mastra 0.1.57-unstable.56 → 0.1.57-unstable.57
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/commands/deploy/deployer.d.ts +4 -2
- package/dist/commands/deploy/deployer.d.ts.map +1 -1
- package/dist/commands/deploy/deployer.js +4 -4
- package/dist/commands/deploy/index.d.ts +2 -1
- package/dist/commands/deploy/index.d.ts.map +1 -1
- package/dist/commands/deploy/index.js +2 -2
- package/dist/commands/deploy/vercel/index.d.ts +2 -1
- package/dist/commands/deploy/vercel/index.d.ts.map +1 -1
- package/dist/commands/deploy/vercel/index.js +2 -1
- package/dist/commands/dev.d.ts +1 -7
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +33 -15
- package/dist/index.js +3 -1
- package/dist/templates/express-server.d.ts.map +1 -1
- package/dist/templates/express-server.js +42 -14
- package/dist/utils/bundle.d.ts +3 -1
- package/dist/utils/bundle.d.ts.map +1 -1
- package/dist/utils/bundle.js +29 -14
- package/package.json +4 -2
- package/src/playground/dist/assets/dark-plus-C3mMm8J8.js +1 -0
- package/src/playground/dist/assets/erb-BgreK6rt.js +1 -0
- package/src/playground/dist/assets/{gdresource-D_y5yz_M.js → gdresource-NFcQ0Q3Z.js} +1 -1
- package/src/playground/dist/assets/gdscript-BVlVXSjx.js +1 -0
- package/src/playground/dist/assets/index-DY22QVI1.js +389 -0
- package/src/playground/dist/assets/index-Dx4A5Op9.js +13 -0
- package/src/playground/dist/assets/light-plus-B7mTdjB0.js +1 -0
- package/src/playground/dist/assets/{monokai-CQWsIgnU.js → monokai-D4h5O-jR.js} +1 -1
- package/src/playground/dist/assets/prisma-CZzQMiei.js +1 -0
- package/src/playground/dist/assets/red-bN70gL4F.js +1 -0
- package/src/playground/dist/assets/rst-BCmapc_q.js +1 -0
- package/src/playground/dist/assets/ruby-DsC6krmi.js +1 -0
- package/src/playground/dist/assets/{solarized-dark-CmY0Y6Yh.js → solarized-dark-DXbdFlpD.js} +1 -1
- package/src/playground/dist/assets/{solarized-light-DZQMDcrx.js → solarized-light-L9t79GZl.js} +1 -1
- package/src/playground/dist/assets/style-7CS44jOg.css +1 -0
- package/src/playground/dist/assets/twig-CvAdjvFj.js +1 -0
- package/src/playground/dist/index.html +2 -2
- package/src/playground/dist/assets/dark-plus-B74Y8nHz.js +0 -1
- package/src/playground/dist/assets/erb-DuefeV9w.js +0 -1
- package/src/playground/dist/assets/gdscript-BIguuW30.js +0 -1
- package/src/playground/dist/assets/index-CzqDlQul.js +0 -13
- package/src/playground/dist/assets/index-qFy09kRJ.js +0 -360
- package/src/playground/dist/assets/light-plus-w1el_4yc.js +0 -1
- package/src/playground/dist/assets/prisma-DFIOpqzz.js +0 -1
- package/src/playground/dist/assets/red-2pWuV6-S.js +0 -1
- package/src/playground/dist/assets/rst-BtGMdPX_.js +0 -1
- package/src/playground/dist/assets/ruby-C8Yez0Ov.js +0 -1
- package/src/playground/dist/assets/style-x_8NJ6Q9.css +0 -1
- package/src/playground/dist/assets/twig-DN6YEzOP.js +0 -1
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
var Gz=Object.defineProperty;var Zz=(e,t,n)=>t in e?Gz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var un=(e,t,n)=>Zz(e,typeof t!="symbol"?t+"":t,n);function Kz(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Kl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qy={exports:{}},Zu={},Jy={exports:{}},ht={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var iC;function Xz(){if(iC)return ht;iC=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function p(U){return U===null||typeof U!="object"?null:(U=h&&U[h]||U["@@iterator"],typeof U=="function"?U:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function k(U,V,D){this.props=U,this.context=V,this.refs=x,this.updater=D||m}k.prototype.isReactComponent={},k.prototype.setState=function(U,V){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,V,"setState")},k.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function w(){}w.prototype=k.prototype;function E(U,V,D){this.props=U,this.context=V,this.refs=x,this.updater=D||m}var C=E.prototype=new w;C.constructor=E,y(C,k.prototype),C.isPureReactComponent=!0;var N=Array.isArray,P=Object.prototype.hasOwnProperty,A={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function M(U,V,D){var G,K={},J=null,ee=null;if(V!=null)for(G in V.ref!==void 0&&(ee=V.ref),V.key!==void 0&&(J=""+V.key),V)P.call(V,G)&&!O.hasOwnProperty(G)&&(K[G]=V[G]);var re=arguments.length-2;if(re===1)K.children=D;else if(1<re){for(var ue=Array(re),he=0;he<re;he++)ue[he]=arguments[he+2];K.children=ue}if(U&&U.defaultProps)for(G in re=U.defaultProps,re)K[G]===void 0&&(K[G]=re[G]);return{$$typeof:e,type:U,key:J,ref:ee,props:K,_owner:A.current}}function j(U,V){return{$$typeof:e,type:U.type,key:V,ref:U.ref,props:U.props,_owner:U._owner}}function R(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function $(U){var V={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(D){return V[D]})}var F=/\/+/g;function H(U,V){return typeof U=="object"&&U!==null&&U.key!=null?$(""+U.key):V.toString(36)}function I(U,V,D,G,K){var J=typeof U;(J==="undefined"||J==="boolean")&&(U=null);var ee=!1;if(U===null)ee=!0;else switch(J){case"string":case"number":ee=!0;break;case"object":switch(U.$$typeof){case e:case t:ee=!0}}if(ee)return ee=U,K=K(ee),U=G===""?"."+H(ee,0):G,N(K)?(D="",U!=null&&(D=U.replace(F,"$&/")+"/"),I(K,V,D,"",function(he){return he})):K!=null&&(R(K)&&(K=j(K,D+(!K.key||ee&&ee.key===K.key?"":(""+K.key).replace(F,"$&/")+"/")+U)),V.push(K)),1;if(ee=0,G=G===""?".":G+":",N(U))for(var re=0;re<U.length;re++){J=U[re];var ue=G+H(J,re);ee+=I(J,V,D,ue,K)}else if(ue=p(U),typeof ue=="function")for(U=ue.call(U),re=0;!(J=U.next()).done;)J=J.value,ue=G+H(J,re++),ee+=I(J,V,D,ue,K);else if(J==="object")throw V=String(U),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return ee}function q(U,V,D){if(U==null)return U;var G=[],K=0;return I(U,G,"","",function(J){return V.call(D,J,K++)}),G}function Y(U){if(U._status===-1){var V=U._result;V=V(),V.then(function(D){(U._status===0||U._status===-1)&&(U._status=1,U._result=D)},function(D){(U._status===0||U._status===-1)&&(U._status=2,U._result=D)}),U._status===-1&&(U._status=0,U._result=V)}if(U._status===1)return U._result.default;throw U._result}var Z={current:null},B={transition:null},W={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:B,ReactCurrentOwner:A};function L(){throw Error("act(...) is not supported in production builds of React.")}return ht.Children={map:q,forEach:function(U,V,D){q(U,function(){V.apply(this,arguments)},D)},count:function(U){var V=0;return q(U,function(){V++}),V},toArray:function(U){return q(U,function(V){return V})||[]},only:function(U){if(!R(U))throw Error("React.Children.only expected to receive a single React element child.");return U}},ht.Component=k,ht.Fragment=n,ht.Profiler=i,ht.PureComponent=E,ht.StrictMode=r,ht.Suspense=u,ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W,ht.act=L,ht.cloneElement=function(U,V,D){if(U==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+U+".");var G=y({},U.props),K=U.key,J=U.ref,ee=U._owner;if(V!=null){if(V.ref!==void 0&&(J=V.ref,ee=A.current),V.key!==void 0&&(K=""+V.key),U.type&&U.type.defaultProps)var re=U.type.defaultProps;for(ue in V)P.call(V,ue)&&!O.hasOwnProperty(ue)&&(G[ue]=V[ue]===void 0&&re!==void 0?re[ue]:V[ue])}var ue=arguments.length-2;if(ue===1)G.children=D;else if(1<ue){re=Array(ue);for(var he=0;he<ue;he++)re[he]=arguments[he+2];G.children=re}return{$$typeof:e,type:U.type,key:K,ref:J,props:G,_owner:ee}},ht.createContext=function(U){return U={$$typeof:s,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},U.Provider={$$typeof:o,_context:U},U.Consumer=U},ht.createElement=M,ht.createFactory=function(U){var V=M.bind(null,U);return V.type=U,V},ht.createRef=function(){return{current:null}},ht.forwardRef=function(U){return{$$typeof:a,render:U}},ht.isValidElement=R,ht.lazy=function(U){return{$$typeof:f,_payload:{_status:-1,_result:U},_init:Y}},ht.memo=function(U,V){return{$$typeof:c,type:U,compare:V===void 0?null:V}},ht.startTransition=function(U){var V=B.transition;B.transition={};try{U()}finally{B.transition=V}},ht.unstable_act=L,ht.useCallback=function(U,V){return Z.current.useCallback(U,V)},ht.useContext=function(U){return Z.current.useContext(U)},ht.useDebugValue=function(){},ht.useDeferredValue=function(U){return Z.current.useDeferredValue(U)},ht.useEffect=function(U,V){return Z.current.useEffect(U,V)},ht.useId=function(){return Z.current.useId()},ht.useImperativeHandle=function(U,V,D){return Z.current.useImperativeHandle(U,V,D)},ht.useInsertionEffect=function(U,V){return Z.current.useInsertionEffect(U,V)},ht.useLayoutEffect=function(U,V){return Z.current.useLayoutEffect(U,V)},ht.useMemo=function(U,V){return Z.current.useMemo(U,V)},ht.useReducer=function(U,V,D){return Z.current.useReducer(U,V,D)},ht.useRef=function(U){return Z.current.useRef(U)},ht.useState=function(U){return Z.current.useState(U)},ht.useSyncExternalStore=function(U,V,D){return Z.current.useSyncExternalStore(U,V,D)},ht.useTransition=function(){return Z.current.useTransition()},ht.version="18.3.1",ht}var oC;function Xl(){return oC||(oC=1,Jy.exports=Xz()),Jy.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var sC;function Qz(){if(sC)return Zu;sC=1;var e=Xl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,u,c){var f,h={},p=null,m=null;c!==void 0&&(p=""+c),u.key!==void 0&&(p=""+u.key),u.ref!==void 0&&(m=u.ref);for(f in u)r.call(u,f)&&!o.hasOwnProperty(f)&&(h[f]=u[f]);if(a&&a.defaultProps)for(f in u=a.defaultProps,u)h[f]===void 0&&(h[f]=u[f]);return{$$typeof:t,type:a,key:p,ref:m,props:h,_owner:i.current}}return Zu.Fragment=n,Zu.jsx=s,Zu.jsxs=s,Zu}var aC;function Jz(){return aC||(aC=1,Qy.exports=Qz()),Qy.exports}var v=Jz(),S=Xl();const ne=Kl(S),e$=Kz({__proto__:null,default:ne},[S]);var mh={},ev={exports:{}},ar={},tv={exports:{}},nv={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var lC;function t$(){return lC||(lC=1,function(e){function t(B,W){var L=B.length;B.push(W);e:for(;0<L;){var U=L-1>>>1,V=B[U];if(0<i(V,W))B[U]=W,B[L]=V,L=U;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var W=B[0],L=B.pop();if(L!==W){B[0]=L;e:for(var U=0,V=B.length,D=V>>>1;U<D;){var G=2*(U+1)-1,K=B[G],J=G+1,ee=B[J];if(0>i(K,L))J<V&&0>i(ee,K)?(B[U]=ee,B[J]=L,U=J):(B[U]=K,B[G]=L,U=G);else if(J<V&&0>i(ee,L))B[U]=ee,B[J]=L,U=J;else break e}}return W}function i(B,W){var L=B.sortIndex-W.sortIndex;return L!==0?L:B.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],c=[],f=1,h=null,p=3,m=!1,y=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(B){for(var W=n(c);W!==null;){if(W.callback===null)r(c);else if(W.startTime<=B)r(c),W.sortIndex=W.expirationTime,t(u,W);else break;W=n(c)}}function N(B){if(x=!1,C(B),!y)if(n(u)!==null)y=!0,Y(P);else{var W=n(c);W!==null&&Z(N,W.startTime-B)}}function P(B,W){y=!1,x&&(x=!1,w(M),M=-1),m=!0;var L=p;try{for(C(W),h=n(u);h!==null&&(!(h.expirationTime>W)||B&&!$());){var U=h.callback;if(typeof U=="function"){h.callback=null,p=h.priorityLevel;var V=U(h.expirationTime<=W);W=e.unstable_now(),typeof V=="function"?h.callback=V:h===n(u)&&r(u),C(W)}else r(u);h=n(u)}if(h!==null)var D=!0;else{var G=n(c);G!==null&&Z(N,G.startTime-W),D=!1}return D}finally{h=null,p=L,m=!1}}var A=!1,O=null,M=-1,j=5,R=-1;function $(){return!(e.unstable_now()-R<j)}function F(){if(O!==null){var B=e.unstable_now();R=B;var W=!0;try{W=O(!0,B)}finally{W?H():(A=!1,O=null)}}else A=!1}var H;if(typeof E=="function")H=function(){E(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,q=I.port2;I.port1.onmessage=F,H=function(){q.postMessage(null)}}else H=function(){k(F,0)};function Y(B){O=B,A||(A=!0,H())}function Z(B,W){M=k(function(){B(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,Y(P))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(B){switch(p){case 1:case 2:case 3:var W=3;break;default:W=p}var L=p;p=W;try{return B()}finally{p=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,W){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var L=p;p=B;try{return W()}finally{p=L}},e.unstable_scheduleCallback=function(B,W,L){var U=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?U+L:U):L=U,B){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=L+V,B={id:f++,callback:W,priorityLevel:B,startTime:L,expirationTime:V,sortIndex:-1},L>U?(B.sortIndex=L,t(c,B),n(u)===null&&B===n(c)&&(x?(w(M),M=-1):x=!0,Z(N,L-U))):(B.sortIndex=V,t(u,B),y||m||(y=!0,Y(P))),B},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(B){var W=p;return function(){var L=p;p=W;try{return B.apply(this,arguments)}finally{p=L}}}}(nv)),nv}var uC;function n$(){return uC||(uC=1,tv.exports=t$()),tv.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var cC;function r$(){if(cC)return ar;cC=1;var e=Xl(),t=n$();function n(l){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(l,d){s(l,d),s(l+"Capture",d)}function s(l,d){for(i[l]=d,l=0;l<d.length;l++)r.add(d[l])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,c=/^[: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]*$/,f={},h={};function p(l){return u.call(h,l)?!0:u.call(f,l)?!1:c.test(l)?h[l]=!0:(f[l]=!0,!1)}function m(l,d,g,b){if(g!==null&&g.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return b?!1:g!==null?!g.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,d,g,b){if(d===null||typeof d>"u"||m(l,d,g,b))return!0;if(b)return!1;if(g!==null)switch(g.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function x(l,d,g,b,_,T,z){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=b,this.attributeNamespace=_,this.mustUseProperty=g,this.propertyName=l,this.type=d,this.sanitizeURL=T,this.removeEmptyString=z}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){k[l]=new x(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var d=l[0];k[d]=new x(d,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){k[l]=new x(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){k[l]=new x(l,2,!1,l,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(l){k[l]=new x(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){k[l]=new x(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){k[l]=new x(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){k[l]=new x(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){k[l]=new x(l,5,!1,l.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function E(l){return l[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(l){var d=l.replace(w,E);k[d]=new x(d,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var d=l.replace(w,E);k[d]=new x(d,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var d=l.replace(w,E);k[d]=new x(d,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){k[l]=new x(l,1,!1,l.toLowerCase(),null,!1,!1)}),k.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){k[l]=new x(l,1,!1,l.toLowerCase(),null,!0,!0)});function C(l,d,g,b){var _=k.hasOwnProperty(d)?k[d]:null;(_!==null?_.type!==0:b||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(y(d,g,_,b)&&(g=null),b||_===null?p(d)&&(g===null?l.removeAttribute(d):l.setAttribute(d,""+g)):_.mustUseProperty?l[_.propertyName]=g===null?_.type===3?!1:"":g:(d=_.attributeName,b=_.attributeNamespace,g===null?l.removeAttribute(d):(_=_.type,g=_===3||_===4&&g===!0?"":""+g,b?l.setAttributeNS(b,d,g):l.setAttribute(d,g))))}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),A=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),$=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),B=Symbol.iterator;function W(l){return l===null||typeof l!="object"?null:(l=B&&l[B]||l["@@iterator"],typeof l=="function"?l:null)}var L=Object.assign,U;function V(l){if(U===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);U=d&&d[1]||""}return`
|
|
34
|
+
`+U+l}var D=!1;function G(l,d){if(!l||D)return"";D=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(de){var b=de}Reflect.construct(l,[],d)}else{try{d.call()}catch(de){b=de}l.call(d.prototype)}else{try{throw Error()}catch(de){b=de}l()}}catch(de){if(de&&b&&typeof de.stack=="string"){for(var _=de.stack.split(`
|
|
35
|
+
`),T=b.stack.split(`
|
|
36
|
+
`),z=_.length-1,X=T.length-1;1<=z&&0<=X&&_[z]!==T[X];)X--;for(;1<=z&&0<=X;z--,X--)if(_[z]!==T[X]){if(z!==1||X!==1)do if(z--,X--,0>X||_[z]!==T[X]){var te=`
|
|
37
|
+
`+_[z].replace(" at new "," at ");return l.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",l.displayName)),te}while(1<=z&&0<=X);break}}}finally{D=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?V(l):""}function K(l){switch(l.tag){case 5:return V(l.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return l=G(l.type,!1),l;case 11:return l=G(l.type.render,!1),l;case 1:return l=G(l.type,!0),l;default:return""}}function J(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case O:return"Fragment";case A:return"Portal";case j:return"Profiler";case M:return"StrictMode";case H:return"Suspense";case I:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case $:return(l.displayName||"Context")+".Consumer";case R:return(l._context.displayName||"Context")+".Provider";case F:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case q:return d=l.displayName||null,d!==null?d:J(l.type)||"Memo";case Y:d=l._payload,l=l._init;try{return J(l(d))}catch{}}return null}function ee(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return J(d);case 8:return d===M?"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 d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function re(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ue(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function he(l){var d=ue(l)?"checked":"value",g=Object.getOwnPropertyDescriptor(l.constructor.prototype,d),b=""+l[d];if(!l.hasOwnProperty(d)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var _=g.get,T=g.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return _.call(this)},set:function(z){b=""+z,T.call(this,z)}}),Object.defineProperty(l,d,{enumerable:g.enumerable}),{getValue:function(){return b},setValue:function(z){b=""+z},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function ke(l){l._valueTracker||(l._valueTracker=he(l))}function fe(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var g=d.getValue(),b="";return l&&(b=ue(l)?l.checked?"true":"false":l.value),l=b,l!==g?(d.setValue(l),!0):!1}function ve(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Me(l,d){var g=d.checked;return L({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:g??l._wrapperState.initialChecked})}function $e(l,d){var g=d.defaultValue==null?"":d.defaultValue,b=d.checked!=null?d.checked:d.defaultChecked;g=re(d.value!=null?d.value:g),l._wrapperState={initialChecked:b,initialValue:g,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function ct(l,d){d=d.checked,d!=null&&C(l,"checked",d,!1)}function _t(l,d){ct(l,d);var g=re(d.value),b=d.type;if(g!=null)b==="number"?(g===0&&l.value===""||l.value!=g)&&(l.value=""+g):l.value!==""+g&&(l.value=""+g);else if(b==="submit"||b==="reset"){l.removeAttribute("value");return}d.hasOwnProperty("value")?oe(l,d.type,g):d.hasOwnProperty("defaultValue")&&oe(l,d.type,re(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(l.defaultChecked=!!d.defaultChecked)}function Q(l,d,g){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var b=d.type;if(!(b!=="submit"&&b!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+l._wrapperState.initialValue,g||d===l.value||(l.value=d),l.defaultValue=d}g=l.name,g!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,g!==""&&(l.name=g)}function oe(l,d,g){(d!=="number"||ve(l.ownerDocument)!==l)&&(g==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+g&&(l.defaultValue=""+g))}var ae=Array.isArray;function Ce(l,d,g,b){if(l=l.options,d){d={};for(var _=0;_<g.length;_++)d["$"+g[_]]=!0;for(g=0;g<l.length;g++)_=d.hasOwnProperty("$"+l[g].value),l[g].selected!==_&&(l[g].selected=_),_&&b&&(l[g].defaultSelected=!0)}else{for(g=""+re(g),d=null,_=0;_<l.length;_++){if(l[_].value===g){l[_].selected=!0,b&&(l[_].defaultSelected=!0);return}d!==null||l[_].disabled||(d=l[_])}d!==null&&(d.selected=!0)}}function we(l,d){if(d.dangerouslySetInnerHTML!=null)throw Error(n(91));return L({},d,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function me(l,d){var g=d.value;if(g==null){if(g=d.children,d=d.defaultValue,g!=null){if(d!=null)throw Error(n(92));if(ae(g)){if(1<g.length)throw Error(n(93));g=g[0]}d=g}d==null&&(d=""),g=d}l._wrapperState={initialValue:re(g)}}function Ae(l,d){var g=re(d.value),b=re(d.defaultValue);g!=null&&(g=""+g,g!==l.value&&(l.value=g),d.defaultValue==null&&l.defaultValue!==g&&(l.defaultValue=g)),b!=null&&(l.defaultValue=""+b)}function Fe(l){var d=l.textContent;d===l._wrapperState.initialValue&&d!==""&&d!==null&&(l.value=d)}function ce(l){switch(l){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 pe(l,d){return l==null||l==="http://www.w3.org/1999/xhtml"?ce(d):l==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Ie,Ke=function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,g,b,_){MSApp.execUnsafeLocalFunction(function(){return l(d,g,b,_)})}:l}(function(l,d){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=d;else{for(Ie=Ie||document.createElement("div"),Ie.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=Ie.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function tt(l,d){if(d){var g=l.firstChild;if(g&&g===l.lastChild&&g.nodeType===3){g.nodeValue=d;return}}l.textContent=d}var At={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},He=["Webkit","ms","Moz","O"];Object.keys(At).forEach(function(l){He.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),At[d]=At[l]})});function it(l,d,g){return d==null||typeof d=="boolean"||d===""?"":g||typeof d!="number"||d===0||At.hasOwnProperty(l)&&At[l]?(""+d).trim():d+"px"}function at(l,d){l=l.style;for(var g in d)if(d.hasOwnProperty(g)){var b=g.indexOf("--")===0,_=it(g,d[g],b);g==="float"&&(g="cssFloat"),b?l.setProperty(g,_):l[g]=_}}var Wt=L({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 yt(l,d){if(d){if(Wt[l]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function yn(l,d){if(l.indexOf("-")===-1)return typeof d.is=="string";switch(l){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 gt=null;function Lt(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var ft=null,Ye=null,dt=null;function Ct(l){if(l=Ou(l)){if(typeof ft!="function")throw Error(n(280));var d=l.stateNode;d&&(d=Pf(d),ft(l.stateNode,l.type,d))}}function nn(l){Ye?dt?dt.push(l):dt=[l]:Ye=l}function vn(){if(Ye){var l=Ye,d=dt;if(dt=Ye=null,Ct(l),d)for(l=0;l<d.length;l++)Ct(d[l])}}function Yi(l,d){return l(d)}function Sa(){}var fu=!1;function of(l,d,g){if(fu)return l(d,g);fu=!0;try{return Yi(l,d,g)}finally{fu=!1,(Ye!==null||dt!==null)&&(Sa(),vn())}}function As(l,d){var g=l.stateNode;if(g===null)return null;var b=Pf(g);if(b===null)return null;g=b[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(l=l.type,b=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!b;break e;default:l=!1}if(l)return null;if(g&&typeof g!="function")throw Error(n(231,d,typeof g));return g}var hu=!1;if(a)try{var Ps={};Object.defineProperty(Ps,"passive",{get:function(){hu=!0}}),window.addEventListener("test",Ps,Ps),window.removeEventListener("test",Ps,Ps)}catch{hu=!1}function lg(l,d,g,b,_,T,z,X,te){var de=Array.prototype.slice.call(arguments,3);try{d.apply(g,de)}catch(xe){this.onError(xe)}}var Rs=!1,Ea=null,Ca=!1,pu=null,ug={onError:function(l){Rs=!0,Ea=l}};function cg(l,d,g,b,_,T,z,X,te){Rs=!1,Ea=null,lg.apply(ug,arguments)}function sf(l,d,g,b,_,T,z,X,te){if(cg.apply(this,arguments),Rs){if(Rs){var de=Ea;Rs=!1,Ea=null}else throw Error(n(198));Ca||(Ca=!0,pu=de)}}function vi(l){var d=l,g=l;if(l.alternate)for(;d.return;)d=d.return;else{l=d;do d=l,d.flags&4098&&(g=d.return),l=d.return;while(l)}return d.tag===3?g:null}function af(l){if(l.tag===13){var d=l.memoizedState;if(d===null&&(l=l.alternate,l!==null&&(d=l.memoizedState)),d!==null)return d.dehydrated}return null}function lf(l){if(vi(l)!==l)throw Error(n(188))}function dg(l){var d=l.alternate;if(!d){if(d=vi(l),d===null)throw Error(n(188));return d!==l?null:l}for(var g=l,b=d;;){var _=g.return;if(_===null)break;var T=_.alternate;if(T===null){if(b=_.return,b!==null){g=b;continue}break}if(_.child===T.child){for(T=_.child;T;){if(T===g)return lf(_),l;if(T===b)return lf(_),d;T=T.sibling}throw Error(n(188))}if(g.return!==b.return)g=_,b=T;else{for(var z=!1,X=_.child;X;){if(X===g){z=!0,g=_,b=T;break}if(X===b){z=!0,b=_,g=T;break}X=X.sibling}if(!z){for(X=T.child;X;){if(X===g){z=!0,g=T,b=_;break}if(X===b){z=!0,b=T,g=_;break}X=X.sibling}if(!z)throw Error(n(189))}}if(g.alternate!==b)throw Error(n(190))}if(g.tag!==3)throw Error(n(188));return g.stateNode.current===g?l:d}function uf(l){return l=dg(l),l!==null?cf(l):null}function cf(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var d=cf(l);if(d!==null)return d;l=l.sibling}return null}var df=t.unstable_scheduleCallback,ff=t.unstable_cancelCallback,hf=t.unstable_shouldYield,fg=t.unstable_requestPaint,Gt=t.unstable_now,hg=t.unstable_getCurrentPriorityLevel,mu=t.unstable_ImmediatePriority,pf=t.unstable_UserBlockingPriority,_a=t.unstable_NormalPriority,pg=t.unstable_LowPriority,gu=t.unstable_IdlePriority,Na=null,Dr=null;function mg(l){if(Dr&&typeof Dr.onCommitFiberRoot=="function")try{Dr.onCommitFiberRoot(Na,l,void 0,(l.current.flags&128)===128)}catch{}}var pr=Math.clz32?Math.clz32:vg,gg=Math.log,yg=Math.LN2;function vg(l){return l>>>=0,l===0?32:31-(gg(l)/yg|0)|0}var Ta=64,Aa=4194304;function qi(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Pa(l,d){var g=l.pendingLanes;if(g===0)return 0;var b=0,_=l.suspendedLanes,T=l.pingedLanes,z=g&268435455;if(z!==0){var X=z&~_;X!==0?b=qi(X):(T&=z,T!==0&&(b=qi(T)))}else z=g&~_,z!==0?b=qi(z):T!==0&&(b=qi(T));if(b===0)return 0;if(d!==0&&d!==b&&!(d&_)&&(_=b&-b,T=d&-d,_>=T||_===16&&(T&4194240)!==0))return d;if(b&4&&(b|=g&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=b;0<d;)g=31-pr(d),_=1<<g,b|=l[g],d&=~_;return b}function h3(l,d){switch(l){case 1:case 2:case 4:return d+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 d+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 p3(l,d){for(var g=l.suspendedLanes,b=l.pingedLanes,_=l.expirationTimes,T=l.pendingLanes;0<T;){var z=31-pr(T),X=1<<z,te=_[z];te===-1?(!(X&g)||X&b)&&(_[z]=h3(X,d)):te<=d&&(l.expiredLanes|=X),T&=~X}}function xg(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Ik(){var l=Ta;return Ta<<=1,!(Ta&4194240)&&(Ta=64),l}function wg(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function yu(l,d,g){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-pr(d),l[d]=g}function m3(l,d){var g=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var b=l.eventTimes;for(l=l.expirationTimes;0<g;){var _=31-pr(g),T=1<<_;d[_]=0,b[_]=-1,l[_]=-1,g&=~T}}function bg(l,d){var g=l.entangledLanes|=d;for(l=l.entanglements;g;){var b=31-pr(g),_=1<<b;_&d|l[b]&d&&(l[b]|=d),g&=~_}}var Nt=0;function jk(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var Lk,kg,Fk,zk,$k,Sg=!1,mf=[],Mo=null,Do=null,Oo=null,vu=new Map,xu=new Map,Io=[],g3="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 Bk(l,d){switch(l){case"focusin":case"focusout":Mo=null;break;case"dragenter":case"dragleave":Do=null;break;case"mouseover":case"mouseout":Oo=null;break;case"pointerover":case"pointerout":vu.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":xu.delete(d.pointerId)}}function wu(l,d,g,b,_,T){return l===null||l.nativeEvent!==T?(l={blockedOn:d,domEventName:g,eventSystemFlags:b,nativeEvent:T,targetContainers:[_]},d!==null&&(d=Ou(d),d!==null&&kg(d)),l):(l.eventSystemFlags|=b,d=l.targetContainers,_!==null&&d.indexOf(_)===-1&&d.push(_),l)}function y3(l,d,g,b,_){switch(d){case"focusin":return Mo=wu(Mo,l,d,g,b,_),!0;case"dragenter":return Do=wu(Do,l,d,g,b,_),!0;case"mouseover":return Oo=wu(Oo,l,d,g,b,_),!0;case"pointerover":var T=_.pointerId;return vu.set(T,wu(vu.get(T)||null,l,d,g,b,_)),!0;case"gotpointercapture":return T=_.pointerId,xu.set(T,wu(xu.get(T)||null,l,d,g,b,_)),!0}return!1}function Vk(l){var d=Ms(l.target);if(d!==null){var g=vi(d);if(g!==null){if(d=g.tag,d===13){if(d=af(g),d!==null){l.blockedOn=d,$k(l.priority,function(){Fk(g)});return}}else if(d===3&&g.stateNode.current.memoizedState.isDehydrated){l.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}l.blockedOn=null}function gf(l){if(l.blockedOn!==null)return!1;for(var d=l.targetContainers;0<d.length;){var g=Cg(l.domEventName,l.eventSystemFlags,d[0],l.nativeEvent);if(g===null){g=l.nativeEvent;var b=new g.constructor(g.type,g);gt=b,g.target.dispatchEvent(b),gt=null}else return d=Ou(g),d!==null&&kg(d),l.blockedOn=g,!1;d.shift()}return!0}function Wk(l,d,g){gf(l)&&g.delete(d)}function v3(){Sg=!1,Mo!==null&&gf(Mo)&&(Mo=null),Do!==null&&gf(Do)&&(Do=null),Oo!==null&&gf(Oo)&&(Oo=null),vu.forEach(Wk),xu.forEach(Wk)}function bu(l,d){l.blockedOn===d&&(l.blockedOn=null,Sg||(Sg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,v3)))}function ku(l){function d(_){return bu(_,l)}if(0<mf.length){bu(mf[0],l);for(var g=1;g<mf.length;g++){var b=mf[g];b.blockedOn===l&&(b.blockedOn=null)}}for(Mo!==null&&bu(Mo,l),Do!==null&&bu(Do,l),Oo!==null&&bu(Oo,l),vu.forEach(d),xu.forEach(d),g=0;g<Io.length;g++)b=Io[g],b.blockedOn===l&&(b.blockedOn=null);for(;0<Io.length&&(g=Io[0],g.blockedOn===null);)Vk(g),g.blockedOn===null&&Io.shift()}var Ra=N.ReactCurrentBatchConfig,yf=!0;function x3(l,d,g,b){var _=Nt,T=Ra.transition;Ra.transition=null;try{Nt=1,Eg(l,d,g,b)}finally{Nt=_,Ra.transition=T}}function w3(l,d,g,b){var _=Nt,T=Ra.transition;Ra.transition=null;try{Nt=4,Eg(l,d,g,b)}finally{Nt=_,Ra.transition=T}}function Eg(l,d,g,b){if(yf){var _=Cg(l,d,g,b);if(_===null)Vg(l,d,b,vf,g),Bk(l,b);else if(y3(_,l,d,g,b))b.stopPropagation();else if(Bk(l,b),d&4&&-1<g3.indexOf(l)){for(;_!==null;){var T=Ou(_);if(T!==null&&Lk(T),T=Cg(l,d,g,b),T===null&&Vg(l,d,b,vf,g),T===_)break;_=T}_!==null&&b.stopPropagation()}else Vg(l,d,b,null,g)}}var vf=null;function Cg(l,d,g,b){if(vf=null,l=Lt(b),l=Ms(l),l!==null)if(d=vi(l),d===null)l=null;else if(g=d.tag,g===13){if(l=af(d),l!==null)return l;l=null}else if(g===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;l=null}else d!==l&&(l=null);return vf=l,null}function Uk(l){switch(l){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(hg()){case mu:return 1;case pf:return 4;case _a:case pg:return 16;case gu:return 536870912;default:return 16}default:return 16}}var jo=null,_g=null,xf=null;function Hk(){if(xf)return xf;var l,d=_g,g=d.length,b,_="value"in jo?jo.value:jo.textContent,T=_.length;for(l=0;l<g&&d[l]===_[l];l++);var z=g-l;for(b=1;b<=z&&d[g-b]===_[T-b];b++);return xf=_.slice(l,1<b?1-b:void 0)}function wf(l){var d=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&d===13&&(l=13)):l=d,l===10&&(l=13),32<=l||l===13?l:0}function bf(){return!0}function Yk(){return!1}function mr(l){function d(g,b,_,T,z){this._reactName=g,this._targetInst=_,this.type=b,this.nativeEvent=T,this.target=z,this.currentTarget=null;for(var X in l)l.hasOwnProperty(X)&&(g=l[X],this[X]=g?g(T):T[X]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?bf:Yk,this.isPropagationStopped=Yk,this}return L(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=bf)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=bf)},persist:function(){},isPersistent:bf}),d}var Ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ng=mr(Ma),Su=L({},Ma,{view:0,detail:0}),b3=mr(Su),Tg,Ag,Eu,kf=L({},Su,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rg,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Eu&&(Eu&&l.type==="mousemove"?(Tg=l.screenX-Eu.screenX,Ag=l.screenY-Eu.screenY):Ag=Tg=0,Eu=l),Tg)},movementY:function(l){return"movementY"in l?l.movementY:Ag}}),qk=mr(kf),k3=L({},kf,{dataTransfer:0}),S3=mr(k3),E3=L({},Su,{relatedTarget:0}),Pg=mr(E3),C3=L({},Ma,{animationName:0,elapsedTime:0,pseudoElement:0}),_3=mr(C3),N3=L({},Ma,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),T3=mr(N3),A3=L({},Ma,{data:0}),Gk=mr(A3),P3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},R3={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"},M3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D3(l){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(l):(l=M3[l])?!!d[l]:!1}function Rg(){return D3}var O3=L({},Su,{key:function(l){if(l.key){var d=P3[l.key]||l.key;if(d!=="Unidentified")return d}return l.type==="keypress"?(l=wf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?R3[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rg,charCode:function(l){return l.type==="keypress"?wf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?wf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),I3=mr(O3),j3=L({},kf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zk=mr(j3),L3=L({},Su,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rg}),F3=mr(L3),z3=L({},Ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),$3=mr(z3),B3=L({},kf,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),V3=mr(B3),W3=[9,13,27,32],Mg=a&&"CompositionEvent"in window,Cu=null;a&&"documentMode"in document&&(Cu=document.documentMode);var U3=a&&"TextEvent"in window&&!Cu,Kk=a&&(!Mg||Cu&&8<Cu&&11>=Cu),Xk=" ",Qk=!1;function Jk(l,d){switch(l){case"keyup":return W3.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eS(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Da=!1;function H3(l,d){switch(l){case"compositionend":return eS(d);case"keypress":return d.which!==32?null:(Qk=!0,Xk);case"textInput":return l=d.data,l===Xk&&Qk?null:l;default:return null}}function Y3(l,d){if(Da)return l==="compositionend"||!Mg&&Jk(l,d)?(l=Hk(),xf=_g=jo=null,Da=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return Kk&&d.locale!=="ko"?null:d.data;default:return null}}var q3={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 tS(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d==="input"?!!q3[l.type]:d==="textarea"}function nS(l,d,g,b){nn(b),d=Nf(d,"onChange"),0<d.length&&(g=new Ng("onChange","change",null,g,b),l.push({event:g,listeners:d}))}var _u=null,Nu=null;function G3(l){wS(l,0)}function Sf(l){var d=Fa(l);if(fe(d))return l}function Z3(l,d){if(l==="change")return d}var rS=!1;if(a){var Dg;if(a){var Og="oninput"in document;if(!Og){var iS=document.createElement("div");iS.setAttribute("oninput","return;"),Og=typeof iS.oninput=="function"}Dg=Og}else Dg=!1;rS=Dg&&(!document.documentMode||9<document.documentMode)}function oS(){_u&&(_u.detachEvent("onpropertychange",sS),Nu=_u=null)}function sS(l){if(l.propertyName==="value"&&Sf(Nu)){var d=[];nS(d,Nu,l,Lt(l)),of(G3,d)}}function K3(l,d,g){l==="focusin"?(oS(),_u=d,Nu=g,_u.attachEvent("onpropertychange",sS)):l==="focusout"&&oS()}function X3(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Sf(Nu)}function Q3(l,d){if(l==="click")return Sf(d)}function J3(l,d){if(l==="input"||l==="change")return Sf(d)}function ez(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var Zr=typeof Object.is=="function"?Object.is:ez;function Tu(l,d){if(Zr(l,d))return!0;if(typeof l!="object"||l===null||typeof d!="object"||d===null)return!1;var g=Object.keys(l),b=Object.keys(d);if(g.length!==b.length)return!1;for(b=0;b<g.length;b++){var _=g[b];if(!u.call(d,_)||!Zr(l[_],d[_]))return!1}return!0}function aS(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function lS(l,d){var g=aS(l);l=0;for(var b;g;){if(g.nodeType===3){if(b=l+g.textContent.length,l<=d&&b>=d)return{node:g,offset:d-l};l=b}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=aS(g)}}function uS(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?uS(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function cS(){for(var l=window,d=ve();d instanceof l.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)l=d.contentWindow;else break;d=ve(l.document)}return d}function Ig(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}function tz(l){var d=cS(),g=l.focusedElem,b=l.selectionRange;if(d!==g&&g&&g.ownerDocument&&uS(g.ownerDocument.documentElement,g)){if(b!==null&&Ig(g)){if(d=b.start,l=b.end,l===void 0&&(l=d),"selectionStart"in g)g.selectionStart=d,g.selectionEnd=Math.min(l,g.value.length);else if(l=(d=g.ownerDocument||document)&&d.defaultView||window,l.getSelection){l=l.getSelection();var _=g.textContent.length,T=Math.min(b.start,_);b=b.end===void 0?T:Math.min(b.end,_),!l.extend&&T>b&&(_=b,b=T,T=_),_=lS(g,T);var z=lS(g,b);_&&z&&(l.rangeCount!==1||l.anchorNode!==_.node||l.anchorOffset!==_.offset||l.focusNode!==z.node||l.focusOffset!==z.offset)&&(d=d.createRange(),d.setStart(_.node,_.offset),l.removeAllRanges(),T>b?(l.addRange(d),l.extend(z.node,z.offset)):(d.setEnd(z.node,z.offset),l.addRange(d)))}}for(d=[],l=g;l=l.parentNode;)l.nodeType===1&&d.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<d.length;g++)l=d[g],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var nz=a&&"documentMode"in document&&11>=document.documentMode,Oa=null,jg=null,Au=null,Lg=!1;function dS(l,d,g){var b=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;Lg||Oa==null||Oa!==ve(b)||(b=Oa,"selectionStart"in b&&Ig(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),Au&&Tu(Au,b)||(Au=b,b=Nf(jg,"onSelect"),0<b.length&&(d=new Ng("onSelect","select",null,d,g),l.push({event:d,listeners:b}),d.target=Oa)))}function Ef(l,d){var g={};return g[l.toLowerCase()]=d.toLowerCase(),g["Webkit"+l]="webkit"+d,g["Moz"+l]="moz"+d,g}var Ia={animationend:Ef("Animation","AnimationEnd"),animationiteration:Ef("Animation","AnimationIteration"),animationstart:Ef("Animation","AnimationStart"),transitionend:Ef("Transition","TransitionEnd")},Fg={},fS={};a&&(fS=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Cf(l){if(Fg[l])return Fg[l];if(!Ia[l])return l;var d=Ia[l],g;for(g in d)if(d.hasOwnProperty(g)&&g in fS)return Fg[l]=d[g];return l}var hS=Cf("animationend"),pS=Cf("animationiteration"),mS=Cf("animationstart"),gS=Cf("transitionend"),yS=new Map,vS="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 Lo(l,d){yS.set(l,d),o(d,[l])}for(var zg=0;zg<vS.length;zg++){var $g=vS[zg],rz=$g.toLowerCase(),iz=$g[0].toUpperCase()+$g.slice(1);Lo(rz,"on"+iz)}Lo(hS,"onAnimationEnd"),Lo(pS,"onAnimationIteration"),Lo(mS,"onAnimationStart"),Lo("dblclick","onDoubleClick"),Lo("focusin","onFocus"),Lo("focusout","onBlur"),Lo(gS,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pu="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(" "),oz=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pu));function xS(l,d,g){var b=l.type||"unknown-event";l.currentTarget=g,sf(b,d,void 0,l),l.currentTarget=null}function wS(l,d){d=(d&4)!==0;for(var g=0;g<l.length;g++){var b=l[g],_=b.event;b=b.listeners;e:{var T=void 0;if(d)for(var z=b.length-1;0<=z;z--){var X=b[z],te=X.instance,de=X.currentTarget;if(X=X.listener,te!==T&&_.isPropagationStopped())break e;xS(_,X,de),T=te}else for(z=0;z<b.length;z++){if(X=b[z],te=X.instance,de=X.currentTarget,X=X.listener,te!==T&&_.isPropagationStopped())break e;xS(_,X,de),T=te}}}if(Ca)throw l=pu,Ca=!1,pu=null,l}function Ft(l,d){var g=d[Gg];g===void 0&&(g=d[Gg]=new Set);var b=l+"__bubble";g.has(b)||(bS(d,l,2,!1),g.add(b))}function Bg(l,d,g){var b=0;d&&(b|=4),bS(g,l,b,d)}var _f="_reactListening"+Math.random().toString(36).slice(2);function Ru(l){if(!l[_f]){l[_f]=!0,r.forEach(function(g){g!=="selectionchange"&&(oz.has(g)||Bg(g,!1,l),Bg(g,!0,l))});var d=l.nodeType===9?l:l.ownerDocument;d===null||d[_f]||(d[_f]=!0,Bg("selectionchange",!1,d))}}function bS(l,d,g,b){switch(Uk(d)){case 1:var _=x3;break;case 4:_=w3;break;default:_=Eg}g=_.bind(null,d,g,l),_=void 0,!hu||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(_=!0),b?_!==void 0?l.addEventListener(d,g,{capture:!0,passive:_}):l.addEventListener(d,g,!0):_!==void 0?l.addEventListener(d,g,{passive:_}):l.addEventListener(d,g,!1)}function Vg(l,d,g,b,_){var T=b;if(!(d&1)&&!(d&2)&&b!==null)e:for(;;){if(b===null)return;var z=b.tag;if(z===3||z===4){var X=b.stateNode.containerInfo;if(X===_||X.nodeType===8&&X.parentNode===_)break;if(z===4)for(z=b.return;z!==null;){var te=z.tag;if((te===3||te===4)&&(te=z.stateNode.containerInfo,te===_||te.nodeType===8&&te.parentNode===_))return;z=z.return}for(;X!==null;){if(z=Ms(X),z===null)return;if(te=z.tag,te===5||te===6){b=T=z;continue e}X=X.parentNode}}b=b.return}of(function(){var de=T,xe=Lt(g),be=[];e:{var ye=yS.get(l);if(ye!==void 0){var De=Ng,Le=l;switch(l){case"keypress":if(wf(g)===0)break e;case"keydown":case"keyup":De=I3;break;case"focusin":Le="focus",De=Pg;break;case"focusout":Le="blur",De=Pg;break;case"beforeblur":case"afterblur":De=Pg;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":De=qk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":De=S3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":De=F3;break;case hS:case pS:case mS:De=_3;break;case gS:De=$3;break;case"scroll":De=b3;break;case"wheel":De=V3;break;case"copy":case"cut":case"paste":De=T3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":De=Zk}var ze=(d&4)!==0,rn=!ze&&l==="scroll",se=ze?ye!==null?ye+"Capture":null:ye;ze=[];for(var ie=de,le;ie!==null;){le=ie;var _e=le.stateNode;if(le.tag===5&&_e!==null&&(le=_e,se!==null&&(_e=As(ie,se),_e!=null&&ze.push(Mu(ie,_e,le)))),rn)break;ie=ie.return}0<ze.length&&(ye=new De(ye,Le,null,g,xe),be.push({event:ye,listeners:ze}))}}if(!(d&7)){e:{if(ye=l==="mouseover"||l==="pointerover",De=l==="mouseout"||l==="pointerout",ye&&g!==gt&&(Le=g.relatedTarget||g.fromElement)&&(Ms(Le)||Le[Gi]))break e;if((De||ye)&&(ye=xe.window===xe?xe:(ye=xe.ownerDocument)?ye.defaultView||ye.parentWindow:window,De?(Le=g.relatedTarget||g.toElement,De=de,Le=Le?Ms(Le):null,Le!==null&&(rn=vi(Le),Le!==rn||Le.tag!==5&&Le.tag!==6)&&(Le=null)):(De=null,Le=de),De!==Le)){if(ze=qk,_e="onMouseLeave",se="onMouseEnter",ie="mouse",(l==="pointerout"||l==="pointerover")&&(ze=Zk,_e="onPointerLeave",se="onPointerEnter",ie="pointer"),rn=De==null?ye:Fa(De),le=Le==null?ye:Fa(Le),ye=new ze(_e,ie+"leave",De,g,xe),ye.target=rn,ye.relatedTarget=le,_e=null,Ms(xe)===de&&(ze=new ze(se,ie+"enter",Le,g,xe),ze.target=le,ze.relatedTarget=rn,_e=ze),rn=_e,De&&Le)t:{for(ze=De,se=Le,ie=0,le=ze;le;le=ja(le))ie++;for(le=0,_e=se;_e;_e=ja(_e))le++;for(;0<ie-le;)ze=ja(ze),ie--;for(;0<le-ie;)se=ja(se),le--;for(;ie--;){if(ze===se||se!==null&&ze===se.alternate)break t;ze=ja(ze),se=ja(se)}ze=null}else ze=null;De!==null&&kS(be,ye,De,ze,!1),Le!==null&&rn!==null&&kS(be,rn,Le,ze,!0)}}e:{if(ye=de?Fa(de):window,De=ye.nodeName&&ye.nodeName.toLowerCase(),De==="select"||De==="input"&&ye.type==="file")var Be=Z3;else if(tS(ye))if(rS)Be=J3;else{Be=X3;var qe=K3}else(De=ye.nodeName)&&De.toLowerCase()==="input"&&(ye.type==="checkbox"||ye.type==="radio")&&(Be=Q3);if(Be&&(Be=Be(l,de))){nS(be,Be,g,xe);break e}qe&&qe(l,ye,de),l==="focusout"&&(qe=ye._wrapperState)&&qe.controlled&&ye.type==="number"&&oe(ye,"number",ye.value)}switch(qe=de?Fa(de):window,l){case"focusin":(tS(qe)||qe.contentEditable==="true")&&(Oa=qe,jg=de,Au=null);break;case"focusout":Au=jg=Oa=null;break;case"mousedown":Lg=!0;break;case"contextmenu":case"mouseup":case"dragend":Lg=!1,dS(be,g,xe);break;case"selectionchange":if(nz)break;case"keydown":case"keyup":dS(be,g,xe)}var Ge;if(Mg)e:{switch(l){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else Da?Jk(l,g)&&(rt="onCompositionEnd"):l==="keydown"&&g.keyCode===229&&(rt="onCompositionStart");rt&&(Kk&&g.locale!=="ko"&&(Da||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&Da&&(Ge=Hk()):(jo=xe,_g="value"in jo?jo.value:jo.textContent,Da=!0)),qe=Nf(de,rt),0<qe.length&&(rt=new Gk(rt,l,null,g,xe),be.push({event:rt,listeners:qe}),Ge?rt.data=Ge:(Ge=eS(g),Ge!==null&&(rt.data=Ge)))),(Ge=U3?H3(l,g):Y3(l,g))&&(de=Nf(de,"onBeforeInput"),0<de.length&&(xe=new Gk("onBeforeInput","beforeinput",null,g,xe),be.push({event:xe,listeners:de}),xe.data=Ge))}wS(be,d)})}function Mu(l,d,g){return{instance:l,listener:d,currentTarget:g}}function Nf(l,d){for(var g=d+"Capture",b=[];l!==null;){var _=l,T=_.stateNode;_.tag===5&&T!==null&&(_=T,T=As(l,g),T!=null&&b.unshift(Mu(l,T,_)),T=As(l,d),T!=null&&b.push(Mu(l,T,_))),l=l.return}return b}function ja(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function kS(l,d,g,b,_){for(var T=d._reactName,z=[];g!==null&&g!==b;){var X=g,te=X.alternate,de=X.stateNode;if(te!==null&&te===b)break;X.tag===5&&de!==null&&(X=de,_?(te=As(g,T),te!=null&&z.unshift(Mu(g,te,X))):_||(te=As(g,T),te!=null&&z.push(Mu(g,te,X)))),g=g.return}z.length!==0&&l.push({event:d,listeners:z})}var sz=/\r\n?/g,az=/\u0000|\uFFFD/g;function SS(l){return(typeof l=="string"?l:""+l).replace(sz,`
|
|
38
|
+
`).replace(az,"")}function Tf(l,d,g){if(d=SS(d),SS(l)!==d&&g)throw Error(n(425))}function Af(){}var Wg=null,Ug=null;function Hg(l,d){return l==="textarea"||l==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var Yg=typeof setTimeout=="function"?setTimeout:void 0,lz=typeof clearTimeout=="function"?clearTimeout:void 0,ES=typeof Promise=="function"?Promise:void 0,uz=typeof queueMicrotask=="function"?queueMicrotask:typeof ES<"u"?function(l){return ES.resolve(null).then(l).catch(cz)}:Yg;function cz(l){setTimeout(function(){throw l})}function qg(l,d){var g=d,b=0;do{var _=g.nextSibling;if(l.removeChild(g),_&&_.nodeType===8)if(g=_.data,g==="/$"){if(b===0){l.removeChild(_),ku(d);return}b--}else g!=="$"&&g!=="$?"&&g!=="$!"||b++;g=_}while(g);ku(d)}function Fo(l){for(;l!=null;l=l.nextSibling){var d=l.nodeType;if(d===1||d===3)break;if(d===8){if(d=l.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return l}function CS(l){l=l.previousSibling;for(var d=0;l;){if(l.nodeType===8){var g=l.data;if(g==="$"||g==="$!"||g==="$?"){if(d===0)return l;d--}else g==="/$"&&d++}l=l.previousSibling}return null}var La=Math.random().toString(36).slice(2),xi="__reactFiber$"+La,Du="__reactProps$"+La,Gi="__reactContainer$"+La,Gg="__reactEvents$"+La,dz="__reactListeners$"+La,fz="__reactHandles$"+La;function Ms(l){var d=l[xi];if(d)return d;for(var g=l.parentNode;g;){if(d=g[Gi]||g[xi]){if(g=d.alternate,d.child!==null||g!==null&&g.child!==null)for(l=CS(l);l!==null;){if(g=l[xi])return g;l=CS(l)}return d}l=g,g=l.parentNode}return null}function Ou(l){return l=l[xi]||l[Gi],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Fa(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Pf(l){return l[Du]||null}var Zg=[],za=-1;function zo(l){return{current:l}}function zt(l){0>za||(l.current=Zg[za],Zg[za]=null,za--)}function Dt(l,d){za++,Zg[za]=l.current,l.current=d}var $o={},jn=zo($o),nr=zo(!1),Ds=$o;function $a(l,d){var g=l.type.contextTypes;if(!g)return $o;var b=l.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===d)return b.__reactInternalMemoizedMaskedChildContext;var _={},T;for(T in g)_[T]=d[T];return b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=_),_}function rr(l){return l=l.childContextTypes,l!=null}function Rf(){zt(nr),zt(jn)}function _S(l,d,g){if(jn.current!==$o)throw Error(n(168));Dt(jn,d),Dt(nr,g)}function NS(l,d,g){var b=l.stateNode;if(d=d.childContextTypes,typeof b.getChildContext!="function")return g;b=b.getChildContext();for(var _ in b)if(!(_ in d))throw Error(n(108,ee(l)||"Unknown",_));return L({},g,b)}function Mf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||$o,Ds=jn.current,Dt(jn,l),Dt(nr,nr.current),!0}function TS(l,d,g){var b=l.stateNode;if(!b)throw Error(n(169));g?(l=NS(l,d,Ds),b.__reactInternalMemoizedMergedChildContext=l,zt(nr),zt(jn),Dt(jn,l)):zt(nr),Dt(nr,g)}var Zi=null,Df=!1,Kg=!1;function AS(l){Zi===null?Zi=[l]:Zi.push(l)}function hz(l){Df=!0,AS(l)}function Bo(){if(!Kg&&Zi!==null){Kg=!0;var l=0,d=Nt;try{var g=Zi;for(Nt=1;l<g.length;l++){var b=g[l];do b=b(!0);while(b!==null)}Zi=null,Df=!1}catch(_){throw Zi!==null&&(Zi=Zi.slice(l+1)),df(mu,Bo),_}finally{Nt=d,Kg=!1}}return null}var Ba=[],Va=0,Of=null,If=0,Or=[],Ir=0,Os=null,Ki=1,Xi="";function Is(l,d){Ba[Va++]=If,Ba[Va++]=Of,Of=l,If=d}function PS(l,d,g){Or[Ir++]=Ki,Or[Ir++]=Xi,Or[Ir++]=Os,Os=l;var b=Ki;l=Xi;var _=32-pr(b)-1;b&=~(1<<_),g+=1;var T=32-pr(d)+_;if(30<T){var z=_-_%5;T=(b&(1<<z)-1).toString(32),b>>=z,_-=z,Ki=1<<32-pr(d)+_|g<<_|b,Xi=T+l}else Ki=1<<T|g<<_|b,Xi=l}function Xg(l){l.return!==null&&(Is(l,1),PS(l,1,0))}function Qg(l){for(;l===Of;)Of=Ba[--Va],Ba[Va]=null,If=Ba[--Va],Ba[Va]=null;for(;l===Os;)Os=Or[--Ir],Or[Ir]=null,Xi=Or[--Ir],Or[Ir]=null,Ki=Or[--Ir],Or[Ir]=null}var gr=null,yr=null,Ut=!1,Kr=null;function RS(l,d){var g=zr(5,null,null,0);g.elementType="DELETED",g.stateNode=d,g.return=l,d=l.deletions,d===null?(l.deletions=[g],l.flags|=16):d.push(g)}function MS(l,d){switch(l.tag){case 5:var g=l.type;return d=d.nodeType!==1||g.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(l.stateNode=d,gr=l,yr=Fo(d.firstChild),!0):!1;case 6:return d=l.pendingProps===""||d.nodeType!==3?null:d,d!==null?(l.stateNode=d,gr=l,yr=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(g=Os!==null?{id:Ki,overflow:Xi}:null,l.memoizedState={dehydrated:d,treeContext:g,retryLane:1073741824},g=zr(18,null,null,0),g.stateNode=d,g.return=l,l.child=g,gr=l,yr=null,!0):!1;default:return!1}}function Jg(l){return(l.mode&1)!==0&&(l.flags&128)===0}function ey(l){if(Ut){var d=yr;if(d){var g=d;if(!MS(l,d)){if(Jg(l))throw Error(n(418));d=Fo(g.nextSibling);var b=gr;d&&MS(l,d)?RS(b,g):(l.flags=l.flags&-4097|2,Ut=!1,gr=l)}}else{if(Jg(l))throw Error(n(418));l.flags=l.flags&-4097|2,Ut=!1,gr=l}}}function DS(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;gr=l}function jf(l){if(l!==gr)return!1;if(!Ut)return DS(l),Ut=!0,!1;var d;if((d=l.tag!==3)&&!(d=l.tag!==5)&&(d=l.type,d=d!=="head"&&d!=="body"&&!Hg(l.type,l.memoizedProps)),d&&(d=yr)){if(Jg(l))throw OS(),Error(n(418));for(;d;)RS(l,d),d=Fo(d.nextSibling)}if(DS(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,d=0;l;){if(l.nodeType===8){var g=l.data;if(g==="/$"){if(d===0){yr=Fo(l.nextSibling);break e}d--}else g!=="$"&&g!=="$!"&&g!=="$?"||d++}l=l.nextSibling}yr=null}}else yr=gr?Fo(l.stateNode.nextSibling):null;return!0}function OS(){for(var l=yr;l;)l=Fo(l.nextSibling)}function Wa(){yr=gr=null,Ut=!1}function ty(l){Kr===null?Kr=[l]:Kr.push(l)}var pz=N.ReactCurrentBatchConfig;function Iu(l,d,g){if(l=g.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(n(309));var b=g.stateNode}if(!b)throw Error(n(147,l));var _=b,T=""+l;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===T?d.ref:(d=function(z){var X=_.refs;z===null?delete X[T]:X[T]=z},d._stringRef=T,d)}if(typeof l!="string")throw Error(n(284));if(!g._owner)throw Error(n(290,l))}return l}function Lf(l,d){throw l=Object.prototype.toString.call(d),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":l))}function IS(l){var d=l._init;return d(l._payload)}function jS(l){function d(se,ie){if(l){var le=se.deletions;le===null?(se.deletions=[ie],se.flags|=16):le.push(ie)}}function g(se,ie){if(!l)return null;for(;ie!==null;)d(se,ie),ie=ie.sibling;return null}function b(se,ie){for(se=new Map;ie!==null;)ie.key!==null?se.set(ie.key,ie):se.set(ie.index,ie),ie=ie.sibling;return se}function _(se,ie){return se=Zo(se,ie),se.index=0,se.sibling=null,se}function T(se,ie,le){return se.index=le,l?(le=se.alternate,le!==null?(le=le.index,le<ie?(se.flags|=2,ie):le):(se.flags|=2,ie)):(se.flags|=1048576,ie)}function z(se){return l&&se.alternate===null&&(se.flags|=2),se}function X(se,ie,le,_e){return ie===null||ie.tag!==6?(ie=Yy(le,se.mode,_e),ie.return=se,ie):(ie=_(ie,le),ie.return=se,ie)}function te(se,ie,le,_e){var Be=le.type;return Be===O?xe(se,ie,le.props.children,_e,le.key):ie!==null&&(ie.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===Y&&IS(Be)===ie.type)?(_e=_(ie,le.props),_e.ref=Iu(se,ie,le),_e.return=se,_e):(_e=ah(le.type,le.key,le.props,null,se.mode,_e),_e.ref=Iu(se,ie,le),_e.return=se,_e)}function de(se,ie,le,_e){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==le.containerInfo||ie.stateNode.implementation!==le.implementation?(ie=qy(le,se.mode,_e),ie.return=se,ie):(ie=_(ie,le.children||[]),ie.return=se,ie)}function xe(se,ie,le,_e,Be){return ie===null||ie.tag!==7?(ie=Ws(le,se.mode,_e,Be),ie.return=se,ie):(ie=_(ie,le),ie.return=se,ie)}function be(se,ie,le){if(typeof ie=="string"&&ie!==""||typeof ie=="number")return ie=Yy(""+ie,se.mode,le),ie.return=se,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case P:return le=ah(ie.type,ie.key,ie.props,null,se.mode,le),le.ref=Iu(se,null,ie),le.return=se,le;case A:return ie=qy(ie,se.mode,le),ie.return=se,ie;case Y:var _e=ie._init;return be(se,_e(ie._payload),le)}if(ae(ie)||W(ie))return ie=Ws(ie,se.mode,le,null),ie.return=se,ie;Lf(se,ie)}return null}function ye(se,ie,le,_e){var Be=ie!==null?ie.key:null;if(typeof le=="string"&&le!==""||typeof le=="number")return Be!==null?null:X(se,ie,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case P:return le.key===Be?te(se,ie,le,_e):null;case A:return le.key===Be?de(se,ie,le,_e):null;case Y:return Be=le._init,ye(se,ie,Be(le._payload),_e)}if(ae(le)||W(le))return Be!==null?null:xe(se,ie,le,_e,null);Lf(se,le)}return null}function De(se,ie,le,_e,Be){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return se=se.get(le)||null,X(ie,se,""+_e,Be);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case P:return se=se.get(_e.key===null?le:_e.key)||null,te(ie,se,_e,Be);case A:return se=se.get(_e.key===null?le:_e.key)||null,de(ie,se,_e,Be);case Y:var qe=_e._init;return De(se,ie,le,qe(_e._payload),Be)}if(ae(_e)||W(_e))return se=se.get(le)||null,xe(ie,se,_e,Be,null);Lf(ie,_e)}return null}function Le(se,ie,le,_e){for(var Be=null,qe=null,Ge=ie,rt=ie=0,Nn=null;Ge!==null&&rt<le.length;rt++){Ge.index>rt?(Nn=Ge,Ge=null):Nn=Ge.sibling;var kt=ye(se,Ge,le[rt],_e);if(kt===null){Ge===null&&(Ge=Nn);break}l&&Ge&&kt.alternate===null&&d(se,Ge),ie=T(kt,ie,rt),qe===null?Be=kt:qe.sibling=kt,qe=kt,Ge=Nn}if(rt===le.length)return g(se,Ge),Ut&&Is(se,rt),Be;if(Ge===null){for(;rt<le.length;rt++)Ge=be(se,le[rt],_e),Ge!==null&&(ie=T(Ge,ie,rt),qe===null?Be=Ge:qe.sibling=Ge,qe=Ge);return Ut&&Is(se,rt),Be}for(Ge=b(se,Ge);rt<le.length;rt++)Nn=De(Ge,se,rt,le[rt],_e),Nn!==null&&(l&&Nn.alternate!==null&&Ge.delete(Nn.key===null?rt:Nn.key),ie=T(Nn,ie,rt),qe===null?Be=Nn:qe.sibling=Nn,qe=Nn);return l&&Ge.forEach(function(Ko){return d(se,Ko)}),Ut&&Is(se,rt),Be}function ze(se,ie,le,_e){var Be=W(le);if(typeof Be!="function")throw Error(n(150));if(le=Be.call(le),le==null)throw Error(n(151));for(var qe=Be=null,Ge=ie,rt=ie=0,Nn=null,kt=le.next();Ge!==null&&!kt.done;rt++,kt=le.next()){Ge.index>rt?(Nn=Ge,Ge=null):Nn=Ge.sibling;var Ko=ye(se,Ge,kt.value,_e);if(Ko===null){Ge===null&&(Ge=Nn);break}l&&Ge&&Ko.alternate===null&&d(se,Ge),ie=T(Ko,ie,rt),qe===null?Be=Ko:qe.sibling=Ko,qe=Ko,Ge=Nn}if(kt.done)return g(se,Ge),Ut&&Is(se,rt),Be;if(Ge===null){for(;!kt.done;rt++,kt=le.next())kt=be(se,kt.value,_e),kt!==null&&(ie=T(kt,ie,rt),qe===null?Be=kt:qe.sibling=kt,qe=kt);return Ut&&Is(se,rt),Be}for(Ge=b(se,Ge);!kt.done;rt++,kt=le.next())kt=De(Ge,se,rt,kt.value,_e),kt!==null&&(l&&kt.alternate!==null&&Ge.delete(kt.key===null?rt:kt.key),ie=T(kt,ie,rt),qe===null?Be=kt:qe.sibling=kt,qe=kt);return l&&Ge.forEach(function(qz){return d(se,qz)}),Ut&&Is(se,rt),Be}function rn(se,ie,le,_e){if(typeof le=="object"&&le!==null&&le.type===O&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case P:e:{for(var Be=le.key,qe=ie;qe!==null;){if(qe.key===Be){if(Be=le.type,Be===O){if(qe.tag===7){g(se,qe.sibling),ie=_(qe,le.props.children),ie.return=se,se=ie;break e}}else if(qe.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===Y&&IS(Be)===qe.type){g(se,qe.sibling),ie=_(qe,le.props),ie.ref=Iu(se,qe,le),ie.return=se,se=ie;break e}g(se,qe);break}else d(se,qe);qe=qe.sibling}le.type===O?(ie=Ws(le.props.children,se.mode,_e,le.key),ie.return=se,se=ie):(_e=ah(le.type,le.key,le.props,null,se.mode,_e),_e.ref=Iu(se,ie,le),_e.return=se,se=_e)}return z(se);case A:e:{for(qe=le.key;ie!==null;){if(ie.key===qe)if(ie.tag===4&&ie.stateNode.containerInfo===le.containerInfo&&ie.stateNode.implementation===le.implementation){g(se,ie.sibling),ie=_(ie,le.children||[]),ie.return=se,se=ie;break e}else{g(se,ie);break}else d(se,ie);ie=ie.sibling}ie=qy(le,se.mode,_e),ie.return=se,se=ie}return z(se);case Y:return qe=le._init,rn(se,ie,qe(le._payload),_e)}if(ae(le))return Le(se,ie,le,_e);if(W(le))return ze(se,ie,le,_e);Lf(se,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,ie!==null&&ie.tag===6?(g(se,ie.sibling),ie=_(ie,le),ie.return=se,se=ie):(g(se,ie),ie=Yy(le,se.mode,_e),ie.return=se,se=ie),z(se)):g(se,ie)}return rn}var Ua=jS(!0),LS=jS(!1),Ff=zo(null),zf=null,Ha=null,ny=null;function ry(){ny=Ha=zf=null}function iy(l){var d=Ff.current;zt(Ff),l._currentValue=d}function oy(l,d,g){for(;l!==null;){var b=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,b!==null&&(b.childLanes|=d)):b!==null&&(b.childLanes&d)!==d&&(b.childLanes|=d),l===g)break;l=l.return}}function Ya(l,d){zf=l,ny=Ha=null,l=l.dependencies,l!==null&&l.firstContext!==null&&(l.lanes&d&&(ir=!0),l.firstContext=null)}function jr(l){var d=l._currentValue;if(ny!==l)if(l={context:l,memoizedValue:d,next:null},Ha===null){if(zf===null)throw Error(n(308));Ha=l,zf.dependencies={lanes:0,firstContext:l}}else Ha=Ha.next=l;return d}var js=null;function sy(l){js===null?js=[l]:js.push(l)}function FS(l,d,g,b){var _=d.interleaved;return _===null?(g.next=g,sy(d)):(g.next=_.next,_.next=g),d.interleaved=g,Qi(l,b)}function Qi(l,d){l.lanes|=d;var g=l.alternate;for(g!==null&&(g.lanes|=d),g=l,l=l.return;l!==null;)l.childLanes|=d,g=l.alternate,g!==null&&(g.childLanes|=d),g=l,l=l.return;return g.tag===3?g.stateNode:null}var Vo=!1;function ay(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zS(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Ji(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function Wo(l,d,g){var b=l.updateQueue;if(b===null)return null;if(b=b.shared,wt&2){var _=b.pending;return _===null?d.next=d:(d.next=_.next,_.next=d),b.pending=d,Qi(l,g)}return _=b.interleaved,_===null?(d.next=d,sy(b)):(d.next=_.next,_.next=d),b.interleaved=d,Qi(l,g)}function $f(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194240)!==0)){var b=d.lanes;b&=l.pendingLanes,g|=b,d.lanes=g,bg(l,g)}}function $S(l,d){var g=l.updateQueue,b=l.alternate;if(b!==null&&(b=b.updateQueue,g===b)){var _=null,T=null;if(g=g.firstBaseUpdate,g!==null){do{var z={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};T===null?_=T=z:T=T.next=z,g=g.next}while(g!==null);T===null?_=T=d:T=T.next=d}else _=T=d;g={baseState:b.baseState,firstBaseUpdate:_,lastBaseUpdate:T,shared:b.shared,effects:b.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}function Bf(l,d,g,b){var _=l.updateQueue;Vo=!1;var T=_.firstBaseUpdate,z=_.lastBaseUpdate,X=_.shared.pending;if(X!==null){_.shared.pending=null;var te=X,de=te.next;te.next=null,z===null?T=de:z.next=de,z=te;var xe=l.alternate;xe!==null&&(xe=xe.updateQueue,X=xe.lastBaseUpdate,X!==z&&(X===null?xe.firstBaseUpdate=de:X.next=de,xe.lastBaseUpdate=te))}if(T!==null){var be=_.baseState;z=0,xe=de=te=null,X=T;do{var ye=X.lane,De=X.eventTime;if((b&ye)===ye){xe!==null&&(xe=xe.next={eventTime:De,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var Le=l,ze=X;switch(ye=d,De=g,ze.tag){case 1:if(Le=ze.payload,typeof Le=="function"){be=Le.call(De,be,ye);break e}be=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=ze.payload,ye=typeof Le=="function"?Le.call(De,be,ye):Le,ye==null)break e;be=L({},be,ye);break e;case 2:Vo=!0}}X.callback!==null&&X.lane!==0&&(l.flags|=64,ye=_.effects,ye===null?_.effects=[X]:ye.push(X))}else De={eventTime:De,lane:ye,tag:X.tag,payload:X.payload,callback:X.callback,next:null},xe===null?(de=xe=De,te=be):xe=xe.next=De,z|=ye;if(X=X.next,X===null){if(X=_.shared.pending,X===null)break;ye=X,X=ye.next,ye.next=null,_.lastBaseUpdate=ye,_.shared.pending=null}}while(!0);if(xe===null&&(te=be),_.baseState=te,_.firstBaseUpdate=de,_.lastBaseUpdate=xe,d=_.shared.interleaved,d!==null){_=d;do z|=_.lane,_=_.next;while(_!==d)}else T===null&&(_.shared.lanes=0);zs|=z,l.lanes=z,l.memoizedState=be}}function BS(l,d,g){if(l=d.effects,d.effects=null,l!==null)for(d=0;d<l.length;d++){var b=l[d],_=b.callback;if(_!==null){if(b.callback=null,b=g,typeof _!="function")throw Error(n(191,_));_.call(b)}}}var ju={},wi=zo(ju),Lu=zo(ju),Fu=zo(ju);function Ls(l){if(l===ju)throw Error(n(174));return l}function ly(l,d){switch(Dt(Fu,d),Dt(Lu,l),Dt(wi,ju),l=d.nodeType,l){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:pe(null,"");break;default:l=l===8?d.parentNode:d,d=l.namespaceURI||null,l=l.tagName,d=pe(d,l)}zt(wi),Dt(wi,d)}function qa(){zt(wi),zt(Lu),zt(Fu)}function VS(l){Ls(Fu.current);var d=Ls(wi.current),g=pe(d,l.type);d!==g&&(Dt(Lu,l),Dt(wi,g))}function uy(l){Lu.current===l&&(zt(wi),zt(Lu))}var Zt=zo(0);function Vf(l){for(var d=l;d!==null;){if(d.tag===13){var g=d.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||g.data==="$?"||g.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var cy=[];function dy(){for(var l=0;l<cy.length;l++)cy[l]._workInProgressVersionPrimary=null;cy.length=0}var Wf=N.ReactCurrentDispatcher,fy=N.ReactCurrentBatchConfig,Fs=0,Kt=null,xn=null,Cn=null,Uf=!1,zu=!1,$u=0,mz=0;function Ln(){throw Error(n(321))}function hy(l,d){if(d===null)return!1;for(var g=0;g<d.length&&g<l.length;g++)if(!Zr(l[g],d[g]))return!1;return!0}function py(l,d,g,b,_,T){if(Fs=T,Kt=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,Wf.current=l===null||l.memoizedState===null?xz:wz,l=g(b,_),zu){T=0;do{if(zu=!1,$u=0,25<=T)throw Error(n(301));T+=1,Cn=xn=null,d.updateQueue=null,Wf.current=bz,l=g(b,_)}while(zu)}if(Wf.current=qf,d=xn!==null&&xn.next!==null,Fs=0,Cn=xn=Kt=null,Uf=!1,d)throw Error(n(300));return l}function my(){var l=$u!==0;return $u=0,l}function bi(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?Kt.memoizedState=Cn=l:Cn=Cn.next=l,Cn}function Lr(){if(xn===null){var l=Kt.alternate;l=l!==null?l.memoizedState:null}else l=xn.next;var d=Cn===null?Kt.memoizedState:Cn.next;if(d!==null)Cn=d,xn=l;else{if(l===null)throw Error(n(310));xn=l,l={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},Cn===null?Kt.memoizedState=Cn=l:Cn=Cn.next=l}return Cn}function Bu(l,d){return typeof d=="function"?d(l):d}function gy(l){var d=Lr(),g=d.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=l;var b=xn,_=b.baseQueue,T=g.pending;if(T!==null){if(_!==null){var z=_.next;_.next=T.next,T.next=z}b.baseQueue=_=T,g.pending=null}if(_!==null){T=_.next,b=b.baseState;var X=z=null,te=null,de=T;do{var xe=de.lane;if((Fs&xe)===xe)te!==null&&(te=te.next={lane:0,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),b=de.hasEagerState?de.eagerState:l(b,de.action);else{var be={lane:xe,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null};te===null?(X=te=be,z=b):te=te.next=be,Kt.lanes|=xe,zs|=xe}de=de.next}while(de!==null&&de!==T);te===null?z=b:te.next=X,Zr(b,d.memoizedState)||(ir=!0),d.memoizedState=b,d.baseState=z,d.baseQueue=te,g.lastRenderedState=b}if(l=g.interleaved,l!==null){_=l;do T=_.lane,Kt.lanes|=T,zs|=T,_=_.next;while(_!==l)}else _===null&&(g.lanes=0);return[d.memoizedState,g.dispatch]}function yy(l){var d=Lr(),g=d.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=l;var b=g.dispatch,_=g.pending,T=d.memoizedState;if(_!==null){g.pending=null;var z=_=_.next;do T=l(T,z.action),z=z.next;while(z!==_);Zr(T,d.memoizedState)||(ir=!0),d.memoizedState=T,d.baseQueue===null&&(d.baseState=T),g.lastRenderedState=T}return[T,b]}function WS(){}function US(l,d){var g=Kt,b=Lr(),_=d(),T=!Zr(b.memoizedState,_);if(T&&(b.memoizedState=_,ir=!0),b=b.queue,vy(qS.bind(null,g,b,l),[l]),b.getSnapshot!==d||T||Cn!==null&&Cn.memoizedState.tag&1){if(g.flags|=2048,Vu(9,YS.bind(null,g,b,_,d),void 0,null),_n===null)throw Error(n(349));Fs&30||HS(g,d,_)}return _}function HS(l,d,g){l.flags|=16384,l={getSnapshot:d,value:g},d=Kt.updateQueue,d===null?(d={lastEffect:null,stores:null},Kt.updateQueue=d,d.stores=[l]):(g=d.stores,g===null?d.stores=[l]:g.push(l))}function YS(l,d,g,b){d.value=g,d.getSnapshot=b,GS(d)&&ZS(l)}function qS(l,d,g){return g(function(){GS(d)&&ZS(l)})}function GS(l){var d=l.getSnapshot;l=l.value;try{var g=d();return!Zr(l,g)}catch{return!0}}function ZS(l){var d=Qi(l,1);d!==null&&ei(d,l,1,-1)}function KS(l){var d=bi();return typeof l=="function"&&(l=l()),d.memoizedState=d.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:l},d.queue=l,l=l.dispatch=vz.bind(null,Kt,l),[d.memoizedState,l]}function Vu(l,d,g,b){return l={tag:l,create:d,destroy:g,deps:b,next:null},d=Kt.updateQueue,d===null?(d={lastEffect:null,stores:null},Kt.updateQueue=d,d.lastEffect=l.next=l):(g=d.lastEffect,g===null?d.lastEffect=l.next=l:(b=g.next,g.next=l,l.next=b,d.lastEffect=l)),l}function XS(){return Lr().memoizedState}function Hf(l,d,g,b){var _=bi();Kt.flags|=l,_.memoizedState=Vu(1|d,g,void 0,b===void 0?null:b)}function Yf(l,d,g,b){var _=Lr();b=b===void 0?null:b;var T=void 0;if(xn!==null){var z=xn.memoizedState;if(T=z.destroy,b!==null&&hy(b,z.deps)){_.memoizedState=Vu(d,g,T,b);return}}Kt.flags|=l,_.memoizedState=Vu(1|d,g,T,b)}function QS(l,d){return Hf(8390656,8,l,d)}function vy(l,d){return Yf(2048,8,l,d)}function JS(l,d){return Yf(4,2,l,d)}function eE(l,d){return Yf(4,4,l,d)}function tE(l,d){if(typeof d=="function")return l=l(),d(l),function(){d(null)};if(d!=null)return l=l(),d.current=l,function(){d.current=null}}function nE(l,d,g){return g=g!=null?g.concat([l]):null,Yf(4,4,tE.bind(null,d,l),g)}function xy(){}function rE(l,d){var g=Lr();d=d===void 0?null:d;var b=g.memoizedState;return b!==null&&d!==null&&hy(d,b[1])?b[0]:(g.memoizedState=[l,d],l)}function iE(l,d){var g=Lr();d=d===void 0?null:d;var b=g.memoizedState;return b!==null&&d!==null&&hy(d,b[1])?b[0]:(l=l(),g.memoizedState=[l,d],l)}function oE(l,d,g){return Fs&21?(Zr(g,d)||(g=Ik(),Kt.lanes|=g,zs|=g,l.baseState=!0),d):(l.baseState&&(l.baseState=!1,ir=!0),l.memoizedState=g)}function gz(l,d){var g=Nt;Nt=g!==0&&4>g?g:4,l(!0);var b=fy.transition;fy.transition={};try{l(!1),d()}finally{Nt=g,fy.transition=b}}function sE(){return Lr().memoizedState}function yz(l,d,g){var b=qo(l);if(g={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null},aE(l))lE(d,g);else if(g=FS(l,d,g,b),g!==null){var _=Zn();ei(g,l,b,_),uE(g,d,b)}}function vz(l,d,g){var b=qo(l),_={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null};if(aE(l))lE(d,_);else{var T=l.alternate;if(l.lanes===0&&(T===null||T.lanes===0)&&(T=d.lastRenderedReducer,T!==null))try{var z=d.lastRenderedState,X=T(z,g);if(_.hasEagerState=!0,_.eagerState=X,Zr(X,z)){var te=d.interleaved;te===null?(_.next=_,sy(d)):(_.next=te.next,te.next=_),d.interleaved=_;return}}catch{}finally{}g=FS(l,d,_,b),g!==null&&(_=Zn(),ei(g,l,b,_),uE(g,d,b))}}function aE(l){var d=l.alternate;return l===Kt||d!==null&&d===Kt}function lE(l,d){zu=Uf=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function uE(l,d,g){if(g&4194240){var b=d.lanes;b&=l.pendingLanes,g|=b,d.lanes=g,bg(l,g)}}var qf={readContext:jr,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useInsertionEffect:Ln,useLayoutEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useMutableSource:Ln,useSyncExternalStore:Ln,useId:Ln,unstable_isNewReconciler:!1},xz={readContext:jr,useCallback:function(l,d){return bi().memoizedState=[l,d===void 0?null:d],l},useContext:jr,useEffect:QS,useImperativeHandle:function(l,d,g){return g=g!=null?g.concat([l]):null,Hf(4194308,4,tE.bind(null,d,l),g)},useLayoutEffect:function(l,d){return Hf(4194308,4,l,d)},useInsertionEffect:function(l,d){return Hf(4,2,l,d)},useMemo:function(l,d){var g=bi();return d=d===void 0?null:d,l=l(),g.memoizedState=[l,d],l},useReducer:function(l,d,g){var b=bi();return d=g!==void 0?g(d):d,b.memoizedState=b.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},b.queue=l,l=l.dispatch=yz.bind(null,Kt,l),[b.memoizedState,l]},useRef:function(l){var d=bi();return l={current:l},d.memoizedState=l},useState:KS,useDebugValue:xy,useDeferredValue:function(l){return bi().memoizedState=l},useTransition:function(){var l=KS(!1),d=l[0];return l=gz.bind(null,l[1]),bi().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,g){var b=Kt,_=bi();if(Ut){if(g===void 0)throw Error(n(407));g=g()}else{if(g=d(),_n===null)throw Error(n(349));Fs&30||HS(b,d,g)}_.memoizedState=g;var T={value:g,getSnapshot:d};return _.queue=T,QS(qS.bind(null,b,T,l),[l]),b.flags|=2048,Vu(9,YS.bind(null,b,T,g,d),void 0,null),g},useId:function(){var l=bi(),d=_n.identifierPrefix;if(Ut){var g=Xi,b=Ki;g=(b&~(1<<32-pr(b)-1)).toString(32)+g,d=":"+d+"R"+g,g=$u++,0<g&&(d+="H"+g.toString(32)),d+=":"}else g=mz++,d=":"+d+"r"+g.toString(32)+":";return l.memoizedState=d},unstable_isNewReconciler:!1},wz={readContext:jr,useCallback:rE,useContext:jr,useEffect:vy,useImperativeHandle:nE,useInsertionEffect:JS,useLayoutEffect:eE,useMemo:iE,useReducer:gy,useRef:XS,useState:function(){return gy(Bu)},useDebugValue:xy,useDeferredValue:function(l){var d=Lr();return oE(d,xn.memoizedState,l)},useTransition:function(){var l=gy(Bu)[0],d=Lr().memoizedState;return[l,d]},useMutableSource:WS,useSyncExternalStore:US,useId:sE,unstable_isNewReconciler:!1},bz={readContext:jr,useCallback:rE,useContext:jr,useEffect:vy,useImperativeHandle:nE,useInsertionEffect:JS,useLayoutEffect:eE,useMemo:iE,useReducer:yy,useRef:XS,useState:function(){return yy(Bu)},useDebugValue:xy,useDeferredValue:function(l){var d=Lr();return xn===null?d.memoizedState=l:oE(d,xn.memoizedState,l)},useTransition:function(){var l=yy(Bu)[0],d=Lr().memoizedState;return[l,d]},useMutableSource:WS,useSyncExternalStore:US,useId:sE,unstable_isNewReconciler:!1};function Xr(l,d){if(l&&l.defaultProps){d=L({},d),l=l.defaultProps;for(var g in l)d[g]===void 0&&(d[g]=l[g]);return d}return d}function wy(l,d,g,b){d=l.memoizedState,g=g(b,d),g=g==null?d:L({},d,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var Gf={isMounted:function(l){return(l=l._reactInternals)?vi(l)===l:!1},enqueueSetState:function(l,d,g){l=l._reactInternals;var b=Zn(),_=qo(l),T=Ji(b,_);T.payload=d,g!=null&&(T.callback=g),d=Wo(l,T,_),d!==null&&(ei(d,l,_,b),$f(d,l,_))},enqueueReplaceState:function(l,d,g){l=l._reactInternals;var b=Zn(),_=qo(l),T=Ji(b,_);T.tag=1,T.payload=d,g!=null&&(T.callback=g),d=Wo(l,T,_),d!==null&&(ei(d,l,_,b),$f(d,l,_))},enqueueForceUpdate:function(l,d){l=l._reactInternals;var g=Zn(),b=qo(l),_=Ji(g,b);_.tag=2,d!=null&&(_.callback=d),d=Wo(l,_,b),d!==null&&(ei(d,l,b,g),$f(d,l,b))}};function cE(l,d,g,b,_,T,z){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(b,T,z):d.prototype&&d.prototype.isPureReactComponent?!Tu(g,b)||!Tu(_,T):!0}function dE(l,d,g){var b=!1,_=$o,T=d.contextType;return typeof T=="object"&&T!==null?T=jr(T):(_=rr(d)?Ds:jn.current,b=d.contextTypes,T=(b=b!=null)?$a(l,_):$o),d=new d(g,T),l.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Gf,l.stateNode=d,d._reactInternals=l,b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=_,l.__reactInternalMemoizedMaskedChildContext=T),d}function fE(l,d,g,b){l=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(g,b),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(g,b),d.state!==l&&Gf.enqueueReplaceState(d,d.state,null)}function by(l,d,g,b){var _=l.stateNode;_.props=g,_.state=l.memoizedState,_.refs={},ay(l);var T=d.contextType;typeof T=="object"&&T!==null?_.context=jr(T):(T=rr(d)?Ds:jn.current,_.context=$a(l,T)),_.state=l.memoizedState,T=d.getDerivedStateFromProps,typeof T=="function"&&(wy(l,d,T,g),_.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(d=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),d!==_.state&&Gf.enqueueReplaceState(_,_.state,null),Bf(l,g,_,b),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308)}function Ga(l,d){try{var g="",b=d;do g+=K(b),b=b.return;while(b);var _=g}catch(T){_=`
|
|
39
|
+
Error generating stack: `+T.message+`
|
|
40
|
+
`+T.stack}return{value:l,source:d,stack:_,digest:null}}function ky(l,d,g){return{value:l,source:null,stack:g??null,digest:d??null}}function Sy(l,d){try{console.error(d.value)}catch(g){setTimeout(function(){throw g})}}var kz=typeof WeakMap=="function"?WeakMap:Map;function hE(l,d,g){g=Ji(-1,g),g.tag=3,g.payload={element:null};var b=d.value;return g.callback=function(){th||(th=!0,Fy=b),Sy(l,d)},g}function pE(l,d,g){g=Ji(-1,g),g.tag=3;var b=l.type.getDerivedStateFromError;if(typeof b=="function"){var _=d.value;g.payload=function(){return b(_)},g.callback=function(){Sy(l,d)}}var T=l.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(g.callback=function(){Sy(l,d),typeof b!="function"&&(Ho===null?Ho=new Set([this]):Ho.add(this));var z=d.stack;this.componentDidCatch(d.value,{componentStack:z!==null?z:""})}),g}function mE(l,d,g){var b=l.pingCache;if(b===null){b=l.pingCache=new kz;var _=new Set;b.set(d,_)}else _=b.get(d),_===void 0&&(_=new Set,b.set(d,_));_.has(g)||(_.add(g),l=jz.bind(null,l,d,g),d.then(l,l))}function gE(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function yE(l,d,g,b,_){return l.mode&1?(l.flags|=65536,l.lanes=_,l):(l===d?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(d=Ji(-1,1),d.tag=2,Wo(g,d,1))),g.lanes|=1),l)}var Sz=N.ReactCurrentOwner,ir=!1;function Gn(l,d,g,b){d.child=l===null?LS(d,null,g,b):Ua(d,l.child,g,b)}function vE(l,d,g,b,_){g=g.render;var T=d.ref;return Ya(d,_),b=py(l,d,g,b,T,_),g=my(),l!==null&&!ir?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~_,eo(l,d,_)):(Ut&&g&&Xg(d),d.flags|=1,Gn(l,d,b,_),d.child)}function xE(l,d,g,b,_){if(l===null){var T=g.type;return typeof T=="function"&&!Hy(T)&&T.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(d.tag=15,d.type=T,wE(l,d,T,b,_)):(l=ah(g.type,null,b,d,d.mode,_),l.ref=d.ref,l.return=d,d.child=l)}if(T=l.child,!(l.lanes&_)){var z=T.memoizedProps;if(g=g.compare,g=g!==null?g:Tu,g(z,b)&&l.ref===d.ref)return eo(l,d,_)}return d.flags|=1,l=Zo(T,b),l.ref=d.ref,l.return=d,d.child=l}function wE(l,d,g,b,_){if(l!==null){var T=l.memoizedProps;if(Tu(T,b)&&l.ref===d.ref)if(ir=!1,d.pendingProps=b=T,(l.lanes&_)!==0)l.flags&131072&&(ir=!0);else return d.lanes=l.lanes,eo(l,d,_)}return Ey(l,d,g,b,_)}function bE(l,d,g){var b=d.pendingProps,_=b.children,T=l!==null?l.memoizedState:null;if(b.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Dt(Ka,vr),vr|=g;else{if(!(g&1073741824))return l=T!==null?T.baseLanes|g:g,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,Dt(Ka,vr),vr|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=T!==null?T.baseLanes:g,Dt(Ka,vr),vr|=b}else T!==null?(b=T.baseLanes|g,d.memoizedState=null):b=g,Dt(Ka,vr),vr|=b;return Gn(l,d,_,g),d.child}function kE(l,d){var g=d.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(d.flags|=512,d.flags|=2097152)}function Ey(l,d,g,b,_){var T=rr(g)?Ds:jn.current;return T=$a(d,T),Ya(d,_),g=py(l,d,g,b,T,_),b=my(),l!==null&&!ir?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~_,eo(l,d,_)):(Ut&&b&&Xg(d),d.flags|=1,Gn(l,d,g,_),d.child)}function SE(l,d,g,b,_){if(rr(g)){var T=!0;Mf(d)}else T=!1;if(Ya(d,_),d.stateNode===null)Kf(l,d),dE(d,g,b),by(d,g,b,_),b=!0;else if(l===null){var z=d.stateNode,X=d.memoizedProps;z.props=X;var te=z.context,de=g.contextType;typeof de=="object"&&de!==null?de=jr(de):(de=rr(g)?Ds:jn.current,de=$a(d,de));var xe=g.getDerivedStateFromProps,be=typeof xe=="function"||typeof z.getSnapshotBeforeUpdate=="function";be||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(X!==b||te!==de)&&fE(d,z,b,de),Vo=!1;var ye=d.memoizedState;z.state=ye,Bf(d,b,z,_),te=d.memoizedState,X!==b||ye!==te||nr.current||Vo?(typeof xe=="function"&&(wy(d,g,xe,b),te=d.memoizedState),(X=Vo||cE(d,g,X,b,ye,te,de))?(be||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(d.flags|=4194308)):(typeof z.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=b,d.memoizedState=te),z.props=b,z.state=te,z.context=de,b=X):(typeof z.componentDidMount=="function"&&(d.flags|=4194308),b=!1)}else{z=d.stateNode,zS(l,d),X=d.memoizedProps,de=d.type===d.elementType?X:Xr(d.type,X),z.props=de,be=d.pendingProps,ye=z.context,te=g.contextType,typeof te=="object"&&te!==null?te=jr(te):(te=rr(g)?Ds:jn.current,te=$a(d,te));var De=g.getDerivedStateFromProps;(xe=typeof De=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(X!==be||ye!==te)&&fE(d,z,b,te),Vo=!1,ye=d.memoizedState,z.state=ye,Bf(d,b,z,_);var Le=d.memoizedState;X!==be||ye!==Le||nr.current||Vo?(typeof De=="function"&&(wy(d,g,De,b),Le=d.memoizedState),(de=Vo||cE(d,g,de,b,ye,Le,te)||!1)?(xe||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(b,Le,te),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(b,Le,te)),typeof z.componentDidUpdate=="function"&&(d.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof z.componentDidUpdate!="function"||X===l.memoizedProps&&ye===l.memoizedState||(d.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&ye===l.memoizedState||(d.flags|=1024),d.memoizedProps=b,d.memoizedState=Le),z.props=b,z.state=Le,z.context=te,b=de):(typeof z.componentDidUpdate!="function"||X===l.memoizedProps&&ye===l.memoizedState||(d.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&ye===l.memoizedState||(d.flags|=1024),b=!1)}return Cy(l,d,g,b,T,_)}function Cy(l,d,g,b,_,T){kE(l,d);var z=(d.flags&128)!==0;if(!b&&!z)return _&&TS(d,g,!1),eo(l,d,T);b=d.stateNode,Sz.current=d;var X=z&&typeof g.getDerivedStateFromError!="function"?null:b.render();return d.flags|=1,l!==null&&z?(d.child=Ua(d,l.child,null,T),d.child=Ua(d,null,X,T)):Gn(l,d,X,T),d.memoizedState=b.state,_&&TS(d,g,!0),d.child}function EE(l){var d=l.stateNode;d.pendingContext?_S(l,d.pendingContext,d.pendingContext!==d.context):d.context&&_S(l,d.context,!1),ly(l,d.containerInfo)}function CE(l,d,g,b,_){return Wa(),ty(_),d.flags|=256,Gn(l,d,g,b),d.child}var _y={dehydrated:null,treeContext:null,retryLane:0};function Ny(l){return{baseLanes:l,cachePool:null,transitions:null}}function _E(l,d,g){var b=d.pendingProps,_=Zt.current,T=!1,z=(d.flags&128)!==0,X;if((X=z)||(X=l!==null&&l.memoizedState===null?!1:(_&2)!==0),X?(T=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(_|=1),Dt(Zt,_&1),l===null)return ey(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?(d.mode&1?l.data==="$!"?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(z=b.children,l=b.fallback,T?(b=d.mode,T=d.child,z={mode:"hidden",children:z},!(b&1)&&T!==null?(T.childLanes=0,T.pendingProps=z):T=lh(z,b,0,null),l=Ws(l,b,g,null),T.return=d,l.return=d,T.sibling=l,d.child=T,d.child.memoizedState=Ny(g),d.memoizedState=_y,l):Ty(d,z));if(_=l.memoizedState,_!==null&&(X=_.dehydrated,X!==null))return Ez(l,d,z,b,X,_,g);if(T){T=b.fallback,z=d.mode,_=l.child,X=_.sibling;var te={mode:"hidden",children:b.children};return!(z&1)&&d.child!==_?(b=d.child,b.childLanes=0,b.pendingProps=te,d.deletions=null):(b=Zo(_,te),b.subtreeFlags=_.subtreeFlags&14680064),X!==null?T=Zo(X,T):(T=Ws(T,z,g,null),T.flags|=2),T.return=d,b.return=d,b.sibling=T,d.child=b,b=T,T=d.child,z=l.child.memoizedState,z=z===null?Ny(g):{baseLanes:z.baseLanes|g,cachePool:null,transitions:z.transitions},T.memoizedState=z,T.childLanes=l.childLanes&~g,d.memoizedState=_y,b}return T=l.child,l=T.sibling,b=Zo(T,{mode:"visible",children:b.children}),!(d.mode&1)&&(b.lanes=g),b.return=d,b.sibling=null,l!==null&&(g=d.deletions,g===null?(d.deletions=[l],d.flags|=16):g.push(l)),d.child=b,d.memoizedState=null,b}function Ty(l,d){return d=lh({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function Zf(l,d,g,b){return b!==null&&ty(b),Ua(d,l.child,null,g),l=Ty(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function Ez(l,d,g,b,_,T,z){if(g)return d.flags&256?(d.flags&=-257,b=ky(Error(n(422))),Zf(l,d,z,b)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(T=b.fallback,_=d.mode,b=lh({mode:"visible",children:b.children},_,0,null),T=Ws(T,_,z,null),T.flags|=2,b.return=d,T.return=d,b.sibling=T,d.child=b,d.mode&1&&Ua(d,l.child,null,z),d.child.memoizedState=Ny(z),d.memoizedState=_y,T);if(!(d.mode&1))return Zf(l,d,z,null);if(_.data==="$!"){if(b=_.nextSibling&&_.nextSibling.dataset,b)var X=b.dgst;return b=X,T=Error(n(419)),b=ky(T,b,void 0),Zf(l,d,z,b)}if(X=(z&l.childLanes)!==0,ir||X){if(b=_n,b!==null){switch(z&-z){case 4:_=2;break;case 16:_=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:_=32;break;case 536870912:_=268435456;break;default:_=0}_=_&(b.suspendedLanes|z)?0:_,_!==0&&_!==T.retryLane&&(T.retryLane=_,Qi(l,_),ei(b,l,_,-1))}return Uy(),b=ky(Error(n(421))),Zf(l,d,z,b)}return _.data==="$?"?(d.flags|=128,d.child=l.child,d=Lz.bind(null,l),_._reactRetry=d,null):(l=T.treeContext,yr=Fo(_.nextSibling),gr=d,Ut=!0,Kr=null,l!==null&&(Or[Ir++]=Ki,Or[Ir++]=Xi,Or[Ir++]=Os,Ki=l.id,Xi=l.overflow,Os=d),d=Ty(d,b.children),d.flags|=4096,d)}function NE(l,d,g){l.lanes|=d;var b=l.alternate;b!==null&&(b.lanes|=d),oy(l.return,d,g)}function Ay(l,d,g,b,_){var T=l.memoizedState;T===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:b,tail:g,tailMode:_}:(T.isBackwards=d,T.rendering=null,T.renderingStartTime=0,T.last=b,T.tail=g,T.tailMode=_)}function TE(l,d,g){var b=d.pendingProps,_=b.revealOrder,T=b.tail;if(Gn(l,d,b.children,g),b=Zt.current,b&2)b=b&1|2,d.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&NE(l,g,d);else if(l.tag===19)NE(l,g,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}b&=1}if(Dt(Zt,b),!(d.mode&1))d.memoizedState=null;else switch(_){case"forwards":for(g=d.child,_=null;g!==null;)l=g.alternate,l!==null&&Vf(l)===null&&(_=g),g=g.sibling;g=_,g===null?(_=d.child,d.child=null):(_=g.sibling,g.sibling=null),Ay(d,!1,_,g,T);break;case"backwards":for(g=null,_=d.child,d.child=null;_!==null;){if(l=_.alternate,l!==null&&Vf(l)===null){d.child=_;break}l=_.sibling,_.sibling=g,g=_,_=l}Ay(d,!0,g,null,T);break;case"together":Ay(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Kf(l,d){!(d.mode&1)&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function eo(l,d,g){if(l!==null&&(d.dependencies=l.dependencies),zs|=d.lanes,!(g&d.childLanes))return null;if(l!==null&&d.child!==l.child)throw Error(n(153));if(d.child!==null){for(l=d.child,g=Zo(l,l.pendingProps),d.child=g,g.return=d;l.sibling!==null;)l=l.sibling,g=g.sibling=Zo(l,l.pendingProps),g.return=d;g.sibling=null}return d.child}function Cz(l,d,g){switch(d.tag){case 3:EE(d),Wa();break;case 5:VS(d);break;case 1:rr(d.type)&&Mf(d);break;case 4:ly(d,d.stateNode.containerInfo);break;case 10:var b=d.type._context,_=d.memoizedProps.value;Dt(Ff,b._currentValue),b._currentValue=_;break;case 13:if(b=d.memoizedState,b!==null)return b.dehydrated!==null?(Dt(Zt,Zt.current&1),d.flags|=128,null):g&d.child.childLanes?_E(l,d,g):(Dt(Zt,Zt.current&1),l=eo(l,d,g),l!==null?l.sibling:null);Dt(Zt,Zt.current&1);break;case 19:if(b=(g&d.childLanes)!==0,l.flags&128){if(b)return TE(l,d,g);d.flags|=128}if(_=d.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Dt(Zt,Zt.current),b)break;return null;case 22:case 23:return d.lanes=0,bE(l,d,g)}return eo(l,d,g)}var AE,Py,PE,RE;AE=function(l,d){for(var g=d.child;g!==null;){if(g.tag===5||g.tag===6)l.appendChild(g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===d)break;for(;g.sibling===null;){if(g.return===null||g.return===d)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},Py=function(){},PE=function(l,d,g,b){var _=l.memoizedProps;if(_!==b){l=d.stateNode,Ls(wi.current);var T=null;switch(g){case"input":_=Me(l,_),b=Me(l,b),T=[];break;case"select":_=L({},_,{value:void 0}),b=L({},b,{value:void 0}),T=[];break;case"textarea":_=we(l,_),b=we(l,b),T=[];break;default:typeof _.onClick!="function"&&typeof b.onClick=="function"&&(l.onclick=Af)}yt(g,b);var z;g=null;for(de in _)if(!b.hasOwnProperty(de)&&_.hasOwnProperty(de)&&_[de]!=null)if(de==="style"){var X=_[de];for(z in X)X.hasOwnProperty(z)&&(g||(g={}),g[z]="")}else de!=="dangerouslySetInnerHTML"&&de!=="children"&&de!=="suppressContentEditableWarning"&&de!=="suppressHydrationWarning"&&de!=="autoFocus"&&(i.hasOwnProperty(de)?T||(T=[]):(T=T||[]).push(de,null));for(de in b){var te=b[de];if(X=_!=null?_[de]:void 0,b.hasOwnProperty(de)&&te!==X&&(te!=null||X!=null))if(de==="style")if(X){for(z in X)!X.hasOwnProperty(z)||te&&te.hasOwnProperty(z)||(g||(g={}),g[z]="");for(z in te)te.hasOwnProperty(z)&&X[z]!==te[z]&&(g||(g={}),g[z]=te[z])}else g||(T||(T=[]),T.push(de,g)),g=te;else de==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,X=X?X.__html:void 0,te!=null&&X!==te&&(T=T||[]).push(de,te)):de==="children"?typeof te!="string"&&typeof te!="number"||(T=T||[]).push(de,""+te):de!=="suppressContentEditableWarning"&&de!=="suppressHydrationWarning"&&(i.hasOwnProperty(de)?(te!=null&&de==="onScroll"&&Ft("scroll",l),T||X===te||(T=[])):(T=T||[]).push(de,te))}g&&(T=T||[]).push("style",g);var de=T;(d.updateQueue=de)&&(d.flags|=4)}},RE=function(l,d,g,b){g!==b&&(d.flags|=4)};function Wu(l,d){if(!Ut)switch(l.tailMode){case"hidden":d=l.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var b=null;g!==null;)g.alternate!==null&&(b=g),g=g.sibling;b===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:b.sibling=null}}function Fn(l){var d=l.alternate!==null&&l.alternate.child===l.child,g=0,b=0;if(d)for(var _=l.child;_!==null;)g|=_.lanes|_.childLanes,b|=_.subtreeFlags&14680064,b|=_.flags&14680064,_.return=l,_=_.sibling;else for(_=l.child;_!==null;)g|=_.lanes|_.childLanes,b|=_.subtreeFlags,b|=_.flags,_.return=l,_=_.sibling;return l.subtreeFlags|=b,l.childLanes=g,d}function _z(l,d,g){var b=d.pendingProps;switch(Qg(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fn(d),null;case 1:return rr(d.type)&&Rf(),Fn(d),null;case 3:return b=d.stateNode,qa(),zt(nr),zt(jn),dy(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(l===null||l.child===null)&&(jf(d)?d.flags|=4:l===null||l.memoizedState.isDehydrated&&!(d.flags&256)||(d.flags|=1024,Kr!==null&&(By(Kr),Kr=null))),Py(l,d),Fn(d),null;case 5:uy(d);var _=Ls(Fu.current);if(g=d.type,l!==null&&d.stateNode!=null)PE(l,d,g,b,_),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!b){if(d.stateNode===null)throw Error(n(166));return Fn(d),null}if(l=Ls(wi.current),jf(d)){b=d.stateNode,g=d.type;var T=d.memoizedProps;switch(b[xi]=d,b[Du]=T,l=(d.mode&1)!==0,g){case"dialog":Ft("cancel",b),Ft("close",b);break;case"iframe":case"object":case"embed":Ft("load",b);break;case"video":case"audio":for(_=0;_<Pu.length;_++)Ft(Pu[_],b);break;case"source":Ft("error",b);break;case"img":case"image":case"link":Ft("error",b),Ft("load",b);break;case"details":Ft("toggle",b);break;case"input":$e(b,T),Ft("invalid",b);break;case"select":b._wrapperState={wasMultiple:!!T.multiple},Ft("invalid",b);break;case"textarea":me(b,T),Ft("invalid",b)}yt(g,T),_=null;for(var z in T)if(T.hasOwnProperty(z)){var X=T[z];z==="children"?typeof X=="string"?b.textContent!==X&&(T.suppressHydrationWarning!==!0&&Tf(b.textContent,X,l),_=["children",X]):typeof X=="number"&&b.textContent!==""+X&&(T.suppressHydrationWarning!==!0&&Tf(b.textContent,X,l),_=["children",""+X]):i.hasOwnProperty(z)&&X!=null&&z==="onScroll"&&Ft("scroll",b)}switch(g){case"input":ke(b),Q(b,T,!0);break;case"textarea":ke(b),Fe(b);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(b.onclick=Af)}b=_,d.updateQueue=b,b!==null&&(d.flags|=4)}else{z=_.nodeType===9?_:_.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=ce(g)),l==="http://www.w3.org/1999/xhtml"?g==="script"?(l=z.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof b.is=="string"?l=z.createElement(g,{is:b.is}):(l=z.createElement(g),g==="select"&&(z=l,b.multiple?z.multiple=!0:b.size&&(z.size=b.size))):l=z.createElementNS(l,g),l[xi]=d,l[Du]=b,AE(l,d,!1,!1),d.stateNode=l;e:{switch(z=yn(g,b),g){case"dialog":Ft("cancel",l),Ft("close",l),_=b;break;case"iframe":case"object":case"embed":Ft("load",l),_=b;break;case"video":case"audio":for(_=0;_<Pu.length;_++)Ft(Pu[_],l);_=b;break;case"source":Ft("error",l),_=b;break;case"img":case"image":case"link":Ft("error",l),Ft("load",l),_=b;break;case"details":Ft("toggle",l),_=b;break;case"input":$e(l,b),_=Me(l,b),Ft("invalid",l);break;case"option":_=b;break;case"select":l._wrapperState={wasMultiple:!!b.multiple},_=L({},b,{value:void 0}),Ft("invalid",l);break;case"textarea":me(l,b),_=we(l,b),Ft("invalid",l);break;default:_=b}yt(g,_),X=_;for(T in X)if(X.hasOwnProperty(T)){var te=X[T];T==="style"?at(l,te):T==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&Ke(l,te)):T==="children"?typeof te=="string"?(g!=="textarea"||te!=="")&&tt(l,te):typeof te=="number"&&tt(l,""+te):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(i.hasOwnProperty(T)?te!=null&&T==="onScroll"&&Ft("scroll",l):te!=null&&C(l,T,te,z))}switch(g){case"input":ke(l),Q(l,b,!1);break;case"textarea":ke(l),Fe(l);break;case"option":b.value!=null&&l.setAttribute("value",""+re(b.value));break;case"select":l.multiple=!!b.multiple,T=b.value,T!=null?Ce(l,!!b.multiple,T,!1):b.defaultValue!=null&&Ce(l,!!b.multiple,b.defaultValue,!0);break;default:typeof _.onClick=="function"&&(l.onclick=Af)}switch(g){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}}b&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return Fn(d),null;case 6:if(l&&d.stateNode!=null)RE(l,d,l.memoizedProps,b);else{if(typeof b!="string"&&d.stateNode===null)throw Error(n(166));if(g=Ls(Fu.current),Ls(wi.current),jf(d)){if(b=d.stateNode,g=d.memoizedProps,b[xi]=d,(T=b.nodeValue!==g)&&(l=gr,l!==null))switch(l.tag){case 3:Tf(b.nodeValue,g,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Tf(b.nodeValue,g,(l.mode&1)!==0)}T&&(d.flags|=4)}else b=(g.nodeType===9?g:g.ownerDocument).createTextNode(b),b[xi]=d,d.stateNode=b}return Fn(d),null;case 13:if(zt(Zt),b=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Ut&&yr!==null&&d.mode&1&&!(d.flags&128))OS(),Wa(),d.flags|=98560,T=!1;else if(T=jf(d),b!==null&&b.dehydrated!==null){if(l===null){if(!T)throw Error(n(318));if(T=d.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[xi]=d}else Wa(),!(d.flags&128)&&(d.memoizedState=null),d.flags|=4;Fn(d),T=!1}else Kr!==null&&(By(Kr),Kr=null),T=!0;if(!T)return d.flags&65536?d:null}return d.flags&128?(d.lanes=g,d):(b=b!==null,b!==(l!==null&&l.memoizedState!==null)&&b&&(d.child.flags|=8192,d.mode&1&&(l===null||Zt.current&1?wn===0&&(wn=3):Uy())),d.updateQueue!==null&&(d.flags|=4),Fn(d),null);case 4:return qa(),Py(l,d),l===null&&Ru(d.stateNode.containerInfo),Fn(d),null;case 10:return iy(d.type._context),Fn(d),null;case 17:return rr(d.type)&&Rf(),Fn(d),null;case 19:if(zt(Zt),T=d.memoizedState,T===null)return Fn(d),null;if(b=(d.flags&128)!==0,z=T.rendering,z===null)if(b)Wu(T,!1);else{if(wn!==0||l!==null&&l.flags&128)for(l=d.child;l!==null;){if(z=Vf(l),z!==null){for(d.flags|=128,Wu(T,!1),b=z.updateQueue,b!==null&&(d.updateQueue=b,d.flags|=4),d.subtreeFlags=0,b=g,g=d.child;g!==null;)T=g,l=b,T.flags&=14680066,z=T.alternate,z===null?(T.childLanes=0,T.lanes=l,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=z.childLanes,T.lanes=z.lanes,T.child=z.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=z.memoizedProps,T.memoizedState=z.memoizedState,T.updateQueue=z.updateQueue,T.type=z.type,l=z.dependencies,T.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),g=g.sibling;return Dt(Zt,Zt.current&1|2),d.child}l=l.sibling}T.tail!==null&&Gt()>Xa&&(d.flags|=128,b=!0,Wu(T,!1),d.lanes=4194304)}else{if(!b)if(l=Vf(z),l!==null){if(d.flags|=128,b=!0,g=l.updateQueue,g!==null&&(d.updateQueue=g,d.flags|=4),Wu(T,!0),T.tail===null&&T.tailMode==="hidden"&&!z.alternate&&!Ut)return Fn(d),null}else 2*Gt()-T.renderingStartTime>Xa&&g!==1073741824&&(d.flags|=128,b=!0,Wu(T,!1),d.lanes=4194304);T.isBackwards?(z.sibling=d.child,d.child=z):(g=T.last,g!==null?g.sibling=z:d.child=z,T.last=z)}return T.tail!==null?(d=T.tail,T.rendering=d,T.tail=d.sibling,T.renderingStartTime=Gt(),d.sibling=null,g=Zt.current,Dt(Zt,b?g&1|2:g&1),d):(Fn(d),null);case 22:case 23:return Wy(),b=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==b&&(d.flags|=8192),b&&d.mode&1?vr&1073741824&&(Fn(d),d.subtreeFlags&6&&(d.flags|=8192)):Fn(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function Nz(l,d){switch(Qg(d),d.tag){case 1:return rr(d.type)&&Rf(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return qa(),zt(nr),zt(jn),dy(),l=d.flags,l&65536&&!(l&128)?(d.flags=l&-65537|128,d):null;case 5:return uy(d),null;case 13:if(zt(Zt),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(n(340));Wa()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return zt(Zt),null;case 4:return qa(),null;case 10:return iy(d.type._context),null;case 22:case 23:return Wy(),null;case 24:return null;default:return null}}var Xf=!1,zn=!1,Tz=typeof WeakSet=="function"?WeakSet:Set,je=null;function Za(l,d){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(b){Jt(l,d,b)}else g.current=null}function Ry(l,d,g){try{g()}catch(b){Jt(l,d,b)}}var ME=!1;function Az(l,d){if(Wg=yf,l=cS(),Ig(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var b=g.getSelection&&g.getSelection();if(b&&b.rangeCount!==0){g=b.anchorNode;var _=b.anchorOffset,T=b.focusNode;b=b.focusOffset;try{g.nodeType,T.nodeType}catch{g=null;break e}var z=0,X=-1,te=-1,de=0,xe=0,be=l,ye=null;t:for(;;){for(var De;be!==g||_!==0&&be.nodeType!==3||(X=z+_),be!==T||b!==0&&be.nodeType!==3||(te=z+b),be.nodeType===3&&(z+=be.nodeValue.length),(De=be.firstChild)!==null;)ye=be,be=De;for(;;){if(be===l)break t;if(ye===g&&++de===_&&(X=z),ye===T&&++xe===b&&(te=z),(De=be.nextSibling)!==null)break;be=ye,ye=be.parentNode}be=De}g=X===-1||te===-1?null:{start:X,end:te}}else g=null}g=g||{start:0,end:0}}else g=null;for(Ug={focusedElem:l,selectionRange:g},yf=!1,je=d;je!==null;)if(d=je,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,je=l;else for(;je!==null;){d=je;try{var Le=d.alternate;if(d.flags&1024)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Le!==null){var ze=Le.memoizedProps,rn=Le.memoizedState,se=d.stateNode,ie=se.getSnapshotBeforeUpdate(d.elementType===d.type?ze:Xr(d.type,ze),rn);se.__reactInternalSnapshotBeforeUpdate=ie}break;case 3:var le=d.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(_e){Jt(d,d.return,_e)}if(l=d.sibling,l!==null){l.return=d.return,je=l;break}je=d.return}return Le=ME,ME=!1,Le}function Uu(l,d,g){var b=d.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var _=b=b.next;do{if((_.tag&l)===l){var T=_.destroy;_.destroy=void 0,T!==void 0&&Ry(d,g,T)}_=_.next}while(_!==b)}}function Qf(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&l)===l){var b=g.create;g.destroy=b()}g=g.next}while(g!==d)}}function My(l){var d=l.ref;if(d!==null){var g=l.stateNode;switch(l.tag){case 5:l=g;break;default:l=g}typeof d=="function"?d(l):d.current=l}}function DE(l){var d=l.alternate;d!==null&&(l.alternate=null,DE(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[xi],delete d[Du],delete d[Gg],delete d[dz],delete d[fz])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function OE(l){return l.tag===5||l.tag===3||l.tag===4}function IE(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||OE(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Dy(l,d,g){var b=l.tag;if(b===5||b===6)l=l.stateNode,d?g.nodeType===8?g.parentNode.insertBefore(l,d):g.insertBefore(l,d):(g.nodeType===8?(d=g.parentNode,d.insertBefore(l,g)):(d=g,d.appendChild(l)),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=Af));else if(b!==4&&(l=l.child,l!==null))for(Dy(l,d,g),l=l.sibling;l!==null;)Dy(l,d,g),l=l.sibling}function Oy(l,d,g){var b=l.tag;if(b===5||b===6)l=l.stateNode,d?g.insertBefore(l,d):g.appendChild(l);else if(b!==4&&(l=l.child,l!==null))for(Oy(l,d,g),l=l.sibling;l!==null;)Oy(l,d,g),l=l.sibling}var Mn=null,Qr=!1;function Uo(l,d,g){for(g=g.child;g!==null;)jE(l,d,g),g=g.sibling}function jE(l,d,g){if(Dr&&typeof Dr.onCommitFiberUnmount=="function")try{Dr.onCommitFiberUnmount(Na,g)}catch{}switch(g.tag){case 5:zn||Za(g,d);case 6:var b=Mn,_=Qr;Mn=null,Uo(l,d,g),Mn=b,Qr=_,Mn!==null&&(Qr?(l=Mn,g=g.stateNode,l.nodeType===8?l.parentNode.removeChild(g):l.removeChild(g)):Mn.removeChild(g.stateNode));break;case 18:Mn!==null&&(Qr?(l=Mn,g=g.stateNode,l.nodeType===8?qg(l.parentNode,g):l.nodeType===1&&qg(l,g),ku(l)):qg(Mn,g.stateNode));break;case 4:b=Mn,_=Qr,Mn=g.stateNode.containerInfo,Qr=!0,Uo(l,d,g),Mn=b,Qr=_;break;case 0:case 11:case 14:case 15:if(!zn&&(b=g.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){_=b=b.next;do{var T=_,z=T.destroy;T=T.tag,z!==void 0&&(T&2||T&4)&&Ry(g,d,z),_=_.next}while(_!==b)}Uo(l,d,g);break;case 1:if(!zn&&(Za(g,d),b=g.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=g.memoizedProps,b.state=g.memoizedState,b.componentWillUnmount()}catch(X){Jt(g,d,X)}Uo(l,d,g);break;case 21:Uo(l,d,g);break;case 22:g.mode&1?(zn=(b=zn)||g.memoizedState!==null,Uo(l,d,g),zn=b):Uo(l,d,g);break;default:Uo(l,d,g)}}function LE(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new Tz),d.forEach(function(b){var _=Fz.bind(null,l,b);g.has(b)||(g.add(b),b.then(_,_))})}}function Jr(l,d){var g=d.deletions;if(g!==null)for(var b=0;b<g.length;b++){var _=g[b];try{var T=l,z=d,X=z;e:for(;X!==null;){switch(X.tag){case 5:Mn=X.stateNode,Qr=!1;break e;case 3:Mn=X.stateNode.containerInfo,Qr=!0;break e;case 4:Mn=X.stateNode.containerInfo,Qr=!0;break e}X=X.return}if(Mn===null)throw Error(n(160));jE(T,z,_),Mn=null,Qr=!1;var te=_.alternate;te!==null&&(te.return=null),_.return=null}catch(de){Jt(_,d,de)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)FE(d,l),d=d.sibling}function FE(l,d){var g=l.alternate,b=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Jr(d,l),ki(l),b&4){try{Uu(3,l,l.return),Qf(3,l)}catch(ze){Jt(l,l.return,ze)}try{Uu(5,l,l.return)}catch(ze){Jt(l,l.return,ze)}}break;case 1:Jr(d,l),ki(l),b&512&&g!==null&&Za(g,g.return);break;case 5:if(Jr(d,l),ki(l),b&512&&g!==null&&Za(g,g.return),l.flags&32){var _=l.stateNode;try{tt(_,"")}catch(ze){Jt(l,l.return,ze)}}if(b&4&&(_=l.stateNode,_!=null)){var T=l.memoizedProps,z=g!==null?g.memoizedProps:T,X=l.type,te=l.updateQueue;if(l.updateQueue=null,te!==null)try{X==="input"&&T.type==="radio"&&T.name!=null&&ct(_,T),yn(X,z);var de=yn(X,T);for(z=0;z<te.length;z+=2){var xe=te[z],be=te[z+1];xe==="style"?at(_,be):xe==="dangerouslySetInnerHTML"?Ke(_,be):xe==="children"?tt(_,be):C(_,xe,be,de)}switch(X){case"input":_t(_,T);break;case"textarea":Ae(_,T);break;case"select":var ye=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!T.multiple;var De=T.value;De!=null?Ce(_,!!T.multiple,De,!1):ye!==!!T.multiple&&(T.defaultValue!=null?Ce(_,!!T.multiple,T.defaultValue,!0):Ce(_,!!T.multiple,T.multiple?[]:"",!1))}_[Du]=T}catch(ze){Jt(l,l.return,ze)}}break;case 6:if(Jr(d,l),ki(l),b&4){if(l.stateNode===null)throw Error(n(162));_=l.stateNode,T=l.memoizedProps;try{_.nodeValue=T}catch(ze){Jt(l,l.return,ze)}}break;case 3:if(Jr(d,l),ki(l),b&4&&g!==null&&g.memoizedState.isDehydrated)try{ku(d.containerInfo)}catch(ze){Jt(l,l.return,ze)}break;case 4:Jr(d,l),ki(l);break;case 13:Jr(d,l),ki(l),_=l.child,_.flags&8192&&(T=_.memoizedState!==null,_.stateNode.isHidden=T,!T||_.alternate!==null&&_.alternate.memoizedState!==null||(Ly=Gt())),b&4&&LE(l);break;case 22:if(xe=g!==null&&g.memoizedState!==null,l.mode&1?(zn=(de=zn)||xe,Jr(d,l),zn=de):Jr(d,l),ki(l),b&8192){if(de=l.memoizedState!==null,(l.stateNode.isHidden=de)&&!xe&&l.mode&1)for(je=l,xe=l.child;xe!==null;){for(be=je=xe;je!==null;){switch(ye=je,De=ye.child,ye.tag){case 0:case 11:case 14:case 15:Uu(4,ye,ye.return);break;case 1:Za(ye,ye.return);var Le=ye.stateNode;if(typeof Le.componentWillUnmount=="function"){b=ye,g=ye.return;try{d=b,Le.props=d.memoizedProps,Le.state=d.memoizedState,Le.componentWillUnmount()}catch(ze){Jt(b,g,ze)}}break;case 5:Za(ye,ye.return);break;case 22:if(ye.memoizedState!==null){BE(be);continue}}De!==null?(De.return=ye,je=De):BE(be)}xe=xe.sibling}e:for(xe=null,be=l;;){if(be.tag===5){if(xe===null){xe=be;try{_=be.stateNode,de?(T=_.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(X=be.stateNode,te=be.memoizedProps.style,z=te!=null&&te.hasOwnProperty("display")?te.display:null,X.style.display=it("display",z))}catch(ze){Jt(l,l.return,ze)}}}else if(be.tag===6){if(xe===null)try{be.stateNode.nodeValue=de?"":be.memoizedProps}catch(ze){Jt(l,l.return,ze)}}else if((be.tag!==22&&be.tag!==23||be.memoizedState===null||be===l)&&be.child!==null){be.child.return=be,be=be.child;continue}if(be===l)break e;for(;be.sibling===null;){if(be.return===null||be.return===l)break e;xe===be&&(xe=null),be=be.return}xe===be&&(xe=null),be.sibling.return=be.return,be=be.sibling}}break;case 19:Jr(d,l),ki(l),b&4&&LE(l);break;case 21:break;default:Jr(d,l),ki(l)}}function ki(l){var d=l.flags;if(d&2){try{e:{for(var g=l.return;g!==null;){if(OE(g)){var b=g;break e}g=g.return}throw Error(n(160))}switch(b.tag){case 5:var _=b.stateNode;b.flags&32&&(tt(_,""),b.flags&=-33);var T=IE(l);Oy(l,T,_);break;case 3:case 4:var z=b.stateNode.containerInfo,X=IE(l);Dy(l,X,z);break;default:throw Error(n(161))}}catch(te){Jt(l,l.return,te)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function Pz(l,d,g){je=l,zE(l)}function zE(l,d,g){for(var b=(l.mode&1)!==0;je!==null;){var _=je,T=_.child;if(_.tag===22&&b){var z=_.memoizedState!==null||Xf;if(!z){var X=_.alternate,te=X!==null&&X.memoizedState!==null||zn;X=Xf;var de=zn;if(Xf=z,(zn=te)&&!de)for(je=_;je!==null;)z=je,te=z.child,z.tag===22&&z.memoizedState!==null?VE(_):te!==null?(te.return=z,je=te):VE(_);for(;T!==null;)je=T,zE(T),T=T.sibling;je=_,Xf=X,zn=de}$E(l)}else _.subtreeFlags&8772&&T!==null?(T.return=_,je=T):$E(l)}}function $E(l){for(;je!==null;){var d=je;if(d.flags&8772){var g=d.alternate;try{if(d.flags&8772)switch(d.tag){case 0:case 11:case 15:zn||Qf(5,d);break;case 1:var b=d.stateNode;if(d.flags&4&&!zn)if(g===null)b.componentDidMount();else{var _=d.elementType===d.type?g.memoizedProps:Xr(d.type,g.memoizedProps);b.componentDidUpdate(_,g.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var T=d.updateQueue;T!==null&&BS(d,T,b);break;case 3:var z=d.updateQueue;if(z!==null){if(g=null,d.child!==null)switch(d.child.tag){case 5:g=d.child.stateNode;break;case 1:g=d.child.stateNode}BS(d,z,g)}break;case 5:var X=d.stateNode;if(g===null&&d.flags&4){g=X;var te=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&g.focus();break;case"img":te.src&&(g.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var de=d.alternate;if(de!==null){var xe=de.memoizedState;if(xe!==null){var be=xe.dehydrated;be!==null&&ku(be)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}zn||d.flags&512&&My(d)}catch(ye){Jt(d,d.return,ye)}}if(d===l){je=null;break}if(g=d.sibling,g!==null){g.return=d.return,je=g;break}je=d.return}}function BE(l){for(;je!==null;){var d=je;if(d===l){je=null;break}var g=d.sibling;if(g!==null){g.return=d.return,je=g;break}je=d.return}}function VE(l){for(;je!==null;){var d=je;try{switch(d.tag){case 0:case 11:case 15:var g=d.return;try{Qf(4,d)}catch(te){Jt(d,g,te)}break;case 1:var b=d.stateNode;if(typeof b.componentDidMount=="function"){var _=d.return;try{b.componentDidMount()}catch(te){Jt(d,_,te)}}var T=d.return;try{My(d)}catch(te){Jt(d,T,te)}break;case 5:var z=d.return;try{My(d)}catch(te){Jt(d,z,te)}}}catch(te){Jt(d,d.return,te)}if(d===l){je=null;break}var X=d.sibling;if(X!==null){X.return=d.return,je=X;break}je=d.return}}var Rz=Math.ceil,Jf=N.ReactCurrentDispatcher,Iy=N.ReactCurrentOwner,Fr=N.ReactCurrentBatchConfig,wt=0,_n=null,ln=null,Dn=0,vr=0,Ka=zo(0),wn=0,Hu=null,zs=0,eh=0,jy=0,Yu=null,or=null,Ly=0,Xa=1/0,to=null,th=!1,Fy=null,Ho=null,nh=!1,Yo=null,rh=0,qu=0,zy=null,ih=-1,oh=0;function Zn(){return wt&6?Gt():ih!==-1?ih:ih=Gt()}function qo(l){return l.mode&1?wt&2&&Dn!==0?Dn&-Dn:pz.transition!==null?(oh===0&&(oh=Ik()),oh):(l=Nt,l!==0||(l=window.event,l=l===void 0?16:Uk(l.type)),l):1}function ei(l,d,g,b){if(50<qu)throw qu=0,zy=null,Error(n(185));yu(l,g,b),(!(wt&2)||l!==_n)&&(l===_n&&(!(wt&2)&&(eh|=g),wn===4&&Go(l,Dn)),sr(l,b),g===1&&wt===0&&!(d.mode&1)&&(Xa=Gt()+500,Df&&Bo()))}function sr(l,d){var g=l.callbackNode;p3(l,d);var b=Pa(l,l===_n?Dn:0);if(b===0)g!==null&&ff(g),l.callbackNode=null,l.callbackPriority=0;else if(d=b&-b,l.callbackPriority!==d){if(g!=null&&ff(g),d===1)l.tag===0?hz(UE.bind(null,l)):AS(UE.bind(null,l)),uz(function(){!(wt&6)&&Bo()}),g=null;else{switch(jk(b)){case 1:g=mu;break;case 4:g=pf;break;case 16:g=_a;break;case 536870912:g=gu;break;default:g=_a}g=QE(g,WE.bind(null,l))}l.callbackPriority=d,l.callbackNode=g}}function WE(l,d){if(ih=-1,oh=0,wt&6)throw Error(n(327));var g=l.callbackNode;if(Qa()&&l.callbackNode!==g)return null;var b=Pa(l,l===_n?Dn:0);if(b===0)return null;if(b&30||b&l.expiredLanes||d)d=sh(l,b);else{d=b;var _=wt;wt|=2;var T=YE();(_n!==l||Dn!==d)&&(to=null,Xa=Gt()+500,Bs(l,d));do try{Oz();break}catch(X){HE(l,X)}while(!0);ry(),Jf.current=T,wt=_,ln!==null?d=0:(_n=null,Dn=0,d=wn)}if(d!==0){if(d===2&&(_=xg(l),_!==0&&(b=_,d=$y(l,_))),d===1)throw g=Hu,Bs(l,0),Go(l,b),sr(l,Gt()),g;if(d===6)Go(l,b);else{if(_=l.current.alternate,!(b&30)&&!Mz(_)&&(d=sh(l,b),d===2&&(T=xg(l),T!==0&&(b=T,d=$y(l,T))),d===1))throw g=Hu,Bs(l,0),Go(l,b),sr(l,Gt()),g;switch(l.finishedWork=_,l.finishedLanes=b,d){case 0:case 1:throw Error(n(345));case 2:Vs(l,or,to);break;case 3:if(Go(l,b),(b&130023424)===b&&(d=Ly+500-Gt(),10<d)){if(Pa(l,0)!==0)break;if(_=l.suspendedLanes,(_&b)!==b){Zn(),l.pingedLanes|=l.suspendedLanes&_;break}l.timeoutHandle=Yg(Vs.bind(null,l,or,to),d);break}Vs(l,or,to);break;case 4:if(Go(l,b),(b&4194240)===b)break;for(d=l.eventTimes,_=-1;0<b;){var z=31-pr(b);T=1<<z,z=d[z],z>_&&(_=z),b&=~T}if(b=_,b=Gt()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*Rz(b/1960))-b,10<b){l.timeoutHandle=Yg(Vs.bind(null,l,or,to),b);break}Vs(l,or,to);break;case 5:Vs(l,or,to);break;default:throw Error(n(329))}}}return sr(l,Gt()),l.callbackNode===g?WE.bind(null,l):null}function $y(l,d){var g=Yu;return l.current.memoizedState.isDehydrated&&(Bs(l,d).flags|=256),l=sh(l,d),l!==2&&(d=or,or=g,d!==null&&By(d)),l}function By(l){or===null?or=l:or.push.apply(or,l)}function Mz(l){for(var d=l;;){if(d.flags&16384){var g=d.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var b=0;b<g.length;b++){var _=g[b],T=_.getSnapshot;_=_.value;try{if(!Zr(T(),_))return!1}catch{return!1}}}if(g=d.child,d.subtreeFlags&16384&&g!==null)g.return=d,d=g;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Go(l,d){for(d&=~jy,d&=~eh,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var g=31-pr(d),b=1<<g;l[g]=-1,d&=~b}}function UE(l){if(wt&6)throw Error(n(327));Qa();var d=Pa(l,0);if(!(d&1))return sr(l,Gt()),null;var g=sh(l,d);if(l.tag!==0&&g===2){var b=xg(l);b!==0&&(d=b,g=$y(l,b))}if(g===1)throw g=Hu,Bs(l,0),Go(l,d),sr(l,Gt()),g;if(g===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,Vs(l,or,to),sr(l,Gt()),null}function Vy(l,d){var g=wt;wt|=1;try{return l(d)}finally{wt=g,wt===0&&(Xa=Gt()+500,Df&&Bo())}}function $s(l){Yo!==null&&Yo.tag===0&&!(wt&6)&&Qa();var d=wt;wt|=1;var g=Fr.transition,b=Nt;try{if(Fr.transition=null,Nt=1,l)return l()}finally{Nt=b,Fr.transition=g,wt=d,!(wt&6)&&Bo()}}function Wy(){vr=Ka.current,zt(Ka)}function Bs(l,d){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==-1&&(l.timeoutHandle=-1,lz(g)),ln!==null)for(g=ln.return;g!==null;){var b=g;switch(Qg(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&Rf();break;case 3:qa(),zt(nr),zt(jn),dy();break;case 5:uy(b);break;case 4:qa();break;case 13:zt(Zt);break;case 19:zt(Zt);break;case 10:iy(b.type._context);break;case 22:case 23:Wy()}g=g.return}if(_n=l,ln=l=Zo(l.current,null),Dn=vr=d,wn=0,Hu=null,jy=eh=zs=0,or=Yu=null,js!==null){for(d=0;d<js.length;d++)if(g=js[d],b=g.interleaved,b!==null){g.interleaved=null;var _=b.next,T=g.pending;if(T!==null){var z=T.next;T.next=_,b.next=z}g.pending=b}js=null}return l}function HE(l,d){do{var g=ln;try{if(ry(),Wf.current=qf,Uf){for(var b=Kt.memoizedState;b!==null;){var _=b.queue;_!==null&&(_.pending=null),b=b.next}Uf=!1}if(Fs=0,Cn=xn=Kt=null,zu=!1,$u=0,Iy.current=null,g===null||g.return===null){wn=1,Hu=d,ln=null;break}e:{var T=l,z=g.return,X=g,te=d;if(d=Dn,X.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var de=te,xe=X,be=xe.tag;if(!(xe.mode&1)&&(be===0||be===11||be===15)){var ye=xe.alternate;ye?(xe.updateQueue=ye.updateQueue,xe.memoizedState=ye.memoizedState,xe.lanes=ye.lanes):(xe.updateQueue=null,xe.memoizedState=null)}var De=gE(z);if(De!==null){De.flags&=-257,yE(De,z,X,T,d),De.mode&1&&mE(T,de,d),d=De,te=de;var Le=d.updateQueue;if(Le===null){var ze=new Set;ze.add(te),d.updateQueue=ze}else Le.add(te);break e}else{if(!(d&1)){mE(T,de,d),Uy();break e}te=Error(n(426))}}else if(Ut&&X.mode&1){var rn=gE(z);if(rn!==null){!(rn.flags&65536)&&(rn.flags|=256),yE(rn,z,X,T,d),ty(Ga(te,X));break e}}T=te=Ga(te,X),wn!==4&&(wn=2),Yu===null?Yu=[T]:Yu.push(T),T=z;do{switch(T.tag){case 3:T.flags|=65536,d&=-d,T.lanes|=d;var se=hE(T,te,d);$S(T,se);break e;case 1:X=te;var ie=T.type,le=T.stateNode;if(!(T.flags&128)&&(typeof ie.getDerivedStateFromError=="function"||le!==null&&typeof le.componentDidCatch=="function"&&(Ho===null||!Ho.has(le)))){T.flags|=65536,d&=-d,T.lanes|=d;var _e=pE(T,X,d);$S(T,_e);break e}}T=T.return}while(T!==null)}GE(g)}catch(Be){d=Be,ln===g&&g!==null&&(ln=g=g.return);continue}break}while(!0)}function YE(){var l=Jf.current;return Jf.current=qf,l===null?qf:l}function Uy(){(wn===0||wn===3||wn===2)&&(wn=4),_n===null||!(zs&268435455)&&!(eh&268435455)||Go(_n,Dn)}function sh(l,d){var g=wt;wt|=2;var b=YE();(_n!==l||Dn!==d)&&(to=null,Bs(l,d));do try{Dz();break}catch(_){HE(l,_)}while(!0);if(ry(),wt=g,Jf.current=b,ln!==null)throw Error(n(261));return _n=null,Dn=0,wn}function Dz(){for(;ln!==null;)qE(ln)}function Oz(){for(;ln!==null&&!hf();)qE(ln)}function qE(l){var d=XE(l.alternate,l,vr);l.memoizedProps=l.pendingProps,d===null?GE(l):ln=d,Iy.current=null}function GE(l){var d=l;do{var g=d.alternate;if(l=d.return,d.flags&32768){if(g=Nz(g,d),g!==null){g.flags&=32767,ln=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{wn=6,ln=null;return}}else if(g=_z(g,d,vr),g!==null){ln=g;return}if(d=d.sibling,d!==null){ln=d;return}ln=d=l}while(d!==null);wn===0&&(wn=5)}function Vs(l,d,g){var b=Nt,_=Fr.transition;try{Fr.transition=null,Nt=1,Iz(l,d,g,b)}finally{Fr.transition=_,Nt=b}return null}function Iz(l,d,g,b){do Qa();while(Yo!==null);if(wt&6)throw Error(n(327));g=l.finishedWork;var _=l.finishedLanes;if(g===null)return null;if(l.finishedWork=null,l.finishedLanes=0,g===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var T=g.lanes|g.childLanes;if(m3(l,T),l===_n&&(ln=_n=null,Dn=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||nh||(nh=!0,QE(_a,function(){return Qa(),null})),T=(g.flags&15990)!==0,g.subtreeFlags&15990||T){T=Fr.transition,Fr.transition=null;var z=Nt;Nt=1;var X=wt;wt|=4,Iy.current=null,Az(l,g),FE(g,l),tz(Ug),yf=!!Wg,Ug=Wg=null,l.current=g,Pz(g),fg(),wt=X,Nt=z,Fr.transition=T}else l.current=g;if(nh&&(nh=!1,Yo=l,rh=_),T=l.pendingLanes,T===0&&(Ho=null),mg(g.stateNode),sr(l,Gt()),d!==null)for(b=l.onRecoverableError,g=0;g<d.length;g++)_=d[g],b(_.value,{componentStack:_.stack,digest:_.digest});if(th)throw th=!1,l=Fy,Fy=null,l;return rh&1&&l.tag!==0&&Qa(),T=l.pendingLanes,T&1?l===zy?qu++:(qu=0,zy=l):qu=0,Bo(),null}function Qa(){if(Yo!==null){var l=jk(rh),d=Fr.transition,g=Nt;try{if(Fr.transition=null,Nt=16>l?16:l,Yo===null)var b=!1;else{if(l=Yo,Yo=null,rh=0,wt&6)throw Error(n(331));var _=wt;for(wt|=4,je=l.current;je!==null;){var T=je,z=T.child;if(je.flags&16){var X=T.deletions;if(X!==null){for(var te=0;te<X.length;te++){var de=X[te];for(je=de;je!==null;){var xe=je;switch(xe.tag){case 0:case 11:case 15:Uu(8,xe,T)}var be=xe.child;if(be!==null)be.return=xe,je=be;else for(;je!==null;){xe=je;var ye=xe.sibling,De=xe.return;if(DE(xe),xe===de){je=null;break}if(ye!==null){ye.return=De,je=ye;break}je=De}}}var Le=T.alternate;if(Le!==null){var ze=Le.child;if(ze!==null){Le.child=null;do{var rn=ze.sibling;ze.sibling=null,ze=rn}while(ze!==null)}}je=T}}if(T.subtreeFlags&2064&&z!==null)z.return=T,je=z;else e:for(;je!==null;){if(T=je,T.flags&2048)switch(T.tag){case 0:case 11:case 15:Uu(9,T,T.return)}var se=T.sibling;if(se!==null){se.return=T.return,je=se;break e}je=T.return}}var ie=l.current;for(je=ie;je!==null;){z=je;var le=z.child;if(z.subtreeFlags&2064&&le!==null)le.return=z,je=le;else e:for(z=ie;je!==null;){if(X=je,X.flags&2048)try{switch(X.tag){case 0:case 11:case 15:Qf(9,X)}}catch(Be){Jt(X,X.return,Be)}if(X===z){je=null;break e}var _e=X.sibling;if(_e!==null){_e.return=X.return,je=_e;break e}je=X.return}}if(wt=_,Bo(),Dr&&typeof Dr.onPostCommitFiberRoot=="function")try{Dr.onPostCommitFiberRoot(Na,l)}catch{}b=!0}return b}finally{Nt=g,Fr.transition=d}}return!1}function ZE(l,d,g){d=Ga(g,d),d=hE(l,d,1),l=Wo(l,d,1),d=Zn(),l!==null&&(yu(l,1,d),sr(l,d))}function Jt(l,d,g){if(l.tag===3)ZE(l,l,g);else for(;d!==null;){if(d.tag===3){ZE(d,l,g);break}else if(d.tag===1){var b=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Ho===null||!Ho.has(b))){l=Ga(g,l),l=pE(d,l,1),d=Wo(d,l,1),l=Zn(),d!==null&&(yu(d,1,l),sr(d,l));break}}d=d.return}}function jz(l,d,g){var b=l.pingCache;b!==null&&b.delete(d),d=Zn(),l.pingedLanes|=l.suspendedLanes&g,_n===l&&(Dn&g)===g&&(wn===4||wn===3&&(Dn&130023424)===Dn&&500>Gt()-Ly?Bs(l,0):jy|=g),sr(l,d)}function KE(l,d){d===0&&(l.mode&1?(d=Aa,Aa<<=1,!(Aa&130023424)&&(Aa=4194304)):d=1);var g=Zn();l=Qi(l,d),l!==null&&(yu(l,d,g),sr(l,g))}function Lz(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),KE(l,g)}function Fz(l,d){var g=0;switch(l.tag){case 13:var b=l.stateNode,_=l.memoizedState;_!==null&&(g=_.retryLane);break;case 19:b=l.stateNode;break;default:throw Error(n(314))}b!==null&&b.delete(d),KE(l,g)}var XE;XE=function(l,d,g){if(l!==null)if(l.memoizedProps!==d.pendingProps||nr.current)ir=!0;else{if(!(l.lanes&g)&&!(d.flags&128))return ir=!1,Cz(l,d,g);ir=!!(l.flags&131072)}else ir=!1,Ut&&d.flags&1048576&&PS(d,If,d.index);switch(d.lanes=0,d.tag){case 2:var b=d.type;Kf(l,d),l=d.pendingProps;var _=$a(d,jn.current);Ya(d,g),_=py(null,d,b,l,_,g);var T=my();return d.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,rr(b)?(T=!0,Mf(d)):T=!1,d.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,ay(d),_.updater=Gf,d.stateNode=_,_._reactInternals=d,by(d,b,l,g),d=Cy(null,d,b,!0,T,g)):(d.tag=0,Ut&&T&&Xg(d),Gn(null,d,_,g),d=d.child),d;case 16:b=d.elementType;e:{switch(Kf(l,d),l=d.pendingProps,_=b._init,b=_(b._payload),d.type=b,_=d.tag=$z(b),l=Xr(b,l),_){case 0:d=Ey(null,d,b,l,g);break e;case 1:d=SE(null,d,b,l,g);break e;case 11:d=vE(null,d,b,l,g);break e;case 14:d=xE(null,d,b,Xr(b.type,l),g);break e}throw Error(n(306,b,""))}return d;case 0:return b=d.type,_=d.pendingProps,_=d.elementType===b?_:Xr(b,_),Ey(l,d,b,_,g);case 1:return b=d.type,_=d.pendingProps,_=d.elementType===b?_:Xr(b,_),SE(l,d,b,_,g);case 3:e:{if(EE(d),l===null)throw Error(n(387));b=d.pendingProps,T=d.memoizedState,_=T.element,zS(l,d),Bf(d,b,null,g);var z=d.memoizedState;if(b=z.element,T.isDehydrated)if(T={element:b,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},d.updateQueue.baseState=T,d.memoizedState=T,d.flags&256){_=Ga(Error(n(423)),d),d=CE(l,d,b,g,_);break e}else if(b!==_){_=Ga(Error(n(424)),d),d=CE(l,d,b,g,_);break e}else for(yr=Fo(d.stateNode.containerInfo.firstChild),gr=d,Ut=!0,Kr=null,g=LS(d,null,b,g),d.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(Wa(),b===_){d=eo(l,d,g);break e}Gn(l,d,b,g)}d=d.child}return d;case 5:return VS(d),l===null&&ey(d),b=d.type,_=d.pendingProps,T=l!==null?l.memoizedProps:null,z=_.children,Hg(b,_)?z=null:T!==null&&Hg(b,T)&&(d.flags|=32),kE(l,d),Gn(l,d,z,g),d.child;case 6:return l===null&&ey(d),null;case 13:return _E(l,d,g);case 4:return ly(d,d.stateNode.containerInfo),b=d.pendingProps,l===null?d.child=Ua(d,null,b,g):Gn(l,d,b,g),d.child;case 11:return b=d.type,_=d.pendingProps,_=d.elementType===b?_:Xr(b,_),vE(l,d,b,_,g);case 7:return Gn(l,d,d.pendingProps,g),d.child;case 8:return Gn(l,d,d.pendingProps.children,g),d.child;case 12:return Gn(l,d,d.pendingProps.children,g),d.child;case 10:e:{if(b=d.type._context,_=d.pendingProps,T=d.memoizedProps,z=_.value,Dt(Ff,b._currentValue),b._currentValue=z,T!==null)if(Zr(T.value,z)){if(T.children===_.children&&!nr.current){d=eo(l,d,g);break e}}else for(T=d.child,T!==null&&(T.return=d);T!==null;){var X=T.dependencies;if(X!==null){z=T.child;for(var te=X.firstContext;te!==null;){if(te.context===b){if(T.tag===1){te=Ji(-1,g&-g),te.tag=2;var de=T.updateQueue;if(de!==null){de=de.shared;var xe=de.pending;xe===null?te.next=te:(te.next=xe.next,xe.next=te),de.pending=te}}T.lanes|=g,te=T.alternate,te!==null&&(te.lanes|=g),oy(T.return,g,d),X.lanes|=g;break}te=te.next}}else if(T.tag===10)z=T.type===d.type?null:T.child;else if(T.tag===18){if(z=T.return,z===null)throw Error(n(341));z.lanes|=g,X=z.alternate,X!==null&&(X.lanes|=g),oy(z,g,d),z=T.sibling}else z=T.child;if(z!==null)z.return=T;else for(z=T;z!==null;){if(z===d){z=null;break}if(T=z.sibling,T!==null){T.return=z.return,z=T;break}z=z.return}T=z}Gn(l,d,_.children,g),d=d.child}return d;case 9:return _=d.type,b=d.pendingProps.children,Ya(d,g),_=jr(_),b=b(_),d.flags|=1,Gn(l,d,b,g),d.child;case 14:return b=d.type,_=Xr(b,d.pendingProps),_=Xr(b.type,_),xE(l,d,b,_,g);case 15:return wE(l,d,d.type,d.pendingProps,g);case 17:return b=d.type,_=d.pendingProps,_=d.elementType===b?_:Xr(b,_),Kf(l,d),d.tag=1,rr(b)?(l=!0,Mf(d)):l=!1,Ya(d,g),dE(d,b,_),by(d,b,_,g),Cy(null,d,b,!0,l,g);case 19:return TE(l,d,g);case 22:return bE(l,d,g)}throw Error(n(156,d.tag))};function QE(l,d){return df(l,d)}function zz(l,d,g,b){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zr(l,d,g,b){return new zz(l,d,g,b)}function Hy(l){return l=l.prototype,!(!l||!l.isReactComponent)}function $z(l){if(typeof l=="function")return Hy(l)?1:0;if(l!=null){if(l=l.$$typeof,l===F)return 11;if(l===q)return 14}return 2}function Zo(l,d){var g=l.alternate;return g===null?(g=zr(l.tag,d,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=d,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&14680064,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,d=l.dependencies,g.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function ah(l,d,g,b,_,T){var z=2;if(b=l,typeof l=="function")Hy(l)&&(z=1);else if(typeof l=="string")z=5;else e:switch(l){case O:return Ws(g.children,_,T,d);case M:z=8,_|=8;break;case j:return l=zr(12,g,d,_|2),l.elementType=j,l.lanes=T,l;case H:return l=zr(13,g,d,_),l.elementType=H,l.lanes=T,l;case I:return l=zr(19,g,d,_),l.elementType=I,l.lanes=T,l;case Z:return lh(g,_,T,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case R:z=10;break e;case $:z=9;break e;case F:z=11;break e;case q:z=14;break e;case Y:z=16,b=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return d=zr(z,g,d,_),d.elementType=l,d.type=b,d.lanes=T,d}function Ws(l,d,g,b){return l=zr(7,l,b,d),l.lanes=g,l}function lh(l,d,g,b){return l=zr(22,l,b,d),l.elementType=Z,l.lanes=g,l.stateNode={isHidden:!1},l}function Yy(l,d,g){return l=zr(6,l,null,d),l.lanes=g,l}function qy(l,d,g){return d=zr(4,l.children!==null?l.children:[],l.key,d),d.lanes=g,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function Bz(l,d,g,b,_){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wg(0),this.expirationTimes=wg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wg(0),this.identifierPrefix=b,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function Gy(l,d,g,b,_,T,z,X,te){return l=new Bz(l,d,g,X,te),d===1?(d=1,T===!0&&(d|=8)):d=0,T=zr(3,null,null,d),l.current=T,T.stateNode=l,T.memoizedState={element:b,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},ay(T),l}function Vz(l,d,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:b==null?null:""+b,children:l,containerInfo:d,implementation:g}}function JE(l){if(!l)return $o;l=l._reactInternals;e:{if(vi(l)!==l||l.tag!==1)throw Error(n(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(rr(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(n(171))}if(l.tag===1){var g=l.type;if(rr(g))return NS(l,g,d)}return d}function eC(l,d,g,b,_,T,z,X,te){return l=Gy(g,b,!0,l,_,T,z,X,te),l.context=JE(null),g=l.current,b=Zn(),_=qo(g),T=Ji(b,_),T.callback=d??null,Wo(g,T,_),l.current.lanes=_,yu(l,_,b),sr(l,b),l}function uh(l,d,g,b){var _=d.current,T=Zn(),z=qo(_);return g=JE(g),d.context===null?d.context=g:d.pendingContext=g,d=Ji(T,z),d.payload={element:l},b=b===void 0?null:b,b!==null&&(d.callback=b),l=Wo(_,d,z),l!==null&&(ei(l,_,z,T),$f(l,_,z)),z}function ch(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function tC(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<d?g:d}}function Zy(l,d){tC(l,d),(l=l.alternate)&&tC(l,d)}function Wz(){return null}var nC=typeof reportError=="function"?reportError:function(l){console.error(l)};function Ky(l){this._internalRoot=l}dh.prototype.render=Ky.prototype.render=function(l){var d=this._internalRoot;if(d===null)throw Error(n(409));uh(l,d,null,null)},dh.prototype.unmount=Ky.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var d=l.containerInfo;$s(function(){uh(null,l,null,null)}),d[Gi]=null}};function dh(l){this._internalRoot=l}dh.prototype.unstable_scheduleHydration=function(l){if(l){var d=zk();l={blockedOn:null,target:l,priority:d};for(var g=0;g<Io.length&&d!==0&&d<Io[g].priority;g++);Io.splice(g,0,l),g===0&&Vk(l)}};function Xy(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function fh(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function rC(){}function Uz(l,d,g,b,_){if(_){if(typeof b=="function"){var T=b;b=function(){var de=ch(z);T.call(de)}}var z=eC(d,b,l,0,null,!1,!1,"",rC);return l._reactRootContainer=z,l[Gi]=z.current,Ru(l.nodeType===8?l.parentNode:l),$s(),z}for(;_=l.lastChild;)l.removeChild(_);if(typeof b=="function"){var X=b;b=function(){var de=ch(te);X.call(de)}}var te=Gy(l,0,!1,null,null,!1,!1,"",rC);return l._reactRootContainer=te,l[Gi]=te.current,Ru(l.nodeType===8?l.parentNode:l),$s(function(){uh(d,te,g,b)}),te}function hh(l,d,g,b,_){var T=g._reactRootContainer;if(T){var z=T;if(typeof _=="function"){var X=_;_=function(){var te=ch(z);X.call(te)}}uh(d,z,l,_)}else z=Uz(g,d,l,_,b);return ch(z)}Lk=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var g=qi(d.pendingLanes);g!==0&&(bg(d,g|1),sr(d,Gt()),!(wt&6)&&(Xa=Gt()+500,Bo()))}break;case 13:$s(function(){var b=Qi(l,1);if(b!==null){var _=Zn();ei(b,l,1,_)}}),Zy(l,1)}},kg=function(l){if(l.tag===13){var d=Qi(l,134217728);if(d!==null){var g=Zn();ei(d,l,134217728,g)}Zy(l,134217728)}},Fk=function(l){if(l.tag===13){var d=qo(l),g=Qi(l,d);if(g!==null){var b=Zn();ei(g,l,d,b)}Zy(l,d)}},zk=function(){return Nt},$k=function(l,d){var g=Nt;try{return Nt=l,d()}finally{Nt=g}},ft=function(l,d,g){switch(d){case"input":if(_t(l,g),d=g.name,g.type==="radio"&&d!=null){for(g=l;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<g.length;d++){var b=g[d];if(b!==l&&b.form===l.form){var _=Pf(b);if(!_)throw Error(n(90));fe(b),_t(b,_)}}}break;case"textarea":Ae(l,g);break;case"select":d=g.value,d!=null&&Ce(l,!!g.multiple,d,!1)}},Yi=Vy,Sa=$s;var Hz={usingClientEntryPoint:!1,Events:[Ou,Fa,Pf,nn,vn,Vy]},Gu={findFiberByHostInstance:Ms,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Yz={bundleType:Gu.bundleType,version:Gu.version,rendererPackageName:Gu.rendererPackageName,rendererConfig:Gu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=uf(l),l===null?null:l.stateNode},findFiberByHostInstance:Gu.findFiberByHostInstance||Wz,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ph=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ph.isDisabled&&ph.supportsFiber)try{Na=ph.inject(Yz),Dr=ph}catch{}}return ar.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hz,ar.createPortal=function(l,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xy(d))throw Error(n(200));return Vz(l,d,null,g)},ar.createRoot=function(l,d){if(!Xy(l))throw Error(n(299));var g=!1,b="",_=nC;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onRecoverableError!==void 0&&(_=d.onRecoverableError)),d=Gy(l,1,!1,null,null,g,!1,b,_),l[Gi]=d.current,Ru(l.nodeType===8?l.parentNode:l),new Ky(d)},ar.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=uf(d),l=l===null?null:l.stateNode,l},ar.flushSync=function(l){return $s(l)},ar.hydrate=function(l,d,g){if(!fh(d))throw Error(n(200));return hh(null,l,d,!0,g)},ar.hydrateRoot=function(l,d,g){if(!Xy(l))throw Error(n(405));var b=g!=null&&g.hydratedSources||null,_=!1,T="",z=nC;if(g!=null&&(g.unstable_strictMode===!0&&(_=!0),g.identifierPrefix!==void 0&&(T=g.identifierPrefix),g.onRecoverableError!==void 0&&(z=g.onRecoverableError)),d=eC(d,null,l,1,g??null,_,!1,T,z),l[Gi]=d.current,Ru(l),b)for(l=0;l<b.length;l++)g=b[l],_=g._getVersion,_=_(g._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[g,_]:d.mutableSourceEagerHydrationData.push(g,_);return new dh(d)},ar.render=function(l,d,g){if(!fh(d))throw Error(n(200));return hh(null,l,d,!1,g)},ar.unmountComponentAtNode=function(l){if(!fh(l))throw Error(n(40));return l._reactRootContainer?($s(function(){hh(null,null,l,!1,function(){l._reactRootContainer=null,l[Gi]=null})}),!0):!1},ar.unstable_batchedUpdates=Vy,ar.unstable_renderSubtreeIntoContainer=function(l,d,g,b){if(!fh(g))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return hh(l,d,g,!1,b)},ar.version="18.3.1-next-f1338f8080-20240426",ar}var dC;function UP(){if(dC)return ev.exports;dC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ev.exports=r$(),ev.exports}var fC;function i$(){if(fC)return mh;fC=1;var e=UP();return mh.createRoot=e.createRoot,mh.hydrateRoot=e.hydrateRoot,mh}var o$=i$(),Ku={},hC;function s$(){if(hC)return Ku;hC=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.parse=s,Ku.serialize=c;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,o=(()=>{const p=function(){};return p.prototype=Object.create(null),p})();function s(p,m){const y=new o,x=p.length;if(x<2)return y;const k=(m==null?void 0:m.decode)||f;let w=0;do{const E=p.indexOf("=",w);if(E===-1)break;const C=p.indexOf(";",w),N=C===-1?x:C;if(E>N){w=p.lastIndexOf(";",E-1)+1;continue}const P=a(p,w,E),A=u(p,E,P),O=p.slice(P,A);if(y[O]===void 0){let M=a(p,E+1,N),j=u(p,N,M);const R=k(p.slice(M,j));y[O]=R}w=N+1}while(w<x);return y}function a(p,m,y){do{const x=p.charCodeAt(m);if(x!==32&&x!==9)return m}while(++m<y);return y}function u(p,m,y){for(;m>y;){const x=p.charCodeAt(--m);if(x!==32&&x!==9)return m+1}return y}function c(p,m,y){const x=(y==null?void 0:y.encode)||encodeURIComponent;if(!e.test(p))throw new TypeError(`argument name is invalid: ${p}`);const k=x(m);if(!t.test(k))throw new TypeError(`argument val is invalid: ${m}`);let w=p+"="+k;if(!y)return w;if(y.maxAge!==void 0){if(!Number.isInteger(y.maxAge))throw new TypeError(`option maxAge is invalid: ${y.maxAge}`);w+="; Max-Age="+y.maxAge}if(y.domain){if(!n.test(y.domain))throw new TypeError(`option domain is invalid: ${y.domain}`);w+="; Domain="+y.domain}if(y.path){if(!r.test(y.path))throw new TypeError(`option path is invalid: ${y.path}`);w+="; Path="+y.path}if(y.expires){if(!h(y.expires)||!Number.isFinite(y.expires.valueOf()))throw new TypeError(`option expires is invalid: ${y.expires}`);w+="; Expires="+y.expires.toUTCString()}if(y.httpOnly&&(w+="; HttpOnly"),y.secure&&(w+="; Secure"),y.partitioned&&(w+="; Partitioned"),y.priority)switch(typeof y.priority=="string"?y.priority.toLowerCase():void 0){case"low":w+="; Priority=Low";break;case"medium":w+="; Priority=Medium";break;case"high":w+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${y.priority}`)}if(y.sameSite)switch(typeof y.sameSite=="string"?y.sameSite.toLowerCase():y.sameSite){case!0:case"strict":w+="; SameSite=Strict";break;case"lax":w+="; SameSite=Lax";break;case"none":w+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${y.sameSite}`)}return w}function f(p){if(p.indexOf("%")===-1)return p;try{return decodeURIComponent(p)}catch{return p}}function h(p){return i.call(p)==="[object Date]"}return Ku}s$();/**
|
|
41
|
+
* react-router v7.0.2
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/var pC="popstate";function a$(e={}){function t(r,i){let{pathname:o,search:s,hash:a}=r.location;return _0("",{pathname:o,search:s,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ic(i)}return u$(t,n,null,e)}function Ht(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ci(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function l$(){return Math.random().toString(36).substring(2,10)}function mC(e,t){return{usr:e.state,key:e.key,idx:t}}function _0(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ql(t):t,state:n,key:t&&t.key||r||l$()}}function Ic({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ql(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function u$(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a="POP",u=null,c=f();c==null&&(c=0,s.replaceState({...s.state,idx:c},""));function f(){return(s.state||{idx:null}).idx}function h(){a="POP";let k=f(),w=k==null?null:k-c;c=k,u&&u({action:a,location:x.location,delta:w})}function p(k,w){a="PUSH";let E=_0(x.location,k,w);c=f()+1;let C=mC(E,c),N=x.createHref(E);try{s.pushState(C,"",N)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(N)}o&&u&&u({action:a,location:x.location,delta:1})}function m(k,w){a="REPLACE";let E=_0(x.location,k,w);c=f();let C=mC(E,c),N=x.createHref(E);s.replaceState(C,"",N),o&&u&&u({action:a,location:x.location,delta:0})}function y(k){let w=i.location.origin!=="null"?i.location.origin:i.location.href,E=typeof k=="string"?k:Ic(k);return E=E.replace(/ $/,"%20"),Ht(w,`No window.location.(origin|href) available to create URL for href: ${E}`),new URL(E,w)}let x={get action(){return a},get location(){return e(i,s)},listen(k){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(pC,h),u=k,()=>{i.removeEventListener(pC,h),u=null}},createHref(k){return t(i,k)},createURL:y,encodeLocation(k){let w=y(k);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:p,replace:m,go(k){return s.go(k)}};return x}function HP(e,t,n="/"){return c$(e,t,n,!1)}function c$(e,t,n,r){let i=typeof t=="string"?Ql(t):t,o=cs(i.pathname||"/",n);if(o==null)return null;let s=YP(e);d$(s);let a=null;for(let u=0;a==null&&u<s.length;++u){let c=k$(o);a=w$(s[u],c,r)}return a}function YP(e,t=[],n=[],r=""){let i=(o,s,a)=>{let u={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};u.relativePath.startsWith("/")&&(Ht(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length));let c=po([r,u.relativePath]),f=n.concat(u);o.children&&o.children.length>0&&(Ht(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),YP(o.children,t,f,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:v$(c,o.index),routesMeta:f})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let u of qP(o.path))i(o,s,u)}),t}function qP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=qP(r.join("/")),a=[];return a.push(...s.map(u=>u===""?o:[o,u].join("/"))),i&&a.push(...s),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function d$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:x$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var f$=/^:[\w-]+$/,h$=3,p$=2,m$=1,g$=10,y$=-2,gC=e=>e==="*";function v$(e,t){let n=e.split("/"),r=n.length;return n.some(gC)&&(r+=y$),t&&(r+=p$),n.filter(i=>!gC(i)).reduce((i,o)=>i+(f$.test(o)?h$:o===""?m$:g$),r)}function x$(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function w$(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",s=[];for(let a=0;a<r.length;++a){let u=r[a],c=a===r.length-1,f=o==="/"?t:t.slice(o.length)||"/",h=sp({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},f),p=u.route;if(!h&&c&&n&&!r[r.length-1].route.index&&(h=sp({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!h)return null;Object.assign(i,h.params),s.push({params:i,pathname:po([o,h.pathname]),pathnameBase:_$(po([o,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(o=po([o,h.pathnameBase]))}return s}function sp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=b$(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],s=o.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,{paramName:f,isOptional:h},p)=>{if(f==="*"){let y=a[p]||"";s=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const m=a[p];return h&&!m?c[f]=void 0:c[f]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:s,pattern:e}}function b$(e,t=!1,n=!0){ci(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,u)=>(r.push({paramName:a,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function k$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ci(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function cs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function S$(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ql(e):e;return{pathname:n?n.startsWith("/")?n:E$(n,t):t,search:N$(r),hash:T$(i)}}function E$(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function rv(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` 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 C$(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function nb(e){let t=C$(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function rb(e,t,n,r=!1){let i;typeof e=="string"?i=Ql(e):(i={...e},Ht(!i.pathname||!i.pathname.includes("?"),rv("?","pathname","search",i)),Ht(!i.pathname||!i.pathname.includes("#"),rv("#","pathname","hash",i)),Ht(!i.search||!i.search.includes("#"),rv("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let h=t.length-1;if(!r&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}a=h>=0?t[h]:"/"}let u=S$(i,a),c=s&&s!=="/"&&s.endsWith("/"),f=(o||s===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||f)&&(u.pathname+="/"),u}var po=e=>e.join("/").replace(/\/\/+/g,"/"),_$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),N$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,T$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function A$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var GP=["POST","PUT","PATCH","DELETE"];new Set(GP);var P$=["GET",...GP];new Set(P$);var Jl=S.createContext(null);Jl.displayName="DataRouter";var tm=S.createContext(null);tm.displayName="DataRouterState";var ZP=S.createContext({isTransitioning:!1});ZP.displayName="ViewTransition";var R$=S.createContext(new Map);R$.displayName="Fetchers";var M$=S.createContext(null);M$.displayName="Await";var mi=S.createContext(null);mi.displayName="Navigation";var Sd=S.createContext(null);Sd.displayName="Location";var Hr=S.createContext({outlet:null,matches:[],isDataRoute:!1});Hr.displayName="Route";var ib=S.createContext(null);ib.displayName="RouteError";function D$(e,{relative:t}={}){Ht(eu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=S.useContext(mi),{hash:i,pathname:o,search:s}=Ed(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:po([n,o])),r.createHref({pathname:a,search:s,hash:i})}function eu(){return S.useContext(Sd)!=null}function _o(){return Ht(eu(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Sd).location}var KP="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function XP(e){S.useContext(mi).static||S.useLayoutEffect(e)}function ks(){let{isDataRoute:e}=S.useContext(Hr);return e?G$():O$()}function O$(){Ht(eu(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(Jl),{basename:t,navigator:n}=S.useContext(mi),{matches:r}=S.useContext(Hr),{pathname:i}=_o(),o=JSON.stringify(nb(r)),s=S.useRef(!1);return XP(()=>{s.current=!0}),S.useCallback((u,c={})=>{if(ci(s.current,KP),!s.current)return;if(typeof u=="number"){n.go(u);return}let f=rb(u,JSON.parse(o),i,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:po([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,o,i,e])}var I$=S.createContext(null);function j$(e){let t=S.useContext(Hr).outlet;return t&&S.createElement(I$.Provider,{value:e},t)}function nm(){let{matches:e}=S.useContext(Hr),t=e[e.length-1];return t?t.params:{}}function Ed(e,{relative:t}={}){let{matches:n}=S.useContext(Hr),{pathname:r}=_o(),i=JSON.stringify(nb(n));return S.useMemo(()=>rb(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function L$(e,t){return QP(e,t)}function QP(e,t,n,r){var w;Ht(eu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=S.useContext(mi),{matches:o}=S.useContext(Hr),s=o[o.length-1],a=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",f=s&&s.route;{let E=f&&f.path||"";JP(u,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
50
|
+
|
|
51
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let h=_o(),p;if(t){let E=typeof t=="string"?Ql(t):t;Ht(c==="/"||((w=E.pathname)==null?void 0:w.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${E.pathname}" was given in the \`location\` prop.`),p=E}else p=h;let m=p.pathname||"/",y=m;if(c!=="/"){let E=c.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(E.length).join("/")}let x=HP(e,{pathname:y});ci(f||x!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),ci(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=V$(x&&x.map(E=>Object.assign({},E,{params:Object.assign({},a,E.params),pathname:po([c,i.encodeLocation?i.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?c:po([c,i.encodeLocation?i.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),o,n,r);return t&&k?S.createElement(Sd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},k):k}function F$(){let e=q$(),t=A$(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:o},"ErrorBoundary")," or"," ",S.createElement("code",{style:o},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:i},n):null,s)}var z$=S.createElement(F$,null),$$=class extends S.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,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?S.createElement(Hr.Provider,{value:this.props.routeContext},S.createElement(ib.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function B$({routeContext:e,match:t,children:n}){let r=S.useContext(Jl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(Hr.Provider,{value:e},n)}function V$(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=n==null?void 0:n.errors;if(o!=null){let u=i.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);Ht(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,u+1))}let s=!1,a=-1;if(n)for(let u=0;u<i.length;u++){let c=i[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(a=u),c.route.id){let{loaderData:f,errors:h}=n,p=c.route.loader&&!f.hasOwnProperty(c.route.id)&&(!h||h[c.route.id]===void 0);if(c.route.lazy||p){s=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((u,c,f)=>{let h,p=!1,m=null,y=null;n&&(h=o&&c.route.id?o[c.route.id]:void 0,m=c.route.errorElement||z$,s&&(a<0&&f===0?(JP("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,y=null):a===f&&(p=!0,y=c.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,f+1)),k=()=>{let w;return h?w=m:p?w=y:c.route.Component?w=S.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=u,S.createElement(B$,{match:c,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:w})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?S.createElement($$,{location:n.location,revalidation:n.revalidation,component:m,error:h,children:k(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):k()},null)}function ob(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function W$(e){let t=S.useContext(Jl);return Ht(t,ob(e)),t}function U$(e){let t=S.useContext(tm);return Ht(t,ob(e)),t}function H$(e){let t=S.useContext(Hr);return Ht(t,ob(e)),t}function sb(e){let t=H$(e),n=t.matches[t.matches.length-1];return Ht(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Y$(){return sb("useRouteId")}function q$(){var r;let e=S.useContext(ib),t=U$("useRouteError"),n=sb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function G$(){let{router:e}=W$("useNavigate"),t=sb("useNavigate"),n=S.useRef(!1);return XP(()=>{n.current=!0}),S.useCallback(async(i,o={})=>{ci(n.current,KP),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var yC={};function JP(e,t,n){!t&&!yC[e]&&(yC[e]=!0,ci(!1,n))}S.memo(Z$);function Z$({routes:e,future:t,state:n}){return QP(e,void 0,n,t)}function K$({to:e,replace:t,state:n,relative:r}){Ht(eu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=S.useContext(mi);ci(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=S.useContext(Hr),{pathname:s}=_o(),a=ks(),u=rb(e,nb(o),s,r==="path"),c=JSON.stringify(u);return S.useEffect(()=>{a(JSON.parse(c),{replace:t,state:n,relative:r})},[a,c,r,t,n]),null}function X$(e){return j$(e.context)}function ti(e){Ht(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Q$({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1}){Ht(!eu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),a=S.useMemo(()=>({basename:s,navigator:i,static:o,future:{}}),[s,i,o]);typeof n=="string"&&(n=Ql(n));let{pathname:u="/",search:c="",hash:f="",state:h=null,key:p="default"}=n,m=S.useMemo(()=>{let y=cs(u,s);return y==null?null:{location:{pathname:y,search:c,hash:f,state:h,key:p},navigationType:r}},[s,u,c,f,h,p,r]);return ci(m!=null,`<Router basename="${s}"> is not able to match the URL "${u}${c}${f}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:S.createElement(mi.Provider,{value:a},S.createElement(Sd.Provider,{children:t,value:m}))}function J$({children:e,location:t}){return L$(N0(e),t)}function N0(e,t=[]){let n=[];return S.Children.forEach(e,(r,i)=>{if(!S.isValidElement(r))return;let o=[...t,i];if(r.type===S.Fragment){n.push.apply(n,N0(r.props.children,o));return}Ht(r.type===ti,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ht(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=N0(r.props.children,o)),n.push(s)}),n}var Uh="get",Hh="application/x-www-form-urlencoded";function rm(e){return e!=null&&typeof e.tagName=="string"}function eB(e){return rm(e)&&e.tagName.toLowerCase()==="button"}function tB(e){return rm(e)&&e.tagName.toLowerCase()==="form"}function nB(e){return rm(e)&&e.tagName.toLowerCase()==="input"}function rB(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function iB(e,t){return e.button===0&&(!t||t==="_self")&&!rB(e)}var gh=null;function oB(){if(gh===null)try{new FormData(document.createElement("form"),0),gh=!1}catch{gh=!0}return gh}var sB=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function iv(e){return e!=null&&!sB.has(e)?(ci(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hh}"`),null):e}function aB(e,t){let n,r,i,o,s;if(tB(e)){let a=e.getAttribute("action");r=a?cs(a,t):null,n=e.getAttribute("method")||Uh,i=iv(e.getAttribute("enctype"))||Hh,o=new FormData(e)}else if(eB(e)||nB(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||a.getAttribute("action");if(r=u?cs(u,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Uh,i=iv(e.getAttribute("formenctype"))||iv(a.getAttribute("enctype"))||Hh,o=new FormData(a,e),!oB()){let{name:c,type:f,value:h}=e;if(f==="image"){let p=c?`${c}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else c&&o.append(c,h)}}else{if(rm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Uh,r=null,i=Hh,s=e}return o&&i==="text/plain"&&(s=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:s}}function ab(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function lB(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function uB(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function cB(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let s=await lB(o,n);return s.links?s.links():[]}return[]}));return pB(r.flat(1).filter(uB).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function vC(e,t,n,r,i,o){let s=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,a=(u,c)=>{var f;return n[c].pathname!==u.pathname||((f=n[c].route.path)==null?void 0:f.endsWith("*"))&&n[c].params["*"]!==u.params["*"]};return o==="assets"?t.filter((u,c)=>s(u,c)||a(u,c)):o==="data"?t.filter((u,c)=>{var h;let f=r.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(s(u,c)||a(u,c))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function dB(e,t){return fB(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let i=[r.module];return r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function fB(e){return[...new Set(e)]}function hB(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function pB(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(hB(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function mB(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function gB(){let e=S.useContext(Jl);return ab(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function yB(){let e=S.useContext(tm);return ab(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var lb=S.createContext(void 0);lb.displayName="FrameworkContext";function eR(){let e=S.useContext(lb);return ab(e,"You must render this element inside a <HydratedRouter> element"),e}function vB(e,t){let n=S.useContext(lb),[r,i]=S.useState(!1),[o,s]=S.useState(!1),{onFocus:a,onBlur:u,onMouseEnter:c,onMouseLeave:f,onTouchStart:h}=t,p=S.useRef(null);S.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let x=w=>{w.forEach(E=>{s(E.isIntersecting)})},k=new IntersectionObserver(x,{threshold:.5});return p.current&&k.observe(p.current),()=>{k.disconnect()}}},[e]),S.useEffect(()=>{if(r){let x=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(x)}}},[r]);let m=()=>{i(!0)},y=()=>{i(!1),s(!1)};return n?e!=="intent"?[o,p,{}]:[o,p,{onFocus:Xu(a,m),onBlur:Xu(u,y),onMouseEnter:Xu(c,m),onMouseLeave:Xu(f,y),onTouchStart:Xu(h,m)}]:[!1,p,{}]}function Xu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function xB({page:e,...t}){let{router:n}=gB(),r=S.useMemo(()=>HP(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?S.createElement(bB,{page:e,matches:r,...t}):(console.warn(`Tried to prefetch ${e} but no routes matched.`),null)}function wB(e){let{manifest:t,routeModules:n}=eR(),[r,i]=S.useState([]);return S.useEffect(()=>{let o=!1;return cB(e,t,n).then(s=>{o||i(s)}),()=>{o=!0}},[e,t,n]),r}function bB({page:e,matches:t,...n}){let r=_o(),{manifest:i,routeModules:o}=eR(),{loaderData:s,matches:a}=yB(),u=S.useMemo(()=>vC(e,t,a,i,r,"data"),[e,t,a,i,r]),c=S.useMemo(()=>vC(e,t,a,i,r,"assets"),[e,t,a,i,r]),f=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let m=new Set,y=!1;if(t.forEach(k=>{var E;let w=i.routes[k.route.id];!w||!w.hasLoader||(!u.some(C=>C.route.id===k.route.id)&&k.route.id in s&&((E=o[k.route.id])!=null&&E.shouldRevalidate)||w.hasClientLoader?y=!0:m.add(k.route.id))}),m.size===0)return[];let x=mB(e);return y&&m.size>0&&x.searchParams.set("_routes",t.filter(k=>m.has(k.route.id)).map(k=>k.route.id).join(",")),[x.pathname+x.search]},[s,r,i,u,t,e,o]),h=S.useMemo(()=>dB(c,i),[c,i]),p=wB(c);return S.createElement(S.Fragment,null,f.map(m=>S.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...n})),h.map(m=>S.createElement("link",{key:m,rel:"modulepreload",href:m,...n})),p.map(({key:m,link:y})=>S.createElement("link",{key:m,...y})))}function kB(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var tR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{tR&&(window.__reactRouterVersion="7.0.2")}catch{}function SB({basename:e,children:t,window:n}){let r=S.useRef();r.current==null&&(r.current=a$({window:n,v5Compat:!0}));let i=r.current,[o,s]=S.useState({action:i.action,location:i.location}),a=S.useCallback(u=>{S.startTransition(()=>s(u))},[s]);return S.useLayoutEffect(()=>i.listen(a),[i,a]),S.createElement(Q$,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:i})}var nR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cd=S.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:s,state:a,target:u,to:c,preventScrollReset:f,viewTransition:h,...p},m){let{basename:y}=S.useContext(mi),x=typeof c=="string"&&nR.test(c),k,w=!1;if(typeof c=="string"&&x&&(k=c,tR))try{let j=new URL(window.location.href),R=c.startsWith("//")?new URL(j.protocol+c):new URL(c),$=cs(R.pathname,y);R.origin===j.origin&&$!=null?c=$+R.search+R.hash:w=!0}catch{ci(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=D$(c,{relative:i}),[C,N,P]=vB(r,p),A=NB(c,{replace:s,state:a,target:u,preventScrollReset:f,relative:i,viewTransition:h});function O(j){t&&t(j),j.defaultPrevented||A(j)}let M=S.createElement("a",{...p,...P,href:k||E,onClick:w||o?t:O,ref:kB(m,N),target:u,"data-discover":!x&&n==="render"?"true":void 0});return C&&!x?S.createElement(S.Fragment,null,M,S.createElement(xB,{page:E})):M});Cd.displayName="Link";var EB=S.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:s,viewTransition:a,children:u,...c},f){let h=Ed(s,{relative:c.relative}),p=_o(),m=S.useContext(tm),{navigator:y,basename:x}=S.useContext(mi),k=m!=null&&MB(h)&&a===!0,w=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,E=p.pathname,C=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(E=E.toLowerCase(),C=C?C.toLowerCase():null,w=w.toLowerCase()),C&&x&&(C=cs(C,x)||C);const N=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let P=E===w||!i&&E.startsWith(w)&&E.charAt(N)==="/",A=C!=null&&(C===w||!i&&C.startsWith(w)&&C.charAt(w.length)==="/"),O={isActive:P,isPending:A,isTransitioning:k},M=P?t:void 0,j;typeof r=="function"?j=r(O):j=[r,P?"active":null,A?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let R=typeof o=="function"?o(O):o;return S.createElement(Cd,{...c,"aria-current":M,className:j,ref:f,style:R,to:s,viewTransition:a},typeof u=="function"?u(O):u)});EB.displayName="NavLink";var CB=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:s=Uh,action:a,onSubmit:u,relative:c,preventScrollReset:f,viewTransition:h,...p},m)=>{let y=PB(),x=RB(a,{relative:c}),k=s.toLowerCase()==="get"?"get":"post",w=typeof a=="string"&&nR.test(a),E=C=>{if(u&&u(C),C.defaultPrevented)return;C.preventDefault();let N=C.nativeEvent.submitter,P=(N==null?void 0:N.getAttribute("formmethod"))||s;y(N||C.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:i,state:o,relative:c,preventScrollReset:f,viewTransition:h})};return S.createElement("form",{ref:m,method:k,action:x,onSubmit:r?u:E,...p,"data-discover":!w&&e==="render"?"true":void 0})});CB.displayName="Form";function _B(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rR(e){let t=S.useContext(Jl);return Ht(t,_B(e)),t}function NB(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:s}={}){let a=ks(),u=_o(),c=Ed(e,{relative:o});return S.useCallback(f=>{if(iB(f,t)){f.preventDefault();let h=n!==void 0?n:Ic(u)===Ic(c);a(e,{replace:h,state:r,preventScrollReset:i,relative:o,viewTransition:s})}},[u,a,c,n,r,t,e,i,o,s])}var TB=0,AB=()=>`__${String(++TB)}__`;function PB(){let{router:e}=rR("useSubmit"),{basename:t}=S.useContext(mi),n=Y$();return S.useCallback(async(r,i={})=>{let{action:o,method:s,encType:a,formData:u,body:c}=aB(r,t);if(i.navigate===!1){let f=i.fetcherKey||AB();await e.fetch(f,n,i.action||o,{preventScrollReset:i.preventScrollReset,formData:u,body:c,formMethod:i.method||s,formEncType:i.encType||a,flushSync:i.flushSync})}else await e.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:u,body:c,formMethod:i.method||s,formEncType:i.encType||a,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function RB(e,{relative:t}={}){let{basename:n}=S.useContext(mi),r=S.useContext(Hr);Ht(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...Ed(e||".",{relative:t})},s=_o();if(e==null){o.search=s.search;let a=new URLSearchParams(o.search),u=a.getAll("index");if(u.some(f=>f==="")){a.delete("index"),u.filter(h=>h).forEach(h=>a.append("index",h));let f=a.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:po([n,o.pathname])),Ic(o)}function MB(e,t={}){let n=S.useContext(ZP);Ht(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=rR("useViewTransitionState"),i=Ed(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=cs(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=cs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return sp(i.pathname,s)!=null||sp(i.pathname,o)!=null}new TextEncoder;/**
|
|
52
|
+
* @license lucide-react v0.468.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const DB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),iR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
57
|
+
* @license lucide-react v0.468.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/var OB={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"};/**
|
|
62
|
+
* @license lucide-react v0.468.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const IB=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},u)=>S.createElement("svg",{ref:u,...OB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:iR("lucide",i),...a},[...s.map(([c,f])=>S.createElement(c,f)),...Array.isArray(o)?o:[o]]));/**
|
|
67
|
+
* @license lucide-react v0.468.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const Yt=(e,t)=>{const n=S.forwardRef(({className:r,...i},o)=>S.createElement(IB,{ref:o,iconNode:t,className:iR(`lucide-${DB(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
72
|
+
* @license lucide-react v0.468.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const jB=Yt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
77
|
+
* @license lucide-react v0.468.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const LB=Yt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
82
|
+
* @license lucide-react v0.468.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const FB=Yt("BotMessageSquare",[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z",key:"w2lp3e"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M9 11v2",key:"1ueba0"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M20 12h2",key:"1q8mjw"}]]);/**
|
|
87
|
+
* @license lucide-react v0.468.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const oR=Yt("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
92
|
+
* @license lucide-react v0.468.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const sR=Yt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
97
|
+
* @license lucide-react v0.468.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const ub=Yt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
102
|
+
* @license lucide-react v0.468.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const cb=Yt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
107
|
+
* @license lucide-react v0.468.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const zB=Yt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
112
|
+
* @license lucide-react v0.468.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const $B=Yt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
117
|
+
* @license lucide-react v0.468.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const ov=Yt("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/**
|
|
122
|
+
* @license lucide-react v0.468.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const BB=Yt("DraftingCompass",[["path",{d:"m12.99 6.74 1.93 3.44",key:"iwagvd"}],["path",{d:"M19.136 12a10 10 0 0 1-14.271 0",key:"ppmlo4"}],["path",{d:"m21 21-2.16-3.84",key:"vylbct"}],["path",{d:"m3 21 8.02-14.26",key:"1ssaw4"}],["circle",{cx:"12",cy:"5",r:"2",key:"f1ur92"}]]);/**
|
|
127
|
+
* @license lucide-react v0.468.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const VB=Yt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
132
|
+
* @license lucide-react v0.468.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const WB=Yt("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
137
|
+
* @license lucide-react v0.468.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const UB=Yt("Footprints",[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]]);/**
|
|
142
|
+
* @license lucide-react v0.468.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const HB=Yt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
147
|
+
* @license lucide-react v0.468.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const YB=Yt("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
152
|
+
* @license lucide-react v0.468.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const aR=Yt("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
|
|
157
|
+
* @license lucide-react v0.468.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const jc=Yt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
162
|
+
* @license lucide-react v0.468.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const ap=Yt("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
|
|
167
|
+
* @license lucide-react v0.468.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const qB=Yt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
172
|
+
* @license lucide-react v0.468.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const GB=Yt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
177
|
+
* @license lucide-react v0.468.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const ZB=Yt("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
182
|
+
* @license lucide-react v0.468.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const T0=Yt("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
|
|
187
|
+
* @license lucide-react v0.468.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const va=Yt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function lR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=lR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function im(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=lR(e))&&(r&&(r+=" "),r+=t);return r}var tu=UP();const uR=Kl(tu);var KB=e=>{switch(e){case"success":return JB;case"info":return tV;case"warning":return eV;case"error":return nV;default:return null}},XB=Array(12).fill(0),QB=({visible:e,className:t})=>ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ne.createElement("div",{className:"sonner-spinner"},XB.map((n,r)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),JB=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),eV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),tV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),nV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),rV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),iV=()=>{let[e,t]=ne.useState(document.hidden);return ne.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},A0=1,oV=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:A0++,o=this.toasts.find(a=>a.id===i),s=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(a=>a.id===i?(this.publish({...a,...e,id:i,title:n}),{...a,...e,id:i,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,s=r.then(async u=>{if(o=["resolve",u],ne.isValidElement(u))i=!1,this.create({id:n,type:"default",message:u});else if(aV(u)&&!u.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:n,type:"error",message:c,description:f})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(u):t.success,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"success",message:c,description:f})}}).catch(async u=>{if(o=["reject",u],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(u):t.error,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"error",message:c,description:f})}}).finally(()=>{var u;i&&(this.dismiss(n),n=void 0),(u=t.finally)==null||u.call(t)}),a=()=>new Promise((u,c)=>s.then(()=>o[0]==="reject"?c(o[1]):u(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||A0++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},br=new oV,sV=(e,t)=>{let n=(t==null?void 0:t.id)||A0++;return br.addToast({title:e,...t,id:n}),n},aV=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lV=sV,uV=()=>br.toasts,mn=Object.assign(lV,{success:br.success,info:br.info,warning:br.warning,error:br.error,custom:br.custom,message:br.message,promise:br.promise,dismiss:br.dismiss,loading:br.loading},{getHistory:uV});function cV(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}cV(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
192
|
+
`);function yh(e){return e.label!==void 0}var dV=3,fV="32px",xC=4e3,hV=356,pV=14,mV=20,gV=200;function yV(...e){return e.filter(Boolean).join(" ")}var vV=e=>{var t,n,r,i,o,s,a,u,c,f,h;let{invert:p,toast:m,unstyled:y,interacting:x,setHeights:k,visibleToasts:w,heights:E,index:C,toasts:N,expanded:P,removeToast:A,defaultRichColors:O,closeButton:M,style:j,cancelButtonStyle:R,actionButtonStyle:$,className:F="",descriptionClassName:H="",duration:I,position:q,gap:Y,loadingIcon:Z,expandByDefault:B,classNames:W,icons:L,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:V,cn:D}=e,[G,K]=ne.useState(!1),[J,ee]=ne.useState(!1),[re,ue]=ne.useState(!1),[he,ke]=ne.useState(!1),[fe,ve]=ne.useState(!1),[Me,$e]=ne.useState(0),[ct,_t]=ne.useState(0),Q=ne.useRef(m.duration||I||xC),oe=ne.useRef(null),ae=ne.useRef(null),Ce=C===0,we=C+1<=w,me=m.type,Ae=m.dismissible!==!1,Fe=m.className||"",ce=m.descriptionClassName||"",pe=ne.useMemo(()=>E.findIndex(Ye=>Ye.toastId===m.id)||0,[E,m.id]),Ie=ne.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:M},[m.closeButton,M]);ne.useMemo(()=>m.duration||I||xC,[m.duration,I]);let Ke=ne.useRef(0),tt=ne.useRef(0),At=ne.useRef(0),He=ne.useRef(null),[it,at]=q.split("-"),Wt=ne.useMemo(()=>E.reduce((Ye,dt,Ct)=>Ct>=pe?Ye:Ye+dt.height,0),[E,pe]),yt=iV(),yn=m.invert||p,gt=me==="loading";tt.current=ne.useMemo(()=>pe*Y+Wt,[pe,Wt]),ne.useEffect(()=>{K(!0)},[]),ne.useEffect(()=>{let Ye=ae.current;if(Ye){let dt=Ye.getBoundingClientRect().height;return _t(dt),k(Ct=>[{toastId:m.id,height:dt,position:m.position},...Ct]),()=>k(Ct=>Ct.filter(nn=>nn.toastId!==m.id))}},[k,m.id]),ne.useLayoutEffect(()=>{if(!G)return;let Ye=ae.current,dt=Ye.style.height;Ye.style.height="auto";let Ct=Ye.getBoundingClientRect().height;Ye.style.height=dt,_t(Ct),k(nn=>nn.find(vn=>vn.toastId===m.id)?nn.map(vn=>vn.toastId===m.id?{...vn,height:Ct}:vn):[{toastId:m.id,height:Ct,position:m.position},...nn])},[G,m.title,m.description,k,m.id]);let Lt=ne.useCallback(()=>{ee(!0),$e(tt.current),k(Ye=>Ye.filter(dt=>dt.toastId!==m.id)),setTimeout(()=>{A(m)},gV)},[m,A,k,tt]);ne.useEffect(()=>{if(m.promise&&me==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return P||x||V&&yt?(()=>{if(At.current<Ke.current){let dt=new Date().getTime()-Ke.current;Q.current=Q.current-dt}At.current=new Date().getTime()})():Q.current!==1/0&&(Ke.current=new Date().getTime(),Ye=setTimeout(()=>{var dt;(dt=m.onAutoClose)==null||dt.call(m,m),Lt()},Q.current)),()=>clearTimeout(Ye)},[P,x,m,me,V,yt,Lt]),ne.useEffect(()=>{m.delete&&Lt()},[Lt,m.delete]);function ft(){var Ye,dt,Ct;return L!=null&&L.loading?ne.createElement("div",{className:D(W==null?void 0:W.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":me==="loading"},L.loading):Z?ne.createElement("div",{className:D(W==null?void 0:W.loader,(dt=m==null?void 0:m.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":me==="loading"},Z):ne.createElement(QB,{className:D(W==null?void 0:W.loader,(Ct=m==null?void 0:m.classNames)==null?void 0:Ct.loader),visible:me==="loading"})}return ne.createElement("li",{tabIndex:0,ref:ae,className:D(F,Fe,W==null?void 0:W.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,W==null?void 0:W.default,W==null?void 0:W[me],(n=m==null?void 0:m.classNames)==null?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:O,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":G,"data-promise":!!m.promise,"data-swiped":fe,"data-removed":J,"data-visible":we,"data-y-position":it,"data-x-position":at,"data-index":C,"data-front":Ce,"data-swiping":re,"data-dismissible":Ae,"data-type":me,"data-invert":yn,"data-swipe-out":he,"data-expanded":!!(P||B&&G),style:{"--index":C,"--toasts-before":C,"--z-index":N.length-C,"--offset":`${J?Me:tt.current}px`,"--initial-height":B?"auto":`${ct}px`,...j,...m.style},onPointerDown:Ye=>{gt||!Ae||(oe.current=new Date,$e(tt.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(ue(!0),He.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,dt,Ct,nn;if(he||!Ae)return;He.current=null;let vn=Number(((Ye=ae.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Yi=new Date().getTime()-((dt=oe.current)==null?void 0:dt.getTime()),Sa=Math.abs(vn)/Yi;if(Math.abs(vn)>=mV||Sa>.11){$e(tt.current),(Ct=m.onDismiss)==null||Ct.call(m,m),Lt(),ke(!0),ve(!1);return}(nn=ae.current)==null||nn.style.setProperty("--swipe-amount","0px"),ue(!1)},onPointerMove:Ye=>{var dt,Ct;if(!He.current||!Ae)return;let nn=Ye.clientY-He.current.y,vn=((dt=window.getSelection())==null?void 0:dt.toString().length)>0,Yi=it==="top"?Math.min(0,nn):Math.max(0,nn);Math.abs(Yi)>0&&ve(!0),!vn&&((Ct=ae.current)==null||Ct.style.setProperty("--swipe-amount",`${Yi}px`))}},Ie&&!m.jsx?ne.createElement("button",{"aria-label":U,"data-disabled":gt,"data-close-button":!0,onClick:gt||!Ae?()=>{}:()=>{var Ye;Lt(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:D(W==null?void 0:W.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(o=L==null?void 0:L.close)!=null?o:rV):null,m.jsx||ne.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ne.createElement(ne.Fragment,null,me||m.icon||m.promise?ne.createElement("div",{"data-icon":"",className:D(W==null?void 0:W.icon,(s=m==null?void 0:m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ft():null,m.type!=="loading"?m.icon||(L==null?void 0:L[me])||KB(me):null):null,ne.createElement("div",{"data-content":"",className:D(W==null?void 0:W.content,(a=m==null?void 0:m.classNames)==null?void 0:a.content)},ne.createElement("div",{"data-title":"",className:D(W==null?void 0:W.title,(u=m==null?void 0:m.classNames)==null?void 0:u.title)},typeof m.title=="function"?m.title():m.title),m.description?ne.createElement("div",{"data-description":"",className:D(H,ce,W==null?void 0:W.description,(c=m==null?void 0:m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),ne.isValidElement(m.cancel)?m.cancel:m.cancel&&yh(m.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||R,onClick:Ye=>{var dt,Ct;yh(m.cancel)&&Ae&&((Ct=(dt=m.cancel).onClick)==null||Ct.call(dt,Ye),Lt())},className:D(W==null?void 0:W.cancelButton,(f=m==null?void 0:m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,ne.isValidElement(m.action)?m.action:m.action&&yh(m.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||$,onClick:Ye=>{var dt,Ct;yh(m.action)&&((Ct=(dt=m.action).onClick)==null||Ct.call(dt,Ye),!Ye.defaultPrevented&&Lt())},className:D(W==null?void 0:W.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function wC(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var xV=S.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:s,className:a,offset:u,theme:c="light",richColors:f,duration:h,style:p,visibleToasts:m=dV,toastOptions:y,dir:x=wC(),gap:k=pV,loadingIcon:w,icons:E,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:N,cn:P=yV}=e,[A,O]=ne.useState([]),M=ne.useMemo(()=>Array.from(new Set([r].concat(A.filter(V=>V.position).map(V=>V.position)))),[A,r]),[j,R]=ne.useState([]),[$,F]=ne.useState(!1),[H,I]=ne.useState(!1),[q,Y]=ne.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=ne.useRef(null),B=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ne.useRef(null),L=ne.useRef(!1),U=ne.useCallback(V=>{O(D=>{var G;return(G=D.find(K=>K.id===V.id))!=null&&G.delete||br.dismiss(V.id),D.filter(({id:K})=>K!==V.id)})},[]);return ne.useEffect(()=>br.subscribe(V=>{if(V.dismiss){O(D=>D.map(G=>G.id===V.id?{...G,delete:!0}:G));return}setTimeout(()=>{uR.flushSync(()=>{O(D=>{let G=D.findIndex(K=>K.id===V.id);return G!==-1?[...D.slice(0,G),{...D[G],...V},...D.slice(G+1)]:[V,...D]})})})}),[]),ne.useEffect(()=>{if(c!=="system"){Y(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:D})=>{Y(D?"dark":"light")})}catch{V.addListener(({matches:G})=>{try{Y(G?"dark":"light")}catch(K){console.error(K)}})}},[c]),ne.useEffect(()=>{A.length<=1&&F(!1)},[A]),ne.useEffect(()=>{let V=D=>{var G,K;i.every(J=>D[J]||D.code===J)&&(F(!0),(G=Z.current)==null||G.focus()),D.code==="Escape"&&(document.activeElement===Z.current||(K=Z.current)!=null&&K.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[i]),ne.useEffect(()=>{if(Z.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,L.current=!1)}},[Z.current]),ne.createElement("section",{"aria-label":`${C} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},M.map((V,D)=>{var G;let[K,J]=V.split("-");return A.length?ne.createElement("ol",{key:V,dir:x==="auto"?wC():x,tabIndex:-1,ref:Z,className:a,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":K,"data-lifted":$&&A.length>1&&!o,"data-x-position":J,style:{"--front-toast-height":`${((G=j[0])==null?void 0:G.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||fV,"--width":`${hV}px`,"--gap":`${k}px`,...p},onBlur:ee=>{L.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(L.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||L.current||(L.current=!0,W.current=ee.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{H||F(!1)},onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},A.filter(ee=>!ee.position&&D===0||ee.position===V).map((ee,re)=>{var ue,he;return ne.createElement(vV,{key:ee.id,icons:E,index:re,toast:ee,defaultRichColors:f,duration:(ue=y==null?void 0:y.duration)!=null?ue:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:m,closeButton:(he=y==null?void 0:y.closeButton)!=null?he:s,interacting:H,position:V,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:U,toasts:A.filter(ke=>ke.position==ee.position),heights:j.filter(ke=>ke.position==ee.position),setHeights:R,expandByDefault:o,gap:k,loadingIcon:w,expanded:$,pauseWhenPageIsHidden:N,cn:P})})):null}))});const db="-",wV=e=>{const t=kV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(db);return a[0]===""&&a.length!==1&&a.shift(),cR(a,t)||bV(s)},getConflictingClassGroupIds:(s,a)=>{const u=n[s]||[];return a&&r[s]?[...u,...r[s]]:u}}},cR=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?cR(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(db);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},bC=/^\[(.+)\]$/,bV=e=>{if(bC.test(e)){const t=bC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},kV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return EV(Object.entries(e.classGroups),n).forEach(([o,s])=>{P0(s,r,o,t)}),r},P0=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:kC(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(SV(i)){P0(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{P0(s,kC(t,o),n,r)})})},kC=(e,t)=>{let n=e;return t.split(db).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},SV=e=>e.isThemeGetter,EV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e,CV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},dR="!",_V=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,s=a=>{const u=[];let c=0,f=0,h;for(let k=0;k<a.length;k++){let w=a[k];if(c===0){if(w===i&&(r||a.slice(k,k+o)===t)){u.push(a.slice(f,k)),f=k+o;continue}if(w==="/"){h=k;continue}}w==="["?c++:w==="]"&&c--}const p=u.length===0?a:a.substring(f),m=p.startsWith(dR),y=m?p.substring(1):p,x=h&&h>f?h-f:void 0;return{modifiers:u,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:x}};return n?a=>n({className:a,parseClassName:s}):s},NV=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},TV=e=>({cache:CV(e.cacheSize),parseClassName:_V(e),...wV(e)}),AV=/\s+/,PV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(AV);let a="";for(let u=s.length-1;u>=0;u-=1){const c=s[u],{modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(c);let y=!!m,x=r(y?p.substring(0,m):p);if(!x){if(!y){a=c+(a.length>0?" "+a:a);continue}if(x=r(p),!x){a=c+(a.length>0?" "+a:a);continue}y=!1}const k=NV(f).join(":"),w=h?k+dR:k,E=w+x;if(o.includes(E))continue;o.push(E);const C=i(x,y);for(let N=0;N<C.length;++N){const P=C[N];o.push(w+P)}a=c+(a.length>0?" "+a:a)}return a};function RV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=fR(t))&&(r&&(r+=" "),r+=n);return r}const fR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=fR(e[r]))&&(n&&(n+=" "),n+=t);return n};function MV(e,...t){let n,r,i,o=s;function s(u){const c=t.reduce((f,h)=>h(f),e());return n=TV(c),r=n.cache.get,i=n.cache.set,o=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=PV(u,n);return i(u,f),f}return function(){return o(RV.apply(null,arguments))}}const $t=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},hR=/^\[(?:([a-z-]+):)?(.+)\]$/i,DV=/^\d+\/\d+$/,OV=new Set(["px","full","screen"]),IV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jV=/\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$/,LV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,FV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,no=e=>xl(e)||OV.has(e)||DV.test(e),Xo=e=>nu(e,"length",qV),xl=e=>!!e&&!Number.isNaN(Number(e)),sv=e=>nu(e,"number",xl),Qu=e=>!!e&&Number.isInteger(Number(e)),$V=e=>e.endsWith("%")&&xl(e.slice(0,-1)),lt=e=>hR.test(e),Qo=e=>IV.test(e),BV=new Set(["length","size","percentage"]),VV=e=>nu(e,BV,pR),WV=e=>nu(e,"position",pR),UV=new Set(["image","url"]),HV=e=>nu(e,UV,ZV),YV=e=>nu(e,"",GV),Ju=()=>!0,nu=(e,t,n)=>{const r=hR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},qV=e=>jV.test(e)&&!LV.test(e),pR=()=>!1,GV=e=>FV.test(e),ZV=e=>zV.test(e),KV=()=>{const e=$t("colors"),t=$t("spacing"),n=$t("blur"),r=$t("brightness"),i=$t("borderColor"),o=$t("borderRadius"),s=$t("borderSpacing"),a=$t("borderWidth"),u=$t("contrast"),c=$t("grayscale"),f=$t("hueRotate"),h=$t("invert"),p=$t("gap"),m=$t("gradientColorStops"),y=$t("gradientColorStopPositions"),x=$t("inset"),k=$t("margin"),w=$t("opacity"),E=$t("padding"),C=$t("saturate"),N=$t("scale"),P=$t("sepia"),A=$t("skew"),O=$t("space"),M=$t("translate"),j=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",lt,t],F=()=>[lt,t],H=()=>["",no,Xo],I=()=>["auto",xl,lt],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",lt],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[xl,lt];return{cacheSize:500,separator:":",theme:{colors:[Ju],spacing:[no,Xo],blur:["none","",Qo,lt],brightness:U(),borderColor:[e],borderRadius:["none","","full",Qo,lt],borderSpacing:F(),borderWidth:H(),contrast:U(),grayscale:W(),hueRotate:U(),invert:W(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[$V,Xo],inset:$(),margin:$(),opacity:U(),padding:F(),saturate:U(),scale:U(),sepia:W(),skew:U(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",lt]}],container:["container"],columns:[{columns:[Qo]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"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","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),lt]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qu,lt]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",lt]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Qu,lt]}],"grid-cols":[{"grid-cols":[Ju]}],"col-start-end":[{col:["auto",{span:["full",Qu,lt]},lt]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Ju]}],"row-start-end":[{row:["auto",{span:[Qu,lt]},lt]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",lt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",lt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",lt,t]}],"min-w":[{"min-w":[lt,t,"min","max","fit"]}],"max-w":[{"max-w":[lt,t,"none","full","min","max","fit","prose",{screen:[Qo]},Qo]}],h:[{h:[lt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[lt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[lt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[lt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qo,Xo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sv]}],"font-family":[{font:[Ju]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",lt]}],"line-clamp":[{"line-clamp":["none",xl,sv]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",no,lt]}],"list-image":[{"list-image":["none",lt]}],"list-style-type":[{list:["none","disc","decimal",lt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",no,Xo]}],"underline-offset":[{"underline-offset":["auto",no,lt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",lt]}],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",lt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),WV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",VV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},HV]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],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:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:Y()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[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:["",...Y()]}],"outline-offset":[{"outline-offset":[no,lt]}],"outline-w":[{outline:[no,Xo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[no,Xo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qo,YV]}],"shadow-color":[{shadow:[Ju]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Qo,lt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[h]}],saturate:[{saturate:[C]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",lt]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",lt]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",lt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Qu,lt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",lt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",lt]}],"caret-color":[{caret:[e]}],"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",lt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[no,Xo,sv]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},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"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-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-s","border-color-e","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"]}}},XV=MV(KV);function Te(...e){return XV(im(e))}const fb=async(e,t)=>{var r;const n=await fetch(e);if(!n.ok){const i=new Error("An error occurred while fetching the data.");throw i.info=await n.json(),i.status=n.status,t||mn.error(((r=i==null?void 0:i.info)==null?void 0:r.error)||(i==null?void 0:i.message)),i}return n.json()},QV=()=>v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",children:[v.jsx("circle",{cx:"18.0002",cy:"18.0002",r:"15.2365",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("ellipse",{cx:"18.0008",cy:"18",rx:"15.2365",ry:"10.2193",transform:"rotate(45 18.0008 18)",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("path",{d:"M11.7793 18.0547H24.3007",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("path",{d:"M14.8574 21.2354L21.2192 14.8736",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("path",{d:"M21.2207 21.2354L14.8589 14.8736",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.57571 11.2943C4.93105 13.0681 3.39081 15.4508 3.39081 17.9997C3.39081 20.5486 4.93105 22.9313 7.57571 24.7051C10.2163 26.4762 13.9001 27.592 18.0003 27.592C22.1004 27.592 25.7842 26.4762 28.4248 24.7051C31.0695 22.9313 32.6097 20.5486 32.6097 17.9997C32.6097 15.4508 31.0695 13.0681 28.4248 11.2943C25.7842 9.5232 22.1004 8.40741 18.0003 8.40741C13.9001 8.40741 10.2163 9.5232 7.57571 11.2943ZM6.87715 10.2528C9.75106 8.32521 13.6855 7.15332 18.0003 7.15332C22.315 7.15332 26.2495 8.32521 29.1234 10.2528C31.9932 12.1776 33.8638 14.9046 33.8638 17.9997C33.8638 21.0948 31.9932 23.8218 29.1234 25.7466C26.2495 27.6742 22.315 28.8461 18.0003 28.8461C13.6855 28.8461 9.75106 27.6742 6.87715 25.7466C4.00728 23.8218 2.13672 21.0948 2.13672 17.9997C2.13672 14.9046 4.00728 12.1776 6.87715 10.2528Z",fill:"currentColor"})]}),JV=[{name:"Agents",url:"/agents",icon:oR},{name:"Tools",url:"/tools",icon:BB},{name:"Workflows",url:"/workflows",icon:T0}],e6=()=>{const{pathname:e}=_o();return v.jsx("div",{className:"relative z-20 h-full text-mastra-el-6",children:v.jsxs("div",{className:"bg-mastra-bg-1 h-full w-full p-4 flex gap-6 flex-col",children:[v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs("div",{className:"flex gap-2 px-2 items-center",children:[v.jsx(QV,{}),v.jsx("p",{className:"text-medium text-sm gradient py-[0.38rem] font-tasa",children:"Mastra Playground"})]})}),v.jsx("div",{children:v.jsx("div",{className:"flex flex-col gap-0.5",children:JV.map(t=>{const[n,r]=e.split("/"),i=t.name.toLowerCase(),o=t.url===e||t.name===e||r===i;return v.jsxs(Cd,{to:t.url,className:Te("flex cursor-pointer w-full px-2 items-center focus-visible:outline-none transition-colors focus-visible:ring-1 focus-visible:ring-mastra-border-4 gap-3 rounded-xs group text-small hover:bg-mastra-el-6/5",o?"bg-mastra-el-6/5":""),children:[v.jsx(t.icon,{className:Te("w-[0.875rem] h-[0.875rem] text-mastra-el-3 group-hover:text-mastra-el-6",o?"text-mastra-el-6":"")}),v.jsx("p",{className:Te("py-[0.38rem] text-mastra-el-6/60 group-hover:text-mastra-el-6 transition-all capitalize ",o?"text-mastra-el-6":""),children:t.name})]})})})}),v.jsxs("div",{className:"flex mt-auto gap-2 items-center justify-center",children:[v.jsx("a",{href:"https://mastra.ai",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"Mastra.AI"}),v.jsx("div",{className:"w-1 h-1 bg-gray-300/60 rounded-full"}),v.jsx("a",{href:"https://mastra.ai/docs/guide",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"Docs"}),v.jsx("div",{className:"w-1 h-1 bg-gray-300/60 rounded-full"}),v.jsx("a",{href:"https://github.com/mastra-ai/mastra",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"GitHub"})]})]})})};var t6=(e,t,n,r,i,o,s,a)=>{let u=document.documentElement,c=["light","dark"];function f(m){(Array.isArray(e)?e:[e]).forEach(y=>{let x=y==="class",k=x&&o?i.map(w=>o[w]||w):i;x?(u.classList.remove(...k),u.classList.add(m)):u.setAttribute(y,m)}),h(m)}function h(m){a&&c.includes(m)&&(u.style.colorScheme=m)}function p(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)f(r);else try{let m=localStorage.getItem(t)||n,y=s&&m==="system"?p():m;f(y)}catch{}},n6=S.createContext(void 0),r6={setTheme:e=>{},themes:[]},i6=()=>{var e;return(e=S.useContext(n6))!=null?e:r6};S.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:s,themes:a,nonce:u,scriptProps:c})=>{let f=JSON.stringify([n,t,o,e,a,s,r,i]).slice(1,-1);return S.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${t6.toString()})(${f})`}})});const o6=({...e})=>{const{theme:t="system"}=i6();return v.jsx(xV,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},s6=S.createContext({theme:"system",setTheme:()=>null});function a6({children:e,defaultTheme:t="system"}){const[n,r]=S.useState(t);return S.useEffect(()=>{const i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";i.classList.add(o);return}i.classList.add(n)},[n]),v.jsx(s6.Provider,{value:{theme:n,setTheme:r},children:e})}const l6=({children:e})=>v.jsxs(a6,{defaultTheme:"dark",attribute:"class",children:[v.jsx(o6,{position:"bottom-right"}),v.jsxs("main",{className:"bg-mastra-bg-1 grid h-full w-full grid-cols-[15rem_minmax(0,_1fr)] overflow-clip",children:[v.jsx("div",{className:"z-20 h-full",children:v.jsx("div",{className:"h-full",children:v.jsx(e6,{})})}),v.jsx("div",{className:"bg-mastra-bg-2 grid h-[calc(100vh-1rem)] relative border-mastra-border-1 rounded-xs border-thin m-2 overflow-hidden border-solid",children:e})]})]}),Cr=({title:e,rightElement:t})=>v.jsx("header",{className:"sticky top-0 z-50",children:v.jsx("div",{className:"flex h-[var(--top-bar-height)] w-full content-center items-center justify-between border-b-[0.1px] border-mastra-border-1 px-[1.31rem]",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h1",{className:"font-medium text-sm font-mono",children:e}),v.jsx("div",{className:"ml-auto",children:t})]})})});function Je({className:e,...t}){return v.jsx("div",{className:Te("animate-pulse rounded-md bg-muted",e),...t})}const mR=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/agents");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching agents",a),mn.error((a==null?void 0:a.error)||"Error fetching agents");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching agents",o),mn.error("Error fetching agents")}finally{r(!1)}})()},[]),{agents:e,isLoading:n}},om=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/agents/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching agent",u),mn.error((u==null?void 0:u.error)||"Error fetching agent");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching agent",s),mn.error("Error fetching agent")}finally{i(!1)}})()},[e]),{agent:t,isLoading:r}},u6=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/tools");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching tools",a),mn.error((a==null?void 0:a.error)||"Error fetching tools");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching tools",o),mn.error("Error fetching tools")}finally{r(!1)}})()},[]),{tools:e,isLoading:n}},c6=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/tools/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching tool",u),mn.error((u==null?void 0:u.error)||"Error fetching tool");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching tool",s),mn.error("Error fetching tool")}finally{i(!1)}})()},[e]),{tool:t,isLoading:r}},d6=()=>{const{agents:e,isLoading:t}=mR(),{tools:n,isLoading:r}=u6(),[i,o]=S.useState(null),[s,a]=S.useState(!0),{agent:u,isLoading:c}=om(i),f=ks();if(t)return v.jsxs("div",{className:"flex flex-col h-full w-full",children:[v.jsx(Cr,{title:"Tools"}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] py-6 px-4",children:[v.jsx("div",{className:"flex flex-col gap-4",children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx("div",{className:"px-2 py-2 rounded-md bg-mastra-bg-13 mb-2",children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx(Je,{className:"h-3 w-3"}),v.jsx(Je,{className:"h-4 w-20"})]})}),v.jsx("div",{className:"flex flex-col gap-2",children:[1,2,3].map(m=>v.jsxs("div",{className:"flex gap-2 items-center px-2 py-2 rounded-md bg-mastra-bg-13",children:[v.jsx(Je,{className:"h-3 w-3"}),v.jsx(Je,{className:"h-4 w-24"})]},m))})]})}),v.jsx("div",{className:"border-l border-mastra-border-1 pl-4",children:v.jsx(Je,{className:"h-full w-full rounded-md"})})]})]});const h=m=>{o(m),a(!1)},p=()=>{a(!0),o(null)};return r||c?v.jsxs("div",{className:"flex flex-col h-full w-full ",children:[v.jsx(Cr,{title:"Tools"}),v.jsx("div",{className:"w-full h-full grid grid-cols-[300px_1fr] ",children:v.jsx("div",{className:"w-full h-full border-r-[0.5px] border-mastra-border-1 py-6 px-4",children:v.jsx(Je,{className:"h-full w-full rounded-md"})})})]}):v.jsxs("div",{className:"flex flex-col h-full w-full ",children:[v.jsx(Cr,{title:"Tools"}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] ",children:[v.jsx("div",{className:"w-full h-full border-r-[0.5px] border-mastra-border-1 py-6 px-4",children:v.jsxs("ul",{className:" flex flex-col gap-4",children:[Object.keys(n).length>0&&v.jsx("li",{className:Te("px-2 py-2 rounded-md hover:bg-mastra-bg-4/80 transition-colors cursor-pointer",s&&"bg-mastra-bg-4/80"),onClick:p,children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-3",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})}),v.jsx("p",{className:"text-sm text-mastra-el-6",children:"All Tools"})]})}),Object.entries(e).map(([m,y])=>v.jsx("li",{className:Te("px-2 py-2 rounded-md hover:bg-mastra-bg-4/80 transition-colors cursor-pointer",i===m&&"bg-mastra-bg-4/80"),onClick:()=>h(m),children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-3",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})}),v.jsxs("p",{className:"text-sm text-mastra-el-6",children:[y.name," Tools"]})]})},m))]})}),v.jsx("div",{className:"flex flex-col gap-4 py-6 px-4",children:v.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2",children:c?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[v.jsx(Je,{className:"h-4 w-24"}),v.jsx(Je,{className:"h-4 w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[v.jsx(Je,{className:"h-4 w-24"}),v.jsx(Je,{className:"h-4 w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[v.jsx(Je,{className:"h-4 w-24"}),v.jsx(Je,{className:"h-4 w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[v.jsx(Je,{className:"h-4 w-24"}),v.jsx(Je,{className:"h-4 w-full"})]})]}):s?Object.entries(n).map(([m,y],x)=>v.jsxs("div",{onClick:()=>{f(`/tools/all/${y.id}`)},className:" hover:bg-mastra-bg-4/80 transition-colors flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] cursor-pointer border-[0.5px] border-mastra-border-1",children:[v.jsx("h3",{className:"text-small text-mastra-el-6",children:m}),v.jsx("p",{className:"text-small text-mastra-el-2",children:y.description})]},x)):Object.entries((u==null?void 0:u.tools)??{}).map(([m,y],x)=>v.jsxs("div",{onClick:()=>{f(`/tools/${i}/${y.id}`)},className:" hover:bg-mastra-bg-4/80 transition-colors flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] cursor-pointer border-[0.5px] border-mastra-border-1",children:[v.jsx("h3",{className:"text-small text-mastra-el-6",children:m}),v.jsx("p",{className:"text-small text-mastra-el-2",children:y.description})]},x))})})]})]})};function SC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sm(...e){return t=>{let n=!1;const r=e.map(i=>{const o=SC(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():SC(e[i],null)}}}}function pt(...e){return S.useCallback(sm(...e),e)}var Li=S.forwardRef((e,t)=>{const{children:n,...r}=e,i=S.Children.toArray(n),o=i.find(f6);if(o){const s=o.props.children,a=i.map(u=>u===o?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:u);return v.jsx(R0,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return v.jsx(R0,{...r,ref:t,children:n})});Li.displayName="Slot";var R0=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const i=p6(n);return S.cloneElement(n,{...h6(r,n.props),ref:t?sm(t,i):i})}return S.Children.count(n)>1?S.Children.only(null):null});R0.displayName="SlotClone";var gR=({children:e})=>v.jsx(v.Fragment,{children:e});function f6(e){return S.isValidElement(e)&&e.type===gR}function h6(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function p6(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const EC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,CC=im,ru=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return CC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],h=o==null?void 0:o[c];if(f===null)return null;const p=EC(f)||EC(h);return i[c][p]}),a=n&&Object.entries(n).reduce((c,f)=>{let[h,p]=f;return p===void 0||(c[h]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:h,className:p,...m}=f;return Object.entries(m).every(y=>{let[x,k]=y;return Array.isArray(k)?k.includes({...o,...a}[x]):{...o,...a}[x]===k})?[...c,h,p]:c},[]);return CC(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},wl=ru("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-mastra-bg-7 border-[0.5px] border-mastra-border-4 text-white hover:bg-mastra-bg-7/70",primary:"border-[0.5px] border-mastra-border-1 bg-mastra-bg-4 hover:bg-mastra-bg-2/80 text-kp-el-6",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Bt=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?Li:"button";return v.jsx(s,{className:Te(wl({variant:t,size:n,className:e})),ref:o,...i})});Bt.displayName="Button";var m6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ue=m6.reduce((e,t)=>{const n=S.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?Li:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function yR(e,t){e&&tu.flushSync(()=>e.dispatchEvent(t))}var Un=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{};function g6(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var tr=e=>{const{present:t,children:n}=e,r=y6(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),o=pt(r.ref,v6(i));return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:o}):null};tr.displayName="Presence";function y6(e){const[t,n]=S.useState(),r=S.useRef({}),i=S.useRef(e),o=S.useRef("none"),s=e?"mounted":"unmounted",[a,u]=g6(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=vh(r.current);o.current=a==="mounted"?c:"none"},[a]),Un(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,m=vh(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Un(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,h=m=>{const x=vh(r.current).includes(m.animationName);if(m.target===t&&x&&(u("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},p=m=>{m.target===t&&(o.current=vh(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function vh(e){return(e==null?void 0:e.animationName)||"none"}function v6(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function x6(e,t){const n=S.createContext(t),r=o=>{const{children:s,...a}=o,u=S.useMemo(()=>a,Object.values(a));return v.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function i(o){const s=S.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Yr(e,t=[]){let n=[];function r(o,s){const a=S.createContext(s),u=n.length;n=[...n,s];const c=h=>{var w;const{scope:p,children:m,...y}=h,x=((w=p==null?void 0:p[e])==null?void 0:w[u])||a,k=S.useMemo(()=>y,Object.values(y));return v.jsx(x.Provider,{value:k,children:m})};c.displayName=o+"Provider";function f(h,p){var x;const m=((x=p==null?void 0:p[e])==null?void 0:x[u])||a,y=S.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(s=>S.createContext(s));return function(a){const u=(a==null?void 0:a[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,w6(i,...t)]}function w6(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:u,scopeName:c})=>{const h=u(o)[`__scope${c}`];return{...a,...h}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function fn(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var b6=S.createContext(void 0);function _d(e){const t=S.useContext(b6);return e||t||"ltr"}function M0(e,[t,n]){return Math.min(n,Math.max(t,e))}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function k6(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var hb="ScrollArea",[vR,vve]=Yr(hb),[S6,qr]=vR(hb),xR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,u]=S.useState(null),[c,f]=S.useState(null),[h,p]=S.useState(null),[m,y]=S.useState(null),[x,k]=S.useState(null),[w,E]=S.useState(0),[C,N]=S.useState(0),[P,A]=S.useState(!1),[O,M]=S.useState(!1),j=pt(t,$=>u($)),R=_d(i);return v.jsx(S6,{scope:n,type:r,dir:R,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:f,content:h,onContentChange:p,scrollbarX:m,onScrollbarXChange:y,scrollbarXEnabled:P,onScrollbarXEnabledChange:A,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:O,onScrollbarYEnabledChange:M,onCornerWidthChange:E,onCornerHeightChange:N,children:v.jsx(Ue.div,{dir:R,...s,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});xR.displayName=hb;var wR="ScrollAreaViewport",bR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=qr(wR,n),a=S.useRef(null),u=pt(t,a,s.onViewportChange);return v.jsxs(v.Fragment,{children:[v.jsx("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}"},nonce:i}),v.jsx(Ue.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:v.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});bR.displayName=wR;var Vi="ScrollAreaScrollbar",pb=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=qr(Vi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return S.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?v.jsx(E6,{...r,ref:t,forceMount:n}):i.type==="scroll"?v.jsx(C6,{...r,ref:t,forceMount:n}):i.type==="auto"?v.jsx(kR,{...r,ref:t,forceMount:n}):i.type==="always"?v.jsx(mb,{...r,ref:t}):null});pb.displayName=Vi;var E6=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=qr(Vi,e.__scopeScrollArea),[o,s]=S.useState(!1);return S.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const c=()=>{window.clearTimeout(u),s(!0)},f=()=>{u=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),v.jsx(tr,{present:n||o,children:v.jsx(kR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),C6=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=qr(Vi,e.__scopeScrollArea),o=e.orientation==="horizontal",s=lm(()=>u("SCROLL_END"),100),[a,u]=k6("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 S.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,u]),S.useEffect(()=>{const c=i.viewport,f=o?"scrollLeft":"scrollTop";if(c){let h=c[f];const p=()=>{const m=c[f];h!==m&&(u("SCROLL"),s()),h=m};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[i.viewport,o,u,s]),v.jsx(tr,{present:n||a!=="hidden",children:v.jsx(mb,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),kR=S.forwardRef((e,t)=>{const n=qr(Vi,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=S.useState(!1),a=e.orientation==="horizontal",u=lm(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:f)}},10);return Al(n.viewport,u),Al(n.content,u),v.jsx(tr,{present:r||o,children:v.jsx(mb,{"data-state":o?"visible":"hidden",...i,ref:t})})}),mb=S.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=qr(Vi,e.__scopeScrollArea),o=S.useRef(null),s=S.useRef(0),[a,u]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=NR(a.viewport,a.content),f={...r,sizes:a,onSizesChange:u,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,m){return R6(p,s.current,a,m)}return n==="horizontal"?v.jsx(_6,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,m=_C(p,a,i.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=h(p,i.dir))}}):n==="vertical"?v.jsx(N6,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,m=_C(p,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=h(p))}}):null}),_6=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=qr(Vi,e.__scopeScrollArea),[s,a]=S.useState(),u=S.useRef(null),c=pt(t,u,o.onScrollbarXChange);return S.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),v.jsx(ER,{"data-orientation":"horizontal",...i,ref:c,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":am(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),AR(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:up(s.paddingLeft),paddingEnd:up(s.paddingRight)}})}})}),N6=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=qr(Vi,e.__scopeScrollArea),[s,a]=S.useState(),u=S.useRef(null),c=pt(t,u,o.onScrollbarYChange);return S.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),v.jsx(ER,{"data-orientation":"vertical",...i,ref:c,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":am(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),AR(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:up(s.paddingTop),paddingEnd:up(s.paddingBottom)}})}})}),[T6,SR]=vR(Vi),ER=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:c,onWheelScroll:f,onResize:h,...p}=e,m=qr(Vi,n),[y,x]=S.useState(null),k=pt(t,j=>x(j)),w=S.useRef(null),E=S.useRef(""),C=m.viewport,N=r.content-r.viewport,P=fn(f),A=fn(u),O=lm(h,10);function M(j){if(w.current){const R=j.clientX-w.current.left,$=j.clientY-w.current.top;c({x:R,y:$})}}return S.useEffect(()=>{const j=R=>{const $=R.target;(y==null?void 0:y.contains($))&&P(R,N)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[C,y,N,P]),S.useEffect(A,[r,A]),Al(y,O),Al(m.content,O),v.jsx(T6,{scope:n,scrollbar:y,hasThumb:i,onThumbChange:fn(o),onThumbPointerUp:fn(s),onThumbPositionChange:A,onThumbPointerDown:fn(a),children:v.jsx(Ue.div,{...p,ref:k,style:{position:"absolute",...p.style},onPointerDown:Re(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),w.current=y.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),M(j))}),onPointerMove:Re(e.onPointerMove,M),onPointerUp:Re(e.onPointerUp,j=>{const R=j.target;R.hasPointerCapture(j.pointerId)&&R.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=E.current,m.viewport&&(m.viewport.style.scrollBehavior=""),w.current=null})})})}),lp="ScrollAreaThumb",CR=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=SR(lp,e.__scopeScrollArea);return v.jsx(tr,{present:n||i.hasThumb,children:v.jsx(A6,{ref:t,...r})})}),A6=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=qr(lp,n),s=SR(lp,n),{onThumbPositionChange:a}=s,u=pt(t,h=>s.onThumbChange(h)),c=S.useRef(void 0),f=lm(()=>{c.current&&(c.current(),c.current=void 0)},100);return S.useEffect(()=>{const h=o.viewport;if(h){const p=()=>{if(f(),!c.current){const m=M6(h,a);c.current=m,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[o.viewport,f,a]),v.jsx(Ue.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Re(e.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),y=h.clientX-m.left,x=h.clientY-m.top;s.onThumbPointerDown({x:y,y:x})}),onPointerUp:Re(e.onPointerUp,s.onThumbPointerUp)})});CR.displayName=lp;var gb="ScrollAreaCorner",_R=S.forwardRef((e,t)=>{const n=qr(gb,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?v.jsx(P6,{...e,ref:t}):null});_R.displayName=gb;var P6=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=qr(gb,n),[o,s]=S.useState(0),[a,u]=S.useState(0),c=!!(o&&a);return Al(i.scrollbarX,()=>{var h;const f=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(f),u(f)}),Al(i.scrollbarY,()=>{var h;const f=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(f),s(f)}),c?v.jsx(Ue.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function up(e){return e?parseInt(e,10):0}function NR(e,t){const n=e/t;return isNaN(n)?0:n}function am(e){const t=NR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function R6(e,t,n,r="ltr"){const i=am(n),o=i/2,s=t||o,a=i-s,u=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return TR([u,c],h)(e)}function _C(e,t,n="ltr"){const r=am(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,u=n==="ltr"?[0,s]:[s*-1,0],c=M0(e,u);return TR([0,s],[0,a])(c)}function TR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function AR(e,t){return e>0&&e<t}var M6=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function lm(e,t){const n=fn(e),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Al(e,t){const n=fn(t);Un(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var PR=xR,D6=bR,O6=_R;const fr=S.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(PR,{ref:r,className:Te("relative overflow-hidden",e),...n,children:[v.jsx(D6,{className:"h-full w-full rounded-[inherit]",children:t}),v.jsx(RR,{}),v.jsx(O6,{})]}));fr.displayName=PR.displayName;const RR=S.forwardRef(({className:e,orientation:t="vertical",...n},r)=>v.jsx(pb,{ref:r,orientation:t,className:Te("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:v.jsx(CR,{className:"relative flex-1 rounded-full bg-border"})}));RR.displayName=pb.displayName;const yb=S.forwardRef(({className:e,...t},n)=>v.jsx("table",{ref:n,className:Te("w-full caption-bottom text-sm border-spacing-0",e),...t}));yb.displayName="Table";const vb=S.forwardRef(({className:e,...t},n)=>v.jsx("thead",{ref:n,className:Te("[&_tr]:border-b",e),...t}));vb.displayName="TableHeader";const xb=S.forwardRef(({className:e,...t},n)=>v.jsx("tbody",{ref:n,className:Te("[&_tr:last-child]:border-0",e),...t}));xb.displayName="TableBody";const I6=S.forwardRef(({className:e,...t},n)=>v.jsx("tfoot",{ref:n,className:Te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));I6.displayName="TableFooter";const ea=S.forwardRef(({className:e,...t},n)=>v.jsx("tr",{ref:n,className:Te("border-b-[0.5px] border-mastra-border-1 transition-colors hover:bg-muted/50 data-[state=selected]:bg-mastra-bg-4/70",e),...t}));ea.displayName="TableRow";const ao=S.forwardRef(({className:e,...t},n)=>v.jsx("th",{ref:n,className:Te("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ao.displayName="TableHead";const Bn=S.forwardRef(({className:e,...t},n)=>v.jsx("td",{ref:n,className:Te("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Bn.displayName="TableCell";const j6=S.forwardRef(({className:e,...t},n)=>v.jsx("caption",{ref:n,className:Te("mt-4 text-sm text-muted-foreground",e),...t}));j6.displayName="TableCaption";function L6(){const{agents:e,isLoading:t}=mR(),n=ks();return v.jsxs("div",{className:"flex flex-col h-full relative overflow-hidden",children:[v.jsx(Cr,{title:"Agents"}),v.jsx("main",{className:"flex-1 relative overflow-hidden",children:v.jsx(fr,{className:"rounded-lg h-full",children:v.jsxs(yb,{children:[v.jsx(vb,{className:"bg-[#171717] sticky top-0 z-10",children:v.jsxs(ea,{className:"border-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(ao,{className:"w-[50px]"}),v.jsx(ao,{className:"text-mastra-el-3",children:"Name"}),v.jsx(ao,{className:"text-mastra-el-3 w-1/2",children:"Instruction"}),v.jsx(ao,{className:"text-mastra-el-3",children:"Model"}),v.jsx(ao,{className:"text-mastra-el-3",children:"Action"})]})}),v.jsx(xb,{className:"border-b border-gray-6",children:t?v.jsxs(ea,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-8"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})})]}):Object.entries(e).map(([r,i])=>{var o;return v.jsxs(ea,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(Bn,{children:v.jsx("div",{className:"h-8 w-full flex items-center justify-center",children:v.jsx(oR,{className:"h-4 w-4 text-mastra-el-5"})})}),v.jsx(Bn,{className:"font-medium text-mastra-el-5",children:i.name}),v.jsx(Bn,{className:"truncate w-1/2 max-w-[500px] text-mastra-el-5",children:i.instructions}),v.jsx(Bn,{className:"text-mastra-el-5 text-sm",children:(o=i==null?void 0:i.model)==null?void 0:o.provider}),v.jsx(Bn,{className:"text-mastra-el-5 text-sm",children:v.jsx("span",{onClick:()=>{n(`/agents/${r}`)},className:"hover:no-underline",children:v.jsxs(Bt,{size:"sm",variant:"outline",children:[v.jsx(FB,{className:"h-4 w-4 text-inherit"}),"Chat with agent"]})})})]},r)})})]})})})]})}var av={exports:{}},lv={};/**
|
|
193
|
+
* @license React
|
|
194
|
+
* use-sync-external-store-shim.production.js
|
|
195
|
+
*
|
|
196
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the MIT license found in the
|
|
199
|
+
* LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/var NC;function F6(){if(NC)return lv;NC=1;var e=Xl();function t(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(h,p){var m=p(),y=r({inst:{value:m,getSnapshot:p}}),x=y[0].inst,k=y[1];return o(function(){x.value=m,x.getSnapshot=p,u(x)&&k({inst:x})},[h,m,p]),i(function(){return u(x)&&k({inst:x}),h(function(){u(x)&&k({inst:x})})},[h]),s(m),m}function u(h){var p=h.getSnapshot;h=h.value;try{var m=p();return!n(h,m)}catch{return!0}}function c(h,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return lv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,lv}var TC;function z6(){return TC||(TC=1,av.exports=F6()),av.exports}var MR=z6();const us=()=>{},ur=us(),uv=Object,Et=e=>e===ur,Ci=e=>typeof e=="function",ds=(e,t)=>({...e,...t}),$6=e=>Ci(e.then),xh=new WeakMap;let B6=0;const Lc=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,o;if(uv(e)===e&&!r&&n!=RegExp){if(i=xh.get(e),i)return i;if(i=++B6+"~",xh.set(e,i),n==Array){for(i="@",o=0;o<e.length;o++)i+=Lc(e[o])+",";xh.set(e,i)}if(n==uv){i="#";const s=uv.keys(e).sort();for(;!Et(o=s.pop());)Et(e[o])||(i+=o+":"+Lc(e[o])+",");xh.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},lo=new WeakMap,cv={},wh={},wb="undefined",um=typeof window!=wb,D0=typeof document!=wb,V6=()=>um&&typeof window.requestAnimationFrame!=wb,DR=(e,t)=>{const n=lo.get(e);return[()=>!Et(t)&&e.get(t)||cv,r=>{if(!Et(t)){const i=e.get(t);t in wh||(wh[t]=i),n[5](t,ds(i,r),i||cv)}},n[6],()=>!Et(t)&&t in wh?wh[t]:!Et(t)&&e.get(t)||cv]};let O0=!0;const W6=()=>O0,[I0,j0]=um&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[us,us],U6=()=>{const e=D0&&document.visibilityState;return Et(e)||e!=="hidden"},H6=e=>(D0&&document.addEventListener("visibilitychange",e),I0("focus",e),()=>{D0&&document.removeEventListener("visibilitychange",e),j0("focus",e)}),Y6=e=>{const t=()=>{O0=!0,e()},n=()=>{O0=!1};return I0("online",t),I0("offline",n),()=>{j0("online",t),j0("offline",n)}},q6={isOnline:W6,isVisible:U6},G6={initFocus:H6,initReconnect:Y6},AC=!ne.useId,Fc=!um||"Deno"in window,Z6=e=>V6()?window.requestAnimationFrame(e):setTimeout(e,1),dv=Fc?S.useEffect:S.useLayoutEffect,fv=typeof navigator<"u"&&navigator.connection,PC=!Fc&&fv&&(["slow-2g","2g"].includes(fv.effectiveType)||fv.saveData),bb=e=>{if(Ci(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Lc(e):"",[e,t]};let K6=0;const L0=()=>++K6,OR=0,IR=1,jR=2,X6=3;var ec={__proto__:null,ERROR_REVALIDATE_EVENT:X6,FOCUS_EVENT:OR,MUTATE_EVENT:jR,RECONNECT_EVENT:IR};async function LR(...e){const[t,n,r,i]=e,o=ds({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let u=o.optimisticData;const c=p=>typeof a=="function"?a(p):a!==!1,f=o.throwOnError;if(Ci(n)){const p=n,m=[],y=t.keys();for(const x of y)!/^\$(inf|sub)\$/.test(x)&&p(t.get(x)._k)&&m.push(x);return Promise.all(m.map(h))}return h(n);async function h(p){const[m]=bb(p);if(!m)return;const[y,x]=DR(t,m),[k,w,E,C]=lo.get(t),N=()=>{const H=k[m];return(Ci(o.revalidate)?o.revalidate(y().data,p):o.revalidate!==!1)&&(delete E[m],delete C[m],H&&H[0])?H[0](jR).then(()=>y().data):y().data};if(e.length<3)return N();let P=r,A;const O=L0();w[m]=[O,0];const M=!Et(u),j=y(),R=j.data,$=j._c,F=Et($)?R:$;if(M&&(u=Ci(u)?u(F,R):u,x({data:u,_c:F})),Ci(P))try{P=P(F)}catch(H){A=H}if(P&&$6(P))if(P=await P.catch(H=>{A=H}),O!==w[m][0]){if(A)throw A;return P}else A&&M&&c(A)&&(s=!0,x({data:F,_c:ur}));if(s&&!A)if(Ci(s)){const H=s(P,F);x({data:H,error:ur,_c:ur})}else x({data:P,error:ur,_c:ur});if(w[m][1]=L0(),Promise.resolve(N()).then(()=>{x({_c:ur})}),A){if(f)throw A;return}return P}}const RC=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Q6=(e,t)=>{if(!lo.has(e)){const n=ds(G6,t),r={},i=LR.bind(ur,e);let o=us;const s={},a=(f,h)=>{const p=s[f]||[];return s[f]=p,p.push(h),()=>p.splice(p.indexOf(h),1)},u=(f,h,p)=>{e.set(f,h);const m=s[f];if(m)for(const y of m)y(h,p)},c=()=>{if(!lo.has(e)&&(lo.set(e,[r,{},{},{},i,u,a]),!Fc)){const f=n.initFocus(setTimeout.bind(ur,RC.bind(ur,r,OR))),h=n.initReconnect(setTimeout.bind(ur,RC.bind(ur,r,IR)));o=()=>{f&&f(),h&&h(),lo.delete(e)}}};return c(),[e,i,c,o]}return[e,lo.get(e)[4]]},J6=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Et(o)&&s>o||setTimeout(r,a,i)},e8=(e,t)=>Lc(e)==Lc(t),[FR,t8]=Q6(new Map),n8=ds({onLoadingSlow:us,onSuccess:us,onError:us,onErrorRetry:J6,onDiscarded:us,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:PC?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:PC?5e3:3e3,compare:e8,isPaused:()=>!1,cache:FR,mutate:t8,fallback:{}},q6),r8=(e,t)=>{const n=ds(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=ds(i,s))}return n},i8=S.createContext({}),o8="$inf$",zR=um&&window.__SWR_DEVTOOLS_USE__,s8=zR?window.__SWR_DEVTOOLS_USE__:[],a8=()=>{zR&&(window.__SWR_DEVTOOLS_REACT__=ne)},l8=e=>Ci(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],kb=()=>ds(n8,S.useContext(i8)),u8=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=bb(t),[,,,a]=lo.get(FR);if(s.startsWith(o8))return n(...o);const u=a[s];return Et(u)?n(...o):(delete a[s],u)}),r),c8=s8.concat(u8),d8=e=>function(...n){const r=kb(),[i,o,s]=l8(n),a=r8(r,s);let u=e;const{use:c}=a,f=(c||[]).concat(c8);for(let h=f.length;h--;)u=f[h](u);return u(i,o||a.fetcher||null,a)},f8=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};a8();const MC=ne.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),hv={dedupe:!0},h8=(e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:u,refreshInterval:c,refreshWhenHidden:f,refreshWhenOffline:h,keepPreviousData:p}=n,[m,y,x,k]=lo.get(r),[w,E]=bb(e),C=S.useRef(!1),N=S.useRef(!1),P=S.useRef(w),A=S.useRef(t),O=S.useRef(n),M=()=>O.current,j=()=>M().isVisible()&&M().isOnline(),[R,$,F,H]=DR(r,w),I=S.useRef({}).current,q=Et(s)?n.fallback[w]:s,Y=(fe,ve)=>{for(const Me in I){const $e=Me;if($e==="data"){if(!i(fe[$e],ve[$e])&&(!Et(fe[$e])||!i(K,ve[$e])))return!1}else if(ve[$e]!==fe[$e])return!1}return!0},Z=S.useMemo(()=>{const fe=!w||!t?!1:Et(a)?M().isPaused()||o?!1:Et(u)?!0:u:a,ve=oe=>{const ae=ds(oe);return delete ae._k,fe?{isValidating:!0,isLoading:!0,...ae}:ae},Me=R(),$e=H(),ct=ve(Me),_t=Me===$e?ct:ve($e);let Q=ct;return[()=>{const oe=ve(R());return Y(oe,Q)?(Q.data=oe.data,Q.isLoading=oe.isLoading,Q.isValidating=oe.isValidating,Q.error=oe.error,Q):(Q=oe,oe)},()=>_t]},[r,w]),B=MR.useSyncExternalStore(S.useCallback(fe=>F(w,(ve,Me)=>{Y(Me,ve)||fe()}),[r,w]),Z[0],Z[1]),W=!C.current,L=m[w]&&m[w].length>0,U=B.data,V=Et(U)?q:U,D=B.error,G=S.useRef(V),K=p?Et(U)?G.current:U:V,J=L&&!Et(D)?!1:W&&!Et(a)?a:M().isPaused()?!1:o?Et(V)?!1:u:Et(V)||u,ee=!!(w&&t&&W&&J),re=Et(B.isValidating)?ee:B.isValidating,ue=Et(B.isLoading)?ee:B.isLoading,he=S.useCallback(async fe=>{const ve=A.current;if(!w||!ve||N.current||M().isPaused())return!1;let Me,$e,ct=!0;const _t=fe||{},Q=!x[w]||!_t.dedupe,oe=()=>AC?!N.current&&w===P.current&&C.current:w===P.current,ae={isValidating:!1,isLoading:!1},Ce=()=>{$(ae)},we=()=>{const Ae=x[w];Ae&&Ae[1]===$e&&delete x[w]},me={isValidating:!0};Et(R().data)&&(me.isLoading=!0);try{if(Q&&($(me),n.loadingTimeout&&Et(R().data)&&setTimeout(()=>{ct&&oe()&&M().onLoadingSlow(w,n)},n.loadingTimeout),x[w]=[ve(E),L0()]),[Me,$e]=x[w],Me=await Me,Q&&setTimeout(we,n.dedupingInterval),!x[w]||x[w][1]!==$e)return Q&&oe()&&M().onDiscarded(w),!1;ae.error=ur;const Ae=y[w];if(!Et(Ae)&&($e<=Ae[0]||$e<=Ae[1]||Ae[1]===0))return Ce(),Q&&oe()&&M().onDiscarded(w),!1;const Fe=R().data;ae.data=i(Fe,Me)?Fe:Me,Q&&oe()&&M().onSuccess(Me,w,n)}catch(Ae){we();const Fe=M(),{shouldRetryOnError:ce}=Fe;Fe.isPaused()||(ae.error=Ae,Q&&oe()&&(Fe.onError(Ae,w,Fe),(ce===!0||Ci(ce)&&ce(Ae))&&(!M().revalidateOnFocus||!M().revalidateOnReconnect||j())&&Fe.onErrorRetry(Ae,w,Fe,pe=>{const Ie=m[w];Ie&&Ie[0]&&Ie[0](ec.ERROR_REVALIDATE_EVENT,pe)},{retryCount:(_t.retryCount||0)+1,dedupe:!0})))}return ct=!1,Ce(),!0},[w,r]),ke=S.useCallback((...fe)=>LR(r,P.current,...fe),[]);if(dv(()=>{A.current=t,O.current=n,Et(U)||(G.current=U)}),dv(()=>{if(!w)return;const fe=he.bind(ur,hv);let ve=0;const $e=f8(w,m,(ct,_t={})=>{if(ct==ec.FOCUS_EVENT){const Q=Date.now();M().revalidateOnFocus&&Q>ve&&j()&&(ve=Q+M().focusThrottleInterval,fe())}else if(ct==ec.RECONNECT_EVENT)M().revalidateOnReconnect&&j()&&fe();else{if(ct==ec.MUTATE_EVENT)return he();if(ct==ec.ERROR_REVALIDATE_EVENT)return he(_t)}});return N.current=!1,P.current=w,C.current=!0,$({_k:E}),J&&(Et(V)||Fc?fe():Z6(fe)),()=>{N.current=!0,$e()}},[w]),dv(()=>{let fe;function ve(){const $e=Ci(c)?c(R().data):c;$e&&fe!==-1&&(fe=setTimeout(Me,$e))}function Me(){!R().error&&(f||M().isVisible())&&(h||M().isOnline())?he(hv).then(ve):ve()}return ve(),()=>{fe&&(clearTimeout(fe),fe=-1)}},[c,f,h,w]),S.useDebugValue(K),o&&Et(V)&&w){if(!AC&&Fc)throw new Error("Fallback data is required when using suspense in SSR.");A.current=t,O.current=n,N.current=!1;const fe=k[w];if(!Et(fe)){const ve=ke(fe);MC(ve)}if(Et(D)){const ve=he(hv);Et(K)||(ve.status="fulfilled",ve.value=!0),MC(ve)}else throw D}return{mutate:ke,get data(){return I.data=!0,K},get error(){return I.error=!0,D},get isValidating(){return I.isValidating=!0,re},get isLoading(){return I.isLoading=!0,ue}}},Sb=d8(h8);function p8({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=S.useState(!1),i=S.useRef(null),o=S.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{mn.success(t),r(!0),i.current&&(clearTimeout(i.current),i.current=null),i.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{mn.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:o}}function cm({content:e,copyMessage:t,classname:n}){const{isCopied:r,handleCopy:i}=p8({text:e,copyMessage:t});return v.jsxs(Bt,{variant:"ghost",size:"icon",className:Te("relative h-6 w-6",n),"aria-label":"Copy to clipboard",onClick:i,children:[v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:v.jsx(ub,{className:Te("h-4 w-4 transition-transform ease-in-out",r?"scale-100":"scale-0")})}),v.jsx($B,{className:Te("h-4 w-4 transition-transform ease-in-out",r?"scale-0":"scale-100")})]})}function m8(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function dm(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const F0=e=>Array.isArray(e);function $R(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function zc(e){return typeof e=="string"||Array.isArray(e)}function DC(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Eb(e,t,n,r){if(typeof t=="function"){const[i,o]=DC(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=DC(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function fm(e,t,n){const r=e.getProps();return Eb(r,t,n!==void 0?n:r.custom,e)}const Cb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_b=["initial",...Cb],Nd=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xa=new Set(Nd),mo=e=>e*1e3,go=e=>e/1e3,g8={type:"spring",stiffness:500,damping:25,restSpeed:10},y8=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),v8={type:"keyframes",duration:.8},x8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},w8=(e,{keyframes:t})=>t.length>2?v8:xa.has(e)?e.startsWith("scale")?y8(t[1]):g8:x8;function Nb(e,t){return e?e[t]||e.default||e:void 0}const b8={skipAnimations:!1,useManualTiming:!1},k8=e=>e!==null;function hm(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(k8),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const _r=e=>e;let z0=_r;function S8(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(c){o.has(c)&&(u.schedule(c),e()),c(s)}const u={schedule:(c,f=!1,h=!1)=>{const m=h&&r?t:n;return f&&o.add(c),m.has(c)||m.add(c),c},cancel:c=>{n.delete(c),o.delete(c)},process:c=>{if(s=c,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,i&&(i=!1,u.process(c))}};return u}const bh=["read","resolveKeyframes","update","preRender","render","postRender"],E8=40;function BR(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=bh.reduce((w,E)=>(w[E]=S8(o),w),{}),{read:a,resolveKeyframes:u,update:c,preRender:f,render:h,postRender:p}=s,m=()=>{const w=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(w-i.timestamp,E8),1),i.timestamp=w,i.isProcessing=!0,a.process(i),u.process(i),c.process(i),f.process(i),h.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:bh.reduce((w,E)=>{const C=s[E];return w[E]=(N,P=!1,A=!1)=>(n||y(),C.schedule(N,P,A)),w},{}),cancel:w=>{for(let E=0;E<bh.length;E++)s[bh[E]].cancel(w)},state:i,steps:s}}const{schedule:Vt,cancel:fs,state:In,steps:pv}=BR(typeof requestAnimationFrame<"u"?requestAnimationFrame:_r,!0),VR=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,C8=1e-7,_8=12;function N8(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=VR(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>C8&&++a<_8);return s}function Td(e,t,n,r){if(e===t&&n===r)return _r;const i=o=>N8(o,0,1,e,n);return o=>o===0||o===1?o:VR(i(o),t,r)}const WR=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,UR=e=>t=>1-e(1-t),HR=Td(.33,1.53,.69,.99),Tb=UR(HR),YR=WR(Tb),qR=e=>(e*=2)<1?.5*Tb(e):.5*(2-Math.pow(2,-10*(e-1))),Ab=e=>1-Math.sin(Math.acos(e)),GR=UR(Ab),ZR=WR(Ab),KR=e=>/^0[^.\s]+$/u.test(e);function T8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||KR(e):!0}const XR=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),QR=e=>t=>typeof t=="string"&&t.startsWith(e),JR=QR("--"),A8=QR("var(--"),Pb=e=>A8(e)?P8.test(e.split("/*")[0].trim()):!1,P8=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,R8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function M8(e){const t=R8.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function eM(e,t,n=1){const[r,i]=M8(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return XR(s)?parseFloat(s):s}return Pb(i)?eM(i,t,n+1):i}const xo=(e,t,n)=>n>t?t:n<e?e:n,iu={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},$c={...iu,transform:e=>xo(0,1,e)},kh={...iu,default:1},Ad=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),is=Ad("deg"),Ri=Ad("%"),Qe=Ad("px"),D8=Ad("vh"),O8=Ad("vw"),OC={...Ri,parse:e=>Ri.parse(e)/100,transform:e=>Ri.transform(e*100)},I8=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),IC=e=>e===iu||e===Qe,jC=(e,t)=>parseFloat(e.split(", ")[t]),LC=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return jC(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?jC(o[1],e):0}},j8=new Set(["x","y","z"]),L8=Nd.filter(e=>!j8.has(e));function F8(e){const t=[];return L8.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Pl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:LC(4,13),y:LC(5,14)};Pl.translateX=Pl.x;Pl.translateY=Pl.y;const tM=e=>t=>t.test(e),z8={test:e=>e==="auto",parse:e=>e},nM=[iu,Qe,Ri,is,O8,D8,z8],FC=e=>nM.find(tM(e)),ta=new Set;let $0=!1,B0=!1;function rM(){if(B0){const e=Array.from(ta).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=F8(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var a;(a=r.getValue(o))===null||a===void 0||a.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}B0=!1,$0=!1,ta.forEach(e=>e.complete()),ta.clear()}function iM(){ta.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(B0=!0)})}function $8(){iM(),rM()}class Rb{constructor(t,n,r,i,o,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ta.add(this),$0||($0=!0,Vt.read(iM),Vt.resolveKeyframes(rM))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;o<t.length;o++)if(t[o]===null)if(o===0){const s=i==null?void 0:i.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const u=r.readValue(n,a);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ta.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ta.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const kc=e=>Math.round(e*1e5)/1e5,Mb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function B8(e){return e==null}const V8=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Db=(e,t)=>n=>!!(typeof n=="string"&&V8.test(n)&&n.startsWith(e)||t&&!B8(n)&&Object.prototype.hasOwnProperty.call(n,t)),oM=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,a]=r.match(Mb);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},W8=e=>xo(0,255,e),mv={...iu,transform:e=>Math.round(W8(e))},Xs={test:Db("rgb","red"),parse:oM("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+mv.transform(e)+", "+mv.transform(t)+", "+mv.transform(n)+", "+kc($c.transform(r))+")"};function U8(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const V0={test:Db("#"),parse:U8,transform:Xs.transform},cl={test:Db("hsl","hue"),parse:oM("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ri.transform(kc(t))+", "+Ri.transform(kc(n))+", "+kc($c.transform(r))+")"},$n={test:e=>Xs.test(e)||V0.test(e)||cl.test(e),parse:e=>Xs.test(e)?Xs.parse(e):cl.test(e)?cl.parse(e):V0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Xs.transform(e):cl.transform(e)},H8=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Y8(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Mb))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(H8))===null||n===void 0?void 0:n.length)||0)>0}const sM="number",aM="color",q8="var",G8="var(",zC="${}",Z8=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Bc(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(Z8,u=>($n.test(u)?(r.color.push(o),i.push(aM),n.push($n.parse(u))):u.startsWith(G8)?(r.var.push(o),i.push(q8),n.push(u)):(r.number.push(o),i.push(sM),n.push(parseFloat(u))),++o,zC)).split(zC);return{values:n,split:a,indexes:r,types:i}}function lM(e){return Bc(e).values}function uM(e){const{split:t,types:n}=Bc(e),r=t.length;return i=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],i[s]!==void 0){const a=n[s];a===sM?o+=kc(i[s]):a===aM?o+=$n.transform(i[s]):o+=i[s]}return o}}const K8=e=>typeof e=="number"?0:e;function X8(e){const t=lM(e);return uM(e)(t.map(K8))}const hs={test:Y8,parse:lM,createTransformer:uM,getAnimatableNone:X8},Q8=new Set(["brightness","contrast","saturate","opacity"]);function J8(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Mb)||[];if(!r)return e;const i=n.replace(r,"");let o=Q8.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const e9=/\b([a-z-]*)\(.*?\)/gu,W0={...hs,getAnimatableNone:e=>{const t=e.match(e9);return t?t.map(J8).join(" "):e}},t9={borderWidth:Qe,borderTopWidth:Qe,borderRightWidth:Qe,borderBottomWidth:Qe,borderLeftWidth:Qe,borderRadius:Qe,radius:Qe,borderTopLeftRadius:Qe,borderTopRightRadius:Qe,borderBottomRightRadius:Qe,borderBottomLeftRadius:Qe,width:Qe,maxWidth:Qe,height:Qe,maxHeight:Qe,top:Qe,right:Qe,bottom:Qe,left:Qe,padding:Qe,paddingTop:Qe,paddingRight:Qe,paddingBottom:Qe,paddingLeft:Qe,margin:Qe,marginTop:Qe,marginRight:Qe,marginBottom:Qe,marginLeft:Qe,backgroundPositionX:Qe,backgroundPositionY:Qe},n9={rotate:is,rotateX:is,rotateY:is,rotateZ:is,scale:kh,scaleX:kh,scaleY:kh,scaleZ:kh,skew:is,skewX:is,skewY:is,distance:Qe,translateX:Qe,translateY:Qe,translateZ:Qe,x:Qe,y:Qe,z:Qe,perspective:Qe,transformPerspective:Qe,opacity:$c,originX:OC,originY:OC,originZ:Qe},$C={...iu,transform:Math.round},Ob={...t9,...n9,zIndex:$C,size:Qe,fillOpacity:$c,strokeOpacity:$c,numOctaves:$C},r9={...Ob,color:$n,backgroundColor:$n,outlineColor:$n,fill:$n,stroke:$n,borderColor:$n,borderTopColor:$n,borderRightColor:$n,borderBottomColor:$n,borderLeftColor:$n,filter:W0,WebkitFilter:W0},Ib=e=>r9[e];function cM(e,t){let n=Ib(e);return n!==W0&&(n=hs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const i9=new Set(["auto","none","0"]);function o9(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!i9.has(o)&&Bc(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=cM(n,i)}class dM extends Rb{constructor(t,n,r,i,o){super(t,n,r,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let c=t[u];if(typeof c=="string"&&(c=c.trim(),Pb(c))){const f=eM(c,n.current);f!==void 0&&(t[u]=f),u===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!I8.has(r)||t.length!==2)return;const[i,o]=t,s=FC(i),a=FC(o);if(s!==a)if(IC(s)&&IC(a))for(let u=0;u<t.length;u++){const c=t[u];typeof c=="string"&&(t[u]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)T8(t[i])&&r.push(i);r.length&&o9(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(r);o&&o.jump(this.measuredOrigin,!1);const s=i.length-1,a=i[s];i[s]=Pl[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([u,c])=>{n.getValue(u).set(c)}),this.resolveNoneKeyframes()}}function jb(e){return typeof e=="function"}let Yh;function s9(){Yh=void 0}const Mi={now:()=>(Yh===void 0&&Mi.set(In.isProcessing||b8.useManualTiming?In.timestamp:performance.now()),Yh),set:e=>{Yh=e,queueMicrotask(s9)}},BC=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hs.test(e)||e==="0")&&!e.startsWith("url("));function a9(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function l9(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=BC(i,t),a=BC(o,t);return!s||!a?!1:a9(e)||(n==="spring"||jb(n))&&r}const u9=40;class fM{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Mi.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:s,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>u9?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&$8(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Mi.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:s,onComplete:a,onUpdate:u,isGenerator:c}=this.options;if(!c&&!l9(t,r,i,o))if(s)this.options.duration=0;else{u==null||u(hm(t,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const f=this.initPlayback(t,n);f!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...f},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Rl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},hM=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=e(Rl(0,i-1,o))+", ";return`linear(${r.substring(0,r.length-2)})`};function pM(e,t){return t?e*(1e3/t):0}const c9=5;function mM(e,t,n){const r=Math.max(t-c9,0);return pM(n-e(r),t-r)}const en={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},gv=.001;function d9({duration:e=en.duration,bounce:t=en.bounce,velocity:n=en.velocity,mass:r=en.mass}){let i,o,s=1-t;s=xo(en.minDamping,en.maxDamping,s),e=xo(en.minDuration,en.maxDuration,go(e)),s<1?(i=c=>{const f=c*s,h=f*e,p=f-n,m=U0(c,s),y=Math.exp(-h);return gv-p/m*y},o=c=>{const h=c*s*e,p=h*n+n,m=Math.pow(s,2)*Math.pow(c,2)*e,y=Math.exp(-h),x=U0(Math.pow(c,2),s);return(-i(c)+gv>0?-1:1)*((p-m)*y)/x}):(i=c=>{const f=Math.exp(-c*e),h=(c-n)*e+1;return-gv+f*h},o=c=>{const f=Math.exp(-c*e),h=(n-c)*(e*e);return f*h});const a=5/e,u=h9(i,o,a);if(e=mo(e),isNaN(u))return{stiffness:en.stiffness,damping:en.damping,duration:e};{const c=Math.pow(u,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const f9=12;function h9(e,t,n){let r=n;for(let i=1;i<f9;i++)r=r-e(r)/t(r);return r}function U0(e,t){return e*Math.sqrt(1-t*t)}const H0=2e4;function gM(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<H0;)t+=n,r=e.next(t);return t>=H0?1/0:t}const p9=["duration","bounce"],m9=["stiffness","damping","mass"];function VC(e,t){return t.some(n=>e[n]!==void 0)}function g9(e){let t={velocity:en.velocity,stiffness:en.stiffness,damping:en.damping,mass:en.mass,isResolvedFromDuration:!1,...e};if(!VC(e,m9)&&VC(e,p9))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*xo(.05,1,1-e.bounce)*Math.sqrt(i);t={...t,mass:en.mass,stiffness:i,damping:o}}else{const n=d9(e);t={...t,...n,mass:en.mass},t.isResolvedFromDuration=!0}return t}function yM(e=en.visualDuration,t=en.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:u,damping:c,mass:f,duration:h,velocity:p,isResolvedFromDuration:m}=g9({...n,velocity:-go(n.velocity||0)}),y=p||0,x=c/(2*Math.sqrt(u*f)),k=s-o,w=go(Math.sqrt(u/f)),E=Math.abs(k)<5;r||(r=E?en.restSpeed.granular:en.restSpeed.default),i||(i=E?en.restDelta.granular:en.restDelta.default);let C;if(x<1){const P=U0(w,x);C=A=>{const O=Math.exp(-x*w*A);return s-O*((y+x*w*k)/P*Math.sin(P*A)+k*Math.cos(P*A))}}else if(x===1)C=P=>s-Math.exp(-w*P)*(k+(y+w*k)*P);else{const P=w*Math.sqrt(x*x-1);C=A=>{const O=Math.exp(-x*w*A),M=Math.min(P*A,300);return s-O*((y+x*w*k)*Math.sinh(M)+P*k*Math.cosh(M))/P}}const N={calculatedDuration:m&&h||null,next:P=>{const A=C(P);if(m)a.done=P>=h;else{let O=0;x<1&&(O=P===0?mo(y):mM(C,P,A));const M=Math.abs(O)<=r,j=Math.abs(s-A)<=i;a.done=M&&j}return a.value=a.done?s:A,a},toString:()=>{const P=Math.min(gM(N),H0),A=hM(O=>N.next(P*O).value,P,30);return P+"ms "+A}};return N}function WC({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:u,restDelta:c=.5,restSpeed:f}){const h=e[0],p={done:!1,value:h},m=M=>a!==void 0&&M<a||u!==void 0&&M>u,y=M=>a===void 0?u:u===void 0||Math.abs(a-M)<Math.abs(u-M)?a:u;let x=n*t;const k=h+x,w=s===void 0?k:s(k);w!==k&&(x=w-h);const E=M=>-x*Math.exp(-M/r),C=M=>w+E(M),N=M=>{const j=E(M),R=C(M);p.done=Math.abs(j)<=c,p.value=p.done?w:R};let P,A;const O=M=>{m(p.value)&&(P=M,A=yM({keyframes:[p.value,y(p.value)],velocity:mM(C,M,p.value),damping:i,stiffness:o,restDelta:c,restSpeed:f}))};return O(0),{calculatedDuration:null,next:M=>{let j=!1;return!A&&P===void 0&&(j=!0,N(M),O(M)),P!==void 0&&M>=P?A.next(M-P):(!j&&N(M),p)}}}const y9=Td(.42,0,1,1),v9=Td(0,0,.58,1),vM=Td(.42,0,.58,1),x9=e=>Array.isArray(e)&&typeof e[0]!="number",Lb=e=>Array.isArray(e)&&typeof e[0]=="number",UC={linear:_r,easeIn:y9,easeInOut:vM,easeOut:v9,circIn:Ab,circInOut:ZR,circOut:GR,backIn:Tb,backInOut:YR,backOut:HR,anticipate:qR},HC=e=>{if(Lb(e)){z0(e.length===4);const[t,n,r,i]=e;return Td(t,n,r,i)}else if(typeof e=="string")return z0(UC[e]!==void 0),UC[e];return e},w9=(e,t)=>n=>t(e(n)),Pd=(...e)=>e.reduce(w9),Qt=(e,t,n)=>e+(t-e)*n;function yv(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function b9({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,u=2*n-a;i=yv(u,a,e+1/3),o=yv(u,a,e),s=yv(u,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function cp(e,t){return n=>n>0?t:e}const vv=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},k9=[V0,Xs,cl],S9=e=>k9.find(t=>t.test(e));function YC(e){const t=S9(e);if(!t)return!1;let n=t.parse(e);return t===cl&&(n=b9(n)),n}const qC=(e,t)=>{const n=YC(e),r=YC(t);if(!n||!r)return cp(e,t);const i={...n};return o=>(i.red=vv(n.red,r.red,o),i.green=vv(n.green,r.green,o),i.blue=vv(n.blue,r.blue,o),i.alpha=Qt(n.alpha,r.alpha,o),Xs.transform(i))},Y0=new Set(["none","hidden"]);function E9(e,t){return Y0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function C9(e,t){return n=>Qt(e,t,n)}function Fb(e){return typeof e=="number"?C9:typeof e=="string"?Pb(e)?cp:$n.test(e)?qC:T9:Array.isArray(e)?xM:typeof e=="object"?$n.test(e)?qC:_9:cp}function xM(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>Fb(o)(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function _9(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Fb(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function N9(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],a=e.indexes[s][i[s]],u=(n=e.values[a])!==null&&n!==void 0?n:0;r[o]=u,i[s]++}return r}const T9=(e,t)=>{const n=hs.createTransformer(t),r=Bc(e),i=Bc(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Y0.has(e)&&!i.values.length||Y0.has(t)&&!r.values.length?E9(e,t):Pd(xM(N9(r,i),i.values),n):cp(e,t)};function wM(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Qt(e,t,n):Fb(e)(e,t)}function A9(e,t,n){const r=[],i=n||wM,o=e.length-1;for(let s=0;s<o;s++){let a=i(e[s],e[s+1]);if(t){const u=Array.isArray(t)?t[s]||_r:t;a=Pd(u,a)}r.push(a)}return r}function P9(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(z0(o===t.length),o===1)return()=>t[0];if(o===2&&e[0]===e[1])return()=>t[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=A9(t,r,i),a=s.length,u=c=>{let f=0;if(a>1)for(;f<e.length-2&&!(c<e[f+1]);f++);const h=Rl(e[f],e[f+1],c);return s[f](h)};return n?c=>u(xo(e[0],e[o-1],c)):u}function R9(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Rl(0,t,r);e.push(Qt(n,1,i))}}function M9(e){const t=[0];return R9(t,e.length-1),t}function D9(e,t){return e.map(n=>n*t)}function O9(e,t){return e.map(()=>t||vM).splice(0,e.length-1)}function dp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=x9(r)?r.map(HC):HC(r),o={done:!1,value:t[0]},s=D9(n&&n.length===t.length?n:M9(t),e),a=P9(s,t,{ease:Array.isArray(i)?i:O9(t,i)});return{calculatedDuration:e,next:u=>(o.value=a(u),o.done=u>=e,o)}}const I9=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Vt.update(t,!0),stop:()=>fs(t),now:()=>In.isProcessing?In.timestamp:Mi.now()}},j9={decay:WC,inertia:WC,tween:dp,keyframes:dp,spring:yM},L9=e=>e/100;class zb extends fM{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:u}=this.options;u&&u()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,s=(i==null?void 0:i.KeyframeResolver)||Rb,a=(u,c)=>this.onKeyframesResolved(u,c);this.resolver=new s(o,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=this.options,a=jb(n)?n:j9[n]||dp;let u,c;a!==dp&&typeof t[0]!="number"&&(u=Pd(L9,wM(t[0],t[1])),t=[0,100]);const f=a({...this.options,keyframes:t});o==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-s})),f.calculatedDuration===null&&(f.calculatedDuration=gM(f));const{calculatedDuration:h}=f,p=h+i,m=p*(r+1)-i;return{generator:f,mirroredGenerator:c,mapPercentToKeyframes:u,calculatedDuration:h,resolvedDuration:p,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:s,mapPercentToKeyframes:a,keyframes:u,calculatedDuration:c,totalDuration:f,resolvedDuration:h}=r;if(this.startTime===null)return o.next(0);const{delay:p,repeat:m,repeatType:y,repeatDelay:x,onUpdate:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-f/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const w=this.currentTime-p*(this.speed>=0?1:-1),E=this.speed>=0?w<0:w>f;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let C=this.currentTime,N=o;if(m){const M=Math.min(this.currentTime,f)/h;let j=Math.floor(M),R=M%1;!R&&M>=1&&(R=1),R===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(y==="reverse"?(R=1-R,x&&(R-=x/h)):y==="mirror"&&(N=s)),C=xo(0,1,R)*h}const P=E?{done:!1,value:u[0]}:N.next(C);a&&(P.value=a(P.value));let{done:A}=P;!E&&c!==null&&(A=this.speed>=0?this.currentTime>=f:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return O&&i!==void 0&&(P.value=hm(u,this.options,i)),k&&k(P.value),O&&this.finish(),P}get duration(){const{resolved:t}=this;return t?go(t.calculatedDuration):0}get time(){return go(this.currentTime)}set time(t){t=mo(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=go(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=I9,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const F9=new Set(["opacity","clipPath","filter","transform"]);function $b(e){let t;return()=>(t===void 0&&(t=e()),t)}const z9={linearEasing:void 0};function $9(e,t){const n=$b(e);return()=>{var r;return(r=z9[t])!==null&&r!==void 0?r:n()}}const fp=$9(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function bM(e){return!!(typeof e=="function"&&fp()||!e||typeof e=="string"&&(e in q0||fp())||Lb(e)||Array.isArray(e)&&e.every(bM))}const dc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,q0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dc([0,.65,.55,1]),circOut:dc([.55,0,1,.45]),backIn:dc([.31,.01,.66,-.59]),backOut:dc([.33,1.53,.69,.99])};function kM(e,t){if(e)return typeof e=="function"&&fp()?hM(e,t):Lb(e)?dc(e):Array.isArray(e)?e.map(n=>kM(n,t)||q0.easeOut):q0[e]}function B9(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeInOut",times:u}={}){const c={[t]:n};u&&(c.offset=u);const f=kM(a,i);return Array.isArray(f)&&(c.easing=f),e.animate(c,{delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}function GC(e,t){e.timeline=t,e.onfinish=null}const V9=$b(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),hp=10,W9=2e4;function U9(e){return jb(e.type)||e.type==="spring"||!bM(e.ease)}function H9(e,t){const n=new zb({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&o<W9;)r=n.sample(o),i.push(r.value),o+=hp;return{times:void 0,keyframes:i,duration:o-hp,ease:"linear"}}const SM={anticipate:qR,backInOut:YR,circInOut:ZR};function Y9(e){return e in SM}class ZC extends fM{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:o}=this.options;this.resolver=new dM(o,(s,a)=>this.onKeyframesResolved(s,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:o,ease:s,type:a,motionValue:u,name:c,startTime:f}=this.options;if(!(!((r=u.owner)===null||r===void 0)&&r.current))return!1;if(typeof s=="string"&&fp()&&Y9(s)&&(s=SM[s]),U9(this.options)){const{onComplete:p,onUpdate:m,motionValue:y,element:x,...k}=this.options,w=H9(t,k);t=w.keyframes,t.length===1&&(t[1]=t[0]),i=w.duration,o=w.times,s=w.ease,a="keyframes"}const h=B9(u.owner.current,c,t,{...this.options,duration:i,times:o,ease:s});return h.startTime=f??this.calcStartTime(),this.pendingTimeline?(GC(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:p}=this.options;u.set(hm(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:i,times:o,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return go(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return go(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=mo(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return _r;const{animation:r}=n;GC(r,t)}return _r}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:s,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:f,onComplete:h,element:p,...m}=this.options,y=new zb({...m,keyframes:r,duration:i,type:o,ease:s,times:a,isGenerator:!0}),x=mo(this.time);c.setWithVelocity(y.sample(x-hp).value,y.sample(x).value,hp)}const{onStop:u}=this.options;u&&u(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:s,type:a}=t;return V9()&&r&&F9.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&o!=="mirror"&&s!==0&&a!=="inertia"}}const q9=$b(()=>window.ScrollTimeline!==void 0);class G9{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>q9()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Z9({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:u,elapsed:c,...f}){return!!Object.keys(f).length}const Bb=(e,t,n,r={},i,o)=>s=>{const a=Nb(r,e)||{},u=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-mo(u);let f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};Z9(a)||(f={...f,...w8(e,f)}),f.duration&&(f.duration=mo(f.duration)),f.repeatDelay&&(f.repeatDelay=mo(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let h=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(f.duration=0,f.delay===0&&(h=!0)),h&&!o&&t.get()!==void 0){const p=hm(f.keyframes,a);if(p!==void 0)return Vt.update(()=>{f.onUpdate(p),f.onComplete()}),new G9([])}return!o&&ZC.supports(f)?new ZC(f):new zb(f)},K9=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),X9=e=>F0(e)?e[e.length-1]||0:e;function Vb(e,t){e.indexOf(t)===-1&&e.push(t)}function Wb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Ub{constructor(){this.subscriptions=[]}add(t){return Vb(this.subscriptions,t),()=>Wb(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const KC=30,Q9=e=>!isNaN(parseFloat(e));class J9{constructor(t,n={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=Mi.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Mi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Q9(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ub);const r=this.events[t].add(n);return t==="change"?()=>{r(),Vt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Mi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>KC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,KC);return pM(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vc(e,t){return new J9(e,t)}function eW(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Vc(n))}function tW(e,t){const n=fm(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=X9(o[s]);eW(e,s,a)}}const Hb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),nW="framerAppearId",EM="data-"+Hb(nW);function CM(e){return e.props[EM]}const Vn=e=>!!(e&&e.getVelocity);function rW(e){return!!(Vn(e)&&e.add)}function G0(e,t){const n=e.getValue("willChange");if(rW(n))return n.add(t)}function iW({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function _M(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...u}=t;r&&(s=r);const c=[],f=i&&e.animationState&&e.animationState.getState()[i];for(const h in u){const p=e.getValue(h,(o=e.latestValues[h])!==null&&o!==void 0?o:null),m=u[h];if(m===void 0||f&&iW(f,h))continue;const y={delay:n,...Nb(s||{},h)};let x=!1;if(window.MotionHandoffAnimation){const w=CM(e);if(w){const E=window.MotionHandoffAnimation(w,h,Vt);E!==null&&(y.startTime=E,x=!0)}}G0(e,h),p.start(Bb(h,p,m,e.shouldReduceMotion&&xa.has(h)?{type:!1}:y,e,x));const k=p.animation;k&&c.push(k)}return a&&Promise.all(c).then(()=>{Vt.update(()=>{a&&tW(e,a)})}),c}function Z0(e,t,n={}){var r;const i=fm(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(_M(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:p}=o;return oW(e,t,f+c,h,p,n)}:()=>Promise.resolve(),{when:u}=o;if(u){const[c,f]=u==="beforeChildren"?[s,a]:[a,s];return c().then(()=>f())}else return Promise.all([s(),a(n.delay)])}function oW(e,t,n=0,r=0,i=1,o){const s=[],a=(e.variantChildren.size-1)*r,u=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(sW).forEach((c,f)=>{c.notify("AnimationStart",t),s.push(Z0(c,t,{...o,delay:n+u(f)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(s)}function sW(e,t){return e.sortNodePosition(t)}function aW(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>Z0(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=Z0(e,t,n);else{const i=typeof t=="function"?fm(e,t,n.custom):t;r=Promise.all(_M(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const lW=_b.length;function NM(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?NM(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<lW;n++){const r=_b[n],i=e.props[r];(zc(i)||i===!1)&&(t[r]=i)}return t}const uW=[...Cb].reverse(),cW=Cb.length;function dW(e){return t=>Promise.all(t.map(({animation:n,options:r})=>aW(e,n,r)))}function fW(e){let t=dW(e),n=XC(),r=!0;const i=u=>(c,f)=>{var h;const p=fm(e,f,u==="exit"?(h=e.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(p){const{transition:m,transitionEnd:y,...x}=p;c={...c,...x,...y}}return c};function o(u){t=u(e)}function s(u){const{props:c}=e,f=NM(e.parent)||{},h=[],p=new Set;let m={},y=1/0;for(let k=0;k<cW;k++){const w=uW[k],E=n[w],C=c[w]!==void 0?c[w]:f[w],N=zc(C),P=w===u?E.isActive:null;P===!1&&(y=k);let A=C===f[w]&&C!==c[w]&&N;if(A&&r&&e.manuallyAnimateOnMount&&(A=!1),E.protectedKeys={...m},!E.isActive&&P===null||!C&&!E.prevProp||dm(C)||typeof C=="boolean")continue;const O=hW(E.prevProp,C);let M=O||w===u&&E.isActive&&!A&&N||k>y&&N,j=!1;const R=Array.isArray(C)?C:[C];let $=R.reduce(i(w),{});P===!1&&($={});const{prevResolvedValues:F={}}=E,H={...F,...$},I=Z=>{M=!0,p.has(Z)&&(j=!0,p.delete(Z)),E.needsAnimating[Z]=!0;const B=e.getValue(Z);B&&(B.liveStyle=!1)};for(const Z in H){const B=$[Z],W=F[Z];if(m.hasOwnProperty(Z))continue;let L=!1;F0(B)&&F0(W)?L=!$R(B,W):L=B!==W,L?B!=null?I(Z):p.add(Z):B!==void 0&&p.has(Z)?I(Z):E.protectedKeys[Z]=!0}E.prevProp=C,E.prevResolvedValues=$,E.isActive&&(m={...m,...$}),r&&e.blockInitialAnimation&&(M=!1),M&&(!(A&&O)||j)&&h.push(...R.map(Z=>({animation:Z,options:{type:w}})))}if(p.size){const k={};p.forEach(w=>{const E=e.getBaseTarget(w),C=e.getValue(w);C&&(C.liveStyle=!0),k[w]=E??null}),h.push({animation:k})}let x=!!h.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(h):Promise.resolve()}function a(u,c){var f;if(n[u].isActive===c)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(p=>{var m;return(m=p.animationState)===null||m===void 0?void 0:m.setActive(u,c)}),n[u].isActive=c;const h=s(u);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=XC(),r=!0}}}function hW(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!$R(t,e):!1}function Us(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function XC(){return{animate:Us(!0),whileInView:Us(),whileHover:Us(),whileTap:Us(),whileDrag:Us(),whileFocus:Us(),exit:Us()}}class Ss{constructor(t){this.isMounted=!1,this.node=t}update(){}}class pW extends Ss{constructor(t){super(t),t.animationState||(t.animationState=fW(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();dm(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let mW=0;class gW extends Ss{constructor(){super(...arguments),this.id=mW++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const yW={animation:{Feature:pW},exit:{Feature:gW}},ni={x:!1,y:!1};function TM(){return ni.x||ni.y}function vW(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const o=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function AM(e,t){const n=vW(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function QC(e){return t=>{t.pointerType==="touch"||TM()||e(t)}}function xW(e,t,n={}){const[r,i,o]=AM(e,n),s=QC(a=>{const{target:u}=a,c=t(a);if(!c||!u)return;const f=QC(h=>{c(h),u.removeEventListener("pointerleave",f)});u.addEventListener("pointerleave",f,i)});return r.forEach(a=>{a.addEventListener("pointerenter",s,i)}),o}const Yb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fc=new WeakSet;function JC(e){return t=>{t.key==="Enter"&&e(t)}}function xv(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const wW=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=JC(()=>{if(fc.has(n))return;xv(n,"down");const i=JC(()=>{xv(n,"up")}),o=()=>xv(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)},bW=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kW(e){return bW.has(e.tagName)||e.tabIndex!==-1}const PM=(e,t)=>t?e===t?!0:PM(e,t.parentElement):!1;function e_(e){return Yb(e)&&!TM()}function SW(e,t,n={}){const[r,i,o]=AM(e,n),s=a=>{const u=a.currentTarget;if(!e_(a)||fc.has(u))return;fc.add(u);const c=t(a),f=(m,y)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),!(!e_(m)||!fc.has(u))&&(fc.delete(u),c&&c(m,{success:y}))},h=m=>{f(m,n.useGlobalTarget||PM(u,m.target))},p=m=>{f(m,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",p,i)};return r.forEach(a=>{kW(a)||(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,i),a.addEventListener("focus",c=>wW(c,i),i)}),o}function EW(e){return e==="x"||e==="y"?ni[e]?null:(ni[e]=!0,()=>{ni[e]=!1}):ni.x||ni.y?null:(ni.x=ni.y=!0,()=>{ni.x=ni.y=!1})}function Rd(e){return{point:{x:e.pageX,y:e.pageY}}}const CW=e=>t=>Yb(t)&&e(t,Rd(t));function Wc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sc(e,t,n,r){return Wc(e,t,CW(n),r)}const t_=(e,t)=>Math.abs(e-t);function _W(e,t){const n=t_(e.x,t.x),r=t_(e.y,t.y);return Math.sqrt(n**2+r**2)}class RM{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=bv(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=_W(h.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:y}=h,{timestamp:x}=In;this.history.push({...y,timestamp:x});const{onStart:k,onMove:w}=this.handlers;p||(k&&k(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=wv(p,this.transformPagePoint),Vt.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=bv(h.type==="pointercancel"?this.lastMoveEventInfo:wv(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(h,k),y&&y(h,k)},!Yb(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=Rd(t),a=wv(s,this.transformPagePoint),{point:u}=a,{timestamp:c}=In;this.history=[{...u,timestamp:c}];const{onSessionStart:f}=n;f&&f(t,bv(a,this.history)),this.removeListeners=Pd(Sc(this.contextWindow,"pointermove",this.handlePointerMove),Sc(this.contextWindow,"pointerup",this.handlePointerUp),Sc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fs(this.updatePoint)}}function wv(e,t){return t?{point:t(e.point)}:e}function n_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bv({point:e},t){return{point:e,delta:n_(e,MM(t)),offset:n_(e,NW(t)),velocity:TW(t,.1)}}function NW(e){return e[0]}function MM(e){return e[e.length-1]}function TW(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=MM(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>mo(t)));)n--;if(!r)return{x:0,y:0};const o=go(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function dl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const DM=1e-4,AW=1-DM,PW=1+DM,OM=.01,RW=0-OM,MW=0+OM;function Rr(e){return e.max-e.min}function DW(e,t,n){return Math.abs(e-t)<=n}function r_(e,t,n,r=.5){e.origin=r,e.originPoint=Qt(t.min,t.max,e.origin),e.scale=Rr(n)/Rr(t),e.translate=Qt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=AW&&e.scale<=PW||isNaN(e.scale))&&(e.scale=1),(e.translate>=RW&&e.translate<=MW||isNaN(e.translate))&&(e.translate=0)}function Ec(e,t,n,r){r_(e.x,t.x,n.x,r?r.originX:void 0),r_(e.y,t.y,n.y,r?r.originY:void 0)}function i_(e,t,n){e.min=n.min+t.min,e.max=e.min+Rr(t)}function OW(e,t,n){i_(e.x,t.x,n.x),i_(e.y,t.y,n.y)}function o_(e,t,n){e.min=t.min-n.min,e.max=e.min+Rr(t)}function Cc(e,t,n){o_(e.x,t.x,n.x),o_(e.y,t.y,n.y)}function IW(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Qt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Qt(n,e,r.max):Math.min(e,n)),e}function s_(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function jW(e,{top:t,left:n,bottom:r,right:i}){return{x:s_(e.x,n,i),y:s_(e.y,t,r)}}function a_(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function LW(e,t){return{x:a_(e.x,t.x),y:a_(e.y,t.y)}}function FW(e,t){let n=.5;const r=Rr(e),i=Rr(t);return i>r?n=Rl(t.min,t.max-r,e.min):r>i&&(n=Rl(e.min,e.max-i,t.min)),xo(0,1,n)}function zW(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const K0=.35;function $W(e=K0){return e===!1?e=0:e===!0&&(e=K0),{x:l_(e,"left","right"),y:l_(e,"top","bottom")}}function l_(e,t,n){return{min:u_(e,t),max:u_(e,n)}}function u_(e,t){return typeof e=="number"?e:e[t]||0}const c_=()=>({translate:0,scale:1,origin:0,originPoint:0}),fl=()=>({x:c_(),y:c_()}),d_=()=>({min:0,max:0}),on=()=>({x:d_(),y:d_()});function Br(e){return[e("x"),e("y")]}function IM({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function BW({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function VW(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function kv(e){return e===void 0||e===1}function X0({scale:e,scaleX:t,scaleY:n}){return!kv(e)||!kv(t)||!kv(n)}function Ys(e){return X0(e)||jM(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function jM(e){return f_(e.x)||f_(e.y)}function f_(e){return e&&e!=="0%"}function pp(e,t,n){const r=e-n,i=t*r;return n+i}function h_(e,t,n,r,i){return i!==void 0&&(e=pp(e,i,r)),pp(e,n,r)+t}function Q0(e,t=0,n=1,r,i){e.min=h_(e.min,t,n,r,i),e.max=h_(e.max,t,n,r,i)}function LM(e,{x:t,y:n}){Q0(e.x,t.translate,t.scale,t.originPoint),Q0(e.y,n.translate,n.scale,n.originPoint)}const p_=.999999999999,m_=1.0000000000001;function WW(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:u}=o.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&pl(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,LM(e,s)),r&&Ys(o.latestValues)&&pl(e,o.latestValues))}t.x<m_&&t.x>p_&&(t.x=1),t.y<m_&&t.y>p_&&(t.y=1)}function hl(e,t){e.min=e.min+t,e.max=e.max+t}function g_(e,t,n,r,i=.5){const o=Qt(e.min,e.max,i);Q0(e,t,n,o,r)}function pl(e,t){g_(e.x,t.x,t.scaleX,t.scale,t.originX),g_(e.y,t.y,t.scaleY,t.scale,t.originY)}function FM(e,t){return IM(VW(e.getBoundingClientRect(),t))}function UW(e,t,n){const r=FM(e,n),{scroll:i}=t;return i&&(hl(r.x,i.offset.x),hl(r.y,i.offset.y)),r}const zM=({current:e})=>e?e.ownerDocument.defaultView:null,HW=new WeakMap;class YW{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=on(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Rd(f).point)},o=(f,h)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=EW(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Br(k=>{let w=this.getAxisMotionValue(k).get()||0;if(Ri.test(w)){const{projection:E}=this.visualElement;if(E&&E.layout){const C=E.layout.layoutBox[k];C&&(w=Rr(C)*(parseFloat(w)/100))}}this.originPoint[k]=w}),y&&Vt.postRender(()=>y(f,h)),G0(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},s=(f,h)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:k}=h;if(m&&this.currentDirection===null){this.currentDirection=qW(k),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,k),this.updateAxis("y",h.point,k),this.visualElement.render(),x&&x(f,h)},a=(f,h)=>this.stop(f,h),u=()=>Br(f=>{var h;return this.getAnimationState(f)==="paused"&&((h=this.getAxisMotionValue(f).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new RM(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:zM(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Vt.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Sh(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=IW(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&dl(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=jW(i.layoutBox,n):this.constraints=!1,this.elastic=$W(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Br(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=zW(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!dl(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=UW(r,i.root,this.visualElement.getTransformPagePoint());let s=LW(i.layout.layoutBox,o);if(n){const a=n(BW(s));this.hasMutatedConstraints=!!a,a&&(s=IM(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},c=Br(f=>{if(!Sh(f,n,this.currentDirection))return;let h=u&&u[f]||{};s&&(h={min:0,max:0});const p=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:r?t[f]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(f,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return G0(this.visualElement,t),r.start(Bb(t,r,0,n,this.visualElement,!1))}stopAnimation(){Br(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Br(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Br(n=>{const{drag:r}=this.getProps();if(!Sh(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-Qt(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!dl(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Br(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const u=a.get();i[s]=FW({min:u,max:u},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Br(s=>{if(!Sh(s,t,null))return;const a=this.getAxisMotionValue(s),{min:u,max:c}=this.constraints[s];a.set(Qt(u,c,i[s]))})}addListeners(){if(!this.visualElement.current)return;HW.set(this.visualElement,this);const t=this.visualElement.current,n=Sc(t,"pointerdown",u=>{const{drag:c,dragListener:f=!0}=this.getProps();c&&f&&this.start(u)}),r=()=>{const{dragConstraints:u}=this.getProps();dl(u)&&u.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Vt.read(r);const s=Wc(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(Br(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=K0,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Sh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qW(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class GW extends Ss{constructor(t){super(t),this.removeGroupControls=_r,this.removeListeners=_r,this.controls=new YW(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_r}unmount(){this.removeGroupControls(),this.removeListeners()}}const y_=e=>(t,n)=>{e&&Vt.postRender(()=>e(t,n))};class ZW extends Ss{constructor(){super(...arguments),this.removePointerDownListener=_r}onPointerDown(t){this.session=new RM(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:y_(t),onStart:y_(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&Vt.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=Sc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const pm=S.createContext(null);function KW(){const e=S.useContext(pm);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=S.useId();S.useEffect(()=>r(i),[]);const o=S.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,o]:[!0]}const qb=S.createContext({}),$M=S.createContext({}),qh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function v_(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const tc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Qe.test(e))e=parseFloat(e);else return e;const n=v_(e,t.target.x),r=v_(e,t.target.y);return`${n}% ${r}%`}},XW={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hs.parse(e);if(i.length>5)return r;const o=hs.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,u=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=u;const c=Qt(a,u,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),o(i)}},mp={};function QW(e){Object.assign(mp,e)}const{schedule:Gb,cancel:xve}=BR(queueMicrotask,!1);class JW extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;QW(eU),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),qh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Vt.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Gb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function BM(e){const[t,n]=KW(),r=S.useContext(qb);return v.jsx(JW,{...e,layoutGroup:r,switchLayoutGroup:S.useContext($M),isPresent:t,safeToRemove:n})}const eU={borderRadius:{...tc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tc,borderTopRightRadius:tc,borderBottomLeftRadius:tc,borderBottomRightRadius:tc,boxShadow:XW},VM=["TopLeft","TopRight","BottomLeft","BottomRight"],tU=VM.length,x_=e=>typeof e=="string"?parseFloat(e):e,w_=e=>typeof e=="number"||Qe.test(e);function nU(e,t,n,r,i,o){i?(e.opacity=Qt(0,n.opacity!==void 0?n.opacity:1,rU(r)),e.opacityExit=Qt(t.opacity!==void 0?t.opacity:1,0,iU(r))):o&&(e.opacity=Qt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<tU;s++){const a=`border${VM[s]}Radius`;let u=b_(t,a),c=b_(n,a);if(u===void 0&&c===void 0)continue;u||(u=0),c||(c=0),u===0||c===0||w_(u)===w_(c)?(e[a]=Math.max(Qt(x_(u),x_(c),r),0),(Ri.test(c)||Ri.test(u))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Qt(t.rotate||0,n.rotate||0,r))}function b_(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const rU=WM(0,.5,GR),iU=WM(.5,.95,_r);function WM(e,t,n){return r=>r<e?0:r>t?1:n(Rl(e,t,r))}function k_(e,t){e.min=t.min,e.max=t.max}function $r(e,t){k_(e.x,t.x),k_(e.y,t.y)}function S_(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function E_(e,t,n,r,i){return e-=t,e=pp(e,1/n,r),i!==void 0&&(e=pp(e,1/i,r)),e}function oU(e,t=0,n=1,r=.5,i,o=e,s=e){if(Ri.test(t)&&(t=parseFloat(t),t=Qt(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Qt(o.min,o.max,r);e===o&&(a-=t),e.min=E_(e.min,t,n,a,i),e.max=E_(e.max,t,n,a,i)}function C_(e,t,[n,r,i],o,s){oU(e,t[n],t[r],t[i],t.scale,o,s)}const sU=["x","scaleX","originX"],aU=["y","scaleY","originY"];function __(e,t,n,r){C_(e.x,t,sU,n?n.x:void 0,r?r.x:void 0),C_(e.y,t,aU,n?n.y:void 0,r?r.y:void 0)}function N_(e){return e.translate===0&&e.scale===1}function UM(e){return N_(e.x)&&N_(e.y)}function T_(e,t){return e.min===t.min&&e.max===t.max}function lU(e,t){return T_(e.x,t.x)&&T_(e.y,t.y)}function A_(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function HM(e,t){return A_(e.x,t.x)&&A_(e.y,t.y)}function P_(e){return Rr(e.x)/Rr(e.y)}function R_(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class uU{constructor(){this.members=[]}add(t){Vb(this.members,t),t.scheduleRender()}remove(t){if(Wb(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function cU(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:f,rotateX:h,rotateY:p,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,u=e.y.scale*t.y;return(a!==1||u!==1)&&(r+=`scale(${a}, ${u})`),r||"none"}const dU=(e,t)=>e.depth-t.depth;class fU{constructor(){this.children=[],this.isDirty=!1}add(t){Vb(this.children,t),this.isDirty=!0}remove(t){Wb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(dU),this.isDirty=!1,this.children.forEach(t)}}function Gh(e){const t=Vn(e)?e.get():e;return K9(t)?t.toValue():t}function hU(e,t){const n=Mi.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(fs(r),e(o-t))};return Vt.read(r,!0),()=>fs(r)}function pU(e){return e instanceof SVGElement&&e.tagName!=="svg"}function mU(e,t,n){const r=Vn(e)?e:Vc(e);return r.start(Bb("",r,t,n)),r.animation}const qs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},hc=typeof window<"u"&&window.MotionDebug!==void 0,Sv=["","X","Y","Z"],gU={visibility:"hidden"},M_=1e3;let yU=0;function Ev(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function YM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=CM(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Vt,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&YM(r)}function qM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=yU++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,hc&&(qs.totalNodes=qs.resolvedTargetDeltas=qs.recalculatedProjection=0),this.nodes.forEach(wU),this.nodes.forEach(CU),this.nodes.forEach(_U),this.nodes.forEach(bU),hc&&window.MotionDebug.record(qs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new fU)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Ub),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const u=this.eventHandlers.get(s);u&&u.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=pU(s),this.instance=s;const{layoutId:u,layout:c,visualElement:f}=this.options;if(f&&!f.current&&f.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||u)&&(this.isLayoutDirty=!0),e){let h;const p=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=hU(p,250),qh.hasAnimatedSinceResize&&(qh.hasAnimatedSinceResize=!1,this.nodes.forEach(O_))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeTargetChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||RU,{onLayoutAnimationStart:k,onLayoutAnimationComplete:w}=f.getProps(),E=!this.targetLayout||!HM(this.targetLayout,y)||m,C=!p&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||C||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,C);const N={...Nb(x,"layout"),onPlay:k,onComplete:w};(f.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N)}else p||O_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,fs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(NU),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&YM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const h=this.path[f];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(D_);return}this.isUpdating||this.nodes.forEach(SU),this.isUpdating=!1,this.nodes.forEach(EU),this.nodes.forEach(vU),this.nodes.forEach(xU),this.clearAllSnapshots();const a=Mi.now();In.delta=xo(0,1e3/60,a-In.timestamp),In.timestamp=a,In.isProcessing=!0,pv.update.process(In),pv.preRender.process(In),pv.render.process(In),In.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Gb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(kU),this.sharedNodes.forEach(TU)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Vt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Vt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=on(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!UM(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,f=c!==this.prevTransformTemplateValue;s&&(a||Ys(this.latestValues)||f)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let u=this.removeElementScroll(a);return s&&(u=this.removeTransform(u)),MU(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:a}=this.options;if(!a)return on();const u=a.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(DU))){const{scroll:f}=this.root;f&&(hl(u.x,f.offset.x),hl(u.y,f.offset.y))}return u}removeElementScroll(s){var a;const u=on();if($r(u,s),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return u;for(let c=0;c<this.path.length;c++){const f=this.path[c],{scroll:h,options:p}=f;f!==this.root&&h&&p.layoutScroll&&(h.wasRoot&&$r(u,s),hl(u.x,h.offset.x),hl(u.y,h.offset.y))}return u}applyTransform(s,a=!1){const u=on();$r(u,s);for(let c=0;c<this.path.length;c++){const f=this.path[c];!a&&f.options.layoutScroll&&f.scroll&&f!==f.root&&pl(u,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),Ys(f.latestValues)&&pl(u,f.latestValues)}return Ys(this.latestValues)&&pl(u,this.latestValues),u}removeTransform(s){const a=on();$r(a,s);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!c.instance||!Ys(c.latestValues))continue;X0(c.latestValues)&&c.updateSnapshot();const f=on(),h=c.measurePageBox();$r(f,h),__(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,f)}return Ys(this.latestValues)&&__(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==In.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var a;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==u;if(!(s||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!(!this.layout||!(h||p))){if(this.resolvedRelativeTargetAt=In.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=on(),this.relativeTargetOrigin=on(),Cc(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),$r(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=on(),this.targetWithTransforms=on()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),OW(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$r(this.target,this.layout.layoutBox),LM(this.target,this.targetDelta)):$r(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=on(),this.relativeTargetOrigin=on(),Cc(this.relativeTargetOrigin,this.target,m.target),$r(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}hc&&qs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||X0(this.parent.latestValues)||jM(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const a=this.getLead(),u=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(c=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===In.timestamp&&(c=!1),c)return;const{layout:f,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||h))return;$r(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;WW(this.layoutCorrected,this.treeScale,this.path,u),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=on());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(S_(this.prevProjectionDelta.x,this.projectionDelta.x),S_(this.prevProjectionDelta.y,this.projectionDelta.y)),Ec(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!R_(this.projectionDelta.x,this.prevProjectionDelta.x)||!R_(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),hc&&qs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),s){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=fl(),this.projectionDelta=fl(),this.projectionDeltaWithTransform=fl()}setAnimationOrigin(s,a=!1){const u=this.snapshot,c=u?u.latestValues:{},f={...this.latestValues},h=fl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=on(),m=u?u.source:void 0,y=this.layout?this.layout.source:void 0,x=m!==y,k=this.getStack(),w=!k||k.members.length<=1,E=!!(x&&!w&&this.options.crossfade===!0&&!this.path.some(PU));this.animationProgress=0;let C;this.mixTargetDelta=N=>{const P=N/1e3;I_(h.x,s.x,P),I_(h.y,s.y,P),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cc(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),AU(this.relativeTarget,this.relativeTargetOrigin,p,P),C&&lU(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=on()),$r(C,this.relativeTarget)),x&&(this.animationValues=f,nU(f,c,this.latestValues,P,E,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Vt.update(()=>{qh.hasAnimatedSinceResize=!0,this.currentAnimation=mU(0,M_,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(M_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:u,layout:c,latestValues:f}=s;if(!(!a||!u||!c)){if(this!==s&&this.layout&&c&&GM(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||on();const h=Rr(this.layout.layoutBox.x);u.x.min=s.target.x.min,u.x.max=u.x.min+h;const p=Rr(this.layout.layoutBox.y);u.y.min=s.target.y.min,u.y.max=u.y.min+p}$r(a,u),pl(a,f),Ec(this.projectionDeltaWithTransform,this.layoutCorrected,a,f)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new uU),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:u}=s;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const c={};u.z&&Ev("z",s,c,this.animationValues);for(let f=0;f<Sv.length;f++)Ev(`rotate${Sv[f]}`,s,c,this.animationValues),Ev(`skew${Sv[f]}`,s,c,this.animationValues);s.render();for(const f in c)s.setStaticValue(f,c[f]),this.animationValues&&(this.animationValues[f]=c[f]);s.scheduleRender()}getProjectionStyles(s){var a,u;if(!this.instance||this.isSVG)return;if(!this.isVisible)return gU;const c={visibility:""},f=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Gh(s==null?void 0:s.pointerEvents)||"",c.transform=f?f(this.latestValues,""):"none",c;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const x={};return this.options.layoutId&&(x.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,x.pointerEvents=Gh(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!Ys(this.latestValues)&&(x.transform=f?f({},""):"none",this.hasProjected=!1),x}const p=h.animationValues||h.latestValues;this.applyTransformsToTarget(),c.transform=cU(this.projectionDeltaWithTransform,this.treeScale,p),f&&(c.transform=f(p,c.transform));const{x:m,y}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,h.animationValues?c.opacity=h===this?(u=(a=p.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&u!==void 0?u:1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:c.opacity=h===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const x in mp){if(p[x]===void 0)continue;const{correct:k,applyTo:w}=mp[x],E=c.transform==="none"?p[x]:k(p[x],h);if(w){const C=w.length;for(let N=0;N<C;N++)c[w[N]]=E}else c[x]=E}return this.options.layoutId&&(c.pointerEvents=h===this?Gh(s==null?void 0:s.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(D_),this.root.sharedNodes.clear()}}}function vU(e){e.updateLayout()}function xU(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?Br(h=>{const p=s?n.measuredBox[h]:n.layoutBox[h],m=Rr(p);p.min=r[h].min,p.max=p.min+m}):GM(o,n.layoutBox,r)&&Br(h=>{const p=s?n.measuredBox[h]:n.layoutBox[h],m=Rr(r[h]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+m)});const a=fl();Ec(a,r,n.layoutBox);const u=fl();s?Ec(u,e.applyTransform(i,!0),n.measuredBox):Ec(u,r,n.layoutBox);const c=!UM(a);let f=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:m}=h;if(p&&m){const y=on();Cc(y,n.layoutBox,p.layoutBox);const x=on();Cc(x,r,m.layoutBox),HM(y,x)||(f=!0),h.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=y,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:u,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:f})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function wU(e){hc&&qs.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function bU(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function kU(e){e.clearSnapshot()}function D_(e){e.clearMeasurements()}function SU(e){e.isLayoutDirty=!1}function EU(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function O_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function CU(e){e.resolveTargetDelta()}function _U(e){e.calcProjection()}function NU(e){e.resetSkewAndRotation()}function TU(e){e.removeLeadSnapshot()}function I_(e,t,n){e.translate=Qt(t.translate,0,n),e.scale=Qt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function j_(e,t,n,r){e.min=Qt(t.min,n.min,r),e.max=Qt(t.max,n.max,r)}function AU(e,t,n,r){j_(e.x,t.x,n.x,r),j_(e.y,t.y,n.y,r)}function PU(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const RU={duration:.45,ease:[.4,0,.1,1]},L_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),F_=L_("applewebkit/")&&!L_("chrome/")?Math.round:_r;function z_(e){e.min=F_(e.min),e.max=F_(e.max)}function MU(e){z_(e.x),z_(e.y)}function GM(e,t,n){return e==="position"||e==="preserve-aspect"&&!DW(P_(t),P_(n),.2)}function DU(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const OU=qM({attachResizeListener:(e,t)=>Wc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cv={current:void 0},ZM=qM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Cv.current){const e=new OU({});e.mount(window),e.setOptions({layoutScroll:!0}),Cv.current=e}return Cv.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),IU={pan:{Feature:ZW},drag:{Feature:GW,ProjectionNode:ZM,MeasureLayout:BM}};function $_(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&Vt.postRender(()=>o(t,Rd(t)))}class jU extends Ss{mount(){const{current:t}=this.node;t&&(this.unmount=xW(t,n=>($_(this.node,n,"Start"),r=>$_(this.node,r,"End"))))}unmount(){}}class LU extends Ss{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Pd(Wc(this.node.current,"focus",()=>this.onFocus()),Wc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function B_(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&Vt.postRender(()=>o(t,Rd(t)))}class FU extends Ss{mount(){const{current:t}=this.node;t&&(this.unmount=SW(t,n=>(B_(this.node,n,"Start"),(r,{success:i})=>B_(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const J0=new WeakMap,_v=new WeakMap,zU=e=>{const t=J0.get(e.target);t&&t(e)},$U=e=>{e.forEach(zU)};function BU({root:e,...t}){const n=e||document;_v.has(n)||_v.set(n,{});const r=_v.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($U,{root:e,...t})),r[i]}function VU(e,t,n){const r=BU(t);return J0.set(e,n),r.observe(e),()=>{J0.delete(e),r.unobserve(e)}}const WU={some:0,all:1};class UU extends Ss{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:WU[i]},a=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=c?f:h;p&&p(u)};return VU(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(HU(t,n))&&this.startObserver()}unmount(){}}function HU({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const YU={inView:{Feature:UU},tap:{Feature:FU},focus:{Feature:LU},hover:{Feature:jU}},qU={layout:{ProjectionNode:ZM,MeasureLayout:BM}},Zb=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),mm=S.createContext({}),Kb=typeof window<"u",KM=Kb?S.useLayoutEffect:S.useEffect,XM=S.createContext({strict:!1});function GU(e,t,n,r,i){var o,s;const{visualElement:a}=S.useContext(mm),u=S.useContext(XM),c=S.useContext(pm),f=S.useContext(Zb).reducedMotion,h=S.useRef(null);r=r||u.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:f}));const p=h.current,m=S.useContext($M);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&ZU(h.current,n,i,m);const y=S.useRef(!1);S.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const x=n[EM],k=S.useRef(!!x&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,x))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,x)));return KM(()=>{p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),Gb.render(p.render),k.current&&p.animationState&&p.animationState.animateChanges())}),S.useEffect(()=>{p&&(!k.current&&p.animationState&&p.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)===null||w===void 0||w.call(window,x)}),k.current=!1))}),p}function ZU(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:u,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:QM(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&dl(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:u,layoutRoot:c})}function QM(e){if(e)return e.options.allowProjection!==!1?e.projection:QM(e.parent)}function KU(e,t,n){return S.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):dl(n)&&(n.current=r))},[t])}function gm(e){return dm(e.animate)||_b.some(t=>zc(e[t]))}function JM(e){return!!(gm(e)||e.variants)}function XU(e,t){if(gm(e)){const{initial:n,animate:r}=e;return{initial:n===!1||zc(n)?n:void 0,animate:zc(r)?r:void 0}}return e.inherit!==!1?t:{}}function QU(e){const{initial:t,animate:n}=XU(e,S.useContext(mm));return S.useMemo(()=>({initial:t,animate:n}),[V_(t),V_(n)])}function V_(e){return Array.isArray(e)?e.join(" "):e}const W_={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ml={};for(const e in W_)Ml[e]={isEnabled:t=>W_[e].some(n=>!!t[n])};function JU(e){for(const t in e)Ml[t]={...Ml[t],...e[t]}}const e7=Symbol.for("motionComponentSymbol");function t7({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&JU(e);function o(a,u){let c;const f={...S.useContext(Zb),...a,layoutId:n7(a)},{isStatic:h}=f,p=QU(a),m=r(a,h);if(!h&&Kb){r7();const y=i7(f);c=y.MeasureLayout,p.visualElement=GU(i,m,f,t,y.ProjectionNode)}return v.jsxs(mm.Provider,{value:p,children:[c&&p.visualElement?v.jsx(c,{visualElement:p.visualElement,...f}):null,n(i,a,KU(m,p.visualElement,u),m,h,p.visualElement)]})}const s=S.forwardRef(o);return s[e7]=i,s}function n7({layoutId:e}){const t=S.useContext(qb).id;return t&&e!==void 0?t+"-"+e:e}function r7(e,t){S.useContext(XM).strict}function i7(e){const{drag:t,layout:n}=Ml;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const o7=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Xb(e){return typeof e!="string"||e.includes("-")?!1:!!(o7.indexOf(e)>-1||/[A-Z]/u.test(e))}function e2(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const t2=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function n2(e,t,n,r){e2(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(t2.has(i)?i:Hb(i),t.attrs[i])}function r2(e,{layout:t,layoutId:n}){return xa.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mp[e]||e==="opacity")}function Qb(e,t,n){var r;const{style:i}=e,o={};for(const s in i)(Vn(i[s])||t.style&&Vn(t.style[s])||r2(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[s]=i[s]);return o}function i2(e,t,n){const r=Qb(e,t,n);for(const i in e)if(Vn(e[i])||Vn(t[i])){const o=Nd.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function Jb(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}function s7({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const s={latestValues:a7(r,i,o,e),renderState:t()};return n&&(s.mount=a=>n(r,a,s)),s}const o2=e=>(t,n)=>{const r=S.useContext(mm),i=S.useContext(pm),o=()=>s7(e,t,r,i);return n?o():Jb(o)};function a7(e,t,n,r){const i={},o=r(e,{});for(const p in o)i[p]=Gh(o[p]);let{initial:s,animate:a}=e;const u=gm(e),c=JM(e);t&&c&&!u&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let f=n?n.initial===!1:!1;f=f||s===!1;const h=f?a:s;if(h&&typeof h!="boolean"&&!dm(h)){const p=Array.isArray(h)?h:[h];for(let m=0;m<p.length;m++){const y=Eb(e,p[m]);if(y){const{transitionEnd:x,transition:k,...w}=y;for(const E in w){let C=w[E];if(Array.isArray(C)){const N=f?C.length-1:0;C=C[N]}C!==null&&(i[E]=C)}for(const E in x)i[E]=x[E]}}}return i}const e1=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),s2=()=>({...e1(),attrs:{}}),a2=(e,t)=>t&&typeof e=="number"?t.transform(e):e,l7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},u7=Nd.length;function c7(e,t,n){let r="",i=!0;for(let o=0;o<u7;o++){const s=Nd[o],a=e[s];if(a===void 0)continue;let u=!0;if(typeof a=="number"?u=a===(s.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||n){const c=a2(a,Ob[s]);if(!u){i=!1;const f=l7[s]||s;r+=`${f}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function t1(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const u in t){const c=t[u];if(xa.has(u)){s=!0;continue}else if(JR(u)){i[u]=c;continue}else{const f=a2(c,Ob[u]);u.startsWith("origin")?(a=!0,o[u]=f):r[u]=f}}if(t.transform||(s||n?r.transform=c7(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:u="50%",originY:c="50%",originZ:f=0}=o;r.transformOrigin=`${u} ${c} ${f}`}}function U_(e,t,n){return typeof e=="string"?e:Qe.transform(t+n*e)}function d7(e,t,n){const r=U_(t,e.x,e.width),i=U_(n,e.y,e.height);return`${r} ${i}`}const f7={offset:"stroke-dashoffset",array:"stroke-dasharray"},h7={offset:"strokeDashoffset",array:"strokeDasharray"};function p7(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?f7:h7;e[o.offset]=Qe.transform(-r);const s=Qe.transform(t),a=Qe.transform(n);e[o.array]=`${s} ${a}`}function n1(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:u=0,...c},f,h){if(t1(e,c,h),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:y}=e;p.transform&&(y&&(m.transform=p.transform),delete p.transform),y&&(i!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=d7(y,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&p7(p,s,a,u,!1)}const r1=e=>typeof e=="string"&&e.toLowerCase()==="svg",m7={useVisualState:o2({scrapeMotionValuesFromProps:i2,createRenderState:s2,onMount:(e,t,{renderState:n,latestValues:r})=>{Vt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Vt.render(()=>{n1(n,r,r1(t.tagName),e.transformTemplate),n2(t,n)})}})},g7={useVisualState:o2({scrapeMotionValuesFromProps:Qb,createRenderState:e1})};function l2(e,t,n){for(const r in t)!Vn(t[r])&&!r2(r,n)&&(e[r]=t[r])}function y7({transformTemplate:e},t){return S.useMemo(()=>{const n=e1();return t1(n,t,e),Object.assign({},n.vars,n.style)},[t])}function v7(e,t){const n=e.style||{},r={};return l2(r,n,e),Object.assign(r,y7(e,t)),r}function x7(e,t){const n={},r=v7(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const w7=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function gp(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||w7.has(e)}let u2=e=>!gp(e);function b7(e){e&&(u2=t=>t.startsWith("on")?!gp(t):e(t))}try{b7(require("@emotion/is-prop-valid").default)}catch{}function k7(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(u2(i)||n===!0&&gp(i)||!t&&!gp(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function S7(e,t,n,r){const i=S.useMemo(()=>{const o=s2();return n1(o,t,r1(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};l2(o,e.style,e),i.style={...o,...i.style}}return i}function E7(e=!1){return(n,r,i,{latestValues:o},s)=>{const u=(Xb(n)?S7:x7)(r,o,s,n),c=k7(r,typeof n=="string",e),f=n!==S.Fragment?{...c,...u,ref:i}:{},{children:h}=r,p=S.useMemo(()=>Vn(h)?h.get():h,[h]);return S.createElement(n,{...f,children:p})}}function C7(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...Xb(r)?m7:g7,preloadedFeatures:e,useRender:E7(i),createVisualElement:t,Component:r};return t7(s)}}const ew={current:null},c2={current:!1};function _7(){if(c2.current=!0,!!Kb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ew.current=e.matches;e.addListener(t),t()}else ew.current=!1}function N7(e,t,n){for(const r in t){const i=t[r],o=n[r];if(Vn(i))e.addValue(r,i);else if(Vn(o))e.addValue(r,Vc(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Vc(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const H_=new WeakMap,T7=[...nM,$n,hs],A7=e=>T7.find(tM(e)),Y_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class P7{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Rb,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Mi.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Vt.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=s;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=gm(n),this.isVariantNode=JM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];u[p]!==void 0&&Vn(m)&&m.set(u[p],!1)}}mount(t){this.current=t,H_.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),c2.current||_7(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ew.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){H_.delete(this.current),this.projection&&this.projection.unmount(),fs(this.notifyUpdate),fs(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=xa.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Vt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ml){const n=Ml[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):on()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Y_.length;r++){const i=Y_[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=N7(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Vc(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(XR(i)||KR(i))?i=parseFloat(i):!A7(i)&&hs.test(n)&&(i=cM(t,n)),this.setBaseTarget(t,Vn(i)?i.get():i)),Vn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=Eb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Vn(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ub),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class d2 extends P7{constructor(){super(...arguments),this.KeyframeResolver=dM}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Vn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function R7(e){return window.getComputedStyle(e)}class M7 extends d2{constructor(){super(...arguments),this.type="html",this.renderInstance=e2}readValueFromInstance(t,n){if(xa.has(n)){const r=Ib(n);return r&&r.default||0}else{const r=R7(t),i=(JR(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return FM(t,n)}build(t,n,r){t1(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Qb(t,n,r)}}class D7 extends d2{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=on}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(xa.has(n)){const r=Ib(n);return r&&r.default||0}return n=t2.has(n)?n:Hb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return i2(t,n,r)}build(t,n,r){n1(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){n2(t,n,r,i)}mount(t){this.isSVGTag=r1(t.tagName),super.mount(t)}}const O7=(e,t)=>Xb(e)?new D7(t):new M7(t,{allowProjection:e!==S.Fragment}),I7=C7({...yW,...YU,...IU,...qU},O7),ym=m8(I7);class j7 extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function L7({children:e,isPresent:t}){const n=S.useId(),r=S.useRef(null),i=S.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=S.useContext(Zb);return S.useInsertionEffect(()=>{const{width:s,height:a,top:u,left:c}=i.current;if(t||!r.current||!s||!a)return;r.current.dataset.motionPopId=n;const f=document.createElement("style");return o&&(f.nonce=o),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(`
|
|
201
|
+
[data-motion-pop-id="${n}"] {
|
|
202
|
+
position: absolute !important;
|
|
203
|
+
width: ${s}px !important;
|
|
204
|
+
height: ${a}px !important;
|
|
205
|
+
top: ${u}px !important;
|
|
206
|
+
left: ${c}px !important;
|
|
207
|
+
}
|
|
208
|
+
`),()=>{document.head.removeChild(f)}},[t]),v.jsx(j7,{isPresent:t,childRef:r,sizeRef:i,children:S.cloneElement(e,{ref:r})})}const F7=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const a=Jb(z7),u=S.useId(),c=S.useCallback(h=>{a.set(h,!0);for(const p of a.values())if(!p)return;r&&r()},[a,r]),f=S.useMemo(()=>({id:u,initial:t,isPresent:n,custom:i,onExitComplete:c,register:h=>(a.set(h,!1),()=>a.delete(h))}),o?[Math.random(),c]:[n,c]);return S.useMemo(()=>{a.forEach((h,p)=>a.set(p,!1))},[n]),S.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=v.jsx(L7,{isPresent:n,children:e})),v.jsx(pm.Provider,{value:f,children:e})};function z7(){return new Map}const Eh=e=>e.key||"";function q_(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const f2=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:s="sync"})=>{const a=S.useMemo(()=>q_(e),[e]),u=a.map(Eh),c=S.useRef(!0),f=S.useRef(a),h=Jb(()=>new Map),[p,m]=S.useState(a),[y,x]=S.useState(a);KM(()=>{c.current=!1,f.current=a;for(let E=0;E<y.length;E++){const C=Eh(y[E]);u.includes(C)?h.delete(C):h.get(C)!==!0&&h.set(C,!1)}},[y,u.length,u.join("-")]);const k=[];if(a!==p){let E=[...a];for(let C=0;C<y.length;C++){const N=y[C],P=Eh(N);u.includes(P)||(E.splice(C,0,N),k.push(N))}s==="wait"&&k.length&&(E=k),x(q_(E)),m(a);return}const{forceRender:w}=S.useContext(qb);return v.jsx(v.Fragment,{children:y.map(E=>{const C=Eh(E),N=a===y||u.includes(C),P=()=>{if(h.has(C))h.set(C,!0);else return;let A=!0;h.forEach(O=>{O||(A=!1)}),A&&(w==null||w(),x(f.current),i&&i())};return v.jsx(F7,{isPresent:N,initial:!c.current||r?void 0:!1,custom:N?void 0:n,presenceAffectsLayout:o,mode:s,onExitComplete:N?void 0:P,children:E},C)})})};function $7(e,t,n){let r=i=>e(i,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function h2(e,t,n){let r=e.length-t.length;if(r===0)return e(...t);if(r===1)return $7(e,t,n);throw new Error("Wrong number of arguments")}function G_(...e){return h2(B7,e)}var B7=(e,t)=>e.length>=t;function Z_(...e){return h2(V7,e)}function V7(e,t){if(!G_(t,1))return{...e};if(!G_(t,2)){let{[t[0]]:r,...i}=e;return i}let n={...e};for(let r of t)delete n[r];return n}const i1=ne.forwardRef((e,t)=>e.file.type.startsWith("image/")?v.jsx(p2,{...e,ref:t}):e.file.type.startsWith("text/")||e.file.name.endsWith(".txt")||e.file.name.endsWith(".md")?v.jsx(m2,{...e,ref:t}):v.jsx(g2,{...e,ref:t}));i1.displayName="FilePreview";const p2=ne.forwardRef(({file:e,onRemove:t},n)=>v.jsxs(ym.div,{ref:n,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:!0,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[v.jsxs("div",{className:"flex w-full items-center space-x-2",children:[v.jsx("img",{alt:`Attachment ${e.name}`,className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted object-cover",src:URL.createObjectURL(e)}),v.jsx("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?v.jsx("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:v.jsx(va,{className:"h-2.5 w-2.5"})}):null]}));p2.displayName="ImageFilePreview";const m2=ne.forwardRef(({file:e,onRemove:t},n)=>{const[r,i]=ne.useState("");return S.useEffect(()=>{const o=new FileReader;o.onload=s=>{var u;const a=(u=s.target)==null?void 0:u.result;i(a.slice(0,50)+(a.length>50?"...":""))},o.readAsText(e)},[e]),v.jsxs(ym.div,{ref:n,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:!0,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[v.jsxs("div",{className:"flex w-full items-center space-x-2",children:[v.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted p-0.5",children:v.jsx("div",{className:"h-full w-full overflow-hidden text-[6px] leading-none text-muted-foreground",children:r||"Loading..."})}),v.jsx("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?v.jsx("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:v.jsx(va,{className:"h-2.5 w-2.5"})}):null]})});m2.displayName="TextFilePreview";const g2=ne.forwardRef(({file:e,onRemove:t},n)=>v.jsxs(ym.div,{ref:n,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:!0,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[v.jsxs("div",{className:"flex w-full items-center space-x-2",children:[v.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted",children:v.jsx(WB,{className:"h-6 w-6 text-foreground"})}),v.jsx("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?v.jsx("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:v.jsx(va,{className:"h-2.5 w-2.5"})}):null]}));g2.displayName="GenericFilePreview";function W7({ref:e,maxHeight:t=Number.MAX_SAFE_INTEGER,borderWidth:n=0,dependencies:r}){const i=S.useRef(null);S.useLayoutEffect(()=>{if(!e.current)return;const o=e.current,s=n*2;i.current===null&&(i.current=o.scrollHeight-s),o.style.removeProperty("height");const a=o.scrollHeight,u=Math.min(a,t),c=Math.max(u,i.current);o.style.height=`${c+s}px`},[t,e,...r])}function y2({placeholder:e="Ask AI...",className:t,onKeyDown:n,submitOnEnter:r=!0,stop:i,isGenerating:o,...s}){var w;const[a,u]=S.useState(!1),c=E=>{s.allowAttachments&&s.setFiles(C=>C===null?E:E===null?C:[...C,...E])},f=E=>{s.allowAttachments===!0&&(E.preventDefault(),u(!0))},h=E=>{s.allowAttachments===!0&&(E.preventDefault(),u(!1))},p=E=>{if(u(!1),s.allowAttachments!==!0)return;E.preventDefault();const C=E.dataTransfer;C.files.length&&c(Array.from(C.files))},m=E=>{var P;const C=(P=E.clipboardData)==null?void 0:P.items;if(!C)return;const N=Array.from(C).map(A=>A.getAsFile()).filter(A=>A!==null);s.allowAttachments&&N.length>0&&c(N)},y=E=>{var C;r&&E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),(C=E.currentTarget.form)==null||C.requestSubmit()),n==null||n(E)},x=S.useRef(null),k=s.allowAttachments&&s.files&&s.files.length>0;return W7({ref:x,maxHeight:240,borderWidth:1,dependencies:[s.value,k]}),v.jsxs("div",{className:"relative flex w-full",onDragOver:f,onDragLeave:h,onDrop:p,children:[v.jsx("textarea",{"aria-label":"Write your prompt here",placeholder:e,ref:x,onPaste:m,onKeyDown:y,className:Te("w-full grow resize-none rounded-xl border border-input bg-transparent p-3 pr-24 text-sm ring-offset-background transition-[border] placeholder:text-muted-foreground focus-visible:border-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",k&&"pb-16",t),...s.allowAttachments?Z_(s,["allowAttachments","files","setFiles"]):Z_(s,["allowAttachments"])}),s.allowAttachments&&v.jsx("div",{className:"absolute inset-x-3 bottom-0 overflow-x-scroll py-3",children:v.jsx("div",{className:"flex space-x-3",children:v.jsx(f2,{mode:"popLayout",children:(w=s.files)==null?void 0:w.map(E=>v.jsx(i1,{file:E,onRemove:()=>{s.setFiles(C=>{if(!C)return null;const N=Array.from(C).filter(P=>P!==E);return N.length===0?null:N})}},E.name+String(E.lastModified)))})})}),v.jsxs("div",{className:"absolute right-3 top-3 flex gap-2",children:[s.allowAttachments&&v.jsx(Bt,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":"Attach a file",onClick:async()=>{const E=await H7();c(E)},children:v.jsx(aR,{className:"h-4 w-4"})}),o&&i?v.jsx(Bt,{type:"button",size:"icon",className:"h-8 w-8","aria-label":"Stop generating",onClick:i,children:v.jsx(GB,{className:"h-3 w-3 animate-pulse",fill:"currentColor"})}):v.jsx(Bt,{type:"submit",size:"icon",className:"h-8 w-8 transition-opacity","aria-label":"Send message",disabled:s.value===""||o,children:v.jsx(LB,{className:"h-5 w-5"})})]}),s.allowAttachments&&v.jsx(U7,{isDragging:a})]})}y2.displayName="MessageInput";function U7({isDragging:e}){return v.jsx(f2,{children:e&&v.jsxs(ym.div,{className:"pointer-events-none absolute inset-0 flex items-center justify-center space-x-2 rounded-xl border border-dashed border-border bg-background text-sm text-muted-foreground",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},"aria-hidden":!0,children:[v.jsx(aR,{className:"h-4 w-4"}),v.jsx("span",{children:"Drop your files here to attach them."})]})})}function H7(){const e=document.createElement("input");return e.type="file",e.multiple=!0,e.accept="*/*",e.click(),new Promise(t=>{e.onchange=n=>{const r=n.currentTarget.files;if(r){t(Array.from(r));return}t(null)}})}function Y7(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const q7=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,G7=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Z7={};function K_(e,t){return(Z7.jsx?G7:q7).test(e)}const K7=/[ \t\n\f\r]/g;function X7(e){return typeof e=="object"?e.type==="text"?X_(e.value):!1:X_(e)}function X_(e){return e.replace(K7,"")===""}class Md{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Md.prototype.property={};Md.prototype.normal={};Md.prototype.space=null;function v2(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new Md(n,r,t)}function tw(e){return e.toLowerCase()}class Gr{constructor(t,n){this.property=t,this.attribute=n}}Gr.prototype.space=null;Gr.prototype.boolean=!1;Gr.prototype.booleanish=!1;Gr.prototype.overloadedBoolean=!1;Gr.prototype.number=!1;Gr.prototype.commaSeparated=!1;Gr.prototype.spaceSeparated=!1;Gr.prototype.commaOrSpaceSeparated=!1;Gr.prototype.mustUseProperty=!1;Gr.prototype.defined=!1;let Q7=0;const ot=wa(),dn=wa(),x2=wa(),Ee=wa(),Ot=wa(),bl=wa(),wr=wa();function wa(){return 2**++Q7}const nw=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:dn,commaOrSpaceSeparated:wr,commaSeparated:bl,number:Ee,overloadedBoolean:x2,spaceSeparated:Ot},Symbol.toStringTag,{value:"Module"})),Nv=Object.keys(nw);class o1 extends Gr{constructor(t,n,r,i){let o=-1;if(super(t,n),Q_(this,"space",i),typeof r=="number")for(;++o<Nv.length;){const s=Nv[o];Q_(this,Nv[o],(r&nw[s])===nw[s])}}}o1.prototype.defined=!0;function Q_(e,t,n){n&&(e[t]=n)}const J7={}.hasOwnProperty;function ou(e){const t={},n={};let r;for(r in e.properties)if(J7.call(e.properties,r)){const i=e.properties[r],o=new o1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[tw(r)]=r,n[tw(o.attribute)]=r}return new Md(t,n,e.space)}const w2=ou({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),b2=ou({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function k2(e,t){return t in e?e[t]:t}function S2(e,t){return k2(e,t.toLowerCase())}const E2=ou({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:S2,properties:{xmlns:null,xmlnsXLink:null}}),C2=ou({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:dn,ariaAutoComplete:null,ariaBusy:dn,ariaChecked:dn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:Ot,ariaCurrent:null,ariaDescribedBy:Ot,ariaDetails:null,ariaDisabled:dn,ariaDropEffect:Ot,ariaErrorMessage:null,ariaExpanded:dn,ariaFlowTo:Ot,ariaGrabbed:dn,ariaHasPopup:null,ariaHidden:dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ot,ariaLevel:Ee,ariaLive:null,ariaModal:dn,ariaMultiLine:dn,ariaMultiSelectable:dn,ariaOrientation:null,ariaOwns:Ot,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:dn,ariaReadOnly:dn,ariaRelevant:null,ariaRequired:dn,ariaRoleDescription:Ot,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:dn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null}}),eH=ou({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:S2,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bl,acceptCharset:Ot,accessKey:Ot,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Ot,autoFocus:ot,autoPlay:ot,blocking:Ot,capture:null,charSet:null,checked:ot,cite:null,className:Ot,cols:Ee,colSpan:null,content:null,contentEditable:dn,controls:ot,controlsList:Ot,coords:Ee|bl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:x2,draggable:dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Ot,height:Ee,hidden:ot,high:Ee,href:null,hrefLang:null,htmlFor:Ot,httpEquiv:Ot,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Ot,itemRef:Ot,itemScope:ot,itemType:Ot,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Ee,pattern:null,ping:Ot,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Ot,required:ot,reversed:ot,rows:Ee,rowSpan:Ee,sandbox:Ot,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:dn,width:Ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ot,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:dn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Ee,security:null,unselectable:null}}),tH=ou({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:k2,properties:{about:wr,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:Ot,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:bl,g2:bl,glyphName:bl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:wr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ee,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ot,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wr,rev:wr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wr,requiredFeatures:wr,requiredFonts:wr,requiredFormats:wr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:wr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wr,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),nH=/^data[-\w.:]+$/i,J_=/-[a-z]/g,rH=/[A-Z]/g;function iH(e,t){const n=tw(t);let r=t,i=Gr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&nH.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(J_,sH);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!J_.test(o)){let s=o.replace(rH,oH);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=o1}return new i(r,t)}function oH(e){return"-"+e.toLowerCase()}function sH(e){return e.charAt(1).toUpperCase()}const aH={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},lH=v2([b2,w2,E2,C2,eH],"html"),s1=v2([b2,w2,E2,C2,tH],"svg");function uH(e){return e.join(" ").trim()}var Ja={},Tv,eN;function cH(){if(eN)return Tv;eN=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
209
|
+
`,c="/",f="*",h="",p="comment",m="declaration";Tv=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var w=1,E=1;function C(H){var I=H.match(t);I&&(w+=I.length);var q=H.lastIndexOf(u);E=~q?H.length-q:E+H.length}function N(){var H={line:w,column:E};return function(I){return I.position=new P(H),M(),I}}function P(H){this.start=H,this.end={line:w,column:E},this.source=k.source}P.prototype.content=x;function A(H){var I=new Error(k.source+":"+w+":"+E+": "+H);if(I.reason=H,I.filename=k.source,I.line=w,I.column=E,I.source=x,!k.silent)throw I}function O(H){var I=H.exec(x);if(I){var q=I[0];return C(q),x=x.slice(q.length),I}}function M(){O(n)}function j(H){var I;for(H=H||[];I=R();)I!==!1&&H.push(I);return H}function R(){var H=N();if(!(c!=x.charAt(0)||f!=x.charAt(1))){for(var I=2;h!=x.charAt(I)&&(f!=x.charAt(I)||c!=x.charAt(I+1));)++I;if(I+=2,h===x.charAt(I-1))return A("End of comment missing");var q=x.slice(2,I-2);return E+=2,C(q),x=x.slice(I),E+=2,H({type:p,comment:q})}}function $(){var H=N(),I=O(r);if(I){if(R(),!O(i))return A("property missing ':'");var q=O(o),Y=H({type:m,property:y(I[0].replace(e,h)),value:q?y(q[0].replace(e,h)):h});return O(s),Y}}function F(){var H=[];j(H);for(var I;I=$();)I!==!1&&(H.push(I),j(H));return H}return M(),F()};function y(x){return x?x.replace(a,h):h}return Tv}var tN;function dH(){if(tN)return Ja;tN=1;var e=Ja&&Ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.default=n;var t=e(cH());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),a=typeof i=="function";return s.forEach(function(u){if(u.type==="declaration"){var c=u.property,f=u.value;a?i(c,f,u):f&&(o=o||{},o[c]=f)}}),o}return Ja}var fH=dH();const nN=Kl(fH),hH=nN.default||nN,_2=N2("end"),a1=N2("start");function N2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function pH(e){const t=a1(e),n=_2(e);if(t&&n)return{start:t,end:n}}function _c(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rN(e.position):"start"in e||"end"in e?rN(e):"line"in e||"column"in e?rw(e):""}function rw(e){return iN(e&&e.line)+":"+iN(e&&e.column)}function rN(e){return rw(e&&e.start)+"-"+rw(e&&e.end)}function iN(e){return e&&typeof e=="number"?e:1}class Yn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=_c(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Yn.prototype.file="";Yn.prototype.name="";Yn.prototype.reason="";Yn.prototype.message="";Yn.prototype.stack="";Yn.prototype.column=void 0;Yn.prototype.line=void 0;Yn.prototype.ancestors=void 0;Yn.prototype.cause=void 0;Yn.prototype.fatal=void 0;Yn.prototype.place=void 0;Yn.prototype.ruleId=void 0;Yn.prototype.source=void 0;const l1={}.hasOwnProperty,mH=new Map,gH=/[A-Z]/g,yH=/-([a-z])/g,vH=new Set(["table","tbody","thead","tfoot","tr"]),xH=new Set(["td","th"]),T2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wH(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=TH(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=NH(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?s1:lH,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=A2(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function A2(e,t,n){if(t.type==="element")return bH(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return kH(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return EH(e,t,n);if(t.type==="mdxjsEsm")return SH(e,t);if(t.type==="root")return CH(e,t,n);if(t.type==="text")return _H(e,t)}function bH(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=s1,e.schema=i),e.ancestors.push(t);const o=R2(e,t.tagName,!1),s=AH(e,t);let a=c1(e,t);return vH.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!X7(u):!0})),P2(e,s,o,t),u1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function kH(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Uc(e,t.position)}function SH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Uc(e,t.position)}function EH(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=s1,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:R2(e,t.name,!0),s=PH(e,t),a=c1(e,t);return P2(e,s,o,t),u1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function CH(e,t,n){const r={};return u1(r,c1(e,t)),e.create(t,e.Fragment,r,n)}function _H(e,t){return t.value}function P2(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function u1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function NH(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function TH(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),u=a1(r);return t(i,o,s,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function AH(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&l1.call(t.properties,i)){const o=RH(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&xH.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function PH(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Uc(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Uc(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function c1(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:mH;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const c=i.get(u)||0;s=u+"-"+c,i.set(u,c+1)}}const a=A2(e,o,s);a!==void 0&&n.push(a)}return n}function RH(e,t,n){const r=iH(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Y7(n):uH(n)),r.property==="style"){let i=typeof n=="object"?n:MH(e,String(n));return e.stylePropertyNameCase==="css"&&(i=DH(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?aH[r.property]||r.property:r.attribute,n]}}function MH(e,t){const n={};try{hH(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Yn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=T2+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(yH,IH)),n[s]=o}}function R2(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=K_(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=K_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return l1.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Uc(e)}function Uc(e,t){const n=new Yn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=T2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function DH(e){const t={};let n;for(n in e)l1.call(e,n)&&(t[OH(n)]=e[n]);return t}function OH(e){let t=e.replace(gH,jH);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function IH(e,t){return t.toUpperCase()}function jH(e){return"-"+e.toLowerCase()}const Av={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},LH={};function d1(e,t){const n=LH,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return M2(e,r,i)}function M2(e,t,n){if(FH(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return oN(e.children,t,n)}return Array.isArray(e)?oN(e,t,n):""}function oN(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=M2(e[i],t,n);return r.join("")}function FH(e){return!!(e&&typeof e=="object")}const sN=document.createElement("i");function f1(e){const t="&"+e+";";sN.innerHTML=t;const n=sN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Nr(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Vr(e,t){return e.length>0?(Nr(e,e.length,0,t),e):t}const aN={}.hasOwnProperty;function D2(e){const t={};let n=-1;for(;++n<e.length;)zH(t,e[n]);return t}function zH(e,t){let n;for(n in t){const i=(aN.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){aN.call(i,s)||(i[s]=[]);const a=o[s];$H(i[s],Array.isArray(a)?a:a?[a]:[])}}}function $H(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Nr(e,0,0,r)}function O2(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jn=Es(/[A-Za-z]/),Wn=Es(/[\dA-Za-z]/),BH=Es(/[#-'*+\--9=?A-Z^-~]/);function yp(e){return e!==null&&(e<32||e===127)}const iw=Es(/\d/),VH=Es(/[\dA-Fa-f]/),WH=Es(/[!-/:-@[-`{-~]/);function Ze(e){return e!==null&&e<-2}function Rt(e){return e!==null&&(e<0||e===32)}function mt(e){return e===-2||e===-1||e===32}const vm=Es(new RegExp("\\p{P}|\\p{S}","u")),aa=Es(/\s/);function Es(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function su(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Wn(e.charCodeAt(n+1))&&Wn(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function xt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return mt(u)?(e.enter(n),a(u)):t(u)}function a(u){return mt(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const UH={tokenize:HH};function HH(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),xt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ze(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const YH={tokenize:qH},lN={tokenize:GH};function qH(e){const t=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,u,c)(C)}return c(C)}function u(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const N=t.events.length;let P=N,A;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){A=t.events[P][1].end;break}w(r);let O=N;for(;O<t.events.length;)t.events[O][1].end={...A},O++;return Nr(t.events,P+1,0,t.events.slice(N)),t.events.length=O,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return y(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(lN,f,h)(C)}function f(C){return i&&E(),w(r),p(C)}function h(C){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(C)}function p(C){return t.containerState={},e.attempt(lN,m,y)(C)}function m(C){return r++,n.push([t.currentConstruct,t.containerState]),p(C)}function y(C){if(C===null){i&&E(),w(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(C)}function x(C){if(C===null){k(e.exit("chunkFlow"),!0),w(0),e.consume(C);return}return Ze(C)?(e.consume(C),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),x)}function k(C,N){const P=t.sliceStream(C);if(N&&P.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(P),t.parser.lazy[C.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<s&&(!i.events[A][1].end||i.events[A][1].end.offset>s))return;const O=t.events.length;let M=O,j,R;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(j){R=t.events[M][1].end;break}j=!0}for(w(r),A=O;A<t.events.length;)t.events[A][1].end={...R},A++;Nr(t.events,M+1,0,t.events.slice(O)),t.events.length=A}}function w(C){let N=n.length;for(;N-- >C;){const P=n[N];t.containerState=P[1],P[0].exit.call(t,e)}n.length=C}function E(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function GH(e,t,n){return xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Dl(e){if(e===null||Rt(e)||aa(e))return 1;if(vm(e))return 2}function xm(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ow={name:"attention",resolveAll:ZH,tokenize:KH};function ZH(e,t){let n=-1,r,i,o,s,a,u,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},p={...e[n][1].start};uN(h,-u),uN(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Vr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Vr(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=Vr(c,xm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Vr(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=Vr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Nr(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function KH(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Dl(r);let o;return s;function s(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const c=e.exit("attentionSequence"),f=Dl(u),h=!f||f===2&&i||n.includes(u),p=!i||i===2&&f||n.includes(r);return c._open=!!(o===42?h:h&&(i||!p)),c._close=!!(o===42?p:p&&(f||!h)),t(u)}}function uN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const XH={name:"autolink",tokenize:QH};function QH(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(m){return Jn(m)?(e.consume(m),s):m===64?n(m):c(m)}function s(m){return m===43||m===45||m===46||Wn(m)?(r=1,a(m)):c(m)}function a(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||Wn(m))&&r++<32?(e.consume(m),a):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||yp(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),f):BH(m)?(e.consume(m),c):n(m)}function f(m){return Wn(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,f):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||Wn(m))&&r++<63){const y=m===45?p:h;return e.consume(m),y}return n(m)}}const Dd={partial:!0,tokenize:JH};function JH(e,t,n){return r;function r(o){return mt(o)?xt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ze(o)?t(o):n(o)}}const I2={continuation:{tokenize:tY},exit:nY,name:"blockQuote",tokenize:eY};function eY(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return mt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function tY(e,t,n){const r=this;return i;function i(s){return mt(s)?xt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(I2,t,n)(s)}}function nY(e){e.exit("blockQuote")}const j2={name:"characterEscape",tokenize:rY};function rY(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return WH(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const L2={name:"characterReference",tokenize:iY};function iY(e,t,n){const r=this;let i=0,o,s;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Wn,f(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=VH,f):(e.enter("characterReferenceValue"),o=7,s=iw,f(h))}function f(h){if(h===59&&i){const p=e.exit("characterReferenceValue");return s===Wn&&!f1(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&i++<o?(e.consume(h),f):n(h)}}const cN={partial:!0,tokenize:sY},dN={concrete:!0,name:"codeFenced",tokenize:oY};function oY(e,t,n){const r=this,i={partial:!0,tokenize:P};let o=0,s=0,a;return u;function u(A){return c(A)}function c(A){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,a=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(A)}function f(A){return A===a?(s++,e.consume(A),f):s<3?n(A):(e.exit("codeFencedFenceSequence"),mt(A)?xt(e,h,"whitespace")(A):h(A))}function h(A){return A===null||Ze(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(cN,x,N)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(A))}function p(A){return A===null||Ze(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):mt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xt(e,m,"whitespace")(A)):A===96&&A===a?n(A):(e.consume(A),p)}function m(A){return A===null||Ze(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(A))}function y(A){return A===null||Ze(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===a?n(A):(e.consume(A),y)}function x(A){return e.attempt(i,N,k)(A)}function k(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),w}function w(A){return o>0&&mt(A)?xt(e,E,"linePrefix",o+1)(A):E(A)}function E(A){return A===null||Ze(A)?e.check(cN,x,N)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||Ze(A)?(e.exit("codeFlowValue"),E(A)):(e.consume(A),C)}function N(A){return e.exit("codeFenced"),t(A)}function P(A,O,M){let j=0;return R;function R(q){return A.enter("lineEnding"),A.consume(q),A.exit("lineEnding"),$}function $(q){return A.enter("codeFencedFence"),mt(q)?xt(A,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):F(q)}function F(q){return q===a?(A.enter("codeFencedFenceSequence"),H(q)):M(q)}function H(q){return q===a?(j++,A.consume(q),H):j>=s?(A.exit("codeFencedFenceSequence"),mt(q)?xt(A,I,"whitespace")(q):I(q)):M(q)}function I(q){return q===null||Ze(q)?(A.exit("codeFencedFence"),O(q)):M(q)}}}function sY(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Pv={name:"codeIndented",tokenize:lY},aY={partial:!0,tokenize:uY};function lY(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),xt(e,o,"linePrefix",5)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):Ze(c)?e.attempt(aY,s,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Ze(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),t(c)}}function uY(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):xt(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Ze(s)?i(s):n(s)}}const cY={name:"codeText",previous:fY,resolve:dY,tokenize:hY};function dY(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function fY(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function hY(e,t,n){let r=0,i,o;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(o=e.enter("codeTextSequence"),i=0,f(h)):Ze(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||Ze(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),c)}function f(h){return h===96?(e.consume(h),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",c(h))}}class pY{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&nc(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),nc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),nc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);nc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);nc(this.left,n.reverse())}}}function nc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function F2(e){const t={};let n=-1,r,i,o,s,a,u,c;const f=new pY(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,mY(f,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return Nr(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function mY(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,u=[],c={};let f,h,p=-1,m=n,y=0,x=0;const k=[x];for(;m;){for(;e.get(++i)[1]!==m;);o.push(i),m._tokenizer||(f=r.sliceStream(m),m.next||f.push(null),h&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(x=p+1,k.push(x),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):k.pop(),p=k.length;p--;){const w=a.slice(k[p],k[p+1]),E=o.pop();u.push([E,E+w.length-1]),e.splice(E,2,w)}for(u.reverse(),p=-1;++p<u.length;)c[y+u[p][0]]=y+u[p][1],y+=u[p][1]-u[p][0]-1;return c}const gY={resolve:vY,tokenize:xY},yY={partial:!0,tokenize:wY};function vY(e){return F2(e),e}function xY(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Ze(a)?e.check(yY,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function wY(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),xt(e,o,"linePrefix")}function o(s){if(s===null||Ze(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function z2(e,t,n,r,i,o,s,a,u){const c=u||Number.POSITIVE_INFINITY;let f=0;return h;function h(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),p):w===null||w===32||w===41||yp(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(w))}function p(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===62?(e.exit("chunkString"),e.exit(a),p(w)):w===null||w===60||Ze(w)?n(w):(e.consume(w),w===92?y:m)}function y(w){return w===60||w===62||w===92?(e.consume(w),m):m(w)}function x(w){return!f&&(w===null||w===41||Rt(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):f<c&&w===40?(e.consume(w),f++,x):w===41?(e.consume(w),f--,x):w===null||w===32||w===40||yp(w)?n(w):(e.consume(w),w===92?k:x)}function k(w){return w===40||w===41||w===92?(e.consume(w),x):x(w)}}function $2(e,t,n,r,i,o){const s=this;let a=0,u;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(o),f}function f(m){return a>999||m===null||m===91||m===93&&!u||m===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):Ze(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||Ze(m)||a++>999?(e.exit("chunkString"),f(m)):(e.consume(m),u||(u=!mt(m)),m===92?p:h)}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,h):h(m)}}function B2(e,t,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),s=p===40?41:p,u):n(p)}function u(p){return p===s?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===s?(e.exit(o),u(s)):p===null?n(p):Ze(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),xt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===s||p===null||Ze(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?h:f)}function h(p){return p===s||p===92?(e.consume(p),f):f(p)}}function Nc(e,t){let n;return r;function r(i){return Ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):mt(i)?xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bY={name:"definition",tokenize:SY},kY={partial:!0,tokenize:EY};function SY(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),s(m)}function s(m){return $2.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return Rt(m)?Nc(e,c)(m):c(m)}function c(m){return z2(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(kY,h,h)(m)}function h(m){return mt(m)?xt(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Ze(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function EY(e,t,n){return r;function r(a){return Rt(a)?Nc(e,i)(a):n(a)}function i(a){return B2(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return mt(a)?xt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Ze(a)?t(a):n(a)}}const CY={name:"hardBreakEscape",tokenize:_Y};function _Y(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const NY={name:"headingAtx",resolve:TY,tokenize:AY};function TY(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Nr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function AY(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Rt(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||Ze(f)?(e.exit("atxHeading"),t(f)):mt(f)?xt(e,a,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function c(f){return f===null||f===35||Rt(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),c)}}const PY=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fN=["pre","script","style","textarea"],RY={concrete:!0,name:"htmlFlow",resolveTo:OY,tokenize:IY},MY={partial:!0,tokenize:LY},DY={partial:!0,tokenize:jY};function OY(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function IY(e,t,n){const r=this;let i,o,s,a,u;return c;function c(D){return f(D)}function f(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),h}function h(D){return D===33?(e.consume(D),p):D===47?(e.consume(D),o=!0,x):D===63?(e.consume(D),i=3,r.interrupt?t:L):Jn(D)?(e.consume(D),s=String.fromCharCode(D),k):n(D)}function p(D){return D===45?(e.consume(D),i=2,m):D===91?(e.consume(D),i=5,a=0,y):Jn(D)?(e.consume(D),i=4,r.interrupt?t:L):n(D)}function m(D){return D===45?(e.consume(D),r.interrupt?t:L):n(D)}function y(D){const G="CDATA[";return D===G.charCodeAt(a++)?(e.consume(D),a===G.length?r.interrupt?t:F:y):n(D)}function x(D){return Jn(D)?(e.consume(D),s=String.fromCharCode(D),k):n(D)}function k(D){if(D===null||D===47||D===62||Rt(D)){const G=D===47,K=s.toLowerCase();return!G&&!o&&fN.includes(K)?(i=1,r.interrupt?t(D):F(D)):PY.includes(s.toLowerCase())?(i=6,G?(e.consume(D),w):r.interrupt?t(D):F(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):o?E(D):C(D))}return D===45||Wn(D)?(e.consume(D),s+=String.fromCharCode(D),k):n(D)}function w(D){return D===62?(e.consume(D),r.interrupt?t:F):n(D)}function E(D){return mt(D)?(e.consume(D),E):R(D)}function C(D){return D===47?(e.consume(D),R):D===58||D===95||Jn(D)?(e.consume(D),N):mt(D)?(e.consume(D),C):R(D)}function N(D){return D===45||D===46||D===58||D===95||Wn(D)?(e.consume(D),N):P(D)}function P(D){return D===61?(e.consume(D),A):mt(D)?(e.consume(D),P):C(D)}function A(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),u=D,O):mt(D)?(e.consume(D),A):M(D)}function O(D){return D===u?(e.consume(D),u=null,j):D===null||Ze(D)?n(D):(e.consume(D),O)}function M(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Rt(D)?P(D):(e.consume(D),M)}function j(D){return D===47||D===62||mt(D)?C(D):n(D)}function R(D){return D===62?(e.consume(D),$):n(D)}function $(D){return D===null||Ze(D)?F(D):mt(D)?(e.consume(D),$):n(D)}function F(D){return D===45&&i===2?(e.consume(D),Y):D===60&&i===1?(e.consume(D),Z):D===62&&i===4?(e.consume(D),U):D===63&&i===3?(e.consume(D),L):D===93&&i===5?(e.consume(D),W):Ze(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(MY,V,H)(D)):D===null||Ze(D)?(e.exit("htmlFlowData"),H(D)):(e.consume(D),F)}function H(D){return e.check(DY,I,V)(D)}function I(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),q}function q(D){return D===null||Ze(D)?H(D):(e.enter("htmlFlowData"),F(D))}function Y(D){return D===45?(e.consume(D),L):F(D)}function Z(D){return D===47?(e.consume(D),s="",B):F(D)}function B(D){if(D===62){const G=s.toLowerCase();return fN.includes(G)?(e.consume(D),U):F(D)}return Jn(D)&&s.length<8?(e.consume(D),s+=String.fromCharCode(D),B):F(D)}function W(D){return D===93?(e.consume(D),L):F(D)}function L(D){return D===62?(e.consume(D),U):D===45&&i===2?(e.consume(D),L):F(D)}function U(D){return D===null||Ze(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),U)}function V(D){return e.exit("htmlFlow"),t(D)}}function jY(e,t,n){const r=this;return i;function i(s){return Ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function LY(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Dd,t,n)}}const FY={name:"htmlText",tokenize:zY};function zY(e,t,n){const r=this;let i,o,s;return a;function a(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),u}function u(L){return L===33?(e.consume(L),c):L===47?(e.consume(L),P):L===63?(e.consume(L),C):Jn(L)?(e.consume(L),M):n(L)}function c(L){return L===45?(e.consume(L),f):L===91?(e.consume(L),o=0,y):Jn(L)?(e.consume(L),E):n(L)}function f(L){return L===45?(e.consume(L),m):n(L)}function h(L){return L===null?n(L):L===45?(e.consume(L),p):Ze(L)?(s=h,Z(L)):(e.consume(L),h)}function p(L){return L===45?(e.consume(L),m):h(L)}function m(L){return L===62?Y(L):L===45?p(L):h(L)}function y(L){const U="CDATA[";return L===U.charCodeAt(o++)?(e.consume(L),o===U.length?x:y):n(L)}function x(L){return L===null?n(L):L===93?(e.consume(L),k):Ze(L)?(s=x,Z(L)):(e.consume(L),x)}function k(L){return L===93?(e.consume(L),w):x(L)}function w(L){return L===62?Y(L):L===93?(e.consume(L),w):x(L)}function E(L){return L===null||L===62?Y(L):Ze(L)?(s=E,Z(L)):(e.consume(L),E)}function C(L){return L===null?n(L):L===63?(e.consume(L),N):Ze(L)?(s=C,Z(L)):(e.consume(L),C)}function N(L){return L===62?Y(L):C(L)}function P(L){return Jn(L)?(e.consume(L),A):n(L)}function A(L){return L===45||Wn(L)?(e.consume(L),A):O(L)}function O(L){return Ze(L)?(s=O,Z(L)):mt(L)?(e.consume(L),O):Y(L)}function M(L){return L===45||Wn(L)?(e.consume(L),M):L===47||L===62||Rt(L)?j(L):n(L)}function j(L){return L===47?(e.consume(L),Y):L===58||L===95||Jn(L)?(e.consume(L),R):Ze(L)?(s=j,Z(L)):mt(L)?(e.consume(L),j):Y(L)}function R(L){return L===45||L===46||L===58||L===95||Wn(L)?(e.consume(L),R):$(L)}function $(L){return L===61?(e.consume(L),F):Ze(L)?(s=$,Z(L)):mt(L)?(e.consume(L),$):j(L)}function F(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),i=L,H):Ze(L)?(s=F,Z(L)):mt(L)?(e.consume(L),F):(e.consume(L),I)}function H(L){return L===i?(e.consume(L),i=void 0,q):L===null?n(L):Ze(L)?(s=H,Z(L)):(e.consume(L),H)}function I(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Rt(L)?j(L):(e.consume(L),I)}function q(L){return L===47||L===62||Rt(L)?j(L):n(L)}function Y(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function Z(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),B}function B(L){return mt(L)?xt(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):W(L)}function W(L){return e.enter("htmlTextData"),s(L)}}const h1={name:"labelEnd",resolveAll:WY,resolveTo:UY,tokenize:HY},$Y={tokenize:YY},BY={tokenize:qY},VY={tokenize:GY};function WY(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Nr(e,0,e.length,n),e}function UY(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,t],["enter",c,t]],a=Vr(a,e.slice(o+1,o+r+3)),a=Vr(a,[["enter",f,t]]),a=Vr(a,xm(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Vr(a,[["exit",f,t],e[s-2],e[s-1],["exit",c,t]]),a=Vr(a,e.slice(s+1)),a=Vr(a,[["exit",u,t]]),Nr(e,o,e.length,a),e}function HY(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?h(p):(s=r.parser.defined.includes(ui(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt($Y,f,s?f:h)(p):p===91?e.attempt(BY,f,s?c:h)(p):s?f(p):h(p)}function c(p){return e.attempt(VY,f,h)(p)}function f(p){return t(p)}function h(p){return o._balanced=!0,n(p)}}function YY(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Rt(h)?Nc(e,o)(h):o(h)}function o(h){return h===41?f(h):z2(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return Rt(h)?Nc(e,u)(h):f(h)}function a(h){return n(h)}function u(h){return h===34||h===39||h===40?B2(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):f(h)}function c(h){return Rt(h)?Nc(e,f)(h):f(h)}function f(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function qY(e,t,n){const r=this;return i;function i(a){return $2.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function GY(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const ZY={name:"labelStartImage",resolveAll:h1.resolveAll,tokenize:KY};function KY(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const XY={name:"labelStartLink",resolveAll:h1.resolveAll,tokenize:QY};function QY(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Rv={name:"lineEnding",tokenize:JY};function JY(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),xt(e,t,"linePrefix")}}const Zh={name:"thematicBreak",tokenize:eq};function eq(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||Ze(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),mt(c)?xt(e,a,"whitespace")(c):a(c))}}const lr={continuation:{tokenize:iq},exit:sq,name:"list",tokenize:rq},tq={partial:!0,tokenize:aq},nq={partial:!0,tokenize:oq};function rq(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(m){const y=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:iw(m)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Zh,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return iw(m)&&++s<10?(e.consume(m),u):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Dd,r.interrupt?n:f,e.attempt(tq,p,h))}function f(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function h(m){return mt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function iq(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Dd,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!mt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(nq,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,xt(e,e.attempt(lr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function oq(e,t,n){const r=this;return xt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function sq(e){e.exit(this.containerState.type)}function aq(e,t,n){const r=this;return xt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!mt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const hN={name:"setextUnderline",resolveTo:lq,tokenize:uq};function lq(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function uq(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),mt(c)?xt(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||Ze(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const cq={tokenize:dq};function dq(e){const t=this,n=e.attempt(Dd,r,e.attempt(this.parser.constructs.flowInitial,i,xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(gY,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const fq={resolveAll:W2()},hq=V2("string"),pq=V2("text");function V2(e){return{resolveAll:W2(e==="text"?mq:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return c(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function c(f){if(f===null)return!0;const h=i[f];let p=-1;if(h)for(;++p<h.length;){const m=h[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function W2(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function mq(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,u;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)u=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const gq={42:lr,43:lr,45:lr,48:lr,49:lr,50:lr,51:lr,52:lr,53:lr,54:lr,55:lr,56:lr,57:lr,62:I2},yq={91:bY},vq={[-2]:Pv,[-1]:Pv,32:Pv},xq={35:NY,42:Zh,45:[hN,Zh],60:RY,61:hN,95:Zh,96:dN,126:dN},wq={38:L2,92:j2},bq={[-5]:Rv,[-4]:Rv,[-3]:Rv,33:ZY,38:L2,42:ow,60:[XH,FY],91:XY,92:[CY,j2],93:h1,95:ow,96:cY},kq={null:[ow,fq]},Sq={null:[42,95]},Eq={null:[]},Cq=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Sq,contentInitial:yq,disable:Eq,document:gq,flow:xq,flowInitial:vq,insideSpan:kq,string:wq,text:bq},Symbol.toStringTag,{value:"Module"}));function _q(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const u={attempt:O(P),check:O(A),consume:E,enter:C,exit:N,interrupt:O(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:x,events:[],now:y,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:h};let f=t.tokenize.call(c,u);return t.resolveAll&&o.push(t),c;function h($){return s=Vr(s,$),k(),s[s.length-1]!==null?[]:(M(t,0),c.events=xm(o,c.events,c),c.events)}function p($,F){return Tq(m($),F)}function m($){return Nq(s,$)}function y(){const{_bufferIndex:$,_index:F,line:H,column:I,offset:q}=r;return{_bufferIndex:$,_index:F,line:H,column:I,offset:q}}function x($){i[$.line]=$.column,R()}function k(){let $;for(;r._index<s.length;){const F=s[r._index];if(typeof F=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<F.length;)w(F.charCodeAt(r._bufferIndex));else w(F)}}function w($){f=f($)}function E($){Ze($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,R()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=$}function C($,F){const H=F||{};return H.type=$,H.start=y(),c.events.push(["enter",H,c]),a.push(H),H}function N($){const F=a.pop();return F.end=y(),c.events.push(["exit",F,c]),F}function P($,F){M($,F.from)}function A($,F){F.restore()}function O($,F){return H;function H(I,q,Y){let Z,B,W,L;return Array.isArray(I)?V(I):"tokenize"in I?V([I]):U(I);function U(J){return ee;function ee(re){const ue=re!==null&&J[re],he=re!==null&&J.null,ke=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(he)?he:he?[he]:[]];return V(ke)(re)}}function V(J){return Z=J,B=0,J.length===0?Y:D(J[B])}function D(J){return ee;function ee(re){return L=j(),W=J,J.partial||(c.currentConstruct=J),J.name&&c.parser.constructs.disable.null.includes(J.name)?K():J.tokenize.call(F?Object.assign(Object.create(c),F):c,u,G,K)(re)}}function G(J){return $(W,L),q}function K(J){return L.restore(),++B<Z.length?D(Z[B]):Y}}}function M($,F){$.resolveAll&&!o.includes($)&&o.push($),$.resolve&&Nr(c.events,F,c.events.length-F,$.resolve(c.events.slice(F),c)),$.resolveTo&&(c.events=$.resolveTo(c.events,c))}function j(){const $=y(),F=c.previous,H=c.currentConstruct,I=c.events.length,q=Array.from(a);return{from:I,restore:Y};function Y(){r=$,c.previous=F,c.currentConstruct=H,c.events.length=I,a=q,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Nq(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Tq(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
210
|
+
`;break}case-3:{s=`\r
|
|
211
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Aq(e){const r={constructs:D2([Cq,...(e||{}).extensions||[]]),content:i(UH),defined:[],document:i(YH),flow:i(cq),lazy:{},string:i(hq),text:i(pq)};return r;function i(o){return s;function s(a){return _q(r,o,a)}}}function Pq(e){for(;!F2(e););return e}const pN=/[\0\t\n\r]/g;function Rq(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const u=[];let c,f,h,p,m;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(pN.lastIndex=h,c=pN.exec(o),p=c&&c.index!==void 0?c.index:o.length,m=o.charCodeAt(p),!c){t=o.slice(h);break}if(m===10&&h===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<p&&(u.push(o.slice(h,p)),e+=p-h),m){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const Mq=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dq(e){return e.replace(Mq,Oq)}function Oq(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return O2(n.slice(o?2:1),o?16:10)}return f1(n)||e}const U2={}.hasOwnProperty;function Iq(e,t,n){return typeof t!="string"&&(n=t,t=void 0),jq(n)(Pq(Aq(n).document().write(Rq()(e,t,!0))))}function jq(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(oe),autolinkProtocol:j,autolinkEmail:j,atxHeading:o($e),blockQuote:o(he),characterEscape:j,characterReference:j,codeFenced:o(ke),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ke,s),codeText:o(fe,s),codeTextData:j,data:j,codeFlowValue:j,definition:o(ve),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Me),hardBreakEscape:o(ct),hardBreakTrailing:o(ct),htmlFlow:o(_t,s),htmlFlowData:j,htmlText:o(_t,s),htmlTextData:j,image:o(Q),label:s,link:o(oe),listItem:o(Ce),listItemValue:p,listOrdered:o(ae,h),listUnordered:o(ae),paragraph:o(we),reference:D,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o($e),strong:o(me),thematicBreak:o(Fe)},exit:{atxHeading:u(),atxHeadingSequence:P,autolink:u(),autolinkEmail:ue,autolinkProtocol:re,blockQuote:u(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:J,characterReference:ee,codeFenced:u(k),codeFencedFence:x,codeFencedFenceInfo:m,codeFencedFenceMeta:y,codeFlowValue:R,codeIndented:u(w),codeText:u(q),codeTextData:R,data:R,definition:u(),definitionDestinationString:N,definitionLabelString:E,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(H),htmlFlowData:R,htmlText:u(I),htmlTextData:R,image:u(Z),label:W,labelText:B,lineEnding:$,link:u(Y),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:G,resourceDestinationString:L,resourceTitleString:U,resource:V,setextHeading:u(M),setextHeadingLineSequence:O,setextHeadingText:A,strong:u(),thematicBreak:u()}};H2(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let pe={type:"root",children:[]};const Ie={stack:[pe],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:f,data:n},Ke=[];let tt=-1;for(;++tt<ce.length;)if(ce[tt][1].type==="listOrdered"||ce[tt][1].type==="listUnordered")if(ce[tt][0]==="enter")Ke.push(tt);else{const At=Ke.pop();tt=i(ce,At,tt)}for(tt=-1;++tt<ce.length;){const At=t[ce[tt][0]];U2.call(At,ce[tt][1].type)&&At[ce[tt][1].type].call(Object.assign({sliceSerialize:ce[tt][2].sliceSerialize},Ie),ce[tt][1])}if(Ie.tokenStack.length>0){const At=Ie.tokenStack[Ie.tokenStack.length-1];(At[1]||mN).call(Ie,void 0,At[0])}for(pe.position={start:Jo(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Jo(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},tt=-1;++tt<t.transforms.length;)pe=t.transforms[tt](pe)||pe;return pe}function i(ce,pe,Ie){let Ke=pe-1,tt=-1,At=!1,He,it,at,Wt;for(;++Ke<=Ie;){const yt=ce[Ke];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?tt++:tt--,Wt=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&(He&&!Wt&&!tt&&!at&&(at=Ke),Wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Wt=void 0}if(!tt&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||tt===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if(He){let yn=Ke;for(it=void 0;yn--;){const gt=ce[yn];if(gt[1].type==="lineEnding"||gt[1].type==="lineEndingBlank"){if(gt[0]==="exit")continue;it&&(ce[it][1].type="lineEndingBlank",At=!0),gt[1].type="lineEnding",it=yn}else if(!(gt[1].type==="linePrefix"||gt[1].type==="blockQuotePrefix"||gt[1].type==="blockQuotePrefixWhitespace"||gt[1].type==="blockQuoteMarker"||gt[1].type==="listItemIndent"))break}at&&(!it||at<it)&&(He._spread=!0),He.end=Object.assign({},it?ce[it][1].start:yt[1].end),ce.splice(it||Ke,0,["exit",He,yt[2]]),Ke++,Ie++}if(yt[1].type==="listItemPrefix"){const yn={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};He=yn,ce.splice(Ke,0,["enter",yn,yt[2]]),Ke++,Ie++,at=void 0,Wt=!0}}}return ce[pe][1]._spread=At,Ie}function o(ce,pe){return Ie;function Ie(Ke){a.call(this,ce(Ke),Ke),pe&&pe.call(this,Ke)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(ce,pe,Ie){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([pe,Ie||void 0]),ce.position={start:Jo(pe.start),end:void 0}}function u(ce){return pe;function pe(Ie){ce&&ce.call(this,Ie),c.call(this,Ie)}}function c(ce,pe){const Ie=this.stack.pop(),Ke=this.tokenStack.pop();if(Ke)Ke[0].type!==ce.type&&(pe?pe.call(this,ce,Ke[0]):(Ke[1]||mN).call(this,ce,Ke[0]));else throw new Error("Cannot close `"+ce.type+"` ("+_c({start:ce.start,end:ce.end})+"): it’s not open");Ie.position.end=Jo(ce.end)}function f(){return d1(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(ce){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function m(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=ce}function y(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=ce}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce.replace(/(\r?\n|\r)$/g,"")}function E(ce){const pe=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=pe,Ie.identifier=ui(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ce}function N(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ce}function P(ce){const pe=this.stack[this.stack.length-1];if(!pe.depth){const Ie=this.sliceSerialize(ce).length;pe.depth=Ie}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function O(ce){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function j(ce){const Ie=this.stack[this.stack.length-1].children;let Ke=Ie[Ie.length-1];(!Ke||Ke.type!=="text")&&(Ke=Ae(),Ke.position={start:Jo(ce.start),end:void 0},Ie.push(Ke)),this.stack.push(Ke)}function R(ce){const pe=this.stack.pop();pe.value+=this.sliceSerialize(ce),pe.position.end=Jo(ce.end)}function $(ce){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ie=pe.children[pe.children.length-1];Ie.position.end=Jo(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(j.call(this,ce),R.call(this,ce))}function F(){this.data.atHardBreak=!0}function H(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce}function I(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce}function q(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce}function Y(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=pe,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function Z(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=pe,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function B(ce){const pe=this.sliceSerialize(ce),Ie=this.stack[this.stack.length-2];Ie.label=Dq(pe),Ie.identifier=ui(pe).toLowerCase()}function W(){const ce=this.stack[this.stack.length-1],pe=this.resume(),Ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ie.type==="link"){const Ke=ce.children;Ie.children=Ke}else Ie.alt=pe}function L(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ce}function U(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ce}function V(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function G(ce){const pe=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=pe,Ie.identifier=ui(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function K(ce){this.data.characterReferenceType=ce.type}function J(ce){const pe=this.sliceSerialize(ce),Ie=this.data.characterReferenceType;let Ke;Ie?(Ke=O2(pe,Ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ke=f1(pe);const tt=this.stack[this.stack.length-1];tt.value+=Ke}function ee(ce){const pe=this.stack.pop();pe.position.end=Jo(ce.end)}function re(ce){R.call(this,ce);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(ce)}function ue(ce){R.call(this,ce);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(ce)}function he(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function fe(){return{type:"inlineCode",value:""}}function ve(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Me(){return{type:"emphasis",children:[]}}function $e(){return{type:"heading",depth:0,children:[]}}function ct(){return{type:"break"}}function _t(){return{type:"html",value:""}}function Q(){return{type:"image",title:null,url:"",alt:null}}function oe(){return{type:"link",title:null,url:"",children:[]}}function ae(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Ce(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function we(){return{type:"paragraph",children:[]}}function me(){return{type:"strong",children:[]}}function Ae(){return{type:"text",value:""}}function Fe(){return{type:"thematicBreak"}}}function Jo(e){return{line:e.line,column:e.column,offset:e.offset}}function H2(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?H2(e,r):Lq(e,r)}}function Lq(e,t){let n;for(n in t)if(U2.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function mN(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_c({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_c({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_c({start:t.start,end:t.end})+") is still open")}function Fq(e){const t=this;t.parser=n;function n(r){return Iq(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zq(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function $q(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
212
|
+
`}]}function Bq(e,t){const n=t.value?t.value+`
|
|
213
|
+
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Vq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=su(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function Hq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Y2(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function qq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Y2(e,t);const i={src:su(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Gq(e,t){const n={src:su(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Zq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Kq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Y2(e,t);const i={href:su(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Xq(e,t){const n={href:su(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Qq(e,t,n){const r=e.all(t),i=n?Jq(n):q2(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let h;f&&f.type==="element"&&f.tagName==="p"?h=f:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
|
|
214
|
+
`}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
215
|
+
`});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function Jq(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=q2(n[r])}return t}function q2(e){const t=e.spread;return t??e.children.length>1}function eG(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function tG(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nG(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function rG(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iG(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=a1(t.children[1]),u=_2(t.children[t.children.length-1]);a&&u&&(s.position={start:a,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function oG(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let u=-1;const c=[];for(;++u<a;){const h=t.children[u],p={},m=s?s[u]:void 0;m&&(p.align=m);let y={type:"element",tagName:o,properties:p,children:[]};h&&(y.children=e.all(h),e.patch(h,y),y=e.applyData(h,y)),c.push(y)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function sG(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const gN=9,yN=32;function aG(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(vN(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(vN(t.slice(i),i>0,!1)),o.join("")}function vN(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===gN||o===yN;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===gN||o===yN;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function lG(e,t){const n={type:"text",value:aG(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function uG(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cG={blockquote:zq,break:$q,code:Bq,delete:Vq,emphasis:Wq,footnoteReference:Uq,heading:Hq,html:Yq,imageReference:qq,image:Gq,inlineCode:Zq,linkReference:Kq,link:Xq,listItem:Qq,list:eG,paragraph:tG,root:nG,strong:rG,table:iG,tableCell:sG,tableRow:oG,text:lG,thematicBreak:uG,toml:Ch,yaml:Ch,definition:Ch,footnoteDefinition:Ch};function Ch(){}const G2=-1,wm=0,vp=1,xp=2,p1=3,m1=4,g1=5,y1=6,Z2=7,K2=8,xN=typeof self=="object"?self:globalThis,dG=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case wm:case G2:return n(s,i);case vp:{const a=n([],i);for(const u of s)a.push(r(u));return a}case xp:{const a=n({},i);for(const[u,c]of s)a[r(u)]=r(c);return a}case p1:return n(new Date(s),i);case m1:{const{source:a,flags:u}=s;return n(new RegExp(a,u),i)}case g1:{const a=n(new Map,i);for(const[u,c]of s)a.set(r(u),r(c));return a}case y1:{const a=n(new Set,i);for(const u of s)a.add(r(u));return a}case Z2:{const{name:a,message:u}=s;return n(new xN[a](u),i)}case K2:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new xN[o](s),i)};return r},wN=e=>dG(new Map,e)(0),el="",{toString:fG}={},{keys:hG}=Object,rc=e=>{const t=typeof e;if(t!=="object"||!e)return[wm,t];const n=fG.call(e).slice(8,-1);switch(n){case"Array":return[vp,el];case"Object":return[xp,el];case"Date":return[p1,el];case"RegExp":return[m1,el];case"Map":return[g1,el];case"Set":return[y1,el]}return n.includes("Array")?[vp,n]:n.includes("Error")?[Z2,n]:[xp,n]},_h=([e,t])=>e===wm&&(t==="function"||t==="symbol"),pG=(e,t,n,r)=>{const i=(s,a)=>{const u=r.push(s)-1;return n.set(a,u),u},o=s=>{if(n.has(s))return n.get(s);let[a,u]=rc(s);switch(a){case wm:{let f=s;switch(u){case"bigint":a=K2,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([G2],s)}return i([a,f],s)}case vp:{if(u)return i([u,[...s]],s);const f=[],h=i([a,f],s);for(const p of s)f.push(o(p));return h}case xp:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],h=i([a,f],s);for(const p of hG(s))(e||!_h(rc(s[p])))&&f.push([o(p),o(s[p])]);return h}case p1:return i([a,s.toISOString()],s);case m1:{const{source:f,flags:h}=s;return i([a,{source:f,flags:h}],s)}case g1:{const f=[],h=i([a,f],s);for(const[p,m]of s)(e||!(_h(rc(p))||_h(rc(m))))&&f.push([o(p),o(m)]);return h}case y1:{const f=[],h=i([a,f],s);for(const p of s)(e||!_h(rc(p)))&&f.push(o(p));return h}}const{message:c}=s;return i([a,{name:u,message:c}],s)};return o},bN=(e,{json:t,lossy:n}={})=>{const r=[];return pG(!(t||n),!!t,new Map,r)(e),r},wp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?wN(bN(e,t)):structuredClone(e):(e,t)=>wN(bN(e,t));function mG(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function gG(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function yG(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||mG,r=e.options.footnoteBackLabel||gG,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const f=e.all(c),h=String(c.identifier).toUpperCase(),p=su(h.toLowerCase());let m=0;const y=[],x=e.footnoteCounts.get(h);for(;x!==void 0&&++m<=x;){y.length>0&&y.push({type:"text",value:" "});let E=typeof n=="string"?n:n(u,m);typeof E=="string"&&(E={type:"text",value:E}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const k=f[f.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const E=k.children[k.children.length-1];E&&E.type==="text"?E.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...y)}else f.push(...y);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...wp(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
216
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
217
|
+
`}]}}const bm=function(e){if(e==null)return bG;if(typeof e=="function")return km(e);if(typeof e=="object")return Array.isArray(e)?vG(e):xG(e);if(typeof e=="string")return wG(e);throw new Error("Expected function, string, or object as test")};function vG(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=bm(e[n]);return km(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function xG(e){const t=e;return km(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function wG(e){return km(t);function t(n){return n&&n.type===e}}function km(e){return t;function t(n,r,i){return!!(kG(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function bG(){return!0}function kG(e){return e!==null&&typeof e=="object"&&"type"in e}const X2=[],SG=!0,sw=!1,EG="skip";function Q2(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=bm(i),s=r?-1:1;a(e,void 0,[])();function a(u,c,f){const h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){const m=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(u.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=X2,y,x,k;if((!t||o(u,c,f[f.length-1]||void 0))&&(m=CG(n(u,f)),m[0]===sw))return m;if("children"in u&&u.children){const w=u;if(w.children&&m[0]!==EG)for(x=(r?w.children.length:-1)+s,k=f.concat(w);x>-1&&x<w.children.length;){const E=w.children[x];if(y=a(E,x,k)(),y[0]===sw)return y;x=typeof y[1]=="number"?y[1]:x+s}}return m}}}function CG(e){return Array.isArray(e)?e:typeof e=="number"?[SG,e]:e==null?X2:[e]}function v1(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),Q2(e,o,a,i);function a(u,c){const f=c[c.length-1],h=f?f.children.indexOf(u):void 0;return s(u,h,f)}}const aw={}.hasOwnProperty,_G={};function NG(e,t){const n=t||_G,r=new Map,i=new Map,o=new Map,s={...cG,...n.handlers},a={all:c,applyData:AG,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:u,options:n,patch:TG,wrap:RG};return v1(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const h=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();h.has(p)||h.set(p,f)}}),a;function u(f,h){const p=f.type,m=a.handlers[p];if(aw.call(a.handlers,p)&&m)return m(a,f,h);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:x,...k}=f,w=wp(k);return w.children=a.all(f),w}return wp(f)}return(a.options.unknownHandler||PG)(a,f,h)}function c(f){const h=[];if("children"in f){const p=f.children;let m=-1;for(;++m<p.length;){const y=a.one(p[m],f);if(y){if(m&&p[m-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=kN(y.value)),!Array.isArray(y)&&y.type==="element")){const x=y.children[0];x&&x.type==="text"&&(x.value=kN(x.value))}Array.isArray(y)?h.push(...y):h.push(y)}}}return h}}function TG(e,t){e.position&&(t.position=pH(e))}function AG(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,wp(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function PG(e,t){const n=t.data||{},r="value"in t&&!(aw.call(n,"hProperties")||aw.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function RG(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
218
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
219
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
220
|
+
`}),n}function kN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function SN(e,t){const n=NG(e,t),r=n.one(e,void 0),i=yG(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
221
|
+
`},i),o}function MG(e,t){return e&&"run"in e?async function(n,r){const i=SN(n,{file:r,...t});await e.run(i,r)}:function(n,r){return SN(n,{file:r,...e||t})}}function EN(e){if(e)throw e}var Mv,CN;function DG(){if(CN)return Mv;CN=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},o=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var f=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!f&&!h)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},s=function(c,f){n&&f.name==="__proto__"?n(c,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):c[f.name]=f.newValue},a=function(c,f){if(f==="__proto__")if(e.call(c,f)){if(r)return r(c,f).value}else return;return c[f]};return Mv=function u(){var c,f,h,p,m,y,x=arguments[0],k=1,w=arguments.length,E=!1;for(typeof x=="boolean"&&(E=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});k<w;++k)if(c=arguments[k],c!=null)for(f in c)h=a(x,f),p=a(c,f),x!==p&&(E&&p&&(o(p)||(m=i(p)))?(m?(m=!1,y=h&&i(h)?h:[]):y=h&&o(h)?h:{},s(x,{name:f,newValue:u(E,y,p)})):typeof p<"u"&&s(x,{name:f,newValue:p}));return x},Mv}var OG=DG();const Dv=Kl(OG);function lw(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function IG(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...c){const f=e[++o];let h=-1;if(u){s(u);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,f?jG(f,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function jG(e,t){let n;return r;function r(...s){const a=e.length>s.length;let u;a&&s.push(i);try{u=e.apply(this,s)}catch(c){const f=c;if(a&&n)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Ei={basename:LG,dirname:FG,extname:zG,join:$G,sep:"/"};function LG(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Od(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function FG(e){if(Od(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function zG(e){Od(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function $G(...e){let t=-1,n;for(;++t<e.length;)Od(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":BG(n)}function BG(e){Od(e);const t=e.codePointAt(0)===47;let n=VG(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function VG(e,t){let n="",r=0,i=-1,o=0,s=-1,a,u;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Od(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const WG={cwd:UG};function UG(){return"/"}function uw(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function HG(e){if(typeof e=="string")e=new URL(e);else if(!uw(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return YG(e)}function YG(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ov=["history","path","basename","stem","extname","dirname"];class J2{constructor(t){let n;t?uw(t)?n={path:t}:typeof t=="string"||qG(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":WG.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ov.length;){const o=Ov[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Ov.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ei.basename(this.path):void 0}set basename(t){jv(t,"basename"),Iv(t,"basename"),this.path=Ei.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ei.dirname(this.path):void 0}set dirname(t){_N(this.basename,"dirname"),this.path=Ei.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ei.extname(this.path):void 0}set extname(t){if(Iv(t,"extname"),_N(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ei.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){uw(t)&&(t=HG(t)),jv(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ei.basename(this.path,this.extname):void 0}set stem(t){jv(t,"stem"),Iv(t,"stem"),this.path=Ei.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Yn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Iv(e,t){if(e&&e.includes(Ei.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ei.sep+"`")}function jv(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _N(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function qG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const GG=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},ZG={}.hasOwnProperty;class x1 extends GG{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=IG()}copy(){const t=new x1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Dv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(zv("data",this.frozen),this.namespace[t]=n,this):ZG.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zv("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Nh(t),r=this.parser||this.Parser;return Lv("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Lv("process",this.parser||this.Parser),Fv("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Nh(t),u=r.parse(a);r.run(u,a,function(f,h,p){if(f||!h||!p)return c(f);const m=h,y=r.stringify(m,p);QG(y)?p.value=y:p.result=y,c(f,p)});function c(f,h){f||!h?s(f):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Lv("processSync",this.parser||this.Parser),Fv("processSync",this.compiler||this.Compiler),this.process(t,i),TN("processSync","process",n),r;function i(o,s){n=!0,EN(o),r=s}}run(t,n,r){NN(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const u=Nh(n);i.run(t,u,c);function c(f,h,p){const m=h||t;f?a(f):s?s(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),TN("runSync","run",r),i;function o(s,a){EN(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Nh(n),i=this.compiler||this.Compiler;return Fv("stringify",i),NN(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(zv("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...h]=c;u(f,h)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=Dv(!0,i.settings,c.settings))}function a(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const h=c[f];o(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,f){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===c){p=h;break}if(p===-1)r.push([c,...f]);else if(f.length>0){let[m,...y]=f;const x=r[p][1];lw(x)&&lw(m)&&(m=Dv(!0,x,m)),r[p]=[c,m,...y]}}}}const KG=new x1().freeze();function Lv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Fv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zv(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function NN(e){if(!lw(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function TN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Nh(e){return XG(e)?e:new J2(e)}function XG(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function QG(e){return typeof e=="string"||JG(e)}function JG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eZ="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",AN=[],PN={allowDangerousHtml:!0},tZ=/^(https?|ircs?|mailto|xmpp)$/i,nZ=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rZ(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||AN,u=e.remarkPlugins||AN,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...PN}:PN,f=e.skipHtml,h=e.unwrapDisallowed,p=e.urlTransform||iZ,m=KG().use(Fq).use(u).use(MG,c).use(a),y=new J2;typeof r=="string"&&(y.value=r);for(const E of nZ)Object.hasOwn(e,E.from)&&(""+E.from+(E.to?"use `"+E.to+"` instead":"remove it")+eZ+E.id,void 0);const x=m.parse(y);let k=m.runSync(x,y);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),v1(k,w),wH(k,{Fragment:v.Fragment,components:o,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function w(E,C,N){if(E.type==="raw"&&N&&typeof C=="number")return f?N.children.splice(C,1):N.children[C]={type:"text",value:E.value},C;if(E.type==="element"){let P;for(P in Av)if(Object.hasOwn(Av,P)&&Object.hasOwn(E.properties,P)){const A=E.properties[P],O=Av[P];(O===null||O.includes(E.tagName))&&(E.properties[P]=p(String(A||""),P,E))}}if(E.type==="element"){let P=t?!t.includes(E.tagName):s?s.includes(E.tagName):!1;if(!P&&n&&typeof C=="number"&&(P=!n(E,C,N)),P&&N&&typeof C=="number")return h&&E.children?N.children.splice(C,1,...E.children):N.children.splice(C,1),C}}}function iZ(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||tZ.test(e.slice(0,t))?e:""}function RN(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function oZ(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function sZ(e,t,n){const i=bm((n||{}).ignore||[]),o=aZ(t);let s=-1;for(;++s<o.length;)Q2(e,"text",a);function a(c,f){let h=-1,p;for(;++h<f.length;){const m=f[h],y=p?p.children:void 0;if(i(m,y?y.indexOf(m):void 0,p))return;p=m}if(p)return u(c,f)}function u(c,f){const h=f[f.length-1],p=o[s][0],m=o[s][1];let y=0;const k=h.children.indexOf(c);let w=!1,E=[];p.lastIndex=0;let C=p.exec(c.value);for(;C;){const N=C.index,P={index:C.index,input:C.input,stack:[...f,c]};let A=m(...C,P);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?p.lastIndex=N+1:(y!==N&&E.push({type:"text",value:c.value.slice(y,N)}),Array.isArray(A)?E.push(...A):A&&E.push(A),y=N+C[0].length,w=!0),!p.global)break;C=p.exec(c.value)}return w?(y<c.value.length&&E.push({type:"text",value:c.value.slice(y)}),h.children.splice(k,1,...E)):E=[c],k+E.length}}function aZ(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([lZ(i[0]),uZ(i[1])])}return t}function lZ(e){return typeof e=="string"?new RegExp(oZ(e),"g"):e}function uZ(e){return typeof e=="function"?e:function(){return e}}const $v="phrasing",Bv=["autolink","link","image","label"];function cZ(){return{transforms:[yZ],enter:{literalAutolink:fZ,literalAutolinkEmail:Vv,literalAutolinkHttp:Vv,literalAutolinkWww:Vv},exit:{literalAutolink:gZ,literalAutolinkEmail:mZ,literalAutolinkHttp:hZ,literalAutolinkWww:pZ}}}function dZ(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$v,notInConstruct:Bv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$v,notInConstruct:Bv},{character:":",before:"[ps]",after:"\\/",inConstruct:$v,notInConstruct:Bv}]}}function fZ(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vv(e){this.config.enter.autolinkProtocol.call(this,e)}function hZ(e){this.config.exit.autolinkProtocol.call(this,e)}function pZ(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function mZ(e){this.config.exit.autolinkEmail.call(this,e)}function gZ(e){this.exit(e)}function yZ(e){sZ(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vZ],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),xZ]],{ignore:["link","linkReference"]})}function vZ(e,t,n,r,i){let o="";if(!eD(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!wZ(n)))return!1;const s=bZ(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function xZ(e,t,n,r){return!eD(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function wZ(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function bZ(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=RN(e,"(");let o=RN(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function eD(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||aa(n)||vm(n))&&(!t||n!==47)}tD.peek=MZ;function kZ(){return{enter:{gfmFootnoteDefinition:EZ,gfmFootnoteDefinitionLabelString:CZ,gfmFootnoteCall:TZ,gfmFootnoteCallString:AZ},exit:{gfmFootnoteDefinition:NZ,gfmFootnoteDefinitionLabelString:_Z,gfmFootnoteCall:RZ,gfmFootnoteCallString:PZ}}}function SZ(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:DZ,footnoteReference:tD}}}function EZ(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function CZ(){this.buffer()}function _Z(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=ui(this.sliceSerialize(e)).toLowerCase()}function NZ(e){this.exit(e)}function TZ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function AZ(){this.buffer()}function PZ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=ui(this.sliceSerialize(e)).toLowerCase()}function RZ(e){this.exit(e)}function tD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),a(),s(),o+=i.move("]"),o}function MZ(){return"["}function DZ(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteDefinition"),a=n.enter("label");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),a(),o+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),o+=i.move(n.indentLines(n.containerFlow(e,i.current()),OZ)),s(),o}function OZ(e,t,n){return t===0?e:(n?"":" ")+e}const IZ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];nD.peek=$Z;function jZ(){return{canContainEols:["delete"],enter:{strikethrough:FZ},exit:{strikethrough:zZ}}}function LZ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:IZ}],handlers:{delete:nD}}}function FZ(e){this.enter({type:"delete",children:[]},e)}function zZ(e){this.exit(e)}function nD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function $Z(){return"~"}function BZ(e){return e.length}function VZ(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||BZ,o=[],s=[],a=[],u=[];let c=0,f=-1;for(;++f<e.length;){const x=[],k=[];let w=-1;for(e[f].length>c&&(c=e[f].length);++w<e[f].length;){const E=WZ(e[f][w]);if(n.alignDelimiters!==!1){const C=i(E);k[w]=C,(u[w]===void 0||C>u[w])&&(u[w]=C)}x.push(E)}s[f]=x,a[f]=k}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<c;)o[h]=MN(r[h]);else{const x=MN(r);for(;++h<c;)o[h]=x}h=-1;const p=[],m=[];for(;++h<c;){const x=o[h];let k="",w="";x===99?(k=":",w=":"):x===108?k=":":x===114&&(w=":");let E=n.alignDelimiters===!1?1:Math.max(1,u[h]-k.length-w.length);const C=k+"-".repeat(E)+w;n.alignDelimiters!==!1&&(E=k.length+E+w.length,E>u[h]&&(u[h]=E),m[h]=E),p[h]=C}s.splice(1,0,p),a.splice(1,0,m),f=-1;const y=[];for(;++f<s.length;){const x=s[f],k=a[f];h=-1;const w=[];for(;++h<c;){const E=x[h]||"";let C="",N="";if(n.alignDelimiters!==!1){const P=u[h]-(k[h]||0),A=o[h];A===114?C=" ".repeat(P):A===99?P%2?(C=" ".repeat(P/2+.5),N=" ".repeat(P/2-.5)):(C=" ".repeat(P/2),N=C):N=" ".repeat(P)}n.delimiterStart!==!1&&!h&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||h)&&w.push(" "),n.alignDelimiters!==!1&&w.push(C),w.push(E),n.alignDelimiters!==!1&&w.push(N),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||h!==c-1)&&w.push("|")}y.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return y.join(`
|
|
222
|
+
`)}function WZ(e){return e==null?"":String(e)}function MN(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function UZ(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),HZ);return i(),s}function HZ(e,t,n){return">"+(n?"":" ")+e}function YZ(e,t){return DN(e,t.inConstruct,!0)&&!DN(e,t.notInConstruct,!1)}function DN(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ON(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
223
|
+
`&&YZ(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
224
|
+
`}function qZ(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function GZ(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ZZ(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function KZ(e,t,n,r){const i=ZZ(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(GZ(e,n)){const h=n.enter("codeIndented"),p=n.indentLines(o,XZ);return h(),p}const a=n.createTracker(r),u=i.repeat(Math.max(qZ(o,i)+1,3)),c=n.enter("codeFenced");let f=a.move(u);if(e.lang){const h=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
|
|
225
|
+
`,encode:["`"],...a.current()})),h()}return f+=a.move(`
|
|
226
|
+
`),o&&(f+=a.move(o+`
|
|
227
|
+
`)),f+=a.move(u),c(),f}function XZ(e,t,n){return(n?"":" ")+e}function w1(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function QZ(e,t,n,r){const i=w1(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(a=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
228
|
+
`,...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),a()),s(),c}function JZ(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Hc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function bp(e,t,n){const r=Dl(e),i=Dl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}rD.peek=eK;function rD(e,t,n,r){const i=JZ(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=u.charCodeAt(0),f=bp(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(u=Hc(c)+u.slice(1));const h=u.charCodeAt(u.length-1),p=bp(r.after.charCodeAt(0),h,i);p.inside&&(u=u.slice(0,-1)+Hc(h));const m=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+m}function eK(e,t,n){return n.options.emphasis||"*"}function tK(e,t){let n=!1;return v1(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,sw}),!!((!e.depth||e.depth<3)&&d1(e)&&(t.options.setext||n))}function nK(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(tK(e,n)){const f=n.enter("headingSetext"),h=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
|
|
229
|
+
`,after:`
|
|
230
|
+
`});return h(),f(),p+`
|
|
231
|
+
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
232
|
+
`))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
233
|
+
`,...o.current()});return/^[\t ]/.test(c)&&(c=Hc(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),u(),a(),c}iD.peek=rK;function iD(e){return e.value||""}function rK(){return"<"}oD.peek=iK;function oD(e,t,n,r){const i=w1(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(a=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),a()),c+=u.move(")"),s(),c}function iK(){return"!"}sD.peek=oK;function sD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const c=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function oK(){return"!"}aD.peek=sK;function aD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let u;if(s.atBreak)for(;u=a.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function sK(){return"`"}function lD(e,t){const n=d1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}uD.peek=aK;function uD(e,t,n,r){const i=w1(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,u;if(lD(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let h=s.move("<");return h+=s.move(n.containerPhrasing(e,{before:h,after:">",...s.current()})),h+=s.move(">"),a(),n.stack=f,h}a=n.enter("link"),u=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(u=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),u()),c+=s.move(")"),a(),c}function aK(e,t,n){return lD(e,n)?"<":"["}cD.peek=lK;function cD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function lK(){return"["}function b1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function uK(e){const t=b1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function cK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function dD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function dK(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?cK(n):b1(n);const a=e.ordered?s==="."?")":".":uK(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),dD(n)===s&&f){let h=-1;for(;++h<e.children.length;){const p=e.children[h];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function fK(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function hK(e,t,n,r){const i=fK(n);let o=n.bulletCurrent||b1(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),f);return u(),c;function f(h,p,m){return p?(m?"":" ".repeat(s))+h:(m?o:o+" ".repeat(s-o.length))+h}}function pK(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const mK=bm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function gK(e,t,n,r){return(e.children.some(function(s){return mK(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function yK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}fD.peek=vK;function fD(e,t,n,r){const i=yK(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=u.charCodeAt(0),f=bp(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(u=Hc(c)+u.slice(1));const h=u.charCodeAt(u.length-1),p=bp(r.after.charCodeAt(0),h,i);p.inside&&(u=u.slice(0,-1)+Hc(h));const m=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+m}function vK(e,t,n){return n.options.strong||"*"}function xK(e,t,n,r){return n.safe(e.value,r)}function wK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function bK(e,t,n){const r=(dD(n)+(n.options.ruleSpaces?" ":"")).repeat(wK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const hD={blockquote:UZ,break:ON,code:KZ,definition:QZ,emphasis:rD,hardBreak:ON,heading:nK,html:iD,image:oD,imageReference:sD,inlineCode:aD,link:uD,linkReference:cD,list:dK,listItem:hK,paragraph:pK,root:gK,strong:fD,text:xK,thematicBreak:bK};function kK(){return{enter:{table:SK,tableData:IN,tableHeader:IN,tableRow:CK},exit:{codeText:_K,table:EK,tableData:Wv,tableHeader:Wv,tableRow:Wv}}}function SK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function EK(e){this.exit(e),this.data.inTable=void 0}function CK(e){this.enter({type:"tableRow",children:[]},e)}function Wv(e){this.exit(e)}function IN(e){this.enter({type:"tableCell",children:[]},e)}function _K(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,NK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function NK(e,t){return t==="|"?t:e}function TK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
234
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:u,tableRow:a}};function s(m,y,x,k){return c(f(m,x,k),m.align)}function a(m,y,x,k){const w=h(m,x,k),E=c([w]);return E.slice(0,E.indexOf(`
|
|
235
|
+
`))}function u(m,y,x,k){const w=x.enter("tableCell"),E=x.enter("phrasing"),C=x.containerPhrasing(m,{...k,before:o,after:o});return E(),w(),C}function c(m,y){return VZ(m,{align:y,alignDelimiters:r,padding:n,stringLength:i})}function f(m,y,x){const k=m.children;let w=-1;const E=[],C=y.enter("table");for(;++w<k.length;)E[w]=h(k[w],y,x);return C(),E}function h(m,y,x){const k=m.children;let w=-1;const E=[],C=y.enter("tableRow");for(;++w<k.length;)E[w]=u(k[w],m,y,x);return C(),E}function p(m,y,x){let k=hD.inlineCode(m,y,x);return x.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function AK(){return{exit:{taskListCheckValueChecked:jN,taskListCheckValueUnchecked:jN,paragraph:RK}}}function PK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:MK}}}function jN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function RK(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function MK(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let u=hD.listItem(e,t,n,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(f){return f+s}}function DK(){return[cZ(),kZ(),jZ(),kK(),AK()]}function OK(e){return{extensions:[dZ(),SZ(),LZ(),TK(e),PK()]}}const IK={tokenize:BK,partial:!0},pD={tokenize:VK,partial:!0},mD={tokenize:WK,partial:!0},gD={tokenize:UK,partial:!0},jK={tokenize:HK,partial:!0},yD={name:"wwwAutolink",tokenize:zK,previous:xD},vD={name:"protocolAutolink",tokenize:$K,previous:wD},No={name:"emailAutolink",tokenize:FK,previous:bD},Wi={};function LK(){return{text:Wi}}let Hs=48;for(;Hs<123;)Wi[Hs]=No,Hs++,Hs===58?Hs=65:Hs===91&&(Hs=97);Wi[43]=No;Wi[45]=No;Wi[46]=No;Wi[95]=No;Wi[72]=[No,vD];Wi[104]=[No,vD];Wi[87]=[No,yD];Wi[119]=[No,yD];function FK(e,t,n){const r=this;let i,o;return s;function s(h){return!cw(h)||!bD.call(r,r.previous)||k1(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(h))}function a(h){return cw(h)?(e.consume(h),a):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(jK,f,c)(h):h===45||h===95||Wn(h)?(o=!0,e.consume(h),u):f(h)}function c(h){return e.consume(h),i=!0,u}function f(h){return o&&i&&Jn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function zK(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!xD.call(r,r.previous)||k1(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(IK,e.attempt(pD,e.attempt(mD,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function $K(e,t,n){const r=this;let i="",o=!1;return s;function s(h){return(h===72||h===104)&&wD.call(r,r.previous)&&!k1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),a):n(h)}function a(h){if(Jn(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),a;if(h===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),o?c:(o=!0,u)):n(h)}function c(h){return h===null||yp(h)||Rt(h)||aa(h)||vm(h)?n(h):e.attempt(pD,e.attempt(mD,f),n)(h)}function f(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function BK(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function VK(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(gD,u,a)(c):c===null||Rt(c)||aa(c)||c!==45&&vm(c)?u(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function u(c){return i||r||!o?n(c):t(c)}}function WK(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(gD,t,o)(s):s===null||Rt(s)||aa(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function UK(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Rt(a)||aa(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Rt(a)||aa(a)?t(a):r(a)}function o(a){return Jn(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):Jn(a)?(e.consume(a),s):n(a)}}function HK(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Wn(o)?n(o):t(o)}}function xD(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Rt(e)}function wD(e){return!Jn(e)}function bD(e){return!(e===47||cw(e))}function cw(e){return e===43||e===45||e===46||e===95||Wn(e)}function k1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const YK={tokenize:eX,partial:!0};function qK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:XK,continuation:{tokenize:QK},exit:JK}},text:{91:{name:"gfmFootnoteCall",tokenize:KK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:GK,resolveTo:ZK}}}}function GK(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return n(u);const c=ui(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function ZK(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function KK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(o>999||h===93&&!s||h===null||h===91||Rt(h))return n(h);if(h===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(ui(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Rt(h)||(s=!0),o++,e.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(e.consume(h),o++,c):c(h)}}function XK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return u;function u(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(y)}function f(y){if(s>999||y===93&&!a||y===null||y===91||Rt(y))return n(y);if(y===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=ui(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Rt(y)||(a=!0),s++,e.consume(y),y===92?h:f}function h(y){return y===91||y===92||y===93?(e.consume(y),s++,f):f(y)}function p(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),i.includes(o)||i.push(o),xt(e,m,"gfmFootnoteDefinitionWhitespace")):n(y)}function m(y){return t(y)}}function QK(e,t,n){return e.check(Dd,t,e.attempt(YK,t,n))}function JK(e){e.exit("gfmFootnoteDefinition")}function eX(e,t,n){const r=this;return xt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function tX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let c=u;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[u][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[u][1].end)},h={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",f,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",h,a]],m=a.parser.constructs.insideSpan.null;m&&Nr(p,p.length,0,xm(m,s.slice(c+1,u),a)),Nr(p,p.length,0,[["exit",h,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",f,a]]),Nr(s,c-1,u-c+3,p),u=c+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){const c=this.previous,f=this.events;let h=0;return p;function p(y){return c===126&&f[f.length-1][1].type!=="characterEscape"?u(y):(s.enter("strikethroughSequenceTemporary"),m(y))}function m(y){const x=Dl(c);if(y===126)return h>1?u(y):(s.consume(y),h++,m);if(h<2&&!n)return u(y);const k=s.exit("strikethroughSequenceTemporary"),w=Dl(y);return k._open=!w||w===2&&!!x,k._close=!x||x===2&&!!w,a(y)}}}class nX{constructor(){this.map=[]}add(t,n,r){rX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function rX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function iX(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function oX(){return{flow:{null:{name:"table",tokenize:sX,resolveAll:aX}}}}function sX(e,t,n){const r=this;let i=0,o=0,s;return a;function a(R){let $=r.events.length-1;for(;$>-1;){const I=r.events[$][1].type;if(I==="lineEnding"||I==="linePrefix")$--;else break}const F=$>-1?r.events[$][1].type:null,H=F==="tableHead"||F==="tableRow"?A:u;return H===A&&r.parser.lazy[r.now().line]?n(R):H(R)}function u(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(s=!0,o+=1),f(R)}function f(R){return R===null?n(R):Ze(R)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),m):n(R):mt(R)?xt(e,f,"whitespace")(R):(o+=1,s&&(s=!1,i+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),h(R)))}function h(R){return R===null||R===124||Rt(R)?(e.exit("data"),f(R)):(e.consume(R),R===92?p:h)}function p(R){return R===92||R===124?(e.consume(R),h):h(R)}function m(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),s=!1,mt(R)?xt(e,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):y(R))}function y(R){return R===45||R===58?k(R):R===124?(s=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),x):P(R)}function x(R){return mt(R)?xt(e,k,"whitespace")(R):k(R)}function k(R){return R===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),w):R===45?(o+=1,w(R)):R===null||Ze(R)?N(R):P(R)}function w(R){return R===45?(e.enter("tableDelimiterFiller"),E(R)):P(R)}function E(R){return R===45?(e.consume(R),E):R===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(R))}function C(R){return mt(R)?xt(e,N,"whitespace")(R):N(R)}function N(R){return R===124?y(R):R===null||Ze(R)?!s||i!==o?P(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):P(R)}function P(R){return n(R)}function A(R){return e.enter("tableRow"),O(R)}function O(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),O):R===null||Ze(R)?(e.exit("tableRow"),t(R)):mt(R)?xt(e,O,"whitespace")(R):(e.enter("data"),M(R))}function M(R){return R===null||R===124||Rt(R)?(e.exit("data"),O(R)):(e.consume(R),R===92?j:M)}function j(R){return R===92||R===124?(e.consume(R),M):M(R)}}function aX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,c,f,h;const p=new nX;for(;++n<e.length;){const m=e[n],y=m[1];m[0]==="enter"?y.type==="tableHead"?(a=!1,u!==0&&(LN(p,t,u,c,f),f=void 0,u=0),c={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",c,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",f,t]])),i=y.type==="tableDelimiterRow"?2:f?3:1):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],h=Th(p,t,o,i,void 0,h),o=[0,0,0,0]),s[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],h=Th(p,t,o,i,void 0,h)),o=s,s=[o[1],n,0,0])):y.type==="tableHead"?(a=!0,u=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],h=Th(p,t,o,i,n,h)):s[1]!==0&&(h=Th(p,t,s,i,n,h)),i=0):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&LN(p,t,u,c,f),p.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=iX(t.events,n))}return e}function Th(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},al(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=al(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=al(t.events,n[2]),f=al(t.events,n[3]),h={type:a,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const p=t.events[n[2]],m=t.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,x=n[3]-n[2]-1;e.add(y,x,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},al(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function LN(e,t,n,r,i){const o=[],s=al(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function al(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const lX={name:"tasklistCheck",tokenize:cX};function uX(){return{text:{91:lX}}}function cX(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return Rt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return Ze(u)?t(u):mt(u)?e.check({tokenize:dX},t,n)(u):n(u)}}function dX(e,t,n){return xt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function fX(e){return D2([LK(),qK(),tX(e),oX(),uX()])}const hX={};function pX(e){const t=this,n=e||hX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(fX(n)),o.push(DK()),s.push(OK(n))}const mX="modulepreload",gX=function(e){return"/"+e},FN={},yX=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=gX(u),u in FN)return;FN[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":mX,c||(h.as="script"),h.crossOrigin="",h.href=u,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};async function vX(e,t){const{codeToTokens:n,bundledLanguages:r}=await yX(async()=>{const{codeToTokens:o,bundledLanguages:s}=await import("./index-Dx4A5Op9.js");return{codeToTokens:o,bundledLanguages:s}},[]);if(!(t in r))return null;const{tokens:i}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return i}function xX({children:e}){const t=e.replace(/\\n/g,`
|
|
236
|
+
`);return v.jsx(rZ,{remarkPlugins:[pX],components:bX,className:"space-y-3",children:t})}const kD=ne.memo(({children:e,language:t,...n})=>{const[r,i]=S.useState([]);return S.useEffect(()=>{vX(e,t).then(o=>{o&&i(o)})},[e,t]),r.length?v.jsx("pre",{...n,children:v.jsx("code",{children:r.map((o,s)=>v.jsxs(v.Fragment,{children:[v.jsx("span",{children:o.map((a,u)=>{const c=typeof a.htmlStyle=="string"?void 0:a.htmlStyle;return v.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:c,children:a.content},u)})},s),s!==r.length-1&&`
|
|
237
|
+
`]}))})}):v.jsx("pre",{...n,children:e})});kD.displayName="HighlightedCode";const wX=({children:e,className:t,language:n,...r})=>{const i=typeof e=="string"?e:dw(e),o=Te("overflow-x-scroll rounded-md border bg-background/50 p-4 font-mono text-sm [scrollbar-width:none]",t);return v.jsxs("div",{className:"group/code relative mb-4",children:[v.jsx(S.Suspense,{fallback:v.jsx("pre",{className:o,...r,children:e}),children:v.jsx(kD,{language:n,className:o,children:i})}),v.jsx("div",{className:"invisible absolute right-2 top-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100",children:v.jsx(cm,{content:i,copyMessage:"Copied code to clipboard"})})]})};function dw(e){var t;if(typeof e=="string")return e;if((t=e==null?void 0:e.props)!=null&&t.children){let n=e.props.children;return Array.isArray(n)?n.map(r=>dw(r)).join(""):dw(n)}return""}const bX={h1:On("h1","text-2xl font-semibold"),h2:On("h2","font-semibold text-xl"),h3:On("h3","font-semibold text-lg"),h4:On("h4","font-semibold text-base"),h5:On("h5","font-medium"),strong:On("strong","font-semibold"),a:On("a","text-primary underline underline-offset-2"),blockquote:On("blockquote","border-l-2 border-primary pl-4"),code:({children:e,className:t,node:n,...r})=>{const i=/language-(\w+)/.exec(t||"");return i?v.jsx(wX,{className:t,language:i[1],...r,children:e}):v.jsx("code",{className:Te("font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-background/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"),...r,children:e})},pre:({children:e})=>e,ol:On("ol","list-decimal space-y-2 pl-6"),ul:On("ul","list-disc space-y-2 pl-6"),li:On("li","my-1.5"),table:On("table","w-full border-collapse overflow-y-auto rounded-md border border-foreground/20"),th:On("th","border border-foreground/20 px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right"),td:On("td","border border-foreground/20 px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right"),tr:On("tr","m-0 border-t p-0 even:bg-muted"),p:On("p","whitespace-pre-wrap leading-relaxed"),hr:On("hr","border-foreground/20")};function On(e,t){const n=({node:r,...i})=>v.jsx(e,{className:t,...i});return n.displayName=e,n}const kX=ru("group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",{variants:{isUser:{true:"bg-primary text-primary-foreground",false:"bg-muted text-foreground"},isError:{true:"bg-red-100 dark:bg-red-900/20",false:""},animation:{none:"",slide:"duration-300 animate-in fade-in-0",scale:"duration-300 animate-in fade-in-0 zoom-in-75",fade:"duration-500 animate-in fade-in-0"}},compoundVariants:[{isUser:!0,animation:"slide",class:"slide-in-from-right"},{isUser:!1,animation:"slide",class:"slide-in-from-left"},{isUser:!0,animation:"scale",class:"origin-bottom-right"},{isUser:!1,animation:"scale",class:"origin-bottom-left"}]}),SX=({role:e,content:t,createdAt:n,showTimeStamp:r=!1,animation:i="scale",actions:o,className:s,experimental_attachments:a,isError:u=!1})=>{const c=e==="user",f=S.useMemo(()=>a==null?void 0:a.map(p=>{const m=EX(p.url);return new File([m],p.name??"Unknown")}),[a]),h=n==null?void 0:n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return v.jsxs("div",{className:Te("flex flex-col",c?"items-end":"items-start"),children:[f?v.jsx("div",{className:"mb-1 flex gap-2 flex-wrap",children:f.map((p,m)=>v.jsx(i1,{file:p},m))}):null,v.jsxs("div",{className:Te(kX({isUser:c,isError:u,animation:i}),s),children:[v.jsx("div",{children:v.jsx(xX,{children:t})}),e==="assistant"&&o?v.jsx("div",{className:"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 opacity-0 transition-opacity group-hover/message:opacity-100 text-foreground",children:o}):null]}),r&&n?v.jsx("time",{dateTime:n.toISOString(),className:Te("mt-1 block px-1 text-xs opacity-50",i!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]})};function EX(e){const t=e.split(",")[1],n=Buffer.from(t??"","base64");return new Uint8Array(n)}function CX(){return v.jsx("div",{className:"justify-left flex space-x-1",children:v.jsx("div",{className:"rounded-lg bg-muted p-3",children:v.jsxs("div",{className:"flex -space-x-2.5",children:[v.jsx(ov,{className:"h-5 w-5 animate-typing-dot-bounce"}),v.jsx(ov,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:90ms]"}),v.jsx(ov,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:180ms]"})]})})})}function _X({messages:e,showTimeStamps:t=!0,isTyping:n=!1,messageOptions:r}){return v.jsxs("div",{className:"space-y-4 overflow-visible",children:[e.map((i,o)=>{const s=typeof r=="function"?r(i):r;return i.role==="assistant"&&!i.content.trim()?null:v.jsx(SX,{showTimeStamp:t,...i,...s},o)}),n&&v.jsx(CX,{})]})}function NX({label:e,append:t,suggestions:n}){return v.jsxs("div",{className:"space-y-6",children:[v.jsx("h2",{className:"text-center text-2xl font-bold",children:e}),v.jsx("div",{className:"flex flex-col sm:flex-row gap-6 text-sm items-center justify-center",children:n.map(r=>v.jsx("button",{onClick:()=>t({role:"user",content:r}),className:"h-max rounded-xl border bg-transparent p-4 hover:bg-accent",children:v.jsx("p",{children:r})},r))})]})}const TX=50;function AX(e){const t=S.useRef(null),n=S.useRef(null),[r,i]=S.useState(!0),o=()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},s=()=>{if(t.current){const{scrollTop:u,scrollHeight:c,clientHeight:f}=t.current;if(n.current?u<n.current:!1)i(!1);else{const p=Math.abs(c-u-f)<TX;i(p)}n.current=u}},a=()=>{i(!1)};return S.useEffect(()=>{t.current&&(n.current=t.current.scrollTop)},[]),S.useEffect(()=>{r&&o()},e),{containerRef:t,scrollToBottom:o,handleScroll:s,shouldAutoScroll:r,handleTouchStart:a}}function PX({messages:e,children:t}){const{containerRef:n,scrollToBottom:r,handleScroll:i,shouldAutoScroll:o,handleTouchStart:s}=AX([e]);return v.jsxs("div",{className:"grid overflow-y-auto pb-4 grid-cols-1",ref:n,onScroll:i,onTouchStart:s,children:[v.jsx("div",{className:"[grid-column:1/1] [grid-row:1/1] max-w-full",children:t}),v.jsx("div",{className:"flex justify-end items-end [grid-column:1/1] [grid-row:1/1] flex-1",children:!o&&v.jsx("div",{className:"sticky bottom-0 left-0 flex w-full justify-end",children:v.jsx(Bt,{onClick:r,className:"h-8 w-8 rounded-full ease-in-out animate-in fade-in-0 slide-in-from-bottom-1",size:"icon",variant:"ghost",children:v.jsx(jB,{className:"h-4 w-4"})})})})]})}const SD=S.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Te("grid max-h-full w-full grid-rows-[1fr_auto]",e),...t}));SD.displayName="ChatContainer";const ED=S.forwardRef(({children:e,handleSubmit:t,isPending:n,className:r},i)=>{const[o,s]=S.useState(null),a=u=>{if(n){u.preventDefault();return}if(!o){t(u);return}const c=RX(o);t(u,{experimental_attachments:c}),s(null)};return v.jsx("form",{ref:i,onSubmit:a,className:r,children:e({files:o,setFiles:s})})});ED.displayName="ChatForm";function RX(e){const t=new DataTransfer;for(const n of Array.from(e))t.items.add(n);return t.files}function MX({agentId:e,initialMessages:t=[],agentName:n,threadId:r,memory:i}){const[o,s]=S.useState(t),[a,u]=S.useState(""),[c,f]=S.useState(!1),{mutate:h}=kb();S.useEffect(()=>{t&&s(t)},[t]);const p=S.useCallback(C=>{u(C.target.value)},[]),m=async C=>{var O,M;if((O=C==null?void 0:C.preventDefault)==null||O.call(C),!a.trim()||c)return;const N=a;u(""),f(!0);const P={id:Date.now().toString(),role:"user",content:N},A={id:(Date.now()+1).toString(),role:"assistant",content:""};s(j=>[...j,P,A]);try{const j=await fetch("/api/agents/"+e+"/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[N],...i?{threadId:r,resourceid:e}:{}})});if(!j.body)return;if(j.status!==200){const I=await j.json();s(q=>[...q.slice(0,-1),{...q[q.length-1],content:I.error,isError:!0}]);return}h(`/api/memory/threads?resourceid=${e}`);const R=j.body.getReader(),$=new TextDecoder;let F="",H="";for(;;){const{done:I,value:q}=await R.read();if(I)break;const Y=$.decode(q);if(F+=Y,(M=F==null?void 0:F.toLocaleLowerCase())!=null&&M.includes("an error occurred")){s(B=>[...B.slice(0,-1),{...B[B.length-1],content:"An error occurred while processing your request.",isError:!0}]);return}const Z=F.matchAll(/0:"([^"]*)"/g);for(const B of Z){const W=B[1];H+=W,s(L=>[...L.slice(0,-1),{...L[L.length-1],content:H}])}F=""}}catch(j){console.error("Error:",j),s(R=>[...R.slice(0,-1),{...R[R.length-1],content:"An error occurred while processing your request.",isError:!0}])}finally{f(!1)}},y=o.at(-1),x=o.length===0,k=c||(y==null?void 0:y.role)==="assistant"&&!(y!=null&&y.content.trim()),w=S.useCallback(C=>{u(C.content),m()},[m]),E=["What capabilities do you have?","How can you help me?","Tell me about yourself"];return v.jsxs(SD,{className:"h-full p-4 max-w-[1000px] mx-auto",children:[v.jsx("div",{className:"flex flex-col h-full py-4",children:x?v.jsx("div",{className:"mx-auto max-w-2xl",children:v.jsx(NX,{label:`Chat with ${n}`,append:w,suggestions:E})}):v.jsx(fr,{className:" h-[calc(100vh-15rem)] px-4",children:v.jsx(PX,{messages:o,children:v.jsx(_X,{messages:o,isTyping:k})})})}),v.jsx(ED,{className:"mt-auto ",isPending:c||k,handleSubmit:m,children:({files:C,setFiles:N})=>v.jsx(y2,{value:a,onChange:p,files:C,setFiles:N,isGenerating:c,placeholder:"Enter your message..."})})]})}const CD=S.forwardRef(({...e},t)=>v.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));CD.displayName="Breadcrumb";const _D=S.forwardRef(({className:e,...t},n)=>v.jsx("ol",{ref:n,className:Te("text-mastra-el-6 flex items-center gap-2 break-words text-[calc(13_/_16_*_1rem)] font-medium",e),...t}));_D.displayName="BreadcrumbList";const ND=S.forwardRef(({className:e,...t},n)=>v.jsx("li",{ref:n,className:Te("inline-flex items-center gap-1.5",e),...t}));ND.displayName="BreadcrumbItem";const TD=S.forwardRef(({asChild:e,className:t,...n},r)=>{const i=e?Li:"a";return v.jsx(i,{ref:r,className:Te("hover:text-text transition-colors",t),...n})});TD.displayName="BreadcrumbLink";const AD=S.forwardRef(({className:e,...t},n)=>v.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Te("text-mastra-el-5 text-sm font-medium",e),...t}));AD.displayName="BreadcrumbPage";const PD=({children:e,className:t,...n})=>v.jsx("li",{role:"presentation","aria-hidden":"true",className:Te(t),...n,children:e??v.jsx(cb,{className:"text-mastra-el-3 !h-[0.625rem] !w-[0.625rem] -rotate-90"})});PD.displayName="BreadcrumbSeparator";function Sm({items:e,pageClassName:t,icon:n}){return v.jsxs("div",{className:"flex items-center gap-4",children:[n,v.jsx(CD,{children:v.jsx(_D,{children:e.map((r,i)=>v.jsxs("span",{className:"flex flex-nowrap items-center gap-2",children:[v.jsx(ND,{children:r.isCurrent?v.jsx(AD,{className:t,children:r.label}):v.jsx(TD,{asChild:!0,children:v.jsx(Cd,{to:r.href,className:"text-mastra-el-3",children:r.label})})},r.href),i<e.length-1&&v.jsx(PD,{})]},i))})})]})}function S1(e){const t=e+"CollectionProvider",[n,r]=Yr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:x}=m,k=ne.useRef(null),w=ne.useRef(new Map).current;return v.jsx(i,{scope:y,itemMap:w,collectionRef:k,children:x})};s.displayName=t;const a=e+"CollectionSlot",u=ne.forwardRef((m,y)=>{const{scope:x,children:k}=m,w=o(a,x),E=pt(y,w.collectionRef);return v.jsx(Li,{ref:E,children:k})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",h=ne.forwardRef((m,y)=>{const{scope:x,children:k,...w}=m,E=ne.useRef(null),C=pt(y,E),N=o(c,x);return ne.useEffect(()=>(N.itemMap.set(E,{ref:E,...w}),()=>void N.itemMap.delete(E))),v.jsx(Li,{[f]:"",ref:C,children:k})});h.displayName=c;function p(m){const y=o(e+"CollectionConsumer",m);return ne.useCallback(()=>{const k=y.collectionRef.current;if(!k)return[];const w=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((N,P)=>w.indexOf(N.ref.current)-w.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},p,r]}var DX=e$.useId||(()=>{}),OX=0;function En(e){const[t,n]=S.useState(DX());return Un(()=>{e||n(r=>r??String(OX++))},[e]),e||(t?`radix-${t}`:"")}function wo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=IX({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=fn(n),u=S.useCallback(c=>{if(o){const h=typeof c=="function"?c(e):c;h!==e&&a(h)}else i(c)},[o,e,i,a]);return[s,u]}function IX({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,i=S.useRef(r),o=fn(t);return S.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var Uv="rovingFocusGroup.onEntryFocus",jX={bubbles:!1,cancelable:!0},Em="RovingFocusGroup",[fw,RD,LX]=S1(Em),[FX,Cm]=Yr(Em,[LX]),[zX,$X]=FX(Em),MD=S.forwardRef((e,t)=>v.jsx(fw.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(fw.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(BX,{...e,ref:t})})}));MD.displayName=Em;var BX=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...h}=e,p=S.useRef(null),m=pt(t,p),y=_d(o),[x=null,k]=wo({prop:s,defaultProp:a,onChange:u}),[w,E]=S.useState(!1),C=fn(c),N=RD(n),P=S.useRef(!1),[A,O]=S.useState(0);return S.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(Uv,C),()=>M.removeEventListener(Uv,C)},[C]),v.jsx(zX,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:x,onItemFocus:S.useCallback(M=>k(M),[k]),onItemShiftTab:S.useCallback(()=>E(!0),[]),onFocusableItemAdd:S.useCallback(()=>O(M=>M+1),[]),onFocusableItemRemove:S.useCallback(()=>O(M=>M-1),[]),children:v.jsx(Ue.div,{tabIndex:w||A===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{P.current=!0}),onFocus:Re(e.onFocus,M=>{const j=!P.current;if(M.target===M.currentTarget&&j&&!w){const R=new CustomEvent(Uv,jX);if(M.currentTarget.dispatchEvent(R),!R.defaultPrevented){const $=N().filter(Y=>Y.focusable),F=$.find(Y=>Y.active),H=$.find(Y=>Y.id===x),q=[F,H,...$].filter(Boolean).map(Y=>Y.ref.current);ID(q,f)}}P.current=!1}),onBlur:Re(e.onBlur,()=>E(!1))})})}),DD="RovingFocusGroupItem",OD=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=En(),u=o||a,c=$X(DD,n),f=c.currentTabStopId===u,h=RD(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=c;return S.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),v.jsx(fw.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:v.jsx(Ue.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Re(e.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:Re(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:Re(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=UX(y,c.orientation,c.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=h().filter(E=>E.focusable).map(E=>E.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const E=w.indexOf(y.currentTarget);w=c.loop?HX(w,E+1):w.slice(E+1)}setTimeout(()=>ID(w))}})})})});OD.displayName=DD;var VX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WX(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function UX(e,t,n){const r=WX(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return VX[r]}function ID(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function HX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jD=MD,LD=OD,E1="Tabs",[YX,bve]=Yr(E1,[Cm]),FD=Cm(),[qX,C1]=YX(E1),zD=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=_d(a),[h,p]=wo({prop:r,onChange:i,defaultProp:o});return v.jsx(qX,{scope:n,baseId:En(),value:h,onValueChange:p,orientation:s,dir:f,activationMode:u,children:v.jsx(Ue.div,{dir:f,"data-orientation":s,...c,ref:t})})});zD.displayName=E1;var $D="TabsList",BD=S.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=C1($D,n),s=FD(n);return v.jsx(jD,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:v.jsx(Ue.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});BD.displayName=$D;var VD="TabsTrigger",WD=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=C1(VD,n),a=FD(n),u=YD(s.baseId,r),c=qD(s.baseId,r),f=r===s.value;return v.jsx(LD,{asChild:!0,...a,focusable:!i,active:f,children:v.jsx(Ue.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Re(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const h=s.activationMode!=="manual";!f&&!i&&h&&s.onValueChange(r)})})})});WD.displayName=VD;var UD="TabsContent",HD=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=C1(UD,n),u=YD(a.baseId,r),c=qD(a.baseId,r),f=r===a.value,h=S.useRef(f);return S.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),v.jsx(tr,{present:i||f,children:({present:p})=>v.jsx(Ue.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&o})})});HD.displayName=UD;function YD(e,t){return`${e}-trigger-${t}`}function qD(e,t){return`${e}-content-${t}`}var GX=zD,GD=BD,ZD=WD,KD=HD;const XD=GX,_1=S.forwardRef(({className:e,...t},n)=>v.jsx(GD,{ref:n,className:Te(e),...t}));_1.displayName=GD.displayName;const na=S.forwardRef(({className:e,...t},n)=>v.jsx(ZD,{ref:n,className:Te(e),...t}));na.displayName=ZD.displayName;const ra=S.forwardRef(({className:e,...t},n)=>v.jsx(KD,{ref:n,className:Te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ra.displayName=KD.displayName;function ZX({agentId:e}){var i;const{isLoading:t,agent:n}=om(e),r=ks();return t?v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]})]})]})}):v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Name"}),v.jsx("p",{className:"text-mastra-el-5",children:n==null?void 0:n.name})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Instructions"}),v.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:n==null?void 0:n.instructions})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Model"}),v.jsx("p",{className:"text-mastra-el-5",children:(i=n==null?void 0:n.model)==null?void 0:i.name})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Provider"}),v.jsx("p",{className:"text-mastra-el-5",children:n==null?void 0:n.model.provider})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Tools"}),v.jsx("div",{className:"flex flex-col gap-2 text-mastra-el-5",children:Object.entries((n==null?void 0:n.tools)??{}).map(([o,s])=>v.jsx("span",{onClick:()=>{r(`/tools/${e}/${s.id}`)},className:"no-underline",children:s.id},o))})]})]})})}function KX({agentId:e}){return v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs w-[400px]",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"GET"}),v.jsx("p",{className:"text-mastra-el-5",children:"/api/agents"})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"GET"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/text"]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/stream"]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/text-object"]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/stream-object"]})]})]})})}const QD=e=>{const[t,n]=S.useState([]),[r,i]=S.useState(!0),o=async s=>{i(!0);try{const a=await fetch(`/api/logs/${s??e}`);if(!a.ok){const c=await a.json();n([]),console.error("Error fetching logs",c),mn.error((c==null?void 0:c.error)||"Error fetching logs");return}const u=await a.json();n(u)}catch(a){n([]),console.error("Error fetching logs",a),mn.error("Error fetching logs")}finally{i(!1)}};return S.useEffect(()=>{o(e)},[e]),{logs:t,isLoading:r,refetchLogs:o}};function XX({agentId:e}){const{logs:t,isLoading:n,refetchLogs:r}=QD(e);return v.jsxs(fr,{className:"h-[calc(100vh-126px)] px-4 pb-4 text-xs w-[400px]",children:[v.jsx("div",{className:"flex justify-end sticky top-0 bg-mastra-bg-2 py-2",children:v.jsx(Bt,{variant:"outline",onClick:()=>r(),children:n?v.jsx(ap,{className:"w-4 h-4 animate-spin"}):v.jsx(ap,{className:"w-4 h-4"})})}),v.jsx("div",{className:"space-y-4",children:t.length===0?v.jsx("p",{className:"text-mastra-el-5",children:"No logs yet"}):t.map(i=>{const o=JSON.parse(i.message);return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsxs("p",{className:"text-mastra-el-4",children:["[",i.timestamp,"]"]}),v.jsxs("p",{className:"text-mastra-el-5",children:["[",i.level,"]"]})]}),v.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:v.jsx("code",{children:JSON.stringify(o,null,2)})})]},i.timestamp)})})]})}function zN({agentId:e}){return v.jsxs(XD,{defaultValue:"details",children:[v.jsxs(_1,{className:"flex shrink-0 border-b",children:[v.jsx(na,{value:"details",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Details"})}),v.jsx(na,{value:"endpoints",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Endpoints"})}),v.jsx(na,{value:"logs",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Logs"})})]}),v.jsx(ra,{value:"details",children:e?v.jsx(ZX,{agentId:e}):null}),v.jsx(ra,{value:"endpoints",children:v.jsx(KX,{agentId:e})}),v.jsx(ra,{value:"logs",children:v.jsx(XX,{agentId:e})})]})}function QX(e,t=globalThis==null?void 0:globalThis.document){const n=fn(e);S.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var JX="DismissableLayer",hw="dismissableLayer.update",eQ="dismissableLayer.pointerDownOutside",tQ="dismissableLayer.focusOutside",$N,JD=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Id=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...u}=e,c=S.useContext(JD),[f,h]=S.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=S.useState({}),y=pt(t,O=>h(O)),x=Array.from(c.layers),[k]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=x.indexOf(k),E=f?x.indexOf(f):-1,C=c.layersWithOutsidePointerEventsDisabled.size>0,N=E>=w,P=iQ(O=>{const M=O.target,j=[...c.branches].some(R=>R.contains(M));!N||j||(i==null||i(O),s==null||s(O),O.defaultPrevented||a==null||a())},p),A=oQ(O=>{const M=O.target;[...c.branches].some(R=>R.contains(M))||(o==null||o(O),s==null||s(O),O.defaultPrevented||a==null||a())},p);return QX(O=>{E===c.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))},p),S.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&($N=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),BN(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=$N)}},[f,p,n,c]),S.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),BN())},[f,c]),S.useEffect(()=>{const O=()=>m({});return document.addEventListener(hw,O),()=>document.removeEventListener(hw,O)},[]),v.jsx(Ue.div,{...u,ref:y,style:{pointerEvents:C?N?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,P.onPointerDownCapture)})});Id.displayName=JX;var nQ="DismissableLayerBranch",rQ=S.forwardRef((e,t)=>{const n=S.useContext(JD),r=S.useRef(null),i=pt(t,r);return S.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),v.jsx(Ue.div,{...e,ref:i})});rQ.displayName=nQ;function iQ(e,t=globalThis==null?void 0:globalThis.document){const n=fn(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let u=function(){eO(eQ,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function oQ(e,t=globalThis==null?void 0:globalThis.document){const n=fn(e),r=S.useRef(!1);return S.useEffect(()=>{const i=o=>{o.target&&!r.current&&eO(tQ,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function BN(){const e=new CustomEvent(hw);document.dispatchEvent(e)}function eO(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?yR(i,o):i.dispatchEvent(o)}var Hv="focusScope.autoFocusOnMount",Yv="focusScope.autoFocusOnUnmount",VN={bubbles:!1,cancelable:!0},sQ="FocusScope",jd=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,u]=S.useState(null),c=fn(i),f=fn(o),h=S.useRef(null),p=pt(t,x=>u(x)),m=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let x=function(C){if(m.paused||!a)return;const N=C.target;a.contains(N)?h.current=N:os(h.current,{select:!0})},k=function(C){if(m.paused||!a)return;const N=C.relatedTarget;N!==null&&(a.contains(N)||os(h.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&os(a)};document.addEventListener("focusin",x),document.addEventListener("focusout",k);const E=new MutationObserver(w);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k),E.disconnect()}}},[r,a,m.paused]),S.useEffect(()=>{if(a){UN.add(m);const x=document.activeElement;if(!a.contains(x)){const w=new CustomEvent(Hv,VN);a.addEventListener(Hv,c),a.dispatchEvent(w),w.defaultPrevented||(aQ(fQ(tO(a)),{select:!0}),document.activeElement===x&&os(a))}return()=>{a.removeEventListener(Hv,c),setTimeout(()=>{const w=new CustomEvent(Yv,VN);a.addEventListener(Yv,f),a.dispatchEvent(w),w.defaultPrevented||os(x??document.body,{select:!0}),a.removeEventListener(Yv,f),UN.remove(m)},0)}}},[a,c,f,m]);const y=S.useCallback(x=>{if(!n&&!r||m.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,w=document.activeElement;if(k&&w){const E=x.currentTarget,[C,N]=lQ(E);C&&N?!x.shiftKey&&w===N?(x.preventDefault(),n&&os(C,{select:!0})):x.shiftKey&&w===C&&(x.preventDefault(),n&&os(N,{select:!0})):w===E&&x.preventDefault()}},[n,r,m.paused]);return v.jsx(Ue.div,{tabIndex:-1,...s,ref:p,onKeyDown:y})});jd.displayName=sQ;function aQ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(os(r,{select:t}),document.activeElement!==n)return}function lQ(e){const t=tO(e),n=WN(t,e),r=WN(t.reverse(),e);return[n,r]}function tO(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function WN(e,t){for(const n of e)if(!uQ(n,{upTo:t}))return n}function uQ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cQ(e){return e instanceof HTMLInputElement&&"select"in e}function os(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cQ(e)&&t&&e.select()}}var UN=dQ();function dQ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=HN(e,t),e.unshift(t)},remove(t){var n;e=HN(e,t),(n=e[0])==null||n.resume()}}}function HN(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fQ(e){return e.filter(t=>t.tagName!=="A")}var hQ="Portal",Ld=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=S.useState(!1);Un(()=>o(!0),[]);const s=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?uR.createPortal(v.jsx(Ue.div,{...r,ref:t}),s):null});Ld.displayName=hQ;var qv=0;function _m(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??YN()),document.body.insertAdjacentElement("beforeend",e[1]??YN()),qv++,()=>{qv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qv--}},[])}function YN(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var _i=function(){return _i=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_i.apply(this,arguments)};function nO(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function pQ(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Kh="right-scroll-bar-position",Xh="width-before-scroll-bar",mQ="with-scroll-bars-hidden",gQ="--removed-body-scroll-bar-size";function Gv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yQ(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var vQ=typeof window<"u"?S.useLayoutEffect:S.useEffect,qN=new WeakMap;function xQ(e,t){var n=yQ(null,function(r){return e.forEach(function(i){return Gv(i,r)})});return vQ(function(){var r=qN.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Gv(a,null)}),o.forEach(function(a){i.has(a)||Gv(a,s)})}qN.set(n,e)},[e]),n}function wQ(e){return e}function bQ(e,t){t===void 0&&(t=wQ);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var u=function(){var f=s;s=[],f.forEach(o)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){s.push(f),c()},filter:function(f){return s=s.filter(f),n}}}};return i}function kQ(e){e===void 0&&(e={});var t=bQ(null);return t.options=_i({async:!0,ssr:!1},e),t}var rO=function(e){var t=e.sideCar,n=nO(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,_i({},n))};rO.isSideCarExport=!0;function SQ(e,t){return e.useMedium(t),rO}var iO=kQ(),Zv=function(){},Nm=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:Zv,onWheelCapture:Zv,onTouchMoveCapture:Zv}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,h=e.shards,p=e.sideCar,m=e.noIsolation,y=e.inert,x=e.allowPinchZoom,k=e.as,w=k===void 0?"div":k,E=e.gapMode,C=nO(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,P=xQ([n,t]),A=_i(_i({},C),i);return S.createElement(S.Fragment,null,f&&S.createElement(N,{sideCar:iO,removeScrollBar:c,shards:h,noIsolation:m,inert:y,setCallbacks:o,allowPinchZoom:!!x,lockRef:n,gapMode:E}),s?S.cloneElement(S.Children.only(a),_i(_i({},A),{ref:P})):S.createElement(w,_i({},A,{className:u,ref:P}),a))});Nm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Nm.classNames={fullWidth:Xh,zeroRight:Kh};var EQ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function CQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=EQ();return t&&e.setAttribute("nonce",t),e}function _Q(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function NQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var TQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=CQ())&&(_Q(t,n),NQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},AQ=function(){var e=TQ();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oO=function(){var e=AQ(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},PQ={left:0,top:0,right:0,gap:0},Kv=function(e){return parseInt(e||"",10)||0},RQ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Kv(n),Kv(r),Kv(i)]},MQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return PQ;var t=RQ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},DQ=oO(),kl="data-scroll-locked",OQ=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
238
|
+
.`.concat(mQ,` {
|
|
239
|
+
overflow: hidden `).concat(r,`;
|
|
240
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
241
|
+
}
|
|
242
|
+
body[`).concat(kl,`] {
|
|
243
|
+
overflow: hidden `).concat(r,`;
|
|
244
|
+
overscroll-behavior: contain;
|
|
245
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
246
|
+
padding-left: `.concat(i,`px;
|
|
247
|
+
padding-top: `).concat(o,`px;
|
|
248
|
+
padding-right: `).concat(s,`px;
|
|
249
|
+
margin-left:0;
|
|
250
|
+
margin-top:0;
|
|
251
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
252
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.`).concat(Kh,` {
|
|
256
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.`).concat(Xh,` {
|
|
260
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.`).concat(Kh," .").concat(Kh,` {
|
|
264
|
+
right: 0 `).concat(r,`;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.`).concat(Xh," .").concat(Xh,` {
|
|
268
|
+
margin-right: 0 `).concat(r,`;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
body[`).concat(kl,`] {
|
|
272
|
+
`).concat(gQ,": ").concat(a,`px;
|
|
273
|
+
}
|
|
274
|
+
`)},GN=function(){var e=parseInt(document.body.getAttribute(kl)||"0",10);return isFinite(e)?e:0},IQ=function(){S.useEffect(function(){return document.body.setAttribute(kl,(GN()+1).toString()),function(){var e=GN()-1;e<=0?document.body.removeAttribute(kl):document.body.setAttribute(kl,e.toString())}},[])},jQ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;IQ();var o=S.useMemo(function(){return MQ(i)},[i]);return S.createElement(DQ,{styles:OQ(o,!t,i,n?"":"!important")})},pw=!1;if(typeof window<"u")try{var Ah=Object.defineProperty({},"passive",{get:function(){return pw=!0,!0}});window.addEventListener("test",Ah,Ah),window.removeEventListener("test",Ah,Ah)}catch{pw=!1}var tl=pw?{passive:!1}:!1,LQ=function(e){return e.tagName==="TEXTAREA"},sO=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!LQ(e)&&n[t]==="visible")},FQ=function(e){return sO(e,"overflowY")},zQ=function(e){return sO(e,"overflowX")},ZN=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=aO(e,r);if(i){var o=lO(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},$Q=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},BQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},aO=function(e,t){return e==="v"?FQ(t):zQ(t)},lO=function(e,t){return e==="v"?$Q(t):BQ(t)},VQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},WQ=function(e,t,n,r,i){var o=VQ(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,u=t.contains(a),c=!1,f=s>0,h=0,p=0;do{var m=lO(e,a),y=m[0],x=m[1],k=m[2],w=x-k-o*y;(y||w)&&aO(e,a)&&(h+=w,p+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&(Math.abs(h)<1||!i)||!f&&(Math.abs(p)<1||!i))&&(c=!0),c},Ph=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},KN=function(e){return[e.deltaX,e.deltaY]},XN=function(e){return e&&"current"in e?e.current:e},UQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HQ=function(e){return`
|
|
275
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
276
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
277
|
+
`)},YQ=0,nl=[];function qQ(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(YQ++)[0],o=S.useState(oO)[0],s=S.useRef(e);S.useEffect(function(){s.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=pQ([e.lockRef.current],(e.shards||[]).map(XN),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=S.useCallback(function(x,k){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!s.current.allowPinchZoom;var w=Ph(x),E=n.current,C="deltaX"in x?x.deltaX:E[0]-w[0],N="deltaY"in x?x.deltaY:E[1]-w[1],P,A=x.target,O=Math.abs(C)>Math.abs(N)?"h":"v";if("touches"in x&&O==="h"&&A.type==="range")return!1;var M=ZN(O,A);if(!M)return!0;if(M?P=O:(P=O==="v"?"h":"v",M=ZN(O,A)),!M)return!1;if(!r.current&&"changedTouches"in x&&(C||N)&&(r.current=P),!P)return!0;var j=r.current||P;return WQ(j,k,x,j==="h"?C:N,!0)},[]),u=S.useCallback(function(x){var k=x;if(!(!nl.length||nl[nl.length-1]!==o)){var w="deltaY"in k?KN(k):Ph(k),E=t.current.filter(function(P){return P.name===k.type&&(P.target===k.target||k.target===P.shadowParent)&&UQ(P.delta,w)})[0];if(E&&E.should){k.cancelable&&k.preventDefault();return}if(!E){var C=(s.current.shards||[]).map(XN).filter(Boolean).filter(function(P){return P.contains(k.target)}),N=C.length>0?a(k,C[0]):!s.current.noIsolation;N&&k.cancelable&&k.preventDefault()}}},[]),c=S.useCallback(function(x,k,w,E){var C={name:x,delta:k,target:w,should:E,shadowParent:GQ(w)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(N){return N!==C})},1)},[]),f=S.useCallback(function(x){n.current=Ph(x),r.current=void 0},[]),h=S.useCallback(function(x){c(x.type,KN(x),x.target,a(x,e.lockRef.current))},[]),p=S.useCallback(function(x){c(x.type,Ph(x),x.target,a(x,e.lockRef.current))},[]);S.useEffect(function(){return nl.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",u,tl),document.addEventListener("touchmove",u,tl),document.addEventListener("touchstart",f,tl),function(){nl=nl.filter(function(x){return x!==o}),document.removeEventListener("wheel",u,tl),document.removeEventListener("touchmove",u,tl),document.removeEventListener("touchstart",f,tl)}},[]);var m=e.removeScrollBar,y=e.inert;return S.createElement(S.Fragment,null,y?S.createElement(o,{styles:HQ(i)}):null,m?S.createElement(jQ,{gapMode:e.gapMode}):null)}function GQ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ZQ=SQ(iO,qQ);var Fd=S.forwardRef(function(e,t){return S.createElement(Nm,_i({},e,{ref:t,sideCar:ZQ}))});Fd.classNames=Nm.classNames;var KQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rl=new WeakMap,Rh=new WeakMap,Mh={},Xv=0,uO=function(e){return e&&(e.host||uO(e.parentNode))},XQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uO(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},QQ=function(e,t,n,r){var i=XQ(t,Array.isArray(e)?e:[e]);Mh[n]||(Mh[n]=new WeakMap);var o=Mh[n],s=[],a=new Set,u=new Set(i),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};i.forEach(c);var f=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))f(p);else try{var m=p.getAttribute(r),y=m!==null&&m!=="false",x=(rl.get(p)||0)+1,k=(o.get(p)||0)+1;rl.set(p,x),o.set(p,k),s.push(p),x===1&&y&&Rh.set(p,!0),k===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return f(t),a.clear(),Xv++,function(){s.forEach(function(h){var p=rl.get(h)-1,m=o.get(h)-1;rl.set(h,p),o.set(h,m),p||(Rh.has(h)||h.removeAttribute(r),Rh.delete(h)),m||h.removeAttribute(n)}),Xv--,Xv||(rl=new WeakMap,rl=new WeakMap,Rh=new WeakMap,Mh={})}},Tm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=KQ(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),QQ(r,i,n,"aria-hidden")):function(){return null}},N1="Dialog",[cO,dO]=Yr(N1),[JQ,gi]=cO(N1),fO=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=S.useRef(null),u=S.useRef(null),[c=!1,f]=wo({prop:r,defaultProp:i,onChange:o});return v.jsx(JQ,{scope:t,triggerRef:a,contentRef:u,contentId:En(),titleId:En(),descriptionId:En(),open:c,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(h=>!h),[f]),modal:s,children:n})};fO.displayName=N1;var hO="DialogTrigger",pO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(hO,n),o=pt(t,i.triggerRef);return v.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":P1(i.open),...r,ref:o,onClick:Re(e.onClick,i.onOpenToggle)})});pO.displayName=hO;var T1="DialogPortal",[eJ,mO]=cO(T1,{forceMount:void 0}),gO=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=gi(T1,t);return v.jsx(eJ,{scope:t,forceMount:n,children:S.Children.map(r,s=>v.jsx(tr,{present:n||o.open,children:v.jsx(Ld,{asChild:!0,container:i,children:s})}))})};gO.displayName=T1;var kp="DialogOverlay",yO=S.forwardRef((e,t)=>{const n=mO(kp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=gi(kp,e.__scopeDialog);return o.modal?v.jsx(tr,{present:r||o.open,children:v.jsx(tJ,{...i,ref:t})}):null});yO.displayName=kp;var tJ=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(kp,n);return v.jsx(Fd,{as:Li,allowPinchZoom:!0,shards:[i.contentRef],children:v.jsx(Ue.div,{"data-state":P1(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),la="DialogContent",vO=S.forwardRef((e,t)=>{const n=mO(la,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=gi(la,e.__scopeDialog);return v.jsx(tr,{present:r||o.open,children:o.modal?v.jsx(nJ,{...i,ref:t}):v.jsx(rJ,{...i,ref:t})})});vO.displayName=la;var nJ=S.forwardRef((e,t)=>{const n=gi(la,e.__scopeDialog),r=S.useRef(null),i=pt(t,n.contentRef,r);return S.useEffect(()=>{const o=r.current;if(o)return Tm(o)},[]),v.jsx(xO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault())})}),rJ=S.forwardRef((e,t)=>{const n=gi(la,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return v.jsx(xO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),xO=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=gi(la,n),u=S.useRef(null),c=pt(t,u);return _m(),v.jsxs(v.Fragment,{children:[v.jsx(jd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:v.jsx(Id,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":P1(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(oJ,{titleId:a.titleId}),v.jsx(aJ,{contentRef:u,descriptionId:a.descriptionId})]})]})}),A1="DialogTitle",wO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(A1,n);return v.jsx(Ue.h2,{id:i.titleId,...r,ref:t})});wO.displayName=A1;var bO="DialogDescription",kO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(bO,n);return v.jsx(Ue.p,{id:i.descriptionId,...r,ref:t})});kO.displayName=bO;var SO="DialogClose",EO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(SO,n);return v.jsx(Ue.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});EO.displayName=SO;function P1(e){return e?"open":"closed"}var CO="DialogTitleWarning",[iJ,_O]=x6(CO,{contentName:la,titleName:A1,docsSlug:"dialog"}),oJ=({titleId:e})=>{const t=_O(CO),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
278
|
+
|
|
279
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
280
|
+
|
|
281
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},sJ="DialogDescriptionWarning",aJ=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_O(sJ).contentName}}.`;return S.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},NO=fO,lJ=pO,TO=gO,AO=yO,PO=vO,uJ=wO,cJ=kO,RO=EO,MO="AlertDialog",[dJ,kve]=Yr(MO,[dO]),To=dO(),DO=e=>{const{__scopeAlertDialog:t,...n}=e,r=To(t);return v.jsx(NO,{...r,...n,modal:!0})};DO.displayName=MO;var fJ="AlertDialogTrigger",OO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(lJ,{...i,...r,ref:t})});OO.displayName=fJ;var hJ="AlertDialogPortal",IO=e=>{const{__scopeAlertDialog:t,...n}=e,r=To(t);return v.jsx(TO,{...r,...n})};IO.displayName=hJ;var pJ="AlertDialogOverlay",jO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(AO,{...i,...r,ref:t})});jO.displayName=pJ;var Sl="AlertDialogContent",[mJ,gJ]=dJ(Sl),LO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=To(n),s=S.useRef(null),a=pt(t,s),u=S.useRef(null);return v.jsx(iJ,{contentName:Sl,titleName:FO,docsSlug:"alert-dialog",children:v.jsx(mJ,{scope:n,cancelRef:u,children:v.jsxs(PO,{role:"alertdialog",...o,...i,ref:a,onOpenAutoFocus:Re(i.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=u.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[v.jsx(gR,{children:r}),v.jsx(vJ,{contentRef:s})]})})})});LO.displayName=Sl;var FO="AlertDialogTitle",zO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(uJ,{...i,...r,ref:t})});zO.displayName=FO;var $O="AlertDialogDescription",BO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(cJ,{...i,...r,ref:t})});BO.displayName=$O;var yJ="AlertDialogAction",VO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(RO,{...i,...r,ref:t})});VO.displayName=yJ;var WO="AlertDialogCancel",UO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=gJ(WO,n),o=To(n),s=pt(t,i);return v.jsx(RO,{...o,...r,ref:s})});UO.displayName=WO;var vJ=({contentRef:e})=>{const t=`\`${Sl}\` requires a description for the component to be accessible for screen reader users.
|
|
282
|
+
|
|
283
|
+
You can add a description to the \`${Sl}\` by passing a \`${$O}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
284
|
+
|
|
285
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Sl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
286
|
+
|
|
287
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return S.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},xJ=DO,wJ=OO,bJ=IO,HO=jO,YO=LO,qO=VO,GO=UO,ZO=zO,KO=BO;const kJ=xJ,SJ=wJ,XO=bJ;function An({open:e,onOpenChange:t,children:n}){return v.jsx(kJ,{open:e,onOpenChange:t,children:n})}const R1=S.forwardRef(({className:e,...t},n)=>v.jsx(HO,{className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));R1.displayName=HO.displayName;const QO=S.forwardRef(({className:e,...t},n)=>v.jsxs(XO,{children:[v.jsx(R1,{}),v.jsx(YO,{ref:n,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));QO.displayName=YO.displayName;const JO=({className:e,...t})=>v.jsx("div",{className:Te("flex flex-col space-y-2 text-center sm:text-left",e),...t});JO.displayName="AlertDialogHeader";const eI=({className:e,...t})=>v.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});eI.displayName="AlertDialogFooter";const tI=S.forwardRef(({className:e,...t},n)=>v.jsx(ZO,{ref:n,className:Te("text-lg font-semibold",e),...t}));tI.displayName=ZO.displayName;const nI=S.forwardRef(({className:e,...t},n)=>v.jsx(KO,{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));nI.displayName=KO.displayName;const rI=S.forwardRef(({className:e,...t},n)=>v.jsx(qO,{ref:n,className:Te(wl(),e),...t}));rI.displayName=qO.displayName;const iI=S.forwardRef(({className:e,...t},n)=>v.jsx(GO,{ref:n,className:Te(wl({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));iI.displayName=GO.displayName;An.Trigger=SJ;An.Portal=XO;An.Overlay=R1;An.Content=QO;An.Header=JO;An.Footer=eI;An.Title=tI;An.Description=nI;An.Action=rI;An.Cancel=iI;const EJ=["top","right","bottom","left"],ps=Math.min,Sr=Math.max,Sp=Math.round,Dh=Math.floor,Di=e=>({x:e,y:e}),CJ={left:"right",right:"left",bottom:"top",top:"bottom"},_J={start:"end",end:"start"};function mw(e,t,n){return Sr(e,ps(t,n))}function bo(e,t){return typeof e=="function"?e(t):e}function ko(e){return e.split("-")[0]}function au(e){return e.split("-")[1]}function M1(e){return e==="x"?"y":"x"}function D1(e){return e==="y"?"height":"width"}function ms(e){return["top","bottom"].includes(ko(e))?"y":"x"}function O1(e){return M1(ms(e))}function NJ(e,t,n){n===void 0&&(n=!1);const r=au(e),i=O1(e),o=D1(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Ep(s)),[s,Ep(s)]}function TJ(e){const t=Ep(e);return[gw(e),t,gw(t)]}function gw(e){return e.replace(/start|end/g,t=>_J[t])}function AJ(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function PJ(e,t,n,r){const i=au(e);let o=AJ(ko(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(gw)))),o}function Ep(e){return e.replace(/left|right|bottom|top/g,t=>CJ[t])}function RJ(e){return{top:0,right:0,bottom:0,left:0,...e}}function oI(e){return typeof e!="number"?RJ(e):{top:e,right:e,bottom:e,left:e}}function Cp(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function QN(e,t,n){let{reference:r,floating:i}=e;const o=ms(t),s=O1(t),a=D1(s),u=ko(t),c=o==="y",f=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let m;switch(u){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-i.width,y:h};break;default:m={x:r.x,y:r.y}}switch(au(t)){case"start":m[s]-=p*(n&&c?-1:1);break;case"end":m[s]+=p*(n&&c?-1:1);break}return m}const MJ=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:h}=QN(c,r,u),p=r,m={},y=0;for(let x=0;x<a.length;x++){const{name:k,fn:w}=a[x],{x:E,y:C,data:N,reset:P}=await w({x:f,y:h,initialPlacement:r,placement:p,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});f=E??f,h=C??h,m={...m,[k]:{...m[k],...N}},P&&y<=50&&(y++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(c=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:f,y:h}=QN(c,p,u)),x=-1)}return{x:f,y:h,placement:p,strategy:i,middlewareData:m}};async function Yc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:p=!1,padding:m=0}=bo(t,e),y=oI(m),k=a[p?h==="floating"?"reference":"floating":h],w=Cp(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(k)))==null||n?k:k.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),E=h==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),N=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},P=Cp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:C,strategy:u}):E);return{top:(w.top-P.top+y.top)/N.y,bottom:(P.bottom-w.bottom+y.bottom)/N.y,left:(w.left-P.left+y.left)/N.x,right:(P.right-w.right+y.right)/N.x}}const DJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:u}=t,{element:c,padding:f=0}=bo(e,t)||{};if(c==null)return{};const h=oI(f),p={x:n,y:r},m=O1(i),y=D1(m),x=await s.getDimensions(c),k=m==="y",w=k?"top":"left",E=k?"bottom":"right",C=k?"clientHeight":"clientWidth",N=o.reference[y]+o.reference[m]-p[m]-o.floating[y],P=p[m]-o.reference[m],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let O=A?A[C]:0;(!O||!await(s.isElement==null?void 0:s.isElement(A)))&&(O=a.floating[C]||o.floating[y]);const M=N/2-P/2,j=O/2-x[y]/2-1,R=ps(h[w],j),$=ps(h[E],j),F=R,H=O-x[y]-$,I=O/2-x[y]/2+M,q=mw(F,I,H),Y=!u.arrow&&au(i)!=null&&I!==q&&o.reference[y]/2-(I<F?R:$)-x[y]/2<0,Z=Y?I<F?I-F:I-H:0;return{[m]:p[m]+Z,data:{[m]:q,centerOffset:I-q-Z,...Y&&{alignmentOffset:Z}},reset:Y}}}),OJ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...k}=bo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=ko(i),E=ms(a),C=ko(a)===a,N=await(u.isRTL==null?void 0:u.isRTL(c.floating)),P=p||(C||!x?[Ep(a)]:TJ(a)),A=y!=="none";!p&&A&&P.push(...PJ(a,x,y,N));const O=[a,...P],M=await Yc(t,k),j=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&j.push(M[w]),h){const I=NJ(i,s,N);j.push(M[I[0]],M[I[1]])}if(R=[...R,{placement:i,overflows:j}],!j.every(I=>I<=0)){var $,F;const I=((($=o.flip)==null?void 0:$.index)||0)+1,q=O[I];if(q)return{data:{index:I,overflows:R},reset:{placement:q}};let Y=(F=R.filter(Z=>Z.overflows[0]<=0).sort((Z,B)=>Z.overflows[1]-B.overflows[1])[0])==null?void 0:F.placement;if(!Y)switch(m){case"bestFit":{var H;const Z=(H=R.filter(B=>{if(A){const W=ms(B.placement);return W===E||W==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(W=>W>0).reduce((W,L)=>W+L,0)]).sort((B,W)=>B[1]-W[1])[0])==null?void 0:H[0];Z&&(Y=Z);break}case"initialPlacement":Y=a;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};function JN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eT(e){return EJ.some(t=>e[t]>=0)}const IJ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=bo(e,t);switch(r){case"referenceHidden":{const o=await Yc(t,{...i,elementContext:"reference"}),s=JN(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:eT(s)}}}case"escaped":{const o=await Yc(t,{...i,altBoundary:!0}),s=JN(o,n.floating);return{data:{escapedOffsets:s,escaped:eT(s)}}}default:return{}}}}};async function jJ(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ko(n),a=au(n),u=ms(n)==="y",c=["left","top"].includes(s)?-1:1,f=o&&u?-1:1,h=bo(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof y=="number"&&(m=a==="end"?y*-1:y),u?{x:m*f,y:p*c}:{x:p*c,y:m*f}}const LJ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,u=await jJ(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:s}}}}},FJ=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:k=>{let{x:w,y:E}=k;return{x:w,y:E}}},...u}=bo(e,t),c={x:n,y:r},f=await Yc(t,u),h=ms(ko(i)),p=M1(h);let m=c[p],y=c[h];if(o){const k=p==="y"?"top":"left",w=p==="y"?"bottom":"right",E=m+f[k],C=m-f[w];m=mw(E,m,C)}if(s){const k=h==="y"?"top":"left",w=h==="y"?"bottom":"right",E=y+f[k],C=y-f[w];y=mw(E,y,C)}const x=a.fn({...t,[p]:m,[h]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:o,[h]:s}}}}}},zJ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=bo(e,t),f={x:n,y:r},h=ms(i),p=M1(h);let m=f[p],y=f[h];const x=bo(a,t),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const C=p==="y"?"height":"width",N=o.reference[p]-o.floating[C]+k.mainAxis,P=o.reference[p]+o.reference[C]-k.mainAxis;m<N?m=N:m>P&&(m=P)}if(c){var w,E;const C=p==="y"?"width":"height",N=["top","left"].includes(ko(i)),P=o.reference[h]-o.floating[C]+(N&&((w=s.offset)==null?void 0:w[h])||0)+(N?0:k.crossAxis),A=o.reference[h]+o.reference[C]+(N?0:((E=s.offset)==null?void 0:E[h])||0)-(N?k.crossAxis:0);y<P?y=P:y>A&&(y=A)}return{[p]:m,[h]:y}}}},$J=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:u=()=>{},...c}=bo(e,t),f=await Yc(t,c),h=ko(i),p=au(i),m=ms(i)==="y",{width:y,height:x}=o.floating;let k,w;h==="top"||h==="bottom"?(k=h,w=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(w=h,k=p==="end"?"top":"bottom");const E=x-f.top-f.bottom,C=y-f.left-f.right,N=ps(x-f[k],E),P=ps(y-f[w],C),A=!t.middlewareData.shift;let O=N,M=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=E),A&&!p){const R=Sr(f.left,0),$=Sr(f.right,0),F=Sr(f.top,0),H=Sr(f.bottom,0);m?M=y-2*(R!==0||$!==0?R+$:Sr(f.left,f.right)):O=x-2*(F!==0||H!==0?F+H:Sr(f.top,f.bottom))}await u({...t,availableWidth:M,availableHeight:O});const j=await s.getDimensions(a.floating);return y!==j.width||x!==j.height?{reset:{rects:!0}}:{}}}};function Am(){return typeof window<"u"}function lu(e){return sI(e)?(e.nodeName||"").toLowerCase():"#document"}function Tr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ui(e){var t;return(t=(sI(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sI(e){return Am()?e instanceof Node||e instanceof Tr(e).Node:!1}function di(e){return Am()?e instanceof Element||e instanceof Tr(e).Element:!1}function Fi(e){return Am()?e instanceof HTMLElement||e instanceof Tr(e).HTMLElement:!1}function tT(e){return!Am()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tr(e).ShadowRoot}function zd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=fi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function BJ(e){return["table","td","th"].includes(lu(e))}function Pm(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function I1(e){const t=j1(),n=di(e)?fi(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(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 VJ(e){let t=gs(e);for(;Fi(t)&&!Ol(t);){if(I1(t))return t;if(Pm(t))return null;t=gs(t)}return null}function j1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ol(e){return["html","body","#document"].includes(lu(e))}function fi(e){return Tr(e).getComputedStyle(e)}function Rm(e){return di(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gs(e){if(lu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tT(e)&&e.host||Ui(e);return tT(t)?t.host:t}function aI(e){const t=gs(e);return Ol(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fi(t)&&zd(t)?t:aI(t)}function qc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=aI(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Tr(i);if(o){const a=yw(s);return t.concat(s,s.visualViewport||[],zd(i)?i:[],a&&n?qc(a):[])}return t.concat(i,qc(i,[],n))}function yw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lI(e){const t=fi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Fi(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Sp(n)!==o||Sp(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function L1(e){return di(e)?e:e.contextElement}function El(e){const t=L1(e);if(!Fi(t))return Di(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=lI(t);let s=(o?Sp(n.width):n.width)/r,a=(o?Sp(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const WJ=Di(0);function uI(e){const t=Tr(e);return!j1()||!t.visualViewport?WJ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UJ(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tr(e)?!1:t}function ua(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=L1(e);let s=Di(1);t&&(r?di(r)&&(s=El(r)):s=El(e));const a=UJ(o,n,r)?uI(o):Di(0);let u=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,f=i.width/s.x,h=i.height/s.y;if(o){const p=Tr(o),m=r&&di(r)?Tr(r):r;let y=p,x=yw(y);for(;x&&r&&m!==y;){const k=El(x),w=x.getBoundingClientRect(),E=fi(x),C=w.left+(x.clientLeft+parseFloat(E.paddingLeft))*k.x,N=w.top+(x.clientTop+parseFloat(E.paddingTop))*k.y;u*=k.x,c*=k.y,f*=k.x,h*=k.y,u+=C,c+=N,y=Tr(x),x=yw(y)}}return Cp({width:f,height:h,x:u,y:c})}function F1(e,t){const n=Rm(e).scrollLeft;return t?t.left+n:ua(Ui(e)).left+n}function cI(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:F1(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function HJ(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ui(r),a=t?Pm(t.floating):!1;if(r===s||a&&o)return n;let u={scrollLeft:0,scrollTop:0},c=Di(1);const f=Di(0),h=Fi(r);if((h||!h&&!o)&&((lu(r)!=="body"||zd(s))&&(u=Rm(r)),Fi(r))){const m=ua(r);c=El(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const p=s&&!h&&!o?cI(s,u,!0):Di(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-u.scrollTop*c.y+f.y+p.y}}function YJ(e){return Array.from(e.getClientRects())}function qJ(e){const t=Ui(e),n=Rm(e),r=e.ownerDocument.body,i=Sr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Sr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+F1(e);const a=-n.scrollTop;return fi(r).direction==="rtl"&&(s+=Sr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function GJ(e,t){const n=Tr(e),r=Ui(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,u=0;if(i){o=i.width,s=i.height;const c=j1();(!c||c&&t==="fixed")&&(a=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:a,y:u}}function ZJ(e,t){const n=ua(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Fi(e)?El(e):Di(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:s,height:a,x:u,y:c}}function nT(e,t,n){let r;if(t==="viewport")r=GJ(e,n);else if(t==="document")r=qJ(Ui(e));else if(di(t))r=ZJ(t,n);else{const i=uI(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Cp(r)}function dI(e,t){const n=gs(e);return n===t||!di(n)||Ol(n)?!1:fi(n).position==="fixed"||dI(n,t)}function KJ(e,t){const n=t.get(e);if(n)return n;let r=qc(e,[],!1).filter(a=>di(a)&&lu(a)!=="body"),i=null;const o=fi(e).position==="fixed";let s=o?gs(e):e;for(;di(s)&&!Ol(s);){const a=fi(s),u=I1(s);!u&&a.position==="fixed"&&(i=null),(o?!u&&!i:!u&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||zd(s)&&!u&&dI(e,s))?r=r.filter(f=>f!==s):i=a,s=gs(s)}return t.set(e,r),r}function XJ(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Pm(t)?[]:KJ(t,this._c):[].concat(n),r],a=s[0],u=s.reduce((c,f)=>{const h=nT(t,f,i);return c.top=Sr(h.top,c.top),c.right=ps(h.right,c.right),c.bottom=ps(h.bottom,c.bottom),c.left=Sr(h.left,c.left),c},nT(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function QJ(e){const{width:t,height:n}=lI(e);return{width:t,height:n}}function JJ(e,t,n){const r=Fi(t),i=Ui(t),o=n==="fixed",s=ua(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const u=Di(0);if(r||!r&&!o)if((lu(t)!=="body"||zd(i))&&(a=Rm(t)),r){const p=ua(t,!0,o,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else i&&(u.x=F1(i));const c=i&&!r&&!o?cI(i,a):Di(0),f=s.left+a.scrollLeft-u.x-c.x,h=s.top+a.scrollTop-u.y-c.y;return{x:f,y:h,width:s.width,height:s.height}}function Qv(e){return fi(e).position==="static"}function rT(e,t){if(!Fi(e)||fi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ui(e)===n&&(n=n.ownerDocument.body),n}function fI(e,t){const n=Tr(e);if(Pm(e))return n;if(!Fi(e)){let i=gs(e);for(;i&&!Ol(i);){if(di(i)&&!Qv(i))return i;i=gs(i)}return n}let r=rT(e,t);for(;r&&BJ(r)&&Qv(r);)r=rT(r,t);return r&&Ol(r)&&Qv(r)&&!I1(r)?n:r||VJ(e)||n}const eee=async function(e){const t=this.getOffsetParent||fI,n=this.getDimensions,r=await n(e.floating);return{reference:JJ(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tee(e){return fi(e).direction==="rtl"}const nee={convertOffsetParentRelativeRectToViewportRelativeRect:HJ,getDocumentElement:Ui,getClippingRect:XJ,getOffsetParent:fI,getElementRects:eee,getClientRects:YJ,getDimensions:QJ,getScale:El,isElement:di,isRTL:tee};function ree(e,t){let n=null,r;const i=Ui(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),o();const{left:c,top:f,width:h,height:p}=e.getBoundingClientRect();if(a||t(),!h||!p)return;const m=Dh(f),y=Dh(i.clientWidth-(c+h)),x=Dh(i.clientHeight-(f+p)),k=Dh(c),E={rootMargin:-m+"px "+-y+"px "+-x+"px "+-k+"px",threshold:Sr(0,ps(1,u))||1};let C=!0;function N(P){const A=P[0].intersectionRatio;if(A!==u){if(!C)return s();A?s(!1,A):r=setTimeout(()=>{s(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(N,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,E)}n.observe(e)}return s(!0),o}function iee(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=L1(e),f=i||o?[...c?qc(c):[],...qc(t)]:[];f.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const h=c&&a?ree(c,n):null;let p=-1,m=null;s&&(m=new ResizeObserver(w=>{let[E]=w;E&&E.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let y,x=u?ua(e):null;u&&k();function k(){const w=ua(e);x&&(w.x!==x.x||w.y!==x.y||w.width!==x.width||w.height!==x.height)&&n(),x=w,y=requestAnimationFrame(k)}return n(),()=>{var w;f.forEach(E=>{i&&E.removeEventListener("scroll",n),o&&E.removeEventListener("resize",n)}),h==null||h(),(w=m)==null||w.disconnect(),m=null,u&&cancelAnimationFrame(y)}}const oee=LJ,see=FJ,aee=OJ,lee=$J,uee=IJ,iT=DJ,cee=zJ,dee=(e,t,n)=>{const r=new Map,i={platform:nee,...n},o={...i.platform,_c:r};return MJ(e,t,{...i,platform:o})};var Qh=typeof document<"u"?S.useLayoutEffect:S.useEffect;function _p(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_p(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!_p(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function hI(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oT(e,t){const n=hI(e);return Math.round(t*n)/n}function Jv(e){const t=S.useRef(e);return Qh(()=>{t.current=e}),t}function fee(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,h]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=S.useState(r);_p(p,r)||m(r);const[y,x]=S.useState(null),[k,w]=S.useState(null),E=S.useCallback(B=>{B!==A.current&&(A.current=B,x(B))},[]),C=S.useCallback(B=>{B!==O.current&&(O.current=B,w(B))},[]),N=o||y,P=s||k,A=S.useRef(null),O=S.useRef(null),M=S.useRef(f),j=u!=null,R=Jv(u),$=Jv(i),F=Jv(c),H=S.useCallback(()=>{if(!A.current||!O.current)return;const B={placement:t,strategy:n,middleware:p};$.current&&(B.platform=$.current),dee(A.current,O.current,B).then(W=>{const L={...W,isPositioned:F.current!==!1};I.current&&!_p(M.current,L)&&(M.current=L,tu.flushSync(()=>{h(L)}))})},[p,t,n,$,F]);Qh(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[c]);const I=S.useRef(!1);Qh(()=>(I.current=!0,()=>{I.current=!1}),[]),Qh(()=>{if(N&&(A.current=N),P&&(O.current=P),N&&P){if(R.current)return R.current(N,P,H);H()}},[N,P,H,R,j]);const q=S.useMemo(()=>({reference:A,floating:O,setReference:E,setFloating:C}),[E,C]),Y=S.useMemo(()=>({reference:N,floating:P}),[N,P]),Z=S.useMemo(()=>{const B={position:n,left:0,top:0};if(!Y.floating)return B;const W=oT(Y.floating,f.x),L=oT(Y.floating,f.y);return a?{...B,transform:"translate("+W+"px, "+L+"px)",...hI(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:L}},[n,a,Y.floating,f.x,f.y]);return S.useMemo(()=>({...f,update:H,refs:q,elements:Y,floatingStyles:Z}),[f,H,q,Y,Z])}const hee=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?iT({element:r.current,padding:i}).fn(n):{}:r?iT({element:r,padding:i}).fn(n):{}}}},pee=(e,t)=>({...oee(e),options:[e,t]}),mee=(e,t)=>({...see(e),options:[e,t]}),gee=(e,t)=>({...cee(e),options:[e,t]}),yee=(e,t)=>({...aee(e),options:[e,t]}),vee=(e,t)=>({...lee(e),options:[e,t]}),xee=(e,t)=>({...uee(e),options:[e,t]}),wee=(e,t)=>({...hee(e),options:[e,t]});var bee="Arrow",pI=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return v.jsx(Ue.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});pI.displayName=bee;var kee=pI;function mI(e){const[t,n]=S.useState(void 0);return Un(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const u=o.borderBoxSize,c=Array.isArray(u)?u[0]:u;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var z1="Popper",[gI,uu]=Yr(z1),[See,yI]=gI(z1),vI=e=>{const{__scopePopper:t,children:n}=e,[r,i]=S.useState(null);return v.jsx(See,{scope:t,anchor:r,onAnchorChange:i,children:n})};vI.displayName=z1;var xI="PopperAnchor",wI=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=yI(xI,n),s=S.useRef(null),a=pt(t,s);return S.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:v.jsx(Ue.div,{...i,ref:a})});wI.displayName=xI;var $1="PopperContent",[Eee,Cee]=gI($1),bI=S.forwardRef((e,t)=>{var ee,re,ue,he,ke,fe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:y,...x}=e,k=yI($1,n),[w,E]=S.useState(null),C=pt(t,ve=>E(ve)),[N,P]=S.useState(null),A=mI(N),O=(A==null?void 0:A.width)??0,M=(A==null?void 0:A.height)??0,j=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},$=Array.isArray(c)?c:[c],F=$.length>0,H={padding:R,boundary:$.filter(Nee),altBoundary:F},{refs:I,floatingStyles:q,placement:Y,isPositioned:Z,middlewareData:B}=fee({strategy:"fixed",placement:j,whileElementsMounted:(...ve)=>iee(...ve,{animationFrame:m==="always"}),elements:{reference:k.anchor},middleware:[pee({mainAxis:i+M,alignmentAxis:s}),u&&mee({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?gee():void 0,...H}),u&&yee({...H}),vee({...H,apply:({elements:ve,rects:Me,availableWidth:$e,availableHeight:ct})=>{const{width:_t,height:Q}=Me.reference,oe=ve.floating.style;oe.setProperty("--radix-popper-available-width",`${$e}px`),oe.setProperty("--radix-popper-available-height",`${ct}px`),oe.setProperty("--radix-popper-anchor-width",`${_t}px`),oe.setProperty("--radix-popper-anchor-height",`${Q}px`)}}),N&&wee({element:N,padding:a}),Tee({arrowWidth:O,arrowHeight:M}),p&&xee({strategy:"referenceHidden",...H})]}),[W,L]=EI(Y),U=fn(y);Un(()=>{Z&&(U==null||U())},[Z,U]);const V=(ee=B.arrow)==null?void 0:ee.x,D=(re=B.arrow)==null?void 0:re.y,G=((ue=B.arrow)==null?void 0:ue.centerOffset)!==0,[K,J]=S.useState();return Un(()=>{w&&J(window.getComputedStyle(w).zIndex)},[w]),v.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:Z?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(he=B.transformOrigin)==null?void 0:he.x,(ke=B.transformOrigin)==null?void 0:ke.y].join(" "),...((fe=B.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(Eee,{scope:n,placedSide:W,onArrowChange:P,arrowX:V,arrowY:D,shouldHideArrow:G,children:v.jsx(Ue.div,{"data-side":W,"data-align":L,...x,ref:C,style:{...x.style,animation:Z?void 0:"none"}})})})});bI.displayName=$1;var kI="PopperArrow",_ee={top:"bottom",right:"left",bottom:"top",left:"right"},SI=S.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Cee(kI,r),s=_ee[o.placedSide];return v.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:v.jsx(kee,{...i,ref:n,style:{...i.style,display:"block"}})})});SI.displayName=kI;function Nee(e){return e!==null}var Tee=e=>({name:"transformOrigin",options:e,fn(t){var k,w,E;const{placement:n,rects:r,middlewareData:i}=t,s=((k=i.arrow)==null?void 0:k.centerOffset)!==0,a=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[c,f]=EI(n),h={start:"0%",center:"50%",end:"100%"}[f],p=(((w=i.arrow)==null?void 0:w.x)??0)+a/2,m=(((E=i.arrow)==null?void 0:E.y)??0)+u/2;let y="",x="";return c==="bottom"?(y=s?h:`${p}px`,x=`${-u}px`):c==="top"?(y=s?h:`${p}px`,x=`${r.floating.height+u}px`):c==="right"?(y=`${-u}px`,x=s?h:`${m}px`):c==="left"&&(y=`${r.floating.width+u}px`,x=s?h:`${m}px`),{data:{x:y,y:x}}}});function EI(e){const[t,n="center"]=e.split("-");return[t,n]}var Mm=vI,Dm=wI,B1=bI,V1=SI,vw=["Enter"," "],Aee=["ArrowDown","PageUp","Home"],CI=["ArrowUp","PageDown","End"],Pee=[...Aee,...CI],Ree={ltr:[...vw,"ArrowRight"],rtl:[...vw,"ArrowLeft"]},Mee={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$d="Menu",[Gc,Dee,Oee]=S1($d),[ba,_I]=Yr($d,[Oee,uu,Cm]),Bd=uu(),NI=Cm(),[TI,Cs]=ba($d),[Iee,Vd]=ba($d),AI=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Bd(t),[u,c]=S.useState(null),f=S.useRef(!1),h=fn(o),p=_d(i);return S.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),v.jsx(Mm,{...a,children:v.jsx(TI,{scope:t,open:n,onOpenChange:h,content:u,onContentChange:c,children:v.jsx(Iee,{scope:t,onClose:S.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:p,modal:s,children:r})})})};AI.displayName=$d;var jee="MenuAnchor",W1=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Bd(n);return v.jsx(Dm,{...i,...r,ref:t})});W1.displayName=jee;var U1="MenuPortal",[Lee,PI]=ba(U1,{forceMount:void 0}),RI=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Cs(U1,t);return v.jsx(Lee,{scope:t,forceMount:n,children:v.jsx(tr,{present:n||o.open,children:v.jsx(Ld,{asChild:!0,container:i,children:r})})})};RI.displayName=U1;var Ur="MenuContent",[Fee,H1]=ba(Ur),MI=S.forwardRef((e,t)=>{const n=PI(Ur,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Cs(Ur,e.__scopeMenu),s=Vd(Ur,e.__scopeMenu);return v.jsx(Gc.Provider,{scope:e.__scopeMenu,children:v.jsx(tr,{present:r||o.open,children:v.jsx(Gc.Slot,{scope:e.__scopeMenu,children:s.modal?v.jsx(zee,{...i,ref:t}):v.jsx($ee,{...i,ref:t})})})})}),zee=S.forwardRef((e,t)=>{const n=Cs(Ur,e.__scopeMenu),r=S.useRef(null),i=pt(t,r);return S.useEffect(()=>{const o=r.current;if(o)return Tm(o)},[]),v.jsx(Y1,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$ee=S.forwardRef((e,t)=>{const n=Cs(Ur,e.__scopeMenu);return v.jsx(Y1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Y1=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:m,disableOutsideScroll:y,...x}=e,k=Cs(Ur,n),w=Vd(Ur,n),E=Bd(n),C=NI(n),N=Dee(n),[P,A]=S.useState(null),O=S.useRef(null),M=pt(t,O,k.onContentChange),j=S.useRef(0),R=S.useRef(""),$=S.useRef(0),F=S.useRef(null),H=S.useRef("right"),I=S.useRef(0),q=y?Fd:S.Fragment,Y=y?{as:Li,allowPinchZoom:!0}:void 0,Z=W=>{var ee,re;const L=R.current+W,U=N().filter(ue=>!ue.disabled),V=document.activeElement,D=(ee=U.find(ue=>ue.ref.current===V))==null?void 0:ee.textValue,G=U.map(ue=>ue.textValue),K=Qee(G,L,D),J=(re=U.find(ue=>ue.textValue===K))==null?void 0:re.ref.current;(function ue(he){R.current=he,window.clearTimeout(j.current),he!==""&&(j.current=window.setTimeout(()=>ue(""),1e3))})(L),J&&setTimeout(()=>J.focus())};S.useEffect(()=>()=>window.clearTimeout(j.current),[]),_m();const B=S.useCallback(W=>{var U,V;return H.current===((U=F.current)==null?void 0:U.side)&&ete(W,(V=F.current)==null?void 0:V.area)},[]);return v.jsx(Fee,{scope:n,searchRef:R,onItemEnter:S.useCallback(W=>{B(W)&&W.preventDefault()},[B]),onItemLeave:S.useCallback(W=>{var L;B(W)||((L=O.current)==null||L.focus(),A(null))},[B]),onTriggerLeave:S.useCallback(W=>{B(W)&&W.preventDefault()},[B]),pointerGraceTimerRef:$,onPointerGraceIntentChange:S.useCallback(W=>{F.current=W},[]),children:v.jsx(q,{...Y,children:v.jsx(jd,{asChild:!0,trapped:i,onMountAutoFocus:Re(o,W=>{var L;W.preventDefault(),(L=O.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:v.jsx(Id,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:m,children:v.jsx(jD,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:A,onEntryFocus:Re(u,W=>{w.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(B1,{role:"menu","aria-orientation":"vertical","data-state":ZI(k.open),"data-radix-menu-content":"",dir:w.dir,...E,...x,ref:M,style:{outline:"none",...x.style},onKeyDown:Re(x.onKeyDown,W=>{const U=W.target.closest("[data-radix-menu-content]")===W.currentTarget,V=W.ctrlKey||W.altKey||W.metaKey,D=W.key.length===1;U&&(W.key==="Tab"&&W.preventDefault(),!V&&D&&Z(W.key));const G=O.current;if(W.target!==G||!Pee.includes(W.key))return;W.preventDefault();const J=N().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);CI.includes(W.key)&&J.reverse(),Kee(J)}),onBlur:Re(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(j.current),R.current="")}),onPointerMove:Re(e.onPointerMove,Zc(W=>{const L=W.target,U=I.current!==W.clientX;if(W.currentTarget.contains(L)&&U){const V=W.clientX>I.current?"right":"left";H.current=V,I.current=W.clientX}}))})})})})})})});MI.displayName=Ur;var Bee="MenuGroup",q1=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(Ue.div,{role:"group",...r,ref:t})});q1.displayName=Bee;var Vee="MenuLabel",DI=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(Ue.div,{...r,ref:t})});DI.displayName=Vee;var Np="MenuItem",sT="menu.itemSelect",Om=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=S.useRef(null),s=Vd(Np,e.__scopeMenu),a=H1(Np,e.__scopeMenu),u=pt(t,o),c=S.useRef(!1),f=()=>{const h=o.current;if(!n&&h){const p=new CustomEvent(sT,{bubbles:!0,cancelable:!0});h.addEventListener(sT,m=>r==null?void 0:r(m),{once:!0}),yR(h,p),p.defaultPrevented?c.current=!1:s.onClose()}};return v.jsx(OI,{...i,ref:u,disabled:n,onClick:Re(e.onClick,f),onPointerDown:h=>{var p;(p=e.onPointerDown)==null||p.call(e,h),c.current=!0},onPointerUp:Re(e.onPointerUp,h=>{var p;c.current||(p=h.currentTarget)==null||p.click()}),onKeyDown:Re(e.onKeyDown,h=>{const p=a.searchRef.current!=="";n||p&&h.key===" "||vw.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Om.displayName=Np;var OI=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=H1(Np,n),a=NI(n),u=S.useRef(null),c=pt(t,u),[f,h]=S.useState(!1),[p,m]=S.useState("");return S.useEffect(()=>{const y=u.current;y&&m((y.textContent??"").trim())},[o.children]),v.jsx(Gc.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:v.jsx(LD,{asChild:!0,...a,focusable:!r,children:v.jsx(Ue.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Re(e.onPointerMove,Zc(y=>{r?s.onItemLeave(y):(s.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Zc(y=>s.onItemLeave(y))),onFocus:Re(e.onFocus,()=>h(!0)),onBlur:Re(e.onBlur,()=>h(!1))})})})}),Wee="MenuCheckboxItem",II=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return v.jsx($I,{scope:e.__scopeMenu,checked:n,children:v.jsx(Om,{role:"menuitemcheckbox","aria-checked":Tp(n)?"mixed":n,...i,ref:t,"data-state":K1(n),onSelect:Re(i.onSelect,()=>r==null?void 0:r(Tp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});II.displayName=Wee;var jI="MenuRadioGroup",[Uee,Hee]=ba(jI,{value:void 0,onValueChange:()=>{}}),LI=S.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=fn(r);return v.jsx(Uee,{scope:e.__scopeMenu,value:n,onValueChange:o,children:v.jsx(q1,{...i,ref:t})})});LI.displayName=jI;var FI="MenuRadioItem",zI=S.forwardRef((e,t)=>{const{value:n,...r}=e,i=Hee(FI,e.__scopeMenu),o=n===i.value;return v.jsx($I,{scope:e.__scopeMenu,checked:o,children:v.jsx(Om,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":K1(o),onSelect:Re(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});zI.displayName=FI;var G1="MenuItemIndicator",[$I,Yee]=ba(G1,{checked:!1}),BI=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=Yee(G1,n);return v.jsx(tr,{present:r||Tp(o.checked)||o.checked===!0,children:v.jsx(Ue.span,{...i,ref:t,"data-state":K1(o.checked)})})});BI.displayName=G1;var qee="MenuSeparator",VI=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(Ue.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});VI.displayName=qee;var Gee="MenuArrow",WI=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Bd(n);return v.jsx(V1,{...i,...r,ref:t})});WI.displayName=Gee;var Z1="MenuSub",[Zee,UI]=ba(Z1),HI=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,o=Cs(Z1,t),s=Bd(t),[a,u]=S.useState(null),[c,f]=S.useState(null),h=fn(i);return S.useEffect(()=>(o.open===!1&&h(!1),()=>h(!1)),[o.open,h]),v.jsx(Mm,{...s,children:v.jsx(TI,{scope:t,open:r,onOpenChange:h,content:c,onContentChange:f,children:v.jsx(Zee,{scope:t,contentId:En(),triggerId:En(),trigger:a,onTriggerChange:u,children:n})})})};HI.displayName=Z1;var pc="MenuSubTrigger",YI=S.forwardRef((e,t)=>{const n=Cs(pc,e.__scopeMenu),r=Vd(pc,e.__scopeMenu),i=UI(pc,e.__scopeMenu),o=H1(pc,e.__scopeMenu),s=S.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=o,c={__scopeMenu:e.__scopeMenu},f=S.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return S.useEffect(()=>f,[f]),S.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),u(null)}},[a,u]),v.jsx(W1,{asChild:!0,...c,children:v.jsx(OI,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":ZI(n.open),...e,ref:sm(t,i.onTriggerChange),onClick:h=>{var p;(p=e.onClick)==null||p.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,Zc(h=>{o.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Re(e.onPointerLeave,Zc(h=>{var m,y;f();const p=(m=n.content)==null?void 0:m.getBoundingClientRect();if(p){const x=(y=n.content)==null?void 0:y.dataset.side,k=x==="right",w=k?-5:5,E=p[k?"left":"right"],C=p[k?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+w,y:h.clientY},{x:E,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:E,y:p.bottom}],side:x}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,h=>{var m;const p=o.searchRef.current!=="";e.disabled||p&&h.key===" "||Ree[r.dir].includes(h.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),h.preventDefault())})})})});YI.displayName=pc;var qI="MenuSubContent",GI=S.forwardRef((e,t)=>{const n=PI(Ur,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Cs(Ur,e.__scopeMenu),s=Vd(Ur,e.__scopeMenu),a=UI(qI,e.__scopeMenu),u=S.useRef(null),c=pt(t,u);return v.jsx(Gc.Provider,{scope:e.__scopeMenu,children:v.jsx(tr,{present:r||o.open,children:v.jsx(Gc.Slot,{scope:e.__scopeMenu,children:v.jsx(Y1,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;s.isUsingKeyboardRef.current&&((h=u.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Re(e.onFocusOutside,f=>{f.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,f=>{s.onClose(),f.preventDefault()}),onKeyDown:Re(e.onKeyDown,f=>{var m;const h=f.currentTarget.contains(f.target),p=Mee[s.dir].includes(f.key);h&&p&&(o.onOpenChange(!1),(m=a.trigger)==null||m.focus(),f.preventDefault())})})})})})});GI.displayName=qI;function ZI(e){return e?"open":"closed"}function Tp(e){return e==="indeterminate"}function K1(e){return Tp(e)?"indeterminate":e?"checked":"unchecked"}function Kee(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Xee(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Qee(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Xee(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function Jee(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,u=t[o].y,c=t[s].x,f=t[s].y;u>r!=f>r&&n<(c-a)*(r-u)/(f-u)+a&&(i=!i)}return i}function ete(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Jee(n,t)}function Zc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var tte=AI,nte=W1,rte=RI,ite=MI,ote=q1,ste=DI,ate=Om,lte=II,ute=LI,cte=zI,dte=BI,fte=VI,hte=WI,pte=HI,mte=YI,gte=GI,X1="DropdownMenu",[yte,Sve]=Yr(X1,[_I]),qn=_I(),[vte,KI]=yte(X1),XI=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,u=qn(t),c=S.useRef(null),[f=!1,h]=wo({prop:i,defaultProp:o,onChange:s});return v.jsx(vte,{scope:t,triggerId:En(),triggerRef:c,contentId:En(),open:f,onOpenChange:h,onOpenToggle:S.useCallback(()=>h(p=>!p),[h]),modal:a,children:v.jsx(tte,{...u,open:f,onOpenChange:h,dir:r,modal:a,children:n})})};XI.displayName=X1;var QI="DropdownMenuTrigger",JI=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=KI(QI,n),s=qn(n);return v.jsx(nte,{asChild:!0,...s,children:v.jsx(Ue.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:sm(t,o.triggerRef),onPointerDown:Re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});JI.displayName=QI;var xte="DropdownMenuPortal",ej=e=>{const{__scopeDropdownMenu:t,...n}=e,r=qn(t);return v.jsx(rte,{...r,...n})};ej.displayName=xte;var tj="DropdownMenuContent",nj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=KI(tj,n),o=qn(n),s=S.useRef(!1);return v.jsx(ite,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{var u;s.current||(u=i.triggerRef.current)==null||u.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;(!i.modal||f)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nj.displayName=tj;var wte="DropdownMenuGroup",rj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(ote,{...i,...r,ref:t})});rj.displayName=wte;var bte="DropdownMenuLabel",ij=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(ste,{...i,...r,ref:t})});ij.displayName=bte;var kte="DropdownMenuItem",oj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(ate,{...i,...r,ref:t})});oj.displayName=kte;var Ste="DropdownMenuCheckboxItem",sj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(lte,{...i,...r,ref:t})});sj.displayName=Ste;var Ete="DropdownMenuRadioGroup",aj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(ute,{...i,...r,ref:t})});aj.displayName=Ete;var Cte="DropdownMenuRadioItem",lj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(cte,{...i,...r,ref:t})});lj.displayName=Cte;var _te="DropdownMenuItemIndicator",uj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(dte,{...i,...r,ref:t})});uj.displayName=_te;var Nte="DropdownMenuSeparator",cj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(fte,{...i,...r,ref:t})});cj.displayName=Nte;var Tte="DropdownMenuArrow",Ate=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(hte,{...i,...r,ref:t})});Ate.displayName=Tte;var Pte=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:o}=e,s=qn(t),[a=!1,u]=wo({prop:r,defaultProp:o,onChange:i});return v.jsx(pte,{...s,open:a,onOpenChange:u,children:n})},Rte="DropdownMenuSubTrigger",dj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(mte,{...i,...r,ref:t})});dj.displayName=Rte;var Mte="DropdownMenuSubContent",fj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(gte,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fj.displayName=Mte;var Dte=XI,hj=JI,pj=ej,mj=nj,Ote=rj,gj=ij,yj=oj,vj=sj,Ite=aj,xj=lj,wj=uj,bj=cj,jte=Pte,kj=dj,Sj=fj;function il(e,t,n){let r=n.initialDeps??[],i;return()=>{var o,s,a,u;let c;n.key&&((o=n.debug)!=null&&o.call(n))&&(c=Date.now());const f=e();if(!(f.length!==r.length||f.some((m,y)=>r[y]!==m)))return i;r=f;let p;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(p=Date.now()),i=t(...f),n.key&&((a=n.debug)!=null&&a.call(n))){const m=Math.round((Date.now()-c)*100)/100,y=Math.round((Date.now()-p)*100)/100,x=y/16,k=(w,E)=>{for(w=String(w);w.length<E;)w=" "+w;return w};console.info(`%c⏱ ${k(y,5)} /${k(m,5)} ms`,`
|
|
288
|
+
font-size: .6rem;
|
|
289
|
+
font-weight: bold;
|
|
290
|
+
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(u=n==null?void 0:n.onChange)==null||u.call(n,i),i}}function ex(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Lte=(e,t)=>Math.abs(e-t)<1,Fte=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},zte=e=>e,$te=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},Bte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=s=>{const{width:a,height:u}=s;t({width:Math.round(a),height:Math.round(u)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const u=a.borderBoxSize[0];if(u){i({width:u.inlineSize,height:u.blockSize});return}}i(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},aT={passive:!0},Vte=typeof window>"u"?!0:"onscrollend"in window,Wte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=e.options.useScrollendEvent&&Vte?()=>{}:Fte(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),s=c=>()=>{const{horizontal:f,isRtl:h}=e.options;i=f?n.scrollLeft*(h&&-1||1):n.scrollTop,o(),t(i,c)},a=s(!0),u=s(!1);return u(),n.addEventListener("scroll",a,aT),n.addEventListener("scrollend",u,aT),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",u)}},Ute=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},Hte=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const s=e+t;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class Yte{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{this._measureElement(o.target,o)})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:zte,rangeExtractor:$te,onChange:()=>{},measureElement:Ute,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=il(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,o=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(i.has(a.lane))continue;const u=o.get(a.lane);if(u==null||a.end>u.end?o.set(a.lane,a):a.end<u.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=il(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,i,o,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s}),{key:!1}),this.getMeasurements=il(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,u);for(let f=u;f<n;f++){const h=o(f),p=this.options.lanes===1?c[f-1]:this.getFurthestMeasurement(c,f),m=p?p.end+this.options.gap:r+i,y=a.get(h),x=typeof y=="number"?y:this.options.estimateSize(f),k=m+x,w=p?p.lane:f%this.options.lanes;c[f]={index:f,start:m,size:x,end:k,key:h,lane:w}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=il(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,i)=>this.range=n.length>0&&r>0?qte({measurements:n,outerSize:r,scrollOffset:i}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=il(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,i,o)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:i,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),o=this.measurementsCache[i];if(!o)return;const s=o.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const o=this.itemSizeCache.get(i.key)??i.size,s=r-o;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,s,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=il(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let o=0,s=n.length;o<s;o++){const a=n[o],u=r[a];i.push(u)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return ex(r[Ej(0,r.length-1,i=>ex(r[i]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&n>=o+i&&(r="end"),r==="end"&&(n-=i);const s=this.options.horizontal?"scrollWidth":"scrollHeight",u=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-i;return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const o=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(i.end>=s+o-this.options.scrollPaddingEnd)r="end";else if(i.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=i.start-this.options.scrollPaddingStart+(i.size-o)/2;switch(r){case"center":return[this.getOffsetForAlignment(a,r),r];case"end":return[this.getOffsetForAlignment(i.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(i.start-this.options.scrollPaddingStart,r),r]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(n,r);if(!o)return;const[s,a]=o;this._scrollToOffset(s,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=ex(this.getOffsetForIndex(n,a));Lte(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:i})}else this.scrollToIndex(n,{align:a,behavior:i})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;return r.length===0?i=this.options.paddingStart:i=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(o=>o.end)),Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Ej=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(o<r)e=i+1;else if(o>r)t=i-1;else return i}return e>0?e-1:0};function qte({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,o=Ej(0,r,a=>e[a].start,n);let s=o;for(;s<r&&e[s].end<n+t;)s++;return{startIndex:o,endIndex:s}}const lT=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Gte(e){const t=S.useReducer(()=>({}),{})[1],n={...e,onChange:(i,o)=>{var s;o?tu.flushSync(t):t(),(s=e.onChange)==null||s.call(e,i,o)}},[r]=S.useState(()=>new Yte(n));return r.setOptions(n),lT(()=>r._didMount(),[]),lT(()=>r._willUpdate()),r}function Zte(e){return Gte({observeElementRect:Bte,observeElementOffset:Wte,scrollToFn:Hte,...e})}const Kte=Dte,Xte=Ote,Qte=pj,Jte=jte,ene=Ite,Cj=S.forwardRef(({className:e,inset:t,children:n,...r},i)=>v.jsx(hj,{ref:i,className:Te("focus-visible:ring-ring focus:outline-none focus-visible:rounded focus-visible:outline-none focus-visible:ring-1",e),...r,children:n}));Cj.displayName=hj.displayName;const _j=S.forwardRef(({className:e,inset:t,children:n,...r},i)=>v.jsxs(kj,{ref:i,className:Te("focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",t&&"pl-8",e),...r,children:[n,v.jsx(cb,{className:"ml-auto -rotate-90"})]}));_j.displayName=kj.displayName;const Nj=S.forwardRef(({className:e,...t},n)=>v.jsx(Sj,{ref:n,className:Te("popover-backdrop-filter popover-background popover-border popover-shadow popover-foreground data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-[8rem] overflow-auto overflow-x-hidden rounded-md p-1",e),...t}));Nj.displayName=Sj.displayName;const Tj=S.forwardRef(({className:e,container:t,sideOffset:n=4,...r},i)=>v.jsx(pj,{container:t,children:v.jsx(mj,{ref:i,sideOffset:n,className:Te("popover-backdrop-filter bg-mastra-bg-2 popover-border popover-shadow popover-foreground data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-[8rem] overflow-auto overflow-x-hidden rounded-md p-1",e),...r})}));Tj.displayName=mj.displayName;const Aj=S.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(yj,{ref:r,className:Te("focus:text-accent-foreground relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-[0.8125rem] outline-none transition-colors focus:bg-[#66686A]/20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>span]:truncate",t&&"pl-8",e),...n}));Aj.displayName=yj.displayName;const Pj=S.forwardRef(({className:e,children:t,checked:n,...r},i)=>v.jsxs(vj,{ref:i,className:Te("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(wj,{children:v.jsx(ub,{className:"h-2 w-2 fill-current"})})}),t]}));Pj.displayName=vj.displayName;const Rj=S.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(xj,{ref:r,className:Te("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(wj,{children:v.jsx(zB,{className:"h-2 w-2 fill-current"})})}),t]}));Rj.displayName=xj.displayName;const Mj=S.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(gj,{ref:r,className:Te("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Mj.displayName=gj.displayName;const Dj=S.forwardRef(({className:e,...t},n)=>v.jsx(bj,{ref:n,className:Te("popover-dividers-bg -mx-1 my-1 h-px",e),...t}));Dj.displayName=bj.displayName;const Oj=({className:e,...t})=>v.jsx("span",{className:Te("ml-auto text-xs tracking-widest opacity-60",e),...t});Oj.displayName="DropdownMenuShortcut";function Sn({open:e,onOpenChange:t,children:n,modal:r}){return v.jsx(Kte,{modal:r,open:e,onOpenChange:t,children:n})}function tne({itemsCount:e,items:t,renderItem:n,...r}){const i=S.useRef(null),o=Zte({count:e,estimateSize:()=>35,getScrollElement:()=>i.current,overscan:5,measureElement:typeof window<"u"&&navigator.userAgent.indexOf("Firefox")===-1?s=>s==null?void 0:s.getBoundingClientRect().height:void 0});return v.jsx("div",{ref:i,className:"h-64 overflow-auto",children:v.jsx("div",{className:"relative w-full overflow-auto",style:{height:`${o.getTotalSize()}px`},children:o==null?void 0:o.getVirtualItems().map((s,a)=>v.jsx("button",{className:"text-accent-foreground absolute left-0 top-0 flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-[0.8125rem] outline-none transition-colors hover:bg-[#66686A]/20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>span]:truncate",style:{height:`${s.size}px`,transform:`translateY(${s.start}px)`},...r,children:n(t[a])},s.index))})})}Sn.Trigger=Cj;Sn.Content=Tj;Sn.Group=Xte;Sn.Portal=Qte;Sn.Item=Aj;Sn.CheckboxItem=Pj;Sn.RadioItem=Rj;Sn.Label=Mj;Sn.Separator=Dj;Sn.Shortcut=Oj;Sn.Sub=Jte;Sn.SubContent=Nj;Sn.SubTrigger=_j;Sn.RadioGroup=ene;Sn.VirtualizedItems=tne;const nne=()=>{const{data:e,isLoading:t,mutate:n}=Sb("/api/memory/status",fb,{fallbackData:{result:!1}});return{memory:e,isLoading:t,mutate:n}},rne=({resourceid:e})=>{const{data:t,isLoading:n,mutate:r}=Sb(`/api/memory/threads?resourceid=${e}`,fb,{fallbackData:[],isPaused:()=>!e,revalidateOnFocus:!1});return S.useEffect(()=>{e&&r()},[e]),{threads:t,isLoading:n,mutate:r}},ine=({threadId:e,memory:t})=>{const{data:n,isLoading:r,mutate:i}=Sb(`/api/memory/threads/${e}/messages`,o=>fb(o,!0),{fallbackData:{uiMessages:[],messages:[]},revalidateOnFocus:!1,shouldRetryOnError:!1});return S.useEffect(()=>{e&&t&&i()},[e,t]),{messages:n==null?void 0:n.uiMessages,isLoading:r,mutate:i}},one=()=>{const{mutate:e}=kb();return{deleteThread:async({threadId:n,resourceid:r})=>{const i=fetch(`/api/memory/threads/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}});mn.promise(i,{loading:"Deleting chat...",success:()=>(e(`/api/memory/threads?resourceid=${r}`),"Chat deleted successfully"),error:"Failed to delete chat"})}}};function sne({agentId:e,threadId:t}){const{threads:n,isLoading:r}=rne({resourceid:e}),{deleteThread:i}=one(),o=ks(),[s,a]=S.useState(null),[u,c]=S.useState(!1),f=async()=>{await i({threadId:s,resourceid:e}),c(!1),s===t&&o(`/agents/${e}`)};return r?v.jsxs("div",{className:"p-4 w-full h-full space-y-2",children:[v.jsx("div",{className:"flex justify-end",children:v.jsx(Je,{className:"h-9 w-9"})}),v.jsx(Je,{className:"h-4"}),v.jsx(Je,{className:"h-4"}),v.jsx(Je,{className:"h-4"}),v.jsx(Je,{className:"h-4"}),v.jsx(Je,{className:"h-4"})]}):n!=null&&n.length?v.jsxs(fr,{className:"h-full p-4 w-[256px]",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex justify-between items-center pl-2",children:[v.jsx("div",{className:"text-sm text-mastra-el-5",children:"Chat history"}),v.jsx(Bt,{variant:"primary",size:"icon",onClick:()=>o(`/agents/${e}`),children:v.jsx(jc,{})})]}),n.map(h=>{const p=h.id===t;return v.jsxs("div",{className:Te("flex cursor-pointer w-full px-2 items-center focus-visible:outline-none transition-colors focus-visible:ring-1 focus-visible:ring-mastra-border-4 gap-3 rounded-xs group text-small hover:bg-mastra-el-6/5",p?"bg-mastra-el-6/5":""),children:[v.jsx(Cd,{to:`/agents/${e}/${h.id}`,className:"flex-1",children:v.jsx("p",{className:Te("py-[0.38rem] text-mastra-el-6/60 group-hover:text-mastra-el-6 transition-all capitalize ",p?"text-mastra-el-6":""),children:h.title})}),v.jsxs(Sn,{children:[v.jsx(Sn.Trigger,{asChild:!0,children:v.jsxs(Bt,{variant:"ghost",size:"icon",className:"ml-auto",children:[v.jsx(VB,{}),v.jsx("span",{className:"sr-only",children:"More"})]})}),v.jsx(Sn.Content,{children:v.jsxs(Sn.Item,{className:"cursor-pointer text-destructive focus:bg-destructive/15 focus:text-destructive dark:text-red-500",onSelect:()=>{a(h.id),c(!0)},children:[v.jsx(ZB,{}),v.jsx("span",{children:"Delete"})]})})]})]},h.id)})]}),v.jsx(An,{open:u,onOpenChange:c,children:v.jsxs(An.Content,{children:[v.jsxs(An.Header,{children:[v.jsx(An.Title,{children:"Are you absolutely sure?"}),v.jsx(An.Description,{children:"This action cannot be undone. This will permanently delete your chat and remove it from our servers."})]}),v.jsxs(An.Footer,{children:[v.jsx(An.Cancel,{children:"Cancel"}),v.jsx(An.Action,{onClick:f,children:"Continue"})]})]})})]}):v.jsxs("div",{className:"p-4 w-full space-y-2 h-full",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsx("div",{className:"text-sm text-mastra-el-5",children:"Chat history"}),v.jsx(Bt,{variant:"primary",size:"icon",onClick:()=>o(`/agents/${e}`),children:v.jsx(jc,{})})]}),v.jsx("div",{className:"text-small text-mastra-el-3",children:"Your conversations will appear here once you start chatting!"})]})}function uT(){const{agentId:e,threadId:t}=nm(),{agent:n,isLoading:r}=om(e),{memory:i}=nne(),o=ks(),{messages:s,isLoading:a}=ine({threadId:t,memory:!!(i!=null&&i.result)}),[u,c]=S.useState(!0);if(S.useEffect(()=>{i!=null&&i.result&&!t&&o(`/agents/${e}/${crypto.randomUUID()}`)},[i==null?void 0:i.result,t]),r)return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsx(Cr,{title:v.jsx(Je,{className:"h-6 w-[200px]"})}),v.jsxs("main",{className:"flex-1 relative grid grid-cols-[256px_1fr_400px] divide-x",children:[v.jsx("div",{className:"p-4",children:v.jsx(Je,{className:"h-[600px]"})}),v.jsx("div",{className:"p-4",children:v.jsx(Je,{className:"h-[600px]"})}),v.jsx("div",{className:"flex flex-col",children:v.jsx(zN,{agentId:e})})]})]});const f=[{label:"Agents",href:"/agents"},{label:n==null?void 0:n.name,href:`/agents/${e}`,isCurrent:!0}];return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsx(Cr,{title:v.jsx(Sm,{items:f})}),v.jsxs("main",{className:Te("flex-1 relative grid divide-x",u&&(i!=null&&i.result)?"grid-cols-[256px_1fr_400px]":"grid-cols-[1fr_400px]"),children:[u&&(i!=null&&i.result)?v.jsx(sne,{agentId:e,threadId:t}):null,v.jsxs("div",{className:"relative",children:[i!=null&&i.result?v.jsx(Bt,{variant:"primary",size:"icon",className:"absolute top-4 left-4 z-50",onClick:()=>c(!u),children:v.jsx(YB,{})}):null,v.jsx(MX,{agentId:e,agentName:n==null?void 0:n.name,threadId:t,initialMessages:a?void 0:s,memory:i==null?void 0:i.result})]}),v.jsx("div",{className:"flex flex-col",children:v.jsx(zN,{agentId:e})})]})]})}const Ij=(e,t)=>e.anyOf.length?e.anyOf.length===1?Pn(e.anyOf[0],{...t,path:[...t.path,"anyOf",0]}):`z.union([${e.anyOf.map((n,r)=>Pn(n,{...t,path:[...t.path,"anyOf",r]})).join(", ")}])`:"z.any()",ane=e=>"z.boolean()",lne=e=>"z.any()",une=(e,t)=>`z.union([${e.type.map(n=>Pn({...e,type:n},t)).join(", ")}])`,cne=(e,t)=>`z.any().refine((value) => !${Pn(e.not,{...t,path:[...t.path,"not"]})}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,dne=e=>"z.null()",fne=e=>[e.slice(0,e.length/2),e.slice(e.length/2)],mc=Symbol("Original index"),hne=e=>{let t=[];for(let n=0;n<e.length;n++){const r=e[n];if(typeof r=="boolean")t.push(r?{[mc]:n}:{[mc]:n,not:{}});else{if(mc in r)return e;t.push({...r,[mc]:n})}}return t};function Ap(e,t){if(e.allOf.length===0)return"z.never()";if(e.allOf.length===1){const n=e.allOf[0];return Pn(n,{...t,path:[...t.path,"allOf",n[mc]]})}else{const[n,r]=fne(hne(e.allOf));return`z.intersection(${Ap({allOf:n},t)}, ${Ap({allOf:r},t)})`}}function Tn(e,t,n){var o;const r=e[t];let i="";if(r!==void 0){const s=n({value:r,json:JSON.stringify(r)});if(s){const a=s[0],u=s.length===3?s[1]:"",c=s.length===3?s[2]:s[1];i+=a,((o=e.errorMessage)==null?void 0:o[t])!==void 0&&(i+=u+JSON.stringify(e.errorMessage[t])),i+=c}}return i}const pne=(e,t)=>{if(Array.isArray(e.items))return`z.tuple([${e.items.map((r,i)=>Pn(r,{...t,path:[...t.path,"items",i]}))}])`;let n=e.items?`z.array(${Pn(e.items,{...t,path:[...t.path,"items"]})})`:"z.array(z.any())";return n+=Tn(e,"minItems",({json:r})=>[`.min(${r}`,", ",")"]),n+=Tn(e,"maxItems",({json:r})=>[`.max(${r}`,", ",")"]),n},mne=e=>`z.literal(${JSON.stringify(e.const)})`,gne=e=>e.enum.length===0?"z.never()":e.enum.length===1?`z.literal(${JSON.stringify(e.enum[0])})`:e.enum.every(t=>typeof t=="string")?`z.enum([${e.enum.map(t=>JSON.stringify(t))}])`:`z.union([${e.enum.map(t=>`z.literal(${JSON.stringify(t)})`).join(", ")}])`,yne=(e,t)=>{const n=Pn(e.if,{...t,path:[...t.path,"if"]}),r=Pn(e.then,{...t,path:[...t.path,"then"]}),i=Pn(e.else,{...t,path:[...t.path,"else"]});return`z.union([${r}, ${i}]).superRefine((value,ctx) => {
|
|
291
|
+
const result = ${n}.safeParse(value).success
|
|
292
|
+
? ${r}.safeParse(value)
|
|
293
|
+
: ${i}.safeParse(value);
|
|
294
|
+
if (!result.success) {
|
|
295
|
+
result.error.errors.forEach((error) => ctx.addIssue(error))
|
|
296
|
+
}
|
|
297
|
+
})`},vne=e=>{let t="z.number()";return e.type==="integer"?t+=Tn(e,"type",()=>[".int(",")"]):t+=Tn(e,"format",({value:n})=>{if(n==="int64")return[".int(",")"]}),t+=Tn(e,"multipleOf",({value:n,json:r})=>n===1?t.startsWith("z.number().int(")?void 0:[".int(",")"]:[`.multipleOf(${r}`,", ",")"]),typeof e.minimum=="number"?e.exclusiveMinimum===!0?t+=Tn(e,"minimum",({json:n})=>[`.gt(${n}`,", ",")"]):t+=Tn(e,"minimum",({json:n})=>[`.gte(${n}`,", ",")"]):typeof e.exclusiveMinimum=="number"&&(t+=Tn(e,"exclusiveMinimum",({json:n})=>[`.gt(${n}`,", ",")"])),typeof e.maximum=="number"?e.exclusiveMaximum===!0?t+=Tn(e,"maximum",({json:n})=>[`.lt(${n}`,", ",")"]):t+=Tn(e,"maximum",({json:n})=>[`.lte(${n}`,", ",")"]):typeof e.exclusiveMaximum=="number"&&(t+=Tn(e,"exclusiveMaximum",({json:n})=>[`.lt(${n}`,", ",")"])),t},jj=(e,t)=>e.oneOf.length?e.oneOf.length===1?Pn(e.oneOf[0],{...t,path:[...t.path,"oneOf",0]}):`z.any().superRefine((x, ctx) => {
|
|
298
|
+
const schemas = [${e.oneOf.map((n,r)=>Pn(n,{...t,path:[...t.path,"oneOf",r]})).join(", ")}];
|
|
299
|
+
const errors = schemas.reduce<z.ZodError[]>(
|
|
300
|
+
(errors, schema) =>
|
|
301
|
+
((result) =>
|
|
302
|
+
result.error ? [...errors, result.error] : errors)(
|
|
303
|
+
schema.safeParse(x),
|
|
304
|
+
),
|
|
305
|
+
[],
|
|
306
|
+
);
|
|
307
|
+
if (schemas.length - errors.length !== 1) {
|
|
308
|
+
ctx.addIssue({
|
|
309
|
+
path: ctx.path,
|
|
310
|
+
code: "invalid_union",
|
|
311
|
+
unionErrors: errors,
|
|
312
|
+
message: "Invalid input: Should pass single schema",
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
})`:"z.any()";function xne(e,t){let n;e.properties&&(Object.keys(e.properties).length?(n="z.object({ ",n+=Object.keys(e.properties).map(s=>{const a=e.properties[s],u=`${JSON.stringify(s)}: ${Pn(a,{...t,path:[...t.path,"properties",s]})}`,c=typeof a=="object"&&a.default!==void 0,f=Array.isArray(e.required)?e.required.includes(s):typeof a=="object"&&a.required===!0;return!c&&!f?`${u}.optional()`:u}).join(", "),n+=" })"):n="z.object({})");const r=e.additionalProperties!==void 0?Pn(e.additionalProperties,{...t,path:[...t.path,"additionalProperties"]}):void 0;let i;if(e.patternProperties){const s=Object.fromEntries(Object.entries(e.patternProperties).map(([a,u])=>[a,Pn(u,{...t,path:[...t.path,"patternProperties",a]})],{}));i="",n?r?i+=`.catchall(z.union([${[...Object.values(s),r].join(", ")}]))`:Object.keys(s).length>1?i+=`.catchall(z.union([${Object.values(s).join(", ")}]))`:i+=`.catchall(${Object.values(s)})`:r?i+=`z.record(z.union([${[...Object.values(s),r].join(", ")}]))`:Object.keys(s).length>1?i+=`z.record(z.union([${Object.values(s).join(", ")}]))`:i+=`z.record(${Object.values(s)})`,i+=`.superRefine((value, ctx) => {
|
|
316
|
+
`,i+=`for (const key in value) {
|
|
317
|
+
`,r&&(e.properties?i+=`let evaluated = [${Object.keys(e.properties).map(a=>JSON.stringify(a)).join(", ")}].includes(key)
|
|
318
|
+
`:i+=`let evaluated = false
|
|
319
|
+
`);for(const a in e.patternProperties)i+="if (key.match(new RegExp("+JSON.stringify(a)+`))) {
|
|
320
|
+
`,r&&(i+=`evaluated = true
|
|
321
|
+
`),i+="const result = "+s[a]+`.safeParse(value[key])
|
|
322
|
+
`,i+=`if (!result.success) {
|
|
323
|
+
`,i+=`ctx.addIssue({
|
|
324
|
+
path: [...ctx.path, key],
|
|
325
|
+
code: 'custom',
|
|
326
|
+
message: \`Invalid input: Key matching regex /\${key}/ must match schema\`,
|
|
327
|
+
params: {
|
|
328
|
+
issues: result.error.issues
|
|
329
|
+
}
|
|
330
|
+
})
|
|
331
|
+
`,i+=`}
|
|
332
|
+
`,i+=`}
|
|
333
|
+
`;r&&(i+=`if (!evaluated) {
|
|
334
|
+
`,i+="const result = "+r+`.safeParse(value[key])
|
|
335
|
+
`,i+=`if (!result.success) {
|
|
336
|
+
`,i+=`ctx.addIssue({
|
|
337
|
+
path: [...ctx.path, key],
|
|
338
|
+
code: 'custom',
|
|
339
|
+
message: \`Invalid input: must match catchall schema\`,
|
|
340
|
+
params: {
|
|
341
|
+
issues: result.error.issues
|
|
342
|
+
}
|
|
343
|
+
})
|
|
344
|
+
`,i+=`}
|
|
345
|
+
`,i+=`}
|
|
346
|
+
`),i+=`}
|
|
347
|
+
`,i+="})"}let o=n?i?n+i:r?r==="z.never()"?n+".strict()":n+`.catchall(${r})`:n:i||(r?`z.record(${r})`:"z.record(z.any())");return bn.an.anyOf(e)&&(o+=`.and(${Ij({...e,anyOf:e.anyOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?{...s,type:"object"}:s)},t)})`),bn.a.oneOf(e)&&(o+=`.and(${jj({...e,oneOf:e.oneOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?{...s,type:"object"}:s)},t)})`),bn.an.allOf(e)&&(o+=`.and(${Ap({...e,allOf:e.allOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?{...s,type:"object"}:s)},t)})`),o}const wne=e=>{let t="z.string()";t+=Tn(e,"format",({value:r})=>{switch(r){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime({ offset: true",", message: "," })"];case"time":return[".time(",")"];case"date":return[".date(",")"];case"binary":return[".base64(",")"];case"duration":return[".duration(",")"]}}),t+=Tn(e,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),t+=Tn(e,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),t+=Tn(e,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),t+=Tn(e,"contentEncoding",({value:r})=>{if(r==="base64")return[".base64(",")"]});const n=Tn(e,"contentMediaType",({value:r})=>{if(r==="application/json")return['.transform((str, ctx) => { try { return JSON.parse(str); } catch (err) { ctx.addIssue({ code: "custom", message: "Invalid JSON" }); }}',", ",")"]});return n!=""&&(t+=n,t+=Tn(e,"contentSchema",({value:r})=>{if(r&&r instanceof Object)return[`.pipe(${Pn(r)}`,", ",")"]})),t},bne=(e,...t)=>Object.keys(e).reduce((n,r)=>(t.includes(r)||(n[r]=e[r]),n),{}),kne=(e,t)=>`${Pn(bne(e,"nullable"),t,!0)}.nullable()`,Pn=(e,t={seen:new Map,path:[]},n)=>{if(typeof e!="object")return e?"z.any()":"z.never()";if(t.parserOverride){const o=t.parserOverride(e,t);if(typeof o=="string")return o}let r=t.seen.get(e);if(r){if(r.r!==void 0)return r.r;if(t.depth===void 0||r.n>=t.depth)return"z.any()";r.n+=1}else r={r:void 0,n:0},t.seen.set(e,r);let i=_ne(e,t);return n||(t.withoutDescribes||(i=Sne(e,i)),t.withoutDefaults||(i=Ene(e,i)),i=Cne(e,i)),r.r=i,i},Sne=(e,t)=>(e.description&&(t+=`.describe(${JSON.stringify(e.description)})`),t),Ene=(e,t)=>(e.default!==void 0&&(t+=`.default(${JSON.stringify(e.default)})`),t),Cne=(e,t)=>(e.readOnly&&(t+=".readonly()"),t),_ne=(e,t)=>bn.a.nullable(e)?kne(e,t):bn.an.object(e)?xne(e,t):bn.an.array(e)?pne(e,t):bn.an.anyOf(e)?Ij(e,t):bn.an.allOf(e)?Ap(e,t):bn.a.oneOf(e)?jj(e,t):bn.a.not(e)?cne(e,t):bn.an.enum(e)?gne(e):bn.a.const(e)?mne(e):bn.a.multipleType(e)?une(e,t):bn.a.primitive(e,"string")?wne(e):bn.a.primitive(e,"number")||bn.a.primitive(e,"integer")?vne(e):bn.a.primitive(e,"boolean")?ane():bn.a.primitive(e,"null")?dne():bn.a.conditional(e)?yne(e,t):lne(),bn={an:{object:e=>e.type==="object",array:e=>e.type==="array",anyOf:e=>e.anyOf!==void 0,allOf:e=>e.allOf!==void 0,enum:e=>e.enum!==void 0},a:{nullable:e=>e.nullable===!0,multipleType:e=>Array.isArray(e.type),not:e=>e.not!==void 0,const:e=>e.const!==void 0,primitive:(e,t)=>e.type===t,conditional:e=>!!("if"in e&&e.if&&"then"in e&&"else"in e&&e.then&&e.else),oneOf:e=>e.oneOf!==void 0}},Q1=(e,{module:t,name:n,type:r,noImport:i,...o}={})=>{if(r&&(!n||t!=="esm"))throw new Error("Option `type` requires `name` to be set and `module` to be `esm`");let s=Pn(e,{module:t,name:n,path:[],seen:new Map,...o});if(t==="cjs"?(s=`module.exports = ${n?`{ ${JSON.stringify(n)}: ${s} }`:s}
|
|
348
|
+
`,i||(s=`const { z } = require("zod")
|
|
349
|
+
|
|
350
|
+
${s}`)):t==="esm"?(s=`export ${n?`const ${n} =`:"default"} ${s}
|
|
351
|
+
`,i||(s=`import { z } from "zod"
|
|
352
|
+
|
|
353
|
+
${s}`)):n&&(s=`const ${n} = ${s}`),r&&n){let a=typeof r=="string"?r:`${n[0].toUpperCase()}${n.substring(1)}`;s+=`export type ${a} = z.infer<typeof ${n}>
|
|
354
|
+
`}return s};class Nne{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Lj{constructor(t){this.generateIdentifier=t,this.kv=new Nne}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}}class Tne extends Lj{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,n){typeof n=="object"?(n.allowProps&&this.classToAllowedProps.set(t,n.allowProps),super.register(t,n.identifier)):super.register(t,n)}getAllowedProps(t){return this.classToAllowedProps.get(t)}}function Ane(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function Pne(e,t){const n=Ane(e);if("find"in n)return n.find(t);const r=n;for(let i=0;i<r.length;i++){const o=r[i];if(t(o))return o}}function Il(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function Jh(e,t){return e.indexOf(t)!==-1}function cT(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}class Rne{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return Pne(this.transfomers,n=>n.isApplicable(t))}findByName(t){return this.transfomers[t]}}const Mne=e=>Object.prototype.toString.call(e).slice(8,-1),Fj=e=>typeof e>"u",Dne=e=>e===null,Kc=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,xw=e=>Kc(e)&&Object.keys(e).length===0,ys=e=>Array.isArray(e),One=e=>typeof e=="string",Ine=e=>typeof e=="number"&&!isNaN(e),jne=e=>typeof e=="boolean",Lne=e=>e instanceof RegExp,Xc=e=>e instanceof Map,Qc=e=>e instanceof Set,zj=e=>Mne(e)==="Symbol",Fne=e=>e instanceof Date&&!isNaN(e.valueOf()),zne=e=>e instanceof Error,dT=e=>typeof e=="number"&&isNaN(e),$ne=e=>jne(e)||Dne(e)||Fj(e)||Ine(e)||One(e)||zj(e),Bne=e=>typeof e=="bigint",Vne=e=>e===1/0||e===-1/0,Wne=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Une=e=>e instanceof URL,$j=e=>e.replace(/\./g,"\\."),tx=e=>e.map(String).map($j).join("."),Tc=e=>{const t=[];let n="";for(let i=0;i<e.length;i++){let o=e.charAt(i);if(o==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(o==="."){t.push(n),n="";continue}n+=o}const r=n;return t.push(r),t};function Si(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}const Bj=[Si(Fj,"undefined",()=>null,()=>{}),Si(Bne,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),Si(Fne,"Date",e=>e.toISOString(),e=>new Date(e)),Si(zne,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),Si(Lne,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Si(Qc,"set",e=>[...e.values()],e=>new Set(e)),Si(Xc,"map",e=>[...e.entries()],e=>new Map(e)),Si(e=>dT(e)||Vne(e),"number",e=>dT(e)?"NaN":e>0?"Infinity":"-Infinity",Number),Si(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),Si(Une,"URL",e=>e.toString(),e=>new URL(e))];function Im(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}const Vj=Im((e,t)=>zj(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),Hne=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),Wj=Im(Wne,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=Hne[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function Uj(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const Hj=Im(Uj,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(i=>{r[i]=e[i]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),Yj=Im((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),Yne=[Hj,Vj,Yj,Wj],fT=(e,t)=>{const n=cT(Yne,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=cT(Bj,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},qj={};Bj.forEach(e=>{qj[e.annotation]=e});const qne=(e,t,n)=>{if(ys(t))switch(t[0]){case"symbol":return Vj.untransform(e,t,n);case"class":return Hj.untransform(e,t,n);case"custom":return Yj.untransform(e,t,n);case"typed-array":return Wj.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=qj[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},ml=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Gj(e){if(Jh(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Jh(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Jh(e,"constructor"))throw new Error("constructor is not allowed as a property")}const Gne=(e,t)=>{Gj(t);for(let n=0;n<t.length;n++){const r=t[n];if(Qc(e))e=ml(e,+r);else if(Xc(e)){const i=+r,o=+t[++n]==0?"key":"value",s=ml(e,i);switch(o){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},ww=(e,t,n)=>{if(Gj(t),t.length===0)return n(e);let r=e;for(let o=0;o<t.length-1;o++){const s=t[o];if(ys(r)){const a=+s;r=r[a]}else if(Kc(r))r=r[s];else if(Qc(r)){const a=+s;r=ml(r,a)}else if(Xc(r)){if(o===t.length-2)break;const u=+s,c=+t[++o]==0?"key":"value",f=ml(r,u);switch(c){case"key":r=f;break;case"value":r=r.get(f);break}}}const i=t[t.length-1];if(ys(r)?r[+i]=n(r[+i]):Kc(r)&&(r[i]=n(r[i])),Qc(r)){const o=ml(r,+i),s=n(o);o!==s&&(r.delete(o),r.add(s))}if(Xc(r)){const o=+t[t.length-2],s=ml(r,o);switch(+i==0?"key":"value"){case"key":{const u=n(s);r.set(u,r.get(s)),u!==s&&r.delete(s);break}case"value":{r.set(s,n(r.get(s)));break}}}return e};function bw(e,t,n=[]){if(!e)return;if(!ys(e)){Il(e,(o,s)=>bw(o,t,[...n,...Tc(s)]));return}const[r,i]=e;i&&Il(i,(o,s)=>{bw(o,t,[...n,...Tc(s)])}),t(r,n)}function Zne(e,t,n){return bw(t,(r,i)=>{e=ww(e,i,o=>qne(o,r,n))}),e}function Kne(e,t){function n(r,i){const o=Gne(e,Tc(i));r.map(Tc).forEach(s=>{e=ww(e,s,()=>o)})}if(ys(t)){const[r,i]=t;r.forEach(o=>{e=ww(e,Tc(o),()=>e)}),i&&Il(i,n)}else Il(t,n);return e}const Xne=(e,t)=>Kc(e)||ys(e)||Xc(e)||Qc(e)||Uj(e,t);function Qne(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function Jne(e,t){const n={};let r;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(a=>a.map(String)).sort((a,u)=>a.length-u.length));const[o,...s]=i;o.length===0?r=s.map(tx):n[tx(o)]=s.map(tx)}),r?xw(n)?[r]:[r,n]:xw(n)?void 0:n}const Zj=(e,t,n,r,i=[],o=[],s=new Map)=>{const a=$ne(e);if(!a){Qne(e,i,t);const m=s.get(e);if(m)return r?{transformedValue:null}:m}if(!Xne(e,n)){const m=fT(e,n),y=m?{transformedValue:m.value,annotations:[m.type]}:{transformedValue:e};return a||s.set(e,y),y}if(Jh(o,e))return{transformedValue:null};const u=fT(e,n),c=(u==null?void 0:u.value)??e,f=ys(c)?[]:{},h={};Il(c,(m,y)=>{if(y==="__proto__"||y==="constructor"||y==="prototype")throw new Error(`Detected property ${y}. This is a prototype pollution risk, please remove it from your object.`);const x=Zj(m,t,n,r,[...i,y],[...o,e],s);f[y]=x.transformedValue,ys(x.annotations)?h[y]=x.annotations:Kc(x.annotations)&&Il(x.annotations,(k,w)=>{h[$j(y)+"."+w]=k})});const p=xw(h)?{transformedValue:f,annotations:u?[u.type]:void 0}:{transformedValue:f,annotations:u?[u.type,h]:h};return a||s.set(e,p),p};function Kj(e){return Object.prototype.toString.call(e).slice(8,-1)}function hT(e){return Kj(e)==="Array"}function ere(e){if(Kj(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function tre(e,t,n,r,i){const o={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";o==="enumerable"&&(e[t]=n),i&&o==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function kw(e,t={}){if(hT(e))return e.map(i=>kw(i,t));if(!ere(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,o)=>{if(hT(t.props)&&!t.props.includes(o))return i;const s=e[o],a=kw(s,t);return tre(i,o,a,e,t.nonenumerable),i},{})}class Mt{constructor({dedupe:t=!1}={}){this.classRegistry=new Tne,this.symbolRegistry=new Lj(n=>n.description??""),this.customTransformerRegistry=new Rne,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const n=new Map,r=Zj(t,n,this,this.dedupe),i={json:r.transformedValue};r.annotations&&(i.meta={...i.meta,values:r.annotations});const o=Jne(n,this.dedupe);return o&&(i.meta={...i.meta,referentialEqualities:o}),i}deserialize(t){const{json:n,meta:r}=t;let i=kw(n);return r!=null&&r.values&&(i=Zne(i,r.values,this)),r!=null&&r.referentialEqualities&&(i=Kne(i,r.referentialEqualities)),i}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t))}registerClass(t,n){this.classRegistry.register(t,n)}registerSymbol(t,n){this.symbolRegistry.register(t,n)}registerCustom(t,n){this.customTransformerRegistry.register({name:n,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}}Mt.defaultInstance=new Mt;Mt.serialize=Mt.defaultInstance.serialize.bind(Mt.defaultInstance);Mt.deserialize=Mt.defaultInstance.deserialize.bind(Mt.defaultInstance);Mt.stringify=Mt.defaultInstance.stringify.bind(Mt.defaultInstance);Mt.parse=Mt.defaultInstance.parse.bind(Mt.defaultInstance);Mt.registerClass=Mt.defaultInstance.registerClass.bind(Mt.defaultInstance);Mt.registerSymbol=Mt.defaultInstance.registerSymbol.bind(Mt.defaultInstance);Mt.registerCustom=Mt.defaultInstance.registerCustom.bind(Mt.defaultInstance);Mt.allowErrorProps=Mt.defaultInstance.allowErrorProps.bind(Mt.defaultInstance);const J1=Mt.parse;var Wd=e=>e.type==="checkbox",Qs=e=>e instanceof Date,Qn=e=>e==null;const Xj=e=>typeof e=="object";var an=e=>!Qn(e)&&!Array.isArray(e)&&Xj(e)&&!Qs(e),Qj=e=>an(e)&&e.target?Wd(e.target)?e.target.checked:e.target.value:e,nre=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Jj=(e,t)=>e.has(nre(t)),rre=e=>{const t=e.constructor&&e.constructor.prototype;return an(t)&&t.hasOwnProperty("isPrototypeOf")},ek=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function kn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(ek&&(e instanceof Blob||r))&&(n||an(e)))if(t=n?[]:{},!n&&!rre(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=kn(e[i]));else return e;return t}var Ud=e=>Array.isArray(e)?e.filter(Boolean):[],Pt=e=>e===void 0,Ne=(e,t,n)=>{if(!t||!an(e))return n;const r=Ud(t.split(/[,[\].]+?/)).reduce((i,o)=>Qn(i)?i:i[o],e);return Pt(r)||r===e?Pt(e[t])?n:e[t]:r},kr=e=>typeof e=="boolean",tk=e=>/^\w*$/.test(e),eL=e=>Ud(e.replace(/["|']|\]/g,"").split(/\.|\[/)),St=(e,t,n)=>{let r=-1;const i=tk(t)?[t]:eL(t),o=i.length,s=o-1;for(;++r<o;){const a=i[r];let u=n;if(r!==s){const c=e[a];u=an(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const Pp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Wr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ro={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ire=ne.createContext(null),jm=()=>ne.useContext(ire);var tL=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const s=o;return t._proxyFormState[s]!==Wr.all&&(t._proxyFormState[s]=!r||Wr.all),n&&(n[s]=!0),e[s]}});return i},Xn=e=>an(e)&&!Object.keys(e).length,nL=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Xn(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(s=>t[s]===(!r||Wr.all))},cr=e=>Array.isArray(e)?e:[e],rL=(e,t,n)=>!e||!t||e===t||cr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Lm(e){const t=ne.useRef(e);t.current=e,ne.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function ore(e){const t=jm(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[s,a]=ne.useState(n._formState),u=ne.useRef(!0),c=ne.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=ne.useRef(i);return f.current=i,Lm({disabled:r,next:h=>u.current&&rL(f.current,h.name,o)&&nL(h,c.current,n._updateFormState)&&a({...n._formState,...h}),subject:n._subjects.state}),ne.useEffect(()=>(u.current=!0,c.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),ne.useMemo(()=>tL(s,n,c.current,!1),[s,n])}var Ti=e=>typeof e=="string",iL=(e,t,n,r,i)=>Ti(e)?(r&&t.watch.add(e),Ne(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Ne(n,o))):(r&&(t.watchAll=!0),n);function sre(e){const t=jm(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:s}=e||{},a=ne.useRef(r);a.current=r,Lm({disabled:o,subject:n._subjects.values,next:f=>{rL(a.current,f.name,s)&&c(kn(iL(a.current,n._names,f.values||n._formValues,!1,i)))}});const[u,c]=ne.useState(n._getWatch(r,i));return ne.useEffect(()=>n._removeUnmounted()),u}function are(e){const t=jm(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,s=Jj(i._names.array,n),a=sre({control:i,name:n,defaultValue:Ne(i._formValues,n,Ne(i._defaultValues,n,e.defaultValue)),exact:!0}),u=ore({control:i,name:n,exact:!0}),c=ne.useRef(i.register(n,{...e.rules,value:a,...kr(e.disabled)?{disabled:e.disabled}:{}})),f=ne.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ne(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ne(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ne(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ne(u.validatingFields,n)},error:{enumerable:!0,get:()=>Ne(u.errors,n)}}),[u,n]),h=ne.useMemo(()=>({name:n,value:a,...kr(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:p=>c.current.onChange({target:{value:Qj(p),name:n},type:Pp.CHANGE}),onBlur:()=>c.current.onBlur({target:{value:Ne(i._formValues,n),name:n},type:Pp.BLUR}),ref:p=>{const m=Ne(i._fields,n);m&&p&&(m._f.ref={focus:()=>p.focus(),select:()=>p.select(),setCustomValidity:y=>p.setCustomValidity(y),reportValidity:()=>p.reportValidity()})}}),[n,i._formValues,r,u.disabled,a,i._fields]);return ne.useEffect(()=>{const p=i._options.shouldUnregister||o,m=(y,x)=>{const k=Ne(i._fields,y);k&&k._f&&(k._f.mount=x)};if(m(n,!0),p){const y=kn(Ne(i._options.defaultValues,n));St(i._defaultValues,n,y),Pt(Ne(i._formValues,n))&&St(i._formValues,n,y)}return()=>{(s?p&&!i._state.action:p)?i.unregister(n):m(n,!1)}},[n,i,s,o]),ne.useEffect(()=>{kr(r)&&Ne(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:Ne(i._fields,n)._f.value})},[r,n,i]),ne.useMemo(()=>({field:h,formState:u,fieldState:f}),[h,u,f])}const cu=e=>e.render(are(e));var oL=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},es=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},nx=(e,t,n={})=>n.shouldFocus||Pt(n.shouldFocus)?n.focusName||`${e}.${Pt(n.focusIndex)?t:n.focusIndex}.`:"",Ac=e=>({isOnSubmit:!e||e===Wr.onSubmit,isOnBlur:e===Wr.onBlur,isOnChange:e===Wr.onChange,isOnAll:e===Wr.all,isOnTouch:e===Wr.onTouched}),Sw=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Cl=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Ne(e,i);if(o){const{_f:s,...a}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],i)&&!r)return!0;if(s.ref&&t(s.ref,s.name)&&!r)return!0;if(Cl(a,t))break}else if(an(a)&&Cl(a,t))break}}};var sL=(e,t,n)=>{const r=cr(Ne(e,n));return St(r,"root",t[n]),St(e,n,r),e},nk=e=>e.type==="file",Ni=e=>typeof e=="function",Rp=e=>{if(!ek)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ep=e=>Ti(e),rk=e=>e.type==="radio",Mp=e=>e instanceof RegExp;const pT={value:!1,isValid:!1},mT={value:!0,isValid:!0};var aL=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Pt(e[0].attributes.value)?Pt(e[0].value)||e[0].value===""?mT:{value:e[0].value,isValid:!0}:mT:pT}return pT};const gT={isValid:!1,value:null};var lL=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,gT):gT;function yT(e,t,n="validate"){if(ep(e)||Array.isArray(e)&&e.every(ep)||kr(e)&&!e)return{type:n,message:ep(e)?e:"",ref:t}}var ol=e=>an(e)&&!Mp(e)?e:{value:e,message:""},Ew=async(e,t,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:u,minLength:c,min:f,max:h,pattern:p,validate:m,name:y,valueAsNumber:x,mount:k,disabled:w}=e._f,E=Ne(t,y);if(!k||w)return{};const C=s?s[0]:o,N=F=>{r&&C.reportValidity&&(C.setCustomValidity(kr(F)?"":F||""),C.reportValidity())},P={},A=rk(o),O=Wd(o),M=A||O,j=(x||nk(o))&&Pt(o.value)&&Pt(E)||Rp(o)&&o.value===""||E===""||Array.isArray(E)&&!E.length,R=oL.bind(null,y,n,P),$=(F,H,I,q=ro.maxLength,Y=ro.minLength)=>{const Z=F?H:I;P[y]={type:F?q:Y,message:Z,ref:o,...R(F?q:Y,Z)}};if(i?!Array.isArray(E)||!E.length:a&&(!M&&(j||Qn(E))||kr(E)&&!E||O&&!aL(s).isValid||A&&!lL(s).isValid)){const{value:F,message:H}=ep(a)?{value:!!a,message:a}:ol(a);if(F&&(P[y]={type:ro.required,message:H,ref:C,...R(ro.required,H)},!n))return N(H),P}if(!j&&(!Qn(f)||!Qn(h))){let F,H;const I=ol(h),q=ol(f);if(!Qn(E)&&!isNaN(E)){const Y=o.valueAsNumber||E&&+E;Qn(I.value)||(F=Y>I.value),Qn(q.value)||(H=Y<q.value)}else{const Y=o.valueAsDate||new Date(E),Z=L=>new Date(new Date().toDateString()+" "+L),B=o.type=="time",W=o.type=="week";Ti(I.value)&&E&&(F=B?Z(E)>Z(I.value):W?E>I.value:Y>new Date(I.value)),Ti(q.value)&&E&&(H=B?Z(E)<Z(q.value):W?E<q.value:Y<new Date(q.value))}if((F||H)&&($(!!F,I.message,q.message,ro.max,ro.min),!n))return N(P[y].message),P}if((u||c)&&!j&&(Ti(E)||i&&Array.isArray(E))){const F=ol(u),H=ol(c),I=!Qn(F.value)&&E.length>+F.value,q=!Qn(H.value)&&E.length<+H.value;if((I||q)&&($(I,F.message,H.message),!n))return N(P[y].message),P}if(p&&!j&&Ti(E)){const{value:F,message:H}=ol(p);if(Mp(F)&&!E.match(F)&&(P[y]={type:ro.pattern,message:H,ref:o,...R(ro.pattern,H)},!n))return N(H),P}if(m){if(Ni(m)){const F=await m(E,t),H=yT(F,C);if(H&&(P[y]={...H,...R(ro.validate,H.message)},!n))return N(H.message),P}else if(an(m)){let F={};for(const H in m){if(!Xn(F)&&!n)break;const I=yT(await m[H](E,t),C,H);I&&(F={...I,...R(H,I.message)},N(I.message),n&&(P[y]=F))}if(!Xn(F)&&(P[y]={ref:C,...F},!n))return P}}return N(!0),P},rx=(e,t)=>[...e,...cr(t)],ix=e=>Array.isArray(e)?e.map(()=>{}):void 0;function ox(e,t,n){return[...e.slice(0,t),...cr(n),...e.slice(t)]}var sx=(e,t,n)=>Array.isArray(e)?(Pt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],ax=(e,t)=>[...cr(t),...cr(e)];function lre(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return Ud(r).length?r:[]}var lx=(e,t)=>Pt(t)?[]:lre(e,cr(t).sort((n,r)=>n-r)),ux=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function ure(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Pt(e)?r++:e[t[r++]];return e}function cre(e){for(const t in e)if(e.hasOwnProperty(t)&&!Pt(e[t]))return!1;return!0}function cn(e,t){const n=Array.isArray(t)?t:tk(t)?[t]:eL(t),r=n.length===1?e:ure(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(an(r)&&Xn(r)||Array.isArray(r)&&cre(r))&&cn(e,n.slice(0,-1)),e}var vT=(e,t,n)=>(e[t]=n,e);function ik(e){const t=jm(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:s}=e,[a,u]=ne.useState(n._getFieldArray(r)),c=ne.useRef(n._getFieldArray(r).map(es)),f=ne.useRef(a),h=ne.useRef(r),p=ne.useRef(!1);h.current=r,f.current=a,n._names.array.add(r),s&&n.register(r,s),Lm({next:({values:A,name:O})=>{if(O===h.current||!O){const M=Ne(A,h.current);Array.isArray(M)&&(u(M),c.current=M.map(es))}},subject:n._subjects.array});const m=ne.useCallback(A=>{p.current=!0,n._updateFieldArray(r,A)},[n,r]),y=(A,O)=>{const M=cr(kn(A)),j=rx(n._getFieldArray(r),M);n._names.focus=nx(r,j.length-1,O),c.current=rx(c.current,M.map(es)),m(j),u(j),n._updateFieldArray(r,j,rx,{argA:ix(A)})},x=(A,O)=>{const M=cr(kn(A)),j=ax(n._getFieldArray(r),M);n._names.focus=nx(r,0,O),c.current=ax(c.current,M.map(es)),m(j),u(j),n._updateFieldArray(r,j,ax,{argA:ix(A)})},k=A=>{const O=lx(n._getFieldArray(r),A);c.current=lx(c.current,A),m(O),u(O),!Array.isArray(Ne(n._fields,r))&&St(n._fields,r,void 0),n._updateFieldArray(r,O,lx,{argA:A})},w=(A,O,M)=>{const j=cr(kn(O)),R=ox(n._getFieldArray(r),A,j);n._names.focus=nx(r,A,M),c.current=ox(c.current,A,j.map(es)),m(R),u(R),n._updateFieldArray(r,R,ox,{argA:A,argB:ix(O)})},E=(A,O)=>{const M=n._getFieldArray(r);ux(M,A,O),ux(c.current,A,O),m(M),u(M),n._updateFieldArray(r,M,ux,{argA:A,argB:O},!1)},C=(A,O)=>{const M=n._getFieldArray(r);sx(M,A,O),sx(c.current,A,O),m(M),u(M),n._updateFieldArray(r,M,sx,{argA:A,argB:O},!1)},N=(A,O)=>{const M=kn(O),j=vT(n._getFieldArray(r),A,M);c.current=[...j].map((R,$)=>!R||$===A?es():c.current[$]),m(j),u([...j]),n._updateFieldArray(r,j,vT,{argA:A,argB:M},!0,!1)},P=A=>{const O=cr(kn(A));c.current=O.map(es),m([...O]),u([...O]),n._updateFieldArray(r,[...O],M=>M,{},!0,!1)};return ne.useEffect(()=>{if(n._state.action=!1,Sw(r,n._names)&&n._subjects.state.next({...n._formState}),p.current&&(!Ac(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(A=>{const O=Ne(A.errors,r),M=Ne(n._formState.errors,r);(M?!O&&M.type||O&&(M.type!==O.type||M.message!==O.message):O&&O.type)&&(O?St(n._formState.errors,r,O):cn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const A=Ne(n._fields,r);A&&A._f&&!(Ac(n._options.reValidateMode).isOnSubmit&&Ac(n._options.mode).isOnSubmit)&&Ew(A,n._formValues,n._options.criteriaMode===Wr.all,n._options.shouldUseNativeValidation,!0).then(O=>!Xn(O)&&n._subjects.state.next({errors:sL(n._formState.errors,O,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&Cl(n._fields,(A,O)=>{if(n._names.focus&&O.startsWith(n._names.focus)&&A.focus)return A.focus(),1}),n._names.focus="",n._updateValid(),p.current=!1},[a,r,n]),ne.useEffect(()=>(!Ne(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||o)&&n.unregister(r)}),[r,n,i,o]),{swap:ne.useCallback(E,[m,r,n]),move:ne.useCallback(C,[m,r,n]),prepend:ne.useCallback(x,[m,r,n]),append:ne.useCallback(y,[m,r,n]),remove:ne.useCallback(k,[m,r,n]),insert:ne.useCallback(w,[m,r,n]),update:ne.useCallback(N,[m,r,n]),replace:ne.useCallback(P,[m,r,n]),fields:ne.useMemo(()=>a.map((A,O)=>({...A,[i]:c.current[O]||es()})),[a,i])}}var cx=()=>{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},Cw=e=>Qn(e)||!Xj(e);function as(e,t){if(Cw(e)||Cw(t))return e===t;if(Qs(e)&&Qs(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const s=t[i];if(Qs(o)&&Qs(s)||an(o)&&an(s)||Array.isArray(o)&&Array.isArray(s)?!as(o,s):o!==s)return!1}}return!0}var uL=e=>e.type==="select-multiple",dre=e=>rk(e)||Wd(e),dx=e=>Rp(e)&&e.isConnected,cL=e=>{for(const t in e)if(Ni(e[t]))return!0;return!1};function Dp(e,t={}){const n=Array.isArray(e);if(an(e)||n)for(const r in e)Array.isArray(e[r])||an(e[r])&&!cL(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Dp(e[r],t[r])):Qn(e[r])||(t[r]=!0);return t}function dL(e,t,n){const r=Array.isArray(e);if(an(e)||r)for(const i in e)Array.isArray(e[i])||an(e[i])&&!cL(e[i])?Pt(t)||Cw(n[i])?n[i]=Array.isArray(e[i])?Dp(e[i],[]):{...Dp(e[i])}:dL(e[i],Qn(t)?{}:t[i],n[i]):n[i]=!as(e[i],t[i]);return n}var ic=(e,t)=>dL(e,t,Dp(t)),fL=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Pt(e)?e:t?e===""?NaN:e&&+e:n&&Ti(e)?new Date(e):r?r(e):e;function fx(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return nk(t)?t.files:rk(t)?lL(e.refs).value:uL(t)?[...t.selectedOptions].map(({value:n})=>n):Wd(t)?aL(e.refs).value:fL(Pt(t.value)?e.ref.value:t.value,e)}var fre=(e,t,n,r)=>{const i={};for(const o of e){const s=Ne(t,o);s&&St(i,o,s._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},oc=e=>Pt(e)?e:Mp(e)?e.source:an(e)?Mp(e.value)?e.value.source:e.value:e;const xT="AsyncFunction";var hre=e=>!!e&&!!e.validate&&!!(Ni(e.validate)&&e.validate.constructor.name===xT||an(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===xT)),pre=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function wT(e,t,n){const r=Ne(e,n);if(r||tk(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=Ne(t,o),a=Ne(e,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:n}}var mre=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,gre=(e,t)=>!Ud(Ne(e,t)).length&&cn(e,t);const yre={mode:Wr.onSubmit,reValidateMode:Wr.onChange,shouldFocusError:!0};function vre(e={}){let t={...yre,...e},n={submitCount:0,isDirty:!1,isLoading:Ni(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=an(t.defaultValues)||an(t.values)?kn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:kn(i),s={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={values:cx(),array:cx(),state:cx()},p=Ac(t.mode),m=Ac(t.reValidateMode),y=t.criteriaMode===Wr.all,x=Q=>oe=>{clearTimeout(c),c=setTimeout(Q,oe)},k=async Q=>{if(!t.disabled&&(f.isValid||Q)){const oe=t.resolver?Xn((await M()).errors):await R(r,!0);oe!==n.isValid&&h.state.next({isValid:oe})}},w=(Q,oe)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((Q||Array.from(a.mount)).forEach(ae=>{ae&&(oe?St(n.validatingFields,ae,oe):cn(n.validatingFields,ae))}),h.state.next({validatingFields:n.validatingFields,isValidating:!Xn(n.validatingFields)}))},E=(Q,oe=[],ae,Ce,we=!0,me=!0)=>{if(Ce&&ae&&!t.disabled){if(s.action=!0,me&&Array.isArray(Ne(r,Q))){const Ae=ae(Ne(r,Q),Ce.argA,Ce.argB);we&&St(r,Q,Ae)}if(me&&Array.isArray(Ne(n.errors,Q))){const Ae=ae(Ne(n.errors,Q),Ce.argA,Ce.argB);we&&St(n.errors,Q,Ae),gre(n.errors,Q)}if(f.touchedFields&&me&&Array.isArray(Ne(n.touchedFields,Q))){const Ae=ae(Ne(n.touchedFields,Q),Ce.argA,Ce.argB);we&&St(n.touchedFields,Q,Ae)}f.dirtyFields&&(n.dirtyFields=ic(i,o)),h.state.next({name:Q,isDirty:F(Q,oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else St(o,Q,oe)},C=(Q,oe)=>{St(n.errors,Q,oe),h.state.next({errors:n.errors})},N=Q=>{n.errors=Q,h.state.next({errors:n.errors,isValid:!1})},P=(Q,oe,ae,Ce)=>{const we=Ne(r,Q);if(we){const me=Ne(o,Q,Pt(ae)?Ne(i,Q):ae);Pt(me)||Ce&&Ce.defaultChecked||oe?St(o,Q,oe?me:fx(we._f)):q(Q,me),s.mount&&k()}},A=(Q,oe,ae,Ce,we)=>{let me=!1,Ae=!1;const Fe={name:Q};if(!t.disabled){const ce=!!(Ne(r,Q)&&Ne(r,Q)._f&&Ne(r,Q)._f.disabled);if(!ae||Ce){f.isDirty&&(Ae=n.isDirty,n.isDirty=Fe.isDirty=F(),me=Ae!==Fe.isDirty);const pe=ce||as(Ne(i,Q),oe);Ae=!!(!ce&&Ne(n.dirtyFields,Q)),pe||ce?cn(n.dirtyFields,Q):St(n.dirtyFields,Q,!0),Fe.dirtyFields=n.dirtyFields,me=me||f.dirtyFields&&Ae!==!pe}if(ae){const pe=Ne(n.touchedFields,Q);pe||(St(n.touchedFields,Q,ae),Fe.touchedFields=n.touchedFields,me=me||f.touchedFields&&pe!==ae)}me&&we&&h.state.next(Fe)}return me?Fe:{}},O=(Q,oe,ae,Ce)=>{const we=Ne(n.errors,Q),me=f.isValid&&kr(oe)&&n.isValid!==oe;if(t.delayError&&ae?(u=x(()=>C(Q,ae)),u(t.delayError)):(clearTimeout(c),u=null,ae?St(n.errors,Q,ae):cn(n.errors,Q)),(ae?!as(we,ae):we)||!Xn(Ce)||me){const Ae={...Ce,...me&&kr(oe)?{isValid:oe}:{},errors:n.errors,name:Q};n={...n,...Ae},h.state.next(Ae)}},M=async Q=>{w(Q,!0);const oe=await t.resolver(o,t.context,fre(Q||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(Q),oe},j=async Q=>{const{errors:oe}=await M(Q);if(Q)for(const ae of Q){const Ce=Ne(oe,ae);Ce?St(n.errors,ae,Ce):cn(n.errors,ae)}else n.errors=oe;return oe},R=async(Q,oe,ae={valid:!0})=>{for(const Ce in Q){const we=Q[Ce];if(we){const{_f:me,...Ae}=we;if(me){const Fe=a.array.has(me.name),ce=we._f&&hre(we._f);ce&&f.validatingFields&&w([Ce],!0);const pe=await Ew(we,o,y,t.shouldUseNativeValidation&&!oe,Fe);if(ce&&f.validatingFields&&w([Ce]),pe[me.name]&&(ae.valid=!1,oe))break;!oe&&(Ne(pe,me.name)?Fe?sL(n.errors,pe,me.name):St(n.errors,me.name,pe[me.name]):cn(n.errors,me.name))}!Xn(Ae)&&await R(Ae,oe,ae)}}return ae.valid},$=()=>{for(const Q of a.unMount){const oe=Ne(r,Q);oe&&(oe._f.refs?oe._f.refs.every(ae=>!dx(ae)):!dx(oe._f.ref))&&J(Q)}a.unMount=new Set},F=(Q,oe)=>!t.disabled&&(Q&&oe&&St(o,Q,oe),!as(U(),i)),H=(Q,oe,ae)=>iL(Q,a,{...s.mount?o:Pt(oe)?i:Ti(Q)?{[Q]:oe}:oe},ae,oe),I=Q=>Ud(Ne(s.mount?o:i,Q,t.shouldUnregister?Ne(i,Q,[]):[])),q=(Q,oe,ae={})=>{const Ce=Ne(r,Q);let we=oe;if(Ce){const me=Ce._f;me&&(!me.disabled&&St(o,Q,fL(oe,me)),we=Rp(me.ref)&&Qn(oe)?"":oe,uL(me.ref)?[...me.ref.options].forEach(Ae=>Ae.selected=we.includes(Ae.value)):me.refs?Wd(me.ref)?me.refs.length>1?me.refs.forEach(Ae=>(!Ae.defaultChecked||!Ae.disabled)&&(Ae.checked=Array.isArray(we)?!!we.find(Fe=>Fe===Ae.value):we===Ae.value)):me.refs[0]&&(me.refs[0].checked=!!we):me.refs.forEach(Ae=>Ae.checked=Ae.value===we):nk(me.ref)?me.ref.value="":(me.ref.value=we,me.ref.type||h.values.next({name:Q,values:{...o}})))}(ae.shouldDirty||ae.shouldTouch)&&A(Q,we,ae.shouldTouch,ae.shouldDirty,!0),ae.shouldValidate&&L(Q)},Y=(Q,oe,ae)=>{for(const Ce in oe){const we=oe[Ce],me=`${Q}.${Ce}`,Ae=Ne(r,me);(a.array.has(Q)||an(we)||Ae&&!Ae._f)&&!Qs(we)?Y(me,we,ae):q(me,we,ae)}},Z=(Q,oe,ae={})=>{const Ce=Ne(r,Q),we=a.array.has(Q),me=kn(oe);St(o,Q,me),we?(h.array.next({name:Q,values:{...o}}),(f.isDirty||f.dirtyFields)&&ae.shouldDirty&&h.state.next({name:Q,dirtyFields:ic(i,o),isDirty:F(Q,me)})):Ce&&!Ce._f&&!Qn(me)?Y(Q,me,ae):q(Q,me,ae),Sw(Q,a)&&h.state.next({...n}),h.values.next({name:s.mount?Q:void 0,values:{...o}})},B=async Q=>{s.mount=!0;const oe=Q.target;let ae=oe.name,Ce=!0;const we=Ne(r,ae),me=()=>oe.type?fx(we._f):Qj(Q),Ae=Fe=>{Ce=Number.isNaN(Fe)||Qs(Fe)&&isNaN(Fe.getTime())||as(Fe,Ne(o,ae,Fe))};if(we){let Fe,ce;const pe=me(),Ie=Q.type===Pp.BLUR||Q.type===Pp.FOCUS_OUT,Ke=!pre(we._f)&&!t.resolver&&!Ne(n.errors,ae)&&!we._f.deps||mre(Ie,Ne(n.touchedFields,ae),n.isSubmitted,m,p),tt=Sw(ae,a,Ie);St(o,ae,pe),Ie?(we._f.onBlur&&we._f.onBlur(Q),u&&u(0)):we._f.onChange&&we._f.onChange(Q);const At=A(ae,pe,Ie,!1),He=!Xn(At)||tt;if(!Ie&&h.values.next({name:ae,type:Q.type,values:{...o}}),Ke)return f.isValid&&(t.mode==="onBlur"?Ie&&k():k()),He&&h.state.next({name:ae,...tt?{}:At});if(!Ie&&tt&&h.state.next({...n}),t.resolver){const{errors:it}=await M([ae]);if(Ae(pe),Ce){const at=wT(n.errors,r,ae),Wt=wT(it,r,at.name||ae);Fe=Wt.error,ae=Wt.name,ce=Xn(it)}}else w([ae],!0),Fe=(await Ew(we,o,y,t.shouldUseNativeValidation))[ae],w([ae]),Ae(pe),Ce&&(Fe?ce=!1:f.isValid&&(ce=await R(r,!0)));Ce&&(we._f.deps&&L(we._f.deps),O(ae,ce,Fe,At))}},W=(Q,oe)=>{if(Ne(n.errors,oe)&&Q.focus)return Q.focus(),1},L=async(Q,oe={})=>{let ae,Ce;const we=cr(Q);if(t.resolver){const me=await j(Pt(Q)?Q:we);ae=Xn(me),Ce=Q?!we.some(Ae=>Ne(me,Ae)):ae}else Q?(Ce=(await Promise.all(we.map(async me=>{const Ae=Ne(r,me);return await R(Ae&&Ae._f?{[me]:Ae}:Ae)}))).every(Boolean),!(!Ce&&!n.isValid)&&k()):Ce=ae=await R(r);return h.state.next({...!Ti(Q)||f.isValid&&ae!==n.isValid?{}:{name:Q},...t.resolver||!Q?{isValid:ae}:{},errors:n.errors}),oe.shouldFocus&&!Ce&&Cl(r,W,Q?we:a.mount),Ce},U=Q=>{const oe={...s.mount?o:i};return Pt(Q)?oe:Ti(Q)?Ne(oe,Q):Q.map(ae=>Ne(oe,ae))},V=(Q,oe)=>({invalid:!!Ne((oe||n).errors,Q),isDirty:!!Ne((oe||n).dirtyFields,Q),error:Ne((oe||n).errors,Q),isValidating:!!Ne(n.validatingFields,Q),isTouched:!!Ne((oe||n).touchedFields,Q)}),D=Q=>{Q&&cr(Q).forEach(oe=>cn(n.errors,oe)),h.state.next({errors:Q?n.errors:{}})},G=(Q,oe,ae)=>{const Ce=(Ne(r,Q,{_f:{}})._f||{}).ref,we=Ne(n.errors,Q)||{},{ref:me,message:Ae,type:Fe,...ce}=we;St(n.errors,Q,{...ce,...oe,ref:Ce}),h.state.next({name:Q,errors:n.errors,isValid:!1}),ae&&ae.shouldFocus&&Ce&&Ce.focus&&Ce.focus()},K=(Q,oe)=>Ni(Q)?h.values.subscribe({next:ae=>Q(H(void 0,oe),ae)}):H(Q,oe,!0),J=(Q,oe={})=>{for(const ae of Q?cr(Q):a.mount)a.mount.delete(ae),a.array.delete(ae),oe.keepValue||(cn(r,ae),cn(o,ae)),!oe.keepError&&cn(n.errors,ae),!oe.keepDirty&&cn(n.dirtyFields,ae),!oe.keepTouched&&cn(n.touchedFields,ae),!oe.keepIsValidating&&cn(n.validatingFields,ae),!t.shouldUnregister&&!oe.keepDefaultValue&&cn(i,ae);h.values.next({values:{...o}}),h.state.next({...n,...oe.keepDirty?{isDirty:F()}:{}}),!oe.keepIsValid&&k()},ee=({disabled:Q,name:oe,field:ae,fields:Ce,value:we})=>{if(kr(Q)&&s.mount||Q){const me=Q?void 0:Pt(we)?fx(ae?ae._f:Ne(Ce,oe)._f):we;(Q||!Q&&!Pt(me))&&St(o,oe,me),A(oe,me,!1,!1,!0)}},re=(Q,oe={})=>{let ae=Ne(r,Q);const Ce=kr(oe.disabled)||kr(t.disabled);return St(r,Q,{...ae||{},_f:{...ae&&ae._f?ae._f:{ref:{name:Q}},name:Q,mount:!0,...oe}}),a.mount.add(Q),ae?ee({field:ae,disabled:kr(oe.disabled)?oe.disabled:t.disabled,name:Q,value:oe.value}):P(Q,!0,oe.value),{...Ce?{disabled:oe.disabled||t.disabled}:{},...t.progressive?{required:!!oe.required,min:oc(oe.min),max:oc(oe.max),minLength:oc(oe.minLength),maxLength:oc(oe.maxLength),pattern:oc(oe.pattern)}:{},name:Q,onChange:B,onBlur:B,ref:we=>{if(we){re(Q,oe),ae=Ne(r,Q);const me=Pt(we.value)&&we.querySelectorAll&&we.querySelectorAll("input,select,textarea")[0]||we,Ae=dre(me),Fe=ae._f.refs||[];if(Ae?Fe.find(ce=>ce===me):me===ae._f.ref)return;St(r,Q,{_f:{...ae._f,...Ae?{refs:[...Fe.filter(dx),me,...Array.isArray(Ne(i,Q))?[{}]:[]],ref:{type:me.type,name:Q}}:{ref:me}}}),P(Q,!1,void 0,me)}else ae=Ne(r,Q,{}),ae._f&&(ae._f.mount=!1),(t.shouldUnregister||oe.shouldUnregister)&&!(Jj(a.array,Q)&&s.action)&&a.unMount.add(Q)}}},ue=()=>t.shouldFocusError&&Cl(r,W,a.mount),he=Q=>{kr(Q)&&(h.state.next({disabled:Q}),Cl(r,(oe,ae)=>{const Ce=Ne(r,ae);Ce&&(oe.disabled=Ce._f.disabled||Q,Array.isArray(Ce._f.refs)&&Ce._f.refs.forEach(we=>{we.disabled=Ce._f.disabled||Q}))},0,!1))},ke=(Q,oe)=>async ae=>{let Ce;if(ae&&(ae.preventDefault&&ae.preventDefault(),ae.persist&&ae.persist()),t.disabled){oe&&await oe({...n.errors},ae);return}let we=kn(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:me,values:Ae}=await M();n.errors=me,we=Ae}else await R(r);if(cn(n.errors,"root"),Xn(n.errors)){h.state.next({errors:{}});try{await Q(we,ae)}catch(me){Ce=me}}else oe&&await oe({...n.errors},ae),ue(),setTimeout(ue);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Xn(n.errors)&&!Ce,submitCount:n.submitCount+1,errors:n.errors}),Ce)throw Ce},fe=(Q,oe={})=>{Ne(r,Q)&&(Pt(oe.defaultValue)?Z(Q,kn(Ne(i,Q))):(Z(Q,oe.defaultValue),St(i,Q,kn(oe.defaultValue))),oe.keepTouched||cn(n.touchedFields,Q),oe.keepDirty||(cn(n.dirtyFields,Q),n.isDirty=oe.defaultValue?F(Q,kn(Ne(i,Q))):F()),oe.keepError||(cn(n.errors,Q),f.isValid&&k()),h.state.next({...n}))},ve=(Q,oe={})=>{const ae=Q?kn(Q):i,Ce=kn(ae),we=Xn(Q),me=we?i:Ce;if(oe.keepDefaultValues||(i=ae),!oe.keepValues){if(oe.keepDirtyValues){const Ae=new Set([...a.mount,...Object.keys(ic(i,o))]);for(const Fe of Array.from(Ae))Ne(n.dirtyFields,Fe)?St(me,Fe,Ne(o,Fe)):Z(Fe,Ne(me,Fe))}else{if(ek&&Pt(Q))for(const Ae of a.mount){const Fe=Ne(r,Ae);if(Fe&&Fe._f){const ce=Array.isArray(Fe._f.refs)?Fe._f.refs[0]:Fe._f.ref;if(Rp(ce)){const pe=ce.closest("form");if(pe){pe.reset();break}}}}r={}}o=t.shouldUnregister?oe.keepDefaultValues?kn(i):{}:kn(me),h.array.next({values:{...me}}),h.values.next({values:{...me}})}a={mount:oe.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!f.isValid||!!oe.keepIsValid||!!oe.keepDirtyValues,s.watch=!!t.shouldUnregister,h.state.next({submitCount:oe.keepSubmitCount?n.submitCount:0,isDirty:we?!1:oe.keepDirty?n.isDirty:!!(oe.keepDefaultValues&&!as(Q,i)),isSubmitted:oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:we?{}:oe.keepDirtyValues?oe.keepDefaultValues&&o?ic(i,o):n.dirtyFields:oe.keepDefaultValues&&Q?ic(i,Q):oe.keepDirty?n.dirtyFields:{},touchedFields:oe.keepTouched?n.touchedFields:{},errors:oe.keepErrors?n.errors:{},isSubmitSuccessful:oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Me=(Q,oe)=>ve(Ni(Q)?Q(o):Q,oe);return{control:{register:re,unregister:J,getFieldState:V,handleSubmit:ke,setError:G,_executeSchema:M,_getWatch:H,_getDirty:F,_updateValid:k,_removeUnmounted:$,_updateFieldArray:E,_updateDisabledField:ee,_getFieldArray:I,_reset:ve,_resetDefaultValues:()=>Ni(t.defaultValues)&&t.defaultValues().then(Q=>{Me(Q,t.resetOptions),h.state.next({isLoading:!1})}),_updateFormState:Q=>{n={...n,...Q}},_disableForm:he,_subjects:h,_proxyFormState:f,_setErrors:N,get _fields(){return r},get _formValues(){return o},get _state(){return s},set _state(Q){s=Q},get _defaultValues(){return i},get _names(){return a},set _names(Q){a=Q},get _formState(){return n},set _formState(Q){n=Q},get _options(){return t},set _options(Q){t={...t,...Q}}},trigger:L,register:re,handleSubmit:ke,watch:K,setValue:Z,getValues:U,reset:Me,resetField:fe,clearErrors:D,unregister:J,setError:G,setFocus:(Q,oe={})=>{const ae=Ne(r,Q),Ce=ae&&ae._f;if(Ce){const we=Ce.refs?Ce.refs[0]:Ce.ref;we.focus&&(we.focus(),oe.shouldSelect&&Ni(we.select)&&we.select())}},getFieldState:V}}function xre(e={}){const t=ne.useRef(void 0),n=ne.useRef(void 0),[r,i]=ne.useState({isDirty:!1,isValidating:!1,isLoading:Ni(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Ni(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...vre(e),formState:r});const o=t.current.control;return o._options=e,Lm({subject:o._subjects.state,next:s=>{nL(s,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),ne.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ne.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==r.isDirty&&o._subjects.state.next({isDirty:s})}},[o,r.isDirty]),ne.useEffect(()=>{e.values&&!as(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(s=>({...s}))):o._resetDefaultValues()},[e.values,o]),ne.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),ne.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),ne.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=tL(r,o),t.current}const bT=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ne(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},hL=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?bT(r.ref,n,e):r.refs&&r.refs.forEach(i=>bT(i,n,e))}},wre=(e,t)=>{t.shouldUseNativeValidation&&hL(e,t);const n={};for(const r in e){const i=Ne(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(bre(t.names||Object.keys(e),r)){const s=Object.assign({},Ne(n,r));St(s,"root",o),St(n,r,s)}else St(n,r,o)}return n},bre=(e,t)=>e.some(n=>n.startsWith(t+"."));var kre=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[s]={message:a.message,type:a.code}}else n[s]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(h){return e.push(h)})}),t){var u=n[s].types,c=u&&u[r.code];n[s]=oL(s,t,n,i,c?[].concat(c,r.message):r.message)}e.shift()}return n},Sre=function(e,t,n){return n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(s,a){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return o.shouldUseNativeValidation&&hL({},o),{errors:{},values:n.raw?r:c}})}catch(c){return a(c)}return u&&u.then?u.then(void 0,a):u}(0,function(s){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(s))return{values:{},errors:wre(kre(s.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw s}))}catch(s){return Promise.reject(s)}}},vt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.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(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(vt||(vt={}));var _w;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(_w||(_w={}));const Oe=vt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),so=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},Se=vt.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"]),Ere=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ar extends Error{get errors(){return this.issues}constructor(t){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=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,u=0;for(;u<s.path.length;){const c=s.path[u];u===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(this),r}static assert(t){if(!(t instanceof Ar))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,vt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=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(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ar.create=e=>new Ar(e);const jl=(e,t)=>{let n;switch(e.code){case Se.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,vt.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${vt.joinValues(e.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${vt.joinValues(e.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${vt.joinValues(e.options)}, received '${e.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:vt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Se.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Se.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=t.defaultError,vt.assertNever(e)}return{message:n}};let pL=jl;function Cre(e){pL=e}function Op(){return pL}const Ip=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="";const u=r.filter(c=>!!c).slice().reverse();for(const c of u)a=c(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}},_re=[];function Pe(e,t){const n=Op(),r=Ip({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===jl?void 0:jl].filter(i=>!!i)});e.common.issues.push(r)}class Hn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return nt;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return Hn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return nt;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const nt=Object.freeze({status:"aborted"}),gl=e=>({status:"dirty",value:e}),er=e=>({status:"valid",value:e}),Nw=e=>e.status==="aborted",Tw=e=>e.status==="dirty",ca=e=>e.status==="valid",Jc=e=>typeof Promise<"u"&&e instanceof Promise;function jp(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function mL(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ve||(Ve={}));var gc,yc;class zi{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,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 kT=(e,t)=>{if(ca(t))return{success:!0,data:t.value};if(!e.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 Ar(e.common.issues);return this._error=n,this._error}}};function st(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>{var u,c;const{message:f}=e;return s.code==="invalid_enum_value"?{message:f??a.defaultError}:typeof a.data>"u"?{message:(u=f??r)!==null&&u!==void 0?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(c=f??n)!==null&&c!==void 0?c:a.defaultError}},description:i}}class ut{get description(){return this._def.description}_getType(t){return so(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:so(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Hn,ctx:{common:t.parent.common,data:t.data,parsedType:so(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Jc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,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:t,parsedType:so(t)},o=this._parseSync({data:t,path:i.path,parent:i});return kT(i,o)}"~validate"(t){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:so(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:i});return ca(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((r=(n=o==null?void 0:o.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(o=>ca(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,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:t,parsedType:so(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Jc(i)?i:Promise.resolve(i));return kT(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:Se.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new hi({schema:this,typeName:et.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Oi.create(this,this._def)}nullable(){return ws.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pr.create(this)}promise(){return $l.create(this,this._def)}or(t){return da.create([this,t],this._def)}and(t){return nd.create(this,t,this._def)}transform(t){return new hi({...st(this._def),schema:this,typeName:et.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new sd({...st(this._def),innerType:this,defaultValue:n,typeName:et.ZodDefault})}brand(){return new ok({typeName:et.ZodBranded,type:this,...st(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new ad({...st(this._def),innerType:this,catchValue:n,typeName:et.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Hd.create(this,t)}readonly(){return ld.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Nre=/^c[^\s-]{8,}$/i,Tre=/^[0-9a-z]+$/,Are=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Pre=/^[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,Rre=/^[a-z0-9_-]{21}$/i,Mre=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Dre=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ore=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ire="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let hx;const jre=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Lre=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Fre=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,zre=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$re=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Bre=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gL="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Vre=new RegExp(`^${gL}$`);function yL(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Wre(e){return new RegExp(`^${yL(e)}$`)}function vL(e){let t=`${gL}T${yL(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ure(e,t){return!!((t==="v4"||!t)&&jre.test(e)||(t==="v6"||!t)&&Fre.test(e))}function Hre(e,t){if(!Mre.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function Yre(e,t){return!!((t==="v4"||!t)&&Lre.test(e)||(t==="v6"||!t)&&zre.test(e))}class si extends ut{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const o=this._getOrReturnCtx(t);return Pe(o,{code:Se.invalid_type,expected:Oe.string,received:o.parsedType}),nt}const r=new Hn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Pe(i,{code:Se.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Pe(i,{code:Se.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Ore.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"email",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")hx||(hx=new RegExp(Ire,"u")),hx.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"emoji",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Pre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"uuid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")Rre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"nanoid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Nre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"cuid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Tre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"cuid2",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Are.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"ulid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Pe(i,{validation:"url",code:Se.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"regex",code:Se.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?vL(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?Vre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Wre(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Dre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"duration",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Ure(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"ip",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Hre(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"jwt",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Yre(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"cidr",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?$re.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"base64",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?Bre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"base64url",code:Se.invalid_string,message:o.message}),r.dirty()):vt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Se.invalid_string,...Ve.errToObj(r)})}_addCheck(t){return new si({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ve.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ve.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ve.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ve.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ve.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ve.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Ve.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ve.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ve.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ve.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ve.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ve.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ve.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ve.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ve.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ve.errToObj(n)})}nonempty(t){return this.min(1,Ve.errToObj(t))}trim(){return new si({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new si({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new si({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}si.create=e=>{var t;return new si({checks:[],typeName:et.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...st(e)})};function qre(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class So extends ut{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const o=this._getOrReturnCtx(t);return Pe(o,{code:Se.invalid_type,expected:Oe.number,received:o.parsedType}),nt}let r;const i=new Hn;for(const o of this._def.checks)o.kind==="int"?vt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?qre(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.not_finite,message:o.message}),i.dirty()):vt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new So({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new So({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ve.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&vt.isInteger(t.value))}get isFinite(){let t=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"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}So.create=e=>new So({checks:[],typeName:et.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...st(e)});class vs extends ut{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Oe.bigint)return this._getInvalidInput(t);let r;const i=new Hn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):vt.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Pe(n,{code:Se.invalid_type,expected:Oe.bigint,received:n.parsedType}),nt}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new vs({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new vs({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vs.create=e=>{var t;return new vs({checks:[],typeName:et.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...st(e)})};class Ll extends ut{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.boolean,received:r.parsedType}),nt}return er(t.data)}}Ll.create=e=>new Ll({typeName:et.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...st(e)});class xs extends ut{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const o=this._getOrReturnCtx(t);return Pe(o,{code:Se.invalid_type,expected:Oe.date,received:o.parsedType}),nt}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Pe(o,{code:Se.invalid_date}),nt}const r=new Hn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):vt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new xs({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ve.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ve.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}xs.create=e=>new xs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:et.ZodDate,...st(e)});class Lp extends ut{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.symbol,received:r.parsedType}),nt}return er(t.data)}}Lp.create=e=>new Lp({typeName:et.ZodSymbol,...st(e)});class ed extends ut{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.undefined,received:r.parsedType}),nt}return er(t.data)}}ed.create=e=>new ed({typeName:et.ZodUndefined,...st(e)});class td extends ut{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.null,received:r.parsedType}),nt}return er(t.data)}}td.create=e=>new td({typeName:et.ZodNull,...st(e)});class Fl extends ut{constructor(){super(...arguments),this._any=!0}_parse(t){return er(t.data)}}Fl.create=e=>new Fl({typeName:et.ZodAny,...st(e)});class ia extends ut{constructor(){super(...arguments),this._unknown=!0}_parse(t){return er(t.data)}}ia.create=e=>new ia({typeName:et.ZodUnknown,...st(e)});class Eo extends ut{_parse(t){const n=this._getOrReturnCtx(t);return Pe(n,{code:Se.invalid_type,expected:Oe.never,received:n.parsedType}),nt}}Eo.create=e=>new Eo({typeName:et.ZodNever,...st(e)});class Fp extends ut{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.void,received:r.parsedType}),nt}return er(t.data)}}Fp.create=e=>new Fp({typeName:et.ZodVoid,...st(e)});class Pr extends ut{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Pe(n,{code:Se.invalid_type,expected:Oe.array,received:n.parsedType}),nt;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Pe(n,{code:s?Se.too_big:Se.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?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&&(Pe(n,{code:Se.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&&(Pe(n,{code:Se.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((s,a)=>i.type._parseAsync(new zi(n,s,n.path,a)))).then(s=>Hn.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new zi(n,s,n.path,a)));return Hn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Pr({...this._def,minLength:{value:t,message:Ve.toString(n)}})}max(t,n){return new Pr({...this._def,maxLength:{value:t,message:Ve.toString(n)}})}length(t,n){return new Pr({...this._def,exactLength:{value:t,message:Ve.toString(n)}})}nonempty(t){return this.min(1,t)}}Pr.create=(e,t)=>new Pr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:et.ZodArray,...st(t)});function ll(e){if(e instanceof Xt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Oi.create(ll(r))}return new Xt({...e._def,shape:()=>t})}else return e instanceof Pr?new Pr({...e._def,type:ll(e.element)}):e instanceof Oi?Oi.create(ll(e.unwrap())):e instanceof ws?ws.create(ll(e.unwrap())):e instanceof $i?$i.create(e.items.map(t=>ll(t))):e}class Xt extends ut{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=vt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const c=this._getOrReturnCtx(t);return Pe(c,{code:Se.invalid_type,expected:Oe.object,received:c.parsedType}),nt}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Eo&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const u=[];for(const c of s){const f=o[c],h=i.data[c];u.push({key:{status:"valid",value:c},value:f._parse(new zi(i,h,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Eo){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of a)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(c==="strict")a.length>0&&(Pe(i,{code:Se.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of a){const h=i.data[f];u.push({key:{status:"valid",value:f},value:c._parse(new zi(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of u){const h=await f.key,p=await f.value;c.push({key:h,value:p,alwaysSet:f.alwaysSet})}return c}).then(c=>Hn.mergeObjectSync(r,c)):Hn.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return Ve.errToObj,new Xt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const u=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ve.errToObj(t).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Xt({...this._def,unknownKeys:"strip"})}passthrough(){return new Xt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Xt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Xt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:et.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Xt({...this._def,catchall:t})}pick(t){const n={};return vt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Xt({...this._def,shape:()=>n})}omit(t){const n={};return vt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Xt({...this._def,shape:()=>n})}deepPartial(){return ll(this)}partial(t){const n={};return vt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Xt({...this._def,shape:()=>n})}required(t){const n={};return vt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Oi;)o=o._def.innerType;n[r]=o}}),new Xt({...this._def,shape:()=>n})}keyof(){return xL(vt.objectKeys(this.shape))}}Xt.create=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strip",catchall:Eo.create(),typeName:et.ZodObject,...st(t)});Xt.strictCreate=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strict",catchall:Eo.create(),typeName:et.ZodObject,...st(t)});Xt.lazycreate=(e,t)=>new Xt({shape:e,unknownKeys:"strip",catchall:Eo.create(),typeName:et.ZodObject,...st(t)});class da extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Ar(a.ctx.common.issues));return Pe(n,{code:Se.invalid_union,unionErrors:s}),nt}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const u of r){const c={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(u=>new Ar(u));return Pe(n,{code:Se.invalid_union,unionErrors:a}),nt}}get options(){return this._def.options}}da.create=(e,t)=>new da({options:e,typeName:et.ZodUnion,...st(t)});const oo=e=>e instanceof id?oo(e.schema):e instanceof hi?oo(e.innerType()):e instanceof zl?[e.value]:e instanceof Bi?e.options:e instanceof od?vt.objectValues(e.enum):e instanceof sd?oo(e._def.innerType):e instanceof ed?[void 0]:e instanceof td?[null]:e instanceof Oi?[void 0,...oo(e.unwrap())]:e instanceof ws?[null,...oo(e.unwrap())]:e instanceof ok||e instanceof ld?oo(e.unwrap()):e instanceof ad?oo(e._def.innerType):[];class Fm extends ut{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Pe(n,{code:Se.invalid_type,expected:Oe.object,received:n.parsedType}),nt;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}):(Pe(n,{code:Se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),nt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=oo(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Fm({typeName:et.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...st(r)})}}function Aw(e,t){const n=so(e),r=so(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=vt.objectKeys(t),o=vt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const u=Aw(e[a],t[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],u=Aw(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class nd extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(Nw(o)||Nw(s))return nt;const a=Aw(o.value,s.value);return a.valid?((Tw(o)||Tw(s))&&n.dirty(),{status:n.value,value:a.data}):(Pe(r,{code:Se.invalid_intersection_types}),nt)};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,s])=>i(o,s)):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}))}}nd.create=(e,t,n)=>new nd({left:e,right:t,typeName:et.ZodIntersection,...st(n)});class $i extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Pe(r,{code:Se.invalid_type,expected:Oe.array,received:r.parsedType}),nt;if(r.data.length<this._def.items.length)return Pe(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nt;!this._def.rest&&r.data.length>this._def.items.length&&(Pe(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const u=this._def.items[a]||this._def.rest;return u?u._parse(new zi(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Hn.mergeArray(n,s)):Hn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new $i({...this._def,rest:t})}}$i.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $i({items:e,typeName:et.ZodTuple,rest:null,...st(t)})};class rd extends ut{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Pe(r,{code:Se.invalid_type,expected:Oe.object,received:r.parsedType}),nt;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new zi(r,a,r.path,a)),value:s._parse(new zi(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Hn.mergeObjectAsync(n,i):Hn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ut?new rd({keyType:t,valueType:n,typeName:et.ZodRecord,...st(r)}):new rd({keyType:si.create(),valueType:t,typeName:et.ZodRecord,...st(n)})}}class zp extends ut{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Pe(r,{code:Se.invalid_type,expected:Oe.map,received:r.parsedType}),nt;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,u],c)=>({key:i._parse(new zi(r,a,r.path,[c,"key"])),value:o._parse(new zi(r,u,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const u of s){const c=await u.key,f=await u.value;if(c.status==="aborted"||f.status==="aborted")return nt;(c.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(c.value,f.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const u of s){const c=u.key,f=u.value;if(c.status==="aborted"||f.status==="aborted")return nt;(c.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(c.value,f.value)}return{status:n.value,value:a}}}}zp.create=(e,t,n)=>new zp({valueType:t,keyType:e,typeName:et.ZodMap,...st(n)});class fa extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Pe(r,{code:Se.invalid_type,expected:Oe.set,received:r.parsedType}),nt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Pe(r,{code:Se.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&&(Pe(r,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(u){const c=new Set;for(const f of u){if(f.status==="aborted")return nt;f.status==="dirty"&&n.dirty(),c.add(f.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((u,c)=>o._parse(new zi(r,u,r.path,c)));return r.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(t,n){return new fa({...this._def,minSize:{value:t,message:Ve.toString(n)}})}max(t,n){return new fa({...this._def,maxSize:{value:t,message:Ve.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}fa.create=(e,t)=>new fa({valueType:e,minSize:null,maxSize:null,typeName:et.ZodSet,...st(t)});class _l extends ut{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Pe(n,{code:Se.invalid_type,expected:Oe.function,received:n.parsedType}),nt;function r(a,u){return Ip({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Op(),jl].filter(c=>!!c),issueData:{code:Se.invalid_arguments,argumentsError:u}})}function i(a,u){return Ip({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Op(),jl].filter(c=>!!c),issueData:{code:Se.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof $l){const a=this;return er(async function(...u){const c=new Ar([]),f=await a._def.args.parseAsync(u,o).catch(m=>{throw c.addIssue(r(u,m)),c}),h=await Reflect.apply(s,this,f);return await a._def.returns._def.type.parseAsync(h,o).catch(m=>{throw c.addIssue(i(h,m)),c})})}else{const a=this;return er(function(...u){const c=a._def.args.safeParse(u,o);if(!c.success)throw new Ar([r(u,c.error)]);const f=Reflect.apply(s,this,c.data),h=a._def.returns.safeParse(f,o);if(!h.success)throw new Ar([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new _l({...this._def,args:$i.create(t).rest(ia.create())})}returns(t){return new _l({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new _l({args:t||$i.create([]).rest(ia.create()),returns:n||ia.create(),typeName:et.ZodFunction,...st(r)})}}class id extends ut{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}id.create=(e,t)=>new id({getter:e,typeName:et.ZodLazy,...st(t)});class zl extends ut{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Pe(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:t.data}}get value(){return this._def.value}}zl.create=(e,t)=>new zl({value:e,typeName:et.ZodLiteral,...st(t)});function xL(e,t){return new Bi({values:e,typeName:et.ZodEnum,...st(t)})}class Bi extends ut{constructor(){super(...arguments),gc.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Pe(n,{expected:vt.joinValues(r),received:n.parsedType,code:Se.invalid_type}),nt}if(jp(this,gc)||mL(this,gc,new Set(this._def.values)),!jp(this,gc).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Pe(n,{received:n.data,code:Se.invalid_enum_value,options:r}),nt}return er(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Bi.create(t,{...this._def,...n})}exclude(t,n=this._def){return Bi.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}gc=new WeakMap;Bi.create=xL;class od extends ut{constructor(){super(...arguments),yc.set(this,void 0)}_parse(t){const n=vt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=vt.objectValues(n);return Pe(r,{expected:vt.joinValues(i),received:r.parsedType,code:Se.invalid_type}),nt}if(jp(this,yc)||mL(this,yc,new Set(vt.getValidEnumValues(this._def.values))),!jp(this,yc).has(t.data)){const i=vt.objectValues(n);return Pe(r,{received:r.data,code:Se.invalid_enum_value,options:i}),nt}return er(t.data)}get enum(){return this._def.values}}yc=new WeakMap;od.create=(e,t)=>new od({values:e,typeName:et.ZodNativeEnum,...st(t)});class $l extends ut{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Pe(n,{code:Se.invalid_type,expected:Oe.promise,received:n.parsedType}),nt;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return er(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}$l.create=(e,t)=>new $l({type:e,typeName:et.ZodPromise,...st(t)});class hi extends ut{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===et.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{Pe(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return nt;const u=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return u.status==="aborted"?nt:u.status==="dirty"||n.value==="dirty"?gl(u.value):u});{if(n.value==="aborted")return nt;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?nt:a.status==="dirty"||n.value==="dirty"?gl(a.value):a}}if(i.type==="refinement"){const s=a=>{const u=i.refinement(a,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?nt:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?nt:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ca(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ca(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);vt.assertNever(i)}}hi.create=(e,t,n)=>new hi({schema:e,typeName:et.ZodEffects,effect:t,...st(n)});hi.createWithPreprocess=(e,t,n)=>new hi({schema:t,effect:{type:"preprocess",transform:e},typeName:et.ZodEffects,...st(n)});class Oi extends ut{_parse(t){return this._getType(t)===Oe.undefined?er(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Oi.create=(e,t)=>new Oi({innerType:e,typeName:et.ZodOptional,...st(t)});class ws extends ut{_parse(t){return this._getType(t)===Oe.null?er(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ws.create=(e,t)=>new ws({innerType:e,typeName:et.ZodNullable,...st(t)});class sd extends ut{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}sd.create=(e,t)=>new sd({innerType:e,typeName:et.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...st(t)});class ad extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Jc(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ar(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ar(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ad.create=(e,t)=>new ad({innerType:e,typeName:et.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...st(t)});class $p extends ut{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.nan,received:r.parsedType}),nt}return{status:"valid",value:t.data}}}$p.create=e=>new $p({typeName:et.ZodNaN,...st(e)});const Gre=Symbol("zod_brand");class ok extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Hd extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);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"?nt:o.status==="dirty"?(n.dirty(),gl(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"?nt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Hd({in:t,out:n,typeName:et.ZodPipeline})}}class ld extends ut{_parse(t){const n=this._def.innerType._parse(t),r=i=>(ca(i)&&(i.value=Object.freeze(i.value)),i);return Jc(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}ld.create=(e,t)=>new ld({innerType:e,typeName:et.ZodReadonly,...st(t)});function wL(e,t={},n){return e?Fl.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:u})}}):Fl.create()}const Zre={object:Xt.lazycreate};var et;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(et||(et={}));const Kre=(e,t={message:`Input not instance of ${e.name}`})=>wL(n=>n instanceof e,t),bL=si.create,kL=So.create,Xre=$p.create,Qre=vs.create,SL=Ll.create,Jre=xs.create,eie=Lp.create,tie=ed.create,nie=td.create,rie=Fl.create,iie=ia.create,oie=Eo.create,sie=Fp.create,aie=Pr.create,lie=Xt.create,uie=Xt.strictCreate,cie=da.create,die=Fm.create,fie=nd.create,hie=$i.create,pie=rd.create,mie=zp.create,gie=fa.create,yie=_l.create,vie=id.create,xie=zl.create,wie=Bi.create,bie=od.create,kie=$l.create,ST=hi.create,Sie=Oi.create,Eie=ws.create,Cie=hi.createWithPreprocess,_ie=Hd.create,Nie=()=>bL().optional(),Tie=()=>kL().optional(),Aie=()=>SL().optional(),Pie={string:e=>si.create({...e,coerce:!0}),number:e=>So.create({...e,coerce:!0}),boolean:e=>Ll.create({...e,coerce:!0}),bigint:e=>vs.create({...e,coerce:!0}),date:e=>xs.create({...e,coerce:!0})},Rie=nt;var sn=Object.freeze({__proto__:null,defaultErrorMap:jl,setErrorMap:Cre,getErrorMap:Op,makeIssue:Ip,EMPTY_PATH:_re,addIssueToContext:Pe,ParseStatus:Hn,INVALID:nt,DIRTY:gl,OK:er,isAborted:Nw,isDirty:Tw,isValid:ca,isAsync:Jc,get util(){return vt},get objectUtil(){return _w},ZodParsedType:Oe,getParsedType:so,ZodType:ut,datetimeRegex:vL,ZodString:si,ZodNumber:So,ZodBigInt:vs,ZodBoolean:Ll,ZodDate:xs,ZodSymbol:Lp,ZodUndefined:ed,ZodNull:td,ZodAny:Fl,ZodUnknown:ia,ZodNever:Eo,ZodVoid:Fp,ZodArray:Pr,ZodObject:Xt,ZodUnion:da,ZodDiscriminatedUnion:Fm,ZodIntersection:nd,ZodTuple:$i,ZodRecord:rd,ZodMap:zp,ZodSet:fa,ZodFunction:_l,ZodLazy:id,ZodLiteral:zl,ZodEnum:Bi,ZodNativeEnum:od,ZodPromise:$l,ZodEffects:hi,ZodTransformer:hi,ZodOptional:Oi,ZodNullable:ws,ZodDefault:sd,ZodCatch:ad,ZodNaN:$p,BRAND:Gre,ZodBranded:ok,ZodPipeline:Hd,ZodReadonly:ld,custom:wL,Schema:ut,ZodSchema:ut,late:Zre,get ZodFirstPartyTypeKind(){return et},coerce:Pie,any:rie,array:aie,bigint:Qre,boolean:SL,date:Jre,discriminatedUnion:die,effect:ST,enum:wie,function:yie,instanceof:Kre,intersection:fie,lazy:vie,literal:xie,map:mie,nan:Xre,nativeEnum:bie,never:oie,null:nie,nullable:Eie,number:kL,object:lie,oboolean:Aie,onumber:Tie,optional:Sie,ostring:Nie,pipeline:_ie,preprocess:Cie,promise:kie,record:pie,set:gie,strictObject:uie,string:bL,symbol:eie,transformer:ST,tuple:hie,undefined:tie,union:cie,unknown:iie,void:sie,NEVER:Rie,ZodIssueCode:Se,quotelessJson:Ere,ZodError:Ar});const Mie=e=>{const t={};return e.errors.forEach(n=>{if(n.path.length>0){const r=n.path.join(".");t[r]={type:"validation",message:n.message}}}),t};function sk(e){return Function("z",`"use strict";return (${e});`)(sn)}const Die=(e,t)=>async n=>{var s,a;const r=((a=(s=e==null?void 0:e._def)==null?void 0:s.options)==null?void 0:a.find(u=>{var c,f,h;return((h=(f=(c=u==null?void 0:u.shape)==null?void 0:c[t])==null?void 0:f._def)==null?void 0:h.value)===n[t]}))||sn.object({[t]:sn.string()}),i=Object.fromEntries(Object.entries(n).filter(([u])=>{var c;return(c=r==null?void 0:r.shape)==null?void 0:c[u]})),o=r.safeParse(i);if(o.success)return{values:o.data,errors:{}};{const u=Mie(o.error);return{values:{},errors:u}}};function Oie({name:e,control:t,renderField:n}){const{fields:r,append:i,remove:o}=ik({control:t,name:e});return v.jsxs("div",{className:"space-y-2",children:[r.map((s,a)=>v.jsxs("div",{className:"relative flex items-center gap-2",children:[n({fieldName:`${e}.${a}`,index:a}),v.jsx(Bt,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-2 -top-2",onClick:()=>o(a),children:v.jsx(va,{className:"h-4 w-4"})})]},s.id)),v.jsxs(Bt,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:()=>i({}),children:[v.jsx(jc,{className:"mr-2 h-4 w-4"}),"Add Item"]})]})}function EL(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ak="Switch",[Iie,Eve]=Yr(ak),[jie,Lie]=Iie(ak),CL=S.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:u="on",onCheckedChange:c,form:f,...h}=e,[p,m]=S.useState(null),y=pt(t,C=>m(C)),x=S.useRef(!1),k=p?f||!!p.closest("form"):!0,[w=!1,E]=wo({prop:i,defaultProp:o,onChange:c});return v.jsxs(jie,{scope:n,checked:w,disabled:a,children:[v.jsx(Ue.button,{type:"button",role:"switch","aria-checked":w,"aria-required":s,"data-state":TL(w),"data-disabled":a?"":void 0,disabled:a,value:u,...h,ref:y,onClick:Re(e.onClick,C=>{E(N=>!N),k&&(x.current=C.isPropagationStopped(),x.current||C.stopPropagation())})}),k&&v.jsx(Fie,{control:p,bubbles:!x.current,name:r,value:u,checked:w,required:s,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});CL.displayName=ak;var _L="SwitchThumb",NL=S.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Lie(_L,n);return v.jsx(Ue.span,{"data-state":TL(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});NL.displayName=_L;var Fie=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=S.useRef(null),s=EL(n),a=mI(t);return S.useEffect(()=>{const u=o.current,c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});h.call(u,n),u.dispatchEvent(p)}},[s,n,r]),v.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function TL(e){return e?"checked":"unchecked"}var AL=CL,zie=NL;const PL=S.forwardRef(({className:e,...t},n)=>v.jsx(AL,{className:Te("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm 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-mastra-bg-7 data-[state=unchecked]:bg-input",e),...t,ref:n,children:v.jsx(zie,{className:Te("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));PL.displayName=AL.displayName;function $ie({name:e,control:t,handleFieldChange:n}){return v.jsx(cu,{name:e,control:t,render:({field:r})=>v.jsx(PL,{checked:r.value,onCheckedChange:i=>{r.onChange(i),n==null||n({key:e,value:i})}})})}const Bie=ru("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Vie({className:e,variant:t,...n}){return v.jsx("div",{className:Te(Bie({variant:t}),e),...n})}var ET=1,Wie=.9,Uie=.8,Hie=.17,px=.1,mx=.999,Yie=.9999,qie=.99,Gie=/[\\\/_+.#"@\[\(\{&]/,Zie=/[\\\/_+.#"@\[\(\{&]/g,Kie=/[\s-]/,RL=/[\s-]/g;function Pw(e,t,n,r,i,o,s){if(o===t.length)return i===e.length?ET:qie;var a=`${i},${o}`;if(s[a]!==void 0)return s[a];for(var u=r.charAt(o),c=n.indexOf(u,i),f=0,h,p,m,y;c>=0;)h=Pw(e,t,n,r,c+1,o+1,s),h>f&&(c===i?h*=ET:Gie.test(e.charAt(c-1))?(h*=Uie,m=e.slice(i,c-1).match(Zie),m&&i>0&&(h*=Math.pow(mx,m.length))):Kie.test(e.charAt(c-1))?(h*=Wie,y=e.slice(i,c-1).match(RL),y&&i>0&&(h*=Math.pow(mx,y.length))):(h*=Hie,i>0&&(h*=Math.pow(mx,c-i))),e.charAt(c)!==t.charAt(o)&&(h*=Yie)),(h<px&&n.charAt(c-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(c-1)!==r.charAt(o))&&(p=Pw(e,t,n,r,c+1,o+2,s),p*px>h&&(h=p*px)),h>f&&(f=h),c=n.indexOf(u,c+1);return s[a]=f,f}function CT(e){return e.toLowerCase().replace(RL," ")}function Xie(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Pw(e,t,CT(e),CT(t),0,0,{})}var sc='[cmdk-group=""]',gx='[cmdk-group-items=""]',Qie='[cmdk-group-heading=""]',lk='[cmdk-item=""]',_T=`${lk}:not([aria-disabled="true"])`,Rw="cmdk-item-select",Ks="data-value",Jie=(e,t,n)=>Xie(e,t,n),ML=S.createContext(void 0),Yd=()=>S.useContext(ML),DL=S.createContext(void 0),uk=()=>S.useContext(DL),OL=S.createContext(void 0),IL=S.forwardRef((e,t)=>{let n=ul(()=>{var V,D;return{search:"",value:(D=(V=e.value)!=null?V:e.defaultValue)!=null?D:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=ul(()=>new Set),i=ul(()=>new Map),o=ul(()=>new Map),s=ul(()=>new Set),a=jL(e),{label:u,children:c,value:f,onValueChange:h,filter:p,shouldFilter:m,loop:y,disablePointerSelection:x=!1,vimBindings:k=!0,...w}=e,E=En(),C=En(),N=En(),P=S.useRef(null),A=coe();ha(()=>{if(f!==void 0){let V=f.trim();n.current.value=V,O.emit()}},[f]),ha(()=>{A(6,H)},[]);let O=S.useMemo(()=>({subscribe:V=>(s.current.add(V),()=>s.current.delete(V)),snapshot:()=>n.current,setState:(V,D,G)=>{var K,J,ee;if(!Object.is(n.current[V],D)){if(n.current[V]=D,V==="search")F(),R(),A(1,$);else if(V==="value"&&(G||A(5,H),((K=a.current)==null?void 0:K.value)!==void 0)){let re=D??"";(ee=(J=a.current).onValueChange)==null||ee.call(J,re);return}O.emit()}},emit:()=>{s.current.forEach(V=>V())}}),[]),M=S.useMemo(()=>({value:(V,D,G)=>{var K;D!==((K=o.current.get(V))==null?void 0:K.value)&&(o.current.set(V,{value:D,keywords:G}),n.current.filtered.items.set(V,j(D,G)),A(2,()=>{R(),O.emit()}))},item:(V,D)=>(r.current.add(V),D&&(i.current.has(D)?i.current.get(D).add(V):i.current.set(D,new Set([V]))),A(3,()=>{F(),R(),n.current.value||$(),O.emit()}),()=>{o.current.delete(V),r.current.delete(V),n.current.filtered.items.delete(V);let G=I();A(4,()=>{F(),(G==null?void 0:G.getAttribute("id"))===V&&$(),O.emit()})}),group:V=>(i.current.has(V)||i.current.set(V,new Set),()=>{o.current.delete(V),i.current.delete(V)}),filter:()=>a.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:E,inputId:N,labelId:C,listInnerRef:P}),[]);function j(V,D){var G,K;let J=(K=(G=a.current)==null?void 0:G.filter)!=null?K:Jie;return V?J(V,n.current.search,D):0}function R(){if(!n.current.search||a.current.shouldFilter===!1)return;let V=n.current.filtered.items,D=[];n.current.filtered.groups.forEach(K=>{let J=i.current.get(K),ee=0;J.forEach(re=>{let ue=V.get(re);ee=Math.max(ue,ee)}),D.push([K,ee])});let G=P.current;q().sort((K,J)=>{var ee,re;let ue=K.getAttribute("id"),he=J.getAttribute("id");return((ee=V.get(he))!=null?ee:0)-((re=V.get(ue))!=null?re:0)}).forEach(K=>{let J=K.closest(gx);J?J.appendChild(K.parentElement===J?K:K.closest(`${gx} > *`)):G.appendChild(K.parentElement===G?K:K.closest(`${gx} > *`))}),D.sort((K,J)=>J[1]-K[1]).forEach(K=>{var J;let ee=(J=P.current)==null?void 0:J.querySelector(`${sc}[${Ks}="${encodeURIComponent(K[0])}"]`);ee==null||ee.parentElement.appendChild(ee)})}function $(){let V=q().find(G=>G.getAttribute("aria-disabled")!=="true"),D=V==null?void 0:V.getAttribute(Ks);O.setState("value",D||void 0)}function F(){var V,D,G,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let J=0;for(let ee of r.current){let re=(D=(V=o.current.get(ee))==null?void 0:V.value)!=null?D:"",ue=(K=(G=o.current.get(ee))==null?void 0:G.keywords)!=null?K:[],he=j(re,ue);n.current.filtered.items.set(ee,he),he>0&&J++}for(let[ee,re]of i.current)for(let ue of re)if(n.current.filtered.items.get(ue)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=J}function H(){var V,D,G;let K=I();K&&(((V=K.parentElement)==null?void 0:V.firstChild)===K&&((G=(D=K.closest(sc))==null?void 0:D.querySelector(Qie))==null||G.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function I(){var V;return(V=P.current)==null?void 0:V.querySelector(`${lk}[aria-selected="true"]`)}function q(){var V;return Array.from(((V=P.current)==null?void 0:V.querySelectorAll(_T))||[])}function Y(V){let D=q()[V];D&&O.setState("value",D.getAttribute(Ks))}function Z(V){var D;let G=I(),K=q(),J=K.findIndex(re=>re===G),ee=K[J+V];(D=a.current)!=null&&D.loop&&(ee=J+V<0?K[K.length-1]:J+V===K.length?K[0]:K[J+V]),ee&&O.setState("value",ee.getAttribute(Ks))}function B(V){let D=I(),G=D==null?void 0:D.closest(sc),K;for(;G&&!K;)G=V>0?loe(G,sc):uoe(G,sc),K=G==null?void 0:G.querySelector(_T);K?O.setState("value",K.getAttribute(Ks)):Z(V)}let W=()=>Y(q().length-1),L=V=>{V.preventDefault(),V.metaKey?W():V.altKey?B(1):Z(1)},U=V=>{V.preventDefault(),V.metaKey?Y(0):V.altKey?B(-1):Z(-1)};return S.createElement(Ue.div,{ref:t,tabIndex:-1,...w,"cmdk-root":"",onKeyDown:V=>{var D;if((D=w.onKeyDown)==null||D.call(w,V),!V.defaultPrevented)switch(V.key){case"n":case"j":{k&&V.ctrlKey&&L(V);break}case"ArrowDown":{L(V);break}case"p":case"k":{k&&V.ctrlKey&&U(V);break}case"ArrowUp":{U(V);break}case"Home":{V.preventDefault(),Y(0);break}case"End":{V.preventDefault(),W();break}case"Enter":if(!V.nativeEvent.isComposing&&V.keyCode!==229){V.preventDefault();let G=I();if(G){let K=new Event(Rw);G.dispatchEvent(K)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:foe},u),zm(e,V=>S.createElement(DL.Provider,{value:O},S.createElement(ML.Provider,{value:M},V))))}),eoe=S.forwardRef((e,t)=>{var n,r;let i=En(),o=S.useRef(null),s=S.useContext(OL),a=Yd(),u=jL(e),c=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;ha(()=>{if(!c)return a.item(i,s==null?void 0:s.id)},[c]);let f=LL(i,o,[e.value,e.children,o],e.keywords),h=uk(),p=pa(A=>A.value&&A.value===f.current),m=pa(A=>c||a.filter()===!1?!0:A.search?A.filtered.items.get(i)>0:!0);S.useEffect(()=>{let A=o.current;if(!(!A||e.disabled))return A.addEventListener(Rw,y),()=>A.removeEventListener(Rw,y)},[m,e.onSelect,e.disabled]);function y(){var A,O;x(),(O=(A=u.current).onSelect)==null||O.call(A,f.current)}function x(){h.setState("value",f.current,!0)}if(!m)return null;let{disabled:k,value:w,onSelect:E,forceMount:C,keywords:N,...P}=e;return S.createElement(Ue.div,{ref:ud([o,t]),...P,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!p,"data-disabled":!!k,"data-selected":!!p,onPointerMove:k||a.getDisablePointerSelection()?void 0:x,onClick:k?void 0:y},e.children)}),toe=S.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=En(),a=S.useRef(null),u=S.useRef(null),c=En(),f=Yd(),h=pa(m=>i||f.filter()===!1?!0:m.search?m.filtered.groups.has(s):!0);ha(()=>f.group(s),[]),LL(s,a,[e.value,e.heading,u]);let p=S.useMemo(()=>({id:s,forceMount:i}),[i]);return S.createElement(Ue.div,{ref:ud([a,t]),...o,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&S.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),zm(e,m=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},S.createElement(OL.Provider,{value:p},m))))}),noe=S.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=S.useRef(null),o=pa(s=>!s.search);return!n&&!o?null:S.createElement(Ue.div,{ref:ud([i,t]),...r,"cmdk-separator":"",role:"separator"})}),roe=S.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=uk(),s=pa(f=>f.search),a=pa(f=>f.value),u=Yd(),c=S.useMemo(()=>{var f;let h=(f=u.listInnerRef.current)==null?void 0:f.querySelector(`${lk}[${Ks}="${encodeURIComponent(a)}"]`);return h==null?void 0:h.getAttribute("id")},[]);return S.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),S.createElement(Ue.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":c,id:u.inputId,type:"text",value:i?e.value:s,onChange:f=>{i||o.setState("search",f.target.value),n==null||n(f.target.value)}})}),ioe=S.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=S.useRef(null),s=S.useRef(null),a=Yd();return S.useEffect(()=>{if(s.current&&o.current){let u=s.current,c=o.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let p=u.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),S.createElement(Ue.div,{ref:ud([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},zm(e,u=>S.createElement("div",{ref:ud([s,a.listInnerRef]),"cmdk-list-sizer":""},u)))}),ooe=S.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...a}=e;return S.createElement(NO,{open:n,onOpenChange:r},S.createElement(TO,{container:s},S.createElement(AO,{"cmdk-overlay":"",className:i}),S.createElement(PO,{"aria-label":e.label,"cmdk-dialog":"",className:o},S.createElement(IL,{ref:t,...a}))))}),soe=S.forwardRef((e,t)=>pa(n=>n.filtered.count===0)?S.createElement(Ue.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),aoe=S.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return S.createElement(Ue.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},zm(e,s=>S.createElement("div",{"aria-hidden":!0},s)))}),hr=Object.assign(IL,{List:ioe,Item:eoe,Input:roe,Group:toe,Separator:noe,Dialog:ooe,Empty:soe,Loading:aoe});function loe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function uoe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function jL(e){let t=S.useRef(e);return ha(()=>{t.current=e}),t}var ha=typeof window>"u"?S.useEffect:S.useLayoutEffect;function ul(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function ud(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function pa(e){let t=uk(),n=()=>e(t.snapshot());return MR.useSyncExternalStore(t.subscribe,n,n)}function LL(e,t,n,r=[]){let i=S.useRef(),o=Yd();return ha(()=>{var s;let a=(()=>{var c;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(c=f.current.textContent)==null?void 0:c.trim():i.current}})(),u=r.map(c=>c.trim());o.value(e,a,u),(s=t.current)==null||s.setAttribute(Ks,a),i.current=a}),i}var coe=()=>{let[e,t]=S.useState(),n=ul(()=>new Map);return ha(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function doe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function zm({asChild:e,children:t},n){return e&&S.isValidElement(t)?S.cloneElement(doe(t),{ref:t.ref},n(t.props.children)):n(t)}var foe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const FL=S.forwardRef(({className:e,...t},n)=>v.jsx(hr,{ref:n,className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));FL.displayName=hr.displayName;const zL=S.forwardRef(({className:e,...t},n)=>v.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[v.jsx(qB,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),v.jsx(hr.Input,{ref:n,className:Te("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));zL.displayName=hr.Input.displayName;const $L=S.forwardRef(({className:e,...t},n)=>v.jsx(hr.List,{ref:n,className:Te("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));$L.displayName=hr.List.displayName;const hoe=S.forwardRef((e,t)=>v.jsx(hr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));hoe.displayName=hr.Empty.displayName;const BL=S.forwardRef(({className:e,...t},n)=>v.jsx(hr.Group,{ref:n,className:Te("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));BL.displayName=hr.Group.displayName;const poe=S.forwardRef(({className:e,...t},n)=>v.jsx(hr.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));poe.displayName=hr.Separator.displayName;const Mw=S.forwardRef(({className:e,...t},n)=>v.jsx(hr.Item,{ref:n,className:Te("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Mw.displayName=hr.Item.displayName;var ck="Popover",[VL,Cve]=Yr(ck,[uu]),qd=uu(),[moe,_s]=VL(ck),WL=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=qd(t),u=S.useRef(null),[c,f]=S.useState(!1),[h=!1,p]=wo({prop:r,defaultProp:i,onChange:o});return v.jsx(Mm,{...a,children:v.jsx(moe,{scope:t,contentId:En(),triggerRef:u,open:h,onOpenChange:p,onOpenToggle:S.useCallback(()=>p(m=>!m),[p]),hasCustomAnchor:c,onCustomAnchorAdd:S.useCallback(()=>f(!0),[]),onCustomAnchorRemove:S.useCallback(()=>f(!1),[]),modal:s,children:n})})};WL.displayName=ck;var UL="PopoverAnchor",goe=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=_s(UL,n),o=qd(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return S.useEffect(()=>(s(),()=>a()),[s,a]),v.jsx(Dm,{...o,...r,ref:t})});goe.displayName=UL;var HL="PopoverTrigger",YL=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=_s(HL,n),o=qd(n),s=pt(t,i.triggerRef),a=v.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":XL(i.open),...r,ref:s,onClick:Re(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:v.jsx(Dm,{asChild:!0,...o,children:a})});YL.displayName=HL;var dk="PopoverPortal",[yoe,voe]=VL(dk,{forceMount:void 0}),qL=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=_s(dk,t);return v.jsx(yoe,{scope:t,forceMount:n,children:v.jsx(tr,{present:n||o.open,children:v.jsx(Ld,{asChild:!0,container:i,children:r})})})};qL.displayName=dk;var Bl="PopoverContent",GL=S.forwardRef((e,t)=>{const n=voe(Bl,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=_s(Bl,e.__scopePopover);return v.jsx(tr,{present:r||o.open,children:o.modal?v.jsx(xoe,{...i,ref:t}):v.jsx(woe,{...i,ref:t})})});GL.displayName=Bl;var xoe=S.forwardRef((e,t)=>{const n=_s(Bl,e.__scopePopover),r=S.useRef(null),i=pt(t,r),o=S.useRef(!1);return S.useEffect(()=>{const s=r.current;if(s)return Tm(s)},[]),v.jsx(Fd,{as:Li,allowPinchZoom:!0,children:v.jsx(ZL,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,c=a.button===2||u;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Re(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),woe=S.forwardRef((e,t)=>{const n=_s(Bl,e.__scopePopover),r=S.useRef(!1),i=S.useRef(!1);return v.jsx(ZL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),ZL=S.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:f,...h}=e,p=_s(Bl,n),m=qd(n);return _m(),v.jsx(jd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:v.jsx(Id,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:v.jsx(B1,{"data-state":XL(p.open),role:"dialog",id:p.contentId,...m,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),KL="PopoverClose",boe=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=_s(KL,n);return v.jsx(Ue.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});boe.displayName=KL;var koe="PopoverArrow",Soe=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=qd(n);return v.jsx(V1,{...i,...r,ref:t})});Soe.displayName=koe;function XL(e){return e?"open":"closed"}var Eoe=WL,Coe=YL,_oe=qL,QL=GL;const JL=Eoe,eF=Coe,fk=S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>v.jsx(_oe,{children:v.jsx(QL,{ref:i,align:t,sideOffset:n,className:Te("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",e),...r})}));fk.displayName=QL.displayName;function NT({name:e,control:t,options:n=[],handleFieldChange:r,placeholder:i}){const[o,s]=S.useState(!1),[a,u]=S.useState("");return v.jsx(cu,{name:e,control:t,render:({field:c})=>{const f=c.value||[],h=m=>{const y=f.filter(x=>x!==m);c.onChange(y),r==null||r({key:e,value:y})},p=m=>{if(!m)return;const y=[...f,m];c.onChange(y),r==null||r({key:e,value:y}),u(""),s(!1)};return v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(m=>v.jsxs(Vie,{className:"flex items-center gap-1",children:[m,v.jsx(Bt,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",onClick:()=>h(m),children:v.jsx(va,{className:"h-3 w-3"})})]},m))}),v.jsxs(JL,{open:o,onOpenChange:s,children:[v.jsx(eF,{asChild:!0,children:v.jsxs(Bt,{variant:"outline",size:"sm",className:"w-full justify-start",children:[v.jsx(jc,{className:"mr-2 h-4 w-4"}),i||"Add item"]})}),v.jsx(fk,{className:"p-0",align:"start",children:v.jsxs(FL,{children:[v.jsx(zL,{placeholder:"Enter value...",value:a,onValueChange:u}),v.jsx($L,{children:v.jsxs(BL,{children:[n.filter(m=>!f.includes(m.value)).map(m=>v.jsx(Mw,{onSelect:()=>p(m.value),children:m.label},m.value)),a&&v.jsxs(Mw,{onSelect:()=>p(a),children:['Create "',a,'"']})]})})]})})]})]})}})}const tF=6048e5,Noe=864e5,TT=Symbol.for("constructDateFrom");function Rn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&TT in e?e[TT](t):e instanceof Date?new e.constructor(t):new Date(t)}function jt(e,t){return Rn(t||e,e)}function nF(e,t,n){const r=jt(e,n==null?void 0:n.in);return isNaN(t)?Rn(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function rF(e,t,n){const r=jt(e,n==null?void 0:n.in);if(isNaN(t))return Rn(e,NaN);if(!t)return r;const i=r.getDate(),o=Rn(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const s=o.getDate();return i>=s?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}let Toe={};function Gd(){return Toe}function Vl(e,t){var a,u,c,f;const n=Gd(),r=(t==null?void 0:t.weekStartsOn)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(c=n.locale)==null?void 0:c.options)==null?void 0:f.weekStartsOn)??0,i=jt(e,t==null?void 0:t.in),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function cd(e,t){return Vl(e,{...t,weekStartsOn:1})}function iF(e,t){const n=jt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Rn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=cd(i),s=Rn(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const a=cd(s);return n.getTime()>=o.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function AT(e){const t=jt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Zd(e,...t){const n=Rn.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function dd(e,t){const n=jt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function oF(e,t,n){const[r,i]=Zd(n==null?void 0:n.in,e,t),o=dd(r),s=dd(i),a=+o-AT(o),u=+s-AT(s);return Math.round((a-u)/Noe)}function Aoe(e,t){const n=iF(e,t),r=Rn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),cd(r)}function Poe(e,t,n){return nF(e,t*7,n)}function Roe(e,t,n){return rF(e,t*12,n)}function Moe(e,t){let n,r=t==null?void 0:t.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=Rn.bind(null,i));const o=jt(i,r);(!n||n<o||isNaN(+o))&&(n=o)}),Rn(r,n||NaN)}function Doe(e,t){let n,r=t==null?void 0:t.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=Rn.bind(null,i));const o=jt(i,r);(!n||n>o||isNaN(+o))&&(n=o)}),Rn(r,n||NaN)}function Ooe(e,t,n){const[r,i]=Zd(n==null?void 0:n.in,e,t);return+dd(r)==+dd(i)}function sF(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function aF(e){return!(!sF(e)&&typeof e!="number"||isNaN(+jt(e)))}function Ioe(e,t,n){const[r,i]=Zd(n==null?void 0:n.in,e,t),o=r.getFullYear()-i.getFullYear(),s=r.getMonth()-i.getMonth();return o*12+s}function joe(e,t){const n=jt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Loe(e,t){const n=jt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Foe(e,t){const n=jt(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function lF(e,t){const n=jt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function uF(e,t){var a,u,c,f;const n=Gd(),r=(t==null?void 0:t.weekStartsOn)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(c=n.locale)==null?void 0:c.options)==null?void 0:f.weekStartsOn)??0,i=jt(e,t==null?void 0:t.in),o=i.getDay(),s=(o<r?-7:0)+6-(o-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function zoe(e,t){return uF(e,{...t,weekStartsOn:1})}const $oe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Boe=(e,t,n)=>{let r;const i=$oe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function yx(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Voe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Woe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uoe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Hoe={date:yx({formats:Voe,defaultWidth:"full"}),time:yx({formats:Woe,defaultWidth:"full"}),dateTime:yx({formats:Uoe,defaultWidth:"full"})},Yoe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qoe=(e,t,n,r)=>Yoe[e];function ac(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const Goe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zoe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Koe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Xoe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Qoe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Joe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ese=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},tse={ordinalNumber:ese,era:ac({values:Goe,defaultWidth:"wide"}),quarter:ac({values:Zoe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ac({values:Koe,defaultWidth:"wide"}),day:ac({values:Xoe,defaultWidth:"wide"}),dayPeriod:ac({values:Qoe,defaultWidth:"wide",formattingValues:Joe,defaultFormattingWidth:"wide"})};function lc(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(a)?rse(a,h=>h.test(s)):nse(a,h=>h.test(s));let c;c=e.valueCallback?e.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;const f=t.slice(s.length);return{value:c,rest:f}}}function nse(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function rse(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ise(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const ose=/^(\d+)(th|st|nd|rd)?/i,sse=/\d+/i,ase={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},lse={any:[/^b/i,/^(a|c)/i]},use={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cse={any:[/1/i,/2/i,/3/i,/4/i]},dse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},fse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},hse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},pse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},mse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},gse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yse={ordinalNumber:ise({matchPattern:ose,parsePattern:sse,valueCallback:e=>parseInt(e,10)}),era:lc({matchPatterns:ase,defaultMatchWidth:"wide",parsePatterns:lse,defaultParseWidth:"any"}),quarter:lc({matchPatterns:use,defaultMatchWidth:"wide",parsePatterns:cse,defaultParseWidth:"any",valueCallback:e=>e+1}),month:lc({matchPatterns:dse,defaultMatchWidth:"wide",parsePatterns:fse,defaultParseWidth:"any"}),day:lc({matchPatterns:hse,defaultMatchWidth:"wide",parsePatterns:pse,defaultParseWidth:"any"}),dayPeriod:lc({matchPatterns:mse,defaultMatchWidth:"any",parsePatterns:gse,defaultParseWidth:"any"})},$m={code:"en-US",formatDistance:Boe,formatLong:Hoe,formatRelative:qoe,localize:tse,match:yse,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vse(e,t){const n=jt(e,t==null?void 0:t.in);return oF(n,lF(n))+1}function cF(e,t){const n=jt(e,t==null?void 0:t.in),r=+cd(n)-+Aoe(n);return Math.round(r/tF)+1}function dF(e,t){var f,h,p,m;const n=jt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Gd(),o=(t==null?void 0:t.firstWeekContainsDate)??((h=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(p=i.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,s=Rn((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=Vl(s,t),u=Rn((t==null?void 0:t.in)||e,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const c=Vl(u,t);return+n>=+a?r+1:+n>=+c?r:r-1}function xse(e,t){var a,u,c,f;const n=Gd(),r=(t==null?void 0:t.firstWeekContainsDate)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(c=n.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??1,i=dF(e,t),o=Rn((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Vl(o,t)}function fF(e,t){const n=jt(e,t==null?void 0:t.in),r=+Vl(n,t)-+xse(n,t);return Math.round(r/tF)+1}function Tt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ts={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Tt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Tt(n+1,2)},d(e,t){return Tt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Tt(e.getHours()%12||12,t.length)},H(e,t){return Tt(e.getHours(),t.length)},m(e,t){return Tt(e.getMinutes(),t.length)},s(e,t){return Tt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Tt(i,t.length)}},sl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},PT={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return ts.y(e,t)},Y:function(e,t,n,r){const i=dF(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return Tt(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Tt(o,t.length)},R:function(e,t){const n=iF(e);return Tt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Tt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Tt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Tt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ts.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Tt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=fF(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},I:function(e,t,n){const r=cF(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Tt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ts.d(e,t)},D:function(e,t,n){const r=vse(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Tt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Tt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Tt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Tt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=sl.noon:r===0?i=sl.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=sl.evening:r>=12?i=sl.afternoon:r>=4?i=sl.morning:i=sl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ts.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ts.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Tt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Tt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ts.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ts.s(e,t)},S:function(e,t){return ts.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return MT(r);case"XXXX":case"XX":return Gs(r);case"XXXXX":case"XXX":default:return Gs(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return MT(r);case"xxxx":case"xx":return Gs(r);case"xxxxx":case"xxx":default:return Gs(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+RT(r,":");case"OOOO":default:return"GMT"+Gs(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+RT(r,":");case"zzzz":default:return"GMT"+Gs(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Tt(r,t.length)},T:function(e,t,n){return Tt(+e,t.length)}};function RT(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Tt(o,2)}function MT(e,t){return e%60===0?(e>0?"-":"+")+Tt(Math.abs(e)/60,2):Gs(e,t)}function Gs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Tt(Math.trunc(r/60),2),o=Tt(r%60,2);return n+i+t+o}const DT=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},hF=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},wse=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return DT(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",DT(r,t)).replace("{{time}}",hF(i,t))},bse={p:hF,P:wse},kse=/^D+$/,Sse=/^Y+$/,Ese=["D","DD","YY","YYYY"];function Cse(e){return kse.test(e)}function _se(e){return Sse.test(e)}function Nse(e,t,n){const r=Tse(e,t,n);if(console.warn(r),Ese.includes(e))throw new RangeError(r)}function Tse(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Ase=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pse=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Rse=/^'([^]*?)'?$/,Mse=/''/g,Dse=/[a-zA-Z]/;function Pc(e,t,n){var f,h,p,m,y,x,k,w;const r=Gd(),i=(n==null?void 0:n.locale)??r.locale??$m,o=(n==null?void 0:n.firstWeekContainsDate)??((h=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(p=r.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((x=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:x.weekStartsOn)??r.weekStartsOn??((w=(k=r.locale)==null?void 0:k.options)==null?void 0:w.weekStartsOn)??0,a=jt(e,n==null?void 0:n.in);if(!aF(a))throw new RangeError("Invalid time value");let u=t.match(Pse).map(E=>{const C=E[0];if(C==="p"||C==="P"){const N=bse[C];return N(E,i.formatLong)}return E}).join("").match(Ase).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const C=E[0];if(C==="'")return{isToken:!1,value:Ose(E)};if(PT[C])return{isToken:!0,value:E};if(C.match(Dse))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:E}});i.localize.preprocessor&&(u=i.localize.preprocessor(a,u));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return u.map(E=>{if(!E.isToken)return E.value;const C=E.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&_se(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Cse(C))&&Nse(C,t,String(e));const N=PT[C[0]];return N(a,C,i.localize,c)}).join("")}function Ose(e){const t=e.match(Rse);return t?t[1].replace(Mse,"'"):e}function Ise(e,t){const n=jt(e,t==null?void 0:t.in),r=n.getFullYear(),i=n.getMonth(),o=Rn(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function jse(e,t){return+jt(e)>+jt(t)}function Lse(e,t){return+jt(e)<+jt(t)}function Fse(e,t,n){const[r,i]=Zd(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function zse(e,t,n){const[r,i]=Zd(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()}function $se(e,t,n){const r=jt(e,n==null?void 0:n.in),i=r.getFullYear(),o=r.getDate(),s=Rn(e,0);s.setFullYear(i,t,15),s.setHours(0,0,0,0);const a=Ise(s);return r.setMonth(t,Math.min(o,a)),r}function Bse(e,t,n){const r=jt(e,n==null?void 0:n.in);return isNaN(+r)?Rn(e,NaN):(r.setFullYear(t),r)}function Vse(e,t,n){var r=this,i=S.useRef(null),o=S.useRef(0),s=S.useRef(null),a=S.useRef([]),u=S.useRef(),c=S.useRef(),f=S.useRef(e),h=S.useRef(!0);f.current=e;var p=typeof window<"u",m=!t&&t!==0&&p;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var y=!!(n=n||{}).leading,x=!("trailing"in n)||!!n.trailing,k="maxWait"in n,w="debounceOnServer"in n&&!!n.debounceOnServer,E=k?Math.max(+n.maxWait||0,t):null;S.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var C=S.useMemo(function(){var N=function(R){var $=a.current,F=u.current;return a.current=u.current=null,o.current=R,c.current=f.current.apply(F,$)},P=function(R,$){m&&cancelAnimationFrame(s.current),s.current=m?requestAnimationFrame(R):setTimeout(R,$)},A=function(R){if(!h.current)return!1;var $=R-i.current;return!i.current||$>=t||$<0||k&&R-o.current>=E},O=function(R){return s.current=null,x&&a.current?N(R):(a.current=u.current=null,c.current)},M=function R(){var $=Date.now();if(A($))return O($);if(h.current){var F=t-($-i.current),H=k?Math.min(F,E-($-o.current)):F;P(R,H)}},j=function(){if(p||w){var R=Date.now(),$=A(R);if(a.current=[].slice.call(arguments),u.current=r,i.current=R,$){if(!s.current&&h.current)return o.current=i.current,P(M,t),y?N(i.current):c.current;if(k)return P(M,t),N(i.current)}return s.current||P(M,t),c.current}};return j.cancel=function(){s.current&&(m?cancelAnimationFrame(s.current):clearTimeout(s.current)),o.current=0,a.current=i.current=u.current=s.current=null},j.isPending=function(){return!!s.current},j.flush=function(){return s.current?O(Date.now()):c.current},j},[y,k,t,E,x,m,p,w]);return C}var Xe;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Xe||(Xe={}));var It;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(It||(It={}));var ai;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(ai||(ai={}));const OT=5,Wse=4;function Use(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),o=t.addDays(i,OT*7-1);return e.getMonth()===o.getMonth()?OT:Wse}function pF(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function Hse(e,t){const n=pF(e,t),r=Use(e,t);return t.addDays(n,r*7-1)}class Ao{constructor(t,n){this.Date=Date,this.addDays=(r,i)=>{var o;return(o=this.overrides)!=null&&o.addDays?this.overrides.addDays(r,i):nF(r,i)},this.addMonths=(r,i)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(r,i):rF(r,i)},this.addWeeks=(r,i)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(r,i):Poe(r,i)},this.addYears=(r,i)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(r,i):Roe(r,i)},this.differenceInCalendarDays=(r,i)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,i):oF(r,i)},this.differenceInCalendarMonths=(r,i)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,i):Ioe(r,i)},this.endOfBroadcastWeek=r=>{var i;return(i=this.overrides)!=null&&i.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r,this):Hse(r,this)},this.endOfISOWeek=r=>{var i;return(i=this.overrides)!=null&&i.endOfISOWeek?this.overrides.endOfISOWeek(r):zoe(r)},this.endOfMonth=r=>{var i;return(i=this.overrides)!=null&&i.endOfMonth?this.overrides.endOfMonth(r):joe(r)},this.endOfWeek=r=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,this.options):uF(r,this.options)},this.endOfYear=r=>{var i;return(i=this.overrides)!=null&&i.endOfYear?this.overrides.endOfYear(r):Foe(r)},this.format=(r,i)=>{var o;return(o=this.overrides)!=null&&o.format?this.overrides.format(r,i,this.options):Pc(r,i,this.options)},this.getISOWeek=r=>{var i;return(i=this.overrides)!=null&&i.getISOWeek?this.overrides.getISOWeek(r):cF(r)},this.getWeek=r=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):fF(r,this.options)},this.isAfter=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(r,i):jse(r,i)},this.isBefore=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(r,i):Lse(r,i)},this.isDate=r=>{var i;return(i=this.overrides)!=null&&i.isDate?this.overrides.isDate(r):sF(r)},this.isSameDay=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(r,i):Ooe(r,i)},this.isSameMonth=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(r,i):Fse(r,i)},this.isSameYear=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(r,i):zse(r,i)},this.max=r=>{var i;return(i=this.overrides)!=null&&i.max?this.overrides.max(r):Moe(r)},this.min=r=>{var i;return(i=this.overrides)!=null&&i.min?this.overrides.min(r):Doe(r)},this.setMonth=(r,i)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(r,i):$se(r,i)},this.setYear=(r,i)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(r,i):Bse(r,i)},this.startOfBroadcastWeek=r=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):pF(r,this)},this.startOfDay=r=>{var i;return(i=this.overrides)!=null&&i.startOfDay?this.overrides.startOfDay(r):dd(r)},this.startOfISOWeek=r=>{var i;return(i=this.overrides)!=null&&i.startOfISOWeek?this.overrides.startOfISOWeek(r):cd(r)},this.startOfMonth=r=>{var i;return(i=this.overrides)!=null&&i.startOfMonth?this.overrides.startOfMonth(r):Loe(r)},this.startOfWeek=r=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):Vl(r,this.options)},this.startOfYear=r=>{var i;return(i=this.overrides)!=null&&i.startOfYear?this.overrides.startOfYear(r):lF(r)},this.options={locale:$m,...t},this.overrides=n}}const ka=new Ao;function Yse(e,t,n={}){return Object.entries(e).filter(([,i])=>i===!0).reduce((i,[o])=>(n[o]?i.push(n[o]):t[It[o]]?i.push(t[It[o]]):t[ai[o]]&&i.push(t[ai[o]]),i),[t[Xe.Day]])}function qse(e){return ne.createElement("button",{...e})}function Gse(e){return ne.createElement("span",{...e})}function Zse(e){const{size:t=24,orientation:n="left",className:r}=e;return ne.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&ne.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&ne.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&ne.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&ne.createElement("polygon",{points:"8 18.612 14.1888889 12.5 8 6.37733333 9.91111111 4.5 18 12.5 9.91111111 20.5"}))}function Kse(e){const{day:t,modifiers:n,...r}=e;return ne.createElement("td",{...r})}function Xse(e){const{day:t,modifiers:n,...r}=e,i=ne.useRef(null);return ne.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),ne.createElement("button",{ref:i,...r})}function Qse(e){const{options:t,className:n,components:r,classNames:i,...o}=e,s=[i[Xe.Dropdown],n].join(" "),a=t==null?void 0:t.find(({value:u})=>u===o.value);return ne.createElement("span",{"data-disabled":o.disabled,className:i[Xe.DropdownRoot]},ne.createElement(r.Select,{className:s,...o},t==null?void 0:t.map(({value:u,label:c,disabled:f})=>ne.createElement(r.Option,{key:u,value:u,disabled:f},c))),ne.createElement("span",{className:i[Xe.CaptionLabel],"aria-hidden":!0},a==null?void 0:a.label,ne.createElement(r.Chevron,{orientation:"down",size:18,className:i[Xe.Chevron]})))}function Jse(e){return ne.createElement("div",{...e})}function eae(e){return ne.createElement("div",{...e})}function tae(e){const{calendarMonth:t,displayIndex:n,...r}=e;return ne.createElement("div",{...r},e.children)}function nae(e){const{calendarMonth:t,displayIndex:n,...r}=e;return ne.createElement("div",{...r})}function rae(e){return ne.createElement("table",{...e})}function iae(e){return ne.createElement("div",{...e})}const mF=S.createContext(void 0);function Kd(){const e=S.useContext(mF);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function oae(e){const{components:t}=Kd();return ne.createElement(t.Dropdown,{...e})}function sae(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:i,...o}=e,{components:s,classNames:a,labels:{labelPrevious:u,labelNext:c}}=Kd();return ne.createElement("nav",{...o},ne.createElement(s.PreviousMonthButton,{type:"button",className:a[Xe.PreviousMonthButton],tabIndex:r?void 0:-1,disabled:r?void 0:!0,"aria-label":u(r),onClick:e.onPreviousClick},ne.createElement(s.Chevron,{disabled:r?void 0:!0,className:a[Xe.Chevron],orientation:"left"})),ne.createElement(s.NextMonthButton,{type:"button",className:a[Xe.NextMonthButton],tabIndex:i?void 0:-1,disabled:i?void 0:!0,"aria-label":c(i),onClick:e.onNextClick},ne.createElement(s.Chevron,{disabled:i?void 0:!0,orientation:"right",className:a[Xe.Chevron]})))}function aae(e){const{components:t}=Kd();return ne.createElement(t.Button,{...e})}function lae(e){return ne.createElement("option",{...e})}function uae(e){const{components:t}=Kd();return ne.createElement(t.Button,{...e})}function cae(e){return ne.createElement("div",{...e})}function dae(e){return ne.createElement("select",{...e})}function fae(e){const{week:t,...n}=e;return ne.createElement("tr",{...n})}function hae(e){return ne.createElement("th",{...e})}function pae(e){return ne.createElement("thead",{"aria-hidden":!0},ne.createElement("tr",{...e}))}function mae(e){const{week:t,...n}=e;return ne.createElement("th",{...n})}function gae(e){return ne.createElement("th",{...e})}function yae(e){return ne.createElement("tbody",{...e})}function vae(e){const{components:t}=Kd();return ne.createElement(t.Dropdown,{...e})}const xae=Object.freeze(Object.defineProperty({__proto__:null,Button:qse,CaptionLabel:Gse,Chevron:Zse,Day:Kse,DayButton:Xse,Dropdown:Qse,DropdownNav:Jse,Footer:eae,Month:tae,MonthCaption:nae,MonthGrid:rae,Months:iae,MonthsDropdown:oae,Nav:sae,NextMonthButton:aae,Option:lae,PreviousMonthButton:uae,Root:cae,Select:dae,Week:fae,WeekNumber:mae,WeekNumberHeader:gae,Weekday:hae,Weekdays:pae,Weeks:yae,YearsDropdown:vae},Symbol.toStringTag,{value:"Module"}));function wae(e){return{...xae,...e}}function bae(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function kae(){const e={};for(const t in Xe)e[Xe[t]]=`rdp-${Xe[t]}`;for(const t in It)e[It[t]]=`rdp-${It[t]}`;for(const t in ai)e[ai[t]]=`rdp-${ai[t]}`;return e}function gF(e,t,n){return(n??new Ao(t)).format(e,"LLLL y")}const Sae=gF;function Eae(e,t,n){return(n??new Ao(t)).format(e,"d")}function Cae(e,t){var n;return(n=t.localize)==null?void 0:n.month(e)}function _ae(e){return e<10?`0${e.toLocaleString()}`:`${e.toLocaleString()}`}function Nae(){return""}function Tae(e,t,n){return(n??new Ao(t)).format(e,"cccccc")}function yF(e){return e.toString()}const Aae=yF,Pae=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:gF,formatDay:Eae,formatMonthCaption:Sae,formatMonthDropdown:Cae,formatWeekNumber:_ae,formatWeekNumberHeader:Nae,formatWeekdayName:Tae,formatYearCaption:Aae,formatYearDropdown:yF},Symbol.toStringTag,{value:"Module"}));function Rae(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...Pae,...e}}function Mae(e,t,n,r,i){if(!t||!n)return;const{addMonths:o,startOfMonth:s}=i,a=e.getFullYear(),u=[];let c=t;for(;u.length<12;)u.push(c.getMonth()),c=o(c,1);return u.sort((p,m)=>p-m).map(p=>{const m=r.formatMonthDropdown(p,i.options.locale??$m),y=i.Date?new i.Date(a,p):new Date(a,p),x=t&&y<s(t)||n&&y>s(n)||!1;return{value:p,label:m,disabled:x}})}function Dae(e,t={},n={}){let r={...t==null?void 0:t[Xe.Day]};return Object.entries(e).filter(([,i])=>i===!0).forEach(([i])=>{r={...r,...n==null?void 0:n[i]}}),r}const vx={},vc={};function Rc(e,t){try{const r=(vx[e]||(vx[e]=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in vc?vc[r]:IT(r,r.split(":"))}catch{if(e in vc)return vc[e];const n=e==null?void 0:e.match(Oae);return n?IT(e,n.slice(1)):NaN}}const Oae=/([+-]\d\d):?(\d\d)?/;function IT(e,t){const n=+t[0],r=+(t[1]||0);return vc[e]=n>0?n*60+r:n*60-r}class Ai extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Rc(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),vF(this),Dw(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Ai(...n,t):new Ai(Date.now(),t)}withTimeZone(t){return new Ai(+this,t)}getTimezoneOffset(){return-Rc(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Dw(this),+this}[Symbol.for("constructDateFrom")](t){return new Ai(+new Date(t),this.timeZone)}}const jT=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!jT.test(e))return;const t=e.replace(jT,"$1UTC");Ai.prototype[t]&&(e.startsWith("get")?Ai.prototype[e]=function(){return this.internal[t]()}:(Ai.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Iae(this),+this},Ai.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Dw(this),+this}))});function Dw(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function Iae(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),vF(e)}function vF(e){const t=Rc(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),o=r-i,s=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&s&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const a=r-t;a&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+a);const u=Rc(e.timeZone,e),f=-new Date(+e).getTimezoneOffset()-u,h=u!==t,p=f-a;if(h&&p){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+p);const m=Rc(e.timeZone,e),y=u-m;y&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y))}}class Pi extends Ai{static tz(t,...n){return n.length?new Pi(...n,t):new Pi(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),i=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,i]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${i}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,i]=this.tzComponents();return`${t} GMT${n}${r}${i} (${jae(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),i=String(Math.abs(t)%60).padStart(2,"0");return[n,r,i]}withTimeZone(t){return new Pi(+this,t)}[Symbol.for("constructDateFrom")](t){return new Pi(+new Date(t),this.timeZone)}}function jae(e,t){return new Intl.DateTimeFormat("en-GB",{timeZone:e,timeZoneName:"long"}).format(t).slice(12)}function Lae(e,t,n,r){const i=n?Pi.tz(n):e.Date?new e.Date:new Date,o=t?e.startOfISOWeek(i):e.startOfWeek(i),s=[];for(let a=0;a<7;a++){const u=e.addDays(o,a);s.push(u)}return s}function Fae(e,t,n,r){if(!e||!t)return;const{startOfYear:i,endOfYear:o,addYears:s,isBefore:a,isSameYear:u}=r,c=i(e),f=o(t),h=[];let p=c;for(;a(p,f)||u(p,f);)h.push(p.getFullYear()),p=s(p,1);return h.map(m=>{const y=n.formatYearDropdown(m);return{value:m,label:y,disabled:!1}})}function xF(e,t,n){return(n??new Ao(t)).format(e,"LLLL y")}const zae=xF;function $ae(e,t,n,r){let i=(r??new Ao(n)).format(e,"PPPP");return t!=null&&t.today&&(i=`Today, ${i}`),i}function wF(e,t,n,r){let i=(r??new Ao(n)).format(e,"PPPP");return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}const Bae=wF;function Vae(){return""}function Wae(e){return"Choose the Month"}function Uae(e){return"Go to the Next Month"}function Hae(e){return"Go to the Previous Month"}function Yae(e,t,n){return(n??new Ao(t)).format(e,"cccc")}function qae(e,t){return`Week ${e}`}function Gae(e){return"Week Number"}function Zae(e){return"Choose the Year"}const Kae=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:zae,labelDay:Bae,labelDayButton:wF,labelGrid:xF,labelGridcell:$ae,labelMonthDropdown:Wae,labelNav:Vae,labelNext:Uae,labelPrevious:Hae,labelWeekNumber:qae,labelWeekNumberHeader:Gae,labelWeekday:Yae,labelYearDropdown:Zae},Symbol.toStringTag,{value:"Module"}));function Xae(e,t,n,r){const i=e[0],o=e[e.length-1],{ISOWeek:s,fixedWeeks:a,broadcastCalendar:u}=n??{},{addDays:c,differenceInCalendarDays:f,differenceInCalendarMonths:h,endOfBroadcastWeek:p,endOfISOWeek:m,endOfMonth:y,endOfWeek:x,isAfter:k,startOfBroadcastWeek:w,startOfISOWeek:E,startOfWeek:C}=r,N=u?w(i,r):s?E(i):C(i),P=u?p(o,r):s?m(y(o)):x(y(o)),A=f(P,N),O=h(o,i)+1,M=[];for(let $=0;$<=A;$++){const F=c(N,$);if(t&&k(F,t))break;M.push(F)}const R=(u?35:42)*O;if(a&&M.length<R){const $=R-M.length;for(let F=0;F<$;F++){const H=c(M[M.length-1],1);M.push(H)}}return M}function Qae(e){const t=[];return e.reduce((n,r)=>{const i=[],o=r.weeks.reduce((s,a)=>[...s,...a.days],i);return[...n,...o]},t)}function Jae(e,t,n,r){const{numberOfMonths:i=1}=n,o=[];for(let s=0;s<i;s++){const a=r.addMonths(e,s);if(t&&a>t)break;o.push(a)}return o}function LT(e,t){const{month:n,defaultMonth:r,today:i=e.timeZone?Pi.tz(e.timeZone):t.Date?new t.Date:new Date,numberOfMonths:o=1,endMonth:s,startMonth:a}=e;let u=n||r||i;const{differenceInCalendarMonths:c,addMonths:f,startOfMonth:h}=t;if(s&&c(s,u)<0){const p=-1*(o-1);u=f(s,p)}return a&&c(u,a)<0&&(u=a),h(u)}class bF{constructor(t,n,r=ka){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class ele{constructor(t,n){this.date=t,this.weeks=n}}class tle{constructor(t,n){this.days=n,this.weekNumber=t}}function nle(e,t,n,r){const{addDays:i,endOfBroadcastWeek:o,endOfISOWeek:s,endOfMonth:a,endOfWeek:u,getISOWeek:c,getWeek:f,startOfBroadcastWeek:h,startOfISOWeek:p,startOfWeek:m}=r,y=e.reduce((x,k)=>{const w=n.broadcastCalendar?h(k,r):n.ISOWeek?p(k):m(k),E=n.broadcastCalendar?o(k,r):n.ISOWeek?s(a(k)):u(a(k)),C=t.filter(O=>O>=w&&O<=E),N=n.broadcastCalendar?35:42;if(n.fixedWeeks&&C.length<N){const O=t.filter(M=>{const j=N-C.length;return M>E&&M<=i(E,j)});C.push(...O)}const P=C.reduce((O,M)=>{const j=n.ISOWeek?c(M):f(M),R=O.find(F=>F.weekNumber===j),$=new bF(M,k,r);return R?R.days.push($):O.push(new tle(j,[$])),O},[]),A=new ele(k,P);return x.push(A),x},[]);return n.reverseMonths?y.reverse():y}function rle(e,t){var x;let{startMonth:n,endMonth:r}=e;const{startOfYear:i,startOfDay:o,startOfMonth:s,endOfMonth:a,addYears:u,endOfYear:c}=t,{fromYear:f,toYear:h,fromMonth:p,toMonth:m}=e;!n&&p&&(n=p),!n&&f&&(n=new Date(f,0,1)),!r&&m&&(r=m),!r&&h&&(r=new Date(h,11,31));const y=(x=e.captionLayout)==null?void 0:x.startsWith("dropdown");if(n)n=s(n);else if(f)n=new Date(f,0,1);else if(!n&&y){const k=e.today??(e.timeZone?Pi.tz(e.timeZone):t.Date?new t.Date:new Date);n=i(u(k,-100))}if(r)r=a(r);else if(h)r=new Date(h,11,31);else if(!r&&y){const k=e.today??(e.timeZone?Pi.tz(e.timeZone):t.Date?new t.Date:new Date);r=c(k)}return[n&&o(n),r&&o(r)]}function ile(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:o=1}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:u}=r,c=i?o:1,f=s(e);if(!t)return a(f,c);if(!(u(t,e)<o))return a(f,c)}function ole(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:o}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:u}=r,c=i?o??1:1,f=s(e);if(!t)return a(f,-c);if(!(u(f,t)<=0))return a(f,-c)}function sle(e){const t=[];return e.reduce((n,r)=>[...n,...r.weeks],t)}function Bm(e,t){const[n,r]=S.useState(e);return[t===void 0?n:t,r]}function ale(e,t){const[n,r]=rle(e,t),{startOfMonth:i,endOfMonth:o}=t,s=LT(e,t),[a,u]=Bm(s,e.month?i(e.month):void 0);S.useEffect(()=>{const A=LT(e,t);u(A)},[e.timeZone]);const c=Jae(a,r,e,t),f=Xae(c,e.endMonth?o(e.endMonth):void 0,e,t),h=nle(c,f,e,t),p=sle(h),m=Qae(h),y=ole(a,n,e,t),x=ile(a,r,e,t),{disableNavigation:k,onMonthChange:w}=e,E=A=>p.some(O=>O.days.some(M=>M.isEqualTo(A))),C=A=>{if(k)return;let O=i(A);n&&O<i(n)&&(O=i(n)),r&&O>i(r)&&(O=i(r)),u(O),w==null||w(O)};return{months:h,weeks:p,days:m,navStart:n,navEnd:r,previousMonth:y,nextMonth:x,goToMonth:C,goToDay:A=>{E(A)||C(A.date)}}}function lle(e,t,n,r){let i,o=0,s=!1;for(;o<e.length&&!s;){const a=e[o],u=t(a);!u[It.disabled]&&!u[It.hidden]&&!u[It.outside]&&(u[It.focused]||r!=null&&r.isEqualTo(a)||n(a.date)||u[It.today])&&(i=a,s=!0),o++}return i||(i=e.find(a=>{const u=t(a);return!u[It.disabled]&&!u[It.hidden]&&!u[It.outside]})),i}function co(e,t,n=!1,r=ka){let{from:i,to:o}=e;const{differenceInCalendarDays:s,isSameDay:a}=r;return i&&o?(s(o,i)<0&&([i,o]=[o,i]),s(t,i)>=(n?1:0)&&s(o,t)>=(n?1:0)):!n&&o?a(o,t):!n&&i?a(i,t):!1}function kF(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function hk(e){return!!(e&&typeof e=="object"&&"from"in e)}function SF(e){return!!(e&&typeof e=="object"&&"after"in e)}function EF(e){return!!(e&&typeof e=="object"&&"before"in e)}function CF(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function _F(e,t){return Array.isArray(e)&&e.every(t.isDate)}function fo(e,t,n=ka){const r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:o,isAfter:s}=n;return r.some(a=>{if(typeof a=="boolean")return a;if(n.isDate(a))return i(e,a);if(_F(a,n))return a.includes(e);if(hk(a))return co(a,e,!1,n);if(CF(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if(kF(a)){const u=o(a.before,e),c=o(a.after,e),f=u>0,h=c<0;return s(a.before,a.after)?h&&f:f||h}return SF(a)?o(e,a.after)>0:EF(a)?o(a.before,e)>0:typeof a=="function"?a(e):!1})}function ule(e,t,n,r,i,o,s){const{ISOWeek:a,broadcastCalendar:u}=o,{addDays:c,addMonths:f,addWeeks:h,addYears:p,endOfBroadcastWeek:m,endOfISOWeek:y,endOfWeek:x,max:k,min:w,startOfBroadcastWeek:E,startOfISOWeek:C,startOfWeek:N}=s;let A={day:c,week:h,month:f,year:p,startOfWeek:O=>u?E(O,s):a?C(O):N(O),endOfWeek:O=>u?m(O,s):a?y(O):x(O)}[e](n,t==="after"?1:-1);return t==="before"&&r?A=k([r,A]):t==="after"&&i&&(A=w([i,A])),A}function NF(e,t,n,r,i,o,s,a=0){if(a>365)return;const u=ule(e,t,n.date,r,i,o,s),c=!!(o.disabled&&fo(u,o.disabled,s)),f=!!(o.hidden&&fo(u,o.hidden,s)),h=u,p=new bF(u,h,s);return!c&&!f?p:NF(e,t,p,r,i,o,s,a+1)}function cle(e,t,n,r,i){const{autoFocus:o}=e,[s,a]=S.useState(),u=lle(t.days,n,r||(()=>!1),s),[c,f]=S.useState(o?u:void 0);return{isFocusTarget:x=>!!(u!=null&&u.isEqualTo(x)),setFocused:f,focused:c,blur:()=>{a(c),f(void 0)},moveFocus:(x,k)=>{if(!c)return;const w=NF(x,k,c,t.navStart,t.navEnd,e,i);w&&(t.goToDay(w),f(w))}}}function dle(e,t,n){const{disabled:r,hidden:i,modifiers:o,showOutsideDays:s,broadcastCalendar:a,today:u}=t,{isSameDay:c,isSameMonth:f,startOfMonth:h,isBefore:p,endOfMonth:m,isAfter:y}=n,x=t.startMonth&&h(t.startMonth),k=t.endMonth&&m(t.endMonth),w={[It.focused]:[],[It.outside]:[],[It.disabled]:[],[It.hidden]:[],[It.today]:[]},E={};for(const C of e){const{date:N,displayMonth:P}=C,A=!!(P&&!f(N,P)),O=!!(x&&p(N,x)),M=!!(k&&y(N,k)),j=!!(r&&fo(N,r,n)),R=!!(i&&fo(N,i,n))||O||M||!a&&!s&&A||a&&s===!1&&A,$=c(N,u??(t.timeZone?Pi.tz(t.timeZone):n.Date?new n.Date:new Date));A&&w.outside.push(C),j&&w.disabled.push(C),R&&w.hidden.push(C),$&&w.today.push(C),o&&Object.keys(o).forEach(F=>{const H=o==null?void 0:o[F];H&&fo(N,H,n)&&(E[F]?E[F].push(C):E[F]=[C])})}return C=>{const N={[It.focused]:!1,[It.disabled]:!1,[It.hidden]:!1,[It.outside]:!1,[It.today]:!1},P={};for(const A in w){const O=w[A];N[A]=O.some(M=>M===C)}for(const A in E)P[A]=E[A].some(O=>O===C);return{...N,...P}}}function fle(e,t){const{selected:n,required:r,onSelect:i}=e,[o,s]=Bm(n,i?n:void 0),a=i?n:o,{isSameDay:u}=t,c=m=>(a==null?void 0:a.some(y=>u(y,m)))??!1,{min:f,max:h}=e;return{selected:a,select:(m,y,x)=>{let k=[...a??[]];if(c(m)){if((a==null?void 0:a.length)===f||r&&(a==null?void 0:a.length)===1)return;k=a==null?void 0:a.filter(w=>!u(w,m))}else(a==null?void 0:a.length)===h?k=[m]:k=[...k,m];return i||s(k),i==null||i(k,m,y,x),k},isSelected:c}}function hle(e,t,n=0,r=0,i=!1,o=ka){const{from:s,to:a}=t||{},{isSameDay:u,isAfter:c,isBefore:f}=o;let h;if(!s&&!a)h={from:e,to:n>0?void 0:e};else if(s&&!a)u(s,e)?i?h={from:s,to:void 0}:h=void 0:f(e,s)?h={from:e,to:s}:h={from:s,to:e};else if(s&&a)if(u(s,e)&&u(a,e))i?h={from:s,to:a}:h=void 0;else if(u(s,e))h={from:s,to:n>0?void 0:e};else if(u(a,e))h={from:e,to:n>0?void 0:e};else if(f(e,s))h={from:e,to:a};else if(c(e,s))h={from:s,to:e};else if(c(e,a))h={from:s,to:e};else throw new Error("Invalid range");if(h!=null&&h.from&&(h!=null&&h.to)){const p=o.differenceInCalendarDays(h.to,h.from);r>0&&p>r?h={from:e,to:void 0}:n>1&&p<n&&(h={from:e,to:void 0})}return h}function ple(e,t,n=ka){const r=Array.isArray(t)?t:[t];let i=e.from;const o=n.differenceInCalendarDays(e.to,e.from),s=Math.min(o,6);for(let a=0;a<=s;a++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function FT(e,t,n=ka){return co(e,t.from,!1,n)||co(e,t.to,!1,n)||co(t,e.from,!1,n)||co(t,e.to,!1,n)}function mle(e,t,n=ka){const r=Array.isArray(t)?t:[t];if(r.filter(a=>typeof a!="function").some(a=>typeof a=="boolean"?a:n.isDate(a)?co(e,a,!1,n):_F(a,n)?a.some(u=>co(e,u,!1,n)):hk(a)?a.from&&a.to?FT(e,{from:a.from,to:a.to},n):!1:CF(a)?ple(e,a.dayOfWeek,n):kF(a)?n.isAfter(a.before,a.after)?FT(e,{from:n.addDays(a.after,1),to:n.addDays(a.before,-1)},n):fo(e.from,a,n)||fo(e.to,a,n):SF(a)||EF(a)?fo(e.from,a,n)||fo(e.to,a,n):!1))return!0;const s=r.filter(a=>typeof a=="function");if(s.length){let a=e.from;const u=n.differenceInCalendarDays(e.to,e.from);for(let c=0;c<=u;c++){if(s.some(f=>f(a)))return!0;a=n.addDays(a,1)}}return!1}function gle(e,t){const{disabled:n,excludeDisabled:r,selected:i,required:o,onSelect:s}=e,[a,u]=Bm(i,s?i:void 0),c=s?i:a;return{selected:c,select:(p,m,y)=>{const{min:x,max:k}=e,w=p?hle(p,c,x,k,o,t):void 0;return r&&n&&(w!=null&&w.from)&&w.to&&mle({from:w.from,to:w.to},n,t)&&(w.from=p,w.to=void 0),s||u(w),s==null||s(w,p,m,y),w},isSelected:p=>c&&co(c,p,!1,t)}}function yle(e,t){const{selected:n,required:r,onSelect:i}=e,[o,s]=Bm(n,i?n:void 0),a=i?n:o,{isSameDay:u}=t;return{selected:a,select:(h,p,m)=>{let y=h;return!r&&a&&a&&u(h,a)&&(y=void 0),i||s(y),i==null||i(y,h,p,m),y},isSelected:h=>a?u(a,h):!1}}function vle(e,t){const n=yle(e,t),r=fle(e,t),i=gle(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return i;default:return}}function xle(e){const{components:t,formatters:n,labels:r,dateLib:i,locale:o,classNames:s}=S.useMemo(()=>{const He={...$m,...e.locale};return{dateLib:new Ao({locale:He,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens},e.dateLib),components:wae(e.components),formatters:Rae(e.formatters),labels:{...Kae,...e.labels},locale:He,classNames:{...kae(),...e.classNames}}},[e.classNames,e.components,e.dateLib,e.firstWeekContainsDate,e.formatters,e.labels,e.locale,e.useAdditionalDayOfYearTokens,e.useAdditionalWeekYearTokens,e.weekStartsOn,e.broadcastCalendar]),{captionLayout:a,mode:u,onDayBlur:c,onDayClick:f,onDayFocus:h,onDayKeyDown:p,onDayMouseEnter:m,onDayMouseLeave:y,onNextClick:x,onPrevClick:k,showWeekNumber:w,styles:E}=e,{formatCaption:C,formatDay:N,formatMonthDropdown:P,formatWeekNumber:A,formatWeekNumberHeader:O,formatWeekdayName:M,formatYearDropdown:j}=n,R=ale(e,i),{days:$,months:F,navStart:H,navEnd:I,previousMonth:q,nextMonth:Y,goToMonth:Z}=R,B=dle($,e,i),{isSelected:W,select:L,selected:U}=vle(e,i)??{},{blur:V,focused:D,isFocusTarget:G,moveFocus:K,setFocused:J}=cle(e,R,B,W??(()=>!1),i),{labelDayButton:ee,labelGridcell:re,labelGrid:ue,labelMonthDropdown:he,labelNav:ke,labelWeekday:fe,labelWeekNumber:ve,labelWeekNumberHeader:Me,labelYearDropdown:$e}=r,ct=S.useMemo(()=>Lae(i,e.ISOWeek,e.timeZone),[i,e.ISOWeek,e.timeZone]),_t=u!==void 0||f!==void 0,Q=S.useCallback(()=>{q&&(Z(q),k==null||k(q))},[q,Z,k]),oe=S.useCallback(()=>{Y&&(Z(Y),x==null||x(Y))},[Z,Y,x]),ae=S.useCallback((He,it)=>at=>{at.preventDefault(),at.stopPropagation(),J(He),L==null||L(He.date,it,at),f==null||f(He.date,it,at)},[L,f,J]),Ce=S.useCallback((He,it)=>at=>{J(He),h==null||h(He.date,it,at)},[h,J]),we=S.useCallback((He,it)=>at=>{V(),c==null||c(He.date,it,at)},[V,c]),me=S.useCallback((He,it)=>at=>{const Wt={ArrowLeft:["day",e.dir==="rtl"?"after":"before"],ArrowRight:["day",e.dir==="rtl"?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[at.shiftKey?"year":"month","before"],PageDown:[at.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Wt[at.key]){at.preventDefault(),at.stopPropagation();const[yt,yn]=Wt[at.key];K(yt,yn)}p==null||p(He.date,it,at)},[K,p,e.dir]),Ae=S.useCallback((He,it)=>at=>{m==null||m(He.date,it,at)},[m]),Fe=S.useCallback((He,it)=>at=>{y==null||y(He.date,it,at)},[y]),ce=S.useCallback(He=>it=>{const at=Number(it.target.value),Wt=i.setMonth(i.startOfMonth(He),at);Z(Wt)},[i,Z]),pe=S.useCallback(He=>it=>{const at=Number(it.target.value),Wt=i.setYear(i.startOfMonth(He),at);Z(Wt)},[i,Z]),{className:Ie,style:Ke}=S.useMemo(()=>({className:[s[Xe.Root],e.className].filter(Boolean).join(" "),style:{...E==null?void 0:E[Xe.Root],...e.style}}),[s,e.className,e.style,E]),tt=bae(e),At={dayPickerProps:e,selected:U,select:L,isSelected:W,months:F,nextMonth:Y,previousMonth:q,goToMonth:Z,getModifiers:B,components:t,classNames:s,styles:E,labels:r,formatters:n};return ne.createElement(mF.Provider,{value:At},ne.createElement(t.Root,{className:Ie,style:Ke,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],...tt},ne.createElement(t.Months,{className:s[Xe.Months],style:E==null?void 0:E[Xe.Months]},!e.hideNavigation&&ne.createElement(t.Nav,{className:s[Xe.Nav],style:E==null?void 0:E[Xe.Nav],"aria-label":ke(),onPreviousClick:Q,onNextClick:oe,previousMonth:q,nextMonth:Y}),F.map((He,it)=>{const at=Mae(He.date,H,I,n,i),Wt=Fae(H,I,n,i);return ne.createElement(t.Month,{className:s[Xe.Month],style:E==null?void 0:E[Xe.Month],key:it,displayIndex:it,calendarMonth:He},ne.createElement(t.MonthCaption,{className:s[Xe.MonthCaption],style:E==null?void 0:E[Xe.MonthCaption],calendarMonth:He,displayIndex:it},a!=null&&a.startsWith("dropdown")?ne.createElement(t.DropdownNav,{className:s[Xe.Dropdowns],style:E==null?void 0:E[Xe.Dropdowns]},a==="dropdown"||a==="dropdown-months"?ne.createElement(t.MonthsDropdown,{className:s[Xe.MonthsDropdown],"aria-label":he(),classNames:s,components:t,disabled:!!e.disableNavigation,onChange:ce(He.date),options:at,style:E==null?void 0:E[Xe.Dropdown],value:He.date.getMonth()}):ne.createElement("span",{role:"status","aria-live":"polite"},P(He.date.getMonth(),o)),a==="dropdown"||a==="dropdown-years"?ne.createElement(t.YearsDropdown,{className:s[Xe.YearsDropdown],"aria-label":$e(i.options),classNames:s,components:t,disabled:!!e.disableNavigation,onChange:pe(He.date),options:Wt,style:E==null?void 0:E[Xe.Dropdown],value:He.date.getFullYear()}):ne.createElement("span",{role:"status","aria-live":"polite"},j(He.date.getFullYear()))):ne.createElement(t.CaptionLabel,{className:s[Xe.CaptionLabel],role:"status","aria-live":"polite"},C(He.date,i.options,i))),ne.createElement(t.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":ue(He.date,i.options,i)||void 0,className:s[Xe.MonthGrid],style:E==null?void 0:E[Xe.MonthGrid]},!e.hideWeekdays&&ne.createElement(t.Weekdays,{className:s[Xe.Weekdays],style:E==null?void 0:E[Xe.Weekdays]},w&&ne.createElement(t.WeekNumberHeader,{"aria-label":Me(i.options),className:s[Xe.WeekNumberHeader],style:E==null?void 0:E[Xe.WeekNumberHeader],scope:"col"},O()),ct.map((yt,yn)=>ne.createElement(t.Weekday,{"aria-label":fe(yt,i.options,i),className:s[Xe.Weekday],key:yn,style:E==null?void 0:E[Xe.Weekday],scope:"col"},M(yt,i.options,i)))),ne.createElement(t.Weeks,{className:s[Xe.Weeks],style:E==null?void 0:E[Xe.Weeks]},He.weeks.map((yt,yn)=>ne.createElement(t.Week,{className:s[Xe.Week],key:yt.weekNumber,style:E==null?void 0:E[Xe.Week],week:yt},w&&ne.createElement(t.WeekNumber,{week:yt,style:E==null?void 0:E[Xe.WeekNumber],"aria-label":ve(yt.weekNumber,{locale:o}),className:s[Xe.WeekNumber],scope:"row",role:"rowheader"},A(yt.weekNumber)),yt.days.map(gt=>{const{date:Lt}=gt,ft=B(gt);if(ft[It.focused]=!ft.hidden&&!!(D!=null&&D.isEqualTo(gt)),ft[ai.selected]=!ft.disabled&&((W==null?void 0:W(Lt))||ft.selected),hk(U)){const{from:nn,to:vn}=U;ft[ai.range_start]=!!(nn&&vn&&i.isSameDay(Lt,nn)),ft[ai.range_end]=!!(nn&&vn&&i.isSameDay(Lt,vn)),ft[ai.range_middle]=co(U,Lt,!0,i)}const Ye=Dae(ft,E,e.modifiersStyles),dt=Yse(ft,s,e.modifiersClassNames),Ct=!_t&&!ft.hidden?re(Lt,ft,i.options,i):void 0;return ne.createElement(t.Day,{key:`${i.format(Lt,"yyyy-MM-dd")}_${i.format(gt.displayMonth,"yyyy-MM")}`,day:gt,modifiers:ft,className:dt.join(" "),style:Ye,role:"gridcell","aria-selected":ft.selected||void 0,"aria-label":Ct,"data-day":i.format(Lt,"yyyy-MM-dd"),"data-month":gt.outside?i.format(Lt,"yyyy-MM"):void 0,"data-selected":ft.selected||void 0,"data-disabled":ft.disabled||void 0,"data-hidden":ft.hidden||void 0,"data-outside":gt.outside||void 0,"data-focused":ft.focused||void 0,"data-today":ft.today||void 0},!ft.hidden&&_t?ne.createElement(t.DayButton,{className:s[Xe.DayButton],style:E==null?void 0:E[Xe.DayButton],type:"button",day:gt,modifiers:ft,disabled:ft.disabled||void 0,tabIndex:G(gt)?0:-1,"aria-label":ee(Lt,ft,i.options,i),onClick:ae(gt,ft),onBlur:we(gt,ft),onFocus:Ce(gt,ft),onKeyDown:me(gt,ft),onMouseEnter:Ae(gt,ft),onMouseLeave:Fe(gt,ft)},N(Lt,i.options,i)):!ft.hidden&&N(gt.date,i.options,i))}))))))})),e.footer&&ne.createElement(t.Footer,{className:s[Xe.Footer],style:E==null?void 0:E[Xe.Footer],role:"status","aria-live":"polite"},e.footer)))}function TF({className:e,classNames:t,showOutsideDays:n=!0,...r}){return v.jsx(xle,{showOutsideDays:n,className:Te("p-3",e),classNames:{months:"flex flex-col space-y-4 sm:space-y-0",month:"space-y-4",month_caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm text-text font-medium",nav:"space-x-1 flex items-center",button_previous:Te(wl({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100","absolute left-1 top-[12px] z-10"),button_next:Te(wl({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100","absolute right-1 top-[12px] z-10"),month_grid:"w-full border-collapse space-y-1",weekdays:"flex",weekday:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",week:"flex w-full mt-2",day:Te(wl({variant:"ghost"}),"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md","h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"),range_start:"day-range-start",range_end:"day-range-end",selected:"!bg-primary !text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",today:"bg-lightGray-7/50 text-accent-foreground",outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",hidden:"invisible",...t},components:{Chevron:({orientation:i})=>v.jsx(sR,{className:Te("h-4 w-4",{"rotate-180":i==="up","rotate-90":i==="left","-rotate-90":i==="right"})})},...r})}TF.displayName="Calendar";const wle=ru("flex w-full text-mastra-el-6 rounded-sm border bg-transparent shadow-sm focus-visible:ring-ring transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-mastra-border-1 border-border-1 placeholder:text-muted-foreground",filled:"bg-inputFill border-border-1 placeholder:text-muted-foreground",unstyled:"border-0 bg-transparent placeholder:text-muted-foreground focus-visible:ring-transparent focus-visible:outline-none"},customSize:{default:"px-[13px] text-[calc(13_/_16_*_1rem)] h-[34px]",sm:"h-[30px] px-[13px] text-xs",lg:"h-10 px-[17px] rounded-md text-[calc(13_/_16_*_1rem)]"}},defaultVariants:{variant:"default",customSize:"default"}}),Xd=S.forwardRef(({className:e,customSize:t,testId:n,variant:r,type:i,...o},s)=>v.jsx("input",{type:i,className:Te(e,wle({variant:r,customSize:t,className:e})),"data-testid":n,ref:s,...o}));Xd.displayName="Input";const ble=({value:e,setValue:t,children:n,className:r,placeholder:i,...o})=>{const[s,a]=S.useState(!1);return v.jsxs(JL,{open:s,onOpenChange:a,children:[v.jsx(eF,{asChild:!0,children:n||v.jsx(AF,{value:e,placeholder:i,className:r,"data-testid":"datepicker-button"})}),v.jsx(fk,{className:"backdrop-blur-4xl w-auto p-0",align:"start","data-testid":"datepicker-calendar",children:v.jsx(kle,{value:e,setValue:u=>t(u?new Date(`${u}z`):null),clearable:o.clearable,setOpenPopover:a,...o})})]})},kle=({value:e,setValue:t,setOpenPopover:n,clearable:r,placeholder:i,className:o,...s})=>{const[a,u]=S.useState(e?Pc(e,"PP"):""),[c,f]=S.useState(e?new Date(e):void 0),h=Vse(x=>{aF(x)&&(f(x),t==null||t(x),n==null||n(!1))},2e3),p=x=>{u(x.currentTarget.value);const k=new Date(x.target.value);h(k)},m=x=>{f(x),t==null||t(x),n==null||n(!1),u(x?Pc(x,"PP"):"")},y=x=>{f(x),u(x?Pc(x,"PP"):"")};return v.jsxs("div",{"aria-label":"Choose date",className:"relative mt-2 flex flex-col gap-2",onKeyDown:x=>{x.stopPropagation(),x.key==="Escape"&&(n==null||n(!1))},children:[v.jsx("div",{className:"w-full px-3",children:v.jsx(Xd,{type:"date",value:a,onChange:p,placeholder:i,className:o})}),v.jsx(TF,{mode:"single",month:c,selected:c,onMonthChange:y,onSelect:m,...s}),v.jsx("div",{className:"px-3 pb-2",children:r&&v.jsx(Bt,{variant:"outline",tabIndex:0,className:"w-full !opacity-50 duration-200 hover:!opacity-100",onClick:()=>{t(null),f(void 0),u(""),n==null||n(!1)},children:"Clear"})})]})},AF=S.forwardRef(({value:e,placeholder:t,className:n,...r},i)=>v.jsxs(Bt,{ref:i,variant:"outline",className:Te("bg-neutral-825 border-neutral-775 w-full justify-start whitespace-nowrap rounded-md border px-2 py-0 text-left flex items-center gap-1",n),...r,children:[v.jsx(sR,{className:"h-4 w-4"}),e?v.jsx("span",{className:"text-white",children:Pc(e,"PPP")}):v.jsx("span",{className:"text-gray",children:t??"Pick a date"})]}));AF.displayName="DefaultButton";function Sle({name:e,control:t,handleFieldChange:n}){return v.jsx(cu,{name:e,control:t,render:({field:r})=>v.jsx(ble,{value:r.value,setValue:i=>{r.onChange(i),n==null||n({key:e,value:i})}})})}var Ele="VisuallyHidden",PF=S.forwardRef((e,t)=>v.jsx(Ue.span,{...e,ref:t,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",...e.style}}));PF.displayName=Ele;var Cle=[" ","Enter","ArrowUp","ArrowDown"],_le=[" ","Enter"],Qd="Select",[Vm,Wm,Nle]=S1(Qd),[du,_ve]=Yr(Qd,[Nle,uu]),Um=uu(),[Tle,Ns]=du(Qd),[Ale,Ple]=du(Qd),RF=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:u,dir:c,name:f,autoComplete:h,disabled:p,required:m,form:y}=e,x=Um(t),[k,w]=S.useState(null),[E,C]=S.useState(null),[N,P]=S.useState(!1),A=_d(c),[O=!1,M]=wo({prop:r,defaultProp:i,onChange:o}),[j,R]=wo({prop:s,defaultProp:a,onChange:u}),$=S.useRef(null),F=k?y||!!k.closest("form"):!0,[H,I]=S.useState(new Set),q=Array.from(H).map(Y=>Y.props.value).join(";");return v.jsx(Mm,{...x,children:v.jsxs(Tle,{required:m,scope:t,trigger:k,onTriggerChange:w,valueNode:E,onValueNodeChange:C,valueNodeHasChildren:N,onValueNodeHasChildrenChange:P,contentId:En(),value:j,onValueChange:R,open:O,onOpenChange:M,dir:A,triggerPointerDownPosRef:$,disabled:p,children:[v.jsx(Vm.Provider,{scope:t,children:v.jsx(Ale,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(Y=>{I(Z=>new Set(Z).add(Y))},[]),onNativeOptionRemove:S.useCallback(Y=>{I(Z=>{const B=new Set(Z);return B.delete(Y),B})},[]),children:n})}),F?v.jsxs(QF,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:h,value:j,onChange:Y=>R(Y.target.value),disabled:p,form:y,children:[j===void 0?v.jsx("option",{value:""}):null,Array.from(H)]},q):null]})})};RF.displayName=Qd;var MF="SelectTrigger",DF=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Um(n),s=Ns(MF,n),a=s.disabled||r,u=pt(t,s.onTriggerChange),c=Wm(n),f=S.useRef("touch"),[h,p,m]=JF(x=>{const k=c().filter(C=>!C.disabled),w=k.find(C=>C.value===s.value),E=e4(k,x,w);E!==void 0&&s.onValueChange(E.value)}),y=x=>{a||(s.onOpenChange(!0),m()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return v.jsx(Dm,{asChild:!0,...o,children:v.jsx(Ue.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":XF(s.value)?"":void 0,...i,ref:u,onClick:Re(i.onClick,x=>{x.currentTarget.focus(),f.current!=="mouse"&&y(x)}),onPointerDown:Re(i.onPointerDown,x=>{f.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(y(x),x.preventDefault())}),onKeyDown:Re(i.onKeyDown,x=>{const k=h.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(k&&x.key===" ")&&Cle.includes(x.key)&&(y(),x.preventDefault())})})})});DF.displayName=MF;var OF="SelectValue",IF=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,u=Ns(OF,n),{onValueNodeHasChildrenChange:c}=u,f=o!==void 0,h=pt(t,u.onValueNodeChange);return Un(()=>{c(f)},[c,f]),v.jsx(Ue.span,{...a,ref:h,style:{pointerEvents:"none"},children:XF(u.value)?v.jsx(v.Fragment,{children:s}):o})});IF.displayName=OF;var Rle="SelectIcon",jF=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return v.jsx(Ue.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});jF.displayName=Rle;var Mle="SelectPortal",LF=e=>v.jsx(Ld,{asChild:!0,...e});LF.displayName=Mle;var ma="SelectContent",FF=S.forwardRef((e,t)=>{const n=Ns(ma,e.__scopeSelect),[r,i]=S.useState();if(Un(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?tu.createPortal(v.jsx(zF,{scope:e.__scopeSelect,children:v.jsx(Vm.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),o):null}return v.jsx($F,{...e,ref:t})});FF.displayName=ma;var ri=10,[zF,Ts]=du(ma),Dle="SelectContentImpl",$F=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:x,avoidCollisions:k,...w}=e,E=Ns(ma,n),[C,N]=S.useState(null),[P,A]=S.useState(null),O=pt(t,ee=>N(ee)),[M,j]=S.useState(null),[R,$]=S.useState(null),F=Wm(n),[H,I]=S.useState(!1),q=S.useRef(!1);S.useEffect(()=>{if(C)return Tm(C)},[C]),_m();const Y=S.useCallback(ee=>{const[re,...ue]=F().map(fe=>fe.ref.current),[he]=ue.slice(-1),ke=document.activeElement;for(const fe of ee)if(fe===ke||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===re&&P&&(P.scrollTop=0),fe===he&&P&&(P.scrollTop=P.scrollHeight),fe==null||fe.focus(),document.activeElement!==ke))return},[F,P]),Z=S.useCallback(()=>Y([M,C]),[Y,M,C]);S.useEffect(()=>{H&&Z()},[H,Z]);const{onOpenChange:B,triggerPointerDownPosRef:W}=E;S.useEffect(()=>{if(C){let ee={x:0,y:0};const re=he=>{var ke,fe;ee={x:Math.abs(Math.round(he.pageX)-(((ke=W.current)==null?void 0:ke.x)??0)),y:Math.abs(Math.round(he.pageY)-(((fe=W.current)==null?void 0:fe.y)??0))}},ue=he=>{ee.x<=10&&ee.y<=10?he.preventDefault():C.contains(he.target)||B(!1),document.removeEventListener("pointermove",re),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ue,{capture:!0})}}},[C,B,W]),S.useEffect(()=>{const ee=()=>B(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[B]);const[L,U]=JF(ee=>{const re=F().filter(ke=>!ke.disabled),ue=re.find(ke=>ke.ref.current===document.activeElement),he=e4(re,ee,ue);he&&setTimeout(()=>he.ref.current.focus())}),V=S.useCallback((ee,re,ue)=>{const he=!q.current&&!ue;(E.value!==void 0&&E.value===re||he)&&(j(ee),he&&(q.current=!0))},[E.value]),D=S.useCallback(()=>C==null?void 0:C.focus(),[C]),G=S.useCallback((ee,re,ue)=>{const he=!q.current&&!ue;(E.value!==void 0&&E.value===re||he)&&$(ee)},[E.value]),K=r==="popper"?Ow:BF,J=K===Ow?{side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:x,avoidCollisions:k}:{};return v.jsx(zF,{scope:n,content:C,viewport:P,onViewportChange:A,itemRefCallback:V,selectedItem:M,onItemLeave:D,itemTextRefCallback:G,focusSelectedItem:Z,selectedItemText:R,position:r,isPositioned:H,searchRef:L,children:v.jsx(Fd,{as:Li,allowPinchZoom:!0,children:v.jsx(jd,{asChild:!0,trapped:E.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Re(i,ee=>{var re;(re=E.trigger)==null||re.focus({preventScroll:!0}),ee.preventDefault()}),children:v.jsx(Id,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:v.jsx(K,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:ee=>ee.preventDefault(),...w,...J,onPlaced:()=>I(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Re(w.onKeyDown,ee=>{const re=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!re&&ee.key.length===1&&U(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let he=F().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const ke=ee.target,fe=he.indexOf(ke);he=he.slice(fe+1)}setTimeout(()=>Y(he)),ee.preventDefault()}})})})})})})});$F.displayName=Dle;var Ole="SelectItemAlignedPosition",BF=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Ns(ma,n),s=Ts(ma,n),[a,u]=S.useState(null),[c,f]=S.useState(null),h=pt(t,O=>f(O)),p=Wm(n),m=S.useRef(!1),y=S.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:w,focusSelectedItem:E}=s,C=S.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&x&&k&&w){const O=o.trigger.getBoundingClientRect(),M=c.getBoundingClientRect(),j=o.valueNode.getBoundingClientRect(),R=w.getBoundingClientRect();if(o.dir!=="rtl"){const ke=R.left-M.left,fe=j.left-ke,ve=O.left-fe,Me=O.width+ve,$e=Math.max(Me,M.width),ct=window.innerWidth-ri,_t=M0(fe,[ri,Math.max(ri,ct-$e)]);a.style.minWidth=Me+"px",a.style.left=_t+"px"}else{const ke=M.right-R.right,fe=window.innerWidth-j.right-ke,ve=window.innerWidth-O.right-fe,Me=O.width+ve,$e=Math.max(Me,M.width),ct=window.innerWidth-ri,_t=M0(fe,[ri,Math.max(ri,ct-$e)]);a.style.minWidth=Me+"px",a.style.right=_t+"px"}const $=p(),F=window.innerHeight-ri*2,H=x.scrollHeight,I=window.getComputedStyle(c),q=parseInt(I.borderTopWidth,10),Y=parseInt(I.paddingTop,10),Z=parseInt(I.borderBottomWidth,10),B=parseInt(I.paddingBottom,10),W=q+Y+H+B+Z,L=Math.min(k.offsetHeight*5,W),U=window.getComputedStyle(x),V=parseInt(U.paddingTop,10),D=parseInt(U.paddingBottom,10),G=O.top+O.height/2-ri,K=F-G,J=k.offsetHeight/2,ee=k.offsetTop+J,re=q+Y+ee,ue=W-re;if(re<=G){const ke=$.length>0&&k===$[$.length-1].ref.current;a.style.bottom="0px";const fe=c.clientHeight-x.offsetTop-x.offsetHeight,ve=Math.max(K,J+(ke?D:0)+fe+Z),Me=re+ve;a.style.height=Me+"px"}else{const ke=$.length>0&&k===$[0].ref.current;a.style.top="0px";const ve=Math.max(G,q+x.offsetTop+(ke?V:0)+J)+ue;a.style.height=ve+"px",x.scrollTop=re-G+x.offsetTop}a.style.margin=`${ri}px 0`,a.style.minHeight=L+"px",a.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,a,c,x,k,w,o.dir,r]);Un(()=>C(),[C]);const[N,P]=S.useState();Un(()=>{c&&P(window.getComputedStyle(c).zIndex)},[c]);const A=S.useCallback(O=>{O&&y.current===!0&&(C(),E==null||E(),y.current=!1)},[C,E]);return v.jsx(jle,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:A,children:v.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:v.jsx(Ue.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});BF.displayName=Ole;var Ile="SelectPopperPosition",Ow=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ri,...o}=e,s=Um(n);return v.jsx(B1,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ow.displayName=Ile;var[jle,pk]=du(ma,{}),Iw="SelectViewport",VF=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Ts(Iw,n),s=pk(Iw,n),a=pt(t,o.onViewportChange),u=S.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),v.jsx(Vm.Slot,{scope:n,children:v.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Re(i.onScroll,c=>{const f=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=s;if(p!=null&&p.current&&h){const m=Math.abs(u.current-f.scrollTop);if(m>0){const y=window.innerHeight-ri*2,x=parseFloat(h.style.minHeight),k=parseFloat(h.style.height),w=Math.max(x,k);if(w<y){const E=w+m,C=Math.min(y,E),N=E-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=N>0?N:0,h.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});VF.displayName=Iw;var WF="SelectGroup",[Lle,Fle]=du(WF),zle=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=En();return v.jsx(Lle,{scope:n,id:i,children:v.jsx(Ue.div,{role:"group","aria-labelledby":i,...r,ref:t})})});zle.displayName=WF;var UF="SelectLabel",$le=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Fle(UF,n);return v.jsx(Ue.div,{id:i.id,...r,ref:t})});$le.displayName=UF;var Bp="SelectItem",[Ble,HF]=du(Bp),YF=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=Ns(Bp,n),u=Ts(Bp,n),c=a.value===r,[f,h]=S.useState(o??""),[p,m]=S.useState(!1),y=pt(t,E=>{var C;return(C=u.itemRefCallback)==null?void 0:C.call(u,E,r,i)}),x=En(),k=S.useRef("touch"),w=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(Ble,{scope:n,value:r,disabled:i,textId:x,isSelected:c,onItemTextChange:S.useCallback(E=>{h(C=>C||((E==null?void 0:E.textContent)??"").trim())},[]),children:v.jsx(Vm.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:v.jsx(Ue.div,{role:"option","aria-labelledby":x,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:y,onFocus:Re(s.onFocus,()=>m(!0)),onBlur:Re(s.onBlur,()=>m(!1)),onClick:Re(s.onClick,()=>{k.current!=="mouse"&&w()}),onPointerUp:Re(s.onPointerUp,()=>{k.current==="mouse"&&w()}),onPointerDown:Re(s.onPointerDown,E=>{k.current=E.pointerType}),onPointerMove:Re(s.onPointerMove,E=>{var C;k.current=E.pointerType,i?(C=u.onItemLeave)==null||C.call(u):k.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(s.onPointerLeave,E=>{var C;E.currentTarget===document.activeElement&&((C=u.onItemLeave)==null||C.call(u))}),onKeyDown:Re(s.onKeyDown,E=>{var N;((N=u.searchRef)==null?void 0:N.current)!==""&&E.key===" "||(_le.includes(E.key)&&w(),E.key===" "&&E.preventDefault())})})})})});YF.displayName=Bp;var xc="SelectItemText",qF=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=Ns(xc,n),a=Ts(xc,n),u=HF(xc,n),c=Ple(xc,n),[f,h]=S.useState(null),p=pt(t,w=>h(w),u.onItemTextChange,w=>{var E;return(E=a.itemTextRefCallback)==null?void 0:E.call(a,w,u.value,u.disabled)}),m=f==null?void 0:f.textContent,y=S.useMemo(()=>v.jsx("option",{value:u.value,disabled:u.disabled,children:m},u.value),[u.disabled,u.value,m]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=c;return Un(()=>(x(y),()=>k(y)),[x,k,y]),v.jsxs(v.Fragment,{children:[v.jsx(Ue.span,{id:u.textId,...o,ref:p}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?tu.createPortal(o.children,s.valueNode):null]})});qF.displayName=xc;var GF="SelectItemIndicator",ZF=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return HF(GF,n).isSelected?v.jsx(Ue.span,{"aria-hidden":!0,...r,ref:t}):null});ZF.displayName=GF;var jw="SelectScrollUpButton",Vle=S.forwardRef((e,t)=>{const n=Ts(jw,e.__scopeSelect),r=pk(jw,e.__scopeSelect),[i,o]=S.useState(!1),s=pt(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollTop>0;o(c)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?v.jsx(KF,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});Vle.displayName=jw;var Lw="SelectScrollDownButton",Wle=S.forwardRef((e,t)=>{const n=Ts(Lw,e.__scopeSelect),r=pk(Lw,e.__scopeSelect),[i,o]=S.useState(!1),s=pt(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<c;o(f)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?v.jsx(KF,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});Wle.displayName=Lw;var KF=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Ts("SelectScrollButton",n),s=S.useRef(null),a=Wm(n),u=S.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return S.useEffect(()=>()=>u(),[u]),Un(()=>{var f;const c=a().find(h=>h.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),v.jsx(Ue.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Re(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Re(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Re(i.onPointerLeave,()=>{u()})})}),Ule="SelectSeparator",Hle=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v.jsx(Ue.div,{"aria-hidden":!0,...r,ref:t})});Hle.displayName=Ule;var Fw="SelectArrow",Yle=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Um(n),o=Ns(Fw,n),s=Ts(Fw,n);return o.open&&s.position==="popper"?v.jsx(V1,{...i,...r,ref:t}):null});Yle.displayName=Fw;function XF(e){return e===""||e===void 0}var QF=S.forwardRef((e,t)=>{const{value:n,...r}=e,i=S.useRef(null),o=pt(t,i),s=EL(n);return S.useEffect(()=>{const a=i.current,u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==n&&f){const h=new Event("change",{bubbles:!0});f.call(a,n),a.dispatchEvent(h)}},[s,n]),v.jsx(PF,{asChild:!0,children:v.jsx("select",{...r,ref:o,defaultValue:n})})});QF.displayName="BubbleSelect";function JF(e){const t=fn(e),n=S.useRef(""),r=S.useRef(0),i=S.useCallback(s=>{const a=n.current+s;t(a),function u(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(a)},[t]),o=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function e4(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=qle(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function qle(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gle=RF,t4=DF,Zle=IF,Kle=jF,Xle=LF,n4=FF,Qle=VF,r4=YF,Jle=qF,eue=ZF;const tue=Gle,nue=Zle,i4=S.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(t4,{ref:r,className:Te("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[t,v.jsx(Kle,{asChild:!0,children:v.jsx(cb,{className:"h-4 w-4 opacity-50"})})]}));i4.displayName=t4.displayName;const o4=S.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>v.jsx(Xle,{children:v.jsx(n4,{ref:i,className:Te("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",e),position:n,...r,children:v.jsx(Qle,{className:Te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));o4.displayName=n4.displayName;const s4=S.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(r4,{ref:r,className:Te("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(eue,{children:v.jsx(ub,{className:"h-4 w-4"})})}),v.jsx(Jle,{children:t})]}));s4.displayName=r4.displayName;function xx({name:e,control:t,options:n,handleFieldChange:r}){return v.jsx(cu,{name:e,control:t,render:({field:i})=>v.jsxs(tue,{value:i.value,onValueChange:o=>{i.onChange(o),r==null||r({key:e,value:o})},children:[v.jsx(i4,{children:v.jsx(nue,{placeholder:"Select an option"})}),v.jsx(o4,{children:n.map(o=>v.jsx(s4,{value:o.value,children:o.label},o.value))})]})})}const a4=S.forwardRef(({className:e,...t},n)=>v.jsx("textarea",{className:Te("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm 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",e),ref:n,...t}));a4.displayName="Textarea";function rue({name:e,control:t,handleFieldChange:n,isMultiline:r,placeholder:i}){const o=r?a4:Xd;return v.jsx(cu,{name:e,control:t,render:({field:s})=>v.jsx(o,{...s,placeholder:i,onChange:a=>{s.onChange(a),n==null||n({key:e,value:a.target.value})}})})}const Vp=(e,t=" ")=>e.split(t).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join(" ");var iue="Label",l4=S.forwardRef((e,t)=>v.jsx(Ue.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));l4.displayName=iue;var u4=l4;const oue=ru("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Hm=S.forwardRef(({className:e,...t},n)=>v.jsx(u4,{ref:n,className:Te(oue(),e),...t}));Hm.displayName=u4.displayName;const sue=ru("block",{variants:{variant:{primary:"text-text",secondary:"text-text-dim"},size:{default:"text-base",xs:"text-xs",sm:"text-sm",md:"text-md",lg:"text-lg",xl:"text-xl","2xl":"text-2xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{variant:"primary",size:"default",weight:"normal"}}),hn=({className:e,weight:t,variant:n,as:r="span",size:i,...o})=>v.jsx(r,{className:Te(sue({size:i,variant:n,weight:t,className:e})),...o}),aue=(e,t)=>(typeof t=="string"&&(t=t==null?void 0:t.split(".")),t==null?void 0:t.reduce((n,r)=>n&&n[r]!==void 0?n[r]:void 0,e)),lue=(e,t=[],n)=>{let r={};function i(o,s){for(const[a,u]of Object.entries(o)){let c=[...s,a];u&&u.constructor===Object?(t!=null&&t.length?t.every(h=>Object.keys(u).includes(h)):!1)?r={...r,[c.join(".")]:u}:i(u,c):r={...r,[c.join(".")]:u}}}return i(e,[]),r};var Kn=(e=>(e.STRING="STRING",e.NUMBER="NUMBER",e.DATE="DATE",e.ENUM="ENUM",e.ARRAY="ARRAY",e.BOOLEAN="BOOLEAN",e.RECORD="RECORD",e.OBJECT="OBJECT",e.UNION="UNION",e.CREATABLE="CREATABLE",e.SELECT="SELECT",e.MULTI_SELECT="MULTI_SELECT",e))(Kn||{});function Wl({schema:e,isOptional:t=!1}){return e instanceof sn.ZodObject?{type:"OBJECT",isOptional:t}:e instanceof sn.ZodString?e instanceof sn.ZodString&&e._def.checks.some(n=>n.kind==="datetime")?{type:"DATE",isOptional:t}:{type:"STRING",isOptional:t}:e instanceof So?{type:"NUMBER",isOptional:t}:e instanceof Ll?{type:"BOOLEAN",isOptional:t}:e instanceof xs?{type:"DATE",isOptional:t}:e instanceof zl?{type:"ENUM",isOptional:t,options:[{label:e.value,value:e.value}]}:e instanceof Bi?{type:"ENUM",isOptional:t,options:e.options.map(n=>({label:n,value:n}))}:e instanceof Pr?{type:"ARRAY",isOptional:t,options:e.element instanceof Bi?e.element.options.map(n=>({label:n,value:n})):[]}:e instanceof sn.ZodOptional||e instanceof sn.ZodDefault?Wl({schema:e._def.innerType,isOptional:!0}):e instanceof sn.ZodEffects?Wl({schema:e._def.schema,isOptional:t}):e instanceof sn.ZodRecord?{type:"RECORD",isOptional:t,innerSchema:e._def.valueType}:{type:"STRING",isOptional:t}}function uue({schema:e,errors:t,renderFieldMap:n,schemaField:r,renderLabel:i,control:o,variables:s,onFieldChange:a,schemaOptions:u,values:c,isOptional:f=!1,isNullable:h=!1}){var k,w;const p=Wl({schema:e,isOptional:f}),m=u!=null&&u.parentField?aue(c,u==null?void 0:u.parentField):"";if(u!=null&&u.parentField&&!m)return null;if(!n)return;const y=lue(t,["message","type"]),x=u!=null&&u.parentField?(k=u==null?void 0:u.options)==null?void 0:k[m]:(u==null?void 0:u.options)||p.options;return v.jsxs("div",{className:"flex flex-col gap-1 mt-3",children:[i?i({isOptional:!!p.isOptional,schemaField:r}):v.jsxs(Hm,{className:"flex gap-0.5 capitalize",htmlFor:r,"aria-required":!p.isOptional,children:[!(p!=null&&p.isOptional)&&v.jsx("span",{className:"text-red-500",children:"*"}),v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3",size:"xs",children:Vp(r.split(".").pop()||"")})]}),n[p.type]({name:r,options:x,control:o,variables:s,innerSchema:p.innerSchema,handleFieldChange:a,isNullable:h}),y!=null&&y[r]?v.jsx(hn,{size:"xs",className:"text-red-500",children:(w=y[r])==null?void 0:w.message}):null]},r)}function c4({renderDynamicForm:e,schema:t,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:s,action:a,isOptional:u=!1,isNullable:c=!1,depth:f}){const h=Wl({schema:t,isOptional:u});if(t instanceof da){const p=t.options;return v.jsxs("div",{children:[v.jsxs(Hm,{className:"flex gap-0.5 capitalize mb-2",htmlFor:s,"aria-required":!h.isOptional,children:[!(h!=null&&h.isOptional)&&v.jsx("span",{className:"text-red-500",children:"*"}),v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3",size:"xs",children:Vp(s)})]}),v.jsx("div",{className:"flex flex-col gap-4",children:p.map((m,y)=>v.jsxs(S.Fragment,{children:[y>=1&&v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 text-center",size:"xs",children:"or"}),v.jsx("div",{className:"ring-1 ring-white/10 p-2 rounded-md relative",children:e({schema:m,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:s,action:a,isOptional:u,isNullable:c,depth:f})})]},y))})]})}return null}function d4({renderDynamicForm:e,schema:t,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:s,action:a,isArray:u=!1,isOptional:c=!1,depth:f}){const h=Wl({schema:t,isOptional:c}),{fields:p,append:m,remove:y}=ik({control:r,name:s});function x(){m({})}return v.jsxs("div",{children:[v.jsxs(Hm,{className:"flex gap-0.5 capitalize mb-2",htmlFor:s,"aria-required":!h.isOptional,children:[!(h!=null&&h.isOptional)&&v.jsx("span",{className:"text-red-500",children:"*"}),v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3",size:"xs",children:Vp(s)})]}),u?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex flex-col gap-4",children:p.map((k,w)=>v.jsxs("div",{className:"ring-1 ring-white/10 p-2 rounded-md relative",children:[v.jsx(Bt,{type:"button",variant:"ghost",size:"icon",onClick:()=>y(w),className:"absolute top-0 right-0",children:v.jsx(va,{className:"text-icon h-3.5 w-3.5"})}),e({schema:t instanceof Pr?t.element:t,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:`${s}.${w}`,action:a,isOptional:c,depth:f})]},k.id))}),v.jsx("div",{className:"flex flex-col gap-4",children:v.jsxs(Bt,{type:"button",variant:"outline",className:"w-full text-xs h-9",onClick:x,children:["Add ",Vp(s.split(".").pop()||"")]})})]}):v.jsx("div",{className:"ring-1 ring-white/10 p-2 rounded-md relative",children:e({schema:t,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:s,action:a,isOptional:c,depth:f})})]})}function cue({name:e,control:t,handleFieldChange:n}){return v.jsx(cu,{name:e,control:t,render:({field:r})=>v.jsx(Xd,{...r,type:"number",onChange:i=>{const o=i.target.value===""?void 0:Number(i.target.value);r.onChange(o),n==null||n({key:e,value:o})}})})}function due({name:e,control:t,renderField:n}){const{fields:r,append:i,remove:o}=ik({control:t,name:e});return v.jsxs("div",{className:"space-y-3",children:[r.map((s,a)=>v.jsxs("div",{className:"relative space-y-2 rounded-lg border p-4",children:[v.jsx(Bt,{type:"button",variant:"ghost",size:"icon",className:"absolute right-2 top-2",onClick:()=>o(a),children:v.jsx(va,{className:"h-4 w-4"})}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Xd,{placeholder:"Key",...t.register(`${e}.${a}.key`)}),n({fieldName:`${e}.${a}.value`,index:a})]})]},s.id)),v.jsxs(Bt,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:()=>i({key:"",value:""}),children:[v.jsx(jc,{className:"mr-2 h-4 w-4"}),"Add Key-Value Pair"]})]})}function tp(){return{[Kn.STRING]:e=>{const{options:t,...n}=e;return t!=null&&t.length?v.jsx(xx,{...n,options:t}):v.jsx(rue,{...n})},[Kn.NUMBER]:e=>v.jsx(cue,{...e}),[Kn.BOOLEAN]:e=>v.jsx($ie,{...e}),[Kn.DATE]:e=>v.jsx(Sle,{...e}),[Kn.ENUM]:e=>{const{options:t=[]}=e;return v.jsx(xx,{...e,options:t})},[Kn.ARRAY]:e=>{const t=({fieldName:n,index:r})=>tp()[Kn.STRING]({...e,name:n});return v.jsx(Oie,{...e,renderField:t})},[Kn.RECORD]:e=>{const t=({fieldName:n,index:r})=>tp()[Kn.STRING]({...e,name:n});return v.jsx(due,{...e,renderField:t})},[Kn.OBJECT]:e=>{const{innerSchema:t,name:n,control:r,handleFieldChange:i}=e;return t?v.jsx(d4,{schema:t,control:r,parentField:n,handleFieldChange:(o,s)=>i({key:o,value:s}),formValues:{},errors:{},renderDynamicForm:o=>Wp({...o,handleFieldChange:i})}):null},[Kn.UNION]:e=>{const{innerSchema:t,name:n,control:r,handleFieldChange:i}=e;return!t||!(t instanceof da)?null:v.jsx(c4,{schema:t,control:r,parentField:n,handleFieldChange:(o,s)=>i({key:o,value:s}),renderDynamicForm:o=>{const s=Wl({schema:o.schema});return tp()[s.type]({...e,...o,control:r,handleFieldChange:i})},formValues:{},errors:{}})},[Kn.CREATABLE]:e=>v.jsx(NT,{...e}),[Kn.SELECT]:e=>{const{options:t=[]}=e;return v.jsx(xx,{...e,options:t})},[Kn.MULTI_SELECT]:e=>v.jsx(NT,{...e})}}function fue(e){return(t,n)=>e({key:t,value:n})}function Wp({schema:e,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s=!1,isNullable:a=!1,depth:u=0}){return u>10?(console.warn("Maximum schema resolution depth reached. Possible circular reference."),null):e instanceof sn.ZodObject?Object.entries(e.shape).map(([c,f])=>{const h=t?`${t}.${c}`:c;return Mc({schema:f,parentField:h,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s,isNullable:a})}):Mc({schema:e,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s,isNullable:a})}function Mc({schema:e,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s=!1,isNullable:a=!1}){if(e instanceof sn.ZodDefault)return null;if(e instanceof sn.ZodOptional)return Mc({schema:e._def.innerType,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:!0,isNullable:a});if(e instanceof sn.ZodObject)return v.jsx("div",{className:"flex flex-col gap-8 py-8",children:v.jsx(d4,{schema:e,control:n,parentField:t,handleFieldChange:(u,c)=>o({key:u,value:c}),formValues:r,errors:i,isOptional:s,renderDynamicForm:u=>Wp({...u,handleFieldChange:o})})},t);if(e instanceof sn.ZodUnion){if(e.options.some(u=>u instanceof sn.ZodNull)){const u=e.options.find(c=>!(c instanceof sn.ZodNull));return Mc({schema:sn.optional(u),parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isNullable:!0})}return v.jsx(c4,{schema:e,control:n,parentField:t,handleFieldChange:fue(o),formValues:r,errors:i,isOptional:s,isNullable:a,renderDynamicForm:u=>Wp({...u,handleFieldChange:c=>o(c)})})}return e instanceof sn.ZodArray?Mc({schema:e.element,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s,isNullable:a}):v.jsx("div",{children:uue({schema:e,schemaField:t,control:n,values:r,errors:i,renderFieldMap:tp(),onFieldChange:o})},t)}function mk({schema:e,onSubmit:t,onChange:n,isSubmitLoading:r,submitButtonLabel:i="Submit"}){var k,w,E;const o=(k=e==null?void 0:e._def)==null?void 0:k.typeName,s=(w=e==null?void 0:e._def)==null?void 0:w.options,a=(E=e==null?void 0:e._def)==null?void 0:E.discriminator,u=xre({resolver:o==="ZodDiscriminatedUnion"?Die(e,a):Sre(e)}),{control:c,handleSubmit:f,watch:h}=u,p=u.watch(),m=a?h(a):void 0,y=o==="ZodDiscriminatedUnion"?(s==null?void 0:s.find(C=>{var N,P,A;return((A=(P=(N=C==null?void 0:C.shape)==null?void 0:N[a])==null?void 0:P._def)==null?void 0:A.value)===m}))||sn.object({[a]:sn.string()}):e;S.useEffect(()=>{n==null||n(p)},[p,n]);function x({key:C,value:N}){C===a?(u.setValue(C,N),n==null||n({...p,[C]:N})):(u.setValue(C,N),n==null||n({...p,[C]:N}))}return v.jsx(fr,{className:"h-full w-full",children:v.jsxs("form",{onSubmit:f(t),className:"flex flex-col gap-4 p-4",children:[Wp({schema:y,parentField:"",control:c,formValues:p,errors:u.formState.errors,handleFieldChange:x}),v.jsx(Bt,{disabled:r,type:"submit",children:r?v.jsx(HB,{className:"h-4 w-4 animate-spin"}):i})]})})}var hue=Object.create,Ym=Object.defineProperty,pue=Object.defineProperties,mue=Object.getOwnPropertyDescriptor,gue=Object.getOwnPropertyDescriptors,f4=Object.getOwnPropertyNames,Up=Object.getOwnPropertySymbols,yue=Object.getPrototypeOf,gk=Object.prototype.hasOwnProperty,h4=Object.prototype.propertyIsEnumerable,zT=(e,t,n)=>t in e?Ym(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))gk.call(t,n)&&zT(e,n,t[n]);if(Up)for(var n of Up(t))h4.call(t,n)&&zT(e,n,t[n]);return e},qm=(e,t)=>pue(e,gue(t)),p4=(e,t)=>{var n={};for(var r in e)gk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Up)for(var r of Up(e))t.indexOf(r)<0&&h4.call(e,r)&&(n[r]=e[r]);return n},vue=(e,t)=>function(){return t||(0,e[f4(e)[0]])((t={exports:{}}).exports,t),t.exports},xue=(e,t)=>{for(var n in t)Ym(e,n,{get:t[n],enumerable:!0})},wue=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of f4(t))!gk.call(e,i)&&i!==n&&Ym(e,i,{get:()=>t[i],enumerable:!(r=mue(t,i))||r.enumerable});return e},bue=(e,t,n)=>(n=e!=null?hue(yue(e)):{},wue(!e||!e.__esModule?Ym(n,"default",{value:e,enumerable:!0}):n,e)),kue=vue({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,o={},s={util:{encode:function y(x){return x instanceof a?new a(x.type,y(x.content),x.alias):Array.isArray(x)?x.map(y):x.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(x,k){k=k||{};var w,E;switch(s.util.type(x)){case"Object":if(E=s.util.objId(x),k[E])return k[E];w={},k[E]=w;for(var C in x)x.hasOwnProperty(C)&&(w[C]=y(x[C],k));return w;case"Array":return E=s.util.objId(x),k[E]?k[E]:(w=[],k[E]=w,x.forEach(function(N,P){w[P]=y(N,k)}),w);default:return x}},getLanguage:function(y){for(;y;){var x=r.exec(y.className);if(x)return x[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,x){y.className=y.className.replace(RegExp(r,"gi"),""),y.classList.add("language-"+x)},isActive:function(y,x,k){for(var w="no-"+x;y;){var E=y.classList;if(E.contains(x))return!0;if(E.contains(w))return!1;y=y.parentElement}return!!k}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,x){var k=s.util.clone(s.languages[y]);for(var w in x)k[w]=x[w];return k},insertBefore:function(y,x,k,w){w=w||s.languages;var E=w[y],C={};for(var N in E)if(E.hasOwnProperty(N)){if(N==x)for(var P in k)k.hasOwnProperty(P)&&(C[P]=k[P]);k.hasOwnProperty(N)||(C[N]=E[N])}var A=w[y];return w[y]=C,s.languages.DFS(s.languages,function(O,M){M===A&&O!=y&&(this[O]=C)}),C},DFS:function y(x,k,w,E){E=E||{};var C=s.util.objId;for(var N in x)if(x.hasOwnProperty(N)){k.call(x,N,x[N],w||N);var P=x[N],A=s.util.type(P);A==="Object"&&!E[C(P)]?(E[C(P)]=!0,y(P,k,null,E)):A==="Array"&&!E[C(P)]&&(E[C(P)]=!0,y(P,k,N,E))}}},plugins:{},highlight:function(y,x,k){var w={code:y,grammar:x,language:k};if(s.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=s.tokenize(w.code,w.grammar),s.hooks.run("after-tokenize",w),a.stringify(s.util.encode(w.tokens),w.language)},tokenize:function(y,x){var k=x.rest;if(k){for(var w in k)x[w]=k[w];delete x.rest}var E=new f;return h(E,E.head,y),c(y,E,x,E.head,0),m(E)},hooks:{all:{},add:function(y,x){var k=s.hooks.all;k[y]=k[y]||[],k[y].push(x)},run:function(y,x){var k=s.hooks.all[y];if(!(!k||!k.length))for(var w=0,E;E=k[w++];)E(x)}},Token:a};function a(y,x,k,w){this.type=y,this.content=x,this.alias=k,this.length=(w||"").length|0}a.stringify=function y(x,k){if(typeof x=="string")return x;if(Array.isArray(x)){var w="";return x.forEach(function(A){w+=y(A,k)}),w}var E={type:x.type,content:y(x.content,k),tag:"span",classes:["token",x.type],attributes:{},language:k},C=x.alias;C&&(Array.isArray(C)?Array.prototype.push.apply(E.classes,C):E.classes.push(C)),s.hooks.run("wrap",E);var N="";for(var P in E.attributes)N+=" "+P+'="'+(E.attributes[P]||"").replace(/"/g,""")+'"';return"<"+E.tag+' class="'+E.classes.join(" ")+'"'+N+">"+E.content+"</"+E.tag+">"};function u(y,x,k,w){y.lastIndex=x;var E=y.exec(k);if(E&&w&&E[1]){var C=E[1].length;E.index+=C,E[0]=E[0].slice(C)}return E}function c(y,x,k,w,E,C){for(var N in k)if(!(!k.hasOwnProperty(N)||!k[N])){var P=k[N];P=Array.isArray(P)?P:[P];for(var A=0;A<P.length;++A){if(C&&C.cause==N+","+A)return;var O=P[A],M=O.inside,j=!!O.lookbehind,R=!!O.greedy,$=O.alias;if(R&&!O.pattern.global){var F=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,F+"g")}for(var H=O.pattern||O,I=w.next,q=E;I!==x.tail&&!(C&&q>=C.reach);q+=I.value.length,I=I.next){var Y=I.value;if(x.length>y.length)return;if(!(Y instanceof a)){var Z=1,B;if(R){if(B=u(H,q,y,j),!B||B.index>=y.length)break;var V=B.index,W=B.index+B[0].length,L=q;for(L+=I.value.length;V>=L;)I=I.next,L+=I.value.length;if(L-=I.value.length,q=L,I.value instanceof a)continue;for(var U=I;U!==x.tail&&(L<W||typeof U.value=="string");U=U.next)Z++,L+=U.value.length;Z--,Y=y.slice(q,L),B.index-=q}else if(B=u(H,0,Y,j),!B)continue;var V=B.index,D=B[0],G=Y.slice(0,V),K=Y.slice(V+D.length),J=q+Y.length;C&&J>C.reach&&(C.reach=J);var ee=I.prev;G&&(ee=h(x,ee,G),q+=G.length),p(x,ee,Z);var re=new a(N,M?s.tokenize(D,M):D,$,D);if(I=h(x,ee,re),K&&h(x,I,K),Z>1){var ue={cause:N+","+A,reach:J};c(y,x,k,I.prev,q,ue),C&&ue.reach>C.reach&&(C.reach=ue.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},x={value:null,prev:y,next:null};y.next=x,this.head=y,this.tail=x,this.length=0}function h(y,x,k){var w=x.next,E={value:k,prev:x,next:w};return x.next=E,w.prev=E,y.length++,E}function p(y,x,k){for(var w=x.next,E=0;E<k&&w!==y.tail;E++)w=w.next;x.next=w,w.prev=x,y.length-=E}function m(y){for(var x=[],k=y.head.next;k!==y.tail;)x.push(k.value),k=k.next;return x}return s}();t.exports=n,n.default=n}}),ge=bue(kue());ge.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ge.languages.markup.tag.inside["attr-value"].inside.entity=ge.languages.markup.entity,ge.languages.markup.doctype.inside["internal-subset"].inside=ge.languages.markup,ge.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(ge.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ge.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:ge.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},ge.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(ge.languages.markup.tag,"addAttribute",{value:function(e,t){ge.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:ge.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ge.languages.html=ge.languages.markup,ge.languages.mathml=ge.languages.markup,ge.languages.svg=ge.languages.markup,ge.languages.xml=ge.languages.extend("markup",{}),ge.languages.ssml=ge.languages.xml,ge.languages.atom=ge.languages.xml,ge.languages.rss=ge.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(ge),ge.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ge.languages.javascript=ge.languages.extend("clike",{"class-name":[ge.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ge.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ge.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ge.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ge.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ge.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ge.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ge.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ge.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ge.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ge.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ge.languages.markup&&(ge.languages.markup.tag.addInlined("script","javascript"),ge.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ge.languages.js=ge.languages.javascript,ge.languages.actionscript=ge.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ge.languages.actionscript["class-name"].alias="function",delete ge.languages.actionscript.parameter,delete ge.languages.actionscript["literal-property"],ge.languages.markup&&ge.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ge.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(ge),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var o=function(h){h.inside||(h.inside={}),h.inside.rest=r},s="doc-comment";if(a=e.languages[i]){var a,u=a[s];if((u=u||(a=e.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[s])instanceof RegExp&&(u=a[s]={pattern:u}),Array.isArray(u))for(var c=0,f=u.length;c<f;c++)u[c]instanceof RegExp&&(u[c]={pattern:u[c]}),o(u[c]);else o(u)}})}}),t.addSupport(["java","javascript","php"],t)}(ge),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(ge),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(ge),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(a,u){u=(u||"").replace(/m/g,"")+"m";var c=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(c,u)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(o),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(ge),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(c){return c=c.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,s=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(f){c!==f&&(e.languages.markdown[c].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(c){c.language!=="markdown"&&c.language!=="md"||function f(h){if(h&&typeof h!="string")for(var p=0,m=h.length;p<m;p++){var y,x=h[p];x.type!=="code"?f(x.content):(y=x.content[1],x=x.content[3],y&&x&&y.type==="code-language"&&x.type==="code-block"&&typeof y.content=="string"&&(y=y.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),y="language-"+(y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase()),x.alias?typeof x.alias=="string"?x.alias=[x.alias,y]:x.alias.push(y):x.alias=[y]))}}(c.tokens)}),e.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var f="",h=0,p=c.classes.length;h<p;h++){var m=c.classes[h],m=/language-(.+)/.exec(m);if(m){f=m[1];break}}var y,x=e.languages[f];x?c.content=e.highlight(function(k){return k=k.replace(s,""),k=k.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(w,E){var C;return(E=E.toLowerCase())[0]==="#"?(C=E[1]==="x"?parseInt(E.slice(2),16):Number(E.slice(1)),u(C)):a[E]||w})}(c.content),x,f):f&&f!=="none"&&e.plugins.autoloader&&(y="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),c.attributes.id=y,e.plugins.autoloader.loadLanguages(f,function(){var k=document.getElementById(y);k&&(k.innerHTML=e.highlight(k.textContent,e.languages[f],f))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(ge),ge.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ge.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ge.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(y){return typeof y!="string"&&y.type!=="comment"&&y.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(h(["definition-mutation","punctuation"])&&f(1).content==="("){n+=2;var o=p(/^\($/,/^\)$/);if(o===-1)continue;for(;n<o;n++){var s=f(0);s.type==="variable"&&(m(s,"variable-input"),i.push(s.content))}n=o+1}if(h(["punctuation","property-query"])&&f(0).content==="{"&&(n++,m(f(0),"property-mutation"),0<i.length)){var a=p(/^\{$/,/^\}$/);if(a!==-1)for(var u=n;u<a;u++){var c=t[u];c.type==="variable"&&0<=i.indexOf(c.content)&&m(c,"variable-input")}}}}function f(y){return t[n+y]}function h(y,x){x=x||0;for(var k=0;k<y.length;k++){var w=f(k+x);if(!w||w.type!==y[k])return}return 1}function p(y,x){for(var k=1,w=n;w<t.length;w++){var E=t[w],C=E.content;if(E.type==="punctuation"&&typeof C=="string"){if(y.test(C))k++;else if(x.test(C)&&--k===0)return w}}return-1}function m(y,x){var k=y.alias;k?Array.isArray(k)||(y.alias=k=[k]):y.alias=k=[],k.push(x)}}),ge.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,i=r.inside["interpolation-punctuation"],o=r.pattern.source;function s(h,p){if(e.languages[h])return{pattern:RegExp("((?:"+p+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:h}}}}function a(h,p,m){return h={code:h,grammar:p,language:m},e.hooks.run("before-tokenize",h),h.tokens=e.tokenize(h.code,h.grammar),e.hooks.run("after-tokenize",h),h.tokens}function u(h,p,m){var k=e.tokenize(h,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),y=0,x={},k=a(k.map(function(E){if(typeof E=="string")return E;for(var C,N,E=E.content;h.indexOf((N=y++,C="___"+m.toUpperCase()+"_"+N+"___"))!==-1;);return x[C]=E,C}).join(""),p,m),w=Object.keys(x);return y=0,function E(C){for(var N=0;N<C.length;N++){if(y>=w.length)return;var P,A,O,M,j,R,$,F=C[N];typeof F=="string"||typeof F.content=="string"?(P=w[y],($=(R=typeof F=="string"?F:F.content).indexOf(P))!==-1&&(++y,A=R.substring(0,$),j=x[P],O=void 0,(M={})["interpolation-punctuation"]=i,(M=e.tokenize(j,M)).length===3&&((O=[1,1]).push.apply(O,a(M[1],e.languages.javascript,"javascript")),M.splice.apply(M,O)),O=new e.Token("interpolation",M,r.alias,j),M=R.substring($+P.length),j=[],A&&j.push(A),j.push(O),M&&(E(R=[M]),j.push.apply(j,R)),typeof F=="string"?(C.splice.apply(C,[N,1].concat(j)),N+=j.length-1):F.content=j)):($=F.content,Array.isArray($)?E($):E([$]))}}(k),new e.Token(m,k,"language-"+m,h)}e.languages.javascript["template-string"]=[s("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),s("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),s("svg",/\bsvg/.source),s("markdown",/\b(?:markdown|md)/.source),s("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),s("sql",/\bsql/.source),t].filter(Boolean);var c={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(h){return typeof h=="string"?h:Array.isArray(h)?h.map(f).join(""):f(h.content)}e.hooks.add("after-tokenize",function(h){h.language in c&&function p(m){for(var y=0,x=m.length;y<x;y++){var k,w,E,C=m[y];typeof C!="string"&&(k=C.content,Array.isArray(k)?C.type==="template-string"?(C=k[1],k.length===3&&typeof C!="string"&&C.type==="embedded-code"&&(w=f(C),C=C.alias,C=Array.isArray(C)?C[0]:C,E=e.languages[C])&&(k[1]=u(w,E,C))):p(k):typeof k!="string"&&p([k]))}}(h.tokens)})}(ge),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(ge),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(ge),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(ge),ge.languages.n4js=ge.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ge.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ge.languages.n4jsd=ge.languages.n4js,function(e){function t(s,a){return RegExp(s.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var o=n[r],i=e.languages.javascript[o],o=(i=e.util.type(i)==="RegExp"?e.languages.javascript[o]={pattern:i}:i).inside||{};(i.inside=o)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(ge),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(u,c){return u=u.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(u,c)}i=o(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function s(u){for(var c=[],f=0;f<u.length;f++){var h=u[f],p=!1;typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?0<c.length&&c[c.length-1].tagName===a(h.content[0].content[1])&&c.pop():h.content[h.content.length-1].content!=="/>"&&c.push({tagName:a(h.content[0].content[1]),openedBraces:0}):0<c.length&&h.type==="punctuation"&&h.content==="{"?c[c.length-1].openedBraces++:0<c.length&&0<c[c.length-1].openedBraces&&h.type==="punctuation"&&h.content==="}"?c[c.length-1].openedBraces--:p=!0),(p||typeof h=="string")&&0<c.length&&c[c.length-1].openedBraces===0&&(p=a(h),f<u.length-1&&(typeof u[f+1]=="string"||u[f+1].type==="plain-text")&&(p+=a(u[f+1]),u.splice(f+1,1)),0<f&&(typeof u[f-1]=="string"||u[f-1].type==="plain-text")&&(p=a(u[f-1])+p,u.splice(f-1,1),f--),u[f]=new e.Token("plain-text",p,null,p)),h.content&&typeof h.content!="string"&&s(h.content)}}var a=function(u){return u?typeof u=="string"?u:typeof u.content=="string"?u.content:u.content.map(a).join(""):""};e.hooks.add("after-tokenize",function(u){u.language!=="jsx"&&u.language!=="tsx"||s(u.tokens)})}(ge),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(ge),ge.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ge.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=ge.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(ge),ge.languages.c=ge.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ge.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ge.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ge.languages.c.string],char:ge.languages.c.char,comment:ge.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ge.languages.c}}}}),ge.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ge.languages.c.boolean,ge.languages.objectivec=ge.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ge.languages.objectivec["class-name"],ge.languages.objc=ge.languages.objectivec,ge.languages.reason=ge.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ge.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ge.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(ge),ge.languages.go=ge.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ge.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ge.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(ge),ge.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ge.languages.python["string-interpolation"].inside.interpolation.inside.rest=ge.languages.python,ge.languages.py=ge.languages.python,ge.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ge.languages.webmanifest=ge.languages.json;var m4={};xue(m4,{dracula:()=>Eue,duotoneDark:()=>_ue,duotoneLight:()=>Tue,github:()=>Pue,gruvboxMaterialDark:()=>oce,gruvboxMaterialLight:()=>ace,jettwaveDark:()=>Xue,jettwaveLight:()=>Jue,nightOwl:()=>Mue,nightOwlLight:()=>Oue,oceanicNext:()=>jue,okaidia:()=>Fue,oneDark:()=>tce,oneLight:()=>rce,palenight:()=>$ue,shadesOfPurple:()=>Vue,synthwave84:()=>Uue,ultramin:()=>Yue,vsDark:()=>g4,vsLight:()=>Zue});var Sue={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},Eue=Sue,Cue={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},_ue=Cue,Nue={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},Tue=Nue,Aue={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Pue=Aue,Rue={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Mue=Rue,Due={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Oue=Due,xr={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",punctuation:"#5FB3B3",tag:"#fc929e",function:"#79b6f2",className:"#FAC863",method:"#6699CC",operator:"#fc929e"},Iue={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:xr.keyword}},{types:["attr-value"],style:{color:xr.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:xr.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:xr.primitive}},{types:["boolean"],style:{color:xr.boolean}},{types:["tag"],style:{color:xr.tag}},{types:["string"],style:{color:xr.string}},{types:["punctuation"],style:{color:xr.string}},{types:["selector","char","builtin","inserted"],style:{color:xr.char}},{types:["function"],style:{color:xr.function}},{types:["operator","entity","url","variable"],style:{color:xr.variable}},{types:["keyword"],style:{color:xr.keyword}},{types:["atrule","class-name"],style:{color:xr.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},jue=Iue,Lue={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},Fue=Lue,zue={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},$ue=zue,Bue={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},Vue=Bue,Wue={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},Uue=Wue,Hue={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},Yue=Hue,que={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},g4=que,Gue={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Zue=Gue,Kue={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Xue=Kue,Que={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Jue=Que,ece={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},tce=ece,nce={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},rce=nce,ice={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},oce=ice,sce={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},ace=sce,lce=e=>S.useCallback(t=>{var n=t,{className:r,style:i,line:o}=n,s=p4(n,["className","style","line"]);const a=qm(Ii({},s),{className:im("token-line",r)});return typeof e=="object"&&"plain"in e&&(a.style=e.plain),typeof i=="object"&&(a.style=Ii(Ii({},a.style||{}),i)),a},[e]),uce=e=>{const t=S.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>e[i]))}},[e]);return S.useCallback(n=>{var r=n,{token:i,className:o,style:s}=r,a=p4(r,["token","className","style"]);const u=qm(Ii({},a),{className:im("token",...i.types,o),children:i.content,style:t(i)});return s!=null&&(u.style=Ii(Ii({},u.style||{}),s)),u},[t])},cce=/\r\n|\r|\n/,$T=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
355
|
+
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
356
|
+
`,e[0].empty=!0)},BT=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},dce=e=>{const t=[[]],n=[e],r=[0],i=[e.length];let o=0,s=0,a=[];const u=[a];for(;s>-1;){for(;(o=r[s]++)<i[s];){let c,f=t[s];const p=n[s][o];if(typeof p=="string"?(f=s>0?f:["plain"],c=p):(f=BT(f,p.type),p.alias&&(f=BT(f,p.alias)),c=p.content),typeof c!="string"){s++,t.push(f),n.push(c),r.push(0),i.push(c.length);continue}const m=c.split(cce),y=m.length;a.push({types:f,content:m[0]});for(let x=1;x<y;x++)$T(a),u.push(a=[]),a.push({types:f,content:m[x]})}s--,t.pop(),n.pop(),r.pop(),i.pop()}return $T(a),u},VT=dce,fce=({prism:e,code:t,grammar:n,language:r})=>S.useMemo(()=>{if(n==null)return VT([t]);const i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",i),VT(i.tokens)},[t,n,r,e]),hce=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((i,o)=>{const{languages:s,style:a}=o;return s&&!s.includes(t)||o.types.forEach(u=>{const c=Ii(Ii({},i[u]),a);i[u]=c}),i},{});return r.root=n,r.plain=qm(Ii({},n),{backgroundColor:void 0}),r},pce=hce,mce=({children:e,language:t,code:n,theme:r,prism:i})=>{const o=t.toLowerCase(),s=pce(r,o),a=lce(s),u=uce(s),c=i.languages[o],f=fce({prism:i,language:o,code:n,grammar:c});return e({tokens:f,className:`prism-code language-${o}`,style:s!=null?s.root:{},getLineProps:a,getTokenProps:u})},gce=e=>S.createElement(mce,qm(Ii({},e),{prism:e.prism||ge,theme:e.theme||g4,code:e.code,language:e.language}));/*! Bundled license information:
|
|
357
|
+
|
|
358
|
+
prismjs/prism.js:
|
|
359
|
+
(**
|
|
360
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
361
|
+
*
|
|
362
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
363
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
364
|
+
* @namespace
|
|
365
|
+
* @public
|
|
366
|
+
*)
|
|
367
|
+
*/const yce=(e,t)=>t.some(n=>{if(typeof n=="number")return e===n;const[r,i]=n.split(":").map(o=>parseInt(o));return r<=e&&e<=i}),vce=(e,t,n)=>n.some(([r,[i,o]])=>r===e&&i<=t&&t<=o),xce=(e,t)=>e.split(new RegExp(`(${t.map(([n])=>n).join("|")})`)).filter(Boolean),wce=e=>e.map(t=>{t=t.startsWith("/")?t:"/"+t;const[,n,r="0:Infinity"]=t.split("/"),[i,o=i]=r.split(":").map(s=>Number(s));return[n,[i,o]]}),y4=(e,t)=>()=>{const n=S.useContext(e);if(n===void 0)throw new Error(t);return n},Gm=e=>Object.assign(S.forwardRef(e),{displayName:e.displayName??e.name}),v4=S.createContext(void 0),x4=S.createContext(void 0),w4=y4(v4,'Could not find nearest <CodeBlock /> component. Please wrap this component with a <CodeBlock /> component imported from "react-code-block".'),yk=y4(x4,'Could not find nearest <CodeBlock.Code /> component. Please wrap this component with <CodeBlock.Code /> component imported from "react-code-block".'),uo=({code:e,words:t=[],lines:n=[],children:r,...i})=>{const o=S.useMemo(()=>wce(t),[t]);return v.jsx(v4.Provider,{value:{code:e.trim(),words:o,lines:n,...i},children:r})},bce=({as:e,children:t,...n},r)=>{const{lines:i,words:o,...s}=w4(),a=e??"pre";return v.jsx(gce,{...s,children:u=>v.jsx(a,{...n,ref:r,children:u.tokens.map((c,f)=>{const h=f+1,p=yce(h,i);return v.jsx(x4.Provider,{value:{highlight:u,line:c,lineNumber:h},children:typeof t=="function"?t({isLineHighlighted:p,lineNumber:h},f):t},f)})})})},kce=({as:e,children:t,className:n,...r},i)=>{const{highlight:o,line:s}=yk(),{getLineProps:a}=o,u=e??"div";return v.jsx(u,{...a({line:s,className:n}),...r,ref:i,children:t})},Sce=({as:e,children:t=({children:o})=>v.jsx("span",{children:o}),className:n,...r},i)=>{const{words:o}=w4(),{line:s,highlight:a,lineNumber:u}=yk(),{getTokenProps:c}=a,f=e??"span";return v.jsx(ne.Fragment,{children:s.map((h,p)=>{const{children:m,...y}=c({token:h,className:n}),x=o.length?xce(m,o):[m];return v.jsx(ne.Fragment,{children:x.map((k,w)=>v.jsx(f,{...y,...r,ref:i,children:t({children:k,isTokenHighlighted:vce(k,u,o)})},w))},p)})})},Ece=({as:e,...t},n)=>{const{lineNumber:r}=yk(),i=e??"span";return v.jsx(i,{...t,ref:n,children:r})};uo.Code=Gm(bce);uo.LineContent=Gm(kce);uo.Token=Gm(Sce);uo.LineNumber=Gm(Ece);function vk({code:e="",language:t="ts",filename:n,className:r}){return v.jsxs(uo,{code:e,language:t,theme:m4.oneDark,children:[n?v.jsx("div",{className:"absolute w-full px-6 py-2 pl-4 text-sm rounded bg-mastra-bg-2 text-mastra-el-6/50",children:n}):null,v.jsx(uo.Code,{className:Te("bg-transparent h-full p-6 rounded-xl whitespace-pre-wrap",n?"pt-10":"",r),children:v.jsx("div",{className:"table-row",children:v.jsxs("div",{className:"flex items-center",children:[v.jsx(uo.LineNumber,{className:"table-cell pr-4 text-sm text-right select-none text-gray-500/50"}),v.jsx(uo.LineContent,{className:"flex",children:v.jsx(uo.Token,{className:"font-mono text-sm mastra-token"})})]})})})]})}const Cce=()=>{const[e,t]=S.useState(!1);return{executeTool:async({agentId:r,toolId:i,input:o})=>{try{t(!0);const s=await fetch(`/api/agents/${r}/tools/${i}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!s.ok)throw new Error(`Error executing tool: ${s.statusText}`);return await s.json()}catch(s){throw console.error("Error executing tool:",s),s}finally{t(!1)}},isExecutingTool:e}},_ce=()=>{const{toolId:e,agentId:t}=nm(),{executeTool:n,isExecutingTool:r}=Cce(),[i,o]=S.useState(null),{agent:s,isLoading:a}=om(t),u=Object.values((s==null?void 0:s.tools)??{}).find(p=>p.id===e),c=async p=>{if(!s||!u)return;const m=await n({agentId:t,toolId:u.id,input:p});o(m)};if(a)return v.jsxs("div",{className:"flex flex-col h-full w-full bg-mastra-bg-1",children:[v.jsx(Cr,{title:"Loading..."}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] p-2 gap-2",children:[v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(Je,{className:"h-[200px] w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx(Je,{className:"h-[200px] w-full"})]})]})]});if(!s||!u)return null;const f=sk(Q1(J1(u.inputSchema))),h=[{label:"Agents",href:"/agents"},{label:t,href:`/agents/${t}`},{label:e,href:`/agents/${t}/tools/${e}`,isCurrent:!0}];return v.jsxs("div",{className:"flex flex-col h-full w-full bg-mastra-bg-1",children:[v.jsx(Cr,{title:v.jsx(Sm,{items:h})}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[1fr_2fr] p-2 gap-2",children:[v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(mk,{isSubmitLoading:r,schema:f,onSubmit:p=>{c(p)}})]}),v.jsxs("div",{className:"flex relative group flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx("div",{className:"flex flex-col gap-2",children:v.jsx(cm,{classname:"absolute z-40 top-4 right-4 w-8 h-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity duration-150 ease-in-out",content:JSON.stringify(i??{},null,2)})}),v.jsx(vk,{code:JSON.stringify(i??{},null,2),language:"json"})]})]})]})},Nce=()=>{const[e,t]=S.useState(!1);return{executeTool:async({toolId:r,input:i})=>{try{t(!0);const o=await fetch(`/api/tools/${r}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:i})});if(!o.ok){const s=await o.json();throw mn.error((s==null?void 0:s.error)||"Error executing dev tool"),new Error(`Error executing dev tool: ${(s==null?void 0:s.error)||o.statusText}`)}return await o.json()}catch(o){throw console.error("Error executing dev tool:",o),o}finally{t(!1)}},isExecuting:e}},Tce=()=>{const{toolId:e}=nm(),{executeTool:t,isExecuting:n}=Nce(),[r,i]=S.useState(null),{tool:o,isLoading:s}=c6(e),a=async f=>{if(!o)return;const h=await t({toolId:o.id,input:f});i(h)};if(s)return v.jsxs("div",{className:"flex flex-col h-full w-full bg-mastra-bg-1",children:[v.jsx(Cr,{title:"Loading..."}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] p-2 gap-2",children:[v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(Je,{className:"h-[200px] w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx(Je,{className:"h-[200px] w-full"})]})]})]});if(!o)return null;const u=sk(Q1(J1(o.inputSchema))),c=[{label:"Tools",href:"/tools"},{label:e,href:`/tools/all/${o.id}`,isCurrent:!0}];return v.jsxs("div",{className:"flex flex-col h-full w-full bg-mastra-bg-1",children:[v.jsx(Cr,{title:v.jsx(Sm,{items:c})}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] p-2 gap-2",children:[v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(mk,{isSubmitLoading:n,schema:u,onSubmit:f=>{a(f)},submitButtonLabel:"Run"})]}),v.jsxs("div",{className:"flex relative group flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx("div",{className:"flex flex-col gap-2",children:v.jsx(cm,{classname:"absolute z-40 top-4 right-4 w-8 h-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity duration-150 ease-in-out",content:JSON.stringify(r??{},null,2)})}),v.jsx(vk,{code:JSON.stringify(r??{},null,2),language:"json"})]})]})]})},Ace=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/workflows");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching workflows",a),mn.error((a==null?void 0:a.error)||"Error fetching workflows");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching workflows",o),mn.error("Error fetching workflows")}finally{r(!1)}})()},[]),{workflows:e,isLoading:n}},b4=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/workflows/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching workflow",u),mn.error((u==null?void 0:u.error)||"Error fetching workflow");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching workflow",s),mn.error("Error fetching workflow")}finally{i(!1)}})()},[e]),{workflow:t,isLoading:r}},Pce=()=>{const[e,t]=S.useState(!1);return{executeWorkflow:async({workflowId:r,input:i})=>{try{t(!0);const o=await fetch(`/api/workflows/${r}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({triggerData:i})});if(!o.ok){const s=await o.json();mn.error((s==null?void 0:s.error)||"Error executing workflow");return}return await o.json()}catch(o){throw console.error("Error executing workflow:",o),o}finally{t(!1)}},isExecutingWorkflow:e}};function Rce(){const{workflows:e,isLoading:t}=Ace(),n=ks();return v.jsxs("div",{className:"flex flex-col h-full relative overflow-hidden",children:[v.jsx(Cr,{title:"Workflows"}),v.jsx("main",{className:"flex-1 relative overflow-hidden",children:v.jsx(fr,{className:"rounded-lg h-full",children:v.jsxs(yb,{children:[v.jsx(vb,{className:"bg-[#171717] sticky top-0 z-10",children:v.jsxs(ea,{className:"border-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(ao,{className:"w-[50px]"}),v.jsx(ao,{className:"text-mastra-el-3 w-1/2",children:"Name"}),v.jsx(ao,{className:"text-mastra-el-3",children:"Action"})]})}),v.jsx(xb,{className:"border-b border-gray-6",children:t?v.jsxs(ea,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-8"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})})]}):Object.entries(e).map(([r,i])=>v.jsxs(ea,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(Bn,{children:v.jsx("div",{className:"h-8 w-full flex items-center justify-center",children:v.jsx(T0,{className:"h-4 w-4 text-mastra-el-5"})})}),v.jsx(Bn,{className:"font-medium truncate max-w-[500px] text-mastra-el-5",children:i.name}),v.jsx(Bn,{className:"text-mastra-el-5 text-sm",children:v.jsx("span",{onClick:()=>{n(`/workflows/${r}`)},className:"hover:no-underline",children:v.jsxs(Bt,{size:"sm",variant:"outline",children:[v.jsx(T0,{className:"h-4 w-4 text-inherit"}),"View Workflow"]})})})]},r))})]})})})]})}function gn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=gn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Mce={value:()=>{}};function Zm(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new np(n)}function np(e){this._=e}function Dce(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}np.prototype=Zm.prototype={constructor:np,on:function(e,t){var n=this._,r=Dce(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=Oce(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=WT(n[i],e.name,t);else if(t==null)for(i in n)n[i]=WT(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new np(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function Oce(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function WT(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Mce,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var zw="http://www.w3.org/1999/xhtml";const UT={svg:"http://www.w3.org/2000/svg",xhtml:zw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Km(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),UT.hasOwnProperty(t)?{space:UT[t],local:e}:e}function Ice(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===zw&&t.documentElement.namespaceURI===zw?t.createElement(e):t.createElementNS(n,e)}}function jce(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function k4(e){var t=Km(e);return(t.local?jce:Ice)(t)}function Lce(){}function xk(e){return e==null?Lce:function(){return this.querySelector(e)}}function Fce(e){typeof e!="function"&&(e=xk(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),u,c,f=0;f<s;++f)(u=o[f])&&(c=e.call(u,u.__data__,f,o))&&("__data__"in u&&(c.__data__=u.__data__),a[f]=c);return new Mr(r,this._parents)}function zce(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function $ce(){return[]}function S4(e){return e==null?$ce:function(){return this.querySelectorAll(e)}}function Bce(e){return function(){return zce(e.apply(this,arguments))}}function Vce(e){typeof e=="function"?e=Bce(e):e=S4(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,u,c=0;c<a;++c)(u=s[c])&&(r.push(e.call(u,u.__data__,c,s)),i.push(u));return new Mr(r,i)}function E4(e){return function(){return this.matches(e)}}function C4(e){return function(t){return t.matches(e)}}var Wce=Array.prototype.find;function Uce(e){return function(){return Wce.call(this.children,e)}}function Hce(){return this.firstElementChild}function Yce(e){return this.select(e==null?Hce:Uce(typeof e=="function"?e:C4(e)))}var qce=Array.prototype.filter;function Gce(){return Array.from(this.children)}function Zce(e){return function(){return qce.call(this.children,e)}}function Kce(e){return this.selectAll(e==null?Gce:Zce(typeof e=="function"?e:C4(e)))}function Xce(e){typeof e!="function"&&(e=E4(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],u,c=0;c<s;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new Mr(r,this._parents)}function _4(e){return new Array(e.length)}function Qce(){return new Mr(this._enter||this._groups.map(_4),this._parents)}function Hp(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Hp.prototype={constructor:Hp,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Jce(e){return function(){return e}}function ede(e,t,n,r,i,o){for(var s=0,a,u=t.length,c=o.length;s<c;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new Hp(e,o[s]);for(;s<u;++s)(a=t[s])&&(i[s]=a)}function tde(e,t,n,r,i,o,s){var a,u,c=new Map,f=t.length,h=o.length,p=new Array(f),m;for(a=0;a<f;++a)(u=t[a])&&(p[a]=m=s.call(u,u.__data__,a,t)+"",c.has(m)?i[a]=u:c.set(m,u));for(a=0;a<h;++a)m=s.call(e,o[a],a,o)+"",(u=c.get(m))?(r[a]=u,u.__data__=o[a],c.delete(m)):n[a]=new Hp(e,o[a]);for(a=0;a<f;++a)(u=t[a])&&c.get(p[a])===u&&(i[a]=u)}function nde(e){return e.__data__}function rde(e,t){if(!arguments.length)return Array.from(this,nde);var n=t?tde:ede,r=this._parents,i=this._groups;typeof e!="function"&&(e=Jce(e));for(var o=i.length,s=new Array(o),a=new Array(o),u=new Array(o),c=0;c<o;++c){var f=r[c],h=i[c],p=h.length,m=ide(e.call(f,f&&f.__data__,c,r)),y=m.length,x=a[c]=new Array(y),k=s[c]=new Array(y),w=u[c]=new Array(p);n(f,h,x,k,w,m,t);for(var E=0,C=0,N,P;E<y;++E)if(N=x[E]){for(E>=C&&(C=E+1);!(P=k[C])&&++C<y;);N._next=P||null}}return s=new Mr(s,r),s._enter=a,s._exit=u,s}function ide(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ode(){return new Mr(this._exit||this._groups.map(_4),this._parents)}function sde(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function ade(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),u=0;u<s;++u)for(var c=n[u],f=r[u],h=c.length,p=a[u]=new Array(h),m,y=0;y<h;++y)(m=c[y]||f[y])&&(p[y]=m);for(;u<i;++u)a[u]=n[u];return new Mr(a,this._parents)}function lde(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function ude(e){e||(e=cde);function t(h,p){return h&&p?e(h.__data__,p.__data__):!h-!p}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,u=i[o]=new Array(a),c,f=0;f<a;++f)(c=s[f])&&(u[f]=c);u.sort(t)}return new Mr(i,this._parents).order()}function cde(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dde(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fde(){return Array.from(this)}function hde(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function pde(){let e=0;for(const t of this)++e;return e}function mde(){return!this.node()}function gde(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function yde(e){return function(){this.removeAttribute(e)}}function vde(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xde(e,t){return function(){this.setAttribute(e,t)}}function wde(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function bde(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function kde(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Sde(e,t){var n=Km(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?vde:yde:typeof t=="function"?n.local?kde:bde:n.local?wde:xde)(n,t))}function N4(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ede(e){return function(){this.style.removeProperty(e)}}function Cde(e,t,n){return function(){this.style.setProperty(e,t,n)}}function _de(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Nde(e,t,n){return arguments.length>1?this.each((t==null?Ede:typeof t=="function"?_de:Cde)(e,t,n??"")):Ul(this.node(),e)}function Ul(e,t){return e.style.getPropertyValue(t)||N4(e).getComputedStyle(e,null).getPropertyValue(t)}function Tde(e){return function(){delete this[e]}}function Ade(e,t){return function(){this[e]=t}}function Pde(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Rde(e,t){return arguments.length>1?this.each((t==null?Tde:typeof t=="function"?Pde:Ade)(e,t)):this.node()[e]}function T4(e){return e.trim().split(/^|\s+/)}function wk(e){return e.classList||new A4(e)}function A4(e){this._node=e,this._names=T4(e.getAttribute("class")||"")}A4.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function P4(e,t){for(var n=wk(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function R4(e,t){for(var n=wk(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Mde(e){return function(){P4(this,e)}}function Dde(e){return function(){R4(this,e)}}function Ode(e,t){return function(){(t.apply(this,arguments)?P4:R4)(this,e)}}function Ide(e,t){var n=T4(e+"");if(arguments.length<2){for(var r=wk(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Ode:t?Mde:Dde)(n,t))}function jde(){this.textContent=""}function Lde(e){return function(){this.textContent=e}}function Fde(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function zde(e){return arguments.length?this.each(e==null?jde:(typeof e=="function"?Fde:Lde)(e)):this.node().textContent}function $de(){this.innerHTML=""}function Bde(e){return function(){this.innerHTML=e}}function Vde(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Wde(e){return arguments.length?this.each(e==null?$de:(typeof e=="function"?Vde:Bde)(e)):this.node().innerHTML}function Ude(){this.nextSibling&&this.parentNode.appendChild(this)}function Hde(){return this.each(Ude)}function Yde(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qde(){return this.each(Yde)}function Gde(e){var t=typeof e=="function"?e:k4(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Zde(){return null}function Kde(e,t){var n=typeof e=="function"?e:k4(e),r=t==null?Zde:typeof t=="function"?t:xk(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Xde(){var e=this.parentNode;e&&e.removeChild(this)}function Qde(){return this.each(Xde)}function Jde(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function efe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tfe(e){return this.select(e?efe:Jde)}function nfe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rfe(e){return function(t){e.call(this,t,this.__data__)}}function ife(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ofe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function sfe(e,t,n){return function(){var r=this.__on,i,o=rfe(t);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function afe(e,t,n){var r=ife(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,c=a.length,f;u<c;++u)for(i=0,f=a[u];i<o;++i)if((s=r[i]).type===f.type&&s.name===f.name)return f.value}return}for(a=t?sfe:ofe,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function M4(e,t,n){var r=N4(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function lfe(e,t){return function(){return M4(this,e,t)}}function ufe(e,t){return function(){return M4(this,e,t.apply(this,arguments))}}function cfe(e,t){return this.each((typeof t=="function"?ufe:lfe)(e,t))}function*dfe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var D4=[null];function Mr(e,t){this._groups=e,this._parents=t}function Jd(){return new Mr([[document.documentElement]],D4)}function ffe(){return this}Mr.prototype=Jd.prototype={constructor:Mr,select:Fce,selectAll:Vce,selectChild:Yce,selectChildren:Kce,filter:Xce,data:rde,enter:Qce,exit:ode,join:sde,merge:ade,selection:ffe,order:lde,sort:ude,call:dde,nodes:fde,node:hde,size:pde,empty:mde,each:gde,attr:Sde,style:Nde,property:Rde,classed:Ide,text:zde,html:Wde,raise:Hde,lower:qde,append:Gde,insert:Kde,remove:Qde,clone:tfe,datum:nfe,on:afe,dispatch:cfe,[Symbol.iterator]:dfe};function Er(e){return typeof e=="string"?new Mr([[document.querySelector(e)]],[document.documentElement]):new Mr([[e]],D4)}function hfe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ii(e,t){if(e=hfe(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const pfe={passive:!1},fd={capture:!0,passive:!1};function wx(e){e.stopImmediatePropagation()}function Nl(e){e.preventDefault(),e.stopImmediatePropagation()}function O4(e){var t=e.document.documentElement,n=Er(e).on("dragstart.drag",Nl,fd);"onselectstart"in t?n.on("selectstart.drag",Nl,fd):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function I4(e,t){var n=e.document.documentElement,r=Er(e).on("dragstart.drag",null);t&&(r.on("click.drag",Nl,fd),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Oh=e=>()=>e;function $w(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:u,dy:c,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:f}})}$w.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function mfe(e){return!e.ctrlKey&&!e.button}function gfe(){return this.parentNode}function yfe(e,t){return t??{x:e.x,y:e.y}}function vfe(){return navigator.maxTouchPoints||"ontouchstart"in this}function j4(){var e=mfe,t=gfe,n=yfe,r=vfe,i={},o=Zm("start","drag","end"),s=0,a,u,c,f,h=0;function p(N){N.on("mousedown.drag",m).filter(r).on("touchstart.drag",k).on("touchmove.drag",w,pfe).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(N,P){if(!(f||!e.call(this,N,P))){var A=C(this,t.call(this,N,P),N,P,"mouse");A&&(Er(N.view).on("mousemove.drag",y,fd).on("mouseup.drag",x,fd),O4(N.view),wx(N),c=!1,a=N.clientX,u=N.clientY,A("start",N))}}function y(N){if(Nl(N),!c){var P=N.clientX-a,A=N.clientY-u;c=P*P+A*A>h}i.mouse("drag",N)}function x(N){Er(N.view).on("mousemove.drag mouseup.drag",null),I4(N.view,c),Nl(N),i.mouse("end",N)}function k(N,P){if(e.call(this,N,P)){var A=N.changedTouches,O=t.call(this,N,P),M=A.length,j,R;for(j=0;j<M;++j)(R=C(this,O,N,P,A[j].identifier,A[j]))&&(wx(N),R("start",N,A[j]))}}function w(N){var P=N.changedTouches,A=P.length,O,M;for(O=0;O<A;++O)(M=i[P[O].identifier])&&(Nl(N),M("drag",N,P[O]))}function E(N){var P=N.changedTouches,A=P.length,O,M;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),O=0;O<A;++O)(M=i[P[O].identifier])&&(wx(N),M("end",N,P[O]))}function C(N,P,A,O,M,j){var R=o.copy(),$=ii(j||A,P),F,H,I;if((I=n.call(N,new $w("beforestart",{sourceEvent:A,target:p,identifier:M,active:s,x:$[0],y:$[1],dx:0,dy:0,dispatch:R}),O))!=null)return F=I.x-$[0]||0,H=I.y-$[1]||0,function q(Y,Z,B){var W=$,L;switch(Y){case"start":i[M]=q,L=s++;break;case"end":delete i[M],--s;case"drag":$=ii(B||Z,P),L=s;break}R.call(Y,N,new $w(Y,{sourceEvent:Z,subject:I,target:p,identifier:M,active:L,x:$[0]+F,y:$[1]+H,dx:$[0]-W[0],dy:$[1]-W[1],dispatch:R}),O)}}return p.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Oh(!!N),p):e},p.container=function(N){return arguments.length?(t=typeof N=="function"?N:Oh(N),p):t},p.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Oh(N),p):n},p.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:Oh(!!N),p):r},p.on=function(){var N=o.on.apply(o,arguments);return N===o?p:N},p.clickDistance=function(N){return arguments.length?(h=(N=+N)*N,p):Math.sqrt(h)},p}function bk(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function L4(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ef(){}var hd=.7,Yp=1/hd,Tl="\\s*([+-]?\\d+)\\s*",pd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xfe=/^#([0-9a-f]{3,8})$/,wfe=new RegExp(`^rgb\\(${Tl},${Tl},${Tl}\\)$`),bfe=new RegExp(`^rgb\\(${ji},${ji},${ji}\\)$`),kfe=new RegExp(`^rgba\\(${Tl},${Tl},${Tl},${pd}\\)$`),Sfe=new RegExp(`^rgba\\(${ji},${ji},${ji},${pd}\\)$`),Efe=new RegExp(`^hsl\\(${pd},${ji},${ji}\\)$`),Cfe=new RegExp(`^hsla\\(${pd},${ji},${ji},${pd}\\)$`),HT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};bk(ef,md,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:YT,formatHex:YT,formatHex8:_fe,formatHsl:Nfe,formatRgb:qT,toString:qT});function YT(){return this.rgb().formatHex()}function _fe(){return this.rgb().formatHex8()}function Nfe(){return F4(this).formatHsl()}function qT(){return this.rgb().formatRgb()}function md(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xfe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?GT(t):n===3?new dr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ih(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ih(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=wfe.exec(e))?new dr(t[1],t[2],t[3],1):(t=bfe.exec(e))?new dr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=kfe.exec(e))?Ih(t[1],t[2],t[3],t[4]):(t=Sfe.exec(e))?Ih(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Efe.exec(e))?XT(t[1],t[2]/100,t[3]/100,1):(t=Cfe.exec(e))?XT(t[1],t[2]/100,t[3]/100,t[4]):HT.hasOwnProperty(e)?GT(HT[e]):e==="transparent"?new dr(NaN,NaN,NaN,0):null}function GT(e){return new dr(e>>16&255,e>>8&255,e&255,1)}function Ih(e,t,n,r){return r<=0&&(e=t=n=NaN),new dr(e,t,n,r)}function Tfe(e){return e instanceof ef||(e=md(e)),e?(e=e.rgb(),new dr(e.r,e.g,e.b,e.opacity)):new dr}function Bw(e,t,n,r){return arguments.length===1?Tfe(e):new dr(e,t,n,r??1)}function dr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}bk(dr,Bw,L4(ef,{brighter(e){return e=e==null?Yp:Math.pow(Yp,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?hd:Math.pow(hd,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dr(oa(this.r),oa(this.g),oa(this.b),qp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ZT,formatHex:ZT,formatHex8:Afe,formatRgb:KT,toString:KT}));function ZT(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}`}function Afe(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}${Js((isNaN(this.opacity)?1:this.opacity)*255)}`}function KT(){const e=qp(this.opacity);return`${e===1?"rgb(":"rgba("}${oa(this.r)}, ${oa(this.g)}, ${oa(this.b)}${e===1?")":`, ${e})`}`}function qp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function oa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Js(e){return e=oa(e),(e<16?"0":"")+e.toString(16)}function XT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new oi(e,t,n,r)}function F4(e){if(e instanceof oi)return new oi(e.h,e.s,e.l,e.opacity);if(e instanceof ef||(e=md(e)),!e)return new oi;if(e instanceof oi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,u=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=u<.5?o+i:2-o-i,s*=60):a=u>0&&u<1?0:s,new oi(s,a,u,e.opacity)}function Pfe(e,t,n,r){return arguments.length===1?F4(e):new oi(e,t,n,r??1)}function oi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}bk(oi,Pfe,L4(ef,{brighter(e){return e=e==null?Yp:Math.pow(Yp,e),new oi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?hd:Math.pow(hd,e),new oi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new dr(bx(e>=240?e-240:e+120,i,r),bx(e,i,r),bx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new oi(QT(this.h),jh(this.s),jh(this.l),qp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=qp(this.opacity);return`${e===1?"hsl(":"hsla("}${QT(this.h)}, ${jh(this.s)*100}%, ${jh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function QT(e){return e=(e||0)%360,e<0?e+360:e}function jh(e){return Math.max(0,Math.min(1,e||0))}function bx(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const z4=e=>()=>e;function Rfe(e,t){return function(n){return e+n*t}}function Mfe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Dfe(e){return(e=+e)==1?$4:function(t,n){return n-t?Mfe(t,n,e):z4(isNaN(t)?n:t)}}function $4(e,t){var n=t-e;return n?Rfe(e,n):z4(isNaN(e)?t:e)}const JT=function e(t){var n=Dfe(t);function r(i,o){var s=n((i=Bw(i)).r,(o=Bw(o)).r),a=n(i.g,o.g),u=n(i.b,o.b),c=$4(i.opacity,o.opacity);return function(f){return i.r=s(f),i.g=a(f),i.b=u(f),i.opacity=c(f),i+""}}return r.gamma=e,r}(1);function ss(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Vw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kx=new RegExp(Vw.source,"g");function Ofe(e){return function(){return e}}function Ife(e){return function(t){return e(t)+""}}function jfe(e,t){var n=Vw.lastIndex=kx.lastIndex=0,r,i,o,s=-1,a=[],u=[];for(e=e+"",t=t+"";(r=Vw.exec(e))&&(i=kx.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,u.push({i:s,x:ss(r,i)})),n=kx.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?u[0]?Ife(u[0].x):Ofe(t):(t=u.length,function(c){for(var f=0,h;f<t;++f)a[(h=u[f]).i]=h.x(c);return a.join("")})}var eA=180/Math.PI,Ww={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function B4(e,t,n,r,i,o){var s,a,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,u/=a),e*r<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*eA,skewX:Math.atan(u)*eA,scaleX:s,scaleY:a}}var Lh;function Lfe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ww:B4(t.a,t.b,t.c,t.d,t.e,t.f)}function Ffe(e){return e==null||(Lh||(Lh=document.createElementNS("http://www.w3.org/2000/svg","g")),Lh.setAttribute("transform",e),!(e=Lh.transform.baseVal.consolidate()))?Ww:(e=e.matrix,B4(e.a,e.b,e.c,e.d,e.e,e.f))}function V4(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function o(c,f,h,p,m,y){if(c!==h||f!==p){var x=m.push("translate(",null,t,null,n);y.push({i:x-4,x:ss(c,h)},{i:x-2,x:ss(f,p)})}else(h||p)&&m.push("translate("+h+t+p+n)}function s(c,f,h,p){c!==f?(c-f>180?f+=360:f-c>180&&(c+=360),p.push({i:h.push(i(h)+"rotate(",null,r)-2,x:ss(c,f)})):f&&h.push(i(h)+"rotate("+f+r)}function a(c,f,h,p){c!==f?p.push({i:h.push(i(h)+"skewX(",null,r)-2,x:ss(c,f)}):f&&h.push(i(h)+"skewX("+f+r)}function u(c,f,h,p,m,y){if(c!==h||f!==p){var x=m.push(i(m)+"scale(",null,",",null,")");y.push({i:x-4,x:ss(c,h)},{i:x-2,x:ss(f,p)})}else(h!==1||p!==1)&&m.push(i(m)+"scale("+h+","+p+")")}return function(c,f){var h=[],p=[];return c=e(c),f=e(f),o(c.translateX,c.translateY,f.translateX,f.translateY,h,p),s(c.rotate,f.rotate,h,p),a(c.skewX,f.skewX,h,p),u(c.scaleX,c.scaleY,f.scaleX,f.scaleY,h,p),c=f=null,function(m){for(var y=-1,x=p.length,k;++y<x;)h[(k=p[y]).i]=k.x(m);return h.join("")}}}var zfe=V4(Lfe,"px, ","px)","deg)"),$fe=V4(Ffe,", ",")",")"),Bfe=1e-12;function tA(e){return((e=Math.exp(e))+1/e)/2}function Vfe(e){return((e=Math.exp(e))-1/e)/2}function Wfe(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ufe=function e(t,n,r){function i(o,s){var a=o[0],u=o[1],c=o[2],f=s[0],h=s[1],p=s[2],m=f-a,y=h-u,x=m*m+y*y,k,w;if(x<Bfe)w=Math.log(p/c)/t,k=function(O){return[a+O*m,u+O*y,c*Math.exp(t*O*w)]};else{var E=Math.sqrt(x),C=(p*p-c*c+r*x)/(2*c*n*E),N=(p*p-c*c-r*x)/(2*p*n*E),P=Math.log(Math.sqrt(C*C+1)-C),A=Math.log(Math.sqrt(N*N+1)-N);w=(A-P)/t,k=function(O){var M=O*w,j=tA(P),R=c/(n*E)*(j*Wfe(t*M+P)-Vfe(P));return[a+R*m,u+R*y,c*j/tA(t*M+P)]}}return k.duration=w*1e3*t/Math.SQRT2,k}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,u=a*a;return e(s,a,u)},i}(Math.SQRT2,2,4);var Hl=0,wc=0,uc=0,W4=1e3,Gp,bc,Zp=0,ga=0,Xm=0,gd=typeof performance=="object"&&performance.now?performance:Date,U4=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kk(){return ga||(U4(Hfe),ga=gd.now()+Xm)}function Hfe(){ga=0}function Kp(){this._call=this._time=this._next=null}Kp.prototype=H4.prototype={constructor:Kp,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?kk():+n)+(t==null?0:+t),!this._next&&bc!==this&&(bc?bc._next=this:Gp=this,bc=this),this._call=e,this._time=n,Uw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Uw())}};function H4(e,t,n){var r=new Kp;return r.restart(e,t,n),r}function Yfe(){kk(),++Hl;for(var e=Gp,t;e;)(t=ga-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Hl}function nA(){ga=(Zp=gd.now())+Xm,Hl=wc=0;try{Yfe()}finally{Hl=0,Gfe(),ga=0}}function qfe(){var e=gd.now(),t=e-Zp;t>W4&&(Xm-=t,Zp=e)}function Gfe(){for(var e,t=Gp,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Gp=n);bc=e,Uw(r)}function Uw(e){if(!Hl){wc&&(wc=clearTimeout(wc));var t=e-ga;t>24?(e<1/0&&(wc=setTimeout(nA,e-gd.now()-Xm)),uc&&(uc=clearInterval(uc))):(uc||(Zp=gd.now(),uc=setInterval(qfe,W4)),Hl=1,U4(nA))}}function rA(e,t,n){var r=new Kp;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Zfe=Zm("start","end","cancel","interrupt"),Kfe=[],Y4=0,iA=1,Hw=2,rp=3,oA=4,Yw=5,ip=6;function Qm(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Xfe(e,n,{name:t,index:r,group:i,on:Zfe,tween:Kfe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Y4})}function Sk(e,t){var n=yi(e,t);if(n.state>Y4)throw new Error("too late; already scheduled");return n}function Hi(e,t){var n=yi(e,t);if(n.state>rp)throw new Error("too late; already running");return n}function yi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Xfe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=H4(o,0,n.time);function o(c){n.state=iA,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var f,h,p,m;if(n.state!==iA)return u();for(f in r)if(m=r[f],m.name===n.name){if(m.state===rp)return rA(s);m.state===oA?(m.state=ip,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[f]):+f<t&&(m.state=ip,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[f])}if(rA(function(){n.state===rp&&(n.state=oA,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Hw,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Hw){for(n.state=rp,i=new Array(p=n.tween.length),f=0,h=-1;f<p;++f)(m=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=m);i.length=h+1}}function a(c){for(var f=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Yw,1),h=-1,p=i.length;++h<p;)i[h].call(e,f);n.state===Yw&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=ip,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function op(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>Hw&&r.state<Yw,r.state=ip,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function Qfe(e){return this.each(function(){op(this,e)})}function Jfe(e,t){var n,r;return function(){var i=Hi(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function ehe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Hi(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},u=0,c=i.length;u<c;++u)if(i[u].name===t){i[u]=a;break}u===c&&i.push(a)}o.tween=i}}function the(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=yi(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?Jfe:ehe)(n,e,t))}function Ek(e,t,n){var r=e._id;return e.each(function(){var i=Hi(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return yi(i,r).value[t]}}function q4(e,t){var n;return(typeof t=="number"?ss:t instanceof md?JT:(n=md(t))?(t=n,JT):jfe)(e,t)}function nhe(e){return function(){this.removeAttribute(e)}}function rhe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ihe(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function ohe(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function she(e,t,n){var r,i,o;return function(){var s,a=n(this),u;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=a+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,a)))}}function ahe(e,t,n){var r,i,o;return function(){var s,a=n(this),u;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=a+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,a)))}}function lhe(e,t){var n=Km(e),r=n==="transform"?$fe:q4;return this.attrTween(e,typeof t=="function"?(n.local?ahe:she)(n,r,Ek(this,"attr."+e,t)):t==null?(n.local?rhe:nhe)(n):(n.local?ohe:ihe)(n,r,t))}function uhe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function che(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function dhe(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&che(e,o)),n}return i._value=t,i}function fhe(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&uhe(e,o)),n}return i._value=t,i}function hhe(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Km(e);return this.tween(n,(r.local?dhe:fhe)(r,t))}function phe(e,t){return function(){Sk(this,e).delay=+t.apply(this,arguments)}}function mhe(e,t){return t=+t,function(){Sk(this,e).delay=t}}function ghe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?phe:mhe)(t,e)):yi(this.node(),t).delay}function yhe(e,t){return function(){Hi(this,e).duration=+t.apply(this,arguments)}}function vhe(e,t){return t=+t,function(){Hi(this,e).duration=t}}function xhe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yhe:vhe)(t,e)):yi(this.node(),t).duration}function whe(e,t){if(typeof t!="function")throw new Error;return function(){Hi(this,e).ease=t}}function bhe(e){var t=this._id;return arguments.length?this.each(whe(t,e)):yi(this.node(),t).ease}function khe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Hi(this,e).ease=n}}function She(e){if(typeof e!="function")throw new Error;return this.each(khe(this._id,e))}function Ehe(e){typeof e!="function"&&(e=E4(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],u,c=0;c<s;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new Co(r,this._parents,this._name,this._id)}function Che(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var u=t[a],c=n[a],f=u.length,h=s[a]=new Array(f),p,m=0;m<f;++m)(p=u[m]||c[m])&&(h[m]=p);for(;a<r;++a)s[a]=t[a];return new Co(s,this._parents,this._name,this._id)}function _he(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Nhe(e,t,n){var r,i,o=_he(t)?Sk:Hi;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function The(e,t){var n=this._id;return arguments.length<2?yi(this.node(),n).on.on(e):this.each(Nhe(n,e,t))}function Ahe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Phe(){return this.on("end.remove",Ahe(this._id))}function Rhe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xk(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],u=a.length,c=o[s]=new Array(u),f,h,p=0;p<u;++p)(f=a[p])&&(h=e.call(f,f.__data__,p,a))&&("__data__"in f&&(h.__data__=f.__data__),c[p]=h,Qm(c[p],t,n,p,c,yi(f,n)));return new Co(o,this._parents,t,n)}function Mhe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=S4(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var u=r[a],c=u.length,f,h=0;h<c;++h)if(f=u[h]){for(var p=e.call(f,f.__data__,h,u),m,y=yi(f,n),x=0,k=p.length;x<k;++x)(m=p[x])&&Qm(m,t,n,x,p,y);o.push(p),s.push(f)}return new Co(o,s,t,n)}var Dhe=Jd.prototype.constructor;function Ohe(){return new Dhe(this._groups,this._parents)}function Ihe(e,t){var n,r,i;return function(){var o=Ul(this,e),s=(this.style.removeProperty(e),Ul(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function G4(e){return function(){this.style.removeProperty(e)}}function jhe(e,t,n){var r,i=n+"",o;return function(){var s=Ul(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function Lhe(e,t,n){var r,i,o;return function(){var s=Ul(this,e),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(e),Ul(this,e))),s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,a))}}function Fhe(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var u=Hi(this,e),c=u.on,f=u.value[o]==null?a||(a=G4(t)):void 0;(c!==n||i!==f)&&(r=(n=c).copy()).on(s,i=f),u.on=r}}function zhe(e,t,n){var r=(e+="")=="transform"?zfe:q4;return t==null?this.styleTween(e,Ihe(e,r)).on("end.style."+e,G4(e)):typeof t=="function"?this.styleTween(e,Lhe(e,r,Ek(this,"style."+e,t))).each(Fhe(this._id,e)):this.styleTween(e,jhe(e,r,t),n).on("end.style."+e,null)}function $he(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Bhe(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&$he(e,s,n)),r}return o._value=t,o}function Vhe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Bhe(e,t,n??""))}function Whe(e){return function(){this.textContent=e}}function Uhe(e){return function(){var t=e(this);this.textContent=t??""}}function Hhe(e){return this.tween("text",typeof e=="function"?Uhe(Ek(this,"text",e)):Whe(e==null?"":e+""))}function Yhe(e){return function(t){this.textContent=e.call(this,t)}}function qhe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Yhe(i)),t}return r._value=e,r}function Ghe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,qhe(e))}function Zhe(){for(var e=this._name,t=this._id,n=Z4(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,u,c=0;c<a;++c)if(u=s[c]){var f=yi(u,t);Qm(u,e,n,c,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Co(r,this._parents,e,n)}function Khe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},u={value:function(){--i===0&&o()}};n.each(function(){var c=Hi(this,r),f=c.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(u)),c.on=t}),i===0&&o()})}var Xhe=0;function Co(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Z4(){return++Xhe}var io=Jd.prototype;Co.prototype={constructor:Co,select:Rhe,selectAll:Mhe,selectChild:io.selectChild,selectChildren:io.selectChildren,filter:Ehe,merge:Che,selection:Ohe,transition:Zhe,call:io.call,nodes:io.nodes,node:io.node,size:io.size,empty:io.empty,each:io.each,on:The,attr:lhe,attrTween:hhe,style:zhe,styleTween:Vhe,text:Hhe,textTween:Ghe,remove:Phe,tween:the,delay:ghe,duration:xhe,ease:bhe,easeVarying:She,end:Khe,[Symbol.iterator]:io[Symbol.iterator]};function Qhe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Jhe={time:null,delay:0,duration:250,ease:Qhe};function epe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function tpe(e){var t,n;e instanceof Co?(t=e._id,e=e._name):(t=Z4(),(n=Jhe).time=kk(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,u,c=0;c<a;++c)(u=s[c])&&Qm(u,e,t,c,s,n||epe(u,t));return new Co(r,this._parents,e,t)}Jd.prototype.interrupt=Qfe;Jd.prototype.transition=tpe;const Fh=e=>()=>e;function npe(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ho(e,t,n){this.k=e,this.x=t,this.y=n}ho.prototype={constructor:ho,scale:function(e){return e===1?this:new ho(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ho(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Jm=new ho(1,0,0);K4.prototype=ho.prototype;function K4(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Jm;return e.__zoom}function Sx(e){e.stopImmediatePropagation()}function cc(e){e.preventDefault(),e.stopImmediatePropagation()}function rpe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ipe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function sA(){return this.__zoom||Jm}function ope(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function spe(){return navigator.maxTouchPoints||"ontouchstart"in this}function ape(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function X4(){var e=rpe,t=ipe,n=ape,r=ope,i=spe,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,u=Ufe,c=Zm("start","zoom","end"),f,h,p,m=500,y=150,x=0,k=10;function w(I){I.property("__zoom",sA).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",R).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(I,q,Y,Z){var B=I.selection?I.selection():I;B.property("__zoom",sA),I!==B?P(I,q,Y,Z):B.interrupt().each(function(){A(this,arguments).event(Z).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},w.scaleBy=function(I,q,Y,Z){w.scaleTo(I,function(){var B=this.__zoom.k,W=typeof q=="function"?q.apply(this,arguments):q;return B*W},Y,Z)},w.scaleTo=function(I,q,Y,Z){w.transform(I,function(){var B=t.apply(this,arguments),W=this.__zoom,L=Y==null?N(B):typeof Y=="function"?Y.apply(this,arguments):Y,U=W.invert(L),V=typeof q=="function"?q.apply(this,arguments):q;return n(C(E(W,V),L,U),B,s)},Y,Z)},w.translateBy=function(I,q,Y,Z){w.transform(I,function(){return n(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),s)},null,Z)},w.translateTo=function(I,q,Y,Z,B){w.transform(I,function(){var W=t.apply(this,arguments),L=this.__zoom,U=Z==null?N(W):typeof Z=="function"?Z.apply(this,arguments):Z;return n(Jm.translate(U[0],U[1]).scale(L.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof Y=="function"?-Y.apply(this,arguments):-Y),W,s)},Z,B)};function E(I,q){return q=Math.max(o[0],Math.min(o[1],q)),q===I.k?I:new ho(q,I.x,I.y)}function C(I,q,Y){var Z=q[0]-Y[0]*I.k,B=q[1]-Y[1]*I.k;return Z===I.x&&B===I.y?I:new ho(I.k,Z,B)}function N(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function P(I,q,Y,Z){I.on("start.zoom",function(){A(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(Z).end()}).tween("zoom",function(){var B=this,W=arguments,L=A(B,W).event(Z),U=t.apply(B,W),V=Y==null?N(U):typeof Y=="function"?Y.apply(B,W):Y,D=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),G=B.__zoom,K=typeof q=="function"?q.apply(B,W):q,J=u(G.invert(V).concat(D/G.k),K.invert(V).concat(D/K.k));return function(ee){if(ee===1)ee=K;else{var re=J(ee),ue=D/re[2];ee=new ho(ue,V[0]-re[0]*ue,V[1]-re[1]*ue)}L.zoom(null,ee)}})}function A(I,q,Y){return!Y&&I.__zooming||new O(I,q)}function O(I,q){this.that=I,this.args=q,this.active=0,this.sourceEvent=null,this.extent=t.apply(I,q),this.taps=0}O.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,q){return this.mouse&&I!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var q=Er(this.that).datum();c.call(I,this.that,new npe(I,{sourceEvent:this.sourceEvent,target:w,type:I,transform:this.that.__zoom,dispatch:c}),q)}};function M(I,...q){if(!e.apply(this,arguments))return;var Y=A(this,q).event(I),Z=this.__zoom,B=Math.max(o[0],Math.min(o[1],Z.k*Math.pow(2,r.apply(this,arguments)))),W=ii(I);if(Y.wheel)(Y.mouse[0][0]!==W[0]||Y.mouse[0][1]!==W[1])&&(Y.mouse[1]=Z.invert(Y.mouse[0]=W)),clearTimeout(Y.wheel);else{if(Z.k===B)return;Y.mouse=[W,Z.invert(W)],op(this),Y.start()}cc(I),Y.wheel=setTimeout(L,y),Y.zoom("mouse",n(C(E(Z,B),Y.mouse[0],Y.mouse[1]),Y.extent,s));function L(){Y.wheel=null,Y.end()}}function j(I,...q){if(p||!e.apply(this,arguments))return;var Y=I.currentTarget,Z=A(this,q,!0).event(I),B=Er(I.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",D,!0),W=ii(I,Y),L=I.clientX,U=I.clientY;O4(I.view),Sx(I),Z.mouse=[W,this.__zoom.invert(W)],op(this),Z.start();function V(G){if(cc(G),!Z.moved){var K=G.clientX-L,J=G.clientY-U;Z.moved=K*K+J*J>x}Z.event(G).zoom("mouse",n(C(Z.that.__zoom,Z.mouse[0]=ii(G,Y),Z.mouse[1]),Z.extent,s))}function D(G){B.on("mousemove.zoom mouseup.zoom",null),I4(G.view,Z.moved),cc(G),Z.event(G).end()}}function R(I,...q){if(e.apply(this,arguments)){var Y=this.__zoom,Z=ii(I.changedTouches?I.changedTouches[0]:I,this),B=Y.invert(Z),W=Y.k*(I.shiftKey?.5:2),L=n(C(E(Y,W),Z,B),t.apply(this,q),s);cc(I),a>0?Er(this).transition().duration(a).call(P,L,Z,I):Er(this).call(w.transform,L,Z,I)}}function $(I,...q){if(e.apply(this,arguments)){var Y=I.touches,Z=Y.length,B=A(this,q,I.changedTouches.length===Z).event(I),W,L,U,V;for(Sx(I),L=0;L<Z;++L)U=Y[L],V=ii(U,this),V=[V,this.__zoom.invert(V),U.identifier],B.touch0?!B.touch1&&B.touch0[2]!==V[2]&&(B.touch1=V,B.taps=0):(B.touch0=V,W=!0,B.taps=1+!!f);f&&(f=clearTimeout(f)),W&&(B.taps<2&&(h=V[0],f=setTimeout(function(){f=null},m)),op(this),B.start())}}function F(I,...q){if(this.__zooming){var Y=A(this,q).event(I),Z=I.changedTouches,B=Z.length,W,L,U,V;for(cc(I),W=0;W<B;++W)L=Z[W],U=ii(L,this),Y.touch0&&Y.touch0[2]===L.identifier?Y.touch0[0]=U:Y.touch1&&Y.touch1[2]===L.identifier&&(Y.touch1[0]=U);if(L=Y.that.__zoom,Y.touch1){var D=Y.touch0[0],G=Y.touch0[1],K=Y.touch1[0],J=Y.touch1[1],ee=(ee=K[0]-D[0])*ee+(ee=K[1]-D[1])*ee,re=(re=J[0]-G[0])*re+(re=J[1]-G[1])*re;L=E(L,Math.sqrt(ee/re)),U=[(D[0]+K[0])/2,(D[1]+K[1])/2],V=[(G[0]+J[0])/2,(G[1]+J[1])/2]}else if(Y.touch0)U=Y.touch0[0],V=Y.touch0[1];else return;Y.zoom("touch",n(C(L,U,V),Y.extent,s))}}function H(I,...q){if(this.__zooming){var Y=A(this,q).event(I),Z=I.changedTouches,B=Z.length,W,L;for(Sx(I),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),W=0;W<B;++W)L=Z[W],Y.touch0&&Y.touch0[2]===L.identifier?delete Y.touch0:Y.touch1&&Y.touch1[2]===L.identifier&&delete Y.touch1;if(Y.touch1&&!Y.touch0&&(Y.touch0=Y.touch1,delete Y.touch1),Y.touch0)Y.touch0[1]=this.__zoom.invert(Y.touch0[0]);else if(Y.end(),Y.taps===2&&(L=ii(L,this),Math.hypot(h[0]-L[0],h[1]-L[1])<k)){var U=Er(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return w.wheelDelta=function(I){return arguments.length?(r=typeof I=="function"?I:Fh(+I),w):r},w.filter=function(I){return arguments.length?(e=typeof I=="function"?I:Fh(!!I),w):e},w.touchable=function(I){return arguments.length?(i=typeof I=="function"?I:Fh(!!I),w):i},w.extent=function(I){return arguments.length?(t=typeof I=="function"?I:Fh([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),w):t},w.scaleExtent=function(I){return arguments.length?(o[0]=+I[0],o[1]=+I[1],w):[o[0],o[1]]},w.translateExtent=function(I){return arguments.length?(s[0][0]=+I[0][0],s[1][0]=+I[1][0],s[0][1]=+I[0][1],s[1][1]=+I[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(I){return arguments.length?(n=I,w):n},w.duration=function(I){return arguments.length?(a=+I,w):a},w.interpolate=function(I){return arguments.length?(u=I,w):u},w.on=function(){var I=c.on.apply(c,arguments);return I===c?w:I},w.clickDistance=function(I){return arguments.length?(x=(I=+I)*I,w):Math.sqrt(x)},w.tapDistance=function(I){return arguments.length?(k=+I,w):k},w}const Po={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},yd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Q4=["Enter"," ","Escape"];var Yl;(function(e){e.Strict="strict",e.Loose="loose"})(Yl||(Yl={}));var sa;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(sa||(sa={}));var vd;(function(e){e.Partial="partial",e.Full="full"})(vd||(vd={}));const J4={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var ls;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ls||(ls={}));var xd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(xd||(xd={}));var We;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(We||(We={}));const aA={[We.Left]:We.Right,[We.Right]:We.Left,[We.Top]:We.Bottom,[We.Bottom]:We.Top};function e5(e){return e===null?null:e?"valid":"invalid"}const t5=e=>"id"in e&&"source"in e&&"target"in e,lpe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ck=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),tf=(e,t=[0,0])=>{const{width:n,height:r}=Ro(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},upe=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const o=typeof i=="string";let s=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(i):Ck(i)?i:t.nodeLookup.get(i.id));const a=s?Xp(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return eg(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tg(n)},nf=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const i=Xp(r);n=eg(n,i)}}),tg(n)},n5=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{const a={...rf(t,[n,r,i]),width:t.width/i,height:t.height/i},u=[];for(const c of e.values()){const{measured:f,selectable:h=!0,hidden:p=!1}=c;if(s&&!h||p)continue;const m=f.width??c.width??c.initialWidth??null,y=f.height??c.height??c.initialHeight??null,x=wd(a,Gl(c)),k=(m??0)*(y??0),w=o&&x>0;(!c.internals.handleBounds||w||x>=k||c.dragging)&&u.push(c)}return u},cpe=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function qw(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Gw({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){if(e.size===0)return Promise.resolve(!1);const a=nf(e),u=_k(a,t,n,(s==null?void 0:s.minZoom)??i,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration}),Promise.resolve(!0)}function r5({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:u,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},f=s.origin??r;let h=i;if(s.extent==="parent"&&!s.expandParent)if(!a)o==null||o("005",Po.error005());else{const m=a.measured.width,y=a.measured.height;m&&y&&(h=[[u,c],[u+m,c+y]])}else a&&Zl(s.extent)&&(h=[[s.extent[0][0]+u,s.extent[0][1]+c],[s.extent[1][0]+u,s.extent[1][1]+c]]);const p=Zl(h)?ya(t,h,s.measured):t;return{position:{x:p.x-u+s.measured.width*f[0],y:p.y-c+s.measured.height*f[1]},positionAbsolute:p}}async function dpe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(p=>p.id)),s=[];for(const p of n){if(p.deletable===!1)continue;const m=o.has(p.id),y=!m&&p.parentId&&s.find(x=>x.id===p.parentId);(m||y)&&s.push(p)}const a=new Set(t.map(p=>p.id)),u=r.filter(p=>p.deletable!==!1),f=cpe(s,u);for(const p of u)a.has(p.id)&&!f.find(y=>y.id===p.id)&&f.push(p);if(!i)return{edges:f,nodes:s};const h=await i({nodes:s,edges:f});return typeof h=="boolean"?h?{edges:f,nodes:s}:{edges:[],nodes:[]}:h}const ql=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ya=(e={x:0,y:0},t,n)=>({x:ql(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ql(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function i5(e,t,n){const{width:r,height:i}=Ro(n),{x:o,y:s}=n.internals.positionAbsolute;return ya(e,[[o,s],[o+r,s+i]],t)}const lA=(e,t,n)=>e<t?ql(Math.abs(e-t),1,t)/t:e>n?-ql(Math.abs(e-n),1,t)/t:0,o5=(e,t,n=15,r=40)=>{const i=lA(e.x,r,t.width-r)*n,o=lA(e.y,r,t.height-r)*n;return[i,o]},eg=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Zw=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),tg=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Gl=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Ck(e)?e.internals.positionAbsolute:tf(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Xp=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Ck(e)?e.internals.positionAbsolute:tf(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},s5=(e,t)=>tg(eg(Zw(e),Zw(t))),wd=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},uA=e=>li(e.width)&&li(e.height)&&li(e.x)&&li(e.y),li=e=>!isNaN(e)&&isFinite(e),fpe=(e,t)=>{},ng=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),rf=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{const a={x:(e-n)/i,y:(t-r)/i};return o?ng(a,s):a},a5=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),_k=(e,t,n,r,i,o)=>{const s=t/(e.width*(1+o)),a=n/(e.height*(1+o)),u=Math.min(s,a),c=ql(u,r,i),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*c,m=n/2-h*c;return{x:p,y:m,zoom:c}},Qp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Zl(e){return e!==void 0&&e!=="parent"}function Ro(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function l5(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function u5(e,t={width:0,height:0},n,r,i){const o={...e},s=r.get(n);if(s){const a=s.origin||i;o.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return o}function Dc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:s}=yo(e),a=rf({x:o-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},r),{x:u,y:c}=n?ng(a,t):a;return{xSnapped:u,ySnapped:c,...a}}const rg=e=>({width:e.offsetWidth,height:e.offsetHeight}),c5=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},hpe=["INPUT","SELECT","TEXTAREA"];function Kw(e){var r,i,o;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return hpe.includes(t==null?void 0:t.nodeName)||((o=t==null?void 0:t.hasAttribute)==null?void 0:o.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const d5=e=>"clientX"in e,yo=(e,t)=>{var o,s;const n=d5(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},cA=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...rg(s)}})};function f5({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const u=e*.125+i*.375+s*.375+n*.125,c=t*.125+o*.375+a*.375+r*.125,f=Math.abs(u-e),h=Math.abs(c-t);return[u,c,f,h]}function zh(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function dA({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case We.Left:return[t-zh(t-r,o),n];case We.Right:return[t+zh(r-t,o),n];case We.Top:return[t,n-zh(n-i,o)];case We.Bottom:return[t,n+zh(i-n,o)]}}function h5({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:r,targetY:i,targetPosition:o=We.Top,curvature:s=.25}){const[a,u]=dA({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[c,f]=dA({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[h,p,m,y]=f5({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:f});return[`M${e},${t} C${a},${u} ${c},${f} ${r},${i}`,h,p,m,y]}function p5({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[o,a,i,s]}function ppe({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;const o=n||t.selected||e.selected,s=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(o?s:0)}function mpe({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=eg(Xp(e),Xp(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return wd(s,tg(o))>0}const gpe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,ype=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),vpe=(e,t)=>{if(!e.source||!e.target)return t;let n;return t5(e)?n={...e}:n={...e,id:gpe(e)},ype(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function m5({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=p5({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const fA={[We.Left]:{x:-1,y:0},[We.Right]:{x:1,y:0},[We.Top]:{x:0,y:-1},[We.Bottom]:{x:0,y:1}},xpe=({source:e,sourcePosition:t=We.Bottom,target:n})=>t===We.Left||t===We.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},hA=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wpe({source:e,sourcePosition:t=We.Bottom,target:n,targetPosition:r=We.Top,center:i,offset:o}){const s=fA[t],a=fA[r],u={x:e.x+s.x*o,y:e.y+s.y*o},c={x:n.x+a.x*o,y:n.y+a.y*o},f=xpe({source:u,sourcePosition:t,target:c}),h=f.x!==0?"x":"y",p=f[h];let m=[],y,x;const k={x:0,y:0},w={x:0,y:0},[E,C,N,P]=p5({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[h]*a[h]===-1){y=i.x??E,x=i.y??C;const O=[{x:y,y:u.y},{x:y,y:c.y}],M=[{x:u.x,y:x},{x:c.x,y:x}];s[h]===p?m=h==="x"?O:M:m=h==="x"?M:O}else{const O=[{x:u.x,y:c.y}],M=[{x:c.x,y:u.y}];if(h==="x"?m=s.x===p?M:O:m=s.y===p?O:M,t===r){const H=Math.abs(e[h]-n[h]);if(H<=o){const I=Math.min(o-1,o-H);s[h]===p?k[h]=(u[h]>e[h]?-1:1)*I:w[h]=(c[h]>n[h]?-1:1)*I}}if(t!==r){const H=h==="x"?"y":"x",I=s[h]===a[H],q=u[H]>c[H],Y=u[H]<c[H];(s[h]===1&&(!I&&q||I&&Y)||s[h]!==1&&(!I&&Y||I&&q))&&(m=h==="x"?O:M)}const j={x:u.x+k.x,y:u.y+k.y},R={x:c.x+w.x,y:c.y+w.y},$=Math.max(Math.abs(j.x-m[0].x),Math.abs(R.x-m[0].x)),F=Math.max(Math.abs(j.y-m[0].y),Math.abs(R.y-m[0].y));$>=F?(y=(j.x+R.x)/2,x=m[0].y):(y=m[0].x,x=(j.y+R.y)/2)}return[[e,{x:u.x+k.x,y:u.y+k.y},...m,{x:c.x+w.x,y:c.y+w.y},n],y,x,N,P]}function bpe(e,t,n,r){const i=Math.min(hA(e,t)/2,hA(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${o+i*c},${s}Q ${o},${s} ${o},${s+i*f}`}const a=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${s+i*u}Q ${o},${s} ${o+i*a},${s}`}function Xw({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:r,targetY:i,targetPosition:o=We.Top,borderRadius:s=5,centerX:a,centerY:u,offset:c=20}){const[f,h,p,m,y]=wpe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:a,y:u},offset:c});return[f.reduce((k,w,E)=>{let C="";return E>0&&E<f.length-1?C=bpe(f[E-1],w,f[E+1],s):C=`${E===0?"M":"L"}${w.x} ${w.y}`,k+=C,k},""),h,p,m,y]}function pA(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function kpe(e){var h;const{sourceNode:t,targetNode:n}=e;if(!pA(t)||!pA(n))return null;const r=t.internals.handleBounds||mA(t.handles),i=n.internals.handleBounds||mA(n.handles),o=gA((r==null?void 0:r.source)??[],e.sourceHandle),s=gA(e.connectionMode===Yl.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!s)return(h=e.onError)==null||h.call(e,"008",Po.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(o==null?void 0:o.position)||We.Bottom,u=(s==null?void 0:s.position)||We.Top,c=bd(t,o,a),f=bd(n,s,u);return{sourceX:c.x,sourceY:c.y,targetX:f.x,targetY:f.y,sourcePosition:a,targetPosition:u}}function mA(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function bd(e,t,n=We.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Ro(e);if(r)return{x:i+s/2,y:o+a/2};switch((t==null?void 0:t.position)??n){case We.Top:return{x:i+s/2,y:o};case We.Right:return{x:i+s,y:o+a/2};case We.Bottom:return{x:i+s/2,y:o+a};case We.Left:return{x:i,y:o+a/2}}}function gA(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Qw(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Spe(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const c=Qw(u,t);o.has(c)||(s.push({id:c,color:u.color||n,...u}),o.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Nk={nodeOrigin:[0,0],nodeExtent:yd,elevateNodesOnSelect:!0,defaults:{}},Epe={...Nk,checkEquality:!0};function Tk(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Cpe(e,t,n){const r=Tk(Nk,n);for(const i of e.values())if(i.parentId)Ak(i,e,t,r);else{const o=tf(i,r.nodeOrigin),s=Zl(i.extent)?i.extent:r.nodeExtent,a=ya(o,s,Ro(i));i.internals.positionAbsolute=a}}function Jw(e,t,n,r){var a,u;const i=Tk(Epe,r),o=new Map(t),s=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let f=o.get(c.id);if(i.checkEquality&&c===(f==null?void 0:f.internals.userNode))t.set(c.id,f);else{const h=tf(c,i.nodeOrigin),p=Zl(c.extent)?c.extent:i.nodeExtent,m=ya(h,p,Ro(c));f={...i.defaults,...c,measured:{width:(a=c.measured)==null?void 0:a.width,height:(u=c.measured)==null?void 0:u.height},internals:{positionAbsolute:m,handleBounds:c.measured?f==null?void 0:f.internals.handleBounds:void 0,z:g5(c,s),userNode:c}},t.set(c.id,f)}c.parentId&&Ak(f,t,n,r)}}function _pe(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Ak(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:s}=Tk(Nk,r),a=e.parentId,u=t.get(a);if(!u){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}_pe(e,n);const c=i?1e3:0,{x:f,y:h,z:p}=Npe(e,u,o,s,c),{positionAbsolute:m}=e.internals,y=f!==m.x||h!==m.y;(y||p!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:y?{x:f,y:h}:m,z:p})}function g5(e,t){return(li(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Npe(e,t,n,r,i){const{x:o,y:s}=t.internals.positionAbsolute,a=Ro(e),u=tf(e,n),c=Zl(e.extent)?ya(u,e.extent,a):u;let f=ya({x:o+c.x,y:s+c.y},r,a);e.extent==="parent"&&(f=i5(f,a,t));const h=g5(e,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>h?p:h}}function Pk(e,t,n,r=[0,0]){var s;const i=[],o=new Map;for(const a of e){const u=t.get(a.parentId);if(!u)continue;const c=((s=o.get(a.parentId))==null?void 0:s.expandedRect)??Gl(u),f=s5(c,a.rect);o.set(a.parentId,{expandedRect:f,parent:u})}return o.size>0&&o.forEach(({expandedRect:a,parent:u},c)=>{var C;const f=u.internals.positionAbsolute,h=Ro(u),p=u.origin??r,m=a.x<f.x?Math.round(Math.abs(f.x-a.x)):0,y=a.y<f.y?Math.round(Math.abs(f.y-a.y)):0,x=Math.max(h.width,Math.round(a.width)),k=Math.max(h.height,Math.round(a.height)),w=(x-h.width)*p[0],E=(k-h.height)*p[1];(m>0||y>0||w||E)&&(i.push({id:c,type:"position",position:{x:u.position.x-m+w,y:u.position.y-y+E}}),(C=n.get(c))==null||C.forEach(N=>{e.some(P=>P.id===N.id)||i.push({id:N.id,type:"position",position:{x:N.position.x+m,y:N.position.y+y}})})),(h.width<a.width||h.height<a.height||m||y)&&i.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:x+(m?p[0]*m-w:0),height:k+(y?p[1]*y-E:0)}})}),i}function Tpe(e,t,n,r,i,o){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!s)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(s),{m22:f}=new window.DOMMatrixReadOnly(c.transform),h=[];for(const p of e.values()){const m=t.get(p.id);if(m)if(m.hidden)m.internals={...m.internals,handleBounds:void 0},a=!0;else{const y=rg(p.nodeElement),x=m.measured.width!==y.width||m.measured.height!==y.height;if(!!(y.width&&y.height&&(x||!m.internals.handleBounds||p.force))){const w=p.nodeElement.getBoundingClientRect(),E=Zl(m.extent)?m.extent:o;let{positionAbsolute:C}=m.internals;m.parentId&&m.extent==="parent"?C=i5(C,y,t.get(m.parentId)):E&&(C=ya(C,E,y)),m.measured=y,m.internals={...m.internals,positionAbsolute:C,handleBounds:{source:cA("source",p.nodeElement,w,f,m.id),target:cA("target",p.nodeElement,w,f,m.id)}},m.parentId&&Ak(m,t,n,{nodeOrigin:i}),a=!0,x&&(u.push({id:m.id,type:"dimensions",dimensions:y}),m.expandParent&&m.parentId&&h.push({id:m.id,parentId:m.parentId,rect:Gl(m,i)}))}}}if(h.length>0){const p=Pk(h,t,n,i);u.push(...p)}return{changes:u,updatedInternals:a}}async function Ape({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function y5(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:a=null}=r,u=`${i}-source-${s}`,c=`${o}-target-${a}`,f=e.get(u)||new Map,h=e.get(c)||new Map,p={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:a};t.set(r.id,r),e.set(u,f.set(`${o}-${a}`,p)),e.set(c,h.set(`${i}-${s}`,p))}}function v5(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:v5(n,t):!1}function yA(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function Ppe(e,t,n,r){const i=new Map;for(const[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!v5(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(o);a&&i.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return i}function Ex({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,u;const i=[];for(const[c,f]of t){const h=(s=n.get(c))==null?void 0:s.internals.userNode;h&&i.push({...h,position:f.position,dragging:r})}if(!e)return[i[0],i];const o=(a=n.get(e))==null?void 0:a.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:i[0],i]}function Rpe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,a=new Map,u=!1,c={x:0,y:0},f=null,h=!1,p=null,m=!1;function y({noDragClassName:k,handleSelector:w,domNode:E,isSelectable:C,nodeId:N,nodeClickDistance:P=0}){p=Er(E);function A({x:R,y:$},F){const{nodeLookup:H,nodeExtent:I,snapGrid:q,snapToGrid:Y,nodeOrigin:Z,onNodeDrag:B,onSelectionDrag:W,onError:L,updateNodePositions:U}=t();o={x:R,y:$};let V=!1,D={x:0,y:0,x2:0,y2:0};if(a.size>1&&I){const G=nf(a);D=Zw(G)}for(const[G,K]of a){if(!H.has(G))continue;let J={x:R-K.distance.x,y:$-K.distance.y};Y&&(J=ng(J,q));let ee=[[I[0][0],I[0][1]],[I[1][0],I[1][1]]];if(a.size>1&&I&&!K.extent){const{positionAbsolute:he}=K.internals,ke=he.x-D.x+I[0][0],fe=he.x+K.measured.width-D.x2+I[1][0],ve=he.y-D.y+I[0][1],Me=he.y+K.measured.height-D.y2+I[1][1];ee=[[ke,ve],[fe,Me]]}const{position:re,positionAbsolute:ue}=r5({nodeId:G,nextPosition:J,nodeLookup:H,nodeExtent:ee,nodeOrigin:Z,onError:L});V=V||K.position.x!==re.x||K.position.y!==re.y,K.position=re,K.internals.positionAbsolute=ue}if(V&&(U(a,!0),F&&(r||B||!N&&W))){const[G,K]=Ex({nodeId:N,dragItems:a,nodeLookup:H});r==null||r(F,a,G,K),B==null||B(F,G,K),N||W==null||W(F,K)}}async function O(){if(!f)return;const{transform:R,panBy:$,autoPanSpeed:F}=t(),[H,I]=o5(c,f,F);(H!==0||I!==0)&&(o.x=(o.x??0)-H/R[2],o.y=(o.y??0)-I/R[2],await $({x:H,y:I})&&A(o,null)),s=requestAnimationFrame(O)}function M(R){var V;const{nodeLookup:$,multiSelectionActive:F,nodesDraggable:H,transform:I,snapGrid:q,snapToGrid:Y,selectNodesOnDrag:Z,onNodeDragStart:B,onSelectionDragStart:W,unselectNodesAndEdges:L}=t();h=!0,(!Z||!C)&&!F&&N&&((V=$.get(N))!=null&&V.selected||L()),C&&Z&&N&&(e==null||e(N));const U=Dc(R.sourceEvent,{transform:I,snapGrid:q,snapToGrid:Y,containerBounds:f});if(o=U,a=Ppe($,H,U,N),a.size>0&&(n||B||!N&&W)){const[D,G]=Ex({nodeId:N,dragItems:a,nodeLookup:$});n==null||n(R.sourceEvent,a,D,G),B==null||B(R.sourceEvent,D,G),N||W==null||W(R.sourceEvent,G)}}const j=j4().clickDistance(P).on("start",R=>{const{domNode:$,nodeDragThreshold:F,transform:H,snapGrid:I,snapToGrid:q}=t();f=($==null?void 0:$.getBoundingClientRect())||null,m=!1,F===0&&M(R),o=Dc(R.sourceEvent,{transform:H,snapGrid:I,snapToGrid:q,containerBounds:f}),c=yo(R.sourceEvent,f)}).on("drag",R=>{const{autoPanOnNodeDrag:$,transform:F,snapGrid:H,snapToGrid:I,nodeDragThreshold:q,nodeLookup:Y}=t(),Z=Dc(R.sourceEvent,{transform:F,snapGrid:H,snapToGrid:I,containerBounds:f});if((R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||N&&!Y.has(N))&&(m=!0),!m){if(!u&&$&&h&&(u=!0,O()),!h){const B=Z.xSnapped-(o.x??0),W=Z.ySnapped-(o.y??0);Math.sqrt(B*B+W*W)>q&&M(R)}(o.x!==Z.xSnapped||o.y!==Z.ySnapped)&&a&&h&&(c=yo(R.sourceEvent,f),A(Z,R.sourceEvent))}}).on("end",R=>{if(!(!h||m)&&(u=!1,h=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:$,updateNodePositions:F,onNodeDragStop:H,onSelectionDragStop:I}=t();if(F(a,!1),i||H||!N&&I){const[q,Y]=Ex({nodeId:N,dragItems:a,nodeLookup:$,dragging:!1});i==null||i(R.sourceEvent,a,q,Y),H==null||H(R.sourceEvent,q,Y),N||I==null||I(R.sourceEvent,Y)}}}).filter(R=>{const $=R.target;return!R.button&&(!k||!yA($,`.${k}`,E))&&(!w||yA($,w,E))});p.call(j)}function x(){p==null||p.on(".drag",null)}return{update:y,destroy:x}}function Mpe(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())wd(i,Gl(o))>0&&r.push(o);return r}const Dpe=250;function Ope(e,t,n,r){var a,u;let i=[],o=1/0;const s=Mpe(e,n,t+Dpe);for(const c of s){const f=[...((a=c.internals.handleBounds)==null?void 0:a.source)??[],...((u=c.internals.handleBounds)==null?void 0:u.target)??[]];for(const h of f){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:p,y:m}=bd(c,h,h.position,!0),y=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));y>t||(y<o?(i=[{...h,x:p,y:m}],o=y):y===o&&i.push({...h,x:p,y:m}))}}if(!i.length)return null;if(i.length>1){const c=r.type==="source"?"target":"source";return i.find(f=>f.type===c)??i[0]}return i[0]}function x5(e,t,n,r,i,o=!1){var c,f,h;const s=r.get(e);if(!s)return null;const a=i==="strict"?(c=s.internals.handleBounds)==null?void 0:c[t]:[...((f=s.internals.handleBounds)==null?void 0:f.source)??[],...((h=s.internals.handleBounds)==null?void 0:h.target)??[]],u=(n?a==null?void 0:a.find(p=>p.id===n):a==null?void 0:a[0])??null;return u&&o?{...u,...bd(s,u,u.position,!0)}:u}function w5(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Ipe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const b5=()=>!0;function jpe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:a,nodeLookup:u,lib:c,autoPanOnConnect:f,flowId:h,panBy:p,cancelConnection:m,onConnectStart:y,onConnect:x,onConnectEnd:k,isValidConnection:w=b5,onReconnectEnd:E,updateConnection:C,getTransform:N,getFromHandle:P,autoPanSpeed:A}){const O=c5(e.target);let M=0,j;const{x:R,y:$}=yo(e),F=O==null?void 0:O.elementFromPoint(R,$),H=w5(o,F),I=a==null?void 0:a.getBoundingClientRect();if(!I||!H)return;const q=x5(i,H,r,u,t);if(!q)return;let Y=yo(e,I),Z=!1,B=null,W=!1,L=null;function U(){if(!f||!I)return;const[ue,he]=o5(Y,I,A);p({x:ue,y:he}),M=requestAnimationFrame(U)}const V={...q,nodeId:i,type:H,position:q.position},D=u.get(i),K={inProgress:!0,isValid:null,from:bd(D,V,We.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:D,to:Y,toHandle:null,toPosition:aA[V.position],toNode:null};C(K);let J=K;y==null||y(e,{nodeId:i,handleId:r,handleType:H});function ee(ue){if(!P()||!V){re(ue);return}const he=N();Y=yo(ue,I),j=Ope(rf(Y,he,!1,[1,1]),n,u,V),Z||(U(),Z=!0);const ke=k5(ue,{handle:j,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:w,doc:O,lib:c,flowId:h,nodeLookup:u});L=ke.handleDomNode,B=ke.connection,W=Ipe(!!j,ke.isValid);const fe={...J,isValid:W,to:j&&W?a5({x:j.x,y:j.y},he):Y,toHandle:ke.toHandle,toPosition:W&&ke.toHandle?ke.toHandle.position:aA[V.position],toNode:ke.toHandle?u.get(ke.toHandle.nodeId):null};W&&j&&J.toHandle&&fe.toHandle&&J.toHandle.type===fe.toHandle.type&&J.toHandle.nodeId===fe.toHandle.nodeId&&J.toHandle.id===fe.toHandle.id&&J.to.x===fe.to.x&&J.to.y===fe.to.y||(C(fe),J=fe)}function re(ue){(j||L)&&B&&W&&(x==null||x(B));const{inProgress:he,...ke}=J,fe={...ke,toPosition:J.toHandle?J.toPosition:null};k==null||k(ue,fe),o&&(E==null||E(ue,fe)),m(),cancelAnimationFrame(M),Z=!1,W=!1,B=null,L=null,O.removeEventListener("mousemove",ee),O.removeEventListener("mouseup",re),O.removeEventListener("touchmove",ee),O.removeEventListener("touchend",re)}O.addEventListener("mousemove",ee),O.addEventListener("mouseup",re),O.addEventListener("touchmove",ee),O.addEventListener("touchend",re)}function k5(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:a,flowId:u,isValidConnection:c=b5,nodeLookup:f}){const h=o==="target",p=t?s.querySelector(`.${a}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y}=yo(e),x=s.elementFromPoint(m,y),k=x!=null&&x.classList.contains(`${a}-flow__handle`)?x:p,w={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const E=w5(void 0,k),C=k.getAttribute("data-nodeid"),N=k.getAttribute("data-handleid"),P=k.classList.contains("connectable"),A=k.classList.contains("connectableend");if(!C||!E)return w;const O={source:h?C:r,sourceHandle:h?N:i,target:h?r:C,targetHandle:h?i:N};w.connection=O;const j=P&&A&&(n===Yl.Strict?h&&E==="source"||!h&&E==="target":C!==r||N!==i);w.isValid=j&&c(O),w.toHandle=x5(C,E,N,f,n,!1)}return w}const eb={onPointerDown:jpe,isValid:k5};function Lpe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Er(e);function o({translateExtent:a,width:u,height:c,zoomStep:f=10,pannable:h=!0,zoomable:p=!0,inversePan:m=!1}){const y=C=>{const N=n();if(C.sourceEvent.type!=="wheel"||!t)return;const P=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*f,A=N[2]*Math.pow(2,P);t.scaleTo(A)};let x=[0,0];const k=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(x=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},w=C=>{const N=n();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!t)return;const P=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],A=[P[0]-x[0],P[1]-x[1]];x=P;const O=r()*Math.max(N[2],Math.log(N[2]))*(m?-1:1),M={x:N[0]-A[0]*O,y:N[1]-A[1]*O},j=[[0,0],[u,c]];t.setViewportConstrained({x:M.x,y:M.y,zoom:N[2]},j,a)},E=X4().on("start",k).on("zoom",h?w:null).on("zoom.wheel",p?y:null);i.call(E,{})}function s(){i.on("zoom",null)}return{update:o,destroy:s,pointer:ii}}const Fpe=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,ig=e=>({x:e.x,y:e.y,zoom:e.k}),Cx=({x:e,y:t,zoom:n})=>Jm.translate(e,t).scale(n),yl=(e,t)=>e.target.closest(`.${t}`),S5=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),_x=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},E5=e=>{const t=e.ctrlKey&&Qp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function zpe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c}){return f=>{if(yl(f,t))return!1;f.preventDefault(),f.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(f.ctrlKey&&s){const k=ii(f),w=E5(f),E=h*Math.pow(2,w);r.scaleTo(n,E,k,f);return}const p=f.deltaMode===1?20:1;let m=i===sa.Vertical?0:f.deltaX*p,y=i===sa.Horizontal?0:f.deltaY*p;!Qp()&&f.shiftKey&&i!==sa.Vertical&&(m=f.deltaY*p,y=0),r.translateBy(n,-(m/h)*o,-(y/h)*o,{internal:!0});const x=ig(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a==null||a(f,x)),e.isPanScrolling&&(u==null||u(f,x),e.panScrollTimeout=setTimeout(()=>{c==null||c(f,x),e.isPanScrolling=!1},150))}}function $pe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){if(!t&&r.type==="wheel"&&!r.ctrlKey||yl(r,e))return null;r.preventDefault(),n.call(this,r,i)}}function Bpe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,s,a;if((o=r.sourceEvent)!=null&&o.internal)return;const i=ig(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function Vpe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var s,a;e.usedRightMouseButton=!!(n&&S5(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((a=o.sourceEvent)!=null&&a.internal)&&(i==null||i(o.sourceEvent,ig(o.transform)))}}function Wpe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,o&&S5(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&Fpe(e.prevViewport,s.transform))){const u=ig(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,u)},n?150:0)}}}function Upe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:a,noPanClassName:u,lib:c}){return f=>{var y;const h=e||t,p=n&&f.ctrlKey;if(f.button===1&&f.type==="mousedown"&&(yl(f,`${c}-flow__node`)||yl(f,`${c}-flow__edge`)))return!0;if(!r&&!h&&!i&&!o&&!n||s||yl(f,a)&&f.type==="wheel"||yl(f,u)&&(f.type!=="wheel"||i&&f.type==="wheel"&&!e)||!n&&f.ctrlKey&&f.type==="wheel")return!1;if(!n&&f.type==="touchstart"&&((y=f.touches)==null?void 0:y.length)>1)return f.preventDefault(),!1;if(!h&&!i&&!p&&f.type==="wheel"||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const m=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||f.type==="wheel")&&m}}function Hpe({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:o,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:u,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),p=X4().clickDistance(!li(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),m=Er(e).call(p);C({x:o.x,y:o.y,zoom:ql(o.zoom,t,n)},[[0,0],[h.width,h.height]],i);const y=m.on("wheel.zoom"),x=m.on("dblclick.zoom");p.wheelDelta(E5);function k(F,H){return m?new Promise(I=>{p==null||p.transform(_x(m,H==null?void 0:H.duration,()=>I(!0)),F)}):Promise.resolve(!1)}function w({noWheelClassName:F,noPanClassName:H,onPaneContextMenu:I,userSelectionActive:q,panOnScroll:Y,panOnDrag:Z,panOnScrollMode:B,panOnScrollSpeed:W,preventScrolling:L,zoomOnPinch:U,zoomOnScroll:V,zoomOnDoubleClick:D,zoomActivationKeyPressed:G,lib:K,onTransformChange:J}){q&&!f.isZoomingOrPanning&&E();const re=Y&&!G&&!q?zpe({zoomPanValues:f,noWheelClassName:F,d3Selection:m,d3Zoom:p,panOnScrollMode:B,panOnScrollSpeed:W,zoomOnPinch:U,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:u}):$pe({noWheelClassName:F,preventScrolling:L,d3ZoomHandler:y});if(m.on("wheel.zoom",re,{passive:!1}),!q){const he=Bpe({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:a});p.on("start",he);const ke=Vpe({zoomPanValues:f,panOnDrag:Z,onPaneContextMenu:!!I,onPanZoom:s,onTransformChange:J});p.on("zoom",ke);const fe=Wpe({zoomPanValues:f,panOnDrag:Z,panOnScroll:Y,onPaneContextMenu:I,onPanZoomEnd:u,onDraggingChange:c});p.on("end",fe)}const ue=Upe({zoomActivationKeyPressed:G,panOnDrag:Z,zoomOnScroll:V,panOnScroll:Y,zoomOnDoubleClick:D,zoomOnPinch:U,userSelectionActive:q,noPanClassName:H,noWheelClassName:F,lib:K});p.filter(ue),D?m.on("dblclick.zoom",x):m.on("dblclick.zoom",null)}function E(){p.on("zoom",null)}async function C(F,H,I){const q=Cx(F),Y=p==null?void 0:p.constrain()(q,H,I);return Y&&await k(Y),new Promise(Z=>Z(Y))}async function N(F,H){const I=Cx(F);return await k(I,H),new Promise(q=>q(I))}function P(F){if(m){const H=Cx(F),I=m.property("__zoom");(I.k!==F.zoom||I.x!==F.x||I.y!==F.y)&&(p==null||p.transform(m,H,null,{sync:!0}))}}function A(){const F=m?K4(m.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function O(F,H){return m?new Promise(I=>{p==null||p.scaleTo(_x(m,H==null?void 0:H.duration,()=>I(!0)),F)}):Promise.resolve(!1)}function M(F,H){return m?new Promise(I=>{p==null||p.scaleBy(_x(m,H==null?void 0:H.duration,()=>I(!0)),F)}):Promise.resolve(!1)}function j(F){p==null||p.scaleExtent(F)}function R(F){p==null||p.translateExtent(F)}function $(F){const H=!li(F)||F<0?0:F;p==null||p.clickDistance(H)}return{update:w,destroy:E,setViewport:N,setViewportConstrained:C,getViewport:A,scaleTo:O,scaleBy:M,setScaleExtent:j,setTranslateExtent:R,syncViewport:P,setClickDistance:$}}var Oc;(function(e){e.Line="line",e.Handle="handle"})(Oc||(Oc={}));function Ype({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const s=e-t,a=n-r,u=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&i&&(u[0]=u[0]*-1),a&&o&&(u[1]=u[1]*-1),u}function qpe(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function ns(e,t){return Math.max(0,t-e)}function rs(e,t){return Math.max(0,e-t)}function $h(e,t,n){return Math.max(0,t-e,e-n)}function vA(e,t){return e?!t:t}function Gpe(e,t,n,r,i,o,s,a){let{affectsX:u,affectsY:c}=t;const{isHorizontal:f,isVertical:h}=t,p=f&&h,{xSnapped:m,ySnapped:y}=n,{minWidth:x,maxWidth:k,minHeight:w,maxHeight:E}=r,{x:C,y:N,width:P,height:A,aspectRatio:O}=e;let M=Math.floor(f?m-e.pointerX:0),j=Math.floor(h?y-e.pointerY:0);const R=P+(u?-M:M),$=A+(c?-j:j),F=-o[0]*P,H=-o[1]*A;let I=$h(R,x,k),q=$h($,w,E);if(s){let B=0,W=0;u&&M<0?B=ns(C+M+F,s[0][0]):!u&&M>0&&(B=rs(C+R+F,s[1][0])),c&&j<0?W=ns(N+j+H,s[0][1]):!c&&j>0&&(W=rs(N+$+H,s[1][1])),I=Math.max(I,B),q=Math.max(q,W)}if(a){let B=0,W=0;u&&M>0?B=rs(C+M,a[0][0]):!u&&M<0&&(B=ns(C+R,a[1][0])),c&&j>0?W=rs(N+j,a[0][1]):!c&&j<0&&(W=ns(N+$,a[1][1])),I=Math.max(I,B),q=Math.max(q,W)}if(i){if(f){const B=$h(R/O,w,E)*O;if(I=Math.max(I,B),s){let W=0;!u&&!c||u&&!c&&p?W=rs(N+H+R/O,s[1][1])*O:W=ns(N+H+(u?M:-M)/O,s[0][1])*O,I=Math.max(I,W)}if(a){let W=0;!u&&!c||u&&!c&&p?W=ns(N+R/O,a[1][1])*O:W=rs(N+(u?M:-M)/O,a[0][1])*O,I=Math.max(I,W)}}if(h){const B=$h($*O,x,k)/O;if(q=Math.max(q,B),s){let W=0;!u&&!c||c&&!u&&p?W=rs(C+$*O+F,s[1][0])/O:W=ns(C+(c?j:-j)*O+F,s[0][0])/O,q=Math.max(q,W)}if(a){let W=0;!u&&!c||c&&!u&&p?W=ns(C+$*O,a[1][0])/O:W=rs(C+(c?j:-j)*O,a[0][0])/O,q=Math.max(q,W)}}}j=j+(j<0?q:-q),M=M+(M<0?I:-I),i&&(p?R>$*O?j=(vA(u,c)?-M:M)/O:M=(vA(u,c)?-j:j)*O:f?(j=M/O,c=u):(M=j*O,u=c));const Y=u?C+M:C,Z=c?N+j:N;return{width:P+(u?-M:M),height:A+(c?-j:j),x:o[0]*M*(u?-1:1)+Y,y:o[1]*j*(c?-1:1)+Z}}const C5={width:0,height:0,x:0,y:0},Zpe={...C5,pointerX:0,pointerY:0,aspectRatio:1};function Kpe(e){return[[0,0],[e.measured.width,e.measured.height]]}function Xpe(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,a=n[0]*o,u=n[1]*s;return[[r-a,i-u],[r+o-a,i+s-u]]}function Qpe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=Er(e);function s({controlPosition:u,boundaries:c,keepAspectRatio:f,onResizeStart:h,onResize:p,onResizeEnd:m,shouldResize:y}){let x={...C5},k={...Zpe};const w=qpe(u);let E,C=null,N=[],P,A,O;const M=j4().on("start",j=>{const{nodeLookup:R,transform:$,snapGrid:F,snapToGrid:H,nodeOrigin:I,paneDomNode:q}=n();if(E=R.get(t),!E)return;C=(q==null?void 0:q.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:Z}=Dc(j.sourceEvent,{transform:$,snapGrid:F,snapToGrid:H,containerBounds:C});x={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},k={...x,pointerX:Y,pointerY:Z,aspectRatio:x.width/x.height},P=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(P=R.get(E.parentId),A=P&&E.extent==="parent"?Kpe(P):void 0),N=[],O=void 0;for(const[B,W]of R)if(W.parentId===t&&(N.push({id:B,position:{...W.position},extent:W.extent}),W.extent==="parent"||W.expandParent)){const L=Xpe(W,E,W.origin??I);O?O=[[Math.min(L[0][0],O[0][0]),Math.min(L[0][1],O[0][1])],[Math.max(L[1][0],O[1][0]),Math.max(L[1][1],O[1][1])]]:O=L}h==null||h(j,{...x})}).on("drag",j=>{const{transform:R,snapGrid:$,snapToGrid:F,nodeOrigin:H}=n(),I=Dc(j.sourceEvent,{transform:R,snapGrid:$,snapToGrid:F,containerBounds:C}),q=[];if(!E)return;const{x:Y,y:Z,width:B,height:W}=x,L={},U=E.origin??H,{width:V,height:D,x:G,y:K}=Gpe(k,w,I,c,f,U,A,O),J=V!==B,ee=D!==W,re=G!==Y&&J,ue=K!==Z&ⅇif(!re&&!ue&&!J&&!ee)return;if((re||ue||U[0]===1||U[1]===1)&&(L.x=re?G:x.x,L.y=ue?K:x.y,x.x=L.x,x.y=L.y,N.length>0)){const ve=G-Y,Me=K-Z;for(const $e of N)$e.position={x:$e.position.x-ve+U[0]*(V-B),y:$e.position.y-Me+U[1]*(D-W)},q.push($e)}if((J||ee)&&(L.width=J?V:x.width,L.height=ee?D:x.height,x.width=L.width,x.height=L.height),P&&E.expandParent){const ve=U[0]*(L.width??0);L.x&&L.x<ve&&(x.x=ve,k.x=k.x-(L.x-ve));const Me=U[1]*(L.height??0);L.y&&L.y<Me&&(x.y=Me,k.y=k.y-(L.y-Me))}const he=Ype({width:x.width,prevWidth:B,height:x.height,prevHeight:W,affectsX:w.affectsX,affectsY:w.affectsY}),ke={...x,direction:he};(y==null?void 0:y(j,ke))!==!1&&(p==null||p(j,ke),r(L,q))}).on("end",j=>{m==null||m(j,{...x}),i==null||i()});o.call(M)}function a(){o.on(".drag",null)}return{update:s,destroy:a}}var Nx={exports:{}},Tx={},Ax={exports:{}},Px={};/**
|
|
368
|
+
* @license React
|
|
369
|
+
* use-sync-external-store-shim.production.min.js
|
|
370
|
+
*
|
|
371
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the MIT license found in the
|
|
374
|
+
* LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/var xA;function Jpe(){if(xA)return Px;xA=1;var e=Xl();function t(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(h,p){var m=p(),y=r({inst:{value:m,getSnapshot:p}}),x=y[0].inst,k=y[1];return o(function(){x.value=m,x.getSnapshot=p,u(x)&&k({inst:x})},[h,m,p]),i(function(){return u(x)&&k({inst:x}),h(function(){u(x)&&k({inst:x})})},[h]),s(m),m}function u(h){var p=h.getSnapshot;h=h.value;try{var m=p();return!n(h,m)}catch{return!0}}function c(h,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Px.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Px}var wA;function eme(){return wA||(wA=1,Ax.exports=Jpe()),Ax.exports}/**
|
|
376
|
+
* @license React
|
|
377
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
378
|
+
*
|
|
379
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the MIT license found in the
|
|
382
|
+
* LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/var bA;function tme(){if(bA)return Tx;bA=1;var e=Xl(),t=eme();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,u=e.useDebugValue;return Tx.useSyncExternalStoreWithSelector=function(c,f,h,p,m){var y=o(null);if(y.current===null){var x={hasValue:!1,value:null};y.current=x}else x=y.current;y=a(function(){function w(A){if(!E){if(E=!0,C=A,A=p(A),m!==void 0&&x.hasValue){var O=x.value;if(m(O,A))return N=O}return N=A}if(O=N,r(C,A))return O;var M=p(A);return m!==void 0&&m(O,M)?O:(C=A,N=M)}var E=!1,C,N,P=h===void 0?null:h;return[function(){return w(f())},P===null?void 0:function(){return w(P())}]},[f,h,p,m]);var k=i(c,y[0],y[1]);return s(function(){x.hasValue=!0,x.value=k},[k]),u(k),k},Tx}var kA;function nme(){return kA||(kA=1,Nx.exports=tme()),Nx.exports}var rme=nme();const ime=Kl(rme),ome={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},SA=e=>{let t;const n=new Set,r=(f,h)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const m=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,m))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>c,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(ome?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,i,u);return u},sme=e=>e?SA(e):SA,{useDebugValue:ame}=ne,{useSyncExternalStoreWithSelector:lme}=ime,ume=e=>e;function _5(e,t=ume,n){const r=lme(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ame(r),r}const EA=(e,t)=>{const n=sme(e),r=(i,o=t)=>_5(n,i,o);return Object.assign(r,n),r},cme=(e,t)=>e?EA(e,t):EA;function tn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const og=S.createContext(null),dme=og.Provider,N5=Po.error001();function bt(e,t){const n=S.useContext(og);if(n===null)throw new Error(N5);return _5(n,e,t)}function qt(){const e=S.useContext(og);if(e===null)throw new Error(N5);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const CA={display:"none"},fme={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},T5="react-flow__node-desc",A5="react-flow__edge-desc",hme="react-flow__aria-live",pme=e=>e.ariaLiveMessage;function mme({rfId:e}){const t=bt(pme);return v.jsx("div",{id:`${hme}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:fme,children:t})}function gme({rfId:e,disableKeyboardA11y:t}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{id:`${T5}-${e}`,style:CA,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),v.jsx("div",{id:`${A5}-${e}`,style:CA,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&v.jsx(mme,{rfId:e})]})}const yme=e=>e.userSelectionActive?"none":"all",Rk=S.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const s=bt(yme),a=`${e}`.split("-");return v.jsx("div",{className:gn(["react-flow__panel",n,...a]),style:{...r,pointerEvents:s},ref:o,...i,children:t})});function vme({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:v.jsx(Rk,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const xme=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Bh=e=>e.id;function wme(e,t){return tn(e.selectedNodes.map(Bh),t.selectedNodes.map(Bh))&&tn(e.selectedEdges.map(Bh),t.selectedEdges.map(Bh))}function bme({onSelectionChange:e}){const t=qt(),{selectedNodes:n,selectedEdges:r}=bt(xme,wme);return S.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const kme=e=>!!e.onSelectionChangeHandlers;function Sme({onSelectionChange:e}){const t=bt(kme);return e||t?v.jsx(bme,{onSelectionChange:e}):null}const P5=[0,0],Eme={x:0,y:0,zoom:1},Cme=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],_A=[...Cme,"rfId"],_me=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),NA={translateExtent:yd,nodeOrigin:P5,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Nme(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:u,setPaneClickDistance:c}=bt(_me,tn),f=qt();S.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=NA,a()}),[]);const h=S.useRef(NA);return S.useEffect(()=>{for(const p of _A){const m=e[p],y=h.current[p];m!==y&&(typeof e[p]>"u"||(p==="nodes"?t(m):p==="edges"?n(m):p==="minZoom"?r(m):p==="maxZoom"?i(m):p==="translateExtent"?o(m):p==="nodeExtent"?s(m):p==="paneClickDistance"?c(m):p==="fitView"?f.setState({fitViewOnInit:m}):p==="fitViewOptions"?f.setState({fitViewOnInitOptions:m}):f.setState({[p]:m})))}h.current=e},_A.map(p=>e[p])),null}function TA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Tme(e){var r;const[t,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const i=TA(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=TA())!=null&&r.matches?"dark":"light"}const AA=typeof document<"u"?document:null;function kd(e=null,t={target:AA,actInsideInputWithModifier:!0}){const[n,r]=S.useState(!1),i=S.useRef(!1),o=S.useRef(new Set([])),[s,a]=S.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
|
|
384
|
+
`).replace(`
|
|
385
|
+
|
|
386
|
+
`,`
|
|
387
|
+
+`).split(`
|
|
388
|
+
`)),f=c.reduce((h,p)=>h.concat(...p),[]);return[c,f]}return[[],[]]},[e]);return S.useEffect(()=>{const u=(t==null?void 0:t.target)||AA;if(e!==null){const c=p=>{if(i.current=p.ctrlKey||p.metaKey||p.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&Kw(p))return!1;const y=RA(p.code,a);o.current.add(p[y]),PA(s,o.current,!1)&&(p.preventDefault(),r(!0))},f=p=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&Kw(p))return!1;const y=RA(p.code,a);PA(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(p[y]),p.key==="Meta"&&o.current.clear(),i.current=!1},h=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",c),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{u==null||u.removeEventListener("keydown",c),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function PA(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function RA(e,t){return t.includes(e)?"code":"key"}const Ame=()=>{const e=qt();return S.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:i,panZoom:o,domNode:s}=e.getState();if(!o||!s)return Promise.resolve(!1);const a=qw(n,t),{width:u,height:c}=rg(s);return Gw({nodes:a,width:u,height:c,minZoom:r,maxZoom:i,panZoom:o},t)},setCenter:async(t,n,r)=>{const{width:i,height:o,maxZoom:s,panZoom:a}=e.getState(),u=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:s,c=i/2-t*u,f=o/2-n*u;return a?(await a.setViewport({x:c,y:f,zoom:u},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:s,panZoom:a}=e.getState(),u=_k(t,r,i,o,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(u,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:s,y:a}=o.getBoundingClientRect(),u={x:t.x-s,y:t.y-a};return rf(u,r,n.snapToGrid,i)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),s=a5(t,n);return{x:s.x+i,y:s.y+o}}}),[])};function R5(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const s=r.get(o.id);s?s.push(o):r.set(o.id,[o])}for(const o of t){const s=r.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...o};for(const u of s)Pme(u,a);n.push(a)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function Pme(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function M5(e,t){return R5(e,t)}function D5(e,t){return R5(e,t)}function Zs(e,t){return{id:e,type:"select",selected:t}}function vl(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const s=t.has(i);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),r.push(Zs(o.id,s)))}return r}function MA({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const a=t.get(s.id),u=((i=a==null?void 0:a.internals)==null?void 0:i.userNode)??a;u!==void 0&&u!==s&&n.push({id:s.id,item:s,type:"replace"}),u===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function DA(e){return{id:e.id,type:"remove"}}const OA=e=>lpe(e),Rme=e=>t5(e);function O5(e){return S.forwardRef(e)}const Mme=typeof window<"u"?S.useLayoutEffect:S.useEffect;function IA(e){const[t,n]=S.useState(BigInt(0)),[r]=S.useState(()=>Dme(()=>n(i=>i+BigInt(1))));return Mme(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function Dme(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const I5=S.createContext(null);function Ome({children:e}){const t=qt(),n=S.useCallback(a=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:f,onNodesChange:h,nodeLookup:p}=t.getState();let m=u;for(const y of a)m=typeof y=="function"?y(m):y;f?c(m):h&&h(MA({items:m,lookup:p}))},[]),r=IA(n),i=S.useCallback(a=>{const{edges:u=[],setEdges:c,hasDefaultEdges:f,onEdgesChange:h,edgeLookup:p}=t.getState();let m=u;for(const y of a)m=typeof y=="function"?y(m):y;f?c(m):h&&h(MA({items:m,lookup:p}))},[]),o=IA(i),s=S.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return v.jsx(I5.Provider,{value:s,children:e})}function Ime(){const e=S.useContext(I5);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const jme=e=>!!e.panZoom;function Mk(){const e=Ame(),t=qt(),n=Ime(),r=bt(jme),i=S.useMemo(()=>{const o=h=>t.getState().nodeLookup.get(h),s=h=>{n.nodeQueue.push(h)},a=h=>{n.edgeQueue.push(h)},u=h=>{var w,E;const{nodeLookup:p,nodeOrigin:m}=t.getState(),y=OA(h)?h:p.get(h.id),x=y.parentId?u5(y.position,y.measured,y.parentId,p,m):y.position,k={...y,position:x,width:((w=y.measured)==null?void 0:w.width)??y.width,height:((E=y.measured)==null?void 0:E.height)??y.height};return Gl(k)},c=(h,p,m={replace:!1})=>{s(y=>y.map(x=>{if(x.id===h){const k=typeof p=="function"?p(x):p;return m.replace&&OA(k)?k:{...x,...k}}return x}))},f=(h,p,m={replace:!1})=>{a(y=>y.map(x=>{if(x.id===h){const k=typeof p=="function"?p(x):p;return m.replace&&Rme(k)?k:{...x,...k}}return x}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var p;return(p=o(h))==null?void 0:p.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(p=>({...p}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:s,setEdges:a,addNodes:h=>{const p=Array.isArray(h)?h:[h];n.nodeQueue.push(m=>[...m,...p])},addEdges:h=>{const p=Array.isArray(h)?h:[h];n.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:h=[],edges:p=[],transform:m}=t.getState(),[y,x,k]=m;return{nodes:h.map(w=>({...w})),edges:p.map(w=>({...w})),viewport:{x:y,y:x,zoom:k}}},deleteElements:async({nodes:h=[],edges:p=[]})=>{const{nodes:m,edges:y,onNodesDelete:x,onEdgesDelete:k,triggerNodeChanges:w,triggerEdgeChanges:E,onDelete:C,onBeforeDelete:N}=t.getState(),{nodes:P,edges:A}=await dpe({nodesToRemove:h,edgesToRemove:p,nodes:m,edges:y,onBeforeDelete:N}),O=A.length>0,M=P.length>0;if(O){const j=A.map(DA);k==null||k(A),E(j)}if(M){const j=P.map(DA);x==null||x(P),w(j)}return(M||O)&&(C==null||C({nodes:P,edges:A})),{deletedNodes:P,deletedEdges:A}},getIntersectingNodes:(h,p=!0,m)=>{const y=uA(h),x=y?h:u(h),k=m!==void 0;return x?(m||t.getState().nodes).filter(w=>{const E=t.getState().nodeLookup.get(w.id);if(E&&!y&&(w.id===h.id||!E.internals.positionAbsolute))return!1;const C=Gl(k?w:E),N=wd(C,x);return p&&N>0||N>=x.width*x.height}):[]},isNodeIntersecting:(h,p,m=!0)=>{const x=uA(h)?h:u(h);if(!x)return!1;const k=wd(x,p);return m&&k>0||k>=x.width*x.height},updateNode:c,updateNodeData:(h,p,m={replace:!1})=>{c(h,y=>{const x=typeof p=="function"?p(y):p;return m.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},m)},updateEdge:f,updateEdgeData:(h,p,m={replace:!1})=>{f(h,y=>{const x=typeof p=="function"?p(y):p;return m.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},m)},getNodesBounds:h=>{const{nodeLookup:p,nodeOrigin:m}=t.getState();return upe(h,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:h,id:p,nodeId:m})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${m}-${h}-${p??null}`))==null?void 0:y.values())??[])}}},[]);return S.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const jA=e=>e.selected,Lme={actInsideInputWithModifier:!1},Fme=typeof window<"u"?window:void 0;function zme({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=qt(),{deleteElements:r}=Mk(),i=kd(e,Lme),o=kd(t,{target:Fme});S.useEffect(()=>{if(i){const{edges:s,nodes:a}=n.getState();r({nodes:a.filter(jA),edges:s.filter(jA)}),n.setState({nodesSelectionActive:!1})}},[i]),S.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function $me(e){const t=qt();S.useEffect(()=>{const n=()=>{var i,o;if(!e.current)return!1;const r=rg(e.current);(r.height===0||r.width===0)&&((o=(i=t.getState()).onError)==null||o.call(i,"004",Po.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const sg={position:"absolute",width:"100%",height:"100%",top:0,left:0},Bme=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function Vme({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=sa.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:f,maxZoom:h,zoomActivationKeyCode:p,preventScrolling:m=!0,children:y,noWheelClassName:x,noPanClassName:k,onViewportChange:w,isControlledViewport:E,paneClickDistance:C}){const N=qt(),P=S.useRef(null),{userSelectionActive:A,lib:O}=bt(Bme,tn),M=kd(p),j=S.useRef();$me(P);const R=S.useCallback($=>{w==null||w({x:$[0],y:$[1],zoom:$[2]}),E||N.setState({transform:$})},[w,E]);return S.useEffect(()=>{if(P.current){j.current=Hpe({domNode:P.current,minZoom:f,maxZoom:h,translateExtent:c,viewport:u,paneClickDistance:C,onDraggingChange:I=>N.setState({paneDragging:I}),onPanZoomStart:(I,q)=>{const{onViewportChangeStart:Y,onMoveStart:Z}=N.getState();Z==null||Z(I,q),Y==null||Y(q)},onPanZoom:(I,q)=>{const{onViewportChange:Y,onMove:Z}=N.getState();Z==null||Z(I,q),Y==null||Y(q)},onPanZoomEnd:(I,q)=>{const{onViewportChangeEnd:Y,onMoveEnd:Z}=N.getState();Z==null||Z(I,q),Y==null||Y(q)}});const{x:$,y:F,zoom:H}=j.current.getViewport();return N.setState({panZoom:j.current,transform:[$,F,H],domNode:P.current.closest(".react-flow")}),()=>{var I;(I=j.current)==null||I.destroy()}}},[]),S.useEffect(()=>{var $;($=j.current)==null||$.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:M,preventScrolling:m,noPanClassName:k,userSelectionActive:A,noWheelClassName:x,lib:O,onTransformChange:R})},[e,t,n,r,i,o,s,a,M,m,k,A,x,O,R]),v.jsx("div",{className:"react-flow__renderer",ref:P,style:sg,children:y})}const Wme=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ume(){const{userSelectionActive:e,userSelectionRect:t}=bt(Wme,tn);return e&&t?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Rx=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Hme=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function Yme({isSelecting:e,selectionKeyPressed:t,selectionMode:n=vd.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:s,onPaneClick:a,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:p,children:m}){const y=S.useRef(null),x=qt(),k=S.useRef(0),w=S.useRef(0),E=S.useRef(),C=S.useRef(new Map),{userSelectionActive:N,elementsSelectable:P,dragging:A}=bt(Hme,tn),O=P&&(e||N),M=S.useRef(!1),j=S.useRef(!1),R=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),k.current=0,w.current=0},$=B=>{if(M.current){M.current=!1;return}a==null||a(B),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},F=B=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){B.preventDefault();return}u==null||u(B)},H=c?B=>c(B):void 0,I=B=>{var G,K,J,ee;const{resetSelectedElements:W,domNode:L,edgeLookup:U}=x.getState();if(E.current=L==null?void 0:L.getBoundingClientRect(),!P||!e||B.button!==0||B.target!==y.current||!E.current)return;(K=(G=B.target)==null?void 0:G.setPointerCapture)==null||K.call(G,B.pointerId),j.current=!0,M.current=!1,C.current=new Map;for(const[re,ue]of U)C.current.set(ue.source,((J=C.current.get(ue.source))==null?void 0:J.add(re))||new Set([re])),C.current.set(ue.target,((ee=C.current.get(ue.target))==null?void 0:ee.add(re))||new Set([re]));const{x:V,y:D}=yo(B.nativeEvent,E.current);W(),x.setState({userSelectionRect:{width:0,height:0,startX:V,startY:D,x:V,y:D}}),o==null||o(B)},q=B=>{const{userSelectionRect:W,edgeLookup:L,transform:U,nodeLookup:V,triggerNodeChanges:D,triggerEdgeChanges:G}=x.getState();if(!E.current||!W)return;M.current=!0;const{x:K,y:J}=yo(B.nativeEvent,E.current),{startX:ee,startY:re}=W,ue={startX:ee,startY:re,x:K<ee?K:ee,y:J<re?J:re,width:Math.abs(K-ee),height:Math.abs(J-re)},he=n5(V,ue,U,n===vd.Partial,!0),ke=new Set,fe=new Set;for(const ve of he){fe.add(ve.id);const Me=C.current.get(ve.id);if(Me)for(const $e of Me)ke.add($e)}if(k.current!==fe.size){k.current=fe.size;const ve=vl(V,fe,!0);D(ve)}if(w.current!==ke.size){w.current=ke.size;const ve=vl(L,ke);G(ve)}x.setState({userSelectionRect:ue,userSelectionActive:!0,nodesSelectionActive:!1})},Y=B=>{var L,U;if(B.button!==0||!j.current)return;(U=(L=B.target)==null?void 0:L.releasePointerCapture)==null||U.call(L,B.pointerId);const{userSelectionRect:W}=x.getState();!N&&W&&B.target===y.current&&($==null||$(B)),k.current>0&&x.setState({nodesSelectionActive:!0}),R(),s==null||s(B),(t||i)&&(M.current=!1),j.current=!1},Z=r===!0||Array.isArray(r)&&r.includes(0);return v.jsxs("div",{className:gn(["react-flow__pane",{draggable:Z,dragging:A,selection:e}]),onClick:O?void 0:Rx($,y),onContextMenu:Rx(F,y),onWheel:Rx(H,y),onPointerEnter:O?void 0:f,onPointerDown:O?I:h,onPointerMove:O?q:h,onPointerUp:O?Y:void 0,onPointerLeave:p,ref:y,style:sg,children:[m,v.jsx(Ume,{})]})}function tb({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:a,onError:u}=t.getState(),c=a.get(e);if(!c){u==null||u("012",Po.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):i([e])}function j5({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:s}){const a=qt(),[u,c]=S.useState(!1),f=S.useRef();return S.useEffect(()=>{f.current=Rpe({getStoreItems:()=>a.getState(),onNodeMouseDown:h=>{tb({id:h,store:a,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),S.useEffect(()=>{var h,p;if(t)(h=f.current)==null||h.destroy();else if(e.current)return(p=f.current)==null||p.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:s}),()=>{var m;(m=f.current)==null||m.destroy()}},[n,r,t,o,e,i]),u}const qme=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function L5(){const e=qt();return S.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:s,onError:a,updateNodePositions:u,nodeLookup:c,nodeOrigin:f}=e.getState(),h=new Map,p=qme(s),m=i?o[0]:5,y=i?o[1]:5,x=n.direction.x*m*n.factor,k=n.direction.y*y*n.factor;for(const[,w]of c){if(!p(w))continue;let E={x:w.internals.positionAbsolute.x+x,y:w.internals.positionAbsolute.y+k};i&&(E=ng(E,o));const{position:C,positionAbsolute:N}=r5({nodeId:w.id,nextPosition:E,nodeLookup:c,nodeExtent:r,nodeOrigin:f,onError:a});w.position=C,w.internals.positionAbsolute=N,h.set(w.id,w)}u(h)},[])}const Dk=S.createContext(null),Gme=Dk.Provider;Dk.Consumer;const F5=()=>S.useContext(Dk),Zme=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Kme=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:s}=r,{fromHandle:a,toHandle:u,isValid:c}=s,f=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:f,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===Yl.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,valid:f&&c}};function Xme({type:e="source",position:t=We.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:u,className:c,onMouseDown:f,onTouchStart:h,...p},m){var I,q;const y=s||null,x=e==="target",k=qt(),w=F5(),{connectOnClick:E,noPanClassName:C,rfId:N}=bt(Zme,tn),{connectingFrom:P,connectingTo:A,clickConnecting:O,isPossibleEndHandle:M,connectionInProcess:j,valid:R}=bt(Kme(w,y,e),tn);w||(q=(I=k.getState()).onError)==null||q.call(I,"010",Po.error010());const $=Y=>{const{defaultEdgeOptions:Z,onConnect:B,hasDefaultEdges:W}=k.getState(),L={...Z,...Y};if(W){const{edges:U,setEdges:V}=k.getState();V(vpe(L,U))}B==null||B(L),a==null||a(L)},F=Y=>{if(!w)return;const Z=d5(Y.nativeEvent);if(i&&(Z&&Y.button===0||!Z)){const B=k.getState();eb.onPointerDown(Y.nativeEvent,{autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:x,handleId:y,nodeId:w,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:B.onConnectEnd,updateConnection:B.updateConnection,onConnect:$,isValidConnection:n||B.isValidConnection,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed})}Z?f==null||f(Y):h==null||h(Y)},H=Y=>{const{onClickConnectStart:Z,onClickConnectEnd:B,connectionClickStartHandle:W,connectionMode:L,isValidConnection:U,lib:V,rfId:D,nodeLookup:G,connection:K}=k.getState();if(!w||!W&&!i)return;if(!W){Z==null||Z(Y.nativeEvent,{nodeId:w,handleId:y,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:w,type:e,id:y}});return}const J=c5(Y.target),ee=n||U,{connection:re,isValid:ue}=eb.isValid(Y.nativeEvent,{handle:{nodeId:w,id:y,type:e},connectionMode:L,fromNodeId:W.nodeId,fromHandleId:W.id||null,fromType:W.type,isValidConnection:ee,flowId:D,doc:J,lib:V,nodeLookup:G});ue&&re&&$(re);const he=structuredClone(K);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,B==null||B(Y,he),k.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":y,"data-nodeid":w,"data-handlepos":t,"data-id":`${N}-${w}-${y}-${e}`,className:gn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,c,{source:!x,target:x,connectable:r,connectablestart:i,connectableend:o,clickconnecting:O,connectingfrom:P,connectingto:A,valid:R,connectionindicator:r&&(!j||M)&&(j?o:i)}]),onMouseDown:F,onTouchStart:F,onClick:E?H:void 0,ref:m,...p,children:u})}const bs=S.memo(O5(Xme));function Qme({data:e,isConnectable:t,sourcePosition:n=We.Bottom}){return v.jsxs(v.Fragment,{children:[e==null?void 0:e.label,v.jsx(bs,{type:"source",position:n,isConnectable:t})]})}function Jme({data:e,isConnectable:t,targetPosition:n=We.Top,sourcePosition:r=We.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(bs,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,v.jsx(bs,{type:"source",position:r,isConnectable:t})]})}function ege(){return null}function tge({data:e,isConnectable:t,targetPosition:n=We.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(bs,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Jp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},LA={input:Qme,default:Jme,output:tge,group:ege};function nge(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const rge=e=>{const{width:t,height:n,x:r,y:i}=nf(e.nodeLookup,{filter:o=>!!o.selected});return{width:li(t)?t:null,height:li(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function ige({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=qt(),{width:i,height:o,transformString:s,userSelectionActive:a}=bt(rge,tn),u=L5(),c=S.useRef(null);if(S.useEffect(()=>{var p;n||(p=c.current)==null||p.focus({preventScroll:!0})},[n]),j5({nodeRef:c}),a||!i||!o)return null;const f=e?p=>{const m=r.getState().nodes.filter(y=>y.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Jp,p.key)&&(p.preventDefault(),u({direction:Jp[p.key],factor:p.shiftKey?4:1}))};return v.jsx("div",{className:gn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:v.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:o}})})}const FA=typeof window<"u"?window:void 0,oge=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function z5({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:k,elementsSelectable:w,zoomOnScroll:E,zoomOnPinch:C,panOnScroll:N,panOnScrollSpeed:P,panOnScrollMode:A,zoomOnDoubleClick:O,panOnDrag:M,defaultViewport:j,translateExtent:R,minZoom:$,maxZoom:F,preventScrolling:H,onSelectionContextMenu:I,noWheelClassName:q,noPanClassName:Y,disableKeyboardA11y:Z,onViewportChange:B,isControlledViewport:W}){const{nodesSelectionActive:L,userSelectionActive:U}=bt(oge),V=kd(c,{target:FA}),D=kd(x,{target:FA}),G=D||M,K=D||N,J=f&&G!==!0,ee=V||U||J;return zme({deleteKeyCode:u,multiSelectionKeyCode:y}),v.jsx(Vme,{onPaneContextMenu:o,elementsSelectable:w,zoomOnScroll:E,zoomOnPinch:C,panOnScroll:K,panOnScrollSpeed:P,panOnScrollMode:A,zoomOnDoubleClick:O,panOnDrag:!V&&G,defaultViewport:j,translateExtent:R,minZoom:$,maxZoom:F,zoomActivationKeyCode:k,preventScrolling:H,noWheelClassName:q,noPanClassName:Y,onViewportChange:B,isControlledViewport:W,paneClickDistance:a,children:v.jsxs(Yme,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:G,isSelecting:!!ee,selectionMode:h,selectionKeyPressed:V,selectionOnDrag:J,children:[e,L&&v.jsx(ige,{onSelectionContextMenu:I,noPanClassName:Y,disableKeyboardA11y:Z})]})})}z5.displayName="FlowRenderer";const sge=S.memo(z5),age=e=>t=>e?n5(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function lge(e){return bt(S.useCallback(age(e),[e]),tn)}const uge=e=>e.updateNodeInternals;function cge(){const e=bt(uge),[t]=S.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return S.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function dge({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=qt(),o=S.useRef(null),s=S.useRef(null),a=S.useRef(e.sourcePosition),u=S.useRef(e.targetPosition),c=S.useRef(t),f=n&&!!e.internals.handleBounds;return S.useEffect(()=>{o.current&&!e.hidden&&(!f||s.current!==o.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(o.current),s.current=o.current)},[f,e.hidden]),S.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),S.useEffect(()=>{if(o.current){const h=c.current!==t,p=a.current!==e.sourcePosition,m=u.current!==e.targetPosition;(h||p||m)&&(c.current=t,a.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function fge({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:s,nodesDraggable:a,elementsSelectable:u,nodesConnectable:c,nodesFocusable:f,resizeObserver:h,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:y,rfId:x,nodeTypes:k,nodeExtent:w,nodeClickDistance:E,onError:C}){const{node:N,internals:P,isParent:A}=bt(re=>{const ue=re.nodeLookup.get(e),he=re.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:he}},tn);let O=N.type||"default",M=(k==null?void 0:k[O])||LA[O];M===void 0&&(C==null||C("003",Po.error003(O)),O="default",M=LA.default);const j=!!(N.draggable||a&&typeof N.draggable>"u"),R=!!(N.selectable||u&&typeof N.selectable>"u"),$=!!(N.connectable||c&&typeof N.connectable>"u"),F=!!(N.focusable||f&&typeof N.focusable>"u"),H=qt(),I=l5(N),q=dge({node:N,nodeType:O,hasDimensions:I,resizeObserver:h}),Y=j5({nodeRef:q,disabled:N.hidden||!j,noDragClassName:p,handleSelector:N.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:E}),Z=L5();if(N.hidden)return null;const B=Ro(N),W=nge(N),L=R||j||t||n||r||i,U=n?re=>n(re,{...P.userNode}):void 0,V=r?re=>r(re,{...P.userNode}):void 0,D=i?re=>i(re,{...P.userNode}):void 0,G=o?re=>o(re,{...P.userNode}):void 0,K=s?re=>s(re,{...P.userNode}):void 0,J=re=>{const{selectNodesOnDrag:ue,nodeDragThreshold:he}=H.getState();R&&(!ue||!j||he>0)&&tb({id:e,store:H,nodeRef:q}),t&&t(re,{...P.userNode})},ee=re=>{if(!(Kw(re.nativeEvent)||y))if(Q4.includes(re.key)&&R){const ue=re.key==="Escape";tb({id:e,store:H,unselect:ue,nodeRef:q})}else j&&N.selected&&Object.prototype.hasOwnProperty.call(Jp,re.key)&&(re.preventDefault(),H.setState({ariaLiveMessage:`Moved selected node ${re.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~P.positionAbsolute.x}, y: ${~~P.positionAbsolute.y}`}),Z({direction:Jp[re.key],factor:re.shiftKey?4:1}))};return v.jsx("div",{className:gn(["react-flow__node",`react-flow__node-${O}`,{[m]:j},N.className,{selected:N.selected,selectable:R,parent:A,draggable:j,dragging:Y}]),ref:q,style:{zIndex:P.z,transform:`translate(${P.positionAbsolute.x}px,${P.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:I?"visible":"hidden",...N.style,...W},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:U,onMouseMove:V,onMouseLeave:D,onContextMenu:G,onClick:J,onDoubleClick:K,onKeyDown:F?ee:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":y?void 0:`${T5}-${x}`,"aria-label":N.ariaLabel,children:v.jsx(Gme,{value:e,children:v.jsx(M,{id:e,data:N.data,type:O,positionAbsoluteX:P.positionAbsolute.x,positionAbsoluteY:P.positionAbsolute.y,selected:N.selected,selectable:R,draggable:j,deletable:N.deletable??!0,isConnectable:$,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:Y,dragHandle:N.dragHandle,zIndex:P.z,parentId:N.parentId,...B})})})}const hge=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function $5(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=bt(hge,tn),s=lge(e.onlyRenderVisibleElements),a=cge();return v.jsx("div",{className:"react-flow__nodes",style:sg,children:s.map(u=>v.jsx(fge,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}$5.displayName="NodeRenderer";const pge=S.memo($5);function mge(e){return bt(S.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const o=n.nodeLookup.get(i.source),s=n.nodeLookup.get(i.target);o&&s&&mpe({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),tn)}const gge=({color:e="none",strokeWidth:t=1})=>v.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),yge=({color:e="none",strokeWidth:t=1})=>v.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),zA={[xd.Arrow]:gge,[xd.ArrowClosed]:yge};function vge(e){const t=qt();return S.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(zA,e)?zA[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Po.error009(e)),null)},[e])}const xge=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const u=vge(t);return u?v.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:v.jsx(u,{color:n,strokeWidth:s})}):null},B5=({defaultColor:e,rfId:t})=>{const n=bt(o=>o.edges),r=bt(o=>o.defaultEdgeOptions),i=S.useMemo(()=>Spe(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?v.jsx("svg",{className:"react-flow__marker",children:v.jsx("defs",{children:i.map(o=>v.jsx(xge,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};B5.displayName="MarkerDefinitions";var wge=S.memo(B5);function V5({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:u,className:c,...f}){const[h,p]=S.useState({x:1,y:0,width:0,height:0}),m=gn(["react-flow__edge-textwrapper",c]),y=S.useRef(null);return S.useEffect(()=>{if(y.current){const x=y.current.getBBox();p({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),typeof n>"u"||!n?null:v.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:m,visibility:h.width?"visible":"hidden",...f,children:[i&&v.jsx("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),v.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:y,style:r,children:n}),u]})}V5.displayName="EdgeText";const bge=S.memo(V5);function ag({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,interactionWidth:c=20,...f}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...f,d:e,fill:"none",className:gn(["react-flow__edge-path",f.className])}),c&&v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}),r&&li(t)&&li(n)?v.jsx(bge,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u}):null]})}function $A({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===We.Left||e===We.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function W5({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:r,targetY:i,targetPosition:o=We.Top}){const[s,a]=$A({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,c]=$A({pos:o,x1:r,y1:i,x2:e,y2:t}),[f,h,p,m]=f5({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${a} ${u},${c} ${r},${i}`,f,h,p,m]}function U5(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=We.Bottom,targetPosition:a=We.Top,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:k,interactionWidth:w})=>{const[E,C,N]=W5({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:a}),P=e.isInternal?void 0:t;return v.jsx(ag,{id:P,path:E,labelX:C,labelY:N,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:k,interactionWidth:w})})}const kge=U5({isInternal:!1}),H5=U5({isInternal:!0});kge.displayName="SimpleBezierEdge";H5.displayName="SimpleBezierEdgeInternal";function Y5(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:p,sourcePosition:m=We.Bottom,targetPosition:y=We.Top,markerEnd:x,markerStart:k,pathOptions:w,interactionWidth:E})=>{const[C,N,P]=Xw({sourceX:n,sourceY:r,sourcePosition:m,targetX:i,targetY:o,targetPosition:y,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset}),A=e.isInternal?void 0:t;return v.jsx(ag,{id:A,path:C,labelX:N,labelY:P,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:x,markerStart:k,interactionWidth:E})})}const q5=Y5({isInternal:!1}),G5=Y5({isInternal:!0});q5.displayName="SmoothStepEdge";G5.displayName="SmoothStepEdgeInternal";function Z5(e){return S.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return v.jsx(q5,{...n,id:r,pathOptions:S.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Sge=Z5({isInternal:!1}),K5=Z5({isInternal:!0});Sge.displayName="StepEdge";K5.displayName="StepEdgeInternal";function X5(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})=>{const[k,w,E]=m5({sourceX:n,sourceY:r,targetX:i,targetY:o}),C=e.isInternal?void 0:t;return v.jsx(ag,{id:C,path:k,labelX:w,labelY:E,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})})}const Ege=X5({isInternal:!1}),Q5=X5({isInternal:!0});Ege.displayName="StraightEdge";Q5.displayName="StraightEdgeInternal";function J5(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=We.Bottom,targetPosition:a=We.Top,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:k,pathOptions:w,interactionWidth:E})=>{const[C,N,P]=h5({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:a,curvature:w==null?void 0:w.curvature}),A=e.isInternal?void 0:t;return v.jsx(ag,{id:A,path:C,labelX:N,labelY:P,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:k,interactionWidth:E})})}const Cge=J5({isInternal:!1}),e3=J5({isInternal:!0});Cge.displayName="BezierEdge";e3.displayName="BezierEdgeInternal";const BA={default:e3,straight:Q5,step:K5,smoothstep:G5,simplebezier:H5},VA={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},_ge=(e,t,n)=>n===We.Left?e-t:n===We.Right?e+t:e,Nge=(e,t,n)=>n===We.Top?e-t:n===We.Bottom?e+t:e,WA="react-flow__edgeupdater";function UA({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a}){return v.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:gn([WA,`${WA}-${a}`]),cx:_ge(t,r,e),cy:Nge(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Tge({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:s,sourcePosition:a,targetPosition:u,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,setReconnecting:p,setUpdateHover:m}){const y=qt(),x=(N,P)=>{if(N.button!==0)return;const{autoPanOnConnect:A,domNode:O,isValidConnection:M,connectionMode:j,connectionRadius:R,lib:$,onConnectStart:F,onConnectEnd:H,cancelConnection:I,nodeLookup:q,rfId:Y,panBy:Z,updateConnection:B}=y.getState(),W=P.type==="target";p(!0),f==null||f(N,n,P.type);const L=(V,D)=>{p(!1),h==null||h(V,n,P.type,D)},U=V=>c==null?void 0:c(n,V);eb.onPointerDown(N.nativeEvent,{autoPanOnConnect:A,connectionMode:j,connectionRadius:R,domNode:O,handleId:P.id,nodeId:P.nodeId,nodeLookup:q,isTarget:W,edgeUpdaterType:P.type,lib:$,flowId:Y,cancelConnection:I,panBy:Z,isValidConnection:M,onConnect:U,onConnectStart:F,onConnectEnd:H,onReconnectEnd:L,updateConnection:B,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle})},k=N=>x(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=N=>x(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>m(!0),C=()=>m(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(UA,{position:a,centerX:r,centerY:i,radius:t,onMouseDown:k,onMouseEnter:E,onMouseOut:C,type:"source"}),(e===!0||e==="target")&&v.jsx(UA,{position:u,centerX:o,centerY:s,radius:t,onMouseDown:w,onMouseEnter:E,onMouseOut:C,type:"target"})]})}function Age({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:s,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,reconnectRadius:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:m,rfId:y,edgeTypes:x,noPanClassName:k,onError:w,disableKeyboardA11y:E}){let C=bt(fe=>fe.edgeLookup.get(e));const N=bt(fe=>fe.defaultEdgeOptions);C=N?{...N,...C}:C;let P=C.type||"default",A=(x==null?void 0:x[P])||BA[P];A===void 0&&(w==null||w("011",Po.error011(P)),P="default",A=BA.default);const O=!!(C.focusable||t&&typeof C.focusable>"u"),M=typeof h<"u"&&(C.reconnectable||n&&typeof C.reconnectable>"u"),j=!!(C.selectable||r&&typeof C.selectable>"u"),R=S.useRef(null),[$,F]=S.useState(!1),[H,I]=S.useState(!1),q=qt(),{zIndex:Y,sourceX:Z,sourceY:B,targetX:W,targetY:L,sourcePosition:U,targetPosition:V}=bt(S.useCallback(fe=>{const ve=fe.nodeLookup.get(C.source),Me=fe.nodeLookup.get(C.target);if(!ve||!Me)return{zIndex:C.zIndex,...VA};const $e=kpe({id:e,sourceNode:ve,targetNode:Me,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:fe.connectionMode,onError:w});return{zIndex:ppe({selected:C.selected,zIndex:C.zIndex,sourceNode:ve,targetNode:Me,elevateOnSelect:fe.elevateEdgesOnSelect}),...$e||VA}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),tn),D=S.useMemo(()=>C.markerStart?`url('#${Qw(C.markerStart,y)}')`:void 0,[C.markerStart,y]),G=S.useMemo(()=>C.markerEnd?`url('#${Qw(C.markerEnd,y)}')`:void 0,[C.markerEnd,y]);if(C.hidden||Z===null||B===null||W===null||L===null)return null;const K=fe=>{var ct;const{addSelectedEdges:ve,unselectNodesAndEdges:Me,multiSelectionActive:$e}=q.getState();j&&(q.setState({nodesSelectionActive:!1}),C.selected&&$e?(Me({nodes:[],edges:[C]}),(ct=R.current)==null||ct.blur()):ve([e])),i&&i(fe,C)},J=o?fe=>{o(fe,{...C})}:void 0,ee=s?fe=>{s(fe,{...C})}:void 0,re=a?fe=>{a(fe,{...C})}:void 0,ue=u?fe=>{u(fe,{...C})}:void 0,he=c?fe=>{c(fe,{...C})}:void 0,ke=fe=>{var ve;if(!E&&Q4.includes(fe.key)&&j){const{unselectNodesAndEdges:Me,addSelectedEdges:$e}=q.getState();fe.key==="Escape"?((ve=R.current)==null||ve.blur(),Me({edges:[C]})):$e([e])}};return v.jsx("svg",{style:{zIndex:Y},children:v.jsxs("g",{className:gn(["react-flow__edge",`react-flow__edge-${P}`,C.className,k,{selected:C.selected,animated:C.animated,inactive:!j&&!i,updating:$,selectable:j}]),onClick:K,onDoubleClick:J,onContextMenu:ee,onMouseEnter:re,onMouseMove:ue,onMouseLeave:he,onKeyDown:O?ke:void 0,tabIndex:O?0:void 0,role:O?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":O?`${A5}-${y}`:void 0,ref:R,children:[!H&&v.jsx(A,{id:e,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:j,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:Z,sourceY:B,targetX:W,targetY:L,sourcePosition:U,targetPosition:V,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:D,markerEnd:G,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),M&&v.jsx(Tge,{edge:C,isReconnectable:M,reconnectRadius:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:m,sourceX:Z,sourceY:B,targetX:W,targetY:L,sourcePosition:U,targetPosition:V,setUpdateHover:F,setReconnecting:I})]})})}const Pge=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function t3({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:f,reconnectRadius:h,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:y,disableKeyboardA11y:x}){const{edgesFocusable:k,edgesReconnectable:w,elementsSelectable:E,onError:C}=bt(Pge,tn),N=mge(t);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(wge,{defaultColor:e,rfId:n}),N.map(P=>v.jsx(Age,{id:P,edgesFocusable:k,edgesReconnectable:w,elementsSelectable:E,noPanClassName:i,onReconnect:o,onContextMenu:s,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:f,reconnectRadius:h,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:y,rfId:n,onError:C,edgeTypes:r,disableKeyboardA11y:x},P))]})}t3.displayName="EdgeRenderer";const Rge=S.memo(t3),Mge=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Dge({children:e}){const t=bt(Mge);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Oge(e){const t=Mk(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Ige=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function jge(e){const t=bt(Ige),n=qt();return S.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Lge(e){return e.connection.inProgress?{...e.connection,to:rf(e.connection.to,e.transform)}:{...e.connection}}function Fge(e){return Lge}function zge(e){const t=Fge();return bt(t,tn)}const $ge=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Bge({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:s,isValid:a,inProgress:u}=bt($ge,tn);return!(o&&i&&u)?null:v.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:gn(["react-flow__connection",e5(a)]),children:v.jsx(n3,{style:t,type:n,CustomComponent:r,isValid:a})})})}const n3=({style:e,type:t=ls.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:s,fromHandle:a,fromPosition:u,to:c,toNode:f,toHandle:h,toPosition:p}=zge();if(!i)return;if(n)return v.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:p,connectionStatus:e5(r),toNode:f,toHandle:h});let m="";const y={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:p};switch(t){case ls.Bezier:[m]=h5(y);break;case ls.SimpleBezier:[m]=W5(y);break;case ls.Step:[m]=Xw({...y,borderRadius:0});break;case ls.SmoothStep:[m]=Xw(y);break;default:[m]=m5(y)}return v.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};n3.displayName="ConnectionLine";const Vge={};function HA(e=Vge){S.useRef(e),qt(),S.useEffect(()=>{},[e])}function Wge(){qt(),S.useRef(!1),S.useEffect(()=>{},[])}function r3({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:f,onSelectionContextMenu:h,onSelectionStart:p,onSelectionEnd:m,connectionLineType:y,connectionLineStyle:x,connectionLineComponent:k,connectionLineContainerStyle:w,selectionKeyCode:E,selectionOnDrag:C,selectionMode:N,multiSelectionKeyCode:P,panActivationKeyCode:A,zoomActivationKeyCode:O,deleteKeyCode:M,onlyRenderVisibleElements:j,elementsSelectable:R,defaultViewport:$,translateExtent:F,minZoom:H,maxZoom:I,preventScrolling:q,defaultMarkerColor:Y,zoomOnScroll:Z,zoomOnPinch:B,panOnScroll:W,panOnScrollSpeed:L,panOnScrollMode:U,zoomOnDoubleClick:V,panOnDrag:D,onPaneClick:G,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:ee,onPaneScroll:re,onPaneContextMenu:ue,paneClickDistance:he,nodeClickDistance:ke,onEdgeContextMenu:fe,onEdgeMouseEnter:ve,onEdgeMouseMove:Me,onEdgeMouseLeave:$e,reconnectRadius:ct,onReconnect:_t,onReconnectStart:Q,onReconnectEnd:oe,noDragClassName:ae,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:me,nodeExtent:Ae,rfId:Fe,viewport:ce,onViewportChange:pe}){return HA(e),HA(t),Wge(),Oge(n),jge(ce),v.jsx(sge,{onPaneClick:G,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:ee,onPaneContextMenu:ue,onPaneScroll:re,paneClickDistance:he,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:C,selectionMode:N,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:P,panActivationKeyCode:A,zoomActivationKeyCode:O,elementsSelectable:R,zoomOnScroll:Z,zoomOnPinch:B,zoomOnDoubleClick:V,panOnScroll:W,panOnScrollSpeed:L,panOnScrollMode:U,panOnDrag:D,defaultViewport:$,translateExtent:F,minZoom:H,maxZoom:I,onSelectionContextMenu:h,preventScrolling:q,noDragClassName:ae,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:me,onViewportChange:pe,isControlledViewport:!!ce,children:v.jsxs(Dge,{children:[v.jsx(Rge,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:_t,onReconnectStart:Q,onReconnectEnd:oe,onlyRenderVisibleElements:j,onEdgeContextMenu:fe,onEdgeMouseEnter:ve,onEdgeMouseMove:Me,onEdgeMouseLeave:$e,reconnectRadius:ct,defaultMarkerColor:Y,noPanClassName:we,disableKeyboardA11y:me,rfId:Fe}),v.jsx(Bge,{style:x,type:y,component:k,containerStyle:w}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(pge,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:f,nodeClickDistance:ke,onlyRenderVisibleElements:j,noPanClassName:we,noDragClassName:ae,disableKeyboardA11y:me,nodeExtent:Ae,rfId:Fe}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}r3.displayName="GraphView";const Uge=S.memo(r3),YA=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:a,nodeExtent:u}={})=>{const c=new Map,f=new Map,h=new Map,p=new Map,m=r??t??[],y=n??e??[],x=a??[0,0],k=u??yd;y5(h,p,m),Jw(y,c,f,{nodeOrigin:x,nodeExtent:k,elevateNodesOnSelect:!1});let w=[0,0,1];if(s&&i&&o){const E=nf(c,{filter:A=>!!((A.width||A.initialWidth)&&(A.height||A.initialHeight))}),{x:C,y:N,zoom:P}=_k(E,i,o,.5,2,.1);w=[C,N,P]}return{rfId:"1",width:0,height:0,transform:w,nodes:y,nodeLookup:c,parentLookup:f,edges:m,edgeLookup:p,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:yd,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Yl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...J4},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:fpe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},Hge=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:a,nodeExtent:u})=>cme((c,f)=>({...YA({nodes:e,edges:t,width:i,height:o,fitView:s,nodeOrigin:a,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:h=>{const{nodeLookup:p,parentLookup:m,nodeOrigin:y,elevateNodesOnSelect:x}=f();Jw(h,p,m,{nodeOrigin:y,nodeExtent:u,elevateNodesOnSelect:x,checkEquality:!0}),c({nodes:h})},setEdges:h=>{const{connectionLookup:p,edgeLookup:m}=f();y5(p,m,h),c({edges:h})},setDefaultNodesAndEdges:(h,p)=>{if(h){const{setNodes:m}=f();m(h),c({hasDefaultNodes:!0})}if(p){const{setEdges:m}=f();m(p),c({hasDefaultEdges:!0})}},updateNodeInternals:(h,p={triggerFitView:!0})=>{const{triggerNodeChanges:m,nodeLookup:y,parentLookup:x,fitViewOnInit:k,fitViewDone:w,fitViewOnInitOptions:E,domNode:C,nodeOrigin:N,nodeExtent:P,debug:A,fitViewSync:O}=f(),{changes:M,updatedInternals:j}=Tpe(h,y,x,C,N,P);if(j){if(Cpe(y,x,{nodeOrigin:N,nodeExtent:P}),p.triggerFitView){let R=w;!w&&k&&(R=O({...E,nodes:E==null?void 0:E.nodes})),c({fitViewDone:R})}else c({});(M==null?void 0:M.length)>0&&(A&&console.log("React Flow: trigger node changes",M),m==null||m(M))}},updateNodePositions:(h,p=!1)=>{const m=[],y=[];for(const[x,k]of h){const w=!!(k!=null&&k.expandParent&&(k!=null&&k.parentId)&&(k!=null&&k.position)),E={id:x,type:"position",position:w?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:p};w&&m.push({id:x,parentId:k.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width,height:k.measured.height}}),y.push(E)}if(m.length>0){const{nodeLookup:x,parentLookup:k,nodeOrigin:w}=f(),E=Pk(m,x,k,w);y.push(...E)}f().triggerNodeChanges(y)},triggerNodeChanges:h=>{const{onNodesChange:p,setNodes:m,nodes:y,hasDefaultNodes:x,debug:k}=f();if(h!=null&&h.length){if(x){const w=M5(h,y);m(w)}k&&console.log("React Flow: trigger node changes",h),p==null||p(h)}},triggerEdgeChanges:h=>{const{onEdgesChange:p,setEdges:m,edges:y,hasDefaultEdges:x,debug:k}=f();if(h!=null&&h.length){if(x){const w=D5(h,y);m(w)}k&&console.log("React Flow: trigger edge changes",h),p==null||p(h)}},addSelectedNodes:h=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:k}=f();if(p){const w=h.map(E=>Zs(E,!0));x(w);return}x(vl(y,new Set([...h]),!0)),k(vl(m))},addSelectedEdges:h=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:k}=f();if(p){const w=h.map(E=>Zs(E,!0));k(w);return}k(vl(m,new Set([...h]))),x(vl(y,new Set,!0))},unselectNodesAndEdges:({nodes:h,edges:p}={})=>{const{edges:m,nodes:y,nodeLookup:x,triggerNodeChanges:k,triggerEdgeChanges:w}=f(),E=h||y,C=p||m,N=E.map(A=>{const O=x.get(A.id);return O&&(O.selected=!1),Zs(A.id,!1)}),P=C.map(A=>Zs(A.id,!1));k(N),w(P)},setMinZoom:h=>{const{panZoom:p,maxZoom:m}=f();p==null||p.setScaleExtent([h,m]),c({minZoom:h})},setMaxZoom:h=>{const{panZoom:p,minZoom:m}=f();p==null||p.setScaleExtent([m,h]),c({maxZoom:h})},setTranslateExtent:h=>{var p;(p=f().panZoom)==null||p.setTranslateExtent(h),c({translateExtent:h})},setPaneClickDistance:h=>{var p;(p=f().panZoom)==null||p.setClickDistance(h)},resetSelectedElements:()=>{const{edges:h,nodes:p,triggerNodeChanges:m,triggerEdgeChanges:y}=f(),x=p.reduce((w,E)=>E.selected?[...w,Zs(E.id,!1)]:w,[]),k=h.reduce((w,E)=>E.selected?[...w,Zs(E.id,!1)]:w,[]);m(x),y(k)},setNodeExtent:h=>{const{nodes:p,nodeLookup:m,parentLookup:y,nodeOrigin:x,elevateNodesOnSelect:k,nodeExtent:w}=f();h[0][0]===w[0][0]&&h[0][1]===w[0][1]&&h[1][0]===w[1][0]&&h[1][1]===w[1][1]||(Jw(p,m,y,{nodeOrigin:x,nodeExtent:h,elevateNodesOnSelect:k,checkEquality:!1}),c({nodeExtent:h}))},panBy:h=>{const{transform:p,width:m,height:y,panZoom:x,translateExtent:k}=f();return Ape({delta:h,panZoom:x,transform:p,translateExtent:k,width:m,height:y})},fitView:h=>{const{panZoom:p,width:m,height:y,minZoom:x,maxZoom:k,nodeLookup:w}=f();if(!p)return Promise.resolve(!1);const E=qw(w,h);return Gw({nodes:E,width:m,height:y,panZoom:p,minZoom:x,maxZoom:k},h)},fitViewSync:h=>{const{panZoom:p,width:m,height:y,minZoom:x,maxZoom:k,nodeLookup:w}=f();if(!p)return!1;const E=qw(w,h);return Gw({nodes:E,width:m,height:y,panZoom:p,minZoom:x,maxZoom:k},h),E.size>0},cancelConnection:()=>{c({connection:{...J4}})},updateConnection:h=>{c({connection:h})},reset:()=>c({...YA()})}),Object.is);function Yge({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,fitView:s,nodeOrigin:a,nodeExtent:u,children:c}){const[f]=S.useState(()=>Hge({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:a,nodeExtent:u}));return v.jsx(dme,{value:f,children:v.jsx(Ome,{children:c})})}function qge({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:s,fitView:a,nodeOrigin:u,nodeExtent:c}){return S.useContext(og)?v.jsx(v.Fragment,{children:e}):v.jsx(Yge,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:s,fitView:a,nodeOrigin:u,nodeExtent:c,children:e})}const Gge={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Zge({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:s,onNodeClick:a,onEdgeClick:u,onInit:c,onMove:f,onMoveStart:h,onMoveEnd:p,onConnect:m,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:w,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:N,onNodeContextMenu:P,onNodeDoubleClick:A,onNodeDragStart:O,onNodeDrag:M,onNodeDragStop:j,onNodesDelete:R,onEdgesDelete:$,onDelete:F,onSelectionChange:H,onSelectionDragStart:I,onSelectionDrag:q,onSelectionDragStop:Y,onSelectionContextMenu:Z,onSelectionStart:B,onSelectionEnd:W,onBeforeDelete:L,connectionMode:U,connectionLineType:V=ls.Bezier,connectionLineStyle:D,connectionLineComponent:G,connectionLineContainerStyle:K,deleteKeyCode:J="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:re=!1,selectionMode:ue=vd.Full,panActivationKeyCode:he="Space",multiSelectionKeyCode:ke=Qp()?"Meta":"Control",zoomActivationKeyCode:fe=Qp()?"Meta":"Control",snapToGrid:ve,snapGrid:Me,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:ct,nodesDraggable:_t,nodesConnectable:Q,nodesFocusable:oe,nodeOrigin:ae=P5,edgesFocusable:Ce,edgesReconnectable:we,elementsSelectable:me=!0,defaultViewport:Ae=Eme,minZoom:Fe=.5,maxZoom:ce=2,translateExtent:pe=yd,preventScrolling:Ie=!0,nodeExtent:Ke,defaultMarkerColor:tt="#b1b1b7",zoomOnScroll:At=!0,zoomOnPinch:He=!0,panOnScroll:it=!1,panOnScrollSpeed:at=.5,panOnScrollMode:Wt=sa.Free,zoomOnDoubleClick:yt=!0,panOnDrag:yn=!0,onPaneClick:gt,onPaneMouseEnter:Lt,onPaneMouseMove:ft,onPaneMouseLeave:Ye,onPaneScroll:dt,onPaneContextMenu:Ct,paneClickDistance:nn=0,nodeClickDistance:vn=0,children:Yi,onReconnect:Sa,onReconnectStart:fu,onReconnectEnd:of,onEdgeContextMenu:As,onEdgeDoubleClick:hu,onEdgeMouseEnter:Ps,onEdgeMouseMove:lg,onEdgeMouseLeave:Rs,reconnectRadius:Ea=10,onNodesChange:Ca,onEdgesChange:pu,noDragClassName:ug="nodrag",noWheelClassName:cg="nowheel",noPanClassName:sf="nopan",fitView:vi,fitViewOptions:af,connectOnClick:lf,attributionPosition:dg,proOptions:uf,defaultEdgeOptions:cf,elevateNodesOnSelect:df,elevateEdgesOnSelect:ff,disableKeyboardA11y:hf=!1,autoPanOnConnect:fg,autoPanOnNodeDrag:Gt,autoPanSpeed:hg,connectionRadius:mu,isValidConnection:pf,onError:_a,style:pg,id:gu,nodeDragThreshold:Na,viewport:Dr,onViewportChange:mg,width:pr,height:gg,colorMode:yg="light",debug:vg,...Ta},Aa){const qi=gu||"1",Pa=Tme(yg);return v.jsx("div",{"data-testid":"rf__wrapper",...Ta,style:{...pg,...Gge},ref:Aa,className:gn(["react-flow",i,Pa]),id:gu,children:v.jsxs(qge,{nodes:e,edges:t,width:pr,height:gg,fitView:vi,nodeOrigin:ae,nodeExtent:Ke,children:[v.jsx(Uge,{onInit:c,onNodeClick:a,onEdgeClick:u,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:N,onNodeContextMenu:P,onNodeDoubleClick:A,nodeTypes:o,edgeTypes:s,connectionLineType:V,connectionLineStyle:D,connectionLineComponent:G,connectionLineContainerStyle:K,selectionKeyCode:ee,selectionOnDrag:re,selectionMode:ue,deleteKeyCode:J,multiSelectionKeyCode:ke,panActivationKeyCode:he,zoomActivationKeyCode:fe,onlyRenderVisibleElements:$e,defaultViewport:Ae,translateExtent:pe,minZoom:Fe,maxZoom:ce,preventScrolling:Ie,zoomOnScroll:At,zoomOnPinch:He,zoomOnDoubleClick:yt,panOnScroll:it,panOnScrollSpeed:at,panOnScrollMode:Wt,panOnDrag:yn,onPaneClick:gt,onPaneMouseEnter:Lt,onPaneMouseMove:ft,onPaneMouseLeave:Ye,onPaneScroll:dt,onPaneContextMenu:Ct,paneClickDistance:nn,nodeClickDistance:vn,onSelectionContextMenu:Z,onSelectionStart:B,onSelectionEnd:W,onReconnect:Sa,onReconnectStart:fu,onReconnectEnd:of,onEdgeContextMenu:As,onEdgeDoubleClick:hu,onEdgeMouseEnter:Ps,onEdgeMouseMove:lg,onEdgeMouseLeave:Rs,reconnectRadius:Ea,defaultMarkerColor:tt,noDragClassName:ug,noWheelClassName:cg,noPanClassName:sf,rfId:qi,disableKeyboardA11y:hf,nodeExtent:Ke,viewport:Dr,onViewportChange:mg}),v.jsx(Nme,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:w,nodesDraggable:_t,nodesConnectable:Q,nodesFocusable:oe,edgesFocusable:Ce,edgesReconnectable:we,elementsSelectable:me,elevateNodesOnSelect:df,elevateEdgesOnSelect:ff,minZoom:Fe,maxZoom:ce,nodeExtent:Ke,onNodesChange:Ca,onEdgesChange:pu,snapToGrid:ve,snapGrid:Me,connectionMode:U,translateExtent:pe,connectOnClick:lf,defaultEdgeOptions:cf,fitView:vi,fitViewOptions:af,onNodesDelete:R,onEdgesDelete:$,onDelete:F,onNodeDragStart:O,onNodeDrag:M,onNodeDragStop:j,onSelectionDrag:q,onSelectionDragStart:I,onSelectionDragStop:Y,onMove:f,onMoveStart:h,onMoveEnd:p,noPanClassName:sf,nodeOrigin:ae,rfId:qi,autoPanOnConnect:fg,autoPanOnNodeDrag:Gt,autoPanSpeed:hg,onError:_a,connectionRadius:mu,isValidConnection:pf,selectNodesOnDrag:ct,nodeDragThreshold:Na,onBeforeDelete:L,paneClickDistance:nn,debug:vg}),v.jsx(Sme,{onSelectionChange:H}),Yi,v.jsx(vme,{proOptions:uf,position:dg}),v.jsx(gme,{rfId:qi,disableKeyboardA11y:hf})]})})}var Kge=O5(Zge);function Xge(e){const[t,n]=S.useState(e),r=S.useCallback(i=>n(o=>M5(i,o)),[]);return[t,n,r]}function Qge(e){const[t,n]=S.useState(e),r=S.useCallback(i=>n(o=>D5(i,o)),[]);return[t,n,r]}function Jge({dimensions:e,lineWidth:t,variant:n,className:r}){return v.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:gn(["react-flow__background-pattern",n,r])})}function eye({radius:e,className:t}){return v.jsx("circle",{cx:e,cy:e,r:e,className:gn(["react-flow__background-pattern","dots",t])})}var vo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(vo||(vo={}));const tye={[vo.Dots]:1,[vo.Lines]:1,[vo.Cross]:6},nye=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function i3({id:e,variant:t=vo.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:s,bgColor:a,style:u,className:c,patternClassName:f}){const h=S.useRef(null),{transform:p,patternId:m}=bt(nye,tn),y=r||tye[t],x=t===vo.Dots,k=t===vo.Cross,w=Array.isArray(n)?n:[n,n],E=[w[0]*p[2]||1,w[1]*p[2]||1],C=y*p[2],N=Array.isArray(o)?o:[o,o],P=k?[C,C]:E,A=[N[0]*p[2]||1+P[0]/2,N[1]*p[2]||1+P[1]/2],O=`${m}${e||""}`;return v.jsxs("svg",{className:gn(["react-flow__background",c]),style:{...u,...sg,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:h,"data-testid":"rf__background",children:[v.jsx("pattern",{id:O,x:p[0]%E[0],y:p[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:x?v.jsx(eye,{radius:C/2,className:f}):v.jsx(Jge,{dimensions:P,lineWidth:i,variant:t,className:f})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}i3.displayName="Background";const rye=S.memo(i3);function iye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function oye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function sye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function aye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function lye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Vh({children:e,className:t,...n}){return v.jsx("button",{type:"button",className:gn(["react-flow__controls-button",t]),...n,children:e})}const uye=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function o3({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:a,onInteractiveChange:u,className:c,children:f,position:h="bottom-left",orientation:p="vertical","aria-label":m="React Flow controls"}){const y=qt(),{isInteractive:x,minZoomReached:k,maxZoomReached:w}=bt(uye,tn),{zoomIn:E,zoomOut:C,fitView:N}=Mk(),P=()=>{E(),o==null||o()},A=()=>{C(),s==null||s()},O=()=>{N(i),a==null||a()},M=()=>{y.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u==null||u(!x)},j=p==="horizontal"?"horizontal":"vertical";return v.jsxs(Rk,{className:gn(["react-flow__controls",j,c]),position:h,style:e,"data-testid":"rf__controls","aria-label":m,children:[t&&v.jsxs(v.Fragment,{children:[v.jsx(Vh,{onClick:P,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:w,children:v.jsx(iye,{})}),v.jsx(Vh,{onClick:A,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:k,children:v.jsx(oye,{})})]}),n&&v.jsx(Vh,{className:"react-flow__controls-fitview",onClick:O,title:"fit view","aria-label":"fit view",children:v.jsx(sye,{})}),r&&v.jsx(Vh,{className:"react-flow__controls-interactive",onClick:M,title:"toggle interactivity","aria-label":"toggle interactivity",children:x?v.jsx(lye,{}):v.jsx(aye,{})}),f]})}o3.displayName="Controls";const cye=S.memo(o3);function dye({id:e,x:t,y:n,width:r,height:i,style:o,color:s,strokeColor:a,strokeWidth:u,className:c,borderRadius:f,shapeRendering:h,selected:p,onClick:m}){const{background:y,backgroundColor:x}=o||{},k=s||y||x;return v.jsx("rect",{className:gn(["react-flow__minimap-node",{selected:p},c]),x:t,y:n,rx:f,ry:f,width:r,height:i,style:{fill:k,stroke:a,strokeWidth:u},shapeRendering:h,onClick:m?w=>m(w,e):void 0})}const fye=S.memo(dye),hye=e=>e.nodes.map(t=>t.id),Mx=e=>e instanceof Function?e:()=>e;function pye({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=fye,onClick:s}){const a=bt(hye,tn),u=Mx(t),c=Mx(e),f=Mx(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:a.map(p=>v.jsx(gye,{id:p,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:s,shapeRendering:h},p))})}function mye({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:a,onClick:u}){const{node:c,x:f,y:h,width:p,height:m}=bt(y=>{const x=y.nodeLookup.get(e),{x:k,y:w}=x.internals.positionAbsolute,{width:E,height:C}=Ro(x);return{node:x,x:k,y:w,width:E,height:C}},tn);return!c||c.hidden||!l5(c)?null:v.jsx(a,{x:f,y:h,width:p,height:m,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:i,strokeColor:n(c),strokeWidth:o,shapeRendering:s,onClick:u,id:c.id})}const gye=S.memo(mye);var yye=S.memo(pye);const vye=200,xye=150,wye=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?s5(nf(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},bye="react-flow__minimap-desc";function s3({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:u,maskColor:c,maskStrokeColor:f,maskStrokeWidth:h,position:p="bottom-right",onClick:m,onNodeClick:y,pannable:x=!1,zoomable:k=!1,ariaLabel:w="React Flow mini map",inversePan:E,zoomStep:C=10,offsetScale:N=5}){const P=qt(),A=S.useRef(null),{boundingRect:O,viewBB:M,rfId:j,panZoom:R,translateExtent:$,flowWidth:F,flowHeight:H}=bt(wye,tn),I=(e==null?void 0:e.width)??vye,q=(e==null?void 0:e.height)??xye,Y=O.width/I,Z=O.height/q,B=Math.max(Y,Z),W=B*I,L=B*q,U=N*B,V=O.x-(W-O.width)/2-U,D=O.y-(L-O.height)/2-U,G=W+U*2,K=L+U*2,J=`${bye}-${j}`,ee=S.useRef(0),re=S.useRef();ee.current=B,S.useEffect(()=>{if(A.current&&R)return re.current=Lpe({domNode:A.current,panZoom:R,getTransform:()=>P.getState().transform,getViewScale:()=>ee.current}),()=>{var ke;(ke=re.current)==null||ke.destroy()}},[R]),S.useEffect(()=>{var ke;(ke=re.current)==null||ke.update({translateExtent:$,width:F,height:H,inversePan:E,pannable:x,zoomStep:C,zoomable:k})},[x,k,E,C,$,F,H]);const ue=m?ke=>{var Me;const[fe,ve]=((Me=re.current)==null?void 0:Me.pointer(ke))||[0,0];m(ke,{x:fe,y:ve})}:void 0,he=y?S.useCallback((ke,fe)=>{const ve=P.getState().nodeLookup.get(fe);y(ke,ve)},[]):void 0;return v.jsx(Rk,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*B:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="string"?s:void 0},className:gn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:I,height:q,viewBox:`${V} ${D} ${G} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":J,ref:A,onClick:ue,children:[w&&v.jsx("title",{id:J,children:w}),v.jsx(yye,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:a}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-U},${D-U}h${G+U*2}v${K+U*2}h${-G-U*2}z
|
|
389
|
+
M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}s3.displayName="MiniMap";const kye=S.memo(s3);function Sye({nodeId:e,position:t,variant:n=Oc.Handle,className:r,style:i={},children:o,color:s,minWidth:a=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:h=!1,shouldResize:p,onResizeStart:m,onResize:y,onResizeEnd:x}){const k=F5(),w=typeof e=="string"?e:k,E=qt(),C=S.useRef(null),N=n===Oc.Line?"right":"bottom-right",P=t??N,A=S.useRef(null);S.useEffect(()=>{if(!(!C.current||!w))return A.current||(A.current=Qpe({domNode:C.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:R,transform:$,snapGrid:F,snapToGrid:H,nodeOrigin:I,domNode:q}=E.getState();return{nodeLookup:R,transform:$,snapGrid:F,snapToGrid:H,nodeOrigin:I,paneDomNode:q}},onChange:(R,$)=>{const{triggerNodeChanges:F,nodeLookup:H,parentLookup:I,nodeOrigin:q}=E.getState(),Y=[],Z={x:R.x,y:R.y},B=H.get(w);if(B&&B.expandParent&&B.parentId){const W=B.origin??q,L=R.width??B.measured.width,U=R.height??B.measured.height,V={id:B.id,parentId:B.parentId,rect:{width:L,height:U,...u5({x:R.x??B.position.x,y:R.y??B.position.y},{width:L,height:U},B.parentId,H,W)}},D=Pk([V],H,I,q);Y.push(...D),Z.x=R.x?Math.max(W[0]*L,R.x):void 0,Z.y=R.y?Math.max(W[1]*U,R.y):void 0}if(Z.x!==void 0&&Z.y!==void 0){const W={id:w,type:"position",position:{...Z}};Y.push(W)}if(R.width!==void 0&&R.height!==void 0){const W={id:w,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:R.width,height:R.height}};Y.push(W)}for(const W of $){const L={...W,type:"position"};Y.push(L)}F(Y)},onEnd:()=>{const R={id:w,type:"dimensions",resizing:!1};E.getState().triggerNodeChanges([R])}})),A.current.update({controlPosition:P,boundaries:{minWidth:a,minHeight:u,maxWidth:c,maxHeight:f},keepAspectRatio:h,onResizeStart:m,onResize:y,onResizeEnd:x,shouldResize:p}),()=>{var R;(R=A.current)==null||R.destroy()}},[P,a,u,c,f,h,m,y,x,p]);const O=P.split("-"),M=n===Oc.Line?"borderColor":"backgroundColor",j=s?{...i,[M]:s}:i;return v.jsx("div",{className:gn(["react-flow__resize-control","nodrag",...O,n,r]),ref:C,style:j,children:o})}S.memo(Sye);var Dx,qA;function Ok(){if(qA)return Dx;qA=1;var e="\0",t="\0",n="";class r{constructor(f){un(this,"_isDirected",!0);un(this,"_isMultigraph",!1);un(this,"_isCompound",!1);un(this,"_label");un(this,"_defaultNodeLabelFn",()=>{});un(this,"_defaultEdgeLabelFn",()=>{});un(this,"_nodes",{});un(this,"_in",{});un(this,"_preds",{});un(this,"_out",{});un(this,"_sucs",{});un(this,"_edgeObjs",{});un(this,"_edgeLabels",{});un(this,"_nodeCount",0);un(this,"_edgeCount",0);un(this,"_parent");un(this,"_children");f&&(this._isDirected=Object.hasOwn(f,"directed")?f.directed:!0,this._isMultigraph=Object.hasOwn(f,"multigraph")?f.multigraph:!1,this._isCompound=Object.hasOwn(f,"compound")?f.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(f){return this._label=f,this}graph(){return this._label}setDefaultNodeLabel(f){return this._defaultNodeLabelFn=f,typeof f!="function"&&(this._defaultNodeLabelFn=()=>f),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var f=this;return this.nodes().filter(h=>Object.keys(f._in[h]).length===0)}sinks(){var f=this;return this.nodes().filter(h=>Object.keys(f._out[h]).length===0)}setNodes(f,h){var p=arguments,m=this;return f.forEach(function(y){p.length>1?m.setNode(y,h):m.setNode(y)}),this}setNode(f,h){return Object.hasOwn(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=h),this):(this._nodes[f]=arguments.length>1?h:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]=t,this._children[f]={},this._children[t][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)}node(f){return this._nodes[f]}hasNode(f){return Object.hasOwn(this._nodes,f)}removeNode(f){var h=this;if(Object.hasOwn(this._nodes,f)){var p=m=>h.removeEdge(h._edgeObjs[m]);delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],this.children(f).forEach(function(m){h.setParent(m)}),delete this._children[f]),Object.keys(this._in[f]).forEach(p),delete this._in[f],delete this._preds[f],Object.keys(this._out[f]).forEach(p),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this}setParent(f,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(h===void 0)h=t;else{h+="";for(var p=h;p!==void 0;p=this.parent(p))if(p===f)throw new Error("Setting "+h+" as parent of "+f+" would create a cycle");this.setNode(h)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=h,this._children[h][f]=!0,this}_removeFromParentsChildList(f){delete this._children[this._parent[f]][f]}parent(f){if(this._isCompound){var h=this._parent[f];if(h!==t)return h}}children(f=t){if(this._isCompound){var h=this._children[f];if(h)return Object.keys(h)}else{if(f===t)return this.nodes();if(this.hasNode(f))return[]}}predecessors(f){var h=this._preds[f];if(h)return Object.keys(h)}successors(f){var h=this._sucs[f];if(h)return Object.keys(h)}neighbors(f){var h=this.predecessors(f);if(h){const m=new Set(h);for(var p of this.successors(f))m.add(p);return Array.from(m.values())}}isLeaf(f){var h;return this.isDirected()?h=this.successors(f):h=this.neighbors(f),h.length===0}filterNodes(f){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var p=this;Object.entries(this._nodes).forEach(function([x,k]){f(x)&&h.setNode(x,k)}),Object.values(this._edgeObjs).forEach(function(x){h.hasNode(x.v)&&h.hasNode(x.w)&&h.setEdge(x,p.edge(x))});var m={};function y(x){var k=p.parent(x);return k===void 0||h.hasNode(k)?(m[x]=k,k):k in m?m[k]:y(k)}return this._isCompound&&h.nodes().forEach(x=>h.setParent(x,y(x))),h}setDefaultEdgeLabel(f){return this._defaultEdgeLabelFn=f,typeof f!="function"&&(this._defaultEdgeLabelFn=()=>f),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(f,h){var p=this,m=arguments;return f.reduce(function(y,x){return m.length>1?p.setEdge(y,x,h):p.setEdge(y,x),x}),this}setEdge(){var f,h,p,m,y=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(f=x.v,h=x.w,p=x.name,arguments.length===2&&(m=arguments[1],y=!0)):(f=x,h=arguments[1],p=arguments[3],arguments.length>2&&(m=arguments[2],y=!0)),f=""+f,h=""+h,p!==void 0&&(p=""+p);var k=s(this._isDirected,f,h,p);if(Object.hasOwn(this._edgeLabels,k))return y&&(this._edgeLabels[k]=m),this;if(p!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(h),this._edgeLabels[k]=y?m:this._defaultEdgeLabelFn(f,h,p);var w=a(this._isDirected,f,h,p);return f=w.v,h=w.w,Object.freeze(w),this._edgeObjs[k]=w,i(this._preds[h],f),i(this._sucs[f],h),this._in[h][k]=w,this._out[f][k]=w,this._edgeCount++,this}edge(f,h,p){var m=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,f,h,p);return this._edgeLabels[m]}edgeAsObj(){const f=this.edge(...arguments);return typeof f!="object"?{label:f}:f}hasEdge(f,h,p){var m=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,f,h,p);return Object.hasOwn(this._edgeLabels,m)}removeEdge(f,h,p){var m=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,f,h,p),y=this._edgeObjs[m];return y&&(f=y.v,h=y.w,delete this._edgeLabels[m],delete this._edgeObjs[m],o(this._preds[h],f),o(this._sucs[f],h),delete this._in[h][m],delete this._out[f][m],this._edgeCount--),this}inEdges(f,h){var p=this._in[f];if(p){var m=Object.values(p);return h?m.filter(y=>y.v===h):m}}outEdges(f,h){var p=this._out[f];if(p){var m=Object.values(p);return h?m.filter(y=>y.w===h):m}}nodeEdges(f,h){var p=this.inEdges(f,h);if(p)return p.concat(this.outEdges(f,h))}}function i(c,f){c[f]?c[f]++:c[f]=1}function o(c,f){--c[f]||delete c[f]}function s(c,f,h,p){var m=""+f,y=""+h;if(!c&&m>y){var x=m;m=y,y=x}return m+n+y+n+(p===void 0?e:p)}function a(c,f,h,p){var m=""+f,y=""+h;if(!c&&m>y){var x=m;m=y,y=x}var k={v:m,w:y};return p&&(k.name=p),k}function u(c,f){return s(c,f.v,f.w,f.name)}return Dx=r,Dx}var Ox,GA;function Eye(){return GA||(GA=1,Ox="2.2.4"),Ox}var Ix,ZA;function Cye(){return ZA||(ZA=1,Ix={Graph:Ok(),version:Eye()}),Ix}var jx,KA;function _ye(){if(KA)return jx;KA=1;var e=Ok();jx={write:t,read:i};function t(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:r(o)};return o.graph()!==void 0&&(s.value=structuredClone(o.graph())),s}function n(o){return o.nodes().map(function(s){var a=o.node(s),u=o.parent(s),c={v:s};return a!==void 0&&(c.value=a),u!==void 0&&(c.parent=u),c})}function r(o){return o.edges().map(function(s){var a=o.edge(s),u={v:s.v,w:s.w};return s.name!==void 0&&(u.name=s.name),a!==void 0&&(u.value=a),u})}function i(o){var s=new e(o.options).setGraph(o.value);return o.nodes.forEach(function(a){s.setNode(a.v,a.value),a.parent&&s.setParent(a.v,a.parent)}),o.edges.forEach(function(a){s.setEdge({v:a.v,w:a.w,name:a.name},a.value)}),s}return jx}var Lx,XA;function Nye(){if(XA)return Lx;XA=1,Lx=e;function e(t){var n={},r=[],i;function o(s){Object.hasOwn(n,s)||(n[s]=!0,i.push(s),t.successors(s).forEach(o),t.predecessors(s).forEach(o))}return t.nodes().forEach(function(s){i=[],o(s),i.length&&r.push(i)}),r}return Lx}var Fx,QA;function a3(){if(QA)return Fx;QA=1;class e{constructor(){un(this,"_arr",[]);un(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var i=this._keyIndices;if(n=String(n),!Object.hasOwn(i,n)){var o=this._arr,s=o.length;return i[n]=s,o.push({key:n,priority:r}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var i=this._keyIndices[n];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)}_heapify(n){var r=this._arr,i=2*n,o=i+1,s=n;i<r.length&&(s=r[i].priority<r[s].priority?i:s,o<r.length&&(s=r[o].priority<r[s].priority?o:s),s!==n&&(this._swap(n,s),this._heapify(s)))}_decrease(n){for(var r=this._arr,i=r[n].priority,o;n!==0&&(o=n>>1,!(r[o].priority<i));)this._swap(n,o),n=o}_swap(n,r){var i=this._arr,o=this._keyIndices,s=i[n],a=i[r];i[n]=a,i[r]=s,o[a.key]=n,o[s.key]=r}}return Fx=e,Fx}var zx,JA;function l3(){if(JA)return zx;JA=1;var e=a3();zx=n;var t=()=>1;function n(i,o,s,a){return r(i,String(o),s||t,a||function(u){return i.outEdges(u)})}function r(i,o,s,a){var u={},c=new e,f,h,p=function(m){var y=m.v!==f?m.v:m.w,x=u[y],k=s(m),w=h.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+m+" Weight: "+k);w<x.distance&&(x.distance=w,x.predecessor=f,c.decrease(y,w))};for(i.nodes().forEach(function(m){var y=m===o?0:Number.POSITIVE_INFINITY;u[m]={distance:y},c.add(m,y)});c.size()>0&&(f=c.removeMin(),h=u[f],h.distance!==Number.POSITIVE_INFINITY);)a(f).forEach(p);return u}return zx}var $x,eP;function Tye(){if(eP)return $x;eP=1;var e=l3();$x=t;function t(n,r,i){return n.nodes().reduce(function(o,s){return o[s]=e(n,s,r,i),o},{})}return $x}var Bx,tP;function u3(){if(tP)return Bx;tP=1,Bx=e;function e(t){var n=0,r=[],i={},o=[];function s(a){var u=i[a]={onStack:!0,lowlink:n,index:n++};if(r.push(a),t.successors(a).forEach(function(h){Object.hasOwn(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(s(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var c=[],f;do f=r.pop(),i[f].onStack=!1,c.push(f);while(a!==f);o.push(c)}}return t.nodes().forEach(function(a){Object.hasOwn(i,a)||s(a)}),o}return Bx}var Vx,nP;function Aye(){if(nP)return Vx;nP=1;var e=u3();Vx=t;function t(n){return e(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return Vx}var Wx,rP;function Pye(){if(rP)return Wx;rP=1,Wx=t;var e=()=>1;function t(r,i,o){return n(r,i||e,o||function(s){return r.outEdges(s)})}function n(r,i,o){var s={},a=r.nodes();return a.forEach(function(u){s[u]={},s[u][u]={distance:0},a.forEach(function(c){u!==c&&(s[u][c]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(c){var f=c.v===u?c.w:c.v,h=i(c);s[u][f]={distance:h,predecessor:u}})}),a.forEach(function(u){var c=s[u];a.forEach(function(f){var h=s[f];a.forEach(function(p){var m=h[u],y=c[p],x=h[p],k=m.distance+y.distance;k<x.distance&&(x.distance=k,x.predecessor=y.predecessor)})})}),s}return Wx}var Ux,iP;function c3(){if(iP)return Ux;iP=1;function e(n){var r={},i={},o=[];function s(a){if(Object.hasOwn(i,a))throw new t;Object.hasOwn(r,a)||(i[a]=!0,r[a]=!0,n.predecessors(a).forEach(s),delete i[a],o.push(a))}if(n.sinks().forEach(s),Object.keys(r).length!==n.nodeCount())throw new t;return o}class t extends Error{constructor(){super(...arguments)}}return Ux=e,e.CycleException=t,Ux}var Hx,oP;function Rye(){if(oP)return Hx;oP=1;var e=c3();Hx=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Hx}var Yx,sP;function d3(){if(sP)return Yx;sP=1,Yx=e;function e(i,o,s){Array.isArray(o)||(o=[o]);var a=i.isDirected()?h=>i.successors(h):h=>i.neighbors(h),u=s==="post"?t:n,c=[],f={};return o.forEach(h=>{if(!i.hasNode(h))throw new Error("Graph does not have node: "+h);u(h,a,f,c)}),c}function t(i,o,s,a){for(var u=[[i,!1]];u.length>0;){var c=u.pop();c[1]?a.push(c[0]):Object.hasOwn(s,c[0])||(s[c[0]]=!0,u.push([c[0],!0]),r(o(c[0]),f=>u.push([f,!1])))}}function n(i,o,s,a){for(var u=[i];u.length>0;){var c=u.pop();Object.hasOwn(s,c)||(s[c]=!0,a.push(c),r(o(c),f=>u.push(f)))}}function r(i,o){for(var s=i.length;s--;)o(i[s],s,i);return i}return Yx}var qx,aP;function Mye(){if(aP)return qx;aP=1;var e=d3();qx=t;function t(n,r){return e(n,r,"post")}return qx}var Gx,lP;function Dye(){if(lP)return Gx;lP=1;var e=d3();Gx=t;function t(n,r){return e(n,r,"pre")}return Gx}var Zx,uP;function Oye(){if(uP)return Zx;uP=1;var e=Ok(),t=a3();Zx=n;function n(r,i){var o=new e,s={},a=new t,u;function c(h){var p=h.v===u?h.w:h.v,m=a.priority(p);if(m!==void 0){var y=i(h);y<m&&(s[p]=u,a.decrease(p,y))}}if(r.nodeCount()===0)return o;r.nodes().forEach(function(h){a.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),a.decrease(r.nodes()[0],0);for(var f=!1;a.size()>0;){if(u=a.removeMin(),Object.hasOwn(s,u))o.setEdge(u,s[u]);else{if(f)throw new Error("Input graph is not connected: "+r);f=!0}r.nodeEdges(u).forEach(c)}return o}return Zx}var Kx,cP;function Iye(){return cP||(cP=1,Kx={components:Nye(),dijkstra:l3(),dijkstraAll:Tye(),findCycles:Aye(),floydWarshall:Pye(),isAcyclic:Rye(),postorder:Mye(),preorder:Dye(),prim:Oye(),tarjan:u3(),topsort:c3()}),Kx}var Xx,dP;function pi(){if(dP)return Xx;dP=1;var e=Cye();return Xx={Graph:e.Graph,json:_ye(),alg:Iye(),version:e.version},Xx}var Qx,fP;function jye(){if(fP)return Qx;fP=1;class e{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,o=i._prev;if(o!==i)return t(o),o}enqueue(i){let o=this._sentinel;i._prev&&i._next&&t(i),i._next=o._next,o._next._prev=i,o._next=i,i._prev=o}toString(){let i=[],o=this._sentinel,s=o._prev;for(;s!==o;)i.push(JSON.stringify(s,n)),s=s._prev;return"["+i.join(", ")+"]"}}function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,i){if(r!=="_next"&&r!=="_prev")return i}return Qx=e,Qx}var Jx,hP;function Lye(){if(hP)return Jx;hP=1;let e=pi().Graph,t=jye();Jx=r;let n=()=>1;function r(c,f){if(c.nodeCount()<=1)return[];let h=s(c,f||n);return i(h.graph,h.buckets,h.zeroIdx).flatMap(m=>c.outEdges(m.v,m.w))}function i(c,f,h){let p=[],m=f[f.length-1],y=f[0],x;for(;c.nodeCount();){for(;x=y.dequeue();)o(c,f,h,x);for(;x=m.dequeue();)o(c,f,h,x);if(c.nodeCount()){for(let k=f.length-2;k>0;--k)if(x=f[k].dequeue(),x){p=p.concat(o(c,f,h,x,!0));break}}}return p}function o(c,f,h,p,m){let y=m?[]:void 0;return c.inEdges(p.v).forEach(x=>{let k=c.edge(x),w=c.node(x.v);m&&y.push({v:x.v,w:x.w}),w.out-=k,a(f,h,w)}),c.outEdges(p.v).forEach(x=>{let k=c.edge(x),w=x.w,E=c.node(w);E.in-=k,a(f,h,E)}),c.removeNode(p.v),y}function s(c,f){let h=new e,p=0,m=0;c.nodes().forEach(k=>{h.setNode(k,{v:k,in:0,out:0})}),c.edges().forEach(k=>{let w=h.edge(k.v,k.w)||0,E=f(k),C=w+E;h.setEdge(k.v,k.w,C),m=Math.max(m,h.node(k.v).out+=E),p=Math.max(p,h.node(k.w).in+=E)});let y=u(m+p+3).map(()=>new t),x=p+1;return h.nodes().forEach(k=>{a(y,x,h.node(k))}),{graph:h,buckets:y,zeroIdx:x}}function a(c,f,h){h.out?h.in?c[h.out-h.in+f].enqueue(h):c[c.length-1].enqueue(h):c[0].enqueue(h)}function u(c){const f=[];for(let h=0;h<c;h++)f.push(h);return f}return Jx}var e0,pP;function pn(){if(pP)return e0;pP=1;let e=pi().Graph;e0={addBorderNode:f,addDummyNode:t,applyWithChunking:m,asNonCompoundGraph:r,buildLayerMatrix:a,intersectRect:s,mapValues:A,maxRank:y,normalizeRanks:u,notime:w,partition:x,pick:P,predecessorWeights:o,range:N,removeEmptyRanks:c,simplify:n,successorWeights:i,time:k,uniqueId:C,zipObject:O};function t(M,j,R,$){let F;do F=C($);while(M.hasNode(F));return R.dummy=j,M.setNode(F,R),F}function n(M){let j=new e().setGraph(M.graph());return M.nodes().forEach(R=>j.setNode(R,M.node(R))),M.edges().forEach(R=>{let $=j.edge(R.v,R.w)||{weight:0,minlen:1},F=M.edge(R);j.setEdge(R.v,R.w,{weight:$.weight+F.weight,minlen:Math.max($.minlen,F.minlen)})}),j}function r(M){let j=new e({multigraph:M.isMultigraph()}).setGraph(M.graph());return M.nodes().forEach(R=>{M.children(R).length||j.setNode(R,M.node(R))}),M.edges().forEach(R=>{j.setEdge(R,M.edge(R))}),j}function i(M){let j=M.nodes().map(R=>{let $={};return M.outEdges(R).forEach(F=>{$[F.w]=($[F.w]||0)+M.edge(F).weight}),$});return O(M.nodes(),j)}function o(M){let j=M.nodes().map(R=>{let $={};return M.inEdges(R).forEach(F=>{$[F.v]=($[F.v]||0)+M.edge(F).weight}),$});return O(M.nodes(),j)}function s(M,j){let R=M.x,$=M.y,F=j.x-R,H=j.y-$,I=M.width/2,q=M.height/2;if(!F&&!H)throw new Error("Not possible to find intersection inside of the rectangle");let Y,Z;return Math.abs(H)*I>Math.abs(F)*q?(H<0&&(q=-q),Y=q*F/H,Z=q):(F<0&&(I=-I),Y=I,Z=I*H/F),{x:R+Y,y:$+Z}}function a(M){let j=N(y(M)+1).map(()=>[]);return M.nodes().forEach(R=>{let $=M.node(R),F=$.rank;F!==void 0&&(j[F][$.order]=R)}),j}function u(M){let j=M.nodes().map($=>{let F=M.node($).rank;return F===void 0?Number.MAX_VALUE:F}),R=m(Math.min,j);M.nodes().forEach($=>{let F=M.node($);Object.hasOwn(F,"rank")&&(F.rank-=R)})}function c(M){let j=M.nodes().map(I=>M.node(I).rank),R=m(Math.min,j),$=[];M.nodes().forEach(I=>{let q=M.node(I).rank-R;$[q]||($[q]=[]),$[q].push(I)});let F=0,H=M.graph().nodeRankFactor;Array.from($).forEach((I,q)=>{I===void 0&&q%H!==0?--F:I!==void 0&&F&&I.forEach(Y=>M.node(Y).rank+=F)})}function f(M,j,R,$){let F={width:0,height:0};return arguments.length>=4&&(F.rank=R,F.order=$),t(M,"border",F,j)}function h(M,j=p){const R=[];for(let $=0;$<M.length;$+=j){const F=M.slice($,$+j);R.push(F)}return R}const p=65535;function m(M,j){if(j.length>p){const R=h(j);return M.apply(null,R.map($=>M.apply(null,$)))}else return M.apply(null,j)}function y(M){const R=M.nodes().map($=>{let F=M.node($).rank;return F===void 0?Number.MIN_VALUE:F});return m(Math.max,R)}function x(M,j){let R={lhs:[],rhs:[]};return M.forEach($=>{j($)?R.lhs.push($):R.rhs.push($)}),R}function k(M,j){let R=Date.now();try{return j()}finally{console.log(M+" time: "+(Date.now()-R)+"ms")}}function w(M,j){return j()}let E=0;function C(M){var j=++E;return toString(M)+j}function N(M,j,R=1){j==null&&(j=M,M=0);let $=H=>H<j;R<0&&($=H=>j<H);const F=[];for(let H=M;$(H);H+=R)F.push(H);return F}function P(M,j){const R={};for(const $ of j)M[$]!==void 0&&(R[$]=M[$]);return R}function A(M,j){let R=j;return typeof j=="string"&&(R=$=>$[j]),Object.entries(M).reduce(($,[F,H])=>($[F]=R(H,F),$),{})}function O(M,j){return M.reduce((R,$,F)=>(R[$]=j[F],R),{})}return e0}var t0,mP;function Fye(){if(mP)return t0;mP=1;let e=Lye(),t=pn().uniqueId;t0={run:n,undo:i};function n(o){(o.graph().acyclicer==="greedy"?e(o,a(o)):r(o)).forEach(u=>{let c=o.edge(u);o.removeEdge(u),c.forwardName=u.name,c.reversed=!0,o.setEdge(u.w,u.v,c,t("rev"))});function a(u){return c=>u.edge(c).weight}}function r(o){let s=[],a={},u={};function c(f){Object.hasOwn(u,f)||(u[f]=!0,a[f]=!0,o.outEdges(f).forEach(h=>{Object.hasOwn(a,h.w)?s.push(h):c(h.w)}),delete a[f])}return o.nodes().forEach(c),s}function i(o){o.edges().forEach(s=>{let a=o.edge(s);if(a.reversed){o.removeEdge(s);let u=a.forwardName;delete a.reversed,delete a.forwardName,o.setEdge(s.w,s.v,a,u)}})}return t0}var n0,gP;function zye(){if(gP)return n0;gP=1;let e=pn();n0={run:t,undo:r};function t(i){i.graph().dummyChains=[],i.edges().forEach(o=>n(i,o))}function n(i,o){let s=o.v,a=i.node(s).rank,u=o.w,c=i.node(u).rank,f=o.name,h=i.edge(o),p=h.labelRank;if(c===a+1)return;i.removeEdge(o);let m,y,x;for(x=0,++a;a<c;++x,++a)h.points=[],y={width:0,height:0,edgeLabel:h,edgeObj:o,rank:a},m=e.addDummyNode(i,"edge",y,"_d"),a===p&&(y.width=h.width,y.height=h.height,y.dummy="edge-label",y.labelpos=h.labelpos),i.setEdge(s,m,{weight:h.weight},f),x===0&&i.graph().dummyChains.push(m),s=m;i.setEdge(s,u,{weight:h.weight},f)}function r(i){i.graph().dummyChains.forEach(o=>{let s=i.node(o),a=s.edgeLabel,u;for(i.setEdge(s.edgeObj,a);s.dummy;)u=i.successors(o)[0],i.removeNode(o),a.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(a.x=s.x,a.y=s.y,a.width=s.width,a.height=s.height),o=u,s=i.node(o)})}return n0}var r0,yP;function em(){if(yP)return r0;yP=1;const{applyWithChunking:e}=pn();r0={longestPath:t,slack:n};function t(r){var i={};function o(s){var a=r.node(s);if(Object.hasOwn(i,s))return a.rank;i[s]=!0;let u=r.outEdges(s).map(f=>f==null?Number.POSITIVE_INFINITY:o(f.w)-r.edge(f).minlen);var c=e(Math.min,u);return c===Number.POSITIVE_INFINITY&&(c=0),a.rank=c}r.sources().forEach(o)}function n(r,i){return r.node(i.w).rank-r.node(i.v).rank-r.edge(i).minlen}return r0}var i0,vP;function f3(){if(vP)return i0;vP=1;var e=pi().Graph,t=em().slack;i0=n;function n(s){var a=new e({directed:!1}),u=s.nodes()[0],c=s.nodeCount();a.setNode(u,{});for(var f,h;r(a,s)<c;)f=i(a,s),h=a.hasNode(f.v)?t(s,f):-t(s,f),o(a,s,h);return a}function r(s,a){function u(c){a.nodeEdges(c).forEach(f=>{var h=f.v,p=c===h?f.w:h;!s.hasNode(p)&&!t(a,f)&&(s.setNode(p,{}),s.setEdge(c,p,{}),u(p))})}return s.nodes().forEach(u),s.nodeCount()}function i(s,a){return a.edges().reduce((c,f)=>{let h=Number.POSITIVE_INFINITY;return s.hasNode(f.v)!==s.hasNode(f.w)&&(h=t(a,f)),h<c[0]?[h,f]:c},[Number.POSITIVE_INFINITY,null])[1]}function o(s,a,u){s.nodes().forEach(c=>a.node(c).rank+=u)}return i0}var o0,xP;function $ye(){if(xP)return o0;xP=1;var e=f3(),t=em().slack,n=em().longestPath,r=pi().alg.preorder,i=pi().alg.postorder,o=pn().simplify;o0=s,s.initLowLimValues=f,s.initCutValues=a,s.calcCutValue=c,s.leaveEdge=p,s.enterEdge=m,s.exchangeEdges=y;function s(E){E=o(E),n(E);var C=e(E);f(C),a(C,E);for(var N,P;N=p(C);)P=m(C,E,N),y(C,E,N,P)}function a(E,C){var N=i(E,E.nodes());N=N.slice(0,N.length-1),N.forEach(P=>u(E,C,P))}function u(E,C,N){var P=E.node(N),A=P.parent;E.edge(N,A).cutvalue=c(E,C,N)}function c(E,C,N){var P=E.node(N),A=P.parent,O=!0,M=C.edge(N,A),j=0;return M||(O=!1,M=C.edge(A,N)),j=M.weight,C.nodeEdges(N).forEach(R=>{var $=R.v===N,F=$?R.w:R.v;if(F!==A){var H=$===O,I=C.edge(R).weight;if(j+=H?I:-I,k(E,N,F)){var q=E.edge(N,F).cutvalue;j+=H?-q:q}}}),j}function f(E,C){arguments.length<2&&(C=E.nodes()[0]),h(E,{},1,C)}function h(E,C,N,P,A){var O=N,M=E.node(P);return C[P]=!0,E.neighbors(P).forEach(j=>{Object.hasOwn(C,j)||(N=h(E,C,N,j,P))}),M.low=O,M.lim=N++,A?M.parent=A:delete M.parent,N}function p(E){return E.edges().find(C=>E.edge(C).cutvalue<0)}function m(E,C,N){var P=N.v,A=N.w;C.hasEdge(P,A)||(P=N.w,A=N.v);var O=E.node(P),M=E.node(A),j=O,R=!1;O.lim>M.lim&&(j=M,R=!0);var $=C.edges().filter(F=>R===w(E,E.node(F.v),j)&&R!==w(E,E.node(F.w),j));return $.reduce((F,H)=>t(C,H)<t(C,F)?H:F)}function y(E,C,N,P){var A=N.v,O=N.w;E.removeEdge(A,O),E.setEdge(P.v,P.w,{}),f(E),a(E,C),x(E,C)}function x(E,C){var N=E.nodes().find(A=>!C.node(A).parent),P=r(E,N);P=P.slice(1),P.forEach(A=>{var O=E.node(A).parent,M=C.edge(A,O),j=!1;M||(M=C.edge(O,A),j=!0),C.node(A).rank=C.node(O).rank+(j?M.minlen:-M.minlen)})}function k(E,C,N){return E.hasEdge(C,N)}function w(E,C,N){return N.low<=C.lim&&C.lim<=N.lim}return o0}var s0,wP;function Bye(){if(wP)return s0;wP=1;var e=em(),t=e.longestPath,n=f3(),r=$ye();s0=i;function i(u){switch(u.graph().ranker){case"network-simplex":a(u);break;case"tight-tree":s(u);break;case"longest-path":o(u);break;default:a(u)}}var o=t;function s(u){t(u),n(u)}function a(u){r(u)}return s0}var a0,bP;function Vye(){if(bP)return a0;bP=1,a0=e;function e(r){let i=n(r);r.graph().dummyChains.forEach(o=>{let s=r.node(o),a=s.edgeObj,u=t(r,i,a.v,a.w),c=u.path,f=u.lca,h=0,p=c[h],m=!0;for(;o!==a.w;){if(s=r.node(o),m){for(;(p=c[h])!==f&&r.node(p).maxRank<s.rank;)h++;p===f&&(m=!1)}if(!m){for(;h<c.length-1&&r.node(p=c[h+1]).minRank<=s.rank;)h++;p=c[h]}r.setParent(o,p),o=r.successors(o)[0]}})}function t(r,i,o,s){let a=[],u=[],c=Math.min(i[o].low,i[s].low),f=Math.max(i[o].lim,i[s].lim),h,p;h=o;do h=r.parent(h),a.push(h);while(h&&(i[h].low>c||f>i[h].lim));for(p=h,h=s;(h=r.parent(h))!==p;)u.push(h);return{path:a.concat(u.reverse()),lca:p}}function n(r){let i={},o=0;function s(a){let u=o;r.children(a).forEach(s),i[a]={low:u,lim:o++}}return r.children().forEach(s),i}return a0}var l0,kP;function Wye(){if(kP)return l0;kP=1;let e=pn();l0={run:t,cleanup:o};function t(s){let a=e.addDummyNode(s,"root",{},"_root"),u=r(s),c=Object.values(u),f=e.applyWithChunking(Math.max,c)-1,h=2*f+1;s.graph().nestingRoot=a,s.edges().forEach(m=>s.edge(m).minlen*=h);let p=i(s)+1;s.children().forEach(m=>n(s,a,h,p,f,u,m)),s.graph().nodeRankFactor=h}function n(s,a,u,c,f,h,p){let m=s.children(p);if(!m.length){p!==a&&s.setEdge(a,p,{weight:0,minlen:u});return}let y=e.addBorderNode(s,"_bt"),x=e.addBorderNode(s,"_bb"),k=s.node(p);s.setParent(y,p),k.borderTop=y,s.setParent(x,p),k.borderBottom=x,m.forEach(w=>{n(s,a,u,c,f,h,w);let E=s.node(w),C=E.borderTop?E.borderTop:w,N=E.borderBottom?E.borderBottom:w,P=E.borderTop?c:2*c,A=C!==N?1:f-h[p]+1;s.setEdge(y,C,{weight:P,minlen:A,nestingEdge:!0}),s.setEdge(N,x,{weight:P,minlen:A,nestingEdge:!0})}),s.parent(p)||s.setEdge(a,y,{weight:0,minlen:f+h[p]})}function r(s){var a={};function u(c,f){var h=s.children(c);h&&h.length&&h.forEach(p=>u(p,f+1)),a[c]=f}return s.children().forEach(c=>u(c,1)),a}function i(s){return s.edges().reduce((a,u)=>a+s.edge(u).weight,0)}function o(s){var a=s.graph();s.removeNode(a.nestingRoot),delete a.nestingRoot,s.edges().forEach(u=>{var c=s.edge(u);c.nestingEdge&&s.removeEdge(u)})}return l0}var u0,SP;function Uye(){if(SP)return u0;SP=1;let e=pn();u0=t;function t(r){function i(o){let s=r.children(o),a=r.node(o);if(s.length&&s.forEach(i),Object.hasOwn(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(let u=a.minRank,c=a.maxRank+1;u<c;++u)n(r,"borderLeft","_bl",o,a,u),n(r,"borderRight","_br",o,a,u)}}r.children().forEach(i)}function n(r,i,o,s,a,u){let c={width:0,height:0,rank:u,borderType:i},f=a[i][u-1],h=e.addDummyNode(r,"border",c,o);a[i][u]=h,r.setParent(h,s),f&&r.setEdge(f,h,{weight:1})}return u0}var c0,EP;function Hye(){if(EP)return c0;EP=1,c0={adjust:e,undo:t};function e(u){let c=u.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(u)}function t(u){let c=u.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&i(u),(c==="lr"||c==="rl")&&(s(u),n(u))}function n(u){u.nodes().forEach(c=>r(u.node(c))),u.edges().forEach(c=>r(u.edge(c)))}function r(u){let c=u.width;u.width=u.height,u.height=c}function i(u){u.nodes().forEach(c=>o(u.node(c))),u.edges().forEach(c=>{let f=u.edge(c);f.points.forEach(o),Object.hasOwn(f,"y")&&o(f)})}function o(u){u.y=-u.y}function s(u){u.nodes().forEach(c=>a(u.node(c))),u.edges().forEach(c=>{let f=u.edge(c);f.points.forEach(a),Object.hasOwn(f,"x")&&a(f)})}function a(u){let c=u.x;u.x=u.y,u.y=c}return c0}var d0,CP;function Yye(){if(CP)return d0;CP=1;let e=pn();d0=t;function t(n){let r={},i=n.nodes().filter(f=>!n.children(f).length),o=i.map(f=>n.node(f).rank),s=e.applyWithChunking(Math.max,o),a=e.range(s+1).map(()=>[]);function u(f){if(r[f])return;r[f]=!0;let h=n.node(f);a[h.rank].push(f),n.successors(f).forEach(u)}return i.sort((f,h)=>n.node(f).rank-n.node(h).rank).forEach(u),a}return d0}var f0,_P;function qye(){if(_P)return f0;_P=1;let e=pn().zipObject;f0=t;function t(r,i){let o=0;for(let s=1;s<i.length;++s)o+=n(r,i[s-1],i[s]);return o}function n(r,i,o){let s=e(o,o.map((p,m)=>m)),a=i.flatMap(p=>r.outEdges(p).map(m=>({pos:s[m.w],weight:r.edge(m).weight})).sort((m,y)=>m.pos-y.pos)),u=1;for(;u<o.length;)u<<=1;let c=2*u-1;u-=1;let f=new Array(c).fill(0),h=0;return a.forEach(p=>{let m=p.pos+u;f[m]+=p.weight;let y=0;for(;m>0;)m%2&&(y+=f[m+1]),m=m-1>>1,f[m]+=p.weight;h+=p.weight*y}),h}return f0}var h0,NP;function Gye(){if(NP)return h0;NP=1,h0=e;function e(t,n=[]){return n.map(r=>{let i=t.inEdges(r);if(i.length){let o=i.reduce((s,a)=>{let u=t.edge(a),c=t.node(a.v);return{sum:s.sum+u.weight*c.order,weight:s.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:r}})}return h0}var p0,TP;function Zye(){if(TP)return p0;TP=1;let e=pn();p0=t;function t(i,o){let s={};i.forEach((u,c)=>{let f=s[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:c};u.barycenter!==void 0&&(f.barycenter=u.barycenter,f.weight=u.weight)}),o.edges().forEach(u=>{let c=s[u.v],f=s[u.w];c!==void 0&&f!==void 0&&(f.indegree++,c.out.push(s[u.w]))});let a=Object.values(s).filter(u=>!u.indegree);return n(a)}function n(i){let o=[];function s(u){return c=>{c.merged||(c.barycenter===void 0||u.barycenter===void 0||c.barycenter>=u.barycenter)&&r(u,c)}}function a(u){return c=>{c.in.push(u),--c.indegree===0&&i.push(c)}}for(;i.length;){let u=i.pop();o.push(u),u.in.reverse().forEach(s(u)),u.out.forEach(a(u))}return o.filter(u=>!u.merged).map(u=>e.pick(u,["vs","i","barycenter","weight"]))}function r(i,o){let s=0,a=0;i.weight&&(s+=i.barycenter*i.weight,a+=i.weight),o.weight&&(s+=o.barycenter*o.weight,a+=o.weight),i.vs=o.vs.concat(i.vs),i.barycenter=s/a,i.weight=a,i.i=Math.min(o.i,i.i),o.merged=!0}return p0}var m0,AP;function Kye(){if(AP)return m0;AP=1;let e=pn();m0=t;function t(i,o){let s=e.partition(i,y=>Object.hasOwn(y,"barycenter")),a=s.lhs,u=s.rhs.sort((y,x)=>x.i-y.i),c=[],f=0,h=0,p=0;a.sort(r(!!o)),p=n(c,u,p),a.forEach(y=>{p+=y.vs.length,c.push(y.vs),f+=y.barycenter*y.weight,h+=y.weight,p=n(c,u,p)});let m={vs:c.flat(!0)};return h&&(m.barycenter=f/h,m.weight=h),m}function n(i,o,s){let a;for(;o.length&&(a=o[o.length-1]).i<=s;)o.pop(),i.push(a.vs),s++;return s}function r(i){return(o,s)=>o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:i?s.i-o.i:o.i-s.i}return m0}var g0,PP;function Xye(){if(PP)return g0;PP=1;let e=Gye(),t=Zye(),n=Kye();g0=r;function r(s,a,u,c){let f=s.children(a),h=s.node(a),p=h?h.borderLeft:void 0,m=h?h.borderRight:void 0,y={};p&&(f=f.filter(E=>E!==p&&E!==m));let x=e(s,f);x.forEach(E=>{if(s.children(E.v).length){let C=r(s,E.v,u,c);y[E.v]=C,Object.hasOwn(C,"barycenter")&&o(E,C)}});let k=t(x,u);i(k,y);let w=n(k,c);if(p&&(w.vs=[p,w.vs,m].flat(!0),s.predecessors(p).length)){let E=s.node(s.predecessors(p)[0]),C=s.node(s.predecessors(m)[0]);Object.hasOwn(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+E.order+C.order)/(w.weight+2),w.weight+=2}return w}function i(s,a){s.forEach(u=>{u.vs=u.vs.flatMap(c=>a[c]?a[c].vs:c)})}function o(s,a){s.barycenter!==void 0?(s.barycenter=(s.barycenter*s.weight+a.barycenter*a.weight)/(s.weight+a.weight),s.weight+=a.weight):(s.barycenter=a.barycenter,s.weight=a.weight)}return g0}var y0,RP;function Qye(){if(RP)return y0;RP=1;let e=pi().Graph,t=pn();y0=n;function n(i,o,s){let a=r(i),u=new e({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(c=>i.node(c));return i.nodes().forEach(c=>{let f=i.node(c),h=i.parent(c);(f.rank===o||f.minRank<=o&&o<=f.maxRank)&&(u.setNode(c),u.setParent(c,h||a),i[s](c).forEach(p=>{let m=p.v===c?p.w:p.v,y=u.edge(m,c),x=y!==void 0?y.weight:0;u.setEdge(m,c,{weight:i.edge(p).weight+x})}),Object.hasOwn(f,"minRank")&&u.setNode(c,{borderLeft:f.borderLeft[o],borderRight:f.borderRight[o]}))}),u}function r(i){for(var o;i.hasNode(o=t.uniqueId("_root")););return o}return y0}var v0,MP;function Jye(){if(MP)return v0;MP=1,v0=e;function e(t,n,r){let i={},o;r.forEach(s=>{let a=t.parent(s),u,c;for(;a;){if(u=t.parent(a),u?(c=i[u],i[u]=a):(c=o,o=a),c&&c!==a){n.setEdge(c,a);return}a=u}})}return v0}var x0,DP;function eve(){if(DP)return x0;DP=1;let e=Yye(),t=qye(),n=Xye(),r=Qye(),i=Jye(),o=pi().Graph,s=pn();x0=a;function a(h,p){if(p&&typeof p.customOrder=="function"){p.customOrder(h,a);return}let m=s.maxRank(h),y=u(h,s.range(1,m+1),"inEdges"),x=u(h,s.range(m-1,-1,-1),"outEdges"),k=e(h);if(f(h,k),p&&p.disableOptimalOrderHeuristic)return;let w=Number.POSITIVE_INFINITY,E;for(let C=0,N=0;N<4;++C,++N){c(C%2?y:x,C%4>=2),k=s.buildLayerMatrix(h);let P=t(h,k);P<w&&(N=0,E=Object.assign({},k),w=P)}f(h,E)}function u(h,p,m){return p.map(function(y){return r(h,y,m)})}function c(h,p){let m=new o;h.forEach(function(y){let x=y.graph().root,k=n(y,x,m,p);k.vs.forEach((w,E)=>y.node(w).order=E),i(y,m,k.vs)})}function f(h,p){Object.values(p).forEach(m=>m.forEach((y,x)=>h.node(y).order=x))}return x0}var w0,OP;function tve(){if(OP)return w0;OP=1;let e=pi().Graph,t=pn();w0={positionX:m,findType1Conflicts:n,findType2Conflicts:r,addConflict:o,hasConflict:s,verticalAlignment:a,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:f,balance:p};function n(k,w){let E={};function C(N,P){let A=0,O=0,M=N.length,j=P[P.length-1];return P.forEach((R,$)=>{let F=i(k,R),H=F?k.node(F).order:M;(F||R===j)&&(P.slice(O,$+1).forEach(I=>{k.predecessors(I).forEach(q=>{let Y=k.node(q),Z=Y.order;(Z<A||H<Z)&&!(Y.dummy&&k.node(I).dummy)&&o(E,q,I)})}),O=$+1,A=H)}),P}return w.length&&w.reduce(C),E}function r(k,w){let E={};function C(P,A,O,M,j){let R;t.range(A,O).forEach($=>{R=P[$],k.node(R).dummy&&k.predecessors(R).forEach(F=>{let H=k.node(F);H.dummy&&(H.order<M||H.order>j)&&o(E,F,R)})})}function N(P,A){let O=-1,M,j=0;return A.forEach((R,$)=>{if(k.node(R).dummy==="border"){let F=k.predecessors(R);F.length&&(M=k.node(F[0]).order,C(A,j,$,O,M),j=$,O=M)}C(A,j,A.length,M,P.length)}),A}return w.length&&w.reduce(N),E}function i(k,w){if(k.node(w).dummy)return k.predecessors(w).find(E=>k.node(E).dummy)}function o(k,w,E){if(w>E){let N=w;w=E,E=N}let C=k[w];C||(k[w]=C={}),C[E]=!0}function s(k,w,E){if(w>E){let C=w;w=E,E=C}return!!k[w]&&Object.hasOwn(k[w],E)}function a(k,w,E,C){let N={},P={},A={};return w.forEach(O=>{O.forEach((M,j)=>{N[M]=M,P[M]=M,A[M]=j})}),w.forEach(O=>{let M=-1;O.forEach(j=>{let R=C(j);if(R.length){R=R.sort((F,H)=>A[F]-A[H]);let $=(R.length-1)/2;for(let F=Math.floor($),H=Math.ceil($);F<=H;++F){let I=R[F];P[j]===j&&M<A[I]&&!s(E,j,I)&&(P[I]=j,P[j]=N[j]=N[I],M=A[I])}}})}),{root:N,align:P}}function u(k,w,E,C,N){let P={},A=c(k,w,E,N),O=N?"borderLeft":"borderRight";function M($,F){let H=A.nodes(),I=H.pop(),q={};for(;I;)q[I]?$(I):(q[I]=!0,H.push(I),H=H.concat(F(I))),I=H.pop()}function j($){P[$]=A.inEdges($).reduce((F,H)=>Math.max(F,P[H.v]+A.edge(H)),0)}function R($){let F=A.outEdges($).reduce((I,q)=>Math.min(I,P[q.w]-A.edge(q)),Number.POSITIVE_INFINITY),H=k.node($);F!==Number.POSITIVE_INFINITY&&H.borderType!==O&&(P[$]=Math.max(P[$],F))}return M(j,A.predecessors.bind(A)),M(R,A.successors.bind(A)),Object.keys(C).forEach($=>P[$]=P[E[$]]),P}function c(k,w,E,C){let N=new e,P=k.graph(),A=y(P.nodesep,P.edgesep,C);return w.forEach(O=>{let M;O.forEach(j=>{let R=E[j];if(N.setNode(R),M){var $=E[M],F=N.edge($,R);N.setEdge($,R,Math.max(A(k,j,M),F||0))}M=j})}),N}function f(k,w){return Object.values(w).reduce((E,C)=>{let N=Number.NEGATIVE_INFINITY,P=Number.POSITIVE_INFINITY;Object.entries(C).forEach(([O,M])=>{let j=x(k,O)/2;N=Math.max(M+j,N),P=Math.min(M-j,P)});const A=N-P;return A<E[0]&&(E=[A,C]),E},[Number.POSITIVE_INFINITY,null])[1]}function h(k,w){let E=Object.values(w),C=t.applyWithChunking(Math.min,E),N=t.applyWithChunking(Math.max,E);["u","d"].forEach(P=>{["l","r"].forEach(A=>{let O=P+A,M=k[O];if(M===w)return;let j=Object.values(M),R=C-t.applyWithChunking(Math.min,j);A!=="l"&&(R=N-t.applyWithChunking(Math.max,j)),R&&(k[O]=t.mapValues(M,$=>$+R))})})}function p(k,w){return t.mapValues(k.ul,(E,C)=>{if(w)return k[w.toLowerCase()][C];{let N=Object.values(k).map(P=>P[C]).sort((P,A)=>P-A);return(N[1]+N[2])/2}})}function m(k){let w=t.buildLayerMatrix(k),E=Object.assign(n(k,w),r(k,w)),C={},N;["u","d"].forEach(A=>{N=A==="u"?w:Object.values(w).reverse(),["l","r"].forEach(O=>{O==="r"&&(N=N.map($=>Object.values($).reverse()));let M=(A==="u"?k.predecessors:k.successors).bind(k),j=a(k,N,E,M),R=u(k,N,j.root,j.align,O==="r");O==="r"&&(R=t.mapValues(R,$=>-$)),C[A+O]=R})});let P=f(k,C);return h(C,P),p(C,k.graph().align)}function y(k,w,E){return(C,N,P)=>{let A=C.node(N),O=C.node(P),M=0,j;if(M+=A.width/2,Object.hasOwn(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":j=-A.width/2;break;case"r":j=A.width/2;break}if(j&&(M+=E?j:-j),j=0,M+=(A.dummy?w:k)/2,M+=(O.dummy?w:k)/2,M+=O.width/2,Object.hasOwn(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":j=O.width/2;break;case"r":j=-O.width/2;break}return j&&(M+=E?j:-j),j=0,M}}function x(k,w){return k.node(w).width}return w0}var b0,IP;function nve(){if(IP)return b0;IP=1;let e=pn(),t=tve().positionX;b0=n;function n(i){i=e.asNonCompoundGraph(i),r(i),Object.entries(t(i)).forEach(([o,s])=>i.node(o).x=s)}function r(i){let o=e.buildLayerMatrix(i),s=i.graph().ranksep,a=0;o.forEach(u=>{const c=u.reduce((f,h)=>{const p=i.node(h).height;return f>p?f:p},0);u.forEach(f=>i.node(f).y=a+c/2),a+=c+s})}return b0}var k0,jP;function rve(){if(jP)return k0;jP=1;let e=Fye(),t=zye(),n=Bye(),r=pn().normalizeRanks,i=Vye(),o=pn().removeEmptyRanks,s=Wye(),a=Uye(),u=Hye(),c=eve(),f=nve(),h=pn(),p=pi().Graph;k0=m;function m(D,G){let K=G&&G.debugTiming?h.time:h.notime;K("layout",()=>{let J=K(" buildLayoutGraph",()=>M(D));K(" runLayout",()=>y(J,K,G)),K(" updateInputGraph",()=>x(D,J))})}function y(D,G,K){G(" makeSpaceForEdgeLabels",()=>j(D)),G(" removeSelfEdges",()=>B(D)),G(" acyclic",()=>e.run(D)),G(" nestingGraph.run",()=>s.run(D)),G(" rank",()=>n(h.asNonCompoundGraph(D))),G(" injectEdgeLabelProxies",()=>R(D)),G(" removeEmptyRanks",()=>o(D)),G(" nestingGraph.cleanup",()=>s.cleanup(D)),G(" normalizeRanks",()=>r(D)),G(" assignRankMinMax",()=>$(D)),G(" removeEdgeLabelProxies",()=>F(D)),G(" normalize.run",()=>t.run(D)),G(" parentDummyChains",()=>i(D)),G(" addBorderSegments",()=>a(D)),G(" order",()=>c(D,K)),G(" insertSelfEdges",()=>W(D)),G(" adjustCoordinateSystem",()=>u.adjust(D)),G(" position",()=>f(D)),G(" positionSelfEdges",()=>L(D)),G(" removeBorderNodes",()=>Z(D)),G(" normalize.undo",()=>t.undo(D)),G(" fixupEdgeLabelCoords",()=>q(D)),G(" undoCoordinateSystem",()=>u.undo(D)),G(" translateGraph",()=>H(D)),G(" assignNodeIntersects",()=>I(D)),G(" reversePoints",()=>Y(D)),G(" acyclic.undo",()=>e.undo(D))}function x(D,G){D.nodes().forEach(K=>{let J=D.node(K),ee=G.node(K);J&&(J.x=ee.x,J.y=ee.y,J.rank=ee.rank,G.children(K).length&&(J.width=ee.width,J.height=ee.height))}),D.edges().forEach(K=>{let J=D.edge(K),ee=G.edge(K);J.points=ee.points,Object.hasOwn(ee,"x")&&(J.x=ee.x,J.y=ee.y)}),D.graph().width=G.graph().width,D.graph().height=G.graph().height}let k=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],C=["width","height"],N={width:0,height:0},P=["minlen","weight","width","height","labeloffset"],A={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function M(D){let G=new p({multigraph:!0,compound:!0}),K=V(D.graph());return G.setGraph(Object.assign({},w,U(K,k),h.pick(K,E))),D.nodes().forEach(J=>{let ee=V(D.node(J));const re=U(ee,C);Object.keys(N).forEach(ue=>{re[ue]===void 0&&(re[ue]=N[ue])}),G.setNode(J,re),G.setParent(J,D.parent(J))}),D.edges().forEach(J=>{let ee=V(D.edge(J));G.setEdge(J,Object.assign({},A,U(ee,P),h.pick(ee,O)))}),G}function j(D){let G=D.graph();G.ranksep/=2,D.edges().forEach(K=>{let J=D.edge(K);J.minlen*=2,J.labelpos.toLowerCase()!=="c"&&(G.rankdir==="TB"||G.rankdir==="BT"?J.width+=J.labeloffset:J.height+=J.labeloffset)})}function R(D){D.edges().forEach(G=>{let K=D.edge(G);if(K.width&&K.height){let J=D.node(G.v),re={rank:(D.node(G.w).rank-J.rank)/2+J.rank,e:G};h.addDummyNode(D,"edge-proxy",re,"_ep")}})}function $(D){let G=0;D.nodes().forEach(K=>{let J=D.node(K);J.borderTop&&(J.minRank=D.node(J.borderTop).rank,J.maxRank=D.node(J.borderBottom).rank,G=Math.max(G,J.maxRank))}),D.graph().maxRank=G}function F(D){D.nodes().forEach(G=>{let K=D.node(G);K.dummy==="edge-proxy"&&(D.edge(K.e).labelRank=K.rank,D.removeNode(G))})}function H(D){let G=Number.POSITIVE_INFINITY,K=0,J=Number.POSITIVE_INFINITY,ee=0,re=D.graph(),ue=re.marginx||0,he=re.marginy||0;function ke(fe){let ve=fe.x,Me=fe.y,$e=fe.width,ct=fe.height;G=Math.min(G,ve-$e/2),K=Math.max(K,ve+$e/2),J=Math.min(J,Me-ct/2),ee=Math.max(ee,Me+ct/2)}D.nodes().forEach(fe=>ke(D.node(fe))),D.edges().forEach(fe=>{let ve=D.edge(fe);Object.hasOwn(ve,"x")&&ke(ve)}),G-=ue,J-=he,D.nodes().forEach(fe=>{let ve=D.node(fe);ve.x-=G,ve.y-=J}),D.edges().forEach(fe=>{let ve=D.edge(fe);ve.points.forEach(Me=>{Me.x-=G,Me.y-=J}),Object.hasOwn(ve,"x")&&(ve.x-=G),Object.hasOwn(ve,"y")&&(ve.y-=J)}),re.width=K-G+ue,re.height=ee-J+he}function I(D){D.edges().forEach(G=>{let K=D.edge(G),J=D.node(G.v),ee=D.node(G.w),re,ue;K.points?(re=K.points[0],ue=K.points[K.points.length-1]):(K.points=[],re=ee,ue=J),K.points.unshift(h.intersectRect(J,re)),K.points.push(h.intersectRect(ee,ue))})}function q(D){D.edges().forEach(G=>{let K=D.edge(G);if(Object.hasOwn(K,"x"))switch((K.labelpos==="l"||K.labelpos==="r")&&(K.width-=K.labeloffset),K.labelpos){case"l":K.x-=K.width/2+K.labeloffset;break;case"r":K.x+=K.width/2+K.labeloffset;break}})}function Y(D){D.edges().forEach(G=>{let K=D.edge(G);K.reversed&&K.points.reverse()})}function Z(D){D.nodes().forEach(G=>{if(D.children(G).length){let K=D.node(G),J=D.node(K.borderTop),ee=D.node(K.borderBottom),re=D.node(K.borderLeft[K.borderLeft.length-1]),ue=D.node(K.borderRight[K.borderRight.length-1]);K.width=Math.abs(ue.x-re.x),K.height=Math.abs(ee.y-J.y),K.x=re.x+K.width/2,K.y=J.y+K.height/2}}),D.nodes().forEach(G=>{D.node(G).dummy==="border"&&D.removeNode(G)})}function B(D){D.edges().forEach(G=>{if(G.v===G.w){var K=D.node(G.v);K.selfEdges||(K.selfEdges=[]),K.selfEdges.push({e:G,label:D.edge(G)}),D.removeEdge(G)}})}function W(D){var G=h.buildLayerMatrix(D);G.forEach(K=>{var J=0;K.forEach((ee,re)=>{var ue=D.node(ee);ue.order=re+J,(ue.selfEdges||[]).forEach(he=>{h.addDummyNode(D,"selfedge",{width:he.label.width,height:he.label.height,rank:ue.rank,order:re+ ++J,e:he.e,label:he.label},"_se")}),delete ue.selfEdges})})}function L(D){D.nodes().forEach(G=>{var K=D.node(G);if(K.dummy==="selfedge"){var J=D.node(K.e.v),ee=J.x+J.width/2,re=J.y,ue=K.x-ee,he=J.height/2;D.setEdge(K.e,K.label),D.removeNode(G),K.label.points=[{x:ee+2*ue/3,y:re-he},{x:ee+5*ue/6,y:re-he},{x:ee+ue,y:re},{x:ee+5*ue/6,y:re+he},{x:ee+2*ue/3,y:re+he}],K.label.x=K.x,K.label.y=K.y}})}function U(D,G){return h.mapValues(h.pick(D,G),Number)}function V(D){var G={};return D&&Object.entries(D).forEach(([K,J])=>{typeof K=="string"&&(K=K.toLowerCase()),G[K]=J}),G}return k0}var S0,LP;function ive(){if(LP)return S0;LP=1;let e=pn(),t=pi().Graph;S0={debugOrdering:n};function n(r){let i=e.buildLayerMatrix(r),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(s=>{o.setNode(s,{label:s}),o.setParent(s,"layer"+r.node(s).rank)}),r.edges().forEach(s=>o.setEdge(s.v,s.w,{},s.name)),i.forEach((s,a)=>{let u="layer"+a;o.setNode(u,{rank:"same"}),s.reduce((c,f)=>(o.setEdge(c,f,{style:"invis"}),f))}),o}return S0}var E0,FP;function ove(){return FP||(FP=1,E0="1.1.4"),E0}var C0,zP;function sve(){return zP||(zP=1,C0={graphlib:pi(),layout:rve(),debug:ive(),util:{time:pn().time,notime:pn().notime},version:ove()}),C0}var ave=sve();const $P=Kl(ave);function BP(e){let t=[];if(!e)return t;function n(r,i){if("ref"in r){const{ref:o,query:s}=r;t.push({ref:o,query:s,conj:i})}if("and"in r)for(const o of r.and)n({...o},"and");if("or"in r)for(const o of r.or)n({...o},"or")}return n(e),t}const VP=(e,t)=>{const n=new $P.graphlib.Graph().setDefaultEdgeLabel(()=>({}));return n.setGraph({rankdir:"TB"}),t.forEach(r=>n.setEdge(r.source,r.target)),e.forEach(r=>{var i,o;return n.setNode(r.id,{...r,width:((i=r.measured)==null?void 0:i.width)??274,height:((o=r.measured)==null?void 0:o.height)??100})}),$P.layout(n),{nodes:e.map(r=>{var a,u;const i=n.node(r.id),o=i.x-(((a=r.measured)==null?void 0:a.width)??274)/2,s=i.y-(((u=r.measured)==null?void 0:u.height)??100)/2;return{...r,position:{x:o,y:s}}}),edges:t}},Wh={animated:!0,markerEnd:{type:xd.ArrowClosed,width:20,height:20,color:"#8e8e8e"}},lve=({stepGraph:e,stepSubscriberGraph:t})=>{if(!e)return{nodes:[],edges:[]};const{initial:n,...r}=e;if(!n.length)return{nodes:[],edges:[]};let i=[],o=[];for(const[u,c]of n.entries()){const h=c.step.id,p=[c,...(r==null?void 0:r[h])||[]].reduce((k,w,E)=>{var N;const C={...w.step,label:w.step.id,type:"default-node",id:i.some(P=>P.id===w.step.id)?`${w.step.id}-${E}`:w.step.id};if((N=w.config)!=null&&N.when){const P=BP(w.config.when),A={id:crypto.randomUUID(),conditions:P,type:"condition-node"};k.push(A)}return k.push(C),k},[]),m=[...p].map((k,w)=>{const E=t==null?void 0:t[k.id];return{id:k.id,position:{x:u*300,y:w*100},type:k.type,data:{conditions:k.conditions,label:k.label,description:k.description,withoutTopHandle:E!=null&&E[k.id]?!1:w===0,withoutBottomHandle:E?!1:w===p.length-1}}});i=[...i,...m];const x=[...p].slice(0,-1).map((k,w)=>({id:`e${k.id}-${p[w+1].id}`,source:k.id,target:p[w+1].id,...Wh}));o=[...o,...x]}if(!t||!Object.keys(t).length){const{nodes:u,edges:c}=VP(i,o);return{nodes:u,edges:c}}for(const[u,c]of Object.entries(t)){const{initial:f,...h}=c;if(f.length)for(const[p,m]of f.entries()){const x=m.step.id,k=[m,...(h==null?void 0:h[x])||[]].map(j=>j.step),w=[m,...(h==null?void 0:h[x])||[]].reduce((j,R,$)=>{var H;const F={...R.step,label:R.step.id,type:"default-node",id:i.some(I=>I.id===R.step.id)?`${R.step.id}-${$}`:R.step.id};if((H=R.config)!=null&&H.when){const I=BP(R.config.when),q={id:crypto.randomUUID(),conditions:I,type:"condition-node"};j.push(q)}return j.push(F),j},[]),E=[...w].map((j,R)=>{const $=t==null?void 0:t[j.id];return{id:j.id,position:{x:p*300+300,y:R*100+100},type:j.type,data:{conditions:j.conditions,label:j.label,description:j.description,withoutBottomHandle:k.some(({id:F})=>F===j.label&&F!==j.id)||$?!1:R===w.length-1}}});i=[...i,...E];const N=[...w].slice(0,-1).map((j,R)=>({id:`e${j.id}-${w[R+1].id}`,source:j.id,target:w[R+1].id,...Wh})),P=w[0],A=w[w.length-1],O=u===P.id?[]:[{id:`e${u}-${P.id}`,source:u,target:P.id,...Wh}],M=k.some(({id:j})=>j===A.label&&j!==A.id)?[{id:`e${A.id}-${u}`,source:A.id,target:u,...Wh}]:[];o=[...o,...O,...N,...M]}}const{nodes:s,edges:a}=VP(i,o);return{nodes:s,edges:a}};function uve({data:e}){const{conditions:t}=e;return v.jsxs("div",{className:Te("bg-mastra-bg-3 rounded-md min-w-[154.23px] max-w-[274px] flex flex-col p-2 gap-2"),children:[v.jsx(bs,{type:"target",position:We.Top,style:{visibility:"hidden"}}),t.map((n,r)=>{var i;return v.jsx(S.Fragment,{children:n.ref.step?v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(hn,{size:"xs",weight:"medium",className:"text-mastra-el-3 bg-mastra-bg-11 my-auto block rounded-[0.125rem] px-2 py-1 text-[10px]",children:((i=n.conj)==null?void 0:i.toLocaleUpperCase())||"WHEN"}),v.jsxs(hn,{size:"xs",className:" text-mastra-el-3",children:[n.ref.step.id||n.ref.step,"'s ",n.ref.path]}),Object.entries(n.query).map(([o,s])=>v.jsxs("div",{className:"flex items-center gap-0.5",children:[v.jsx(hn,{size:"xs",className:" text-mastra-el-3 lowercase",children:o}),v.jsx(hn,{size:"xs",className:"text-mastra-el-3 py-[0.19rem]",children:s})]},`${o}-${s}`))]}):null},`${n.ref.path}-${r}`)}),v.jsx(bs,{type:"source",position:We.Bottom,style:{visibility:"hidden"}})]})}function cve({data:e}){const{label:t,description:n,withoutTopHandle:r,withoutBottomHandle:i}=e;return v.jsxs("div",{className:Te("bg-mastra-bg-8 rounded-md w-[274px]"),children:[!r&&v.jsx(bs,{type:"target",position:We.Top,style:{visibility:"hidden"}}),v.jsx("div",{className:"p-2",children:v.jsxs("div",{className:"text-sm bg-mastra-bg-9 flex items-center gap-[6px] rounded-sm p-2",children:[v.jsx(UB,{className:"text-current w-4 h-4"}),v.jsx(hn,{size:"xs",weight:"medium",className:"text-mastra-el-6 capitalize",children:t})]})}),n&&v.jsx("div",{className:"bg-mastra-bg-4 rounded-b-md p-2 text-[10px] text-left text-mastra-el-4",children:n}),!i&&v.jsx(bs,{type:"source",position:We.Bottom,style:{visibility:"hidden"}})]})}function dve({workflow:e}){const{nodes:t,edges:n}=lve(e),[r,i,o]=Xge(t),[s]=Qge(n),a={"default-node":cve,"condition-node":uve};return v.jsx("div",{className:"w-full h-full",children:v.jsxs(Kge,{nodes:r,edges:s,nodeTypes:a,onNodesChange:o,fitView:!0,fitViewOptions:{maxZoom:.85},children:[v.jsx(cye,{}),v.jsx(kye,{pannable:!0,zoomable:!0,maskColor:"#121212",bgColor:"#171717",nodeColor:"#2c2c2c"}),v.jsx(rye,{variant:vo.Dots,gap:12,size:.5})]})})}function fve({workflowId:e}){return v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs w-[400px]",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"GET"}),v.jsx("p",{className:"text-mastra-el-5",children:"/api/workflows"})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"GET"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/workflows/",e]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/workflows/",e,"/execute"]})]})]})})}function hve({runId:e}){const{logs:t,isLoading:n,refetchLogs:r}=QD(e);return v.jsxs(fr,{className:"h-[calc(100vh-126px)] px-4 pb-4 text-xs w-[400px]",children:[v.jsx("div",{className:"flex justify-end sticky top-0 bg-mastra-bg-2 py-2",children:v.jsx(Bt,{variant:"outline",onClick:()=>r(e),children:n?v.jsx(ap,{className:"w-4 h-4 animate-spin"}):v.jsx(ap,{className:"w-4 h-4"})})}),v.jsx("div",{className:"space-y-4",children:t.length===0?v.jsx("p",{className:"text-mastra-el-5",children:"No logs yet"}):t.map(i=>{const o=JSON.parse(i.message);return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsxs("p",{className:"text-mastra-el-4",children:["[",i.timestamp,"]"]}),v.jsxs("p",{className:"text-mastra-el-5",children:["[",i.level,"]"]})]}),v.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:v.jsx("code",{children:JSON.stringify(o,null,2)})})]},i.timestamp)})})]})}function pve({workflowId:e,setRunId:t}){const{isLoading:n,workflow:r}=b4(e),{executeWorkflow:i,isExecutingWorkflow:o}=Pce(),[s,a]=S.useState(null),u=r==null?void 0:r.triggerSchema,c=async h=>{if(!r)return;const p=await i({workflowId:e,input:h});a(p),t(p.runId)};if(n)return v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:v.jsx("div",{className:"space-y-4",children:v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]})})});if(!r)return null;const f=sk(Q1(J1(u)));return v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs w-[400px]",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(mk,{schema:f,isSubmitLoading:o,onSubmit:h=>{c(h)}})]}),v.jsxs("div",{children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx("div",{className:"flex flex-col gap-2",children:v.jsx(cm,{classname:"absolute z-40 top-4 right-4 w-8 h-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity duration-150 ease-in-out",content:JSON.stringify(s??{},null,2)})}),v.jsx(vk,{className:"w-[368px] overflow-x-auto",code:JSON.stringify(s??{},null,2),language:"json"})]})]})})}function WP({workflowId:e}){const[t,n]=S.useState("");return v.jsxs(XD,{defaultValue:"run",children:[v.jsxs(_1,{className:"flex shrink-0 border-b",children:[v.jsx(na,{value:"run",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Run"})}),v.jsx(na,{value:"endpoints",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Endpoints"})}),v.jsx(na,{value:"logs",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Logs"})})]}),v.jsx(ra,{value:"run",children:e?v.jsx(pve,{workflowId:e,setRunId:n}):null}),v.jsx(ra,{value:"endpoints",children:v.jsx(fve,{workflowId:e})}),v.jsx(ra,{value:"logs",children:v.jsx(hve,{runId:t})})]})}function mve(){const{workflowId:e}=nm(),{workflow:t,isLoading:n}=b4(e);if(n)return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsx(Cr,{title:v.jsx(Je,{className:"h-6 w-[200px]"})}),v.jsxs("main",{className:"flex-1 relative grid grid-cols-[1fr_400px] divide-x",children:[v.jsx("div",{className:"p-4",children:v.jsx(Je,{className:"h-[600px]"})}),v.jsx("div",{className:"flex flex-col",children:v.jsx(WP,{workflowId:e})})]})]});const r=[{label:"Workflows",href:"/workflows"},{label:t==null?void 0:t.name,href:`/workflows/${e}`,isCurrent:!0}];return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsx(Cr,{title:v.jsx(Sm,{items:r})}),v.jsxs("main",{className:"flex-1 relative grid grid-cols-[1fr_400px] divide-x",children:[v.jsx(dve,{workflow:t}),v.jsx("div",{className:"flex flex-col",children:v.jsx(WP,{workflowId:e})})]})]})}function gve(){return v.jsx(SB,{children:v.jsx(J$,{children:v.jsxs(ti,{element:v.jsx(l6,{children:v.jsx(X$,{})}),children:[v.jsx(ti,{path:"/",element:v.jsx(K$,{to:"/agents"})}),v.jsx(ti,{path:"/agents",element:v.jsx(L6,{})}),v.jsx(ti,{path:"/agents/:agentId",element:v.jsx(uT,{})}),v.jsx(ti,{path:"/agents/:agentId/:threadId",element:v.jsx(uT,{})}),v.jsx(ti,{path:"/tools",element:v.jsx(d6,{})}),v.jsx(ti,{path:"/tools/:agentId/:toolId",element:v.jsx(_ce,{})}),v.jsx(ti,{path:"/tools/all/:toolId",element:v.jsx(Tce,{})}),v.jsx(ti,{path:"/workflows",element:v.jsx(Rce,{})}),v.jsx(ti,{path:"/workflows/:workflowId",element:v.jsx(mve,{})})]})})})}o$.createRoot(document.getElementById("root")).render(v.jsx(S.StrictMode,{children:v.jsx(gve,{})}));export{yX as _,Y7 as a,uH as b,RN as c,iH as f,lH as h,s1 as s,X7 as w};
|