@owox/backend 0.3.0-next-20250710104322 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/public/assets/index-CW8mTM9D.js +600 -0
- package/dist/public/assets/index-fzGzERTq.css +1 -0
- package/dist/public/index.html +2 -2
- package/dist/src/common/scheduler/shared/entities/scheduled-trigger.entity.js +1 -1
- package/package.json +5 -11
- package/dist/public/assets/index-DWI4R5zF.css +0 -1
- package/dist/public/assets/index-brfO5Ude.js +0 -590
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
var ID=Object.defineProperty;var PD=(e,t,n)=>t in e?ID(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fc=(e,t,n)=>PD(e,typeof t!="symbol"?t+"":t,n);function FD(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(a,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>a[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"]'))a(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).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 a(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function JC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qg={exports:{}},Uc={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Fw;function UD(){if(Fw)return Uc;Fw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,i,o){var u=null;if(o!==void 0&&(u=""+o),i.key!==void 0&&(u=""+i.key),"key"in i){o={};for(var f in i)f!=="key"&&(o[f]=i[f])}else o=i;return i=o.ref,{$$typeof:e,type:a,key:u,ref:i!==void 0?i:null,props:o}}return Uc.Fragment=t,Uc.jsx=n,Uc.jsxs=n,Uc}var Uw;function zD(){return Uw||(Uw=1,qg.exports=UD()),qg.exports}var c=zD(),Zg={exports:{}},ct={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var zw;function VD(){if(zw)return ct;zw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=b&&M[b]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function C(M,G,P){this.props=M,this.context=G,this.refs=E,this.updater=P||S}C.prototype.isReactComponent={},C.prototype.setState=function(M,G){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,G,"setState")},C.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function R(){}R.prototype=C.prototype;function T(M,G,P){this.props=M,this.context=G,this.refs=E,this.updater=P||S}var N=T.prototype=new R;N.constructor=T,w(N,C.prototype),N.isPureReactComponent=!0;var O=Array.isArray,A={H:null,A:null,T:null,S:null,V:null},D=Object.prototype.hasOwnProperty;function L(M,G,P,q,ie,he){return P=he.ref,{$$typeof:e,type:M,key:G,ref:P!==void 0?P:null,props:he}}function H(M,G){return L(M.type,G,void 0,void 0,void 0,M.props)}function X(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function re(M){var G={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(P){return G[P]})}var me=/\/+/g;function V(M,G){return typeof M=="object"&&M!==null&&M.key!=null?re(""+M.key):G.toString(36)}function le(){}function ue(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(le,le):(M.status="pending",M.then(function(G){M.status==="pending"&&(M.status="fulfilled",M.value=G)},function(G){M.status==="pending"&&(M.status="rejected",M.reason=G)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function ne(M,G,P,q,ie){var he=typeof M;(he==="undefined"||he==="boolean")&&(M=null);var ve=!1;if(M===null)ve=!0;else switch(he){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(M.$$typeof){case e:case t:ve=!0;break;case v:return ve=M._init,ne(ve(M._payload),G,P,q,ie)}}if(ve)return ie=ie(M),ve=q===""?"."+V(M,0):q,O(ie)?(P="",ve!=null&&(P=ve.replace(me,"$&/")+"/"),ne(ie,G,P,"",function(be){return be})):ie!=null&&(X(ie)&&(ie=H(ie,P+(ie.key==null||M&&M.key===ie.key?"":(""+ie.key).replace(me,"$&/")+"/")+ve)),G.push(ie)),1;ve=0;var fe=q===""?".":q+":";if(O(M))for(var _e=0;_e<M.length;_e++)q=M[_e],he=fe+V(q,_e),ve+=ne(q,G,P,he,ie);else if(_e=y(M),typeof _e=="function")for(M=_e.call(M),_e=0;!(q=M.next()).done;)q=q.value,he=fe+V(q,_e++),ve+=ne(q,G,P,he,ie);else if(he==="object"){if(typeof M.then=="function")return ne(ue(M),G,P,q,ie);throw G=String(M),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ve}function k(M,G,P){if(M==null)return M;var q=[],ie=0;return ne(M,q,"","",function(he){return G.call(P,he,ie++)}),q}function Z(M){if(M._status===-1){var G=M._result;G=G(),G.then(function(P){(M._status===0||M._status===-1)&&(M._status=1,M._result=P)},function(P){(M._status===0||M._status===-1)&&(M._status=2,M._result=P)}),M._status===-1&&(M._status=0,M._result=G)}if(M._status===1)return M._result.default;throw M._result}var $=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)};function se(){}return ct.Children={map:k,forEach:function(M,G,P){k(M,function(){G.apply(this,arguments)},P)},count:function(M){var G=0;return k(M,function(){G++}),G},toArray:function(M){return k(M,function(G){return G})||[]},only:function(M){if(!X(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},ct.Component=C,ct.Fragment=n,ct.Profiler=i,ct.PureComponent=T,ct.StrictMode=a,ct.Suspense=h,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,ct.__COMPILER_RUNTIME={__proto__:null,c:function(M){return A.H.useMemoCache(M)}},ct.cache=function(M){return function(){return M.apply(null,arguments)}},ct.cloneElement=function(M,G,P){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var q=w({},M.props),ie=M.key,he=void 0;if(G!=null)for(ve in G.ref!==void 0&&(he=void 0),G.key!==void 0&&(ie=""+G.key),G)!D.call(G,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&G.ref===void 0||(q[ve]=G[ve]);var ve=arguments.length-2;if(ve===1)q.children=P;else if(1<ve){for(var fe=Array(ve),_e=0;_e<ve;_e++)fe[_e]=arguments[_e+2];q.children=fe}return L(M.type,ie,void 0,void 0,he,q)},ct.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:o,_context:M},M},ct.createElement=function(M,G,P){var q,ie={},he=null;if(G!=null)for(q in G.key!==void 0&&(he=""+G.key),G)D.call(G,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(ie[q]=G[q]);var ve=arguments.length-2;if(ve===1)ie.children=P;else if(1<ve){for(var fe=Array(ve),_e=0;_e<ve;_e++)fe[_e]=arguments[_e+2];ie.children=fe}if(M&&M.defaultProps)for(q in ve=M.defaultProps,ve)ie[q]===void 0&&(ie[q]=ve[q]);return L(M,he,void 0,void 0,null,ie)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(M){return{$$typeof:f,render:M}},ct.isValidElement=X,ct.lazy=function(M){return{$$typeof:v,_payload:{_status:-1,_result:M},_init:Z}},ct.memo=function(M,G){return{$$typeof:m,type:M,compare:G===void 0?null:G}},ct.startTransition=function(M){var G=A.T,P={};A.T=P;try{var q=M(),ie=A.S;ie!==null&&ie(P,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(se,$)}catch(he){$(he)}finally{A.T=G}},ct.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},ct.use=function(M){return A.H.use(M)},ct.useActionState=function(M,G,P){return A.H.useActionState(M,G,P)},ct.useCallback=function(M,G){return A.H.useCallback(M,G)},ct.useContext=function(M){return A.H.useContext(M)},ct.useDebugValue=function(){},ct.useDeferredValue=function(M,G){return A.H.useDeferredValue(M,G)},ct.useEffect=function(M,G,P){var q=A.H;if(typeof P=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return q.useEffect(M,G)},ct.useId=function(){return A.H.useId()},ct.useImperativeHandle=function(M,G,P){return A.H.useImperativeHandle(M,G,P)},ct.useInsertionEffect=function(M,G){return A.H.useInsertionEffect(M,G)},ct.useLayoutEffect=function(M,G){return A.H.useLayoutEffect(M,G)},ct.useMemo=function(M,G){return A.H.useMemo(M,G)},ct.useOptimistic=function(M,G){return A.H.useOptimistic(M,G)},ct.useReducer=function(M,G,P){return A.H.useReducer(M,G,P)},ct.useRef=function(M){return A.H.useRef(M)},ct.useState=function(M){return A.H.useState(M)},ct.useSyncExternalStore=function(M,G,P){return A.H.useSyncExternalStore(M,G,P)},ct.useTransition=function(){return A.H.useTransition()},ct.version="19.1.0",ct}var Vw;function $y(){return Vw||(Vw=1,Zg.exports=VD()),Zg.exports}var g=$y();const ot=JC(g),eR=FD({__proto__:null,default:ot},[g]);var Yg={exports:{}},zc={},Kg={exports:{}},Qg={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var $w;function $D(){return $w||($w=1,function(e){function t(k,Z){var $=k.length;k.push(Z);e:for(;0<$;){var se=$-1>>>1,M=k[se];if(0<i(M,Z))k[se]=Z,k[$]=M,$=se;else break e}}function n(k){return k.length===0?null:k[0]}function a(k){if(k.length===0)return null;var Z=k[0],$=k.pop();if($!==Z){k[0]=$;e:for(var se=0,M=k.length,G=M>>>1;se<G;){var P=2*(se+1)-1,q=k[P],ie=P+1,he=k[ie];if(0>i(q,$))ie<M&&0>i(he,q)?(k[se]=he,k[ie]=$,se=ie):(k[se]=q,k[P]=$,se=P);else if(ie<M&&0>i(he,$))k[se]=he,k[ie]=$,se=ie;else break e}}return Z}function i(k,Z){var $=k.sortIndex-Z.sortIndex;return $!==0?$:k.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],m=[],v=1,b=null,y=3,S=!1,w=!1,E=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function O(k){for(var Z=n(m);Z!==null;){if(Z.callback===null)a(m);else if(Z.startTime<=k)a(m),Z.sortIndex=Z.expirationTime,t(h,Z);else break;Z=n(m)}}function A(k){if(E=!1,O(k),!w)if(n(h)!==null)w=!0,D||(D=!0,V());else{var Z=n(m);Z!==null&&ne(A,Z.startTime-k)}}var D=!1,L=-1,H=5,X=-1;function re(){return C?!0:!(e.unstable_now()-X<H)}function me(){if(C=!1,D){var k=e.unstable_now();X=k;var Z=!0;try{e:{w=!1,E&&(E=!1,T(L),L=-1),S=!0;var $=y;try{t:{for(O(k),b=n(h);b!==null&&!(b.expirationTime>k&&re());){var se=b.callback;if(typeof se=="function"){b.callback=null,y=b.priorityLevel;var M=se(b.expirationTime<=k);if(k=e.unstable_now(),typeof M=="function"){b.callback=M,O(k),Z=!0;break t}b===n(h)&&a(h),O(k)}else a(h);b=n(h)}if(b!==null)Z=!0;else{var G=n(m);G!==null&&ne(A,G.startTime-k),Z=!1}}break e}finally{b=null,y=$,S=!1}Z=void 0}}finally{Z?V():D=!1}}}var V;if(typeof N=="function")V=function(){N(me)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,ue=le.port2;le.port1.onmessage=me,V=function(){ue.postMessage(null)}}else V=function(){R(me,0)};function ne(k,Z){L=R(function(){k(e.unstable_now())},Z)}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(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(k){switch(y){case 1:case 2:case 3:var Z=3;break;default:Z=y}var $=y;y=Z;try{return k()}finally{y=$}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(k,Z){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var $=y;y=k;try{return Z()}finally{y=$}},e.unstable_scheduleCallback=function(k,Z,$){var se=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?se+$:se):$=se,k){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=$+M,k={id:v++,callback:Z,priorityLevel:k,startTime:$,expirationTime:M,sortIndex:-1},$>se?(k.sortIndex=$,t(m,k),n(h)===null&&k===n(m)&&(E?(T(L),L=-1):E=!0,ne(A,$-se))):(k.sortIndex=M,t(h,k),w||S||(w=!0,D||(D=!0,V()))),k},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(k){var Z=y;return function(){var $=y;y=Z;try{return k.apply(this,arguments)}finally{y=$}}}}(Qg)),Qg}var Hw;function HD(){return Hw||(Hw=1,Kg.exports=$D()),Kg.exports}var Xg={exports:{}},Mn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Bw;function BD(){if(Bw)return Mn;Bw=1;var e=$y();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(h,m,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:b==null?null:""+b,children:h,containerInfo:m,implementation:v}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Mn.createPortal=function(h,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return o(h,m,null,v)},Mn.flushSync=function(h){var m=u.T,v=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=m,a.p=v,a.d.f()}},Mn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},Mn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Mn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var v=m.as,b=f(v,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:b,integrity:y,fetchPriority:S}):v==="script"&&a.d.X(h,{crossOrigin:b,integrity:y,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Mn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=f(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},Mn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,b=f(v,m.crossOrigin);a.d.L(h,v,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Mn.preloadModule=function(h,m){if(typeof h=="string")if(m){var v=f(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},Mn.requestFormReset=function(h){a.d.r(h)},Mn.unstable_batchedUpdates=function(h,m){return h(m)},Mn.useFormState=function(h,m,v){return u.H.useFormState(h,m,v)},Mn.useFormStatus=function(){return u.H.useHostTransitionStatus()},Mn.version="19.1.0",Mn}var Gw;function tR(){if(Gw)return Xg.exports;Gw=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(),Xg.exports=BD(),Xg.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var qw;function GD(){if(qw)return zc;qw=1;var e=HD(),t=$y(),n=tR();function a(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var s=r,l=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(l=s.return),r=s.return;while(r)}return s.tag===3?l:null}function u(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function f(r){if(o(r)!==r)throw Error(a(188))}function h(r){var s=r.alternate;if(!s){if(s=o(r),s===null)throw Error(a(188));return s!==r?null:r}for(var l=r,d=s;;){var p=l.return;if(p===null)break;var x=p.alternate;if(x===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===l)return f(p),r;if(x===d)return f(p),s;x=x.sibling}throw Error(a(188))}if(l.return!==d.return)l=p,d=x;else{for(var _=!1,j=p.child;j;){if(j===l){_=!0,l=p,d=x;break}if(j===d){_=!0,d=p,l=x;break}j=j.sibling}if(!_){for(j=x.child;j;){if(j===l){_=!0,l=x,d=p;break}if(j===d){_=!0,d=x,l=p;break}j=j.sibling}if(!_)throw Error(a(189))}}if(l.alternate!==d)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:s}function m(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=m(r),s!==null)return s;r=r.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),T=Symbol.for("react.consumer"),N=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),me=Symbol.iterator;function V(r){return r===null||typeof r!="object"?null:(r=me&&r[me]||r["@@iterator"],typeof r=="function"?r:null)}var le=Symbol.for("react.client.reference");function ue(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===le?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case A:return"Suspense";case D:return"SuspenseList";case X:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return(r.displayName||"Context")+".Provider";case T:return(r._context.displayName||"Context")+".Consumer";case O:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case L:return s=r.displayName||null,s!==null?s:ue(r.type)||"Memo";case H:s=r._payload,r=r._init;try{return ue(r(s))}catch{}}return null}var ne=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},se=[],M=-1;function G(r){return{current:r}}function P(r){0>M||(r.current=se[M],se[M]=null,M--)}function q(r,s){M++,se[M]=r.current,r.current=s}var ie=G(null),he=G(null),ve=G(null),fe=G(null);function _e(r,s){switch(q(ve,s),q(he,r),q(ie,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?fw(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=fw(s),r=hw(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}P(ie),q(ie,r)}function be(){P(ie),P(he),P(ve)}function Te(r){r.memoizedState!==null&&q(fe,r);var s=ie.current,l=hw(s,r.type);s!==l&&(q(he,r),q(ie,l))}function Me(r){he.current===r&&(P(ie),P(he)),fe.current===r&&(P(fe),Mc._currentValue=$)}var Ge=Object.prototype.hasOwnProperty,Yt=e.unstable_scheduleCallback,zt=e.unstable_cancelCallback,Rr=e.unstable_shouldYield,Yr=e.unstable_requestPaint,en=e.unstable_now,go=e.unstable_getCurrentPriorityLevel,_r=e.unstable_ImmediatePriority,F=e.unstable_UserBlockingPriority,W=e.unstable_NormalPriority,oe=e.unstable_LowPriority,Ce=e.unstable_IdlePriority,Ee=e.log,Se=e.unstable_setDisableYieldValue,je=null,Be=null;function ht(r){if(typeof Ee=="function"&&Se(r),Be&&typeof Be.setStrictMode=="function")try{Be.setStrictMode(je,r)}catch{}}var jt=Math.clz32?Math.clz32:vo,bs=Math.log,pn=Math.LN2;function vo(r){return r>>>=0,r===0?32:31-(bs(r)/pn|0)|0}var Kr=256,Qr=4194304;function Xr(r){var s=r&42;if(s!==0)return s;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ha(r,s,l){var d=r.pendingLanes;if(d===0)return 0;var p=0,x=r.suspendedLanes,_=r.pingedLanes;r=r.warmLanes;var j=d&134217727;return j!==0?(d=j&~x,d!==0?p=Xr(d):(_&=j,_!==0?p=Xr(_):l||(l=j&~r,l!==0&&(p=Xr(l))))):(j=d&~x,j!==0?p=Xr(j):_!==0?p=Xr(_):l||(l=d&~r,l!==0&&(p=Xr(l)))),p===0?0:s!==0&&s!==p&&(s&x)===0&&(x=p&-p,l=s&-s,x>=l||x===32&&(l&4194048)!==0)?s:p}function Tr(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function vi(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yo(){var r=Kr;return Kr<<=1,(Kr&4194048)===0&&(Kr=256),r}function hd(){var r=Qr;return Qr<<=1,(Qr&62914560)===0&&(Qr=4194304),r}function xo(r){for(var s=[],l=0;31>l;l++)s.push(r);return s}function yi(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function md(r,s,l,d,p,x){var _=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var j=r.entanglements,I=r.expirationTimes,Q=r.hiddenUpdates;for(l=_&~l;0<l;){var ce=31-jt(l),pe=1<<ce;j[ce]=0,I[ce]=-1;var J=Q[ce];if(J!==null)for(Q[ce]=null,ce=0;ce<J.length;ce++){var ee=J[ce];ee!==null&&(ee.lane&=-536870913)}l&=~pe}d!==0&&xi(r,d,0),x!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=x&~(_&~s))}function xi(r,s,l){r.pendingLanes|=s,r.suspendedLanes&=~s;var d=31-jt(s);r.entangledLanes|=s,r.entanglements[d]=r.entanglements[d]|1073741824|l&4194090}function bi(r,s){var l=r.entangledLanes|=s;for(r=r.entanglements;l;){var d=31-jt(l),p=1<<d;p&s|r[d]&s&&(r[d]|=s),l&=~p}}function $l(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Hl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function U(){var r=Z.p;return r!==0?r:(r=window.event,r===void 0?32:Ow(r.type))}function Y(r,s){var l=Z.p;try{return Z.p=r,s()}finally{Z.p=l}}var te=Math.random().toString(36).slice(2),ge="__reactFiber$"+te,we="__reactProps$"+te,Pe="__reactContainer$"+te,qe="__reactEvents$"+te,Oe="__reactListeners$"+te,$e="__reactHandles$"+te,He="__reactResources$"+te,Je="__reactMarker$"+te;function ze(r){delete r[ge],delete r[we],delete r[qe],delete r[Oe],delete r[$e]}function rt(r){var s=r[ge];if(s)return s;for(var l=r.parentNode;l;){if(s=l[Pe]||l[ge]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(r=vw(r);r!==null;){if(l=r[ge])return l;r=vw(r)}return s}r=l,l=r.parentNode}return null}function Et(r){if(r=r[ge]||r[Pe]){var s=r.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return r}return null}function Vt(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(a(33))}function Kt(r){var s=r[He];return s||(s=r[He]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Tt(r){r[Je]=!0}var St=new Set,Ss={};function Fn(r,s){Nr(r,s),Nr(r+"Capture",s)}function Nr(r,s){for(Ss[r]=s,r=0;r<s.length;r++)St.add(s[r])}var qn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ws={},Es={};function Bl(r){return Ge.call(Es,r)?!0:Ge.call(ws,r)?!1:qn.test(r)?Es[r]=!0:(ws[r]=!0,!1)}function Ar(r,s,l){if(Bl(s))if(l===null)r.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var d=s.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+l)}}function za(r,s,l){if(l===null)r.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+l)}}function mt(r,s,l,d){if(d===null)r.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(s,l,""+d)}}var Dn,Wr;function Jr(r){if(Dn===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);Dn=s&&s[1]||"",Wr=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Dn+r+Wr}var Si=!1;function Gt(r,s){if(!r||Si)return"";Si=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ee){var J=ee}Reflect.construct(r,[],pe)}else{try{pe.call()}catch(ee){J=ee}r.call(pe.prototype)}}else{try{throw Error()}catch(ee){J=ee}(pe=r())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ee){if(ee&&J&&typeof ee.stack=="string")return[ee.stack,J.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=d.DetermineComponentFrameRoot(),_=x[0],j=x[1];if(_&&j){var I=_.split(`
|
|
44
|
+
`),Q=j.split(`
|
|
45
|
+
`);for(p=d=0;d<I.length&&!I[d].includes("DetermineComponentFrameRoot");)d++;for(;p<Q.length&&!Q[p].includes("DetermineComponentFrameRoot");)p++;if(d===I.length||p===Q.length)for(d=I.length-1,p=Q.length-1;1<=d&&0<=p&&I[d]!==Q[p];)p--;for(;1<=d&&0<=p;d--,p--)if(I[d]!==Q[p]){if(d!==1||p!==1)do if(d--,p--,0>p||I[d]!==Q[p]){var ce=`
|
|
46
|
+
`+I[d].replace(" at new "," at ");return r.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",r.displayName)),ce}while(1<=d&&0<=p);break}}}finally{Si=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?Jr(l):""}function Cs(r){switch(r.tag){case 26:case 27:case 5:return Jr(r.type);case 16:return Jr("Lazy");case 13:return Jr("Suspense");case 19:return Jr("SuspenseList");case 0:case 15:return Gt(r.type,!1);case 11:return Gt(r.type.render,!1);case 1:return Gt(r.type,!0);case 31:return Jr("Activity");default:return""}}function Gl(r){try{var s="";do s+=Cs(r),r=r.return;while(r);return s}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}function Zn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function o0(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function D2(r){var s=o0(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),d=""+r[s];if(!r.hasOwnProperty(s)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,x=l.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return p.call(this)},set:function(_){d=""+_,x.call(this,_)}}),Object.defineProperty(r,s,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(_){d=""+_},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function pd(r){r._valueTracker||(r._valueTracker=D2(r))}function l0(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var l=s.getValue(),d="";return r&&(d=o0(r)?r.checked?"true":"false":r.value),r=d,r!==l?(s.setValue(r),!0):!1}function gd(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var O2=/[\n"\\]/g;function jr(r){return r.replace(O2,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Hm(r,s,l,d,p,x,_,j){r.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.type=_:r.removeAttribute("type"),s!=null?_==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+Zn(s)):r.value!==""+Zn(s)&&(r.value=""+Zn(s)):_!=="submit"&&_!=="reset"||r.removeAttribute("value"),s!=null?Bm(r,_,Zn(s)):l!=null?Bm(r,_,Zn(l)):d!=null&&r.removeAttribute("value"),p==null&&x!=null&&(r.defaultChecked=!!x),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?r.name=""+Zn(j):r.removeAttribute("name")}function c0(r,s,l,d,p,x,_,j){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(r.type=x),s!=null||l!=null){if(!(x!=="submit"&&x!=="reset"||s!=null))return;l=l!=null?""+Zn(l):"",s=s!=null?""+Zn(s):l,j||s===r.value||(r.value=s),r.defaultValue=s}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=j?r.checked:!!d,r.defaultChecked=!!d,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(r.name=_)}function Bm(r,s,l){s==="number"&&gd(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function bo(r,s,l,d){if(r=r.options,s){s={};for(var p=0;p<l.length;p++)s["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=s.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&d&&(r[l].defaultSelected=!0)}else{for(l=""+Zn(l),s=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}s!==null||r[p].disabled||(s=r[p])}s!==null&&(s.selected=!0)}}function u0(r,s,l){if(s!=null&&(s=""+Zn(s),s!==r.value&&(r.value=s),l==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=l!=null?""+Zn(l):""}function d0(r,s,l,d){if(s==null){if(d!=null){if(l!=null)throw Error(a(92));if(ne(d)){if(1<d.length)throw Error(a(93));d=d[0]}l=d}l==null&&(l=""),s=l}l=Zn(s),r.defaultValue=l,d=r.textContent,d===l&&d!==""&&d!==null&&(r.value=d)}function So(r,s){if(s){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=s;return}}r.textContent=s}var M2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function f0(r,s,l){var d=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":d?r.setProperty(s,l):typeof l!="number"||l===0||M2.has(s)?s==="float"?r.cssFloat=l:r[s]=(""+l).trim():r[s]=l+"px"}function h0(r,s,l){if(s!=null&&typeof s!="object")throw Error(a(62));if(r=r.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||s!=null&&s.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in s)d=s[p],s.hasOwnProperty(p)&&l[p]!==d&&f0(r,p,d)}else for(var x in s)s.hasOwnProperty(x)&&f0(r,x,s[x])}function Gm(r){if(r.indexOf("-")===-1)return!1;switch(r){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 k2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),L2=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vd(r){return L2.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}var qm=null;function Zm(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var wo=null,Eo=null;function m0(r){var s=Et(r);if(s&&(r=s.stateNode)){var l=r[we]||null;e:switch(r=s.stateNode,s.type){case"input":if(Hm(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+jr(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var d=l[s];if(d!==r&&d.form===r.form){var p=d[we]||null;if(!p)throw Error(a(90));Hm(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<l.length;s++)d=l[s],d.form===r.form&&l0(d)}break e;case"textarea":u0(r,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&bo(r,!!l.multiple,s,!1)}}}var Ym=!1;function p0(r,s,l){if(Ym)return r(s,l);Ym=!0;try{var d=r(s);return d}finally{if(Ym=!1,(wo!==null||Eo!==null)&&(nf(),wo&&(s=wo,r=Eo,Eo=wo=null,m0(s),r)))for(s=0;s<r.length;s++)m0(r[s])}}function ql(r,s){var l=r.stateNode;if(l===null)return null;var d=l[we]||null;if(d===null)return null;l=d[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(a(231,s,typeof l));return l}var Va=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Km=!1;if(Va)try{var Zl={};Object.defineProperty(Zl,"passive",{get:function(){Km=!0}}),window.addEventListener("test",Zl,Zl),window.removeEventListener("test",Zl,Zl)}catch{Km=!1}var Rs=null,Qm=null,yd=null;function g0(){if(yd)return yd;var r,s=Qm,l=s.length,d,p="value"in Rs?Rs.value:Rs.textContent,x=p.length;for(r=0;r<l&&s[r]===p[r];r++);var _=l-r;for(d=1;d<=_&&s[l-d]===p[x-d];d++);return yd=p.slice(r,1<d?1-d:void 0)}function xd(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function bd(){return!0}function v0(){return!1}function Yn(r){function s(l,d,p,x,_){this._reactName=l,this._targetInst=p,this.type=d,this.nativeEvent=x,this.target=_,this.currentTarget=null;for(var j in r)r.hasOwnProperty(j)&&(l=r[j],this[j]=l?l(x):x[j]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?bd:v0,this.isPropagationStopped=v0,this}return v(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=bd)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=bd)},persist:function(){},isPersistent:bd}),s}var wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sd=Yn(wi),Yl=v({},wi,{view:0,detail:0}),I2=Yn(Yl),Xm,Wm,Kl,wd=v({},Yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ep,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Kl&&(Kl&&r.type==="mousemove"?(Xm=r.screenX-Kl.screenX,Wm=r.screenY-Kl.screenY):Wm=Xm=0,Kl=r),Xm)},movementY:function(r){return"movementY"in r?r.movementY:Wm}}),y0=Yn(wd),P2=v({},wd,{dataTransfer:0}),F2=Yn(P2),U2=v({},Yl,{relatedTarget:0}),Jm=Yn(U2),z2=v({},wi,{animationName:0,elapsedTime:0,pseudoElement:0}),V2=Yn(z2),$2=v({},wi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),H2=Yn($2),B2=v({},wi,{data:0}),x0=Yn(B2),G2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q2={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"},Z2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y2(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=Z2[r])?!!s[r]:!1}function ep(){return Y2}var K2=v({},Yl,{key:function(r){if(r.key){var s=G2[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=xd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?q2[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ep,charCode:function(r){return r.type==="keypress"?xd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?xd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Q2=Yn(K2),X2=v({},wd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),b0=Yn(X2),W2=v({},Yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ep}),J2=Yn(W2),ej=v({},wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),tj=Yn(ej),nj=v({},wd,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),rj=Yn(nj),aj=v({},wi,{newState:0,oldState:0}),sj=Yn(aj),ij=[9,13,27,32],tp=Va&&"CompositionEvent"in window,Ql=null;Va&&"documentMode"in document&&(Ql=document.documentMode);var oj=Va&&"TextEvent"in window&&!Ql,S0=Va&&(!tp||Ql&&8<Ql&&11>=Ql),w0=" ",E0=!1;function C0(r,s){switch(r){case"keyup":return ij.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function R0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Co=!1;function lj(r,s){switch(r){case"compositionend":return R0(s);case"keypress":return s.which!==32?null:(E0=!0,w0);case"textInput":return r=s.data,r===w0&&E0?null:r;default:return null}}function cj(r,s){if(Co)return r==="compositionend"||!tp&&C0(r,s)?(r=g0(),yd=Qm=Rs=null,Co=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return S0&&s.locale!=="ko"?null:s.data;default:return null}}var uj={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 _0(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!uj[r.type]:s==="textarea"}function T0(r,s,l,d){wo?Eo?Eo.push(d):Eo=[d]:wo=d,s=cf(s,"onChange"),0<s.length&&(l=new Sd("onChange","change",null,l,d),r.push({event:l,listeners:s}))}var Xl=null,Wl=null;function dj(r){ow(r,0)}function Ed(r){var s=Vt(r);if(l0(s))return r}function N0(r,s){if(r==="change")return s}var A0=!1;if(Va){var np;if(Va){var rp="oninput"in document;if(!rp){var j0=document.createElement("div");j0.setAttribute("oninput","return;"),rp=typeof j0.oninput=="function"}np=rp}else np=!1;A0=np&&(!document.documentMode||9<document.documentMode)}function D0(){Xl&&(Xl.detachEvent("onpropertychange",O0),Wl=Xl=null)}function O0(r){if(r.propertyName==="value"&&Ed(Wl)){var s=[];T0(s,Wl,r,Zm(r)),p0(dj,s)}}function fj(r,s,l){r==="focusin"?(D0(),Xl=s,Wl=l,Xl.attachEvent("onpropertychange",O0)):r==="focusout"&&D0()}function hj(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Ed(Wl)}function mj(r,s){if(r==="click")return Ed(s)}function pj(r,s){if(r==="input"||r==="change")return Ed(s)}function gj(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var rr=typeof Object.is=="function"?Object.is:gj;function Jl(r,s){if(rr(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var l=Object.keys(r),d=Object.keys(s);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var p=l[d];if(!Ge.call(s,p)||!rr(r[p],s[p]))return!1}return!0}function M0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function k0(r,s){var l=M0(r);r=0;for(var d;l;){if(l.nodeType===3){if(d=r+l.textContent.length,r<=s&&d>=s)return{node:l,offset:s-r};r=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=M0(l)}}function L0(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?L0(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function I0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=gd(r.document);s instanceof r.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)r=s.contentWindow;else break;s=gd(r.document)}return s}function ap(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var vj=Va&&"documentMode"in document&&11>=document.documentMode,Ro=null,sp=null,ec=null,ip=!1;function P0(r,s,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ip||Ro==null||Ro!==gd(d)||(d=Ro,"selectionStart"in d&&ap(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ec&&Jl(ec,d)||(ec=d,d=cf(sp,"onSelect"),0<d.length&&(s=new Sd("onSelect","select",null,s,l),r.push({event:s,listeners:d}),s.target=Ro)))}function Ei(r,s){var l={};return l[r.toLowerCase()]=s.toLowerCase(),l["Webkit"+r]="webkit"+s,l["Moz"+r]="moz"+s,l}var _o={animationend:Ei("Animation","AnimationEnd"),animationiteration:Ei("Animation","AnimationIteration"),animationstart:Ei("Animation","AnimationStart"),transitionrun:Ei("Transition","TransitionRun"),transitionstart:Ei("Transition","TransitionStart"),transitioncancel:Ei("Transition","TransitionCancel"),transitionend:Ei("Transition","TransitionEnd")},op={},F0={};Va&&(F0=document.createElement("div").style,"AnimationEvent"in window||(delete _o.animationend.animation,delete _o.animationiteration.animation,delete _o.animationstart.animation),"TransitionEvent"in window||delete _o.transitionend.transition);function Ci(r){if(op[r])return op[r];if(!_o[r])return r;var s=_o[r],l;for(l in s)if(s.hasOwnProperty(l)&&l in F0)return op[r]=s[l];return r}var U0=Ci("animationend"),z0=Ci("animationiteration"),V0=Ci("animationstart"),yj=Ci("transitionrun"),xj=Ci("transitionstart"),bj=Ci("transitioncancel"),$0=Ci("transitionend"),H0=new Map,lp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");lp.push("scrollEnd");function ea(r,s){H0.set(r,s),Fn(s,[r])}var B0=new WeakMap;function Dr(r,s){if(typeof r=="object"&&r!==null){var l=B0.get(r);return l!==void 0?l:(s={value:r,source:s,stack:Gl(s)},B0.set(r,s),s)}return{value:r,source:s,stack:Gl(s)}}var Or=[],To=0,cp=0;function Cd(){for(var r=To,s=cp=To=0;s<r;){var l=Or[s];Or[s++]=null;var d=Or[s];Or[s++]=null;var p=Or[s];Or[s++]=null;var x=Or[s];if(Or[s++]=null,d!==null&&p!==null){var _=d.pending;_===null?p.next=p:(p.next=_.next,_.next=p),d.pending=p}x!==0&&G0(l,p,x)}}function Rd(r,s,l,d){Or[To++]=r,Or[To++]=s,Or[To++]=l,Or[To++]=d,cp|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function up(r,s,l,d){return Rd(r,s,l,d),_d(r)}function No(r,s){return Rd(r,null,null,s),_d(r)}function G0(r,s,l){r.lanes|=l;var d=r.alternate;d!==null&&(d.lanes|=l);for(var p=!1,x=r.return;x!==null;)x.childLanes|=l,d=x.alternate,d!==null&&(d.childLanes|=l),x.tag===22&&(r=x.stateNode,r===null||r._visibility&1||(p=!0)),r=x,x=x.return;return r.tag===3?(x=r.stateNode,p&&s!==null&&(p=31-jt(l),r=x.hiddenUpdates,d=r[p],d===null?r[p]=[s]:d.push(s),s.lane=l|536870912),x):null}function _d(r){if(50<Rc)throw Rc=0,gg=null,Error(a(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var Ao={};function Sj(r,s,l,d){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ar(r,s,l,d){return new Sj(r,s,l,d)}function dp(r){return r=r.prototype,!(!r||!r.isReactComponent)}function $a(r,s){var l=r.alternate;return l===null?(l=ar(r.tag,s,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=s,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,s=r.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function q0(r,s){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,s=l.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function Td(r,s,l,d,p,x){var _=0;if(d=r,typeof r=="function")dp(r)&&(_=1);else if(typeof r=="string")_=ED(r,l,ie.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case X:return r=ar(31,l,s,p),r.elementType=X,r.lanes=x,r;case w:return Ri(l.children,p,x,s);case E:_=8,p|=24;break;case C:return r=ar(12,l,s,p|2),r.elementType=C,r.lanes=x,r;case A:return r=ar(13,l,s,p),r.elementType=A,r.lanes=x,r;case D:return r=ar(19,l,s,p),r.elementType=D,r.lanes=x,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case R:case N:_=10;break e;case T:_=9;break e;case O:_=11;break e;case L:_=14;break e;case H:_=16,d=null;break e}_=29,l=Error(a(130,r===null?"null":typeof r,"")),d=null}return s=ar(_,l,s,p),s.elementType=r,s.type=d,s.lanes=x,s}function Ri(r,s,l,d){return r=ar(7,r,d,s),r.lanes=l,r}function fp(r,s,l){return r=ar(6,r,null,s),r.lanes=l,r}function hp(r,s,l){return s=ar(4,r.children!==null?r.children:[],r.key,s),s.lanes=l,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var jo=[],Do=0,Nd=null,Ad=0,Mr=[],kr=0,_i=null,Ha=1,Ba="";function Ti(r,s){jo[Do++]=Ad,jo[Do++]=Nd,Nd=r,Ad=s}function Z0(r,s,l){Mr[kr++]=Ha,Mr[kr++]=Ba,Mr[kr++]=_i,_i=r;var d=Ha;r=Ba;var p=32-jt(d)-1;d&=~(1<<p),l+=1;var x=32-jt(s)+p;if(30<x){var _=p-p%5;x=(d&(1<<_)-1).toString(32),d>>=_,p-=_,Ha=1<<32-jt(s)+p|l<<p|d,Ba=x+r}else Ha=1<<x|l<<p|d,Ba=r}function mp(r){r.return!==null&&(Ti(r,1),Z0(r,1,0))}function pp(r){for(;r===Nd;)Nd=jo[--Do],jo[Do]=null,Ad=jo[--Do],jo[Do]=null;for(;r===_i;)_i=Mr[--kr],Mr[kr]=null,Ba=Mr[--kr],Mr[kr]=null,Ha=Mr[--kr],Mr[kr]=null}var Un=null,Xt=null,At=!1,Ni=null,ma=!1,gp=Error(a(519));function Ai(r){var s=Error(a(418,""));throw rc(Dr(s,r)),gp}function Y0(r){var s=r.stateNode,l=r.type,d=r.memoizedProps;switch(s[ge]=r,s[we]=d,l){case"dialog":yt("cancel",s),yt("close",s);break;case"iframe":case"object":case"embed":yt("load",s);break;case"video":case"audio":for(l=0;l<Tc.length;l++)yt(Tc[l],s);break;case"source":yt("error",s);break;case"img":case"image":case"link":yt("error",s),yt("load",s);break;case"details":yt("toggle",s);break;case"input":yt("invalid",s),c0(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0),pd(s);break;case"select":yt("invalid",s);break;case"textarea":yt("invalid",s),d0(s,d.value,d.defaultValue,d.children),pd(s)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||d.suppressHydrationWarning===!0||dw(s.textContent,l)?(d.popover!=null&&(yt("beforetoggle",s),yt("toggle",s)),d.onScroll!=null&&yt("scroll",s),d.onScrollEnd!=null&&yt("scrollend",s),d.onClick!=null&&(s.onclick=uf),s=!0):s=!1,s||Ai(r)}function K0(r){for(Un=r.return;Un;)switch(Un.tag){case 5:case 13:ma=!1;return;case 27:case 3:ma=!0;return;default:Un=Un.return}}function tc(r){if(r!==Un)return!1;if(!At)return K0(r),At=!0,!1;var s=r.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||Og(r.type,r.memoizedProps)),l=!l),l&&Xt&&Ai(r),K0(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8)if(l=r.data,l==="/$"){if(s===0){Xt=na(r.nextSibling);break e}s--}else l!=="$"&&l!=="$!"&&l!=="$?"||s++;r=r.nextSibling}Xt=null}}else s===27?(s=Xt,Vs(r.type)?(r=Ig,Ig=null,Xt=r):Xt=s):Xt=Un?na(r.stateNode.nextSibling):null;return!0}function nc(){Xt=Un=null,At=!1}function Q0(){var r=Ni;return r!==null&&(Xn===null?Xn=r:Xn.push.apply(Xn,r),Ni=null),r}function rc(r){Ni===null?Ni=[r]:Ni.push(r)}var vp=G(null),ji=null,Ga=null;function _s(r,s,l){q(vp,s._currentValue),s._currentValue=l}function qa(r){r._currentValue=vp.current,P(vp)}function yp(r,s,l){for(;r!==null;){var d=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),r===l)break;r=r.return}}function xp(r,s,l,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var x=p.dependencies;if(x!==null){var _=p.child;x=x.firstContext;e:for(;x!==null;){var j=x;x=p;for(var I=0;I<s.length;I++)if(j.context===s[I]){x.lanes|=l,j=x.alternate,j!==null&&(j.lanes|=l),yp(x.return,l,r),d||(_=null);break e}x=j.next}}else if(p.tag===18){if(_=p.return,_===null)throw Error(a(341));_.lanes|=l,x=_.alternate,x!==null&&(x.lanes|=l),yp(_,l,r),_=null}else _=p.child;if(_!==null)_.return=p;else for(_=p;_!==null;){if(_===r){_=null;break}if(p=_.sibling,p!==null){p.return=_.return,_=p;break}_=_.return}p=_}}function ac(r,s,l,d){r=null;for(var p=s,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var _=p.alternate;if(_===null)throw Error(a(387));if(_=_.memoizedProps,_!==null){var j=p.type;rr(p.pendingProps.value,_.value)||(r!==null?r.push(j):r=[j])}}else if(p===fe.current){if(_=p.alternate,_===null)throw Error(a(387));_.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Mc):r=[Mc])}p=p.return}r!==null&&xp(s,r,l,d),s.flags|=262144}function jd(r){for(r=r.firstContext;r!==null;){if(!rr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Di(r){ji=r,Ga=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function On(r){return X0(ji,r)}function Dd(r,s){return ji===null&&Di(r),X0(r,s)}function X0(r,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},Ga===null){if(r===null)throw Error(a(308));Ga=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else Ga=Ga.next=s;return l}var wj=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(l,d){r.push(d)}};this.abort=function(){s.aborted=!0,r.forEach(function(l){return l()})}},Ej=e.unstable_scheduleCallback,Cj=e.unstable_NormalPriority,gn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bp(){return{controller:new wj,data:new Map,refCount:0}}function sc(r){r.refCount--,r.refCount===0&&Ej(Cj,function(){r.controller.abort()})}var ic=null,Sp=0,Oo=0,Mo=null;function Rj(r,s){if(ic===null){var l=ic=[];Sp=0,Oo=Eg(),Mo={status:"pending",value:void 0,then:function(d){l.push(d)}}}return Sp++,s.then(W0,W0),s}function W0(){if(--Sp===0&&ic!==null){Mo!==null&&(Mo.status="fulfilled");var r=ic;ic=null,Oo=0,Mo=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function _j(r,s){var l=[],d={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return r.then(function(){d.status="fulfilled",d.value=s;for(var p=0;p<l.length;p++)(0,l[p])(s)},function(p){for(d.status="rejected",d.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),d}var J0=k.S;k.S=function(r,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&Rj(r,s),J0!==null&&J0(r,s)};var Oi=G(null);function wp(){var r=Oi.current;return r!==null?r:Ft.pooledCache}function Od(r,s){s===null?q(Oi,Oi.current):q(Oi,s.pool)}function eb(){var r=wp();return r===null?null:{parent:gn._currentValue,pool:r}}var oc=Error(a(460)),tb=Error(a(474)),Md=Error(a(542)),Ep={then:function(){}};function nb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function kd(){}function rb(r,s,l){switch(l=r[l],l===void 0?r.push(s):l!==s&&(s.then(kd,kd),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,sb(r),r;default:if(typeof s.status=="string")s.then(kd,kd);else{if(r=Ft,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=s,r.status="pending",r.then(function(d){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=d}},function(d){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,sb(r),r}throw lc=s,oc}}var lc=null;function ab(){if(lc===null)throw Error(a(459));var r=lc;return lc=null,r}function sb(r){if(r===oc||r===Md)throw Error(a(483))}var Ts=!1;function Cp(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rp(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ns(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function As(r,s,l){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(Ot&2)!==0){var p=d.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),d.pending=s,s=_d(r),G0(r,null,l),s}return Rd(r,d,s,l),_d(r)}function cc(r,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var d=s.lanes;d&=r.pendingLanes,l|=d,s.lanes=l,bi(r,l)}}function _p(r,s){var l=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var p=null,x=null;if(l=l.firstBaseUpdate,l!==null){do{var _={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};x===null?p=x=_:x=x.next=_,l=l.next}while(l!==null);x===null?p=x=s:x=x.next=s}else p=x=s;l={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:d.shared,callbacks:d.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=s:r.next=s,l.lastBaseUpdate=s}var Tp=!1;function uc(){if(Tp){var r=Mo;if(r!==null)throw r}}function dc(r,s,l,d){Tp=!1;var p=r.updateQueue;Ts=!1;var x=p.firstBaseUpdate,_=p.lastBaseUpdate,j=p.shared.pending;if(j!==null){p.shared.pending=null;var I=j,Q=I.next;I.next=null,_===null?x=Q:_.next=Q,_=I;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,j=ce.lastBaseUpdate,j!==_&&(j===null?ce.firstBaseUpdate=Q:j.next=Q,ce.lastBaseUpdate=I))}if(x!==null){var pe=p.baseState;_=0,ce=Q=I=null,j=x;do{var J=j.lane&-536870913,ee=J!==j.lane;if(ee?(wt&J)===J:(d&J)===J){J!==0&&J===Oo&&(Tp=!0),ce!==null&&(ce=ce.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var tt=r,Ze=j;J=s;var It=l;switch(Ze.tag){case 1:if(tt=Ze.payload,typeof tt=="function"){pe=tt.call(It,pe,J);break e}pe=tt;break e;case 3:tt.flags=tt.flags&-65537|128;case 0:if(tt=Ze.payload,J=typeof tt=="function"?tt.call(It,pe,J):tt,J==null)break e;pe=v({},pe,J);break e;case 2:Ts=!0}}J=j.callback,J!==null&&(r.flags|=64,ee&&(r.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[J]:ee.push(J))}else ee={lane:J,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ce===null?(Q=ce=ee,I=pe):ce=ce.next=ee,_|=J;if(j=j.next,j===null){if(j=p.shared.pending,j===null)break;ee=j,j=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);ce===null&&(I=pe),p.baseState=I,p.firstBaseUpdate=Q,p.lastBaseUpdate=ce,x===null&&(p.shared.lanes=0),Ps|=_,r.lanes=_,r.memoizedState=pe}}function ib(r,s){if(typeof r!="function")throw Error(a(191,r));r.call(s)}function ob(r,s){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)ib(l[r],s)}var ko=G(null),Ld=G(0);function lb(r,s){r=Ja,q(Ld,r),q(ko,s),Ja=r|s.baseLanes}function Np(){q(Ld,Ja),q(ko,ko.current)}function Ap(){Ja=Ld.current,P(ko),P(Ld)}var js=0,dt=null,kt=null,dn=null,Id=!1,Lo=!1,Mi=!1,Pd=0,fc=0,Io=null,Tj=0;function tn(){throw Error(a(321))}function jp(r,s){if(s===null)return!1;for(var l=0;l<s.length&&l<r.length;l++)if(!rr(r[l],s[l]))return!1;return!0}function Dp(r,s,l,d,p,x){return js=x,dt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,k.H=r===null||r.memoizedState===null?Gb:qb,Mi=!1,x=l(d,p),Mi=!1,Lo&&(x=ub(s,l,d,p)),cb(r),x}function cb(r){k.H=Hd;var s=kt!==null&&kt.next!==null;if(js=0,dn=kt=dt=null,Id=!1,fc=0,Io=null,s)throw Error(a(300));r===null||Sn||(r=r.dependencies,r!==null&&jd(r)&&(Sn=!0))}function ub(r,s,l,d){dt=r;var p=0;do{if(Lo&&(Io=null),fc=0,Lo=!1,25<=p)throw Error(a(301));if(p+=1,dn=kt=null,r.updateQueue!=null){var x=r.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}k.H=kj,x=s(l,d)}while(Lo);return x}function Nj(){var r=k.H,s=r.useState()[0];return s=typeof s.then=="function"?hc(s):s,r=r.useState()[0],(kt!==null?kt.memoizedState:null)!==r&&(dt.flags|=1024),s}function Op(){var r=Pd!==0;return Pd=0,r}function Mp(r,s,l){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~l}function kp(r){if(Id){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Id=!1}js=0,dn=kt=dt=null,Lo=!1,fc=Pd=0,Io=null}function Kn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?dt.memoizedState=dn=r:dn=dn.next=r,dn}function fn(){if(kt===null){var r=dt.alternate;r=r!==null?r.memoizedState:null}else r=kt.next;var s=dn===null?dt.memoizedState:dn.next;if(s!==null)dn=s,kt=r;else{if(r===null)throw dt.alternate===null?Error(a(467)):Error(a(310));kt=r,r={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},dn===null?dt.memoizedState=dn=r:dn=dn.next=r}return dn}function Lp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hc(r){var s=fc;return fc+=1,Io===null&&(Io=[]),r=rb(Io,r,s),s=dt,(dn===null?s.memoizedState:dn.next)===null&&(s=s.alternate,k.H=s===null||s.memoizedState===null?Gb:qb),r}function Fd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return hc(r);if(r.$$typeof===N)return On(r)}throw Error(a(438,String(r)))}function Ip(r){var s=null,l=dt.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var d=dt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=Lp(),dt.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(r),d=0;d<r;d++)l[d]=re;return s.index++,l}function Za(r,s){return typeof s=="function"?s(r):s}function Ud(r){var s=fn();return Pp(s,kt,r)}function Pp(r,s,l){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=l;var p=r.baseQueue,x=d.pending;if(x!==null){if(p!==null){var _=p.next;p.next=x.next,x.next=_}s.baseQueue=p=x,d.pending=null}if(x=r.baseState,p===null)r.memoizedState=x;else{s=p.next;var j=_=null,I=null,Q=s,ce=!1;do{var pe=Q.lane&-536870913;if(pe!==Q.lane?(wt&pe)===pe:(js&pe)===pe){var J=Q.revertLane;if(J===0)I!==null&&(I=I.next={lane:0,revertLane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),pe===Oo&&(ce=!0);else if((js&J)===J){Q=Q.next,J===Oo&&(ce=!0);continue}else pe={lane:0,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},I===null?(j=I=pe,_=x):I=I.next=pe,dt.lanes|=J,Ps|=J;pe=Q.action,Mi&&l(x,pe),x=Q.hasEagerState?Q.eagerState:l(x,pe)}else J={lane:pe,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},I===null?(j=I=J,_=x):I=I.next=J,dt.lanes|=pe,Ps|=pe;Q=Q.next}while(Q!==null&&Q!==s);if(I===null?_=x:I.next=j,!rr(x,r.memoizedState)&&(Sn=!0,ce&&(l=Mo,l!==null)))throw l;r.memoizedState=x,r.baseState=_,r.baseQueue=I,d.lastRenderedState=x}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Fp(r){var s=fn(),l=s.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var d=l.dispatch,p=l.pending,x=s.memoizedState;if(p!==null){l.pending=null;var _=p=p.next;do x=r(x,_.action),_=_.next;while(_!==p);rr(x,s.memoizedState)||(Sn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),l.lastRenderedState=x}return[x,d]}function db(r,s,l){var d=dt,p=fn(),x=At;if(x){if(l===void 0)throw Error(a(407));l=l()}else l=s();var _=!rr((kt||p).memoizedState,l);_&&(p.memoizedState=l,Sn=!0),p=p.queue;var j=mb.bind(null,d,p,r);if(mc(2048,8,j,[r]),p.getSnapshot!==s||_||dn!==null&&dn.memoizedState.tag&1){if(d.flags|=2048,Po(9,zd(),hb.bind(null,d,p,l,s),null),Ft===null)throw Error(a(349));x||(js&124)!==0||fb(d,s,l)}return l}function fb(r,s,l){r.flags|=16384,r={getSnapshot:s,value:l},s=dt.updateQueue,s===null?(s=Lp(),dt.updateQueue=s,s.stores=[r]):(l=s.stores,l===null?s.stores=[r]:l.push(r))}function hb(r,s,l,d){s.value=l,s.getSnapshot=d,pb(s)&&gb(r)}function mb(r,s,l){return l(function(){pb(s)&&gb(r)})}function pb(r){var s=r.getSnapshot;r=r.value;try{var l=s();return!rr(r,l)}catch{return!0}}function gb(r){var s=No(r,2);s!==null&&cr(s,r,2)}function Up(r){var s=Kn();if(typeof r=="function"){var l=r;if(r=l(),Mi){ht(!0);try{l()}finally{ht(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:r},s}function vb(r,s,l,d){return r.baseState=l,Pp(r,kt,typeof d=="function"?d:Za)}function Aj(r,s,l,d,p){if($d(r))throw Error(a(485));if(r=s.action,r!==null){var x={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){x.listeners.push(_)}};k.T!==null?l(!0):x.isTransition=!1,d(x),l=s.pending,l===null?(x.next=s.pending=x,yb(s,x)):(x.next=l.next,s.pending=l.next=x)}}function yb(r,s){var l=s.action,d=s.payload,p=r.state;if(s.isTransition){var x=k.T,_={};k.T=_;try{var j=l(p,d),I=k.S;I!==null&&I(_,j),xb(r,s,j)}catch(Q){zp(r,s,Q)}finally{k.T=x}}else try{x=l(p,d),xb(r,s,x)}catch(Q){zp(r,s,Q)}}function xb(r,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){bb(r,s,d)},function(d){return zp(r,s,d)}):bb(r,s,l)}function bb(r,s,l){s.status="fulfilled",s.value=l,Sb(s),r.state=l,s=r.pending,s!==null&&(l=s.next,l===s?r.pending=null:(l=l.next,s.next=l,yb(r,l)))}function zp(r,s,l){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=l,Sb(s),s=s.next;while(s!==d)}r.action=null}function Sb(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function wb(r,s){return s}function Eb(r,s){if(At){var l=Ft.formState;if(l!==null){e:{var d=dt;if(At){if(Xt){t:{for(var p=Xt,x=ma;p.nodeType!==8;){if(!x){p=null;break t}if(p=na(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){Xt=na(p.nextSibling),d=p.data==="F!";break e}}Ai(d)}d=!1}d&&(s=l[0])}}return l=Kn(),l.memoizedState=l.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wb,lastRenderedState:s},l.queue=d,l=$b.bind(null,dt,d),d.dispatch=l,d=Up(!1),x=Gp.bind(null,dt,!1,d.queue),d=Kn(),p={state:s,dispatch:null,action:r,pending:null},d.queue=p,l=Aj.bind(null,dt,p,x,l),p.dispatch=l,d.memoizedState=r,[s,l,!1]}function Cb(r){var s=fn();return Rb(s,kt,r)}function Rb(r,s,l){if(s=Pp(r,s,wb)[0],r=Ud(Za)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=hc(s)}catch(_){throw _===oc?Md:_}else d=s;s=fn();var p=s.queue,x=p.dispatch;return l!==s.memoizedState&&(dt.flags|=2048,Po(9,zd(),jj.bind(null,p,l),null)),[d,x,r]}function jj(r,s){r.action=s}function _b(r){var s=fn(),l=kt;if(l!==null)return Rb(s,l,r);fn(),s=s.memoizedState,l=fn();var d=l.queue.dispatch;return l.memoizedState=r,[s,d,!1]}function Po(r,s,l,d){return r={tag:r,create:l,deps:d,inst:s,next:null},s=dt.updateQueue,s===null&&(s=Lp(),dt.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=r.next=r:(d=l.next,l.next=r,r.next=d,s.lastEffect=r),r}function zd(){return{destroy:void 0,resource:void 0}}function Tb(){return fn().memoizedState}function Vd(r,s,l,d){var p=Kn();d=d===void 0?null:d,dt.flags|=r,p.memoizedState=Po(1|s,zd(),l,d)}function mc(r,s,l,d){var p=fn();d=d===void 0?null:d;var x=p.memoizedState.inst;kt!==null&&d!==null&&jp(d,kt.memoizedState.deps)?p.memoizedState=Po(s,x,l,d):(dt.flags|=r,p.memoizedState=Po(1|s,x,l,d))}function Nb(r,s){Vd(8390656,8,r,s)}function Ab(r,s){mc(2048,8,r,s)}function jb(r,s){return mc(4,2,r,s)}function Db(r,s){return mc(4,4,r,s)}function Ob(r,s){if(typeof s=="function"){r=r();var l=s(r);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Mb(r,s,l){l=l!=null?l.concat([r]):null,mc(4,4,Ob.bind(null,s,r),l)}function Vp(){}function kb(r,s){var l=fn();s=s===void 0?null:s;var d=l.memoizedState;return s!==null&&jp(s,d[1])?d[0]:(l.memoizedState=[r,s],r)}function Lb(r,s){var l=fn();s=s===void 0?null:s;var d=l.memoizedState;if(s!==null&&jp(s,d[1]))return d[0];if(d=r(),Mi){ht(!0);try{r()}finally{ht(!1)}}return l.memoizedState=[d,s],d}function $p(r,s,l){return l===void 0||(js&1073741824)!==0?r.memoizedState=s:(r.memoizedState=l,r=FS(),dt.lanes|=r,Ps|=r,l)}function Ib(r,s,l,d){return rr(l,s)?l:ko.current!==null?(r=$p(r,l,d),rr(r,s)||(Sn=!0),r):(js&42)===0?(Sn=!0,r.memoizedState=l):(r=FS(),dt.lanes|=r,Ps|=r,s)}function Pb(r,s,l,d,p){var x=Z.p;Z.p=x!==0&&8>x?x:8;var _=k.T,j={};k.T=j,Gp(r,!1,s,l);try{var I=p(),Q=k.S;if(Q!==null&&Q(j,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ce=_j(I,d);pc(r,s,ce,lr(r))}else pc(r,s,d,lr(r))}catch(pe){pc(r,s,{then:function(){},status:"rejected",reason:pe},lr())}finally{Z.p=x,k.T=_}}function Dj(){}function Hp(r,s,l,d){if(r.tag!==5)throw Error(a(476));var p=Fb(r).queue;Pb(r,p,s,$,l===null?Dj:function(){return Ub(r),l(d)})}function Fb(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:$},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:l},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function Ub(r){var s=Fb(r).next.queue;pc(r,s,{},lr())}function Bp(){return On(Mc)}function zb(){return fn().memoizedState}function Vb(){return fn().memoizedState}function Oj(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var l=lr();r=Ns(l);var d=As(s,r,l);d!==null&&(cr(d,s,l),cc(d,s,l)),s={cache:bp()},r.payload=s;return}s=s.return}}function Mj(r,s,l){var d=lr();l={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},$d(r)?Hb(s,l):(l=up(r,s,l,d),l!==null&&(cr(l,r,d),Bb(l,s,d)))}function $b(r,s,l){var d=lr();pc(r,s,l,d)}function pc(r,s,l,d){var p={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if($d(r))Hb(s,p);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var _=s.lastRenderedState,j=x(_,l);if(p.hasEagerState=!0,p.eagerState=j,rr(j,_))return Rd(r,s,p,0),Ft===null&&Cd(),!1}catch{}finally{}if(l=up(r,s,p,d),l!==null)return cr(l,r,d),Bb(l,s,d),!0}return!1}function Gp(r,s,l,d){if(d={lane:2,revertLane:Eg(),action:d,hasEagerState:!1,eagerState:null,next:null},$d(r)){if(s)throw Error(a(479))}else s=up(r,l,d,2),s!==null&&cr(s,r,2)}function $d(r){var s=r.alternate;return r===dt||s!==null&&s===dt}function Hb(r,s){Lo=Id=!0;var l=r.pending;l===null?s.next=s:(s.next=l.next,l.next=s),r.pending=s}function Bb(r,s,l){if((l&4194048)!==0){var d=s.lanes;d&=r.pendingLanes,l|=d,s.lanes=l,bi(r,l)}}var Hd={readContext:On,use:Fd,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useLayoutEffect:tn,useInsertionEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useSyncExternalStore:tn,useId:tn,useHostTransitionStatus:tn,useFormState:tn,useActionState:tn,useOptimistic:tn,useMemoCache:tn,useCacheRefresh:tn},Gb={readContext:On,use:Fd,useCallback:function(r,s){return Kn().memoizedState=[r,s===void 0?null:s],r},useContext:On,useEffect:Nb,useImperativeHandle:function(r,s,l){l=l!=null?l.concat([r]):null,Vd(4194308,4,Ob.bind(null,s,r),l)},useLayoutEffect:function(r,s){return Vd(4194308,4,r,s)},useInsertionEffect:function(r,s){Vd(4,2,r,s)},useMemo:function(r,s){var l=Kn();s=s===void 0?null:s;var d=r();if(Mi){ht(!0);try{r()}finally{ht(!1)}}return l.memoizedState=[d,s],d},useReducer:function(r,s,l){var d=Kn();if(l!==void 0){var p=l(s);if(Mi){ht(!0);try{l(s)}finally{ht(!1)}}}else p=s;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=Mj.bind(null,dt,r),[d.memoizedState,r]},useRef:function(r){var s=Kn();return r={current:r},s.memoizedState=r},useState:function(r){r=Up(r);var s=r.queue,l=$b.bind(null,dt,s);return s.dispatch=l,[r.memoizedState,l]},useDebugValue:Vp,useDeferredValue:function(r,s){var l=Kn();return $p(l,r,s)},useTransition:function(){var r=Up(!1);return r=Pb.bind(null,dt,r.queue,!0,!1),Kn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,l){var d=dt,p=Kn();if(At){if(l===void 0)throw Error(a(407));l=l()}else{if(l=s(),Ft===null)throw Error(a(349));(wt&124)!==0||fb(d,s,l)}p.memoizedState=l;var x={value:l,getSnapshot:s};return p.queue=x,Nb(mb.bind(null,d,x,r),[r]),d.flags|=2048,Po(9,zd(),hb.bind(null,d,x,l,s),null),l},useId:function(){var r=Kn(),s=Ft.identifierPrefix;if(At){var l=Ba,d=Ha;l=(d&~(1<<32-jt(d)-1)).toString(32)+l,s="«"+s+"R"+l,l=Pd++,0<l&&(s+="H"+l.toString(32)),s+="»"}else l=Tj++,s="«"+s+"r"+l.toString(32)+"»";return r.memoizedState=s},useHostTransitionStatus:Bp,useFormState:Eb,useActionState:Eb,useOptimistic:function(r){var s=Kn();s.memoizedState=s.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=Gp.bind(null,dt,!0,l),l.dispatch=s,[r,s]},useMemoCache:Ip,useCacheRefresh:function(){return Kn().memoizedState=Oj.bind(null,dt)}},qb={readContext:On,use:Fd,useCallback:kb,useContext:On,useEffect:Ab,useImperativeHandle:Mb,useInsertionEffect:jb,useLayoutEffect:Db,useMemo:Lb,useReducer:Ud,useRef:Tb,useState:function(){return Ud(Za)},useDebugValue:Vp,useDeferredValue:function(r,s){var l=fn();return Ib(l,kt.memoizedState,r,s)},useTransition:function(){var r=Ud(Za)[0],s=fn().memoizedState;return[typeof r=="boolean"?r:hc(r),s]},useSyncExternalStore:db,useId:zb,useHostTransitionStatus:Bp,useFormState:Cb,useActionState:Cb,useOptimistic:function(r,s){var l=fn();return vb(l,kt,r,s)},useMemoCache:Ip,useCacheRefresh:Vb},kj={readContext:On,use:Fd,useCallback:kb,useContext:On,useEffect:Ab,useImperativeHandle:Mb,useInsertionEffect:jb,useLayoutEffect:Db,useMemo:Lb,useReducer:Fp,useRef:Tb,useState:function(){return Fp(Za)},useDebugValue:Vp,useDeferredValue:function(r,s){var l=fn();return kt===null?$p(l,r,s):Ib(l,kt.memoizedState,r,s)},useTransition:function(){var r=Fp(Za)[0],s=fn().memoizedState;return[typeof r=="boolean"?r:hc(r),s]},useSyncExternalStore:db,useId:zb,useHostTransitionStatus:Bp,useFormState:_b,useActionState:_b,useOptimistic:function(r,s){var l=fn();return kt!==null?vb(l,kt,r,s):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:Ip,useCacheRefresh:Vb},Fo=null,gc=0;function Bd(r){var s=gc;return gc+=1,Fo===null&&(Fo=[]),rb(Fo,r,s)}function vc(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Gd(r,s){throw s.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(s),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function Zb(r){var s=r._init;return s(r._payload)}function Yb(r){function s(B,z){if(r){var K=B.deletions;K===null?(B.deletions=[z],B.flags|=16):K.push(z)}}function l(B,z){if(!r)return null;for(;z!==null;)s(B,z),z=z.sibling;return null}function d(B){for(var z=new Map;B!==null;)B.key!==null?z.set(B.key,B):z.set(B.index,B),B=B.sibling;return z}function p(B,z){return B=$a(B,z),B.index=0,B.sibling=null,B}function x(B,z,K){return B.index=K,r?(K=B.alternate,K!==null?(K=K.index,K<z?(B.flags|=67108866,z):K):(B.flags|=67108866,z)):(B.flags|=1048576,z)}function _(B){return r&&B.alternate===null&&(B.flags|=67108866),B}function j(B,z,K,de){return z===null||z.tag!==6?(z=fp(K,B.mode,de),z.return=B,z):(z=p(z,K),z.return=B,z)}function I(B,z,K,de){var ke=K.type;return ke===w?ce(B,z,K.props.children,de,K.key):z!==null&&(z.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===H&&Zb(ke)===z.type)?(z=p(z,K.props),vc(z,K),z.return=B,z):(z=Td(K.type,K.key,K.props,null,B.mode,de),vc(z,K),z.return=B,z)}function Q(B,z,K,de){return z===null||z.tag!==4||z.stateNode.containerInfo!==K.containerInfo||z.stateNode.implementation!==K.implementation?(z=hp(K,B.mode,de),z.return=B,z):(z=p(z,K.children||[]),z.return=B,z)}function ce(B,z,K,de,ke){return z===null||z.tag!==7?(z=Ri(K,B.mode,de,ke),z.return=B,z):(z=p(z,K),z.return=B,z)}function pe(B,z,K){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=fp(""+z,B.mode,K),z.return=B,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case y:return K=Td(z.type,z.key,z.props,null,B.mode,K),vc(K,z),K.return=B,K;case S:return z=hp(z,B.mode,K),z.return=B,z;case H:var de=z._init;return z=de(z._payload),pe(B,z,K)}if(ne(z)||V(z))return z=Ri(z,B.mode,K,null),z.return=B,z;if(typeof z.then=="function")return pe(B,Bd(z),K);if(z.$$typeof===N)return pe(B,Dd(B,z),K);Gd(B,z)}return null}function J(B,z,K,de){var ke=z!==null?z.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return ke!==null?null:j(B,z,""+K,de);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case y:return K.key===ke?I(B,z,K,de):null;case S:return K.key===ke?Q(B,z,K,de):null;case H:return ke=K._init,K=ke(K._payload),J(B,z,K,de)}if(ne(K)||V(K))return ke!==null?null:ce(B,z,K,de,null);if(typeof K.then=="function")return J(B,z,Bd(K),de);if(K.$$typeof===N)return J(B,z,Dd(B,K),de);Gd(B,K)}return null}function ee(B,z,K,de,ke){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return B=B.get(K)||null,j(z,B,""+de,ke);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case y:return B=B.get(de.key===null?K:de.key)||null,I(z,B,de,ke);case S:return B=B.get(de.key===null?K:de.key)||null,Q(z,B,de,ke);case H:var pt=de._init;return de=pt(de._payload),ee(B,z,K,de,ke)}if(ne(de)||V(de))return B=B.get(K)||null,ce(z,B,de,ke,null);if(typeof de.then=="function")return ee(B,z,K,Bd(de),ke);if(de.$$typeof===N)return ee(B,z,K,Dd(z,de),ke);Gd(z,de)}return null}function tt(B,z,K,de){for(var ke=null,pt=null,Ve=z,Ye=z=0,En=null;Ve!==null&&Ye<K.length;Ye++){Ve.index>Ye?(En=Ve,Ve=null):En=Ve.sibling;var Nt=J(B,Ve,K[Ye],de);if(Nt===null){Ve===null&&(Ve=En);break}r&&Ve&&Nt.alternate===null&&s(B,Ve),z=x(Nt,z,Ye),pt===null?ke=Nt:pt.sibling=Nt,pt=Nt,Ve=En}if(Ye===K.length)return l(B,Ve),At&&Ti(B,Ye),ke;if(Ve===null){for(;Ye<K.length;Ye++)Ve=pe(B,K[Ye],de),Ve!==null&&(z=x(Ve,z,Ye),pt===null?ke=Ve:pt.sibling=Ve,pt=Ve);return At&&Ti(B,Ye),ke}for(Ve=d(Ve);Ye<K.length;Ye++)En=ee(Ve,B,Ye,K[Ye],de),En!==null&&(r&&En.alternate!==null&&Ve.delete(En.key===null?Ye:En.key),z=x(En,z,Ye),pt===null?ke=En:pt.sibling=En,pt=En);return r&&Ve.forEach(function(qs){return s(B,qs)}),At&&Ti(B,Ye),ke}function Ze(B,z,K,de){if(K==null)throw Error(a(151));for(var ke=null,pt=null,Ve=z,Ye=z=0,En=null,Nt=K.next();Ve!==null&&!Nt.done;Ye++,Nt=K.next()){Ve.index>Ye?(En=Ve,Ve=null):En=Ve.sibling;var qs=J(B,Ve,Nt.value,de);if(qs===null){Ve===null&&(Ve=En);break}r&&Ve&&qs.alternate===null&&s(B,Ve),z=x(qs,z,Ye),pt===null?ke=qs:pt.sibling=qs,pt=qs,Ve=En}if(Nt.done)return l(B,Ve),At&&Ti(B,Ye),ke;if(Ve===null){for(;!Nt.done;Ye++,Nt=K.next())Nt=pe(B,Nt.value,de),Nt!==null&&(z=x(Nt,z,Ye),pt===null?ke=Nt:pt.sibling=Nt,pt=Nt);return At&&Ti(B,Ye),ke}for(Ve=d(Ve);!Nt.done;Ye++,Nt=K.next())Nt=ee(Ve,B,Ye,Nt.value,de),Nt!==null&&(r&&Nt.alternate!==null&&Ve.delete(Nt.key===null?Ye:Nt.key),z=x(Nt,z,Ye),pt===null?ke=Nt:pt.sibling=Nt,pt=Nt);return r&&Ve.forEach(function(LD){return s(B,LD)}),At&&Ti(B,Ye),ke}function It(B,z,K,de){if(typeof K=="object"&&K!==null&&K.type===w&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case y:e:{for(var ke=K.key;z!==null;){if(z.key===ke){if(ke=K.type,ke===w){if(z.tag===7){l(B,z.sibling),de=p(z,K.props.children),de.return=B,B=de;break e}}else if(z.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===H&&Zb(ke)===z.type){l(B,z.sibling),de=p(z,K.props),vc(de,K),de.return=B,B=de;break e}l(B,z);break}else s(B,z);z=z.sibling}K.type===w?(de=Ri(K.props.children,B.mode,de,K.key),de.return=B,B=de):(de=Td(K.type,K.key,K.props,null,B.mode,de),vc(de,K),de.return=B,B=de)}return _(B);case S:e:{for(ke=K.key;z!==null;){if(z.key===ke)if(z.tag===4&&z.stateNode.containerInfo===K.containerInfo&&z.stateNode.implementation===K.implementation){l(B,z.sibling),de=p(z,K.children||[]),de.return=B,B=de;break e}else{l(B,z);break}else s(B,z);z=z.sibling}de=hp(K,B.mode,de),de.return=B,B=de}return _(B);case H:return ke=K._init,K=ke(K._payload),It(B,z,K,de)}if(ne(K))return tt(B,z,K,de);if(V(K)){if(ke=V(K),typeof ke!="function")throw Error(a(150));return K=ke.call(K),Ze(B,z,K,de)}if(typeof K.then=="function")return It(B,z,Bd(K),de);if(K.$$typeof===N)return It(B,z,Dd(B,K),de);Gd(B,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,z!==null&&z.tag===6?(l(B,z.sibling),de=p(z,K),de.return=B,B=de):(l(B,z),de=fp(K,B.mode,de),de.return=B,B=de),_(B)):l(B,z)}return function(B,z,K,de){try{gc=0;var ke=It(B,z,K,de);return Fo=null,ke}catch(Ve){if(Ve===oc||Ve===Md)throw Ve;var pt=ar(29,Ve,null,B.mode);return pt.lanes=de,pt.return=B,pt}finally{}}}var Uo=Yb(!0),Kb=Yb(!1),Lr=G(null),pa=null;function Ds(r){var s=r.alternate;q(vn,vn.current&1),q(Lr,r),pa===null&&(s===null||ko.current!==null||s.memoizedState!==null)&&(pa=r)}function Qb(r){if(r.tag===22){if(q(vn,vn.current),q(Lr,r),pa===null){var s=r.alternate;s!==null&&s.memoizedState!==null&&(pa=r)}}else Os()}function Os(){q(vn,vn.current),q(Lr,Lr.current)}function Ya(r){P(Lr),pa===r&&(pa=null),P(vn)}var vn=G(0);function qd(r){for(var s=r;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||Lg(l)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function qp(r,s,l,d){s=r.memoizedState,l=l(d,s),l=l==null?s:v({},s,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var Zp={enqueueSetState:function(r,s,l){r=r._reactInternals;var d=lr(),p=Ns(d);p.payload=s,l!=null&&(p.callback=l),s=As(r,p,d),s!==null&&(cr(s,r,d),cc(s,r,d))},enqueueReplaceState:function(r,s,l){r=r._reactInternals;var d=lr(),p=Ns(d);p.tag=1,p.payload=s,l!=null&&(p.callback=l),s=As(r,p,d),s!==null&&(cr(s,r,d),cc(s,r,d))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var l=lr(),d=Ns(l);d.tag=2,s!=null&&(d.callback=s),s=As(r,d,l),s!==null&&(cr(s,r,l),cc(s,r,l))}};function Xb(r,s,l,d,p,x,_){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,x,_):s.prototype&&s.prototype.isPureReactComponent?!Jl(l,d)||!Jl(p,x):!0}function Wb(r,s,l,d){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,d),s.state!==r&&Zp.enqueueReplaceState(s,s.state,null)}function ki(r,s){var l=s;if("ref"in s){l={};for(var d in s)d!=="ref"&&(l[d]=s[d])}if(r=r.defaultProps){l===s&&(l=v({},l));for(var p in r)l[p]===void 0&&(l[p]=r[p])}return l}var Zd=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)};function Jb(r){Zd(r)}function eS(r){console.error(r)}function tS(r){Zd(r)}function Yd(r,s){try{var l=r.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function nS(r,s,l){try{var d=r.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Yp(r,s,l){return l=Ns(l),l.tag=3,l.payload={element:null},l.callback=function(){Yd(r,s)},l}function rS(r){return r=Ns(r),r.tag=3,r}function aS(r,s,l,d){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var x=d.value;r.payload=function(){return p(x)},r.callback=function(){nS(s,l,d)}}var _=l.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(r.callback=function(){nS(s,l,d),typeof p!="function"&&(Fs===null?Fs=new Set([this]):Fs.add(this));var j=d.stack;this.componentDidCatch(d.value,{componentStack:j!==null?j:""})})}function Lj(r,s,l,d,p){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=l.alternate,s!==null&&ac(s,l,p,!0),l=Lr.current,l!==null){switch(l.tag){case 13:return pa===null?yg():l.alternate===null&&Wt===0&&(Wt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,d===Ep?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([d]):s.add(d),bg(r,d,p)),!1;case 22:return l.flags|=65536,d===Ep?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([d]):l.add(d)),bg(r,d,p)),!1}throw Error(a(435,l.tag))}return bg(r,d,p),yg(),!1}if(At)return s=Lr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,d!==gp&&(r=Error(a(422),{cause:d}),rc(Dr(r,l)))):(d!==gp&&(s=Error(a(423),{cause:d}),rc(Dr(s,l))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=Dr(d,l),p=Yp(r.stateNode,d,p),_p(r,p),Wt!==4&&(Wt=2)),!1;var x=Error(a(520),{cause:d});if(x=Dr(x,l),Cc===null?Cc=[x]:Cc.push(x),Wt!==4&&(Wt=2),s===null)return!0;d=Dr(d,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,r=p&-p,l.lanes|=r,r=Yp(l.stateNode,d,r),_p(l,r),!1;case 1:if(s=l.type,x=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Fs===null||!Fs.has(x))))return l.flags|=65536,p&=-p,l.lanes|=p,p=rS(p),aS(p,r,l,d),_p(l,p),!1}l=l.return}while(l!==null);return!1}var sS=Error(a(461)),Sn=!1;function Cn(r,s,l,d){s.child=r===null?Kb(s,null,l,d):Uo(s,r.child,l,d)}function iS(r,s,l,d,p){l=l.render;var x=s.ref;if("ref"in d){var _={};for(var j in d)j!=="ref"&&(_[j]=d[j])}else _=d;return Di(s),d=Dp(r,s,l,_,x,p),j=Op(),r!==null&&!Sn?(Mp(r,s,p),Ka(r,s,p)):(At&&j&&mp(s),s.flags|=1,Cn(r,s,d,p),s.child)}function oS(r,s,l,d,p){if(r===null){var x=l.type;return typeof x=="function"&&!dp(x)&&x.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=x,lS(r,s,x,d,p)):(r=Td(l.type,null,d,s,s.mode,p),r.ref=s.ref,r.return=s,s.child=r)}if(x=r.child,!ng(r,p)){var _=x.memoizedProps;if(l=l.compare,l=l!==null?l:Jl,l(_,d)&&r.ref===s.ref)return Ka(r,s,p)}return s.flags|=1,r=$a(x,d),r.ref=s.ref,r.return=s,s.child=r}function lS(r,s,l,d,p){if(r!==null){var x=r.memoizedProps;if(Jl(x,d)&&r.ref===s.ref)if(Sn=!1,s.pendingProps=d=x,ng(r,p))(r.flags&131072)!==0&&(Sn=!0);else return s.lanes=r.lanes,Ka(r,s,p)}return Kp(r,s,l,d,p)}function cS(r,s,l){var d=s.pendingProps,p=d.children,x=r!==null?r.memoizedState:null;if(d.mode==="hidden"){if((s.flags&128)!==0){if(d=x!==null?x.baseLanes|l:l,r!==null){for(p=s.child=r.child,x=0;p!==null;)x=x|p.lanes|p.childLanes,p=p.sibling;s.childLanes=x&~d}else s.childLanes=0,s.child=null;return uS(r,s,d,l)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&Od(s,x!==null?x.cachePool:null),x!==null?lb(s,x):Np(),Qb(s);else return s.lanes=s.childLanes=536870912,uS(r,s,x!==null?x.baseLanes|l:l,l)}else x!==null?(Od(s,x.cachePool),lb(s,x),Os(),s.memoizedState=null):(r!==null&&Od(s,null),Np(),Os());return Cn(r,s,p,l),s.child}function uS(r,s,l,d){var p=wp();return p=p===null?null:{parent:gn._currentValue,pool:p},s.memoizedState={baseLanes:l,cachePool:p},r!==null&&Od(s,null),Np(),Qb(s),r!==null&&ac(r,s,d,!0),null}function Kd(r,s){var l=s.ref;if(l===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(r===null||r.ref!==l)&&(s.flags|=4194816)}}function Kp(r,s,l,d,p){return Di(s),l=Dp(r,s,l,d,void 0,p),d=Op(),r!==null&&!Sn?(Mp(r,s,p),Ka(r,s,p)):(At&&d&&mp(s),s.flags|=1,Cn(r,s,l,p),s.child)}function dS(r,s,l,d,p,x){return Di(s),s.updateQueue=null,l=ub(s,d,l,p),cb(r),d=Op(),r!==null&&!Sn?(Mp(r,s,x),Ka(r,s,x)):(At&&d&&mp(s),s.flags|=1,Cn(r,s,l,x),s.child)}function fS(r,s,l,d,p){if(Di(s),s.stateNode===null){var x=Ao,_=l.contextType;typeof _=="object"&&_!==null&&(x=On(_)),x=new l(d,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Zp,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=d,x.state=s.memoizedState,x.refs={},Cp(s),_=l.contextType,x.context=typeof _=="object"&&_!==null?On(_):Ao,x.state=s.memoizedState,_=l.getDerivedStateFromProps,typeof _=="function"&&(qp(s,l,_,d),x.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(_=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),_!==x.state&&Zp.enqueueReplaceState(x,x.state,null),dc(s,d,x,p),uc(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(r===null){x=s.stateNode;var j=s.memoizedProps,I=ki(l,j);x.props=I;var Q=x.context,ce=l.contextType;_=Ao,typeof ce=="object"&&ce!==null&&(_=On(ce));var pe=l.getDerivedStateFromProps;ce=typeof pe=="function"||typeof x.getSnapshotBeforeUpdate=="function",j=s.pendingProps!==j,ce||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(j||Q!==_)&&Wb(s,x,d,_),Ts=!1;var J=s.memoizedState;x.state=J,dc(s,d,x,p),uc(),Q=s.memoizedState,j||J!==Q||Ts?(typeof pe=="function"&&(qp(s,l,pe,d),Q=s.memoizedState),(I=Ts||Xb(s,l,I,d,J,Q,_))?(ce||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=Q),x.props=d,x.state=Q,x.context=_,d=I):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{x=s.stateNode,Rp(r,s),_=s.memoizedProps,ce=ki(l,_),x.props=ce,pe=s.pendingProps,J=x.context,Q=l.contextType,I=Ao,typeof Q=="object"&&Q!==null&&(I=On(Q)),j=l.getDerivedStateFromProps,(Q=typeof j=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(_!==pe||J!==I)&&Wb(s,x,d,I),Ts=!1,J=s.memoizedState,x.state=J,dc(s,d,x,p),uc();var ee=s.memoizedState;_!==pe||J!==ee||Ts||r!==null&&r.dependencies!==null&&jd(r.dependencies)?(typeof j=="function"&&(qp(s,l,j,d),ee=s.memoizedState),(ce=Ts||Xb(s,l,ce,d,J,ee,I)||r!==null&&r.dependencies!==null&&jd(r.dependencies))?(Q||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(d,ee,I),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(d,ee,I)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||_===r.memoizedProps&&J===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||_===r.memoizedProps&&J===r.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=ee),x.props=d,x.state=ee,x.context=I,d=ce):(typeof x.componentDidUpdate!="function"||_===r.memoizedProps&&J===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||_===r.memoizedProps&&J===r.memoizedState||(s.flags|=1024),d=!1)}return x=d,Kd(r,s),d=(s.flags&128)!==0,x||d?(x=s.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,r!==null&&d?(s.child=Uo(s,r.child,null,p),s.child=Uo(s,null,l,p)):Cn(r,s,l,p),s.memoizedState=x.state,r=s.child):r=Ka(r,s,p),r}function hS(r,s,l,d){return nc(),s.flags|=256,Cn(r,s,l,d),s.child}var Qp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xp(r){return{baseLanes:r,cachePool:eb()}}function Wp(r,s,l){return r=r!==null?r.childLanes&~l:0,s&&(r|=Ir),r}function mS(r,s,l){var d=s.pendingProps,p=!1,x=(s.flags&128)!==0,_;if((_=x)||(_=r!==null&&r.memoizedState===null?!1:(vn.current&2)!==0),_&&(p=!0,s.flags&=-129),_=(s.flags&32)!==0,s.flags&=-33,r===null){if(At){if(p?Ds(s):Os(),At){var j=Xt,I;if(I=j){e:{for(I=j,j=ma;I.nodeType!==8;){if(!j){j=null;break e}if(I=na(I.nextSibling),I===null){j=null;break e}}j=I}j!==null?(s.memoizedState={dehydrated:j,treeContext:_i!==null?{id:Ha,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},I=ar(18,null,null,0),I.stateNode=j,I.return=s,s.child=I,Un=s,Xt=null,I=!0):I=!1}I||Ai(s)}if(j=s.memoizedState,j!==null&&(j=j.dehydrated,j!==null))return Lg(j)?s.lanes=32:s.lanes=536870912,null;Ya(s)}return j=d.children,d=d.fallback,p?(Os(),p=s.mode,j=Qd({mode:"hidden",children:j},p),d=Ri(d,p,l,null),j.return=s,d.return=s,j.sibling=d,s.child=j,p=s.child,p.memoizedState=Xp(l),p.childLanes=Wp(r,_,l),s.memoizedState=Qp,d):(Ds(s),Jp(s,j))}if(I=r.memoizedState,I!==null&&(j=I.dehydrated,j!==null)){if(x)s.flags&256?(Ds(s),s.flags&=-257,s=eg(r,s,l)):s.memoizedState!==null?(Os(),s.child=r.child,s.flags|=128,s=null):(Os(),p=d.fallback,j=s.mode,d=Qd({mode:"visible",children:d.children},j),p=Ri(p,j,l,null),p.flags|=2,d.return=s,p.return=s,d.sibling=p,s.child=d,Uo(s,r.child,null,l),d=s.child,d.memoizedState=Xp(l),d.childLanes=Wp(r,_,l),s.memoizedState=Qp,s=p);else if(Ds(s),Lg(j)){if(_=j.nextSibling&&j.nextSibling.dataset,_)var Q=_.dgst;_=Q,d=Error(a(419)),d.stack="",d.digest=_,rc({value:d,source:null,stack:null}),s=eg(r,s,l)}else if(Sn||ac(r,s,l,!1),_=(l&r.childLanes)!==0,Sn||_){if(_=Ft,_!==null&&(d=l&-l,d=(d&42)!==0?1:$l(d),d=(d&(_.suspendedLanes|l))!==0?0:d,d!==0&&d!==I.retryLane))throw I.retryLane=d,No(r,d),cr(_,r,d),sS;j.data==="$?"||yg(),s=eg(r,s,l)}else j.data==="$?"?(s.flags|=192,s.child=r.child,s=null):(r=I.treeContext,Xt=na(j.nextSibling),Un=s,At=!0,Ni=null,ma=!1,r!==null&&(Mr[kr++]=Ha,Mr[kr++]=Ba,Mr[kr++]=_i,Ha=r.id,Ba=r.overflow,_i=s),s=Jp(s,d.children),s.flags|=4096);return s}return p?(Os(),p=d.fallback,j=s.mode,I=r.child,Q=I.sibling,d=$a(I,{mode:"hidden",children:d.children}),d.subtreeFlags=I.subtreeFlags&65011712,Q!==null?p=$a(Q,p):(p=Ri(p,j,l,null),p.flags|=2),p.return=s,d.return=s,d.sibling=p,s.child=d,d=p,p=s.child,j=r.child.memoizedState,j===null?j=Xp(l):(I=j.cachePool,I!==null?(Q=gn._currentValue,I=I.parent!==Q?{parent:Q,pool:Q}:I):I=eb(),j={baseLanes:j.baseLanes|l,cachePool:I}),p.memoizedState=j,p.childLanes=Wp(r,_,l),s.memoizedState=Qp,d):(Ds(s),l=r.child,r=l.sibling,l=$a(l,{mode:"visible",children:d.children}),l.return=s,l.sibling=null,r!==null&&(_=s.deletions,_===null?(s.deletions=[r],s.flags|=16):_.push(r)),s.child=l,s.memoizedState=null,l)}function Jp(r,s){return s=Qd({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function Qd(r,s){return r=ar(22,r,null,s),r.lanes=0,r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},r}function eg(r,s,l){return Uo(s,r.child,null,l),r=Jp(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function pS(r,s,l){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s),yp(r.return,s,l)}function tg(r,s,l,d,p){var x=r.memoizedState;x===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:p}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=d,x.tail=l,x.tailMode=p)}function gS(r,s,l){var d=s.pendingProps,p=d.revealOrder,x=d.tail;if(Cn(r,s,d.children,l),d=vn.current,(d&2)!==0)d=d&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&pS(r,l,s);else if(r.tag===19)pS(r,l,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}d&=1}switch(q(vn,d),p){case"forwards":for(l=s.child,p=null;l!==null;)r=l.alternate,r!==null&&qd(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=s.child,s.child=null):(p=l.sibling,l.sibling=null),tg(s,!1,p,l,x);break;case"backwards":for(l=null,p=s.child,s.child=null;p!==null;){if(r=p.alternate,r!==null&&qd(r)===null){s.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}tg(s,!0,l,null,x);break;case"together":tg(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Ka(r,s,l){if(r!==null&&(s.dependencies=r.dependencies),Ps|=s.lanes,(l&s.childLanes)===0)if(r!==null){if(ac(r,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(a(153));if(s.child!==null){for(r=s.child,l=$a(r,r.pendingProps),s.child=l,l.return=s;r.sibling!==null;)r=r.sibling,l=l.sibling=$a(r,r.pendingProps),l.return=s;l.sibling=null}return s.child}function ng(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&jd(r)))}function Ij(r,s,l){switch(s.tag){case 3:_e(s,s.stateNode.containerInfo),_s(s,gn,r.memoizedState.cache),nc();break;case 27:case 5:Te(s);break;case 4:_e(s,s.stateNode.containerInfo);break;case 10:_s(s,s.type,s.memoizedProps.value);break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(Ds(s),s.flags|=128,null):(l&s.child.childLanes)!==0?mS(r,s,l):(Ds(s),r=Ka(r,s,l),r!==null?r.sibling:null);Ds(s);break;case 19:var p=(r.flags&128)!==0;if(d=(l&s.childLanes)!==0,d||(ac(r,s,l,!1),d=(l&s.childLanes)!==0),p){if(d)return gS(r,s,l);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),q(vn,vn.current),d)break;return null;case 22:case 23:return s.lanes=0,cS(r,s,l);case 24:_s(s,gn,r.memoizedState.cache)}return Ka(r,s,l)}function vS(r,s,l){if(r!==null)if(r.memoizedProps!==s.pendingProps)Sn=!0;else{if(!ng(r,l)&&(s.flags&128)===0)return Sn=!1,Ij(r,s,l);Sn=(r.flags&131072)!==0}else Sn=!1,At&&(s.flags&1048576)!==0&&Z0(s,Ad,s.index);switch(s.lanes=0,s.tag){case 16:e:{r=s.pendingProps;var d=s.elementType,p=d._init;if(d=p(d._payload),s.type=d,typeof d=="function")dp(d)?(r=ki(d,r),s.tag=1,s=fS(null,s,d,r,l)):(s.tag=0,s=Kp(null,s,d,r,l));else{if(d!=null){if(p=d.$$typeof,p===O){s.tag=11,s=iS(null,s,d,r,l);break e}else if(p===L){s.tag=14,s=oS(null,s,d,r,l);break e}}throw s=ue(d)||d,Error(a(306,s,""))}}return s;case 0:return Kp(r,s,s.type,s.pendingProps,l);case 1:return d=s.type,p=ki(d,s.pendingProps),fS(r,s,d,p,l);case 3:e:{if(_e(s,s.stateNode.containerInfo),r===null)throw Error(a(387));d=s.pendingProps;var x=s.memoizedState;p=x.element,Rp(r,s),dc(s,d,null,l);var _=s.memoizedState;if(d=_.cache,_s(s,gn,d),d!==x.cache&&xp(s,[gn],l,!0),uc(),d=_.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:_.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=hS(r,s,d,l);break e}else if(d!==p){p=Dr(Error(a(424)),s),rc(p),s=hS(r,s,d,l);break e}else{switch(r=s.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Xt=na(r.firstChild),Un=s,At=!0,Ni=null,ma=!0,l=Kb(s,null,d,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(nc(),d===p){s=Ka(r,s,l);break e}Cn(r,s,d,l)}s=s.child}return s;case 26:return Kd(r,s),r===null?(l=Sw(s.type,null,s.pendingProps,null))?s.memoizedState=l:At||(l=s.type,r=s.pendingProps,d=df(ve.current).createElement(l),d[ge]=s,d[we]=r,_n(d,l,r),Tt(d),s.stateNode=d):s.memoizedState=Sw(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return Te(s),r===null&&At&&(d=s.stateNode=yw(s.type,s.pendingProps,ve.current),Un=s,ma=!0,p=Xt,Vs(s.type)?(Ig=p,Xt=na(d.firstChild)):Xt=p),Cn(r,s,s.pendingProps.children,l),Kd(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&At&&((p=d=Xt)&&(d=uD(d,s.type,s.pendingProps,ma),d!==null?(s.stateNode=d,Un=s,Xt=na(d.firstChild),ma=!1,p=!0):p=!1),p||Ai(s)),Te(s),p=s.type,x=s.pendingProps,_=r!==null?r.memoizedProps:null,d=x.children,Og(p,x)?d=null:_!==null&&Og(p,_)&&(s.flags|=32),s.memoizedState!==null&&(p=Dp(r,s,Nj,null,null,l),Mc._currentValue=p),Kd(r,s),Cn(r,s,d,l),s.child;case 6:return r===null&&At&&((r=l=Xt)&&(l=dD(l,s.pendingProps,ma),l!==null?(s.stateNode=l,Un=s,Xt=null,r=!0):r=!1),r||Ai(s)),null;case 13:return mS(r,s,l);case 4:return _e(s,s.stateNode.containerInfo),d=s.pendingProps,r===null?s.child=Uo(s,null,d,l):Cn(r,s,d,l),s.child;case 11:return iS(r,s,s.type,s.pendingProps,l);case 7:return Cn(r,s,s.pendingProps,l),s.child;case 8:return Cn(r,s,s.pendingProps.children,l),s.child;case 12:return Cn(r,s,s.pendingProps.children,l),s.child;case 10:return d=s.pendingProps,_s(s,s.type,d.value),Cn(r,s,d.children,l),s.child;case 9:return p=s.type._context,d=s.pendingProps.children,Di(s),p=On(p),d=d(p),s.flags|=1,Cn(r,s,d,l),s.child;case 14:return oS(r,s,s.type,s.pendingProps,l);case 15:return lS(r,s,s.type,s.pendingProps,l);case 19:return gS(r,s,l);case 31:return d=s.pendingProps,l=s.mode,d={mode:d.mode,children:d.children},r===null?(l=Qd(d,l),l.ref=s.ref,s.child=l,l.return=s,s=l):(l=$a(r.child,d),l.ref=s.ref,s.child=l,l.return=s,s=l),s;case 22:return cS(r,s,l);case 24:return Di(s),d=On(gn),r===null?(p=wp(),p===null&&(p=Ft,x=bp(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=l),p=x),s.memoizedState={parent:d,cache:p},Cp(s),_s(s,gn,p)):((r.lanes&l)!==0&&(Rp(r,s),dc(s,null,null,l),uc()),p=r.memoizedState,x=s.memoizedState,p.parent!==d?(p={parent:d,cache:d},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),_s(s,gn,d)):(d=x.cache,_s(s,gn,d),d!==p.cache&&xp(s,[gn],l,!0))),Cn(r,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(a(156,s.tag))}function Qa(r){r.flags|=4}function yS(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!_w(s)){if(s=Lr.current,s!==null&&((wt&4194048)===wt?pa!==null:(wt&62914560)!==wt&&(wt&536870912)===0||s!==pa))throw lc=Ep,tb;r.flags|=8192}}function Xd(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?hd():536870912,r.lanes|=s,Ho|=s)}function yc(r,s){if(!At)switch(r.tailMode){case"hidden":s=r.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Qt(r){var s=r.alternate!==null&&r.alternate.child===r.child,l=0,d=0;if(s)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=l,s}function Pj(r,s,l){var d=s.pendingProps;switch(pp(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(s),null;case 1:return Qt(s),null;case 3:return l=s.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),qa(gn),be(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(tc(s)?Qa(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Q0())),Qt(s),null;case 26:return l=s.memoizedState,r===null?(Qa(s),l!==null?(Qt(s),yS(s,l)):(Qt(s),s.flags&=-16777217)):l?l!==r.memoizedState?(Qa(s),Qt(s),yS(s,l)):(Qt(s),s.flags&=-16777217):(r.memoizedProps!==d&&Qa(s),Qt(s),s.flags&=-16777217),null;case 27:Me(s),l=ve.current;var p=s.type;if(r!==null&&s.stateNode!=null)r.memoizedProps!==d&&Qa(s);else{if(!d){if(s.stateNode===null)throw Error(a(166));return Qt(s),null}r=ie.current,tc(s)?Y0(s):(r=yw(p,d,l),s.stateNode=r,Qa(s))}return Qt(s),null;case 5:if(Me(s),l=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==d&&Qa(s);else{if(!d){if(s.stateNode===null)throw Error(a(166));return Qt(s),null}if(r=ie.current,tc(s))Y0(s);else{switch(p=df(ve.current),r){case 1:r=p.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:r=p.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":r=p.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":r=p.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":r=p.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof d.is=="string"?p.createElement("select",{is:d.is}):p.createElement("select"),d.multiple?r.multiple=!0:d.size&&(r.size=d.size);break;default:r=typeof d.is=="string"?p.createElement(l,{is:d.is}):p.createElement(l)}}r[ge]=s,r[we]=d;e:for(p=s.child;p!==null;){if(p.tag===5||p.tag===6)r.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===s)break e;for(;p.sibling===null;){if(p.return===null||p.return===s)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}s.stateNode=r;e:switch(_n(r,l,d),l){case"button":case"input":case"select":case"textarea":r=!!d.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Qa(s)}}return Qt(s),s.flags&=-16777217,null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==d&&Qa(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(a(166));if(r=ve.current,tc(s)){if(r=s.stateNode,l=s.memoizedProps,d=null,p=Un,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[ge]=s,r=!!(r.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||dw(r.nodeValue,l)),r||Ai(s)}else r=df(r).createTextNode(d),r[ge]=s,s.stateNode=r}return Qt(s),null;case 13:if(d=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=tc(s),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[ge]=s}else nc(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Qt(s),p=!1}else p=Q0(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(Ya(s),s):(Ya(s),null)}if(Ya(s),(s.flags&128)!==0)return s.lanes=l,s;if(l=d!==null,r=r!==null&&r.memoizedState!==null,l){d=s.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool);var x=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(x=d.memoizedState.cachePool.pool),x!==p&&(d.flags|=2048)}return l!==r&&l&&(s.child.flags|=8192),Xd(s,s.updateQueue),Qt(s),null;case 4:return be(),r===null&&Tg(s.stateNode.containerInfo),Qt(s),null;case 10:return qa(s.type),Qt(s),null;case 19:if(P(vn),p=s.memoizedState,p===null)return Qt(s),null;if(d=(s.flags&128)!==0,x=p.rendering,x===null)if(d)yc(p,!1);else{if(Wt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(x=qd(r),x!==null){for(s.flags|=128,yc(p,!1),r=x.updateQueue,s.updateQueue=r,Xd(s,r),s.subtreeFlags=0,r=l,l=s.child;l!==null;)q0(l,r),l=l.sibling;return q(vn,vn.current&1|2),s.child}r=r.sibling}p.tail!==null&&en()>ef&&(s.flags|=128,d=!0,yc(p,!1),s.lanes=4194304)}else{if(!d)if(r=qd(x),r!==null){if(s.flags|=128,d=!0,r=r.updateQueue,s.updateQueue=r,Xd(s,r),yc(p,!0),p.tail===null&&p.tailMode==="hidden"&&!x.alternate&&!At)return Qt(s),null}else 2*en()-p.renderingStartTime>ef&&l!==536870912&&(s.flags|=128,d=!0,yc(p,!1),s.lanes=4194304);p.isBackwards?(x.sibling=s.child,s.child=x):(r=p.last,r!==null?r.sibling=x:s.child=x,p.last=x)}return p.tail!==null?(s=p.tail,p.rendering=s,p.tail=s.sibling,p.renderingStartTime=en(),s.sibling=null,r=vn.current,q(vn,d?r&1|2:r&1),s):(Qt(s),null);case 22:case 23:return Ya(s),Ap(),d=s.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(l&536870912)!==0&&(s.flags&128)===0&&(Qt(s),s.subtreeFlags&6&&(s.flags|=8192)):Qt(s),l=s.updateQueue,l!==null&&Xd(s,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==l&&(s.flags|=2048),r!==null&&P(Oi),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),qa(gn),Qt(s),null;case 25:return null;case 30:return null}throw Error(a(156,s.tag))}function Fj(r,s){switch(pp(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return qa(gn),be(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return Me(s),null;case 13:if(Ya(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(a(340));nc()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return P(vn),null;case 4:return be(),null;case 10:return qa(s.type),null;case 22:case 23:return Ya(s),Ap(),r!==null&&P(Oi),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return qa(gn),null;case 25:return null;default:return null}}function xS(r,s){switch(pp(s),s.tag){case 3:qa(gn),be();break;case 26:case 27:case 5:Me(s);break;case 4:be();break;case 13:Ya(s);break;case 19:P(vn);break;case 10:qa(s.type);break;case 22:case 23:Ya(s),Ap(),r!==null&&P(Oi);break;case 24:qa(gn)}}function xc(r,s){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var p=d.next;l=p;do{if((l.tag&r)===r){d=void 0;var x=l.create,_=l.inst;d=x(),_.destroy=d}l=l.next}while(l!==p)}}catch(j){Pt(s,s.return,j)}}function Ms(r,s,l){try{var d=s.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var x=p.next;d=x;do{if((d.tag&r)===r){var _=d.inst,j=_.destroy;if(j!==void 0){_.destroy=void 0,p=s;var I=l,Q=j;try{Q()}catch(ce){Pt(p,I,ce)}}}d=d.next}while(d!==x)}}catch(ce){Pt(s,s.return,ce)}}function bS(r){var s=r.updateQueue;if(s!==null){var l=r.stateNode;try{ob(s,l)}catch(d){Pt(r,r.return,d)}}}function SS(r,s,l){l.props=ki(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(d){Pt(r,s,d)}}function bc(r,s){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof l=="function"?r.refCleanup=l(d):l.current=d}}catch(p){Pt(r,s,p)}}function ga(r,s){var l=r.ref,d=r.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(p){Pt(r,s,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){Pt(r,s,p)}else l.current=null}function wS(r){var s=r.type,l=r.memoizedProps,d=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(p){Pt(r,r.return,p)}}function rg(r,s,l){try{var d=r.stateNode;sD(d,r.type,l,s),d[we]=s}catch(p){Pt(r,r.return,p)}}function ES(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Vs(r.type)||r.tag===4}function ag(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||ES(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Vs(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function sg(r,s,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(r),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=uf));else if(d!==4&&(d===27&&Vs(r.type)&&(l=r.stateNode,s=null),r=r.child,r!==null))for(sg(r,s,l),r=r.sibling;r!==null;)sg(r,s,l),r=r.sibling}function Wd(r,s,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,s?l.insertBefore(r,s):l.appendChild(r);else if(d!==4&&(d===27&&Vs(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(Wd(r,s,l),r=r.sibling;r!==null;)Wd(r,s,l),r=r.sibling}function CS(r){var s=r.stateNode,l=r.memoizedProps;try{for(var d=r.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);_n(s,d,l),s[ge]=r,s[we]=l}catch(x){Pt(r,r.return,x)}}var Xa=!1,nn=!1,ig=!1,RS=typeof WeakSet=="function"?WeakSet:Set,wn=null;function Uj(r,s){if(r=r.containerInfo,jg=vf,r=I0(r),ap(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var p=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{l.nodeType,x.nodeType}catch{l=null;break e}var _=0,j=-1,I=-1,Q=0,ce=0,pe=r,J=null;t:for(;;){for(var ee;pe!==l||p!==0&&pe.nodeType!==3||(j=_+p),pe!==x||d!==0&&pe.nodeType!==3||(I=_+d),pe.nodeType===3&&(_+=pe.nodeValue.length),(ee=pe.firstChild)!==null;)J=pe,pe=ee;for(;;){if(pe===r)break t;if(J===l&&++Q===p&&(j=_),J===x&&++ce===d&&(I=_),(ee=pe.nextSibling)!==null)break;pe=J,J=pe.parentNode}pe=ee}l=j===-1||I===-1?null:{start:j,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(Dg={focusedElem:r,selectionRange:l},vf=!1,wn=s;wn!==null;)if(s=wn,r=s.child,(s.subtreeFlags&1024)!==0&&r!==null)r.return=s,wn=r;else for(;wn!==null;){switch(s=wn,x=s.alternate,r=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if((r&1024)!==0&&x!==null){r=void 0,l=s,p=x.memoizedProps,x=x.memoizedState,d=l.stateNode;try{var tt=ki(l.type,p,l.elementType===l.type);r=d.getSnapshotBeforeUpdate(tt,x),d.__reactInternalSnapshotBeforeUpdate=r}catch(Ze){Pt(l,l.return,Ze)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,l=r.nodeType,l===9)kg(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":kg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=s.sibling,r!==null){r.return=s.return,wn=r;break}wn=s.return}}function _S(r,s,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:ks(r,l),d&4&&xc(5,l);break;case 1:if(ks(r,l),d&4)if(r=l.stateNode,s===null)try{r.componentDidMount()}catch(_){Pt(l,l.return,_)}else{var p=ki(l.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(p,s,r.__reactInternalSnapshotBeforeUpdate)}catch(_){Pt(l,l.return,_)}}d&64&&bS(l),d&512&&bc(l,l.return);break;case 3:if(ks(r,l),d&64&&(r=l.updateQueue,r!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{ob(r,s)}catch(_){Pt(l,l.return,_)}}break;case 27:s===null&&d&4&&CS(l);case 26:case 5:ks(r,l),s===null&&d&4&&wS(l),d&512&&bc(l,l.return);break;case 12:ks(r,l);break;case 13:ks(r,l),d&4&&AS(r,l),d&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=Yj.bind(null,l),fD(r,l))));break;case 22:if(d=l.memoizedState!==null||Xa,!d){s=s!==null&&s.memoizedState!==null||nn,p=Xa;var x=nn;Xa=d,(nn=s)&&!x?Ls(r,l,(l.subtreeFlags&8772)!==0):ks(r,l),Xa=p,nn=x}break;case 30:break;default:ks(r,l)}}function TS(r){var s=r.alternate;s!==null&&(r.alternate=null,TS(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&ze(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var qt=null,Qn=!1;function Wa(r,s,l){for(l=l.child;l!==null;)NS(r,s,l),l=l.sibling}function NS(r,s,l){if(Be&&typeof Be.onCommitFiberUnmount=="function")try{Be.onCommitFiberUnmount(je,l)}catch{}switch(l.tag){case 26:nn||ga(l,s),Wa(r,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:nn||ga(l,s);var d=qt,p=Qn;Vs(l.type)&&(qt=l.stateNode,Qn=!1),Wa(r,s,l),Ac(l.stateNode),qt=d,Qn=p;break;case 5:nn||ga(l,s);case 6:if(d=qt,p=Qn,qt=null,Wa(r,s,l),qt=d,Qn=p,qt!==null)if(Qn)try{(qt.nodeType===9?qt.body:qt.nodeName==="HTML"?qt.ownerDocument.body:qt).removeChild(l.stateNode)}catch(x){Pt(l,s,x)}else try{qt.removeChild(l.stateNode)}catch(x){Pt(l,s,x)}break;case 18:qt!==null&&(Qn?(r=qt,gw(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),Pc(r)):gw(qt,l.stateNode));break;case 4:d=qt,p=Qn,qt=l.stateNode.containerInfo,Qn=!0,Wa(r,s,l),qt=d,Qn=p;break;case 0:case 11:case 14:case 15:nn||Ms(2,l,s),nn||Ms(4,l,s),Wa(r,s,l);break;case 1:nn||(ga(l,s),d=l.stateNode,typeof d.componentWillUnmount=="function"&&SS(l,s,d)),Wa(r,s,l);break;case 21:Wa(r,s,l);break;case 22:nn=(d=nn)||l.memoizedState!==null,Wa(r,s,l),nn=d;break;default:Wa(r,s,l)}}function AS(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Pc(r)}catch(l){Pt(s,s.return,l)}}function zj(r){switch(r.tag){case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new RS),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new RS),s;default:throw Error(a(435,r.tag))}}function og(r,s){var l=zj(r);s.forEach(function(d){var p=Kj.bind(null,r,d);l.has(d)||(l.add(d),d.then(p,p))})}function sr(r,s){var l=s.deletions;if(l!==null)for(var d=0;d<l.length;d++){var p=l[d],x=r,_=s,j=_;e:for(;j!==null;){switch(j.tag){case 27:if(Vs(j.type)){qt=j.stateNode,Qn=!1;break e}break;case 5:qt=j.stateNode,Qn=!1;break e;case 3:case 4:qt=j.stateNode.containerInfo,Qn=!0;break e}j=j.return}if(qt===null)throw Error(a(160));NS(x,_,p),qt=null,Qn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)jS(s,r),s=s.sibling}var ta=null;function jS(r,s){var l=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:sr(s,r),ir(r),d&4&&(Ms(3,r,r.return),xc(3,r),Ms(5,r,r.return));break;case 1:sr(s,r),ir(r),d&512&&(nn||l===null||ga(l,l.return)),d&64&&Xa&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var p=ta;if(sr(s,r),ir(r),d&512&&(nn||l===null||ga(l,l.return)),d&4){var x=l!==null?l.memoizedState:null;if(d=r.memoizedState,l===null)if(d===null)if(r.stateNode===null){e:{d=r.type,l=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":x=p.getElementsByTagName("title")[0],(!x||x[Je]||x[ge]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(d),p.head.insertBefore(x,p.querySelector("head > title"))),_n(x,d,l),x[ge]=r,Tt(x),d=x;break e;case"link":var _=Cw("link","href",p).get(d+(l.href||""));if(_){for(var j=0;j<_.length;j++)if(x=_[j],x.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&x.getAttribute("rel")===(l.rel==null?null:l.rel)&&x.getAttribute("title")===(l.title==null?null:l.title)&&x.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){_.splice(j,1);break t}}x=p.createElement(d),_n(x,d,l),p.head.appendChild(x);break;case"meta":if(_=Cw("meta","content",p).get(d+(l.content||""))){for(j=0;j<_.length;j++)if(x=_[j],x.getAttribute("content")===(l.content==null?null:""+l.content)&&x.getAttribute("name")===(l.name==null?null:l.name)&&x.getAttribute("property")===(l.property==null?null:l.property)&&x.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&x.getAttribute("charset")===(l.charSet==null?null:l.charSet)){_.splice(j,1);break t}}x=p.createElement(d),_n(x,d,l),p.head.appendChild(x);break;default:throw Error(a(468,d))}x[ge]=r,Tt(x),d=x}r.stateNode=d}else Rw(p,r.type,r.stateNode);else r.stateNode=Ew(p,d,r.memoizedProps);else x!==d?(x===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):x.count--,d===null?Rw(p,r.type,r.stateNode):Ew(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&rg(r,r.memoizedProps,l.memoizedProps)}break;case 27:sr(s,r),ir(r),d&512&&(nn||l===null||ga(l,l.return)),l!==null&&d&4&&rg(r,r.memoizedProps,l.memoizedProps);break;case 5:if(sr(s,r),ir(r),d&512&&(nn||l===null||ga(l,l.return)),r.flags&32){p=r.stateNode;try{So(p,"")}catch(ee){Pt(r,r.return,ee)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,rg(r,p,l!==null?l.memoizedProps:p)),d&1024&&(ig=!0);break;case 6:if(sr(s,r),ir(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,l=r.stateNode;try{l.nodeValue=d}catch(ee){Pt(r,r.return,ee)}}break;case 3:if(mf=null,p=ta,ta=ff(s.containerInfo),sr(s,r),ta=p,ir(r),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Pc(s.containerInfo)}catch(ee){Pt(r,r.return,ee)}ig&&(ig=!1,DS(r));break;case 4:d=ta,ta=ff(r.stateNode.containerInfo),sr(s,r),ir(r),ta=d;break;case 12:sr(s,r),ir(r);break;case 13:sr(s,r),ir(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(hg=en()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,og(r,d)));break;case 22:p=r.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,Q=Xa,ce=nn;if(Xa=Q||p,nn=ce||I,sr(s,r),nn=ce,Xa=Q,ir(r),d&8192)e:for(s=r.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(l===null||I||Xa||nn||Li(r)),l=null,s=r;;){if(s.tag===5||s.tag===26){if(l===null){I=l=s;try{if(x=I.stateNode,p)_=x.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{j=I.stateNode;var pe=I.memoizedProps.style,J=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;j.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(ee){Pt(I,I.return,ee)}}}else if(s.tag===6){if(l===null){I=s;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(ee){Pt(I,I.return,ee)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}d&4&&(d=r.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,og(r,l))));break;case 19:sr(s,r),ir(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,og(r,d)));break;case 30:break;case 21:break;default:sr(s,r),ir(r)}}function ir(r){var s=r.flags;if(s&2){try{for(var l,d=r.return;d!==null;){if(ES(d)){l=d;break}d=d.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,x=ag(r);Wd(r,x,p);break;case 5:var _=l.stateNode;l.flags&32&&(So(_,""),l.flags&=-33);var j=ag(r);Wd(r,j,_);break;case 3:case 4:var I=l.stateNode.containerInfo,Q=ag(r);sg(r,Q,I);break;default:throw Error(a(161))}}catch(ce){Pt(r,r.return,ce)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function DS(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;DS(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function ks(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)_S(r,s.alternate,s),s=s.sibling}function Li(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:Ms(4,s,s.return),Li(s);break;case 1:ga(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&SS(s,s.return,l),Li(s);break;case 27:Ac(s.stateNode);case 26:case 5:ga(s,s.return),Li(s);break;case 22:s.memoizedState===null&&Li(s);break;case 30:Li(s);break;default:Li(s)}r=r.sibling}}function Ls(r,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,p=r,x=s,_=x.flags;switch(x.tag){case 0:case 11:case 15:Ls(p,x,l),xc(4,x);break;case 1:if(Ls(p,x,l),d=x,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Q){Pt(d,d.return,Q)}if(d=x,p=d.updateQueue,p!==null){var j=d.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)ib(I[p],j)}catch(Q){Pt(d,d.return,Q)}}l&&_&64&&bS(x),bc(x,x.return);break;case 27:CS(x);case 26:case 5:Ls(p,x,l),l&&d===null&&_&4&&wS(x),bc(x,x.return);break;case 12:Ls(p,x,l);break;case 13:Ls(p,x,l),l&&_&4&&AS(p,x);break;case 22:x.memoizedState===null&&Ls(p,x,l),bc(x,x.return);break;case 30:break;default:Ls(p,x,l)}s=s.sibling}}function lg(r,s){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&sc(l))}function cg(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&sc(r))}function va(r,s,l,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)OS(r,s,l,d),s=s.sibling}function OS(r,s,l,d){var p=s.flags;switch(s.tag){case 0:case 11:case 15:va(r,s,l,d),p&2048&&xc(9,s);break;case 1:va(r,s,l,d);break;case 3:va(r,s,l,d),p&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&sc(r)));break;case 12:if(p&2048){va(r,s,l,d),r=s.stateNode;try{var x=s.memoizedProps,_=x.id,j=x.onPostCommit;typeof j=="function"&&j(_,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(I){Pt(s,s.return,I)}}else va(r,s,l,d);break;case 13:va(r,s,l,d);break;case 23:break;case 22:x=s.stateNode,_=s.alternate,s.memoizedState!==null?x._visibility&2?va(r,s,l,d):Sc(r,s):x._visibility&2?va(r,s,l,d):(x._visibility|=2,zo(r,s,l,d,(s.subtreeFlags&10256)!==0)),p&2048&&lg(_,s);break;case 24:va(r,s,l,d),p&2048&&cg(s.alternate,s);break;default:va(r,s,l,d)}}function zo(r,s,l,d,p){for(p=p&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var x=r,_=s,j=l,I=d,Q=_.flags;switch(_.tag){case 0:case 11:case 15:zo(x,_,j,I,p),xc(8,_);break;case 23:break;case 22:var ce=_.stateNode;_.memoizedState!==null?ce._visibility&2?zo(x,_,j,I,p):Sc(x,_):(ce._visibility|=2,zo(x,_,j,I,p)),p&&Q&2048&&lg(_.alternate,_);break;case 24:zo(x,_,j,I,p),p&&Q&2048&&cg(_.alternate,_);break;default:zo(x,_,j,I,p)}s=s.sibling}}function Sc(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=r,d=s,p=d.flags;switch(d.tag){case 22:Sc(l,d),p&2048&&lg(d.alternate,d);break;case 24:Sc(l,d),p&2048&&cg(d.alternate,d);break;default:Sc(l,d)}s=s.sibling}}var wc=8192;function Vo(r){if(r.subtreeFlags&wc)for(r=r.child;r!==null;)MS(r),r=r.sibling}function MS(r){switch(r.tag){case 26:Vo(r),r.flags&wc&&r.memoizedState!==null&&RD(ta,r.memoizedState,r.memoizedProps);break;case 5:Vo(r);break;case 3:case 4:var s=ta;ta=ff(r.stateNode.containerInfo),Vo(r),ta=s;break;case 22:r.memoizedState===null&&(s=r.alternate,s!==null&&s.memoizedState!==null?(s=wc,wc=16777216,Vo(r),wc=s):Vo(r));break;default:Vo(r)}}function kS(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function Ec(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];wn=d,IS(d,r)}kS(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)LS(r),r=r.sibling}function LS(r){switch(r.tag){case 0:case 11:case 15:Ec(r),r.flags&2048&&Ms(9,r,r.return);break;case 3:Ec(r);break;case 12:Ec(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,Jd(r)):Ec(r);break;default:Ec(r)}}function Jd(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];wn=d,IS(d,r)}kS(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Ms(8,s,s.return),Jd(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,Jd(s));break;default:Jd(s)}r=r.sibling}}function IS(r,s){for(;wn!==null;){var l=wn;switch(l.tag){case 0:case 11:case 15:Ms(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:sc(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,wn=d;else e:for(l=r;wn!==null;){d=wn;var p=d.sibling,x=d.return;if(TS(d),d===l){wn=null;break e}if(p!==null){p.return=x,wn=p;break e}wn=x}}}var Vj={getCacheForType:function(r){var s=On(gn),l=s.data.get(r);return l===void 0&&(l=r(),s.data.set(r,l)),l}},$j=typeof WeakMap=="function"?WeakMap:Map,Ot=0,Ft=null,vt=null,wt=0,Mt=0,or=null,Is=!1,$o=!1,ug=!1,Ja=0,Wt=0,Ps=0,Ii=0,dg=0,Ir=0,Ho=0,Cc=null,Xn=null,fg=!1,hg=0,ef=1/0,tf=null,Fs=null,Rn=0,Us=null,Bo=null,Go=0,mg=0,pg=null,PS=null,Rc=0,gg=null;function lr(){if((Ot&2)!==0&&wt!==0)return wt&-wt;if(k.T!==null){var r=Oo;return r!==0?r:Eg()}return U()}function FS(){Ir===0&&(Ir=(wt&536870912)===0||At?yo():536870912);var r=Lr.current;return r!==null&&(r.flags|=32),Ir}function cr(r,s,l){(r===Ft&&(Mt===2||Mt===9)||r.cancelPendingCommit!==null)&&(qo(r,0),zs(r,wt,Ir,!1)),yi(r,l),((Ot&2)===0||r!==Ft)&&(r===Ft&&((Ot&2)===0&&(Ii|=l),Wt===4&&zs(r,wt,Ir,!1)),ya(r))}function US(r,s,l){if((Ot&6)!==0)throw Error(a(327));var d=!l&&(s&124)===0&&(s&r.expiredLanes)===0||Tr(r,s),p=d?Gj(r,s):xg(r,s,!0),x=d;do{if(p===0){$o&&!d&&zs(r,s,0,!1);break}else{if(l=r.current.alternate,x&&!Hj(l)){p=xg(r,s,!1),x=!1;continue}if(p===2){if(x=s,r.errorRecoveryDisabledLanes&x)var _=0;else _=r.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){s=_;e:{var j=r;p=Cc;var I=j.current.memoizedState.isDehydrated;if(I&&(qo(j,_).flags|=256),_=xg(j,_,!1),_!==2){if(ug&&!I){j.errorRecoveryDisabledLanes|=x,Ii|=x,p=4;break e}x=Xn,Xn=p,x!==null&&(Xn===null?Xn=x:Xn.push.apply(Xn,x))}p=_}if(x=!1,p!==2)continue}}if(p===1){qo(r,0),zs(r,s,0,!0);break}e:{switch(d=r,x=p,x){case 0:case 1:throw Error(a(345));case 4:if((s&4194048)!==s)break;case 6:zs(d,s,Ir,!Is);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((s&62914560)===s&&(p=hg+300-en(),10<p)){if(zs(d,s,Ir,!Is),ha(d,0,!0)!==0)break e;d.timeoutHandle=mw(zS.bind(null,d,l,Xn,tf,fg,s,Ir,Ii,Ho,Is,x,2,-0,0),p);break e}zS(d,l,Xn,tf,fg,s,Ir,Ii,Ho,Is,x,0,-0,0)}}break}while(!0);ya(r)}function zS(r,s,l,d,p,x,_,j,I,Q,ce,pe,J,ee){if(r.timeoutHandle=-1,pe=s.subtreeFlags,(pe&8192||(pe&16785408)===16785408)&&(Oc={stylesheets:null,count:0,unsuspend:CD},MS(s),pe=_D(),pe!==null)){r.cancelPendingCommit=pe(ZS.bind(null,r,s,x,l,d,p,_,j,I,ce,1,J,ee)),zs(r,x,_,!Q);return}ZS(r,s,x,l,d,p,_,j,I)}function Hj(r){for(var s=r;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var p=l[d],x=p.getSnapshot;p=p.value;try{if(!rr(x(),p))return!1}catch{return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function zs(r,s,l,d){s&=~dg,s&=~Ii,r.suspendedLanes|=s,r.pingedLanes&=~s,d&&(r.warmLanes|=s),d=r.expirationTimes;for(var p=s;0<p;){var x=31-jt(p),_=1<<x;d[x]=-1,p&=~_}l!==0&&xi(r,l,s)}function nf(){return(Ot&6)===0?(_c(0),!1):!0}function vg(){if(vt!==null){if(Mt===0)var r=vt.return;else r=vt,Ga=ji=null,kp(r),Fo=null,gc=0,r=vt;for(;r!==null;)xS(r.alternate,r),r=r.return;vt=null}}function qo(r,s){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,oD(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),vg(),Ft=r,vt=l=$a(r.current,null),wt=s,Mt=0,or=null,Is=!1,$o=Tr(r,s),ug=!1,Ho=Ir=dg=Ii=Ps=Wt=0,Xn=Cc=null,fg=!1,(s&8)!==0&&(s|=s&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=s;0<d;){var p=31-jt(d),x=1<<p;s|=r[p],d&=~x}return Ja=s,Cd(),l}function VS(r,s){dt=null,k.H=Hd,s===oc||s===Md?(s=ab(),Mt=3):s===tb?(s=ab(),Mt=4):Mt=s===sS?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,or=s,vt===null&&(Wt=1,Yd(r,Dr(s,r.current)))}function $S(){var r=k.H;return k.H=Hd,r===null?Hd:r}function HS(){var r=k.A;return k.A=Vj,r}function yg(){Wt=4,Is||(wt&4194048)!==wt&&Lr.current!==null||($o=!0),(Ps&134217727)===0&&(Ii&134217727)===0||Ft===null||zs(Ft,wt,Ir,!1)}function xg(r,s,l){var d=Ot;Ot|=2;var p=$S(),x=HS();(Ft!==r||wt!==s)&&(tf=null,qo(r,s)),s=!1;var _=Wt;e:do try{if(Mt!==0&&vt!==null){var j=vt,I=or;switch(Mt){case 8:vg(),_=6;break e;case 3:case 2:case 9:case 6:Lr.current===null&&(s=!0);var Q=Mt;if(Mt=0,or=null,Zo(r,j,I,Q),l&&$o){_=0;break e}break;default:Q=Mt,Mt=0,or=null,Zo(r,j,I,Q)}}Bj(),_=Wt;break}catch(ce){VS(r,ce)}while(!0);return s&&r.shellSuspendCounter++,Ga=ji=null,Ot=d,k.H=p,k.A=x,vt===null&&(Ft=null,wt=0,Cd()),_}function Bj(){for(;vt!==null;)BS(vt)}function Gj(r,s){var l=Ot;Ot|=2;var d=$S(),p=HS();Ft!==r||wt!==s?(tf=null,ef=en()+500,qo(r,s)):$o=Tr(r,s);e:do try{if(Mt!==0&&vt!==null){s=vt;var x=or;t:switch(Mt){case 1:Mt=0,or=null,Zo(r,s,x,1);break;case 2:case 9:if(nb(x)){Mt=0,or=null,GS(s);break}s=function(){Mt!==2&&Mt!==9||Ft!==r||(Mt=7),ya(r)},x.then(s,s);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:nb(x)?(Mt=0,or=null,GS(s)):(Mt=0,or=null,Zo(r,s,x,7));break;case 5:var _=null;switch(vt.tag){case 26:_=vt.memoizedState;case 5:case 27:var j=vt;if(!_||_w(_)){Mt=0,or=null;var I=j.sibling;if(I!==null)vt=I;else{var Q=j.return;Q!==null?(vt=Q,rf(Q)):vt=null}break t}}Mt=0,or=null,Zo(r,s,x,5);break;case 6:Mt=0,or=null,Zo(r,s,x,6);break;case 8:vg(),Wt=6;break e;default:throw Error(a(462))}}qj();break}catch(ce){VS(r,ce)}while(!0);return Ga=ji=null,k.H=d,k.A=p,Ot=l,vt!==null?0:(Ft=null,wt=0,Cd(),Wt)}function qj(){for(;vt!==null&&!Rr();)BS(vt)}function BS(r){var s=vS(r.alternate,r,Ja);r.memoizedProps=r.pendingProps,s===null?rf(r):vt=s}function GS(r){var s=r,l=s.alternate;switch(s.tag){case 15:case 0:s=dS(l,s,s.pendingProps,s.type,void 0,wt);break;case 11:s=dS(l,s,s.pendingProps,s.type.render,s.ref,wt);break;case 5:kp(s);default:xS(l,s),s=vt=q0(s,Ja),s=vS(l,s,Ja)}r.memoizedProps=r.pendingProps,s===null?rf(r):vt=s}function Zo(r,s,l,d){Ga=ji=null,kp(s),Fo=null,gc=0;var p=s.return;try{if(Lj(r,p,s,l,wt)){Wt=1,Yd(r,Dr(l,r.current)),vt=null;return}}catch(x){if(p!==null)throw vt=p,x;Wt=1,Yd(r,Dr(l,r.current)),vt=null;return}s.flags&32768?(At||d===1?r=!0:$o||(wt&536870912)!==0?r=!1:(Is=r=!0,(d===2||d===9||d===3||d===6)&&(d=Lr.current,d!==null&&d.tag===13&&(d.flags|=16384))),qS(s,r)):rf(s)}function rf(r){var s=r;do{if((s.flags&32768)!==0){qS(s,Is);return}r=s.return;var l=Pj(s.alternate,s,Ja);if(l!==null){vt=l;return}if(s=s.sibling,s!==null){vt=s;return}vt=s=r}while(s!==null);Wt===0&&(Wt=5)}function qS(r,s){do{var l=Fj(r.alternate,r);if(l!==null){l.flags&=32767,vt=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(r=r.sibling,r!==null)){vt=r;return}vt=r=l}while(r!==null);Wt=6,vt=null}function ZS(r,s,l,d,p,x,_,j,I){r.cancelPendingCommit=null;do af();while(Rn!==0);if((Ot&6)!==0)throw Error(a(327));if(s!==null){if(s===r.current)throw Error(a(177));if(x=s.lanes|s.childLanes,x|=cp,md(r,l,x,_,j,I),r===Ft&&(vt=Ft=null,wt=0),Bo=s,Us=r,Go=l,mg=x,pg=p,PS=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Qj(W,function(){return WS(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=k.T,k.T=null,p=Z.p,Z.p=2,_=Ot,Ot|=4;try{Uj(r,s,l)}finally{Ot=_,Z.p=p,k.T=d}}Rn=1,YS(),KS(),QS()}}function YS(){if(Rn===1){Rn=0;var r=Us,s=Bo,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=k.T,k.T=null;var d=Z.p;Z.p=2;var p=Ot;Ot|=4;try{jS(s,r);var x=Dg,_=I0(r.containerInfo),j=x.focusedElem,I=x.selectionRange;if(_!==j&&j&&j.ownerDocument&&L0(j.ownerDocument.documentElement,j)){if(I!==null&&ap(j)){var Q=I.start,ce=I.end;if(ce===void 0&&(ce=Q),"selectionStart"in j)j.selectionStart=Q,j.selectionEnd=Math.min(ce,j.value.length);else{var pe=j.ownerDocument||document,J=pe&&pe.defaultView||window;if(J.getSelection){var ee=J.getSelection(),tt=j.textContent.length,Ze=Math.min(I.start,tt),It=I.end===void 0?Ze:Math.min(I.end,tt);!ee.extend&&Ze>It&&(_=It,It=Ze,Ze=_);var B=k0(j,Ze),z=k0(j,It);if(B&&z&&(ee.rangeCount!==1||ee.anchorNode!==B.node||ee.anchorOffset!==B.offset||ee.focusNode!==z.node||ee.focusOffset!==z.offset)){var K=pe.createRange();K.setStart(B.node,B.offset),ee.removeAllRanges(),Ze>It?(ee.addRange(K),ee.extend(z.node,z.offset)):(K.setEnd(z.node,z.offset),ee.addRange(K))}}}}for(pe=[],ee=j;ee=ee.parentNode;)ee.nodeType===1&&pe.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<pe.length;j++){var de=pe[j];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}vf=!!jg,Dg=jg=null}finally{Ot=p,Z.p=d,k.T=l}}r.current=s,Rn=2}}function KS(){if(Rn===2){Rn=0;var r=Us,s=Bo,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=k.T,k.T=null;var d=Z.p;Z.p=2;var p=Ot;Ot|=4;try{_S(r,s.alternate,s)}finally{Ot=p,Z.p=d,k.T=l}}Rn=3}}function QS(){if(Rn===4||Rn===3){Rn=0,Yr();var r=Us,s=Bo,l=Go,d=PS;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Rn=5:(Rn=0,Bo=Us=null,XS(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Fs=null),Hl(l),s=s.stateNode,Be&&typeof Be.onCommitFiberRoot=="function")try{Be.onCommitFiberRoot(je,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=k.T,p=Z.p,Z.p=2,k.T=null;try{for(var x=r.onRecoverableError,_=0;_<d.length;_++){var j=d[_];x(j.value,{componentStack:j.stack})}}finally{k.T=s,Z.p=p}}(Go&3)!==0&&af(),ya(r),p=r.pendingLanes,(l&4194090)!==0&&(p&42)!==0?r===gg?Rc++:(Rc=0,gg=r):Rc=0,_c(0)}}function XS(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,sc(s)))}function af(r){return YS(),KS(),QS(),WS()}function WS(){if(Rn!==5)return!1;var r=Us,s=mg;mg=0;var l=Hl(Go),d=k.T,p=Z.p;try{Z.p=32>l?32:l,k.T=null,l=pg,pg=null;var x=Us,_=Go;if(Rn=0,Bo=Us=null,Go=0,(Ot&6)!==0)throw Error(a(331));var j=Ot;if(Ot|=4,LS(x.current),OS(x,x.current,_,l),Ot=j,_c(0,!1),Be&&typeof Be.onPostCommitFiberRoot=="function")try{Be.onPostCommitFiberRoot(je,x)}catch{}return!0}finally{Z.p=p,k.T=d,XS(r,s)}}function JS(r,s,l){s=Dr(l,s),s=Yp(r.stateNode,s,2),r=As(r,s,2),r!==null&&(yi(r,2),ya(r))}function Pt(r,s,l){if(r.tag===3)JS(r,r,l);else for(;s!==null;){if(s.tag===3){JS(s,r,l);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Fs===null||!Fs.has(d))){r=Dr(l,r),l=rS(2),d=As(s,l,2),d!==null&&(aS(l,d,s,r),yi(d,2),ya(d));break}}s=s.return}}function bg(r,s,l){var d=r.pingCache;if(d===null){d=r.pingCache=new $j;var p=new Set;d.set(s,p)}else p=d.get(s),p===void 0&&(p=new Set,d.set(s,p));p.has(l)||(ug=!0,p.add(l),r=Zj.bind(null,r,s,l),s.then(r,r))}function Zj(r,s,l){var d=r.pingCache;d!==null&&d.delete(s),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,Ft===r&&(wt&l)===l&&(Wt===4||Wt===3&&(wt&62914560)===wt&&300>en()-hg?(Ot&2)===0&&qo(r,0):dg|=l,Ho===wt&&(Ho=0)),ya(r)}function ew(r,s){s===0&&(s=hd()),r=No(r,s),r!==null&&(yi(r,s),ya(r))}function Yj(r){var s=r.memoizedState,l=0;s!==null&&(l=s.retryLane),ew(r,l)}function Kj(r,s){var l=0;switch(r.tag){case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(s),ew(r,l)}function Qj(r,s){return Yt(r,s)}var sf=null,Yo=null,Sg=!1,of=!1,wg=!1,Pi=0;function ya(r){r!==Yo&&r.next===null&&(Yo===null?sf=Yo=r:Yo=Yo.next=r),of=!0,Sg||(Sg=!0,Wj())}function _c(r,s){if(!wg&&of){wg=!0;do for(var l=!1,d=sf;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var x=0;else{var _=d.suspendedLanes,j=d.pingedLanes;x=(1<<31-jt(42|r)+1)-1,x&=p&~(_&~j),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(l=!0,aw(d,x))}else x=wt,x=ha(d,d===Ft?x:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(x&3)===0||Tr(d,x)||(l=!0,aw(d,x));d=d.next}while(l);wg=!1}}function Xj(){tw()}function tw(){of=Sg=!1;var r=0;Pi!==0&&(iD()&&(r=Pi),Pi=0);for(var s=en(),l=null,d=sf;d!==null;){var p=d.next,x=nw(d,s);x===0?(d.next=null,l===null?sf=p:l.next=p,p===null&&(Yo=l)):(l=d,(r!==0||(x&3)!==0)&&(of=!0)),d=p}_c(r)}function nw(r,s){for(var l=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,x=r.pendingLanes&-62914561;0<x;){var _=31-jt(x),j=1<<_,I=p[_];I===-1?((j&l)===0||(j&d)!==0)&&(p[_]=vi(j,s)):I<=s&&(r.expiredLanes|=j),x&=~j}if(s=Ft,l=wt,l=ha(r,r===s?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,l===0||r===s&&(Mt===2||Mt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&zt(d),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||Tr(r,l)){if(s=l&-l,s===r.callbackPriority)return s;switch(d!==null&&zt(d),Hl(l)){case 2:case 8:l=F;break;case 32:l=W;break;case 268435456:l=Ce;break;default:l=W}return d=rw.bind(null,r),l=Yt(l,d),r.callbackPriority=s,r.callbackNode=l,s}return d!==null&&d!==null&&zt(d),r.callbackPriority=2,r.callbackNode=null,2}function rw(r,s){if(Rn!==0&&Rn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(af()&&r.callbackNode!==l)return null;var d=wt;return d=ha(r,r===Ft?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(US(r,d,s),nw(r,en()),r.callbackNode!=null&&r.callbackNode===l?rw.bind(null,r):null)}function aw(r,s){if(af())return null;US(r,s,!0)}function Wj(){lD(function(){(Ot&6)!==0?Yt(_r,Xj):tw()})}function Eg(){return Pi===0&&(Pi=yo()),Pi}function sw(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:vd(""+r)}function iw(r,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,r.id&&l.setAttribute("form",r.id),s.parentNode.insertBefore(l,s),r=new FormData(r),l.parentNode.removeChild(l),r}function Jj(r,s,l,d,p){if(s==="submit"&&l&&l.stateNode===p){var x=sw((p[we]||null).action),_=d.submitter;_&&(s=(s=_[we]||null)?sw(s.formAction):_.getAttribute("formAction"),s!==null&&(x=s,_=null));var j=new Sd("action","action",null,d,p);r.push({event:j,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Pi!==0){var I=_?iw(p,_):new FormData(p);Hp(l,{pending:!0,data:I,method:p.method,action:x},null,I)}}else typeof x=="function"&&(j.preventDefault(),I=_?iw(p,_):new FormData(p),Hp(l,{pending:!0,data:I,method:p.method,action:x},x,I))},currentTarget:p}]})}}for(var Cg=0;Cg<lp.length;Cg++){var Rg=lp[Cg],eD=Rg.toLowerCase(),tD=Rg[0].toUpperCase()+Rg.slice(1);ea(eD,"on"+tD)}ea(U0,"onAnimationEnd"),ea(z0,"onAnimationIteration"),ea(V0,"onAnimationStart"),ea("dblclick","onDoubleClick"),ea("focusin","onFocus"),ea("focusout","onBlur"),ea(yj,"onTransitionRun"),ea(xj,"onTransitionStart"),ea(bj,"onTransitionCancel"),ea($0,"onTransitionEnd"),Nr("onMouseEnter",["mouseout","mouseover"]),Nr("onMouseLeave",["mouseout","mouseover"]),Nr("onPointerEnter",["pointerout","pointerover"]),Nr("onPointerLeave",["pointerout","pointerover"]),Fn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tc="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(" "),nD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tc));function ow(r,s){s=(s&4)!==0;for(var l=0;l<r.length;l++){var d=r[l],p=d.event;d=d.listeners;e:{var x=void 0;if(s)for(var _=d.length-1;0<=_;_--){var j=d[_],I=j.instance,Q=j.currentTarget;if(j=j.listener,I!==x&&p.isPropagationStopped())break e;x=j,p.currentTarget=Q;try{x(p)}catch(ce){Zd(ce)}p.currentTarget=null,x=I}else for(_=0;_<d.length;_++){if(j=d[_],I=j.instance,Q=j.currentTarget,j=j.listener,I!==x&&p.isPropagationStopped())break e;x=j,p.currentTarget=Q;try{x(p)}catch(ce){Zd(ce)}p.currentTarget=null,x=I}}}}function yt(r,s){var l=s[qe];l===void 0&&(l=s[qe]=new Set);var d=r+"__bubble";l.has(d)||(lw(s,r,2,!1),l.add(d))}function _g(r,s,l){var d=0;s&&(d|=4),lw(l,r,d,s)}var lf="_reactListening"+Math.random().toString(36).slice(2);function Tg(r){if(!r[lf]){r[lf]=!0,St.forEach(function(l){l!=="selectionchange"&&(nD.has(l)||_g(l,!1,r),_g(l,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[lf]||(s[lf]=!0,_g("selectionchange",!1,s))}}function lw(r,s,l,d){switch(Ow(s)){case 2:var p=AD;break;case 8:p=jD;break;default:p=Vg}l=p.bind(null,s,l,r),p=void 0,!Km||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(s,l,{capture:!0,passive:p}):r.addEventListener(s,l,!0):p!==void 0?r.addEventListener(s,l,{passive:p}):r.addEventListener(s,l,!1)}function Ng(r,s,l,d,p){var x=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var _=d.tag;if(_===3||_===4){var j=d.stateNode.containerInfo;if(j===p)break;if(_===4)for(_=d.return;_!==null;){var I=_.tag;if((I===3||I===4)&&_.stateNode.containerInfo===p)return;_=_.return}for(;j!==null;){if(_=rt(j),_===null)return;if(I=_.tag,I===5||I===6||I===26||I===27){d=x=_;continue e}j=j.parentNode}}d=d.return}p0(function(){var Q=x,ce=Zm(l),pe=[];e:{var J=H0.get(r);if(J!==void 0){var ee=Sd,tt=r;switch(r){case"keypress":if(xd(l)===0)break e;case"keydown":case"keyup":ee=Q2;break;case"focusin":tt="focus",ee=Jm;break;case"focusout":tt="blur",ee=Jm;break;case"beforeblur":case"afterblur":ee=Jm;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=y0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=F2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=J2;break;case U0:case z0:case V0:ee=V2;break;case $0:ee=tj;break;case"scroll":case"scrollend":ee=I2;break;case"wheel":ee=rj;break;case"copy":case"cut":case"paste":ee=H2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=b0;break;case"toggle":case"beforetoggle":ee=sj}var Ze=(s&4)!==0,It=!Ze&&(r==="scroll"||r==="scrollend"),B=Ze?J!==null?J+"Capture":null:J;Ze=[];for(var z=Q,K;z!==null;){var de=z;if(K=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||K===null||B===null||(de=ql(z,B),de!=null&&Ze.push(Nc(z,de,K))),It)break;z=z.return}0<Ze.length&&(J=new ee(J,tt,null,l,ce),pe.push({event:J,listeners:Ze}))}}if((s&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",ee=r==="mouseout"||r==="pointerout",J&&l!==qm&&(tt=l.relatedTarget||l.fromElement)&&(rt(tt)||tt[Pe]))break e;if((ee||J)&&(J=ce.window===ce?ce:(J=ce.ownerDocument)?J.defaultView||J.parentWindow:window,ee?(tt=l.relatedTarget||l.toElement,ee=Q,tt=tt?rt(tt):null,tt!==null&&(It=o(tt),Ze=tt.tag,tt!==It||Ze!==5&&Ze!==27&&Ze!==6)&&(tt=null)):(ee=null,tt=Q),ee!==tt)){if(Ze=y0,de="onMouseLeave",B="onMouseEnter",z="mouse",(r==="pointerout"||r==="pointerover")&&(Ze=b0,de="onPointerLeave",B="onPointerEnter",z="pointer"),It=ee==null?J:Vt(ee),K=tt==null?J:Vt(tt),J=new Ze(de,z+"leave",ee,l,ce),J.target=It,J.relatedTarget=K,de=null,rt(ce)===Q&&(Ze=new Ze(B,z+"enter",tt,l,ce),Ze.target=K,Ze.relatedTarget=It,de=Ze),It=de,ee&&tt)t:{for(Ze=ee,B=tt,z=0,K=Ze;K;K=Ko(K))z++;for(K=0,de=B;de;de=Ko(de))K++;for(;0<z-K;)Ze=Ko(Ze),z--;for(;0<K-z;)B=Ko(B),K--;for(;z--;){if(Ze===B||B!==null&&Ze===B.alternate)break t;Ze=Ko(Ze),B=Ko(B)}Ze=null}else Ze=null;ee!==null&&cw(pe,J,ee,Ze,!1),tt!==null&&It!==null&&cw(pe,It,tt,Ze,!0)}}e:{if(J=Q?Vt(Q):window,ee=J.nodeName&&J.nodeName.toLowerCase(),ee==="select"||ee==="input"&&J.type==="file")var ke=N0;else if(_0(J))if(A0)ke=pj;else{ke=hj;var pt=fj}else ee=J.nodeName,!ee||ee.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?Q&&Gm(Q.elementType)&&(ke=N0):ke=mj;if(ke&&(ke=ke(r,Q))){T0(pe,ke,l,ce);break e}pt&&pt(r,J,Q),r==="focusout"&&Q&&J.type==="number"&&Q.memoizedProps.value!=null&&Bm(J,"number",J.value)}switch(pt=Q?Vt(Q):window,r){case"focusin":(_0(pt)||pt.contentEditable==="true")&&(Ro=pt,sp=Q,ec=null);break;case"focusout":ec=sp=Ro=null;break;case"mousedown":ip=!0;break;case"contextmenu":case"mouseup":case"dragend":ip=!1,P0(pe,l,ce);break;case"selectionchange":if(vj)break;case"keydown":case"keyup":P0(pe,l,ce)}var Ve;if(tp)e:{switch(r){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else Co?C0(r,l)&&(Ye="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ye="onCompositionStart");Ye&&(S0&&l.locale!=="ko"&&(Co||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Co&&(Ve=g0()):(Rs=ce,Qm="value"in Rs?Rs.value:Rs.textContent,Co=!0)),pt=cf(Q,Ye),0<pt.length&&(Ye=new x0(Ye,r,null,l,ce),pe.push({event:Ye,listeners:pt}),Ve?Ye.data=Ve:(Ve=R0(l),Ve!==null&&(Ye.data=Ve)))),(Ve=oj?lj(r,l):cj(r,l))&&(Ye=cf(Q,"onBeforeInput"),0<Ye.length&&(pt=new x0("onBeforeInput","beforeinput",null,l,ce),pe.push({event:pt,listeners:Ye}),pt.data=Ve)),Jj(pe,r,Q,l,ce)}ow(pe,s)})}function Nc(r,s,l){return{instance:r,listener:s,currentTarget:l}}function cf(r,s){for(var l=s+"Capture",d=[];r!==null;){var p=r,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=ql(r,l),p!=null&&d.unshift(Nc(r,p,x)),p=ql(r,s),p!=null&&d.push(Nc(r,p,x))),r.tag===3)return d;r=r.return}return[]}function Ko(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function cw(r,s,l,d,p){for(var x=s._reactName,_=[];l!==null&&l!==d;){var j=l,I=j.alternate,Q=j.stateNode;if(j=j.tag,I!==null&&I===d)break;j!==5&&j!==26&&j!==27||Q===null||(I=Q,p?(Q=ql(l,x),Q!=null&&_.unshift(Nc(l,Q,I))):p||(Q=ql(l,x),Q!=null&&_.push(Nc(l,Q,I)))),l=l.return}_.length!==0&&r.push({event:s,listeners:_})}var rD=/\r\n?/g,aD=/\u0000|\uFFFD/g;function uw(r){return(typeof r=="string"?r:""+r).replace(rD,`
|
|
49
|
+
`).replace(aD,"")}function dw(r,s){return s=uw(s),uw(r)===s}function uf(){}function Lt(r,s,l,d,p,x){switch(l){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||So(r,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&So(r,""+d);break;case"className":za(r,"class",d);break;case"tabIndex":za(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":za(r,l,d);break;case"style":h0(r,d,x);break;case"data":if(s!=="object"){za(r,"data",d);break}case"src":case"href":if(d===""&&(s!=="a"||l!=="href")){r.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(l);break}d=vd(""+d),r.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(l==="formAction"?(s!=="input"&&Lt(r,s,"name",p.name,p,null),Lt(r,s,"formEncType",p.formEncType,p,null),Lt(r,s,"formMethod",p.formMethod,p,null),Lt(r,s,"formTarget",p.formTarget,p,null)):(Lt(r,s,"encType",p.encType,p,null),Lt(r,s,"method",p.method,p,null),Lt(r,s,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(l);break}d=vd(""+d),r.setAttribute(l,d);break;case"onClick":d!=null&&(r.onclick=uf);break;case"onScroll":d!=null&&yt("scroll",r);break;case"onScrollEnd":d!=null&&yt("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}l=vd(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,""+d):r.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":d===!0?r.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,d):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(l,d):r.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(l):r.setAttribute(l,d);break;case"popover":yt("beforetoggle",r),yt("toggle",r),Ar(r,"popover",d);break;case"xlinkActuate":mt(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":mt(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":mt(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":mt(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":mt(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":mt(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":mt(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":mt(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":mt(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Ar(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=k2.get(l)||l,Ar(r,l,d))}}function Ag(r,s,l,d,p,x){switch(l){case"style":h0(r,d,x);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof d=="string"?So(r,d):(typeof d=="number"||typeof d=="bigint")&&So(r,""+d);break;case"onScroll":d!=null&&yt("scroll",r);break;case"onScrollEnd":d!=null&&yt("scrollend",r);break;case"onClick":d!=null&&(r.onclick=uf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ss.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),s=l.slice(2,p?l.length-7:void 0),x=r[we]||null,x=x!=null?x[l]:null,typeof x=="function"&&r.removeEventListener(s,x,p),typeof d=="function")){typeof x!="function"&&x!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(s,d,p);break e}l in r?r[l]=d:d===!0?r.setAttribute(l,""):Ar(r,l,d)}}}function _n(r,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",r),yt("load",r);var d=!1,p=!1,x;for(x in l)if(l.hasOwnProperty(x)){var _=l[x];if(_!=null)switch(x){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:Lt(r,s,x,_,l,null)}}p&&Lt(r,s,"srcSet",l.srcSet,l,null),d&&Lt(r,s,"src",l.src,l,null);return;case"input":yt("invalid",r);var j=x=_=p=null,I=null,Q=null;for(d in l)if(l.hasOwnProperty(d)){var ce=l[d];if(ce!=null)switch(d){case"name":p=ce;break;case"type":_=ce;break;case"checked":I=ce;break;case"defaultChecked":Q=ce;break;case"value":x=ce;break;case"defaultValue":j=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(a(137,s));break;default:Lt(r,s,d,ce,l,null)}}c0(r,x,j,I,Q,_,p,!1),pd(r);return;case"select":yt("invalid",r),d=_=x=null;for(p in l)if(l.hasOwnProperty(p)&&(j=l[p],j!=null))switch(p){case"value":x=j;break;case"defaultValue":_=j;break;case"multiple":d=j;default:Lt(r,s,p,j,l,null)}s=x,l=_,r.multiple=!!d,s!=null?bo(r,!!d,s,!1):l!=null&&bo(r,!!d,l,!0);return;case"textarea":yt("invalid",r),x=p=d=null;for(_ in l)if(l.hasOwnProperty(_)&&(j=l[_],j!=null))switch(_){case"value":d=j;break;case"defaultValue":p=j;break;case"children":x=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(91));break;default:Lt(r,s,_,j,l,null)}d0(r,d,p,x),pd(r);return;case"option":for(I in l)if(l.hasOwnProperty(I)&&(d=l[I],d!=null))switch(I){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Lt(r,s,I,d,l,null)}return;case"dialog":yt("beforetoggle",r),yt("toggle",r),yt("cancel",r),yt("close",r);break;case"iframe":case"object":yt("load",r);break;case"video":case"audio":for(d=0;d<Tc.length;d++)yt(Tc[d],r);break;case"image":yt("error",r),yt("load",r);break;case"details":yt("toggle",r);break;case"embed":case"source":case"link":yt("error",r),yt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in l)if(l.hasOwnProperty(Q)&&(d=l[Q],d!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:Lt(r,s,Q,d,l,null)}return;default:if(Gm(s)){for(ce in l)l.hasOwnProperty(ce)&&(d=l[ce],d!==void 0&&Ag(r,s,ce,d,l,void 0));return}}for(j in l)l.hasOwnProperty(j)&&(d=l[j],d!=null&&Lt(r,s,j,d,l,null))}function sD(r,s,l,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,_=null,j=null,I=null,Q=null,ce=null;for(ee in l){var pe=l[ee];if(l.hasOwnProperty(ee)&&pe!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":I=pe;default:d.hasOwnProperty(ee)||Lt(r,s,ee,null,d,pe)}}for(var J in d){var ee=d[J];if(pe=l[J],d.hasOwnProperty(J)&&(ee!=null||pe!=null))switch(J){case"type":x=ee;break;case"name":p=ee;break;case"checked":Q=ee;break;case"defaultChecked":ce=ee;break;case"value":_=ee;break;case"defaultValue":j=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,s));break;default:ee!==pe&&Lt(r,s,J,ee,d,pe)}}Hm(r,_,j,I,Q,ce,x,p);return;case"select":ee=_=j=J=null;for(x in l)if(I=l[x],l.hasOwnProperty(x)&&I!=null)switch(x){case"value":break;case"multiple":ee=I;default:d.hasOwnProperty(x)||Lt(r,s,x,null,d,I)}for(p in d)if(x=d[p],I=l[p],d.hasOwnProperty(p)&&(x!=null||I!=null))switch(p){case"value":J=x;break;case"defaultValue":j=x;break;case"multiple":_=x;default:x!==I&&Lt(r,s,p,x,d,I)}s=j,l=_,d=ee,J!=null?bo(r,!!l,J,!1):!!d!=!!l&&(s!=null?bo(r,!!l,s,!0):bo(r,!!l,l?[]:"",!1));return;case"textarea":ee=J=null;for(j in l)if(p=l[j],l.hasOwnProperty(j)&&p!=null&&!d.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Lt(r,s,j,null,d,p)}for(_ in d)if(p=d[_],x=l[_],d.hasOwnProperty(_)&&(p!=null||x!=null))switch(_){case"value":J=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==x&&Lt(r,s,_,p,d,x)}u0(r,J,ee);return;case"option":for(var tt in l)if(J=l[tt],l.hasOwnProperty(tt)&&J!=null&&!d.hasOwnProperty(tt))switch(tt){case"selected":r.selected=!1;break;default:Lt(r,s,tt,null,d,J)}for(I in d)if(J=d[I],ee=l[I],d.hasOwnProperty(I)&&J!==ee&&(J!=null||ee!=null))switch(I){case"selected":r.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:Lt(r,s,I,J,d,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ze in l)J=l[Ze],l.hasOwnProperty(Ze)&&J!=null&&!d.hasOwnProperty(Ze)&&Lt(r,s,Ze,null,d,J);for(Q in d)if(J=d[Q],ee=l[Q],d.hasOwnProperty(Q)&&J!==ee&&(J!=null||ee!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,s));break;default:Lt(r,s,Q,J,d,ee)}return;default:if(Gm(s)){for(var It in l)J=l[It],l.hasOwnProperty(It)&&J!==void 0&&!d.hasOwnProperty(It)&&Ag(r,s,It,void 0,d,J);for(ce in d)J=d[ce],ee=l[ce],!d.hasOwnProperty(ce)||J===ee||J===void 0&&ee===void 0||Ag(r,s,ce,J,d,ee);return}}for(var B in l)J=l[B],l.hasOwnProperty(B)&&J!=null&&!d.hasOwnProperty(B)&&Lt(r,s,B,null,d,J);for(pe in d)J=d[pe],ee=l[pe],!d.hasOwnProperty(pe)||J===ee||J==null&&ee==null||Lt(r,s,pe,J,d,ee)}var jg=null,Dg=null;function df(r){return r.nodeType===9?r:r.ownerDocument}function fw(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hw(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function Og(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Mg=null;function iD(){var r=window.event;return r&&r.type==="popstate"?r===Mg?!1:(Mg=r,!0):(Mg=null,!1)}var mw=typeof setTimeout=="function"?setTimeout:void 0,oD=typeof clearTimeout=="function"?clearTimeout:void 0,pw=typeof Promise=="function"?Promise:void 0,lD=typeof queueMicrotask=="function"?queueMicrotask:typeof pw<"u"?function(r){return pw.resolve(null).then(r).catch(cD)}:mw;function cD(r){setTimeout(function(){throw r})}function Vs(r){return r==="head"}function gw(r,s){var l=s,d=0,p=0;do{var x=l.nextSibling;if(r.removeChild(l),x&&x.nodeType===8)if(l=x.data,l==="/$"){if(0<d&&8>d){l=d;var _=r.ownerDocument;if(l&1&&Ac(_.documentElement),l&2&&Ac(_.body),l&4)for(l=_.head,Ac(l),_=l.firstChild;_;){var j=_.nextSibling,I=_.nodeName;_[Je]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&_.rel.toLowerCase()==="stylesheet"||l.removeChild(_),_=j}}if(p===0){r.removeChild(x),Pc(s);return}p--}else l==="$"||l==="$?"||l==="$!"?p++:d=l.charCodeAt(0)-48;else d=0;l=x}while(l);Pc(s)}function kg(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":kg(l),ze(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function uD(r,s,l,d){for(;r.nodeType===1;){var p=l;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[Je])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(x=r.getAttribute("rel"),x==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(x!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(x=r.getAttribute("src"),(x!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===x)return r}else return r;if(r=na(r.nextSibling),r===null)break}return null}function dD(r,s,l){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=na(r.nextSibling),r===null))return null;return r}function Lg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState==="complete"}function fD(r,s){var l=r.ownerDocument;if(r.data!=="$?"||l.readyState==="complete")s();else{var d=function(){s(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function na(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="F!"||s==="F")break;if(s==="/$")return null}}return r}var Ig=null;function vw(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"){if(s===0)return r;s--}else l==="/$"&&s++}r=r.previousSibling}return null}function yw(r,s,l){switch(s=df(l),r){case"html":if(r=s.documentElement,!r)throw Error(a(452));return r;case"head":if(r=s.head,!r)throw Error(a(453));return r;case"body":if(r=s.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Ac(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);ze(r)}var Pr=new Map,xw=new Set;function ff(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var es=Z.d;Z.d={f:hD,r:mD,D:pD,C:gD,L:vD,m:yD,X:bD,S:xD,M:SD};function hD(){var r=es.f(),s=nf();return r||s}function mD(r){var s=Et(r);s!==null&&s.tag===5&&s.type==="form"?Ub(s):es.r(r)}var Qo=typeof document>"u"?null:document;function bw(r,s,l){var d=Qo;if(d&&typeof s=="string"&&s){var p=jr(s);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),xw.has(p)||(xw.add(p),r={rel:r,crossOrigin:l,href:s},d.querySelector(p)===null&&(s=d.createElement("link"),_n(s,"link",r),Tt(s),d.head.appendChild(s)))}}function pD(r){es.D(r),bw("dns-prefetch",r,null)}function gD(r,s){es.C(r,s),bw("preconnect",r,s)}function vD(r,s,l){es.L(r,s,l);var d=Qo;if(d&&r&&s){var p='link[rel="preload"][as="'+jr(s)+'"]';s==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+jr(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+jr(l.imageSizes)+'"]')):p+='[href="'+jr(r)+'"]';var x=p;switch(s){case"style":x=Xo(r);break;case"script":x=Wo(r)}Pr.has(x)||(r=v({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:r,as:s},l),Pr.set(x,r),d.querySelector(p)!==null||s==="style"&&d.querySelector(jc(x))||s==="script"&&d.querySelector(Dc(x))||(s=d.createElement("link"),_n(s,"link",r),Tt(s),d.head.appendChild(s)))}}function yD(r,s){es.m(r,s);var l=Qo;if(l&&r){var d=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+jr(d)+'"][href="'+jr(r)+'"]',x=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Wo(r)}if(!Pr.has(x)&&(r=v({rel:"modulepreload",href:r},s),Pr.set(x,r),l.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Dc(x)))return}d=l.createElement("link"),_n(d,"link",r),Tt(d),l.head.appendChild(d)}}}function xD(r,s,l){es.S(r,s,l);var d=Qo;if(d&&r){var p=Kt(d).hoistableStyles,x=Xo(r);s=s||"default";var _=p.get(x);if(!_){var j={loading:0,preload:null};if(_=d.querySelector(jc(x)))j.loading=5;else{r=v({rel:"stylesheet",href:r,"data-precedence":s},l),(l=Pr.get(x))&&Pg(r,l);var I=_=d.createElement("link");Tt(I),_n(I,"link",r),I._p=new Promise(function(Q,ce){I.onload=Q,I.onerror=ce}),I.addEventListener("load",function(){j.loading|=1}),I.addEventListener("error",function(){j.loading|=2}),j.loading|=4,hf(_,s,d)}_={type:"stylesheet",instance:_,count:1,state:j},p.set(x,_)}}}function bD(r,s){es.X(r,s);var l=Qo;if(l&&r){var d=Kt(l).hoistableScripts,p=Wo(r),x=d.get(p);x||(x=l.querySelector(Dc(p)),x||(r=v({src:r,async:!0},s),(s=Pr.get(p))&&Fg(r,s),x=l.createElement("script"),Tt(x),_n(x,"link",r),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(p,x))}}function SD(r,s){es.M(r,s);var l=Qo;if(l&&r){var d=Kt(l).hoistableScripts,p=Wo(r),x=d.get(p);x||(x=l.querySelector(Dc(p)),x||(r=v({src:r,async:!0,type:"module"},s),(s=Pr.get(p))&&Fg(r,s),x=l.createElement("script"),Tt(x),_n(x,"link",r),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(p,x))}}function Sw(r,s,l,d){var p=(p=ve.current)?ff(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=Xo(l.href),l=Kt(p).hoistableStyles,d=l.get(s),d||(d={type:"style",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=Xo(l.href);var x=Kt(p).hoistableStyles,_=x.get(r);if(_||(p=p.ownerDocument||p,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(r,_),(x=p.querySelector(jc(r)))&&!x._p&&(_.instance=x,_.state.loading=5),Pr.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Pr.set(r,l),x||wD(p,r,l,_.state))),s&&d===null)throw Error(a(528,""));return _}if(s&&d!==null)throw Error(a(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wo(l),l=Kt(p).hoistableScripts,d=l.get(s),d||(d={type:"script",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Xo(r){return'href="'+jr(r)+'"'}function jc(r){return'link[rel="stylesheet"]['+r+"]"}function ww(r){return v({},r,{"data-precedence":r.precedence,precedence:null})}function wD(r,s,l,d){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=r.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),_n(s,"link",l),Tt(s),r.head.appendChild(s))}function Wo(r){return'[src="'+jr(r)+'"]'}function Dc(r){return"script[async]"+r}function Ew(r,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var d=r.querySelector('style[data-href~="'+jr(l.href)+'"]');if(d)return s.instance=d,Tt(d),d;var p=v({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),Tt(d),_n(d,"style",p),hf(d,l.precedence,r),s.instance=d;case"stylesheet":p=Xo(l.href);var x=r.querySelector(jc(p));if(x)return s.state.loading|=4,s.instance=x,Tt(x),x;d=ww(l),(p=Pr.get(p))&&Pg(d,p),x=(r.ownerDocument||r).createElement("link"),Tt(x);var _=x;return _._p=new Promise(function(j,I){_.onload=j,_.onerror=I}),_n(x,"link",d),s.state.loading|=4,hf(x,l.precedence,r),s.instance=x;case"script":return x=Wo(l.src),(p=r.querySelector(Dc(x)))?(s.instance=p,Tt(p),p):(d=l,(p=Pr.get(x))&&(d=v({},l),Fg(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),Tt(p),_n(p,"link",d),r.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(a(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,hf(d,l.precedence,r));return s.instance}function hf(r,s,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,x=p,_=0;_<d.length;_++){var j=d[_];if(j.dataset.precedence===s)x=j;else if(x!==p)break}x?x.parentNode.insertBefore(r,x.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(r,s.firstChild))}function Pg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function Fg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var mf=null;function Cw(r,s,l){if(mf===null){var d=new Map,p=mf=new Map;p.set(l,d)}else p=mf,d=p.get(l),d||(d=new Map,p.set(l,d));if(d.has(r))return d;for(d.set(r,null),l=l.getElementsByTagName(r),p=0;p<l.length;p++){var x=l[p];if(!(x[Je]||x[ge]||r==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var _=x.getAttribute(s)||"";_=r+_;var j=d.get(_);j?j.push(x):d.set(_,[x])}}return d}function Rw(r,s,l){r=r.ownerDocument||r,r.head.insertBefore(l,s==="title"?r.querySelector("head > title"):null)}function ED(r,s,l){if(l===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return r=s.disabled,typeof s.precedence=="string"&&r==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function _w(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}var Oc=null;function CD(){}function RD(r,s,l){if(Oc===null)throw Error(a(475));var d=Oc;if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=Xo(l.href),x=r.querySelector(jc(p));if(x){r=x._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(d.count++,d=pf.bind(d),r.then(d,d)),s.state.loading|=4,s.instance=x,Tt(x);return}x=r.ownerDocument||r,l=ww(l),(p=Pr.get(p))&&Pg(l,p),x=x.createElement("link"),Tt(x);var _=x;_._p=new Promise(function(j,I){_.onload=j,_.onerror=I}),_n(x,"link",l),s.instance=x}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(s,r),(r=s.state.preload)&&(s.state.loading&3)===0&&(d.count++,s=pf.bind(d),r.addEventListener("load",s),r.addEventListener("error",s))}}function _D(){if(Oc===null)throw Error(a(475));var r=Oc;return r.stylesheets&&r.count===0&&Ug(r,r.stylesheets),0<r.count?function(s){var l=setTimeout(function(){if(r.stylesheets&&Ug(r,r.stylesheets),r.unsuspend){var d=r.unsuspend;r.unsuspend=null,d()}},6e4);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(l)}}:null}function pf(){if(this.count--,this.count===0){if(this.stylesheets)Ug(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var gf=null;function Ug(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,gf=new Map,s.forEach(TD,r),gf=null,pf.call(r))}function TD(r,s){if(!(s.state.loading&4)){var l=gf.get(r);if(l)var d=l.get(null);else{l=new Map,gf.set(r,l);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var _=p[x];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(l.set(_.dataset.precedence,_),d=_)}d&&l.set(null,d)}p=s.instance,_=p.getAttribute("data-precedence"),x=l.get(_)||d,x===d&&l.set(null,p),l.set(_,p),this.count++,d=pf.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),x?x.parentNode.insertBefore(p,x.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),s.state.loading|=4}}var Mc={$$typeof:N,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function ND(r,s,l,d,p,x,_,j){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xo(0),this.hiddenUpdates=xo(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function Tw(r,s,l,d,p,x,_,j,I,Q,ce,pe){return r=new ND(r,s,l,_,j,I,Q,pe),s=1,x===!0&&(s|=24),x=ar(3,null,null,s),r.current=x,x.stateNode=r,s=bp(),s.refCount++,r.pooledCache=s,s.refCount++,x.memoizedState={element:d,isDehydrated:l,cache:s},Cp(x),r}function Nw(r){return r?(r=Ao,r):Ao}function Aw(r,s,l,d,p,x){p=Nw(p),d.context===null?d.context=p:d.pendingContext=p,d=Ns(s),d.payload={element:l},x=x===void 0?null:x,x!==null&&(d.callback=x),l=As(r,d,s),l!==null&&(cr(l,r,s),cc(l,r,s))}function jw(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<s?l:s}}function zg(r,s){jw(r,s),(r=r.alternate)&&jw(r,s)}function Dw(r){if(r.tag===13){var s=No(r,67108864);s!==null&&cr(s,r,67108864),zg(r,67108864)}}var vf=!0;function AD(r,s,l,d){var p=k.T;k.T=null;var x=Z.p;try{Z.p=2,Vg(r,s,l,d)}finally{Z.p=x,k.T=p}}function jD(r,s,l,d){var p=k.T;k.T=null;var x=Z.p;try{Z.p=8,Vg(r,s,l,d)}finally{Z.p=x,k.T=p}}function Vg(r,s,l,d){if(vf){var p=$g(d);if(p===null)Ng(r,s,d,yf,l),Mw(r,d);else if(OD(p,r,s,l,d))d.stopPropagation();else if(Mw(r,d),s&4&&-1<DD.indexOf(r)){for(;p!==null;){var x=Et(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var _=Xr(x.pendingLanes);if(_!==0){var j=x;for(j.pendingLanes|=2,j.entangledLanes|=2;_;){var I=1<<31-jt(_);j.entanglements[1]|=I,_&=~I}ya(x),(Ot&6)===0&&(ef=en()+500,_c(0))}}break;case 13:j=No(x,2),j!==null&&cr(j,x,2),nf(),zg(x,2)}if(x=$g(d),x===null&&Ng(r,s,d,yf,l),x===p)break;p=x}p!==null&&d.stopPropagation()}else Ng(r,s,d,null,l)}}function $g(r){return r=Zm(r),Hg(r)}var yf=null;function Hg(r){if(yf=null,r=rt(r),r!==null){var s=o(r);if(s===null)r=null;else{var l=s.tag;if(l===13){if(r=u(s),r!==null)return r;r=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return yf=r,null}function Ow(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(go()){case _r:return 2;case F:return 8;case W:case oe:return 32;case Ce:return 268435456;default:return 32}default:return 32}}var Bg=!1,$s=null,Hs=null,Bs=null,kc=new Map,Lc=new Map,Gs=[],DD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Mw(r,s){switch(r){case"focusin":case"focusout":$s=null;break;case"dragenter":case"dragleave":Hs=null;break;case"mouseover":case"mouseout":Bs=null;break;case"pointerover":case"pointerout":kc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lc.delete(s.pointerId)}}function Ic(r,s,l,d,p,x){return r===null||r.nativeEvent!==x?(r={blockedOn:s,domEventName:l,eventSystemFlags:d,nativeEvent:x,targetContainers:[p]},s!==null&&(s=Et(s),s!==null&&Dw(s)),r):(r.eventSystemFlags|=d,s=r.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),r)}function OD(r,s,l,d,p){switch(s){case"focusin":return $s=Ic($s,r,s,l,d,p),!0;case"dragenter":return Hs=Ic(Hs,r,s,l,d,p),!0;case"mouseover":return Bs=Ic(Bs,r,s,l,d,p),!0;case"pointerover":var x=p.pointerId;return kc.set(x,Ic(kc.get(x)||null,r,s,l,d,p)),!0;case"gotpointercapture":return x=p.pointerId,Lc.set(x,Ic(Lc.get(x)||null,r,s,l,d,p)),!0}return!1}function kw(r){var s=rt(r.target);if(s!==null){var l=o(s);if(l!==null){if(s=l.tag,s===13){if(s=u(l),s!==null){r.blockedOn=s,Y(r.priority,function(){if(l.tag===13){var d=lr();d=$l(d);var p=No(l,d);p!==null&&cr(p,l,d),zg(l,d)}});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function xf(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var l=$g(r.nativeEvent);if(l===null){l=r.nativeEvent;var d=new l.constructor(l.type,l);qm=d,l.target.dispatchEvent(d),qm=null}else return s=Et(l),s!==null&&Dw(s),r.blockedOn=l,!1;s.shift()}return!0}function Lw(r,s,l){xf(r)&&l.delete(s)}function MD(){Bg=!1,$s!==null&&xf($s)&&($s=null),Hs!==null&&xf(Hs)&&(Hs=null),Bs!==null&&xf(Bs)&&(Bs=null),kc.forEach(Lw),Lc.forEach(Lw)}function bf(r,s){r.blockedOn===s&&(r.blockedOn=null,Bg||(Bg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,MD)))}var Sf=null;function Iw(r){Sf!==r&&(Sf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Sf===r&&(Sf=null);for(var s=0;s<r.length;s+=3){var l=r[s],d=r[s+1],p=r[s+2];if(typeof d!="function"){if(Hg(d||l)===null)continue;break}var x=Et(l);x!==null&&(r.splice(s,3),s-=3,Hp(x,{pending:!0,data:p,method:l.method,action:d},d,p))}}))}function Pc(r){function s(I){return bf(I,r)}$s!==null&&bf($s,r),Hs!==null&&bf(Hs,r),Bs!==null&&bf(Bs,r),kc.forEach(s),Lc.forEach(s);for(var l=0;l<Gs.length;l++){var d=Gs[l];d.blockedOn===r&&(d.blockedOn=null)}for(;0<Gs.length&&(l=Gs[0],l.blockedOn===null);)kw(l),l.blockedOn===null&&Gs.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var p=l[d],x=l[d+1],_=p[we]||null;if(typeof x=="function")_||Iw(l);else if(_){var j=null;if(x&&x.hasAttribute("formAction")){if(p=x,_=x[we]||null)j=_.formAction;else if(Hg(p)!==null)continue}else j=_.action;typeof j=="function"?l[d+1]=j:(l.splice(d,3),d-=3),Iw(l)}}}function Gg(r){this._internalRoot=r}wf.prototype.render=Gg.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(a(409));var l=s.current,d=lr();Aw(l,d,r,s,null,null)},wf.prototype.unmount=Gg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Aw(r.current,2,null,r,null,null),nf(),s[Pe]=null}};function wf(r){this._internalRoot=r}wf.prototype.unstable_scheduleHydration=function(r){if(r){var s=U();r={blockedOn:null,target:r,priority:s};for(var l=0;l<Gs.length&&s!==0&&s<Gs[l].priority;l++);Gs.splice(l,0,r),l===0&&kw(r)}};var Pw=t.version;if(Pw!=="19.1.0")throw Error(a(527,Pw,"19.1.0"));Z.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=h(s),r=r!==null?m(r):null,r=r===null?null:r.stateNode,r};var kD={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ef=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ef.isDisabled&&Ef.supportsFiber)try{je=Ef.inject(kD),Be=Ef}catch{}}return zc.createRoot=function(r,s){if(!i(r))throw Error(a(299));var l=!1,d="",p=Jb,x=eS,_=tS,j=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(j=s.unstable_transitionCallbacks)),s=Tw(r,1,!1,null,null,l,d,p,x,_,j,null),r[Pe]=s.current,Tg(r),new Gg(s)},zc.hydrateRoot=function(r,s,l){if(!i(r))throw Error(a(299));var d=!1,p="",x=Jb,_=eS,j=tS,I=null,Q=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(_=l.onCaughtError),l.onRecoverableError!==void 0&&(j=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(I=l.unstable_transitionCallbacks),l.formState!==void 0&&(Q=l.formState)),s=Tw(r,1,!0,s,l??null,d,p,x,_,j,I,Q),s.context=Nw(null),l=s.current,d=lr(),d=$l(d),p=Ns(d),p.callback=null,As(l,p,d),l=d,s.current.lanes=l,yi(s,l),ya(s),r[Pe]=s.current,Tg(r),new wf(s)},zc.version="19.1.0",zc}var Zw;function qD(){if(Zw)return Yg.exports;Zw=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(),Yg.exports=GD(),Yg.exports}var ZD=qD(),Vc={},Yw;function YD(){if(Yw)return Vc;Yw=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.parse=u,Vc.serialize=m;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,a=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,o=(()=>{const y=function(){};return y.prototype=Object.create(null),y})();function u(y,S){const w=new o,E=y.length;if(E<2)return w;const C=(S==null?void 0:S.decode)||v;let R=0;do{const T=y.indexOf("=",R);if(T===-1)break;const N=y.indexOf(";",R),O=N===-1?E:N;if(T>O){R=y.lastIndexOf(";",T-1)+1;continue}const A=f(y,R,T),D=h(y,T,A),L=y.slice(A,D);if(w[L]===void 0){let H=f(y,T+1,O),X=h(y,O,H);const re=C(y.slice(H,X));w[L]=re}R=O+1}while(R<E);return w}function f(y,S,w){do{const E=y.charCodeAt(S);if(E!==32&&E!==9)return S}while(++S<w);return w}function h(y,S,w){for(;S>w;){const E=y.charCodeAt(--S);if(E!==32&&E!==9)return S+1}return w}function m(y,S,w){const E=(w==null?void 0:w.encode)||encodeURIComponent;if(!e.test(y))throw new TypeError(`argument name is invalid: ${y}`);const C=E(S);if(!t.test(C))throw new TypeError(`argument val is invalid: ${S}`);let R=y+"="+C;if(!w)return R;if(w.maxAge!==void 0){if(!Number.isInteger(w.maxAge))throw new TypeError(`option maxAge is invalid: ${w.maxAge}`);R+="; Max-Age="+w.maxAge}if(w.domain){if(!n.test(w.domain))throw new TypeError(`option domain is invalid: ${w.domain}`);R+="; Domain="+w.domain}if(w.path){if(!a.test(w.path))throw new TypeError(`option path is invalid: ${w.path}`);R+="; Path="+w.path}if(w.expires){if(!b(w.expires)||!Number.isFinite(w.expires.valueOf()))throw new TypeError(`option expires is invalid: ${w.expires}`);R+="; Expires="+w.expires.toUTCString()}if(w.httpOnly&&(R+="; HttpOnly"),w.secure&&(R+="; Secure"),w.partitioned&&(R+="; Partitioned"),w.priority)switch(typeof w.priority=="string"?w.priority.toLowerCase():void 0){case"low":R+="; Priority=Low";break;case"medium":R+="; Priority=Medium";break;case"high":R+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${w.priority}`)}if(w.sameSite)switch(typeof w.sameSite=="string"?w.sameSite.toLowerCase():w.sameSite){case!0:case"strict":R+="; SameSite=Strict";break;case"lax":R+="; SameSite=Lax";break;case"none":R+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${w.sameSite}`)}return R}function v(y){if(y.indexOf("%")===-1)return y;try{return decodeURIComponent(y)}catch{return y}}function b(y){return i.call(y)==="[object Date]"}return Vc}YD();/**
|
|
50
|
+
* react-router v7.6.2
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var nR=e=>{throw TypeError(e)},KD=(e,t,n)=>t.has(e)||nR("Cannot "+n),Wg=(e,t,n)=>(KD(e,t,"read from private field"),n?n.call(e):t.get(e)),QD=(e,t,n)=>t.has(e)?nR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Kw="popstate";function XD(e={}){function t(a,i){let{pathname:o,search:u,hash:f}=a.location;return vu("",{pathname:o,search:u,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(a,i){return typeof i=="string"?i:ri(i)}return JD(t,n,null,e)}function gt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function an(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function WD(){return Math.random().toString(36).substring(2,10)}function Qw(e,t){return{usr:e.state,key:e.key,idx:t}}function vu(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ui(t):t,state:n,key:t&&t.key||a||WD()}}function ri({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 ui(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function JD(e,t,n,a={}){let{window:i=document.defaultView,v5Compat:o=!1}=a,u=i.history,f="POP",h=null,m=v();m==null&&(m=0,u.replaceState({...u.state,idx:m},""));function v(){return(u.state||{idx:null}).idx}function b(){f="POP";let C=v(),R=C==null?null:C-m;m=C,h&&h({action:f,location:E.location,delta:R})}function y(C,R){f="PUSH";let T=vu(E.location,C,R);m=v()+1;let N=Qw(T,m),O=E.createHref(T);try{u.pushState(N,"",O)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign(O)}o&&h&&h({action:f,location:E.location,delta:1})}function S(C,R){f="REPLACE";let T=vu(E.location,C,R);m=v();let N=Qw(T,m),O=E.createHref(T);u.replaceState(N,"",O),o&&h&&h({action:f,location:E.location,delta:0})}function w(C){return rR(C)}let E={get action(){return f},get location(){return e(i,u)},listen(C){if(h)throw new Error("A history only accepts one active listener");return i.addEventListener(Kw,b),h=C,()=>{i.removeEventListener(Kw,b),h=null}},createHref(C){return t(i,C)},createURL:w,encodeLocation(C){let R=w(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:y,replace:S,go(C){return u.go(C)}};return E}function rR(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),gt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:ri(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var nu,Xw=class{constructor(e){if(QD(this,nu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Wg(this,nu).has(e))return Wg(this,nu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Wg(this,nu).set(e,t)}};nu=new WeakMap;var eO=new Set(["lazy","caseSensitive","path","id","index","children"]);function tO(e){return eO.has(e)}var nO=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function rO(e){return nO.has(e)}function aO(e){return e.index===!0}function sh(e,t,n=[],a={}){return e.map((i,o)=>{let u=[...n,String(o)],f=typeof i.id=="string"?i.id:u.join("-");if(gt(i.index!==!0||!i.children,"Cannot specify children on an index route"),gt(!a[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),aO(i)){let h={...i,...t(i),id:f};return a[f]=h,h}else{let h={...i,...t(i),id:f,children:void 0};return a[f]=h,i.children&&(h.children=sh(i.children,t,u,a)),h}})}function Xs(e,t,n="/"){return Bf(e,t,n,!1)}function Bf(e,t,n,a){let i=typeof t=="string"?ui(t):t,o=$r(i.pathname||"/",n);if(o==null)return null;let u=aR(e);iO(u);let f=null;for(let h=0;f==null&&h<u.length;++h){let m=vO(o);f=pO(u[h],m,a)}return f}function sO(e,t){let{route:n,pathname:a,params:i}=e;return{id:n.id,pathname:a,params:i,data:t[n.id],handle:n.handle}}function aR(e,t=[],n=[],a=""){let i=(o,u,f)=>{let h={relativePath:f===void 0?o.path||"":f,caseSensitive:o.caseSensitive===!0,childrenIndex:u,route:o};h.relativePath.startsWith("/")&&(gt(h.relativePath.startsWith(a),`Absolute route path "${h.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(a.length));let m=Ca([a,h.relativePath]),v=n.concat(h);o.children&&o.children.length>0&&(gt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),aR(o.children,t,v,m)),!(o.path==null&&!o.index)&&t.push({path:m,score:hO(m,o.index),routesMeta:v})};return e.forEach((o,u)=>{var f;if(o.path===""||!((f=o.path)!=null&&f.includes("?")))i(o,u);else for(let h of sR(o.path))i(o,u,h)}),t}function sR(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return i?[o,""]:[o];let u=sR(a.join("/")),f=[];return f.push(...u.map(h=>h===""?o:[o,h].join("/"))),i&&f.push(...u),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function iO(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mO(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var oO=/^:[\w-]+$/,lO=3,cO=2,uO=1,dO=10,fO=-2,Ww=e=>e==="*";function hO(e,t){let n=e.split("/"),a=n.length;return n.some(Ww)&&(a+=fO),t&&(a+=cO),n.filter(i=>!Ww(i)).reduce((i,o)=>i+(oO.test(o)?lO:o===""?uO:dO),a)}function mO(e,t){return e.length===t.length&&e.slice(0,-1).every((a,i)=>a===t[i])?e[e.length-1]-t[t.length-1]:0}function pO(e,t,n=!1){let{routesMeta:a}=e,i={},o="/",u=[];for(let f=0;f<a.length;++f){let h=a[f],m=f===a.length-1,v=o==="/"?t:t.slice(o.length)||"/",b=ih({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},v),y=h.route;if(!b&&m&&n&&!a[a.length-1].route.index&&(b=ih({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},v)),!b)return null;Object.assign(i,b.params),u.push({params:i,pathname:Ca([o,b.pathname]),pathnameBase:bO(Ca([o,b.pathnameBase])),route:y}),b.pathnameBase!=="/"&&(o=Ca([o,b.pathnameBase]))}return u}function ih(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=gO(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],u=o.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:a.reduce((m,{paramName:v,isOptional:b},y)=>{if(v==="*"){let w=f[y]||"";u=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const S=f[y];return b&&!S?m[v]=void 0:m[v]=(S||"").replace(/%2F/g,"/"),m},{}),pathname:o,pathnameBase:u,pattern:e}}function gO(e,t=!1,n=!0){an(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 a=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,h)=>(a.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),a]}function vO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return an(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function $r(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}function yO(e,t="/"){let{pathname:n,search:a="",hash:i=""}=typeof e=="string"?ui(e):e;return{pathname:n?n.startsWith("/")?n:xO(n,t):t,search:SO(a),hash:wO(i)}}function xO(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 Jg(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. 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 iR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Hh(e){let t=iR(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Bh(e,t,n,a=!1){let i;typeof e=="string"?i=ui(e):(i={...e},gt(!i.pathname||!i.pathname.includes("?"),Jg("?","pathname","search",i)),gt(!i.pathname||!i.pathname.includes("#"),Jg("#","pathname","hash",i)),gt(!i.search||!i.search.includes("#"),Jg("#","search","hash",i)));let o=e===""||i.pathname==="",u=o?"/":i.pathname,f;if(u==null)f=n;else{let b=t.length-1;if(!a&&u.startsWith("..")){let y=u.split("/");for(;y[0]==="..";)y.shift(),b-=1;i.pathname=y.join("/")}f=b>=0?t[b]:"/"}let h=yO(i,f),m=u&&u!=="/"&&u.endsWith("/"),v=(o||u===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||v)&&(h.pathname+="/"),h}var Ca=e=>e.join("/").replace(/\/\/+/g,"/"),bO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),SO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,oh=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function yu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var oR=["POST","PUT","PATCH","DELETE"],EO=new Set(oR),CO=["GET",...oR],RO=new Set(CO),_O=new Set([301,302,303,307,308]),TO=new Set([307,308]),ev={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},NO={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$c={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Hy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,AO=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),lR="remix-router-transitions",cR=Symbol("ResetLoaderData");function jO(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";gt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],i=e.mapRouteProperties||AO,o={},u=sh(e.routes,i,void 0,o),f,h=e.basename||"/",m=e.dataStrategy||LO,v={unstable_middleware:!1,...e.future},b=null,y=new Set,S=null,w=null,E=null,C=e.hydrationData!=null,R=Xs(u,e.history.location,h),T=!1,N=null,O;if(R==null&&!e.patchRoutesOnNavigation){let U=Fr(404,{pathname:e.history.location.pathname}),{matches:Y,route:te}=uE(u);O=!0,R=Y,N={[te.id]:U}}else if(R&&!e.hydrationData&&xi(R,u,e.history.location.pathname).active&&(R=null),R)if(R.some(U=>U.route.lazy))O=!1;else if(!R.some(U=>U.route.loader))O=!0;else{let U=e.hydrationData?e.hydrationData.loaderData:null,Y=e.hydrationData?e.hydrationData.errors:null;if(Y){let te=R.findIndex(ge=>Y[ge.route.id]!==void 0);O=R.slice(0,te+1).every(ge=>!Hv(ge.route,U,Y))}else O=R.every(te=>!Hv(te.route,U,Y))}else{O=!1,R=[];let U=xi(null,u,e.history.location.pathname);U.active&&U.matches&&(T=!0,R=U.matches)}let A,D={historyAction:e.history.action,location:e.history.location,matches:R,initialized:O,navigation:ev,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||N,fetchers:new Map,blockers:new Map},L="POP",H=!1,X,re=!1,me=new Map,V=null,le=!1,ue=!1,ne=new Set,k=new Map,Z=0,$=-1,se=new Map,M=new Set,G=new Map,P=new Map,q=new Set,ie=new Map,he,ve=null;function fe(){if(b=e.history.listen(({action:U,location:Y,delta:te})=>{if(he){he(),he=void 0;return}an(ie.size===0||te!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ge=vi({currentLocation:D.location,nextLocation:Y,historyAction:U});if(ge&&te!=null){let we=new Promise(Pe=>{he=Pe});e.history.go(te*-1),Tr(ge,{state:"blocked",location:Y,proceed(){Tr(ge,{state:"proceeding",proceed:void 0,reset:void 0,location:Y}),we.then(()=>e.history.go(te))},reset(){let Pe=new Map(D.blockers);Pe.set(ge,$c),Te({blockers:Pe})}});return}return zt(U,Y)}),n){qO(t,me);let U=()=>ZO(t,me);t.addEventListener("pagehide",U),V=()=>t.removeEventListener("pagehide",U)}return D.initialized||zt("POP",D.location,{initialHydration:!0}),A}function _e(){b&&b(),V&&V(),y.clear(),X&&X.abort(),D.fetchers.forEach((U,Y)=>jt(Y)),D.blockers.forEach((U,Y)=>ha(Y))}function be(U){return y.add(U),()=>y.delete(U)}function Te(U,Y={}){D={...D,...U};let te=[],ge=[];D.fetchers.forEach((we,Pe)=>{we.state==="idle"&&(q.has(Pe)?te.push(Pe):ge.push(Pe))}),q.forEach(we=>{!D.fetchers.has(we)&&!k.has(we)&&te.push(we)}),[...y].forEach(we=>we(D,{deletedFetchers:te,viewTransitionOpts:Y.viewTransitionOpts,flushSync:Y.flushSync===!0})),te.forEach(we=>jt(we)),ge.forEach(we=>D.fetchers.delete(we))}function Me(U,Y,{flushSync:te}={}){var He,Je;let ge=D.actionData!=null&&D.navigation.formMethod!=null&&dr(D.navigation.formMethod)&&D.navigation.state==="loading"&&((He=U.state)==null?void 0:He._isRedirect)!==!0,we;Y.actionData?Object.keys(Y.actionData).length>0?we=Y.actionData:we=null:ge?we=D.actionData:we=null;let Pe=Y.loaderData?lE(D.loaderData,Y.loaderData,Y.matches||[],Y.errors):D.loaderData,qe=D.blockers;qe.size>0&&(qe=new Map(qe),qe.forEach((ze,rt)=>qe.set(rt,$c)));let Oe=H===!0||D.navigation.formMethod!=null&&dr(D.navigation.formMethod)&&((Je=U.state)==null?void 0:Je._isRedirect)!==!0;f&&(u=f,f=void 0),le||L==="POP"||(L==="PUSH"?e.history.push(U,U.state):L==="REPLACE"&&e.history.replace(U,U.state));let $e;if(L==="POP"){let ze=me.get(D.location.pathname);ze&&ze.has(U.pathname)?$e={currentLocation:D.location,nextLocation:U}:me.has(U.pathname)&&($e={currentLocation:U,nextLocation:D.location})}else if(re){let ze=me.get(D.location.pathname);ze?ze.add(U.pathname):(ze=new Set([U.pathname]),me.set(D.location.pathname,ze)),$e={currentLocation:D.location,nextLocation:U}}Te({...Y,actionData:we,loaderData:Pe,historyAction:L,location:U,initialized:!0,navigation:ev,revalidation:"idle",restoreScrollPosition:md(U,Y.matches||D.matches),preventScrollReset:Oe,blockers:qe},{viewTransitionOpts:$e,flushSync:te===!0}),L="POP",H=!1,re=!1,le=!1,ue=!1,ve==null||ve.resolve(),ve=null}async function Ge(U,Y){if(typeof U=="number"){e.history.go(U);return}let te=$v(D.location,D.matches,h,U,Y==null?void 0:Y.fromRouteId,Y==null?void 0:Y.relative),{path:ge,submission:we,error:Pe}=Jw(!1,te,Y),qe=D.location,Oe=vu(D.location,ge,Y&&Y.state);Oe={...Oe,...e.history.encodeLocation(Oe)};let $e=Y&&Y.replace!=null?Y.replace:void 0,He="PUSH";$e===!0?He="REPLACE":$e===!1||we!=null&&dr(we.formMethod)&&we.formAction===D.location.pathname+D.location.search&&(He="REPLACE");let Je=Y&&"preventScrollReset"in Y?Y.preventScrollReset===!0:void 0,ze=(Y&&Y.flushSync)===!0,rt=vi({currentLocation:qe,nextLocation:Oe,historyAction:He});if(rt){Tr(rt,{state:"blocked",location:Oe,proceed(){Tr(rt,{state:"proceeding",proceed:void 0,reset:void 0,location:Oe}),Ge(U,Y)},reset(){let Et=new Map(D.blockers);Et.set(rt,$c),Te({blockers:Et})}});return}await zt(He,Oe,{submission:we,pendingError:Pe,preventScrollReset:Je,replace:Y&&Y.replace,enableViewTransition:Y&&Y.viewTransition,flushSync:ze})}function Yt(){ve||(ve=YO()),Se(),Te({revalidation:"loading"});let U=ve.promise;return D.navigation.state==="submitting"?U:D.navigation.state==="idle"?(zt(D.historyAction,D.location,{startUninterruptedRevalidation:!0}),U):(zt(L||D.historyAction,D.navigation.location,{overrideNavigation:D.navigation,enableViewTransition:re===!0}),U)}async function zt(U,Y,te){X&&X.abort(),X=null,L=U,le=(te&&te.startUninterruptedRevalidation)===!0,yi(D.location,D.matches),H=(te&&te.preventScrollReset)===!0,re=(te&&te.enableViewTransition)===!0;let ge=f||u,we=te&&te.overrideNavigation,Pe=te!=null&&te.initialHydration&&D.matches&&D.matches.length>0&&!T?D.matches:Xs(ge,Y,h),qe=(te&&te.flushSync)===!0;if(Pe&&D.initialized&&!ue&&VO(D.location,Y)&&!(te&&te.submission&&dr(te.submission.formMethod))){Me(Y,{matches:Pe},{flushSync:qe});return}let Oe=xi(Pe,ge,Y.pathname);if(Oe.active&&Oe.matches&&(Pe=Oe.matches),!Pe){let{error:Kt,notFoundMatches:Tt,route:St}=yo(Y.pathname);Me(Y,{matches:Tt,loaderData:{},errors:{[St.id]:Kt}},{flushSync:qe});return}X=new AbortController;let $e=sl(e.history,Y,X.signal,te&&te.submission),He=new Xw(e.unstable_getContext?await e.unstable_getContext():void 0),Je;if(te&&te.pendingError)Je=[zi(Pe).route.id,{type:"error",error:te.pendingError}];else if(te&&te.submission&&dr(te.submission.formMethod)){let Kt=await Rr($e,Y,te.submission,Pe,He,Oe.active,te&&te.initialHydration===!0,{replace:te.replace,flushSync:qe});if(Kt.shortCircuited)return;if(Kt.pendingActionResult){let[Tt,St]=Kt.pendingActionResult;if(ur(St)&&yu(St.error)&&St.error.status===404){X=null,Me(Y,{matches:Kt.matches,loaderData:{},errors:{[Tt]:St.error}});return}}Pe=Kt.matches||Pe,Je=Kt.pendingActionResult,we=tv(Y,te.submission),qe=!1,Oe.active=!1,$e=sl(e.history,$e.url,$e.signal)}let{shortCircuited:ze,matches:rt,loaderData:Et,errors:Vt}=await Yr($e,Y,Pe,He,Oe.active,we,te&&te.submission,te&&te.fetcherSubmission,te&&te.replace,te&&te.initialHydration===!0,qe,Je);ze||(X=null,Me(Y,{matches:rt||Pe,...cE(Je),loaderData:Et,errors:Vt}))}async function Rr(U,Y,te,ge,we,Pe,qe,Oe={}){Se();let $e=BO(Y,te);if(Te({navigation:$e},{flushSync:Oe.flushSync===!0}),Pe){let ze=await bi(ge,Y.pathname,U.signal);if(ze.type==="aborted")return{shortCircuited:!0};if(ze.type==="error"){let rt=zi(ze.partialMatches).route.id;return{matches:ze.partialMatches,pendingActionResult:[rt,{type:"error",error:ze.error}]}}else if(ze.matches)ge=ze.matches;else{let{notFoundMatches:rt,error:Et,route:Vt}=yo(Y.pathname);return{matches:rt,pendingActionResult:[Vt.id,{type:"error",error:Et}]}}}let He,Je=ru(ge,Y);if(!Je.route.action&&!Je.route.lazy)He={type:"error",error:Fr(405,{method:U.method,pathname:Y.pathname,routeId:Je.route.id})};else{let ze=fl(i,o,U,ge,Je,qe?[]:a,we),rt=await Ce(U,ze,we,null);if(He=rt[Je.route.id],!He){for(let Et of ge)if(rt[Et.route.id]){He=rt[Et.route.id];break}}if(U.signal.aborted)return{shortCircuited:!0}}if(Vi(He)){let ze;return Oe&&Oe.replace!=null?ze=Oe.replace:ze=sE(He.response.headers.get("Location"),new URL(U.url),h)===D.location.pathname+D.location.search,await oe(U,He,!0,{submission:te,replace:ze}),{shortCircuited:!0}}if(ur(He)){let ze=zi(ge,Je.route.id);return(Oe&&Oe.replace)!==!0&&(L="PUSH"),{matches:ge,pendingActionResult:[ze.route.id,He,Je.route.id]}}return{matches:ge,pendingActionResult:[Je.route.id,He]}}async function Yr(U,Y,te,ge,we,Pe,qe,Oe,$e,He,Je,ze){let rt=Pe||tv(Y,qe),Et=qe||Oe||fE(rt),Vt=!le&&!He;if(we){if(Vt){let Dn=en(ze);Te({navigation:rt,...Dn!==void 0?{actionData:Dn}:{}},{flushSync:Je})}let mt=await bi(te,Y.pathname,U.signal);if(mt.type==="aborted")return{shortCircuited:!0};if(mt.type==="error"){let Dn=zi(mt.partialMatches).route.id;return{matches:mt.partialMatches,loaderData:{},errors:{[Dn]:mt.error}}}else if(mt.matches)te=mt.matches;else{let{error:Dn,notFoundMatches:Wr,route:Jr}=yo(Y.pathname);return{matches:Wr,loaderData:{},errors:{[Jr.id]:Dn}}}}let Kt=f||u,{dsMatches:Tt,revalidatingFetchers:St}=eE(U,ge,i,o,e.history,D,te,Et,Y,He?[]:a,He===!0,ue,ne,q,G,M,Kt,h,e.patchRoutesOnNavigation!=null,ze);if($=++Z,!e.dataStrategy&&!Tt.some(mt=>mt.shouldLoad)&&St.length===0){let mt=Kr();return Me(Y,{matches:te,loaderData:{},errors:ze&&ur(ze[1])?{[ze[0]]:ze[1].error}:null,...cE(ze),...mt?{fetchers:new Map(D.fetchers)}:{}},{flushSync:Je}),{shortCircuited:!0}}if(Vt){let mt={};if(!we){mt.navigation=rt;let Dn=en(ze);Dn!==void 0&&(mt.actionData=Dn)}St.length>0&&(mt.fetchers=go(St)),Te(mt,{flushSync:Je})}St.forEach(mt=>{pn(mt.key),mt.controller&&k.set(mt.key,mt.controller)});let Ss=()=>St.forEach(mt=>pn(mt.key));X&&X.signal.addEventListener("abort",Ss);let{loaderResults:Fn,fetcherResults:Nr}=await Ee(Tt,St,U,ge);if(U.signal.aborted)return{shortCircuited:!0};X&&X.signal.removeEventListener("abort",Ss),St.forEach(mt=>k.delete(mt.key));let qn=Cf(Fn);if(qn)return await oe(U,qn.result,!0,{replace:$e}),{shortCircuited:!0};if(qn=Cf(Nr),qn)return M.add(qn.key),await oe(U,qn.result,!0,{replace:$e}),{shortCircuited:!0};let{loaderData:ws,errors:Es}=oE(D,te,Fn,ze,St,Nr);He&&D.errors&&(Es={...D.errors,...Es});let Bl=Kr(),Ar=Qr($),za=Bl||Ar||St.length>0;return{matches:te,loaderData:ws,errors:Es,...za?{fetchers:new Map(D.fetchers)}:{}}}function en(U){if(U&&!ur(U[1]))return{[U[0]]:U[1].data};if(D.actionData)return Object.keys(D.actionData).length===0?null:D.actionData}function go(U){return U.forEach(Y=>{let te=D.fetchers.get(Y.key),ge=Hc(void 0,te?te.data:void 0);D.fetchers.set(Y.key,ge)}),new Map(D.fetchers)}async function _r(U,Y,te,ge){pn(U);let we=(ge&&ge.flushSync)===!0,Pe=f||u,qe=$v(D.location,D.matches,h,te,Y,ge==null?void 0:ge.relative),Oe=Xs(Pe,qe,h),$e=xi(Oe,Pe,qe);if($e.active&&$e.matches&&(Oe=$e.matches),!Oe){Be(U,Y,Fr(404,{pathname:qe}),{flushSync:we});return}let{path:He,submission:Je,error:ze}=Jw(!0,qe,ge);if(ze){Be(U,Y,ze,{flushSync:we});return}let rt=ru(Oe,He),Et=new Xw(e.unstable_getContext?await e.unstable_getContext():void 0),Vt=(ge&&ge.preventScrollReset)===!0;if(Je&&dr(Je.formMethod)){await F(U,Y,He,rt,Oe,Et,$e.active,we,Vt,Je);return}G.set(U,{routeId:Y,path:He}),await W(U,Y,He,rt,Oe,Et,$e.active,we,Vt,Je)}async function F(U,Y,te,ge,we,Pe,qe,Oe,$e,He){Se(),G.delete(U);function Je(Gt){if(!Gt.route.action&&!Gt.route.lazy){let Cs=Fr(405,{method:He.formMethod,pathname:te,routeId:Y});return Be(U,Y,Cs,{flushSync:Oe}),!0}return!1}if(!qe&&Je(ge))return;let ze=D.fetchers.get(U);je(U,GO(He,ze),{flushSync:Oe});let rt=new AbortController,Et=sl(e.history,te,rt.signal,He);if(qe){let Gt=await bi(we,te,Et.signal,U);if(Gt.type==="aborted")return;if(Gt.type==="error"){Be(U,Y,Gt.error,{flushSync:Oe});return}else if(Gt.matches){if(we=Gt.matches,ge=ru(we,te),Je(ge))return}else{Be(U,Y,Fr(404,{pathname:te}),{flushSync:Oe});return}}k.set(U,rt);let Vt=Z,Kt=fl(i,o,Et,we,ge,a,Pe),St=(await Ce(Et,Kt,Pe,U))[ge.route.id];if(Et.signal.aborted){k.get(U)===rt&&k.delete(U);return}if(q.has(U)){if(Vi(St)||ur(St)){je(U,Ys(void 0));return}}else{if(Vi(St))if(k.delete(U),$>Vt){je(U,Ys(void 0));return}else return M.add(U),je(U,Hc(He)),oe(Et,St,!1,{fetcherSubmission:He,preventScrollReset:$e});if(ur(St)){Be(U,Y,St.error);return}}let Ss=D.navigation.location||D.location,Fn=sl(e.history,Ss,rt.signal),Nr=f||u,qn=D.navigation.state!=="idle"?Xs(Nr,D.navigation.location,h):D.matches;gt(qn,"Didn't find any matches after fetcher action");let ws=++Z;se.set(U,ws);let Es=Hc(He,St.data);D.fetchers.set(U,Es);let{dsMatches:Bl,revalidatingFetchers:Ar}=eE(Fn,Pe,i,o,e.history,D,qn,He,Ss,a,!1,ue,ne,q,G,M,Nr,h,e.patchRoutesOnNavigation!=null,[ge.route.id,St]);Ar.filter(Gt=>Gt.key!==U).forEach(Gt=>{let Cs=Gt.key,Gl=D.fetchers.get(Cs),Zn=Hc(void 0,Gl?Gl.data:void 0);D.fetchers.set(Cs,Zn),pn(Cs),Gt.controller&&k.set(Cs,Gt.controller)}),Te({fetchers:new Map(D.fetchers)});let za=()=>Ar.forEach(Gt=>pn(Gt.key));rt.signal.addEventListener("abort",za);let{loaderResults:mt,fetcherResults:Dn}=await Ee(Bl,Ar,Fn,Pe);if(rt.signal.aborted)return;if(rt.signal.removeEventListener("abort",za),se.delete(U),k.delete(U),Ar.forEach(Gt=>k.delete(Gt.key)),D.fetchers.has(U)){let Gt=Ys(St.data);D.fetchers.set(U,Gt)}let Wr=Cf(mt);if(Wr)return oe(Fn,Wr.result,!1,{preventScrollReset:$e});if(Wr=Cf(Dn),Wr)return M.add(Wr.key),oe(Fn,Wr.result,!1,{preventScrollReset:$e});let{loaderData:Jr,errors:Si}=oE(D,qn,mt,void 0,Ar,Dn);Qr(ws),D.navigation.state==="loading"&&ws>$?(gt(L,"Expected pending action"),X&&X.abort(),Me(D.navigation.location,{matches:qn,loaderData:Jr,errors:Si,fetchers:new Map(D.fetchers)})):(Te({errors:Si,loaderData:lE(D.loaderData,Jr,qn,Si),fetchers:new Map(D.fetchers)}),ue=!1)}async function W(U,Y,te,ge,we,Pe,qe,Oe,$e,He){let Je=D.fetchers.get(U);je(U,Hc(He,Je?Je.data:void 0),{flushSync:Oe});let ze=new AbortController,rt=sl(e.history,te,ze.signal);if(qe){let St=await bi(we,te,rt.signal,U);if(St.type==="aborted")return;if(St.type==="error"){Be(U,Y,St.error,{flushSync:Oe});return}else if(St.matches)we=St.matches,ge=ru(we,te);else{Be(U,Y,Fr(404,{pathname:te}),{flushSync:Oe});return}}k.set(U,ze);let Et=Z,Vt=fl(i,o,rt,we,ge,a,Pe),Tt=(await Ce(rt,Vt,Pe,U))[ge.route.id];if(k.get(U)===ze&&k.delete(U),!rt.signal.aborted){if(q.has(U)){je(U,Ys(void 0));return}if(Vi(Tt))if($>Et){je(U,Ys(void 0));return}else{M.add(U),await oe(rt,Tt,!1,{preventScrollReset:$e});return}if(ur(Tt)){Be(U,Y,Tt.error);return}je(U,Ys(Tt.data))}}async function oe(U,Y,te,{submission:ge,fetcherSubmission:we,preventScrollReset:Pe,replace:qe}={}){Y.response.headers.has("X-Remix-Revalidate")&&(ue=!0);let Oe=Y.response.headers.get("Location");gt(Oe,"Expected a Location header on the redirect Response"),Oe=sE(Oe,new URL(U.url),h);let $e=vu(D.location,Oe,{_isRedirect:!0});if(n){let Vt=!1;if(Y.response.headers.has("X-Remix-Reload-Document"))Vt=!0;else if(Hy.test(Oe)){const Kt=rR(Oe,!0);Vt=Kt.origin!==t.location.origin||$r(Kt.pathname,h)==null}if(Vt){qe?t.location.replace(Oe):t.location.assign(Oe);return}}X=null;let He=qe===!0||Y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Je,formAction:ze,formEncType:rt}=D.navigation;!ge&&!we&&Je&&ze&&rt&&(ge=fE(D.navigation));let Et=ge||we;if(TO.has(Y.response.status)&&Et&&dr(Et.formMethod))await zt(He,$e,{submission:{...Et,formAction:Oe},preventScrollReset:Pe||H,enableViewTransition:te?re:void 0});else{let Vt=tv($e,ge);await zt(He,$e,{overrideNavigation:Vt,fetcherSubmission:we,preventScrollReset:Pe||H,enableViewTransition:te?re:void 0})}}async function Ce(U,Y,te,ge){let we,Pe={};try{we=await IO(m,U,Y,ge,te,!1)}catch(qe){return Y.filter(Oe=>Oe.shouldLoad).forEach(Oe=>{Pe[Oe.route.id]={type:"error",error:qe}}),Pe}if(U.signal.aborted)return Pe;for(let[qe,Oe]of Object.entries(we))if($O(Oe)){let $e=Oe.result;Pe[qe]={type:"redirect",response:UO($e,U,qe,Y,h)}}else Pe[qe]=await FO(Oe);return Pe}async function Ee(U,Y,te,ge){let we=Ce(te,U,ge,null),Pe=Promise.all(Y.map(async $e=>{if($e.matches&&$e.match&&$e.request&&$e.controller){let Je=(await Ce($e.request,$e.matches,ge,$e.key))[$e.match.route.id];return{[$e.key]:Je}}else return Promise.resolve({[$e.key]:{type:"error",error:Fr(404,{pathname:$e.path})}})})),qe=await we,Oe=(await Pe).reduce(($e,He)=>Object.assign($e,He),{});return{loaderResults:qe,fetcherResults:Oe}}function Se(){ue=!0,G.forEach((U,Y)=>{k.has(Y)&&ne.add(Y),pn(Y)})}function je(U,Y,te={}){D.fetchers.set(U,Y),Te({fetchers:new Map(D.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Be(U,Y,te,ge={}){let we=zi(D.matches,Y);jt(U),Te({errors:{[we.route.id]:te},fetchers:new Map(D.fetchers)},{flushSync:(ge&&ge.flushSync)===!0})}function ht(U){return P.set(U,(P.get(U)||0)+1),q.has(U)&&q.delete(U),D.fetchers.get(U)||NO}function jt(U){let Y=D.fetchers.get(U);k.has(U)&&!(Y&&Y.state==="loading"&&se.has(U))&&pn(U),G.delete(U),se.delete(U),M.delete(U),q.delete(U),ne.delete(U),D.fetchers.delete(U)}function bs(U){let Y=(P.get(U)||0)-1;Y<=0?(P.delete(U),q.add(U)):P.set(U,Y),Te({fetchers:new Map(D.fetchers)})}function pn(U){let Y=k.get(U);Y&&(Y.abort(),k.delete(U))}function vo(U){for(let Y of U){let te=ht(Y),ge=Ys(te.data);D.fetchers.set(Y,ge)}}function Kr(){let U=[],Y=!1;for(let te of M){let ge=D.fetchers.get(te);gt(ge,`Expected fetcher: ${te}`),ge.state==="loading"&&(M.delete(te),U.push(te),Y=!0)}return vo(U),Y}function Qr(U){let Y=[];for(let[te,ge]of se)if(ge<U){let we=D.fetchers.get(te);gt(we,`Expected fetcher: ${te}`),we.state==="loading"&&(pn(te),se.delete(te),Y.push(te))}return vo(Y),Y.length>0}function Xr(U,Y){let te=D.blockers.get(U)||$c;return ie.get(U)!==Y&&ie.set(U,Y),te}function ha(U){D.blockers.delete(U),ie.delete(U)}function Tr(U,Y){let te=D.blockers.get(U)||$c;gt(te.state==="unblocked"&&Y.state==="blocked"||te.state==="blocked"&&Y.state==="blocked"||te.state==="blocked"&&Y.state==="proceeding"||te.state==="blocked"&&Y.state==="unblocked"||te.state==="proceeding"&&Y.state==="unblocked",`Invalid blocker state transition: ${te.state} -> ${Y.state}`);let ge=new Map(D.blockers);ge.set(U,Y),Te({blockers:ge})}function vi({currentLocation:U,nextLocation:Y,historyAction:te}){if(ie.size===0)return;ie.size>1&&an(!1,"A router only supports one blocker at a time");let ge=Array.from(ie.entries()),[we,Pe]=ge[ge.length-1],qe=D.blockers.get(we);if(!(qe&&qe.state==="proceeding")&&Pe({currentLocation:U,nextLocation:Y,historyAction:te}))return we}function yo(U){let Y=Fr(404,{pathname:U}),te=f||u,{matches:ge,route:we}=uE(te);return{notFoundMatches:ge,route:we,error:Y}}function hd(U,Y,te){if(S=U,E=Y,w=te||null,!C&&D.navigation===ev){C=!0;let ge=md(D.location,D.matches);ge!=null&&Te({restoreScrollPosition:ge})}return()=>{S=null,E=null,w=null}}function xo(U,Y){return w&&w(U,Y.map(ge=>sO(ge,D.loaderData)))||U.key}function yi(U,Y){if(S&&E){let te=xo(U,Y);S[te]=E()}}function md(U,Y){if(S){let te=xo(U,Y),ge=S[te];if(typeof ge=="number")return ge}return null}function xi(U,Y,te){if(e.patchRoutesOnNavigation)if(U){if(Object.keys(U[0].params).length>0)return{active:!0,matches:Bf(Y,te,h,!0)}}else return{active:!0,matches:Bf(Y,te,h,!0)||[]};return{active:!1,matches:null}}async function bi(U,Y,te,ge){if(!e.patchRoutesOnNavigation)return{type:"success",matches:U};let we=U;for(;;){let Pe=f==null,qe=f||u,Oe=o;try{await e.patchRoutesOnNavigation({signal:te,path:Y,matches:we,fetcherKey:ge,patch:(Je,ze)=>{te.aborted||tE(Je,ze,qe,Oe,i)}})}catch(Je){return{type:"error",error:Je,partialMatches:we}}finally{Pe&&!te.aborted&&(u=[...u])}if(te.aborted)return{type:"aborted"};let $e=Xs(qe,Y,h);if($e)return{type:"success",matches:$e};let He=Bf(qe,Y,h,!0);if(!He||we.length===He.length&&we.every((Je,ze)=>Je.route.id===He[ze].route.id))return{type:"success",matches:null};we=He}}function $l(U){o={},f=sh(U,i,void 0,o)}function Hl(U,Y){let te=f==null;tE(U,Y,f||u,o,i),te&&(u=[...u],Te({}))}return A={get basename(){return h},get future(){return v},get state(){return D},get routes(){return u},get window(){return t},initialize:fe,subscribe:be,enableScrollRestoration:hd,navigate:Ge,fetch:_r,revalidate:Yt,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:ht,deleteFetcher:bs,dispose:_e,getBlocker:Xr,deleteBlocker:ha,patchRoutes:Hl,_internalFetchControllers:k,_internalSetRoutes:$l},A}function DO(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function $v(e,t,n,a,i,o){let u,f;if(i){u=[];for(let m of t)if(u.push(m),m.route.id===i){f=m;break}}else u=t,f=t[t.length-1];let h=Bh(a||".",Hh(u),$r(e.pathname,n)||e.pathname,o==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&f){let m=By(h.search);if(f.route.index&&!m)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&m){let v=new URLSearchParams(h.search),b=v.getAll("index");v.delete("index"),b.filter(S=>S).forEach(S=>v.append("index",S));let y=v.toString();h.search=y?`?${y}`:""}}return n!=="/"&&(h.pathname=h.pathname==="/"?n:Ca([n,h.pathname])),ri(h)}function Jw(e,t,n){if(!n||!DO(n))return{path:t};if(n.formMethod&&!HO(n.formMethod))return{path:t,error:Fr(405,{method:n.formMethod})};let a=()=>({path:t,error:Fr(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),u=pR(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!dr(o))return a();let b=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[S,w])=>`${y}${S}=${w}
|
|
59
|
+
`,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:u,formEncType:n.formEncType,formData:void 0,json:void 0,text:b}}}else if(n.formEncType==="application/json"){if(!dr(o))return a();try{let b=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:u,formEncType:n.formEncType,formData:void 0,json:b,text:void 0}}}catch{return a()}}}gt(typeof FormData=="function","FormData is not available in this environment");let f,h;if(n.formData)f=Gv(n.formData),h=n.formData;else if(n.body instanceof FormData)f=Gv(n.body),h=n.body;else if(n.body instanceof URLSearchParams)f=n.body,h=iE(f);else if(n.body==null)f=new URLSearchParams,h=new FormData;else try{f=new URLSearchParams(n.body),h=iE(f)}catch{return a()}let m={formMethod:o,formAction:u,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(dr(m.formMethod))return{path:t,submission:m};let v=ui(t);return e&&v.search&&By(v.search)&&f.append("index",""),v.search=`?${f}`,{path:ri(v),submission:m}}function eE(e,t,n,a,i,o,u,f,h,m,v,b,y,S,w,E,C,R,T,N){var le;let O=N?ur(N[1])?N[1].error:N[1].data:void 0,A=i.createURL(o.location),D=i.createURL(h),L;if(v&&o.errors){let ue=Object.keys(o.errors)[0];L=u.findIndex(ne=>ne.route.id===ue)}else if(N&&ur(N[1])){let ue=N[0];L=u.findIndex(ne=>ne.route.id===ue)-1}let H=N?N[1].statusCode:void 0,X=H&&H>=400,re={currentUrl:A,currentParams:((le=o.matches[0])==null?void 0:le.params)||{},nextUrl:D,nextParams:u[0].params,...f,actionResult:O,actionStatus:H},me=u.map((ue,ne)=>{let{route:k}=ue,Z=null;if(L!=null&&ne>L?Z=!1:k.lazy?Z=!0:k.loader==null?Z=!1:v?Z=Hv(k,o.loaderData,o.errors):OO(o.loaderData,o.matches[ne],ue)&&(Z=!0),Z!==null)return Bv(n,a,e,ue,m,t,Z);let $=X?!1:b||A.pathname+A.search===D.pathname+D.search||A.search!==D.search||MO(o.matches[ne],ue),se={...re,defaultShouldRevalidate:$},M=lh(ue,se);return Bv(n,a,e,ue,m,t,M,se)}),V=[];return w.forEach((ue,ne)=>{if(v||!u.some(q=>q.route.id===ue.routeId)||S.has(ne))return;let k=o.fetchers.get(ne),Z=k&&k.state!=="idle"&&k.data===void 0,$=Xs(C,ue.path,R);if(!$){if(T&&Z)return;V.push({key:ne,routeId:ue.routeId,path:ue.path,matches:null,match:null,request:null,controller:null});return}if(E.has(ne))return;let se=ru($,ue.path),M=new AbortController,G=sl(i,ue.path,M.signal),P=null;if(y.has(ne))y.delete(ne),P=fl(n,a,G,$,se,m,t);else if(Z)b&&(P=fl(n,a,G,$,se,m,t));else{let q={...re,defaultShouldRevalidate:X?!1:b};lh(se,q)&&(P=fl(n,a,G,$,se,m,t,q))}P&&V.push({key:ne,routeId:ue.routeId,path:ue.path,matches:P,match:se,request:G,controller:M})}),{dsMatches:me,revalidatingFetchers:V}}function Hv(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let a=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!a&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!i}function OO(e,t,n){let a=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return a||i}function MO(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function lh(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function tE(e,t,n,a,i){let o;if(e){let h=a[e];gt(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),o=h.children}else o=n;let u=t.filter(h=>!o.some(m=>uR(h,m))),f=sh(u,i,[e||"_","patch",String((o==null?void 0:o.length)||"0")],a);o.push(...f)}function uR(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,a)=>{var i;return(i=t.children)==null?void 0:i.some(o=>uR(n,o))}):!1}var nE=new WeakMap,dR=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let i=n[t.id];if(gt(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let o=i.lazy[e];if(!o)return;let u=nE.get(i);u||(u={},nE.set(i,u));let f=u[e];if(f)return f;let h=(async()=>{let m=tO(e),b=i[e]!==void 0&&e!=="hasErrorBoundary";if(m)an(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(b)an(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(i,{[e]:y}),Object.assign(i,a(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(y=>y===void 0)&&(i.lazy=void 0))})();return u[e]=h,h},rE=new WeakMap;function kO(e,t,n,a,i){let o=n[e.id];if(gt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let v=rE.get(o);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let b=(async()=>{gt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),S={};for(let w in y){let E=y[w];if(E===void 0)continue;let C=rO(w),T=o[w]!==void 0&&w!=="hasErrorBoundary";C?an(!C,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?an(!T,`Route "${o.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):S[w]=E}Object.assign(o,S),Object.assign(o,{...a(o),lazy:void 0})})();return rE.set(o,b),b.catch(()=>{}),{lazyRoutePromise:b,lazyHandlerPromise:b}}let u=Object.keys(e.lazy),f=[],h;for(let v of u){if(i&&i.includes(v))continue;let b=dR({key:v,route:e,manifest:n,mapRouteProperties:a});b&&(f.push(b),v===t&&(h=b))}let m=f.length>0?Promise.all(f).then(()=>{}):void 0;return m==null||m.catch(()=>{}),h==null||h.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:h}}async function aE(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,o)=>{n[t[o].route.id]=i}),n}async function LO(e){return e.matches.some(t=>t.route.unstable_middleware)?fR(e,!1,()=>aE(e),(t,n)=>({[n]:{type:"error",result:t}})):aE(e)}async function fR(e,t,n,a){let{matches:i,request:o,params:u,context:f}=e,h={handlerResult:void 0};try{let m=i.flatMap(b=>b.route.unstable_middleware?b.route.unstable_middleware.map(y=>[b.route.id,y]):[]),v=await hR({request:o,params:u,context:f},m,t,h,n);return t?v:h.handlerResult}catch(m){if(!h.middlewareError)throw m;let v=await a(h.middlewareError.error,h.middlewareError.routeId);return h.handlerResult?Object.assign(h.handlerResult,v):v}}async function hR(e,t,n,a,i,o=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason?u.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${u.method} ${u.url}`);let f=t[o];if(!f)return a.handlerResult=await i(),a.handlerResult;let[h,m]=f,v=!1,b,y=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");v=!0,await hR(e,t,n,a,i,o+1)};try{let S=await m({request:e.request,params:e.params,context:e.context},y);return v?S===void 0?b:S:y()}catch(S){throw a.middlewareError?a.middlewareError.error!==S&&(a.middlewareError={routeId:h,error:S}):a.middlewareError={routeId:h,error:S},S}}function mR(e,t,n,a,i){let o=dR({key:"unstable_middleware",route:a.route,manifest:t,mapRouteProperties:e}),u=kO(a.route,dr(n.method)?"action":"loader",t,e,i);return{middleware:o,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function Bv(e,t,n,a,i,o,u,f=null){let h=!1,m=mR(e,t,n,a,i);return{...a,_lazyPromises:m,shouldLoad:u,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(v){return h=!0,f?typeof v=="boolean"?lh(a,{...f,defaultShouldRevalidate:v}):lh(a,f):u},resolve(v){return h||u||v&&n.method==="GET"&&(a.route.lazy||a.route.loader)?PO({request:n,match:a,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:v,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function fl(e,t,n,a,i,o,u,f=null){return a.map(h=>h.route.id!==i.route.id?{...h,shouldLoad:!1,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler:()=>!1,_lazyPromises:mR(e,t,n,h,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Bv(e,t,n,h,o,u,!0,f))}async function IO(e,t,n,a,i,o){n.some(m=>{var v;return(v=m._lazyPromises)==null?void 0:v.middleware})&&await Promise.all(n.map(m=>{var v;return(v=m._lazyPromises)==null?void 0:v.middleware}));let u={request:t,params:n[0].params,context:i,matches:n},h=await e({...u,fetcherKey:a,unstable_runClientMiddleware:m=>{let v=u;return fR(v,!1,()=>m({...v,fetcherKey:a,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(b,y)=>({[y]:{type:"error",result:b}}))}});try{await Promise.all(n.flatMap(m=>{var v,b;return[(v=m._lazyPromises)==null?void 0:v.handler,(b=m._lazyPromises)==null?void 0:b.route]}))}catch{}return h}async function PO({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:i,scopedContext:o}){let u,f,h=dr(e.method),m=h?"action":"loader",v=b=>{let y,S=new Promise((C,R)=>y=R);f=()=>y(),e.signal.addEventListener("abort",f);let w=C=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${t.route.id}]`)):b({request:e,params:t.params,context:o},...C!==void 0?[C]:[]),E=(async()=>{try{return{type:"data",result:await(i?i(R=>w(R)):w())}}catch(C){return{type:"error",result:C}}})();return Promise.race([E,S])};try{let b=h?t.route.action:t.route.loader;if(n||a)if(b){let y,[S]=await Promise.all([v(b).catch(w=>{y=w}),n,a]);if(y!==void 0)throw y;u=S}else{await n;let y=h?t.route.action:t.route.loader;if(y)[u]=await Promise.all([v(y),a]);else if(m==="action"){let S=new URL(e.url),w=S.pathname+S.search;throw Fr(405,{method:e.method,pathname:w,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(b)u=await v(b);else{let y=new URL(e.url),S=y.pathname+y.search;throw Fr(404,{pathname:S})}}catch(b){return{type:"error",result:b}}finally{f&&e.signal.removeEventListener("abort",f)}return u}async function FO(e){var a,i,o,u,f,h;let{result:t,type:n}=e;if(gR(t)){let m;try{let v=t.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?t.body==null?m=null:m=await t.json():m=await t.text()}catch(v){return{type:"error",error:v}}return n==="error"?{type:"error",error:new oh(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:"data",data:m,statusCode:t.status,headers:t.headers}}return n==="error"?dE(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new oh(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:yu(t)?t.status:void 0,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:yu(t)?t.status:void 0}:dE(t)?{type:"data",data:t.data,statusCode:(f=t.init)==null?void 0:f.status,headers:(h=t.init)!=null&&h.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function UO(e,t,n,a,i){let o=e.headers.get("Location");if(gt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Hy.test(o)){let u=a.slice(0,a.findIndex(f=>f.route.id===n)+1);o=$v(new URL(t.url),u,i,o),e.headers.set("Location",o)}return e}function sE(e,t,n){if(Hy.test(e)){let a=e,i=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=$r(i.pathname,n)!=null;if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}return e}function sl(e,t,n,a){let i=e.createURL(pR(t)).toString(),o={signal:n};if(a&&dr(a.formMethod)){let{formMethod:u,formEncType:f}=a;o.method=u.toUpperCase(),f==="application/json"?(o.headers=new Headers({"Content-Type":f}),o.body=JSON.stringify(a.json)):f==="text/plain"?o.body=a.text:f==="application/x-www-form-urlencoded"&&a.formData?o.body=Gv(a.formData):o.body=a.formData}return new Request(i,o)}function Gv(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function iE(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function zO(e,t,n,a=!1,i=!1){let o={},u=null,f,h=!1,m={},v=n&&ur(n[1])?n[1].error:void 0;return e.forEach(b=>{if(!(b.route.id in t))return;let y=b.route.id,S=t[y];if(gt(!Vi(S),"Cannot handle redirect results in processLoaderData"),ur(S)){let w=S.error;if(v!==void 0&&(w=v,v=void 0),u=u||{},i)u[y]=w;else{let E=zi(e,y);u[E.route.id]==null&&(u[E.route.id]=w)}a||(o[y]=cR),h||(h=!0,f=yu(S.error)?S.error.status:500),S.headers&&(m[y]=S.headers)}else o[y]=S.data,S.statusCode&&S.statusCode!==200&&!h&&(f=S.statusCode),S.headers&&(m[y]=S.headers)}),v!==void 0&&n&&(u={[n[0]]:v},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:u,statusCode:f||200,loaderHeaders:m}}function oE(e,t,n,a,i,o){let{loaderData:u,errors:f}=zO(t,n,a);return i.filter(h=>!h.matches||h.matches.some(m=>m.shouldLoad)).forEach(h=>{let{key:m,match:v,controller:b}=h,y=o[m];if(gt(y,"Did not find corresponding fetcher result"),!(b&&b.signal.aborted))if(ur(y)){let S=zi(e.matches,v==null?void 0:v.route.id);f&&f[S.route.id]||(f={...f,[S.route.id]:y.error}),e.fetchers.delete(m)}else if(Vi(y))gt(!1,"Unhandled fetcher revalidation redirect");else{let S=Ys(y.data);e.fetchers.set(m,S)}}),{loaderData:u,errors:f}}function lE(e,t,n,a){let i=Object.entries(t).filter(([,o])=>o!==cR).reduce((o,[u,f])=>(o[u]=f,o),{});for(let o of n){let u=o.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&o.route.loader&&(i[u]=e[u]),a&&a.hasOwnProperty(u))break}return i}function cE(e){return e?ur(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function zi(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function uE(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Fr(e,{pathname:t,routeId:n,method:a,type:i,message:o}={}){let u="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(u="Bad Request",a&&t&&n?f=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(f="Unable to encode submission body")):e===403?(u="Forbidden",f=`Route "${n}" does not match URL "${t}"`):e===404?(u="Not Found",f=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",a&&t&&n?f=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:a&&(f=`Invalid request method "${a.toUpperCase()}"`)),new oh(e||500,u,new Error(f),!0)}function Cf(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,i]=t[n];if(Vi(i))return{key:a,result:i}}}function pR(e){let t=typeof e=="string"?ui(e):e;return ri({...t,hash:""})}function VO(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function $O(e){return gR(e.result)&&_O.has(e.result.status)}function ur(e){return e.type==="error"}function Vi(e){return(e&&e.type)==="redirect"}function dE(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function gR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function HO(e){return RO.has(e.toUpperCase())}function dr(e){return EO.has(e.toUpperCase())}function By(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ru(e,t){let n=typeof t=="string"?ui(t).search:t.search;if(e[e.length-1].route.index&&By(n||""))return e[e.length-1];let a=iR(e);return a[a.length-1]}function fE(e){let{formMethod:t,formAction:n,formEncType:a,text:i,formData:o,json:u}=e;if(!(!t||!n||!a)){if(i!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:a,formData:o,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:u,text:void 0}}}function tv(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function BO(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Hc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function GO(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ys(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function qO(e,t){try{let n=e.sessionStorage.getItem(lR);if(n){let a=JSON.parse(n);for(let[i,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function ZO(e,t){if(t.size>0){let n={};for(let[a,i]of t)n[a]=[...i];try{e.sessionStorage.setItem(lR,JSON.stringify(n))}catch(a){an(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function YO(){let e,t,n=new Promise((a,i)=>{e=async o=>{a(o);try{await n}catch{}},t=async o=>{i(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var so=g.createContext(null);so.displayName="DataRouter";var Mu=g.createContext(null);Mu.displayName="DataRouterState";var Gy=g.createContext({isTransitioning:!1});Gy.displayName="ViewTransition";var vR=g.createContext(new Map);vR.displayName="Fetchers";var KO=g.createContext(null);KO.displayName="Await";var ua=g.createContext(null);ua.displayName="Navigation";var Gh=g.createContext(null);Gh.displayName="Location";var Hr=g.createContext({outlet:null,matches:[],isDataRoute:!1});Hr.displayName="Route";var qy=g.createContext(null);qy.displayName="RouteError";function QO(e,{relative:t}={}){gt(wl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=g.useContext(ua),{hash:i,pathname:o,search:u}=Iu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Ca([n,o])),a.createHref({pathname:f,search:u,hash:i})}function wl(){return g.useContext(Gh)!=null}function di(){return gt(wl(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(Gh).location}var yR="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function xR(e){g.useContext(ua).static||g.useLayoutEffect(e)}function ku(){let{isDataRoute:e}=g.useContext(Hr);return e?dM():XO()}function XO(){gt(wl(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(so),{basename:t,navigator:n}=g.useContext(ua),{matches:a}=g.useContext(Hr),{pathname:i}=di(),o=JSON.stringify(Hh(a)),u=g.useRef(!1);return xR(()=>{u.current=!0}),g.useCallback((h,m={})=>{if(an(u.current,yR),!u.current)return;if(typeof h=="number"){n.go(h);return}let v=Bh(h,JSON.parse(o),i,m.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:Ca([t,v.pathname])),(m.replace?n.replace:n.push)(v,m.state,m)},[t,n,o,i,e])}var bR=g.createContext(null);function Lu(){return g.useContext(bR)}function WO(e){let t=g.useContext(Hr).outlet;return t&&g.createElement(bR.Provider,{value:e},t)}function JO(){let{matches:e}=g.useContext(Hr),t=e[e.length-1];return t?t.params:{}}function Iu(e,{relative:t}={}){let{matches:n}=g.useContext(Hr),{pathname:a}=di(),i=JSON.stringify(Hh(n));return g.useMemo(()=>Bh(e,JSON.parse(i),a,t==="path"),[e,i,a,t])}function eM(e,t,n,a){gt(wl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=g.useContext(ua),{matches:o}=g.useContext(Hr),u=o[o.length-1],f=u?u.params:{},h=u?u.pathname:"/",m=u?u.pathnameBase:"/",v=u&&u.route;{let R=v&&v.path||"";SR(h,!v||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${R}">) 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.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let b=di(),y;y=b;let S=y.pathname||"/",w=S;if(m!=="/"){let R=m.replace(/^\//,"").split("/");w="/"+S.replace(/^\//,"").split("/").slice(R.length).join("/")}let E=Xs(e,{pathname:w});return an(v||E!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),an(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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.`),sM(E&&E.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Ca([m,i.encodeLocation?i.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:Ca([m,i.encodeLocation?i.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),o,n,a)}function tM(){let e=uM(),t=yu(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,u)}var nM=g.createElement(tM,null),rM=class extends g.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?g.createElement(Hr.Provider,{value:this.props.routeContext},g.createElement(qy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function aM({routeContext:e,match:t,children:n}){let a=g.useContext(so);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(Hr.Provider,{value:e},n)}function sM(e,t=[],n=null,a=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 h=i.findIndex(m=>m.route.id&&(o==null?void 0:o[m.route.id])!==void 0);gt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,h+1))}let u=!1,f=-1;if(n)for(let h=0;h<i.length;h++){let m=i[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(f=h),m.route.id){let{loaderData:v,errors:b}=n,y=m.route.loader&&!v.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||y){u=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}return i.reduceRight((h,m,v)=>{let b,y=!1,S=null,w=null;n&&(b=o&&m.route.id?o[m.route.id]:void 0,S=m.route.errorElement||nM,u&&(f<0&&v===0?(SR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,w=null):f===v&&(y=!0,w=m.route.hydrateFallbackElement||null)));let E=t.concat(i.slice(0,v+1)),C=()=>{let R;return b?R=S:y?R=w:m.route.Component?R=g.createElement(m.route.Component,null):m.route.element?R=m.route.element:R=h,g.createElement(aM,{match:m,routeContext:{outlet:h,matches:E,isDataRoute:n!=null},children:R})};return n&&(m.route.ErrorBoundary||m.route.errorElement||v===0)?g.createElement(rM,{location:n.location,revalidation:n.revalidation,component:S,error:b,children:C(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):C()},null)}function Zy(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function iM(e){let t=g.useContext(so);return gt(t,Zy(e)),t}function oM(e){let t=g.useContext(Mu);return gt(t,Zy(e)),t}function lM(e){let t=g.useContext(Hr);return gt(t,Zy(e)),t}function Yy(e){let t=lM(e),n=t.matches[t.matches.length-1];return gt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function cM(){return Yy("useRouteId")}function uM(){var a;let e=g.useContext(qy),t=oM("useRouteError"),n=Yy("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function dM(){let{router:e}=iM("useNavigate"),t=Yy("useNavigate"),n=g.useRef(!1);return xR(()=>{n.current=!0}),g.useCallback(async(i,o={})=>{an(n.current,yR),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var hE={};function SR(e,t,n){!t&&!hE[e]&&(hE[e]=!0,an(!1,n))}var mE={};function pE(e,t){!e&&!mE[t]&&(mE[t]=!0,console.warn(t))}function fM(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&an(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:g.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&an(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&an(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var hM=["HydrateFallback","hydrateFallbackElement"],mM=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function pM({router:e,flushSync:t}){let[n,a]=g.useState(e.state),[i,o]=g.useState(),[u,f]=g.useState({isTransitioning:!1}),[h,m]=g.useState(),[v,b]=g.useState(),[y,S]=g.useState(),w=g.useRef(new Map),E=g.useCallback((N,{deletedFetchers:O,flushSync:A,viewTransitionOpts:D})=>{N.fetchers.forEach((H,X)=>{H.data!==void 0&&w.current.set(X,H.data)}),O.forEach(H=>w.current.delete(H)),pE(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let L=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(pE(D==null||L,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!D||!L){t&&A?t(()=>a(N)):g.startTransition(()=>a(N));return}if(t&&A){t(()=>{v&&(h&&h.resolve(),v.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let H=e.window.document.startViewTransition(()=>{t(()=>a(N))});H.finished.finally(()=>{t(()=>{m(void 0),b(void 0),o(void 0),f({isTransitioning:!1})})}),t(()=>b(H));return}v?(h&&h.resolve(),v.skipTransition(),S({state:N,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(o(N),f({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,v,h]);g.useLayoutEffect(()=>e.subscribe(E),[e,E]),g.useEffect(()=>{u.isTransitioning&&!u.flushSync&&m(new mM)},[u]),g.useEffect(()=>{if(h&&i&&e.window){let N=i,O=h.promise,A=e.window.document.startViewTransition(async()=>{g.startTransition(()=>a(N)),await O});A.finished.finally(()=>{m(void 0),b(void 0),o(void 0),f({isTransitioning:!1})}),b(A)}},[i,h,e.window]),g.useEffect(()=>{h&&i&&n.location.key===i.location.key&&h.resolve()},[h,v,n.location,i]),g.useEffect(()=>{!u.isTransitioning&&y&&(o(y.state),f({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),S(void 0))},[u.isTransitioning,y]);let C=g.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:N=>e.navigate(N),push:(N,O,A)=>e.navigate(N,{state:O,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(N,O,A)=>e.navigate(N,{replace:!0,state:O,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[e]),R=e.basename||"/",T=g.useMemo(()=>({router:e,navigator:C,static:!1,basename:R}),[e,C,R]);return g.createElement(g.Fragment,null,g.createElement(so.Provider,{value:T},g.createElement(Mu.Provider,{value:n},g.createElement(vR.Provider,{value:w.current},g.createElement(Gy.Provider,{value:u},g.createElement(xM,{basename:R,location:n.location,navigationType:n.historyAction,navigator:C},g.createElement(gM,{routes:e.routes,future:e.future,state:n})))))),null)}var gM=g.memo(vM);function vM({routes:e,future:t,state:n}){return eM(e,void 0,n,t)}function yM({to:e,replace:t,state:n,relative:a}){gt(wl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=g.useContext(ua);an(!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}=g.useContext(Hr),{pathname:u}=di(),f=ku(),h=Bh(e,Hh(o),u,a==="path"),m=JSON.stringify(h);return g.useEffect(()=>{f(JSON.parse(m),{replace:t,state:n,relative:a})},[f,m,a,t,n]),null}function wR(e){return WO(e.context)}function xM({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:i,static:o=!1}){gt(!wl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=g.useMemo(()=>({basename:u,navigator:i,static:o,future:{}}),[u,i,o]);typeof n=="string"&&(n=ui(n));let{pathname:h="/",search:m="",hash:v="",state:b=null,key:y="default"}=n,S=g.useMemo(()=>{let w=$r(h,u);return w==null?null:{location:{pathname:w,search:m,hash:v,state:b,key:y},navigationType:a}},[u,h,m,v,b,y,a]);return an(S!=null,`<Router basename="${u}"> is not able to match the URL "${h}${m}${v}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:g.createElement(ua.Provider,{value:f},g.createElement(Gh.Provider,{children:t,value:S}))}var Gf="get",qf="application/x-www-form-urlencoded";function qh(e){return e!=null&&typeof e.tagName=="string"}function bM(e){return qh(e)&&e.tagName.toLowerCase()==="button"}function SM(e){return qh(e)&&e.tagName.toLowerCase()==="form"}function wM(e){return qh(e)&&e.tagName.toLowerCase()==="input"}function EM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function CM(e,t){return e.button===0&&(!t||t==="_self")&&!EM(e)}var Rf=null;function RM(){if(Rf===null)try{new FormData(document.createElement("form"),0),Rf=!1}catch{Rf=!0}return Rf}var _M=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nv(e){return e!=null&&!_M.has(e)?(an(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${qf}"`),null):e}function TM(e,t){let n,a,i,o,u;if(SM(e)){let f=e.getAttribute("action");a=f?$r(f,t):null,n=e.getAttribute("method")||Gf,i=nv(e.getAttribute("enctype"))||qf,o=new FormData(e)}else if(bM(e)||wM(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(a=h?$r(h,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Gf,i=nv(e.getAttribute("formenctype"))||nv(f.getAttribute("enctype"))||qf,o=new FormData(f,e),!RM()){let{name:m,type:v,value:b}=e;if(v==="image"){let y=m?`${m}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else m&&o.append(m,b)}}else{if(qh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Gf,a=null,i=qf,u=e}return o&&i==="text/plain"&&(u=o,o=void 0),{action:a,method:n.toLowerCase(),encType:i,formData:o,body:u}}function Ky(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function NM(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 AM(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 jM(e,t,n){let a=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let u=await NM(o,n);return u.links?u.links():[]}return[]}));return kM(a.flat(1).filter(AM).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function gE(e,t,n,a,i,o){let u=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,f=(h,m)=>{var v;return n[m].pathname!==h.pathname||((v=n[m].route.path)==null?void 0:v.endsWith("*"))&&n[m].params["*"]!==h.params["*"]};return o==="assets"?t.filter((h,m)=>u(h,m)||f(h,m)):o==="data"?t.filter((h,m)=>{var b;let v=a.routes[h.route.id];if(!v||!v.hasLoader)return!1;if(u(h,m)||f(h,m))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((b=n[0])==null?void 0:b.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function DM(e,t,{includeHydrateFallback:n}={}){return OM(e.map(a=>{let i=t.routes[a.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function OM(e){return[...new Set(e)]}function MM(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function kM(e,t){let n=new Set;return new Set(t),e.reduce((a,i)=>{let o=JSON.stringify(MM(i));return n.has(o)||(n.add(o),a.push({key:o,link:i})),a},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var LM=new Set([100,101,204,205]);function IM(e,t){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&$r(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function ER(){let e=g.useContext(so);return Ky(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function PM(){let e=g.useContext(Mu);return Ky(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Qy=g.createContext(void 0);Qy.displayName="FrameworkContext";function CR(){let e=g.useContext(Qy);return Ky(e,"You must render this element inside a <HydratedRouter> element"),e}function FM(e,t){let n=g.useContext(Qy),[a,i]=g.useState(!1),[o,u]=g.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:m,onMouseLeave:v,onTouchStart:b}=t,y=g.useRef(null);g.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let E=R=>{R.forEach(T=>{u(T.isIntersecting)})},C=new IntersectionObserver(E,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),g.useEffect(()=>{if(a){let E=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(E)}}},[a]);let S=()=>{i(!0)},w=()=>{i(!1),u(!1)};return n?e!=="intent"?[o,y,{}]:[o,y,{onFocus:Bc(f,S),onBlur:Bc(h,w),onMouseEnter:Bc(m,S),onMouseLeave:Bc(v,w),onTouchStart:Bc(b,S)}]:[!1,y,{}]}function Bc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function UM({page:e,...t}){let{router:n}=ER(),a=g.useMemo(()=>Xs(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?g.createElement(VM,{page:e,matches:a,...t}):null}function zM(e){let{manifest:t,routeModules:n}=CR(),[a,i]=g.useState([]);return g.useEffect(()=>{let o=!1;return jM(e,t,n).then(u=>{o||i(u)}),()=>{o=!0}},[e,t,n]),a}function VM({page:e,matches:t,...n}){let a=di(),{manifest:i,routeModules:o}=CR(),{basename:u}=ER(),{loaderData:f,matches:h}=PM(),m=g.useMemo(()=>gE(e,t,h,i,a,"data"),[e,t,h,i,a]),v=g.useMemo(()=>gE(e,t,h,i,a,"assets"),[e,t,h,i,a]),b=g.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let w=new Set,E=!1;if(t.forEach(R=>{var N;let T=i.routes[R.route.id];!T||!T.hasLoader||(!m.some(O=>O.route.id===R.route.id)&&R.route.id in f&&((N=o[R.route.id])!=null&&N.shouldRevalidate)||T.hasClientLoader?E=!0:w.add(R.route.id))}),w.size===0)return[];let C=IM(e,u);return E&&w.size>0&&C.searchParams.set("_routes",t.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[u,f,a,i,m,t,e,o]),y=g.useMemo(()=>DM(v,i),[v,i]),S=zM(v);return g.createElement(g.Fragment,null,b.map(w=>g.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),y.map(w=>g.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:E})=>g.createElement("link",{key:w,...E})))}function $M(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var RR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{RR&&(window.__reactRouterVersion="7.6.2")}catch{}function HM(e,t){return jO({basename:t==null?void 0:t.basename,unstable_getContext:t==null?void 0:t.unstable_getContext,future:t==null?void 0:t.future,history:XD({window:t==null?void 0:t.window}),hydrationData:BM(),routes:e,mapRouteProperties:fM,hydrationRouteProperties:hM,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function BM(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:GM(e.errors)}),e}function GM(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,i]of t)if(i&&i.__type==="RouteErrorResponse")n[a]=new oh(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let u=new o(i.message);u.stack="",n[a]=u}catch{}}if(n[a]==null){let o=new Error(i.message);o.stack="",n[a]=o}}else n[a]=i;return n}var _R=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,io=g.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:i,reloadDocument:o,replace:u,state:f,target:h,to:m,preventScrollReset:v,viewTransition:b,...y},S){let{basename:w}=g.useContext(ua),E=typeof m=="string"&&_R.test(m),C,R=!1;if(typeof m=="string"&&E&&(C=m,RR))try{let X=new URL(window.location.href),re=m.startsWith("//")?new URL(X.protocol+m):new URL(m),me=$r(re.pathname,w);re.origin===X.origin&&me!=null?m=me+re.search+re.hash:R=!0}catch{an(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=QO(m,{relative:i}),[N,O,A]=FM(a,y),D=YM(m,{replace:u,state:f,target:h,preventScrollReset:v,relative:i,viewTransition:b});function L(X){t&&t(X),X.defaultPrevented||D(X)}let H=g.createElement("a",{...y,...A,href:C||T,onClick:R||o?t:L,ref:$M(S,O),target:h,"data-discover":!E&&n==="render"?"true":void 0});return N&&!E?g.createElement(g.Fragment,null,H,g.createElement(UM,{page:T})):H});io.displayName="Link";var ch=g.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:i=!1,style:o,to:u,viewTransition:f,children:h,...m},v){let b=Iu(u,{relative:m.relative}),y=di(),S=g.useContext(Mu),{navigator:w,basename:E}=g.useContext(ua),C=S!=null&&JM(b)&&f===!0,R=w.encodeLocation?w.encodeLocation(b).pathname:b.pathname,T=y.pathname,N=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;n||(T=T.toLowerCase(),N=N?N.toLowerCase():null,R=R.toLowerCase()),N&&E&&(N=$r(N,E)||N);const O=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=T===R||!i&&T.startsWith(R)&&T.charAt(O)==="/",D=N!=null&&(N===R||!i&&N.startsWith(R)&&N.charAt(R.length)==="/"),L={isActive:A,isPending:D,isTransitioning:C},H=A?t:void 0,X;typeof a=="function"?X=a(L):X=[a,A?"active":null,D?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let re=typeof o=="function"?o(L):o;return g.createElement(io,{...m,"aria-current":H,className:X,ref:v,style:re,to:u,viewTransition:f},typeof h=="function"?h(L):h)});ch.displayName="NavLink";var qM=g.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:i,state:o,method:u=Gf,action:f,onSubmit:h,relative:m,preventScrollReset:v,viewTransition:b,...y},S)=>{let w=XM(),E=WM(f,{relative:m}),C=u.toLowerCase()==="get"?"get":"post",R=typeof f=="string"&&_R.test(f),T=N=>{if(h&&h(N),N.defaultPrevented)return;N.preventDefault();let O=N.nativeEvent.submitter,A=(O==null?void 0:O.getAttribute("formmethod"))||u;w(O||N.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:i,state:o,relative:m,preventScrollReset:v,viewTransition:b})};return g.createElement("form",{ref:S,method:C,action:E,onSubmit:a?h:T,...y,"data-discover":!R&&e==="render"?"true":void 0})});qM.displayName="Form";function ZM(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TR(e){let t=g.useContext(so);return gt(t,ZM(e)),t}function YM(e,{target:t,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:u}={}){let f=ku(),h=di(),m=Iu(e,{relative:o});return g.useCallback(v=>{if(CM(v,t)){v.preventDefault();let b=n!==void 0?n:ri(h)===ri(m);f(e,{replace:b,state:a,preventScrollReset:i,relative:o,viewTransition:u})}},[h,f,m,n,a,t,e,i,o,u])}var KM=0,QM=()=>`__${String(++KM)}__`;function XM(){let{router:e}=TR("useSubmit"),{basename:t}=g.useContext(ua),n=cM();return g.useCallback(async(a,i={})=>{let{action:o,method:u,encType:f,formData:h,body:m}=TM(a,t);if(i.navigate===!1){let v=i.fetcherKey||QM();await e.fetch(v,n,i.action||o,{preventScrollReset:i.preventScrollReset,formData:h,body:m,formMethod:i.method||u,formEncType:i.encType||f,flushSync:i.flushSync})}else await e.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:h,body:m,formMethod:i.method||u,formEncType:i.encType||f,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function WM(e,{relative:t}={}){let{basename:n}=g.useContext(ua),a=g.useContext(Hr);gt(a,"useFormAction must be used inside a RouteContext");let[i]=a.matches.slice(-1),o={...Iu(e||".",{relative:t})},u=di();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),h=f.getAll("index");if(h.some(v=>v==="")){f.delete("index"),h.filter(b=>b).forEach(b=>f.append("index",b));let v=f.toString();o.search=v?`?${v}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ca([n,o.pathname])),ri(o)}function JM(e,t={}){let n=g.useContext(Gy);gt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=TR("useViewTransitionState"),i=Iu(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=$r(n.currentLocation.pathname,a)||n.currentLocation.pathname,u=$r(n.nextLocation.pathname,a)||n.nextLocation.pathname;return ih(i.pathname,u)!=null||ih(i.pathname,o)!=null}[...LM];var El=tR();const e4=JC(El);/**
|
|
62
|
+
* react-router v7.6.2
|
|
63
|
+
*
|
|
64
|
+
* Copyright (c) Remix Software Inc.
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the MIT license found in the
|
|
67
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
68
|
+
*
|
|
69
|
+
* @license MIT
|
|
70
|
+
*/function t4(e){return g.createElement(pM,{flushSync:El.flushSync,...e})}function vE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function us(...e){return t=>{let n=!1;const a=e.map(i=>{const o=vE(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<a.length;i++){const o=a[i];typeof o=="function"?o():vE(e[i],null)}}}}function xt(...e){return g.useCallback(us(...e),e)}function ai(e){const t=n4(e),n=g.forwardRef((a,i)=>{const{children:o,...u}=a,f=g.Children.toArray(o),h=f.find(r4);if(h){const m=h.props.children,v=f.map(b=>b===h?g.Children.count(m)>1?g.Children.only(null):g.isValidElement(m)?m.props.children:null:b);return c.jsx(t,{...u,ref:i,children:g.isValidElement(m)?g.cloneElement(m,void 0,v):null})}return c.jsx(t,{...u,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var Zh=ai("Slot");function n4(e){const t=g.forwardRef((n,a)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const u=s4(i),f=a4(o,i.props);return i.type!==g.Fragment&&(f.ref=a?us(a,u):u),g.cloneElement(i,f)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NR=Symbol("radix.slottable");function AR(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=NR,t}function r4(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NR}function a4(e,t){const n={...t};for(const a in t){const i=e[a],o=t[a];/^on[A-Z]/.test(a)?i&&o?n[a]=(...f)=>{const h=o(...f);return i(...f),h}:i&&(n[a]=i):a==="style"?n[a]={...i,...o}:a==="className"&&(n[a]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function s4(e){var a,i;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.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 jR(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=jR(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function DR(){for(var e,t,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=jR(e))&&(a&&(a+=" "),a+=t);return a}const yE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xE=DR,Pu=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return xE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,u=Object.keys(i).map(m=>{const v=n==null?void 0:n[m],b=o==null?void 0:o[m];if(v===null)return null;const y=yE(v)||yE(b);return i[m][y]}),f=n&&Object.entries(n).reduce((m,v)=>{let[b,y]=v;return y===void 0||(m[b]=y),m},{}),h=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((m,v)=>{let{class:b,className:y,...S}=v;return Object.entries(S).every(w=>{let[E,C]=w;return Array.isArray(C)?C.includes({...o,...f}[E]):{...o,...f}[E]===C})?[...m,b,y]:m},[]);return xE(e,u,h,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
|
71
|
+
* @license lucide-react v0.475.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const i4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),OR=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/**
|
|
76
|
+
* @license lucide-react v0.475.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/var o4={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"};/**
|
|
81
|
+
* @license lucide-react v0.475.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const l4=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:i="",children:o,iconNode:u,...f},h)=>g.createElement("svg",{ref:h,...o4,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:OR("lucide",i),...f},[...u.map(([m,v])=>g.createElement(m,v)),...Array.isArray(o)?o:[o]]));/**
|
|
86
|
+
* @license lucide-react v0.475.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const et=(e,t)=>{const n=g.forwardRef(({className:a,...i},o)=>g.createElement(l4,{ref:o,iconNode:t,className:OR(`lucide-${i4(e)}`,a),...i}));return n.displayName=`${e}`,n};/**
|
|
91
|
+
* @license lucide-react v0.475.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const c4=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],MR=et("ArchiveRestore",c4);/**
|
|
96
|
+
* @license lucide-react v0.475.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const u4=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],d4=et("ArrowLeft",u4);/**
|
|
101
|
+
* @license lucide-react v0.475.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const f4=[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]],h4=et("Asterisk",f4);/**
|
|
106
|
+
* @license lucide-react v0.475.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const m4=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],p4=et("BadgeAlert",m4);/**
|
|
111
|
+
* @license lucide-react v0.475.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const g4=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],v4=et("BadgeCheck",g4);/**
|
|
116
|
+
* @license lucide-react v0.475.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const y4=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],x4=et("BookOpen",y4);/**
|
|
121
|
+
* @license lucide-react v0.475.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const b4=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],S4=et("Box",b4);/**
|
|
126
|
+
* @license lucide-react v0.475.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const w4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ta=et("Check",w4);/**
|
|
131
|
+
* @license lucide-react v0.475.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const E4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],gs=et("ChevronDown",E4);/**
|
|
136
|
+
* @license lucide-react v0.475.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const C4=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],R4=et("ChevronLeft",C4);/**
|
|
141
|
+
* @license lucide-react v0.475.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const _4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xy=et("ChevronRight",_4);/**
|
|
146
|
+
* @license lucide-react v0.475.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const T4=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Na=et("ChevronUp",T4);/**
|
|
151
|
+
* @license lucide-react v0.475.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const N4=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],kR=et("ChevronsUpDown",N4);/**
|
|
156
|
+
* @license lucide-react v0.475.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const A4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Yh=et("CircleAlert",A4);/**
|
|
161
|
+
* @license lucide-react v0.475.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const j4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Wy=et("CircleCheck",j4);/**
|
|
166
|
+
* @license lucide-react v0.475.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const D4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],LR=et("CircleHelp",D4);/**
|
|
171
|
+
* @license lucide-react v0.475.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const O4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],IR=et("CircleX",O4);/**
|
|
176
|
+
* @license lucide-react v0.475.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const M4=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],PR=et("Code",M4);/**
|
|
181
|
+
* @license lucide-react v0.475.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const k4=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]],L4=et("DatabaseZap",k4);/**
|
|
186
|
+
* @license lucide-react v0.475.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const I4=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],FR=et("Database",I4);/**
|
|
191
|
+
* @license lucide-react v0.475.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const P4=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],F4=et("EllipsisVertical",P4);/**
|
|
196
|
+
* @license lucide-react v0.475.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const U4=[["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"}]],vs=et("Ellipsis",U4);/**
|
|
201
|
+
* @license lucide-react v0.475.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const z4=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Jy=et("ExternalLink",z4);/**
|
|
206
|
+
* @license lucide-react v0.475.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const V4=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],$4=et("EyeOff",V4);/**
|
|
211
|
+
* @license lucide-react v0.475.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const H4=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],B4=et("Eye",H4);/**
|
|
216
|
+
* @license lucide-react v0.475.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const G4=[["path",{d:"M6 3h12l4 6-10 13L2 9Z",key:"1pcd5k"}],["path",{d:"M11 3 8 9l4 13 4-13-3-6",key:"1fcu3u"}],["path",{d:"M2 9h20",key:"16fsjt"}]],q4=et("Gem",G4);/**
|
|
221
|
+
* @license lucide-react v0.475.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const Z4=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["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"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],Y4=et("Grip",Z4);/**
|
|
226
|
+
* @license lucide-react v0.475.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const K4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],qi=et("Info",K4);/**
|
|
231
|
+
* @license lucide-react v0.475.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const Q4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ex=et("LoaderCircle",Q4);/**
|
|
236
|
+
* @license lucide-react v0.475.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const X4=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],W4=et("Lock",X4);/**
|
|
241
|
+
* @license lucide-react v0.475.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const J4=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],e3=et("MessageCircle",J4);/**
|
|
246
|
+
* @license lucide-react v0.475.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const t3=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],n3=et("Moon",t3);/**
|
|
251
|
+
* @license lucide-react v0.475.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const r3=[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],a3=et("PackagePlus",r3);/**
|
|
256
|
+
* @license lucide-react v0.475.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const s3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],i3=et("PanelLeft",s3);/**
|
|
261
|
+
* @license lucide-react v0.475.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const o3=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],UR=et("Play",o3);/**
|
|
266
|
+
* @license lucide-react v0.475.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const l3=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],c3=et("Plug",l3);/**
|
|
271
|
+
* @license lucide-react v0.475.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const u3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pa=et("Plus",u3);/**
|
|
276
|
+
* @license lucide-react v0.475.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const d3=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],f3=et("Scale",d3);/**
|
|
281
|
+
* @license lucide-react v0.475.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const h3=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],oo=et("Search",h3);/**
|
|
286
|
+
* @license lucide-react v0.475.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const m3=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],zR=et("Server",m3);/**
|
|
291
|
+
* @license lucide-react v0.475.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const p3=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],g3=et("Settings2",p3);/**
|
|
296
|
+
* @license lucide-react v0.475.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const v3=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],y3=et("Settings",v3);/**
|
|
301
|
+
* @license lucide-react v0.475.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const x3=[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]],b3=et("SquareArrowOutUpRight",x3);/**
|
|
306
|
+
* @license lucide-react v0.475.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const S3=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],w3=et("Sun",S3);/**
|
|
311
|
+
* @license lucide-react v0.475.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const E3=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],C3=et("Table",E3);/**
|
|
316
|
+
* @license lucide-react v0.475.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const R3=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],VR=et("Timer",R3);/**
|
|
321
|
+
* @license lucide-react v0.475.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const _3=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],tx=et("Trash2",_3);/**
|
|
326
|
+
* @license lucide-react v0.475.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const T3=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],N3=et("TriangleAlert",T3);/**
|
|
331
|
+
* @license lucide-react v0.475.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const A3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uh=et("X",A3),rv=768;function j3(){const[e,t]=g.useState(void 0);return g.useEffect(()=>{const n=window.matchMedia(`(max-width: ${rv-1}px)`),a=()=>{t(window.innerWidth<rv)};return n.addEventListener("change",a),t(window.innerWidth<rv),()=>n.removeEventListener("change",a)},[]),!!e}const nx="-",D3=e=>{const t=M3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{const f=u.split(nx);return f[0]===""&&f.length!==1&&f.shift(),$R(f,t)||O3(u)},getConflictingClassGroupIds:(u,f)=>{const h=n[u]||[];return f&&a[u]?[...h,...a[u]]:h}}},$R=(e,t)=>{var u;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),i=a?$R(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(nx);return(u=t.validators.find(({validator:f})=>f(o)))==null?void 0:u.classGroupId},bE=/^\[(.+)\]$/,O3=e=>{if(bE.test(e)){const t=bE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},M3=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const i in n)qv(n[i],a,i,t);return a},qv=(e,t,n,a)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:SE(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(k3(i)){qv(i(a),t,n,a);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,u])=>{qv(u,SE(t,o),n,a)})})},SE=(e,t)=>{let n=e;return t.split(nx).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},k3=e=>e.isThemeGetter,L3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const i=(o,u)=>{n.set(o,u),t++,t>e&&(t=0,a=n,n=new Map)};return{get(o){let u=n.get(o);if(u!==void 0)return u;if((u=a.get(o))!==void 0)return i(o,u),u},set(o,u){n.has(o)?n.set(o,u):i(o,u)}}},Zv="!",Yv=":",I3=Yv.length,P3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=i=>{const o=[];let u=0,f=0,h=0,m;for(let w=0;w<i.length;w++){let E=i[w];if(u===0&&f===0){if(E===Yv){o.push(i.slice(h,w)),h=w+I3;continue}if(E==="/"){m=w;continue}}E==="["?u++:E==="]"?u--:E==="("?f++:E===")"&&f--}const v=o.length===0?i:i.substring(h),b=F3(v),y=b!==v,S=m&&m>h?m-h:void 0;return{modifiers:o,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:S}};if(t){const i=t+Yv,o=a;a=u=>u.startsWith(i)?o(u.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:u,maybePostfixModifierPosition:void 0}}if(n){const i=a;a=o=>n({className:o,parseClassName:i})}return a},F3=e=>e.endsWith(Zv)?e.substring(0,e.length-1):e.startsWith(Zv)?e.substring(1):e,U3=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const i=[];let o=[];return a.forEach(u=>{u[0]==="["||t[u]?(i.push(...o.sort(),u),o=[]):o.push(u)}),i.push(...o.sort()),i}},z3=e=>({cache:L3(e.cacheSize),parseClassName:P3(e),sortModifiers:U3(e),...D3(e)}),V3=/\s+/,$3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:i,sortModifiers:o}=t,u=[],f=e.trim().split(V3);let h="";for(let m=f.length-1;m>=0;m-=1){const v=f[m],{isExternal:b,modifiers:y,hasImportantModifier:S,baseClassName:w,maybePostfixModifierPosition:E}=n(v);if(b){h=v+(h.length>0?" "+h:h);continue}let C=!!E,R=a(C?w.substring(0,E):w);if(!R){if(!C){h=v+(h.length>0?" "+h:h);continue}if(R=a(w),!R){h=v+(h.length>0?" "+h:h);continue}C=!1}const T=o(y).join(":"),N=S?T+Zv:T,O=N+R;if(u.includes(O))continue;u.push(O);const A=i(R,C);for(let D=0;D<A.length;++D){const L=A[D];u.push(N+L)}h=v+(h.length>0?" "+h:h)}return h};function H3(){let e=0,t,n,a="";for(;e<arguments.length;)(t=arguments[e++])&&(n=HR(t))&&(a&&(a+=" "),a+=n);return a}const HR=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=HR(e[a]))&&(n&&(n+=" "),n+=t);return n};function B3(e,...t){let n,a,i,o=u;function u(h){const m=t.reduce((v,b)=>b(v),e());return n=z3(m),a=n.cache.get,i=n.cache.set,o=f,f(h)}function f(h){const m=a(h);if(m)return m;const v=$3(h,n);return i(h,v),v}return function(){return o(H3.apply(null,arguments))}}const yn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},BR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,GR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,G3=/^\d+\/\d+$/,q3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Z3=/\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$/,Y3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,K3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Q3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jo=e=>G3.test(e),ft=e=>!!e&&!Number.isNaN(Number(e)),Zs=e=>!!e&&Number.isInteger(Number(e)),av=e=>e.endsWith("%")&&ft(e.slice(0,-1)),ts=e=>q3.test(e),X3=()=>!0,W3=e=>Z3.test(e)&&!Y3.test(e),qR=()=>!1,J3=e=>K3.test(e),ek=e=>Q3.test(e),tk=e=>!Le(e)&&!Ie(e),nk=e=>Cl(e,KR,qR),Le=e=>BR.test(e),Fi=e=>Cl(e,QR,W3),sv=e=>Cl(e,ok,ft),wE=e=>Cl(e,ZR,qR),rk=e=>Cl(e,YR,ek),_f=e=>Cl(e,XR,J3),Ie=e=>GR.test(e),Gc=e=>Rl(e,QR),ak=e=>Rl(e,lk),EE=e=>Rl(e,ZR),sk=e=>Rl(e,KR),ik=e=>Rl(e,YR),Tf=e=>Rl(e,XR,!0),Cl=(e,t,n)=>{const a=BR.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Rl=(e,t,n=!1)=>{const a=GR.exec(e);return a?a[1]?t(a[1]):n:!1},ZR=e=>e==="position"||e==="percentage",YR=e=>e==="image"||e==="url",KR=e=>e==="length"||e==="size"||e==="bg-size",QR=e=>e==="length",ok=e=>e==="number",lk=e=>e==="family-name",XR=e=>e==="shadow",ck=()=>{const e=yn("color"),t=yn("font"),n=yn("text"),a=yn("font-weight"),i=yn("tracking"),o=yn("leading"),u=yn("breakpoint"),f=yn("container"),h=yn("spacing"),m=yn("radius"),v=yn("shadow"),b=yn("inset-shadow"),y=yn("text-shadow"),S=yn("drop-shadow"),w=yn("blur"),E=yn("perspective"),C=yn("aspect"),R=yn("ease"),T=yn("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...O(),Ie,Le],D=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],H=()=>[Ie,Le,h],X=()=>[Jo,"full","auto",...H()],re=()=>[Zs,"none","subgrid",Ie,Le],me=()=>["auto",{span:["full",Zs,Ie,Le]},Zs,Ie,Le],V=()=>[Zs,"auto",Ie,Le],le=()=>["auto","min","max","fr",Ie,Le],ue=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...H()],Z=()=>[Jo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],$=()=>[e,Ie,Le],se=()=>[...O(),EE,wE,{position:[Ie,Le]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",sk,nk,{size:[Ie,Le]}],P=()=>[av,Gc,Fi],q=()=>["","none","full",m,Ie,Le],ie=()=>["",ft,Gc,Fi],he=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[ft,av,EE,wE],_e=()=>["","none",w,Ie,Le],be=()=>["none",ft,Ie,Le],Te=()=>["none",ft,Ie,Le],Me=()=>[ft,Ie,Le],Ge=()=>[Jo,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ts],breakpoint:[ts],color:[X3],container:[ts],"drop-shadow":[ts],ease:["in","out","in-out"],font:[tk],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ts],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ts],shadow:[ts],spacing:["px",ft],text:[ts],"text-shadow":[ts],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jo,Le,Ie,C]}],container:["container"],columns:[{columns:[ft,Le,Ie,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],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:[Zs,"auto",Ie,Le]}],basis:[{basis:[Jo,"full","auto",f,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ft,Jo,"auto","initial","none",Le]}],grow:[{grow:["",ft,Ie,Le]}],shrink:[{shrink:["",ft,Ie,Le]}],order:[{order:[Zs,"first","last","none",Ie,Le]}],"grid-cols":[{"grid-cols":re()}],"col-start-end":[{col:me()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":re()}],"row-start-end":[{row:me()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":le()}],"auto-rows":[{"auto-rows":le()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...ue(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...ue()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":ue()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],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":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[f,"screen",...Z()]}],"min-w":[{"min-w":[f,"screen","none",...Z()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,Gc,Fi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ie,sv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",av,Le]}],"font-family":[{font:[ak,Le,t]}],"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:[i,Ie,Le]}],"line-clamp":[{"line-clamp":[ft,"none",Ie,sv]}],leading:[{leading:[o,...H()]}],"list-image":[{"list-image":["none",Ie,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[ft,"from-font","auto",Ie,Fi]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[ft,"auto",Ie,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zs,Ie,Le],radial:["",Ie,Le],conic:[Zs,Ie,Le]},ik,rk]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ft,Ie,Le]}],"outline-w":[{outline:["",ft,Gc,Fi]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",v,Tf,_f]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",b,Tf,_f]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[ft,Fi]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",y,Tf,_f]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[ft,Ie,Le]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ft]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Ie,Le]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[ft]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Le]}],filter:[{filter:["","none",Ie,Le]}],blur:[{blur:_e()}],brightness:[{brightness:[ft,Ie,Le]}],contrast:[{contrast:[ft,Ie,Le]}],"drop-shadow":[{"drop-shadow":["","none",S,Tf,_f]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",ft,Ie,Le]}],"hue-rotate":[{"hue-rotate":[ft,Ie,Le]}],invert:[{invert:["",ft,Ie,Le]}],saturate:[{saturate:[ft,Ie,Le]}],sepia:[{sepia:["",ft,Ie,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Le]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[ft,Ie,Le]}],"backdrop-contrast":[{"backdrop-contrast":[ft,Ie,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ft,Ie,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ft,Ie,Le]}],"backdrop-invert":[{"backdrop-invert":["",ft,Ie,Le]}],"backdrop-opacity":[{"backdrop-opacity":[ft,Ie,Le]}],"backdrop-saturate":[{"backdrop-saturate":[ft,Ie,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",ft,Ie,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ft,"initial",Ie,Le]}],ease:[{ease:["linear","initial",R,Ie,Le]}],delay:[{delay:[ft,Ie,Le]}],animate:[{animate:["none",T,Ie,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,Ie,Le]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[Ie,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie,Le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",Ie,Le]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[ft,Gc,Fi,sv]}],stroke:[{stroke:["none",...$()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},uk=B3(ck);function ye(...e){return uk(DR(e))}const rx=Pu("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Ue({className:e,variant:t,size:n,asChild:a=!1,...i}){const o=a?Zh:"button";return c.jsx(o,{"data-slot":"button",className:ye(rx({variant:t,size:n,className:e})),...i})}function Ut({className:e,type:t,...n}){return c.jsx("input",{type:t,"data-slot":"input",className:ye("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var dk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=dk.reduce((e,t)=>{const n=ai(`Primitive.${t}`),a=g.forwardRef((i,o)=>{const{asChild:u,...f}=i,h=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(h,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function WR(e,t){e&&El.flushSync(()=>e.dispatchEvent(t))}var fk="Separator",CE="horizontal",hk=["horizontal","vertical"],JR=g.forwardRef((e,t)=>{const{decorative:n,orientation:a=CE,...i}=e,o=mk(a)?a:CE,f=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return c.jsx(We.div,{"data-orientation":o,...f,...i,ref:t})});JR.displayName=fk;function mk(e){return hk.includes(e)}var pk=JR;function Fu({className:e,orientation:t="horizontal",decorative:n=!0,...a}){return c.jsx(pk,{"data-slot":"separator",decorative:n,orientation:t,className:ye("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...a})}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 gk(e,t){const n=g.createContext(t),a=o=>{const{children:u,...f}=o,h=g.useMemo(()=>f,Object.values(f));return c.jsx(n.Provider,{value:h,children:u})};a.displayName=e+"Provider";function i(o){const u=g.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,i]}function Br(e,t=[]){let n=[];function a(o,u){const f=g.createContext(u),h=n.length;n=[...n,u];const m=b=>{var R;const{scope:y,children:S,...w}=b,E=((R=y==null?void 0:y[e])==null?void 0:R[h])||f,C=g.useMemo(()=>w,Object.values(w));return c.jsx(E.Provider,{value:C,children:S})};m.displayName=o+"Provider";function v(b,y){var E;const S=((E=y==null?void 0:y[e])==null?void 0:E[h])||f,w=g.useContext(S);if(w)return w;if(u!==void 0)return u;throw new Error(`\`${b}\` must be used within \`${o}\``)}return[m,v]}const i=()=>{const o=n.map(u=>g.createContext(u));return function(f){const h=(f==null?void 0:f[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return i.scopeName=e,[a,vk(i,...t)]}function vk(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const u=a.reduce((f,{useScope:h,scopeName:m})=>{const b=h(o)[`__scope${m}`];return{...f,...b}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var Pn=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},yk=eR[" useId ".trim().toString()]||(()=>{}),xk=0;function jn(e){const[t,n]=g.useState(yk());return Pn(()=>{n(a=>a??String(xk++))},[e]),t?`radix-${t}`:""}var bk=eR[" useInsertionEffect ".trim().toString()]||Pn;function ds({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[i,o,u]=Sk({defaultProp:t,onChange:n}),f=e!==void 0,h=f?e:i;{const v=g.useRef(e!==void 0);g.useEffect(()=>{const b=v.current;b!==f&&console.warn(`${a} is changing from ${b?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=f},[f,a])}const m=g.useCallback(v=>{var b;if(f){const y=wk(v)?v(e):v;y!==e&&((b=u.current)==null||b.call(u,y))}else o(v)},[f,e,o,u]);return[h,m]}function Sk({defaultProp:e,onChange:t}){const[n,a]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return bk(()=>{o.current=t},[t]),g.useEffect(()=>{var u;i.current!==n&&((u=o.current)==null||u.call(o,n),i.current=n)},[n,i]),[n,a,o]}function wk(e){return typeof e=="function"}function Aa(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function Ek(e,t=globalThis==null?void 0:globalThis.document){const n=Aa(e);g.useEffect(()=>{const a=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var Ck="DismissableLayer",Kv="dismissableLayer.update",Rk="dismissableLayer.pointerDownOutside",_k="dismissableLayer.focusOutside",RE,e1=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lo=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...h}=e,m=g.useContext(e1),[v,b]=g.useState(null),y=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=g.useState({}),w=xt(t,L=>b(L)),E=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=E.indexOf(C),T=v?E.indexOf(v):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,O=T>=R,A=Ak(L=>{const H=L.target,X=[...m.branches].some(re=>re.contains(H));!O||X||(i==null||i(L),u==null||u(L),L.defaultPrevented||f==null||f())},y),D=jk(L=>{const H=L.target;[...m.branches].some(re=>re.contains(H))||(o==null||o(L),u==null||u(L),L.defaultPrevented||f==null||f())},y);return Ek(L=>{T===m.layers.size-1&&(a==null||a(L),!L.defaultPrevented&&f&&(L.preventDefault(),f()))},y),g.useEffect(()=>{if(v)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(RE=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(v)),m.layers.add(v),_E(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=RE)}},[v,y,n,m]),g.useEffect(()=>()=>{v&&(m.layers.delete(v),m.layersWithOutsidePointerEventsDisabled.delete(v),_E())},[v,m]),g.useEffect(()=>{const L=()=>S({});return document.addEventListener(Kv,L),()=>document.removeEventListener(Kv,L)},[]),c.jsx(We.div,{...h,ref:w,style:{pointerEvents:N?O?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,A.onPointerDownCapture)})});lo.displayName=Ck;var Tk="DismissableLayerBranch",Nk=g.forwardRef((e,t)=>{const n=g.useContext(e1),a=g.useRef(null),i=xt(t,a);return g.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(We.div,{...e,ref:i})});Nk.displayName=Tk;function Ak(e,t=globalThis==null?void 0:globalThis.document){const n=Aa(e),a=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let h=function(){t1(Rk,n,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=h,t.addEventListener("click",i.current,{once:!0})):h()}else t.removeEventListener("click",i.current);a.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function jk(e,t=globalThis==null?void 0:globalThis.document){const n=Aa(e),a=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!a.current&&t1(_k,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function _E(){const e=new CustomEvent(Kv);document.dispatchEvent(e)}function t1(e,t,n,{discrete:a}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),a?WR(i,o):i.dispatchEvent(o)}var iv="focusScope.autoFocusOnMount",ov="focusScope.autoFocusOnUnmount",TE={bubbles:!1,cancelable:!0},Dk="FocusScope",Uu=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...u}=e,[f,h]=g.useState(null),m=Aa(i),v=Aa(o),b=g.useRef(null),y=xt(t,E=>h(E)),S=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(a){let E=function(N){if(S.paused||!f)return;const O=N.target;f.contains(O)?b.current=O:Ks(b.current,{select:!0})},C=function(N){if(S.paused||!f)return;const O=N.relatedTarget;O!==null&&(f.contains(O)||Ks(b.current,{select:!0}))},R=function(N){if(document.activeElement===document.body)for(const A of N)A.removedNodes.length>0&&Ks(f)};document.addEventListener("focusin",E),document.addEventListener("focusout",C);const T=new MutationObserver(R);return f&&T.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",C),T.disconnect()}}},[a,f,S.paused]),g.useEffect(()=>{if(f){AE.add(S);const E=document.activeElement;if(!f.contains(E)){const R=new CustomEvent(iv,TE);f.addEventListener(iv,m),f.dispatchEvent(R),R.defaultPrevented||(Ok(Pk(n1(f)),{select:!0}),document.activeElement===E&&Ks(f))}return()=>{f.removeEventListener(iv,m),setTimeout(()=>{const R=new CustomEvent(ov,TE);f.addEventListener(ov,v),f.dispatchEvent(R),R.defaultPrevented||Ks(E??document.body,{select:!0}),f.removeEventListener(ov,v),AE.remove(S)},0)}}},[f,m,v,S]);const w=g.useCallback(E=>{if(!n&&!a||S.paused)return;const C=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,R=document.activeElement;if(C&&R){const T=E.currentTarget,[N,O]=Mk(T);N&&O?!E.shiftKey&&R===O?(E.preventDefault(),n&&Ks(N,{select:!0})):E.shiftKey&&R===N&&(E.preventDefault(),n&&Ks(O,{select:!0})):R===T&&E.preventDefault()}},[n,a,S.paused]);return c.jsx(We.div,{tabIndex:-1,...u,ref:y,onKeyDown:w})});Uu.displayName=Dk;function Ok(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(Ks(a,{select:t}),document.activeElement!==n)return}function Mk(e){const t=n1(e),n=NE(t,e),a=NE(t.reverse(),e);return[n,a]}function n1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const i=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||i?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function NE(e,t){for(const n of e)if(!kk(n,{upTo:t}))return n}function kk(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 Lk(e){return e instanceof HTMLInputElement&&"select"in e}function Ks(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Lk(e)&&t&&e.select()}}var AE=Ik();function Ik(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jE(e,t),e.unshift(t)},remove(t){var n;e=jE(e,t),(n=e[0])==null||n.resume()}}}function jE(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function Pk(e){return e.filter(t=>t.tagName!=="A")}var Fk="Portal",co=g.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[i,o]=g.useState(!1);Pn(()=>o(!0),[]);const u=n||i&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?e4.createPortal(c.jsx(We.div,{...a,ref:t}),u):null});co.displayName=Fk;function Uk(e,t){return g.useReducer((n,a)=>t[n][a]??n,e)}var nr=e=>{const{present:t,children:n}=e,a=zk(t),i=typeof n=="function"?n({present:a.isPresent}):g.Children.only(n),o=xt(a.ref,Vk(i));return typeof n=="function"||a.isPresent?g.cloneElement(i,{ref:o}):null};nr.displayName="Presence";function zk(e){const[t,n]=g.useState(),a=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),u=e?"mounted":"unmounted",[f,h]=Uk(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const m=Nf(a.current);o.current=f==="mounted"?m:"none"},[f]),Pn(()=>{const m=a.current,v=i.current;if(v!==e){const y=o.current,S=Nf(m);e?h("MOUNT"):S==="none"||(m==null?void 0:m.display)==="none"?h("UNMOUNT"):h(v&&y!==S?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,h]),Pn(()=>{if(t){let m;const v=t.ownerDocument.defaultView??window,b=S=>{const E=Nf(a.current).includes(S.animationName);if(S.target===t&&E&&(h("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},y=S=>{S.target===t&&(o.current=Nf(a.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{v.clearTimeout(m),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:g.useCallback(m=>{a.current=m?getComputedStyle(m):null,n(m)},[])}}function Nf(e){return(e==null?void 0:e.animationName)||"none"}function Vk(e){var a,i;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lv=0;function Kh(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??DE()),document.body.insertAdjacentElement("beforeend",e[1]??DE()),lv++,()=>{lv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lv--}},[])}function DE(){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 ba=function(){return ba=Object.assign||function(t){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ba.apply(this,arguments)};function r1(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]]);return n}function $k(e,t,n){if(n||arguments.length===2)for(var a=0,i=t.length,o;a<i;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var Zf="right-scroll-bar-position",Yf="width-before-scroll-bar",Hk="with-scroll-bars-hidden",Bk="--removed-body-scroll-bar-size";function cv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Gk(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var i=n.value;i!==a&&(n.value=a,n.callback(a,i))}}}})[0];return n.callback=t,n.facade}var qk=typeof window<"u"?g.useLayoutEffect:g.useEffect,OE=new WeakMap;function Zk(e,t){var n=Gk(null,function(a){return e.forEach(function(i){return cv(i,a)})});return qk(function(){var a=OE.get(n);if(a){var i=new Set(a),o=new Set(e),u=n.current;i.forEach(function(f){o.has(f)||cv(f,null)}),o.forEach(function(f){i.has(f)||cv(f,u)})}OE.set(n,e)},[e]),n}function Yk(e){return e}function Kk(e,t){t===void 0&&(t=Yk);var n=[],a=!1,i={read:function(){if(a)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 u=t(o,a);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(a=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(o),u=n}var h=function(){var v=u;u=[],v.forEach(o)},m=function(){return Promise.resolve().then(h)};m(),n={push:function(v){u.push(v),m()},filter:function(v){return u=u.filter(v),n}}}};return i}function Qk(e){e===void 0&&(e={});var t=Kk(null);return t.options=ba({async:!0,ssr:!1},e),t}var a1=function(e){var t=e.sideCar,n=r1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return g.createElement(a,ba({},n))};a1.isSideCarExport=!0;function Xk(e,t){return e.useMedium(t),a1}var s1=Qk(),uv=function(){},Qh=g.forwardRef(function(e,t){var n=g.useRef(null),a=g.useState({onScrollCapture:uv,onWheelCapture:uv,onTouchMoveCapture:uv}),i=a[0],o=a[1],u=e.forwardProps,f=e.children,h=e.className,m=e.removeScrollBar,v=e.enabled,b=e.shards,y=e.sideCar,S=e.noRelative,w=e.noIsolation,E=e.inert,C=e.allowPinchZoom,R=e.as,T=R===void 0?"div":R,N=e.gapMode,O=r1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=y,D=Zk([n,t]),L=ba(ba({},O),i);return g.createElement(g.Fragment,null,v&&g.createElement(A,{sideCar:s1,removeScrollBar:m,shards:b,noRelative:S,noIsolation:w,inert:E,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:N}),u?g.cloneElement(g.Children.only(f),ba(ba({},L),{ref:D})):g.createElement(T,ba({},L,{className:h,ref:D}),f))});Qh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qh.classNames={fullWidth:Yf,zeroRight:Zf};var Wk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Jk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Wk();return t&&e.setAttribute("nonce",t),e}function eL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Jk())&&(eL(t,n),tL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rL=function(){var e=nL();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},i1=function(){var e=rL(),t=function(n){var a=n.styles,i=n.dynamic;return e(a,i),null};return t},aL={left:0,top:0,right:0,gap:0},dv=function(e){return parseInt(e||"",10)||0},sL=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[dv(n),dv(a),dv(i)]},iL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aL;var t=sL(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},oL=i1(),hl="data-scroll-locked",lL=function(e,t,n,a){var i=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
336
|
+
.`.concat(Hk,` {
|
|
337
|
+
overflow: hidden `).concat(a,`;
|
|
338
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
339
|
+
}
|
|
340
|
+
body[`).concat(hl,`] {
|
|
341
|
+
overflow: hidden `).concat(a,`;
|
|
342
|
+
overscroll-behavior: contain;
|
|
343
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
344
|
+
padding-left: `.concat(i,`px;
|
|
345
|
+
padding-top: `).concat(o,`px;
|
|
346
|
+
padding-right: `).concat(u,`px;
|
|
347
|
+
margin-left:0;
|
|
348
|
+
margin-top:0;
|
|
349
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
350
|
+
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.`).concat(Zf,` {
|
|
354
|
+
right: `).concat(f,"px ").concat(a,`;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.`).concat(Yf,` {
|
|
358
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.`).concat(Zf," .").concat(Zf,` {
|
|
362
|
+
right: 0 `).concat(a,`;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.`).concat(Yf," .").concat(Yf,` {
|
|
366
|
+
margin-right: 0 `).concat(a,`;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
body[`).concat(hl,`] {
|
|
370
|
+
`).concat(Bk,": ").concat(f,`px;
|
|
371
|
+
}
|
|
372
|
+
`)},ME=function(){var e=parseInt(document.body.getAttribute(hl)||"0",10);return isFinite(e)?e:0},cL=function(){g.useEffect(function(){return document.body.setAttribute(hl,(ME()+1).toString()),function(){var e=ME()-1;e<=0?document.body.removeAttribute(hl):document.body.setAttribute(hl,e.toString())}},[])},uL=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,i=a===void 0?"margin":a;cL();var o=g.useMemo(function(){return iL(i)},[i]);return g.createElement(oL,{styles:lL(o,!t,i,n?"":"!important")})},Qv=!1;if(typeof window<"u")try{var Af=Object.defineProperty({},"passive",{get:function(){return Qv=!0,!0}});window.addEventListener("test",Af,Af),window.removeEventListener("test",Af,Af)}catch{Qv=!1}var el=Qv?{passive:!1}:!1,dL=function(e){return e.tagName==="TEXTAREA"},o1=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dL(e)&&n[t]==="visible")},fL=function(e){return o1(e,"overflowY")},hL=function(e){return o1(e,"overflowX")},kE=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var i=l1(e,a);if(i){var o=c1(e,a),u=o[1],f=o[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},mL=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},pL=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},l1=function(e,t){return e==="v"?fL(t):hL(t)},c1=function(e,t){return e==="v"?mL(t):pL(t)},gL=function(e,t){return e==="h"&&t==="rtl"?-1:1},vL=function(e,t,n,a,i){var o=gL(e,window.getComputedStyle(t).direction),u=o*a,f=n.target,h=t.contains(f),m=!1,v=u>0,b=0,y=0;do{if(!f)break;var S=c1(e,f),w=S[0],E=S[1],C=S[2],R=E-C-o*w;(w||R)&&l1(e,f)&&(b+=R,y+=w);var T=f.parentNode;f=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!h&&f!==document.body||h&&(t.contains(f)||t===f));return(v&&Math.abs(b)<1||!v&&Math.abs(y)<1)&&(m=!0),m},jf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},LE=function(e){return[e.deltaX,e.deltaY]},IE=function(e){return e&&"current"in e?e.current:e},yL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xL=function(e){return`
|
|
373
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
374
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
375
|
+
`)},bL=0,tl=[];function SL(e){var t=g.useRef([]),n=g.useRef([0,0]),a=g.useRef(),i=g.useState(bL++)[0],o=g.useState(i1)[0],u=g.useRef(e);g.useEffect(function(){u.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var E=$k([e.lockRef.current],(e.shards||[]).map(IE),!0).filter(Boolean);return E.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),E.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var f=g.useCallback(function(E,C){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!u.current.allowPinchZoom;var R=jf(E),T=n.current,N="deltaX"in E?E.deltaX:T[0]-R[0],O="deltaY"in E?E.deltaY:T[1]-R[1],A,D=E.target,L=Math.abs(N)>Math.abs(O)?"h":"v";if("touches"in E&&L==="h"&&D.type==="range")return!1;var H=kE(L,D);if(!H)return!0;if(H?A=L:(A=L==="v"?"h":"v",H=kE(L,D)),!H)return!1;if(!a.current&&"changedTouches"in E&&(N||O)&&(a.current=A),!A)return!0;var X=a.current||A;return vL(X,C,E,X==="h"?N:O)},[]),h=g.useCallback(function(E){var C=E;if(!(!tl.length||tl[tl.length-1]!==o)){var R="deltaY"in C?LE(C):jf(C),T=t.current.filter(function(A){return A.name===C.type&&(A.target===C.target||C.target===A.shadowParent)&&yL(A.delta,R)})[0];if(T&&T.should){C.cancelable&&C.preventDefault();return}if(!T){var N=(u.current.shards||[]).map(IE).filter(Boolean).filter(function(A){return A.contains(C.target)}),O=N.length>0?f(C,N[0]):!u.current.noIsolation;O&&C.cancelable&&C.preventDefault()}}},[]),m=g.useCallback(function(E,C,R,T){var N={name:E,delta:C,target:R,should:T,shadowParent:wL(R)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(O){return O!==N})},1)},[]),v=g.useCallback(function(E){n.current=jf(E),a.current=void 0},[]),b=g.useCallback(function(E){m(E.type,LE(E),E.target,f(E,e.lockRef.current))},[]),y=g.useCallback(function(E){m(E.type,jf(E),E.target,f(E,e.lockRef.current))},[]);g.useEffect(function(){return tl.push(o),e.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:y}),document.addEventListener("wheel",h,el),document.addEventListener("touchmove",h,el),document.addEventListener("touchstart",v,el),function(){tl=tl.filter(function(E){return E!==o}),document.removeEventListener("wheel",h,el),document.removeEventListener("touchmove",h,el),document.removeEventListener("touchstart",v,el)}},[]);var S=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:xL(i)}):null,S?g.createElement(uL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const EL=Xk(s1,SL);var zu=g.forwardRef(function(e,t){return g.createElement(Qh,ba({},e,{ref:t,sideCar:EL}))});zu.classNames=Qh.classNames;var CL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},nl=new WeakMap,Df=new WeakMap,Of={},fv=0,u1=function(e){return e&&(e.host||u1(e.parentNode))},RL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=u1(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},_L=function(e,t,n,a){var i=RL(t,Array.isArray(e)?e:[e]);Of[n]||(Of[n]=new WeakMap);var o=Of[n],u=[],f=new Set,h=new Set(i),m=function(b){!b||f.has(b)||(f.add(b),m(b.parentNode))};i.forEach(m);var v=function(b){!b||h.has(b)||Array.prototype.forEach.call(b.children,function(y){if(f.has(y))v(y);else try{var S=y.getAttribute(a),w=S!==null&&S!=="false",E=(nl.get(y)||0)+1,C=(o.get(y)||0)+1;nl.set(y,E),o.set(y,C),u.push(y),E===1&&w&&Df.set(y,!0),C===1&&y.setAttribute(n,"true"),w||y.setAttribute(a,"true")}catch(R){console.error("aria-hidden: cannot operate on ",y,R)}})};return v(t),f.clear(),fv++,function(){u.forEach(function(b){var y=nl.get(b)-1,S=o.get(b)-1;nl.set(b,y),o.set(b,S),y||(Df.has(b)||b.removeAttribute(a),Df.delete(b)),S||b.removeAttribute(n)}),fv--,fv||(nl=new WeakMap,nl=new WeakMap,Df=new WeakMap,Of={})}},Xh=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),i=CL(e);return i?(a.push.apply(a,Array.from(i.querySelectorAll("[aria-live], script"))),_L(a,i,n,"aria-hidden")):function(){return null}},Wh="Dialog",[d1,f1]=Br(Wh),[TL,da]=d1(Wh),h1=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:i,onOpenChange:o,modal:u=!0}=e,f=g.useRef(null),h=g.useRef(null),[m,v]=ds({prop:a,defaultProp:i??!1,onChange:o,caller:Wh});return c.jsx(TL,{scope:t,triggerRef:f,contentRef:h,contentId:jn(),titleId:jn(),descriptionId:jn(),open:m,onOpenChange:v,onOpenToggle:g.useCallback(()=>v(b=>!b),[v]),modal:u,children:n})};h1.displayName=Wh;var m1="DialogTrigger",p1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=da(m1,n),o=xt(t,i.triggerRef);return c.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ix(i.open),...a,ref:o,onClick:Re(e.onClick,i.onOpenToggle)})});p1.displayName=m1;var ax="DialogPortal",[NL,g1]=d1(ax,{forceMount:void 0}),v1=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:i}=e,o=da(ax,t);return c.jsx(NL,{scope:t,forceMount:n,children:g.Children.map(a,u=>c.jsx(nr,{present:n||o.open,children:c.jsx(co,{asChild:!0,container:i,children:u})}))})};v1.displayName=ax;var dh="DialogOverlay",y1=g.forwardRef((e,t)=>{const n=g1(dh,e.__scopeDialog),{forceMount:a=n.forceMount,...i}=e,o=da(dh,e.__scopeDialog);return o.modal?c.jsx(nr,{present:a||o.open,children:c.jsx(jL,{...i,ref:t})}):null});y1.displayName=dh;var AL=ai("DialogOverlay.RemoveScroll"),jL=g.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=da(dh,n);return c.jsx(zu,{as:AL,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(We.div,{"data-state":ix(i.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Zi="DialogContent",x1=g.forwardRef((e,t)=>{const n=g1(Zi,e.__scopeDialog),{forceMount:a=n.forceMount,...i}=e,o=da(Zi,e.__scopeDialog);return c.jsx(nr,{present:a||o.open,children:o.modal?c.jsx(DL,{...i,ref:t}):c.jsx(OL,{...i,ref:t})})});x1.displayName=Zi;var DL=g.forwardRef((e,t)=>{const n=da(Zi,e.__scopeDialog),a=g.useRef(null),i=xt(t,n.contentRef,a);return g.useEffect(()=>{const o=a.current;if(o)return Xh(o)},[]),c.jsx(b1,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault())})}),OL=g.forwardRef((e,t)=>{const n=da(Zi,e.__scopeDialog),a=g.useRef(!1),i=g.useRef(!1);return c.jsx(b1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:o=>{var h,m;(h=e.onInteractOutside)==null||h.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=o.target;((m=n.triggerRef.current)==null?void 0:m.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),b1=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,...u}=e,f=da(Zi,n),h=g.useRef(null),m=xt(t,h);return Kh(),c.jsxs(c.Fragment,{children:[c.jsx(Uu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx(lo,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":ix(f.open),...u,ref:m,onDismiss:()=>f.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(kL,{titleId:f.titleId}),c.jsx(IL,{contentRef:h,descriptionId:f.descriptionId})]})]})}),sx="DialogTitle",S1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=da(sx,n);return c.jsx(We.h2,{id:i.titleId,...a,ref:t})});S1.displayName=sx;var w1="DialogDescription",E1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=da(w1,n);return c.jsx(We.p,{id:i.descriptionId,...a,ref:t})});E1.displayName=w1;var C1="DialogClose",R1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=da(C1,n);return c.jsx(We.button,{type:"button",...a,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});R1.displayName=C1;function ix(e){return e?"open":"closed"}var _1="DialogTitleWarning",[ML,T1]=gk(_1,{contentName:Zi,titleName:sx,docsSlug:"dialog"}),kL=({titleId:e})=>{const t=T1(_1),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
376
|
+
|
|
377
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
378
|
+
|
|
379
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},LL="DialogDescriptionWarning",IL=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${T1(LL).contentName}}.`;return g.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Jh=h1,PL=p1,em=v1,tm=y1,nm=x1,ox=S1,lx=E1,rm=R1;function _l({...e}){return c.jsx(Jh,{"data-slot":"sheet",...e})}function FL({...e}){return c.jsx(em,{"data-slot":"sheet-portal",...e})}function UL({className:e,...t}){return c.jsx(tm,{"data-slot":"sheet-overlay",className:ye("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Tl({className:e,children:t,side:n="right",...a}){return c.jsxs(FL,{children:[c.jsx(UL,{}),c.jsxs(nm,{"data-slot":"sheet-content",className:ye("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...a,children:[t,c.jsxs(rm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[c.jsx(uh,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Nl({className:e,...t}){return c.jsx("div",{"data-slot":"sheet-header",className:ye("flex flex-col gap-1.5 p-4",e),...t})}function am({className:e,...t}){return c.jsx(ox,{"data-slot":"sheet-title",className:ye("text-foreground font-semibold",e),...t})}function sm({className:e,...t}){return c.jsx(lx,{"data-slot":"sheet-description",className:ye("text-muted-foreground text-sm",e),...t})}function gr({className:e,...t}){return c.jsx("div",{"data-slot":"skeleton",className:ye("bg-accent animate-pulse rounded-md",e),...t})}const zL=["top","right","bottom","left"],si=Math.min,mr=Math.max,fh=Math.round,Mf=Math.floor,Ra=e=>({x:e,y:e}),VL={left:"right",right:"left",bottom:"top",top:"bottom"},$L={start:"end",end:"start"};function Xv(e,t,n){return mr(e,si(t,n))}function fs(e,t){return typeof e=="function"?e(t):e}function hs(e){return e.split("-")[0]}function Al(e){return e.split("-")[1]}function cx(e){return e==="x"?"y":"x"}function ux(e){return e==="y"?"height":"width"}function wa(e){return["top","bottom"].includes(hs(e))?"y":"x"}function dx(e){return cx(wa(e))}function HL(e,t,n){n===void 0&&(n=!1);const a=Al(e),i=dx(e),o=ux(i);let u=i==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(u=hh(u)),[u,hh(u)]}function BL(e){const t=hh(e);return[Wv(e),t,Wv(t)]}function Wv(e){return e.replace(/start|end/g,t=>$L[t])}function GL(e,t,n){const a=["left","right"],i=["right","left"],o=["top","bottom"],u=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:a:t?a:i;case"left":case"right":return t?o:u;default:return[]}}function qL(e,t,n,a){const i=Al(e);let o=GL(hs(e),n==="start",a);return i&&(o=o.map(u=>u+"-"+i),t&&(o=o.concat(o.map(Wv)))),o}function hh(e){return e.replace(/left|right|bottom|top/g,t=>VL[t])}function ZL(e){return{top:0,right:0,bottom:0,left:0,...e}}function N1(e){return typeof e!="number"?ZL(e):{top:e,right:e,bottom:e,left:e}}function mh(e){const{x:t,y:n,width:a,height:i}=e;return{width:a,height:i,top:n,left:t,right:t+a,bottom:n+i,x:t,y:n}}function PE(e,t,n){let{reference:a,floating:i}=e;const o=wa(t),u=dx(t),f=ux(u),h=hs(t),m=o==="y",v=a.x+a.width/2-i.width/2,b=a.y+a.height/2-i.height/2,y=a[f]/2-i[f]/2;let S;switch(h){case"top":S={x:v,y:a.y-i.height};break;case"bottom":S={x:v,y:a.y+a.height};break;case"right":S={x:a.x+a.width,y:b};break;case"left":S={x:a.x-i.width,y:b};break;default:S={x:a.x,y:a.y}}switch(Al(t)){case"start":S[u]-=y*(n&&m?-1:1);break;case"end":S[u]+=y*(n&&m?-1:1);break}return S}const YL=async(e,t,n)=>{const{placement:a="bottom",strategy:i="absolute",middleware:o=[],platform:u}=n,f=o.filter(Boolean),h=await(u.isRTL==null?void 0:u.isRTL(t));let m=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:v,y:b}=PE(m,a,h),y=a,S={},w=0;for(let E=0;E<f.length;E++){const{name:C,fn:R}=f[E],{x:T,y:N,data:O,reset:A}=await R({x:v,y:b,initialPlacement:a,placement:y,strategy:i,middlewareData:S,rects:m,platform:u,elements:{reference:e,floating:t}});v=T??v,b=N??b,S={...S,[C]:{...S[C],...O}},A&&w<=50&&(w++,typeof A=="object"&&(A.placement&&(y=A.placement),A.rects&&(m=A.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:v,y:b}=PE(m,y,h)),E=-1)}return{x:v,y:b,placement:y,strategy:i,middlewareData:S}};async function xu(e,t){var n;t===void 0&&(t={});const{x:a,y:i,platform:o,rects:u,elements:f,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:v="viewport",elementContext:b="floating",altBoundary:y=!1,padding:S=0}=fs(t,e),w=N1(S),C=f[y?b==="floating"?"reference":"floating":b],R=mh(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(f.floating)),boundary:m,rootBoundary:v,strategy:h})),T=b==="floating"?{x:a,y:i,width:u.floating.width,height:u.floating.height}:u.reference,N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f.floating)),O=await(o.isElement==null?void 0:o.isElement(N))?await(o.getScale==null?void 0:o.getScale(N))||{x:1,y:1}:{x:1,y:1},A=mh(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:T,offsetParent:N,strategy:h}):T);return{top:(R.top-A.top+w.top)/O.y,bottom:(A.bottom-R.bottom+w.bottom)/O.y,left:(R.left-A.left+w.left)/O.x,right:(A.right-R.right+w.right)/O.x}}const KL=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:i,rects:o,platform:u,elements:f,middlewareData:h}=t,{element:m,padding:v=0}=fs(e,t)||{};if(m==null)return{};const b=N1(v),y={x:n,y:a},S=dx(i),w=ux(S),E=await u.getDimensions(m),C=S==="y",R=C?"top":"left",T=C?"bottom":"right",N=C?"clientHeight":"clientWidth",O=o.reference[w]+o.reference[S]-y[S]-o.floating[w],A=y[S]-o.reference[S],D=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m));let L=D?D[N]:0;(!L||!await(u.isElement==null?void 0:u.isElement(D)))&&(L=f.floating[N]||o.floating[w]);const H=O/2-A/2,X=L/2-E[w]/2-1,re=si(b[R],X),me=si(b[T],X),V=re,le=L-E[w]-me,ue=L/2-E[w]/2+H,ne=Xv(V,ue,le),k=!h.arrow&&Al(i)!=null&&ue!==ne&&o.reference[w]/2-(ue<V?re:me)-E[w]/2<0,Z=k?ue<V?ue-V:ue-le:0;return{[S]:y[S]+Z,data:{[S]:ne,centerOffset:ue-ne-Z,...k&&{alignmentOffset:Z}},reset:k}}}),QL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:i,middlewareData:o,rects:u,initialPlacement:f,platform:h,elements:m}=t,{mainAxis:v=!0,crossAxis:b=!0,fallbackPlacements:y,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:E=!0,...C}=fs(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const R=hs(i),T=wa(f),N=hs(f)===f,O=await(h.isRTL==null?void 0:h.isRTL(m.floating)),A=y||(N||!E?[hh(f)]:BL(f)),D=w!=="none";!y&&D&&A.push(...qL(f,E,w,O));const L=[f,...A],H=await xu(t,C),X=[];let re=((a=o.flip)==null?void 0:a.overflows)||[];if(v&&X.push(H[R]),b){const ue=HL(i,u,O);X.push(H[ue[0]],H[ue[1]])}if(re=[...re,{placement:i,overflows:X}],!X.every(ue=>ue<=0)){var me,V;const ue=(((me=o.flip)==null?void 0:me.index)||0)+1,ne=L[ue];if(ne&&(!(b==="alignment"?T!==wa(ne):!1)||re.every($=>$.overflows[0]>0&&wa($.placement)===T)))return{data:{index:ue,overflows:re},reset:{placement:ne}};let k=(V=re.filter(Z=>Z.overflows[0]<=0).sort((Z,$)=>Z.overflows[1]-$.overflows[1])[0])==null?void 0:V.placement;if(!k)switch(S){case"bestFit":{var le;const Z=(le=re.filter($=>{if(D){const se=wa($.placement);return se===T||se==="y"}return!0}).map($=>[$.placement,$.overflows.filter(se=>se>0).reduce((se,M)=>se+M,0)]).sort(($,se)=>$[1]-se[1])[0])==null?void 0:le[0];Z&&(k=Z);break}case"initialPlacement":k=f;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function FE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function UE(e){return zL.some(t=>e[t]>=0)}const XL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...i}=fs(e,t);switch(a){case"referenceHidden":{const o=await xu(t,{...i,elementContext:"reference"}),u=FE(o,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:UE(u)}}}case"escaped":{const o=await xu(t,{...i,altBoundary:!0}),u=FE(o,n.floating);return{data:{escapedOffsets:u,escaped:UE(u)}}}default:return{}}}}};async function WL(e,t){const{placement:n,platform:a,elements:i}=e,o=await(a.isRTL==null?void 0:a.isRTL(i.floating)),u=hs(n),f=Al(n),h=wa(n)==="y",m=["left","top"].includes(u)?-1:1,v=o&&h?-1:1,b=fs(t,e);let{mainAxis:y,crossAxis:S,alignmentAxis:w}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return f&&typeof w=="number"&&(S=f==="end"?w*-1:w),h?{x:S*v,y:y*m}:{x:y*m,y:S*v}}const JL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:i,y:o,placement:u,middlewareData:f}=t,h=await WL(t,e);return u===((n=f.offset)==null?void 0:n.placement)&&(a=f.arrow)!=null&&a.alignmentOffset?{}:{x:i+h.x,y:o+h.y,data:{...h,placement:u}}}}},eI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:i}=t,{mainAxis:o=!0,crossAxis:u=!1,limiter:f={fn:C=>{let{x:R,y:T}=C;return{x:R,y:T}}},...h}=fs(e,t),m={x:n,y:a},v=await xu(t,h),b=wa(hs(i)),y=cx(b);let S=m[y],w=m[b];if(o){const C=y==="y"?"top":"left",R=y==="y"?"bottom":"right",T=S+v[C],N=S-v[R];S=Xv(T,S,N)}if(u){const C=b==="y"?"top":"left",R=b==="y"?"bottom":"right",T=w+v[C],N=w-v[R];w=Xv(T,w,N)}const E=f.fn({...t,[y]:S,[b]:w});return{...E,data:{x:E.x-n,y:E.y-a,enabled:{[y]:o,[b]:u}}}}}},tI=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:i,rects:o,middlewareData:u}=t,{offset:f=0,mainAxis:h=!0,crossAxis:m=!0}=fs(e,t),v={x:n,y:a},b=wa(i),y=cx(b);let S=v[y],w=v[b];const E=fs(f,t),C=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(h){const N=y==="y"?"height":"width",O=o.reference[y]-o.floating[N]+C.mainAxis,A=o.reference[y]+o.reference[N]-C.mainAxis;S<O?S=O:S>A&&(S=A)}if(m){var R,T;const N=y==="y"?"width":"height",O=["top","left"].includes(hs(i)),A=o.reference[b]-o.floating[N]+(O&&((R=u.offset)==null?void 0:R[b])||0)+(O?0:C.crossAxis),D=o.reference[b]+o.reference[N]+(O?0:((T=u.offset)==null?void 0:T[b])||0)-(O?C.crossAxis:0);w<A?w=A:w>D&&(w=D)}return{[y]:S,[b]:w}}}},nI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:i,rects:o,platform:u,elements:f}=t,{apply:h=()=>{},...m}=fs(e,t),v=await xu(t,m),b=hs(i),y=Al(i),S=wa(i)==="y",{width:w,height:E}=o.floating;let C,R;b==="top"||b==="bottom"?(C=b,R=y===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(R=b,C=y==="end"?"top":"bottom");const T=E-v.top-v.bottom,N=w-v.left-v.right,O=si(E-v[C],T),A=si(w-v[R],N),D=!t.middlewareData.shift;let L=O,H=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(H=N),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(L=T),D&&!y){const re=mr(v.left,0),me=mr(v.right,0),V=mr(v.top,0),le=mr(v.bottom,0);S?H=w-2*(re!==0||me!==0?re+me:mr(v.left,v.right)):L=E-2*(V!==0||le!==0?V+le:mr(v.top,v.bottom))}await h({...t,availableWidth:H,availableHeight:L});const X=await u.getDimensions(f.floating);return w!==X.width||E!==X.height?{reset:{rects:!0}}:{}}}};function im(){return typeof window<"u"}function jl(e){return A1(e)?(e.nodeName||"").toLowerCase():"#document"}function vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fa(e){var t;return(t=(A1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function A1(e){return im()?e instanceof Node||e instanceof vr(e).Node:!1}function la(e){return im()?e instanceof Element||e instanceof vr(e).Element:!1}function ja(e){return im()?e instanceof HTMLElement||e instanceof vr(e).HTMLElement:!1}function zE(e){return!im()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vr(e).ShadowRoot}function Vu(e){const{overflow:t,overflowX:n,overflowY:a,display:i}=ca(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(i)}function rI(e){return["table","td","th"].includes(jl(e))}function om(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function fx(e){const t=hx(),n=la(e)?ca(e):e;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function aI(e){let t=ii(e);for(;ja(t)&&!gl(t);){if(fx(t))return t;if(om(t))return null;t=ii(t)}return null}function hx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gl(e){return["html","body","#document"].includes(jl(e))}function ca(e){return vr(e).getComputedStyle(e)}function lm(e){return la(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ii(e){if(jl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zE(e)&&e.host||Fa(e);return zE(t)?t.host:t}function j1(e){const t=ii(e);return gl(t)?e.ownerDocument?e.ownerDocument.body:e.body:ja(t)&&Vu(t)?t:j1(t)}function bu(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=j1(e),o=i===((a=e.ownerDocument)==null?void 0:a.body),u=vr(i);if(o){const f=Jv(u);return t.concat(u,u.visualViewport||[],Vu(i)?i:[],f&&n?bu(f):[])}return t.concat(i,bu(i,[],n))}function Jv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function D1(e){const t=ca(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const i=ja(e),o=i?e.offsetWidth:n,u=i?e.offsetHeight:a,f=fh(n)!==o||fh(a)!==u;return f&&(n=o,a=u),{width:n,height:a,$:f}}function mx(e){return la(e)?e:e.contextElement}function ml(e){const t=mx(e);if(!ja(t))return Ra(1);const n=t.getBoundingClientRect(),{width:a,height:i,$:o}=D1(t);let u=(o?fh(n.width):n.width)/a,f=(o?fh(n.height):n.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const sI=Ra(0);function O1(e){const t=vr(e);return!hx()||!t.visualViewport?sI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vr(e)?!1:t}function Yi(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=mx(e);let u=Ra(1);t&&(a?la(a)&&(u=ml(a)):u=ml(e));const f=iI(o,n,a)?O1(o):Ra(0);let h=(i.left+f.x)/u.x,m=(i.top+f.y)/u.y,v=i.width/u.x,b=i.height/u.y;if(o){const y=vr(o),S=a&&la(a)?vr(a):a;let w=y,E=Jv(w);for(;E&&a&&S!==w;){const C=ml(E),R=E.getBoundingClientRect(),T=ca(E),N=R.left+(E.clientLeft+parseFloat(T.paddingLeft))*C.x,O=R.top+(E.clientTop+parseFloat(T.paddingTop))*C.y;h*=C.x,m*=C.y,v*=C.x,b*=C.y,h+=N,m+=O,w=vr(E),E=Jv(w)}}return mh({width:v,height:b,x:h,y:m})}function px(e,t){const n=lm(e).scrollLeft;return t?t.left+n:Yi(Fa(e)).left+n}function M1(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=a.left+t.scrollLeft-(n?0:px(e,a)),o=a.top+t.scrollTop;return{x:i,y:o}}function oI(e){let{elements:t,rect:n,offsetParent:a,strategy:i}=e;const o=i==="fixed",u=Fa(a),f=t?om(t.floating):!1;if(a===u||f&&o)return n;let h={scrollLeft:0,scrollTop:0},m=Ra(1);const v=Ra(0),b=ja(a);if((b||!b&&!o)&&((jl(a)!=="body"||Vu(u))&&(h=lm(a)),ja(a))){const S=Yi(a);m=ml(a),v.x=S.x+a.clientLeft,v.y=S.y+a.clientTop}const y=u&&!b&&!o?M1(u,h,!0):Ra(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-h.scrollLeft*m.x+v.x+y.x,y:n.y*m.y-h.scrollTop*m.y+v.y+y.y}}function lI(e){return Array.from(e.getClientRects())}function cI(e){const t=Fa(e),n=lm(e),a=e.ownerDocument.body,i=mr(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),o=mr(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let u=-n.scrollLeft+px(e);const f=-n.scrollTop;return ca(a).direction==="rtl"&&(u+=mr(t.clientWidth,a.clientWidth)-i),{width:i,height:o,x:u,y:f}}function uI(e,t){const n=vr(e),a=Fa(e),i=n.visualViewport;let o=a.clientWidth,u=a.clientHeight,f=0,h=0;if(i){o=i.width,u=i.height;const m=hx();(!m||m&&t==="fixed")&&(f=i.offsetLeft,h=i.offsetTop)}return{width:o,height:u,x:f,y:h}}function dI(e,t){const n=Yi(e,!0,t==="fixed"),a=n.top+e.clientTop,i=n.left+e.clientLeft,o=ja(e)?ml(e):Ra(1),u=e.clientWidth*o.x,f=e.clientHeight*o.y,h=i*o.x,m=a*o.y;return{width:u,height:f,x:h,y:m}}function VE(e,t,n){let a;if(t==="viewport")a=uI(e,n);else if(t==="document")a=cI(Fa(e));else if(la(t))a=dI(t,n);else{const i=O1(e);a={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return mh(a)}function k1(e,t){const n=ii(e);return n===t||!la(n)||gl(n)?!1:ca(n).position==="fixed"||k1(n,t)}function fI(e,t){const n=t.get(e);if(n)return n;let a=bu(e,[],!1).filter(f=>la(f)&&jl(f)!=="body"),i=null;const o=ca(e).position==="fixed";let u=o?ii(e):e;for(;la(u)&&!gl(u);){const f=ca(u),h=fx(u);!h&&f.position==="fixed"&&(i=null),(o?!h&&!i:!h&&f.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Vu(u)&&!h&&k1(e,u))?a=a.filter(v=>v!==u):i=f,u=ii(u)}return t.set(e,a),a}function hI(e){let{element:t,boundary:n,rootBoundary:a,strategy:i}=e;const u=[...n==="clippingAncestors"?om(t)?[]:fI(t,this._c):[].concat(n),a],f=u[0],h=u.reduce((m,v)=>{const b=VE(t,v,i);return m.top=mr(b.top,m.top),m.right=si(b.right,m.right),m.bottom=si(b.bottom,m.bottom),m.left=mr(b.left,m.left),m},VE(t,f,i));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function mI(e){const{width:t,height:n}=D1(e);return{width:t,height:n}}function pI(e,t,n){const a=ja(t),i=Fa(t),o=n==="fixed",u=Yi(e,!0,o,t);let f={scrollLeft:0,scrollTop:0};const h=Ra(0);function m(){h.x=px(i)}if(a||!a&&!o)if((jl(t)!=="body"||Vu(i))&&(f=lm(t)),a){const S=Yi(t,!0,o,t);h.x=S.x+t.clientLeft,h.y=S.y+t.clientTop}else i&&m();o&&!a&&i&&m();const v=i&&!a&&!o?M1(i,f):Ra(0),b=u.left+f.scrollLeft-h.x-v.x,y=u.top+f.scrollTop-h.y-v.y;return{x:b,y,width:u.width,height:u.height}}function hv(e){return ca(e).position==="static"}function $E(e,t){if(!ja(e)||ca(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Fa(e)===n&&(n=n.ownerDocument.body),n}function L1(e,t){const n=vr(e);if(om(e))return n;if(!ja(e)){let i=ii(e);for(;i&&!gl(i);){if(la(i)&&!hv(i))return i;i=ii(i)}return n}let a=$E(e,t);for(;a&&rI(a)&&hv(a);)a=$E(a,t);return a&&gl(a)&&hv(a)&&!fx(a)?n:a||aI(e)||n}const gI=async function(e){const t=this.getOffsetParent||L1,n=this.getDimensions,a=await n(e.floating);return{reference:pI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function vI(e){return ca(e).direction==="rtl"}const yI={convertOffsetParentRelativeRectToViewportRelativeRect:oI,getDocumentElement:Fa,getClippingRect:hI,getOffsetParent:L1,getElementRects:gI,getClientRects:lI,getDimensions:mI,getScale:ml,isElement:la,isRTL:vI};function I1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xI(e,t){let n=null,a;const i=Fa(e);function o(){var f;clearTimeout(a),(f=n)==null||f.disconnect(),n=null}function u(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),o();const m=e.getBoundingClientRect(),{left:v,top:b,width:y,height:S}=m;if(f||t(),!y||!S)return;const w=Mf(b),E=Mf(i.clientWidth-(v+y)),C=Mf(i.clientHeight-(b+S)),R=Mf(v),N={rootMargin:-w+"px "+-E+"px "+-C+"px "+-R+"px",threshold:mr(0,si(1,h))||1};let O=!0;function A(D){const L=D[0].intersectionRatio;if(L!==h){if(!O)return u();L?u(!1,L):a=setTimeout(()=>{u(!1,1e-7)},1e3)}L===1&&!I1(m,e.getBoundingClientRect())&&u(),O=!1}try{n=new IntersectionObserver(A,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,N)}n.observe(e)}return u(!0),o}function bI(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,m=mx(e),v=i||o?[...m?bu(m):[],...bu(t)]:[];v.forEach(R=>{i&&R.addEventListener("scroll",n,{passive:!0}),o&&R.addEventListener("resize",n)});const b=m&&f?xI(m,n):null;let y=-1,S=null;u&&(S=new ResizeObserver(R=>{let[T]=R;T&&T.target===m&&S&&(S.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var N;(N=S)==null||N.observe(t)})),n()}),m&&!h&&S.observe(m),S.observe(t));let w,E=h?Yi(e):null;h&&C();function C(){const R=Yi(e);E&&!I1(E,R)&&n(),E=R,w=requestAnimationFrame(C)}return n(),()=>{var R;v.forEach(T=>{i&&T.removeEventListener("scroll",n),o&&T.removeEventListener("resize",n)}),b==null||b(),(R=S)==null||R.disconnect(),S=null,h&&cancelAnimationFrame(w)}}const SI=JL,wI=eI,EI=QL,CI=nI,RI=XL,HE=KL,_I=tI,TI=(e,t,n)=>{const a=new Map,i={platform:yI,...n},o={...i.platform,_c:a};return YL(e,t,{...i,platform:o})};var NI=typeof document<"u",AI=function(){},Kf=NI?g.useLayoutEffect:AI;function ph(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,a,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!ph(e[a],t[a]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,i[a]))return!1;for(a=n;a--!==0;){const o=i[a];if(!(o==="_owner"&&e.$$typeof)&&!ph(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function P1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function BE(e,t){const n=P1(e);return Math.round(t*n)/n}function mv(e){const t=g.useRef(e);return Kf(()=>{t.current=e}),t}function jI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:i,elements:{reference:o,floating:u}={},transform:f=!0,whileElementsMounted:h,open:m}=e,[v,b]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,S]=g.useState(a);ph(y,a)||S(a);const[w,E]=g.useState(null),[C,R]=g.useState(null),T=g.useCallback($=>{$!==D.current&&(D.current=$,E($))},[]),N=g.useCallback($=>{$!==L.current&&(L.current=$,R($))},[]),O=o||w,A=u||C,D=g.useRef(null),L=g.useRef(null),H=g.useRef(v),X=h!=null,re=mv(h),me=mv(i),V=mv(m),le=g.useCallback(()=>{if(!D.current||!L.current)return;const $={placement:t,strategy:n,middleware:y};me.current&&($.platform=me.current),TI(D.current,L.current,$).then(se=>{const M={...se,isPositioned:V.current!==!1};ue.current&&!ph(H.current,M)&&(H.current=M,El.flushSync(()=>{b(M)}))})},[y,t,n,me,V]);Kf(()=>{m===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,b($=>({...$,isPositioned:!1})))},[m]);const ue=g.useRef(!1);Kf(()=>(ue.current=!0,()=>{ue.current=!1}),[]),Kf(()=>{if(O&&(D.current=O),A&&(L.current=A),O&&A){if(re.current)return re.current(O,A,le);le()}},[O,A,le,re,X]);const ne=g.useMemo(()=>({reference:D,floating:L,setReference:T,setFloating:N}),[T,N]),k=g.useMemo(()=>({reference:O,floating:A}),[O,A]),Z=g.useMemo(()=>{const $={position:n,left:0,top:0};if(!k.floating)return $;const se=BE(k.floating,v.x),M=BE(k.floating,v.y);return f?{...$,transform:"translate("+se+"px, "+M+"px)",...P1(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:se,top:M}},[n,f,k.floating,v.x,v.y]);return g.useMemo(()=>({...v,update:le,refs:ne,elements:k,floatingStyles:Z}),[v,le,ne,k,Z])}const DI=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:i}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?HE({element:a.current,padding:i}).fn(n):{}:a?HE({element:a,padding:i}).fn(n):{}}}},OI=(e,t)=>({...SI(e),options:[e,t]}),MI=(e,t)=>({...wI(e),options:[e,t]}),kI=(e,t)=>({..._I(e),options:[e,t]}),LI=(e,t)=>({...EI(e),options:[e,t]}),II=(e,t)=>({...CI(e),options:[e,t]}),PI=(e,t)=>({...RI(e),options:[e,t]}),FI=(e,t)=>({...DI(e),options:[e,t]});var UI="Arrow",F1=g.forwardRef((e,t)=>{const{children:n,width:a=10,height:i=5,...o}=e;return c.jsx(We.svg,{...o,ref:t,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});F1.displayName=UI;var zI=F1;function U1(e){const[t,n]=g.useState(void 0);return Pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let u,f;if("borderBoxSize"in o){const h=o.borderBoxSize,m=Array.isArray(h)?h[0]:h;u=m.inlineSize,f=m.blockSize}else u=e.offsetWidth,f=e.offsetHeight;n({width:u,height:f})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var gx="Popper",[z1,Ua]=Br(gx),[VI,V1]=z1(gx),$1=e=>{const{__scopePopper:t,children:n}=e,[a,i]=g.useState(null);return c.jsx(VI,{scope:t,anchor:a,onAnchorChange:i,children:n})};$1.displayName=gx;var H1="PopperAnchor",B1=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...i}=e,o=V1(H1,n),u=g.useRef(null),f=xt(t,u);return g.useEffect(()=>{o.onAnchorChange((a==null?void 0:a.current)||u.current)}),a?null:c.jsx(We.div,{...i,ref:f})});B1.displayName=H1;var vx="PopperContent",[$I,HI]=z1(vx),G1=g.forwardRef((e,t)=>{var fe,_e,be,Te,Me,Ge;const{__scopePopper:n,side:a="bottom",sideOffset:i=0,align:o="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:v=0,sticky:b="partial",hideWhenDetached:y=!1,updatePositionStrategy:S="optimized",onPlaced:w,...E}=e,C=V1(vx,n),[R,T]=g.useState(null),N=xt(t,Yt=>T(Yt)),[O,A]=g.useState(null),D=U1(O),L=(D==null?void 0:D.width)??0,H=(D==null?void 0:D.height)??0,X=a+(o!=="center"?"-"+o:""),re=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},me=Array.isArray(m)?m:[m],V=me.length>0,le={padding:re,boundary:me.filter(GI),altBoundary:V},{refs:ue,floatingStyles:ne,placement:k,isPositioned:Z,middlewareData:$}=jI({strategy:"fixed",placement:X,whileElementsMounted:(...Yt)=>bI(...Yt,{animationFrame:S==="always"}),elements:{reference:C.anchor},middleware:[OI({mainAxis:i+H,alignmentAxis:u}),h&&MI({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?kI():void 0,...le}),h&&LI({...le}),II({...le,apply:({elements:Yt,rects:zt,availableWidth:Rr,availableHeight:Yr})=>{const{width:en,height:go}=zt.reference,_r=Yt.floating.style;_r.setProperty("--radix-popper-available-width",`${Rr}px`),_r.setProperty("--radix-popper-available-height",`${Yr}px`),_r.setProperty("--radix-popper-anchor-width",`${en}px`),_r.setProperty("--radix-popper-anchor-height",`${go}px`)}}),O&&FI({element:O,padding:f}),qI({arrowWidth:L,arrowHeight:H}),y&&PI({strategy:"referenceHidden",...le})]}),[se,M]=Y1(k),G=Aa(w);Pn(()=>{Z&&(G==null||G())},[Z,G]);const P=(fe=$.arrow)==null?void 0:fe.x,q=(_e=$.arrow)==null?void 0:_e.y,ie=((be=$.arrow)==null?void 0:be.centerOffset)!==0,[he,ve]=g.useState();return Pn(()=>{R&&ve(window.getComputedStyle(R).zIndex)},[R]),c.jsx("div",{ref:ue.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:Z?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(Te=$.transformOrigin)==null?void 0:Te.x,(Me=$.transformOrigin)==null?void 0:Me.y].join(" "),...((Ge=$.hide)==null?void 0:Ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx($I,{scope:n,placedSide:se,onArrowChange:A,arrowX:P,arrowY:q,shouldHideArrow:ie,children:c.jsx(We.div,{"data-side":se,"data-align":M,...E,ref:N,style:{...E.style,animation:Z?void 0:"none"}})})})});G1.displayName=vx;var q1="PopperArrow",BI={top:"bottom",right:"left",bottom:"top",left:"right"},Z1=g.forwardRef(function(t,n){const{__scopePopper:a,...i}=t,o=HI(q1,a),u=BI[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[u]: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:c.jsx(zI,{...i,ref:n,style:{...i.style,display:"block"}})})});Z1.displayName=q1;function GI(e){return e!==null}var qI=e=>({name:"transformOrigin",options:e,fn(t){var C,R,T;const{placement:n,rects:a,middlewareData:i}=t,u=((C=i.arrow)==null?void 0:C.centerOffset)!==0,f=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[m,v]=Y1(n),b={start:"0%",center:"50%",end:"100%"}[v],y=(((R=i.arrow)==null?void 0:R.x)??0)+f/2,S=(((T=i.arrow)==null?void 0:T.y)??0)+h/2;let w="",E="";return m==="bottom"?(w=u?b:`${y}px`,E=`${-h}px`):m==="top"?(w=u?b:`${y}px`,E=`${a.floating.height+h}px`):m==="right"?(w=`${-h}px`,E=u?b:`${S}px`):m==="left"&&(w=`${a.floating.width+h}px`,E=u?b:`${S}px`),{data:{x:w,y:E}}}});function Y1(e){const[t,n="center"]=e.split("-");return[t,n]}var $u=$1,Dl=B1,Hu=G1,Bu=Z1,K1=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ZI="VisuallyHidden",Q1=g.forwardRef((e,t)=>c.jsx(We.span,{...e,ref:t,style:{...K1,...e.style}}));Q1.displayName=ZI;var YI=Q1,[cm,Iq]=Br("Tooltip",[Ua]),um=Ua(),X1="TooltipProvider",KI=700,ey="tooltip.open",[QI,yx]=cm(X1),W1=e=>{const{__scopeTooltip:t,delayDuration:n=KI,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:o}=e,u=g.useRef(!0),f=g.useRef(!1),h=g.useRef(0);return g.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),c.jsx(QI,{scope:t,isOpenDelayedRef:u,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(h.current),u.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>u.current=!0,a)},[a]),isPointerInTransitRef:f,onPointerInTransitChange:g.useCallback(m=>{f.current=m},[]),disableHoverableContent:i,children:o})};W1.displayName=X1;var Su="Tooltip",[XI,Gu]=cm(Su),J1=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:i,onOpenChange:o,disableHoverableContent:u,delayDuration:f}=e,h=yx(Su,e.__scopeTooltip),m=um(t),[v,b]=g.useState(null),y=jn(),S=g.useRef(0),w=u??h.disableHoverableContent,E=f??h.delayDuration,C=g.useRef(!1),[R,T]=ds({prop:a,defaultProp:i??!1,onChange:L=>{L?(h.onOpen(),document.dispatchEvent(new CustomEvent(ey))):h.onClose(),o==null||o(L)},caller:Su}),N=g.useMemo(()=>R?C.current?"delayed-open":"instant-open":"closed",[R]),O=g.useCallback(()=>{window.clearTimeout(S.current),S.current=0,C.current=!1,T(!0)},[T]),A=g.useCallback(()=>{window.clearTimeout(S.current),S.current=0,T(!1)},[T]),D=g.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{C.current=!0,T(!0),S.current=0},E)},[E,T]);return g.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),c.jsx($u,{...m,children:c.jsx(XI,{scope:t,contentId:y,open:R,stateAttribute:N,trigger:v,onTriggerChange:b,onTriggerEnter:g.useCallback(()=>{h.isOpenDelayedRef.current?D():O()},[h.isOpenDelayedRef,D,O]),onTriggerLeave:g.useCallback(()=>{w?A():(window.clearTimeout(S.current),S.current=0)},[A,w]),onOpen:O,onClose:A,disableHoverableContent:w,children:n})})};J1.displayName=Su;var ty="TooltipTrigger",e_=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,i=Gu(ty,n),o=yx(ty,n),u=um(n),f=g.useRef(null),h=xt(t,f,i.onTriggerChange),m=g.useRef(!1),v=g.useRef(!1),b=g.useCallback(()=>m.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),c.jsx(Dl,{asChild:!0,...u,children:c.jsx(We.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:h,onPointerMove:Re(e.onPointerMove,y=>{y.pointerType!=="touch"&&!v.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),v.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{i.onTriggerLeave(),v.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{i.open&&i.onClose(),m.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:Re(e.onFocus,()=>{m.current||i.onOpen()}),onBlur:Re(e.onBlur,i.onClose),onClick:Re(e.onClick,i.onClose)})})});e_.displayName=ty;var xx="TooltipPortal",[WI,JI]=cm(xx,{forceMount:void 0}),t_=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:i}=e,o=Gu(xx,t);return c.jsx(WI,{scope:t,forceMount:n,children:c.jsx(nr,{present:n||o.open,children:c.jsx(co,{asChild:!0,container:i,children:a})})})};t_.displayName=xx;var vl="TooltipContent",n_=g.forwardRef((e,t)=>{const n=JI(vl,e.__scopeTooltip),{forceMount:a=n.forceMount,side:i="top",...o}=e,u=Gu(vl,e.__scopeTooltip);return c.jsx(nr,{present:a||u.open,children:u.disableHoverableContent?c.jsx(r_,{side:i,...o,ref:t}):c.jsx(eP,{side:i,...o,ref:t})})}),eP=g.forwardRef((e,t)=>{const n=Gu(vl,e.__scopeTooltip),a=yx(vl,e.__scopeTooltip),i=g.useRef(null),o=xt(t,i),[u,f]=g.useState(null),{trigger:h,onClose:m}=n,v=i.current,{onPointerInTransitChange:b}=a,y=g.useCallback(()=>{f(null),b(!1)},[b]),S=g.useCallback((w,E)=>{const C=w.currentTarget,R={x:w.clientX,y:w.clientY},T=aP(R,C.getBoundingClientRect()),N=sP(R,T),O=iP(E.getBoundingClientRect()),A=lP([...N,...O]);f(A),b(!0)},[b]);return g.useEffect(()=>()=>y(),[y]),g.useEffect(()=>{if(h&&v){const w=C=>S(C,v),E=C=>S(C,h);return h.addEventListener("pointerleave",w),v.addEventListener("pointerleave",E),()=>{h.removeEventListener("pointerleave",w),v.removeEventListener("pointerleave",E)}}},[h,v,S,y]),g.useEffect(()=>{if(u){const w=E=>{const C=E.target,R={x:E.clientX,y:E.clientY},T=(h==null?void 0:h.contains(C))||(v==null?void 0:v.contains(C)),N=!oP(R,u);T?y():N&&(y(),m())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[h,v,u,m,y]),c.jsx(r_,{...e,ref:o})}),[tP,nP]=cm(Su,{isInside:!1}),rP=AR("TooltipContent"),r_=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:u,...f}=e,h=Gu(vl,n),m=um(n),{onClose:v}=h;return g.useEffect(()=>(document.addEventListener(ey,v),()=>document.removeEventListener(ey,v)),[v]),g.useEffect(()=>{if(h.trigger){const b=y=>{const S=y.target;S!=null&&S.contains(h.trigger)&&v()};return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[h.trigger,v]),c.jsx(lo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:u,onFocusOutside:b=>b.preventDefault(),onDismiss:v,children:c.jsxs(Hu,{"data-state":h.stateAttribute,...m,...f,ref:t,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(rP,{children:a}),c.jsx(tP,{scope:n,isInside:!0,children:c.jsx(YI,{id:h.contentId,role:"tooltip",children:i||a})})]})})});n_.displayName=vl;var a_="TooltipArrow",s_=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,i=um(n);return nP(a_,n).isInside?null:c.jsx(Bu,{...i,...a,ref:t})});s_.displayName=a_;function aP(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,a,i,o)){case o:return"left";case i:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function sP(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function iP(e){const{top:t,right:n,bottom:a,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:a},{x:i,y:a}]}function oP(e,t){const{x:n,y:a}=e;let i=!1;for(let o=0,u=t.length-1;o<t.length;u=o++){const f=t[o],h=t[u],m=f.x,v=f.y,b=h.x,y=h.y;v>a!=y>a&&n<(b-m)*(a-v)/(y-v)+m&&(i=!i)}return i}function lP(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),cP(t)}function cP(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const i=e[a];for(;t.length>=2;){const o=t[t.length-1],u=t[t.length-2];if((o.x-u.x)*(i.y-u.y)>=(o.y-u.y)*(i.x-u.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const i=e[a];for(;n.length>=2;){const o=n[n.length-1],u=n[n.length-2];if((o.x-u.x)*(i.y-u.y)>=(o.y-u.y)*(i.x-u.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var uP=W1,dP=J1,fP=e_,hP=t_,mP=n_,pP=s_;function ls({delayDuration:e=0,...t}){return c.jsx(uP,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function sn({...e}){return c.jsx(ls,{children:c.jsx(dP,{"data-slot":"tooltip",...e})})}function on({...e}){return c.jsx(fP,{"data-slot":"tooltip-trigger",...e})}function ln({className:e,sideOffset:t=0,children:n,...a}){return c.jsx(hP,{children:c.jsxs(mP,{"data-slot":"tooltip-content",sideOffset:t,className:ye("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...a,children:[n,c.jsx(pP,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const gP="sidebar_state",vP=60*60*24*7,yP="16rem",xP="18rem",bP="3rem",SP="b",i_=g.createContext(null);function qu(){const e=g.useContext(i_);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function wP({defaultOpen:e=!0,open:t,onOpenChange:n,className:a,style:i,children:o,...u}){const f=j3(),[h,m]=g.useState(!1),[v,b]=g.useState(e),y=t??v,S=g.useCallback(R=>{const T=typeof R=="function"?R(y):R;n?n(T):b(T),document.cookie=`${gP}=${T}; path=/; max-age=${vP}`},[n,y]),w=g.useCallback(()=>f?m(R=>!R):S(R=>!R),[f,S,m]);g.useEffect(()=>{const R=T=>{T.key===SP&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);const E=y?"expanded":"collapsed",C=g.useMemo(()=>({state:E,open:y,setOpen:S,isMobile:f,openMobile:h,setOpenMobile:m,toggleSidebar:w}),[E,y,S,f,h,m,w]);return c.jsx(i_.Provider,{value:C,children:c.jsx(ls,{delayDuration:0,children:c.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":yP,"--sidebar-width-icon":bP,...i},className:ye("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",a),...u,children:o})})})}function EP({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:a,children:i,...o}){const{isMobile:u,state:f,openMobile:h,setOpenMobile:m}=qu();return n==="none"?c.jsx("div",{"data-slot":"sidebar",className:ye("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),...o,children:i}):u?c.jsx(_l,{open:h,onOpenChange:m,...o,children:c.jsxs(Tl,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":xP},side:e,children:[c.jsxs(Nl,{className:"sr-only",children:[c.jsx(am,{children:"Sidebar"}),c.jsx(sm,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):c.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[c.jsx("div",{"data-slot":"sidebar-gap",className:ye("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),c.jsx("div",{"data-slot":"sidebar-container",className:ye("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...o,children:c.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i})})]})}function CP({className:e,onClick:t,...n}){const{toggleSidebar:a}=qu();return c.jsxs(Ue,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ye("size-7",e),onClick:i=>{t==null||t(i),a()},...n,children:[c.jsx(i3,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function RP({className:e,...t}){const{toggleSidebar:n}=qu();return c.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:ye("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function _P({className:e,...t}){return c.jsx("main",{"data-slot":"sidebar-inset",className:ye("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function TP({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ye("flex flex-col gap-2 p-2",e),...t})}function NP({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ye("flex flex-col gap-2 p-2",e),...t})}function AP({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ye("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function GE({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ye("relative flex w-full min-w-0 flex-col p-2",e),...t})}function qE({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ye("w-full text-sm",e),...t})}function jP({className:e,...t}){return c.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ye("flex w-full min-w-0 flex-col gap-1",e),...t})}function DP({className:e,...t}){return c.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ye("group/menu-item relative",e),...t})}const OP=Pu("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function MP({asChild:e=!1,isActive:t=!1,variant:n="default",size:a="default",tooltip:i,className:o,...u}){const f=e?Zh:"button",{isMobile:h,state:m}=qu(),v=c.jsx(f,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":a,"data-active":t,className:ye(OP({variant:n,size:a}),o),...u});return i?(typeof i=="string"&&(i={children:i}),c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:v}),c.jsx(ln,{side:"right",align:"center",hidden:m!=="collapsed"||h,...i})]})):v}var kP=(e,t,n,a,i,o,u,f)=>{let h=document.documentElement,m=["light","dark"];function v(S){(Array.isArray(e)?e:[e]).forEach(w=>{let E=w==="class",C=E&&o?i.map(R=>o[R]||R):i;E?(h.classList.remove(...C),h.classList.add(o&&o[S]?o[S]:S)):h.setAttribute(w,S)}),b(S)}function b(S){f&&m.includes(S)&&(h.style.colorScheme=S)}function y(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(a)v(a);else try{let S=localStorage.getItem(t)||n,w=u&&S==="system"?y():S;v(w)}catch{}},ZE=["light","dark"],o_="(prefers-color-scheme: dark)",LP=typeof window>"u",bx=g.createContext(void 0),IP={setTheme:e=>{},themes:[]},l_=()=>{var e;return(e=g.useContext(bx))!=null?e:IP},PP=e=>g.useContext(bx)?g.createElement(g.Fragment,null,e.children):g.createElement(UP,{...e}),FP=["light","dark"],UP=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:a=!0,storageKey:i="theme",themes:o=FP,defaultTheme:u=n?"system":"light",attribute:f="data-theme",value:h,children:m,nonce:v,scriptProps:b})=>{let[y,S]=g.useState(()=>VP(i,u)),[w,E]=g.useState(()=>y==="system"?pv():y),C=h?Object.values(h):o,R=g.useCallback(A=>{let D=A;if(!D)return;A==="system"&&n&&(D=pv());let L=h?h[D]:D,H=t?$P(v):null,X=document.documentElement,re=me=>{me==="class"?(X.classList.remove(...C),L&&X.classList.add(L)):me.startsWith("data-")&&(L?X.setAttribute(me,L):X.removeAttribute(me))};if(Array.isArray(f)?f.forEach(re):re(f),a){let me=ZE.includes(u)?u:null,V=ZE.includes(D)?D:me;X.style.colorScheme=V}H==null||H()},[v]),T=g.useCallback(A=>{let D=typeof A=="function"?A(y):A;S(D);try{localStorage.setItem(i,D)}catch{}},[y]),N=g.useCallback(A=>{let D=pv(A);E(D),y==="system"&&n&&!e&&R("system")},[y,e]);g.useEffect(()=>{let A=window.matchMedia(o_);return A.addListener(N),N(A),()=>A.removeListener(N)},[N]),g.useEffect(()=>{let A=D=>{D.key===i&&(D.newValue?S(D.newValue):T(u))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[T]),g.useEffect(()=>{R(e??y)},[e,y]);let O=g.useMemo(()=>({theme:y,setTheme:T,forcedTheme:e,resolvedTheme:y==="system"?w:y,themes:n?[...o,"system"]:o,systemTheme:n?w:void 0}),[y,T,e,w,n,o]);return g.createElement(bx.Provider,{value:O},g.createElement(zP,{forcedTheme:e,storageKey:i,attribute:f,enableSystem:n,enableColorScheme:a,defaultTheme:u,value:h,themes:o,nonce:v,scriptProps:b}),m)},zP=g.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:a,enableColorScheme:i,defaultTheme:o,value:u,themes:f,nonce:h,scriptProps:m})=>{let v=JSON.stringify([n,t,o,e,f,u,a,i]).slice(1,-1);return g.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(${kP.toString()})(${v})`}})}),VP=(e,t)=>{if(LP)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},$P=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},pv=e=>(e||(e=window.matchMedia(o_)),e.matches?"dark":"light");function HP(){const{setTheme:e,theme:t}=l_();return c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsxs(Ue,{variant:"ghost",size:"icon",className:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground dark:hover:bg-sidebar-accent dark:hover:text-sidebar-accent-foreground",onClick:()=>{e(t==="light"?"dark":"light")},children:[c.jsx(w3,{className:"size-5 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90"}),c.jsx(n3,{className:"absolute size-5 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"}),c.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),c.jsx(ln,{children:c.jsx("p",{children:"Toggle theme"})})]})}function Sx(e){const t=e+"CollectionProvider",[n,a]=Br(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),u=E=>{const{scope:C,children:R}=E,T=ot.useRef(null),N=ot.useRef(new Map).current;return c.jsx(i,{scope:C,itemMap:N,collectionRef:T,children:R})};u.displayName=t;const f=e+"CollectionSlot",h=ai(f),m=ot.forwardRef((E,C)=>{const{scope:R,children:T}=E,N=o(f,R),O=xt(C,N.collectionRef);return c.jsx(h,{ref:O,children:T})});m.displayName=f;const v=e+"CollectionItemSlot",b="data-radix-collection-item",y=ai(v),S=ot.forwardRef((E,C)=>{const{scope:R,children:T,...N}=E,O=ot.useRef(null),A=xt(C,O),D=o(v,R);return ot.useEffect(()=>(D.itemMap.set(O,{ref:O,...N}),()=>void D.itemMap.delete(O))),c.jsx(y,{[b]:"",ref:A,children:T})});S.displayName=v;function w(E){const C=o(e+"CollectionConsumer",E);return ot.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${b}]`));return Array.from(C.itemMap.values()).sort((D,L)=>N.indexOf(D.ref.current)-N.indexOf(L.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:u,Slot:m,ItemSlot:S},w,a]}var BP=g.createContext(void 0);function wx(e){const t=g.useContext(BP);return e||t||"ltr"}var gv="rovingFocusGroup.onEntryFocus",GP={bubbles:!1,cancelable:!0},Zu="RovingFocusGroup",[ny,c_,qP]=Sx(Zu),[ZP,u_]=Br(Zu,[qP]),[YP,KP]=ZP(Zu),d_=g.forwardRef((e,t)=>c.jsx(ny.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(ny.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(QP,{...e,ref:t})})}));d_.displayName=Zu;var QP=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:i=!1,dir:o,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:v=!1,...b}=e,y=g.useRef(null),S=xt(t,y),w=wx(o),[E,C]=ds({prop:u,defaultProp:f??null,onChange:h,caller:Zu}),[R,T]=g.useState(!1),N=Aa(m),O=c_(n),A=g.useRef(!1),[D,L]=g.useState(0);return g.useEffect(()=>{const H=y.current;if(H)return H.addEventListener(gv,N),()=>H.removeEventListener(gv,N)},[N]),c.jsx(YP,{scope:n,orientation:a,dir:w,loop:i,currentTabStopId:E,onItemFocus:g.useCallback(H=>C(H),[C]),onItemShiftTab:g.useCallback(()=>T(!0),[]),onFocusableItemAdd:g.useCallback(()=>L(H=>H+1),[]),onFocusableItemRemove:g.useCallback(()=>L(H=>H-1),[]),children:c.jsx(We.div,{tabIndex:R||D===0?-1:0,"data-orientation":a,...b,ref:S,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{A.current=!0}),onFocus:Re(e.onFocus,H=>{const X=!A.current;if(H.target===H.currentTarget&&X&&!R){const re=new CustomEvent(gv,GP);if(H.currentTarget.dispatchEvent(re),!re.defaultPrevented){const me=O().filter(k=>k.focusable),V=me.find(k=>k.active),le=me.find(k=>k.id===E),ne=[V,le,...me].filter(Boolean).map(k=>k.ref.current);m_(ne,v)}}A.current=!1}),onBlur:Re(e.onBlur,()=>T(!1))})})}),f_="RovingFocusGroupItem",h_=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:i=!1,tabStopId:o,children:u,...f}=e,h=jn(),m=o||h,v=KP(f_,n),b=v.currentTabStopId===m,y=c_(n),{onFocusableItemAdd:S,onFocusableItemRemove:w,currentTabStopId:E}=v;return g.useEffect(()=>{if(a)return S(),()=>w()},[a,S,w]),c.jsx(ny.ItemSlot,{scope:n,id:m,focusable:a,active:i,children:c.jsx(We.span,{tabIndex:b?0:-1,"data-orientation":v.orientation,...f,ref:t,onMouseDown:Re(e.onMouseDown,C=>{a?v.onItemFocus(m):C.preventDefault()}),onFocus:Re(e.onFocus,()=>v.onItemFocus(m)),onKeyDown:Re(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){v.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const R=JP(C,v.orientation,v.dir);if(R!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let N=y().filter(O=>O.focusable).map(O=>O.ref.current);if(R==="last")N.reverse();else if(R==="prev"||R==="next"){R==="prev"&&N.reverse();const O=N.indexOf(C.currentTarget);N=v.loop?e5(N,O+1):N.slice(O+1)}setTimeout(()=>m_(N))}}),children:typeof u=="function"?u({isCurrentTabStop:b,hasTabStop:E!=null}):u})})});h_.displayName=f_;var XP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WP(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function JP(e,t,n){const a=WP(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return XP[a]}function m_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function e5(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var t5=d_,n5=h_,ry=["Enter"," "],r5=["ArrowDown","PageUp","Home"],p_=["ArrowUp","PageDown","End"],a5=[...r5,...p_],s5={ltr:[...ry,"ArrowRight"],rtl:[...ry,"ArrowLeft"]},i5={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Yu="Menu",[wu,o5,l5]=Sx(Yu),[uo,g_]=Br(Yu,[l5,Ua,u_]),dm=Ua(),v_=u_(),[c5,fo]=uo(Yu),[u5,Ku]=uo(Yu),y_=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:i,onOpenChange:o,modal:u=!0}=e,f=dm(t),[h,m]=g.useState(null),v=g.useRef(!1),b=Aa(o),y=wx(i);return g.useEffect(()=>{const S=()=>{v.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>v.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),c.jsx($u,{...f,children:c.jsx(c5,{scope:t,open:n,onOpenChange:b,content:h,onContentChange:m,children:c.jsx(u5,{scope:t,onClose:g.useCallback(()=>b(!1),[b]),isUsingKeyboardRef:v,dir:y,modal:u,children:a})})})};y_.displayName=Yu;var d5="MenuAnchor",Ex=g.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,i=dm(n);return c.jsx(Dl,{...i,...a,ref:t})});Ex.displayName=d5;var Cx="MenuPortal",[f5,x_]=uo(Cx,{forceMount:void 0}),b_=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:i}=e,o=fo(Cx,t);return c.jsx(f5,{scope:t,forceMount:n,children:c.jsx(nr,{present:n||o.open,children:c.jsx(co,{asChild:!0,container:i,children:a})})})};b_.displayName=Cx;var zr="MenuContent",[h5,Rx]=uo(zr),S_=g.forwardRef((e,t)=>{const n=x_(zr,e.__scopeMenu),{forceMount:a=n.forceMount,...i}=e,o=fo(zr,e.__scopeMenu),u=Ku(zr,e.__scopeMenu);return c.jsx(wu.Provider,{scope:e.__scopeMenu,children:c.jsx(nr,{present:a||o.open,children:c.jsx(wu.Slot,{scope:e.__scopeMenu,children:u.modal?c.jsx(m5,{...i,ref:t}):c.jsx(p5,{...i,ref:t})})})})}),m5=g.forwardRef((e,t)=>{const n=fo(zr,e.__scopeMenu),a=g.useRef(null),i=xt(t,a);return g.useEffect(()=>{const o=a.current;if(o)return Xh(o)},[]),c.jsx(_x,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),p5=g.forwardRef((e,t)=>{const n=fo(zr,e.__scopeMenu);return c.jsx(_x,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),g5=ai("MenuContent.ScrollLock"),_x=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:b,onInteractOutside:y,onDismiss:S,disableOutsideScroll:w,...E}=e,C=fo(zr,n),R=Ku(zr,n),T=dm(n),N=v_(n),O=o5(n),[A,D]=g.useState(null),L=g.useRef(null),H=xt(t,L,C.onContentChange),X=g.useRef(0),re=g.useRef(""),me=g.useRef(0),V=g.useRef(null),le=g.useRef("right"),ue=g.useRef(0),ne=w?zu:g.Fragment,k=w?{as:g5,allowPinchZoom:!0}:void 0,Z=se=>{var fe,_e;const M=re.current+se,G=O().filter(be=>!be.disabled),P=document.activeElement,q=(fe=G.find(be=>be.ref.current===P))==null?void 0:fe.textValue,ie=G.map(be=>be.textValue),he=N5(ie,M,q),ve=(_e=G.find(be=>be.textValue===he))==null?void 0:_e.ref.current;(function be(Te){re.current=Te,window.clearTimeout(X.current),Te!==""&&(X.current=window.setTimeout(()=>be(""),1e3))})(M),ve&&setTimeout(()=>ve.focus())};g.useEffect(()=>()=>window.clearTimeout(X.current),[]),Kh();const $=g.useCallback(se=>{var G,P;return le.current===((G=V.current)==null?void 0:G.side)&&j5(se,(P=V.current)==null?void 0:P.area)},[]);return c.jsx(h5,{scope:n,searchRef:re,onItemEnter:g.useCallback(se=>{$(se)&&se.preventDefault()},[$]),onItemLeave:g.useCallback(se=>{var M;$(se)||((M=L.current)==null||M.focus(),D(null))},[$]),onTriggerLeave:g.useCallback(se=>{$(se)&&se.preventDefault()},[$]),pointerGraceTimerRef:me,onPointerGraceIntentChange:g.useCallback(se=>{V.current=se},[]),children:c.jsx(ne,{...k,children:c.jsx(Uu,{asChild:!0,trapped:i,onMountAutoFocus:Re(o,se=>{var M;se.preventDefault(),(M=L.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:c.jsx(lo,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:b,onInteractOutside:y,onDismiss:S,children:c.jsx(t5,{asChild:!0,...N,dir:R.dir,orientation:"vertical",loop:a,currentTabStopId:A,onCurrentTabStopIdChange:D,onEntryFocus:Re(h,se=>{R.isUsingKeyboardRef.current||se.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Hu,{role:"menu","aria-orientation":"vertical","data-state":P_(C.open),"data-radix-menu-content":"",dir:R.dir,...T,...E,ref:H,style:{outline:"none",...E.style},onKeyDown:Re(E.onKeyDown,se=>{const G=se.target.closest("[data-radix-menu-content]")===se.currentTarget,P=se.ctrlKey||se.altKey||se.metaKey,q=se.key.length===1;G&&(se.key==="Tab"&&se.preventDefault(),!P&&q&&Z(se.key));const ie=L.current;if(se.target!==ie||!a5.includes(se.key))return;se.preventDefault();const ve=O().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);p_.includes(se.key)&&ve.reverse(),_5(ve)}),onBlur:Re(e.onBlur,se=>{se.currentTarget.contains(se.target)||(window.clearTimeout(X.current),re.current="")}),onPointerMove:Re(e.onPointerMove,Eu(se=>{const M=se.target,G=ue.current!==se.clientX;if(se.currentTarget.contains(M)&&G){const P=se.clientX>ue.current?"right":"left";le.current=P,ue.current=se.clientX}}))})})})})})})});S_.displayName=zr;var v5="MenuGroup",Tx=g.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return c.jsx(We.div,{role:"group",...a,ref:t})});Tx.displayName=v5;var y5="MenuLabel",w_=g.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return c.jsx(We.div,{...a,ref:t})});w_.displayName=y5;var gh="MenuItem",YE="menu.itemSelect",fm=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...i}=e,o=g.useRef(null),u=Ku(gh,e.__scopeMenu),f=Rx(gh,e.__scopeMenu),h=xt(t,o),m=g.useRef(!1),v=()=>{const b=o.current;if(!n&&b){const y=new CustomEvent(YE,{bubbles:!0,cancelable:!0});b.addEventListener(YE,S=>a==null?void 0:a(S),{once:!0}),WR(b,y),y.defaultPrevented?m.current=!1:u.onClose()}};return c.jsx(E_,{...i,ref:h,disabled:n,onClick:Re(e.onClick,v),onPointerDown:b=>{var y;(y=e.onPointerDown)==null||y.call(e,b),m.current=!0},onPointerUp:Re(e.onPointerUp,b=>{var y;m.current||(y=b.currentTarget)==null||y.click()}),onKeyDown:Re(e.onKeyDown,b=>{const y=f.searchRef.current!=="";n||y&&b.key===" "||ry.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})});fm.displayName=gh;var E_=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:i,...o}=e,u=Rx(gh,n),f=v_(n),h=g.useRef(null),m=xt(t,h),[v,b]=g.useState(!1),[y,S]=g.useState("");return g.useEffect(()=>{const w=h.current;w&&S((w.textContent??"").trim())},[o.children]),c.jsx(wu.ItemSlot,{scope:n,disabled:a,textValue:i??y,children:c.jsx(n5,{asChild:!0,...f,focusable:!a,children:c.jsx(We.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...o,ref:m,onPointerMove:Re(e.onPointerMove,Eu(w=>{a?u.onItemLeave(w):(u.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Eu(w=>u.onItemLeave(w))),onFocus:Re(e.onFocus,()=>b(!0)),onBlur:Re(e.onBlur,()=>b(!1))})})})}),x5="MenuCheckboxItem",C_=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...i}=e;return c.jsx(A_,{scope:e.__scopeMenu,checked:n,children:c.jsx(fm,{role:"menuitemcheckbox","aria-checked":vh(n)?"mixed":n,...i,ref:t,"data-state":Ax(n),onSelect:Re(i.onSelect,()=>a==null?void 0:a(vh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});C_.displayName=x5;var R_="MenuRadioGroup",[b5,S5]=uo(R_,{value:void 0,onValueChange:()=>{}}),__=g.forwardRef((e,t)=>{const{value:n,onValueChange:a,...i}=e,o=Aa(a);return c.jsx(b5,{scope:e.__scopeMenu,value:n,onValueChange:o,children:c.jsx(Tx,{...i,ref:t})})});__.displayName=R_;var T_="MenuRadioItem",N_=g.forwardRef((e,t)=>{const{value:n,...a}=e,i=S5(T_,e.__scopeMenu),o=n===i.value;return c.jsx(A_,{scope:e.__scopeMenu,checked:o,children:c.jsx(fm,{role:"menuitemradio","aria-checked":o,...a,ref:t,"data-state":Ax(o),onSelect:Re(a.onSelect,()=>{var u;return(u=i.onValueChange)==null?void 0:u.call(i,n)},{checkForDefaultPrevented:!1})})})});N_.displayName=T_;var Nx="MenuItemIndicator",[A_,w5]=uo(Nx,{checked:!1}),j_=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...i}=e,o=w5(Nx,n);return c.jsx(nr,{present:a||vh(o.checked)||o.checked===!0,children:c.jsx(We.span,{...i,ref:t,"data-state":Ax(o.checked)})})});j_.displayName=Nx;var E5="MenuSeparator",D_=g.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return c.jsx(We.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});D_.displayName=E5;var C5="MenuArrow",O_=g.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,i=dm(n);return c.jsx(Bu,{...i,...a,ref:t})});O_.displayName=C5;var R5="MenuSub",[Pq,M_]=uo(R5),au="MenuSubTrigger",k_=g.forwardRef((e,t)=>{const n=fo(au,e.__scopeMenu),a=Ku(au,e.__scopeMenu),i=M_(au,e.__scopeMenu),o=Rx(au,e.__scopeMenu),u=g.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=o,m={__scopeMenu:e.__scopeMenu},v=g.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return g.useEffect(()=>v,[v]),g.useEffect(()=>{const b=f.current;return()=>{window.clearTimeout(b),h(null)}},[f,h]),c.jsx(Ex,{asChild:!0,...m,children:c.jsx(E_,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":P_(n.open),...e,ref:us(t,i.onTriggerChange),onClick:b=>{var y;(y=e.onClick)==null||y.call(e,b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,Eu(b=>{o.onItemEnter(b),!b.defaultPrevented&&!e.disabled&&!n.open&&!u.current&&(o.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{n.onOpenChange(!0),v()},100))})),onPointerLeave:Re(e.onPointerLeave,Eu(b=>{var S,w;v();const y=(S=n.content)==null?void 0:S.getBoundingClientRect();if(y){const E=(w=n.content)==null?void 0:w.dataset.side,C=E==="right",R=C?-5:5,T=y[C?"left":"right"],N=y[C?"right":"left"];o.onPointerGraceIntentChange({area:[{x:b.clientX+R,y:b.clientY},{x:T,y:y.top},{x:N,y:y.top},{x:N,y:y.bottom},{x:T,y:y.bottom}],side:E}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(b),b.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,b=>{var S;const y=o.searchRef.current!=="";e.disabled||y&&b.key===" "||s5[a.dir].includes(b.key)&&(n.onOpenChange(!0),(S=n.content)==null||S.focus(),b.preventDefault())})})})});k_.displayName=au;var L_="MenuSubContent",I_=g.forwardRef((e,t)=>{const n=x_(zr,e.__scopeMenu),{forceMount:a=n.forceMount,...i}=e,o=fo(zr,e.__scopeMenu),u=Ku(zr,e.__scopeMenu),f=M_(L_,e.__scopeMenu),h=g.useRef(null),m=xt(t,h);return c.jsx(wu.Provider,{scope:e.__scopeMenu,children:c.jsx(nr,{present:a||o.open,children:c.jsx(wu.Slot,{scope:e.__scopeMenu,children:c.jsx(_x,{id:f.contentId,"aria-labelledby":f.triggerId,...i,ref:m,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var b;u.isUsingKeyboardRef.current&&((b=h.current)==null||b.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:Re(e.onFocusOutside,v=>{v.target!==f.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,v=>{u.onClose(),v.preventDefault()}),onKeyDown:Re(e.onKeyDown,v=>{var S;const b=v.currentTarget.contains(v.target),y=i5[u.dir].includes(v.key);b&&y&&(o.onOpenChange(!1),(S=f.trigger)==null||S.focus(),v.preventDefault())})})})})})});I_.displayName=L_;function P_(e){return e?"open":"closed"}function vh(e){return e==="indeterminate"}function Ax(e){return vh(e)?"indeterminate":e?"checked":"unchecked"}function _5(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function T5(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function N5(e,t,n){const i=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let u=T5(e,Math.max(o,0));i.length===1&&(u=u.filter(m=>m!==n));const h=u.find(m=>m.toLowerCase().startsWith(i.toLowerCase()));return h!==n?h:void 0}function A5(e,t){const{x:n,y:a}=e;let i=!1;for(let o=0,u=t.length-1;o<t.length;u=o++){const f=t[o],h=t[u],m=f.x,v=f.y,b=h.x,y=h.y;v>a!=y>a&&n<(b-m)*(a-v)/(y-v)+m&&(i=!i)}return i}function j5(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return A5(n,t)}function Eu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var D5=y_,O5=Ex,M5=b_,k5=S_,L5=Tx,I5=w_,P5=fm,F5=C_,U5=__,z5=N_,V5=j_,$5=D_,H5=O_,B5=k_,G5=I_,hm="DropdownMenu",[q5,Fq]=Br(hm,[g_]),Gn=g_(),[Z5,F_]=q5(hm),U_=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:i,defaultOpen:o,onOpenChange:u,modal:f=!0}=e,h=Gn(t),m=g.useRef(null),[v,b]=ds({prop:i,defaultProp:o??!1,onChange:u,caller:hm});return c.jsx(Z5,{scope:t,triggerId:jn(),triggerRef:m,contentId:jn(),open:v,onOpenChange:b,onOpenToggle:g.useCallback(()=>b(y=>!y),[b]),modal:f,children:c.jsx(D5,{...h,open:v,onOpenChange:b,dir:a,modal:f,children:n})})};U_.displayName=hm;var z_="DropdownMenuTrigger",V_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...i}=e,o=F_(z_,n),u=Gn(n);return c.jsx(O5,{asChild:!0,...u,children:c.jsx(We.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":a?"":void 0,disabled:a,...i,ref:us(t,o.triggerRef),onPointerDown:Re(e.onPointerDown,f=>{!a&&f.button===0&&f.ctrlKey===!1&&(o.onOpenToggle(),o.open||f.preventDefault())}),onKeyDown:Re(e.onKeyDown,f=>{a||(["Enter"," "].includes(f.key)&&o.onOpenToggle(),f.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});V_.displayName=z_;var Y5="DropdownMenuPortal",$_=e=>{const{__scopeDropdownMenu:t,...n}=e,a=Gn(t);return c.jsx(M5,{...a,...n})};$_.displayName=Y5;var H_="DropdownMenuContent",B_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=F_(H_,n),o=Gn(n),u=g.useRef(!1);return c.jsx(k5,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...a,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,f=>{var h;u.current||(h=i.triggerRef.current)==null||h.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,f=>{const h=f.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0,v=h.button===2||m;(!i.modal||v)&&(u.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)"}})});B_.displayName=H_;var K5="DropdownMenuGroup",Q5=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(L5,{...i,...a,ref:t})});Q5.displayName=K5;var X5="DropdownMenuLabel",W5=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(I5,{...i,...a,ref:t})});W5.displayName=X5;var J5="DropdownMenuItem",G_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(P5,{...i,...a,ref:t})});G_.displayName=J5;var eF="DropdownMenuCheckboxItem",tF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(F5,{...i,...a,ref:t})});tF.displayName=eF;var nF="DropdownMenuRadioGroup",rF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(U5,{...i,...a,ref:t})});rF.displayName=nF;var aF="DropdownMenuRadioItem",sF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(z5,{...i,...a,ref:t})});sF.displayName=aF;var iF="DropdownMenuItemIndicator",oF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(V5,{...i,...a,ref:t})});oF.displayName=iF;var lF="DropdownMenuSeparator",q_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx($5,{...i,...a,ref:t})});q_.displayName=lF;var cF="DropdownMenuArrow",uF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(H5,{...i,...a,ref:t})});uF.displayName=cF;var dF="DropdownMenuSubTrigger",fF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(B5,{...i,...a,ref:t})});fF.displayName=dF;var hF="DropdownMenuSubContent",mF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=Gn(n);return c.jsx(G5,{...i,...a,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)"}})});mF.displayName=hF;var pF=U_,gF=V_,vF=$_,Z_=B_,Y_=G_,K_=q_;const Gr=pF,qr=gF,Cr=g.forwardRef(({className:e,sideOffset:t=4,...n},a)=>c.jsx(vF,{children:c.jsx(Z_,{ref:a,sideOffset:t,className:ye("bg-popover text-popover-foreground 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 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),...n})}));Cr.displayName=Z_.displayName;const Zt=g.forwardRef(({className:e,inset:t,...n},a)=>c.jsx(Y_,{ref:a,className:ye("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Zt.displayName=Y_.displayName;const ho=g.forwardRef(({className:e,...t},n)=>c.jsx(K_,{ref:n,className:ye("bg-muted -mx-1 my-1 h-px",e),...t}));ho.displayName=K_.displayName;const yF="data:image/svg+xml,%3csvg%20width='45'%20height='36'%20viewBox='0%200%2045%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1026_9)'%3e%3cpath%20d='M41.0124%202.70808C42.5841%204.28086%2043.2307%206.93134%2043.2307%206.93134C43.2307%206.93134%2044.1924%2012.2686%2044.1924%2019.5152C44.1924%209.25778%2040.7126%207.4971%2028.6169%207.4971H17.4622C11.2702%207.4971%2011.689%2013.72%2011.2702%2016.6815L10.7614%2021.156C10.5171%2025.8635%2011.3345%2028.7805%2016.1644%2028.7805C6.09372%2028.7805%200.499987%2030.4294%200.5%2016.2326C0.499994%209.80708%201.46893%206.93134%201.46893%206.93134C1.46893%206.93134%202.11548%204.28086%203.69048%202.70808C5.26549%201.13349%207.5998%200.975453%207.5998%200.975453C7.5998%200.975453%2012.4195%200.25%2021.9403%200.25C31.4612%200.25%2036.84%200.975453%2036.84%200.975453C36.84%200.975453%2039.4359%201.13349%2041.0124%202.70808Z'%20fill='url(%23paint0_linear_1026_9)'/%3e%3cpath%20d='M44.1907%2019.8412C44.1913%2019.9695%2044.1916%2020.0989%2044.1916%2020.2295C44.1916%2026.3837%2043.2754%2028.779%2043.2754%2028.779C43.2754%2028.779%2042.5584%2031.6808%2041.3343%2032.9343C39.3918%2034.9233%2037.3144%2035.0343%2037.3144%2035.0343C37.3144%2035.0343%2032.8453%2035.75%2023.229%2035.75C14.0031%2035.75%207.85921%2035.0387%207.85921%2035.0387C7.85921%2035.0387%205.26504%2034.8795%203.69004%2033.3064C2.11504%2031.7307%201.46849%2028.779%201.46849%2028.779C1.46849%2028.779%200.5%2022.7163%200.5%2016.0794C0.499988%2028.8752%205.0442%2028.7984%2013.3149%2028.6587H13.3149C14.2204%2028.6434%2015.1706%2028.6273%2016.1644%2028.6273H27.318C32.2013%2028.6273%2033.3039%2025.0731%2033.5164%2021.0028L34.0267%2014.7934C34.1626%2012.2409%2033.8337%2010.4287%2033.0336%209.26241C32.1612%207.99016%2030.6747%207.3439%2028.6169%207.3439C41.4253%207.3439%2044.1022%209.05998%2044.1907%2019.8412Z'%20fill='url(%23paint1_linear_1026_9)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1026_9'%20x1='22.2878'%20y1='0.25'%20x2='22.4818'%20y2='30.5768'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2305D2FF'/%3e%3cstop%20offset='0.156227'%20stop-color='%2321A1F1'/%3e%3cstop%20offset='0.407114'%20stop-color='%231E88E5'/%3e%3cstop%20offset='0.72248'%20stop-color='%231E6EE5'/%3e%3cstop%20offset='1'%20stop-color='%23182FFF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1026_9'%20x1='3.17783'%20y1='35.6937'%20x2='37.9386'%20y2='5.41095'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2324D8FF'/%3e%3cstop%20offset='0.156227'%20stop-color='%2321A1F1'/%3e%3cstop%20offset='0.407114'%20stop-color='%231E88E5'/%3e%3cstop%20offset='0.749106'%20stop-color='%231E7AE5'/%3e%3cstop%20offset='1'%20stop-color='%230046F9'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1026_9'%3e%3crect%20width='45'%20height='36'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",xF=({width:e=45,height:t=36,className:n=""})=>c.jsx("img",{src:yF,alt:"OWOX Logo",width:e,height:t,className:n}),bF=({className:e,size:t=24})=>c.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),SF=({className:e,size:t=24})=>c.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[c.jsx("path",{d:"M10.6842 44.2221L0.419465 26.278C-0.139822 25.3001 -0.139822 23.6999 0.419465 22.722L10.6842 4.77786C11.2435 3.79993 12.6166 3 13.7355 3H34.265C35.3838 3 36.7567 3.79993 37.3163 4.77786L47.5801 22.722C48.14 23.6999 48.14 25.3001 47.5801 26.278L37.3163 44.2221C36.7567 45.2001 35.3838 46 34.265 46H13.7355C12.6166 46 11.2435 45.2001 10.6842 44.2221Z",fill:"#4486FA"}),c.jsx("path",{d:"M30.6154 18.3848L43.6923 32.8463L37.3828 43.85C36.8268 44.8118 35.4628 45.5986 34.3511 45.5986L17.5385 30.0771L30.6154 18.3848Z",fill:"#3778ED"}),c.jsx("path",{d:"M24.1539 33.1537C28.997 33.1537 32.9231 29.2276 32.9231 24.3845C32.9231 19.5414 28.997 15.6152 24.1539 15.6152C19.3108 15.6152 15.3846 19.5414 15.3846 24.3845C15.3846 29.2276 19.3108 33.1537 24.1539 33.1537Z",fill:"white"}),c.jsx("path",{d:"M31.2681 29.2331L34.3825 32.3476C34.7428 32.7079 34.7428 33.2925 34.3825 33.6528L33.7296 34.3057C33.3693 34.666 32.7847 34.666 32.4244 34.3057L29.3099 31.1913C28.9496 30.831 28.9496 30.2464 29.3099 29.886L29.9628 29.2331C30.3231 28.8728 30.9077 28.8728 31.2681 29.2331Z",fill:"white"}),c.jsx("path",{d:"M24.1538 31.0003C27.8074 31.0003 30.7692 28.0385 30.7692 24.3849C30.7692 20.7313 27.8074 17.7695 24.1538 17.7695C20.5003 17.7695 17.5385 20.7313 17.5385 24.3849C17.5385 28.0385 20.5003 31.0003 24.1538 31.0003Z",fill:"#4486FA"}),c.jsx("path",{d:"M24.1538 29.4615C26.9577 29.4615 29.2308 27.1884 29.2308 24.3845C29.2308 21.5806 26.9577 19.3076 24.1538 19.3076C21.3499 19.3076 19.0769 21.5806 19.0769 24.3845C19.0769 27.1884 21.3499 29.4615 24.1538 29.4615Z",fill:"#4486FA"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.3846 21.4619H25.2308V29.4619H23.3846V21.4619ZM26.4615 24.8465H28.3077V28.5388H26.4615V24.8465ZM21.8462 23.6158H20V28.5388H21.8462V23.6158Z",fill:"white"})]}),wF=({className:e,size:t=24})=>c.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[c.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),c.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),c.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),c.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),c.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),c.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),c.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),c.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),c.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),c.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),c.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),c.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),c.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),c.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),c.jsx("path",{d:"M24 1.134L27.7974 2.3466V29.6562L24 30.4332V1.134ZM36.8118 9.6L31.179 8.4588V29.0142L36.8118 27.873V9.6ZM43.2144 3.06L39.1344 1.4196V27.381L43.2144 26.5248V3.06ZM48 1.5618L44.901 0V26.1684L48 25.5978V1.5618Z",fill:"#F58534"})]}),jx=({className:e,size:t=24})=>c.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0C19.7661 0 12 0 10 0C8.19719 0 6 2.18498 6 4V44C6 45.815 8.18947 47.9993 10 47.9993H38C39.8105 47.9993 42 45.815 42 44C42 44 42 25.6447 42 14L28 0Z",fill:"#00A65F"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),EF=({className:e,size:t=24})=>c.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[c.jsx("path",{d:"M23.7876 0C22.2395 0 20.8149 0.856389 20.0821 2.22332C19.3574 3.59024 19.4398 5.25361 20.3044 6.5382L22.0995 4.75131C22.0419 4.57015 22.009 4.38899 22.009 4.1996C22.009 3.21969 22.7995 2.42918 23.7794 2.42918C24.7593 2.42918 25.5498 3.21969 25.5498 4.1996C25.5498 5.1795 24.7593 5.97002 23.7794 5.97002C23.59 5.97002 23.4088 5.93708 23.2277 5.87944L21.4325 7.66632C22.923 8.67917 24.891 8.62153 26.3238 7.53457C27.7566 6.44762 28.3331 4.56192 27.7566 2.85737C27.1885 1.1446 25.5827 0 23.7876 0Z",fill:"#34A853"}),c.jsx("path",{d:"M22.1161 12.2282C22.1161 10.8118 21.6632 9.42842 20.8068 8.30029L18.4846 10.6224C19.2093 11.9564 18.954 13.6033 17.8506 14.6491L19.1187 17.737C20.9797 16.5266 22.1161 14.4515 22.1161 12.2282Z",fill:"#FBBC04"}),c.jsx("path",{d:"M15.6108 15.5637H15.5531C14.1286 15.5637 12.8604 14.6579 12.3993 13.3075C11.9382 11.957 12.3828 10.4666 13.511 9.58547C14.6391 8.70438 16.1954 8.64674 17.3894 9.43725L19.6951 7.13159C17.4553 5.31176 14.2932 5.17177 11.897 6.78574C9.50076 8.3997 8.44675 11.3806 9.28667 14.1392C10.1266 16.8977 12.671 18.7834 15.5531 18.7834C15.9978 18.7834 16.4425 18.7422 16.8789 18.6517L15.6108 15.5637Z",fill:"#EA4335"}),c.jsx("path",{d:"M23.87 18.231C22.4125 18.231 20.9632 18.4451 19.5716 18.8568L21.4161 23.3611C22.2148 23.1634 23.0383 23.0646 23.87 23.0646C28.6625 23.0646 32.7797 26.449 33.7184 31.1509C34.6489 35.8528 32.1374 40.5547 27.7155 42.3828C23.2936 44.2108 18.1882 42.6627 15.5284 38.6855C12.8687 34.7082 13.3792 29.3969 16.7636 26.0043C17.4718 25.2962 18.2787 24.7033 19.1598 24.2339L17.34 19.7461C10.5465 23.0728 7.32686 30.9697 9.86308 38.1008C12.3993 45.2319 19.8762 49.3244 27.2461 47.6117C34.616 45.9071 39.532 38.9407 38.6756 31.4226C37.8192 23.9045 31.454 18.231 23.8864 18.231H23.87Z",fill:"#4285F4"})]}),CF=({className:e,size:t=24})=>c.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[c.jsx("path",{d:"M6.10815 8C6.10815 6.89543 7.00358 6 8.10815 6H40.1082C41.2127 6 42.1082 6.89543 42.1082 8V40C42.1082 41.1046 41.2127 42 40.1082 42H8.10816C7.00359 42 6.10815 41.1046 6.10815 40V8Z",fill:"#FF9800"}),c.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),c.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),c.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),c.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),c.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),c.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),c.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),c.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),c.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),c.jsx("path",{d:"M13 35C13 32.7909 14.7909 31 17 31C19.2091 31 21 32.7909 21 35C21 37.2091 19.2091 39 17 39C14.7909 39 13 37.2091 13 35Z",fill:"white"})]});function Cu({className:e,...t}){return c.jsx("textarea",{"data-slot":"textarea",className:ye("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function mm({value:e,onChange:t,keysToMask:n=[],className:a,displayOnly:i=!1}){const o=(b,y)=>{if(!b||y.length===0)return!1;try{const S=JSON.parse(b),w=E=>typeof E!="object"||E===null?!1:Array.isArray(E)?E.some(C=>typeof C=="object"&&C!==null&&w(C)):Object.keys(E).some(C=>y.includes(C)||typeof E[C]=="object"&&E[C]!==null&&w(E[C]));return w(S)}catch{return!1}},u=i?!1:!e||n.length===0||!o(e,n),[f,h]=g.useState(u);g.useEffect(()=>{i?h(!1):(!e||n.length===0||!o(e,n))&&h(!0)},[e,n,i]);const m=b=>{if(!b)return"";try{const y=JSON.parse(b),S=C=>{if(typeof C!="object"||C===null)return C;const R=Array.isArray(C)?[...C]:{...C};return Array.isArray(R)?R.forEach((T,N)=>{typeof T=="object"&&T!==null&&(R[N]=S(T))}):Object.entries(R).forEach(([T,N])=>{if(n.includes(T))if(typeof N=="string"){const O=N.length;O>30?R[T]="*".repeat(Math.min(20,Math.ceil(O/3))):O>10?R[T]="*".repeat(Math.min(10,Math.ceil(O/2))):R[T]="*".repeat(O)}else R[T]="***";else typeof N=="object"&&N!==null&&(R[T]=S(N))}),R},E=S(typeof y=="object"?y:{});return JSON.stringify(E,null,2)}catch{return b}},v=e&&n.length>0&&o(e,n);return c.jsxs("div",{className:"relative",children:[!f&&v&&!i&&c.jsx(ls,{children:c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx("div",{className:"absolute top-2 left-2 z-10",children:c.jsx(W4,{className:"h-4 w-4 text-gray-500"})})}),c.jsx(ln,{children:c.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),i?c.jsx("div",{className:`p-2 font-mono ${a??""} min-h-[150px] cursor-not-allowed whitespace-pre-wrap opacity-70`,children:m(e)}):c.jsx(Cu,{value:f?e:m(e),onChange:b=>{(f||!v)&&t&&t(b.target.value)},onFocus:b=>{!f&&v&&b.target.blur()},readOnly:!!(!f&&v),className:`font-mono ${a??""} ${!f&&v?"cursor-not-allowed opacity-70":""} min-h-[150px]`,rows:8}),v&&!i&&c.jsx(Ue,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{h(!f)},children:f?c.jsx(ls,{children:c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx($4,{className:"h-4 w-4"}),c.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),c.jsx(ln,{children:c.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):c.jsx(ls,{children:c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(B4,{className:"h-4 w-4"}),c.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),c.jsx(ln,{children:c.jsx("p",{children:"Show sensitive data and enable editing"})})]})})})]})}var _t;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const u of i)o[u]=u;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(f=>typeof i[i[f]]!="number"),u={};for(const f of o)u[f]=i[f];return e.objectValues(u)},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 u in i)Object.prototype.hasOwnProperty.call(i,u)&&o.push(u);return o},e.find=(i,o)=>{for(const u of i)if(o(u))return u},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function a(i,o=" | "){return i.map(u=>typeof u=="string"?`'${u}'`:u).join(o)}e.joinValues=a,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(_t||(_t={}));var KE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(KE||(KE={}));const De=_t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qs=e=>{switch(typeof e){case"undefined":return De.undefined;case"string":return De.string;case"number":return Number.isNaN(e)?De.nan:De.number;case"boolean":return De.boolean;case"function":return De.function;case"bigint":return De.bigint;case"symbol":return De.symbol;case"object":return Array.isArray(e)?De.array:e===null?De.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?De.promise:typeof Map<"u"&&e instanceof Map?De.map:typeof Set<"u"&&e instanceof Set?De.set:typeof Date<"u"&&e instanceof Date?De.date:De.object;default:return De.unknown}},xe=_t.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"]);class ms extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};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},a={_errors:[]},i=o=>{for(const u of o.issues)if(u.code==="invalid_union")u.unionErrors.map(i);else if(u.code==="invalid_return_type")i(u.returnTypeError);else if(u.code==="invalid_arguments")i(u.argumentsError);else if(u.path.length===0)a._errors.push(n(u));else{let f=a,h=0;for(;h<u.path.length;){const m=u.path[h];h===u.path.length-1?(f[m]=f[m]||{_errors:[]},f[m]._errors.push(n(u))):f[m]=f[m]||{_errors:[]},f=f[m],h++}}};return i(this),a}static assert(t){if(!(t instanceof ms))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_t.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},a=[];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))):a.push(t(i));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}ms.create=e=>new ms(e);const ay=(e,t)=>{let n;switch(e.code){case xe.invalid_type:e.received===De.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case xe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,_t.jsonStringifyReplacer)}`;break;case xe.unrecognized_keys:n=`Unrecognized key(s) in object: ${_t.joinValues(e.keys,", ")}`;break;case xe.invalid_union:n="Invalid input";break;case xe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_t.joinValues(e.options)}`;break;case xe.invalid_enum_value:n=`Invalid enum value. Expected ${_t.joinValues(e.options)}, received '${e.received}'`;break;case xe.invalid_arguments:n="Invalid function arguments";break;case xe.invalid_return_type:n="Invalid function return type";break;case xe.invalid_date:n="Invalid date";break;case xe.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}"`:_t.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case xe.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 xe.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 xe.custom:n="Invalid input";break;case xe.invalid_intersection_types:n="Intersection results could not be merged";break;case xe.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case xe.not_finite:n="Number must be finite";break;default:n=t.defaultError,_t.assertNever(e)}return{message:n}};let RF=ay;function _F(){return RF}const TF=e=>{const{data:t,path:n,errorMaps:a,issueData:i}=e,o=[...n,...i.path||[]],u={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let f="";const h=a.filter(m=>!!m).slice().reverse();for(const m of h)f=m(u,{data:t,defaultError:f}).message;return{...i,path:o,message:f}};function Ae(e,t){const n=_F(),a=TF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ay?void 0:ay].filter(i=>!!i)});e.common.issues.push(a)}class Bn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const a=[];for(const i of n){if(i.status==="aborted")return nt;i.status==="dirty"&&t.dirty(),a.push(i.value)}return{status:t.value,value:a}}static async mergeObjectAsync(t,n){const a=[];for(const i of n){const o=await i.key,u=await i.value;a.push({key:o,value:u})}return Bn.mergeObjectSync(t,a)}static mergeObjectSync(t,n){const a={};for(const i of n){const{key:o,value:u}=i;if(o.status==="aborted"||u.status==="aborted")return nt;o.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof u.value<"u"||i.alwaysSet)&&(a[o.value]=u.value)}return{status:t.value,value:a}}}const nt=Object.freeze({status:"aborted"}),su=e=>({status:"dirty",value:e}),Zr=e=>({status:"valid",value:e}),QE=e=>e.status==="aborted",XE=e=>e.status==="dirty",yl=e=>e.status==="valid",yh=e=>typeof Promise<"u"&&e instanceof Promise;var Fe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Fe||(Fe={}));class Da{constructor(t,n,a,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=a,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const WE=(e,t)=>{if(yl(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 ms(e.common.issues);return this._error=n,this._error}}};function ut(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:i}=e;if(t&&(n||a))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:(u,f)=>{const{message:h}=e;return u.code==="invalid_enum_value"?{message:h??f.defaultError}:typeof f.data>"u"?{message:h??a??f.defaultError}:u.code!=="invalid_type"?{message:f.defaultError}:{message:h??n??f.defaultError}},description:i}}class bt{get description(){return this._def.description}_getType(t){return Qs(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Qs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Bn,ctx:{common:t.parent.common,data:t.data,parsedType:Qs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(yh(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 a=this.safeParse(t,n);if(a.success)return a.data;throw a.error}safeParse(t,n){const a={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qs(t)},i=this._parseSync({data:t,path:a.path,parent:a});return WE(a,i)}"~validate"(t){var a,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qs(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:n});return yl(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(i=(a=o==null?void 0:o.message)==null?void 0:a.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>yl(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){const a=await this.safeParseAsync(t,n);if(a.success)return a.data;throw a.error}async safeParseAsync(t,n){const a={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:Qs(t)},i=this._parse({data:t,path:a.path,parent:a}),o=await(yh(i)?i:Promise.resolve(i));return WE(a,o)}refine(t,n){const a=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const u=t(i),f=()=>o.addIssue({code:xe.custom,...a(i)});return typeof Promise<"u"&&u instanceof Promise?u.then(h=>h?!0:(f(),!1)):u?!0:(f(),!1)})}refinement(t,n){return this._refinement((a,i)=>t(a)?!0:(i.addIssue(typeof n=="function"?n(a,i):n),!1))}_refinement(t){return new Xi({schema:this,typeName:at.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 cs.create(this,this._def)}nullable(){return Wi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _a.create(this)}promise(){return _h.create(this,this._def)}or(t){return Sh.create([this,t],this._def)}and(t){return wh.create(this,t,this._def)}transform(t){return new Xi({...ut(this._def),schema:this,typeName:at.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Th({...ut(this._def),innerType:this,defaultValue:n,typeName:at.ZodDefault})}brand(){return new J_({typeName:at.ZodBranded,type:this,...ut(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Nh({...ut(this._def),innerType:this,catchValue:n,typeName:at.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Ox.create(this,t)}readonly(){return Ah.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const NF=/^c[^\s-]{8,}$/i,AF=/^[0-9a-z]+$/,jF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,DF=/^[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,OF=/^[a-z0-9_-]{21}$/i,MF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,kF=/^[-+]?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)?)??$/,LF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,IF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let vv;const PF=/^(?:(?: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])$/,FF=/^(?:(?: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])$/,UF=/^(([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]))$/,zF=/^(([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])$/,VF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$F=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Q_="((\\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])))",HF=new RegExp(`^${Q_}$`);function X_(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function BF(e){return new RegExp(`^${X_(e)}$`)}function GF(e){let t=`${Q_}T${X_(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 qF(e,t){return!!((t==="v4"||!t)&&PF.test(e)||(t==="v6"||!t)&&UF.test(e))}function ZF(e,t){if(!MF.test(e))return!1;try{const[n]=e.split("."),a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(a));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function YF(e,t){return!!((t==="v4"||!t)&&FF.test(e)||(t==="v6"||!t)&&zF.test(e))}class os extends bt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==De.string){const o=this._getOrReturnCtx(t);return Ae(o,{code:xe.invalid_type,expected:De.string,received:o.parsedType}),nt}const a=new Bn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),a.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),a.dirty());else if(o.kind==="length"){const u=t.data.length>o.value,f=t.data.length<o.value;(u||f)&&(i=this._getOrReturnCtx(t,i),u?Ae(i,{code:xe.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):f&&Ae(i,{code:xe.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),a.dirty())}else if(o.kind==="email")LF.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"email",code:xe.invalid_string,message:o.message}),a.dirty());else if(o.kind==="emoji")vv||(vv=new RegExp(IF,"u")),vv.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"emoji",code:xe.invalid_string,message:o.message}),a.dirty());else if(o.kind==="uuid")DF.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"uuid",code:xe.invalid_string,message:o.message}),a.dirty());else if(o.kind==="nanoid")OF.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"nanoid",code:xe.invalid_string,message:o.message}),a.dirty());else if(o.kind==="cuid")NF.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid",code:xe.invalid_string,message:o.message}),a.dirty());else if(o.kind==="cuid2")AF.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid2",code:xe.invalid_string,message:o.message}),a.dirty());else if(o.kind==="ulid")jF.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ulid",code:xe.invalid_string,message:o.message}),a.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ae(i,{validation:"url",code:xe.invalid_string,message:o.message}),a.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"regex",code:xe.invalid_string,message:o.message}),a.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),a.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),Ae(i,{code:xe.invalid_string,validation:{startsWith:o.value},message:o.message}),a.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.invalid_string,validation:{endsWith:o.value},message:o.message}),a.dirty()):o.kind==="datetime"?GF(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.invalid_string,validation:"datetime",message:o.message}),a.dirty()):o.kind==="date"?HF.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.invalid_string,validation:"date",message:o.message}),a.dirty()):o.kind==="time"?BF(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.invalid_string,validation:"time",message:o.message}),a.dirty()):o.kind==="duration"?kF.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"duration",code:xe.invalid_string,message:o.message}),a.dirty()):o.kind==="ip"?qF(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ip",code:xe.invalid_string,message:o.message}),a.dirty()):o.kind==="jwt"?ZF(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"jwt",code:xe.invalid_string,message:o.message}),a.dirty()):o.kind==="cidr"?YF(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cidr",code:xe.invalid_string,message:o.message}),a.dirty()):o.kind==="base64"?VF.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"base64",code:xe.invalid_string,message:o.message}),a.dirty()):o.kind==="base64url"?$F.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"base64url",code:xe.invalid_string,message:o.message}),a.dirty()):_t.assertNever(o);return{status:a.value,value:t.data}}_regex(t,n,a){return this.refinement(i=>t.test(i),{validation:n,code:xe.invalid_string,...Fe.errToObj(a)})}_addCheck(t){return new os({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Fe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Fe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Fe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Fe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Fe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Fe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Fe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Fe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Fe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Fe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Fe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Fe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Fe.errToObj(t)})}datetime(t){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:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Fe.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,...Fe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Fe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Fe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Fe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Fe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Fe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Fe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Fe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Fe.errToObj(n)})}nonempty(t){return this.min(1,Fe.errToObj(t))}trim(){return new os({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new os({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new os({...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}}os.create=e=>new os({checks:[],typeName:at.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ut(e)});function KF(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,i=n>a?n:a,o=Number.parseInt(e.toFixed(i).replace(".","")),u=Number.parseInt(t.toFixed(i).replace(".",""));return o%u/10**i}class Ru extends bt{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)!==De.number){const o=this._getOrReturnCtx(t);return Ae(o,{code:xe.invalid_type,expected:De.number,received:o.parsedType}),nt}let a;const i=new Bn;for(const o of this._def.checks)o.kind==="int"?_t.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),Ae(a,{code:xe.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(a=this._getOrReturnCtx(t,a),Ae(a,{code:xe.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)&&(a=this._getOrReturnCtx(t,a),Ae(a,{code:xe.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?KF(t.data,o.value)!==0&&(a=this._getOrReturnCtx(t,a),Ae(a,{code:xe.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),Ae(a,{code:xe.not_finite,message:o.message}),i.dirty()):_t.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Fe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Fe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Fe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Fe.toString(n))}setLimit(t,n,a,i){return new Ru({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Fe.toString(i)}]})}_addCheck(t){return new Ru({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Fe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Fe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Fe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Fe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Fe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Fe.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"&&_t.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(t===null||a.value<t)&&(t=a.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ru.create=e=>new Ru({checks:[],typeName:at.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ut(e)});class _u extends bt{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)!==De.bigint)return this._getInvalidInput(t);let a;const i=new Bn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(a=this._getOrReturnCtx(t,a),Ae(a,{code:xe.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)&&(a=this._getOrReturnCtx(t,a),Ae(a,{code:xe.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),Ae(a,{code:xe.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):_t.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ae(n,{code:xe.invalid_type,expected:De.bigint,received:n.parsedType}),nt}gte(t,n){return this.setLimit("min",t,!0,Fe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Fe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Fe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Fe.toString(n))}setLimit(t,n,a,i){return new _u({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Fe.toString(i)}]})}_addCheck(t){return new _u({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Fe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Fe.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}}_u.create=e=>new _u({checks:[],typeName:at.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ut(e)});class sy extends bt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==De.boolean){const a=this._getOrReturnCtx(t);return Ae(a,{code:xe.invalid_type,expected:De.boolean,received:a.parsedType}),nt}return Zr(t.data)}}sy.create=e=>new sy({typeName:at.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ut(e)});class xh extends bt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==De.date){const o=this._getOrReturnCtx(t);return Ae(o,{code:xe.invalid_type,expected:De.date,received:o.parsedType}),nt}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ae(o,{code:xe.invalid_date}),nt}const a=new Bn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),a.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:xe.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),a.dirty()):_t.assertNever(o);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(t){return new xh({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Fe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Fe.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}}xh.create=e=>new xh({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:at.ZodDate,...ut(e)});class JE extends bt{_parse(t){if(this._getType(t)!==De.symbol){const a=this._getOrReturnCtx(t);return Ae(a,{code:xe.invalid_type,expected:De.symbol,received:a.parsedType}),nt}return Zr(t.data)}}JE.create=e=>new JE({typeName:at.ZodSymbol,...ut(e)});class iy extends bt{_parse(t){if(this._getType(t)!==De.undefined){const a=this._getOrReturnCtx(t);return Ae(a,{code:xe.invalid_type,expected:De.undefined,received:a.parsedType}),nt}return Zr(t.data)}}iy.create=e=>new iy({typeName:at.ZodUndefined,...ut(e)});class bh extends bt{_parse(t){if(this._getType(t)!==De.null){const a=this._getOrReturnCtx(t);return Ae(a,{code:xe.invalid_type,expected:De.null,received:a.parsedType}),nt}return Zr(t.data)}}bh.create=e=>new bh({typeName:at.ZodNull,...ut(e)});class eC extends bt{constructor(){super(...arguments),this._any=!0}_parse(t){return Zr(t.data)}}eC.create=e=>new eC({typeName:at.ZodAny,...ut(e)});class oy extends bt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Zr(t.data)}}oy.create=e=>new oy({typeName:at.ZodUnknown,...ut(e)});class oi extends bt{_parse(t){const n=this._getOrReturnCtx(t);return Ae(n,{code:xe.invalid_type,expected:De.never,received:n.parsedType}),nt}}oi.create=e=>new oi({typeName:at.ZodNever,...ut(e)});class tC extends bt{_parse(t){if(this._getType(t)!==De.undefined){const a=this._getOrReturnCtx(t);return Ae(a,{code:xe.invalid_type,expected:De.void,received:a.parsedType}),nt}return Zr(t.data)}}tC.create=e=>new tC({typeName:at.ZodVoid,...ut(e)});class _a extends bt{_parse(t){const{ctx:n,status:a}=this._processInputParams(t),i=this._def;if(n.parsedType!==De.array)return Ae(n,{code:xe.invalid_type,expected:De.array,received:n.parsedType}),nt;if(i.exactLength!==null){const u=n.data.length>i.exactLength.value,f=n.data.length<i.exactLength.value;(u||f)&&(Ae(n,{code:u?xe.too_big:xe.too_small,minimum:f?i.exactLength.value:void 0,maximum:u?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ae(n,{code:xe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ae(n,{code:xe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((u,f)=>i.type._parseAsync(new Da(n,u,n.path,f)))).then(u=>Bn.mergeArray(a,u));const o=[...n.data].map((u,f)=>i.type._parseSync(new Da(n,u,n.path,f)));return Bn.mergeArray(a,o)}get element(){return this._def.type}min(t,n){return new _a({...this._def,minLength:{value:t,message:Fe.toString(n)}})}max(t,n){return new _a({...this._def,maxLength:{value:t,message:Fe.toString(n)}})}length(t,n){return new _a({...this._def,exactLength:{value:t,message:Fe.toString(n)}})}nonempty(t){return this.min(1,t)}}_a.create=(e,t)=>new _a({type:e,minLength:null,maxLength:null,exactLength:null,typeName:at.ZodArray,...ut(t)});function il(e){if(e instanceof hn){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=cs.create(il(a))}return new hn({...e._def,shape:()=>t})}else return e instanceof _a?new _a({...e._def,type:il(e.element)}):e instanceof cs?cs.create(il(e.unwrap())):e instanceof Wi?Wi.create(il(e.unwrap())):e instanceof Ki?Ki.create(e.items.map(t=>il(t))):e}class hn extends bt{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=_t.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==De.object){const m=this._getOrReturnCtx(t);return Ae(m,{code:xe.invalid_type,expected:De.object,received:m.parsedType}),nt}const{status:a,ctx:i}=this._processInputParams(t),{shape:o,keys:u}=this._getCached(),f=[];if(!(this._def.catchall instanceof oi&&this._def.unknownKeys==="strip"))for(const m in i.data)u.includes(m)||f.push(m);const h=[];for(const m of u){const v=o[m],b=i.data[m];h.push({key:{status:"valid",value:m},value:v._parse(new Da(i,b,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof oi){const m=this._def.unknownKeys;if(m==="passthrough")for(const v of f)h.push({key:{status:"valid",value:v},value:{status:"valid",value:i.data[v]}});else if(m==="strict")f.length>0&&(Ae(i,{code:xe.unrecognized_keys,keys:f}),a.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const v of f){const b=i.data[v];h.push({key:{status:"valid",value:v},value:m._parse(new Da(i,b,i.path,v)),alwaysSet:v in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const m=[];for(const v of h){const b=await v.key,y=await v.value;m.push({key:b,value:y,alwaysSet:v.alwaysSet})}return m}).then(m=>Bn.mergeObjectSync(a,m)):Bn.mergeObjectSync(a,h)}get shape(){return this._def.shape()}strict(t){return Fe.errToObj,new hn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,a)=>{var o,u;const i=((u=(o=this._def).errorMap)==null?void 0:u.call(o,n,a).message)??a.defaultError;return n.code==="unrecognized_keys"?{message:Fe.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new hn({...this._def,unknownKeys:"strip"})}passthrough(){return new hn({...this._def,unknownKeys:"passthrough"})}extend(t){return new hn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new hn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:at.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new hn({...this._def,catchall:t})}pick(t){const n={};for(const a of _t.objectKeys(t))t[a]&&this.shape[a]&&(n[a]=this.shape[a]);return new hn({...this._def,shape:()=>n})}omit(t){const n={};for(const a of _t.objectKeys(this.shape))t[a]||(n[a]=this.shape[a]);return new hn({...this._def,shape:()=>n})}deepPartial(){return il(this)}partial(t){const n={};for(const a of _t.objectKeys(this.shape)){const i=this.shape[a];t&&!t[a]?n[a]=i:n[a]=i.optional()}return new hn({...this._def,shape:()=>n})}required(t){const n={};for(const a of _t.objectKeys(this.shape))if(t&&!t[a])n[a]=this.shape[a];else{let o=this.shape[a];for(;o instanceof cs;)o=o._def.innerType;n[a]=o}return new hn({...this._def,shape:()=>n})}keyof(){return W_(_t.objectKeys(this.shape))}}hn.create=(e,t)=>new hn({shape:()=>e,unknownKeys:"strip",catchall:oi.create(),typeName:at.ZodObject,...ut(t)});hn.strictCreate=(e,t)=>new hn({shape:()=>e,unknownKeys:"strict",catchall:oi.create(),typeName:at.ZodObject,...ut(t)});hn.lazycreate=(e,t)=>new hn({shape:e,unknownKeys:"strip",catchall:oi.create(),typeName:at.ZodObject,...ut(t)});class Sh extends bt{_parse(t){const{ctx:n}=this._processInputParams(t),a=this._def.options;function i(o){for(const f of o)if(f.result.status==="valid")return f.result;for(const f of o)if(f.result.status==="dirty")return n.common.issues.push(...f.ctx.common.issues),f.result;const u=o.map(f=>new ms(f.ctx.common.issues));return Ae(n,{code:xe.invalid_union,unionErrors:u}),nt}if(n.common.async)return Promise.all(a.map(async o=>{const u={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:u}),ctx:u}})).then(i);{let o;const u=[];for(const h of a){const m={...n,common:{...n.common,issues:[]},parent:null},v=h._parseSync({data:n.data,path:n.path,parent:m});if(v.status==="valid")return v;v.status==="dirty"&&!o&&(o={result:v,ctx:m}),m.common.issues.length&&u.push(m.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const f=u.map(h=>new ms(h));return Ae(n,{code:xe.invalid_union,unionErrors:f}),nt}}get options(){return this._def.options}}Sh.create=(e,t)=>new Sh({options:e,typeName:at.ZodUnion,...ut(t)});const as=e=>e instanceof cy?as(e.schema):e instanceof Xi?as(e.innerType()):e instanceof Ch?[e.value]:e instanceof Qi?e.options:e instanceof Rh?_t.objectValues(e.enum):e instanceof Th?as(e._def.innerType):e instanceof iy?[void 0]:e instanceof bh?[null]:e instanceof cs?[void 0,...as(e.unwrap())]:e instanceof Wi?[null,...as(e.unwrap())]:e instanceof J_||e instanceof Ah?as(e.unwrap()):e instanceof Nh?as(e._def.innerType):[];class Dx extends bt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==De.object)return Ae(n,{code:xe.invalid_type,expected:De.object,received:n.parsedType}),nt;const a=this.discriminator,i=n.data[a],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}):(Ae(n,{code:xe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),nt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,a){const i=new Map;for(const o of n){const u=as(o.shape[t]);if(!u.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const f of u){if(i.has(f))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);i.set(f,o)}}return new Dx({typeName:at.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ut(a)})}}function ly(e,t){const n=Qs(e),a=Qs(t);if(e===t)return{valid:!0,data:e};if(n===De.object&&a===De.object){const i=_t.objectKeys(t),o=_t.objectKeys(e).filter(f=>i.indexOf(f)!==-1),u={...e,...t};for(const f of o){const h=ly(e[f],t[f]);if(!h.valid)return{valid:!1};u[f]=h.data}return{valid:!0,data:u}}else if(n===De.array&&a===De.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const u=e[o],f=t[o],h=ly(u,f);if(!h.valid)return{valid:!1};i.push(h.data)}return{valid:!0,data:i}}else return n===De.date&&a===De.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class wh extends bt{_parse(t){const{status:n,ctx:a}=this._processInputParams(t),i=(o,u)=>{if(QE(o)||QE(u))return nt;const f=ly(o.value,u.value);return f.valid?((XE(o)||XE(u))&&n.dirty(),{status:n.value,value:f.data}):(Ae(a,{code:xe.invalid_intersection_types}),nt)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([o,u])=>i(o,u)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}wh.create=(e,t,n)=>new wh({left:e,right:t,typeName:at.ZodIntersection,...ut(n)});class Ki extends bt{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==De.array)return Ae(a,{code:xe.invalid_type,expected:De.array,received:a.parsedType}),nt;if(a.data.length<this._def.items.length)return Ae(a,{code:xe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nt;!this._def.rest&&a.data.length>this._def.items.length&&(Ae(a,{code:xe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...a.data].map((u,f)=>{const h=this._def.items[f]||this._def.rest;return h?h._parse(new Da(a,u,a.path,f)):null}).filter(u=>!!u);return a.common.async?Promise.all(o).then(u=>Bn.mergeArray(n,u)):Bn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ki({...this._def,rest:t})}}Ki.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ki({items:e,typeName:at.ZodTuple,rest:null,...ut(t)})};class Eh extends bt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==De.object)return Ae(a,{code:xe.invalid_type,expected:De.object,received:a.parsedType}),nt;const i=[],o=this._def.keyType,u=this._def.valueType;for(const f in a.data)i.push({key:o._parse(new Da(a,f,a.path,f)),value:u._parse(new Da(a,a.data[f],a.path,f)),alwaysSet:f in a.data});return a.common.async?Bn.mergeObjectAsync(n,i):Bn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,a){return n instanceof bt?new Eh({keyType:t,valueType:n,typeName:at.ZodRecord,...ut(a)}):new Eh({keyType:os.create(),valueType:t,typeName:at.ZodRecord,...ut(n)})}}class nC extends bt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==De.map)return Ae(a,{code:xe.invalid_type,expected:De.map,received:a.parsedType}),nt;const i=this._def.keyType,o=this._def.valueType,u=[...a.data.entries()].map(([f,h],m)=>({key:i._parse(new Da(a,f,a.path,[m,"key"])),value:o._parse(new Da(a,h,a.path,[m,"value"]))}));if(a.common.async){const f=new Map;return Promise.resolve().then(async()=>{for(const h of u){const m=await h.key,v=await h.value;if(m.status==="aborted"||v.status==="aborted")return nt;(m.status==="dirty"||v.status==="dirty")&&n.dirty(),f.set(m.value,v.value)}return{status:n.value,value:f}})}else{const f=new Map;for(const h of u){const m=h.key,v=h.value;if(m.status==="aborted"||v.status==="aborted")return nt;(m.status==="dirty"||v.status==="dirty")&&n.dirty(),f.set(m.value,v.value)}return{status:n.value,value:f}}}}nC.create=(e,t,n)=>new nC({valueType:t,keyType:e,typeName:at.ZodMap,...ut(n)});class Tu extends bt{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==De.set)return Ae(a,{code:xe.invalid_type,expected:De.set,received:a.parsedType}),nt;const i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Ae(a,{code:xe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Ae(a,{code:xe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function u(h){const m=new Set;for(const v of h){if(v.status==="aborted")return nt;v.status==="dirty"&&n.dirty(),m.add(v.value)}return{status:n.value,value:m}}const f=[...a.data.values()].map((h,m)=>o._parse(new Da(a,h,a.path,m)));return a.common.async?Promise.all(f).then(h=>u(h)):u(f)}min(t,n){return new Tu({...this._def,minSize:{value:t,message:Fe.toString(n)}})}max(t,n){return new Tu({...this._def,maxSize:{value:t,message:Fe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Tu.create=(e,t)=>new Tu({valueType:e,minSize:null,maxSize:null,typeName:at.ZodSet,...ut(t)});class cy extends bt{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})}}cy.create=(e,t)=>new cy({getter:e,typeName:at.ZodLazy,...ut(t)});class Ch extends bt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ae(n,{received:n.data,code:xe.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ch.create=(e,t)=>new Ch({value:e,typeName:at.ZodLiteral,...ut(t)});function W_(e,t){return new Qi({values:e,typeName:at.ZodEnum,...ut(t)})}class Qi extends bt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),a=this._def.values;return Ae(n,{expected:_t.joinValues(a),received:n.parsedType,code:xe.invalid_type}),nt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),a=this._def.values;return Ae(n,{received:n.data,code:xe.invalid_enum_value,options:a}),nt}return Zr(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 Qi.create(t,{...this._def,...n})}exclude(t,n=this._def){return Qi.create(this.options.filter(a=>!t.includes(a)),{...this._def,...n})}}Qi.create=W_;class Rh extends bt{_parse(t){const n=_t.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==De.string&&a.parsedType!==De.number){const i=_t.objectValues(n);return Ae(a,{expected:_t.joinValues(i),received:a.parsedType,code:xe.invalid_type}),nt}if(this._cache||(this._cache=new Set(_t.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=_t.objectValues(n);return Ae(a,{received:a.data,code:xe.invalid_enum_value,options:i}),nt}return Zr(t.data)}get enum(){return this._def.values}}Rh.create=(e,t)=>new Rh({values:e,typeName:at.ZodNativeEnum,...ut(t)});class _h extends bt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==De.promise&&n.common.async===!1)return Ae(n,{code:xe.invalid_type,expected:De.promise,received:n.parsedType}),nt;const a=n.parsedType===De.promise?n.data:Promise.resolve(n.data);return Zr(a.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}_h.create=(e,t)=>new _h({type:e,typeName:at.ZodPromise,...ut(t)});class Xi extends bt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===at.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:a}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:u=>{Ae(a,u),u.fatal?n.abort():n.dirty()},get path(){return a.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const u=i.transform(a.data,o);if(a.common.async)return Promise.resolve(u).then(async f=>{if(n.value==="aborted")return nt;const h=await this._def.schema._parseAsync({data:f,path:a.path,parent:a});return h.status==="aborted"?nt:h.status==="dirty"||n.value==="dirty"?su(h.value):h});{if(n.value==="aborted")return nt;const f=this._def.schema._parseSync({data:u,path:a.path,parent:a});return f.status==="aborted"?nt:f.status==="dirty"||n.value==="dirty"?su(f.value):f}}if(i.type==="refinement"){const u=f=>{const h=i.refinement(f,o);if(a.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(a.common.async===!1){const f=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return f.status==="aborted"?nt:(f.status==="dirty"&&n.dirty(),u(f.value),{status:n.value,value:f.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(f=>f.status==="aborted"?nt:(f.status==="dirty"&&n.dirty(),u(f.value).then(()=>({status:n.value,value:f.value}))))}if(i.type==="transform")if(a.common.async===!1){const u=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!yl(u))return nt;const f=i.transform(u.value,o);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:f}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(u=>yl(u)?Promise.resolve(i.transform(u.value,o)).then(f=>({status:n.value,value:f})):nt);_t.assertNever(i)}}Xi.create=(e,t,n)=>new Xi({schema:e,typeName:at.ZodEffects,effect:t,...ut(n)});Xi.createWithPreprocess=(e,t,n)=>new Xi({schema:t,effect:{type:"preprocess",transform:e},typeName:at.ZodEffects,...ut(n)});class cs extends bt{_parse(t){return this._getType(t)===De.undefined?Zr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}cs.create=(e,t)=>new cs({innerType:e,typeName:at.ZodOptional,...ut(t)});class Wi extends bt{_parse(t){return this._getType(t)===De.null?Zr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Wi.create=(e,t)=>new Wi({innerType:e,typeName:at.ZodNullable,...ut(t)});class Th extends bt{_parse(t){const{ctx:n}=this._processInputParams(t);let a=n.data;return n.parsedType===De.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Th.create=(e,t)=>new Th({innerType:e,typeName:at.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ut(t)});class Nh extends bt{_parse(t){const{ctx:n}=this._processInputParams(t),a={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return yh(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ms(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ms(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Nh.create=(e,t)=>new Nh({innerType:e,typeName:at.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ut(t)});class rC extends bt{_parse(t){if(this._getType(t)!==De.nan){const a=this._getOrReturnCtx(t);return Ae(a,{code:xe.invalid_type,expected:De.nan,received:a.parsedType}),nt}return{status:"valid",value:t.data}}}rC.create=e=>new rC({typeName:at.ZodNaN,...ut(e)});class J_ extends bt{_parse(t){const{ctx:n}=this._processInputParams(t),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ox extends bt{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?nt:o.status==="dirty"?(n.dirty(),su(o.value)):this._def.out._parseAsync({data:o.value,path:a.path,parent:a})})();{const i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?nt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(t,n){return new Ox({in:t,out:n,typeName:at.ZodPipeline})}}class Ah extends bt{_parse(t){const n=this._def.innerType._parse(t),a=i=>(yl(i)&&(i.value=Object.freeze(i.value)),i);return yh(n)?n.then(i=>a(i)):a(n)}unwrap(){return this._def.innerType}}Ah.create=(e,t)=>new Ah({innerType:e,typeName:at.ZodReadonly,...ut(t)});var at;(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"})(at||(at={}));const Bt=os.create,QF=sy.create,XF=bh.create,WF=oy.create;oi.create;const aC=_a.create,$t=hn.create,JF=Sh.create,eT=Dx.create;wh.create;Ki.create;const e6=Eh.create,ys=Ch.create;Qi.create;const Mx=Rh.create;_h.create;cs.create;const t6=Wi.create,kf=nt,tT=$t({serviceAccount:Bt().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:xe.custom,message:"Service Account must be a valid JSON object"}),kf):n.client_email?n.private_key?e:(t.addIssue({code:xe.custom,message:"Service Account must contain a private_key field"}),kf):(t.addIssue({code:xe.custom,message:"Service Account must contain a client_email field"}),kf)}catch(n){return console.error(n),t.addIssue({code:xe.custom,message:"Service Account must be a valid JSON string"}),kf}})}),n6=[{title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:bF},{title:"Discover Upgrade Options",href:"https://www.owox.com/pricing/?utm_source=bi_owox_com&utm_medium=community_edition&utm_campaign=pricing&utm_keyword=upgrade_options&utm_content=header_dropdown",icon:q4},{type:"separator"},{title:"Leave your feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:e3},{title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:Yh},{type:"separator"},{title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:f3}];function r6(){const[e,t]=g.useState(!1);return c.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:c.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:c.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:c.jsxs(Gr,{open:e,onOpenChange:t,children:[c.jsx(qr,{asChild:!0,children:c.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[c.jsx("div",{className:"text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white dark:bg-white/10",children:c.jsx(xF,{width:24,height:24})}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),c.jsx("span",{className:"text-muted-foreground truncate text-xs",children:"Community Edition"})]}),c.jsx(gs,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})}),c.jsx(Cr,{align:"start",sideOffset:8,className:"min-w-max",children:n6.map((n,a)=>{if(n.type==="separator")return c.jsx(ho,{},`separator-${String(a)}`);const i=n.icon;return c.jsx(Zt,{asChild:!0,children:c.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[c.jsx(i,{className:"size-4"}),n.title]})},n.href)})})]})})})})}const a6=[{title:"Data Marts",url:"/data-marts",icon:S4},{title:"Storages",url:"/data-storages",icon:FR},{title:"Destinations",url:"/data-destinations",icon:MR}];function s6({variant:e="inset",collapsible:t="icon"}){return c.jsxs(EP,{variant:e,collapsible:t,children:[c.jsx(TP,{children:c.jsx(r6,{})}),c.jsxs(AP,{children:[c.jsx(GE,{children:c.jsx(qE,{children:c.jsxs(ch,{to:"/data-marts/create","data-sidebar":"menu-button","data-size":"md",className:"peer/menu-button ring-sidebar-ring bg-primary hover:bg-primary-hover text-primary-foreground hover:text-primary-foreground flex h-8 w-full items-center gap-2 overflow-hidden rounded-full p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[c.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:c.jsx(Pa,{className:"size-4 shrink-0"})}),c.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:c.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})})}),c.jsx(GE,{children:c.jsx(qE,{children:c.jsx(jP,{children:a6.map(n=>c.jsx(DP,{children:c.jsx(ch,{to:n.url,className:({isActive:a})=>`flex w-full items-center gap-2 rounded-md font-medium transition-colors ${a?"bg-sidebar-active text-sidebar-active-foreground font-medium shadow-sm":""}`,children:c.jsxs(sn,{delayDuration:500,children:[c.jsx(on,{asChild:!0,children:c.jsxs(MP,{children:[g.createElement(n.icon,{className:"size-4 shrink-0 transition-all "}),c.jsx("span",{children:n.title})]})}),c.jsx(ln,{side:"right",children:n.title})]})})},n.title))})})})]}),c.jsx(NP,{className:"p-2",children:c.jsx(HP,{})}),c.jsx(RP,{})]})}function i6({children:e,...t}){return c.jsx(PP,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}function nT(e,t){return function(){return e.apply(t,arguments)}}const{toString:o6}=Object.prototype,{getPrototypeOf:kx}=Object,{iterator:pm,toStringTag:rT}=Symbol,gm=(e=>t=>{const n=o6.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),fa=e=>(e=e.toLowerCase(),t=>gm(t)===e),vm=e=>t=>typeof t===e,{isArray:Ol}=Array,Nu=vm("undefined");function l6(e){return e!==null&&!Nu(e)&&e.constructor!==null&&!Nu(e.constructor)&&er(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const aT=fa("ArrayBuffer");function c6(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&aT(e.buffer),t}const u6=vm("string"),er=vm("function"),sT=vm("number"),ym=e=>e!==null&&typeof e=="object",d6=e=>e===!0||e===!1,Qf=e=>{if(gm(e)!=="object")return!1;const t=kx(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(rT in e)&&!(pm in e)},f6=fa("Date"),h6=fa("File"),m6=fa("Blob"),p6=fa("FileList"),g6=e=>ym(e)&&er(e.pipe),v6=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||er(e.append)&&((t=gm(e))==="formdata"||t==="object"&&er(e.toString)&&e.toString()==="[object FormData]"))},y6=fa("URLSearchParams"),[x6,b6,S6,w6]=["ReadableStream","Request","Response","Headers"].map(fa),E6=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qu(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,i;if(typeof e!="object"&&(e=[e]),Ol(e))for(a=0,i=e.length;a<i;a++)t.call(null,e[a],a,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),u=o.length;let f;for(a=0;a<u;a++)f=o[a],t.call(null,e[f],f,e)}}function iT(e,t){t=t.toLowerCase();const n=Object.keys(e);let a=n.length,i;for(;a-- >0;)if(i=n[a],t===i.toLowerCase())return i;return null}const $i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,oT=e=>!Nu(e)&&e!==$i;function uy(){const{caseless:e}=oT(this)&&this||{},t={},n=(a,i)=>{const o=e&&iT(t,i)||i;Qf(t[o])&&Qf(a)?t[o]=uy(t[o],a):Qf(a)?t[o]=uy({},a):Ol(a)?t[o]=a.slice():t[o]=a};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&Qu(arguments[a],n);return t}const C6=(e,t,n,{allOwnKeys:a}={})=>(Qu(t,(i,o)=>{n&&er(i)?e[o]=nT(i,n):e[o]=i},{allOwnKeys:a}),e),R6=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),_6=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},T6=(e,t,n,a)=>{let i,o,u;const f={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)u=i[o],(!a||a(u,e,t))&&!f[u]&&(t[u]=e[u],f[u]=!0);e=n!==!1&&kx(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},N6=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},A6=e=>{if(!e)return null;if(Ol(e))return e;let t=e.length;if(!sT(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},j6=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&kx(Uint8Array)),D6=(e,t)=>{const a=(e&&e[pm]).call(e);let i;for(;(i=a.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},O6=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},M6=fa("HTMLFormElement"),k6=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,i){return a.toUpperCase()+i}),sC=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),L6=fa("RegExp"),lT=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};Qu(n,(i,o)=>{let u;(u=t(i,o,e))!==!1&&(a[o]=u||i)}),Object.defineProperties(e,a)},I6=e=>{lT(e,(t,n)=>{if(er(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if(er(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},P6=(e,t)=>{const n={},a=i=>{i.forEach(o=>{n[o]=!0})};return Ol(e)?a(e):a(String(e).split(t)),n},F6=()=>{},U6=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function z6(e){return!!(e&&er(e.append)&&e[rT]==="FormData"&&e[pm])}const V6=e=>{const t=new Array(10),n=(a,i)=>{if(ym(a)){if(t.indexOf(a)>=0)return;if(!("toJSON"in a)){t[i]=a;const o=Ol(a)?[]:{};return Qu(a,(u,f)=>{const h=n(u,i+1);!Nu(h)&&(o[f]=h)}),t[i]=void 0,o}}return a};return n(e,0)},$6=fa("AsyncFunction"),H6=e=>e&&(ym(e)||er(e))&&er(e.then)&&er(e.catch),cT=((e,t)=>e?setImmediate:t?((n,a)=>($i.addEventListener("message",({source:i,data:o})=>{i===$i&&o===n&&a.length&&a.shift()()},!1),i=>{a.push(i),$i.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",er($i.postMessage)),B6=typeof queueMicrotask<"u"?queueMicrotask.bind($i):typeof process<"u"&&process.nextTick||cT,G6=e=>e!=null&&er(e[pm]),ae={isArray:Ol,isArrayBuffer:aT,isBuffer:l6,isFormData:v6,isArrayBufferView:c6,isString:u6,isNumber:sT,isBoolean:d6,isObject:ym,isPlainObject:Qf,isReadableStream:x6,isRequest:b6,isResponse:S6,isHeaders:w6,isUndefined:Nu,isDate:f6,isFile:h6,isBlob:m6,isRegExp:L6,isFunction:er,isStream:g6,isURLSearchParams:y6,isTypedArray:j6,isFileList:p6,forEach:Qu,merge:uy,extend:C6,trim:E6,stripBOM:R6,inherits:_6,toFlatObject:T6,kindOf:gm,kindOfTest:fa,endsWith:N6,toArray:A6,forEachEntry:D6,matchAll:O6,isHTMLForm:M6,hasOwnProperty:sC,hasOwnProp:sC,reduceDescriptors:lT,freezeMethods:I6,toObjectSet:P6,toCamelCase:k6,noop:F6,toFiniteNumber:U6,findKey:iT,global:$i,isContextDefined:oT,isSpecCompliantForm:z6,toJSONObject:V6,isAsyncFn:$6,isThenable:H6,setImmediate:cT,asap:B6,isIterable:G6};function lt(e,t,n,a,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),a&&(this.request=a),i&&(this.response=i,this.status=i.status?i.status:null)}ae.inherits(lt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ae.toJSONObject(this.config),code:this.code,status:this.status}}});const uT=lt.prototype,dT={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{dT[e]={value:e}});Object.defineProperties(lt,dT);Object.defineProperty(uT,"isAxiosError",{value:!0});lt.from=(e,t,n,a,i,o)=>{const u=Object.create(uT);return ae.toFlatObject(e,u,function(h){return h!==Error.prototype},f=>f!=="isAxiosError"),lt.call(u,e.message,t,n,a,i),u.cause=e,u.name=e.name,o&&Object.assign(u,o),u};const q6=null;function dy(e){return ae.isPlainObject(e)||ae.isArray(e)}function fT(e){return ae.endsWith(e,"[]")?e.slice(0,-2):e}function iC(e,t,n){return e?e.concat(t).map(function(i,o){return i=fT(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function Z6(e){return ae.isArray(e)&&!e.some(dy)}const Y6=ae.toFlatObject(ae,{},null,function(t){return/^is[A-Z]/.test(t)});function xm(e,t,n){if(!ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ae.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,C){return!ae.isUndefined(C[E])});const a=n.metaTokens,i=n.visitor||v,o=n.dots,u=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&ae.isSpecCompliantForm(t);if(!ae.isFunction(i))throw new TypeError("visitor must be a function");function m(w){if(w===null)return"";if(ae.isDate(w))return w.toISOString();if(!h&&ae.isBlob(w))throw new lt("Blob is not supported. Use a Buffer instead.");return ae.isArrayBuffer(w)||ae.isTypedArray(w)?h&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function v(w,E,C){let R=w;if(w&&!C&&typeof w=="object"){if(ae.endsWith(E,"{}"))E=a?E:E.slice(0,-2),w=JSON.stringify(w);else if(ae.isArray(w)&&Z6(w)||(ae.isFileList(w)||ae.endsWith(E,"[]"))&&(R=ae.toArray(w)))return E=fT(E),R.forEach(function(N,O){!(ae.isUndefined(N)||N===null)&&t.append(u===!0?iC([E],O,o):u===null?E:E+"[]",m(N))}),!1}return dy(w)?!0:(t.append(iC(C,E,o),m(w)),!1)}const b=[],y=Object.assign(Y6,{defaultVisitor:v,convertValue:m,isVisitable:dy});function S(w,E){if(!ae.isUndefined(w)){if(b.indexOf(w)!==-1)throw Error("Circular reference detected in "+E.join("."));b.push(w),ae.forEach(w,function(R,T){(!(ae.isUndefined(R)||R===null)&&i.call(t,R,ae.isString(T)?T.trim():T,E,y))===!0&&S(R,E?E.concat(T):[T])}),b.pop()}}if(!ae.isObject(e))throw new TypeError("data must be an object");return S(e),t}function oC(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function Lx(e,t){this._pairs=[],e&&xm(e,this,t)}const hT=Lx.prototype;hT.append=function(t,n){this._pairs.push([t,n])};hT.toString=function(t){const n=t?function(a){return t.call(this,a,oC)}:oC;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function K6(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function mT(e,t,n){if(!t)return e;const a=n&&n.encode||K6;ae.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=ae.isURLSearchParams(t)?t.toString():new Lx(t,n).toString(a),o){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class lC{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ae.forEach(this.handlers,function(a){a!==null&&t(a)})}}const pT={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q6=typeof URLSearchParams<"u"?URLSearchParams:Lx,X6=typeof FormData<"u"?FormData:null,W6=typeof Blob<"u"?Blob:null,J6={isBrowser:!0,classes:{URLSearchParams:Q6,FormData:X6,Blob:W6},protocols:["http","https","file","blob","url","data"]},Ix=typeof window<"u"&&typeof document<"u",fy=typeof navigator=="object"&&navigator||void 0,e8=Ix&&(!fy||["ReactNative","NativeScript","NS"].indexOf(fy.product)<0),t8=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",n8=Ix&&window.location.href||"http://localhost",r8=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ix,hasStandardBrowserEnv:e8,hasStandardBrowserWebWorkerEnv:t8,navigator:fy,origin:n8},Symbol.toStringTag,{value:"Module"})),In={...r8,...J6};function a8(e,t){return xm(e,new In.classes.URLSearchParams,Object.assign({visitor:function(n,a,i,o){return In.isNode&&ae.isBuffer(n)?(this.append(a,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function s8(e){return ae.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function i8(e){const t={},n=Object.keys(e);let a;const i=n.length;let o;for(a=0;a<i;a++)o=n[a],t[o]=e[o];return t}function gT(e){function t(n,a,i,o){let u=n[o++];if(u==="__proto__")return!0;const f=Number.isFinite(+u),h=o>=n.length;return u=!u&&ae.isArray(i)?i.length:u,h?(ae.hasOwnProp(i,u)?i[u]=[i[u],a]:i[u]=a,!f):((!i[u]||!ae.isObject(i[u]))&&(i[u]=[]),t(n,a,i[u],o)&&ae.isArray(i[u])&&(i[u]=i8(i[u])),!f)}if(ae.isFormData(e)&&ae.isFunction(e.entries)){const n={};return ae.forEachEntry(e,(a,i)=>{t(s8(a),i,n,0)}),n}return null}function o8(e,t,n){if(ae.isString(e))try{return(t||JSON.parse)(e),ae.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const Xu={transitional:pT,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const a=n.getContentType()||"",i=a.indexOf("application/json")>-1,o=ae.isObject(t);if(o&&ae.isHTMLForm(t)&&(t=new FormData(t)),ae.isFormData(t))return i?JSON.stringify(gT(t)):t;if(ae.isArrayBuffer(t)||ae.isBuffer(t)||ae.isStream(t)||ae.isFile(t)||ae.isBlob(t)||ae.isReadableStream(t))return t;if(ae.isArrayBufferView(t))return t.buffer;if(ae.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let f;if(o){if(a.indexOf("application/x-www-form-urlencoded")>-1)return a8(t,this.formSerializer).toString();if((f=ae.isFileList(t))||a.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return xm(f?{"files[]":t}:t,h&&new h,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),o8(t)):t}],transformResponse:[function(t){const n=this.transitional||Xu.transitional,a=n&&n.forcedJSONParsing,i=this.responseType==="json";if(ae.isResponse(t)||ae.isReadableStream(t))return t;if(t&&ae.isString(t)&&(a&&!this.responseType||i)){const u=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(f){if(u)throw f.name==="SyntaxError"?lt.from(f,lt.ERR_BAD_RESPONSE,this,null,this.response):f}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:In.classes.FormData,Blob:In.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ae.forEach(["delete","get","head","post","put","patch"],e=>{Xu.headers[e]={}});const l8=ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),c8=e=>{const t={};let n,a,i;return e&&e.split(`
|
|
380
|
+
`).forEach(function(u){i=u.indexOf(":"),n=u.substring(0,i).trim().toLowerCase(),a=u.substring(i+1).trim(),!(!n||t[n]&&l8[n])&&(n==="set-cookie"?t[n]?t[n].push(a):t[n]=[a]:t[n]=t[n]?t[n]+", "+a:a)}),t},cC=Symbol("internals");function qc(e){return e&&String(e).trim().toLowerCase()}function Xf(e){return e===!1||e==null?e:ae.isArray(e)?e.map(Xf):String(e)}function u8(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}const d8=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function yv(e,t,n,a,i){if(ae.isFunction(a))return a.call(this,t,n);if(i&&(t=n),!!ae.isString(t)){if(ae.isString(a))return t.indexOf(a)!==-1;if(ae.isRegExp(a))return a.test(t)}}function f8(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,a)=>n.toUpperCase()+a)}function h8(e,t){const n=ae.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+n,{value:function(i,o,u){return this[a].call(this,t,i,o,u)},configurable:!0})})}let tr=class{constructor(t){t&&this.set(t)}set(t,n,a){const i=this;function o(f,h,m){const v=qc(h);if(!v)throw new Error("header name must be a non-empty string");const b=ae.findKey(i,v);(!b||i[b]===void 0||m===!0||m===void 0&&i[b]!==!1)&&(i[b||h]=Xf(f))}const u=(f,h)=>ae.forEach(f,(m,v)=>o(m,v,h));if(ae.isPlainObject(t)||t instanceof this.constructor)u(t,n);else if(ae.isString(t)&&(t=t.trim())&&!d8(t))u(c8(t),n);else if(ae.isObject(t)&&ae.isIterable(t)){let f={},h,m;for(const v of t){if(!ae.isArray(v))throw TypeError("Object iterator must return a key-value pair");f[m=v[0]]=(h=f[m])?ae.isArray(h)?[...h,v[1]]:[h,v[1]]:v[1]}u(f,n)}else t!=null&&o(n,t,a);return this}get(t,n){if(t=qc(t),t){const a=ae.findKey(this,t);if(a){const i=this[a];if(!n)return i;if(n===!0)return u8(i);if(ae.isFunction(n))return n.call(this,i,a);if(ae.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=qc(t),t){const a=ae.findKey(this,t);return!!(a&&this[a]!==void 0&&(!n||yv(this,this[a],a,n)))}return!1}delete(t,n){const a=this;let i=!1;function o(u){if(u=qc(u),u){const f=ae.findKey(a,u);f&&(!n||yv(a,a[f],f,n))&&(delete a[f],i=!0)}}return ae.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let a=n.length,i=!1;for(;a--;){const o=n[a];(!t||yv(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,a={};return ae.forEach(this,(i,o)=>{const u=ae.findKey(a,o);if(u){n[u]=Xf(i),delete n[o];return}const f=t?f8(o):String(o).trim();f!==o&&delete n[o],n[f]=Xf(i),a[f]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ae.forEach(this,(a,i)=>{a!=null&&a!==!1&&(n[i]=t&&ae.isArray(a)?a.join(", "):a)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
381
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const a=new this(t);return n.forEach(i=>a.set(i)),a}static accessor(t){const a=(this[cC]=this[cC]={accessors:{}}).accessors,i=this.prototype;function o(u){const f=qc(u);a[f]||(h8(i,u),a[f]=!0)}return ae.isArray(t)?t.forEach(o):o(t),this}};tr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ae.reduceDescriptors(tr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}});ae.freezeMethods(tr);function xv(e,t){const n=this||Xu,a=t||n,i=tr.from(a.headers);let o=a.data;return ae.forEach(e,function(f){o=f.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function vT(e){return!!(e&&e.__CANCEL__)}function Ml(e,t,n){lt.call(this,e??"canceled",lt.ERR_CANCELED,t,n),this.name="CanceledError"}ae.inherits(Ml,lt,{__CANCEL__:!0});function yT(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new lt("Request failed with status code "+n.status,[lt.ERR_BAD_REQUEST,lt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function m8(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function p8(e,t){e=e||10;const n=new Array(e),a=new Array(e);let i=0,o=0,u;return t=t!==void 0?t:1e3,function(h){const m=Date.now(),v=a[o];u||(u=m),n[i]=h,a[i]=m;let b=o,y=0;for(;b!==i;)y+=n[b++],b=b%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),m-u<t)return;const S=v&&m-v;return S?Math.round(y*1e3/S):void 0}}function g8(e,t){let n=0,a=1e3/t,i,o;const u=(m,v=Date.now())=>{n=v,i=null,o&&(clearTimeout(o),o=null),e.apply(null,m)};return[(...m)=>{const v=Date.now(),b=v-n;b>=a?u(m,v):(i=m,o||(o=setTimeout(()=>{o=null,u(i)},a-b)))},()=>i&&u(i)]}const jh=(e,t,n=3)=>{let a=0;const i=p8(50,250);return g8(o=>{const u=o.loaded,f=o.lengthComputable?o.total:void 0,h=u-a,m=i(h),v=u<=f;a=u;const b={loaded:u,total:f,progress:f?u/f:void 0,bytes:h,rate:m||void 0,estimated:m&&f&&v?(f-u)/m:void 0,event:o,lengthComputable:f!=null,[t?"download":"upload"]:!0};e(b)},n)},uC=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},dC=e=>(...t)=>ae.asap(()=>e(...t)),v8=In.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,In.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(In.origin),In.navigator&&/(msie|trident)/i.test(In.navigator.userAgent)):()=>!0,y8=In.hasStandardBrowserEnv?{write(e,t,n,a,i,o){const u=[e+"="+encodeURIComponent(t)];ae.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),ae.isString(a)&&u.push("path="+a),ae.isString(i)&&u.push("domain="+i),o===!0&&u.push("secure"),document.cookie=u.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function x8(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function b8(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xT(e,t,n){let a=!x8(t);return e&&(a||n==!1)?b8(e,t):t}const fC=e=>e instanceof tr?{...e}:e;function Ji(e,t){t=t||{};const n={};function a(m,v,b,y){return ae.isPlainObject(m)&&ae.isPlainObject(v)?ae.merge.call({caseless:y},m,v):ae.isPlainObject(v)?ae.merge({},v):ae.isArray(v)?v.slice():v}function i(m,v,b,y){if(ae.isUndefined(v)){if(!ae.isUndefined(m))return a(void 0,m,b,y)}else return a(m,v,b,y)}function o(m,v){if(!ae.isUndefined(v))return a(void 0,v)}function u(m,v){if(ae.isUndefined(v)){if(!ae.isUndefined(m))return a(void 0,m)}else return a(void 0,v)}function f(m,v,b){if(b in t)return a(m,v);if(b in e)return a(void 0,m)}const h={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:f,headers:(m,v,b)=>i(fC(m),fC(v),b,!0)};return ae.forEach(Object.keys(Object.assign({},e,t)),function(v){const b=h[v]||i,y=b(e[v],t[v],v);ae.isUndefined(y)&&b!==f||(n[v]=y)}),n}const bT=e=>{const t=Ji({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:i,xsrfCookieName:o,headers:u,auth:f}=t;t.headers=u=tr.from(u),t.url=mT(xT(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),f&&u.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):"")));let h;if(ae.isFormData(n)){if(In.hasStandardBrowserEnv||In.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((h=u.getContentType())!==!1){const[m,...v]=h?h.split(";").map(b=>b.trim()).filter(Boolean):[];u.setContentType([m||"multipart/form-data",...v].join("; "))}}if(In.hasStandardBrowserEnv&&(a&&ae.isFunction(a)&&(a=a(t)),a||a!==!1&&v8(t.url))){const m=i&&o&&y8.read(o);m&&u.set(i,m)}return t},S8=typeof XMLHttpRequest<"u",w8=S8&&function(e){return new Promise(function(n,a){const i=bT(e);let o=i.data;const u=tr.from(i.headers).normalize();let{responseType:f,onUploadProgress:h,onDownloadProgress:m}=i,v,b,y,S,w;function E(){S&&S(),w&&w(),i.cancelToken&&i.cancelToken.unsubscribe(v),i.signal&&i.signal.removeEventListener("abort",v)}let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function R(){if(!C)return;const N=tr.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),A={data:!f||f==="text"||f==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:N,config:e,request:C};yT(function(L){n(L),E()},function(L){a(L),E()},A),C=null}"onloadend"in C?C.onloadend=R:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(R)},C.onabort=function(){C&&(a(new lt("Request aborted",lt.ECONNABORTED,e,C)),C=null)},C.onerror=function(){a(new lt("Network Error",lt.ERR_NETWORK,e,C)),C=null},C.ontimeout=function(){let O=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const A=i.transitional||pT;i.timeoutErrorMessage&&(O=i.timeoutErrorMessage),a(new lt(O,A.clarifyTimeoutError?lt.ETIMEDOUT:lt.ECONNABORTED,e,C)),C=null},o===void 0&&u.setContentType(null),"setRequestHeader"in C&&ae.forEach(u.toJSON(),function(O,A){C.setRequestHeader(A,O)}),ae.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),f&&f!=="json"&&(C.responseType=i.responseType),m&&([y,w]=jh(m,!0),C.addEventListener("progress",y)),h&&C.upload&&([b,S]=jh(h),C.upload.addEventListener("progress",b),C.upload.addEventListener("loadend",S)),(i.cancelToken||i.signal)&&(v=N=>{C&&(a(!N||N.type?new Ml(null,e,C):N),C.abort(),C=null)},i.cancelToken&&i.cancelToken.subscribe(v),i.signal&&(i.signal.aborted?v():i.signal.addEventListener("abort",v)));const T=m8(i.url);if(T&&In.protocols.indexOf(T)===-1){a(new lt("Unsupported protocol "+T+":",lt.ERR_BAD_REQUEST,e));return}C.send(o||null)})},E8=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,i;const o=function(m){if(!i){i=!0,f();const v=m instanceof Error?m:this.reason;a.abort(v instanceof lt?v:new Ml(v instanceof Error?v.message:v))}};let u=t&&setTimeout(()=>{u=null,o(new lt(`timeout ${t} of ms exceeded`,lt.ETIMEDOUT))},t);const f=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(o):m.removeEventListener("abort",o)}),e=null)};e.forEach(m=>m.addEventListener("abort",o));const{signal:h}=a;return h.unsubscribe=()=>ae.asap(f),h}},C8=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let a=0,i;for(;a<n;)i=a+t,yield e.slice(a,i),a=i},R8=async function*(e,t){for await(const n of _8(e))yield*C8(n,t)},_8=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:a}=await t.read();if(n)break;yield a}}finally{await t.cancel()}},hC=(e,t,n,a)=>{const i=R8(e,t);let o=0,u,f=h=>{u||(u=!0,a&&a(h))};return new ReadableStream({async pull(h){try{const{done:m,value:v}=await i.next();if(m){f(),h.close();return}let b=v.byteLength;if(n){let y=o+=b;n(y)}h.enqueue(new Uint8Array(v))}catch(m){throw f(m),m}},cancel(h){return f(h),i.return()}},{highWaterMark:2})},bm=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ST=bm&&typeof ReadableStream=="function",T8=bm&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),wT=(e,...t)=>{try{return!!e(...t)}catch{return!1}},N8=ST&&wT(()=>{let e=!1;const t=new Request(In.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),mC=64*1024,hy=ST&&wT(()=>ae.isReadableStream(new Response("").body)),Dh={stream:hy&&(e=>e.body)};bm&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Dh[t]&&(Dh[t]=ae.isFunction(e[t])?n=>n[t]():(n,a)=>{throw new lt(`Response type '${t}' is not supported`,lt.ERR_NOT_SUPPORT,a)})})})(new Response);const A8=async e=>{if(e==null)return 0;if(ae.isBlob(e))return e.size;if(ae.isSpecCompliantForm(e))return(await new Request(In.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ae.isArrayBufferView(e)||ae.isArrayBuffer(e))return e.byteLength;if(ae.isURLSearchParams(e)&&(e=e+""),ae.isString(e))return(await T8(e)).byteLength},j8=async(e,t)=>{const n=ae.toFiniteNumber(e.getContentLength());return n??A8(t)},D8=bm&&(async e=>{let{url:t,method:n,data:a,signal:i,cancelToken:o,timeout:u,onDownloadProgress:f,onUploadProgress:h,responseType:m,headers:v,withCredentials:b="same-origin",fetchOptions:y}=bT(e);m=m?(m+"").toLowerCase():"text";let S=E8([i,o&&o.toAbortSignal()],u),w;const E=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let C;try{if(h&&N8&&n!=="get"&&n!=="head"&&(C=await j8(v,a))!==0){let A=new Request(t,{method:"POST",body:a,duplex:"half"}),D;if(ae.isFormData(a)&&(D=A.headers.get("content-type"))&&v.setContentType(D),A.body){const[L,H]=uC(C,jh(dC(h)));a=hC(A.body,mC,L,H)}}ae.isString(b)||(b=b?"include":"omit");const R="credentials"in Request.prototype;w=new Request(t,{...y,signal:S,method:n.toUpperCase(),headers:v.normalize().toJSON(),body:a,duplex:"half",credentials:R?b:void 0});let T=await fetch(w);const N=hy&&(m==="stream"||m==="response");if(hy&&(f||N&&E)){const A={};["status","statusText","headers"].forEach(X=>{A[X]=T[X]});const D=ae.toFiniteNumber(T.headers.get("content-length")),[L,H]=f&&uC(D,jh(dC(f),!0))||[];T=new Response(hC(T.body,mC,L,()=>{H&&H(),E&&E()}),A)}m=m||"text";let O=await Dh[ae.findKey(Dh,m)||"text"](T,e);return!N&&E&&E(),await new Promise((A,D)=>{yT(A,D,{data:O,headers:tr.from(T.headers),status:T.status,statusText:T.statusText,config:e,request:w})})}catch(R){throw E&&E(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new lt("Network Error",lt.ERR_NETWORK,e,w),{cause:R.cause||R}):lt.from(R,R&&R.code,e,w)}}),my={http:q6,xhr:w8,fetch:D8};ae.forEach(my,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const pC=e=>`- ${e}`,O8=e=>ae.isFunction(e)||e===null||e===!1,ET={getAdapter:e=>{e=ae.isArray(e)?e:[e];const{length:t}=e;let n,a;const i={};for(let o=0;o<t;o++){n=e[o];let u;if(a=n,!O8(n)&&(a=my[(u=String(n)).toLowerCase()],a===void 0))throw new lt(`Unknown adapter '${u}'`);if(a)break;i[u||"#"+o]=a}if(!a){const o=Object.entries(i).map(([f,h])=>`adapter ${f} `+(h===!1?"is not supported by the environment":"is not available in the build"));let u=t?o.length>1?`since :
|
|
382
|
+
`+o.map(pC).join(`
|
|
383
|
+
`):" "+pC(o[0]):"as no adapter specified";throw new lt("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a},adapters:my};function bv(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ml(null,e)}function gC(e){return bv(e),e.headers=tr.from(e.headers),e.data=xv.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ET.getAdapter(e.adapter||Xu.adapter)(e).then(function(a){return bv(e),a.data=xv.call(e,e.transformResponse,a),a.headers=tr.from(a.headers),a},function(a){return vT(a)||(bv(e),a&&a.response&&(a.response.data=xv.call(e,e.transformResponse,a.response),a.response.headers=tr.from(a.response.headers))),Promise.reject(a)})}const CT="1.9.0",Sm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Sm[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const vC={};Sm.transitional=function(t,n,a){function i(o,u){return"[Axios v"+CT+"] Transitional option '"+o+"'"+u+(a?". "+a:"")}return(o,u,f)=>{if(t===!1)throw new lt(i(u," has been removed"+(n?" in "+n:"")),lt.ERR_DEPRECATED);return n&&!vC[u]&&(vC[u]=!0,console.warn(i(u," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,u,f):!0}};Sm.spelling=function(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function M8(e,t,n){if(typeof e!="object")throw new lt("options must be an object",lt.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let i=a.length;for(;i-- >0;){const o=a[i],u=t[o];if(u){const f=e[o],h=f===void 0||u(f,o,e);if(h!==!0)throw new lt("option "+o+" must be "+h,lt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new lt("Unknown option "+o,lt.ERR_BAD_OPTION)}}const Wf={assertOptions:M8,validators:Sm},xa=Wf.validators;let Gi=class{constructor(t){this.defaults=t||{},this.interceptors={request:new lC,response:new lC}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{a.stack?o&&!String(a.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
384
|
+
`+o):a.stack=o}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ji(this.defaults,n);const{transitional:a,paramsSerializer:i,headers:o}=n;a!==void 0&&Wf.assertOptions(a,{silentJSONParsing:xa.transitional(xa.boolean),forcedJSONParsing:xa.transitional(xa.boolean),clarifyTimeoutError:xa.transitional(xa.boolean)},!1),i!=null&&(ae.isFunction(i)?n.paramsSerializer={serialize:i}:Wf.assertOptions(i,{encode:xa.function,serialize:xa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Wf.assertOptions(n,{baseUrl:xa.spelling("baseURL"),withXsrfToken:xa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=o&&ae.merge(o.common,o[n.method]);o&&ae.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=tr.concat(u,o);const f=[];let h=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(h=h&&E.synchronous,f.unshift(E.fulfilled,E.rejected))});const m=[];this.interceptors.response.forEach(function(E){m.push(E.fulfilled,E.rejected)});let v,b=0,y;if(!h){const w=[gC.bind(this),void 0];for(w.unshift.apply(w,f),w.push.apply(w,m),y=w.length,v=Promise.resolve(n);b<y;)v=v.then(w[b++],w[b++]);return v}y=f.length;let S=n;for(b=0;b<y;){const w=f[b++],E=f[b++];try{S=w(S)}catch(C){E.call(this,C);break}}try{v=gC.call(this,S)}catch(w){return Promise.reject(w)}for(b=0,y=m.length;b<y;)v=v.then(m[b++],m[b++]);return v}getUri(t){t=Ji(this.defaults,t);const n=xT(t.baseURL,t.url,t.allowAbsoluteUrls);return mT(n,t.params,t.paramsSerializer)}};ae.forEach(["delete","get","head","options"],function(t){Gi.prototype[t]=function(n,a){return this.request(Ji(a||{},{method:t,url:n,data:(a||{}).data}))}});ae.forEach(["post","put","patch"],function(t){function n(a){return function(o,u,f){return this.request(Ji(f||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:u}))}}Gi.prototype[t]=n(),Gi.prototype[t+"Form"]=n(!0)});let k8=class RT{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const a=this;this.promise.then(i=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](i);a._listeners=null}),this.promise.then=i=>{let o;const u=new Promise(f=>{a.subscribe(f),o=f}).then(i);return u.cancel=function(){a.unsubscribe(o)},u},t(function(o,u,f){a.reason||(a.reason=new Ml(o,u,f),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new RT(function(i){t=i}),cancel:t}}};function L8(e){return function(n){return e.apply(null,n)}}function I8(e){return ae.isObject(e)&&e.isAxiosError===!0}const py={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(py).forEach(([e,t])=>{py[t]=e});function _T(e){const t=new Gi(e),n=nT(Gi.prototype.request,t);return ae.extend(n,Gi.prototype,t,{allOwnKeys:!0}),ae.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return _T(Ji(e,i))},n}const un=_T(Xu);un.Axios=Gi;un.CanceledError=Ml;un.CancelToken=k8;un.isCancel=vT;un.VERSION=CT;un.toFormData=xm;un.AxiosError=lt;un.Cancel=un.CanceledError;un.all=function(t){return Promise.all(t)};un.spread=L8;un.isAxiosError=I8;un.mergeConfig=Ji;un.AxiosHeaders=tr;un.formToJSON=e=>gT(ae.isHTMLForm(e)?new FormData(e):e);un.getAdapter=ET.getAdapter;un.HttpStatusCode=py;un.default=un;const{Axios:Vq,AxiosError:$q,CanceledError:Hq,isCancel:Bq,CancelToken:Gq,VERSION:qq,all:Zq,Cancel:Yq,isAxiosError:Kq,spread:Qq,toFormData:Xq,AxiosHeaders:Wq,HttpStatusCode:Jq,formToJSON:eZ,getAdapter:tZ,mergeConfig:nZ}=un;let P8={data:""},F8=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||P8,U8=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,z8=/\/\*[^]*?\*\/| +/g,yC=/\n+/g,Ws=(e,t)=>{let n="",a="",i="";for(let o in e){let u=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+u+";":a+=o[1]=="f"?Ws(u,o):o+"{"+Ws(u,o[1]=="k"?"":t)+"}":typeof u=="object"?a+=Ws(u,t?t.replace(/([^,])+/g,f=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,h=>/&/.test(h)?h.replace(/&/g,f):f?f+" "+h:h)):o):u!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Ws.p?Ws.p(o,u):o+":"+u+";")}return n+(t&&i?t+"{"+i+"}":i)+a},ns={},TT=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+TT(e[n]);return t}return e},V8=(e,t,n,a,i)=>{let o=TT(e),u=ns[o]||(ns[o]=(h=>{let m=0,v=11;for(;m<h.length;)v=101*v+h.charCodeAt(m++)>>>0;return"go"+v})(o));if(!ns[u]){let h=o!==e?e:(m=>{let v,b,y=[{}];for(;v=U8.exec(m.replace(z8,""));)v[4]?y.shift():v[3]?(b=v[3].replace(yC," ").trim(),y.unshift(y[0][b]=y[0][b]||{})):y[0][v[1]]=v[2].replace(yC," ").trim();return y[0]})(e);ns[u]=Ws(i?{["@keyframes "+u]:h}:h,n?"":"."+u)}let f=n&&ns.g?ns.g:null;return n&&(ns.g=ns[u]),((h,m,v,b)=>{b?m.data=m.data.replace(b,h):m.data.indexOf(h)===-1&&(m.data=v?h+m.data:m.data+h)})(ns[u],t,a,f),u},$8=(e,t,n)=>e.reduce((a,i,o)=>{let u=t[o];if(u&&u.call){let f=u(n),h=f&&f.props&&f.props.className||/^go/.test(f)&&f;u=h?"."+h:f&&typeof f=="object"?f.props?"":Ws(f,""):f===!1?"":f}return a+i+(u??"")},"");function wm(e){let t=this||{},n=e.call?e(t.p):e;return V8(n.unshift?n.raw?$8(n,[].slice.call(arguments,1),t.p):n.reduce((a,i)=>Object.assign(a,i&&i.call?i(t.p):i),{}):n,F8(t.target),t.g,t.o,t.k)}let NT,gy,vy;wm.bind({g:1});let ps=wm.bind({k:1});function H8(e,t,n,a){Ws.p=t,NT=e,gy=n,vy=a}function fi(e,t){let n=this||{};return function(){let a=arguments;function i(o,u){let f=Object.assign({},o),h=f.className||i.className;n.p=Object.assign({theme:gy&&gy()},f),n.o=/ *go\d+/.test(h),f.className=wm.apply(n,a)+(h?" "+h:"");let m=e;return e[0]&&(m=f.as||e,delete f.as),vy&&m[0]&&vy(f),NT(m,f)}return i}}var B8=e=>typeof e=="function",Oh=(e,t)=>B8(e)?e(t):e,G8=(()=>{let e=0;return()=>(++e).toString()})(),AT=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),q8=20,jT=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,q8)};case 1:return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return jT(e,{type:e.toasts.find(o=>o.id===n.id)?1:0,toast:n});case 3:let{toastId:a}=t;return{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,dismissed:!0,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Jf=[],Hi={toasts:[],pausedAt:void 0},mo=e=>{Hi=jT(Hi,e),Jf.forEach(t=>{t(Hi)})},Z8={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Y8=(e={})=>{let[t,n]=g.useState(Hi),a=g.useRef(Hi);g.useEffect(()=>(a.current!==Hi&&n(Hi),Jf.push(n),()=>{let o=Jf.indexOf(n);o>-1&&Jf.splice(o,1)}),[]);let i=t.toasts.map(o=>{var u,f,h;return{...e,...e[o.type],...o,removeDelay:o.removeDelay||((u=e[o.type])==null?void 0:u.removeDelay)||(e==null?void 0:e.removeDelay),duration:o.duration||((f=e[o.type])==null?void 0:f.duration)||(e==null?void 0:e.duration)||Z8[o.type],style:{...e.style,...(h=e[o.type])==null?void 0:h.style,...o.style}}});return{...t,toasts:i}},K8=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||G8()}),Wu=e=>(t,n)=>{let a=K8(t,e,n);return mo({type:2,toast:a}),a.id},Jt=(e,t)=>Wu("blank")(e,t);Jt.error=Wu("error");Jt.success=Wu("success");Jt.loading=Wu("loading");Jt.custom=Wu("custom");Jt.dismiss=e=>{mo({type:3,toastId:e})};Jt.remove=e=>mo({type:4,toastId:e});Jt.promise=(e,t,n)=>{let a=Jt.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let o=t.success?Oh(t.success,i):void 0;return o?Jt.success(o,{id:a,...n,...n==null?void 0:n.success}):Jt.dismiss(a),i}).catch(i=>{let o=t.error?Oh(t.error,i):void 0;o?Jt.error(o,{id:a,...n,...n==null?void 0:n.error}):Jt.dismiss(a)}),e};var Q8=(e,t)=>{mo({type:1,toast:{id:e,height:t}})},X8=()=>{mo({type:5,time:Date.now()})},du=new Map,W8=1e3,J8=(e,t=W8)=>{if(du.has(e))return;let n=setTimeout(()=>{du.delete(e),mo({type:4,toastId:e})},t);du.set(e,n)},e9=e=>{let{toasts:t,pausedAt:n}=Y8(e);g.useEffect(()=>{if(n)return;let o=Date.now(),u=t.map(f=>{if(f.duration===1/0)return;let h=(f.duration||0)+f.pauseDuration-(o-f.createdAt);if(h<0){f.visible&&Jt.dismiss(f.id);return}return setTimeout(()=>Jt.dismiss(f.id),h)});return()=>{u.forEach(f=>f&&clearTimeout(f))}},[t,n]);let a=g.useCallback(()=>{n&&mo({type:6,time:Date.now()})},[n]),i=g.useCallback((o,u)=>{let{reverseOrder:f=!1,gutter:h=8,defaultPosition:m}=u||{},v=t.filter(S=>(S.position||m)===(o.position||m)&&S.height),b=v.findIndex(S=>S.id===o.id),y=v.filter((S,w)=>w<b&&S.visible).length;return v.filter(S=>S.visible).slice(...f?[y+1]:[0,y]).reduce((S,w)=>S+(w.height||0)+h,0)},[t]);return g.useEffect(()=>{t.forEach(o=>{if(o.dismissed)J8(o.id,o.removeDelay);else{let u=du.get(o.id);u&&(clearTimeout(u),du.delete(o.id))}})},[t]),{toasts:t,handlers:{updateHeight:Q8,startPause:X8,endPause:a,calculateOffset:i}}},t9=ps`
|
|
385
|
+
from {
|
|
386
|
+
transform: scale(0) rotate(45deg);
|
|
387
|
+
opacity: 0;
|
|
388
|
+
}
|
|
389
|
+
to {
|
|
390
|
+
transform: scale(1) rotate(45deg);
|
|
391
|
+
opacity: 1;
|
|
392
|
+
}`,n9=ps`
|
|
393
|
+
from {
|
|
394
|
+
transform: scale(0);
|
|
395
|
+
opacity: 0;
|
|
396
|
+
}
|
|
397
|
+
to {
|
|
398
|
+
transform: scale(1);
|
|
399
|
+
opacity: 1;
|
|
400
|
+
}`,r9=ps`
|
|
401
|
+
from {
|
|
402
|
+
transform: scale(0) rotate(90deg);
|
|
403
|
+
opacity: 0;
|
|
404
|
+
}
|
|
405
|
+
to {
|
|
406
|
+
transform: scale(1) rotate(90deg);
|
|
407
|
+
opacity: 1;
|
|
408
|
+
}`,a9=fi("div")`
|
|
409
|
+
width: 20px;
|
|
410
|
+
opacity: 0;
|
|
411
|
+
height: 20px;
|
|
412
|
+
border-radius: 10px;
|
|
413
|
+
background: ${e=>e.primary||"#ff4b4b"};
|
|
414
|
+
position: relative;
|
|
415
|
+
transform: rotate(45deg);
|
|
416
|
+
|
|
417
|
+
animation: ${t9} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
418
|
+
forwards;
|
|
419
|
+
animation-delay: 100ms;
|
|
420
|
+
|
|
421
|
+
&:after,
|
|
422
|
+
&:before {
|
|
423
|
+
content: '';
|
|
424
|
+
animation: ${n9} 0.15s ease-out forwards;
|
|
425
|
+
animation-delay: 150ms;
|
|
426
|
+
position: absolute;
|
|
427
|
+
border-radius: 3px;
|
|
428
|
+
opacity: 0;
|
|
429
|
+
background: ${e=>e.secondary||"#fff"};
|
|
430
|
+
bottom: 9px;
|
|
431
|
+
left: 4px;
|
|
432
|
+
height: 2px;
|
|
433
|
+
width: 12px;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
&:before {
|
|
437
|
+
animation: ${r9} 0.15s ease-out forwards;
|
|
438
|
+
animation-delay: 180ms;
|
|
439
|
+
transform: rotate(90deg);
|
|
440
|
+
}
|
|
441
|
+
`,s9=ps`
|
|
442
|
+
from {
|
|
443
|
+
transform: rotate(0deg);
|
|
444
|
+
}
|
|
445
|
+
to {
|
|
446
|
+
transform: rotate(360deg);
|
|
447
|
+
}
|
|
448
|
+
`,i9=fi("div")`
|
|
449
|
+
width: 12px;
|
|
450
|
+
height: 12px;
|
|
451
|
+
box-sizing: border-box;
|
|
452
|
+
border: 2px solid;
|
|
453
|
+
border-radius: 100%;
|
|
454
|
+
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
455
|
+
border-right-color: ${e=>e.primary||"#616161"};
|
|
456
|
+
animation: ${s9} 1s linear infinite;
|
|
457
|
+
`,o9=ps`
|
|
458
|
+
from {
|
|
459
|
+
transform: scale(0) rotate(45deg);
|
|
460
|
+
opacity: 0;
|
|
461
|
+
}
|
|
462
|
+
to {
|
|
463
|
+
transform: scale(1) rotate(45deg);
|
|
464
|
+
opacity: 1;
|
|
465
|
+
}`,l9=ps`
|
|
466
|
+
0% {
|
|
467
|
+
height: 0;
|
|
468
|
+
width: 0;
|
|
469
|
+
opacity: 0;
|
|
470
|
+
}
|
|
471
|
+
40% {
|
|
472
|
+
height: 0;
|
|
473
|
+
width: 6px;
|
|
474
|
+
opacity: 1;
|
|
475
|
+
}
|
|
476
|
+
100% {
|
|
477
|
+
opacity: 1;
|
|
478
|
+
height: 10px;
|
|
479
|
+
}`,c9=fi("div")`
|
|
480
|
+
width: 20px;
|
|
481
|
+
opacity: 0;
|
|
482
|
+
height: 20px;
|
|
483
|
+
border-radius: 10px;
|
|
484
|
+
background: ${e=>e.primary||"#61d345"};
|
|
485
|
+
position: relative;
|
|
486
|
+
transform: rotate(45deg);
|
|
487
|
+
|
|
488
|
+
animation: ${o9} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
489
|
+
forwards;
|
|
490
|
+
animation-delay: 100ms;
|
|
491
|
+
&:after {
|
|
492
|
+
content: '';
|
|
493
|
+
box-sizing: border-box;
|
|
494
|
+
animation: ${l9} 0.2s ease-out forwards;
|
|
495
|
+
opacity: 0;
|
|
496
|
+
animation-delay: 200ms;
|
|
497
|
+
position: absolute;
|
|
498
|
+
border-right: 2px solid;
|
|
499
|
+
border-bottom: 2px solid;
|
|
500
|
+
border-color: ${e=>e.secondary||"#fff"};
|
|
501
|
+
bottom: 6px;
|
|
502
|
+
left: 6px;
|
|
503
|
+
height: 10px;
|
|
504
|
+
width: 6px;
|
|
505
|
+
}
|
|
506
|
+
`,u9=fi("div")`
|
|
507
|
+
position: absolute;
|
|
508
|
+
`,d9=fi("div")`
|
|
509
|
+
position: relative;
|
|
510
|
+
display: flex;
|
|
511
|
+
justify-content: center;
|
|
512
|
+
align-items: center;
|
|
513
|
+
min-width: 20px;
|
|
514
|
+
min-height: 20px;
|
|
515
|
+
`,f9=ps`
|
|
516
|
+
from {
|
|
517
|
+
transform: scale(0.6);
|
|
518
|
+
opacity: 0.4;
|
|
519
|
+
}
|
|
520
|
+
to {
|
|
521
|
+
transform: scale(1);
|
|
522
|
+
opacity: 1;
|
|
523
|
+
}`,h9=fi("div")`
|
|
524
|
+
position: relative;
|
|
525
|
+
transform: scale(0.6);
|
|
526
|
+
opacity: 0.4;
|
|
527
|
+
min-width: 20px;
|
|
528
|
+
animation: ${f9} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
529
|
+
forwards;
|
|
530
|
+
`,m9=({toast:e})=>{let{icon:t,type:n,iconTheme:a}=e;return t!==void 0?typeof t=="string"?g.createElement(h9,null,t):t:n==="blank"?null:g.createElement(d9,null,g.createElement(i9,{...a}),n!=="loading"&&g.createElement(u9,null,n==="error"?g.createElement(a9,{...a}):g.createElement(c9,{...a})))},p9=e=>`
|
|
531
|
+
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
532
|
+
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
533
|
+
`,g9=e=>`
|
|
534
|
+
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
535
|
+
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
536
|
+
`,v9="0%{opacity:0;} 100%{opacity:1;}",y9="0%{opacity:1;} 100%{opacity:0;}",x9=fi("div")`
|
|
537
|
+
display: flex;
|
|
538
|
+
align-items: center;
|
|
539
|
+
background: #fff;
|
|
540
|
+
color: #363636;
|
|
541
|
+
line-height: 1.3;
|
|
542
|
+
will-change: transform;
|
|
543
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
544
|
+
max-width: 350px;
|
|
545
|
+
pointer-events: auto;
|
|
546
|
+
padding: 8px 10px;
|
|
547
|
+
border-radius: 8px;
|
|
548
|
+
`,b9=fi("div")`
|
|
549
|
+
display: flex;
|
|
550
|
+
justify-content: center;
|
|
551
|
+
margin: 4px 10px;
|
|
552
|
+
color: inherit;
|
|
553
|
+
flex: 1 1 auto;
|
|
554
|
+
white-space: pre-line;
|
|
555
|
+
`,S9=(e,t)=>{let n=e.includes("top")?1:-1,[a,i]=AT()?[v9,y9]:[p9(n),g9(n)];return{animation:t?`${ps(a)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ps(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},w9=g.memo(({toast:e,position:t,style:n,children:a})=>{let i=e.height?S9(e.position||t||"top-center",e.visible):{opacity:0},o=g.createElement(m9,{toast:e}),u=g.createElement(b9,{...e.ariaProps},Oh(e.message,e));return g.createElement(x9,{className:e.className,style:{...i,...n,...e.style}},typeof a=="function"?a({icon:o,message:u}):g.createElement(g.Fragment,null,o,u))});H8(g.createElement);var E9=({id:e,className:t,style:n,onHeightUpdate:a,children:i})=>{let o=g.useCallback(u=>{if(u){let f=()=>{let h=u.getBoundingClientRect().height;a(e,h)};f(),new MutationObserver(f).observe(u,{subtree:!0,childList:!0,characterData:!0})}},[e,a]);return g.createElement("div",{ref:o,className:t,style:n},i)},C9=(e,t)=>{let n=e.includes("top"),a=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:AT()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...a,...i}},R9=wm`
|
|
556
|
+
z-index: 9999;
|
|
557
|
+
> * {
|
|
558
|
+
pointer-events: auto;
|
|
559
|
+
}
|
|
560
|
+
`,Lf=16,ti=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:a,children:i,containerStyle:o,containerClassName:u})=>{let{toasts:f,handlers:h}=e9(n);return g.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:Lf,left:Lf,right:Lf,bottom:Lf,pointerEvents:"none",...o},className:u,onMouseEnter:h.startPause,onMouseLeave:h.endPause},f.map(m=>{let v=m.position||t,b=h.calculateOffset(m,{reverseOrder:e,gutter:a,defaultPosition:t}),y=C9(v,b);return g.createElement(E9,{id:m.id,key:m.id,onHeightUpdate:h.updateHeight,className:m.visible?R9:"",style:y},m.type==="custom"?Oh(m.message,m):i?i(m):g.createElement(w9,{toast:m,position:v}))}))},Mh=Jt;const _9={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},Sa=un.create(_9);Sa.interceptors.response.use(e=>e,e=>{if(e.response&&e.response.status===400){const t=e.response.data;Mh.error(t.message)}return Promise.reject(e)});class kl{constructor(t){Fc(this,"baseUrl");this.baseUrl=t}async get(t,n,a){const i=this.createUrl(t);return(await Sa.get(i,{...a,params:n})).data}async post(t,n,a){const i=this.createUrl(t);return(await Sa.post(i,n,a)).data}async put(t,n,a){const i=this.createUrl(t);return(await Sa.put(i,n,a)).data}async patch(t,n,a){const i=this.createUrl(t);return(await Sa.patch(i,n,a)).data}async delete(t,n){const a=this.createUrl(t);return(await Sa.delete(a,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class T9{set(t,n){try{const a=typeof n=="object"?JSON.stringify(n):String(n);localStorage.setItem(t,a)}catch(a){console.error(`Error setting localStorage key "${t}":`,a)}}get(t,n){try{const a=localStorage.getItem(t);if(a===null)return null;switch(n){case"boolean":return a==="true";case"json":{const i=JSON.parse(a);return typeof i=="object"?i:null}default:return a}}catch(a){return console.error(`Error getting localStorage key "${t}":`,a),null}}remove(t){try{localStorage.removeItem(t)}catch(n){console.error(`Error removing localStorage key "${t}":`,n)}}has(t){try{return localStorage.getItem(t)!==null}catch(n){return console.error(`Error checking localStorage key "${t}":`,n),!1}}clear(){try{localStorage.clear()}catch(t){console.error("Error clearing localStorage:",t)}}}const kh=new T9;class N9{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(a=>{const i=this.getTimezoneOffset(a,n),o=this.formatOffset(i),u=this.isDaylightSavingTime(a,n),f=this.getDisplayName(a,o);return{identifier:a,displayName:f,offsetMinutes:i,offsetString:o,isDST:u}})}getTimezoneOffset(t,n=new Date){try{const a=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),i=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),o=new Date(a.format(n)),u=new Date(i.format(n));return Math.round((u.getTime()-o.getTime())/(1e3*60))}catch(a){return console.warn(`Failed to get offset for timezone ${t}:`,a),0}}formatOffset(t){const n=t>=0?"+":"-",a=Math.abs(t),i=Math.floor(a/60),o=a%60;return`${n}${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`}isDaylightSavingTime(t,n=new Date){try{const a=new Date(n.getFullYear(),0,1),i=new Date(n.getFullYear(),6,1),o=this.getTimezoneOffset(t,a),u=this.getTimezoneOffset(t,i),f=this.getTimezoneOffset(t,n),h=Math.min(o,u);return f>h}catch(a){return console.warn(`Failed to check DST for timezone ${t}:`,a),!1}}getDisplayName(t,n){return`${t} (${n})`}getBrowserTimezone(){const t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date,a=this.getTimezoneOffset(t,n),i=this.formatOffset(a),o=this.isDaylightSavingTime(t,n),u=this.getDisplayName(t,i);return{identifier:t,displayName:u,offsetMinutes:a,offsetString:i,isDST:o}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const A9=new N9;function j9({isLoading:e,className:t}){const[n,a]=g.useState(0),[i,o]=g.useState(!1);return g.useEffect(()=>{let u,f;return e?(o(!0),a(0),u=setInterval(()=>{a(h=>h<90?h+(90-h)/10:h)},200)):(a(100),f=setTimeout(()=>{o(!1)},300)),()=>{clearInterval(u),clearTimeout(f)}},[e]),c.jsx("div",{className:ye("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!i&&"opacity-0",t),children:c.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const DT=g.createContext({isLoading:!1});function D9({children:e}){const[t,n]=g.useState(0),a=t>0;return g.useEffect(()=>{const i=Sa.interceptors.request.use(u=>(n(f=>f+1),u),u=>(n(f=>Math.max(0,f-1)),Promise.reject(u))),o=Sa.interceptors.response.use(u=>(n(f=>Math.max(0,f-1)),u),u=>(n(f=>Math.max(0,f-1)),Promise.reject(u)));return()=>{Sa.interceptors.request.eject(i),Sa.interceptors.response.eject(o)}},[]),c.jsx(DT.Provider,{value:{isLoading:a},children:e})}function O9(){return g.useContext(DT)}function OT(){return c.jsx(ti,{position:"top-center",toastOptions:{duration:3e3,style:{background:"#363636",color:"#fff"},success:{style:{color:"#16a34a",background:"#fff"}},error:{style:{color:"#dc2626",background:"#fff"},duration:4e3}}})}const xC="sidebar_state";function M9(){const{state:e,isMobile:t}=qu(),a=t||e==="collapsed",{isLoading:i}=O9();return c.jsxs(c.Fragment,{children:[c.jsx(OT,{}),c.jsx(j9,{isLoading:i}),c.jsx(s6,{variant:"inset",collapsible:"icon"}),c.jsx(_P,{children:c.jsxs("div",{className:"relative h-full w-full",children:[a&&c.jsx("div",{className:"absolute top-7 left-4 z-10 md:hidden",children:c.jsx(CP,{})}),c.jsx(wR,{})]})})]})}function k9(){const[e,t]=g.useState(()=>kh.get(xC,"boolean")??!0),n=a=>{t(a),kh.set(xC,a)};return c.jsx(i6,{children:c.jsx(D9,{children:c.jsx(wP,{open:e,onOpenChange:n,children:c.jsx(M9,{})})})})}function L9(){return c.jsxs("div",{className:"app-container",children:[c.jsx("h1",{children:"About OWOX"}),c.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function I9(){return c.jsxs("div",{className:"app-container",children:[c.jsx("h1",{children:"404 - Page Not Found"}),c.jsx("p",{children:"The page you are looking for does not exist."}),c.jsx(io,{to:"/",children:"Go back to home"})]})}const P9={items:[],loading:!1,error:null};function F9(e,t){switch(t.type){case"SET_ITEMS":return{...e,items:t.payload,loading:!1,error:null};case"SET_LOADING":return{...e,loading:!0,error:null};case"SET_ERROR":return{...e,loading:!1,error:t.payload};default:return e}}const MT=g.createContext(void 0);function U9({children:e}){const[t,n]=g.useReducer(F9,P9);return c.jsx(MT.Provider,{value:{state:t,dispatch:n},children:e})}function z9(){const e=g.useContext(MT);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class V9 extends kl{constructor(){super("/data-marts")}async getDataMarts(){return this.get("/")}async getDataMartById(t){return this.get(`/${t}`)}async createDataMart(t){return this.post("",t)}async updateDataMart(t,n){return this.patch(`/${t}`,n)}async deleteDataMart(t){return this.delete(`/${t}`)}async updateDataMartDescription(t,n){return this.put(`/${t}/description`,{description:n})}async updateDataMartTitle(t,n){return this.put(`/${t}/title`,{title:n})}async updateDataMartDefinition(t,n){return this.put(`/${t}/definition`,n)}async publishDataMart(t){return this.put(`/${t}/publish`)}async runDataMart(t){return this.post(`/${t}/manual-run`)}}const ra=new V9;var Nn=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(Nn||{}),Xe=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(Xe||{}),eh=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION_TYPE="MISSING_DEFINITION_TYPE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(eh||{});const $9={ALREADY_PUBLISHED:"Data mart is already published",INVALID_STORAGE:"Data mart must have a valid storage",MISSING_DEFINITION_TYPE:"Data mart must have an input source configured",MISSING_DEFINITION:"Data mart must have a valid definition"},kT={statuses:{[Nn.DRAFT]:{code:Nn.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[Nn.PUBLISHED]:{code:Nn.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},LT=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,IT=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,H9=e=>e?LT(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",B9=e=>e?IT(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",PT=e=>{if(!e)return!1;const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/,n=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/;return t.test(e)||n.test(e)},FT=e=>{if(!e)return!1;const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/,n=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/;return t.test(e)||n.test(e)},G9=e=>e?PT(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",q9=e=>e?FT(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required";function Z9(e){return"serviceAccount"in e}function Y9(e){return"accessKeyId"in e&&"secretAccessKey"in e}const K9=[{value:"US",label:"US (multiple regions)",group:"North America"},{value:"northamerica-northeast1",label:"Montréal",group:"North America"},{value:"northamerica-northeast2",label:"Toronto",group:"North America"},{value:"us-central1",label:"Iowa",group:"North America"},{value:"us-east1",label:"South Carolina",group:"North America"},{value:"us-east4",label:"Northern Virginia",group:"North America"},{value:"us-east5",label:"Columbus",group:"North America"},{value:"us-west1",label:"Oregon",group:"North America"},{value:"us-west2",label:"Los Angeles",group:"North America"},{value:"us-west3",label:"Salt Lake City",group:"North America"},{value:"us-west4",label:"Las Vegas",group:"North America"},{value:"EU",label:"EU (multiple regions)",group:"Europe"},{value:"europe-central2",label:"Warsaw",group:"Europe"},{value:"europe-north1",label:"Finland",group:"Europe"},{value:"europe-southwest1",label:"Madrid",group:"Europe"},{value:"europe-west1",label:"Belgium",group:"Europe"},{value:"europe-west2",label:"London",group:"Europe"},{value:"europe-west3",label:"Frankfurt",group:"Europe"},{value:"europe-west4",label:"Netherlands",group:"Europe"},{value:"europe-west6",label:"Zurich",group:"Europe"},{value:"europe-west8",label:"Milan",group:"Europe"},{value:"europe-west9",label:"Paris",group:"Europe"},{value:"europe-west12",label:"Turin",group:"Europe"},{value:"asia-east1",label:"Taiwan",group:"Asia Pacific"},{value:"asia-east2",label:"Hong Kong",group:"Asia Pacific"},{value:"asia-northeast1",label:"Tokyo",group:"Asia Pacific"},{value:"asia-northeast2",label:"Osaka",group:"Asia Pacific"},{value:"asia-northeast3",label:"Seoul",group:"Asia Pacific"},{value:"asia-south1",label:"Mumbai",group:"Asia Pacific"},{value:"asia-south2",label:"Delhi",group:"Asia Pacific"},{value:"asia-southeast1",label:"Singapore",group:"Asia Pacific"},{value:"asia-southeast2",label:"Jakarta",group:"Asia Pacific"},{value:"australia-southeast1",label:"Sydney",group:"Asia Pacific"},{value:"australia-southeast2",label:"Melbourne",group:"Asia Pacific"},{value:"southamerica-east1",label:"São Paulo",group:"Other"},{value:"southamerica-west1",label:"Santiago",group:"Other"},{value:"me-central1",label:"Doha",group:"Other"},{value:"me-central2",label:"Dammam",group:"Other"},{value:"me-west1",label:"Tel Aviv",group:"Other"},{value:"africa-south1",label:"Johannesburg",group:"Other"}];function Q9(e){return"projectId"in e}function X9(e){return"databaseName"in e&&"outputBucket"in e}var st=(e=>(e.GOOGLE_BIGQUERY="GOOGLE_BIGQUERY",e.AWS_ATHENA="AWS_ATHENA",e))(st||{});const yy=({label:e,value:t,truncate:n=!1})=>{const a=typeof t=="string"?t.trim():t,i=a==="";return c.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[c.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&a&&!i?c.jsx("span",{className:"truncate text-sm",title:a,children:a.length>30?a.substring(0,30)+"...":a}):c.jsx("span",{className:"text-sm",children:i||a===void 0?c.jsx("span",{className:"text-muted-foreground",children:"—"}):a})]})},W9=({type:e,config:t})=>{const n={[st.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[st.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Database Name",key:"databaseName"},{label:"Output Bucket",key:"outputBucket"}]},a=t&&(e===st.GOOGLE_BIGQUERY&&Q9(t)||e===st.AWS_ATHENA&&X9(t));return c.jsx("div",{className:"grid gap-2",children:n[e].map(({label:i,key:o})=>{let u;return a&&(u=(e===st.GOOGLE_BIGQUERY,t[o])),c.jsx(yy,{label:i,value:u},o)})})},UT=["private_key","private_key_id","client_email","client_id","client_x509_cert_url"],J9=({type:e,credentials:t})=>{switch(e){case st.GOOGLE_BIGQUERY:{const a=t&&Z9(t)?String(t.serviceAccount):void 0;return c.jsx("div",{className:"grid gap-2",children:c.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Service Account:"}),a?c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx("span",{className:"cursor-help truncate text-sm",children:a.length>30?a.substring(0,30)+"...":a})}),c.jsx(ln,{className:"max-w-md",children:c.jsx(mm,{displayOnly:!0,value:a,keysToMask:UT})})]}):c.jsx("span",{className:"text-sm",children:c.jsx("span",{className:"text-muted-foreground",children:"—"})})]})})}case st.AWS_ATHENA:{const n=t&&Y9(t);return c.jsxs("div",{className:"grid gap-2",children:[c.jsx(yy,{label:"Access Key ID",value:n?String(t.accessKeyId):void 0}),c.jsx(yy,{label:"Secret Access Key",value:n&&t.secretAccessKey?"••••••••••••••••":void 0})]})}default:return c.jsx("p",{className:"text-gray-500 italic",children:"Unknown credential type"})}},eU=({type:e,config:t,credentials:n})=>c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),c.jsx(W9,{type:e,config:t})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("h4",{className:"text-sm font-medium",children:"Credentials"}),c.jsx(J9,{type:e,credentials:n})]})]}),tU=Pu("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function yr({className:e,variant:t,asChild:n=!1,...a}){const i=n?Zh:"span";return c.jsx(i,{"data-slot":"badge",className:ye(tU({variant:t}),e),...a})}const hi={types:{[st.GOOGLE_BIGQUERY]:{type:st.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:SF},[st.AWS_ATHENA]:{type:st.AWS_ATHENA,displayName:"AWS Athena",icon:wF}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function nU({dataStorage:e,isLoading:t=!1}){if(t)return c.jsx("div",{className:"space-y-4",children:c.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((f,h)=>c.jsxs("div",{className:"space-y-1",children:[c.jsx(gr,{className:"h-5 w-24"}),c.jsx(gr,{className:"h-6 w-40"})]},h))})});if(!e)return c.jsx("div",{children:"No storage information available."});const{type:n,config:a,credentials:i,createdAt:o,modifiedAt:u}=e;return c.jsx("div",{className:"space-y-2",children:c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{children:e.title}),c.jsx(yr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:f,icon:h}=hi.getInfo(n);return c.jsxs(c.Fragment,{children:[c.jsx(h,{}),f]})})()})]}),c.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:c.jsx(eU,{type:n,config:a,credentials:i})}),c.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Created:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(o))]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Modified:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(u))]})]})]})})}const rU=$t({accessKeyId:Bt().min(1,"Access Key ID is required"),secretAccessKey:Bt().min(1,"Secret Access Key is required")}),aU=$t({projectId:Bt().min(1,"Project ID is required"),location:Bt().min(1,"Location is required")}),sU=$t({region:Bt().min(1,"Region is required"),outputBucket:Bt().min(1,"Output Bucket is required"),databaseName:Bt().min(1,"Database Name is required")}),zT=$t({title:Bt().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),iU=zT.extend({type:ys(st.GOOGLE_BIGQUERY),credentials:tT,config:aU}),oU=zT.extend({type:ys(st.AWS_ATHENA),credentials:rU,config:sU}),lU=eT("type",[iU,oU]),cU=(e,t)=>{if(!e)return!1;switch(t){case st.GOOGLE_BIGQUERY:return LT(e);case st.AWS_ATHENA:return PT(e);default:return!1}},uU=(e,t)=>{if(!e)return!1;switch(t){case st.GOOGLE_BIGQUERY:return IT(e);case st.AWS_ATHENA:return FT(e);default:return!1}},dU=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case st.GOOGLE_BIGQUERY:return H9(e);case st.AWS_ATHENA:return G9(e);default:return"Unsupported storage type"}},fU=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case st.GOOGLE_BIGQUERY:return B9(e);case st.AWS_ATHENA:return q9(e);default:return"Unsupported storage type"}},VT=e=>{switch(e){case st.GOOGLE_BIGQUERY:return"project.dataset.table";case st.AWS_ATHENA:return"database.table or catalog.database.table";default:return""}},hU=e=>{switch(e){case st.GOOGLE_BIGQUERY:return"project.dataset.table_*";case st.AWS_ATHENA:return"database.table_* or catalog.database.table_*";default:return""}},$T=e=>{switch(e){case st.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case st.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";default:return""}},mU=e=>{switch(e){case st.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case st.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';default:return""}};var Ur=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(Ur||{});const pU={solid:"px-2.5 py-0.5 rounded-full",subtle:"px-2.5 py-0.5 rounded-full",outline:"px-2.5 py-0.5 rounded-full border",ghost:""},gU=e=>pU[e],vU={[Ur.SUCCESS]:{icon:v4,colors:{solid:"bg-green-500 text-white",subtle:"bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-400",outline:"border-green-500 text-green-700 dark:text-green-400",ghost:"text-green-500 dark:text-green-400"}},[Ur.ERROR]:{icon:p4,colors:{solid:"bg-red-500 text-white",subtle:"bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-400",outline:"border-red-500 text-red-700 dark:text-red-400",ghost:"text-red-500 dark:text-red-400"}},[Ur.WARNING]:{icon:N3,colors:{solid:"bg-yellow-500 text-white",subtle:"bg-yellow-50 text-yellow-700 dark:bg-yellow-950 dark:text-yellow-400",outline:"border-yellow-500 text-yellow-700 dark:text-yellow-400",ghost:"text-yellow-500 dark:text-yellow-400"}},[Ur.INFO]:{icon:qi,colors:{solid:"bg-blue-500 text-white",subtle:"bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-400",outline:"border-blue-500 text-blue-700 dark:text-blue-400",ghost:"text-blue-500 dark:text-blue-400"}},[Ur.NEUTRAL]:{icon:qi,colors:{solid:"bg-gray-500 text-white",subtle:"bg-gray-50 text-gray-700 dark:bg-gray-950 dark:text-gray-400",outline:"border-gray-500 text-gray-700 dark:text-gray-400",ghost:"text-muted-foreground"}}};function HT({type:e=Ur.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:a,className:i}){const{icon:o,colors:u}=vU[e],f=h=>{const m="inline-flex items-center gap-1 text-sm",v=gU(h),b=u[h];return ye(m,v,b,i)};return c.jsxs("span",{className:f(t),children:[n&&c.jsx(o,{className:"h-4 w-4","data-testid":"icon"}),a]})}const yU=e=>{switch(e){case Nn.DRAFT:return Ur.NEUTRAL;case Nn.PUBLISHED:return Ur.SUCCESS;default:return Ur.NEUTRAL}},BT=e=>$t({fullyQualifiedName:Bt().min(1,"Fully qualified name is required").refine(t=>cU(t,e),t=>({message:dU(t,e)}))}),xU=e=>$t({pattern:Bt().min(1,"Table pattern is required").refine(t=>uU(t,e),t=>({message:fU(t,e)}))}),bU=e=>{const t=[];return e.status.code===Nn.PUBLISHED&&t.push(eh.ALREADY_PUBLISHED),e.definitionType||t.push(eh.MISSING_DEFINITION_TYPE),e.definition||t.push(eh.MISSING_DEFINITION),t},SU=e=>e.map(t=>$9[t]);function wU(e){return e.map(t=>({id:t.id,title:t.title,status:kT.getInfo(t.status),storageType:t.storage.type,storageTitle:t.storage.title||void 0,definitionType:t.definitionType,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}))}function GT(){const{state:e,dispatch:t}=z9(),n=g.useCallback(async()=>{t({type:"SET_LOADING"});try{const o=await ra.getDataMarts(),u=wU(o);t({type:"SET_ITEMS",payload:u})}catch(o){t({type:"SET_ERROR",payload:o instanceof Error?o.message:"Failed to load data marts"})}},[t]),a=g.useCallback(async o=>{t({type:"SET_LOADING"});try{await ra.deleteDataMart(o)}catch(u){throw t({type:"SET_ERROR",payload:u instanceof Error?u.message:"Failed to delete data mart"}),u}},[t]),i=g.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:i,deleteDataMart:a}}/**
|
|
561
|
+
* table-core
|
|
562
|
+
*
|
|
563
|
+
* Copyright (c) TanStack
|
|
564
|
+
*
|
|
565
|
+
* This source code is licensed under the MIT license found in the
|
|
566
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
567
|
+
*
|
|
568
|
+
* @license MIT
|
|
569
|
+
*/function ei(e,t){return typeof e=="function"?e(t):e}function Er(e,t){return n=>{t.setState(a=>({...a,[e]:ei(n,a[e])}))}}function Em(e){return e instanceof Function}function EU(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function CU(e,t){const n=[],a=i=>{i.forEach(o=>{n.push(o);const u=t(o);u!=null&&u.length&&a(u)})};return a(e),n}function Ke(e,t,n){let a=[],i;return o=>{let u;n.key&&n.debug&&(u=Date.now());const f=e(o);if(!(f.length!==a.length||f.some((v,b)=>a[b]!==v)))return i;a=f;let m;if(n.key&&n.debug&&(m=Date.now()),i=t(...f),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const v=Math.round((Date.now()-u)*100)/100,b=Math.round((Date.now()-m)*100)/100,y=b/16,S=(w,E)=>{for(w=String(w);w.length<E;)w=" "+w;return w};console.info(`%c⏱ ${S(b,5)} /${S(v,5)} ms`,`
|
|
570
|
+
font-size: .6rem;
|
|
571
|
+
font-weight: bold;
|
|
572
|
+
color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Qe(e,t,n,a){return{debug:()=>{var i;return(i=e==null?void 0:e.debugAll)!=null?i:e[t]},key:!1,onChange:a}}function RU(e,t,n,a){const i=()=>{var u;return(u=o.getValue())!=null?u:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(a),renderValue:i,getContext:Ke(()=>[e,n,t,o],(u,f,h,m)=>({table:u,column:f,row:h,cell:m,getValue:m.getValue,renderValue:m.renderValue}),Qe(e.options,"debugCells"))};return e._features.forEach(u=>{u.createCell==null||u.createCell(o,n,t,e)},{}),o}function _U(e,t,n,a){var i,o;const f={...e._getDefaultColumnDef(),...t},h=f.accessorKey;let m=(i=(o=f.id)!=null?o:h?typeof String.prototype.replaceAll=="function"?h.replaceAll(".","_"):h.replace(/\./g,"_"):void 0)!=null?i:typeof f.header=="string"?f.header:void 0,v;if(f.accessorFn?v=f.accessorFn:h&&(h.includes(".")?v=y=>{let S=y;for(const E of h.split(".")){var w;S=(w=S)==null?void 0:w[E]}return S}:v=y=>y[f.accessorKey]),!m)throw new Error;let b={id:`${String(m)}`,accessorFn:v,parent:a,depth:n,columnDef:f,columns:[],getFlatColumns:Ke(()=>[!0],()=>{var y;return[b,...(y=b.columns)==null?void 0:y.flatMap(S=>S.getFlatColumns())]},Qe(e.options,"debugColumns")),getLeafColumns:Ke(()=>[e._getOrderColumnsFn()],y=>{var S;if((S=b.columns)!=null&&S.length){let w=b.columns.flatMap(E=>E.getLeafColumns());return y(w)}return[b]},Qe(e.options,"debugColumns"))};for(const y of e._features)y.createColumn==null||y.createColumn(b,e);return b}const kn="debugHeaders";function bC(e,t,n){var a;let o={id:(a=n.id)!=null?a:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const u=[],f=h=>{h.subHeaders&&h.subHeaders.length&&h.subHeaders.map(f),u.push(h)};return f(o),u},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(u=>{u.createHeader==null||u.createHeader(o,e)}),o}const TU={createTable:e=>{e.getHeaderGroups=Ke(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,a,i)=>{var o,u;const f=(o=a==null?void 0:a.map(b=>n.find(y=>y.id===b)).filter(Boolean))!=null?o:[],h=(u=i==null?void 0:i.map(b=>n.find(y=>y.id===b)).filter(Boolean))!=null?u:[],m=n.filter(b=>!(a!=null&&a.includes(b.id))&&!(i!=null&&i.includes(b.id)));return If(t,[...f,...m,...h],e)},Qe(e.options,kn)),e.getCenterHeaderGroups=Ke(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,a,i)=>(n=n.filter(o=>!(a!=null&&a.includes(o.id))&&!(i!=null&&i.includes(o.id))),If(t,n,e,"center")),Qe(e.options,kn)),e.getLeftHeaderGroups=Ke(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,a)=>{var i;const o=(i=a==null?void 0:a.map(u=>n.find(f=>f.id===u)).filter(Boolean))!=null?i:[];return If(t,o,e,"left")},Qe(e.options,kn)),e.getRightHeaderGroups=Ke(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,a)=>{var i;const o=(i=a==null?void 0:a.map(u=>n.find(f=>f.id===u)).filter(Boolean))!=null?i:[];return If(t,o,e,"right")},Qe(e.options,kn)),e.getFooterGroups=Ke(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Qe(e.options,kn)),e.getLeftFooterGroups=Ke(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Qe(e.options,kn)),e.getCenterFooterGroups=Ke(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Qe(e.options,kn)),e.getRightFooterGroups=Ke(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Qe(e.options,kn)),e.getFlatHeaders=Ke(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,kn)),e.getLeftFlatHeaders=Ke(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,kn)),e.getCenterFlatHeaders=Ke(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,kn)),e.getRightFlatHeaders=Ke(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,kn)),e.getCenterLeafHeaders=Ke(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var a;return!((a=n.subHeaders)!=null&&a.length)}),Qe(e.options,kn)),e.getLeftLeafHeaders=Ke(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var a;return!((a=n.subHeaders)!=null&&a.length)}),Qe(e.options,kn)),e.getRightLeafHeaders=Ke(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var a;return!((a=n.subHeaders)!=null&&a.length)}),Qe(e.options,kn)),e.getLeafHeaders=Ke(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,a)=>{var i,o,u,f,h,m;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(u=(f=n[0])==null?void 0:f.headers)!=null?u:[],...(h=(m=a[0])==null?void 0:m.headers)!=null?h:[]].map(v=>v.getLeafHeaders()).flat()},Qe(e.options,kn))}};function If(e,t,n,a){var i,o;let u=0;const f=function(y,S){S===void 0&&(S=1),u=Math.max(u,S),y.filter(w=>w.getIsVisible()).forEach(w=>{var E;(E=w.columns)!=null&&E.length&&f(w.columns,S+1)},0)};f(e);let h=[];const m=(y,S)=>{const w={depth:S,id:[a,`${S}`].filter(Boolean).join("_"),headers:[]},E=[];y.forEach(C=>{const R=[...E].reverse()[0],T=C.column.depth===w.depth;let N,O=!1;if(T&&C.column.parent?N=C.column.parent:(N=C.column,O=!0),R&&(R==null?void 0:R.column)===N)R.subHeaders.push(C);else{const A=bC(n,N,{id:[a,S,N.id,C==null?void 0:C.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${E.filter(D=>D.column===N).length}`:void 0,depth:S,index:E.length});A.subHeaders.push(C),E.push(A)}w.headers.push(C),C.headerGroup=w}),h.push(w),S>0&&m(E,S-1)},v=t.map((y,S)=>bC(n,y,{depth:u,index:S}));m(v,u-1),h.reverse();const b=y=>y.filter(w=>w.column.getIsVisible()).map(w=>{let E=0,C=0,R=[0];w.subHeaders&&w.subHeaders.length?(R=[],b(w.subHeaders).forEach(N=>{let{colSpan:O,rowSpan:A}=N;E+=O,R.push(A)})):E=1;const T=Math.min(...R);return C=C+T,w.colSpan=E,w.rowSpan=C,{colSpan:E,rowSpan:C}});return b((i=(o=h[0])==null?void 0:o.headers)!=null?i:[]),h}const Px=(e,t,n,a,i,o,u)=>{let f={id:t,index:a,original:n,depth:i,parentId:u,_valuesCache:{},_uniqueValuesCache:{},getValue:h=>{if(f._valuesCache.hasOwnProperty(h))return f._valuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return f._valuesCache[h]=m.accessorFn(f.original,a),f._valuesCache[h]},getUniqueValues:h=>{if(f._uniqueValuesCache.hasOwnProperty(h))return f._uniqueValuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(f._uniqueValuesCache[h]=m.columnDef.getUniqueValues(f.original,a),f._uniqueValuesCache[h]):(f._uniqueValuesCache[h]=[f.getValue(h)],f._uniqueValuesCache[h])},renderValue:h=>{var m;return(m=f.getValue(h))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>CU(f.subRows,h=>h.subRows),getParentRow:()=>f.parentId?e.getRow(f.parentId,!0):void 0,getParentRows:()=>{let h=[],m=f;for(;;){const v=m.getParentRow();if(!v)break;h.push(v),m=v}return h.reverse()},getAllCells:Ke(()=>[e.getAllLeafColumns()],h=>h.map(m=>RU(e,f,m,m.id)),Qe(e.options,"debugRows")),_getAllCellsByColumnId:Ke(()=>[f.getAllCells()],h=>h.reduce((m,v)=>(m[v.column.id]=v,m),{}),Qe(e.options,"debugRows"))};for(let h=0;h<e._features.length;h++){const m=e._features[h];m==null||m.createRow==null||m.createRow(f,e)}return f},NU={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},qT=(e,t,n)=>{var a,i;const o=n==null||(a=n.toString())==null?void 0:a.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};qT.autoRemove=e=>oa(e);const ZT=(e,t,n)=>{var a;return!!(!((a=e.getValue(t))==null||(a=a.toString())==null)&&a.includes(n))};ZT.autoRemove=e=>oa(e);const YT=(e,t,n)=>{var a;return((a=e.getValue(t))==null||(a=a.toString())==null?void 0:a.toLowerCase())===(n==null?void 0:n.toLowerCase())};YT.autoRemove=e=>oa(e);const KT=(e,t,n)=>{var a;return(a=e.getValue(t))==null?void 0:a.includes(n)};KT.autoRemove=e=>oa(e);const QT=(e,t,n)=>!n.some(a=>{var i;return!((i=e.getValue(t))!=null&&i.includes(a))});QT.autoRemove=e=>oa(e)||!(e!=null&&e.length);const XT=(e,t,n)=>n.some(a=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(a)});XT.autoRemove=e=>oa(e)||!(e!=null&&e.length);const WT=(e,t,n)=>e.getValue(t)===n;WT.autoRemove=e=>oa(e);const JT=(e,t,n)=>e.getValue(t)==n;JT.autoRemove=e=>oa(e);const Fx=(e,t,n)=>{let[a,i]=n;const o=e.getValue(t);return o>=a&&o<=i};Fx.resolveFilterValue=e=>{let[t,n]=e,a=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(a)?-1/0:a,u=n===null||Number.isNaN(i)?1/0:i;if(o>u){const f=o;o=u,u=f}return[o,u]};Fx.autoRemove=e=>oa(e)||oa(e[0])&&oa(e[1]);const ss={includesString:qT,includesStringSensitive:ZT,equalsString:YT,arrIncludes:KT,arrIncludesAll:QT,arrIncludesSome:XT,equals:WT,weakEquals:JT,inNumberRange:Fx};function oa(e){return e==null||e===""}const AU={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Er("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],a=n==null?void 0:n.getValue(e.id);return typeof a=="string"?ss.includesString:typeof a=="number"?ss.inNumberRange:typeof a=="boolean"||a!==null&&typeof a=="object"?ss.equals:Array.isArray(a)?ss.arrIncludes:ss.weakEquals},e.getFilterFn=()=>{var n,a;return Em(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(a=t.options.filterFns)==null?void 0:a[e.columnDef.filterFn])!=null?n:ss[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,a,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((a=t.options.enableColumnFilters)!=null?a:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(a=>a.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,a;return(n=(a=t.getState().columnFilters)==null?void 0:a.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(a=>{const i=e.getFilterFn(),o=a==null?void 0:a.find(v=>v.id===e.id),u=ei(n,o?o.value:void 0);if(SC(i,u,e)){var f;return(f=a==null?void 0:a.filter(v=>v.id!==e.id))!=null?f:[]}const h={id:e.id,value:u};if(o){var m;return(m=a==null?void 0:a.map(v=>v.id===e.id?h:v))!=null?m:[]}return a!=null&&a.length?[...a,h]:[h]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),a=i=>{var o;return(o=ei(t,i))==null?void 0:o.filter(u=>{const f=n.find(h=>h.id===u.id);if(f){const h=f.getFilterFn();if(SC(h,u.value,f))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(a)},e.resetColumnFilters=t=>{var n,a;e.setColumnFilters(t?[]:(n=(a=e.initialState)==null?void 0:a.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function SC(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const jU=(e,t,n)=>n.reduce((a,i)=>{const o=i.getValue(e);return a+(typeof o=="number"?o:0)},0),DU=(e,t,n)=>{let a;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(a>o||a===void 0&&o>=o)&&(a=o)}),a},OU=(e,t,n)=>{let a;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(a<o||a===void 0&&o>=o)&&(a=o)}),a},MU=(e,t,n)=>{let a,i;return n.forEach(o=>{const u=o.getValue(e);u!=null&&(a===void 0?u>=u&&(a=i=u):(a>u&&(a=u),i<u&&(i=u)))}),[a,i]},kU=(e,t)=>{let n=0,a=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,a+=o)}),n)return a/n},LU=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!EU(n))return;if(n.length===1)return n[0];const a=Math.floor(n.length/2),i=n.sort((o,u)=>o-u);return n.length%2!==0?i[a]:(i[a-1]+i[a])/2},IU=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),PU=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,FU=(e,t)=>t.length,Sv={sum:jU,min:DU,max:OU,extent:MU,mean:kU,median:LU,unique:IU,uniqueCount:PU,count:FU},UU={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Er("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(a=>a!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,a;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((a=t.options.enableGrouping)!=null?a:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],a=n==null?void 0:n.getValue(e.id);if(typeof a=="number")return Sv.sum;if(Object.prototype.toString.call(a)==="[object Date]")return Sv.extent},e.getAggregationFn=()=>{var n,a;if(!e)throw new Error;return Em(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(a=t.options.aggregationFns)==null?void 0:a[e.columnDef.aggregationFn])!=null?n:Sv[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,a;e.setGrouping(t?[]:(n=(a=e.initialState)==null?void 0:a.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const a=t.getColumn(n);return a!=null&&a.columnDef.getGroupingValue?(e._groupingValuesCache[n]=a.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,a)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function zU(e,t,n){if(!(t!=null&&t.length)||!n)return e;const a=e.filter(o=>!t.includes(o.id));return n==="remove"?a:[...t.map(o=>e.find(u=>u.id===o)).filter(Boolean),...a]}const VU={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Er("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ke(n=>[fu(t,n)],n=>n.findIndex(a=>a.id===e.id),Qe(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var a;return((a=fu(t,n)[0])==null?void 0:a.id)===e.id},e.getIsLastColumn=n=>{var a;const i=fu(t,n);return((a=i[i.length-1])==null?void 0:a.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ke(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,a)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const u=[...t],f=[...i];for(;f.length&&u.length;){const h=u.shift(),m=f.findIndex(v=>v.id===h);m>-1&&o.push(f.splice(m,1)[0])}o=[...o,...f]}return zU(o,n,a)},Qe(e.options,"debugTable"))}},wv=()=>({left:[],right:[]}),$U={getInitialState:e=>({columnPinning:wv(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Er("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const a=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,u;if(n==="right"){var f,h;return{left:((f=i==null?void 0:i.left)!=null?f:[]).filter(b=>!(a!=null&&a.includes(b))),right:[...((h=i==null?void 0:i.right)!=null?h:[]).filter(b=>!(a!=null&&a.includes(b))),...a]}}if(n==="left"){var m,v;return{left:[...((m=i==null?void 0:i.left)!=null?m:[]).filter(b=>!(a!=null&&a.includes(b))),...a],right:((v=i==null?void 0:i.right)!=null?v:[]).filter(b=>!(a!=null&&a.includes(b)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(b=>!(a!=null&&a.includes(b))),right:((u=i==null?void 0:i.right)!=null?u:[]).filter(b=>!(a!=null&&a.includes(b)))}})},e.getCanPin=()=>e.getLeafColumns().some(a=>{var i,o,u;return((i=a.columnDef.enablePinning)!=null?i:!0)&&((o=(u=t.options.enableColumnPinning)!=null?u:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(f=>f.id),{left:a,right:i}=t.getState().columnPinning,o=n.some(f=>a==null?void 0:a.includes(f)),u=n.some(f=>i==null?void 0:i.includes(f));return o?"left":u?"right":!1},e.getPinnedIndex=()=>{var n,a;const i=e.getIsPinned();return i?(n=(a=t.getState().columnPinning)==null||(a=a[i])==null?void 0:a.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ke(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,a,i)=>{const o=[...a??[],...i??[]];return n.filter(u=>!o.includes(u.column.id))},Qe(t.options,"debugRows")),e.getLeftVisibleCells=Ke(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,a)=>(a??[]).map(o=>n.find(u=>u.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Qe(t.options,"debugRows")),e.getRightVisibleCells=Ke(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,a)=>(a??[]).map(o=>n.find(u=>u.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Qe(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,a;return e.setColumnPinning(t?wv():(n=(a=e.initialState)==null?void 0:a.columnPinning)!=null?n:wv())},e.getIsSomeColumnsPinned=t=>{var n;const a=e.getState().columnPinning;if(!t){var i,o;return!!((i=a.left)!=null&&i.length||(o=a.right)!=null&&o.length)}return!!((n=a[t])!=null&&n.length)},e.getLeftLeafColumns=Ke(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(a=>t.find(i=>i.id===a)).filter(Boolean),Qe(e.options,"debugColumns")),e.getRightLeafColumns=Ke(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(a=>t.find(i=>i.id===a)).filter(Boolean),Qe(e.options,"debugColumns")),e.getCenterLeafColumns=Ke(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,a)=>{const i=[...n??[],...a??[]];return t.filter(o=>!i.includes(o.id))},Qe(e.options,"debugColumns"))}};function HU(e){return e||(typeof document<"u"?document:null)}const Pf={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ev=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),BU={getDefaultColumnDef:()=>Pf,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ev(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Er("columnSizing",e),onColumnSizingInfoChange:Er("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,a,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Pf.minSize,(a=o??e.columnDef.size)!=null?a:Pf.size),(i=e.columnDef.maxSize)!=null?i:Pf.maxSize)},e.getStart=Ke(n=>[n,fu(t,n),t.getState().columnSizing],(n,a)=>a.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Qe(t.options,"debugColumns")),e.getAfter=Ke(n=>[n,fu(t,n),t.getState().columnSizing],(n,a)=>a.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Qe(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:a,...i}=n;return i})},e.getCanResize=()=>{var n,a;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((a=t.options.enableColumnResizing)!=null?a:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const a=i=>{if(i.subHeaders.length)i.subHeaders.forEach(a);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return a(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const a=t.getColumn(e.column.id),i=a==null?void 0:a.getCanResize();return o=>{if(!a||!i||(o.persist==null||o.persist(),Cv(o)&&o.touches&&o.touches.length>1))return;const u=e.getSize(),f=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[a.id,a.getSize()]],h=Cv(o)?Math.round(o.touches[0].clientX):o.clientX,m={},v=(R,T)=>{typeof T=="number"&&(t.setColumnSizingInfo(N=>{var O,A;const D=t.options.columnResizeDirection==="rtl"?-1:1,L=(T-((O=N==null?void 0:N.startOffset)!=null?O:0))*D,H=Math.max(L/((A=N==null?void 0:N.startSize)!=null?A:0),-.999999);return N.columnSizingStart.forEach(X=>{let[re,me]=X;m[re]=Math.round(Math.max(me+me*H,0)*100)/100}),{...N,deltaOffset:L,deltaPercentage:H}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(N=>({...N,...m})))},b=R=>v("move",R),y=R=>{v("end",R),t.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},S=HU(n),w={moveHandler:R=>b(R.clientX),upHandler:R=>{S==null||S.removeEventListener("mousemove",w.moveHandler),S==null||S.removeEventListener("mouseup",w.upHandler),y(R.clientX)}},E={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),b(R.touches[0].clientX),!1),upHandler:R=>{var T;S==null||S.removeEventListener("touchmove",E.moveHandler),S==null||S.removeEventListener("touchend",E.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),y((T=R.touches[0])==null?void 0:T.clientX)}},C=GU()?{passive:!1}:!1;Cv(o)?(S==null||S.addEventListener("touchmove",E.moveHandler,C),S==null||S.addEventListener("touchend",E.upHandler,C)):(S==null||S.addEventListener("mousemove",w.moveHandler,C),S==null||S.addEventListener("mouseup",w.upHandler,C)),t.setColumnSizingInfo(R=>({...R,startOffset:h,startSize:u,deltaOffset:0,deltaPercentage:0,columnSizingStart:f,isResizingColumn:a.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Ev():(n=e.initialState.columnSizingInfo)!=null?n:Ev())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((a,i)=>a+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((a,i)=>a+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((a,i)=>a+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((a,i)=>a+i.getSize(),0))!=null?t:0}}};let Ff=null;function GU(){if(typeof Ff=="boolean")return Ff;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Ff=e,Ff}function Cv(e){return e.type==="touchstart"}const qU={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Er("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(a=>({...a,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,a;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(a=t.getState().columnVisibility)==null?void 0:a[e.id])!=null?n:!0},e.getCanHide=()=>{var n,a;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((a=t.options.enableHiding)!=null?a:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ke(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(a=>a.column.getIsVisible()),Qe(t.options,"debugRows")),e.getVisibleCells=Ke(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,a,i)=>[...n,...a,...i],Qe(t.options,"debugRows"))},createTable:e=>{const t=(n,a)=>Ke(()=>[a(),a().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Qe(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var a;e.setColumnVisibility(n?{}:(a=e.initialState.columnVisibility)!=null?a:{})},e.toggleAllColumnsVisible=n=>{var a;n=(a=n)!=null?a:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var a;e.toggleAllColumnsVisible((a=n.target)==null?void 0:a.checked)}}};function fu(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ZU={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},YU={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Er("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const a=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof a=="string"||typeof a=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,a,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((a=t.options.enableGlobalFilter)!=null?a:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ss.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:a}=e.options;return Em(a)?a:a==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[a])!=null?t:ss[a]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},KU={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Er("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var a,i;if(!t){e._queue(()=>{t=!0});return}if((a=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?a:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=a=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(a),e.toggleAllRowsExpanded=a=>{a??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=a=>{var i,o;e.setExpanded(a?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(a=>a.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>a=>{a.persist==null||a.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const a=e.getState().expanded;return a===!0||Object.values(a).some(Boolean)},e.getIsAllRowsExpanded=()=>{const a=e.getState().expanded;return typeof a=="boolean"?a===!0:!(!Object.keys(a).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let a=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const u=o.split(".");a=Math.max(a,u.length)}),a},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(a=>{var i;const o=a===!0?!0:!!(a!=null&&a[e.id]);let u={};if(a===!0?Object.keys(t.getRowModel().rowsById).forEach(f=>{u[f]=!0}):u=a,n=(i=n)!=null?i:!o,!o&&n)return{...u,[e.id]:!0};if(o&&!n){const{[e.id]:f,...h}=u;return h}return a})},e.getIsExpanded=()=>{var n;const a=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:a===!0||a!=null&&a[e.id])},e.getCanExpand=()=>{var n,a,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((a=t.options.enableExpanding)!=null?a:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,a=e;for(;n&&a.parentId;)a=t.getRow(a.parentId,!0),n=a.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},xy=0,by=10,Rv=()=>({pageIndex:xy,pageSize:by}),QU={getInitialState:e=>({...e,pagination:{...Rv(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Er("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var a,i;if(!t){e._queue(()=>{t=!0});return}if((a=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?a:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=a=>{const i=o=>ei(a,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=a=>{var i;e.setPagination(a?Rv():(i=e.initialState.pagination)!=null?i:Rv())},e.setPageIndex=a=>{e.setPagination(i=>{let o=ei(a,i.pageIndex);const u=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,u)),{...i,pageIndex:o}})},e.resetPageIndex=a=>{var i,o;e.setPageIndex(a?xy:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:xy)},e.resetPageSize=a=>{var i,o;e.setPageSize(a?by:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:by)},e.setPageSize=a=>{e.setPagination(i=>{const o=Math.max(1,ei(a,i.pageSize)),u=i.pageSize*i.pageIndex,f=Math.floor(u/o);return{...i,pageIndex:f,pageSize:o}})},e.setPageCount=a=>e.setPagination(i=>{var o;let u=ei(a,(o=e.options.pageCount)!=null?o:-1);return typeof u=="number"&&(u=Math.max(-1,u)),{...i,pageCount:u}}),e.getPageOptions=Ke(()=>[e.getPageCount()],a=>{let i=[];return a&&a>0&&(i=[...new Array(a)].fill(null).map((o,u)=>u)),i},Qe(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:a}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:a<i-1},e.previousPage=()=>e.setPageIndex(a=>a-1),e.nextPage=()=>e.setPageIndex(a=>a+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var a;return(a=e.options.pageCount)!=null?a:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var a;return(a=e.options.rowCount)!=null?a:e.getPrePaginationRowModel().rows.length}}},_v=()=>({top:[],bottom:[]}),XU={getInitialState:e=>({rowPinning:_v(),...e}),getDefaultOptions:e=>({onRowPinningChange:Er("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,a,i)=>{const o=a?e.getLeafRows().map(h=>{let{id:m}=h;return m}):[],u=i?e.getParentRows().map(h=>{let{id:m}=h;return m}):[],f=new Set([...u,e.id,...o]);t.setRowPinning(h=>{var m,v;if(n==="bottom"){var b,y;return{top:((b=h==null?void 0:h.top)!=null?b:[]).filter(E=>!(f!=null&&f.has(E))),bottom:[...((y=h==null?void 0:h.bottom)!=null?y:[]).filter(E=>!(f!=null&&f.has(E))),...Array.from(f)]}}if(n==="top"){var S,w;return{top:[...((S=h==null?void 0:h.top)!=null?S:[]).filter(E=>!(f!=null&&f.has(E))),...Array.from(f)],bottom:((w=h==null?void 0:h.bottom)!=null?w:[]).filter(E=>!(f!=null&&f.has(E)))}}return{top:((m=h==null?void 0:h.top)!=null?m:[]).filter(E=>!(f!=null&&f.has(E))),bottom:((v=h==null?void 0:h.bottom)!=null?v:[]).filter(E=>!(f!=null&&f.has(E)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:a,enablePinning:i}=t.options;return typeof a=="function"?a(e):(n=a??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:a,bottom:i}=t.getState().rowPinning,o=n.some(f=>a==null?void 0:a.includes(f)),u=n.some(f=>i==null?void 0:i.includes(f));return o?"top":u?"bottom":!1},e.getPinnedIndex=()=>{var n,a;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(u=>{let{id:f}=u;return f});return(a=o==null?void 0:o.indexOf(e.id))!=null?a:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,a;return e.setRowPinning(t?_v():(n=(a=e.initialState)==null?void 0:a.rowPinning)!=null?n:_v())},e.getIsSomeRowsPinned=t=>{var n;const a=e.getState().rowPinning;if(!t){var i,o;return!!((i=a.top)!=null&&i.length||(o=a.bottom)!=null&&o.length)}return!!((n=a[t])!=null&&n.length)},e._getPinnedRows=(t,n,a)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(u=>{const f=e.getRow(u,!0);return f.getIsAllParentsExpanded()?f:null}):(n??[]).map(u=>t.find(f=>f.id===u))).filter(Boolean).map(u=>({...u,position:a}))},e.getTopRows=Ke(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Qe(e.options,"debugRows")),e.getBottomRows=Ke(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Qe(e.options,"debugRows")),e.getCenterRows=Ke(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,a)=>{const i=new Set([...n??[],...a??[]]);return t.filter(o=>!i.has(o.id))},Qe(e.options,"debugRows"))}},WU={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Er("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const a={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(a[o.id]=!0)}):i.forEach(o=>{delete a[o.id]}),a})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const a=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{Sy(i,o.id,a,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ke(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Tv(e,n):{rows:[],flatRows:[],rowsById:{}},Qe(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ke(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Tv(e,n):{rows:[],flatRows:[],rowsById:{}},Qe(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ke(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Tv(e,n):{rows:[],flatRows:[],rowsById:{}},Qe(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let a=!!(t.length&&Object.keys(n).length);return a&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(a=!1),a},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let a=!!t.length;return a&&t.some(i=>!n[i.id])&&(a=!1),a},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,a)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var u;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const f={...o};return Sy(f,e.id,n,(u=a==null?void 0:a.selectChildren)!=null?u:!0,t),f})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Ux(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return wy(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return wy(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return a=>{var i;n&&e.toggleSelected((i=a.target)==null?void 0:i.checked)}}}},Sy=(e,t,n,a,i)=>{var o;const u=i.getRow(t,!0);n?(u.getCanMultiSelect()||Object.keys(e).forEach(f=>delete e[f]),u.getCanSelect()&&(e[t]=!0)):delete e[t],a&&(o=u.subRows)!=null&&o.length&&u.getCanSelectSubRows()&&u.subRows.forEach(f=>Sy(e,f.id,n,a,i))};function Tv(e,t){const n=e.getState().rowSelection,a=[],i={},o=function(u,f){return u.map(h=>{var m;const v=Ux(h,n);if(v&&(a.push(h),i[h.id]=h),(m=h.subRows)!=null&&m.length&&(h={...h,subRows:o(h.subRows)}),v)return h}).filter(Boolean)};return{rows:o(t.rows),flatRows:a,rowsById:i}}function Ux(e,t){var n;return(n=t[e.id])!=null?n:!1}function wy(e,t,n){var a;if(!((a=e.subRows)!=null&&a.length))return!1;let i=!0,o=!1;return e.subRows.forEach(u=>{if(!(o&&!i)&&(u.getCanSelect()&&(Ux(u,t)?o=!0:i=!1),u.subRows&&u.subRows.length)){const f=wy(u,t);f==="all"?o=!0:(f==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const Ey=/([0-9]+)/gm,JU=(e,t,n)=>eN(li(e.getValue(n)).toLowerCase(),li(t.getValue(n)).toLowerCase()),ez=(e,t,n)=>eN(li(e.getValue(n)),li(t.getValue(n))),tz=(e,t,n)=>zx(li(e.getValue(n)).toLowerCase(),li(t.getValue(n)).toLowerCase()),nz=(e,t,n)=>zx(li(e.getValue(n)),li(t.getValue(n))),rz=(e,t,n)=>{const a=e.getValue(n),i=t.getValue(n);return a>i?1:a<i?-1:0},az=(e,t,n)=>zx(e.getValue(n),t.getValue(n));function zx(e,t){return e===t?0:e>t?1:-1}function li(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function eN(e,t){const n=e.split(Ey).filter(Boolean),a=t.split(Ey).filter(Boolean);for(;n.length&&a.length;){const i=n.shift(),o=a.shift(),u=parseInt(i,10),f=parseInt(o,10),h=[u,f].sort();if(isNaN(h[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(h[1]))return isNaN(u)?-1:1;if(u>f)return 1;if(f>u)return-1}return n.length-a.length}const Zc={alphanumeric:JU,alphanumericCaseSensitive:ez,text:tz,textCaseSensitive:nz,datetime:rz,basic:az},sz={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Er("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let a=!1;for(const i of n){const o=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Zc.datetime;if(typeof o=="string"&&(a=!0,o.split(Ey).length>1))return Zc.alphanumeric}return a?Zc.text:Zc.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,a;if(!e)throw new Error;return Em(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(a=t.options.sortingFns)==null?void 0:a[e.columnDef.sortingFn])!=null?n:Zc[e.columnDef.sortingFn]},e.toggleSorting=(n,a)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(u=>{const f=u==null?void 0:u.find(S=>S.id===e.id),h=u==null?void 0:u.findIndex(S=>S.id===e.id);let m=[],v,b=o?n:i==="desc";if(u!=null&&u.length&&e.getCanMultiSort()&&a?f?v="toggle":v="add":u!=null&&u.length&&h!==u.length-1?v="replace":f?v="toggle":v="replace",v==="toggle"&&(o||i||(v="remove")),v==="add"){var y;m=[...u,{id:e.id,desc:b}],m.splice(0,m.length-((y=t.options.maxMultiSortColCount)!=null?y:Number.MAX_SAFE_INTEGER))}else v==="toggle"?m=u.map(S=>S.id===e.id?{...S,desc:b}:S):v==="remove"?m=u.filter(S=>S.id!==e.id):m=[{id:e.id,desc:b}];return m})},e.getFirstSortDir=()=>{var n,a;return((n=(a=e.columnDef.sortDescFirst)!=null?a:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var a,i;const o=e.getFirstSortDir(),u=e.getIsSorted();return u?u!==o&&((a=t.options.enableSortingRemoval)==null||a)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:u==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,a;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((a=t.options.enableSorting)!=null?a:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,a;return(n=(a=e.columnDef.enableMultiSort)!=null?a:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const a=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return a?a.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,a;return(n=(a=t.getState().sorting)==null?void 0:a.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(a=>a.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return a=>{n&&(a.persist==null||a.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(a):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,a;e.setSorting(t?[]:(n=(a=e.initialState)==null?void 0:a.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},iz=[TU,qU,VU,$U,NU,AU,ZU,YU,sz,UU,KU,QU,XU,WU,BU];function oz(e){var t,n;const a=[...iz,...(t=e._features)!=null?t:[]];let i={_features:a};const o=i._features.reduce((y,S)=>Object.assign(y,S.getDefaultOptions==null?void 0:S.getDefaultOptions(i)),{}),u=y=>i.options.mergeOptions?i.options.mergeOptions(o,y):{...o,...y};let h={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(y=>{var S;h=(S=y.getInitialState==null?void 0:y.getInitialState(h))!=null?S:h});const m=[];let v=!1;const b={_features:a,options:{...o,...e},initialState:h,_queue:y=>{m.push(y),v||(v=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();v=!1}).catch(S=>setTimeout(()=>{throw S})))},reset:()=>{i.setState(i.initialState)},setOptions:y=>{const S=ei(y,i.options);i.options=u(S)},getState:()=>i.options.state,setState:y=>{i.options.onStateChange==null||i.options.onStateChange(y)},_getRowId:(y,S,w)=>{var E;return(E=i.options.getRowId==null?void 0:i.options.getRowId(y,S,w))!=null?E:`${w?[w.id,S].join("."):S}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(y,S)=>{let w=(S?i.getPrePaginationRowModel():i.getRowModel()).rowsById[y];if(!w&&(w=i.getCoreRowModel().rowsById[y],!w))throw new Error;return w},_getDefaultColumnDef:Ke(()=>[i.options.defaultColumn],y=>{var S;return y=(S=y)!=null?S:{},{header:w=>{const E=w.header.column.columnDef;return E.accessorKey?E.accessorKey:E.accessorFn?E.id:null},cell:w=>{var E,C;return(E=(C=w.renderValue())==null||C.toString==null?void 0:C.toString())!=null?E:null},...i._features.reduce((w,E)=>Object.assign(w,E.getDefaultColumnDef==null?void 0:E.getDefaultColumnDef()),{}),...y}},Qe(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:Ke(()=>[i._getColumnDefs()],y=>{const S=function(w,E,C){return C===void 0&&(C=0),w.map(R=>{const T=_U(i,R,C,E),N=R;return T.columns=N.columns?S(N.columns,T,C+1):[],T})};return S(y)},Qe(e,"debugColumns")),getAllFlatColumns:Ke(()=>[i.getAllColumns()],y=>y.flatMap(S=>S.getFlatColumns()),Qe(e,"debugColumns")),_getAllFlatColumnsById:Ke(()=>[i.getAllFlatColumns()],y=>y.reduce((S,w)=>(S[w.id]=w,S),{}),Qe(e,"debugColumns")),getAllLeafColumns:Ke(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(y,S)=>{let w=y.flatMap(E=>E.getLeafColumns());return S(w)},Qe(e,"debugColumns")),getColumn:y=>i._getAllFlatColumnsById()[y]};Object.assign(i,b);for(let y=0;y<i._features.length;y++){const S=i._features[y];S==null||S.createTable==null||S.createTable(i)}return i}function Ju(){return e=>Ke(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},a=function(i,o,u){o===void 0&&(o=0);const f=[];for(let m=0;m<i.length;m++){const v=Px(e,e._getRowId(i[m],m,u),i[m],m,o,void 0,u==null?void 0:u.id);if(n.flatRows.push(v),n.rowsById[v.id]=v,f.push(v),e.options.getSubRows){var h;v.originalSubRows=e.options.getSubRows(i[m],m),(h=v.originalSubRows)!=null&&h.length&&(v.subRows=a(v.originalSubRows,o+1,v))}}return f};return n.rows=a(t),n},Qe(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function lz(e){const t=[],n=a=>{var i;t.push(a),(i=a.subRows)!=null&&i.length&&a.getIsExpanded()&&a.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function cz(e,t,n){return n.options.filterFromLeafRows?uz(e,t,n):dz(e,t,n)}function uz(e,t,n){var a;const i=[],o={},u=(a=n.options.maxLeafRowFilterDepth)!=null?a:100,f=function(h,m){m===void 0&&(m=0);const v=[];for(let y=0;y<h.length;y++){var b;let S=h[y];const w=Px(n,S.id,S.original,S.index,S.depth,void 0,S.parentId);if(w.columnFilters=S.columnFilters,(b=S.subRows)!=null&&b.length&&m<u){if(w.subRows=f(S.subRows,m+1),S=w,t(S)&&!w.subRows.length){v.push(S),o[S.id]=S,i.push(S);continue}if(t(S)||w.subRows.length){v.push(S),o[S.id]=S,i.push(S);continue}}else S=w,t(S)&&(v.push(S),o[S.id]=S,i.push(S))}return v};return{rows:f(e),flatRows:i,rowsById:o}}function dz(e,t,n){var a;const i=[],o={},u=(a=n.options.maxLeafRowFilterDepth)!=null?a:100,f=function(h,m){m===void 0&&(m=0);const v=[];for(let y=0;y<h.length;y++){let S=h[y];if(t(S)){var b;if((b=S.subRows)!=null&&b.length&&m<u){const E=Px(n,S.id,S.original,S.index,S.depth,void 0,S.parentId);E.subRows=f(S.subRows,m+1),S=E}v.push(S),i.push(S),o[S.id]=S}}return v};return{rows:f(e),flatRows:i,rowsById:o}}function ed(){return e=>Ke(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,a)=>{if(!t.rows.length||!(n!=null&&n.length)&&!a){for(let y=0;y<t.flatRows.length;y++)t.flatRows[y].columnFilters={},t.flatRows[y].columnFiltersMeta={};return t}const i=[],o=[];(n??[]).forEach(y=>{var S;const w=e.getColumn(y.id);if(!w)return;const E=w.getFilterFn();E&&i.push({id:y.id,filterFn:E,resolvedValue:(S=E.resolveFilterValue==null?void 0:E.resolveFilterValue(y.value))!=null?S:y.value})});const u=(n??[]).map(y=>y.id),f=e.getGlobalFilterFn(),h=e.getAllLeafColumns().filter(y=>y.getCanGlobalFilter());a&&f&&h.length&&(u.push("__global__"),h.forEach(y=>{var S;o.push({id:y.id,filterFn:f,resolvedValue:(S=f.resolveFilterValue==null?void 0:f.resolveFilterValue(a))!=null?S:a})}));let m,v;for(let y=0;y<t.flatRows.length;y++){const S=t.flatRows[y];if(S.columnFilters={},i.length)for(let w=0;w<i.length;w++){m=i[w];const E=m.id;S.columnFilters[E]=m.filterFn(S,E,m.resolvedValue,C=>{S.columnFiltersMeta[E]=C})}if(o.length){for(let w=0;w<o.length;w++){v=o[w];const E=v.id;if(v.filterFn(S,E,v.resolvedValue,C=>{S.columnFiltersMeta[E]=C})){S.columnFilters.__global__=!0;break}}S.columnFilters.__global__!==!0&&(S.columnFilters.__global__=!1)}}const b=y=>{for(let S=0;S<u.length;S++)if(y.columnFilters[u[S]]===!1)return!1;return!0};return cz(t.rows,b,e)},Qe(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function td(e){return t=>Ke(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,a)=>{if(!a.rows.length)return a;const{pageSize:i,pageIndex:o}=n;let{rows:u,flatRows:f,rowsById:h}=a;const m=i*o,v=m+i;u=u.slice(m,v);let b;t.options.paginateExpandedRows?b={rows:u,flatRows:f,rowsById:h}:b=lz({rows:u,flatRows:f,rowsById:h}),b.flatRows=[];const y=S=>{b.flatRows.push(S),S.subRows.length&&S.subRows.forEach(y)};return b.rows.forEach(y),b},Qe(t.options,"debugTable"))}function nd(){return e=>Ke(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const a=e.getState().sorting,i=[],o=a.filter(h=>{var m;return(m=e.getColumn(h.id))==null?void 0:m.getCanSort()}),u={};o.forEach(h=>{const m=e.getColumn(h.id);m&&(u[h.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const f=h=>{const m=h.map(v=>({...v}));return m.sort((v,b)=>{for(let S=0;S<o.length;S+=1){var y;const w=o[S],E=u[w.id],C=E.sortUndefined,R=(y=w==null?void 0:w.desc)!=null?y:!1;let T=0;if(C){const N=v.getValue(w.id),O=b.getValue(w.id),A=N===void 0,D=O===void 0;if(A||D){if(C==="first")return A?-1:1;if(C==="last")return A?1:-1;T=A&&D?0:A?C:-C}}if(T===0&&(T=E.sortingFn(v,b,w.id)),T!==0)return R&&(T*=-1),E.invertSorting&&(T*=-1),T}return v.index-b.index}),m.forEach(v=>{var b;i.push(v),(b=v.subRows)!=null&&b.length&&(v.subRows=f(v.subRows))}),m};return{rows:f(n.rows),flatRows:i,rowsById:n.rowsById}},Qe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
573
|
+
* react-table
|
|
574
|
+
*
|
|
575
|
+
* Copyright (c) TanStack
|
|
576
|
+
*
|
|
577
|
+
* This source code is licensed under the MIT license found in the
|
|
578
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
579
|
+
*
|
|
580
|
+
* @license MIT
|
|
581
|
+
*/function xl(e,t){return e?fz(e)?g.createElement(e,t):e:null}function fz(e){return hz(e)||typeof e=="function"||mz(e)}function hz(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function mz(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function rd(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=g.useState(()=>({current:oz(t)})),[a,i]=g.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...a,...e.state},onStateChange:u=>{i(u),e.onStateChange==null||e.onStateChange(u)}})),n.current}function ad({className:e,...t}){return c.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:c.jsx("table",{"data-slot":"table",className:ye("w-full caption-bottom text-sm",e),...t})})}function sd({className:e,...t}){return c.jsx("thead",{"data-slot":"table-header",className:ye("[&_tr]:border-b",e),...t})}function id({className:e,...t}){return c.jsx("tbody",{"data-slot":"table-body",className:ye("[&_tr:last-child]:border-0",e),...t})}function Hn({className:e,...t}){return c.jsx("tr",{"data-slot":"table-row",className:ye("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function od({className:e,...t}){return c.jsx("th",{"data-slot":"table-head",className:ye("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Oa({className:e,...t}){return c.jsx("td",{"data-slot":"table-cell",className:ye("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var tN="AlertDialog",[pz,rZ]=Br(tN,[f1]),xs=f1(),nN=e=>{const{__scopeAlertDialog:t,...n}=e,a=xs(t);return c.jsx(Jh,{...a,...n,modal:!0})};nN.displayName=tN;var gz="AlertDialogTrigger",vz=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=xs(n);return c.jsx(PL,{...i,...a,ref:t})});vz.displayName=gz;var yz="AlertDialogPortal",rN=e=>{const{__scopeAlertDialog:t,...n}=e,a=xs(t);return c.jsx(em,{...a,...n})};rN.displayName=yz;var xz="AlertDialogOverlay",aN=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=xs(n);return c.jsx(tm,{...i,...a,ref:t})});aN.displayName=xz;var pl="AlertDialogContent",[bz,Sz]=pz(pl),wz=AR("AlertDialogContent"),sN=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...i}=e,o=xs(n),u=g.useRef(null),f=xt(t,u),h=g.useRef(null);return c.jsx(ML,{contentName:pl,titleName:iN,docsSlug:"alert-dialog",children:c.jsx(bz,{scope:n,cancelRef:h,children:c.jsxs(nm,{role:"alertdialog",...o,...i,ref:f,onOpenAutoFocus:Re(i.onOpenAutoFocus,m=>{var v;m.preventDefault(),(v=h.current)==null||v.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[c.jsx(wz,{children:a}),c.jsx(Cz,{contentRef:u})]})})})});sN.displayName=pl;var iN="AlertDialogTitle",oN=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=xs(n);return c.jsx(ox,{...i,...a,ref:t})});oN.displayName=iN;var lN="AlertDialogDescription",cN=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=xs(n);return c.jsx(lx,{...i,...a,ref:t})});cN.displayName=lN;var Ez="AlertDialogAction",uN=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=xs(n);return c.jsx(rm,{...i,...a,ref:t})});uN.displayName=Ez;var dN="AlertDialogCancel",fN=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:i}=Sz(dN,n),o=xs(n),u=xt(t,i);return c.jsx(rm,{...o,...a,ref:u})});fN.displayName=dN;var Cz=({contentRef:e})=>{const t=`\`${pl}\` requires a description for the component to be accessible for screen reader users.
|
|
582
|
+
|
|
583
|
+
You can add a description to the \`${pl}\` by passing a \`${lN}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
584
|
+
|
|
585
|
+
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 \`${pl}\`. 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.
|
|
586
|
+
|
|
587
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{var a;document.getElementById((a=e.current)==null?void 0:a.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Rz=nN,_z=rN,Tz=aN,Nz=sN,Az=uN,jz=fN,Dz=oN,Oz=cN;function Mz({...e}){return c.jsx(Rz,{"data-slot":"alert-dialog",...e})}function kz({...e}){return c.jsx(_z,{"data-slot":"alert-dialog-portal",...e})}function Lz({className:e,...t}){return c.jsx(Tz,{"data-slot":"alert-dialog-overlay",className:ye("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Iz({className:e,...t}){return c.jsxs(kz,{children:[c.jsx(Lz,{}),c.jsx(Nz,{"data-slot":"alert-dialog-content",className:ye("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function Pz({className:e,...t}){return c.jsx("div",{"data-slot":"alert-dialog-header",className:ye("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Fz({className:e,...t}){return c.jsx("div",{"data-slot":"alert-dialog-footer",className:ye("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Uz({className:e,...t}){return c.jsx(Dz,{"data-slot":"alert-dialog-title",className:ye("text-lg font-semibold",e),...t})}function zz({className:e,...t}){return c.jsx(Oz,{"data-slot":"alert-dialog-description",className:ye("text-muted-foreground text-sm",e),...t})}function Vz({className:e,...t}){return c.jsx(Az,{className:ye(rx(),e),...t})}function $z({className:e,...t}){return c.jsx(jz,{className:ye(rx({variant:"outline"}),e),...t})}function Hz(){return c.jsxs("div",{className:"dm-empty-state",children:[c.jsx(a3,{className:"dm-empty-state-ico",strokeWidth:1}),c.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Data Mart"}),c.jsx("p",{className:"dm-empty-state-subtitle",children:"Data Marts help you organize and analyze your data effectively."}),c.jsx(io,{to:"/data-marts/create",children:c.jsxs(Ue,{variant:"outline",children:[c.jsx(Pa,{className:"h-4 w-4"}),"New Data Mart"]})})]})}function hN(){return c.jsx(gr,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}function Bz({columns:e,data:t,deleteDataMart:n,refetchDataMarts:a,isLoading:i}){var A;const o=ku(),[u,f]=g.useState([{id:"title",desc:!1}]),[h,m]=g.useState([]),[v,b]=g.useState({}),[y,S]=g.useState({}),[w,E]=g.useState(!1),[C,R]=g.useState(!1),T=async()=>{try{R(!0);const L=O.getSelectedRowModel().rows.map(H=>H.original.id);for(const H of L)await n(H);Jt.success(`Successfully deleted ${String(L.length)} data mart${L.length!==1?"s":""}`),S({}),await a()}catch(D){console.error("Error deleting data marts:",D),Jt.error("Failed to delete some data marts. Please try again.")}finally{R(!1),E(!1)}},N=Object.keys(y).length>0,O=rd({data:t,columns:[{id:"select",size:40,header:({table:D})=>c.jsx("button",{type:"button",role:"checkbox","aria-checked":D.getIsAllRowsSelected(),"data-state":D.getIsAllRowsSelected()?"checked":"unchecked","aria-label":"Select all rows",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:D.getToggleAllRowsSelectedHandler(),children:D.getIsAllRowsSelected()&&c.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:c.jsx(Ta,{className:"size-3.5"})})}),cell:({row:D})=>c.jsx("button",{type:"button",role:"checkbox","aria-checked":D.getIsSelected(),"data-state":D.getIsSelected()?"checked":"unchecked","aria-label":"Select row",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:D.getToggleSelectedHandler(),children:D.getIsSelected()&&c.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:c.jsx(Ta,{className:"size-3.5"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Ju(),getPaginationRowModel:td(),onSortingChange:f,getSortedRowModel:nd(),onColumnFiltersChange:m,getFilteredRowModel:ed(),onColumnVisibilityChange:b,onRowSelectionChange:S,state:{sorting:u,columnFilters:h,columnVisibility:v,rowSelection:y},enableRowSelection:!0});return i?c.jsxs("div",{children:[c.jsx(ti,{}),c.jsx(hN,{})]}):t.length?c.jsxs("div",{className:"dm-card",children:[c.jsx(ti,{}),c.jsxs("div",{className:"dm-card-toolbar",children:[c.jsxs("div",{className:"dm-card-toolbar-left",children:[N&&c.jsx(Ue,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{E(!0)},disabled:C,children:c.jsx(tx,{className:"h-4 w-4"})}),c.jsxs("div",{className:"dm-card-toolbar-search",children:[c.jsx(oo,{className:"dm-card-toolbar-search-icon"}),c.jsx(Ut,{placeholder:"Search by title",value:(A=O.getColumn("title"))==null?void 0:A.getFilterValue(),onChange:D=>{var L;return(L=O.getColumn("title"))==null?void 0:L.setFilterValue(D.target.value)},className:"dm-card-toolbar-search-input"})]})]}),c.jsx("div",{className:"dm-card-toolbar-right",children:c.jsx(io,{to:"/data-marts/create",children:c.jsxs(Ue,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[c.jsx(Pa,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),c.jsx("div",{className:"dm-card-table-wrap",children:c.jsxs(ad,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[c.jsx(sd,{className:"dm-card-table-header",children:O.getHeaderGroups().map(D=>c.jsx(Hn,{className:"dm-card-table-header-row",children:D.headers.map(L=>c.jsx(od,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:L.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:L.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(L.getSize())}%`},children:L.isPlaceholder?null:xl(L.column.columnDef.header,L.getContext())},L.id))},D.id))}),c.jsx(id,{className:"dm-card-table-body",children:O.getRowModel().rows.length?O.getRowModel().rows.map(D=>c.jsx(Hn,{"data-state":D.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:L=>{if(L.target instanceof HTMLElement&&(L.target.closest('[role="checkbox"]')||L.target.closest(".actions-cell")||L.target.closest('[role="menuitem"]')||L.target.closest('[data-state="open"]')))return;const H=D.original.id;o(`/data-marts/${H}/data-setup`)},children:D.getVisibleCells().map(L=>c.jsx(Oa,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${L.column.id==="actions"?"actions-cell":""} ${L.column.id==="createdAt"?"whitespace-nowrap":""}`,style:L.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:L.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(L.column.getSize())}%`},children:xl(L.column.columnDef.cell,L.getContext())},L.id))},D.id)):c.jsx(Hn,{children:c.jsx(Oa,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),c.jsxs("div",{className:"dm-card-pagination",children:[c.jsx(Ue,{variant:"outline",size:"sm",onClick:()=>{O.previousPage()},disabled:!O.getCanPreviousPage(),children:"Previous"}),c.jsx(Ue,{variant:"outline",size:"sm",onClick:()=>{O.nextPage()},disabled:!O.getCanNextPage(),children:"Next"})]}),c.jsx(Mz,{open:w,onOpenChange:E,children:c.jsxs(Iz,{children:[c.jsxs(Pz,{children:[c.jsx(Uz,{children:"Are you sure?"}),c.jsxs(zz,{children:["You're about to delete ",Object.keys(y).length," selected data mart",Object.keys(y).length!==1?"s":"",". This action cannot be undone."]})]}),c.jsxs(Fz,{children:[c.jsx($z,{disabled:C,children:"Cancel"}),c.jsx(Vz,{onClick:()=>{T()},disabled:C,className:"bg-destructive hover:bg-destructive/90",children:C?"Deleting...":"Delete"})]})]})})]}):c.jsxs("div",{className:"dm-card",children:[c.jsx(ti,{}),c.jsx(Hz,{})]})}function Yc({column:e,children:t}){return c.jsxs(Ue,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,c.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&c.jsx(Na,{className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&c.jsx(gs,{className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&c.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:c.jsx(Na,{className:"text-muted-foreground h-4 w-4"})})]})]})}function Cm({...e}){return c.jsx(Jh,{"data-slot":"dialog",...e})}function Gz({...e}){return c.jsx(em,{"data-slot":"dialog-portal",...e})}function qz({className:e,...t}){return c.jsx(tm,{"data-slot":"dialog-overlay",className:ye("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Rm({className:e,children:t,showCloseButton:n=!0,...a}){return c.jsxs(Gz,{"data-slot":"dialog-portal",children:[c.jsx(qz,{}),c.jsxs(nm,{"data-slot":"dialog-content",className:ye("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...a,children:[t,n&&c.jsxs(rm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[c.jsx(uh,{}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _m({className:e,...t}){return c.jsx("div",{"data-slot":"dialog-header",className:ye("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Zz({className:e,...t}){return c.jsx("div",{"data-slot":"dialog-footer",className:ye("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Ll({className:e,...t}){return c.jsx(ox,{"data-slot":"dialog-title",className:ye("text-lg leading-none font-semibold",e),...t})}function Il({className:e,...t}){return c.jsx(lx,{"data-slot":"dialog-description",className:ye("text-muted-foreground text-sm",e),...t})}const Yz=Pu("",{variants:{variant:{brand:"bg-primary text-white shadow-xs hover:bg-primary-hover focus-visible:ring-brand-blue-200 dark:focus-visible:ring-brand-blue-400"}}});function Cy({className:e,variant:t,...n}){return t==="brand"?c.jsx(Ue,{variant:"default",className:ye(Yz({variant:t}),e),...n}):c.jsx(Ue,{variant:t,className:e,...n})}const po=({open:e,onOpenChange:t,title:n,description:a,confirmLabel:i="Confirm",cancelLabel:o,onConfirm:u,onCancel:f,variant:h="destructive",children:m})=>{const v=()=>{t(!1),f==null||f()};return c.jsx(Cm,{open:e,onOpenChange:t,children:c.jsxs(Rm,{children:[c.jsxs(_m,{children:[c.jsx(Ll,{children:n}),c.jsx(Il,{children:a})]}),m,c.jsxs(Zz,{children:[o&&c.jsx(Cy,{variant:"secondary",onClick:v,children:o}),c.jsx(Cy,{variant:h,onClick:u,children:i})]})]})})},Kz=({row:e,onDeleteSuccess:t})=>{const[n,a]=g.useState(!1),[i,o]=g.useState(!1),{deleteDataMart:u,refreshList:f}=GT(),h=async()=>{try{await u(e.original.id),a(!1),await f(),t==null||t()}catch(m){console.error("Failed to delete data mart:",m)}};return c.jsxs("div",{className:"text-right",children:[c.jsxs(Gr,{open:i,onOpenChange:o,children:[c.jsx(qr,{asChild:!0,children:c.jsx(Ue,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:c.jsx(vs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),c.jsxs(Cr,{align:"end",children:[c.jsx(Zt,{children:c.jsx(io,{to:`/data-marts/${e.original.id}/data-setup`,className:"dm-card-table-body-row-actiondropdownitem",children:"Open"})}),c.jsx(ho,{}),c.jsx(Zt,{className:"dm-card-table-body-row-actiondropdownitem text-red-600",onClick:()=>{a(!0)},children:"Delete"})]})]}),c.jsx(po,{open:n,onOpenChange:a,title:"Delete Data Mart",description:"Are you sure you want to delete this data mart? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>void h(),variant:"destructive"})]})};var Ln=(e=>(e.TITLE="title",e.DEFINITION_TYPE="definitionType",e.STORAGE_TYPE="storageType",e.STATUS="status",e.CREATED_AT="createdAt",e))(Ln||{});const ol={[Ln.TITLE]:"Title",[Ln.DEFINITION_TYPE]:"Source",[Ln.STORAGE_TYPE]:"Storage",[Ln.STATUS]:"Status",[Ln.CREATED_AT]:"Created at"};function Qz({table:e}){return c.jsx("div",{className:"px-3 text-right",children:c.jsxs(Gr,{children:[c.jsx(qr,{asChild:!0,children:c.jsx(Ue,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:c.jsx(vs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),c.jsx(Cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=ol[t.id]||t.id;return c.jsx(Zt,{className:"capitalize",children:c.jsxs("label",{className:"flex items-center space-x-2",children:[c.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&c.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:c.jsx(Ta,{className:"size-3.5"})})}),c.jsx("span",{children:n})]})},t.id)})})]})})}const Xz={types:{[Xe.SQL]:{type:Xe.SQL,displayName:"SQL",icon:PR},[Xe.TABLE]:{type:Xe.TABLE,displayName:"Table",icon:C3},[Xe.VIEW]:{type:Xe.VIEW,displayName:"View",icon:Y4},[Xe.TABLE_PATTERN]:{type:Xe.TABLE_PATTERN,displayName:"Pattern",icon:h4},[Xe.CONNECTOR]:{type:Xe.CONNECTOR,displayName:"Connector",icon:zR}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}},Wz=({onDeleteSuccess:e}={})=>[{accessorKey:Ln.TITLE,size:40,header:({column:t})=>c.jsx(Yc,{column:t,children:ol[Ln.TITLE]}),cell:({row:t})=>c.jsx("div",{children:t.getValue("title")})},{accessorKey:Ln.DEFINITION_TYPE,size:15,header:({column:t})=>c.jsx(Yc,{column:t,children:ol[Ln.DEFINITION_TYPE]}),cell:({row:t})=>{const n=t.getValue("definitionType"),{displayName:a,icon:i}=Xz.getInfo(n);return c.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[c.jsx(i,{className:"h-4 w-4"}),a]})}},{accessorKey:Ln.STORAGE_TYPE,size:15,header:({column:t})=>c.jsx(Yc,{column:t,children:ol[Ln.STORAGE_TYPE]}),cell:({row:t})=>{const n=t.getValue("storageType"),a=t.original.storageTitle,{displayName:i,icon:o}=hi.getInfo(n),u=a??i;return c.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[c.jsx(o,{size:18}),u]})}},{accessorKey:Ln.CREATED_AT,size:15,header:({column:t})=>c.jsx(Yc,{column:t,children:ol[Ln.CREATED_AT]}),cell:({row:t})=>{const n=t.getValue("createdAt"),a=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(n);return c.jsx("div",{className:"text-muted-foreground",children:a})}},{accessorKey:Ln.STATUS,size:15,header:({column:t})=>c.jsx(Yc,{column:t,children:ol[Ln.STATUS]}),cell:({row:t})=>{const n=t.getValue("status");return c.jsx(HT,{type:yU(n.code),variant:"ghost",showIcon:!1,children:n.displayName})}},{id:"actions",size:80,header:({table:t})=>c.jsx(Qz,{table:t}),cell:({row:t})=>c.jsx(Kz,{row:t,onDeleteSuccess:e})}],Jz=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:a,loading:i}=GT();return g.useEffect(()=>{t()},[t]),c.jsx(Bz,{columns:Wz(),data:e,deleteDataMart:n,refetchDataMarts:a,isLoading:i})};function e7(){return c.jsxs("div",{className:"dm-page",children:[c.jsx("header",{className:"dm-page-header",children:c.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),c.jsx("div",{className:"dm-page-content",children:c.jsx(U9,{children:c.jsx(Jz,{})})})]})}const mN=g.createContext(void 0),Kc=e=>{const t=bU(e);return{...e,canPublish:t.length===0,validationErrors:t}},pN={dataMart:null,isLoading:!1,error:null};function t7(e,t){switch(t.type){case"FETCH_DATA_MART_START":case"CREATE_DATA_MART_START":case"UPDATE_DATA_MART_START":case"UPDATE_DATA_MART_TITLE_START":case"UPDATE_DATA_MART_DESCRIPTION_START":case"UPDATE_DATA_MART_DEFINITION_START":case"DELETE_DATA_MART_START":case"PUBLISH_DATA_MART_START":case"RUN_DATA_MART_START":return{...e,isLoading:!0,error:null};case"CREATE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_SUCCESS":case"UPDATE_DATA_MART_SUCCESS":case"PUBLISH_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:Kc(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Kc({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Kc({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Kc({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Kc({...e.dataMart,definitionType:t.payload.definitionType,definition:t.payload.definition,modifiedAt:new Date})}:e;case"DELETE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:null};case"RUN_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_ERROR":case"CREATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_TITLE_ERROR":case"UPDATE_DATA_MART_DESCRIPTION_ERROR":case"UPDATE_DATA_MART_DEFINITION_ERROR":case"DELETE_DATA_MART_ERROR":case"PUBLISH_DATA_MART_ERROR":case"RUN_DATA_MART_ERROR":return{...e,isLoading:!1,error:t.payload};case"RESET":return pN;default:return e}}function ld(){const e=g.useContext(mN);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class n7{mapFromDto(t){const n=t.config,a=t.credentials;let i="";return a&&Object.keys(a).length>0&&(i=JSON.stringify(a,null,2)),{id:t.id,title:t.title,type:st.GOOGLE_BIGQUERY,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{serviceAccount:i},config:{projectId:(n==null?void 0:n.projectId)??"",location:(n==null?void 0:n.location)??""}}}mapToUpdateRequest(t){return{credentials:{...JSON.parse(t.credentials.serviceAccount)},config:{projectId:t.config.projectId,location:t.config.location}}}}class r7{mapFromDto(t){const n=t.config,a=t.credentials;return{id:t.id,title:t.title,type:st.AWS_ATHENA,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{accessKeyId:(a==null?void 0:a.accessKeyId)??"",secretAccessKey:(a==null?void 0:a.secretAccessKey)??""},config:{databaseName:(n==null?void 0:n.databaseName)??"",region:(n==null?void 0:n.region)??"",outputBucket:(n==null?void 0:n.outputBucket)??""}}}mapToUpdateRequest(t){return{credentials:{accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey},config:{databaseName:t.config.databaseName,region:t.config.region,outputBucket:t.config.outputBucket}}}}const gN={getMapper(e){switch(e){case st.GOOGLE_BIGQUERY:return new n7;case st.AWS_ATHENA:return new r7;default:throw new Error(`Unknown storage type: ${String(e)}`)}}};function th(e){return gN.getMapper(e.type).mapFromDto(e)}function a7(e){const t=gN.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function s7(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function i7(e){return{type:e}}function o7(e){return{sqlQuery:e.sqlQuery}}function l7(e){return{sqlQuery:e.sqlQuery}}function c7(e){return{fullyQualifiedName:e.fullyQualifiedName}}function u7(e){return{fullyQualifiedName:e.fullyQualifiedName}}function d7(e){return{fullyQualifiedName:e.fullyQualifiedName}}function f7(e){return{fullyQualifiedName:e.fullyQualifiedName}}function h7(e){return{pattern:e.pattern}}function m7(e){return{pattern:e.pattern}}function p7(e){return{connector:{source:{name:e.connector.source.name,configuration:e.connector.source.configuration,node:e.connector.source.node,fields:e.connector.source.fields},storage:{fullyQualifiedName:e.connector.storage.fullyQualifiedName}}}}function g7(e){const t=e.connector;return{connector:{source:{name:t.source.name,configuration:t.source.configuration,node:t.source.node,fields:t.source.fields},storage:{fullyQualifiedName:t.storage.fullyQualifiedName}}}}function v7(e,t){if(!e||!t)return null;switch(e){case Xe.SQL:return l7(t);case Xe.TABLE:return u7(t);case Xe.VIEW:return f7(t);case Xe.TABLE_PATTERN:return m7(t);case Xe.CONNECTOR:return g7(t);default:return console.warn(`Unknown definition type: ${String(e)}`),null}}function Uf(e){return{id:e.id,title:e.title,description:e.description,status:kT.getInfo(e.status),storage:th(e.storage),definitionType:e.definitionType,definition:v7(e.definitionType,e.definition),createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,validationErrors:[]}}function y7(e){return{id:e.id,title:e.title}}const Jn=e=>{var n;return(n=e.response)==null?void 0:n.data};function vN({children:e}){const[t,n]=g.useReducer(t7,pN),a=g.useCallback(async C=>{try{n({type:"FETCH_DATA_MART_START"});const R=await ra.getDataMartById(C),T=Uf(R);n({type:"FETCH_DATA_MART_SUCCESS",payload:T})}catch(R){n({type:"FETCH_DATA_MART_ERROR",payload:Jn(R)})}},[]),i=async C=>{try{n({type:"CREATE_DATA_MART_START"});const R=await ra.createDataMart(C),T=y7(R);return n({type:"CREATE_DATA_MART_SUCCESS",payload:T}),T}catch(R){throw n({type:"CREATE_DATA_MART_ERROR",payload:Jn(R)}),R}},o=async(C,R)=>{try{n({type:"UPDATE_DATA_MART_START"});const T=await ra.updateDataMart(C,R),N=Uf(T);n({type:"UPDATE_DATA_MART_SUCCESS",payload:N})}catch(T){n({type:"UPDATE_DATA_MART_ERROR",payload:Jn(T)})}},u=async C=>{try{n({type:"DELETE_DATA_MART_START"}),await ra.deleteDataMart(C),n({type:"DELETE_DATA_MART_SUCCESS"})}catch(R){n({type:"DELETE_DATA_MART_ERROR",payload:Jn(R)})}},f=async(C,R)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await ra.updateDataMartTitle(C,R),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:R})}catch(T){n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:Jn(T)})}},h=async(C,R)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await ra.updateDataMartDescription(C,R),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:R??""})}catch(T){n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:Jn(T)})}},m=g.useCallback(C=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:C})},[]),v=async(C,R,T)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let N;switch(R){case Xe.SQL:N={definitionType:R,definition:o7(T)};break;case Xe.TABLE:N={definitionType:R,definition:c7(T)};break;case Xe.VIEW:N={definitionType:R,definition:d7(T)};break;case Xe.TABLE_PATTERN:N={definitionType:R,definition:h7(T)};break;case Xe.CONNECTOR:{N={definitionType:Xe.CONNECTOR,definition:p7(T)};break}default:throw new Error(`Unsupported definition type: ${String(R)}`)}const O=await ra.updateDataMartDefinition(C,N),A=Uf(O);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:R,definition:T}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:A})}catch(N){n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:Jn(N)})}},b=async C=>{try{n({type:"PUBLISH_DATA_MART_START"});const R=await ra.publishDataMart(C),T=Uf(R);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:T})}catch(R){throw n({type:"PUBLISH_DATA_MART_ERROR",payload:Jn(R)}),R}},y=async C=>{try{n({type:"RUN_DATA_MART_START"}),await ra.runDataMart(C),n({type:"RUN_DATA_MART_SUCCESS"})}catch(R){n({type:"RUN_DATA_MART_ERROR",payload:Jn(R)})}},S=g.useCallback(()=>{n({type:"RESET"})},[]),w=g.useCallback(()=>t.error?t.error.message:null,[t.error]),E={...t,getDataMart:a,createDataMart:i,updateDataMart:o,deleteDataMart:u,updateDataMartTitle:f,updateDataMartDescription:h,updateDataMartStorage:m,updateDataMartDefinition:v,publishDataMart:b,runDataMart:y,getErrorMessage:w,reset:S};return c.jsx(mN.Provider,{value:E,children:e})}const x7=$t({title:Bt().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:Bt().min(1,"Storage is required")});function b7(){const{createDataMart:e,isLoading:t,error:n}=ld();return{handleCreate:g.useCallback(async i=>{try{return await e(i)}catch(o){return console.error(o),null}},[e]),isSubmitting:t,serverError:n}}function S7(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:a,updateDataMartDescription:i,updateDataMartDefinition:o,publishDataMart:u,runDataMart:f,reset:h,dataMart:m,isLoading:v,error:b,getErrorMessage:y}=ld();return g.useEffect(()=>(e?t(e):h(),()=>{h()}),[e,t,h]),{dataMart:m,isLoading:v,error:b,getErrorMessage:y,deleteDataMart:n,updateDataMartTitle:a,updateDataMartDescription:i,updateDataMartDefinition:o,publishDataMart:u,runDataMart:f}}var cd=e=>e.type==="checkbox",Bi=e=>e instanceof Date,zn=e=>e==null;const yN=e=>typeof e=="object";var cn=e=>!zn(e)&&!Array.isArray(e)&&yN(e)&&!Bi(e),xN=e=>cn(e)&&e.target?cd(e.target)?e.target.checked:e.target.value:e,w7=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,bN=(e,t)=>e.has(w7(t)),E7=e=>{const t=e.constructor&&e.constructor.prototype;return cn(t)&&t.hasOwnProperty("isPrototypeOf")},Vx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Tn(e){let t;const n=Array.isArray(e),a=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(!(Vx&&(e instanceof Blob||a))&&(n||cn(e)))if(t=n?[]:{},!n&&!E7(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=Tn(e[i]));else return e;return t}var Tm=e=>/^\w*$/.test(e),rn=e=>e===void 0,$x=e=>Array.isArray(e)?e.filter(Boolean):[],Hx=e=>$x(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ne=(e,t,n)=>{if(!t||!cn(e))return n;const a=(Tm(t)?[t]:Hx(t)).reduce((i,o)=>zn(i)?i:i[o],e);return rn(a)||a===e?rn(e[t])?n:e[t]:a},fr=e=>typeof e=="boolean",Dt=(e,t,n)=>{let a=-1;const i=Tm(t)?[t]:Hx(t),o=i.length,u=o-1;for(;++a<o;){const f=i[a];let h=n;if(a!==u){const m=e[f];h=cn(m)||Array.isArray(m)?m:isNaN(+i[a+1])?{}:[]}if(f==="__proto__"||f==="constructor"||f==="prototype")return;e[f]=h,e=e[f]}};const Lh={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},sa={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},rs={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Bx=ot.createContext(null);Bx.displayName="HookFormContext";const Pl=()=>ot.useContext(Bx),SN=e=>{const{children:t,...n}=e;return ot.createElement(Bx.Provider,{value:n},t)};var wN=(e,t,n,a=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const u=o;return t._proxyFormState[u]!==sa.all&&(t._proxyFormState[u]=!a||sa.all),n&&(n[u]=!0),e[u]}});return i};const Gx=typeof window<"u"?g.useLayoutEffect:g.useEffect;function EN(e){const t=Pl(),{control:n=t.control,disabled:a,name:i,exact:o}=e||{},[u,f]=ot.useState(n._formState),h=ot.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Gx(()=>n._subscribe({name:i,formState:h.current,exact:o,callback:m=>{!a&&f({...n._formState,...m})}}),[i,a,o]),ot.useEffect(()=>{h.current.isValid&&n._setValid(!0)},[n]),ot.useMemo(()=>wN(u,n,h.current,!1),[u,n])}var Ea=e=>typeof e=="string",CN=(e,t,n,a,i)=>Ea(e)?(a&&t.watch.add(e),Ne(n,e,i)):Array.isArray(e)?e.map(o=>(a&&t.watch.add(o),Ne(n,o))):(a&&(t.watchAll=!0),n);function C7(e){const t=Pl(),{control:n=t.control,name:a,defaultValue:i,disabled:o,exact:u}=e||{},f=ot.useRef(i),[h,m]=ot.useState(n._getWatch(a,f.current));return Gx(()=>n._subscribe({name:a,formState:{values:!0},exact:u,callback:v=>!o&&m(CN(a,n._names,v.values||n._formValues,!1,f.current))}),[a,n,o,u]),ot.useEffect(()=>n._removeUnmounted()),h}function R7(e){const t=Pl(),{name:n,disabled:a,control:i=t.control,shouldUnregister:o}=e,u=bN(i._names.array,n),f=C7({control:i,name:n,defaultValue:Ne(i._formValues,n,Ne(i._defaultValues,n,e.defaultValue)),exact:!0}),h=EN({control:i,name:n,exact:!0}),m=ot.useRef(e),v=ot.useRef(i.register(n,{...e.rules,value:f,...fr(e.disabled)?{disabled:e.disabled}:{}})),b=ot.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ne(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ne(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ne(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ne(h.validatingFields,n)},error:{enumerable:!0,get:()=>Ne(h.errors,n)}}),[h,n]),y=ot.useCallback(C=>v.current.onChange({target:{value:xN(C),name:n},type:Lh.CHANGE}),[n]),S=ot.useCallback(()=>v.current.onBlur({target:{value:Ne(i._formValues,n),name:n},type:Lh.BLUR}),[n,i._formValues]),w=ot.useCallback(C=>{const R=Ne(i._fields,n);R&&C&&(R._f.ref={focus:()=>C.focus&&C.focus(),select:()=>C.select&&C.select(),setCustomValidity:T=>C.setCustomValidity(T),reportValidity:()=>C.reportValidity()})},[i._fields,n]),E=ot.useMemo(()=>({name:n,value:f,...fr(a)||h.disabled?{disabled:h.disabled||a}:{},onChange:y,onBlur:S,ref:w}),[n,a,h.disabled,y,S,w,f]);return ot.useEffect(()=>{const C=i._options.shouldUnregister||o;i.register(n,{...m.current.rules,...fr(m.current.disabled)?{disabled:m.current.disabled}:{}});const R=(T,N)=>{const O=Ne(i._fields,T);O&&O._f&&(O._f.mount=N)};if(R(n,!0),C){const T=Tn(Ne(i._options.defaultValues,n));Dt(i._defaultValues,n,T),rn(Ne(i._formValues,n))&&Dt(i._formValues,n,T)}return!u&&i.register(n),()=>{(u?C&&!i._state.action:C)?i.unregister(n):R(n,!1)}},[n,i,u,o]),ot.useEffect(()=>{i._setDisabledField({disabled:a,name:n})},[a,n,i]),ot.useMemo(()=>({field:E,formState:h,fieldState:b}),[E,h,b])}const RN=e=>e.render(R7(e));var qx=(e,t,n,a,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[a]:i||!0}}:{},hu=e=>Array.isArray(e)?e:[e],wC=()=>{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=[]}}},Ry=e=>zn(e)||!yN(e);function Js(e,t){if(Ry(e)||Ry(t))return e===t;if(Bi(e)&&Bi(t))return e.getTime()===t.getTime();const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(const i of n){const o=e[i];if(!a.includes(i))return!1;if(i!=="ref"){const u=t[i];if(Bi(o)&&Bi(u)||cn(o)&&cn(u)||Array.isArray(o)&&Array.isArray(u)?!Js(o,u):o!==u)return!1}}return!0}var Wn=e=>cn(e)&&!Object.keys(e).length,Zx=e=>e.type==="file",ia=e=>typeof e=="function",Ih=e=>{if(!Vx)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},_N=e=>e.type==="select-multiple",Yx=e=>e.type==="radio",_7=e=>Yx(e)||cd(e),Nv=e=>Ih(e)&&e.isConnected;function T7(e,t){const n=t.slice(0,-1).length;let a=0;for(;a<n;)e=rn(e)?a++:e[t[a++]];return e}function N7(e){for(const t in e)if(e.hasOwnProperty(t)&&!rn(e[t]))return!1;return!0}function xn(e,t){const n=Array.isArray(t)?t:Tm(t)?[t]:Hx(t),a=n.length===1?e:T7(e,n),i=n.length-1,o=n[i];return a&&delete a[o],i!==0&&(cn(a)&&Wn(a)||Array.isArray(a)&&N7(a))&&xn(e,n.slice(0,-1)),e}var TN=e=>{for(const t in e)if(ia(e[t]))return!0;return!1};function Ph(e,t={}){const n=Array.isArray(e);if(cn(e)||n)for(const a in e)Array.isArray(e[a])||cn(e[a])&&!TN(e[a])?(t[a]=Array.isArray(e[a])?[]:{},Ph(e[a],t[a])):zn(e[a])||(t[a]=!0);return t}function NN(e,t,n){const a=Array.isArray(e);if(cn(e)||a)for(const i in e)Array.isArray(e[i])||cn(e[i])&&!TN(e[i])?rn(t)||Ry(n[i])?n[i]=Array.isArray(e[i])?Ph(e[i],[]):{...Ph(e[i])}:NN(e[i],zn(t)?{}:t[i],n[i]):n[i]=!Js(e[i],t[i]);return n}var Qc=(e,t)=>NN(e,t,Ph(t));const EC={value:!1,isValid:!1},CC={value:!0,isValid:!0};var AN=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&&!rn(e[0].attributes.value)?rn(e[0].value)||e[0].value===""?CC:{value:e[0].value,isValid:!0}:CC:EC}return EC},jN=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:a})=>rn(e)?e:t?e===""?NaN:e&&+e:n&&Ea(e)?new Date(e):a?a(e):e;const RC={isValid:!1,value:null};var DN=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,RC):RC;function _C(e){const t=e.ref;return Zx(t)?t.files:Yx(t)?DN(e.refs).value:_N(t)?[...t.selectedOptions].map(({value:n})=>n):cd(t)?AN(e.refs).value:jN(rn(t.value)?e.ref.value:t.value,e)}var A7=(e,t,n,a)=>{const i={};for(const o of e){const u=Ne(t,o);u&&Dt(i,o,u._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:a}},Fh=e=>e instanceof RegExp,Xc=e=>rn(e)?e:Fh(e)?e.source:cn(e)?Fh(e.value)?e.value.source:e.value:e,TC=e=>({isOnSubmit:!e||e===sa.onSubmit,isOnBlur:e===sa.onBlur,isOnChange:e===sa.onChange,isOnAll:e===sa.all,isOnTouch:e===sa.onTouched});const NC="AsyncFunction";var j7=e=>!!e&&!!e.validate&&!!(ia(e.validate)&&e.validate.constructor.name===NC||cn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===NC)),D7=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),AC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(a=>e.startsWith(a)&&/^\.\w+/.test(e.slice(a.length))));const mu=(e,t,n,a)=>{for(const i of n||Object.keys(e)){const o=Ne(e,i);if(o){const{_f:u,...f}=o;if(u){if(u.refs&&u.refs[0]&&t(u.refs[0],i)&&!a)return!0;if(u.ref&&t(u.ref,u.name)&&!a)return!0;if(mu(f,t))break}else if(cn(f)&&mu(f,t))break}}};function jC(e,t,n){const a=Ne(e,n);if(a||Tm(n))return{error:a,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),u=Ne(t,o),f=Ne(e,o);if(u&&!Array.isArray(u)&&n!==o)return{name:n};if(f&&f.type)return{name:o,error:f};if(f&&f.root&&f.root.type)return{name:`${o}.root`,error:f.root};i.pop()}return{name:n}}var O7=(e,t,n,a)=>{n(e);const{name:i,...o}=e;return Wn(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(u=>t[u]===(!a||sa.all))},M7=(e,t,n)=>!e||!t||e===t||hu(e).some(a=>a&&(n?a===t:a.startsWith(t)||t.startsWith(a))),k7=(e,t,n,a,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?a.isOnBlur:i.isOnBlur)?!e:(n?a.isOnChange:i.isOnChange)?e:!0,L7=(e,t)=>!$x(Ne(e,t)).length&&xn(e,t),I7=(e,t,n)=>{const a=hu(Ne(e,n));return Dt(a,"root",t[n]),Dt(e,n,a),e},nh=e=>Ea(e);function DC(e,t,n="validate"){if(nh(e)||Array.isArray(e)&&e.every(nh)||fr(e)&&!e)return{type:n,message:nh(e)?e:"",ref:t}}var rl=e=>cn(e)&&!Fh(e)?e:{value:e,message:""},OC=async(e,t,n,a,i,o)=>{const{ref:u,refs:f,required:h,maxLength:m,minLength:v,min:b,max:y,pattern:S,validate:w,name:E,valueAsNumber:C,mount:R}=e._f,T=Ne(n,E);if(!R||t.has(E))return{};const N=f?f[0]:u,O=V=>{i&&N.reportValidity&&(N.setCustomValidity(fr(V)?"":V||""),N.reportValidity())},A={},D=Yx(u),L=cd(u),H=D||L,X=(C||Zx(u))&&rn(u.value)&&rn(T)||Ih(u)&&u.value===""||T===""||Array.isArray(T)&&!T.length,re=qx.bind(null,E,a,A),me=(V,le,ue,ne=rs.maxLength,k=rs.minLength)=>{const Z=V?le:ue;A[E]={type:V?ne:k,message:Z,ref:u,...re(V?ne:k,Z)}};if(o?!Array.isArray(T)||!T.length:h&&(!H&&(X||zn(T))||fr(T)&&!T||L&&!AN(f).isValid||D&&!DN(f).isValid)){const{value:V,message:le}=nh(h)?{value:!!h,message:h}:rl(h);if(V&&(A[E]={type:rs.required,message:le,ref:N,...re(rs.required,le)},!a))return O(le),A}if(!X&&(!zn(b)||!zn(y))){let V,le;const ue=rl(y),ne=rl(b);if(!zn(T)&&!isNaN(T)){const k=u.valueAsNumber||T&&+T;zn(ue.value)||(V=k>ue.value),zn(ne.value)||(le=k<ne.value)}else{const k=u.valueAsDate||new Date(T),Z=M=>new Date(new Date().toDateString()+" "+M),$=u.type=="time",se=u.type=="week";Ea(ue.value)&&T&&(V=$?Z(T)>Z(ue.value):se?T>ue.value:k>new Date(ue.value)),Ea(ne.value)&&T&&(le=$?Z(T)<Z(ne.value):se?T<ne.value:k<new Date(ne.value))}if((V||le)&&(me(!!V,ue.message,ne.message,rs.max,rs.min),!a))return O(A[E].message),A}if((m||v)&&!X&&(Ea(T)||o&&Array.isArray(T))){const V=rl(m),le=rl(v),ue=!zn(V.value)&&T.length>+V.value,ne=!zn(le.value)&&T.length<+le.value;if((ue||ne)&&(me(ue,V.message,le.message),!a))return O(A[E].message),A}if(S&&!X&&Ea(T)){const{value:V,message:le}=rl(S);if(Fh(V)&&!T.match(V)&&(A[E]={type:rs.pattern,message:le,ref:u,...re(rs.pattern,le)},!a))return O(le),A}if(w){if(ia(w)){const V=await w(T,n),le=DC(V,N);if(le&&(A[E]={...le,...re(rs.validate,le.message)},!a))return O(le.message),A}else if(cn(w)){let V={};for(const le in w){if(!Wn(V)&&!a)break;const ue=DC(await w[le](T,n),N,le);ue&&(V={...ue,...re(le,ue.message)},O(ue.message),a&&(A[E]=V))}if(!Wn(V)&&(A[E]={ref:N,...V},!a))return A}}return O(!0),A};const P7={mode:sa.onSubmit,reValidateMode:sa.onChange,shouldFocusError:!0};function F7(e={}){let t={...P7,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:ia(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const a={};let i=cn(t.defaultValues)||cn(t.values)?Tn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Tn(i),u={action:!1,mount:!1,watch:!1},f={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},h,m=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let b={...v};const y={array:wC(),state:wC()},S=t.criteriaMode===sa.all,w=F=>W=>{clearTimeout(m),m=setTimeout(F,W)},E=async F=>{if(!t.disabled&&(v.isValid||b.isValid||F)){const W=t.resolver?Wn((await L()).errors):await X(a,!0);W!==n.isValid&&y.state.next({isValid:W})}},C=(F,W)=>{!t.disabled&&(v.isValidating||v.validatingFields||b.isValidating||b.validatingFields)&&((F||Array.from(f.mount)).forEach(oe=>{oe&&(W?Dt(n.validatingFields,oe,W):xn(n.validatingFields,oe))}),y.state.next({validatingFields:n.validatingFields,isValidating:!Wn(n.validatingFields)}))},R=(F,W=[],oe,Ce,Ee=!0,Se=!0)=>{if(Ce&&oe&&!t.disabled){if(u.action=!0,Se&&Array.isArray(Ne(a,F))){const je=oe(Ne(a,F),Ce.argA,Ce.argB);Ee&&Dt(a,F,je)}if(Se&&Array.isArray(Ne(n.errors,F))){const je=oe(Ne(n.errors,F),Ce.argA,Ce.argB);Ee&&Dt(n.errors,F,je),L7(n.errors,F)}if((v.touchedFields||b.touchedFields)&&Se&&Array.isArray(Ne(n.touchedFields,F))){const je=oe(Ne(n.touchedFields,F),Ce.argA,Ce.argB);Ee&&Dt(n.touchedFields,F,je)}(v.dirtyFields||b.dirtyFields)&&(n.dirtyFields=Qc(i,o)),y.state.next({name:F,isDirty:me(F,W),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Dt(o,F,W)},T=(F,W)=>{Dt(n.errors,F,W),y.state.next({errors:n.errors})},N=F=>{n.errors=F,y.state.next({errors:n.errors,isValid:!1})},O=(F,W,oe,Ce)=>{const Ee=Ne(a,F);if(Ee){const Se=Ne(o,F,rn(oe)?Ne(i,F):oe);rn(Se)||Ce&&Ce.defaultChecked||W?Dt(o,F,W?Se:_C(Ee._f)):ue(F,Se),u.mount&&E()}},A=(F,W,oe,Ce,Ee)=>{let Se=!1,je=!1;const Be={name:F};if(!t.disabled){if(!oe||Ce){(v.isDirty||b.isDirty)&&(je=n.isDirty,n.isDirty=Be.isDirty=me(),Se=je!==Be.isDirty);const ht=Js(Ne(i,F),W);je=!!Ne(n.dirtyFields,F),ht?xn(n.dirtyFields,F):Dt(n.dirtyFields,F,!0),Be.dirtyFields=n.dirtyFields,Se=Se||(v.dirtyFields||b.dirtyFields)&&je!==!ht}if(oe){const ht=Ne(n.touchedFields,F);ht||(Dt(n.touchedFields,F,oe),Be.touchedFields=n.touchedFields,Se=Se||(v.touchedFields||b.touchedFields)&&ht!==oe)}Se&&Ee&&y.state.next(Be)}return Se?Be:{}},D=(F,W,oe,Ce)=>{const Ee=Ne(n.errors,F),Se=(v.isValid||b.isValid)&&fr(W)&&n.isValid!==W;if(t.delayError&&oe?(h=w(()=>T(F,oe)),h(t.delayError)):(clearTimeout(m),h=null,oe?Dt(n.errors,F,oe):xn(n.errors,F)),(oe?!Js(Ee,oe):Ee)||!Wn(Ce)||Se){const je={...Ce,...Se&&fr(W)?{isValid:W}:{},errors:n.errors,name:F};n={...n,...je},y.state.next(je)}},L=async F=>{C(F,!0);const W=await t.resolver(o,t.context,A7(F||f.mount,a,t.criteriaMode,t.shouldUseNativeValidation));return C(F),W},H=async F=>{const{errors:W}=await L(F);if(F)for(const oe of F){const Ce=Ne(W,oe);Ce?Dt(n.errors,oe,Ce):xn(n.errors,oe)}else n.errors=W;return W},X=async(F,W,oe={valid:!0})=>{for(const Ce in F){const Ee=F[Ce];if(Ee){const{_f:Se,...je}=Ee;if(Se){const Be=f.array.has(Se.name),ht=Ee._f&&j7(Ee._f);ht&&v.validatingFields&&C([Ce],!0);const jt=await OC(Ee,f.disabled,o,S,t.shouldUseNativeValidation&&!W,Be);if(ht&&v.validatingFields&&C([Ce]),jt[Se.name]&&(oe.valid=!1,W))break;!W&&(Ne(jt,Se.name)?Be?I7(n.errors,jt,Se.name):Dt(n.errors,Se.name,jt[Se.name]):xn(n.errors,Se.name))}!Wn(je)&&await X(je,W,oe)}}return oe.valid},re=()=>{for(const F of f.unMount){const W=Ne(a,F);W&&(W._f.refs?W._f.refs.every(oe=>!Nv(oe)):!Nv(W._f.ref))&&fe(F)}f.unMount=new Set},me=(F,W)=>!t.disabled&&(F&&W&&Dt(o,F,W),!Js(M(),i)),V=(F,W,oe)=>CN(F,f,{...u.mount?o:rn(W)?i:Ea(F)?{[F]:W}:W},oe,W),le=F=>$x(Ne(u.mount?o:i,F,t.shouldUnregister?Ne(i,F,[]):[])),ue=(F,W,oe={})=>{const Ce=Ne(a,F);let Ee=W;if(Ce){const Se=Ce._f;Se&&(!Se.disabled&&Dt(o,F,jN(W,Se)),Ee=Ih(Se.ref)&&zn(W)?"":W,_N(Se.ref)?[...Se.ref.options].forEach(je=>je.selected=Ee.includes(je.value)):Se.refs?cd(Se.ref)?Se.refs.forEach(je=>{(!je.defaultChecked||!je.disabled)&&(Array.isArray(Ee)?je.checked=!!Ee.find(Be=>Be===je.value):je.checked=Ee===je.value||!!Ee)}):Se.refs.forEach(je=>je.checked=je.value===Ee):Zx(Se.ref)?Se.ref.value="":(Se.ref.value=Ee,Se.ref.type||y.state.next({name:F,values:Tn(o)})))}(oe.shouldDirty||oe.shouldTouch)&&A(F,Ee,oe.shouldTouch,oe.shouldDirty,!0),oe.shouldValidate&&se(F)},ne=(F,W,oe)=>{for(const Ce in W){if(!W.hasOwnProperty(Ce))return;const Ee=W[Ce],Se=F+"."+Ce,je=Ne(a,Se);(f.array.has(F)||cn(Ee)||je&&!je._f)&&!Bi(Ee)?ne(Se,Ee,oe):ue(Se,Ee,oe)}},k=(F,W,oe={})=>{const Ce=Ne(a,F),Ee=f.array.has(F),Se=Tn(W);Dt(o,F,Se),Ee?(y.array.next({name:F,values:Tn(o)}),(v.isDirty||v.dirtyFields||b.isDirty||b.dirtyFields)&&oe.shouldDirty&&y.state.next({name:F,dirtyFields:Qc(i,o),isDirty:me(F,Se)})):Ce&&!Ce._f&&!zn(Se)?ne(F,Se,oe):ue(F,Se,oe),AC(F,f)&&y.state.next({...n}),y.state.next({name:u.mount?F:void 0,values:Tn(o)})},Z=async F=>{u.mount=!0;const W=F.target;let oe=W.name,Ce=!0;const Ee=Ne(a,oe),Se=ht=>{Ce=Number.isNaN(ht)||Bi(ht)&&isNaN(ht.getTime())||Js(ht,Ne(o,oe,ht))},je=TC(t.mode),Be=TC(t.reValidateMode);if(Ee){let ht,jt;const bs=W.type?_C(Ee._f):xN(F),pn=F.type===Lh.BLUR||F.type===Lh.FOCUS_OUT,vo=!D7(Ee._f)&&!t.resolver&&!Ne(n.errors,oe)&&!Ee._f.deps||k7(pn,Ne(n.touchedFields,oe),n.isSubmitted,Be,je),Kr=AC(oe,f,pn);Dt(o,oe,bs),pn?(Ee._f.onBlur&&Ee._f.onBlur(F),h&&h(0)):Ee._f.onChange&&Ee._f.onChange(F);const Qr=A(oe,bs,pn),Xr=!Wn(Qr)||Kr;if(!pn&&y.state.next({name:oe,type:F.type,values:Tn(o)}),vo)return(v.isValid||b.isValid)&&(t.mode==="onBlur"?pn&&E():pn||E()),Xr&&y.state.next({name:oe,...Kr?{}:Qr});if(!pn&&Kr&&y.state.next({...n}),t.resolver){const{errors:ha}=await L([oe]);if(Se(bs),Ce){const Tr=jC(n.errors,a,oe),vi=jC(ha,a,Tr.name||oe);ht=vi.error,oe=vi.name,jt=Wn(ha)}}else C([oe],!0),ht=(await OC(Ee,f.disabled,o,S,t.shouldUseNativeValidation))[oe],C([oe]),Se(bs),Ce&&(ht?jt=!1:(v.isValid||b.isValid)&&(jt=await X(a,!0)));Ce&&(Ee._f.deps&&se(Ee._f.deps),D(oe,jt,ht,Qr))}},$=(F,W)=>{if(Ne(n.errors,W)&&F.focus)return F.focus(),1},se=async(F,W={})=>{let oe,Ce;const Ee=hu(F);if(t.resolver){const Se=await H(rn(F)?F:Ee);oe=Wn(Se),Ce=F?!Ee.some(je=>Ne(Se,je)):oe}else F?(Ce=(await Promise.all(Ee.map(async Se=>{const je=Ne(a,Se);return await X(je&&je._f?{[Se]:je}:je)}))).every(Boolean),!(!Ce&&!n.isValid)&&E()):Ce=oe=await X(a);return y.state.next({...!Ea(F)||(v.isValid||b.isValid)&&oe!==n.isValid?{}:{name:F},...t.resolver||!F?{isValid:oe}:{},errors:n.errors}),W.shouldFocus&&!Ce&&mu(a,$,F?Ee:f.mount),Ce},M=F=>{const W={...u.mount?o:i};return rn(F)?W:Ea(F)?Ne(W,F):F.map(oe=>Ne(W,oe))},G=(F,W)=>({invalid:!!Ne((W||n).errors,F),isDirty:!!Ne((W||n).dirtyFields,F),error:Ne((W||n).errors,F),isValidating:!!Ne(n.validatingFields,F),isTouched:!!Ne((W||n).touchedFields,F)}),P=F=>{F&&hu(F).forEach(W=>xn(n.errors,W)),y.state.next({errors:F?n.errors:{}})},q=(F,W,oe)=>{const Ce=(Ne(a,F,{_f:{}})._f||{}).ref,Ee=Ne(n.errors,F)||{},{ref:Se,message:je,type:Be,...ht}=Ee;Dt(n.errors,F,{...ht,...W,ref:Ce}),y.state.next({name:F,errors:n.errors,isValid:!1}),oe&&oe.shouldFocus&&Ce&&Ce.focus&&Ce.focus()},ie=(F,W)=>ia(F)?y.state.subscribe({next:oe=>F(V(void 0,W),oe)}):V(F,W,!0),he=F=>y.state.subscribe({next:W=>{M7(F.name,W.name,F.exact)&&O7(W,F.formState||v,en,F.reRenderRoot)&&F.callback({values:{...o},...n,...W})}}).unsubscribe,ve=F=>(u.mount=!0,b={...b,...F.formState},he({...F,formState:b})),fe=(F,W={})=>{for(const oe of F?hu(F):f.mount)f.mount.delete(oe),f.array.delete(oe),W.keepValue||(xn(a,oe),xn(o,oe)),!W.keepError&&xn(n.errors,oe),!W.keepDirty&&xn(n.dirtyFields,oe),!W.keepTouched&&xn(n.touchedFields,oe),!W.keepIsValidating&&xn(n.validatingFields,oe),!t.shouldUnregister&&!W.keepDefaultValue&&xn(i,oe);y.state.next({values:Tn(o)}),y.state.next({...n,...W.keepDirty?{isDirty:me()}:{}}),!W.keepIsValid&&E()},_e=({disabled:F,name:W})=>{(fr(F)&&u.mount||F||f.disabled.has(W))&&(F?f.disabled.add(W):f.disabled.delete(W))},be=(F,W={})=>{let oe=Ne(a,F);const Ce=fr(W.disabled)||fr(t.disabled);return Dt(a,F,{...oe||{},_f:{...oe&&oe._f?oe._f:{ref:{name:F}},name:F,mount:!0,...W}}),f.mount.add(F),oe?_e({disabled:fr(W.disabled)?W.disabled:t.disabled,name:F}):O(F,!0,W.value),{...Ce?{disabled:W.disabled||t.disabled}:{},...t.progressive?{required:!!W.required,min:Xc(W.min),max:Xc(W.max),minLength:Xc(W.minLength),maxLength:Xc(W.maxLength),pattern:Xc(W.pattern)}:{},name:F,onChange:Z,onBlur:Z,ref:Ee=>{if(Ee){be(F,W),oe=Ne(a,F);const Se=rn(Ee.value)&&Ee.querySelectorAll&&Ee.querySelectorAll("input,select,textarea")[0]||Ee,je=_7(Se),Be=oe._f.refs||[];if(je?Be.find(ht=>ht===Se):Se===oe._f.ref)return;Dt(a,F,{_f:{...oe._f,...je?{refs:[...Be.filter(Nv),Se,...Array.isArray(Ne(i,F))?[{}]:[]],ref:{type:Se.type,name:F}}:{ref:Se}}}),O(F,!1,void 0,Se)}else oe=Ne(a,F,{}),oe._f&&(oe._f.mount=!1),(t.shouldUnregister||W.shouldUnregister)&&!(bN(f.array,F)&&u.action)&&f.unMount.add(F)}}},Te=()=>t.shouldFocusError&&mu(a,$,f.mount),Me=F=>{fr(F)&&(y.state.next({disabled:F}),mu(a,(W,oe)=>{const Ce=Ne(a,oe);Ce&&(W.disabled=Ce._f.disabled||F,Array.isArray(Ce._f.refs)&&Ce._f.refs.forEach(Ee=>{Ee.disabled=Ce._f.disabled||F}))},0,!1))},Ge=(F,W)=>async oe=>{let Ce;oe&&(oe.preventDefault&&oe.preventDefault(),oe.persist&&oe.persist());let Ee=Tn(o);if(y.state.next({isSubmitting:!0}),t.resolver){const{errors:Se,values:je}=await L();n.errors=Se,Ee=je}else await X(a);if(f.disabled.size)for(const Se of f.disabled)Dt(Ee,Se,void 0);if(xn(n.errors,"root"),Wn(n.errors)){y.state.next({errors:{}});try{await F(Ee,oe)}catch(Se){Ce=Se}}else W&&await W({...n.errors},oe),Te(),setTimeout(Te);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Wn(n.errors)&&!Ce,submitCount:n.submitCount+1,errors:n.errors}),Ce)throw Ce},Yt=(F,W={})=>{Ne(a,F)&&(rn(W.defaultValue)?k(F,Tn(Ne(i,F))):(k(F,W.defaultValue),Dt(i,F,Tn(W.defaultValue))),W.keepTouched||xn(n.touchedFields,F),W.keepDirty||(xn(n.dirtyFields,F),n.isDirty=W.defaultValue?me(F,Tn(Ne(i,F))):me()),W.keepError||(xn(n.errors,F),v.isValid&&E()),y.state.next({...n}))},zt=(F,W={})=>{const oe=F?Tn(F):i,Ce=Tn(oe),Ee=Wn(F),Se=Ee?i:Ce;if(W.keepDefaultValues||(i=oe),!W.keepValues){if(W.keepDirtyValues){const je=new Set([...f.mount,...Object.keys(Qc(i,o))]);for(const Be of Array.from(je))Ne(n.dirtyFields,Be)?Dt(Se,Be,Ne(o,Be)):k(Be,Ne(Se,Be))}else{if(Vx&&rn(F))for(const je of f.mount){const Be=Ne(a,je);if(Be&&Be._f){const ht=Array.isArray(Be._f.refs)?Be._f.refs[0]:Be._f.ref;if(Ih(ht)){const jt=ht.closest("form");if(jt){jt.reset();break}}}}for(const je of f.mount)k(je,Ne(Se,je))}o=Tn(Se),y.array.next({values:{...Se}}),y.state.next({values:{...Se}})}f={mount:W.keepDirtyValues?f.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},u.mount=!v.isValid||!!W.keepIsValid||!!W.keepDirtyValues,u.watch=!!t.shouldUnregister,y.state.next({submitCount:W.keepSubmitCount?n.submitCount:0,isDirty:Ee?!1:W.keepDirty?n.isDirty:!!(W.keepDefaultValues&&!Js(F,i)),isSubmitted:W.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ee?{}:W.keepDirtyValues?W.keepDefaultValues&&o?Qc(i,o):n.dirtyFields:W.keepDefaultValues&&F?Qc(i,F):W.keepDirty?n.dirtyFields:{},touchedFields:W.keepTouched?n.touchedFields:{},errors:W.keepErrors?n.errors:{},isSubmitSuccessful:W.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Rr=(F,W)=>zt(ia(F)?F(o):F,W),Yr=(F,W={})=>{const oe=Ne(a,F),Ce=oe&&oe._f;if(Ce){const Ee=Ce.refs?Ce.refs[0]:Ce.ref;Ee.focus&&(Ee.focus(),W.shouldSelect&&ia(Ee.select)&&Ee.select())}},en=F=>{n={...n,...F}},_r={control:{register:be,unregister:fe,getFieldState:G,handleSubmit:Ge,setError:q,_subscribe:he,_runSchema:L,_focusError:Te,_getWatch:V,_getDirty:me,_setValid:E,_setFieldArray:R,_setDisabledField:_e,_setErrors:N,_getFieldArray:le,_reset:zt,_resetDefaultValues:()=>ia(t.defaultValues)&&t.defaultValues().then(F=>{Rr(F,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:Me,_subjects:y,_proxyFormState:v,get _fields(){return a},get _formValues(){return o},get _state(){return u},set _state(F){u=F},get _defaultValues(){return i},get _names(){return f},set _names(F){f=F},get _formState(){return n},get _options(){return t},set _options(F){t={...t,...F}}},subscribe:ve,trigger:se,register:be,handleSubmit:Ge,watch:ie,setValue:k,getValues:M,reset:Rr,resetField:Yt,clearErrors:P,unregister:fe,setError:q,setFocus:Yr,getFieldState:G};return{..._r,formControl:_r}}function Fl(e={}){const t=ot.useRef(void 0),n=ot.useRef(void 0),[a,i]=ot.useState({isDirty:!1,isValidating:!1,isLoading:ia(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:ia(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:a},e.defaultValues&&!ia(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...f}=F7(e);t.current={...f,formState:a}}const o=t.current.control;return o._options=e,Gx(()=>{const u=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(f=>({...f,isReady:!0})),o._formState.isReady=!0,u},[o]),ot.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ot.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),ot.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),ot.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),ot.useEffect(()=>{if(o._proxyFormState.isDirty){const u=o._getDirty();u!==a.isDirty&&o._subjects.state.next({isDirty:u})}},[o,a.isDirty]),ot.useEffect(()=>{e.values&&!Js(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(u=>({...u}))):o._resetDefaultValues()},[o,e.values]),ot.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=wN(a,o),t.current}const MC=(e,t,n)=>{if(e&&"reportValidity"in e){const a=Ne(n,t);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},_y=(e,t)=>{for(const n in t.fields){const a=t.fields[n];a&&a.ref&&"reportValidity"in a.ref?MC(a.ref,n,e):a&&a.refs&&a.refs.forEach(i=>MC(i,n,e))}},kC=(e,t)=>{t.shouldUseNativeValidation&&_y(e,t);const n={};for(const a in e){const i=Ne(t.fields,a),o=Object.assign(e[a]||{},{ref:i&&i.ref});if(U7(t.names||Object.keys(e),a)){const u=Object.assign({},Ne(n,a));Dt(u,"root",o),Dt(n,a,u)}else Dt(n,a,o)}return n},U7=(e,t)=>{const n=LC(t);return e.some(a=>LC(a).match(`^${n}\\.\\d+`))};function LC(e){return e.replace(/\]|\[/g,"")}function ON(e,t,n){function a(f,h){var m;Object.defineProperty(f,"_zod",{value:f._zod??{},enumerable:!1}),(m=f._zod).traits??(m.traits=new Set),f._zod.traits.add(e),t(f,h);for(const v in u.prototype)v in f||Object.defineProperty(f,v,{value:u.prototype[v].bind(f)});f._zod.constr=u,f._zod.def=h}const i=(n==null?void 0:n.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function u(f){var h;const m=n!=null&&n.Parent?new o:this;a(m,f),(h=m._zod).deferred??(h.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>{var h,m;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(m=(h=f==null?void 0:f._zod)==null?void 0:h.traits)==null?void 0:m.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}class z7 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const V7={};function MN(e){return V7}function $7(e,t){return typeof t=="bigint"?t.toString():t}const kN=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function zf(e){return typeof e=="string"?e:e==null?void 0:e.message}function LN(e,t,n){var i,o,u,f,h,m;const a={...e,path:e.path??[]};if(!e.message){const v=zf((u=(o=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??zf((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??zf((h=n.customError)==null?void 0:h.call(n,e))??zf((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";a.message=v}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}const IN=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,$7,2)},enumerable:!0})},H7=ON("$ZodError",IN),PN=ON("$ZodError",IN,{Parent:Error}),B7=e=>(t,n,a,i)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new z7;if(u.issues.length){const f=new((i==null?void 0:i.Err)??e)(u.issues.map(h=>LN(h,o,MN())));throw kN(f,i==null?void 0:i.callee),f}return u.value},G7=B7(PN),q7=e=>async(t,n,a,i)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new((i==null?void 0:i.Err)??e)(u.issues.map(h=>LN(h,o,MN())));throw kN(f,i==null?void 0:i.callee),f}return u.value},Z7=q7(PN);function IC(e,t){try{var n=e()}catch(a){return t(a)}return n&&n.then?n.then(void 0,t):n}function Y7(e,t){for(var n={};e.length;){var a=e[0],i=a.code,o=a.message,u=a.path.join(".");if(!n[u])if("unionErrors"in a){var f=a.unionErrors[0].errors[0];n[u]={message:f.message,type:f.code}}else n[u]={message:o,type:i};if("unionErrors"in a&&a.unionErrors.forEach(function(v){return v.errors.forEach(function(b){return e.push(b)})}),t){var h=n[u].types,m=h&&h[a.code];n[u]=qx(u,t,n,i,m?[].concat(m,a.message):a.message)}e.shift()}return n}function K7(e,t){for(var n={};e.length;){var a=e[0],i=a.code,o=a.message,u=a.path.join(".");if(!n[u])if(a.code==="invalid_union"){var f=a.errors[0][0];n[u]={message:f.message,type:f.code}}else n[u]={message:o,type:i};if(a.code==="invalid_union"&&a.errors.forEach(function(v){return v.forEach(function(b){return e.push(b)})}),t){var h=n[u].types,m=h&&h[a.code];n[u]=qx(u,t,n,i,m?[].concat(m,a.message):a.message)}e.shift()}return n}function Ul(e,t,n){if(n===void 0&&(n={}),function(a){return"_def"in a&&typeof a._def=="object"&&"typeName"in a._def}(e))return function(a,i,o){try{return Promise.resolve(IC(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](a,t)).then(function(u){return o.shouldUseNativeValidation&&_y({},o),{errors:{},values:n.raw?Object.assign({},a):u}})},function(u){if(function(f){return Array.isArray(f==null?void 0:f.issues)}(u))return{values:{},errors:kC(Y7(u.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw u}))}catch(u){return Promise.reject(u)}};if(function(a){return"_zod"in a&&typeof a._zod=="object"}(e))return function(a,i,o){try{return Promise.resolve(IC(function(){return Promise.resolve((n.mode==="sync"?G7:Z7)(e,a,t)).then(function(u){return o.shouldUseNativeValidation&&_y({},o),{errors:{},values:n.raw?Object.assign({},a):u}})},function(u){if(function(f){return f instanceof H7}(u))return{values:{},errors:kC(K7(u.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw u}))}catch(u){return Promise.reject(u)}};throw new Error("Invalid input: not a Zod schema")}function PC(e,[t,n]){return Math.min(n,Math.max(t,e))}function FN(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Q7=[" ","Enter","ArrowUp","ArrowDown"],X7=[" ","Enter"],eo="Select",[Nm,Am,W7]=Sx(eo),[zl,aZ]=Br(eo,[W7,Ua]),jm=Ua(),[J7,mi]=zl(eo),[eV,tV]=zl(eo),UN=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:i,onOpenChange:o,value:u,defaultValue:f,onValueChange:h,dir:m,name:v,autoComplete:b,disabled:y,required:S,form:w}=e,E=jm(t),[C,R]=g.useState(null),[T,N]=g.useState(null),[O,A]=g.useState(!1),D=wx(m),[L,H]=ds({prop:a,defaultProp:i??!1,onChange:o,caller:eo}),[X,re]=ds({prop:u,defaultProp:f,onChange:h,caller:eo}),me=g.useRef(null),V=C?w||!!C.closest("form"):!0,[le,ue]=g.useState(new Set),ne=Array.from(le).map(k=>k.props.value).join(";");return c.jsx($u,{...E,children:c.jsxs(J7,{required:S,scope:t,trigger:C,onTriggerChange:R,valueNode:T,onValueNodeChange:N,valueNodeHasChildren:O,onValueNodeHasChildrenChange:A,contentId:jn(),value:X,onValueChange:re,open:L,onOpenChange:H,dir:D,triggerPointerDownPosRef:me,disabled:y,children:[c.jsx(Nm.Provider,{scope:t,children:c.jsx(eV,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(k=>{ue(Z=>new Set(Z).add(k))},[]),onNativeOptionRemove:g.useCallback(k=>{ue(Z=>{const $=new Set(Z);return $.delete(k),$})},[]),children:n})}),V?c.jsxs(lA,{"aria-hidden":!0,required:S,tabIndex:-1,name:v,autoComplete:b,value:X,onChange:k=>re(k.target.value),disabled:y,form:w,children:[X===void 0?c.jsx("option",{value:""}):null,Array.from(le)]},ne):null]})})};UN.displayName=eo;var zN="SelectTrigger",VN=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...i}=e,o=jm(n),u=mi(zN,n),f=u.disabled||a,h=xt(t,u.onTriggerChange),m=Am(n),v=g.useRef("touch"),[b,y,S]=uA(E=>{const C=m().filter(N=>!N.disabled),R=C.find(N=>N.value===u.value),T=dA(C,E,R);T!==void 0&&u.onValueChange(T.value)}),w=E=>{f||(u.onOpenChange(!0),S()),E&&(u.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return c.jsx(Dl,{asChild:!0,...o,children:c.jsx(We.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":cA(u.value)?"":void 0,...i,ref:h,onClick:Re(i.onClick,E=>{E.currentTarget.focus(),v.current!=="mouse"&&w(E)}),onPointerDown:Re(i.onPointerDown,E=>{v.current=E.pointerType;const C=E.target;C.hasPointerCapture(E.pointerId)&&C.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(w(E),E.preventDefault())}),onKeyDown:Re(i.onKeyDown,E=>{const C=b.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&y(E.key),!(C&&E.key===" ")&&Q7.includes(E.key)&&(w(),E.preventDefault())})})})});VN.displayName=zN;var $N="SelectValue",HN=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:i,children:o,placeholder:u="",...f}=e,h=mi($N,n),{onValueNodeHasChildrenChange:m}=h,v=o!==void 0,b=xt(t,h.onValueNodeChange);return Pn(()=>{m(v)},[m,v]),c.jsx(We.span,{...f,ref:b,style:{pointerEvents:"none"},children:cA(h.value)?c.jsx(c.Fragment,{children:u}):o})});HN.displayName=$N;var nV="SelectIcon",BN=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...i}=e;return c.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:a||"▼"})});BN.displayName=nV;var rV="SelectPortal",GN=e=>c.jsx(co,{asChild:!0,...e});GN.displayName=rV;var to="SelectContent",qN=g.forwardRef((e,t)=>{const n=mi(to,e.__scopeSelect),[a,i]=g.useState();if(Pn(()=>{i(new DocumentFragment)},[]),!n.open){const o=a;return o?El.createPortal(c.jsx(ZN,{scope:e.__scopeSelect,children:c.jsx(Nm.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(YN,{...e,ref:t})});qN.displayName=to;var aa=10,[ZN,pi]=zl(to),aV="SelectContentImpl",sV=ai("SelectContent.RemoveScroll"),YN=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:u,side:f,sideOffset:h,align:m,alignOffset:v,arrowPadding:b,collisionBoundary:y,collisionPadding:S,sticky:w,hideWhenDetached:E,avoidCollisions:C,...R}=e,T=mi(to,n),[N,O]=g.useState(null),[A,D]=g.useState(null),L=xt(t,fe=>O(fe)),[H,X]=g.useState(null),[re,me]=g.useState(null),V=Am(n),[le,ue]=g.useState(!1),ne=g.useRef(!1);g.useEffect(()=>{if(N)return Xh(N)},[N]),Kh();const k=g.useCallback(fe=>{const[_e,...be]=V().map(Ge=>Ge.ref.current),[Te]=be.slice(-1),Me=document.activeElement;for(const Ge of fe)if(Ge===Me||(Ge==null||Ge.scrollIntoView({block:"nearest"}),Ge===_e&&A&&(A.scrollTop=0),Ge===Te&&A&&(A.scrollTop=A.scrollHeight),Ge==null||Ge.focus(),document.activeElement!==Me))return},[V,A]),Z=g.useCallback(()=>k([H,N]),[k,H,N]);g.useEffect(()=>{le&&Z()},[le,Z]);const{onOpenChange:$,triggerPointerDownPosRef:se}=T;g.useEffect(()=>{if(N){let fe={x:0,y:0};const _e=Te=>{var Me,Ge;fe={x:Math.abs(Math.round(Te.pageX)-(((Me=se.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(Te.pageY)-(((Ge=se.current)==null?void 0:Ge.y)??0))}},be=Te=>{fe.x<=10&&fe.y<=10?Te.preventDefault():N.contains(Te.target)||$(!1),document.removeEventListener("pointermove",_e),se.current=null};return se.current!==null&&(document.addEventListener("pointermove",_e),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",_e),document.removeEventListener("pointerup",be,{capture:!0})}}},[N,$,se]),g.useEffect(()=>{const fe=()=>$(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[$]);const[M,G]=uA(fe=>{const _e=V().filter(Me=>!Me.disabled),be=_e.find(Me=>Me.ref.current===document.activeElement),Te=dA(_e,fe,be);Te&&setTimeout(()=>Te.ref.current.focus())}),P=g.useCallback((fe,_e,be)=>{const Te=!ne.current&&!be;(T.value!==void 0&&T.value===_e||Te)&&(X(fe),Te&&(ne.current=!0))},[T.value]),q=g.useCallback(()=>N==null?void 0:N.focus(),[N]),ie=g.useCallback((fe,_e,be)=>{const Te=!ne.current&&!be;(T.value!==void 0&&T.value===_e||Te)&&me(fe)},[T.value]),he=a==="popper"?Ty:KN,ve=he===Ty?{side:f,sideOffset:h,align:m,alignOffset:v,arrowPadding:b,collisionBoundary:y,collisionPadding:S,sticky:w,hideWhenDetached:E,avoidCollisions:C}:{};return c.jsx(ZN,{scope:n,content:N,viewport:A,onViewportChange:D,itemRefCallback:P,selectedItem:H,onItemLeave:q,itemTextRefCallback:ie,focusSelectedItem:Z,selectedItemText:re,position:a,isPositioned:le,searchRef:M,children:c.jsx(zu,{as:sV,allowPinchZoom:!0,children:c.jsx(Uu,{asChild:!0,trapped:T.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:Re(i,fe=>{var _e;(_e=T.trigger)==null||_e.focus({preventScroll:!0}),fe.preventDefault()}),children:c.jsx(lo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:u,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:c.jsx(he,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:fe=>fe.preventDefault(),...R,...ve,onPlaced:()=>ue(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Re(R.onKeyDown,fe=>{const _e=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!_e&&fe.key.length===1&&G(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let Te=V().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const Me=fe.target,Ge=Te.indexOf(Me);Te=Te.slice(Ge+1)}setTimeout(()=>k(Te)),fe.preventDefault()}})})})})})})});YN.displayName=aV;var iV="SelectItemAlignedPosition",KN=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...i}=e,o=mi(to,n),u=pi(to,n),[f,h]=g.useState(null),[m,v]=g.useState(null),b=xt(t,L=>v(L)),y=Am(n),S=g.useRef(!1),w=g.useRef(!0),{viewport:E,selectedItem:C,selectedItemText:R,focusSelectedItem:T}=u,N=g.useCallback(()=>{if(o.trigger&&o.valueNode&&f&&m&&E&&C&&R){const L=o.trigger.getBoundingClientRect(),H=m.getBoundingClientRect(),X=o.valueNode.getBoundingClientRect(),re=R.getBoundingClientRect();if(o.dir!=="rtl"){const Me=re.left-H.left,Ge=X.left-Me,Yt=L.left-Ge,zt=L.width+Yt,Rr=Math.max(zt,H.width),Yr=window.innerWidth-aa,en=PC(Ge,[aa,Math.max(aa,Yr-Rr)]);f.style.minWidth=zt+"px",f.style.left=en+"px"}else{const Me=H.right-re.right,Ge=window.innerWidth-X.right-Me,Yt=window.innerWidth-L.right-Ge,zt=L.width+Yt,Rr=Math.max(zt,H.width),Yr=window.innerWidth-aa,en=PC(Ge,[aa,Math.max(aa,Yr-Rr)]);f.style.minWidth=zt+"px",f.style.right=en+"px"}const me=y(),V=window.innerHeight-aa*2,le=E.scrollHeight,ue=window.getComputedStyle(m),ne=parseInt(ue.borderTopWidth,10),k=parseInt(ue.paddingTop,10),Z=parseInt(ue.borderBottomWidth,10),$=parseInt(ue.paddingBottom,10),se=ne+k+le+$+Z,M=Math.min(C.offsetHeight*5,se),G=window.getComputedStyle(E),P=parseInt(G.paddingTop,10),q=parseInt(G.paddingBottom,10),ie=L.top+L.height/2-aa,he=V-ie,ve=C.offsetHeight/2,fe=C.offsetTop+ve,_e=ne+k+fe,be=se-_e;if(_e<=ie){const Me=me.length>0&&C===me[me.length-1].ref.current;f.style.bottom="0px";const Ge=m.clientHeight-E.offsetTop-E.offsetHeight,Yt=Math.max(he,ve+(Me?q:0)+Ge+Z),zt=_e+Yt;f.style.height=zt+"px"}else{const Me=me.length>0&&C===me[0].ref.current;f.style.top="0px";const Yt=Math.max(ie,ne+E.offsetTop+(Me?P:0)+ve)+be;f.style.height=Yt+"px",E.scrollTop=_e-ie+E.offsetTop}f.style.margin=`${aa}px 0`,f.style.minHeight=M+"px",f.style.maxHeight=V+"px",a==null||a(),requestAnimationFrame(()=>S.current=!0)}},[y,o.trigger,o.valueNode,f,m,E,C,R,o.dir,a]);Pn(()=>N(),[N]);const[O,A]=g.useState();Pn(()=>{m&&A(window.getComputedStyle(m).zIndex)},[m]);const D=g.useCallback(L=>{L&&w.current===!0&&(N(),T==null||T(),w.current=!1)},[N,T]);return c.jsx(lV,{scope:n,contentWrapper:f,shouldExpandOnScrollRef:S,onScrollButtonChange:D,children:c.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:c.jsx(We.div,{...i,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});KN.displayName=iV;var oV="SelectPopperPosition",Ty=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:i=aa,...o}=e,u=jm(n);return c.jsx(Hu,{...u,...o,ref:t,align:a,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)"}})});Ty.displayName=oV;var[lV,Kx]=zl(to,{}),Ny="SelectViewport",QN=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...i}=e,o=pi(Ny,n),u=Kx(Ny,n),f=xt(t,o.onViewportChange),h=g.useRef(0);return c.jsxs(c.Fragment,{children:[c.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:a}),c.jsx(Nm.Slot,{scope:n,children:c.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Re(i.onScroll,m=>{const v=m.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:y}=u;if(y!=null&&y.current&&b){const S=Math.abs(h.current-v.scrollTop);if(S>0){const w=window.innerHeight-aa*2,E=parseFloat(b.style.minHeight),C=parseFloat(b.style.height),R=Math.max(E,C);if(R<w){const T=R+S,N=Math.min(w,T),O=T-N;b.style.height=N+"px",b.style.bottom==="0px"&&(v.scrollTop=O>0?O:0,b.style.justifyContent="flex-end")}}}h.current=v.scrollTop})})})]})});QN.displayName=Ny;var XN="SelectGroup",[cV,uV]=zl(XN),WN=g.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,i=jn();return c.jsx(cV,{scope:n,id:i,children:c.jsx(We.div,{role:"group","aria-labelledby":i,...a,ref:t})})});WN.displayName=XN;var JN="SelectLabel",dV=g.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,i=uV(JN,n);return c.jsx(We.div,{id:i.id,...a,ref:t})});dV.displayName=JN;var Uh="SelectItem",[fV,eA]=zl(Uh),tA=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:i=!1,textValue:o,...u}=e,f=mi(Uh,n),h=pi(Uh,n),m=f.value===a,[v,b]=g.useState(o??""),[y,S]=g.useState(!1),w=xt(t,T=>{var N;return(N=h.itemRefCallback)==null?void 0:N.call(h,T,a,i)}),E=jn(),C=g.useRef("touch"),R=()=>{i||(f.onValueChange(a),f.onOpenChange(!1))};if(a==="")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 c.jsx(fV,{scope:n,value:a,disabled:i,textId:E,isSelected:m,onItemTextChange:g.useCallback(T=>{b(N=>N||((T==null?void 0:T.textContent)??"").trim())},[]),children:c.jsx(Nm.ItemSlot,{scope:n,value:a,disabled:i,textValue:v,children:c.jsx(We.div,{role:"option","aria-labelledby":E,"data-highlighted":y?"":void 0,"aria-selected":m&&y,"data-state":m?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:w,onFocus:Re(u.onFocus,()=>S(!0)),onBlur:Re(u.onBlur,()=>S(!1)),onClick:Re(u.onClick,()=>{C.current!=="mouse"&&R()}),onPointerUp:Re(u.onPointerUp,()=>{C.current==="mouse"&&R()}),onPointerDown:Re(u.onPointerDown,T=>{C.current=T.pointerType}),onPointerMove:Re(u.onPointerMove,T=>{var N;C.current=T.pointerType,i?(N=h.onItemLeave)==null||N.call(h):C.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(u.onPointerLeave,T=>{var N;T.currentTarget===document.activeElement&&((N=h.onItemLeave)==null||N.call(h))}),onKeyDown:Re(u.onKeyDown,T=>{var O;((O=h.searchRef)==null?void 0:O.current)!==""&&T.key===" "||(X7.includes(T.key)&&R(),T.key===" "&&T.preventDefault())})})})})});tA.displayName=Uh;var iu="SelectItemText",nA=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:i,...o}=e,u=mi(iu,n),f=pi(iu,n),h=eA(iu,n),m=tV(iu,n),[v,b]=g.useState(null),y=xt(t,R=>b(R),h.onItemTextChange,R=>{var T;return(T=f.itemTextRefCallback)==null?void 0:T.call(f,R,h.value,h.disabled)}),S=v==null?void 0:v.textContent,w=g.useMemo(()=>c.jsx("option",{value:h.value,disabled:h.disabled,children:S},h.value),[h.disabled,h.value,S]),{onNativeOptionAdd:E,onNativeOptionRemove:C}=m;return Pn(()=>(E(w),()=>C(w)),[E,C,w]),c.jsxs(c.Fragment,{children:[c.jsx(We.span,{id:h.textId,...o,ref:y}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren?El.createPortal(o.children,u.valueNode):null]})});nA.displayName=iu;var rA="SelectItemIndicator",aA=g.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return eA(rA,n).isSelected?c.jsx(We.span,{"aria-hidden":!0,...a,ref:t}):null});aA.displayName=rA;var Ay="SelectScrollUpButton",sA=g.forwardRef((e,t)=>{const n=pi(Ay,e.__scopeSelect),a=Kx(Ay,e.__scopeSelect),[i,o]=g.useState(!1),u=xt(t,a.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let f=function(){const m=h.scrollTop>0;o(m)};const h=n.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?c.jsx(oA,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=n;f&&h&&(f.scrollTop=f.scrollTop-h.offsetHeight)}}):null});sA.displayName=Ay;var jy="SelectScrollDownButton",iA=g.forwardRef((e,t)=>{const n=pi(jy,e.__scopeSelect),a=Kx(jy,e.__scopeSelect),[i,o]=g.useState(!1),u=xt(t,a.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let f=function(){const m=h.scrollHeight-h.clientHeight,v=Math.ceil(h.scrollTop)<m;o(v)};const h=n.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?c.jsx(oA,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=n;f&&h&&(f.scrollTop=f.scrollTop+h.offsetHeight)}}):null});iA.displayName=jy;var oA=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...i}=e,o=pi("SelectScrollButton",n),u=g.useRef(null),f=Am(n),h=g.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return g.useEffect(()=>()=>h(),[h]),Pn(()=>{var v;const m=f().find(b=>b.ref.current===document.activeElement);(v=m==null?void 0:m.ref.current)==null||v.scrollIntoView({block:"nearest"})},[f]),c.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Re(i.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(a,50))}),onPointerMove:Re(i.onPointerMove,()=>{var m;(m=o.onItemLeave)==null||m.call(o),u.current===null&&(u.current=window.setInterval(a,50))}),onPointerLeave:Re(i.onPointerLeave,()=>{h()})})}),hV="SelectSeparator",mV=g.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return c.jsx(We.div,{"aria-hidden":!0,...a,ref:t})});mV.displayName=hV;var Dy="SelectArrow",pV=g.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,i=jm(n),o=mi(Dy,n),u=pi(Dy,n);return o.open&&u.position==="popper"?c.jsx(Bu,{...i,...a,ref:t}):null});pV.displayName=Dy;var gV="SelectBubbleInput",lA=g.forwardRef(({__scopeSelect:e,value:t,...n},a)=>{const i=g.useRef(null),o=xt(a,i),u=FN(t);return g.useEffect(()=>{const f=i.current;if(!f)return;const h=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(h,"value").set;if(u!==t&&v){const b=new Event("change",{bubbles:!0});v.call(f,t),f.dispatchEvent(b)}},[u,t]),c.jsx(We.select,{...n,style:{...K1,...n.style},ref:o,defaultValue:t})});lA.displayName=gV;function cA(e){return e===""||e===void 0}function uA(e){const t=Aa(e),n=g.useRef(""),a=g.useRef(0),i=g.useCallback(u=>{const f=n.current+u;t(f),function h(m){n.current=m,window.clearTimeout(a.current),m!==""&&(a.current=window.setTimeout(()=>h(""),1e3))}(f)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,i,o]}function dA(e,t,n){const i=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let u=vV(e,Math.max(o,0));i.length===1&&(u=u.filter(m=>m!==n));const h=u.find(m=>m.textValue.toLowerCase().startsWith(i.toLowerCase()));return h!==n?h:void 0}function vV(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var yV=UN,xV=VN,bV=HN,SV=BN,wV=GN,EV=qN,CV=QN,RV=WN,_V=tA,TV=nA,NV=aA,AV=sA,jV=iA;function Ma({...e}){return c.jsx(yV,{"data-slot":"select",...e})}function Dm({...e}){return c.jsx(RV,{"data-slot":"select-group",...e})}function ka({...e}){return c.jsx(bV,{"data-slot":"select-value",...e})}function La({className:e,size:t="default",children:n,...a}){return c.jsxs(xV,{"data-slot":"select-trigger","data-size":t,className:ye("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[n,c.jsx(SV,{asChild:!0,children:c.jsx(gs,{className:"size-4 opacity-50"})})]})}function Ia({className:e,children:t,position:n="popper",...a}){return c.jsx(wV,{children:c.jsxs(EV,{"data-slot":"select-content",className:ye("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",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,...a,children:[c.jsx(DV,{}),c.jsx(CV,{className:ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),c.jsx(OV,{})]})})}function An({className:e,children:t,...n}){return c.jsxs(_V,{"data-slot":"select-item",className:ye("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(NV,{children:c.jsx(Ta,{className:"size-4"})})}),c.jsx(TV,{children:t})]})}function DV({className:e,...t}){return c.jsx(AV,{"data-slot":"select-scroll-up-button",className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Na,{className:"size-4"})})}function OV({className:e,...t}){return c.jsx(jV,{"data-slot":"select-scroll-down-button",className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(gs,{className:"size-4"})})}var MV="Label",fA=g.forwardRef((e,t)=>c.jsx(We.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())}}));fA.displayName=MV;var kV=fA;function Ht({className:e,...t}){return c.jsx(kV,{"data-slot":"label",className:ye("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const hA=g.createContext(void 0);function LV(){const e=g.useContext(hA);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var Ct=(e=>(e.FETCH_STORAGES_START="FETCH_STORAGES_START",e.FETCH_STORAGES_SUCCESS="FETCH_STORAGES_SUCCESS",e.FETCH_STORAGES_ERROR="FETCH_STORAGES_ERROR",e.FETCH_STORAGE_START="FETCH_STORAGE_START",e.FETCH_STORAGE_SUCCESS="FETCH_STORAGE_SUCCESS",e.FETCH_STORAGE_ERROR="FETCH_STORAGE_ERROR",e.CLEAR_CURRENT_STORAGE="CLEAR_CURRENT_STORAGE",e.CREATE_STORAGE_START="CREATE_STORAGE_START",e.CREATE_STORAGE_SUCCESS="CREATE_STORAGE_SUCCESS",e.CREATE_STORAGE_ERROR="CREATE_STORAGE_ERROR",e.UPDATE_STORAGE_START="UPDATE_STORAGE_START",e.UPDATE_STORAGE_SUCCESS="UPDATE_STORAGE_SUCCESS",e.UPDATE_STORAGE_ERROR="UPDATE_STORAGE_ERROR",e.DELETE_STORAGE_START="DELETE_STORAGE_START",e.DELETE_STORAGE_SUCCESS="DELETE_STORAGE_SUCCESS",e.DELETE_STORAGE_ERROR="DELETE_STORAGE_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(Ct||{});const IV={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function PV(e,t){switch(t.type){case Ct.FETCH_STORAGES_START:case Ct.FETCH_STORAGE_START:case Ct.CREATE_STORAGE_START:case Ct.UPDATE_STORAGE_START:return{...e,error:null};case Ct.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case Ct.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case Ct.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case Ct.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case Ct.UPDATE_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,dataStorages:e.dataStorages.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case Ct.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case Ct.FETCH_STORAGES_ERROR:case Ct.FETCH_STORAGE_ERROR:case Ct.CREATE_STORAGE_ERROR:case Ct.UPDATE_STORAGE_ERROR:case Ct.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case Ct.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case Ct.CLEAR_ERROR:return{...e,error:null};default:return e}}function Qx({children:e}){const[t,n]=g.useReducer(PV,IV);return c.jsx(hA.Provider,{value:{state:t,dispatch:n},children:e})}class FV extends kl{constructor(){super("/data-storages")}async getDataStorages(){return this.get("/")}async getDataStorageById(t){return this.get(`/${t}`)}async createDataStorage(t){return this.post("",t)}async updateDataStorage(t,n){return this.put(`/${t}`,n)}async deleteDataStorage(t){return this.delete(`/${t}`)}}const Wc=new FV;class Av extends kl{constructor(){super("/connectors")}async getAvailableConnectors(){return this.get("/")}async getConnectorSpecification(t){return this.get(`/${t}/specification`)}async getConnectorFields(t){return this.get(`/${t}/fields`)}}function Om(){const{state:e,dispatch:t}=LV(),n=g.useCallback(async()=>{t({type:Ct.FETCH_STORAGES_START});try{const h=await Wc.getDataStorages();t({type:Ct.FETCH_STORAGES_SUCCESS,payload:h.map(s7)})}catch(h){t({type:Ct.FETCH_STORAGES_ERROR,payload:Jn(h)})}},[t]),a=g.useCallback(async h=>{try{const m=await Wc.getDataStorageById(h),v=th(m);t({type:Ct.FETCH_STORAGE_SUCCESS,payload:v})}catch(m){t({type:Ct.FETCH_STORAGE_ERROR,payload:Jn(m)})}},[t]),i=g.useCallback(async h=>{t({type:Ct.CREATE_STORAGE_START});try{const m=i7(h),v=await Wc.createDataStorage(m),b=th(v);return t({type:Ct.CREATE_STORAGE_SUCCESS,payload:b}),b}catch(m){return t({type:Ct.CREATE_STORAGE_ERROR,payload:Jn(m)}),null}},[t]),o=g.useCallback(async(h,m)=>{t({type:Ct.UPDATE_STORAGE_START});try{const v=a7(m),b=await Wc.updateDataStorage(h,v),y=th(b);return t({type:Ct.UPDATE_STORAGE_SUCCESS,payload:y}),y}catch(v){return t({type:Ct.UPDATE_STORAGE_ERROR,payload:Jn(v)}),null}},[t]),u=g.useCallback(async h=>{t({type:Ct.DELETE_STORAGE_START});try{await Wc.deleteDataStorage(h),t({type:Ct.DELETE_STORAGE_SUCCESS,payload:h})}catch(m){t({type:Ct.DELETE_STORAGE_ERROR,payload:Jn(m)})}},[t]),f=g.useCallback(()=>{t({type:Ct.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:a,createDataStorage:i,updateDataStorage:o,deleteDataStorage:u,clearCurrentDataStorage:f}}function UV({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:a,serverError:i}=b7(),{dataStorages:o,loading:u,fetchDataStorages:f}=Om();g.useEffect(()=>{f()},[f]);const h=Fl({resolver:Ul(x7),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""}}),{formState:m}=h,{errors:v}=m,b=async y=>{const S=await n(y);S&&t&&t(S)};return c.jsxs("form",{onSubmit:y=>{h.handleSubmit(b)(y)},className:"space-y-4",children:[i&&c.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:i.message}),c.jsxs("div",{children:[c.jsx(Ht,{htmlFor:"title",className:"mb-1 block text-sm font-medium",children:"Title"}),c.jsx(Ut,{id:"title",...h.register("title"),className:"w-full",disabled:a}),v.title&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:v.title.message})]}),c.jsxs("div",{children:[c.jsx(Ht,{htmlFor:"storageId",className:"mb-1 block text-sm font-medium",children:"Storage"}),c.jsxs(Ma,{onValueChange:y=>{h.setValue("storageId",y,{shouldValidate:!0})},value:h.watch("storageId"),disabled:a||u,children:[c.jsx(La,{className:"w-full",children:c.jsx(ka,{placeholder:"Select a storage"})}),c.jsx(Ia,{children:c.jsxs(Dm,{children:[u&&c.jsx(An,{value:"loading",disabled:!0,children:"Loading..."}),!u&&o.length===0&&c.jsx(An,{value:"empty",disabled:!0,children:"No storages available"}),!u&&o.map(y=>{const S=hi.getInfo(y.type).icon;return c.jsx(An,{value:y.id,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(S,{className:"h-4 w-4"}),c.jsx("span",{children:y.title})]})},y.id)})]})})]}),v.storageId&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:v.storageId.message})]}),c.jsx("div",{className:"pt-2",children:c.jsx(Ue,{type:"submit",disabled:a,variant:"default",children:a?"Saving...":"Create"})})]})}function zV({title:e,onUpdate:t,className:n,errorMessage:a="Title cannot be empty",minWidth:i="200px"}){const[o,u]=g.useState(e),[f,h]=g.useState(!1),m=g.useRef(null);g.useEffect(()=>{u(e)},[e]),g.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${String(m.current.scrollHeight)}px`)},[o]);const v=async()=>{if(o.trim()===""){u(e);return}if(o.trim()!==e)try{h(!0),await t(o.trim())}catch(y){u(e),console.error(y)}finally{h(!1)}},b=y=>{if(y.key==="Enter"&&!y.shiftKey){if(y.preventDefault(),o.trim()===""){Mh.error(a),u(e);return}v()}else y.key==="Escape"&&u(e)};return c.jsx("h2",{className:ye("m-0 cursor-pointer p-0 hover:opacity-80",n),children:c.jsx(Cu,{ref:m,value:o,onChange:y=>{u(y.target.value);const S=y.target;S.style.height="auto",S.style.height=`${String(S.scrollHeight)}px`},onBlur:()=>void v(),onKeyDown:b,className:ye("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":f}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:i},disabled:f})})}function VV({id:e}){const t=ku(),{dataMart:n,deleteDataMart:a,updateDataMartTitle:i,updateDataMartDescription:o,updateDataMartDefinition:u,publishDataMart:f,runDataMart:h,isLoading:m,error:v,getErrorMessage:b}=S7(e),[y,S]=g.useState(!1),[w,E]=g.useState(!1),C=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"}],R=async O=>{n&&await i(n.id,O)},T=async()=>{if(n){E(!0);try{await f(n.id),Jt.success("Data mart published successfully")}catch(O){Jt.error(O instanceof Error?O.message:"Failed to publish data mart")}finally{E(!1)}}},N=async()=>{n&&await h(n.id)};return n?c.jsxs("div",{className:"px-12 py-6",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center",children:[c.jsx("button",{onClick:()=>void t("/data-marts"),className:"rounded p-1 hover:bg-gray-100",title:"Back to Data Marts",children:c.jsx(d4,{className:"h-5 w-5 text-gray-400"})}),c.jsx(zV,{title:n.title,onUpdate:R,className:"text-xl font-medium"})]}),c.jsxs("div",{className:"flex items-center gap-2"+(w?" opacity-50":""),style:{minWidth:"120px"},children:[c.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx("div",{children:c.jsx(HT,{type:n.status.code===Nn.PUBLISHED?Ur.SUCCESS:Ur.NEUTRAL,variant:"subtle",children:n.status.displayName})})}),c.jsx(ln,{children:n.status.code===Nn.PUBLISHED?"Published data mart is available for scheduled runs":"Draft data mart is not available for scheduled runs. Publish to make it available"})]}),n.status.code===Nn.DRAFT&&c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx("div",{children:c.jsxs(Cy,{variant:"default",onClick:()=>{T()},disabled:w||!n.canPublish,className:"ml-2 flex items-center gap-1",children:[c.jsx(Wy,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!n.canPublish&&c.jsxs(ln,{children:[c.jsx("div",{children:"Data mart cannot be published. Please fix the validation issues:"}),n.validationErrors.length>0&&c.jsx("ul",{className:"mt-2 list-disc pl-5",children:SU(n.validationErrors).map((O,A)=>c.jsx("li",{children:O},A))})]})]})]}),c.jsxs(Gr,{children:[c.jsx(qr,{asChild:!0,children:c.jsx("button",{className:"rounded p-1 hover:bg-gray-100",children:c.jsx(F4,{className:"h-5 w-5"})})}),c.jsxs(Cr,{align:"end",children:[n.status.code===Nn.PUBLISHED&&n.definitionType===Xe.CONNECTOR&&c.jsxs(Zt,{className:"text-blue-600",onClick:()=>{N()},children:[c.jsx(UR,{className:"mr-2 h-4 w-4"}),"Manual Run"]}),c.jsxs(Zt,{className:"text-red-600",onClick:()=>{S(!0)},children:[c.jsx(tx,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})]}),c.jsx("div",{children:c.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:C.map(O=>c.jsx(ch,{to:O.path,className:({isActive:A})=>ye("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",A?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:O.name},O.name))})}),c.jsx("div",{className:"pt-4",children:c.jsx(wR,{context:{dataMart:n,isLoading:m,error:v,getErrorMessage:b,updateDataMartDescription:o,updateDataMartDefinition:u}})}),c.jsx(po,{open:y,onOpenChange:S,title:"Delete Data Mart",description:c.jsxs(c.Fragment,{children:["Are you sure you want to delete ",c.jsxs("strong",{children:['"',n.title,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await a(n.id),S(!1),t("/data-marts")}catch(O){console.error("Failed to delete data mart:",O)}})()}})]}):c.jsx("div",{className:"p-4",children:"No data mart found"})}function $V({description:e,onUpdate:t,className:n,placeholder:a="Add description...",minWidth:i="100%",minHeight:o="100px"}){const[u,f]=g.useState(e??""),[h,m]=g.useState(!1),[v,b]=g.useState(!1),y=g.useRef(null);g.useEffect(()=>{f(e??"")},[e]),g.useEffect(()=>{if(y.current&&h){y.current.focus();const R=y.current.value.length;y.current.setSelectionRange(R,R),S(y.current)}},[h]);const S=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},w=R=>{f(R.target.value),S(R.target)},E=async()=>{const R=u.trim();if(R===(e??"")){m(!1);return}try{b(!0),await t(R===""?null:R),m(!1),Mh.success("Description updated")}catch(N){console.error("Failed to update description:",N),Mh.error("Failed to update description"),f(e??"")}finally{b(!1)}},C=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),E()):R.key==="Escape"&&(R.preventDefault(),f(e??""),m(!1))};return h?c.jsxs("div",{className:"w-full",children:[c.jsx(Cu,{ref:y,value:u,onChange:w,onBlur:()=>void E(),onKeyDown:C,placeholder:a,className:ye("m-0 w-full border-0 bg-white p-2 shadow-none dark:bg-white/4","focus-visible:ring-primary focus-visible:ring-0",{"opacity-50":v}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:o,minWidth:i},disabled:v}),c.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[c.jsxs("span",{children:["Press"," ",c.jsx("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-1 py-0.5 font-sans",children:"Ctrl+Enter"})," ","to save •"," "]}),c.jsxs("span",{children:[c.jsx("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-1 py-0.5 font-sans",children:"Esc"})," ","to cancel •"," "]}),c.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):c.jsx("div",{className:"flex w-full items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:c.jsx("div",{onClick:()=>{m(!0)},className:ye("min-h-24 cursor-pointer rounded p-2 whitespace-pre-wrap","transition-colors duration-150",!e&&"text-gray-400 italic",n),style:{minWidth:i},children:e??a})})}function HV(){const{dataMart:e,updateDataMartDescription:t}=Lu(),n=async a=>{await t(e.id,a)};return c.jsxs("div",{children:[c.jsx(OT,{}),c.jsx($V,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})]})}function BV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,a)}return n}function UC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FC(Object(n),!0).forEach(function(a){BV(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FC(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function GV(e,t){if(e==null)return{};var n={},a=Object.keys(e),i,o;for(o=0;o<a.length;o++)i=a[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function qV(e,t){if(e==null)return{};var n=GV(e,t),a,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)a=o[i],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function ZV(e,t){return YV(e)||KV(e,t)||QV(e,t)||XV()}function YV(e){if(Array.isArray(e))return e}function KV(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],a=!0,i=!1,o=void 0;try{for(var u=e[Symbol.iterator](),f;!(a=(f=u.next()).done)&&(n.push(f.value),!(t&&n.length===t));a=!0);}catch(h){i=!0,o=h}finally{try{!a&&u.return!=null&&u.return()}finally{if(i)throw o}}return n}}function QV(e,t){if(e){if(typeof e=="string")return zC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zC(e,t)}}function zC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function XV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
588
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,a)}return n}function $C(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VC(Object(n),!0).forEach(function(a){WV(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VC(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function JV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(a){return t.reduceRight(function(i,o){return o(i)},a)}}function ou(e){return function t(){for(var n=this,a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var u=arguments.length,f=new Array(u),h=0;h<u;h++)f[h]=arguments[h];return t.apply(n,[].concat(i,f))}}}function zh(e){return{}.toString.call(e).includes("Object")}function e$(e){return!Object.keys(e).length}function Au(e){return typeof e=="function"}function t$(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n$(e,t){return zh(t)||ni("changeType"),Object.keys(t).some(function(n){return!t$(e,n)})&&ni("changeField"),t}function r$(e){Au(e)||ni("selectorType")}function a$(e){Au(e)||zh(e)||ni("handlerType"),zh(e)&&Object.values(e).some(function(t){return!Au(t)})&&ni("handlersType")}function s$(e){e||ni("initialIsRequired"),zh(e)||ni("initialType"),e$(e)&&ni("initialContent")}function i$(e,t){throw new Error(e[t]||e.default)}var o$={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ni=ou(i$)(o$),Vf={changes:n$,selector:r$,handler:a$,initial:s$};function l$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Vf.initial(e),Vf.handler(t);var n={current:e},a=ou(d$)(n,t),i=ou(u$)(n),o=ou(Vf.changes)(e),u=ou(c$)(n);function f(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(v){return v};return Vf.selector(m),m(n.current)}function h(m){JV(a,i,o,u)(m)}return[f,h]}function c$(e,t){return Au(t)?t(e.current):t}function u$(e,t){return e.current=$C($C({},e.current),t),t}function d$(e,t,n){return Au(t)?t(e.current):Object.keys(n).forEach(function(a){var i;return(i=t[a])===null||i===void 0?void 0:i.call(t,e.current[a])}),n}var f$={create:l$},h$={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function m$(e){return function t(){for(var n=this,a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var u=arguments.length,f=new Array(u),h=0;h<u;h++)f[h]=arguments[h];return t.apply(n,[].concat(i,f))}}}function p$(e){return{}.toString.call(e).includes("Object")}function g$(e){return e||HC("configIsRequired"),p$(e)||HC("configType"),e.urls?(v$(),{paths:{vs:e.urls.monacoBase}}):e}function v$(){console.warn(mA.deprecation)}function y$(e,t){throw new Error(e[t]||e.default)}var mA={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
589
|
+
You are using deprecated way of configuration.
|
|
590
|
+
|
|
591
|
+
Instead of using
|
|
592
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
593
|
+
use
|
|
594
|
+
monaco.config({ paths: { vs: '...' } })
|
|
595
|
+
|
|
596
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
597
|
+
`},HC=m$(y$)(mA),x$={config:g$},b$=function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return function(i){return n.reduceRight(function(o,u){return u(o)},i)}};function pA(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],pA(e[n],t[n]))}),UC(UC({},e),t)}var S$={type:"cancelation",msg:"operation is manually canceled"};function jv(e){var t=!1,n=new Promise(function(a,i){e.then(function(o){return t?i(S$):a(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var w$=f$.create({config:h$,isInitialized:!1,resolve:null,reject:null,monaco:null}),gA=ZV(w$,2),ud=gA[0],Mm=gA[1];function E$(e){var t=x$.config(e),n=t.monaco,a=qV(t,["monaco"]);Mm(function(i){return{config:pA(i.config,a),monaco:n}})}function C$(){var e=ud(function(t){var n=t.monaco,a=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:a,resolve:i}});if(!e.isInitialized){if(Mm({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),jv(Dv);if(window.monaco&&window.monaco.editor)return vA(window.monaco),e.resolve(window.monaco),jv(Dv);b$(R$,T$)(N$)}return jv(Dv)}function R$(e){return document.body.appendChild(e)}function _$(e){var t=document.createElement("script");return e&&(t.src=e),t}function T$(e){var t=ud(function(a){var i=a.config,o=a.reject;return{config:i,reject:o}}),n=_$("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function N$(){var e=ud(function(n){var a=n.config,i=n.resolve,o=n.reject;return{config:a,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){vA(n),e.resolve(n)},function(n){e.reject(n)})}function vA(e){ud().monaco||Mm({monaco:e})}function A$(){return ud(function(e){var t=e.monaco;return t})}var Dv=new Promise(function(e,t){return Mm({resolve:e,reject:t})}),yA={config:E$,init:C$,__getMonacoInstance:A$},j$={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ov=j$,D$={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},O$=D$;function M$({children:e}){return ot.createElement("div",{style:O$.container},e)}var k$=M$,L$=k$;function I$({width:e,height:t,isEditorReady:n,loading:a,_ref:i,className:o,wrapperProps:u}){return ot.createElement("section",{style:{...Ov.wrapper,width:e,height:t},...u},!n&&ot.createElement(L$,null,a),ot.createElement("div",{ref:i,style:{...Ov.fullWidth,...!n&&Ov.hide},className:o}))}var P$=I$,xA=g.memo(P$);function F$(e){g.useEffect(e,[])}var bA=F$;function U$(e,t,n=!0){let a=g.useRef(!0);g.useEffect(a.current||!n?()=>{a.current=!1}:e,t)}var hr=U$;function pu(){}function ul(e,t,n,a){return z$(e,a)||V$(e,t,n,a)}function z$(e,t){return e.editor.getModel(SA(e,t))}function V$(e,t,n,a){return e.editor.createModel(t,n,a?SA(e,a):void 0)}function SA(e,t){return e.Uri.parse(t)}function $$({original:e,modified:t,language:n,originalLanguage:a,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:u,keepCurrentOriginalModel:f=!1,keepCurrentModifiedModel:h=!1,theme:m="light",loading:v="Loading...",options:b={},height:y="100%",width:S="100%",className:w,wrapperProps:E={},beforeMount:C=pu,onMount:R=pu}){let[T,N]=g.useState(!1),[O,A]=g.useState(!0),D=g.useRef(null),L=g.useRef(null),H=g.useRef(null),X=g.useRef(R),re=g.useRef(C),me=g.useRef(!1);bA(()=>{let ne=yA.init();return ne.then(k=>(L.current=k)&&A(!1)).catch(k=>(k==null?void 0:k.type)!=="cancelation"&&console.error("Monaco initialization: error:",k)),()=>D.current?ue():ne.cancel()}),hr(()=>{if(D.current&&L.current){let ne=D.current.getOriginalEditor(),k=ul(L.current,e||"",a||n||"text",o||"");k!==ne.getModel()&&ne.setModel(k)}},[o],T),hr(()=>{if(D.current&&L.current){let ne=D.current.getModifiedEditor(),k=ul(L.current,t||"",i||n||"text",u||"");k!==ne.getModel()&&ne.setModel(k)}},[u],T),hr(()=>{let ne=D.current.getModifiedEditor();ne.getOption(L.current.editor.EditorOption.readOnly)?ne.setValue(t||""):t!==ne.getValue()&&(ne.executeEdits("",[{range:ne.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),ne.pushUndoStop())},[t],T),hr(()=>{var ne,k;(k=(ne=D.current)==null?void 0:ne.getModel())==null||k.original.setValue(e||"")},[e],T),hr(()=>{let{original:ne,modified:k}=D.current.getModel();L.current.editor.setModelLanguage(ne,a||n||"text"),L.current.editor.setModelLanguage(k,i||n||"text")},[n,a,i],T),hr(()=>{var ne;(ne=L.current)==null||ne.editor.setTheme(m)},[m],T),hr(()=>{var ne;(ne=D.current)==null||ne.updateOptions(b)},[b],T);let V=g.useCallback(()=>{var Z;if(!L.current)return;re.current(L.current);let ne=ul(L.current,e||"",a||n||"text",o||""),k=ul(L.current,t||"",i||n||"text",u||"");(Z=D.current)==null||Z.setModel({original:ne,modified:k})},[n,t,i,e,a,o,u]),le=g.useCallback(()=>{var ne;!me.current&&H.current&&(D.current=L.current.editor.createDiffEditor(H.current,{automaticLayout:!0,...b}),V(),(ne=L.current)==null||ne.editor.setTheme(m),N(!0),me.current=!0)},[b,m,V]);g.useEffect(()=>{T&&X.current(D.current,L.current)},[T]),g.useEffect(()=>{!O&&!T&&le()},[O,T,le]);function ue(){var k,Z,$,se;let ne=(k=D.current)==null?void 0:k.getModel();f||((Z=ne==null?void 0:ne.original)==null||Z.dispose()),h||(($=ne==null?void 0:ne.modified)==null||$.dispose()),(se=D.current)==null||se.dispose()}return ot.createElement(xA,{width:S,height:y,isEditorReady:T,loading:v,_ref:H,className:w,wrapperProps:E})}var H$=$$;g.memo(H$);function B$(e){let t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}var G$=B$,$f=new Map;function q$({defaultValue:e,defaultLanguage:t,defaultPath:n,value:a,language:i,path:o,theme:u="light",line:f,loading:h="Loading...",options:m={},overrideServices:v={},saveViewState:b=!0,keepCurrentModel:y=!1,width:S="100%",height:w="100%",className:E,wrapperProps:C={},beforeMount:R=pu,onMount:T=pu,onChange:N,onValidate:O=pu}){let[A,D]=g.useState(!1),[L,H]=g.useState(!0),X=g.useRef(null),re=g.useRef(null),me=g.useRef(null),V=g.useRef(T),le=g.useRef(R),ue=g.useRef(),ne=g.useRef(a),k=G$(o),Z=g.useRef(!1),$=g.useRef(!1);bA(()=>{let G=yA.init();return G.then(P=>(X.current=P)&&H(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>re.current?M():G.cancel()}),hr(()=>{var P,q,ie,he;let G=ul(X.current,e||a||"",t||i||"",o||n||"");G!==((P=re.current)==null?void 0:P.getModel())&&(b&&$f.set(k,(q=re.current)==null?void 0:q.saveViewState()),(ie=re.current)==null||ie.setModel(G),b&&((he=re.current)==null||he.restoreViewState($f.get(o))))},[o],A),hr(()=>{var G;(G=re.current)==null||G.updateOptions(m)},[m],A),hr(()=>{!re.current||a===void 0||(re.current.getOption(X.current.editor.EditorOption.readOnly)?re.current.setValue(a):a!==re.current.getValue()&&($.current=!0,re.current.executeEdits("",[{range:re.current.getModel().getFullModelRange(),text:a,forceMoveMarkers:!0}]),re.current.pushUndoStop(),$.current=!1))},[a],A),hr(()=>{var P,q;let G=(P=re.current)==null?void 0:P.getModel();G&&i&&((q=X.current)==null||q.editor.setModelLanguage(G,i))},[i],A),hr(()=>{var G;f!==void 0&&((G=re.current)==null||G.revealLine(f))},[f],A),hr(()=>{var G;(G=X.current)==null||G.editor.setTheme(u)},[u],A);let se=g.useCallback(()=>{var G;if(!(!me.current||!X.current)&&!Z.current){le.current(X.current);let P=o||n,q=ul(X.current,a||e||"",t||i||"",P||"");re.current=(G=X.current)==null?void 0:G.editor.create(me.current,{model:q,automaticLayout:!0,...m},v),b&&re.current.restoreViewState($f.get(P)),X.current.editor.setTheme(u),f!==void 0&&re.current.revealLine(f),D(!0),Z.current=!0}},[e,t,n,a,i,o,m,v,b,u,f]);g.useEffect(()=>{A&&V.current(re.current,X.current)},[A]),g.useEffect(()=>{!L&&!A&&se()},[L,A,se]),ne.current=a,g.useEffect(()=>{var G,P;A&&N&&((G=ue.current)==null||G.dispose(),ue.current=(P=re.current)==null?void 0:P.onDidChangeModelContent(q=>{$.current||N(re.current.getValue(),q)}))},[A,N]),g.useEffect(()=>{if(A){let G=X.current.editor.onDidChangeMarkers(P=>{var ie;let q=(ie=re.current.getModel())==null?void 0:ie.uri;if(q&&P.find(he=>he.path===q.path)){let he=X.current.editor.getModelMarkers({resource:q});O==null||O(he)}});return()=>{G==null||G.dispose()}}return()=>{}},[A,O]);function M(){var G,P;(G=ue.current)==null||G.dispose(),y?b&&$f.set(o,re.current.saveViewState()):(P=re.current.getModel())==null||P.dispose(),re.current.dispose()}return ot.createElement(xA,{width:S,height:w,isEditorReady:A,loading:h,_ref:me,className:E,wrapperProps:C})}var Z$=q$,Y$=g.memo(Z$);function K$({initialValue:e,onChange:t}){const[n,a]=g.useState((e==null?void 0:e.sqlQuery)??""),{theme:i}=l_();g.useEffect(()=>{e!=null&&e.sqlQuery&&e.sqlQuery!==n&&a(e.sqlQuery)},[e,n]);function o(u){u!==void 0&&(a(u),t({sqlQuery:u}))}return c.jsx("div",{className:"shadow-xs",children:c.jsx(Y$,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:o,theme:i==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function Oy({icon:e,title:t,subtitle:n,rightContent:a,onClick:i,className:o}){const u=e;return c.jsxs("div",{className:ye("group flex items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",i&&"cursor-pointer dark:hover:bg-white/5",o),onClick:i,children:[c.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&c.jsx("div",{className:"flex items-center justify-center",children:c.jsx(u,{className:"h-6 w-6"})}),c.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[c.jsx("div",{className:"text-md font-medium",children:t}),n&&c.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),c.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[a,c.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-gray-700/25",children:c.jsx(Xy,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var BC=1,Q$=.9,X$=.8,W$=.17,Mv=.1,kv=.999,J$=.9999,eH=.99,tH=/[\\\/_+.#"@\[\(\{&]/,nH=/[\\\/_+.#"@\[\(\{&]/g,rH=/[\s-]/,wA=/[\s-]/g;function My(e,t,n,a,i,o,u){if(o===t.length)return i===e.length?BC:eH;var f=`${i},${o}`;if(u[f]!==void 0)return u[f];for(var h=a.charAt(o),m=n.indexOf(h,i),v=0,b,y,S,w;m>=0;)b=My(e,t,n,a,m+1,o+1,u),b>v&&(m===i?b*=BC:tH.test(e.charAt(m-1))?(b*=X$,S=e.slice(i,m-1).match(nH),S&&i>0&&(b*=Math.pow(kv,S.length))):rH.test(e.charAt(m-1))?(b*=Q$,w=e.slice(i,m-1).match(wA),w&&i>0&&(b*=Math.pow(kv,w.length))):(b*=W$,i>0&&(b*=Math.pow(kv,m-i))),e.charAt(m)!==t.charAt(o)&&(b*=J$)),(b<Mv&&n.charAt(m-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(m-1)!==a.charAt(o))&&(y=My(e,t,n,a,m+1,o+2,u),y*Mv>b&&(b=y*Mv)),b>v&&(v=b),m=n.indexOf(h,m+1);return u[f]=v,v}function GC(e){return e.toLowerCase().replace(wA," ")}function aH(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,My(e,t,GC(e),GC(t),0,0,{})}var Jc='[cmdk-group=""]',Lv='[cmdk-group-items=""]',sH='[cmdk-group-heading=""]',EA='[cmdk-item=""]',qC=`${EA}:not([aria-disabled="true"])`,ky="cmdk-item-select",ll="data-value",iH=(e,t,n)=>aH(e,t,n),CA=g.createContext(void 0),dd=()=>g.useContext(CA),RA=g.createContext(void 0),Xx=()=>g.useContext(RA),_A=g.createContext(void 0),TA=g.forwardRef((e,t)=>{let n=cl(()=>{var P,q;return{search:"",value:(q=(P=e.value)!=null?P:e.defaultValue)!=null?q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=cl(()=>new Set),i=cl(()=>new Map),o=cl(()=>new Map),u=cl(()=>new Set),f=NA(e),{label:h,children:m,value:v,onValueChange:b,filter:y,shouldFilter:S,loop:w,disablePointerSelection:E=!1,vimBindings:C=!0,...R}=e,T=jn(),N=jn(),O=jn(),A=g.useRef(null),D=vH();no(()=>{if(v!==void 0){let P=v.trim();n.current.value=P,L.emit()}},[v]),no(()=>{D(6,le)},[]);let L=g.useMemo(()=>({subscribe:P=>(u.current.add(P),()=>u.current.delete(P)),snapshot:()=>n.current,setState:(P,q,ie)=>{var he,ve,fe,_e;if(!Object.is(n.current[P],q)){if(n.current[P]=q,P==="search")V(),re(),D(1,me);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let be=document.getElementById(O);be?be.focus():(he=document.getElementById(T))==null||he.focus()}if(D(7,()=>{var be;n.current.selectedItemId=(be=ue())==null?void 0:be.id,L.emit()}),ie||D(5,le),((ve=f.current)==null?void 0:ve.value)!==void 0){let be=q??"";(_e=(fe=f.current).onValueChange)==null||_e.call(fe,be);return}}L.emit()}},emit:()=>{u.current.forEach(P=>P())}}),[]),H=g.useMemo(()=>({value:(P,q,ie)=>{var he;q!==((he=o.current.get(P))==null?void 0:he.value)&&(o.current.set(P,{value:q,keywords:ie}),n.current.filtered.items.set(P,X(q,ie)),D(2,()=>{re(),L.emit()}))},item:(P,q)=>(a.current.add(P),q&&(i.current.has(q)?i.current.get(q).add(P):i.current.set(q,new Set([P]))),D(3,()=>{V(),re(),n.current.value||me(),L.emit()}),()=>{o.current.delete(P),a.current.delete(P),n.current.filtered.items.delete(P);let ie=ue();D(4,()=>{V(),(ie==null?void 0:ie.getAttribute("id"))===P&&me(),L.emit()})}),group:P=>(i.current.has(P)||i.current.set(P,new Set),()=>{o.current.delete(P),i.current.delete(P)}),filter:()=>f.current.shouldFilter,label:h||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:T,inputId:O,labelId:N,listInnerRef:A}),[]);function X(P,q){var ie,he;let ve=(he=(ie=f.current)==null?void 0:ie.filter)!=null?he:iH;return P?ve(P,n.current.search,q):0}function re(){if(!n.current.search||f.current.shouldFilter===!1)return;let P=n.current.filtered.items,q=[];n.current.filtered.groups.forEach(he=>{let ve=i.current.get(he),fe=0;ve.forEach(_e=>{let be=P.get(_e);fe=Math.max(be,fe)}),q.push([he,fe])});let ie=A.current;ne().sort((he,ve)=>{var fe,_e;let be=he.getAttribute("id"),Te=ve.getAttribute("id");return((fe=P.get(Te))!=null?fe:0)-((_e=P.get(be))!=null?_e:0)}).forEach(he=>{let ve=he.closest(Lv);ve?ve.appendChild(he.parentElement===ve?he:he.closest(`${Lv} > *`)):ie.appendChild(he.parentElement===ie?he:he.closest(`${Lv} > *`))}),q.sort((he,ve)=>ve[1]-he[1]).forEach(he=>{var ve;let fe=(ve=A.current)==null?void 0:ve.querySelector(`${Jc}[${ll}="${encodeURIComponent(he[0])}"]`);fe==null||fe.parentElement.appendChild(fe)})}function me(){let P=ne().find(ie=>ie.getAttribute("aria-disabled")!=="true"),q=P==null?void 0:P.getAttribute(ll);L.setState("value",q||void 0)}function V(){var P,q,ie,he;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ve=0;for(let fe of a.current){let _e=(q=(P=o.current.get(fe))==null?void 0:P.value)!=null?q:"",be=(he=(ie=o.current.get(fe))==null?void 0:ie.keywords)!=null?he:[],Te=X(_e,be);n.current.filtered.items.set(fe,Te),Te>0&&ve++}for(let[fe,_e]of i.current)for(let be of _e)if(n.current.filtered.items.get(be)>0){n.current.filtered.groups.add(fe);break}n.current.filtered.count=ve}function le(){var P,q,ie;let he=ue();he&&(((P=he.parentElement)==null?void 0:P.firstChild)===he&&((ie=(q=he.closest(Jc))==null?void 0:q.querySelector(sH))==null||ie.scrollIntoView({block:"nearest"})),he.scrollIntoView({block:"nearest"}))}function ue(){var P;return(P=A.current)==null?void 0:P.querySelector(`${EA}[aria-selected="true"]`)}function ne(){var P;return Array.from(((P=A.current)==null?void 0:P.querySelectorAll(qC))||[])}function k(P){let q=ne()[P];q&&L.setState("value",q.getAttribute(ll))}function Z(P){var q;let ie=ue(),he=ne(),ve=he.findIndex(_e=>_e===ie),fe=he[ve+P];(q=f.current)!=null&&q.loop&&(fe=ve+P<0?he[he.length-1]:ve+P===he.length?he[0]:he[ve+P]),fe&&L.setState("value",fe.getAttribute(ll))}function $(P){let q=ue(),ie=q==null?void 0:q.closest(Jc),he;for(;ie&&!he;)ie=P>0?pH(ie,Jc):gH(ie,Jc),he=ie==null?void 0:ie.querySelector(qC);he?L.setState("value",he.getAttribute(ll)):Z(P)}let se=()=>k(ne().length-1),M=P=>{P.preventDefault(),P.metaKey?se():P.altKey?$(1):Z(1)},G=P=>{P.preventDefault(),P.metaKey?k(0):P.altKey?$(-1):Z(-1)};return g.createElement(We.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:P=>{var q;(q=R.onKeyDown)==null||q.call(R,P);let ie=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||ie))switch(P.key){case"n":case"j":{C&&P.ctrlKey&&M(P);break}case"ArrowDown":{M(P);break}case"p":case"k":{C&&P.ctrlKey&&G(P);break}case"ArrowUp":{G(P);break}case"Home":{P.preventDefault(),k(0);break}case"End":{P.preventDefault(),se();break}case"Enter":{P.preventDefault();let he=ue();if(he){let ve=new Event(ky);he.dispatchEvent(ve)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:H.inputId,id:H.labelId,style:xH},h),km(e,P=>g.createElement(RA.Provider,{value:L},g.createElement(CA.Provider,{value:H},P))))}),oH=g.forwardRef((e,t)=>{var n,a;let i=jn(),o=g.useRef(null),u=g.useContext(_A),f=dd(),h=NA(e),m=(a=(n=h.current)==null?void 0:n.forceMount)!=null?a:u==null?void 0:u.forceMount;no(()=>{if(!m)return f.item(i,u==null?void 0:u.id)},[m]);let v=AA(i,o,[e.value,e.children,o],e.keywords),b=Xx(),y=ci(D=>D.value&&D.value===v.current),S=ci(D=>m||f.filter()===!1?!0:D.search?D.filtered.items.get(i)>0:!0);g.useEffect(()=>{let D=o.current;if(!(!D||e.disabled))return D.addEventListener(ky,w),()=>D.removeEventListener(ky,w)},[S,e.onSelect,e.disabled]);function w(){var D,L;E(),(L=(D=h.current).onSelect)==null||L.call(D,v.current)}function E(){b.setState("value",v.current,!0)}if(!S)return null;let{disabled:C,value:R,onSelect:T,forceMount:N,keywords:O,...A}=e;return g.createElement(We.div,{ref:us(o,t),...A,id:i,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!y,"data-disabled":!!C,"data-selected":!!y,onPointerMove:C||f.getDisablePointerSelection()?void 0:E,onClick:C?void 0:w},e.children)}),lH=g.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:i,...o}=e,u=jn(),f=g.useRef(null),h=g.useRef(null),m=jn(),v=dd(),b=ci(S=>i||v.filter()===!1?!0:S.search?S.filtered.groups.has(u):!0);no(()=>v.group(u),[]),AA(u,f,[e.value,e.heading,h]);let y=g.useMemo(()=>({id:u,forceMount:i}),[i]);return g.createElement(We.div,{ref:us(f,t),...o,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},n&&g.createElement("div",{ref:h,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),km(e,S=>g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},g.createElement(_A.Provider,{value:y},S))))}),cH=g.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,i=g.useRef(null),o=ci(u=>!u.search);return!n&&!o?null:g.createElement(We.div,{ref:us(i,t),...a,"cmdk-separator":"",role:"separator"})}),uH=g.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,i=e.value!=null,o=Xx(),u=ci(m=>m.search),f=ci(m=>m.selectedItemId),h=dd();return g.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),g.createElement(We.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,"aria-activedescendant":f,id:h.inputId,type:"text",value:i?e.value:u,onChange:m=>{i||o.setState("search",m.target.value),n==null||n(m.target.value)}})}),dH=g.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...i}=e,o=g.useRef(null),u=g.useRef(null),f=ci(m=>m.selectedItemId),h=dd();return g.useEffect(()=>{if(u.current&&o.current){let m=u.current,v=o.current,b,y=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let S=m.offsetHeight;v.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return y.observe(m),()=>{cancelAnimationFrame(b),y.unobserve(m)}}},[]),g.createElement(We.div,{ref:us(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:h.listId},km(e,m=>g.createElement("div",{ref:us(u,h.listInnerRef),"cmdk-list-sizer":""},m)))}),fH=g.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:i,contentClassName:o,container:u,...f}=e;return g.createElement(Jh,{open:n,onOpenChange:a},g.createElement(em,{container:u},g.createElement(tm,{"cmdk-overlay":"",className:i}),g.createElement(nm,{"aria-label":e.label,"cmdk-dialog":"",className:o},g.createElement(TA,{ref:t,...f}))))}),hH=g.forwardRef((e,t)=>ci(n=>n.filtered.count===0)?g.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),mH=g.forwardRef((e,t)=>{let{progress:n,children:a,label:i="Loading...",...o}=e;return g.createElement(We.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},km(e,u=>g.createElement("div",{"aria-hidden":!0},u)))}),Vl=Object.assign(TA,{List:dH,Item:oH,Input:uH,Group:lH,Separator:cH,Dialog:fH,Empty:hH,Loading:mH});function pH(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function gH(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function NA(e){let t=g.useRef(e);return no(()=>{t.current=e}),t}var no=typeof window>"u"?g.useEffect:g.useLayoutEffect;function cl(e){let t=g.useRef();return t.current===void 0&&(t.current=e()),t}function ci(e){let t=Xx(),n=()=>e(t.snapshot());return g.useSyncExternalStore(t.subscribe,n,n)}function AA(e,t,n,a=[]){let i=g.useRef(),o=dd();return no(()=>{var u;let f=(()=>{var m;for(let v of n){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(m=v.current.textContent)==null?void 0:m.trim():i.current}})(),h=a.map(m=>m.trim());o.value(e,f,h),(u=t.current)==null||u.setAttribute(ll,f),i.current=f}),i}var vH=()=>{let[e,t]=g.useState(),n=cl(()=>new Map);return no(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,i)=>{n.current.set(a,i),t({})}};function yH(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function km({asChild:e,children:t},n){return e&&g.isValidElement(t)?g.cloneElement(yH(t),{ref:t.ref},n(t.props.children)):n(t)}var xH={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function jA({className:e,...t}){return c.jsx(Vl,{"data-slot":"command",className:ye("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function DA({className:e,...t}){return c.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[c.jsx(oo,{className:"size-4 shrink-0 opacity-50"}),c.jsx(Vl.Input,{"data-slot":"command-input",className:ye("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function bH({className:e,...t}){return c.jsx(Vl.List,{"data-slot":"command-list",className:ye("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function OA({...e}){return c.jsx(Vl.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function MA({className:e,...t}){return c.jsx(Vl.Group,{"data-slot":"command-group",className:ye("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function kA({className:e,...t}){return c.jsx(Vl.Item,{"data-slot":"command-item",className:ye("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Lm="Popover",[LA,sZ]=Br(Lm,[Ua]),fd=Ua(),[SH,gi]=LA(Lm),IA=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:i,onOpenChange:o,modal:u=!1}=e,f=fd(t),h=g.useRef(null),[m,v]=g.useState(!1),[b,y]=ds({prop:a,defaultProp:i??!1,onChange:o,caller:Lm});return c.jsx($u,{...f,children:c.jsx(SH,{scope:t,contentId:jn(),triggerRef:h,open:b,onOpenChange:y,onOpenToggle:g.useCallback(()=>y(S=>!S),[y]),hasCustomAnchor:m,onCustomAnchorAdd:g.useCallback(()=>v(!0),[]),onCustomAnchorRemove:g.useCallback(()=>v(!1),[]),modal:u,children:n})})};IA.displayName=Lm;var PA="PopoverAnchor",wH=g.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=gi(PA,n),o=fd(n),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return g.useEffect(()=>(u(),()=>f()),[u,f]),c.jsx(Dl,{...o,...a,ref:t})});wH.displayName=PA;var FA="PopoverTrigger",UA=g.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=gi(FA,n),o=fd(n),u=xt(t,i.triggerRef),f=c.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":BA(i.open),...a,ref:u,onClick:Re(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:c.jsx(Dl,{asChild:!0,...o,children:f})});UA.displayName=FA;var Wx="PopoverPortal",[EH,CH]=LA(Wx,{forceMount:void 0}),zA=e=>{const{__scopePopover:t,forceMount:n,children:a,container:i}=e,o=gi(Wx,t);return c.jsx(EH,{scope:t,forceMount:n,children:c.jsx(nr,{present:n||o.open,children:c.jsx(co,{asChild:!0,container:i,children:a})})})};zA.displayName=Wx;var bl="PopoverContent",VA=g.forwardRef((e,t)=>{const n=CH(bl,e.__scopePopover),{forceMount:a=n.forceMount,...i}=e,o=gi(bl,e.__scopePopover);return c.jsx(nr,{present:a||o.open,children:o.modal?c.jsx(_H,{...i,ref:t}):c.jsx(TH,{...i,ref:t})})});VA.displayName=bl;var RH=ai("PopoverContent.RemoveScroll"),_H=g.forwardRef((e,t)=>{const n=gi(bl,e.__scopePopover),a=g.useRef(null),i=xt(t,a),o=g.useRef(!1);return g.useEffect(()=>{const u=a.current;if(u)return Xh(u)},[]),c.jsx(zu,{as:RH,allowPinchZoom:!0,children:c.jsx($A,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,u=>{var f;u.preventDefault(),o.current||(f=n.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,m=f.button===2||h;o.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Re(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})}),TH=g.forwardRef((e,t)=>{const n=gi(bl,e.__scopePopover),a=g.useRef(!1),i=g.useRef(!1);return c.jsx($A,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:o=>{var h,m;(h=e.onInteractOutside)==null||h.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=o.target;((m=n.triggerRef.current)==null?void 0:m.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),$A=g.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:v,...b}=e,y=gi(bl,n),S=fd(n);return Kh(),c.jsx(Uu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx(lo,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:v,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>y.onOpenChange(!1),children:c.jsx(Hu,{"data-state":BA(y.open),role:"dialog",id:y.contentId,...S,...b,ref:t,style:{...b.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)"}})})})}),HA="PopoverClose",NH=g.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=gi(HA,n);return c.jsx(We.button,{type:"button",...a,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});NH.displayName=HA;var AH="PopoverArrow",jH=g.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=fd(n);return c.jsx(Bu,{...i,...a,ref:t})});jH.displayName=AH;function BA(e){return e?"open":"closed"}var DH=IA,OH=UA,MH=zA,kH=VA;function GA({...e}){return c.jsx(DH,{"data-slot":"popover",...e})}function qA({...e}){return c.jsx(OH,{"data-slot":"popover-trigger",...e})}function ZA({className:e,align:t="center",sideOffset:n=4,...a}){return c.jsx(MH,{children:c.jsx(kH,{"data-slot":"popover-content",align:t,sideOffset:n,className:ye("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...a})})}function Jx({options:e,value:t,onValueChange:n,placeholder:a="Select an option",emptyMessage:i="No results found.",className:o,disabled:u=!1}){const[f,h]=g.useState(!1),[m,v]=g.useState(""),b=g.useMemo(()=>{const w={};return e.forEach(E=>{const C=E.group??"";Object.prototype.hasOwnProperty.call(w,C)||(w[C]=[]),w[C].push(E)}),w},[e]),y=e.find(w=>w.value===t),S=g.useCallback(w=>{n(w),requestAnimationFrame(()=>{v(""),h(!1)})},[n]);return c.jsxs(GA,{open:f,onOpenChange:h,modal:!0,children:[c.jsx(qA,{asChild:!0,children:c.jsxs(Ue,{variant:"outline",role:"combobox","aria-expanded":f,className:ye("w-full justify-between",!t&&"text-muted-foreground",o),disabled:u,children:[y?y.label:a,c.jsx(kR,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),c.jsx(ZA,{className:"max-h-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:c.jsxs(jA,{children:[c.jsx(DA,{placeholder:`Search ${a.toLowerCase()}...`,value:m,onValueChange:v}),c.jsx(OA,{children:i}),Object.entries(b).map(([w,E])=>{const C=m?E.filter(R=>R.label.toLowerCase().includes(m.toLowerCase())):E;return C.length===0?null:c.jsx(MA,{heading:w,children:C.map(R=>c.jsxs(kA,{value:R.value,onSelect:()=>{S(R.value)},children:[c.jsx(Ta,{className:ye("mr-2 h-4 w-4",t===R.value?"opacity-100":"opacity-0")}),R.label]},R.value))},w||"default")})]})})]})}const LH=({form:e})=>{var a,i,o;const{register:t,formState:{errors:n}}=e;return e.watch("type")!==st.GOOGLE_BIGQUERY?null:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"text-lg font-medium",children:"Connection Settings"}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs(Ht,{htmlFor:"project-id",className:"block text-sm font-medium text-gray-700",children:["Project ID",c.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),c.jsx(Ut,{id:"project-id",type:"text",...t("config.projectId",{required:!0}),className:"mt-1 block w-full"}),n.config&&"projectId"in n.config&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:(a=n.config.projectId)==null?void 0:a.message})]}),c.jsxs("div",{children:[c.jsxs(Ht,{htmlFor:"location",className:"block text-sm font-medium text-gray-700",children:["Location",c.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),c.jsx(RN,{name:"config.location",control:e.control,defaultValue:"US",rules:{required:!0},render:({field:u})=>c.jsx(Jx,{options:K9,value:u.value,onValueChange:u.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),n.config&&"location"in n.config&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:(i=n.config.location)==null?void 0:i.message})]})]})]}),c.jsx(Fu,{}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs(Ht,{htmlFor:"service-account-key",className:"block text-sm font-medium text-gray-700",children:["Service Account JSON",c.jsx(ls,{children:c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx(qi,{className:"ml-1.5 inline-block h-4 w-4 cursor-help text-gray-500"})}),c.jsxs(ln,{className:"max-w-sm text-sm",children:[c.jsx("p",{children:"A Service Account Key is a JSON credential file that provides authentication to Google BigQuery."}),c.jsx("p",{className:"mt-1",children:"To get one, go to the Google Cloud Console, navigate to IAM & Admin > Service Accounts, create or select a service account, and generate a new JSON key."})]})]})})]}),c.jsx(mm,{value:e.watch("credentials.serviceAccount"),onChange:u=>{e.setValue("credentials.serviceAccount",u)},keysToMask:UT}),n.credentials&&"serviceAccount"in n.credentials&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:(o=n.credentials.serviceAccount)==null?void 0:o.message})]})]})]})},IH=({form:e})=>{var a,i,o,u,f;const{register:t,formState:{errors:n}}=e;return e.watch("type")!==st.AWS_ATHENA?null:c.jsx(c.Fragment,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"text-lg font-medium",children:"Connection Settings"}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs(Ht,{htmlFor:"region",className:"block text-sm font-medium text-gray-700",children:["Region",c.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),c.jsx(Ut,{id:"region",type:"text",...t("config.region"),className:"mt-1 block w-full"}),n.config&&"region"in n.config&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:(a=n.config.region)==null?void 0:a.message})]}),c.jsxs("div",{children:[c.jsxs(Ht,{htmlFor:"database-name",className:"block text-sm font-medium text-gray-700",children:["Database Name",c.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),c.jsx(Ut,{id:"database-name",type:"text",...t("config.databaseName"),className:"mt-1 block w-full"}),n.config&&"databaseName"in n.config&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:(i=n.config.databaseName)==null?void 0:i.message})]}),c.jsxs("div",{children:[c.jsxs(Ht,{htmlFor:"output-bucket",className:"block text-sm font-medium text-gray-700",children:["Output Bucket",c.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),c.jsx(Ut,{id:"output-bucket",type:"text",...t("config.outputBucket"),className:"block w-full"}),n.config&&"outputBucket"in n.config&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:(o=n.config.outputBucket)==null?void 0:o.message})]})]})]}),c.jsx(Fu,{}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs(Ht,{htmlFor:"access-key-id",className:"block text-sm font-medium text-gray-700",children:["Access Key ID",c.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),c.jsx(Ut,{id:"access-key-id",type:"text",...t("credentials.accessKeyId"),className:"block w-full"}),n.credentials&&"accessKeyId"in n.credentials&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:(u=n.credentials.accessKeyId)==null?void 0:u.message})]}),c.jsxs("div",{children:[c.jsxs(Ht,{htmlFor:"secret-access-key",className:"block text-sm font-medium text-gray-700",children:["Secret Access Key",c.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),c.jsx(Ut,{id:"secret-access-key",type:"password",...t("credentials.secretAccessKey"),className:"block w-full"}),n.credentials&&"secretAccessKey"in n.credentials&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:(f=n.credentials.secretAccessKey)==null?void 0:f.message})]})]})]})]})})};function PH({initialData:e,onSubmit:t,onCancel:n}){const a=Fl({resolver:Ul(lU),defaultValues:e}),{watch:i,register:o,formState:{errors:u}}=a,f=i("type");return c.jsxs("form",{onSubmit:h=>{h.preventDefault(),a.handleSubmit(t)(h)},className:"space-y-4",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs(Ht,{htmlFor:"title",className:"block text-sm font-medium text-gray-700",children:["Title",c.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),c.jsx(Ut,{id:"title",type:"text",...o("title"),className:"mt-1 block w-full","aria-required":"true","aria-invalid":!!u.title}),u.title&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:u.title.message})]}),c.jsxs("div",{children:[c.jsx(Ht,{className:"block text-sm font-medium text-gray-700",children:"Storage Provider"}),c.jsxs(Ma,{defaultValue:e==null?void 0:e.type,onValueChange:h=>{a.setValue("type",h)},disabled:!!e,children:[c.jsx(La,{className:"w-full",children:c.jsx(ka,{placeholder:"Select a storage type"})}),c.jsx(Ia,{children:c.jsx(Dm,{children:hi.getAllTypes().map(({type:h,displayName:m,icon:v})=>c.jsx(An,{value:h,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(v,{}),m]})},h))})})]})]}),f===st.GOOGLE_BIGQUERY&&c.jsx(LH,{form:a}),f===st.AWS_ATHENA&&c.jsx(IH,{form:a})]}),c.jsxs("div",{className:"flex justify-end space-x-4",children:[c.jsx(Ue,{variant:"ghost",type:"button",onClick:n,children:"Cancel"}),c.jsx(Ue,{variant:"default",type:"submit",children:"Save"})]})]})}function YA({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:a}){const{updateDataStorage:i}=Om(),o=async u=>{if(n){const f=await i(n.id,u);f&&(a(f),t())}};return c.jsx(_l,{open:e,onOpenChange:t,children:c.jsxs(Tl,{onOpenAutoFocus:u=>{u.preventDefault()},className:"flex h-full min-w-[480px] flex-col",children:[c.jsxs(Nl,{children:[c.jsx(Ll,{children:"Configure Storage Provider"}),c.jsx(Il,{children:"Customize settings for your storage provider"})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:c.jsx(PH,{initialData:n??void 0,onSubmit:o,onCancel:t})})]})})}const FH=({dataStorage:e,onDataStorageChange:t})=>{const[n,a]=g.useState(!1),i=hi.getInfo(e.type),o=()=>{a(!0)},u=()=>{a(!1)},f=()=>{if(!(()=>{switch(e.type){case st.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case st.AWS_ATHENA:return!!(e.config.region&&e.config.databaseName&&e.config.outputBucket);default:return!1}})())return"Storage configuration is incomplete";const m=(b,y)=>c.jsxs("span",{children:[c.jsxs("span",{className:"font-semibold",children:[b,":"]})," ",c.jsx("span",{className:"text-muted-foreground",children:y})]}),v=(b,y,S)=>c.jsxs("span",{children:[c.jsxs("span",{className:"font-semibold",children:[b,":"]})," ",c.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",onClick:w=>{w.stopPropagation()},children:[y,c.jsx(Jy,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})]});switch(e.type){case st.GOOGLE_BIGQUERY:{const b=e.config.projectId,y=e.config.location,S=`https://console.cloud.google.com/bigquery?project=${b}`;return c.jsxs("div",{className:"flex flex-wrap gap-2",children:[v("Project ID",b,S),c.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",y)]})}case st.AWS_ATHENA:{const b=e.config.region,y=e.config.databaseName,S=e.config.outputBucket,w=`https://console.aws.amazon.com/athena/home?region=${b}#/query-editor`,E=`https://s3.console.aws.amazon.com/s3/buckets/${S}?region=${b}`;return c.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",b),c.jsx("span",{className:"text-muted-foreground",children:"•"}),v("Database",y,w),c.jsx("span",{className:"text-muted-foreground",children:"•"}),v("Bucket",S,E)]})}default:return"Unknown storage type configuration"}};return c.jsxs(c.Fragment,{children:[c.jsx(ti,{}),c.jsx(Oy,{title:e.title,icon:i.icon,subtitle:f(),onClick:o}),c.jsx(Qx,{children:c.jsx(YA,{isOpen:n,onClose:u,dataStorage:e,onSaveSuccess:h=>{t&&t(h),Jt.success("Saved")}})})]})};function UH({initialType:e,onTypeSelect:t}){var u;const[n,a]=g.useState(e??null),i=f=>{a(f),t(f)},o=[{type:Xe.SQL,label:"SQL",description:"SQL query"},{type:Xe.TABLE,label:"Table",description:"Existing table"},{type:Xe.VIEW,label:"View",description:"Existing view"},{type:Xe.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:Xe.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return c.jsxs("div",{className:"dm-card-block",children:[c.jsx(Ht,{className:"text-foreground",children:"Definition Type"}),c.jsxs(Ma,{value:n??"",onValueChange:f=>{i(f)},children:[c.jsx(La,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:c.jsx(ka,{placeholder:"Select definition type",children:n&&((u=o.find(f=>f.type===n))==null?void 0:u.label)})}),c.jsx(Ia,{children:c.jsx(Dm,{children:o.map(f=>c.jsxs(An,{value:f.type,children:[f.label,c.jsx("span",{className:"text-muted-foreground/80 ml-2",children:f.description})]},f.type))})})]})]})}const zH=$t({definitionType:ys(Xe.SQL),definition:$t({sqlQuery:Bt().min(1,"SQL query is required")})}),VH=e=>{const t=BT(e);return $t({definitionType:ys(Xe.TABLE),definition:t})},$H=e=>{const t=BT(e);return $t({definitionType:ys(Xe.VIEW),definition:t})},HH=e=>{const t=xU(e);return $t({definitionType:ys(Xe.TABLE_PATTERN),definition:t})},BH=$t({definitionType:ys(Xe.CONNECTOR),definition:$t({connector:$t({source:$t({name:Bt().min(1,"Connector name is required"),configuration:aC(e6(WF())).min(1,"At least one configuration is required"),node:Bt().min(1,"Node is required"),fields:aC(Bt()).min(1,"At least one field is required")}),storage:$t({fullyQualifiedName:Bt().min(1,"fully qualified name is required")})})})}),GH=(e,t)=>{if(!e)return $t({definitionType:t6(Mx(Xe)),definition:$t({}).optional()});switch(e){case Xe.SQL:return zH;case Xe.TABLE:return VH(t);case Xe.VIEW:return $H(t);case Xe.TABLE_PATTERN:return HH(t);case Xe.CONNECTOR:return BH;default:return $t({})}},e0=SN,KA=g.createContext({}),xr=({...e})=>c.jsx(KA.Provider,{value:{name:e.name},children:c.jsx(RN,{...e})}),Im=()=>{const e=g.useContext(KA),t=g.useContext(QA),{getFieldState:n}=Pl(),a=EN({name:e.name}),i=n(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},QA=g.createContext({});function br({className:e,...t}){const n=g.useId();return c.jsx(QA.Provider,{value:{id:n},children:c.jsx("div",{"data-slot":"form-item",className:ye("grid gap-2",e),...t})})}function Vr({className:e,...t}){const{error:n,formItemId:a}=Im();return c.jsx(Ht,{"data-slot":"form-label","data-error":!!n,className:ye("data-[error=true]:text-destructive",e),htmlFor:a,...t})}function Sr({...e}){const{error:t,formItemId:n,formDescriptionId:a,formMessageId:i}=Im();return c.jsx(Zh,{"data-slot":"form-control",id:n,"aria-describedby":t?`${a} ${i}`:`${a}`,"aria-invalid":!!t,...e})}function ju({className:e,...t}){const{formDescriptionId:n}=Im();return c.jsx("p",{"data-slot":"form-description",id:n,className:ye("text-muted-foreground text-sm",e),...t})}function wr({className:e,...t}){const{error:n,formMessageId:a}=Im(),i=n?String((n==null?void 0:n.message)??""):t.children;return i?c.jsx("p",{"data-slot":"form-message",id:a,className:ye("text-destructive text-sm",e),...t,children:i}):null}function qH({control:e}){return c.jsx(xr,{control:e,name:"definition.sqlQuery",render:({field:t})=>c.jsxs(br,{className:"dm-card-block",children:[c.jsx(Vr,{className:"text-foreground",children:"SQL Query"}),c.jsx(Sr,{children:c.jsx(K$,{initialValue:{sqlQuery:t.value},onChange:n=>{t.onChange(n.sqlQuery)}})}),c.jsx(wr,{})]})})}function ZH({control:e,storageType:t}){const n=VT(t),a=$T(t);return c.jsx(xr,{control:e,name:"definition.fullyQualifiedName",render:({field:i})=>c.jsxs(br,{className:"dm-card-block",children:[c.jsx(Vr,{className:"text-foreground",children:"Fully Qualified Table Name"}),c.jsx(Sr,{children:c.jsx(Ut,{placeholder:n,value:i.value||"",onChange:i.onChange,className:"dm-card-formcontrol"})}),c.jsx(ju,{children:a}),c.jsx(wr,{})]})})}function YH({control:e,storageType:t}){const n=VT(t),a=$T(t);return c.jsx(xr,{control:e,name:"definition.fullyQualifiedName",render:({field:i})=>c.jsxs(br,{className:"dm-card-block",children:[c.jsx(Vr,{className:"text-foreground",children:"Fully Qualified View Name"}),c.jsx(Sr,{children:c.jsx(Ut,{placeholder:n,value:i.value||"",onChange:i.onChange,className:"dm-card-formcontrol"})}),c.jsx(ju,{className:"text-muted-foreground/50",children:a}),c.jsx(wr,{})]})})}function KH({control:e,storageType:t}){const n=hU(t),a=mU(t);return c.jsx(xr,{control:e,name:"definition.pattern",render:({field:i})=>c.jsxs(br,{className:"dm-card-block",children:[c.jsx(Vr,{className:"text-foreground",children:"Table Pattern"}),c.jsx(Sr,{children:c.jsx(Ut,{placeholder:n,value:i.value||"",onChange:i.onChange,className:"dm-card-formcontrol"})}),c.jsx(ju,{className:"text-muted-foreground/50",children:a}),c.jsx(wr,{})]})})}const XA=e=>{switch(e){case Xe.SQL:return{sqlQuery:"-- Start writing your SQL query here..."};case Xe.TABLE:return{fullyQualifiedName:""};case Xe.VIEW:return{fullyQualifiedName:""};case Xe.TABLE_PATTERN:return{pattern:""};case Xe.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}};var bn=(e=>(e.FETCH_CONNECTORS_START="FETCH_CONNECTORS_START",e.FETCH_CONNECTORS_SUCCESS="FETCH_CONNECTORS_SUCCESS",e.FETCH_CONNECTORS_ERROR="FETCH_CONNECTORS_ERROR",e.FETCH_CONNECTOR_SPECIFICATION_START="FETCH_CONNECTOR_SPECIFICATION_START",e.FETCH_CONNECTOR_SPECIFICATION_SUCCESS="FETCH_CONNECTOR_SPECIFICATION_SUCCESS",e.FETCH_CONNECTOR_SPECIFICATION_ERROR="FETCH_CONNECTOR_SPECIFICATION_ERROR",e.FETCH_CONNECTOR_FIELDS_START="FETCH_CONNECTOR_FIELDS_START",e.FETCH_CONNECTOR_FIELDS_SUCCESS="FETCH_CONNECTOR_FIELDS_SUCCESS",e.FETCH_CONNECTOR_FIELDS_ERROR="FETCH_CONNECTOR_FIELDS_ERROR",e))(bn||{});const QH={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function XH(e,t){switch(t.type){case bn.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case bn.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case bn.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case bn.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case bn.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case bn.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case bn.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case bn.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case bn.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const WA=g.createContext(void 0);function WH({children:e}){const[t,n]=g.useReducer(XH,QH);return c.jsx(WA.Provider,{value:{state:t,dispatch:n},children:e})}function JH(){const e=g.useContext(WA);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}function eB(){const{state:e,dispatch:t}=JH(),n=g.useCallback(async()=>{t({type:bn.FETCH_CONNECTORS_START});try{const u=await new Av().getAvailableConnectors();t({type:bn.FETCH_CONNECTORS_SUCCESS,payload:u})}catch(o){t({type:bn.FETCH_CONNECTORS_ERROR,payload:o instanceof Error?o.message:"Unknown error"})}},[t]),a=g.useCallback(async o=>{t({type:bn.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new Av().getConnectorSpecification(o);t({type:bn.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(u){t({type:bn.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:u instanceof Error?u.message:"Unknown error"})}},[t]),i=g.useCallback(async o=>{t({type:bn.FETCH_CONNECTOR_FIELDS_START});try{const f=await new Av().getConnectorFields(o);t({type:bn.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(u){t({type:bn.FETCH_CONNECTOR_FIELDS_ERROR,payload:u instanceof Error?u.message:"Unknown error"})}},[t]);return{connectors:e.connectors,connectorSpecification:e.connectorSpecification,connectorFields:e.connectorFields,loading:e.loading,loadingSpecification:e.loadingSpecification,loadingFields:e.loadingFields,error:e.error,fetchAvailableConnectors:n,fetchConnectorSpecification:a,fetchConnectorFields:i}}function rh({className:e,...t}){return c.jsx("div",{"data-slot":"card",className:ye("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function ah({className:e,...t}){return c.jsx("div",{"data-slot":"card-header",className:ye("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ly({className:e,...t}){return c.jsx("div",{"data-slot":"card-title",className:ye("leading-none font-semibold",e),...t})}function tB({className:e,...t}){return c.jsx("div",{"data-slot":"card-description",className:ye("text-muted-foreground text-sm",e),...t})}function Iy({className:e,...t}){return c.jsx("div",{"data-slot":"card-content",className:ye("px-6",e),...t})}function nB({className:e,...t}){return c.jsx("div",{"data-slot":"card-footer",className:ye("flex items-center px-6 [.border-t]:pt-6",e),...t})}const rB=Pu("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function t0({className:e,variant:t,...n}){return c.jsx("div",{"data-slot":"alert",role:"alert",className:ye(rB({variant:t}),e),...n})}function JA({className:e,...t}){return c.jsx("div",{"data-slot":"alert-title",className:ye("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function n0({className:e,...t}){return c.jsx("div",{"data-slot":"alert-description",className:ye("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function aB({connectors:e,selectedConnector:t,loading:n,error:a,onConnectorSelect:i}){return n?c.jsx("div",{className:"space-y-4",children:c.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6}).map((o,u)=>c.jsxs(rh,{children:[c.jsxs(ah,{children:[c.jsx(gr,{className:"h-4 w-3/4"}),c.jsx(gr,{className:"h-3 w-1/2"})]}),c.jsx(Iy,{children:c.jsx(gr,{className:"h-10 w-full"})})]},u))})}):a?c.jsxs(t0,{variant:"destructive",children:[c.jsx(Yh,{className:"h-4 w-4"}),c.jsx(n0,{children:"Failed to load available connectors. Please try again."})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-2",children:e.map(o=>c.jsx(rh,{className:`cursor-pointer transition-all duration-200 hover:shadow-md ${(t==null?void 0:t.name)===o.name?"ring-primary border-primary":"hover:border-muted-foreground/25"}`,onClick:()=>{i(o)},children:c.jsx(ah,{className:"pb-3",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(Ly,{className:"text-base",children:o.title??o.name})})})})},o.name))}),e.length===0&&c.jsxs("div",{className:"py-8 text-center",children:[c.jsx(c3,{className:"text-muted-foreground mx-auto mb-4 h-12 w-12"}),c.jsx("h4",{className:"text-muted-foreground text-lg font-medium",children:"No connectors available"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Contact your administrator to add connector configurations."})]}),c.jsx("div",{className:"flex flex-col gap-4",children:c.jsxs(rh,{className:"bg-muted cursor-pointer transition-all duration-200 hover:shadow-md",children:[c.jsx(ah,{className:"pb-3",children:c.jsx(Ly,{className:"text-base",children:"Custom code"})}),c.jsx(Iy,{children:c.jsx("p",{className:"text-muted-foreground text-sm",children:"Coming soon..."})})]})})]})}function sB(e,t,n){const{name:a,title:i,requiredType:o,options:u,placeholder:f,default:h}=e,m=i??a,v=a;if(u&&u.length>0){const b=u.map(y=>({value:y,label:y}));return c.jsx(Jx,{options:b,value:t[a]||h||"",onValueChange:y=>{n(a,y)},placeholder:f??`Select ${m.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}switch(o){case"boolean":return c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("input",{type:"checkbox",id:v,name:a,checked:t[a]||h||!1,onChange:b=>{n(a,b.target.checked)},className:"text-primary focus:ring-primary border-border h-4 w-4 rounded"}),c.jsx(Ht,{htmlFor:v,className:"cursor-pointer text-sm",children:m})]});case"number":return c.jsx(Ut,{id:v,name:a,type:"number",value:t[a]||h||"",placeholder:f??`Enter ${m.toLowerCase()}`,onChange:b=>{const y=parseFloat(b.target.value)||0;n(a,y)}});case"array":return c.jsx(Cu,{id:v,name:a,value:Array.isArray(t[a])?t[a].join(`
|
|
598
|
+
`):Array.isArray(h)?h.join(`
|
|
599
|
+
`):"",placeholder:f??`Enter ${m.toLowerCase()} (one per line)`,rows:4,onChange:b=>{const y=b.target.value.split(`
|
|
600
|
+
`).filter(S=>S.trim());n(a,y)}});case"object":return c.jsx(Cu,{id:v,name:a,value:t[a]&&typeof t[a]=="object"?JSON.stringify(t[a],null,2):typeof h=="object"?JSON.stringify(h,null,2):"",placeholder:f??`Enter ${m.toLowerCase()} as JSON`,rows:6,className:"font-mono",onChange:b=>{try{const y=JSON.parse(b.target.value);n(a,y)}catch{n(a,b.target.value)}}});case"date":{const b=y=>{if(!y||typeof y!="string"&&typeof y!="number")return"";const S=typeof y=="string"?y:y.toString();try{const w=new Date(S);return isNaN(w.getTime())?"":w.toISOString().split("T")[0]}catch{return""}};return c.jsx(Ut,{id:v,name:a,type:"text",value:t[a]||b(h)||"",placeholder:f??`Enter ${m.toLowerCase()}`,onChange:y=>{n(a,y.target.value)}})}case"string":default:return c.jsx(Ut,{id:v,name:a,type:"text",value:t[a]||h||"",placeholder:f??`Enter ${m.toLowerCase()}`,onChange:b=>{n(a,b.target.value)}})}}function ZC({connectorSpecification:e,onConfigurationChange:t,onValidationChange:n,initialConfiguration:a,loading:i=!1}){const[o,u]=g.useState({}),f=g.useRef(!1),h=g.useRef(!1);g.useEffect(()=>{if(e){h.current=!0;const y={...a??{}};e.forEach(S=>{y[S.name]===void 0&&S.default!==void 0&&(y[S.name]=S.default)}),u(y),f.current=!0,setTimeout(()=>{h.current=!1},0)}},[e,a]),g.useEffect(()=>{f.current&&a&&Object.keys(a).length>0&&(h.current=!0,u(a),setTimeout(()=>{h.current=!1},0))},[a]),g.useEffect(()=>{f.current&&!h.current&&Object.keys(o).length>0&&(t==null||t(o))},[o,t]);const m=(y,S)=>{u(w=>({...w,[y]:S}))},v=(y,S)=>S.filter(E=>E.required&&E.showInUI!==!1&&E.name!=="Fields").every(E=>{const C=y[E.name];return!(C==null||typeof C=="string"&&C.trim()===""||Array.isArray(C)&&C.length===0)});if(g.useEffect(()=>{if(e&&n){const y=v(o,e);n(y)}},[o,e,n]),i)return c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-lg font-medium",children:"Configuration"}),c.jsx("p",{className:"text-muted-foreground mb-8 text-sm",children:"Loading connector configuration..."}),c.jsx("div",{className:"flex flex-col gap-4",children:Array.from({length:3}).map((y,S)=>c.jsxs("div",{className:"mb-2 space-y-1",children:[c.jsx(gr,{className:"h-4 w-32"}),c.jsx(gr,{className:"h-10 w-full"}),c.jsx(gr,{className:"h-3 w-48"})]},S))})]});if(!e||e.length===0)return null;const b=[...e].filter(y=>y.showInUI!==!1&&y.name!=="Fields").sort((y,S)=>{const w=E=>{const C=E.default!=null&&E.default!=="";return E.required&&!C?1:E.required&&C?2:!E.required&&!C?3:4};return w(y)-w(S)});return c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-lg font-medium",children:"Configuration"}),c.jsx("p",{className:"text-muted-foreground mb-8 text-sm",children:"Configure the connector parameters. All fields with an asterisk (*) are required."}),c.jsx("div",{className:"flex flex-col gap-4",children:b.map(y=>c.jsxs("div",{className:"mb-2 space-y-1",children:[y.requiredType!=="boolean"&&c.jsxs(Ht,{htmlFor:y.name,className:"text-sm font-medium",children:[y.title??y.name,y.required&&c.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),sB(y,o,m),y.description&&c.jsx("p",{className:"text-muted-foreground text-sm",children:y.description})]},y.name))})]})}function iB({connectorFields:e,selectedField:t,connectorName:n,loading:a=!1,onFieldSelect:i}){const o=n?`Select Nodes for ${n}`:"Select Nodes";return a?c.jsxs("div",{className:"space-y-4",children:[c.jsx("h4",{className:"text-lg font-medium",children:o}),c.jsx("div",{className:"flex flex-col gap-4",children:Array.from({length:3}).map((u,f)=>c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(gr,{className:"h-4 w-4 rounded-full"}),c.jsx(gr,{className:"h-4 w-32"})]},f))})]}):!e||e.length===0?c.jsxs("div",{className:"space-y-4",children:[c.jsx("h4",{className:"text-lg font-medium",children:o}),c.jsx("p",{className:"text-destructive text-sm",children:n?`No nodes found for ${n}`:"No nodes found"}),c.jsx("p",{className:"text-muted-foreground text-muted-foreground text-sm",children:"This connector might not be fully implemented yet or there could be other issues. Please create an issue on GitHub to report this problem."})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsx("h4",{className:"text-lg font-medium",children:o}),c.jsx("div",{className:"flex flex-col gap-4",children:e.map(u=>c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("input",{type:"radio",id:u.name,name:"selectedField",value:u.name,className:"text-primary focus:ring-primary border-border h-4 w-4",onChange:f=>{i(f.target.value)},checked:t===u.name}),c.jsx("label",{htmlFor:u.name,className:"text-muted-foreground cursor-pointer text-sm",children:c.jsx("div",{className:"flex items-center gap-2",children:u.overview??u.name})}),u.name&&c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx(qi,{className:"text-muted-foreground/75 inline-block h-4 w-4 cursor-help"})}),c.jsxs(ln,{children:[c.jsxs("p",{children:["Table name: ",u.name]}),u.description&&c.jsx("p",{children:u.description}),u.documentation&&c.jsx("p",{children:u.documentation})]})]})]},u.name))})]})}function oB({connectorFields:e,selectedField:t,selectedFields:n,onFieldToggle:a,onSelectAllFields:i}){const o=g.useRef(null),u=g.useRef(null),[f,h]=g.useState(""),m=e==null?void 0:e.find(R=>R.name===t),v=(m==null?void 0:m.fields)??[],b=v.filter(R=>R.name.toLowerCase().includes(f.toLowerCase().trim())),y=v.map(R=>R.name),S=n.filter(R=>y.includes(R)).length,w=y.length>0&&S===y.length,E=S>0&&S<y.length;if(g.useEffect(()=>{o.current&&(o.current.indeterminate=E)},[E]),!t||!e||!v.length)return null;const C=R=>{const T=R.target.checked;i?i(y,T):y.forEach(N=>{const O=n.includes(N);T&&!O?a(N,!0):!T&&O&&a(N,!1)})};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("h4",{className:"text-lg font-medium",children:["Selected field for node: ",t]}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Select the fields you want to include in the connector."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("input",{ref:o,type:"checkbox",id:"master-checkbox",className:"text-primary focus:ring-primary border-border h-4 w-4",checked:w,onChange:C}),c.jsxs("label",{htmlFor:"master-checkbox",className:"cursor-pointer text-sm font-medium",children:["Select all fields (",S,"/",y.length,")"]})]}),c.jsxs("div",{className:"relative pr-2",children:[c.jsx(oo,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=u.current)==null||R.focus()}}),c.jsx("input",{ref:u,type:"text",placeholder:"Filter",value:f,onChange:R=>{h(R.target.value)},className:"focus:border-primary h-8 w-48 rounded-none border-0 bg-transparent pl-9 text-sm outline-none focus:border-b"})]})]}),c.jsx("div",{className:"border-border border-t"}),c.jsxs("div",{className:"flex flex-col gap-3",children:[b.map(R=>c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("input",{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,className:"text-primary focus:ring-primary border-border h-4 w-4",onChange:T=>{a(R.name,T.target.checked)},checked:n.includes(R.name)}),c.jsx("label",{htmlFor:`field-${R.name}`,className:"text-muted-foreground cursor-pointer text-sm",children:c.jsx("div",{className:"flex items-center gap-2",children:R.name})}),R.name&&c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx(qi,{className:"text-muted-foreground/75 inline-block h-4 w-4 cursor-help"})}),c.jsxs(ln,{children:[c.jsxs("p",{children:["Type: ",R.type]}),R.description&&c.jsx("p",{children:R.description})]})]})]},R.name)),b.length===0&&f&&c.jsxs("div",{className:"text-muted-foreground py-4 text-center text-sm",children:['No fields match "',f,'"']})]})]})]})}const e2=g.createContext(void 0),t2={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function lB(e,t){switch(t.type){case"FETCH_TRIGGERS_START":case"FETCH_TRIGGER_START":case"CREATE_TRIGGER_START":case"UPDATE_TRIGGER_START":case"DELETE_TRIGGER_START":return{...e,isLoading:!0,error:null};case"FETCH_TRIGGERS_SUCCESS":return{...e,triggers:t.payload,isLoading:!1};case"FETCH_TRIGGER_SUCCESS":return{...e,selectedTrigger:t.payload,isLoading:!1};case"CREATE_TRIGGER_SUCCESS":return{...e,triggers:[...e.triggers,t.payload],isLoading:!1};case"UPDATE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.map(n=>n.id===t.payload.id?t.payload:n),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload.id?t.payload:e.selectedTrigger,isLoading:!1};case"DELETE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.filter(n=>n.id!==t.payload),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload?null:e.selectedTrigger,isLoading:!1};case"FETCH_TRIGGERS_ERROR":case"FETCH_TRIGGER_ERROR":case"CREATE_TRIGGER_ERROR":case"UPDATE_TRIGGER_ERROR":case"DELETE_TRIGGER_ERROR":return{...e,isLoading:!1,error:t.payload};case"SELECT_TRIGGER":return{...e,selectedTrigger:t.payload};case"RESET":return t2;default:return e}}class cB extends kl{constructor(){super("/data-marts")}async getScheduledTriggers(t){return this.get(`/${t}/scheduled-triggers`)}async getScheduledTrigger(t,n){return this.get(`/${t}/scheduled-triggers/${n}`)}async createScheduledTrigger(t,n){return this.post(`/${t}/scheduled-triggers`,n)}async updateScheduledTrigger(t,n,a){return this.put(`/${t}/scheduled-triggers/${n}`,a)}async deleteScheduledTrigger(t,n){return this.delete(`/${t}/scheduled-triggers/${n}`)}}const al=new cB;var mn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(mn||{});const dl={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"},n2=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,uB=/[#&]gid=([0-9]+)/;function r2(e){return n2.test(e)}function dB(e){const t=n2.exec(e);return t?t[2]:""}function fB(e){const t=uB.exec(e);return t?t[1]:"0"}function hB(e){return{spreadsheetId:dB(e),sheetId:parseInt(fB(e),10)}}function r0(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function mB(e,t,n){try{const a=JSON.parse(e);return t in a?a[t]:n}catch(a){return console.error(`Error parsing service account JSON: ${String(a)}`),n}}function YC(e){return mB(e,"client_email")}const a2=g.createContext(void 0);var it=(e=>(e.FETCH_REPORTS_START="FETCH_REPORTS_START",e.FETCH_REPORTS_SUCCESS="FETCH_REPORTS_SUCCESS",e.FETCH_REPORTS_ERROR="FETCH_REPORTS_ERROR",e.FETCH_REPORT_START="FETCH_REPORT_START",e.FETCH_REPORT_SUCCESS="FETCH_REPORT_SUCCESS",e.FETCH_REPORT_ERROR="FETCH_REPORT_ERROR",e.CLEAR_CURRENT_REPORT="CLEAR_CURRENT_REPORT",e.CREATE_REPORT_START="CREATE_REPORT_START",e.CREATE_REPORT_SUCCESS="CREATE_REPORT_SUCCESS",e.CREATE_REPORT_ERROR="CREATE_REPORT_ERROR",e.UPDATE_REPORT_START="UPDATE_REPORT_START",e.UPDATE_REPORT_SUCCESS="UPDATE_REPORT_SUCCESS",e.UPDATE_REPORT_ERROR="UPDATE_REPORT_ERROR",e.DELETE_REPORT_START="DELETE_REPORT_START",e.DELETE_REPORT_SUCCESS="DELETE_REPORT_SUCCESS",e.DELETE_REPORT_ERROR="DELETE_REPORT_ERROR",e.START_POLLING_REPORT="START_POLLING_REPORT",e.STOP_POLLING_REPORT="STOP_POLLING_REPORT",e.UPDATE_POLLED_REPORT="UPDATE_POLLED_REPORT",e.STOP_ALL_POLLING="STOP_ALL_POLLING",e.CLEAR_ERROR="CLEAR_ERROR",e))(it||{}),Py=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e))(Py||{}),Vn=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e))(Vn||{}),pr=(e=>(e.EDIT="edit",e.CREATE="create",e))(pr||{});const pB={reports:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function gB(e,t){switch(t.type){case it.FETCH_REPORTS_START:case it.FETCH_REPORT_START:case it.CREATE_REPORT_START:case it.UPDATE_REPORT_START:case it.DELETE_REPORT_START:return{...e,loading:!0,error:null};case it.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case it.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case it.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case it.UPDATE_REPORT_SUCCESS:return{...e,currentReport:t.payload,reports:e.reports.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case it.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case it.FETCH_REPORTS_ERROR:case it.FETCH_REPORT_ERROR:case it.CREATE_REPORT_ERROR:case it.UPDATE_REPORT_ERROR:case it.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case it.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case it.CLEAR_ERROR:return{...e,error:null};case it.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case it.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case it.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case it.UPDATE_POLLED_REPORT:{const n=e.reports.find(a=>a.id===t.payload.id);return n&&t.payload.lastRunStatus!==Vn.RUNNING||(n==null?void 0:n.lastRunStatus)!==Vn.RUNNING?{...e,reports:e.reports.map(a=>a.id===t.payload.id?{...a,lastRunStatus:t.payload.lastRunStatus}:a),polledReportIds:e.polledReportIds.filter(a=>a!==t.payload.id)}:e}default:return e}}function s2({children:e}){const[t,n]=g.useReducer(gB,pB);return c.jsx(a2.Provider,{value:{state:t,dispatch:n},children:e})}function vB(){const e=g.useContext(a2);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class yB extends kl{constructor(){super("/reports")}async createReport(t){return this.post("",t)}async getReportById(t){return this.get(`/${t}`)}async getReportsByDataMartId(t){return this.get(`/data-mart/${t}`)}async getReportsByProject(){return this.get("/")}async updateReport(t,n){return this.put(`/${t}`,n)}async deleteReport(t){return this.delete(`/${t}`)}async runReport(t){return this.post(`/${t}/run`)}}const is=new yB,xB={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class bB{constructor(){Fc(this,"pollingTimers",new Map);Fc(this,"pollCounters",new Map);Fc(this,"config",xB)}setConfig(t){this.config={...this.config,...t}}startPolling(t,n){this.stopPolling(t),this.pollCounters.set(t,0);const a=async()=>{try{const i=this.pollCounters.get(t)??0;this.pollCounters.set(t,i+1);const o=await is.getReportById(t);if(n(o),o.lastRunStatus!==Vn.RUNNING){this.stopPolling(t);return}const f=i<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,h=setTimeout(()=>{a()},f);this.pollingTimers.set(t,h)}catch(i){console.error(`Error polling report status for ${t}:`,i),this.stopPolling(t)}};return a(),()=>{this.stopPolling(t)}}stopPolling(t){const n=this.pollingTimers.get(t);n&&(clearTimeout(n),this.pollingTimers.delete(t),this.pollCounters.delete(t))}stopAllPolling(){for(const t of this.pollingTimers.keys())this.stopPolling(t)}isPolling(t){return this.pollingTimers.has(t)}}const Hf=new bB;var $n=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e))($n||{}),gu=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e))(gu||{}),Fy=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e))(Fy||{});class SB{mapFromDto(t){let n="";try{n=JSON.stringify(t.credentials.serviceAccountKey,null,2)}catch(a){console.error(a,"Error parsing service account key")}return{id:t.id,title:t.title,type:$n.GOOGLE_SHEETS,projectId:t.projectId,credentials:{serviceAccount:n},createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t;return{title:n.title,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:Fy.GOOGLE_SHEETS_CREDENTIALS}}}mapToCreateRequest(t){const n=t;return{title:n.title,type:$n.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:Fy.GOOGLE_SHEETS_CREDENTIALS}}}}const a0={getMapper(e){switch(e){case $n.GOOGLE_SHEETS:return new SB;default:throw new Error(`Unknown destination type: ${String(e)}`)}}};function lu(e){return a0.getMapper(e.type).mapFromDto(e)}function wB(e){return a0.getMapper(e.type).mapToUpdateRequest(e)}function EB(e){return a0.getMapper(e.type).mapToCreateRequest(e)}function Ui(e){return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:lu(e.dataDestinationAccess),destinationConfig:{type:e.destinationConfig.type,spreadsheetId:e.destinationConfig.spreadsheetId,sheetId:e.destinationConfig.sheetId.toString()},lastRunDate:e.lastRunAt?new Date(e.lastRunAt):null,lastRunStatus:e.lastRunStatus,lastRunError:e.lastRunError,runsCount:e.runsCount,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Pm(){const{state:e,dispatch:t}=vB(),n=g.useCallback(async()=>{t({type:it.FETCH_REPORTS_START});try{const C=(await is.getReportsByProject()).map(Ui);t({type:it.FETCH_REPORTS_SUCCESS,payload:C})}catch(E){t({type:it.FETCH_REPORTS_ERROR,payload:E instanceof Error?E.message:"Failed to fetch reports"})}},[t]),a=g.useCallback(async E=>{t({type:it.FETCH_REPORTS_START});try{const R=(await is.getReportsByDataMartId(E)).map(Ui);t({type:it.FETCH_REPORTS_SUCCESS,payload:R})}catch(C){t({type:it.FETCH_REPORTS_ERROR,payload:C instanceof Error?C.message:"Failed to fetch reports"})}},[t]),i=g.useCallback(async E=>{t({type:it.FETCH_REPORT_START});try{const C=await is.getReportById(E),R=Ui(C);t({type:it.FETCH_REPORT_SUCCESS,payload:R})}catch(C){t({type:it.FETCH_REPORT_ERROR,payload:C instanceof Error?C.message:"Failed to fetch report"})}},[t]),o=g.useCallback(async E=>{t({type:it.CREATE_REPORT_START});try{const C=await is.createReport(E),R=Ui(C);return t({type:it.CREATE_REPORT_SUCCESS,payload:R}),R}catch(C){return t({type:it.CREATE_REPORT_ERROR,payload:C instanceof Error?C.message:"Failed to сreate report"}),null}},[t]),u=g.useCallback(async(E,C)=>{t({type:it.UPDATE_REPORT_START});try{const R=await is.updateReport(E,C),T=Ui(R);return t({type:it.UPDATE_REPORT_SUCCESS,payload:T}),T}catch(R){return t({type:it.UPDATE_REPORT_ERROR,payload:R instanceof Error?R.message:"Failed to update report"}),null}},[t]),f=g.useCallback(async E=>{t({type:it.DELETE_REPORT_START});try{await is.deleteReport(E),t({type:it.DELETE_REPORT_SUCCESS,payload:E})}catch(C){t({type:it.DELETE_REPORT_ERROR,payload:C instanceof Error?C.message:"Failed to delete report"})}},[t]),h=g.useCallback(()=>{t({type:it.CLEAR_CURRENT_REPORT})},[t]),m=g.useCallback(()=>{t({type:it.CLEAR_ERROR})},[t]),v=g.useCallback(E=>{Hf.stopPolling(E),t({type:it.STOP_POLLING_REPORT,payload:E})},[t]),b=g.useCallback(E=>{e.polledReportIds.includes(E)&&v(E),t({type:it.START_POLLING_REPORT,payload:E}),Hf.startPolling(E,C=>{const R=Ui(C);t({type:it.UPDATE_POLLED_REPORT,payload:R})})},[t,e.polledReportIds,v]),y=g.useCallback(()=>{Hf.stopAllPolling(),t({type:it.STOP_ALL_POLLING})},[t]),S=g.useCallback(E=>{Hf.setConfig(E)},[]),w=g.useCallback(async E=>{try{v(E),await is.runReport(E),await i(E),b(E)}catch(C){console.error("Failed to run report:",C)}},[i,b,v]);return g.useEffect(()=>()=>{y()},[y]),{reports:e.reports,currentReport:e.currentReport,loading:e.loading,error:e.error,polledReportIds:e.polledReportIds,fetchReports:n,fetchReportsByDataMartId:a,fetchReportById:i,createReport:o,updateReport:u,deleteReport:f,runReport:w,startPollingReport:b,stopPollingReport:v,stopAllPolling:y,setPollingConfig:S,clearCurrentReport:h,clearError:m}}const CB={statuses:{[Vn.SUCCESS]:{status:Vn.SUCCESS,displayName:"Success",icon:Wy,color:"text-green-500"},[Vn.RUNNING]:{status:Vn.RUNNING,displayName:"In progress",icon:ex,color:"text-primary animate-spin"},[Vn.ERROR]:{status:Vn.ERROR,displayName:"Fail",icon:IR,color:"text-red-500"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}};function RB({status:e,showText:t=!0,text:n,showIcon:a=!0,className:i}){const{icon:o,displayName:u,color:f}=CB.getInfo(e);return c.jsxs("span",{className:ye("inline-flex items-center gap-2",i),children:[a&&c.jsx(o,{className:ye("h-5 w-5",f)}),t&&c.jsx("span",{className:"text-sm",children:n??u})]})}class Uy{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}async enhanceWithReportData(t){if(t.type!==mn.REPORT_RUN)return t;const n=t.triggerConfig;if(!(n!=null&&n.reportId))return t;try{const a=await is.getReportById(n.reportId),i=Ui(a);return{...t,triggerConfig:{...n,report:i}}}catch(a){return console.error(`Failed to fetch report data for trigger ${t.id}:`,a),t}}async enhanceTriggersWithReportData(t){return Promise.all(t.map(n=>this.enhanceWithReportData(n)))}mapToCreateRequest(t){return{type:mn.REPORT_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}class _B{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToCreateRequest(t){return{type:mn.CONNECTOR_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}const Iv={getMapper(e){switch(e){case mn.REPORT_RUN:return new Uy;case mn.CONNECTOR_RUN:return new _B;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},eu={mapFromDto(e){return Iv.getMapper(e.type).mapFromDto(e)},mapFromDtoList(e){return e.map(t=>this.mapFromDto(t))},async mapFromDtoWithReportData(e){const t=this.mapFromDto(e);return t.type===mn.REPORT_RUN?new Uy().enhanceWithReportData(t):t},async mapFromDtoListWithReportData(e){const t=this.mapFromDtoList(e),n=t.filter(a=>a.type===mn.REPORT_RUN);if(n.length>0){const i=await new Uy().enhanceTriggersWithReportData(n);return t.map(o=>o.type===mn.REPORT_RUN?i.find(u=>u.id===o.id)??o:o)}return t},mapToCreateRequest(e){return Iv.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return Iv.getMapper(e.type).mapToUpdateRequest(e)}};function TB({children:e}){const[t,n]=g.useReducer(lB,t2),a=g.useCallback(async b=>{n({type:"FETCH_TRIGGERS_START"});try{const y=await al.getScheduledTriggers(b),S=await eu.mapFromDtoListWithReportData(y);n({type:"FETCH_TRIGGERS_SUCCESS",payload:S})}catch(y){n({type:"FETCH_TRIGGERS_ERROR",payload:y instanceof Error?y.message:"Failed to fetch scheduled triggers"})}},[]),i=g.useCallback(async(b,y)=>{n({type:"FETCH_TRIGGERS_START"});try{const w=(await al.getScheduledTriggers(b)).filter(C=>C.type===y),E=await eu.mapFromDtoListWithReportData(w);n({type:"FETCH_TRIGGERS_SUCCESS",payload:E})}catch(S){n({type:"FETCH_TRIGGERS_ERROR",payload:S instanceof Error?S.message:"Failed to fetch scheduled triggers"})}},[]),o=g.useCallback(async(b,y)=>{n({type:"FETCH_TRIGGER_START"});try{const S=await al.getScheduledTrigger(b,y),w=await eu.mapFromDtoWithReportData(S);n({type:"FETCH_TRIGGER_SUCCESS",payload:w})}catch(S){n({type:"FETCH_TRIGGER_ERROR",payload:S instanceof Error?S.message:"Failed to fetch scheduled trigger"})}},[]),u=g.useCallback(async(b,y,S,w,E,C)=>{n({type:"CREATE_TRIGGER_START"});try{const R={type:y,cronExpression:S,timeZone:w,isActive:E,triggerConfig:C},T=await al.createScheduledTrigger(b,R),N=await eu.mapFromDtoWithReportData(T);return n({type:"CREATE_TRIGGER_SUCCESS",payload:N}),N}catch(R){throw n({type:"CREATE_TRIGGER_ERROR",payload:R instanceof Error?R.message:"Failed to create scheduled trigger"}),R}},[]),f=g.useCallback(async(b,y,S,w,E)=>{n({type:"UPDATE_TRIGGER_START"});try{const C={cronExpression:S,timeZone:w,isActive:E},R=await al.updateScheduledTrigger(b,y,C),T=await eu.mapFromDtoWithReportData(R);n({type:"UPDATE_TRIGGER_SUCCESS",payload:T})}catch(C){throw n({type:"UPDATE_TRIGGER_ERROR",payload:C instanceof Error?C.message:"Failed to update scheduled trigger"}),C}},[]),h=g.useCallback(async(b,y)=>{n({type:"DELETE_TRIGGER_START"});try{await al.deleteScheduledTrigger(b,y),n({type:"DELETE_TRIGGER_SUCCESS",payload:y})}catch(S){throw n({type:"DELETE_TRIGGER_ERROR",payload:S instanceof Error?S.message:"Failed to delete scheduled trigger"}),S}},[]),m=g.useCallback(b=>{n({type:"SELECT_TRIGGER",payload:b})},[]),v=g.useCallback(()=>{n({type:"RESET"})},[]);return c.jsx(e2.Provider,{value:{...t,getScheduledTriggers:a,getScheduledTriggersByType:i,getScheduledTrigger:o,createScheduledTrigger:u,updateScheduledTrigger:f,deleteScheduledTrigger:h,selectScheduledTrigger:m,reset:v},children:e})}function i2(){const e=g.useContext(e2);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function NB(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:a,createScheduledTrigger:i,updateScheduledTrigger:o,deleteScheduledTrigger:u,selectScheduledTrigger:f,reset:h,triggers:m,selectedTrigger:v,isLoading:b,error:y}=i2();return g.useEffect(()=>(e?t(e):h(),()=>{h()}),[e,t,h]),{triggers:m,selectedTrigger:v,isLoading:b,error:y,getScheduledTriggers:S=>t(S),getScheduledTriggersByType:(S,w)=>n(S,w),getScheduledTrigger:(S,w)=>a(S,w),createScheduledTrigger:(S,w,E,C,R,T)=>i(S,w,E,C,R,T),updateScheduledTrigger:(S,w,E,C,R)=>o(S,w,E,C,R),deleteScheduledTrigger:(S,w)=>u(S,w),selectScheduledTrigger:f}}const AB=$t({type:ys(dl.SCHEDULED_REPORT_RUN),reportId:Bt().min(1,"Report ID is required")}),jB=XF(),DB=$t({type:Mx(mn),cronExpression:Bt().min(1,"Cron expression is required"),timeZone:Bt().min(1,"Time zone is required"),isActive:QF(),triggerConfig:JF([AB,jB])});function OB({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:a}){const i=Fl({resolver:Ul(DB),defaultValues:{type:e?e.type:n??mn.REPORT_RUN,cronExpression:(e==null?void 0:e.cronExpression)??"",timeZone:(e==null?void 0:e.timeZone)??Intl.DateTimeFormat().resolvedOptions().timeZone,isActive:(e==null?void 0:e.isActive)??!0,triggerConfig:e?e.triggerConfig:{type:dl.SCHEDULED_REPORT_RUN,reportId:t??""}}});g.useEffect(()=>{t&&i.getValues("type")===mn.REPORT_RUN&&i.setValue("triggerConfig",{type:dl.SCHEDULED_REPORT_RUN,reportId:t})},[t,i]),g.useEffect(()=>{n&&(i.setValue("type",n),n===mn.REPORT_RUN?i.setValue("triggerConfig",{type:dl.SCHEDULED_REPORT_RUN,reportId:t??""}):i.setValue("triggerConfig",null))},[n,t,i]);const o=f=>{i.setValue("type",f),f===mn.REPORT_RUN?i.setValue("triggerConfig",{type:dl.SCHEDULED_REPORT_RUN,reportId:t??""}):i.setValue("triggerConfig",null)},u=async f=>{try{await a(f)}catch(h){console.error("Error submitting form:",h)}};return{form:i,handleTypeChange:o,handleSubmit:i.handleSubmit(u),isDirty:i.formState.isDirty}}function MB({value:e,onChange:t,disabled:n}){const{reports:a,fetchReportsByDataMartId:i}=Pm(),{dataMart:o}=ld();return g.useEffect(()=>{o&&i(o.id)},[i,o]),c.jsxs(Ma,{value:e,onValueChange:t,disabled:n,children:[c.jsx(La,{className:"w-full",children:c.jsx(ka,{placeholder:"Select a report"})}),c.jsx(Ia,{children:a.map(u=>c.jsx(An,{value:u.id,children:u.title},u.id))})]})}var Fm="Switch",[kB,iZ]=Br(Fm),[LB,IB]=kB(Fm),o2=g.forwardRef((e,t)=>{const{__scopeSwitch:n,name:a,checked:i,defaultChecked:o,required:u,disabled:f,value:h="on",onCheckedChange:m,form:v,...b}=e,[y,S]=g.useState(null),w=xt(t,N=>S(N)),E=g.useRef(!1),C=y?v||!!y.closest("form"):!0,[R,T]=ds({prop:i,defaultProp:o??!1,onChange:m,caller:Fm});return c.jsxs(LB,{scope:n,checked:R,disabled:f,children:[c.jsx(We.button,{type:"button",role:"switch","aria-checked":R,"aria-required":u,"data-state":d2(R),"data-disabled":f?"":void 0,disabled:f,value:h,...b,ref:w,onClick:Re(e.onClick,N=>{T(O=>!O),C&&(E.current=N.isPropagationStopped(),E.current||N.stopPropagation())})}),C&&c.jsx(u2,{control:y,bubbles:!E.current,name:a,value:h,checked:R,required:u,disabled:f,form:v,style:{transform:"translateX(-100%)"}})]})});o2.displayName=Fm;var l2="SwitchThumb",c2=g.forwardRef((e,t)=>{const{__scopeSwitch:n,...a}=e,i=IB(l2,n);return c.jsx(We.span,{"data-state":d2(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t})});c2.displayName=l2;var PB="SwitchBubbleInput",u2=g.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:a=!0,...i},o)=>{const u=g.useRef(null),f=xt(u,o),h=FN(n),m=U1(t);return g.useEffect(()=>{const v=u.current;if(!v)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set;if(h!==n&&S){const w=new Event("click",{bubbles:a});S.call(v,n),v.dispatchEvent(w)}},[h,n,a]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:f,style:{...i.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});u2.displayName=PB;function d2(e){return e?"checked":"unchecked"}var FB=o2,UB=c2;function zB({className:e,...t}){return c.jsx(FB,{"data-slot":"switch",className:ye("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:c.jsx(UB,{"data-slot":"switch-thumb",className:ye("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function VB(e){const t=e.trim().split(/\s+/);return t.length!==5?null:{minute:t[0],hour:t[1],day:t[2],month:t[3],dayOfWeek:t[4]}}function zy(e,t="UTC"){const n=VB(e);if(!n)return{type:"daily",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};const{minute:a,hour:i,day:o,month:u,dayOfWeek:f}=n;if(a.startsWith("*/")&&i==="*"&&o==="*"&&u==="*"&&f==="*"){const b=Number.parseInt(a.substring(2));if(!isNaN(b))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:b,timezone:t}}if(a!=="*"&&i.startsWith("*/")&&o==="*"&&u==="*"&&f==="*"){const b=Number.parseInt(i.substring(2));if(!isNaN(b)&&a==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:b,timezone:t}}const h=Number.parseInt(a),m=Number.parseInt(i),v=!isNaN(h)&&!isNaN(m)?`${m.toString().padStart(2,"0")}:${h.toString().padStart(2,"0")}`:"09:00";if(!isNaN(h)&&!isNaN(m)&&o==="*"&&u==="*"&&f==="*")return{type:"daily",time:v,weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};if(!isNaN(h)&&!isNaN(m)&&o==="*"&&u==="*"&&f!=="*"){const b=f.split(",").map(y=>Number.parseInt(y.trim())).filter(y=>!isNaN(y)&&y>=0&&y<=6);if(b.length>0)return{type:"weekly",time:v,weekdays:b,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(h)&&!isNaN(m)&&o!=="*"&&u==="*"&&f==="*"){const b=o.split(",").map(y=>Number.parseInt(y.trim())).filter(y=>!isNaN(y)&&y>=1&&y<=31);if(b.length>0)return{type:"monthly",time:v,weekdays:[1,2,3,4,5],monthDays:b,customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}return{type:"custom",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}function f2({options:e,selected:t,onSelectionChange:n,placeholder:a="Select items...",searchPlaceholder:i="Search...",maxDisplayItems:o=3}){const[u,f]=g.useState(!1),h=b=>{const y=t.includes(b)?t.filter(S=>S!==b):[...t,b].sort((S,w)=>S-w);n(y)},m=(b,y)=>{y.preventDefault(),y.stopPropagation(),n(t.filter(S=>S!==b))},v=()=>{if(t.length===0)return c.jsx("span",{className:"text-muted-foreground text-sm",children:a});const b=t.map(y=>e.find(S=>S.value===y)).filter(Boolean);return b.length<=o?c.jsx("div",{className:"flex flex-wrap gap-1",children:b.map(y=>c.jsxs(yr,{variant:"secondary",className:"text-xs h-5",children:[y.label,c.jsx("span",{className:"ml-1 hover:bg-secondary-foreground/20 rounded-full p-0.5 cursor-pointer inline-flex items-center justify-center",onClick:S=>m(y.value,S),children:c.jsx(uh,{className:"h-2 w-2"})})]},y.value))}):c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs(yr,{variant:"secondary",className:"text-xs h-5",children:[b[0].label,c.jsx("span",{className:"ml-1 hover:bg-secondary-foreground/20 rounded-full p-0.5 cursor-pointer inline-flex items-center justify-center",onClick:y=>m(b[0].value,y),children:c.jsx(uh,{className:"h-2 w-2"})})]}),b.length>1&&c.jsxs(yr,{variant:"outline",className:"text-xs h-5",children:["+",b.length-1]})]})};return c.jsxs(GA,{open:u,onOpenChange:f,modal:!0,children:[c.jsx(qA,{asChild:!0,children:c.jsxs(Ue,{variant:"outline",role:"combobox","aria-expanded":u,className:"w-full justify-between bg-transparent h-9 min-h-9 py-1",children:[c.jsx("div",{className:"flex-1 text-left",children:v()}),c.jsx(kR,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),c.jsx(ZA,{className:"w-full p-0 max-h-[400px] overflow-y-auto",style:{padding:0},children:c.jsxs(jA,{className:"overflow-visible h-full",children:[c.jsx(DA,{placeholder:i,className:"h-8"}),c.jsxs(bH,{className:"max-h-[350px] h-full overflow-y-auto",children:[c.jsx(OA,{children:"No items found."}),c.jsx(MA,{className:"overflow-visible h-full",children:e.map(b=>c.jsxs(kA,{value:b.value.toString(),onSelect:()=>h(b.value),className:"text-sm",children:[c.jsx(Ta,{className:ye("mr-2 h-3 w-3",t.includes(b.value)?"opacity-100":"opacity-0")}),b.label]},b.value))})]})]})})]})}const h2=[{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"},{value:0,label:"Sunday"}],cu=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function m2(e,t,n){if(!t)return"Schedule is disabled";const a=e.time,i=n!==cu()?` (${n})`:"";switch(e.type){case"daily":return`Daily at ${a}${i}`;case"weekly":return`Weekly on ${e.weekdays.map(u=>{var f;return(f=h2.find(h=>h.value===u))==null?void 0:f.label}).join(", ")} at ${a}${i}`;case"monthly":{const u=[...e.monthDays].sort((h,m)=>h-m).map(h=>h===1?"1st":h===2?"2nd":h===3?"3rd":`${String(h)}th`);return`Monthly on the ${u.length===1?u[0]:u.length===2?`${u[0]} and ${u[1]}`:`${u.slice(0,-1).join(", ")}, and ${u[u.length-1]}`} at ${a}${i}`}case"interval":return e.intervalType==="minutes"?`Every ${String(e.intervalValue)} minute${e.intervalValue!==1?"s":""}${i}`:`Every ${String(e.intervalValue)} hour${e.intervalValue!==1?"s":""}${i}`;case"custom":return`Custom schedule${i}`;default:return""}}function $B(e,t,n=!0){const a=zy(e,t);return m2(a,n,t)}const HB=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),BB=[5,10,15,30],GB=[1,2,3,4,6,8,12],qB=({value:e,onChange:t,disabled:n})=>c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ht,{children:"Type"}),c.jsxs(Ma,{value:e,onValueChange:a=>{t(a)},disabled:n,children:[c.jsx(La,{className:"w-full",children:c.jsx(ka,{})}),c.jsxs(Ia,{children:[c.jsx(An,{value:"daily",children:"Daily"}),c.jsx(An,{value:"weekly",children:"Weekly"}),c.jsx(An,{value:"monthly",children:"Monthly"}),c.jsx(An,{value:"interval",children:"Interval"})]})]})]}),ZB=({value:e,onChange:t,disabled:n})=>c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ht,{children:"Time"}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(Ut,{className:"w-24",type:"time",value:e,onChange:a=>{t(a.target.value)},disabled:n})})]}),KC=({value:e,onChange:t,disabled:n,timezones:a})=>c.jsxs("div",{className:"w-full space-y-2",children:[c.jsx(Ht,{children:"Timezone"}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(Jx,{options:a,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),YB=({value:e,onChange:t,disabled:n})=>c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ht,{children:"Days of Week"}),c.jsx("div",{className:n?"pointer-events-none":"",children:c.jsx(f2,{options:h2,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),KB=({value:e,onChange:t,disabled:n})=>c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ht,{children:"Days of Month"}),c.jsx("div",{className:n?"pointer-events-none":"",children:c.jsx(f2,{options:HB,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),QB=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:a,disabled:i})=>c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ht,{children:"Type"}),c.jsxs(Ma,{value:e,onValueChange:o=>{n(o)},disabled:i,children:[c.jsx(La,{className:"w-full",children:c.jsx(ka,{})}),c.jsxs(Ia,{children:[c.jsx(An,{value:"minutes",children:"Minutes"}),c.jsx(An,{value:"hours",children:"Hours"})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ht,{children:"Every"}),c.jsxs(Ma,{value:t.toString(),onValueChange:o=>{a(Number.parseInt(o)||1)},disabled:i,children:[c.jsx(La,{className:"w-full",children:c.jsx(ka,{})}),c.jsx(Ia,{children:(e==="minutes"?BB:GB).map(o=>c.jsxs(An,{value:o.toString(),children:[o," ",e==="minutes"?"min":"hr"]},o))})]})]})]}),XB=({value:e,onChange:t,disabled:n})=>c.jsxs("div",{className:"space-y-1",children:[c.jsx(Ht,{className:"text-sm",children:"Cron Expression"}),c.jsx(Ut,{value:e,onChange:a=>{t(a.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function WB({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:a,className:i,showPreview:o=!0,showSaveButton:u=!1}){const[f,h]=g.useState(n),[m,v]=g.useState(t??cu()),[b,y]=g.useState(!1),S=g.useMemo(()=>A9.getTimezonesWithOffset().map(V=>({value:V.identifier,label:V.displayName,offset:V.offsetString,isDST:V.isDST})),[]),[w,E]=g.useState(()=>zy(e,m)),[C,R]=g.useState(""),[T,N]=g.useState("");g.useEffect(()=>{h(n)},[n]),g.useEffect(()=>{const V=t??cu();v(V)},[t]),g.useEffect(()=>{if(e){const V=zy(e,m);E(V)}},[e,m]);const O=V=>{const[le,ue]=V.time.split(":").map(Number);switch(V.type){case"daily":return`${String(ue)} ${String(le)} * * *`;case"weekly":return`${String(ue)} ${String(le)} * * ${V.weekdays.join(",")}`;case"monthly":return`${String(ue)} ${String(le)} ${V.monthDays.join(",")} * *`;case"interval":return V.intervalType==="minutes"?`*/${String(V.intervalValue)} * * * *`:`0 */${String(V.intervalValue)} * * *`;case"custom":return V.customCron;default:return`${String(ue)} ${String(le)} * * *`}},A=g.useMemo(()=>V=>m2(V,f,m),[f,m]);g.useEffect(()=>{const V=O(w);R(V),N(A(w))},[w,f,m,A]);const D=g.useRef(""),L=g.useRef(""),H=g.useRef(!1);g.useEffect(()=>{const V=O(w);a&&(D.current!==V||L.current!==m||H.current!==f)&&(a({cron:V,timezone:m,enabled:f}),D.current=V,L.current=m,H.current=f)},[w,m,f,a]);const X=V=>{h(V)},re=V=>{v(V),E(le=>({...le,timezone:V}))},me=["daily","weekly","monthly"].includes(w.type);return c.jsxs("div",{className:i,children:[c.jsx("div",{className:"mb-4 space-y-4 pt-0",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-foreground flex items-center gap-1.5 font-medium",children:"Schedule Settings"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ht,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:f?"Enabled":"Disabled"}),c.jsx(zB,{id:"schedule-enabled",checked:f,onCheckedChange:X})]})]})}),c.jsxs("div",{className:"space-y-4 pt-0",children:[c.jsxs("div",{className:`space-y-4 ${f?"":"opacity-50"}`,children:[c.jsx(qB,{value:w.type,onChange:V=>{E(le=>({...le,type:V}))},disabled:!f}),w.type!=="custom"&&w.type!=="interval"&&c.jsxs("div",{className:"flex gap-3",children:[c.jsx(ZB,{value:w.time,onChange:V=>{E(le=>({...le,time:V}))},disabled:!f}),me&&c.jsx(KC,{value:m,onChange:re,disabled:!f,timezones:S})]}),(w.type==="interval"||w.type==="custom")&&c.jsx(KC,{value:m,onChange:re,disabled:!f,timezones:S}),w.type==="weekly"&&c.jsx(YB,{value:w.weekdays,onChange:V=>{E(le=>({...le,weekdays:V}))},disabled:!f}),w.type==="monthly"&&c.jsx(KB,{value:w.monthDays,onChange:V=>{E(le=>({...le,monthDays:V}))},disabled:!f}),w.type==="interval"&&c.jsx(QB,{intervalType:w.intervalType,intervalValue:w.intervalValue,onTypeChange:V=>{E(le=>({...le,intervalType:V,intervalValue:V==="minutes"?15:1}))},onValueChange:V=>{E(le=>({...le,intervalValue:V}))},disabled:!f}),w.type==="custom"&&c.jsx(XB,{value:w.customCron,onChange:V=>{E(le=>({...le,customCron:V}))},disabled:!f})]}),o&&c.jsxs(c.Fragment,{children:[c.jsx(Fu,{className:"my-3"}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{y(!b)},children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(y3,{className:"h-4 w-4"}),c.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),b?c.jsx(Na,{className:"text-muted-foreground h-4 w-4"}):c.jsx(gs,{className:"text-muted-foreground h-4 w-4"})]}),b&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),c.jsx(yr,{variant:f?"default":"secondary",className:"text-xs",children:f?"Enabled":"Disabled"})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),c.jsx(yr,{variant:"secondary",className:"font-mono text-xs",children:C})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),c.jsx(yr,{variant:"outline",className:"text-xs",children:m})]}),c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),c.jsx("span",{className:"flex-1 text-right text-xs",children:T})]})]}),f&&me&&m!==cu()&&c.jsxs(t0,{className:"border-amber-200 bg-amber-50",children:[c.jsx(Yh,{className:"h-4 w-4"}),c.jsx(JA,{children:"Time Zone"}),c.jsxs(n0,{children:["Schedule runs in ",m," (not your local ",cu()," ","time). Execution time may differ from expected."]})]})]})]})]}),u&&c.jsx(Ue,{className:"w-full",disabled:!f,children:"Save Schedule"})]})]})}function JB({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:a,onCancel:i,onDirtyChange:o}){const[u,f]=g.useState(!1),{form:h,handleTypeChange:m,handleSubmit:v,isDirty:b}=OB({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async C=>{f(!0);try{await a(C)}finally{f(!1)}}});g.useEffect(()=>{o==null||o(b)},[b,o]);const{control:y,watch:S}=h,E=S("type")===mn.REPORT_RUN;return c.jsx(e0,{...h,children:c.jsxs("form",{className:"flex flex-1 flex-col overflow-hidden",onSubmit:C=>{C.preventDefault(),v()},children:[c.jsx("div",{className:"bg-muted flex-1 overflow-y-auto p-4 dark:bg-transparent",children:c.jsxs("div",{className:"flex min-h-full flex-col gap-4",children:[c.jsx(xr,{control:y,name:"type",render:({field:C})=>c.jsxs(br,{className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:[c.jsx(Vr,{className:"text-foreground flex items-center gap-1.5 text-sm font-medium",children:"Trigger Type"}),c.jsxs(Ma,{onValueChange:R=>{C.onChange(R),m(R)},defaultValue:C.value,disabled:!!n||!!e||!!S("triggerConfig.reportId"),children:[c.jsx(Sr,{children:c.jsx(La,{className:"w-full",children:c.jsx(ka,{placeholder:"Select trigger type"})})}),c.jsxs(Ia,{children:[c.jsx(An,{value:mn.REPORT_RUN,children:"Report Run"}),c.jsx(An,{value:mn.CONNECTOR_RUN,children:"Connector Run"})]})]}),c.jsx(ju,{children:e?"Trigger type cannot be changed after creation.":"Choose the type of trigger - run a report or connector."}),c.jsx(wr,{})]})}),E&&c.jsx(xr,{control:y,name:"triggerConfig.reportId",render:({field:C})=>c.jsxs(br,{className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:[c.jsx(Vr,{className:"text-foreground flex items-center gap-1.5 text-sm font-medium",children:"Report"}),c.jsx(Sr,{children:c.jsx(s2,{children:c.jsx(MB,{value:C.value,onChange:C.onChange,disabled:!!t||!!e})})}),c.jsx(ju,{children:c.jsx("span",{className:"text-sm",children:e!=null&&e.triggerConfig?"The report cannot be changed for existing triggers. To use a different report, please create a new trigger":"Select the report that will be run by this trigger"})}),c.jsx(wr,{})]})}),c.jsx("div",{className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-4 transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:c.jsx(WB,{showPreview:!1,cron:S("cronExpression"),timezone:S("timeZone"),enabled:S("isActive"),onChange:C=>{h.setValue("cronExpression",C.cron,{shouldDirty:!0}),h.setValue("timeZone",C.timezone,{shouldDirty:!0}),h.setValue("isActive",C.enabled,{shouldDirty:!0})}})})]})}),c.jsxs("div",{className:"flex flex-col gap-1.5 border-t px-4 py-3",children:[c.jsx(Ue,{type:"submit",disabled:u||!b,className:"w-full",children:u?"Saving...":"Save"}),i&&c.jsx(Ue,{variant:"outline",onClick:i,type:"button",className:"w-full",children:"Cancel"})]})]})})}function eG(e){const t=g.useMemo(()=>Array.isArray(e)?Object.fromEntries(e.filter(i=>i.meta.hidden).map(i=>["id"in i&&i.id?i.id:"accessorKey"in i&&typeof i.accessorKey=="string"?i.accessorKey:void 0,!1]).filter(([i])=>i!==void 0)):{},[e]),[n,a]=g.useState({});return g.useEffect(()=>{a(t)},[t]),{columnVisibility:n,setColumnVisibility:a,defaultHiddenColumns:t}}function Vy({date:e,className:t=""}){const n=g.useMemo(()=>{const a=new Date,i=e.getTime()-a.getTime(),o=Math.abs(i),u=i<0,f=Math.floor(o/(1e3*60)),h=Math.floor(o/(1e3*60*60)),m=Math.floor(o/(1e3*60*60*24)),v=Math.floor(m/7),b=Math.floor(m/30),y=Math.floor(m/365),S=E=>E.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),w=E=>E.toLocaleDateString("en-US",{weekday:"long"});if(f<1)return u?"just now":"in a moment";if(f<60)return u?f===1?"1 minute ago":`${f} minutes ago`:f===1?"in 1 minute":`in ${f} minutes`;if(h<24)return u?h===1?"1 hour ago":`${h} hours ago`:h===1?"in 1 hour":`in ${h} hours`;if(m===1){const E=S(e);return u?`yesterday at ${E}`:`tomorrow at ${E}`}if(m<7){const E=w(e),C=S(e);return u?`last ${E} at ${C}`:`this ${E} at ${C}`}if(m<14){const E=w(e),C=S(e);return u?`last ${E} at ${C}`:`next ${E} at ${C}`}return v<4?u?v===2?"2 weeks ago":"3 weeks ago":v===2?"in 2 weeks":"in 3 weeks":b<12?u?b===1?"1 month ago":`${b} months ago`:b===1?"in 1 month":`in ${b} months`:u?y===1?"1 year ago":`${y} years ago`:y===1?"in 1 year":`in ${y} years`},[e]);return c.jsx("span",{className:`text-sm text-muted-foreground ${t}`,title:e.toLocaleString(),children:n})}function tG({cronExpression:e,timeZone:t,isEnabled:n=!0}){const a=g.useMemo(()=>$B(e,t,n),[e,t,n]);return c.jsxs("div",{children:[c.jsx("div",{children:a}),n&&c.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function nG({table:e}){return c.jsx("div",{className:"px-3 text-right",children:c.jsxs(Gr,{children:[c.jsx(qr,{asChild:!0,children:c.jsx(Ue,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:c.jsx(vs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),c.jsx(Cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>c.jsx(Zt,{className:"capitalize",children:c.jsxs("label",{className:"flex items-center space-x-2",children:[c.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta.title??t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&c.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:c.jsx(Ta,{className:"size-3.5"})})}),c.jsx("span",{children:t.columnDef.meta.title??t.id})]})},t.id))})]})})}function rG({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[a,i]=g.useState(!1),[o,u]=g.useState(!1),f=()=>{u(!1),n(e.id)};return c.jsxs("div",{className:"text-right",onClick:h=>{h.stopPropagation()},children:[c.jsxs(Gr,{open:a,onOpenChange:i,children:[c.jsx(qr,{asChild:!0,children:c.jsx(Ue,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${a?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:c.jsx(vs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),c.jsxs(Cr,{align:"end",children:[c.jsx(Zt,{className:"dm-card-table-body-row-actiondropdownitem",onClick:()=>{t(e.id)},children:"Edit"}),c.jsx(ho,{}),c.jsx(Zt,{className:"dm-card-table-body-row-actiondropdownitem text-red-600",onClick:()=>{u(!0)},children:"Delete"})]})]}),c.jsx(po,{open:o,onOpenChange:u,title:"Delete Scheduled Trigger",description:"Are you sure you want to delete this scheduled trigger? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:f,variant:"destructive"})]})}var Pv,Um="HoverCard",[p2,oZ]=Br(Um,[Ua]),zm=Ua(),[aG,Vm]=p2(Um),g2=e=>{const{__scopeHoverCard:t,children:n,open:a,defaultOpen:i,onOpenChange:o,openDelay:u=700,closeDelay:f=300}=e,h=zm(t),m=g.useRef(0),v=g.useRef(0),b=g.useRef(!1),y=g.useRef(!1),[S,w]=ds({prop:a,defaultProp:i??!1,onChange:o,caller:Um}),E=g.useCallback(()=>{clearTimeout(v.current),m.current=window.setTimeout(()=>w(!0),u)},[u,w]),C=g.useCallback(()=>{clearTimeout(m.current),!b.current&&!y.current&&(v.current=window.setTimeout(()=>w(!1),f))},[f,w]),R=g.useCallback(()=>w(!1),[w]);return g.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(v.current)},[]),c.jsx(aG,{scope:t,open:S,onOpenChange:w,onOpen:E,onClose:C,onDismiss:R,hasSelectionRef:b,isPointerDownOnContentRef:y,children:c.jsx($u,{...h,children:n})})};g2.displayName=Um;var v2="HoverCardTrigger",y2=g.forwardRef((e,t)=>{const{__scopeHoverCard:n,...a}=e,i=Vm(v2,n),o=zm(n);return c.jsx(Dl,{asChild:!0,...o,children:c.jsx(We.a,{"data-state":i.open?"open":"closed",...a,ref:t,onPointerEnter:Re(e.onPointerEnter,$h(i.onOpen)),onPointerLeave:Re(e.onPointerLeave,$h(i.onClose)),onFocus:Re(e.onFocus,i.onOpen),onBlur:Re(e.onBlur,i.onClose),onTouchStart:Re(e.onTouchStart,u=>u.preventDefault())})})});y2.displayName=v2;var s0="HoverCardPortal",[sG,iG]=p2(s0,{forceMount:void 0}),x2=e=>{const{__scopeHoverCard:t,forceMount:n,children:a,container:i}=e,o=Vm(s0,t);return c.jsx(sG,{scope:t,forceMount:n,children:c.jsx(nr,{present:n||o.open,children:c.jsx(co,{asChild:!0,container:i,children:a})})})};x2.displayName=s0;var Vh="HoverCardContent",b2=g.forwardRef((e,t)=>{const n=iG(Vh,e.__scopeHoverCard),{forceMount:a=n.forceMount,...i}=e,o=Vm(Vh,e.__scopeHoverCard);return c.jsx(nr,{present:a||o.open,children:c.jsx(oG,{"data-state":o.open?"open":"closed",...i,onPointerEnter:Re(e.onPointerEnter,$h(o.onOpen)),onPointerLeave:Re(e.onPointerLeave,$h(o.onClose)),ref:t})})});b2.displayName=Vh;var oG=g.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:u,...f}=e,h=Vm(Vh,n),m=zm(n),v=g.useRef(null),b=xt(t,v),[y,S]=g.useState(!1);return g.useEffect(()=>{if(y){const w=document.body;return Pv=w.style.userSelect||w.style.webkitUserSelect,w.style.userSelect="none",w.style.webkitUserSelect="none",()=>{w.style.userSelect=Pv,w.style.webkitUserSelect=Pv}}},[y]),g.useEffect(()=>{if(v.current){const w=()=>{S(!1),h.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var C;((C=document.getSelection())==null?void 0:C.toString())!==""&&(h.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",w),()=>{document.removeEventListener("pointerup",w),h.hasSelectionRef.current=!1,h.isPointerDownOnContentRef.current=!1}}},[h.isPointerDownOnContentRef,h.hasSelectionRef]),g.useEffect(()=>{v.current&&uG(v.current).forEach(E=>E.setAttribute("tabindex","-1"))}),c.jsx(lo,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:Re(o,w=>{w.preventDefault()}),onDismiss:h.onDismiss,children:c.jsx(Hu,{...m,...f,onPointerDown:Re(f.onPointerDown,w=>{w.currentTarget.contains(w.target)&&S(!0),h.hasSelectionRef.current=!1,h.isPointerDownOnContentRef.current=!0}),ref:b,style:{...f.style,userSelect:y?"text":void 0,WebkitUserSelect:y?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),lG="HoverCardArrow",cG=g.forwardRef((e,t)=>{const{__scopeHoverCard:n,...a}=e,i=zm(n);return c.jsx(Bu,{...i,...a,ref:t})});cG.displayName=lG;function $h(e){return t=>t.pointerType==="touch"?void 0:e()}function uG(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var dG=g2,fG=y2,hG=x2,mG=b2;function pG({...e}){return c.jsx(dG,{"data-slot":"hover-card",...e})}function gG({...e}){return c.jsx(fG,{"data-slot":"hover-card-trigger",...e})}function vG({className:e,align:t="center",sideOffset:n=4,...a}){return c.jsx(hG,{"data-slot":"hover-card-portal",children:c.jsx(mG,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:ye("bg-popover text-popover-foreground 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 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...a})})}function yG({report:e,children:t}){return c.jsxs(pG,{children:[c.jsx(gG,{asChild:!0,children:c.jsx("div",{className:"text-sm hover:cursor-help",children:t})}),c.jsx(vG,{className:"w-110",children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-semibold",children:e.title||"Unnamed Report"}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:["ID: ",e.id]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium",children:"Last Run Status"}),e.lastRunStatus?c.jsx("div",{className:"mt-1",children:c.jsx(RB,{status:e.lastRunStatus})}):c.jsx("p",{className:"text-muted-foreground text-sm",children:"Not run yet"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium",children:"Last Run"}),c.jsx("p",{className:"text-sm",children:e.lastRunDate?c.jsx(Vy,{date:e.lastRunDate}):"Never run"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium",children:"Total Runs"}),c.jsx("p",{className:"text-sm",children:e.runsCount||0})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium",children:"Destination"}),e.destinationConfig.spreadsheetId?c.jsxs("a",{href:r0(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-blue-500 hover:underline",title:"Open Document","aria-label":"Open Document",children:[c.jsx(jx,{size:20}),"Open Document",c.jsx(Jy,{className:"h-3 w-3","aria-hidden":"true"})]}):c.jsx("p",{className:"text-sm",children:"Not specified"})]})]}),e.lastRunError&&c.jsx("div",{children:c.jsx("p",{className:"text-destructive text-xs",children:e.lastRunError})}),c.jsx("div",{className:"border-t pt-2",children:c.jsxs("div",{className:"text-muted-foreground flex justify-between text-xs",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Created:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e.createdAt))]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Modified:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e.modifiedAt))]})]})})]})})]})}function xG({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",header:"Type",cell:({row:n})=>{const i=n.getValue("type")===mn.REPORT_RUN?"Report":"Connector";return c.jsx(yr,{variant:"outline",className:"px-2 py-0.5 text-xs",children:i})},meta:{title:"Type"},size:100},{accessorKey:"triggerConfig",header:"Report",cell:({row:n})=>{const a=n.original;if(a.type===mn.REPORT_RUN&&a.triggerConfig){const i=a.triggerConfig;return c.jsx(yG,{report:i.report,children:i.report.title})}else return c.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})},meta:{title:"Target"}},{accessorKey:"cronExpression",header:"Schedule",cell:({row:n})=>{const a=n.getValue("cronExpression"),i=n.original.timeZone,o=n.getValue("isActive");return c.jsx(tG,{cronExpression:String(a),timeZone:i,isEnabled:o})},meta:{title:"Schedule"}},{accessorKey:"nextRun",header:"Next Run",cell:({row:n})=>{const a=n.original.nextRun;return c.jsx("div",{className:"text-sm",children:a?c.jsx(Vy,{date:new Date(a)}):c.jsx("span",{className:"text-muted-foreground text-sm",children:"Not scheduled"})})},meta:{title:"Next Run"}},{accessorKey:"lastRun",header:"Last Run",cell:({row:n})=>{const a=n.original.lastRun;return c.jsx("div",{className:"text-sm",children:a?c.jsx(Vy,{date:new Date(a)}):c.jsx("span",{className:"text-muted-foreground text-sm",children:"Never run"})})},meta:{title:"Last Run"}},{accessorKey:"isActive",header:"Status",cell:({row:n})=>{const a=n.getValue("isActive");return c.jsx(yr,{variant:a?"default":"secondary",children:a?"Active":"Inactive"})},meta:{title:"Status"}},{id:"actions",header:({table:n})=>c.jsx(nG,{table:n}),cell:({row:n})=>c.jsx(rG,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function bG({searchInputId:e,onAddTrigger:t,filterValue:n,onFilterChange:a}){return c.jsxs("div",{className:"dm-card-toolbar",children:[c.jsx("div",{className:"dm-card-toolbar-left",children:c.jsxs("div",{className:"dm-card-toolbar-search",children:[c.jsx(oo,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),c.jsx(Ut,{id:e,placeholder:"Search triggers",value:n,onChange:a,className:"dm-card-toolbar-search-input","aria-label":"Search triggers"})]})}),c.jsx("div",{className:"dm-card-toolbar-right",children:c.jsxs(Ue,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:t,"aria-label":"Add new trigger",children:[c.jsx(Pa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]})}function SG({table:e,onPreviousClick:t,onNextClick:n}){return c.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[c.jsx(Ue,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),c.jsx(Ue,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function wG(e){const[t,n]=g.useState(""),a=g.useCallback(i=>{const o=i.target.value;n(o),e.setGlobalFilter(o)},[e]);return{value:t,onChange:a}}function S2({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:a,preSelectedType:i}){const{createScheduledTrigger:o,updateScheduledTrigger:u,selectedTrigger:f}=i2(),[h,m]=g.useState(!1),[v,b]=g.useState(!1),y=g.useCallback(()=>{v?m(!0):t()},[v,t]),S=g.useCallback(()=>{m(!1),b(!1),t()},[t]),w=g.useCallback(N=>{b(N)},[]),E=g.useCallback(()=>{b(!1),t()},[t]),C=!!f,R=g.useMemo(()=>{var O;return f?{type:f.type,cronExpression:f.cronExpression,timeZone:f.timeZone,isActive:f.isActive,triggerConfig:f.type===mn.REPORT_RUN?{type:dl.SCHEDULED_REPORT_RUN,reportId:((O=f.triggerConfig)==null?void 0:O.reportId)??""}:null}:void 0},[f]),T=async N=>{C?await u(n,f.id,N.cronExpression,N.timeZone,N.isActive):await o(n,N.type,N.cronExpression,N.timeZone,N.isActive,N.triggerConfig),E()};return c.jsxs(c.Fragment,{children:[c.jsx(_l,{open:e,onOpenChange:N=>{N||y()},children:c.jsxs(Tl,{className:"flex h-full min-w-[480px] flex-col gap-0",children:[c.jsxs(Nl,{className:"border-b py-3",children:[c.jsxs(am,{children:[C?"Edit":"Create"," Scheduled Trigger"]}),c.jsx(sm,{children:"Configure a scheduled trigger to automatically run reports or connectors."})]}),c.jsx(JB,{preSelectedReportId:a,preSelectedType:i,initialData:R,onSubmit:T,onCancel:y,onDirtyChange:w})]})}),c.jsx(po,{open:h,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:S,variant:"destructive"})]})}function EG({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:a}){const[i,o]=g.useState([{id:"type",desc:!1}]),[u,f]=g.useState(!1),h=g.useCallback(()=>{f(!0)},[]),m=g.useCallback(()=>{f(!1)},[]),v=g.useCallback(A=>{a(A)},[a]),b=g.useMemo(()=>xG({onEditTrigger:n,onDeleteTrigger:v}),[n,v]),{columnVisibility:y,setColumnVisibility:S}=eG(b),w=rd({data:e,columns:b,getCoreRowModel:Ju(),getPaginationRowModel:td(),onSortingChange:o,getSortedRowModel:nd(),getFilteredRowModel:ed(),state:{sorting:i,columnVisibility:y},onColumnVisibilityChange:S,enableGlobalFilter:!0,enableColumnResizing:!1}),{value:E,onChange:C}=wG(w),R=g.useCallback(()=>{w.previousPage()},[w]),T=g.useCallback(()=>{w.nextPage()},[w]);return c.jsxs(c.Fragment,{children:[c.jsx(bG,{table:w,searchInputId:"scheduled-triggers-search-input",onAddTrigger:h,filterValue:E,onFilterChange:C}),c.jsx("div",{className:"dm-card-table-wrap",children:c.jsxs(ad,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[c.jsx(sd,{className:"dm-card-table-header",children:w.getHeaderGroups().map(A=>c.jsx(Hn,{className:"dm-card-table-header-row",children:A.headers.map(D=>c.jsx(od,{className:"[&:has([role=checkbox])]:pl-5 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",children:D.isPlaceholder?null:typeof D.column.columnDef.header=="function"?D.column.columnDef.header(D.getContext()):D.column.columnDef.header},D.id))},A.id))}),c.jsx(id,{className:"dm-card-table-body",children:w.getRowModel().rows.length?w.getRowModel().rows.map((A,D)=>c.jsx(Hn,{onClick:()=>{n(A.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":D+1,children:A.getVisibleCells().map((L,H)=>c.jsx(Oa,{className:`whitespace-normal ${L.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":H+1,children:typeof L.column.columnDef.cell=="function"?L.column.columnDef.cell(L.getContext()):L.column.columnDef.cell},L.id))},A.id)):c.jsx(Hn,{children:c.jsx(Oa,{colSpan:b.length,className:"dm-card-table-body-row-empty",role:"cell",children:c.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),c.jsx(SG,{table:w,onPreviousClick:R,onNextClick:T}),c.jsx(S2,{isOpen:u,onClose:m,dataMartId:t})]})}function CG({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:a,selectedTrigger:i}=NB(e),[o,u]=g.useState(!1);g.useEffect(()=>{i&&u(!0)},[i]);const f=v=>{const b=t.find(y=>y.id===v);b&&a(b)},h=()=>{u(!1),a(null)},m=async v=>{try{await n(e,v),Jt.success("Trigger deleted successfully")}catch(b){console.error("Error deleting trigger:",b),Jt.error("Failed to delete trigger")}};return c.jsxs(c.Fragment,{children:[c.jsx(EG,{triggers:t,dataMartId:e,onEditTrigger:f,onDeleteTrigger:v=>void m(v)}),c.jsx(S2,{isOpen:o,onClose:h,dataMartId:e})]})}function w2(){return c.jsx("div",{className:"border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-4 transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:c.jsxs("div",{className:"flex items-start gap-3 rounded-md bg-blue-50 p-3 dark:bg-blue-950/20",children:[c.jsx(VR,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium",children:"Time Triggers Now Available!"}),c.jsx("p",{className:"text-sm",children:"Create scheduled runs for your reports or connectors in the Triggers section. This powerful feature allows you to automate your reporting workflow."})]})]})})}function RG({dataStorageType:e,target:t,selectedNode:n,onTargetChange:a}){const i=()=>(t==null?void 0:t.fullyQualifiedName.split(".")[0])??"";return c.jsxs("div",{className:"space-y-4",children:[c.jsx("h4",{className:"text-lg font-medium",children:"Setup target"}),c.jsxs("div",{className:"flex flex-col gap-4",children:[e===st.GOOGLE_BIGQUERY&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("label",{htmlFor:"dataset-name",className:"text-muted-foreground text-sm",children:"Enter dataset name for Google BigQuery where the connector data will be stored. The dataset will be created automatically if it doesn't exist."}),c.jsx(Ut,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:i(),onChange:o=>{a({fullyQualifiedName:`${o.target.value}.${n.replace(/[^a-zA-Z0-9_]/g,"_")}`})}}),c.jsxs("div",{className:"text-muted-foreground mt-2 text-sm",children:['Table name will be created automatically based on the selected node name: "',n.replace(/[^a-zA-Z0-9_]/g,"_"),'"',c.jsx("br",{}),"Full path:"," ",c.jsxs("span",{className:"text-foreground/90",children:[i()||"[dataset]",".",n.replace(/[^a-zA-Z0-9_]/g,"_")]})]})]}),e===st.AWS_ATHENA&&c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsx("label",{htmlFor:"dataset-name",className:"text-muted-foreground text-sm",children:"Enter database name for Amazon Athena where the connector data will be stored. The database must exist before running the connector."}),c.jsx(Ut,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:i(),onChange:o=>{a({fullyQualifiedName:`${o.target.value}.${n.replace(/[^a-zA-Z0-9_]/g,"_")}`})}}),c.jsxs("div",{className:"text-muted-foreground mt-2 text-sm",children:['Table name will be created automatically based on the selected node name: "',n.replace(/[^a-zA-Z0-9_]/g,"_"),'"',c.jsx("br",{}),"Full path:"," ",c.jsxs("span",{className:"text-foreground/90",children:[i()||"[database]",".",n.replace(/[^a-zA-Z0-9_]/g,"_")]})]})]}),c.jsx(w2,{})]})]})}function _G({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:a,isLoading:i=!1,onNext:o,onBack:u,onFinish:f,nextLabel:h="Next",backLabel:m="Back",finishLabel:v="Finish"}){const b=e===t;return c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"flex-1",children:a&&c.jsxs(Ue,{variant:"outline",onClick:u,disabled:i,className:"flex items-center gap-2",children:[c.jsx(R4,{className:"h-4 w-4"}),m]})}),c.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),c.jsx("div",{className:"flex flex-1 justify-end",children:b?c.jsx(Ue,{onClick:f,disabled:!n||i,className:"flex items-center gap-2",children:v}):c.jsxs(Ue,{onClick:o,disabled:!n||i,className:"flex items-center gap-2",children:[h,c.jsx(Xy,{className:"h-4 w-4"})]})})]})}function TG({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:a=null}){const[i,o]=g.useState(null),[u,f]=g.useState(""),[h,m]=g.useState([]),[v,b]=g.useState(1),[y,S]=g.useState({}),[w,E]=g.useState(!1),[C,R]=g.useState(new Set),{connectors:T,connectorSpecification:N,connectorFields:O,loading:A,loadingSpecification:D,loadingFields:L,error:H,fetchAvailableConnectors:X,fetchConnectorSpecification:re,fetchConnectorFields:me}=eB(),[V,le]=g.useState(null),ne=(n?[{id:1,title:"Configuration",description:"Set up connector parameters"}]:[{id:1,title:"Select Connector",description:"Choose a data source"},{id:2,title:"Configuration",description:"Set up connector parameters"},{id:3,title:"Select Nodes",description:"Choose data nodes"},{id:4,title:"Select Fields",description:"Pick specific fields"},{id:5,title:"Target Setup",description:"Configure destination"}]).length,k=g.useCallback(async be=>{!C.has(be)&&!D&&(R(Te=>new Set(Te).add(be)),await re(be))},[C,D,re]);g.useEffect(()=>{T.length===0&&!A&&X()},[T.length,A,X]),g.useEffect(()=>{if(a){const{source:be,storage:Te}=a;if(f(be.node),m(be.fields),S(be.configuration[0]||{}),le({fullyQualifiedName:Te.fullyQualifiedName}),T.length>0){const Me=T.find(Ge=>Ge.name===be.name);Me&&(o(Me),n?k(Me.name):(k(Me.name),me(Me.name)))}}},[a,T,n,k,me]),g.useEffect(()=>{if(n&&T.length>0&&!i&&!a){const be=T[0];o(be),k(be.name)}},[n,T,i,a,k]);const Z=be=>{o(be),S({}),E(!1),R(Te=>{const Me=new Set(Te);return Me.delete(be.name),Me}),k(be.name),me(be.name)},$=be=>{f(be),m([])},se=(be,Te)=>{m(Te?Me=>[...Me,be]:Me=>Me.filter(Ge=>Ge!==be))},M=(be,Te)=>{m(Te?Me=>{const Ge=be.filter(Yt=>!Me.includes(Yt));return[...Me,...Ge]}:Me=>Me.filter(Ge=>!be.includes(Ge)))},G=be=>{le(be)},P=g.useCallback(be=>{S(be)},[]),q=g.useCallback(be=>{E(be)},[]);g.useEffect(()=>{N&&(N.some(Te=>Te.required&&Te.showInUI!==!1&&Te.name!=="Fields")||E(!0))},[N]);const ie=()=>{v<ne&&b(v+1)},he=()=>{v>1&&b(v-1)},ve=()=>{if(n)return i!==null&&w;switch(v){case 1:return i!==null;case 2:return w;case 3:return u!=="";case 4:return h.length>0;case 5:return V!==null;default:return!1}},fe=()=>v>1,_e=()=>{if(n&&v===1)return N?c.jsx(ZC,{connectorSpecification:N,onConfigurationChange:P,onValidationChange:q,initialConfiguration:y,loading:D}):null;switch(v){case 1:return c.jsx(aB,{connectors:T,selectedConnector:i,loading:A,error:H,onConnectorSelect:Z});case 2:return i&&N?c.jsx(ZC,{connectorSpecification:N,onConfigurationChange:P,onValidationChange:q,initialConfiguration:y,loading:D}):null;case 3:return i&&O?c.jsx(iB,{connectorFields:O,selectedField:u,connectorName:i.title??i.name,loading:L,onFieldSelect:$}):null;case 4:return u&&O?c.jsx(oB,{connectorFields:O,selectedField:u,selectedFields:h,onFieldToggle:se,onSelectAllFields:M}):null;case 5:return c.jsx(RG,{dataStorageType:t,selectedNode:u,target:V,onTargetChange:G});default:return null}};return c.jsxs("div",{className:"flex h-full flex-col p-4",children:[c.jsx("div",{className:"mb-6 flex-1 overflow-x-visible overflow-y-auto",children:_e()}),c.jsx("div",{className:"bg-background -mx-4 border-t px-4 pt-4",children:c.jsx(_G,{currentStep:v,totalSteps:ne,canGoNext:ve(),canGoBack:fe(),isLoading:D||L,onNext:ie,onBack:he,onFinish:()=>{n&&i?e({source:{name:i.name,configuration:[y],node:(a==null?void 0:a.source.node)??u,fields:(a==null?void 0:a.source.fields)??h},storage:(a==null?void 0:a.storage)??{fullyQualifiedName:(a==null?void 0:a.storage.fullyQualifiedName)??""}}):i&&V&&e({source:{name:i.name,configuration:[y],node:u,fields:h},storage:{fullyQualifiedName:V.fullyQualifiedName}})}})})]})}function NG({isOpen:e,onClose:t,connector:n,dataStorageType:a,onSubmit:i,configurationOnly:o=!1,existingConnector:u=null}){return c.jsx(_l,{open:e,onOpenChange:t,children:c.jsxs(Tl,{className:"flex h-screen min-w-[480px] flex-col",children:[c.jsxs(Nl,{children:[c.jsx(Ll,{children:n!=null&&n.name?"Table filled by connector":"Setup Connector"}),c.jsx(Il,{children:"Setup your connector to use in your data mart"})]}),c.jsx("div",{className:"flex-1 overflow-x-visible overflow-y-auto",children:c.jsx(TG,{onSubmit:f=>{i(f),t()},dataStorageType:a,configurationOnly:o,existingConnector:u})})]})})}const i0=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:a=!1,existingConnector:i=null})=>{const[o,u]=g.useState(!1),f=()=>{u(!0)},h=()=>{u(!1)},m=()=>n?c.jsx("div",{onClick:f,style:{cursor:"pointer"},children:n}):null;return c.jsxs(c.Fragment,{children:[c.jsx(ti,{}),m(),o&&c.jsx(WH,{children:c.jsx(NG,{isOpen:o,onClose:h,connector:null,dataStorageType:e,onSubmit:t,configurationOnly:a,existingConnector:i})})]})};function AG({storageType:e,onSetupConnector:t}){return c.jsx("div",{className:"space-y-4",children:c.jsx(i0,{dataStorageType:e,onSubmit:t,configurationOnly:!1,children:c.jsxs(Ue,{type:"button",variant:"outline",className:"flex h-24 w-full items-center justify-center gap-2 rounded-md border-0 border-b border-gray-200 bg-white shadow-none hover:bg-white hover:shadow-xs dark:bg-white/2",children:[c.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:c.jsx(zR,{className:"h-4 w-4",strokeWidth:2.25})}),c.jsx("span",{children:"Setup Connector"}),c.jsx(Xy,{className:"h-6 w-6"})]})})})}const jG=e=>{switch(e){case st.GOOGLE_BIGQUERY:return"Google BigQuery";case st.AWS_ATHENA:return"AWS Athena";default:return e}},uu=e=>typeof e=="object"&&"connector"in e,Fv=e=>{if(!uu(e))return!1;const{source:t,storage:n}=e.connector,a=!!t.name&&!!t.configuration&&t.configuration.length>0&&!!t.node&&!!t.fields&&t.fields.length>0,i=!!n.fullyQualifiedName&&n.fullyQualifiedName.split(".").length===2;return a&&i};function DG({configIndex:e,connectorDef:t,storageType:n,onRemoveConfiguration:a,onUpdateConfiguration:i,dataMartStatus:o,totalConfigurations:u}){const f=hi.getInfo(n),h=()=>{const y=t.connector.source.node||"No node selected";return c.jsx("div",{className:"flex flex-wrap gap-2",children:c.jsxs("span",{children:[c.jsx("span",{className:"font-semibold",children:"Node:"})," ",c.jsx("span",{className:"text-primary",children:y})]})})},m=()=>{const[y,S]=t.connector.storage.fullyQualifiedName.split("."),w=n===st.GOOGLE_BIGQUERY?"Dataset":"Database";return c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs("span",{children:[c.jsxs("span",{className:"font-semibold",children:[w,":"]})," ",c.jsx("span",{className:"text-muted-foreground",children:y})]}),c.jsx("span",{className:"text-muted-foreground",children:"•"}),c.jsxs("span",{children:[c.jsxs("span",{className:"font-semibold",children:["Table",":"]})," ",c.jsx("span",{className:"text-muted-foreground",children:S})]})]})},v=()=>{const y=t.connector.source.fields.length,S=t.connector.source.fields;return c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsxs("div",{className:"text-muted-foreground/75 dark:text-muted-foreground/50 flex cursor-help items-center gap-1 text-sm",children:["Fields: ",y,c.jsx(qi,{className:"h-3 w-3"})]})}),c.jsx(ln,{side:"left",className:"max-w-sm",children:c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"text-sm font-semibold",children:["Selected fields (",y,"):"]}),c.jsx("div",{className:"scrollbar-thin max-h-48 overflow-y-auto",children:S.length>0?c.jsx("ul",{className:"space-y-0.5 text-xs",children:S.map((w,E)=>c.jsxs("li",{className:"truncate",children:["• ",w]},E))}):c.jsx("div",{className:"text-muted-foreground text-xs",children:"No fields selected"})})]})})]})},b=()=>!(o===Nn.PUBLISHED&&u===1);return c.jsxs("div",{className:"flex w-full items-center border-b pb-4",children:[c.jsx("div",{className:"flex-grow",children:c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(i0,{dataStorageType:n,onSubmit:i(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:c.jsx(Oy,{title:t.connector.source.name||"Connector",subtitle:h(),className:"min-h-[80px] cursor-pointer transition-colors",rightContent:v()})}),c.jsx(Oy,{title:jG(n),icon:f.icon,subtitle:m(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),c.jsx("div",{className:"shrink-0 pl-4",children:c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx(Ue,{type:"button",variant:"ghost",size:"sm",onClick:()=>{b()&&a(e)},disabled:!b(),className:"disabled:text-muted-foreground/50 text-red-600 hover:bg-red-50 hover:text-red-700 dark:hover:bg-red-950/50",children:c.jsx(tx,{className:"h-4 w-4"})})}),!b()&&c.jsx(ln,{children:"Cannot remove the last configuration in published pipeline"})]})})]})}function OG({storageType:e,onAddConfiguration:t,existingConnector:n}){return c.jsx("div",{children:c.jsx(i0,{dataStorageType:e,onSubmit:a=>{const i=a.source.configuration[0]||{};t(i)},configurationOnly:!0,existingConnector:n,children:c.jsxs(Ue,{type:"button",variant:"outline",className:"hover:border-primary/50 flex h-12 w-full items-center justify-center gap-2 border-1 text-sm",children:[c.jsx(Pa,{className:"h-4 w-4"}),c.jsx("span",{children:"Add more configuration"})]})})})}function MG({control:e,storageType:t}){const{dataMart:n}=Lu(),{setValue:a,getValues:i,trigger:o}=Pl(),u=()=>{setTimeout(()=>void o("definition"),0)},f=(n==null?void 0:n.status)??Nn.DRAFT,h=y=>{const S=y.source,w=y.storage;a("definition",{connector:{source:S,storage:w}},{shouldDirty:!0,shouldTouch:!0}),u()},m=y=>S=>{const E=i().definition;if(typeof E=="object"&&uu(E)){const C=[...E.connector.source.configuration];C[y]=S.source.configuration[0]||{};const R={connector:{...E.connector,source:{...E.connector.source,configuration:C}}};a("definition",R,{shouldDirty:!0,shouldTouch:!0}),u()}},v=y=>{const w=i().definition;if(uu(w)&&w.connector.source.configuration.length<=1){const E=XA(Xe.CONNECTOR);a("definition",E,{shouldDirty:!0,shouldTouch:!0}),u()}if(typeof w=="object"&&uu(w)&&w.connector.source.configuration.length>1){const E={...w.connector.source,configuration:w.connector.source.configuration.filter((R,T)=>T!==y)},C={connector:{...w.connector,source:E}};a("definition",C,{shouldDirty:!0,shouldTouch:!0}),u()}},b=y=>{const w=i().definition;if(uu(w)){const E={...w.connector.source,configuration:[...w.connector.source.configuration,y]},C={connector:{...w.connector,source:E}};a("definition",C,{shouldDirty:!0,shouldTouch:!0}),u()}};return c.jsx(xr,{control:e,name:"definition",render:({field:y})=>c.jsxs(br,{className:"space-y-0",children:[c.jsx(Sr,{children:c.jsx("div",{className:"space-y-4",children:!Fv(y.value)||f===Nn.DRAFT?c.jsx(AG,{storageType:t,onSetupConnector:h}):c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"text-muted-foreground text-sm font-medium",children:"Input Source"}),c.jsxs("div",{className:"space-y-3",children:[Fv(y.value)?y.value.connector.source.configuration.map((S,w)=>{const E=y.value;return c.jsx(DG,{configIndex:w,connectorDef:E,storageType:t,onRemoveConfiguration:v,onUpdateConfiguration:m,dataMartStatus:f.code,totalConfigurations:E.connector.source.configuration.length},w)}):null,c.jsx(OG,{storageType:t,onAddConfiguration:b,existingConnector:Fv(y.value)?{source:y.value.connector.source,storage:y.value.connector.storage}:void 0})]})]})})}),c.jsx(wr,{})]})})}function kG({definitionType:e,storageType:t}){const{control:n}=Pl();return c.jsxs("div",{className:"space-y-2",children:[e===Xe.SQL&&c.jsx(qH,{control:n}),e===Xe.TABLE&&c.jsx(ZH,{control:n,storageType:t}),e===Xe.VIEW&&c.jsx(YH,{control:n,storageType:t}),e===Xe.TABLE_PATTERN&&c.jsx(KH,{control:n,storageType:t}),e===Xe.CONNECTOR&&c.jsx(MG,{control:n,storageType:t})]})}function LG(){const{dataMart:e,updateDataMartDefinition:t}=Lu();if(!e)throw new Error("Data mart not found");const{definitionType:n,definition:a,id:i,storage:{type:o}}=e,[u,f]=g.useState(n),h=g.useCallback(()=>{if(!u)return;const O={definitionType:u,definition:XA(u)};return a?{definitionType:u,definition:a}:O},[u,a]),m=g.useCallback(()=>{if(!u)return;const O=GH(u,o);return Ul(O)},[u,o]),v=Fl({resolver:m(),defaultValues:h(),mode:"onChange"}),{handleSubmit:b,reset:y,formState:{isDirty:S,isValid:w}}=v;g.useEffect(()=>{u&&y(h())},[u,y,h]);const E=O=>{f(O)},C=async O=>{if(u&&i)try{await t(i,O.definitionType,O.definition),y(O)}catch(A){console.error("Failed to update data mart definition:",A)}},R=O=>{O.preventDefault(),b(C)(O)},T=()=>{y(h())},N=()=>u?c.jsxs("form",{onSubmit:R,className:"space-y-4",children:[c.jsx(kG,{definitionType:u,storageType:o}),c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{className:"align-items-center flex justify-start space-x-4",children:[c.jsx(Ue,{variant:"default",type:"submit",disabled:!w,children:"Save"}),c.jsx(Ue,{type:"button",variant:"ghost",onClick:T,disabled:!S,children:"Discard"})]})})]}):null;return c.jsx(SN,{...v,children:c.jsxs("div",{className:"space-y-4",children:[!n&&c.jsx(UH,{initialType:u,onTypeSelect:E}),N()]})})}function IG(){const{id:e}=JO();return e?c.jsx("div",{className:"dm-page",children:c.jsx(vN,{children:c.jsx(VV,{id:e})})}):c.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}const E2=g.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function ro({icon:e,title:t,subtitle:n,help:a,actions:i}){const{collapsible:o,isCollapsed:u,handleCollapse:f}=g.useContext(E2);return c.jsxs(ah,{className:ye("group flex items-start justify-between gap-4 px-4 py-4",o&&"cursor-pointer"),onClick:o?f:void 0,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:c.jsx(e,{className:"h-4 w-4",strokeWidth:2.25})}),c.jsx(Ly,{className:"text-md text-foreground leading-none font-medium",children:t})]}),n&&c.jsx(tB,{className:ye("text-md text-muted-foreground/50",!u&&"hidden"),children:n}),a&&c.jsx(ls,{children:c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsxs("div",{className:"pointer-events-none ml-2 flex items-center opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100",children:[c.jsx(LR,{className:"text-muted-foreground/50 h-4 w-4"}),c.jsx("span",{className:"sr-only",children:a})]})}),c.jsx(ln,{children:c.jsx("p",{children:a})})]})})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[i,o&&c.jsx("div",{className:ye("flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-gray-700/25"),children:c.jsx("div",{className:ye("transform transition-transform duration-200",u?"rotate-0":"rotate-180"),children:c.jsx(gs,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}ro.displayName="CollapsibleCardHeader";function ao({children:e}){return c.jsx(Iy,{className:"px-4 pt-1",children:e})}ao.displayName="CollapsibleCardContent";function Sl({left:e,right:t}){return c.jsxs(nB,{className:"flex items-center gap-2 px-4 py-4",children:[c.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&c.jsx("div",{className:"flex items-center",children:t})]})}Sl.displayName="CollapsibleCardFooter";function C2({children:e}){return c.jsx("div",{className:"flex gap-2",children:e})}C2.displayName="CollapsibleCardActions";const QC="collapsed-card-";function Du({children:e,className:t,variant:n="default",collapsible:a=!1,defaultCollapsed:i=!1,onCollapsedChange:o,name:u}){const f=u?kh.get(`${QC}${u}`,"boolean")??i:i,[h,m]=g.useState(f);g.useEffect(()=>{u&&kh.set(`${QC}${u}`,h)},[h,u]);const v=()=>{const C=!h;m(C),o==null||o(C)};let b,y,S,w;g.Children.forEach(e,C=>{if(g.isValidElement(C))switch(C.type){case ro:b=C;break;case ao:y=C;break;case Sl:S=C;break;case C2:w=C;break}});const E={default:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none",dense:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none text-sm",flat:"rounded-md p-0 gap-0 border-0 border-b-0 shadow-none"};return c.jsx(E2.Provider,{value:{isCollapsed:h,collapsible:a,handleCollapse:v},children:c.jsxs(rh,{className:ye(E[n],t),children:[b,w,c.jsx("div",{className:ye("grid transition-all duration-200",h?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:c.jsxs("div",{className:"overflow-hidden",children:[y,S]})})]})})}function PG(){const{dataMart:e,updateDataMartStorage:t}=ld();return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs(Du,{collapsible:!0,name:"data-storage",children:[c.jsx(ro,{icon:FR,title:"Storage",subtitle:"Configure where your data will be stored"}),c.jsx(ao,{children:(e==null?void 0:e.storage)&&c.jsx(FH,{dataStorage:e.storage,onDataStorageChange:t})}),c.jsx(Sl,{})]}),c.jsxs(Du,{collapsible:!0,name:"input-source",children:[c.jsx(ro,{icon:PR,title:"Input Source",subtitle:"Configure how to extract data from your data warehouse"}),c.jsx(ao,{children:e&&c.jsx(LG,{})}),c.jsx(Sl,{})]})]})}function FG(){const[e,t]=g.useState(null),[n,a]=g.useState(!1),[i,o]=g.useState(pr.EDIT),u=g.useCallback(()=>{o(pr.CREATE),t(null),a(!0)},[]),f=g.useCallback(v=>{t(v),o(pr.EDIT),a(!0)},[]),h=g.useCallback(()=>{a(!1)},[]),m=g.useCallback(v=>i===pr.EDIT&&e?v.find(b=>b.id===e):void 0,[i,e]);return{editId:e,editOpen:n,editMode:i,handleAddReport:u,handleEditRow:f,handleCloseEditForm:h,getEditReport:m}}function UG(e){const t=g.useCallback(a=>{const i=e.getColumn("title");i&&i.setFilterValue(a.target.value)},[e]);return{value:g.useCallback(()=>{const a=e.getColumn("title");if(!a)return"";const i=a.getFilterValue();return typeof i=="string"?i:""},[e])(),onChange:t}}function zG(e){const t=g.useMemo(()=>Array.isArray(e)?Object.fromEntries(e.filter(i=>i.meta.hidden).map(i=>["id"in i&&i.id?i.id:"accessorKey"in i&&typeof i.accessorKey=="string"?i.accessorKey:void 0,!1]).filter(([i])=>i!==void 0)):{},[e]),[n,a]=g.useState({});return g.useEffect(()=>{a(t)},[t]),{columnVisibility:n,setColumnVisibility:a,defaultHiddenColumns:t}}const VG=e=>{if(!e)return"—";let t;if(typeof e=="string"){if(t=new Date(e),isNaN(t.getTime()))return"—"}else if(t=e,isNaN(t.getTime()))return"—";return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)};function $G({row:e,onDeleteSuccess:t,onEditReport:n}){const[a,i]=g.useState(!1),[o,u]=g.useState(!1),[f,h]=g.useState(!1),{deleteReport:m,fetchReportsByDataMartId:v,runReport:b}=Pm(),y=`actions-menu-${e.original.id}`,S=g.useCallback(async()=>{try{i(!0),await m(e.original.id),await v(e.original.dataMart.id),t==null||t()}catch(C){console.error("Failed to delete Google Sheet:",C)}finally{i(!1)}},[m,v,t,e.original.id,e.original.dataMart.id]),w=g.useCallback(()=>{n==null||n(e.original.id),h(!1)},[n,e.original.id]),E=g.useCallback(async()=>{try{u(!0),await b(e.original.id)}catch(C){console.error("Failed to run report:",C)}finally{u(!1)}},[b,e.original.id]);return c.jsx("div",{className:"text-right",onClick:C=>{C.stopPropagation()},children:c.jsxs(Gr,{open:f,onOpenChange:h,children:[c.jsx(qr,{asChild:!0,children:c.jsxs(Ue,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-200/50 dark:hover:bg-white/10","aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":f,"aria-controls":y,children:[c.jsx("span",{className:"sr-only",children:"Open menu"}),c.jsx(vs,{className:"h-4 w-4","aria-hidden":"true"})]})}),c.jsxs(Cr,{id:y,align:"end",role:"menu",children:[c.jsx(Zt,{onClick:C=>{C.stopPropagation(),w()},role:"menuitem",children:"Edit report"}),c.jsxs(Zt,{onClick:C=>{C.stopPropagation(),E()},disabled:o,role:"menuitem","aria-label":o?"Running report...":`Run report: ${e.original.title}`,className:"flex items-center gap-1",children:[o?"Running...":"Run report",c.jsx(UR,{className:"h-3 w-3","aria-hidden":"true"})]}),c.jsx(Zt,{asChild:!0,children:c.jsxs("a",{href:r0(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1",role:"menuitem",onClick:C=>{C.stopPropagation()},children:["Open document",c.jsx(b3,{className:"h-3 w-3","aria-hidden":"true"})]})}),c.jsx(ho,{}),c.jsx(Zt,{className:"text-red-600",onClick:C=>{C.stopPropagation(),S()},disabled:a,role:"menuitem","aria-label":a?"Deleting report...":`Delete report: ${e.original.title}`,children:a?"Deleting...":"Delete"})]})]})})}const HG={[Vn.SUCCESS]:{icon:Wy,color:"text-green-500",label:"Success"},[Vn.ERROR]:{icon:IR,color:"text-red-500",label:"Fail"},[Vn.RUNNING]:{icon:ex,color:"text-primary animate-spin",label:"In progress"}};function BG({status:e,error:t}){if(!e)return null;const n=HG[e],{icon:a,color:i,label:o}=n,u=`status-tooltip-${e}-${t?"error":"normal"}`,f=()=>e===Vn.ERROR&&t?`${o}: ${t}`:o;return c.jsx(ls,{children:c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx(a,{className:ye("h-5 w-5",i),role:"img","aria-label":f(),"aria-describedby":u,tabIndex:0})}),c.jsxs(ln,{id:u,side:"bottom",role:"tooltip",children:[c.jsx("div",{className:"text-xs",children:o}),e===Vn.ERROR&&t&&c.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}function Uv({column:e,children:t,label:n}){const a=e.getIsSorted(),i=g.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),o=()=>a==="asc"?"sorted ascending":a==="desc"?"sorted descending":"not sorted",u=()=>a==="asc"?"ascending":a==="desc"?"descending":"none",f=n??(typeof t=="string"?t:"Column");return c.jsxs(Ue,{variant:"ghost",onClick:i,className:"group inline-flex cursor-pointer items-center gap-1 px-2","aria-label":`${f} - ${o()}. Click to sort.`,"aria-sort":u(),children:[t,c.jsxs("span",{className:"ml-1 flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[a==="asc"&&c.jsx(Na,{className:"text-foreground h-4 w-4"}),a==="desc"&&c.jsx(gs,{className:"text-foreground h-4 w-4"}),!a&&c.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:c.jsx(Na,{className:"text-muted-foreground h-4 w-4"})})]})]})}const XC=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},GG=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:"title",header:({column:n})=>c.jsx(Uv,{column:n,children:"Report Title"}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,meta:{title:"Report title"}},{accessorKey:"lastRunDate",header:({column:n})=>c.jsx(Uv,{column:n,children:"Last Run Date"}),cell:({row:n})=>n.original.lastRunDate?VG(n.original.lastRunDate):"-",size:70,meta:{title:"Last Run Date"}},{accessorKey:"lastRunStatus",header:({column:n})=>c.jsx(Uv,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?c.jsx(BG,{status:n.original.lastRunStatus,error:n.original.lastRunError}):"-",size:60,meta:{title:"Last Run Status"}},{id:"actions",cell:({row:n})=>c.jsx($G,{row:n,onDeleteSuccess:e,onEditReport:t}),size:20,meta:{title:"Actions"}}];function qG({elementId:e,isOpen:t,delay:n=100,selectText:a=!1}){g.useEffect(()=>{{const i=setTimeout(()=>{const o=document.getElementById(e);if(o){const u=o;u.focus(),a&&u.value?u.select():u.value&&u.setSelectionRange(u.value.length,u.value.length)}},n);return()=>{clearTimeout(i)}}},[t,e,n,a])}const ZG=$t({title:Bt().min(1,"Title is required"),documentUrl:Bt().refine(r2,"Enter a valid Google Sheets URL"),dataDestinationId:Bt().min(1,"Destination is required")});function YG({initialReport:e,mode:t,dataMartId:n,onSuccess:a}){const[i,o]=g.useState(null),[u,f]=g.useState(!1),{updateReport:h,createReport:m,error:v,clearError:b}=Pm();g.useEffect(()=>{u&&v&&(o(v),f(!1))},[v,u]);const y=Fl({resolver:Ul(ZG),defaultValues:{title:"",documentUrl:"",dataDestinationId:""},mode:"onTouched"}),{register:S,handleSubmit:w,formState:E,reset:C}=y,{errors:R,isDirty:T}=E,N=g.useCallback(async O=>{try{o(null),b(),f(!0);const{spreadsheetId:A,sheetId:D}=hB(O.documentUrl);if(!A){o("Invalid Google Sheets URL");return}let L;if(t===pr.CREATE)L=await m({title:O.title,dataMartId:n,dataDestinationId:O.dataDestinationId,destinationConfig:{type:Py.GOOGLE_SHEETS_CONFIG,spreadsheetId:A,sheetId:D}});else{if(!e){o("Initial report is required for edit mode");return}L=await h(e.id,{title:O.title,dataDestinationId:O.dataDestinationId,destinationConfig:{type:Py.GOOGLE_SHEETS_CONFIG,spreadsheetId:A,sheetId:D}})}if(!L||v){o(v??"An error occurred while submitting the form");return}a==null||a()}catch(A){console.error("Error submitting form:",A),o("An error occurred while submitting the form")}},[t,e,n,m,h,a,b,v]);return{form:y,register:S,handleSubmit:w,errors:R,isDirty:T,reset:C,formError:i,isSubmitting:u,setFormError:o,getValues:y.getValues,onSubmit:N}}class KG extends kl{constructor(){super("/data-destinations")}async getDataDestinations(){return this.get("/")}async getDataDestinationById(t){return this.get(`/${t}`)}async createDataDestination(t){return this.post("",t)}async updateDataDestination(t,n){return this.put(`/${t}`,n)}async deleteDataDestination(t){return this.delete(`/${t}`)}}const tu=new KG,Ou={types:{[$n.GOOGLE_SHEETS]:{type:$n.GOOGLE_SHEETS,displayName:"Google Sheets",icon:jx,status:gu.ACTIVE},[$n.LOOKER_STUDIO]:{type:$n.LOOKER_STUDIO,displayName:"Looker Studio",icon:EF,status:gu.COMING_SOON},[$n.ODATA]:{type:$n.ODATA,displayName:"OData",icon:CF,status:gu.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},QG=$t({title:Bt().min(1,"Title is required"),type:Mx($n)}),XG=QG.extend({type:ys($n.GOOGLE_SHEETS),credentials:tT}),WG=eT("type",[XG]),R2=g.createContext(void 0);var Rt=(e=>(e.FETCH_DESTINATIONS_START="FETCH_DESTINATIONS_START",e.FETCH_DESTINATIONS_SUCCESS="FETCH_DESTINATIONS_SUCCESS",e.FETCH_DESTINATIONS_ERROR="FETCH_DESTINATIONS_ERROR",e.FETCH_DESTINATION_START="FETCH_DESTINATION_START",e.FETCH_DESTINATION_SUCCESS="FETCH_DESTINATION_SUCCESS",e.FETCH_DESTINATION_ERROR="FETCH_DESTINATION_ERROR",e.CLEAR_CURRENT_DESTINATION="CLEAR_CURRENT_DESTINATION",e.CREATE_DESTINATION_START="CREATE_DESTINATION_START",e.CREATE_DESTINATION_SUCCESS="CREATE_DESTINATION_SUCCESS",e.CREATE_DESTINATION_ERROR="CREATE_DESTINATION_ERROR",e.UPDATE_DESTINATION_START="UPDATE_DESTINATION_START",e.UPDATE_DESTINATION_SUCCESS="UPDATE_DESTINATION_SUCCESS",e.UPDATE_DESTINATION_ERROR="UPDATE_DESTINATION_ERROR",e.DELETE_DESTINATION_START="DELETE_DESTINATION_START",e.DELETE_DESTINATION_SUCCESS="DELETE_DESTINATION_SUCCESS",e.DELETE_DESTINATION_ERROR="DELETE_DESTINATION_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(Rt||{});const JG={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function eq(e,t){switch(t.type){case Rt.FETCH_DESTINATIONS_START:case Rt.FETCH_DESTINATION_START:case Rt.CREATE_DESTINATION_START:case Rt.UPDATE_DESTINATION_START:case Rt.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case Rt.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case Rt.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case Rt.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case Rt.UPDATE_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,dataDestinations:e.dataDestinations.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case Rt.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case Rt.FETCH_DESTINATIONS_ERROR:case Rt.FETCH_DESTINATION_ERROR:case Rt.CREATE_DESTINATION_ERROR:case Rt.UPDATE_DESTINATION_ERROR:case Rt.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case Rt.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case Rt.CLEAR_ERROR:return{...e,error:null};default:return e}}function _2({children:e}){const[t,n]=g.useReducer(eq,JG);return c.jsx(R2.Provider,{value:{state:t,dispatch:n},children:e})}function tq(){const e=g.useContext(R2);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}function $m(){const{state:e,dispatch:t}=tq(),n=g.useCallback(async()=>{t({type:Rt.FETCH_DESTINATIONS_START});try{const m=(await tu.getDataDestinations()).map(lu);t({type:Rt.FETCH_DESTINATIONS_SUCCESS,payload:m})}catch(h){t({type:Rt.FETCH_DESTINATIONS_ERROR,payload:h instanceof Error?h.message:"Failed to load destinations"})}},[t]),a=g.useCallback(async h=>{try{const m=await tu.getDataDestinationById(h),v=lu(m);t({type:Rt.FETCH_DESTINATION_SUCCESS,payload:v})}catch(m){t({type:Rt.FETCH_DESTINATION_ERROR,payload:m instanceof Error?m.message:"Failed to load destination"})}},[t]),i=g.useCallback(async h=>{t({type:Rt.CREATE_DESTINATION_START});try{const m=EB(h),v=await tu.createDataDestination(m),b=lu(v);return t({type:Rt.CREATE_DESTINATION_SUCCESS,payload:b}),b}catch(m){return t({type:Rt.CREATE_DESTINATION_ERROR,payload:m instanceof Error?m.message:"Failed to create destination"}),null}},[t]),o=g.useCallback(async(h,m)=>{t({type:Rt.UPDATE_DESTINATION_START});try{const v=wB(m),b=await tu.updateDataDestination(h,v),y=lu(b);return t({type:Rt.UPDATE_DESTINATION_SUCCESS,payload:y}),y}catch(v){return t({type:Rt.UPDATE_DESTINATION_ERROR,payload:v instanceof Error?v.message:"Failed to update destination"}),null}},[t]),u=g.useCallback(async h=>{t({type:Rt.DELETE_DESTINATION_START});try{await tu.deleteDataDestination(h),t({type:Rt.DELETE_DESTINATION_SUCCESS,payload:h})}catch(m){t({type:Rt.DELETE_DESTINATION_ERROR,payload:m instanceof Error?m.message:"Failed to delete destination"})}},[t]),f=g.useCallback(()=>{t({type:Rt.CLEAR_CURRENT_DESTINATION})},[t]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:a,createDataDestination:i,updateDataDestination:o,deleteDataDestination:u,clearCurrentDataDestination:f}}const T2=["private_key","private_key_id","client_email","client_id","client_x509_cert_url"];function nq(e){return"serviceAccount"in e}const rq=({type:e,credentials:t})=>{if(!t)return c.jsx("div",{className:"text-muted-foreground text-sm",children:"No credentials provided."});switch(e){case $n.GOOGLE_SHEETS:{const a=nq(t)?String(t.serviceAccount):void 0;return c.jsx("div",{className:"grid gap-2",children:c.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Service Account:"}),a?c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx("span",{className:"cursor-help truncate text-sm",children:a.length>30?a.substring(0,30)+"...":a})}),c.jsx(ln,{className:"max-w-md",children:c.jsx(mm,{displayOnly:!0,value:a,keysToMask:T2})})]}):c.jsx("span",{className:"text-sm",children:c.jsx("span",{className:"text-muted-foreground",children:"—"})})]})})}default:return c.jsx("div",{className:"text-muted-foreground text-sm",children:"Unknown destination type."})}},aq=({type:e,credentials:t})=>c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{className:"space-y-1",children:[c.jsx("h4",{className:"text-sm font-medium",children:"Credentials"}),c.jsx(rq,{type:e,credentials:t})]})});function sq({dataDestination:e,isLoading:t=!1}){if(t)return c.jsx("div",{className:"space-y-4",children:c.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((u,f)=>c.jsxs("div",{className:"space-y-1",children:[c.jsx(gr,{className:"h-5 w-24"}),c.jsx(gr,{className:"h-6 w-40"})]},f))})});if(!e)return c.jsx("div",{children:"No destination information available."});const{type:n,credentials:a,createdAt:i,modifiedAt:o}=e;return c.jsx("div",{className:"space-y-2",children:c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{children:e.title}),c.jsx(yr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:u,icon:f}=Ou.getInfo(n);return c.jsxs(c.Fragment,{children:[c.jsx(f,{}),u]})})()})]}),c.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:c.jsx(aq,{type:n,credentials:a})}),c.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Created:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i))]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Modified:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(o))]})]})]})})}const iq=g.forwardRef(({initialReport:e,mode:t=pr.EDIT,onDirtyChange:n,onFormErrorChange:a,onSubmit:i,onCancel:o},u)=>{const f="google-sheets-edit-form",h="google-sheets-title-input",m="google-sheets-document-url-input",v="google-sheets-data-destination-select",{dataMart:b}=Lu(),{dataDestinations:y,fetchDataDestinations:S,loading:w}=$m(),[E,C]=g.useState([]);g.useEffect(()=>{b&&S()},[b,S]),g.useEffect(()=>{if(y.length>0){const X=y.filter(re=>re.type===$n.GOOGLE_SHEETS);C(X)}},[y]),qG({elementId:h,isOpen:!0,delay:150});const{isDirty:R,reset:T,form:N,isSubmitting:O,formError:A,onSubmit:D}=YG({initialReport:e,mode:t,dataMartId:(b==null?void 0:b.id)??"",onSuccess:()=>{i==null||i()}});g.useEffect(()=>{a&&a(A)},[A,a]),g.useEffect(()=>{t===pr.EDIT&&e?T({title:e.title,documentUrl:r0(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id}):t===pr.CREATE&&T({title:"",documentUrl:"",dataDestinationId:""})},[e,t,T,E]),g.useEffect(()=>{n==null||n(R)},[R,n]);const L=N.watch("documentUrl"),H=L&&r2(L.trim());return c.jsx(e0,{...N,children:c.jsxs("form",{id:f,className:"flex flex-1 flex-col overflow-hidden",noValidate:!0,ref:u,children:[c.jsx("div",{className:"bg-muted flex-1 overflow-y-auto p-4 dark:bg-transparent",children:c.jsxs("div",{className:"flex min-h-full flex-col gap-4",children:[c.jsx(xr,{control:N.control,name:"title",render:({field:X})=>c.jsxs(br,{className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:[c.jsx(Vr,{className:"text-foreground flex items-center gap-1.5 text-sm font-medium",children:"Title"}),c.jsx(Sr,{children:c.jsx(Ut,{id:h,placeholder:"Report title",...X})}),c.jsx(wr,{})]})}),c.jsx(xr,{control:N.control,name:"dataDestinationId",render:({field:X})=>c.jsxs(br,{className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:[c.jsx(Vr,{className:"text-foreground flex items-center gap-1.5 text-sm font-medium",children:"Destination"}),c.jsxs(Ma,{onValueChange:X.onChange,value:X.value,disabled:w||E.length===0,children:[c.jsx(Sr,{children:c.jsx(La,{id:v,className:"w-full max-w-full overflow-hidden",children:c.jsx(ka,{className:"truncate",placeholder:"Select a destination",children:X.value&&E.length>0&&(()=>{const re=E.find(me=>me.id===X.value);if(re){const V=Ou.getInfo(re.type).icon;return c.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[c.jsx(V,{className:"h-4 w-4 flex-shrink-0"}),c.jsx("div",{className:"flex min-w-0 flex-col",children:c.jsx("span",{className:"truncate",children:re.title})})]})}return null})()})})}),c.jsx(Ia,{children:E.map(re=>{const V=Ou.getInfo(re.type).icon;return c.jsx(An,{value:re.id,children:c.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[c.jsx(V,{className:"h-4 w-4 flex-shrink-0"}),c.jsxs("div",{className:"flex min-w-0 flex-col",children:[c.jsx("span",{className:"truncate",children:re.title}),c.jsx("span",{className:"text-muted-foreground truncate text-xs",children:YC(re.credentials.serviceAccount)??"No email found"})]})]})},re.id)})})]}),E.length===0&&!w&&c.jsxs(t0,{className:"mt-2",children:[c.jsx(Yh,{className:"h-4 w-4"}),c.jsx(JA,{children:"No destinations available"}),c.jsxs(n0,{children:["You need to create a Destination before you can create a report."," ",c.jsx(io,{to:"/data-destinations",className:"font-medium text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:"Go to Destinations"})]})]}),X.value&&E.length>0&&(()=>{const re=E.find(me=>me.id===X.value);return re?c.jsxs("div",{className:"mt-2 flex flex-col",children:[c.jsx("span",{className:"text-foreground mb-0.5 text-xs font-semibold",children:"Service Account Email:"}),c.jsx("span",{className:"text-muted-foreground bg-muted/30 rounded px-2 py-1 text-xs",children:YC(re.credentials.serviceAccount)??"No email found"})]}):null})(),c.jsx(wr,{})]})}),c.jsx(xr,{control:N.control,name:"documentUrl",render:({field:X})=>c.jsxs(br,{className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:[c.jsx(Vr,{className:"text-foreground flex items-center gap-1.5 text-sm font-medium",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{children:"Document Link"}),c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx("button",{type:"button",className:"text-muted-foreground/50 hover:text-foreground transition","aria-label":"Help information about document link",children:c.jsx(LR,{className:"h-3.5 w-3.5","aria-hidden":"true"})})}),c.jsx(ln,{side:"top",align:"center",role:"tooltip",children:"This is a link to the original document in Google Sheets"})]})]})}),c.jsx("div",{className:"mb-2",children:c.jsxs("ul",{className:"text-muted-foreground list-decimal space-y-1 pl-4 text-sm",role:"list",children:[c.jsx("li",{role:"listitem",children:"Go to your Google Sheet document."}),c.jsx("li",{role:"listitem",children:"Share it with the service account email."}),c.jsx("li",{role:"listitem",children:"Paste the document URL below."})]})}),c.jsx(Sr,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ut,{id:m,placeholder:"Document URL",className:"flex-1",...X}),c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${H?"text-blue-600 hover:bg-blue-50 hover:text-blue-700 dark:text-blue-400 dark:hover:bg-blue-950/20 dark:hover:text-blue-300":"text-muted-foreground/30 cursor-not-allowed"}`,onClick:()=>{H&&window.open(L.trim(),"_blank","noopener,noreferrer")},disabled:!H,"aria-label":H?"Open document in new tab":"Document link is not valid",children:c.jsx(Jy,{className:"h-4 w-4","aria-hidden":"true"})})}),c.jsx(ln,{side:"top",align:"center",role:"tooltip",children:H?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),c.jsx(wr,{})]})}),c.jsx(Fu,{}),c.jsx(w2,{})]})}),c.jsxs("div",{className:"flex flex-col gap-1.5 border-t px-4 py-3",children:[c.jsxs(Ue,{variant:"default",type:"button",onClick:()=>void N.handleSubmit(D)(),className:"w-full","aria-label":t===pr.CREATE?"Create new report":"Save changes to report",disabled:!R||O,children:[O&&c.jsx(ex,{className:"mr-2 h-4 w-4 animate-spin"}),t===pr.CREATE?"Create new report":"Save changes to report"]}),c.jsx(Ue,{variant:"outline",type:"button",onClick:o,className:"w-full","aria-label":"Cancel and close form",children:"Cancel"})]})]})})});function oq({isOpen:e,onClose:t,initialReport:n,mode:a}){const[i,o]=g.useState(!1),[u,f]=g.useState(!1),h=g.useCallback(()=>{u?o(!0):t()},[u,t]),m=g.useCallback(()=>{o(!1),f(!1),t()},[t]),v=g.useCallback(y=>{f(y)},[]),b=g.useCallback(()=>{f(!1),t()},[t]);return c.jsxs(c.Fragment,{children:[c.jsx(_l,{open:e,onOpenChange:y=>{y||h()},children:c.jsxs(Tl,{className:"flex h-full min-w-[480px] flex-col gap-0",children:[c.jsxs(Nl,{className:"border-b py-3",children:[c.jsx(am,{children:a===pr.CREATE?"Create new report":"Edit report"}),c.jsx(sm,{children:a===pr.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),c.jsx(_2,{children:c.jsx(iq,{initialReport:n,mode:a,onDirtyChange:v,onSubmit:b,onCancel:h})})]})}),c.jsx(po,{open:i,onOpenChange:o,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:m,variant:"destructive"})]})}function lq({table:e,searchInputId:t,columnsMenuId:n,columnsMenuOpen:a,setColumnsMenuOpen:i,onAddReport:o,filterValue:u,onFilterChange:f,dataMartStatus:h}){return c.jsxs("div",{className:"flex items-center justify-between pb-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"relative w-sm",children:[c.jsx(oo,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4","aria-hidden":"true"}),c.jsx(Ut,{id:t,placeholder:"Search by report title",value:u,onChange:f,className:"border-muted rounded-md border bg-white pl-8 dark:bg-white/4","aria-label":"Search reports by title"})]}),c.jsxs(Gr,{open:a,onOpenChange:i,children:[c.jsx(qr,{asChild:!0,children:c.jsx(Ue,{variant:"outline",className:"ml-2 h-8 px-2 font-normal","aria-label":"Show columns","aria-haspopup":"true","aria-expanded":a,"aria-controls":n,children:c.jsx(g3,{className:"h-4 w-4","aria-hidden":"true"})})}),c.jsxs(Cr,{id:n,align:"start",role:"menu",children:[c.jsx(Zt,{disabled:!0,className:"cursor-default opacity-70 select-none",role:"menuitem",children:"Toggle columns"}),e.getAllColumns().filter(function(m){return m.getCanHide()}).map(m=>c.jsxs(Zt,{className:"flex items-center gap-2 capitalize",onClick:()=>{m.toggleVisibility(!m.getIsVisible())},role:"menuitemcheckbox","aria-checked":m.getIsVisible(),children:[c.jsx("span",{className:`mr-2 flex h-4 w-4 items-center justify-center rounded border ${m.getIsVisible()?"bg-primary border-primary":""}`,"aria-hidden":"true",children:m.getIsVisible()&&c.jsx(Ta,{className:"h-3 w-3 text-white"})}),m.id]},m.id))]})]})]}),c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx("div",{className:"inline-block",children:c.jsxs(Ue,{variant:"outline",className:"flex h-8 items-center gap-2 px-3",onClick:o,"aria-label":"Add new Google Sheets report",disabled:(h==null?void 0:h.code)===Nn.DRAFT,children:[c.jsx(Pa,{className:"h-4 w-4","aria-hidden":"true"}),"Add report"]})})}),(h==null?void 0:h.code)===Nn.DRAFT&&c.jsx(ln,{children:c.jsx("p",{children:"Reports can only be created for published data marts"})})]})]})}function cq({table:e,onPreviousClick:t,onNextClick:n}){return c.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",role:"navigation","aria-label":"Table pagination",children:[c.jsx(Ue,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),c.jsx(Ue,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function uq(){const{dataMart:e}=Lu(),{fetchReportsByDataMartId:t,reports:n,stopAllPolling:a,setPollingConfig:i}=Pm(),[o,u]=g.useState([{id:"lastRunDate",desc:!0}]),[f,h]=g.useState(!1),{editOpen:m,handleAddReport:v,editMode:b,handleEditRow:y,handleCloseEditForm:S,getEditReport:w}=FG(),E=w(n);g.useEffect(()=>{i({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[i]),g.useEffect(()=>{(async()=>{try{if(!e)return;await t(e.id)}catch(V){console.error(V)}})()},[t,e]),g.useEffect(()=>()=>{a()},[e==null?void 0:e.id,a]);const C=g.useMemo(()=>GG({onDeleteSuccess:()=>{},onEditReport:y}),[y]),{columnVisibility:R,setColumnVisibility:T}=zG(C),N=rd({data:n,columns:C,getCoreRowModel:Ju(),getPaginationRowModel:td(),onSortingChange:u,getSortedRowModel:nd(),state:{sorting:o,columnVisibility:R},getFilteredRowModel:ed(),onColumnVisibilityChange:T}),{value:O,onChange:A}=UG(N),D=g.useCallback(()=>{N.previousPage()},[N]),L=g.useCallback(()=>{N.nextPage()},[N]);return c.jsxs("div",{className:"w-full",children:[c.jsx(ti,{}),c.jsx(lq,{table:N,searchInputId:"google-sheets-search-input",columnsMenuId:"google-sheets-columns-menu",columnsMenuOpen:f,setColumnsMenuOpen:h,onAddReport:v,filterValue:O,onFilterChange:A,dataMartStatus:e==null?void 0:e.status}),c.jsx("div",{className:"rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:c.jsxs(ad,{id:"google-sheets-reports-table",className:"w-full table-fixed",role:"table","aria-label":"Google Sheets reports",children:[c.jsx(sd,{className:"rounded-tl-md rounded-tr-md border-0 border-b bg-transparent dark:bg-transparent",children:N.getHeaderGroups().map(me=>c.jsx(Hn,{className:"bg-muted/50 border-b hover:bg-white dark:bg-white/2 dark:hover:bg-white/10",children:me.headers.map(V=>c.jsx(od,{className:XC(V.column.columnDef._align),style:{width:V.getSize()},scope:"col",children:V.isPlaceholder?null:typeof V.column.columnDef.header=="function"?V.column.columnDef.header(V.getContext()):V.column.columnDef.header},V.id))},me.id))}),c.jsx(id,{children:N.getRowModel().rows.length?N.getRowModel().rows.map((me,V)=>c.jsx(Hn,{onClick:()=>{y(me.original.id)},className:"cursor-pointer",role:"row","aria-rowindex":V+1,children:me.getVisibleCells().map((le,ue)=>c.jsx(Oa,{className:`pl-4 whitespace-normal ${XC(le.column.columnDef._align)}`,style:{width:le.column.getSize()},role:"cell","aria-colindex":ue+1,children:typeof le.column.columnDef.cell=="function"?le.column.columnDef.cell(le.getContext()):le.column.columnDef.cell},le.id))},me.id)):c.jsx(Hn,{children:c.jsx(Oa,{colSpan:C.length,className:"h-24 text-center",role:"cell",children:c.jsx("span",{role:"status","aria-live":"polite",children:"No results."})})})})]})}),c.jsx(cq,{table:N,onPreviousClick:D,onNextClick:L}),c.jsx(oq,{isOpen:m,onClose:S,initialReport:E,mode:b})]})}function dq(){return c.jsx("div",{className:"flex flex-col gap-4",children:c.jsx(s2,{children:c.jsxs(Du,{name:"googlesheets",collapsible:!0,defaultCollapsed:!1,children:[c.jsx(ro,{icon:jx,title:"Google Sheets",help:"List of report exports to Google Sheets"}),c.jsx(ao,{children:c.jsx(uq,{})})]})})})}function WC(){return c.jsxs(Du,{children:[c.jsx(ro,{icon:x4,title:"Description"}),c.jsx(ao,{children:c.jsx(HV,{})}),c.jsx(Sl,{})]})}function fq(){const{dataMart:e}=ld();return c.jsxs(Du,{children:[c.jsx(ro,{icon:VR,title:"Time triggers"}),c.jsx(ao,{children:c.jsx(TB,{children:c.jsx("div",{className:"p-4",children:e&&c.jsx(CG,{dataMartId:e.id})})})}),c.jsx(Sl,{})]})}function hq(){const e=ku(),t=n=>{e(`/data-marts/${n.id}/data-setup`)};return c.jsxs("main",{className:"container mx-auto px-4 py-8",children:[c.jsx("div",{className:"mb-6 flex items-center justify-between",children:c.jsx("h1",{className:"text-2xl font-bold",children:"Create Data Mart"})}),c.jsx("div",{className:"rounded-lg p-6 shadow",children:c.jsx(Qx,{children:c.jsx(vN,{children:c.jsx(UV,{initialData:{title:"New Data Mart"},onSuccess:t})})})})]})}function N2({isOpen:e,onClose:t,id:n}){const{getDataStorageById:a,currentDataStorage:i,loading:o,clearCurrentDataStorage:u}=Om();g.useEffect(()=>(e&&n&&a(n),()=>{e||u()}),[e,n,a,u]);const f=()=>{u(),t()};return c.jsx(Cm,{open:e,onOpenChange:h=>{h||f()},children:c.jsxs(Rm,{children:[c.jsxs(_m,{children:[c.jsx(Ll,{children:"Storage Details"}),c.jsx(Il,{children:"View detailed information about this storage."})]}),c.jsx("div",{className:"py-4",children:c.jsx(nU,{dataStorage:i,isLoading:o})})]})})}function zv({column:e,children:t}){return c.jsxs(Ue,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,c.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&c.jsx(Na,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&c.jsx(gs,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&c.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:c.jsx(Na,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}const mq=({id:e,onViewDetails:t,onEdit:n,onDelete:a})=>{const[i,o]=g.useState(!1);return c.jsx("div",{className:"text-right",children:c.jsxs(Gr,{open:i,onOpenChange:o,children:[c.jsx(qr,{asChild:!0,children:c.jsx(Ue,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:c.jsx(vs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),c.jsxs(Cr,{align:"end",children:[c.jsx(Zt,{onClick:()=>t==null?void 0:t(e),className:"dm-card-table-body-row-actiondropdownitem",children:"View details"}),c.jsx(Zt,{onClick:()=>void(n==null?void 0:n(e)),className:"dm-card-table-body-row-actiondropdownitem",children:"Edit"}),c.jsx(ho,{}),c.jsx(Zt,{onClick:()=>a==null?void 0:a(e),className:"dm-card-table-body-row-actiondropdownitem text-red-600",children:"Delete"})]})]})})};function pq({table:e}){return c.jsx("div",{className:"px-3 text-right",children:c.jsxs(Gr,{children:[c.jsx(qr,{asChild:!0,children:c.jsx(Ue,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:c.jsx(vs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),c.jsx(Cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>c.jsx(Zt,{className:"capitalize",children:c.jsxs("label",{className:"flex items-center space-x-2",children:[c.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&c.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:c.jsx(Ta,{className:"size-3.5"})})}),c.jsx("span",{children:t.id})]})},t.id))})]})})}const gq=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:a})=>c.jsx(zv,{column:a,children:"Title"}),cell:({row:a})=>{const i=a.getValue("title");return c.jsx("div",{children:i})}},{accessorKey:"type",size:30,header:({column:a})=>c.jsx(zv,{column:a,children:"Type"}),cell:({row:a})=>{const i=a.getValue("type"),{displayName:o,icon:u}=hi.getInfo(i);return c.jsxs(yr,{variant:"secondary",className:"flex items-center gap-2",children:[c.jsx(u,{}),o]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:a})=>c.jsx(zv,{column:a,children:"Created at"}),cell:({row:a})=>{const i=a.getValue("createdAt"),o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(i);return c.jsx("div",{children:o})}},{id:"actions",size:80,header:({table:a})=>c.jsx(pq,{table:a}),cell:({row:a})=>c.jsx(mq,{id:a.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function vq({onOpenTypeDialog:e}){return c.jsxs("div",{className:"dm-empty-state",children:[c.jsx(L4,{className:"dm-empty-state-ico",strokeWidth:1}),c.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),c.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),c.jsxs(Ue,{variant:"outline",onClick:e,children:[c.jsx(Pa,{className:"h-4 w-4"}),"New Storage"]})]})}function yq({columns:e,data:t,onViewDetails:n,onOpenTypeDialog:a}){var N;const[i,o]=g.useState([{id:"createdAt",desc:!1}]),[u,f]=g.useState([]),[h,m]=g.useState({}),[v,b]=g.useState({}),[y,S]=g.useState(!1),[w,E]=g.useState(null),C=rd({data:t,columns:[...e],getCoreRowModel:Ju(),getPaginationRowModel:td(),onSortingChange:o,getSortedRowModel:nd(),onColumnFiltersChange:f,getFilteredRowModel:ed(),onColumnVisibilityChange:m,onRowSelectionChange:b,state:{sorting:i,columnFilters:u,columnVisibility:h,rowSelection:v},enableRowSelection:!0}),R=O=>{const A=t.find(D=>D.id===O);E(A),S(!0),n==null||n(O)},T=(O,A)=>{A.target instanceof HTMLElement&&(A.target.closest('[role="checkbox"]')||A.target.closest(".actions-cell")||A.target.closest('[role="menuitem"]'))||R(O)};return t.length?c.jsxs("div",{children:[w&&c.jsx(N2,{isOpen:y,onClose:()=>{S(!1)},id:w.id}),c.jsxs("div",{className:"dm-card",children:[c.jsxs("div",{className:"dm-card-toolbar",children:[c.jsx("div",{className:"dm-card-toolbar-left",children:c.jsxs("div",{className:"dm-card-toolbar-search",children:[c.jsx(oo,{className:"dm-card-toolbar-search-icon"}),c.jsx(Ut,{placeholder:"Search by title",value:(N=C.getColumn("title"))==null?void 0:N.getFilterValue(),onChange:O=>{var A;return(A=C.getColumn("title"))==null?void 0:A.setFilterValue(O.target.value)},className:"dm-card-toolbar-search-input"})]})}),c.jsx("div",{className:"dm-card-toolbar-right",children:c.jsxs(Ue,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{a==null||a()},children:[c.jsx(Pa,{className:"h-4 w-4"}),"New Storage"]})})]}),c.jsx("div",{className:"dm-card-table-wrap",children:c.jsxs(ad,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[c.jsx(sd,{className:"dm-card-table-header",children:C.getHeaderGroups().map(O=>c.jsx(Hn,{className:"dm-card-table-header-row",children:O.headers.map(A=>c.jsx(od,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:A.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(A.getSize())}%`},children:A.isPlaceholder?null:xl(A.column.columnDef.header,A.getContext())},A.id))},O.id))}),c.jsx(id,{className:"dm-card-table-body",children:C.getRowModel().rows.length?C.getRowModel().rows.map(O=>c.jsx(Hn,{"data-state":O.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:A=>{const D=O.original.id;T(D,A)},children:O.getVisibleCells().map(A=>c.jsx(Oa,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${A.column.id==="actions"?"actions-cell":""} ${A.column.id==="createdAt"?"whitespace-nowrap":""}`,style:A.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(A.column.getSize())}%`},children:xl(A.column.columnDef.cell,A.getContext())},A.id))},O.id)):c.jsx(Hn,{children:c.jsx(Oa,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),c.jsxs("div",{className:"dm-card-pagination",children:[c.jsx(Ue,{variant:"outline",size:"sm",onClick:()=>{C.previousPage()},disabled:!C.getCanPreviousPage(),children:"Previous"}),c.jsx(Ue,{variant:"outline",size:"sm",onClick:()=>{C.nextPage()},disabled:!C.getCanNextPage(),children:"Next"})]})]})]}):c.jsxs("div",{className:"dm-card",children:[c.jsx(ti,{}),c.jsx(vq,{onOpenTypeDialog:a})]})}const xq=({isOpen:e,onClose:t,onSelect:n})=>c.jsx(Cm,{open:e,onOpenChange:t,children:c.jsxs(Rm,{className:"sm:max-w-md",children:[c.jsxs(_m,{children:[c.jsx(Ll,{children:"New Storage"}),c.jsx(Il,{children:"Choose the type of storage you want to create"})]}),c.jsx("div",{className:"grid grid-cols-2 gap-4 py-4",children:hi.getAllTypes().map(a=>{const i=a.icon;return c.jsxs(Ue,{variant:"outline",className:"flex flex-row items-center justify-start gap-3 p-6",onClick:()=>void n(a.type),children:[c.jsx(i,{size:32}),c.jsx("span",{className:"font-medium",children:a.displayName})]},a.type)})})]})}),bq=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,a]=g.useState(e),{dataStorages:i,currentDataStorage:o,clearCurrentDataStorage:u,loading:f,fetchDataStorages:h,getDataStorageById:m,deleteDataStorage:v,createDataStorage:b}=Om();g.useEffect(()=>{h()},[h]),g.useEffect(()=>{a(e)},[e]);const y=()=>{a(!1),t==null||t()},[S,w]=g.useState(!1),[E,C]=g.useState(!1),[R,T]=g.useState(null),[N,O]=g.useState(!1),[A,D]=g.useState(null),L=async Z=>{try{const $=await b(Z);y(),$!=null&&$.id&&(await m($.id),w(!0))}catch($){console.error("Failed to create storage:",$)}};if(f)return c.jsx(hN,{});const H=Z=>{D(Z),O(!0)},X=()=>{O(!1),D(null)},re=async Z=>{await m(Z),w(!0)},me=Z=>{T(Z),C(!0)},V=async()=>{if(R)try{await v(R),await h()}catch(Z){console.error("Failed to delete storage:",Z)}finally{C(!1),T(null)}},le=async()=>{try{w(!1),await h()}catch(Z){console.error("Failed to save storage:",Z)}},ue=()=>{w(!1),u()},ne=i.map(Z=>({id:Z.id,title:Z.title,type:Z.type,createdAt:Z.createdAt,modifiedAt:Z.modifiedAt})),k=gq({onViewDetails:H,onEdit:re,onDelete:me});return c.jsxs("div",{children:[c.jsx(yq,{columns:k,data:ne,onOpenTypeDialog:()=>{a(!0)}}),c.jsx(N2,{isOpen:N,onClose:X,id:A??""}),c.jsx(xq,{isOpen:n,onClose:y,onSelect:L}),c.jsx(YA,{isOpen:S,onClose:ue,dataStorage:o,onSaveSuccess:()=>void le()}),c.jsx(po,{open:E,onOpenChange:C,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{V()},onCancel:()=>{T(null)},variant:"destructive"})]})},Sq=()=>{const[e,t]=g.useState(!1);return c.jsxs("div",{className:"dm-page",children:[c.jsx("header",{className:"dm-page-header",children:c.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),c.jsx("div",{className:"dm-page-content",children:c.jsx(Qx,{children:c.jsx(bq,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function A2({isOpen:e,onClose:t,id:n}){const{getDataDestinationById:a,currentDataDestination:i,loading:o,clearCurrentDataDestination:u}=$m();g.useEffect(()=>(e&&n&&a(n),()=>{e||u()}),[e,n,a,u]);const f=()=>{u(),t()};return c.jsx(Cm,{open:e,onOpenChange:h=>{h||f()},children:c.jsxs(Rm,{children:[c.jsxs(_m,{children:[c.jsx(Ll,{children:"Destination Details"}),c.jsx(Il,{children:"View detailed information about this destination."})]}),c.jsx("div",{className:"py-4",children:c.jsx(sq,{dataDestination:i,isLoading:o})})]})})}function Vv({column:e,children:t}){return c.jsxs(Ue,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,c.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&c.jsx(Na,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&c.jsx(gs,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&c.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:c.jsx(Na,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}const wq=({id:e,onViewDetails:t,onEdit:n,onDelete:a})=>{const[i,o]=g.useState(!1);return c.jsx("div",{className:"text-right",children:c.jsxs(Gr,{open:i,onOpenChange:o,children:[c.jsx(qr,{asChild:!0,children:c.jsx(Ue,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:c.jsx(vs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),c.jsxs(Cr,{align:"end",children:[c.jsx(Zt,{onClick:()=>t==null?void 0:t(e),className:"dm-card-table-body-row-actiondropdownitem",children:"View details"}),c.jsx(Zt,{onClick:()=>void(n==null?void 0:n(e)),className:"dm-card-table-body-row-actiondropdownitem",children:"Edit"}),c.jsx(ho,{}),c.jsx(Zt,{onClick:()=>a==null?void 0:a(e),className:"dm-card-table-body-row-actiondropdownitem text-red-600",children:"Delete"})]})]})})};function Eq({table:e}){return c.jsx("div",{className:"px-3 text-right",children:c.jsxs(Gr,{children:[c.jsx(qr,{asChild:!0,children:c.jsx(Ue,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:c.jsx(vs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),c.jsx(Cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>c.jsx(Zt,{className:"capitalize",children:c.jsxs("label",{className:"flex items-center space-x-2",children:[c.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&c.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:c.jsx(Ta,{className:"size-3.5"})})}),c.jsx("span",{children:t.id})]})},t.id))})]})})}const Cq=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:a})=>c.jsx(Vv,{column:a,children:"Title"}),cell:({row:a})=>{const i=a.getValue("title");return c.jsx("div",{className:"overflow-hidden text-ellipsis",children:i})}},{accessorKey:"type",size:30,header:({column:a})=>c.jsx(Vv,{column:a,children:"Type"}),cell:({row:a})=>{const i=a.getValue("type"),{displayName:o,icon:u}=Ou.getInfo(i);return c.jsxs(yr,{variant:"secondary",className:"flex items-center gap-2",children:[c.jsx(u,{}),o]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:a})=>c.jsx(Vv,{column:a,children:"Created at"}),cell:({row:a})=>{const i=a.getValue("createdAt"),o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(i);return c.jsx("div",{children:o})}},{id:"actions",size:80,header:({table:a})=>c.jsx(Eq,{table:a}),cell:({row:a})=>c.jsx(wq,{id:a.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function Rq({onOpenTypeDialog:e}){return c.jsxs("div",{className:"dm-empty-state",children:[c.jsx(MR,{className:"dm-empty-state-ico",strokeWidth:1}),c.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),c.jsx("p",{className:"dm-empty-state-subtitle",children:"A Destination combines your reporting tool and access credentials — both needed to deliver data from Data Marts to your reports and dashboards."}),c.jsxs(Ue,{variant:"outline",onClick:e,children:[c.jsx(Pa,{className:"h-4 w-4"}),"New Destination"]})]})}function _q({columns:e,data:t,onViewDetails:n,onOpenTypeDialog:a}){var N;const[i,o]=g.useState([{id:"createdAt",desc:!1}]),[u,f]=g.useState([]),[h,m]=g.useState({}),[v,b]=g.useState({}),[y,S]=g.useState(!1),[w,E]=g.useState(null),C=rd({data:t,columns:[...e],getCoreRowModel:Ju(),getPaginationRowModel:td(),onSortingChange:o,getSortedRowModel:nd(),onColumnFiltersChange:f,getFilteredRowModel:ed(),onColumnVisibilityChange:m,onRowSelectionChange:b,state:{sorting:i,columnFilters:u,columnVisibility:h,rowSelection:v},enableRowSelection:!0}),R=O=>{const A=t.find(D=>D.id===O);E(A),S(!0),n==null||n(O)},T=(O,A)=>{A.target instanceof HTMLElement&&(A.target.closest('[role="checkbox"]')||A.target.closest(".actions-cell")||A.target.closest('[role="menuitem"]'))||R(O)};return t.length?c.jsxs("div",{children:[w&&c.jsx(A2,{isOpen:y,onClose:()=>{S(!1)},id:w.id}),c.jsxs("div",{className:"dm-card",children:[c.jsxs("div",{className:"dm-card-toolbar",children:[c.jsx("div",{className:"dm-card-toolbar-left",children:c.jsxs("div",{className:"dm-card-toolbar-search",children:[c.jsx(oo,{className:"dm-card-toolbar-search-icon"}),c.jsx(Ut,{placeholder:"Search by title",value:(N=C.getColumn("title"))==null?void 0:N.getFilterValue(),onChange:O=>{var A;return(A=C.getColumn("title"))==null?void 0:A.setFilterValue(O.target.value)},className:"dm-card-toolbar-search-input"})]})}),c.jsx("div",{className:"dm-card-toolbar-right",children:c.jsxs(Ue,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{a==null||a()},children:[c.jsx(Pa,{className:"h-4 w-4"}),"New Destination"]})})]}),c.jsx("div",{className:"dm-card-table-wrap",children:c.jsxs(ad,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[c.jsx(sd,{className:"dm-card-table-header",children:C.getHeaderGroups().map(O=>c.jsx(Hn,{className:"dm-card-table-header-row",children:O.headers.map(A=>c.jsx(od,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:A.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(A.getSize())}%`},children:A.isPlaceholder?null:xl(A.column.columnDef.header,A.getContext())},A.id))},O.id))}),c.jsx(id,{className:"dm-card-table-body",children:C.getRowModel().rows.length?C.getRowModel().rows.map(O=>c.jsx(Hn,{"data-state":O.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:A=>{const D=O.original.id;T(D,A)},children:O.getVisibleCells().map(A=>c.jsx(Oa,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${A.column.id==="actions"?"actions-cell":""} ${A.column.id==="createdAt"?"whitespace-nowrap":""}`,style:A.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(A.column.getSize())}%`},children:xl(A.column.columnDef.cell,A.getContext())},A.id))},O.id)):c.jsx(Hn,{children:c.jsx(Oa,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),c.jsxs("div",{className:"dm-card-pagination",children:[c.jsx(Ue,{variant:"outline",size:"sm",onClick:()=>{C.previousPage()},disabled:!C.getCanPreviousPage(),children:"Previous"}),c.jsx(Ue,{variant:"outline",size:"sm",onClick:()=>{C.nextPage()},disabled:!C.getCanNextPage(),children:"Next"})]})]})]}):c.jsx("div",{className:"dm-card",children:c.jsx(Rq,{onOpenTypeDialog:a})})}function Tq({form:e}){return c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),c.jsx(xr,{control:e.control,name:"credentials.serviceAccount",render:({field:t})=>c.jsxs(br,{className:"w-full max-w-full",children:[c.jsxs(Vr,{className:"flex items-center gap-1",children:["Service Account JSON",c.jsx("span",{className:"text-red-500",children:"*"}),c.jsx(ls,{children:c.jsxs(sn,{children:[c.jsx(on,{asChild:!0,children:c.jsx(qi,{className:"h-4 w-4 cursor-help text-gray-500"})}),c.jsxs(ln,{className:"max-w-sm text-sm",children:[c.jsx("p",{children:"A Service Account Key is a JSON credential file that provides authentication to Google Sheets."}),c.jsx("p",{className:"mt-1",children:"To get one, go to the Google Cloud Console, navigate to IAM & Admin > Service Accounts, create or select a service account, and generate a new JSON key."})]})]})})]}),c.jsx(Sr,{children:c.jsx("div",{className:"w-full max-w-full overflow-hidden",children:c.jsx(mm,{value:t.value,onChange:t.onChange,keysToMask:T2,className:"w-full max-w-full overflow-x-auto break-words whitespace-pre-wrap"})})}),c.jsx(wr,{})]})})]})}function Nq({initialData:e,onSubmit:t,onCancel:n}){const a=Fl({resolver:Ul(WG),defaultValues:e??{title:"",type:$n.GOOGLE_SHEETS,credentials:{serviceAccount:""}},mode:"onTouched"}),i=o=>{o.preventDefault(),a.handleSubmit(t)(o)};return c.jsx(e0,{...a,children:c.jsxs("form",{onSubmit:i,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsx(xr,{control:a.control,name:"title",render:({field:o})=>c.jsxs(br,{children:[c.jsxs(Vr,{children:["Title",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx(Sr,{children:c.jsx(Ut,{placeholder:"Enter title",...o})}),c.jsx(wr,{})]})}),c.jsx(xr,{control:a.control,name:"type",render:({field:o})=>c.jsxs(br,{children:[c.jsxs(Vr,{children:["Destination Type",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsxs(Ma,{onValueChange:o.onChange,defaultValue:o.value,disabled:!!e,children:[c.jsx(Sr,{children:c.jsx(La,{className:"w-full",children:c.jsx(ka,{placeholder:"Select a destination type"})})}),c.jsx(Ia,{children:c.jsx(Dm,{children:Ou.getAllTypes().map(({type:u,displayName:f,icon:h,status:m})=>{const v=m===gu.COMING_SOON;return c.jsx(An,{value:u,disabled:v,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(h,{}),f,v&&c.jsx(yr,{variant:"secondary",children:m})]})},u)})})})]}),c.jsx(wr,{})]})}),c.jsx(Fu,{}),c.jsx(Tq,{form:a})]}),c.jsxs("div",{className:"flex justify-end space-x-4",children:[c.jsx(Ue,{variant:"ghost",type:"button",onClick:n,children:"Cancel"}),c.jsx(Ue,{variant:"default",type:"submit",children:"Save"})]})]})})}function Aq({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:a}){const{updateDataDestination:i,createDataDestination:o}=$m(),u=async f=>{if(n){const h={title:f.title,credentials:f.credentials,type:f.type},m=await i(n.id,h);m&&a(m)}else{const h={title:f.title,type:f.type,credentials:f.credentials},m=await o(h);m&&a(m)}t()};return c.jsx(_l,{open:e,onOpenChange:t,children:c.jsxs(Tl,{className:"flex h-full min-w-[480px] flex-col",children:[c.jsxs(Nl,{children:[c.jsx(am,{children:"Configure destination"}),c.jsx(sm,{children:"Customize settings for your destination"})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:c.jsx(Nq,{initialData:n??void 0,onSubmit:u,onCancel:t})})]})})}const jq=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:a,clearCurrentDataDestination:i,fetchDataDestinations:o,getDataDestinationById:u,deleteDataDestination:f}=$m(),h=g.useCallback(()=>{i(),v(!0),t==null||t()},[i,t]),[m,v]=g.useState(!1),[b,y]=g.useState(!1),[S,w]=g.useState(null),[E,C]=g.useState(!1),[R,T]=g.useState(null);g.useEffect(()=>{o()},[o]),g.useEffect(()=>{e&&h()},[e,h]);const N=V=>{T(V),C(!0)},O=()=>{C(!1),T(null)},A=async V=>{await u(V),v(!0)},D=V=>{w(V),y(!0)},L=async()=>{if(S)try{await f(S),await o()}catch(V){console.error("Failed to delete destination:",V)}finally{y(!1),w(null)}},H=async()=>{try{v(!1),await o()}catch(V){console.error("Failed to save destination:",V)}},X=()=>{v(!1),i()},re=n.map(V=>({id:V.id,title:V.title,type:V.type,createdAt:V.createdAt,modifiedAt:V.modifiedAt})),me=Cq({onViewDetails:N,onEdit:A,onDelete:D});return c.jsxs("div",{children:[c.jsx(_q,{columns:me,data:re,onOpenTypeDialog:h}),c.jsx(A2,{isOpen:E,onClose:O,id:R??""}),c.jsx(Aq,{isOpen:m,onClose:X,dataDestination:a,onSaveSuccess:()=>void H()}),c.jsx(po,{open:b,onOpenChange:y,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{L()},onCancel:()=>{w(null)},variant:"destructive"})]})},Dq=()=>{const[e,t]=g.useState(!1);return c.jsxs("div",{className:"dm-page",children:[c.jsx("header",{className:"dm-page-header",children:c.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),c.jsx("div",{className:"dm-page-content",children:c.jsx(_2,{children:c.jsx(jq,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})},Oq=[{path:"overview",element:c.jsx(WC,{})},{path:"data-setup",element:c.jsx(PG,{})},{path:"reports",element:c.jsx(dq,{})},{path:"triggers",element:c.jsx(fq,{})},{index:!0,element:c.jsx(WC,{})}],Mq=[{path:"/",element:c.jsx(k9,{}),children:[{index:!0,element:c.jsx(yM,{to:"/data-marts",replace:!0})},{path:"about",element:c.jsx(L9,{})},{path:"data-marts",element:c.jsx(e7,{})},{path:"data-marts/create",element:c.jsx(hq,{})},{path:"data-marts/:id",element:c.jsx(IG,{}),children:Oq},{path:"data-storages",element:c.jsx(Sq,{})},{path:"data-destinations",element:c.jsx(Dq,{})},{path:"*",element:c.jsx(I9,{})}]}];function kq(){const e=HM(Mq);return c.jsx(t4,{router:e})}const j2=document.getElementById("root");if(!j2)throw new Error("Root element not found");ZD.createRoot(j2).render(c.jsx(g.StrictMode,{children:c.jsx(kq,{})}));
|