@owox/web 0.16.0-next-20251217153437 → 0.16.0-next-20251218103137
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/assets/index-ChUo2jRy.js +859 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/index-BEzL2WXe.js +0 -859
|
@@ -1,859 +0,0 @@
|
|
|
1
|
-
var N9=Object.defineProperty;var A9=(e,t,n)=>t in e?N9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var to=(e,t,n)=>A9(e,typeof t!="symbol"?t+"":t,n);function D9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function JN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var y0={exports:{}},mf={};/**
|
|
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 Sj;function O9(){if(Sj)return mf;Sj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,i){var c=null;if(i!==void 0&&(c=""+i),s.key!==void 0&&(c=""+s.key),"key"in s){i={};for(var u in s)u!=="key"&&(i[u]=s[u])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:i}}return mf.Fragment=t,mf.jsx=n,mf.jsxs=n,mf}var Cj;function I9(){return Cj||(Cj=1,y0.exports=O9()),y0.exports}var a=I9(),x0={exports:{}},gt={};/**
|
|
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 wj;function M9(){if(wj)return gt;wj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=x&&P[x]||P["@@iterator"],typeof P=="function"?P:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function R(P,z,F){this.props=P,this.context=z,this.refs=w,this.updater=F||C}R.prototype.isReactComponent={},R.prototype.setState=function(P,z){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,z,"setState")},R.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function j(){}j.prototype=R.prototype;function _(P,z,F){this.props=P,this.context=z,this.refs=w,this.updater=F||C}var D=_.prototype=new j;D.constructor=_,b(D,R.prototype),D.isPureReactComponent=!0;var O=Array.isArray;function A(){}var T={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function k(P,z,F){var Z=F.ref;return{$$typeof:e,type:P,key:z,ref:Z!==void 0?Z:null,props:F}}function V(P,z){return k(P.type,z,P.props)}function U(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function K(P){var z={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(F){return z[F]})}var G=/\/+/g;function q(P,z){return typeof P=="object"&&P!==null&&P.key!=null?K(""+P.key):z.toString(36)}function H(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(A,A):(P.status="pending",P.then(function(z){P.status==="pending"&&(P.status="fulfilled",P.value=z)},function(z){P.status==="pending"&&(P.status="rejected",P.reason=z)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function M(P,z,F,Z,Q){var le=typeof P;(le==="undefined"||le==="boolean")&&(P=null);var J=!1;if(P===null)J=!0;else switch(le){case"bigint":case"string":case"number":J=!0;break;case"object":switch(P.$$typeof){case e:case t:J=!0;break;case y:return J=P._init,M(J(P._payload),z,F,Z,Q)}}if(J)return Q=Q(P),J=Z===""?"."+q(P,0):Z,O(Q)?(F="",J!=null&&(F=J.replace(G,"$&/")+"/"),M(Q,z,F,"",function(Ce){return Ce})):Q!=null&&(U(Q)&&(Q=V(Q,F+(Q.key==null||P&&P.key===Q.key?"":(""+Q.key).replace(G,"$&/")+"/")+J)),z.push(Q)),1;J=0;var ie=Z===""?".":Z+":";if(O(P))for(var ye=0;ye<P.length;ye++)Z=P[ye],le=ie+q(Z,ye),J+=M(Z,z,F,le,Q);else if(ye=v(P),typeof ye=="function")for(P=ye.call(P),ye=0;!(Z=P.next()).done;)Z=Z.value,le=ie+q(Z,ye++),J+=M(Z,z,F,le,Q);else if(le==="object"){if(typeof P.then=="function")return M(H(P),z,F,Z,Q);throw z=String(P),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return J}function B(P,z,F){if(P==null)return P;var Z=[],Q=0;return M(P,Z,"","",function(le){return z.call(F,le,Q++)}),Z}function $(P){if(P._status===-1){var z=P._result;z=z(),z.then(function(F){(P._status===0||P._status===-1)&&(P._status=1,P._result=F)},function(F){(P._status===0||P._status===-1)&&(P._status=2,P._result=F)}),P._status===-1&&(P._status=0,P._result=z)}if(P._status===1)return P._result.default;throw P._result}var re=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},ge={map:B,forEach:function(P,z,F){B(P,function(){z.apply(this,arguments)},F)},count:function(P){var z=0;return B(P,function(){z++}),z},toArray:function(P){return B(P,function(z){return z})||[]},only:function(P){if(!U(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return gt.Activity=g,gt.Children=ge,gt.Component=R,gt.Fragment=n,gt.Profiler=s,gt.PureComponent=_,gt.StrictMode=r,gt.Suspense=f,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,gt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return T.H.useMemoCache(P)}},gt.cache=function(P){return function(){return P.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(P,z,F){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var Z=b({},P.props),Q=P.key;if(z!=null)for(le in z.key!==void 0&&(Q=""+z.key),z)!I.call(z,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&z.ref===void 0||(Z[le]=z[le]);var le=arguments.length-2;if(le===1)Z.children=F;else if(1<le){for(var J=Array(le),ie=0;ie<le;ie++)J[ie]=arguments[ie+2];Z.children=J}return k(P.type,Q,Z)},gt.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:i,_context:P},P},gt.createElement=function(P,z,F){var Z,Q={},le=null;if(z!=null)for(Z in z.key!==void 0&&(le=""+z.key),z)I.call(z,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(Q[Z]=z[Z]);var J=arguments.length-2;if(J===1)Q.children=F;else if(1<J){for(var ie=Array(J),ye=0;ye<J;ye++)ie[ye]=arguments[ye+2];Q.children=ie}if(P&&P.defaultProps)for(Z in J=P.defaultProps,J)Q[Z]===void 0&&(Q[Z]=J[Z]);return k(P,le,Q)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(P){return{$$typeof:u,render:P}},gt.isValidElement=U,gt.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:$}},gt.memo=function(P,z){return{$$typeof:m,type:P,compare:z===void 0?null:z}},gt.startTransition=function(P){var z=T.T,F={};T.T=F;try{var Z=P(),Q=T.S;Q!==null&&Q(F,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(A,re)}catch(le){re(le)}finally{z!==null&&F.types!==null&&(z.types=F.types),T.T=z}},gt.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},gt.use=function(P){return T.H.use(P)},gt.useActionState=function(P,z,F){return T.H.useActionState(P,z,F)},gt.useCallback=function(P,z){return T.H.useCallback(P,z)},gt.useContext=function(P){return T.H.useContext(P)},gt.useDebugValue=function(){},gt.useDeferredValue=function(P,z){return T.H.useDeferredValue(P,z)},gt.useEffect=function(P,z){return T.H.useEffect(P,z)},gt.useEffectEvent=function(P){return T.H.useEffectEvent(P)},gt.useId=function(){return T.H.useId()},gt.useImperativeHandle=function(P,z,F){return T.H.useImperativeHandle(P,z,F)},gt.useInsertionEffect=function(P,z){return T.H.useInsertionEffect(P,z)},gt.useLayoutEffect=function(P,z){return T.H.useLayoutEffect(P,z)},gt.useMemo=function(P,z){return T.H.useMemo(P,z)},gt.useOptimistic=function(P,z){return T.H.useOptimistic(P,z)},gt.useReducer=function(P,z,F){return T.H.useReducer(P,z,F)},gt.useRef=function(P){return T.H.useRef(P)},gt.useState=function(P){return T.H.useState(P)},gt.useSyncExternalStore=function(P,z,F){return T.H.useSyncExternalStore(P,z,F)},gt.useTransition=function(){return T.H.useTransition()},gt.version="19.2.1",gt}var Ej;function Wb(){return Ej||(Ej=1,x0.exports=M9()),x0.exports}var h=Wb();const ae=JN(h),dh=D9({__proto__:null,default:ae},[h]);var v0={exports:{}},pf={},b0={exports:{}},S0={};/**
|
|
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 Rj;function k9(){return Rj||(Rj=1,(function(e){function t(M,B){var $=M.length;M.push(B);e:for(;0<$;){var re=$-1>>>1,ge=M[re];if(0<s(ge,B))M[re]=B,M[$]=ge,$=re;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var B=M[0],$=M.pop();if($!==B){M[0]=$;e:for(var re=0,ge=M.length,P=ge>>>1;re<P;){var z=2*(re+1)-1,F=M[z],Z=z+1,Q=M[Z];if(0>s(F,$))Z<ge&&0>s(Q,F)?(M[re]=Q,M[Z]=$,re=Z):(M[re]=F,M[z]=$,re=z);else if(Z<ge&&0>s(Q,$))M[re]=Q,M[Z]=$,re=Z;else break e}}return B}function s(M,B){var $=M.sortIndex-B.sortIndex;return $!==0?$:M.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],m=[],y=1,g=null,x=3,v=!1,C=!1,b=!1,w=!1,R=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function D(M){for(var B=n(m);B!==null;){if(B.callback===null)r(m);else if(B.startTime<=M)r(m),B.sortIndex=B.expirationTime,t(f,B);else break;B=n(m)}}function O(M){if(b=!1,D(M),!C)if(n(f)!==null)C=!0,A||(A=!0,K());else{var B=n(m);B!==null&&H(O,B.startTime-M)}}var A=!1,T=-1,I=5,k=-1;function V(){return w?!0:!(e.unstable_now()-k<I)}function U(){if(w=!1,A){var M=e.unstable_now();k=M;var B=!0;try{e:{C=!1,b&&(b=!1,j(T),T=-1),v=!0;var $=x;try{t:{for(D(M),g=n(f);g!==null&&!(g.expirationTime>M&&V());){var re=g.callback;if(typeof re=="function"){g.callback=null,x=g.priorityLevel;var ge=re(g.expirationTime<=M);if(M=e.unstable_now(),typeof ge=="function"){g.callback=ge,D(M),B=!0;break t}g===n(f)&&r(f),D(M)}else r(f);g=n(f)}if(g!==null)B=!0;else{var P=n(m);P!==null&&H(O,P.startTime-M),B=!1}}break e}finally{g=null,x=$,v=!1}B=void 0}}finally{B?K():A=!1}}}var K;if(typeof _=="function")K=function(){_(U)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,q=G.port2;G.port1.onmessage=U,K=function(){q.postMessage(null)}}else K=function(){R(U,0)};function H(M,B){T=R(function(){M(e.unstable_now())},B)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(M){switch(x){case 1:case 2:case 3:var B=3;break;default:B=x}var $=x;x=B;try{return M()}finally{x=$}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(M,B){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var $=x;x=M;try{return B()}finally{x=$}},e.unstable_scheduleCallback=function(M,B,$){var re=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?re+$:re):$=re,M){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=$+ge,M={id:y++,callback:B,priorityLevel:M,startTime:$,expirationTime:ge,sortIndex:-1},$>re?(M.sortIndex=$,t(m,M),n(f)===null&&M===n(m)&&(b?(j(T),T=-1):b=!0,H(O,$-re))):(M.sortIndex=ge,t(f,M),C||v||(C=!0,A||(A=!0,K()))),M},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(M){var B=x;return function(){var $=x;x=B;try{return M.apply(this,arguments)}finally{x=$}}}})(S0)),S0}var jj;function L9(){return jj||(jj=1,b0.exports=k9()),b0.exports}var C0={exports:{}},Br={};/**
|
|
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 Tj;function P9(){if(Tj)return Br;Tj=1;var e=Wb();function t(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+f+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(f,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:f,containerInfo:m,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,m){if(f==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Br.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Br.createPortal=function(f,m){var y=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 i(f,m,null,y)},Br.flushSync=function(f){var m=c.T,y=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=m,r.p=y,r.d.f()}},Br.preconnect=function(f,m){typeof f=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(f,m))},Br.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Br.preinit=function(f,m){if(typeof f=="string"&&m&&typeof m.as=="string"){var y=m.as,g=u(y,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?r.d.S(f,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:v}):y==="script"&&r.d.X(f,{crossOrigin:g,integrity:x,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Br.preinitModule=function(f,m){if(typeof f=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=u(m.as,m.crossOrigin);r.d.M(f,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(f)},Br.preload=function(f,m){if(typeof f=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=u(y,m.crossOrigin);r.d.L(f,y,{crossOrigin:g,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})}},Br.preloadModule=function(f,m){if(typeof f=="string")if(m){var y=u(m.as,m.crossOrigin);r.d.m(f,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(f)},Br.requestFormReset=function(f){r.d.r(f)},Br.unstable_batchedUpdates=function(f,m){return f(m)},Br.useFormState=function(f,m,y){return c.H.useFormState(f,m,y)},Br.useFormStatus=function(){return c.H.useHostTransitionStatus()},Br.version="19.2.1",Br}var _j;function eA(){if(_j)return C0.exports;_j=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(),C0.exports=P9(),C0.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 Nj;function U9(){if(Nj)return pf;Nj=1;var e=L9(),t=Wb(),n=eA();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function c(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function u(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function f(o){if(i(o)!==o)throw Error(r(188))}function m(o){var l=o.alternate;if(!l){if(l=i(o),l===null)throw Error(r(188));return l!==o?null:o}for(var d=o,p=l;;){var S=d.return;if(S===null)break;var E=S.alternate;if(E===null){if(p=S.return,p!==null){d=p;continue}break}if(S.child===E.child){for(E=S.child;E;){if(E===d)return f(S),o;if(E===p)return f(S),l;E=E.sibling}throw Error(r(188))}if(d.return!==p.return)d=S,p=E;else{for(var N=!1,L=S.child;L;){if(L===d){N=!0,d=S,p=E;break}if(L===p){N=!0,p=S,d=E;break}L=L.sibling}if(!N){for(L=E.child;L;){if(L===d){N=!0,d=E,p=S;break}if(L===p){N=!0,p=E,d=S;break}L=L.sibling}if(!N)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:l}function y(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=y(o),l!==null)return l;o=o.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),_=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function K(o){return o===null||typeof o!="object"?null:(o=U&&o[U]||o["@@iterator"],typeof o=="function"?o:null)}var G=Symbol.for("react.client.reference");function q(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===G?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case b:return"Fragment";case R:return"Profiler";case w:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case k:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case C:return"Portal";case _:return o.displayName||"Context";case j:return(o._context.displayName||"Context")+".Consumer";case D:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case T:return l=o.displayName||null,l!==null?l:q(o.type)||"Memo";case I:l=o._payload,o=o._init;try{return q(o(l))}catch{}}return null}var H=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},re=[],ge=-1;function P(o){return{current:o}}function z(o){0>ge||(o.current=re[ge],re[ge]=null,ge--)}function F(o,l){ge++,re[ge]=o.current,o.current=l}var Z=P(null),Q=P(null),le=P(null),J=P(null);function ie(o,l){switch(F(le,l),F(Q,o),F(Z,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?GR(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=GR(l),o=BR(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}z(Z),F(Z,o)}function ye(){z(Z),z(Q),z(le)}function Ce(o){o.memoizedState!==null&&F(J,o);var l=Z.current,d=BR(l,o.type);l!==d&&(F(Q,o),F(Z,d))}function He(o){Q.current===o&&(z(Z),z(Q)),J.current===o&&(z(J),uf._currentValue=$)}var Ee,Ke;function nt(o){if(Ee===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);Ee=l&&l[1]||"",Ke=-1<d.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ee+o+Ke}var Ft=!1;function Pt(o,l){if(!o||Ft)return"";Ft=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(pe){var he=pe}Reflect.construct(o,[],be)}else{try{be.call()}catch(pe){he=pe}o.call(be.prototype)}}else{try{throw Error()}catch(pe){he=pe}(be=o())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(pe){if(pe&&he&&typeof pe.stack=="string")return[pe.stack,he.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=p.DetermineComponentFrameRoot(),N=E[0],L=E[1];if(N&&L){var X=N.split(`
|
|
44
|
-
`),de=L.split(`
|
|
45
|
-
`);for(S=p=0;p<X.length&&!X[p].includes("DetermineComponentFrameRoot");)p++;for(;S<de.length&&!de[S].includes("DetermineComponentFrameRoot");)S++;if(p===X.length||S===de.length)for(p=X.length-1,S=de.length-1;1<=p&&0<=S&&X[p]!==de[S];)S--;for(;1<=p&&0<=S;p--,S--)if(X[p]!==de[S]){if(p!==1||S!==1)do if(p--,S--,0>S||X[p]!==de[S]){var xe=`
|
|
46
|
-
`+X[p].replace(" at new "," at ");return o.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",o.displayName)),xe}while(1<=p&&0<=S);break}}}finally{Ft=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?nt(d):""}function On(o,l){switch(o.tag){case 26:case 27:case 5:return nt(o.type);case 16:return nt("Lazy");case 13:return o.child!==l&&l!==null?nt("Suspense Fallback"):nt("Suspense");case 19:return nt("SuspenseList");case 0:case 15:return Pt(o.type,!1);case 11:return Pt(o.type.render,!1);case 1:return Pt(o.type,!0);case 31:return nt("Activity");default:return""}}function yn(o){try{var l="",d=null;do l+=On(o,d),d=o,o=o.return;while(o);return l}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var ke=Object.prototype.hasOwnProperty,Y=e.unstable_scheduleCallback,ne=e.unstable_cancelCallback,ce=e.unstable_shouldYield,Ie=e.unstable_requestPaint,Re=e.unstable_now,Te=e.unstable_getCurrentPriorityLevel,$e=e.unstable_ImmediatePriority,mt=e.unstable_UserBlockingPriority,st=e.unstable_NormalPriority,Xt=e.unstable_LowPriority,sr=e.unstable_IdlePriority,$n=e.log,Or=e.unstable_setDisableYieldValue,Jr=null,fn=null;function or(o){if(typeof $n=="function"&&Or(o),fn&&typeof fn.setStrictMode=="function")try{fn.setStrictMode(Jr,o)}catch{}}var kn=Math.clz32?Math.clz32:ea,Ws=Math.log,Aa=Math.LN2;function ea(o){return o>>>=0,o===0?32:31-(Ws(o)/Aa|0)|0}var Da=256,Es=262144,wn=4194304;function In(o){var l=o&42;if(l!==0)return l;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function We(o,l,d){var p=o.pendingLanes;if(p===0)return 0;var S=0,E=o.suspendedLanes,N=o.pingedLanes;o=o.warmLanes;var L=p&134217727;return L!==0?(p=L&~E,p!==0?S=In(p):(N&=L,N!==0?S=In(N):d||(d=L&~o,d!==0&&(S=In(d))))):(L=p&~E,L!==0?S=In(L):N!==0?S=In(N):d||(d=p&~o,d!==0&&(S=In(d)))),S===0?0:l!==0&&l!==S&&(l&E)===0&&(E=S&-S,d=l&-l,E>=d||E===32&&(d&4194048)!==0)?l:S}function Bt(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Qt(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 qt(){var o=wn;return wn<<=1,(wn&62914560)===0&&(wn=4194304),o}function Vn(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function en(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Jt(o,l,d,p,S,E){var N=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var L=o.entanglements,X=o.expirationTimes,de=o.hiddenUpdates;for(d=N&~d;0<d;){var xe=31-kn(d),be=1<<xe;L[xe]=0,X[xe]=-1;var he=de[xe];if(he!==null)for(de[xe]=null,xe=0;xe<he.length;xe++){var pe=he[xe];pe!==null&&(pe.lane&=-536870913)}d&=~be}p!==0&&Rr(o,p,0),E!==0&&S===0&&o.tag!==0&&(o.suspendedLanes|=E&~(N&~l))}function Rr(o,l,d){o.pendingLanes|=l,o.suspendedLanes&=~l;var p=31-kn(l);o.entangledLanes|=l,o.entanglements[p]=o.entanglements[p]|1073741824|d&261930}function W(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var p=31-kn(d),S=1<<p;S&l|o[p]&l&&(o[p]|=l),d&=~S}}function ee(o,l){var d=l&-l;return d=(d&42)!==0?1:fe(d),(d&(o.suspendedLanes|l))!==0?0:d}function fe(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Se(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Ae(){var o=B.p;return o!==0?o:(o=window.event,o===void 0?32:mj(o.type))}function Be(o,l){var d=B.p;try{return B.p=o,l()}finally{B.p=d}}var Fe=Math.random().toString(36).slice(2),Le="__reactFiber$"+Fe,ze="__reactProps$"+Fe,Qe="__reactContainer$"+Fe,at="__reactEvents$"+Fe,tt="__reactListeners$"+Fe,pt="__reactHandles$"+Fe,hn="__reactResources$"+Fe,Ln="__reactMarker$"+Fe;function Zn(o){delete o[Le],delete o[ze],delete o[at],delete o[tt],delete o[pt]}function sn(o){var l=o[Le];if(l)return l;for(var d=o.parentNode;d;){if(l=d[Qe]||d[Le]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=QR(o);o!==null;){if(d=o[Le])return d;o=QR(o)}return l}o=d,d=o.parentNode}return null}function on(o){if(o=o[Le]||o[Qe]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function Oa(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function ns(o){var l=o[hn];return l||(l=o[hn]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function An(o){o[Ln]=!0}var Ia=new Set,Lc={};function Ma(o,l){pa(o,l),pa(o+"Capture",l)}function pa(o,l){for(Lc[o]=l,o=0;o<l.length;o++)Ia.add(l[o])}var Pc=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]*$"),Ml={},Ht={};function jr(o){return ke.call(Ht,o)?!0:ke.call(Ml,o)?!1:Pc.test(o)?Ht[o]=!0:(Ml[o]=!0,!1)}function Rs(o,l,d){if(jr(l))if(d===null)o.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+d)}}function rs(o,l,d){if(d===null)o.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+d)}}function ln(o,l,d,p){if(p===null)o.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(l,d,""+p)}}function Ir(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Rd(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function cx(o,l,d){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var S=p.get,E=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return S.call(this)},set:function(N){d=""+N,E.call(this,N)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return d},setValue:function(N){d=""+N},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function ux(o){if(!o._valueTracker){var l=Rd(o)?"checked":"value";o._valueTracker=cx(o,l,""+o[l])}}function PC(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),p="";return o&&(p=Rd(o)?o.checked?"true":"false":o.value),o=p,o!==d?(l.setValue(o),!0):!1}function Qh(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var w8=/[\n"\\]/g;function as(o){return o.replace(w8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function dx(o,l,d,p,S,E,N,L){o.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?o.type=N:o.removeAttribute("type"),l!=null?N==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+Ir(l)):o.value!==""+Ir(l)&&(o.value=""+Ir(l)):N!=="submit"&&N!=="reset"||o.removeAttribute("value"),l!=null?fx(o,N,Ir(l)):d!=null?fx(o,N,Ir(d)):p!=null&&o.removeAttribute("value"),S==null&&E!=null&&(o.defaultChecked=!!E),S!=null&&(o.checked=S&&typeof S!="function"&&typeof S!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?o.name=""+Ir(L):o.removeAttribute("name")}function UC(o,l,d,p,S,E,N,L){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.type=E),l!=null||d!=null){if(!(E!=="submit"&&E!=="reset"||l!=null)){ux(o);return}d=d!=null?""+Ir(d):"",l=l!=null?""+Ir(l):d,L||l===o.value||(o.value=l),o.defaultValue=l}p=p??S,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=L?o.checked:!!p,o.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.name=N),ux(o)}function fx(o,l,d){l==="number"&&Qh(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function Uc(o,l,d,p){if(o=o.options,l){l={};for(var S=0;S<d.length;S++)l["$"+d[S]]=!0;for(d=0;d<o.length;d++)S=l.hasOwnProperty("$"+o[d].value),o[d].selected!==S&&(o[d].selected=S),S&&p&&(o[d].defaultSelected=!0)}else{for(d=""+Ir(d),l=null,S=0;S<o.length;S++){if(o[S].value===d){o[S].selected=!0,p&&(o[S].defaultSelected=!0);return}l!==null||o[S].disabled||(l=o[S])}l!==null&&(l.selected=!0)}}function zC(o,l,d){if(l!=null&&(l=""+Ir(l),l!==o.value&&(o.value=l),d==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=d!=null?""+Ir(d):""}function FC(o,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(H(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=Ir(l),o.defaultValue=d,p=o.textContent,p===d&&p!==""&&p!==null&&(o.value=p),ux(o)}function zc(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var E8=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 HC(o,l,d){var p=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?p?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":p?o.setProperty(l,d):typeof d!="number"||d===0||E8.has(l)?l==="float"?o.cssFloat=d:o[l]=(""+d).trim():o[l]=d+"px"}function $C(o,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,d!=null){for(var p in d)!d.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="");for(var S in l)p=l[S],l.hasOwnProperty(S)&&d[S]!==p&&HC(o,S,p)}else for(var E in l)l.hasOwnProperty(E)&&HC(o,E,l[E])}function hx(o){if(o.indexOf("-")===-1)return!1;switch(o){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 R8=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"]]),j8=/^[\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 Jh(o){return j8.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function _o(){}var mx=null;function px(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Fc=null,Hc=null;function VC(o){var l=on(o);if(l&&(o=l.stateNode)){var d=o[ze]||null;e:switch(o=l.stateNode,l.type){case"input":if(dx(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+as(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==o&&p.form===o.form){var S=p[ze]||null;if(!S)throw Error(r(90));dx(p,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(l=0;l<d.length;l++)p=d[l],p.form===o.form&&PC(p)}break e;case"textarea":zC(o,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&Uc(o,!!d.multiple,l,!1)}}}var gx=!1;function GC(o,l,d){if(gx)return o(l,d);gx=!0;try{var p=o(l);return p}finally{if(gx=!1,(Fc!==null||Hc!==null)&&(Fm(),Fc&&(l=Fc,o=Hc,Hc=Fc=null,VC(l),o)))for(l=0;l<o.length;l++)VC(o[l])}}function jd(o,l){var d=o.stateNode;if(d===null)return null;var p=d[ze]||null;if(p===null)return null;d=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var No=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yx=!1;if(No)try{var Td={};Object.defineProperty(Td,"passive",{get:function(){yx=!0}}),window.addEventListener("test",Td,Td),window.removeEventListener("test",Td,Td)}catch{yx=!1}var vi=null,xx=null,em=null;function BC(){if(em)return em;var o,l=xx,d=l.length,p,S="value"in vi?vi.value:vi.textContent,E=S.length;for(o=0;o<d&&l[o]===S[o];o++);var N=d-o;for(p=1;p<=N&&l[d-p]===S[E-p];p++);return em=S.slice(o,1<p?1-p:void 0)}function tm(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function nm(){return!0}function qC(){return!1}function ga(o){function l(d,p,S,E,N){this._reactName=d,this._targetInst=S,this.type=p,this.nativeEvent=E,this.target=N,this.currentTarget=null;for(var L in o)o.hasOwnProperty(L)&&(d=o[L],this[L]=d?d(E):E[L]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?nm:qC,this.isPropagationStopped=qC,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=nm)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=nm)},persist:function(){},isPersistent:nm}),l}var kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rm=ga(kl),_d=g({},kl,{view:0,detail:0}),T8=ga(_d),vx,bx,Nd,am=g({},_d,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cx,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Nd&&(Nd&&o.type==="mousemove"?(vx=o.screenX-Nd.screenX,bx=o.screenY-Nd.screenY):bx=vx=0,Nd=o),vx)},movementY:function(o){return"movementY"in o?o.movementY:bx}}),KC=ga(am),_8=g({},am,{dataTransfer:0}),N8=ga(_8),A8=g({},_d,{relatedTarget:0}),Sx=ga(A8),D8=g({},kl,{animationName:0,elapsedTime:0,pseudoElement:0}),O8=ga(D8),I8=g({},kl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),M8=ga(I8),k8=g({},kl,{data:0}),ZC=ga(k8),L8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},P8={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"},U8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function z8(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=U8[o])?!!l[o]:!1}function Cx(){return z8}var F8=g({},_d,{key:function(o){if(o.key){var l=L8[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=tm(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?P8[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cx,charCode:function(o){return o.type==="keypress"?tm(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?tm(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),H8=ga(F8),$8=g({},am,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),YC=ga($8),V8=g({},_d,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cx}),G8=ga(V8),B8=g({},kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),q8=ga(B8),K8=g({},am,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),Z8=ga(K8),Y8=g({},kl,{newState:0,oldState:0}),W8=ga(Y8),X8=[9,13,27,32],wx=No&&"CompositionEvent"in window,Ad=null;No&&"documentMode"in document&&(Ad=document.documentMode);var Q8=No&&"TextEvent"in window&&!Ad,WC=No&&(!wx||Ad&&8<Ad&&11>=Ad),XC=" ",QC=!1;function JC(o,l){switch(o){case"keyup":return X8.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ew(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var $c=!1;function J8(o,l){switch(o){case"compositionend":return ew(l);case"keypress":return l.which!==32?null:(QC=!0,XC);case"textInput":return o=l.data,o===XC&&QC?null:o;default:return null}}function ek(o,l){if($c)return o==="compositionend"||!wx&&JC(o,l)?(o=BC(),em=xx=vi=null,$c=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return WC&&l.locale!=="ko"?null:l.data;default:return null}}var tk={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 tw(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!tk[o.type]:l==="textarea"}function nw(o,l,d,p){Fc?Hc?Hc.push(p):Hc=[p]:Fc=p,l=Km(l,"onChange"),0<l.length&&(d=new rm("onChange","change",null,d,p),o.push({event:d,listeners:l}))}var Dd=null,Od=null;function nk(o){UR(o,0)}function sm(o){var l=Oa(o);if(PC(l))return o}function rw(o,l){if(o==="change")return l}var aw=!1;if(No){var Ex;if(No){var Rx="oninput"in document;if(!Rx){var sw=document.createElement("div");sw.setAttribute("oninput","return;"),Rx=typeof sw.oninput=="function"}Ex=Rx}else Ex=!1;aw=Ex&&(!document.documentMode||9<document.documentMode)}function ow(){Dd&&(Dd.detachEvent("onpropertychange",iw),Od=Dd=null)}function iw(o){if(o.propertyName==="value"&&sm(Od)){var l=[];nw(l,Od,o,px(o)),GC(nk,l)}}function rk(o,l,d){o==="focusin"?(ow(),Dd=l,Od=d,Dd.attachEvent("onpropertychange",iw)):o==="focusout"&&ow()}function ak(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return sm(Od)}function sk(o,l){if(o==="click")return sm(l)}function ok(o,l){if(o==="input"||o==="change")return sm(l)}function ik(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var ka=typeof Object.is=="function"?Object.is:ik;function Id(o,l){if(ka(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),p=Object.keys(l);if(d.length!==p.length)return!1;for(p=0;p<d.length;p++){var S=d[p];if(!ke.call(l,S)||!ka(o[S],l[S]))return!1}return!0}function lw(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function cw(o,l){var d=lw(o);o=0;for(var p;d;){if(d.nodeType===3){if(p=o+d.textContent.length,o<=l&&p>=l)return{node:d,offset:l-o};o=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=lw(d)}}function uw(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?uw(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function dw(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Qh(o.document);l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=Qh(o.document)}return l}function jx(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var lk=No&&"documentMode"in document&&11>=document.documentMode,Vc=null,Tx=null,Md=null,_x=!1;function fw(o,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;_x||Vc==null||Vc!==Qh(p)||(p=Vc,"selectionStart"in p&&jx(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Md&&Id(Md,p)||(Md=p,p=Km(Tx,"onSelect"),0<p.length&&(l=new rm("onSelect","select",null,l,d),o.push({event:l,listeners:p}),l.target=Vc)))}function Ll(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var Gc={animationend:Ll("Animation","AnimationEnd"),animationiteration:Ll("Animation","AnimationIteration"),animationstart:Ll("Animation","AnimationStart"),transitionrun:Ll("Transition","TransitionRun"),transitionstart:Ll("Transition","TransitionStart"),transitioncancel:Ll("Transition","TransitionCancel"),transitionend:Ll("Transition","TransitionEnd")},Nx={},hw={};No&&(hw=document.createElement("div").style,"AnimationEvent"in window||(delete Gc.animationend.animation,delete Gc.animationiteration.animation,delete Gc.animationstart.animation),"TransitionEvent"in window||delete Gc.transitionend.transition);function Pl(o){if(Nx[o])return Nx[o];if(!Gc[o])return o;var l=Gc[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in hw)return Nx[o]=l[d];return o}var mw=Pl("animationend"),pw=Pl("animationiteration"),gw=Pl("animationstart"),ck=Pl("transitionrun"),uk=Pl("transitionstart"),dk=Pl("transitioncancel"),yw=Pl("transitionend"),xw=new Map,Ax="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(" ");Ax.push("scrollEnd");function js(o,l){xw.set(o,l),Ma(l,[o])}var om=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},ss=[],Bc=0,Dx=0;function im(){for(var o=Bc,l=Dx=Bc=0;l<o;){var d=ss[l];ss[l++]=null;var p=ss[l];ss[l++]=null;var S=ss[l];ss[l++]=null;var E=ss[l];if(ss[l++]=null,p!==null&&S!==null){var N=p.pending;N===null?S.next=S:(S.next=N.next,N.next=S),p.pending=S}E!==0&&vw(d,S,E)}}function lm(o,l,d,p){ss[Bc++]=o,ss[Bc++]=l,ss[Bc++]=d,ss[Bc++]=p,Dx|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function Ox(o,l,d,p){return lm(o,l,d,p),cm(o)}function Ul(o,l){return lm(o,null,null,l),cm(o)}function vw(o,l,d){o.lanes|=d;var p=o.alternate;p!==null&&(p.lanes|=d);for(var S=!1,E=o.return;E!==null;)E.childLanes|=d,p=E.alternate,p!==null&&(p.childLanes|=d),E.tag===22&&(o=E.stateNode,o===null||o._visibility&1||(S=!0)),o=E,E=E.return;return o.tag===3?(E=o.stateNode,S&&l!==null&&(S=31-kn(d),o=E.hiddenUpdates,p=o[S],p===null?o[S]=[l]:p.push(l),l.lane=d|536870912),E):null}function cm(o){if(50<nf)throw nf=0,Hv=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var qc={};function fk(o,l,d,p){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function La(o,l,d,p){return new fk(o,l,d,p)}function Ix(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Ao(o,l){var d=o.alternate;return d===null?(d=La(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&65011712,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d.refCleanup=o.refCleanup,d}function bw(o,l){o.flags&=65011714;var d=o.alternate;return d===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=d.childLanes,o.lanes=d.lanes,o.child=d.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=d.memoizedProps,o.memoizedState=d.memoizedState,o.updateQueue=d.updateQueue,o.type=d.type,l=d.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function um(o,l,d,p,S,E){var N=0;if(p=o,typeof o=="function")Ix(o)&&(N=1);else if(typeof o=="string")N=y9(o,d,Z.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case k:return o=La(31,d,l,S),o.elementType=k,o.lanes=E,o;case b:return zl(d.children,S,E,l);case w:N=8,S|=24;break;case R:return o=La(12,d,l,S|2),o.elementType=R,o.lanes=E,o;case O:return o=La(13,d,l,S),o.elementType=O,o.lanes=E,o;case A:return o=La(19,d,l,S),o.elementType=A,o.lanes=E,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case _:N=10;break e;case j:N=9;break e;case D:N=11;break e;case T:N=14;break e;case I:N=16,p=null;break e}N=29,d=Error(r(130,o===null?"null":typeof o,"")),p=null}return l=La(N,d,l,S),l.elementType=o,l.type=p,l.lanes=E,l}function zl(o,l,d,p){return o=La(7,o,p,l),o.lanes=d,o}function Mx(o,l,d){return o=La(6,o,null,l),o.lanes=d,o}function Sw(o){var l=La(18,null,null,0);return l.stateNode=o,l}function kx(o,l,d){return l=La(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var Cw=new WeakMap;function os(o,l){if(typeof o=="object"&&o!==null){var d=Cw.get(o);return d!==void 0?d:(l={value:o,source:l,stack:yn(l)},Cw.set(o,l),l)}return{value:o,source:l,stack:yn(l)}}var Kc=[],Zc=0,dm=null,kd=0,is=[],ls=0,bi=null,Xs=1,Qs="";function Do(o,l){Kc[Zc++]=kd,Kc[Zc++]=dm,dm=o,kd=l}function ww(o,l,d){is[ls++]=Xs,is[ls++]=Qs,is[ls++]=bi,bi=o;var p=Xs;o=Qs;var S=32-kn(p)-1;p&=~(1<<S),d+=1;var E=32-kn(l)+S;if(30<E){var N=S-S%5;E=(p&(1<<N)-1).toString(32),p>>=N,S-=N,Xs=1<<32-kn(l)+S|d<<S|p,Qs=E+o}else Xs=1<<E|d<<S|p,Qs=o}function Lx(o){o.return!==null&&(Do(o,1),ww(o,1,0))}function Px(o){for(;o===dm;)dm=Kc[--Zc],Kc[Zc]=null,kd=Kc[--Zc],Kc[Zc]=null;for(;o===bi;)bi=is[--ls],is[ls]=null,Qs=is[--ls],is[ls]=null,Xs=is[--ls],is[ls]=null}function Ew(o,l){is[ls++]=Xs,is[ls++]=Qs,is[ls++]=bi,Xs=l.id,Qs=l.overflow,bi=o}var Mr=null,Pn=null,Kt=!1,Si=null,cs=!1,Ux=Error(r(519));function Ci(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ld(os(l,o)),Ux}function Rw(o){var l=o.stateNode,d=o.type,p=o.memoizedProps;switch(l[Le]=o,l[ze]=p,d){case"dialog":zt("cancel",l),zt("close",l);break;case"iframe":case"object":case"embed":zt("load",l);break;case"video":case"audio":for(d=0;d<af.length;d++)zt(af[d],l);break;case"source":zt("error",l);break;case"img":case"image":case"link":zt("error",l),zt("load",l);break;case"details":zt("toggle",l);break;case"input":zt("invalid",l),UC(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":zt("invalid",l);break;case"textarea":zt("invalid",l),FC(l,p.value,p.defaultValue,p.children)}d=p.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||p.suppressHydrationWarning===!0||$R(l.textContent,d)?(p.popover!=null&&(zt("beforetoggle",l),zt("toggle",l)),p.onScroll!=null&&zt("scroll",l),p.onScrollEnd!=null&&zt("scrollend",l),p.onClick!=null&&(l.onclick=_o),l=!0):l=!1,l||Ci(o,!0)}function jw(o){for(Mr=o.return;Mr;)switch(Mr.tag){case 5:case 31:case 13:cs=!1;return;case 27:case 3:cs=!0;return;default:Mr=Mr.return}}function Yc(o){if(o!==Mr)return!1;if(!Kt)return jw(o),Kt=!0,!1;var l=o.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=o.type,d=!(d!=="form"&&d!=="button")||n0(o.type,o.memoizedProps)),d=!d),d&&Pn&&Ci(o),jw(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=XR(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=XR(o)}else l===27?(l=Pn,Li(o.type)?(o=i0,i0=null,Pn=o):Pn=l):Pn=Mr?ds(o.stateNode.nextSibling):null;return!0}function Fl(){Pn=Mr=null,Kt=!1}function zx(){var o=Si;return o!==null&&(ba===null?ba=o:ba.push.apply(ba,o),Si=null),o}function Ld(o){Si===null?Si=[o]:Si.push(o)}var Fx=P(null),Hl=null,Oo=null;function wi(o,l,d){F(Fx,l._currentValue),l._currentValue=d}function Io(o){o._currentValue=Fx.current,z(Fx)}function Hx(o,l,d){for(;o!==null;){var p=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),o===d)break;o=o.return}}function $x(o,l,d,p){var S=o.child;for(S!==null&&(S.return=o);S!==null;){var E=S.dependencies;if(E!==null){var N=S.child;E=E.firstContext;e:for(;E!==null;){var L=E;E=S;for(var X=0;X<l.length;X++)if(L.context===l[X]){E.lanes|=d,L=E.alternate,L!==null&&(L.lanes|=d),Hx(E.return,d,o),p||(N=null);break e}E=L.next}}else if(S.tag===18){if(N=S.return,N===null)throw Error(r(341));N.lanes|=d,E=N.alternate,E!==null&&(E.lanes|=d),Hx(N,d,o),N=null}else N=S.child;if(N!==null)N.return=S;else for(N=S;N!==null;){if(N===o){N=null;break}if(S=N.sibling,S!==null){S.return=N.return,N=S;break}N=N.return}S=N}}function Wc(o,l,d,p){o=null;for(var S=l,E=!1;S!==null;){if(!E){if((S.flags&524288)!==0)E=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var N=S.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var L=S.type;ka(S.pendingProps.value,N.value)||(o!==null?o.push(L):o=[L])}}else if(S===J.current){if(N=S.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(o!==null?o.push(uf):o=[uf])}S=S.return}o!==null&&$x(l,o,d,p),l.flags|=262144}function fm(o){for(o=o.firstContext;o!==null;){if(!ka(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function $l(o){Hl=o,Oo=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function kr(o){return Tw(Hl,o)}function hm(o,l){return Hl===null&&$l(o),Tw(o,l)}function Tw(o,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},Oo===null){if(o===null)throw Error(r(308));Oo=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Oo=Oo.next=l;return d}var hk=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(d,p){o.push(p)}};this.abort=function(){l.aborted=!0,o.forEach(function(d){return d()})}},mk=e.unstable_scheduleCallback,pk=e.unstable_NormalPriority,ir={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vx(){return{controller:new hk,data:new Map,refCount:0}}function Pd(o){o.refCount--,o.refCount===0&&mk(pk,function(){o.controller.abort()})}var Ud=null,Gx=0,Xc=0,Qc=null;function gk(o,l){if(Ud===null){var d=Ud=[];Gx=0,Xc=Kv(),Qc={status:"pending",value:void 0,then:function(p){d.push(p)}}}return Gx++,l.then(_w,_w),l}function _w(){if(--Gx===0&&Ud!==null){Qc!==null&&(Qc.status="fulfilled");var o=Ud;Ud=null,Xc=0,Qc=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function yk(o,l){var d=[],p={status:"pending",value:null,reason:null,then:function(S){d.push(S)}};return o.then(function(){p.status="fulfilled",p.value=l;for(var S=0;S<d.length;S++)(0,d[S])(l)},function(S){for(p.status="rejected",p.reason=S,S=0;S<d.length;S++)(0,d[S])(void 0)}),p}var Nw=M.S;M.S=function(o,l){fR=Re(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&gk(o,l),Nw!==null&&Nw(o,l)};var Vl=P(null);function Bx(){var o=Vl.current;return o!==null?o:Dn.pooledCache}function mm(o,l){l===null?F(Vl,Vl.current):F(Vl,l.pool)}function Aw(){var o=Bx();return o===null?null:{parent:ir._currentValue,pool:o}}var Jc=Error(r(460)),qx=Error(r(474)),pm=Error(r(542)),gm={then:function(){}};function Dw(o){return o=o.status,o==="fulfilled"||o==="rejected"}function Ow(o,l,d){switch(d=o[d],d===void 0?o.push(l):d!==l&&(l.then(_o,_o),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,Mw(o),o;default:if(typeof l.status=="string")l.then(_o,_o);else{if(o=Dn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(p){if(l.status==="pending"){var S=l;S.status="fulfilled",S.value=p}},function(p){if(l.status==="pending"){var S=l;S.status="rejected",S.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,Mw(o),o}throw Bl=l,Jc}}function Gl(o){try{var l=o._init;return l(o._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(Bl=d,Jc):d}}var Bl=null;function Iw(){if(Bl===null)throw Error(r(459));var o=Bl;return Bl=null,o}function Mw(o){if(o===Jc||o===pm)throw Error(r(483))}var eu=null,zd=0;function ym(o){var l=zd;return zd+=1,eu===null&&(eu=[]),Ow(eu,o,l)}function Fd(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function xm(o,l){throw l.$$typeof===x?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function kw(o){function l(oe,te){if(o){var ue=oe.deletions;ue===null?(oe.deletions=[te],oe.flags|=16):ue.push(te)}}function d(oe,te){if(!o)return null;for(;te!==null;)l(oe,te),te=te.sibling;return null}function p(oe){for(var te=new Map;oe!==null;)oe.key!==null?te.set(oe.key,oe):te.set(oe.index,oe),oe=oe.sibling;return te}function S(oe,te){return oe=Ao(oe,te),oe.index=0,oe.sibling=null,oe}function E(oe,te,ue){return oe.index=ue,o?(ue=oe.alternate,ue!==null?(ue=ue.index,ue<te?(oe.flags|=67108866,te):ue):(oe.flags|=67108866,te)):(oe.flags|=1048576,te)}function N(oe){return o&&oe.alternate===null&&(oe.flags|=67108866),oe}function L(oe,te,ue,ve){return te===null||te.tag!==6?(te=Mx(ue,oe.mode,ve),te.return=oe,te):(te=S(te,ue),te.return=oe,te)}function X(oe,te,ue,ve){var rt=ue.type;return rt===b?xe(oe,te,ue.props.children,ve,ue.key):te!==null&&(te.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===I&&Gl(rt)===te.type)?(te=S(te,ue.props),Fd(te,ue),te.return=oe,te):(te=um(ue.type,ue.key,ue.props,null,oe.mode,ve),Fd(te,ue),te.return=oe,te)}function de(oe,te,ue,ve){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=kx(ue,oe.mode,ve),te.return=oe,te):(te=S(te,ue.children||[]),te.return=oe,te)}function xe(oe,te,ue,ve,rt){return te===null||te.tag!==7?(te=zl(ue,oe.mode,ve,rt),te.return=oe,te):(te=S(te,ue),te.return=oe,te)}function be(oe,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Mx(""+te,oe.mode,ue),te.return=oe,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return ue=um(te.type,te.key,te.props,null,oe.mode,ue),Fd(ue,te),ue.return=oe,ue;case C:return te=kx(te,oe.mode,ue),te.return=oe,te;case I:return te=Gl(te),be(oe,te,ue)}if(H(te)||K(te))return te=zl(te,oe.mode,ue,null),te.return=oe,te;if(typeof te.then=="function")return be(oe,ym(te),ue);if(te.$$typeof===_)return be(oe,hm(oe,te),ue);xm(oe,te)}return null}function he(oe,te,ue,ve){var rt=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return rt!==null?null:L(oe,te,""+ue,ve);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===rt?X(oe,te,ue,ve):null;case C:return ue.key===rt?de(oe,te,ue,ve):null;case I:return ue=Gl(ue),he(oe,te,ue,ve)}if(H(ue)||K(ue))return rt!==null?null:xe(oe,te,ue,ve,null);if(typeof ue.then=="function")return he(oe,te,ym(ue),ve);if(ue.$$typeof===_)return he(oe,te,hm(oe,ue),ve);xm(oe,ue)}return null}function pe(oe,te,ue,ve,rt){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return oe=oe.get(ue)||null,L(te,oe,""+ve,rt);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return oe=oe.get(ve.key===null?ue:ve.key)||null,X(te,oe,ve,rt);case C:return oe=oe.get(ve.key===null?ue:ve.key)||null,de(te,oe,ve,rt);case I:return ve=Gl(ve),pe(oe,te,ue,ve,rt)}if(H(ve)||K(ve))return oe=oe.get(ue)||null,xe(te,oe,ve,rt,null);if(typeof ve.then=="function")return pe(oe,te,ue,ym(ve),rt);if(ve.$$typeof===_)return pe(oe,te,ue,hm(te,ve),rt);xm(te,ve)}return null}function qe(oe,te,ue,ve){for(var rt=null,cn=null,Xe=te,Tt=te=0,Vt=null;Xe!==null&&Tt<ue.length;Tt++){Xe.index>Tt?(Vt=Xe,Xe=null):Vt=Xe.sibling;var un=he(oe,Xe,ue[Tt],ve);if(un===null){Xe===null&&(Xe=Vt);break}o&&Xe&&un.alternate===null&&l(oe,Xe),te=E(un,te,Tt),cn===null?rt=un:cn.sibling=un,cn=un,Xe=Vt}if(Tt===ue.length)return d(oe,Xe),Kt&&Do(oe,Tt),rt;if(Xe===null){for(;Tt<ue.length;Tt++)Xe=be(oe,ue[Tt],ve),Xe!==null&&(te=E(Xe,te,Tt),cn===null?rt=Xe:cn.sibling=Xe,cn=Xe);return Kt&&Do(oe,Tt),rt}for(Xe=p(Xe);Tt<ue.length;Tt++)Vt=pe(Xe,oe,Tt,ue[Tt],ve),Vt!==null&&(o&&Vt.alternate!==null&&Xe.delete(Vt.key===null?Tt:Vt.key),te=E(Vt,te,Tt),cn===null?rt=Vt:cn.sibling=Vt,cn=Vt);return o&&Xe.forEach(function(Hi){return l(oe,Hi)}),Kt&&Do(oe,Tt),rt}function ot(oe,te,ue,ve){if(ue==null)throw Error(r(151));for(var rt=null,cn=null,Xe=te,Tt=te=0,Vt=null,un=ue.next();Xe!==null&&!un.done;Tt++,un=ue.next()){Xe.index>Tt?(Vt=Xe,Xe=null):Vt=Xe.sibling;var Hi=he(oe,Xe,un.value,ve);if(Hi===null){Xe===null&&(Xe=Vt);break}o&&Xe&&Hi.alternate===null&&l(oe,Xe),te=E(Hi,te,Tt),cn===null?rt=Hi:cn.sibling=Hi,cn=Hi,Xe=Vt}if(un.done)return d(oe,Xe),Kt&&Do(oe,Tt),rt;if(Xe===null){for(;!un.done;Tt++,un=ue.next())un=be(oe,un.value,ve),un!==null&&(te=E(un,te,Tt),cn===null?rt=un:cn.sibling=un,cn=un);return Kt&&Do(oe,Tt),rt}for(Xe=p(Xe);!un.done;Tt++,un=ue.next())un=pe(Xe,oe,Tt,un.value,ve),un!==null&&(o&&un.alternate!==null&&Xe.delete(un.key===null?Tt:un.key),te=E(un,te,Tt),cn===null?rt=un:cn.sibling=un,cn=un);return o&&Xe.forEach(function(_9){return l(oe,_9)}),Kt&&Do(oe,Tt),rt}function jn(oe,te,ue,ve){if(typeof ue=="object"&&ue!==null&&ue.type===b&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:e:{for(var rt=ue.key;te!==null;){if(te.key===rt){if(rt=ue.type,rt===b){if(te.tag===7){d(oe,te.sibling),ve=S(te,ue.props.children),ve.return=oe,oe=ve;break e}}else if(te.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===I&&Gl(rt)===te.type){d(oe,te.sibling),ve=S(te,ue.props),Fd(ve,ue),ve.return=oe,oe=ve;break e}d(oe,te);break}else l(oe,te);te=te.sibling}ue.type===b?(ve=zl(ue.props.children,oe.mode,ve,ue.key),ve.return=oe,oe=ve):(ve=um(ue.type,ue.key,ue.props,null,oe.mode,ve),Fd(ve,ue),ve.return=oe,oe=ve)}return N(oe);case C:e:{for(rt=ue.key;te!==null;){if(te.key===rt)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){d(oe,te.sibling),ve=S(te,ue.children||[]),ve.return=oe,oe=ve;break e}else{d(oe,te);break}else l(oe,te);te=te.sibling}ve=kx(ue,oe.mode,ve),ve.return=oe,oe=ve}return N(oe);case I:return ue=Gl(ue),jn(oe,te,ue,ve)}if(H(ue))return qe(oe,te,ue,ve);if(K(ue)){if(rt=K(ue),typeof rt!="function")throw Error(r(150));return ue=rt.call(ue),ot(oe,te,ue,ve)}if(typeof ue.then=="function")return jn(oe,te,ym(ue),ve);if(ue.$$typeof===_)return jn(oe,te,hm(oe,ue),ve);xm(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(d(oe,te.sibling),ve=S(te,ue),ve.return=oe,oe=ve):(d(oe,te),ve=Mx(ue,oe.mode,ve),ve.return=oe,oe=ve),N(oe)):d(oe,te)}return function(oe,te,ue,ve){try{zd=0;var rt=jn(oe,te,ue,ve);return eu=null,rt}catch(Xe){if(Xe===Jc||Xe===pm)throw Xe;var cn=La(29,Xe,null,oe.mode);return cn.lanes=ve,cn.return=oe,cn}finally{}}}var ql=kw(!0),Lw=kw(!1),Ei=!1;function Kx(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zx(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Ri(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function ji(o,l,d){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(mn&2)!==0){var S=p.pending;return S===null?l.next=l:(l.next=S.next,S.next=l),p.pending=l,l=cm(o),vw(o,null,d),l}return lm(o,p,l,d),cm(o)}function Hd(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,W(o,d)}}function Yx(o,l){var d=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var S=null,E=null;if(d=d.firstBaseUpdate,d!==null){do{var N={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};E===null?S=E=N:E=E.next=N,d=d.next}while(d!==null);E===null?S=E=l:E=E.next=l}else S=E=l;d={baseState:p.baseState,firstBaseUpdate:S,lastBaseUpdate:E,shared:p.shared,callbacks:p.callbacks},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}var Wx=!1;function $d(){if(Wx){var o=Qc;if(o!==null)throw o}}function Vd(o,l,d,p){Wx=!1;var S=o.updateQueue;Ei=!1;var E=S.firstBaseUpdate,N=S.lastBaseUpdate,L=S.shared.pending;if(L!==null){S.shared.pending=null;var X=L,de=X.next;X.next=null,N===null?E=de:N.next=de,N=X;var xe=o.alternate;xe!==null&&(xe=xe.updateQueue,L=xe.lastBaseUpdate,L!==N&&(L===null?xe.firstBaseUpdate=de:L.next=de,xe.lastBaseUpdate=X))}if(E!==null){var be=S.baseState;N=0,xe=de=X=null,L=E;do{var he=L.lane&-536870913,pe=he!==L.lane;if(pe?($t&he)===he:(p&he)===he){he!==0&&he===Xc&&(Wx=!0),xe!==null&&(xe=xe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var qe=o,ot=L;he=l;var jn=d;switch(ot.tag){case 1:if(qe=ot.payload,typeof qe=="function"){be=qe.call(jn,be,he);break e}be=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=ot.payload,he=typeof qe=="function"?qe.call(jn,be,he):qe,he==null)break e;be=g({},be,he);break e;case 2:Ei=!0}}he=L.callback,he!==null&&(o.flags|=64,pe&&(o.flags|=8192),pe=S.callbacks,pe===null?S.callbacks=[he]:pe.push(he))}else pe={lane:he,tag:L.tag,payload:L.payload,callback:L.callback,next:null},xe===null?(de=xe=pe,X=be):xe=xe.next=pe,N|=he;if(L=L.next,L===null){if(L=S.shared.pending,L===null)break;pe=L,L=pe.next,pe.next=null,S.lastBaseUpdate=pe,S.shared.pending=null}}while(!0);xe===null&&(X=be),S.baseState=X,S.firstBaseUpdate=de,S.lastBaseUpdate=xe,E===null&&(S.shared.lanes=0),Di|=N,o.lanes=N,o.memoizedState=be}}function Pw(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function Uw(o,l){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)Pw(d[o],l)}var tu=P(null),vm=P(0);function zw(o,l){o=$o,F(vm,o),F(tu,l),$o=o|l.baseLanes}function Xx(){F(vm,$o),F(tu,tu.current)}function Qx(){$o=vm.current,z(tu),z(vm)}var Pa=P(null),us=null;function Ti(o){var l=o.alternate;F(nr,nr.current&1),F(Pa,o),us===null&&(l===null||tu.current!==null||l.memoizedState!==null)&&(us=o)}function Jx(o){F(nr,nr.current),F(Pa,o),us===null&&(us=o)}function Fw(o){o.tag===22?(F(nr,nr.current),F(Pa,o),us===null&&(us=o)):_i()}function _i(){F(nr,nr.current),F(Pa,Pa.current)}function Ua(o){z(Pa),us===o&&(us=null),z(nr)}var nr=P(0);function bm(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||s0(d)||o0(d)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Mo=0,wt=null,En=null,lr=null,Sm=!1,nu=!1,Kl=!1,Cm=0,Gd=0,ru=null,xk=0;function Yn(){throw Error(r(321))}function ev(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!ka(o[d],l[d]))return!1;return!0}function tv(o,l,d,p,S,E){return Mo=E,wt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=o===null||o.memoizedState===null?wE:gv,Kl=!1,E=d(p,S),Kl=!1,nu&&(E=$w(l,d,p,S)),Hw(o),E}function Hw(o){M.H=Kd;var l=En!==null&&En.next!==null;if(Mo=0,lr=En=wt=null,Sm=!1,Gd=0,ru=null,l)throw Error(r(300));o===null||cr||(o=o.dependencies,o!==null&&fm(o)&&(cr=!0))}function $w(o,l,d,p){wt=o;var S=0;do{if(nu&&(ru=null),Gd=0,nu=!1,25<=S)throw Error(r(301));if(S+=1,lr=En=null,o.updateQueue!=null){var E=o.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}M.H=EE,E=l(d,p)}while(nu);return E}function vk(){var o=M.H,l=o.useState()[0];return l=typeof l.then=="function"?Bd(l):l,o=o.useState()[0],(En!==null?En.memoizedState:null)!==o&&(wt.flags|=1024),l}function nv(){var o=Cm!==0;return Cm=0,o}function rv(o,l,d){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~d}function av(o){if(Sm){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}Sm=!1}Mo=0,lr=En=wt=null,nu=!1,Gd=Cm=0,ru=null}function ta(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lr===null?wt.memoizedState=lr=o:lr=lr.next=o,lr}function rr(){if(En===null){var o=wt.alternate;o=o!==null?o.memoizedState:null}else o=En.next;var l=lr===null?wt.memoizedState:lr.next;if(l!==null)lr=l,En=o;else{if(o===null)throw wt.alternate===null?Error(r(467)):Error(r(310));En=o,o={memoizedState:En.memoizedState,baseState:En.baseState,baseQueue:En.baseQueue,queue:En.queue,next:null},lr===null?wt.memoizedState=lr=o:lr=lr.next=o}return lr}function wm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bd(o){var l=Gd;return Gd+=1,ru===null&&(ru=[]),o=Ow(ru,o,l),l=wt,(lr===null?l.memoizedState:lr.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?wE:gv),o}function Em(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Bd(o);if(o.$$typeof===_)return kr(o)}throw Error(r(438,String(o)))}function sv(o){var l=null,d=wt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var p=wt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(S){return S.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=wm(),wt.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(o),p=0;p<o;p++)d[p]=V;return l.index++,d}function ko(o,l){return typeof l=="function"?l(o):l}function Rm(o){var l=rr();return ov(l,En,o)}function ov(o,l,d){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var S=o.baseQueue,E=p.pending;if(E!==null){if(S!==null){var N=S.next;S.next=E.next,E.next=N}l.baseQueue=S=E,p.pending=null}if(E=o.baseState,S===null)o.memoizedState=E;else{l=S.next;var L=N=null,X=null,de=l,xe=!1;do{var be=de.lane&-536870913;if(be!==de.lane?($t&be)===be:(Mo&be)===be){var he=de.revertLane;if(he===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),be===Xc&&(xe=!0);else if((Mo&he)===he){de=de.next,he===Xc&&(xe=!0);continue}else be={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},X===null?(L=X=be,N=E):X=X.next=be,wt.lanes|=he,Di|=he;be=de.action,Kl&&d(E,be),E=de.hasEagerState?de.eagerState:d(E,be)}else he={lane:be,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},X===null?(L=X=he,N=E):X=X.next=he,wt.lanes|=be,Di|=be;de=de.next}while(de!==null&&de!==l);if(X===null?N=E:X.next=L,!ka(E,o.memoizedState)&&(cr=!0,xe&&(d=Qc,d!==null)))throw d;o.memoizedState=E,o.baseState=N,o.baseQueue=X,p.lastRenderedState=E}return S===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function iv(o){var l=rr(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=o;var p=d.dispatch,S=d.pending,E=l.memoizedState;if(S!==null){d.pending=null;var N=S=S.next;do E=o(E,N.action),N=N.next;while(N!==S);ka(E,l.memoizedState)||(cr=!0),l.memoizedState=E,l.baseQueue===null&&(l.baseState=E),d.lastRenderedState=E}return[E,p]}function Vw(o,l,d){var p=wt,S=rr(),E=Kt;if(E){if(d===void 0)throw Error(r(407));d=d()}else d=l();var N=!ka((En||S).memoizedState,d);if(N&&(S.memoizedState=d,cr=!0),S=S.queue,uv(qw.bind(null,p,S,o),[o]),S.getSnapshot!==l||N||lr!==null&&lr.memoizedState.tag&1){if(p.flags|=2048,au(9,{destroy:void 0},Bw.bind(null,p,S,d,l),null),Dn===null)throw Error(r(349));E||(Mo&127)!==0||Gw(p,l,d)}return d}function Gw(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=wt.updateQueue,l===null?(l=wm(),wt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function Bw(o,l,d,p){l.value=d,l.getSnapshot=p,Kw(l)&&Zw(o)}function qw(o,l,d){return d(function(){Kw(l)&&Zw(o)})}function Kw(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!ka(o,d)}catch{return!0}}function Zw(o){var l=Ul(o,2);l!==null&&Sa(l,o,2)}function lv(o){var l=ta();if(typeof o=="function"){var d=o;if(o=d(),Kl){or(!0);try{d()}finally{or(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:o},l}function Yw(o,l,d,p){return o.baseState=d,ov(o,En,typeof p=="function"?p:ko)}function bk(o,l,d,p,S){if(_m(o))throw Error(r(485));if(o=l.action,o!==null){var E={payload:S,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){E.listeners.push(N)}};M.T!==null?d(!0):E.isTransition=!1,p(E),d=l.pending,d===null?(E.next=l.pending=E,Ww(l,E)):(E.next=d.next,l.pending=d.next=E)}}function Ww(o,l){var d=l.action,p=l.payload,S=o.state;if(l.isTransition){var E=M.T,N={};M.T=N;try{var L=d(S,p),X=M.S;X!==null&&X(N,L),Xw(o,l,L)}catch(de){cv(o,l,de)}finally{E!==null&&N.types!==null&&(E.types=N.types),M.T=E}}else try{E=d(S,p),Xw(o,l,E)}catch(de){cv(o,l,de)}}function Xw(o,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){Qw(o,l,p)},function(p){return cv(o,l,p)}):Qw(o,l,d)}function Qw(o,l,d){l.status="fulfilled",l.value=d,Jw(l),o.state=d,l=o.pending,l!==null&&(d=l.next,d===l?o.pending=null:(d=d.next,l.next=d,Ww(o,d)))}function cv(o,l,d){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,Jw(l),l=l.next;while(l!==p)}o.action=null}function Jw(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function eE(o,l){return l}function tE(o,l){if(Kt){var d=Dn.formState;if(d!==null){e:{var p=wt;if(Kt){if(Pn){t:{for(var S=Pn,E=cs;S.nodeType!==8;){if(!E){S=null;break t}if(S=ds(S.nextSibling),S===null){S=null;break t}}E=S.data,S=E==="F!"||E==="F"?S:null}if(S){Pn=ds(S.nextSibling),p=S.data==="F!";break e}}Ci(p)}p=!1}p&&(l=d[0])}}return d=ta(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:eE,lastRenderedState:l},d.queue=p,d=bE.bind(null,wt,p),p.dispatch=d,p=lv(!1),E=pv.bind(null,wt,!1,p.queue),p=ta(),S={state:l,dispatch:null,action:o,pending:null},p.queue=S,d=bk.bind(null,wt,S,E,d),S.dispatch=d,p.memoizedState=o,[l,d,!1]}function nE(o){var l=rr();return rE(l,En,o)}function rE(o,l,d){if(l=ov(o,l,eE)[0],o=Rm(ko)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=Bd(l)}catch(N){throw N===Jc?pm:N}else p=l;l=rr();var S=l.queue,E=S.dispatch;return d!==l.memoizedState&&(wt.flags|=2048,au(9,{destroy:void 0},Sk.bind(null,S,d),null)),[p,E,o]}function Sk(o,l){o.action=l}function aE(o){var l=rr(),d=En;if(d!==null)return rE(l,d,o);rr(),l=l.memoizedState,d=rr();var p=d.queue.dispatch;return d.memoizedState=o,[l,p,!1]}function au(o,l,d,p){return o={tag:o,create:d,deps:p,inst:l,next:null},l=wt.updateQueue,l===null&&(l=wm(),wt.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=o.next=o:(p=d.next,d.next=o,o.next=p,l.lastEffect=o),o}function sE(){return rr().memoizedState}function jm(o,l,d,p){var S=ta();wt.flags|=o,S.memoizedState=au(1|l,{destroy:void 0},d,p===void 0?null:p)}function Tm(o,l,d,p){var S=rr();p=p===void 0?null:p;var E=S.memoizedState.inst;En!==null&&p!==null&&ev(p,En.memoizedState.deps)?S.memoizedState=au(l,E,d,p):(wt.flags|=o,S.memoizedState=au(1|l,E,d,p))}function oE(o,l){jm(8390656,8,o,l)}function uv(o,l){Tm(2048,8,o,l)}function Ck(o){wt.flags|=4;var l=wt.updateQueue;if(l===null)l=wm(),wt.updateQueue=l,l.events=[o];else{var d=l.events;d===null?l.events=[o]:d.push(o)}}function iE(o){var l=rr().memoizedState;return Ck({ref:l,nextImpl:o}),function(){if((mn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function lE(o,l){return Tm(4,2,o,l)}function cE(o,l){return Tm(4,4,o,l)}function uE(o,l){if(typeof l=="function"){o=o();var d=l(o);return function(){typeof d=="function"?d():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function dE(o,l,d){d=d!=null?d.concat([o]):null,Tm(4,4,uE.bind(null,l,o),d)}function dv(){}function fE(o,l){var d=rr();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&ev(l,p[1])?p[0]:(d.memoizedState=[o,l],o)}function hE(o,l){var d=rr();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&ev(l,p[1]))return p[0];if(p=o(),Kl){or(!0);try{o()}finally{or(!1)}}return d.memoizedState=[p,l],p}function fv(o,l,d){return d===void 0||(Mo&1073741824)!==0&&($t&261930)===0?o.memoizedState=l:(o.memoizedState=d,o=mR(),wt.lanes|=o,Di|=o,d)}function mE(o,l,d,p){return ka(d,l)?d:tu.current!==null?(o=fv(o,d,p),ka(o,l)||(cr=!0),o):(Mo&42)===0||(Mo&1073741824)!==0&&($t&261930)===0?(cr=!0,o.memoizedState=d):(o=mR(),wt.lanes|=o,Di|=o,l)}function pE(o,l,d,p,S){var E=B.p;B.p=E!==0&&8>E?E:8;var N=M.T,L={};M.T=L,pv(o,!1,l,d);try{var X=S(),de=M.S;if(de!==null&&de(L,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var xe=yk(X,p);qd(o,l,xe,Ha(o))}else qd(o,l,p,Ha(o))}catch(be){qd(o,l,{then:function(){},status:"rejected",reason:be},Ha())}finally{B.p=E,N!==null&&L.types!==null&&(N.types=L.types),M.T=N}}function wk(){}function hv(o,l,d,p){if(o.tag!==5)throw Error(r(476));var S=gE(o).queue;pE(o,S,l,$,d===null?wk:function(){return yE(o),d(p)})}function gE(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:$},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:d},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function yE(o){var l=gE(o);l.next===null&&(l=o.alternate.memoizedState),qd(o,l.next.queue,{},Ha())}function mv(){return kr(uf)}function xE(){return rr().memoizedState}function vE(){return rr().memoizedState}function Ek(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var d=Ha();o=Ri(d);var p=ji(l,o,d);p!==null&&(Sa(p,l,d),Hd(p,l,d)),l={cache:Vx()},o.payload=l;return}l=l.return}}function Rk(o,l,d){var p=Ha();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},_m(o)?SE(l,d):(d=Ox(o,l,d,p),d!==null&&(Sa(d,o,p),CE(d,l,p)))}function bE(o,l,d){var p=Ha();qd(o,l,d,p)}function qd(o,l,d,p){var S={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(_m(o))SE(l,S);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var N=l.lastRenderedState,L=E(N,d);if(S.hasEagerState=!0,S.eagerState=L,ka(L,N))return lm(o,l,S,0),Dn===null&&im(),!1}catch{}finally{}if(d=Ox(o,l,S,p),d!==null)return Sa(d,o,p),CE(d,l,p),!0}return!1}function pv(o,l,d,p){if(p={lane:2,revertLane:Kv(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},_m(o)){if(l)throw Error(r(479))}else l=Ox(o,d,p,2),l!==null&&Sa(l,o,2)}function _m(o){var l=o.alternate;return o===wt||l!==null&&l===wt}function SE(o,l){nu=Sm=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function CE(o,l,d){if((d&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,W(o,d)}}var Kd={readContext:kr,use:Em,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useLayoutEffect:Yn,useInsertionEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useSyncExternalStore:Yn,useId:Yn,useHostTransitionStatus:Yn,useFormState:Yn,useActionState:Yn,useOptimistic:Yn,useMemoCache:Yn,useCacheRefresh:Yn};Kd.useEffectEvent=Yn;var wE={readContext:kr,use:Em,useCallback:function(o,l){return ta().memoizedState=[o,l===void 0?null:l],o},useContext:kr,useEffect:oE,useImperativeHandle:function(o,l,d){d=d!=null?d.concat([o]):null,jm(4194308,4,uE.bind(null,l,o),d)},useLayoutEffect:function(o,l){return jm(4194308,4,o,l)},useInsertionEffect:function(o,l){jm(4,2,o,l)},useMemo:function(o,l){var d=ta();l=l===void 0?null:l;var p=o();if(Kl){or(!0);try{o()}finally{or(!1)}}return d.memoizedState=[p,l],p},useReducer:function(o,l,d){var p=ta();if(d!==void 0){var S=d(l);if(Kl){or(!0);try{d(l)}finally{or(!1)}}}else S=l;return p.memoizedState=p.baseState=S,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:S},p.queue=o,o=o.dispatch=Rk.bind(null,wt,o),[p.memoizedState,o]},useRef:function(o){var l=ta();return o={current:o},l.memoizedState=o},useState:function(o){o=lv(o);var l=o.queue,d=bE.bind(null,wt,l);return l.dispatch=d,[o.memoizedState,d]},useDebugValue:dv,useDeferredValue:function(o,l){var d=ta();return fv(d,o,l)},useTransition:function(){var o=lv(!1);return o=pE.bind(null,wt,o.queue,!0,!1),ta().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,d){var p=wt,S=ta();if(Kt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),Dn===null)throw Error(r(349));($t&127)!==0||Gw(p,l,d)}S.memoizedState=d;var E={value:d,getSnapshot:l};return S.queue=E,oE(qw.bind(null,p,E,o),[o]),p.flags|=2048,au(9,{destroy:void 0},Bw.bind(null,p,E,d,l),null),d},useId:function(){var o=ta(),l=Dn.identifierPrefix;if(Kt){var d=Qs,p=Xs;d=(p&~(1<<32-kn(p)-1)).toString(32)+d,l="_"+l+"R_"+d,d=Cm++,0<d&&(l+="H"+d.toString(32)),l+="_"}else d=xk++,l="_"+l+"r_"+d.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:mv,useFormState:tE,useActionState:tE,useOptimistic:function(o){var l=ta();l.memoizedState=l.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=pv.bind(null,wt,!0,d),d.dispatch=l,[o,l]},useMemoCache:sv,useCacheRefresh:function(){return ta().memoizedState=Ek.bind(null,wt)},useEffectEvent:function(o){var l=ta(),d={impl:o};return l.memoizedState=d,function(){if((mn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},gv={readContext:kr,use:Em,useCallback:fE,useContext:kr,useEffect:uv,useImperativeHandle:dE,useInsertionEffect:lE,useLayoutEffect:cE,useMemo:hE,useReducer:Rm,useRef:sE,useState:function(){return Rm(ko)},useDebugValue:dv,useDeferredValue:function(o,l){var d=rr();return mE(d,En.memoizedState,o,l)},useTransition:function(){var o=Rm(ko)[0],l=rr().memoizedState;return[typeof o=="boolean"?o:Bd(o),l]},useSyncExternalStore:Vw,useId:xE,useHostTransitionStatus:mv,useFormState:nE,useActionState:nE,useOptimistic:function(o,l){var d=rr();return Yw(d,En,o,l)},useMemoCache:sv,useCacheRefresh:vE};gv.useEffectEvent=iE;var EE={readContext:kr,use:Em,useCallback:fE,useContext:kr,useEffect:uv,useImperativeHandle:dE,useInsertionEffect:lE,useLayoutEffect:cE,useMemo:hE,useReducer:iv,useRef:sE,useState:function(){return iv(ko)},useDebugValue:dv,useDeferredValue:function(o,l){var d=rr();return En===null?fv(d,o,l):mE(d,En.memoizedState,o,l)},useTransition:function(){var o=iv(ko)[0],l=rr().memoizedState;return[typeof o=="boolean"?o:Bd(o),l]},useSyncExternalStore:Vw,useId:xE,useHostTransitionStatus:mv,useFormState:aE,useActionState:aE,useOptimistic:function(o,l){var d=rr();return En!==null?Yw(d,En,o,l):(d.baseState=o,[o,d.queue.dispatch])},useMemoCache:sv,useCacheRefresh:vE};EE.useEffectEvent=iE;function yv(o,l,d,p){l=o.memoizedState,d=d(p,l),d=d==null?l:g({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var xv={enqueueSetState:function(o,l,d){o=o._reactInternals;var p=Ha(),S=Ri(p);S.payload=l,d!=null&&(S.callback=d),l=ji(o,S,p),l!==null&&(Sa(l,o,p),Hd(l,o,p))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var p=Ha(),S=Ri(p);S.tag=1,S.payload=l,d!=null&&(S.callback=d),l=ji(o,S,p),l!==null&&(Sa(l,o,p),Hd(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Ha(),p=Ri(d);p.tag=2,l!=null&&(p.callback=l),l=ji(o,p,d),l!==null&&(Sa(l,o,d),Hd(l,o,d))}};function RE(o,l,d,p,S,E,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,E,N):l.prototype&&l.prototype.isPureReactComponent?!Id(d,p)||!Id(S,E):!0}function jE(o,l,d,p){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,p),l.state!==o&&xv.enqueueReplaceState(l,l.state,null)}function Zl(o,l){var d=l;if("ref"in l){d={};for(var p in l)p!=="ref"&&(d[p]=l[p])}if(o=o.defaultProps){d===l&&(d=g({},d));for(var S in o)d[S]===void 0&&(d[S]=o[S])}return d}function TE(o){om(o)}function _E(o){console.error(o)}function NE(o){om(o)}function Nm(o,l){try{var d=o.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function AE(o,l,d){try{var p=o.onCaughtError;p(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function vv(o,l,d){return d=Ri(d),d.tag=3,d.payload={element:null},d.callback=function(){Nm(o,l)},d}function DE(o){return o=Ri(o),o.tag=3,o}function OE(o,l,d,p){var S=d.type.getDerivedStateFromError;if(typeof S=="function"){var E=p.value;o.payload=function(){return S(E)},o.callback=function(){AE(l,d,p)}}var N=d.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(o.callback=function(){AE(l,d,p),typeof S!="function"&&(Oi===null?Oi=new Set([this]):Oi.add(this));var L=p.stack;this.componentDidCatch(p.value,{componentStack:L!==null?L:""})})}function jk(o,l,d,p,S){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=d.alternate,l!==null&&Wc(l,d,S,!0),d=Pa.current,d!==null){switch(d.tag){case 31:case 13:return us===null?Hm():d.alternate===null&&Wn===0&&(Wn=3),d.flags&=-257,d.flags|=65536,d.lanes=S,p===gm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),Gv(o,p,S)),!1;case 22:return d.flags|=65536,p===gm?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([p]):d.add(p)),Gv(o,p,S)),!1}throw Error(r(435,d.tag))}return Gv(o,p,S),Hm(),!1}if(Kt)return l=Pa.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=S,p!==Ux&&(o=Error(r(422),{cause:p}),Ld(os(o,d)))):(p!==Ux&&(l=Error(r(423),{cause:p}),Ld(os(l,d))),o=o.current.alternate,o.flags|=65536,S&=-S,o.lanes|=S,p=os(p,d),S=vv(o.stateNode,p,S),Yx(o,S),Wn!==4&&(Wn=2)),!1;var E=Error(r(520),{cause:p});if(E=os(E,d),tf===null?tf=[E]:tf.push(E),Wn!==4&&(Wn=2),l===null)return!0;p=os(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,o=S&-S,d.lanes|=o,o=vv(d.stateNode,p,o),Yx(d,o),!1;case 1:if(l=d.type,E=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Oi===null||!Oi.has(E))))return d.flags|=65536,S&=-S,d.lanes|=S,S=DE(S),OE(S,o,d,p),Yx(d,S),!1}d=d.return}while(d!==null);return!1}var bv=Error(r(461)),cr=!1;function Lr(o,l,d,p){l.child=o===null?Lw(l,null,d,p):ql(l,o.child,d,p)}function IE(o,l,d,p,S){d=d.render;var E=l.ref;if("ref"in p){var N={};for(var L in p)L!=="ref"&&(N[L]=p[L])}else N=p;return $l(l),p=tv(o,l,d,N,E,S),L=nv(),o!==null&&!cr?(rv(o,l,S),Lo(o,l,S)):(Kt&&L&&Lx(l),l.flags|=1,Lr(o,l,p,S),l.child)}function ME(o,l,d,p,S){if(o===null){var E=d.type;return typeof E=="function"&&!Ix(E)&&E.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=E,kE(o,l,E,p,S)):(o=um(d.type,null,p,l,l.mode,S),o.ref=l.ref,o.return=l,l.child=o)}if(E=o.child,!_v(o,S)){var N=E.memoizedProps;if(d=d.compare,d=d!==null?d:Id,d(N,p)&&o.ref===l.ref)return Lo(o,l,S)}return l.flags|=1,o=Ao(E,p),o.ref=l.ref,o.return=l,l.child=o}function kE(o,l,d,p,S){if(o!==null){var E=o.memoizedProps;if(Id(E,p)&&o.ref===l.ref)if(cr=!1,l.pendingProps=p=E,_v(o,S))(o.flags&131072)!==0&&(cr=!0);else return l.lanes=o.lanes,Lo(o,l,S)}return Sv(o,l,d,p,S)}function LE(o,l,d,p){var S=p.children,E=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((l.flags&128)!==0){if(E=E!==null?E.baseLanes|d:d,o!==null){for(p=l.child=o.child,S=0;p!==null;)S=S|p.lanes|p.childLanes,p=p.sibling;p=S&~E}else p=0,l.child=null;return PE(o,l,E,d,p)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&mm(l,E!==null?E.cachePool:null),E!==null?zw(l,E):Xx(),Fw(l);else return p=l.lanes=536870912,PE(o,l,E!==null?E.baseLanes|d:d,d,p)}else E!==null?(mm(l,E.cachePool),zw(l,E),_i(),l.memoizedState=null):(o!==null&&mm(l,null),Xx(),_i());return Lr(o,l,S,d),l.child}function Zd(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function PE(o,l,d,p,S){var E=Bx();return E=E===null?null:{parent:ir._currentValue,pool:E},l.memoizedState={baseLanes:d,cachePool:E},o!==null&&mm(l,null),Xx(),Fw(l),o!==null&&Wc(o,l,p,!0),l.childLanes=S,null}function Am(o,l){return l=Om({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function UE(o,l,d){return ql(l,o.child,null,d),o=Am(l,l.pendingProps),o.flags|=2,Ua(l),l.memoizedState=null,o}function Tk(o,l,d){var p=l.pendingProps,S=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(Kt){if(p.mode==="hidden")return o=Am(l,p),l.lanes=536870912,Zd(null,o);if(Jx(l),(o=Pn)?(o=WR(o,cs),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:bi!==null?{id:Xs,overflow:Qs}:null,retryLane:536870912,hydrationErrors:null},d=Sw(o),d.return=l,l.child=d,Mr=l,Pn=null)):o=null,o===null)throw Ci(l);return l.lanes=536870912,null}return Am(l,p)}var E=o.memoizedState;if(E!==null){var N=E.dehydrated;if(Jx(l),S)if(l.flags&256)l.flags&=-257,l=UE(o,l,d);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(cr||Wc(o,l,d,!1),S=(d&o.childLanes)!==0,cr||S){if(p=Dn,p!==null&&(N=ee(p,d),N!==0&&N!==E.retryLane))throw E.retryLane=N,Ul(o,N),Sa(p,o,N),bv;Hm(),l=UE(o,l,d)}else o=E.treeContext,Pn=ds(N.nextSibling),Mr=l,Kt=!0,Si=null,cs=!1,o!==null&&Ew(l,o),l=Am(l,p),l.flags|=4096;return l}return o=Ao(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Dm(o,l){var d=l.ref;if(d===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(o===null||o.ref!==d)&&(l.flags|=4194816)}}function Sv(o,l,d,p,S){return $l(l),d=tv(o,l,d,p,void 0,S),p=nv(),o!==null&&!cr?(rv(o,l,S),Lo(o,l,S)):(Kt&&p&&Lx(l),l.flags|=1,Lr(o,l,d,S),l.child)}function zE(o,l,d,p,S,E){return $l(l),l.updateQueue=null,d=$w(l,p,d,S),Hw(o),p=nv(),o!==null&&!cr?(rv(o,l,E),Lo(o,l,E)):(Kt&&p&&Lx(l),l.flags|=1,Lr(o,l,d,E),l.child)}function FE(o,l,d,p,S){if($l(l),l.stateNode===null){var E=qc,N=d.contextType;typeof N=="object"&&N!==null&&(E=kr(N)),E=new d(p,E),l.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=xv,l.stateNode=E,E._reactInternals=l,E=l.stateNode,E.props=p,E.state=l.memoizedState,E.refs={},Kx(l),N=d.contextType,E.context=typeof N=="object"&&N!==null?kr(N):qc,E.state=l.memoizedState,N=d.getDerivedStateFromProps,typeof N=="function"&&(yv(l,d,N,p),E.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(N=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),N!==E.state&&xv.enqueueReplaceState(E,E.state,null),Vd(l,p,E,S),$d(),E.state=l.memoizedState),typeof E.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){E=l.stateNode;var L=l.memoizedProps,X=Zl(d,L);E.props=X;var de=E.context,xe=d.contextType;N=qc,typeof xe=="object"&&xe!==null&&(N=kr(xe));var be=d.getDerivedStateFromProps;xe=typeof be=="function"||typeof E.getSnapshotBeforeUpdate=="function",L=l.pendingProps!==L,xe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L||de!==N)&&jE(l,E,p,N),Ei=!1;var he=l.memoizedState;E.state=he,Vd(l,p,E,S),$d(),de=l.memoizedState,L||he!==de||Ei?(typeof be=="function"&&(yv(l,d,be,p),de=l.memoizedState),(X=Ei||RE(l,d,X,p,he,de,N))?(xe||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(l.flags|=4194308)):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=de),E.props=p,E.state=de,E.context=N,p=X):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{E=l.stateNode,Zx(o,l),N=l.memoizedProps,xe=Zl(d,N),E.props=xe,be=l.pendingProps,he=E.context,de=d.contextType,X=qc,typeof de=="object"&&de!==null&&(X=kr(de)),L=d.getDerivedStateFromProps,(de=typeof L=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(N!==be||he!==X)&&jE(l,E,p,X),Ei=!1,he=l.memoizedState,E.state=he,Vd(l,p,E,S),$d();var pe=l.memoizedState;N!==be||he!==pe||Ei||o!==null&&o.dependencies!==null&&fm(o.dependencies)?(typeof L=="function"&&(yv(l,d,L,p),pe=l.memoizedState),(xe=Ei||RE(l,d,xe,p,he,pe,X)||o!==null&&o.dependencies!==null&&fm(o.dependencies))?(de||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(p,pe,X),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(p,pe,X)),typeof E.componentDidUpdate=="function"&&(l.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof E.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=pe),E.props=p,E.state=pe,E.context=X,p=xe):(typeof E.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),p=!1)}return E=p,Dm(o,l),p=(l.flags&128)!==0,E||p?(E=l.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:E.render(),l.flags|=1,o!==null&&p?(l.child=ql(l,o.child,null,S),l.child=ql(l,null,d,S)):Lr(o,l,d,S),l.memoizedState=E.state,o=l.child):o=Lo(o,l,S),o}function HE(o,l,d,p){return Fl(),l.flags|=256,Lr(o,l,d,p),l.child}var Cv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wv(o){return{baseLanes:o,cachePool:Aw()}}function Ev(o,l,d){return o=o!==null?o.childLanes&~d:0,l&&(o|=Fa),o}function $E(o,l,d){var p=l.pendingProps,S=!1,E=(l.flags&128)!==0,N;if((N=E)||(N=o!==null&&o.memoizedState===null?!1:(nr.current&2)!==0),N&&(S=!0,l.flags&=-129),N=(l.flags&32)!==0,l.flags&=-33,o===null){if(Kt){if(S?Ti(l):_i(),(o=Pn)?(o=WR(o,cs),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:bi!==null?{id:Xs,overflow:Qs}:null,retryLane:536870912,hydrationErrors:null},d=Sw(o),d.return=l,l.child=d,Mr=l,Pn=null)):o=null,o===null)throw Ci(l);return o0(o)?l.lanes=32:l.lanes=536870912,null}var L=p.children;return p=p.fallback,S?(_i(),S=l.mode,L=Om({mode:"hidden",children:L},S),p=zl(p,S,d,null),L.return=l,p.return=l,L.sibling=p,l.child=L,p=l.child,p.memoizedState=wv(d),p.childLanes=Ev(o,N,d),l.memoizedState=Cv,Zd(null,p)):(Ti(l),Rv(l,L))}var X=o.memoizedState;if(X!==null&&(L=X.dehydrated,L!==null)){if(E)l.flags&256?(Ti(l),l.flags&=-257,l=jv(o,l,d)):l.memoizedState!==null?(_i(),l.child=o.child,l.flags|=128,l=null):(_i(),L=p.fallback,S=l.mode,p=Om({mode:"visible",children:p.children},S),L=zl(L,S,d,null),L.flags|=2,p.return=l,L.return=l,p.sibling=L,l.child=p,ql(l,o.child,null,d),p=l.child,p.memoizedState=wv(d),p.childLanes=Ev(o,N,d),l.memoizedState=Cv,l=Zd(null,p));else if(Ti(l),o0(L)){if(N=L.nextSibling&&L.nextSibling.dataset,N)var de=N.dgst;N=de,p=Error(r(419)),p.stack="",p.digest=N,Ld({value:p,source:null,stack:null}),l=jv(o,l,d)}else if(cr||Wc(o,l,d,!1),N=(d&o.childLanes)!==0,cr||N){if(N=Dn,N!==null&&(p=ee(N,d),p!==0&&p!==X.retryLane))throw X.retryLane=p,Ul(o,p),Sa(N,o,p),bv;s0(L)||Hm(),l=jv(o,l,d)}else s0(L)?(l.flags|=192,l.child=o.child,l=null):(o=X.treeContext,Pn=ds(L.nextSibling),Mr=l,Kt=!0,Si=null,cs=!1,o!==null&&Ew(l,o),l=Rv(l,p.children),l.flags|=4096);return l}return S?(_i(),L=p.fallback,S=l.mode,X=o.child,de=X.sibling,p=Ao(X,{mode:"hidden",children:p.children}),p.subtreeFlags=X.subtreeFlags&65011712,de!==null?L=Ao(de,L):(L=zl(L,S,d,null),L.flags|=2),L.return=l,p.return=l,p.sibling=L,l.child=p,Zd(null,p),p=l.child,L=o.child.memoizedState,L===null?L=wv(d):(S=L.cachePool,S!==null?(X=ir._currentValue,S=S.parent!==X?{parent:X,pool:X}:S):S=Aw(),L={baseLanes:L.baseLanes|d,cachePool:S}),p.memoizedState=L,p.childLanes=Ev(o,N,d),l.memoizedState=Cv,Zd(o.child,p)):(Ti(l),d=o.child,o=d.sibling,d=Ao(d,{mode:"visible",children:p.children}),d.return=l,d.sibling=null,o!==null&&(N=l.deletions,N===null?(l.deletions=[o],l.flags|=16):N.push(o)),l.child=d,l.memoizedState=null,d)}function Rv(o,l){return l=Om({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Om(o,l){return o=La(22,o,null,l),o.lanes=0,o}function jv(o,l,d){return ql(l,o.child,null,d),o=Rv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function VE(o,l,d){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),Hx(o.return,l,d)}function Tv(o,l,d,p,S,E){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:S,treeForkCount:E}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=d,N.tailMode=S,N.treeForkCount=E)}function GE(o,l,d){var p=l.pendingProps,S=p.revealOrder,E=p.tail;p=p.children;var N=nr.current,L=(N&2)!==0;if(L?(N=N&1|2,l.flags|=128):N&=1,F(nr,N),Lr(o,l,p,d),p=Kt?kd:0,!L&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&VE(o,d,l);else if(o.tag===19)VE(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(S){case"forwards":for(d=l.child,S=null;d!==null;)o=d.alternate,o!==null&&bm(o)===null&&(S=d),d=d.sibling;d=S,d===null?(S=l.child,l.child=null):(S=d.sibling,d.sibling=null),Tv(l,!1,S,d,E,p);break;case"backwards":case"unstable_legacy-backwards":for(d=null,S=l.child,l.child=null;S!==null;){if(o=S.alternate,o!==null&&bm(o)===null){l.child=S;break}o=S.sibling,S.sibling=d,d=S,S=o}Tv(l,!0,d,null,E,p);break;case"together":Tv(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function Lo(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Di|=l.lanes,(d&l.childLanes)===0)if(o!==null){if(Wc(o,l,d,!1),(d&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,d=Ao(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Ao(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function _v(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&fm(o)))}function _k(o,l,d){switch(l.tag){case 3:ie(l,l.stateNode.containerInfo),wi(l,ir,o.memoizedState.cache),Fl();break;case 27:case 5:Ce(l);break;case 4:ie(l,l.stateNode.containerInfo);break;case 10:wi(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Jx(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(Ti(l),l.flags|=128,null):(d&l.child.childLanes)!==0?$E(o,l,d):(Ti(l),o=Lo(o,l,d),o!==null?o.sibling:null);Ti(l);break;case 19:var S=(o.flags&128)!==0;if(p=(d&l.childLanes)!==0,p||(Wc(o,l,d,!1),p=(d&l.childLanes)!==0),S){if(p)return GE(o,l,d);l.flags|=128}if(S=l.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),F(nr,nr.current),p)break;return null;case 22:return l.lanes=0,LE(o,l,d,l.pendingProps);case 24:wi(l,ir,o.memoizedState.cache)}return Lo(o,l,d)}function BE(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps)cr=!0;else{if(!_v(o,d)&&(l.flags&128)===0)return cr=!1,_k(o,l,d);cr=(o.flags&131072)!==0}else cr=!1,Kt&&(l.flags&1048576)!==0&&ww(l,kd,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=Gl(l.elementType),l.type=o,typeof o=="function")Ix(o)?(p=Zl(o,p),l.tag=1,l=FE(null,l,o,p,d)):(l.tag=0,l=Sv(null,l,o,p,d));else{if(o!=null){var S=o.$$typeof;if(S===D){l.tag=11,l=IE(null,l,o,p,d);break e}else if(S===T){l.tag=14,l=ME(null,l,o,p,d);break e}}throw l=q(o)||o,Error(r(306,l,""))}}return l;case 0:return Sv(o,l,l.type,l.pendingProps,d);case 1:return p=l.type,S=Zl(p,l.pendingProps),FE(o,l,p,S,d);case 3:e:{if(ie(l,l.stateNode.containerInfo),o===null)throw Error(r(387));p=l.pendingProps;var E=l.memoizedState;S=E.element,Zx(o,l),Vd(l,p,null,d);var N=l.memoizedState;if(p=N.cache,wi(l,ir,p),p!==E.cache&&$x(l,[ir],d,!0),$d(),p=N.element,E.isDehydrated)if(E={element:p,isDehydrated:!1,cache:N.cache},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){l=HE(o,l,p,d);break e}else if(p!==S){S=os(Error(r(424)),l),Ld(S),l=HE(o,l,p,d);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Pn=ds(o.firstChild),Mr=l,Kt=!0,Si=null,cs=!0,d=Lw(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Fl(),p===S){l=Lo(o,l,d);break e}Lr(o,l,p,d)}l=l.child}return l;case 26:return Dm(o,l),o===null?(d=nj(l.type,null,l.pendingProps,null))?l.memoizedState=d:Kt||(d=l.type,o=l.pendingProps,p=Zm(le.current).createElement(d),p[Le]=l,p[ze]=o,Pr(p,d,o),An(p),l.stateNode=p):l.memoizedState=nj(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return Ce(l),o===null&&Kt&&(p=l.stateNode=JR(l.type,l.pendingProps,le.current),Mr=l,cs=!0,S=Pn,Li(l.type)?(i0=S,Pn=ds(p.firstChild)):Pn=S),Lr(o,l,l.pendingProps.children,d),Dm(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&Kt&&((S=p=Pn)&&(p=a9(p,l.type,l.pendingProps,cs),p!==null?(l.stateNode=p,Mr=l,Pn=ds(p.firstChild),cs=!1,S=!0):S=!1),S||Ci(l)),Ce(l),S=l.type,E=l.pendingProps,N=o!==null?o.memoizedProps:null,p=E.children,n0(S,E)?p=null:N!==null&&n0(S,N)&&(l.flags|=32),l.memoizedState!==null&&(S=tv(o,l,vk,null,null,d),uf._currentValue=S),Dm(o,l),Lr(o,l,p,d),l.child;case 6:return o===null&&Kt&&((o=d=Pn)&&(d=s9(d,l.pendingProps,cs),d!==null?(l.stateNode=d,Mr=l,Pn=null,o=!0):o=!1),o||Ci(l)),null;case 13:return $E(o,l,d);case 4:return ie(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=ql(l,null,p,d):Lr(o,l,p,d),l.child;case 11:return IE(o,l,l.type,l.pendingProps,d);case 7:return Lr(o,l,l.pendingProps,d),l.child;case 8:return Lr(o,l,l.pendingProps.children,d),l.child;case 12:return Lr(o,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,wi(l,l.type,p.value),Lr(o,l,p.children,d),l.child;case 9:return S=l.type._context,p=l.pendingProps.children,$l(l),S=kr(S),p=p(S),l.flags|=1,Lr(o,l,p,d),l.child;case 14:return ME(o,l,l.type,l.pendingProps,d);case 15:return kE(o,l,l.type,l.pendingProps,d);case 19:return GE(o,l,d);case 31:return Tk(o,l,d);case 22:return LE(o,l,d,l.pendingProps);case 24:return $l(l),p=kr(ir),o===null?(S=Bx(),S===null&&(S=Dn,E=Vx(),S.pooledCache=E,E.refCount++,E!==null&&(S.pooledCacheLanes|=d),S=E),l.memoizedState={parent:p,cache:S},Kx(l),wi(l,ir,S)):((o.lanes&d)!==0&&(Zx(o,l),Vd(l,null,null,d),$d()),S=o.memoizedState,E=l.memoizedState,S.parent!==p?(S={parent:p,cache:p},l.memoizedState=S,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=S),wi(l,ir,p)):(p=E.cache,wi(l,ir,p),p!==S.cache&&$x(l,[ir],d,!0))),Lr(o,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Po(o){o.flags|=4}function Nv(o,l,d,p,S){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(S&335544128)===S)if(o.stateNode.complete)o.flags|=8192;else if(xR())o.flags|=8192;else throw Bl=gm,qx}else o.flags&=-16777217}function qE(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!ij(l))if(xR())o.flags|=8192;else throw Bl=gm,qx}function Im(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?qt():536870912,o.lanes|=l,lu|=l)}function Yd(o,l){if(!Kt)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null}}function Un(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,p=0;if(l)for(var S=o.child;S!==null;)d|=S.lanes|S.childLanes,p|=S.subtreeFlags&65011712,p|=S.flags&65011712,S.return=o,S=S.sibling;else for(S=o.child;S!==null;)d|=S.lanes|S.childLanes,p|=S.subtreeFlags,p|=S.flags,S.return=o,S=S.sibling;return o.subtreeFlags|=p,o.childLanes=d,l}function Nk(o,l,d){var p=l.pendingProps;switch(Px(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Un(l),null;case 1:return Un(l),null;case 3:return d=l.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),Io(ir),ye(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(Yc(l)?Po(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,zx())),Un(l),null;case 26:var S=l.type,E=l.memoizedState;return o===null?(Po(l),E!==null?(Un(l),qE(l,E)):(Un(l),Nv(l,S,null,p,d))):E?E!==o.memoizedState?(Po(l),Un(l),qE(l,E)):(Un(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&Po(l),Un(l),Nv(l,S,o,p,d)),null;case 27:if(He(l),d=le.current,S=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&Po(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Un(l),null}o=Z.current,Yc(l)?Rw(l):(o=JR(S,p,d),l.stateNode=o,Po(l))}return Un(l),null;case 5:if(He(l),S=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&Po(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Un(l),null}if(E=Z.current,Yc(l))Rw(l);else{var N=Zm(le.current);switch(E){case 1:E=N.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:E=N.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":E=N.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":E=N.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":E=N.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?E.multiple=!0:p.size&&(E.size=p.size);break;default:E=typeof p.is=="string"?N.createElement(S,{is:p.is}):N.createElement(S)}}E[Le]=l,E[ze]=p;e:for(N=l.child;N!==null;){if(N.tag===5||N.tag===6)E.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===l)break e;for(;N.sibling===null;){if(N.return===null||N.return===l)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}l.stateNode=E;e:switch(Pr(E,S,p),S){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Po(l)}}return Un(l),Nv(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,d),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&Po(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(o=le.current,Yc(l)){if(o=l.stateNode,d=l.memoizedProps,p=null,S=Mr,S!==null)switch(S.tag){case 27:case 5:p=S.memoizedProps}o[Le]=l,o=!!(o.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||$R(o.nodeValue,d)),o||Ci(l,!0)}else o=Zm(o).createTextNode(p),o[Le]=l,l.stateNode=o}return Un(l),null;case 31:if(d=l.memoizedState,o===null||o.memoizedState!==null){if(p=Yc(l),d!==null){if(o===null){if(!p)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Le]=l}else Fl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),o=!1}else d=zx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return l.flags&256?(Ua(l),l):(Ua(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Un(l),null;case 13:if(p=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(S=Yc(l),p!==null&&p.dehydrated!==null){if(o===null){if(!S)throw Error(r(318));if(S=l.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Le]=l}else Fl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),S=!1}else S=zx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=S),S=!0;if(!S)return l.flags&256?(Ua(l),l):(Ua(l),null)}return Ua(l),(l.flags&128)!==0?(l.lanes=d,l):(d=p!==null,o=o!==null&&o.memoizedState!==null,d&&(p=l.child,S=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(S=p.alternate.memoizedState.cachePool.pool),E=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(E=p.memoizedState.cachePool.pool),E!==S&&(p.flags|=2048)),d!==o&&d&&(l.child.flags|=8192),Im(l,l.updateQueue),Un(l),null);case 4:return ye(),o===null&&Xv(l.stateNode.containerInfo),Un(l),null;case 10:return Io(l.type),Un(l),null;case 19:if(z(nr),p=l.memoizedState,p===null)return Un(l),null;if(S=(l.flags&128)!==0,E=p.rendering,E===null)if(S)Yd(p,!1);else{if(Wn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(E=bm(o),E!==null){for(l.flags|=128,Yd(p,!1),o=E.updateQueue,l.updateQueue=o,Im(l,o),l.subtreeFlags=0,o=d,d=l.child;d!==null;)bw(d,o),d=d.sibling;return F(nr,nr.current&1|2),Kt&&Do(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&Re()>Um&&(l.flags|=128,S=!0,Yd(p,!1),l.lanes=4194304)}else{if(!S)if(o=bm(E),o!==null){if(l.flags|=128,S=!0,o=o.updateQueue,l.updateQueue=o,Im(l,o),Yd(p,!0),p.tail===null&&p.tailMode==="hidden"&&!E.alternate&&!Kt)return Un(l),null}else 2*Re()-p.renderingStartTime>Um&&d!==536870912&&(l.flags|=128,S=!0,Yd(p,!1),l.lanes=4194304);p.isBackwards?(E.sibling=l.child,l.child=E):(o=p.last,o!==null?o.sibling=E:l.child=E,p.last=E)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Re(),o.sibling=null,d=nr.current,F(nr,S?d&1|2:d&1),Kt&&Do(l,p.treeForkCount),o):(Un(l),null);case 22:case 23:return Ua(l),Qx(),p=l.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(d&536870912)!==0&&(l.flags&128)===0&&(Un(l),l.subtreeFlags&6&&(l.flags|=8192)):Un(l),d=l.updateQueue,d!==null&&Im(l,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048),o!==null&&z(Vl),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Io(ir),Un(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function Ak(o,l){switch(Px(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Io(ir),ye(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return He(l),null;case 31:if(l.memoizedState!==null){if(Ua(l),l.alternate===null)throw Error(r(340));Fl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Ua(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Fl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return z(nr),null;case 4:return ye(),null;case 10:return Io(l.type),null;case 22:case 23:return Ua(l),Qx(),o!==null&&z(Vl),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Io(ir),null;case 25:return null;default:return null}}function KE(o,l){switch(Px(l),l.tag){case 3:Io(ir),ye();break;case 26:case 27:case 5:He(l);break;case 4:ye();break;case 31:l.memoizedState!==null&&Ua(l);break;case 13:Ua(l);break;case 19:z(nr);break;case 10:Io(l.type);break;case 22:case 23:Ua(l),Qx(),o!==null&&z(Vl);break;case 24:Io(ir)}}function Wd(o,l){try{var d=l.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var S=p.next;d=S;do{if((d.tag&o)===o){p=void 0;var E=d.create,N=d.inst;p=E(),N.destroy=p}d=d.next}while(d!==S)}}catch(L){bn(l,l.return,L)}}function Ni(o,l,d){try{var p=l.updateQueue,S=p!==null?p.lastEffect:null;if(S!==null){var E=S.next;p=E;do{if((p.tag&o)===o){var N=p.inst,L=N.destroy;if(L!==void 0){N.destroy=void 0,S=l;var X=d,de=L;try{de()}catch(xe){bn(S,X,xe)}}}p=p.next}while(p!==E)}}catch(xe){bn(l,l.return,xe)}}function ZE(o){var l=o.updateQueue;if(l!==null){var d=o.stateNode;try{Uw(l,d)}catch(p){bn(o,o.return,p)}}}function YE(o,l,d){d.props=Zl(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(p){bn(o,l,p)}}function Xd(o,l){try{var d=o.ref;if(d!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:p=o.stateNode;break;default:p=o.stateNode}typeof d=="function"?o.refCleanup=d(p):d.current=p}}catch(S){bn(o,l,S)}}function Js(o,l){var d=o.ref,p=o.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(S){bn(o,l,S)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(S){bn(o,l,S)}else d.current=null}function WE(o){var l=o.type,d=o.memoizedProps,p=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&p.focus();break e;case"img":d.src?p.src=d.src:d.srcSet&&(p.srcset=d.srcSet)}}catch(S){bn(o,o.return,S)}}function Av(o,l,d){try{var p=o.stateNode;Qk(p,o.type,d,l),p[ze]=l}catch(S){bn(o,o.return,S)}}function XE(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Li(o.type)||o.tag===4}function Dv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||XE(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Li(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Ov(o,l,d){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(o,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(o),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=_o));else if(p!==4&&(p===27&&Li(o.type)&&(d=o.stateNode,l=null),o=o.child,o!==null))for(Ov(o,l,d),o=o.sibling;o!==null;)Ov(o,l,d),o=o.sibling}function Mm(o,l,d){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(p!==4&&(p===27&&Li(o.type)&&(d=o.stateNode),o=o.child,o!==null))for(Mm(o,l,d),o=o.sibling;o!==null;)Mm(o,l,d),o=o.sibling}function QE(o){var l=o.stateNode,d=o.memoizedProps;try{for(var p=o.type,S=l.attributes;S.length;)l.removeAttributeNode(S[0]);Pr(l,p,d),l[Le]=o,l[ze]=d}catch(E){bn(o,o.return,E)}}var Uo=!1,ur=!1,Iv=!1,JE=typeof WeakSet=="function"?WeakSet:Set,Tr=null;function Dk(o,l){if(o=o.containerInfo,e0=tp,o=dw(o),jx(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var S=p.anchorOffset,E=p.focusNode;p=p.focusOffset;try{d.nodeType,E.nodeType}catch{d=null;break e}var N=0,L=-1,X=-1,de=0,xe=0,be=o,he=null;t:for(;;){for(var pe;be!==d||S!==0&&be.nodeType!==3||(L=N+S),be!==E||p!==0&&be.nodeType!==3||(X=N+p),be.nodeType===3&&(N+=be.nodeValue.length),(pe=be.firstChild)!==null;)he=be,be=pe;for(;;){if(be===o)break t;if(he===d&&++de===S&&(L=N),he===E&&++xe===p&&(X=N),(pe=be.nextSibling)!==null)break;be=he,he=be.parentNode}be=pe}d=L===-1||X===-1?null:{start:L,end:X}}else d=null}d=d||{start:0,end:0}}else d=null;for(t0={focusedElem:o,selectionRange:d},tp=!1,Tr=l;Tr!==null;)if(l=Tr,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Tr=o;else for(;Tr!==null;){switch(l=Tr,E=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(d=0;d<o.length;d++)S=o[d],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&E!==null){o=void 0,d=l,S=E.memoizedProps,E=E.memoizedState,p=d.stateNode;try{var qe=Zl(d.type,S);o=p.getSnapshotBeforeUpdate(qe,E),p.__reactInternalSnapshotBeforeUpdate=o}catch(ot){bn(d,d.return,ot)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,d=o.nodeType,d===9)a0(o);else if(d===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":a0(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Tr=o;break}Tr=l.return}}function eR(o,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:Fo(o,d),p&4&&Wd(5,d);break;case 1:if(Fo(o,d),p&4)if(o=d.stateNode,l===null)try{o.componentDidMount()}catch(N){bn(d,d.return,N)}else{var S=Zl(d.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(S,l,o.__reactInternalSnapshotBeforeUpdate)}catch(N){bn(d,d.return,N)}}p&64&&ZE(d),p&512&&Xd(d,d.return);break;case 3:if(Fo(o,d),p&64&&(o=d.updateQueue,o!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=d.child.stateNode;break;case 1:l=d.child.stateNode}try{Uw(o,l)}catch(N){bn(d,d.return,N)}}break;case 27:l===null&&p&4&&QE(d);case 26:case 5:Fo(o,d),l===null&&p&4&&WE(d),p&512&&Xd(d,d.return);break;case 12:Fo(o,d);break;case 31:Fo(o,d),p&4&&rR(o,d);break;case 13:Fo(o,d),p&4&&aR(o,d),p&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=Fk.bind(null,d),o9(o,d))));break;case 22:if(p=d.memoizedState!==null||Uo,!p){l=l!==null&&l.memoizedState!==null||ur,S=Uo;var E=ur;Uo=p,(ur=l)&&!E?Ho(o,d,(d.subtreeFlags&8772)!==0):Fo(o,d),Uo=S,ur=E}break;case 30:break;default:Fo(o,d)}}function tR(o){var l=o.alternate;l!==null&&(o.alternate=null,tR(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Zn(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Gn=null,ya=!1;function zo(o,l,d){for(d=d.child;d!==null;)nR(o,l,d),d=d.sibling}function nR(o,l,d){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(Jr,d)}catch{}switch(d.tag){case 26:ur||Js(d,l),zo(o,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:ur||Js(d,l);var p=Gn,S=ya;Li(d.type)&&(Gn=d.stateNode,ya=!1),zo(o,l,d),of(d.stateNode),Gn=p,ya=S;break;case 5:ur||Js(d,l);case 6:if(p=Gn,S=ya,Gn=null,zo(o,l,d),Gn=p,ya=S,Gn!==null)if(ya)try{(Gn.nodeType===9?Gn.body:Gn.nodeName==="HTML"?Gn.ownerDocument.body:Gn).removeChild(d.stateNode)}catch(E){bn(d,l,E)}else try{Gn.removeChild(d.stateNode)}catch(E){bn(d,l,E)}break;case 18:Gn!==null&&(ya?(o=Gn,ZR(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),gu(o)):ZR(Gn,d.stateNode));break;case 4:p=Gn,S=ya,Gn=d.stateNode.containerInfo,ya=!0,zo(o,l,d),Gn=p,ya=S;break;case 0:case 11:case 14:case 15:Ni(2,d,l),ur||Ni(4,d,l),zo(o,l,d);break;case 1:ur||(Js(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&YE(d,l,p)),zo(o,l,d);break;case 21:zo(o,l,d);break;case 22:ur=(p=ur)||d.memoizedState!==null,zo(o,l,d),ur=p;break;default:zo(o,l,d)}}function rR(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{gu(o)}catch(d){bn(l,l.return,d)}}}function aR(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{gu(o)}catch(d){bn(l,l.return,d)}}function Ok(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new JE),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new JE),l;default:throw Error(r(435,o.tag))}}function km(o,l){var d=Ok(o);l.forEach(function(p){if(!d.has(p)){d.add(p);var S=Hk.bind(null,o,p);p.then(S,S)}})}function xa(o,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var S=d[p],E=o,N=l,L=N;e:for(;L!==null;){switch(L.tag){case 27:if(Li(L.type)){Gn=L.stateNode,ya=!1;break e}break;case 5:Gn=L.stateNode,ya=!1;break e;case 3:case 4:Gn=L.stateNode.containerInfo,ya=!0;break e}L=L.return}if(Gn===null)throw Error(r(160));nR(E,N,S),Gn=null,ya=!1,E=S.alternate,E!==null&&(E.return=null),S.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)sR(l,o),l=l.sibling}var Ts=null;function sR(o,l){var d=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:xa(l,o),va(o),p&4&&(Ni(3,o,o.return),Wd(3,o),Ni(5,o,o.return));break;case 1:xa(l,o),va(o),p&512&&(ur||d===null||Js(d,d.return)),p&64&&Uo&&(o=o.updateQueue,o!==null&&(p=o.callbacks,p!==null&&(d=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=d===null?p:d.concat(p))));break;case 26:var S=Ts;if(xa(l,o),va(o),p&512&&(ur||d===null||Js(d,d.return)),p&4){var E=d!==null?d.memoizedState:null;if(p=o.memoizedState,d===null)if(p===null)if(o.stateNode===null){e:{p=o.type,d=o.memoizedProps,S=S.ownerDocument||S;t:switch(p){case"title":E=S.getElementsByTagName("title")[0],(!E||E[Ln]||E[Le]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=S.createElement(p),S.head.insertBefore(E,S.querySelector("head > title"))),Pr(E,p,d),E[Le]=o,An(E),p=E;break e;case"link":var N=sj("link","href",S).get(p+(d.href||""));if(N){for(var L=0;L<N.length;L++)if(E=N[L],E.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&E.getAttribute("rel")===(d.rel==null?null:d.rel)&&E.getAttribute("title")===(d.title==null?null:d.title)&&E.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){N.splice(L,1);break t}}E=S.createElement(p),Pr(E,p,d),S.head.appendChild(E);break;case"meta":if(N=sj("meta","content",S).get(p+(d.content||""))){for(L=0;L<N.length;L++)if(E=N[L],E.getAttribute("content")===(d.content==null?null:""+d.content)&&E.getAttribute("name")===(d.name==null?null:d.name)&&E.getAttribute("property")===(d.property==null?null:d.property)&&E.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&E.getAttribute("charset")===(d.charSet==null?null:d.charSet)){N.splice(L,1);break t}}E=S.createElement(p),Pr(E,p,d),S.head.appendChild(E);break;default:throw Error(r(468,p))}E[Le]=o,An(E),p=E}o.stateNode=p}else oj(S,o.type,o.stateNode);else o.stateNode=aj(S,p,o.memoizedProps);else E!==p?(E===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):E.count--,p===null?oj(S,o.type,o.stateNode):aj(S,p,o.memoizedProps)):p===null&&o.stateNode!==null&&Av(o,o.memoizedProps,d.memoizedProps)}break;case 27:xa(l,o),va(o),p&512&&(ur||d===null||Js(d,d.return)),d!==null&&p&4&&Av(o,o.memoizedProps,d.memoizedProps);break;case 5:if(xa(l,o),va(o),p&512&&(ur||d===null||Js(d,d.return)),o.flags&32){S=o.stateNode;try{zc(S,"")}catch(qe){bn(o,o.return,qe)}}p&4&&o.stateNode!=null&&(S=o.memoizedProps,Av(o,S,d!==null?d.memoizedProps:S)),p&1024&&(Iv=!0);break;case 6:if(xa(l,o),va(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,d=o.stateNode;try{d.nodeValue=p}catch(qe){bn(o,o.return,qe)}}break;case 3:if(Xm=null,S=Ts,Ts=Ym(l.containerInfo),xa(l,o),Ts=S,va(o),p&4&&d!==null&&d.memoizedState.isDehydrated)try{gu(l.containerInfo)}catch(qe){bn(o,o.return,qe)}Iv&&(Iv=!1,oR(o));break;case 4:p=Ts,Ts=Ym(o.stateNode.containerInfo),xa(l,o),va(o),Ts=p;break;case 12:xa(l,o),va(o);break;case 31:xa(l,o),va(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,km(o,p)));break;case 13:xa(l,o),va(o),o.child.flags&8192&&o.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Pm=Re()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,km(o,p)));break;case 22:S=o.memoizedState!==null;var X=d!==null&&d.memoizedState!==null,de=Uo,xe=ur;if(Uo=de||S,ur=xe||X,xa(l,o),ur=xe,Uo=de,va(o),p&8192)e:for(l=o.stateNode,l._visibility=S?l._visibility&-2:l._visibility|1,S&&(d===null||X||Uo||ur||Yl(o)),d=null,l=o;;){if(l.tag===5||l.tag===26){if(d===null){X=d=l;try{if(E=X.stateNode,S)N=E.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{L=X.stateNode;var be=X.memoizedProps.style,he=be!=null&&be.hasOwnProperty("display")?be.display:null;L.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(qe){bn(X,X.return,qe)}}}else if(l.tag===6){if(d===null){X=l;try{X.stateNode.nodeValue=S?"":X.memoizedProps}catch(qe){bn(X,X.return,qe)}}}else if(l.tag===18){if(d===null){X=l;try{var pe=X.stateNode;S?YR(pe,!0):YR(X.stateNode,!1)}catch(qe){bn(X,X.return,qe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=o.updateQueue,p!==null&&(d=p.retryQueue,d!==null&&(p.retryQueue=null,km(o,d))));break;case 19:xa(l,o),va(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,km(o,p)));break;case 30:break;case 21:break;default:xa(l,o),va(o)}}function va(o){var l=o.flags;if(l&2){try{for(var d,p=o.return;p!==null;){if(XE(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var S=d.stateNode,E=Dv(o);Mm(o,E,S);break;case 5:var N=d.stateNode;d.flags&32&&(zc(N,""),d.flags&=-33);var L=Dv(o);Mm(o,L,N);break;case 3:case 4:var X=d.stateNode.containerInfo,de=Dv(o);Ov(o,de,X);break;default:throw Error(r(161))}}catch(xe){bn(o,o.return,xe)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function oR(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;oR(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Fo(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)eR(o,l.alternate,l),l=l.sibling}function Yl(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Ni(4,l,l.return),Yl(l);break;case 1:Js(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&YE(l,l.return,d),Yl(l);break;case 27:of(l.stateNode);case 26:case 5:Js(l,l.return),Yl(l);break;case 22:l.memoizedState===null&&Yl(l);break;case 30:Yl(l);break;default:Yl(l)}o=o.sibling}}function Ho(o,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,S=o,E=l,N=E.flags;switch(E.tag){case 0:case 11:case 15:Ho(S,E,d),Wd(4,E);break;case 1:if(Ho(S,E,d),p=E,S=p.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(de){bn(p,p.return,de)}if(p=E,S=p.updateQueue,S!==null){var L=p.stateNode;try{var X=S.shared.hiddenCallbacks;if(X!==null)for(S.shared.hiddenCallbacks=null,S=0;S<X.length;S++)Pw(X[S],L)}catch(de){bn(p,p.return,de)}}d&&N&64&&ZE(E),Xd(E,E.return);break;case 27:QE(E);case 26:case 5:Ho(S,E,d),d&&p===null&&N&4&&WE(E),Xd(E,E.return);break;case 12:Ho(S,E,d);break;case 31:Ho(S,E,d),d&&N&4&&rR(S,E);break;case 13:Ho(S,E,d),d&&N&4&&aR(S,E);break;case 22:E.memoizedState===null&&Ho(S,E,d),Xd(E,E.return);break;case 30:break;default:Ho(S,E,d)}l=l.sibling}}function Mv(o,l){var d=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==d&&(o!=null&&o.refCount++,d!=null&&Pd(d))}function kv(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Pd(o))}function _s(o,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)iR(o,l,d,p),l=l.sibling}function iR(o,l,d,p){var S=l.flags;switch(l.tag){case 0:case 11:case 15:_s(o,l,d,p),S&2048&&Wd(9,l);break;case 1:_s(o,l,d,p);break;case 3:_s(o,l,d,p),S&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Pd(o)));break;case 12:if(S&2048){_s(o,l,d,p),o=l.stateNode;try{var E=l.memoizedProps,N=E.id,L=E.onPostCommit;typeof L=="function"&&L(N,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(X){bn(l,l.return,X)}}else _s(o,l,d,p);break;case 31:_s(o,l,d,p);break;case 13:_s(o,l,d,p);break;case 23:break;case 22:E=l.stateNode,N=l.alternate,l.memoizedState!==null?E._visibility&2?_s(o,l,d,p):Qd(o,l):E._visibility&2?_s(o,l,d,p):(E._visibility|=2,su(o,l,d,p,(l.subtreeFlags&10256)!==0||!1)),S&2048&&Mv(N,l);break;case 24:_s(o,l,d,p),S&2048&&kv(l.alternate,l);break;default:_s(o,l,d,p)}}function su(o,l,d,p,S){for(S=S&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var E=o,N=l,L=d,X=p,de=N.flags;switch(N.tag){case 0:case 11:case 15:su(E,N,L,X,S),Wd(8,N);break;case 23:break;case 22:var xe=N.stateNode;N.memoizedState!==null?xe._visibility&2?su(E,N,L,X,S):Qd(E,N):(xe._visibility|=2,su(E,N,L,X,S)),S&&de&2048&&Mv(N.alternate,N);break;case 24:su(E,N,L,X,S),S&&de&2048&&kv(N.alternate,N);break;default:su(E,N,L,X,S)}l=l.sibling}}function Qd(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=o,p=l,S=p.flags;switch(p.tag){case 22:Qd(d,p),S&2048&&Mv(p.alternate,p);break;case 24:Qd(d,p),S&2048&&kv(p.alternate,p);break;default:Qd(d,p)}l=l.sibling}}var Jd=8192;function ou(o,l,d){if(o.subtreeFlags&Jd)for(o=o.child;o!==null;)lR(o,l,d),o=o.sibling}function lR(o,l,d){switch(o.tag){case 26:ou(o,l,d),o.flags&Jd&&o.memoizedState!==null&&x9(d,Ts,o.memoizedState,o.memoizedProps);break;case 5:ou(o,l,d);break;case 3:case 4:var p=Ts;Ts=Ym(o.stateNode.containerInfo),ou(o,l,d),Ts=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=Jd,Jd=16777216,ou(o,l,d),Jd=p):ou(o,l,d));break;default:ou(o,l,d)}}function cR(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function ef(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Tr=p,dR(p,o)}cR(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)uR(o),o=o.sibling}function uR(o){switch(o.tag){case 0:case 11:case 15:ef(o),o.flags&2048&&Ni(9,o,o.return);break;case 3:ef(o);break;case 12:ef(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Lm(o)):ef(o);break;default:ef(o)}}function Lm(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Tr=p,dR(p,o)}cR(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Ni(8,l,l.return),Lm(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Lm(l));break;default:Lm(l)}o=o.sibling}}function dR(o,l){for(;Tr!==null;){var d=Tr;switch(d.tag){case 0:case 11:case 15:Ni(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var p=d.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Pd(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,Tr=p;else e:for(d=o;Tr!==null;){p=Tr;var S=p.sibling,E=p.return;if(tR(p),p===d){Tr=null;break e}if(S!==null){S.return=E,Tr=S;break e}Tr=E}}}var Ik={getCacheForType:function(o){var l=kr(ir),d=l.data.get(o);return d===void 0&&(d=o(),l.data.set(o,d)),d},cacheSignal:function(){return kr(ir).controller.signal}},Mk=typeof WeakMap=="function"?WeakMap:Map,mn=0,Dn=null,Ut=null,$t=0,vn=0,za=null,Ai=!1,iu=!1,Lv=!1,$o=0,Wn=0,Di=0,Wl=0,Pv=0,Fa=0,lu=0,tf=null,ba=null,Uv=!1,Pm=0,fR=0,Um=1/0,zm=null,Oi=null,mr=0,Ii=null,cu=null,Vo=0,zv=0,Fv=null,hR=null,nf=0,Hv=null;function Ha(){return(mn&2)!==0&&$t!==0?$t&-$t:M.T!==null?Kv():Ae()}function mR(){if(Fa===0)if(($t&536870912)===0||Kt){var o=Es;Es<<=1,(Es&3932160)===0&&(Es=262144),Fa=o}else Fa=536870912;return o=Pa.current,o!==null&&(o.flags|=32),Fa}function Sa(o,l,d){(o===Dn&&(vn===2||vn===9)||o.cancelPendingCommit!==null)&&(uu(o,0),Mi(o,$t,Fa,!1)),en(o,d),((mn&2)===0||o!==Dn)&&(o===Dn&&((mn&2)===0&&(Wl|=d),Wn===4&&Mi(o,$t,Fa,!1)),eo(o))}function pR(o,l,d){if((mn&6)!==0)throw Error(r(327));var p=!d&&(l&127)===0&&(l&o.expiredLanes)===0||Bt(o,l),S=p?Pk(o,l):Vv(o,l,!0),E=p;do{if(S===0){iu&&!p&&Mi(o,l,0,!1);break}else{if(d=o.current.alternate,E&&!kk(d)){S=Vv(o,l,!1),E=!1;continue}if(S===2){if(E=l,o.errorRecoveryDisabledLanes&E)var N=0;else N=o.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){l=N;e:{var L=o;S=tf;var X=L.current.memoizedState.isDehydrated;if(X&&(uu(L,N).flags|=256),N=Vv(L,N,!1),N!==2){if(Lv&&!X){L.errorRecoveryDisabledLanes|=E,Wl|=E,S=4;break e}E=ba,ba=S,E!==null&&(ba===null?ba=E:ba.push.apply(ba,E))}S=N}if(E=!1,S!==2)continue}}if(S===1){uu(o,0),Mi(o,l,0,!0);break}e:{switch(p=o,E=S,E){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Mi(p,l,Fa,!Ai);break e;case 2:ba=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(S=Pm+300-Re(),10<S)){if(Mi(p,l,Fa,!Ai),We(p,0,!0)!==0)break e;Vo=l,p.timeoutHandle=qR(gR.bind(null,p,d,ba,zm,Uv,l,Fa,Wl,lu,Ai,E,"Throttled",-0,0),S);break e}gR(p,d,ba,zm,Uv,l,Fa,Wl,lu,Ai,E,null,-0,0)}}break}while(!0);eo(o)}function gR(o,l,d,p,S,E,N,L,X,de,xe,be,he,pe){if(o.timeoutHandle=-1,be=l.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_o},lR(l,E,be);var qe=(E&62914560)===E?Pm-Re():(E&4194048)===E?fR-Re():0;if(qe=v9(be,qe),qe!==null){Vo=E,o.cancelPendingCommit=qe(ER.bind(null,o,l,E,d,p,S,N,L,X,xe,be,null,he,pe)),Mi(o,E,N,!de);return}}ER(o,l,E,d,p,S,N,L,X)}function kk(o){for(var l=o;;){var d=l.tag;if((d===0||d===11||d===15)&&l.flags&16384&&(d=l.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var p=0;p<d.length;p++){var S=d[p],E=S.getSnapshot;S=S.value;try{if(!ka(E(),S))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Mi(o,l,d,p){l&=~Pv,l&=~Wl,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var S=l;0<S;){var E=31-kn(S),N=1<<E;p[E]=-1,S&=~N}d!==0&&Rr(o,d,l)}function Fm(){return(mn&6)===0?(rf(0),!1):!0}function $v(){if(Ut!==null){if(vn===0)var o=Ut.return;else o=Ut,Oo=Hl=null,av(o),eu=null,zd=0,o=Ut;for(;o!==null;)KE(o.alternate,o),o=o.return;Ut=null}}function uu(o,l){var d=o.timeoutHandle;d!==-1&&(o.timeoutHandle=-1,t9(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),Vo=0,$v(),Dn=o,Ut=d=Ao(o.current,null),$t=l,vn=0,za=null,Ai=!1,iu=Bt(o,l),Lv=!1,lu=Fa=Pv=Wl=Di=Wn=0,ba=tf=null,Uv=!1,(l&8)!==0&&(l|=l&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=l;0<p;){var S=31-kn(p),E=1<<S;l|=o[S],p&=~E}return $o=l,im(),d}function yR(o,l){wt=null,M.H=Kd,l===Jc||l===pm?(l=Iw(),vn=3):l===qx?(l=Iw(),vn=4):vn=l===bv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,za=l,Ut===null&&(Wn=1,Nm(o,os(l,o.current)))}function xR(){var o=Pa.current;return o===null?!0:($t&4194048)===$t?us===null:($t&62914560)===$t||($t&536870912)!==0?o===us:!1}function vR(){var o=M.H;return M.H=Kd,o===null?Kd:o}function bR(){var o=M.A;return M.A=Ik,o}function Hm(){Wn=4,Ai||($t&4194048)!==$t&&Pa.current!==null||(iu=!0),(Di&134217727)===0&&(Wl&134217727)===0||Dn===null||Mi(Dn,$t,Fa,!1)}function Vv(o,l,d){var p=mn;mn|=2;var S=vR(),E=bR();(Dn!==o||$t!==l)&&(zm=null,uu(o,l)),l=!1;var N=Wn;e:do try{if(vn!==0&&Ut!==null){var L=Ut,X=za;switch(vn){case 8:$v(),N=6;break e;case 3:case 2:case 9:case 6:Pa.current===null&&(l=!0);var de=vn;if(vn=0,za=null,du(o,L,X,de),d&&iu){N=0;break e}break;default:de=vn,vn=0,za=null,du(o,L,X,de)}}Lk(),N=Wn;break}catch(xe){yR(o,xe)}while(!0);return l&&o.shellSuspendCounter++,Oo=Hl=null,mn=p,M.H=S,M.A=E,Ut===null&&(Dn=null,$t=0,im()),N}function Lk(){for(;Ut!==null;)SR(Ut)}function Pk(o,l){var d=mn;mn|=2;var p=vR(),S=bR();Dn!==o||$t!==l?(zm=null,Um=Re()+500,uu(o,l)):iu=Bt(o,l);e:do try{if(vn!==0&&Ut!==null){l=Ut;var E=za;t:switch(vn){case 1:vn=0,za=null,du(o,l,E,1);break;case 2:case 9:if(Dw(E)){vn=0,za=null,CR(l);break}l=function(){vn!==2&&vn!==9||Dn!==o||(vn=7),eo(o)},E.then(l,l);break e;case 3:vn=7;break e;case 4:vn=5;break e;case 7:Dw(E)?(vn=0,za=null,CR(l)):(vn=0,za=null,du(o,l,E,7));break;case 5:var N=null;switch(Ut.tag){case 26:N=Ut.memoizedState;case 5:case 27:var L=Ut;if(N?ij(N):L.stateNode.complete){vn=0,za=null;var X=L.sibling;if(X!==null)Ut=X;else{var de=L.return;de!==null?(Ut=de,$m(de)):Ut=null}break t}}vn=0,za=null,du(o,l,E,5);break;case 6:vn=0,za=null,du(o,l,E,6);break;case 8:$v(),Wn=6;break e;default:throw Error(r(462))}}Uk();break}catch(xe){yR(o,xe)}while(!0);return Oo=Hl=null,M.H=p,M.A=S,mn=d,Ut!==null?0:(Dn=null,$t=0,im(),Wn)}function Uk(){for(;Ut!==null&&!ce();)SR(Ut)}function SR(o){var l=BE(o.alternate,o,$o);o.memoizedProps=o.pendingProps,l===null?$m(o):Ut=l}function CR(o){var l=o,d=l.alternate;switch(l.tag){case 15:case 0:l=zE(d,l,l.pendingProps,l.type,void 0,$t);break;case 11:l=zE(d,l,l.pendingProps,l.type.render,l.ref,$t);break;case 5:av(l);default:KE(d,l),l=Ut=bw(l,$o),l=BE(d,l,$o)}o.memoizedProps=o.pendingProps,l===null?$m(o):Ut=l}function du(o,l,d,p){Oo=Hl=null,av(l),eu=null,zd=0;var S=l.return;try{if(jk(o,S,l,d,$t)){Wn=1,Nm(o,os(d,o.current)),Ut=null;return}}catch(E){if(S!==null)throw Ut=S,E;Wn=1,Nm(o,os(d,o.current)),Ut=null;return}l.flags&32768?(Kt||p===1?o=!0:iu||($t&536870912)!==0?o=!1:(Ai=o=!0,(p===2||p===9||p===3||p===6)&&(p=Pa.current,p!==null&&p.tag===13&&(p.flags|=16384))),wR(l,o)):$m(l)}function $m(o){var l=o;do{if((l.flags&32768)!==0){wR(l,Ai);return}o=l.return;var d=Nk(l.alternate,l,$o);if(d!==null){Ut=d;return}if(l=l.sibling,l!==null){Ut=l;return}Ut=l=o}while(l!==null);Wn===0&&(Wn=5)}function wR(o,l){do{var d=Ak(o.alternate,o);if(d!==null){d.flags&=32767,Ut=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(o=o.sibling,o!==null)){Ut=o;return}Ut=o=d}while(o!==null);Wn=6,Ut=null}function ER(o,l,d,p,S,E,N,L,X){o.cancelPendingCommit=null;do Vm();while(mr!==0);if((mn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(E=l.lanes|l.childLanes,E|=Dx,Jt(o,d,E,N,L,X),o===Dn&&(Ut=Dn=null,$t=0),cu=l,Ii=o,Vo=d,zv=E,Fv=S,hR=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,$k(st,function(){return NR(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=M.T,M.T=null,S=B.p,B.p=2,N=mn,mn|=4;try{Dk(o,l,d)}finally{mn=N,B.p=S,M.T=p}}mr=1,RR(),jR(),TR()}}function RR(){if(mr===1){mr=0;var o=Ii,l=cu,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=M.T,M.T=null;var p=B.p;B.p=2;var S=mn;mn|=4;try{sR(l,o);var E=t0,N=dw(o.containerInfo),L=E.focusedElem,X=E.selectionRange;if(N!==L&&L&&L.ownerDocument&&uw(L.ownerDocument.documentElement,L)){if(X!==null&&jx(L)){var de=X.start,xe=X.end;if(xe===void 0&&(xe=de),"selectionStart"in L)L.selectionStart=de,L.selectionEnd=Math.min(xe,L.value.length);else{var be=L.ownerDocument||document,he=be&&be.defaultView||window;if(he.getSelection){var pe=he.getSelection(),qe=L.textContent.length,ot=Math.min(X.start,qe),jn=X.end===void 0?ot:Math.min(X.end,qe);!pe.extend&&ot>jn&&(N=jn,jn=ot,ot=N);var oe=cw(L,ot),te=cw(L,jn);if(oe&&te&&(pe.rangeCount!==1||pe.anchorNode!==oe.node||pe.anchorOffset!==oe.offset||pe.focusNode!==te.node||pe.focusOffset!==te.offset)){var ue=be.createRange();ue.setStart(oe.node,oe.offset),pe.removeAllRanges(),ot>jn?(pe.addRange(ue),pe.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),pe.addRange(ue))}}}}for(be=[],pe=L;pe=pe.parentNode;)pe.nodeType===1&&be.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<be.length;L++){var ve=be[L];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}tp=!!e0,t0=e0=null}finally{mn=S,B.p=p,M.T=d}}o.current=l,mr=2}}function jR(){if(mr===2){mr=0;var o=Ii,l=cu,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=M.T,M.T=null;var p=B.p;B.p=2;var S=mn;mn|=4;try{eR(o,l.alternate,l)}finally{mn=S,B.p=p,M.T=d}}mr=3}}function TR(){if(mr===4||mr===3){mr=0,Ie();var o=Ii,l=cu,d=Vo,p=hR;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?mr=5:(mr=0,cu=Ii=null,_R(o,o.pendingLanes));var S=o.pendingLanes;if(S===0&&(Oi=null),Se(d),l=l.stateNode,fn&&typeof fn.onCommitFiberRoot=="function")try{fn.onCommitFiberRoot(Jr,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=M.T,S=B.p,B.p=2,M.T=null;try{for(var E=o.onRecoverableError,N=0;N<p.length;N++){var L=p[N];E(L.value,{componentStack:L.stack})}}finally{M.T=l,B.p=S}}(Vo&3)!==0&&Vm(),eo(o),S=o.pendingLanes,(d&261930)!==0&&(S&42)!==0?o===Hv?nf++:(nf=0,Hv=o):nf=0,rf(0)}}function _R(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Pd(l)))}function Vm(){return RR(),jR(),TR(),NR()}function NR(){if(mr!==5)return!1;var o=Ii,l=zv;zv=0;var d=Se(Vo),p=M.T,S=B.p;try{B.p=32>d?32:d,M.T=null,d=Fv,Fv=null;var E=Ii,N=Vo;if(mr=0,cu=Ii=null,Vo=0,(mn&6)!==0)throw Error(r(331));var L=mn;if(mn|=4,uR(E.current),iR(E,E.current,N,d),mn=L,rf(0,!1),fn&&typeof fn.onPostCommitFiberRoot=="function")try{fn.onPostCommitFiberRoot(Jr,E)}catch{}return!0}finally{B.p=S,M.T=p,_R(o,l)}}function AR(o,l,d){l=os(d,l),l=vv(o.stateNode,l,2),o=ji(o,l,2),o!==null&&(en(o,2),eo(o))}function bn(o,l,d){if(o.tag===3)AR(o,o,d);else for(;l!==null;){if(l.tag===3){AR(l,o,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Oi===null||!Oi.has(p))){o=os(d,o),d=DE(2),p=ji(l,d,2),p!==null&&(OE(d,p,l,o),en(p,2),eo(p));break}}l=l.return}}function Gv(o,l,d){var p=o.pingCache;if(p===null){p=o.pingCache=new Mk;var S=new Set;p.set(l,S)}else S=p.get(l),S===void 0&&(S=new Set,p.set(l,S));S.has(d)||(Lv=!0,S.add(d),o=zk.bind(null,o,l,d),l.then(o,o))}function zk(o,l,d){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Dn===o&&($t&d)===d&&(Wn===4||Wn===3&&($t&62914560)===$t&&300>Re()-Pm?(mn&2)===0&&uu(o,0):Pv|=d,lu===$t&&(lu=0)),eo(o)}function DR(o,l){l===0&&(l=qt()),o=Ul(o,l),o!==null&&(en(o,l),eo(o))}function Fk(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),DR(o,d)}function Hk(o,l){var d=0;switch(o.tag){case 31:case 13:var p=o.stateNode,S=o.memoizedState;S!==null&&(d=S.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(l),DR(o,d)}function $k(o,l){return Y(o,l)}var Gm=null,fu=null,Bv=!1,Bm=!1,qv=!1,ki=0;function eo(o){o!==fu&&o.next===null&&(fu===null?Gm=fu=o:fu=fu.next=o),Bm=!0,Bv||(Bv=!0,Gk())}function rf(o,l){if(!qv&&Bm){qv=!0;do for(var d=!1,p=Gm;p!==null;){if(o!==0){var S=p.pendingLanes;if(S===0)var E=0;else{var N=p.suspendedLanes,L=p.pingedLanes;E=(1<<31-kn(42|o)+1)-1,E&=S&~(N&~L),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(d=!0,kR(p,E))}else E=$t,E=We(p,p===Dn?E:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(E&3)===0||Bt(p,E)||(d=!0,kR(p,E));p=p.next}while(d);qv=!1}}function Vk(){OR()}function OR(){Bm=Bv=!1;var o=0;ki!==0&&e9()&&(o=ki);for(var l=Re(),d=null,p=Gm;p!==null;){var S=p.next,E=IR(p,l);E===0?(p.next=null,d===null?Gm=S:d.next=S,S===null&&(fu=d)):(d=p,(o!==0||(E&3)!==0)&&(Bm=!0)),p=S}mr!==0&&mr!==5||rf(o),ki!==0&&(ki=0)}function IR(o,l){for(var d=o.suspendedLanes,p=o.pingedLanes,S=o.expirationTimes,E=o.pendingLanes&-62914561;0<E;){var N=31-kn(E),L=1<<N,X=S[N];X===-1?((L&d)===0||(L&p)!==0)&&(S[N]=Qt(L,l)):X<=l&&(o.expiredLanes|=L),E&=~L}if(l=Dn,d=$t,d=We(o,o===l?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,d===0||o===l&&(vn===2||vn===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&ne(p),o.callbackNode=null,o.callbackPriority=0;if((d&3)===0||Bt(o,d)){if(l=d&-d,l===o.callbackPriority)return l;switch(p!==null&&ne(p),Se(d)){case 2:case 8:d=mt;break;case 32:d=st;break;case 268435456:d=sr;break;default:d=st}return p=MR.bind(null,o),d=Y(d,p),o.callbackPriority=l,o.callbackNode=d,l}return p!==null&&p!==null&&ne(p),o.callbackPriority=2,o.callbackNode=null,2}function MR(o,l){if(mr!==0&&mr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if(Vm()&&o.callbackNode!==d)return null;var p=$t;return p=We(o,o===Dn?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(pR(o,p,l),IR(o,Re()),o.callbackNode!=null&&o.callbackNode===d?MR.bind(null,o):null)}function kR(o,l){if(Vm())return null;pR(o,l,!0)}function Gk(){n9(function(){(mn&6)!==0?Y($e,Vk):OR()})}function Kv(){if(ki===0){var o=Xc;o===0&&(o=Da,Da<<=1,(Da&261888)===0&&(Da=256)),ki=o}return ki}function LR(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Jh(""+o)}function PR(o,l){var d=l.ownerDocument.createElement("input");return d.name=l.name,d.value=l.value,o.id&&d.setAttribute("form",o.id),l.parentNode.insertBefore(d,l),o=new FormData(o),d.parentNode.removeChild(d),o}function Bk(o,l,d,p,S){if(l==="submit"&&d&&d.stateNode===S){var E=LR((S[ze]||null).action),N=p.submitter;N&&(l=(l=N[ze]||null)?LR(l.formAction):N.getAttribute("formAction"),l!==null&&(E=l,N=null));var L=new rm("action","action",null,p,S);o.push({event:L,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ki!==0){var X=N?PR(S,N):new FormData(S);hv(d,{pending:!0,data:X,method:S.method,action:E},null,X)}}else typeof E=="function"&&(L.preventDefault(),X=N?PR(S,N):new FormData(S),hv(d,{pending:!0,data:X,method:S.method,action:E},E,X))},currentTarget:S}]})}}for(var Zv=0;Zv<Ax.length;Zv++){var Yv=Ax[Zv],qk=Yv.toLowerCase(),Kk=Yv[0].toUpperCase()+Yv.slice(1);js(qk,"on"+Kk)}js(mw,"onAnimationEnd"),js(pw,"onAnimationIteration"),js(gw,"onAnimationStart"),js("dblclick","onDoubleClick"),js("focusin","onFocus"),js("focusout","onBlur"),js(ck,"onTransitionRun"),js(uk,"onTransitionStart"),js(dk,"onTransitionCancel"),js(yw,"onTransitionEnd"),pa("onMouseEnter",["mouseout","mouseover"]),pa("onMouseLeave",["mouseout","mouseover"]),pa("onPointerEnter",["pointerout","pointerover"]),pa("onPointerLeave",["pointerout","pointerover"]),Ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var af="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(" "),Zk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(af));function UR(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var p=o[d],S=p.event;p=p.listeners;e:{var E=void 0;if(l)for(var N=p.length-1;0<=N;N--){var L=p[N],X=L.instance,de=L.currentTarget;if(L=L.listener,X!==E&&S.isPropagationStopped())break e;E=L,S.currentTarget=de;try{E(S)}catch(xe){om(xe)}S.currentTarget=null,E=X}else for(N=0;N<p.length;N++){if(L=p[N],X=L.instance,de=L.currentTarget,L=L.listener,X!==E&&S.isPropagationStopped())break e;E=L,S.currentTarget=de;try{E(S)}catch(xe){om(xe)}S.currentTarget=null,E=X}}}}function zt(o,l){var d=l[at];d===void 0&&(d=l[at]=new Set);var p=o+"__bubble";d.has(p)||(zR(l,o,2,!1),d.add(p))}function Wv(o,l,d){var p=0;l&&(p|=4),zR(d,o,p,l)}var qm="_reactListening"+Math.random().toString(36).slice(2);function Xv(o){if(!o[qm]){o[qm]=!0,Ia.forEach(function(d){d!=="selectionchange"&&(Zk.has(d)||Wv(d,!1,o),Wv(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[qm]||(l[qm]=!0,Wv("selectionchange",!1,l))}}function zR(o,l,d,p){switch(mj(l)){case 2:var S=C9;break;case 8:S=w9;break;default:S=f0}d=S.bind(null,l,d,o),S=void 0,!yx||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(S=!0),p?S!==void 0?o.addEventListener(l,d,{capture:!0,passive:S}):o.addEventListener(l,d,!0):S!==void 0?o.addEventListener(l,d,{passive:S}):o.addEventListener(l,d,!1)}function Qv(o,l,d,p,S){var E=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var N=p.tag;if(N===3||N===4){var L=p.stateNode.containerInfo;if(L===S)break;if(N===4)for(N=p.return;N!==null;){var X=N.tag;if((X===3||X===4)&&N.stateNode.containerInfo===S)return;N=N.return}for(;L!==null;){if(N=sn(L),N===null)return;if(X=N.tag,X===5||X===6||X===26||X===27){p=E=N;continue e}L=L.parentNode}}p=p.return}GC(function(){var de=E,xe=px(d),be=[];e:{var he=xw.get(o);if(he!==void 0){var pe=rm,qe=o;switch(o){case"keypress":if(tm(d)===0)break e;case"keydown":case"keyup":pe=H8;break;case"focusin":qe="focus",pe=Sx;break;case"focusout":qe="blur",pe=Sx;break;case"beforeblur":case"afterblur":pe=Sx;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=KC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=N8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=G8;break;case mw:case pw:case gw:pe=O8;break;case yw:pe=q8;break;case"scroll":case"scrollend":pe=T8;break;case"wheel":pe=Z8;break;case"copy":case"cut":case"paste":pe=M8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=YC;break;case"toggle":case"beforetoggle":pe=W8}var ot=(l&4)!==0,jn=!ot&&(o==="scroll"||o==="scrollend"),oe=ot?he!==null?he+"Capture":null:he;ot=[];for(var te=de,ue;te!==null;){var ve=te;if(ue=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ue===null||oe===null||(ve=jd(te,oe),ve!=null&&ot.push(sf(te,ve,ue))),jn)break;te=te.return}0<ot.length&&(he=new pe(he,qe,null,d,xe),be.push({event:he,listeners:ot}))}}if((l&7)===0){e:{if(he=o==="mouseover"||o==="pointerover",pe=o==="mouseout"||o==="pointerout",he&&d!==mx&&(qe=d.relatedTarget||d.fromElement)&&(sn(qe)||qe[Qe]))break e;if((pe||he)&&(he=xe.window===xe?xe:(he=xe.ownerDocument)?he.defaultView||he.parentWindow:window,pe?(qe=d.relatedTarget||d.toElement,pe=de,qe=qe?sn(qe):null,qe!==null&&(jn=i(qe),ot=qe.tag,qe!==jn||ot!==5&&ot!==27&&ot!==6)&&(qe=null)):(pe=null,qe=de),pe!==qe)){if(ot=KC,ve="onMouseLeave",oe="onMouseEnter",te="mouse",(o==="pointerout"||o==="pointerover")&&(ot=YC,ve="onPointerLeave",oe="onPointerEnter",te="pointer"),jn=pe==null?he:Oa(pe),ue=qe==null?he:Oa(qe),he=new ot(ve,te+"leave",pe,d,xe),he.target=jn,he.relatedTarget=ue,ve=null,sn(xe)===de&&(ot=new ot(oe,te+"enter",qe,d,xe),ot.target=ue,ot.relatedTarget=jn,ve=ot),jn=ve,pe&&qe)t:{for(ot=Yk,oe=pe,te=qe,ue=0,ve=oe;ve;ve=ot(ve))ue++;ve=0;for(var rt=te;rt;rt=ot(rt))ve++;for(;0<ue-ve;)oe=ot(oe),ue--;for(;0<ve-ue;)te=ot(te),ve--;for(;ue--;){if(oe===te||te!==null&&oe===te.alternate){ot=oe;break t}oe=ot(oe),te=ot(te)}ot=null}else ot=null;pe!==null&&FR(be,he,pe,ot,!1),qe!==null&&jn!==null&&FR(be,jn,qe,ot,!0)}}e:{if(he=de?Oa(de):window,pe=he.nodeName&&he.nodeName.toLowerCase(),pe==="select"||pe==="input"&&he.type==="file")var cn=rw;else if(tw(he))if(aw)cn=ok;else{cn=ak;var Xe=rk}else pe=he.nodeName,!pe||pe.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?de&&hx(de.elementType)&&(cn=rw):cn=sk;if(cn&&(cn=cn(o,de))){nw(be,cn,d,xe);break e}Xe&&Xe(o,he,de),o==="focusout"&&de&&he.type==="number"&&de.memoizedProps.value!=null&&fx(he,"number",he.value)}switch(Xe=de?Oa(de):window,o){case"focusin":(tw(Xe)||Xe.contentEditable==="true")&&(Vc=Xe,Tx=de,Md=null);break;case"focusout":Md=Tx=Vc=null;break;case"mousedown":_x=!0;break;case"contextmenu":case"mouseup":case"dragend":_x=!1,fw(be,d,xe);break;case"selectionchange":if(lk)break;case"keydown":case"keyup":fw(be,d,xe)}var Tt;if(wx)e:{switch(o){case"compositionstart":var Vt="onCompositionStart";break e;case"compositionend":Vt="onCompositionEnd";break e;case"compositionupdate":Vt="onCompositionUpdate";break e}Vt=void 0}else $c?JC(o,d)&&(Vt="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Vt="onCompositionStart");Vt&&(WC&&d.locale!=="ko"&&($c||Vt!=="onCompositionStart"?Vt==="onCompositionEnd"&&$c&&(Tt=BC()):(vi=xe,xx="value"in vi?vi.value:vi.textContent,$c=!0)),Xe=Km(de,Vt),0<Xe.length&&(Vt=new ZC(Vt,o,null,d,xe),be.push({event:Vt,listeners:Xe}),Tt?Vt.data=Tt:(Tt=ew(d),Tt!==null&&(Vt.data=Tt)))),(Tt=Q8?J8(o,d):ek(o,d))&&(Vt=Km(de,"onBeforeInput"),0<Vt.length&&(Xe=new ZC("onBeforeInput","beforeinput",null,d,xe),be.push({event:Xe,listeners:Vt}),Xe.data=Tt)),Bk(be,o,de,d,xe)}UR(be,l)})}function sf(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Km(o,l){for(var d=l+"Capture",p=[];o!==null;){var S=o,E=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||E===null||(S=jd(o,d),S!=null&&p.unshift(sf(o,S,E)),S=jd(o,l),S!=null&&p.push(sf(o,S,E))),o.tag===3)return p;o=o.return}return[]}function Yk(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function FR(o,l,d,p,S){for(var E=l._reactName,N=[];d!==null&&d!==p;){var L=d,X=L.alternate,de=L.stateNode;if(L=L.tag,X!==null&&X===p)break;L!==5&&L!==26&&L!==27||de===null||(X=de,S?(de=jd(d,E),de!=null&&N.unshift(sf(d,de,X))):S||(de=jd(d,E),de!=null&&N.push(sf(d,de,X)))),d=d.return}N.length!==0&&o.push({event:l,listeners:N})}var Wk=/\r\n?/g,Xk=/\u0000|\uFFFD/g;function HR(o){return(typeof o=="string"?o:""+o).replace(Wk,`
|
|
49
|
-
`).replace(Xk,"")}function $R(o,l){return l=HR(l),HR(o)===l}function Rn(o,l,d,p,S,E){switch(d){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||zc(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&zc(o,""+p);break;case"className":rs(o,"class",p);break;case"tabIndex":rs(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":rs(o,d,p);break;case"style":$C(o,p,E);break;case"data":if(l!=="object"){rs(o,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||d!=="href")){o.removeAttribute(d);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=Jh(""+p),o.setAttribute(d,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(d,"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 E=="function"&&(d==="formAction"?(l!=="input"&&Rn(o,l,"name",S.name,S,null),Rn(o,l,"formEncType",S.formEncType,S,null),Rn(o,l,"formMethod",S.formMethod,S,null),Rn(o,l,"formTarget",S.formTarget,S,null)):(Rn(o,l,"encType",S.encType,S,null),Rn(o,l,"method",S.method,S,null),Rn(o,l,"target",S.target,S,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=Jh(""+p),o.setAttribute(d,p);break;case"onClick":p!=null&&(o.onclick=_o);break;case"onScroll":p!=null&&zt("scroll",o);break;case"onScrollEnd":p!=null&&zt("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(S.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}d=Jh(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,""+p):o.removeAttribute(d);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":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,""):o.removeAttribute(d);break;case"capture":case"download":p===!0?o.setAttribute(d,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,p):o.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(d,p):o.removeAttribute(d);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(d):o.setAttribute(d,p);break;case"popover":zt("beforetoggle",o),zt("toggle",o),Rs(o,"popover",p);break;case"xlinkActuate":ln(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":ln(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":ln(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":ln(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":ln(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":ln(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":ln(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":ln(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":ln(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Rs(o,"is",p);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=R8.get(d)||d,Rs(o,d,p))}}function Jv(o,l,d,p,S,E){switch(d){case"style":$C(o,p,E);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(S.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"children":typeof p=="string"?zc(o,p):(typeof p=="number"||typeof p=="bigint")&&zc(o,""+p);break;case"onScroll":p!=null&&zt("scroll",o);break;case"onScrollEnd":p!=null&&zt("scrollend",o);break;case"onClick":p!=null&&(o.onclick=_o);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lc.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(S=d.endsWith("Capture"),l=d.slice(2,S?d.length-7:void 0),E=o[ze]||null,E=E!=null?E[d]:null,typeof E=="function"&&o.removeEventListener(l,E,S),typeof p=="function")){typeof E!="function"&&E!==null&&(d in o?o[d]=null:o.hasAttribute(d)&&o.removeAttribute(d)),o.addEventListener(l,p,S);break e}d in o?o[d]=p:p===!0?o.setAttribute(d,""):Rs(o,d,p)}}}function Pr(o,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":zt("error",o),zt("load",o);var p=!1,S=!1,E;for(E in d)if(d.hasOwnProperty(E)){var N=d[E];if(N!=null)switch(E){case"src":p=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Rn(o,l,E,N,d,null)}}S&&Rn(o,l,"srcSet",d.srcSet,d,null),p&&Rn(o,l,"src",d.src,d,null);return;case"input":zt("invalid",o);var L=E=N=S=null,X=null,de=null;for(p in d)if(d.hasOwnProperty(p)){var xe=d[p];if(xe!=null)switch(p){case"name":S=xe;break;case"type":N=xe;break;case"checked":X=xe;break;case"defaultChecked":de=xe;break;case"value":E=xe;break;case"defaultValue":L=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,l));break;default:Rn(o,l,p,xe,d,null)}}UC(o,E,L,X,de,N,S,!1);return;case"select":zt("invalid",o),p=N=E=null;for(S in d)if(d.hasOwnProperty(S)&&(L=d[S],L!=null))switch(S){case"value":E=L;break;case"defaultValue":N=L;break;case"multiple":p=L;default:Rn(o,l,S,L,d,null)}l=E,d=N,o.multiple=!!p,l!=null?Uc(o,!!p,l,!1):d!=null&&Uc(o,!!p,d,!0);return;case"textarea":zt("invalid",o),E=S=p=null;for(N in d)if(d.hasOwnProperty(N)&&(L=d[N],L!=null))switch(N){case"value":p=L;break;case"defaultValue":S=L;break;case"children":E=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Rn(o,l,N,L,d,null)}FC(o,p,S,E);return;case"option":for(X in d)if(d.hasOwnProperty(X)&&(p=d[X],p!=null))switch(X){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Rn(o,l,X,p,d,null)}return;case"dialog":zt("beforetoggle",o),zt("toggle",o),zt("cancel",o),zt("close",o);break;case"iframe":case"object":zt("load",o);break;case"video":case"audio":for(p=0;p<af.length;p++)zt(af[p],o);break;case"image":zt("error",o),zt("load",o);break;case"details":zt("toggle",o);break;case"embed":case"source":case"link":zt("error",o),zt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in d)if(d.hasOwnProperty(de)&&(p=d[de],p!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Rn(o,l,de,p,d,null)}return;default:if(hx(l)){for(xe in d)d.hasOwnProperty(xe)&&(p=d[xe],p!==void 0&&Jv(o,l,xe,p,d,void 0));return}}for(L in d)d.hasOwnProperty(L)&&(p=d[L],p!=null&&Rn(o,l,L,p,d,null))}function Qk(o,l,d,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,E=null,N=null,L=null,X=null,de=null,xe=null;for(pe in d){var be=d[pe];if(d.hasOwnProperty(pe)&&be!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":X=be;default:p.hasOwnProperty(pe)||Rn(o,l,pe,null,p,be)}}for(var he in p){var pe=p[he];if(be=d[he],p.hasOwnProperty(he)&&(pe!=null||be!=null))switch(he){case"type":E=pe;break;case"name":S=pe;break;case"checked":de=pe;break;case"defaultChecked":xe=pe;break;case"value":N=pe;break;case"defaultValue":L=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,l));break;default:pe!==be&&Rn(o,l,he,pe,p,be)}}dx(o,N,L,X,de,xe,E,S);return;case"select":pe=N=L=he=null;for(E in d)if(X=d[E],d.hasOwnProperty(E)&&X!=null)switch(E){case"value":break;case"multiple":pe=X;default:p.hasOwnProperty(E)||Rn(o,l,E,null,p,X)}for(S in p)if(E=p[S],X=d[S],p.hasOwnProperty(S)&&(E!=null||X!=null))switch(S){case"value":he=E;break;case"defaultValue":L=E;break;case"multiple":N=E;default:E!==X&&Rn(o,l,S,E,p,X)}l=L,d=N,p=pe,he!=null?Uc(o,!!d,he,!1):!!p!=!!d&&(l!=null?Uc(o,!!d,l,!0):Uc(o,!!d,d?[]:"",!1));return;case"textarea":pe=he=null;for(L in d)if(S=d[L],d.hasOwnProperty(L)&&S!=null&&!p.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Rn(o,l,L,null,p,S)}for(N in p)if(S=p[N],E=d[N],p.hasOwnProperty(N)&&(S!=null||E!=null))switch(N){case"value":he=S;break;case"defaultValue":pe=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(r(91));break;default:S!==E&&Rn(o,l,N,S,p,E)}zC(o,he,pe);return;case"option":for(var qe in d)if(he=d[qe],d.hasOwnProperty(qe)&&he!=null&&!p.hasOwnProperty(qe))switch(qe){case"selected":o.selected=!1;break;default:Rn(o,l,qe,null,p,he)}for(X in p)if(he=p[X],pe=d[X],p.hasOwnProperty(X)&&he!==pe&&(he!=null||pe!=null))switch(X){case"selected":o.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:Rn(o,l,X,he,p,pe)}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 ot in d)he=d[ot],d.hasOwnProperty(ot)&&he!=null&&!p.hasOwnProperty(ot)&&Rn(o,l,ot,null,p,he);for(de in p)if(he=p[de],pe=d[de],p.hasOwnProperty(de)&&he!==pe&&(he!=null||pe!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:Rn(o,l,de,he,p,pe)}return;default:if(hx(l)){for(var jn in d)he=d[jn],d.hasOwnProperty(jn)&&he!==void 0&&!p.hasOwnProperty(jn)&&Jv(o,l,jn,void 0,p,he);for(xe in p)he=p[xe],pe=d[xe],!p.hasOwnProperty(xe)||he===pe||he===void 0&&pe===void 0||Jv(o,l,xe,he,p,pe);return}}for(var oe in d)he=d[oe],d.hasOwnProperty(oe)&&he!=null&&!p.hasOwnProperty(oe)&&Rn(o,l,oe,null,p,he);for(be in p)he=p[be],pe=d[be],!p.hasOwnProperty(be)||he===pe||he==null&&pe==null||Rn(o,l,be,he,p,pe)}function VR(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jk(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,d=performance.getEntriesByType("resource"),p=0;p<d.length;p++){var S=d[p],E=S.transferSize,N=S.initiatorType,L=S.duration;if(E&&L&&VR(N)){for(N=0,L=S.responseEnd,p+=1;p<d.length;p++){var X=d[p],de=X.startTime;if(de>L)break;var xe=X.transferSize,be=X.initiatorType;xe&&VR(be)&&(X=X.responseEnd,N+=xe*(X<L?1:(L-de)/(X-de)))}if(--p,l+=8*(E+N)/(S.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var e0=null,t0=null;function Zm(o){return o.nodeType===9?o:o.ownerDocument}function GR(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function BR(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function n0(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var r0=null;function e9(){var o=window.event;return o&&o.type==="popstate"?o===r0?!1:(r0=o,!0):(r0=null,!1)}var qR=typeof setTimeout=="function"?setTimeout:void 0,t9=typeof clearTimeout=="function"?clearTimeout:void 0,KR=typeof Promise=="function"?Promise:void 0,n9=typeof queueMicrotask=="function"?queueMicrotask:typeof KR<"u"?function(o){return KR.resolve(null).then(o).catch(r9)}:qR;function r9(o){setTimeout(function(){throw o})}function Li(o){return o==="head"}function ZR(o,l){var d=l,p=0;do{var S=d.nextSibling;if(o.removeChild(d),S&&S.nodeType===8)if(d=S.data,d==="/$"||d==="/&"){if(p===0){o.removeChild(S),gu(l);return}p--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")p++;else if(d==="html")of(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,of(d);for(var E=d.firstChild;E;){var N=E.nextSibling,L=E.nodeName;E[Ln]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&E.rel.toLowerCase()==="stylesheet"||d.removeChild(E),E=N}}else d==="body"&&of(o.ownerDocument.body);d=S}while(d);gu(l)}function YR(o,l){var d=o;o=0;do{var p=d.nextSibling;if(d.nodeType===1?l?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(l?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),p&&p.nodeType===8)if(d=p.data,d==="/$"){if(o===0)break;o--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||o++;d=p}while(d)}function a0(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var d=l;switch(l=l.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":a0(d),Zn(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function a9(o,l,d,p){for(;o.nodeType===1;){var S=d;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[Ln])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(E=o.getAttribute("rel"),E==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(E!==S.rel||o.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||o.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||o.getAttribute("title")!==(S.title==null?null:S.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(E=o.getAttribute("src"),(E!==(S.src==null?null:S.src)||o.getAttribute("type")!==(S.type==null?null:S.type)||o.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&E&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var E=S.name==null?null:""+S.name;if(S.type==="hidden"&&o.getAttribute("name")===E)return o}else return o;if(o=ds(o.nextSibling),o===null)break}return null}function s9(o,l,d){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=ds(o.nextSibling),o===null))return null;return o}function WR(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=ds(o.nextSibling),o===null))return null;return o}function s0(o){return o.data==="$?"||o.data==="$~"}function o0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function o9(o,l){var d=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||d.readyState!=="loading")l();else{var p=function(){l(),d.removeEventListener("DOMContentLoaded",p)};d.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function ds(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var i0=null;function XR(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(l===0)return ds(o.nextSibling);l--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||l++}o=o.nextSibling}return null}function QR(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(l===0)return o;l--}else d!=="/$"&&d!=="/&"||l++}o=o.previousSibling}return null}function JR(o,l,d){switch(l=Zm(d),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function of(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Zn(o)}var fs=new Map,ej=new Set;function Ym(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Go=B.d;B.d={f:i9,r:l9,D:c9,C:u9,L:d9,m:f9,X:m9,S:h9,M:p9};function i9(){var o=Go.f(),l=Fm();return o||l}function l9(o){var l=on(o);l!==null&&l.tag===5&&l.type==="form"?yE(l):Go.r(o)}var hu=typeof document>"u"?null:document;function tj(o,l,d){var p=hu;if(p&&typeof l=="string"&&l){var S=as(l);S='link[rel="'+o+'"][href="'+S+'"]',typeof d=="string"&&(S+='[crossorigin="'+d+'"]'),ej.has(S)||(ej.add(S),o={rel:o,crossOrigin:d,href:l},p.querySelector(S)===null&&(l=p.createElement("link"),Pr(l,"link",o),An(l),p.head.appendChild(l)))}}function c9(o){Go.D(o),tj("dns-prefetch",o,null)}function u9(o,l){Go.C(o,l),tj("preconnect",o,l)}function d9(o,l,d){Go.L(o,l,d);var p=hu;if(p&&o&&l){var S='link[rel="preload"][as="'+as(l)+'"]';l==="image"&&d&&d.imageSrcSet?(S+='[imagesrcset="'+as(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(S+='[imagesizes="'+as(d.imageSizes)+'"]')):S+='[href="'+as(o)+'"]';var E=S;switch(l){case"style":E=mu(o);break;case"script":E=pu(o)}fs.has(E)||(o=g({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:o,as:l},d),fs.set(E,o),p.querySelector(S)!==null||l==="style"&&p.querySelector(lf(E))||l==="script"&&p.querySelector(cf(E))||(l=p.createElement("link"),Pr(l,"link",o),An(l),p.head.appendChild(l)))}}function f9(o,l){Go.m(o,l);var d=hu;if(d&&o){var p=l&&typeof l.as=="string"?l.as:"script",S='link[rel="modulepreload"][as="'+as(p)+'"][href="'+as(o)+'"]',E=S;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=pu(o)}if(!fs.has(E)&&(o=g({rel:"modulepreload",href:o},l),fs.set(E,o),d.querySelector(S)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(cf(E)))return}p=d.createElement("link"),Pr(p,"link",o),An(p),d.head.appendChild(p)}}}function h9(o,l,d){Go.S(o,l,d);var p=hu;if(p&&o){var S=ns(p).hoistableStyles,E=mu(o);l=l||"default";var N=S.get(E);if(!N){var L={loading:0,preload:null};if(N=p.querySelector(lf(E)))L.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},d),(d=fs.get(E))&&l0(o,d);var X=N=p.createElement("link");An(X),Pr(X,"link",o),X._p=new Promise(function(de,xe){X.onload=de,X.onerror=xe}),X.addEventListener("load",function(){L.loading|=1}),X.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Wm(N,l,p)}N={type:"stylesheet",instance:N,count:1,state:L},S.set(E,N)}}}function m9(o,l){Go.X(o,l);var d=hu;if(d&&o){var p=ns(d).hoistableScripts,S=pu(o),E=p.get(S);E||(E=d.querySelector(cf(S)),E||(o=g({src:o,async:!0},l),(l=fs.get(S))&&c0(o,l),E=d.createElement("script"),An(E),Pr(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},p.set(S,E))}}function p9(o,l){Go.M(o,l);var d=hu;if(d&&o){var p=ns(d).hoistableScripts,S=pu(o),E=p.get(S);E||(E=d.querySelector(cf(S)),E||(o=g({src:o,async:!0,type:"module"},l),(l=fs.get(S))&&c0(o,l),E=d.createElement("script"),An(E),Pr(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},p.set(S,E))}}function nj(o,l,d,p){var S=(S=le.current)?Ym(S):null;if(!S)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=mu(d.href),d=ns(S).hoistableStyles,p=d.get(l),p||(p={type:"style",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=mu(d.href);var E=ns(S).hoistableStyles,N=E.get(o);if(N||(S=S.ownerDocument||S,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(o,N),(E=S.querySelector(lf(o)))&&!E._p&&(N.instance=E,N.state.loading=5),fs.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},fs.set(o,d),E||g9(S,o,d,N.state))),l&&p===null)throw Error(r(528,""));return N}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=pu(d),d=ns(S).hoistableScripts,p=d.get(l),p||(p={type:"script",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function mu(o){return'href="'+as(o)+'"'}function lf(o){return'link[rel="stylesheet"]['+o+"]"}function rj(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function g9(o,l,d,p){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=o.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Pr(l,"link",d),An(l),o.head.appendChild(l))}function pu(o){return'[src="'+as(o)+'"]'}function cf(o){return"script[async]"+o}function aj(o,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+as(d.href)+'"]');if(p)return l.instance=p,An(p),p;var S=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),An(p),Pr(p,"style",S),Wm(p,d.precedence,o),l.instance=p;case"stylesheet":S=mu(d.href);var E=o.querySelector(lf(S));if(E)return l.state.loading|=4,l.instance=E,An(E),E;p=rj(d),(S=fs.get(S))&&l0(p,S),E=(o.ownerDocument||o).createElement("link"),An(E);var N=E;return N._p=new Promise(function(L,X){N.onload=L,N.onerror=X}),Pr(E,"link",p),l.state.loading|=4,Wm(E,d.precedence,o),l.instance=E;case"script":return E=pu(d.src),(S=o.querySelector(cf(E)))?(l.instance=S,An(S),S):(p=d,(S=fs.get(E))&&(p=g({},d),c0(p,S)),o=o.ownerDocument||o,S=o.createElement("script"),An(S),Pr(S,"link",p),o.head.appendChild(S),l.instance=S);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,Wm(p,d.precedence,o));return l.instance}function Wm(o,l,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=p.length?p[p.length-1]:null,E=S,N=0;N<p.length;N++){var L=p[N];if(L.dataset.precedence===l)E=L;else if(E!==S)break}E?E.parentNode.insertBefore(o,E.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(o,l.firstChild))}function l0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function c0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Xm=null;function sj(o,l,d){if(Xm===null){var p=new Map,S=Xm=new Map;S.set(d,p)}else S=Xm,p=S.get(d),p||(p=new Map,S.set(d,p));if(p.has(o))return p;for(p.set(o,null),d=d.getElementsByTagName(o),S=0;S<d.length;S++){var E=d[S];if(!(E[Ln]||E[Le]||o==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var N=E.getAttribute(l)||"";N=o+N;var L=p.get(N);L?L.push(E):p.set(N,[E])}}return p}function oj(o,l,d){o=o.ownerDocument||o,o.head.insertBefore(d,l==="title"?o.querySelector("head > title"):null)}function y9(o,l,d){if(d===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return o=l.disabled,typeof l.precedence=="string"&&o==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function ij(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function x9(o,l,d,p){if(d.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var S=mu(p.href),E=l.querySelector(lf(S));if(E){l=E._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=Qm.bind(o),l.then(o,o)),d.state.loading|=4,d.instance=E,An(E);return}E=l.ownerDocument||l,p=rj(p),(S=fs.get(S))&&l0(p,S),E=E.createElement("link"),An(E);var N=E;N._p=new Promise(function(L,X){N.onload=L,N.onerror=X}),Pr(E,"link",p),d.instance=E}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(d,l),(l=d.state.preload)&&(d.state.loading&3)===0&&(o.count++,d=Qm.bind(o),l.addEventListener("load",d),l.addEventListener("error",d))}}var u0=0;function v9(o,l){return o.stylesheets&&o.count===0&&ep(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var p=setTimeout(function(){if(o.stylesheets&&ep(o,o.stylesheets),o.unsuspend){var E=o.unsuspend;o.unsuspend=null,E()}},6e4+l);0<o.imgBytes&&u0===0&&(u0=62500*Jk());var S=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&ep(o,o.stylesheets),o.unsuspend)){var E=o.unsuspend;o.unsuspend=null,E()}},(o.imgBytes>u0?50:800)+l);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(S)}}:null}function Qm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Jm=null;function ep(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Jm=new Map,l.forEach(b9,o),Jm=null,Qm.call(o))}function b9(o,l){if(!(l.state.loading&4)){var d=Jm.get(o);if(d)var p=d.get(null);else{d=new Map,Jm.set(o,d);for(var S=o.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<S.length;E++){var N=S[E];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(d.set(N.dataset.precedence,N),p=N)}p&&d.set(null,p)}S=l.instance,N=S.getAttribute("data-precedence"),E=d.get(N)||p,E===p&&d.set(null,S),d.set(N,S),this.count++,p=Qm.bind(this),S.addEventListener("load",p),S.addEventListener("error",p),E?E.parentNode.insertBefore(S,E.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(S,o.firstChild)),l.state.loading|=4}}var uf={$$typeof:_,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function S9(o,l,d,p,S,E,N,L,X){this.tag=1,this.containerInfo=o,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=Vn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vn(0),this.hiddenUpdates=Vn(null),this.identifierPrefix=p,this.onUncaughtError=S,this.onCaughtError=E,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function lj(o,l,d,p,S,E,N,L,X,de,xe,be){return o=new S9(o,l,d,N,X,de,xe,be,L),l=1,E===!0&&(l|=24),E=La(3,null,null,l),o.current=E,E.stateNode=o,l=Vx(),l.refCount++,o.pooledCache=l,l.refCount++,E.memoizedState={element:p,isDehydrated:d,cache:l},Kx(E),o}function cj(o){return o?(o=qc,o):qc}function uj(o,l,d,p,S,E){S=cj(S),p.context===null?p.context=S:p.pendingContext=S,p=Ri(l),p.payload={element:d},E=E===void 0?null:E,E!==null&&(p.callback=E),d=ji(o,p,l),d!==null&&(Sa(d,o,l),Hd(d,o,l))}function dj(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function d0(o,l){dj(o,l),(o=o.alternate)&&dj(o,l)}function fj(o){if(o.tag===13||o.tag===31){var l=Ul(o,67108864);l!==null&&Sa(l,o,67108864),d0(o,67108864)}}function hj(o){if(o.tag===13||o.tag===31){var l=Ha();l=fe(l);var d=Ul(o,l);d!==null&&Sa(d,o,l),d0(o,l)}}var tp=!0;function C9(o,l,d,p){var S=M.T;M.T=null;var E=B.p;try{B.p=2,f0(o,l,d,p)}finally{B.p=E,M.T=S}}function w9(o,l,d,p){var S=M.T;M.T=null;var E=B.p;try{B.p=8,f0(o,l,d,p)}finally{B.p=E,M.T=S}}function f0(o,l,d,p){if(tp){var S=h0(p);if(S===null)Qv(o,l,p,np,d),pj(o,p);else if(R9(S,o,l,d,p))p.stopPropagation();else if(pj(o,p),l&4&&-1<E9.indexOf(o)){for(;S!==null;){var E=on(S);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var N=In(E.pendingLanes);if(N!==0){var L=E;for(L.pendingLanes|=2,L.entangledLanes|=2;N;){var X=1<<31-kn(N);L.entanglements[1]|=X,N&=~X}eo(E),(mn&6)===0&&(Um=Re()+500,rf(0))}}break;case 31:case 13:L=Ul(E,2),L!==null&&Sa(L,E,2),Fm(),d0(E,2)}if(E=h0(p),E===null&&Qv(o,l,p,np,d),E===S)break;S=E}S!==null&&p.stopPropagation()}else Qv(o,l,p,null,d)}}function h0(o){return o=px(o),m0(o)}var np=null;function m0(o){if(np=null,o=sn(o),o!==null){var l=i(o);if(l===null)o=null;else{var d=l.tag;if(d===13){if(o=c(l),o!==null)return o;o=null}else if(d===31){if(o=u(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return np=o,null}function mj(o){switch(o){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(Te()){case $e:return 2;case mt:return 8;case st:case Xt:return 32;case sr:return 268435456;default:return 32}default:return 32}}var p0=!1,Pi=null,Ui=null,zi=null,df=new Map,ff=new Map,Fi=[],E9="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 pj(o,l){switch(o){case"focusin":case"focusout":Pi=null;break;case"dragenter":case"dragleave":Ui=null;break;case"mouseover":case"mouseout":zi=null;break;case"pointerover":case"pointerout":df.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ff.delete(l.pointerId)}}function hf(o,l,d,p,S,E){return o===null||o.nativeEvent!==E?(o={blockedOn:l,domEventName:d,eventSystemFlags:p,nativeEvent:E,targetContainers:[S]},l!==null&&(l=on(l),l!==null&&fj(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,S!==null&&l.indexOf(S)===-1&&l.push(S),o)}function R9(o,l,d,p,S){switch(l){case"focusin":return Pi=hf(Pi,o,l,d,p,S),!0;case"dragenter":return Ui=hf(Ui,o,l,d,p,S),!0;case"mouseover":return zi=hf(zi,o,l,d,p,S),!0;case"pointerover":var E=S.pointerId;return df.set(E,hf(df.get(E)||null,o,l,d,p,S)),!0;case"gotpointercapture":return E=S.pointerId,ff.set(E,hf(ff.get(E)||null,o,l,d,p,S)),!0}return!1}function gj(o){var l=sn(o.target);if(l!==null){var d=i(l);if(d!==null){if(l=d.tag,l===13){if(l=c(d),l!==null){o.blockedOn=l,Be(o.priority,function(){hj(d)});return}}else if(l===31){if(l=u(d),l!==null){o.blockedOn=l,Be(o.priority,function(){hj(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function rp(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=h0(o.nativeEvent);if(d===null){d=o.nativeEvent;var p=new d.constructor(d.type,d);mx=p,d.target.dispatchEvent(p),mx=null}else return l=on(d),l!==null&&fj(l),o.blockedOn=d,!1;l.shift()}return!0}function yj(o,l,d){rp(o)&&d.delete(l)}function j9(){p0=!1,Pi!==null&&rp(Pi)&&(Pi=null),Ui!==null&&rp(Ui)&&(Ui=null),zi!==null&&rp(zi)&&(zi=null),df.forEach(yj),ff.forEach(yj)}function ap(o,l){o.blockedOn===l&&(o.blockedOn=null,p0||(p0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,j9)))}var sp=null;function xj(o){sp!==o&&(sp=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){sp===o&&(sp=null);for(var l=0;l<o.length;l+=3){var d=o[l],p=o[l+1],S=o[l+2];if(typeof p!="function"){if(m0(p||d)===null)continue;break}var E=on(d);E!==null&&(o.splice(l,3),l-=3,hv(E,{pending:!0,data:S,method:d.method,action:p},p,S))}}))}function gu(o){function l(X){return ap(X,o)}Pi!==null&&ap(Pi,o),Ui!==null&&ap(Ui,o),zi!==null&&ap(zi,o),df.forEach(l),ff.forEach(l);for(var d=0;d<Fi.length;d++){var p=Fi[d];p.blockedOn===o&&(p.blockedOn=null)}for(;0<Fi.length&&(d=Fi[0],d.blockedOn===null);)gj(d),d.blockedOn===null&&Fi.shift();if(d=(o.ownerDocument||o).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var S=d[p],E=d[p+1],N=S[ze]||null;if(typeof E=="function")N||xj(d);else if(N){var L=null;if(E&&E.hasAttribute("formAction")){if(S=E,N=E[ze]||null)L=N.formAction;else if(m0(S)!==null)continue}else L=N.action;typeof L=="function"?d[p+1]=L:(d.splice(p,3),p-=3),xj(d)}}}function vj(){function o(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(N){return S=N})},focusReset:"manual",scroll:"manual"})}function l(){S!==null&&(S(),S=null),p||setTimeout(d,20)}function d(){if(!p&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,S=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(d,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),S!==null&&(S(),S=null)}}}function g0(o){this._internalRoot=o}op.prototype.render=g0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=Ha();uj(d,p,o,l,null,null)},op.prototype.unmount=g0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;uj(o.current,2,null,o,null,null),Fm(),l[Qe]=null}};function op(o){this._internalRoot=o}op.prototype.unstable_scheduleHydration=function(o){if(o){var l=Ae();o={blockedOn:null,target:o,priority:l};for(var d=0;d<Fi.length&&l!==0&&l<Fi[d].priority;d++);Fi.splice(d,0,o),d===0&&gj(o)}};var bj=t.version;if(bj!=="19.2.1")throw Error(r(527,bj,"19.2.1"));B.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=m(l),o=o!==null?y(o):null,o=o===null?null:o.stateNode,o};var T9={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ip=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ip.isDisabled&&ip.supportsFiber)try{Jr=ip.inject(T9),fn=ip}catch{}}return pf.createRoot=function(o,l){if(!s(o))throw Error(r(299));var d=!1,p="",S=TE,E=_E,N=NE;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(S=l.onUncaughtError),l.onCaughtError!==void 0&&(E=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError)),l=lj(o,1,!1,null,null,d,p,null,S,E,N,vj),o[Qe]=l.current,Xv(o),new g0(l)},pf.hydrateRoot=function(o,l,d){if(!s(o))throw Error(r(299));var p=!1,S="",E=TE,N=_E,L=NE,X=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(S=d.identifierPrefix),d.onUncaughtError!==void 0&&(E=d.onUncaughtError),d.onCaughtError!==void 0&&(N=d.onCaughtError),d.onRecoverableError!==void 0&&(L=d.onRecoverableError),d.formState!==void 0&&(X=d.formState)),l=lj(o,1,!0,l,d??null,p,S,X,E,N,L,vj),l.context=cj(null),d=l.current,p=Ha(),p=fe(p),S=Ri(p),S.callback=null,ji(d,S,p),d=p,l.current.lanes=d,en(l,d),eo(l),o[Qe]=l.current,Xv(o),new op(l)},pf.version="19.2.1",pf}var Aj;function z9(){if(Aj)return v0.exports;Aj=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(),v0.exports=U9(),v0.exports}var F9=z9();/**
|
|
50
|
-
* react-router v7.10.1
|
|
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 tA=e=>{throw TypeError(e)},H9=(e,t,n)=>t.has(e)||tA("Cannot "+n),w0=(e,t,n)=>(H9(e,t,"read from private field"),n?n.call(e):t.get(e)),$9=(e,t,n)=>t.has(e)?tA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Dj="popstate";function V9(e={}){function t(r,s){let{pathname:i,search:c,hash:u}=r.location;return Bf("",{pathname:i,search:c,hash:u},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:bo(s)}return B9(t,n,null,e)}function Lt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Kn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function G9(){return Math.random().toString(36).substring(2,10)}function Oj(e,t){return{usr:e.state,key:e.key,idx:t}}function Bf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?gl(t):t,state:n,key:t&&t.key||r||G9()}}function bo({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 gl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function B9(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,c=s.history,u="POP",f=null,m=y();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function y(){return(c.state||{idx:null}).idx}function g(){u="POP";let w=y(),R=w==null?null:w-m;m=w,f&&f({action:u,location:b.location,delta:R})}function x(w,R){u="PUSH";let j=Bf(b.location,w,R);m=y()+1;let _=Oj(j,m),D=b.createHref(j);try{c.pushState(_,"",D)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;s.location.assign(D)}i&&f&&f({action:u,location:b.location,delta:1})}function v(w,R){u="REPLACE";let j=Bf(b.location,w,R);m=y();let _=Oj(j,m),D=b.createHref(j);c.replaceState(_,"",D),i&&f&&f({action:u,location:b.location,delta:0})}function C(w){return nA(w)}let b={get action(){return u},get location(){return e(s,c)},listen(w){if(f)throw new Error("A history only accepts one active listener");return s.addEventListener(Dj,g),f=w,()=>{s.removeEventListener(Dj,g),f=null}},createHref(w){return t(s,w)},createURL:C,encodeLocation(w){let R=C(w);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:v,go(w){return c.go(w)}};return b}function nA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Lt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:bo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Nf,Ij=class{constructor(e){if($9(this,Nf,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(w0(this,Nf).has(e))return w0(this,Nf).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){w0(this,Nf).set(e,t)}};Nf=new WeakMap;var q9=new Set(["lazy","caseSensitive","path","id","index","children"]);function K9(e){return q9.has(e)}var Z9=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Y9(e){return Z9.has(e)}function W9(e){return e.index===!0}function qf(e,t,n=[],r={},s=!1){return e.map((i,c)=>{let u=[...n,String(c)],f=typeof i.id=="string"?i.id:u.join("-");if(Lt(i.index!==!0||!i.children,"Cannot specify children on an index route"),Lt(s||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),W9(i)){let m={...i,id:f};return r[f]=Mj(m,t(m)),m}else{let m={...i,id:f,children:void 0};return r[f]=Mj(m,t(m)),i.children&&(m.children=qf(i.children,t,u,r,s)),m}})}function Mj(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Zi(e,t,n="/"){return Af(e,t,n,!1)}function Af(e,t,n,r){let s=typeof t=="string"?gl(t):t,i=ys(s.pathname||"/",n);if(i==null)return null;let c=rA(e);Q9(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let m=c7(i);u=i7(c[f],m,r)}return u}function X9(e,t){let{route:n,pathname:r,params:s}=e;return{id:n.id,pathname:r,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function rA(e,t=[],n=[],r="",s=!1){let i=(c,u,f=s,m)=>{let y={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&f)return;Lt(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let g=ho([r,y.relativePath]),x=n.concat(y);c.children&&c.children.length>0&&(Lt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),rA(c.children,t,x,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:s7(g,c.index),routesMeta:x})};return e.forEach((c,u)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))i(c,u);else for(let m of aA(c.path))i(c,u,!0,m)}),t}function aA(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let c=aA(r.join("/")),u=[];return u.push(...c.map(f=>f===""?i:[i,f].join("/"))),s&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function Q9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:o7(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var J9=/^:[\w-]+$/,e7=3,t7=2,n7=1,r7=10,a7=-2,kj=e=>e==="*";function s7(e,t){let n=e.split("/"),r=n.length;return n.some(kj)&&(r+=a7),t&&(r+=t7),n.filter(s=>!kj(s)).reduce((s,i)=>s+(J9.test(i)?e7:i===""?n7:r7),r)}function o7(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function i7(e,t,n=!1){let{routesMeta:r}=e,s={},i="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],m=u===r.length-1,y=i==="/"?t:t.slice(i.length)||"/",g=eg({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},y),x=f.route;if(!g&&m&&n&&!r[r.length-1].route.index&&(g=eg({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},y)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:ho([i,g.pathname]),pathnameBase:h7(ho([i,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(i=ho([i,g.pathnameBase]))}return c}function eg(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=l7(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],c=i.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((m,{paramName:y,isOptional:g},x)=>{if(y==="*"){let C=u[x]||"";c=i.slice(0,i.length-C.length).replace(/(.)\/+$/,"$1")}const v=u[x];return g&&!v?m[y]=void 0:m[y]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:i,pathnameBase:c,pattern:e}}function l7(e,t=!1,n=!0){Kn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function c7(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Kn(!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 ys(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function u7({basename:e,pathname:t}){return t==="/"?e:ho([e,t])}var d7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bg=e=>d7.test(e);function f7(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?gl(e):e,i;if(n)if(Bg(n))i=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Kn(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?i=Lj(n.substring(1),"/"):i=Lj(n,t)}else i=t;return{pathname:i,search:m7(r),hash:p7(s)}}function Lj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function E0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function sA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qg(e){let t=sA(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Kg(e,t,n,r=!1){let s;typeof e=="string"?s=gl(e):(s={...e},Lt(!s.pathname||!s.pathname.includes("?"),E0("?","pathname","search",s)),Lt(!s.pathname||!s.pathname.includes("#"),E0("#","pathname","hash",s)),Lt(!s.search||!s.search.includes("#"),E0("#","search","hash",s)));let i=e===""||s.pathname==="",c=i?"/":s.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}u=g>=0?t[g]:"/"}let f=f7(s,u),m=c&&c!=="/"&&c.endsWith("/"),y=(i||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||y)&&(f.pathname+="/"),f}var ho=e=>e.join("/").replace(/\/\/+/g,"/"),h7=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),m7=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,p7=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Zg=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Kf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function fh(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ji=Symbol("Uninstrumented");function g7(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:t.id,index:t.index,path:t.path,instrument(i){let c=Object.keys(n);for(let u of c)i[u]&&n[u].push(i[u])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let s=ku(n.lazy,t.lazy,()=>{});s&&(r.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(i=>{let c=s[i],u=n[`lazy.${i}`];if(typeof c=="function"&&u.length>0){let f=ku(u,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[i]:f}))}})}return["loader","action"].forEach(s=>{let i=t[s];if(typeof i=="function"&&n[s].length>0){let c=i[Ji]??i,u=ku(n[s],c,(...f)=>Pj(f[0]));u&&(u[Ji]=c,r[s]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let i=s[Ji]??s,c=ku(n.middleware,i,(...u)=>Pj(u[0]));return c?(c[Ji]=i,c):s})),r}function y7(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(s){let i=Object.keys(s);for(let c of i)s[c]&&n[c].push(s[c])}})),n.navigate.length>0){let r=e.navigate[Ji]??e.navigate,s=ku(n.navigate,r,(...i)=>{let[c,u]=i;return{to:typeof c=="number"||typeof c=="string"?c:c?bo(c):".",...Uj(e,u??{})}});s&&(s[Ji]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[Ji]??e.fetch,s=ku(n.fetch,r,(...i)=>{let[c,,u,f]=i;return{href:u??".",fetcherKey:c,...Uj(e,f??{})}});s&&(s[Ji]=r,e.fetch=s)}return e}function ku(e,t,n){return e.length===0?null:async(...r)=>{let s=await oA(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function oA(e,t,n,r){let s=e[r],i;if(s){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=oA(e,t,n,r-1),i=await c,Lt(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await s(u,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await u(),await c}else try{i={type:"success",value:await n()}}catch(c){i={type:"error",value:c}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Pj(e){let{request:t,context:n,params:r,unstable_pattern:s}=e;return{request:x7(t),params:{...r},unstable_pattern:s,context:v7(n)}}function Uj(e,t){return{currentUrl:bo(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function x7(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function v7(e){if(S7(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var b7=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function S7(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===b7}var iA=["POST","PUT","PATCH","DELETE"],C7=new Set(iA),w7=["GET",...iA],E7=new Set(w7),R7=new Set([301,302,303,307,308]),j7=new Set([307,308]),R0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},T7={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},_7=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),lA="remix-router-transitions",cA=Symbol("ResetLoaderData");function N7(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";Lt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||_7,i=s;if(e.unstable_instrumentations){let W=e.unstable_instrumentations;i=ee=>({...s(ee),...g7(W.map(fe=>fe.route).filter(Boolean),ee)})}let c={},u=qf(e.routes,i,void 0,c),f,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let y=e.dataStrategy||M7,g={...e.future},x=null,v=new Set,C=null,b=null,w=null,R=e.hydrationData!=null,j=Zi(u,e.history.location,m),_=!1,D=null,O;if(j==null&&!e.patchRoutesOnNavigation){let W=hs(404,{pathname:e.history.location.pathname}),{matches:ee,route:fe}=lp(u);O=!0,j=ee,D={[fe.id]:W}}else if(j&&!e.hydrationData&&qt(j,u,e.history.location.pathname).active&&(j=null),j)if(j.some(W=>W.route.lazy))O=!1;else if(!j.some(W=>Xb(W.route)))O=!0;else{let W=e.hydrationData?e.hydrationData.loaderData:null,ee=e.hydrationData?e.hydrationData.errors:null;if(ee){let fe=j.findIndex(Se=>ee[Se.route.id]!==void 0);O=j.slice(0,fe+1).every(Se=>!I1(Se.route,W,ee))}else O=j.every(fe=>!I1(fe.route,W,ee))}else{O=!1,j=[];let W=qt(null,u,e.history.location.pathname);W.active&&W.matches&&(_=!0,j=W.matches)}let A,T={historyAction:e.history.action,location:e.history.location,matches:j,initialized:O,navigation:R0,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||D,fetchers:new Map,blockers:new Map},I="POP",k=null,V=!1,U,K=!1,G=new Map,q=null,H=!1,M=!1,B=new Set,$=new Map,re=0,ge=-1,P=new Map,z=new Set,F=new Map,Z=new Map,Q=new Set,le=new Map,J,ie=null;function ye(){if(x=e.history.listen(({action:W,location:ee,delta:fe})=>{if(J){J(),J=void 0;return}Kn(le.size===0||fe!=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 Se=Es({currentLocation:T.location,nextLocation:ee,historyAction:W});if(Se&&fe!=null){let Ae=new Promise(Be=>{J=Be});e.history.go(fe*-1),Da(Se,{state:"blocked",location:ee,proceed(){Da(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:ee}),Ae.then(()=>e.history.go(fe))},reset(){let Be=new Map(T.blockers);Be.set(Se,gf),Ee({blockers:Be})}}),k==null||k.resolve(),k=null;return}return Pt(W,ee)}),n){W7(t,G);let W=()=>X7(t,G);t.addEventListener("pagehide",W),q=()=>t.removeEventListener("pagehide",W)}return T.initialized||Pt("POP",T.location,{initialHydration:!0}),A}function Ce(){x&&x(),q&&q(),v.clear(),U&&U.abort(),T.fetchers.forEach((W,ee)=>Or(ee)),T.blockers.forEach((W,ee)=>ea(ee))}function He(W){return v.add(W),()=>v.delete(W)}function Ee(W,ee={}){W.matches&&(W.matches=W.matches.map(Ae=>{let Be=c[Ae.route.id],Fe=Ae.route;return Fe.element!==Be.element||Fe.errorElement!==Be.errorElement||Fe.hydrateFallbackElement!==Be.hydrateFallbackElement?{...Ae,route:Be}:Ae})),T={...T,...W};let fe=[],Se=[];T.fetchers.forEach((Ae,Be)=>{Ae.state==="idle"&&(Q.has(Be)?fe.push(Be):Se.push(Be))}),Q.forEach(Ae=>{!T.fetchers.has(Ae)&&!$.has(Ae)&&fe.push(Ae)}),[...v].forEach(Ae=>Ae(T,{deletedFetchers:fe,newErrors:W.errors??null,viewTransitionOpts:ee.viewTransitionOpts,flushSync:ee.flushSync===!0})),fe.forEach(Ae=>Or(Ae)),Se.forEach(Ae=>T.fetchers.delete(Ae))}function Ke(W,ee,{flushSync:fe}={}){var at,tt;let Se=T.actionData!=null&&T.navigation.formMethod!=null&&ra(T.navigation.formMethod)&&T.navigation.state==="loading"&&((at=W.state)==null?void 0:at._isRedirect)!==!0,Ae;ee.actionData?Object.keys(ee.actionData).length>0?Ae=ee.actionData:Ae=null:Se?Ae=T.actionData:Ae=null;let Be=ee.loaderData?Zj(T.loaderData,ee.loaderData,ee.matches||[],ee.errors):T.loaderData,Fe=T.blockers;Fe.size>0&&(Fe=new Map(Fe),Fe.forEach((pt,hn)=>Fe.set(hn,gf)));let Le=H?!1:Qt(W,ee.matches||T.matches),ze=V===!0||T.navigation.formMethod!=null&&ra(T.navigation.formMethod)&&((tt=W.state)==null?void 0:tt._isRedirect)!==!0;f&&(u=f,f=void 0),H||I==="POP"||(I==="PUSH"?e.history.push(W,W.state):I==="REPLACE"&&e.history.replace(W,W.state));let Qe;if(I==="POP"){let pt=G.get(T.location.pathname);pt&&pt.has(W.pathname)?Qe={currentLocation:T.location,nextLocation:W}:G.has(W.pathname)&&(Qe={currentLocation:W,nextLocation:T.location})}else if(K){let pt=G.get(T.location.pathname);pt?pt.add(W.pathname):(pt=new Set([W.pathname]),G.set(T.location.pathname,pt)),Qe={currentLocation:T.location,nextLocation:W}}Ee({...ee,actionData:Ae,loaderData:Be,historyAction:I,location:W,initialized:!0,navigation:R0,revalidation:"idle",restoreScrollPosition:Le,preventScrollReset:ze,blockers:Fe},{viewTransitionOpts:Qe,flushSync:fe===!0}),I="POP",V=!1,K=!1,H=!1,M=!1,k==null||k.resolve(),k=null,ie==null||ie.resolve(),ie=null}async function nt(W,ee){if(k==null||k.resolve(),k=null,typeof W=="number"){k||(k=Qj());let hn=k.promise;return e.history.go(W),hn}let fe=O1(T.location,T.matches,m,W,ee==null?void 0:ee.fromRouteId,ee==null?void 0:ee.relative),{path:Se,submission:Ae,error:Be}=zj(!1,fe,ee),Fe=T.location,Le=Bf(T.location,Se,ee&&ee.state);Le={...Le,...e.history.encodeLocation(Le)};let ze=ee&&ee.replace!=null?ee.replace:void 0,Qe="PUSH";ze===!0?Qe="REPLACE":ze===!1||Ae!=null&&ra(Ae.formMethod)&&Ae.formAction===T.location.pathname+T.location.search&&(Qe="REPLACE");let at=ee&&"preventScrollReset"in ee?ee.preventScrollReset===!0:void 0,tt=(ee&&ee.flushSync)===!0,pt=Es({currentLocation:Fe,nextLocation:Le,historyAction:Qe});if(pt){Da(pt,{state:"blocked",location:Le,proceed(){Da(pt,{state:"proceeding",proceed:void 0,reset:void 0,location:Le}),nt(W,ee)},reset(){let hn=new Map(T.blockers);hn.set(pt,gf),Ee({blockers:hn})}});return}await Pt(Qe,Le,{submission:Ae,pendingError:Be,preventScrollReset:at,replace:ee&&ee.replace,enableViewTransition:ee&&ee.viewTransition,flushSync:tt})}function Ft(){ie||(ie=Qj()),mt(),Ee({revalidation:"loading"});let W=ie.promise;return T.navigation.state==="submitting"?W:T.navigation.state==="idle"?(Pt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),W):(Pt(I||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:K===!0}),W)}async function Pt(W,ee,fe){U&&U.abort(),U=null,I=W,H=(fe&&fe.startUninterruptedRevalidation)===!0,Bt(T.location,T.matches),V=(fe&&fe.preventScrollReset)===!0,K=(fe&&fe.enableViewTransition)===!0;let Se=f||u,Ae=fe&&fe.overrideNavigation,Be=fe!=null&&fe.initialHydration&&T.matches&&T.matches.length>0&&!_?T.matches:Zi(Se,ee,m),Fe=(fe&&fe.flushSync)===!0;if(Be&&T.initialized&&!M&&$7(T.location,ee)&&!(fe&&fe.submission&&ra(fe.submission.formMethod))){Ke(ee,{matches:Be},{flushSync:Fe});return}let Le=qt(Be,Se,ee.pathname);if(Le.active&&Le.matches&&(Be=Le.matches),!Be){let{error:Zn,notFoundMatches:sn,route:on}=wn(ee.pathname);Ke(ee,{matches:sn,loaderData:{},errors:{[on.id]:Zn}},{flushSync:Fe});return}U=new AbortController;let ze=ju(e.history,ee,U.signal,fe&&fe.submission),Qe=e.getContext?await e.getContext():new Ij,at;if(fe&&fe.pendingError)at=[Yi(Be).route.id,{type:"error",error:fe.pendingError}];else if(fe&&fe.submission&&ra(fe.submission.formMethod)){let Zn=await On(ze,ee,fe.submission,Be,Qe,Le.active,fe&&fe.initialHydration===!0,{replace:fe.replace,flushSync:Fe});if(Zn.shortCircuited)return;if(Zn.pendingActionResult){let[sn,on]=Zn.pendingActionResult;if(Va(on)&&Kf(on.error)&&on.error.status===404){U=null,Ke(ee,{matches:Zn.matches,loaderData:{},errors:{[sn]:on.error}});return}}Be=Zn.matches||Be,at=Zn.pendingActionResult,Ae=j0(ee,fe.submission),Fe=!1,Le.active=!1,ze=ju(e.history,ze.url,ze.signal)}let{shortCircuited:tt,matches:pt,loaderData:hn,errors:Ln}=await yn(ze,ee,Be,Qe,Le.active,Ae,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,fe&&fe.initialHydration===!0,Fe,at);tt||(U=null,Ke(ee,{matches:pt||Be,...Yj(at),loaderData:hn,errors:Ln}))}async function On(W,ee,fe,Se,Ae,Be,Fe,Le={}){mt();let ze=Z7(ee,fe);if(Ee({navigation:ze},{flushSync:Le.flushSync===!0}),Be){let tt=await Vn(Se,ee.pathname,W.signal);if(tt.type==="aborted")return{shortCircuited:!0};if(tt.type==="error"){if(tt.partialMatches.length===0){let{matches:hn,route:Ln}=lp(u);return{matches:hn,pendingActionResult:[Ln.id,{type:"error",error:tt.error}]}}let pt=Yi(tt.partialMatches).route.id;return{matches:tt.partialMatches,pendingActionResult:[pt,{type:"error",error:tt.error}]}}else if(tt.matches)Se=tt.matches;else{let{notFoundMatches:pt,error:hn,route:Ln}=wn(ee.pathname);return{matches:pt,pendingActionResult:[Ln.id,{type:"error",error:hn}]}}}let Qe,at=zp(Se,ee);if(!at.route.action&&!at.route.lazy)Qe={type:"error",error:hs(405,{method:W.method,pathname:ee.pathname,routeId:at.route.id})};else{let tt=Uu(i,c,W,Se,at,Fe?[]:r,Ae),pt=await Te(W,tt,Ae,null);if(Qe=pt[at.route.id],!Qe){for(let hn of Se)if(pt[hn.route.id]){Qe=pt[hn.route.id];break}}if(W.signal.aborted)return{shortCircuited:!0}}if(nc(Qe)){let tt;return Le&&Le.replace!=null?tt=Le.replace:tt=Bj(Qe.response.headers.get("Location"),new URL(W.url),m)===T.location.pathname+T.location.search,await Re(W,Qe,!0,{submission:fe,replace:tt}),{shortCircuited:!0}}if(Va(Qe)){let tt=Yi(Se,at.route.id);return(Le&&Le.replace)!==!0&&(I="PUSH"),{matches:Se,pendingActionResult:[tt.route.id,Qe,at.route.id]}}return{matches:Se,pendingActionResult:[at.route.id,Qe]}}async function yn(W,ee,fe,Se,Ae,Be,Fe,Le,ze,Qe,at,tt){let pt=Be||j0(ee,Fe),hn=Fe||Le||Xj(pt),Ln=!H&&!Qe;if(Ae){if(Ln){let jr=ke(tt);Ee({navigation:pt,...jr!==void 0?{actionData:jr}:{}},{flushSync:at})}let Ht=await Vn(fe,ee.pathname,W.signal);if(Ht.type==="aborted")return{shortCircuited:!0};if(Ht.type==="error"){if(Ht.partialMatches.length===0){let{matches:Rs,route:rs}=lp(u);return{matches:Rs,loaderData:{},errors:{[rs.id]:Ht.error}}}let jr=Yi(Ht.partialMatches).route.id;return{matches:Ht.partialMatches,loaderData:{},errors:{[jr]:Ht.error}}}else if(Ht.matches)fe=Ht.matches;else{let{error:jr,notFoundMatches:Rs,route:rs}=wn(ee.pathname);return{matches:Rs,loaderData:{},errors:{[rs.id]:jr}}}}let Zn=f||u,{dsMatches:sn,revalidatingFetchers:on}=Fj(W,Se,i,c,e.history,T,fe,hn,ee,Qe?[]:r,Qe===!0,M,B,Q,F,z,Zn,m,e.patchRoutesOnNavigation!=null,tt);if(ge=++re,!e.dataStrategy&&!sn.some(Ht=>Ht.shouldLoad)&&!sn.some(Ht=>Ht.route.middleware&&Ht.route.middleware.length>0)&&on.length===0){let Ht=kn();return Ke(ee,{matches:fe,loaderData:{},errors:tt&&Va(tt[1])?{[tt[0]]:tt[1].error}:null,...Yj(tt),...Ht?{fetchers:new Map(T.fetchers)}:{}},{flushSync:at}),{shortCircuited:!0}}if(Ln){let Ht={};if(!Ae){Ht.navigation=pt;let jr=ke(tt);jr!==void 0&&(Ht.actionData=jr)}on.length>0&&(Ht.fetchers=Y(on)),Ee(Ht,{flushSync:at})}on.forEach(Ht=>{fn(Ht.key),Ht.controller&&$.set(Ht.key,Ht.controller)});let Oa=()=>on.forEach(Ht=>fn(Ht.key));U&&U.signal.addEventListener("abort",Oa);let{loaderResults:ns,fetcherResults:An}=await $e(sn,on,W,Se);if(W.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",Oa),on.forEach(Ht=>$.delete(Ht.key));let Ia=cp(ns);if(Ia)return await Re(W,Ia.result,!0,{replace:ze}),{shortCircuited:!0};if(Ia=cp(An),Ia)return z.add(Ia.key),await Re(W,Ia.result,!0,{replace:ze}),{shortCircuited:!0};let{loaderData:Lc,errors:Ma}=Kj(T,fe,ns,tt,on,An);Qe&&T.errors&&(Ma={...T.errors,...Ma});let pa=kn(),Pc=Ws(ge),Ml=pa||Pc||on.length>0;return{matches:fe,loaderData:Lc,errors:Ma,...Ml?{fetchers:new Map(T.fetchers)}:{}}}function ke(W){if(W&&!Va(W[1]))return{[W[0]]:W[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Y(W){return W.forEach(ee=>{let fe=T.fetchers.get(ee.key),Se=yf(void 0,fe?fe.data:void 0);T.fetchers.set(ee.key,Se)}),new Map(T.fetchers)}async function ne(W,ee,fe,Se){fn(W);let Ae=(Se&&Se.flushSync)===!0,Be=f||u,Fe=O1(T.location,T.matches,m,fe,ee,Se==null?void 0:Se.relative),Le=Zi(Be,Fe,m),ze=qt(Le,Be,Fe);if(ze.active&&ze.matches&&(Le=ze.matches),!Le){Xt(W,ee,hs(404,{pathname:Fe}),{flushSync:Ae});return}let{path:Qe,submission:at,error:tt}=zj(!0,Fe,Se);if(tt){Xt(W,ee,tt,{flushSync:Ae});return}let pt=e.getContext?await e.getContext():new Ij,hn=(Se&&Se.preventScrollReset)===!0;if(at&&ra(at.formMethod)){await ce(W,ee,Qe,Le,pt,ze.active,Ae,hn,at);return}F.set(W,{routeId:ee,path:Qe}),await Ie(W,ee,Qe,Le,pt,ze.active,Ae,hn,at)}async function ce(W,ee,fe,Se,Ae,Be,Fe,Le,ze){mt(),F.delete(W);let Qe=T.fetchers.get(W);st(W,Y7(ze,Qe),{flushSync:Fe});let at=new AbortController,tt=ju(e.history,fe,at.signal,ze);if(Be){let ln=await Vn(Se,new URL(tt.url).pathname,tt.signal,W);if(ln.type==="aborted")return;if(ln.type==="error"){Xt(W,ee,ln.error,{flushSync:Fe});return}else if(ln.matches)Se=ln.matches;else{Xt(W,ee,hs(404,{pathname:fe}),{flushSync:Fe});return}}let pt=zp(Se,fe);if(!pt.route.action&&!pt.route.lazy){let ln=hs(405,{method:ze.formMethod,pathname:fe,routeId:ee});Xt(W,ee,ln,{flushSync:Fe});return}$.set(W,at);let hn=re,Ln=Uu(i,c,tt,Se,pt,r,Ae),Zn=await Te(tt,Ln,Ae,W),sn=Zn[pt.route.id];if(!sn){for(let ln of Ln)if(Zn[ln.route.id]){sn=Zn[ln.route.id];break}}if(tt.signal.aborted){$.get(W)===at&&$.delete(W);return}if(Q.has(W)){if(nc(sn)||Va(sn)){st(W,Zo(void 0));return}}else{if(nc(sn))if($.delete(W),ge>hn){st(W,Zo(void 0));return}else return z.add(W),st(W,yf(ze)),Re(tt,sn,!1,{fetcherSubmission:ze,preventScrollReset:Le});if(Va(sn)){Xt(W,ee,sn.error);return}}let on=T.navigation.location||T.location,Oa=ju(e.history,on,at.signal),ns=f||u,An=T.navigation.state!=="idle"?Zi(ns,T.navigation.location,m):T.matches;Lt(An,"Didn't find any matches after fetcher action");let Ia=++re;P.set(W,Ia);let Lc=yf(ze,sn.data);T.fetchers.set(W,Lc);let{dsMatches:Ma,revalidatingFetchers:pa}=Fj(Oa,Ae,i,c,e.history,T,An,ze,on,r,!1,M,B,Q,F,z,ns,m,e.patchRoutesOnNavigation!=null,[pt.route.id,sn]);pa.filter(ln=>ln.key!==W).forEach(ln=>{let Ir=ln.key,Rd=T.fetchers.get(Ir),cx=yf(void 0,Rd?Rd.data:void 0);T.fetchers.set(Ir,cx),fn(Ir),ln.controller&&$.set(Ir,ln.controller)}),Ee({fetchers:new Map(T.fetchers)});let Pc=()=>pa.forEach(ln=>fn(ln.key));at.signal.addEventListener("abort",Pc);let{loaderResults:Ml,fetcherResults:Ht}=await $e(Ma,pa,Oa,Ae);if(at.signal.aborted)return;if(at.signal.removeEventListener("abort",Pc),P.delete(W),$.delete(W),pa.forEach(ln=>$.delete(ln.key)),T.fetchers.has(W)){let ln=Zo(sn.data);T.fetchers.set(W,ln)}let jr=cp(Ml);if(jr)return Re(Oa,jr.result,!1,{preventScrollReset:Le});if(jr=cp(Ht),jr)return z.add(jr.key),Re(Oa,jr.result,!1,{preventScrollReset:Le});let{loaderData:Rs,errors:rs}=Kj(T,An,Ml,void 0,pa,Ht);Ws(Ia),T.navigation.state==="loading"&&Ia>ge?(Lt(I,"Expected pending action"),U&&U.abort(),Ke(T.navigation.location,{matches:An,loaderData:Rs,errors:rs,fetchers:new Map(T.fetchers)})):(Ee({errors:rs,loaderData:Zj(T.loaderData,Rs,An,rs),fetchers:new Map(T.fetchers)}),M=!1)}async function Ie(W,ee,fe,Se,Ae,Be,Fe,Le,ze){let Qe=T.fetchers.get(W);st(W,yf(ze,Qe?Qe.data:void 0),{flushSync:Fe});let at=new AbortController,tt=ju(e.history,fe,at.signal);if(Be){let on=await Vn(Se,new URL(tt.url).pathname,tt.signal,W);if(on.type==="aborted")return;if(on.type==="error"){Xt(W,ee,on.error,{flushSync:Fe});return}else if(on.matches)Se=on.matches;else{Xt(W,ee,hs(404,{pathname:fe}),{flushSync:Fe});return}}let pt=zp(Se,fe);$.set(W,at);let hn=re,Ln=Uu(i,c,tt,Se,pt,r,Ae),sn=(await Te(tt,Ln,Ae,W))[pt.route.id];if($.get(W)===at&&$.delete(W),!tt.signal.aborted){if(Q.has(W)){st(W,Zo(void 0));return}if(nc(sn))if(ge>hn){st(W,Zo(void 0));return}else{z.add(W),await Re(tt,sn,!1,{preventScrollReset:Le});return}if(Va(sn)){Xt(W,ee,sn.error);return}st(W,Zo(sn.data))}}async function Re(W,ee,fe,{submission:Se,fetcherSubmission:Ae,preventScrollReset:Be,replace:Fe}={}){fe||(k==null||k.resolve(),k=null),ee.response.headers.has("X-Remix-Revalidate")&&(M=!0);let Le=ee.response.headers.get("Location");Lt(Le,"Expected a Location header on the redirect Response"),Le=Bj(Le,new URL(W.url),m);let ze=Bf(T.location,Le,{_isRedirect:!0});if(n){let Ln=!1;if(ee.response.headers.has("X-Remix-Reload-Document"))Ln=!0;else if(Bg(Le)){const Zn=nA(Le,!0);Ln=Zn.origin!==t.location.origin||ys(Zn.pathname,m)==null}if(Ln){Fe?t.location.replace(Le):t.location.assign(Le);return}}U=null;let Qe=Fe===!0||ee.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:at,formAction:tt,formEncType:pt}=T.navigation;!Se&&!Ae&&at&&tt&&pt&&(Se=Xj(T.navigation));let hn=Se||Ae;if(j7.has(ee.response.status)&&hn&&ra(hn.formMethod))await Pt(Qe,ze,{submission:{...hn,formAction:Le},preventScrollReset:Be||V,enableViewTransition:fe?K:void 0});else{let Ln=j0(ze,Se);await Pt(Qe,ze,{overrideNavigation:Ln,fetcherSubmission:Ae,preventScrollReset:Be||V,enableViewTransition:fe?K:void 0})}}async function Te(W,ee,fe,Se){let Ae,Be={};try{Ae=await L7(y,W,ee,Se,fe,!1)}catch(Fe){return ee.filter(Le=>Le.shouldLoad).forEach(Le=>{Be[Le.route.id]={type:"error",error:Fe}}),Be}if(W.signal.aborted)return Be;for(let[Fe,Le]of Object.entries(Ae))if(q7(Le)){let ze=Le.result;Be[Fe]={type:"redirect",response:F7(ze,W,Fe,ee,m)}}else Be[Fe]=await z7(Le);return Be}async function $e(W,ee,fe,Se){let Ae=Te(fe,W,Se,null),Be=Promise.all(ee.map(async ze=>{if(ze.matches&&ze.match&&ze.request&&ze.controller){let at=(await Te(ze.request,ze.matches,Se,ze.key))[ze.match.route.id];return{[ze.key]:at}}else return Promise.resolve({[ze.key]:{type:"error",error:hs(404,{pathname:ze.path})}})})),Fe=await Ae,Le=(await Be).reduce((ze,Qe)=>Object.assign(ze,Qe),{});return{loaderResults:Fe,fetcherResults:Le}}function mt(){M=!0,F.forEach((W,ee)=>{$.has(ee)&&B.add(ee),fn(ee)})}function st(W,ee,fe={}){T.fetchers.set(W,ee),Ee({fetchers:new Map(T.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function Xt(W,ee,fe,Se={}){let Ae=Yi(T.matches,ee);Or(W),Ee({errors:{[Ae.route.id]:fe},fetchers:new Map(T.fetchers)},{flushSync:(Se&&Se.flushSync)===!0})}function sr(W){return Z.set(W,(Z.get(W)||0)+1),Q.has(W)&&Q.delete(W),T.fetchers.get(W)||T7}function $n(W,ee){fn(W,ee==null?void 0:ee.reason),st(W,Zo(null))}function Or(W){let ee=T.fetchers.get(W);$.has(W)&&!(ee&&ee.state==="loading"&&P.has(W))&&fn(W),F.delete(W),P.delete(W),z.delete(W),Q.delete(W),B.delete(W),T.fetchers.delete(W)}function Jr(W){let ee=(Z.get(W)||0)-1;ee<=0?(Z.delete(W),Q.add(W)):Z.set(W,ee),Ee({fetchers:new Map(T.fetchers)})}function fn(W,ee){let fe=$.get(W);fe&&(fe.abort(ee),$.delete(W))}function or(W){for(let ee of W){let fe=sr(ee),Se=Zo(fe.data);T.fetchers.set(ee,Se)}}function kn(){let W=[],ee=!1;for(let fe of z){let Se=T.fetchers.get(fe);Lt(Se,`Expected fetcher: ${fe}`),Se.state==="loading"&&(z.delete(fe),W.push(fe),ee=!0)}return or(W),ee}function Ws(W){let ee=[];for(let[fe,Se]of P)if(Se<W){let Ae=T.fetchers.get(fe);Lt(Ae,`Expected fetcher: ${fe}`),Ae.state==="loading"&&(fn(fe),P.delete(fe),ee.push(fe))}return or(ee),ee.length>0}function Aa(W,ee){let fe=T.blockers.get(W)||gf;return le.get(W)!==ee&&le.set(W,ee),fe}function ea(W){T.blockers.delete(W),le.delete(W)}function Da(W,ee){let fe=T.blockers.get(W)||gf;Lt(fe.state==="unblocked"&&ee.state==="blocked"||fe.state==="blocked"&&ee.state==="blocked"||fe.state==="blocked"&&ee.state==="proceeding"||fe.state==="blocked"&&ee.state==="unblocked"||fe.state==="proceeding"&&ee.state==="unblocked",`Invalid blocker state transition: ${fe.state} -> ${ee.state}`);let Se=new Map(T.blockers);Se.set(W,ee),Ee({blockers:Se})}function Es({currentLocation:W,nextLocation:ee,historyAction:fe}){if(le.size===0)return;le.size>1&&Kn(!1,"A router only supports one blocker at a time");let Se=Array.from(le.entries()),[Ae,Be]=Se[Se.length-1],Fe=T.blockers.get(Ae);if(!(Fe&&Fe.state==="proceeding")&&Be({currentLocation:W,nextLocation:ee,historyAction:fe}))return Ae}function wn(W){let ee=hs(404,{pathname:W}),fe=f||u,{matches:Se,route:Ae}=lp(fe);return{notFoundMatches:Se,route:Ae,error:ee}}function In(W,ee,fe){if(C=W,w=ee,b=fe||null,!R&&T.navigation===R0){R=!0;let Se=Qt(T.location,T.matches);Se!=null&&Ee({restoreScrollPosition:Se})}return()=>{C=null,w=null,b=null}}function We(W,ee){return b&&b(W,ee.map(Se=>X9(Se,T.loaderData)))||W.key}function Bt(W,ee){if(C&&w){let fe=We(W,ee);C[fe]=w()}}function Qt(W,ee){if(C){let fe=We(W,ee),Se=C[fe];if(typeof Se=="number")return Se}return null}function qt(W,ee,fe){if(e.patchRoutesOnNavigation)if(W){if(Object.keys(W[0].params).length>0)return{active:!0,matches:Af(ee,fe,m,!0)}}else return{active:!0,matches:Af(ee,fe,m,!0)||[]};return{active:!1,matches:null}}async function Vn(W,ee,fe,Se){if(!e.patchRoutesOnNavigation)return{type:"success",matches:W};let Ae=W;for(;;){let Be=f==null,Fe=f||u,Le=c;try{await e.patchRoutesOnNavigation({signal:fe,path:ee,matches:Ae,fetcherKey:Se,patch:(at,tt)=>{fe.aborted||Hj(at,tt,Fe,Le,i,!1)}})}catch(at){return{type:"error",error:at,partialMatches:Ae}}finally{Be&&!fe.aborted&&(u=[...u])}if(fe.aborted)return{type:"aborted"};let ze=Zi(Fe,ee,m),Qe=null;if(ze){if(Object.keys(ze[0].params).length===0)return{type:"success",matches:ze};if(Qe=Af(Fe,ee,m,!0),!(Qe&&Ae.length<Qe.length&&en(Ae,Qe.slice(0,Ae.length))))return{type:"success",matches:ze}}if(Qe||(Qe=Af(Fe,ee,m,!0)),!Qe||en(Ae,Qe))return{type:"success",matches:null};Ae=Qe}}function en(W,ee){return W.length===ee.length&&W.every((fe,Se)=>fe.route.id===ee[Se].route.id)}function Jt(W){c={},f=qf(W,i,void 0,c)}function Rr(W,ee,fe=!1){let Se=f==null;Hj(W,ee,f||u,c,i,fe),Se&&(u=[...u],Ee({}))}return A={get basename(){return m},get future(){return g},get state(){return T},get routes(){return u},get window(){return t},initialize:ye,subscribe:He,enableScrollRestoration:In,navigate:nt,fetch:ne,revalidate:Ft,createHref:W=>e.history.createHref(W),encodeLocation:W=>e.history.encodeLocation(W),getFetcher:sr,resetFetcher:$n,deleteFetcher:Jr,dispose:Ce,getBlocker:Aa,deleteBlocker:ea,patchRoutes:Rr,_internalFetchControllers:$,_internalSetRoutes:Jt,_internalSetStateDoNotUseOrYouWillBreakYourApp(W){Ee(W)}},e.unstable_instrumentations&&(A=y7(A,e.unstable_instrumentations.map(W=>W.router).filter(Boolean))),A}function A7(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function O1(e,t,n,r,s,i){let c,u;if(s){c=[];for(let m of t)if(c.push(m),m.route.id===s){u=m;break}}else c=t,u=t[t.length-1];let f=Kg(r||".",qg(c),ys(e.pathname,n)||e.pathname,i==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let m=Qb(f.search);if(u.route.index&&!m)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&m){let y=new URLSearchParams(f.search),g=y.getAll("index");y.delete("index"),g.filter(v=>v).forEach(v=>y.append("index",v));let x=y.toString();f.search=x?`?${x}`:""}}return n!=="/"&&(f.pathname=u7({basename:n,pathname:f.pathname})),bo(f)}function zj(e,t,n){if(!n||!A7(n))return{path:t};if(n.formMethod&&!K7(n.formMethod))return{path:t,error:hs(405,{method:n.formMethod})};let r=()=>({path:t,error:hs(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=pA(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ra(i))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[v,C])=>`${x}${v}=${C}
|
|
59
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!ra(i))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}Lt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=k1(n.formData),f=n.formData;else if(n.body instanceof FormData)u=k1(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=qj(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=qj(u)}catch{return r()}let m={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(ra(m.formMethod))return{path:t,submission:m};let y=gl(t);return e&&y.search&&Qb(y.search)&&u.append("index",""),y.search=`?${u}`,{path:bo(y),submission:m}}function Fj(e,t,n,r,s,i,c,u,f,m,y,g,x,v,C,b,w,R,j,_){var q;let D=_?Va(_[1])?_[1].error:_[1].data:void 0,O=s.createURL(i.location),A=s.createURL(f),T;if(y&&i.errors){let H=Object.keys(i.errors)[0];T=c.findIndex(M=>M.route.id===H)}else if(_&&Va(_[1])){let H=_[0];T=c.findIndex(M=>M.route.id===H)-1}let I=_?_[1].statusCode:void 0,k=I&&I>=400,V={currentUrl:O,currentParams:((q=i.matches[0])==null?void 0:q.params)||{},nextUrl:A,nextParams:c[0].params,...u,actionResult:D,actionStatus:I},U=fh(c),K=c.map((H,M)=>{let{route:B}=H,$=null;if(T!=null&&M>T?$=!1:B.lazy?$=!0:Xb(B)?y?$=I1(B,i.loaderData,i.errors):D7(i.loaderData,i.matches[M],H)&&($=!0):$=!1,$!==null)return M1(n,r,e,U,H,m,t,$);let re=k?!1:g||O.pathname+O.search===A.pathname+A.search||O.search!==A.search||O7(i.matches[M],H),ge={...V,defaultShouldRevalidate:re},P=tg(H,ge);return M1(n,r,e,U,H,m,t,P,ge)}),G=[];return C.forEach((H,M)=>{if(y||!c.some(Z=>Z.route.id===H.routeId)||v.has(M))return;let B=i.fetchers.get(M),$=B&&B.state!=="idle"&&B.data===void 0,re=Zi(w,H.path,R);if(!re){if(j&&$)return;G.push({key:M,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(b.has(M))return;let ge=zp(re,H.path),P=new AbortController,z=ju(s,H.path,P.signal),F=null;if(x.has(M))x.delete(M),F=Uu(n,r,z,re,ge,m,t);else if($)g&&(F=Uu(n,r,z,re,ge,m,t));else{let Z={...V,defaultShouldRevalidate:k?!1:g};tg(ge,Z)&&(F=Uu(n,r,z,re,ge,m,t,Z))}F&&G.push({key:M,routeId:H.routeId,path:H.path,matches:F,match:ge,request:z,controller:P})}),{dsMatches:K,revalidatingFetchers:G}}function Xb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function I1(e,t,n){if(e.lazy)return!0;if(!Xb(e))return!1;let r=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;return!r&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!s}function D7(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function O7(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function tg(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Hj(e,t,n,r,s,i){let c;if(e){let m=r[e];Lt(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),c=m.children}else c=n;let u=[],f=[];if(t.forEach(m=>{let y=c.find(g=>uA(m,g));y?f.push({existingRoute:y,newRoute:m}):u.push(m)}),u.length>0){let m=qf(u,s,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...m)}if(i&&f.length>0)for(let m=0;m<f.length;m++){let{existingRoute:y,newRoute:g}=f[m],x=y,[v]=qf([g],s,[],{},!0);Object.assign(x,{element:v.element?v.element:x.element,errorElement:v.errorElement?v.errorElement:x.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:x.hydrateFallbackElement})}}function uA(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,r)=>{var s;return(s=t.children)==null?void 0:s.some(i=>uA(n,i))}):!1}var $j=new WeakMap,dA=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(Lt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let i=s.lazy[e];if(!i)return;let c=$j.get(s);c||(c={},$j.set(s,c));let u=c[e];if(u)return u;let f=(async()=>{let m=K9(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)Kn(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Kn(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await i();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return c[e]=f,f},Vj=new WeakMap;function I7(e,t,n,r,s){let i=n[e.id];if(Lt(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let y=Vj.get(i);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let g=(async()=>{Lt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),v={};for(let C in x){let b=x[C];if(b===void 0)continue;let w=Y9(C),j=i[C]!==void 0&&C!=="hasErrorBoundary";w?Kn(!w,"Route property "+C+" is not a supported property to be returned from a lazy route function. This property will be ignored."):j?Kn(!j,`Route "${i.id}" has a static property "${C}" defined but its lazy function is also returning a value for this property. The lazy route property "${C}" will be ignored.`):v[C]=b}Object.assign(i,v),Object.assign(i,{...r(i),lazy:void 0})})();return Vj.set(i,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let y of c){if(s&&s.includes(y))continue;let g=dA({key:y,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),y===t&&(f=g))}let m=u.length>0?Promise.all(u).then(()=>{}):void 0;return m==null||m.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:f}}async function Gj(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,i)=>{n[t[i].route.id]=s}),n}async function M7(e){return e.matches.some(t=>t.route.middleware)?fA(e,()=>Gj(e)):Gj(e)}function fA(e,t){return k7(e,t,r=>r,G7,n);function n(r,s,i){if(i)return Promise.resolve(Object.assign(i.value,{[s]:{type:"error",result:r}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(m=>m.route.id===s),0),Math.max(c.findIndex(m=>m.shouldCallHandler()),0)),f=Yi(c,c[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function k7(e,t,n,r,s){let{matches:i,request:c,params:u,context:f,unstable_pattern:m}=e,y=i.flatMap(x=>x.route.middleware?x.route.middleware.map(v=>[x.route.id,v]):[]);return await hA({request:c,params:u,context:f,unstable_pattern:m},y,t,n,r,s)}async function hA(e,t,n,r,s,i,c=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let f=t[c];if(!f)return await n();let[m,y]=f,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await hA(e,t,n,r,s,i,c+1)},g.value}catch(v){return g={value:await i(v,m,g)},g.value}};try{let v=await y(e,x),C=v!=null?r(v):void 0;return s(C)?C:g?C??g.value:(g={value:await x()},g.value)}catch(v){return await i(v,m,g)}}function mA(e,t,n,r,s){let i=dA({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=I7(r.route,ra(n.method)?"action":"loader",t,e,s);return{middleware:i,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function M1(e,t,n,r,s,i,c,u,f=null){let m=!1,y=mA(e,t,n,s,i);return{...s,_lazyPromises:y,shouldLoad:u,shouldRevalidateArgs:f,shouldCallHandler(g){return m=!0,f?typeof g=="boolean"?tg(s,{...f,defaultShouldRevalidate:g}):tg(s,f):u},resolve(g){let{lazy:x,loader:v,middleware:C}=s.route,b=m||u||g&&!ra(n.method)&&(x||v),w=C&&C.length>0&&!v&&!x;return b&&(ra(n.method)||!w)?P7({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:y==null?void 0:y.handler,lazyRoutePromise:y==null?void 0:y.route,handlerOverride:g,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function Uu(e,t,n,r,s,i,c,u=null){return r.map(f=>f.route.id!==s.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:mA(e,t,n,f,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:M1(e,t,n,fh(r),f,i,c,!0,u))}async function L7(e,t,n,r,s,i){n.some(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(n.map(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware}));let c={request:t,unstable_pattern:fh(n),params:n[0].params,context:s,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:m=>{let y=c;return fA(y,()=>m({...y,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>{var y,g;return[(y=m._lazyPromises)==null?void 0:y.handler,(g=m._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function P7({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:i,scopedContext:c}){let u,f,m=ra(e.method),y=m?"action":"loader",g=x=>{let v,C=new Promise((R,j)=>v=j);f=()=>v(),e.signal.addEventListener("abort",f);let b=R=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${n.route.id}]`)):x({request:e,unstable_pattern:t,params:n.params,context:c},...R!==void 0?[R]:[]),w=(async()=>{try{return{type:"data",result:await(i?i(j=>b(j)):b())}}catch(R){return{type:"error",result:R}}})();return Promise.race([w,C])};try{let x=m?n.route.action:n.route.loader;if(r||s)if(x){let v,[C]=await Promise.all([g(x).catch(b=>{v=b}),r,s]);if(v!==void 0)throw v;u=C}else{await r;let v=m?n.route.action:n.route.loader;if(v)[u]=await Promise.all([g(v),s]);else if(y==="action"){let C=new URL(e.url),b=C.pathname+C.search;throw hs(405,{method:e.method,pathname:b,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(x)u=await g(x);else{let v=new URL(e.url),C=v.pathname+v.search;throw hs(404,{pathname:C})}}catch(x){return{type:"error",result:x}}finally{f&&e.signal.removeEventListener("abort",f)}return u}async function U7(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function z7(e){var r,s,i,c,u;let{result:t,type:n}=e;if(gA(t)){let f;try{f=await U7(t)}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new Zg(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?Wj(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:V7(t),statusCode:Kf(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Kf(t)?t.status:void 0}:Wj(t)?{type:"data",data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function F7(e,t,n,r,s){let i=e.headers.get("Location");if(Lt(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Bg(i)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=O1(new URL(t.url),c,s,i),e.headers.set("Location",i)}return e}function Bj(e,t,n){if(Bg(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=ys(s.pathname,n)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function ju(e,t,n,r){let s=e.createURL(pA(t)).toString(),i={signal:n};if(r&&ra(r.formMethod)){let{formMethod:c,formEncType:u}=r;i.method=c.toUpperCase(),u==="application/json"?(i.headers=new Headers({"Content-Type":u}),i.body=JSON.stringify(r.json)):u==="text/plain"?i.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?i.body=k1(r.formData):i.body=r.formData}return new Request(s,i)}function k1(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function qj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function H7(e,t,n,r=!1,s=!1){let i={},c=null,u,f=!1,m={},y=n&&Va(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let x=g.route.id,v=t[x];if(Lt(!nc(v),"Cannot handle redirect results in processLoaderData"),Va(v)){let C=v.error;if(y!==void 0&&(C=y,y=void 0),c=c||{},s)c[x]=C;else{let b=Yi(e,x);c[b.route.id]==null&&(c[b.route.id]=C)}r||(i[x]=cA),f||(f=!0,u=Kf(v.error)?v.error.status:500),v.headers&&(m[x]=v.headers)}else i[x]=v.data,v.statusCode&&v.statusCode!==200&&!f&&(u=v.statusCode),v.headers&&(m[x]=v.headers)}),y!==void 0&&n&&(c={[n[0]]:y},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:u||200,loaderHeaders:m}}function Kj(e,t,n,r,s,i){let{loaderData:c,errors:u}=H7(t,n,r);return s.filter(f=>!f.matches||f.matches.some(m=>m.shouldLoad)).forEach(f=>{let{key:m,match:y,controller:g}=f;if(g&&g.signal.aborted)return;let x=i[m];if(Lt(x,"Did not find corresponding fetcher result"),Va(x)){let v=Yi(e.matches,y==null?void 0:y.route.id);u&&u[v.route.id]||(u={...u,[v.route.id]:x.error}),e.fetchers.delete(m)}else if(nc(x))Lt(!1,"Unhandled fetcher revalidation redirect");else{let v=Zo(x.data);e.fetchers.set(m,v)}}),{loaderData:c,errors:u}}function Zj(e,t,n,r){let s=Object.entries(t).filter(([,i])=>i!==cA).reduce((i,[c,u])=>(i[c]=u,i),{});for(let i of n){let c=i.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&i.route.loader&&(s[c]=e[c]),r&&r.hasOwnProperty(c))break}return s}function Yj(e){return e?Va(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Yi(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function lp(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 hs(e,{pathname:t,routeId:n,method:r,type:s,message:i}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new Zg(e||500,c,new Error(u),!0)}function cp(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(nc(s))return{key:r,result:s}}}function pA(e){let t=typeof e=="string"?gl(e):e;return bo({...t,hash:""})}function $7(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function V7(e){var t,n;return new Zg(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function G7(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&B7(n))}function B7(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function q7(e){return gA(e.result)&&R7.has(e.result.status)}function Va(e){return e.type==="error"}function nc(e){return(e&&e.type)==="redirect"}function Wj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function gA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function K7(e){return E7.has(e.toUpperCase())}function ra(e){return C7.has(e.toUpperCase())}function Qb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function zp(e,t){let n=typeof t=="string"?gl(t).search:t.search;if(e[e.length-1].route.index&&Qb(n||""))return e[e.length-1];let r=sA(e);return r[r.length-1]}function Xj(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:i,json:c}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function j0(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 Z7(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 yf(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 Y7(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 Zo(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 W7(e,t){try{let n=e.sessionStorage.getItem(lA);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(s,new Set(i||[]))}}catch{}}function X7(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(lA,JSON.stringify(n))}catch(r){Kn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function Qj(){let e,t,n=new Promise((r,s)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{s(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Cc=h.createContext(null);Cc.displayName="DataRouter";var hh=h.createContext(null);hh.displayName="DataRouterState";h.createContext(!1);var Jb=h.createContext({isTransitioning:!1});Jb.displayName="ViewTransition";var yA=h.createContext(new Map);yA.displayName="Fetchers";var Q7=h.createContext(null);Q7.displayName="Await";var xs=h.createContext(null);xs.displayName="Navigation";var Yg=h.createContext(null);Yg.displayName="Location";var vs=h.createContext({outlet:null,matches:[],isDataRoute:!1});vs.displayName="Route";var eS=h.createContext(null);eS.displayName="RouteError";function J7(e,{relative:t}={}){Lt(od(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=h.useContext(xs),{hash:s,pathname:i,search:c}=mh(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:ho([n,i])),r.createHref({pathname:u,search:c,hash:s})}function od(){return h.useContext(Yg)!=null}function Bs(){return Lt(od(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Yg).location}var xA="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function vA(e){h.useContext(xs).static||h.useLayoutEffect(e)}function wc(){let{isDataRoute:e}=h.useContext(vs);return e?hL():eL()}function eL(){Lt(od(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(Cc),{basename:t,navigator:n}=h.useContext(xs),{matches:r}=h.useContext(vs),{pathname:s}=Bs(),i=JSON.stringify(qg(r)),c=h.useRef(!1);return vA(()=>{c.current=!0}),h.useCallback((f,m={})=>{if(Kn(c.current,xA),!c.current)return;if(typeof f=="number"){n.go(f);return}let y=Kg(f,JSON.parse(i),s,m.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:ho([t,y.pathname])),(m.replace?n.replace:n.push)(y,m.state,m)},[t,n,i,s,e])}var bA=h.createContext(null);function bs(){return h.useContext(bA)}function tL(e){let t=h.useContext(vs).outlet;return h.useMemo(()=>t&&h.createElement(bA.Provider,{value:e},t),[t,e])}function Wg(){let{matches:e}=h.useContext(vs),t=e[e.length-1];return t?t.params:{}}function mh(e,{relative:t}={}){let{matches:n}=h.useContext(vs),{pathname:r}=Bs(),s=JSON.stringify(qg(n));return h.useMemo(()=>Kg(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function nL(e,t,n,r,s){Lt(od(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=h.useContext(xs),{matches:c}=h.useContext(vs),u=c[c.length-1],f=u?u.params:{},m=u?u.pathname:"/",y=u?u.pathnameBase:"/",g=u&&u.route;{let j=g&&g.path||"";SA(m,!g||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${j}">) 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="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let x=Bs(),v;v=x;let C=v.pathname||"/",b=C;if(y!=="/"){let j=y.replace(/^\//,"").split("/");b="/"+C.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=Zi(e,{pathname:b});return Kn(g||w!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Kn(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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.`),iL(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:ho([y,i.encodeLocation?i.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?y:ho([y,i.encodeLocation?i.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),c,n,r,s)}function rL(){let e=fL(),t=Kf(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:i},"ErrorBoundary")," or"," ",h.createElement("code",{style:i},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:s},n):null,c)}var aL=h.createElement(rL,null),sL=class extends h.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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?h.createElement(vs.Provider,{value:this.props.routeContext},h.createElement(eS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function oL({routeContext:e,match:t,children:n}){let r=h.useContext(Cc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(vs.Provider,{value:e},n)}function iL(e,t=[],n=null,r=null,s=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,c=n==null?void 0:n.errors;if(c!=null){let y=i.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);Lt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,y+1))}let u=!1,f=-1;if(n)for(let y=0;y<i.length;y++){let g=i[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:x,errors:v}=n,C=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||C){u=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}let m=n&&r?(y,g)=>{var x,v;r(y,{location:n.location,params:((v=(x=n.matches)==null?void 0:x[0])==null?void 0:v.params)??{},unstable_pattern:fh(n.matches),errorInfo:g})}:void 0;return i.reduceRight((y,g,x)=>{let v,C=!1,b=null,w=null;n&&(v=c&&g.route.id?c[g.route.id]:void 0,b=g.route.errorElement||aL,u&&(f<0&&x===0?(SA("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,w=null):f===x&&(C=!0,w=g.route.hydrateFallbackElement||null)));let R=t.concat(i.slice(0,x+1)),j=()=>{let _;return v?_=b:C?_=w:g.route.Component?_=h.createElement(g.route.Component,null):g.route.element?_=g.route.element:_=y,h.createElement(oL,{match:g,routeContext:{outlet:y,matches:R,isDataRoute:n!=null},children:_})};return n&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?h.createElement(sL,{location:n.location,revalidation:n.revalidation,component:b,error:v,children:j(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:m}):j()},null)}function tS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lL(e){let t=h.useContext(Cc);return Lt(t,tS(e)),t}function cL(e){let t=h.useContext(hh);return Lt(t,tS(e)),t}function uL(e){let t=h.useContext(vs);return Lt(t,tS(e)),t}function nS(e){let t=uL(e),n=t.matches[t.matches.length-1];return Lt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function dL(){return nS("useRouteId")}function fL(){var r;let e=h.useContext(eS),t=cL("useRouteError"),n=nS("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function hL(){let{router:e}=lL("useNavigate"),t=nS("useNavigate"),n=h.useRef(!1);return vA(()=>{n.current=!0}),h.useCallback(async(s,i={})=>{Kn(n.current,xA),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var Jj={};function SA(e,t,n){!t&&!Jj[e]&&(Jj[e]=!0,Kn(!1,n))}var eT={};function tT(e,t){!e&&!eT[t]&&(eT[t]=!0,console.warn(t))}var mL="useOptimistic",nT=dh[mL],pL=()=>{};function gL(e){return nT?nT(e):[e,pL]}function yL(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Kn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Kn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Kn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var xL=["HydrateFallback","hydrateFallbackElement"],vL=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 bL({router:e,flushSync:t,unstable_onError:n,unstable_useTransitions:r}){let[s,i]=h.useState(e.state),[c,u]=gL(s),[f,m]=h.useState(),[y,g]=h.useState({isTransitioning:!1}),[x,v]=h.useState(),[C,b]=h.useState(),[w,R]=h.useState(),j=h.useRef(new Map),_=h.useCallback((T,{deletedFetchers:I,newErrors:k,flushSync:V,viewTransitionOpts:U})=>{k&&n&&Object.values(k).forEach(G=>{var q;return n(G,{location:T.location,params:((q=T.matches[0])==null?void 0:q.params)??{},unstable_pattern:fh(T.matches)})}),T.fetchers.forEach((G,q)=>{G.data!==void 0&&j.current.set(q,G.data)}),I.forEach(G=>j.current.delete(G)),tT(V===!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 K=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(tT(U==null||K,"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."),!U||!K){t&&V?t(()=>i(T)):r===!1?i(T):h.startTransition(()=>{r===!0&&u(G=>rT(G,T)),i(T)});return}if(t&&V){t(()=>{C&&(x==null||x.resolve(),C.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let G=e.window.document.startViewTransition(()=>{t(()=>i(T))});G.finished.finally(()=>{t(()=>{v(void 0),b(void 0),m(void 0),g({isTransitioning:!1})})}),t(()=>b(G));return}C?(x==null||x.resolve(),C.skipTransition(),R({state:T,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(m(T),g({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[e.window,t,C,x,r,u,n]);h.useLayoutEffect(()=>e.subscribe(_),[e,_]),h.useEffect(()=>{y.isTransitioning&&!y.flushSync&&v(new vL)},[y]),h.useEffect(()=>{if(x&&f&&e.window){let T=f,I=x.promise,k=e.window.document.startViewTransition(async()=>{r===!1?i(T):h.startTransition(()=>{r===!0&&u(V=>rT(V,T)),i(T)}),await I});k.finished.finally(()=>{v(void 0),b(void 0),m(void 0),g({isTransitioning:!1})}),b(k)}},[f,x,e.window,r,u]),h.useEffect(()=>{x&&f&&c.location.key===f.location.key&&x.resolve()},[x,C,c.location,f]),h.useEffect(()=>{!y.isTransitioning&&w&&(m(w.state),g({isTransitioning:!0,flushSync:!1,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),R(void 0))},[y.isTransitioning,w]);let D=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,I,k)=>e.navigate(T,{state:I,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(T,I,k)=>e.navigate(T,{replace:!0,state:I,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[e]),O=e.basename||"/",A=h.useMemo(()=>({router:e,navigator:D,static:!1,basename:O,unstable_onError:n}),[e,D,O,n]);return h.createElement(h.Fragment,null,h.createElement(Cc.Provider,{value:A},h.createElement(hh.Provider,{value:c},h.createElement(yA.Provider,{value:j.current},h.createElement(Jb.Provider,{value:y},h.createElement(EL,{basename:O,location:c.location,navigationType:c.historyAction,navigator:D,unstable_useTransitions:r===!0},h.createElement(SL,{routes:e.routes,future:e.future,state:c,unstable_onError:n})))))),null)}function rT(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var SL=h.memo(CL);function CL({routes:e,future:t,state:n,unstable_onError:r}){return nL(e,void 0,n,r,t)}function wL({to:e,replace:t,state:n,relative:r}){Lt(od(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=h.useContext(xs);Kn(!s,"<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:i}=h.useContext(vs),{pathname:c}=Bs(),u=wc(),f=Kg(e,qg(i),c,r==="path"),m=JSON.stringify(f);return h.useEffect(()=>{u(JSON.parse(m),{replace:t,state:n,relative:r})},[u,m,r,t,n]),null}function rS(e){return tL(e.context)}function EL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1,unstable_useTransitions:c}){Lt(!od(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=h.useMemo(()=>({basename:u,navigator:s,static:i,unstable_useTransitions:c,future:{}}),[u,s,i,c]);typeof n=="string"&&(n=gl(n));let{pathname:m="/",search:y="",hash:g="",state:x=null,key:v="default"}=n,C=h.useMemo(()=>{let b=ys(m,u);return b==null?null:{location:{pathname:b,search:y,hash:g,state:x,key:v},navigationType:r}},[u,m,y,g,x,v,r]);return Kn(C!=null,`<Router basename="${u}"> is not able to match the URL "${m}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:h.createElement(xs.Provider,{value:f},h.createElement(Yg.Provider,{children:t,value:C}))}var Fp="get",Hp="application/x-www-form-urlencoded";function Xg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function RL(e){return Xg(e)&&e.tagName.toLowerCase()==="button"}function jL(e){return Xg(e)&&e.tagName.toLowerCase()==="form"}function TL(e){return Xg(e)&&e.tagName.toLowerCase()==="input"}function _L(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NL(e,t){return e.button===0&&(!t||t==="_self")&&!_L(e)}function L1(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function AL(e,t){let n=L1(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}var up=null;function DL(){if(up===null)try{new FormData(document.createElement("form"),0),up=!1}catch{up=!0}return up}var OL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function T0(e){return e!=null&&!OL.has(e)?(Kn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hp}"`),null):e}function IL(e,t){let n,r,s,i,c;if(jL(e)){let u=e.getAttribute("action");r=u?ys(u,t):null,n=e.getAttribute("method")||Fp,s=T0(e.getAttribute("enctype"))||Hp,i=new FormData(e)}else if(RL(e)||TL(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?ys(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Fp,s=T0(e.getAttribute("formenctype"))||T0(u.getAttribute("enctype"))||Hp,i=new FormData(u,e),!DL()){let{name:m,type:y,value:g}=e;if(y==="image"){let x=m?`${m}.`:"";i.append(`${x}x`,"0"),i.append(`${x}y`,"0")}else m&&i.append(m,g)}}else{if(Xg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Fp,r=null,s=Hp,c=e}return i&&s==="text/plain"&&(c=i,i=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:i,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function aS(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ML(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&ys(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function kL(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 LL(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 PL(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let c=await kL(i,n);return c.links?c.links():[]}return[]}));return HL(r.flat(1).filter(LL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function aT(e,t,n,r,s,i){let c=(f,m)=>n[m]?f.route.id!==n[m].route.id:!0,u=(f,m)=>{var y;return n[m].pathname!==f.pathname||((y=n[m].route.path)==null?void 0:y.endsWith("*"))&&n[m].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,m)=>c(f,m)||u(f,m)):i==="data"?t.filter((f,m)=>{var g;let y=r.routes[f.route.id];if(!y||!y.hasLoader)return!1;if(c(f,m)||u(f,m))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function UL(e,t,{includeHydrateFallback:n}={}){return zL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function zL(e){return[...new Set(e)]}function FL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function HL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(FL(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function CA(){let e=h.useContext(Cc);return aS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $L(){let e=h.useContext(hh);return aS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var sS=h.createContext(void 0);sS.displayName="FrameworkContext";function wA(){let e=h.useContext(sS);return aS(e,"You must render this element inside a <HydratedRouter> element"),e}function VL(e,t){let n=h.useContext(sS),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:m,onMouseLeave:y,onTouchStart:g}=t,x=h.useRef(null);h.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let b=R=>{R.forEach(j=>{c(j.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return x.current&&w.observe(x.current),()=>{w.disconnect()}}},[e]),h.useEffect(()=>{if(r){let b=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(b)}}},[r]);let v=()=>{s(!0)},C=()=>{s(!1),c(!1)};return n?e!=="intent"?[i,x,{}]:[i,x,{onFocus:xf(u,v),onBlur:xf(f,C),onMouseEnter:xf(m,v),onMouseLeave:xf(y,C),onTouchStart:xf(g,v)}]:[!1,x,{}]}function xf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function GL({page:e,...t}){let{router:n}=CA(),r=h.useMemo(()=>Zi(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?h.createElement(qL,{page:e,matches:r,...t}):null}function BL(e){let{manifest:t,routeModules:n}=wA(),[r,s]=h.useState([]);return h.useEffect(()=>{let i=!1;return PL(e,t,n).then(c=>{i||s(c)}),()=>{i=!0}},[e,t,n]),r}function qL({page:e,matches:t,...n}){let r=Bs(),{manifest:s,routeModules:i}=wA(),{basename:c}=CA(),{loaderData:u,matches:f}=$L(),m=h.useMemo(()=>aT(e,t,f,s,r,"data"),[e,t,f,s,r]),y=h.useMemo(()=>aT(e,t,f,s,r,"assets"),[e,t,f,s,r]),g=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,b=!1;if(t.forEach(R=>{var _;let j=s.routes[R.route.id];!j||!j.hasLoader||(!m.some(D=>D.route.id===R.route.id)&&R.route.id in u&&((_=i[R.route.id])!=null&&_.shouldRevalidate)||j.hasClientLoader?b=!0:C.add(R.route.id))}),C.size===0)return[];let w=ML(e,c,"data");return b&&C.size>0&&w.searchParams.set("_routes",t.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[w.pathname+w.search]},[c,u,r,s,m,t,e,i]),x=h.useMemo(()=>UL(y,s),[y,s]),v=BL(y);return h.createElement(h.Fragment,null,g.map(C=>h.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),x.map(C=>h.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),v.map(({key:C,link:b})=>h.createElement("link",{key:C,nonce:n.nonce,...b})))}function KL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var EA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{EA&&(window.__reactRouterVersion="7.10.1")}catch{}function ZL(e,t){return N7({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:V9({window:t==null?void 0:t.window}),hydrationData:YL(),routes:e,mapRouteProperties:yL,hydrationRouteProperties:xL,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function YL(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:WL(e.errors)}),e}function WL(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Zg(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let c=new i(s.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}var RA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wr=h.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:c,state:u,target:f,to:m,preventScrollReset:y,viewTransition:g,...x},v){let{basename:C,unstable_useTransitions:b}=h.useContext(xs),w=typeof m=="string"&&RA.test(m),R,j=!1;if(typeof m=="string"&&w&&(R=m,EA))try{let V=new URL(window.location.href),U=m.startsWith("//")?new URL(V.protocol+m):new URL(m),K=ys(U.pathname,C);U.origin===V.origin&&K!=null?m=K+U.search+U.hash:j=!0}catch{Kn(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=J7(m,{relative:s}),[D,O,A]=VL(r,x),T=JL(m,{replace:c,state:u,target:f,preventScrollReset:y,relative:s,viewTransition:g,unstable_useTransitions:b});function I(V){t&&t(V),V.defaultPrevented||T(V)}let k=h.createElement("a",{...x,...A,href:R||_,onClick:j||i?t:I,ref:KL(v,O),target:f,"data-discover":!w&&n==="render"?"true":void 0});return D&&!w?h.createElement(h.Fragment,null,k,h.createElement(GL,{page:_})):k});Wr.displayName="Link";var ph=h.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:c,viewTransition:u,children:f,...m},y){let g=mh(c,{relative:m.relative}),x=Bs(),v=h.useContext(hh),{navigator:C,basename:b}=h.useContext(xs),w=v!=null&&sP(g)&&u===!0,R=C.encodeLocation?C.encodeLocation(g).pathname:g.pathname,j=x.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(j=j.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&b&&(_=ys(_,b)||_);const D=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let O=j===R||!s&&j.startsWith(R)&&j.charAt(D)==="/",A=_!=null&&(_===R||!s&&_.startsWith(R)&&_.charAt(R.length)==="/"),T={isActive:O,isPending:A,isTransitioning:w},I=O?t:void 0,k;typeof r=="function"?k=r(T):k=[r,O?"active":null,A?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let V=typeof i=="function"?i(T):i;return h.createElement(Wr,{...m,"aria-current":I,className:k,ref:y,style:V,to:c,viewTransition:u},typeof f=="function"?f(T):f)});ph.displayName="NavLink";var XL=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:c=Fp,action:u,onSubmit:f,relative:m,preventScrollReset:y,viewTransition:g,...x},v)=>{let{unstable_useTransitions:C}=h.useContext(xs),b=rP(),w=aP(u,{relative:m}),R=c.toLowerCase()==="get"?"get":"post",j=typeof u=="string"&&RA.test(u),_=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let O=D.nativeEvent.submitter,A=(O==null?void 0:O.getAttribute("formmethod"))||c,T=()=>b(O||D.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:s,state:i,relative:m,preventScrollReset:y,viewTransition:g});C&&n!==!1?h.startTransition(()=>T()):T()};return h.createElement("form",{ref:v,method:R,action:w,onSubmit:r?f:_,...x,"data-discover":!j&&e==="render"?"true":void 0})});XL.displayName="Form";function QL(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jA(e){let t=h.useContext(Cc);return Lt(t,QL(e)),t}function JL(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:c,unstable_useTransitions:u}={}){let f=wc(),m=Bs(),y=mh(e,{relative:i});return h.useCallback(g=>{if(NL(g,t)){g.preventDefault();let x=n!==void 0?n:bo(m)===bo(y),v=()=>f(e,{replace:x,state:r,preventScrollReset:s,relative:i,viewTransition:c});u?h.startTransition(()=>v()):v()}},[m,f,y,n,r,t,e,s,i,c,u])}function eP(e){Kn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=h.useRef(L1(e)),n=h.useRef(!1),r=Bs(),s=h.useMemo(()=>AL(r.search,n.current?null:t.current),[r.search]),i=wc(),c=h.useCallback((u,f)=>{const m=L1(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,i("?"+m,f)},[i,s]);return[s,c]}var tP=0,nP=()=>`__${String(++tP)}__`;function rP(){let{router:e}=jA("useSubmit"),{basename:t}=h.useContext(xs),n=dL(),r=e.fetch,s=e.navigate;return h.useCallback(async(i,c={})=>{let{action:u,method:f,encType:m,formData:y,body:g}=IL(i,t);if(c.navigate===!1){let x=c.fetcherKey||nP();await r(x,n,c.action||u,{preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||f,formEncType:c.encType||m,flushSync:c.flushSync})}else await s(c.action||u,{preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||f,formEncType:c.encType||m,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,s,t,n])}function aP(e,{relative:t}={}){let{basename:n}=h.useContext(xs),r=h.useContext(vs);Lt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...mh(e||".",{relative:t})},c=Bs();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(y=>y==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let y=u.toString();i.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:ho([n,i.pathname])),bo(i)}function sP(e,{relative:t}={}){let n=h.useContext(Jb);Lt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=jA("useViewTransitionState"),s=mh(e,{relative:t});if(!n.isTransitioning)return!1;let i=ys(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ys(n.nextLocation.pathname,r)||n.nextLocation.pathname;return eg(s.pathname,c)!=null||eg(s.pathname,i)!=null}var Ls=eA();const TA=JN(Ls);function oP(e){return h.createElement(bL,{flushSync:Ls.flushSync,...e})}function sT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xr(...e){return t=>{let n=!1;const r=e.map(s=>{const i=sT(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():sT(e[s],null)}}}}function ht(...e){return h.useCallback(Xr(...e),e)}var iP=Symbol.for("react.lazy"),ng=dh[" use ".trim().toString()];function lP(e){return typeof e=="object"&&e!==null&&"then"in e}function _A(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===iP&&"_payload"in e&&lP(e._payload)}function oS(e){const t=cP(e),n=h.forwardRef((r,s)=>{let{children:i,...c}=r;_A(i)&&typeof ng=="function"&&(i=ng(i._payload));const u=h.Children.toArray(i),f=u.find(dP);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var gh=oS("Slot");function cP(e){const t=h.forwardRef((n,r)=>{let{children:s,...i}=n;if(_A(s)&&typeof ng=="function"&&(s=ng(s._payload)),h.isValidElement(s)){const c=hP(s),u=fP(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uP=Symbol("radix.slottable");function dP(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uP}function fP(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function hP(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function NA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=NA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function AA(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=NA(e))&&(r&&(r+=" "),r+=t);return r}const oT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,iT=AA,Ec=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return iT(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,c=Object.keys(s).map(m=>{const y=n==null?void 0:n[m],g=i==null?void 0:i[m];if(y===null)return null;const x=oT(y)||oT(g);return s[m][x]}),u=n&&Object.entries(n).reduce((m,y)=>{let[g,x]=y;return x===void 0||(m[g]=x),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,y)=>{let{class:g,className:x,...v}=y;return Object.entries(v).every(C=>{let[b,w]=C;return Array.isArray(w)?w.includes({...i,...u}[b]):{...i,...u}[b]===w})?[...m,g,x]:m},[]);return iT(e,c,f,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
|
62
|
-
* @license lucide-react v0.475.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const mP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),DA=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
67
|
-
* @license lucide-react v0.475.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/var pP={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"};/**
|
|
72
|
-
* @license lucide-react v0.475.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const gP=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:c,...u},f)=>h.createElement("svg",{ref:f,...pP,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:DA("lucide",s),...u},[...c.map(([m,y])=>h.createElement(m,y)),...Array.isArray(i)?i:[i]]));/**
|
|
77
|
-
* @license lucide-react v0.475.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const _e=(e,t)=>{const n=h.forwardRef(({className:r,...s},i)=>h.createElement(gP,{ref:i,iconNode:t,className:DA(`lucide-${mP(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
82
|
-
* @license lucide-react v0.475.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const yP=[["path",{d:"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",key:"ns4c3b"}],["path",{d:"m12 15 5 6H7Z",key:"14qnn2"}]],_0=_e("Airplay",yP);/**
|
|
87
|
-
* @license lucide-react v0.475.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const xP=[["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"}]],iS=_e("ArchiveRestore",xP);/**
|
|
92
|
-
* @license lucide-react v0.475.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const vP=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M15 4h5l-5 6h5",key:"8asdl1"}],["path",{d:"M15 20v-3.5a2.5 2.5 0 0 1 5 0V20",key:"r6l5cz"}],["path",{d:"M20 18h-5",key:"18j1r2"}]],lT=_e("ArrowDownZA",vP);/**
|
|
97
|
-
* @license lucide-react v0.475.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const bP=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],SP=_e("ArrowLeft",bP);/**
|
|
102
|
-
* @license lucide-react v0.475.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const CP=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],wP=_e("ArrowRightLeft",CP);/**
|
|
107
|
-
* @license lucide-react v0.475.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const EP=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],cT=_e("ArrowUpAZ",EP);/**
|
|
112
|
-
* @license lucide-react v0.475.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const RP=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],uT=_e("ArrowUpDown",RP);/**
|
|
117
|
-
* @license lucide-react v0.475.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const jP=[["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"}]],TP=_e("Asterisk",jP);/**
|
|
122
|
-
* @license lucide-react v0.475.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const _P=[["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"}]],NP=_e("BadgeAlert",_P);/**
|
|
127
|
-
* @license lucide-react v0.475.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const AP=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],DP=_e("Blocks",AP);/**
|
|
132
|
-
* @license lucide-react v0.475.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const OP=[["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"}]],IP=_e("BookOpen",OP);/**
|
|
137
|
-
* @license lucide-react v0.475.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const MP=[["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"}]],rg=_e("Box",MP);/**
|
|
142
|
-
* @license lucide-react v0.475.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const kP=[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2",key:"1ksdt3"}],["path",{d:"M22 13a18.15 18.15 0 0 1-20 0",key:"12hx5q"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],LP=_e("BriefcaseBusiness",kP);/**
|
|
147
|
-
* @license lucide-react v0.475.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const PP=[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],lS=_e("CalendarClock",PP);/**
|
|
152
|
-
* @license lucide-react v0.475.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const UP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],oa=_e("Check",UP);/**
|
|
157
|
-
* @license lucide-react v0.475.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const zP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ss=_e("ChevronDown",zP);/**
|
|
162
|
-
* @license lucide-react v0.475.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const FP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],HP=_e("ChevronLeft",FP);/**
|
|
167
|
-
* @license lucide-react v0.475.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const $P=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_a=_e("ChevronRight",$P);/**
|
|
172
|
-
* @license lucide-react v0.475.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const VP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Yu=_e("ChevronUp",VP);/**
|
|
177
|
-
* @license lucide-react v0.475.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const GP=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],BP=_e("ChevronsDownUp",GP);/**
|
|
182
|
-
* @license lucide-react v0.475.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const qP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],cS=_e("ChevronsUpDown",qP);/**
|
|
187
|
-
* @license lucide-react v0.475.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const KP=[["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=_e("CircleAlert",KP);/**
|
|
192
|
-
* @license lucide-react v0.475.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const ZP=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],YP=_e("CircleCheckBig",ZP);/**
|
|
197
|
-
* @license lucide-react v0.475.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const WP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xh=_e("CircleCheck",WP);/**
|
|
202
|
-
* @license lucide-react v0.475.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const XP=[["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"}]],ag=_e("CircleX",XP);/**
|
|
207
|
-
* @license lucide-react v0.475.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const QP=[["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z",key:"1tn4o7"}],["path",{d:"m6.2 5.3 3.1 3.9",key:"iuk76l"}],["path",{d:"m12.4 3.4 3.1 4",key:"6hsd6n"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z",key:"ltgou9"}]],JP=_e("Clapperboard",QP);/**
|
|
212
|
-
* @license lucide-react v0.475.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const eU=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],uS=_e("Code",eU);/**
|
|
217
|
-
* @license lucide-react v0.475.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const tU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],nU=_e("Columns3",tU);/**
|
|
222
|
-
* @license lucide-react v0.475.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const rU=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Wu=_e("Copy",rU);/**
|
|
227
|
-
* @license lucide-react v0.475.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const aU=[["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"}]],OA=_e("DatabaseZap",aU);/**
|
|
232
|
-
* @license lucide-react v0.475.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const sU=[["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"}]],cc=_e("Database",sU);/**
|
|
237
|
-
* @license lucide-react v0.475.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const oU=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],iU=_e("Download",oU);/**
|
|
242
|
-
* @license lucide-react v0.475.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const lU=[["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"}]],IA=_e("EllipsisVertical",lU);/**
|
|
247
|
-
* @license lucide-react v0.475.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const cU=[["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"}]],qs=_e("Ellipsis",cU);/**
|
|
252
|
-
* @license lucide-react v0.475.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const uU=[["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"}]],si=_e("ExternalLink",uU);/**
|
|
257
|
-
* @license lucide-react v0.475.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const dU=[["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"}]],fU=_e("EyeOff",dU);/**
|
|
262
|
-
* @license lucide-react v0.475.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const hU=[["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"}]],MA=_e("Eye",hU);/**
|
|
267
|
-
* @license lucide-react v0.475.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const mU=[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]],pU=_e("FilePenLine",mU);/**
|
|
272
|
-
* @license lucide-react v0.475.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const gU=[["path",{d:"M20 10V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4",key:"1rdf37"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M16 14a2 2 0 0 0-2 2",key:"ceaadl"}],["path",{d:"M20 14a2 2 0 0 1 2 2",key:"1ny6zw"}],["path",{d:"M20 22a2 2 0 0 0 2-2",key:"1l9q4k"}],["path",{d:"M16 22a2 2 0 0 1-2-2",key:"1wqh5n"}]],yU=_e("FileScan",gU);/**
|
|
277
|
-
* @license lucide-react v0.475.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const xU=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],vU=_e("FileText",xU);/**
|
|
282
|
-
* @license lucide-react v0.475.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const bU=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],SU=_e("FlaskConical",bU);/**
|
|
287
|
-
* @license lucide-react v0.475.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const CU=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],wU=_e("FolderTree",CU);/**
|
|
292
|
-
* @license lucide-react v0.475.0 - ISC
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the ISC license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const EU=[["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"}]],dT=_e("Gem",EU);/**
|
|
297
|
-
* @license lucide-react v0.475.0 - ISC
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the ISC license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const RU=[["path",{d:"M12 13V2l8 4-8 4",key:"5wlwwj"}],["path",{d:"M20.561 10.222a9 9 0 1 1-12.55-5.29",key:"1c0wjv"}],["path",{d:"M8.002 9.997a5 5 0 1 0 8.9 2.02",key:"gb1g7m"}]],jU=_e("Goal",RU);/**
|
|
302
|
-
* @license lucide-react v0.475.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const TU=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],_U=_e("GraduationCap",TU);/**
|
|
307
|
-
* @license lucide-react v0.475.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the ISC license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const NU=[["path",{d:"M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3",key:"11za1p"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],AU=_e("Grid2x2Check",NU);/**
|
|
312
|
-
* @license lucide-react v0.475.0 - ISC
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the ISC license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const DU=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],kA=_e("GripVertical",DU);/**
|
|
317
|
-
* @license lucide-react v0.475.0 - ISC
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the ISC license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const OU=[["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"}]],IU=_e("Grip",OU);/**
|
|
322
|
-
* @license lucide-react v0.475.0 - ISC
|
|
323
|
-
*
|
|
324
|
-
* This source code is licensed under the ISC license.
|
|
325
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const MU=[["path",{d:"M3 7V5c0-1.1.9-2 2-2h2",key:"adw53z"}],["path",{d:"M17 3h2c1.1 0 2 .9 2 2v2",key:"an4l38"}],["path",{d:"M21 17v2c0 1.1-.9 2-2 2h-2",key:"144t0e"}],["path",{d:"M7 21H5c-1.1 0-2-.9-2-2v-2",key:"rtnfgi"}],["rect",{width:"7",height:"5",x:"7",y:"7",rx:"1",key:"1eyiv7"}],["rect",{width:"7",height:"5",x:"10",y:"12",rx:"1",key:"1qlmkx"}]],kU=_e("Group",MU);/**
|
|
327
|
-
* @license lucide-react v0.475.0 - ISC
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the ISC license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const LU=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],PU=_e("History",LU);/**
|
|
332
|
-
* @license lucide-react v0.475.0 - ISC
|
|
333
|
-
*
|
|
334
|
-
* This source code is licensed under the ISC license.
|
|
335
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const UU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Fr=_e("Info",UU);/**
|
|
337
|
-
* @license lucide-react v0.475.0 - ISC
|
|
338
|
-
*
|
|
339
|
-
* This source code is licensed under the ISC license.
|
|
340
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const zU=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],P1=_e("KeyRound",zU);/**
|
|
342
|
-
* @license lucide-react v0.475.0 - ISC
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the ISC license.
|
|
345
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const FU=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],HU=_e("Layers",FU);/**
|
|
347
|
-
* @license lucide-react v0.475.0 - ISC
|
|
348
|
-
*
|
|
349
|
-
* This source code is licensed under the ISC license.
|
|
350
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const $U=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],VU=_e("Lightbulb",$U);/**
|
|
352
|
-
* @license lucide-react v0.475.0 - ISC
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the ISC license.
|
|
355
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const GU=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],BU=_e("ListChecks",GU);/**
|
|
357
|
-
* @license lucide-react v0.475.0 - ISC
|
|
358
|
-
*
|
|
359
|
-
* This source code is licensed under the ISC license.
|
|
360
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const qU=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Rc=_e("LoaderCircle",qU);/**
|
|
362
|
-
* @license lucide-react v0.475.0 - ISC
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the ISC license.
|
|
365
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const KU=[["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"}]],ZU=_e("Lock",KU);/**
|
|
367
|
-
* @license lucide-react v0.475.0 - ISC
|
|
368
|
-
*
|
|
369
|
-
* This source code is licensed under the ISC license.
|
|
370
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const YU=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],WU=_e("LogOut",YU);/**
|
|
372
|
-
* @license lucide-react v0.475.0 - ISC
|
|
373
|
-
*
|
|
374
|
-
* This source code is licensed under the ISC license.
|
|
375
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const XU=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],QU=_e("Menu",XU);/**
|
|
377
|
-
* @license lucide-react v0.475.0 - ISC
|
|
378
|
-
*
|
|
379
|
-
* This source code is licensed under the ISC license.
|
|
380
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const JU=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["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"}]],LA=_e("MessageCircleQuestion",JU);/**
|
|
382
|
-
* @license lucide-react v0.475.0 - ISC
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the ISC license.
|
|
385
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const ez=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],tz=_e("MessageCircle",ez);/**
|
|
387
|
-
* @license lucide-react v0.475.0 - ISC
|
|
388
|
-
*
|
|
389
|
-
* This source code is licensed under the ISC license.
|
|
390
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/const nz=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],rz=_e("MessagesSquare",nz);/**
|
|
392
|
-
* @license lucide-react v0.475.0 - ISC
|
|
393
|
-
*
|
|
394
|
-
* This source code is licensed under the ISC license.
|
|
395
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/const az=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],PA=_e("Monitor",az);/**
|
|
397
|
-
* @license lucide-react v0.475.0 - ISC
|
|
398
|
-
*
|
|
399
|
-
* This source code is licensed under the ISC license.
|
|
400
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
-
*/const sz=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],UA=_e("Moon",sz);/**
|
|
402
|
-
* @license lucide-react v0.475.0 - ISC
|
|
403
|
-
*
|
|
404
|
-
* This source code is licensed under the ISC license.
|
|
405
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
-
*/const oz=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],iz=_e("Network",oz);/**
|
|
407
|
-
* @license lucide-react v0.475.0 - ISC
|
|
408
|
-
*
|
|
409
|
-
* This source code is licensed under the ISC license.
|
|
410
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/const lz=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],cz=_e("OctagonAlert",lz);/**
|
|
412
|
-
* @license lucide-react v0.475.0 - ISC
|
|
413
|
-
*
|
|
414
|
-
* This source code is licensed under the ISC license.
|
|
415
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const uz=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],zA=_e("OctagonX",uz);/**
|
|
417
|
-
* @license lucide-react v0.475.0 - ISC
|
|
418
|
-
*
|
|
419
|
-
* This source code is licensed under the ISC license.
|
|
420
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const dz=[["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"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]],fz=_e("PackageSearch",dz);/**
|
|
422
|
-
* @license lucide-react v0.475.0 - ISC
|
|
423
|
-
*
|
|
424
|
-
* This source code is licensed under the ISC license.
|
|
425
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
-
*/const hz=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],mz=_e("PenLine",hz);/**
|
|
427
|
-
* @license lucide-react v0.475.0 - ISC
|
|
428
|
-
*
|
|
429
|
-
* This source code is licensed under the ISC license.
|
|
430
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
-
*/const pz=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],id=_e("Pencil",pz);/**
|
|
432
|
-
* @license lucide-react v0.475.0 - ISC
|
|
433
|
-
*
|
|
434
|
-
* This source code is licensed under the ISC license.
|
|
435
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/const gz=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Qg=_e("Play",gz);/**
|
|
437
|
-
* @license lucide-react v0.475.0 - ISC
|
|
438
|
-
*
|
|
439
|
-
* This source code is licensed under the ISC license.
|
|
440
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
-
*/const yz=[["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"}]],dS=_e("Plug",yz);/**
|
|
442
|
-
* @license lucide-react v0.475.0 - ISC
|
|
443
|
-
*
|
|
444
|
-
* This source code is licensed under the ISC license.
|
|
445
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
-
*/const xz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ma=_e("Plus",xz);/**
|
|
447
|
-
* @license lucide-react v0.475.0 - ISC
|
|
448
|
-
*
|
|
449
|
-
* This source code is licensed under the ISC license.
|
|
450
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
-
*/const vz=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],bz=_e("RefreshCw",vz);/**
|
|
452
|
-
* @license lucide-react v0.475.0 - ISC
|
|
453
|
-
*
|
|
454
|
-
* This source code is licensed under the ISC license.
|
|
455
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/const Sz=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Cz=_e("Rocket",Sz);/**
|
|
457
|
-
* @license lucide-react v0.475.0 - ISC
|
|
458
|
-
*
|
|
459
|
-
* This source code is licensed under the ISC license.
|
|
460
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
-
*/const wz=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],Ez=_e("Route",wz);/**
|
|
462
|
-
* @license lucide-react v0.475.0 - ISC
|
|
463
|
-
*
|
|
464
|
-
* This source code is licensed under the ISC license.
|
|
465
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
-
*/const Rz=[["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"}]],jz=_e("Scale",Rz);/**
|
|
467
|
-
* @license lucide-react v0.475.0 - ISC
|
|
468
|
-
*
|
|
469
|
-
* This source code is licensed under the ISC license.
|
|
470
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
-
*/const Tz=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],_z=_e("ScanSearch",Tz);/**
|
|
472
|
-
* @license lucide-react v0.475.0 - ISC
|
|
473
|
-
*
|
|
474
|
-
* This source code is licensed under the ISC license.
|
|
475
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
-
*/const Nz=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]],Az=_e("ScanText",Nz);/**
|
|
477
|
-
* @license lucide-react v0.475.0 - ISC
|
|
478
|
-
*
|
|
479
|
-
* This source code is licensed under the ISC license.
|
|
480
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
481
|
-
*/const Dz=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],jc=_e("Search",Dz);/**
|
|
482
|
-
* @license lucide-react v0.475.0 - ISC
|
|
483
|
-
*
|
|
484
|
-
* This source code is licensed under the ISC license.
|
|
485
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
486
|
-
*/const Oz=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Iz=_e("Send",Oz);/**
|
|
487
|
-
* @license lucide-react v0.475.0 - ISC
|
|
488
|
-
*
|
|
489
|
-
* This source code is licensed under the ISC license.
|
|
490
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
491
|
-
*/const Mz=[["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"}]],FA=_e("Settings",Mz);/**
|
|
492
|
-
* @license lucide-react v0.475.0 - ISC
|
|
493
|
-
*
|
|
494
|
-
* This source code is licensed under the ISC license.
|
|
495
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
496
|
-
*/const kz=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],io=_e("Sparkles",kz);/**
|
|
497
|
-
* @license lucide-react v0.475.0 - ISC
|
|
498
|
-
*
|
|
499
|
-
* This source code is licensed under the ISC license.
|
|
500
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
501
|
-
*/const Lz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 8h7",key:"kbo1nt"}],["path",{d:"M8 12h6",key:"ikassy"}],["path",{d:"M11 16h5",key:"oq65wt"}]],Pz=_e("SquareChartGantt",Lz);/**
|
|
502
|
-
* @license lucide-react v0.475.0 - ISC
|
|
503
|
-
*
|
|
504
|
-
* This source code is licensed under the ISC license.
|
|
505
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
506
|
-
*/const Uz=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],zz=_e("SquareCheckBig",Uz);/**
|
|
507
|
-
* @license lucide-react v0.475.0 - ISC
|
|
508
|
-
*
|
|
509
|
-
* This source code is licensed under the ISC license.
|
|
510
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
511
|
-
*/const Fz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],HA=_e("SquarePlay",Fz);/**
|
|
512
|
-
* @license lucide-react v0.475.0 - ISC
|
|
513
|
-
*
|
|
514
|
-
* This source code is licensed under the ISC license.
|
|
515
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
516
|
-
*/const Hz=[["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"}]],$A=_e("Sun",Hz);/**
|
|
517
|
-
* @license lucide-react v0.475.0 - ISC
|
|
518
|
-
*
|
|
519
|
-
* This source code is licensed under the ISC license.
|
|
520
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
521
|
-
*/const $z=[["path",{d:"M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z",key:"1ldrpk"}],["path",{d:"M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7",key:"11i5po"}],["path",{d:"M 7 17h.01",key:"1euzgo"}],["path",{d:"m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8",key:"o2gii7"}]],Vz=_e("SwatchBook",$z);/**
|
|
522
|
-
* @license lucide-react v0.475.0 - ISC
|
|
523
|
-
*
|
|
524
|
-
* This source code is licensed under the ISC license.
|
|
525
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
526
|
-
*/const Gz=[["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"}]],VA=_e("Table",Gz);/**
|
|
527
|
-
* @license lucide-react v0.475.0 - ISC
|
|
528
|
-
*
|
|
529
|
-
* This source code is licensed under the ISC license.
|
|
530
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
531
|
-
*/const Bz=[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]],qz=_e("Telescope",Bz);/**
|
|
532
|
-
* @license lucide-react v0.475.0 - ISC
|
|
533
|
-
*
|
|
534
|
-
* This source code is licensed under the ISC license.
|
|
535
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
536
|
-
*/const Kz=[["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"}]],es=_e("Trash2",Kz);/**
|
|
537
|
-
* @license lucide-react v0.475.0 - ISC
|
|
538
|
-
*
|
|
539
|
-
* This source code is licensed under the ISC license.
|
|
540
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
541
|
-
*/const Zz=[["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"}]],vh=_e("TriangleAlert",Zz);/**
|
|
542
|
-
* @license lucide-react v0.475.0 - ISC
|
|
543
|
-
*
|
|
544
|
-
* This source code is licensed under the ISC license.
|
|
545
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
546
|
-
*/const Yz=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],Zf=_e("Unplug",Yz);/**
|
|
547
|
-
* @license lucide-react v0.475.0 - ISC
|
|
548
|
-
*
|
|
549
|
-
* This source code is licensed under the ISC license.
|
|
550
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
551
|
-
*/const Wz=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],fT=_e("Users",Wz);/**
|
|
552
|
-
* @license lucide-react v0.475.0 - ISC
|
|
553
|
-
*
|
|
554
|
-
* This source code is licensed under the ISC license.
|
|
555
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
556
|
-
*/const Xz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uc=_e("X",Xz),N0=768;function Qz(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${N0-1}px)`),r=()=>{t(window.innerWidth<N0)};return n.addEventListener("change",r),t(window.innerWidth<N0),()=>n.removeEventListener("change",r)},[]),!!e}const Jz=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},eF=(e,t)=>({classGroupId:e,validator:t}),GA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),sg="-",hT=[],tF="arbitrary..",nF=e=>{const t=aF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return rF(c);const u=c.split(sg),f=u[0]===""&&u.length>1?1:0;return BA(u,f,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const f=r[c],m=n[c];return f?m?Jz(m,f):f:m||hT}return n[c]||hT}}},BA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const m=BA(e,t+1,i);if(m)return m}const c=n.validators;if(c===null)return;const u=t===0?e.join(sg):e.slice(t).join(sg),f=c.length;for(let m=0;m<f;m++){const y=c[m];if(y.validator(u))return y.classGroupId}},rF=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?tF+r:void 0})(),aF=e=>{const{theme:t,classGroups:n}=e;return sF(n,t)},sF=(e,t)=>{const n=GA();for(const r in e){const s=e[r];fS(s,n,r,t)}return n},fS=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const c=e[i];oF(c,t,n,r)}},oF=(e,t,n,r)=>{if(typeof e=="string"){iF(e,t,n);return}if(typeof e=="function"){lF(e,t,n,r);return}cF(e,t,n,r)},iF=(e,t,n)=>{const r=e===""?t:qA(t,e);r.classGroupId=n},lF=(e,t,n,r)=>{if(uF(e)){fS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(eF(n,e))},cF=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let c=0;c<i;c++){const[u,f]=s[c];fS(f,qA(t,u),n,r)}},qA=(e,t)=>{let n=e;const r=t.split(sg),s=r.length;for(let i=0;i<s;i++){const c=r[i];let u=n.nextPart.get(c);u||(u=GA(),n.nextPart.set(c,u)),n=u}return n},uF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,c)=>{n[i]=c,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let c=n[i];if(c!==void 0)return c;if((c=r[i])!==void 0)return s(i,c),c},set(i,c){i in n?n[i]=c:s(i,c)}}},U1="!",mT=":",fF=[],pT=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),hF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let c=0,u=0,f=0,m;const y=s.length;for(let b=0;b<y;b++){const w=s[b];if(c===0&&u===0){if(w===mT){i.push(s.slice(f,b)),f=b+1;continue}if(w==="/"){m=b;continue}}w==="["?c++:w==="]"?c--:w==="("?u++:w===")"&&u--}const g=i.length===0?s:s.slice(f);let x=g,v=!1;g.endsWith(U1)?(x=g.slice(0,-1),v=!0):g.startsWith(U1)&&(x=g.slice(1),v=!0);const C=m&&m>f?m-f:void 0;return pT(i,v,x,C)};if(t){const s=t+mT,i=r;r=c=>c.startsWith(s)?i(c.slice(s.length)):pT(fF,!1,c,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},mF=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const c=n[i],u=c[0]==="[",f=t.has(c);u||f?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(c)):s.push(c)}return s.length>0&&(s.sort(),r.push(...s)),r}},pF=e=>({cache:dF(e.cacheSize),parseClassName:hF(e),sortModifiers:mF(e),...nF(e)}),gF=/\s+/,yF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,c=[],u=e.trim().split(gF);let f="";for(let m=u.length-1;m>=0;m-=1){const y=u[m],{isExternal:g,modifiers:x,hasImportantModifier:v,baseClassName:C,maybePostfixModifierPosition:b}=n(y);if(g){f=y+(f.length>0?" "+f:f);continue}let w=!!b,R=r(w?C.substring(0,b):C);if(!R){if(!w){f=y+(f.length>0?" "+f:f);continue}if(R=r(C),!R){f=y+(f.length>0?" "+f:f);continue}w=!1}const j=x.length===0?"":x.length===1?x[0]:i(x).join(":"),_=v?j+U1:j,D=_+R;if(c.indexOf(D)>-1)continue;c.push(D);const O=s(R,w);for(let A=0;A<O.length;++A){const T=O[A];c.push(_+T)}f=y+(f.length>0?" "+f:f)}return f},xF=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=KA(n))&&(s&&(s+=" "),s+=r);return s},KA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=KA(e[r]))&&(n&&(n+=" "),n+=t);return n},vF=(e,...t)=>{let n,r,s,i;const c=f=>{const m=t.reduce((y,g)=>g(y),e());return n=pF(m),r=n.cache.get,s=n.cache.set,i=u,u(f)},u=f=>{const m=r(f);if(m)return m;const y=yF(f,n);return s(f,y),y};return i=c,(...f)=>i(xF(...f))},bF=[],pr=e=>{const t=n=>n[e]||bF;return t.isThemeGetter=!0,t},ZA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,YA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SF=/^\d+\/\d+$/,CF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wF=/\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$/,EF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,RF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yu=e=>SF.test(e),kt=e=>!!e&&!Number.isNaN(Number(e)),$i=e=>!!e&&Number.isInteger(Number(e)),A0=e=>e.endsWith("%")&&kt(e.slice(0,-1)),Bo=e=>CF.test(e),TF=()=>!0,_F=e=>wF.test(e)&&!EF.test(e),WA=()=>!1,NF=e=>RF.test(e),AF=e=>jF.test(e),DF=e=>!Ze(e)&&!Ye(e),OF=e=>ld(e,JA,WA),Ze=e=>ZA.test(e),Xl=e=>ld(e,e4,_F),D0=e=>ld(e,PF,kt),gT=e=>ld(e,XA,WA),IF=e=>ld(e,QA,AF),dp=e=>ld(e,t4,NF),Ye=e=>YA.test(e),vf=e=>cd(e,e4),MF=e=>cd(e,UF),yT=e=>cd(e,XA),kF=e=>cd(e,JA),LF=e=>cd(e,QA),fp=e=>cd(e,t4,!0),ld=(e,t,n)=>{const r=ZA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},cd=(e,t,n=!1)=>{const r=YA.exec(e);return r?r[1]?t(r[1]):n:!1},XA=e=>e==="position"||e==="percentage",QA=e=>e==="image"||e==="url",JA=e=>e==="length"||e==="size"||e==="bg-size",e4=e=>e==="length",PF=e=>e==="number",UF=e=>e==="family-name",t4=e=>e==="shadow",zF=()=>{const e=pr("color"),t=pr("font"),n=pr("text"),r=pr("font-weight"),s=pr("tracking"),i=pr("leading"),c=pr("breakpoint"),u=pr("container"),f=pr("spacing"),m=pr("radius"),y=pr("shadow"),g=pr("inset-shadow"),x=pr("text-shadow"),v=pr("drop-shadow"),C=pr("blur"),b=pr("perspective"),w=pr("aspect"),R=pr("ease"),j=pr("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...D(),Ye,Ze],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],I=()=>[Ye,Ze,f],k=()=>[yu,"full","auto",...I()],V=()=>[$i,"none","subgrid",Ye,Ze],U=()=>["auto",{span:["full",$i,Ye,Ze]},$i,Ye,Ze],K=()=>[$i,"auto",Ye,Ze],G=()=>["auto","min","max","fr",Ye,Ze],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...I()],B=()=>[yu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],$=()=>[e,Ye,Ze],re=()=>[...D(),yT,gT,{position:[Ye,Ze]}],ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",kF,OF,{size:[Ye,Ze]}],z=()=>[A0,vf,Xl],F=()=>["","none","full",m,Ye,Ze],Z=()=>["",kt,vf,Xl],Q=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[kt,A0,yT,gT],ie=()=>["","none",C,Ye,Ze],ye=()=>["none",kt,Ye,Ze],Ce=()=>["none",kt,Ye,Ze],He=()=>[kt,Ye,Ze],Ee=()=>[yu,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bo],breakpoint:[Bo],color:[TF],container:[Bo],"drop-shadow":[Bo],ease:["in","out","in-out"],font:[DF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bo],shadow:[Bo],spacing:["px",kt],text:[Bo],"text-shadow":[Bo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yu,Ze,Ye,w]}],container:["container"],columns:[{columns:[kt,Ze,Ye,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[$i,"auto",Ye,Ze]}],basis:[{basis:[yu,"full","auto",u,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[kt,yu,"auto","initial","none",Ze]}],grow:[{grow:["",kt,Ye,Ze]}],shrink:[{shrink:["",kt,Ye,Ze]}],order:[{order:[$i,"first","last","none",Ye,Ze]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[u,"screen",...B()]}],"min-w":[{"min-w":[u,"screen","none",...B()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,vf,Xl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,D0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",A0,Ze]}],"font-family":[{font:[MF,Ze,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:[s,Ye,Ze]}],"line-clamp":[{"line-clamp":[kt,"none",Ye,D0]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",Ye,Ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ze]}],"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:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[kt,"from-font","auto",Ye,Xl]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[kt,"auto",Ye,Ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ze]}],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",Ye,Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ge()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$i,Ye,Ze],radial:["",Ye,Ze],conic:[$i,Ye,Ze]},LF,IF]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"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:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[kt,Ye,Ze]}],"outline-w":[{outline:["",kt,vf,Xl]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",y,fp,dp]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",g,fp,dp]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[kt,Xl]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",x,fp,dp]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[kt,Ye,Ze]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"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":[kt]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Ye,Ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[kt]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"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:re()}],"mask-repeat":[{mask:ge()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ze]}],filter:[{filter:["","none",Ye,Ze]}],blur:[{blur:ie()}],brightness:[{brightness:[kt,Ye,Ze]}],contrast:[{contrast:[kt,Ye,Ze]}],"drop-shadow":[{"drop-shadow":["","none",v,fp,dp]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",kt,Ye,Ze]}],"hue-rotate":[{"hue-rotate":[kt,Ye,Ze]}],invert:[{invert:["",kt,Ye,Ze]}],saturate:[{saturate:[kt,Ye,Ze]}],sepia:[{sepia:["",kt,Ye,Ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ze]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[kt,Ye,Ze]}],"backdrop-contrast":[{"backdrop-contrast":[kt,Ye,Ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",kt,Ye,Ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[kt,Ye,Ze]}],"backdrop-invert":[{"backdrop-invert":["",kt,Ye,Ze]}],"backdrop-opacity":[{"backdrop-opacity":[kt,Ye,Ze]}],"backdrop-saturate":[{"backdrop-saturate":[kt,Ye,Ze]}],"backdrop-sepia":[{"backdrop-sepia":["",kt,Ye,Ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[kt,"initial",Ye,Ze]}],ease:[{ease:["linear","initial",R,Ye,Ze]}],delay:[{delay:[kt,Ye,Ze]}],animate:[{animate:["none",j,Ye,Ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ye,Ze]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[Ye,Ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"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",Ye,Ze]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Ye,Ze]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[kt,vf,Xl,D0]}],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"]}},FF=vF(zF);function se(...e){return FF(AA(e))}const hS=Ec("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-white/4 dark:hover:bg-white/8",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-white/8",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","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function we({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?gh:"button";return a.jsx(i,{"data-slot":"button",className:se(hS({variant:t,size:n,className:e})),...s})}function It({className:e,type:t,...n}){return a.jsx("input",{type:t,"data-slot":"input",className:se("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 HF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$F=HF.reduce((e,t)=>{const n=oS(`Primitive.${t}`),r=h.forwardRef((s,i)=>{const{asChild:c,...u}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),VF="Separator",xT="horizontal",GF=["horizontal","vertical"],n4=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=xT,...s}=e,i=BF(r)?r:xT,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx($F.div,{"data-orientation":i,...u,...s,ref:t})});n4.displayName=VF;function BF(e){return GF.includes(e)}var qF=n4;function mS({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return a.jsx(qF,{"data-slot":"separator",decorative:n,orientation:t,className:se("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),...r})}function Me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function KF(e,t){const n=h.createContext(t),r=i=>{const{children:c,...u}=i,f=h.useMemo(()=>u,Object.values(u));return a.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function s(i){const c=h.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function Sr(e,t=[]){let n=[];function r(i,c){const u=h.createContext(c),f=n.length;n=[...n,c];const m=g=>{var R;const{scope:x,children:v,...C}=g,b=((R=x==null?void 0:x[e])==null?void 0:R[f])||u,w=h.useMemo(()=>C,Object.values(C));return a.jsx(b.Provider,{value:w,children:v})};m.displayName=i+"Provider";function y(g,x){var b;const v=((b=x==null?void 0:x[e])==null?void 0:b[f])||u,C=h.useContext(v);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,y]}const s=()=>{const i=n.map(c=>h.createContext(c));return function(u){const f=(u==null?void 0:u[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return s.scopeName=e,[r,ZF(s,...t)]}function ZF(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const c=r.reduce((u,{useScope:f,scopeName:m})=>{const g=f(i)[`__scope${m}`];return{...u,...g}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Hr=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},YF=dh[" useId ".trim().toString()]||(()=>{}),WF=0;function er(e){const[t,n]=h.useState(YF());return Hr(()=>{n(r=>r??String(WF++))},[e]),e||(t?`radix-${t}`:"")}var XF=dh[" useInsertionEffect ".trim().toString()]||Hr;function ia({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,c]=QF({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:s;{const y=h.useRef(e!==void 0);h.useEffect(()=>{const g=y.current;g!==u&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${u?"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.`),y.current=u},[u,r])}const m=h.useCallback(y=>{var g;if(u){const x=JF(y)?y(e):y;x!==e&&((g=c.current)==null||g.call(c,x))}else i(y)},[u,e,i,c]);return[f,m]}function QF({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),i=h.useRef(t);return XF(()=>{i.current=t},[t]),h.useEffect(()=>{var c;s.current!==n&&((c=i.current)==null||c.call(i,n),s.current=n)},[n,s]),[n,r,i]}function JF(e){return typeof e=="function"}function eH(e){const t=tH(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(rH);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function tH(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=sH(s),u=aH(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nH=Symbol("radix.slottable");function rH(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nH}function aH(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function sH(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],et=oH.reduce((e,t)=>{const n=eH(`Primitive.${t}`),r=h.forwardRef((s,i)=>{const{asChild:c,...u}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function r4(e,t){e&&Ls.flushSync(()=>e.dispatchEvent(t))}function Fs(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function iH(e,t=globalThis==null?void 0:globalThis.document){const n=Fs(e);h.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var lH="DismissableLayer",z1="dismissableLayer.update",cH="dismissableLayer.pointerDownOutside",uH="dismissableLayer.focusOutside",vT,a4=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tc=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...f}=e,m=h.useContext(a4),[y,g]=h.useState(null),x=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=h.useState({}),C=ht(t,T=>g(T)),b=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=b.indexOf(w),j=y?b.indexOf(y):-1,_=m.layersWithOutsidePointerEventsDisabled.size>0,D=j>=R,O=hH(T=>{const I=T.target,k=[...m.branches].some(V=>V.contains(I));!D||k||(s==null||s(T),c==null||c(T),T.defaultPrevented||u==null||u())},x),A=mH(T=>{const I=T.target;[...m.branches].some(V=>V.contains(I))||(i==null||i(T),c==null||c(T),T.defaultPrevented||u==null||u())},x);return iH(T=>{j===m.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},x),h.useEffect(()=>{if(y)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(vT=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),bT(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=vT)}},[y,x,n,m]),h.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),bT())},[y,m]),h.useEffect(()=>{const T=()=>v({});return document.addEventListener(z1,T),()=>document.removeEventListener(z1,T)},[]),a.jsx(et.div,{...f,ref:C,style:{pointerEvents:_?D?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,O.onPointerDownCapture)})});Tc.displayName=lH;var dH="DismissableLayerBranch",fH=h.forwardRef((e,t)=>{const n=h.useContext(a4),r=h.useRef(null),s=ht(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(et.div,{...e,ref:s})});fH.displayName=dH;function hH(e,t=globalThis==null?void 0:globalThis.document){const n=Fs(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let f=function(){s4(cH,n,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=f,t.addEventListener("click",s.current,{once:!0})):f()}else t.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function mH(e,t=globalThis==null?void 0:globalThis.document){const n=Fs(e),r=h.useRef(!1);return h.useEffect(()=>{const s=i=>{i.target&&!r.current&&s4(uH,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bT(){const e=new CustomEvent(z1);document.dispatchEvent(e)}function s4(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?r4(s,i):s.dispatchEvent(i)}var O0="focusScope.autoFocusOnMount",I0="focusScope.autoFocusOnUnmount",ST={bubbles:!1,cancelable:!0},pH="FocusScope",bh=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=e,[u,f]=h.useState(null),m=Fs(s),y=Fs(i),g=h.useRef(null),x=ht(t,b=>f(b)),v=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let b=function(_){if(v.paused||!u)return;const D=_.target;u.contains(D)?g.current=D:Gi(g.current,{select:!0})},w=function(_){if(v.paused||!u)return;const D=_.relatedTarget;D!==null&&(u.contains(D)||Gi(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const O of _)O.removedNodes.length>0&&Gi(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const j=new MutationObserver(R);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),j.disconnect()}}},[r,u,v.paused]),h.useEffect(()=>{if(u){wT.add(v);const b=document.activeElement;if(!u.contains(b)){const R=new CustomEvent(O0,ST);u.addEventListener(O0,m),u.dispatchEvent(R),R.defaultPrevented||(gH(SH(o4(u)),{select:!0}),document.activeElement===b&&Gi(u))}return()=>{u.removeEventListener(O0,m),setTimeout(()=>{const R=new CustomEvent(I0,ST);u.addEventListener(I0,y),u.dispatchEvent(R),R.defaultPrevented||Gi(b??document.body,{select:!0}),u.removeEventListener(I0,y),wT.remove(v)},0)}}},[u,m,y,v]);const C=h.useCallback(b=>{if(!n&&!r||v.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,R=document.activeElement;if(w&&R){const j=b.currentTarget,[_,D]=yH(j);_&&D?!b.shiftKey&&R===D?(b.preventDefault(),n&&Gi(_,{select:!0})):b.shiftKey&&R===_&&(b.preventDefault(),n&&Gi(D,{select:!0})):R===j&&b.preventDefault()}},[n,r,v.paused]);return a.jsx(et.div,{tabIndex:-1,...c,ref:x,onKeyDown:C})});bh.displayName=pH;function gH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Gi(r,{select:t}),document.activeElement!==n)return}function yH(e){const t=o4(e),n=CT(t,e),r=CT(t.reverse(),e);return[n,r]}function o4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function CT(e,t){for(const n of e)if(!xH(n,{upTo:t}))return n}function xH(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 vH(e){return e instanceof HTMLInputElement&&"select"in e}function Gi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vH(e)&&t&&e.select()}}var wT=bH();function bH(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ET(e,t),e.unshift(t)},remove(t){var n;e=ET(e,t),(n=e[0])==null||n.resume()}}}function ET(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function SH(e){return e.filter(t=>t.tagName!=="A")}var CH="Portal",_c=h.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,i]=h.useState(!1);Hr(()=>i(!0),[]);const c=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?TA.createPortal(a.jsx(et.div,{...r,ref:t}),c):null});_c.displayName=CH;function wH(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Vr=e=>{const{present:t,children:n}=e,r=EH(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=ht(r.ref,RH(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:i}):null};Vr.displayName="Presence";function EH(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),i=h.useRef("none"),c=e?"mounted":"unmounted",[u,f]=wH(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const m=hp(r.current);i.current=u==="mounted"?m:"none"},[u]),Hr(()=>{const m=r.current,y=s.current;if(y!==e){const x=i.current,v=hp(m);e?f("MOUNT"):v==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(y&&x!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),Hr(()=>{if(t){let m;const y=t.ownerDocument.defaultView??window,g=v=>{const b=hp(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(f("ANIMATION_END"),!s.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",m=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},x=v=>{v.target===t&&(i.current=hp(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:h.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function hp(e){return(e==null?void 0:e.animationName)||"none"}function RH(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var M0=0;function Jg(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??RT()),document.body.insertAdjacentElement("beforeend",e[1]??RT()),M0++,()=>{M0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),M0--}},[])}function RT(){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 co=function(){return co=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},co.apply(this,arguments)};function i4(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function jH(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var $p="right-scroll-bar-position",Vp="width-before-scroll-bar",TH="with-scroll-bars-hidden",_H="--removed-body-scroll-bar-size";function k0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function NH(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var AH=typeof window<"u"?h.useLayoutEffect:h.useEffect,jT=new WeakMap;function DH(e,t){var n=NH(null,function(r){return e.forEach(function(s){return k0(s,r)})});return AH(function(){var r=jT.get(n);if(r){var s=new Set(r),i=new Set(e),c=n.current;s.forEach(function(u){i.has(u)||k0(u,null)}),i.forEach(function(u){s.has(u)||k0(u,c)})}jT.set(n,e)},[e]),n}function OH(e){return e}function IH(e,t){t===void 0&&(t=OH);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var c=t(i,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(i){for(r=!0;n.length;){var c=n;n=[],c.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(i),c=n}var f=function(){var y=c;c=[],y.forEach(i)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(y){c.push(y),m()},filter:function(y){return c=c.filter(y),n}}}};return s}function MH(e){e===void 0&&(e={});var t=IH(null);return t.options=co({async:!0,ssr:!1},e),t}var l4=function(e){var t=e.sideCar,n=i4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,co({},n))};l4.isSideCarExport=!0;function kH(e,t){return e.useMedium(t),l4}var c4=MH(),L0=function(){},ey=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:L0,onWheelCapture:L0,onTouchMoveCapture:L0}),s=r[0],i=r[1],c=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,y=e.enabled,g=e.shards,x=e.sideCar,v=e.noRelative,C=e.noIsolation,b=e.inert,w=e.allowPinchZoom,R=e.as,j=R===void 0?"div":R,_=e.gapMode,D=i4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=x,A=DH([n,t]),T=co(co({},D),s);return h.createElement(h.Fragment,null,y&&h.createElement(O,{sideCar:c4,removeScrollBar:m,shards:g,noRelative:v,noIsolation:C,inert:b,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:_}),c?h.cloneElement(h.Children.only(u),co(co({},T),{ref:A})):h.createElement(j,co({},T,{className:f,ref:A}),u))});ey.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ey.classNames={fullWidth:Vp,zeroRight:$p};var LH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=LH();return t&&e.setAttribute("nonce",t),e}function UH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var FH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=PH())&&(UH(t,n),zH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},HH=function(){var e=FH();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},u4=function(){var e=HH(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},$H={left:0,top:0,right:0,gap:0},P0=function(e){return parseInt(e||"",10)||0},VH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[P0(n),P0(r),P0(s)]},GH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $H;var t=VH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},BH=u4(),zu="data-scroll-locked",qH=function(e,t,n,r){var s=e.left,i=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
557
|
-
.`.concat(TH,` {
|
|
558
|
-
overflow: hidden `).concat(r,`;
|
|
559
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
560
|
-
}
|
|
561
|
-
body[`).concat(zu,`] {
|
|
562
|
-
overflow: hidden `).concat(r,`;
|
|
563
|
-
overscroll-behavior: contain;
|
|
564
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
565
|
-
padding-left: `.concat(s,`px;
|
|
566
|
-
padding-top: `).concat(i,`px;
|
|
567
|
-
padding-right: `).concat(c,`px;
|
|
568
|
-
margin-left:0;
|
|
569
|
-
margin-top:0;
|
|
570
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
571
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
.`).concat($p,` {
|
|
575
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
.`).concat(Vp,` {
|
|
579
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
.`).concat($p," .").concat($p,` {
|
|
583
|
-
right: 0 `).concat(r,`;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
.`).concat(Vp," .").concat(Vp,` {
|
|
587
|
-
margin-right: 0 `).concat(r,`;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
body[`).concat(zu,`] {
|
|
591
|
-
`).concat(_H,": ").concat(u,`px;
|
|
592
|
-
}
|
|
593
|
-
`)},TT=function(){var e=parseInt(document.body.getAttribute(zu)||"0",10);return isFinite(e)?e:0},KH=function(){h.useEffect(function(){return document.body.setAttribute(zu,(TT()+1).toString()),function(){var e=TT()-1;e<=0?document.body.removeAttribute(zu):document.body.setAttribute(zu,e.toString())}},[])},ZH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;KH();var i=h.useMemo(function(){return GH(s)},[s]);return h.createElement(BH,{styles:qH(i,!t,s,n?"":"!important")})},F1=!1;if(typeof window<"u")try{var mp=Object.defineProperty({},"passive",{get:function(){return F1=!0,!0}});window.addEventListener("test",mp,mp),window.removeEventListener("test",mp,mp)}catch{F1=!1}var xu=F1?{passive:!1}:!1,YH=function(e){return e.tagName==="TEXTAREA"},d4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!YH(e)&&n[t]==="visible")},WH=function(e){return d4(e,"overflowY")},XH=function(e){return d4(e,"overflowX")},_T=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=f4(e,r);if(s){var i=h4(e,r),c=i[1],u=i[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},QH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},JH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},f4=function(e,t){return e==="v"?WH(t):XH(t)},h4=function(e,t){return e==="v"?QH(t):JH(t)},e$=function(e,t){return e==="h"&&t==="rtl"?-1:1},t$=function(e,t,n,r,s){var i=e$(e,window.getComputedStyle(t).direction),c=i*r,u=n.target,f=t.contains(u),m=!1,y=c>0,g=0,x=0;do{if(!u)break;var v=h4(e,u),C=v[0],b=v[1],w=v[2],R=b-w-i*C;(C||R)&&f4(e,u)&&(g+=R,x+=C);var j=u.parentNode;u=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(y&&Math.abs(g)<1||!y&&Math.abs(x)<1)&&(m=!0),m},pp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},NT=function(e){return[e.deltaX,e.deltaY]},AT=function(e){return e&&"current"in e?e.current:e},n$=function(e,t){return e[0]===t[0]&&e[1]===t[1]},r$=function(e){return`
|
|
594
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
595
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
596
|
-
`)},a$=0,vu=[];function s$(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(a$++)[0],i=h.useState(u4)[0],c=h.useRef(e);h.useEffect(function(){c.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var b=jH([e.lockRef.current],(e.shards||[]).map(AT),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=h.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!c.current.allowPinchZoom;var R=pp(b),j=n.current,_="deltaX"in b?b.deltaX:j[0]-R[0],D="deltaY"in b?b.deltaY:j[1]-R[1],O,A=b.target,T=Math.abs(_)>Math.abs(D)?"h":"v";if("touches"in b&&T==="h"&&A.type==="range")return!1;var I=window.getSelection(),k=I&&I.anchorNode,V=k?k===A||k.contains(A):!1;if(V)return!1;var U=_T(T,A);if(!U)return!0;if(U?O=T:(O=T==="v"?"h":"v",U=_T(T,A)),!U)return!1;if(!r.current&&"changedTouches"in b&&(_||D)&&(r.current=O),!O)return!0;var K=r.current||O;return t$(K,w,b,K==="h"?_:D)},[]),f=h.useCallback(function(b){var w=b;if(!(!vu.length||vu[vu.length-1]!==i)){var R="deltaY"in w?NT(w):pp(w),j=t.current.filter(function(O){return O.name===w.type&&(O.target===w.target||w.target===O.shadowParent)&&n$(O.delta,R)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var _=(c.current.shards||[]).map(AT).filter(Boolean).filter(function(O){return O.contains(w.target)}),D=_.length>0?u(w,_[0]):!c.current.noIsolation;D&&w.cancelable&&w.preventDefault()}}},[]),m=h.useCallback(function(b,w,R,j){var _={name:b,delta:w,target:R,should:j,shadowParent:o$(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(D){return D!==_})},1)},[]),y=h.useCallback(function(b){n.current=pp(b),r.current=void 0},[]),g=h.useCallback(function(b){m(b.type,NT(b),b.target,u(b,e.lockRef.current))},[]),x=h.useCallback(function(b){m(b.type,pp(b),b.target,u(b,e.lockRef.current))},[]);h.useEffect(function(){return vu.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",f,xu),document.addEventListener("touchmove",f,xu),document.addEventListener("touchstart",y,xu),function(){vu=vu.filter(function(b){return b!==i}),document.removeEventListener("wheel",f,xu),document.removeEventListener("touchmove",f,xu),document.removeEventListener("touchstart",y,xu)}},[]);var v=e.removeScrollBar,C=e.inert;return h.createElement(h.Fragment,null,C?h.createElement(i,{styles:r$(s)}):null,v?h.createElement(ZH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function o$(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const i$=kH(c4,s$);var Sh=h.forwardRef(function(e,t){return h.createElement(ey,co({},e,{ref:t,sideCar:i$}))});Sh.classNames=ey.classNames;var l$=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bu=new WeakMap,gp=new WeakMap,yp={},U0=0,m4=function(e){return e&&(e.host||m4(e.parentNode))},c$=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=m4(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},u$=function(e,t,n,r){var s=c$(t,Array.isArray(e)?e:[e]);yp[n]||(yp[n]=new WeakMap);var i=yp[n],c=[],u=new Set,f=new Set(s),m=function(g){!g||u.has(g)||(u.add(g),m(g.parentNode))};s.forEach(m);var y=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(x){if(u.has(x))y(x);else try{var v=x.getAttribute(r),C=v!==null&&v!=="false",b=(bu.get(x)||0)+1,w=(i.get(x)||0)+1;bu.set(x,b),i.set(x,w),c.push(x),b===1&&C&&gp.set(x,!0),w===1&&x.setAttribute(n,"true"),C||x.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",x,R)}})};return y(t),u.clear(),U0++,function(){c.forEach(function(g){var x=bu.get(g)-1,v=i.get(g)-1;bu.set(g,x),i.set(g,v),x||(gp.has(g)||g.removeAttribute(r),gp.delete(g)),v||g.removeAttribute(n)}),U0--,U0||(bu=new WeakMap,bu=new WeakMap,gp=new WeakMap,yp={})}},ty=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=l$(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),u$(r,s,n,"aria-hidden")):function(){return null}};function d$(e){const t=f$(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(m$);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function f$(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=g$(s),u=p$(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var h$=Symbol("radix.slottable");function m$(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===h$}function p$(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function g$(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ny="Dialog",[p4,g4]=Sr(ny),[y$,Ks]=p4(ny),y4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,u=h.useRef(null),f=h.useRef(null),[m,y]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:ny});return a.jsx(y$,{scope:t,triggerRef:u,contentRef:f,contentId:er(),titleId:er(),descriptionId:er(),open:m,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};y4.displayName=ny;var x4="DialogTrigger",v4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(x4,n),i=ht(t,s.triggerRef);return a.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":yS(s.open),...r,ref:i,onClick:Me(e.onClick,s.onOpenToggle)})});v4.displayName=x4;var pS="DialogPortal",[x$,b4]=p4(pS,{forceMount:void 0}),S4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Ks(pS,t);return a.jsx(x$,{scope:t,forceMount:n,children:h.Children.map(r,c=>a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:c})}))})};S4.displayName=pS;var og="DialogOverlay",C4=h.forwardRef((e,t)=>{const n=b4(og,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ks(og,e.__scopeDialog);return i.modal?a.jsx(Vr,{present:r||i.open,children:a.jsx(b$,{...s,ref:t})}):null});C4.displayName=og;var v$=d$("DialogOverlay.RemoveScroll"),b$=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(og,n);return a.jsx(Sh,{as:v$,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(et.div,{"data-state":yS(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),dc="DialogContent",w4=h.forwardRef((e,t)=>{const n=b4(dc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ks(dc,e.__scopeDialog);return a.jsx(Vr,{present:r||i.open,children:i.modal?a.jsx(S$,{...s,ref:t}):a.jsx(C$,{...s,ref:t})})});w4.displayName=dc;var S$=h.forwardRef((e,t)=>{const n=Ks(dc,e.__scopeDialog),r=h.useRef(null),s=ht(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return ty(i)},[]),a.jsx(E4,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&i.preventDefault()}),onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault())})}),C$=h.forwardRef((e,t)=>{const n=Ks(dc,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(E4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var f,m;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),E4=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=e,u=Ks(dc,n),f=h.useRef(null),m=ht(t,f);return Jg(),a.jsxs(a.Fragment,{children:[a.jsx(bh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Tc,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":yS(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(E$,{titleId:u.titleId}),a.jsx(j$,{contentRef:f,descriptionId:u.descriptionId})]})]})}),gS="DialogTitle",R4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(gS,n);return a.jsx(et.h2,{id:s.titleId,...r,ref:t})});R4.displayName=gS;var j4="DialogDescription",T4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(j4,n);return a.jsx(et.p,{id:s.descriptionId,...r,ref:t})});T4.displayName=j4;var _4="DialogClose",N4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(_4,n);return a.jsx(et.button,{type:"button",...r,ref:t,onClick:Me(e.onClick,()=>s.onOpenChange(!1))})});N4.displayName=_4;function yS(e){return e?"open":"closed"}var A4="DialogTitleWarning",[w$,D4]=KF(A4,{contentName:dc,titleName:gS,docsSlug:"dialog"}),E$=({titleId:e})=>{const t=D4(A4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
597
|
-
|
|
598
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
599
|
-
|
|
600
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},R$="DialogDescriptionWarning",j$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${D4(R$).contentName}}.`;return h.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ry=y4,T$=v4,ay=S4,sy=C4,oy=w4,xS=R4,vS=T4,iy=N4;function ui({...e}){return a.jsx(ry,{"data-slot":"sheet",...e})}function _$({...e}){return a.jsx(ay,{"data-slot":"sheet-portal",...e})}function N$({className:e,...t}){return a.jsx(sy,{"data-slot":"sheet-overlay",className:se("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 di({className:e,children:t,side:n="right",...r}){return a.jsxs(_$,{children:[a.jsx(N$,{}),a.jsxs(oy,{"data-slot":"sheet-content",className:se("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-0 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 min-w-[100%] border-l sm:max-w-sm sm:min-w-[600px]",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full min-w-[100%] border-r sm:max-w-sm sm:min-w-[600px]",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),...r,children:[t,a.jsxs(iy,{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:[a.jsx(uc,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function fi({className:e,...t}){return a.jsx("div",{"data-slot":"sheet-header",className:se("flex flex-col gap-1 border-b p-4",e),...t})}function hi({className:e,...t}){return a.jsx(xS,{"data-slot":"sheet-title",className:se("text-foreground font-semibold",e),...t})}function yl({className:e,...t}){return a.jsx(vS,{"data-slot":"sheet-description",className:se("text-muted-foreground text-sm",e),...t})}function zr({className:e,...t}){return a.jsx("div",{"data-slot":"skeleton",className:se("bg-accent animate-pulse rounded-md",e),...t})}const A$=["top","right","bottom","left"],dl=Math.min,Ka=Math.max,ig=Math.round,xp=Math.floor,mo=e=>({x:e,y:e}),D$={left:"right",right:"left",bottom:"top",top:"bottom"},O$={start:"end",end:"start"};function H1(e,t,n){return Ka(e,dl(t,n))}function oi(e,t){return typeof e=="function"?e(t):e}function ii(e){return e.split("-")[0]}function ud(e){return e.split("-")[1]}function bS(e){return e==="x"?"y":"x"}function SS(e){return e==="y"?"height":"width"}const I$=new Set(["top","bottom"]);function uo(e){return I$.has(ii(e))?"y":"x"}function CS(e){return bS(uo(e))}function M$(e,t,n){n===void 0&&(n=!1);const r=ud(e),s=CS(e),i=SS(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=lg(c)),[c,lg(c)]}function k$(e){const t=lg(e);return[$1(e),t,$1(t)]}function $1(e){return e.replace(/start|end/g,t=>O$[t])}const DT=["left","right"],OT=["right","left"],L$=["top","bottom"],P$=["bottom","top"];function U$(e,t,n){switch(e){case"top":case"bottom":return n?t?OT:DT:t?DT:OT;case"left":case"right":return t?L$:P$;default:return[]}}function z$(e,t,n,r){const s=ud(e);let i=U$(ii(e),n==="start",r);return s&&(i=i.map(c=>c+"-"+s),t&&(i=i.concat(i.map($1)))),i}function lg(e){return e.replace(/left|right|bottom|top/g,t=>D$[t])}function F$(e){return{top:0,right:0,bottom:0,left:0,...e}}function O4(e){return typeof e!="number"?F$(e):{top:e,right:e,bottom:e,left:e}}function cg(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function IT(e,t,n){let{reference:r,floating:s}=e;const i=uo(t),c=CS(t),u=SS(c),f=ii(t),m=i==="y",y=r.x+r.width/2-s.width/2,g=r.y+r.height/2-s.height/2,x=r[u]/2-s[u]/2;let v;switch(f){case"top":v={x:y,y:r.y-s.height};break;case"bottom":v={x:y,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:g};break;case"left":v={x:r.x-s.width,y:g};break;default:v={x:r.x,y:r.y}}switch(ud(t)){case"start":v[c]-=x*(n&&m?-1:1);break;case"end":v[c]+=x*(n&&m?-1:1);break}return v}const H$=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:c}=n,u=i.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:y,y:g}=IT(m,r,f),x=r,v={},C=0;for(let b=0;b<u.length;b++){const{name:w,fn:R}=u[b],{x:j,y:_,data:D,reset:O}=await R({x:y,y:g,initialPlacement:r,placement:x,strategy:s,middlewareData:v,rects:m,platform:c,elements:{reference:e,floating:t}});y=j??y,g=_??g,v={...v,[w]:{...v[w],...D}},O&&C<=50&&(C++,typeof O=="object"&&(O.placement&&(x=O.placement),O.rects&&(m=O.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):O.rects),{x:y,y:g}=IT(m,x,f)),b=-1)}return{x:y,y:g,placement:x,strategy:s,middlewareData:v}};async function Yf(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:c,elements:u,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:x=!1,padding:v=0}=oi(t,e),C=O4(v),w=u[x?g==="floating"?"reference":"floating":g],R=cg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:m,rootBoundary:y,strategy:f})),j=g==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),D=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},O=cg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:j,offsetParent:_,strategy:f}):j);return{top:(R.top-O.top+C.top)/D.y,bottom:(O.bottom-R.bottom+C.bottom)/D.y,left:(R.left-O.left+C.left)/D.x,right:(O.right-R.right+C.right)/D.x}}const $$=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:c,elements:u,middlewareData:f}=t,{element:m,padding:y=0}=oi(e,t)||{};if(m==null)return{};const g=O4(y),x={x:n,y:r},v=CS(s),C=SS(v),b=await c.getDimensions(m),w=v==="y",R=w?"top":"left",j=w?"bottom":"right",_=w?"clientHeight":"clientWidth",D=i.reference[C]+i.reference[v]-x[v]-i.floating[C],O=x[v]-i.reference[v],A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let T=A?A[_]:0;(!T||!await(c.isElement==null?void 0:c.isElement(A)))&&(T=u.floating[_]||i.floating[C]);const I=D/2-O/2,k=T/2-b[C]/2-1,V=dl(g[R],k),U=dl(g[j],k),K=V,G=T-b[C]-U,q=T/2-b[C]/2+I,H=H1(K,q,G),M=!f.arrow&&ud(s)!=null&&q!==H&&i.reference[C]/2-(q<K?V:U)-b[C]/2<0,B=M?q<K?q-K:q-G:0;return{[v]:x[v]+B,data:{[v]:H,centerOffset:q-H-B,...M&&{alignmentOffset:B}},reset:M}}}),V$=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:c,initialPlacement:u,platform:f,elements:m}=t,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:b=!0,...w}=oi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const R=ii(s),j=uo(u),_=ii(u)===u,D=await(f.isRTL==null?void 0:f.isRTL(m.floating)),O=x||(_||!b?[lg(u)]:k$(u)),A=C!=="none";!x&&A&&O.push(...z$(u,b,C,D));const T=[u,...O],I=await Yf(t,w),k=[];let V=((r=i.flip)==null?void 0:r.overflows)||[];if(y&&k.push(I[R]),g){const q=M$(s,c,D);k.push(I[q[0]],I[q[1]])}if(V=[...V,{placement:s,overflows:k}],!k.every(q=>q<=0)){var U,K;const q=(((U=i.flip)==null?void 0:U.index)||0)+1,H=T[q];if(H&&(!(g==="alignment"?j!==uo(H):!1)||V.every($=>uo($.placement)===j?$.overflows[0]>0:!0)))return{data:{index:q,overflows:V},reset:{placement:H}};let M=(K=V.filter(B=>B.overflows[0]<=0).sort((B,$)=>B.overflows[1]-$.overflows[1])[0])==null?void 0:K.placement;if(!M)switch(v){case"bestFit":{var G;const B=(G=V.filter($=>{if(A){const re=uo($.placement);return re===j||re==="y"}return!0}).map($=>[$.placement,$.overflows.filter(re=>re>0).reduce((re,ge)=>re+ge,0)]).sort(($,re)=>$[1]-re[1])[0])==null?void 0:G[0];B&&(M=B);break}case"initialPlacement":M=u;break}if(s!==M)return{reset:{placement:M}}}return{}}}};function MT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kT(e){return A$.some(t=>e[t]>=0)}const G$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=oi(e,t);switch(r){case"referenceHidden":{const i=await Yf(t,{...s,elementContext:"reference"}),c=MT(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:kT(c)}}}case"escaped":{const i=await Yf(t,{...s,altBoundary:!0}),c=MT(i,n.floating);return{data:{escapedOffsets:c,escaped:kT(c)}}}default:return{}}}}},I4=new Set(["left","top"]);async function B$(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=ii(n),u=ud(n),f=uo(n)==="y",m=I4.has(c)?-1:1,y=i&&f?-1:1,g=oi(t,e);let{mainAxis:x,crossAxis:v,alignmentAxis:C}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof C=="number"&&(v=u==="end"?C*-1:C),f?{x:v*y,y:x*m}:{x:x*m,y:v*y}}const q$=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:c,middlewareData:u}=t,f=await B$(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+f.x,y:i+f.y,data:{...f,placement:c}}}}},K$=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:w=>{let{x:R,y:j}=w;return{x:R,y:j}}},...f}=oi(e,t),m={x:n,y:r},y=await Yf(t,f),g=uo(ii(s)),x=bS(g);let v=m[x],C=m[g];if(i){const w=x==="y"?"top":"left",R=x==="y"?"bottom":"right",j=v+y[w],_=v-y[R];v=H1(j,v,_)}if(c){const w=g==="y"?"top":"left",R=g==="y"?"bottom":"right",j=C+y[w],_=C-y[R];C=H1(j,C,_)}const b=u.fn({...t,[x]:v,[g]:C});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[x]:i,[g]:c}}}}}},Z$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:m=!0}=oi(e,t),y={x:n,y:r},g=uo(s),x=bS(g);let v=y[x],C=y[g];const b=oi(u,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(f){const _=x==="y"?"height":"width",D=i.reference[x]-i.floating[_]+w.mainAxis,O=i.reference[x]+i.reference[_]-w.mainAxis;v<D?v=D:v>O&&(v=O)}if(m){var R,j;const _=x==="y"?"width":"height",D=I4.has(ii(s)),O=i.reference[g]-i.floating[_]+(D&&((R=c.offset)==null?void 0:R[g])||0)+(D?0:w.crossAxis),A=i.reference[g]+i.reference[_]+(D?0:((j=c.offset)==null?void 0:j[g])||0)-(D?w.crossAxis:0);C<O?C=O:C>A&&(C=A)}return{[x]:v,[g]:C}}}},Y$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:c,elements:u}=t,{apply:f=()=>{},...m}=oi(e,t),y=await Yf(t,m),g=ii(s),x=ud(s),v=uo(s)==="y",{width:C,height:b}=i.floating;let w,R;g==="top"||g==="bottom"?(w=g,R=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,w=x==="end"?"top":"bottom");const j=b-y.top-y.bottom,_=C-y.left-y.right,D=dl(b-y[w],j),O=dl(C-y[R],_),A=!t.middlewareData.shift;let T=D,I=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=j),A&&!x){const V=Ka(y.left,0),U=Ka(y.right,0),K=Ka(y.top,0),G=Ka(y.bottom,0);v?I=C-2*(V!==0||U!==0?V+U:Ka(y.left,y.right)):T=b-2*(K!==0||G!==0?K+G:Ka(y.top,y.bottom))}await f({...t,availableWidth:I,availableHeight:T});const k=await c.getDimensions(u.floating);return C!==k.width||b!==k.height?{reset:{rects:!0}}:{}}}};function ly(){return typeof window<"u"}function dd(e){return M4(e)?(e.nodeName||"").toLowerCase():"#document"}function Wa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Eo(e){var t;return(t=(M4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function M4(e){return ly()?e instanceof Node||e instanceof Wa(e).Node:!1}function Hs(e){return ly()?e instanceof Element||e instanceof Wa(e).Element:!1}function So(e){return ly()?e instanceof HTMLElement||e instanceof Wa(e).HTMLElement:!1}function LT(e){return!ly()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wa(e).ShadowRoot}const W$=new Set(["inline","contents"]);function Ch(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=$s(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!W$.has(s)}const X$=new Set(["table","td","th"]);function Q$(e){return X$.has(dd(e))}const J$=[":popover-open",":modal"];function cy(e){return J$.some(t=>{try{return e.matches(t)}catch{return!1}})}const eV=["transform","translate","scale","rotate","perspective"],tV=["transform","translate","scale","rotate","perspective","filter"],nV=["paint","layout","strict","content"];function wS(e){const t=ES(),n=Hs(e)?$s(e):e;return eV.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||tV.some(r=>(n.willChange||"").includes(r))||nV.some(r=>(n.contain||"").includes(r))}function rV(e){let t=fl(e);for(;So(t)&&!Xu(t);){if(wS(t))return t;if(cy(t))return null;t=fl(t)}return null}function ES(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const aV=new Set(["html","body","#document"]);function Xu(e){return aV.has(dd(e))}function $s(e){return Wa(e).getComputedStyle(e)}function uy(e){return Hs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fl(e){if(dd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||LT(e)&&e.host||Eo(e);return LT(t)?t.host:t}function k4(e){const t=fl(e);return Xu(t)?e.ownerDocument?e.ownerDocument.body:e.body:So(t)&&Ch(t)?t:k4(t)}function Wf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=k4(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),c=Wa(s);if(i){const u=V1(c);return t.concat(c,c.visualViewport||[],Ch(s)?s:[],u&&n?Wf(u):[])}return t.concat(s,Wf(s,[],n))}function V1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function L4(e){const t=$s(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=So(e),i=s?e.offsetWidth:n,c=s?e.offsetHeight:r,u=ig(n)!==i||ig(r)!==c;return u&&(n=i,r=c),{width:n,height:r,$:u}}function RS(e){return Hs(e)?e:e.contextElement}function Fu(e){const t=RS(e);if(!So(t))return mo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=L4(t);let c=(i?ig(n.width):n.width)/r,u=(i?ig(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const sV=mo(0);function P4(e){const t=Wa(e);return!ES()||!t.visualViewport?sV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function oV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wa(e)?!1:t}function fc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=RS(e);let c=mo(1);t&&(r?Hs(r)&&(c=Fu(r)):c=Fu(e));const u=oV(i,n,r)?P4(i):mo(0);let f=(s.left+u.x)/c.x,m=(s.top+u.y)/c.y,y=s.width/c.x,g=s.height/c.y;if(i){const x=Wa(i),v=r&&Hs(r)?Wa(r):r;let C=x,b=V1(C);for(;b&&r&&v!==C;){const w=Fu(b),R=b.getBoundingClientRect(),j=$s(b),_=R.left+(b.clientLeft+parseFloat(j.paddingLeft))*w.x,D=R.top+(b.clientTop+parseFloat(j.paddingTop))*w.y;f*=w.x,m*=w.y,y*=w.x,g*=w.y,f+=_,m+=D,C=Wa(b),b=V1(C)}}return cg({width:y,height:g,x:f,y:m})}function dy(e,t){const n=uy(e).scrollLeft;return t?t.left+n:fc(Eo(e)).left+n}function U4(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-dy(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function iV(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",c=Eo(r),u=t?cy(t.floating):!1;if(r===c||u&&i)return n;let f={scrollLeft:0,scrollTop:0},m=mo(1);const y=mo(0),g=So(r);if((g||!g&&!i)&&((dd(r)!=="body"||Ch(c))&&(f=uy(r)),So(r))){const v=fc(r);m=Fu(r),y.x=v.x+r.clientLeft,y.y=v.y+r.clientTop}const x=c&&!g&&!i?U4(c,f):mo(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+y.x+x.x,y:n.y*m.y-f.scrollTop*m.y+y.y+x.y}}function lV(e){return Array.from(e.getClientRects())}function cV(e){const t=Eo(e),n=uy(e),r=e.ownerDocument.body,s=Ka(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ka(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+dy(e);const u=-n.scrollTop;return $s(r).direction==="rtl"&&(c+=Ka(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:c,y:u}}const PT=25;function uV(e,t){const n=Wa(e),r=Eo(e),s=n.visualViewport;let i=r.clientWidth,c=r.clientHeight,u=0,f=0;if(s){i=s.width,c=s.height;const y=ES();(!y||y&&t==="fixed")&&(u=s.offsetLeft,f=s.offsetTop)}const m=dy(r);if(m<=0){const y=r.ownerDocument,g=y.body,x=getComputedStyle(g),v=y.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,C=Math.abs(r.clientWidth-g.clientWidth-v);C<=PT&&(i-=C)}else m<=PT&&(i+=m);return{width:i,height:c,x:u,y:f}}const dV=new Set(["absolute","fixed"]);function fV(e,t){const n=fc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=So(e)?Fu(e):mo(1),c=e.clientWidth*i.x,u=e.clientHeight*i.y,f=s*i.x,m=r*i.y;return{width:c,height:u,x:f,y:m}}function UT(e,t,n){let r;if(t==="viewport")r=uV(e,n);else if(t==="document")r=cV(Eo(e));else if(Hs(t))r=fV(t,n);else{const s=P4(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return cg(r)}function z4(e,t){const n=fl(e);return n===t||!Hs(n)||Xu(n)?!1:$s(n).position==="fixed"||z4(n,t)}function hV(e,t){const n=t.get(e);if(n)return n;let r=Wf(e,[],!1).filter(u=>Hs(u)&&dd(u)!=="body"),s=null;const i=$s(e).position==="fixed";let c=i?fl(e):e;for(;Hs(c)&&!Xu(c);){const u=$s(c),f=wS(c);!f&&u.position==="fixed"&&(s=null),(i?!f&&!s:!f&&u.position==="static"&&!!s&&dV.has(s.position)||Ch(c)&&!f&&z4(e,c))?r=r.filter(y=>y!==c):s=u,c=fl(c)}return t.set(e,r),r}function mV(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?cy(t)?[]:hV(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((m,y)=>{const g=UT(t,y,s);return m.top=Ka(g.top,m.top),m.right=dl(g.right,m.right),m.bottom=dl(g.bottom,m.bottom),m.left=Ka(g.left,m.left),m},UT(t,u,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function pV(e){const{width:t,height:n}=L4(e);return{width:t,height:n}}function gV(e,t,n){const r=So(t),s=Eo(t),i=n==="fixed",c=fc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=mo(0);function m(){f.x=dy(s)}if(r||!r&&!i)if((dd(t)!=="body"||Ch(s))&&(u=uy(t)),r){const v=fc(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else s&&m();i&&!r&&s&&m();const y=s&&!r&&!i?U4(s,u):mo(0),g=c.left+u.scrollLeft-f.x-y.x,x=c.top+u.scrollTop-f.y-y.y;return{x:g,y:x,width:c.width,height:c.height}}function z0(e){return $s(e).position==="static"}function zT(e,t){if(!So(e)||$s(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Eo(e)===n&&(n=n.ownerDocument.body),n}function F4(e,t){const n=Wa(e);if(cy(e))return n;if(!So(e)){let s=fl(e);for(;s&&!Xu(s);){if(Hs(s)&&!z0(s))return s;s=fl(s)}return n}let r=zT(e,t);for(;r&&Q$(r)&&z0(r);)r=zT(r,t);return r&&Xu(r)&&z0(r)&&!wS(r)?n:r||rV(e)||n}const yV=async function(e){const t=this.getOffsetParent||F4,n=this.getDimensions,r=await n(e.floating);return{reference:gV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xV(e){return $s(e).direction==="rtl"}const vV={convertOffsetParentRelativeRectToViewportRelativeRect:iV,getDocumentElement:Eo,getClippingRect:mV,getOffsetParent:F4,getElementRects:yV,getClientRects:lV,getDimensions:pV,getScale:Fu,isElement:Hs,isRTL:xV};function H4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bV(e,t){let n=null,r;const s=Eo(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),i();const m=e.getBoundingClientRect(),{left:y,top:g,width:x,height:v}=m;if(u||t(),!x||!v)return;const C=xp(g),b=xp(s.clientWidth-(y+x)),w=xp(s.clientHeight-(g+v)),R=xp(y),_={rootMargin:-C+"px "+-b+"px "+-w+"px "+-R+"px",threshold:Ka(0,dl(1,f))||1};let D=!0;function O(A){const T=A[0].intersectionRatio;if(T!==f){if(!D)return c();T?c(!1,T):r=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!H4(m,e.getBoundingClientRect())&&c(),D=!1}try{n=new IntersectionObserver(O,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,_)}n.observe(e)}return c(!0),i}function SV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,m=RS(e),y=s||i?[...m?Wf(m):[],...Wf(t)]:[];y.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=m&&u?bV(m,n):null;let x=-1,v=null;c&&(v=new ResizeObserver(R=>{let[j]=R;j&&j.target===m&&v&&(v.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var _;(_=v)==null||_.observe(t)})),n()}),m&&!f&&v.observe(m),v.observe(t));let C,b=f?fc(e):null;f&&w();function w(){const R=fc(e);b&&!H4(b,R)&&n(),b=R,C=requestAnimationFrame(w)}return n(),()=>{var R;y.forEach(j=>{s&&j.removeEventListener("scroll",n),i&&j.removeEventListener("resize",n)}),g==null||g(),(R=v)==null||R.disconnect(),v=null,f&&cancelAnimationFrame(C)}}const CV=q$,wV=K$,EV=V$,RV=Y$,jV=G$,FT=$$,TV=Z$,_V=(e,t,n)=>{const r=new Map,s={platform:vV,...n},i={...s.platform,_c:r};return H$(e,t,{...s,platform:i})};var NV=typeof document<"u",AV=function(){},Gp=NV?h.useLayoutEffect:AV;function ug(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ug(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!ug(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function $4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function HT(e,t){const n=$4(e);return Math.round(t*n)/n}function F0(e){const t=h.useRef(e);return Gp(()=>{t.current=e}),t}function DV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:c}={},transform:u=!0,whileElementsMounted:f,open:m}=e,[y,g]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,v]=h.useState(r);ug(x,r)||v(r);const[C,b]=h.useState(null),[w,R]=h.useState(null),j=h.useCallback($=>{$!==A.current&&(A.current=$,b($))},[]),_=h.useCallback($=>{$!==T.current&&(T.current=$,R($))},[]),D=i||C,O=c||w,A=h.useRef(null),T=h.useRef(null),I=h.useRef(y),k=f!=null,V=F0(f),U=F0(s),K=F0(m),G=h.useCallback(()=>{if(!A.current||!T.current)return;const $={placement:t,strategy:n,middleware:x};U.current&&($.platform=U.current),_V(A.current,T.current,$).then(re=>{const ge={...re,isPositioned:K.current!==!1};q.current&&!ug(I.current,ge)&&(I.current=ge,Ls.flushSync(()=>{g(ge)}))})},[x,t,n,U,K]);Gp(()=>{m===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[m]);const q=h.useRef(!1);Gp(()=>(q.current=!0,()=>{q.current=!1}),[]),Gp(()=>{if(D&&(A.current=D),O&&(T.current=O),D&&O){if(V.current)return V.current(D,O,G);G()}},[D,O,G,V,k]);const H=h.useMemo(()=>({reference:A,floating:T,setReference:j,setFloating:_}),[j,_]),M=h.useMemo(()=>({reference:D,floating:O}),[D,O]),B=h.useMemo(()=>{const $={position:n,left:0,top:0};if(!M.floating)return $;const re=HT(M.floating,y.x),ge=HT(M.floating,y.y);return u?{...$,transform:"translate("+re+"px, "+ge+"px)",...$4(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:re,top:ge}},[n,u,M.floating,y.x,y.y]);return h.useMemo(()=>({...y,update:G,refs:H,elements:M,floatingStyles:B}),[y,G,H,M,B])}const OV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?FT({element:r.current,padding:s}).fn(n):{}:r?FT({element:r,padding:s}).fn(n):{}}}},IV=(e,t)=>({...CV(e),options:[e,t]}),MV=(e,t)=>({...wV(e),options:[e,t]}),kV=(e,t)=>({...TV(e),options:[e,t]}),LV=(e,t)=>({...EV(e),options:[e,t]}),PV=(e,t)=>({...RV(e),options:[e,t]}),UV=(e,t)=>({...jV(e),options:[e,t]}),zV=(e,t)=>({...OV(e),options:[e,t]});var FV="Arrow",V4=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(et.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});V4.displayName=FV;var HV=V4;function jS(e){const[t,n]=h.useState(void 0);return Hr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let c,u;if("borderBoxSize"in i){const f=i.borderBoxSize,m=Array.isArray(f)?f[0]:f;c=m.inlineSize,u=m.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var TS="Popper",[G4,Ro]=Sr(TS),[$V,B4]=G4(TS),q4=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null);return a.jsx($V,{scope:t,anchor:r,onAnchorChange:s,children:n})};q4.displayName=TS;var K4="PopperAnchor",Z4=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=B4(K4,n),c=h.useRef(null),u=ht(t,c),f=h.useRef(null);return h.useEffect(()=>{const m=f.current;f.current=(r==null?void 0:r.current)||c.current,m!==f.current&&i.onAnchorChange(f.current)}),r?null:a.jsx(et.div,{...s,ref:u})});Z4.displayName=K4;var _S="PopperContent",[VV,GV]=G4(_S),Y4=h.forwardRef((e,t)=>{var J,ie,ye,Ce,He,Ee;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:g="partial",hideWhenDetached:x=!1,updatePositionStrategy:v="optimized",onPlaced:C,...b}=e,w=B4(_S,n),[R,j]=h.useState(null),_=ht(t,Ke=>j(Ke)),[D,O]=h.useState(null),A=jS(D),T=(A==null?void 0:A.width)??0,I=(A==null?void 0:A.height)??0,k=r+(i!=="center"?"-"+i:""),V=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},U=Array.isArray(m)?m:[m],K=U.length>0,G={padding:V,boundary:U.filter(qV),altBoundary:K},{refs:q,floatingStyles:H,placement:M,isPositioned:B,middlewareData:$}=DV({strategy:"fixed",placement:k,whileElementsMounted:(...Ke)=>SV(...Ke,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[IV({mainAxis:s+I,alignmentAxis:c}),f&&MV({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?kV():void 0,...G}),f&&LV({...G}),PV({...G,apply:({elements:Ke,rects:nt,availableWidth:Ft,availableHeight:Pt})=>{const{width:On,height:yn}=nt.reference,ke=Ke.floating.style;ke.setProperty("--radix-popper-available-width",`${Ft}px`),ke.setProperty("--radix-popper-available-height",`${Pt}px`),ke.setProperty("--radix-popper-anchor-width",`${On}px`),ke.setProperty("--radix-popper-anchor-height",`${yn}px`)}}),D&&zV({element:D,padding:u}),KV({arrowWidth:T,arrowHeight:I}),x&&UV({strategy:"referenceHidden",...G})]}),[re,ge]=Q4(M),P=Fs(C);Hr(()=>{B&&(P==null||P())},[B,P]);const z=(J=$.arrow)==null?void 0:J.x,F=(ie=$.arrow)==null?void 0:ie.y,Z=((ye=$.arrow)==null?void 0:ye.centerOffset)!==0,[Q,le]=h.useState();return Hr(()=>{R&&le(window.getComputedStyle(R).zIndex)},[R]),a.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:B?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(Ce=$.transformOrigin)==null?void 0:Ce.x,(He=$.transformOrigin)==null?void 0:He.y].join(" "),...((Ee=$.hide)==null?void 0:Ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(VV,{scope:n,placedSide:re,onArrowChange:O,arrowX:z,arrowY:F,shouldHideArrow:Z,children:a.jsx(et.div,{"data-side":re,"data-align":ge,...b,ref:_,style:{...b.style,animation:B?void 0:"none"}})})})});Y4.displayName=_S;var W4="PopperArrow",BV={top:"bottom",right:"left",bottom:"top",left:"right"},X4=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=GV(W4,r),c=BV[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(HV,{...s,ref:n,style:{...s.style,display:"block"}})})});X4.displayName=W4;function qV(e){return e!==null}var KV=e=>({name:"transformOrigin",options:e,fn(t){var w,R,j;const{placement:n,rects:r,middlewareData:s}=t,c=((w=s.arrow)==null?void 0:w.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,y]=Q4(n),g={start:"0%",center:"50%",end:"100%"}[y],x=(((R=s.arrow)==null?void 0:R.x)??0)+u/2,v=(((j=s.arrow)==null?void 0:j.y)??0)+f/2;let C="",b="";return m==="bottom"?(C=c?g:`${x}px`,b=`${-f}px`):m==="top"?(C=c?g:`${x}px`,b=`${r.floating.height+f}px`):m==="right"?(C=`${-f}px`,b=c?g:`${v}px`):m==="left"&&(C=`${r.floating.width+f}px`,b=c?g:`${v}px`),{data:{x:C,y:b}}}});function Q4(e){const[t,n="center"]=e.split("-");return[t,n]}var fd=q4,hd=Z4,wh=Y4,Eh=X4,ZV=Symbol("radix.slottable");function YV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ZV,t}var J4=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"}),WV="VisuallyHidden",e3=h.forwardRef((e,t)=>a.jsx(et.span,{...e,ref:t,style:{...J4,...e.style}}));e3.displayName=WV;var XV=e3,[fy]=Sr("Tooltip",[Ro]),hy=Ro(),t3="TooltipProvider",QV=700,G1="tooltip.open",[JV,NS]=fy(t3),n3=e=>{const{__scopeTooltip:t,delayDuration:n=QV,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,c=h.useRef(!0),u=h.useRef(!1),f=h.useRef(0);return h.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),a.jsx(JV,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:h.useCallback(m=>{u.current=m},[]),disableHoverableContent:s,children:i})};n3.displayName=t3;var Xf="Tooltip",[eG,Rh]=fy(Xf),r3=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:c,delayDuration:u}=e,f=NS(Xf,e.__scopeTooltip),m=hy(t),[y,g]=h.useState(null),x=er(),v=h.useRef(0),C=c??f.disableHoverableContent,b=u??f.delayDuration,w=h.useRef(!1),[R,j]=ia({prop:r,defaultProp:s??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(G1))):f.onClose(),i==null||i(T)},caller:Xf}),_=h.useMemo(()=>R?w.current?"delayed-open":"instant-open":"closed",[R]),D=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,w.current=!1,j(!0)},[j]),O=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,j(!1)},[j]),A=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{w.current=!0,j(!0),v.current=0},b)},[b,j]);return h.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(fd,{...m,children:a.jsx(eG,{scope:t,contentId:x,open:R,stateAttribute:_,trigger:y,onTriggerChange:g,onTriggerEnter:h.useCallback(()=>{f.isOpenDelayedRef.current?A():D()},[f.isOpenDelayedRef,A,D]),onTriggerLeave:h.useCallback(()=>{C?O():(window.clearTimeout(v.current),v.current=0)},[O,C]),onOpen:D,onClose:O,disableHoverableContent:C,children:n})})};r3.displayName=Xf;var B1="TooltipTrigger",a3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Rh(B1,n),i=NS(B1,n),c=hy(n),u=h.useRef(null),f=ht(t,u,s.onTriggerChange),m=h.useRef(!1),y=h.useRef(!1),g=h.useCallback(()=>m.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),a.jsx(hd,{asChild:!0,...c,children:a.jsx(et.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:Me(e.onPointerMove,x=>{x.pointerType!=="touch"&&!y.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),y.current=!0)}),onPointerLeave:Me(e.onPointerLeave,()=>{s.onTriggerLeave(),y.current=!1}),onPointerDown:Me(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Me(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Me(e.onBlur,s.onClose),onClick:Me(e.onClick,s.onClose)})})});a3.displayName=B1;var AS="TooltipPortal",[tG,nG]=fy(AS,{forceMount:void 0}),s3=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=Rh(AS,t);return a.jsx(tG,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:r})})})};s3.displayName=AS;var Qu="TooltipContent",o3=h.forwardRef((e,t)=>{const n=nG(Qu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,c=Rh(Qu,e.__scopeTooltip);return a.jsx(Vr,{present:r||c.open,children:c.disableHoverableContent?a.jsx(i3,{side:s,...i,ref:t}):a.jsx(rG,{side:s,...i,ref:t})})}),rG=h.forwardRef((e,t)=>{const n=Rh(Qu,e.__scopeTooltip),r=NS(Qu,e.__scopeTooltip),s=h.useRef(null),i=ht(t,s),[c,u]=h.useState(null),{trigger:f,onClose:m}=n,y=s.current,{onPointerInTransitChange:g}=r,x=h.useCallback(()=>{u(null),g(!1)},[g]),v=h.useCallback((C,b)=>{const w=C.currentTarget,R={x:C.clientX,y:C.clientY},j=iG(R,w.getBoundingClientRect()),_=lG(R,j),D=cG(b.getBoundingClientRect()),O=dG([..._,...D]);u(O),g(!0)},[g]);return h.useEffect(()=>()=>x(),[x]),h.useEffect(()=>{if(f&&y){const C=w=>v(w,y),b=w=>v(w,f);return f.addEventListener("pointerleave",C),y.addEventListener("pointerleave",b),()=>{f.removeEventListener("pointerleave",C),y.removeEventListener("pointerleave",b)}}},[f,y,v,x]),h.useEffect(()=>{if(c){const C=b=>{const w=b.target,R={x:b.clientX,y:b.clientY},j=(f==null?void 0:f.contains(w))||(y==null?void 0:y.contains(w)),_=!uG(R,c);j?x():_&&(x(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[f,y,c,m,x]),a.jsx(i3,{...e,ref:i})}),[aG,sG]=fy(Xf,{isInside:!1}),oG=YV("TooltipContent"),i3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:c,...u}=e,f=Rh(Qu,n),m=hy(n),{onClose:y}=f;return h.useEffect(()=>(document.addEventListener(G1,y),()=>document.removeEventListener(G1,y)),[y]),h.useEffect(()=>{if(f.trigger){const g=x=>{const v=x.target;v!=null&&v.contains(f.trigger)&&y()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,y]),a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:y,children:a.jsxs(wh,{"data-state":f.stateAttribute,...m,...u,ref:t,style:{...u.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:[a.jsx(oG,{children:r}),a.jsx(aG,{scope:n,isInside:!0,children:a.jsx(XV,{id:f.contentId,role:"tooltip",children:s||r})})]})})});o3.displayName=Qu;var l3="TooltipArrow",c3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=hy(n);return sG(l3,n).isInside?null:a.jsx(Eh,{...s,...r,ref:t})});c3.displayName=l3;function iG(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function lG(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function cG(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function uG(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,c=t.length-1;i<t.length;c=i++){const u=t[i],f=t[c],m=u.x,y=u.y,g=f.x,x=f.y;y>r!=x>r&&n<(g-m)*(r-y)/(x-y)+m&&(s=!s)}return s}function dG(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),fG(t)}function fG(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],c=t[t.length-2];if((i.x-c.x)*(s.y-c.y)>=(i.y-c.y)*(s.x-c.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],c=n[n.length-2];if((i.x-c.x)*(s.y-c.y)>=(i.y-c.y)*(s.x-c.x))n.pop();else break}n.push(s)}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 hG=n3,mG=r3,pG=a3,gG=s3,yG=o3,xG=c3;function Ya({delayDuration:e=0,...t}){return a.jsx(hG,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function vt({...e}){return a.jsx(Ya,{children:a.jsx(mG,{"data-slot":"tooltip",...e})})}function bt({...e}){return a.jsx(pG,{"data-slot":"tooltip-trigger",...e})}function St({className:e,sideOffset:t=0,children:n,...r}){return a.jsx(gG,{children:a.jsxs(yG,{"data-slot":"tooltip-content",sideOffset:t,className:se("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 bg-black px-3 py-1.5 text-xs text-balance text-white dark:bg-white dark:text-black",e),...r,children:[n,a.jsx(xG,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-black fill-black dark:bg-white dark:fill-white"})]})})}const vG="sidebar_state",bG=3600*24*7,SG="16rem",CG="18rem",wG="3rem",EG="b",u3=h.createContext(null);function jh(){const e=h.useContext(u3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function RG({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...c}){const u=Qz(),[f,m]=h.useState(!1),[y,g]=h.useState(e),x=t??y,v=h.useCallback(R=>{const j=typeof R=="function"?R(x):R;n?n(j):g(j),document.cookie=`${vG}=${j}; path=/; max-age=${bG}`},[n,x]),C=h.useCallback(()=>u?m(R=>!R):v(R=>!R),[u,v,m]);h.useEffect(()=>{const R=j=>{j.key===EG&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),C())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[C]);const b=x?"expanded":"collapsed",w=h.useMemo(()=>({state:b,open:x,setOpen:v,isMobile:u,openMobile:f,setOpenMobile:m,toggleSidebar:C}),[b,x,v,u,f,m,C]);return a.jsx(u3.Provider,{value:w,children:a.jsx(Ya,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":SG,"--sidebar-width-icon":wG,...s},className:se("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:i})})})}function jG({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:m}=jh();return n==="none"?a.jsx("div",{"data-slot":"sidebar",className:se("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:s}):c?a.jsx(ui,{open:f,onOpenChange:m,...i,children:a.jsxs(di,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) min-w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":CG},side:e,children:[a.jsxs(fi,{className:"sr-only",children:[a.jsx(hi,{children:"Sidebar"}),a.jsx(yl,{children:"Displays the mobile sidebar."})]}),a.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):a.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[a.jsx("div",{"data-slot":"sidebar-gap",className:se("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)")}),a.jsx("div",{"data-slot":"sidebar-container",className:se("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",r),...i,children:a.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:s})})]})}function TG({className:e,onClick:t,...n}){const{toggleSidebar:r}=jh();return a.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:a.jsxs(we,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:se("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[a.jsx(QU,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function _G({className:e,...t}){const{toggleSidebar:n}=jh();return a.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:se("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 NG({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:se("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 AG({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:se("flex flex-col gap-2 p-2",e),...t})}function DG({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:se("flex flex-col gap-2 p-2",e),...t})}function OG({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:se("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function $T({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:se("relative flex w-full min-w-0 flex-col p-2",e),...t})}function VT({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:se("w-full text-sm",e),...t})}function IG({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:se("flex w-full min-w-0 flex-col gap-1",e),...t})}function MG({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:se("group/menu-item relative",e),...t})}const kG=Ec("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 LG({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...c}){const u=e?gh:"button",{isMobile:f,state:m}=jh(),y=a.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:se(kG({variant:n,size:r}),i),...c});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:y}),a.jsx(St,{side:"right",align:"center",hidden:m!=="collapsed"||f,...s})]})):y}function q1(e){const t=PG(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(zG);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function PG(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=HG(s),u=FG(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UG=Symbol("radix.slottable");function zG(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UG}function FG(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function HG(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $G(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:w,children:R}=b,j=ae.useRef(null),_=ae.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=q1(u),m=ae.forwardRef((b,w)=>{const{scope:R,children:j}=b,_=i(u,R),D=ht(w,_.collectionRef);return a.jsx(f,{ref:D,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=q1(y),v=ae.forwardRef((b,w)=>{const{scope:R,children:j,..._}=b,D=ae.useRef(null),O=ht(w,D),A=i(y,R);return ae.useEffect(()=>(A.itemMap.set(D,{ref:D,..._}),()=>void A.itemMap.delete(D))),a.jsx(x,{[g]:"",ref:O,children:j})});v.displayName=y;function C(b){const w=i(e+"CollectionConsumer",b);return ae.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var VG=h.createContext(void 0);function Th(e){const t=h.useContext(VG);return e||t||"ltr"}function GT(e){const t=GG(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(qG);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function GG(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=ZG(s),u=KG(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BG=Symbol("radix.slottable");function qG(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BG}function KG(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function ZG(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function YG(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:w,children:R}=b,j=ae.useRef(null),_=ae.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=GT(u),m=ae.forwardRef((b,w)=>{const{scope:R,children:j}=b,_=i(u,R),D=ht(w,_.collectionRef);return a.jsx(f,{ref:D,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=GT(y),v=ae.forwardRef((b,w)=>{const{scope:R,children:j,..._}=b,D=ae.useRef(null),O=ht(w,D),A=i(y,R);return ae.useEffect(()=>(A.itemMap.set(D,{ref:D,..._}),()=>void A.itemMap.delete(D))),a.jsx(x,{[g]:"",ref:O,children:j})});v.displayName=y;function C(b){const w=i(e+"CollectionConsumer",b);return ae.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var H0="rovingFocusGroup.onEntryFocus",WG={bubbles:!1,cancelable:!0},_h="RovingFocusGroup",[K1,d3,XG]=YG(_h),[QG,my]=Sr(_h,[XG]),[JG,eB]=QG(_h),f3=h.forwardRef((e,t)=>a.jsx(K1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(K1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(tB,{...e,ref:t})})}));f3.displayName=_h;var tB=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...g}=e,x=h.useRef(null),v=ht(t,x),C=Th(i),[b,w]=ia({prop:c,defaultProp:u??null,onChange:f,caller:_h}),[R,j]=h.useState(!1),_=Fs(m),D=d3(n),O=h.useRef(!1),[A,T]=h.useState(0);return h.useEffect(()=>{const I=x.current;if(I)return I.addEventListener(H0,_),()=>I.removeEventListener(H0,_)},[_]),a.jsx(JG,{scope:n,orientation:r,dir:C,loop:s,currentTabStopId:b,onItemFocus:h.useCallback(I=>w(I),[w]),onItemShiftTab:h.useCallback(()=>j(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(I=>I+1),[]),onFocusableItemRemove:h.useCallback(()=>T(I=>I-1),[]),children:a.jsx(et.div,{tabIndex:R||A===0?-1:0,"data-orientation":r,...g,ref:v,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{O.current=!0}),onFocus:Me(e.onFocus,I=>{const k=!O.current;if(I.target===I.currentTarget&&k&&!R){const V=new CustomEvent(H0,WG);if(I.currentTarget.dispatchEvent(V),!V.defaultPrevented){const U=D().filter(M=>M.focusable),K=U.find(M=>M.active),G=U.find(M=>M.id===b),H=[K,G,...U].filter(Boolean).map(M=>M.ref.current);p3(H,y)}}O.current=!1}),onBlur:Me(e.onBlur,()=>j(!1))})})}),h3="RovingFocusGroupItem",m3=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:c,...u}=e,f=er(),m=i||f,y=eB(h3,n),g=y.currentTabStopId===m,x=d3(n),{onFocusableItemAdd:v,onFocusableItemRemove:C,currentTabStopId:b}=y;return h.useEffect(()=>{if(r)return v(),()=>C()},[r,v,C]),a.jsx(K1.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:a.jsx(et.span,{tabIndex:g?0:-1,"data-orientation":y.orientation,...u,ref:t,onMouseDown:Me(e.onMouseDown,w=>{r?y.onItemFocus(m):w.preventDefault()}),onFocus:Me(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:Me(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){y.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const R=aB(w,y.orientation,y.dir);if(R!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let _=x().filter(D=>D.focusable).map(D=>D.ref.current);if(R==="last")_.reverse();else if(R==="prev"||R==="next"){R==="prev"&&_.reverse();const D=_.indexOf(w.currentTarget);_=y.loop?sB(_,D+1):_.slice(D+1)}setTimeout(()=>p3(_))}}),children:typeof c=="function"?c({isCurrentTabStop:g,hasTabStop:b!=null}):c})})});m3.displayName=h3;var nB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rB(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function aB(e,t,n){const r=rB(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return nB[r]}function p3(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function sB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var g3=f3,y3=m3,Z1=["Enter"," "],oB=["ArrowDown","PageUp","Home"],x3=["ArrowUp","PageDown","End"],iB=[...oB,...x3],lB={ltr:[...Z1,"ArrowRight"],rtl:[...Z1,"ArrowLeft"]},cB={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Nh="Menu",[Qf,uB,dB]=$G(Nh),[Nc,v3]=Sr(Nh,[dB,Ro,my]),Ah=Ro(),b3=my(),[S3,xl]=Nc(Nh),[fB,Dh]=Nc(Nh),C3=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:c=!0}=e,u=Ah(t),[f,m]=h.useState(null),y=h.useRef(!1),g=Fs(i),x=Th(s);return h.useEffect(()=>{const v=()=>{y.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>y.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),a.jsx(fd,{...u,children:a.jsx(S3,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:m,children:a.jsx(fB,{scope:t,onClose:h.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:y,dir:x,modal:c,children:r})})})};C3.displayName=Nh;var hB="MenuAnchor",DS=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Ah(n);return a.jsx(hd,{...s,...r,ref:t})});DS.displayName=hB;var OS="MenuPortal",[mB,w3]=Nc(OS,{forceMount:void 0}),E3=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=xl(OS,t);return a.jsx(mB,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:r})})})};E3.displayName=OS;var gs="MenuContent",[pB,IS]=Nc(gs),R3=h.forwardRef((e,t)=>{const n=w3(gs,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=xl(gs,e.__scopeMenu),c=Dh(gs,e.__scopeMenu);return a.jsx(Qf.Provider,{scope:e.__scopeMenu,children:a.jsx(Vr,{present:r||i.open,children:a.jsx(Qf.Slot,{scope:e.__scopeMenu,children:c.modal?a.jsx(gB,{...s,ref:t}):a.jsx(yB,{...s,ref:t})})})})}),gB=h.forwardRef((e,t)=>{const n=xl(gs,e.__scopeMenu),r=h.useRef(null),s=ht(t,r);return h.useEffect(()=>{const i=r.current;if(i)return ty(i)},[]),a.jsx(MS,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),yB=h.forwardRef((e,t)=>{const n=xl(gs,e.__scopeMenu);return a.jsx(MS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),xB=q1("MenuContent.ScrollLock"),MS=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:x,onDismiss:v,disableOutsideScroll:C,...b}=e,w=xl(gs,n),R=Dh(gs,n),j=Ah(n),_=b3(n),D=uB(n),[O,A]=h.useState(null),T=h.useRef(null),I=ht(t,T,w.onContentChange),k=h.useRef(0),V=h.useRef(""),U=h.useRef(0),K=h.useRef(null),G=h.useRef("right"),q=h.useRef(0),H=C?Sh:h.Fragment,M=C?{as:xB,allowPinchZoom:!0}:void 0,B=re=>{var J,ie;const ge=V.current+re,P=D().filter(ye=>!ye.disabled),z=document.activeElement,F=(J=P.find(ye=>ye.ref.current===z))==null?void 0:J.textValue,Z=P.map(ye=>ye.textValue),Q=AB(Z,ge,F),le=(ie=P.find(ye=>ye.textValue===Q))==null?void 0:ie.ref.current;(function ye(Ce){V.current=Ce,window.clearTimeout(k.current),Ce!==""&&(k.current=window.setTimeout(()=>ye(""),1e3))})(ge),le&&setTimeout(()=>le.focus())};h.useEffect(()=>()=>window.clearTimeout(k.current),[]),Jg();const $=h.useCallback(re=>{var P,z;return G.current===((P=K.current)==null?void 0:P.side)&&OB(re,(z=K.current)==null?void 0:z.area)},[]);return a.jsx(pB,{scope:n,searchRef:V,onItemEnter:h.useCallback(re=>{$(re)&&re.preventDefault()},[$]),onItemLeave:h.useCallback(re=>{var ge;$(re)||((ge=T.current)==null||ge.focus(),A(null))},[$]),onTriggerLeave:h.useCallback(re=>{$(re)&&re.preventDefault()},[$]),pointerGraceTimerRef:U,onPointerGraceIntentChange:h.useCallback(re=>{K.current=re},[]),children:a.jsx(H,{...M,children:a.jsx(bh,{asChild:!0,trapped:s,onMountAutoFocus:Me(i,re=>{var ge;re.preventDefault(),(ge=T.current)==null||ge.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:x,onDismiss:v,children:a.jsx(g3,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Me(f,re=>{R.isUsingKeyboardRef.current||re.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(wh,{role:"menu","aria-orientation":"vertical","data-state":$3(w.open),"data-radix-menu-content":"",dir:R.dir,...j,...b,ref:I,style:{outline:"none",...b.style},onKeyDown:Me(b.onKeyDown,re=>{const P=re.target.closest("[data-radix-menu-content]")===re.currentTarget,z=re.ctrlKey||re.altKey||re.metaKey,F=re.key.length===1;P&&(re.key==="Tab"&&re.preventDefault(),!z&&F&&B(re.key));const Z=T.current;if(re.target!==Z||!iB.includes(re.key))return;re.preventDefault();const le=D().filter(J=>!J.disabled).map(J=>J.ref.current);x3.includes(re.key)&&le.reverse(),_B(le)}),onBlur:Me(e.onBlur,re=>{re.currentTarget.contains(re.target)||(window.clearTimeout(k.current),V.current="")}),onPointerMove:Me(e.onPointerMove,Jf(re=>{const ge=re.target,P=q.current!==re.clientX;if(re.currentTarget.contains(ge)&&P){const z=re.clientX>q.current?"right":"left";G.current=z,q.current=re.clientX}}))})})})})})})});R3.displayName=gs;var vB="MenuGroup",kS=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(et.div,{role:"group",...r,ref:t})});kS.displayName=vB;var bB="MenuLabel",j3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(et.div,{...r,ref:t})});j3.displayName=bB;var dg="MenuItem",BT="menu.itemSelect",py=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=h.useRef(null),c=Dh(dg,e.__scopeMenu),u=IS(dg,e.__scopeMenu),f=ht(t,i),m=h.useRef(!1),y=()=>{const g=i.current;if(!n&&g){const x=new CustomEvent(BT,{bubbles:!0,cancelable:!0});g.addEventListener(BT,v=>r==null?void 0:r(v),{once:!0}),r4(g,x),x.defaultPrevented?m.current=!1:c.onClose()}};return a.jsx(T3,{...s,ref:f,disabled:n,onClick:Me(e.onClick,y),onPointerDown:g=>{var x;(x=e.onPointerDown)==null||x.call(e,g),m.current=!0},onPointerUp:Me(e.onPointerUp,g=>{var x;m.current||(x=g.currentTarget)==null||x.click()}),onKeyDown:Me(e.onKeyDown,g=>{const x=u.searchRef.current!=="";n||x&&g.key===" "||Z1.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});py.displayName=dg;var T3=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,c=IS(dg,n),u=b3(n),f=h.useRef(null),m=ht(t,f),[y,g]=h.useState(!1),[x,v]=h.useState("");return h.useEffect(()=>{const C=f.current;C&&v((C.textContent??"").trim())},[i.children]),a.jsx(Qf.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:a.jsx(y3,{asChild:!0,...u,focusable:!r,children:a.jsx(et.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:m,onPointerMove:Me(e.onPointerMove,Jf(C=>{r?c.onItemLeave(C):(c.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Me(e.onPointerLeave,Jf(C=>c.onItemLeave(C))),onFocus:Me(e.onFocus,()=>g(!0)),onBlur:Me(e.onBlur,()=>g(!1))})})})}),SB="MenuCheckboxItem",_3=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(I3,{scope:e.__scopeMenu,checked:n,children:a.jsx(py,{role:"menuitemcheckbox","aria-checked":fg(n)?"mixed":n,...s,ref:t,"data-state":US(n),onSelect:Me(s.onSelect,()=>r==null?void 0:r(fg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_3.displayName=SB;var N3="MenuRadioGroup",[CB,wB]=Nc(N3,{value:void 0,onValueChange:()=>{}}),A3=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Fs(r);return a.jsx(CB,{scope:e.__scopeMenu,value:n,onValueChange:i,children:a.jsx(kS,{...s,ref:t})})});A3.displayName=N3;var D3="MenuRadioItem",O3=h.forwardRef((e,t)=>{const{value:n,...r}=e,s=wB(D3,e.__scopeMenu),i=n===s.value;return a.jsx(I3,{scope:e.__scopeMenu,checked:i,children:a.jsx(py,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":US(i),onSelect:Me(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});O3.displayName=D3;var LS="MenuItemIndicator",[I3,EB]=Nc(LS,{checked:!1}),M3=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=EB(LS,n);return a.jsx(Vr,{present:r||fg(i.checked)||i.checked===!0,children:a.jsx(et.span,{...s,ref:t,"data-state":US(i.checked)})})});M3.displayName=LS;var RB="MenuSeparator",k3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});k3.displayName=RB;var jB="MenuArrow",L3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Ah(n);return a.jsx(Eh,{...s,...r,ref:t})});L3.displayName=jB;var PS="MenuSub",[TB,P3]=Nc(PS),U3=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,i=xl(PS,t),c=Ah(t),[u,f]=h.useState(null),[m,y]=h.useState(null),g=Fs(s);return h.useEffect(()=>(i.open===!1&&g(!1),()=>g(!1)),[i.open,g]),a.jsx(fd,{...c,children:a.jsx(S3,{scope:t,open:r,onOpenChange:g,content:m,onContentChange:y,children:a.jsx(TB,{scope:t,contentId:er(),triggerId:er(),trigger:u,onTriggerChange:f,children:n})})})};U3.displayName=PS;var Df="MenuSubTrigger",z3=h.forwardRef((e,t)=>{const n=xl(Df,e.__scopeMenu),r=Dh(Df,e.__scopeMenu),s=P3(Df,e.__scopeMenu),i=IS(Df,e.__scopeMenu),c=h.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=i,m={__scopeMenu:e.__scopeMenu},y=h.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return h.useEffect(()=>y,[y]),h.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),f(null)}},[u,f]),a.jsx(DS,{asChild:!0,...m,children:a.jsx(T3,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":$3(n.open),...e,ref:Xr(t,s.onTriggerChange),onClick:g=>{var x;(x=e.onClick)==null||x.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,Jf(g=>{i.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(i.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),y()},100))})),onPointerLeave:Me(e.onPointerLeave,Jf(g=>{var v,C;y();const x=(v=n.content)==null?void 0:v.getBoundingClientRect();if(x){const b=(C=n.content)==null?void 0:C.dataset.side,w=b==="right",R=w?-5:5,j=x[w?"left":"right"],_=x[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:g.clientX+R,y:g.clientY},{x:j,y:x.top},{x:_,y:x.top},{x:_,y:x.bottom},{x:j,y:x.bottom}],side:b}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(g),g.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Me(e.onKeyDown,g=>{var v;const x=i.searchRef.current!=="";e.disabled||x&&g.key===" "||lB[r.dir].includes(g.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),g.preventDefault())})})})});z3.displayName=Df;var F3="MenuSubContent",H3=h.forwardRef((e,t)=>{const n=w3(gs,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=xl(gs,e.__scopeMenu),c=Dh(gs,e.__scopeMenu),u=P3(F3,e.__scopeMenu),f=h.useRef(null),m=ht(t,f);return a.jsx(Qf.Provider,{scope:e.__scopeMenu,children:a.jsx(Vr,{present:r||i.open,children:a.jsx(Qf.Slot,{scope:e.__scopeMenu,children:a.jsx(MS,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:m,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:y=>{var g;c.isUsingKeyboardRef.current&&((g=f.current)==null||g.focus()),y.preventDefault()},onCloseAutoFocus:y=>y.preventDefault(),onFocusOutside:Me(e.onFocusOutside,y=>{y.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Me(e.onEscapeKeyDown,y=>{c.onClose(),y.preventDefault()}),onKeyDown:Me(e.onKeyDown,y=>{var v;const g=y.currentTarget.contains(y.target),x=cB[c.dir].includes(y.key);g&&x&&(i.onOpenChange(!1),(v=u.trigger)==null||v.focus(),y.preventDefault())})})})})})});H3.displayName=F3;function $3(e){return e?"open":"closed"}function fg(e){return e==="indeterminate"}function US(e){return fg(e)?"indeterminate":e?"checked":"unchecked"}function _B(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function NB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function AB(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=NB(e,Math.max(i,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function DB(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,c=t.length-1;i<t.length;c=i++){const u=t[i],f=t[c],m=u.x,y=u.y,g=f.x,x=f.y;y>r!=x>r&&n<(g-m)*(r-y)/(x-y)+m&&(s=!s)}return s}function OB(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return DB(n,t)}function Jf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var IB=C3,MB=DS,kB=E3,LB=R3,PB=kS,UB=j3,zB=py,FB=_3,HB=A3,$B=O3,VB=M3,GB=k3,BB=L3,qB=U3,KB=z3,ZB=H3,gy="DropdownMenu",[YB]=Sr(gy,[v3]),Qr=v3(),[WB,V3]=YB(gy),G3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:c,modal:u=!0}=e,f=Qr(t),m=h.useRef(null),[y,g]=ia({prop:s,defaultProp:i??!1,onChange:c,caller:gy});return a.jsx(WB,{scope:t,triggerId:er(),triggerRef:m,contentId:er(),open:y,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(x=>!x),[g]),modal:u,children:a.jsx(IB,{...f,open:y,onOpenChange:g,dir:r,modal:u,children:n})})};G3.displayName=gy;var B3="DropdownMenuTrigger",q3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=V3(B3,n),c=Qr(n);return a.jsx(MB,{asChild:!0,...c,children:a.jsx(et.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Xr(t,i.triggerRef),onPointerDown:Me(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:Me(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});q3.displayName=B3;var XB="DropdownMenuPortal",K3=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Qr(t);return a.jsx(kB,{...r,...n})};K3.displayName=XB;var Z3="DropdownMenuContent",Y3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=V3(Z3,n),i=Qr(n),c=h.useRef(!1);return a.jsx(LB,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Me(e.onCloseAutoFocus,u=>{var f;c.current||(f=s.triggerRef.current)==null||f.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:Me(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,y=f.button===2||m;(!s.modal||y)&&(c.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)"}})});Y3.displayName=Z3;var QB="DropdownMenuGroup",JB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(PB,{...s,...r,ref:t})});JB.displayName=QB;var eq="DropdownMenuLabel",tq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(UB,{...s,...r,ref:t})});tq.displayName=eq;var nq="DropdownMenuItem",W3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(zB,{...s,...r,ref:t})});W3.displayName=nq;var rq="DropdownMenuCheckboxItem",aq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(FB,{...s,...r,ref:t})});aq.displayName=rq;var sq="DropdownMenuRadioGroup",oq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(HB,{...s,...r,ref:t})});oq.displayName=sq;var iq="DropdownMenuRadioItem",lq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx($B,{...s,...r,ref:t})});lq.displayName=iq;var cq="DropdownMenuItemIndicator",uq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(VB,{...s,...r,ref:t})});uq.displayName=cq;var dq="DropdownMenuSeparator",X3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(GB,{...s,...r,ref:t})});X3.displayName=dq;var fq="DropdownMenuArrow",hq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(BB,{...s,...r,ref:t})});hq.displayName=fq;var mq=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:i}=e,c=Qr(t),[u,f]=ia({prop:r,defaultProp:i??!1,onChange:s,caller:"DropdownMenuSub"});return a.jsx(qB,{...c,open:u,onOpenChange:f,children:n})},pq="DropdownMenuSubTrigger",Q3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(KB,{...s,...r,ref:t})});Q3.displayName=pq;var gq="DropdownMenuSubContent",J3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(ZB,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});J3.displayName=gq;var yq=G3,xq=q3,eD=K3,vq=Y3,bq=W3,Sq=X3,Cq=mq,wq=Q3,Eq=J3;function Cr({...e}){return a.jsx(yq,{"data-slot":"dropdown-menu",...e})}function Rq({...e}){return a.jsx(eD,{"data-slot":"dropdown-menu-portal",...e})}function wr({...e}){return a.jsx(xq,{"data-slot":"dropdown-menu-trigger",...e})}function Er({className:e,sideOffset:t=4,...n}){return a.jsx(eD,{children:a.jsx(vq,{"data-slot":"dropdown-menu-content",sideOffset:t,className:se("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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Ct({className:e,inset:t,variant:n="default",...r}){return a.jsx(bq,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:se("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function la({className:e,...t}){return a.jsx(Sq,{"data-slot":"dropdown-menu-separator",className:se("bg-border -mx-1 my-1 h-px",e),...t})}function yy({...e}){return a.jsx(Cq,{"data-slot":"dropdown-menu-sub",...e})}function xy({className:e,inset:t,children:n,...r}){return a.jsxs(wq,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:se("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,a.jsx(_a,{className:"ml-auto size-4"})]})}function vy({className:e,...t}){return a.jsx(Eq,{"data-slot":"dropdown-menu-sub-content",className:se("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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...t})}const jq="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",Tq=({width:e=45,height:t=36,className:n=""})=>a.jsx("img",{src:jq,alt:"OWOX Logo",width:e,height:t,className:n}),tD=h.createContext(null),nD=h.createContext(()=>{});function rD(){return h.useContext(nD)}function eh(e){const t=h.useContext(tD);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function aD(){return eh(e=>e.project)}function md(){const{data:e,callState:t,error:n}=eh(r=>r.flags);return{flags:e,callState:t,error:n}}function _q({isOpen:e}){const{title:t}=aD();return a.jsx(wr,{asChild:!0,children:a.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:[a.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:a.jsx(Tq,{width:24,height:24})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t??"Project"})]}),a.jsx(Ss,{className:`ml-auto size-4 transition-transform duration-200 ${e?"-rotate-90":""}`})]})})}var Zr=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(Zr||{});function sD(e,t){return function(){return e.apply(t,arguments)}}const{toString:Nq}=Object.prototype,{getPrototypeOf:zS}=Object,{iterator:by,toStringTag:oD}=Symbol,Sy=(e=>t=>{const n=Nq.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zs=e=>(e=e.toLowerCase(),t=>Sy(t)===e),Cy=e=>t=>typeof t===e,{isArray:pd}=Array,Ju=Cy("undefined");function Oh(e){return e!==null&&!Ju(e)&&e.constructor!==null&&!Ju(e.constructor)&&Ra(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const iD=Zs("ArrayBuffer");function Aq(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&iD(e.buffer),t}const Dq=Cy("string"),Ra=Cy("function"),lD=Cy("number"),Ih=e=>e!==null&&typeof e=="object",Oq=e=>e===!0||e===!1,Bp=e=>{if(Sy(e)!=="object")return!1;const t=zS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(oD in e)&&!(by in e)},Iq=e=>{if(!Ih(e)||Oh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Mq=Zs("Date"),kq=Zs("File"),Lq=Zs("Blob"),Pq=Zs("FileList"),Uq=e=>Ih(e)&&Ra(e.pipe),zq=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ra(e.append)&&((t=Sy(e))==="formdata"||t==="object"&&Ra(e.toString)&&e.toString()==="[object FormData]"))},Fq=Zs("URLSearchParams"),[Hq,$q,Vq,Gq]=["ReadableStream","Request","Response","Headers"].map(Zs),Bq=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Mh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),pd(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Oh(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),c=i.length;let u;for(r=0;r<c;r++)u=i[r],t.call(null,e[u],u,e)}}function cD(e,t){if(Oh(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const rc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,uD=e=>!Ju(e)&&e!==rc;function Y1(){const{caseless:e,skipUndefined:t}=uD(this)&&this||{},n={},r=(s,i)=>{const c=e&&cD(n,i)||i;Bp(n[c])&&Bp(s)?n[c]=Y1(n[c],s):Bp(s)?n[c]=Y1({},s):pd(s)?n[c]=s.slice():(!t||!Ju(s))&&(n[c]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Mh(arguments[s],r);return n}const qq=(e,t,n,{allOwnKeys:r}={})=>(Mh(t,(s,i)=>{n&&Ra(s)?e[i]=sD(s,n):e[i]=s},{allOwnKeys:r}),e),Kq=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Zq=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Yq=(e,t,n,r)=>{let s,i,c;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)c=s[i],(!r||r(c,e,t))&&!u[c]&&(t[c]=e[c],u[c]=!0);e=n!==!1&&zS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Wq=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Xq=e=>{if(!e)return null;if(pd(e))return e;let t=e.length;if(!lD(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Qq=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&zS(Uint8Array)),Jq=(e,t)=>{const r=(e&&e[by]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},eK=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},tK=Zs("HTMLFormElement"),nK=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),qT=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),rK=Zs("RegExp"),dD=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Mh(n,(s,i)=>{let c;(c=t(s,i,e))!==!1&&(r[i]=c||s)}),Object.defineProperties(e,r)},aK=e=>{dD(e,(t,n)=>{if(Ra(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ra(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},sK=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return pd(e)?r(e):r(String(e).split(t)),n},oK=()=>{},iK=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function lK(e){return!!(e&&Ra(e.append)&&e[oD]==="FormData"&&e[by])}const cK=e=>{const t=new Array(10),n=(r,s)=>{if(Ih(r)){if(t.indexOf(r)>=0)return;if(Oh(r))return r;if(!("toJSON"in r)){t[s]=r;const i=pd(r)?[]:{};return Mh(r,(c,u)=>{const f=n(c,s+1);!Ju(f)&&(i[u]=f)}),t[s]=void 0,i}}return r};return n(e,0)},uK=Zs("AsyncFunction"),dK=e=>e&&(Ih(e)||Ra(e))&&Ra(e.then)&&Ra(e.catch),fD=((e,t)=>e?setImmediate:t?((n,r)=>(rc.addEventListener("message",({source:s,data:i})=>{s===rc&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),rc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ra(rc.postMessage)),fK=typeof queueMicrotask<"u"?queueMicrotask.bind(rc):typeof process<"u"&&process.nextTick||fD,hK=e=>e!=null&&Ra(e[by]),me={isArray:pd,isArrayBuffer:iD,isBuffer:Oh,isFormData:zq,isArrayBufferView:Aq,isString:Dq,isNumber:lD,isBoolean:Oq,isObject:Ih,isPlainObject:Bp,isEmptyObject:Iq,isReadableStream:Hq,isRequest:$q,isResponse:Vq,isHeaders:Gq,isUndefined:Ju,isDate:Mq,isFile:kq,isBlob:Lq,isRegExp:rK,isFunction:Ra,isStream:Uq,isURLSearchParams:Fq,isTypedArray:Qq,isFileList:Pq,forEach:Mh,merge:Y1,extend:qq,trim:Bq,stripBOM:Kq,inherits:Zq,toFlatObject:Yq,kindOf:Sy,kindOfTest:Zs,endsWith:Wq,toArray:Xq,forEachEntry:Jq,matchAll:eK,isHTMLForm:tK,hasOwnProperty:qT,hasOwnProp:qT,reduceDescriptors:dD,freezeMethods:aK,toObjectSet:sK,toCamelCase:nK,noop:oK,toFiniteNumber:iK,findKey:cD,global:rc,isContextDefined:uD,isSpecCompliantForm:lK,toJSONObject:cK,isAsyncFn:uK,isThenable:dK,setImmediate:fD,asap:fK,isIterable:hK};function Rt(e,t,n,r,s){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),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}me.inherits(Rt,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:me.toJSONObject(this.config),code:this.code,status:this.status}}});const hD=Rt.prototype,mD={};["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=>{mD[e]={value:e}});Object.defineProperties(Rt,mD);Object.defineProperty(hD,"isAxiosError",{value:!0});Rt.from=(e,t,n,r,s,i)=>{const c=Object.create(hD);me.toFlatObject(e,c,function(y){return y!==Error.prototype},m=>m!=="isAxiosError");const u=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return Rt.call(c,u,f,n,r,s),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",i&&Object.assign(c,i),c};const mK=null;function W1(e){return me.isPlainObject(e)||me.isArray(e)}function pD(e){return me.endsWith(e,"[]")?e.slice(0,-2):e}function KT(e,t,n){return e?e.concat(t).map(function(s,i){return s=pD(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function pK(e){return me.isArray(e)&&!e.some(W1)}const gK=me.toFlatObject(me,{},null,function(t){return/^is[A-Z]/.test(t)});function wy(e,t,n){if(!me.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=me.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,w){return!me.isUndefined(w[b])});const r=n.metaTokens,s=n.visitor||y,i=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&me.isSpecCompliantForm(t);if(!me.isFunction(s))throw new TypeError("visitor must be a function");function m(C){if(C===null)return"";if(me.isDate(C))return C.toISOString();if(me.isBoolean(C))return C.toString();if(!f&&me.isBlob(C))throw new Rt("Blob is not supported. Use a Buffer instead.");return me.isArrayBuffer(C)||me.isTypedArray(C)?f&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function y(C,b,w){let R=C;if(C&&!w&&typeof C=="object"){if(me.endsWith(b,"{}"))b=r?b:b.slice(0,-2),C=JSON.stringify(C);else if(me.isArray(C)&&pK(C)||(me.isFileList(C)||me.endsWith(b,"[]"))&&(R=me.toArray(C)))return b=pD(b),R.forEach(function(_,D){!(me.isUndefined(_)||_===null)&&t.append(c===!0?KT([b],D,i):c===null?b:b+"[]",m(_))}),!1}return W1(C)?!0:(t.append(KT(w,b,i),m(C)),!1)}const g=[],x=Object.assign(gK,{defaultVisitor:y,convertValue:m,isVisitable:W1});function v(C,b){if(!me.isUndefined(C)){if(g.indexOf(C)!==-1)throw Error("Circular reference detected in "+b.join("."));g.push(C),me.forEach(C,function(R,j){(!(me.isUndefined(R)||R===null)&&s.call(t,R,me.isString(j)?j.trim():j,b,x))===!0&&v(R,b?b.concat(j):[j])}),g.pop()}}if(!me.isObject(e))throw new TypeError("data must be an object");return v(e),t}function ZT(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function FS(e,t){this._pairs=[],e&&wy(e,this,t)}const gD=FS.prototype;gD.append=function(t,n){this._pairs.push([t,n])};gD.toString=function(t){const n=t?function(r){return t.call(this,r,ZT)}:ZT;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function yK(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function yD(e,t,n){if(!t)return e;const r=n&&n.encode||yK;me.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=me.isURLSearchParams(t)?t.toString():new FS(t,n).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class YT{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){me.forEach(this.handlers,function(r){r!==null&&t(r)})}}const xD={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xK=typeof URLSearchParams<"u"?URLSearchParams:FS,vK=typeof FormData<"u"?FormData:null,bK=typeof Blob<"u"?Blob:null,SK={isBrowser:!0,classes:{URLSearchParams:xK,FormData:vK,Blob:bK},protocols:["http","https","file","blob","url","data"]},HS=typeof window<"u"&&typeof document<"u",X1=typeof navigator=="object"&&navigator||void 0,CK=HS&&(!X1||["ReactNative","NativeScript","NS"].indexOf(X1.product)<0),wK=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",EK=HS&&window.location.href||"http://localhost",RK=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:HS,hasStandardBrowserEnv:CK,hasStandardBrowserWebWorkerEnv:wK,navigator:X1,origin:EK},Symbol.toStringTag,{value:"Module"})),Kr={...RK,...SK};function jK(e,t){return wy(e,new Kr.classes.URLSearchParams,{visitor:function(n,r,s,i){return Kr.isNode&&me.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function TK(e){return me.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function _K(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function vD(e){function t(n,r,s,i){let c=n[i++];if(c==="__proto__")return!0;const u=Number.isFinite(+c),f=i>=n.length;return c=!c&&me.isArray(s)?s.length:c,f?(me.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!u):((!s[c]||!me.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],i)&&me.isArray(s[c])&&(s[c]=_K(s[c])),!u)}if(me.isFormData(e)&&me.isFunction(e.entries)){const n={};return me.forEachEntry(e,(r,s)=>{t(TK(r),s,n,0)}),n}return null}function NK(e,t,n){if(me.isString(e))try{return(t||JSON.parse)(e),me.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const kh={transitional:xD,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=me.isObject(t);if(i&&me.isHTMLForm(t)&&(t=new FormData(t)),me.isFormData(t))return s?JSON.stringify(vD(t)):t;if(me.isArrayBuffer(t)||me.isBuffer(t)||me.isStream(t)||me.isFile(t)||me.isBlob(t)||me.isReadableStream(t))return t;if(me.isArrayBufferView(t))return t.buffer;if(me.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return jK(t,this.formSerializer).toString();if((u=me.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return wy(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),NK(t)):t}],transformResponse:[function(t){const n=this.transitional||kh.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(me.isResponse(t)||me.isReadableStream(t))return t;if(t&&me.isString(t)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(u){if(c)throw u.name==="SyntaxError"?Rt.from(u,Rt.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kr.classes.FormData,Blob:Kr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};me.forEach(["delete","get","head","post","put","patch"],e=>{kh.headers[e]={}});const AK=me.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"]),DK=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
601
|
-
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&AK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},WT=Symbol("internals");function bf(e){return e&&String(e).trim().toLowerCase()}function qp(e){return e===!1||e==null?e:me.isArray(e)?e.map(qp):String(e)}function OK(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const IK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function $0(e,t,n,r,s){if(me.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!me.isString(t)){if(me.isString(r))return t.indexOf(r)!==-1;if(me.isRegExp(r))return r.test(t)}}function MK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function kK(e,t){const n=me.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,c){return this[r].call(this,t,s,i,c)},configurable:!0})})}let ja=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(u,f,m){const y=bf(f);if(!y)throw new Error("header name must be a non-empty string");const g=me.findKey(s,y);(!g||s[g]===void 0||m===!0||m===void 0&&s[g]!==!1)&&(s[g||f]=qp(u))}const c=(u,f)=>me.forEach(u,(m,y)=>i(m,y,f));if(me.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(me.isString(t)&&(t=t.trim())&&!IK(t))c(DK(t),n);else if(me.isObject(t)&&me.isIterable(t)){let u={},f,m;for(const y of t){if(!me.isArray(y))throw TypeError("Object iterator must return a key-value pair");u[m=y[0]]=(f=u[m])?me.isArray(f)?[...f,y[1]]:[f,y[1]]:y[1]}c(u,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=bf(t),t){const r=me.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return OK(s);if(me.isFunction(n))return n.call(this,s,r);if(me.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=bf(t),t){const r=me.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||$0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(c){if(c=bf(c),c){const u=me.findKey(r,c);u&&(!n||$0(r,r[u],u,n))&&(delete r[u],s=!0)}}return me.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||$0(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return me.forEach(this,(s,i)=>{const c=me.findKey(r,i);if(c){n[c]=qp(s),delete n[i];return}const u=t?MK(i):String(i).trim();u!==i&&delete n[i],n[u]=qp(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return me.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&me.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
602
|
-
`)}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 r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[WT]=this[WT]={accessors:{}}).accessors,s=this.prototype;function i(c){const u=bf(c);r[u]||(kK(s,c),r[u]=!0)}return me.isArray(t)?t.forEach(i):i(t),this}};ja.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);me.reduceDescriptors(ja.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});me.freezeMethods(ja);function V0(e,t){const n=this||kh,r=t||n,s=ja.from(r.headers);let i=r.data;return me.forEach(e,function(u){i=u.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function bD(e){return!!(e&&e.__CANCEL__)}function gd(e,t,n){Rt.call(this,e??"canceled",Rt.ERR_CANCELED,t,n),this.name="CanceledError"}me.inherits(gd,Rt,{__CANCEL__:!0});function SD(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Rt("Request failed with status code "+n.status,[Rt.ERR_BAD_REQUEST,Rt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function LK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function PK(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,c;return t=t!==void 0?t:1e3,function(f){const m=Date.now(),y=r[i];c||(c=m),n[s]=f,r[s]=m;let g=i,x=0;for(;g!==s;)x+=n[g++],g=g%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),m-c<t)return;const v=y&&m-y;return v?Math.round(x*1e3/v):void 0}}function UK(e,t){let n=0,r=1e3/t,s,i;const c=(m,y=Date.now())=>{n=y,s=null,i&&(clearTimeout(i),i=null),e(...m)};return[(...m)=>{const y=Date.now(),g=y-n;g>=r?c(m,y):(s=m,i||(i=setTimeout(()=>{i=null,c(s)},r-g)))},()=>s&&c(s)]}const hg=(e,t,n=3)=>{let r=0;const s=PK(50,250);return UK(i=>{const c=i.loaded,u=i.lengthComputable?i.total:void 0,f=c-r,m=s(f),y=c<=u;r=c;const g={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:m||void 0,estimated:m&&u&&y?(u-c)/m:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},XT=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},QT=e=>(...t)=>me.asap(()=>e(...t)),zK=Kr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Kr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Kr.origin),Kr.navigator&&/(msie|trident)/i.test(Kr.navigator.userAgent)):()=>!0,FK=Kr.hasStandardBrowserEnv?{write(e,t,n,r,s,i,c){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];me.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),me.isString(r)&&u.push(`path=${r}`),me.isString(s)&&u.push(`domain=${s}`),i===!0&&u.push("secure"),me.isString(c)&&u.push(`SameSite=${c}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function HK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function $K(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function CD(e,t,n){let r=!HK(t);return e&&(r||n==!1)?$K(e,t):t}const JT=e=>e instanceof ja?{...e}:e;function hc(e,t){t=t||{};const n={};function r(m,y,g,x){return me.isPlainObject(m)&&me.isPlainObject(y)?me.merge.call({caseless:x},m,y):me.isPlainObject(y)?me.merge({},y):me.isArray(y)?y.slice():y}function s(m,y,g,x){if(me.isUndefined(y)){if(!me.isUndefined(m))return r(void 0,m,g,x)}else return r(m,y,g,x)}function i(m,y){if(!me.isUndefined(y))return r(void 0,y)}function c(m,y){if(me.isUndefined(y)){if(!me.isUndefined(m))return r(void 0,m)}else return r(void 0,y)}function u(m,y,g){if(g in t)return r(m,y);if(g in e)return r(void 0,m)}const f={url:i,method:i,data:i,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:u,headers:(m,y,g)=>s(JT(m),JT(y),g,!0)};return me.forEach(Object.keys({...e,...t}),function(y){const g=f[y]||s,x=g(e[y],t[y],y);me.isUndefined(x)&&g!==u||(n[y]=x)}),n}const wD=e=>{const t=hc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:c,auth:u}=t;if(t.headers=c=ja.from(c),t.url=yD(CD(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),me.isFormData(n)){if(Kr.hasStandardBrowserEnv||Kr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(me.isFunction(n.getHeaders)){const f=n.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([y,g])=>{m.includes(y.toLowerCase())&&c.set(y,g)})}}if(Kr.hasStandardBrowserEnv&&(r&&me.isFunction(r)&&(r=r(t)),r||r!==!1&&zK(t.url))){const f=s&&i&&FK.read(i);f&&c.set(s,f)}return t},VK=typeof XMLHttpRequest<"u",GK=VK&&function(e){return new Promise(function(n,r){const s=wD(e);let i=s.data;const c=ja.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:m}=s,y,g,x,v,C;function b(){v&&v(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(y),s.signal&&s.signal.removeEventListener("abort",y)}let w=new XMLHttpRequest;w.open(s.method.toUpperCase(),s.url,!0),w.timeout=s.timeout;function R(){if(!w)return;const _=ja.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),O={data:!u||u==="text"||u==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:_,config:e,request:w};SD(function(T){n(T),b()},function(T){r(T),b()},O),w=null}"onloadend"in w?w.onloadend=R:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(R)},w.onabort=function(){w&&(r(new Rt("Request aborted",Rt.ECONNABORTED,e,w)),w=null)},w.onerror=function(D){const O=D&&D.message?D.message:"Network Error",A=new Rt(O,Rt.ERR_NETWORK,e,w);A.event=D||null,r(A),w=null},w.ontimeout=function(){let D=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||xD;s.timeoutErrorMessage&&(D=s.timeoutErrorMessage),r(new Rt(D,O.clarifyTimeoutError?Rt.ETIMEDOUT:Rt.ECONNABORTED,e,w)),w=null},i===void 0&&c.setContentType(null),"setRequestHeader"in w&&me.forEach(c.toJSON(),function(D,O){w.setRequestHeader(O,D)}),me.isUndefined(s.withCredentials)||(w.withCredentials=!!s.withCredentials),u&&u!=="json"&&(w.responseType=s.responseType),m&&([x,C]=hg(m,!0),w.addEventListener("progress",x)),f&&w.upload&&([g,v]=hg(f),w.upload.addEventListener("progress",g),w.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(y=_=>{w&&(r(!_||_.type?new gd(null,e,w):_),w.abort(),w=null)},s.cancelToken&&s.cancelToken.subscribe(y),s.signal&&(s.signal.aborted?y():s.signal.addEventListener("abort",y)));const j=LK(s.url);if(j&&Kr.protocols.indexOf(j)===-1){r(new Rt("Unsupported protocol "+j+":",Rt.ERR_BAD_REQUEST,e));return}w.send(i||null)})},BK=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(m){if(!s){s=!0,u();const y=m instanceof Error?m:this.reason;r.abort(y instanceof Rt?y:new gd(y instanceof Error?y.message:y))}};let c=t&&setTimeout(()=>{c=null,i(new Rt(`timeout ${t} of ms exceeded`,Rt.ETIMEDOUT))},t);const u=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(i):m.removeEventListener("abort",i)}),e=null)};e.forEach(m=>m.addEventListener("abort",i));const{signal:f}=r;return f.unsubscribe=()=>me.asap(u),f}},qK=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},KK=async function*(e,t){for await(const n of ZK(e))yield*qK(n,t)},ZK=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},e_=(e,t,n,r)=>{const s=KK(e,t);let i=0,c,u=f=>{c||(c=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:m,value:y}=await s.next();if(m){u(),f.close();return}let g=y.byteLength;if(n){let x=i+=g;n(x)}f.enqueue(new Uint8Array(y))}catch(m){throw u(m),m}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},t_=64*1024,{isFunction:vp}=me,YK=(({Request:e,Response:t})=>({Request:e,Response:t}))(me.global),{ReadableStream:n_,TextEncoder:r_}=me.global,a_=(e,...t)=>{try{return!!e(...t)}catch{return!1}},WK=e=>{e=me.merge.call({skipUndefined:!0},YK,e);const{fetch:t,Request:n,Response:r}=e,s=t?vp(t):typeof fetch=="function",i=vp(n),c=vp(r);if(!s)return!1;const u=s&&vp(n_),f=s&&(typeof r_=="function"?(C=>b=>C.encode(b))(new r_):async C=>new Uint8Array(await new n(C).arrayBuffer())),m=i&&u&&a_(()=>{let C=!1;const b=new n(Kr.origin,{body:new n_,method:"POST",get duplex(){return C=!0,"half"}}).headers.has("Content-Type");return C&&!b}),y=c&&u&&a_(()=>me.isReadableStream(new r("").body)),g={stream:y&&(C=>C.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(C=>{!g[C]&&(g[C]=(b,w)=>{let R=b&&b[C];if(R)return R.call(b);throw new Rt(`Response type '${C}' is not supported`,Rt.ERR_NOT_SUPPORT,w)})});const x=async C=>{if(C==null)return 0;if(me.isBlob(C))return C.size;if(me.isSpecCompliantForm(C))return(await new n(Kr.origin,{method:"POST",body:C}).arrayBuffer()).byteLength;if(me.isArrayBufferView(C)||me.isArrayBuffer(C))return C.byteLength;if(me.isURLSearchParams(C)&&(C=C+""),me.isString(C))return(await f(C)).byteLength},v=async(C,b)=>{const w=me.toFiniteNumber(C.getContentLength());return w??x(b)};return async C=>{let{url:b,method:w,data:R,signal:j,cancelToken:_,timeout:D,onDownloadProgress:O,onUploadProgress:A,responseType:T,headers:I,withCredentials:k="same-origin",fetchOptions:V}=wD(C),U=t||fetch;T=T?(T+"").toLowerCase():"text";let K=BK([j,_&&_.toAbortSignal()],D),G=null;const q=K&&K.unsubscribe&&(()=>{K.unsubscribe()});let H;try{if(A&&m&&w!=="get"&&w!=="head"&&(H=await v(I,R))!==0){let P=new n(b,{method:"POST",body:R,duplex:"half"}),z;if(me.isFormData(R)&&(z=P.headers.get("content-type"))&&I.setContentType(z),P.body){const[F,Z]=XT(H,hg(QT(A)));R=e_(P.body,t_,F,Z)}}me.isString(k)||(k=k?"include":"omit");const M=i&&"credentials"in n.prototype,B={...V,signal:K,method:w.toUpperCase(),headers:I.normalize().toJSON(),body:R,duplex:"half",credentials:M?k:void 0};G=i&&new n(b,B);let $=await(i?U(G,V):U(b,B));const re=y&&(T==="stream"||T==="response");if(y&&(O||re&&q)){const P={};["status","statusText","headers"].forEach(Q=>{P[Q]=$[Q]});const z=me.toFiniteNumber($.headers.get("content-length")),[F,Z]=O&&XT(z,hg(QT(O),!0))||[];$=new r(e_($.body,t_,F,()=>{Z&&Z(),q&&q()}),P)}T=T||"text";let ge=await g[me.findKey(g,T)||"text"]($,C);return!re&&q&&q(),await new Promise((P,z)=>{SD(P,z,{data:ge,headers:ja.from($.headers),status:$.status,statusText:$.statusText,config:C,request:G})})}catch(M){throw q&&q(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new Rt("Network Error",Rt.ERR_NETWORK,C,G),{cause:M.cause||M}):Rt.from(M,M&&M.code,C,G)}}},XK=new Map,ED=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let c=i.length,u=c,f,m,y=XK;for(;u--;)f=i[u],m=y.get(f),m===void 0&&y.set(f,m=u?new Map:WK(t)),y=m;return m};ED();const $S={http:mK,xhr:GK,fetch:{get:ED}};me.forEach($S,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const s_=e=>`- ${e}`,QK=e=>me.isFunction(e)||e===null||e===!1;function JK(e,t){e=me.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let c=0;c<n;c++){r=e[c];let u;if(s=r,!QK(r)&&(s=$S[(u=String(r)).toLowerCase()],s===void 0))throw new Rt(`Unknown adapter '${u}'`);if(s&&(me.isFunction(s)||(s=s.get(t))))break;i[u||"#"+c]=s}if(!s){const c=Object.entries(i).map(([f,m])=>`adapter ${f} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=n?c.length>1?`since :
|
|
603
|
-
`+c.map(s_).join(`
|
|
604
|
-
`):" "+s_(c[0]):"as no adapter specified";throw new Rt("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}const RD={getAdapter:JK,adapters:$S};function G0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gd(null,e)}function o_(e){return G0(e),e.headers=ja.from(e.headers),e.data=V0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),RD.getAdapter(e.adapter||kh.adapter,e)(e).then(function(r){return G0(e),r.data=V0.call(e,e.transformResponse,r),r.headers=ja.from(r.headers),r},function(r){return bD(r)||(G0(e),r&&r.response&&(r.response.data=V0.call(e,e.transformResponse,r.response),r.response.headers=ja.from(r.response.headers))),Promise.reject(r)})}const jD="1.13.2",Ey={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ey[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const i_={};Ey.transitional=function(t,n,r){function s(i,c){return"[Axios v"+jD+"] Transitional option '"+i+"'"+c+(r?". "+r:"")}return(i,c,u)=>{if(t===!1)throw new Rt(s(c," has been removed"+(n?" in "+n:"")),Rt.ERR_DEPRECATED);return n&&!i_[c]&&(i_[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,c,u):!0}};Ey.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function eZ(e,t,n){if(typeof e!="object")throw new Rt("options must be an object",Rt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],c=t[i];if(c){const u=e[i],f=u===void 0||c(u,i,e);if(f!==!0)throw new Rt("option "+i+" must be "+f,Rt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Rt("Unknown option "+i,Rt.ERR_BAD_OPTION)}}const Kp={assertOptions:eZ,validators:Ey},no=Kp.validators;let oc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new YT,response:new YT}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
605
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=hc(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Kp.assertOptions(r,{silentJSONParsing:no.transitional(no.boolean),forcedJSONParsing:no.transitional(no.boolean),clarifyTimeoutError:no.transitional(no.boolean)},!1),s!=null&&(me.isFunction(s)?n.paramsSerializer={serialize:s}:Kp.assertOptions(s,{encode:no.function,serialize:no.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Kp.assertOptions(n,{baseUrl:no.spelling("baseURL"),withXsrfToken:no.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=i&&me.merge(i.common,i[n.method]);i&&me.forEach(["delete","get","head","post","put","patch","common"],C=>{delete i[C]}),n.headers=ja.concat(c,i);const u=[];let f=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(f=f&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const m=[];this.interceptors.response.forEach(function(b){m.push(b.fulfilled,b.rejected)});let y,g=0,x;if(!f){const C=[o_.bind(this),void 0];for(C.unshift(...u),C.push(...m),x=C.length,y=Promise.resolve(n);g<x;)y=y.then(C[g++],C[g++]);return y}x=u.length;let v=n;for(;g<x;){const C=u[g++],b=u[g++];try{v=C(v)}catch(w){b.call(this,w);break}}try{y=o_.call(this,v)}catch(C){return Promise.reject(C)}for(g=0,x=m.length;g<x;)y=y.then(m[g++],m[g++]);return y}getUri(t){t=hc(this.defaults,t);const n=CD(t.baseURL,t.url,t.allowAbsoluteUrls);return yD(n,t.params,t.paramsSerializer)}};me.forEach(["delete","get","head","options"],function(t){oc.prototype[t]=function(n,r){return this.request(hc(r||{},{method:t,url:n,data:(r||{}).data}))}});me.forEach(["post","put","patch"],function(t){function n(r){return function(i,c,u){return this.request(hc(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:c}))}}oc.prototype[t]=n(),oc.prototype[t+"Form"]=n(!0)});let tZ=class TD{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const c=new Promise(u=>{r.subscribe(u),i=u}).then(s);return c.cancel=function(){r.unsubscribe(i)},c},t(function(i,c,u){r.reason||(r.reason=new gd(i,c,u),n(r.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=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new TD(function(s){t=s}),cancel:t}}};function nZ(e){return function(n){return e.apply(null,n)}}function rZ(e){return me.isObject(e)&&e.isAxiosError===!0}const Q1={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Q1).forEach(([e,t])=>{Q1[t]=e});function _D(e){const t=new oc(e),n=sD(oc.prototype.request,t);return me.extend(n,oc.prototype,t,{allOwnKeys:!0}),me.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return _D(hc(e,s))},n}const tr=_D(kh);tr.Axios=oc;tr.CanceledError=gd;tr.CancelToken=tZ;tr.isCancel=bD;tr.VERSION=jD;tr.toFormData=wy;tr.AxiosError=Rt;tr.Cancel=tr.CanceledError;tr.all=function(t){return Promise.all(t)};tr.spread=nZ;tr.isAxiosError=rZ;tr.mergeConfig=hc;tr.AxiosHeaders=ja;tr.formToJSON=e=>vD(me.isHTMLForm(e)?new FormData(e):e);tr.getAdapter=RD.getAdapter;tr.HttpStatusCode=Q1;tr.default=tr;const{Axios:Mme,AxiosError:l_,CanceledError:kme,isCancel:Lme,CancelToken:Pme,VERSION:Ume,all:zme,Cancel:Fme,isAxiosError:Hme,spread:$me,toFormData:Vme,AxiosHeaders:aZ,HttpStatusCode:Gme,formToJSON:Bme,getAdapter:qme,mergeConfig:Kme}=tr;function sZ(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const ed={SIGN_IN:"/auth/sign-in",SIGN_OUT:"/auth/sign-out",ACCESS_TOKEN:"/auth/access-token",API_USER:"/auth/api/user",API_PROJECTS:"/auth/api/projects"};function oZ(e){if(e&&typeof e=="object"&&"response"in e){const n=e,{status:r,data:s}=n.response;switch(r){case 401:return{message:(s==null?void 0:s.message)??"Invalid credentials or session expired",code:"UNAUTHORIZED",statusCode:401};case 403:return{message:(s==null?void 0:s.message)??"Access forbidden",code:"FORBIDDEN",statusCode:403};case 422:return{message:(s==null?void 0:s.message)??"Invalid request data",code:"VALIDATION_ERROR",statusCode:422};default:return{message:(s==null?void 0:s.message)??"Authentication error",code:"AUTH_ERROR",statusCode:r}}}return e&&typeof e=="object"&&"request"in e?{message:"Network error - please check your connection",code:"NETWORK_ERROR"}:{message:e instanceof Error?e.message:"Unknown authentication error",code:"UNKNOWN_ERROR"}}const VS=tr.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function iZ(){const e=window.location.pathname+window.location.search,t=new URL(ed.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function lZ(){const e=new URL(ed.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",ed.SIGN_IN),window.location.href=e.toString()}async function cZ(){try{return(await VS.post(ed.ACCESS_TOKEN,{})).data}catch(e){const t=oZ(e);throw new Error(t.message)}}async function uZ(e){const t=await VS.get(ed.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return sZ(t.data)}async function dZ(e){return(await VS.get(ed.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const ND=h.createContext(null);class fZ{constructor(t,n){to(this,"getToken");to(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let GS=null;function hZ(e){GS=e}function BS(){return GS}function bp(){GS=null}const mZ=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},De=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",qS(e)},pZ=e=>{De({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},gZ=()=>{De({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},qS=e=>{var t;if(typeof window<"u"){mZ();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function yZ(e,t){switch(t.type){case"SET_LOADING":return{...e,status:Zr.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:Zr.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:Zr.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:Zr.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const xZ={status:Zr.LOADING,session:null,user:null};function vZ({children:e}){var y;const[t,n]=h.useReducer(yZ,xZ);h.useEffect(()=>{var g;if((g=t.session)!=null&&g.accessToken){const x=new fZ(()=>{var v;return((v=t.session)==null?void 0:v.accessToken)??null},async()=>await s());hZ(x)}else bp()},[(y=t.session)==null?void 0:y.accessToken]);const r=h.useCallback(()=>{iZ()},[]);async function s(){try{const x=(await cZ()).accessToken;if(!x)throw new Error("Invalid token received");const v={accessToken:x},C=await uZ(x);return n({type:"SET_USER",payload:{user:C}}),n({type:"SET_AUTHENTICATED",payload:{session:v}}),x}catch(g){throw bp(),n({type:"SET_UNAUTHENTICATED"}),g}}const i=h.useCallback(async()=>{await s()},[]),c=h.useCallback(async()=>{try{n({type:"SET_LOADING"});try{await i()}catch{n({type:"SET_UNAUTHENTICATED"}),r()}}catch(g){console.error("Failed to initialize auth:",g),bp(),n({type:"SET_UNAUTHENTICATED"})}},[i,r]),u=h.useCallback(()=>{try{gZ()}finally{lZ()}},[]),f=h.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t.user&&(qS({projectId:t.user.projectId}),pZ({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),h.useEffect(()=>{const g=()=>{u()};return window.addEventListener("auth:logout",g),()=>{window.removeEventListener("auth:logout",g),bp()}},[u]);const m={...t,signIn:r,signOut:u,refreshToken:i,clearError:f};return a.jsx(ND.Provider,{value:m,children:e})}function mi(){const e=h.useContext(ND);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function AD(){const{status:e,session:t,user:n,error:r}=mi();return{status:e,session:t,user:n,error:r,isLoading:e===Zr.LOADING,isAuthenticated:e===Zr.AUTHENTICATED,isUnauthenticated:e===Zr.UNAUTHENTICATED,hasError:e===Zr.ERROR}}function bZ(){const{user:e}=mi();return e}function Hu({fullScreen:e=!1,size:t="md",message:n}){const r={sm:"h-4 w-4 border-2",md:"h-8 w-8 border-4",lg:"h-12 w-12 border-4"},s=e?"flex h-screen items-center justify-center":"flex items-center justify-center p-4";return a.jsx("div",{className:s,children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&a.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function c_({message:e}){return a.jsx(Hu,{fullScreen:!0,message:e})}function u_(){return a.jsx("div",{className:"flex h-screen items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),a.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),a.jsx(we,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function SZ({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:i}=AD();return r?a.jsx(c_,{}):s?a.jsx(a.Fragment,{children:e}):i?n?(window.location.href=n,a.jsx(c_,{})):t?a.jsx(a.Fragment,{children:t}):a.jsx(u_,{}):t?a.jsx(a.Fragment,{children:t}):a.jsx(u_,{})}const DD=h.createContext(null);function OD(){const e=h.useContext(DD);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const CZ="/ui",wZ=()=>CZ,mg=(e,t)=>{const n=wZ(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function EZ(){const{projects:e,loadProjects:t,error:n,isLoading:r}=OD(),{user:s}=mi();return a.jsxs(yy,{children:[a.jsx(la,{}),a.jsxs(xy,{className:"flex items-center gap-2",children:[a.jsx(wP,{className:"h-4 w-4"}),"Switch project"]}),a.jsx(Rq,{children:a.jsxs(vy,{children:[r&&a.jsx(Ct,{disabled:!0,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Rc,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&a.jsxs(a.Fragment,{children:[a.jsx(Ct,{disabled:!0,children:"Unable to load projects. Please try again."}),a.jsx(Ct,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(i=>{const c=i.id===(s==null?void 0:s.projectId);return a.jsx(Ct,{asChild:!0,children:a.jsxs(ph,{to:mg(encodeURIComponent(i.id),"/"),className:"flex items-center gap-2",children:[c?a.jsx(oa,{className:"h-4 w-4"}):a.jsx("span",{className:"h-4 w-4"}),i.title]})},i.id)})]})})]})}function RZ(){return a.jsx(EZ,{})}const jZ=({className:e,size:t=24})=>a.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:a.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"})}),ID=({className:e,size:t=24})=>a.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:[a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"})]}),MD=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),a.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),a.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),a.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),a.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),a.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),a.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),a.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),a.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),a.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),a.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),a.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),a.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),a.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),a.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"})]}),TZ=({className:e,size:t=24})=>a.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:[a.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"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),_Z=({className:e,size:t=24})=>a.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:[a.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"}),a.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"}),a.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"}),a.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"})]}),NZ=({className:e,size:t=24})=>a.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:[a.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"}),a.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),a.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),a.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),a.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),a.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),a.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),a.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),a.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),a.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),a.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"})]}),kD=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M41.1492 36.5821L31.017 30.7288C29.5935 29.9092 27.7733 30.3966 26.9494 31.8201C26.6302 32.3808 26.5051 32.9976 26.5655 33.5972V45.0365C26.5655 46.6712 27.894 47.9998 29.5331 47.9998C31.1679 47.9998 32.4965 46.6712 32.4965 45.0365V38.4585L38.173 41.7367C39.5964 42.5605 41.421 42.0688 42.2405 40.6454C43.0644 39.2219 42.577 37.4017 41.1492 36.5821Z",fill:"#29B5E8"}),a.jsx("path",{d:"M15.949 24.039C15.9663 22.9822 15.4099 21.9987 14.4954 21.4682L4.36313 15.6192C3.92316 15.3647 3.41849 15.231 2.91381 15.231C1.87427 15.231 0.908061 15.7874 0.390448 16.6846C-0.411852 18.0735 0.0669408 19.855 1.45587 20.6573L7.29627 24.0261L1.45587 27.3992C0.782972 27.7874 0.299866 28.4128 0.101448 29.1634C-0.101284 29.9139 0.00223886 30.699 0.390448 31.3719C0.908061 32.2691 1.87427 32.8255 2.9095 32.8255C3.41849 32.8255 3.92316 32.6918 4.36313 32.4373L14.4954 26.5883C15.4012 26.062 15.9577 25.0872 15.949 24.039Z",fill:"#29B5E8"}),a.jsx("path",{d:"M6.6628 11.4738L16.7951 17.3228C17.977 18.0086 19.4349 17.7843 20.3666 16.8742C20.9576 16.3307 21.3242 15.5543 21.3242 14.6916V2.96765C21.3242 1.32854 19.9957 0 18.3609 0C16.7217 0 15.3932 1.32854 15.3932 2.96765V9.64054L9.63907 6.31919C8.21564 5.49532 6.39536 5.98274 5.5715 7.40618C4.74763 8.82962 5.23936 10.6499 6.6628 11.4738Z",fill:"#29B5E8"}),a.jsx("path",{d:"M29.4459 24.5131C29.4459 24.7374 29.3165 25.048 29.1569 25.2119L25.1411 29.2277C24.9815 29.3873 24.6666 29.5167 24.4423 29.5167H23.42C23.1957 29.5167 22.8808 29.3873 22.7212 29.2277L18.7011 25.2119C18.5415 25.048 18.4121 24.7374 18.4121 24.5131V23.4908C18.4121 23.2622 18.5415 22.9516 18.7011 22.792L22.7212 18.7719C22.8808 18.6123 23.1957 18.4829 23.42 18.4829H24.4423C24.6666 18.4829 24.9815 18.6123 25.1411 18.7719L29.1569 22.792C29.3165 22.9516 29.4459 23.2622 29.4459 23.4908V24.5131ZM25.8614 24.0214V23.9782C25.8614 23.8143 25.7665 23.5857 25.6501 23.4649L24.4639 22.2831C24.3474 22.1623 24.1188 22.0674 23.9506 22.0674H23.9074C23.7435 22.0674 23.5149 22.1623 23.3941 22.2831L22.2123 23.4649C22.0958 23.5814 22.0009 23.81 22.0009 23.9782V24.0214C22.0009 24.1896 22.0958 24.4182 22.2123 24.5347L23.3941 25.7209C23.5149 25.8373 23.7435 25.9322 23.9074 25.9322H23.9506C24.1188 25.9322 24.3474 25.8373 24.4639 25.7209L25.6501 24.5347C25.7665 24.4182 25.8614 24.1896 25.8614 24.0214Z",fill:"#29B5E8"}),a.jsx("path",{d:"M31.0158 17.3228L41.1481 11.4738C42.5715 10.6542 43.0632 8.82962 42.2394 7.40618C41.4155 5.98274 39.5952 5.49532 38.1718 6.31919L32.4953 9.59741V2.96765C32.4953 1.32854 31.1667 0 29.532 0C27.8928 0 26.5643 1.32854 26.5643 2.96765V14.4587C26.5082 15.0539 26.6247 15.675 26.9482 16.2358C27.7721 17.6592 29.5923 18.1467 31.0158 17.3228Z",fill:"#29B5E8"}),a.jsx("path",{d:"M18.8267 30.3841C18.1538 30.2546 17.4335 30.3625 16.7951 30.7291L6.6628 36.5825C5.23936 37.402 4.74763 39.2223 5.5715 40.6457C6.39536 42.0735 8.21564 42.5609 9.63907 41.737L15.3932 38.4157V45.0368C15.3932 46.6716 16.7217 48.0002 18.3609 48.0002C19.9957 48.0002 21.3242 46.6716 21.3242 45.0368V33.3129C21.3242 31.8334 20.2415 30.6083 18.8267 30.3841Z",fill:"#29B5E8"}),a.jsx("path",{d:"M47.4814 16.6501C46.6618 15.2223 44.8372 14.7349 43.4138 15.5588L33.2815 21.4078C32.311 21.9685 31.7761 22.9951 31.7934 24.039C31.7847 25.0785 32.3196 26.0922 33.2815 26.6443L43.4138 32.4977C44.8372 33.3172 46.6575 32.8298 47.4814 31.4064C48.3052 29.9829 47.8135 28.1626 46.3901 27.3388L40.6532 24.0261L46.3901 20.7133C47.8178 19.8938 48.3052 18.0735 47.4814 16.6501Z",fill:"#29B5E8"})]}),AZ=({className:e,size:t=24})=>a.jsx("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:a.jsx("path",{d:"M45.8905 35.0619V26.9571L45.0149 26.4095L24 37.9095L4.0796 26.9571V22.2476L24 33.0905L46 21.1524V13.1571L45.1244 12.6095L24 24.219L4.84577 13.7048L24 3.19048L39.4328 11.6238L40.6368 10.9667V10.0905L24 1L2 12.9381V14.1429L24 26.1905L43.9204 15.2381V20.0571L24 31.0095L2.87562 19.4L2 19.9476V28.0524L24 39.9905L43.9204 29.1476V33.8571L24 44.8095L2.87562 33.3095L2 33.8571V35.0619L24 47L45.8905 35.0619Z",fill:"#FF3621"})}),DZ=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),a.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),a.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),a.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),a.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),a.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),a.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),OZ=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M23.9333 0L3 11.9733V35.8933L23.9333 48L44.8667 36.0267V12.0267L23.9333 0ZM41 33.52L23.9333 43.3867L6.86667 33.624V14.3467L23.9333 4.48L41 14.3733V33.52Z",fill:"#0078D4"}),a.jsx("path",{d:"M23.9333 0L3 11.9733L6.86667 14.3467L23.9333 4.48L41 14.3467L44.8667 11.9733L23.9333 0Z",fill:"url(#paint0_linear_19_1262)"}),a.jsx("path",{d:"M33.9068 27.9336C33.7031 27.5984 33.4028 27.3325 33.0454 27.1709C31.9608 24.8031 30.2991 22.7454 28.2128 21.1865C26.1265 19.6276 23.6822 18.6173 21.1041 18.2482L38.3761 8.26689L34.3601 5.96289L14.6908 17.3336C14.3087 17.5535 14.0099 17.8936 13.8411 18.3009C13.6722 18.7082 13.6426 19.1598 13.757 19.5857C13.8714 20.0115 14.1232 20.3876 14.4734 20.6554C14.8236 20.9233 15.2525 21.068 15.6934 21.0669C15.7747 21.0519 15.8549 21.0314 15.9334 21.0056L16.2668 22.4002C18.7745 21.8089 21.4081 22.0755 23.7464 23.1574C26.0848 24.2393 27.9928 26.074 29.1654 28.3682L9.56812 39.6936L13.5681 42.0029L33.1761 30.6669C33.4376 30.5106 33.6586 30.295 33.8214 30.0376L34.0214 29.9896C34.0028 29.9122 33.9734 29.8429 33.9548 29.7656C34.0967 29.4794 34.1665 29.1629 34.1581 28.8436C34.1497 28.5243 34.0634 28.2119 33.9068 27.9336Z",fill:"#50E6FF"}),a.jsx("path",{d:"M32.176 24.0347C31.2003 24.0347 30.2465 24.3241 29.4352 24.8662C28.6239 25.4082 27.9916 26.1787 27.6182 27.0802C27.2448 27.9816 27.1471 28.9735 27.3375 29.9305C27.5278 30.8875 27.9977 31.7665 28.6876 32.4565C29.3775 33.1464 30.2566 33.6163 31.2135 33.8066C32.1705 33.997 33.1625 33.8993 34.0639 33.5259C34.9653 33.1525 35.7358 32.5202 36.2779 31.7089C36.82 30.8976 37.1093 29.9438 37.1093 28.9681C37.1093 27.6597 36.5896 26.4049 35.6644 25.4797C34.7392 24.5545 33.4844 24.0347 32.176 24.0347ZM15.6907 14.0454C14.7149 14.0454 13.7611 14.3347 12.9498 14.8768C12.1386 15.4189 11.5062 16.1894 11.1329 17.0908C10.7595 17.9923 10.6618 18.9842 10.8521 19.9412C11.0425 20.8982 11.5123 21.7772 12.2023 22.4671C12.8922 23.1571 13.7712 23.6269 14.7282 23.8173C15.6852 24.0076 16.6771 23.9099 17.5786 23.5365C18.48 23.1632 19.2505 22.5308 19.7926 21.7196C20.3347 20.9083 20.624 19.9545 20.624 18.9787C20.624 17.6703 20.1042 16.4155 19.1791 15.4904C18.2539 14.5652 16.9991 14.0454 15.6907 14.0454Z",fill:"url(#paint1_linear_19_1262)"}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),a.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),a.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{"stop-color":"#198AB3"}),a.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),a.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),a.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),a.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),Ac=({className:e="",size:t=24,base64:n})=>a.jsx("img",{src:n??void 0,alt:"icon",className:`max-w-none ${e}`,style:{width:t,height:t}}),IZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{fill:"currentColor",d:"M12.455 21.73c-4.585 0-7.749-.347-7.964-.371-.164-.013-1.55-.141-2.44-1.037-.9-.907-1.26-2.518-1.274-2.586-.01-.044-.29-1.267-.432-3.389a61.23 61.23 0 0 1-.078-2.403c0-3.559.49-5.744.511-5.835.016-.068.377-1.522 1.273-2.423.873-.88 2.11-1.02 2.296-1.036.244-.036 2.712-.38 7.444-.38 1.422 0 3.843.082 3.867.083 2.365.106 3.696.274 3.86.296.186.014 1.554.149 2.437 1.037.895.9 1.255 2.355 1.27 2.417.018.069.508 1.963.508 5.743 0 .89-.065 2.337-.068 2.399-.131 2.248-.405 3.447-.416 3.497-.043.174-.422 1.66-1.123 2.383-1.035 1.066-2.154 1.212-2.356 1.23-.248.039-2.558.375-7.315.375Zm-.664-18.502c-4.815 0-7.295.367-7.32.371a.446.446 0 0 1-.038.004c-.009 0-1.04.086-1.711.76-.705.709-1.016 1.955-1.02 1.967-.003.015-.485 2.174-.485 5.614 0 .836.076 2.331.077 2.347.135 2.028.407 3.222.41 3.234.004.02.317 1.413 1.018 2.12.67.673 1.831.758 1.843.759l.024.002c.031.004 3.198.366 7.866.366 4.848 0 7.161-.362 7.184-.365a.484.484 0 0 1 .05-.005c.033-.003.91-.074 1.757-.947.441-.455.784-1.552.879-1.937 0-.004.265-1.173.391-3.323 0-.01.067-1.48.067-2.349 0-3.636-.475-5.488-.48-5.507-.005-.021-.316-1.267-1.02-1.976-.67-.674-1.832-.759-1.844-.76a.391.391 0 0 1-.033-.003c-.013-.002-1.362-.182-3.785-.29-.02 0-2.424-.082-3.83-.082Z"}),a.jsx("path",{fill:"currentColor",d:"M5.415 17.057V6.247h7.074c2.212 0 3.318.925 3.318 2.776 0 .74-.142 1.316-.425 1.732a1.476 1.476 0 0 1-.768.609c.201.052.398.155.59.311.585.477.878 1.213.878 2.209 0 1.162-.284 1.99-.85 2.489-.521.456-1.353.684-2.496.684H5.415Zm.987-9.722v3.531h6.482c.686 0 1.171-.114 1.456-.344.32-.26.48-.718.48-1.374 0-.615-.142-1.063-.425-1.344-.312-.313-.815-.469-1.511-.469H6.402Zm0 4.62v4.013h6.718c.658 0 1.152-.165 1.481-.498.33-.331.493-.86.493-1.586 0-.684-.173-1.177-.52-1.478-.348-.3-.86-.45-1.536-.45l-6.636-.001ZM19.282 17.057h-1.067V6.247h1.067v10.81Z"}),a.jsx("path",{fill:"currentColor",d:"M23.467 11.846c0-3.756-.488-5.627-.5-5.673l-.001-.006a6.188 6.188 0 0 0-.292-.852c-.197-.47-.494-1.022-.906-1.438-.4-.401-.917-.64-1.37-.779a4.392 4.392 0 0 0-.9-.18h-.015c-.156-.021-1.48-.19-3.837-.295-.114-.004-2.465-.082-3.855-.082-4.717 0-7.172.342-7.406.376l-.008.002H4.37c-.176.015-1.328.15-2.131.958-.414.416-.711.97-.909 1.44a6.178 6.178 0 0 0-.292.855c-.025.105-.505 2.264-.505 5.771 0 .84.073 2.278.078 2.386l.059.747c.105 1.173.243 1.982.316 2.358l.05.24.002.004c.006.028.096.432.292.937.199.512.497 1.1.909 1.515.402.405.925.644 1.38.783.453.137.82.17.891.176h.01l.685.069c1.19.107 3.82.301 7.25.301 4.744 0 7.041-.335 7.275-.371l.008-.001h.009c.167-.015 1.215-.149 2.188-1.152.312-.321.567-.832.752-1.307a8.15 8.15 0 0 0 .303-.951c.019-.085.282-1.266.409-3.448.005-.107.068-1.514.068-2.383Zm-.95 0c0-3.598-.469-5.426-.471-5.436l-.001-.005s-.02-.077-.059-.202a5.943 5.943 0 0 0-.177-.49c-.14-.341-.34-.73-.599-1.034l-.114-.124c-.289-.29-.697-.464-1.053-.564a3.79 3.79 0 0 0-.577-.114l-.048-.004a.677.677 0 0 1-.05-.005l-.062-.009-.186-.021a33.921 33.921 0 0 0-.727-.074 60.204 60.204 0 0 0-2.78-.185c-.022 0-2.421-.08-3.822-.08-2.401 0-4.218.091-5.437.183a37.894 37.894 0 0 0-1.725.169l-.087.011-.03.005h-.003a.744.744 0 0 1-.06.005h.001c.007 0-.23.02-.547.117-.32.099-.701.271-.994.566-.316.317-.553.769-.714 1.158-.145.35-.221.63-.234.678 0 0-.478 2.138-.478 5.552 0 .828.077 2.317.077 2.334.134 1.992.399 3.168.404 3.189a6.681 6.681 0 0 0 .235.763c.163.43.4.911.71 1.223.289.29.696.464 1.052.564.35.098.621.119.621.119h.002l.037.003H4.63c.007.002.017.002.03.004l.112.013a62.06 62.06 0 0 0 2.03.167c1.373.09 3.326.18 5.653.18 4.78 0 7.082-.353 7.142-.362l.077-.009c.067-.006.833-.094 1.581-.865.182-.188.363-.533.514-.908.147-.366.252-.724.297-.905.012-.054.263-1.201.384-3.274.004-.086.067-1.495.067-2.333ZM15.54 9.024c0-.869-.257-1.477-.733-1.875-.485-.406-1.243-.632-2.318-.633H5.68v10.27h7.055c1.118 0 1.872-.224 2.321-.618.483-.424.758-1.16.758-2.285 0-.94-.275-1.586-.778-1.997a1.303 1.303 0 0 0-.49-.26l-.881-.229.864-.29a1.21 1.21 0 0 0 .632-.503v-.002c.242-.354.379-.87.379-1.578Zm4.007-3.048v11.351h-1.6V5.976h1.6Zm-1.067 10.81h.534V6.517h-.534v10.27Zm-3.653-2.902c0-.643-.163-1.043-.427-1.272l-.114-.086c-.28-.19-.687-.3-1.248-.3l-6.37-.001v3.473h6.45c.618 0 1.032-.155 1.293-.419.258-.26.416-.703.416-1.395Zm-.275-4.737c0-.579-.134-.941-.345-1.15v-.001c-.24-.24-.659-.391-1.324-.391H6.67v2.99h6.215c.673 0 1.08-.115 1.29-.284.227-.185.38-.543.38-1.164Zm.808 4.737c0 .76-.17 1.374-.571 1.778-.397.4-.971.577-1.67.577H6.135v-4.555l6.904.001c.71 0 1.293.157 1.708.516.43.373.614.959.614 1.683Zm7.689-2.038c0 .44-.017 1.029-.033 1.506l-.024.605-.008.182-.002.05v.022c-.127 2.161-.393 3.345-.399 3.37v.003c-.05.203-.164.586-.322.979-.154.383-.366.814-.625 1.082-.907.935-1.856 1.02-1.929 1.026h-.005a.241.241 0 0 0-.023.003c-.053.008-2.382.368-7.225.368-3.51 0-6.175-.204-7.305-.308l-.593-.059v-.001h-.011a4.034 4.034 0 0 1-.727-.137c-.395-.111-.903-.317-1.285-.701-.39-.394-.662-.963-.832-1.412a6.672 6.672 0 0 1-.258-.84l-.004-.017-.01-.046a17.864 17.864 0 0 1-.145-.816 28.269 28.269 0 0 1-.257-2.396v-.011l-.002-.013-.002-.052-.008-.185c-.008-.156-.018-.371-.027-.612-.02-.48-.039-1.069-.039-1.493 0-3.459.485-5.638.493-5.674v-.006l.003-.005.003-.014.012-.046.048-.162c.043-.135.107-.323.194-.533.172-.414.442-.94.831-1.331.378-.38.849-.588 1.214-.7.365-.113.645-.137.668-.139h.002l.015-.002c.089-.013 2.58-.373 7.358-.373.706 0 1.662.02 2.441.04.39.01.737.02.988.028l.297.01c.035 0 .063.002.082.003h.033c1.216.055 2.164.128 2.81.187l1 .106.008.001h.01l.018.003.045.004a4.322 4.322 0 0 1 .663.13c.394.111.903.317 1.286.702.388.39.657.918.829 1.333.165.399.249.717.26.764l.08.374c.14.717.409 2.458.409 5.203Zm.95 0c0 .897-.066 2.35-.069 2.41v.004c-.132 2.26-.407 3.475-.423 3.543v.005c-.023.093-.132.52-.326 1.018-.19.492-.477 1.086-.866 1.488-1.073 1.106-2.236 1.281-2.507 1.308-.265.04-2.589.378-7.354.378-4.598 0-7.772-.348-7.994-.373a4.92 4.92 0 0 1-.994-.196c-.439-.134-.964-.36-1.416-.743l-.189-.174c-.488-.492-.82-1.162-1.029-1.7a7.404 7.404 0 0 1-.316-1.019c-.023-.1-.298-1.332-.438-3.43v-.003C.075 14.289 0 12.81 0 11.943c0-3.578.493-5.782.519-5.895v-.003c.01-.044.11-.439.32-.941.21-.5.54-1.125 1.024-1.61l.18-.169c.925-.8 2.096-.929 2.281-.945C4.65 2.333 7.127 2 11.791 2c.714 0 1.678.02 2.464.041a215.63 215.63 0 0 1 1.297.038l.082.002.023.001h.013c2.311.104 3.641.268 3.867.297.104.008.516.048 1.016.202.498.153 1.107.426 1.59.913l.174.188c.389.451.664.984.848 1.42.202.482.3.865.316.93.025.092.519 2.01.519 5.814Zm-8.914-2.699c0 .69-.167 1.25-.58 1.586v.001c-.359.289-.922.402-1.622.402H6.135v-4.07l6.75-.002c.725 0 1.312.162 1.696.546l.124.142c.268.348.381.827.381 1.395Zm.988-.123c0 .77-.147 1.407-.472 1.884a1.905 1.905 0 0 1-.396.435l.165.12v.002c.666.543.977 1.369.977 2.418 0 1.199-.292 2.123-.942 2.694-.592.519-1.502.75-2.67.75H5.148V5.976h7.342c1.135 0 2.037.236 2.658.756.63.528.926 1.31.926 2.292Z"})]}),MZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M5.14132 15.1175C5.14132 16.4971 4.02636 17.612 2.64683 17.612C1.2673 17.612 0.152344 16.4971 0.152344 15.1175C0.152344 13.738 1.2673 12.623 2.64683 12.623H5.14132V15.1175ZM6.38856 15.1175C6.38856 13.738 7.50352 12.623 8.88305 12.623C10.2626 12.623 11.3775 13.738 11.3775 15.1175V21.3538C11.3775 22.7333 10.2626 23.8482 8.88305 23.8482C7.50352 23.8482 6.38856 22.7333 6.38856 21.3538V15.1175Z",fill:"#E01E5A"}),a.jsx("path",{d:"M8.88242 5.10226C7.50289 5.10226 6.38793 3.9873 6.38793 2.60777C6.38793 1.22824 7.50289 0.113281 8.88242 0.113281C10.2619 0.113281 11.3769 1.22824 11.3769 2.60777V5.10226H8.88242ZM8.88242 6.3684C10.2619 6.3684 11.3769 7.48336 11.3769 8.86289C11.3769 10.2424 10.2619 11.3574 8.88242 11.3574H2.6273C1.24777 11.3574 0.132812 10.2424 0.132812 8.86289C0.132812 7.48336 1.24777 6.3684 2.6273 6.3684H8.88242Z",fill:"#36C5F0"}),a.jsx("path",{d:"M18.8768 8.86289C18.8768 7.48336 19.9918 6.3684 21.3713 6.3684C22.7509 6.3684 23.8658 7.48336 23.8658 8.86289C23.8658 10.2424 22.7509 11.3574 21.3713 11.3574H18.8768V8.86289ZM17.6296 8.86289C17.6296 10.2424 16.5146 11.3574 15.1351 11.3574C13.7556 11.3574 12.6406 10.2424 12.6406 8.86289V2.60777C12.6406 1.22824 13.7556 0.113281 15.1351 0.113281C16.5146 0.113281 17.6296 1.22824 17.6296 2.60777V8.86289Z",fill:"#2EB67D"}),a.jsx("path",{d:"M15.1351 18.8593C16.5146 18.8593 17.6296 19.9742 17.6296 21.3538C17.6296 22.7333 16.5146 23.8482 15.1351 23.8482C13.7556 23.8482 12.6406 22.7333 12.6406 21.3538V18.8593H15.1351ZM15.1351 17.612C13.7556 17.612 12.6406 16.4971 12.6406 15.1175C12.6406 13.738 13.7556 12.623 15.1351 12.623H21.3902C22.7698 12.623 23.8847 13.738 23.8847 15.1175C23.8847 16.4971 22.7698 17.612 21.3902 17.612H15.1351Z",fill:"#ECB22E"})]}),kZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),LZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M21 9.99795V7.99795C20.9996 7.64722 20.9071 7.30276 20.7315 6.99911C20.556 6.69546 20.3037 6.44331 20 6.26795L13 2.26795C12.696 2.09241 12.3511 2 12 2C11.6489 2 11.304 2.09241 11 2.26795L4 6.26795C3.69626 6.44331 3.44398 6.69546 3.26846 6.99911C3.09294 7.30276 3.00036 7.64722 3 7.99795V15.9979C3.00036 16.3487 3.09294 16.6931 3.26846 16.9968C3.44398 17.3004 3.69626 17.5526 4 17.7279L11 21.7279C11.304 21.9035 11.6489 21.9959 12 21.9959C12.3511 21.9959 12.696 21.9035 13 21.7279L15 20.5879",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),PZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M24 12C24 5.37308 18.6269 0 12 0C5.37308 0 0 5.37308 0 12C0 17.989 4.38757 22.9537 10.1252 23.8549V15.4696H7.07749V12H10.1252V9.35565C10.1252 6.34847 11.9173 4.68626 14.6579 4.68626C15.9707 4.68626 17.3444 4.92083 17.3444 4.92083V7.874H15.8307C14.3406 7.874 13.8748 8.79876 13.8748 9.74884V12H17.2026L16.6711 15.4696H13.8748V23.8549C19.6124 22.9554 24 17.9907 24 12Z",fill:"#1977F3"}),a.jsx("path",{d:"M16.6717 15.4708L17.2033 12.0012H13.8755V9.75008C13.8755 8.80169 14.3396 7.87524 15.8313 7.87524H17.345V4.92207C17.345 4.92207 15.9714 4.6875 14.6585 4.6875C11.918 4.6875 10.1258 6.34803 10.1258 9.35689V12.0012H7.07812V15.4708H10.1258V23.8561C10.7367 23.9523 11.3628 24.0012 12.0006 24.0012C12.6385 24.0012 13.2646 23.9506 13.8755 23.8561V15.4708H16.6717Z",fill:"#FEFEFE"})]}),UZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("rect",{x:"2",y:"2",width:"20",height:"20",fill:"white"}),a.jsx("path",{d:"M20.4491 20.4496H16.8931V14.8805C16.8931 13.5525 16.8694 11.8429 15.0436 11.8429C13.1915 11.8429 12.9081 13.2899 12.9081 14.7838V20.4492H9.35203V8.99689H12.7658V10.562H12.8136C13.1553 9.97782 13.649 9.49726 14.2421 9.17149C14.8352 8.84572 15.5056 8.68693 16.1819 8.71203C19.7861 8.71203 20.4506 11.0828 20.4506 14.167L20.4491 20.4496ZM5.33963 7.43144C4.93148 7.43151 4.53247 7.31055 4.19307 7.08385C3.85367 6.85715 3.58913 6.53489 3.43287 6.15783C3.27661 5.78077 3.23566 5.36584 3.31521 4.96551C3.39477 4.56517 3.59125 4.19743 3.8798 3.90876C4.16835 3.6201 4.53602 3.42348 4.93631 3.34378C5.3366 3.26408 5.75152 3.30488 6.12863 3.46101C6.50573 3.61713 6.82807 3.88158 7.05489 4.22091C7.2817 4.56025 7.40281 4.95922 7.40288 5.36738C7.40293 5.63839 7.34959 5.90675 7.24593 6.15715C7.14227 6.40754 6.99032 6.63507 6.79873 6.82674C6.60714 7.0184 6.37966 7.17045 6.1293 7.27421C5.87895 7.37796 5.61062 7.43139 5.33963 7.43144ZM7.11765 20.4496H3.5579V8.99689H7.11765V20.4496ZM22.222 0.00163516H1.77099C1.30681 -0.00360329 0.859518 0.175663 0.52744 0.500042C0.195362 0.824421 0.00566506 1.26737 0 1.73156V22.2681C0.00547117 22.7325 0.195057 23.1758 0.527123 23.5005C0.85919 23.8252 1.30658 24.0048 1.77099 23.9999H22.222C22.6873 24.0057 23.1359 23.8266 23.4693 23.5019C23.8027 23.1772 23.9936 22.7334 24 22.2681V1.73008C23.9934 1.26497 23.8024 0.821515 23.469 0.497144C23.1356 0.172773 22.6871 -0.00598143 22.222 0.000152822",fill:"#0A66C2"})]}),zZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M2.4 0H21.6C22.9256 0 24 1.07443 24 2.4V21.6C24 22.9256 22.9256 24 21.6 24H2.4C1.07443 24 0 22.9256 0 21.6V2.4C0 1.07443 1.07443 0 2.4 0Z",fill:"#010101"}),a.jsx("path",{d:"M16.0971 9.46492C17.3375 10.3511 18.8571 10.8725 20.4981 10.8725V7.71605C20.1875 7.71617 19.8778 7.68377 19.5739 7.61937V10.104C17.9329 10.104 16.4136 9.58256 15.1729 8.69639V15.1378C15.1729 18.3601 12.5594 20.9721 9.33558 20.9721C8.13276 20.9721 7.01472 20.6087 6.08594 19.9853C7.14596 21.0686 8.62418 21.7407 10.2596 21.7407C13.4836 21.7407 16.0972 19.1286 16.0972 15.9062V9.46492H16.0971ZM17.2373 6.28044C16.6034 5.5883 16.1872 4.69375 16.0971 3.70479V3.29883H15.2213C15.4417 4.55571 16.1937 5.62956 17.2373 6.28044ZM8.12494 17.5127C7.77082 17.0486 7.5794 16.4808 7.58026 15.897C7.58026 14.4232 8.77571 13.2283 10.2505 13.2283C10.5254 13.2281 10.7986 13.2703 11.0605 13.3533V10.1263C10.7544 10.0844 10.4455 10.0666 10.1366 10.0732V12.5849C9.87454 12.5019 9.60122 12.4597 9.32629 12.4599C7.85147 12.4599 6.65612 13.6548 6.65612 15.1287C6.65612 16.1708 7.25362 17.0732 8.12494 17.5127Z",fill:"#EE1D52"}),a.jsx("path",{d:"M15.1726 8.69639C16.4133 9.58256 17.9326 10.104 19.5736 10.104V7.61937C18.6576 7.42444 17.8467 6.94594 17.237 6.28044C16.1934 5.62956 15.4414 4.55571 15.221 3.29883H12.9204V15.9061C12.9152 17.3758 11.7218 18.5658 10.2501 18.5658C9.38288 18.5658 8.61243 18.1527 8.12452 17.5127C7.2532 17.0732 6.6557 16.1708 6.6557 15.1287C6.6557 13.6548 7.85104 12.4599 9.32587 12.4599C9.60841 12.4599 9.88075 12.5039 10.1362 12.5849V10.0732C6.96907 10.1386 4.42188 12.7251 4.42188 15.9062C4.42188 17.4941 5.05621 18.9337 6.08563 19.9854C7.01441 20.6088 8.13245 20.9722 9.33528 20.9722C12.5591 20.9722 15.1726 18.3601 15.1726 15.1379V8.69639Z",fill:"white"}),a.jsx("path",{d:"M19.5758 7.6202V6.94836C18.7498 6.9496 17.9401 6.71839 17.2392 6.28116C17.8596 6.96001 18.6765 7.42815 19.5758 7.6202ZM15.2232 3.29966C15.2022 3.17955 15.186 3.05864 15.1748 2.93721V2.53125H11.9983V15.1386C11.9932 16.6082 10.7999 17.7982 9.32812 17.7982C8.89598 17.7982 8.48809 17.6958 8.12678 17.5135C8.61468 18.1535 9.38513 18.5666 10.2524 18.5666C11.7239 18.5666 12.9174 17.3766 12.9226 15.9069V3.29966H15.2232ZM10.1386 10.074V9.35876C9.87315 9.32247 9.60555 9.30433 9.33764 9.30447C6.1135 9.30447 3.5 11.9166 3.5 15.1386C3.5 17.1587 4.52715 18.9389 6.088 19.9862C5.05858 18.9344 4.42424 17.4948 4.42424 15.9069C4.42424 12.7259 6.97133 10.1394 10.1386 10.074Z",fill:"#69C9D0"})]}),FZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M2 2H11.5V11.5H2V2Z",fill:"#F25022"}),a.jsx("path",{d:"M12.5 2H22V11.5H12.5V2Z",fill:"#7FBA00"}),a.jsx("path",{d:"M2 12.5H11.5V22H2V12.5Z",fill:"#00A4EF"}),a.jsx("path",{d:"M12.5 12.5H22V22H12.5V12.5Z",fill:"#FFB900"})]}),HZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsxs("g",{"clip-path":"url(#clip0_377_3451)",children:[a.jsx("path",{d:"M16.4954 9.25H22.6042C23.1814 9.25 23.6492 9.71786 23.6492 10.295V15.8593C23.6492 17.9805 21.9297 19.7 19.8086 19.7H19.7904C17.6693 19.7003 15.9495 17.981 15.9492 15.8599C15.9492 15.8597 15.9492 15.8595 15.9492 15.8593V9.79616C15.9492 9.49452 16.1937 9.25 16.4954 9.25Z",fill:"#5059C9"}),a.jsx("path",{d:"M20.6234 8.14922C21.9903 8.14922 23.0984 7.04112 23.0984 5.67422C23.0984 4.30731 21.9903 3.19922 20.6234 3.19922C19.2565 3.19922 18.1484 4.30731 18.1484 5.67422C18.1484 7.04112 19.2565 8.14922 20.6234 8.14922Z",fill:"#5059C9"}),a.jsx("path",{d:"M12.9266 8.15001C14.901 8.15001 16.5016 6.54942 16.5016 4.575C16.5016 2.60058 14.901 1 12.9266 1C10.9521 1 9.35156 2.60058 9.35156 4.575C9.35156 6.54942 10.9521 8.15001 12.9266 8.15001Z",fill:"#7B83EB"}),a.jsx("path",{d:"M17.6912 9.25H7.60751C7.03725 9.26411 6.58614 9.73737 6.59937 10.3077V16.6541C6.51973 20.0763 9.22724 22.9163 12.6494 23C16.0715 22.9163 18.779 20.0763 18.6994 16.6541V10.3077C18.7126 9.73737 18.2615 9.26411 17.6912 9.25Z",fill:"#7B83EB"}),a.jsx("path",{opacity:"0.1",d:"M13.2019 9.25V18.1435C13.1991 18.5513 12.952 18.9177 12.5749 19.073C12.4548 19.1238 12.3257 19.15 12.1954 19.15H7.08585C7.01436 18.9685 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H13.2019Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V18.6935C12.6518 18.8239 12.6257 18.9529 12.5749 19.073C12.4196 19.4501 12.0532 19.6973 11.6454 19.7H7.34436C7.25085 19.5185 7.16286 19.337 7.08585 19.15C7.00885 18.963 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V17.5935C12.6477 18.1476 12.1995 18.5958 11.6454 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1018 9.25V17.5935C12.0977 18.1476 11.6495 18.5958 11.0953 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.1018Z",fill:"black"}),a.jsx("path",{opacity:"0.1",d:"M13.2002 6.40688V8.13938C13.1067 8.14488 13.0187 8.15038 12.9252 8.15038C12.8317 8.15038 12.7437 8.14489 12.6502 8.13938C12.4646 8.12706 12.2805 8.09761 12.1002 8.05138C10.9865 7.78763 10.0663 7.00654 9.62522 5.95039C9.54932 5.77303 9.4904 5.58886 9.44922 5.40039H12.1937C12.7487 5.40249 13.1981 5.85188 13.2002 6.40688Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1 6.95572V8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.0935C11.6485 5.95133 12.0979 6.40072 12.1 6.95572Z",fill:"black"}),a.jsx("path",{d:"M1.00814 5.94922H11.0918C11.6486 5.94922 12.1 6.40059 12.1 6.95736V17.0411C12.1 17.5978 11.6486 18.0492 11.0918 18.0492H1.00814C0.451357 18.0492 0 17.5978 0 17.0411V6.95736C0 6.40059 0.451368 5.94922 1.00814 5.94922Z",fill:"url(#paint0_linear_377_3451)"}),a.jsx("path",{d:"M8.70484 9.78745H6.68908V15.2765H5.40484V9.78745H3.39844V8.72266H8.70484V9.78745Z",fill:"white"})]}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"paint0_linear_377_3451",x1:"2.10202",y1:"5.16147",x2:"9.99799",y2:"18.837",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{"stop-color":"#5A62C3"}),a.jsx("stop",{offset:"0.5","stop-color":"#4D55BD"}),a.jsx("stop",{offset:"1","stop-color":"#3940AB"})]}),a.jsx("clipPath",{id:"clip0_377_3451",children:a.jsx("rect",{width:"23.65",height:"22",fill:"white",transform:"translate(0 1)"})})]})]}),$Z=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M6.22775 0.0390625L6.2285 5.77431L0.5 5.77281V1.55856C0.5425 1.26056 0.63075 1.01031 0.76475 0.807812C1.09525 0.306812 1.57575 0.0545625 2.20625 0.0510625C3.53925 0.0440625 4.87975 0.0400625 6.22775 0.0390625Z",fill:"#0066DA"}),a.jsx("path",{d:"M6.22656 0.0390625L18.0331 0.0405625C18.0579 0.0405527 18.082 0.0481525 18.1021 0.0623125L18.1298 0.0825625C18.1218 0.0855625 18.1151 0.0888125 18.1096 0.0923125C18.1011 0.0968125 18.0968 0.103813 18.0968 0.113313L18.0953 5.77656C18.0943 5.77656 18.0931 5.77656 18.0916 5.77656H6.22956C6.22906 5.77606 6.22831 5.77531 6.22731 5.77431L6.22656 0.0390625Z",fill:"#FBBC04"}),a.jsx("path",{d:"M18.1322 0.0820312L23.7909 5.75803L18.0977 5.77603L18.0992 0.112781C18.0992 0.103281 18.1034 0.0962812 18.1119 0.0917812C18.1174 0.0882812 18.1242 0.0850312 18.1322 0.0820312Z",fill:"#EA4335"}),a.jsx("path",{d:"M0.5 5.77148L6.2285 5.77298C6.2295 5.77398 6.23025 5.77473 6.23075 5.77523L6.23225 13.7012L0.5 13.6997V5.77148Z",fill:"#2684FC"}),a.jsx("path",{d:"M23.788 5.75781L23.8232 5.78331V17.9258C23.6902 18.6523 23.3137 19.1216 22.6937 19.3336C22.4727 19.4096 22.147 19.4471 21.7165 19.4461C18.922 19.4416 16.099 19.4373 13.2475 19.4333C12.8335 19.4328 12.4135 19.4358 11.9875 19.4423C11.964 19.4428 11.944 19.4513 11.9275 19.4678C10.5325 20.8563 9.13247 22.2568 7.72747 23.6693C7.51222 23.8861 7.26847 24.0068 6.95947 23.9611C6.67147 23.9186 6.45922 23.7701 6.32272 23.5156C6.26522 23.4076 6.23597 23.2106 6.23497 22.9246C6.23147 21.7651 6.23022 20.6018 6.23122 19.4348L6.23047 16.5638L9.06397 13.7303C9.07632 13.718 9.09102 13.7081 9.10723 13.7015C9.12345 13.6948 9.14086 13.6913 9.15847 13.6913L18.031 13.6943C18.0475 13.6943 18.0633 13.6878 18.075 13.6761C18.0867 13.6644 18.0932 13.6486 18.0932 13.6321L18.091 5.77581C18.0925 5.77581 18.0937 5.77581 18.0947 5.77581L23.788 5.75781Z",fill:"#00AC47"}),a.jsx("path",{d:"M6.23225 13.7027V16.5647L6.233 19.4357C5.0345 19.4427 3.84625 19.4449 2.66825 19.4424C2.17725 19.4414 1.8235 19.4029 1.607 19.3269C1 19.1149 0.631 18.6449 0.5 17.9169V13.7012L6.23225 13.7027Z",fill:"#00832D"})]}),VZ=({className:e,size:t=24,strokeWidth:n=2,strokeColor:r="#1E88E5"})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:r,"stroke-width":n,"stroke-linecap":"round","stroke-linejoin":"round",children:[a.jsx("path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}),a.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"})]});function jo({className:e,...t}){return a.jsx("textarea",{"data-slot":"textarea",className:se("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 LD({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:s="min-h-[150px]",displayOnly:i=!1,showCopyButton:c=!1}){const u=(w,R)=>{if(!w||R.length===0)return!1;try{const j=JSON.parse(w),_=D=>typeof D!="object"||D===null?!1:Array.isArray(D)?D.some(O=>typeof O=="object"&&O!==null&&_(O)):Object.keys(D).some(O=>R.includes(O)||typeof D[O]=="object"&&D[O]!==null&&_(D[O]));return _(j)}catch{return!1}},f=i?!1:!e||n.length===0||!u(e,n),[m,y]=h.useState(f),[g,x]=h.useState(!1);h.useEffect(()=>{i?y(!1):(!e||n.length===0||!u(e,n))&&y(!0)},[e,n,i]),h.useEffect(()=>{if(g){const w=setTimeout(()=>{x(!1)},2e3);return()=>{clearTimeout(w)}}},[g]);const v=()=>{navigator.clipboard.writeText(e),x(!0)},C=w=>{if(!w)return"";try{const R=JSON.parse(w),j=O=>{if(typeof O!="object"||O===null)return O;const A=Array.isArray(O)?[...O]:{...O};return Array.isArray(A)?A.forEach((T,I)=>{typeof T=="object"&&T!==null&&(A[I]=j(T))}):Object.entries(A).forEach(([T,I])=>{if(n.includes(T))if(typeof I=="string"){const k=I.length;k>30?A[T]="*".repeat(Math.min(20,Math.ceil(k/3))):k>10?A[T]="*".repeat(Math.min(10,Math.ceil(k/2))):A[T]="*".repeat(k)}else A[T]="***";else typeof I=="object"&&I!==null&&(A[T]=j(I))}),A},D=j(typeof R=="object"?R:{});return JSON.stringify(D,null,2)}catch{return w}},b=e&&n.length>0&&u(e,n);return a.jsxs("div",{className:"relative",children:[!m&&b&&!i&&a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("div",{className:"absolute top-2 left-2 z-10",children:a.jsx(ZU,{className:"h-4 w-4 text-gray-500"})})}),a.jsx(St,{children:a.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),i?a.jsx("div",{className:`p-2 font-mono ${r??""} ${s} cursor-not-allowed whitespace-pre-wrap opacity-70`,children:C(e)}):a.jsx(jo,{value:m?e:C(e),onChange:w=>{(m||!b)&&t&&t(w.target.value)},onFocus:w=>{!m&&b&&w.target.blur()},readOnly:!!(!m&&b),className:`font-mono ${r??""} ${!m&&b?"cursor-not-allowed opacity-70":""} ${s}`,rows:8}),b&&!i&&a.jsx(we,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{y(!m)},children:m?a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(fU,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),a.jsx(St,{children:a.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(MA,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),a.jsx(St,{children:a.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),c&&a.jsx(we,{type:"button",variant:"ghost",className:`absolute ${b&&!i?"top-2 right-24":"top-2 right-2"}`,onClick:v,children:a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("div",{className:"flex items-center gap-1",children:g?a.jsxs(a.Fragment,{children:[a.jsx(oa,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copied!"})]}):a.jsxs(a.Fragment,{children:[a.jsx(Wu,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copy"})]})})}),a.jsx(St,{children:a.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var rn;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const i={};for(const c of s)i[c]=c;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of i)c[u]=s[u];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&i.push(c);return i},e.find=(s,i)=>{for(const c of s)if(i(c))return c},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(rn||(rn={}));var d_;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(d_||(d_={}));const Ge=rn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),qi=e=>{switch(typeof e){case"undefined":return Ge.undefined;case"string":return Ge.string;case"number":return Number.isNaN(e)?Ge.nan:Ge.number;case"boolean":return Ge.boolean;case"function":return Ge.function;case"bigint":return Ge.bigint;case"symbol":return Ge.symbol;case"object":return Array.isArray(e)?Ge.array:e===null?Ge.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ge.promise:typeof Map<"u"&&e instanceof Map?Ge.map:typeof Set<"u"&&e instanceof Set?Ge.set:typeof Date<"u"&&e instanceof Date?Ge.date:Ge.object;default:return Ge.unknown}},Ne=rn.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 li extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},s=i=>{for(const c of i.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)r._errors.push(n(c));else{let u=r,f=0;for(;f<c.path.length;){const m=c.path[f];f===c.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(n(c))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return s(this),r}static assert(t){if(!(t instanceof li))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}li.create=e=>new li(e);const J1=(e,t)=>{let n;switch(e.code){case Ne.invalid_type:e.received===Ge.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,rn.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${rn.joinValues(e.keys,", ")}`;break;case Ne.invalid_union:n="Invalid input";break;case Ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${rn.joinValues(e.options)}`;break;case Ne.invalid_enum_value:n=`Invalid enum value. Expected ${rn.joinValues(e.options)}, received '${e.received}'`;break;case Ne.invalid_arguments:n="Invalid function arguments";break;case Ne.invalid_return_type:n="Invalid function return type";break;case Ne.invalid_date:n="Invalid date";break;case Ne.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}"`:rn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ne.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==="bigint"?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 Ne.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 Ne.custom:n="Invalid input";break;case Ne.invalid_intersection_types:n="Intersection results could not be merged";break;case Ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,rn.assertNever(e)}return{message:n}};let GZ=J1;function BZ(){return GZ}const qZ=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],c={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let u="";const f=r.filter(m=>!!m).slice().reverse();for(const m of f)u=m(c,{data:t,defaultError:u}).message;return{...s,path:i,message:u}};function Ue(e,t){const n=BZ(),r=qZ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===J1?void 0:J1].filter(s=>!!s)});e.common.issues.push(r)}class ca{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return ut;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const i=await s.key,c=await s.value;r.push({key:i,value:c})}return ca.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:i,value:c}=s;if(i.status==="aborted"||c.status==="aborted")return ut;i.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(r[i.value]=c.value)}return{status:t.value,value:r}}}const ut=Object.freeze({status:"aborted"}),Of=e=>({status:"dirty",value:e}),Cs=e=>({status:"valid",value:e}),f_=e=>e.status==="aborted",h_=e=>e.status==="dirty",td=e=>e.status==="valid",pg=e=>typeof Promise<"u"&&e instanceof Promise;var Je;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Je||(Je={}));class Co{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}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 m_=(e,t)=>{if(td(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 li(e.common.issues);return this._error=n,this._error}}};function At(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(c,u)=>{const{message:f}=e;return c.code==="invalid_enum_value"?{message:f??u.defaultError}:typeof u.data>"u"?{message:f??r??u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:f??n??u.defaultError}},description:s}}class Gt{get description(){return this._def.description}_getType(t){return qi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:qi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ca,ctx:{common:t.parent.common,data:t.data,parsedType:qi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(pg(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={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:qi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return m_(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:qi(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return td(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>td(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:qi(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(pg(s)?s:Promise.resolve(s));return m_(r,i)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const c=t(s),u=()=>i.addIssue({code:Ne.custom,...r(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(f=>f?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new gc({schema:this,typeName:dt.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 ti.create(this,this._def)}nullable(){return yc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return po.create(this)}promise(){return wg.create(this,this._def)}or(t){return xg.create([this,t],this._def)}and(t){return vg.create(this,t,this._def)}transform(t){return new gc({...At(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Eg({...At(this._def),innerType:this,defaultValue:n,typeName:dt.ZodDefault})}brand(){return new FD({typeName:dt.ZodBranded,type:this,...At(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Rg({...At(this._def),innerType:this,catchValue:n,typeName:dt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ZS.create(this,t)}readonly(){return jg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const KZ=/^c[^\s-]{8,}$/i,ZZ=/^[0-9a-z]+$/,YZ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,WZ=/^[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,XZ=/^[a-z0-9_-]{21}$/i,QZ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,JZ=/^[-+]?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)?)??$/,eY=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let B0;const nY=/^(?:(?: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])$/,rY=/^(?:(?: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])$/,aY=/^(([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]))$/,sY=/^(([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])$/,oY=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iY=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,PD="((\\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])))",lY=new RegExp(`^${PD}$`);function UD(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 cY(e){return new RegExp(`^${UD(e)}$`)}function uY(e){let t=`${PD}T${UD(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 dY(e,t){return!!((t==="v4"||!t)&&nY.test(e)||(t==="v6"||!t)&&aY.test(e))}function fY(e,t){if(!QZ.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function hY(e,t){return!!((t==="v4"||!t)&&rY.test(e)||(t==="v6"||!t)&&sY.test(e))}class ei extends Gt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ge.string){const i=this._getOrReturnCtx(t);return Ue(i,{code:Ne.invalid_type,expected:Ge.string,received:i.parsedType}),ut}const r=new ca;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const c=t.data.length>i.value,u=t.data.length<i.value;(c||u)&&(s=this._getOrReturnCtx(t,s),c?Ue(s,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&Ue(s,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")eY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"email",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")B0||(B0=new RegExp(tY,"u")),B0.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"emoji",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")WZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"uuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")XZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"nanoid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")KZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")ZZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid2",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")YZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ulid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Ue(s,{validation:"url",code:Ne.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"regex",code:Ne.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?uY(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?lY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?cY(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?JZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"duration",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?dY(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ip",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?fY(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"jwt",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?hY(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cidr",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?oY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?iY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64url",code:Ne.invalid_string,message:i.message}),r.dirty()):rn.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Ne.invalid_string,...Je.errToObj(r)})}_addCheck(t){return new ei({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Je.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Je.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Je.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Je.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Je.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Je.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Je.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Je.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Je.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Je.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Je.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Je.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Je.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,...Je.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,...Je.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Je.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Je.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Je.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Je.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Je.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Je.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Je.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Je.errToObj(n)})}nonempty(t){return this.min(1,Je.errToObj(t))}trim(){return new ei({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ei({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ei({...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}}ei.create=e=>new ei({checks:[],typeName:dt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...At(e)});function mY(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return i%c/10**s}class nd extends Gt{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)!==Ge.number){const i=this._getOrReturnCtx(t);return Ue(i,{code:Ne.invalid_type,expected:Ge.number,received:i.parsedType}),ut}let r;const s=new ca;for(const i of this._def.checks)i.kind==="int"?rn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?mY(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.not_finite,message:i.message}),s.dirty()):rn.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Je.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Je.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Je.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Je.toString(n))}setLimit(t,n,r,s){return new nd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(s)}]})}_addCheck(t){return new nd({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Je.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Je.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Je.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Je.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Je.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Je.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"&&rn.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}nd.create=e=>new nd({checks:[],typeName:dt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...At(e)});class th extends Gt{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)!==Ge.bigint)return this._getInvalidInput(t);let r;const s=new ca;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):rn.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Ne.invalid_type,expected:Ge.bigint,received:n.parsedType}),ut}gte(t,n){return this.setLimit("min",t,!0,Je.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Je.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Je.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Je.toString(n))}setLimit(t,n,r,s){return new th({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(s)}]})}_addCheck(t){return new th({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Je.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Je.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}}th.create=e=>new th({checks:[],typeName:dt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...At(e)});class eb extends Gt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ge.boolean){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Ge.boolean,received:r.parsedType}),ut}return Cs(t.data)}}eb.create=e=>new eb({typeName:dt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...At(e)});class gg extends Gt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ge.date){const i=this._getOrReturnCtx(t);return Ue(i,{code:Ne.invalid_type,expected:Ge.date,received:i.parsedType}),ut}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Ue(i,{code:Ne.invalid_date}),ut}const r=new ca;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):rn.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new gg({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Je.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Je.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}}gg.create=e=>new gg({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:dt.ZodDate,...At(e)});class p_ extends Gt{_parse(t){if(this._getType(t)!==Ge.symbol){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Ge.symbol,received:r.parsedType}),ut}return Cs(t.data)}}p_.create=e=>new p_({typeName:dt.ZodSymbol,...At(e)});class tb extends Gt{_parse(t){if(this._getType(t)!==Ge.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Ge.undefined,received:r.parsedType}),ut}return Cs(t.data)}}tb.create=e=>new tb({typeName:dt.ZodUndefined,...At(e)});class yg extends Gt{_parse(t){if(this._getType(t)!==Ge.null){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Ge.null,received:r.parsedType}),ut}return Cs(t.data)}}yg.create=e=>new yg({typeName:dt.ZodNull,...At(e)});class g_ extends Gt{constructor(){super(...arguments),this._any=!0}_parse(t){return Cs(t.data)}}g_.create=e=>new g_({typeName:dt.ZodAny,...At(e)});class nb extends Gt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Cs(t.data)}}nb.create=e=>new nb({typeName:dt.ZodUnknown,...At(e)});class hl extends Gt{_parse(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Ne.invalid_type,expected:Ge.never,received:n.parsedType}),ut}}hl.create=e=>new hl({typeName:dt.ZodNever,...At(e)});class y_ extends Gt{_parse(t){if(this._getType(t)!==Ge.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Ge.void,received:r.parsedType}),ut}return Cs(t.data)}}y_.create=e=>new y_({typeName:dt.ZodVoid,...At(e)});class po extends Gt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Ge.array)return Ue(n,{code:Ne.invalid_type,expected:Ge.array,received:n.parsedType}),ut;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(Ue(n,{code:c?Ne.too_big:Ne.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Ue(n,{code:Ne.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Ue(n,{code:Ne.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Co(n,c,n.path,u)))).then(c=>ca.mergeArray(r,c));const i=[...n.data].map((c,u)=>s.type._parseSync(new Co(n,c,n.path,u)));return ca.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new po({...this._def,minLength:{value:t,message:Je.toString(n)}})}max(t,n){return new po({...this._def,maxLength:{value:t,message:Je.toString(n)}})}length(t,n){return new po({...this._def,exactLength:{value:t,message:Je.toString(n)}})}nonempty(t){return this.min(1,t)}}po.create=(e,t)=>new po({type:e,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...At(t)});function Tu(e){if(e instanceof fr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ti.create(Tu(r))}return new fr({...e._def,shape:()=>t})}else return e instanceof po?new po({...e._def,type:Tu(e.element)}):e instanceof ti?ti.create(Tu(e.unwrap())):e instanceof yc?yc.create(Tu(e.unwrap())):e instanceof mc?mc.create(e.items.map(t=>Tu(t))):e}class fr extends Gt{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=rn.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ge.object){const m=this._getOrReturnCtx(t);return Ue(m,{code:Ne.invalid_type,expected:Ge.object,received:m.parsedType}),ut}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof hl&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||u.push(m);const f=[];for(const m of c){const y=i[m],g=s.data[m];f.push({key:{status:"valid",value:m},value:y._parse(new Co(s,g,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof hl){const m=this._def.unknownKeys;if(m==="passthrough")for(const y of u)f.push({key:{status:"valid",value:y},value:{status:"valid",value:s.data[y]}});else if(m==="strict")u.length>0&&(Ue(s,{code:Ne.unrecognized_keys,keys:u}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const y of u){const g=s.data[y];f.push({key:{status:"valid",value:y},value:m._parse(new Co(s,g,s.path,y)),alwaysSet:y in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const y of f){const g=await y.key,x=await y.value;m.push({key:g,value:x,alwaysSet:y.alwaysSet})}return m}).then(m=>ca.mergeObjectSync(r,m)):ca.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return Je.errToObj,new fr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,c;const s=((c=(i=this._def).errorMap)==null?void 0:c.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Je.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new fr({...this._def,unknownKeys:"strip"})}passthrough(){return new fr({...this._def,unknownKeys:"passthrough"})}extend(t){return new fr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new fr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:dt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new fr({...this._def,catchall:t})}pick(t){const n={};for(const r of rn.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new fr({...this._def,shape:()=>n})}omit(t){const n={};for(const r of rn.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new fr({...this._def,shape:()=>n})}deepPartial(){return Tu(this)}partial(t){const n={};for(const r of rn.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new fr({...this._def,shape:()=>n})}required(t){const n={};for(const r of rn.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ti;)i=i._def.innerType;n[r]=i}return new fr({...this._def,shape:()=>n})}keyof(){return zD(rn.objectKeys(this.shape))}}fr.create=(e,t)=>new fr({shape:()=>e,unknownKeys:"strip",catchall:hl.create(),typeName:dt.ZodObject,...At(t)});fr.strictCreate=(e,t)=>new fr({shape:()=>e,unknownKeys:"strict",catchall:hl.create(),typeName:dt.ZodObject,...At(t)});fr.lazycreate=(e,t)=>new fr({shape:e,unknownKeys:"strip",catchall:hl.create(),typeName:dt.ZodObject,...At(t)});class xg extends Gt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=i.map(u=>new li(u.ctx.common.issues));return Ue(n,{code:Ne.invalid_union,unionErrors:c}),ut}if(n.common.async)return Promise.all(r.map(async i=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let i;const c=[];for(const f of r){const m={...n,common:{...n.common,issues:[]},parent:null},y=f._parseSync({data:n.data,path:n.path,parent:m});if(y.status==="valid")return y;y.status==="dirty"&&!i&&(i={result:y,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=c.map(f=>new li(f));return Ue(n,{code:Ne.invalid_union,unionErrors:u}),ut}}get options(){return this._def.options}}xg.create=(e,t)=>new xg({options:e,typeName:dt.ZodUnion,...At(t)});const Yo=e=>e instanceof ab?Yo(e.schema):e instanceof gc?Yo(e.innerType()):e instanceof Sg?[e.value]:e instanceof pc?e.options:e instanceof Cg?rn.objectValues(e.enum):e instanceof Eg?Yo(e._def.innerType):e instanceof tb?[void 0]:e instanceof yg?[null]:e instanceof ti?[void 0,...Yo(e.unwrap())]:e instanceof yc?[null,...Yo(e.unwrap())]:e instanceof FD||e instanceof jg?Yo(e.unwrap()):e instanceof Rg?Yo(e._def.innerType):[];class KS extends Gt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ge.object)return Ue(n,{code:Ne.invalid_type,expected:Ge.object,received:n.parsedType}),ut;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Ue(n,{code:Ne.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ut)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const i of n){const c=Yo(i.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);s.set(u,i)}}return new KS({typeName:dt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...At(r)})}}function rb(e,t){const n=qi(e),r=qi(t);if(e===t)return{valid:!0,data:e};if(n===Ge.object&&r===Ge.object){const s=rn.objectKeys(t),i=rn.objectKeys(e).filter(u=>s.indexOf(u)!==-1),c={...e,...t};for(const u of i){const f=rb(e[u],t[u]);if(!f.valid)return{valid:!1};c[u]=f.data}return{valid:!0,data:c}}else if(n===Ge.array&&r===Ge.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const c=e[i],u=t[i],f=rb(c,u);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===Ge.date&&r===Ge.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class vg extends Gt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,c)=>{if(f_(i)||f_(c))return ut;const u=rb(i.value,c.value);return u.valid?((h_(i)||h_(c))&&n.dirty(),{status:n.value,value:u.data}):(Ue(r,{code:Ne.invalid_intersection_types}),ut)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,c])=>s(i,c)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}vg.create=(e,t,n)=>new vg({left:e,right:t,typeName:dt.ZodIntersection,...At(n)});class mc extends Gt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.array)return Ue(r,{code:Ne.invalid_type,expected:Ge.array,received:r.parsedType}),ut;if(r.data.length<this._def.items.length)return Ue(r,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ut;!this._def.rest&&r.data.length>this._def.items.length&&(Ue(r,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((c,u)=>{const f=this._def.items[u]||this._def.rest;return f?f._parse(new Co(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(i).then(c=>ca.mergeArray(n,c)):ca.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new mc({...this._def,rest:t})}}mc.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new mc({items:e,typeName:dt.ZodTuple,rest:null,...At(t)})};class bg extends Gt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.object)return Ue(r,{code:Ne.invalid_type,expected:Ge.object,received:r.parsedType}),ut;const s=[],i=this._def.keyType,c=this._def.valueType;for(const u in r.data)s.push({key:i._parse(new Co(r,u,r.path,u)),value:c._parse(new Co(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?ca.mergeObjectAsync(n,s):ca.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Gt?new bg({keyType:t,valueType:n,typeName:dt.ZodRecord,...At(r)}):new bg({keyType:ei.create(),valueType:t,typeName:dt.ZodRecord,...At(n)})}}class x_ extends Gt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.map)return Ue(r,{code:Ne.invalid_type,expected:Ge.map,received:r.parsedType}),ut;const s=this._def.keyType,i=this._def.valueType,c=[...r.data.entries()].map(([u,f],m)=>({key:s._parse(new Co(r,u,r.path,[m,"key"])),value:i._parse(new Co(r,f,r.path,[m,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const f of c){const m=await f.key,y=await f.value;if(m.status==="aborted"||y.status==="aborted")return ut;(m.status==="dirty"||y.status==="dirty")&&n.dirty(),u.set(m.value,y.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const f of c){const m=f.key,y=f.value;if(m.status==="aborted"||y.status==="aborted")return ut;(m.status==="dirty"||y.status==="dirty")&&n.dirty(),u.set(m.value,y.value)}return{status:n.value,value:u}}}}x_.create=(e,t,n)=>new x_({valueType:t,keyType:e,typeName:dt.ZodMap,...At(n)});class nh extends Gt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.set)return Ue(r,{code:Ne.invalid_type,expected:Ge.set,received:r.parsedType}),ut;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ue(r,{code:Ne.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Ue(r,{code:Ne.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function c(f){const m=new Set;for(const y of f){if(y.status==="aborted")return ut;y.status==="dirty"&&n.dirty(),m.add(y.value)}return{status:n.value,value:m}}const u=[...r.data.values()].map((f,m)=>i._parse(new Co(r,f,r.path,m)));return r.common.async?Promise.all(u).then(f=>c(f)):c(u)}min(t,n){return new nh({...this._def,minSize:{value:t,message:Je.toString(n)}})}max(t,n){return new nh({...this._def,maxSize:{value:t,message:Je.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}nh.create=(e,t)=>new nh({valueType:e,minSize:null,maxSize:null,typeName:dt.ZodSet,...At(t)});class ab extends Gt{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})}}ab.create=(e,t)=>new ab({getter:e,typeName:dt.ZodLazy,...At(t)});class Sg extends Gt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ue(n,{received:n.data,code:Ne.invalid_literal,expected:this._def.value}),ut}return{status:"valid",value:t.data}}get value(){return this._def.value}}Sg.create=(e,t)=>new Sg({value:e,typeName:dt.ZodLiteral,...At(t)});function zD(e,t){return new pc({values:e,typeName:dt.ZodEnum,...At(t)})}class pc extends Gt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{expected:rn.joinValues(r),received:n.parsedType,code:Ne.invalid_type}),ut}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{received:n.data,code:Ne.invalid_enum_value,options:r}),ut}return Cs(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 pc.create(t,{...this._def,...n})}exclude(t,n=this._def){return pc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}pc.create=zD;class Cg extends Gt{_parse(t){const n=rn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ge.string&&r.parsedType!==Ge.number){const s=rn.objectValues(n);return Ue(r,{expected:rn.joinValues(s),received:r.parsedType,code:Ne.invalid_type}),ut}if(this._cache||(this._cache=new Set(rn.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=rn.objectValues(n);return Ue(r,{received:r.data,code:Ne.invalid_enum_value,options:s}),ut}return Cs(t.data)}get enum(){return this._def.values}}Cg.create=(e,t)=>new Cg({values:e,typeName:dt.ZodNativeEnum,...At(t)});class wg extends Gt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ge.promise&&n.common.async===!1)return Ue(n,{code:Ne.invalid_type,expected:Ge.promise,received:n.parsedType}),ut;const r=n.parsedType===Ge.promise?n.data:Promise.resolve(n.data);return Cs(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}wg.create=(e,t)=>new wg({type:e,typeName:dt.ZodPromise,...At(t)});class gc extends Gt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:c=>{Ue(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const c=s.transform(r.data,i);if(r.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return ut;const f=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return f.status==="aborted"?ut:f.status==="dirty"||n.value==="dirty"?Of(f.value):f});{if(n.value==="aborted")return ut;const u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?ut:u.status==="dirty"||n.value==="dirty"?Of(u.value):u}}if(s.type==="refinement"){const c=u=>{const f=s.refinement(u,i);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?ut:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?ut:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!td(c))return ut;const u=s.transform(c.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>td(c)?Promise.resolve(s.transform(c.value,i)).then(u=>({status:n.value,value:u})):ut);rn.assertNever(s)}}gc.create=(e,t,n)=>new gc({schema:e,typeName:dt.ZodEffects,effect:t,...At(n)});gc.createWithPreprocess=(e,t,n)=>new gc({schema:t,effect:{type:"preprocess",transform:e},typeName:dt.ZodEffects,...At(n)});class ti extends Gt{_parse(t){return this._getType(t)===Ge.undefined?Cs(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ti.create=(e,t)=>new ti({innerType:e,typeName:dt.ZodOptional,...At(t)});class yc extends Gt{_parse(t){return this._getType(t)===Ge.null?Cs(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}yc.create=(e,t)=>new yc({innerType:e,typeName:dt.ZodNullable,...At(t)});class Eg extends Gt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ge.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Eg.create=(e,t)=>new Eg({innerType:e,typeName:dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...At(t)});class Rg extends Gt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return pg(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new li(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new li(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Rg.create=(e,t)=>new Rg({innerType:e,typeName:dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...At(t)});class v_ extends Gt{_parse(t){if(this._getType(t)!==Ge.nan){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Ge.nan,received:r.parsedType}),ut}return{status:"valid",value:t.data}}}v_.create=e=>new v_({typeName:dt.ZodNaN,...At(e)});class FD extends Gt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ZS extends Gt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ut:i.status==="dirty"?(n.dirty(),Of(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ut:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new ZS({in:t,out:n,typeName:dt.ZodPipeline})}}class jg extends Gt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(td(s)&&(s.value=Object.freeze(s.value)),s);return pg(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}jg.create=(e,t)=>new jg({innerType:e,typeName:dt.ZodReadonly,...At(t)});var dt;(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"})(dt||(dt={}));const Dt=ei.create,pY=nd.create,gY=eb.create,yY=yg.create,xY=nb.create;hl.create;const sb=po.create,an=fr.create,vY=xg.create,YS=KS.create;vg.create;mc.create;const bY=bg.create,Gr=Sg.create;pc.create;const Ry=Cg.create;wg.create;ti.create;const SY=yc.create,q0=ut,HD=an({serviceAccount:Dt().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Ne.custom,message:"Service Account must be a valid JSON object"}),q0):n.client_email?e:(t.addIssue({code:Ne.custom,message:"Service Account must contain a client_email field"}),q0)}catch(n){return console.error(n),t.addIssue({code:Ne.custom,message:"Service Account must be a valid JSON string"}),q0}})}),CY=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:jZ,visible:{flagKey:"MENU_GITHUB_COMMUNITY_VISIBLE",expectedValue:"true"},group:"community"},{type:"menu-item",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:dT,visible:{flagKey:"MENU_UPGRADE_OPTIONS_VISIBLE",expectedValue:"true"},group:"community"},{type:"menu-item",title:"Project settings",href:"https://platform.owox.com/ui/p/none/settings/general",icon:FA,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Credits consumption",href:"https://platform.owox.com/ui/p/none/settings/consumption",icon:dT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:LP,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:fT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:fT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"better-auth"},group:"project"},{type:"menu-item",title:"Leave Feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:tz,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:NP,visible:{flagKey:"MENU_ISSUES_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:jz,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:IZ,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function ob(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function wY(){const{flags:e}=md(),{loadProjects:t,projects:n}=OD(),{id:r}=aD(),s=ob("IDP_PROVIDER","owox",e);h.useEffect(()=>{s&&t()},[t,s]);const i=n.length>1;return{visibleMenuItems:h.useMemo(()=>{const f=CY.filter(x=>typeof x.visible=="boolean"?x.visible:ob(x.visible.flagKey,x.visible.expectedValue,e)).map(x=>{if(x.group==="project"&&x.href&&r)try{const v=x.href.replace("/p/none/",`/p/${r}/`);return{...x,href:v}}catch{return x}return x}),m=new Map;f.forEach(x=>{const v=x.group||"default";m.has(v)||m.set(v,[]);const C=m.get(v);C&&C.push(x)});const y=[],g=Array.from(m.entries()).filter(([,x])=>x.length>0);return g.forEach(([,x],v)=>{y.push(...x),v<g.length-1&&y.push({type:"separator",visible:!0})}),y},[e,r]),canSwitchProject:i}}function EY(){const{visibleMenuItems:e,canSwitchProject:t}=wY();return a.jsxs(Er,{align:"start",side:"right",className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return a.jsx(la,{},`separator-${String(r)}`);const s=n.icon;return a.jsx(Ct,{asChild:!0,children:a.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[a.jsx(s,{className:"size-4"}),n.title]})},n.href)}),t&&a.jsx(RZ,{},"switch-project")]})}var Et=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(Et||{});let RY={data:""},jY=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||RY},TY=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,_Y=/\/\*[^]*?\*\/| +/g,b_=/\n+/g,Wi=(e,t)=>{let n="",r="",s="";for(let i in e){let c=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+c+";":r+=i[1]=="f"?Wi(c,i):i+"{"+Wi(c,i[1]=="k"?"":t)+"}":typeof c=="object"?r+=Wi(c,t?t.replace(/([^,])+/g,u=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,u):u?u+" "+f:f)):i):c!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Wi.p?Wi.p(i,c):i+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},qo={},$D=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+$D(e[n]);return t}return e},NY=(e,t,n,r,s)=>{let i=$D(e),c=qo[i]||(qo[i]=(f=>{let m=0,y=11;for(;m<f.length;)y=101*y+f.charCodeAt(m++)>>>0;return"go"+y})(i));if(!qo[c]){let f=i!==e?e:(m=>{let y,g,x=[{}];for(;y=TY.exec(m.replace(_Y,""));)y[4]?x.shift():y[3]?(g=y[3].replace(b_," ").trim(),x.unshift(x[0][g]=x[0][g]||{})):x[0][y[1]]=y[2].replace(b_," ").trim();return x[0]})(e);qo[c]=Wi(s?{["@keyframes "+c]:f}:f,n?"":"."+c)}let u=n&&qo.g?qo.g:null;return n&&(qo.g=qo[c]),((f,m,y,g)=>{g?m.data=m.data.replace(g,f):m.data.indexOf(f)===-1&&(m.data=y?f+m.data:m.data+f)})(qo[c],t,r,u),c},AY=(e,t,n)=>e.reduce((r,s,i)=>{let c=t[i];if(c&&c.call){let u=c(n),f=u&&u.props&&u.props.className||/^go/.test(u)&&u;c=f?"."+f:u&&typeof u=="object"?u.props?"":Wi(u,""):u===!1?"":u}return r+s+(c??"")},"");function jy(e){let t=this||{},n=e.call?e(t.p):e;return NY(n.unshift?n.raw?AY(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,jY(t.target),t.g,t.o,t.k)}let VD,ib,lb;jy.bind({g:1});let ci=jy.bind({k:1});function DY(e,t,n,r){Wi.p=t,VD=e,ib=n,lb=r}function vl(e,t){let n=this||{};return function(){let r=arguments;function s(i,c){let u=Object.assign({},i),f=u.className||s.className;n.p=Object.assign({theme:ib&&ib()},u),n.o=/ *go\d+/.test(f),u.className=jy.apply(n,r)+(f?" "+f:"");let m=e;return e[0]&&(m=u.as||e,delete u.as),lb&&m[0]&&lb(u),VD(m,u)}return s}}var OY=e=>typeof e=="function",Tg=(e,t)=>OY(e)?e(t):e,IY=(()=>{let e=0;return()=>(++e).toString()})(),GD=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),MY=20,WS="default",BD=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(c=>c.id===t.toast.id?{...c,...t.toast}:c)};case 2:let{toast:r}=t;return BD(e,{type:e.toasts.find(c=>c.id===r.id)?1:0,toast:r});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(c=>c.id===s||s===void 0?{...c,dismissed:!0,visible:!1}:c)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(c=>c.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(c=>({...c,pauseDuration:c.pauseDuration+i}))}}},Zp=[],qD={toasts:[],pausedAt:void 0,settings:{toastLimit:MY}},fo={},KD=(e,t=WS)=>{fo[t]=BD(fo[t]||qD,e),Zp.forEach(([n,r])=>{n===t&&r(fo[t])})},ZD=e=>Object.keys(fo).forEach(t=>KD(e,t)),kY=e=>Object.keys(fo).find(t=>fo[t].toasts.some(n=>n.id===e)),Ty=(e=WS)=>t=>{KD(t,e)},LY={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},PY=(e={},t=WS)=>{let[n,r]=h.useState(fo[t]||qD),s=h.useRef(fo[t]);h.useEffect(()=>(s.current!==fo[t]&&r(fo[t]),Zp.push([t,r]),()=>{let c=Zp.findIndex(([u])=>u===t);c>-1&&Zp.splice(c,1)}),[t]);let i=n.toasts.map(c=>{var u,f,m;return{...e,...e[c.type],...c,removeDelay:c.removeDelay||((u=e[c.type])==null?void 0:u.removeDelay)||(e==null?void 0:e.removeDelay),duration:c.duration||((f=e[c.type])==null?void 0:f.duration)||(e==null?void 0:e.duration)||LY[c.type],style:{...e.style,...(m=e[c.type])==null?void 0:m.style,...c.style}}});return{...n,toasts:i}},UY=(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)||IY()}),Lh=e=>(t,n)=>{let r=UY(t,e,n);return Ty(r.toasterId||kY(r.id))({type:2,toast:r}),r.id},_n=(e,t)=>Lh("blank")(e,t);_n.error=Lh("error");_n.success=Lh("success");_n.loading=Lh("loading");_n.custom=Lh("custom");_n.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Ty(t)(n):ZD(n)};_n.dismissAll=e=>_n.dismiss(void 0,e);_n.remove=(e,t)=>{let n={type:4,toastId:e};t?Ty(t)(n):ZD(n)};_n.removeAll=e=>_n.remove(void 0,e);_n.promise=(e,t,n)=>{let r=_n.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?Tg(t.success,s):void 0;return i?_n.success(i,{id:r,...n,...n==null?void 0:n.success}):_n.dismiss(r),s}).catch(s=>{let i=t.error?Tg(t.error,s):void 0;i?_n.error(i,{id:r,...n,...n==null?void 0:n.error}):_n.dismiss(r)}),e};var zY=1e3,FY=(e,t="default")=>{let{toasts:n,pausedAt:r}=PY(e,t),s=h.useRef(new Map).current,i=h.useCallback((g,x=zY)=>{if(s.has(g))return;let v=setTimeout(()=>{s.delete(g),c({type:4,toastId:g})},x);s.set(g,v)},[]);h.useEffect(()=>{if(r)return;let g=Date.now(),x=n.map(v=>{if(v.duration===1/0)return;let C=(v.duration||0)+v.pauseDuration-(g-v.createdAt);if(C<0){v.visible&&_n.dismiss(v.id);return}return setTimeout(()=>_n.dismiss(v.id,t),C)});return()=>{x.forEach(v=>v&&clearTimeout(v))}},[n,r,t]);let c=h.useCallback(Ty(t),[t]),u=h.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=h.useCallback((g,x)=>{c({type:1,toast:{id:g,height:x}})},[c]),m=h.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),y=h.useCallback((g,x)=>{let{reverseOrder:v=!1,gutter:C=8,defaultPosition:b}=x||{},w=n.filter(_=>(_.position||b)===(g.position||b)&&_.height),R=w.findIndex(_=>_.id===g.id),j=w.filter((_,D)=>D<R&&_.visible).length;return w.filter(_=>_.visible).slice(...v?[j+1]:[0,j]).reduce((_,D)=>_+(D.height||0)+C,0)},[n]);return h.useEffect(()=>{n.forEach(g=>{if(g.dismissed)i(g.id,g.removeDelay);else{let x=s.get(g.id);x&&(clearTimeout(x),s.delete(g.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:f,startPause:u,endPause:m,calculateOffset:y}}},HY=ci`
|
|
606
|
-
from {
|
|
607
|
-
transform: scale(0) rotate(45deg);
|
|
608
|
-
opacity: 0;
|
|
609
|
-
}
|
|
610
|
-
to {
|
|
611
|
-
transform: scale(1) rotate(45deg);
|
|
612
|
-
opacity: 1;
|
|
613
|
-
}`,$Y=ci`
|
|
614
|
-
from {
|
|
615
|
-
transform: scale(0);
|
|
616
|
-
opacity: 0;
|
|
617
|
-
}
|
|
618
|
-
to {
|
|
619
|
-
transform: scale(1);
|
|
620
|
-
opacity: 1;
|
|
621
|
-
}`,VY=ci`
|
|
622
|
-
from {
|
|
623
|
-
transform: scale(0) rotate(90deg);
|
|
624
|
-
opacity: 0;
|
|
625
|
-
}
|
|
626
|
-
to {
|
|
627
|
-
transform: scale(1) rotate(90deg);
|
|
628
|
-
opacity: 1;
|
|
629
|
-
}`,GY=vl("div")`
|
|
630
|
-
width: 20px;
|
|
631
|
-
opacity: 0;
|
|
632
|
-
height: 20px;
|
|
633
|
-
border-radius: 10px;
|
|
634
|
-
background: ${e=>e.primary||"#ff4b4b"};
|
|
635
|
-
position: relative;
|
|
636
|
-
transform: rotate(45deg);
|
|
637
|
-
|
|
638
|
-
animation: ${HY} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
639
|
-
forwards;
|
|
640
|
-
animation-delay: 100ms;
|
|
641
|
-
|
|
642
|
-
&:after,
|
|
643
|
-
&:before {
|
|
644
|
-
content: '';
|
|
645
|
-
animation: ${$Y} 0.15s ease-out forwards;
|
|
646
|
-
animation-delay: 150ms;
|
|
647
|
-
position: absolute;
|
|
648
|
-
border-radius: 3px;
|
|
649
|
-
opacity: 0;
|
|
650
|
-
background: ${e=>e.secondary||"#fff"};
|
|
651
|
-
bottom: 9px;
|
|
652
|
-
left: 4px;
|
|
653
|
-
height: 2px;
|
|
654
|
-
width: 12px;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
&:before {
|
|
658
|
-
animation: ${VY} 0.15s ease-out forwards;
|
|
659
|
-
animation-delay: 180ms;
|
|
660
|
-
transform: rotate(90deg);
|
|
661
|
-
}
|
|
662
|
-
`,BY=ci`
|
|
663
|
-
from {
|
|
664
|
-
transform: rotate(0deg);
|
|
665
|
-
}
|
|
666
|
-
to {
|
|
667
|
-
transform: rotate(360deg);
|
|
668
|
-
}
|
|
669
|
-
`,qY=vl("div")`
|
|
670
|
-
width: 12px;
|
|
671
|
-
height: 12px;
|
|
672
|
-
box-sizing: border-box;
|
|
673
|
-
border: 2px solid;
|
|
674
|
-
border-radius: 100%;
|
|
675
|
-
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
676
|
-
border-right-color: ${e=>e.primary||"#616161"};
|
|
677
|
-
animation: ${BY} 1s linear infinite;
|
|
678
|
-
`,KY=ci`
|
|
679
|
-
from {
|
|
680
|
-
transform: scale(0) rotate(45deg);
|
|
681
|
-
opacity: 0;
|
|
682
|
-
}
|
|
683
|
-
to {
|
|
684
|
-
transform: scale(1) rotate(45deg);
|
|
685
|
-
opacity: 1;
|
|
686
|
-
}`,ZY=ci`
|
|
687
|
-
0% {
|
|
688
|
-
height: 0;
|
|
689
|
-
width: 0;
|
|
690
|
-
opacity: 0;
|
|
691
|
-
}
|
|
692
|
-
40% {
|
|
693
|
-
height: 0;
|
|
694
|
-
width: 6px;
|
|
695
|
-
opacity: 1;
|
|
696
|
-
}
|
|
697
|
-
100% {
|
|
698
|
-
opacity: 1;
|
|
699
|
-
height: 10px;
|
|
700
|
-
}`,YY=vl("div")`
|
|
701
|
-
width: 20px;
|
|
702
|
-
opacity: 0;
|
|
703
|
-
height: 20px;
|
|
704
|
-
border-radius: 10px;
|
|
705
|
-
background: ${e=>e.primary||"#61d345"};
|
|
706
|
-
position: relative;
|
|
707
|
-
transform: rotate(45deg);
|
|
708
|
-
|
|
709
|
-
animation: ${KY} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
710
|
-
forwards;
|
|
711
|
-
animation-delay: 100ms;
|
|
712
|
-
&:after {
|
|
713
|
-
content: '';
|
|
714
|
-
box-sizing: border-box;
|
|
715
|
-
animation: ${ZY} 0.2s ease-out forwards;
|
|
716
|
-
opacity: 0;
|
|
717
|
-
animation-delay: 200ms;
|
|
718
|
-
position: absolute;
|
|
719
|
-
border-right: 2px solid;
|
|
720
|
-
border-bottom: 2px solid;
|
|
721
|
-
border-color: ${e=>e.secondary||"#fff"};
|
|
722
|
-
bottom: 6px;
|
|
723
|
-
left: 6px;
|
|
724
|
-
height: 10px;
|
|
725
|
-
width: 6px;
|
|
726
|
-
}
|
|
727
|
-
`,WY=vl("div")`
|
|
728
|
-
position: absolute;
|
|
729
|
-
`,XY=vl("div")`
|
|
730
|
-
position: relative;
|
|
731
|
-
display: flex;
|
|
732
|
-
justify-content: center;
|
|
733
|
-
align-items: center;
|
|
734
|
-
min-width: 20px;
|
|
735
|
-
min-height: 20px;
|
|
736
|
-
`,QY=ci`
|
|
737
|
-
from {
|
|
738
|
-
transform: scale(0.6);
|
|
739
|
-
opacity: 0.4;
|
|
740
|
-
}
|
|
741
|
-
to {
|
|
742
|
-
transform: scale(1);
|
|
743
|
-
opacity: 1;
|
|
744
|
-
}`,JY=vl("div")`
|
|
745
|
-
position: relative;
|
|
746
|
-
transform: scale(0.6);
|
|
747
|
-
opacity: 0.4;
|
|
748
|
-
min-width: 20px;
|
|
749
|
-
animation: ${QY} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
750
|
-
forwards;
|
|
751
|
-
`,eW=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?h.createElement(JY,null,t):t:n==="blank"?null:h.createElement(XY,null,h.createElement(qY,{...r}),n!=="loading"&&h.createElement(WY,null,n==="error"?h.createElement(GY,{...r}):h.createElement(YY,{...r})))},tW=e=>`
|
|
752
|
-
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
753
|
-
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
754
|
-
`,nW=e=>`
|
|
755
|
-
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
756
|
-
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
757
|
-
`,rW="0%{opacity:0;} 100%{opacity:1;}",aW="0%{opacity:1;} 100%{opacity:0;}",sW=vl("div")`
|
|
758
|
-
display: flex;
|
|
759
|
-
align-items: center;
|
|
760
|
-
background: #fff;
|
|
761
|
-
color: #363636;
|
|
762
|
-
line-height: 1.3;
|
|
763
|
-
will-change: transform;
|
|
764
|
-
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
765
|
-
max-width: 350px;
|
|
766
|
-
pointer-events: auto;
|
|
767
|
-
padding: 8px 10px;
|
|
768
|
-
border-radius: 8px;
|
|
769
|
-
`,oW=vl("div")`
|
|
770
|
-
display: flex;
|
|
771
|
-
justify-content: center;
|
|
772
|
-
margin: 4px 10px;
|
|
773
|
-
color: inherit;
|
|
774
|
-
flex: 1 1 auto;
|
|
775
|
-
white-space: pre-line;
|
|
776
|
-
`,iW=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=GD()?[rW,aW]:[tW(n),nW(n)];return{animation:t?`${ci(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ci(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},lW=h.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?iW(e.position||t||"top-center",e.visible):{opacity:0},i=h.createElement(eW,{toast:e}),c=h.createElement(oW,{...e.ariaProps},Tg(e.message,e));return h.createElement(sW,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:c}):h.createElement(h.Fragment,null,i,c))});DY(h.createElement);var cW=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let i=h.useCallback(c=>{if(c){let u=()=>{let f=c.getBoundingClientRect().height;r(e,f)};u(),new MutationObserver(u).observe(c,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return h.createElement("div",{ref:i,className:t,style:n},s)},uW=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:GD()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},dW=jy`
|
|
777
|
-
z-index: 9999;
|
|
778
|
-
> * {
|
|
779
|
-
pointer-events: auto;
|
|
780
|
-
}
|
|
781
|
-
`,Sp=16,fW=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:i,containerStyle:c,containerClassName:u})=>{let{toasts:f,handlers:m}=FY(n,i);return h.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Sp,left:Sp,right:Sp,bottom:Sp,pointerEvents:"none",...c},className:u,onMouseEnter:m.startPause,onMouseLeave:m.endPause},f.map(y=>{let g=y.position||t,x=m.calculateOffset(y,{reverseOrder:e,gutter:r,defaultPosition:t}),v=uW(g,x);return h.createElement(cW,{id:y.id,key:y.id,onHeightUpdate:m.updateHeight,className:y.visible?dW:"",style:v},y.type==="custom"?Tg(y.message,y):s?s(y):h.createElement(lW,{toast:y,position:g}))}))},_t=_n;const dn=e=>{var n;return(n=e.response)==null?void 0:n.data};function S_(e,t="Something went wrong"){var s,i;const n=dn(e);let r=n.message.trim()||t;(i=(s=n.errorDetails)==null?void 0:s.error)!=null&&i.trim()&&(r=`${r}. ${n.errorDetails.error}`),_t.error(r)}function YD(e,t){var n,r,s,i;if(e){const c=e.trim().split(" ").filter(Boolean);return c.length>=2?`${((n=c[0])==null?void 0:n[0])??""}${((r=c[1])==null?void 0:r[0])??""}`.toUpperCase():((i=(s=c[0])==null?void 0:s[0])==null?void 0:i.toUpperCase())||""}if(t!=null&&t.includes("@")){const c=t.split("@")[0];return c.length>1?`${c[0]}${c[1]}`.toUpperCase():c[0].toUpperCase()}return"U"}class hW{constructor(){to(this,"isRefreshingToken",!1);to(this,"refreshTokenPromise",null);to(this,"accessToken",null)}getAccessToken(){return this.accessToken}setAccessToken(t){this.accessToken=t}isRefreshing(){return this.isRefreshingToken}async refreshToken(t){if(this.isRefreshingToken&&this.refreshTokenPromise)return await this.refreshTokenPromise;this.isRefreshingToken=!0,this.refreshTokenPromise=this.performRefresh(t);try{const n=await this.refreshTokenPromise;return this.setAccessToken(n),n}finally{this.isRefreshingToken=!1,this.refreshTokenPromise=null}}clear(){this.accessToken=null,this.isRefreshingToken=!1,this.refreshTokenPromise=null}async performRefresh(t){try{return await t()}catch(n){throw this.clear(),n}}}const mW={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},Ea=tr.create(mW),cb=new hW;Ea.interceptors.request.use(e=>{if(e.skipAuthHeader||new aZ(e.headers).has("X-OWOX-Authorization"))return e;const n=BS(),r=(n==null?void 0:n.getAccessToken())??cb.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));Ea.interceptors.response.use(e=>e,async e=>{var n,r,s;const t=e.config;if(((n=e.response)==null?void 0:n.status)===401&&!t._retry){t._retry=!0;try{const i=BS();if(!i)throw new Error("No token provider available");const c=await cb.refreshToken(()=>i.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await Ea(t)}catch{return cb.clear(),window.dispatchEvent(new CustomEvent("auth:logout",{detail:{reason:"token_refresh_failed"}})),Promise.reject(new Error("Token refresh failed"))}}return((r=e.response)==null?void 0:r.status)===403&&S_(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&S_(e,"Bad request"),Promise.reject(e)});const WD={projects:[],callState:Et.IDLE,error:null};function pW(e,t){switch(t.type){case"LOADING":return{...e,callState:Et.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:Et.LOADED,error:null};case"ERROR":return{...e,callState:Et.ERROR,error:t.payload};case"RESET":return{...WD};default:return e}}function gW({children:e}){const[t,n]=h.useReducer(pW,WD),r=h.useCallback(async()=>{n({type:"LOADING"});try{const u=BS();if(!u){n({type:"ERROR",payload:dn(new l_("No token provider"))});return}const f=u.getAccessToken();if(!f){n({type:"ERROR",payload:dn(new l_("Unable to obtain access token"))});return}const m=await dZ(f);n({type:"SUCCESS",payload:m})}catch(u){n({type:"ERROR",payload:dn(u)})}},[]),s=h.useCallback(()=>{n({type:"RESET"})},[]),i=t.callState===Et.LOADING,c={...t,loadProjects:r,reset:s,isLoading:i};return a.jsx(DD.Provider,{value:c,children:e})}function yW(){const[e,t]=h.useState(!1);return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(Cr,{open:e,onOpenChange:t,children:[a.jsx(_q,{isOpen:e}),a.jsx(gW,{children:a.jsx(EY,{})})]})})})})}var xW=(e,t,n,r,s,i,c,u)=>{let f=document.documentElement,m=["light","dark"];function y(v){(Array.isArray(e)?e:[e]).forEach(C=>{let b=C==="class",w=b&&i?s.map(R=>i[R]||R):s;b?(f.classList.remove(...w),f.classList.add(i&&i[v]?i[v]:v)):f.setAttribute(C,v)}),g(v)}function g(v){u&&m.includes(v)&&(f.style.colorScheme=v)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)y(r);else try{let v=localStorage.getItem(t)||n,C=c&&v==="system"?x():v;y(C)}catch{}},C_=["light","dark"],XD="(prefers-color-scheme: dark)",vW=typeof window>"u",XS=h.createContext(void 0),bW={setTheme:e=>{},themes:[]},Ph=()=>{var e;return(e=h.useContext(XS))!=null?e:bW},SW=e=>h.useContext(XS)?h.createElement(h.Fragment,null,e.children):h.createElement(wW,{...e}),CW=["light","dark"],wW=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:i=CW,defaultTheme:c=n?"system":"light",attribute:u="data-theme",value:f,children:m,nonce:y,scriptProps:g})=>{let[x,v]=h.useState(()=>RW(s,c)),[C,b]=h.useState(()=>x==="system"?K0():x),w=f?Object.values(f):i,R=h.useCallback(O=>{let A=O;if(!A)return;O==="system"&&n&&(A=K0());let T=f?f[A]:A,I=t?jW(y):null,k=document.documentElement,V=U=>{U==="class"?(k.classList.remove(...w),T&&k.classList.add(T)):U.startsWith("data-")&&(T?k.setAttribute(U,T):k.removeAttribute(U))};if(Array.isArray(u)?u.forEach(V):V(u),r){let U=C_.includes(c)?c:null,K=C_.includes(A)?A:U;k.style.colorScheme=K}I==null||I()},[y]),j=h.useCallback(O=>{let A=typeof O=="function"?O(x):O;v(A);try{localStorage.setItem(s,A)}catch{}},[x]),_=h.useCallback(O=>{let A=K0(O);b(A),x==="system"&&n&&!e&&R("system")},[x,e]);h.useEffect(()=>{let O=window.matchMedia(XD);return O.addListener(_),_(O),()=>O.removeListener(_)},[_]),h.useEffect(()=>{let O=A=>{A.key===s&&(A.newValue?v(A.newValue):j(c))};return window.addEventListener("storage",O),()=>window.removeEventListener("storage",O)},[j]),h.useEffect(()=>{R(e??x)},[e,x]);let D=h.useMemo(()=>({theme:x,setTheme:j,forcedTheme:e,resolvedTheme:x==="system"?C:x,themes:n?[...i,"system"]:i,systemTheme:n?C:void 0}),[x,j,e,C,n,i]);return h.createElement(XS.Provider,{value:D},h.createElement(EW,{forcedTheme:e,storageKey:s,attribute:u,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:i,nonce:y,scriptProps:g}),m)},EW=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:c,themes:u,nonce:f,scriptProps:m})=>{let y=JSON.stringify([n,t,i,e,u,c,r,s]).slice(1,-1);return h.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${xW.toString()})(${y})`}})}),RW=(e,t)=>{if(vW)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},jW=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)}},K0=e=>(e||(e=window.matchMedia(XD)),e.matches?"dark":"light");const TW=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:_W(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:PA},{value:"light",label:"Light",icon:$A},{value:"dark",label:"Dark",icon:UA}]}},{type:"separator"},{type:"item",title:"Sign out",icon:WU,onClick:n,className:"text-red-600 focus:text-red-600"}];function _W(e){switch(e){case"light":return $A;case"dark":return UA;case"system":default:return PA}}var $u=(e=>(e.LARGE="LARGE",e.NORMAL="NORMAL",e.SMALL="SMALL",e))($u||{});function ub({avatar:e,initials:t,displayName:n,size:r=$u.NORMAL}){let s,i,c;switch(r){case $u.SMALL:s="w-6 h-6",i="w-5 h-5",c="text-[10px]";break;case $u.LARGE:s="w-16 h-16",i="w-15 h-15",c="text-2xl";break;default:s="size-8",i="size-full",c="text-sm"}return a.jsx("div",{className:`${s} flex aspect-square items-center justify-center rounded-full border bg-white dark:bg-white/10`,children:e?a.jsx("img",{src:e,alt:n,className:`${i} rounded-full object-cover`}):a.jsx("span",{className:`${c} text-muted-foreground font-medium`,children:t})})}function NW({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return a.jsx(wr,{asChild:!0,children:a.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]:rounded-full 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:[a.jsx(ub,{avatar:r,initials:s,displayName:t}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[a.jsx("span",{className:"truncate font-medium",children:t}),n&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]}),a.jsx(Ss,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"-rotate-90":""}`})]})})}function AW({items:e}){return a.jsx(Er,{align:"end",side:"right",className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return a.jsx(la,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return a.jsxs(yy,{children:[a.jsxs(xy,{className:"flex items-center gap-2 px-2 py-1.5",children:[a.jsx(t.icon,{className:"size-4"}),t.title]}),a.jsx(vy,{children:r.options.map(s=>a.jsxs(Ct,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(s.value)},children:[s.icon&&a.jsx(s.icon,{className:"size-4"}),s.label,r.value===s.value&&a.jsx(oa,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return a.jsxs(Ct,{onClick:t.onClick,className:`flex items-center gap-2 px-2 py-1.5 ${t.className??""}`,children:[a.jsx(t.icon,{className:`size-4 ${t.className??""}`}),t.title]},t.title)})})}function DW(){const{user:e,signOut:t}=mi(),{setTheme:n,theme:r}=Ph(),[s,i]=h.useState(!1);if(!e)return null;const{fullName:c,email:u,avatar:f}=e,m=c??u??"Unknown User",y=YD(c,u);return a.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(Cr,{open:s,onOpenChange:i,children:[a.jsx(NW,{isOpen:s,displayName:m,email:u,avatar:f,initials:y}),a.jsx(AW,{items:TW({theme:r,setTheme:n,signOut:t})})]})})}function OW(){const{user:e,status:t}=mi();return t===Zr.LOADING||t===Zr.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function pi(){const e=wc(),t=OW(),n=h.useCallback((i,c)=>{if(!t){e("/",{replace:!0});return}const u=mg(t,i);e(u,c)},[e,t]),r=h.useCallback(i=>t?mg(t,i):i,[t]);return h.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function IW(e,t=500){const[n,r]=h.useState(!1),s=h.useRef(!1),i=h.useRef(null),c=h.useCallback(async(...u)=>{if(s.current)return Promise.reject(new Error("Action is locked"));s.current=!0,r(!0);try{return await e(...u)}finally{i.current=setTimeout(()=>{s.current=!1,r(!1)},t)}},[e,t]);return h.useEffect(()=>()=>{i.current&&clearTimeout(i.current),s.current=!1},[]),{trigger:c,isLocked:n}}function MW(){const{scope:e}=pi();return a.jsxs(ph,{to:e("/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:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:a.jsx(ma,{className:"size-4 shrink-0"})}),a.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:a.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})}const kW=[{title:"Data Marts",url:"/data-marts",icon:rg},{title:"Storages",url:"/data-storages",icon:cc},{title:"Destinations",url:"/data-destinations",icon:iS}];function LW(){const{scope:e}=pi();return a.jsx(IG,{children:kW.map(t=>{const n=t.icon;return a.jsx(MG,{children:a.jsx(ph,{to:e(t.url),className:({isActive:r})=>`flex w-full items-center gap-2 rounded-md font-medium transition-colors ${r?"bg-sidebar-active text-sidebar-active-foreground font-medium shadow-sm":""}`,children:({isActive:r})=>a.jsxs(vt,{delayDuration:500,children:[a.jsx(bt,{asChild:!0,children:a.jsxs(LG,{className:`${r?"hover:bg-transparent":""}`,children:[a.jsx(n,{className:"size-4 shrink-0 transition-all"}),a.jsx("span",{children:t.title}),t.badge&&a.jsx("span",{className:"bg-primary/20 text-primary ml-auto rounded-full px-2 py-0.5 text-xs",children:t.badge})]})}),a.jsx(St,{side:"right",children:t.title})]})})},t.title)})})}const QD=20,JD=20;function e5({vertical:e,horizontal:t}){if(window.Intercom)try{const n={};n.vertical_padding=e,n.horizontal_padding=t,Object.keys(n).length>0&&window.Intercom("update",n)}catch(n){console.warn("Failed to update Intercom padding",n)}}function PW(e){try{if(!window.Intercom)return;window.Intercom("update",{hide_default_launcher:!e})}catch(t){console.warn("Failed to toggle Intercom launcher visibility",t)}}function UW(e=30,t=0){e5({vertical:JD+e,horizontal:QD+t})}function db(){if(e5({vertical:JD,horizontal:QD}),PW(!1),window.__intercom_open_on_ready&&window.Intercom){try{window.Intercom("show")}catch(e){console.warn("Failed to show Intercom after boot",e)}window.__intercom_open_on_ready=!1}}function zW(){if(window.Intercom)try{window.Intercom("show")}catch(e){console.warn("Intercom show failed",e)}else window.__intercom_open_on_ready=!0}function FW(e){return[{type:"menu-item",title:"What´s new",icon:Cz,href:"https://docs.owox.com/docs/changelog/?utm_source=community_edition&utm_medium=organic&utm_campaign=support_menu_dropdown&utm_content=whats_new",visible:!0},{type:"separator"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=community_edition&utm_medium=organic&utm_campaign=support_menu_dropdown&utm_content=documentation",icon:Fr,visible:{flagKey:"MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE",expectedValue:"true"}},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=app_owox_com&utm_medium=organic&utm_campaign=support_menu_dropdown&utm_content=documentation",icon:Fr,visible:{flagKey:"MENU_DOCUMENTATION_OWOX_CLOUD_VISIBLE",expectedValue:"true"}},{type:"submenu",title:"Video tutorials",icon:JP,visible:!0,submenu:{options:[{label:"Getting Started with Data Marts",icon:_0,onClick:()=>{e("video-3-getting-started-with-data-marts")}},{label:"SQL to Google Sheets in Minutes",icon:_0,onClick:()=>{e("video-1-google-sheets")}},{label:"Looker Studio Setup",icon:_0,onClick:()=>{e("video-2-looker")}}]}},{type:"separator"},{type:"menu-item",title:"Slack Community",href:"https://join.slack.com/t/owox-data-marts/shared_invite/zt-3fffrsau9-UlobJVlXzRLpXmvs0ffvoQ",icon:kZ,visible:!0},{type:"menu-item",title:"Online Chat",icon:rz,onClick:()=>{zW()},visible:!0}]}function HW({isOpen:e}){return a.jsx(wr,{asChild:!0,children:a.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:[a.jsx("div",{className:"text-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white dark:bg-white/10",children:a.jsx(LA,{className:"text-muted-foreground",size:18,strokeWidth:1.5})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[a.jsx("span",{className:"truncate font-medium",children:"Help"}),a.jsx("span",{className:"text-muted-foreground hidden truncate text-xs",children:"Chat, Docs, Videos"})]}),a.jsx(Ss,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"-rotate-90":""}`})]})})}function $W({items:e,onClose:t}){return a.jsx(Er,{align:"end",side:"right",className:"w-56",children:e.map((n,r)=>{if(n.type==="separator")return a.jsx(la,{},`sep-${String(r)}`);const s=n.icon;if(n.type==="submenu"){const{submenu:i}=n;return a.jsxs(yy,{children:[a.jsxs(xy,{className:"flex items-center gap-2",children:[a.jsx(s,{className:"text-muted-foreground size-4"}),n.title]}),a.jsx(vy,{children:i.options.map((c,u)=>a.jsxs(Ct,{onClick:()=>{var f;(f=c.onClick)==null||f.call(c),t==null||t()},children:[c.icon&&a.jsx(c.icon,{className:"size-4"}),c.label]},`submenu-${n.title}-opt-${String(u)}`))})]},`submenu-${n.title}-${String(r)}`)}return a.jsx(Ct,{onClick:()=>{var i;(i=n.onClick)==null||i.call(n),t==null||t()},asChild:!!n.href,children:n.href?a.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(s,{className:"size-4"}),n.title]}):a.jsxs(a.Fragment,{children:[a.jsx(s,{className:"size-4"}),n.title]})},`item-${n.title}-${String(r)}`)})})}function VW(e){const{flags:t}=md();return{visibleItems:h.useMemo(()=>e.filter(r=>r.type==="separator"||r.type==="submenu"?!0:typeof r.visible=="boolean"?r.visible:ob(r.visible.flagKey,r.visible.expectedValue,t)),[e,t])}}const t5={activePopoverId:null,isOpen:!1},n5="contentPopovers/OPEN_POPOVER",r5="contentPopovers/CLOSE_POPOVER",a5="contentPopovers/TOGGLE_POPOVER";function GW(e){return{type:n5,payload:e}}function BW(e){return{type:r5,payload:e}}function qW(e){return{type:a5,payload:e}}function KW(e=t5,t){switch(t.type){case n5:return{activePopoverId:t.payload,isOpen:!0};case r5:{const n=t.payload;return e.activePopoverId!==n?e:{activePopoverId:null,isOpen:!1}}case a5:{const n=t.payload;return e.activePopoverId!==n?{activePopoverId:n,isOpen:!0}:{activePopoverId:n,isOpen:!e.isOpen}}default:return e}}function QS(){const e=rD(),t=eh(n=>n.contentPopovers);return{activePopoverId:t.activePopoverId,isOpen:t.isOpen,open:n=>{e(GW(n))},close:()=>{t.activePopoverId&&e(BW(t.activePopoverId))},toggle:n=>{e(qW(n))}}}function ZW(){const[e,t]=h.useState(!1),{open:n}=QS(),r=FW(n),{visibleItems:s}=VW(r);return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(Cr,{open:e,onOpenChange:t,children:[a.jsx(HW,{isOpen:e}),a.jsx($W,{items:s,onClose:()=>{t(!1)}})]})})})})}function YW({variant:e="inset",collapsible:t="icon"}){return a.jsxs(jG,{variant:e,collapsible:t,children:[a.jsx(AG,{children:a.jsx(yW,{})}),a.jsxs(OG,{children:[a.jsx($T,{children:a.jsx(VT,{children:a.jsx(MW,{})})}),a.jsx($T,{children:a.jsx(VT,{children:a.jsx(LW,{})})})]}),a.jsxs(DG,{children:[a.jsx(ZW,{}),a.jsx(mS,{}),a.jsx(DW,{})]}),a.jsx(_G,{})]})}function WW({children:e,...t}){return a.jsx(SW,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class bl{constructor(t){to(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await Ea.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await Ea.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await Ea.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await Ea.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await Ea.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class XW{set(t,n){try{const r=typeof n=="object"?JSON.stringify(n):String(n);localStorage.setItem(t,r)}catch(r){console.error(`Error setting localStorage key "${t}":`,r)}}get(t,n){try{const r=localStorage.getItem(t);if(r===null)return null;switch(n){case"boolean":return r==="true";case"json":{const s=JSON.parse(r);return typeof s=="object"?s:null}default:return r}}catch(r){return console.error(`Error getting localStorage key "${t}":`,r),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 ps=new XW;class QW{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const s=this.getTimezoneOffset(r,n),i=this.formatOffset(s),c=this.isDaylightSavingTime(r,n),u=this.getDisplayName(r,i);return{identifier:r,displayName:u,offsetMinutes:s,offsetString:i,isDST:c}})}getTimezoneOffset(t,n=new Date){try{const r=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}),s=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}),i=new Date(r.format(n)),c=new Date(s.format(n));return Math.round((c.getTime()-i.getTime())/(1e3*60))}catch(r){return console.warn(`Failed to get offset for timezone ${t}:`,r),0}}formatOffset(t){const n=t>=0?"+":"-",r=Math.abs(t),s=Math.floor(r/60),i=r%60;return`${n}${s.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}isDaylightSavingTime(t,n=new Date){try{const r=new Date(n.getFullYear(),0,1),s=new Date(n.getFullYear(),6,1),i=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,s),u=this.getTimezoneOffset(t,n),f=Math.min(i,c);return u>f}catch(r){return console.warn(`Failed to check DST for timezone ${t}:`,r),!1}}getDisplayName(t,n){return`${t} (${n})`}getBrowserTimezone(){const t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date,r=this.getTimezoneOffset(t,n),s=this.formatOffset(r),i=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,s);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:s,isDST:i}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const JW=new QW;function eX({isLoading:e,className:t}){const[n,r]=h.useState(0),[s,i]=h.useState(!1);return h.useEffect(()=>{let c,u;return e?(i(!0),r(0),c=setInterval(()=>{r(f=>f<90?f+(90-f)/10:f)},200)):(r(100),u=setTimeout(()=>{i(!1)},300)),()=>{clearInterval(c),clearTimeout(u)}},[e]),a.jsx("div",{className:se("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!s&&"opacity-0",t),children:a.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const s5=h.createContext({isLoading:!1});function tX({children:e}){const[t,n]=h.useState(0),r=t>0;return h.useEffect(()=>{const s=Ea.interceptors.request.use(c=>(c.skipLoadingIndicator||n(u=>u+1),c),c=>(c.config.skipLoadingIndicator||n(u=>Math.max(0,u-1)),Promise.reject(c))),i=Ea.interceptors.response.use(c=>(c.config.skipLoadingIndicator||n(u=>Math.max(0,u-1)),c),c=>(c.config.skipLoadingIndicator||n(u=>Math.max(0,u-1)),Promise.reject(c)));return()=>{Ea.interceptors.request.eject(s),Ea.interceptors.response.eject(i)}},[]),a.jsx(s5.Provider,{value:{isLoading:r},children:e})}function nX(){return h.useContext(s5)}function rX(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const aX=e=>{switch(e){case"success":return iX;case"info":return cX;case"warning":return lX;case"error":return uX;default:return null}},sX=Array(12).fill(0),oX=({visible:e,className:t})=>ae.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ae.createElement("div",{className:"sonner-spinner"},sX.map((n,r)=>ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),iX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),lX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),cX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),uX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),dX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),fX=()=>{const[e,t]=ae.useState(document.hidden);return ae.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let fb=1;class hX{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:fb++,c=this.toasts.find(f=>f.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),c?this.toasts=this.toasts.map(f=>f.id===i?(this.publish({...f,...t,id:i,title:r}),{...f,...t,id:i,dismissible:u,title:r}):f):this.addToast({title:r,...s,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,c;const u=s.then(async m=>{if(c=["resolve",m],ae.isValidElement(m))i=!1,this.create({id:r,type:"default",message:m});else if(pX(m)&&!m.ok){i=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,x=typeof n.description=="function"?await n.description(`HTTP error! status: ${m.status}`):n.description,C=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:x,...C})}else if(m instanceof Error){i=!1;const g=typeof n.error=="function"?await n.error(m):n.error,x=typeof n.description=="function"?await n.description(m):n.description,C=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:x,...C})}else if(n.success!==void 0){i=!1;const g=typeof n.success=="function"?await n.success(m):n.success,x=typeof n.description=="function"?await n.description(m):n.description,C=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:r,type:"success",description:x,...C})}}).catch(async m=>{if(c=["reject",m],n.error!==void 0){i=!1;const y=typeof n.error=="function"?await n.error(m):n.error,g=typeof n.description=="function"?await n.description(m):n.description,v=typeof y=="object"&&!ae.isValidElement(y)?y:{message:y};this.create({id:r,type:"error",description:g,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((m,y)=>u.then(()=>c[0]==="reject"?y(c[1]):m(c[1])).catch(y));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||fb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ca=new hX,mX=(e,t)=>{const n=(t==null?void 0:t.id)||fb++;return Ca.addToast({title:e,...t,id:n}),n},pX=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",gX=mX,yX=()=>Ca.toasts,xX=()=>Ca.getActiveToasts(),w_=Object.assign(gX,{success:Ca.success,info:Ca.info,warning:Ca.warning,error:Ca.error,custom:Ca.custom,message:Ca.message,promise:Ca.promise,dismiss:Ca.dismiss,loading:Ca.loading},{getHistory:yX,getToasts:xX});rX("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Cp(e){return e.label!==void 0}const vX=3,bX="24px",SX="16px",E_=4e3,CX=356,wX=14,EX=45,RX=200;function ro(...e){return e.filter(Boolean).join(" ")}function jX(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const TX=e=>{var t,n,r,s,i,c,u,f,m;const{invert:y,toast:g,unstyled:x,interacting:v,setHeights:C,visibleToasts:b,heights:w,index:R,toasts:j,expanded:_,removeToast:D,defaultRichColors:O,closeButton:A,style:T,cancelButtonStyle:I,actionButtonStyle:k,className:V="",descriptionClassName:U="",duration:K,position:G,gap:q,expandByDefault:H,classNames:M,icons:B,closeButtonAriaLabel:$="Close toast"}=e,[re,ge]=ae.useState(null),[P,z]=ae.useState(null),[F,Z]=ae.useState(!1),[Q,le]=ae.useState(!1),[J,ie]=ae.useState(!1),[ye,Ce]=ae.useState(!1),[He,Ee]=ae.useState(!1),[Ke,nt]=ae.useState(0),[Ft,Pt]=ae.useState(0),On=ae.useRef(g.duration||K||E_),yn=ae.useRef(null),ke=ae.useRef(null),Y=R===0,ne=R+1<=b,ce=g.type,Ie=g.dismissible!==!1,Re=g.className||"",Te=g.descriptionClassName||"",$e=ae.useMemo(()=>w.findIndex(We=>We.toastId===g.id)||0,[w,g.id]),mt=ae.useMemo(()=>{var We;return(We=g.closeButton)!=null?We:A},[g.closeButton,A]),st=ae.useMemo(()=>g.duration||K||E_,[g.duration,K]),Xt=ae.useRef(0),sr=ae.useRef(0),$n=ae.useRef(0),Or=ae.useRef(null),[Jr,fn]=G.split("-"),or=ae.useMemo(()=>w.reduce((We,Bt,Qt)=>Qt>=$e?We:We+Bt.height,0),[w,$e]),kn=fX(),Ws=g.invert||y,Aa=ce==="loading";sr.current=ae.useMemo(()=>$e*q+or,[$e,or]),ae.useEffect(()=>{On.current=st},[st]),ae.useEffect(()=>{Z(!0)},[]),ae.useEffect(()=>{const We=ke.current;if(We){const Bt=We.getBoundingClientRect().height;return Pt(Bt),C(Qt=>[{toastId:g.id,height:Bt,position:g.position},...Qt]),()=>C(Qt=>Qt.filter(qt=>qt.toastId!==g.id))}},[C,g.id]),ae.useLayoutEffect(()=>{if(!F)return;const We=ke.current,Bt=We.style.height;We.style.height="auto";const Qt=We.getBoundingClientRect().height;We.style.height=Bt,Pt(Qt),C(qt=>qt.find(en=>en.toastId===g.id)?qt.map(en=>en.toastId===g.id?{...en,height:Qt}:en):[{toastId:g.id,height:Qt,position:g.position},...qt])},[F,g.title,g.description,C,g.id,g.jsx,g.action,g.cancel]);const ea=ae.useCallback(()=>{le(!0),nt(sr.current),C(We=>We.filter(Bt=>Bt.toastId!==g.id)),setTimeout(()=>{D(g)},RX)},[g,D,C,sr]);ae.useEffect(()=>{if(g.promise&&ce==="loading"||g.duration===1/0||g.type==="loading")return;let We;return _||v||kn?(()=>{if($n.current<Xt.current){const qt=new Date().getTime()-Xt.current;On.current=On.current-qt}$n.current=new Date().getTime()})():(()=>{On.current!==1/0&&(Xt.current=new Date().getTime(),We=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),ea()},On.current))})(),()=>clearTimeout(We)},[_,v,g,ce,kn,ea]),ae.useEffect(()=>{g.delete&&(ea(),g.onDismiss==null||g.onDismiss.call(g,g))},[ea,g.delete]);function Da(){var We;if(B!=null&&B.loading){var Bt;return ae.createElement("div",{className:ro(M==null?void 0:M.loader,g==null||(Bt=g.classNames)==null?void 0:Bt.loader,"sonner-loader"),"data-visible":ce==="loading"},B.loading)}return ae.createElement(oX,{className:ro(M==null?void 0:M.loader,g==null||(We=g.classNames)==null?void 0:We.loader),visible:ce==="loading"})}const Es=g.icon||(B==null?void 0:B[ce])||aX(ce);var wn,In;return ae.createElement("li",{tabIndex:0,ref:ke,className:ro(V,Re,M==null?void 0:M.toast,g==null||(t=g.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[ce],g==null||(n=g.classNames)==null?void 0:n[ce]),"data-sonner-toast":"","data-rich-colors":(wn=g.richColors)!=null?wn:O,"data-styled":!(g.jsx||g.unstyled||x),"data-mounted":F,"data-promise":!!g.promise,"data-swiped":He,"data-removed":Q,"data-visible":ne,"data-y-position":Jr,"data-x-position":fn,"data-index":R,"data-front":Y,"data-swiping":J,"data-dismissible":Ie,"data-type":ce,"data-invert":Ws,"data-swipe-out":ye,"data-swipe-direction":P,"data-expanded":!!(_||H&&F),"data-testid":g.testId,style:{"--index":R,"--toasts-before":R,"--z-index":j.length-R,"--offset":`${Q?Ke:sr.current}px`,"--initial-height":H?"auto":`${Ft}px`,...T,...g.style},onDragEnd:()=>{ie(!1),ge(null),Or.current=null},onPointerDown:We=>{We.button!==2&&(Aa||!Ie||(yn.current=new Date,nt(sr.current),We.target.setPointerCapture(We.pointerId),We.target.tagName!=="BUTTON"&&(ie(!0),Or.current={x:We.clientX,y:We.clientY})))},onPointerUp:()=>{var We,Bt,Qt;if(ye||!Ie)return;Or.current=null;const qt=Number(((We=ke.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Vn=Number(((Bt=ke.current)==null?void 0:Bt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),en=new Date().getTime()-((Qt=yn.current)==null?void 0:Qt.getTime()),Jt=re==="x"?qt:Vn,Rr=Math.abs(Jt)/en;if(Math.abs(Jt)>=EX||Rr>.11){nt(sr.current),g.onDismiss==null||g.onDismiss.call(g,g),z(re==="x"?qt>0?"right":"left":Vn>0?"down":"up"),ea(),Ce(!0);return}else{var W,ee;(W=ke.current)==null||W.style.setProperty("--swipe-amount-x","0px"),(ee=ke.current)==null||ee.style.setProperty("--swipe-amount-y","0px")}Ee(!1),ie(!1),ge(null)},onPointerMove:We=>{var Bt,Qt,qt;if(!Or.current||!Ie||((Bt=window.getSelection())==null?void 0:Bt.toString().length)>0)return;const en=We.clientY-Or.current.y,Jt=We.clientX-Or.current.x;var Rr;const W=(Rr=e.swipeDirections)!=null?Rr:jX(G);!re&&(Math.abs(Jt)>1||Math.abs(en)>1)&&ge(Math.abs(Jt)>Math.abs(en)?"x":"y");let ee={x:0,y:0};const fe=Se=>1/(1.5+Math.abs(Se)/20);if(re==="y"){if(W.includes("top")||W.includes("bottom"))if(W.includes("top")&&en<0||W.includes("bottom")&&en>0)ee.y=en;else{const Se=en*fe(en);ee.y=Math.abs(Se)<Math.abs(en)?Se:en}}else if(re==="x"&&(W.includes("left")||W.includes("right")))if(W.includes("left")&&Jt<0||W.includes("right")&&Jt>0)ee.x=Jt;else{const Se=Jt*fe(Jt);ee.x=Math.abs(Se)<Math.abs(Jt)?Se:Jt}(Math.abs(ee.x)>0||Math.abs(ee.y)>0)&&Ee(!0),(Qt=ke.current)==null||Qt.style.setProperty("--swipe-amount-x",`${ee.x}px`),(qt=ke.current)==null||qt.style.setProperty("--swipe-amount-y",`${ee.y}px`)}},mt&&!g.jsx&&ce!=="loading"?ae.createElement("button",{"aria-label":$,"data-disabled":Aa,"data-close-button":!0,onClick:Aa||!Ie?()=>{}:()=>{ea(),g.onDismiss==null||g.onDismiss.call(g,g)},className:ro(M==null?void 0:M.closeButton,g==null||(r=g.classNames)==null?void 0:r.closeButton)},(In=B==null?void 0:B.close)!=null?In:dX):null,(ce||g.icon||g.promise)&&g.icon!==null&&((B==null?void 0:B[ce])!==null||g.icon)?ae.createElement("div",{"data-icon":"",className:ro(M==null?void 0:M.icon,g==null||(s=g.classNames)==null?void 0:s.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Da():null,g.type!=="loading"?Es:null):null,ae.createElement("div",{"data-content":"",className:ro(M==null?void 0:M.content,g==null||(i=g.classNames)==null?void 0:i.content)},ae.createElement("div",{"data-title":"",className:ro(M==null?void 0:M.title,g==null||(c=g.classNames)==null?void 0:c.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?ae.createElement("div",{"data-description":"",className:ro(U,Te,M==null?void 0:M.description,g==null||(u=g.classNames)==null?void 0:u.description)},typeof g.description=="function"?g.description():g.description):null),ae.isValidElement(g.cancel)?g.cancel:g.cancel&&Cp(g.cancel)?ae.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||I,onClick:We=>{Cp(g.cancel)&&Ie&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,We),ea())},className:ro(M==null?void 0:M.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,ae.isValidElement(g.action)?g.action:g.action&&Cp(g.action)?ae.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||k,onClick:We=>{Cp(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,We),!We.defaultPrevented&&ea())},className:ro(M==null?void 0:M.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function R_(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function _X(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,c=i?"--mobile-offset":"--offset",u=i?SX:bX;function f(m){["top","right","bottom","left"].forEach(y=>{n[`${c}-${y}`]=typeof m=="number"?`${m}px`:m})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(m=>{r[m]===void 0?n[`${c}-${m}`]=u:n[`${c}-${m}`]=typeof r[m]=="number"?`${r[m]}px`:r[m]}):f(u)}),n}const NX=ae.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:m,offset:y,mobileOffset:g,theme:x="light",richColors:v,duration:C,style:b,visibleToasts:w=vX,toastOptions:R,dir:j=R_(),gap:_=wX,icons:D,containerAriaLabel:O="Notifications"}=t,[A,T]=ae.useState([]),I=ae.useMemo(()=>r?A.filter(F=>F.toasterId===r):A.filter(F=>!F.toasterId),[A,r]),k=ae.useMemo(()=>Array.from(new Set([i].concat(I.filter(F=>F.position).map(F=>F.position)))),[I,i]),[V,U]=ae.useState([]),[K,G]=ae.useState(!1),[q,H]=ae.useState(!1),[M,B]=ae.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ae.useRef(null),re=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ge=ae.useRef(null),P=ae.useRef(!1),z=ae.useCallback(F=>{T(Z=>{var Q;return(Q=Z.find(le=>le.id===F.id))!=null&&Q.delete||Ca.dismiss(F.id),Z.filter(({id:le})=>le!==F.id)})},[]);return ae.useEffect(()=>Ca.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{T(Z=>Z.map(Q=>Q.id===F.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{TA.flushSync(()=>{T(Z=>{const Q=Z.findIndex(le=>le.id===F.id);return Q!==-1?[...Z.slice(0,Q),{...Z[Q],...F},...Z.slice(Q+1)]:[F,...Z]})})})}),[A]),ae.useEffect(()=>{if(x!=="system"){B(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:Z})=>{B(Z?"dark":"light")})}catch{F.addListener(({matches:Q})=>{try{B(Q?"dark":"light")}catch(le){console.error(le)}})}},[x]),ae.useEffect(()=>{A.length<=1&&G(!1)},[A]),ae.useEffect(()=>{const F=Z=>{var Q;if(c.every(ie=>Z[ie]||Z.code===ie)){var J;G(!0),(J=$.current)==null||J.focus()}Z.code==="Escape"&&(document.activeElement===$.current||(Q=$.current)!=null&&Q.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[c]),ae.useEffect(()=>{if($.current)return()=>{ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null,P.current=!1)}},[$.current]),ae.createElement("section",{ref:n,"aria-label":`${O} ${re}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((F,Z)=>{var Q;const[le,J]=F.split("-");return I.length?ae.createElement("ol",{key:F,dir:j==="auto"?R_():j,tabIndex:-1,ref:$,className:m,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":le,"data-x-position":J,style:{"--front-toast-height":`${((Q=V[0])==null?void 0:Q.height)||0}px`,"--width":`${CX}px`,"--gap":`${_}px`,...b,..._X(y,g)},onBlur:ie=>{P.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(P.current=!1,ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||P.current||(P.current=!0,ge.current=ie.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{q||G(!1)},onDragEnd:()=>G(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},I.filter(ie=>!ie.position&&Z===0||ie.position===F).map((ie,ye)=>{var Ce,He;return ae.createElement(TX,{key:ie.id,icons:D,index:ye,toast:ie,defaultRichColors:v,duration:(Ce=R==null?void 0:R.duration)!=null?Ce:C,className:R==null?void 0:R.className,descriptionClassName:R==null?void 0:R.descriptionClassName,invert:s,visibleToasts:w,closeButton:(He=R==null?void 0:R.closeButton)!=null?He:f,interacting:q,position:F,style:R==null?void 0:R.style,unstyled:R==null?void 0:R.unstyled,classNames:R==null?void 0:R.classNames,cancelButtonStyle:R==null?void 0:R.cancelButtonStyle,actionButtonStyle:R==null?void 0:R.actionButtonStyle,closeButtonAriaLabel:R==null?void 0:R.closeButtonAriaLabel,removeToast:z,toasts:I.filter(Ee=>Ee.position==ie.position),heights:V.filter(Ee=>Ee.position==ie.position),setHeights:U,expandByDefault:u,gap:_,expanded:K,swipeDirections:t.swipeDirections})})):null}))}),AX=({...e})=>{const{theme:t="system"}=Ph();return a.jsx(NX,{theme:t,className:"toaster group",icons:{success:a.jsx(xh,{className:"size-4"}),info:a.jsx(Fr,{className:"size-4"}),warning:a.jsx(vh,{className:"size-4"}),error:a.jsx(zA,{className:"size-4"}),loading:a.jsx(Rc,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})};function DX(){return a.jsx(fW,{position:"top-center",toastOptions:{duration:3e3,style:{borderRadius:"32px",boxShadow:"none",padding:"0.4rem 1rem",maxWidth:"800px",fontSize:"0.875rem",borderBottomWidth:"1px",borderBottomStyle:"solid"},success:{style:{background:"#ECFDF5",color:"#166534",borderBottomColor:"#D6DFE6"}},error:{style:{background:"#FEE2E2",color:"#991B1B",borderBottomColor:"#EAD1D1"},duration:6e3},loading:{style:{background:"#E8EDFB",color:"#1D4ED8",borderBottomColor:"#CAD5F6",borderBottomWidth:"1px",borderBottomStyle:"solid"}}}})}function OX({children:e}){const{isLoading:t}=AD(),n=bZ(),r=Wg(),s=Bs();return h.useEffect(()=>{if(t)return;const i=r.projectId,c=n==null?void 0:n.projectId;if(i&&!s.pathname.startsWith("/auth")&&n&&c&&c!==i){const u=new URLSearchParams({projectId:i}).toString();window.location.href=`/auth/sign-in?${u}`}},[t,n,r.projectId,s.pathname]),a.jsx(a.Fragment,{children:e})}const j_="sidebar_state";function IX(){const{state:e,isMobile:t}=jh(),r=t||e==="collapsed",{isLoading:s}=nX();return a.jsxs(a.Fragment,{children:[a.jsx(AX,{position:"bottom-right",closeButton:!0}),a.jsx(DX,{}),a.jsx(eX,{isLoading:s}),a.jsxs(SZ,{redirectTo:"/auth/sign-in",children:[a.jsx(YW,{variant:"inset",collapsible:"icon"}),a.jsxs(NG,{children:[r&&a.jsx(TG,{}),a.jsx(OX,{children:a.jsx(rS,{})})]})]})]})}function MX(){const[e,t]=h.useState(()=>ps.get(j_,"boolean")??!0),n=r=>{t(r),ps.set(j_,r)};return a.jsx(WW,{children:a.jsx(tX,{children:a.jsx(RG,{open:e,onOpenChange:n,children:a.jsx(IX,{})})})})}function kX(){return a.jsxs("div",{className:"app-container",children:[a.jsx("h1",{children:"About OWOX"}),a.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function T_(){return a.jsxs("div",{className:"dm-empty-state-404page",children:[a.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[a.jsx(qz,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),a.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",a.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",a.jsx("i",{children:"yesterday"}),".",a.jsx("br",{}),"Escape while you can!"]}),a.jsx(we,{variant:"default",asChild:!0,children:a.jsxs(Wr,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",a.jsx(_a,{className:"h-4 w-4"})]})})]}),a.jsx("div",{className:"dm-empty-state-404page-background"})]})}const LX={items:[],loading:!1,error:null};function PX(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 o5=h.createContext(void 0);function UX({children:e}){const[t,n]=h.useReducer(PX,LX);return a.jsx(o5.Provider,{value:{state:t,dispatch:n},children:e})}function zX(){const e=h.useContext(o5);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class FX extends bl{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,{timeout:18e4})}async publishDataMart(t){return this.put(`/${t}/publish`,void 0,{timeout:18e4})}async runDataMart(t,n){return this.post(`/${t}/manual-run`,{payload:n})}async cancelDataMartRun(t,n){await this.post(`/${t}/runs/${n}/cancel`)}async actualizeDataMartSchema(t){return this.post(`/${t}/actualize-schema`,void 0,{timeout:18e4})}async updateDataMartSchema(t,n){return this.put(`/${t}/schema`,n,{timeout:18e4})}async createSqlDryRunTrigger(t,n){return this.post(`/${t}/sql-dry-run-triggers`,{sql:n},{skipLoadingIndicator:!0})}async getSqlDryRunTriggerStatus(t,n){return(await this.get(`/${t}/sql-dry-run-triggers/${n}/status`,void 0,{skipLoadingIndicator:!0})).status}async getSqlDryRunTriggerResponse(t,n){return this.get(`/${t}/sql-dry-run-triggers/${n}`,void 0,{skipLoadingIndicator:!0})}async abortSqlDryRunTrigger(t,n){await this.delete(`/${t}/sql-dry-run-triggers/${n}`,{skipLoadingIndicator:!0})}async createSchemaActualizeTrigger(t){return this.post(`/${t}/schema-actualize-triggers`,void 0,{skipLoadingIndicator:!0})}async getSchemaActualizeTriggerStatus(t,n){return(await this.get(`/${t}/schema-actualize-triggers/${n}/status`,void 0,{skipLoadingIndicator:!0})).status}async getSchemaActualizeTriggerResponse(t,n){return this.get(`/${t}/schema-actualize-triggers/${n}`,void 0,{skipLoadingIndicator:!0})}async abortSchemaActualizeTrigger(t,n){await this.delete(`/${t}/schema-actualize-triggers/${n}`,{skipLoadingIndicator:!0})}async getDataMartRuns(t,n=5,r=0,s){return await this.get(`/${t}/runs`,{limit:n,offset:r},s)}async getDataMartRunById(t,n,r){return this.get(`/${t}/runs/${n}`,void 0,r)}async getDataMartsByConnectorName(t){return this.get(`/by-connector/${t}`)}}const Tn=new FX;var Ar=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(Ar||{}),Ve=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(Ve||{}),Yp=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(Yp||{});const HX={ALREADY_PUBLISHED:"Data mart is already published",INVALID_STORAGE:"Data mart must have a valid storage",MISSING_DEFINITION:"Data Mart must have an input source configured"};var i5=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(i5||{}),Ur=(e=>(e.CONNECTOR="CONNECTOR",e.GOOGLE_SHEETS_EXPORT="GOOGLE_SHEETS_EXPORT",e.LOOKER_STUDIO="LOOKER_STUDIO",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e.INSIGHT="INSIGHT",e))(Ur||{}),qn=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(qn||{});const l5={statuses:{[Ar.DRAFT]:{code:Ar.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[Ar.PUBLISHED]:{code:Ar.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},c5=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,u5=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,$X=e=>e?c5(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",VX=e=>e?u5(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",d5=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)},f5=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)},GX=e=>e?d5(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",BX=e=>e?f5(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required";var Ps=(e=>(e.PASSWORD="PASSWORD",e.KEY_PAIR="KEY_PAIR",e))(Ps||{});const qX=[{value:"US",label:"US (multiple regions)",group:"North America"},{value:"northamerica-northeast1",label:"northamerica-northeast1 (Montréal)",group:"North America"},{value:"northamerica-northeast2",label:"northamerica-northeast2 (Toronto)",group:"North America"},{value:"us-central1",label:"us-central1 (Iowa)",group:"North America"},{value:"us-east1",label:"us-east1 (South Carolina)",group:"North America"},{value:"us-east4",label:"us-east4 (Northern Virginia)",group:"North America"},{value:"us-east5",label:"us-east5 (Columbus)",group:"North America"},{value:"us-west1",label:"us-west1 (Oregon)",group:"North America"},{value:"us-west2",label:"us-west2 (Los Angeles)",group:"North America"},{value:"us-west3",label:"us-west3 (Salt Lake City)",group:"North America"},{value:"us-west4",label:"us-west4 (Las Vegas)",group:"North America"},{value:"EU",label:"EU (multiple regions)",group:"Europe"},{value:"europe-central2",label:"europe-central2 (Warsaw)",group:"Europe"},{value:"europe-north1",label:"europe-north1 (Finland)",group:"Europe"},{value:"europe-southwest1",label:"europe-southwest1 (Madrid)",group:"Europe"},{value:"europe-west1",label:"europe-west1 (Belgium)",group:"Europe"},{value:"europe-west2",label:"europe-west2 (London)",group:"Europe"},{value:"europe-west3",label:"europe-west3 (Frankfurt)",group:"Europe"},{value:"europe-west4",label:"europe-west4 (Netherlands)",group:"Europe"},{value:"europe-west6",label:"europe-west6 (Zurich)",group:"Europe"},{value:"europe-west8",label:"europe-west8 (Milan)",group:"Europe"},{value:"europe-west9",label:"europe-west9 (Paris)",group:"Europe"},{value:"europe-west12",label:"europe-west12 (Turin)",group:"Europe"},{value:"asia-east1",label:"asia-east1 (Taiwan)",group:"Asia Pacific"},{value:"asia-east2",label:"asia-east2 (Hong Kong)",group:"Asia Pacific"},{value:"asia-northeast1",label:"asia-northeast1 (Tokyo)",group:"Asia Pacific"},{value:"asia-northeast2",label:"asia-northeast2 (Osaka)",group:"Asia Pacific"},{value:"asia-northeast3",label:"asia-northeast3 (Seoul)",group:"Asia Pacific"},{value:"asia-south1",label:"asia-south1 (Mumbai)",group:"Asia Pacific"},{value:"asia-south2",label:"asia-south2 (Delhi)",group:"Asia Pacific"},{value:"asia-southeast1",label:"asia-southeast1 (Singapore)",group:"Asia Pacific"},{value:"asia-southeast2",label:"asia-southeast2 (Jakarta)",group:"Asia Pacific"},{value:"australia-southeast1",label:"australia-southeast1 (Sydney)",group:"Asia Pacific"},{value:"australia-southeast2",label:"australia-southeast2 (Melbourne)",group:"Asia Pacific"},{value:"southamerica-east1",label:"southamerica-east1 (São Paulo)",group:"Other"},{value:"southamerica-west1",label:"southamerica-west1 (Santiago)",group:"Other"},{value:"me-central1",label:"me-central1 (Doha)",group:"Other"},{value:"me-central2",label:"me-central2 (Dammam)",group:"Other"},{value:"me-west1",label:"me-west1 (Tel Aviv)",group:"Other"},{value:"africa-south1",label:"africa-south1 (Johannesburg)",group:"Other"}];function KX(e){return"projectId"in e}function ZX(e){return"outputBucket"in e}var je=(e=>(e.GOOGLE_BIGQUERY="GOOGLE_BIGQUERY",e.AWS_ATHENA="AWS_ATHENA",e.SNOWFLAKE="SNOWFLAKE",e.DATABRICKS="DATABRICKS",e.AWS_REDSHIFT="AWS_REDSHIFT",e.AZURE_SYNAPSE="AZURE_SYNAPSE",e))(je||{}),Qo=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(Qo||{});const YX=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,s=r==="";return a.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[a.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!s?a.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):a.jsx("span",{className:"text-sm",children:s||r===void 0?a.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},WX=({type:e,config:t})=>{const n={[je.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[je.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[je.SNOWFLAKE]:[],[je.DATABRICKS]:[],[je.AWS_REDSHIFT]:[],[je.AZURE_SYNAPSE]:[]},r=t&&(e===je.GOOGLE_BIGQUERY&&KX(t)||e===je.AWS_ATHENA&&ZX(t));return a.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:i})=>{let c;return r&&(c=(e===je.GOOGLE_BIGQUERY,t[i])),a.jsx(YX,{label:s,value:c},i)})})},XX=({type:e,config:t})=>a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),a.jsx(WX,{type:e,config:t})]})}),QX=Ec("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 Nr({className:e,variant:t,asChild:n=!1,...r}){const s=n?gh:"span";return a.jsx(s,{"data-slot":"badge",className:se(QX({variant:t}),e),...r})}function h5(e){return e.type===je.GOOGLE_BIGQUERY}function m5(e){return e.type===je.AWS_ATHENA}function p5(e){return e.type===je.SNOWFLAKE}const Sl={types:{[je.GOOGLE_BIGQUERY]:{type:je.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:ID,status:Qo.ACTIVE},[je.AWS_ATHENA]:{type:je.AWS_ATHENA,displayName:"AWS Athena",icon:MD,status:Qo.ACTIVE},[je.SNOWFLAKE]:{type:je.SNOWFLAKE,displayName:"Snowflake",icon:kD,status:Qo.ACTIVE},[je.DATABRICKS]:{type:je.DATABRICKS,displayName:"Databricks",icon:AZ,status:Qo.COMING_SOON},[je.AWS_REDSHIFT]:{type:je.AWS_REDSHIFT,displayName:"AWS Redshift",icon:DZ,status:Qo.COMING_SOON},[je.AZURE_SYNAPSE]:{type:je.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:OZ,status:Qo.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function JX({dataStorage:e,isLoading:t=!1}){if(t)return a.jsx("div",{className:"space-y-4",children:a.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,u)=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(zr,{className:"h-5 w-24"}),a.jsx(zr,{className:"h-6 w-40"})]},u))})});if(!e)return a.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:s,modifiedAt:i}=e;return a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{children:e.title}),a.jsx(Nr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:u}=Sl.getInfo(n);return a.jsxs(a.Fragment,{children:[a.jsx(u,{}),c]})})()})]}),a.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:a.jsx(XX,{type:n,config:r})}),a.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[a.jsxs("div",{children:[a.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(s))]}),a.jsxs("div",{children:[a.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(i))]})]})]})})}function eQ(e){const t=e.split(".");return t.length===2?{dataset:t[0],table:t[1]}:t.length===3?{dataset:t[0],schema:t[1],table:t[2]}:(console.error("Invalid fully qualified name format:",e),null)}function tQ(e,t,n){const r=encodeURIComponent(e),s=encodeURIComponent(t),i=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${s}!3s${i}`}function nQ(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function rQ(e){return`https://${e}.snowflakecomputing.com/`}function aQ(e,t){const n=eQ(t);if(!n)return null;const{dataset:r,table:s}=n;return h5(e)?tQ(e.config.projectId,r,s):m5(e)?nQ(e.config.region):p5(e)?rQ(e.config.account):null}function sQ(e,t){const n=aQ(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function oQ(e){return h5(e)?"Open table in Google BigQuery":m5(e)?"Open region in AWS Athena":p5(e)?"Open console in Snowflake":"Open data in storage"}function g5(e){switch(e.type){case je.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case je.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);case je.SNOWFLAKE:return!!(e.config.account&&e.config.warehouse);default:return!1}}const iQ=an({accessKeyId:Dt().min(1,"Access Key ID is required"),secretAccessKey:Dt().min(1,"Secret Access Key is required")}),lQ=an({authMethod:Gr(Ps.PASSWORD),username:Dt().min(1,"Username is required"),password:Dt().min(1,"Password is required")}),cQ=an({authMethod:Gr(Ps.KEY_PAIR),username:Dt().min(1,"Username is required"),privateKey:Dt().min(1,"Private Key is required"),privateKeyPassphrase:Dt().optional()}),uQ=YS("authMethod",[lQ,cQ]),dQ=an({projectId:Dt().min(1,"Project ID is required"),location:Dt().min(1,"Location is required")}),fQ=an({region:Dt().min(1,"Region is required"),outputBucket:Dt().min(1,"Output Bucket is required")}),hQ=an({account:Dt().min(1,"Account is required"),warehouse:Dt().min(1,"Warehouse is required")}),JS=an({title:Dt().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),mQ=JS.extend({type:Gr(je.GOOGLE_BIGQUERY),credentials:HD,config:dQ}),pQ=JS.extend({type:Gr(je.AWS_ATHENA),credentials:iQ,config:fQ}),gQ=JS.extend({type:Gr(je.SNOWFLAKE),credentials:uQ,config:hQ}),yQ=YS("type",[mQ,pQ,gQ]),y5=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${t}$`).test(e)},x5=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")',n='(?:[a-zA-Z0-9_$*]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${n}$`).test(e)},xQ=e=>e?y5(e)?"":"Invalid format. Expected: database.schema.object":"Fully qualified name is required",vQ=e=>e?x5(e)?"":"Invalid format. Expected: database.schema.table_* (with wildcards)":"Table pattern is required",bQ=(e,t)=>{if(!e)return!1;switch(t){case je.GOOGLE_BIGQUERY:return c5(e);case je.AWS_ATHENA:return d5(e);case je.SNOWFLAKE:return y5(e);default:return!1}},SQ=(e,t)=>{if(!e)return!1;switch(t){case je.GOOGLE_BIGQUERY:return u5(e);case je.AWS_ATHENA:return f5(e);case je.SNOWFLAKE:return x5(e);default:return!1}},CQ=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case je.GOOGLE_BIGQUERY:return $X(e);case je.AWS_ATHENA:return GX(e);case je.SNOWFLAKE:return xQ(e);default:return"Unsupported storage type"}},wQ=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case je.GOOGLE_BIGQUERY:return VX(e);case je.AWS_ATHENA:return BX(e);case je.SNOWFLAKE:return vQ(e);default:return"Unsupported storage type"}},v5=e=>{switch(e){case je.GOOGLE_BIGQUERY:return"project.dataset.table";case je.AWS_ATHENA:return"database.table or catalog.database.table";case je.SNOWFLAKE:return"database.schema.table";default:return""}},EQ=e=>{switch(e){case je.GOOGLE_BIGQUERY:return"project.dataset.table_*";case je.AWS_ATHENA:return"database.table_* or catalog.database.table_*";case je.SNOWFLAKE:return"database.schema.table_*";default:return""}},b5=e=>{switch(e){case je.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case je.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";case je.SNOWFLAKE:return"Enter the fully qualified name of the table (e.g., database.schema.table)";default:return""}},RQ=e=>{switch(e){case je.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case je.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';case je.SNOWFLAKE:return'Enter a pattern to match multiple tables (e.g., database.schema.table_* will match all tables starting with "table_")';default:return""}};var Jn=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(Jn||{});const jQ={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:""},TQ=e=>jQ[e],_Q={[Jn.SUCCESS]:{icon:xh,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"}},[Jn.ERROR]:{icon:zA,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"}},[Jn.WARNING]:{icon:vh,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"}},[Jn.INFO]:{icon:Fr,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"}},[Jn.NEUTRAL]:{icon:Fr,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 Uh({type:e=Jn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:i,colors:c}=_Q[e],u=f=>{const m="inline-flex items-center gap-1 text-sm",y=TQ(f),g=c[f];return se(m,y,g,s)};return a.jsxs("span",{className:u(t),children:[n&&a.jsx(i,{className:"h-4 w-4","data-testid":"icon"}),r]})}const S5=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,NQ=/[#&]gid=([0-9]+)/;function C5(e){return S5.test(e)}function AQ(e){const t=S5.exec(e);return t?t[2]:""}function DQ(e){const t=NQ.exec(e);return t?t[1]:"0"}function OQ(e){return{spreadsheetId:AQ(e),sheetId:parseInt(DQ(e),10)}}function e2(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function IQ(e,t,n){try{const r=JSON.parse(e);return t in r?r[t]:n}catch(r){return console.error(`Error parsing service account JSON: ${String(r)}`),n}}function Z0(e){return IQ(e,"client_email")}const w5=h.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_DESTINATIONS_START="FETCH_DESTINATIONS_START",e.FETCH_DESTINATIONS_SUCCESS="FETCH_DESTINATIONS_SUCCESS",e.FETCH_DESTINATIONS_ERROR="FETCH_DESTINATIONS_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||{}),Dr=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e.EMAIL_CONFIG="email-config",e))(Dr||{}),Mn=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(Mn||{}),Nn=(e=>(e.EDIT="edit",e.CREATE="create",e))(Nn||{});const MQ={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function kQ(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_DESTINATIONS_SUCCESS:return{...e,destinations: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.FETCH_DESTINATIONS_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(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==Mn.RUNNING||(n==null?void 0:n.lastRunStatus)!==Mn.RUNNING?{...e,reports:e.reports.map(r=>r.id===t.payload.id?{...r,lastRunStatus:t.payload.lastRunStatus}:r),polledReportIds:e.polledReportIds.filter(r=>r!==t.payload.id)}:e}default:return e}}function t2({children:e}){const[t,n]=h.useReducer(kQ,MQ);return a.jsx(w5.Provider,{value:{state:t,dispatch:n},children:e})}function LQ(){const e=h.useContext(w5);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class PQ extends bl{constructor(){super("/reports")}async createReport(t){return this.post("",t)}async getReportById(t){return this.get(`/${t}`)}async getReportsByDataMartId(t,n){return this.get(`/data-mart/${t}`,void 0,n)}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 Wo=new PQ,UQ={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class zQ{constructor(){to(this,"pollingTimers",new Map);to(this,"pollCounters",new Map);to(this,"config",UQ)}setConfig(t){this.config={...this.config,...t}}startPolling(t,n){this.stopPolling(t),this.pollCounters.set(t,0);const r=async()=>{try{const s=this.pollCounters.get(t)??0;this.pollCounters.set(t,s+1);const i=await Wo.getReportById(t);if(n(i),i.lastRunStatus!==Mn.RUNNING){this.stopPolling(t);return}const u=s<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,f=setTimeout(()=>{r()},u);this.pollingTimers.set(t,f)}catch(s){console.error(`Error polling report status for ${t}:`,s),this.stopPolling(t)}};return r(),()=>{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 wp=new zQ;var Oe=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e))(Oe||{}),As=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e.CLOUD_ONLY="Cloud only",e))(As||{}),go=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e.EMAIL_CREDENTIALS="email-credentials",e))(go||{});class FQ extends bl{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}`)}async rotateSecretKey(t){return this.post(`/${t}/rotate-secret-key`)}}const Jl=new FQ,aa={types:{[Oe.GOOGLE_SHEETS]:{type:Oe.GOOGLE_SHEETS,displayName:"Google Sheets",icon:TZ,status:As.ACTIVE},[Oe.LOOKER_STUDIO]:{type:Oe.LOOKER_STUDIO,displayName:"Looker Studio",icon:_Z,status:As.ACTIVE},[Oe.EMAIL]:{type:Oe.EMAIL,displayName:"Email",icon:VZ,status:As.CLOUD_ONLY},[Oe.SLACK]:{type:Oe.SLACK,displayName:"Slack",icon:MZ,status:As.CLOUD_ONLY},[Oe.MS_TEAMS]:{type:Oe.MS_TEAMS,displayName:"Microsoft Teams",icon:HZ,status:As.CLOUD_ONLY},[Oe.GOOGLE_CHAT]:{type:Oe.GOOGLE_CHAT,displayName:"Google Chat",icon:$Z,status:As.CLOUD_ONLY},[Oe.ODATA]:{type:Oe.ODATA,displayName:"OData",icon:NZ,status:As.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},HQ=an({deploymentUrl:Dt().optional(),destinationId:Dt().optional(),destinationSecretKey:Dt().optional()}),$Q=an({to:sb(Dt().email()).min(1)}),n2=an({title:Dt().min(1,"Title is required"),type:Ry(Oe)}),VQ=n2.extend({type:Gr(Oe.GOOGLE_SHEETS),credentials:HD}),GQ=n2.extend({type:Gr(Oe.LOOKER_STUDIO),credentials:HQ.optional()}),_y=n2.extend({credentials:$Q.optional()}),BQ=_y.extend({type:Gr(Oe.EMAIL)}),qQ=_y.extend({type:Gr(Oe.SLACK)}),KQ=_y.extend({type:Gr(Oe.MS_TEAMS)}),ZQ=_y.extend({type:Gr(Oe.GOOGLE_CHAT)}),YQ=YS("type",[VQ,GQ,BQ,qQ,KQ,ZQ]),E5=h.createContext(void 0);var tn=(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))(tn||{});const WQ={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function XQ(e,t){switch(t.type){case tn.FETCH_DESTINATIONS_START:case tn.FETCH_DESTINATION_START:case tn.CREATE_DESTINATION_START:case tn.UPDATE_DESTINATION_START:case tn.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case tn.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case tn.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case tn.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case tn.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 tn.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case tn.FETCH_DESTINATIONS_ERROR:case tn.FETCH_DESTINATION_ERROR:case tn.CREATE_DESTINATION_ERROR:case tn.UPDATE_DESTINATION_ERROR:case tn.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case tn.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case tn.CLEAR_ERROR:return{...e,error:null};default:return e}}function zh({children:e}){const[t,n]=h.useReducer(XQ,WQ);return a.jsx(E5.Provider,{value:{state:t,dispatch:n},children:e})}function QQ(){const e=h.useContext(E5);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class Ep{constructor(t){this.type=t}mapFromDto(t){const n=this.extractCredentials(t.credentials);return{id:t.id,title:t.title,type:this.type,projectId:t.projectId,credentials:n,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t,r={title:n.title??""};if(n.credentials!==void 0){const s=n.credentials.to;r.credentials={type:go.EMAIL_CREDENTIALS,to:s}}return r}mapToCreateRequest(t){const n=t,r=n.credentials.to;return{title:n.title,type:this.type,credentials:{type:go.EMAIL_CREDENTIALS,to:r}}}extractCredentials(t){return t.type===go.EMAIL_CREDENTIALS?{to:t.to}:{to:[]}}}class JQ{mapFromDto(t){let n="";try{t.credentials.type===go.GOOGLE_SHEETS_CREDENTIALS&&(n=JSON.stringify(t.credentials.serviceAccountKey,null,2))}catch(r){console.error(r,"Error parsing service account key")}return{id:t.id,title:t.title,type:Oe.GOOGLE_SHEETS,projectId:t.projectId,credentials:{serviceAccount:n},createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t,r={title:n.title??""};return n.credentials&&(r.credentials={serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:go.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:Oe.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:go.GOOGLE_SHEETS_CREDENTIALS}}}}class eJ{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:Oe.LOOKER_STUDIO,projectId:t.projectId,credentials:n,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){return{title:t.title??"",credentials:{type:go.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:Oe.LOOKER_STUDIO,credentials:{type:go.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===go.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const R5={getMapper(e){switch(e){case Oe.GOOGLE_SHEETS:return new JQ;case Oe.LOOKER_STUDIO:return new eJ;case Oe.EMAIL:return new Ep(Oe.EMAIL);case Oe.SLACK:return new Ep(Oe.SLACK);case Oe.MS_TEAMS:return new Ep(Oe.MS_TEAMS);case Oe.GOOGLE_CHAT:return new Ep(Oe.GOOGLE_CHAT);default:throw new Error(`Unknown destination type: ${e}`)}}};function _u(e){return R5.getMapper(e.type).mapFromDto(e)}function Fh(){const{state:e,dispatch:t}=QQ(),n=h.useCallback(async()=>{t({type:tn.FETCH_DESTINATIONS_START});try{const y=(await Jl.getDataDestinations()).map(_u);t({type:tn.FETCH_DESTINATIONS_SUCCESS,payload:y})}catch(m){const y=m instanceof Error?m.message:"Failed to load destinations";t({type:tn.FETCH_DESTINATIONS_ERROR,payload:y}),De({event:"data_destination_error",category:"DataDestination",action:"ListError",error:y})}},[t]),r=h.useCallback(async m=>{try{const y=await Jl.getDataDestinationById(m),g=_u(y);t({type:tn.FETCH_DESTINATION_SUCCESS,payload:g})}catch(y){const g=y instanceof Error?y.message:"Failed to load destination";t({type:tn.FETCH_DESTINATION_ERROR,payload:g}),De({event:"data_destination_error",category:"DataDestination",action:"GetError",error:g})}},[t]),s=h.useCallback(async m=>{t({type:tn.CREATE_DESTINATION_START});try{const y=await Jl.createDataDestination(m),g=_u(y);return t({type:tn.CREATE_DESTINATION_SUCCESS,payload:g}),De({event:"data_destination_created",category:"DataDestination",action:"Create",label:g.type}),_t.success("Destination created"),g}catch(y){const g=y instanceof Error?y.message:"Failed to create destination";return t({type:tn.CREATE_DESTINATION_ERROR,payload:g}),De({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:m.type,error:g}),null}},[t]),i=h.useCallback(async(m,y)=>{t({type:tn.UPDATE_DESTINATION_START});try{const g=await Jl.updateDataDestination(m,y),x=_u(g);return t({type:tn.UPDATE_DESTINATION_SUCCESS,payload:x}),De({event:"data_destination_updated",category:"DataDestination",action:"Update",label:x.type}),_t.success("Destination updated"),x}catch(g){const x=g instanceof Error?g.message:"Failed to update destination";return t({type:tn.UPDATE_DESTINATION_ERROR,payload:x}),De({event:"data_destination_error",category:"DataDestination",action:"UpdateError",error:x}),null}},[t]),c=h.useCallback(async m=>{t({type:tn.DELETE_DESTINATION_START});try{await Jl.deleteDataDestination(m),t({type:tn.DELETE_DESTINATION_SUCCESS,payload:m}),De({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),_t.success("Destination deleted")}catch(y){const g=y instanceof Error?y.message:"Failed to delete destination";throw t({type:tn.DELETE_DESTINATION_ERROR,payload:g}),De({event:"data_destination_error",category:"DataDestination",action:"DeleteError",error:g}),y}},[t]),u=h.useCallback(()=>{t({type:tn.CLEAR_CURRENT_DESTINATION})},[t]),f=h.useCallback(async m=>{try{const y=await Jl.rotateSecretKey(m),g=_u(y);return De({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:g.type}),g}catch(y){const g=y instanceof Error?y.message:"Failed to rotate secret key";throw De({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",error:g}),console.error("Failed to rotate secret key:",y),y}},[]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:r,createDataDestination:s,updateDataDestination:i,deleteDataDestination:c,clearCurrentDataDestination:u,rotateSecretKey:f}}function tJ(e){const t=aa.getInfo(e.type),n=t.status!==As.COMING_SOON;return{destinationInfo:t,isVisible:n}}function nJ(){const{dataMart:e}=bs(),{fetchReportsByDataMartId:t}=ts(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=Fh(),[i,c]=h.useState(!0);return h.useEffect(()=>{if(!e)return;(async()=>{c(!0);try{await Promise.all([r(),t(e.id)])}catch(m){console.error("Failed to fetch Data Mart destinations or reports:",m)}finally{c(!1)}})()},[e,r,t]),{dataDestinations:n,isLoading:i||s}}function r2(e){return JSON.stringify(e,null,2)}class rJ{mapFromDto(t){if(t.type!==Dr.EMAIL_CONFIG)throw new Error("Invalid destination config type");return{type:Dr.EMAIL_CONFIG,reportCondition:t.reportCondition,subject:t.subject,messageTemplate:t.messageTemplate}}}class aJ{mapFromDto(t){if(t.type!==Dr.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:Dr.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class sJ{mapFromDto(t){if(t.type!==Dr.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:Dr.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const oJ={getMapper(e){switch(e){case Dr.GOOGLE_SHEETS_CONFIG:return new aJ;case Dr.LOOKER_STUDIO_CONFIG:return new sJ;case Dr.EMAIL_CONFIG:return new rJ;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function iJ(e){return oJ.getMapper(e.type).mapFromDto(e)}function ec(e){const t=iJ(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:_u(e.dataDestinationAccess),destinationConfig:t,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)}}const j5=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)},Ny=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"—";const r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(t),s=new Map(r.map(g=>[g.type,g.value])),i=s.get("year")??"",c=s.get("month")??"",u=s.get("day")??"",f=s.get("hour")??"",m=s.get("minute")??"",y=s.get("second")??"";return`${i}-${c}-${u} ${f}:${m}:${y}`},Su=e=>Ny(T5(e).toISOString()),T5=e=>{const t=e.trim();if(t.includes("T")||t.includes("Z")){const s=new Date(t);if(!isNaN(s.getTime()))return s}let n=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(t);if(n)return new Date(Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]?parseInt(n[6],10):0));if(n=/^(\d{1,2})[./](\d{1,2})[./](\d{4})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(t),n)return new Date(Date.UTC(parseInt(n[3],10),parseInt(n[2],10)-1,parseInt(n[1],10),parseInt(n[4],10),parseInt(n[5],10),n[6]?parseInt(n[6],10):0));const r=new Date(t);return isNaN(r.getTime())?(console.warn(`Failed to parse date string: "${e}", using current date as fallback`),new Date):r},lJ=(e,t)=>{const n=t.getTime()-e.getTime(),r=Math.floor(n/1e3),s=Math.floor(r/60),i=Math.floor(s/60),c=s%60,u=r%60,f=[];return i>0&&f.push(`${String(i)} h`),c>0&&f.push(`${String(c)} min`),f.push(`${String(u)} sec`),f.join(" ")};function _5(e){return JSON.parse(JSON.stringify(e))}function cJ(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/Math.pow(t,r)).toFixed(2)).toString()} ${n[r]}`}const N5=e=>{try{const t=JSON.parse(e),{project_id:n,client_id:r,client_email:s}=t;return!n||!r||!s?null:{url:`https://console.cloud.google.com/iam-admin/serviceaccounts/details/${r}?project=${n}`,email:s}}catch{return null}};function uJ(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function dJ(e){return!e||typeof e!="object"?!0:e.LICENSED_APP_EDITION==="COMMUNITY"}const fJ=e=>e?e.split(",").map(t=>t.trim()).filter(Boolean):[];function ts(){const{state:e,dispatch:t}=LQ(),n=h.useCallback(async()=>{t({type:it.FETCH_DESTINATIONS_START});try{const w=await Jl.getDataDestinations();t({type:it.FETCH_DESTINATIONS_SUCCESS,payload:w})}catch(w){const R=w instanceof Error?w.message:"Failed to fetch destinations";t({type:it.FETCH_DESTINATIONS_ERROR,payload:R}),De({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=h.useCallback(async()=>{t({type:it.FETCH_REPORTS_START});try{const R=(await Wo.getReportsByProject()).map(ec);t({type:it.FETCH_REPORTS_SUCCESS,payload:R})}catch(w){const R=w instanceof Error?w.message:"Failed to fetch reports";t({type:it.FETCH_REPORTS_ERROR,payload:R}),De({event:"report_error",category:"Report",action:"ListError",error:R})}},[t]),s=h.useCallback(async(w,R)=>{R!=null&&R.silent||t({type:it.FETCH_REPORTS_START});try{const _=(await Wo.getReportsByDataMartId(w,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(ec);t({type:it.FETCH_REPORTS_SUCCESS,payload:_})}catch(j){const _=j instanceof Error?j.message:"Failed to fetch reports";t({type:it.FETCH_REPORTS_ERROR,payload:_}),De({event:"report_error",category:"Report",action:"ListError",error:_})}},[t]),i=h.useCallback(async w=>{t({type:it.FETCH_REPORT_START});try{const R=await Wo.getReportById(w),j=ec(R);t({type:it.FETCH_REPORT_SUCCESS,payload:j})}catch(R){const j=R instanceof Error?R.message:"Failed to fetch report";t({type:it.FETCH_REPORT_ERROR,payload:j}),De({event:"report_error",category:"Report",action:"GetError",error:j})}},[t]),c=h.useCallback(async w=>{t({type:it.CREATE_REPORT_START});try{const R=await Wo.createReport(w),j=ec(R);return t({type:it.CREATE_REPORT_SUCCESS,payload:j}),De({event:"report_created",category:"Report",action:"Create",label:j.dataDestination.type,details:j.title,context:j.dataMart.id}),_t.success("Report created"),j}catch(R){const j=R instanceof Error?R.message:"Failed to create report";return t({type:it.CREATE_REPORT_ERROR,payload:j}),De({event:"report_error",category:"Report",action:"CreateError",label:w.destinationConfig.type,error:j}),null}},[t]),u=h.useCallback(async(w,R)=>{t({type:it.UPDATE_REPORT_START});try{const j=await Wo.updateReport(w,R),_=ec(j);return t({type:it.UPDATE_REPORT_SUCCESS,payload:_}),De({event:"report_updated",category:"Report",action:"Update",label:_.dataDestination.type,value:_.title,context:_.dataMart.id,details:_.id}),_t.success("Report updated"),_}catch(j){const _=j instanceof Error?j.message:"Failed to update report";return t({type:it.UPDATE_REPORT_ERROR,payload:_}),De({event:"report_error",category:"Report",action:"UpdateError",error:_}),null}},[t]),f=h.useCallback(async w=>{t({type:it.DELETE_REPORT_START});try{await Wo.deleteReport(w),t({type:it.DELETE_REPORT_SUCCESS,payload:w}),De({event:"report_deleted",category:"Report",action:"Delete",label:w}),_t.success("Report deleted")}catch(R){const j=R instanceof Error?R.message:"Failed to delete report";t({type:it.DELETE_REPORT_ERROR,payload:j}),De({event:"report_error",category:"Report",action:"DeleteError",label:w,error:j})}},[t]),m=h.useCallback(()=>{t({type:it.CLEAR_CURRENT_REPORT})},[t]),y=h.useCallback(()=>{t({type:it.CLEAR_ERROR})},[t]),g=h.useCallback(w=>{wp.stopPolling(w),t({type:it.STOP_POLLING_REPORT,payload:w})},[t]),x=h.useCallback(w=>{e.polledReportIds.includes(w)&&g(w),t({type:it.START_POLLING_REPORT,payload:w}),wp.startPolling(w,R=>{const j=ec(R);t({type:it.UPDATE_POLLED_REPORT,payload:j})})},[t,e.polledReportIds,g]),v=h.useCallback(()=>{wp.stopAllPolling(),t({type:it.STOP_ALL_POLLING})},[t]),C=h.useCallback(w=>{wp.setConfig(w)},[]),b=h.useCallback(async w=>{try{g(w),await Wo.runReport(w),await i(w),x(w),De({event:"report_run_started",category:"Report",action:"Run",label:w}),_t.success("Report run started")}catch(R){const j=R instanceof Error?R.message:"Failed to run report";De({event:"report_error",category:"Report",action:"RunError",error:j}),console.error("Failed to run report:",R)}},[i,x,g]);return h.useEffect(()=>()=>{v()},[v]),{destinations:e.destinations,reports:e.reports,currentReport:e.currentReport,loading:e.loading,error:e.error,polledReportIds:e.polledReportIds,fetchDestinations:n,fetchReports:r,fetchReportsByDataMartId:s,fetchReportById:i,createReport:c,updateReport:u,deleteReport:f,runReport:b,startPollingReport:x,stopPollingReport:g,stopAllPolling:v,setPollingConfig:C,clearCurrentReport:m,clearError:y}}Mn.SUCCESS+"",Mn.SUCCESS,Mn.RUNNING+"",Mn.RUNNING,Mn.ERROR+"",Mn.ERROR,Mn.CANCELLED+"",Mn.CANCELLED;var Y0,Ay="HoverCard",[A5]=Sr(Ay,[Ro]),Dy=Ro(),[hJ,Oy]=A5(Ay),D5=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:i,openDelay:c=700,closeDelay:u=300}=e,f=Dy(t),m=h.useRef(0),y=h.useRef(0),g=h.useRef(!1),x=h.useRef(!1),[v,C]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:Ay}),b=h.useCallback(()=>{clearTimeout(y.current),m.current=window.setTimeout(()=>C(!0),c)},[c,C]),w=h.useCallback(()=>{clearTimeout(m.current),!g.current&&!x.current&&(y.current=window.setTimeout(()=>C(!1),u))},[u,C]),R=h.useCallback(()=>C(!1),[C]);return h.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(y.current)},[]),a.jsx(hJ,{scope:t,open:v,onOpenChange:C,onOpen:b,onClose:w,onDismiss:R,hasSelectionRef:g,isPointerDownOnContentRef:x,children:a.jsx(fd,{...f,children:n})})};D5.displayName=Ay;var O5="HoverCardTrigger",I5=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Oy(O5,n),i=Dy(n);return a.jsx(hd,{asChild:!0,...i,children:a.jsx(et.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Me(e.onPointerEnter,Ng(s.onOpen)),onPointerLeave:Me(e.onPointerLeave,Ng(s.onClose)),onFocus:Me(e.onFocus,s.onOpen),onBlur:Me(e.onBlur,s.onClose),onTouchStart:Me(e.onTouchStart,c=>c.preventDefault())})})});I5.displayName=O5;var a2="HoverCardPortal",[mJ,pJ]=A5(a2,{forceMount:void 0}),M5=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,i=Oy(a2,t);return a.jsx(mJ,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:r})})})};M5.displayName=a2;var _g="HoverCardContent",k5=h.forwardRef((e,t)=>{const n=pJ(_g,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=Oy(_g,e.__scopeHoverCard);return a.jsx(Vr,{present:r||i.open,children:a.jsx(gJ,{"data-state":i.open?"open":"closed",...s,onPointerEnter:Me(e.onPointerEnter,Ng(i.onOpen)),onPointerLeave:Me(e.onPointerLeave,Ng(i.onClose)),ref:t})})});k5.displayName=_g;var gJ=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,...u}=e,f=Oy(_g,n),m=Dy(n),y=h.useRef(null),g=ht(t,y),[x,v]=h.useState(!1);return h.useEffect(()=>{if(x){const C=document.body;return Y0=C.style.userSelect||C.style.webkitUserSelect,C.style.userSelect="none",C.style.webkitUserSelect="none",()=>{C.style.userSelect=Y0,C.style.webkitUserSelect=Y0}}},[x]),h.useEffect(()=>{if(y.current){const C=()=>{v(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var w;((w=document.getSelection())==null?void 0:w.toString())!==""&&(f.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",C),()=>{document.removeEventListener("pointerup",C),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!1}}},[f.isPointerDownOnContentRef,f.hasSelectionRef]),h.useEffect(()=>{y.current&&vJ(y.current).forEach(b=>b.setAttribute("tabindex","-1"))}),a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Me(i,C=>{C.preventDefault()}),onDismiss:f.onDismiss,children:a.jsx(wh,{...m,...u,onPointerDown:Me(u.onPointerDown,C=>{C.currentTarget.contains(C.target)&&v(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:g,style:{...u.style,userSelect:x?"text":void 0,WebkitUserSelect:x?"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)"}})})}),yJ="HoverCardArrow",xJ=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Dy(n);return a.jsx(Eh,{...s,...r,ref:t})});xJ.displayName=yJ;function Ng(e){return t=>t.pointerType==="touch"?void 0:e()}function vJ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var bJ=D5,SJ=I5,CJ=M5,wJ=k5;const Iy=({...e})=>a.jsx(bJ,{"data-slot":"hover-card",...e});Iy.displayName="HoverCard";const My=h.forwardRef(({...e},t)=>a.jsx(SJ,{"data-slot":"hover-card-trigger",ref:t,...e}));My.displayName="HoverCardTrigger";const ky=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...s},i)=>{const c=u=>{u.stopPropagation(),r&&r(u)};return a.jsx(CJ,{children:a.jsx(wJ,{ref:i,align:t,sideOffset:n,className:se("bg-popover text-popover-foreground z-50 w-110 rounded-lg border px-6 py-4 shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onClick:c,...s})})});ky.displayName="HoverCardContent";const s2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("border-border flex gap-4 border-b pb-4",e),...t}));s2.displayName="HoverCardHeader";const o2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));o2.displayName="HoverCardHeaderIcon";const i2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("flex flex-col space-y-1",e),...t}));i2.displayName="HoverCardHeaderText";const l2=h.forwardRef(({className:e,...t},n)=>a.jsx("h2",{ref:n,className:se("text-md pt-1 leading-snug font-semibold",e),...t}));l2.displayName="HoverCardHeaderTitle";const c2=h.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:se("text-muted-foreground text-sm",e),...t}));c2.displayName="HoverCardHeaderDescription";const u2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("flex flex-col",e),...t}));u2.displayName="HoverCardBody";const el=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("border-border flex items-center justify-between border-b py-4",e),...t}));el.displayName="HoverCardItem";const tl=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:se("text-muted-foreground text-sm",e),...t}));tl.displayName="HoverCardItemLabel";const nl=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:se("text-sm",e),...t}));nl.displayName="HoverCardItemValue";const d2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("pt-4 pb-2",e),...t}));d2.displayName="HoverCardFooter";function Ly(e){return e.type===Dr.GOOGLE_SHEETS_CONFIG}function L5(e){return e.type===Dr.LOOKER_STUDIO_CONFIG}function W0(e){return e.type===Dr.EMAIL_CONFIG}function Vs({date:e,className:t=""}){const n=h.useMemo(()=>{const r=new Date,s=e.getTime()-r.getTime(),i=Math.abs(s),c=s<0,u=Math.floor(i/(1e3*60)),f=Math.floor(i/(1e3*60*60)),m=Math.floor(i/(1e3*60*60*24)),y=Math.floor(m/7),g=Math.floor(m/30),x=Math.floor(m/365),v=b=>b.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),C=b=>b.toLocaleDateString("en-US",{weekday:"long"});if(u<1)return c?"Just now":"In a moment";if(u<60)return c?u===1?"1 minute ago":`${u} minutes ago`:u===1?"In 1 minute":`In ${u} minutes`;if(f<24)return c?f===1?"1 hour ago":`${f} hours ago`:f===1?"In 1 hour":`In ${f} hours`;if(m===1){const b=v(e);return c?`Yesterday at ${b}`:`Tomorrow at ${b}`}if(m<7){const b=C(e),w=v(e);return c?`Last ${b} at ${w}`:`This ${b} at ${w}`}if(m<14){const b=C(e),w=v(e);return c?`Last ${b} at ${w}`:`Next ${b} at ${w}`}return y<4?c?y===2?"2 weeks ago":"3 weeks ago":y===2?"In 2 weeks":"In 3 weeks":g<12?c?g===1?"1 month ago":`${g} months ago`:g===1?"In 1 month":`In ${g} months`:c?x===1?"1 year ago":`${x} years ago`:x===1?"In 1 year":`In ${x} years`},[e]);return a.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const EJ=()=>{const e=h.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=h.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},RJ=ae.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=EJ(),i=h.useMemo(()=>t.lastRunStatus?{statusType:_J(t.lastRunStatus),statusText:AJ(t.lastRunStatus)}:null,[t.lastRunStatus]),c=h.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:s.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,s]),u=h.useMemo(()=>aa.getInfo(t.dataDestination.type).icon,[t.dataDestination.type]),f=h.useMemo(()=>Ly(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),m=h.useCallback(()=>{if(!f.isGoogleSheets||!f.spreadsheetId||!f.sheetId)return;const y=e2(f.spreadsheetId,f.sheetId);window.open(y,"_blank","noopener,noreferrer")},[f]);return a.jsxs(Iy,{children:[a.jsx(My,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(ky,{children:[a.jsxs(s2,{children:[a.jsx(o2,{children:a.jsx(u,{size:20})}),a.jsxs(i2,{children:[a.jsx(l2,{children:t.title||"Unnamed Report"}),a.jsxs(c2,{children:["Last modified ",a.jsx(Vs,{date:new Date(t.modifiedAt)})]})]})]}),a.jsxs(u2,{children:[a.jsxs(el,{children:[a.jsx(tl,{children:"Last run status:"}),a.jsx(nl,{children:i?a.jsx(Uh,{type:i.statusType,variant:"ghost",children:i.statusText}):"Not run yet"})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Last run date:"}),a.jsx(nl,{children:t.lastRunDate?a.jsx(Vs,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&a.jsxs(el,{children:[a.jsx(tl,{children:"Error message:"}),a.jsx(nl,{children:t.lastRunError})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Total runs:"}),a.jsxs(nl,{children:[t.runsCount||0," runs",c.createdAt&&a.jsxs(a.Fragment,{children:[", since ",c.createdAt]})]})]})]}),f.isGoogleSheets&&a.jsx(d2,{children:a.jsxs(we,{className:"w-full",variant:"default",onClick:m,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",a.jsx(si,{className:"ml-1 inline h-4 w-4","aria-hidden":"true"})]})})]})]})},(e,t)=>e.report.id===t.report.id&&e.report.title===t.report.title&&e.report.modifiedAt===t.report.modifiedAt&&e.report.lastRunStatus===t.report.lastRunStatus&&e.report.lastRunDate===t.report.lastRunDate&&e.report.lastRunError===t.report.lastRunError&&e.report.runsCount===t.report.runsCount&&e.report.createdAt===t.report.createdAt&&JSON.stringify(e.report.destinationConfig)===JSON.stringify(t.report.destinationConfig));var Xa=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Xa||{});const jJ=e=>{switch(e){case Ar.DRAFT:return Jn.NEUTRAL;case Ar.PUBLISHED:return Jn.SUCCESS;default:return Jn.NEUTRAL}},TJ=e=>{switch(e){case qn.SUCCESS:return Jn.SUCCESS;case qn.RUNNING:return Jn.INFO;case qn.FAILED:case qn.CANCELLED:case qn.INTERRUPTED:return Jn.ERROR;default:return Jn.NEUTRAL}},_J=e=>{switch(e){case Mn.SUCCESS:return Jn.SUCCESS;case Mn.RUNNING:return Jn.INFO;case Mn.ERROR:return Jn.ERROR;default:return Jn.NEUTRAL}},NJ=e=>{switch(e){case qn.SUCCESS:return"Success";case qn.RUNNING:return"Running";case qn.FAILED:return"Failed";case qn.CANCELLED:return"Cancelled";case qn.INTERRUPTED:return"Interrupted";case qn.PENDING:return"Pending";default:return"Unknown"}},AJ=e=>{switch(e){case Mn.SUCCESS:return"Success";case Mn.RUNNING:return"Running";case Mn.ERROR:return"Failed";default:return"Unknown"}},DJ=e=>e?[qn.SUCCESS,qn.FAILED,qn.CANCELLED,qn.INTERRUPTED].includes(e):!0,OJ=e=>e?[Xa.SUCCESS,Xa.ERROR,Xa.CANCELLED].includes(e):!0,P5=e=>an({fullyQualifiedName:Dt().min(1,"Fully qualified name is required").refine(t=>bQ(t,e),t=>({message:CQ(t,e)}))}),IJ=e=>an({pattern:Dt().min(1,"Table pattern is required").refine(t=>SQ(t,e),t=>({message:wQ(t,e)}))}),MJ=e=>{const t=[];return e.status.code===Ar.PUBLISHED&&t.push(Yp.ALREADY_PUBLISHED),g5(e.storage)||t.push(Yp.INVALID_STORAGE),e.definition||t.push(Yp.MISSING_DEFINITION),t},kJ=e=>e.map(t=>HX[t]);function LJ(e){return e.map(t=>({id:t.id,title:t.title,status:l5.getInfo(t.status),storageType:t.storage.type,storageTitle:t.storage.title||void 0,definitionType:t.definitionType,triggersCount:t.triggersCount,reportsCount:t.reportsCount,createdByUser:t.createdByUser,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),definition:t.definition}))}function U5(){const{state:e,dispatch:t}=zX(),n=h.useCallback(async()=>{t({type:"SET_LOADING"});try{const i=await Tn.getDataMarts(),c=LJ(i);t({type:"SET_ITEMS",payload:c})}catch(i){t({type:"SET_ERROR",payload:i instanceof Error?i.message:"Failed to load data marts"})}},[t]),r=h.useCallback(async i=>{t({type:"SET_LOADING"});try{await Tn.deleteDataMart(i),De({event:"data_mart_deleted",category:"DataMart",action:"Delete"})}catch(c){const u=c instanceof Error?c.message:"Failed to delete data mart";throw t({type:"SET_ERROR",payload:u}),De({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:u}),c}},[t]),s=h.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:s,deleteDataMart:r}}/**
|
|
782
|
-
* table-core
|
|
783
|
-
*
|
|
784
|
-
* Copyright (c) TanStack
|
|
785
|
-
*
|
|
786
|
-
* This source code is licensed under the MIT license found in the
|
|
787
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
788
|
-
*
|
|
789
|
-
* @license MIT
|
|
790
|
-
*/function rl(e,t){return typeof e=="function"?e(t):e}function Ja(e,t){return n=>{t.setState(r=>({...r,[e]:rl(n,r[e])}))}}function Py(e){return e instanceof Function}function PJ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function UJ(e,t){const n=[],r=s=>{s.forEach(i=>{n.push(i);const c=t(i);c!=null&&c.length&&r(c)})};return r(e),n}function lt(e,t,n){let r=[],s;return i=>{let c;n.key&&n.debug&&(c=Date.now());const u=e(i);if(!(u.length!==r.length||u.some((y,g)=>r[g]!==y)))return s;r=u;let m;if(n.key&&n.debug&&(m=Date.now()),s=t(...u),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const y=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-m)*100)/100,x=g/16,v=(C,b)=>{for(C=String(C);C.length<b;)C=" "+C;return C};console.info(`%c⏱ ${v(g,5)} /${v(y,5)} ms`,`
|
|
791
|
-
font-size: .6rem;
|
|
792
|
-
font-weight: bold;
|
|
793
|
-
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function ct(e,t,n,r){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function zJ(e,t,n,r){const s=()=>{var c;return(c=i.getValue())!=null?c:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:lt(()=>[e,n,t,i],(c,u,f,m)=>({table:c,column:u,row:f,cell:m,getValue:m.getValue,renderValue:m.renderValue}),ct(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(i,n,t,e)},{}),i}function FJ(e,t,n,r){var s,i;const u={...e._getDefaultColumnDef(),...t},f=u.accessorKey;let m=(s=(i=u.id)!=null?i:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?s:typeof u.header=="string"?u.header:void 0,y;if(u.accessorFn?y=u.accessorFn:f&&(f.includes(".")?y=x=>{let v=x;for(const b of f.split(".")){var C;v=(C=v)==null?void 0:C[b]}return v}:y=x=>x[u.accessorKey]),!m)throw new Error;let g={id:`${String(m)}`,accessorFn:y,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:lt(()=>[!0],()=>{var x;return[g,...(x=g.columns)==null?void 0:x.flatMap(v=>v.getFlatColumns())]},ct(e.options,"debugColumns")),getLeafColumns:lt(()=>[e._getOrderColumnsFn()],x=>{var v;if((v=g.columns)!=null&&v.length){let C=g.columns.flatMap(b=>b.getLeafColumns());return x(C)}return[g]},ct(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(g,e);return g}const qr="debugHeaders";function __(e,t,n){var r;let i={id:(r=n.id)!=null?r: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 c=[],u=f=>{f.subHeaders&&f.subHeaders.length&&f.subHeaders.map(u),c.push(f)};return u(i),c},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(i,e)}),i}const HJ={createTable:e=>{e.getHeaderGroups=lt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var i,c;const u=(i=r==null?void 0:r.map(g=>n.find(x=>x.id===g)).filter(Boolean))!=null?i:[],f=(c=s==null?void 0:s.map(g=>n.find(x=>x.id===g)).filter(Boolean))!=null?c:[],m=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(s!=null&&s.includes(g.id)));return Rp(t,[...u,...m,...f],e)},ct(e.options,qr)),e.getCenterHeaderGroups=lt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(s!=null&&s.includes(i.id))),Rp(t,n,e,"center")),ct(e.options,qr)),e.getLeftHeaderGroups=lt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const i=(s=r==null?void 0:r.map(c=>n.find(u=>u.id===c)).filter(Boolean))!=null?s:[];return Rp(t,i,e,"left")},ct(e.options,qr)),e.getRightHeaderGroups=lt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const i=(s=r==null?void 0:r.map(c=>n.find(u=>u.id===c)).filter(Boolean))!=null?s:[];return Rp(t,i,e,"right")},ct(e.options,qr)),e.getFooterGroups=lt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getLeftFooterGroups=lt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getCenterFooterGroups=lt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getRightFooterGroups=lt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getFlatHeaders=lt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getLeftFlatHeaders=lt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getCenterFlatHeaders=lt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getRightFlatHeaders=lt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getCenterLeafHeaders=lt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,qr)),e.getLeftLeafHeaders=lt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,qr)),e.getRightLeafHeaders=lt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,qr)),e.getLeafHeaders=lt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,i,c,u,f,m;return[...(s=(i=t[0])==null?void 0:i.headers)!=null?s:[],...(c=(u=n[0])==null?void 0:u.headers)!=null?c:[],...(f=(m=r[0])==null?void 0:m.headers)!=null?f:[]].map(y=>y.getLeafHeaders()).flat()},ct(e.options,qr))}};function Rp(e,t,n,r){var s,i;let c=0;const u=function(x,v){v===void 0&&(v=1),c=Math.max(c,v),x.filter(C=>C.getIsVisible()).forEach(C=>{var b;(b=C.columns)!=null&&b.length&&u(C.columns,v+1)},0)};u(e);let f=[];const m=(x,v)=>{const C={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},b=[];x.forEach(w=>{const R=[...b].reverse()[0],j=w.column.depth===C.depth;let _,D=!1;if(j&&w.column.parent?_=w.column.parent:(_=w.column,D=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(w);else{const O=__(n,_,{id:[r,v,_.id,w==null?void 0:w.id].filter(Boolean).join("_"),isPlaceholder:D,placeholderId:D?`${b.filter(A=>A.column===_).length}`:void 0,depth:v,index:b.length});O.subHeaders.push(w),b.push(O)}C.headers.push(w),w.headerGroup=C}),f.push(C),v>0&&m(b,v-1)},y=t.map((x,v)=>__(n,x,{depth:c,index:v}));m(y,c-1),f.reverse();const g=x=>x.filter(C=>C.column.getIsVisible()).map(C=>{let b=0,w=0,R=[0];C.subHeaders&&C.subHeaders.length?(R=[],g(C.subHeaders).forEach(_=>{let{colSpan:D,rowSpan:O}=_;b+=D,R.push(O)})):b=1;const j=Math.min(...R);return w=w+j,C.colSpan=b,C.rowSpan=w,{colSpan:b,rowSpan:w}});return g((s=(i=f[0])==null?void 0:i.headers)!=null?s:[]),f}const f2=(e,t,n,r,s,i,c)=>{let u={id:t,index:r,original:n,depth:s,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(u._valuesCache.hasOwnProperty(f))return u._valuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return u._valuesCache[f]=m.accessorFn(u.original,r),u._valuesCache[f]},getUniqueValues:f=>{if(u._uniqueValuesCache.hasOwnProperty(f))return u._uniqueValuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(u._uniqueValuesCache[f]=m.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[f]):(u._uniqueValuesCache[f]=[u.getValue(f)],u._uniqueValuesCache[f])},renderValue:f=>{var m;return(m=u.getValue(f))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>UJ(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],m=u;for(;;){const y=m.getParentRow();if(!y)break;f.push(y),m=y}return f.reverse()},getAllCells:lt(()=>[e.getAllLeafColumns()],f=>f.map(m=>zJ(e,u,m,m.id)),ct(e.options,"debugRows")),_getAllCellsByColumnId:lt(()=>[u.getAllCells()],f=>f.reduce((m,y)=>(m[y.column.id]=y,m),{}),ct(e.options,"debugRows"))};for(let f=0;f<e._features.length;f++){const m=e._features[f];m==null||m.createRow==null||m.createRow(u,e)}return u},$J={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()}}},z5=(e,t,n)=>{var r,s;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(i))};z5.autoRemove=e=>Us(e);const F5=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};F5.autoRemove=e=>Us(e);const H5=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};H5.autoRemove=e=>Us(e);const $5=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};$5.autoRemove=e=>Us(e);const V5=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});V5.autoRemove=e=>Us(e)||!(e!=null&&e.length);const G5=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});G5.autoRemove=e=>Us(e)||!(e!=null&&e.length);const B5=(e,t,n)=>e.getValue(t)===n;B5.autoRemove=e=>Us(e);const q5=(e,t,n)=>e.getValue(t)==n;q5.autoRemove=e=>Us(e);const h2=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};h2.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(s)?1/0:s;if(i>c){const u=i;i=c,c=u}return[i,c]};h2.autoRemove=e=>Us(e)||Us(e[0])&&Us(e[1]);const Xo={includesString:z5,includesStringSensitive:F5,equalsString:H5,arrIncludes:$5,arrIncludesAll:V5,arrIncludesSome:G5,equals:B5,weakEquals:q5,inNumberRange:h2};function Us(e){return e==null||e===""}const VJ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ja("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Xo.includesString:typeof r=="number"?Xo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Xo.equals:Array.isArray(r)?Xo.arrIncludes:Xo.weakEquals},e.getFilterFn=()=>{var n,r;return Py(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Xo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),i=r==null?void 0:r.find(y=>y.id===e.id),c=rl(n,i?i.value:void 0);if(N_(s,c,e)){var u;return(u=r==null?void 0:r.filter(y=>y.id!==e.id))!=null?u:[]}const f={id:e.id,value:c};if(i){var m;return(m=r==null?void 0:r.map(y=>y.id===e.id?f:y))!=null?m:[]}return r!=null&&r.length?[...r,f]:[f]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var i;return(i=rl(t,s))==null?void 0:i.filter(c=>{const u=n.find(f=>f.id===c.id);if(u){const f=u.getFilterFn();if(N_(f,c.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.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 N_(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const GJ=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),BJ=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},qJ=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},KJ=(e,t,n)=>{let r,s;return n.forEach(i=>{const c=i.getValue(e);c!=null&&(r===void 0?c>=c&&(r=s=c):(r>c&&(r=c),s<c&&(s=c)))}),[r,s]},ZJ=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let i=s.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},YJ=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!PJ(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((i,c)=>i-c);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},WJ=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),XJ=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,QJ=(e,t)=>t.length,X0={sum:GJ,min:BJ,max:qJ,extent:KJ,mean:ZJ,median:YJ,unique:WJ,uniqueCount:XJ,count:QJ},JJ={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:Ja("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!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],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return X0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return X0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Py(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:X0[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.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 r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function eee(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(c=>c.id===i)).filter(Boolean),...r]}const tee={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ja("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=lt(n=>[Pf(t,n)],n=>n.findIndex(r=>r.id===e.id),ct(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Pf(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Pf(t,n);return((r=s[s.length-1])==null?void 0:r.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=lt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let i=[];if(!(t!=null&&t.length))i=s;else{const c=[...t],u=[...s];for(;u.length&&c.length;){const f=c.shift(),m=u.findIndex(y=>y.id===f);m>-1&&i.push(u.splice(m,1)[0])}i=[...i,...u]}return eee(i,n,r)},ct(e.options,"debugTable"))}},Q0=()=>({left:[],right:[]}),nee={getInitialState:e=>({columnPinning:Q0(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ja("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var i,c;if(n==="right"){var u,f;return{left:((u=s==null?void 0:s.left)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((f=s==null?void 0:s.right)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var m,y;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((y=s==null?void 0:s.right)!=null?y:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((i=s==null?void 0:s.left)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g))),right:((c=s==null?void 0:s.right)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,i,c;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((i=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:r,right:s}=t.getState().columnPinning,i=n.some(u=>r==null?void 0:r.includes(u)),c=n.some(u=>s==null?void 0:s.includes(u));return i?"left":c?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=lt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const i=[...r??[],...s??[]];return n.filter(c=>!i.includes(c.column.id))},ct(t.options,"debugRows")),e.getLeftVisibleCells=lt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(c=>c.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ct(t.options,"debugRows")),e.getRightVisibleCells=lt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(c=>c.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ct(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Q0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Q0())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,i;return!!((s=r.left)!=null&&s.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=lt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ct(e.options,"debugColumns")),e.getRightLeafColumns=lt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ct(e.options,"debugColumns")),e.getCenterLeafColumns=lt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(i=>!s.includes(i.id))},ct(e.options,"debugColumns"))}};function ree(e){return e||(typeof document<"u"?document:null)}const jp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},J0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),aee={getDefaultColumnDef:()=>jp,getInitialState:e=>({columnSizing:{},columnSizingInfo:J0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ja("columnSizing",e),onColumnSizingInfoChange:Ja("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:jp.minSize,(r=i??e.columnDef.size)!=null?r:jp.size),(s=e.columnDef.maxSize)!=null?s:jp.maxSize)},e.getStart=lt(n=>[n,Pf(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),ct(t.options,"debugColumns")),e.getAfter=lt(n=>[n,Pf(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),ct(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var i;n+=(i=s.column.getSize())!=null?i:0}};return r(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 r=t.getColumn(e.column.id),s=r==null?void 0:r.getCanResize();return i=>{if(!r||!s||(i.persist==null||i.persist(),e1(i)&&i.touches&&i.touches.length>1))return;const c=e.getSize(),u=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[r.id,r.getSize()]],f=e1(i)?Math.round(i.touches[0].clientX):i.clientX,m={},y=(R,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(_=>{var D,O;const A=t.options.columnResizeDirection==="rtl"?-1:1,T=(j-((D=_==null?void 0:_.startOffset)!=null?D:0))*A,I=Math.max(T/((O=_==null?void 0:_.startSize)!=null?O:0),-.999999);return _.columnSizingStart.forEach(k=>{let[V,U]=k;m[V]=Math.round(Math.max(U+U*I,0)*100)/100}),{..._,deltaOffset:T,deltaPercentage:I}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...m})))},g=R=>y("move",R),x=R=>{y("end",R),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=ree(n),C={moveHandler:R=>g(R.clientX),upHandler:R=>{v==null||v.removeEventListener("mousemove",C.moveHandler),v==null||v.removeEventListener("mouseup",C.upHandler),x(R.clientX)}},b={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),g(R.touches[0].clientX),!1),upHandler:R=>{var j;v==null||v.removeEventListener("touchmove",b.moveHandler),v==null||v.removeEventListener("touchend",b.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),x((j=R.touches[0])==null?void 0:j.clientX)}},w=see()?{passive:!1}:!1;e1(i)?(v==null||v.addEventListener("touchmove",b.moveHandler,w),v==null||v.addEventListener("touchend",b.upHandler,w)):(v==null||v.addEventListener("mousemove",C.moveHandler,w),v==null||v.addEventListener("mouseup",C.upHandler,w)),t.setColumnSizingInfo(R=>({...R,startOffset:f,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.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?J0():(n=e.initialState.columnSizingInfo)!=null?n:J0())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let Tp=null;function see(){if(typeof Tp=="boolean")return Tp;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 Tp=e,Tp}function e1(e){return e.type==="touchstart"}const oee={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ja("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=lt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ct(t.options,"debugRows")),e.getVisibleCells=lt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],ct(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>lt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ct(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 r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.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 r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Pf(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const iee={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()}}},lee={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ja("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Xo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Py(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Xo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},cee={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ja("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,i;e.setExpanded(r?{}:(s=(i=e.initialState)==null?void 0:i.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const c=i.split(".");r=Math.max(r,c.length)}),r},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(r=>{var s;const i=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{c[u]=!0}):c=r,n=(s=n)!=null?s:!i,!i&&n)return{...c,[e.id]:!0};if(i&&!n){const{[e.id]:u,...f}=c;return f}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},hb=0,mb=10,t1=()=>({pageIndex:hb,pageSize:mb}),uee={getInitialState:e=>({...e,pagination:{...t1(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ja("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=i=>rl(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?t1():(s=e.initialState.pagination)!=null?s:t1())},e.setPageIndex=r=>{e.setPagination(s=>{let i=rl(r,s.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,c)),{...s,pageIndex:i}})},e.resetPageIndex=r=>{var s,i;e.setPageIndex(r?hb:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:hb)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?mb:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:mb)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,rl(r,s.pageSize)),c=s.pageSize*s.pageIndex,u=Math.floor(c/i);return{...s,pageIndex:u,pageSize:i}})},e.setPageCount=r=>e.setPagination(s=>{var i;let c=rl(r,(i=e.options.pageCount)!=null?i:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=lt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,c)=>c)),s},ct(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:r<s-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+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 r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},n1=()=>({top:[],bottom:[]}),dee={getInitialState:e=>({rowPinning:n1(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ja("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const i=r?e.getLeafRows().map(f=>{let{id:m}=f;return m}):[],c=s?e.getParentRows().map(f=>{let{id:m}=f;return m}):[],u=new Set([...c,e.id,...i]);t.setRowPinning(f=>{var m,y;if(n==="bottom"){var g,x;return{top:((g=f==null?void 0:f.top)!=null?g:[]).filter(b=>!(u!=null&&u.has(b))),bottom:[...((x=f==null?void 0:f.bottom)!=null?x:[]).filter(b=>!(u!=null&&u.has(b))),...Array.from(u)]}}if(n==="top"){var v,C;return{top:[...((v=f==null?void 0:f.top)!=null?v:[]).filter(b=>!(u!=null&&u.has(b))),...Array.from(u)],bottom:((C=f==null?void 0:f.bottom)!=null?C:[]).filter(b=>!(u!=null&&u.has(b)))}}return{top:((m=f==null?void 0:f.top)!=null?m:[]).filter(b=>!(u!=null&&u.has(b))),bottom:((y=f==null?void 0:f.bottom)!=null?y:[]).filter(b=>!(u!=null&&u.has(b)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,i=n.some(u=>r==null?void 0:r.includes(u)),c=n.some(u=>s==null?void 0:s.includes(u));return i?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const i=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(c=>{let{id:u}=c;return u});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?n1():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:n1())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,i;return!!((s=r.top)!=null&&s.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(c=>{const u=e.getRow(c,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(c=>t.find(u=>u.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=lt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ct(e.options,"debugRows")),e.getBottomRows=lt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ct(e.options,"debugRows")),e.getCenterRows=lt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(i=>!s.has(i.id))},ct(e.options,"debugRows"))}},fee={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ja("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 r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):s.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(i=>{pb(s,i.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?r1(e,n):{rows:[],flatRows:[],rowsById:{}},ct(e.options,"debugTable")),e.getFilteredSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?r1(e,n):{rows:[],flatRows:[],rowsById:{}},ct(e.options,"debugTable")),e.getGroupedSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?r1(e,n):{rows:[],flatRows:[],rowsById:{}},ct(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},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,r)=>{const s=e.getIsSelected();t.setRowSelection(i=>{var c;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return i;const u={...i};return pb(u,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return m2(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return gb(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return gb(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 r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},pb=(e,t,n,r,s)=>{var i;const c=s.getRow(t,!0);n?(c.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=c.subRows)!=null&&i.length&&c.getCanSelectSubRows()&&c.subRows.forEach(u=>pb(e,u.id,n,r,s))};function r1(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(c,u){return c.map(f=>{var m;const y=m2(f,n);if(y&&(r.push(f),s[f.id]=f),(m=f.subRows)!=null&&m.length&&(f={...f,subRows:i(f.subRows)}),y)return f}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function m2(e,t){var n;return(n=t[e.id])!=null?n:!1}function gb(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,i=!1;return e.subRows.forEach(c=>{if(!(i&&!s)&&(c.getCanSelect()&&(m2(c,t)?i=!0:s=!1),c.subRows&&c.subRows.length)){const u=gb(c,t);u==="all"?i=!0:(u==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const yb=/([0-9]+)/gm,hee=(e,t,n)=>K5(ml(e.getValue(n)).toLowerCase(),ml(t.getValue(n)).toLowerCase()),mee=(e,t,n)=>K5(ml(e.getValue(n)),ml(t.getValue(n))),pee=(e,t,n)=>p2(ml(e.getValue(n)).toLowerCase(),ml(t.getValue(n)).toLowerCase()),gee=(e,t,n)=>p2(ml(e.getValue(n)),ml(t.getValue(n))),yee=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},xee=(e,t,n)=>p2(e.getValue(n),t.getValue(n));function p2(e,t){return e===t?0:e>t?1:-1}function ml(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function K5(e,t){const n=e.split(yb).filter(Boolean),r=t.split(yb).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),i=r.shift(),c=parseInt(s,10),u=parseInt(i,10),f=[c,u].sort();if(isNaN(f[0])){if(s>i)return 1;if(i>s)return-1;continue}if(isNaN(f[1]))return isNaN(c)?-1:1;if(c>u)return 1;if(u>c)return-1}return n.length-r.length}const Sf={alphanumeric:hee,alphanumericCaseSensitive:mee,text:pee,textCaseSensitive:gee,datetime:yee,basic:xee},vee={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ja("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const i=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Sf.datetime;if(typeof i=="string"&&(r=!0,i.split(yb).length>1))return Sf.alphanumeric}return r?Sf.text:Sf.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,r;if(!e)throw new Error;return Py(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Sf[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(c=>{const u=c==null?void 0:c.find(v=>v.id===e.id),f=c==null?void 0:c.findIndex(v=>v.id===e.id);let m=[],y,g=i?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?u?y="toggle":y="add":c!=null&&c.length&&f!==c.length-1?y="replace":u?y="toggle":y="replace",y==="toggle"&&(i||s||(y="remove")),y==="add"){var x;m=[...c,{id:e.id,desc:g}],m.splice(0,m.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else y==="toggle"?m=c.map(v=>v.id===e.id?{...v,desc:g}:v):y==="remove"?m=c.filter(v=>v.id!==e.id):m=[{id:e.id,desc:g}];return m})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const i=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:c==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.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())}},bee=[HJ,oee,tee,nee,$J,VJ,iee,lee,vee,JJ,cee,uee,dee,fee,aee];function See(e){var t,n;const r=[...bee,...(t=e._features)!=null?t:[]];let s={_features:r};const i=s._features.reduce((x,v)=>Object.assign(x,v.getDefaultOptions==null?void 0:v.getDefaultOptions(s)),{}),c=x=>s.options.mergeOptions?s.options.mergeOptions(i,x):{...i,...x};let f={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var v;f=(v=x.getInitialState==null?void 0:x.getInitialState(f))!=null?v:f});const m=[];let y=!1;const g={_features:r,options:{...i,...e},initialState:f,_queue:x=>{m.push(x),y||(y=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();y=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const v=rl(x,s.options);s.options=c(v)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,v,C)=>{var b;return(b=s.options.getRowId==null?void 0:s.options.getRowId(x,v,C))!=null?b:`${C?[C.id,v].join("."):v}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,v)=>{let C=(v?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!C&&(C=s.getCoreRowModel().rowsById[x],!C))throw new Error;return C},_getDefaultColumnDef:lt(()=>[s.options.defaultColumn],x=>{var v;return x=(v=x)!=null?v:{},{header:C=>{const b=C.header.column.columnDef;return b.accessorKey?b.accessorKey:b.accessorFn?b.id:null},cell:C=>{var b,w;return(b=(w=C.renderValue())==null||w.toString==null?void 0:w.toString())!=null?b:null},...s._features.reduce((C,b)=>Object.assign(C,b.getDefaultColumnDef==null?void 0:b.getDefaultColumnDef()),{}),...x}},ct(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:lt(()=>[s._getColumnDefs()],x=>{const v=function(C,b,w){return w===void 0&&(w=0),C.map(R=>{const j=FJ(s,R,w,b),_=R;return j.columns=_.columns?v(_.columns,j,w+1):[],j})};return v(x)},ct(e,"debugColumns")),getAllFlatColumns:lt(()=>[s.getAllColumns()],x=>x.flatMap(v=>v.getFlatColumns()),ct(e,"debugColumns")),_getAllFlatColumnsById:lt(()=>[s.getAllFlatColumns()],x=>x.reduce((v,C)=>(v[C.id]=C,v),{}),ct(e,"debugColumns")),getAllLeafColumns:lt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,v)=>{let C=x.flatMap(b=>b.getLeafColumns());return v(C)},ct(e,"debugColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,g);for(let x=0;x<s._features.length;x++){const v=s._features[x];v==null||v.createTable==null||v.createTable(s)}return s}function Cl(){return e=>lt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,i,c){i===void 0&&(i=0);const u=[];for(let m=0;m<s.length;m++){const y=f2(e,e._getRowId(s[m],m,c),s[m],m,i,void 0,c==null?void 0:c.id);if(n.flatRows.push(y),n.rowsById[y.id]=y,u.push(y),e.options.getSubRows){var f;y.originalSubRows=e.options.getSubRows(s[m],m),(f=y.originalSubRows)!=null&&f.length&&(y.subRows=r(y.originalSubRows,i+1,y))}}return u};return n.rows=r(t),n},ct(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Cee(e){const t=[],n=r=>{var s;t.push(r),(s=r.subRows)!=null&&s.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function wee(e,t,n){return n.options.filterFromLeafRows?Eee(e,t,n):Ree(e,t,n)}function Eee(e,t,n){var r;const s=[],i={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(f,m){m===void 0&&(m=0);const y=[];for(let x=0;x<f.length;x++){var g;let v=f[x];const C=f2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);if(C.columnFilters=v.columnFilters,(g=v.subRows)!=null&&g.length&&m<c){if(C.subRows=u(v.subRows,m+1),v=C,t(v)&&!C.subRows.length){y.push(v),i[v.id]=v,s.push(v);continue}if(t(v)||C.subRows.length){y.push(v),i[v.id]=v,s.push(v);continue}}else v=C,t(v)&&(y.push(v),i[v.id]=v,s.push(v))}return y};return{rows:u(e),flatRows:s,rowsById:i}}function Ree(e,t,n){var r;const s=[],i={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(f,m){m===void 0&&(m=0);const y=[];for(let x=0;x<f.length;x++){let v=f[x];if(t(v)){var g;if((g=v.subRows)!=null&&g.length&&m<c){const b=f2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);b.subRows=u(v.subRows,m+1),v=b}y.push(v),s.push(v),i[v.id]=v}}return y};return{rows:u(e),flatRows:s,rowsById:i}}function yd(){return e=>lt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let x=0;x<t.flatRows.length;x++)t.flatRows[x].columnFilters={},t.flatRows[x].columnFiltersMeta={};return t}const s=[],i=[];(n??[]).forEach(x=>{var v;const C=e.getColumn(x.id);if(!C)return;const b=C.getFilterFn();b&&s.push({id:x.id,filterFn:b,resolvedValue:(v=b.resolveFilterValue==null?void 0:b.resolveFilterValue(x.value))!=null?v:x.value})});const c=(n??[]).map(x=>x.id),u=e.getGlobalFilterFn(),f=e.getAllLeafColumns().filter(x=>x.getCanGlobalFilter());r&&u&&f.length&&(c.push("__global__"),f.forEach(x=>{var v;i.push({id:x.id,filterFn:u,resolvedValue:(v=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?v:r})}));let m,y;for(let x=0;x<t.flatRows.length;x++){const v=t.flatRows[x];if(v.columnFilters={},s.length)for(let C=0;C<s.length;C++){m=s[C];const b=m.id;v.columnFilters[b]=m.filterFn(v,b,m.resolvedValue,w=>{v.columnFiltersMeta[b]=w})}if(i.length){for(let C=0;C<i.length;C++){y=i[C];const b=y.id;if(y.filterFn(v,b,y.resolvedValue,w=>{v.columnFiltersMeta[b]=w})){v.columnFilters.__global__=!0;break}}v.columnFilters.__global__!==!0&&(v.columnFilters.__global__=!1)}}const g=x=>{for(let v=0;v<c.length;v++)if(x.columnFilters[c[v]]===!1)return!1;return!0};return wee(t.rows,g,e)},ct(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Hh(e){return t=>lt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:s,pageIndex:i}=n;let{rows:c,flatRows:u,rowsById:f}=r;const m=s*i,y=m+s;c=c.slice(m,y);let g;t.options.paginateExpandedRows?g={rows:c,flatRows:u,rowsById:f}:g=Cee({rows:c,flatRows:u,rowsById:f}),g.flatRows=[];const x=v=>{g.flatRows.push(v),v.subRows.length&&v.subRows.forEach(x)};return g.rows.forEach(x),g},ct(t.options,"debugTable"))}function Dc(){return e=>lt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],i=r.filter(f=>{var m;return(m=e.getColumn(f.id))==null?void 0:m.getCanSort()}),c={};i.forEach(f=>{const m=e.getColumn(f.id);m&&(c[f.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const u=f=>{const m=f.map(y=>({...y}));return m.sort((y,g)=>{for(let v=0;v<i.length;v+=1){var x;const C=i[v],b=c[C.id],w=b.sortUndefined,R=(x=C==null?void 0:C.desc)!=null?x:!1;let j=0;if(w){const _=y.getValue(C.id),D=g.getValue(C.id),O=_===void 0,A=D===void 0;if(O||A){if(w==="first")return O?-1:1;if(w==="last")return O?1:-1;j=O&&A?0:O?w:-w}}if(j===0&&(j=b.sortingFn(y,g,C.id)),j!==0)return R&&(j*=-1),b.invertSorting&&(j*=-1),j}return y.index-g.index}),m.forEach(y=>{var g;s.push(y),(g=y.subRows)!=null&&g.length&&(y.subRows=u(y.subRows))}),m};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},ct(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
794
|
-
* react-table
|
|
795
|
-
*
|
|
796
|
-
* Copyright (c) TanStack
|
|
797
|
-
*
|
|
798
|
-
* This source code is licensed under the MIT license found in the
|
|
799
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
800
|
-
*
|
|
801
|
-
* @license MIT
|
|
802
|
-
*/function rd(e,t){return e?jee(e)?h.createElement(e,t):e:null}function jee(e){return Tee(e)||typeof e=="function"||_ee(e)}function Tee(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function _ee(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function wl(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=h.useState(()=>({current:See(t)})),[r,s]=h.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function El({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:a.jsx("table",{"data-slot":"table",className:se("w-full caption-bottom text-sm",e),...t})})}function Rl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:se("[&_tr]:border-b",e),...t})}function jl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:se("[&_tr:last-child]:border-0",e),...t})}function Hn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:se("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Tl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:se("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 $r({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:se("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var Nee=Symbol("radix.slottable");function Aee(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Nee,t}var Z5="AlertDialog",[Dee]=Sr(Z5,[g4]),gi=g4(),Y5=e=>{const{__scopeAlertDialog:t,...n}=e,r=gi(t);return a.jsx(ry,{...r,...n,modal:!0})};Y5.displayName=Z5;var Oee="AlertDialogTrigger",Iee=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=gi(n);return a.jsx(T$,{...s,...r,ref:t})});Iee.displayName=Oee;var Mee="AlertDialogPortal",W5=e=>{const{__scopeAlertDialog:t,...n}=e,r=gi(t);return a.jsx(ay,{...r,...n})};W5.displayName=Mee;var kee="AlertDialogOverlay",X5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=gi(n);return a.jsx(sy,{...s,...r,ref:t})});X5.displayName=kee;var Vu="AlertDialogContent",[Lee,Pee]=Dee(Vu),Uee=Aee("AlertDialogContent"),Q5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=gi(n),c=h.useRef(null),u=ht(t,c),f=h.useRef(null);return a.jsx(w$,{contentName:Vu,titleName:J5,docsSlug:"alert-dialog",children:a.jsx(Lee,{scope:n,cancelRef:f,children:a.jsxs(oy,{role:"alertdialog",...i,...s,ref:u,onOpenAutoFocus:Me(s.onOpenAutoFocus,m=>{var y;m.preventDefault(),(y=f.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[a.jsx(Uee,{children:r}),a.jsx(Fee,{contentRef:c})]})})})});Q5.displayName=Vu;var J5="AlertDialogTitle",eO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=gi(n);return a.jsx(xS,{...s,...r,ref:t})});eO.displayName=J5;var tO="AlertDialogDescription",nO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=gi(n);return a.jsx(vS,{...s,...r,ref:t})});nO.displayName=tO;var zee="AlertDialogAction",rO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=gi(n);return a.jsx(iy,{...s,...r,ref:t})});rO.displayName=zee;var aO="AlertDialogCancel",sO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=Pee(aO,n),i=gi(n),c=ht(t,s);return a.jsx(iy,{...i,...r,ref:c})});sO.displayName=aO;var Fee=({contentRef:e})=>{const t=`\`${Vu}\` requires a description for the component to be accessible for screen reader users.
|
|
803
|
-
|
|
804
|
-
You can add a description to the \`${Vu}\` by passing a \`${tO}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
805
|
-
|
|
806
|
-
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 \`${Vu}\`. 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.
|
|
807
|
-
|
|
808
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Hee=Y5,$ee=W5,Vee=X5,Gee=Q5,Bee=rO,qee=sO,Kee=eO,Zee=nO;function oO({...e}){return a.jsx(Hee,{"data-slot":"alert-dialog",...e})}function Yee({...e}){return a.jsx($ee,{"data-slot":"alert-dialog-portal",...e})}function Wee({className:e,...t}){return a.jsx(Vee,{"data-slot":"alert-dialog-overlay",className:se("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 iO({className:e,...t}){return a.jsxs(Yee,{children:[a.jsx(Wee,{}),a.jsx(Gee,{"data-slot":"alert-dialog-content",className:se("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 lO({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-header",className:se("flex flex-col gap-2 text-center sm:text-left",e),...t})}function cO({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-footer",className:se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function uO({className:e,...t}){return a.jsx(Kee,{"data-slot":"alert-dialog-title",className:se("text-lg font-semibold",e),...t})}function dO({className:e,...t}){return a.jsx(Zee,{"data-slot":"alert-dialog-description",className:se("text-muted-foreground text-sm",e),...t})}function fO({className:e,...t}){return a.jsx(Bee,{className:se(hS(),e),...t})}function hO({className:e,...t}){return a.jsx(qee,{className:se(hS({variant:"outline"}),e),...t})}const mO=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],pO={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:Ve.CONNECTOR,icon:PZ},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:Ve.CONNECTOR,icon:UZ},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:Ve.CONNECTOR,icon:zZ},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:Ve.CONNECTOR,icon:FZ},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:Ve.CONNECTOR,icon:dS},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:Ve.SQL,icon:uS},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:rg}},A_=mO.map(e=>({key:e,...pO[e]}));function Xee(e){if(!e||!mO.includes(e))return;const t=e;return{key:t,...pO[t]}}function Qee({children:e,className:t="",...n}){return a.jsx("div",{className:"dm-card",children:a.jsx("div",{className:se("-m-4 flex flex-col items-start justify-between gap-12 overflow-hidden px-8 py-16 lg:flex-row-reverse lg:px-16 lg:py-24 2xl:items-center",t),...n,children:e})})}function Jee({children:e,className:t="",...n}){return a.jsx("div",{className:se("pb-2",t),...n,children:e})}function ete({children:e,className:t="",...n}){return a.jsx("h2",{className:se("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function tte({children:e,className:t="",...n}){return a.jsx("p",{className:se("text-muted-foreground text-lg",t),...n,children:e})}function nte({children:e,rings:t=7,className:n="",...r}){return a.jsxs("div",{className:se("relative flex w-full justify-center lg:w-[30%] 2xl:w-[35%]",n),...r,children:[a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:Array.from({length:t},(s,i)=>{const c=`${(16*(i+1)+24).toString()}vmin`;return a.jsx("div",{className:"animate-ring-pulse",style:{height:c,width:c,animationDelay:`${(i*.3).toString()}s`,animationDuration:"4s",opacity:.2+i*.1,filter:i===0?"blur(1px)":"none"}},i)})}),a.jsx("div",{className:"animate-glow-burst"}),a.jsx("div",{className:"animate-icon-entrance","aria-label":"Illustration",children:e})]})}function rte({children:e,className:t="",...n}){return a.jsx("div",{className:se("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function a1({separator:e=!0,children:t,className:n="",...r}){return a.jsx("section",{className:se("relative pb-10",e&&"after:from-border after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-gradient-to-r after:to-transparent",n),...r,children:t})}function D_({children:e,className:t="",...n}){return a.jsx("h3",{className:se("mb-4 text-xl font-medium",t),...n,children:e})}function s1({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-wrap items-center gap-4",t),...n,children:e})}function _p({href:e,icon:t,title:n,variant:r="outline",size:s,className:i="",target:c,...u}){const f=r==="outline"?"lg":"sm",m=a.jsxs("span",{className:se("flex items-center gap-2"),children:[t,n]});return e?a.jsx(we,{asChild:!0,variant:r,size:s??f,className:se(r==="ghost"?"text-muted-foreground":"",i),...u,children:a.jsx(Wr,{to:e,target:c,children:m})}):a.jsx(we,{variant:r,size:s??f,className:i,...u,children:m})}function ate(){const{scope:e}=pi(),t=A_.filter(r=>r.definitionType===Ve.CONNECTOR),n=A_.filter(r=>r.definitionType!==Ve.CONNECTOR);return a.jsxs(Qee,{children:[a.jsx(nte,{children:a.jsx(LZ,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),a.jsxs(rte,{children:[a.jsxs(Jee,{children:[a.jsx(ete,{children:"Let’s Build Your First Data Mart"}),a.jsx(tte,{children:"A Data Mart is the key element of self-service analytics — it provides both control for data analyst and freedom for business users. To get started, connect the source you need or query the data you already have in storage"})]}),a.jsxs(a1,{children:[a.jsx(D_,{children:"Connect a data source"}),a.jsx(s1,{children:t.map(r=>a.jsx(_p,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&a.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key))})]}),a.jsxs(a1,{children:[a.jsx(D_,{children:"Use existing SQL or start from scratch"}),a.jsx(s1,{children:n.map((r,s)=>a.jsxs(a.Fragment,{children:[a.jsx(_p,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&a.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key),s<n.length-1&&a.jsx("span",{className:"text-muted-foreground text-sm",children:"or"})]}))})]}),a.jsx(a1,{separator:!1,children:a.jsxs(s1,{children:[a.jsx(_p,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:a.jsx(HA,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),a.jsx(_p,{href:"https://docs.owox.com/docs/getting-started/core-concepts/?utm_source=owox_data_marts&utm_medium=empty_data_marts_page&utm_campaign=help_buttons",icon:a.jsx(_U,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function ste(){return a.jsx(zr,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const Cu={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},ote={extractColumnIds:e=>e.map(t=>{if(t.id)return t.id;if("accessorKey"in t&&typeof t.accessorKey=="string")return t.accessorKey}).filter(t=>t!==void 0)};function Oc({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=Cu.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=Cu.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:i=Cu.DEFAULT_EXCLUDED_COLUMNS}){const c=h.useMemo(()=>({SORTING:`${t}${Cu.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${Cu.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),u=h.useMemo(()=>ote.extractColumnIds(e),[e]),f=h.useMemo(()=>u.filter(b=>!s.includes(b)),[u,s]),m=h.useCallback(()=>{const b=ps.get(c.SORTING,"json");return b&&Array.isArray(b)&&b.length>0?b:[{id:f.includes(n)?n:f[0]??Cu.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,f,n]),y=h.useCallback(()=>{const b=ps.get(c.COLUMN_VISIBILITY,"json");if(b&&typeof b=="object"&&!Array.isArray(b)){const w={};for(const R of u)i.includes(R)||(w[R]=b[R]);return w}return r},[c.COLUMN_VISIBILITY,u,i,r]),[g,x]=h.useState(m),[v,C]=h.useState(y);return h.useEffect(()=>{g.length>0&&f.includes(g[0].id)&&ps.set(c.SORTING,g)},[g,f,c.SORTING]),h.useEffect(()=>{const b={};for(const w of u){if(i.includes(w))continue;const R=v[w];typeof R=="boolean"&&(b[w]=R)}ps.set(c.COLUMN_VISIBILITY,b)},[v,u,i,c.COLUMN_VISIBILITY]),{sorting:g,setSorting:x,columnVisibility:v,setColumnVisibility:C}}function ite({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var I;const{navigate:i,scope:c}=pi(),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:y}=Oc({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1,createdByUser:!1}}),[g,x]=h.useState([]),[v,C]=h.useState({}),[b,w]=h.useState(!1),[R,j]=h.useState(!1),_="data-mart-empty-state-onboarding-video-shown",{open:D}=QS();h.useEffect(()=>{!s&&t.length===0&&(ps.get(_,"boolean")||(D("video-3-getting-started-with-data-marts"),ps.set(_,!0)))},[s,t.length,D]);const O=async()=>{try{j(!0);const V=T.getSelectedRowModel().rows.map(U=>U.original.id);for(const U of V)await n(U);_n.success(`Successfully deleted ${String(V.length)} data mart${V.length!==1?"s":""}`),C({}),await r()}catch(k){console.error("Error deleting data marts:",k),_n.error("Failed to delete some data marts. Please try again.")}finally{j(!1),w(!1)}},A=Object.keys(v).length>0,T=wl({data:t,columns:[{id:"select",size:40,header:({table:k})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":k.getIsAllRowsSelected(),"data-state":k.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:k.getToggleAllRowsSelectedHandler(),children:k.getIsAllRowsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),cell:({row:k})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":k.getIsSelected(),"data-state":k.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:k.getToggleSelectedHandler(),children:k.getIsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:f,getSortedRowModel:Dc(),onColumnFiltersChange:x,getFilteredRowModel:yd(),onColumnVisibilityChange:y,onRowSelectionChange:C,state:{sorting:u,columnFilters:g,columnVisibility:m,rowSelection:v},enableRowSelection:!0});return s?a.jsx("div",{children:a.jsx(ste,{})}):t.length?a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsxs("div",{className:"dm-card-toolbar-left",children:[A&&a.jsx(we,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{w(!0)},disabled:R,children:a.jsx(es,{className:"h-4 w-4"})}),a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(jc,{className:"dm-card-toolbar-search-icon"}),a.jsx(It,{placeholder:"Search by title",value:(I=T.getColumn("title"))==null?void 0:I.getFilterValue(),onChange:k=>{var V;return(V=T.getColumn("title"))==null?void 0:V.setFilterValue(k.target.value)},className:"dm-card-toolbar-search-input"})]})]}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsx(Wr,{to:c("/data-marts/create"),children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[a.jsx(ma,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:T.getHeaderGroups().map(k=>a.jsx(Hn,{className:"dm-card-table-header-row",children:k.headers.map(V=>a.jsx(Tl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:V.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:V.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(V.getSize())}%`},children:V.isPlaceholder?null:rd(V.column.columnDef.header,V.getContext())},V.id))},k.id))}),a.jsx(jl,{className:"dm-card-table-body",children:T.getRowModel().rows.length?T.getRowModel().rows.map(k=>a.jsx(Hn,{"data-state":k.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:V=>{if(V.target instanceof HTMLElement&&(V.target.closest('[role="checkbox"]')||V.target.closest(".actions-cell")||V.target.closest('[role="menuitem"]')||V.target.closest('[data-state="open"]')))return;const U=k.original.id;i(`/data-marts/${U}/data-setup`)},children:k.getVisibleCells().map(V=>a.jsx($r,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${V.column.id==="actions"?"actions-cell":""} ${V.column.id==="createdAt"?"whitespace-nowrap":""}`,style:V.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:V.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(V.column.getSize())}%`},children:rd(V.column.columnDef.cell,V.getContext())},V.id))},k.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{T.previousPage()},disabled:!T.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{T.nextPage()},disabled:!T.getCanNextPage(),children:"Next"})]}),a.jsx(oO,{open:b,onOpenChange:w,children:a.jsxs(iO,{children:[a.jsxs(lO,{children:[a.jsx(uO,{children:"Are you sure?"}),a.jsxs(dO,{children:["You're about to delete ",Object.keys(v).length," selected data mart",Object.keys(v).length!==1?"s":"",". This action cannot be undone."]})]}),a.jsxs(cO,{children:[a.jsx(hO,{disabled:R,children:"Cancel"}),a.jsx(fO,{onClick:()=>{O()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):a.jsx(ate,{})}function gO({userProjection:e}){const{fullName:t,email:n,avatar:r}=e,s=t??n??"Unknown User",i=YD(t,n);return a.jsxs(Iy,{children:[a.jsx(My,{asChild:!0,children:a.jsxs("div",{className:"mx-1 inline-flex min-w-max items-center gap-1 rounded-full bg-neutral-100 py-1 pr-3 pl-1 dark:bg-neutral-900",children:[a.jsx(ub,{avatar:r,initials:i,displayName:s,size:$u.SMALL}),a.jsx("span",{className:"text-muted-foreground inline text-sm leading-tight","aria-label":s,children:s})]})}),a.jsx(ky,{side:"top",align:"start",className:"w-max p-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ub,{avatar:r,initials:i,displayName:s,size:$u.LARGE}),a.jsxs("div",{className:"grid text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:t??n??"Unknown User"}),n&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]})]})})]})}function g2({...e}){return a.jsx(ry,{"data-slot":"dialog",...e})}function lte({...e}){return a.jsx(ay,{"data-slot":"dialog-portal",...e})}function cte({className:e,...t}){return a.jsx(sy,{"data-slot":"dialog-overlay",className:se("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 y2({className:e,children:t,showCloseButton:n=!0,...r}){return a.jsxs(lte,{"data-slot":"dialog-portal",children:[a.jsx(cte,{}),a.jsxs(oy,{"data-slot":"dialog-content",className:se("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),...r,children:[t,n&&a.jsxs(iy,{"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:[a.jsx(uc,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function x2({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-header",className:se("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ute({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-footer",className:se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function v2({className:e,...t}){return a.jsx(xS,{"data-slot":"dialog-title",className:se("text-lg leading-none font-semibold",e),...t})}function b2({className:e,...t}){return a.jsx(vS,{"data-slot":"dialog-description",className:se("text-muted-foreground text-sm",e),...t})}const dte=Ec("",{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 Gu({className:e,variant:t,...n}){return t==="brand"?a.jsx(we,{variant:"default",className:se(dte({variant:t}),e),...n}):a.jsx(we,{variant:t,className:e,...n})}const br=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:i,onConfirm:c,onCancel:u,variant:f="destructive",children:m})=>{const y=()=>{t(!1),u==null||u()};return a.jsx(g2,{open:e,onOpenChange:t,children:a.jsxs(y2,{children:[a.jsxs(x2,{children:[a.jsx(v2,{children:n}),a.jsx(b2,{children:r})]}),m,a.jsxs(ute,{children:[i&&a.jsx(Gu,{variant:"secondary",onClick:y,children:i}),a.jsx(Gu,{variant:f,onClick:c,children:s})]})]})})},fte=({row:e,onDeleteSuccess:t})=>{const{scope:n}=pi(),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{deleteDataMart:u,refreshList:f}=U5(),m=async()=>{try{await u(e.original.id),s(!1),await f(),t==null||t()}catch(y){console.error("Failed to delete data mart:",y)}};return a.jsxs("div",{className:"text-right",children:[a.jsxs(Cr,{open:i,onOpenChange:c,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{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:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[a.jsx(Ct,{children:a.jsxs(Wr,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[a.jsx(id,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]})}),a.jsx(la,{}),a.jsxs(Ct,{onClick:()=>{s(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),a.jsx(br,{open:r,onOpenChange:s,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 m(),variant:"destructive"})]})},O_={types:{[Ve.SQL]:{type:Ve.SQL,displayName:"SQL",icon:uS},[Ve.TABLE]:{type:Ve.TABLE,displayName:"Table",icon:VA},[Ve.VIEW]:{type:Ve.VIEW,displayName:"View",icon:IU},[Ve.TABLE_PATTERN]:{type:Ve.TABLE_PATTERN,displayName:"Pattern",icon:TP},[Ve.CONNECTOR]:{type:Ve.CONNECTOR,displayName:"Connector",icon:dS}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}};var zn=(e=>(e.TITLE="title",e.DEFINITION_TYPE="definitionType",e.STORAGE_TYPE="storageType",e.STATUS="status",e.TRIGGERS_COUNT="triggersCount",e.REPORTS_COUNT="reportsCount",e.CREATED_AT="createdAt",e.CREATED_BY_USER="createdByUser",e))(zn||{});const Vi={[zn.TITLE]:"Title",[zn.DEFINITION_TYPE]:"Input Source",[zn.STORAGE_TYPE]:"Storage",[zn.STATUS]:"Status",[zn.TRIGGERS_COUNT]:"Triggers",[zn.REPORTS_COUNT]:"Reports",[zn.CREATED_AT]:"Created at",[zn.CREATED_BY_USER]:"Created by"};function xr({column:e,children:t,label:n}){const r=e.getIsSorted(),s=h.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),i=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",u=n??(typeof t=="string"?t:"Column");return a.jsxs(we,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${u} - ${i()}. Click to sort.`,"aria-sort":c(),children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&a.jsx(Yu,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(Ss,{className:"text-foreground h-4 w-4"}),!r&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(Yu,{className:"text-muted-foreground h-4 w-4"})})]})]})}function xd({table:e,getColumnLabel:t}){return a.jsx("div",{className:"text-right",children:a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Er,{align:"end",children:e.getAllColumns().filter(n=>n.getCanHide()&&n.id!=="actions").map(n=>{var s;const r=(t==null?void 0:t(n.id,n))??((s=n.columnDef.meta)==null?void 0:s.title)??n.id;return a.jsx(Ct,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":n.getIsVisible(),"data-state":n.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${r}`,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:()=>{n.toggleVisibility(!n.getIsVisible())},children:n.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:r})]})},n.id)})})]})})}const hte=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:zn.TITLE,size:40,header:({column:n})=>a.jsx(xr,{column:n,children:Vi[zn.TITLE]}),cell:({row:n})=>a.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===Ve.CONNECTOR){const s=n.definition,i=t.find(c=>c.name===s.connector.source.name);return(i==null?void 0:i.displayName)??(i==null?void 0:i.name)??"Unknown"}else{const{displayName:s}=O_.getInfo(r);return s}},id:zn.DEFINITION_TYPE,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:Vi[zn.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case Ve.CONNECTOR:{const s=n.original.definition,i=t.find(c=>c.name===s.connector.source.name);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(i==null?void 0:i.logoBase64)&&a.jsx(Ac,{base64:i.logoBase64,size:18}),(i==null?void 0:i.displayName)??"Unknown"]})}default:{const{displayName:s,icon:i}=O_.getInfo(r);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(i,{className:"h-4 w-4"}),s]})}}}},{accessorKey:zn.STORAGE_TYPE,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:Vi[zn.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:i,icon:c}=Sl.getInfo(r),u=s??i;return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),u]})}},{accessorKey:zn.CREATED_AT,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:Vi[zn.CREATED_AT]}),cell:({row:n})=>{const r=n.getValue("createdAt"),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(r);return a.jsx("div",{className:"text-muted-foreground",children:s})}},{id:zn.CREATED_BY_USER,size:15,accessorFn:n=>{const r=n.createdByUser;return(r==null?void 0:r.fullName)??(r==null?void 0:r.email)},header:({column:n})=>a.jsx(xr,{column:n,children:Vi[zn.CREATED_BY_USER]}),cell:({row:n})=>{const r=n.original.createdByUser;return r?a.jsx(gO,{userProjection:r}):a.jsx("div",{className:"text-muted-foreground",children:"—"})}},{accessorKey:zn.STATUS,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:Vi[zn.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return a.jsx(Uh,{type:jJ(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:zn.TRIGGERS_COUNT,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:Vi[zn.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return a.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:zn.REPORTS_COUNT,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:Vi[zn.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return a.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>a.jsx(xd,{table:n}),cell:({row:n})=>a.jsx(fte,{row:n,onDeleteSuccess:e})}];var yr=(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))(yr||{});const mte={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function pte(e,t){switch(t.type){case yr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case yr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case yr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case yr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case yr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case yr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case yr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case yr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case yr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const yO=h.createContext(void 0);function ad({children:e}){const[t,n]=h.useReducer(pte,mte);return a.jsx(yO.Provider,{value:{state:t,dispatch:n},children:e})}function gte(){const e=h.useContext(yO);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var Os=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(Os||{});class Uf extends bl{constructor(){super("/connectors")}async getAvailableConnectors(){return this.get("/")}async getConnectorSpecification(t){return this.get(`/${t}/specification`)}async getConnectorFields(t){return this.get(`/${t}/fields`)}async exchangeCredentials(t,n){return this.post(`/${t}/oauth/exchange`,n)}async checkOAuthStatus(t,n){return this.get(`/${t}/oauth/status/${n}`)}async getOAuthSettings(t,n){return this.get(`/${t}/oauth/settings?path=${encodeURIComponent(n)}`)}}function xO(e){return e.map(t=>({name:t.name,displayName:t.title??t.name,description:t.description??"",logoBase64:t.logo,docUrl:t.docUrl})).sort((t,n)=>t.displayName.localeCompare(n.displayName))}function Ic(){const{state:e,dispatch:t}=gte(),n=h.useMemo(()=>xO(e.connectors),[e.connectors]),r=h.useCallback(async()=>{t({type:yr.FETCH_CONNECTORS_START});try{const u=await new Uf().getAvailableConnectors();t({type:yr.FETCH_CONNECTORS_SUCCESS,payload:u})}catch(c){const u=c instanceof Error?c.message:"Unknown error";t({type:yr.FETCH_CONNECTORS_ERROR,payload:u}),De({event:"connector_error",category:"Connector",action:"ListError",label:u})}},[t]),s=h.useCallback(async c=>{t({type:yr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new Uf().getConnectorSpecification(c);t({type:yr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:yr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),De({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),i=h.useCallback(async c=>{t({type:yr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new Uf().getConnectorFields(c);t({type:yr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:yr.FETCH_CONNECTOR_FIELDS_ERROR,payload:f}),De({event:"connector_error",category:"Connector",action:"FieldsError",label:c})}},[t]);return{connectors:n,connectorSpecification:e.connectorSpecification,connectorFields:e.connectorFields,loading:e.loading,loadingSpecification:e.loadingSpecification,loadingFields:e.loadingFields,error:e.error,fetchAvailableConnectors:r,fetchConnectorSpecification:s,fetchConnectorFields:i}}const yte=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=U5(),{connectors:i,fetchAvailableConnectors:c}=Ic();return h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t()},[t]),a.jsx(ite,{columns:hte({connectors:i}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function I_(){return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(UX,{children:a.jsx(ad,{children:a.jsx(yte,{})})})})]})}const vO=h.createContext(void 0),Cf=e=>{const t=MJ(e);return{...e,canPublish:t.length===0,validationErrors:t}};var Qa=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(Qa||{}),rh=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(rh||{}),ar=(e=>(e.INTEGER="INTEGER",e.FLOAT="FLOAT",e.NUMERIC="NUMERIC",e.BIGNUMERIC="BIGNUMERIC",e.STRING="STRING",e.BYTES="BYTES",e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.TIME="TIME",e.DATETIME="DATETIME",e.TIMESTAMP="TIMESTAMP",e.GEOGRAPHY="GEOGRAPHY",e.JSON="JSON",e.RECORD="RECORD",e.STRUCT="STRUCT",e.RANGE="RANGE",e.INTERVAL="INTERVAL",e))(ar||{}),S2=(e=>(e.BOOLEAN="BOOLEAN",e.TINYINT="TINYINT",e.SMALLINT="SMALLINT",e.INTEGER="INTEGER",e.BIGINT="BIGINT",e.REAL="REAL",e.FLOAT="FLOAT",e.DOUBLE="DOUBLE",e.DECIMAL="DECIMAL",e.CHAR="CHAR",e.VARCHAR="VARCHAR",e.STRING="STRING",e.BINARY="BINARY",e.VARBINARY="VARBINARY",e.DATE="DATE",e.TIME="TIME",e.TIMESTAMP="TIMESTAMP",e.TIME_WITH_TIME_ZONE="TIME WITH TIME ZONE",e.TIMESTAMP_WITH_TIME_ZONE="TIMESTAMP WITH TIME ZONE",e.INTERVAL_YEAR_TO_MONTH="INTERVAL YEAR TO MONTH",e.INTERVAL_DAY_TO_SECOND="INTERVAL DAY TO SECOND",e.ARRAY="ARRAY",e.MAP="MAP",e.STRUCT="STRUCT",e.ROW="ROW",e.JSON="JSON",e))(S2||{}),C2=(e=>(e.NUMBER="NUMBER",e.DECIMAL="DECIMAL",e.NUMERIC="NUMERIC",e.INT="INT",e.INTEGER="INTEGER",e.BIGINT="BIGINT",e.SMALLINT="SMALLINT",e.TINYINT="TINYINT",e.BYTEINT="BYTEINT",e.FLOAT="FLOAT",e.FLOAT4="FLOAT4",e.FLOAT8="FLOAT8",e.DOUBLE="DOUBLE",e.DOUBLE_PRECISION="DOUBLE PRECISION",e.REAL="REAL",e.VARCHAR="VARCHAR",e.CHAR="CHAR",e.CHARACTER="CHARACTER",e.STRING="STRING",e.TEXT="TEXT",e.BINARY="BINARY",e.VARBINARY="VARBINARY",e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.DATETIME="DATETIME",e.TIME="TIME",e.TIMESTAMP="TIMESTAMP",e.TIMESTAMP_LTZ="TIMESTAMP_LTZ",e.TIMESTAMP_NTZ="TIMESTAMP_NTZ",e.TIMESTAMP_TZ="TIMESTAMP_TZ",e.VARIANT="VARIANT",e.OBJECT="OBJECT",e.ARRAY="ARRAY",e.GEOGRAPHY="GEOGRAPHY",e.GEOMETRY="GEOMETRY",e))(C2||{});const xte=(e,t)=>e!==Ve.CONNECTOR||t===null?!0:t.fields.some(r=>r.status===Qa.CONNECTED),bO={dataMart:null,isLoading:!1,error:null,runs:[]};function vte(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":case"ACTUALIZE_DATA_MART_SCHEMA_START":case"UPDATE_DATA_MART_SCHEMA_START":case"FETCH_DATA_MART_RUNS_START":case"LOAD_MORE_DATA_MART_RUNS_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":case"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS":case"UPDATE_DATA_MART_SCHEMA_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:Cf(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Cf({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Cf({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Cf({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Cf({...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_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:t.payload};case"LOAD_MORE_DATA_MART_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:[...e.runs,...t.payload]};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":case"ACTUALIZE_DATA_MART_SCHEMA_ERROR":case"UPDATE_DATA_MART_SCHEMA_ERROR":case"FETCH_DATA_MART_RUNS_ERROR":case"LOAD_MORE_DATA_MART_RUNS_ERROR":return{...e,isLoading:!1,error:t.payload};case"RESET":return bO;default:return e}}function ws(){const e=h.useContext(vO);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class bte{mapFromDto(t){const n=t.config,r=t.credentials;let s="";return r&&Object.keys(r).length>0&&(s=JSON.stringify(r,null,2)),{id:t.id,title:t.title,type:je.GOOGLE_BIGQUERY,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{serviceAccount:s},config:{projectId:(n==null?void 0:n.projectId)??"",location:(n==null?void 0:n.location)??""}}}mapToUpdateRequest(t){const n={config:{projectId:t.config.projectId,location:t.config.location}};return t.credentials&&(n.credentials={...JSON.parse(t.credentials.serviceAccount)}),n}}class Ste{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:je.AWS_ATHENA,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{accessKeyId:(r==null?void 0:r.accessKeyId)??"",secretAccessKey:(r==null?void 0:r.secretAccessKey)??""},config:{region:(n==null?void 0:n.region)??"",outputBucket:(n==null?void 0:n.outputBucket)??""}}}mapToUpdateRequest(t){const n={config:{region:t.config.region,outputBucket:t.config.outputBucket}};return t.credentials&&(n.credentials={accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}),n}}class Cte{mapFromDto(t){const n=t.config,r=t.credentials,s=r?r.authMethod==="KEY_PAIR"?{authMethod:Ps.KEY_PAIR,username:r.username??"",privateKey:r.privateKey??"",privateKeyPassphrase:r.privateKeyPassphrase}:{authMethod:Ps.PASSWORD,username:r.username??"",password:r.password??""}:void 0;return{id:t.id,title:t.title,type:je.SNOWFLAKE,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:s??{authMethod:Ps.PASSWORD,username:"",password:""},config:n?{account:n.account,warehouse:n.warehouse}:{account:"",warehouse:""}}}mapToUpdateRequest(t){const n={config:{account:t.config.account,warehouse:t.config.warehouse}};if(t.credentials){const r=t.credentials;n.credentials={authMethod:r.authMethod,username:r.username,...r.authMethod===Ps.PASSWORD?{password:r.password}:{privateKey:r.privateKey,privateKeyPassphrase:r.privateKeyPassphrase}}}return n}}const SO={getMapper(e){switch(e){case je.GOOGLE_BIGQUERY:return new bte;case je.AWS_ATHENA:return new Ste;case je.SNOWFLAKE:return new Cte;default:throw new Error(`Unknown storage type: ${e}`)}}};function Wp(e){return SO.getMapper(e.type).mapFromDto(e)}function wte(e){const t=SO.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function Ete(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Rte(e){return{type:e}}let Np=null;async function jte(){if(Np)return Np;const e=await Tte();return Np=xO(e),Np}async function Tte(){return await new Uf().getAvailableConnectors()}async function _te(e){const t=await jte();return t.length===0?null:t.find(r=>r.name===e)??null}function Nte(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function Ate(e){return{sqlQuery:e.sqlQuery}}function Dte(e){return{sqlQuery:e.sqlQuery}}function Ote(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Ite(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Mte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function kte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Lte(e){return{pattern:e.pattern}}function Pte(e){return{pattern:e.pattern}}function Ute(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 zte(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}}}}async function Fte(e,t){if(!e||!t)return null;switch(e){case Ve.SQL:return Dte(t);case Ve.TABLE:return Ite(t);case Ve.VIEW:return kte(t);case Ve.TABLE_PATTERN:return Pte(t);case Ve.CONNECTOR:{const n=zte(t);return n.connector.info=await _te(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function wu(e){const t={id:e.id,title:e.title,description:e.description,status:l5.getInfo(e.status),storage:Wp(e.storage),definitionType:e.definitionType,definition:await Fte(e.definitionType,e.definition),schema:e.schema,connectorState:e.connectorState??null,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,canActualizeSchema:!1,validationErrors:[]};return t.canActualizeSchema=xte(t.definitionType,t.schema),t}function Hte(e){return{id:e.id,title:e.title}}const $te=e=>({id:e.id,status:e.status,createdAt:new Date(e.createdAt),logs:e.logs??[],errors:e.errors??[],definitionRun:e.definitionRun,type:e.type,triggerType:e.runType,startedAt:e.startedAt?new Date(e.startedAt):null,finishedAt:e.finishedAt?new Date(e.finishedAt):null,reportDefinition:e.reportDefinition?e.reportDefinition:null,reportId:e.reportId,insightDefinition:e.insightDefinition??null,insightId:e.insightId,createdByUser:e.createdByUser}),M_=e=>e.runs.map($te);function CO({children:e}){const[t,n]=h.useReducer(vte,bO),r=h.useCallback(async A=>{try{n({type:"FETCH_DATA_MART_START"});const T=await Tn.getDataMartById(A),I=await wu(T);n({type:"FETCH_DATA_MART_SUCCESS",payload:I}),qS({context:I.id,value:I.title})}catch(T){n({type:"FETCH_DATA_MART_ERROR",payload:dn(T)})}},[]),s=h.useCallback(async A=>{try{n({type:"CREATE_DATA_MART_START"});const T=await Tn.createDataMart(A),I=Hte(T);return n({type:"CREATE_DATA_MART_SUCCESS",payload:I}),De({event:"data_mart_created",category:"DataMart",action:"Create",label:I.id,value:I.title}),_t.success("Data Mart created"),I}catch(T){const I=dn(T);throw n({type:"CREATE_DATA_MART_ERROR",payload:I}),De({event:"data_mart_error",category:"DataMart",action:"CreateError",value:A.title,error:I.message}),T}},[]),i=h.useCallback(async(A,T)=>{try{n({type:"UPDATE_DATA_MART_START"});const I=await Tn.updateDataMart(A,T),k=await wu(I);n({type:"UPDATE_DATA_MART_SUCCESS",payload:k}),De({event:"data_mart_updated",category:"DataMart",action:"Update",label:k.id,value:k.title})}catch(I){const k=dn(I);n({type:"UPDATE_DATA_MART_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:A,value:T.title})}},[]),c=h.useCallback(async A=>{try{n({type:"DELETE_DATA_MART_START"}),await Tn.deleteDataMart(A),n({type:"DELETE_DATA_MART_SUCCESS"}),De({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:A}),_t.success("Data Mart deleted")}catch(T){const I=dn(T);n({type:"DELETE_DATA_MART_ERROR",payload:I}),De({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:A,error:I.message})}},[]),u=h.useCallback(async(A,T)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await Tn.updateDataMartTitle(A,T),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:T}),De({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:A,value:T}),_t.success("Title updated")}catch(I){const k=dn(I);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:A,error:k.message})}},[]),f=h.useCallback(async(A,T)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await Tn.updateDataMartDescription(A,T),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:T??""}),De({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription",label:A}),_t.success("Description updated")}catch(I){const k=dn(I);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:A,error:k.message})}},[]),m=h.useCallback(A=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:A})},[]),y=h.useCallback(async(A,T,I)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let k;switch(T){case Ve.SQL:k={definitionType:T,definition:Ate(I)};break;case Ve.TABLE:k={definitionType:T,definition:Ote(I)};break;case Ve.VIEW:k={definitionType:T,definition:Mte(I)};break;case Ve.TABLE_PATTERN:k={definitionType:T,definition:Lte(I)};break;case Ve.CONNECTOR:{const K=I;let G;for(const q of K.connector.source.configuration){const H=q;if(H._copiedFrom){G=H._copiedFrom.dataMartId;break}}k={definitionType:Ve.CONNECTOR,definition:Ute(K),sourceDataMartId:G};break}default:throw new Error(`Unsupported definition type: ${String(T)}`)}const V=await Tn.updateDataMartDefinition(A,k),U=await wu(V);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:T,definition:I}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:U}),De({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:T,context:U.id,value:U.title})}catch(k){const V=dn(k);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:V}),De({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:T,context:A,error:V.message})}},[]),g=h.useCallback(async A=>{try{n({type:"PUBLISH_DATA_MART_START"});const T=await Tn.publishDataMart(A),I=await wu(T);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:I}),_t.success("Data Mart published"),De({event:"data_mart_published",category:"DataMart",action:"Publish",label:I.storage.type,context:I.id,value:I.title,details:I.definitionType??"No definition"})}catch(T){const I=dn(T);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:I}),De({event:"data_mart_error",category:"DataMart",action:"PublishError",label:A,error:I.message}),T}},[]),x=h.useCallback(async(A,T=5,I=0,k)=>{try{k!=null&&k.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const V=await Tn.getDataMartRuns(A,T,I,k!=null&&k.silent?{skipLoadingIndicator:!0}:void 0),U=M_(V);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:U}),U}catch(V){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:dn(V)}),V}},[]),v=h.useCallback(async(A,T,I=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const k=await Tn.getDataMartRuns(A,I,T),V=M_(k);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:V}),De({event:"data_mart_runs_loaded",category:"DataMart",action:"LoadMore",context:A}),V}catch(k){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:dn(k)}),k}},[]),C=h.useCallback(async A=>{const T=_t.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),De({event:"data_mart_run_started",category:"DataMart",action:"Run",label:"Manual",context:A.id}),await Tn.runDataMart(A.id,A.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(I){_t.dismiss(T);const k=dn(I);n({type:"RUN_DATA_MART_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"RunError",label:"Manual",context:A.id,error:k.message})}},[]),b=h.useCallback(async(A,T)=>{try{await Tn.cancelDataMartRun(A,T),await x(A),_t.success("Data Mart run canceled"),De({event:"data_mart_run_canceled",category:"DataMart",action:"CancelRun",label:"Manual"})}catch(I){const k=dn(I);n({type:"RUN_DATA_MART_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"CancelRunError",error:k.message})}},[x]),w=h.useCallback(async(A,T)=>{try{return await Tn.getDataMartRunById(A,T)}catch(I){const k=dn(I);throw De({event:"data_mart_error",category:"DataMart",action:"FetchRunDetailsError",error:k.message}),I}},[]),R=h.useCallback(async A=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const T=await Tn.actualizeDataMartSchema(A),I=await wu(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:I}),_t.success("Output schema actualized"),De({event:"data_mart_schema_actualized",category:"DataMart",action:"ActualizeSchema",label:"Automatic"})}catch(T){const I=dn(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:I}),De({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",error:I.message})}},[]),j=h.useCallback(async(A,T)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const I=await Tn.updateDataMartSchema(A,{schema:T}),k=await wu(I);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:k}),_t.success("Output schema updated"),De({event:"data_mart_schema_updated",category:"DataMart",action:"UpdateSchema",label:"Manual"})}catch(I){const k=dn(I);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",error:k.message})}},[]),_=h.useCallback(()=>{n({type:"RESET"})},[]),D=h.useCallback(()=>t.error?t.error.message:null,[t.error]),O={...t,getDataMart:r,createDataMart:s,updateDataMart:i,deleteDataMart:c,updateDataMartTitle:u,updateDataMartDescription:f,updateDataMartStorage:m,updateDataMartDefinition:y,publishDataMart:g,runDataMart:C,cancelDataMartRun:b,actualizeDataMartSchema:R,updateDataMartSchema:j,getDataMartRuns:x,getDataMartRunById:w,loadMoreDataMartRuns:v,getErrorMessage:D,reset:_};return a.jsx(vO.Provider,{value:O,children:e})}var $h=e=>e.type==="checkbox",ac=e=>e instanceof Date,wa=e=>e==null;const wO=e=>typeof e=="object";var hr=e=>!wa(e)&&!Array.isArray(e)&&wO(e)&&!ac(e),EO=e=>hr(e)&&e.target?$h(e.target)?e.target.checked:e.target.value:e,Vte=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,RO=(e,t)=>e.has(Vte(t)),Gte=e=>{const t=e.constructor&&e.constructor.prototype;return hr(t)&&t.hasOwnProperty("isPrototypeOf")},w2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function gr(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(w2&&(e instanceof Blob||r))&&(n||hr(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!Gte(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=gr(e[s]));else return e;return t}var Uy=e=>/^\w*$/.test(e),Xn=e=>e===void 0,E2=e=>Array.isArray(e)?e.filter(Boolean):[],R2=e=>E2(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pe=(e,t,n)=>{if(!t||!hr(e))return n;const r=(Uy(t)?[t]:R2(t)).reduce((s,i)=>wa(s)?s:s[i],e);return Xn(r)||r===e?Xn(e[t])?n:e[t]:r},Ga=e=>typeof e=="boolean",Sn=(e,t,n)=>{let r=-1;const s=Uy(t)?[t]:R2(t),i=s.length,c=i-1;for(;++r<i;){const u=s[r];let f=n;if(r!==c){const m=e[u];f=hr(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const Ag={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Is={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ko={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},j2=ae.createContext(null);j2.displayName="HookFormContext";const vd=()=>ae.useContext(j2),jO=e=>{const{children:t,...n}=e;return ae.createElement(j2.Provider,{value:n},t)};var TO=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const c=i;return t._proxyFormState[c]!==Is.all&&(t._proxyFormState[c]=!r||Is.all),n&&(n[c]=!0),e[c]}});return s};const T2=typeof window<"u"?ae.useLayoutEffect:ae.useEffect;function _O(e){const t=vd(),{control:n=t.control,disabled:r,name:s,exact:i}=e||{},[c,u]=ae.useState(n._formState),f=ae.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return T2(()=>n._subscribe({name:s,formState:f.current,exact:i,callback:m=>{!r&&u({...n._formState,...m})}}),[s,r,i]),ae.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),ae.useMemo(()=>TO(c,n,f.current,!1),[c,n])}var Za=e=>typeof e=="string",xb=(e,t,n,r,s)=>Za(e)?(r&&t.watch.add(e),Pe(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Pe(n,i))):(r&&(t.watchAll=!0),n),vb=e=>wa(e)||!wO(e);function Ms(e,t,n=new WeakSet){if(vb(e)||vb(t))return Object.is(e,t);if(ac(e)&&ac(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of r){const c=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const u=t[i];if(ac(c)&&ac(u)||hr(c)&&hr(u)||Array.isArray(c)&&Array.isArray(u)?!Ms(c,u,n):!Object.is(c,u))return!1}}return!0}function Bte(e){const t=vd(),{control:n=t.control,name:r,defaultValue:s,disabled:i,exact:c,compute:u}=e||{},f=ae.useRef(s),m=ae.useRef(u),y=ae.useRef(void 0),g=ae.useRef(n),x=ae.useRef(r);m.current=u;const[v,C]=ae.useState(()=>{const D=n._getWatch(r,f.current);return m.current?m.current(D):D}),b=ae.useCallback(D=>{const O=xb(r,n._names,D||n._formValues,!1,f.current);return m.current?m.current(O):O},[n._formValues,n._names,r]),w=ae.useCallback(D=>{if(!i){const O=xb(r,n._names,D||n._formValues,!1,f.current);if(m.current){const A=m.current(O);Ms(A,y.current)||(C(A),y.current=A)}else C(O)}},[n._formValues,n._names,i,r]);T2(()=>((g.current!==n||!Ms(x.current,r))&&(g.current=n,x.current=r,w()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:D=>{w(D.values)}})),[n,c,r,w]),ae.useEffect(()=>n._removeUnmounted());const R=g.current!==n,j=x.current,_=ae.useMemo(()=>{if(i)return null;const D=!R&&!Ms(j,r);return R||D?b():null},[i,R,r,j,b]);return _!==null?_:v}function qte(e){const t=vd(),{name:n,disabled:r,control:s=t.control,shouldUnregister:i,defaultValue:c,exact:u=!0}=e,f=RO(s._names.array,n),m=ae.useMemo(()=>Pe(s._formValues,n,Pe(s._defaultValues,n,c)),[s,n,c]),y=Bte({control:s,name:n,defaultValue:m,exact:u}),g=_O({control:s,name:n,exact:u}),x=ae.useRef(e),v=ae.useRef(void 0),C=ae.useRef(s.register(n,{...e.rules,value:y,...Ga(e.disabled)?{disabled:e.disabled}:{}}));x.current=e;const b=ae.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Pe(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!Pe(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Pe(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Pe(g.validatingFields,n)},error:{enumerable:!0,get:()=>Pe(g.errors,n)}}),[g,n]),w=ae.useCallback(D=>C.current.onChange({target:{value:EO(D),name:n},type:Ag.CHANGE}),[n]),R=ae.useCallback(()=>C.current.onBlur({target:{value:Pe(s._formValues,n),name:n},type:Ag.BLUR}),[n,s._formValues]),j=ae.useCallback(D=>{const O=Pe(s._fields,n);O&&D&&(O._f.ref={focus:()=>D.focus&&D.focus(),select:()=>D.select&&D.select(),setCustomValidity:A=>D.setCustomValidity(A),reportValidity:()=>D.reportValidity()})},[s._fields,n]),_=ae.useMemo(()=>({name:n,value:y,...Ga(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:w,onBlur:R,ref:j}),[n,r,g.disabled,w,R,j,y]);return ae.useEffect(()=>{const D=s._options.shouldUnregister||i,O=v.current;O&&O!==n&&!f&&s.unregister(O),s.register(n,{...x.current.rules,...Ga(x.current.disabled)?{disabled:x.current.disabled}:{}});const A=(T,I)=>{const k=Pe(s._fields,T);k&&k._f&&(k._f.mount=I)};if(A(n,!0),D){const T=gr(Pe(s._options.defaultValues,n,x.current.defaultValue));Sn(s._defaultValues,n,T),Xn(Pe(s._formValues,n))&&Sn(s._formValues,n,T)}return!f&&s.register(n),v.current=n,()=>{(f?D&&!s._state.action:D)?s.unregister(n):A(n,!1)}},[n,s,f,i]),ae.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),ae.useMemo(()=>({field:_,formState:g,fieldState:b}),[_,g,b])}const Kte=e=>e.render(qte(e));var _2=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},zf=e=>Array.isArray(e)?e:[e],k_=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function NO(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],i=t[r];if(s&&hr(s)&&i){const c=NO(s,i);hr(c)&&(n[r]=c)}else e[r]&&(n[r]=i)}return n}var na=e=>hr(e)&&!Object.keys(e).length,N2=e=>e.type==="file",ks=e=>typeof e=="function",Dg=e=>{if(!w2)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},AO=e=>e.type==="select-multiple",A2=e=>e.type==="radio",Zte=e=>A2(e)||$h(e),o1=e=>Dg(e)&&e.isConnected;function Yte(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Xn(e)?r++:e[t[r++]];return e}function Wte(e){for(const t in e)if(e.hasOwnProperty(t)&&!Xn(e[t]))return!1;return!0}function dr(e,t){const n=Array.isArray(t)?t:Uy(t)?[t]:R2(t),r=n.length===1?e:Yte(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(hr(r)&&na(r)||Array.isArray(r)&&Wte(r))&&dr(e,n.slice(0,-1)),e}var Xte=e=>{for(const t in e)if(ks(e[t]))return!0;return!1};function DO(e){return Array.isArray(e)||hr(e)&&!Xte(e)}function bb(e,t={}){for(const n in e){const r=e[n];DO(r)?(t[n]=Array.isArray(r)?[]:{},bb(r,t[n])):Xn(r)||(t[n]=!0)}return t}function Nu(e,t,n){n||(n=bb(t));for(const r in e){const s=e[r];if(DO(s))Xn(t)||vb(n[r])?n[r]=bb(s,Array.isArray(s)?[]:{}):Nu(s,wa(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!Ms(s,i)}}return n}const L_={value:!1,isValid:!1},P_={value:!0,isValid:!0};var OO=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&&!Xn(e[0].attributes.value)?Xn(e[0].value)||e[0].value===""?P_:{value:e[0].value,isValid:!0}:P_:L_}return L_},IO=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Xn(e)?e:t?e===""?NaN:e&&+e:n&&Za(e)?new Date(e):r?r(e):e;const U_={isValid:!1,value:null};var MO=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,U_):U_;function z_(e){const t=e.ref;return N2(t)?t.files:A2(t)?MO(e.refs).value:AO(t)?[...t.selectedOptions].map(({value:n})=>n):$h(t)?OO(e.refs).value:IO(Xn(t.value)?e.ref.value:t.value,e)}var Qte=(e,t,n,r)=>{const s={};for(const i of e){const c=Pe(t,i);c&&Sn(s,i,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Og=e=>e instanceof RegExp,wf=e=>Xn(e)?e:Og(e)?e.source:hr(e)?Og(e.value)?e.value.source:e.value:e,F_=e=>({isOnSubmit:!e||e===Is.onSubmit,isOnBlur:e===Is.onBlur,isOnChange:e===Is.onChange,isOnAll:e===Is.all,isOnTouch:e===Is.onTouched});const H_="AsyncFunction";var Jte=e=>!!e&&!!e.validate&&!!(ks(e.validate)&&e.validate.constructor.name===H_||hr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===H_)),ene=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),$_=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ff=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=Pe(e,s);if(i){const{_f:c,...u}=i;if(c){if(c.refs&&c.refs[0]&&t(c.refs[0],s)&&!r)return!0;if(c.ref&&t(c.ref,c.name)&&!r)return!0;if(Ff(u,t))break}else if(hr(u)&&Ff(u,t))break}}};function V_(e,t,n){const r=Pe(e,n);if(r||Uy(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),c=Pe(t,i),u=Pe(e,i);if(c&&!Array.isArray(c)&&n!==i)return{name:n};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};s.pop()}return{name:n}}var tne=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return na(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(c=>t[c]===(!r||Is.all))},nne=(e,t,n)=>!e||!t||e===t||zf(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),rne=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,ane=(e,t)=>!E2(Pe(e,t)).length&&dr(e,t),sne=(e,t,n)=>{const r=zf(Pe(e,n));return Sn(r,"root",t[n]),Sn(e,n,r),e};function G_(e,t,n="validate"){if(Za(e)||Array.isArray(e)&&e.every(Za)||Ga(e)&&!e)return{type:n,message:Za(e)?e:"",ref:t}}var Eu=e=>hr(e)&&!Og(e)?e:{value:e,message:""},B_=async(e,t,n,r,s,i)=>{const{ref:c,refs:u,required:f,maxLength:m,minLength:y,min:g,max:x,pattern:v,validate:C,name:b,valueAsNumber:w,mount:R}=e._f,j=Pe(n,b);if(!R||t.has(b))return{};const _=u?u[0]:c,D=K=>{s&&_.reportValidity&&(_.setCustomValidity(Ga(K)?"":K||""),_.reportValidity())},O={},A=A2(c),T=$h(c),I=A||T,k=(w||N2(c))&&Xn(c.value)&&Xn(j)||Dg(c)&&c.value===""||j===""||Array.isArray(j)&&!j.length,V=_2.bind(null,b,r,O),U=(K,G,q,H=Ko.maxLength,M=Ko.minLength)=>{const B=K?G:q;O[b]={type:K?H:M,message:B,ref:c,...V(K?H:M,B)}};if(i?!Array.isArray(j)||!j.length:f&&(!I&&(k||wa(j))||Ga(j)&&!j||T&&!OO(u).isValid||A&&!MO(u).isValid)){const{value:K,message:G}=Za(f)?{value:!!f,message:f}:Eu(f);if(K&&(O[b]={type:Ko.required,message:G,ref:_,...V(Ko.required,G)},!r))return D(G),O}if(!k&&(!wa(g)||!wa(x))){let K,G;const q=Eu(x),H=Eu(g);if(!wa(j)&&!isNaN(j)){const M=c.valueAsNumber||j&&+j;wa(q.value)||(K=M>q.value),wa(H.value)||(G=M<H.value)}else{const M=c.valueAsDate||new Date(j),B=ge=>new Date(new Date().toDateString()+" "+ge),$=c.type=="time",re=c.type=="week";Za(q.value)&&j&&(K=$?B(j)>B(q.value):re?j>q.value:M>new Date(q.value)),Za(H.value)&&j&&(G=$?B(j)<B(H.value):re?j<H.value:M<new Date(H.value))}if((K||G)&&(U(!!K,q.message,H.message,Ko.max,Ko.min),!r))return D(O[b].message),O}if((m||y)&&!k&&(Za(j)||i&&Array.isArray(j))){const K=Eu(m),G=Eu(y),q=!wa(K.value)&&j.length>+K.value,H=!wa(G.value)&&j.length<+G.value;if((q||H)&&(U(q,K.message,G.message),!r))return D(O[b].message),O}if(v&&!k&&Za(j)){const{value:K,message:G}=Eu(v);if(Og(K)&&!j.match(K)&&(O[b]={type:Ko.pattern,message:G,ref:c,...V(Ko.pattern,G)},!r))return D(G),O}if(C){if(ks(C)){const K=await C(j,n),G=G_(K,_);if(G&&(O[b]={...G,...V(Ko.validate,G.message)},!r))return D(G.message),O}else if(hr(C)){let K={};for(const G in C){if(!na(K)&&!r)break;const q=G_(await C[G](j,n),_,G);q&&(K={...q,...V(G,q.message)},D(q.message),r&&(O[b]=K))}if(!na(K)&&(O[b]={ref:_,...K},!r))return O}}return D(!0),O};const one={mode:Is.onSubmit,reValidateMode:Is.onChange,shouldFocusError:!0};function ine(e={}){let t={...one,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:ks(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=hr(t.defaultValues)||hr(t.values)?gr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:gr(s),c={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const y={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...y};const x={array:k_(),state:k_()},v=t.criteriaMode===Is.all,C=Y=>ne=>{clearTimeout(m),m=setTimeout(Y,ne)},b=async Y=>{if(!t.disabled&&(y.isValid||g.isValid||Y)){const ne=t.resolver?na((await T()).errors):await k(r,!0);ne!==n.isValid&&x.state.next({isValid:ne})}},w=(Y,ne)=>{!t.disabled&&(y.isValidating||y.validatingFields||g.isValidating||g.validatingFields)&&((Y||Array.from(u.mount)).forEach(ce=>{ce&&(ne?Sn(n.validatingFields,ce,ne):dr(n.validatingFields,ce))}),x.state.next({validatingFields:n.validatingFields,isValidating:!na(n.validatingFields)}))},R=(Y,ne=[],ce,Ie,Re=!0,Te=!0)=>{if(Ie&&ce&&!t.disabled){if(c.action=!0,Te&&Array.isArray(Pe(r,Y))){const $e=ce(Pe(r,Y),Ie.argA,Ie.argB);Re&&Sn(r,Y,$e)}if(Te&&Array.isArray(Pe(n.errors,Y))){const $e=ce(Pe(n.errors,Y),Ie.argA,Ie.argB);Re&&Sn(n.errors,Y,$e),ane(n.errors,Y)}if((y.touchedFields||g.touchedFields)&&Te&&Array.isArray(Pe(n.touchedFields,Y))){const $e=ce(Pe(n.touchedFields,Y),Ie.argA,Ie.argB);Re&&Sn(n.touchedFields,Y,$e)}(y.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Nu(s,i)),x.state.next({name:Y,isDirty:U(Y,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Sn(i,Y,ne)},j=(Y,ne)=>{Sn(n.errors,Y,ne),x.state.next({errors:n.errors})},_=Y=>{n.errors=Y,x.state.next({errors:n.errors,isValid:!1})},D=(Y,ne,ce,Ie)=>{const Re=Pe(r,Y);if(Re){const Te=Pe(i,Y,Xn(ce)?Pe(s,Y):ce);Xn(Te)||Ie&&Ie.defaultChecked||ne?Sn(i,Y,ne?Te:z_(Re._f)):q(Y,Te),c.mount&&!c.action&&b()}},O=(Y,ne,ce,Ie,Re)=>{let Te=!1,$e=!1;const mt={name:Y};if(!t.disabled){if(!ce||Ie){(y.isDirty||g.isDirty)&&($e=n.isDirty,n.isDirty=mt.isDirty=U(),Te=$e!==mt.isDirty);const st=Ms(Pe(s,Y),ne);$e=!!Pe(n.dirtyFields,Y),st?dr(n.dirtyFields,Y):Sn(n.dirtyFields,Y,!0),mt.dirtyFields=n.dirtyFields,Te=Te||(y.dirtyFields||g.dirtyFields)&&$e!==!st}if(ce){const st=Pe(n.touchedFields,Y);st||(Sn(n.touchedFields,Y,ce),mt.touchedFields=n.touchedFields,Te=Te||(y.touchedFields||g.touchedFields)&&st!==ce)}Te&&Re&&x.state.next(mt)}return Te?mt:{}},A=(Y,ne,ce,Ie)=>{const Re=Pe(n.errors,Y),Te=(y.isValid||g.isValid)&&Ga(ne)&&n.isValid!==ne;if(t.delayError&&ce?(f=C(()=>j(Y,ce)),f(t.delayError)):(clearTimeout(m),f=null,ce?Sn(n.errors,Y,ce):dr(n.errors,Y)),(ce?!Ms(Re,ce):Re)||!na(Ie)||Te){const $e={...Ie,...Te&&Ga(ne)?{isValid:ne}:{},errors:n.errors,name:Y};n={...n,...$e},x.state.next($e)}},T=async Y=>{w(Y,!0);const ne=await t.resolver(i,t.context,Qte(Y||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(Y),ne},I=async Y=>{const{errors:ne}=await T(Y);if(Y)for(const ce of Y){const Ie=Pe(ne,ce);Ie?Sn(n.errors,ce,Ie):dr(n.errors,ce)}else n.errors=ne;return ne},k=async(Y,ne,ce={valid:!0})=>{for(const Ie in Y){const Re=Y[Ie];if(Re){const{_f:Te,...$e}=Re;if(Te){const mt=u.array.has(Te.name),st=Re._f&&Jte(Re._f);st&&y.validatingFields&&w([Te.name],!0);const Xt=await B_(Re,u.disabled,i,v,t.shouldUseNativeValidation&&!ne,mt);if(st&&y.validatingFields&&w([Te.name]),Xt[Te.name]&&(ce.valid=!1,ne))break;!ne&&(Pe(Xt,Te.name)?mt?sne(n.errors,Xt,Te.name):Sn(n.errors,Te.name,Xt[Te.name]):dr(n.errors,Te.name))}!na($e)&&await k($e,ne,ce)}}return ce.valid},V=()=>{for(const Y of u.unMount){const ne=Pe(r,Y);ne&&(ne._f.refs?ne._f.refs.every(ce=>!o1(ce)):!o1(ne._f.ref))&&J(Y)}u.unMount=new Set},U=(Y,ne)=>!t.disabled&&(Y&&ne&&Sn(i,Y,ne),!Ms(ge(),s)),K=(Y,ne,ce)=>xb(Y,u,{...c.mount?i:Xn(ne)?s:Za(Y)?{[Y]:ne}:ne},ce,ne),G=Y=>E2(Pe(c.mount?i:s,Y,t.shouldUnregister?Pe(s,Y,[]):[])),q=(Y,ne,ce={})=>{const Ie=Pe(r,Y);let Re=ne;if(Ie){const Te=Ie._f;Te&&(!Te.disabled&&Sn(i,Y,IO(ne,Te)),Re=Dg(Te.ref)&&wa(ne)?"":ne,AO(Te.ref)?[...Te.ref.options].forEach($e=>$e.selected=Re.includes($e.value)):Te.refs?$h(Te.ref)?Te.refs.forEach($e=>{(!$e.defaultChecked||!$e.disabled)&&(Array.isArray(Re)?$e.checked=!!Re.find(mt=>mt===$e.value):$e.checked=Re===$e.value||!!Re)}):Te.refs.forEach($e=>$e.checked=$e.value===Re):N2(Te.ref)?Te.ref.value="":(Te.ref.value=Re,Te.ref.type||x.state.next({name:Y,values:gr(i)})))}(ce.shouldDirty||ce.shouldTouch)&&O(Y,Re,ce.shouldTouch,ce.shouldDirty,!0),ce.shouldValidate&&re(Y)},H=(Y,ne,ce)=>{for(const Ie in ne){if(!ne.hasOwnProperty(Ie))return;const Re=ne[Ie],Te=Y+"."+Ie,$e=Pe(r,Te);(u.array.has(Y)||hr(Re)||$e&&!$e._f)&&!ac(Re)?H(Te,Re,ce):q(Te,Re,ce)}},M=(Y,ne,ce={})=>{const Ie=Pe(r,Y),Re=u.array.has(Y),Te=gr(ne);Sn(i,Y,Te),Re?(x.array.next({name:Y,values:gr(i)}),(y.isDirty||y.dirtyFields||g.isDirty||g.dirtyFields)&&ce.shouldDirty&&x.state.next({name:Y,dirtyFields:Nu(s,i),isDirty:U(Y,Te)})):Ie&&!Ie._f&&!wa(Te)?H(Y,Te,ce):q(Y,Te,ce),$_(Y,u)&&x.state.next({...n,name:Y}),x.state.next({name:c.mount?Y:void 0,values:gr(i)})},B=async Y=>{c.mount=!0;const ne=Y.target;let ce=ne.name,Ie=!0;const Re=Pe(r,ce),Te=st=>{Ie=Number.isNaN(st)||ac(st)&&isNaN(st.getTime())||Ms(st,Pe(i,ce,st))},$e=F_(t.mode),mt=F_(t.reValidateMode);if(Re){let st,Xt;const sr=ne.type?z_(Re._f):EO(Y),$n=Y.type===Ag.BLUR||Y.type===Ag.FOCUS_OUT,Or=!ene(Re._f)&&!t.resolver&&!Pe(n.errors,ce)&&!Re._f.deps||rne($n,Pe(n.touchedFields,ce),n.isSubmitted,mt,$e),Jr=$_(ce,u,$n);Sn(i,ce,sr),$n?(!ne||!ne.readOnly)&&(Re._f.onBlur&&Re._f.onBlur(Y),f&&f(0)):Re._f.onChange&&Re._f.onChange(Y);const fn=O(ce,sr,$n),or=!na(fn)||Jr;if(!$n&&x.state.next({name:ce,type:Y.type,values:gr(i)}),Or)return(y.isValid||g.isValid)&&(t.mode==="onBlur"?$n&&b():$n||b()),or&&x.state.next({name:ce,...Jr?{}:fn});if(!$n&&Jr&&x.state.next({...n}),t.resolver){const{errors:kn}=await T([ce]);if(Te(sr),Ie){const Ws=V_(n.errors,r,ce),Aa=V_(kn,r,Ws.name||ce);st=Aa.error,ce=Aa.name,Xt=na(kn)}}else w([ce],!0),st=(await B_(Re,u.disabled,i,v,t.shouldUseNativeValidation))[ce],w([ce]),Te(sr),Ie&&(st?Xt=!1:(y.isValid||g.isValid)&&(Xt=await k(r,!0)));Ie&&(Re._f.deps&&(!Array.isArray(Re._f.deps)||Re._f.deps.length>0)&&re(Re._f.deps),A(ce,Xt,st,fn))}},$=(Y,ne)=>{if(Pe(n.errors,ne)&&Y.focus)return Y.focus(),1},re=async(Y,ne={})=>{let ce,Ie;const Re=zf(Y);if(t.resolver){const Te=await I(Xn(Y)?Y:Re);ce=na(Te),Ie=Y?!Re.some($e=>Pe(Te,$e)):ce}else Y?(Ie=(await Promise.all(Re.map(async Te=>{const $e=Pe(r,Te);return await k($e&&$e._f?{[Te]:$e}:$e)}))).every(Boolean),!(!Ie&&!n.isValid)&&b()):Ie=ce=await k(r);return x.state.next({...!Za(Y)||(y.isValid||g.isValid)&&ce!==n.isValid?{}:{name:Y},...t.resolver||!Y?{isValid:ce}:{},errors:n.errors}),ne.shouldFocus&&!Ie&&Ff(r,$,Y?Re:u.mount),Ie},ge=(Y,ne)=>{let ce={...c.mount?i:s};return ne&&(ce=NO(ne.dirtyFields?n.dirtyFields:n.touchedFields,ce)),Xn(Y)?ce:Za(Y)?Pe(ce,Y):Y.map(Ie=>Pe(ce,Ie))},P=(Y,ne)=>({invalid:!!Pe((ne||n).errors,Y),isDirty:!!Pe((ne||n).dirtyFields,Y),error:Pe((ne||n).errors,Y),isValidating:!!Pe(n.validatingFields,Y),isTouched:!!Pe((ne||n).touchedFields,Y)}),z=Y=>{Y&&zf(Y).forEach(ne=>dr(n.errors,ne)),x.state.next({errors:Y?n.errors:{}})},F=(Y,ne,ce)=>{const Ie=(Pe(r,Y,{_f:{}})._f||{}).ref,Re=Pe(n.errors,Y)||{},{ref:Te,message:$e,type:mt,...st}=Re;Sn(n.errors,Y,{...st,...ne,ref:Ie}),x.state.next({name:Y,errors:n.errors,isValid:!1}),ce&&ce.shouldFocus&&Ie&&Ie.focus&&Ie.focus()},Z=(Y,ne)=>ks(Y)?x.state.subscribe({next:ce=>"values"in ce&&Y(K(void 0,ne),ce)}):K(Y,ne,!0),Q=Y=>x.state.subscribe({next:ne=>{nne(Y.name,ne.name,Y.exact)&&tne(ne,Y.formState||y,On,Y.reRenderRoot)&&Y.callback({values:{...i},...n,...ne,defaultValues:s})}}).unsubscribe,le=Y=>(c.mount=!0,g={...g,...Y.formState},Q({...Y,formState:g})),J=(Y,ne={})=>{for(const ce of Y?zf(Y):u.mount)u.mount.delete(ce),u.array.delete(ce),ne.keepValue||(dr(r,ce),dr(i,ce)),!ne.keepError&&dr(n.errors,ce),!ne.keepDirty&&dr(n.dirtyFields,ce),!ne.keepTouched&&dr(n.touchedFields,ce),!ne.keepIsValidating&&dr(n.validatingFields,ce),!t.shouldUnregister&&!ne.keepDefaultValue&&dr(s,ce);x.state.next({values:gr(i)}),x.state.next({...n,...ne.keepDirty?{isDirty:U()}:{}}),!ne.keepIsValid&&b()},ie=({disabled:Y,name:ne})=>{(Ga(Y)&&c.mount||Y||u.disabled.has(ne))&&(Y?u.disabled.add(ne):u.disabled.delete(ne))},ye=(Y,ne={})=>{let ce=Pe(r,Y);const Ie=Ga(ne.disabled)||Ga(t.disabled);return Sn(r,Y,{...ce||{},_f:{...ce&&ce._f?ce._f:{ref:{name:Y}},name:Y,mount:!0,...ne}}),u.mount.add(Y),ce?ie({disabled:Ga(ne.disabled)?ne.disabled:t.disabled,name:Y}):D(Y,!0,ne.value),{...Ie?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:wf(ne.min),max:wf(ne.max),minLength:wf(ne.minLength),maxLength:wf(ne.maxLength),pattern:wf(ne.pattern)}:{},name:Y,onChange:B,onBlur:B,ref:Re=>{if(Re){ye(Y,ne),ce=Pe(r,Y);const Te=Xn(Re.value)&&Re.querySelectorAll&&Re.querySelectorAll("input,select,textarea")[0]||Re,$e=Zte(Te),mt=ce._f.refs||[];if($e?mt.find(st=>st===Te):Te===ce._f.ref)return;Sn(r,Y,{_f:{...ce._f,...$e?{refs:[...mt.filter(o1),Te,...Array.isArray(Pe(s,Y))?[{}]:[]],ref:{type:Te.type,name:Y}}:{ref:Te}}}),D(Y,!1,void 0,Te)}else ce=Pe(r,Y,{}),ce._f&&(ce._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(RO(u.array,Y)&&c.action)&&u.unMount.add(Y)}}},Ce=()=>t.shouldFocusError&&Ff(r,$,u.mount),He=Y=>{Ga(Y)&&(x.state.next({disabled:Y}),Ff(r,(ne,ce)=>{const Ie=Pe(r,ce);Ie&&(ne.disabled=Ie._f.disabled||Y,Array.isArray(Ie._f.refs)&&Ie._f.refs.forEach(Re=>{Re.disabled=Ie._f.disabled||Y}))},0,!1))},Ee=(Y,ne)=>async ce=>{let Ie;ce&&(ce.preventDefault&&ce.preventDefault(),ce.persist&&ce.persist());let Re=gr(i);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:Te,values:$e}=await T();n.errors=Te,Re=gr($e)}else await k(r);if(u.disabled.size)for(const Te of u.disabled)dr(Re,Te);if(dr(n.errors,"root"),na(n.errors)){x.state.next({errors:{}});try{await Y(Re,ce)}catch(Te){Ie=Te}}else ne&&await ne({...n.errors},ce),Ce(),setTimeout(Ce);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:na(n.errors)&&!Ie,submitCount:n.submitCount+1,errors:n.errors}),Ie)throw Ie},Ke=(Y,ne={})=>{Pe(r,Y)&&(Xn(ne.defaultValue)?M(Y,gr(Pe(s,Y))):(M(Y,ne.defaultValue),Sn(s,Y,gr(ne.defaultValue))),ne.keepTouched||dr(n.touchedFields,Y),ne.keepDirty||(dr(n.dirtyFields,Y),n.isDirty=ne.defaultValue?U(Y,gr(Pe(s,Y))):U()),ne.keepError||(dr(n.errors,Y),y.isValid&&b()),x.state.next({...n}))},nt=(Y,ne={})=>{const ce=Y?gr(Y):s,Ie=gr(ce),Re=na(Y),Te=Re?s:Ie;if(ne.keepDefaultValues||(s=ce),!ne.keepValues){if(ne.keepDirtyValues){const $e=new Set([...u.mount,...Object.keys(Nu(s,i))]);for(const mt of Array.from($e))Pe(n.dirtyFields,mt)?Sn(Te,mt,Pe(i,mt)):M(mt,Pe(Te,mt))}else{if(w2&&Xn(Y))for(const $e of u.mount){const mt=Pe(r,$e);if(mt&&mt._f){const st=Array.isArray(mt._f.refs)?mt._f.refs[0]:mt._f.ref;if(Dg(st)){const Xt=st.closest("form");if(Xt){Xt.reset();break}}}}if(ne.keepFieldsRef)for(const $e of u.mount)M($e,Pe(Te,$e));else r={}}i=t.shouldUnregister?ne.keepDefaultValues?gr(s):{}:gr(Te),x.array.next({values:{...Te}}),x.state.next({values:{...Te}})}u={mount:ne.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!y.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!t.shouldUnregister&&!na(Te),c.watch=!!t.shouldUnregister,c.action=!1,ne.keepErrors||(n.errors={}),x.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:Re?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!Ms(Y,s)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Re?{}:ne.keepDirtyValues?ne.keepDefaultValues&&i?Nu(s,i):n.dirtyFields:ne.keepDefaultValues&&Y?Nu(s,Y):ne.keepDirty?n.dirtyFields:{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Ft=(Y,ne)=>nt(ks(Y)?Y(i):Y,ne),Pt=(Y,ne={})=>{const ce=Pe(r,Y),Ie=ce&&ce._f;if(Ie){const Re=Ie.refs?Ie.refs[0]:Ie.ref;Re.focus&&(Re.focus(),ne.shouldSelect&&ks(Re.select)&&Re.select())}},On=Y=>{n={...n,...Y}},ke={control:{register:ye,unregister:J,getFieldState:P,handleSubmit:Ee,setError:F,_subscribe:Q,_runSchema:T,_focusError:Ce,_getWatch:K,_getDirty:U,_setValid:b,_setFieldArray:R,_setDisabledField:ie,_setErrors:_,_getFieldArray:G,_reset:nt,_resetDefaultValues:()=>ks(t.defaultValues)&&t.defaultValues().then(Y=>{Ft(Y,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:V,_disableForm:He,_subjects:x,_proxyFormState:y,get _fields(){return r},get _formValues(){return i},get _state(){return c},set _state(Y){c=Y},get _defaultValues(){return s},get _names(){return u},set _names(Y){u=Y},get _formState(){return n},get _options(){return t},set _options(Y){t={...t,...Y}}},subscribe:le,trigger:re,register:ye,handleSubmit:Ee,watch:Z,setValue:M,getValues:ge,reset:Ft,resetField:Ke,clearErrors:z,unregister:J,setError:F,setFocus:Pt,getFieldState:P};return{...ke,formControl:ke}}function To(e={}){const t=ae.useRef(void 0),n=ae.useRef(void 0),[r,s]=ae.useState({isDirty:!1,isValidating:!1,isLoading:ks(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:ks(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!ks(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...u}=ine(e);t.current={...u,formState:r}}const i=t.current.control;return i._options=e,T2(()=>{const c=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(u=>({...u,isReady:!0})),i._formState.isReady=!0,c},[i]),ae.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),ae.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),ae.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),ae.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),ae.useEffect(()=>{if(i._proxyFormState.isDirty){const c=i._getDirty();c!==r.isDirty&&i._subjects.state.next({isDirty:c})}},[i,r.isDirty]),ae.useEffect(()=>{var c;e.values&&!Ms(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((c=i._options.resetOptions)===null||c===void 0)&&c.keepIsValid||i._setValid(),n.current=e.values,s(u=>({...u}))):i._resetDefaultValues()},[i,e.values]),ae.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=TO(r,i),t.current}var lne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cne=lne.reduce((e,t)=>{const n=oS(`Primitive.${t}`),r=h.forwardRef((s,i)=>{const{asChild:c,...u}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),une="Label",kO=h.forwardRef((e,t)=>a.jsx(cne.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));kO.displayName=une;var dne=kO;function Ta({className:e,...t}){return a.jsx(dne,{"data-slot":"label",className:se("flex items-center gap-2 text-sm leading-none font-medium 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 _l=jO,LO=h.createContext({}),Nt=({...e})=>a.jsx(LO.Provider,{value:{name:e.name},children:a.jsx(Kte,{...e})}),Vh=()=>{const e=h.useContext(LO),t=h.useContext(PO),{getFieldState:n}=vd(),r=_O({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},PO=h.createContext({});function xt({className:e="",...t}){const n=h.useId();return a.jsx(PO.Provider,{value:{id:n},children:a.jsx("div",{"data-slot":"form-item",className:se("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",e),...t})})}function yt({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:i,formItemId:c}=Vh();return a.jsxs(Ta,{"data-slot":"form-label","data-error":!!i,className:se("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...s,children:[a.jsx("span",{children:r}),t&&a.jsxs(vt,{...n,children:[a.jsx(bt,{asChild:!0,children:a.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:a.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(St,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function jt({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=Vh();return a.jsx(gh,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function xn({className:e,...t}){const{formDescriptionId:n}=Vh();return a.jsx("div",{"data-slot":"form-description",id:n,className:se("text-muted-foreground text-sm",e),...t})}function Mt({className:e,...t}){const{error:n,formMessageId:r}=Vh(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?a.jsx("p",{"data-slot":"form-message",id:r,className:se("text-destructive text-sm",e),...t,children:s}):null}function Nl({children:e,className:t="",variant:n="default"}){const r=n==="light"?"flex-1 overflow-y-auto":"bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4";return a.jsx("div",{className:r,children:a.jsx("div",{className:se("flex min-h-full flex-col gap-4",t),children:e})})}function Mc({className:e="",children:t,variant:n="default"}){const r=n==="light"?"flex flex-col gap-1.5 pt-4":"flex flex-col gap-1.5 border-t px-4 py-3";return a.jsx("div",{className:se(r,e),children:t})}function Yr({title:e,children:t}){return a.jsxs("section",{className:"mb-4",children:[e&&a.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function fne({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:i="vertical",className:c=""}){const{formItemId:u}=Vh();return a.jsxs("label",{htmlFor:`${u}-${e}`,className:se("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",s&&"cursor-not-allowed opacity-50",i==="horizontal"?"flex-row":"flex-col",n?"bg-muted border-input border-b":"hover:bg-muted border-border bg-transparent",c),children:[a.jsx("input",{type:"radio",id:`${u}-${e}`,value:e,checked:n,onChange:r,disabled:s,className:se("peer border-input ring-offset-background h-4 w-4 rounded-full border","checked:bg-primary checked:border-primary","focus-visible:ring-ring focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50")}),a.jsx("span",{className:se("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function hne({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return a.jsx("div",{tabIndex:-1,className:se(r==="horizontal"?"flex gap-6":"flex flex-col gap-2","border-input rounded-md border bg-transparent px-1 py-1 transition-colors","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]","text-foreground selection:bg-primary selection:text-primary-foreground","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",s),children:e.map(i=>a.jsx(fne,{value:i.value,label:i.label,checked:t===i.value,onChange:c=>n(c.target.value),disabled:i.disabled,orientation:r},i.value))})}const yi=h.forwardRef(({children:e,className:t="",...n},r)=>a.jsx("form",{ref:r,className:se("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));yi.displayName="AppForm";function q_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sb(e){const t=mne(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(gne);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function mne(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=xne(s),u=yne(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pne=Symbol("radix.slottable");function gne(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pne}function yne(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function xne(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function vne(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:w,children:R}=b,j=ae.useRef(null),_=ae.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=Sb(u),m=ae.forwardRef((b,w)=>{const{scope:R,children:j}=b,_=i(u,R),D=ht(w,_.collectionRef);return a.jsx(f,{ref:D,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=Sb(y),v=ae.forwardRef((b,w)=>{const{scope:R,children:j,..._}=b,D=ae.useRef(null),O=ht(w,D),A=i(y,R);return ae.useEffect(()=>(A.itemMap.set(D,{ref:D,..._}),()=>void A.itemMap.delete(D))),a.jsx(x,{[g]:"",ref:O,children:j})});v.displayName=y;function C(b){const w=i(e+"CollectionConsumer",b);return ae.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}function D2(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var bne=[" ","Enter","ArrowUp","ArrowDown"],Sne=[" ","Enter"],xc="Select",[zy,Fy,Cne]=vne(xc),[bd]=Sr(xc,[Cne,Ro]),Hy=Ro(),[wne,Al]=bd(xc),[Ene,Rne]=bd(xc),UO=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:c,defaultValue:u,onValueChange:f,dir:m,name:y,autoComplete:g,disabled:x,required:v,form:C}=e,b=Hy(t),[w,R]=h.useState(null),[j,_]=h.useState(null),[D,O]=h.useState(!1),A=Th(m),[T,I]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:xc}),[k,V]=ia({prop:c,defaultProp:u,onChange:f,caller:xc}),U=h.useRef(null),K=w?C||!!w.closest("form"):!0,[G,q]=h.useState(new Set),H=Array.from(G).map(M=>M.props.value).join(";");return a.jsx(fd,{...b,children:a.jsxs(wne,{required:v,scope:t,trigger:w,onTriggerChange:R,valueNode:j,onValueNodeChange:_,valueNodeHasChildren:D,onValueNodeHasChildrenChange:O,contentId:er(),value:k,onValueChange:V,open:T,onOpenChange:I,dir:A,triggerPointerDownPosRef:U,disabled:x,children:[a.jsx(zy.Provider,{scope:t,children:a.jsx(Ene,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(M=>{q(B=>new Set(B).add(M))},[]),onNativeOptionRemove:h.useCallback(M=>{q(B=>{const $=new Set(B);return $.delete(M),$})},[]),children:n})}),K?a.jsxs(l6,{"aria-hidden":!0,required:v,tabIndex:-1,name:y,autoComplete:g,value:k,onChange:M=>V(M.target.value),disabled:x,form:C,children:[k===void 0?a.jsx("option",{value:""}):null,Array.from(G)]},H):null]})})};UO.displayName=xc;var zO="SelectTrigger",FO=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=Hy(n),c=Al(zO,n),u=c.disabled||r,f=ht(t,c.onTriggerChange),m=Fy(n),y=h.useRef("touch"),[g,x,v]=u6(b=>{const w=m().filter(_=>!_.disabled),R=w.find(_=>_.value===c.value),j=d6(w,b,R);j!==void 0&&c.onValueChange(j.value)}),C=b=>{u||(c.onOpenChange(!0),v()),b&&(c.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return a.jsx(hd,{asChild:!0,...i,children:a.jsx(et.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":c6(c.value)?"":void 0,...s,ref:f,onClick:Me(s.onClick,b=>{b.currentTarget.focus(),y.current!=="mouse"&&C(b)}),onPointerDown:Me(s.onPointerDown,b=>{y.current=b.pointerType;const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(C(b),b.preventDefault())}),onKeyDown:Me(s.onKeyDown,b=>{const w=g.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&x(b.key),!(w&&b.key===" ")&&bne.includes(b.key)&&(C(),b.preventDefault())})})})});FO.displayName=zO;var HO="SelectValue",$O=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:c="",...u}=e,f=Al(HO,n),{onValueNodeHasChildrenChange:m}=f,y=i!==void 0,g=ht(t,f.onValueNodeChange);return Hr(()=>{m(y)},[m,y]),a.jsx(et.span,{...u,ref:g,style:{pointerEvents:"none"},children:c6(f.value)?a.jsx(a.Fragment,{children:c}):i})});$O.displayName=HO;var jne="SelectIcon",VO=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(et.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});VO.displayName=jne;var Tne="SelectPortal",GO=e=>a.jsx(_c,{asChild:!0,...e});GO.displayName=Tne;var vc="SelectContent",BO=h.forwardRef((e,t)=>{const n=Al(vc,e.__scopeSelect),[r,s]=h.useState();if(Hr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Ls.createPortal(a.jsx(qO,{scope:e.__scopeSelect,children:a.jsx(zy.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(KO,{...e,ref:t})});BO.displayName=vc;var Ns=10,[qO,Dl]=bd(vc),_ne="SelectContentImpl",Nne=Sb("SelectContent.RemoveScroll"),KO=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:c,side:u,sideOffset:f,align:m,alignOffset:y,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:C,hideWhenDetached:b,avoidCollisions:w,...R}=e,j=Al(vc,n),[_,D]=h.useState(null),[O,A]=h.useState(null),T=ht(t,J=>D(J)),[I,k]=h.useState(null),[V,U]=h.useState(null),K=Fy(n),[G,q]=h.useState(!1),H=h.useRef(!1);h.useEffect(()=>{if(_)return ty(_)},[_]),Jg();const M=h.useCallback(J=>{const[ie,...ye]=K().map(Ee=>Ee.ref.current),[Ce]=ye.slice(-1),He=document.activeElement;for(const Ee of J)if(Ee===He||(Ee==null||Ee.scrollIntoView({block:"nearest"}),Ee===ie&&O&&(O.scrollTop=0),Ee===Ce&&O&&(O.scrollTop=O.scrollHeight),Ee==null||Ee.focus(),document.activeElement!==He))return},[K,O]),B=h.useCallback(()=>M([I,_]),[M,I,_]);h.useEffect(()=>{G&&B()},[G,B]);const{onOpenChange:$,triggerPointerDownPosRef:re}=j;h.useEffect(()=>{if(_){let J={x:0,y:0};const ie=Ce=>{var He,Ee;J={x:Math.abs(Math.round(Ce.pageX)-(((He=re.current)==null?void 0:He.x)??0)),y:Math.abs(Math.round(Ce.pageY)-(((Ee=re.current)==null?void 0:Ee.y)??0))}},ye=Ce=>{J.x<=10&&J.y<=10?Ce.preventDefault():_.contains(Ce.target)||$(!1),document.removeEventListener("pointermove",ie),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ye,{capture:!0})}}},[_,$,re]),h.useEffect(()=>{const J=()=>$(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[$]);const[ge,P]=u6(J=>{const ie=K().filter(He=>!He.disabled),ye=ie.find(He=>He.ref.current===document.activeElement),Ce=d6(ie,J,ye);Ce&&setTimeout(()=>Ce.ref.current.focus())}),z=h.useCallback((J,ie,ye)=>{const Ce=!H.current&&!ye;(j.value!==void 0&&j.value===ie||Ce)&&(k(J),Ce&&(H.current=!0))},[j.value]),F=h.useCallback(()=>_==null?void 0:_.focus(),[_]),Z=h.useCallback((J,ie,ye)=>{const Ce=!H.current&&!ye;(j.value!==void 0&&j.value===ie||Ce)&&U(J)},[j.value]),Q=r==="popper"?Cb:ZO,le=Q===Cb?{side:u,sideOffset:f,align:m,alignOffset:y,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:C,hideWhenDetached:b,avoidCollisions:w}:{};return a.jsx(qO,{scope:n,content:_,viewport:O,onViewportChange:A,itemRefCallback:z,selectedItem:I,onItemLeave:F,itemTextRefCallback:Z,focusSelectedItem:B,selectedItemText:V,position:r,isPositioned:G,searchRef:ge,children:a.jsx(Sh,{as:Nne,allowPinchZoom:!0,children:a.jsx(bh,{asChild:!0,trapped:j.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Me(s,J=>{var ie;(ie=j.trigger)==null||ie.focus({preventScroll:!0}),J.preventDefault()}),children:a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:a.jsx(Q,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:J=>J.preventDefault(),...R,...le,onPlaced:()=>q(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Me(R.onKeyDown,J=>{const ie=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ie&&J.key.length===1&&P(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ce=K().filter(He=>!He.disabled).map(He=>He.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const He=J.target,Ee=Ce.indexOf(He);Ce=Ce.slice(Ee+1)}setTimeout(()=>M(Ce)),J.preventDefault()}})})})})})})});KO.displayName=_ne;var Ane="SelectItemAlignedPosition",ZO=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Al(vc,n),c=Dl(vc,n),[u,f]=h.useState(null),[m,y]=h.useState(null),g=ht(t,T=>y(T)),x=Fy(n),v=h.useRef(!1),C=h.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:R,focusSelectedItem:j}=c,_=h.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&m&&b&&w&&R){const T=i.trigger.getBoundingClientRect(),I=m.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),V=R.getBoundingClientRect();if(i.dir!=="rtl"){const He=V.left-I.left,Ee=k.left-He,Ke=T.left-Ee,nt=T.width+Ke,Ft=Math.max(nt,I.width),Pt=window.innerWidth-Ns,On=q_(Ee,[Ns,Math.max(Ns,Pt-Ft)]);u.style.minWidth=nt+"px",u.style.left=On+"px"}else{const He=I.right-V.right,Ee=window.innerWidth-k.right-He,Ke=window.innerWidth-T.right-Ee,nt=T.width+Ke,Ft=Math.max(nt,I.width),Pt=window.innerWidth-Ns,On=q_(Ee,[Ns,Math.max(Ns,Pt-Ft)]);u.style.minWidth=nt+"px",u.style.right=On+"px"}const U=x(),K=window.innerHeight-Ns*2,G=b.scrollHeight,q=window.getComputedStyle(m),H=parseInt(q.borderTopWidth,10),M=parseInt(q.paddingTop,10),B=parseInt(q.borderBottomWidth,10),$=parseInt(q.paddingBottom,10),re=H+M+G+$+B,ge=Math.min(w.offsetHeight*5,re),P=window.getComputedStyle(b),z=parseInt(P.paddingTop,10),F=parseInt(P.paddingBottom,10),Z=T.top+T.height/2-Ns,Q=K-Z,le=w.offsetHeight/2,J=w.offsetTop+le,ie=H+M+J,ye=re-ie;if(ie<=Z){const He=U.length>0&&w===U[U.length-1].ref.current;u.style.bottom="0px";const Ee=m.clientHeight-b.offsetTop-b.offsetHeight,Ke=Math.max(Q,le+(He?F:0)+Ee+B),nt=ie+Ke;u.style.height=nt+"px"}else{const He=U.length>0&&w===U[0].ref.current;u.style.top="0px";const Ke=Math.max(Z,H+b.offsetTop+(He?z:0)+le)+ye;u.style.height=Ke+"px",b.scrollTop=ie-Z+b.offsetTop}u.style.margin=`${Ns}px 0`,u.style.minHeight=ge+"px",u.style.maxHeight=K+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[x,i.trigger,i.valueNode,u,m,b,w,R,i.dir,r]);Hr(()=>_(),[_]);const[D,O]=h.useState();Hr(()=>{m&&O(window.getComputedStyle(m).zIndex)},[m]);const A=h.useCallback(T=>{T&&C.current===!0&&(_(),j==null||j(),C.current=!1)},[_,j]);return a.jsx(One,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:a.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:a.jsx(et.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});ZO.displayName=Ane;var Dne="SelectPopperPosition",Cb=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ns,...i}=e,c=Hy(n);return a.jsx(wh,{...c,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})});Cb.displayName=Dne;var[One,O2]=bd(vc,{}),wb="SelectViewport",YO=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Dl(wb,n),c=O2(wb,n),u=ht(t,i.onViewportChange),f=h.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(zy.Slot,{scope:n,children:a.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Me(s.onScroll,m=>{const y=m.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:x}=c;if(x!=null&&x.current&&g){const v=Math.abs(f.current-y.scrollTop);if(v>0){const C=window.innerHeight-Ns*2,b=parseFloat(g.style.minHeight),w=parseFloat(g.style.height),R=Math.max(b,w);if(R<C){const j=R+v,_=Math.min(C,j),D=j-_;g.style.height=_+"px",g.style.bottom==="0px"&&(y.scrollTop=D>0?D:0,g.style.justifyContent="flex-end")}}}f.current=y.scrollTop})})})]})});YO.displayName=wb;var WO="SelectGroup",[Ine,Mne]=bd(WO),XO=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=er();return a.jsx(Ine,{scope:n,id:s,children:a.jsx(et.div,{role:"group","aria-labelledby":s,...r,ref:t})})});XO.displayName=WO;var QO="SelectLabel",kne=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Mne(QO,n);return a.jsx(et.div,{id:s.id,...r,ref:t})});kne.displayName=QO;var Ig="SelectItem",[Lne,JO]=bd(Ig),e6=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...c}=e,u=Al(Ig,n),f=Dl(Ig,n),m=u.value===r,[y,g]=h.useState(i??""),[x,v]=h.useState(!1),C=ht(t,j=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,j,r,s)}),b=er(),w=h.useRef("touch"),R=()=>{s||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(Lne,{scope:n,value:r,disabled:s,textId:b,isSelected:m,onItemTextChange:h.useCallback(j=>{g(_=>_||((j==null?void 0:j.textContent)??"").trim())},[]),children:a.jsx(zy.ItemSlot,{scope:n,value:r,disabled:s,textValue:y,children:a.jsx(et.div,{role:"option","aria-labelledby":b,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:C,onFocus:Me(c.onFocus,()=>v(!0)),onBlur:Me(c.onBlur,()=>v(!1)),onClick:Me(c.onClick,()=>{w.current!=="mouse"&&R()}),onPointerUp:Me(c.onPointerUp,()=>{w.current==="mouse"&&R()}),onPointerDown:Me(c.onPointerDown,j=>{w.current=j.pointerType}),onPointerMove:Me(c.onPointerMove,j=>{var _;w.current=j.pointerType,s?(_=f.onItemLeave)==null||_.call(f):w.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(c.onPointerLeave,j=>{var _;j.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Me(c.onKeyDown,j=>{var D;((D=f.searchRef)==null?void 0:D.current)!==""&&j.key===" "||(Sne.includes(j.key)&&R(),j.key===" "&&j.preventDefault())})})})})});e6.displayName=Ig;var If="SelectItemText",t6=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,c=Al(If,n),u=Dl(If,n),f=JO(If,n),m=Rne(If,n),[y,g]=h.useState(null),x=ht(t,R=>g(R),f.onItemTextChange,R=>{var j;return(j=u.itemTextRefCallback)==null?void 0:j.call(u,R,f.value,f.disabled)}),v=y==null?void 0:y.textContent,C=h.useMemo(()=>a.jsx("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=m;return Hr(()=>(b(C),()=>w(C)),[b,w,C]),a.jsxs(a.Fragment,{children:[a.jsx(et.span,{id:f.textId,...i,ref:x}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Ls.createPortal(i.children,c.valueNode):null]})});t6.displayName=If;var n6="SelectItemIndicator",r6=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return JO(n6,n).isSelected?a.jsx(et.span,{"aria-hidden":!0,...r,ref:t}):null});r6.displayName=n6;var Eb="SelectScrollUpButton",a6=h.forwardRef((e,t)=>{const n=Dl(Eb,e.__scopeSelect),r=O2(Eb,e.__scopeSelect),[s,i]=h.useState(!1),c=ht(t,r.onScrollButtonChange);return Hr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollTop>0;i(m)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(o6,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});a6.displayName=Eb;var Rb="SelectScrollDownButton",s6=h.forwardRef((e,t)=>{const n=Dl(Rb,e.__scopeSelect),r=O2(Rb,e.__scopeSelect),[s,i]=h.useState(!1),c=ht(t,r.onScrollButtonChange);return Hr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollHeight-f.clientHeight,y=Math.ceil(f.scrollTop)<m;i(y)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(o6,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});s6.displayName=Rb;var o6=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Dl("SelectScrollButton",n),c=h.useRef(null),u=Fy(n),f=h.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return h.useEffect(()=>()=>f(),[f]),Hr(()=>{var y;const m=u().find(g=>g.ref.current===document.activeElement);(y=m==null?void 0:m.ref.current)==null||y.scrollIntoView({block:"nearest"})},[u]),a.jsx(et.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Me(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Me(s.onPointerMove,()=>{var m;(m=i.onItemLeave)==null||m.call(i),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Me(s.onPointerLeave,()=>{f()})})}),Pne="SelectSeparator",i6=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(et.div,{"aria-hidden":!0,...r,ref:t})});i6.displayName=Pne;var jb="SelectArrow",Une=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Hy(n),i=Al(jb,n),c=Dl(jb,n);return i.open&&c.position==="popper"?a.jsx(Eh,{...s,...r,ref:t}):null});Une.displayName=jb;var zne="SelectBubbleInput",l6=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=h.useRef(null),i=ht(r,s),c=D2(t);return h.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLSelectElement.prototype,y=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&y){const g=new Event("change",{bubbles:!0});y.call(u,t),u.dispatchEvent(g)}},[c,t]),a.jsx(et.select,{...n,style:{...J4,...n.style},ref:i,defaultValue:t})});l6.displayName=zne;function c6(e){return e===""||e===void 0}function u6(e){const t=Fs(e),n=h.useRef(""),r=h.useRef(0),s=h.useCallback(c=>{const u=n.current+c;t(u),(function f(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function d6(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=Fne(e,Math.max(i,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function Fne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Hne=UO,$ne=FO,Vne=$O,Gne=VO,Bne=GO,qne=BO,Kne=YO,Zne=XO,Yne=e6,Wne=t6,Xne=r6,Qne=a6,Jne=s6,ere=i6;function ua({...e}){return a.jsx(Hne,{"data-slot":"select",...e})}function $y({...e}){return a.jsx(Zne,{"data-slot":"select-group",...e})}function da({...e}){return a.jsx(Vne,{"data-slot":"select-value",...e})}function fa({className:e,size:t="default",children:n,...r}){return a.jsxs($ne,{"data-slot":"select-trigger","data-size":t,className:se("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),...r,children:[n,a.jsx(Gne,{asChild:!0,children:a.jsx(Ss,{className:"size-4 opacity-50"})})]})}function ha({className:e,children:t,position:n="popper",...r}){return a.jsx(Bne,{children:a.jsxs(qne,{"data-slot":"select-content",className:se("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,...r,children:[a.jsx(tre,{}),a.jsx(Kne,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),a.jsx(nre,{})]})})}function Bn({className:e,children:t,...n}){return a.jsxs(Yne,{"data-slot":"select-item",className:se("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:[a.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(Xne,{children:a.jsx(oa,{className:"size-4"})})}),a.jsx(Wne,{children:t})]})}function f6({className:e,...t}){return a.jsx(ere,{"data-slot":"select-separator",className:se("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function tre({className:e,...t}){return a.jsx(Qne,{"data-slot":"select-scroll-up-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Yu,{className:"size-4"})})}function nre({className:e,...t}){return a.jsx(Jne,{"data-slot":"select-scroll-down-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Ss,{className:"size-4"})})}const rre=an({title:Dt().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:Dt().min(1,"Storage is required")});function are(){const{createDataMart:e,isLoading:t,error:n}=ws();return{handleCreate:h.useCallback(async s=>{try{return await e(s)}catch(i){return console.error(i),null}},[e]),isSubmitting:t,serverError:n}}function sre(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:y,getDataMartRuns:g,loadMoreDataMartRuns:x,reset:v,dataMart:C,isLoading:b,error:w,getErrorMessage:R,runs:j}=ws();return h.useEffect(()=>(e?t(e):v(),()=>{v()}),[e,t,v]),{dataMart:C,isLoading:b,error:w,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:y,getDataMartRuns:g,loadMoreDataMartRuns:x,runs:j,getDataMart:t}}const K_=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Pe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Tb=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?K_(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>K_(s,n,e))}},Z_=(e,t)=>{t.shouldUseNativeValidation&&Tb(e,t);const n={};for(const r in e){const s=Pe(t.fields,r),i=Object.assign(e[r]||{},{ref:s&&s.ref});if(ore(t.names||Object.keys(e),r)){const c=Object.assign({},Pe(n,r));Sn(c,"root",i),Sn(n,r,c)}else Sn(n,r,i)}return n},ore=(e,t)=>{const n=Y_(t);return e.some(r=>Y_(r).match(`^${n}\\.\\d+`))};function Y_(e){return e.replace(/\]|\[/g,"")}function h6(e,t,n){function r(u,f){var m;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(m=u._zod).traits??(m.traits=new Set),u._zod.traits.add(e),t(u,f);for(const y in c.prototype)y in u||Object.defineProperty(u,y,{value:c.prototype[y].bind(u)});u._zod.constr=c,u._zod.def=f}const s=(n==null?void 0:n.Parent)??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function c(u){var f;const m=n!=null&&n.Parent?new i:this;r(m,u),(f=m._zod).deferred??(f.deferred=[]);for(const y of m._zod.deferred)y();return m}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:u=>{var f,m;return n!=null&&n.Parent&&u instanceof n.Parent?!0:(m=(f=u==null?void 0:u._zod)==null?void 0:f.traits)==null?void 0:m.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class ire extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const lre={};function m6(e){return lre}function cre(e,t){return typeof t=="bigint"?t.toString():t}const p6=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ap(e){return typeof e=="string"?e:e==null?void 0:e.message}function g6(e,t,n){var s,i,c,u,f,m;const r={...e,path:e.path??[]};if(!e.message){const y=Ap((c=(i=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:i.error)==null?void 0:c.call(i,e))??Ap((u=t==null?void 0:t.error)==null?void 0:u.call(t,e))??Ap((f=n.customError)==null?void 0:f.call(n,e))??Ap((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=y}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const y6=(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,cre,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ure=h6("$ZodError",y6),x6=h6("$ZodError",y6,{Parent:Error}),dre=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},i);if(c instanceof Promise)throw new ire;if(c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>g6(f,i,m6())));throw p6(u,s==null?void 0:s.callee),u}return c.value},fre=dre(x6),hre=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>g6(f,i,m6())));throw p6(u,s==null?void 0:s.callee),u}return c.value},mre=hre(x6);function W_(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function pre(e,t){for(var n={};e.length;){var r=e[0],s=r.code,i=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var u=r.unionErrors[0].errors[0];n[c]={message:u.message,type:u.code}}else n[c]={message:i,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(y){return y.errors.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=_2(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function gre(e,t){for(var n={};e.length;){var r=e[0],s=r.code,i=r.message,c=r.path.join(".");if(!n[c])if(r.code==="invalid_union"&&r.errors.length>0){var u=r.errors[0][0];n[c]={message:u.message,type:u.code}}else n[c]={message:i,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(y){return y.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=_2(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function xi(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,s,i){try{return Promise.resolve(W_(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return i.shouldUseNativeValidation&&Tb({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return Array.isArray(u==null?void 0:u.issues)})(c))return{values:{},errors:Z_(pre(c.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw c}))}catch(c){return Promise.reject(c)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,i){try{return Promise.resolve(W_(function(){return Promise.resolve((n.mode==="sync"?fre:mre)(e,r,t)).then(function(c){return i.shouldUseNativeValidation&&Tb({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return u instanceof ure})(c))return{values:{},errors:Z_(gre(c.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const v6=h.createContext(void 0);function yre(){const e=h.useContext(v6);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var nn=(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))(nn||{});const xre={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function vre(e,t){switch(t.type){case nn.FETCH_STORAGES_START:case nn.FETCH_STORAGE_START:case nn.CREATE_STORAGE_START:case nn.UPDATE_STORAGE_START:return{...e,error:null};case nn.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case nn.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case nn.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case nn.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case nn.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 nn.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case nn.FETCH_STORAGES_ERROR:case nn.FETCH_STORAGE_ERROR:case nn.CREATE_STORAGE_ERROR:case nn.UPDATE_STORAGE_ERROR:case nn.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case nn.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case nn.CLEAR_ERROR:return{...e,error:null};default:return e}}function I2({children:e}){const[t,n]=h.useReducer(vre,xre);return a.jsx(v6.Provider,{value:{state:t,dispatch:n},children:e})}class bre extends bl{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 Ef=new bre;function Vy(){const{state:e,dispatch:t}=yre(),n=h.useCallback(async()=>{t({type:nn.FETCH_STORAGES_START});try{const f=await Ef.getDataStorages();t({type:nn.FETCH_STORAGES_SUCCESS,payload:f.map(Ete)})}catch(f){throw t({type:nn.FETCH_STORAGES_ERROR,payload:dn(f)}),f}},[t]),r=h.useCallback(async f=>{try{const m=await Ef.getDataStorageById(f),y=Wp(m);t({type:nn.FETCH_STORAGE_SUCCESS,payload:y})}catch(m){throw t({type:nn.FETCH_STORAGE_ERROR,payload:dn(m)}),m}},[t]),s=h.useCallback(async f=>{t({type:nn.CREATE_STORAGE_START});try{const m=Rte(f),y=await Ef.createDataStorage(m),g=Wp(y);return t({type:nn.CREATE_STORAGE_SUCCESS,payload:g}),De({event:"data_storage_created",category:"DataStorage",action:"Create",label:g.type,details:g.title}),_t.success("Storage created"),g}catch(m){return t({type:nn.CREATE_STORAGE_ERROR,payload:dn(m)}),null}},[t]),i=h.useCallback(async(f,m)=>{t({type:nn.UPDATE_STORAGE_START});try{const y=wte(m),g=await Ef.updateDataStorage(f,y),x=Wp(g);return t({type:nn.UPDATE_STORAGE_SUCCESS,payload:x}),De({event:"data_storage_updated",category:"DataStorage",action:"Update",label:x.type,context:x.id}),_t.success("Storage updated"),x}catch(y){return t({type:nn.UPDATE_STORAGE_ERROR,payload:dn(y)}),null}},[t]),c=h.useCallback(async f=>{t({type:nn.DELETE_STORAGE_START});try{await Ef.deleteDataStorage(f),t({type:nn.DELETE_STORAGE_SUCCESS,payload:f}),De({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),_t.success("Storage deleted")}catch(m){throw t({type:nn.DELETE_STORAGE_ERROR,payload:dn(m)}),m}},[t]),u=h.useCallback(()=>{t({type:nn.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:s,updateDataStorage:i,deleteDataStorage:c,clearCurrentDataStorage:u}}const b6=({isOpen:e,onClose:t,onSelect:n,isCreatingDataStorage:r})=>{const{trigger:s,isLocked:i}=IW(n,1e3);return a.jsx(g2,{open:e,onOpenChange:t,children:a.jsxs(y2,{className:"sm:max-w-sm",children:[a.jsxs(x2,{children:[a.jsx(v2,{children:"New Storage"}),a.jsx(b2,{children:"Choose the type of storage you want to create"})]}),a.jsx("div",{className:"flex flex-col gap-4 py-4",children:Sl.getAllTypes().map(c=>{const u=c.icon,f=c.status===Qo.ACTIVE;return a.jsxs(we,{variant:"outline",className:"flex px-4 py-6 select-none",onClick:()=>{s(c.type)},disabled:!f||r||i,onDoubleClick:m=>{m.preventDefault()},children:[a.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[a.jsx(u,{size:24}),a.jsx("span",{className:"font-medium",children:c.displayName})]}),!f&&a.jsx(Nr,{variant:"secondary",children:"Coming soon"})]},c.type)})})]})})};function Sre({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=are(),{dataStorages:i,loading:c,fetchDataStorages:u,createDataStorage:f,getDataStorageById:m}=Vy(),[y,g]=h.useState(!1),[x,v]=h.useState(!1);h.useEffect(()=>{u()},[u]);const C=To({resolver:xi(rre),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),b=async j=>{const _=await n(j);_&&t&&t(_)},w=()=>{g(!0)},R=async j=>{v(!0);try{const _=await f(j);_!=null&&_.id&&(await m(_.id),C.setValue("storageId",_.id))}catch(_){console.error("Failed to create storage:",_)}g(!1),v(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(_l,{...C,children:a.jsxs(yi,{onSubmit:j=>{C.handleSubmit(b)(j)},children:[a.jsxs(Nl,{variant:"light",children:[s&&a.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),a.jsx(Nt,{control:C.control,name:"title",render:({field:j})=>a.jsxs(xt,{children:[a.jsx(yt,{children:"Title"}),a.jsx(jt,{children:a.jsx(It,{id:"title",placeholder:"Enter title",...j,disabled:r})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:C.control,name:"storageId",render:({field:j})=>a.jsxs(xt,{children:[a.jsx(yt,{children:"Storage"}),a.jsx(jt,{children:a.jsxs(ua,{onValueChange:_=>{_==="create_new"?w():j.onChange(_)},value:j.value,disabled:r||c,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a storage"})}),a.jsx(ha,{children:a.jsxs($y,{children:[c&&a.jsx(Bn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&i.map(_=>{const D=Sl.getInfo(_.type).icon;return a.jsx(Bn,{value:_.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(D,{size:20}),a.jsx("span",{children:_.title})]})},_.id)}),!c&&i.length>0&&a.jsx(f6,{}),a.jsx(Bn,{value:"create_new",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:a.jsx(ma,{size:20})}),a.jsx("span",{children:"Create new storage"})]})})]})})]})}),a.jsx(Mt,{})]})})]}),a.jsxs(Mc,{variant:"light",children:[a.jsx(we,{type:"submit",children:"Create Data Mart"}),a.jsx(we,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),a.jsx(b6,{isOpen:y,onClose:()=>{g(!1)},onSelect:j=>R(j),isCreatingDataStorage:x})]})}function S6({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[i,c]=h.useState(e),[u,f]=h.useState(!1),m=h.useRef(null);h.useEffect(()=>{c(e)},[e]),h.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${String(m.current.scrollHeight)}px`)},[i]);const y=async()=>{if(i.trim()===""){c(e);return}if(i.trim()!==e)try{f(!0),await t(i.trim())}catch(x){c(e),console.error(x)}finally{f(!1)}},g=x=>{if(x.key==="Enter"&&!x.shiftKey){if(x.preventDefault(),i.trim()===""){_t.error(r),c(e);return}y()}else x.key==="Escape"&&c(e)};return a.jsx("h2",{className:se("m-0 cursor-pointer p-0 hover:opacity-80",n),children:a.jsx(jo,{ref:m,value:i,onChange:x=>{c(x.target.value);const v=x.target;v.style.height="auto",v.style.height=`${String(v.scrollHeight)}px`},onBlur:()=>void y(),onKeyDown:g,className:se("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":u}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:s},disabled:u})})}var tc=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(tc||{}),C6=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(C6||{}),Gy="Tabs",[Cre]=Sr(Gy,[my]),w6=my(),[wre,M2]=Cre(Gy),E6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:c="horizontal",dir:u,activationMode:f="automatic",...m}=e,y=Th(u),[g,x]=ia({prop:r,onChange:s,defaultProp:i??"",caller:Gy});return a.jsx(wre,{scope:n,baseId:er(),value:g,onValueChange:x,orientation:c,dir:y,activationMode:f,children:a.jsx(et.div,{dir:y,"data-orientation":c,...m,ref:t})})});E6.displayName=Gy;var R6="TabsList",j6=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=M2(R6,n),c=w6(n);return a.jsx(g3,{asChild:!0,...c,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(et.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});j6.displayName=R6;var T6="TabsTrigger",_6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,c=M2(T6,n),u=w6(n),f=D6(c.baseId,r),m=O6(c.baseId,r),y=r===c.value;return a.jsx(y3,{asChild:!0,...u,focusable:!s,active:y,children:a.jsx(et.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":m,"data-state":y?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...i,ref:t,onMouseDown:Me(e.onMouseDown,g=>{!s&&g.button===0&&g.ctrlKey===!1?c.onValueChange(r):g.preventDefault()}),onKeyDown:Me(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const g=c.activationMode!=="manual";!y&&!s&&g&&c.onValueChange(r)})})})});_6.displayName=T6;var N6="TabsContent",A6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...c}=e,u=M2(N6,n),f=D6(u.baseId,r),m=O6(u.baseId,r),y=r===u.value,g=h.useRef(y);return h.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),a.jsx(Vr,{present:s||y,children:({present:x})=>a.jsx(et.div,{"data-state":y?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!x,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:x&&i})})});A6.displayName=N6;function D6(e,t){return`${e}-trigger-${t}`}function O6(e,t){return`${e}-content-${t}`}var Ere=E6,Rre=j6,jre=_6,Tre=A6;function k2({className:e,...t}){return a.jsx(Ere,{"data-slot":"tabs",className:se("flex flex-col gap-2",e),...t})}function L2({className:e,...t}){return a.jsx(Rre,{"data-slot":"tabs-list",className:se("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function ah({className:e,...t}){return a.jsx(jre,{"data-slot":"tabs-trigger",className:se("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function _re({className:e,...t}){return a.jsx(Tre,{"data-slot":"tabs-content",className:se("flex-1 outline-none",e),...t})}var By="Collapsible",[Nre,I6]=Sr(By),[Are,P2]=Nre(By),M6=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:c,...u}=e,[f,m]=ia({prop:r,defaultProp:s??!1,onChange:c,caller:By});return a.jsx(Are,{scope:n,disabled:i,contentId:er(),open:f,onOpenToggle:h.useCallback(()=>m(y=>!y),[m]),children:a.jsx(et.div,{"data-state":H2(f),"data-disabled":i?"":void 0,...u,ref:t})})});M6.displayName=By;var k6="CollapsibleTrigger",U2=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=P2(k6,n);return a.jsx(et.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":H2(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Me(e.onClick,s.onOpenToggle)})});U2.displayName=k6;var z2="CollapsibleContent",F2=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=P2(z2,e.__scopeCollapsible);return a.jsx(Vr,{present:n||s.open,children:({present:i})=>a.jsx(Dre,{...r,ref:t,present:i})})});F2.displayName=z2;var Dre=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,c=P2(z2,n),[u,f]=h.useState(r),m=h.useRef(null),y=ht(t,m),g=h.useRef(0),x=g.current,v=h.useRef(0),C=v.current,b=c.open||u,w=h.useRef(b),R=h.useRef(void 0);return h.useEffect(()=>{const j=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(j)},[]),Hr(()=>{const j=m.current;if(j){R.current=R.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const _=j.getBoundingClientRect();g.current=_.height,v.current=_.width,w.current||(j.style.transitionDuration=R.current.transitionDuration,j.style.animationName=R.current.animationName),f(r)}},[c.open,r]),a.jsx(et.div,{"data-state":H2(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!b,...i,ref:y,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...e.style},children:b&&s})});function H2(e){return e?"open":"closed"}var L6=M6,Ore=U2,Ire=F2;const Mre=L6,kre=U2,Lre=F2;function Pre({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function Ure({children:e,className:t="",...n}){return a.jsx("div",{className:se("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:a.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function zre({children:e,className:t="",variant:n="horizontal",...r}){const s=n==="vertical"?"flex flex-col gap-1.5 pt-4":"flex items-center justify-between border-t px-4 py-3";return a.jsx("div",{className:se(s,t),...r,children:e})}function Bi({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step-item",className:se("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",t),...n,children:e})}function Fre({label:e,children:t,className:n="",options:r,value:s,onValueChange:i,required:c=!1,tooltip:u,...f}){return a.jsx("div",{"data-slot":"wizard-step-item-one-of",className:se("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",n),...f,children:a.jsxs(k2,{value:s,onValueChange:i,children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ba,{required:c,tooltip:u,className:"w-full",children:e}),r.length>1&&a.jsx(L2,{children:r.map(m=>a.jsx(ah,{value:m.value,children:m.label},m.value))})]}),t]})})}function P6({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,i]=h.useState(n);return a.jsxs(Mre,{open:s,onOpenChange:i,"data-slot":"wizard-collapsible",className:se("group/collapsible flex flex-col gap-2 py-3",r),children:[a.jsx(kre,{asChild:!0,children:a.jsxs("button",{type:"button",className:se("flex cursor-pointer items-center gap-1"),children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx(_a,{className:se("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),a.jsx(Lre,{className:"data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up overflow-hidden",children:a.jsx("div",{className:"flex flex-col gap-2 pt-2",children:t})})]})}function Ba({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...i}){return a.jsxs(Ta,{"data-slot":"wizard-step-label",className:se("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...i,children:[t?a.jsxs(vt,{...r,children:[a.jsx(bt,{asChild:!0,children:a.jsxs("span",{className:"flex items-center gap-1",children:[e,a.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),a.jsx(St,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):a.jsx("span",{children:e}),n&&a.jsxs(vt,{...r,children:[a.jsx(bt,{asChild:!0,children:a.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:a.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(St,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function al({title:e,children:t,className:n="",...r}){return a.jsxs("section",{"data-slot":"wizard-step-section",className:se("mb-8",n),...r,children:[e&&a.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function ni({icon:e,title:t,subtitle:n,docUrl:r,variant:s="default",className:i,...c}){return s==="compact"?a.jsxs("div",{"data-slot":"wizard-step-hero",className:se("border-border mb-6 flex items-center justify-between gap-4 border-b pb-4",i),...c,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[e&&a.jsx("div",{children:e}),a.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Wr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(si,{className:"h-4 w-4"})]})})]}):a.jsxs("div",{"data-slot":"wizard-step-hero",className:se("mb-6 flex flex-col items-center justify-center text-center",i),...c,children:[e&&a.jsx("div",{className:"mt-6 mb-3",children:e}),a.jsx("h2",{className:"text-xl font-medium",children:t}),n&&a.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&a.jsx(we,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:a.jsxs(Wr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(si,{className:"h-4 w-4"})]})})]})}function ri({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step",className:se("space-y-4",t),...n,children:e})}function Hre({children:e,className:t="",...n}){return a.jsx("div",{className:se("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function $re({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:i,className:c="",...u}){return a.jsxs("div",{className:se("border-border flex items-center gap-4 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",r?"cursor-not-allowed opacity-50 hover:shadow-none":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",n&&!r?"ring-primary border-transparent ring-2 dark:bg-white/8":"",c),onClick:s,onDoubleClick:i,...u,children:[e&&a.jsx("span",{className:"shrink-0",children:e}),r?a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),a.jsx(St,{side:"top",align:"center",children:"Coming soon"})]}):a.jsx("span",{className:"text-sm font-medium",children:t})]})}function U6({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-col gap-0.5 rounded-md border-b bg-white p-2 transition-shadow duration-200 select-none hover:shadow-sm dark:bg-white/4",t),...n,children:e})}function z6({type:e,id:t,name:n,value:r,label:s,checked:i,selected:c=!1,disabled:u=!1,tooltip:f,rightIcon:m,onChange:y,className:g="",...x}){const v=b=>{y&&y(e==="checkbox"?b.target.checked:b.target.value)},C=h.useRef(null);return a.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:b=>{if(u)return;const w=b.target;w.tagName==="INPUT"||w.tagName==="LABEL"||w.closest("label")||C.current&&C.current.click()},className:se("group flex items-center gap-2 rounded-sm px-4 py-3 transition-shadow duration-200 select-none",u?"cursor-not-allowed":"hover:bg-accent cursor-pointer dark:hover:bg-white/4",c?"bg-primary/8 hover:bg-primary/8 dark:bg-white/8 dark:hover:bg-white/8":"",g),children:[a.jsx("input",{ref:C,id:t,type:e,name:n,value:r,checked:i,disabled:u,onChange:v,className:se("text-primary focus:ring-primary border-border cursor-pointer",e==="radio"||e==="checkbox"?"accent-primary dark:accent-primary h-4 w-4":"h-8 w-full rounded-md border px-2"),...x}),s&&a.jsx(Ba,{htmlFor:t,className:se("cursor-pointer",u&&"cursor-not-allowed"),children:s}),(f||m)&&a.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[f&&a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx(Fr,{className:"text-muted-foreground/75 pointer-events-none h-4 w-4 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100","data-tooltip-trigger":!0})}),a.jsx(St,{side:"top",align:"center",children:f})]}),m&&a.jsx("div",{className:"flex items-center",children:m})]})]})}function $2({variant:e="grid",items:t,className:n=""}){const r=t??(e==="grid"?12:6),s=e==="grid"?"grid grid-cols-1 gap-4 md:grid-cols-2":"flex flex-col gap-4";return a.jsx("div",{"data-slot":"wizard-step-loading",className:se(s,n),children:Array.from({length:r}).map((i,c)=>a.jsx(zr,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function X_(e){const t=Vre(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(Bre);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Vre(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=Kre(s),u=qre(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gre=Symbol("radix.slottable");function Bre(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gre}function qre(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Kre(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Zre(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:w,children:R}=b,j=ae.useRef(null),_=ae.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=X_(u),m=ae.forwardRef((b,w)=>{const{scope:R,children:j}=b,_=i(u,R),D=ht(w,_.collectionRef);return a.jsx(f,{ref:D,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=X_(y),v=ae.forwardRef((b,w)=>{const{scope:R,children:j,..._}=b,D=ae.useRef(null),O=ht(w,D),A=i(y,R);return ae.useEffect(()=>(A.itemMap.set(D,{ref:D,..._}),()=>void A.itemMap.delete(D))),a.jsx(x,{[g]:"",ref:O,children:j})});v.displayName=y;function C(b){const w=i(e+"CollectionConsumer",b);return ae.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var Ys="Accordion",Yre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[V2,Wre,Xre]=Zre(Ys),[qy]=Sr(Ys,[Xre,I6]),G2=I6(),F6=ae.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return a.jsx(V2.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?a.jsx(tae,{...i,ref:t}):a.jsx(eae,{...s,ref:t})})});F6.displayName=Ys;var[H6,Qre]=qy(Ys),[$6,Jre]=qy(Ys,{collapsible:!1}),eae=ae.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...c}=e,[u,f]=ia({prop:n,defaultProp:r??"",onChange:s,caller:Ys});return a.jsx(H6,{scope:e.__scopeAccordion,value:ae.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:ae.useCallback(()=>i&&f(""),[i,f]),children:a.jsx($6,{scope:e.__scopeAccordion,collapsible:i,children:a.jsx(V6,{...c,ref:t})})})}),tae=ae.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[c,u]=ia({prop:n,defaultProp:r??[],onChange:s,caller:Ys}),f=ae.useCallback(y=>u((g=[])=>[...g,y]),[u]),m=ae.useCallback(y=>u((g=[])=>g.filter(x=>x!==y)),[u]);return a.jsx(H6,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:m,children:a.jsx($6,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(V6,{...i,ref:t})})})}),[nae,Ky]=qy(Ys),V6=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...c}=e,u=ae.useRef(null),f=ht(u,t),m=Wre(n),g=Th(s)==="ltr",x=Me(e.onKeyDown,v=>{var I;if(!Yre.includes(v.key))return;const C=v.target,b=m().filter(k=>{var V;return!((V=k.ref.current)!=null&&V.disabled)}),w=b.findIndex(k=>k.ref.current===C),R=b.length;if(w===-1)return;v.preventDefault();let j=w;const _=0,D=R-1,O=()=>{j=w+1,j>D&&(j=_)},A=()=>{j=w-1,j<_&&(j=D)};switch(v.key){case"Home":j=_;break;case"End":j=D;break;case"ArrowRight":i==="horizontal"&&(g?O():A());break;case"ArrowDown":i==="vertical"&&O();break;case"ArrowLeft":i==="horizontal"&&(g?A():O());break;case"ArrowUp":i==="vertical"&&A();break}const T=j%R;(I=b[T].ref.current)==null||I.focus()});return a.jsx(nae,{scope:n,disabled:r,direction:s,orientation:i,children:a.jsx(V2.Slot,{scope:n,children:a.jsx(et.div,{...c,"data-orientation":i,ref:f,onKeyDown:r?void 0:x})})})}),Mg="AccordionItem",[rae,B2]=qy(Mg),G6=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,i=Ky(Mg,n),c=Qre(Mg,n),u=G2(n),f=er(),m=r&&c.value.includes(r)||!1,y=i.disabled||e.disabled;return a.jsx(rae,{scope:n,open:m,disabled:y,triggerId:f,children:a.jsx(L6,{"data-orientation":i.orientation,"data-state":W6(m),...u,...s,ref:t,disabled:y,open:m,onOpenChange:g=>{g?c.onItemOpen(r):c.onItemClose(r)}})})});G6.displayName=Mg;var B6="AccordionHeader",q6=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ky(Ys,n),i=B2(B6,n);return a.jsx(et.h3,{"data-orientation":s.orientation,"data-state":W6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});q6.displayName=B6;var _b="AccordionTrigger",K6=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ky(Ys,n),i=B2(_b,n),c=Jre(_b,n),u=G2(n);return a.jsx(V2.ItemSlot,{scope:n,children:a.jsx(Ore,{"aria-disabled":i.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...u,...r,ref:t})})});K6.displayName=_b;var Z6="AccordionContent",Y6=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ky(Ys,n),i=B2(Z6,n),c=G2(n);return a.jsx(Ire,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...c,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Y6.displayName=Z6;function W6(e){return e?"open":"closed"}var aae=F6,sae=G6,oae=q6,iae=K6,lae=Y6;const q2={default:{itemClass:"border-b last:border-b-0",triggerClass:"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",icon:null,chevronClass:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",contentInnerClass:"pt-0 pb-4",headerClass:"flex"},common:{itemClass:"overflow-hidden",triggerClass:"group focus-visible:ring-primary hover:bg-muted [&[data-state=open]]:bg-muted flex items-center gap-1 rounded-sm px-2 py-1 transition-all outline-none focus-visible:ring-2 [&[data-state=open]]:rounded-br-none [&[data-state=open]]:rounded-bl-none [&[data-state=open]]:font-semibold",icon:a.jsx(LA,{className:"size-4 shrink-0","aria-hidden":"true"}),chevronClass:"size-3.5 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down bg-muted overflow-hidden rounded-sm rounded-tl-none py-0 pr-2 pl-7 text-sm",contentInnerClass:"pt-2 pb-4",headerClass:void 0}},X6=h.createContext("default");function Cn({variant:e="default",...t}){return a.jsx(X6.Provider,{value:e,children:a.jsx(aae,{"data-slot":"accordion",...t})})}function K2(e){const t=h.useContext(X6);return e??t??"default"}function Zt({className:e,variant:t,...n}){const r=K2(t),{itemClass:s}=q2[r];return a.jsx(sae,{"data-slot":"accordion-item",className:se(s,e),...n})}function Yt({className:e,children:t,variant:n,...r}){const s=K2(n),{triggerClass:i,icon:c,chevronClass:u,headerClass:f}=q2[s];return a.jsx(oae,{className:f,children:a.jsxs(iae,{"data-slot":"accordion-trigger",className:se(i,e),...r,children:[c,t,a.jsx(Ss,{className:u,"aria-hidden":"true"})]})})}function Wt({className:e,children:t,variant:n,...r}){const s=K2(n),{contentClass:i,contentInnerClass:c}=q2[s];return a.jsx(lae,{"data-slot":"accordion-content",className:se(i,e),...r,children:a.jsx("div",{className:c,children:t})})}function gn({href:e,children:t,className:n,...r}){return a.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:se("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,a.jsx(si,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function Q_(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"connector-state-details",children:[a.jsx(Yt,{children:"What’s connector state?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"The connector state stores internal data between runs and updates automatically with each execution. It’s used to track progress and ensure consistent data processing across runs."}),a.jsx("p",{className:"mb-2",children:"Connector state is available only for connectors that support incremental runs, helping add only new or updated records since the last run without reloading existing data."}),a.jsxs("p",{className:"mb-2",children:["For more details, see the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/?utm_source=owox_data_marts&utm_medium=manual_run_sheet&utm_campaign=tooltip_connector_state",children:"OWOX documentation"}),"."]})]})]})})}function cae({configuration:e,connectorState:t}){const r=((e==null?void 0:e.connector.source.configuration)??[]).map((u,f)=>{const m=u;return typeof m._id=="string"?{id:m._id,index:f}:void 0}).filter(u=>!!u),s=(t==null?void 0:t.states)??[],i=new Map(s.map(u=>[u._id,u])),c=r.map(({id:u,index:f})=>{const m=i.get(u);return m?{state:m,index:f}:void 0}).filter(u=>!!u);return a.jsx(P6,{title:"State Info",children:c.length===0?a.jsxs(xt,{children:[a.jsx(yt,{children:"Connector state"}),a.jsx(jt,{children:a.jsx("div",{className:"bg-muted min-h-[70px] cursor-not-allowed overflow-auto rounded-md px-3 py-2 font-mono text-sm whitespace-pre-wrap opacity-70",children:"No state available"})}),a.jsx(xn,{children:a.jsx(Q_,{})})]}):a.jsx(a.Fragment,{children:c.map(({state:u,index:f})=>{const m=u.at||"",y=m?Ny(T5(m).toISOString()):"—",g=u.state,x=(()=>{try{return JSON.stringify(g,null,2)}catch{return typeof g=="string"?g:'"—"'}})();return a.jsxs(xt,{children:[a.jsx(yt,{tooltip:`Created at ${y}`,children:`Connector state of configuration #${String(f+1)}`}),a.jsx(jt,{children:a.jsx(LD,{value:x,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),a.jsx(xn,{children:a.jsx(Q_,{})})]},u._id)})})})}function uae({configuration:e,onClose:t,onSubmit:n}){const[r,s]=h.useState(new Set),i=h.useId(),c=To({defaultValues:{runType:tc.INCREMENTAL}}),{loading:u,loadingSpecification:f,connectorSpecification:m,fetchConnectorSpecification:y}=Ic(),{dataMart:g}=ws(),x=h.useCallback(async w=>{!r.has(w)&&!f&&(s(R=>new Set(R).add(w)),await y(w))},[r,f,y]);h.useEffect(()=>{e!=null&&e.connector.source.name&&x(e.connector.source.name)},[e,u,x]);const v=w=>{n&&n(w)},C=()=>{t&&t()},b=w=>{if(!w)return"text";switch(w){case Os.DATE:return"date";case Os.NUMBER:return"number";default:return"text"}};return f?a.jsx("div",{children:"Loading..."}):m?a.jsx(_l,{...c,children:a.jsxs(yi,{id:i,noValidate:!0,onSubmit:w=>void c.handleSubmit(v)(w),children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(Nt,{control:c.control,name:"runType",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),a.jsx(jt,{children:a.jsxs(a.Fragment,{children:[a.jsx(hne,{options:[{value:tc.INCREMENTAL,label:"Incremental load"},{value:tc.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:w.value,onChange:w.onChange,orientation:"horizontal"}),a.jsx(xn,{children:c.watch("runType")===tc.MANUAL_BACKFILL?"Reloads all data for a specific time range from the source, replacing existing records for that period. Use when you need to correct or update historical data.":"Adds only new or updated records since the last run, using the current state of your Data Mart as a reference. Ideal for keeping data fresh without reloading what`s already there."})]})})]})}),c.watch("runType")===tc.INCREMENTAL&&a.jsx(cae,{configuration:e,connectorState:(g==null?void 0:g.connectorState)??null})]}),c.watch("runType")===tc.MANUAL_BACKFILL&&a.jsx(Yr,{title:"Run configuration",children:m.filter(w=>{var R;return(R=w.attributes)==null?void 0:R.includes(C6.MANUAL_BACKFILL)}).map(w=>a.jsx(Nt,{control:c.control,name:`data.${w.name}`,render:()=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:w.description,children:w.title??w.name}),a.jsx(jt,{children:a.jsx(It,{id:w.name,placeholder:w.description,type:b(w.requiredType),defaultValue:typeof w.default=="string"||typeof w.default=="number"?w.default.toString():void 0,...c.register(`data.${w.name}`,{required:!0})})}),a.jsx(Mt,{})]},w.name)}))})]}),a.jsxs(Mc,{children:[a.jsx(we,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),a.jsx(we,{type:"button",variant:"outline",onClick:C,children:"Cancel"})]})]})}):a.jsx("div",{children:"No connector specification found"})}function Ol(e,t){h.useEffect(()=>(e?UW(0,600):db(),()=>{db()}),[e,0,600])}function dae({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return Ol(e),a.jsx(ui,{open:e,onOpenChange:t,children:a.jsxs(di,{children:[a.jsx(fi,{children:a.jsx(hi,{children:"Manual Run"})}),a.jsx(uae,{configuration:n,onClose:t,onSubmit:r})]})})}function Q6({children:e,configuration:t,onManualRun:n,open:r}){const[s,i]=h.useState(r??!1),c=()=>{i(!0)},u=m=>{n(m),i(!1)},f=()=>e?a.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return a.jsxs(a.Fragment,{children:[f(),s&&a.jsx(ad,{children:a.jsx(dae,{isOpen:s,onClose:()=>{i(!1)},configuration:t,onSubmit:u})})]})}const fae=1e3;function hae(e,t){const[n,r]=h.useState(!1),[s,i]=h.useState(null),c=h.useRef(null),u=h.useRef(null),f=h.useRef(!0),m=h.useRef(t);m.current=t;const y=h.useCallback(w=>{f.current&&r(w)},[]),g=h.useCallback(w=>{f.current&&i(w)},[]),x=h.useCallback((w,R)=>{const j=w instanceof Error?w.message:"Schema actualization failed";_t.dismiss(R),g(j),y(!1),c.current=null,u.current=null,_t.error(j,{duration:void 0,id:R})},[g,y]),v=h.useCallback(async()=>{var R;const w=c.current;if((R=u.current)==null||R.abort(),w){_t.dismiss(w);try{await Tn.abortSchemaActualizeTrigger(e,w)}catch{}}c.current=null,u.current=null,y(!1)},[e,y]),C=h.useCallback(async(w,R)=>{var _;const j=D=>D===Xa.SUCCESS||D===Xa.ERROR||D===Xa.CANCELLED;for(;!R.aborted&&c.current===w;)try{const D=await Tn.getSchemaActualizeTriggerStatus(e,w);if(j(D)){try{const O=await Tn.getSchemaActualizeTriggerResponse(e,w);if(_t.dismiss(w),O.success)(_=m.current)==null||_.call(m),_t.success("Output schema actualized",{duration:void 0,id:w});else{const A=O.error??"Schema actualization failed";g(A),_t.error(A,{duration:void 0,id:w})}}catch(O){const A=O instanceof Error?O.message:"Schema actualization failed";_t.dismiss(w),g(A),_t.error(A,{duration:void 0,id:w})}y(!1),c.current=null,u.current=null;return}await new Promise(O=>setTimeout(O,fae))}catch(D){x(D,w)}},[e,g,y,x]),b=h.useCallback(async()=>{c.current&&await v(),g(null),y(!0);try{const{triggerId:w}=await Tn.createSchemaActualizeTrigger(e);_t.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:w}),c.current=w;const R=new AbortController;u.current=R;try{await C(w,R.signal)}catch(j){x(j,w)}}catch(w){y(!1),g(w instanceof Error?w.message:"Failed to start schema actualization")}},[e,v,C,g,y,x]);return h.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const w=c.current;(R=u.current)==null||R.abort(),w&&(_t.dismiss(w),Tn.abortSchemaActualizeTrigger(e,w).catch(()=>{})),c.current=null,u.current=null}),[e]),{run:b,isLoading:n,cancel:v,error:s}}function mae({id:e}){const{navigate:t}=pi(),{user:n}=mi(),{flags:r}=md(),{dataMart:s,deleteDataMart:i,updateDataMartTitle:c,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:y,publishDataMart:g,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:C,loadMoreDataMartRuns:b,isLoading:w,error:R,getErrorMessage:j,runs:_,getDataMart:D}=sre(e),[O,A]=h.useState(!1),[T,I]=h.useState(!1),{id:k="",canPublish:V=!1,canActualizeSchema:U=!1,status:K={code:null,displayName:"",description:""},title:G="",definition:q=null,definitionType:H=null,validationErrors:M=[]}=s??{},B=h.useCallback(()=>{k&&D(k)},[k,D]),{run:$,isLoading:re}=hae(k,B),ge=h.useCallback(async()=>{U&&await $()},[U,$]),P=r==null?void 0:r.INSIGHTS_ENABLED_PROJECT_IDS,z=(n==null?void 0:n.projectId)??"",F=z.length>0&&fJ(P??"").includes(z),Z=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},...F?[{name:"Insights",path:"insights"}]:[],{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],Q=h.useCallback(async ie=>{k&&await c(k,ie)},[k,c]),le=h.useCallback(async()=>{if(k){I(!0);try{await g(k),ge()}catch(ie){console.log(ie instanceof Error?ie.message:"Failed to publish Data Mart")}finally{I(!1)}}},[k,g,ge]),J=h.useCallback(async ie=>{if(k){if(K.code!==Ar.PUBLISHED){_n.error("Manual run is only available for published Data Marts");return}await x({id:k,payload:ie})}},[k,K,x]);return s?a.jsxs("div",{className:"px-12 py-6",children:[a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[a.jsx(Gu,{onClick:()=>{t("/data-marts")},variant:"ghost",size:"sm","aria-label":"Back to Data Marts",title:"Back to Data Marts",className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:a.jsx(SP,{className:"h-5 w-5"})}),a.jsx(S6,{title:G,onUpdate:Q,className:"text-2xl font-medium"})]}),a.jsxs("div",{className:"flex items-center gap-2"+(T?" opacity-50":""),style:{minWidth:"120px"},children:[a.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("div",{children:a.jsx(Uh,{type:K.code===Ar.PUBLISHED?Jn.SUCCESS:Jn.NEUTRAL,variant:"subtle",children:K.displayName})})}),a.jsx(St,{children:K.code===Ar.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),K.code===Ar.DRAFT&&a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("div",{children:a.jsxs(Gu,{variant:"default",onClick:()=>{le()},disabled:T||!V,className:"ml-2 flex items-center gap-1",children:[a.jsx(xh,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!V&&a.jsxs(St,{children:[a.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),M.length>0&&a.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:kJ(M).map((ie,ye)=>a.jsx("li",{children:ie},ye))})]})]})]}),a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(Gu,{variant:"ghost",children:a.jsx(IA,{className:"h-5 w-5"})})}),a.jsxs(Er,{align:"end",children:[H===Ve.CONNECTOR&&a.jsxs(a.Fragment,{children:[a.jsx(Q6,{configuration:q??null,onManualRun:ie=>{J({runType:ie.runType,data:ie.data})},children:a.jsxs(Ct,{onClick:ie=>{ie.preventDefault()},children:[a.jsx(Qg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})}),a.jsx(la,{})]}),a.jsxs(Ct,{onClick:()=>{A(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),a.jsx("div",{children:a.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:Z.map(ie=>a.jsx(ph,{to:ie.path,className:({isActive:ye})=>se("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",ye?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:border-gray-200 dark:hover:text-gray-200"),children:ie.name},ie.name))})}),a.jsx("div",{className:"pt-4",children:a.jsx(rS,{context:{dataMart:s,isLoading:w,error:R,getErrorMessage:j,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:y,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:C,loadMoreDataMartRuns:b,runs:_,getDataMart:D,runSchemaActualization:ge,isSchemaActualizationLoading:re}})}),a.jsx(br,{open:O,onOpenChange:A,title:"Delete Data Mart",description:a.jsxs(a.Fragment,{children:["Are you sure you want to delete ",a.jsxs("strong",{children:['"',G,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await i(k),A(!1),t("/data-marts")}catch(ie){console.error("Failed to delete Data Mart:",ie)}})()}})]}):a.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[a.jsx(zr,{className:"h-16 w-full"},0),Array.from({length:3}).map((ie,ye)=>a.jsx(zr,{className:"h-48 w-full"},ye+1))]})}function pae({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:s="100%",minHeight:i="100px"}){const[c,u]=h.useState(e??""),[f,m]=h.useState(!1),[y,g]=h.useState(!1),x=h.useRef(null);h.useEffect(()=>{u(e??"")},[e]),h.useEffect(()=>{if(x.current&&f){x.current.focus();const R=x.current.value.length;x.current.setSelectionRange(R,R),v(x.current)}},[f]);const v=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},C=R=>{u(R.target.value),v(R.target)},b=async()=>{const R=c.trim();if(R===(e??"")){m(!1);return}try{g(!0),await t(R===""?null:R),m(!1)}catch(_){console.error("Failed to update description:",_),u(e??"")}finally{g(!1)}},w=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),b()):R.key==="Escape"&&(R.preventDefault(),u(e??""),m(!1))};return f?a.jsxs("div",{className:"w-full",children:[a.jsx(jo,{ref:x,value:c,onChange:C,onBlur:()=>void b(),onKeyDown:w,placeholder:r,className:se("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":y}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:i,minWidth:s},disabled:y}),a.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Ctrl+Enter"})," ","to save •"," "]}),a.jsxs("span",{children:[a.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Esc"})," ","to cancel •"," "]}),a.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):a.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:a.jsx("div",{onClick:()=>{m(!0)},className:se("min-h-24 cursor-pointer rounded p-2 whitespace-pre-wrap","transition-colors duration-150",!e&&"text-gray-400 italic",n),style:{minWidth:s},children:e??r})})}function gae(){const{dataMart:e,updateDataMartDescription:t}=bs(),n=async r=>{await t(e.id,r)};return a.jsx("div",{children:a.jsx(pae,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function J_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yae(e){if(Array.isArray(e))return e}function xae(e,t,n){return(t=Rae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,c,u=[],f=!0,m=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(f=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(y){m=!0,s=y}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw s}}return u}}function bae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
809
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function tN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eN(Object(n),!0).forEach(function(r){xae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sae(e,t){if(e==null)return{};var n,r,s=Cae(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function Cae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function wae(e,t){return yae(e)||vae(e,t)||jae(e,t)||bae()}function Eae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rae(e){var t=Eae(e,"string");return typeof t=="symbol"?t:t+""}function jae(e,t){if(e){if(typeof e=="string")return J_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J_(e,t):void 0}}function Tae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function rN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nN(Object(n),!0).forEach(function(r){Tae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(s,i){return i(s)},r)}}function Mf(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return t.apply(n,[].concat(s,u))}}}function kg(e){return{}.toString.call(e).includes("Object")}function Nae(e){return!Object.keys(e).length}function sh(e){return typeof e=="function"}function Aae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Dae(e,t){return kg(t)||ll("changeType"),Object.keys(t).some(function(n){return!Aae(e,n)})&&ll("changeField"),t}function Oae(e){sh(e)||ll("selectorType")}function Iae(e){sh(e)||kg(e)||ll("handlerType"),kg(e)&&Object.values(e).some(function(t){return!sh(t)})&&ll("handlersType")}function Mae(e){e||ll("initialIsRequired"),kg(e)||ll("initialType"),Nae(e)&&ll("initialContent")}function kae(e,t){throw new Error(e[t]||e.default)}var Lae={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"},ll=Mf(kae)(Lae),Dp={changes:Dae,selector:Oae,handler:Iae,initial:Mae};function Pae(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Dp.initial(e),Dp.handler(t);var n={current:e},r=Mf(Fae)(n,t),s=Mf(zae)(n),i=Mf(Dp.changes)(e),c=Mf(Uae)(n);function u(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return Dp.selector(m),m(n.current)}function f(m){_ae(r,s,i,c)(m)}return[u,f]}function Uae(e,t){return sh(t)?t(e.current):t}function zae(e,t){return e.current=rN(rN({},e.current),t),t}function Fae(e,t,n){return sh(t)?t(e.current):Object.keys(n).forEach(function(r){var s;return(s=t[r])===null||s===void 0?void 0:s.call(t,e.current[r])}),n}var Hae={create:Pae},$ae={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Vae(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return t.apply(n,[].concat(s,u))}}}function Gae(e){return{}.toString.call(e).includes("Object")}function Bae(e){return e||aN("configIsRequired"),Gae(e)||aN("configType"),e.urls?(qae(),{paths:{vs:e.urls.monacoBase}}):e}function qae(){console.warn(J6.deprecation)}function Kae(e,t){throw new Error(e[t]||e.default)}var J6={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!
|
|
810
|
-
You are using deprecated way of configuration.
|
|
811
|
-
|
|
812
|
-
Instead of using
|
|
813
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
814
|
-
use
|
|
815
|
-
monaco.config({ paths: { vs: '...' } })
|
|
816
|
-
|
|
817
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
818
|
-
`},aN=Vae(Kae)(J6),Zae={config:Bae},Yae=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(i,c){return c(i)},s)}};function eI(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],eI(e[n],t[n]))}),tN(tN({},e),t)}var Wae={type:"cancelation",msg:"operation is manually canceled"};function i1(e){var t=!1,n=new Promise(function(r,s){e.then(function(i){return t?s(Wae):r(i)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var Xae=["monaco"],Qae=Hae.create({config:$ae,isInitialized:!1,resolve:null,reject:null,monaco:null}),tI=wae(Qae,2),Gh=tI[0],Zy=tI[1];function Jae(e){var t=Zae.config(e),n=t.monaco,r=Sae(t,Xae);Zy(function(s){return{config:eI(s.config,r),monaco:n}})}function ese(){var e=Gh(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Zy({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),i1(l1);if(window.monaco&&window.monaco.editor)return nI(window.monaco),e.resolve(window.monaco),i1(l1);Yae(tse,rse)(ase)}return i1(l1)}function tse(e){return document.body.appendChild(e)}function nse(e){var t=document.createElement("script");return e&&(t.src=e),t}function rse(e){var t=Gh(function(r){var s=r.config,i=r.reject;return{config:s,reject:i}}),n=nse("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function ase(){var e=Gh(function(n){var r=n.config,s=n.resolve,i=n.reject;return{config:r,resolve:s,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;nI(r),e.resolve(r)},function(n){e.reject(n)})}function nI(e){Gh().monaco||Zy({monaco:e})}function sse(){return Gh(function(e){var t=e.monaco;return t})}var l1=new Promise(function(e,t){return Zy({resolve:e,reject:t})}),rI={config:Jae,init:ese,__getMonacoInstance:sse},ose={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},c1=ose,ise={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},lse=ise;function cse({children:e}){return ae.createElement("div",{style:lse.container},e)}var use=cse,dse=use;function fse({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:i,wrapperProps:c}){return ae.createElement("section",{style:{...c1.wrapper,width:e,height:t},...c},!n&&ae.createElement(dse,null,r),ae.createElement("div",{ref:s,style:{...c1.fullWidth,...!n&&c1.hide},className:i}))}var hse=fse,aI=h.memo(hse);function mse(e){h.useEffect(e,[])}var sI=mse;function pse(e,t,n=!0){let r=h.useRef(!0);h.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var qa=pse;function Hf(){}function Lu(e,t,n,r){return gse(e,r)||yse(e,t,n,r)}function gse(e,t){return e.editor.getModel(oI(e,t))}function yse(e,t,n,r){return e.editor.createModel(t,n,r?oI(e,r):void 0)}function oI(e,t){return e.Uri.parse(t)}function xse({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:m="light",loading:y="Loading...",options:g={},height:x="100%",width:v="100%",className:C,wrapperProps:b={},beforeMount:w=Hf,onMount:R=Hf}){let[j,_]=h.useState(!1),[D,O]=h.useState(!0),A=h.useRef(null),T=h.useRef(null),I=h.useRef(null),k=h.useRef(R),V=h.useRef(w),U=h.useRef(!1);sI(()=>{let H=rI.init();return H.then(M=>(T.current=M)&&O(!1)).catch(M=>(M==null?void 0:M.type)!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>A.current?q():H.cancel()}),qa(()=>{if(A.current&&T.current){let H=A.current.getOriginalEditor(),M=Lu(T.current,e||"",r||n||"text",i||"");M!==H.getModel()&&H.setModel(M)}},[i],j),qa(()=>{if(A.current&&T.current){let H=A.current.getModifiedEditor(),M=Lu(T.current,t||"",s||n||"text",c||"");M!==H.getModel()&&H.setModel(M)}},[c],j),qa(()=>{let H=A.current.getModifiedEditor();H.getOption(T.current.editor.EditorOption.readOnly)?H.setValue(t||""):t!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[t],j),qa(()=>{var H,M;(M=(H=A.current)==null?void 0:H.getModel())==null||M.original.setValue(e||"")},[e],j),qa(()=>{let{original:H,modified:M}=A.current.getModel();T.current.editor.setModelLanguage(H,r||n||"text"),T.current.editor.setModelLanguage(M,s||n||"text")},[n,r,s],j),qa(()=>{var H;(H=T.current)==null||H.editor.setTheme(m)},[m],j),qa(()=>{var H;(H=A.current)==null||H.updateOptions(g)},[g],j);let K=h.useCallback(()=>{var B;if(!T.current)return;V.current(T.current);let H=Lu(T.current,e||"",r||n||"text",i||""),M=Lu(T.current,t||"",s||n||"text",c||"");(B=A.current)==null||B.setModel({original:H,modified:M})},[n,t,s,e,r,i,c]),G=h.useCallback(()=>{var H;!U.current&&I.current&&(A.current=T.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...g}),K(),(H=T.current)==null||H.editor.setTheme(m),_(!0),U.current=!0)},[g,m,K]);h.useEffect(()=>{j&&k.current(A.current,T.current)},[j]),h.useEffect(()=>{!D&&!j&&G()},[D,j,G]);function q(){var M,B,$,re;let H=(M=A.current)==null?void 0:M.getModel();u||((B=H==null?void 0:H.original)==null||B.dispose()),f||(($=H==null?void 0:H.modified)==null||$.dispose()),(re=A.current)==null||re.dispose()}return ae.createElement(aI,{width:v,height:x,isEditorReady:j,loading:y,_ref:I,className:C,wrapperProps:b})}var vse=xse;h.memo(vse);function bse(e){let t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}var Sse=bse,Op=new Map;function Cse({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:i,theme:c="light",line:u,loading:f="Loading...",options:m={},overrideServices:y={},saveViewState:g=!0,keepCurrentModel:x=!1,width:v="100%",height:C="100%",className:b,wrapperProps:w={},beforeMount:R=Hf,onMount:j=Hf,onChange:_,onValidate:D=Hf}){let[O,A]=h.useState(!1),[T,I]=h.useState(!0),k=h.useRef(null),V=h.useRef(null),U=h.useRef(null),K=h.useRef(j),G=h.useRef(R),q=h.useRef(),H=h.useRef(r),M=Sse(i),B=h.useRef(!1),$=h.useRef(!1);sI(()=>{let P=rI.init();return P.then(z=>(k.current=z)&&I(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>V.current?ge():P.cancel()}),qa(()=>{var z,F,Z,Q;let P=Lu(k.current,e||r||"",t||s||"",i||n||"");P!==((z=V.current)==null?void 0:z.getModel())&&(g&&Op.set(M,(F=V.current)==null?void 0:F.saveViewState()),(Z=V.current)==null||Z.setModel(P),g&&((Q=V.current)==null||Q.restoreViewState(Op.get(i))))},[i],O),qa(()=>{var P;(P=V.current)==null||P.updateOptions(m)},[m],O),qa(()=>{!V.current||r===void 0||(V.current.getOption(k.current.editor.EditorOption.readOnly)?V.current.setValue(r):r!==V.current.getValue()&&($.current=!0,V.current.executeEdits("",[{range:V.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),V.current.pushUndoStop(),$.current=!1))},[r],O),qa(()=>{var z,F;let P=(z=V.current)==null?void 0:z.getModel();P&&s&&((F=k.current)==null||F.editor.setModelLanguage(P,s))},[s],O),qa(()=>{var P;u!==void 0&&((P=V.current)==null||P.revealLine(u))},[u],O),qa(()=>{var P;(P=k.current)==null||P.editor.setTheme(c)},[c],O);let re=h.useCallback(()=>{var P;if(!(!U.current||!k.current)&&!B.current){G.current(k.current);let z=i||n,F=Lu(k.current,r||e||"",t||s||"",z||"");V.current=(P=k.current)==null?void 0:P.editor.create(U.current,{model:F,automaticLayout:!0,...m},y),g&&V.current.restoreViewState(Op.get(z)),k.current.editor.setTheme(c),u!==void 0&&V.current.revealLine(u),A(!0),B.current=!0}},[e,t,n,r,s,i,m,y,g,c,u]);h.useEffect(()=>{O&&K.current(V.current,k.current)},[O]),h.useEffect(()=>{!T&&!O&&re()},[T,O,re]),H.current=r,h.useEffect(()=>{var P,z;O&&_&&((P=q.current)==null||P.dispose(),q.current=(z=V.current)==null?void 0:z.onDidChangeModelContent(F=>{$.current||_(V.current.getValue(),F)}))},[O,_]),h.useEffect(()=>{if(O){let P=k.current.editor.onDidChangeMarkers(z=>{var Z;let F=(Z=V.current.getModel())==null?void 0:Z.uri;if(F&&z.find(Q=>Q.path===F.path)){let Q=k.current.editor.getModelMarkers({resource:F});D==null||D(Q)}});return()=>{P==null||P.dispose()}}return()=>{}},[O,D]);function ge(){var P,z;(P=q.current)==null||P.dispose(),x?g&&Op.set(i,V.current.saveViewState()):(z=V.current.getModel())==null||z.dispose(),V.current.dispose()}return ae.createElement(aI,{width:v,height:C,isEditorReady:O,loading:f,_ref:U,className:b,wrapperProps:w})}var wse=Cse,iI=h.memo(wse);function Ese({initialValue:e,onChange:t}){const[n,r]=h.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=Ph();h.useEffect(()=>{e!=null&&e.sqlQuery&&e.sqlQuery!==n&&r(e.sqlQuery)},[e,n]);function i(c){c!==void 0&&(r(c),t({sqlQuery:c}))}return a.jsx("div",{className:"shadow-xs",children:a.jsx(iI,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:i,theme:s==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function Nb({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:i}){const c=e;return a.jsxs("div",{className:se("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",s&&"cursor-pointer dark:hover:bg-white/5",i),onClick:s,children:[a.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(c,{className:"h-6 w-6"})}),a.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[a.jsx("div",{className:"text-md font-medium",children:t}),n&&a.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,s&&a.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-white/4",children:a.jsx(_a,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var sN=1,Rse=.9,jse=.8,Tse=.17,u1=.1,d1=.999,_se=.9999,Nse=.99,Ase=/[\\\/_+.#"@\[\(\{&]/,Dse=/[\\\/_+.#"@\[\(\{&]/g,Ose=/[\s-]/,lI=/[\s-]/g;function Ab(e,t,n,r,s,i,c){if(i===t.length)return s===e.length?sN:Nse;var u=`${s},${i}`;if(c[u]!==void 0)return c[u];for(var f=r.charAt(i),m=n.indexOf(f,s),y=0,g,x,v,C;m>=0;)g=Ab(e,t,n,r,m+1,i+1,c),g>y&&(m===s?g*=sN:Ase.test(e.charAt(m-1))?(g*=jse,v=e.slice(s,m-1).match(Dse),v&&s>0&&(g*=Math.pow(d1,v.length))):Ose.test(e.charAt(m-1))?(g*=Rse,C=e.slice(s,m-1).match(lI),C&&s>0&&(g*=Math.pow(d1,C.length))):(g*=Tse,s>0&&(g*=Math.pow(d1,m-s))),e.charAt(m)!==t.charAt(i)&&(g*=_se)),(g<u1&&n.charAt(m-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(m-1)!==r.charAt(i))&&(x=Ab(e,t,n,r,m+1,i+2,c),x*u1>g&&(g=x*u1)),g>y&&(y=g),m=n.indexOf(f,m+1);return c[u]=y,y}function oN(e){return e.toLowerCase().replace(lI," ")}function Ise(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Ab(e,t,oN(e),oN(t),0,0,{})}var Rf='[cmdk-group=""]',f1='[cmdk-group-items=""]',Mse='[cmdk-group-heading=""]',cI='[cmdk-item=""]',iN=`${cI}:not([aria-disabled="true"])`,Db="cmdk-item-select",Au="data-value",kse=(e,t,n)=>Ise(e,t,n),uI=h.createContext(void 0),Bh=()=>h.useContext(uI),dI=h.createContext(void 0),Z2=()=>h.useContext(dI),fI=h.createContext(void 0),hI=h.forwardRef((e,t)=>{let n=Du(()=>{var z,F;return{search:"",value:(F=(z=e.value)!=null?z:e.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Du(()=>new Set),s=Du(()=>new Map),i=Du(()=>new Map),c=Du(()=>new Set),u=mI(e),{label:f,children:m,value:y,onValueChange:g,filter:x,shouldFilter:v,loop:C,disablePointerSelection:b=!1,vimBindings:w=!0,...R}=e,j=er(),_=er(),D=er(),O=h.useRef(null),A=qse();bc(()=>{if(y!==void 0){let z=y.trim();n.current.value=z,T.emit()}},[y]),bc(()=>{A(6,G)},[]);let T=h.useMemo(()=>({subscribe:z=>(c.current.add(z),()=>c.current.delete(z)),snapshot:()=>n.current,setState:(z,F,Z)=>{var Q,le,J,ie;if(!Object.is(n.current[z],F)){if(n.current[z]=F,z==="search")K(),V(),A(1,U);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(D);ye?ye.focus():(Q=document.getElementById(j))==null||Q.focus()}if(A(7,()=>{var ye;n.current.selectedItemId=(ye=q())==null?void 0:ye.id,T.emit()}),Z||A(5,G),((le=u.current)==null?void 0:le.value)!==void 0){let ye=F??"";(ie=(J=u.current).onValueChange)==null||ie.call(J,ye);return}}T.emit()}},emit:()=>{c.current.forEach(z=>z())}}),[]),I=h.useMemo(()=>({value:(z,F,Z)=>{var Q;F!==((Q=i.current.get(z))==null?void 0:Q.value)&&(i.current.set(z,{value:F,keywords:Z}),n.current.filtered.items.set(z,k(F,Z)),A(2,()=>{V(),T.emit()}))},item:(z,F)=>(r.current.add(z),F&&(s.current.has(F)?s.current.get(F).add(z):s.current.set(F,new Set([z]))),A(3,()=>{K(),V(),n.current.value||U(),T.emit()}),()=>{i.current.delete(z),r.current.delete(z),n.current.filtered.items.delete(z);let Z=q();A(4,()=>{K(),(Z==null?void 0:Z.getAttribute("id"))===z&&U(),T.emit()})}),group:z=>(s.current.has(z)||s.current.set(z,new Set),()=>{i.current.delete(z),s.current.delete(z)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:j,inputId:D,labelId:_,listInnerRef:O}),[]);function k(z,F){var Z,Q;let le=(Q=(Z=u.current)==null?void 0:Z.filter)!=null?Q:kse;return z?le(z,n.current.search,F):0}function V(){if(!n.current.search||u.current.shouldFilter===!1)return;let z=n.current.filtered.items,F=[];n.current.filtered.groups.forEach(Q=>{let le=s.current.get(Q),J=0;le.forEach(ie=>{let ye=z.get(ie);J=Math.max(ye,J)}),F.push([Q,J])});let Z=O.current;H().sort((Q,le)=>{var J,ie;let ye=Q.getAttribute("id"),Ce=le.getAttribute("id");return((J=z.get(Ce))!=null?J:0)-((ie=z.get(ye))!=null?ie:0)}).forEach(Q=>{let le=Q.closest(f1);le?le.appendChild(Q.parentElement===le?Q:Q.closest(`${f1} > *`)):Z.appendChild(Q.parentElement===Z?Q:Q.closest(`${f1} > *`))}),F.sort((Q,le)=>le[1]-Q[1]).forEach(Q=>{var le;let J=(le=O.current)==null?void 0:le.querySelector(`${Rf}[${Au}="${encodeURIComponent(Q[0])}"]`);J==null||J.parentElement.appendChild(J)})}function U(){let z=H().find(Z=>Z.getAttribute("aria-disabled")!=="true"),F=z==null?void 0:z.getAttribute(Au);T.setState("value",F||void 0)}function K(){var z,F,Z,Q;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let le=0;for(let J of r.current){let ie=(F=(z=i.current.get(J))==null?void 0:z.value)!=null?F:"",ye=(Q=(Z=i.current.get(J))==null?void 0:Z.keywords)!=null?Q:[],Ce=k(ie,ye);n.current.filtered.items.set(J,Ce),Ce>0&&le++}for(let[J,ie]of s.current)for(let ye of ie)if(n.current.filtered.items.get(ye)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=le}function G(){var z,F,Z;let Q=q();Q&&(((z=Q.parentElement)==null?void 0:z.firstChild)===Q&&((Z=(F=Q.closest(Rf))==null?void 0:F.querySelector(Mse))==null||Z.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function q(){var z;return(z=O.current)==null?void 0:z.querySelector(`${cI}[aria-selected="true"]`)}function H(){var z;return Array.from(((z=O.current)==null?void 0:z.querySelectorAll(iN))||[])}function M(z){let F=H()[z];F&&T.setState("value",F.getAttribute(Au))}function B(z){var F;let Z=q(),Q=H(),le=Q.findIndex(ie=>ie===Z),J=Q[le+z];(F=u.current)!=null&&F.loop&&(J=le+z<0?Q[Q.length-1]:le+z===Q.length?Q[0]:Q[le+z]),J&&T.setState("value",J.getAttribute(Au))}function $(z){let F=q(),Z=F==null?void 0:F.closest(Rf),Q;for(;Z&&!Q;)Z=z>0?Gse(Z,Rf):Bse(Z,Rf),Q=Z==null?void 0:Z.querySelector(iN);Q?T.setState("value",Q.getAttribute(Au)):B(z)}let re=()=>M(H().length-1),ge=z=>{z.preventDefault(),z.metaKey?re():z.altKey?$(1):B(1)},P=z=>{z.preventDefault(),z.metaKey?M(0):z.altKey?$(-1):B(-1)};return h.createElement(et.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:z=>{var F;(F=R.onKeyDown)==null||F.call(R,z);let Z=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||Z))switch(z.key){case"n":case"j":{w&&z.ctrlKey&&ge(z);break}case"ArrowDown":{ge(z);break}case"p":case"k":{w&&z.ctrlKey&&P(z);break}case"ArrowUp":{P(z);break}case"Home":{z.preventDefault(),M(0);break}case"End":{z.preventDefault(),re();break}case"Enter":{z.preventDefault();let Q=q();if(Q){let le=new Event(Db);Q.dispatchEvent(le)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:Zse},f),Yy(e,z=>h.createElement(dI.Provider,{value:T},h.createElement(uI.Provider,{value:I},z))))}),Lse=h.forwardRef((e,t)=>{var n,r;let s=er(),i=h.useRef(null),c=h.useContext(fI),u=Bh(),f=mI(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;bc(()=>{if(!m)return u.item(s,c==null?void 0:c.id)},[m]);let y=pI(s,i,[e.value,e.children,i],e.keywords),g=Z2(),x=pl(A=>A.value&&A.value===y.current),v=pl(A=>m||u.filter()===!1?!0:A.search?A.filtered.items.get(s)>0:!0);h.useEffect(()=>{let A=i.current;if(!(!A||e.disabled))return A.addEventListener(Db,C),()=>A.removeEventListener(Db,C)},[v,e.onSelect,e.disabled]);function C(){var A,T;b(),(T=(A=f.current).onSelect)==null||T.call(A,y.current)}function b(){g.setState("value",y.current,!0)}if(!v)return null;let{disabled:w,value:R,onSelect:j,forceMount:_,keywords:D,...O}=e;return h.createElement(et.div,{ref:Xr(i,t),...O,id:s,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!x,"data-disabled":!!w,"data-selected":!!x,onPointerMove:w||u.getDisablePointerSelection()?void 0:b,onClick:w?void 0:C},e.children)}),Pse=h.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,c=er(),u=h.useRef(null),f=h.useRef(null),m=er(),y=Bh(),g=pl(v=>s||y.filter()===!1?!0:v.search?v.filtered.groups.has(c):!0);bc(()=>y.group(c),[]),pI(c,u,[e.value,e.heading,f]);let x=h.useMemo(()=>({id:c,forceMount:s}),[s]);return h.createElement(et.div,{ref:Xr(u,t),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&h.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),Yy(e,v=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},h.createElement(fI.Provider,{value:x},v))))}),Use=h.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=h.useRef(null),i=pl(c=>!c.search);return!n&&!i?null:h.createElement(et.div,{ref:Xr(s,t),...r,"cmdk-separator":"",role:"separator"})}),zse=h.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=Z2(),c=pl(m=>m.search),u=pl(m=>m.selectedItemId),f=Bh();return h.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),h.createElement(et.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":u,id:f.inputId,type:"text",value:s?e.value:c,onChange:m=>{s||i.setState("search",m.target.value),n==null||n(m.target.value)}})}),Fse=h.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=h.useRef(null),c=h.useRef(null),u=pl(m=>m.selectedItemId),f=Bh();return h.useEffect(()=>{if(c.current&&i.current){let m=c.current,y=i.current,g,x=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let v=m.offsetHeight;y.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(g),x.unobserve(m)}}},[]),h.createElement(et.div,{ref:Xr(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:f.listId},Yy(e,m=>h.createElement("div",{ref:Xr(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),Hse=h.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:c,...u}=e;return h.createElement(ry,{open:n,onOpenChange:r},h.createElement(ay,{container:c},h.createElement(sy,{"cmdk-overlay":"",className:s}),h.createElement(oy,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(hI,{ref:t,...u}))))}),$se=h.forwardRef((e,t)=>pl(n=>n.filtered.count===0)?h.createElement(et.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Vse=h.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return h.createElement(et.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Yy(e,c=>h.createElement("div",{"aria-hidden":!0},c)))}),Sd=Object.assign(hI,{List:Fse,Item:Lse,Input:zse,Group:Pse,Separator:Use,Dialog:Hse,Empty:$se,Loading:Vse});function Gse(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Bse(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function mI(e){let t=h.useRef(e);return bc(()=>{t.current=e}),t}var bc=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Du(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function pl(e){let t=Z2(),n=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,n,n)}function pI(e,t,n,r=[]){let s=h.useRef(),i=Bh();return bc(()=>{var c;let u=(()=>{var m;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(m=y.current.textContent)==null?void 0:m.trim():s.current}})(),f=r.map(m=>m.trim());i.value(e,u,f),(c=t.current)==null||c.setAttribute(Au,u),s.current=u}),s}var qse=()=>{let[e,t]=h.useState(),n=Du(()=>new Map);return bc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function Kse(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Yy({asChild:e,children:t},n){return e&&h.isValidElement(t)?h.cloneElement(Kse(t),{ref:t.ref},n(t.props.children)):n(t)}var Zse={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Y2({className:e,...t}){return a.jsx(Sd,{"data-slot":"command",className:se("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function W2({className:e,...t}){return a.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[a.jsx(jc,{className:"size-4 shrink-0 opacity-50"}),a.jsx(Sd.Input,{"data-slot":"command-input",className:se("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 gI({className:e,...t}){return a.jsx(Sd.List,{"data-slot":"command-list",className:se("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function yI({...e}){return a.jsx(Sd.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function xI({className:e,...t}){return a.jsx(Sd.Group,{"data-slot":"command-group",className:se("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 X2({className:e,...t}){return a.jsx(Sd.Item,{"data-slot":"command-item",className:se("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})}function Yse(e){const t=Wse(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(Qse);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Wse(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=eoe(s),u=Jse(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xse=Symbol("radix.slottable");function Qse(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xse}function Jse(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function eoe(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wy="Popover",[vI]=Sr(Wy,[Ro]),qh=Ro(),[toe,Il]=vI(Wy),bI=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!1}=e,u=qh(t),f=h.useRef(null),[m,y]=h.useState(!1),[g,x]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:Wy});return a.jsx(fd,{...u,children:a.jsx(toe,{scope:t,contentId:er(),triggerRef:f,open:g,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(v=>!v),[x]),hasCustomAnchor:m,onCustomAnchorAdd:h.useCallback(()=>y(!0),[]),onCustomAnchorRemove:h.useCallback(()=>y(!1),[]),modal:c,children:n})})};bI.displayName=Wy;var SI="PopoverAnchor",noe=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Il(SI,n),i=qh(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=s;return h.useEffect(()=>(c(),()=>u()),[c,u]),a.jsx(hd,{...i,...r,ref:t})});noe.displayName=SI;var CI="PopoverTrigger",wI=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Il(CI,n),i=qh(n),c=ht(t,s.triggerRef),u=a.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":_I(s.open),...r,ref:c,onClick:Me(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:a.jsx(hd,{asChild:!0,...i,children:u})});wI.displayName=CI;var Q2="PopoverPortal",[roe,aoe]=vI(Q2,{forceMount:void 0}),EI=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Il(Q2,t);return a.jsx(roe,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:r})})})};EI.displayName=Q2;var sd="PopoverContent",RI=h.forwardRef((e,t)=>{const n=aoe(sd,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Il(sd,e.__scopePopover);return a.jsx(Vr,{present:r||i.open,children:i.modal?a.jsx(ooe,{...s,ref:t}):a.jsx(ioe,{...s,ref:t})})});RI.displayName=sd;var soe=Yse("PopoverContent.RemoveScroll"),ooe=h.forwardRef((e,t)=>{const n=Il(sd,e.__scopePopover),r=h.useRef(null),s=ht(t,r),i=h.useRef(!1);return h.useEffect(()=>{const c=r.current;if(c)return ty(c)},[]),a.jsx(Sh,{as:soe,allowPinchZoom:!0,children:a.jsx(jI,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,m=u.button===2||f;i.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Me(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),ioe=h.forwardRef((e,t)=>{const n=Il(sd,e.__scopePopover),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(jI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var f,m;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),jI=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:y,...g}=e,x=Il(sd,n),v=qh(n);return Jg(),a.jsx(bh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:y,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:a.jsx(wh,{"data-state":_I(x.open),role:"dialog",id:x.contentId,...v,...g,ref:t,style:{...g.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)"}})})})}),TI="PopoverClose",loe=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Il(TI,n);return a.jsx(et.button,{type:"button",...r,ref:t,onClick:Me(e.onClick,()=>s.onOpenChange(!1))})});loe.displayName=TI;var coe="PopoverArrow",uoe=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=qh(n);return a.jsx(Eh,{...s,...r,ref:t})});uoe.displayName=coe;function _I(e){return e?"open":"closed"}var doe=bI,foe=wI,hoe=EI,moe=RI;function J2({...e}){return a.jsx(doe,{"data-slot":"popover",...e})}function eC({...e}){return a.jsx(foe,{"data-slot":"popover-trigger",...e})}function tC({className:e,align:t="center",sideOffset:n=4,...r}){return a.jsx(hoe,{children:a.jsx(moe,{"data-slot":"popover-content",align:t,sideOffset:n,className:se("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),...r})})}function nC({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:s="No results found.",className:i,disabled:c=!1}){const[u,f]=h.useState(!1),[m,y]=h.useState(""),g=h.useMemo(()=>{const C={};return e.forEach(b=>{const w=b.group??"";Object.prototype.hasOwnProperty.call(C,w)||(C[w]=[]),C[w].push(b)}),C},[e]),x=e.find(C=>C.value===t),v=h.useCallback(C=>{n(C),requestAnimationFrame(()=>{y(""),f(!1)})},[n]);return a.jsxs(J2,{open:u,onOpenChange:f,modal:!0,children:[a.jsx(eC,{asChild:!0,children:a.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":u,className:se("w-full justify-between",!t&&"text-muted-foreground",i),disabled:c,children:[x?x.label:r,a.jsx(cS,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(tC,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:a.jsxs(Y2,{children:[a.jsx(W2,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:y}),a.jsx(yI,{children:s}),Object.entries(g).map(([C,b])=>a.jsx(xI,{heading:C,children:b.map(w=>a.jsxs(X2,{value:w.value,onSelect:()=>{v(w.value)},keywords:[w.label],children:[a.jsx(oa,{className:se("mr-2 h-4 w-4",t===w.value?"opacity-100":"opacity-0")}),w.label]},w.value))},C||"default"))]})})]})}function poe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"service-account-details",children:[a.jsx(Yt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),a.jsx("p",{className:"mb-2",children:"Here's what to do:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Go to"," ",a.jsx(gn,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),a.jsxs("li",{children:["Open ",a.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),a.jsx("li",{children:"Create a new service account or select an existing one."}),a.jsxs("li",{children:["Assign the ",a.jsx("strong",{children:"bigquery.dataEditor"})," and ",a.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),a.jsxs("li",{children:["Open the Service Accounts page, go to the ",a.jsx("strong",{children:"Keys"})," tab, click"," ",a.jsx("strong",{children:"Add key"}),", and select ",a.jsx("strong",{children:"Create new key"}),"."]}),a.jsxs("li",{children:["Choose ",a.jsx("strong",{children:"JSON"})," format and click ",a.jsx("strong",{children:"Create"}),"."]}),a.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function goe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"project-id-details",children:[a.jsx(Yt,{children:"How do I find my Project ID?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),a.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),a.jsxs("li",{children:["Find your project in the list. The ",a.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),a.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function yoe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"gbq-location-details",children:[a.jsx(Yt,{children:"How do I find my dataset location?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"BigQuery data is stored in specific regions. To avoid query errors, your SQL queries must process data stored in the same location."}),a.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),a.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),a.jsxs("li",{children:["Click each dataset name to open its details. The ",a.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",a.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",a.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",a.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),a.jsx("li",{children:"Make sure all your datasets are stored in the same location. If they are in different locations, select the location where most of your data is stored or create separate Storage for each location."}),a.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const xoe=({form:e})=>{const[t,n]=h.useState(!1);if(e.watch("type")!==je.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},i=e.watch("credentials.serviceAccount"),c=i?N5(i):null;return a.jsxs(a.Fragment,{children:[a.jsxs(Yr,{title:"Connection Settings",children:[a.jsx(Nt,{control:e.control,name:"config.projectId",render:({field:u})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),a.jsx(jt,{children:a.jsx(It,{...u,placeholder:"Enter a Project Id"})}),a.jsx(xn,{children:a.jsx(goe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"config.location",render:({field:u})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),a.jsx(jt,{children:a.jsx(nC,{options:qX,value:u.value,onValueChange:u.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),a.jsx(xn,{children:a.jsx(yoe,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Yr,{title:"Authentication",children:a.jsx(Nt,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(yt,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&i&&a.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(jt,{children:!t&&c?a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx(gn,{href:c.url,children:c.email})}),a.jsx(St,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(jo,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(xn,{children:a.jsx(poe,{})}),a.jsx(Mt,{})]})})})]})};function voe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-region-details",children:[a.jsx(Yt,{children:"How do I find my Athena region?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"Athena queries run in a specific AWS region. You must select the region where your Athena service and data are located."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),a.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),a.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function boe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-output-bucket-details",children:[a.jsx(Yt,{children:"How do I find a bucket?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",a.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),a.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),a.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),a.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),a.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function Soe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-access-key-id-details",children:[a.jsx(Yt,{children:"How do I get my AWS Access Key ID?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"Before accessing your AWS Access Key ID, make sure you have a user with the necessary permissions to use Athena and Glue in your AWS account."}),a.jsxs("p",{className:"mb-4 text-sm",children:["Learn more about how to create a user in AWS ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/?utm_source=owox_data_marts&utm_medium=storage_enity&utm_campaign=tooltip_aws",children:"in documentation"}),"."]}),a.jsx(mS,{className:"my-4"}),a.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),a.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),a.jsxs("li",{children:["Under ",a.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),a.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function Coe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-secret-access-key-details",children:[a.jsx(Yt,{children:"How do I get my AWS Secret Access Key?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"The Secret Access Key is part of your AWS credentials needed to connect and authenticate. It is only shown when you create a new key."}),a.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),a.jsxs("li",{children:["Under ",a.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),a.jsx("li",{children:"When you create a new key, copy and securely store the Secret Access Key — you won't be able to see it again."})]})]})]})})}const woe=({form:e})=>{const[t,n]=h.useState("");return h.useEffect(()=>{const r=e.getValues("credentials.accessKeyId");if(r){const s="_".repeat(r.length);n(s),e.setValue("credentials.secretAccessKey",s,{shouldDirty:!1})}},[e]),e.watch("type")!==je.AWS_ATHENA?null:a.jsxs(a.Fragment,{children:[a.jsxs(Yr,{title:"Connection Settings",children:[a.jsx(Nt,{control:e.control,name:"config.region",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),a.jsx(jt,{children:a.jsx(It,{...r,placeholder:"Enter a region"})}),a.jsx(xn,{children:a.jsx(voe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"config.outputBucket",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),a.jsx(jt,{children:a.jsx(It,{...r,placeholder:"Enter an output bucket"})}),a.jsx(xn,{children:a.jsx(boe,{})}),a.jsx(Mt,{})]})})]}),a.jsxs(Yr,{title:"Authentication",children:[a.jsx(Nt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),a.jsx(jt,{children:a.jsx(It,{...r,placeholder:"Enter an access key id"})}),a.jsx(xn,{children:a.jsx(Soe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),a.jsx(jt,{children:a.jsx(It,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),a.jsx(xn,{children:a.jsx(Coe,{})}),a.jsx(Mt,{})]})})]})]})};function Eoe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-account-details",children:[a.jsx(Yt,{children:"How do I find my Snowflake account identifier?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To find the region and locator for your account, see"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/admin-account-identifier#finding-the-region-and-locator-for-an-account",children:"Snowflake documentation"}),"."]}),a.jsxs("ol",{className:"list-inside list-decimal space-y-3 text-sm",children:[a.jsx("li",{children:"Open the account selector and review the list of accounts that you previously signed in to."}),a.jsxs("li",{children:["Select ",a.jsx("strong",{children:"View account details"}),"."]}),a.jsxs("li",{children:["The ",a.jsx("strong",{children:"Account Details"})," dialog displays information about the account, including the account identifier and the account URL."]}),a.jsxs("li",{children:["Copy part of your account identifier from the ",a.jsx("strong",{children:"Account locator"})," field."]}),a.jsx("li",{children:"Find the region in the account selector (e.g. Europe West4 (Netherlands))."}),a.jsxs("li",{children:["Compare the found region with the ",a.jsx("strong",{children:"Account Identifier Region"})," in"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/admin-account-identifier#non-vps-account-locator-formats-by-cloud-platform-and-region",children:"Snowflake documentation"})," ","for locator formats by cloud platform and region."]}),a.jsxs("li",{children:["Create the account identifier by combining the locator and the region like this:"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"locator.region"}),a.jsxs("div",{className:"mt-2",children:["Examples:",a.jsxs("ul",{className:"mt-1 ml-4 space-y-1",children:[a.jsx("li",{children:a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"xy12345.ap-northeast-3.aws"})}),a.jsx("li",{children:a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"xy12345.north-europe.azure"})})]})]})]})]}),a.jsxs("div",{className:"mt-4 text-sm",children:["More details in"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",children:"OWOX Snowflake documentation"}),"."]})]})]})})}function Roe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-warehouse-details",children:[a.jsx(Yt,{children:"How do I find my Snowflake warehouse?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"A warehouse in Snowflake is a cluster of compute resources that executes queries and performs data loading operations."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your warehouse:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:'Log in to your Snowflake account and navigate to the "Warehouses" section in the left sidebar.'}),a.jsx("li",{children:`You'll see a list of available warehouses. Common default names include "COMPUTE_WH" or "PROD_WH".`}),a.jsx("li",{children:"Select the warehouse you want to use for this connection. Make sure it has the appropriate size and auto-suspend settings for your workload."}),a.jsx("li",{children:`If you don't have a warehouse, you can create one using the "Create Warehouse" button or run: CREATE WAREHOUSE my_warehouse;`})]})]})]})})}function joe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-auth-method-details",children:[a.jsx(Yt,{children:"Which authentication method should I choose?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"Snowflake supports two authentication methods for programmatic access:"}),a.jsxs("div",{className:"space-y-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("strong",{className:"font-medium",children:"Username & Password:"}),a.jsx("p",{className:"mt-1",children:"The simplest method using your Snowflake username and password. Suitable for development and testing environments."})]}),a.jsxs("div",{children:[a.jsx("strong",{className:"font-medium",children:"Key Pair Authentication:"}),a.jsx("p",{className:"mt-1",children:"More secure method using public/private key cryptography. Recommended for production environments. You'll need to generate an RSA key pair and assign the public key to your Snowflake user."}),a.jsxs("p",{className:"mt-1",children:["Learn more about"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"key pair authentication"}),"."]})]})]})]})]})})}function Toe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-username-details",children:[a.jsx(Yt,{children:"How do I find my Snowflake username?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"Your Snowflake username is the login identifier for your Snowflake account."}),a.jsx("p",{className:"mb-2",children:"Here's what you need to know:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm",children:[a.jsx("li",{children:"Use the same username you use to log in to the Snowflake web interface."}),a.jsx("li",{children:"Snowflake usernames are case-insensitive and are typically in uppercase by default."}),a.jsx("li",{children:"If you're using SSO (Single Sign-On) for the web interface, you may need to create a separate user account with password authentication for programmatic access."}),a.jsx("li",{children:"You can view all users in your account by running: SHOW USERS; (requires appropriate privileges)"})]})]})]})})}function _oe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-password-details",children:[a.jsx(Yt,{children:"How do I manage my Snowflake password?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"Use the password associated with your Snowflake user account for authentication."}),a.jsx("p",{className:"mb-2",children:"Important security considerations:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm",children:[a.jsx("li",{children:"Your password must meet Snowflake's security requirements (minimum length, complexity, etc.)."}),a.jsx("li",{children:"If you've forgotten your password, a Snowflake administrator can reset it using: ALTER USER username SET PASSWORD = 'new_password';"}),a.jsxs("li",{children:["For production environments, consider using"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Key-Pair authentication"})," ","instead of passwords for enhanced security."]}),a.jsx("li",{children:"Your password is encrypted and securely stored. It will never be displayed in plain text after saving."})]})]})]})})}function Noe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-keypair-details",children:[a.jsx(Yt,{children:"How do I set up key pair authentication?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"To use key pair authentication, you need to generate an RSA key pair and configure your Snowflake user."}),a.jsx("p",{className:"mb-2",children:"Here's how to set it up:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Generate an RSA key pair using OpenSSL:",a.jsx("pre",{className:"mt-1 rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",children:"openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt"})]}),a.jsxs("li",{children:["Extract the public key:",a.jsx("pre",{className:"mt-1 rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",children:"openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub"})]}),a.jsxs("li",{children:["Assign the public key to your Snowflake user (run this in Snowflake as ACCOUNTADMIN):",a.jsx("pre",{className:"mt-1 rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",children:"ALTER USER your_username SET RSA_PUBLIC_KEY='MIIBIjANBg...';"})]}),a.jsx("li",{children:"Copy the private key content from rsa_key.p8 and paste it in the Private Key field above."})]}),a.jsxs("p",{className:"mt-2 text-xs",children:["For more details, see"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Snowflake's key pair authentication documentation"}),"."]})]})]})})}function Aoe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-passphrase-details",children:[a.jsx(Yt,{children:"What is a passphrase and when do I need it?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"A passphrase is an optional encryption password that protects your private key."}),a.jsx("p",{className:"mb-2",children:"Here's what you need to know:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm",children:[a.jsx("li",{children:"If you generated your private key with a passphrase (encrypted key), you must provide it here."}),a.jsx("li",{children:"If your private key is not encrypted (generated without the -nocrypt flag), leave this field empty."}),a.jsx("li",{children:"When generating an encrypted key with OpenSSL, you set the passphrase during the key generation process."}),a.jsx("li",{children:"The passphrase adds an extra layer of security by encrypting the private key file itself."}),a.jsx("li",{children:"This passphrase is only used to decrypt the private key and is never sent to Snowflake."})]})]})]})})}const Doe=({form:e})=>{const t=e.watch("credentials.authMethod");return e.watch("type")!==je.SNOWFLAKE?null:a.jsxs(a.Fragment,{children:[a.jsxs(Yr,{title:"Connection Settings",children:[a.jsx(Nt,{control:e.control,name:"config.account",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter your Snowflake account identifier",children:"Account"}),a.jsx(jt,{children:a.jsx(It,{...n,placeholder:"e.g., xy12345.us-east-1"})}),a.jsx(xn,{children:a.jsx(Eoe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"config.warehouse",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Specify the Snowflake warehouse to use for query execution",children:"Warehouse"}),a.jsx(jt,{children:a.jsx(It,{...n,placeholder:"Enter warehouse name"})}),a.jsx(xn,{children:a.jsx(Roe,{})}),a.jsx(Mt,{})]})})]}),a.jsxs(Yr,{title:"Authentication",children:[a.jsx(Nt,{control:e.control,name:"credentials.authMethod",render:({field:n})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(yt,{children:"Authentication Method"}),a.jsx(k2,{value:n.value,onValueChange:n.onChange,children:a.jsxs(L2,{children:[a.jsx(ah,{value:Ps.PASSWORD,children:"Username & Password"}),a.jsx(ah,{value:Ps.KEY_PAIR,children:"Key Pair"})]})})]}),a.jsx(xn,{children:a.jsx(joe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"credentials.username",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your Snowflake username",children:"Username"}),a.jsx(jt,{children:a.jsx(It,{...n,placeholder:"Enter username"})}),a.jsx(xn,{children:a.jsx(Toe,{})}),a.jsx(Mt,{})]})}),t===Ps.PASSWORD&&a.jsx(Nt,{control:e.control,name:"credentials.password",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your Snowflake password",children:"Password"}),a.jsx(jt,{children:a.jsx(It,{...n,type:"password",placeholder:"Enter password"})}),a.jsx(xn,{children:a.jsx(_oe,{})}),a.jsx(Mt,{})]})}),t===Ps.KEY_PAIR&&a.jsxs(a.Fragment,{children:[a.jsx(Nt,{control:e.control,name:"credentials.privateKey",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Paste your private key in PEM format",children:"Private Key"}),a.jsx(jt,{children:a.jsx(jo,{...n,placeholder:`-----BEGIN PRIVATE KEY-----
|
|
819
|
-
...
|
|
820
|
-
-----END PRIVATE KEY-----`,rows:6})}),a.jsx(xn,{children:a.jsx(Noe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"credentials.privateKeyPassphrase",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter the passphrase if your private key is encrypted",children:"Passphrase (Optional)"}),a.jsx(jt,{children:a.jsx(It,{...n,type:"password",value:n.value??"",placeholder:"Enter passphrase if key is encrypted"})}),a.jsx(xn,{children:a.jsx(Aoe,{})}),a.jsx(Mt,{})]})})]})]})]})},Ooe=()=>a.jsx(a.Fragment,{children:a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,className:"mt-2",children:a.jsxs(Zt,{value:"snowflake-setup",children:[a.jsx(Yt,{children:"How do I get started with Snowflake?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"To use Snowflake as your storage provider, you'll need an active Snowflake account with appropriate permissions."}),a.jsx("p",{className:"mb-2",children:"Here's how to get started:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Sign up for a"," ",a.jsx(gn,{className:"underline",href:"https://signup.snowflake.com/",children:"Snowflake account"})," ","if you don't have one yet."]}),a.jsx("li",{children:"Make sure you have the necessary privileges to create and access databases, schemas, and warehouses."}),a.jsx("li",{children:"Choose your authentication method: Username & Password for quick setup, or Key-Pair authentication for production environments."}),a.jsx("li",{children:"Fill in the connection details below (account identifier and warehouse)."}),a.jsx("li",{children:"You can access tables using the full path format: database.schema.table (similar to BigQuery and Athena)."})]})]})]})})});function Ioe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"bigquery-api-details",children:[a.jsx(Yt,{children:"How do I enable the BigQuery API?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",a.jsx(gn,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),a.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),a.jsxs("li",{children:["If the API isn't enabled yet, click ",a.jsx("strong",{children:"Enable"}),"."]}),a.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function Moe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-api-details",children:[a.jsx(Yt,{children:"How do I activate Athena API?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"AWS Athena is a serverless interactive query service. To use it, you need to activate Athena in your AWS account."}),a.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),a.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),a.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function koe({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=To({resolver:xi(yQ),defaultValues:e}),{watch:i,control:c,formState:{isDirty:u,isSubmitting:f}}=s,m=i("type");ae.useEffect(()=>{r==null||r(u)},[u,r]);const y=async g=>{const{dirtyFields:x}=s.formState,v=_5(g);return x.credentials||delete v.credentials,t(v)};return a.jsx(_l,{...s,children:a.jsxs(yi,{onSubmit:g=>{s.handleSubmit(y)(g)},noValidate:!0,children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(Nt,{control:c,name:"title",render:({field:g})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),a.jsx(jt,{children:a.jsx(It,{...g,placeholder:"Storage title"})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:c,name:"type",render:({field:g})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),a.jsx(jt,{children:a.jsxs(ua,{value:g.value,onValueChange:g.onChange,disabled:!!e,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a storage type"})}),a.jsx(ha,{children:a.jsx($y,{children:Sl.getAllTypes().map(({type:x,displayName:v,icon:C,status:b})=>a.jsx(Bn,{value:x,disabled:b===Qo.COMING_SOON,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(C,{size:20}),v]})},x))})})]})}),a.jsxs(xn,{children:[m===je.GOOGLE_BIGQUERY&&a.jsx(Ioe,{}),m===je.AWS_ATHENA&&a.jsx(Moe,{}),m===je.SNOWFLAKE&&a.jsx(Ooe,{})]}),a.jsx(Mt,{})]})})]}),m===je.GOOGLE_BIGQUERY&&a.jsx(xoe,{form:s}),m===je.AWS_ATHENA&&a.jsx(woe,{form:s}),m===je.SNOWFLAKE&&a.jsx(Doe,{form:s})]}),a.jsxs(Mc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!u||f,children:"Save"}),a.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function kc(e){const[t,n]=h.useState(!1),[r,s]=h.useState(!1),i=h.useCallback(()=>{r?n(!0):e()},[r,e]),c=h.useCallback(()=>{n(!1),s(!1),e()},[e]),u=h.useCallback(m=>{s(m)},[]),f=h.useCallback(()=>{s(!1),e()},[e]);return{showUnsavedDialog:t,setShowUnsavedDialog:n,isDirty:r,handleClose:i,confirmClose:c,handleFormDirtyChange:u,handleFormSubmitSuccess:f}}function NI({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=Vy();Ol(e);const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:y}=kc(t),g=async v=>{if(n){const C=await s(n.id,v);C&&(r(C),y())}},x=h.useRef(!1);return h.useEffect(()=>{const v=n?"Edit":"Create";e&&!x.current?(De({event:"data_storage_config_open",category:"DataStorage",action:v,label:n==null?void 0:n.type}),x.current=!0):!e&&x.current&&(De({event:"data_storage_config_close",category:"DataStorage",action:v,label:n==null?void 0:n.type}),x.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(ui,{open:e,onOpenChange:v=>{v||u()},children:a.jsxs(di,{children:[a.jsxs(fi,{children:[a.jsx(hi,{children:"Configure Storage Provider"}),a.jsx(yl,{children:"Customize settings for your storage provider"})]}),a.jsx(koe,{initialData:n??void 0,onSubmit:g,onCancel:u,onDirtyChange:m})]})}),a.jsx(br,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:f,variant:"destructive"})]})}const Loe=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=h.useState(!1),s=Sl.getInfo(e.type),i=()=>{r(!0)},c=()=>{r(!1)},u=()=>{const f=g5(e);if(De({event:"data_storage_configuration_loaded",category:"DataMart",action:f?"ValidStorage":"InvalidStorage",label:e.type}),!f)return a.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[a.jsx(vh,{className:"h-4 w-4 text-red-500"}),a.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const m=(g,x)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:x})]}),y=(g,x,v)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx(gn,{href:v,onClick:C=>{C.stopPropagation()},children:x})]});switch(e.type){case je.GOOGLE_BIGQUERY:{const g=e.config.projectId,x=e.config.location,v=`https://console.cloud.google.com/bigquery?project=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[y("Project ID",g,v),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",x)]})}case je.AWS_ATHENA:{const g=e.config.region,x=e.config.outputBucket,v=`https://s3.console.aws.amazon.com/s3/buckets/${x}?region=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",g),a.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Bucket",x,v)]})}case je.SNOWFLAKE:{const g=e.config.account,x=e.config.warehouse;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[y("Account",g,"https://app.snowflake.com/"),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Warehouse",x)]})}default:return"Unknown storage type configuration"}};return a.jsxs(a.Fragment,{children:[a.jsx(Nb,{title:e.title,icon:s.icon,subtitle:u(),onClick:i}),a.jsx(I2,{children:a.jsx(NI,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function Poe({initialType:e,onTypeSelect:t}){var c;const[n,r]=h.useState(e??null);h.useEffect(()=>{e!==void 0&&e!==n&&r(e)},[e,n]);const s=u=>{r(u),t(u)},i=[{type:Ve.SQL,label:"SQL",description:"SQL query"},{type:Ve.TABLE,label:"Table",description:"Existing table"},{type:Ve.VIEW,label:"View",description:"Existing view"},{type:Ve.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:Ve.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return a.jsxs("div",{className:"dm-card-block",children:[a.jsx(Ta,{className:"text-foreground",children:"Definition Type"}),a.jsxs(ua,{value:n??"",onValueChange:u=>{s(u)},children:[a.jsx(fa,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:a.jsx(da,{placeholder:"Select definition type",children:n&&((c=i.find(u=>u.type===n))==null?void 0:c.label)})}),a.jsx(ha,{children:a.jsx($y,{children:i.map(u=>a.jsxs(Bn,{value:u.type,children:[u.label,a.jsx("span",{className:"text-muted-foreground/80 ml-2",children:u.description})]},u.type))})})]})]})}const Uoe=an({definitionType:Gr(Ve.SQL),definition:an({sqlQuery:Dt().min(1,"SQL query is required")})}),zoe=e=>{const t=P5(e);return an({definitionType:Gr(Ve.TABLE),definition:t})},Foe=e=>{const t=P5(e);return an({definitionType:Gr(Ve.VIEW),definition:t})},Hoe=e=>{const t=IJ(e);return an({definitionType:Gr(Ve.TABLE_PATTERN),definition:t})},$oe=an({definitionType:Gr(Ve.CONNECTOR),definition:an({connector:an({source:an({name:Dt().min(1,"Connector name is required"),configuration:sb(bY(xY())).min(1,"At least one configuration is required"),node:Dt().min(1,"Node is required"),fields:sb(Dt()).min(1,"At least one field is required")}),storage:an({fullyQualifiedName:Dt().min(1,"fully qualified name is required")})})})}),Voe=(e,t)=>{if(!e)return an({definitionType:SY(Ry(Ve)),definition:an({}).optional()});switch(e){case Ve.SQL:return Uoe;case Ve.TABLE:return zoe(t);case Ve.VIEW:return Foe(t);case Ve.TABLE_PATTERN:return Hoe(t);case Ve.CONNECTOR:return $oe;default:return an({})}};function Goe({control:e}){return a.jsx(Nt,{control:e,name:"definition.sqlQuery",render:({field:t})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{className:"text-foreground",children:"SQL Query"}),a.jsx(jt,{children:a.jsx(Ese,{initialValue:t.value?{sqlQuery:t.value}:void 0,onChange:n=>{t.onChange(n.sqlQuery)}})}),a.jsx(Mt,{})]})})}function Boe({control:e,storageType:t}){const n=v5(t),r=b5(t);return a.jsx(Nt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{children:"Fully Qualified Table Name"}),a.jsx(jt,{children:a.jsx(It,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(xn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}function qoe({control:e,storageType:t}){const n=v5(t),r=b5(t);return a.jsx(Nt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{children:"Fully Qualified View Name"}),a.jsx(jt,{children:a.jsx(It,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(xn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}function Koe({control:e,storageType:t}){const n=EQ(t),r=RQ(t);return a.jsx(Nt,{control:e,name:"definition.pattern",render:({field:s})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{children:"Table Pattern"}),a.jsx(jt,{children:a.jsx(It,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(xn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}const rC=e=>{switch(e){case Ve.SQL:return{sqlQuery:""};case Ve.TABLE:return{fullyQualifiedName:""};case Ve.VIEW:return{fullyQualifiedName:""};case Ve.TABLE_PATTERN:return{pattern:""};case Ve.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},Zoe=Ec("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 aC({className:e,variant:t,...n}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:se(Zoe({variant:t}),e),...n})}function AI({className:e,...t}){return a.jsx("div",{"data-slot":"alert-title",className:se("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function sC({className:e,...t}){return a.jsx("div",{"data-slot":"alert-description",className:se("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function Yoe({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:i}){return n?a.jsx($2,{variant:"grid"}):r?a.jsxs(aC,{variant:"destructive",children:[a.jsx(yh,{className:"h-4 w-4"}),a.jsx(sC,{children:"Failed to load available connectors. Please try again."})]}):a.jsxs(ri,{children:[a.jsx(al,{title:"Choose Connector",children:a.jsx(Hre,{children:e.map(c=>a.jsx($re,{icon:c.logoBase64?a.jsx(Ac,{base64:c.logoBase64,size:20}):null,title:c.displayName,selected:(t==null?void 0:t.name)===c.name,onClick:()=>{s(c)},onDoubleClick:()=>{s(c),i==null||i(c)}},c.name))})}),e.length===0&&a.jsx(ni,{icon:a.jsx(Zf,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function Woe({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:i,onBack:c,onFinish:u,nextLabel:f="Next",backLabel:m="Back",finishLabel:y="Save"}){const g=e===t;return t===1?a.jsx("div",{className:"w-full",children:a.jsx(we,{className:"w-full",variant:"default",onClick:u,disabled:!n||s,children:y})}):a.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[a.jsx("div",{className:"flex-1",children:r&&a.jsxs(we,{variant:"outline",onClick:c,disabled:s,children:[a.jsx(HP,{className:"h-4 w-4"}),m]})}),a.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),a.jsx("div",{className:"flex flex-1 justify-end",children:g?a.jsx(we,{variant:"default",onClick:u,disabled:!n||s,children:y}):a.jsxs(we,{variant:"default",onClick:i,disabled:!n||s,children:[f,a.jsx(_a,{className:"h-4 w-4"})]})})]})}function ic({connector:e,size:t=24,variant:n="compact"}){return a.jsx(ni,{icon:a.jsx(Ac,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function Bu({label:e}){return a.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Wr,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",a.jsx(si,{className:"h-4 w-4"})]})})})}const Ob="**********";function Xoe({specification:e,configuration:t,onValueChange:n}){const{name:r,title:s}=e,i=s??r,c=r;return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(It,{type:"checkbox",id:c,name:r,checked:t[r]||!1,onChange:u=>{n(r,u.target.checked)},className:"text-primary focus:ring-primary border-border h-4 w-4 rounded"}),a.jsx(Ta,{htmlFor:c,className:"cursor-pointer text-sm",children:a.jsx(Ba,{htmlFor:c,required:e.required,tooltip:e.description,children:i})})]})}function Qoe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(It,{id:r,name:r,type:"number",value:t[r]||"",placeholder:s??`Enter ${i.toLowerCase()}`,onChange:c=>{const u=c.target.value,f=u===""?void 0:parseFloat(u);n(r,f)}})}function Joe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name;return a.jsx(jo,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
|
|
821
|
-
`):Array.isArray(i)?i.join(`
|
|
822
|
-
`):"",placeholder:s??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:u=>{const f=u.target.value.split(`
|
|
823
|
-
`).filter(m=>m.trim());n(r,f)}})}function eie({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name,u=f=>{if(!f||typeof f!="string"&&typeof f!="number")return"";const m=typeof f=="string"?f:f.toString();try{const y=new Date(m);return isNaN(y.getTime())?"":y.toISOString().split("T")[0]}catch{return""}};return a.jsx(It,{id:r,name:r,type:"date",value:t[r]||u(i)||"",placeholder:s??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function tie({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(It,{id:r,name:r,type:"text",value:t[r]||"",placeholder:s??`Enter ${i.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function nie({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:i,default:c}=e;return a.jsx(jo,{id:s,name:s,value:t[s]&&typeof t[s]=="object"?JSON.stringify(t[s],null,2):typeof c=="object"?JSON.stringify(c,null,2):"",placeholder:i??`Enter ${r.toLowerCase()} as JSON`,rows:6,className:"font-mono",onChange:u=>{try{const f=JSON.parse(u.target.value);n(s,f)}catch{n(s,u.target.value)}}})}function rie({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s}){const i=e.title??e.name,c=r&&!s;return a.jsx(It,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?Ob:t[e.name]||"",...c?{readOnly:!0,disabled:!0}:{},...c?{}:{placeholder:e.placeholder??`Enter ${i.toLowerCase()}`},...c?{}:{onChange:u=>{n(e.name,u.target.value)}}})}function aie({specification:e,configuration:t,onValueChange:n,specOptions:r}){const{name:s,placeholder:i,default:c}=e,u=e.title??e.name,f=r.map(m=>({value:m,label:m}));return a.jsx(nC,{options:f,value:t[s]||c||"",onValueChange:m=>{n(s,m)},placeholder:i??`Select ${u.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function sie(){const e=h.useRef(new Uf),t=h.useCallback(async(s,i,c)=>await e.current.exchangeCredentials(s,{fieldPath:c,payload:i}),[]),n=h.useCallback(async(s,i)=>{try{return await e.current.checkOAuthStatus(s,i)}catch{return{valid:!1}}},[]),r=h.useCallback(async(s,i)=>await e.current.getOAuthSettings(s,i),[]);return{exchangeCredentials:t,checkStatus:n,getSettings:r}}let jf=null;function oie({appId:e,scope:t,onSuccess:n,onError:r,disabled:s=!1,children:i}){const[c,u]=h.useState(!1),[f,m]=h.useState(!1),[y,g]=h.useState(null);h.useEffect(()=>{if(window.FB){m(!0);return}if(document.getElementById("facebook-jssdk")){const w=setInterval(()=>{window.FB&&(m(!0),clearInterval(w))},100);return()=>{clearInterval(w)}}if(!e)return;if(jf&&jf!==e){console.warn("Facebook SDK already initialized with different appId");return}jf??(jf=e),window.fbAsyncInit=function(){window.FB&&jf&&(window.FB.init({appId:jf,cookie:!0,xfbml:!0,version:"v23.0"}),m(!0))};const b=document.createElement("script");b.id="facebook-jssdk",b.src="https://connect.facebook.net/en_US/sdk.js",b.async=!0,b.defer=!0,b.crossOrigin="anonymous",document.body.appendChild(b)},[e]);const x=()=>{if(!window.FB||!f){const b=new Error("Facebook SDK not loaded or not ready");g(b.message),r==null||r(b);return}u(!0),g(null),window.FB.login(b=>{var w;if(b.status==="connected"&&b.authResponse){const{accessToken:R,expiresIn:j,userID:_}=b.authResponse;(w=window.FB)==null||w.api("/me?fields=name,email",D=>{const O={accessToken:R,expiresIn:j,userID:_,userName:D.name,userEmail:D.email};n(O),u(!1)})}else{const R=new Error("User cancelled login or did not fully authorize");g(R.message),r==null||r(R),u(!1)}},{scope:t})},v=s||c||!f,C=()=>c?"Connecting...":i||(f?"Continue with Facebook":"Loading...");return a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs(we,{type:"button",onClick:x,disabled:v,className:"flex items-center justify-center gap-2 rounded-md border-none bg-[#1877F2] px-4 py-2.5 text-sm font-semibold text-white hover:bg-[#166FE5] disabled:cursor-not-allowed disabled:opacity-60",children:[a.jsx("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"})}),C()]}),y&&a.jsx("div",{className:"mt-1 text-xs text-red-600",children:y})]})}function iie({isLoading:e,status:t,settings:n,onOAuthSuccess:r}){const s=i=>{r({accessToken:i.accessToken})};return a.jsx("div",{className:"mt-2 mb-2",children:a.jsx(oie,{appId:n==null?void 0:n.vars.AppId,scope:n==null?void 0:n.vars.Scopes,onSuccess:s,disabled:e,children:t!=null&&t.user?a.jsxs(a.Fragment,{children:["Authenticated as ",a.jsx("strong",{children:t.user.name??t.user.id})]}):"Continue with Facebook"})})}function DI({specification:e,option:t,configuration:n,onValueChange:r,connectorName:s,onSecretEditToggle:i,secretEditing:c={},isEditingExisting:u=!1}){const[f,m]=h.useState(!1),[y,g]=h.useState(null),[x,v]=h.useState(null),[C,b]=h.useState(null),w=h.useMemo(()=>{const G=n[e.name],q=t!=null&&t.value&&G?G[t.value]:G;return q==null?void 0:q._source_credential_id},[n,e.name,t==null?void 0:t.value]),R=h.useMemo(()=>t?`${e.name}.${t.value}`:e.name,[e.name,t]),j=h.useMemo(()=>{const G=n[e.name];if(t!=null&&t.value&&G){const q=G[t.value];return q&&typeof q=="object"&&!Array.isArray(q)?q:{}}return G&&typeof G=="object"&&!Array.isArray(G)?G:{}},[n,e.name,t==null?void 0:t.value]),_=h.useMemo(()=>{const G=j;return"_source_credential_id"in G?!1:!!(t!=null&&t.items&&Object.keys(t.items).some(H=>H in G&&G[H]!==void 0&&G[H]!==""))},[j,t]),[D,O]=h.useState(_);h.useEffect(()=>{const G="_source_credential_id"in j,q=(t==null?void 0:t.items)&&Object.keys(t.items).some(H=>H in j&&j[H]!==void 0&&j[H]!=="");G&&D?O(!1):q&&!D&&O(!0)},[j,t,D]);const A=(G,q)=>{if(!(t!=null&&t.value))return;const H=n[e.name]&&typeof n[e.name]=="object"?n[e.name]:{};r(e.name,{...H,[t.value]:{...typeof H[t.value]=="object"&&H[t.value]!==null?H[t.value]:{},[G]:q}})},{checkStatus:T,getSettings:I,exchangeCredentials:k}=sie(),V=async G=>{try{m(!0),b(null);const q=await k(s,G,R),H=n[e.name];t?r(e.name,{...H,[t.value]:{_source_credential_id:q.credentialId}}):r(e.name,{_source_credential_id:q.credentialId})}catch(q){const H=q instanceof Error?q.message:"Failed to exchange OAuth credentials";console.error("Failed to exchange OAuth credentials:",q),b(H)}finally{m(!1)}};h.useEffect(()=>{if(!w){g(null),m(!1);return}let G=!1;return(async()=>{try{m(!0);const H=await T(s,w);G||g(H)}catch(H){G||(console.error("Failed to validate credentials:",H),g({valid:!1}))}finally{G||m(!1)}})(),()=>{G=!0}},[w,s,T]),h.useEffect(()=>{(async()=>{try{const q=await I(s,R);v(q)}catch(q){console.error("Failed to fetch settings:",q),v(null)}})()},[s,R,I]);const U=!!(x!=null&&x.isEnabled);if((D||!U)&&(t!=null&&t.items))return a.jsxs("div",{className:"space-y-4",children:[Object.entries(t.items).map(([G,q])=>{const H=Array.isArray(q.attributes)?q.attributes.includes("SECRET")&&j[G]!==void 0:!1,M=c[e.name]??!1;return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ba,{htmlFor:G,required:q.required,tooltip:q.description,className:"mb-2 justify-start",children:q.title??G}),H&&u&&i&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!M)},children:M?"Cancel":"Edit"})]}),oC({specification:{...q,name:G},configuration:j,onValueChange:(B,$)=>{A(B,$)},flags:{isEditingExisting:u,isSecret:H,isSecretEditing:M},connectorName:s})]},G)}),U&&a.jsx(we,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),O(!1),m(!1)},className:"px-0",children:"Back to OAuth"})]});const K=(()=>{switch(s){case"FacebookMarketing":return a.jsx(iie,{isLoading:f,status:y,settings:x,onOAuthSuccess:V});default:return null}})();return a.jsxs("div",{className:"space-y-3",children:[K,C&&a.jsx("div",{className:"text-destructive text-sm",children:C}),(t==null?void 0:t.items)&&Object.keys(t.items).length>0&&a.jsx(we,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),O(!0)},className:"px-0",children:"Manually"})]})}function oC({specification:e,configuration:t,onValueChange:n,flags:r,connectorName:s}){const{requiredType:i,options:c}=e,{isSecret:u=!1,isEditingExisting:f=!1,isSecretEditing:m=!1}=r??{};if(e.attributes&&Array.isArray(e.attributes)&&e.attributes.includes("OAUTH_FLOW"))return a.jsx(DI,{specification:e,configuration:t,onValueChange:n,connectorName:s});if(u)return a.jsx(rie,{specification:e,configuration:t,onValueChange:n,isEditingExisting:f,isSecretEditing:m});if(c&&c.length>0)return a.jsx(aie,{specification:e,configuration:t,onValueChange:n,specOptions:c});switch(i){case Os.BOOLEAN:return a.jsx(Xoe,{specification:e,configuration:t,onValueChange:n});case Os.NUMBER:return a.jsx(Qoe,{specification:e,configuration:t,onValueChange:n});case Os.ARRAY:return a.jsx(Joe,{specification:e,configuration:t,onValueChange:n});case Os.OBJECT:return a.jsx(nie,{specification:e,configuration:t,onValueChange:n});case Os.DATE:return a.jsx(eie,{specification:e,configuration:t,onValueChange:n});case Os.STRING:default:return a.jsx(tie,{specification:e,configuration:t,onValueChange:n})}}function lie({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:i,onSecretEditToggle:c,connectorName:u}){return a.jsxs(Bi,{children:[e.requiredType!==Os.BOOLEAN&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ba,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),s&&n&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),oC({specification:e,configuration:t,onValueChange:i,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r},connectorName:u})]},e.name)}function cie({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:i,connectorName:c}){const u=h.useMemo(()=>{var v,C;const x=t[e.name];if(x&&typeof x=="object"){const b=Object.keys(x);if(b.length>0)return b[0]}return((C=(v=e.oneOf)==null?void 0:v[0])==null?void 0:C.value)??""},[t,e.name,e.oneOf]),[f,m]=h.useState(u);if(h.useEffect(()=>{m(u)},[u]),h.useEffect(()=>{if(f){const x=t[e.name];x&&typeof x=="object"&&f in x||n(e.name,{[f]:{}})}},[f,e.name]),!e.oneOf)return null;const y=x=>{m(x)},g=(x,v,C)=>{const b=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[x]:{...typeof b[x]=="object"&&b[x]!==null?b[x]:{},[v]:C}})};return a.jsx(Fre,{label:e.title??e.name,options:e.oneOf.map(x=>({value:x.value,label:x.label})),value:f,onValueChange:y,children:e.oneOf.map(x=>{const v=x.attributes&&Array.isArray(x.attributes)&&x.attributes.includes("OAUTH_FLOW");return a.jsx(_re,{value:x.value,children:v?a.jsx(DI,{specification:e,option:x,configuration:t,onValueChange:n,connectorName:c,onSecretEditToggle:i,secretEditing:{[e.name]:s},isEditingExisting:r}):Object.entries(x.items).map(([C,b])=>{const w=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},R=Array.isArray(b.attributes)&&Object.keys(w)[0]===x.value?b.attributes.includes("SECRET"):!1,j=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},_=typeof j[x.value]=="object"&&j[x.value]!==null?j[x.value]:{};return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ba,{htmlFor:C,required:b.required,tooltip:b.description,className:"mb-2 justify-start",children:C}),R&&r&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!s)},children:s?"Cancel":"Edit"})]}),oC({specification:{...b,name:C},configuration:_,onValueChange:(D,O)=>{g(x.value,D,O)},flags:{isEditingExisting:r,isSecret:R,isSecretEditing:s},connectorName:c})]},C)})},x.value)})},e.name)}function lN(e,t,n,r,s,i,c){return e.map(u=>{const f=Array.isArray(u.attributes)?u.attributes.includes("SECRET"):!1,m=s[u.name];return u.oneOf&&u.requiredType===Os.OBJECT?a.jsx(cie,{specification:u,configuration:t,onValueChange:n,isEditingExisting:i,isSecretEditing:m,onSecretEditToggle:r,connectorName:c},u.name):a.jsx(lie,{specification:u,configuration:t,isEditingExisting:i,isSecret:f,isSecretEditing:m,onValueChange:n,onSecretEditToggle:r,connectorName:c},u.name)})}function cN({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:i,isEditingExisting:c,connectorName:u}){return e?a.jsx(P6,{title:e,children:lN(t,n,r,s,i,c,u)}):lN(t,n,r,s,i,c,u)}function uie({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,s]=h.useState([]),[i,c]=h.useState(!1),[u,f]=h.useState(!1),m=h.useCallback(async()=>{c(!0);try{const x=await Tn.getDataMartsByConnectorName(e);s(x)}catch{s([])}finally{c(!1)}},[e]);h.useEffect(()=>{u&&m()},[u,m]);const y=(x,v)=>{const C=v._id;if(!C){console.error("Configuration does not have _id field");return}t({dataMartId:x.id,dataMartTitle:x.title,configId:C,configuration:v}),f(!1)},g=x=>{const C=[],b=R=>{if(!n)return!0;const j=n.find(_=>_.name===R);return(j==null?void 0:j.required)??!1},w=(R,j,_=0,D=!0)=>{if(R.startsWith("_")||D&&_===0&&!b(R))return;let O=null;if(j==null)O="N/A";else if(typeof j=="string")O=j;else if(typeof j=="number"||typeof j=="boolean")O=String(j);else if(Array.isArray(j))O=JSON.stringify(j);else if(typeof j=="object"){C.push({key:R,value:"{",indent:_}),Object.entries(j).forEach(([A,T])=>{w(A,T,_+1,!1)}),C.push({key:"",value:"}",indent:_});return}else O=JSON.stringify(j);C.push({key:R,value:O,indent:_})};for(const[R,j]of Object.entries(x))w(R,j);return a.jsx("div",{className:"space-y-1 font-mono text-xs",children:C.map(({key:R,value:j,indent:_},D)=>a.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(_*12)}px`},children:[R&&a.jsxs("span",{className:"font-medium",children:[R,":"]}),a.jsx("span",{className:"text-muted-foreground truncate",title:j,children:j})]},D))})};return a.jsx(Ya,{children:a.jsxs(Cr,{open:u,onOpenChange:f,children:[a.jsx(wr,{asChild:!0,children:a.jsxs(we,{type:"button",variant:"ghost",size:"sm",className:"cursor-pointer",children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Copy from…"}),a.jsx(_a,{className:se("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",u&&"rotate-90")})]})}),a.jsx(Er,{side:"bottom",align:"end",className:"w-72",children:i?a.jsx(Ct,{disabled:!0,children:"Loading…"}):r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",children:[a.jsx("div",{className:"bg-muted/70 rounded-full p-3",children:a.jsx(fz,{className:"text-muted-foreground h-6 w-6",strokeWidth:1.5})}),a.jsx("span",{className:"text-foreground text-sm font-medium",children:"No matching Data Marts"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"You can reuse configuration settings only from connector-based Data Marts that use the same source."})]}):a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"text-muted-foreground border-b p-2 text-sm",children:"Select one of your existing Data Marts to reuse its configuration settings."}),a.jsx("div",{children:r.map(x=>{const C=x.definition.connector.source.configuration;return C.length===0?null:C.length===1?a.jsxs(vt,{delayDuration:300,children:[a.jsx(bt,{asChild:!0,children:a.jsxs(Ct,{onSelect:()=>{y(x,C[0])},children:[a.jsx(rg,{className:"text-foreground h-4 w-4"}),x.title]})}),a.jsx(St,{side:"right",className:"max-w-sm",children:g(C[0])})]},x.id):a.jsxs(yy,{children:[a.jsxs(xy,{className:"flex items-center gap-2",children:[a.jsx(rg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:x.title})]}),a.jsx(vy,{children:C.map((b,w)=>a.jsxs(vt,{delayDuration:300,children:[a.jsx(bt,{asChild:!0,children:a.jsxs(Ct,{onSelect:()=>{y(x,b)},children:["Configuration ",w+1]})}),a.jsx(St,{side:"right",className:"max-w-sm",children:g(b)})]},w))})]},x.id)})})]})})]})})}function uN({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:s,loading:i=!1,isEditingExisting:c=!1}){const[u,f]=h.useState({}),m=h.useRef(!1),y=h.useRef(!1),[g,x]=h.useState({});h.useEffect(()=>{if(t){y.current=!0;const A={...s??{}};t.forEach(T=>{const I=Array.isArray(T.attributes)?T.attributes.includes("SECRET"):!1;A[T.name]===void 0&&T.default!==void 0&&(A[T.name]=T.default),c&&I&&(A[T.name]=Ob)}),f(A),m.current=!0,setTimeout(()=>{y.current=!1},0)}},[t,s,c]),h.useEffect(()=>{m.current&&s&&Object.keys(s).length>0&&(y.current=!0,f({...s}),setTimeout(()=>{y.current=!1},0))},[s]),h.useEffect(()=>{m.current&&!y.current&&Object.keys(u).length>0&&(n==null||n(u))},[u,n]);const v=(A,T)=>{f(I=>({...I,[A]:T}))},C=h.useCallback(A=>!(A==null||typeof A=="string"&&A.trim()===""||typeof A=="number"&&isNaN(A)||Array.isArray(A)&&A.length===0),[]),b=h.useCallback((A,T)=>{var k,V;if(typeof A!="object"||A===null)return C(A);if((k=T.attributes)!=null&&k.includes("OAUTH_FLOW")&&"_source_credential_id"in A)return!0;const I=(V=T.oneOf)==null?void 0:V.filter(U=>U.value===Object.keys(A)[0]);return I?I.every(U=>{var K;if((K=U.attributes)!=null&&K.includes("OAUTH_FLOW")){const G=A[U.value];if(typeof G=="object"&&G!==null){if("_source_credential_id"in G)return!0;const q=Object.entries(U.items).filter(([,H])=>H.required);if(q.length>0)return q.every(([H])=>{const M=G[H];return C(M)})}return!1}return Object.entries(U.items).every(([,G])=>U.value in A?b(A[U.value],G):!1)}):C(A[T.name])},[C]),w=h.useCallback((A,T)=>{const I=T.filter(K=>K.required&&K.oneOf),k=I.length===0?!0:I.some(K=>b(A[K.name],K)),U=T.filter(K=>K.required&&K.name!=="Fields").every(K=>C(A[K.name]));return k&&U},[C,b]),R=(A,T)=>{x(I=>({...I,[A]:T})),f(T?I=>({...I,[A]:""}):I=>({...I,[A]:Ob}))},j=A=>{const T={...u};Object.entries(A.configuration).forEach(([I,k])=>{["_id","_copiedFrom"].includes(I)||(T[I]=k)}),T._copiedFrom={dataMartId:A.dataMartId,dataMartTitle:A.dataMartTitle,configId:A.configId},f(T)};if(h.useEffect(()=>{if(t&&r){const A=w(u,t);r(A)}},[u,t,r,w]),i)return a.jsx($2,{variant:"list"});if(!t||t.length===0)return a.jsxs(ri,{children:[a.jsx(ic,{connector:e}),a.jsx(ni,{icon:a.jsx(Zf,{size:56,strokeWidth:1}),title:"No configuration found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(Bu,{label:"Need configuration?"})]});const _=[...t].filter(A=>{var T;return A.name!=="Fields"&&!((T=A.attributes)!=null&&T.includes("HIDE_IN_CONFIG_FORM"))}).sort((A,T)=>{const I=k=>{const V=k.default!=null&&k.default!=="";return k.required&&!V?1:k.required&&V?2:!k.required&&!V?3:4};return I(A)-I(T)}),D=_.filter(A=>{var T;return!((T=A.attributes)!=null&&T.includes("ADVANCED"))}),O=_.filter(A=>{var T;return(T=A.attributes)==null?void 0:T.includes("ADVANCED")});return a.jsx(a.Fragment,{children:a.jsxs(ri,{children:[a.jsx(ic,{connector:e}),a.jsxs(al,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Configure Settings"}),a.jsx(uie,{currentConnectorName:e.name,onCopyConfiguration:j,connectorSpecification:t})]}),D.length>0&&a.jsx(cN,{items:D,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name}),O.length>0&&a.jsx(cN,{collapsibleTitle:"Advanced Settings",items:O,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name})]})]})})}function die({connector:e,connectorFields:t,selectedField:n,connectorName:r,loading:s=!1,onFieldSelect:i}){const c=r?`Select data for ${r}`:"Select data";return s?a.jsx($2,{variant:"list"}):!t||t.length===0?a.jsxs(ri,{children:[a.jsx(ic,{connector:e}),a.jsx(ni,{icon:a.jsx(Zf,{size:56,strokeWidth:1}),title:r?`No nodes found for ${r}`:"No nodes found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(Bu,{label:"Missing some data?"})]}):a.jsxs(ri,{children:[a.jsx(ic,{connector:e}),a.jsxs(al,{title:c,children:[a.jsx(U6,{children:t.map(u=>a.jsx(z6,{type:"radio",id:u.name,name:"selectedField",value:u.name,label:u.overview??u.name,checked:n===u.name,onChange:f=>{i(f)},tooltip:u.name&&a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Table name:"})," ",u.destinationName??u.name]}),u.description&&a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Description:"})," ",u.description]}),u.documentation&&a.jsxs(Wr,{to:u.documentation,target:"_blank",rel:"noopener noreferrer",className:"bg-muted/16 hover:bg-muted/20 dark:bg-muted/8 dark:hover:bg-muted/16 flex items-center justify-center gap-1 rounded-sm px-2 py-1 font-semibold",children:["Read more",a.jsx(_a,{className:"h-3 w-3"})]})]}),selected:n===u.name},u.name))}),a.jsx(Bu,{label:"Missing some data?"})]})]})}var so=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(so||{});function dN({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const i=h.useRef(null),[c,u]=h.useState(""),[f,m]=h.useState(so.ORIGINAL),y=t==null?void 0:t.find(R=>R.name===n),g=h.useMemo(()=>(y==null?void 0:y.fields)??[],[y==null?void 0:y.fields]),x=h.useMemo(()=>(y==null?void 0:y.uniqueKeys)??[],[y==null?void 0:y.uniqueKeys]),v=h.useMemo(()=>{const R=new Map;return g.forEach((j,_)=>R.set(j.name,_)),R},[g]),C=h.useMemo(()=>{const R=g.filter(_=>_.name.toLowerCase().includes(c.toLowerCase().trim())),j=(_,D)=>{const O=x.includes(_.name),A=x.includes(D.name);if(O&&!A)return-1;if(!O&&A)return 1;if(f===so.ASC)return _.name.localeCompare(D.name);if(f===so.DESC)return D.name.localeCompare(_.name);const T=v.get(_.name)??0,I=v.get(D.name)??0;return T-I};return[...R].sort(j)},[g,c,x,f,v]),b=g.map(R=>R.name),w=r.filter(R=>b.includes(R)).length;return h.useEffect(()=>{if(x.length>0){const R=x.filter(j=>g.some(_=>_.name===j)&&!r.includes(j));R.length>0&&R.forEach(j=>{s(j,!0)})}},[n,x,g,r,s]),h.useEffect(()=>{const R=j=>{const D=(j.ctrlKey||j.metaKey)&&j.shiftKey&&j.key.toLowerCase()==="a",O=document.activeElement.tagName;if(!(O==="INPUT"||O==="TEXTAREA")&&D){j.preventDefault();const A=g.map(k=>k.name),I=A.filter(k=>!r.includes(k)).length>0;A.forEach(k=>{s(k,I)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[g,r,s]),!n||!t?a.jsxs(ri,{children:[a.jsx(ic,{connector:e}),a.jsx(ni,{icon:a.jsx(Zf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(Bu,{label:"Need fields?"})]}):g.length?a.jsx(ri,{children:a.jsxs(a.Fragment,{children:[a.jsx(ic,{connector:e}),a.jsxs("div",{className:"border-border -mt-6 mb-6 flex w-full items-center gap-2 border-b",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(jc,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=i.current)==null||R.focus()}}),a.jsx("input",{ref:i,type:"text",placeholder:"Search field",value:c,onChange:R=>{u(R.target.value)},className:"h-12 w-full rounded-none border-0 pl-9 text-sm outline-none"}),c&&a.jsx("button",{type:"button",onClick:()=>{u("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:a.jsx(uc,{className:"h-4 w-4"})})]}),a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===so.ASC&&a.jsx(cT,{className:"text-muted-foreground h-4 w-4"}),f===so.DESC&&a.jsx(lT,{className:"text-muted-foreground h-4 w-4"}),f===so.ORIGINAL&&a.jsx(uT,{className:"text-muted-foreground h-4 w-4"})]})}),a.jsxs(Er,{align:"end",children:[a.jsxs(Ct,{onSelect:()=>{m(so.ASC)},children:[a.jsx(cT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),a.jsxs(Ct,{onSelect:()=>{m(so.DESC)},children:[a.jsx(lT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),a.jsxs(Ct,{onSelect:()=>{m(so.ORIGINAL)},children:[a.jsx(uT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),a.jsxs(al,{title:`Selected ${String(w)} of ${String(b.length)} fields for "${n}" data`,children:[a.jsxs(U6,{children:[C.map(R=>{const j=x.includes(R.name);return a.jsx(z6,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||j,disabled:j,onChange:_=>{s(R.name,_)},label:R.name,tooltip:a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[j&&a.jsxs("p",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-semibold",children:"Unique key"})," ",a.jsx(P1,{className:"text-secondary h-3 w-3"})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:j?a.jsx(P1,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),C.length===0&&c&&a.jsxs("div",{className:"text-muted-foreground p-8 text-center text-sm",children:['No fields match "',c,'"']})]}),a.jsx(Bu,{label:"Need another field?"})]})]})}):a.jsxs(ri,{children:[a.jsx(ic,{connector:e}),a.jsx(ni,{icon:a.jsx(Zf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(Bu,{label:"Need fields?"})]})}const OI=h.createContext(void 0),II={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function fie(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 II;default:return e}}class hie extends bl{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,r){return this.put(`/${t}/scheduled-triggers/${n}`,r)}async deleteScheduledTrigger(t,n){return this.delete(`/${t}/scheduled-triggers/${n}`)}}const lo=new hie;var Fn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(Fn||{});const sl={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class Ib{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!==Fn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await Wo.getReportById(n.reportId),s=ec(r);return{...t,triggerConfig:{...n,report:s}}}catch(r){return console.error(`Failed to fetch report data for trigger ${t.id}:`,r),t}}async enhanceTriggersWithReportData(t){return Promise.all(t.map(n=>this.enhanceWithReportData(n)))}mapToCreateRequest(t){return{type:Fn.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 mie{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:Fn.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 h1={getMapper(e){switch(e){case Fn.REPORT_RUN:return new Ib;case Fn.CONNECTOR_RUN:return new mie;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},Tf={mapFromDto(e){return h1.getMapper(e.type).mapFromDto(e)},mapFromDtoList(e){return e.map(t=>this.mapFromDto(t))},async mapFromDtoWithReportData(e,t){const n=this.mapFromDto(e);switch(n.type){case Fn.REPORT_RUN:return new Ib().enhanceWithReportData(n);case Fn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new Ib,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===Fn.REPORT_RUN),i=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case Fn.REPORT_RUN:return i.find(u=>u.id===c.id)??c;case Fn.CONNECTOR_RUN:{const u=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:u}}}default:return c}})},mapToCreateRequest(e){return h1.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return h1.getMapper(e.type).mapToUpdateRequest(e)}};function pie({children:e}){const[t,n]=h.useReducer(fie,II),{dataMart:r}=ws(),{fetchAvailableConnectors:s}=Ic();if(!r)throw new Error("Trigger provider must be used within a data mart context");const i=h.useCallback(async v=>{await s(),n({type:"FETCH_TRIGGERS_START"});try{const C=await lo.getScheduledTriggers(v),b=await Tf.mapFromDtoListWithReportData(C,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:b})}catch(C){const b=C instanceof Error?C.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:b}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:b})}},[r,s]),c=h.useCallback(async(v,C)=>{n({type:"FETCH_TRIGGERS_START"});try{const w=(await lo.getScheduledTriggers(v)).filter(j=>j.type===C),R=await Tf.mapFromDtoListWithReportData(w,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(b){const w=b instanceof Error?b.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:w}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:w})}},[r]),u=h.useCallback(async(v,C)=>{n({type:"FETCH_TRIGGER_START"});try{const b=await lo.getScheduledTrigger(v,C),w=await Tf.mapFromDtoWithReportData(b,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:w})}catch(b){const w=b instanceof Error?b.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:w}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:w})}},[r]),f=h.useCallback(async(v,C,b,w,R,j)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:C,cronExpression:b,timeZone:w,isActive:R,triggerConfig:j},D=await lo.createScheduledTrigger(v,_),O=await Tf.mapFromDtoWithReportData(D,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:O}),De({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:C}),_n.success("Trigger created"),O}catch(_){const D=_ instanceof Error?_.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:D}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:D}),_}},[r]),m=h.useCallback(async(v,C,b,w,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const j={cronExpression:b,timeZone:w,isActive:R},_=await lo.updateScheduledTrigger(v,C,j),D=await Tf.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:D}),De({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:D.type}),_n.success("Trigger updated")}catch(j){const _=j instanceof Error?j.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:_}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:_}),j}},[r]),y=h.useCallback(async(v,C)=>{n({type:"DELETE_TRIGGER_START"});try{await lo.deleteScheduledTrigger(v,C),n({type:"DELETE_TRIGGER_SUCCESS",payload:C}),De({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:C}),_n.success("Trigger deleted")}catch(b){const w=b instanceof Error?b.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:w}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:w}),b}},[]),g=h.useCallback(v=>{n({type:"SELECT_TRIGGER",payload:v})},[]),x=h.useCallback(()=>{n({type:"RESET"})},[]);return a.jsx(OI.Provider,{value:{...t,getScheduledTriggers:i,getScheduledTriggersByType:c,getScheduledTrigger:u,createScheduledTrigger:f,updateScheduledTrigger:m,deleteScheduledTrigger:y,selectScheduledTrigger:g,reset:x},children:e})}function MI(){const e=h.useContext(OI);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function gie(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:i,deleteScheduledTrigger:c,selectScheduledTrigger:u,reset:f,triggers:m,selectedTrigger:y,isLoading:g,error:x}=MI();return h.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:m,selectedTrigger:y,isLoading:g,error:x,getScheduledTriggers:v=>t(v),getScheduledTriggersByType:(v,C)=>n(v,C),getScheduledTrigger:(v,C)=>r(v,C),createScheduledTrigger:(v,C,b,w,R,j)=>s(v,C,b,w,R,j),updateScheduledTrigger:(v,C,b,w,R)=>i(v,C,b,w,R),deleteScheduledTrigger:(v,C)=>c(v,C),selectScheduledTrigger:u}}const yie=an({type:Gr(sl.SCHEDULED_REPORT_RUN),reportId:Dt().min(1,"Report ID is required")}),xie=yY(),vie=an({type:Ry(Fn),cronExpression:Dt().min(1,"Cron expression is required"),timeZone:Dt().min(1,"Time zone is required"),isActive:gY(),triggerConfig:vY([yie,xie])});function bie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=To({resolver:xi(vie),defaultValues:{type:e?e.type:n??Fn.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:sl.SCHEDULED_REPORT_RUN,reportId:t??""}}});h.useEffect(()=>{t&&s.getValues("type")===Fn.REPORT_RUN&&s.setValue("triggerConfig",{type:sl.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),h.useEffect(()=>{n&&(s.setValue("type",n),n===Fn.REPORT_RUN?s.setValue("triggerConfig",{type:sl.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const i=u=>{s.setValue("type",u),u===Fn.REPORT_RUN?s.setValue("triggerConfig",{type:sl.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null)},c=async u=>{try{await r(u)}catch(f){console.error("Error submitting form:",f)}};return{form:s,handleTypeChange:i,handleSubmit:s.handleSubmit(c),isDirty:s.formState.isDirty}}const Sie=[Oe.GOOGLE_SHEETS,Oe.EMAIL,Oe.SLACK,Oe.MS_TEAMS,Oe.GOOGLE_CHAT];function Cie({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=ts(),{dataMart:i}=ws();h.useEffect(()=>{i&&s(i.id)},[s,i]);const c=r.filter(u=>Sie.includes(u.dataDestination.type));return a.jsxs(ua,{value:e,onValueChange:t,disabled:n,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a report"})}),a.jsx(ha,{children:c.map(u=>{const f=aa.getInfo(u.dataDestination.type).icon;return a.jsx(Bn,{value:u.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(f,{className:"h-4 w-4",size:16}),a.jsx("span",{children:u.title})]})},u.id)})})]})}var Xy="Switch",[wie]=Sr(Xy),[Eie,Rie]=wie(Xy),kI=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f="on",onCheckedChange:m,form:y,...g}=e,[x,v]=h.useState(null),C=ht(t,_=>v(_)),b=h.useRef(!1),w=x?y||!!x.closest("form"):!0,[R,j]=ia({prop:s,defaultProp:i??!1,onChange:m,caller:Xy});return a.jsxs(Eie,{scope:n,checked:R,disabled:u,children:[a.jsx(et.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":zI(R),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:C,onClick:Me(e.onClick,_=>{j(D=>!D),w&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),w&&a.jsx(UI,{control:x,bubbles:!b.current,name:r,value:f,checked:R,required:c,disabled:u,form:y,style:{transform:"translateX(-100%)"}})]})});kI.displayName=Xy;var LI="SwitchThumb",PI=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Rie(LI,n);return a.jsx(et.span,{"data-state":zI(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});PI.displayName=LI;var jie="SwitchBubbleInput",UI=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const c=h.useRef(null),u=ht(c,i),f=D2(n),m=jS(t);return h.useEffect(()=>{const y=c.current;if(!y)return;const g=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(g,"checked").set;if(f!==n&&v){const C=new Event("click",{bubbles:r});v.call(y,n),y.dispatchEvent(C)}},[f,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:u,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});UI.displayName=jie;function zI(e){return e?"checked":"unchecked"}var Tie=kI,_ie=PI;function iC({className:e,...t}){return a.jsx(Tie,{"data-slot":"switch",className:se("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 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 dark:data-[state=unchecked]:bg-white/16",e),...t,children:a.jsx(_ie,{"data-slot":"switch-thumb",className:se("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 Nie(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 Mb(e,t="UTC"){const n=Nie(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:r,hour:s,day:i,month:c,dayOfWeek:u}=n;if(r.startsWith("*/")&&s==="*"&&i==="*"&&c==="*"&&u==="*"){const g=Number.parseInt(r.substring(2));if(!isNaN(g))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:g,timezone:t}}if(r!=="*"&&s.startsWith("*/")&&i==="*"&&c==="*"&&u==="*"){const g=Number.parseInt(s.substring(2));if(!isNaN(g)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:g,timezone:t}}const f=Number.parseInt(r),m=Number.parseInt(s),y=!isNaN(f)&&!isNaN(m)?`${m.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}`:"09:00";if(!isNaN(f)&&!isNaN(m)&&i==="*"&&c==="*"&&u==="*")return{type:"daily",time:y,weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};if(!isNaN(f)&&!isNaN(m)&&i==="*"&&c==="*"&&u!=="*"){const g=u.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=0&&x<=6);if(g.length>0)return{type:"weekly",time:y,weekdays:g,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(f)&&!isNaN(m)&&i!=="*"&&c==="*"&&u==="*"){const g=i.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=1&&x<=31);if(g.length>0)return{type:"monthly",time:y,weekdays:[1,2,3,4,5],monthDays:g,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 FI({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:i=3}){const[c,u]=h.useState(!1),f=g=>{const x=t.includes(g)?t.filter(v=>v!==g):[...t,g].sort((v,C)=>v-C);n(x)},m=(g,x)=>{x.preventDefault(),x.stopPropagation(),n(t.filter(v=>v!==g))},y=()=>{if(t.length===0)return a.jsx("span",{className:"text-muted-foreground text-sm",children:r});const g=t.map(x=>e.find(v=>v.value===x)).filter(Boolean);return g.length<=i?a.jsx("div",{className:"flex flex-wrap gap-1",children:g.map(x=>a.jsxs(Nr,{variant:"secondary",className:"h-5 text-xs",children:[x.label,a.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:v=>m(x.value,v),children:a.jsx(uc,{className:"h-2 w-2"})})]},x.value))}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(Nr,{variant:"secondary",className:"h-5 text-xs",children:[g[0].label,a.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:x=>m(g[0].value,x),children:a.jsx(uc,{className:"h-2 w-2"})})]}),g.length>1&&a.jsxs(Nr,{variant:"outline",className:"h-5 text-xs",children:["+",g.length-1]})]})};return a.jsxs(J2,{open:c,onOpenChange:u,modal:!0,children:[a.jsx(eC,{asChild:!0,children:a.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[a.jsx("div",{className:"flex-1 text-left",children:y()}),a.jsx(cS,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),a.jsx(tC,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:a.jsxs(Y2,{className:"h-full overflow-visible",children:[a.jsx(W2,{placeholder:s,className:"h-8"}),a.jsxs(gI,{className:"h-full max-h-[350px] overflow-y-auto",children:[a.jsx(yI,{children:"No items found."}),a.jsx(xI,{className:"h-full overflow-visible",children:e.map(g=>a.jsxs(X2,{value:g.value.toString(),onSelect:()=>f(g.value),className:"text-sm",children:[a.jsx(oa,{className:se("mr-2 h-3 w-3",t.includes(g.value)?"opacity-100":"opacity-0")}),g.label]},g.value))})]})]})})]})}const HI=[{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"}],Ip=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function $I(e,t){if(!t)return"Schedule is disabled";const n=e.time;switch(e.type){case"daily":return`Daily at ${n}`;case"weekly":return`Weekly on ${e.weekdays.map(s=>{var i;return(i=HI.find(c=>c.value===s))==null?void 0:i.label}).join(", ")} at ${n}`;case"monthly":{const s=[...e.monthDays].sort((c,u)=>c-u).map(c=>c===1?"1st":c===2?"2nd":c===3?"3rd":`${String(c)}th`);return`Monthly on the ${s.length===1?s[0]:s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(", ")}, and ${s[s.length-1]}`} at ${n}`}case"interval":return e.intervalType==="minutes"?`Every ${String(e.intervalValue)} minute${e.intervalValue!==1?"s":""}`:`Every ${String(e.intervalValue)} hour${e.intervalValue!==1?"s":""}`;case"custom":return"Custom schedule";default:return""}}function Aie(e,t,n=!0){const r=Mb(e,t);return $I(r,n)}const Die=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),kb=[5,10,15,30],Lb=[1,2,3,4,6,8,12],Oie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Type"}),a.jsxs(ua,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{})}),a.jsxs(ha,{children:[a.jsx(Bn,{value:"daily",children:"Daily"}),a.jsx(Bn,{value:"weekly",children:"Weekly"}),a.jsx(Bn,{value:"monthly",children:"Monthly"}),a.jsx(Bn,{value:"interval",children:"Interval"})]})]})]}),Iie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Time"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(It,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),fN=({value:e,onChange:t,disabled:n,timezones:r})=>a.jsxs("div",{className:"w-full space-y-2",children:[a.jsx(Ta,{children:"Timezone"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(nC,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),Mie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Days of Week"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(FI,{options:HI,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),kie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Days of Month"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(FI,{options:Die,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),Lie=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:s})=>a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Type"}),a.jsxs(ua,{value:e,onValueChange:i=>{n(i)},disabled:s,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{})}),a.jsxs(ha,{children:[a.jsx(Bn,{value:"minutes",children:"Minutes"}),a.jsx(Bn,{value:"hours",children:"Hours"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Every"}),a.jsxs(ua,{value:t.toString(),onValueChange:i=>{r(Number.parseInt(i)||1)},disabled:s,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{})}),a.jsx(ha,{children:(e==="minutes"?kb:Lb).map(i=>a.jsxs(Bn,{value:i.toString(),children:[i," ",e==="minutes"?"min":"hr"]},i))})]})]})]}),Pie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Ta,{className:"text-sm",children:"Cron Expression"}),a.jsx(It,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),a.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function Pb({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:i=!0,showSaveButton:c=!1,hideEnableSwitch:u=!1}){const[f,m]=h.useState(n),[y,g]=h.useState(t??Ip()),[x,v]=h.useState(!1),C=h.useMemo(()=>JW.getTimezonesWithOffset().map(H=>({value:H.identifier,label:H.displayName,offset:H.offsetString,isDST:H.isDST})),[]),[b,w]=h.useState(()=>Mb(e,y)),[R,j]=h.useState(""),[_,D]=h.useState("");h.useEffect(()=>{m(n)},[n]),h.useEffect(()=>{const H=t??Ip();g(H)},[t]),h.useEffect(()=>{if(e){const H=Mb(e,y);w(H)}},[e,y]);const O=H=>{const[M,B]=H.time.split(":").map(Number);switch(H.type){case"daily":return`${String(B)} ${String(M)} * * *`;case"weekly":return`${String(B)} ${String(M)} * * ${H.weekdays.join(",")}`;case"monthly":return`${String(B)} ${String(M)} ${H.monthDays.join(",")} * *`;case"interval":return H.intervalType==="minutes"?`*/${String(H.intervalValue)} * * * *`:`0 */${String(H.intervalValue)} * * *`;case"custom":return H.customCron;default:return`${String(B)} ${String(M)} * * *`}},A=h.useCallback(H=>{w(M=>{if(M.intervalType===H)return console.log("Type unchanged, skipping update"),M;const $=(H==="minutes"?kb:Lb)[0];return{...M,intervalType:H,intervalValue:$}})},[]),T=h.useCallback(H=>{w(M=>(M.intervalType==="minutes"?kb:Lb).includes(H)?{...M,intervalValue:H}:M)},[]),I=h.useMemo(()=>H=>$I(H,f),[f]);h.useEffect(()=>{const H=O(b);j(H),D(I(b))},[b,f,y,I]);const k=h.useRef(""),V=h.useRef(""),U=h.useRef(!1);h.useEffect(()=>{const H=O(b);r&&(k.current!==H||V.current!==y||U.current!==f)&&(r({cron:H,timezone:y,enabled:f}),k.current=H,V.current=y,U.current=f)},[b,y,f,r]);const K=H=>{m(H)},G=H=>{g(H),w(M=>({...M,timezone:H}))},q=["daily","weekly","monthly"].includes(b.type);return a.jsxs("div",{className:s,children:[!u&&a.jsx("div",{className:"mb-4 space-y-4 pt-0",children:a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ta,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:f?"Enabled":"Disabled"}),a.jsx(iC,{id:"schedule-enabled",checked:f,onCheckedChange:K})]})})}),a.jsxs("div",{className:"space-y-4 pt-0",children:[a.jsxs("div",{className:`space-y-4 ${f?"":"opacity-50"}`,children:[a.jsx(Oie,{value:b.type,onChange:H=>{w(M=>({...M,type:H}))},disabled:!f}),b.type!=="custom"&&b.type!=="interval"&&a.jsxs("div",{className:"flex gap-3",children:[a.jsx(Iie,{value:b.time,onChange:H=>{w(M=>({...M,time:H}))},disabled:!f}),q&&a.jsx(fN,{value:y,onChange:G,disabled:!f,timezones:C})]}),(b.type==="interval"||b.type==="custom")&&a.jsx(fN,{value:y,onChange:G,disabled:!f,timezones:C}),b.type==="weekly"&&a.jsx(Mie,{value:b.weekdays,onChange:H=>{w(M=>({...M,weekdays:H}))},disabled:!f}),b.type==="monthly"&&a.jsx(kie,{value:b.monthDays,onChange:H=>{w(M=>({...M,monthDays:H}))},disabled:!f}),b.type==="interval"&&a.jsx(Lie,{intervalType:b.intervalType,intervalValue:b.intervalValue,onTypeChange:A,onValueChange:T,disabled:!f}),b.type==="custom"&&a.jsx(Pie,{value:b.customCron,onChange:H=>{w(M=>({...M,customCron:H}))},disabled:!f})]}),i&&a.jsxs(a.Fragment,{children:[a.jsx(mS,{className:"my-3"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{v(!x)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(FA,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),x?a.jsx(Yu,{className:"text-muted-foreground h-4 w-4"}):a.jsx(Ss,{className:"text-muted-foreground h-4 w-4"})]}),x&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),a.jsx(Nr,{variant:f?"default":"secondary",className:"text-xs",children:f?"Enabled":"Disabled"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),a.jsx(Nr,{variant:"secondary",className:"font-mono text-xs",children:R})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),a.jsx(Nr,{variant:"outline",className:"text-xs",children:y})]}),a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),a.jsx("span",{className:"flex-1 text-right text-xs",children:_})]})]}),f&&q&&y!==Ip()&&a.jsxs(aC,{className:"border-amber-200 bg-amber-50",children:[a.jsx(yh,{className:"h-4 w-4"}),a.jsx(AI,{children:"Time Zone"}),a.jsxs(sC,{children:["Schedule runs in ",y," (not your local ",Ip()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&a.jsx(we,{className:"w-full",disabled:!f,children:"Save Schedule"})]})]})}function Uie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"trigger-type-options-description-details",children:[a.jsx(Yt,{children:"How do I choose a type?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Report Run"})," - runs a report to import data from the specified Data Storage into a Destination provider (e.g. Google Sheets document)."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Connector Run"})," - runs a connector (e.g., Facebook Ads) configured in the Data Mart to update raw data in the selected Data Storage."]})]})]})})}function zie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"trigger-type-change-description-details",children:[a.jsx(Yt,{children:"How do I change the trigger type?"}),a.jsx(Wt,{children:a.jsx("p",{children:"Trigger type cannot be changed after the trigger is created. If you need a different type, delete the existing trigger and create a new one with the desired type."})})]})})}function Fie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"report-change-description-details",children:[a.jsx(Yt,{children:"How do I change a report?"}),a.jsx(Wt,{children:a.jsx("p",{children:"The report cannot be changed after the trigger is created. If you need a different report, delete the existing trigger and create a new one with the desired report."})})]})})}function Hie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"report-select-description-details",children:[a.jsx(Yt,{children:"How do I choose the report?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),a.jsxs("p",{children:["You can use an existing one or create a new one on the ",a.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function $ie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:i}){const[c,u]=h.useState(!1),{form:f,handleTypeChange:m,handleSubmit:y,isDirty:g}=bie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async w=>{u(!0);try{await r(w)}finally{u(!1)}}});h.useEffect(()=>{i==null||i(g)},[g,i]);const{control:x,watch:v}=f,b=v("type")===Fn.REPORT_RUN;return a.jsx(_l,{...f,children:a.jsxs(yi,{onSubmit:w=>void y(w),noValidate:!1,children:[a.jsxs(Nl,{children:[a.jsx(Nt,{control:x,name:"type",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),a.jsxs(ua,{onValueChange:R=>{w.onChange(R),m(R)},defaultValue:w.value,disabled:!!n||!!e||!!v("triggerConfig.reportId"),children:[a.jsx(jt,{children:a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select trigger type"})})}),a.jsxs(ha,{children:[a.jsx(Bn,{value:Fn.REPORT_RUN,children:"Report Run"}),a.jsx(Bn,{value:Fn.CONNECTOR_RUN,children:"Connector Run"})]})]}),a.jsx(xn,{children:e?a.jsx(zie,{}):a.jsx(Uie,{})}),a.jsx(Mt,{})]})}),b&&a.jsx(Nt,{control:x,name:"triggerConfig.reportId",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),a.jsx(jt,{children:a.jsx(t2,{children:a.jsx(Cie,{value:w.value,onChange:w.onChange,disabled:!!t||!!e})})}),a.jsx(xn,{children:e!=null&&e.triggerConfig?a.jsx(Fie,{}):a.jsx(Hie,{})}),a.jsx(Mt,{})]})}),a.jsx(Pb,{showPreview:!1,cron:v("cronExpression"),timezone:v("timeZone"),enabled:v("isActive"),onChange:w=>{f.setValue("cronExpression",w.cron,{shouldDirty:!0}),f.setValue("timeZone",w.timezone,{shouldDirty:!0}),f.setValue("isActive",w.enabled,{shouldDirty:!0})},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-transparent dark:bg-white/4"})]}),a.jsxs(Mc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!g||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),s&&a.jsx(we,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Vie({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=h.useMemo(()=>Aie(e,t,n),[e,t,n]);return a.jsxs("div",{children:[a.jsx("div",{children:r}),n&&a.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function Gie({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),u=()=>{c(!1),n(e.id)};return a.jsxs("div",{className:"text-right",onClick:f=>{f.stopPropagation()},children:[a.jsxs(Cr,{open:r,onOpenChange:s,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${r?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[a.jsxs(Ct,{onClick:()=>{t(e.id)},children:[a.jsx(id,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),a.jsx(la,{}),a.jsxs(Ct,{onClick:()=>{c(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),a.jsx(br,{open:i,onOpenChange:c,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:u,variant:"destructive"})]})}function Bie({connector:e}){const{connectors:t}=Ic(),n=Nte(e,t);return a.jsx(a.Fragment,{children:n})}function VI({connector:e}){return a.jsx(Bie,{connector:e})}function qie(e){if(e.length===0)return{lastRunDate:null,lastRunStatus:null,totalRuns:0,firstRunDate:null};const t=e[0],n=e[e.length-1],r=new Date(n.createdAt);return{lastRunDate:new Date(t.createdAt),lastRunStatus:t.status,totalRuns:e.length,firstRunDate:r}}const Kie=e=>{const{connectors:t}=Ic();return h.useMemo(()=>t.find(n=>n.name===e),[t,e])},Zie=ae.memo(function({connector:t,children:n}){const r=Kie(t.source.name),{dataMart:s,runs:i,getDataMartRuns:c}=ws();h.useEffect(()=>{s!=null&&s.id&&c(s.id)},[s==null?void 0:s.id,c]);const u=h.useMemo(()=>r!=null&&r.logoBase64?a.jsx(Ac,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=h.useCallback(()=>{s!=null&&s.storage&&sQ(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=h.useMemo(()=>qie(i),[i]),y=h.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:TJ(m.lastRunStatus),statusText:NJ(m.lastRunStatus),date:m.lastRunDate},[m]),g=h.useMemo(()=>(s==null?void 0:s.storage)&&oQ(s.storage),[s]),x=h.useMemo(()=>{const v=t.source.fields.length.toString();return`${t.source.node} • ${v} fields`},[t.source.node,t.source.fields.length]);return a.jsxs(Iy,{children:[a.jsx(My,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(ky,{children:[a.jsxs(s2,{children:[a.jsx(o2,{children:u}),a.jsxs(i2,{children:[a.jsx(l2,{children:a.jsx(VI,{connector:t})}),a.jsx(c2,{children:x})]})]}),a.jsxs(u2,{children:[a.jsxs(el,{children:[a.jsx(tl,{children:"Last run status:"}),a.jsx(nl,{children:y?a.jsx(Uh,{type:y.statusType,variant:"ghost",children:y.statusText}):"Not run yet"})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Last run date:"}),a.jsx(nl,{children:y?a.jsx(Vs,{date:y.date}):"Never run"})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Total runs:"}),a.jsxs(nl,{children:[m.totalRuns," runs",m.firstRunDate&&a.jsxs(a.Fragment,{children:[", since"," ",m.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),a.jsx(d2,{children:a.jsxs(we,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[g,a.jsx(si,{className:"ml-1 inline h-4 w-4","aria-hidden":"true"})]})})]})]})},(e,t)=>e.connector.source.name===t.connector.source.name&&e.connector.storage.fullyQualifiedName===t.connector.storage.fullyQualifiedName&&e.connector.source.node===t.connector.source.node&&e.connector.source.fields.length===t.connector.source.fields.length);function Yie(e){const t=e.triggerConfig,n=aa.getInfo(t.report.dataDestination.type).icon;return a.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[a.jsx(n,{className:"h-4 w-4",size:16}),t.report.title,a.jsx(RJ,{report:t.report,children:a.jsx(Fr,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Wie(e){var s;const t=e.triggerConfig,{connector:n}=t.connector,r=(s=n.info)!=null&&s.logoBase64?a.jsx(Ac,{base64:n.info.logoBase64,className:"h-4 w-4",size:16}):a.jsx(cc,{className:"h-4 w-4",size:16});return a.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[r,a.jsx(VI,{connector:n}),a.jsx(Zie,{connector:n,children:a.jsx(Fr,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Xie({trigger:e}){switch(e.type){case Fn.REPORT_RUN:return Yie(e);case Fn.CONNECTOR_RUN:return Wie(e);default:return a.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function Qie({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===Fn.REPORT_RUN?"Report Run":"Connector Run";return a.jsx(Nr,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>a.jsx(Xie,{trigger:n.original}),meta:{title:"Run Target"}},{accessorKey:"cronExpression",size:20,header:"Schedule",cell:({row:n})=>{const r=n.getValue("cronExpression"),s=n.original.timeZone,i=n.getValue("isActive");return a.jsx(Vie,{cronExpression:String(r),timeZone:s,isEnabled:i})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(Vs,{date:new Date(r)}):"Not scheduled"})},meta:{title:"Next Run"}},{accessorKey:"lastRun",size:15,header:"Last Run",cell:({row:n})=>{const r=n.original.lastRun;return a.jsx("div",{className:"text-sm",children:r?a.jsx(Vs,{date:new Date(r)}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"Never run"})})},meta:{title:"Last Run"}},{accessorKey:"isActive",size:15,header:"Trigger Status",cell:({row:n})=>{const r=n.getValue("isActive");return a.jsx(Uh,{type:r?Jn.SUCCESS:Jn.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>a.jsx(xd,{table:n}),cell:({row:n})=>a.jsx(Gie,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function Jie({table:e,onPreviousClick:t,onNextClick:n}){return a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function lC({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){Ol(e);const{createScheduledTrigger:i,updateScheduledTrigger:c,selectedTrigger:u}=MI(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:y,confirmClose:g,handleFormDirtyChange:x,handleFormSubmitSuccess:v}=kc(t),C=!!u,b=h.useMemo(()=>u?{type:u.type,cronExpression:u.cronExpression,timeZone:u.timeZone,isActive:u.isActive,triggerConfig:u.type===Fn.REPORT_RUN?{type:sl.SCHEDULED_REPORT_RUN,reportId:u.triggerConfig.reportId}:null}:void 0,[u]),w=async j=>{C?await c(n,u.id,j.cronExpression,j.timeZone,j.isActive):await i(n,j.type,j.cronExpression,j.timeZone,j.isActive,j.triggerConfig),v()},R=h.useRef(!1);return h.useEffect(()=>{const j=C?"Edit":"Create",_=(u==null?void 0:u.type)??s;e&&!R.current?(De({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:j,label:_}),R.current=!0):!e&&R.current&&(De({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:j,label:_}),R.current=!1)},[e,C,u,s]),a.jsxs(a.Fragment,{children:[a.jsx(ui,{open:e,onOpenChange:j=>{j||y()},children:a.jsxs(di,{children:[a.jsxs(fi,{children:[a.jsxs(hi,{children:[C?"Edit":"Create"," Scheduled Trigger"]}),a.jsx(yl,{children:"Configure automatic runs for your reports or connectors."})]}),a.jsx($ie,{preSelectedReportId:r,preSelectedType:s,initialData:b,onSubmit:w,onCancel:y,onDirtyChange:x})]})}),a.jsx(br,{open:f,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function ele({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,i]=h.useState(!1),c=h.useCallback(()=>{i(!1)},[]),u=h.useCallback(R=>{r(R)},[r]),f=h.useMemo(()=>Qie({onEditTrigger:n,onDeleteTrigger:u}),[n,u]),{sorting:m,setSorting:y,columnVisibility:g,setColumnVisibility:x}=Oc({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),v=wl({data:e,columns:f,getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:y,getSortedRowModel:Dc(),getFilteredRowModel:yd(),state:{sorting:m,columnVisibility:g},onColumnVisibilityChange:x,enableGlobalFilter:!0,enableColumnResizing:!1}),C=h.useCallback(()=>{v.previousPage()},[v]),b=h.useCallback(()=>{v.nextPage()},[v]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[a.jsx(Rl,{className:"dm-card-table-header",children:v.getHeaderGroups().map(R=>a.jsx(Hn,{className:"dm-card-table-header-row",children:R.headers.map(j=>a.jsx(Tl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:j.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.getSize())}%`},children:j.isPlaceholder?null:typeof j.column.columnDef.header=="function"?j.column.columnDef.header(j.getContext()):j.column.columnDef.header},j.id))},R.id))}),a.jsx(jl,{className:"dm-card-table-body",children:v.getRowModel().rows.length?v.getRowModel().rows.map((R,j)=>a.jsx(Hn,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":j+1,children:R.getVisibleCells().map((_,D)=>a.jsx($r,{className:`whitespace-normal ${_.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":D+1,style:_.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:typeof _.column.columnDef.cell=="function"?_.column.columnDef.cell(_.getContext()):_.column.columnDef.cell},_.id))},R.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:f.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),a.jsx(Jie,{table:v,onPreviousClick:C,onNextClick:b}),a.jsx(lC,{isOpen:s,onClose:c,dataMartId:t})]})}function tle({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=gie(e),[i,c]=h.useState(!1);h.useEffect(()=>{s&&c(!0)},[s]);const u=y=>{const g=t.find(x=>x.id===y);g&&r(g)},f=()=>{c(!1),r(null)},m=async y=>{try{await n(e,y)}catch(g){console.error("Error deleting trigger:",g)}};return a.jsxs(a.Fragment,{children:[a.jsx(ele,{triggers:t,dataMartId:e,onEditTrigger:u,onDeleteTrigger:y=>void m(y)}),a.jsx(lC,{isOpen:i,onClose:f,dataMartId:e})]})}function cC(){return a.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:a.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[a.jsx(lS,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Time Triggers"}),a.jsxs("p",{className:"text-muted-foreground",children:["Set up automatic runs in the ",a.jsx("span",{className:"font-medium",children:"Triggers"})," tab once you’ve saved and published this Data Mart."]})]})]})})}function Mp(e){return e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}function Lg(e){return e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function nle({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:s}){const i=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[u,f]=h.useState(""),[m,y]=h.useState(""),[g,x]=h.useState(""),[v,C]=h.useState(null),[b,w]=h.useState(null),[R,j]=h.useState(null),_=(I,k=!1)=>I.trim()?k&&I.startsWith('"')&&I.endsWith('"')?I.slice(1,-1)?null:"Quoted identifier cannot be empty":/^[A-Za-z][A-Za-z0-9_]*$/.test(I)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",D=h.useCallback((I,k,V,U,K,G)=>{let q;if(e===je.SNOWFLAKE&&K){const M=Mp(K),B=Mp(k);q=`${I}.${M}.${B}`}else q=`${I}.${k}`;const H=e===je.SNOWFLAKE?!!(I&&K&&k&&V===null&&G===null&&U===null):!!(I&&k&&V===null&&U===null);s({fullyQualifiedName:q,isValid:H})},[s,e]);h.useEffect(()=>{let I="",k="",V="";if(t!=null&&t.fullyQualifiedName){const M=t.fullyQualifiedName.match(/(?:[^."]+|"[^"]*")+/g)??[];if(e===je.SNOWFLAKE&&M.length===3){const B=M[0],$=M[1],re=M[2];B&&$&&re&&(I=B,k=Lg($),V=Lg(re))}else if(M.length>=2){const B=M[0],$=M[1];B&&$&&(I=B,V=$)}}else I=`${c}_owox`,e===je.SNOWFLAKE&&(k="PUBLIC"),V=i;const U=_(I),K=e===je.SNOWFLAKE?_(k,!0):null,G=_(V,e===je.SNOWFLAKE);f(I),y(k),x(V),C(U),w(K),j(G);const q=e===je.SNOWFLAKE&&k?`${I}.${Mp(k)}.${Mp(V)}`:`${I}.${V}`,H=e===je.SNOWFLAKE?!!(I&&k&&V&&U===null&&K===null&&G===null):!!(I&&V&&U===null&&G===null);((t==null?void 0:t.fullyQualifiedName)!==q||t.isValid!==H)&&D(I,V,U,G,k,K)},[t,i,c,e,D]);const O=I=>{f(I);const k=_(I);C(k),D(I,g,k,R,m,b)},A=I=>{y(I);const k=_(I,!0);w(k),D(u,g,v,R,I,k)},T=I=>{x(I);const k=_(I,e===je.SNOWFLAKE);j(k),D(u,I,v,k,m,b)};return a.jsxs(ri,{children:[e===je.GOOGLE_BIGQUERY&&a.jsxs(a.Fragment,{children:[a.jsx(ni,{icon:a.jsx(ID,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),a.jsxs(al,{title:"Choose where to store your data",children:[a.jsxs(Bi,{children:[a.jsx(Ba,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),a.jsx(It,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"dataset-name-error":void 0,onChange:I=>{O(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),v&&a.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Bi,{children:[a.jsx(Ba,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(It,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"table-name-error":void 0,onChange:I=>{T(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),R&&a.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),e===je.AWS_ATHENA&&a.jsxs(a.Fragment,{children:[a.jsx(ni,{icon:a.jsx(MD,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),a.jsxs(al,{title:"Choose where to store your data",children:[a.jsxs(Bi,{children:[a.jsx(Ba,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),a.jsx(It,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"database-name-error":void 0,onChange:I=>{O(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),v&&a.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Bi,{children:[a.jsx(Ba,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(It,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"athena-table-name-error":void 0,onChange:I=>{T(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),R&&a.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),e===je.SNOWFLAKE&&a.jsxs(a.Fragment,{children:[a.jsx(ni,{icon:a.jsx(kD,{}),title:"Snowflake",docUrl:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",variant:"compact"}),a.jsxs(al,{title:"Choose where to store your data",children:[a.jsxs(Bi,{children:[a.jsx(Ba,{required:!0,htmlFor:"snowflake-database-name",tooltip:"Enter database name for Snowflake where the connector data will be stored.",children:"Database name"}),a.jsx(It,{type:"text",id:"snowflake-database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"snowflake-database-name-error":void 0,onChange:I=>{O(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn't exist"}),v&&a.jsx("p",{id:"snowflake-database-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Bi,{children:[a.jsx(Ba,{required:!0,htmlFor:"snowflake-schema-name",tooltip:"Enter schema name for Snowflake where the connector data will be stored. Identifiers will be quoted automatically to preserve case sensitivity.",children:"Schema name"}),a.jsx(It,{type:"text",id:"snowflake-schema-name",placeholder:"PUBLIC",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"snowflake-schema-name-error":void 0,onChange:I=>{A(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Schema is auto-created on first run if it doesn't exist"}),b&&a.jsx("p",{id:"snowflake-schema-name-error",className:"text-destructive text-sm",children:b})]}),a.jsxs(Bi,{children:[a.jsx(Ba,{required:!0,htmlFor:"snowflake-table-name",tooltip:"Enter table name where the connector data will be stored. Identifiers will be quoted automatically to preserve case sensitivity.",children:"Table name"}),a.jsx(It,{type:"text",id:"snowflake-table-name",placeholder:"my_table",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"snowflake-table-name-error":void 0,onChange:I=>{T(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn't exist"}),R&&a.jsx("p",{id:"snowflake-table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),a.jsx(al,{title:"Schedule updates",children:a.jsx(cC,{})})]})}function rle({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:s="full",initialStep:i,preselectedConnector:c,onDirtyChange:u}){const[f,m]=h.useState(!1),[y,g]=h.useState(null),[x,v]=h.useState(""),[C,b]=h.useState([]),[w,R]=h.useState(1),[j,_]=h.useState({}),[D,O]=h.useState(!1),[A,T]=h.useState(new Set),[I,k]=h.useState(new Set),{connectors:V,connectorSpecification:U,connectorFields:K,loading:G,loadingSpecification:q,loadingFields:H,error:M,fetchAvailableConnectors:B,fetchConnectorSpecification:$,fetchConnectorFields:re}=Ic();h.useEffect(()=>{u==null||u(f)},[f,u]);const[ge,P]=h.useState(null),z=h.useMemo(()=>n?[{id:1,title:"Configuration",description:"Set up connector parameters"}]:s==="fields-only"?[{id:1,title:"Select Fields",description:"Pick specific fields"}]:[{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"}],[n,s]),F=z.length,Z=h.useCallback(async ke=>{!A.has(ke)&&!q&&(T(Y=>new Set(Y).add(ke)),await $(ke))},[A,q,$]),Q=h.useCallback(async ke=>{I.has(ke)||(k(Y=>new Set(Y).add(ke)),await re(ke))},[I,re]);h.useEffect(()=>{if(!c||y||V.length===0)return;const ke=V.find(Y=>Y.name===c);ke&&(g(ke),R(i??2),Z(ke.name),!n&&s!=="fields-only"&&Q(ke.name))},[c,V,y,i,n,s,Z,Q]),h.useEffect(()=>{if(V.length===0&&!G&&B(),r&&V.length>0&&!y){const{source:ke,storage:Y}=r;v(ke.node),b(ke.fields),_(ke.configuration[0]||{}),P({fullyQualifiedName:Y.fullyQualifiedName,isValid:!0});const ne=V.find(ce=>ce.name===ke.name);ne&&(g(ne),Z(ne.name),!n&&s!=="fields-only"&&Q(ne.name),s==="fields-only"&&Q(ne.name))}if(n&&V.length>0&&!y&&!r){const ke=V[0];g(ke),Z(ke.name)}},[s,r,V,n,G,B,Z,Q,y]);const le=ke=>{g(ke),_({}),O(!1),m(!0),T(Y=>{const ne=new Set(Y);return ne.delete(ke.name),ne}),Z(ke.name),Q(ke.name),De({event:"connector_setup",category:ke.name,action:"connector_selected",label:ke.displayName})},J=ke=>{v(ke),b([]),m(!0)},ie=(ke,Y)=>{b(Y?ne=>ne.includes(ke)?ne:[...ne,ke]:ne=>ne.filter(ce=>ce!==ke)),m(!0)},ye=(ke,Y)=>{b(Y?ne=>{const ce=ke.filter(Ie=>!ne.includes(Ie));return[...ne,...ce]}:ne=>ne.filter(ce=>!ke.includes(ce))),m(!0)},Ce=ke=>{P(ke),m(!0)},He=h.useCallback(ke=>{_(ke),m(!0)},[]),Ee=h.useCallback(ke=>{O(ke)},[]);h.useEffect(()=>{U&&(U.some(Y=>Y.required&&Y.name!=="Fields")||O(!0))},[U]),h.useEffect(()=>{var Y;const ke=((Y=z[w-1])==null?void 0:Y.title)??`Step ${String(w)}`;y&&De({event:"connector_setup",category:y.name,action:"step",label:ke})},[w,y]);const Ke=()=>{w<F&&R(w+1)},nt=()=>{w>1&&R(w-1)},Ft=()=>{if(n)return y!==null&&D;if(s==="fields-only")switch(w){case 1:return C.length>0;default:return!1}switch(w){case 1:return y!==null;case 2:return D;case 3:return x!=="";case 4:return C.length>0;case 5:return ge!==null&&ge.fullyQualifiedName!==""&&ge.isValid;default:return!1}},Pt=()=>w>1,On=(ke,Y)=>{if(!ke)return Y;const ne=ke.find(ce=>ce.name===Y);return(ne==null?void 0:ne.destinationName)??Y},yn=()=>{if(n&&w===1)return U&&y?a.jsx(uN,{connector:y,connectorSpecification:U,onConfigurationChange:He,onValidationChange:Ee,initialConfiguration:j,loading:q,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(w){case 1:return y&&x&&K?a.jsx(dN,{connector:y,connectorFields:K,selectedField:x,selectedFields:C,onFieldToggle:ie,onSelectAllFields:ye}):null;default:return null}switch(w){case 1:return a.jsx(Yoe,{connectors:V,selectedConnector:y,loading:G,error:M,onConnectorSelect:le,onConnectorDoubleClick:()=>{R(ke=>ke<F?ke+1:ke)}});case 2:return y&&U?a.jsx(uN,{connector:y,connectorSpecification:U,onConfigurationChange:He,onValidationChange:Ee,initialConfiguration:j,loading:q,isEditingExisting:!1}):null;case 3:return y&&K?a.jsx(die,{connectorFields:K,connector:y,selectedField:x,connectorName:y.displayName,loading:H,onFieldSelect:J}):null;case 4:return y&&x&&K?a.jsx(dN,{connector:y,connectorFields:K,selectedField:x,selectedFields:C,onFieldToggle:ie,onSelectAllFields:ye}):null;case 5:return x&&K?a.jsx(nle,{dataStorageType:t,destinationName:On(K,x),connectorName:(y==null?void 0:y.displayName)??"",target:ge,onTargetChange:Ce}):null;default:return null}};return a.jsxs(Pre,{children:[a.jsx(Ure,{children:yn()}),a.jsx(zre,{variant:"horizontal",children:a.jsx(Woe,{currentStep:w,totalSteps:F,canGoNext:Ft(),canGoBack:Pt(),isLoading:q||H,onNext:Ke,onBack:nt,onFinish:()=>{n&&y?(e({source:{name:y.name,configuration:[j],node:(r==null?void 0:r.source.node)??x,fields:(r==null?void 0:r.source.fields)??C},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}),De({event:"connector_setup",category:y.name,action:"created",label:"configuration-only"})):s==="fields-only"&&r?(e({source:{...r.source,fields:C},storage:r.storage}),De({event:"connector_setup",category:r.source.name,action:"created",label:"fields-only"})):y&&ge&&(e({source:{name:y.name,configuration:[j],node:x,fields:C},storage:{fullyQualifiedName:ge.fullyQualifiedName}}),De({event:"connector_setup",category:y.name,action:"created",label:"full"})),m(!1)}})})]})}function GI({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:i=null,mode:c="full",initialStep:u,preselectedConnector:f}){const{showUnsavedDialog:m,setShowUnsavedDialog:y,handleClose:g,confirmClose:x,handleFormDirtyChange:v,handleFormSubmitSuccess:C}=kc(t);return Ol(e),a.jsxs(a.Fragment,{children:[a.jsx(ui,{open:e,onOpenChange:b=>{b||g()},children:a.jsxs(di,{children:[a.jsxs(fi,{children:[a.jsx(hi,{children:c==="fields-only"?"Connector Fields":i!=null&&i.source.name?"Edit Connector":"Set Up Connector"}),a.jsx(yl,{children:c==="fields-only"?"Select fields for your Data Mart":i!=null&&i.source.name?"Update configuration":"Follow these steps to set it up"})]}),a.jsx(rle,{onSubmit:b=>{r(b),C()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:i,mode:c,initialStep:u,preselectedConnector:f,onDirtyChange:v})]})}),a.jsx(br,{open:m,onOpenChange:y,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:x,variant:"destructive"})]})}const uC=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:i,isOpen:c,onClose:u})=>{const[f,m]=h.useState(!1),[y,g]=h.useState(1),[x,v]=h.useState();h.useEffect(()=>{c!==void 0&&m(c)},[c]);const C=()=>{v(void 0),g(1),m(!0)},b=()=>{m(!1),u==null||u()};return h.useEffect(()=>{i&&(i==="connector"?(v(void 0),g(1),m(!0)):(v(i),g(2),m(!0)))},[i]),a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{onClick:C,style:{cursor:"pointer"},children:n}),a.jsx(ad,{children:a.jsx(GI,{isOpen:f,onClose:b,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:y,preselectedConnector:x})})]})};function ale({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return a.jsx(uC,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:s,children:a.jsxs(we,{type:"button",variant:"outline",className:"flex h-24 w-full cursor-pointer items-center justify-center gap-2 border-0 shadow-none dark:border-transparent dark:bg-transparent dark:hover:bg-white/4",children:[a.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:a.jsx(dS,{className:"h-4 w-4",strokeWidth:2.25})}),a.jsx("span",{children:"Setup Connector"}),a.jsx(_a,{className:"h-6 w-6"})]})})}const sle=e=>{switch(e){case je.GOOGLE_BIGQUERY:return"Google BigQuery";case je.AWS_ATHENA:return"AWS Athena";case je.SNOWFLAKE:return"Snowflake";default:return e}},Ou=e=>typeof e=="object"&&"connector"in e,_f=e=>{if(!Ou(e))return!1;const{source:t,storage:n}=e.connector,r=!!t.name&&!!t.configuration&&t.configuration.length>0&&!!t.node&&!!t.fields&&t.fields.length>0,s=n.fullyQualifiedName.split("."),i=s.length===2||s.length===3;return r&&i};function ole({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:s,dataStorage:i}){const c=Sl.getInfo(i.type),{connectors:u,fetchAvailableConnectors:f}=Ic();h.useEffect(()=>{f()},[f]);const m=C=>{const b=u.find(w=>w.name===C);if(b!=null&&b.logoBase64)return()=>a.jsx(Ac,{base64:b.logoBase64,size:24})},y=()=>{const C=t.connector.source.node||"No node selected";return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground/75",children:"Data:"})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:C}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsxs("span",{className:"text-muted-foreground flex items-center gap-1 font-medium",children:[a.jsx("span",{children:"Edit config"}),a.jsx(_a,{className:"h-3 w-3"})]})}),a.jsx(St,{children:"Edit connector configuration"})]})]})},g=(C,b,w)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[C,":"]})," ",a.jsx(gn,{href:w,onClick:R=>{R.stopPropagation()},children:b})]}),x=()=>{switch(i.type){case je.GOOGLE_BIGQUERY:{const C=i.config.projectId,b=t.connector.storage.fullyQualifiedName,w=b.split(".")[0],R=b.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${w}`,_=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${w}!3s${R}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Dataset",w,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,_),a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx(Fr,{className:"h-4 w-4"})}),a.jsx(St,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case je.AWS_ATHENA:{const C=i.config.region,b=t.connector.storage.fullyQualifiedName,[w,R]=b.split("."),j=`https://console.aws.amazon.com/athena/home?region=${C}#/query-editor`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Database",w,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,j),a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx(Fr,{className:"h-4 w-4"})}),a.jsx(St,{children:"The database and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case je.SNOWFLAKE:{const C=i.config.account,w=t.connector.storage.fullyQualifiedName.split("."),R=w[0],j=w[1],_=w[2],D=`https://${C}.snowflakecomputing.com`,O=`${D}/#/data/databases/${R}`,A=`${D}/#/data/databases/${R}/schemas/${j}`,T=`${D}/#/data/databases/${R}/schemas/${j}/table/${_}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Database",R,O),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Schema",Lg(j),A),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",Lg(_),T),a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx(Fr,{className:"h-4 w-4"})}),a.jsx(St,{children:"The database, schema and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}default:return"Unknown storage type configuration"}},v=()=>s!==1;return a.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[a.jsx("div",{className:"flex-grow",children:a.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[a.jsx(uC,{dataStorageType:i.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:a.jsx(Nb,{icon:m(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:y(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),a.jsx(Nb,{title:sle(i.type),icon:c.icon,subtitle:x(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),a.jsx("div",{className:"shrink-0 px-4",children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("span",{children:a.jsx(we,{type:"button",variant:"ghost",onClick:()=>{v()&&n(e)},disabled:!v(),children:a.jsx(es,{className:"h-4 w-4"})})})}),!v()&&a.jsx(St,{children:"Remove last configuration only after adding a new one."})]})})]})}function ile({storageType:e,onAddConfiguration:t,existingConnector:n}){return a.jsx("div",{children:a.jsx(uC,{dataStorageType:e,onSubmit:r=>{const s=r.source.configuration[0]||{};t(s)},configurationOnly:!0,existingConnector:n?{source:{...n.source,configuration:[]},storage:n.storage}:void 0,children:a.jsxs(we,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(ma,{className:"h-4 w-4"}),a.jsx("span",{children:"Configuration"})]})})})}function lle({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:s}){const{dataMart:i,runDataMart:c}=bs(),{setValue:u,getValues:f,trigger:m}=vd(),[y,g]=h.useState(!1),[x,v]=h.useState(!1);h.useEffect(()=>{r&&v(!0)},[r]);const C=(i==null?void 0:i.status)??Ar.DRAFT,b=async q=>{u("definition",q,{shouldDirty:!0,shouldTouch:!0}),await m("definition")&&s&&s()},w=async q=>{const H=q.source,M=q.storage;await b({connector:{source:H,storage:M}})},R=async q=>{if(i){if(i.status.code!==Ar.PUBLISHED){_t.error("Manual run is only available for published data marts");return}await c({id:i.id,payload:q})}},j=q=>async H=>{const B=f().definition;if(typeof B=="object"&&Ou(B)){const $=[...B.connector.source.configuration];$[q]=H.source.configuration[0]||{};const re={connector:{...B.connector,source:{...B.connector.source,configuration:$}}};await b(re)}},_=async q=>{const M=f().definition;if(typeof M=="object"&&Ou(M)){const B={connector:{...M.connector,source:{...M.connector.source,fields:q.source.fields}}};await b(B)}g(!1)},D=q=>{R({runType:q.runType,data:q.data})},O=q=>{const H=q.connector.source.fields.length;return a.jsxs(we,{type:"button",variant:"outline",onClick:()=>{g(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(mz,{className:"h-4 w-4"}),a.jsxs("span",{children:["Edit Fields (",String(H),")"]})]})},[A,T]=h.useState(null),[I,k]=h.useState(!1),V=q=>{T(q),k(!0)},U=async()=>{A!==null&&(await K(A),T(null),k(!1))},K=async q=>{const M=f().definition;if(Ou(M)&&M.connector.source.configuration.length<=1){const B=rC(Ve.CONNECTOR);await b(B)}if(typeof M=="object"&&Ou(M)&&M.connector.source.configuration.length>1){const B={...M.connector.source,configuration:M.connector.source.configuration.filter((re,ge)=>ge!==q)},$={connector:{...M.connector,source:B}};await b($)}},G=async q=>{const M=f().definition;if(Ou(M)){const B={...M.connector.source,configuration:[...M.connector.source.configuration,q]},$={connector:{...M.connector,source:B}};await b($)}};return a.jsxs(a.Fragment,{children:[a.jsx(Nt,{control:e,name:"definition",render:({field:q})=>a.jsxs(xt,{className:"dark:bg-white/2",children:[a.jsx(jt,{children:a.jsx("div",{className:"space-y-3",children:!_f(q.value)||C===Ar.DRAFT?a.jsx(ale,{storageType:t,onSetupConnector:H=>{w(H),v(!1)},preset:n,isOpen:x,onClose:()=>{v(!1)}}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ile,{storageType:t,onAddConfiguration:H=>void G(H),existingConnector:_f(q.value)?{source:q.value.connector.source,storage:q.value.connector.storage}:void 0}),_f(q.value)&&O(q.value)]}),a.jsx("div",{className:"flex items-center gap-2",children:i&&i.definitionType===Ve.CONNECTOR&&a.jsx(Q6,{configuration:i.definition,onManualRun:D,children:a.jsxs(we,{variant:"outline",children:[a.jsx(Qg,{className:"h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})})})]}),a.jsx("div",{className:"space-y-3",children:_f(q.value)&&(i!=null&&i.storage)?q.value.connector.source.configuration.map((H,M)=>{const B=q.value;return a.jsx(ad,{children:a.jsx(ole,{configIndex:M,connectorDef:B,dataStorage:i.storage,onRemoveConfiguration:$=>{V($)},onUpdateConfiguration:$=>j($),dataMartStatus:typeof C=="object"?C.code:C,totalConfigurations:B.connector.source.configuration.length},M)},M)}):null})]})})}),a.jsx(Mt,{})]})}),a.jsx(ad,{children:a.jsx(GI,{isOpen:y,onClose:()=>{g(!1)},onSubmit:q=>void _(q),dataStorageType:t,existingConnector:_f(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),a.jsx(br,{open:I,onOpenChange:k,title:"Delete Configuration",description:"Are you sure you want to delete this configuration? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{U()},onCancel:()=>{T(null)},variant:"destructive"})]})}function cle({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:s}=vd(),[i,c]=h.useState(!1);return h.useEffect(()=>{e===Ve.CONNECTOR&&!n?c(!0):c(!1)},[e,n]),a.jsxs("div",{className:"space-y-2",children:[e===Ve.SQL&&a.jsx(Goe,{control:s}),e===Ve.TABLE&&a.jsx(Boe,{control:s,storageType:t}),e===Ve.VIEW&&a.jsx(qoe,{control:s,storageType:t}),e===Ve.TABLE_PATTERN&&a.jsx(Koe,{control:s,storageType:t}),e===Ve.CONNECTOR&&a.jsx(lle,{control:s,storageType:t,preset:n,autoOpen:i,saveDataMartDefinition:r})]})}function BI(){const[e]=eP(),t=e.get("preset");return h.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return Xee(n)},[t])}function ule(e,t){const[n,r]=h.useState(e);return h.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const dle=1e3,fle=[Xa.SUCCESS,Xa.ERROR,Xa.CANCELLED];function hle(e){const[t,n]=h.useState(!1),[r,s]=h.useState(null),i=h.useRef({triggerId:null,abortController:null}),c=h.useCallback(g=>i.current.triggerId===g,[]),u=h.useCallback(g=>{s({isValid:!1,error:g instanceof Error?g.message:"Validation failed"}),n(!1)},[]),f=h.useCallback(async()=>{const{triggerId:g,abortController:x}=i.current;if(g){x==null||x.abort(),i.current={triggerId:null,abortController:null},s(null),n(!1);try{await Tn.abortSqlDryRunTrigger(e,g)}catch(v){console.error("Failed to cancel trigger:",v)}}},[e]),m=h.useCallback(async(g,x)=>{for(;!x.aborted&&c(g);)try{const v=await Tn.getSqlDryRunTriggerStatus(e,g);if(fle.includes(v)){const C=await Tn.getSqlDryRunTriggerResponse(e,g);s({isValid:C.isValid,error:C.error??void 0,bytes:C.bytes}),n(!1),i.current={triggerId:null,abortController:null};return}await new Promise(C=>setTimeout(C,dle))}catch(v){u(v),i.current={triggerId:null,abortController:null};return}},[e,c,u]),y=h.useCallback(async g=>{await f(),n(!0),s(null);try{const{triggerId:x}=await Tn.createSqlDryRunTrigger(e,g),v=new AbortController;i.current={triggerId:x,abortController:v},await m(x,v.signal)}catch(x){u(x)}},[e,f,m,u]);return h.useEffect(()=>()=>{const{triggerId:g,abortController:x}=i.current;x==null||x.abort(),g&&Tn.abortSqlDryRunTrigger(e,g).catch(()=>{})},[e]),{validateSql:y,isLoading:t,result:r,cancel:f}}const mle=300;function ple({sql:e,dataMartId:t,debounceDelay:n=mle,className:r="",onValidationStateChange:s}){const i=ule(e.trim(),n),{validateSql:c,isLoading:u,result:f,cancel:m}=hle(t);h.useEffect(()=>{if(!i){m();const g={isLoading:!1,isValid:null,error:null,bytes:null};s==null||s(g);return}c(i)},[i,c,m,s]),h.useEffect(()=>{const g={isLoading:u,isValid:(f==null?void 0:f.isValid)??null,error:(f==null?void 0:f.error)??null,bytes:(f==null?void 0:f.bytes)??null};s==null||s(g)},[u,f,s]);const y=()=>u?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(Rc,{className:"h-4 w-4 animate-spin"}),a.jsx("span",{className:"text-sm",children:"Validating..."})]}):f?f.isValid?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(YP,{className:"h-4 w-4 text-green-600"}),a.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),f.bytes!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(cc,{className:"h-3 w-3 text-gray-600"}),a.jsx("span",{className:"text-xs text-gray-600",children:cJ(f.bytes)})]})}),a.jsx(St,{children:a.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):a.jsxs("div",{className:"flex h-9 items-center gap-2",children:[a.jsx(ag,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),f.error&&a.jsx("span",{className:"text-xs text-red-500",children:f.error})]}):a.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[a.jsx(cc,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:"Type a query to get started"})]});return a.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:y()})}const gle={isValid:null,isLoading:!1,error:null},yle=(e,t)=>{if(e!==Ve.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},xle=e=>rC(e);function vle({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:s,runSchemaActualization:i}=bs(),c=BI();if(!r)throw new Error("Data mart not found");const{definition:u,id:f,storage:{type:m}}=r,[,y]=h.useState(gle),[g,x]=h.useState(!1),v=h.useCallback(()=>{if(!e)return;const G={definitionType:e,definition:rC(e)};return u?{definitionType:e,definition:u}:G},[e,u]),C=h.useCallback(()=>{if(!e)return;const G=Voe(e,m);return xi(G)},[e,m]),b=To({resolver:C(),defaultValues:v(),mode:"onChange"}),{handleSubmit:w,reset:R,watch:j,formState:{isDirty:_,isValid:D}}=b,O=j("definition"),A=yle(e,O);h.useEffect(()=>{e&&R(v())},[e,R,v]),h.useEffect(()=>{if(!e&&!t&&(c!=null&&c.definitionType)){n(c.definitionType);const G={definitionType:c.definitionType,definition:xle(c.definitionType)};R(G)}},[c,e,t,R,n]);const T=h.useCallback(G=>{y({isLoading:G.isLoading,isValid:G.isValid,error:G.error})},[]),I=h.useCallback(G=>{n(G)},[n]),k=h.useCallback(async G=>{if(e&&f)try{await s(f,G.definitionType,G.definition),x(!0),R(G)}catch(q){console.error("Failed to update data mart definition:",q)}},[f,e,s,R]);h.useEffect(()=>{g&&(x(!1),i==null||i())},[g,i]);const V=h.useCallback(G=>{G==null||G.preventDefault(),w(k)(G)},[w,k]),U=h.useCallback(()=>{R(v())},[R,v]),K=()=>e?a.jsxs("form",{onSubmit:V,className:"space-y-4",children:[a.jsx(cle,{definitionType:e,storageType:m,preset:c==null?void 0:c.connectorSourceTitle,saveDataMartDefinition:V}),e!==Ve.CONNECTOR&&a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(we,{variant:"default",type:"submit",disabled:!D||!_,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:U,disabled:!_,children:"Discard"}),e===Ve.SQL&&A&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-6 w-px bg-gray-300"}),a.jsx(ple,{sql:A,dataMartId:f,onValidationStateChange:T})]})]})]}):null;return a.jsx(jO,{...b,children:a.jsxs("div",{className:"space-y-4",children:[!t&&a.jsx(Poe,{initialType:e,onTypeSelect:I}),K()]})})}function ble(e){switch(e){case je.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case je.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};case je.SNOWFLAKE:return{type:"snowflake-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function qI(e){return e.type==="bigquery-data-mart-schema"}function KI(e){return e.type==="athena-data-mart-schema"}function ZI(e){return e.type==="snowflake-data-mart-schema"}function hN(e){return e!==null&&typeof e=="object"&&"mode"in e}function mN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function pN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function Sle(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function m1(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Cle(e){const t=m1(e),[n,r]=h.useState(t),[s,i]=h.useState(!1);h.useEffect(()=>{const f=m1(e);r(f),i(!1)},[e]);const c=h.useCallback(f=>{n?qI(n)&&f.every(hN)?(r({...n,fields:f}),i(!0)):KI(n)&&f.every(mN)?(r({...n,fields:f}),i(!0)):ZI(n)&&f.every(pN)&&(r({...n,fields:f}),i(!0)):f.length>0&&(hN(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),i(!0)):mN(f[0])?(r({type:"athena-data-mart-schema",fields:f}),i(!0)):pN(f[0])&&(r({type:"snowflake-data-mart-schema",fields:f}),i(!0)))},[n]),u=h.useCallback(()=>{const f=m1(e);r(f),i(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:u,setIsDirty:i}}function wle(e,t){const n=h.useRef(!1),r=h.useRef(!1),[s,i]=h.useState("idle");return h.useEffect(()=>{e||(n.current||r.current)&&(i(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:s,startSaveOperation:()=>{n.current=!0,i("idle")},startActualizeOperation:()=>{r.current=!0,i("idle")},resetOperationStatus:()=>{i("idle")}}}function Ele(e){const t=h.useMemo(()=>Array.isArray(e)?Object.fromEntries(e.filter(s=>s.meta&&s.meta.hidden).map(s=>["id"in s&&s.id?s.id:"accessorKey"in s&&typeof s.accessorKey=="string"?s.accessorKey:void 0,!1]).filter(([s])=>s!==void 0)):{},[e]),[n,r]=h.useState({});return h.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function YI(e,t){const n=e.name?e.name.toLowerCase().includes(t):!1,r=e.alias?e.alias.toLowerCase().includes(t):!1,s=e.description?e.description.toLowerCase().includes(t):!1;if(n||r||s)return!0;const i=e;return i.fields&&i.fields.length>0?i.fields.some(c=>YI(c,t)):!1}function WI(e,t,n=""){const r=[];return e.forEach((s,i)=>{const c=n?`${n}.${String(i)}`:String(i),u=s.name?s.name.toLowerCase().includes(t):!1,f=s.alias?s.alias.toLowerCase().includes(t):!1,m=s.description?s.description.toLowerCase().includes(t):!1;if((u||f||m)&&r.push(c),s.fields&&s.fields.length>0){const y=WI(s.fields,t,c);y.length>0&&(r.includes(c)||r.push(c),r.push(...y))}}),r}function Rle(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return YI(r,s)}function jle(e){const[t,n]=h.useState(""),r=h.useCallback(i=>{n(i),e.setGlobalFilter(i)},[e]),s=t.toLowerCase();return{value:t,onChange:r,searchValue:s}}function Tle(e){const[t,n]=h.useState(new Set),[r,s]=h.useState(null),i=h.useRef(""),c=h.useMemo(()=>{const C=b=>b.some(w=>w.type===ar.RECORD||w.type===ar.STRUCT||w.fields&&C(w.fields));return C(e)},[e]),u=h.useCallback(C=>{n(b=>{const w=new Set(b);return w.has(C)?w.delete(C):w.add(C),w})},[]),f=h.useCallback(()=>{const C=[],b=(w,R="")=>{w.forEach((j,_)=>{const D=R?`${R}.${String(_)}`:String(_);(j.type===ar.RECORD||j.type===ar.STRUCT)&&j.fields&&j.fields.length>0&&(C.push(D),b(j.fields,D))})};b(e),n(w=>C.every(j=>w.has(j))?new Set:new Set(C))},[e]),m=h.useMemo(()=>{const C=[],b=(w,R="",j=0)=>{w.forEach((_,D)=>{const O=R?`${R}.${String(D)}`:String(D),A=_.type===ar.RECORD||_.type===ar.STRUCT;C.push({..._,path:O,level:j}),A&&_.fields&&t.has(O)&&b(_.fields,O,j+1)})};return b(e),C},[e,t]),y=h.useCallback(C=>{if(C!==i.current)if(i.current=C,C){r===null&&s(new Set(t));const w=WI(e,C).filter(R=>{const j=R.split(".").map(Number);let _=e,D;for(let O=0;O<j.length;O++){if(D=_[j[O]],!D)return!1;if((D.type===ar.RECORD||D.type===ar.STRUCT)&&D.fields&&D.fields.length>0)return!0;O<j.length-1&&(_=D.fields??[])}return!1});n(R=>{const j=new Set(R);return w.forEach(_=>{j.add(_)}),j})}else r!==null&&(n(r),s(null))},[e,t,r]),g=h.useCallback(C=>{const b=m[C];return b.type===ar.RECORD||b.type===ar.STRUCT},[m]),x=h.useMemo(()=>e.map(C=>({...C,fields:void 0})),[e]),v=h.useMemo(()=>{const C=[],b=(w,R="")=>{w.forEach((j,_)=>{const D=R?`${R}.${String(_)}`:String(_);(j.type===ar.RECORD||j.type===ar.STRUCT)&&j.fields&&j.fields.length>0&&(C.push(D),b(j.fields,D))})};return b(e),C.length===0?!1:C.every(w=>t.has(w))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:u,toggleAllRecords:f,flattenedFields:m,handleSearchChange:y,isRecordType:g,topLevelFields:x,allExpanded:v}}function _le(e,t,n,r){const s=h.useCallback((f,m)=>{if(n){const y=[...e],g=t[f].path;if(!g)y[f]={...y[f],...m};else{const x=g.split(".").map(Number);let v=y,C;for(let w=0;w<x.length-1;w++)C=v[x[w]],v=C.fields??[];const b=x[x.length-1];v[b]&&(v[b]={...v[b],...m})}n(y)}},[e,t,n]),i=h.useCallback(()=>{if(n){const f={name:"",type:ar.STRING,mode:rh.NULLABLE,isPrimaryKey:!1,status:Qa.DISCONNECTED};n([...e,f])}},[e,n]),c=h.useCallback(f=>{if(n){const m=[...e],y=t[f].path;if(!y)m.splice(f,1);else{const g=y.split(".").map(Number);let x=m,v;for(let b=0;b<g.length-1;b++)v=x[g[b]],x=v.fields??[];const C=g[g.length-1];x.splice(C,1)}n(m)}},[e,t,n]),u=h.useCallback(f=>{var m,y;if(n&&r){const g=[...e],x=t[f].path,v={name:"",type:ar.STRING,mode:rh.NULLABLE,isPrimaryKey:!1,status:Qa.DISCONNECTED};if(!x)(m=g[f]).fields??(m.fields=[]),g[f].fields.push(v);else{const C=x.split(".").map(Number);let b=g;for(let w=0;w<C.length;w++){const R=C[w];w===C.length-1?((y=b[R]).fields??(y.fields=[]),b[R].fields.push(v)):b=b[R].fields??[]}}n(g)}},[e,t,n,r]);return{updateField:s,handleAddRow:i,handleDeleteRow:c,handleAddNestedField:u}}function dC(e,t,n){return{handleDragEnd:h.useCallback(s=>{const{active:i,over:c}=s;if(!c||i.id===c.id||!t)return;if(!n){const x=Number(i.id),v=Number(c.id),C=[...e],[b]=C.splice(x,1);C.splice(v,0,b),t(C);return}const u=n.findIndex((x,v)=>(x.path??String(v))===i.id),f=n.findIndex((x,v)=>(x.path??String(v))===c.id);if(u===-1||f===-1)return;const m=n[u].path,y=n[f].path,g=[...e];if(!m&&!y){const[x]=g.splice(u,1);g.splice(f,0,x),t(g);return}if(m&&y){const x=m.split(".").map(Number),v=y.split(".").map(Number);if(x.length===v.length&&x.slice(0,-1).join(".")===v.slice(0,-1).join(".")){let C=g;for(let j=0;j<x.length-1;j++)C=C[x[j]].fields??[];const b=x[x.length-1],w=v[v.length-1],[R]=C.splice(b,1);C.splice(w,0,R),t(g)}}},[e,n,t])}}function Nle(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Qy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Cd(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function fC(e){return"nodeType"in e}function Na(e){var t,n;return e?Cd(e)?e:fC(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function hC(e){const{Document:t}=Na(e);return e instanceof t}function Kh(e){return Cd(e)?!1:e instanceof Na(e).HTMLElement}function XI(e){return e instanceof Na(e).SVGElement}function wd(e){return e?Cd(e)?e.document:fC(e)?hC(e)?e:Kh(e)||XI(e)?e.ownerDocument:document:document:document}const wo=Qy?h.useLayoutEffect:h.useEffect;function mC(e){const t=h.useRef(e);return wo(()=>{t.current=e}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function Ale(){const e=h.useRef(null),t=h.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function oh(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return wo(()=>{n.current!==e&&(n.current=e)},t),n}function Zh(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Pg(e){const t=mC(e),n=h.useRef(null),r=h.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Ub(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let p1={};function Yh(e,t){return h.useMemo(()=>{if(t)return t;const n=p1[e]==null?0:p1[e]+1;return p1[e]=n,e+"-"+n},[e,t])}function QI(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,c)=>{const u=Object.entries(c);for(const[f,m]of u){const y=i[f];y!=null&&(i[f]=y+e*m)}return i},{...t})}}const qu=QI(1),Ug=QI(-1);function Dle(e){return"clientX"in e&&"clientY"in e}function pC(e){if(!e)return!1;const{KeyboardEvent:t}=Na(e.target);return t&&e instanceof t}function Ole(e){if(!e)return!1;const{TouchEvent:t}=Na(e.target);return t&&e instanceof t}function zb(e){if(Ole(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Dle(e)?{x:e.clientX,y:e.clientY}:null}const ih=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[ih.Translate.toString(e),ih.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),gN="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ile(e){return e.matches(gN)?e:e.querySelector(gN)}const Mle={display:"none"};function kle(e){let{id:t,value:n}=e;return ae.createElement("div",{id:t,style:Mle},n)}function Lle(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ae.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Ple(){const[e,t]=h.useState("");return{announce:h.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const JI=h.createContext(null);function Ule(e){const t=h.useContext(JI);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zle(){const[e]=h.useState(()=>new Set),t=h.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[h.useCallback(r=>{let{type:s,event:i}=r;e.forEach(c=>{var u;return(u=c[s])==null?void 0:u.call(c,i)})},[e]),t]}const Fle={draggable:`
|
|
824
|
-
To pick up a draggable item, press the space bar.
|
|
825
|
-
While dragging, use the arrow keys to move the item.
|
|
826
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
827
|
-
`},Hle={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function $le(e){let{announcements:t=Hle,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Fle}=e;const{announce:i,announcement:c}=Ple(),u=Yh("DndLiveRegion"),[f,m]=h.useState(!1);if(h.useEffect(()=>{m(!0)},[]),Ule(h.useMemo(()=>({onDragStart(g){let{active:x}=g;i(t.onDragStart({active:x}))},onDragMove(g){let{active:x,over:v}=g;t.onDragMove&&i(t.onDragMove({active:x,over:v}))},onDragOver(g){let{active:x,over:v}=g;i(t.onDragOver({active:x,over:v}))},onDragEnd(g){let{active:x,over:v}=g;i(t.onDragEnd({active:x,over:v}))},onDragCancel(g){let{active:x,over:v}=g;i(t.onDragCancel({active:x,over:v}))}}),[i,t])),!f)return null;const y=ae.createElement(ae.Fragment,null,ae.createElement(kle,{id:r,value:s.draggable}),ae.createElement(Lle,{id:u,announcement:c}));return n?Ls.createPortal(y,n):y}var vr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(vr||(vr={}));function zg(){}function gC(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function yC(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Gs=Object.freeze({x:0,y:0});function Vle(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Gle(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Ble(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function qle(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function yN(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const xC=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=yN(t,t.left,t.top),i=[];for(const c of r){const{id:u}=c,f=n.get(u);if(f){const m=Vle(yN(f),s);i.push({id:u,data:{droppableContainer:c,value:m}})}}return i.sort(Gle)};function Kle(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),c=s-r,u=i-n;if(r<s&&n<i){const f=t.width*t.height,m=e.width*e.height,y=c*u,g=y/(f+m-y);return Number(g.toFixed(4))}return 0}const Zle=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const i of r){const{id:c}=i,u=n.get(c);if(u){const f=Kle(u,t);f>0&&s.push({id:c,data:{droppableContainer:i,value:f}})}}return s.sort(Ble)};function Yle(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function eM(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Gs}function Wle(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((c,u)=>({...c,top:c.top+e*u.y,bottom:c.bottom+e*u.y,left:c.left+e*u.x,right:c.right+e*u.x}),{...n})}}const Xle=Wle(1);function Qle(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Jle(e,t,n){const r=Qle(t);if(!r)return e;const{scaleX:s,scaleY:i,x:c,y:u}=r,f=e.left-c-(1-s)*parseFloat(n),m=e.top-u-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),y=s?e.width/s:e.width,g=i?e.height/i:e.height;return{width:y,height:g,top:m,right:f+y,bottom:m+g,left:f}}const ece={ignoreTransform:!1};function Ed(e,t){t===void 0&&(t=ece);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:y}=Na(e).getComputedStyle(e);m&&(n=Jle(n,m,y))}const{top:r,left:s,width:i,height:c,bottom:u,right:f}=n;return{top:r,left:s,width:i,height:c,bottom:u,right:f}}function xN(e){return Ed(e,{ignoreTransform:!0})}function tce(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function nce(e,t){return t===void 0&&(t=Na(e).getComputedStyle(e)),t.position==="fixed"}function rce(e,t){t===void 0&&(t=Na(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function vC(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(hC(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Kh(s)||XI(s)||n.includes(s))return n;const i=Na(e).getComputedStyle(s);return s!==e&&rce(s,i)&&n.push(s),nce(s,i)?n:r(s.parentNode)}return e?r(e):n}function tM(e){const[t]=vC(e,1);return t??null}function g1(e){return!Qy||!e?null:Cd(e)?e:fC(e)?hC(e)||e===wd(e).scrollingElement?window:Kh(e)?e:null:null}function nM(e){return Cd(e)?e.scrollX:e.scrollLeft}function rM(e){return Cd(e)?e.scrollY:e.scrollTop}function Fb(e){return{x:nM(e),y:rM(e)}}var _r;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(_r||(_r={}));function aM(e){return!Qy||!e?!1:e===document.scrollingElement}function sM(e){const t={x:0,y:0},n=aM(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:c,isRight:u,maxScroll:r,minScroll:t}}const ace={x:.2,y:.2};function sce(e,t,n,r,s){let{top:i,left:c,right:u,bottom:f}=n;r===void 0&&(r=10),s===void 0&&(s=ace);const{isTop:m,isBottom:y,isLeft:g,isRight:x}=sM(e),v={x:0,y:0},C={x:0,y:0},b={height:t.height*s.y,width:t.width*s.x};return!m&&i<=t.top+b.height?(v.y=_r.Backward,C.y=r*Math.abs((t.top+b.height-i)/b.height)):!y&&f>=t.bottom-b.height&&(v.y=_r.Forward,C.y=r*Math.abs((t.bottom-b.height-f)/b.height)),!x&&u>=t.right-b.width?(v.x=_r.Forward,C.x=r*Math.abs((t.right-b.width-u)/b.width)):!g&&c<=t.left+b.width&&(v.x=_r.Backward,C.x=r*Math.abs((t.left+b.width-c)/b.width)),{direction:v,speed:C}}function oce(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,height:c}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function oM(e){return e.reduce((t,n)=>qu(t,Fb(n)),Gs)}function ice(e){return e.reduce((t,n)=>t+nM(n),0)}function lce(e){return e.reduce((t,n)=>t+rM(n),0)}function cce(e,t){if(t===void 0&&(t=Ed),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);tM(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const uce=[["x",["left","right"],ice],["y",["top","bottom"],lce]];class bC{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=vC(n),s=oM(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,u]of uce)for(const f of c)Object.defineProperty(this,f,{get:()=>{const m=u(r),y=s[i]-m;return this.rect[f]+y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class $f{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function dce(e){const{EventTarget:t}=Na(e);return e instanceof t?e:wd(e)}function y1(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var ms;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ms||(ms={}));function vN(e){e.preventDefault()}function fce(e){e.stopPropagation()}var pn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(pn||(pn={}));const iM={start:[pn.Space,pn.Enter],cancel:[pn.Esc],end:[pn.Space,pn.Enter,pn.Tab]},hce=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case pn.Right:return{...n,x:n.x+25};case pn.Left:return{...n,x:n.x-25};case pn.Down:return{...n,y:n.y+25};case pn.Up:return{...n,y:n.y-25}}};class lM{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new $f(wd(n)),this.windowListeners=new $f(Na(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ms.Resize,this.handleCancel),this.windowListeners.add(ms.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ms.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&cce(r),n(Gs)}handleKeyDown(t){if(pC(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=iM,coordinateGetter:c=hce,scrollBehavior:u="smooth"}=s,{code:f}=t;if(i.end.includes(f)){this.handleEnd(t);return}if(i.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:m}=r.current,y=m?{x:m.left,y:m.top}:Gs;this.referenceCoordinates||(this.referenceCoordinates=y);const g=c(t,{active:n,context:r.current,currentCoordinates:y});if(g){const x=Ug(g,y),v={x:0,y:0},{scrollableAncestors:C}=r.current;for(const b of C){const w=t.code,{isTop:R,isRight:j,isLeft:_,isBottom:D,maxScroll:O,minScroll:A}=sM(b),T=oce(b),I={x:Math.min(w===pn.Right?T.right-T.width/2:T.right,Math.max(w===pn.Right?T.left:T.left+T.width/2,g.x)),y:Math.min(w===pn.Down?T.bottom-T.height/2:T.bottom,Math.max(w===pn.Down?T.top:T.top+T.height/2,g.y))},k=w===pn.Right&&!j||w===pn.Left&&!_,V=w===pn.Down&&!D||w===pn.Up&&!R;if(k&&I.x!==g.x){const U=b.scrollLeft+x.x,K=w===pn.Right&&U<=O.x||w===pn.Left&&U>=A.x;if(K&&!x.y){b.scrollTo({left:U,behavior:u});return}K?v.x=b.scrollLeft-U:v.x=w===pn.Right?b.scrollLeft-O.x:b.scrollLeft-A.x,v.x&&b.scrollBy({left:-v.x,behavior:u});break}else if(V&&I.y!==g.y){const U=b.scrollTop+x.y,K=w===pn.Down&&U<=O.y||w===pn.Up&&U>=A.y;if(K&&!x.x){b.scrollTo({top:U,behavior:u});return}K?v.y=b.scrollTop-U:v.y=w===pn.Down?b.scrollTop-O.y:b.scrollTop-A.y,v.y&&b.scrollBy({top:-v.y,behavior:u});break}}this.handleMove(t,qu(Ug(g,this.referenceCoordinates),v))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}lM.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=iM,onActivation:s}=t,{active:i}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const u=i.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function bN(e){return!!(e&&"distance"in e)}function SN(e){return!!(e&&"delay"in e)}class SC{constructor(t,n,r){var s;r===void 0&&(r=dce(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:c}=i;this.props=t,this.events=n,this.document=wd(c),this.documentListeners=new $f(this.document),this.listeners=new $f(r),this.windowListeners=new $f(Na(c)),this.initialCoordinates=(s=zb(i))!=null?s:Gs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ms.Resize,this.handleCancel),this.windowListeners.add(ms.DragStart,vN),this.windowListeners.add(ms.VisibilityChange,this.handleCancel),this.windowListeners.add(ms.ContextMenu,vN),this.documentListeners.add(ms.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(SN(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(bN(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(ms.Click,fce,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ms.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:c,options:{activationConstraint:u}}=i;if(!s)return;const f=(n=zb(t))!=null?n:Gs,m=Ug(s,f);if(!r&&u){if(bN(u)){if(u.tolerance!=null&&y1(m,u.tolerance))return this.handleCancel();if(y1(m,u.distance))return this.handleStart()}if(SN(u)&&y1(m,u.tolerance))return this.handleCancel();this.handlePending(u,m);return}t.cancelable&&t.preventDefault(),c(f)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===pn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const mce={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Wh extends SC{constructor(t){const{event:n}=t,r=wd(n.target);super(t,mce,r)}}Wh.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const pce={move:{name:"mousemove"},end:{name:"mouseup"}};var Hb;(function(e){e[e.RightClick=2]="RightClick"})(Hb||(Hb={}));class gce extends SC{constructor(t){super(t,pce,wd(t.event.target))}}gce.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Hb.RightClick?!1:(r==null||r({event:n}),!0)}}];const x1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class yce extends SC{constructor(t){super(t,x1)}static setup(){return window.addEventListener(x1.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(x1.move.name,t)};function t(){}}}yce.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var Vf;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Vf||(Vf={}));var Fg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Fg||(Fg={}));function xce(e){let{acceleration:t,activator:n=Vf.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:c=5,order:u=Fg.TreeOrder,pointerCoordinates:f,scrollableAncestors:m,scrollableAncestorRects:y,delta:g,threshold:x}=e;const v=bce({delta:g,disabled:!i}),[C,b]=Ale(),w=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),j=h.useMemo(()=>{switch(n){case Vf.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Vf.DraggableRect:return s}},[n,s,f]),_=h.useRef(null),D=h.useCallback(()=>{const A=_.current;if(!A)return;const T=w.current.x*R.current.x,I=w.current.y*R.current.y;A.scrollBy(T,I)},[]),O=h.useMemo(()=>u===Fg.TreeOrder?[...m].reverse():m,[u,m]);h.useEffect(()=>{if(!i||!m.length||!j){b();return}for(const A of O){if((r==null?void 0:r(A))===!1)continue;const T=m.indexOf(A),I=y[T];if(!I)continue;const{direction:k,speed:V}=sce(A,I,j,t,x);for(const U of["x","y"])v[U][k[U]]||(V[U]=0,k[U]=0);if(V.x>0||V.y>0){b(),_.current=A,C(D,c),w.current=V,R.current=k;return}}w.current={x:0,y:0},R.current={x:0,y:0},b()},[t,D,r,b,i,c,JSON.stringify(j),JSON.stringify(v),C,m,O,y,JSON.stringify(x)])}const vce={x:{[_r.Backward]:!1,[_r.Forward]:!1},y:{[_r.Backward]:!1,[_r.Forward]:!1}};function bce(e){let{delta:t,disabled:n}=e;const r=Ub(t);return Zh(s=>{if(n||!r||!s)return vce;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[_r.Backward]:s.x[_r.Backward]||i.x===-1,[_r.Forward]:s.x[_r.Forward]||i.x===1},y:{[_r.Backward]:s.y[_r.Backward]||i.y===-1,[_r.Forward]:s.y[_r.Forward]||i.y===1}}},[n,t,r])}function Sce(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Zh(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function Cce(e,t){return h.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...i]},[]),[e,t])}var lh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(lh||(lh={}));var $b;(function(e){e.Optimized="optimized"})($b||($b={}));const CN=new Map;function wce(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,c]=h.useState(null),{frequency:u,measure:f,strategy:m}=s,y=h.useRef(e),g=w(),x=oh(g),v=h.useCallback(function(R){R===void 0&&(R=[]),!x.current&&c(j=>j===null?R:j.concat(R.filter(_=>!j.includes(_))))},[x]),C=h.useRef(null),b=Zh(R=>{if(g&&!n)return CN;if(!R||R===CN||y.current!==e||i!=null){const j=new Map;for(let _ of e){if(!_)continue;if(i&&i.length>0&&!i.includes(_.id)&&_.rect.current){j.set(_.id,_.rect.current);continue}const D=_.node.current,O=D?new bC(f(D),D):null;_.rect.current=O,O&&j.set(_.id,O)}return j}return R},[e,i,n,g,f]);return h.useEffect(()=>{y.current=e},[e]),h.useEffect(()=>{g||v()},[n,g]),h.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),h.useEffect(()=>{g||typeof u!="number"||C.current!==null||(C.current=setTimeout(()=>{v(),C.current=null},u))},[u,g,v,...r]),{droppableRects:b,measureDroppableContainers:v,measuringScheduled:i!=null};function w(){switch(m){case lh.Always:return!1;case lh.BeforeDragging:return n;default:return!n}}}function cM(e,t){return Zh(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ece(e,t){return cM(e,t)}function Rce(e){let{callback:t,disabled:n}=e;const r=mC(t),s=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return h.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Jy(e){let{callback:t,disabled:n}=e;const r=mC(t),s=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return h.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function jce(e){return new bC(Ed(e),e)}function wN(e,t,n){t===void 0&&(t=jce);const[r,s]=h.useState(null);function i(){s(f=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=f??n)!=null?m:null}const y=t(e);return JSON.stringify(f)===JSON.stringify(y)?f:y})}const c=Rce({callback(f){if(e)for(const m of f){const{type:y,target:g}=m;if(y==="childList"&&g instanceof HTMLElement&&g.contains(e)){i();break}}}}),u=Jy({callback:i});return wo(()=>{i(),e?(u==null||u.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),c==null||c.disconnect())},[e]),r}function Tce(e){const t=cM(e);return eM(e,t)}const EN=[];function _ce(e){const t=h.useRef(e),n=Zh(r=>e?r&&r!==EN&&e&&t.current&&e.parentNode===t.current.parentNode?r:vC(e):EN,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function Nce(e){const[t,n]=h.useState(null),r=h.useRef(e),s=h.useCallback(i=>{const c=g1(i.target);c&&n(u=>u?(u.set(c,Fb(c)),new Map(u)):null)},[]);return h.useEffect(()=>{const i=r.current;if(e!==i){c(i);const u=e.map(f=>{const m=g1(f);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,Fb(m)]):null}).filter(f=>f!=null);n(u.length?new Map(u):null),r.current=e}return()=>{c(e),c(i)};function c(u){u.forEach(f=>{const m=g1(f);m==null||m.removeEventListener("scroll",s)})}},[s,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>qu(i,c),Gs):oM(e):Gs,[e,t])}function RN(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==Gs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ug(e,n.current):Gs}function Ace(e){h.useEffect(()=>{if(!Qy)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Dce(e,t){return h.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=c=>{i(c,t)},n},{}),[e,t])}function uM(e){return h.useMemo(()=>e?tce(e):null,[e])}const jN=[];function Oce(e,t){t===void 0&&(t=Ed);const[n]=e,r=uM(n?Na(n):null),[s,i]=h.useState(jN);function c(){i(()=>e.length?e.map(f=>aM(f)?r:new bC(t(f),f)):jN)}const u=Jy({callback:c});return wo(()=>{u==null||u.disconnect(),c(),e.forEach(f=>u==null?void 0:u.observe(f))},[e]),s}function Ice(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Kh(t)?t:e}function Mce(e){let{measure:t}=e;const[n,r]=h.useState(null),s=h.useCallback(m=>{for(const{target:y}of m)if(Kh(y)){r(g=>{const x=t(y);return g?{...g,width:x.width,height:x.height}:x});break}},[t]),i=Jy({callback:s}),c=h.useCallback(m=>{const y=Ice(m);i==null||i.disconnect(),y&&(i==null||i.observe(y)),r(y?t(y):null)},[t,i]),[u,f]=Pg(c);return h.useMemo(()=>({nodeRef:u,rect:n,setRef:f}),[n,u,f])}const kce=[{sensor:Wh,options:{}},{sensor:lM,options:{}}],Lce={current:{}},Xp={draggable:{measure:xN},droppable:{measure:xN,strategy:lh.WhileDragging,frequency:$b.Optimized},dragOverlay:{measure:Ed}};class Gf extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Pce={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Gf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:zg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Xp,measureDroppableContainers:zg,windowRect:null,measuringScheduled:!1},Uce={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:zg,draggableNodes:new Map,over:null,measureDroppableContainers:zg},ex=h.createContext(Uce),dM=h.createContext(Pce);function zce(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Gf}}}function Fce(e,t){switch(t.type){case vr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case vr.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case vr.DragEnd:case vr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case vr.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Gf(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case vr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const c=new Gf(e.droppable.containers);return c.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case vr.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Gf(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Hce(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=h.useContext(ex),i=Ub(r),c=Ub(n==null?void 0:n.id);return h.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!pC(i)||document.activeElement===i.target)return;const u=s.get(c);if(!u)return;const{activatorNode:f,node:m}=u;if(!f.current&&!m.current)return;requestAnimationFrame(()=>{for(const y of[f.current,m.current]){if(!y)continue;const g=Ile(y);if(g){g.focus();break}}})}},[r,t,s,c,i]),null}function $ce(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function Vce(e){return h.useMemo(()=>({draggable:{...Xp.draggable,...e==null?void 0:e.draggable},droppable:{...Xp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Xp.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Gce(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=h.useRef(!1),{x:c,y:u}=typeof s=="boolean"?{x:s,y:s}:s;wo(()=>{if(!c&&!u||!t){i.current=!1;return}if(i.current||!r)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const y=n(m),g=eM(y,r);if(c||(g.x=0),u||(g.y=0),i.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const x=tM(m);x&&x.scrollBy({top:g.y,left:g.x})}},[t,c,u,r,n])}const fM=h.createContext({...Gs,scaleX:1,scaleY:1});var Ki;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ki||(Ki={}));const CC=h.memo(function(t){var n,r,s,i;let{id:c,accessibility:u,autoScroll:f=!0,children:m,sensors:y=kce,collisionDetection:g=Zle,measuring:x,modifiers:v,...C}=t;const b=h.useReducer(Fce,void 0,zce),[w,R]=b,[j,_]=zle(),[D,O]=h.useState(Ki.Uninitialized),A=D===Ki.Initialized,{draggable:{active:T,nodes:I,translate:k},droppable:{containers:V}}=w,U=T!=null?I.get(T):null,K=h.useRef({initial:null,translated:null}),G=h.useMemo(()=>{var wn;return T!=null?{id:T,data:(wn=U==null?void 0:U.data)!=null?wn:Lce,rect:K}:null},[T,U]),q=h.useRef(null),[H,M]=h.useState(null),[B,$]=h.useState(null),re=oh(C,Object.values(C)),ge=Yh("DndDescribedBy",c),P=h.useMemo(()=>V.getEnabled(),[V]),z=Vce(x),{droppableRects:F,measureDroppableContainers:Z,measuringScheduled:Q}=wce(P,{dragging:A,dependencies:[k.x,k.y],config:z.droppable}),le=Sce(I,T),J=h.useMemo(()=>B?zb(B):null,[B]),ie=Es(),ye=Ece(le,z.draggable.measure);Gce({activeNode:T!=null?I.get(T):null,config:ie.layoutShiftCompensation,initialRect:ye,measure:z.draggable.measure});const Ce=wN(le,z.draggable.measure,ye),He=wN(le?le.parentElement:null),Ee=h.useRef({activatorEvent:null,active:null,activeNode:le,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:V,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ke=V.getNodeFor((n=Ee.current.over)==null?void 0:n.id),nt=Mce({measure:z.dragOverlay.measure}),Ft=(r=nt.nodeRef.current)!=null?r:le,Pt=A?(s=nt.rect)!=null?s:Ce:null,On=!!(nt.nodeRef.current&&nt.rect),yn=Tce(On?null:Ce),ke=uM(Ft?Na(Ft):null),Y=_ce(A?Ke??le:null),ne=Oce(Y),ce=$ce(v,{transform:{x:k.x-yn.x,y:k.y-yn.y,scaleX:1,scaleY:1},activatorEvent:B,active:G,activeNodeRect:Ce,containerNodeRect:He,draggingNodeRect:Pt,over:Ee.current.over,overlayNodeRect:nt.rect,scrollableAncestors:Y,scrollableAncestorRects:ne,windowRect:ke}),Ie=J?qu(J,k):null,Re=Nce(Y),Te=RN(Re),$e=RN(Re,[Ce]),mt=qu(ce,Te),st=Pt?Xle(Pt,ce):null,Xt=G&&st?g({active:G,collisionRect:st,droppableRects:F,droppableContainers:P,pointerCoordinates:Ie}):null,sr=qle(Xt,"id"),[$n,Or]=h.useState(null),Jr=On?ce:qu(ce,$e),fn=Yle(Jr,(i=$n==null?void 0:$n.rect)!=null?i:null,Ce),or=h.useRef(null),kn=h.useCallback((wn,In)=>{let{sensor:We,options:Bt}=In;if(q.current==null)return;const Qt=I.get(q.current);if(!Qt)return;const qt=wn.nativeEvent,Vn=new We({active:q.current,activeNode:Qt,event:qt,options:Bt,context:Ee,onAbort(Jt){if(!I.get(Jt))return;const{onDragAbort:W}=re.current,ee={id:Jt};W==null||W(ee),j({type:"onDragAbort",event:ee})},onPending(Jt,Rr,W,ee){if(!I.get(Jt))return;const{onDragPending:Se}=re.current,Ae={id:Jt,constraint:Rr,initialCoordinates:W,offset:ee};Se==null||Se(Ae),j({type:"onDragPending",event:Ae})},onStart(Jt){const Rr=q.current;if(Rr==null)return;const W=I.get(Rr);if(!W)return;const{onDragStart:ee}=re.current,fe={activatorEvent:qt,active:{id:Rr,data:W.data,rect:K}};Ls.unstable_batchedUpdates(()=>{ee==null||ee(fe),O(Ki.Initializing),R({type:vr.DragStart,initialCoordinates:Jt,active:Rr}),j({type:"onDragStart",event:fe}),M(or.current),$(qt)})},onMove(Jt){R({type:vr.DragMove,coordinates:Jt})},onEnd:en(vr.DragEnd),onCancel:en(vr.DragCancel)});or.current=Vn;function en(Jt){return async function(){const{active:W,collisions:ee,over:fe,scrollAdjustedTranslate:Se}=Ee.current;let Ae=null;if(W&&Se){const{cancelDrop:Be}=re.current;Ae={activatorEvent:qt,active:W,collisions:ee,delta:Se,over:fe},Jt===vr.DragEnd&&typeof Be=="function"&&await Promise.resolve(Be(Ae))&&(Jt=vr.DragCancel)}q.current=null,Ls.unstable_batchedUpdates(()=>{R({type:Jt}),O(Ki.Uninitialized),Or(null),M(null),$(null),or.current=null;const Be=Jt===vr.DragEnd?"onDragEnd":"onDragCancel";if(Ae){const Fe=re.current[Be];Fe==null||Fe(Ae),j({type:Be,event:Ae})}})}}},[I]),Ws=h.useCallback((wn,In)=>(We,Bt)=>{const Qt=We.nativeEvent,qt=I.get(Bt);if(q.current!==null||!qt||Qt.dndKit||Qt.defaultPrevented)return;const Vn={active:qt};wn(We,In.options,Vn)===!0&&(Qt.dndKit={capturedBy:In.sensor},q.current=Bt,kn(We,In))},[I,kn]),Aa=Cce(y,Ws);Ace(y),wo(()=>{Ce&&D===Ki.Initializing&&O(Ki.Initialized)},[Ce,D]),h.useEffect(()=>{const{onDragMove:wn}=re.current,{active:In,activatorEvent:We,collisions:Bt,over:Qt}=Ee.current;if(!In||!We)return;const qt={active:In,activatorEvent:We,collisions:Bt,delta:{x:mt.x,y:mt.y},over:Qt};Ls.unstable_batchedUpdates(()=>{wn==null||wn(qt),j({type:"onDragMove",event:qt})})},[mt.x,mt.y]),h.useEffect(()=>{const{active:wn,activatorEvent:In,collisions:We,droppableContainers:Bt,scrollAdjustedTranslate:Qt}=Ee.current;if(!wn||q.current==null||!In||!Qt)return;const{onDragOver:qt}=re.current,Vn=Bt.get(sr),en=Vn&&Vn.rect.current?{id:Vn.id,rect:Vn.rect.current,data:Vn.data,disabled:Vn.disabled}:null,Jt={active:wn,activatorEvent:In,collisions:We,delta:{x:Qt.x,y:Qt.y},over:en};Ls.unstable_batchedUpdates(()=>{Or(en),qt==null||qt(Jt),j({type:"onDragOver",event:Jt})})},[sr]),wo(()=>{Ee.current={activatorEvent:B,active:G,activeNode:le,collisionRect:st,collisions:Xt,droppableRects:F,draggableNodes:I,draggingNode:Ft,draggingNodeRect:Pt,droppableContainers:V,over:$n,scrollableAncestors:Y,scrollAdjustedTranslate:mt},K.current={initial:Pt,translated:st}},[G,le,Xt,st,I,Ft,Pt,F,V,$n,Y,mt]),xce({...ie,delta:k,draggingRect:st,pointerCoordinates:Ie,scrollableAncestors:Y,scrollableAncestorRects:ne});const ea=h.useMemo(()=>({active:G,activeNode:le,activeNodeRect:Ce,activatorEvent:B,collisions:Xt,containerNodeRect:He,dragOverlay:nt,draggableNodes:I,droppableContainers:V,droppableRects:F,over:$n,measureDroppableContainers:Z,scrollableAncestors:Y,scrollableAncestorRects:ne,measuringConfiguration:z,measuringScheduled:Q,windowRect:ke}),[G,le,Ce,B,Xt,He,nt,I,V,F,$n,Z,Y,ne,z,Q,ke]),Da=h.useMemo(()=>({activatorEvent:B,activators:Aa,active:G,activeNodeRect:Ce,ariaDescribedById:{draggable:ge},dispatch:R,draggableNodes:I,over:$n,measureDroppableContainers:Z}),[B,Aa,G,Ce,R,ge,I,$n,Z]);return ae.createElement(JI.Provider,{value:_},ae.createElement(ex.Provider,{value:Da},ae.createElement(dM.Provider,{value:ea},ae.createElement(fM.Provider,{value:fn},m)),ae.createElement(Hce,{disabled:(u==null?void 0:u.restoreFocus)===!1})),ae.createElement($le,{...u,hiddenTextDescribedById:ge}));function Es(){const wn=(H==null?void 0:H.autoScrollEnabled)===!1,In=typeof f=="object"?f.enabled===!1:f===!1,We=A&&!wn&&!In;return typeof f=="object"?{...f,enabled:We}:{enabled:We}}}),Bce=h.createContext(null),TN="button",qce="Draggable";function Kce(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=Yh(qce),{activators:c,activatorEvent:u,active:f,activeNodeRect:m,ariaDescribedById:y,draggableNodes:g,over:x}=h.useContext(ex),{role:v=TN,roleDescription:C="draggable",tabIndex:b=0}=s??{},w=(f==null?void 0:f.id)===t,R=h.useContext(w?fM:Bce),[j,_]=Pg(),[D,O]=Pg(),A=Dce(c,t),T=oh(n);wo(()=>(g.set(t,{id:t,key:i,node:j,activatorNode:D,data:T}),()=>{const k=g.get(t);k&&k.key===i&&g.delete(t)}),[g,t]);const I=h.useMemo(()=>({role:v,tabIndex:b,"aria-disabled":r,"aria-pressed":w&&v===TN?!0:void 0,"aria-roledescription":C,"aria-describedby":y.draggable}),[r,v,b,w,C,y.draggable]);return{active:f,activatorEvent:u,activeNodeRect:m,attributes:I,isDragging:w,listeners:r?void 0:A,node:j,over:x,setNodeRef:_,setActivatorNodeRef:O,transform:R}}function Zce(){return h.useContext(dM)}const Yce="Droppable",Wce={timeout:25};function Xce(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=Yh(Yce),{active:c,dispatch:u,over:f,measureDroppableContainers:m}=h.useContext(ex),y=h.useRef({disabled:n}),g=h.useRef(!1),x=h.useRef(null),v=h.useRef(null),{disabled:C,updateMeasurementsFor:b,timeout:w}={...Wce,...s},R=oh(b??r),j=h.useCallback(()=>{if(!g.current){g.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{m(Array.isArray(R.current)?R.current:[R.current]),v.current=null},w)},[w]),_=Jy({callback:j,disabled:C||!c}),D=h.useCallback((I,k)=>{_&&(k&&(_.unobserve(k),g.current=!1),I&&_.observe(I))},[_]),[O,A]=Pg(D),T=oh(t);return h.useEffect(()=>{!_||!O.current||(_.disconnect(),g.current=!1,_.observe(O.current))},[O,_]),h.useEffect(()=>(u({type:vr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:O,rect:x,data:T}}),()=>u({type:vr.UnregisterDroppable,key:i,id:r})),[r]),h.useEffect(()=>{n!==y.current.disabled&&(u({type:vr.SetDroppableDisabled,id:r,key:i,disabled:n}),y.current.disabled=n)},[r,i,n,u]),{active:c,rect:x,isOver:(f==null?void 0:f.id)===r,node:O,over:f,setNodeRef:A}}function hM(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Qce(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function kp(e){return e!==null&&e>=0}function Jce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function eue(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const mM=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=hM(t,r,n),c=t[s],u=i[s];return!u||!c?null:{x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height}},Lp={scaleX:1,scaleY:1},wC=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:c}=e;const u=(t=i[n])!=null?t:r;if(!u)return null;if(s===n){const m=i[c];return m?{x:0,y:n<c?m.top+m.height-(u.top+u.height):m.top-u.top,...Lp}:null}const f=tue(i,s,n);return s>n&&s<=c?{x:0,y:-u.height-f,...Lp}:s<n&&s>=c?{x:0,y:u.height+f,...Lp}:{x:0,y:0,...Lp}};function tue(e,t,n){const r=e[t],s=e[t-1],i=e[t+1];return r?n<t?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const pM="Sortable",gM=ae.createContext({activeIndex:-1,containerId:pM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:mM,disabled:{draggable:!1,droppable:!1}});function EC(e){let{children:t,id:n,items:r,strategy:s=mM,disabled:i=!1}=e;const{active:c,dragOverlay:u,droppableRects:f,over:m,measureDroppableContainers:y}=Zce(),g=Yh(pM,n),x=u.rect!==null,v=h.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),C=c!=null,b=c?v.indexOf(c.id):-1,w=m?v.indexOf(m.id):-1,R=h.useRef(v),j=!Jce(v,R.current),_=w!==-1&&b===-1||j,D=eue(i);wo(()=>{j&&C&&y(v)},[j,v,C,y]),h.useEffect(()=>{R.current=v},[v]);const O=h.useMemo(()=>({activeIndex:b,containerId:g,disabled:D,disableTransforms:_,items:v,overIndex:w,useDragOverlay:x,sortedRects:Qce(v,f),strategy:s}),[b,g,D.draggable,D.droppable,_,v,w,f,x,s]);return ae.createElement(gM.Provider,{value:O},t)}const nue=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return hM(n,r,s).indexOf(t)},rue=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:i,newIndex:c,previousItems:u,previousContainerId:f,transition:m}=e;return!m||!r||u!==i&&s===c?!1:n?!0:c!==s&&t===f},aue={duration:200,easing:"ease"},yM="transform",sue=ih.Transition.toString({property:yM,duration:0,easing:"linear"}),oue={roleDescription:"sortable"};function iue(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,c]=h.useState(null),u=h.useRef(n);return wo(()=>{if(!t&&n!==u.current&&r.current){const f=s.current;if(f){const m=Ed(r.current,{ignoreTransform:!0}),y={x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height};(y.x||y.y)&&c(y)}}n!==u.current&&(u.current=n)},[t,n,r,s]),h.useEffect(()=>{i&&c(null)},[i]),i}function lue(e){let{animateLayoutChanges:t=rue,attributes:n,disabled:r,data:s,getNewIndex:i=nue,id:c,strategy:u,resizeObserverConfig:f,transition:m=aue}=e;const{items:y,containerId:g,activeIndex:x,disabled:v,disableTransforms:C,sortedRects:b,overIndex:w,useDragOverlay:R,strategy:j}=h.useContext(gM),_=cue(r,v),D=y.indexOf(c),O=h.useMemo(()=>({sortable:{containerId:g,index:D,items:y},...s}),[g,s,D,y]),A=h.useMemo(()=>y.slice(y.indexOf(c)),[y,c]),{rect:T,node:I,isOver:k,setNodeRef:V}=Xce({id:c,data:O,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...f}}),{active:U,activatorEvent:K,activeNodeRect:G,attributes:q,setNodeRef:H,listeners:M,isDragging:B,over:$,setActivatorNodeRef:re,transform:ge}=Kce({id:c,data:O,attributes:{...oue,...n},disabled:_.draggable}),P=Nle(V,H),z=!!U,F=z&&!C&&kp(x)&&kp(w),Z=!R&&B,Q=Z&&F?ge:null,J=F?Q??(u??j)({rects:b,activeNodeRect:G,activeIndex:x,overIndex:w,index:D}):null,ie=kp(x)&&kp(w)?i({id:c,items:y,activeIndex:x,overIndex:w}):D,ye=U==null?void 0:U.id,Ce=h.useRef({activeId:ye,items:y,newIndex:ie,containerId:g}),He=y!==Ce.current.items,Ee=t({active:U,containerId:g,isDragging:B,isSorting:z,id:c,index:D,items:y,newIndex:Ce.current.newIndex,previousItems:Ce.current.items,previousContainerId:Ce.current.containerId,transition:m,wasDragging:Ce.current.activeId!=null}),Ke=iue({disabled:!Ee,index:D,node:I,rect:T});return h.useEffect(()=>{z&&Ce.current.newIndex!==ie&&(Ce.current.newIndex=ie),g!==Ce.current.containerId&&(Ce.current.containerId=g),y!==Ce.current.items&&(Ce.current.items=y)},[z,ie,g,y]),h.useEffect(()=>{if(ye===Ce.current.activeId)return;if(ye&&!Ce.current.activeId){Ce.current.activeId=ye;return}const Ft=setTimeout(()=>{Ce.current.activeId=ye},50);return()=>clearTimeout(Ft)},[ye]),{active:U,activeIndex:x,attributes:q,data:O,rect:T,index:D,newIndex:ie,items:y,isOver:k,isSorting:z,isDragging:B,listeners:M,node:I,overIndex:w,over:$,setNodeRef:P,setActivatorNodeRef:re,setDroppableNodeRef:V,setDraggableNodeRef:H,transform:Ke??J,transition:nt()};function nt(){if(Ke||He&&Ce.current.newIndex===D)return sue;if(!(Z&&!pC(K)||!m)&&(z||Ee))return ih.Transition.toString({...m,property:yM})}}function cue(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}pn.Down,pn.Right,pn.Up,pn.Left;function Ku({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:s=!1,className:i,saveButtonText:c="Save",cancelButtonText:u="Discard"}){const[f,m]=h.useState(!1),[y,g]=h.useState(e),x=h.useRef(null),v=j=>{g(j.target.value)},C=()=>{n&&y!==e&&n(y.trim()),m(!1)},b=()=>{g(e),m(!1)},w=j=>{j.key==="Enter"&&!j.shiftKey?(r===1||j.ctrlKey)&&(j.preventDefault(),C()):j.key==="Escape"&&(j.preventDefault(),b())},R=j=>{m(j),j?(g(e),setTimeout(()=>{x.current&&x.current.focus()},0)):b()};return a.jsxs(J2,{open:f,onOpenChange:R,children:[a.jsx(eC,{asChild:!0,children:a.jsx("div",{className:se("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",i),children:e||t})}),a.jsxs(tC,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[a.jsx(jo,{ref:x,value:y,onChange:v,onKeyDown:w,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),a.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:b,className:"h-7 cursor-pointer px-2 text-xs",children:u}),a.jsx(we,{size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function uue({isAllExpanded:e,onToggle:t}){return a.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,title:e?"Collapse all items":"Expand all items",children:e?a.jsx(BP,{className:"h-4 w-4"}):a.jsx(cS,{className:"h-4 w-4"})})}function due({isExpanded:e,onToggle:t,ariaLabel:n}){return a.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,"aria-label":n??(e?"Collapse":"Expand"),children:e?a.jsx(Ss,{className:"h-4 w-4"}):a.jsx(_a,{className:"h-4 w-4"})})}function fue({className:e="",...t}){return a.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:a.jsx(kA,{className:"h-4 w-4 text-gray-400"})})}function RC({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:i,transition:c,isDragging:u}=lue({id:e}),f={transform:ih.Transform.toString(i),transition:c,opacity:u?.75:1},m=h.Children.toArray(t),y=[a.jsx($r,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:a.jsx(fue,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return a.jsx(Hn,{ref:s,style:f,className:"group",children:y})}function xM({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[s,i]=h.useState(!1),c=()=>{t&&t(e.index),i(!1)},u=r&&n&&r(e.index),f=!!t,m=u&&f;return a.jsxs("div",{className:"px-3 text-right",children:[a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100","aria-label":"Row actions",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[u&&a.jsxs(Ct,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&a.jsx(la,{}),f&&a.jsxs(Ct,{onClick:()=>{i(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),a.jsx(br,{open:s,onOpenChange:i,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function hue({mode:e,onModeChange:t}){const n=Object.values(rh),r=s=>{t&&t(s)};return a.jsxs(ua,{value:e,onValueChange:r,children:[a.jsx(fa,{className:"h-90 cursor-pointer",size:"sm",children:a.jsx(da,{placeholder:"Select field mode"})}),a.jsx(ha,{className:"max-h-[300px]",children:n.map(s=>a.jsx(Bn,{value:s,children:s},s))})]})}var tx="Checkbox",[mue]=Sr(tx),[pue,jC]=mue(tx);function gue(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:c,name:u,onCheckedChange:f,required:m,value:y="on",internal_do_not_use_render:g}=e,[x,v]=ia({prop:n,defaultProp:s??!1,onChange:f,caller:tx}),[C,b]=h.useState(null),[w,R]=h.useState(null),j=h.useRef(!1),_=C?!!c||!!C.closest("form"):!0,D={checked:x,disabled:i,setChecked:v,control:C,setControl:b,name:u,form:c,value:y,hasConsumerStoppedPropagationRef:j,required:m,defaultChecked:cl(s)?!1:s,isFormControl:_,bubbleInput:w,setBubbleInput:R};return a.jsx(pue,{scope:t,...D,children:yue(g)?g(D):r})}var vM="CheckboxTrigger",bM=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:c,disabled:u,checked:f,required:m,setControl:y,setChecked:g,hasConsumerStoppedPropagationRef:x,isFormControl:v,bubbleInput:C}=jC(vM,e),b=ht(s,y),w=h.useRef(f);return h.useEffect(()=>{const R=i==null?void 0:i.form;if(R){const j=()=>g(w.current);return R.addEventListener("reset",j),()=>R.removeEventListener("reset",j)}},[i,g]),a.jsx(et.button,{type:"button",role:"checkbox","aria-checked":cl(f)?"mixed":f,"aria-required":m,"data-state":jM(f),"data-disabled":u?"":void 0,disabled:u,value:c,...r,ref:b,onKeyDown:Me(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Me(n,R=>{g(j=>cl(j)?!0:!j),C&&v&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});bM.displayName=vM;var SM=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f,onCheckedChange:m,form:y,...g}=e;return a.jsx(gue,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:u,required:c,onCheckedChange:m,name:r,form:y,value:f,internal_do_not_use_render:({isFormControl:x})=>a.jsxs(a.Fragment,{children:[a.jsx(bM,{...g,ref:t,__scopeCheckbox:n}),x&&a.jsx(RM,{__scopeCheckbox:n})]})})});SM.displayName=tx;var CM="CheckboxIndicator",wM=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=jC(CM,n);return a.jsx(Vr,{present:r||cl(i.checked)||i.checked===!0,children:a.jsx(et.span,{"data-state":jM(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});wM.displayName=CM;var EM="CheckboxBubbleInput",RM=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:c,required:u,disabled:f,name:m,value:y,form:g,bubbleInput:x,setBubbleInput:v}=jC(EM,e),C=ht(n,v),b=D2(i),w=jS(r);h.useEffect(()=>{const j=x;if(!j)return;const _=window.HTMLInputElement.prototype,O=Object.getOwnPropertyDescriptor(_,"checked").set,A=!s.current;if(b!==i&&O){const T=new Event("click",{bubbles:A});j.indeterminate=cl(i),O.call(j,cl(i)?!1:i),j.dispatchEvent(T)}},[x,b,i,s]);const R=h.useRef(cl(i)?!1:i);return a.jsx(et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:u,disabled:f,name:m,value:y,form:g,...t,tabIndex:-1,ref:C,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});RM.displayName=EM;function yue(e){return typeof e=="function"}function cl(e){return e==="indeterminate"}function jM(e){return cl(e)?"indeterminate":e?"checked":"unchecked"}function xue({className:e,...t}){return a.jsx(SM,{"data-slot":"checkbox",className:se("peer border-input dark:bg-input/30 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 shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(wM,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5"})})})}function TM({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return a.jsx(xue,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const _N={[Qa.CONNECTED]:{icon:xh,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[Qa.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:vh,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[Qa.DISCONNECTED]:{icon:cz,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function _M({status:e}){if(!(e in _N))return null;const t=_N[e],{icon:n,color:r,label:s,description:i}=t,c=`schema-field-status-tooltip-${e}`;return a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx(n,{className:se("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),a.jsxs(St,{id:c,side:"bottom",role:"tooltip",children:[a.jsx("div",{className:"text-xs font-medium",children:s}),a.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:i})]})]})})}function TC({type:e,storageType:t,onTypeChange:n}){const r=t===je.GOOGLE_BIGQUERY?Object.values(ar):t===je.AWS_ATHENA?Object.values(S2):Object.values(C2),s=i=>{n&&(t===je.GOOGLE_BIGQUERY||je.AWS_ATHENA,n(i))};return a.jsxs(ua,{value:e,onValueChange:s,children:[a.jsx(fa,{className:"cursor-pointer",size:"sm",children:a.jsx(da,{placeholder:"Select field type"})}),a.jsx(ha,{className:"max-h-[300px]",children:r.map(i=>a.jsx(Bn,{value:i,children:i},i))})]})}function vue({table:e}){return a.jsx("div",{className:"px-3 text-right",children:a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(Ct,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta?t.columnDef.meta.title??t.id: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()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function bue({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:s=500,className:i,"aria-label":c}){const[u,f]=h.useState(n),m=h.useRef(!0);h.useEffect(()=>{(n===""||m.current)&&(f(n),m.current=!1)},[n]);const y=h.useCallback(g=>{const x=g.target.value;f(x);const v=setTimeout(()=>{r(x)},s);return()=>{clearTimeout(v)}},[r,s]);return a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(jc,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),a.jsx(It,{id:e,placeholder:t,value:u,onChange:y,className:i??"dm-card-toolbar-search-input","aria-label":c??t})]})}function Sue({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:s,disabled:i=!1}){return a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsx(bue,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),a.jsxs("div",{className:"dm-card-toolbar-right",children:[s&&a.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(s).map(([c,u])=>u===0?null:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(_M,{status:c}),a.jsx("span",{className:"text-sm font-medium text-gray-500",children:u})]},c))}),a.jsxs(we,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,disabled:i,"aria-label":"Add new field",children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const Cue={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function NN(e,t={}){const n=Cue[e];return n?{...t,position:"sticky",zIndex:n.zIndex,...n.left!==void 0&&{left:n.left},...n.right!==void 0&&{right:n.right}}:t}function wue({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:i,dragContextProps:c,rowComponent:u=Hn,getRowId:f}){const{isSchemaActualizationLoading:m}=bs(),y=t,g=i,x=u,{columnVisibility:v,setColumnVisibility:C}=Ele(y),b=wl({data:e,columns:y,getCoreRowModel:Cl(),getFilteredRowModel:yd(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:v},onColumnVisibilityChange:C,enableGlobalFilter:!0,globalFilterFn:Rle,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:w,onChange:R,searchValue:j}=jle(b),_=h.useRef("");h.useEffect(()=>{s&&j!==_.current&&(_.current=j,s(j))},[j,s]);const D=h.useMemo(()=>{const T={[Qa.CONNECTED]:0,[Qa.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[Qa.DISCONNECTED]:0};return(r??e).forEach(k=>{k.status in T&&T[k.status]++}),T},[e,r]);return a.jsxs("div",{className:"space-y-4",children:[n&&a.jsx(Sue,{table:b,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:w,onFilterChange:R,statusCounts:D,disabled:m}),a.jsx("div",{className:"dm-card-table-wrap mb-0",children:a.jsxs(El,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:b.getHeaderGroups().map(T=>a.jsx(Hn,{className:"dm-card-table-header-row",children:T.headers.map(I=>a.jsx(Tl,{className:"bg-secondary dark:bg-background",style:NN(I.column.id,{width:I.getSize()!==0?I.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:I.isPlaceholder?null:typeof I.column.columnDef.header=="function"?I.column.columnDef.header(I.getContext()):I.column.columnDef.header},I.id))},T.id))}),a.jsx(jl,{className:"dm-card-table-body",children:b.getRowModel().rows.length?a.jsx(g,{...c,children:b.getRowModel().rows.map(T=>a.jsx(x,{id:f?f(T):T.index,row:T,children:T.getVisibleCells().map(I=>a.jsx($r,{className:"bg-background dark:bg-muted",style:NN(I.column.id,{width:I.column.getSize()!==0?I.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:I.column.columnDef.cell&&typeof I.column.columnDef.cell=="function"?I.column.columnDef.cell(I.getContext()):null},I.id))},T.id))}):a.jsx(Hn,{children:a.jsx($r,{colSpan:y.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&a.jsxs(we,{variant:"outline",className:"dm-card-table-add-field-btn bg-background dark:bg-muted w-full cursor-pointer rounded-t-none border-0",onClick:n,disabled:m,"aria-label":"Add new field",children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function _C({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:i=[],fieldsForStatusCount:c,onSearchChange:u,nameColumnHeader:f,nameColumnCell:m,primaryKeyColumnCell:y,aliasColumnCell:g,descriptionColumnCell:x,actionsColumnCell:v,dragContext:C,dragContextProps:b,rowComponent:w,getRowId:R}){const j=h.useCallback((T,I)=>{if(t){const k=[...e];k[T]={...k[T],...I},t(k)}},[e,t]),_=h.useCallback(()=>{if(t){const T=r();t([...e,T])}},[e,t,r]),D=h.useCallback(T=>{if(t){const I=[...e];I.splice(T,1),t(I)}},[e,t]),O=h.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:T})=>a.jsx(_M,{status:T.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>a.jsxs(vt,{children:[a.jsx(bt,{className:"cursor-default",children:"Name"}),a.jsx(St,{children:"Field name in the output schema"})]})),size:80,cell:({row:T})=>m?m({row:T,updateField:j}):a.jsx(Ku,{value:Sle(T.getValue("name")),onValueChange:I=>{j(T.index,{name:I})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>a.jsxs(vt,{children:[a.jsx(bt,{className:"cursor-default",children:"PK"}),a.jsx(St,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:T})=>y?y({row:T,updateField:j}):a.jsx(TM,{isPrimaryKey:T.getValue("isPrimaryKey"),onPrimaryKeyChange:I=>{j(T.index,{isPrimaryKey:I})}}),enableHiding:!1},{accessorKey:"alias",header:()=>a.jsxs(vt,{children:[a.jsx(bt,{className:"cursor-default",children:"Alias"}),a.jsx(St,{children:"Alternative name for the field"})]}),size:80,cell:({row:T})=>g?g({row:T,updateField:j}):a.jsx(Ku,{value:T.getValue("alias"),onValueChange:I=>{j(T.index,{alias:I})},placeholder:"-"})},{accessorKey:"description",header:()=>a.jsxs(vt,{children:[a.jsx(bt,{className:"cursor-default",children:"Description"}),a.jsx(St,{children:"Detailed information about the field"})]}),cell:({row:T})=>x?x({row:T,updateField:j}):a.jsx(Ku,{value:T.getValue("description"),onValueChange:I=>{j(T.index,{description:I})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:T})=>a.jsx(vue,{table:T}),cell:({row:T,table:I})=>v?v({row:T,table:I}):a.jsx(xM,{row:T,onDeleteRow:t?D:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[j,D,t,f,m,y,g,x,v]),A=h.useMemo(()=>{const I={accessorKey:"type",header:()=>a.jsxs(vt,{children:[a.jsx(bt,{className:"cursor-default pl-[12px]",children:"Type"}),a.jsx(St,{children:"Data type of the field"})]}),size:80,cell:V=>s({row:V.row,updateField:j}),enableHiding:!1},k=[...O];if(k.splice(3,0,I),i.length>0){const V=[...i];V.sort((U,K)=>{const G=U.columnIndex??1/0,q=K.columnIndex??1/0;return G-q}),V.forEach(U=>{if(U.columnIndex!==void 0){const K=Math.min(Math.max(0,U.columnIndex),k.length);k.splice(K,0,U)}else k.splice(k.length-1,0,U)})}return k},[O,s,j,i]);return a.jsx(wue,{fields:e,columns:A,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:u,dragContext:C,dragContextProps:b,rowComponent:w,getRowId:R})}function Eue({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:i,flattenedFields:c,handleSearchChange:u,isRecordType:f,topLevelFields:m,allExpanded:y}=Tle(e),{updateField:g,handleDeleteRow:x,handleAddNestedField:v,handleAddRow:C}=_le(e,c,t,U=>U),b=h.useCallback(()=>({name:"",type:ar.STRING,mode:rh.NULLABLE,isPrimaryKey:!1,status:Qa.DISCONNECTED}),[]),w=h.useCallback(({row:U})=>a.jsx(TC,{type:U.getValue("type"),storageType:je.GOOGLE_BIGQUERY,onTypeChange:K=>{g(U.index,{type:K})}}),[g]),R=h.useMemo(()=>[{accessorKey:"mode",header:()=>a.jsxs(vt,{children:[a.jsx(bt,{className:"cursor-default pl-[12px]",children:"Mode"}),a.jsx(St,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
|
|
828
|
-
NULLABLE - field can be NULL
|
|
829
|
-
REQUIRED - field cant be NULL
|
|
830
|
-
REPEATED - field is an Array of Type`})]}),size:80,cell:({row:U})=>a.jsx(hue,{mode:U.getValue("mode"),onModeChange:K=>{g(U.index,{mode:K})}}),columnIndex:4}],[g]),j=h.useCallback(()=>a.jsxs("div",{className:"flex items-center",children:[r&&a.jsx(uue,{isAllExpanded:y,onToggle:i}),a.jsxs(vt,{children:[a.jsx(bt,{className:"cursor-default",children:"Name"}),a.jsx(St,{children:"Field name in the output schema"})]})]}),[r,y,i]),_=h.useCallback(({row:U})=>{const K=c[U.index],q=(K.type===ar.RECORD||K.type===ar.STRUCT)&&K.fields&&K.fields.length>0,H=K.path??"",M=K.level??0,B=n.has(H);return a.jsxs("div",{className:"flex items-center",children:[M>0&&a.jsx("div",{style:{width:`${String(M*16-(q?4:0))}px`},className:"flex-shrink-0"}),q?a.jsx(due,{isExpanded:B,onToggle:()=>{s(H)},ariaLabel:B?"Collapse nested fields":"Expand nested fields"}):r&&a.jsx("div",{className:"w-5"}),a.jsx(Ku,{value:U.getValue("name"),onValueChange:$=>{g(U.index,{name:$})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,g]),D=h.useCallback(({row:U})=>{const K=c[U.index],G=K.type===ar.RECORD||K.type===ar.STRUCT;return(K.level??0)===0&&!G?a.jsx(TM,{isPrimaryKey:U.getValue("isPrimaryKey"),onPrimaryKeyChange:H=>{g(U.index,{isPrimaryKey:H})}}):a.jsx("div",{})},[c,g]),O=h.useCallback(({row:U})=>a.jsx(Ku,{value:U.getValue("description"),onValueChange:K=>{g(U.index,{description:K})},minRows:5,placeholder:"-"}),[g]),A=h.useCallback(({row:U})=>a.jsx(Ku,{value:U.getValue("alias"),onValueChange:K=>{g(U.index,{alias:K})},placeholder:"-"}),[g]),T=h.useCallback(({row:U})=>a.jsx(xM,{row:U,onDeleteRow:t?x:void 0,onAddNestedField:t?v:void 0,isRecordType:f}),[t,x,v,f]),{handleDragEnd:I}=dC(e,t,c),k=h.useCallback(U=>{const K=c[U.index];return K.path??String(c.indexOf(K))},[c]),V=yC(gC(Wh,{activationConstraint:{distance:5}}));return a.jsx(CC,{sensors:V,collisionDetection:xC,onDragEnd:I,children:a.jsx(_C,{fields:c,onFieldsChange:t,onAddRow:C,createNewField:b,renderTypeCell:w,additionalColumns:R,fieldsForStatusCount:m,onSearchChange:u,nameColumnHeader:j,nameColumnCell:_,primaryKeyColumnCell:D,aliasColumnCell:A,descriptionColumnCell:O,actionsColumnCell:T,dragContext:EC,dragContextProps:{items:c.map(U=>U.path??String(c.indexOf(U))),strategy:wC},rowComponent:RC,getRowId:k})})}function Rue({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:S2.STRING,isPrimaryKey:!1,status:Qa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(TC,{type:c.getValue("type"),storageType:je.AWS_ATHENA,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=dC(e,t),i=yC(gC(Wh,{activationConstraint:{distance:5}}));return a.jsx(CC,{sensors:i,collisionDetection:xC,onDragEnd:s,children:a.jsx(_C,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:EC,dragContextProps:{items:e.map((c,u)=>u),strategy:wC},rowComponent:RC})})}function jue({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:C2.VARCHAR,isPrimaryKey:!1,status:Qa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(TC,{type:c.getValue("type"),storageType:je.SNOWFLAKE,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=dC(e,t),i=yC(gC(Wh,{activationConstraint:{distance:5}}));return a.jsx(CC,{sensors:i,collisionDetection:xC,onDragEnd:s,children:a.jsx(_C,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:EC,dragContextProps:{items:e.map((c,u)=>u),strategy:wC},rowComponent:RC})})}function Tue({schema:e,storageType:t,onFieldsChange:n}){const r=h.useMemo(()=>{if(!e){const s=ble(t);return n(s.fields),s}return e},[e,t,n]);return qI(r)?a.jsx(Eue,{fields:r.fields,onFieldsChange:n}):KI(r)?a.jsx(Rue,{fields:r.fields,onFieldsChange:n}):ZI(r)?a.jsx(jue,{fields:r.fields,onFieldsChange:n}):a.jsx("div",{className:"p-4 text-center",children:a.jsx("p",{children:"Unsupported schema type"})})}function _ue({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:s,runSchemaActualization:i,isSchemaActualizationLoading:c}=bs(),{id:u="",schema:f}=t??{},{schema:m,isDirty:y,updateSchema:g,resetSchema:x}=Cle(f),{operationStatus:v,startSaveOperation:C}=wle(r,s);h.useEffect(()=>{v==="success"&&x()},[v,x]);const b=h.useCallback(D=>{g(D)},[g]),w=h.useCallback(()=>{u&&m&&(C(),n(u,m).then(()=>{i==null||i()}))},[u,m,C,n,i]),R=h.useCallback(()=>{i==null||i()},[i]),j=h.useCallback(()=>{x()},[x]),_=r||c;return t?a.jsxs("div",{className:"space-y-4",children:[a.jsx(Tue,{schema:m,storageType:t.storage.type,onFieldsChange:b}),a.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[a.jsxs("div",{className:"flex space-x-4",children:[a.jsx(we,{variant:"default",onClick:w,disabled:!y||_,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:j,disabled:!y||_,children:"Discard"})]}),a.jsx(we,{type:"button",variant:"outline",onClick:R,disabled:!e||_,children:"Refresh schema"})]})]}):a.jsx("div",{children:"Error: Data mart not found"})}function Nue(){const e=Wg(),{id:t,projectId:n}=e;return t?n?a.jsx("div",{className:"dm-page",children:a.jsx(CO,{children:a.jsx(mae,{id:t})})}):a.jsx("div",{className:"dm-page-header",children:"Project ID is required"}):a.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}function Aue({className:e,...t}){return a.jsx("div",{"data-slot":"card",className:se("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Due({className:e,...t}){return a.jsx("div",{"data-slot":"card-header",className:se("@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 Oue({className:e,...t}){return a.jsx("div",{"data-slot":"card-title",className:se("leading-none font-semibold",e),...t})}function Iue({className:e,...t}){return a.jsx("div",{"data-slot":"card-description",className:se("text-muted-foreground text-sm",e),...t})}function Mue({className:e,...t}){return a.jsx("div",{"data-slot":"card-content",className:se("px-6",e),...t})}function kue({className:e,...t}){return a.jsx("div",{"data-slot":"card-footer",className:se("flex items-center px-6 [.border-t]:pt-6",e),...t})}const NC=h.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function yo({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=h.useContext(NC);return a.jsxs("div",{className:"flex items-center gap-2 self-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.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:a.jsx(e,{size:18})}),a.jsx(Oue,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&a.jsx(Iue,{className:se("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.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:[a.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),a.jsx("span",{className:"sr-only",children:t})]})}),a.jsx(St,{children:a.jsx("p",{children:t})})]})})]})}yo.displayName="CollapsibleCardHeaderTitle";function Xh({children:e,className:t}){const n=r=>{r.stopPropagation()};return a.jsx("div",{className:se("flex items-center gap-2 self-center",t),onClick:n,children:e})}Xh.displayName="CollapsibleCardHeaderActions";function xo({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=h.useContext(NC);let s,i;return h.Children.forEach(e,c=>{if(h.isValidElement(c))switch(c.type){case yo:s=c;break;case Xh:i=c;break}}),a.jsxs(Due,{className:se("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[s,a.jsxs("div",{className:"flex items-center gap-2",children:[i,t&&a.jsx("div",{className:se("flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 hover:bg-gray-200/50 dark:hover:bg-white/4"),children:a.jsx("div",{className:se("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:a.jsx(Ss,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}xo.displayName="CollapsibleCardHeader";function vo({children:e}){return a.jsx(Mue,{className:"px-4 pt-1",children:e})}vo.displayName="CollapsibleCardContent";function ai({left:e,right:t}){return a.jsxs(kue,{className:"flex items-center gap-2 px-4 py-4",children:[a.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&a.jsx("div",{className:"flex items-center",children:t})]})}ai.displayName="CollapsibleCardFooter";const AN="collapsed-card-";function ul({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:i,name:c}){const u=c?ps.get(`${AN}${c}`,"boolean")??s:s,[f,m]=h.useState(u);h.useEffect(()=>{c&&ps.set(`${AN}${c}`,f)},[f,c]);const y=()=>{const b=!f;m(b),i==null||i(b)};let g,x,v;h.Children.forEach(e,b=>{if(h.isValidElement(b))switch(b.type){case xo:g=b;break;case vo:x=b;break;case ai:v=b;break}});const C={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 a.jsx(NC.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:y},children:a.jsxs(Aue,{className:se(C[n],t),children:[g,a.jsx("div",{className:se("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:a.jsxs("div",{className:"overflow-hidden",children:[x,v]})})]})})}function Lue(){const{dataMart:e,updateDataMartStorage:t}=ws(),n=(e==null?void 0:e.definitionType)??null,[r,s]=h.useState(n);return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs(ul,{collapsible:!0,name:"data-storage",children:[a.jsx(xo,{children:a.jsx(yo,{icon:cc,tooltip:"Configure where your data will be stored",children:"Storage"})}),a.jsx(vo,{children:(e==null?void 0:e.storage)&&a.jsx(Loe,{dataStorage:e.storage,onDataStorageChange:t})}),a.jsx(ai,{})]}),a.jsxs(ul,{collapsible:!0,name:"input-source",children:[a.jsx(xo,{children:a.jsx(yo,{icon:uS,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),a.jsx(vo,{children:e&&a.jsx(vle,{definitionType:r,initialDefinitionType:n,setDefinitionType:s})}),a.jsx(ai,{})]}),a.jsxs(ul,{collapsible:!0,name:"output-schema",children:[a.jsx(xo,{children:a.jsx(yo,{icon:nU,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),a.jsx(vo,{children:e&&a.jsx(_ue,{definitionType:r})}),a.jsx(ai,{})]})]})}function Pue({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:y,runReport:g}=ts(),x=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await y(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[m,y,t,e.original.id,e.original.dataMart.id]),C=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),b=h.useCallback(async()=>{try{s(!0),await g(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[g,e.original.id]),w=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(Cr,{open:i,onOpenChange:c,children:[a.jsx(wr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":x,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(Er,{id:x,align:"end",role:"menu",children:[a.jsxs(Ct,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem",children:[a.jsx(id,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),Ly(e.original.destinationConfig)&&a.jsxs(a.Fragment,{children:[a.jsx(la,{}),a.jsxs(Ct,{onClick:R=>{R.stopPropagation(),b()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(Qg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(Ct,{asChild:!0,children:a.jsxs("a",{href:e2(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[a.jsx(vU,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),a.jsx(la,{}),a.jsxs(Ct,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(br,{open:u,onOpenChange:f,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{v()},variant:"destructive"})]})}const Uue={[Mn.SUCCESS]:{icon:xh,color:"text-green-500",label:"Success"},[Mn.ERROR]:{icon:ag,color:"text-red-500",label:"Fail"},[Mn.RUNNING]:{icon:Rc,color:"text-primary animate-spin",label:"In progress"},[Mn.CANCELLED]:{icon:ag,color:"text-gray-500",label:"Cancelled"}};function NM({status:e,error:t}){if(!e)return null;const n=Uue[e],{icon:r,color:s,label:i}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,u=()=>e===Mn.ERROR&&t?`${i}: ${t}`:i;return a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx(r,{className:se("h-5 w-5",s),role:"img","aria-label":u(),"aria-describedby":c,tabIndex:0})}),a.jsxs(St,{id:c,side:"bottom",role:"tooltip",children:[a.jsx("div",{className:"text-xs",children:i}),e===Mn.ERROR&&t&&a.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}var ol=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(ol||{});const zue={[ol.TITLE]:"Title",[ol.LAST_RUN_DATE]:"Last Run Date",[ol.LAST_RUN_STATUS]:"Last Run Status"},Fue=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:ol.TITLE,header:({column:n})=>a.jsx(xr,{column:n,children:zue[ol.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:ol.LAST_RUN_DATE,header:({column:n})=>a.jsx(xr,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(Vs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:ol.LAST_RUN_STATUS,header:({column:n})=>a.jsx(xr,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(NM,{status:n.original.lastRunStatus,error:n.original.lastRunError}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>a.jsx(xd,{table:n}),cell:({row:n})=>a.jsx(Pue,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function Hue({destination:e,onEditReport:t}){const{reports:n,setPollingConfig:r}=ts(),s=h.useMemo(()=>n.filter(x=>x.dataDestination.type===Oe.GOOGLE_SHEETS&&x.dataDestination.id===e.id),[n,e.id]);h.useEffect(()=>{r({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[r]);const i=h.useMemo(()=>Fue({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:c,setSorting:u,columnVisibility:f,setColumnVisibility:m}=Oc({columns:i,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),y=wl({data:s,columns:i,getCoreRowModel:Cl(),onSortingChange:u,getSortedRowModel:Dc(),state:{sorting:c,columnVisibility:f},onColumnVisibilityChange:m}),g=`google-sheets-reports-table-${e.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{id:g,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[a.jsx(Rl,{className:"dm-card-table-header",children:y.getHeaderGroups().map(x=>a.jsx(Hn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(Tl,{style:v.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(v.column.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))},x.id))}),a.jsx(jl,{className:"dm-card-table-body",children:y.getRowModel().rows.length?y.getRowModel().rows.map((x,v)=>a.jsx(Hn,{onClick:()=>{const C=n.find(b=>b.id===x.original.id);C&&t(C)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:x.getVisibleCells().map((C,b)=>a.jsx($r,{className:`px-6 whitespace-normal ${C.column.id==="actions"?"actions-cell":""}`,style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},role:"cell","aria-colindex":b+1,children:typeof C.column.columnDef.cell=="function"?C.column.columnDef.cell(C.getContext()):C.column.columnDef.cell},C.id))},x.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:i.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function $ue({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:y,runReport:g}=ts(),x=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await y(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete report:",R)}},[m,y,t,e.original.id,e.original.dataMart.id]),C=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),b=h.useCallback(async()=>{try{s(!0),await g(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[g,e.original.id]),w=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(Cr,{open:i,onOpenChange:c,children:[a.jsx(wr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":x,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(Er,{id:x,align:"end",role:"menu",children:[a.jsxs(Ct,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem",children:[a.jsx(id,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),a.jsx(la,{}),a.jsxs(Ct,{onClick:R=>{R.stopPropagation(),b()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(Qg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(la,{}),a.jsxs(Ct,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(br,{open:u,onOpenChange:f,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{v()},variant:"destructive"})]})}function v1({column:e,children:t,label:n}){const r=e.getIsSorted(),s=h.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),i=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",u=n??(typeof t=="string"?t:"Column");return a.jsxs(we,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${u} - ${i()}. Click to sort.`,"aria-sort":c(),children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&a.jsx(Yu,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(Ss,{className:"text-foreground h-4 w-4"}),!r&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(Yu,{className:"text-muted-foreground h-4 w-4"})})]})]})}var il=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(il||{});const AM={[il.TITLE]:"Title",[il.LAST_RUN_DATE]:"Last Run Date",[il.LAST_RUN_STATUS]:"Last Run Status"};function Vue({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=AM[t.id]||t.id;return a.jsx(Ct,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.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()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:n})]})},t.id)})})]})})}const Gue=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:il.TITLE,header:({column:n})=>a.jsx(v1,{column:n,children:AM[il.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:il.LAST_RUN_DATE,header:({column:n})=>a.jsx(v1,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(Vs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:il.LAST_RUN_STATUS,header:({column:n})=>a.jsx(v1,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(NM,{status:n.original.lastRunStatus,error:n.original.lastRunError}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>a.jsx(Vue,{table:n}),cell:({row:n})=>a.jsx($ue,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function Bue({destinationType:e,destination:t,onEditReport:n}){const{reports:r,setPollingConfig:s}=ts(),i=h.useMemo(()=>r.filter(v=>v.dataDestination.type===e&&v.dataDestination.id===t.id),[r,t.id,e]);h.useEffect(()=>{s({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[s]);const c=h.useMemo(()=>Gue({onDeleteSuccess:()=>{},onEditReport:n}),[n]),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:y}=Oc({columns:c,storageKeyPrefix:`data-mart-email-reports-${t.id}`,defaultSortingColumn:"lastRunDate"}),g=wl({data:i,columns:c,getCoreRowModel:Cl(),onSortingChange:f,getSortedRowModel:Dc(),state:{sorting:u,columnVisibility:m},onColumnVisibilityChange:y}),x=`email-reports-table-${t.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{id:x,className:"dm-card-table",role:"table","aria-label":`${t.title} reports`,children:[a.jsx(Rl,{className:"dm-card-table-header",children:g.getHeaderGroups().map(v=>a.jsx(Hn,{className:"dm-card-table-header-row",children:v.headers.map(C=>a.jsx(Tl,{style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},scope:"col",children:C.isPlaceholder?null:typeof C.column.columnDef.header=="function"?C.column.columnDef.header(C.getContext()):C.column.columnDef.header},C.id))},v.id))}),a.jsx(jl,{className:"dm-card-table-body",children:g.getRowModel().rows.length?g.getRowModel().rows.map((v,C)=>a.jsx(Hn,{onClick:()=>{const b=r.find(w=>w.id===v.original.id);b&&n(b)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":C+1,children:v.getVisibleCells().map((b,w)=>a.jsx($r,{className:`px-6 whitespace-normal ${b.column.id==="actions"?"actions-cell":""}`,style:b.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(b.column.getSize())}%`},role:"cell","aria-colindex":w+1,children:typeof b.column.columnDef.cell=="function"?b.column.columnDef.cell(b.getContext()):b.column.columnDef.cell},b.id))},v.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:c.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function que({children:e,className:t,...n}){return a.jsx("div",{className:se("group flex items-start justify-center gap-3 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",t),...n,children:e})}function Kue({children:e,className:t,...n}){return a.jsx("div",{className:se("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function Zue({children:e,className:t,...n}){return a.jsx("div",{className:se("text-md font-medium",t),...n,children:e})}function Yue({children:e,className:t,...n}){return a.jsx("div",{className:se("text-muted-foreground text-sm",t),...n,children:e})}function Wue({checked:e,disabled:t,loading:n,onCheckedChange:r,tooltipTextSwitchOn:s,tooltipTextSwitchOff:i,tooltipTextSwitchDisabled:c}){const u=t?c??"Disabled":e?s:i;return a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:f=>f.stopPropagation(),children:n?a.jsx(Rc,{className:"text-muted-foreground h-5 w-5 animate-spin"}):a.jsx(iC,{checked:e,disabled:t,onCheckedChange:r})})}),a.jsx(St,{children:u})]})}function Xue({icon:e,className:t,...n}){return a.jsx("div",{className:se("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:a.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-white/4",children:e??a.jsx(_a,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function Que(e){const{dataMart:t}=bs(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:i}=ts(),[c,u]=h.useState(!1),f=h.useMemo(()=>n.find(v=>v.dataDestination.type===Oe.LOOKER_STUDIO&&v.dataDestination.id===e.id),[n,e.id]),m=h.useMemo(()=>(t==null?void 0:t.status.code)===Ar.PUBLISHED,[t==null?void 0:t.status.code]),y=h.useMemo(()=>!!f,[f]),g=h.useMemo(()=>y?"Available in Looker Studio":"Not available in Looker Studio",[y]),x=h.useCallback(async v=>{if(!(!t||!m)){u(!0);try{if(v){const C={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:Dr.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(C),await i(t.id)}else f&&(await s(f.id),await i(t.id))}catch(C){console.error("Failed to toggle Looker Studio report:",C)}finally{u(!1)}}},[t,m,e,f,r,s,i]);return{existingReport:f,isLoading:c,isEnabled:m,isChecked:y,dynamicTitle:g,handleSwitchChange:x}}function Jue({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:i,isChecked:c,dynamicTitle:u,handleSwitchChange:f}=Que(e),m=h.useCallback(()=>{r&&t(r)},[r,t]);return a.jsxs(que,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?m:void 0,...n,children:[a.jsx(Wue,{checked:c,disabled:!i,loading:s,onCheckedChange:y=>void f(y),tooltipTextSwitchOn:"Switch off to remove access",tooltipTextSwitchOff:"Switch on to enable access",tooltipTextSwitchDisabled:"Publish the Data Mart first to enable access in Looker Studio"}),a.jsxs(Kue,{children:[a.jsx(Zue,{children:u}),a.jsx(Yue,{children:c&&r?a.jsx(a.Fragment,{children:r.lastRunDate?a.jsxs(a.Fragment,{children:["Last fetched"," ",r.lastRunStatus===Mn.SUCCESS&&"successfully ",a.jsx(Vs,{date:new Date(r.lastRunDate)}),r.lastRunStatus===Mn.ERROR&&" but failed with error",r.lastRunError&&a.jsx("div",{className:"mt-1 text-red-600 dark:text-red-400",children:r.lastRunError})]}):"Waiting for Looker Studio to fetch data"}):"Switch on to enable access"})]}),c&&r&&a.jsx(Xue,{})]})}function ede(){const{scope:e}=pi();return a.jsx("div",{className:"dm-card",children:a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(iS,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Wr,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",a.jsx(_a,{className:"h-4 w-4"})]})})]})})}function tde(){const[e,t]=h.useState(!1),[n,r]=h.useState(Nn.CREATE),[s,i]=h.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(Nn.CREATE),i(null),t(!0),De({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:m=>{r(Nn.EDIT),i(m),t(!0),De({event:"report_open",category:"Report",action:"EditReport",label:m.dataDestination.type})},handleCloseModal:()=>{t(!1),i(null),De({event:"report_close",category:"Report",action:n===Nn.EDIT?"Edit":"Create",label:"ReportForm"})}}}const nde=[Oe.GOOGLE_SHEETS,Oe.EMAIL,Oe.SLACK,Oe.MS_TEAMS,Oe.GOOGLE_CHAT];function rde({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=tJ(e),{isOpen:s,mode:i,editingReport:c,handleAddReport:u,handleEditReport:f,handleCloseModal:m}=tde();return r?a.jsxs(a.Fragment,{children:[a.jsxs(ul,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[a.jsxs(xo,{children:[a.jsx(yo,{icon:n.icon,children:e.title}),a.jsx(Xh,{children:nde.includes(e.type)&&a.jsx(ade,{dataMartStatus:t,onAddReport:u})})]}),a.jsx(vo,{children:a.jsx(ife,{destination:e,onEditReport:f})}),a.jsx(ai,{})]}),a.jsx(ofe,{destination:e,isOpen:s,onClose:m,mode:i,initialReport:c})]}):null}function ade({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===Ar.DRAFT;return a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("span",{children:a.jsxs(we,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[a.jsx(ma,{className:"h-4 w-4"}),"Add Report"]})})}),n&&a.jsx(St,{children:a.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function sde({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){h.useEffect(()=>{{const s=setTimeout(()=>{const i=document.getElementById(e);if(i){const c=i;c.focus(),r&&c.value?c.select():c.value&&c.setSelectionRange(c.value.length,c.value.length)}},n);return()=>{clearTimeout(s)}}},[t,e,n,r])}const ode=an({title:Dt().min(1,"Title is required"),documentUrl:Dt().refine(C5,"Enter a valid Google Sheets URL"),dataDestinationId:Dt().min(1,"Destination is required")});function ide({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:y,createReport:g,error:x,clearError:v}=ts();h.useEffect(()=>{f&&x&&(u(x),m(!1))},[x,f]);const C=To({resolver:xi(ode),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&Ly(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(i==null?void 0:i.id)??""},mode:"onTouched"}),{register:b,handleSubmit:w,formState:R,reset:j}=C,{errors:_,isDirty:D}=R,O=h.useCallback(async A=>{try{u(null),v(),m(!0);const{spreadsheetId:T,sheetId:I}=OQ(A.documentUrl);if(!T){u("Invalid Google Sheets URL");return}let k;if(t===Nn.CREATE)k=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:{type:Dr.GOOGLE_SHEETS_CONFIG,spreadsheetId:T,sheetId:I}});else{if(!e){u("Initial report is required for edit mode");return}k=await y(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:{type:Dr.GOOGLE_SHEETS_CONFIG,spreadsheetId:T,sheetId:I}})}if(!k||x){u(x??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(k))}catch(V){console.error("onAfterSubmit failed",V)}s==null||s()}catch(T){console.error("Error submitting form:",T),u("An error occurred while submitting the form")}},[t,e,n,g,y,r,s,v,x]);return{form:C,register:b,handleSubmit:w,errors:_,isDirty:D,reset:j,formError:c,isSubmitting:f,setFormError:u,getValues:C.getValues,onSubmit:O}}function lde(e){return e.type===sl.SCHEDULED_REPORT_RUN}function cde(e,t){if(e.length!==t.length)return!1;const n=i=>`${i.id??"new"}|${i.cron}|${i.timezone}|${i.enabled?"1":"0"}`,r=[...e].sort((i,c)=>n(i).localeCompare(n(c))),s=[...t].sort((i,c)=>n(i).localeCompare(n(c)));for(let i=0;i<r.length;i++){const c=r[i],u=s[i];if(c.id!==u.id||c.cron!==u.cron||c.timezone!==u.timezone||c.enabled!==u.enabled)return!1}return!0}const DN=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,ON="0 9 * * *";function ude(e){return{id:e.id,cron:e.cronExpression,timezone:e.timeZone,enabled:e.isActive,lastRun:e.lastRunTimestamp??null,nextRun:e.nextRunTimestamp??null}}async function IN(e,t){return(await lo.getScheduledTriggers(e)).filter(s=>s.type===Fn.REPORT_RUN&&lde(s.triggerConfig)&&s.triggerConfig.reportId===t).map(ude)}const AC=h.forwardRef(({dataMartId:e,reportId:t,onDirtyChange:n},r)=>{const[s,i]=h.useState([]),[c,u]=h.useState([]),f=h.useRef(!1),[m,y]=h.useState(null);h.useEffect(()=>{let b=!1;async function w(){if(!e||!t){u([]),i([]),f.current=!0,n==null||n(!1);return}try{const R=await IN(e,t);b||(u(R),i(R),f.current=!0,n==null||n(!1))}catch{b||(u([]),i([]),f.current=!0,n==null||n(!1))}}return w(),()=>{b=!0}},[e,t,n]),h.useEffect(()=>{f.current&&(n==null||n(!cde(s,c)))},[s,c,n]),h.useImperativeHandle(r,()=>({persist:async b=>{const w=c.filter(O=>O.id!==null),R=s.filter(O=>O.id!==null),j=new Map(w.map(O=>[O.id,O])),_=new Map(R.map(O=>[O.id,O]));for(const[O]of j.entries())_.get(O)||await lo.deleteScheduledTrigger(e,O);for(const[O,A]of _.entries()){const T=j.get(O);T&&(T.cron!==A.cron||T.timezone!==A.timezone||T.enabled!==A.enabled)&&await lo.updateScheduledTrigger(e,O,{cronExpression:A.cron,timeZone:A.timezone,isActive:A.enabled})}const D=s.filter(O=>!O.id);for(const O of D)await lo.createScheduledTrigger(e,{type:Fn.REPORT_RUN,cronExpression:O.cron,timeZone:O.timezone,isActive:O.enabled,triggerConfig:{type:sl.SCHEDULED_REPORT_RUN,reportId:b}});try{const O=await IN(e,b);u(O),i(O),n==null||n(!1)}catch{u(s.map(O=>({...O}))),n==null||n(!1)}}}),[e,s,c,n]);const g=()=>{i(b=>[...b,{id:null,cron:ON,timezone:DN(),enabled:!0}])},x=b=>{i(w=>w.filter((R,j)=>j!==b))},v=(b,w)=>{i(R=>R.map((j,_)=>_===b?{...j,...w}:j))},C=s.length>0;return a.jsxs("div",{className:"flex flex-col gap-4",children:[C?s.map((b,w)=>a.jsxs("div",{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-transparent dark:bg-white/4",children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ta,{htmlFor:`trigger-enabled-${String(w)}`,className:"text-sm font-normal",children:b.enabled?"Enabled":"Disabled"}),a.jsx(iC,{id:`trigger-enabled-${String(w)}`,checked:b.enabled,onCheckedChange:R=>{v(w,{enabled:R})}})]}),a.jsx("div",{children:a.jsx(we,{variant:"ghost",size:"sm",type:"button","aria-label":"Delete trigger",onClick:()=>{y(w)},children:a.jsx(es,{className:"h-4 w-4","aria-hidden":"true"})})})]}),a.jsx(Pb,{cron:b.cron,timezone:b.timezone,enabled:b.enabled,onChange:v.bind(null,w),showPreview:!1,showSaveButton:!1,hideEnableSwitch:!0}),(b.lastRun??b.nextRun)&&a.jsxs("div",{className:"text-muted-foreground mt-3 grid gap-1 text-xs sm:grid-cols-2",children:[b.lastRun&&a.jsxs("div",{children:[a.jsx("span",{className:"text-foreground/80 font-medium",children:"Last run: "}),a.jsx(Vs,{date:new Date(b.lastRun)})]}),b.nextRun&&a.jsxs("div",{children:[a.jsx("span",{className:"text-foreground/80 font-medium",children:"Next run: "}),a.jsx(Vs,{date:new Date(b.nextRun)})]})]}),m===w&&a.jsx(oO,{open:m===w,onOpenChange:R=>{R||y(null)},children:a.jsxs(iO,{children:[a.jsxs(lO,{children:[a.jsx(uO,{children:"Delete trigger?"}),a.jsx(dO,{children:"This action will remove this schedule from the report."})]}),a.jsxs(cO,{children:[a.jsx(hO,{onClick:()=>{y(null)},children:"Cancel"}),a.jsx(fO,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{x(w),y(null)},children:"Delete"})]})]})})]},`${b.id??"new"}:${String(w)}`)):a.jsxs("div",{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-transparent dark:bg-white/4",children:[a.jsx(Pb,{cron:ON,timezone:DN(),enabled:!1,showPreview:!1,showSaveButton:!1,hideEnableSwitch:!0}),a.jsx("div",{className:"gp-2 mt-3 flex items-center justify-between text-sm",children:a.jsx(we,{variant:"outline",type:"button",onClick:g,size:"sm",children:"+ Add trigger"})})]}),C&&a.jsx("div",{children:a.jsx(we,{variant:"outline",type:"button",onClick:g,children:"+ Add trigger"})})]})});AC.displayName="ReportSchedulesInlineList";function dde(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"service-account-details",children:[a.jsx(Yt,{children:"How do I get a correct document link?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open your Google Sheets document and select the specific ",a.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),a.jsxs("li",{children:["Share the document with the service account email and grant it ",a.jsx("strong",{children:"Editor"})," ","access."]}),a.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",a.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),a.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function b1(e){return"serviceAccount"in e}function DM({value:e,children:t,doNotTruncateContent:n}){const[r,s]=h.useState(!1),i=async()=>{e&&(await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3))};return a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsxs("div",{role:"button",tabIndex:0,onClick:i,onKeyDown:c=>c.key==="Enter"&&i(),className:se("flex cursor-pointer items-center justify-between gap-2 select-none","text-muted-foreground border-input rounded-md border px-3 py-1.5 text-sm","hover:bg-accent hover:text-accent-foreground transition-colors"),children:[a.jsx("span",{className:n?"w-[95%]":"truncate",children:t||e||"No data"}),r?a.jsx(oa,{className:"h-4 w-4 text-green-500"}):a.jsx(Wu,{className:"h-4 w-4"})]})}),a.jsx(St,{children:a.jsx("p",{children:r?"Copied!":"Click to copy"})})]})})}const fde=Ec("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l [&>*:not(:first-child)]:border-white/24 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function hde({className:e,orientation:t,...n}){return a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":t,className:se(fde({orientation:t}),e),...n})}const OM=({mode:e,isSubmitting:t,isDirty:n,triggersDirty:r,onRunAndSave:s,onCancel:i})=>{const c=t||!(n||r),u=e===Nn.CREATE?"Create & Run report":n||r?"Save & Run report":"Run report";return a.jsxs(Mc,{children:[a.jsxs(hde,{className:"w-full",children:[a.jsx(we,{variant:"default",type:"submit",disabled:c,className:"flex-1",children:e===Nn.CREATE?"Create new report":"Save changes to report"}),a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"default",type:"button",disabled:c,"aria-label":"More actions",className:"group",children:a.jsx(Ss,{className:"size-4 transition-transform duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})})}),a.jsx(Er,{align:"end",side:"top",children:a.jsx(Ct,{onClick:s,disabled:t,children:u})})]})]}),i&&a.jsx(we,{variant:"outline",type:"button",onClick:i,disabled:t,children:"Cancel"})]})},mde=h.forwardRef(({initialReport:e,mode:t=Nn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="google-sheets-edit-form",m="google-sheets-title-input",y="google-sheets-document-url-input",g="google-sheets-data-destination-select",{dataMart:x}=bs(),{scope:v}=pi(),{dataDestinations:C,fetchDataDestinations:b,loading:w}=Fh(),[R,j]=h.useState([]);h.useEffect(()=>{x&&b()},[x,b]),h.useEffect(()=>{if(C.length>0){const M=C.filter(B=>B.type===Oe.GOOGLE_SHEETS);j(M)}},[C]),sde({elementId:m,isOpen:!0,delay:150});const _=h.useRef(null),D=h.useRef(!1),[O,A]=h.useState(!1),{runReport:T}=ts(),{isDirty:I,reset:k,form:V,isSubmitting:U,formError:K,onSubmit:G}=ide({initialReport:e,mode:t,dataMartId:(x==null?void 0:x.id)??"",onAfterSubmit:async M=>{var B;try{await((B=_.current)==null?void 0:B.persist(M.id))}catch($){console.error("Failed to persist schedule for report",$)}if(D.current)try{await T(M.id)}catch($){throw console.error("Failed to run report",$),$}finally{D.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(K)},[K,r]),h.useEffect(()=>{if(t===Nn.EDIT&&e&&Ly(e.destinationConfig))k({title:e.title,documentUrl:e2(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===Nn.CREATE){const M=(c==null?void 0:c.id)??"";k({title:"",documentUrl:"",dataDestinationId:M})}},[e,t,k,c]),h.useEffect(()=>{n==null||n(I||O)},[I,O,n]);const q=V.watch("documentUrl"),H=q&&C5(q.trim());return a.jsx(_l,{...V,children:a.jsxs(yi,{id:f,ref:u,noValidate:!0,onSubmit:M=>void V.handleSubmit(G)(M),children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(Nt,{control:V.control,name:"title",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(jt,{children:a.jsx(It,{id:m,placeholder:"Enter a report title",...M})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:V.control,name:"dataDestinationId",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(ua,{onValueChange:M.onChange,value:M.value,disabled:w||R.length===0,children:[a.jsx(jt,{children:a.jsx(fa,{id:g,className:"w-full max-w-full overflow-hidden",children:a.jsx(da,{className:"truncate",placeholder:"Select a destination",children:M.value&&R.length>0&&(()=>{const B=R.find($=>$.id===M.value);if(B){const re=aa.getInfo(B.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(re,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:B.title})})]})}return null})()})})}),a.jsx(ha,{children:R.map(B=>{const re=aa.getInfo(B.type).icon;return a.jsx(Bn,{value:B.id,children:a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(re,{className:"flex-shrink-0",size:18}),a.jsxs("div",{className:"flex min-w-0 flex-col",children:[a.jsx("span",{className:"truncate",children:B.title}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(b1(B.credentials)&&Z0(B.credentials.serviceAccount))??"No email found"})]})]})},B.id)})})]}),R.length===0&&!w&&a.jsxs(aC,{className:"mt-2",children:[a.jsx(yh,{className:"h-4 w-4"}),a.jsx(AI,{children:"No destinations available"}),a.jsxs(sC,{children:["You need to create a Destination before you can create a report."," ",a.jsx(Wr,{to:v("/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"})]})]}),M.value&&R.length>0&&(()=>{const B=R.find($=>$.id===M.value);return B?a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(yt,{children:"Service Account Email"}),a.jsx(DM,{value:b1(B.credentials)?Z0(B.credentials.serviceAccount)??"No email found":"",children:b1(B.credentials)?Z0(B.credentials.serviceAccount):"No email found"})]}):null})(),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:V.control,name:"documentUrl",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),a.jsx(jt,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(It,{id:y,placeholder:"Document URL",className:"flex-1",...M}),a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.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(q.trim(),"_blank","noopener,noreferrer")},disabled:!H,"aria-label":H?"Open document in new tab":"Document link is not valid",children:a.jsx(si,{className:"h-4 w-4","aria-hidden":"true"})})}),a.jsx(St,{side:"top",align:"center",role:"tooltip",children:H?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),a.jsx(xn,{children:a.jsx(dde,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Yr,{title:"Automate Report Runs",children:x!=null&&x.id?a.jsx(AC,{ref:_,dataMartId:x.id,reportId:t===Nn.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:A}):a.jsx(cC,{})})]}),a.jsx(OM,{mode:t,isSubmitting:U,isDirty:I,triggersDirty:O,onRunAndSave:()=>{D.current=!0,V.handleSubmit(G)()},onCancel:i})]})})});function pde({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:y}=kc(t);return Ol(e),a.jsxs(a.Fragment,{children:[a.jsx(ui,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(di,{children:[a.jsxs(fi,{children:[a.jsx(hi,{children:r===Nn.CREATE?"Create new report":"Edit report"}),a.jsx(yl,{children:r===Nn.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),a.jsx(zh,{children:a.jsx(mde,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:y,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(br,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:f,variant:"destructive"})]})}const gde=an({cacheLifetime:pY().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function yde({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,i]=h.useState(null),{createReport:c,updateReport:u}=ts(),f=To({resolver:xi(gde),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&L5(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async y=>{try{i(null);const{cacheLifetime:g}=y,x={type:Dr.LOOKER_STUDIO_CONFIG,cacheLifetime:g};e?await u(e.id,{title:"Looker Studio Report",dataDestinationId:e.dataDestination.id,destinationConfig:x}):await c({title:"Looker Studio Report",dataMartId:t,dataDestinationId:(r==null?void 0:r.id)??"",destinationConfig:x}),n==null||n()}catch(g){console.error("Error submitting form:",g),i("Failed to save report. Please try again.")}},formError:s,isSubmitting:f.formState.isSubmitting,isDirty:f.formState.isDirty,reset:f.reset}}function xde(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"cache-lifetime-details",children:[a.jsx(Yt,{children:"What is the Cache Lifetime for Looker Studio?"}),a.jsx(Wt,{children:a.jsx("p",{className:"mb-2",children:"Cache Lifetime - defines the period during which results from previous query executions are served from storage-side cache, eliminating the need to re-execute the query"})})]})})}const vde=[{value:300,label:"5 minutes"},{value:600,label:"10 minutes"},{value:900,label:"15 minutes"},{value:1800,label:"30 minutes"},{value:3600,label:"1 hour"},{value:7200,label:"2 hours"},{value:14400,label:"4 hours"},{value:28800,label:"8 hours"},{value:43200,label:"12 hours"}],bde=h.forwardRef(({initialReport:e,mode:t=Nn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="looker-studio-edit-form",{dataMart:m}=bs(),{isDirty:y,reset:g,form:x,isSubmitting:v,formError:C,onSubmit:b}=yde({initialReport:e,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return h.useEffect(()=>{r&&r(C)},[C,r]),h.useEffect(()=>{t===Nn.EDIT&&e&&L5(e.destinationConfig)?g({cacheLifetime:e.destinationConfig.cacheLifetime}):t===Nn.CREATE&&g({cacheLifetime:300})},[e,t,g]),h.useEffect(()=>{n==null||n(y)},[y,n]),a.jsx(_l,{...x,children:a.jsxs(yi,{id:f,ref:u,noValidate:!0,onSubmit:w=>void x.handleSubmit(b)(w),children:[a.jsx(Nl,{children:a.jsx(Yr,{title:"Cache Configuration",children:a.jsx(Nt,{control:x.control,name:"cacheLifetime",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),a.jsxs(ua,{onValueChange:R=>{w.onChange(parseInt(R,10))},value:w.value.toString(),defaultValue:"300",children:[a.jsx(jt,{children:a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select cache time"})})}),a.jsx(ha,{children:vde.map(R=>a.jsx(Bn,{value:R.value.toString(),children:R.label},R.value))})]}),a.jsx(Mt,{}),a.jsx(xn,{children:a.jsx(xde,{})})]})})})}),a.jsxs(Mc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":t===Nn.CREATE?"Create":"Save changes",disabled:!y||v,children:v?t===Nn.CREATE?"Creating...":"Saving...":t===Nn.CREATE?"Create":"Save changes"}),i&&a.jsx(we,{variant:"outline",type:"button",onClick:i,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Sde({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:y}=kc(t);return Ol(e),a.jsxs(a.Fragment,{children:[a.jsx(ui,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(di,{children:[a.jsxs(fi,{children:[a.jsx(hi,{children:(s==null?void 0:s.title)??"Looker Studio"}),a.jsx(yl,{children:r===Nn.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),a.jsx(zh,{children:a.jsx(bde,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:y,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(br,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:f,variant:"destructive"})]})}const MN=({destination:e})=>{const n=aa.getInfo(e.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(n,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:e.title})})]})};function Cde(e){return"to"in e}const wde=({destination:e})=>{if(!e)return null;const t=e.credentials,n=Cde(t)&&t.to.length?t.to.join(", "):"";return a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(yt,{children:"Recipients of this report"}),a.jsx(DM,{doNotTruncateContent:!0,value:n,children:n||"No recipients found"})]})};var sc=(e=>(e.ALWAYS="ALWAYS",e.RESULT_IS_EMPTY="RESULT_IS_EMPTY",e.RESULT_IS_NOT_EMPTY="RESULT_IS_NOT_EMPTY",e))(sc||{});const Ede=an({title:Dt().min(1,"Title is required"),dataDestinationId:Dt().min(1,"Destination is required"),reportCondition:Ry(sc),subject:Dt().min(1,"Subject is required"),messageTemplate:Dt().min(1,"Message body is required")});function Rde({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:y,createReport:g,error:x,clearError:v}=ts();h.useEffect(()=>{f&&x&&(u(x),m(!1))},[x,f]);const C=To({resolver:xi(Ede),defaultValues:{title:(e==null?void 0:e.title)??"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(i==null?void 0:i.id)??"",reportCondition:e!=null&&e.destinationConfig&&W0(e.destinationConfig)?e.destinationConfig.reportCondition:sc.ALWAYS,subject:e!=null&&e.destinationConfig&&W0(e.destinationConfig)?e.destinationConfig.subject:"",messageTemplate:e!=null&&e.destinationConfig&&W0(e.destinationConfig)?e.destinationConfig.messageTemplate:""},mode:"onTouched"}),{handleSubmit:b,formState:w,reset:R}=C,{isDirty:j,errors:_}=w,D=h.useCallback(async O=>{try{u(null),v(),m(!0);let A;const T={type:Dr.EMAIL_CONFIG,reportCondition:O.reportCondition,subject:O.subject,messageTemplate:O.messageTemplate};if(t===Nn.CREATE)A=await g({title:O.title,dataMartId:n,dataDestinationId:O.dataDestinationId,destinationConfig:T});else{if(!e){u("Initial report is required for edit mode");return}A=await y(e.id,{title:O.title,dataDestinationId:O.dataDestinationId,destinationConfig:T})}if(!A||x){u(x??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(A))}catch(I){console.error("onAfterSubmit failed",I)}s==null||s()}catch(A){console.error("Error submitting form:",A),u("An error occurred while submitting the form")}},[t,e,n,g,y,r,s,v,x]);return{form:C,handleSubmit:b,errors:_,isDirty:j,reset:R,formError:c,isSubmitting:f,setFormError:u,onSubmit:D}}const jde=()=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(zr,{className:"h-6 w-3/4"}),a.jsx(zr,{className:"h-4 w-1/2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(zr,{className:"h-4 w-full"}),a.jsx(zr,{className:"h-4 w-5/6"}),a.jsx(zr,{className:"h-4 w-4/5"}),a.jsx(zr,{className:"h-4 w-3/4"})]})]});function IM({html:e,loading:t=!1,error:n=null,height:r=240,className:s,emptyState:i=a.jsx("div",{className:"text-muted-foreground text-sm",children:"Nothing to preview"})}){const{resolvedTheme:c}=Ph(),[u,f]=h.useState({bg:"#fff",fg:"#000"});return h.useEffect(()=>{if(typeof window>"u")return;let m;const y=requestAnimationFrame(()=>{m=requestAnimationFrame(()=>{const g=getComputedStyle(document.documentElement),x=g.getPropertyValue("--background").trim()||"#fff",v=g.getPropertyValue("--foreground").trim()||"#000";f({bg:x,fg:v})})});return()=>{cancelAnimationFrame(y),cancelAnimationFrame(m)}},[c]),a.jsxs("div",{className:`bg-background overflow-auto rounded-md pl-2 ${s??""}`,style:{height:r},children:[t&&a.jsx(jde,{}),!t&&n&&a.jsxs("div",{className:"text-destructive text-sm",children:["Error: ",n]}),!t&&!n&&!e&&i,!t&&!n&&!!e&&a.jsx("iframe",{title:"Markdown preview",sandbox:"allow-popups allow-popups-to-escape-sandbox",srcDoc:`<!doctype html>
|
|
831
|
-
<html lang='en' style="background:${u.bg};color:${u.fg}">
|
|
832
|
-
<head>
|
|
833
|
-
<meta charset='utf-8'/>
|
|
834
|
-
<base target='_blank'>
|
|
835
|
-
</head>
|
|
836
|
-
<body>${e}</body>
|
|
837
|
-
</html>`,className:"h-full w-full border-0"})]})}function Tde({value:e,onChange:t}){return a.jsx(k2,{value:e,onValueChange:n=>{t(n)},children:a.jsxs(L2,{children:[a.jsx(ah,{value:"markdown",children:"Markdown"}),a.jsx(ah,{value:"preview",children:"Preview"})]})})}function _de({markdown:e,enabled:t=!0,debounceMs:n=300,toHtml:r}){const[s,i]=h.useState(""),[c,u]=h.useState(!1),[f,m]=h.useState(null),y=h.useRef(null);return h.useEffect(()=>{var C;if(!t)return;const g=e;if(!g.trim()){i(""),m(null),u(!1);return}const x=new AbortController;(C=y.current)==null||C.abort(),y.current=x,u(!0),m(null);const v=setTimeout(()=>{r(g,x.signal).then(b=>{i(b)}).catch(b=>{if(x.signal.aborted)return;const w=b instanceof Error?b.message:"Failed to load preview";m(w)}).finally(()=>{x.signal.aborted||u(!1)})},n);return()=>{clearTimeout(v),x.abort()}},[e,t,n,r]),{html:s,loading:c,error:f}}function Nde(e,t){return Ea.post("/markdown/parse-to-html",{markdown:e},{headers:{"Content-Type":"application/json"},responseType:"text",signal:t}).then(n=>n.data)}function MM(e){const t=h.useCallback(Nde,[]);return _de({...e,toHtml:t})}const Ade={list:[],listLoadingStatus:Et.IDLE,activeInsight:null,activeInsightLoadingStatus:Et.IDLE,executionStatus:Et.IDLE,executionTriggerId:null,error:null};var ft=(e=>(e.FETCH_INSIGHTS_START="FETCH_INSIGHTS_START",e.FETCH_INSIGHTS_SUCCESS="FETCH_INSIGHTS_SUCCESS",e.FETCH_INSIGHTS_ERROR="FETCH_INSIGHTS_ERROR",e.GET_INSIGHT_START="GET_INSIGHT_START",e.GET_INSIGHT_SUCCESS="GET_INSIGHT_SUCCESS",e.GET_INSIGHT_ERROR="GET_INSIGHT_ERROR",e.CREATE_INSIGHT_START="CREATE_INSIGHT_START",e.CREATE_INSIGHT_SUCCESS="CREATE_INSIGHT_SUCCESS",e.CREATE_INSIGHT_ERROR="CREATE_INSIGHT_ERROR",e.UPDATE_INSIGHT_START="UPDATE_INSIGHT_START",e.UPDATE_INSIGHT_SUCCESS="UPDATE_INSIGHT_SUCCESS",e.UPDATE_INSIGHT_ERROR="UPDATE_INSIGHT_ERROR",e.DELETE_INSIGHT_START="DELETE_INSIGHT_START",e.DELETE_INSIGHT_SUCCESS="DELETE_INSIGHT_SUCCESS",e.DELETE_INSIGHT_ERROR="DELETE_INSIGHT_ERROR",e.RUN_INSIGHT_START="RUN_INSIGHT_START",e.RUN_INSIGHT_START_ERROR="RUN_INSIGHT_START_ERROR",e.RUN_INSIGHT_STARTED="RUN_INSIGHT_STARTED",e.RUN_INSIGHT_SUCCESS="RUN_INSIGHT_SUCCESS",e.RUN_INSIGHT_ERROR="RUN_INSIGHT_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(ft||{});class Dde extends bl{constructor(){super("/data-marts")}async getInsights(t){return this.get(`/${t}/insights`)}async getInsightById(t,n){return await this.get(`/${t}/insights/${n}`)}async createInsight(t,n){return this.post(`/${t}/insights`,n)}async updateInsight(t,n,r){return this.put(`/${t}/insights/${n}`,r)}async updateInsightTitle(t,n,r){return this.put(`/${t}/insights/${n}/title`,r)}async deleteInsight(t,n){return this.delete(`/${t}/insights/${n}`)}async startInsightExecution(t,n){return this.post(`/${t}/insights/${n}/run-triggers`,{})}async checkInsightExecutionStatus(t,n,r,s){return this.get(`/${t}/insights/${r}/run-triggers/${n}/status`,null,s)}async getInsightRunTriggers(t,n,r){return this.get(`/${t}/insights/${n}/run-triggers/`,null,r)}}const oo=new Dde,Iu=e=>({id:e.id,title:e.title,template:e.template??null,output:e.output??null,outputUpdatedAt:e.outputUpdatedAt?new Date(e.outputUpdatedAt):null,lastRun:e.lastManualDataMartRun?{status:e.lastManualDataMartRun.status,id:e.lastManualDataMartRun.id}:null,createdById:e.createdById,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}),Ode=e=>e.data.map(Iu),Ide=e=>({title:e.title,template:e.template??null}),Mde=e=>({title:e.title,template:e.template??null}),kM=h.createContext(void 0);function LM(){const e=h.useContext(kM);if(!e)throw new Error("useInsightsContext must be used within InsightsProvider");return e}function nx(){const{state:e,dispatch:t}=LM(),{dataMart:n}=ws();if(!n)throw new Error("useInsights must be used within a DataMart context");const r=h.useCallback(async()=>{t({type:ft.FETCH_INSIGHTS_START});try{const C=await oo.getInsights(n.id),b=Ode(C);t({type:ft.FETCH_INSIGHTS_SUCCESS,payload:b})}catch(C){throw t({type:ft.FETCH_INSIGHTS_ERROR,payload:dn(C)}),C}},[n.id,t]),s=h.useCallback(async C=>{t({type:ft.GET_INSIGHT_START});try{const b=await oo.getInsightById(n.id,C),w=Iu(b);return t({type:ft.GET_INSIGHT_SUCCESS,payload:w}),w}catch(b){throw t({type:ft.GET_INSIGHT_ERROR,payload:dn(b)}),b}},[n.id,t]),i=h.useCallback(async C=>{const b=await oo.getInsightById(n.id,C);return Iu(b)},[n.id]),c=h.useCallback(async C=>{t({type:ft.CREATE_INSIGHT_START});try{const b=Ide(C),w=await oo.createInsight(n.id,b),R=Iu(w);return t({type:ft.CREATE_INSIGHT_SUCCESS,payload:R}),De({event:"insight_created",category:"Insights",action:"Create",label:R.id,details:R.title,context:n.id,value:n.title}),_t.success("Insight created"),R}catch(b){const w=dn(b);return t({type:ft.CREATE_INSIGHT_ERROR,payload:w}),De({event:"insight_error",category:"Insights",action:"CreateError",label:C.title,context:n.id,error:w.message}),null}},[n.id,n.title,t]),u=h.useCallback(async(C,b)=>{t({type:ft.UPDATE_INSIGHT_START});try{const w=Mde(b),R=await oo.updateInsight(n.id,C,w),j=Iu(R);return t({type:ft.UPDATE_INSIGHT_SUCCESS,payload:j}),De({event:"insight_updated",category:"Insights",action:"Update",label:j.id,context:n.id,details:j.title}),_t.success("Insight updated"),j}catch(w){return t({type:ft.UPDATE_INSIGHT_ERROR,payload:dn(w)}),null}},[n.id,t]),f=h.useCallback(async C=>{t({type:ft.DELETE_INSIGHT_START});try{await oo.deleteInsight(n.id,C),t({type:ft.DELETE_INSIGHT_SUCCESS,payload:C}),De({event:"insight_deleted",category:"Insights",action:"Delete",label:C}),_t.success("Insight deleted")}catch(b){throw t({type:ft.DELETE_INSIGHT_ERROR,payload:dn(b)}),b}},[n.id,t]),m=h.useCallback(async(C,b)=>{t({type:ft.UPDATE_INSIGHT_START});try{const w=await oo.updateInsightTitle(n.id,C,{title:b}),R=Iu(w),j=e.list.find(D=>D.id===C)??e.activeInsight,_=j?{...R,template:j.template}:R;return t({type:ft.UPDATE_INSIGHT_SUCCESS,payload:_}),De({event:"insight_title_updated",category:"Insights",action:"Update title",label:_.id,context:n.id,details:_.title}),_t.success("Title updated"),_}catch(w){return t({type:ft.UPDATE_INSIGHT_ERROR,payload:dn(w)}),null}},[n.id,t,e.activeInsight,e.list]),y=h.useCallback(async C=>{t({type:ft.RUN_INSIGHT_START});try{const b=await oo.startInsightExecution(n.id,C);t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:b.triggerId}}),De({event:"insight_run",category:"Insights",action:"Run",label:C})}catch(b){t({type:ft.RUN_INSIGHT_ERROR,payload:dn(b)})}},[t,n.id]),g=h.useCallback(()=>{t({type:ft.RUN_INSIGHT_SUCCESS,payload:{triggerId:""}})},[t]),x=h.useCallback(C=>{t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:C}})},[t]),v=h.useCallback(async()=>{const C=e.activeInsight;if(!(!C||!n.id)&&!e.executionTriggerId&&!(!C.lastRun||DJ(C.lastRun.status)))try{const w=(await oo.getInsightRunTriggers(n.id,C.id,{skipLoadingIndicator:!0})).data.sort((R,j)=>new Date(j.modifiedAt).getTime()-new Date(R.modifiedAt).getTime()).find(R=>!OJ(R.status));w!=null&&w.id&&(t({type:ft.RUN_INSIGHT_START}),t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:w.id}}))}catch(b){t({type:ft.RUN_INSIGHT_ERROR,payload:dn(b)})}},[e.activeInsight,e.executionTriggerId,n.id,t]);return{insights:e.list,activeInsight:e.activeInsight,listLoading:e.listLoadingStatus===Et.LOADING,insightLoading:e.activeInsightLoadingStatus===Et.LOADING,isRunning:e.executionStatus===Et.LOADING,triggerId:e.executionTriggerId,error:e.error,fetchInsights:r,getInsight:s,getInsightSilently:i,createInsight:c,updateInsight:u,updateInsightTitle:m,deleteInsight:f,runInsight:y,setTriggerId:x,resetTriggerId:g,ensureActiveRunPolling:v}}function PM(){const{state:e}=LM(),t=h.useMemo(()=>e.list,[e.list]),n=h.useMemo(()=>e.listLoadingStatus===Et.LOADING,[e.listLoadingStatus]),r=h.useMemo(()=>e.listLoadingStatus===Et.LOADED||e.listLoadingStatus===Et.ERROR,[e.listLoadingStatus]),s=h.useMemo(()=>e.error,[e.error]),i=h.useMemo(()=>t.length>0,[t.length]);return{insights:t,isLoading:n,isLoaded:r,error:s,hasInsights:i}}function kde(e,t){var n,r;switch(t.type){case ft.FETCH_INSIGHTS_START:return{...e,listLoadingStatus:Et.LOADING,error:null};case ft.GET_INSIGHT_START:return{...e,activeInsightLoadingStatus:Et.LOADING,error:null};case ft.CREATE_INSIGHT_START:return{...e,activeInsightLoadingStatus:Et.LOADING,error:null};case ft.UPDATE_INSIGHT_START:return{...e,error:null};case ft.DELETE_INSIGHT_START:return{...e,listLoadingStatus:Et.LOADING,error:null};case ft.FETCH_INSIGHTS_SUCCESS:return{...e,list:t.payload,listLoadingStatus:Et.LOADED,error:null};case ft.GET_INSIGHT_SUCCESS:return{...e,activeInsight:t.payload,activeInsightLoadingStatus:Et.LOADED,error:null};case ft.CREATE_INSIGHT_SUCCESS:return{...e,list:[...e.list,t.payload],listLoadingStatus:Et.LOADED,activeInsightLoadingStatus:Et.LOADED,error:null};case ft.UPDATE_INSIGHT_SUCCESS:return{...e,list:e.list.map(s=>s.id===t.payload.id?t.payload:s),activeInsight:((n=e.activeInsight)==null?void 0:n.id)===t.payload.id?t.payload:e.activeInsight,listLoadingStatus:Et.LOADED,error:null};case ft.DELETE_INSIGHT_SUCCESS:return{...e,list:e.list.filter(s=>s.id!==t.payload),activeInsight:((r=e.activeInsight)==null?void 0:r.id)===t.payload?null:e.activeInsight,listLoadingStatus:Et.LOADED,error:null};case ft.FETCH_INSIGHTS_ERROR:return{...e,listLoadingStatus:Et.ERROR,error:t.payload};case ft.GET_INSIGHT_ERROR:return{...e,activeInsightLoadingStatus:Et.ERROR,error:t.payload};case ft.CREATE_INSIGHT_ERROR:return{...e,listLoadingStatus:Et.ERROR,activeInsightLoadingStatus:Et.ERROR,error:t.payload};case ft.UPDATE_INSIGHT_ERROR:case ft.DELETE_INSIGHT_ERROR:return{...e,listLoadingStatus:Et.ERROR,error:t.payload};case ft.RUN_INSIGHT_START:return{...e,executionStatus:Et.LOADING,error:null};case ft.RUN_INSIGHT_STARTED:return{...e,executionTriggerId:t.payload.triggerId,error:null};case ft.RUN_INSIGHT_SUCCESS:return{...e,executionStatus:Et.LOADED,executionTriggerId:null,error:null};case ft.CLEAR_ERROR:return{...e,error:null};default:return e}}function DC({children:e,initialState:t}){const[n,r]=h.useReducer(kde,t??Ade);return a.jsx(kM.Provider,{value:{state:n,dispatch:r},children:e})}const Lde=[{label:"New prompt",insertText:`{{#prompt}}
|
|
838
|
-
$0
|
|
839
|
-
{{/prompt}}`,documentation:"Insert a {{#prompt}} template for generative queries"}],S1=new WeakMap,C1=new WeakMap,kN="insight.copyTemplate";let Qp=null;function LN(e){Qp=e}function Pde(e,t){const n=S1.get(e)??new Set;if(S1.has(e)||S1.set(e,n),n.has(t))return;e.editor.registerCommand(kN,()=>{Qp==null||Qp()});const r=e.languages.registerCompletionItemProvider(t,{triggerCharacters:["/"],provideCompletionItems:(i,c)=>{const u=c.lineNumber,f=c.column,m=i.getValueInRange({startLineNumber:u,startColumn:1,endLineNumber:u,endColumn:f}),y=m.lastIndexOf("/");if(y!==-1){const g=m.substring(y+1),x={startLineNumber:u,endLineNumber:u,startColumn:y+2,endColumn:f},v={range:{startLineNumber:u,endLineNumber:u,startColumn:y+1,endColumn:y+2},text:""},C=[];return Lde.forEach((b,w)=>{b.label.startsWith(g)&&C.push({label:b.label,insertText:b.insertText,documentation:{value:b.documentation,isTrusted:!0},detail:b.documentation,kind:e.languages.CompletionItemKind.Field,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:x,additionalTextEdits:[v],sortText:`${String(w)}_${b.label}`})}),C.push({label:"Copy template…",kind:e.languages.CompletionItemKind.Reference,detail:"Copy template from an existing Insight",insertText:"",range:x,additionalTextEdits:[v],command:{id:kN,title:"Copy template…"},sortText:"999_copy_template"}),{suggestions:C}}return{suggestions:[]}}}),s=C1.get(e)??new Map;C1.has(e)||C1.set(e,s),s.set(t,r),n.add(t)}function Vb({value:e,onChange:t,height:n="60vh",className:r,readOnly:s,showLineNumbers:i=!0,excludeInsightId:c}){const{resolvedTheme:u}=Ph(),f=h.useRef(null),m=h.useRef(null),y=h.useRef(null),[g,x]=h.useState(!1),[v,C]=h.useState({top:0,left:0}),[b,w]=h.useState(320),[R,j]=h.useState(""),_=h.useRef(null),{insights:D,isLoading:O}=PM(),{fetchInsights:A,getInsightSilently:T}=nx(),I=()=>{const U=m.current,K=y.current;if(!U||!K)return;const G=U.getLayoutInfo(),q=G.contentLeft,H=G.contentWidth,M=8,B=288,$=16,re=q+(H-B)/2,ge=q+M,P=q+Math.max(0,H-B-M),z=Math.min(Math.max(re,ge),P);C({top:M,left:z});const F=G.height,Z=Math.max(120,F-$);w(Z),x(!0),De({event:"insight_editor_open_copy_template_menu",category:"InsightEditor",action:"OpenMenu"})},k=async U=>{const K=m.current;if(!K||!K.getModel())return;const q=K.getPosition();if(!q)return;const H={startLineNumber:q.lineNumber,startColumn:q.column,endLineNumber:q.lineNumber,endColumn:q.column};let M=U.template??"";if(!M||M.length===0)try{const $=await T(U.id);if(M=($==null?void 0:$.template)??"",M.length===0){_n.error("Insight template is empty"),x(!1);return}}catch{console.error("[InsightEditor] Failed to fetch insight template - skipping")}const B=M.concat(`
|
|
840
|
-
|
|
841
|
-
<!-- Copied from Insight: ${U.title} (${U.id}) -->
|
|
842
|
-
`);K.executeEdits("insight-editor",[{range:H,text:B,forceMoveMarkers:!0}]),De({event:"insight_editor_copy_template",category:"InsightEditor",action:"CopyTemplate",label:U.title,details:U.id}),K.focus(),x(!1)},V=(U,K)=>{m.current=U,y.current=K,Pde(K,"markdown");const G=()=>{LN(()=>{O||A(),j(""),I()})};G();const q=U.onDidFocusEditorText(()=>{G()}),H=U.onDidScrollChange(()=>{x(!1)}),M=U.onMouseDown(()=>{x(!1)}),B="insight-editor-inline-placeholder",$=document.createElement("div");$.textContent="Press '/' for commands";const re=()=>{try{const Ee=U.getOption(K.editor.EditorOption.fontInfo),Ke=`${String(Ee.fontSize)}px`,nt=`${String(Ee.lineHeight)}px`,Ft=Ee.fontFamily;Object.assign($.style,{color:"inherit",opacity:"0.55",fontStyle:"italic",fontSize:Ke,lineHeight:nt,fontFamily:Ft,pointerEvents:"none",whiteSpace:"pre",userSelect:"none"})}catch{Object.assign($.style,{color:"inherit",opacity:"0.55",fontStyle:"italic",pointerEvents:"none",whiteSpace:"pre",userSelect:"none"})}};re();let ge=null,P=null;const z={getId:()=>B,getDomNode:()=>$,getPosition:()=>ge};U.addContentWidget(z);const F=Ee=>{ge={position:{lineNumber:Ee,column:1},preference:[K.editor.ContentWidgetPositionPreference.EXACT]},$.style.display="",U.layoutContentWidget(z)},Z=()=>{ge=null,$.style.display="none",U.layoutContentWidget(z)},Q=()=>{const Ee=U.getModel(),Ke=U.getPosition()??P;if(!Ee||!Ke){Z();return}const nt=Ee.getLineCount(),Ft=Math.min(Math.max(1,Ke.lineNumber),Math.max(1,nt));Ee.getLineContent(Ft).trim().length===0?F(Ft):Z()};Q();const le=U.onDidChangeCursorPosition(()=>{const Ee=U.getPosition();Ee&&(P=Ee),Q()}),J=U.onDidChangeModelContent(()=>{Q()}),ie=U.onDidChangeModel(()=>{Q()}),ye=U.onDidBlurEditorText(()=>{Q()}),Ce=U.onDidFocusEditorText(()=>{const Ee=U.getPosition();Ee&&(P=Ee),Q()}),He=U.onDidChangeConfiguration(()=>{re(),Q()});_.current={scroll:H,mouse:M,layout:q,cursor:le,content:J,model:ie,blur:ye,focusText:Ce,config:He,placeholderWidget:{dispose:()=>{try{U.removeContentWidget(z)}catch{}}}}};return h.useEffect(()=>()=>{var K,G,q,H,M,B,$,re,ge,P;LN(null);const U=_.current;if(U){try{(K=U.scroll)==null||K.dispose(),(G=U.mouse)==null||G.dispose(),(q=U.layout)==null||q.dispose(),(H=U.cursor)==null||H.dispose(),(M=U.content)==null||M.dispose(),(B=U.model)==null||B.dispose(),($=U.blur)==null||$.dispose(),(re=U.focusText)==null||re.dispose(),(ge=U.config)==null||ge.dispose(),(P=U.placeholderWidget)==null||P.dispose()}catch{}_.current=null}},[]),h.useEffect(()=>{if(!g)return;const U=G=>{const q=G.target,H=f.current;H&&q&&!H.contains(q)&&x(!1)},K=G=>{var q;G.key==="Escape"&&(G.preventDefault(),G.stopPropagation(),x(!1),j(""),(q=m.current)==null||q.focus())};return document.addEventListener("mousedown",U),document.addEventListener("keydown",K,!0),()=>{document.removeEventListener("mousedown",U),document.removeEventListener("keydown",K,!0)}},[g]),a.jsxs("div",{ref:f,className:r,style:{position:"relative"},children:[a.jsx(iI,{height:n,language:"markdown",theme:u==="dark"?"vs-dark":"light",className:"overflow-hidden rounded-tl-md",value:e,onChange:U=>{t(U??"")},onMount:V,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",overviewRulerBorder:!1,automaticLayout:!0,overviewRulerLanes:0,readOnly:!!s,lineNumbers:i?"on":"off"}}),g&&a.jsx("div",{style:{position:"absolute",top:v.top,left:v.left,zIndex:60},onMouseDown:U=>{U.stopPropagation()},children:a.jsx("div",{className:"bg-popover text-popover-foreground flex w-72 flex-col rounded-md border shadow-md outline-none",style:{maxHeight:b},children:a.jsxs(Y2,{className:"flex min-h-0 flex-col",children:[a.jsx(W2,{autoFocus:!0,placeholder:"Search insights…",value:R,onValueChange:j}),a.jsxs(gI,{className:"flex-1 overflow-auto",children:[O&&a.jsx("div",{className:"p-2 text-sm opacity-60",children:"Loading…"}),!O&&D.filter(U=>c?U.id!==c:!0).filter(U=>(R||"").length?U.title.toLowerCase().includes(R.toLowerCase()):!0).map(U=>a.jsx(X2,{value:`${U.id}:${U.title}`,onSelect:()=>{k(U)},children:a.jsx("span",{className:"block w-full truncate whitespace-nowrap",children:U.title})},U.id)),!O&&D.filter(U=>c?U.id!==c:!0).length===0&&a.jsxs("div",{className:"flex items-start gap-2 p-2 text-sm opacity-60",children:[a.jsx(VU,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:"No insights yet. Create them on the Insights tab, then you can copy their templates into the email report."})]})]})]})})})]})}function Ude(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"message-details",children:[a.jsx(Yt,{children:"How can I format my message?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"You can format your message using Markdown — a simple text formatting syntax that lets you add structure and style without using complex editors."}),a.jsxs("p",{className:"mb-2",children:["For example:",a.jsx("br",{}),"**bold text** → ",a.jsx("b",{children:"bold text"}),a.jsx("br",{}),"*italic text* → ",a.jsx("i",{children:"italic text"}),a.jsx("br",{}),"- list item → • list item"]}),a.jsxs("p",{children:["Use the Preview tab to see how your message will look after formatting.",a.jsx("br",{}),"If you’re new to Markdown, learn more from this"," ",a.jsx(gn,{className:"underline",href:"https://www.markdownguide.org/basic-syntax/",children:"quick guide"})]})]})]})})}function zde(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"sending-condition-details",children:[a.jsx(Yt,{children:"What are Data Mart Run results?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"A Data Mart Run result is the outcome of processing your Data Mart — for example, running an SQL query that retrieves data for your report."}),a.jsx("p",{children:"Before sending a report, OWOX automatically runs the Data Mart and checks its result. Depending on your settings, the report can be sent always, only if the result is not empty, or only if it’s empty."})]})]})})}function Fde(){return a.jsxs(Zt,{value:"sheets-api-details",children:[a.jsx(Yt,{children:"How do I enable the Google Sheets API?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",a.jsx(gn,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),a.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),a.jsxs("li",{children:["If the API isn't enabled yet, click ",a.jsx("strong",{children:"Enable"}),"."]}),a.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})}function Hde(){return a.jsxs(Zt,{value:"looker-studio-details",children:[a.jsx(Yt,{children:"How do I connect to Looker Studio?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Looker Studio, you need to provide a deployment URL that the"," ",a.jsx(gn,{className:"p-0",href:"https://datastudio.google.com/datasources/create?connectorId=AKfycbz6kcYn3qGuG0jVNFjcDnkXvVDiz4hewKdAFjOm-_d4VkKVcBidPjqZO991AvGL3FtM4A",children:"Looker Studio connector"})," ","will use to access your data."]}),a.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),a.jsx(gn,{className:"p-0",href:"https://docs.owox.com/docs/destinations/supported-destinations/looker-studio/?utm_source=owox_data_marts&utm_medium=destination_enity&utm_campaign=tooltip",children:"Learn more"})]})]})}function $de(){return a.jsxs(Zt,{value:"odata-details",children:[a.jsx(Yt,{children:"How do I use OData?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs."}),a.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]})}function Vde(){return a.jsxs(Zt,{value:"email-details",children:[a.jsx(Yt,{children:"How do I start sending Email?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports by email, first configure the ",a.jsx("strong",{children:"Email"})," destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Email block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected addresses as formatted text."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/email/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-email",children:"OWOX documentation"}),"."]})]})]})}function Gde(){return a.jsxs(Zt,{value:"slack-details",children:[a.jsx(Yt,{children:"How do I start sending to Slack?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Slack, first configure the ",a.jsx("strong",{children:"Slack"})," destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Slack block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/slack/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-slack",children:"OWOX documentation"}),"."]})]})]})}function Bde(){return a.jsxs(Zt,{value:"msteams-details",children:[a.jsx(Yt,{children:"How do I start sending to Microsoft Teams?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Microsoft Teams, first configure the ",a.jsx("strong",{children:"Microsoft Teams"})," ","destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Microsoft Teams block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/microsoft-teams/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-microsoft-teams",children:"OWOX documentation"}),"."]})]})]})}function qde(){return a.jsxs(Zt,{value:"googlechat-details",children:[a.jsx(Yt,{children:"How do I start sending to Google Chat?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Google Chat, first configure the ",a.jsx("strong",{children:"Google Chat"})," ","destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Google Chat block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the connected space as chat messages."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/google-chat/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-google-chat",children:"OWOX documentation"}),"."]})]})]})}const Kde={[Oe.GOOGLE_SHEETS]:Fde,[Oe.LOOKER_STUDIO]:Hde,[Oe.ODATA]:$de,[Oe.EMAIL]:Vde,[Oe.SLACK]:Gde,[Oe.MS_TEAMS]:Bde,[Oe.GOOGLE_CHAT]:qde};function Zde({destinationType:e}){const t=Kde[e];return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsx(t,{})})}function Yde({form:e,isEditMode:t,allowedDestinationTypes:n}){const{flags:r}=md();return a.jsx(Nt,{control:e.control,name:"type",render:({field:s})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select the destination to send your data",children:"Destination Type"}),a.jsxs(ua,{onValueChange:s.onChange,defaultValue:s.value,disabled:!!t,children:[a.jsx(jt,{children:a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a destination type"})})}),a.jsx(ha,{children:a.jsx($y,{children:aa.getAllTypes().filter(({type:i})=>n&&n.length>0?n.includes(i):!0).map(({type:i,displayName:c,icon:u,status:f})=>{const m=f===As.COMING_SOON,y=f===As.CLOUD_ONLY&&dJ(r);return a.jsx(a.Fragment,{children:y?a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("div",{children:a.jsx(Bn,{value:i,disabled:!0,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(u,{size:18}),c,a.jsx(Nr,{variant:"secondary",children:"Cloud & Enterprise"})]})},i)})}),a.jsxs(St,{side:"left",align:"start",className:"w-[220px]",children:["Available only in"," ",a.jsxs(Wr,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/owox-cloud-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["Cloud edition",a.jsx(si,{className:"h-3 w-3"})]})," ","or with"," ",a.jsxs(Wr,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/self-managed-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["an Enterprise plan",a.jsx(si,{className:"h-3 w-3"})]}),"."]})]}):a.jsx(Bn,{value:i,disabled:m,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(u,{size:18}),c,m&&a.jsx(Nr,{variant:"outline",children:f})]})},i)})})})})]}),a.jsx(xn,{children:a.jsx(Zde,{destinationType:s.value})}),a.jsx(Mt,{})]})})}const UM="credentials.to",Wde=/[,;\n]/,Xde=", ",zM="Enter emails separated by comma, semicolon or newline",Qde="Emails list";function PN(e){const t=new Set,n=[];for(const r of e.split(Wde)){const s=r.trim();if(!s)continue;const i=s.toLowerCase();t.has(i)||(t.add(i),n.push(s))}return n}function w1(e){return e.join(Xde)}function UN(e,t){e.setValue(UM,t,{shouldDirty:!0,shouldTouch:!0})}function Jde({field:e,form:t}){const n=Array.isArray(e.value)?w1(e.value):"",[r,s]=h.useState(n),[i,c]=h.useState(!1),u=Array.isArray(e.value)?w1(e.value):"";h.useEffect(()=>{i||s(u)},[u,i]);const f=g=>{const x=g.target.value;s(x),UN(t,PN(x))},m=()=>{c(!0)},y=g=>{c(!1),e.onBlur();const x=PN(g.target.value);UN(t,x),s(w1(x))};return a.jsx(jo,{name:e.name,ref:e.ref,onFocus:m,onBlur:y,value:r,onChange:f,className:"min-h-[150px] font-mono",rows:8,placeholder:zM})}function Pp({form:e,emailsFieldTitle:t=Qde}){return a.jsx(Nt,{control:e.control,name:UM,render:({field:n})=>a.jsxs(xt,{children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx(yt,{tooltip:zM,children:t})}),a.jsx(jt,{children:a.jsx(Jde,{field:n,form:e})}),a.jsx(Mt,{})]})})}function efe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"service-account-details",children:[a.jsx(Yt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),a.jsx("p",{className:"mb-2",children:"Here's what to do:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Go to"," ",a.jsx(gn,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),a.jsxs("li",{children:["Open ",a.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),a.jsx("li",{children:"Create a new service account or select an existing one."}),a.jsxs("li",{children:["Open the Service Accounts page, go to the ",a.jsx("strong",{children:"Keys"})," tab, click"," ",a.jsx("strong",{children:"Add key"}),", and select ",a.jsx("strong",{children:"Create new key"}),"."]}),a.jsxs("li",{children:["Choose ",a.jsx("strong",{children:"JSON"})," format and click ",a.jsx("strong",{children:"Create"}),"."]}),a.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function tfe({form:e}){const[t,n]=h.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},i=e.watch("credentials.serviceAccount"),c=i?N5(i):null;return a.jsx(Nt,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(yt,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&i&&a.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(jt,{children:!t&&c?a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx(gn,{href:c.url,children:c.email})}),a.jsx(St,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(jo,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(xn,{children:a.jsx(efe,{})}),a.jsx(Mt,{})]})})}function OC(e){return"destinationSecretKey"in e}function nfe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"json-config-details",children:[a.jsx(Yt,{children:"What is the JSON Config for Looker Studio?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),a.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[a.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),a.jsx("li",{children:"If you need to rotate a previous secret key, you can use the corresponding function in the menu on the destinations list."})]})]})]})})}function rfe({form:e}){const t=e.getValues("credentials"),n=h.useMemo(()=>t&&OC(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=h.useMemo(()=>r2(n),[n]);return a.jsx(a.Fragment,{children:n.destinationSecretKey&&a.jsx(Nt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>a.jsxs(xt,{children:[a.jsx(yt,{children:"JSON Config"}),a.jsx(jt,{children:a.jsx(LD,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),a.jsx(Mt,{}),a.jsx(xn,{children:a.jsx(nfe,{})})]})})})}function afe({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r,isEditMode:s,allowedDestinationTypes:i}){const c=To({resolver:xi(YQ),defaultValues:e??{title:"New Destination",type:Oe.GOOGLE_SHEETS},mode:"onTouched"}),u=c.watch("type");h.useEffect(()=>{r==null||r(c.formState.isDirty)},[c.formState.isDirty,r]);const f=async m=>{const{dirtyFields:y}=c.formState,g=_5(m);return y.credentials||delete g.credentials,t(g)};return a.jsx(_l,{...c,children:a.jsxs(yi,{onSubmit:m=>{c.handleSubmit(f)(m)},children:[a.jsxs(Nl,{children:[a.jsx(Nt,{control:c.control,name:"title",render:({field:m})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),a.jsx(jt,{children:a.jsx(It,{placeholder:"Enter title",...m})}),a.jsx(Mt,{})]})}),a.jsx(Yde,{form:c,isEditMode:s,allowedDestinationTypes:i}),u===Oe.GOOGLE_SHEETS&&a.jsx(tfe,{form:c}),u===Oe.LOOKER_STUDIO&&a.jsx(rfe,{form:c}),u===Oe.EMAIL&&a.jsx(Pp,{form:c,emailsFieldTitle:"Enter user emails list"}),u===Oe.SLACK&&a.jsx(Pp,{form:c,emailsFieldTitle:"Enter Slack channel emails list"}),u===Oe.MS_TEAMS&&a.jsx(Pp,{form:c,emailsFieldTitle:"Enter Microsoft Teams channel emails list"}),u===Oe.GOOGLE_CHAT&&a.jsx(Pp,{form:c,emailsFieldTitle:"Enter Google Chat channel emails list"})]}),a.jsxs(Mc,{children:[a.jsxs(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!c.formState.isDirty||c.formState.isSubmitting,children:[c.formState.isSubmitting&&a.jsx(Rc,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),a.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function FM({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r,initialFormData:s,allowedDestinationTypes:i}){const{updateDataDestination:c,createDataDestination:u}=Fh(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:y,confirmClose:g,handleFormDirtyChange:x,handleFormSubmitSuccess:v}=kc(t);Ol(e);const C=async w=>{const R=R5.getMapper(w.type);if(n){const j=R.mapToUpdateRequest(w),_=await c(n.id,j);_&&r(_)}else{const j=R.mapToCreateRequest(w),_=await u(j);_&&r(_)}v()},b=h.useRef(!1);return h.useEffect(()=>{const w=n?"Edit":"Create";e&&!b.current?(De({event:"data_destination_config_open",category:"DataDestination",action:w,label:n==null?void 0:n.type}),b.current=!0):!e&&b.current&&(De({event:"data_destination_config_close",category:"DataDestination",action:w,label:n==null?void 0:n.type}),b.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(ui,{open:e,onOpenChange:w=>{w||y()},children:a.jsxs(di,{children:[a.jsxs(fi,{children:[a.jsx(hi,{children:"Configure destination"}),a.jsx(yl,{children:"Customize settings for your destination"})]}),a.jsx(afe,{initialData:n??s??null,onSubmit:C,onCancel:y,onDirtyChange:x,isEditMode:!!n,allowedDestinationTypes:i})]})}),a.jsx(br,{open:f,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const sfe=[Oe.EMAIL,Oe.SLACK,Oe.GOOGLE_CHAT,Oe.MS_TEAMS],HM=h.forwardRef(({initialReport:e,mode:t=Nn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c,prefill:u,allowedDestinationTypes:f},m)=>{const y="email-report-edit-form",{dataMart:g}=ws(),x=h.useRef(null),v=h.useRef(!1),[C,b]=h.useState(!1),{runReport:w}=ts(),{dataDestinations:R,fetchDataDestinations:j,loading:_}=Fh(),[D,O]=h.useState([]),[A,T]=h.useState(!1);h.useEffect(()=>{g&&j()},[g,j]),h.useEffect(()=>{if(R.length>0){const F=f??(c!=null&&c.type?[c.type]:sfe),Z=R.filter(Q=>F.includes(Q.type));O(Z)}},[R,c==null?void 0:c.type,f]);const{isDirty:I,reset:k,form:V,isSubmitting:U,formError:K,onSubmit:G}=Rde({initialReport:e,mode:t,dataMartId:(g==null?void 0:g.id)??"",onAfterSubmit:async F=>{var Z;try{await((Z=x.current)==null?void 0:Z.persist(F.id))}catch(Q){console.error("Failed to persist schedule for report",Q)}if(v.current)try{await w(F.id)}catch(Q){throw console.error("Failed to run report",Q),Q}finally{v.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(K)},[K,r]),h.useEffect(()=>{if(!(t===Nn.EDIT&&e)){if(t===Nn.CREATE){const F=(c==null?void 0:c.id)??"";k({title:(u==null?void 0:u.title)??"",dataDestinationId:F,reportCondition:sc.ALWAYS,subject:(u==null?void 0:u.subject)??"",messageTemplate:(u==null?void 0:u.messageTemplate)??""})}}},[e,t,k,c,u==null?void 0:u.title,u==null?void 0:u.subject,u==null?void 0:u.messageTemplate]),h.useEffect(()=>{n==null||n(I||C)},[I,C,n]);const q=h.useMemo(()=>[{value:sc.ALWAYS,label:"Send always"},{value:sc.RESULT_IS_EMPTY,label:"Send only when result is empty"},{value:sc.RESULT_IS_NOT_EMPTY,label:"Send only when result is not empty"}],[]),[H,M]=h.useState("markdown"),B=V.watch("messageTemplate"),{html:$,loading:re,error:ge}=MM({markdown:B,enabled:H==="preview"}),P=V.watch("dataDestinationId"),z=h.useMemo(()=>P&&D.length>0?D.find(F=>F.id===P)??null:null,[P,D]);return a.jsxs(a.Fragment,{children:[a.jsx(_l,{...V,children:a.jsxs(yi,{id:y,ref:m,noValidate:!0,onSubmit:F=>{V.handleSubmit(G)(F)},children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(Nt,{control:V.control,name:"title",render:({field:F})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(jt,{children:a.jsx(It,{placeholder:"Enter a report title",...F})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:V.control,name:"dataDestinationId",render:({field:F})=>a.jsxs(xt,{children:[a.jsx("div",{className:"flex items-center justify-between gap-2",children:a.jsx(yt,{tooltip:"Select one of your existing destinations",children:"Destination"})}),a.jsxs(ua,{onValueChange:Z=>{if(Z==="__create_new__"){T(!0);return}F.onChange(Z)},value:F.value,disabled:_,children:[a.jsx(jt,{children:a.jsx(fa,{className:"w-full max-w-full overflow-hidden",children:a.jsx(da,{className:"truncate",placeholder:"Select a destination",children:z&&a.jsx(MN,{destination:z})})})}),a.jsxs(ha,{children:[D.map(Z=>a.jsx(Bn,{value:Z.id,children:a.jsx(MN,{destination:Z})},Z.id)),D.length>0&&a.jsx(f6,{}),!c&&a.jsx(Bn,{value:"__create_new__",children:"+ Create new"})]})]}),a.jsx(wde,{destination:z}),a.jsx(Mt,{})]})})]}),a.jsxs(Yr,{title:"Template",children:[a.jsx(Nt,{control:V.control,name:"subject",render:({field:F})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Add a short, clear subject line for your report",children:"Subject"}),a.jsx(jt,{children:a.jsx(It,{placeholder:"Enter a message title",...F})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:V.control,name:"messageTemplate",render:({field:F})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(yt,{tooltip:"Write your report message in Markdown and check the final format in Preview",children:"Message"}),a.jsx(Tde,{value:H,onChange:M})]}),a.jsx(jt,{children:a.jsx("div",{className:"overflow-hidden rounded-md border",children:H==="markdown"?a.jsx(DC,{children:a.jsx(Vb,{value:F.value,onChange:Z=>{F.onChange(Z)},height:240,showLineNumbers:!1})}):a.jsx(IM,{html:$,loading:re,error:ge,height:240})})}),a.jsx(xn,{children:a.jsx(Ude,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Yr,{title:"Sending conditions",children:a.jsx(Nt,{control:V.control,name:"reportCondition",render:({field:F})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Define when the report should be sent based on your Data Mart’s execution result",children:"Data Mart Run results"}),a.jsxs(ua,{onValueChange:F.onChange,value:F.value,children:[a.jsx(jt,{children:a.jsx(fa,{className:"w-full max-w-full overflow-hidden",children:a.jsx(da,{})})}),a.jsx(ha,{children:q.map(Z=>a.jsx(Bn,{value:Z.value,children:Z.label},Z.value))})]}),a.jsx(xn,{children:a.jsx(zde,{})}),a.jsx(Mt,{})]})})}),a.jsx(Yr,{title:"Automate Report Runs",children:g!=null&&g.id?a.jsx(AC,{ref:x,dataMartId:g.id,reportId:t===Nn.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:b}):a.jsx(cC,{})})]}),a.jsx(OM,{mode:t,isSubmitting:U,isDirty:I,triggersDirty:C,onRunAndSave:()=>{v.current=!0,V.handleSubmit(G)()},onCancel:i})]})}),a.jsx(FM,{isOpen:A,onClose:()=>{T(!1)},dataDestination:null,initialFormData:{title:"New Destination",type:(f==null?void 0:f[0])??Oe.EMAIL},allowedDestinationTypes:f,onSaveSuccess:F=>{j().then(()=>{V.setValue("dataDestinationId",F.id,{shouldDirty:!0,shouldTouch:!0}),T(!1)})}})]})});HM.displayName="EmailReportEditForm";function $M({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c}){const{projectId:u,id:f}=Wg(),{pathname:m}=Bs(),{showUnsavedDialog:y,setShowUnsavedDialog:g,handleClose:x,confirmClose:v,handleFormDirtyChange:C,handleFormSubmitSuccess:b}=kc(t),w=h.useCallback(()=>{const R=u&&f?`/ui/${u}/data-marts/${f}/reports`:"/";m.includes("/reports")||w_("Report has been created",{closeButton:!0,description:a.jsxs(a.Fragment,{children:["You can view it in"," ",a.jsx(Wr,{to:R,className:"underline underline-offset-4",onClick:()=>w_.dismiss(),children:"Destinations"})," ","page"]}),duration:1/0}),b()},[b,u,f,m]);return Ol(e),a.jsxs(a.Fragment,{children:[a.jsx(ui,{open:e,onOpenChange:R=>{R||x()},children:a.jsxs(di,{children:[a.jsxs(fi,{children:[a.jsx(hi,{children:(s==null?void 0:s.title)??"Report"}),a.jsx(yl,{children:r===Nn.CREATE?"Fill in the details to create a new report":"Update details of an existing report"})]}),a.jsx(zh,{children:a.jsx(HM,{initialReport:n,mode:r,onDirtyChange:C,onSubmit:w,onCancel:x,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c})})]})}),a.jsx(br,{open:y,onOpenChange:g,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:v,variant:"destructive"})]})}function ofe({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case Oe.GOOGLE_SHEETS:return a.jsx(pde,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Oe.LOOKER_STUDIO:return a.jsx(Sde,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Oe.EMAIL:case Oe.SLACK:case Oe.GOOGLE_CHAT:case Oe.MS_TEAMS:return a.jsx($M,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function ife({destination:e,onEditReport:t}){switch(e.type){case Oe.GOOGLE_SHEETS:return a.jsx(Hue,{destination:e,onEditReport:t});case Oe.EMAIL:case Oe.SLACK:case Oe.GOOGLE_CHAT:case Oe.MS_TEAMS:return a.jsx(Bue,{destinationType:e.type,destination:e,onEditReport:t});case Oe.LOOKER_STUDIO:return a.jsx(Jue,{destination:e,onEditReport:t});default:return null}}function VM(){return a.jsx("div",{className:"flex flex-col gap-4",children:a.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>a.jsx("div",{className:"border-border rounded-lg border p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(zr,{className:"h-4 w-4 rounded-full"}),a.jsx(zr,{className:"h-4 w-40"}),a.jsx(zr,{className:"h-3 w-32"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(zr,{className:"h-6 w-16 rounded-full"}),a.jsx(zr,{className:"h-4 w-4"})]})]})},t))})})}function IC({enabled:e,intervalMs:t=5e3,onlyWhenVisible:n=!0,onTick:r}){const s=h.useRef(r);s.current=r;const i=h.useRef(null);h.useEffect(()=>{var f;if(!e)return;(f=i.current)==null||f.abort(),i.current=new AbortController;const c=()=>{if(!n||document.visibilityState==="visible"){const m=new AbortController;s.current(m.signal)}};c();const u=window.setInterval(c,t);return()=>{var m;window.clearInterval(u),(m=i.current)==null||m.abort()}},[e,t,n])}function lfe({enabled:e=!0,intervalMs:t=5e3}={}){const{dataMart:n}=bs(),{fetchReportsByDataMartId:r}=ts(),s=n==null?void 0:n.id;h.useEffect(()=>{s&&r(s)},[s,r]),IC({enabled:!!s&&e,intervalMs:t,onTick:()=>{s&&r(s,{silent:!0})}})}function cfe(){const{dataMart:e}=bs(),{dataDestinations:t,isLoading:n}=nJ();return lfe({enabled:!0,intervalMs:5e3}),e?a.jsx("div",{className:"flex flex-col gap-4",children:n?a.jsx(VM,{}):t.length===0?a.jsx(ede,{}):t.map(r=>a.jsx(rde,{destination:r,dataMartStatus:e.status},r.id))}):null}function ufe(){return a.jsx(zh,{children:a.jsx(t2,{children:a.jsx(cfe,{})})})}function zN(){return a.jsxs(ul,{children:[a.jsx(xo,{children:a.jsx(yo,{icon:IP,tooltip:"Description of the Data Mart",children:"Description"})}),a.jsx(vo,{children:a.jsx(gae,{})}),a.jsx(ai,{})]})}function dfe(){const{dataMart:e}=ws(),[t,n]=h.useState(!1),r=h.useCallback(()=>{n(!0)},[]),s=h.useCallback(()=>{n(!1)},[]);return a.jsxs(ul,{children:[a.jsxs(xo,{children:[a.jsx(yo,{icon:lS,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),a.jsx(Xh,{children:a.jsxs(we,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),a.jsx(vo,{children:a.jsx(ad,{children:a.jsx(pie,{children:e&&a.jsxs(a.Fragment,{children:[a.jsx(tle,{dataMartId:e.id}),a.jsx(lC,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),a.jsx(ai,{})]})}function ffe(){return a.jsx(DC,{children:a.jsx(rS,{})})}function hfe({status:e}){switch(e){case qn.RUNNING:return a.jsx(Nr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case qn.SUCCESS:return a.jsx(Nr,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case qn.FAILED:return a.jsx(Nr,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case qn.CANCELLED:return a.jsx(Nr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case qn.INTERRUPTED:return a.jsx(Nr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});case qn.PENDING:return a.jsx(Nr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});default:return a.jsx(Nr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}var sa=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(sa||{}),Ds=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(Ds||{});const FN=(e,t,n=!1)=>{var c,u,f,m;const r=e.split(`
|
|
843
|
-
`).filter(y=>y.trim()!=="");if(r.length>=3){const y=r[0],g=r[1],x=r.slice(2).join(`
|
|
844
|
-
`);if(y.includes("T")&&y.includes("Z")){const v=E1(x);return{id:`log-${t.toString()}`,timestamp:Su(y),level:n?sa.ERROR:sa.INFO,message:v.message,metadata:{at:(c=v.metadata)!=null&&c.at?Su(v.metadata.at):Su(y),type:((u=v.metadata)==null?void 0:u.type)??(g!=="unknown"?g:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const y=E1(s[3]);return{id:`log-${t.toString()}`,timestamp:Su(s[1]),level:n?sa.ERROR:s[2],message:y.message,metadata:(f=y.metadata)!=null&&f.at?{...y.metadata,at:Su(y.metadata.at)}:y.metadata}}const i=E1(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?sa.ERROR:sa.INFO,message:i.message,metadata:(m=i.metadata)!=null&&m.at?{...i.metadata,at:Su(i.metadata.at)}:i.metadata}},E1=e=>{try{const t=JSON.parse(e);if(typeof t=="object"){const n={},r={...t};"type"in r&&(n.type=r.type,delete r.type),"at"in r&&(n.at=r.at,delete r.at);const s=Object.keys(r);if(s.length===1){const i=s[0],c=r[i];return{message:typeof c=="string"?c:JSON.stringify(c),metadata:Object.keys(n).length>0?n:void 0}}return{message:JSON.stringify(r,null,2),metadata:Object.keys(n).length>0?n:void 0}}}catch{}return{message:e}},GM=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},mfe=(e,t)=>{var i,c;let n="",r="";switch(e.type){case Ur.CONNECTOR:n=t??"",r="connector";break;case Ur.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case Ur.GOOGLE_SHEETS_EXPORT:case Ur.EMAIL:case Ur.SLACK:case Ur.MS_TEAMS:case Ur.GOOGLE_CHAT:n=((i=e.reportDefinition)==null?void 0:i.title)??"",r="report";break;case Ur.INSIGHT:n=((c=e.insightDefinition)==null?void 0:c.title)??"",r="insight";break}return[uJ(`${e.triggerType} ${r} run`.trim()),n]},pfe=e=>{const t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=`datamart-run-${e.id.slice(0,8)}-logs.json`,r.click(),URL.revokeObjectURL(n)},gfe=e=>{const t=e.startedAt??e.createdAt;return Ny(t.toISOString())},yfe=e=>{const t=HN(e.startedAt),n=HN(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=lJ(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},HN=e=>e?Ny(e.toISOString()):"N/A";function xfe({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:i,dataMartId:c}){const u=y=>{y.stopPropagation()},f=async y=>{if(y.stopPropagation(),c)try{await i(c,s.id),_n.success("Data mart run cancelled successfully")}catch(g){_n.error(g instanceof Error?g.message:"Failed to cancel data mart run")}},m=y=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${y?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`;return a.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ds.STRUCTURED)},className:`${m(e===Ds.STRUCTURED)} rounded-l-lg`,children:"Structured"}),a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ds.RAW)},className:`${m(e===Ds.RAW)} rounded-none`,children:"Raw"}),a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ds.CONFIGURATION)},className:`${m(e===Ds.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==Ds.CONFIGURATION&&a.jsxs("div",{className:"relative",children:[a.jsx(jc,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),a.jsx(It,{type:"text",placeholder:"Search logs...",value:n,onChange:y=>{r(y.target.value)},onClick:u,className:"border-input bg-background text-foreground placeholder:text-muted-foreground focus:ring-ring rounded-md border py-2 pr-4 pl-8 text-xs focus:border-transparent focus:ring-2 focus:outline-none"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[s.status===qn.RUNNING&&a.jsxs(we,{variant:"destructive",size:"sm",onClick:y=>void f(y),children:[a.jsx(uc,{className:"h-4 w-4"}),"Cancel"]}),a.jsxs(we,{variant:"outline",size:"sm",onClick:y=>{y.stopPropagation(),pfe(s)},className:"flex items-center gap-2",children:[a.jsx(iU,{className:"h-4 w-4"}),"JSON"]})]})]})}function vfe(e){switch(e){case sa.INFO:return a.jsx(Fr,{className:"h-3 w-3 text-blue-500"});case sa.WARNING:return a.jsx(vh,{className:"h-3 w-3 text-yellow-500"});case sa.ERROR:return a.jsx(ag,{className:"h-3 w-3 text-red-500"});case sa.SYSTEM:return a.jsx(yh,{className:"text-muted-foreground h-3 w-3"});default:return a.jsx(Fr,{className:"text-muted-foreground h-3 w-3"})}}function bfe(e){switch(e){case sa.INFO:return"text-blue-600 dark:text-blue-400";case sa.WARNING:return"text-yellow-600 dark:text-yellow-400";case sa.ERROR:return"text-red-600 dark:text-red-400";case sa.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function Sfe(e){return e===i5.SCHEDULED?a.jsx(lS,{size:18}):a.jsx(HA,{size:18})}function Cfe({logs:e}){const t=r=>{r.stopPropagation()},n=r=>{var s;return(s=r.metadata)!=null&&s.at?r.metadata.at:r.timestamp};return e.length===0?a.jsx("div",{className:"bg-background border-border rounded-lg border",children:a.jsx("div",{className:"text-muted-foreground p-8 text-center text-sm",children:"No logs found"})}):a.jsx("div",{className:"bg-background border-border rounded-lg border",children:a.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((r,s)=>a.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-xs ${s===e.length-1?"border-b-0":""}`,onClick:t,children:[a.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:n(r)}),a.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[vfe(r.level),a.jsx("span",{className:`text-xs font-medium ${bfe(r.level)}`,children:GM(r)})]}),a.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===sa.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
|
|
845
|
-
`)?a.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):a.jsx("span",{children:r.message})})]},r.id))})})}var Hg=(e=>(e.ERROR="error",e.DEFAULT="default",e))(Hg||{});function $g({text:e,section:t,variant:n="default",copiedSection:r,onCopy:s,iconOnly:i=!1}){const c=n==="error",u=r===t,f="flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors cursor-pointer",m=c?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/40":"text-foreground hover:bg-muted";return a.jsx("button",{onClick:y=>{s(e,t),y.stopPropagation()},className:`${f} ${m}`,title:`Copy ${t} to clipboard`,children:i?a.jsx(a.Fragment,{children:u?a.jsx(oa,{className:"h-3 w-3"}):a.jsx(Wu,{className:"h-3 w-3"})}):u?a.jsxs(a.Fragment,{children:[a.jsx(oa,{className:"h-3 w-3"}),"Copied"]}):a.jsxs(a.Fragment,{children:[a.jsx(Wu,{className:"h-3 w-3"}),"Copy"]})})}function rx(){const[e,t]=h.useState(null),n=async(s,i)=>{if(!s)return!1;try{return await navigator.clipboard.writeText(s),t(i),setTimeout(()=>{t(null)},2e3),!0}catch(c){return console.error("Failed to copy text: ",c),!1}};return{copiedSection:e,copyToClipboard:n,handleCopy:(s,i)=>{n(s,i)}}}function wfe({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=rx(),s=i=>{i.stopPropagation()};return a.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:s,children:[t.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[a.jsx(yh,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),a.jsx($g,{text:t.join(`
|
|
846
|
-
`),section:"errors",variant:Hg.ERROR,copiedSection:n,onCopy:r})]}),a.jsx("div",{className:"max-h-96 overflow-y-auto rounded-md bg-red-50 p-3 font-mono text-xs dark:border-red-800 dark:bg-red-950/40",children:t.map((i,c)=>a.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:i},c))})]}),e.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[a.jsx(Fr,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),a.jsx($g,{text:e.join(`
|
|
847
|
-
`),section:"logs",variant:Hg.DEFAULT,copiedSection:n,onCopy:r})]}),a.jsx("div",{className:"bg-muted max-h-96 overflow-y-auto rounded-md p-3 font-mono text-xs dark:bg-white/3",children:e.map((i,c)=>a.jsx("div",{className:"mb-1 leading-relaxed",children:i},c))})]})]})}function Efe({definitionRun:e,reportDefinition:t,insightDefinition:n}){const{copiedSection:r,handleCopy:s}=rx(),i=c=>{c.stopPropagation()};return a.jsx("div",{className:"border-border rounded-lg border",onClick:i,children:e!=null?a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),a.jsx($g,{text:JSON.stringify(e,null,2),section:"configuration",variant:Hg.DEFAULT,copiedSection:r,onCopy:s})]}),a.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(e,null,2)}),t&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Report definition:"}),a.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(t,null,2)})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Insight definition:"}),a.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(n,null,2)})]})]}):a.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}const ao=18;function Rfe({type:e,base64Icon:t}){switch(e){case Ur.CONNECTOR:return t?a.jsx(Ac,{base64:t,size:ao}):a.jsx(cc,{className:"text-muted-foreground",size:ao});case Ur.GOOGLE_SHEETS_EXPORT:{const n=aa.getInfo(Oe.GOOGLE_SHEETS).icon;return a.jsx(n,{size:ao})}case Ur.LOOKER_STUDIO:{const n=aa.getInfo(Oe.LOOKER_STUDIO).icon;return a.jsx(n,{size:ao})}case Ur.EMAIL:{const n=aa.getInfo(Oe.EMAIL).icon;return a.jsx(n,{size:ao})}case Ur.SLACK:{const n=aa.getInfo(Oe.SLACK).icon;return a.jsx(n,{size:ao})}case Ur.MS_TEAMS:{const n=aa.getInfo(Oe.MS_TEAMS).icon;return a.jsx(n,{size:ao})}case Ur.GOOGLE_CHAT:{const n=aa.getInfo(Oe.GOOGLE_CHAT).icon;return a.jsx(n,{size:ao})}case Ur.INSIGHT:return a.jsx(io,{className:"text-brand-blue-500",size:ao});default:return a.jsx(cc,{className:"text-muted-foreground",size:ao})}}function jfe({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,cancelDataMartRun:u,dataMartId:f,dataMartConnectorInfo:m}){const{copiedSection:y,handleCopy:g}=rx(),x=h.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const j=e.logs.map((O,A)=>FN(O,A)),_=e.errors.map((O,A)=>FN(O,e.logs.length+A,!0));return[...j,..._].filter(O=>{const A=GM(O);return i===""||O.message.toLowerCase().includes(i.toLowerCase())||A.toLowerCase().includes(i.toLowerCase())})},[e.logs,e.errors,i]),v=h.useCallback(()=>r===Ds.STRUCTURED?a.jsx(Cfe,{logs:x}):r===Ds.RAW?a.jsx(wfe,{logs:e.logs,errors:e.errors}):a.jsx(Efe,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition,insightDefinition:e.insightDefinition}),[r,x,e.logs,e.errors,e.definitionRun,e.reportDefinition,e.insightDefinition]),C=gfe(e),b=yfe(e),[w,R]=mfe(e,m==null?void 0:m.displayName);return a.jsxs("div",{className:"dm-card-block",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{children:a.jsx(Rfe,{type:e.type,base64Icon:m==null?void 0:m.logoBase64})}),a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("div",{className:"text-foreground align-center mr-12 flex items-center font-mono text-sm font-medium",children:C})}),a.jsx(St,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{children:["Started At: ",b.startedAt]}),a.jsxs("div",{children:["Finished At: ",b.finishedAt]}),b.duration&&a.jsxs("div",{children:["Duration: ",b.duration]})]})})]}),a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[Sfe(e.triggerType),a.jsxs("span",{className:"inline-flex items-center",children:[w,e.createdByUser&&a.jsxs(a.Fragment,{children:[" by ",a.jsx(gO,{userProjection:e.createdByUser})]}),R&&a.jsxs(a.Fragment,{children:[" • ",R]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(hfe,{status:e.status}),a.jsx(_a,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&a.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),a.jsx($g,{text:e.id,section:"run-id",onCopy:g,copiedSection:y,iconOnly:!0})]}),a.jsx(xfe,{logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,run:e,cancelDataMartRun:u,dataMartId:f}),v()]})]})}function Tfe(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:i=[],isLoading:c}=bs(),[u,f]=h.useState(!1),[m,y]=h.useState(!0),[g,x]=h.useState(0),[v,C]=h.useState(null),[b,w]=h.useState(Ds.STRUCTURED),[R,j]=h.useState(""),_=h.useCallback(async()=>{if(!(t!=null&&t.id))return;const T=await n(t.id,20,0);x(T.length),y(T.length===20)},[t==null?void 0:t.id,n,20]),D=h.useCallback(async()=>{if(!(t!=null&&t.id)||u)return;f(!0);const T=await r(t.id,g,20);x(I=>I+T.length),y(T.length===20),f(!1)},[t==null?void 0:t.id,r,g,u,20]);h.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const O=h.useMemo(()=>(t==null?void 0:t.definitionType)===Ve.CONNECTOR&&t.definition&&"connector"in t.definition?t.definition.connector.info??null:null,[t]),A=T=>{C(v===T?null:T)};return c?a.jsx(VM,{}):a.jsx("div",{className:"flex flex-col gap-4 pb-4",children:i.length===0?a.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):a.jsxs("div",{className:"space-y-2",children:[i.map(T=>a.jsx(jfe,{run:T,isExpanded:v===T.id,onToggle:A,logViewType:b,setLogViewType:w,searchTerm:R,setSearchTerm:j,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:O},T.id)),m&&a.jsx("div",{className:"flex justify-center pt-4",children:a.jsx(Gu,{variant:"outline",size:"sm",onClick:()=>void D(),disabled:u,className:"flex items-center gap-2",children:u?a.jsxs(a.Fragment,{children:[a.jsx(bz,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const _fe=5e3,Nfe=20;function Afe(){const{dataMart:e,getDataMartRuns:t}=ws();return IC({enabled:!!(e!=null&&e.id),intervalMs:_fe,onTick:()=>{e!=null&&e.id&&t(e.id,Nfe,0,{silent:!0})}}),a.jsx("div",{className:"flex flex-col gap-4",children:a.jsxs(ul,{collapsible:!1,name:"run-history",children:[a.jsx(xo,{children:a.jsx(yo,{icon:PU,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"})}),a.jsx(vo,{children:a.jsx(Tfe,{})})]})})}function Dfe(){const e=BI(),{navigate:t}=pi(),n=r=>{const s=e?`/data-marts/${r.id}/data-setup?preset=${e.key}`:`/data-marts/${r.id}/data-setup`;t(s)};return a.jsx("div",{className:"flex h-full w-full items-center justify-center",children:a.jsx("div",{className:"m-auto w-lg",children:a.jsxs("div",{className:"bg-muted/50 dark:bg-sidebar rounded-xl border-b border-gray-200 p-12 pt-8 dark:border-gray-700/50",children:[a.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),a.jsx(I2,{children:a.jsx(CO,{children:a.jsx(Sre,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function BM({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:i,clearCurrentDataStorage:c}=Vy();h.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const u=()=>{c(),t()};return a.jsx(g2,{open:e,onOpenChange:f=>{f||u()},children:a.jsxs(y2,{children:[a.jsxs(x2,{children:[a.jsx(v2,{children:"Storage Details"}),a.jsx(b2,{children:"View detailed information about this storage."})]}),a.jsx("div",{className:"py-4",children:a.jsx(JX,{dataStorage:s,isLoading:i})})]})})}const Ofe=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,i]=h.useState(!1);return a.jsx("div",{className:"text-right",children:a.jsxs(Cr,{open:s,onOpenChange:i,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${s?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[a.jsxs(Ct,{onClick:()=>t==null?void 0:t(e),children:[a.jsx(MA,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"View details"})]}),a.jsxs(Ct,{onClick:()=>void(n==null?void 0:n(e)),children:[a.jsx(id,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),a.jsx(la,{}),a.jsxs(Ct,{onClick:()=>r==null?void 0:r(e),children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})},Ife=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(xr,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return a.jsx("div",{children:s})}},{accessorKey:"type",size:30,header:({column:r})=>a.jsx(xr,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=Sl.getInfo(s);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),i]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>a.jsx(xr,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return a.jsx("div",{className:"text-muted-foreground",children:i})}},{id:"actions",size:80,header:({table:r})=>a.jsx(xd,{table:r}),cell:({row:r})=>a.jsx(Ofe,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function Mfe({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(OA,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),a.jsxs(we,{variant:"outline",onClick:e,children:[a.jsx(ma,{className:"h-4 w-4"}),"New Storage"]})]})}function kfe({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Oc({columns:e,storageKeyPrefix:"data-storage-list"}),[f,m]=h.useState([]),[y,g]=h.useState({}),[x,v]=h.useState(!1),[C]=h.useState(null),b=wl({data:t,columns:[...e],getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:i,getSortedRowModel:Dc(),onColumnFiltersChange:m,getFilteredRowModel:yd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:y},enableRowSelection:!0}),w=(j,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(j)};return t.length?a.jsxs("div",{children:[C&&a.jsx(BM,{isOpen:x,onClose:()=>{v(!1)},id:C.id}),a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(jc,{className:"dm-card-toolbar-search-icon"}),a.jsx(It,{placeholder:"Search by title",value:(R=b.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:j=>{var _;return(_=b.getColumn("title"))==null?void 0:_.setFilterValue(j.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ma,{className:"h-4 w-4"}),"New Storage"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:b.getHeaderGroups().map(j=>a.jsx(Hn,{className:"dm-card-table-header-row",children:j.headers.map(_=>a.jsx(Tl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.getSize())}%`},children:_.isPlaceholder?null:rd(_.column.columnDef.header,_.getContext())},_.id))},j.id))}),a.jsx(jl,{className:"dm-card-table-body",children:b.getRowModel().rows.length?b.getRowModel().rows.map(j=>a.jsx(Hn,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const D=j.original.id;w(D,_)},children:j.getVisibleCells().map(_=>a.jsx($r,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${_.column.id==="actions"?"actions-cell":""} ${_.column.id==="createdAt"?"whitespace-nowrap":""}`,style:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:rd(_.column.columnDef.cell,_.getContext())},_.id))},j.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{b.previousPage()},disabled:!b.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{b.nextPage()},disabled:!b.getCanNextPage(),children:"Next"})]})]})]}):a.jsx("div",{className:"dm-card",children:a.jsx(Mfe,{onOpenTypeDialog:r})})}const Lfe=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=h.useState(e),[s,i]=h.useState(!1),{dataStorages:c,currentDataStorage:u,clearCurrentDataStorage:f,fetchDataStorages:m,getDataStorageById:y,deleteDataStorage:g,createDataStorage:x}=Vy();h.useEffect(()=>{m()},[m]),h.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[C,b]=h.useState(!1),[w,R]=h.useState(!1),[j,_]=h.useState(null),[D,O]=h.useState(!1),[A,T]=h.useState(null),I=async $=>{i(!0);try{const re=await x($);v(),re!=null&&re.id&&(await y(re.id),b(!0),i(!1))}catch(re){console.error("Failed to create storage:",re)}},k=$=>{T($),O(!0)},V=()=>{O(!1),T(null)},U=async $=>{await y($),b(!0)},K=$=>{_($),R(!0)},G=async()=>{if(j)try{await g(j),await m()}catch($){console.error("Failed to delete storage:",$)}finally{R(!1),_(null)}},q=async()=>{try{b(!1),await m()}catch($){console.error("Failed to save storage:",$)}},H=()=>{b(!1),f()},M=c.map($=>({id:$.id,title:$.title,type:$.type,createdAt:$.createdAt,modifiedAt:$.modifiedAt})),B=Ife({onViewDetails:k,onEdit:U,onDelete:K});return a.jsxs("div",{children:[a.jsx(kfe,{columns:B,data:M,onEdit:U,onOpenTypeDialog:()=>{r(!0)}}),a.jsx(BM,{isOpen:D,onClose:V,id:A??""}),a.jsx(b6,{isOpen:n,onClose:v,onSelect:I,isCreatingDataStorage:s}),a.jsx(NI,{isOpen:C,onClose:H,dataStorage:u,onSaveSuccess:()=>void q()}),a.jsx(br,{open:w,onOpenChange:R,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{G()},onCancel:()=>{_(null)},variant:"destructive"})]})},Pfe=()=>{const[e,t]=h.useState(!1);return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(I2,{children:a.jsx(Lfe,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function Ufe({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(iS,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),a.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."}),a.jsxs(we,{variant:"outline",onClick:e,children:[a.jsx(ma,{className:"h-4 w-4"}),"New Destination"]})]})}function zfe({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var C;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Oc({columns:e,storageKeyPrefix:"data-destination-list"}),[f,m]=h.useState([]),[y,g]=h.useState({}),x=wl({data:t,columns:[...e],getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:i,getSortedRowModel:Dc(),onColumnFiltersChange:m,getFilteredRowModel:yd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:y},enableRowSelection:!0}),v=(b,w)=>{w.target instanceof HTMLElement&&(w.target.closest('[role="checkbox"]')||w.target.closest(".actions-cell")||w.target.closest('[role="menuitem"]'))||n==null||n(b)};return t.length?a.jsx("div",{children:a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(jc,{className:"dm-card-toolbar-search-icon"}),a.jsx(It,{placeholder:"Search by title",value:(C=x.getColumn("title"))==null?void 0:C.getFilterValue(),onChange:b=>{var w;return(w=x.getColumn("title"))==null?void 0:w.setFilterValue(b.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ma,{className:"h-4 w-4"}),"New Destination"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:x.getHeaderGroups().map(b=>a.jsx(Hn,{className:"dm-card-table-header-row",children:b.headers.map(w=>a.jsx(Tl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:w.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(w.getSize())}%`},children:w.isPlaceholder?null:rd(w.column.columnDef.header,w.getContext())},w.id))},b.id))}),a.jsx(jl,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map(b=>a.jsx(Hn,{"data-state":b.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:w=>{const R=b.original.id;v(R,w)},children:b.getVisibleCells().map(w=>a.jsx($r,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${w.column.id==="actions"?"actions-cell":""} ${w.column.id==="createdAt"?"whitespace-nowrap":""}`,style:w.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(w.column.getSize())}%`},children:rd(w.column.columnDef.cell,w.getContext())},w.id))},b.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.previousPage()},disabled:!x.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.nextPage()},disabled:!x.getCanNextPage(),children:"Next"})]})]})}):a.jsx("div",{className:"dm-card",children:a.jsx(Ufe,{onOpenTypeDialog:r})})}const Ffe=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:i})=>{const[c,u]=h.useState(!1),f=()=>{if(n&&OC(n)){const g=r2(n);navigator.clipboard.writeText(g),_t.success("JSON Config copied to clipboard")}},m=t===Oe.LOOKER_STUDIO,y=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return a.jsx(a.Fragment,{children:a.jsx("div",{className:"text-right",children:a.jsxs(Cr,{open:c,onOpenChange:u,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${c?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[a.jsxs(Ct,{onClick:()=>void(r==null?void 0:r(e)),children:[a.jsx(id,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),m&&y&&a.jsxs(a.Fragment,{children:[a.jsx(la,{}),a.jsxs(Ct,{onClick:f,children:[a.jsx(Wu,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Copy JSON Config"})]}),a.jsxs(Ct,{onClick:()=>{i==null||i(e)},children:[a.jsx(P1,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Rotate Secret Key"})]})]}),a.jsx(la,{}),a.jsxs(Ct,{onClick:()=>s==null?void 0:s(e),children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})},Hfe=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(xr,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return a.jsx("div",{className:"overflow-hidden text-ellipsis",children:s})}},{accessorKey:"type",size:30,header:({column:r})=>a.jsx(xr,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=aa.getInfo(s);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),i]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>a.jsx(xr,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return a.jsx("div",{className:"text-muted-foreground",children:i})}},{id:"actions",size:80,header:({table:r})=>a.jsx(xd,{table:r}),cell:({row:r})=>a.jsx(Ffe,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}],$fe=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:i,getDataDestinationById:c,deleteDataDestination:u,rotateSecretKey:f}=Fh(),m=h.useCallback(()=>{s(),g(!0),t==null||t()},[s,t]),[y,g]=h.useState(!1),[x,v]=h.useState(!1),[C,b]=h.useState(!1),[w,R]=h.useState(null),[j,_]=h.useState(null);h.useEffect(()=>{i()},[i]),h.useEffect(()=>{e&&m()},[e,m]);const D=async G=>{await c(G),g(!0)},O=G=>{R(G),v(!0)},A=G=>{_(G),b(!0)},T=async()=>{if(j)try{const G=await f(j);if(OC(G.credentials)){_t.success("New JSON Config copied to clipboard");const q=r2(G.credentials);navigator.clipboard.writeText(q)}await i()}catch(G){console.error("Failed to rotate secret key:",G)}finally{b(!1),_(null)}},I=async()=>{if(w)try{await u(w),await i()}catch(G){console.error("Failed to delete destination:",G)}finally{v(!1),R(null)}},k=async()=>{try{g(!1),await i()}catch(G){console.error("Failed to save destination:",G)}},V=()=>{g(!1),s()},U=n.map(G=>({id:G.id,title:G.title,type:G.type,createdAt:G.createdAt,modifiedAt:G.modifiedAt,credentials:G.credentials})),K=Hfe({onEdit:D,onDelete:O,onRotateSecretKey:A});return a.jsxs("div",{children:[a.jsx(zfe,{columns:K,data:U,onEdit:D,onDelete:O,onRotateSecretKey:A,onOpenTypeDialog:m}),a.jsx(FM,{isOpen:y,onClose:V,dataDestination:r,onSaveSuccess:()=>void k()}),a.jsx(br,{open:x,onOpenChange:v,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{I()},onCancel:()=>{R(null)},variant:"destructive"}),a.jsx(br,{open:C,onOpenChange:b,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void T(),onCancel:()=>{b(!1)},variant:"destructive",children:a.jsxs("div",{className:"text-sm",children:[a.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),a.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[a.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),a.jsx("li",{children:"Go to your Looker Studio Connector"}),a.jsx("li",{children:"Update the configuration with the new JSON Config"}),a.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),a.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},Vfe=()=>{const[e,t]=h.useState(!1);return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(zh,{children:a.jsx($fe,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Gb({className:e,...t}){return a.jsx("div",{"data-slot":"empty",className:se("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",e),...t})}function Bb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-header",className:se("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}const Gfe=Ec("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-muted-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6 [&_svg]:stroke-[1.5]"}},defaultVariants:{variant:"default"}});function qb({className:e,variant:t="default",...n}){return a.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:se(Gfe({variant:t,className:e})),...n})}function Kb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-title",className:se("text-muted-foreground text-lg font-medium tracking-tight",e),...t})}function Zb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-description",className:se("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Bfe({className:e,...t}){return a.jsx("div",{"data-slot":"empty-content",className:se("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}const qfe=()=>{const e=wc(),{createInsight:t,insightLoading:n}=nx(),r=()=>{(async()=>{const s=await t({title:"Untitled insight"});s&&e(s.id)})()};return a.jsxs(Gb,{children:[a.jsxs(Bb,{children:[a.jsx(qb,{variant:"icon",children:a.jsx(io,{})}),a.jsx(Kb,{children:"Create your first Insight"}),a.jsx(Zb,{children:"Create an Insight to prompt your Data Mart and discover the story behind your data."})]}),a.jsx(Bfe,{children:a.jsxs(we,{variant:"outline",onClick:r,disabled:n,children:[a.jsx(ma,{className:"h-4 w-4"}),"New Insight"]})})]})};function Kfe({id:e,onDelete:t}){const[n,r]=h.useState(!1);return a.jsx("div",{className:"text-right",onClick:s=>{s.stopPropagation()},children:a.jsxs(Cr,{open:n,onOpenChange:r,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${n?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Er,{align:"end",children:a.jsxs(Ct,{className:"text-destructive",onClick:()=>t==null?void 0:t(e),children:[a.jsx(es,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})}const Zfe=({onDelete:e}={})=>[{accessorKey:"title",size:50,header:({column:t})=>a.jsx(xr,{column:t,children:"Title"}),cell:({row:t})=>{const n=t.getValue("title");return a.jsx("div",{className:"overflow-hidden text-ellipsis",children:n})},meta:{title:"Title"}},{accessorKey:"lastRun",size:50,sortDescFirst:!0,header:({column:t})=>a.jsx(xr,{column:t,children:"Last run"}),cell:({row:t})=>{const n=t.getValue("lastRun");return a.jsx("div",{className:"text-muted-foreground",children:j5(n)})},meta:{title:"Last run"}},{id:"actions",size:80,header:({table:t})=>a.jsx(xd,{table:t}),cell:({row:t})=>a.jsx(Kfe,{id:t.original.id,onDelete:e}),meta:{title:"Actions"}}];function Yfe({items:e,onRowClick:t,onDelete:n}){const r=h.useMemo(()=>Zfe({onDelete:n}),[n]),{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Oc({columns:r,storageKeyPrefix:"data-mart-insights",defaultSortingColumn:"lastRun"}),f=wl({data:e,columns:r,getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:i,getSortedRowModel:Dc(),getFilteredRowModel:yd(),state:{sorting:s,columnVisibility:c},onColumnVisibilityChange:u,enableGlobalFilter:!0,enableColumnResizing:!1}),m=h.useCallback(()=>{f.previousPage()},[f]),y=h.useCallback(()=>{f.nextPage()},[f]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{id:"insights-table",className:"dm-card-table",role:"table","aria-label":"Insights",children:[a.jsx(Rl,{className:"dm-card-table-header",children:f.getHeaderGroups().map(x=>a.jsx(Hn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(Tl,{scope:"col",style:v.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(v.getSize())}%`},children:v.isPlaceholder?null:typeof v.column.columnDef.header=="function"?v.column.columnDef.header(v.getContext()):v.column.columnDef.header},v.id))},x.id))}),a.jsx(jl,{className:"dm-card-table-body",children:f.getRowModel().rows.length?f.getRowModel().rows.map((x,v)=>a.jsx(Hn,{onClick:()=>{t(x.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:x.getVisibleCells().map((C,b)=>a.jsx($r,{className:`px-6 whitespace-normal ${C.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":b+1,style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},children:typeof C.column.columnDef.cell=="function"?C.column.columnDef.cell(C.getContext()):C.column.columnDef.cell},C.id))},x.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:r.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No insights found."})})})})]})}),a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:m,disabled:!f.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:y,disabled:!f.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})]})}function Wfe(){const e=wc(),{fetchInsights:t,deleteInsight:n,createInsight:r,insightLoading:s}=nx(),{insights:i,isLoading:c,error:u,hasInsights:f}=PM(),[m,y]=h.useState(null);h.useEffect(()=>{t()},[t]);const g=C=>{e(C)},x=()=>{(async()=>{const C=await r({title:"Untitled insight"});C&&e(C.id)})()},v=()=>{(async()=>{if(m)try{await n(m)}finally{y(null)}})()};return a.jsxs(ul,{children:[a.jsxs(xo,{children:[a.jsx(yo,{tooltip:"Manage and review your insights",icon:io,children:"Insights"}),f&&a.jsx(Xh,{children:a.jsxs(we,{variant:"outline","aria-label":"Add new insight",disabled:s,onClick:x,children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"New insight"]})})]}),a.jsxs(vo,{children:[c&&!f?a.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading insights…"}):u?a.jsx("div",{className:"text-destructive p-4 text-sm",children:"Failed to load insights"}):f?a.jsx(Yfe,{items:i.map(C=>({id:C.id,title:C.title,lastRun:C.outputUpdatedAt})),onRowClick:g,onDelete:C=>{y(C)}}):a.jsx(qfe,{}),a.jsx(br,{open:!!m,onOpenChange:C=>{C||y(null)},title:"Delete Insight",description:"Are you sure you want to delete this insight? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:v})]}),a.jsx(ai,{})]})}function Xfe(){return a.jsx(DC,{children:a.jsx(Wfe,{})})}const ax=h.createContext(null);ax.displayName="PanelGroupContext";const Qn={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},MC=10,lc=h.useLayoutEffect,$N=dh.useId,Qfe=typeof $N=="function"?$N:()=>null;let Jfe=0;function kC(e=null){const t=Qfe(),n=h.useRef(e||t||null);return n.current===null&&(n.current=""+Jfe++),e??n.current}function qM({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:c,maxSize:u,minSize:f,onCollapse:m,onExpand:y,onResize:g,order:x,style:v,tagName:C="div",...b}){const w=h.useContext(ax);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:R,expandPanel:j,getPanelSize:_,getPanelStyle:D,groupId:O,isPanelCollapsed:A,reevaluatePanelConstraints:T,registerPanel:I,resizePanel:k,unregisterPanel:V}=w,U=kC(c),K=h.useRef({callbacks:{onCollapse:m,onExpand:y,onResize:g},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:f},id:U,idIsFromProps:c!==void 0,order:x});h.useRef({didLogMissingDefaultSizeWarning:!1}),lc(()=>{const{callbacks:q,constraints:H}=K.current,M={...H};K.current.id=U,K.current.idIsFromProps=c!==void 0,K.current.order=x,q.onCollapse=m,q.onExpand=y,q.onResize=g,H.collapsedSize=n,H.collapsible=r,H.defaultSize=s,H.maxSize=u,H.minSize=f,(M.collapsedSize!==H.collapsedSize||M.collapsible!==H.collapsible||M.maxSize!==H.maxSize||M.minSize!==H.minSize)&&T(K.current,M)}),lc(()=>{const q=K.current;return I(q),()=>{V(q)}},[x,U,I,V]),h.useImperativeHandle(i,()=>({collapse:()=>{R(K.current)},expand:q=>{j(K.current,q)},getId(){return U},getSize(){return _(K.current)},isCollapsed(){return A(K.current)},isExpanded(){return!A(K.current)},resize:q=>{k(K.current,q)}}),[R,j,_,A,U,k]);const G=D(K.current,s);return h.createElement(C,{...b,children:e,className:t,id:U,style:{...G,...v},[Qn.groupId]:O,[Qn.panel]:"",[Qn.panelCollapsible]:r||void 0,[Qn.panelId]:U,[Qn.panelSize]:parseFloat(""+G.flexGrow).toFixed(1)})}const KM=h.forwardRef((e,t)=>h.createElement(qM,{...e,forwardedRef:t}));qM.displayName="Panel";KM.displayName="forwardRef(Panel)";let Yb=null,Jp=-1,Xi=null;function ehe(e,t,n){const r=(t&QM)!==0,s=(t&JM)!==0,i=(t&e8)!==0,c=(t&t8)!==0;if(t){if(r)return i?"se-resize":c?"ne-resize":"e-resize";if(s)return i?"sw-resize":c?"nw-resize":"w-resize";if(i)return"s-resize";if(c)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function the(){Xi!==null&&(document.head.removeChild(Xi),Yb=null,Xi=null,Jp=-1)}function R1(e,t,n){var r,s;const i=ehe(e,t);if(Yb!==i){if(Yb=i,Xi===null&&(Xi=document.createElement("style"),document.head.appendChild(Xi)),Jp>=0){var c;(c=Xi.sheet)===null||c===void 0||c.removeRule(Jp)}Jp=(r=(s=Xi.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${i} !important;}`))!==null&&r!==void 0?r:-1}}function ZM(e){return e.type==="keydown"}function YM(e){return e.type.startsWith("pointer")}function WM(e){return e.type.startsWith("mouse")}function sx(e){if(YM(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(WM(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function nhe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function rhe(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function ahe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:BN(e),b:BN(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Ot(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:GN(VN(n.a)),b:GN(VN(n.b))};if(s.a===s.b){const i=r.childNodes,c={a:n.a.at(-1),b:n.b.at(-1)};let u=i.length;for(;u--;){const f=i[u];if(f===c.a)return 1;if(f===c.b)return-1}}return Math.sign(s.a-s.b)}const she=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function ohe(e){var t;const n=getComputedStyle((t=XM(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function ihe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||ohe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||she.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function VN(e){let t=e.length;for(;t--;){const n=e[t];if(Ot(n,"Missing node"),ihe(n))return n}return null}function GN(e){return e&&Number(getComputedStyle(e).zIndex)||0}function BN(e){const t=[];for(;e;)t.push(e),e=XM(e);return t}function XM(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const QM=1,JM=2,e8=4,t8=8,lhe=nhe()==="coarse";let zs=[],Zu=!1,Qi=new Map,ox=new Map;const ch=new Set;function che(e,t,n,r,s){var i;const{ownerDocument:c}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},f=(i=Qi.get(c))!==null&&i!==void 0?i:0;return Qi.set(c,f+1),ch.add(u),Vg(),function(){var y;ox.delete(e),ch.delete(u);const g=(y=Qi.get(c))!==null&&y!==void 0?y:1;if(Qi.set(c,g-1),Vg(),g===1&&Qi.delete(c),zs.includes(u)){const x=zs.indexOf(u);x>=0&&zs.splice(x,1),ix(),s("up",!0,null)}}}function uhe(e){const{target:t}=e,{x:n,y:r}=sx(e);Zu=!0,LC({target:t,x:n,y:r}),Vg(),zs.length>0&&(Gg("down",e),ix(),e.preventDefault(),n8(t)||e.stopImmediatePropagation())}function j1(e){const{x:t,y:n}=sx(e);if(Zu&&e.type!=="pointerleave"&&e.buttons===0&&(Zu=!1,Gg("up",e)),!Zu){const{target:r}=e;LC({target:r,x:t,y:n})}Gg("move",e),ix(),zs.length>0&&e.preventDefault()}function T1(e){const{target:t}=e,{x:n,y:r}=sx(e);ox.clear(),Zu=!1,zs.length>0&&(e.preventDefault(),n8(t)||e.stopImmediatePropagation()),Gg("up",e),LC({target:t,x:n,y:r}),ix(),Vg()}function n8(e){let t=e;for(;t;){if(t.hasAttribute(Qn.resizeHandle))return!0;t=t.parentElement}return!1}function LC({target:e,x:t,y:n}){zs.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),ch.forEach(s=>{const{element:i,hitAreaMargins:c}=s,u=i.getBoundingClientRect(),{bottom:f,left:m,right:y,top:g}=u,x=lhe?c.coarse:c.fine;if(t>=m-x&&t<=y+x&&n>=g-x&&n<=f+x){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&ahe(r,i)>0){let C=r,b=!1;for(;C&&!C.contains(i);){if(rhe(C.getBoundingClientRect(),u)){b=!0;break}C=C.parentElement}if(b)return}zs.push(s)}})}function _1(e,t){ox.set(e,t)}function ix(){let e=!1,t=!1;zs.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;ox.forEach(r=>{n|=r}),e&&t?R1("intersection",n):e?R1("horizontal",n):t?R1("vertical",n):the()}let N1;function Vg(){var e;(e=N1)===null||e===void 0||e.abort(),N1=new AbortController;const t={capture:!0,signal:N1.signal};ch.size&&(Zu?(zs.length>0&&Qi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("contextmenu",T1,t),s.addEventListener("pointerleave",j1,t),s.addEventListener("pointermove",j1,t))}),Qi.forEach((n,r)=>{const{body:s}=r;s.addEventListener("pointerup",T1,t),s.addEventListener("pointercancel",T1,t)})):Qi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("pointerdown",uhe,t),s.addEventListener("pointermove",j1,t))}))}function Gg(e,t){ch.forEach(n=>{const{setResizeHandlerState:r}=n,s=zs.includes(n);r(e,s,t)})}function dhe(){const[e,t]=h.useState(0);return h.useCallback(()=>t(n=>n+1),[])}function Ot(e,t){if(!e)throw console.error(t),Error(t)}function Sc(e,t,n=MC){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Jo(e,t,n=MC){return Sc(e,t,n)===0}function $a(e,t,n){return Sc(e,t,n)===0}function fhe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],i=t[r];if(!$a(s,i,n))return!1}return!0}function Pu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Ot(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:s=0,collapsible:i,maxSize:c=100,minSize:u=0}=r;if(Sc(n,u)<0)if(i){const f=(s+u)/2;Sc(n,f)<0?n=s:n=u}else n=u;return n=Math.min(c,n),n=parseFloat(n.toFixed(MC)),n}function kf({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if($a(e,0))return t;const c=[...t],[u,f]=r;Ot(u!=null,"Invalid first pivot index"),Ot(f!=null,"Invalid second pivot index");let m=0;if(i==="keyboard"){{const g=e<0?f:u,x=n[g];Ot(x,`Panel constraints not found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:b=0}=x;if(C){const w=t[g];if(Ot(w!=null,`Previous layout not found for panel index ${g}`),$a(w,v)){const R=b-w;Sc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}{const g=e<0?u:f,x=n[g];Ot(x,`No panel constraints found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:b=0}=x;if(C){const w=t[g];if(Ot(w!=null,`Previous layout not found for panel index ${g}`),$a(w,b)){const R=w-v;Sc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}}{const g=e<0?1:-1;let x=e<0?f:u,v=0;for(;;){const b=t[x];Ot(b!=null,`Previous layout not found for panel index ${x}`);const R=Pu({panelConstraints:n,panelIndex:x,size:100})-b;if(v+=R,x+=g,x<0||x>=n.length)break}const C=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-C:C}{let x=e<0?u:f;for(;x>=0&&x<n.length;){const v=Math.abs(e)-Math.abs(m),C=t[x];Ot(C!=null,`Previous layout not found for panel index ${x}`);const b=C-v,w=Pu({panelConstraints:n,panelIndex:x,size:b});if(!$a(C,w)&&(m+=C-w,c[x]=w,m.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?x--:x++}}if(fhe(s,c))return s;{const g=e<0?f:u,x=t[g];Ot(x!=null,`Previous layout not found for panel index ${g}`);const v=x+m,C=Pu({panelConstraints:n,panelIndex:g,size:v});if(c[g]=C,!$a(C,v)){let b=v-C,R=e<0?f:u;for(;R>=0&&R<n.length;){const j=c[R];Ot(j!=null,`Previous layout not found for panel index ${R}`);const _=j+b,D=Pu({panelConstraints:n,panelIndex:R,size:_});if($a(j,D)||(b-=D-j,c[R]=D),$a(b,0))break;e>0?R--:R++}}}const y=c.reduce((g,x)=>x+g,0);return $a(y,100)?c:s}function hhe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,i=0,c=0;const u=n[0];Ot(u!=null,"No pivot index found"),t.forEach((g,x)=>{const{constraints:v}=g,{maxSize:C=100,minSize:b=0}=v;x===u?(r=b,s=C):(i+=b,c+=C)});const f=Math.min(s,100-i),m=Math.max(r,100-c),y=e[u];return{valueMax:f,valueMin:m,valueNow:y}}function uh(e,t=document){return Array.from(t.querySelectorAll(`[${Qn.resizeHandleId}][data-panel-group-id="${e}"]`))}function r8(e,t,n=document){const s=uh(e,n).findIndex(i=>i.getAttribute(Qn.resizeHandleId)===t);return s??null}function a8(e,t,n){const r=r8(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function mhe(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function s8(e,t=document){if(mhe(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function lx(e,t=document){const n=t.querySelector(`[${Qn.resizeHandleId}="${e}"]`);return n||null}function phe(e,t,n,r=document){var s,i,c,u;const f=lx(t,r),m=uh(e,r),y=f?m.indexOf(f):-1,g=(s=(i=n[y])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,x=(c=(u=n[y+1])===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:null;return[g,x]}function ghe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:c}){h.useRef({didWarnAboutMissingResizeHandle:!1}),lc(()=>{if(!i)return;const u=uh(n,i);for(let f=0;f<s.length-1;f++){const{valueMax:m,valueMin:y,valueNow:g}=hhe({layout:r,panelsArray:s,pivotIndices:[f,f+1]}),x=u[f];if(x!=null){const v=s[f];Ot(v,`No panel data found for index "${f}"`),x.setAttribute("aria-controls",v.id),x.setAttribute("aria-valuemax",""+Math.round(m)),x.setAttribute("aria-valuemin",""+Math.round(y)),x.setAttribute("aria-valuenow",g!=null?""+Math.round(g):"")}}return()=>{u.forEach((f,m)=>{f.removeAttribute("aria-controls"),f.removeAttribute("aria-valuemax"),f.removeAttribute("aria-valuemin"),f.removeAttribute("aria-valuenow")})}},[n,r,s,i]),h.useEffect(()=>{if(!i)return;const u=t.current;Ot(u,"Eager values not found");const{panelDataArray:f}=u,m=s8(n,i);Ot(m!=null,`No group found for id "${n}"`);const y=uh(n,i);Ot(y,`No resize handles found for group id "${n}"`);const g=y.map(x=>{const v=x.getAttribute(Qn.resizeHandleId);Ot(v,"Resize handle element has no handle id attribute");const[C,b]=phe(n,v,f,i);if(C==null||b==null)return()=>{};const w=R=>{if(!R.defaultPrevented)switch(R.key){case"Enter":{R.preventDefault();const j=f.findIndex(_=>_.id===C);if(j>=0){const _=f[j];Ot(_,`No panel data found for index ${j}`);const D=r[j],{collapsedSize:O=0,collapsible:A,minSize:T=0}=_.constraints;if(D!=null&&A){const I=kf({delta:$a(D,O)?T-O:O-D,initialLayout:r,panelConstraints:f.map(k=>k.constraints),pivotIndices:a8(n,v,i),prevLayout:r,trigger:"keyboard"});r!==I&&c(I)}}break}}};return x.addEventListener("keydown",w),()=>{x.removeEventListener("keydown",w)}});return()=>{g.forEach(x=>x())}},[i,e,t,n,r,s,c])}function qN(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function o8(e,t){const n=e==="horizontal",{x:r,y:s}=sx(t);return n?r:s}function yhe(e,t,n,r,s){const i=n==="horizontal",c=lx(t,s);Ot(c,`No resize handle element found for id "${t}"`);const u=c.getAttribute(Qn.groupId);Ot(u,"Resize handle element has no group id attribute");let{initialCursorPosition:f}=r;const m=o8(n,e),y=s8(u,s);Ot(y,`No group element found for id "${u}"`);const g=y.getBoundingClientRect(),x=i?g.width:g.height;return(m-f)/x*100}function xhe(e,t,n,r,s,i){if(ZM(e)){const c=n==="horizontal";let u=0;e.shiftKey?u=100:s!=null?u=s:u=10;let f=0;switch(e.key){case"ArrowDown":f=c?0:u;break;case"ArrowLeft":f=c?-u:0;break;case"ArrowRight":f=c?u:0;break;case"ArrowUp":f=c?0:-u;break;case"End":f=100;break;case"Home":f=-100;break}return f}else return r==null?0:yhe(e,t,n,r,i)}function vhe({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,s=100;for(let i=0;i<e.length;i++){const c=n[i];Ot(c,`Panel constraints not found for index ${i}`);const{defaultSize:u}=c;u!=null&&(r++,t[i]=u,s-=u)}for(let i=0;i<e.length;i++){const c=n[i];Ot(c,`Panel constraints not found for index ${i}`);const{defaultSize:u}=c;if(u!=null)continue;const f=e.length-r,m=s/f;r++,t[i]=m,s-=m}return t}function Ru(e,t,n){t.forEach((r,s)=>{const i=e[s];Ot(i,`Panel data not found for index ${s}`);const{callbacks:c,constraints:u,id:f}=i,{collapsedSize:m=0,collapsible:y}=u,g=n[f];if(g==null||r!==g){n[f]=r;const{onCollapse:x,onExpand:v,onResize:C}=c;C&&C(r,g),y&&(x||v)&&(v&&(g==null||Jo(g,m))&&!Jo(r,m)&&v(),x&&(g==null||!Jo(g,m))&&Jo(r,m)&&x())}})}function Up(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function bhe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:s,precision:i=3}){const c=n[s];let u;return c==null?u=e!=null?e.toFixed(i):"1":r.length===1?u="1":u=c.toFixed(i),{flexBasis:0,flexGrow:u,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function She(e,t=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function KN(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function i8(e){return`react-resizable-panels:${e}`}function l8(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:i}=t;return s?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function c8(e,t){try{const n=i8(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function Che(e,t,n){var r,s;const i=(r=c8(e,n))!==null&&r!==void 0?r:{},c=l8(t);return(s=i[c])!==null&&s!==void 0?s:null}function whe(e,t,n,r,s){var i;const c=i8(e),u=l8(t),f=(i=c8(e,s))!==null&&i!==void 0?i:{};f[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(c,JSON.stringify(f))}catch(m){console.error(m)}}function ZN({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,c)=>i+c,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!$a(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const c=n[i];Ot(c!=null,`No layout data found for index ${i}`);const u=100/r*c;n[i]=u}let s=0;for(let i=0;i<t.length;i++){const c=n[i];Ot(c!=null,`No layout data found for index ${i}`);const u=Pu({panelConstraints:t,panelIndex:i,size:c});c!=u&&(s+=c-u,n[i]=u)}if(!$a(s,0))for(let i=0;i<t.length;i++){const c=n[i];Ot(c!=null,`No layout data found for index ${i}`);const u=c+s,f=Pu({panelConstraints:t,panelIndex:i,size:u});if(c!==f&&(s-=f-c,n[i]=f,$a(s,0)))break}return n}const Ehe=100,Lf={getItem:e=>(KN(Lf),Lf.getItem(e)),setItem:(e,t)=>{KN(Lf),Lf.setItem(e,t)}},YN={};function u8({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:c=null,keyboardResizeBy:u=null,storage:f=Lf,style:m,tagName:y="div",...g}){const x=kC(i),v=h.useRef(null),[C,b]=h.useState(null),[w,R]=h.useState([]),j=dhe(),_=h.useRef({}),D=h.useRef(new Map),O=h.useRef(0),A=h.useRef({autoSaveId:e,direction:r,dragState:C,id:x,keyboardResizeBy:u,onLayout:c,storage:f}),T=h.useRef({layout:w,panelDataArray:[],panelDataArrayChanged:!1});h.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),h.useImperativeHandle(s,()=>({getId:()=>A.current.id,getLayout:()=>{const{layout:F}=T.current;return F},setLayout:F=>{const{onLayout:Z}=A.current,{layout:Q,panelDataArray:le}=T.current,J=ZN({layout:F,panelConstraints:le.map(ie=>ie.constraints)});qN(Q,J)||(R(J),T.current.layout=J,Z&&Z(J),Ru(le,J,_.current))}}),[]),lc(()=>{A.current.autoSaveId=e,A.current.direction=r,A.current.dragState=C,A.current.id=x,A.current.onLayout=c,A.current.storage=f}),ghe({committedValuesRef:A,eagerValuesRef:T,groupId:x,layout:w,panelDataArray:T.current.panelDataArray,setLayout:R,panelGroupElement:v.current}),h.useEffect(()=>{const{panelDataArray:F}=T.current;if(e){if(w.length===0||w.length!==F.length)return;let Z=YN[e];Z==null&&(Z=She(whe,Ehe),YN[e]=Z);const Q=[...F],le=new Map(D.current);Z(e,Q,le,w,f)}},[e,w,f]),h.useEffect(()=>{});const I=h.useCallback(F=>{const{onLayout:Z}=A.current,{layout:Q,panelDataArray:le}=T.current;if(F.constraints.collapsible){const J=le.map(He=>He.constraints),{collapsedSize:ie=0,panelSize:ye,pivotIndices:Ce}=Ql(le,F,Q);if(Ot(ye!=null,`Panel size not found for panel "${F.id}"`),!Jo(ye,ie)){D.current.set(F.id,ye);const Ee=Mu(le,F)===le.length-1?ye-ie:ie-ye,Ke=kf({delta:Ee,initialLayout:Q,panelConstraints:J,pivotIndices:Ce,prevLayout:Q,trigger:"imperative-api"});Up(Q,Ke)||(R(Ke),T.current.layout=Ke,Z&&Z(Ke),Ru(le,Ke,_.current))}}},[]),k=h.useCallback((F,Z)=>{const{onLayout:Q}=A.current,{layout:le,panelDataArray:J}=T.current;if(F.constraints.collapsible){const ie=J.map(nt=>nt.constraints),{collapsedSize:ye=0,panelSize:Ce=0,minSize:He=0,pivotIndices:Ee}=Ql(J,F,le),Ke=Z??He;if(Jo(Ce,ye)){const nt=D.current.get(F.id),Ft=nt!=null&&nt>=Ke?nt:Ke,On=Mu(J,F)===J.length-1?Ce-Ft:Ft-Ce,yn=kf({delta:On,initialLayout:le,panelConstraints:ie,pivotIndices:Ee,prevLayout:le,trigger:"imperative-api"});Up(le,yn)||(R(yn),T.current.layout=yn,Q&&Q(yn),Ru(J,yn,_.current))}}},[]),V=h.useCallback(F=>{const{layout:Z,panelDataArray:Q}=T.current,{panelSize:le}=Ql(Q,F,Z);return Ot(le!=null,`Panel size not found for panel "${F.id}"`),le},[]),U=h.useCallback((F,Z)=>{const{panelDataArray:Q}=T.current,le=Mu(Q,F);return bhe({defaultSize:Z,dragState:C,layout:w,panelData:Q,panelIndex:le})},[C,w]),K=h.useCallback(F=>{const{layout:Z,panelDataArray:Q}=T.current,{collapsedSize:le=0,collapsible:J,panelSize:ie}=Ql(Q,F,Z);return Ot(ie!=null,`Panel size not found for panel "${F.id}"`),J===!0&&Jo(ie,le)},[]),G=h.useCallback(F=>{const{layout:Z,panelDataArray:Q}=T.current,{collapsedSize:le=0,collapsible:J,panelSize:ie}=Ql(Q,F,Z);return Ot(ie!=null,`Panel size not found for panel "${F.id}"`),!J||Sc(ie,le)>0},[]),q=h.useCallback(F=>{const{panelDataArray:Z}=T.current;Z.push(F),Z.sort((Q,le)=>{const J=Q.order,ie=le.order;return J==null&&ie==null?0:J==null?-1:ie==null?1:J-ie}),T.current.panelDataArrayChanged=!0,j()},[j]);lc(()=>{if(T.current.panelDataArrayChanged){T.current.panelDataArrayChanged=!1;const{autoSaveId:F,onLayout:Z,storage:Q}=A.current,{layout:le,panelDataArray:J}=T.current;let ie=null;if(F){const Ce=Che(F,J,Q);Ce&&(D.current=new Map(Object.entries(Ce.expandToSizes)),ie=Ce.layout)}ie==null&&(ie=vhe({panelDataArray:J}));const ye=ZN({layout:ie,panelConstraints:J.map(Ce=>Ce.constraints)});qN(le,ye)||(R(ye),T.current.layout=ye,Z&&Z(ye),Ru(J,ye,_.current))}}),lc(()=>{const F=T.current;return()=>{F.layout=[]}},[]);const H=h.useCallback(F=>{let Z=!1;const Q=v.current;return Q&&window.getComputedStyle(Q,null).getPropertyValue("direction")==="rtl"&&(Z=!0),function(J){J.preventDefault();const ie=v.current;if(!ie)return()=>null;const{direction:ye,dragState:Ce,id:He,keyboardResizeBy:Ee,onLayout:Ke}=A.current,{layout:nt,panelDataArray:Ft}=T.current,{initialLayout:Pt}=Ce??{},On=a8(He,F,ie);let yn=xhe(J,F,ye,Ce,Ee,ie);const ke=ye==="horizontal";ke&&Z&&(yn=-yn);const Y=Ft.map(Ie=>Ie.constraints),ne=kf({delta:yn,initialLayout:Pt??nt,panelConstraints:Y,pivotIndices:On,prevLayout:nt,trigger:ZM(J)?"keyboard":"mouse-or-touch"}),ce=!Up(nt,ne);(YM(J)||WM(J))&&O.current!=yn&&(O.current=yn,!ce&&yn!==0?ke?_1(F,yn<0?QM:JM):_1(F,yn<0?e8:t8):_1(F,0)),ce&&(R(ne),T.current.layout=ne,Ke&&Ke(ne),Ru(Ft,ne,_.current))}},[]),M=h.useCallback((F,Z)=>{const{onLayout:Q}=A.current,{layout:le,panelDataArray:J}=T.current,ie=J.map(nt=>nt.constraints),{panelSize:ye,pivotIndices:Ce}=Ql(J,F,le);Ot(ye!=null,`Panel size not found for panel "${F.id}"`);const Ee=Mu(J,F)===J.length-1?ye-Z:Z-ye,Ke=kf({delta:Ee,initialLayout:le,panelConstraints:ie,pivotIndices:Ce,prevLayout:le,trigger:"imperative-api"});Up(le,Ke)||(R(Ke),T.current.layout=Ke,Q&&Q(Ke),Ru(J,Ke,_.current))},[]),B=h.useCallback((F,Z)=>{const{layout:Q,panelDataArray:le}=T.current,{collapsedSize:J=0,collapsible:ie}=Z,{collapsedSize:ye=0,collapsible:Ce,maxSize:He=100,minSize:Ee=0}=F.constraints,{panelSize:Ke}=Ql(le,F,Q);Ke!=null&&(ie&&Ce&&Jo(Ke,J)?Jo(J,ye)||M(F,ye):Ke<Ee?M(F,Ee):Ke>He&&M(F,He))},[M]),$=h.useCallback((F,Z)=>{const{direction:Q}=A.current,{layout:le}=T.current;if(!v.current)return;const J=lx(F,v.current);Ot(J,`Drag handle element not found for id "${F}"`);const ie=o8(Q,Z);b({dragHandleId:F,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:ie,initialLayout:le})},[]),re=h.useCallback(()=>{b(null)},[]),ge=h.useCallback(F=>{const{panelDataArray:Z}=T.current,Q=Mu(Z,F);Q>=0&&(Z.splice(Q,1),delete _.current[F.id],T.current.panelDataArrayChanged=!0,j())},[j]),P=h.useMemo(()=>({collapsePanel:I,direction:r,dragState:C,expandPanel:k,getPanelSize:V,getPanelStyle:U,groupId:x,isPanelCollapsed:K,isPanelExpanded:G,reevaluatePanelConstraints:B,registerPanel:q,registerResizeHandle:H,resizePanel:M,startDragging:$,stopDragging:re,unregisterPanel:ge,panelGroupElement:v.current}),[I,C,r,k,V,U,x,K,G,B,q,H,M,$,re,ge]),z={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return h.createElement(ax.Provider,{value:P},h.createElement(y,{...g,children:t,className:n,id:i,ref:v,style:{...z,...m},[Qn.group]:"",[Qn.groupDirection]:r,[Qn.groupId]:x}))}const d8=h.forwardRef((e,t)=>h.createElement(u8,{...e,forwardedRef:t}));u8.displayName="PanelGroup";d8.displayName="forwardRef(PanelGroup)";function Mu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Ql(e,t,n){const r=Mu(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],c=n[r];return{...t.constraints,panelSize:c,pivotIndices:i}}function Rhe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){h.useEffect(()=>{if(e||n==null||r==null)return;const s=lx(t,r);if(s==null)return;const i=c=>{if(!c.defaultPrevented)switch(c.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{c.preventDefault(),n(c);break}case"F6":{c.preventDefault();const u=s.getAttribute(Qn.groupId);Ot(u,`No group element found for id "${u}"`);const f=uh(u,r),m=r8(u,t,r);Ot(m!==null,`No resize element found for id "${t}"`);const y=c.shiftKey?m>0?m-1:f.length-1:m+1<f.length?m+1:0;f[y].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,e,t,n])}function f8({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onClick:c,onDragging:u,onFocus:f,onPointerDown:m,onPointerUp:y,style:g={},tabIndex:x=0,tagName:v="div",...C}){var b,w;const R=h.useRef(null),j=h.useRef({onClick:c,onDragging:u,onPointerDown:m,onPointerUp:y});h.useEffect(()=>{j.current.onClick=c,j.current.onDragging=u,j.current.onPointerDown=m,j.current.onPointerUp=y});const _=h.useContext(ax);if(_===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:O,registerResizeHandle:A,startDragging:T,stopDragging:I,panelGroupElement:k}=_,V=kC(s),[U,K]=h.useState("inactive"),[G,q]=h.useState(!1),[H,M]=h.useState(null),B=h.useRef({state:U});lc(()=>{B.current.state=U}),h.useEffect(()=>{if(n)M(null);else{const P=A(V);M(()=>P)}},[n,V,A]);const $=(b=r==null?void 0:r.coarse)!==null&&b!==void 0?b:15,re=(w=r==null?void 0:r.fine)!==null&&w!==void 0?w:5;h.useEffect(()=>{if(n||H==null)return;const P=R.current;Ot(P,"Element ref not attached");let z=!1;return che(V,P,D,{coarse:$,fine:re},(Z,Q,le)=>{if(!Q){K("inactive");return}switch(Z){case"down":{K("drag"),z=!1,Ot(le,'Expected event to be defined for "down" action'),T(V,le);const{onDragging:J,onPointerDown:ie}=j.current;J==null||J(!0),ie==null||ie();break}case"move":{const{state:J}=B.current;z=!0,J!=="drag"&&K("hover"),Ot(le,'Expected event to be defined for "move" action'),H(le);break}case"up":{K("hover"),I();const{onClick:J,onDragging:ie,onPointerUp:ye}=j.current;ie==null||ie(!1),ye==null||ye(),z||J==null||J();break}}})},[$,D,n,re,A,V,H,T,I]),Rhe({disabled:n,handleId:V,resizeHandler:H,panelGroupElement:k});const ge={touchAction:"none",userSelect:"none"};return h.createElement(v,{...C,children:e,className:t,id:s,onBlur:()=>{q(!1),i==null||i()},onFocus:()=>{q(!0),f==null||f()},ref:R,role:"separator",style:{...ge,...g},tabIndex:x,[Qn.groupDirection]:D,[Qn.groupId]:O,[Qn.resizeHandle]:"",[Qn.resizeHandleActive]:U==="drag"?"pointer":G?"keyboard":void 0,[Qn.resizeHandleEnabled]:!n,[Qn.resizeHandleId]:V,[Qn.resizeHandleState]:U})}f8.displayName="PanelResizeHandle";function jhe({className:e,...t}){return a.jsx(d8,{"data-slot":"resizable-panel-group",className:se("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function WN({...e}){return a.jsx(KM,{"data-slot":"resizable-panel",...e})}function The({withHandle:e,className:t,...n}){return a.jsx(f8,{"data-slot":"resizable-handle",className:se("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&a.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:a.jsx(kA,{className:"size-2.5"})})})}function _he({storageKey:e,left:t,right:n,initialRatio:r=.5,minWidth:s=240,className:i}){const c=h.useMemo(()=>{const x=ps.get(e);if(x!==null){const v=Number(x);if(!Number.isNaN(v))return A1(v,.1,.9)}return A1(r,.1,.9)},[e,r]),u=Math.round(c*100),f=100-u,y=Math.min(45,Math.max(5,Math.round(s/1200*100)));function g(x){const v=x[0],C=A1(v/100,.1,.9);ps.set(e,C)}return a.jsxs(jhe,{direction:"horizontal",onLayout:g,className:se("relative flex h-full w-full items-stretch overflow-hidden",i),children:[a.jsx(WN,{defaultSize:u,minSize:y,className:"overflow-auto",children:t}),a.jsx(The,{withHandle:!0}),a.jsx(WN,{defaultSize:f,minSize:y,className:"overflow-auto",children:n})]})}function A1(e,t,n){return Math.max(t,Math.min(n,e))}function Nhe({...e}){return a.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Ahe({className:e,...t}){return a.jsx("ol",{"data-slot":"breadcrumb-list",className:se("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function XN({className:e,...t}){return a.jsx("li",{"data-slot":"breadcrumb-item",className:se("inline-flex items-center gap-1.5",e),...t})}function Dhe({asChild:e,className:t,...n}){const r=e?gh:"a";return a.jsx(r,{"data-slot":"breadcrumb-link",className:se("hover:text-foreground transition-colors",t),...n})}function Ohe({children:e,className:t,...n}){return a.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:se("[&>svg]:size-3.5",t),...n,children:e??a.jsx(_a,{})})}function Ihe({dataMartId:e,triggerId:t,insightId:n,onRunFinished:r,onError:s}){const i=h.useCallback(async c=>{if(!(!e||!t))try{const u=await oo.checkInsightExecutionStatus(e,t,n,{skipLoadingIndicator:!0,signal:c});[Xa.SUCCESS,Xa.ERROR,Xa.CANCELLED].includes(u.status)&&r()}catch(u){s(u)}},[e,t,n,r,s]);IC({enabled:!!(e&&t),intervalMs:2500,onlyWhenVisible:!0,onTick:i})}const Mhe=an({title:Dt().min(1,"Title cannot be empty"),template:Dt().optional()}),khe=(e,t,n)=>{const{register:r,watch:s,handleSubmit:i,reset:c,resetField:u,setValue:f,formState:{isSubmitting:m,dirtyFields:y}}=To({resolver:xi(Mhe),defaultValues:{title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""}}),g=s("title"),x=s("template"),v=!!y.template;h.useEffect(()=>{c({title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""})},[e==null?void 0:e.id,e==null?void 0:e.title,e==null?void 0:e.template,c]);const C=h.useCallback(async w=>{if(!e)return;const R=w.trim();f("title",R,{shouldDirty:!0,shouldValidate:!0}),await n(e.id,R),u("title",{defaultValue:R})},[e,u,f,n]),b=h.useCallback(async w=>{if(!e)return;const R={title:w.title.trim(),template:w.template&&w.template.trim().length>0?w.template:null},j=await t(e.id,R);j&&c({title:j.title,template:j.template??""})},[e,c,t]);return{register:r,handleSubmit:i,setValue:f,isTemplateDirty:v,isSubmitting:m,titleValue:g,templateValue:x,handleTitleUpdate:C,onSubmit:b}},D1=[{icon:io,text:"Initializing intelligence..."},{icon:OA,text:"Connecting to data sources..."},{icon:iz,text:"Mapping data relationships..."},{icon:wU,text:"Exploring dataset structure..."},{icon:Az,text:"Scanning available fields..."},{icon:Pz,text:"Analyzing data patterns..."},{icon:Ez,text:"Selecting optimal insight path..."},{icon:VA,text:"Preparing aggregated tables..."},{icon:HU,text:"Building visual model..."},{icon:pU,text:"Finalizing insight output..."},{icon:Vz,text:"Validating field consistency..."},{icon:_z,text:"Checking for missing values..."},{icon:SU,text:"Detecting anomalies in data..."},{icon:BU,text:"Cross-referencing data sources..."},{icon:zz,text:"Verifying aggregation results..."},{icon:kU,text:"Ensuring data relationships are correct..."},{icon:DP,text:"Refining visual model parameters..."},{icon:AU,text:"Confirming data integrity..."},{icon:yU,text:"Preparing final output for insights..."},{icon:jU,text:"Performing final quality checks..."}],Lhe=()=>{const[e,t]=h.useState(0);h.useEffect(()=>{const r=setInterval(()=>{t(s=>(s+1)%D1.length)},5e3);return()=>{clearInterval(r)}},[]);const n=D1[e].icon;return a.jsx("div",{className:"bg-muted h-full w-full rounded-tr-md rounded-br-md dark:bg-transparent",children:a.jsxs("div",{className:"flex h-full w-full animate-pulse flex-col items-center justify-center gap-4 p-4 text-center select-none",children:[a.jsx("div",{className:"text-muted-foreground animate-fade-slide-in-out",children:a.jsx(n,{className:"h-8 w-8",strokeWidth:1})},`${String(e)}-icon`),a.jsx("h3",{className:"text-muted-foreground animate-fade-slide-in-out text-sm",children:D1[e].text},`${String(e)}-text`)]})})};function Phe(){const e=wc(),{insightId:t}=Wg(),n=h.useMemo(()=>"insight_details_split",[]),[r,s]=h.useState(!1),{dataMart:i}=ws(),c=(i==null?void 0:i.status.code)===Ar.DRAFT,{activeInsight:u,insightLoading:f,isRunning:m,triggerId:y,updateInsight:g,updateInsightTitle:x,getInsight:v,runInsight:C,deleteInsight:b,resetTriggerId:w,ensureActiveRunPolling:R}=nx(),{handleSubmit:j,setValue:_,isTemplateDirty:D,isSubmitting:O,titleValue:A,templateValue:T,handleTitleUpdate:I,onSubmit:k}=khe(u,g,x),V=MM({markdown:(u==null?void 0:u.output)??"",enabled:!!(u!=null&&u.output),debounceMs:0}),[U,K]=h.useState(!1),[G,q]=h.useState(!1),{copyToClipboard:H}=rx(),M=h.useCallback(async()=>{const P=(u==null?void 0:u.output)??"";if(!P)return;await H(P,"insight-output")?_t.success("Markdown copied to clipboard"):_t.error("Failed to copy to clipboard"),De({event:"insight_output_copied",category:"Insights",action:"Copy"})},[u==null?void 0:u.output,H]);h.useEffect(()=>{const P=z=>{(z.metaKey||z.ctrlKey)&&z.shiftKey&&(z.key==="M"||z.key==="m")&&(z.preventDefault(),K(Z=>!Z),De({event:"insight_raw_output_toggle",category:"Insights",action:"ToggleRawOutput"}))};return window.addEventListener("keydown",P),()=>{window.removeEventListener("keydown",P)}},[]);const B=h.useCallback(async()=>{u&&(await b(u.id),e(".."))},[u,b,e]),$=!f&&!(u!=null&&u.output);h.useEffect(()=>{t&&v(t)},[t,v]),h.useEffect(()=>{u!=null&&u.id&&R()},[u==null?void 0:u.id,R]),Ihe({triggerId:y,dataMartId:(i==null?void 0:i.id)??"",insightId:(u==null?void 0:u.id)??"",onRunFinished:h.useCallback(()=>{w(),u!=null&&u.id&&v(u.id)},[u==null?void 0:u.id,v,w]),onError:h.useCallback(()=>{w()},[w])});const re=h.useCallback(async()=>{if(!(u!=null&&u.id)){console.error("Insight ID is not available");return}try{await C(u.id)}catch(P){throw console.error("Failed to run insight"),P}},[u==null?void 0:u.id,C]),ge=h.useCallback(()=>j(async P=>{if(await k(P),!(u!=null&&u.id)){console.error("Insight ID is not available");return}try{await C(u.id)}catch(z){throw console.error("Failed to run insight"),z}})(),[j,u==null?void 0:u.id,k,C]);return f?a.jsx("div",{className:"text-muted-foreground flex flex-col gap-2 text-sm",children:"Loading..."}):!u||!i?a.jsxs(Gb,{children:[a.jsx(Bb,{children:a.jsx(qb,{variant:"icon",children:a.jsx(io,{})})}),a.jsx(Kb,{children:"Insight not found"}),a.jsx(Zb,{children:"The insight you're looking for doesn't exist or couldn't be loaded"})]}):a.jsxs("div",{className:"flex h-full w-full flex-col gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(Nhe,{children:a.jsxs(Ahe,{children:[a.jsx(XN,{children:a.jsx(Dhe,{asChild:!0,children:a.jsx(Wr,{to:"..",children:"Insights"})})}),a.jsx(Ohe,{}),a.jsx(XN,{children:a.jsx("span",{"aria-current":"page",className:"block max-w-[480px] truncate",children:a.jsx(S6,{title:A||"Untitled insight",onUpdate:I,className:"font-medium",errorMessage:"Title cannot be empty",minWidth:"200px"})})})]})}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",size:"icon","aria-label":"Insight actions",children:a.jsx(IA,{className:"h-4 w-4"})})}),a.jsx(Er,{align:"end",children:a.jsxs(Ct,{onClick:()=>{s(!0)},className:"text-destructive",children:[a.jsx(es,{className:"h-4 w-4 text-red-600"})," ",a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})]}),a.jsx("div",{className:"bg-background flex-1 rounded-md border",children:a.jsx(_he,{storageKey:n,initialRatio:.5,left:a.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:a.jsx(Vb,{value:T??"",onChange:P=>{_("template",P,{shouldDirty:!0})},height:"calc(100vh - 275px)",placeholder:"Type / to view available commands...",readOnly:m,excludeInsightId:t})}),a.jsxs("div",{className:"flex items-center justify-between gap-4 border-t px-4 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[c?a.jsxs(vt,{delayDuration:150,children:[a.jsx(bt,{asChild:!0,children:a.jsx("span",{className:"inline-flex",tabIndex:0,children:a.jsx(we,{variant:"default",size:"default",disabled:O||m||!D,onClick:()=>{D&&j(async P=>{await k(P)})()},children:D?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(io,{})," Save Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(io,{})," Run Insight"]})})})}),a.jsx(St,{side:"top",children:a.jsx("p",{children:"To run an insight, publish the Data Mart first"})})]}):a.jsx(we,{variant:"default",size:"default",disabled:O||m,onClick:()=>void(D?ge():re()),children:m?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Rc,{className:"h-3 w-3 animate-spin"})," Running…"]}):D?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(io,{})," Save & Run Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(io,{})," Run Insight"]})}),a.jsxs(vt,{delayDuration:1500,children:[a.jsx(bt,{asChild:!0,children:a.jsx("span",{className:"inline-flex",tabIndex:0,children:a.jsxs(we,{variant:"outline",size:"default",onClick:()=>{De({event:"insight_send_schedule",category:"Insights",action:"SendSchedule",label:t}),c||q(!0)},disabled:c,className:"gap-2",children:[a.jsx(Iz,{className:"text-muted-foreground h-4 w-4"}),"Send & Schedule ..."]})})}),a.jsx(St,{side:"top",children:c?a.jsx("p",{children:"You can schedule and send reports only after publishing the Data Mart"}):a.jsx("p",{children:"You can schedule this insight to run at a specific time or send it to a recipient"})})]})]}),u.outputUpdatedAt&&a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx("div",{className:"text-muted-foreground/75 text-sm",children:a.jsx(Vs,{date:u.outputUpdatedAt})})}),a.jsx(St,{side:"top",children:a.jsxs("p",{children:["Last run: ",j5(u.outputUpdatedAt)]})})]})})]})]}),right:a.jsx("div",{className:"h-full",children:m?a.jsx(Lhe,{}):$?a.jsx(Gb,{className:"h-full",children:a.jsxs(Bb,{children:[a.jsx(qb,{variant:"icon",children:a.jsx(io,{})}),a.jsx(Kb,{children:"Even data needs a little spark"}),a.jsx(Zb,{children:"Write prompt to uncover the story behind your data!"})]})}):a.jsx("div",{className:"flex h-full min-h-0 flex-col gap-2",children:a.jsx("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:U?a.jsx(Vb,{value:u.output??"",onChange:()=>{},height:"100%",className:"h-full",readOnly:!0,excludeInsightId:t}):V.error?a.jsx("div",{className:"text-destructive",children:V.error}):a.jsxs(a.Fragment,{children:[a.jsx(IM,{html:V.html,loading:V.loading,error:V.error,height:"100%"}),!!u.output&&!V.loading&&!V.error&&a.jsx("div",{className:"absolute top-2 right-2 z-10",children:a.jsx(Ya,{children:a.jsxs(vt,{children:[a.jsx(bt,{asChild:!0,children:a.jsx(we,{variant:"outline",size:"icon",className:"h-8 w-8","aria-label":"Copy markdown to clipboard",onClick:()=>void M(),children:a.jsx(Wu,{className:"h-4 w-4"})})}),a.jsx(St,{side:"left",children:a.jsx("p",{children:"Copy markdown to clipboard"})})]})})})]})})})})})}),a.jsx(br,{open:r,onOpenChange:s,title:"Delete Insight",description:"Are you sure you want to delete this insight? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{B()}}),a.jsx(t2,{children:a.jsx($M,{isOpen:G,onClose:()=>{q(!1)},mode:Nn.CREATE,preSelectedDestination:null,prefill:{title:u.title||A||"New report",subject:`Insight: ${u.title||A||""}`.trim(),messageTemplate:T??""},allowedDestinationTypes:[Oe.EMAIL,Oe.SLACK,Oe.MS_TEAMS,Oe.GOOGLE_CHAT]})})]})}const Uhe=[{path:"overview",element:a.jsx(zN,{})},{path:"data-setup",element:a.jsx(Lue,{})},{path:"insights",element:a.jsx(ffe,{}),children:[{index:!0,element:a.jsx(Xfe,{})},{path:":insightId",element:a.jsx(Phe,{})}]},{path:"reports",element:a.jsx(ufe,{})},{path:"triggers",element:a.jsx(dfe,{})},{path:"run-history",element:a.jsx(Afe,{})},{index:!0,element:a.jsx(zN,{})}];function zhe({to:e="/data-marts"}){const{user:t,status:n}=mi();if(n===Zr.LOADING)return a.jsx(Hu,{fullScreen:!0,message:"Loading..."});if(n===Zr.UNAUTHENTICATED||!t)return a.jsx(Hu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=mg(t.projectId,e);return a.jsx(wL,{to:r,replace:!0})}return a.jsx(Hu,{fullScreen:!0,message:"Project not found"})}const Fhe=[{index:!0,path:"/",element:a.jsx(zhe,{})},{path:"/ui/:projectId",element:a.jsx(MX,{}),children:[{path:"about",element:a.jsx(kX,{})},{index:!0,element:a.jsx(I_,{})},{path:"data-marts",element:a.jsx(I_,{})},{path:"data-marts/create",element:a.jsx(Dfe,{})},{path:"data-marts/:id",element:a.jsx(Nue,{}),children:Uhe},{path:"data-storages",element:a.jsx(Pfe,{})},{path:"data-destinations",element:a.jsx(Vfe,{})},{path:"*",element:a.jsx(T_,{})}]},{path:"*",element:a.jsx(T_,{})}],h8="gtm-script",m8="gtm-noscript",Hhe="GOOGLE_TAG_MANAGER_CONTAINER_ID";function $he(){return!!document.getElementById(h8)}function Vhe(e){const t=document.createElement("script");return t.id=h8,t.innerHTML=`
|
|
848
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
849
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
850
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
851
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
852
|
-
})(window,document,'script','dataLayer','${e}');
|
|
853
|
-
`,t}function Ghe(e){const t=document.createElement("noscript");return t.id=m8,t.innerHTML=`
|
|
854
|
-
<iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
|
|
855
|
-
height="0"
|
|
856
|
-
width="0"
|
|
857
|
-
style="display:none;visibility:hidden">
|
|
858
|
-
</iframe>
|
|
859
|
-
`,t}function Bhe(e){if($he())return;const t=Vhe(e);document.head.prepend(t)}function qhe(e){if(document.getElementById(m8))return;const t=Ghe(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function Khe(e){try{Bhe(e),qhe(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function Zhe(e){return(e[Hhe]??"").trim()}function Yhe(){const{flags:e,callState:t}=md();return h.useEffect(()=>{if(t!==Et.LOADED||!e)return;const n=Zhe(e);n&&Khe(n)},[e,t]),null}const Whe="INTERCOM_APP_ID",p8="intercom-widget-script";function Xhe(){return!!document.getElementById(p8)}function Qhe(e,t){if(Xhe()){t();return}const n=document.createElement("script");n.id=p8,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function Jhe(){try{return(await Ea.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function eme(e,t){const n={app_id:e,user_id:t.id,hide_default_launcher:!0};return t.email&&(n.email=t.email),t.fullName&&(n.name=t.fullName),t.projectTitle&&(n.Name_project=t.projectTitle),n}async function tme(e,t){if(!t)return;const n=eme(e,t),r=await Jhe();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function nme(){const{flags:e,callState:t}=md(),{user:n}=mi(),r=h.useRef(!1);return h.useEffect(()=>{if(r.current||t!==Et.LOADED||!e)return;const s=e[Whe],i=(typeof s=="string"?s:"").trim();i&&Qhe(i,()=>{tme(i,n).then(()=>{r.current=!0,db()})})},[e,t,n]),null}function rme({initialState:e,reducer:t,children:n}){const[r,s]=h.useReducer(t,e),i=h.useMemo(()=>s,[s]);return a.jsx(tD.Provider,{value:r,children:a.jsx(nD.Provider,{value:i,children:n})})}function ame(e){return(t,n)=>{const r={...t};return Object.keys(e).forEach(s=>{const i=e[s],c=t[s],u=i(c,n);u!==c&&(r[s]=u)}),r}}const QN={id:null,title:null},g8="project/SET_PROJECT",sme="project/CLEAR_PROJECT";function ome(e){return{type:g8,payload:e}}function ime(e=QN,t){switch(t.type){case g8:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case sme:return{...QN};default:return e}}class lme extends bl{getFlags(){return this.get("/flags")}}const cme=new lme(""),y8={LICENSED_APP_EDITION:"COMMUNITY",MENU_GITHUB_COMMUNITY_VISIBLE:"true",MENU_UPGRADE_OPTIONS_VISIBLE:"true",MENU_FEEDBACK_VISIBLE:"true",MENU_ISSUES_VISIBLE:"true",MENU_LICENSE_VISIBLE:"true",MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE:"true",MENU_SLACK_COMMUNITY_VISIBLE:"true"},ume={data:{...y8},callState:Et.IDLE},x8="settings/LOAD_FLAGS",v8="settings/LOAD_FLAGS_SUCCESS",b8="settings/LOAD_FLAGS_ERROR";function dme(){return{type:x8}}function fme(e){return{type:v8,payload:e}}function hme(e){return{type:b8,payload:e}}function mme(e=ume,t){switch(t.type){case x8:return{...e,callState:Et.LOADING,error:void 0};case v8:return{...e,callState:Et.LOADED,data:{...y8,...t.payload}};case b8:return{...e,callState:Et.ERROR,error:t.payload};default:return e}}async function pme(e){try{e(dme());const t=await cme.getFlags();e(fme(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(hme(n))}}const S8="app/SET_READY";function gme(e={ready:!1},t){switch(t.type){case S8:return{...e,ready:!!t.payload};default:return e}}const yme=ame({project:ime,flags:mme,contentPopovers:KW,app:gme});function xme({children:e}){return a.jsx(rme,{reducer:yme,initialState:{project:{id:null,title:null},flags:{data:null,callState:Et.IDLE},contentPopovers:t5,app:{ready:!1}},children:e})}function vme({children:e}){const t=rD(),{user:n,status:r}=mi(),s=eh(f=>f.flags),i=s.callState,c=eh(f=>f.app.ready);h.useEffect(()=>{r===Zr.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(ome({id:n.projectId,title:n.projectTitle??null})),i===Et.IDLE&&pme(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,i,t]),h.useEffect(()=>{const f=r===Zr.AUTHENTICATED&&!!(n!=null&&n.projectId)&&i===Et.LOADED;t({type:S8,payload:f})},[r,n==null?void 0:n.projectId,i,t]);const u=h.useMemo(()=>a.jsx(Hu,{fullScreen:!0,message:"Loading application..."}),[]);return c?a.jsx(a.Fragment,{children:e}):i===Et.ERROR?a.jsx(Hu,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):u}const bme={center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4","top-left":"top-4 left-4","top-right":"top-4 right-4"};function Sme({width:e=500,height:t=500,position:n="center",children:r}){return a.jsx("div",{className:se("fixed z-[999] rounded-2xl border bg-white dark:bg-neutral-900","border-neutral-200 dark:border-neutral-800","hover:shadow-3xl transform shadow-2xl transition-all duration-200 ease-out",bme[n]),style:{width:e,height:t},"data-slot":"floating-popover",children:a.jsx("div",{className:"flex h-full flex-col",children:r})})}function Cme({children:e,onClose:t,...n}){return a.jsxs("div",{className:"relative flex items-center justify-between rounded-tl-2xl rounded-tr-2xl border-b bg-neutral-50 px-4 py-3 dark:bg-neutral-800/40","data-slot":"floating-popover-header",...n,children:[e,t&&a.jsx("button",{onClick:t,className:se("ml-2 rounded-sm p-1.5 transition-all","text-muted-foreground hover:text-foreground hover:bg-neutral-100 dark:hover:bg-neutral-800","focus:ring-brand-blue-500 focus:ring-2 focus:outline-none active:scale-95"),"aria-label":"Close popover",children:a.jsx(uc,{className:"size-4"})})]})}function wme({children:e}){return a.jsx("h2",{className:"text-md font-semibold","data-slot":"floating-popover-title",children:e})}function Eme({children:e}){return a.jsx("div",{className:"flex-1 space-y-4 overflow-auto px-4 py-3","data-slot":"floating-popover-content",children:e})}function Rme(){return a.jsx(a.Fragment,{children:a.jsx("video",{src:"https://github.com/user-attachments/assets/d2d9d913-a6fc-4949-a8e8-d697abd1631a",controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full rounded-md",children:"Your browser does not support the video tag."})})}function jme(){return a.jsx(a.Fragment,{children:a.jsx("video",{src:"https://github.com/user-attachments/assets/95e499eb-0a36-4180-846b-a829294e1afe",controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full rounded-md",children:"Your browser does not support the video tag."})})}function Tme(){return a.jsx(a.Fragment,{children:a.jsx("video",{src:"https://github.com/user-attachments/assets/dcb60ce1-dd7b-4783-b19c-f2fd85079e1f",controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full rounded-md",children:"Your browser does not support the video tag."})})}const _me={"video-1-google-sheets":{width:500,height:410,position:"bottom-left",title:"SQL to Google Sheets in Minutes",content:Rme},"video-2-looker":{width:500,height:410,position:"bottom-left",title:"Looker Studio Setup",content:jme},"video-3-getting-started-with-data-marts":{width:500,height:355,position:"bottom-left",title:"Getting Started with Data Marts",content:Tme}};function Nme(){const{activePopoverId:e,isOpen:t,close:n}=QS();if(!t||!e)return null;const r=_me[e],{width:s=500,height:i=400,position:c="center",title:u,content:f}=r;return a.jsxs(Sme,{width:s,height:i,position:c,onClose:n,children:[a.jsx(Cme,{onClose:n,children:u&&a.jsx(wme,{children:u})}),a.jsx(Eme,{children:a.jsx(f,{onClose:n})})]})}function Ame(){const e=ZL(Fhe);return a.jsx(vZ,{children:a.jsx(xme,{children:a.jsxs(vme,{children:[a.jsx(Yhe,{}),a.jsx(nme,{}),a.jsx(Nme,{}),a.jsx(oP,{router:e})]})})})}const C8=document.getElementById("root");if(!C8)throw new Error("Root element not found");F9.createRoot(C8).render(a.jsx(h.StrictMode,{children:a.jsx(Ame,{})}));
|