@owox/web 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,683 @@
1
+ var nk=Object.defineProperty;var rk=(e,t,n)=>t in e?nk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var is=(e,t,n)=>rk(e,typeof t!="symbol"?t+"":t,n);function ak(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 l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{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 l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function e_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ty={exports:{}},ed={};/**
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 dR;function sk(){if(dR)return ed;dR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:l}}return ed.Fragment=t,ed.jsx=n,ed.jsxs=n,ed}var fR;function ok(){return fR||(fR=1,Ty.exports=sk()),Ty.exports}var o=ok(),_y={exports:{}},ht={};/**
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 hR;function ik(){if(hR)return ht;hR=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"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function E(L,Z,U){this.props=L,this.context=Z,this.refs=C,this.updater=U||b}E.prototype.isReactComponent={},E.prototype.setState=function(L,Z){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,Z,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function R(){}R.prototype=E.prototype;function T(L,Z,U){this.props=L,this.context=Z,this.refs=C,this.updater=U||b}var _=T.prototype=new R;_.constructor=T,w(_,E.prototype),_.isPureReactComponent=!0;var O=Array.isArray,A={H:null,A:null,T:null,S:null,V:null},j=Object.prototype.hasOwnProperty;function D(L,Z,U,q,le,me){return U=me.ref,{$$typeof:e,type:L,key:Z,ref:U!==void 0?U:null,props:me}}function k(L,Z){return D(L.type,Z,void 0,void 0,void 0,L.props)}function V(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function B(L){var Z={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(U){return Z[U]})}var z=/\/+/g;function J(L,Z){return typeof L=="object"&&L!==null&&L.key!=null?B(""+L.key):Z.toString(36)}function oe(){}function K(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(oe,oe):(L.status="pending",L.then(function(Z){L.status==="pending"&&(L.status="fulfilled",L.value=Z)},function(Z){L.status==="pending"&&(L.status="rejected",L.reason=Z)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function Y(L,Z,U,q,le){var me=typeof L;(me==="undefined"||me==="boolean")&&(L=null);var ve=!1;if(L===null)ve=!0;else switch(me){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(L.$$typeof){case e:case t:ve=!0;break;case g:return ve=L._init,Y(ve(L._payload),Z,U,q,le)}}if(ve)return le=le(L),ve=q===""?"."+J(L,0):q,O(le)?(U="",ve!=null&&(U=ve.replace(z,"$&/")+"/"),Y(le,Z,U,"",function(De){return De})):le!=null&&(V(le)&&(le=k(le,U+(le.key==null||L&&L.key===le.key?"":(""+le.key).replace(z,"$&/")+"/")+ve)),Z.push(le)),1;ve=0;var fe=q===""?".":q+":";if(O(L))for(var Ee=0;Ee<L.length;Ee++)q=L[Ee],me=fe+J(q,Ee),ve+=Y(q,Z,U,me,le);else if(Ee=x(L),typeof Ee=="function")for(L=Ee.call(L),Ee=0;!(q=L.next()).done;)q=q.value,me=fe+J(q,Ee++),ve+=Y(q,Z,U,me,le);else if(me==="object"){if(typeof L.then=="function")return Y(K(L),Z,U,q,le);throw Z=String(L),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return ve}function I(L,Z,U){if(L==null)return L;var q=[],le=0;return Y(L,q,"","",function(me){return Z.call(U,me,le++)}),q}function W(L){if(L._status===-1){var Z=L._result;Z=Z(),Z.then(function(U){(L._status===0||L._status===-1)&&(L._status=1,L._result=U)},function(U){(L._status===0||L._status===-1)&&(L._status=2,L._result=U)}),L._status===-1&&(L._status=0,L._result=Z)}if(L._status===1)return L._result.default;throw L._result}var G=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)};function ie(){}return ht.Children={map:I,forEach:function(L,Z,U){I(L,function(){Z.apply(this,arguments)},U)},count:function(L){var Z=0;return I(L,function(){Z++}),Z},toArray:function(L){return I(L,function(Z){return Z})||[]},only:function(L){if(!V(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},ht.Component=E,ht.Fragment=n,ht.Profiler=s,ht.PureComponent=T,ht.StrictMode=r,ht.Suspense=h,ht.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,ht.__COMPILER_RUNTIME={__proto__:null,c:function(L){return A.H.useMemoCache(L)}},ht.cache=function(L){return function(){return L.apply(null,arguments)}},ht.cloneElement=function(L,Z,U){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var q=w({},L.props),le=L.key,me=void 0;if(Z!=null)for(ve in Z.ref!==void 0&&(me=void 0),Z.key!==void 0&&(le=""+Z.key),Z)!j.call(Z,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&Z.ref===void 0||(q[ve]=Z[ve]);var ve=arguments.length-2;if(ve===1)q.children=U;else if(1<ve){for(var fe=Array(ve),Ee=0;Ee<ve;Ee++)fe[Ee]=arguments[Ee+2];q.children=fe}return D(L.type,le,void 0,void 0,me,q)},ht.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:l,_context:L},L},ht.createElement=function(L,Z,U){var q,le={},me=null;if(Z!=null)for(q in Z.key!==void 0&&(me=""+Z.key),Z)j.call(Z,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(le[q]=Z[q]);var ve=arguments.length-2;if(ve===1)le.children=U;else if(1<ve){for(var fe=Array(ve),Ee=0;Ee<ve;Ee++)fe[Ee]=arguments[Ee+2];le.children=fe}if(L&&L.defaultProps)for(q in ve=L.defaultProps,ve)le[q]===void 0&&(le[q]=ve[q]);return D(L,me,void 0,void 0,null,le)},ht.createRef=function(){return{current:null}},ht.forwardRef=function(L){return{$$typeof:d,render:L}},ht.isValidElement=V,ht.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:W}},ht.memo=function(L,Z){return{$$typeof:m,type:L,compare:Z===void 0?null:Z}},ht.startTransition=function(L){var Z=A.T,U={};A.T=U;try{var q=L(),le=A.S;le!==null&&le(U,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(ie,G)}catch(me){G(me)}finally{A.T=Z}},ht.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},ht.use=function(L){return A.H.use(L)},ht.useActionState=function(L,Z,U){return A.H.useActionState(L,Z,U)},ht.useCallback=function(L,Z){return A.H.useCallback(L,Z)},ht.useContext=function(L){return A.H.useContext(L)},ht.useDebugValue=function(){},ht.useDeferredValue=function(L,Z){return A.H.useDeferredValue(L,Z)},ht.useEffect=function(L,Z,U){var q=A.H;if(typeof U=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return q.useEffect(L,Z)},ht.useId=function(){return A.H.useId()},ht.useImperativeHandle=function(L,Z,U){return A.H.useImperativeHandle(L,Z,U)},ht.useInsertionEffect=function(L,Z){return A.H.useInsertionEffect(L,Z)},ht.useLayoutEffect=function(L,Z){return A.H.useLayoutEffect(L,Z)},ht.useMemo=function(L,Z){return A.H.useMemo(L,Z)},ht.useOptimistic=function(L,Z){return A.H.useOptimistic(L,Z)},ht.useReducer=function(L,Z,U){return A.H.useReducer(L,Z,U)},ht.useRef=function(L){return A.H.useRef(L)},ht.useState=function(L){return A.H.useState(L)},ht.useSyncExternalStore=function(L,Z,U){return A.H.useSyncExternalStore(L,Z,U)},ht.useTransition=function(){return A.H.useTransition()},ht.version="19.1.1",ht}var mR;function Ib(){return mR||(mR=1,_y.exports=ik()),_y.exports}var p=Ib();const je=e_(p),t_=ak({__proto__:null,default:je},[p]);var jy={exports:{}},td={},Ny={exports:{}},Ay={};/**
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 pR;function lk(){return pR||(pR=1,(function(e){function t(I,W){var G=I.length;I.push(W);e:for(;0<G;){var ie=G-1>>>1,L=I[ie];if(0<s(L,W))I[ie]=W,I[G]=L,G=ie;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var W=I[0],G=I.pop();if(G!==W){I[0]=G;e:for(var ie=0,L=I.length,Z=L>>>1;ie<Z;){var U=2*(ie+1)-1,q=I[U],le=U+1,me=I[le];if(0>s(q,G))le<L&&0>s(me,q)?(I[ie]=me,I[le]=G,ie=le):(I[ie]=q,I[U]=G,ie=U);else if(le<L&&0>s(me,G))I[ie]=me,I[le]=G,ie=le;else break e}}return W}function s(I,W){var G=I.sortIndex-W.sortIndex;return G!==0?G:I.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],m=[],g=1,v=null,x=3,b=!1,w=!1,C=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function O(I){for(var W=n(m);W!==null;){if(W.callback===null)r(m);else if(W.startTime<=I)r(m),W.sortIndex=W.expirationTime,t(h,W);else break;W=n(m)}}function A(I){if(C=!1,O(I),!w)if(n(h)!==null)w=!0,j||(j=!0,J());else{var W=n(m);W!==null&&Y(A,W.startTime-I)}}var j=!1,D=-1,k=5,V=-1;function B(){return E?!0:!(e.unstable_now()-V<k)}function z(){if(E=!1,j){var I=e.unstable_now();V=I;var W=!0;try{e:{w=!1,C&&(C=!1,T(D),D=-1),b=!0;var G=x;try{t:{for(O(I),v=n(h);v!==null&&!(v.expirationTime>I&&B());){var ie=v.callback;if(typeof ie=="function"){v.callback=null,x=v.priorityLevel;var L=ie(v.expirationTime<=I);if(I=e.unstable_now(),typeof L=="function"){v.callback=L,O(I),W=!0;break t}v===n(h)&&r(h),O(I)}else r(h);v=n(h)}if(v!==null)W=!0;else{var Z=n(m);Z!==null&&Y(A,Z.startTime-I),W=!1}}break e}finally{v=null,x=G,b=!1}W=void 0}}finally{W?J():j=!1}}}var J;if(typeof _=="function")J=function(){_(z)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,K=oe.port2;oe.port1.onmessage=z,J=function(){K.postMessage(null)}}else J=function(){R(z,0)};function Y(I,W){D=R(function(){I(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(I){switch(x){case 1:case 2:case 3:var W=3;break;default:W=x}var G=x;x=W;try{return I()}finally{x=G}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(I,W){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var G=x;x=I;try{return W()}finally{x=G}},e.unstable_scheduleCallback=function(I,W,G){var ie=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?ie+G:ie):G=ie,I){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=G+L,I={id:g++,callback:W,priorityLevel:I,startTime:G,expirationTime:L,sortIndex:-1},G>ie?(I.sortIndex=G,t(m,I),n(h)===null&&I===n(m)&&(C?(T(D),D=-1):C=!0,Y(A,G-ie))):(I.sortIndex=L,t(h,I),w||b||(w=!0,j||(j=!0,J()))),I},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(I){var W=x;return function(){var G=x;x=W;try{return I.apply(this,arguments)}finally{x=G}}}})(Ay)),Ay}var gR;function ck(){return gR||(gR=1,Ny.exports=lk()),Ny.exports}var Dy={exports:{}},hr={};/**
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 vR;function uk(){if(vR)return hr;vR=1;var e=Ib();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var 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 l(h,m,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:h,containerInfo:m,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return hr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,hr.createPortal=function(h,m){var g=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 l(h,m,null,g)},hr.flushSync=function(h){var m=c.T,g=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=m,r.p=g,r.d.f()}},hr.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(h,m))},hr.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},hr.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,v=d(g,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?r.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:b}):g==="script"&&r.d.X(h,{crossOrigin:v,integrity:x,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},hr.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=d(m.as,m.crossOrigin);r.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(h)},hr.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,v=d(g,m.crossOrigin);r.d.L(h,g,{crossOrigin:v,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})}},hr.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=d(m.as,m.crossOrigin);r.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(h)},hr.requestFormReset=function(h){r.d.r(h)},hr.unstable_batchedUpdates=function(h,m){return h(m)},hr.useFormState=function(h,m,g){return c.H.useFormState(h,m,g)},hr.useFormStatus=function(){return c.H.useHostTransitionStatus()},hr.version="19.1.1",hr}var yR;function n_(){if(yR)return Dy.exports;yR=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(),Dy.exports=uk(),Dy.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 xR;function dk(){if(xR)return td;xR=1;var e=ck(),t=Ib(),n=n_();function r(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var i=a,u=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(u=i.return),a=i.return;while(a)}return i.tag===3?u:null}function c(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function d(a){if(l(a)!==a)throw Error(r(188))}function h(a){var i=a.alternate;if(!i){if(i=l(a),i===null)throw Error(r(188));return i!==a?null:a}for(var u=a,f=i;;){var y=u.return;if(y===null)break;var S=y.alternate;if(S===null){if(f=y.return,f!==null){u=f;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===u)return d(y),a;if(S===f)return d(y),i;S=S.sibling}throw Error(r(188))}if(u.return!==f.return)u=y,f=S;else{for(var N=!1,M=y.child;M;){if(M===u){N=!0,u=y,f=S;break}if(M===f){N=!0,f=y,u=S;break}M=M.sibling}if(!N){for(M=S.child;M;){if(M===u){N=!0,u=S,f=y;break}if(M===f){N=!0,f=S,u=y;break}M=M.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==f)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:i}function m(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=m(a),i!==null)return i;a=a.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),T=Symbol.for("react.consumer"),_=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function J(a){return a===null||typeof a!="object"?null:(a=z&&a[z]||a["@@iterator"],typeof a=="function"?a:null)}var oe=Symbol.for("react.client.reference");function K(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===oe?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case w:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case j:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case b:return"Portal";case _:return(a.displayName||"Context")+".Provider";case T:return(a._context.displayName||"Context")+".Consumer";case O:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case D:return i=a.displayName||null,i!==null?i:K(a.type)||"Memo";case k:i=a._payload,a=a._init;try{return K(a(i))}catch{}}return null}var Y=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},ie=[],L=-1;function Z(a){return{current:a}}function U(a){0>L||(a.current=ie[L],ie[L]=null,L--)}function q(a,i){L++,ie[L]=a.current,a.current=i}var le=Z(null),me=Z(null),ve=Z(null),fe=Z(null);function Ee(a,i){switch(q(ve,i),q(me,a),q(le,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?FE(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=FE(i),a=HE(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}U(le),q(le,a)}function De(){U(le),U(me),U(ve)}function be(a){a.memoizedState!==null&&q(fe,a);var i=le.current,u=HE(i,a.type);i!==u&&(q(me,a),q(le,u))}function Je(a){me.current===a&&(U(le),U(me)),fe.current===a&&(U(fe),Yu._currentValue=G)}var Xe=Object.prototype.hasOwnProperty,Ht=e.unstable_scheduleCallback,Ne=e.unstable_cancelCallback,vt=e.unstable_shouldYield,ut=e.unstable_requestPaint,Tt=e.unstable_now,Ia=e.unstable_getCurrentPriorityLevel,ur=e.unstable_ImmediatePriority,H=e.unstable_UserBlockingPriority,te=e.unstable_NormalPriority,ue=e.unstable_LowPriority,_e=e.unstable_IdlePriority,Re=e.log,Ce=e.unstable_setDisableYieldValue,ke=null,Be=null;function ct(a){if(typeof Re=="function"&&Ce(a),Be&&typeof Be.setStrictMode=="function")try{Be.setStrictMode(ke,a)}catch{}}var Et=Math.clz32?Math.clz32:As,La=Math.log,Wt=Math.LN2;function As(a){return a>>>=0,a===0?32:31-(La(a)/Wt|0)|0}var Vr=256,zr=4194304;function Sr(a){var i=a&42;if(i!==0)return i;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function $r(a,i,u){var f=a.pendingLanes;if(f===0)return 0;var y=0,S=a.suspendedLanes,N=a.pingedLanes;a=a.warmLanes;var M=f&134217727;return M!==0?(f=M&~S,f!==0?y=Sr(f):(N&=M,N!==0?y=Sr(N):u||(u=M&~a,u!==0&&(y=Sr(u))))):(M=f&~S,M!==0?y=Sr(M):N!==0?y=Sr(N):u||(u=f&~a,u!==0&&(y=Sr(u)))),y===0?0:i!==0&&i!==y&&(i&S)===0&&(S=y&-y,u=i&-i,S>=u||S===32&&(u&4194048)!==0)?i:y}function Ar(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function es(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 po(){var a=Vr;return Vr<<=1,(Vr&4194048)===0&&(Vr=256),a}function Tl(){var a=zr;return zr<<=1,(zr&62914560)===0&&(zr=4194304),a}function go(a){for(var i=[],u=0;31>u;u++)i.push(a);return i}function on(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Yn(a,i,u,f,y,S){var N=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var M=a.entanglements,P=a.expirationTimes,re=a.hiddenUpdates;for(u=N&~u;0<u;){var he=31-Et(u),ye=1<<he;M[he]=0,P[he]=-1;var ae=re[he];if(ae!==null)for(re[he]=null,he=0;he<ae.length;he++){var se=ae[he];se!==null&&(se.lane&=-536870913)}u&=~ye}f!==0&&Sn(a,f,0),S!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=S&~(N&~i))}function Sn(a,i,u){a.pendingLanes|=i,a.suspendedLanes&=~i;var f=31-Et(i);a.entangledLanes|=i,a.entanglements[f]=a.entanglements[f]|1073741824|u&4194090}function dr(a,i){var u=a.entangledLanes|=i;for(a=a.entanglements;u;){var f=31-Et(u),y=1<<f;y&i|a[f]&i&&(a[f]|=i),u&=~y}}function Wn(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Fn(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function F(){var a=W.p;return a!==0?a:(a=window.event,a===void 0?32:sR(a.type))}function X(a,i){var u=W.p;try{return W.p=a,i()}finally{W.p=u}}var ne=Math.random().toString(36).slice(2),pe="__reactFiber$"+ne,xe="__reactProps$"+ne,Oe="__reactContainer$"+ne,Ue="__reactEvents$"+ne,Le="__reactListeners$"+ne,Fe="__reactHandles$"+ne,Ye="__reactResources$"+ne,qe="__reactMarker$"+ne;function Ke(a){delete a[pe],delete a[xe],delete a[Ue],delete a[Le],delete a[Fe]}function st(a){var i=a[pe];if(i)return i;for(var u=a.parentNode;u;){if(i=u[Oe]||u[pe]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(a=BE(a);a!==null;){if(u=a[pe])return u;a=BE(a)}return i}a=u,u=a.parentNode}return null}function Lt(a){if(a=a[pe]||a[Oe]){var i=a.tag;if(i===5||i===6||i===13||i===26||i===27||i===3)return a}return null}function mn(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function pn(a){var i=a[Ye];return i||(i=a[Ye]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function dt(a){a[qe]=!0}var Qt=new Set,ts={};function Br(a,i){Cr(a,i),Cr(a+"Capture",i)}function Cr(a,i){for(ts[a]=i,a=0;a<i.length;a++)Qt.add(i[a])}var ma=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]*$"),_l={},vo={};function Ds(a){return Xe.call(vo,a)?!0:Xe.call(_l,a)?!1:ma.test(a)?vo[a]=!0:(_l[a]=!0,!1)}function Os(a,i,u){if(Ds(i))if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+u)}}function Ms(a,i,u){if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(i);return}a.setAttribute(i,""+u)}}function pt(a,i,u,f){if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(i,u,""+f)}}var jn,Ni;function pa(a){if(jn===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);jn=i&&i[1]||"",Ni=-1<u.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+jn+a+Ni}var cn=!1;function yo(a,i){if(!a||cn)return"";cn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(se){var ae=se}Reflect.construct(a,[],ye)}else{try{ye.call()}catch(se){ae=se}a.call(ye.prototype)}}else{try{throw Error()}catch(se){ae=se}(ye=a())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(se){if(se&&ae&&typeof se.stack=="string")return[se.stack,ae.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=f.DetermineComponentFrameRoot(),N=S[0],M=S[1];if(N&&M){var P=N.split(`
44
+ `),re=M.split(`
45
+ `);for(y=f=0;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;for(;y<re.length&&!re[y].includes("DetermineComponentFrameRoot");)y++;if(f===P.length||y===re.length)for(f=P.length-1,y=re.length-1;1<=f&&0<=y&&P[f]!==re[y];)y--;for(;1<=f&&0<=y;f--,y--)if(P[f]!==re[y]){if(f!==1||y!==1)do if(f--,y--,0>y||P[f]!==re[y]){var he=`
46
+ `+P[f].replace(" at new "," at ");return a.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",a.displayName)),he}while(1<=f&&0<=y);break}}}finally{cn=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?pa(u):""}function Nf(a){switch(a.tag){case 26:case 27:case 5:return pa(a.type);case 16:return pa("Lazy");case 13:return pa("Suspense");case 19:return pa("SuspenseList");case 0:case 15:return yo(a.type,!1);case 11:return yo(a.type.render,!1);case 1:return yo(a.type,!0);case 31:return pa("Activity");default:return""}}function Af(a){try{var i="";do i+=Nf(a),a=a.return;while(a);return i}catch(u){return`
47
+ Error generating stack: `+u.message+`
48
+ `+u.stack}}function ga(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function kS(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Q4(a){var i=kS(a)?"checked":"value",u=Object.getOwnPropertyDescriptor(a.constructor.prototype,i),f=""+a[i];if(!a.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,S=u.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return y.call(this)},set:function(N){f=""+N,S.call(this,N)}}),Object.defineProperty(a,i,{enumerable:u.enumerable}),{getValue:function(){return f},setValue:function(N){f=""+N},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function Df(a){a._valueTracker||(a._valueTracker=Q4(a))}function IS(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var u=i.getValue(),f="";return a&&(f=kS(a)?a.checked?"true":"false":a.value),a=f,a!==u?(i.setValue(a),!0):!1}function Of(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var X4=/[\n"\\]/g;function va(a){return a.replace(X4,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function wg(a,i,u,f,y,S,N,M){a.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.type=N:a.removeAttribute("type"),i!=null?N==="number"?(i===0&&a.value===""||a.value!=i)&&(a.value=""+ga(i)):a.value!==""+ga(i)&&(a.value=""+ga(i)):N!=="submit"&&N!=="reset"||a.removeAttribute("value"),i!=null?Eg(a,N,ga(i)):u!=null?Eg(a,N,ga(u)):f!=null&&a.removeAttribute("value"),y==null&&S!=null&&(a.defaultChecked=!!S),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.name=""+ga(M):a.removeAttribute("name")}function LS(a,i,u,f,y,S,N,M){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),i!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||i!=null))return;u=u!=null?""+ga(u):"",i=i!=null?""+ga(i):u,M||i===a.value||(a.value=i),a.defaultValue=i}f=f??y,f=typeof f!="function"&&typeof f!="symbol"&&!!f,a.checked=M?a.checked:!!f,a.defaultChecked=!!f,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.name=N)}function Eg(a,i,u){i==="number"&&Of(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function jl(a,i,u,f){if(a=a.options,i){i={};for(var y=0;y<u.length;y++)i["$"+u[y]]=!0;for(u=0;u<a.length;u++)y=i.hasOwnProperty("$"+a[u].value),a[u].selected!==y&&(a[u].selected=y),y&&f&&(a[u].defaultSelected=!0)}else{for(u=""+ga(u),i=null,y=0;y<a.length;y++){if(a[y].value===u){a[y].selected=!0,f&&(a[y].defaultSelected=!0);return}i!==null||a[y].disabled||(i=a[y])}i!==null&&(i.selected=!0)}}function PS(a,i,u){if(i!=null&&(i=""+ga(i),i!==a.value&&(a.value=i),u==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=u!=null?""+ga(u):""}function US(a,i,u,f){if(i==null){if(f!=null){if(u!=null)throw Error(r(92));if(Y(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),i=u}u=ga(i),a.defaultValue=u,f=a.textContent,f===u&&f!==""&&f!==null&&(a.value=f)}function Nl(a,i){if(i){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=i;return}}a.textContent=i}var J4=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 FS(a,i,u){var f=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":f?a.setProperty(i,u):typeof u!="number"||u===0||J4.has(i)?i==="float"?a.cssFloat=u:a[i]=(""+u).trim():a[i]=u+"px"}function HS(a,i,u){if(i!=null&&typeof i!="object")throw Error(r(62));if(a=a.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?a.setProperty(f,""):f==="float"?a.cssFloat="":a[f]="");for(var y in i)f=i[y],i.hasOwnProperty(y)&&u[y]!==f&&FS(a,y,f)}else for(var S in i)i.hasOwnProperty(S)&&FS(a,S,i[S])}function Rg(a){if(a.indexOf("-")===-1)return!1;switch(a){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 e3=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"]]),t3=/^[\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 Mf(a){return t3.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var Tg=null;function _g(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Al=null,Dl=null;function VS(a){var i=Lt(a);if(i&&(a=i.stateNode)){var u=a[xe]||null;e:switch(a=i.stateNode,i.type){case"input":if(wg(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+va(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var f=u[i];if(f!==a&&f.form===a.form){var y=f[xe]||null;if(!y)throw Error(r(90));wg(f,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(i=0;i<u.length;i++)f=u[i],f.form===a.form&&IS(f)}break e;case"textarea":PS(a,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&jl(a,!!u.multiple,i,!1)}}}var jg=!1;function zS(a,i,u){if(jg)return a(i,u);jg=!0;try{var f=a(i);return f}finally{if(jg=!1,(Al!==null||Dl!==null)&&(yh(),Al&&(i=Al,a=Dl,Dl=Al=null,VS(i),a)))for(i=0;i<a.length;i++)VS(a[i])}}function lu(a,i){var u=a.stateNode;if(u===null)return null;var f=u[xe]||null;if(f===null)return null;u=f[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(a=a.type,f=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!f;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,i,typeof u));return u}var ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ng=!1;if(ks)try{var cu={};Object.defineProperty(cu,"passive",{get:function(){Ng=!0}}),window.addEventListener("test",cu,cu),window.removeEventListener("test",cu,cu)}catch{Ng=!1}var xo=null,Ag=null,kf=null;function $S(){if(kf)return kf;var a,i=Ag,u=i.length,f,y="value"in xo?xo.value:xo.textContent,S=y.length;for(a=0;a<u&&i[a]===y[a];a++);var N=u-a;for(f=1;f<=N&&i[u-f]===y[S-f];f++);return kf=y.slice(a,1<f?1-f:void 0)}function If(a){var i=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&i===13&&(a=13)):a=i,a===10&&(a=13),32<=a||a===13?a:0}function Lf(){return!0}function BS(){return!1}function Dr(a){function i(u,f,y,S,N){this._reactName=u,this._targetInst=y,this.type=f,this.nativeEvent=S,this.target=N,this.currentTarget=null;for(var M in a)a.hasOwnProperty(M)&&(u=a[M],this[M]=u?u(S):S[M]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Lf:BS,this.isPropagationStopped=BS,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Lf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Lf)},persist:function(){},isPersistent:Lf}),i}var Ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pf=Dr(Ai),uu=g({},Ai,{view:0,detail:0}),n3=Dr(uu),Dg,Og,du,Uf=g({},uu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kg,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==du&&(du&&a.type==="mousemove"?(Dg=a.screenX-du.screenX,Og=a.screenY-du.screenY):Og=Dg=0,du=a),Dg)},movementY:function(a){return"movementY"in a?a.movementY:Og}}),GS=Dr(Uf),r3=g({},Uf,{dataTransfer:0}),a3=Dr(r3),s3=g({},uu,{relatedTarget:0}),Mg=Dr(s3),o3=g({},Ai,{animationName:0,elapsedTime:0,pseudoElement:0}),i3=Dr(o3),l3=g({},Ai,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),c3=Dr(l3),u3=g({},Ai,{data:0}),qS=Dr(u3),d3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f3={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"},h3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function m3(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=h3[a])?!!i[a]:!1}function kg(){return m3}var p3=g({},uu,{key:function(a){if(a.key){var i=d3[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=If(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?f3[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kg,charCode:function(a){return a.type==="keypress"?If(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?If(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),g3=Dr(p3),v3=g({},Uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),KS=Dr(v3),y3=g({},uu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kg}),x3=Dr(y3),b3=g({},Ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),S3=Dr(b3),C3=g({},Uf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),w3=Dr(C3),E3=g({},Ai,{newState:0,oldState:0}),R3=Dr(E3),T3=[9,13,27,32],Ig=ks&&"CompositionEvent"in window,fu=null;ks&&"documentMode"in document&&(fu=document.documentMode);var _3=ks&&"TextEvent"in window&&!fu,ZS=ks&&(!Ig||fu&&8<fu&&11>=fu),YS=" ",WS=!1;function QS(a,i){switch(a){case"keyup":return T3.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XS(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ol=!1;function j3(a,i){switch(a){case"compositionend":return XS(i);case"keypress":return i.which!==32?null:(WS=!0,YS);case"textInput":return a=i.data,a===YS&&WS?null:a;default:return null}}function N3(a,i){if(Ol)return a==="compositionend"||!Ig&&QS(a,i)?(a=$S(),kf=Ag=xo=null,Ol=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return ZS&&i.locale!=="ko"?null:i.data;default:return null}}var A3={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 JS(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!A3[a.type]:i==="textarea"}function eC(a,i,u,f){Al?Dl?Dl.push(f):Dl=[f]:Al=f,i=Eh(i,"onChange"),0<i.length&&(u=new Pf("onChange","change",null,u,f),a.push({event:u,listeners:i}))}var hu=null,mu=null;function D3(a){kE(a,0)}function Ff(a){var i=mn(a);if(IS(i))return a}function tC(a,i){if(a==="change")return i}var nC=!1;if(ks){var Lg;if(ks){var Pg="oninput"in document;if(!Pg){var rC=document.createElement("div");rC.setAttribute("oninput","return;"),Pg=typeof rC.oninput=="function"}Lg=Pg}else Lg=!1;nC=Lg&&(!document.documentMode||9<document.documentMode)}function aC(){hu&&(hu.detachEvent("onpropertychange",sC),mu=hu=null)}function sC(a){if(a.propertyName==="value"&&Ff(mu)){var i=[];eC(i,mu,a,_g(a)),zS(D3,i)}}function O3(a,i,u){a==="focusin"?(aC(),hu=i,mu=u,hu.attachEvent("onpropertychange",sC)):a==="focusout"&&aC()}function M3(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Ff(mu)}function k3(a,i){if(a==="click")return Ff(i)}function I3(a,i){if(a==="input"||a==="change")return Ff(i)}function L3(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var Gr=typeof Object.is=="function"?Object.is:L3;function pu(a,i){if(Gr(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var u=Object.keys(a),f=Object.keys(i);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var y=u[f];if(!Xe.call(i,y)||!Gr(a[y],i[y]))return!1}return!0}function oC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function iC(a,i){var u=oC(a);a=0;for(var f;u;){if(u.nodeType===3){if(f=a+u.textContent.length,a<=i&&f>=i)return{node:u,offset:i-a};a=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=oC(u)}}function lC(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?lC(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function cC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=Of(a.document);i instanceof a.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)a=i.contentWindow;else break;i=Of(a.document)}return i}function Ug(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i&&(i==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||i==="textarea"||a.contentEditable==="true")}var P3=ks&&"documentMode"in document&&11>=document.documentMode,Ml=null,Fg=null,gu=null,Hg=!1;function uC(a,i,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Hg||Ml==null||Ml!==Of(f)||(f=Ml,"selectionStart"in f&&Ug(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),gu&&pu(gu,f)||(gu=f,f=Eh(Fg,"onSelect"),0<f.length&&(i=new Pf("onSelect","select",null,i,u),a.push({event:i,listeners:f}),i.target=Ml)))}function Di(a,i){var u={};return u[a.toLowerCase()]=i.toLowerCase(),u["Webkit"+a]="webkit"+i,u["Moz"+a]="moz"+i,u}var kl={animationend:Di("Animation","AnimationEnd"),animationiteration:Di("Animation","AnimationIteration"),animationstart:Di("Animation","AnimationStart"),transitionrun:Di("Transition","TransitionRun"),transitionstart:Di("Transition","TransitionStart"),transitioncancel:Di("Transition","TransitionCancel"),transitionend:Di("Transition","TransitionEnd")},Vg={},dC={};ks&&(dC=document.createElement("div").style,"AnimationEvent"in window||(delete kl.animationend.animation,delete kl.animationiteration.animation,delete kl.animationstart.animation),"TransitionEvent"in window||delete kl.transitionend.transition);function Oi(a){if(Vg[a])return Vg[a];if(!kl[a])return a;var i=kl[a],u;for(u in i)if(i.hasOwnProperty(u)&&u in dC)return Vg[a]=i[u];return a}var fC=Oi("animationend"),hC=Oi("animationiteration"),mC=Oi("animationstart"),U3=Oi("transitionrun"),F3=Oi("transitionstart"),H3=Oi("transitioncancel"),pC=Oi("transitionend"),gC=new Map,zg="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(" ");zg.push("scrollEnd");function Pa(a,i){gC.set(a,i),Br(i,[a])}var vC=new WeakMap;function ya(a,i){if(typeof a=="object"&&a!==null){var u=vC.get(a);return u!==void 0?u:(i={value:a,source:i,stack:Af(i)},vC.set(a,i),i)}return{value:a,source:i,stack:Af(i)}}var xa=[],Il=0,$g=0;function Hf(){for(var a=Il,i=$g=Il=0;i<a;){var u=xa[i];xa[i++]=null;var f=xa[i];xa[i++]=null;var y=xa[i];xa[i++]=null;var S=xa[i];if(xa[i++]=null,f!==null&&y!==null){var N=f.pending;N===null?y.next=y:(y.next=N.next,N.next=y),f.pending=y}S!==0&&yC(u,y,S)}}function Vf(a,i,u,f){xa[Il++]=a,xa[Il++]=i,xa[Il++]=u,xa[Il++]=f,$g|=f,a.lanes|=f,a=a.alternate,a!==null&&(a.lanes|=f)}function Bg(a,i,u,f){return Vf(a,i,u,f),zf(a)}function Ll(a,i){return Vf(a,null,null,i),zf(a)}function yC(a,i,u){a.lanes|=u;var f=a.alternate;f!==null&&(f.lanes|=u);for(var y=!1,S=a.return;S!==null;)S.childLanes|=u,f=S.alternate,f!==null&&(f.childLanes|=u),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(y=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,y&&i!==null&&(y=31-Et(u),a=S.hiddenUpdates,f=a[y],f===null?a[y]=[i]:f.push(i),i.lane=u|536870912),S):null}function zf(a){if(50<Vu)throw Vu=0,Wv=null,Error(r(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var Pl={};function V3(a,i,u,f){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qr(a,i,u,f){return new V3(a,i,u,f)}function Gg(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Is(a,i){var u=a.alternate;return u===null?(u=qr(a.tag,i,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=i,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,i=a.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function xC(a,i){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=i,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,i=u.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),a}function $f(a,i,u,f,y,S){var N=0;if(f=a,typeof a=="function")Gg(a)&&(N=1);else if(typeof a=="string")N=$M(a,u,le.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case V:return a=qr(31,u,i,y),a.elementType=V,a.lanes=S,a;case w:return Mi(u.children,y,S,i);case C:N=8,y|=24;break;case E:return a=qr(12,u,i,y|2),a.elementType=E,a.lanes=S,a;case A:return a=qr(13,u,i,y),a.elementType=A,a.lanes=S,a;case j:return a=qr(19,u,i,y),a.elementType=j,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case R:case _:N=10;break e;case T:N=9;break e;case O:N=11;break e;case D:N=14;break e;case k:N=16,f=null;break e}N=29,u=Error(r(130,a===null?"null":typeof a,"")),f=null}return i=qr(N,u,i,y),i.elementType=a,i.type=f,i.lanes=S,i}function Mi(a,i,u,f){return a=qr(7,a,f,i),a.lanes=u,a}function qg(a,i,u){return a=qr(6,a,null,i),a.lanes=u,a}function Kg(a,i,u){return i=qr(4,a.children!==null?a.children:[],a.key,i),i.lanes=u,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}var Ul=[],Fl=0,Bf=null,Gf=0,ba=[],Sa=0,ki=null,Ls=1,Ps="";function Ii(a,i){Ul[Fl++]=Gf,Ul[Fl++]=Bf,Bf=a,Gf=i}function bC(a,i,u){ba[Sa++]=Ls,ba[Sa++]=Ps,ba[Sa++]=ki,ki=a;var f=Ls;a=Ps;var y=32-Et(f)-1;f&=~(1<<y),u+=1;var S=32-Et(i)+y;if(30<S){var N=y-y%5;S=(f&(1<<N)-1).toString(32),f>>=N,y-=N,Ls=1<<32-Et(i)+y|u<<y|f,Ps=S+a}else Ls=1<<S|u<<y|f,Ps=a}function Zg(a){a.return!==null&&(Ii(a,1),bC(a,1,0))}function Yg(a){for(;a===Bf;)Bf=Ul[--Fl],Ul[Fl]=null,Gf=Ul[--Fl],Ul[Fl]=null;for(;a===ki;)ki=ba[--Sa],ba[Sa]=null,Ps=ba[--Sa],ba[Sa]=null,Ls=ba[--Sa],ba[Sa]=null}var wr=null,gn=null,Pt=!1,Li=null,ns=!1,Wg=Error(r(519));function Pi(a){var i=Error(r(418,""));throw xu(ya(i,a)),Wg}function SC(a){var i=a.stateNode,u=a.type,f=a.memoizedProps;switch(i[pe]=a,i[xe]=f,u){case"dialog":wt("cancel",i),wt("close",i);break;case"iframe":case"object":case"embed":wt("load",i);break;case"video":case"audio":for(u=0;u<$u.length;u++)wt($u[u],i);break;case"source":wt("error",i);break;case"img":case"image":case"link":wt("error",i),wt("load",i);break;case"details":wt("toggle",i);break;case"input":wt("invalid",i),LS(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0),Df(i);break;case"select":wt("invalid",i);break;case"textarea":wt("invalid",i),US(i,f.value,f.defaultValue,f.children),Df(i)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||f.suppressHydrationWarning===!0||UE(i.textContent,u)?(f.popover!=null&&(wt("beforetoggle",i),wt("toggle",i)),f.onScroll!=null&&wt("scroll",i),f.onScrollEnd!=null&&wt("scrollend",i),f.onClick!=null&&(i.onclick=Rh),i=!0):i=!1,i||Pi(a)}function CC(a){for(wr=a.return;wr;)switch(wr.tag){case 5:case 13:ns=!1;return;case 27:case 3:ns=!0;return;default:wr=wr.return}}function vu(a){if(a!==wr)return!1;if(!Pt)return CC(a),Pt=!0,!1;var i=a.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||fy(a.type,a.memoizedProps)),u=!u),u&&gn&&Pi(a),CC(a),i===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));e:{for(a=a.nextSibling,i=0;a;){if(a.nodeType===8)if(u=a.data,u==="/$"){if(i===0){gn=Fa(a.nextSibling);break e}i--}else u!=="$"&&u!=="$!"&&u!=="$?"||i++;a=a.nextSibling}gn=null}}else i===27?(i=gn,Io(a.type)?(a=gy,gy=null,gn=a):gn=i):gn=wr?Fa(a.stateNode.nextSibling):null;return!0}function yu(){gn=wr=null,Pt=!1}function wC(){var a=Li;return a!==null&&(kr===null?kr=a:kr.push.apply(kr,a),Li=null),a}function xu(a){Li===null?Li=[a]:Li.push(a)}var Qg=Z(null),Ui=null,Us=null;function bo(a,i,u){q(Qg,i._currentValue),i._currentValue=u}function Fs(a){a._currentValue=Qg.current,U(Qg)}function Xg(a,i,u){for(;a!==null;){var f=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),a===u)break;a=a.return}}function Jg(a,i,u,f){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var S=y.dependencies;if(S!==null){var N=y.child;S=S.firstContext;e:for(;S!==null;){var M=S;S=y;for(var P=0;P<i.length;P++)if(M.context===i[P]){S.lanes|=u,M=S.alternate,M!==null&&(M.lanes|=u),Xg(S.return,u,a),f||(N=null);break e}S=M.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(r(341));N.lanes|=u,S=N.alternate,S!==null&&(S.lanes|=u),Xg(N,u,a),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===a){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function bu(a,i,u,f){a=null;for(var y=i,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var M=y.type;Gr(y.pendingProps.value,N.value)||(a!==null?a.push(M):a=[M])}}else if(y===fe.current){if(N=y.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(Yu):a=[Yu])}y=y.return}a!==null&&Jg(i,a,u,f),i.flags|=262144}function qf(a){for(a=a.firstContext;a!==null;){if(!Gr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Fi(a){Ui=a,Us=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function fr(a){return EC(Ui,a)}function Kf(a,i){return Ui===null&&Fi(a),EC(a,i)}function EC(a,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},Us===null){if(a===null)throw Error(r(308));Us=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else Us=Us.next=i;return u}var z3=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(u,f){a.push(f)}};this.abort=function(){i.aborted=!0,a.forEach(function(u){return u()})}},$3=e.unstable_scheduleCallback,B3=e.unstable_NormalPriority,Hn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ev(){return{controller:new z3,data:new Map,refCount:0}}function Su(a){a.refCount--,a.refCount===0&&$3(B3,function(){a.controller.abort()})}var Cu=null,tv=0,Hl=0,Vl=null;function G3(a,i){if(Cu===null){var u=Cu=[];tv=0,Hl=ry(),Vl={status:"pending",value:void 0,then:function(f){u.push(f)}}}return tv++,i.then(RC,RC),i}function RC(){if(--tv===0&&Cu!==null){Vl!==null&&(Vl.status="fulfilled");var a=Cu;Cu=null,Hl=0,Vl=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function q3(a,i){var u=[],f={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return a.then(function(){f.status="fulfilled",f.value=i;for(var y=0;y<u.length;y++)(0,u[y])(i)},function(y){for(f.status="rejected",f.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),f}var TC=I.S;I.S=function(a,i){typeof i=="object"&&i!==null&&typeof i.then=="function"&&G3(a,i),TC!==null&&TC(a,i)};var Hi=Z(null);function nv(){var a=Hi.current;return a!==null?a:sn.pooledCache}function Zf(a,i){i===null?q(Hi,Hi.current):q(Hi,i.pool)}function _C(){var a=nv();return a===null?null:{parent:Hn._currentValue,pool:a}}var wu=Error(r(460)),jC=Error(r(474)),Yf=Error(r(542)),rv={then:function(){}};function NC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Wf(){}function AC(a,i,u){switch(u=a[u],u===void 0?a.push(i):u!==i&&(i.then(Wf,Wf),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,OC(a),a;default:if(typeof i.status=="string")i.then(Wf,Wf);else{if(a=sn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=i,a.status="pending",a.then(function(f){if(i.status==="pending"){var y=i;y.status="fulfilled",y.value=f}},function(f){if(i.status==="pending"){var y=i;y.status="rejected",y.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,OC(a),a}throw Eu=i,wu}}var Eu=null;function DC(){if(Eu===null)throw Error(r(459));var a=Eu;return Eu=null,a}function OC(a){if(a===wu||a===Yf)throw Error(r(483))}var So=!1;function av(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sv(a,i){a=a.updateQueue,i.updateQueue===a&&(i.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Co(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function wo(a,i,u){var f=a.updateQueue;if(f===null)return null;if(f=f.shared,($t&2)!==0){var y=f.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),f.pending=i,i=zf(a),yC(a,null,u),i}return Vf(a,f,i,u),zf(a)}function Ru(a,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var f=i.lanes;f&=a.pendingLanes,u|=f,i.lanes=u,dr(a,u)}}function ov(a,i){var u=a.updateQueue,f=a.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var y=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var N={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?y=S=N:S=S.next=N,u=u.next}while(u!==null);S===null?y=S=i:S=S.next=i}else y=S=i;u={baseState:f.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:f.shared,callbacks:f.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=i:a.next=i,u.lastBaseUpdate=i}var iv=!1;function Tu(){if(iv){var a=Vl;if(a!==null)throw a}}function _u(a,i,u,f){iv=!1;var y=a.updateQueue;So=!1;var S=y.firstBaseUpdate,N=y.lastBaseUpdate,M=y.shared.pending;if(M!==null){y.shared.pending=null;var P=M,re=P.next;P.next=null,N===null?S=re:N.next=re,N=P;var he=a.alternate;he!==null&&(he=he.updateQueue,M=he.lastBaseUpdate,M!==N&&(M===null?he.firstBaseUpdate=re:M.next=re,he.lastBaseUpdate=P))}if(S!==null){var ye=y.baseState;N=0,he=re=P=null,M=S;do{var ae=M.lane&-536870913,se=ae!==M.lane;if(se?(_t&ae)===ae:(f&ae)===ae){ae!==0&&ae===Hl&&(iv=!0),he!==null&&(he=he.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ot=a,et=M;ae=i;var en=u;switch(et.tag){case 1:if(ot=et.payload,typeof ot=="function"){ye=ot.call(en,ye,ae);break e}ye=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=et.payload,ae=typeof ot=="function"?ot.call(en,ye,ae):ot,ae==null)break e;ye=g({},ye,ae);break e;case 2:So=!0}}ae=M.callback,ae!==null&&(a.flags|=64,se&&(a.flags|=8192),se=y.callbacks,se===null?y.callbacks=[ae]:se.push(ae))}else se={lane:ae,tag:M.tag,payload:M.payload,callback:M.callback,next:null},he===null?(re=he=se,P=ye):he=he.next=se,N|=ae;if(M=M.next,M===null){if(M=y.shared.pending,M===null)break;se=M,M=se.next,se.next=null,y.lastBaseUpdate=se,y.shared.pending=null}}while(!0);he===null&&(P=ye),y.baseState=P,y.firstBaseUpdate=re,y.lastBaseUpdate=he,S===null&&(y.shared.lanes=0),Do|=N,a.lanes=N,a.memoizedState=ye}}function MC(a,i){if(typeof a!="function")throw Error(r(191,a));a.call(i)}function kC(a,i){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)MC(u[a],i)}var zl=Z(null),Qf=Z(0);function IC(a,i){a=qs,q(Qf,a),q(zl,i),qs=a|i.baseLanes}function lv(){q(Qf,qs),q(zl,zl.current)}function cv(){qs=Qf.current,U(zl),U(Qf)}var Eo=0,yt=null,Xt=null,Nn=null,Xf=!1,$l=!1,Vi=!1,Jf=0,ju=0,Bl=null,K3=0;function Cn(){throw Error(r(321))}function uv(a,i){if(i===null)return!1;for(var u=0;u<i.length&&u<a.length;u++)if(!Gr(a[u],i[u]))return!1;return!0}function dv(a,i,u,f,y,S){return Eo=S,yt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,I.H=a===null||a.memoizedState===null?yw:xw,Vi=!1,S=u(f,y),Vi=!1,$l&&(S=PC(i,u,f,y)),LC(a),S}function LC(a){I.H=sh;var i=Xt!==null&&Xt.next!==null;if(Eo=0,Nn=Xt=yt=null,Xf=!1,ju=0,Bl=null,i)throw Error(r(300));a===null||Qn||(a=a.dependencies,a!==null&&qf(a)&&(Qn=!0))}function PC(a,i,u,f){yt=a;var y=0;do{if($l&&(Bl=null),ju=0,$l=!1,25<=y)throw Error(r(301));if(y+=1,Nn=Xt=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}I.H=eM,S=i(u,f)}while($l);return S}function Z3(){var a=I.H,i=a.useState()[0];return i=typeof i.then=="function"?Nu(i):i,a=a.useState()[0],(Xt!==null?Xt.memoizedState:null)!==a&&(yt.flags|=1024),i}function fv(){var a=Jf!==0;return Jf=0,a}function hv(a,i,u){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~u}function mv(a){if(Xf){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}Xf=!1}Eo=0,Nn=Xt=yt=null,$l=!1,ju=Jf=0,Bl=null}function Or(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?yt.memoizedState=Nn=a:Nn=Nn.next=a,Nn}function An(){if(Xt===null){var a=yt.alternate;a=a!==null?a.memoizedState:null}else a=Xt.next;var i=Nn===null?yt.memoizedState:Nn.next;if(i!==null)Nn=i,Xt=a;else{if(a===null)throw yt.alternate===null?Error(r(467)):Error(r(310));Xt=a,a={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},Nn===null?yt.memoizedState=Nn=a:Nn=Nn.next=a}return Nn}function pv(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Nu(a){var i=ju;return ju+=1,Bl===null&&(Bl=[]),a=AC(Bl,a,i),i=yt,(Nn===null?i.memoizedState:Nn.next)===null&&(i=i.alternate,I.H=i===null||i.memoizedState===null?yw:xw),a}function eh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Nu(a);if(a.$$typeof===_)return fr(a)}throw Error(r(438,String(a)))}function gv(a){var i=null,u=yt.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var f=yt.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(y){return y.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=pv(),yt.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(a),f=0;f<a;f++)u[f]=B;return i.index++,u}function Hs(a,i){return typeof i=="function"?i(a):i}function th(a){var i=An();return vv(i,Xt,a)}function vv(a,i,u){var f=a.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=u;var y=a.baseQueue,S=f.pending;if(S!==null){if(y!==null){var N=y.next;y.next=S.next,S.next=N}i.baseQueue=y=S,f.pending=null}if(S=a.baseState,y===null)a.memoizedState=S;else{i=y.next;var M=N=null,P=null,re=i,he=!1;do{var ye=re.lane&-536870913;if(ye!==re.lane?(_t&ye)===ye:(Eo&ye)===ye){var ae=re.revertLane;if(ae===0)P!==null&&(P=P.next={lane:0,revertLane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),ye===Hl&&(he=!0);else if((Eo&ae)===ae){re=re.next,ae===Hl&&(he=!0);continue}else ye={lane:0,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},P===null?(M=P=ye,N=S):P=P.next=ye,yt.lanes|=ae,Do|=ae;ye=re.action,Vi&&u(S,ye),S=re.hasEagerState?re.eagerState:u(S,ye)}else ae={lane:ye,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},P===null?(M=P=ae,N=S):P=P.next=ae,yt.lanes|=ye,Do|=ye;re=re.next}while(re!==null&&re!==i);if(P===null?N=S:P.next=M,!Gr(S,a.memoizedState)&&(Qn=!0,he&&(u=Vl,u!==null)))throw u;a.memoizedState=S,a.baseState=N,a.baseQueue=P,f.lastRenderedState=S}return y===null&&(f.lanes=0),[a.memoizedState,f.dispatch]}function yv(a){var i=An(),u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var f=u.dispatch,y=u.pending,S=i.memoizedState;if(y!==null){u.pending=null;var N=y=y.next;do S=a(S,N.action),N=N.next;while(N!==y);Gr(S,i.memoizedState)||(Qn=!0),i.memoizedState=S,i.baseQueue===null&&(i.baseState=S),u.lastRenderedState=S}return[S,f]}function UC(a,i,u){var f=yt,y=An(),S=Pt;if(S){if(u===void 0)throw Error(r(407));u=u()}else u=i();var N=!Gr((Xt||y).memoizedState,u);N&&(y.memoizedState=u,Qn=!0),y=y.queue;var M=VC.bind(null,f,y,a);if(Au(2048,8,M,[a]),y.getSnapshot!==i||N||Nn!==null&&Nn.memoizedState.tag&1){if(f.flags|=2048,Gl(9,nh(),HC.bind(null,f,y,u,i),null),sn===null)throw Error(r(349));S||(Eo&124)!==0||FC(f,i,u)}return u}function FC(a,i,u){a.flags|=16384,a={getSnapshot:i,value:u},i=yt.updateQueue,i===null?(i=pv(),yt.updateQueue=i,i.stores=[a]):(u=i.stores,u===null?i.stores=[a]:u.push(a))}function HC(a,i,u,f){i.value=u,i.getSnapshot=f,zC(i)&&$C(a)}function VC(a,i,u){return u(function(){zC(i)&&$C(a)})}function zC(a){var i=a.getSnapshot;a=a.value;try{var u=i();return!Gr(a,u)}catch{return!0}}function $C(a){var i=Ll(a,2);i!==null&&Qr(i,a,2)}function xv(a){var i=Or();if(typeof a=="function"){var u=a;if(a=u(),Vi){ct(!0);try{u()}finally{ct(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:a},i}function BC(a,i,u,f){return a.baseState=u,vv(a,Xt,typeof f=="function"?f:Hs)}function Y3(a,i,u,f,y){if(ah(a))throw Error(r(485));if(a=i.action,a!==null){var S={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){S.listeners.push(N)}};I.T!==null?u(!0):S.isTransition=!1,f(S),u=i.pending,u===null?(S.next=i.pending=S,GC(i,S)):(S.next=u.next,i.pending=u.next=S)}}function GC(a,i){var u=i.action,f=i.payload,y=a.state;if(i.isTransition){var S=I.T,N={};I.T=N;try{var M=u(y,f),P=I.S;P!==null&&P(N,M),qC(a,i,M)}catch(re){bv(a,i,re)}finally{I.T=S}}else try{S=u(y,f),qC(a,i,S)}catch(re){bv(a,i,re)}}function qC(a,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){KC(a,i,f)},function(f){return bv(a,i,f)}):KC(a,i,u)}function KC(a,i,u){i.status="fulfilled",i.value=u,ZC(i),a.state=u,i=a.pending,i!==null&&(u=i.next,u===i?a.pending=null:(u=u.next,i.next=u,GC(a,u)))}function bv(a,i,u){var f=a.pending;if(a.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=u,ZC(i),i=i.next;while(i!==f)}a.action=null}function ZC(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function YC(a,i){return i}function WC(a,i){if(Pt){var u=sn.formState;if(u!==null){e:{var f=yt;if(Pt){if(gn){t:{for(var y=gn,S=ns;y.nodeType!==8;){if(!S){y=null;break t}if(y=Fa(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){gn=Fa(y.nextSibling),f=y.data==="F!";break e}}Pi(f)}f=!1}f&&(i=u[0])}}return u=Or(),u.memoizedState=u.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:YC,lastRenderedState:i},u.queue=f,u=pw.bind(null,yt,f),f.dispatch=u,f=xv(!1),S=Rv.bind(null,yt,!1,f.queue),f=Or(),y={state:i,dispatch:null,action:a,pending:null},f.queue=y,u=Y3.bind(null,yt,y,S,u),y.dispatch=u,f.memoizedState=a,[i,u,!1]}function QC(a){var i=An();return XC(i,Xt,a)}function XC(a,i,u){if(i=vv(a,i,YC)[0],a=th(Hs)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=Nu(i)}catch(N){throw N===wu?Yf:N}else f=i;i=An();var y=i.queue,S=y.dispatch;return u!==i.memoizedState&&(yt.flags|=2048,Gl(9,nh(),W3.bind(null,y,u),null)),[f,S,a]}function W3(a,i){a.action=i}function JC(a){var i=An(),u=Xt;if(u!==null)return XC(i,u,a);An(),i=i.memoizedState,u=An();var f=u.queue.dispatch;return u.memoizedState=a,[i,f,!1]}function Gl(a,i,u,f){return a={tag:a,create:u,deps:f,inst:i,next:null},i=yt.updateQueue,i===null&&(i=pv(),yt.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=a.next=a:(f=u.next,u.next=a,a.next=f,i.lastEffect=a),a}function nh(){return{destroy:void 0,resource:void 0}}function ew(){return An().memoizedState}function rh(a,i,u,f){var y=Or();f=f===void 0?null:f,yt.flags|=a,y.memoizedState=Gl(1|i,nh(),u,f)}function Au(a,i,u,f){var y=An();f=f===void 0?null:f;var S=y.memoizedState.inst;Xt!==null&&f!==null&&uv(f,Xt.memoizedState.deps)?y.memoizedState=Gl(i,S,u,f):(yt.flags|=a,y.memoizedState=Gl(1|i,S,u,f))}function tw(a,i){rh(8390656,8,a,i)}function nw(a,i){Au(2048,8,a,i)}function rw(a,i){return Au(4,2,a,i)}function aw(a,i){return Au(4,4,a,i)}function sw(a,i){if(typeof i=="function"){a=a();var u=i(a);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return a=a(),i.current=a,function(){i.current=null}}function ow(a,i,u){u=u!=null?u.concat([a]):null,Au(4,4,sw.bind(null,i,a),u)}function Sv(){}function iw(a,i){var u=An();i=i===void 0?null:i;var f=u.memoizedState;return i!==null&&uv(i,f[1])?f[0]:(u.memoizedState=[a,i],a)}function lw(a,i){var u=An();i=i===void 0?null:i;var f=u.memoizedState;if(i!==null&&uv(i,f[1]))return f[0];if(f=a(),Vi){ct(!0);try{a()}finally{ct(!1)}}return u.memoizedState=[f,i],f}function Cv(a,i,u){return u===void 0||(Eo&1073741824)!==0?a.memoizedState=i:(a.memoizedState=u,a=dE(),yt.lanes|=a,Do|=a,u)}function cw(a,i,u,f){return Gr(u,i)?u:zl.current!==null?(a=Cv(a,u,f),Gr(a,i)||(Qn=!0),a):(Eo&42)===0?(Qn=!0,a.memoizedState=u):(a=dE(),yt.lanes|=a,Do|=a,i)}function uw(a,i,u,f,y){var S=W.p;W.p=S!==0&&8>S?S:8;var N=I.T,M={};I.T=M,Rv(a,!1,i,u);try{var P=y(),re=I.S;if(re!==null&&re(M,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var he=q3(P,f);Du(a,i,he,Wr(a))}else Du(a,i,f,Wr(a))}catch(ye){Du(a,i,{then:function(){},status:"rejected",reason:ye},Wr())}finally{W.p=S,I.T=N}}function Q3(){}function wv(a,i,u,f){if(a.tag!==5)throw Error(r(476));var y=dw(a).queue;uw(a,y,i,G,u===null?Q3:function(){return fw(a),u(f)})}function dw(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:G},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:u},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function fw(a){var i=dw(a).next.queue;Du(a,i,{},Wr())}function Ev(){return fr(Yu)}function hw(){return An().memoizedState}function mw(){return An().memoizedState}function X3(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var u=Wr();a=Co(u);var f=wo(i,a,u);f!==null&&(Qr(f,i,u),Ru(f,i,u)),i={cache:ev()},a.payload=i;return}i=i.return}}function J3(a,i,u){var f=Wr();u={lane:f,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},ah(a)?gw(i,u):(u=Bg(a,i,u,f),u!==null&&(Qr(u,a,f),vw(u,i,f)))}function pw(a,i,u){var f=Wr();Du(a,i,u,f)}function Du(a,i,u,f){var y={lane:f,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(ah(a))gw(i,y);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=i.lastRenderedReducer,S!==null))try{var N=i.lastRenderedState,M=S(N,u);if(y.hasEagerState=!0,y.eagerState=M,Gr(M,N))return Vf(a,i,y,0),sn===null&&Hf(),!1}catch{}finally{}if(u=Bg(a,i,y,f),u!==null)return Qr(u,a,f),vw(u,i,f),!0}return!1}function Rv(a,i,u,f){if(f={lane:2,revertLane:ry(),action:f,hasEagerState:!1,eagerState:null,next:null},ah(a)){if(i)throw Error(r(479))}else i=Bg(a,u,f,2),i!==null&&Qr(i,a,2)}function ah(a){var i=a.alternate;return a===yt||i!==null&&i===yt}function gw(a,i){$l=Xf=!0;var u=a.pending;u===null?i.next=i:(i.next=u.next,u.next=i),a.pending=i}function vw(a,i,u){if((u&4194048)!==0){var f=i.lanes;f&=a.pendingLanes,u|=f,i.lanes=u,dr(a,u)}}var sh={readContext:fr,use:eh,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useLayoutEffect:Cn,useInsertionEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useSyncExternalStore:Cn,useId:Cn,useHostTransitionStatus:Cn,useFormState:Cn,useActionState:Cn,useOptimistic:Cn,useMemoCache:Cn,useCacheRefresh:Cn},yw={readContext:fr,use:eh,useCallback:function(a,i){return Or().memoizedState=[a,i===void 0?null:i],a},useContext:fr,useEffect:tw,useImperativeHandle:function(a,i,u){u=u!=null?u.concat([a]):null,rh(4194308,4,sw.bind(null,i,a),u)},useLayoutEffect:function(a,i){return rh(4194308,4,a,i)},useInsertionEffect:function(a,i){rh(4,2,a,i)},useMemo:function(a,i){var u=Or();i=i===void 0?null:i;var f=a();if(Vi){ct(!0);try{a()}finally{ct(!1)}}return u.memoizedState=[f,i],f},useReducer:function(a,i,u){var f=Or();if(u!==void 0){var y=u(i);if(Vi){ct(!0);try{u(i)}finally{ct(!1)}}}else y=i;return f.memoizedState=f.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},f.queue=a,a=a.dispatch=J3.bind(null,yt,a),[f.memoizedState,a]},useRef:function(a){var i=Or();return a={current:a},i.memoizedState=a},useState:function(a){a=xv(a);var i=a.queue,u=pw.bind(null,yt,i);return i.dispatch=u,[a.memoizedState,u]},useDebugValue:Sv,useDeferredValue:function(a,i){var u=Or();return Cv(u,a,i)},useTransition:function(){var a=xv(!1);return a=uw.bind(null,yt,a.queue,!0,!1),Or().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,u){var f=yt,y=Or();if(Pt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=i(),sn===null)throw Error(r(349));(_t&124)!==0||FC(f,i,u)}y.memoizedState=u;var S={value:u,getSnapshot:i};return y.queue=S,tw(VC.bind(null,f,S,a),[a]),f.flags|=2048,Gl(9,nh(),HC.bind(null,f,S,u,i),null),u},useId:function(){var a=Or(),i=sn.identifierPrefix;if(Pt){var u=Ps,f=Ls;u=(f&~(1<<32-Et(f)-1)).toString(32)+u,i="«"+i+"R"+u,u=Jf++,0<u&&(i+="H"+u.toString(32)),i+="»"}else u=K3++,i="«"+i+"r"+u.toString(32)+"»";return a.memoizedState=i},useHostTransitionStatus:Ev,useFormState:WC,useActionState:WC,useOptimistic:function(a){var i=Or();i.memoizedState=i.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=Rv.bind(null,yt,!0,u),u.dispatch=i,[a,i]},useMemoCache:gv,useCacheRefresh:function(){return Or().memoizedState=X3.bind(null,yt)}},xw={readContext:fr,use:eh,useCallback:iw,useContext:fr,useEffect:nw,useImperativeHandle:ow,useInsertionEffect:rw,useLayoutEffect:aw,useMemo:lw,useReducer:th,useRef:ew,useState:function(){return th(Hs)},useDebugValue:Sv,useDeferredValue:function(a,i){var u=An();return cw(u,Xt.memoizedState,a,i)},useTransition:function(){var a=th(Hs)[0],i=An().memoizedState;return[typeof a=="boolean"?a:Nu(a),i]},useSyncExternalStore:UC,useId:hw,useHostTransitionStatus:Ev,useFormState:QC,useActionState:QC,useOptimistic:function(a,i){var u=An();return BC(u,Xt,a,i)},useMemoCache:gv,useCacheRefresh:mw},eM={readContext:fr,use:eh,useCallback:iw,useContext:fr,useEffect:nw,useImperativeHandle:ow,useInsertionEffect:rw,useLayoutEffect:aw,useMemo:lw,useReducer:yv,useRef:ew,useState:function(){return yv(Hs)},useDebugValue:Sv,useDeferredValue:function(a,i){var u=An();return Xt===null?Cv(u,a,i):cw(u,Xt.memoizedState,a,i)},useTransition:function(){var a=yv(Hs)[0],i=An().memoizedState;return[typeof a=="boolean"?a:Nu(a),i]},useSyncExternalStore:UC,useId:hw,useHostTransitionStatus:Ev,useFormState:JC,useActionState:JC,useOptimistic:function(a,i){var u=An();return Xt!==null?BC(u,Xt,a,i):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:gv,useCacheRefresh:mw},ql=null,Ou=0;function oh(a){var i=Ou;return Ou+=1,ql===null&&(ql=[]),AC(ql,a,i)}function Mu(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function ih(a,i){throw i.$$typeof===v?Error(r(525)):(a=Object.prototype.toString.call(i),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":a)))}function bw(a){var i=a._init;return i(a._payload)}function Sw(a){function i(Q,$){if(a){var ee=Q.deletions;ee===null?(Q.deletions=[$],Q.flags|=16):ee.push($)}}function u(Q,$){if(!a)return null;for(;$!==null;)i(Q,$),$=$.sibling;return null}function f(Q){for(var $=new Map;Q!==null;)Q.key!==null?$.set(Q.key,Q):$.set(Q.index,Q),Q=Q.sibling;return $}function y(Q,$){return Q=Is(Q,$),Q.index=0,Q.sibling=null,Q}function S(Q,$,ee){return Q.index=ee,a?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<$?(Q.flags|=67108866,$):ee):(Q.flags|=67108866,$)):(Q.flags|=1048576,$)}function N(Q){return a&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,$,ee,ge){return $===null||$.tag!==6?($=qg(ee,Q.mode,ge),$.return=Q,$):($=y($,ee),$.return=Q,$)}function P(Q,$,ee,ge){var Ve=ee.type;return Ve===w?he(Q,$,ee.props.children,ge,ee.key):$!==null&&($.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===k&&bw(Ve)===$.type)?($=y($,ee.props),Mu($,ee),$.return=Q,$):($=$f(ee.type,ee.key,ee.props,null,Q.mode,ge),Mu($,ee),$.return=Q,$)}function re(Q,$,ee,ge){return $===null||$.tag!==4||$.stateNode.containerInfo!==ee.containerInfo||$.stateNode.implementation!==ee.implementation?($=Kg(ee,Q.mode,ge),$.return=Q,$):($=y($,ee.children||[]),$.return=Q,$)}function he(Q,$,ee,ge,Ve){return $===null||$.tag!==7?($=Mi(ee,Q.mode,ge,Ve),$.return=Q,$):($=y($,ee),$.return=Q,$)}function ye(Q,$,ee){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=qg(""+$,Q.mode,ee),$.return=Q,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case x:return ee=$f($.type,$.key,$.props,null,Q.mode,ee),Mu(ee,$),ee.return=Q,ee;case b:return $=Kg($,Q.mode,ee),$.return=Q,$;case k:var ge=$._init;return $=ge($._payload),ye(Q,$,ee)}if(Y($)||J($))return $=Mi($,Q.mode,ee,null),$.return=Q,$;if(typeof $.then=="function")return ye(Q,oh($),ee);if($.$$typeof===_)return ye(Q,Kf(Q,$),ee);ih(Q,$)}return null}function ae(Q,$,ee,ge){var Ve=$!==null?$.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Ve!==null?null:M(Q,$,""+ee,ge);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case x:return ee.key===Ve?P(Q,$,ee,ge):null;case b:return ee.key===Ve?re(Q,$,ee,ge):null;case k:return Ve=ee._init,ee=Ve(ee._payload),ae(Q,$,ee,ge)}if(Y(ee)||J(ee))return Ve!==null?null:he(Q,$,ee,ge,null);if(typeof ee.then=="function")return ae(Q,$,oh(ee),ge);if(ee.$$typeof===_)return ae(Q,$,Kf(Q,ee),ge);ih(Q,ee)}return null}function se(Q,$,ee,ge,Ve){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return Q=Q.get(ee)||null,M($,Q,""+ge,Ve);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:return Q=Q.get(ge.key===null?ee:ge.key)||null,P($,Q,ge,Ve);case b:return Q=Q.get(ge.key===null?ee:ge.key)||null,re($,Q,ge,Ve);case k:var bt=ge._init;return ge=bt(ge._payload),se(Q,$,ee,ge,Ve)}if(Y(ge)||J(ge))return Q=Q.get(ee)||null,he($,Q,ge,Ve,null);if(typeof ge.then=="function")return se(Q,$,ee,oh(ge),Ve);if(ge.$$typeof===_)return se(Q,$,ee,Kf($,ge),Ve);ih($,ge)}return null}function ot(Q,$,ee,ge){for(var Ve=null,bt=null,We=$,nt=$=0,Jn=null;We!==null&&nt<ee.length;nt++){We.index>nt?(Jn=We,We=null):Jn=We.sibling;var kt=ae(Q,We,ee[nt],ge);if(kt===null){We===null&&(We=Jn);break}a&&We&&kt.alternate===null&&i(Q,We),$=S(kt,$,nt),bt===null?Ve=kt:bt.sibling=kt,bt=kt,We=Jn}if(nt===ee.length)return u(Q,We),Pt&&Ii(Q,nt),Ve;if(We===null){for(;nt<ee.length;nt++)We=ye(Q,ee[nt],ge),We!==null&&($=S(We,$,nt),bt===null?Ve=We:bt.sibling=We,bt=We);return Pt&&Ii(Q,nt),Ve}for(We=f(We);nt<ee.length;nt++)Jn=se(We,Q,nt,ee[nt],ge),Jn!==null&&(a&&Jn.alternate!==null&&We.delete(Jn.key===null?nt:Jn.key),$=S(Jn,$,nt),bt===null?Ve=Jn:bt.sibling=Jn,bt=Jn);return a&&We.forEach(function(Ho){return i(Q,Ho)}),Pt&&Ii(Q,nt),Ve}function et(Q,$,ee,ge){if(ee==null)throw Error(r(151));for(var Ve=null,bt=null,We=$,nt=$=0,Jn=null,kt=ee.next();We!==null&&!kt.done;nt++,kt=ee.next()){We.index>nt?(Jn=We,We=null):Jn=We.sibling;var Ho=ae(Q,We,kt.value,ge);if(Ho===null){We===null&&(We=Jn);break}a&&We&&Ho.alternate===null&&i(Q,We),$=S(Ho,$,nt),bt===null?Ve=Ho:bt.sibling=Ho,bt=Ho,We=Jn}if(kt.done)return u(Q,We),Pt&&Ii(Q,nt),Ve;if(We===null){for(;!kt.done;nt++,kt=ee.next())kt=ye(Q,kt.value,ge),kt!==null&&($=S(kt,$,nt),bt===null?Ve=kt:bt.sibling=kt,bt=kt);return Pt&&Ii(Q,nt),Ve}for(We=f(We);!kt.done;nt++,kt=ee.next())kt=se(We,Q,nt,kt.value,ge),kt!==null&&(a&&kt.alternate!==null&&We.delete(kt.key===null?nt:kt.key),$=S(kt,$,nt),bt===null?Ve=kt:bt.sibling=kt,bt=kt);return a&&We.forEach(function(tk){return i(Q,tk)}),Pt&&Ii(Q,nt),Ve}function en(Q,$,ee,ge){if(typeof ee=="object"&&ee!==null&&ee.type===w&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case x:e:{for(var Ve=ee.key;$!==null;){if($.key===Ve){if(Ve=ee.type,Ve===w){if($.tag===7){u(Q,$.sibling),ge=y($,ee.props.children),ge.return=Q,Q=ge;break e}}else if($.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===k&&bw(Ve)===$.type){u(Q,$.sibling),ge=y($,ee.props),Mu(ge,ee),ge.return=Q,Q=ge;break e}u(Q,$);break}else i(Q,$);$=$.sibling}ee.type===w?(ge=Mi(ee.props.children,Q.mode,ge,ee.key),ge.return=Q,Q=ge):(ge=$f(ee.type,ee.key,ee.props,null,Q.mode,ge),Mu(ge,ee),ge.return=Q,Q=ge)}return N(Q);case b:e:{for(Ve=ee.key;$!==null;){if($.key===Ve)if($.tag===4&&$.stateNode.containerInfo===ee.containerInfo&&$.stateNode.implementation===ee.implementation){u(Q,$.sibling),ge=y($,ee.children||[]),ge.return=Q,Q=ge;break e}else{u(Q,$);break}else i(Q,$);$=$.sibling}ge=Kg(ee,Q.mode,ge),ge.return=Q,Q=ge}return N(Q);case k:return Ve=ee._init,ee=Ve(ee._payload),en(Q,$,ee,ge)}if(Y(ee))return ot(Q,$,ee,ge);if(J(ee)){if(Ve=J(ee),typeof Ve!="function")throw Error(r(150));return ee=Ve.call(ee),et(Q,$,ee,ge)}if(typeof ee.then=="function")return en(Q,$,oh(ee),ge);if(ee.$$typeof===_)return en(Q,$,Kf(Q,ee),ge);ih(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,$!==null&&$.tag===6?(u(Q,$.sibling),ge=y($,ee),ge.return=Q,Q=ge):(u(Q,$),ge=qg(ee,Q.mode,ge),ge.return=Q,Q=ge),N(Q)):u(Q,$)}return function(Q,$,ee,ge){try{Ou=0;var Ve=en(Q,$,ee,ge);return ql=null,Ve}catch(We){if(We===wu||We===Yf)throw We;var bt=qr(29,We,null,Q.mode);return bt.lanes=ge,bt.return=Q,bt}finally{}}}var Kl=Sw(!0),Cw=Sw(!1),Ca=Z(null),rs=null;function Ro(a){var i=a.alternate;q(Vn,Vn.current&1),q(Ca,a),rs===null&&(i===null||zl.current!==null||i.memoizedState!==null)&&(rs=a)}function ww(a){if(a.tag===22){if(q(Vn,Vn.current),q(Ca,a),rs===null){var i=a.alternate;i!==null&&i.memoizedState!==null&&(rs=a)}}else To()}function To(){q(Vn,Vn.current),q(Ca,Ca.current)}function Vs(a){U(Ca),rs===a&&(rs=null),U(Vn)}var Vn=Z(0);function lh(a){for(var i=a;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||py(u)))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}function Tv(a,i,u,f){i=a.memoizedState,u=u(f,i),u=u==null?i:g({},i,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var _v={enqueueSetState:function(a,i,u){a=a._reactInternals;var f=Wr(),y=Co(f);y.payload=i,u!=null&&(y.callback=u),i=wo(a,y,f),i!==null&&(Qr(i,a,f),Ru(i,a,f))},enqueueReplaceState:function(a,i,u){a=a._reactInternals;var f=Wr(),y=Co(f);y.tag=1,y.payload=i,u!=null&&(y.callback=u),i=wo(a,y,f),i!==null&&(Qr(i,a,f),Ru(i,a,f))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var u=Wr(),f=Co(u);f.tag=2,i!=null&&(f.callback=i),i=wo(a,f,u),i!==null&&(Qr(i,a,u),Ru(i,a,u))}};function Ew(a,i,u,f,y,S,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(f,S,N):i.prototype&&i.prototype.isPureReactComponent?!pu(u,f)||!pu(y,S):!0}function Rw(a,i,u,f){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,f),i.state!==a&&_v.enqueueReplaceState(i,i.state,null)}function zi(a,i){var u=i;if("ref"in i){u={};for(var f in i)f!=="ref"&&(u[f]=i[f])}if(a=a.defaultProps){u===i&&(u=g({},u));for(var y in a)u[y]===void 0&&(u[y]=a[y])}return u}var ch=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function Tw(a){ch(a)}function _w(a){console.error(a)}function jw(a){ch(a)}function uh(a,i){try{var u=a.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function Nw(a,i,u){try{var f=a.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function jv(a,i,u){return u=Co(u),u.tag=3,u.payload={element:null},u.callback=function(){uh(a,i)},u}function Aw(a){return a=Co(a),a.tag=3,a}function Dw(a,i,u,f){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var S=f.value;a.payload=function(){return y(S)},a.callback=function(){Nw(i,u,f)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(a.callback=function(){Nw(i,u,f),typeof y!="function"&&(Oo===null?Oo=new Set([this]):Oo.add(this));var M=f.stack;this.componentDidCatch(f.value,{componentStack:M!==null?M:""})})}function tM(a,i,u,f,y){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=u.alternate,i!==null&&bu(i,u,y,!0),u=Ca.current,u!==null){switch(u.tag){case 13:return rs===null?Xv():u.alternate===null&&vn===0&&(vn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,f===rv?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([f]):i.add(f),ey(a,f,y)),!1;case 22:return u.flags|=65536,f===rv?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([f]):u.add(f)),ey(a,f,y)),!1}throw Error(r(435,u.tag))}return ey(a,f,y),Xv(),!1}if(Pt)return i=Ca.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=y,f!==Wg&&(a=Error(r(422),{cause:f}),xu(ya(a,u)))):(f!==Wg&&(i=Error(r(423),{cause:f}),xu(ya(i,u))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,f=ya(f,u),y=jv(a.stateNode,f,y),ov(a,y),vn!==4&&(vn=2)),!1;var S=Error(r(520),{cause:f});if(S=ya(S,u),Hu===null?Hu=[S]:Hu.push(S),vn!==4&&(vn=2),i===null)return!0;f=ya(f,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,a=y&-y,u.lanes|=a,a=jv(u.stateNode,f,a),ov(u,a),!1;case 1:if(i=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Oo===null||!Oo.has(S))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Aw(y),Dw(y,a,u,f),ov(u,y),!1}u=u.return}while(u!==null);return!1}var Ow=Error(r(461)),Qn=!1;function ar(a,i,u,f){i.child=a===null?Cw(i,null,u,f):Kl(i,a.child,u,f)}function Mw(a,i,u,f,y){u=u.render;var S=i.ref;if("ref"in f){var N={};for(var M in f)M!=="ref"&&(N[M]=f[M])}else N=f;return Fi(i),f=dv(a,i,u,N,S,y),M=fv(),a!==null&&!Qn?(hv(a,i,y),zs(a,i,y)):(Pt&&M&&Zg(i),i.flags|=1,ar(a,i,f,y),i.child)}function kw(a,i,u,f,y){if(a===null){var S=u.type;return typeof S=="function"&&!Gg(S)&&S.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=S,Iw(a,i,S,f,y)):(a=$f(u.type,null,f,i,i.mode,y),a.ref=i.ref,a.return=i,i.child=a)}if(S=a.child,!Lv(a,y)){var N=S.memoizedProps;if(u=u.compare,u=u!==null?u:pu,u(N,f)&&a.ref===i.ref)return zs(a,i,y)}return i.flags|=1,a=Is(S,f),a.ref=i.ref,a.return=i,i.child=a}function Iw(a,i,u,f,y){if(a!==null){var S=a.memoizedProps;if(pu(S,f)&&a.ref===i.ref)if(Qn=!1,i.pendingProps=f=S,Lv(a,y))(a.flags&131072)!==0&&(Qn=!0);else return i.lanes=a.lanes,zs(a,i,y)}return Nv(a,i,u,f,y)}function Lw(a,i,u){var f=i.pendingProps,y=f.children,S=a!==null?a.memoizedState:null;if(f.mode==="hidden"){if((i.flags&128)!==0){if(f=S!==null?S.baseLanes|u:u,a!==null){for(y=i.child=a.child,S=0;y!==null;)S=S|y.lanes|y.childLanes,y=y.sibling;i.childLanes=S&~f}else i.childLanes=0,i.child=null;return Pw(a,i,f,u)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&Zf(i,S!==null?S.cachePool:null),S!==null?IC(i,S):lv(),ww(i);else return i.lanes=i.childLanes=536870912,Pw(a,i,S!==null?S.baseLanes|u:u,u)}else S!==null?(Zf(i,S.cachePool),IC(i,S),To(),i.memoizedState=null):(a!==null&&Zf(i,null),lv(),To());return ar(a,i,y,u),i.child}function Pw(a,i,u,f){var y=nv();return y=y===null?null:{parent:Hn._currentValue,pool:y},i.memoizedState={baseLanes:u,cachePool:y},a!==null&&Zf(i,null),lv(),ww(i),a!==null&&bu(a,i,f,!0),null}function dh(a,i){var u=i.ref;if(u===null)a!==null&&a.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(i.flags|=4194816)}}function Nv(a,i,u,f,y){return Fi(i),u=dv(a,i,u,f,void 0,y),f=fv(),a!==null&&!Qn?(hv(a,i,y),zs(a,i,y)):(Pt&&f&&Zg(i),i.flags|=1,ar(a,i,u,y),i.child)}function Uw(a,i,u,f,y,S){return Fi(i),i.updateQueue=null,u=PC(i,f,u,y),LC(a),f=fv(),a!==null&&!Qn?(hv(a,i,S),zs(a,i,S)):(Pt&&f&&Zg(i),i.flags|=1,ar(a,i,u,S),i.child)}function Fw(a,i,u,f,y){if(Fi(i),i.stateNode===null){var S=Pl,N=u.contextType;typeof N=="object"&&N!==null&&(S=fr(N)),S=new u(f,S),i.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=_v,i.stateNode=S,S._reactInternals=i,S=i.stateNode,S.props=f,S.state=i.memoizedState,S.refs={},av(i),N=u.contextType,S.context=typeof N=="object"&&N!==null?fr(N):Pl,S.state=i.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(Tv(i,u,N,f),S.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(N=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),N!==S.state&&_v.enqueueReplaceState(S,S.state,null),_u(i,f,S,y),Tu(),S.state=i.memoizedState),typeof S.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(a===null){S=i.stateNode;var M=i.memoizedProps,P=zi(u,M);S.props=P;var re=S.context,he=u.contextType;N=Pl,typeof he=="object"&&he!==null&&(N=fr(he));var ye=u.getDerivedStateFromProps;he=typeof ye=="function"||typeof S.getSnapshotBeforeUpdate=="function",M=i.pendingProps!==M,he||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M||re!==N)&&Rw(i,S,f,N),So=!1;var ae=i.memoizedState;S.state=ae,_u(i,f,S,y),Tu(),re=i.memoizedState,M||ae!==re||So?(typeof ye=="function"&&(Tv(i,u,ye,f),re=i.memoizedState),(P=So||Ew(i,u,P,f,ae,re,N))?(he||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(i.flags|=4194308)):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=re),S.props=f,S.state=re,S.context=N,f=P):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{S=i.stateNode,sv(a,i),N=i.memoizedProps,he=zi(u,N),S.props=he,ye=i.pendingProps,ae=S.context,re=u.contextType,P=Pl,typeof re=="object"&&re!==null&&(P=fr(re)),M=u.getDerivedStateFromProps,(re=typeof M=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(N!==ye||ae!==P)&&Rw(i,S,f,P),So=!1,ae=i.memoizedState,S.state=ae,_u(i,f,S,y),Tu();var se=i.memoizedState;N!==ye||ae!==se||So||a!==null&&a.dependencies!==null&&qf(a.dependencies)?(typeof M=="function"&&(Tv(i,u,M,f),se=i.memoizedState),(he=So||Ew(i,u,he,f,ae,se,P)||a!==null&&a.dependencies!==null&&qf(a.dependencies))?(re||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(f,se,P),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(f,se,P)),typeof S.componentDidUpdate=="function"&&(i.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof S.componentDidUpdate!="function"||N===a.memoizedProps&&ae===a.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&ae===a.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=se),S.props=f,S.state=se,S.context=P,f=he):(typeof S.componentDidUpdate!="function"||N===a.memoizedProps&&ae===a.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&ae===a.memoizedState||(i.flags|=1024),f=!1)}return S=f,dh(a,i),f=(i.flags&128)!==0,S||f?(S=i.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:S.render(),i.flags|=1,a!==null&&f?(i.child=Kl(i,a.child,null,y),i.child=Kl(i,null,u,y)):ar(a,i,u,y),i.memoizedState=S.state,a=i.child):a=zs(a,i,y),a}function Hw(a,i,u,f){return yu(),i.flags|=256,ar(a,i,u,f),i.child}var Av={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dv(a){return{baseLanes:a,cachePool:_C()}}function Ov(a,i,u){return a=a!==null?a.childLanes&~u:0,i&&(a|=wa),a}function Vw(a,i,u){var f=i.pendingProps,y=!1,S=(i.flags&128)!==0,N;if((N=S)||(N=a!==null&&a.memoizedState===null?!1:(Vn.current&2)!==0),N&&(y=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,a===null){if(Pt){if(y?Ro(i):To(),Pt){var M=gn,P;if(P=M){e:{for(P=M,M=ns;P.nodeType!==8;){if(!M){M=null;break e}if(P=Fa(P.nextSibling),P===null){M=null;break e}}M=P}M!==null?(i.memoizedState={dehydrated:M,treeContext:ki!==null?{id:Ls,overflow:Ps}:null,retryLane:536870912,hydrationErrors:null},P=qr(18,null,null,0),P.stateNode=M,P.return=i,i.child=P,wr=i,gn=null,P=!0):P=!1}P||Pi(i)}if(M=i.memoizedState,M!==null&&(M=M.dehydrated,M!==null))return py(M)?i.lanes=32:i.lanes=536870912,null;Vs(i)}return M=f.children,f=f.fallback,y?(To(),y=i.mode,M=fh({mode:"hidden",children:M},y),f=Mi(f,y,u,null),M.return=i,f.return=i,M.sibling=f,i.child=M,y=i.child,y.memoizedState=Dv(u),y.childLanes=Ov(a,N,u),i.memoizedState=Av,f):(Ro(i),Mv(i,M))}if(P=a.memoizedState,P!==null&&(M=P.dehydrated,M!==null)){if(S)i.flags&256?(Ro(i),i.flags&=-257,i=kv(a,i,u)):i.memoizedState!==null?(To(),i.child=a.child,i.flags|=128,i=null):(To(),y=f.fallback,M=i.mode,f=fh({mode:"visible",children:f.children},M),y=Mi(y,M,u,null),y.flags|=2,f.return=i,y.return=i,f.sibling=y,i.child=f,Kl(i,a.child,null,u),f=i.child,f.memoizedState=Dv(u),f.childLanes=Ov(a,N,u),i.memoizedState=Av,i=y);else if(Ro(i),py(M)){if(N=M.nextSibling&&M.nextSibling.dataset,N)var re=N.dgst;N=re,f=Error(r(419)),f.stack="",f.digest=N,xu({value:f,source:null,stack:null}),i=kv(a,i,u)}else if(Qn||bu(a,i,u,!1),N=(u&a.childLanes)!==0,Qn||N){if(N=sn,N!==null&&(f=u&-u,f=(f&42)!==0?1:Wn(f),f=(f&(N.suspendedLanes|u))!==0?0:f,f!==0&&f!==P.retryLane))throw P.retryLane=f,Ll(a,f),Qr(N,a,f),Ow;M.data==="$?"||Xv(),i=kv(a,i,u)}else M.data==="$?"?(i.flags|=192,i.child=a.child,i=null):(a=P.treeContext,gn=Fa(M.nextSibling),wr=i,Pt=!0,Li=null,ns=!1,a!==null&&(ba[Sa++]=Ls,ba[Sa++]=Ps,ba[Sa++]=ki,Ls=a.id,Ps=a.overflow,ki=i),i=Mv(i,f.children),i.flags|=4096);return i}return y?(To(),y=f.fallback,M=i.mode,P=a.child,re=P.sibling,f=Is(P,{mode:"hidden",children:f.children}),f.subtreeFlags=P.subtreeFlags&65011712,re!==null?y=Is(re,y):(y=Mi(y,M,u,null),y.flags|=2),y.return=i,f.return=i,f.sibling=y,i.child=f,f=y,y=i.child,M=a.child.memoizedState,M===null?M=Dv(u):(P=M.cachePool,P!==null?(re=Hn._currentValue,P=P.parent!==re?{parent:re,pool:re}:P):P=_C(),M={baseLanes:M.baseLanes|u,cachePool:P}),y.memoizedState=M,y.childLanes=Ov(a,N,u),i.memoizedState=Av,f):(Ro(i),u=a.child,a=u.sibling,u=Is(u,{mode:"visible",children:f.children}),u.return=i,u.sibling=null,a!==null&&(N=i.deletions,N===null?(i.deletions=[a],i.flags|=16):N.push(a)),i.child=u,i.memoizedState=null,u)}function Mv(a,i){return i=fh({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function fh(a,i){return a=qr(22,a,null,i),a.lanes=0,a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},a}function kv(a,i,u){return Kl(i,a.child,null,u),a=Mv(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function zw(a,i,u){a.lanes|=i;var f=a.alternate;f!==null&&(f.lanes|=i),Xg(a.return,i,u)}function Iv(a,i,u,f,y){var S=a.memoizedState;S===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:y}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=f,S.tail=u,S.tailMode=y)}function $w(a,i,u){var f=i.pendingProps,y=f.revealOrder,S=f.tail;if(ar(a,i,f.children,u),f=Vn.current,(f&2)!==0)f=f&1|2,i.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&zw(a,u,i);else if(a.tag===19)zw(a,u,i);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}f&=1}switch(q(Vn,f),y){case"forwards":for(u=i.child,y=null;u!==null;)a=u.alternate,a!==null&&lh(a)===null&&(y=u),u=u.sibling;u=y,u===null?(y=i.child,i.child=null):(y=u.sibling,u.sibling=null),Iv(i,!1,y,u,S);break;case"backwards":for(u=null,y=i.child,i.child=null;y!==null;){if(a=y.alternate,a!==null&&lh(a)===null){i.child=y;break}a=y.sibling,y.sibling=u,u=y,y=a}Iv(i,!0,u,null,S);break;case"together":Iv(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function zs(a,i,u){if(a!==null&&(i.dependencies=a.dependencies),Do|=i.lanes,(u&i.childLanes)===0)if(a!==null){if(bu(a,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(a!==null&&i.child!==a.child)throw Error(r(153));if(i.child!==null){for(a=i.child,u=Is(a,a.pendingProps),i.child=u,u.return=i;a.sibling!==null;)a=a.sibling,u=u.sibling=Is(a,a.pendingProps),u.return=i;u.sibling=null}return i.child}function Lv(a,i){return(a.lanes&i)!==0?!0:(a=a.dependencies,!!(a!==null&&qf(a)))}function nM(a,i,u){switch(i.tag){case 3:Ee(i,i.stateNode.containerInfo),bo(i,Hn,a.memoizedState.cache),yu();break;case 27:case 5:be(i);break;case 4:Ee(i,i.stateNode.containerInfo);break;case 10:bo(i,i.type,i.memoizedProps.value);break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(Ro(i),i.flags|=128,null):(u&i.child.childLanes)!==0?Vw(a,i,u):(Ro(i),a=zs(a,i,u),a!==null?a.sibling:null);Ro(i);break;case 19:var y=(a.flags&128)!==0;if(f=(u&i.childLanes)!==0,f||(bu(a,i,u,!1),f=(u&i.childLanes)!==0),y){if(f)return $w(a,i,u);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),q(Vn,Vn.current),f)break;return null;case 22:case 23:return i.lanes=0,Lw(a,i,u);case 24:bo(i,Hn,a.memoizedState.cache)}return zs(a,i,u)}function Bw(a,i,u){if(a!==null)if(a.memoizedProps!==i.pendingProps)Qn=!0;else{if(!Lv(a,u)&&(i.flags&128)===0)return Qn=!1,nM(a,i,u);Qn=(a.flags&131072)!==0}else Qn=!1,Pt&&(i.flags&1048576)!==0&&bC(i,Gf,i.index);switch(i.lanes=0,i.tag){case 16:e:{a=i.pendingProps;var f=i.elementType,y=f._init;if(f=y(f._payload),i.type=f,typeof f=="function")Gg(f)?(a=zi(f,a),i.tag=1,i=Fw(null,i,f,a,u)):(i.tag=0,i=Nv(null,i,f,a,u));else{if(f!=null){if(y=f.$$typeof,y===O){i.tag=11,i=Mw(null,i,f,a,u);break e}else if(y===D){i.tag=14,i=kw(null,i,f,a,u);break e}}throw i=K(f)||f,Error(r(306,i,""))}}return i;case 0:return Nv(a,i,i.type,i.pendingProps,u);case 1:return f=i.type,y=zi(f,i.pendingProps),Fw(a,i,f,y,u);case 3:e:{if(Ee(i,i.stateNode.containerInfo),a===null)throw Error(r(387));f=i.pendingProps;var S=i.memoizedState;y=S.element,sv(a,i),_u(i,f,null,u);var N=i.memoizedState;if(f=N.cache,bo(i,Hn,f),f!==S.cache&&Jg(i,[Hn],u,!0),Tu(),f=N.element,S.isDehydrated)if(S={element:f,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=S,i.memoizedState=S,i.flags&256){i=Hw(a,i,f,u);break e}else if(f!==y){y=ya(Error(r(424)),i),xu(y),i=Hw(a,i,f,u);break e}else{switch(a=i.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(gn=Fa(a.firstChild),wr=i,Pt=!0,Li=null,ns=!0,u=Cw(i,null,f,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(yu(),f===y){i=zs(a,i,u);break e}ar(a,i,f,u)}i=i.child}return i;case 26:return dh(a,i),a===null?(u=ZE(i.type,null,i.pendingProps,null))?i.memoizedState=u:Pt||(u=i.type,a=i.pendingProps,f=Th(ve.current).createElement(u),f[pe]=i,f[xe]=a,or(f,u,a),dt(f),i.stateNode=f):i.memoizedState=ZE(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return be(i),a===null&&Pt&&(f=i.stateNode=GE(i.type,i.pendingProps,ve.current),wr=i,ns=!0,y=gn,Io(i.type)?(gy=y,gn=Fa(f.firstChild)):gn=y),ar(a,i,i.pendingProps.children,u),dh(a,i),a===null&&(i.flags|=4194304),i.child;case 5:return a===null&&Pt&&((y=f=gn)&&(f=AM(f,i.type,i.pendingProps,ns),f!==null?(i.stateNode=f,wr=i,gn=Fa(f.firstChild),ns=!1,y=!0):y=!1),y||Pi(i)),be(i),y=i.type,S=i.pendingProps,N=a!==null?a.memoizedProps:null,f=S.children,fy(y,S)?f=null:N!==null&&fy(y,N)&&(i.flags|=32),i.memoizedState!==null&&(y=dv(a,i,Z3,null,null,u),Yu._currentValue=y),dh(a,i),ar(a,i,f,u),i.child;case 6:return a===null&&Pt&&((a=u=gn)&&(u=DM(u,i.pendingProps,ns),u!==null?(i.stateNode=u,wr=i,gn=null,a=!0):a=!1),a||Pi(i)),null;case 13:return Vw(a,i,u);case 4:return Ee(i,i.stateNode.containerInfo),f=i.pendingProps,a===null?i.child=Kl(i,null,f,u):ar(a,i,f,u),i.child;case 11:return Mw(a,i,i.type,i.pendingProps,u);case 7:return ar(a,i,i.pendingProps,u),i.child;case 8:return ar(a,i,i.pendingProps.children,u),i.child;case 12:return ar(a,i,i.pendingProps.children,u),i.child;case 10:return f=i.pendingProps,bo(i,i.type,f.value),ar(a,i,f.children,u),i.child;case 9:return y=i.type._context,f=i.pendingProps.children,Fi(i),y=fr(y),f=f(y),i.flags|=1,ar(a,i,f,u),i.child;case 14:return kw(a,i,i.type,i.pendingProps,u);case 15:return Iw(a,i,i.type,i.pendingProps,u);case 19:return $w(a,i,u);case 31:return f=i.pendingProps,u=i.mode,f={mode:f.mode,children:f.children},a===null?(u=fh(f,u),u.ref=i.ref,i.child=u,u.return=i,i=u):(u=Is(a.child,f),u.ref=i.ref,i.child=u,u.return=i,i=u),i;case 22:return Lw(a,i,u);case 24:return Fi(i),f=fr(Hn),a===null?(y=nv(),y===null&&(y=sn,S=ev(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=u),y=S),i.memoizedState={parent:f,cache:y},av(i),bo(i,Hn,y)):((a.lanes&u)!==0&&(sv(a,i),_u(i,null,null,u),Tu()),y=a.memoizedState,S=i.memoizedState,y.parent!==f?(y={parent:f,cache:f},i.memoizedState=y,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=y),bo(i,Hn,f)):(f=S.cache,bo(i,Hn,f),f!==y.cache&&Jg(i,[Hn],u,!0))),ar(a,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function $s(a){a.flags|=4}function Gw(a,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!JE(i)){if(i=Ca.current,i!==null&&((_t&4194048)===_t?rs!==null:(_t&62914560)!==_t&&(_t&536870912)===0||i!==rs))throw Eu=rv,jC;a.flags|=8192}}function hh(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?Tl():536870912,a.lanes|=i,Ql|=i)}function ku(a,i){if(!Pt)switch(a.tailMode){case"hidden":i=a.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:f.sibling=null}}function un(a){var i=a.alternate!==null&&a.alternate.child===a.child,u=0,f=0;if(i)for(var y=a.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags&65011712,f|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags,f|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=f,a.childLanes=u,i}function rM(a,i,u){var f=i.pendingProps;switch(Yg(i),i.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(i),null;case 1:return un(i),null;case 3:return u=i.stateNode,f=null,a!==null&&(f=a.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),Fs(Hn),De(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(vu(i)?$s(i):a===null||a.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,wC())),un(i),null;case 26:return u=i.memoizedState,a===null?($s(i),u!==null?(un(i),Gw(i,u)):(un(i),i.flags&=-16777217)):u?u!==a.memoizedState?($s(i),un(i),Gw(i,u)):(un(i),i.flags&=-16777217):(a.memoizedProps!==f&&$s(i),un(i),i.flags&=-16777217),null;case 27:Je(i),u=ve.current;var y=i.type;if(a!==null&&i.stateNode!=null)a.memoizedProps!==f&&$s(i);else{if(!f){if(i.stateNode===null)throw Error(r(166));return un(i),null}a=le.current,vu(i)?SC(i):(a=GE(y,f,u),i.stateNode=a,$s(i))}return un(i),null;case 5:if(Je(i),u=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==f&&$s(i);else{if(!f){if(i.stateNode===null)throw Error(r(166));return un(i),null}if(a=le.current,vu(i))SC(i);else{switch(y=Th(ve.current),a){case 1:a=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:a=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":a=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":a=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":a=y.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof f.is=="string"?y.createElement("select",{is:f.is}):y.createElement("select"),f.multiple?a.multiple=!0:f.size&&(a.size=f.size);break;default:a=typeof f.is=="string"?y.createElement(u,{is:f.is}):y.createElement(u)}}a[pe]=i,a[xe]=f;e:for(y=i.child;y!==null;){if(y.tag===5||y.tag===6)a.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===i)break e;for(;y.sibling===null;){if(y.return===null||y.return===i)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}i.stateNode=a;e:switch(or(a,u,f),u){case"button":case"input":case"select":case"textarea":a=!!f.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&$s(i)}}return un(i),i.flags&=-16777217,null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==f&&$s(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(r(166));if(a=ve.current,vu(i)){if(a=i.stateNode,u=i.memoizedProps,f=null,y=wr,y!==null)switch(y.tag){case 27:case 5:f=y.memoizedProps}a[pe]=i,a=!!(a.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||UE(a.nodeValue,u)),a||Pi(i)}else a=Th(a).createTextNode(f),a[pe]=i,i.stateNode=a}return un(i),null;case 13:if(f=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=vu(i),f!==null&&f.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=i.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[pe]=i}else yu(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;un(i),y=!1}else y=wC(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return i.flags&256?(Vs(i),i):(Vs(i),null)}if(Vs(i),(i.flags&128)!==0)return i.lanes=u,i;if(u=f!==null,a=a!==null&&a.memoizedState!==null,u){f=i.child,y=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(y=f.alternate.memoizedState.cachePool.pool);var S=null;f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(S=f.memoizedState.cachePool.pool),S!==y&&(f.flags|=2048)}return u!==a&&u&&(i.child.flags|=8192),hh(i,i.updateQueue),un(i),null;case 4:return De(),a===null&&iy(i.stateNode.containerInfo),un(i),null;case 10:return Fs(i.type),un(i),null;case 19:if(U(Vn),y=i.memoizedState,y===null)return un(i),null;if(f=(i.flags&128)!==0,S=y.rendering,S===null)if(f)ku(y,!1);else{if(vn!==0||a!==null&&(a.flags&128)!==0)for(a=i.child;a!==null;){if(S=lh(a),S!==null){for(i.flags|=128,ku(y,!1),a=S.updateQueue,i.updateQueue=a,hh(i,a),i.subtreeFlags=0,a=u,u=i.child;u!==null;)xC(u,a),u=u.sibling;return q(Vn,Vn.current&1|2),i.child}a=a.sibling}y.tail!==null&&Tt()>gh&&(i.flags|=128,f=!0,ku(y,!1),i.lanes=4194304)}else{if(!f)if(a=lh(S),a!==null){if(i.flags|=128,f=!0,a=a.updateQueue,i.updateQueue=a,hh(i,a),ku(y,!0),y.tail===null&&y.tailMode==="hidden"&&!S.alternate&&!Pt)return un(i),null}else 2*Tt()-y.renderingStartTime>gh&&u!==536870912&&(i.flags|=128,f=!0,ku(y,!1),i.lanes=4194304);y.isBackwards?(S.sibling=i.child,i.child=S):(a=y.last,a!==null?a.sibling=S:i.child=S,y.last=S)}return y.tail!==null?(i=y.tail,y.rendering=i,y.tail=i.sibling,y.renderingStartTime=Tt(),i.sibling=null,a=Vn.current,q(Vn,f?a&1|2:a&1),i):(un(i),null);case 22:case 23:return Vs(i),cv(),f=i.memoizedState!==null,a!==null?a.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(u&536870912)!==0&&(i.flags&128)===0&&(un(i),i.subtreeFlags&6&&(i.flags|=8192)):un(i),u=i.updateQueue,u!==null&&hh(i,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048),a!==null&&U(Hi),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Fs(Hn),un(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function aM(a,i){switch(Yg(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return Fs(Hn),De(),a=i.flags,(a&65536)!==0&&(a&128)===0?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return Je(i),null;case 13:if(Vs(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(r(340));yu()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return U(Vn),null;case 4:return De(),null;case 10:return Fs(i.type),null;case 22:case 23:return Vs(i),cv(),a!==null&&U(Hi),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return Fs(Hn),null;case 25:return null;default:return null}}function qw(a,i){switch(Yg(i),i.tag){case 3:Fs(Hn),De();break;case 26:case 27:case 5:Je(i);break;case 4:De();break;case 13:Vs(i);break;case 19:U(Vn);break;case 10:Fs(i.type);break;case 22:case 23:Vs(i),cv(),a!==null&&U(Hi);break;case 24:Fs(Hn)}}function Iu(a,i){try{var u=i.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var y=f.next;u=y;do{if((u.tag&a)===a){f=void 0;var S=u.create,N=u.inst;f=S(),N.destroy=f}u=u.next}while(u!==y)}}catch(M){nn(i,i.return,M)}}function _o(a,i,u){try{var f=i.updateQueue,y=f!==null?f.lastEffect:null;if(y!==null){var S=y.next;f=S;do{if((f.tag&a)===a){var N=f.inst,M=N.destroy;if(M!==void 0){N.destroy=void 0,y=i;var P=u,re=M;try{re()}catch(he){nn(y,P,he)}}}f=f.next}while(f!==S)}}catch(he){nn(i,i.return,he)}}function Kw(a){var i=a.updateQueue;if(i!==null){var u=a.stateNode;try{kC(i,u)}catch(f){nn(a,a.return,f)}}}function Zw(a,i,u){u.props=zi(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(f){nn(a,i,f)}}function Lu(a,i){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var f=a.stateNode;break;case 30:f=a.stateNode;break;default:f=a.stateNode}typeof u=="function"?a.refCleanup=u(f):u.current=f}}catch(y){nn(a,i,y)}}function as(a,i){var u=a.ref,f=a.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(y){nn(a,i,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){nn(a,i,y)}else u.current=null}function Yw(a){var i=a.type,u=a.memoizedProps,f=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(y){nn(a,a.return,y)}}function Pv(a,i,u){try{var f=a.stateNode;RM(f,a.type,u,i),f[xe]=i}catch(y){nn(a,a.return,y)}}function Ww(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Io(a.type)||a.tag===4}function Uv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Ww(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Io(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Fv(a,i,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(a),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Rh));else if(f!==4&&(f===27&&Io(a.type)&&(u=a.stateNode,i=null),a=a.child,a!==null))for(Fv(a,i,u),a=a.sibling;a!==null;)Fv(a,i,u),a=a.sibling}function mh(a,i,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,i?u.insertBefore(a,i):u.appendChild(a);else if(f!==4&&(f===27&&Io(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(mh(a,i,u),a=a.sibling;a!==null;)mh(a,i,u),a=a.sibling}function Qw(a){var i=a.stateNode,u=a.memoizedProps;try{for(var f=a.type,y=i.attributes;y.length;)i.removeAttributeNode(y[0]);or(i,f,u),i[pe]=a,i[xe]=u}catch(S){nn(a,a.return,S)}}var Bs=!1,wn=!1,Hv=!1,Xw=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function sM(a,i){if(a=a.containerInfo,uy=Oh,a=cC(a),Ug(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var y=f.anchorOffset,S=f.focusNode;f=f.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var N=0,M=-1,P=-1,re=0,he=0,ye=a,ae=null;t:for(;;){for(var se;ye!==u||y!==0&&ye.nodeType!==3||(M=N+y),ye!==S||f!==0&&ye.nodeType!==3||(P=N+f),ye.nodeType===3&&(N+=ye.nodeValue.length),(se=ye.firstChild)!==null;)ae=ye,ye=se;for(;;){if(ye===a)break t;if(ae===u&&++re===y&&(M=N),ae===S&&++he===f&&(P=N),(se=ye.nextSibling)!==null)break;ye=ae,ae=ye.parentNode}ye=se}u=M===-1||P===-1?null:{start:M,end:P}}else u=null}u=u||{start:0,end:0}}else u=null;for(dy={focusedElem:a,selectionRange:u},Oh=!1,Xn=i;Xn!==null;)if(i=Xn,a=i.child,(i.subtreeFlags&1024)!==0&&a!==null)a.return=i,Xn=a;else for(;Xn!==null;){switch(i=Xn,S=i.alternate,a=i.flags,i.tag){case 0:break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,u=i,y=S.memoizedProps,S=S.memoizedState,f=u.stateNode;try{var ot=zi(u.type,y,u.elementType===u.type);a=f.getSnapshotBeforeUpdate(ot,S),f.__reactInternalSnapshotBeforeUpdate=a}catch(et){nn(u,u.return,et)}}break;case 3:if((a&1024)!==0){if(a=i.stateNode.containerInfo,u=a.nodeType,u===9)my(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":my(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=i.sibling,a!==null){a.return=i.return,Xn=a;break}Xn=i.return}}function Jw(a,i,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:jo(a,u),f&4&&Iu(5,u);break;case 1:if(jo(a,u),f&4)if(a=u.stateNode,i===null)try{a.componentDidMount()}catch(N){nn(u,u.return,N)}else{var y=zi(u.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(y,i,a.__reactInternalSnapshotBeforeUpdate)}catch(N){nn(u,u.return,N)}}f&64&&Kw(u),f&512&&Lu(u,u.return);break;case 3:if(jo(a,u),f&64&&(a=u.updateQueue,a!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{kC(a,i)}catch(N){nn(u,u.return,N)}}break;case 27:i===null&&f&4&&Qw(u);case 26:case 5:jo(a,u),i===null&&f&4&&Yw(u),f&512&&Lu(u,u.return);break;case 12:jo(a,u);break;case 13:jo(a,u),f&4&&nE(a,u),f&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=mM.bind(null,u),OM(a,u))));break;case 22:if(f=u.memoizedState!==null||Bs,!f){i=i!==null&&i.memoizedState!==null||wn,y=Bs;var S=wn;Bs=f,(wn=i)&&!S?No(a,u,(u.subtreeFlags&8772)!==0):jo(a,u),Bs=y,wn=S}break;case 30:break;default:jo(a,u)}}function eE(a){var i=a.alternate;i!==null&&(a.alternate=null,eE(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&Ke(i)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var ln=null,Mr=!1;function Gs(a,i,u){for(u=u.child;u!==null;)tE(a,i,u),u=u.sibling}function tE(a,i,u){if(Be&&typeof Be.onCommitFiberUnmount=="function")try{Be.onCommitFiberUnmount(ke,u)}catch{}switch(u.tag){case 26:wn||as(u,i),Gs(a,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:wn||as(u,i);var f=ln,y=Mr;Io(u.type)&&(ln=u.stateNode,Mr=!1),Gs(a,i,u),Gu(u.stateNode),ln=f,Mr=y;break;case 5:wn||as(u,i);case 6:if(f=ln,y=Mr,ln=null,Gs(a,i,u),ln=f,Mr=y,ln!==null)if(Mr)try{(ln.nodeType===9?ln.body:ln.nodeName==="HTML"?ln.ownerDocument.body:ln).removeChild(u.stateNode)}catch(S){nn(u,i,S)}else try{ln.removeChild(u.stateNode)}catch(S){nn(u,i,S)}break;case 18:ln!==null&&(Mr?(a=ln,$E(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Ju(a)):$E(ln,u.stateNode));break;case 4:f=ln,y=Mr,ln=u.stateNode.containerInfo,Mr=!0,Gs(a,i,u),ln=f,Mr=y;break;case 0:case 11:case 14:case 15:wn||_o(2,u,i),wn||_o(4,u,i),Gs(a,i,u);break;case 1:wn||(as(u,i),f=u.stateNode,typeof f.componentWillUnmount=="function"&&Zw(u,i,f)),Gs(a,i,u);break;case 21:Gs(a,i,u);break;case 22:wn=(f=wn)||u.memoizedState!==null,Gs(a,i,u),wn=f;break;default:Gs(a,i,u)}}function nE(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Ju(a)}catch(u){nn(i,i.return,u)}}function oM(a){switch(a.tag){case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new Xw),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new Xw),i;default:throw Error(r(435,a.tag))}}function Vv(a,i){var u=oM(a);i.forEach(function(f){var y=pM.bind(null,a,f);u.has(f)||(u.add(f),f.then(y,y))})}function Kr(a,i){var u=i.deletions;if(u!==null)for(var f=0;f<u.length;f++){var y=u[f],S=a,N=i,M=N;e:for(;M!==null;){switch(M.tag){case 27:if(Io(M.type)){ln=M.stateNode,Mr=!1;break e}break;case 5:ln=M.stateNode,Mr=!1;break e;case 3:case 4:ln=M.stateNode.containerInfo,Mr=!0;break e}M=M.return}if(ln===null)throw Error(r(160));tE(S,N,y),ln=null,Mr=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(i.subtreeFlags&13878)for(i=i.child;i!==null;)rE(i,a),i=i.sibling}var Ua=null;function rE(a,i){var u=a.alternate,f=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Kr(i,a),Zr(a),f&4&&(_o(3,a,a.return),Iu(3,a),_o(5,a,a.return));break;case 1:Kr(i,a),Zr(a),f&512&&(wn||u===null||as(u,u.return)),f&64&&Bs&&(a=a.updateQueue,a!==null&&(f=a.callbacks,f!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var y=Ua;if(Kr(i,a),Zr(a),f&512&&(wn||u===null||as(u,u.return)),f&4){var S=u!==null?u.memoizedState:null;if(f=a.memoizedState,u===null)if(f===null)if(a.stateNode===null){e:{f=a.type,u=a.memoizedProps,y=y.ownerDocument||y;t:switch(f){case"title":S=y.getElementsByTagName("title")[0],(!S||S[qe]||S[pe]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(f),y.head.insertBefore(S,y.querySelector("head > title"))),or(S,f,u),S[pe]=a,dt(S),f=S;break e;case"link":var N=QE("link","href",y).get(f+(u.href||""));if(N){for(var M=0;M<N.length;M++)if(S=N[M],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){N.splice(M,1);break t}}S=y.createElement(f),or(S,f,u),y.head.appendChild(S);break;case"meta":if(N=QE("meta","content",y).get(f+(u.content||""))){for(M=0;M<N.length;M++)if(S=N[M],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){N.splice(M,1);break t}}S=y.createElement(f),or(S,f,u),y.head.appendChild(S);break;default:throw Error(r(468,f))}S[pe]=a,dt(S),f=S}a.stateNode=f}else XE(y,a.type,a.stateNode);else a.stateNode=WE(y,f,a.memoizedProps);else S!==f?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,f===null?XE(y,a.type,a.stateNode):WE(y,f,a.memoizedProps)):f===null&&a.stateNode!==null&&Pv(a,a.memoizedProps,u.memoizedProps)}break;case 27:Kr(i,a),Zr(a),f&512&&(wn||u===null||as(u,u.return)),u!==null&&f&4&&Pv(a,a.memoizedProps,u.memoizedProps);break;case 5:if(Kr(i,a),Zr(a),f&512&&(wn||u===null||as(u,u.return)),a.flags&32){y=a.stateNode;try{Nl(y,"")}catch(se){nn(a,a.return,se)}}f&4&&a.stateNode!=null&&(y=a.memoizedProps,Pv(a,y,u!==null?u.memoizedProps:y)),f&1024&&(Hv=!0);break;case 6:if(Kr(i,a),Zr(a),f&4){if(a.stateNode===null)throw Error(r(162));f=a.memoizedProps,u=a.stateNode;try{u.nodeValue=f}catch(se){nn(a,a.return,se)}}break;case 3:if(Nh=null,y=Ua,Ua=_h(i.containerInfo),Kr(i,a),Ua=y,Zr(a),f&4&&u!==null&&u.memoizedState.isDehydrated)try{Ju(i.containerInfo)}catch(se){nn(a,a.return,se)}Hv&&(Hv=!1,aE(a));break;case 4:f=Ua,Ua=_h(a.stateNode.containerInfo),Kr(i,a),Zr(a),Ua=f;break;case 12:Kr(i,a),Zr(a);break;case 13:Kr(i,a),Zr(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Kv=Tt()),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Vv(a,f)));break;case 22:y=a.memoizedState!==null;var P=u!==null&&u.memoizedState!==null,re=Bs,he=wn;if(Bs=re||y,wn=he||P,Kr(i,a),wn=he,Bs=re,Zr(a),f&8192)e:for(i=a.stateNode,i._visibility=y?i._visibility&-2:i._visibility|1,y&&(u===null||P||Bs||wn||$i(a)),u=null,i=a;;){if(i.tag===5||i.tag===26){if(u===null){P=u=i;try{if(S=P.stateNode,y)N=S.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{M=P.stateNode;var ye=P.memoizedProps.style,ae=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;M.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(se){nn(P,P.return,se)}}}else if(i.tag===6){if(u===null){P=i;try{P.stateNode.nodeValue=y?"":P.memoizedProps}catch(se){nn(P,P.return,se)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===a)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=a.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,Vv(a,u))));break;case 19:Kr(i,a),Zr(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Vv(a,f)));break;case 30:break;case 21:break;default:Kr(i,a),Zr(a)}}function Zr(a){var i=a.flags;if(i&2){try{for(var u,f=a.return;f!==null;){if(Ww(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,S=Uv(a);mh(a,S,y);break;case 5:var N=u.stateNode;u.flags&32&&(Nl(N,""),u.flags&=-33);var M=Uv(a);mh(a,M,N);break;case 3:case 4:var P=u.stateNode.containerInfo,re=Uv(a);Fv(a,re,P);break;default:throw Error(r(161))}}catch(he){nn(a,a.return,he)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function aE(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;aE(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function jo(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Jw(a,i.alternate,i),i=i.sibling}function $i(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:_o(4,i,i.return),$i(i);break;case 1:as(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&Zw(i,i.return,u),$i(i);break;case 27:Gu(i.stateNode);case 26:case 5:as(i,i.return),$i(i);break;case 22:i.memoizedState===null&&$i(i);break;case 30:$i(i);break;default:$i(i)}a=a.sibling}}function No(a,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,y=a,S=i,N=S.flags;switch(S.tag){case 0:case 11:case 15:No(y,S,u),Iu(4,S);break;case 1:if(No(y,S,u),f=S,y=f.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(re){nn(f,f.return,re)}if(f=S,y=f.updateQueue,y!==null){var M=f.stateNode;try{var P=y.shared.hiddenCallbacks;if(P!==null)for(y.shared.hiddenCallbacks=null,y=0;y<P.length;y++)MC(P[y],M)}catch(re){nn(f,f.return,re)}}u&&N&64&&Kw(S),Lu(S,S.return);break;case 27:Qw(S);case 26:case 5:No(y,S,u),u&&f===null&&N&4&&Yw(S),Lu(S,S.return);break;case 12:No(y,S,u);break;case 13:No(y,S,u),u&&N&4&&nE(y,S);break;case 22:S.memoizedState===null&&No(y,S,u),Lu(S,S.return);break;case 30:break;default:No(y,S,u)}i=i.sibling}}function zv(a,i){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&Su(u))}function $v(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Su(a))}function ss(a,i,u,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)sE(a,i,u,f),i=i.sibling}function sE(a,i,u,f){var y=i.flags;switch(i.tag){case 0:case 11:case 15:ss(a,i,u,f),y&2048&&Iu(9,i);break;case 1:ss(a,i,u,f);break;case 3:ss(a,i,u,f),y&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Su(a)));break;case 12:if(y&2048){ss(a,i,u,f),a=i.stateNode;try{var S=i.memoizedProps,N=S.id,M=S.onPostCommit;typeof M=="function"&&M(N,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(P){nn(i,i.return,P)}}else ss(a,i,u,f);break;case 13:ss(a,i,u,f);break;case 23:break;case 22:S=i.stateNode,N=i.alternate,i.memoizedState!==null?S._visibility&2?ss(a,i,u,f):Pu(a,i):S._visibility&2?ss(a,i,u,f):(S._visibility|=2,Zl(a,i,u,f,(i.subtreeFlags&10256)!==0)),y&2048&&zv(N,i);break;case 24:ss(a,i,u,f),y&2048&&$v(i.alternate,i);break;default:ss(a,i,u,f)}}function Zl(a,i,u,f,y){for(y=y&&(i.subtreeFlags&10256)!==0,i=i.child;i!==null;){var S=a,N=i,M=u,P=f,re=N.flags;switch(N.tag){case 0:case 11:case 15:Zl(S,N,M,P,y),Iu(8,N);break;case 23:break;case 22:var he=N.stateNode;N.memoizedState!==null?he._visibility&2?Zl(S,N,M,P,y):Pu(S,N):(he._visibility|=2,Zl(S,N,M,P,y)),y&&re&2048&&zv(N.alternate,N);break;case 24:Zl(S,N,M,P,y),y&&re&2048&&$v(N.alternate,N);break;default:Zl(S,N,M,P,y)}i=i.sibling}}function Pu(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=a,f=i,y=f.flags;switch(f.tag){case 22:Pu(u,f),y&2048&&zv(f.alternate,f);break;case 24:Pu(u,f),y&2048&&$v(f.alternate,f);break;default:Pu(u,f)}i=i.sibling}}var Uu=8192;function Yl(a){if(a.subtreeFlags&Uu)for(a=a.child;a!==null;)oE(a),a=a.sibling}function oE(a){switch(a.tag){case 26:Yl(a),a.flags&Uu&&a.memoizedState!==null&&GM(Ua,a.memoizedState,a.memoizedProps);break;case 5:Yl(a);break;case 3:case 4:var i=Ua;Ua=_h(a.stateNode.containerInfo),Yl(a),Ua=i;break;case 22:a.memoizedState===null&&(i=a.alternate,i!==null&&i.memoizedState!==null?(i=Uu,Uu=16777216,Yl(a),Uu=i):Yl(a));break;default:Yl(a)}}function iE(a){var i=a.alternate;if(i!==null&&(a=i.child,a!==null)){i.child=null;do i=a.sibling,a.sibling=null,a=i;while(a!==null)}}function Fu(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];Xn=f,cE(f,a)}iE(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)lE(a),a=a.sibling}function lE(a){switch(a.tag){case 0:case 11:case 15:Fu(a),a.flags&2048&&_o(9,a,a.return);break;case 3:Fu(a);break;case 12:Fu(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&2&&(a.return===null||a.return.tag!==13)?(i._visibility&=-3,ph(a)):Fu(a);break;default:Fu(a)}}function ph(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];Xn=f,cE(f,a)}iE(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:_o(8,i,i.return),ph(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,ph(i));break;default:ph(i)}a=a.sibling}}function cE(a,i){for(;Xn!==null;){var u=Xn;switch(u.tag){case 0:case 11:case 15:_o(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Su(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,Xn=f;else e:for(u=a;Xn!==null;){f=Xn;var y=f.sibling,S=f.return;if(eE(f),f===u){Xn=null;break e}if(y!==null){y.return=S,Xn=y;break e}Xn=S}}}var iM={getCacheForType:function(a){var i=fr(Hn),u=i.data.get(a);return u===void 0&&(u=a(),i.data.set(a,u)),u}},lM=typeof WeakMap=="function"?WeakMap:Map,$t=0,sn=null,Ct=null,_t=0,Bt=0,Yr=null,Ao=!1,Wl=!1,Bv=!1,qs=0,vn=0,Do=0,Bi=0,Gv=0,wa=0,Ql=0,Hu=null,kr=null,qv=!1,Kv=0,gh=1/0,vh=null,Oo=null,sr=0,Mo=null,Xl=null,Jl=0,Zv=0,Yv=null,uE=null,Vu=0,Wv=null;function Wr(){if(($t&2)!==0&&_t!==0)return _t&-_t;if(I.T!==null){var a=Hl;return a!==0?a:ry()}return F()}function dE(){wa===0&&(wa=(_t&536870912)===0||Pt?po():536870912);var a=Ca.current;return a!==null&&(a.flags|=32),wa}function Qr(a,i,u){(a===sn&&(Bt===2||Bt===9)||a.cancelPendingCommit!==null)&&(ec(a,0),ko(a,_t,wa,!1)),on(a,u),(($t&2)===0||a!==sn)&&(a===sn&&(($t&2)===0&&(Bi|=u),vn===4&&ko(a,_t,wa,!1)),os(a))}function fE(a,i,u){if(($t&6)!==0)throw Error(r(327));var f=!u&&(i&124)===0&&(i&a.expiredLanes)===0||Ar(a,i),y=f?dM(a,i):Jv(a,i,!0),S=f;do{if(y===0){Wl&&!f&&ko(a,i,0,!1);break}else{if(u=a.current.alternate,S&&!cM(u)){y=Jv(a,i,!1),S=!1;continue}if(y===2){if(S=i,a.errorRecoveryDisabledLanes&S)var N=0;else N=a.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var M=a;y=Hu;var P=M.current.memoizedState.isDehydrated;if(P&&(ec(M,N).flags|=256),N=Jv(M,N,!1),N!==2){if(Bv&&!P){M.errorRecoveryDisabledLanes|=S,Bi|=S,y=4;break e}S=kr,kr=y,S!==null&&(kr===null?kr=S:kr.push.apply(kr,S))}y=N}if(S=!1,y!==2)continue}}if(y===1){ec(a,0),ko(a,i,0,!0);break}e:{switch(f=a,S=y,S){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:ko(f,i,wa,!Ao);break e;case 2:kr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(y=Kv+300-Tt(),10<y)){if(ko(f,i,wa,!Ao),$r(f,0,!0)!==0)break e;f.timeoutHandle=VE(hE.bind(null,f,u,kr,vh,qv,i,wa,Bi,Ql,Ao,S,2,-0,0),y);break e}hE(f,u,kr,vh,qv,i,wa,Bi,Ql,Ao,S,0,-0,0)}}break}while(!0);os(a)}function hE(a,i,u,f,y,S,N,M,P,re,he,ye,ae,se){if(a.timeoutHandle=-1,ye=i.subtreeFlags,(ye&8192||(ye&16785408)===16785408)&&(Zu={stylesheets:null,count:0,unsuspend:BM},oE(i),ye=qM(),ye!==null)){a.cancelPendingCommit=ye(bE.bind(null,a,i,S,u,f,y,N,M,P,he,1,ae,se)),ko(a,S,N,!re);return}bE(a,i,S,u,f,y,N,M,P)}function cM(a){for(var i=a;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var y=u[f],S=y.getSnapshot;y=y.value;try{if(!Gr(S(),y))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ko(a,i,u,f){i&=~Gv,i&=~Bi,a.suspendedLanes|=i,a.pingedLanes&=~i,f&&(a.warmLanes|=i),f=a.expirationTimes;for(var y=i;0<y;){var S=31-Et(y),N=1<<S;f[S]=-1,y&=~N}u!==0&&Sn(a,u,i)}function yh(){return($t&6)===0?(zu(0),!1):!0}function Qv(){if(Ct!==null){if(Bt===0)var a=Ct.return;else a=Ct,Us=Ui=null,mv(a),ql=null,Ou=0,a=Ct;for(;a!==null;)qw(a.alternate,a),a=a.return;Ct=null}}function ec(a,i){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,_M(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),Qv(),sn=a,Ct=u=Is(a.current,null),_t=i,Bt=0,Yr=null,Ao=!1,Wl=Ar(a,i),Bv=!1,Ql=wa=Gv=Bi=Do=vn=0,kr=Hu=null,qv=!1,(i&8)!==0&&(i|=i&32);var f=a.entangledLanes;if(f!==0)for(a=a.entanglements,f&=i;0<f;){var y=31-Et(f),S=1<<y;i|=a[y],f&=~S}return qs=i,Hf(),u}function mE(a,i){yt=null,I.H=sh,i===wu||i===Yf?(i=DC(),Bt=3):i===jC?(i=DC(),Bt=4):Bt=i===Ow?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Yr=i,Ct===null&&(vn=1,uh(a,ya(i,a.current)))}function pE(){var a=I.H;return I.H=sh,a===null?sh:a}function gE(){var a=I.A;return I.A=iM,a}function Xv(){vn=4,Ao||(_t&4194048)!==_t&&Ca.current!==null||(Wl=!0),(Do&134217727)===0&&(Bi&134217727)===0||sn===null||ko(sn,_t,wa,!1)}function Jv(a,i,u){var f=$t;$t|=2;var y=pE(),S=gE();(sn!==a||_t!==i)&&(vh=null,ec(a,i)),i=!1;var N=vn;e:do try{if(Bt!==0&&Ct!==null){var M=Ct,P=Yr;switch(Bt){case 8:Qv(),N=6;break e;case 3:case 2:case 9:case 6:Ca.current===null&&(i=!0);var re=Bt;if(Bt=0,Yr=null,tc(a,M,P,re),u&&Wl){N=0;break e}break;default:re=Bt,Bt=0,Yr=null,tc(a,M,P,re)}}uM(),N=vn;break}catch(he){mE(a,he)}while(!0);return i&&a.shellSuspendCounter++,Us=Ui=null,$t=f,I.H=y,I.A=S,Ct===null&&(sn=null,_t=0,Hf()),N}function uM(){for(;Ct!==null;)vE(Ct)}function dM(a,i){var u=$t;$t|=2;var f=pE(),y=gE();sn!==a||_t!==i?(vh=null,gh=Tt()+500,ec(a,i)):Wl=Ar(a,i);e:do try{if(Bt!==0&&Ct!==null){i=Ct;var S=Yr;t:switch(Bt){case 1:Bt=0,Yr=null,tc(a,i,S,1);break;case 2:case 9:if(NC(S)){Bt=0,Yr=null,yE(i);break}i=function(){Bt!==2&&Bt!==9||sn!==a||(Bt=7),os(a)},S.then(i,i);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:NC(S)?(Bt=0,Yr=null,yE(i)):(Bt=0,Yr=null,tc(a,i,S,7));break;case 5:var N=null;switch(Ct.tag){case 26:N=Ct.memoizedState;case 5:case 27:var M=Ct;if(!N||JE(N)){Bt=0,Yr=null;var P=M.sibling;if(P!==null)Ct=P;else{var re=M.return;re!==null?(Ct=re,xh(re)):Ct=null}break t}}Bt=0,Yr=null,tc(a,i,S,5);break;case 6:Bt=0,Yr=null,tc(a,i,S,6);break;case 8:Qv(),vn=6;break e;default:throw Error(r(462))}}fM();break}catch(he){mE(a,he)}while(!0);return Us=Ui=null,I.H=f,I.A=y,$t=u,Ct!==null?0:(sn=null,_t=0,Hf(),vn)}function fM(){for(;Ct!==null&&!vt();)vE(Ct)}function vE(a){var i=Bw(a.alternate,a,qs);a.memoizedProps=a.pendingProps,i===null?xh(a):Ct=i}function yE(a){var i=a,u=i.alternate;switch(i.tag){case 15:case 0:i=Uw(u,i,i.pendingProps,i.type,void 0,_t);break;case 11:i=Uw(u,i,i.pendingProps,i.type.render,i.ref,_t);break;case 5:mv(i);default:qw(u,i),i=Ct=xC(i,qs),i=Bw(u,i,qs)}a.memoizedProps=a.pendingProps,i===null?xh(a):Ct=i}function tc(a,i,u,f){Us=Ui=null,mv(i),ql=null,Ou=0;var y=i.return;try{if(tM(a,y,i,u,_t)){vn=1,uh(a,ya(u,a.current)),Ct=null;return}}catch(S){if(y!==null)throw Ct=y,S;vn=1,uh(a,ya(u,a.current)),Ct=null;return}i.flags&32768?(Pt||f===1?a=!0:Wl||(_t&536870912)!==0?a=!1:(Ao=a=!0,(f===2||f===9||f===3||f===6)&&(f=Ca.current,f!==null&&f.tag===13&&(f.flags|=16384))),xE(i,a)):xh(i)}function xh(a){var i=a;do{if((i.flags&32768)!==0){xE(i,Ao);return}a=i.return;var u=rM(i.alternate,i,qs);if(u!==null){Ct=u;return}if(i=i.sibling,i!==null){Ct=i;return}Ct=i=a}while(i!==null);vn===0&&(vn=5)}function xE(a,i){do{var u=aM(a.alternate,a);if(u!==null){u.flags&=32767,Ct=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(a=a.sibling,a!==null)){Ct=a;return}Ct=a=u}while(a!==null);vn=6,Ct=null}function bE(a,i,u,f,y,S,N,M,P){a.cancelPendingCommit=null;do bh();while(sr!==0);if(($t&6)!==0)throw Error(r(327));if(i!==null){if(i===a.current)throw Error(r(177));if(S=i.lanes|i.childLanes,S|=$g,Yn(a,u,S,N,M,P),a===sn&&(Ct=sn=null,_t=0),Xl=i,Mo=a,Jl=u,Zv=S,Yv=y,uE=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,gM(te,function(){return RE(),null})):(a.callbackNode=null,a.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=I.T,I.T=null,y=W.p,W.p=2,N=$t,$t|=4;try{sM(a,i,u)}finally{$t=N,W.p=y,I.T=f}}sr=1,SE(),CE(),wE()}}function SE(){if(sr===1){sr=0;var a=Mo,i=Xl,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var f=W.p;W.p=2;var y=$t;$t|=4;try{rE(i,a);var S=dy,N=cC(a.containerInfo),M=S.focusedElem,P=S.selectionRange;if(N!==M&&M&&M.ownerDocument&&lC(M.ownerDocument.documentElement,M)){if(P!==null&&Ug(M)){var re=P.start,he=P.end;if(he===void 0&&(he=re),"selectionStart"in M)M.selectionStart=re,M.selectionEnd=Math.min(he,M.value.length);else{var ye=M.ownerDocument||document,ae=ye&&ye.defaultView||window;if(ae.getSelection){var se=ae.getSelection(),ot=M.textContent.length,et=Math.min(P.start,ot),en=P.end===void 0?et:Math.min(P.end,ot);!se.extend&&et>en&&(N=en,en=et,et=N);var Q=iC(M,et),$=iC(M,en);if(Q&&$&&(se.rangeCount!==1||se.anchorNode!==Q.node||se.anchorOffset!==Q.offset||se.focusNode!==$.node||se.focusOffset!==$.offset)){var ee=ye.createRange();ee.setStart(Q.node,Q.offset),se.removeAllRanges(),et>en?(se.addRange(ee),se.extend($.node,$.offset)):(ee.setEnd($.node,$.offset),se.addRange(ee))}}}}for(ye=[],se=M;se=se.parentNode;)se.nodeType===1&&ye.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<ye.length;M++){var ge=ye[M];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Oh=!!uy,dy=uy=null}finally{$t=y,W.p=f,I.T=u}}a.current=i,sr=2}}function CE(){if(sr===2){sr=0;var a=Mo,i=Xl,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var f=W.p;W.p=2;var y=$t;$t|=4;try{Jw(a,i.alternate,i)}finally{$t=y,W.p=f,I.T=u}}sr=3}}function wE(){if(sr===4||sr===3){sr=0,ut();var a=Mo,i=Xl,u=Jl,f=uE;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?sr=5:(sr=0,Xl=Mo=null,EE(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(Oo=null),Fn(u),i=i.stateNode,Be&&typeof Be.onCommitFiberRoot=="function")try{Be.onCommitFiberRoot(ke,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=I.T,y=W.p,W.p=2,I.T=null;try{for(var S=a.onRecoverableError,N=0;N<f.length;N++){var M=f[N];S(M.value,{componentStack:M.stack})}}finally{I.T=i,W.p=y}}(Jl&3)!==0&&bh(),os(a),y=a.pendingLanes,(u&4194090)!==0&&(y&42)!==0?a===Wv?Vu++:(Vu=0,Wv=a):Vu=0,zu(0)}}function EE(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,Su(i)))}function bh(a){return SE(),CE(),wE(),RE()}function RE(){if(sr!==5)return!1;var a=Mo,i=Zv;Zv=0;var u=Fn(Jl),f=I.T,y=W.p;try{W.p=32>u?32:u,I.T=null,u=Yv,Yv=null;var S=Mo,N=Jl;if(sr=0,Xl=Mo=null,Jl=0,($t&6)!==0)throw Error(r(331));var M=$t;if($t|=4,lE(S.current),sE(S,S.current,N,u),$t=M,zu(0,!1),Be&&typeof Be.onPostCommitFiberRoot=="function")try{Be.onPostCommitFiberRoot(ke,S)}catch{}return!0}finally{W.p=y,I.T=f,EE(a,i)}}function TE(a,i,u){i=ya(u,i),i=jv(a.stateNode,i,2),a=wo(a,i,2),a!==null&&(on(a,2),os(a))}function nn(a,i,u){if(a.tag===3)TE(a,a,u);else for(;i!==null;){if(i.tag===3){TE(i,a,u);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Oo===null||!Oo.has(f))){a=ya(u,a),u=Aw(2),f=wo(i,u,2),f!==null&&(Dw(u,f,i,a),on(f,2),os(f));break}}i=i.return}}function ey(a,i,u){var f=a.pingCache;if(f===null){f=a.pingCache=new lM;var y=new Set;f.set(i,y)}else y=f.get(i),y===void 0&&(y=new Set,f.set(i,y));y.has(u)||(Bv=!0,y.add(u),a=hM.bind(null,a,i,u),i.then(a,a))}function hM(a,i,u){var f=a.pingCache;f!==null&&f.delete(i),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,sn===a&&(_t&u)===u&&(vn===4||vn===3&&(_t&62914560)===_t&&300>Tt()-Kv?($t&2)===0&&ec(a,0):Gv|=u,Ql===_t&&(Ql=0)),os(a)}function _E(a,i){i===0&&(i=Tl()),a=Ll(a,i),a!==null&&(on(a,i),os(a))}function mM(a){var i=a.memoizedState,u=0;i!==null&&(u=i.retryLane),_E(a,u)}function pM(a,i){var u=0;switch(a.tag){case 13:var f=a.stateNode,y=a.memoizedState;y!==null&&(u=y.retryLane);break;case 19:f=a.stateNode;break;case 22:f=a.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(i),_E(a,u)}function gM(a,i){return Ht(a,i)}var Sh=null,nc=null,ty=!1,Ch=!1,ny=!1,Gi=0;function os(a){a!==nc&&a.next===null&&(nc===null?Sh=nc=a:nc=nc.next=a),Ch=!0,ty||(ty=!0,yM())}function zu(a,i){if(!ny&&Ch){ny=!0;do for(var u=!1,f=Sh;f!==null;){if(a!==0){var y=f.pendingLanes;if(y===0)var S=0;else{var N=f.suspendedLanes,M=f.pingedLanes;S=(1<<31-Et(42|a)+1)-1,S&=y&~(N&~M),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,DE(f,S))}else S=_t,S=$r(f,f===sn?S:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(S&3)===0||Ar(f,S)||(u=!0,DE(f,S));f=f.next}while(u);ny=!1}}function vM(){jE()}function jE(){Ch=ty=!1;var a=0;Gi!==0&&(TM()&&(a=Gi),Gi=0);for(var i=Tt(),u=null,f=Sh;f!==null;){var y=f.next,S=NE(f,i);S===0?(f.next=null,u===null?Sh=y:u.next=y,y===null&&(nc=u)):(u=f,(a!==0||(S&3)!==0)&&(Ch=!0)),f=y}zu(a)}function NE(a,i){for(var u=a.suspendedLanes,f=a.pingedLanes,y=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var N=31-Et(S),M=1<<N,P=y[N];P===-1?((M&u)===0||(M&f)!==0)&&(y[N]=es(M,i)):P<=i&&(a.expiredLanes|=M),S&=~M}if(i=sn,u=_t,u=$r(a,a===i?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f=a.callbackNode,u===0||a===i&&(Bt===2||Bt===9)||a.cancelPendingCommit!==null)return f!==null&&f!==null&&Ne(f),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||Ar(a,u)){if(i=u&-u,i===a.callbackPriority)return i;switch(f!==null&&Ne(f),Fn(u)){case 2:case 8:u=H;break;case 32:u=te;break;case 268435456:u=_e;break;default:u=te}return f=AE.bind(null,a),u=Ht(u,f),a.callbackPriority=i,a.callbackNode=u,i}return f!==null&&f!==null&&Ne(f),a.callbackPriority=2,a.callbackNode=null,2}function AE(a,i){if(sr!==0&&sr!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(bh()&&a.callbackNode!==u)return null;var f=_t;return f=$r(a,a===sn?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f===0?null:(fE(a,f,i),NE(a,Tt()),a.callbackNode!=null&&a.callbackNode===u?AE.bind(null,a):null)}function DE(a,i){if(bh())return null;fE(a,i,!0)}function yM(){jM(function(){($t&6)!==0?Ht(ur,vM):jE()})}function ry(){return Gi===0&&(Gi=po()),Gi}function OE(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Mf(""+a)}function ME(a,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,a.id&&u.setAttribute("form",a.id),i.parentNode.insertBefore(u,i),a=new FormData(a),u.parentNode.removeChild(u),a}function xM(a,i,u,f,y){if(i==="submit"&&u&&u.stateNode===y){var S=OE((y[xe]||null).action),N=f.submitter;N&&(i=(i=N[xe]||null)?OE(i.formAction):N.getAttribute("formAction"),i!==null&&(S=i,N=null));var M=new Pf("action","action",null,f,y);a.push({event:M,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Gi!==0){var P=N?ME(y,N):new FormData(y);wv(u,{pending:!0,data:P,method:y.method,action:S},null,P)}}else typeof S=="function"&&(M.preventDefault(),P=N?ME(y,N):new FormData(y),wv(u,{pending:!0,data:P,method:y.method,action:S},S,P))},currentTarget:y}]})}}for(var ay=0;ay<zg.length;ay++){var sy=zg[ay],bM=sy.toLowerCase(),SM=sy[0].toUpperCase()+sy.slice(1);Pa(bM,"on"+SM)}Pa(fC,"onAnimationEnd"),Pa(hC,"onAnimationIteration"),Pa(mC,"onAnimationStart"),Pa("dblclick","onDoubleClick"),Pa("focusin","onFocus"),Pa("focusout","onBlur"),Pa(U3,"onTransitionRun"),Pa(F3,"onTransitionStart"),Pa(H3,"onTransitionCancel"),Pa(pC,"onTransitionEnd"),Cr("onMouseEnter",["mouseout","mouseover"]),Cr("onMouseLeave",["mouseout","mouseover"]),Cr("onPointerEnter",["pointerout","pointerover"]),Cr("onPointerLeave",["pointerout","pointerover"]),Br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Br("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Br("onBeforeInput",["compositionend","keypress","textInput","paste"]),Br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $u="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(" "),CM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($u));function kE(a,i){i=(i&4)!==0;for(var u=0;u<a.length;u++){var f=a[u],y=f.event;f=f.listeners;e:{var S=void 0;if(i)for(var N=f.length-1;0<=N;N--){var M=f[N],P=M.instance,re=M.currentTarget;if(M=M.listener,P!==S&&y.isPropagationStopped())break e;S=M,y.currentTarget=re;try{S(y)}catch(he){ch(he)}y.currentTarget=null,S=P}else for(N=0;N<f.length;N++){if(M=f[N],P=M.instance,re=M.currentTarget,M=M.listener,P!==S&&y.isPropagationStopped())break e;S=M,y.currentTarget=re;try{S(y)}catch(he){ch(he)}y.currentTarget=null,S=P}}}}function wt(a,i){var u=i[Ue];u===void 0&&(u=i[Ue]=new Set);var f=a+"__bubble";u.has(f)||(IE(i,a,2,!1),u.add(f))}function oy(a,i,u){var f=0;i&&(f|=4),IE(u,a,f,i)}var wh="_reactListening"+Math.random().toString(36).slice(2);function iy(a){if(!a[wh]){a[wh]=!0,Qt.forEach(function(u){u!=="selectionchange"&&(CM.has(u)||oy(u,!1,a),oy(u,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[wh]||(i[wh]=!0,oy("selectionchange",!1,i))}}function IE(a,i,u,f){switch(sR(i)){case 2:var y=YM;break;case 8:y=WM;break;default:y=Sy}u=y.bind(null,i,u,a),y=void 0,!Ng||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),f?y!==void 0?a.addEventListener(i,u,{capture:!0,passive:y}):a.addEventListener(i,u,!0):y!==void 0?a.addEventListener(i,u,{passive:y}):a.addEventListener(i,u,!1)}function ly(a,i,u,f,y){var S=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var N=f.tag;if(N===3||N===4){var M=f.stateNode.containerInfo;if(M===y)break;if(N===4)for(N=f.return;N!==null;){var P=N.tag;if((P===3||P===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;M!==null;){if(N=st(M),N===null)return;if(P=N.tag,P===5||P===6||P===26||P===27){f=S=N;continue e}M=M.parentNode}}f=f.return}zS(function(){var re=S,he=_g(u),ye=[];e:{var ae=gC.get(a);if(ae!==void 0){var se=Pf,ot=a;switch(a){case"keypress":if(If(u)===0)break e;case"keydown":case"keyup":se=g3;break;case"focusin":ot="focus",se=Mg;break;case"focusout":ot="blur",se=Mg;break;case"beforeblur":case"afterblur":se=Mg;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=GS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=a3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=x3;break;case fC:case hC:case mC:se=i3;break;case pC:se=S3;break;case"scroll":case"scrollend":se=n3;break;case"wheel":se=w3;break;case"copy":case"cut":case"paste":se=c3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=KS;break;case"toggle":case"beforetoggle":se=R3}var et=(i&4)!==0,en=!et&&(a==="scroll"||a==="scrollend"),Q=et?ae!==null?ae+"Capture":null:ae;et=[];for(var $=re,ee;$!==null;){var ge=$;if(ee=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||ee===null||Q===null||(ge=lu($,Q),ge!=null&&et.push(Bu($,ge,ee))),en)break;$=$.return}0<et.length&&(ae=new se(ae,ot,null,u,he),ye.push({event:ae,listeners:et}))}}if((i&7)===0){e:{if(ae=a==="mouseover"||a==="pointerover",se=a==="mouseout"||a==="pointerout",ae&&u!==Tg&&(ot=u.relatedTarget||u.fromElement)&&(st(ot)||ot[Oe]))break e;if((se||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,se?(ot=u.relatedTarget||u.toElement,se=re,ot=ot?st(ot):null,ot!==null&&(en=l(ot),et=ot.tag,ot!==en||et!==5&&et!==27&&et!==6)&&(ot=null)):(se=null,ot=re),se!==ot)){if(et=GS,ge="onMouseLeave",Q="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(et=KS,ge="onPointerLeave",Q="onPointerEnter",$="pointer"),en=se==null?ae:mn(se),ee=ot==null?ae:mn(ot),ae=new et(ge,$+"leave",se,u,he),ae.target=en,ae.relatedTarget=ee,ge=null,st(he)===re&&(et=new et(Q,$+"enter",ot,u,he),et.target=ee,et.relatedTarget=en,ge=et),en=ge,se&&ot)t:{for(et=se,Q=ot,$=0,ee=et;ee;ee=rc(ee))$++;for(ee=0,ge=Q;ge;ge=rc(ge))ee++;for(;0<$-ee;)et=rc(et),$--;for(;0<ee-$;)Q=rc(Q),ee--;for(;$--;){if(et===Q||Q!==null&&et===Q.alternate)break t;et=rc(et),Q=rc(Q)}et=null}else et=null;se!==null&&LE(ye,ae,se,et,!1),ot!==null&&en!==null&&LE(ye,en,ot,et,!0)}}e:{if(ae=re?mn(re):window,se=ae.nodeName&&ae.nodeName.toLowerCase(),se==="select"||se==="input"&&ae.type==="file")var Ve=tC;else if(JS(ae))if(nC)Ve=I3;else{Ve=M3;var bt=O3}else se=ae.nodeName,!se||se.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?re&&Rg(re.elementType)&&(Ve=tC):Ve=k3;if(Ve&&(Ve=Ve(a,re))){eC(ye,Ve,u,he);break e}bt&&bt(a,ae,re),a==="focusout"&&re&&ae.type==="number"&&re.memoizedProps.value!=null&&Eg(ae,"number",ae.value)}switch(bt=re?mn(re):window,a){case"focusin":(JS(bt)||bt.contentEditable==="true")&&(Ml=bt,Fg=re,gu=null);break;case"focusout":gu=Fg=Ml=null;break;case"mousedown":Hg=!0;break;case"contextmenu":case"mouseup":case"dragend":Hg=!1,uC(ye,u,he);break;case"selectionchange":if(P3)break;case"keydown":case"keyup":uC(ye,u,he)}var We;if(Ig)e:{switch(a){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else Ol?QS(a,u)&&(nt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(nt="onCompositionStart");nt&&(ZS&&u.locale!=="ko"&&(Ol||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Ol&&(We=$S()):(xo=he,Ag="value"in xo?xo.value:xo.textContent,Ol=!0)),bt=Eh(re,nt),0<bt.length&&(nt=new qS(nt,a,null,u,he),ye.push({event:nt,listeners:bt}),We?nt.data=We:(We=XS(u),We!==null&&(nt.data=We)))),(We=_3?j3(a,u):N3(a,u))&&(nt=Eh(re,"onBeforeInput"),0<nt.length&&(bt=new qS("onBeforeInput","beforeinput",null,u,he),ye.push({event:bt,listeners:nt}),bt.data=We)),xM(ye,a,re,u,he)}kE(ye,i)})}function Bu(a,i,u){return{instance:a,listener:i,currentTarget:u}}function Eh(a,i){for(var u=i+"Capture",f=[];a!==null;){var y=a,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=lu(a,u),y!=null&&f.unshift(Bu(a,y,S)),y=lu(a,i),y!=null&&f.push(Bu(a,y,S))),a.tag===3)return f;a=a.return}return[]}function rc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function LE(a,i,u,f,y){for(var S=i._reactName,N=[];u!==null&&u!==f;){var M=u,P=M.alternate,re=M.stateNode;if(M=M.tag,P!==null&&P===f)break;M!==5&&M!==26&&M!==27||re===null||(P=re,y?(re=lu(u,S),re!=null&&N.unshift(Bu(u,re,P))):y||(re=lu(u,S),re!=null&&N.push(Bu(u,re,P)))),u=u.return}N.length!==0&&a.push({event:i,listeners:N})}var wM=/\r\n?/g,EM=/\u0000|\uFFFD/g;function PE(a){return(typeof a=="string"?a:""+a).replace(wM,`
49
+ `).replace(EM,"")}function UE(a,i){return i=PE(i),PE(a)===i}function Rh(){}function Jt(a,i,u,f,y,S){switch(u){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||Nl(a,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&Nl(a,""+f);break;case"className":Ms(a,"class",f);break;case"tabIndex":Ms(a,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Ms(a,u,f);break;case"style":HS(a,f,S);break;case"data":if(i!=="object"){Ms(a,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||u!=="href")){a.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=Mf(""+f),a.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(i!=="input"&&Jt(a,i,"name",y.name,y,null),Jt(a,i,"formEncType",y.formEncType,y,null),Jt(a,i,"formMethod",y.formMethod,y,null),Jt(a,i,"formTarget",y.formTarget,y,null)):(Jt(a,i,"encType",y.encType,y,null),Jt(a,i,"method",y.method,y,null),Jt(a,i,"target",y.target,y,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=Mf(""+f),a.setAttribute(u,f);break;case"onClick":f!=null&&(a.onclick=Rh);break;case"onScroll":f!=null&&wt("scroll",a);break;case"onScrollEnd":f!=null&&wt("scrollend",a);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":a.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){a.removeAttribute("xlink:href");break}u=Mf(""+f),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,""+f):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":f===!0?a.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,f):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?a.setAttribute(u,f):a.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?a.removeAttribute(u):a.setAttribute(u,f);break;case"popover":wt("beforetoggle",a),wt("toggle",a),Os(a,"popover",f);break;case"xlinkActuate":pt(a,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":pt(a,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":pt(a,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":pt(a,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":pt(a,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":pt(a,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":pt(a,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":pt(a,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":pt(a,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Os(a,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=e3.get(u)||u,Os(a,u,f))}}function cy(a,i,u,f,y,S){switch(u){case"style":HS(a,f,S);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof f=="string"?Nl(a,f):(typeof f=="number"||typeof f=="bigint")&&Nl(a,""+f);break;case"onScroll":f!=null&&wt("scroll",a);break;case"onScrollEnd":f!=null&&wt("scrollend",a);break;case"onClick":f!=null&&(a.onclick=Rh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ts.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),i=u.slice(2,y?u.length-7:void 0),S=a[xe]||null,S=S!=null?S[u]:null,typeof S=="function"&&a.removeEventListener(i,S,y),typeof f=="function")){typeof S!="function"&&S!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(i,f,y);break e}u in a?a[u]=f:f===!0?a.setAttribute(u,""):Os(a,u,f)}}}function or(a,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":wt("error",a),wt("load",a);var f=!1,y=!1,S;for(S in u)if(u.hasOwnProperty(S)){var N=u[S];if(N!=null)switch(S){case"src":f=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Jt(a,i,S,N,u,null)}}y&&Jt(a,i,"srcSet",u.srcSet,u,null),f&&Jt(a,i,"src",u.src,u,null);return;case"input":wt("invalid",a);var M=S=N=y=null,P=null,re=null;for(f in u)if(u.hasOwnProperty(f)){var he=u[f];if(he!=null)switch(f){case"name":y=he;break;case"type":N=he;break;case"checked":P=he;break;case"defaultChecked":re=he;break;case"value":S=he;break;case"defaultValue":M=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,i));break;default:Jt(a,i,f,he,u,null)}}LS(a,S,M,P,re,N,y,!1),Df(a);return;case"select":wt("invalid",a),f=N=S=null;for(y in u)if(u.hasOwnProperty(y)&&(M=u[y],M!=null))switch(y){case"value":S=M;break;case"defaultValue":N=M;break;case"multiple":f=M;default:Jt(a,i,y,M,u,null)}i=S,u=N,a.multiple=!!f,i!=null?jl(a,!!f,i,!1):u!=null&&jl(a,!!f,u,!0);return;case"textarea":wt("invalid",a),S=y=f=null;for(N in u)if(u.hasOwnProperty(N)&&(M=u[N],M!=null))switch(N){case"value":f=M;break;case"defaultValue":y=M;break;case"children":S=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:Jt(a,i,N,M,u,null)}US(a,f,y,S),Df(a);return;case"option":for(P in u)if(u.hasOwnProperty(P)&&(f=u[P],f!=null))switch(P){case"selected":a.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Jt(a,i,P,f,u,null)}return;case"dialog":wt("beforetoggle",a),wt("toggle",a),wt("cancel",a),wt("close",a);break;case"iframe":case"object":wt("load",a);break;case"video":case"audio":for(f=0;f<$u.length;f++)wt($u[f],a);break;case"image":wt("error",a),wt("load",a);break;case"details":wt("toggle",a);break;case"embed":case"source":case"link":wt("error",a),wt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in u)if(u.hasOwnProperty(re)&&(f=u[re],f!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Jt(a,i,re,f,u,null)}return;default:if(Rg(i)){for(he in u)u.hasOwnProperty(he)&&(f=u[he],f!==void 0&&cy(a,i,he,f,u,void 0));return}}for(M in u)u.hasOwnProperty(M)&&(f=u[M],f!=null&&Jt(a,i,M,f,u,null))}function RM(a,i,u,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,N=null,M=null,P=null,re=null,he=null;for(se in u){var ye=u[se];if(u.hasOwnProperty(se)&&ye!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":P=ye;default:f.hasOwnProperty(se)||Jt(a,i,se,null,f,ye)}}for(var ae in f){var se=f[ae];if(ye=u[ae],f.hasOwnProperty(ae)&&(se!=null||ye!=null))switch(ae){case"type":S=se;break;case"name":y=se;break;case"checked":re=se;break;case"defaultChecked":he=se;break;case"value":N=se;break;case"defaultValue":M=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,i));break;default:se!==ye&&Jt(a,i,ae,se,f,ye)}}wg(a,N,M,P,re,he,S,y);return;case"select":se=N=M=ae=null;for(S in u)if(P=u[S],u.hasOwnProperty(S)&&P!=null)switch(S){case"value":break;case"multiple":se=P;default:f.hasOwnProperty(S)||Jt(a,i,S,null,f,P)}for(y in f)if(S=f[y],P=u[y],f.hasOwnProperty(y)&&(S!=null||P!=null))switch(y){case"value":ae=S;break;case"defaultValue":M=S;break;case"multiple":N=S;default:S!==P&&Jt(a,i,y,S,f,P)}i=M,u=N,f=se,ae!=null?jl(a,!!u,ae,!1):!!f!=!!u&&(i!=null?jl(a,!!u,i,!0):jl(a,!!u,u?[]:"",!1));return;case"textarea":se=ae=null;for(M in u)if(y=u[M],u.hasOwnProperty(M)&&y!=null&&!f.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Jt(a,i,M,null,f,y)}for(N in f)if(y=f[N],S=u[N],f.hasOwnProperty(N)&&(y!=null||S!=null))switch(N){case"value":ae=y;break;case"defaultValue":se=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==S&&Jt(a,i,N,y,f,S)}PS(a,ae,se);return;case"option":for(var ot in u)if(ae=u[ot],u.hasOwnProperty(ot)&&ae!=null&&!f.hasOwnProperty(ot))switch(ot){case"selected":a.selected=!1;break;default:Jt(a,i,ot,null,f,ae)}for(P in f)if(ae=f[P],se=u[P],f.hasOwnProperty(P)&&ae!==se&&(ae!=null||se!=null))switch(P){case"selected":a.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:Jt(a,i,P,ae,f,se)}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 et in u)ae=u[et],u.hasOwnProperty(et)&&ae!=null&&!f.hasOwnProperty(et)&&Jt(a,i,et,null,f,ae);for(re in f)if(ae=f[re],se=u[re],f.hasOwnProperty(re)&&ae!==se&&(ae!=null||se!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,i));break;default:Jt(a,i,re,ae,f,se)}return;default:if(Rg(i)){for(var en in u)ae=u[en],u.hasOwnProperty(en)&&ae!==void 0&&!f.hasOwnProperty(en)&&cy(a,i,en,void 0,f,ae);for(he in f)ae=f[he],se=u[he],!f.hasOwnProperty(he)||ae===se||ae===void 0&&se===void 0||cy(a,i,he,ae,f,se);return}}for(var Q in u)ae=u[Q],u.hasOwnProperty(Q)&&ae!=null&&!f.hasOwnProperty(Q)&&Jt(a,i,Q,null,f,ae);for(ye in f)ae=f[ye],se=u[ye],!f.hasOwnProperty(ye)||ae===se||ae==null&&se==null||Jt(a,i,ye,ae,f,se)}var uy=null,dy=null;function Th(a){return a.nodeType===9?a:a.ownerDocument}function FE(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function HE(a,i){if(a===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&i==="foreignObject"?0:a}function fy(a,i){return a==="textarea"||a==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var hy=null;function TM(){var a=window.event;return a&&a.type==="popstate"?a===hy?!1:(hy=a,!0):(hy=null,!1)}var VE=typeof setTimeout=="function"?setTimeout:void 0,_M=typeof clearTimeout=="function"?clearTimeout:void 0,zE=typeof Promise=="function"?Promise:void 0,jM=typeof queueMicrotask=="function"?queueMicrotask:typeof zE<"u"?function(a){return zE.resolve(null).then(a).catch(NM)}:VE;function NM(a){setTimeout(function(){throw a})}function Io(a){return a==="head"}function $E(a,i){var u=i,f=0,y=0;do{var S=u.nextSibling;if(a.removeChild(u),S&&S.nodeType===8)if(u=S.data,u==="/$"){if(0<f&&8>f){u=f;var N=a.ownerDocument;if(u&1&&Gu(N.documentElement),u&2&&Gu(N.body),u&4)for(u=N.head,Gu(u),N=u.firstChild;N;){var M=N.nextSibling,P=N.nodeName;N[qe]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&N.rel.toLowerCase()==="stylesheet"||u.removeChild(N),N=M}}if(y===0){a.removeChild(S),Ju(i);return}y--}else u==="$"||u==="$?"||u==="$!"?y++:f=u.charCodeAt(0)-48;else f=0;u=S}while(u);Ju(i)}function my(a){var i=a.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":my(u),Ke(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function AM(a,i,u,f){for(;a.nodeType===1;){var y=u;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(f){if(!a[qe])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=Fa(a.nextSibling),a===null)break}return null}function DM(a,i,u){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Fa(a.nextSibling),a===null))return null;return a}function py(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState==="complete"}function OM(a,i){var u=a.ownerDocument;if(a.data!=="$?"||u.readyState==="complete")i();else{var f=function(){i(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),a._reactRetry=f}}function Fa(a){for(;a!=null;a=a.nextSibling){var i=a.nodeType;if(i===1||i===3)break;if(i===8){if(i=a.data,i==="$"||i==="$!"||i==="$?"||i==="F!"||i==="F")break;if(i==="/$")return null}}return a}var gy=null;function BE(a){a=a.previousSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"){if(i===0)return a;i--}else u==="/$"&&i++}a=a.previousSibling}return null}function GE(a,i,u){switch(i=Th(u),a){case"html":if(a=i.documentElement,!a)throw Error(r(452));return a;case"head":if(a=i.head,!a)throw Error(r(453));return a;case"body":if(a=i.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Gu(a){for(var i=a.attributes;i.length;)a.removeAttributeNode(i[0]);Ke(a)}var Ea=new Map,qE=new Set;function _h(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ks=W.d;W.d={f:MM,r:kM,D:IM,C:LM,L:PM,m:UM,X:HM,S:FM,M:VM};function MM(){var a=Ks.f(),i=yh();return a||i}function kM(a){var i=Lt(a);i!==null&&i.tag===5&&i.type==="form"?fw(i):Ks.r(a)}var ac=typeof document>"u"?null:document;function KE(a,i,u){var f=ac;if(f&&typeof i=="string"&&i){var y=va(i);y='link[rel="'+a+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),qE.has(y)||(qE.add(y),a={rel:a,crossOrigin:u,href:i},f.querySelector(y)===null&&(i=f.createElement("link"),or(i,"link",a),dt(i),f.head.appendChild(i)))}}function IM(a){Ks.D(a),KE("dns-prefetch",a,null)}function LM(a,i){Ks.C(a,i),KE("preconnect",a,i)}function PM(a,i,u){Ks.L(a,i,u);var f=ac;if(f&&a&&i){var y='link[rel="preload"][as="'+va(i)+'"]';i==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+va(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+va(u.imageSizes)+'"]')):y+='[href="'+va(a)+'"]';var S=y;switch(i){case"style":S=sc(a);break;case"script":S=oc(a)}Ea.has(S)||(a=g({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:a,as:i},u),Ea.set(S,a),f.querySelector(y)!==null||i==="style"&&f.querySelector(qu(S))||i==="script"&&f.querySelector(Ku(S))||(i=f.createElement("link"),or(i,"link",a),dt(i),f.head.appendChild(i)))}}function UM(a,i){Ks.m(a,i);var u=ac;if(u&&a){var f=i&&typeof i.as=="string"?i.as:"script",y='link[rel="modulepreload"][as="'+va(f)+'"][href="'+va(a)+'"]',S=y;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=oc(a)}if(!Ea.has(S)&&(a=g({rel:"modulepreload",href:a},i),Ea.set(S,a),u.querySelector(y)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ku(S)))return}f=u.createElement("link"),or(f,"link",a),dt(f),u.head.appendChild(f)}}}function FM(a,i,u){Ks.S(a,i,u);var f=ac;if(f&&a){var y=pn(f).hoistableStyles,S=sc(a);i=i||"default";var N=y.get(S);if(!N){var M={loading:0,preload:null};if(N=f.querySelector(qu(S)))M.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":i},u),(u=Ea.get(S))&&vy(a,u);var P=N=f.createElement("link");dt(P),or(P,"link",a),P._p=new Promise(function(re,he){P.onload=re,P.onerror=he}),P.addEventListener("load",function(){M.loading|=1}),P.addEventListener("error",function(){M.loading|=2}),M.loading|=4,jh(N,i,f)}N={type:"stylesheet",instance:N,count:1,state:M},y.set(S,N)}}}function HM(a,i){Ks.X(a,i);var u=ac;if(u&&a){var f=pn(u).hoistableScripts,y=oc(a),S=f.get(y);S||(S=u.querySelector(Ku(y)),S||(a=g({src:a,async:!0},i),(i=Ea.get(y))&&yy(a,i),S=u.createElement("script"),dt(S),or(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},f.set(y,S))}}function VM(a,i){Ks.M(a,i);var u=ac;if(u&&a){var f=pn(u).hoistableScripts,y=oc(a),S=f.get(y);S||(S=u.querySelector(Ku(y)),S||(a=g({src:a,async:!0,type:"module"},i),(i=Ea.get(y))&&yy(a,i),S=u.createElement("script"),dt(S),or(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},f.set(y,S))}}function ZE(a,i,u,f){var y=(y=ve.current)?_h(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=sc(u.href),u=pn(y).hoistableStyles,f=u.get(i),f||(f={type:"style",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=sc(u.href);var S=pn(y).hoistableStyles,N=S.get(a);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,N),(S=y.querySelector(qu(a)))&&!S._p&&(N.instance=S,N.state.loading=5),Ea.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ea.set(a,u),S||zM(y,a,u,N.state))),i&&f===null)throw Error(r(528,""));return N}if(i&&f!==null)throw Error(r(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=oc(u),u=pn(y).hoistableScripts,f=u.get(i),f||(f={type:"script",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function sc(a){return'href="'+va(a)+'"'}function qu(a){return'link[rel="stylesheet"]['+a+"]"}function YE(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function zM(a,i,u,f){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=a.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),or(i,"link",u),dt(i),a.head.appendChild(i))}function oc(a){return'[src="'+va(a)+'"]'}function Ku(a){return"script[async]"+a}function WE(a,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var f=a.querySelector('style[data-href~="'+va(u.href)+'"]');if(f)return i.instance=f,dt(f),f;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(a.ownerDocument||a).createElement("style"),dt(f),or(f,"style",y),jh(f,u.precedence,a),i.instance=f;case"stylesheet":y=sc(u.href);var S=a.querySelector(qu(y));if(S)return i.state.loading|=4,i.instance=S,dt(S),S;f=YE(u),(y=Ea.get(y))&&vy(f,y),S=(a.ownerDocument||a).createElement("link"),dt(S);var N=S;return N._p=new Promise(function(M,P){N.onload=M,N.onerror=P}),or(S,"link",f),i.state.loading|=4,jh(S,u.precedence,a),i.instance=S;case"script":return S=oc(u.src),(y=a.querySelector(Ku(S)))?(i.instance=y,dt(y),y):(f=u,(y=Ea.get(S))&&(f=g({},u),yy(f,y)),a=a.ownerDocument||a,y=a.createElement("script"),dt(y),or(y,"link",f),a.head.appendChild(y),i.instance=y);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,jh(f,u.precedence,a));return i.instance}function jh(a,i,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=f.length?f[f.length-1]:null,S=y,N=0;N<f.length;N++){var M=f[N];if(M.dataset.precedence===i)S=M;else if(S!==y)break}S?S.parentNode.insertBefore(a,S.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(a,i.firstChild))}function vy(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function yy(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var Nh=null;function QE(a,i,u){if(Nh===null){var f=new Map,y=Nh=new Map;y.set(u,f)}else y=Nh,f=y.get(u),f||(f=new Map,y.set(u,f));if(f.has(a))return f;for(f.set(a,null),u=u.getElementsByTagName(a),y=0;y<u.length;y++){var S=u[y];if(!(S[qe]||S[pe]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var N=S.getAttribute(i)||"";N=a+N;var M=f.get(N);M?M.push(S):f.set(N,[S])}}return f}function XE(a,i,u){a=a.ownerDocument||a,a.head.insertBefore(u,i==="title"?a.querySelector("head > title"):null)}function $M(a,i,u){if(u===1||i.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return a=i.disabled,typeof i.precedence=="string"&&a==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function JE(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}var Zu=null;function BM(){}function GM(a,i,u){if(Zu===null)throw Error(r(475));var f=Zu;if(i.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var y=sc(u.href),S=a.querySelector(qu(y));if(S){a=S._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(f.count++,f=Ah.bind(f),a.then(f,f)),i.state.loading|=4,i.instance=S,dt(S);return}S=a.ownerDocument||a,u=YE(u),(y=Ea.get(y))&&vy(u,y),S=S.createElement("link"),dt(S);var N=S;N._p=new Promise(function(M,P){N.onload=M,N.onerror=P}),or(S,"link",u),i.instance=S}f.stylesheets===null&&(f.stylesheets=new Map),f.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(f.count++,i=Ah.bind(f),a.addEventListener("load",i),a.addEventListener("error",i))}}function qM(){if(Zu===null)throw Error(r(475));var a=Zu;return a.stylesheets&&a.count===0&&xy(a,a.stylesheets),0<a.count?function(i){var u=setTimeout(function(){if(a.stylesheets&&xy(a,a.stylesheets),a.unsuspend){var f=a.unsuspend;a.unsuspend=null,f()}},6e4);return a.unsuspend=i,function(){a.unsuspend=null,clearTimeout(u)}}:null}function Ah(){if(this.count--,this.count===0){if(this.stylesheets)xy(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Dh=null;function xy(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Dh=new Map,i.forEach(KM,a),Dh=null,Ah.call(a))}function KM(a,i){if(!(i.state.loading&4)){var u=Dh.get(a);if(u)var f=u.get(null);else{u=new Map,Dh.set(a,u);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var N=y[S];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(u.set(N.dataset.precedence,N),f=N)}f&&u.set(null,f)}y=i.instance,N=y.getAttribute("data-precedence"),S=u.get(N)||f,S===f&&u.set(null,y),u.set(N,y),this.count++,f=Ah.bind(this),y.addEventListener("load",f),y.addEventListener("error",f),S?S.parentNode.insertBefore(y,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),i.state.loading|=4}}var Yu={$$typeof:_,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function ZM(a,i,u,f,y,S,N,M){this.tag=1,this.containerInfo=a,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=go(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=go(0),this.hiddenUpdates=go(null),this.identifierPrefix=f,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function eR(a,i,u,f,y,S,N,M,P,re,he,ye){return a=new ZM(a,i,u,N,M,P,re,ye),i=1,S===!0&&(i|=24),S=qr(3,null,null,i),a.current=S,S.stateNode=a,i=ev(),i.refCount++,a.pooledCache=i,i.refCount++,S.memoizedState={element:f,isDehydrated:u,cache:i},av(S),a}function tR(a){return a?(a=Pl,a):Pl}function nR(a,i,u,f,y,S){y=tR(y),f.context===null?f.context=y:f.pendingContext=y,f=Co(i),f.payload={element:u},S=S===void 0?null:S,S!==null&&(f.callback=S),u=wo(a,f,i),u!==null&&(Qr(u,a,i),Ru(u,a,i))}function rR(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<i?u:i}}function by(a,i){rR(a,i),(a=a.alternate)&&rR(a,i)}function aR(a){if(a.tag===13){var i=Ll(a,67108864);i!==null&&Qr(i,a,67108864),by(a,67108864)}}var Oh=!0;function YM(a,i,u,f){var y=I.T;I.T=null;var S=W.p;try{W.p=2,Sy(a,i,u,f)}finally{W.p=S,I.T=y}}function WM(a,i,u,f){var y=I.T;I.T=null;var S=W.p;try{W.p=8,Sy(a,i,u,f)}finally{W.p=S,I.T=y}}function Sy(a,i,u,f){if(Oh){var y=Cy(f);if(y===null)ly(a,i,f,Mh,u),oR(a,f);else if(XM(y,a,i,u,f))f.stopPropagation();else if(oR(a,f),i&4&&-1<QM.indexOf(a)){for(;y!==null;){var S=Lt(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var N=Sr(S.pendingLanes);if(N!==0){var M=S;for(M.pendingLanes|=2,M.entangledLanes|=2;N;){var P=1<<31-Et(N);M.entanglements[1]|=P,N&=~P}os(S),($t&6)===0&&(gh=Tt()+500,zu(0))}}break;case 13:M=Ll(S,2),M!==null&&Qr(M,S,2),yh(),by(S,2)}if(S=Cy(f),S===null&&ly(a,i,f,Mh,u),S===y)break;y=S}y!==null&&f.stopPropagation()}else ly(a,i,f,null,u)}}function Cy(a){return a=_g(a),wy(a)}var Mh=null;function wy(a){if(Mh=null,a=st(a),a!==null){var i=l(a);if(i===null)a=null;else{var u=i.tag;if(u===13){if(a=c(i),a!==null)return a;a=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return Mh=a,null}function sR(a){switch(a){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(Ia()){case ur:return 2;case H:return 8;case te:case ue:return 32;case _e:return 268435456;default:return 32}default:return 32}}var Ey=!1,Lo=null,Po=null,Uo=null,Wu=new Map,Qu=new Map,Fo=[],QM="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 oR(a,i){switch(a){case"focusin":case"focusout":Lo=null;break;case"dragenter":case"dragleave":Po=null;break;case"mouseover":case"mouseout":Uo=null;break;case"pointerover":case"pointerout":Wu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qu.delete(i.pointerId)}}function Xu(a,i,u,f,y,S){return a===null||a.nativeEvent!==S?(a={blockedOn:i,domEventName:u,eventSystemFlags:f,nativeEvent:S,targetContainers:[y]},i!==null&&(i=Lt(i),i!==null&&aR(i)),a):(a.eventSystemFlags|=f,i=a.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),a)}function XM(a,i,u,f,y){switch(i){case"focusin":return Lo=Xu(Lo,a,i,u,f,y),!0;case"dragenter":return Po=Xu(Po,a,i,u,f,y),!0;case"mouseover":return Uo=Xu(Uo,a,i,u,f,y),!0;case"pointerover":var S=y.pointerId;return Wu.set(S,Xu(Wu.get(S)||null,a,i,u,f,y)),!0;case"gotpointercapture":return S=y.pointerId,Qu.set(S,Xu(Qu.get(S)||null,a,i,u,f,y)),!0}return!1}function iR(a){var i=st(a.target);if(i!==null){var u=l(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){a.blockedOn=i,X(a.priority,function(){if(u.tag===13){var f=Wr();f=Wn(f);var y=Ll(u,f);y!==null&&Qr(y,u,f),by(u,f)}});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function kh(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var u=Cy(a.nativeEvent);if(u===null){u=a.nativeEvent;var f=new u.constructor(u.type,u);Tg=f,u.target.dispatchEvent(f),Tg=null}else return i=Lt(u),i!==null&&aR(i),a.blockedOn=u,!1;i.shift()}return!0}function lR(a,i,u){kh(a)&&u.delete(i)}function JM(){Ey=!1,Lo!==null&&kh(Lo)&&(Lo=null),Po!==null&&kh(Po)&&(Po=null),Uo!==null&&kh(Uo)&&(Uo=null),Wu.forEach(lR),Qu.forEach(lR)}function Ih(a,i){a.blockedOn===i&&(a.blockedOn=null,Ey||(Ey=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,JM)))}var Lh=null;function cR(a){Lh!==a&&(Lh=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lh===a&&(Lh=null);for(var i=0;i<a.length;i+=3){var u=a[i],f=a[i+1],y=a[i+2];if(typeof f!="function"){if(wy(f||u)===null)continue;break}var S=Lt(u);S!==null&&(a.splice(i,3),i-=3,wv(S,{pending:!0,data:y,method:u.method,action:f},f,y))}}))}function Ju(a){function i(P){return Ih(P,a)}Lo!==null&&Ih(Lo,a),Po!==null&&Ih(Po,a),Uo!==null&&Ih(Uo,a),Wu.forEach(i),Qu.forEach(i);for(var u=0;u<Fo.length;u++){var f=Fo[u];f.blockedOn===a&&(f.blockedOn=null)}for(;0<Fo.length&&(u=Fo[0],u.blockedOn===null);)iR(u),u.blockedOn===null&&Fo.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var y=u[f],S=u[f+1],N=y[xe]||null;if(typeof S=="function")N||cR(u);else if(N){var M=null;if(S&&S.hasAttribute("formAction")){if(y=S,N=S[xe]||null)M=N.formAction;else if(wy(y)!==null)continue}else M=N.action;typeof M=="function"?u[f+1]=M:(u.splice(f,3),f-=3),cR(u)}}}function Ry(a){this._internalRoot=a}Ph.prototype.render=Ry.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(r(409));var u=i.current,f=Wr();nR(u,f,a,i,null,null)},Ph.prototype.unmount=Ry.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;nR(a.current,2,null,a,null,null),yh(),i[Oe]=null}};function Ph(a){this._internalRoot=a}Ph.prototype.unstable_scheduleHydration=function(a){if(a){var i=F();a={blockedOn:null,target:a,priority:i};for(var u=0;u<Fo.length&&i!==0&&i<Fo[u].priority;u++);Fo.splice(u,0,a),u===0&&iR(a)}};var uR=t.version;if(uR!=="19.1.1")throw Error(r(527,uR,"19.1.1"));W.findDOMNode=function(a){var i=a._reactInternals;if(i===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(i),a=a!==null?m(a):null,a=a===null?null:a.stateNode,a};var ek={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Uh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uh.isDisabled&&Uh.supportsFiber)try{ke=Uh.inject(ek),Be=Uh}catch{}}return td.createRoot=function(a,i){if(!s(a))throw Error(r(299));var u=!1,f="",y=Tw,S=_w,N=jw,M=null;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(S=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(M=i.unstable_transitionCallbacks)),i=eR(a,1,!1,null,null,u,f,y,S,N,M,null),a[Oe]=i.current,iy(a),new Ry(i)},td.hydrateRoot=function(a,i,u){if(!s(a))throw Error(r(299));var f=!1,y="",S=Tw,N=_w,M=jw,P=null,re=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(M=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(P=u.unstable_transitionCallbacks),u.formState!==void 0&&(re=u.formState)),i=eR(a,1,!0,i,u??null,f,y,S,N,M,P,re),i.context=tR(null),u=i.current,f=Wr(),f=Wn(f),y=Co(f),y.callback=null,wo(u,y,f),u=f,i.current.lanes=u,on(i,u),os(i),a[Oe]=i.current,iy(a),new Ph(i)},td.version="19.1.1",td}var bR;function fk(){if(bR)return jy.exports;bR=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(),jy.exports=dk(),jy.exports}var hk=fk();/**
50
+ * react-router v7.8.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 r_=e=>{throw TypeError(e)},mk=(e,t,n)=>t.has(e)||r_("Cannot "+n),Oy=(e,t,n)=>(mk(e,t,"read from private field"),n?n.call(e):t.get(e)),pk=(e,t,n)=>t.has(e)?r_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),SR="popstate";function gk(e={}){function t(r,s){let{pathname:l,search:c,hash:d}=r.location;return _d("",{pathname:l,search:c,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:oi(s)}return yk(t,n,null,e)}function St(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Tn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vk(){return Math.random().toString(36).substring(2,10)}function CR(e,t){return{usr:e.state,key:e.key,idx:t}}function _d(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?mi(t):t,state:n,key:t&&t.key||r||vk()}}function oi({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 mi(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 yk(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,c=s.history,d="POP",h=null,m=g();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function g(){return(c.state||{idx:null}).idx}function v(){d="POP";let E=g(),R=E==null?null:E-m;m=E,h&&h({action:d,location:C.location,delta:R})}function x(E,R){d="PUSH";let T=_d(C.location,E,R);m=g()+1;let _=CR(T,m),O=C.createHref(T);try{c.pushState(_,"",O)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(O)}l&&h&&h({action:d,location:C.location,delta:1})}function b(E,R){d="REPLACE";let T=_d(C.location,E,R);m=g();let _=CR(T,m),O=C.createHref(T);c.replaceState(_,"",O),l&&h&&h({action:d,location:C.location,delta:0})}function w(E){return a_(E)}let C={get action(){return d},get location(){return e(s,c)},listen(E){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(SR,v),h=E,()=>{s.removeEventListener(SR,v),h=null}},createHref(E){return t(s,E)},createURL:w,encodeLocation(E){let R=w(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:b,go(E){return c.go(E)}};return C}function a_(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),St(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:oi(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var pd,wR=class{constructor(e){if(pk(this,pd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Oy(this,pd).has(e))return Oy(this,pd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Oy(this,pd).set(e,t)}};pd=new WeakMap;var xk=new Set(["lazy","caseSensitive","path","id","index","children"]);function bk(e){return xk.has(e)}var Sk=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function Ck(e){return Sk.has(e)}function wk(e){return e.index===!0}function jd(e,t,n=[],r={},s=!1){return e.map((l,c)=>{let d=[...n,String(c)],h=typeof l.id=="string"?l.id:d.join("-");if(St(l.index!==!0||!l.children,"Cannot specify children on an index route"),St(s||!r[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),wk(l)){let m={...l,...t(l),id:h};return r[h]=m,m}else{let m={...l,...t(l),id:h,children:void 0};return r[h]=m,l.children&&(m.children=jd(l.children,t,d,r,s)),m}})}function Ko(e,t,n="/"){return om(e,t,n,!1)}function om(e,t,n,r){let s=typeof t=="string"?mi(t):t,l=Na(s.pathname||"/",n);if(l==null)return null;let c=s_(e);Rk(c);let d=null;for(let h=0;d==null&&h<c.length;++h){let m=Lk(l);d=kk(c[h],m,r)}return d}function Ek(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 s_(e,t=[],n=[],r="",s=!1){let l=(c,d,h=s,m)=>{let g={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&h)return;St(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let v=vs([r,g.relativePath]),x=n.concat(g);c.children&&c.children.length>0&&(St(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),s_(c.children,t,x,v,h)),!(c.path==null&&!c.index)&&t.push({path:v,score:Ok(v,c.index),routesMeta:x})};return e.forEach((c,d)=>{var h;if(c.path===""||!((h=c.path)!=null&&h.includes("?")))l(c,d);else for(let m of o_(c.path))l(c,d,!0,m)}),t}function o_(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let c=o_(r.join("/")),d=[];return d.push(...c.map(h=>h===""?l:[l,h].join("/"))),s&&d.push(...c),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function Rk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Mk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Tk=/^:[\w-]+$/,_k=3,jk=2,Nk=1,Ak=10,Dk=-2,ER=e=>e==="*";function Ok(e,t){let n=e.split("/"),r=n.length;return n.some(ER)&&(r+=Dk),t&&(r+=jk),n.filter(s=>!ER(s)).reduce((s,l)=>s+(Tk.test(l)?_k:l===""?Nk:Ak),r)}function Mk(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 kk(e,t,n=!1){let{routesMeta:r}=e,s={},l="/",c=[];for(let d=0;d<r.length;++d){let h=r[d],m=d===r.length-1,g=l==="/"?t:t.slice(l.length)||"/",v=wm({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),x=h.route;if(!v&&m&&n&&!r[r.length-1].route.index&&(v=wm({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!v)return null;Object.assign(s,v.params),c.push({params:s,pathname:vs([l,v.pathname]),pathnameBase:Hk(vs([l,v.pathnameBase])),route:x}),v.pathnameBase!=="/"&&(l=vs([l,v.pathnameBase]))}return c}function wm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ik(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],c=l.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:r.reduce((m,{paramName:g,isOptional:v},x)=>{if(g==="*"){let w=d[x]||"";c=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[x];return v&&!b?m[g]=void 0:m[g]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function Ik(e,t=!1,n=!0){Tn(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,d,h)=>(r.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).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 Lk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tn(!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 Na(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 Pk({basename:e,pathname:t}){return t==="/"?e:vs([e,t])}function Uk(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?mi(e):e;return{pathname:n?n.startsWith("/")?n:Fk(n,t):t,search:Vk(r),hash:zk(s)}}function Fk(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 My(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 i_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fp(e){let t=i_(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function hp(e,t,n,r=!1){let s;typeof e=="string"?s=mi(e):(s={...e},St(!s.pathname||!s.pathname.includes("?"),My("?","pathname","search",s)),St(!s.pathname||!s.pathname.includes("#"),My("#","pathname","hash",s)),St(!s.search||!s.search.includes("#"),My("#","search","hash",s)));let l=e===""||s.pathname==="",c=l?"/":s.pathname,d;if(c==null)d=n;else{let v=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}d=v>=0?t[v]:"/"}let h=Uk(s,d),m=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var vs=e=>e.join("/").replace(/\/\/+/g,"/"),Hk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Em=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 Nd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var l_=["POST","PUT","PATCH","DELETE"],$k=new Set(l_),Bk=["GET",...l_],Gk=new Set(Bk),qk=new Set([301,302,303,307,308]),Kk=new Set([307,308]),ky={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Zk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Yk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lb=e=>Yk.test(e),Wk=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),c_="remix-router-transitions",u_=Symbol("ResetLoaderData");function Qk(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";St(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||Wk,l={},c=jd(e.routes,s,void 0,l),d,h=e.basename||"/",m=e.dataStrategy||nI,g={unstable_middleware:!1,...e.future},v=null,x=new Set,b=null,w=null,C=null,E=e.hydrationData!=null,R=Ko(c,e.history.location,h),T=!1,_=null,O;if(R==null&&!e.patchRoutesOnNavigation){let F=Ra(404,{pathname:e.history.location.pathname}),{matches:X,route:ne}=LR(c);O=!0,R=X,_={[ne.id]:F}}else if(R&&!e.hydrationData&&Sn(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(F=>F.route.lazy))O=!1;else if(!R.some(F=>F.route.loader))O=!0;else{let F=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let ne=R.findIndex(pe=>X[pe.route.id]!==void 0);O=R.slice(0,ne+1).every(pe=>!Dx(pe.route,F,X))}else O=R.every(ne=>!Dx(ne.route,F,X))}else{O=!1,R=[];let F=Sn(null,c,e.history.location.pathname);F.active&&F.matches&&(T=!0,R=F.matches)}let A,j={historyAction:e.history.action,location:e.history.location,matches:R,initialized:O,navigation:ky,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||_,fetchers:new Map,blockers:new Map},D="POP",k=!1,V,B=!1,z=new Map,J=null,oe=!1,K=!1,Y=new Set,I=new Map,W=0,G=-1,ie=new Map,L=new Set,Z=new Map,U=new Map,q=new Set,le=new Map,me,ve=null;function fe(){if(v=e.history.listen(({action:F,location:X,delta:ne})=>{if(me){me(),me=void 0;return}Tn(le.size===0||ne!=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 pe=es({currentLocation:j.location,nextLocation:X,historyAction:F});if(pe&&ne!=null){let xe=new Promise(Oe=>{me=Oe});e.history.go(ne*-1),Ar(pe,{state:"blocked",location:X,proceed(){Ar(pe,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),xe.then(()=>e.history.go(ne))},reset(){let Oe=new Map(j.blockers);Oe.set(pe,nd),be({blockers:Oe})}});return}return Ne(F,X)}),n){mI(t,z);let F=()=>pI(t,z);t.addEventListener("pagehide",F),J=()=>t.removeEventListener("pagehide",F)}return j.initialized||Ne("POP",j.location,{initialHydration:!0}),A}function Ee(){v&&v(),J&&J(),x.clear(),V&&V.abort(),j.fetchers.forEach((F,X)=>Et(X)),j.blockers.forEach((F,X)=>$r(X))}function De(F){return x.add(F),()=>x.delete(F)}function be(F,X={}){F.matches&&(F.matches=F.matches.map(xe=>{let Oe=l[xe.route.id],Ue=xe.route;return Ue.element!==Oe.element||Ue.errorElement!==Oe.errorElement||Ue.hydrateFallbackElement!==Oe.hydrateFallbackElement?{...xe,route:Oe}:xe})),j={...j,...F};let ne=[],pe=[];j.fetchers.forEach((xe,Oe)=>{xe.state==="idle"&&(q.has(Oe)?ne.push(Oe):pe.push(Oe))}),q.forEach(xe=>{!j.fetchers.has(xe)&&!I.has(xe)&&ne.push(xe)}),[...x].forEach(xe=>xe(j,{deletedFetchers:ne,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),ne.forEach(xe=>Et(xe)),pe.forEach(xe=>j.fetchers.delete(xe))}function Je(F,X,{flushSync:ne}={}){var qe,Ke;let pe=j.actionData!=null&&j.navigation.formMethod!=null&&Lr(j.navigation.formMethod)&&j.navigation.state==="loading"&&((qe=F.state)==null?void 0:qe._isRedirect)!==!0,xe;X.actionData?Object.keys(X.actionData).length>0?xe=X.actionData:xe=null:pe?xe=j.actionData:xe=null;let Oe=X.loaderData?kR(j.loaderData,X.loaderData,X.matches||[],X.errors):j.loaderData,Ue=j.blockers;Ue.size>0&&(Ue=new Map(Ue),Ue.forEach((st,Lt)=>Ue.set(Lt,nd)));let Le=oe?!1:Yn(F,X.matches||j.matches),Fe=k===!0||j.navigation.formMethod!=null&&Lr(j.navigation.formMethod)&&((Ke=F.state)==null?void 0:Ke._isRedirect)!==!0;d&&(c=d,d=void 0),oe||D==="POP"||(D==="PUSH"?e.history.push(F,F.state):D==="REPLACE"&&e.history.replace(F,F.state));let Ye;if(D==="POP"){let st=z.get(j.location.pathname);st&&st.has(F.pathname)?Ye={currentLocation:j.location,nextLocation:F}:z.has(F.pathname)&&(Ye={currentLocation:F,nextLocation:j.location})}else if(B){let st=z.get(j.location.pathname);st?st.add(F.pathname):(st=new Set([F.pathname]),z.set(j.location.pathname,st)),Ye={currentLocation:j.location,nextLocation:F}}be({...X,actionData:xe,loaderData:Oe,historyAction:D,location:F,initialized:!0,navigation:ky,revalidation:"idle",restoreScrollPosition:Le,preventScrollReset:Fe,blockers:Ue},{viewTransitionOpts:Ye,flushSync:ne===!0}),D="POP",k=!1,B=!1,oe=!1,K=!1,ve==null||ve.resolve(),ve=null}async function Xe(F,X){if(typeof F=="number"){e.history.go(F);return}let ne=Ax(j.location,j.matches,h,F,X==null?void 0:X.fromRouteId,X==null?void 0:X.relative),{path:pe,submission:xe,error:Oe}=RR(!1,ne,X),Ue=j.location,Le=_d(j.location,pe,X&&X.state);Le={...Le,...e.history.encodeLocation(Le)};let Fe=X&&X.replace!=null?X.replace:void 0,Ye="PUSH";Fe===!0?Ye="REPLACE":Fe===!1||xe!=null&&Lr(xe.formMethod)&&xe.formAction===j.location.pathname+j.location.search&&(Ye="REPLACE");let qe=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,Ke=(X&&X.flushSync)===!0,st=es({currentLocation:Ue,nextLocation:Le,historyAction:Ye});if(st){Ar(st,{state:"blocked",location:Le,proceed(){Ar(st,{state:"proceeding",proceed:void 0,reset:void 0,location:Le}),Xe(F,X)},reset(){let Lt=new Map(j.blockers);Lt.set(st,nd),be({blockers:Lt})}});return}await Ne(Ye,Le,{submission:xe,pendingError:Oe,preventScrollReset:qe,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:Ke})}function Ht(){ve||(ve=gI()),Ce(),be({revalidation:"loading"});let F=ve.promise;return j.navigation.state==="submitting"?F:j.navigation.state==="idle"?(Ne(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),F):(Ne(D||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:B===!0}),F)}async function Ne(F,X,ne){V&&V.abort(),V=null,D=F,oe=(ne&&ne.startUninterruptedRevalidation)===!0,on(j.location,j.matches),k=(ne&&ne.preventScrollReset)===!0,B=(ne&&ne.enableViewTransition)===!0;let pe=d||c,xe=ne&&ne.overrideNavigation,Oe=ne!=null&&ne.initialHydration&&j.matches&&j.matches.length>0&&!T?j.matches:Ko(pe,X,h),Ue=(ne&&ne.flushSync)===!0;if(Oe&&j.initialized&&!K&&cI(j.location,X)&&!(ne&&ne.submission&&Lr(ne.submission.formMethod))){Je(X,{matches:Oe},{flushSync:Ue});return}let Le=Sn(Oe,pe,X.pathname);if(Le.active&&Le.matches&&(Oe=Le.matches),!Oe){let{error:pn,notFoundMatches:dt,route:Qt}=po(X.pathname);Je(X,{matches:dt,loaderData:{},errors:{[Qt.id]:pn}},{flushSync:Ue});return}V=new AbortController;let Fe=gc(e.history,X,V.signal,ne&&ne.submission),Ye=e.unstable_getContext?await e.unstable_getContext():new wR,qe;if(ne&&ne.pendingError)qe=[Zo(Oe).route.id,{type:"error",error:ne.pendingError}];else if(ne&&ne.submission&&Lr(ne.submission.formMethod)){let pn=await vt(Fe,X,ne.submission,Oe,Ye,Le.active,ne&&ne.initialHydration===!0,{replace:ne.replace,flushSync:Ue});if(pn.shortCircuited)return;if(pn.pendingActionResult){let[dt,Qt]=pn.pendingActionResult;if(Xr(Qt)&&Nd(Qt.error)&&Qt.error.status===404){V=null,Je(X,{matches:pn.matches,loaderData:{},errors:{[dt]:Qt.error}});return}}Oe=pn.matches||Oe,qe=pn.pendingActionResult,xe=Iy(X,ne.submission),Ue=!1,Le.active=!1,Fe=gc(e.history,Fe.url,Fe.signal)}let{shortCircuited:Ke,matches:st,loaderData:Lt,errors:mn}=await ut(Fe,X,Oe,Ye,Le.active,xe,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,ne&&ne.initialHydration===!0,Ue,qe);Ke||(V=null,Je(X,{matches:st||Oe,...IR(qe),loaderData:Lt,errors:mn}))}async function vt(F,X,ne,pe,xe,Oe,Ue,Le={}){Ce();let Fe=fI(X,ne);if(be({navigation:Fe},{flushSync:Le.flushSync===!0}),Oe){let Ke=await dr(pe,X.pathname,F.signal);if(Ke.type==="aborted")return{shortCircuited:!0};if(Ke.type==="error"){let st=Zo(Ke.partialMatches).route.id;return{matches:Ke.partialMatches,pendingActionResult:[st,{type:"error",error:Ke.error}]}}else if(Ke.matches)pe=Ke.matches;else{let{notFoundMatches:st,error:Lt,route:mn}=po(X.pathname);return{matches:st,pendingActionResult:[mn.id,{type:"error",error:Lt}]}}}let Ye,qe=im(pe,X);if(!qe.route.action&&!qe.route.lazy)Ye={type:"error",error:Ra(405,{method:F.method,pathname:X.pathname,routeId:qe.route.id})};else{let Ke=Rc(s,l,F,pe,qe,Ue?[]:r,xe),st=await _e(F,Ke,xe,null);if(Ye=st[qe.route.id],!Ye){for(let Lt of pe)if(st[Lt.route.id]){Ye=st[Lt.route.id];break}}if(F.signal.aborted)return{shortCircuited:!0}}if(Wi(Ye)){let Ke;return Le&&Le.replace!=null?Ke=Le.replace:Ke=DR(Ye.response.headers.get("Location"),new URL(F.url),h)===j.location.pathname+j.location.search,await ue(F,Ye,!0,{submission:ne,replace:Ke}),{shortCircuited:!0}}if(Xr(Ye)){let Ke=Zo(pe,qe.route.id);return(Le&&Le.replace)!==!0&&(D="PUSH"),{matches:pe,pendingActionResult:[Ke.route.id,Ye,qe.route.id]}}return{matches:pe,pendingActionResult:[qe.route.id,Ye]}}async function ut(F,X,ne,pe,xe,Oe,Ue,Le,Fe,Ye,qe,Ke){let st=Oe||Iy(X,Ue),Lt=Ue||Le||UR(st),mn=!oe&&!Ye;if(xe){if(mn){let jn=Tt(Ke);be({navigation:st,...jn!==void 0?{actionData:jn}:{}},{flushSync:qe})}let pt=await dr(ne,X.pathname,F.signal);if(pt.type==="aborted")return{shortCircuited:!0};if(pt.type==="error"){let jn=Zo(pt.partialMatches).route.id;return{matches:pt.partialMatches,loaderData:{},errors:{[jn]:pt.error}}}else if(pt.matches)ne=pt.matches;else{let{error:jn,notFoundMatches:Ni,route:pa}=po(X.pathname);return{matches:Ni,loaderData:{},errors:{[pa.id]:jn}}}}let pn=d||c,{dsMatches:dt,revalidatingFetchers:Qt}=TR(F,pe,s,l,e.history,j,ne,Lt,X,Ye?[]:r,Ye===!0,K,Y,q,Z,L,pn,h,e.patchRoutesOnNavigation!=null,Ke);if(G=++W,!e.dataStrategy&&!dt.some(pt=>pt.shouldLoad)&&!dt.some(pt=>pt.route.unstable_middleware)&&Qt.length===0){let pt=Vr();return Je(X,{matches:ne,loaderData:{},errors:Ke&&Xr(Ke[1])?{[Ke[0]]:Ke[1].error}:null,...IR(Ke),...pt?{fetchers:new Map(j.fetchers)}:{}},{flushSync:qe}),{shortCircuited:!0}}if(mn){let pt={};if(!xe){pt.navigation=st;let jn=Tt(Ke);jn!==void 0&&(pt.actionData=jn)}Qt.length>0&&(pt.fetchers=Ia(Qt)),be(pt,{flushSync:qe})}Qt.forEach(pt=>{Wt(pt.key),pt.controller&&I.set(pt.key,pt.controller)});let ts=()=>Qt.forEach(pt=>Wt(pt.key));V&&V.signal.addEventListener("abort",ts);let{loaderResults:Br,fetcherResults:Cr}=await Re(dt,Qt,F,pe);if(F.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",ts),Qt.forEach(pt=>I.delete(pt.key));let ma=Fh(Br);if(ma)return await ue(F,ma.result,!0,{replace:Fe}),{shortCircuited:!0};if(ma=Fh(Cr),ma)return L.add(ma.key),await ue(F,ma.result,!0,{replace:Fe}),{shortCircuited:!0};let{loaderData:_l,errors:vo}=MR(j,ne,Br,Ke,Qt,Cr);Ye&&j.errors&&(vo={...j.errors,...vo});let Ds=Vr(),Os=zr(G),Ms=Ds||Os||Qt.length>0;return{matches:ne,loaderData:_l,errors:vo,...Ms?{fetchers:new Map(j.fetchers)}:{}}}function Tt(F){if(F&&!Xr(F[1]))return{[F[0]]:F[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function Ia(F){return F.forEach(X=>{let ne=j.fetchers.get(X.key),pe=rd(void 0,ne?ne.data:void 0);j.fetchers.set(X.key,pe)}),new Map(j.fetchers)}async function ur(F,X,ne,pe){Wt(F);let xe=(pe&&pe.flushSync)===!0,Oe=d||c,Ue=Ax(j.location,j.matches,h,ne,X,pe==null?void 0:pe.relative),Le=Ko(Oe,Ue,h),Fe=Sn(Le,Oe,Ue);if(Fe.active&&Fe.matches&&(Le=Fe.matches),!Le){Be(F,X,Ra(404,{pathname:Ue}),{flushSync:xe});return}let{path:Ye,submission:qe,error:Ke}=RR(!0,Ue,pe);if(Ke){Be(F,X,Ke,{flushSync:xe});return}let st=e.unstable_getContext?await e.unstable_getContext():new wR,Lt=(pe&&pe.preventScrollReset)===!0;if(qe&&Lr(qe.formMethod)){await H(F,X,Ye,Le,st,Fe.active,xe,Lt,qe);return}Z.set(F,{routeId:X,path:Ye}),await te(F,X,Ye,Le,st,Fe.active,xe,Lt,qe)}async function H(F,X,ne,pe,xe,Oe,Ue,Le,Fe){Ce(),Z.delete(F);let Ye=j.fetchers.get(F);ke(F,hI(Fe,Ye),{flushSync:Ue});let qe=new AbortController,Ke=gc(e.history,ne,qe.signal,Fe);if(Oe){let cn=await dr(pe,new URL(Ke.url).pathname,Ke.signal,F);if(cn.type==="aborted")return;if(cn.type==="error"){Be(F,X,cn.error,{flushSync:Ue});return}else if(cn.matches)pe=cn.matches;else{Be(F,X,Ra(404,{pathname:ne}),{flushSync:Ue});return}}let st=im(pe,ne);if(!st.route.action&&!st.route.lazy){let cn=Ra(405,{method:Fe.formMethod,pathname:ne,routeId:X});Be(F,X,cn,{flushSync:Ue});return}I.set(F,qe);let Lt=W,mn=Rc(s,l,Ke,pe,st,r,xe),dt=(await _e(Ke,mn,xe,F))[st.route.id];if(Ke.signal.aborted){I.get(F)===qe&&I.delete(F);return}if(q.has(F)){if(Wi(dt)||Xr(dt)){ke(F,zo(void 0));return}}else{if(Wi(dt))if(I.delete(F),G>Lt){ke(F,zo(void 0));return}else return L.add(F),ke(F,rd(Fe)),ue(Ke,dt,!1,{fetcherSubmission:Fe,preventScrollReset:Le});if(Xr(dt)){Be(F,X,dt.error);return}}let Qt=j.navigation.location||j.location,ts=gc(e.history,Qt,qe.signal),Br=d||c,Cr=j.navigation.state!=="idle"?Ko(Br,j.navigation.location,h):j.matches;St(Cr,"Didn't find any matches after fetcher action");let ma=++W;ie.set(F,ma);let _l=rd(Fe,dt.data);j.fetchers.set(F,_l);let{dsMatches:vo,revalidatingFetchers:Ds}=TR(ts,xe,s,l,e.history,j,Cr,Fe,Qt,r,!1,K,Y,q,Z,L,Br,h,e.patchRoutesOnNavigation!=null,[st.route.id,dt]);Ds.filter(cn=>cn.key!==F).forEach(cn=>{let yo=cn.key,Nf=j.fetchers.get(yo),Af=rd(void 0,Nf?Nf.data:void 0);j.fetchers.set(yo,Af),Wt(yo),cn.controller&&I.set(yo,cn.controller)}),be({fetchers:new Map(j.fetchers)});let Os=()=>Ds.forEach(cn=>Wt(cn.key));qe.signal.addEventListener("abort",Os);let{loaderResults:Ms,fetcherResults:pt}=await Re(vo,Ds,ts,xe);if(qe.signal.aborted)return;if(qe.signal.removeEventListener("abort",Os),ie.delete(F),I.delete(F),Ds.forEach(cn=>I.delete(cn.key)),j.fetchers.has(F)){let cn=zo(dt.data);j.fetchers.set(F,cn)}let jn=Fh(Ms);if(jn)return ue(ts,jn.result,!1,{preventScrollReset:Le});if(jn=Fh(pt),jn)return L.add(jn.key),ue(ts,jn.result,!1,{preventScrollReset:Le});let{loaderData:Ni,errors:pa}=MR(j,Cr,Ms,void 0,Ds,pt);zr(ma),j.navigation.state==="loading"&&ma>G?(St(D,"Expected pending action"),V&&V.abort(),Je(j.navigation.location,{matches:Cr,loaderData:Ni,errors:pa,fetchers:new Map(j.fetchers)})):(be({errors:pa,loaderData:kR(j.loaderData,Ni,Cr,pa),fetchers:new Map(j.fetchers)}),K=!1)}async function te(F,X,ne,pe,xe,Oe,Ue,Le,Fe){let Ye=j.fetchers.get(F);ke(F,rd(Fe,Ye?Ye.data:void 0),{flushSync:Ue});let qe=new AbortController,Ke=gc(e.history,ne,qe.signal);if(Oe){let Qt=await dr(pe,new URL(Ke.url).pathname,Ke.signal,F);if(Qt.type==="aborted")return;if(Qt.type==="error"){Be(F,X,Qt.error,{flushSync:Ue});return}else if(Qt.matches)pe=Qt.matches;else{Be(F,X,Ra(404,{pathname:ne}),{flushSync:Ue});return}}let st=im(pe,ne);I.set(F,qe);let Lt=W,mn=Rc(s,l,Ke,pe,st,r,xe),dt=(await _e(Ke,mn,xe,F))[st.route.id];if(I.get(F)===qe&&I.delete(F),!Ke.signal.aborted){if(q.has(F)){ke(F,zo(void 0));return}if(Wi(dt))if(G>Lt){ke(F,zo(void 0));return}else{L.add(F),await ue(Ke,dt,!1,{preventScrollReset:Le});return}if(Xr(dt)){Be(F,X,dt.error);return}ke(F,zo(dt.data))}}async function ue(F,X,ne,{submission:pe,fetcherSubmission:xe,preventScrollReset:Oe,replace:Ue}={}){X.response.headers.has("X-Remix-Revalidate")&&(K=!0);let Le=X.response.headers.get("Location");St(Le,"Expected a Location header on the redirect Response"),Le=DR(Le,new URL(F.url),h);let Fe=_d(j.location,Le,{_isRedirect:!0});if(n){let mn=!1;if(X.response.headers.has("X-Remix-Reload-Document"))mn=!0;else if(Lb(Le)){const pn=a_(Le,!0);mn=pn.origin!==t.location.origin||Na(pn.pathname,h)==null}if(mn){Ue?t.location.replace(Le):t.location.assign(Le);return}}V=null;let Ye=Ue===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:qe,formAction:Ke,formEncType:st}=j.navigation;!pe&&!xe&&qe&&Ke&&st&&(pe=UR(j.navigation));let Lt=pe||xe;if(Kk.has(X.response.status)&&Lt&&Lr(Lt.formMethod))await Ne(Ye,Fe,{submission:{...Lt,formAction:Le},preventScrollReset:Oe||k,enableViewTransition:ne?B:void 0});else{let mn=Iy(Fe,pe);await Ne(Ye,Fe,{overrideNavigation:mn,fetcherSubmission:xe,preventScrollReset:Oe||k,enableViewTransition:ne?B:void 0})}}async function _e(F,X,ne,pe){let xe,Oe={};try{xe=await rI(m,F,X,pe,ne,!1)}catch(Ue){return X.filter(Le=>Le.shouldLoad).forEach(Le=>{Oe[Le.route.id]={type:"error",error:Ue}}),Oe}if(F.signal.aborted)return Oe;for(let[Ue,Le]of Object.entries(xe))if(uI(Le)){let Fe=Le.result;Oe[Ue]={type:"redirect",response:iI(Fe,F,Ue,X,h)}}else Oe[Ue]=await oI(Le);return Oe}async function Re(F,X,ne,pe){let xe=_e(ne,F,pe,null),Oe=Promise.all(X.map(async Fe=>{if(Fe.matches&&Fe.match&&Fe.request&&Fe.controller){let qe=(await _e(Fe.request,Fe.matches,pe,Fe.key))[Fe.match.route.id];return{[Fe.key]:qe}}else return Promise.resolve({[Fe.key]:{type:"error",error:Ra(404,{pathname:Fe.path})}})})),Ue=await xe,Le=(await Oe).reduce((Fe,Ye)=>Object.assign(Fe,Ye),{});return{loaderResults:Ue,fetcherResults:Le}}function Ce(){K=!0,Z.forEach((F,X)=>{I.has(X)&&Y.add(X),Wt(X)})}function ke(F,X,ne={}){j.fetchers.set(F,X),be({fetchers:new Map(j.fetchers)},{flushSync:(ne&&ne.flushSync)===!0})}function Be(F,X,ne,pe={}){let xe=Zo(j.matches,X);Et(F),be({errors:{[xe.route.id]:ne},fetchers:new Map(j.fetchers)},{flushSync:(pe&&pe.flushSync)===!0})}function ct(F){return U.set(F,(U.get(F)||0)+1),q.has(F)&&q.delete(F),j.fetchers.get(F)||Zk}function Et(F){let X=j.fetchers.get(F);I.has(F)&&!(X&&X.state==="loading"&&ie.has(F))&&Wt(F),Z.delete(F),ie.delete(F),L.delete(F),q.delete(F),Y.delete(F),j.fetchers.delete(F)}function La(F){let X=(U.get(F)||0)-1;X<=0?(U.delete(F),q.add(F)):U.set(F,X),be({fetchers:new Map(j.fetchers)})}function Wt(F){let X=I.get(F);X&&(X.abort(),I.delete(F))}function As(F){for(let X of F){let ne=ct(X),pe=zo(ne.data);j.fetchers.set(X,pe)}}function Vr(){let F=[],X=!1;for(let ne of L){let pe=j.fetchers.get(ne);St(pe,`Expected fetcher: ${ne}`),pe.state==="loading"&&(L.delete(ne),F.push(ne),X=!0)}return As(F),X}function zr(F){let X=[];for(let[ne,pe]of ie)if(pe<F){let xe=j.fetchers.get(ne);St(xe,`Expected fetcher: ${ne}`),xe.state==="loading"&&(Wt(ne),ie.delete(ne),X.push(ne))}return As(X),X.length>0}function Sr(F,X){let ne=j.blockers.get(F)||nd;return le.get(F)!==X&&le.set(F,X),ne}function $r(F){j.blockers.delete(F),le.delete(F)}function Ar(F,X){let ne=j.blockers.get(F)||nd;St(ne.state==="unblocked"&&X.state==="blocked"||ne.state==="blocked"&&X.state==="blocked"||ne.state==="blocked"&&X.state==="proceeding"||ne.state==="blocked"&&X.state==="unblocked"||ne.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${ne.state} -> ${X.state}`);let pe=new Map(j.blockers);pe.set(F,X),be({blockers:pe})}function es({currentLocation:F,nextLocation:X,historyAction:ne}){if(le.size===0)return;le.size>1&&Tn(!1,"A router only supports one blocker at a time");let pe=Array.from(le.entries()),[xe,Oe]=pe[pe.length-1],Ue=j.blockers.get(xe);if(!(Ue&&Ue.state==="proceeding")&&Oe({currentLocation:F,nextLocation:X,historyAction:ne}))return xe}function po(F){let X=Ra(404,{pathname:F}),ne=d||c,{matches:pe,route:xe}=LR(ne);return{notFoundMatches:pe,route:xe,error:X}}function Tl(F,X,ne){if(b=F,C=X,w=ne||null,!E&&j.navigation===ky){E=!0;let pe=Yn(j.location,j.matches);pe!=null&&be({restoreScrollPosition:pe})}return()=>{b=null,C=null,w=null}}function go(F,X){return w&&w(F,X.map(pe=>Ek(pe,j.loaderData)))||F.key}function on(F,X){if(b&&C){let ne=go(F,X);b[ne]=C()}}function Yn(F,X){if(b){let ne=go(F,X),pe=b[ne];if(typeof pe=="number")return pe}return null}function Sn(F,X,ne){if(e.patchRoutesOnNavigation)if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:om(X,ne,h,!0)}}else return{active:!0,matches:om(X,ne,h,!0)||[]};return{active:!1,matches:null}}async function dr(F,X,ne,pe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:F};let xe=F;for(;;){let Oe=d==null,Ue=d||c,Le=l;try{await e.patchRoutesOnNavigation({signal:ne,path:X,matches:xe,fetcherKey:pe,patch:(qe,Ke)=>{ne.aborted||_R(qe,Ke,Ue,Le,s,!1)}})}catch(qe){return{type:"error",error:qe,partialMatches:xe}}finally{Oe&&!ne.aborted&&(c=[...c])}if(ne.aborted)return{type:"aborted"};let Fe=Ko(Ue,X,h);if(Fe)return{type:"success",matches:Fe};let Ye=om(Ue,X,h,!0);if(!Ye||xe.length===Ye.length&&xe.every((qe,Ke)=>qe.route.id===Ye[Ke].route.id))return{type:"success",matches:null};xe=Ye}}function Wn(F){l={},d=jd(F,s,void 0,l)}function Fn(F,X,ne=!1){let pe=d==null;_R(F,X,d||c,l,s,ne),pe&&(c=[...c],be({}))}return A={get basename(){return h},get future(){return g},get state(){return j},get routes(){return c},get window(){return t},initialize:fe,subscribe:De,enableScrollRestoration:Tl,navigate:Xe,fetch:ur,revalidate:Ht,createHref:F=>e.history.createHref(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:ct,deleteFetcher:La,dispose:Ee,getBlocker:Sr,deleteBlocker:$r,patchRoutes:Fn,_internalFetchControllers:I,_internalSetRoutes:Wn,_internalSetStateDoNotUseOrYouWillBreakYourApp(F){be(F)}},A}function Xk(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ax(e,t,n,r,s,l){let c,d;if(s){c=[];for(let m of t)if(c.push(m),m.route.id===s){d=m;break}}else c=t,d=t[t.length-1];let h=hp(r||".",fp(c),Na(e.pathname,n)||e.pathname,l==="path");if(r==null&&(h.search=e.search,h.hash=e.hash),(r==null||r===""||r===".")&&d){let m=Pb(h.search);if(d.route.index&&!m)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&m){let g=new URLSearchParams(h.search),v=g.getAll("index");g.delete("index"),v.filter(b=>b).forEach(b=>g.append("index",b));let x=g.toString();h.search=x?`?${x}`:""}}return n!=="/"&&(h.pathname=Pk({basename:n,pathname:h.pathname})),oi(h)}function RR(e,t,n){if(!n||!Xk(n))return{path:t};if(n.formMethod&&!dI(n.formMethod))return{path:t,error:Ra(405,{method:n.formMethod})};let r=()=>({path:t,error:Ra(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=v_(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Lr(l))return r();let v=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[b,w])=>`${x}${b}=${w}
59
+ `,""):String(n.body);return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:v}}}else if(n.formEncType==="application/json"){if(!Lr(l))return r();try{let v=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:v,text:void 0}}}catch{return r()}}}St(typeof FormData=="function","FormData is not available in this environment");let d,h;if(n.formData)d=Mx(n.formData),h=n.formData;else if(n.body instanceof FormData)d=Mx(n.body),h=n.body;else if(n.body instanceof URLSearchParams)d=n.body,h=OR(d);else if(n.body==null)d=new URLSearchParams,h=new FormData;else try{d=new URLSearchParams(n.body),h=OR(d)}catch{return r()}let m={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(Lr(m.formMethod))return{path:t,submission:m};let g=mi(t);return e&&g.search&&Pb(g.search)&&d.append("index",""),g.search=`?${d}`,{path:oi(g),submission:m}}function TR(e,t,n,r,s,l,c,d,h,m,g,v,x,b,w,C,E,R,T,_){var oe;let O=_?Xr(_[1])?_[1].error:_[1].data:void 0,A=s.createURL(l.location),j=s.createURL(h),D;if(g&&l.errors){let K=Object.keys(l.errors)[0];D=c.findIndex(Y=>Y.route.id===K)}else if(_&&Xr(_[1])){let K=_[0];D=c.findIndex(Y=>Y.route.id===K)-1}let k=_?_[1].statusCode:void 0,V=k&&k>=400,B={currentUrl:A,currentParams:((oe=l.matches[0])==null?void 0:oe.params)||{},nextUrl:j,nextParams:c[0].params,...d,actionResult:O,actionStatus:k},z=c.map((K,Y)=>{let{route:I}=K,W=null;if(D!=null&&Y>D?W=!1:I.lazy?W=!0:I.loader==null?W=!1:g?W=Dx(I,l.loaderData,l.errors):Jk(l.loaderData,l.matches[Y],K)&&(W=!0),W!==null)return Ox(n,r,e,K,m,t,W);let G=V?!1:v||A.pathname+A.search===j.pathname+j.search||A.search!==j.search||eI(l.matches[Y],K),ie={...B,defaultShouldRevalidate:G},L=Rm(K,ie);return Ox(n,r,e,K,m,t,L,ie)}),J=[];return w.forEach((K,Y)=>{if(g||!c.some(q=>q.route.id===K.routeId)||b.has(Y))return;let I=l.fetchers.get(Y),W=I&&I.state!=="idle"&&I.data===void 0,G=Ko(E,K.path,R);if(!G){if(T&&W)return;J.push({key:Y,routeId:K.routeId,path:K.path,matches:null,match:null,request:null,controller:null});return}if(C.has(Y))return;let ie=im(G,K.path),L=new AbortController,Z=gc(s,K.path,L.signal),U=null;if(x.has(Y))x.delete(Y),U=Rc(n,r,Z,G,ie,m,t);else if(W)v&&(U=Rc(n,r,Z,G,ie,m,t));else{let q={...B,defaultShouldRevalidate:V?!1:v};Rm(ie,q)&&(U=Rc(n,r,Z,G,ie,m,t,q))}U&&J.push({key:Y,routeId:K.routeId,path:K.path,matches:U,match:ie,request:Z,controller:L})}),{dsMatches:z,revalidatingFetchers:J}}function Dx(e,t,n){if(e.lazy)return!0;if(!e.loader)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 Jk(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function eI(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Rm(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function _R(e,t,n,r,s,l){let c;if(e){let m=r[e];St(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),c=m.children}else c=n;let d=[],h=[];if(t.forEach(m=>{let g=c.find(v=>d_(m,v));g?h.push({existingRoute:g,newRoute:m}):d.push(m)}),d.length>0){let m=jd(d,s,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...m)}if(l&&h.length>0)for(let m=0;m<h.length;m++){let{existingRoute:g,newRoute:v}=h[m],x=g,[b]=jd([v],s,[],{},!0);Object.assign(x,{element:b.element?b.element:x.element,errorElement:b.errorElement?b.errorElement:x.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:x.hydrateFallbackElement})}}function d_(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(l=>d_(n,l))}):!1}var jR=new WeakMap,f_=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(St(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let l=s.lazy[e];if(!l)return;let c=jR.get(s);c||(c={},jR.set(s,c));let d=c[e];if(d)return d;let h=(async()=>{let m=bk(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)Tn(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(v)Tn(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await l();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]=h,h},NR=new WeakMap;function tI(e,t,n,r,s){let l=n[e.id];if(St(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=NR.get(l);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{St(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),b={};for(let w in x){let C=x[w];if(C===void 0)continue;let E=Ck(w),T=l[w]!==void 0&&w!=="hasErrorBoundary";E?Tn(!E,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?Tn(!T,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=C}Object.assign(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return NR.set(l,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let c=Object.keys(e.lazy),d=[],h;for(let g of c){if(s&&s.includes(g))continue;let v=f_({key:g,route:e,manifest:n,mapRouteProperties:r});v&&(d.push(v),g===t&&(h=v))}let m=d.length>0?Promise.all(d).then(()=>{}):void 0;return m==null||m.catch(()=>{}),h==null||h.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:h}}async function AR(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,l)=>{n[t[l].route.id]=s}),n}async function nI(e){if(!e.matches.some(n=>n.route.unstable_middleware))return AR(e);let t=!1;return m_(e,()=>(t=!0,AR(e)),(n,r)=>h_(n,r,e.matches,t))}function h_(e,t,n,r){if(r)return{[t]:{type:"error",result:e}};{let s=Math.min(n.findIndex(c=>c.route.id===t)||0,n.findIndex(c=>c.unstable_shouldCallHandler())||0);return{[Zo(n,n[s].route.id).route.id]:{type:"error",result:e}}}}async function m_(e,t,n){let{matches:r,request:s,params:l,context:c}=e,d=r.flatMap(m=>m.route.unstable_middleware?m.route.unstable_middleware.map(g=>[m.route.id,g]):[]),h={};return await p_({request:s,params:l,context:c},d,t,n,h),h}async function p_(e,t,n,r,s={},l=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason?c.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${c.method} ${c.url}`);let d=t[l];if(!d){let x=await n();Object.assign(s,x);return}let[h,m]=d,g=!1,v=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");g=!0;try{let x=await p_(e,t,n,r,s,l+1);Object.assign(s,x)}catch(x){let b=await r(x,h);Object.assign(s,b)}};try{let x=await m({request:e.request,params:e.params,context:e.context},v);typeof x<"u"&&console.warn("client middlewares are not intended to return values, the value will be ignored",x),g||await v()}catch(x){let b=await r(x,h);Object.assign(s,b)}}function g_(e,t,n,r,s){let l=f_({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=tI(r.route,Lr(n.method)?"action":"loader",t,e,s);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Ox(e,t,n,r,s,l,c,d=null){let h=!1,m=g_(e,t,n,r,s);return{...r,_lazyPromises:m,shouldLoad:c,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler(g){return h=!0,d?typeof g=="boolean"?Rm(r,{...d,defaultShouldRevalidate:g}):Rm(r,d):c},resolve(g){return h||c||g&&!Lr(n.method)&&(r.route.lazy||r.route.loader)?aI({request:n,match:r,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:g,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Rc(e,t,n,r,s,l,c,d=null){return r.map(h=>h.route.id!==s.route.id?{...h,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:g_(e,t,n,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ox(e,t,n,h,l,c,!0,d))}async function rI(e,t,n,r,s,l){n.some(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(n.map(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware}));let c={request:t,params:n[0].params,context:s,matches:n},h=await e({...c,fetcherKey:r,unstable_runClientMiddleware:m=>{let g=c,v=!1;return m_(g,()=>(v=!0,m({...g,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}})),(x,b)=>h_(x,b,n,v))}});try{await Promise.all(n.flatMap(m=>{var g,v;return[(g=m._lazyPromises)==null?void 0:g.handler,(v=m._lazyPromises)==null?void 0:v.route]}))}catch{}return h}async function aI({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:s,scopedContext:l}){let c,d,h=Lr(e.method),m=h?"action":"loader",g=v=>{let x,b=new Promise((E,R)=>x=R);d=()=>x(),e.signal.addEventListener("abort",d);let w=E=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${t.route.id}]`)):v({request:e,params:t.params,context:l},...E!==void 0?[E]:[]),C=(async()=>{try{return{type:"data",result:await(s?s(R=>w(R)):w())}}catch(E){return{type:"error",result:E}}})();return Promise.race([C,b])};try{let v=h?t.route.action:t.route.loader;if(n||r)if(v){let x,[b]=await Promise.all([g(v).catch(w=>{x=w}),n,r]);if(x!==void 0)throw x;c=b}else{await n;let x=h?t.route.action:t.route.loader;if(x)[c]=await Promise.all([g(x),r]);else if(m==="action"){let b=new URL(e.url),w=b.pathname+b.search;throw Ra(405,{method:e.method,pathname:w,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(v)c=await g(v);else{let x=new URL(e.url),b=x.pathname+x.search;throw Ra(404,{pathname:b})}}catch(v){return{type:"error",result:v}}finally{d&&e.signal.removeEventListener("abort",d)}return c}async function sI(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 oI(e){var r,s,l,c,d,h;let{result:t,type:n}=e;if(y_(t)){let m;try{m=await sI(t)}catch(g){return{type:"error",error:g}}return n==="error"?{type:"error",error:new Em(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:"data",data:m,statusCode:t.status,headers:t.headers}}return n==="error"?PR(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:new Em(((l=t.init)==null?void 0:l.status)||500,void 0,t.data),statusCode:Nd(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Nd(t)?t.status:void 0}:PR(t)?{type:"data",data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(h=t.init)!=null&&h.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function iI(e,t,n,r,s){let l=e.headers.get("Location");if(St(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!Lb(l)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=Ax(new URL(t.url),c,s,l),e.headers.set("Location",l)}return e}function DR(e,t,n){if(Lb(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=Na(s.pathname,n)!=null;if(s.origin===t.origin&&l)return s.pathname+s.search+s.hash}return e}function gc(e,t,n,r){let s=e.createURL(v_(t)).toString(),l={signal:n};if(r&&Lr(r.formMethod)){let{formMethod:c,formEncType:d}=r;l.method=c.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(r.json)):d==="text/plain"?l.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?l.body=Mx(r.formData):l.body=r.formData}return new Request(s,l)}function Mx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function OR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function lI(e,t,n,r=!1,s=!1){let l={},c=null,d,h=!1,m={},g=n&&Xr(n[1])?n[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in t))return;let x=v.route.id,b=t[x];if(St(!Wi(b),"Cannot handle redirect results in processLoaderData"),Xr(b)){let w=b.error;if(g!==void 0&&(w=g,g=void 0),c=c||{},s)c[x]=w;else{let C=Zo(e,x);c[C.route.id]==null&&(c[C.route.id]=w)}r||(l[x]=u_),h||(h=!0,d=Nd(b.error)?b.error.status:500),b.headers&&(m[x]=b.headers)}else l[x]=b.data,b.statusCode&&b.statusCode!==200&&!h&&(d=b.statusCode),b.headers&&(m[x]=b.headers)}),g!==void 0&&n&&(c={[n[0]]:g},n[2]&&(l[n[2]]=void 0)),{loaderData:l,errors:c,statusCode:d||200,loaderHeaders:m}}function MR(e,t,n,r,s,l){let{loaderData:c,errors:d}=lI(t,n,r);return s.filter(h=>!h.matches||h.matches.some(m=>m.shouldLoad)).forEach(h=>{let{key:m,match:g,controller:v}=h;if(v&&v.signal.aborted)return;let x=l[m];if(St(x,"Did not find corresponding fetcher result"),Xr(x)){let b=Zo(e.matches,g==null?void 0:g.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:x.error}),e.fetchers.delete(m)}else if(Wi(x))St(!1,"Unhandled fetcher revalidation redirect");else{let b=zo(x.data);e.fetchers.set(m,b)}}),{loaderData:c,errors:d}}function kR(e,t,n,r){let s=Object.entries(t).filter(([,l])=>l!==u_).reduce((l,[c,d])=>(l[c]=d,l),{});for(let l of n){let c=l.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&l.route.loader&&(s[c]=e[c]),r&&r.hasOwnProperty(c))break}return s}function IR(e){return e?Xr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Zo(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 LR(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 Ra(e,{pathname:t,routeId:n,method:r,type:s,message:l}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`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"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`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&&(d=`Invalid request method "${r.toUpperCase()}"`)),new Em(e||500,c,new Error(d),!0)}function Fh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(Wi(s))return{key:r,result:s}}}function v_(e){let t=typeof e=="string"?mi(e):e;return oi({...t,hash:""})}function cI(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function uI(e){return y_(e.result)&&qk.has(e.result.status)}function Xr(e){return e.type==="error"}function Wi(e){return(e&&e.type)==="redirect"}function PR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function y_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function dI(e){return Gk.has(e.toUpperCase())}function Lr(e){return $k.has(e.toUpperCase())}function Pb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function im(e,t){let n=typeof t=="string"?mi(t).search:t.search;if(e[e.length-1].route.index&&Pb(n||""))return e[e.length-1];let r=i_(e);return r[r.length-1]}function UR(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:l,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(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,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 Iy(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 fI(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 rd(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 hI(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 mI(e,t){try{let n=e.sessionStorage.getItem(c_);if(n){let r=JSON.parse(n);for(let[s,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(s,new Set(l||[]))}}catch{}}function pI(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(c_,JSON.stringify(n))}catch(r){Tn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function gI(){let e,t,n=new Promise((r,s)=>{e=async l=>{r(l);try{await n}catch{}},t=async l=>{s(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var hl=p.createContext(null);hl.displayName="DataRouter";var Kd=p.createContext(null);Kd.displayName="DataRouterState";p.createContext(!1);var Ub=p.createContext({isTransitioning:!1});Ub.displayName="ViewTransition";var x_=p.createContext(new Map);x_.displayName="Fetchers";var vI=p.createContext(null);vI.displayName="Await";var Wa=p.createContext(null);Wa.displayName="Navigation";var mp=p.createContext(null);mp.displayName="Location";var Da=p.createContext({outlet:null,matches:[],isDataRoute:!1});Da.displayName="Route";var Fb=p.createContext(null);Fb.displayName="RouteError";function yI(e,{relative:t}={}){St(Fc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=p.useContext(Wa),{hash:s,pathname:l,search:c}=Yd(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:vs([n,l])),r.createHref({pathname:d,search:c,hash:s})}function Fc(){return p.useContext(mp)!=null}function pi(){return St(Fc(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(mp).location}var b_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function S_(e){p.useContext(Wa).static||p.useLayoutEffect(e)}function Zd(){let{isDataRoute:e}=p.useContext(Da);return e?MI():xI()}function xI(){St(Fc(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(hl),{basename:t,navigator:n}=p.useContext(Wa),{matches:r}=p.useContext(Da),{pathname:s}=pi(),l=JSON.stringify(fp(r)),c=p.useRef(!1);return S_(()=>{c.current=!0}),p.useCallback((h,m={})=>{if(Tn(c.current,b_),!c.current)return;if(typeof h=="number"){n.go(h);return}let g=hp(h,JSON.parse(l),s,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:vs([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,l,s,e])}var C_=p.createContext(null);function Ts(){return p.useContext(C_)}function bI(e){let t=p.useContext(Da).outlet;return t&&p.createElement(C_.Provider,{value:e},t)}function SI(){let{matches:e}=p.useContext(Da),t=e[e.length-1];return t?t.params:{}}function Yd(e,{relative:t}={}){let{matches:n}=p.useContext(Da),{pathname:r}=pi(),s=JSON.stringify(fp(n));return p.useMemo(()=>hp(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function CI(e,t,n,r){St(Fc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=p.useContext(Wa),{matches:l}=p.useContext(Da),c=l[l.length-1],d=c?c.params:{},h=c?c.pathname:"/",m=c?c.pathnameBase:"/",g=c&&c.route;{let R=g&&g.path||"";w_(h,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let v=pi(),x;x=v;let b=x.pathname||"/",w=b;if(m!=="/"){let R=m.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(R.length).join("/")}let C=Ko(e,{pathname:w});return Tn(g||C!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Tn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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.`),_I(C&&C.map(R=>Object.assign({},R,{params:Object.assign({},d,R.params),pathname:vs([m,s.encodeLocation?s.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:vs([m,s.encodeLocation?s.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),l,n,r)}function wI(){let e=OI(),t=Nd(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},l={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:l},"ErrorBoundary")," or"," ",p.createElement("code",{style:l},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:s},n):null,c)}var EI=p.createElement(wI,null),RI=class extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?p.createElement(Da.Provider,{value:this.props.routeContext},p.createElement(Fb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function TI({routeContext:e,match:t,children:n}){let r=p.useContext(hl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(Da.Provider,{value:e},n)}function _I(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=n==null?void 0:n.errors;if(l!=null){let h=s.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);St(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,h+1))}let c=!1,d=-1;if(n)for(let h=0;h<s.length;h++){let m=s[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=h),m.route.id){let{loaderData:g,errors:v}=n,x=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||x){c=!0,d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}return s.reduceRight((h,m,g)=>{let v,x=!1,b=null,w=null;n&&(v=l&&m.route.id?l[m.route.id]:void 0,b=m.route.errorElement||EI,c&&(d<0&&g===0?(w_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,w=null):d===g&&(x=!0,w=m.route.hydrateFallbackElement||null)));let C=t.concat(s.slice(0,g+1)),E=()=>{let R;return v?R=b:x?R=w:m.route.Component?R=p.createElement(m.route.Component,null):m.route.element?R=m.route.element:R=h,p.createElement(TI,{match:m,routeContext:{outlet:h,matches:C,isDataRoute:n!=null},children:R})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?p.createElement(RI,{location:n.location,revalidation:n.revalidation,component:b,error:v,children:E(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):E()},null)}function Hb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jI(e){let t=p.useContext(hl);return St(t,Hb(e)),t}function NI(e){let t=p.useContext(Kd);return St(t,Hb(e)),t}function AI(e){let t=p.useContext(Da);return St(t,Hb(e)),t}function Vb(e){let t=AI(e),n=t.matches[t.matches.length-1];return St(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function DI(){return Vb("useRouteId")}function OI(){var r;let e=p.useContext(Fb),t=NI("useRouteError"),n=Vb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function MI(){let{router:e}=jI("useNavigate"),t=Vb("useNavigate"),n=p.useRef(!1);return S_(()=>{n.current=!0}),p.useCallback(async(s,l={})=>{Tn(n.current,b_),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var FR={};function w_(e,t,n){!t&&!FR[e]&&(FR[e]=!0,Tn(!1,n))}var HR={};function VR(e,t){!e&&!HR[t]&&(HR[t]=!0,console.warn(t))}function kI(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Tn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:p.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Tn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Tn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var II=["HydrateFallback","hydrateFallbackElement"],LI=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 PI({router:e,flushSync:t}){let[n,r]=p.useState(e.state),[s,l]=p.useState(),[c,d]=p.useState({isTransitioning:!1}),[h,m]=p.useState(),[g,v]=p.useState(),[x,b]=p.useState(),w=p.useRef(new Map),C=p.useCallback((_,{deletedFetchers:O,flushSync:A,viewTransitionOpts:j})=>{_.fetchers.forEach((k,V)=>{k.data!==void 0&&w.current.set(V,k.data)}),O.forEach(k=>w.current.delete(k)),VR(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let D=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(VR(j==null||D,"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."),!j||!D){t&&A?t(()=>r(_)):p.startTransition(()=>r(_));return}if(t&&A){t(()=>{g&&(h&&h.resolve(),g.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:j.currentLocation,nextLocation:j.nextLocation})});let k=e.window.document.startViewTransition(()=>{t(()=>r(_))});k.finished.finally(()=>{t(()=>{m(void 0),v(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>v(k));return}g?(h&&h.resolve(),g.skipTransition(),b({state:_,currentLocation:j.currentLocation,nextLocation:j.nextLocation})):(l(_),d({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}))},[e.window,t,g,h]);p.useLayoutEffect(()=>e.subscribe(C),[e,C]),p.useEffect(()=>{c.isTransitioning&&!c.flushSync&&m(new LI)},[c]),p.useEffect(()=>{if(h&&s&&e.window){let _=s,O=h.promise,A=e.window.document.startViewTransition(async()=>{p.startTransition(()=>r(_)),await O});A.finished.finally(()=>{m(void 0),v(void 0),l(void 0),d({isTransitioning:!1})}),v(A)}},[s,h,e.window]),p.useEffect(()=>{h&&s&&n.location.key===s.location.key&&h.resolve()},[h,g,n.location,s]),p.useEffect(()=>{!c.isTransitioning&&x&&(l(x.state),d({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),b(void 0))},[c.isTransitioning,x]);let E=p.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:_=>e.navigate(_),push:(_,O,A)=>e.navigate(_,{state:O,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(_,O,A)=>e.navigate(_,{replace:!0,state:O,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[e]),R=e.basename||"/",T=p.useMemo(()=>({router:e,navigator:E,static:!1,basename:R}),[e,E,R]);return p.createElement(p.Fragment,null,p.createElement(hl.Provider,{value:T},p.createElement(Kd.Provider,{value:n},p.createElement(x_.Provider,{value:w.current},p.createElement(Ub.Provider,{value:c},p.createElement(VI,{basename:R,location:n.location,navigationType:n.historyAction,navigator:E},p.createElement(UI,{routes:e.routes,future:e.future,state:n})))))),null)}var UI=p.memo(FI);function FI({routes:e,future:t,state:n}){return CI(e,void 0,n,t)}function HI({to:e,replace:t,state:n,relative:r}){St(Fc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=p.useContext(Wa);Tn(!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:l}=p.useContext(Da),{pathname:c}=pi(),d=Zd(),h=hp(e,fp(l),c,r==="path"),m=JSON.stringify(h);return p.useEffect(()=>{d(JSON.parse(m),{replace:t,state:n,relative:r})},[d,m,r,t,n]),null}function E_(e){return bI(e.context)}function VI({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:l=!1}){St(!Fc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=p.useMemo(()=>({basename:c,navigator:s,static:l,future:{}}),[c,s,l]);typeof n=="string"&&(n=mi(n));let{pathname:h="/",search:m="",hash:g="",state:v=null,key:x="default"}=n,b=p.useMemo(()=>{let w=Na(h,c);return w==null?null:{location:{pathname:w,search:m,hash:g,state:v,key:x},navigationType:r}},[c,h,m,g,v,x,r]);return Tn(b!=null,`<Router basename="${c}"> is not able to match the URL "${h}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:p.createElement(Wa.Provider,{value:d},p.createElement(mp.Provider,{children:t,value:b}))}var lm="get",cm="application/x-www-form-urlencoded";function pp(e){return e!=null&&typeof e.tagName=="string"}function zI(e){return pp(e)&&e.tagName.toLowerCase()==="button"}function $I(e){return pp(e)&&e.tagName.toLowerCase()==="form"}function BI(e){return pp(e)&&e.tagName.toLowerCase()==="input"}function GI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qI(e,t){return e.button===0&&(!t||t==="_self")&&!GI(e)}var Hh=null;function KI(){if(Hh===null)try{new FormData(document.createElement("form"),0),Hh=!1}catch{Hh=!0}return Hh}var ZI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ly(e){return e!=null&&!ZI.has(e)?(Tn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${cm}"`),null):e}function YI(e,t){let n,r,s,l,c;if($I(e)){let d=e.getAttribute("action");r=d?Na(d,t):null,n=e.getAttribute("method")||lm,s=Ly(e.getAttribute("enctype"))||cm,l=new FormData(e)}else if(zI(e)||BI(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(r=h?Na(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||lm,s=Ly(e.getAttribute("formenctype"))||Ly(d.getAttribute("enctype"))||cm,l=new FormData(d,e),!KI()){let{name:m,type:g,value:v}=e;if(g==="image"){let x=m?`${m}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else m&&l.append(m,v)}}else{if(pp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=lm,r=null,s=cm,c=e}return l&&s==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function WI(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&&Na(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function QI(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 XI(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 JI(e,t,n){let r=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let c=await QI(l,n);return c.links?c.links():[]}return[]}));return rL(r.flat(1).filter(XI).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function zR(e,t,n,r,s,l){let c=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,d=(h,m)=>{var g;return n[m].pathname!==h.pathname||((g=n[m].route.path)==null?void 0:g.endsWith("*"))&&n[m].params["*"]!==h.params["*"]};return l==="assets"?t.filter((h,m)=>c(h,m)||d(h,m)):l==="data"?t.filter((h,m)=>{var v;let g=r.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(c(h,m)||d(h,m))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((v=n[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function eL(e,t,{includeHydrateFallback:n}={}){return tL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function tL(e){return[...new Set(e)]}function nL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function rL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let l=JSON.stringify(nL(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function R_(){let e=p.useContext(hl);return zb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function aL(){let e=p.useContext(Kd);return zb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var $b=p.createContext(void 0);$b.displayName="FrameworkContext";function T_(){let e=p.useContext($b);return zb(e,"You must render this element inside a <HydratedRouter> element"),e}function sL(e,t){let n=p.useContext($b),[r,s]=p.useState(!1),[l,c]=p.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:v}=t,x=p.useRef(null);p.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=R=>{R.forEach(T=>{c(T.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),p.useEffect(()=>{if(r){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[r]);let b=()=>{s(!0)},w=()=>{s(!1),c(!1)};return n?e!=="intent"?[l,x,{}]:[l,x,{onFocus:ad(d,b),onBlur:ad(h,w),onMouseEnter:ad(m,b),onMouseLeave:ad(g,w),onTouchStart:ad(v,b)}]:[!1,x,{}]}function ad(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oL({page:e,...t}){let{router:n}=R_(),r=p.useMemo(()=>Ko(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?p.createElement(lL,{page:e,matches:r,...t}):null}function iL(e){let{manifest:t,routeModules:n}=T_(),[r,s]=p.useState([]);return p.useEffect(()=>{let l=!1;return JI(e,t,n).then(c=>{l||s(c)}),()=>{l=!0}},[e,t,n]),r}function lL({page:e,matches:t,...n}){let r=pi(),{manifest:s,routeModules:l}=T_(),{basename:c}=R_(),{loaderData:d,matches:h}=aL(),m=p.useMemo(()=>zR(e,t,h,s,r,"data"),[e,t,h,s,r]),g=p.useMemo(()=>zR(e,t,h,s,r,"assets"),[e,t,h,s,r]),v=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(R=>{var _;let T=s.routes[R.route.id];!T||!T.hasLoader||(!m.some(O=>O.route.id===R.route.id)&&R.route.id in d&&((_=l[R.route.id])!=null&&_.shouldRevalidate)||T.hasClientLoader?C=!0:w.add(R.route.id))}),w.size===0)return[];let E=WI(e,c,"data");return C&&w.size>0&&E.searchParams.set("_routes",t.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[c,d,r,s,m,t,e,l]),x=p.useMemo(()=>eL(g,s),[g,s]),b=iL(g);return p.createElement(p.Fragment,null,v.map(w=>p.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),x.map(w=>p.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:C})=>p.createElement("link",{key:w,nonce:n.nonce,...C})))}function cL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var __=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{__&&(window.__reactRouterVersion="7.8.1")}catch{}function uL(e,t){return Qk({basename:t==null?void 0:t.basename,unstable_getContext:t==null?void 0:t.unstable_getContext,future:t==null?void 0:t.future,history:gk({window:t==null?void 0:t.window}),hydrationData:dL(),routes:e,mapRouteProperties:kI,hydrationRouteProperties:II,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function dL(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:fL(e.errors)}),e}function fL(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 Em(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let l=window[s.__subType];if(typeof l=="function")try{let c=new l(s.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let l=new Error(s.message);l.stack="",n[r]=l}}else n[r]=s;return n}var j_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gi=p.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:c,state:d,target:h,to:m,preventScrollReset:g,viewTransition:v,...x},b){let{basename:w}=p.useContext(Wa),C=typeof m=="string"&&j_.test(m),E,R=!1;if(typeof m=="string"&&C&&(E=m,__))try{let V=new URL(window.location.href),B=m.startsWith("//")?new URL(V.protocol+m):new URL(m),z=Na(B.pathname,w);B.origin===V.origin&&z!=null?m=z+B.search+B.hash:R=!0}catch{Tn(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=yI(m,{relative:s}),[_,O,A]=sL(r,x),j=pL(m,{replace:c,state:d,target:h,preventScrollReset:g,relative:s,viewTransition:v});function D(V){t&&t(V),V.defaultPrevented||j(V)}let k=p.createElement("a",{...x,...A,href:E||T,onClick:R||l?t:D,ref:cL(b,O),target:h,"data-discover":!C&&n==="render"?"true":void 0});return _&&!C?p.createElement(p.Fragment,null,k,p.createElement(oL,{page:T})):k});gi.displayName="Link";var Tm=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:c,viewTransition:d,children:h,...m},g){let v=Yd(c,{relative:m.relative}),x=pi(),b=p.useContext(Kd),{navigator:w,basename:C}=p.useContext(Wa),E=b!=null&&bL(v)&&d===!0,R=w.encodeLocation?w.encodeLocation(v).pathname:v.pathname,T=x.pathname,_=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(T=T.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&C&&(_=Na(_,C)||_);const O=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=T===R||!s&&T.startsWith(R)&&T.charAt(O)==="/",j=_!=null&&(_===R||!s&&_.startsWith(R)&&_.charAt(R.length)==="/"),D={isActive:A,isPending:j,isTransitioning:E},k=A?t:void 0,V;typeof r=="function"?V=r(D):V=[r,A?"active":null,j?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let B=typeof l=="function"?l(D):l;return p.createElement(gi,{...m,"aria-current":k,className:V,ref:g,style:B,to:c,viewTransition:d},typeof h=="function"?h(D):h)});Tm.displayName="NavLink";var hL=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:l,method:c=lm,action:d,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:v,...x},b)=>{let w=yL(),C=xL(d,{relative:m}),E=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&j_.test(d),T=_=>{if(h&&h(_),_.defaultPrevented)return;_.preventDefault();let O=_.nativeEvent.submitter,A=(O==null?void 0:O.getAttribute("formmethod"))||c;w(O||_.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:s,state:l,relative:m,preventScrollReset:g,viewTransition:v})};return p.createElement("form",{ref:b,method:E,action:C,onSubmit:r?h:T,...x,"data-discover":!R&&e==="render"?"true":void 0})});hL.displayName="Form";function mL(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function N_(e){let t=p.useContext(hl);return St(t,mL(e)),t}function pL(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:l,viewTransition:c}={}){let d=Zd(),h=pi(),m=Yd(e,{relative:l});return p.useCallback(g=>{if(qI(g,t)){g.preventDefault();let v=n!==void 0?n:oi(h)===oi(m);d(e,{replace:v,state:r,preventScrollReset:s,relative:l,viewTransition:c})}},[h,d,m,n,r,t,e,s,l,c])}var gL=0,vL=()=>`__${String(++gL)}__`;function yL(){let{router:e}=N_("useSubmit"),{basename:t}=p.useContext(Wa),n=DI();return p.useCallback(async(r,s={})=>{let{action:l,method:c,encType:d,formData:h,body:m}=YI(r,t);if(s.navigate===!1){let g=s.fetcherKey||vL();await e.fetch(g,n,s.action||l,{preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||c,formEncType:s.encType||d,flushSync:s.flushSync})}else await e.navigate(s.action||l,{preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||c,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function xL(e,{relative:t}={}){let{basename:n}=p.useContext(Wa),r=p.useContext(Da);St(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...Yd(e||".",{relative:t})},c=pi();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),h=d.getAll("index");if(h.some(g=>g==="")){d.delete("index"),h.filter(v=>v).forEach(v=>d.append("index",v));let g=d.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:vs([n,l.pathname])),oi(l)}function bL(e,{relative:t}={}){let n=p.useContext(Ub);St(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=N_("useViewTransitionState"),s=Yd(e,{relative:t});if(!n.isTransitioning)return!1;let l=Na(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Na(n.nextLocation.pathname,r)||n.nextLocation.pathname;return wm(s.pathname,c)!=null||wm(s.pathname,l)!=null}var Ba=n_();const SL=e_(Ba);function CL(e){return p.createElement(PI,{flushSync:Ba.flushSync,...e})}function $R(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function io(...e){return t=>{let n=!1;const r=e.map(s=>{const l=$R(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<r.length;s++){const l=r[s];typeof l=="function"?l():$R(e[s],null)}}}}function gt(...e){return p.useCallback(io(...e),e)}function ii(e){const t=wL(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),h=d.find(EL);if(h){const m=h.props.children,g=d.map(v=>v===h?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:v);return o.jsx(t,{...c,ref:s,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}var gp=ii("Slot");function wL(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=TL(s),d=RL(l,s.props);return s.type!==p.Fragment&&(d.ref=r?io(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var A_=Symbol("radix.slottable");function D_(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=A_,t}function EL(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===A_}function RL(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const h=l(...d);return s(...d),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function TL(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 O_(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=O_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function M_(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=O_(e))&&(r&&(r+=" "),r+=t);return r}const BR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,GR=M_,Wd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return GR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,c=Object.keys(s).map(m=>{const g=n==null?void 0:n[m],v=l==null?void 0:l[m];if(g===null)return null;const x=BR(g)||BR(v);return s[m][x]}),d=n&&Object.entries(n).reduce((m,g)=>{let[v,x]=g;return x===void 0||(m[v]=x),m},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,g)=>{let{class:v,className:x,...b}=g;return Object.entries(b).every(w=>{let[C,E]=w;return Array.isArray(E)?E.includes({...l,...d}[C]):{...l,...d}[C]===E})?[...m,v,x]:m},[]);return GR(e,c,h,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 _L=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),k_=(...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 jL={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 NL=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:c,...d},h)=>p.createElement("svg",{ref:h,...jL,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:k_("lucide",s),...d},[...c.map(([m,g])=>p.createElement(m,g)),...Array.isArray(l)?l:[l]]));/**
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 He=(e,t)=>{const n=p.forwardRef(({className:r,...s},l)=>p.createElement(NL,{ref:l,iconNode:t,className:k_(`lucide-${_L(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 AL=[["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"}]],Bb=He("ArchiveRestore",AL);/**
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 DL=[["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"}]],qR=He("ArrowDownZA",DL);/**
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 OL=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ML=He("ArrowLeft",OL);/**
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 kL=[["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"}]],KR=He("ArrowUpAZ",kL);/**
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 IL=[["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"}]],ZR=He("ArrowUpDown",IL);/**
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 LL=[["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"}]],PL=He("Asterisk",LL);/**
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 UL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],FL=He("Ban",UL);/**
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 HL=[["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"}]],VL=He("BookOpen",HL);/**
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 zL=[["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"}]],$L=He("Box",zL);/**
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 BL=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vr=He("Check",BL);/**
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 GL=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Oa=He("ChevronDown",GL);/**
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 qL=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],KL=He("ChevronLeft",qL);/**
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 ZL=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ml=He("ChevronRight",ZL);/**
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 YL=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],bs=He("ChevronUp",YL);/**
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 WL=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],QL=He("ChevronsDownUp",WL);/**
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 XL=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Gb=He("ChevronsUpDown",XL);/**
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 JL=[["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"}]],Hc=He("CircleAlert",JL);/**
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 e5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],I_=He("CircleCheckBig",e5);/**
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 t5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],vp=He("CircleCheck",t5);/**
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 n5=[["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"}]],yp=He("CircleX",n5);/**
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 r5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],a5=He("Circle",r5);/**
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 s5=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],L_=He("Code",s5);/**
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 o5=[["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"}]],i5=He("Columns3",o5);/**
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 l5=[["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"}]],_m=He("Copy",l5);/**
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 c5=[["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"}]],u5=He("DatabaseZap",c5);/**
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 d5=[["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"}]],jm=He("Database",d5);/**
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 f5=[["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"}]],h5=He("Download",f5);/**
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 m5=[["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"}]],p5=He("EllipsisVertical",m5);/**
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 g5=[["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"}]],Ma=He("Ellipsis",g5);/**
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 v5=[["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"}]],Qd=He("ExternalLink",v5);/**
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 y5=[["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"}]],x5=He("EyeOff",y5);/**
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 b5=[["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"}]],S5=He("Eye",b5);/**
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 C5=[["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"}]],w5=He("Gem",C5);/**
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 E5=[["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"}]],R5=He("GripVertical",E5);/**
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 T5=[["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"}]],_5=He("Grip",T5);/**
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 j5=[["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"}]],N5=He("History",j5);/**
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 A5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Fr=He("Info",A5);/**
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 D5=[["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"}]],YR=He("KeyRound",D5);/**
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 O5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xd=He("LoaderCircle",O5);/**
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 M5=[["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"}]],k5=He("Lock",M5);/**
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 I5=[["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"}]],L5=He("LogOut",I5);/**
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 P5=[["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"}]],U5=He("MessageCircleQuestion",P5);/**
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 F5=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],H5=He("MessageCircle",F5);/**
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 V5=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],z5=He("MessageSquare",V5);/**
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 $5=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],B5=He("Moon",$5);/**
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 G5=[["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"}]],q5=He("OctagonAlert",G5);/**
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 K5=[["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"}]],Z5=He("OctagonX",K5);/**
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 Y5=[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],W5=He("PackagePlus",Y5);/**
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 Q5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],X5=He("PanelLeft",Q5);/**
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 J5=[["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"}]],e6=He("PenLine",J5);/**
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 t6=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],qb=He("Play",t6);/**
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 n6=[["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"}]],P_=He("Plug",n6);/**
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 r6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ha=He("Plus",r6);/**
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 a6=[["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"}]],U_=He("RefreshCw",a6);/**
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 s6=[["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"}]],o6=He("Scale",s6);/**
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 i6=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],vi=He("Search",i6);/**
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 l6=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],c6=He("Server",l6);/**
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 u6=[["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"}]],F_=He("Settings",u6);/**
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 d6=[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]],f6=He("SquareArrowOutUpRight",d6);/**
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 h6=[["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"}]],m6=He("Sun",h6);/**
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 p6=[["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"}]],g6=He("Table",p6);/**
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 v6=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],H_=He("Timer",v6);/**
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 y6=[["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"}]],xp=He("Trash2",y6);/**
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 x6=[["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"}]],Kb=He("TriangleAlert",x6);/**
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 b6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ad=He("X",b6),Py=768;function S6(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Py-1}px)`),r=()=>{t(window.innerWidth<Py)};return n.addEventListener("change",r),t(window.innerWidth<Py),()=>n.removeEventListener("change",r)},[]),!!e}const Zb="-",C6=e=>{const t=E6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const d=c.split(Zb);return d[0]===""&&d.length!==1&&d.shift(),V_(d,t)||w6(c)},getConflictingClassGroupIds:(c,d)=>{const h=n[c]||[];return d&&r[c]?[...h,...r[c]]:h}}},V_=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?V_(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const l=e.join(Zb);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},WR=/^\[(.+)\]$/,w6=e=>{if(WR.test(e)){const t=WR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},E6=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)kx(n[s],r,s,t);return r},kx=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const l=s===""?t:QR(t,s);l.classGroupId=n;return}if(typeof s=="function"){if(R6(s)){kx(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([l,c])=>{kx(c,QR(t,l),n,r)})})},QR=(e,t)=>{let n=e;return t.split(Zb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},R6=e=>e.isThemeGetter,T6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,r=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=r.get(l))!==void 0)return s(l,c),c},set(l,c){n.has(l)?n.set(l,c):s(l,c)}}},Ix="!",Lx=":",_6=Lx.length,j6=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let c=0,d=0,h=0,m;for(let w=0;w<s.length;w++){let C=s[w];if(c===0&&d===0){if(C===Lx){l.push(s.slice(h,w)),h=w+_6;continue}if(C==="/"){m=w;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const g=l.length===0?s:s.substring(h),v=N6(g),x=v!==g,b=m&&m>h?m-h:void 0;return{modifiers:l,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:b}};if(t){const s=t+Lx,l=r;r=c=>c.startsWith(s)?l(c.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},N6=e=>e.endsWith(Ix)?e.substring(0,e.length-1):e.startsWith(Ix)?e.substring(1):e,A6=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let l=[];return r.forEach(c=>{c[0]==="["||t[c]?(s.push(...l.sort(),c),l=[]):l.push(c)}),s.push(...l.sort()),s}},D6=e=>({cache:T6(e.cacheSize),parseClassName:j6(e),sortModifiers:A6(e),...C6(e)}),O6=/\s+/,M6=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,c=[],d=e.trim().split(O6);let h="";for(let m=d.length-1;m>=0;m-=1){const g=d[m],{isExternal:v,modifiers:x,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:C}=n(g);if(v){h=g+(h.length>0?" "+h:h);continue}let E=!!C,R=r(E?w.substring(0,C):w);if(!R){if(!E){h=g+(h.length>0?" "+h:h);continue}if(R=r(w),!R){h=g+(h.length>0?" "+h:h);continue}E=!1}const T=l(x).join(":"),_=b?T+Ix:T,O=_+R;if(c.includes(O))continue;c.push(O);const A=s(R,E);for(let j=0;j<A.length;++j){const D=A[j];c.push(_+D)}h=g+(h.length>0?" "+h:h)}return h};function k6(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=z_(t))&&(r&&(r+=" "),r+=n);return r}const z_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=z_(e[r]))&&(n&&(n+=" "),n+=t);return n};function I6(e,...t){let n,r,s,l=c;function c(h){const m=t.reduce((g,v)=>v(g),e());return n=D6(m),r=n.cache.get,s=n.cache.set,l=d,d(h)}function d(h){const m=r(h);if(m)return m;const g=M6(h,n);return s(h,g),g}return function(){return l(k6.apply(null,arguments))}}const zn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,B_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,L6=/^\d+\/\d+$/,P6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,U6=/\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$/,F6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,H6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,V6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ic=e=>L6.test(e),xt=e=>!!e&&!Number.isNaN(Number(e)),Vo=e=>!!e&&Number.isInteger(Number(e)),Uy=e=>e.endsWith("%")&&xt(e.slice(0,-1)),Zs=e=>P6.test(e),z6=()=>!0,$6=e=>U6.test(e)&&!F6.test(e),G_=()=>!1,B6=e=>H6.test(e),G6=e=>V6.test(e),q6=e=>!ze(e)&&!$e(e),K6=e=>Vc(e,Z_,G_),ze=e=>$_.test(e),qi=e=>Vc(e,Y_,$6),Fy=e=>Vc(e,X6,xt),XR=e=>Vc(e,q_,G_),Z6=e=>Vc(e,K_,G6),Vh=e=>Vc(e,W_,B6),$e=e=>B_.test(e),sd=e=>zc(e,Y_),Y6=e=>zc(e,J6),JR=e=>zc(e,q_),W6=e=>zc(e,Z_),Q6=e=>zc(e,K_),zh=e=>zc(e,W_,!0),Vc=(e,t,n)=>{const r=$_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},zc=(e,t,n=!1)=>{const r=B_.exec(e);return r?r[1]?t(r[1]):n:!1},q_=e=>e==="position"||e==="percentage",K_=e=>e==="image"||e==="url",Z_=e=>e==="length"||e==="size"||e==="bg-size",Y_=e=>e==="length",X6=e=>e==="number",J6=e=>e==="family-name",W_=e=>e==="shadow",e8=()=>{const e=zn("color"),t=zn("font"),n=zn("text"),r=zn("font-weight"),s=zn("tracking"),l=zn("leading"),c=zn("breakpoint"),d=zn("container"),h=zn("spacing"),m=zn("radius"),g=zn("shadow"),v=zn("inset-shadow"),x=zn("text-shadow"),b=zn("drop-shadow"),w=zn("blur"),C=zn("perspective"),E=zn("aspect"),R=zn("ease"),T=zn("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...O(),$e,ze],j=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],k=()=>[$e,ze,h],V=()=>[ic,"full","auto",...k()],B=()=>[Vo,"none","subgrid",$e,ze],z=()=>["auto",{span:["full",Vo,$e,ze]},Vo,$e,ze],J=()=>[Vo,"auto",$e,ze],oe=()=>["auto","min","max","fr",$e,ze],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...k()],W=()=>[ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],G=()=>[e,$e,ze],ie=()=>[...O(),JR,XR,{position:[$e,ze]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",W6,K6,{size:[$e,ze]}],U=()=>[Uy,sd,qi],q=()=>["","none","full",m,$e,ze],le=()=>["",xt,sd,qi],me=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[xt,Uy,JR,XR],Ee=()=>["","none",w,$e,ze],De=()=>["none",xt,$e,ze],be=()=>["none",xt,$e,ze],Je=()=>[xt,$e,ze],Xe=()=>[ic,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Zs],breakpoint:[Zs],color:[z6],container:[Zs],"drop-shadow":[Zs],ease:["in","out","in-out"],font:[q6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Zs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Zs],shadow:[Zs],spacing:["px",xt],text:[Zs],"text-shadow":[Zs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ic,ze,$e,E]}],container:["container"],columns:[{columns:[xt,ze,$e,d]}],"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:A()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Vo,"auto",$e,ze]}],basis:[{basis:[ic,"full","auto",d,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xt,ic,"auto","initial","none",ze]}],grow:[{grow:["",xt,$e,ze]}],shrink:[{shrink:["",xt,$e,ze]}],order:[{order:[Vo,"first","last","none",$e,ze]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[d,"screen",...W()]}],"min-w":[{"min-w":[d,"screen","none",...W()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,sd,qi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,$e,Fy]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Uy,ze]}],"font-family":[{font:[Y6,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,$e,ze]}],"line-clamp":[{"line-clamp":[xt,"none",$e,Fy]}],leading:[{leading:[l,...k()]}],"list-image":[{"list-image":["none",$e,ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[xt,"from-font","auto",$e,qi]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[xt,"auto",$e,ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e,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",$e,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:ie()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Vo,$e,ze],radial:["",$e,ze],conic:[Vo,$e,ze]},Q6,Z6]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xt,$e,ze]}],"outline-w":[{outline:["",xt,sd,qi]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",g,zh,Vh]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",v,zh,Vh]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[xt,qi]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",x,zh,Vh]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[xt,$e,ze]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[xt]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[$e,ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[xt]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,ze]}],filter:[{filter:["","none",$e,ze]}],blur:[{blur:Ee()}],brightness:[{brightness:[xt,$e,ze]}],contrast:[{contrast:[xt,$e,ze]}],"drop-shadow":[{"drop-shadow":["","none",b,zh,Vh]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",xt,$e,ze]}],"hue-rotate":[{"hue-rotate":[xt,$e,ze]}],invert:[{invert:["",xt,$e,ze]}],saturate:[{saturate:[xt,$e,ze]}],sepia:[{sepia:["",xt,$e,ze]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,ze]}],"backdrop-blur":[{"backdrop-blur":Ee()}],"backdrop-brightness":[{"backdrop-brightness":[xt,$e,ze]}],"backdrop-contrast":[{"backdrop-contrast":[xt,$e,ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xt,$e,ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xt,$e,ze]}],"backdrop-invert":[{"backdrop-invert":["",xt,$e,ze]}],"backdrop-opacity":[{"backdrop-opacity":[xt,$e,ze]}],"backdrop-saturate":[{"backdrop-saturate":[xt,$e,ze]}],"backdrop-sepia":[{"backdrop-sepia":["",xt,$e,ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$e,ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xt,"initial",$e,ze]}],ease:[{ease:["linear","initial",R,$e,ze]}],delay:[{delay:[xt,$e,ze]}],animate:[{animate:["none",T,$e,ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,$e,ze]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:De()}],"rotate-x":[{"rotate-x":De()}],"rotate-y":[{"rotate-y":De()}],"rotate-z":[{"rotate-z":De()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Je()}],"skew-x":[{"skew-x":Je()}],"skew-y":[{"skew-y":Je()}],transform:[{transform:[$e,ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xe()}],"translate-x":[{"translate-x":Xe()}],"translate-y":[{"translate-y":Xe()}],"translate-z":[{"translate-z":Xe()}],"translate-none":["translate-none"],accent:[{accent:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"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",$e,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":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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",$e,ze]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[xt,sd,qi,Fy]}],stroke:[{stroke:["none",...G()]}],"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"]}},t8=I6(e8);function de(...e){return t8(M_(e))}const Yb=Wd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function we({className:e,variant:t,size:n,asChild:r=!1,...s}){const l=r?gp:"button";return o.jsx(l,{"data-slot":"button",className:de(Yb({variant:t,size:n,className:e})),...s})}function zt({className:e,type:t,...n}){return o.jsx("input",{type:t,"data-slot":"input",className:de("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 n8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=n8.reduce((e,t)=>{const n=ii(`Primitive.${t}`),r=p.forwardRef((s,l)=>{const{asChild:c,...d}=s,h=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(h,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Q_(e,t){e&&Ba.flushSync(()=>e.dispatchEvent(t))}var r8="Separator",e1="horizontal",a8=["horizontal","vertical"],X_=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=e1,...s}=e,l=s8(r)?r:e1,d=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return o.jsx(Ze.div,{"data-orientation":l,...d,...s,ref:t})});X_.displayName=r8;function s8(e){return a8.includes(e)}var o8=X_;function J_({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return o.jsx(o8,{"data-slot":"separator",decorative:n,orientation:t,className:de("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 Te(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 i8(e,t){const n=p.createContext(t),r=l=>{const{children:c,...d}=l,h=p.useMemo(()=>d,Object.values(d));return o.jsx(n.Provider,{value:h,children:c})};r.displayName=e+"Provider";function s(l){const c=p.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,s]}function jr(e,t=[]){let n=[];function r(l,c){const d=p.createContext(c),h=n.length;n=[...n,c];const m=v=>{var R;const{scope:x,children:b,...w}=v,C=((R=x==null?void 0:x[e])==null?void 0:R[h])||d,E=p.useMemo(()=>w,Object.values(w));return o.jsx(C.Provider,{value:E,children:b})};m.displayName=l+"Provider";function g(v,x){var C;const b=((C=x==null?void 0:x[e])==null?void 0:C[h])||d,w=p.useContext(b);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[m,g]}const s=()=>{const l=n.map(c=>p.createContext(c));return function(d){const h=(d==null?void 0:d[e])||l;return p.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return s.scopeName=e,[r,l8(s,...t)]}function l8(...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(l){const c=r.reduce((d,{useScope:h,scopeName:m})=>{const v=h(l)[`__scope${m}`];return{...d,...v}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var lr=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},c8=t_[" useId ".trim().toString()]||(()=>{}),u8=0;function Kn(e){const[t,n]=p.useState(c8());return lr(()=>{n(r=>r??String(u8++))},[e]),t?`radix-${t}`:""}var d8=t_[" useInsertionEffect ".trim().toString()]||lr;function ra({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,l,c]=f8({defaultProp:t,onChange:n}),d=e!==void 0,h=d?e:s;{const g=p.useRef(e!==void 0);p.useEffect(()=>{const v=g.current;v!==d&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${d?"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.`),g.current=d},[d,r])}const m=p.useCallback(g=>{var v;if(d){const x=h8(g)?g(e):g;x!==e&&((v=c.current)==null||v.call(c,x))}else l(g)},[d,e,l,c]);return[h,m]}function f8({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),s=p.useRef(n),l=p.useRef(t);return d8(()=>{l.current=t},[t]),p.useEffect(()=>{var c;s.current!==n&&((c=l.current)==null||c.call(l,n),s.current=n)},[n,s]),[n,r,l]}function h8(e){return typeof e=="function"}function Ss(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function m8(e,t=globalThis==null?void 0:globalThis.document){const n=Ss(e);p.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 p8="DismissableLayer",Px="dismissableLayer.update",g8="dismissableLayer.pointerDownOutside",v8="dismissableLayer.focusOutside",t1,ej=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pl=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...h}=e,m=p.useContext(ej),[g,v]=p.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),w=gt(t,D=>v(D)),C=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=C.indexOf(E),T=g?C.indexOf(g):-1,_=m.layersWithOutsidePointerEventsDisabled.size>0,O=T>=R,A=b8(D=>{const k=D.target,V=[...m.branches].some(B=>B.contains(k));!O||V||(s==null||s(D),c==null||c(D),D.defaultPrevented||d==null||d())},x),j=S8(D=>{const k=D.target;[...m.branches].some(B=>B.contains(k))||(l==null||l(D),c==null||c(D),D.defaultPrevented||d==null||d())},x);return m8(D=>{T===m.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&d&&(D.preventDefault(),d()))},x),p.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(t1=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),n1(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=t1)}},[g,x,n,m]),p.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),n1())},[g,m]),p.useEffect(()=>{const D=()=>b({});return document.addEventListener(Px,D),()=>document.removeEventListener(Px,D)},[]),o.jsx(Ze.div,{...h,ref:w,style:{pointerEvents:_?O?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,j.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,A.onPointerDownCapture)})});pl.displayName=p8;var y8="DismissableLayerBranch",x8=p.forwardRef((e,t)=>{const n=p.useContext(ej),r=p.useRef(null),s=gt(t,r);return p.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),o.jsx(Ze.div,{...e,ref:s})});x8.displayName=y8;function b8(e,t=globalThis==null?void 0:globalThis.document){const n=Ss(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let h=function(){tj(g8,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=h,t.addEventListener("click",s.current,{once:!0})):h()}else t.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function S8(e,t=globalThis==null?void 0:globalThis.document){const n=Ss(e),r=p.useRef(!1);return p.useEffect(()=>{const s=l=>{l.target&&!r.current&&tj(v8,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function n1(){const e=new CustomEvent(Px);document.dispatchEvent(e)}function tj(e,t,n,{discrete:r}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Q_(s,l):s.dispatchEvent(l)}var Hy="focusScope.autoFocusOnMount",Vy="focusScope.autoFocusOnUnmount",r1={bubbles:!1,cancelable:!0},C8="FocusScope",Jd=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=e,[d,h]=p.useState(null),m=Ss(s),g=Ss(l),v=p.useRef(null),x=gt(t,C=>h(C)),b=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let C=function(_){if(b.paused||!d)return;const O=_.target;d.contains(O)?v.current=O:$o(v.current,{select:!0})},E=function(_){if(b.paused||!d)return;const O=_.relatedTarget;O!==null&&(d.contains(O)||$o(v.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&$o(d)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const T=new MutationObserver(R);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),T.disconnect()}}},[r,d,b.paused]),p.useEffect(()=>{if(d){s1.add(b);const C=document.activeElement;if(!d.contains(C)){const R=new CustomEvent(Hy,r1);d.addEventListener(Hy,m),d.dispatchEvent(R),R.defaultPrevented||(w8(j8(nj(d)),{select:!0}),document.activeElement===C&&$o(d))}return()=>{d.removeEventListener(Hy,m),setTimeout(()=>{const R=new CustomEvent(Vy,r1);d.addEventListener(Vy,g),d.dispatchEvent(R),R.defaultPrevented||$o(C??document.body,{select:!0}),d.removeEventListener(Vy,g),s1.remove(b)},0)}}},[d,m,g,b]);const w=p.useCallback(C=>{if(!n&&!r||b.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,R=document.activeElement;if(E&&R){const T=C.currentTarget,[_,O]=E8(T);_&&O?!C.shiftKey&&R===O?(C.preventDefault(),n&&$o(_,{select:!0})):C.shiftKey&&R===_&&(C.preventDefault(),n&&$o(O,{select:!0})):R===T&&C.preventDefault()}},[n,r,b.paused]);return o.jsx(Ze.div,{tabIndex:-1,...c,ref:x,onKeyDown:w})});Jd.displayName=C8;function w8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if($o(r,{select:t}),document.activeElement!==n)return}function E8(e){const t=nj(e),n=a1(t,e),r=a1(t.reverse(),e);return[n,r]}function nj(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 a1(e,t){for(const n of e)if(!R8(n,{upTo:t}))return n}function R8(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 T8(e){return e instanceof HTMLInputElement&&"select"in e}function $o(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&T8(e)&&t&&e.select()}}var s1=_8();function _8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=o1(e,t),e.unshift(t)},remove(t){var n;e=o1(e,t),(n=e[0])==null||n.resume()}}}function o1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function j8(e){return e.filter(t=>t.tagName!=="A")}var N8="Portal",gl=p.forwardRef((e,t)=>{var d;const{container:n,...r}=e,[s,l]=p.useState(!1);lr(()=>l(!0),[]);const c=n||s&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?SL.createPortal(o.jsx(Ze.div,{...r,ref:t}),c):null});gl.displayName=N8;function A8(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var yr=e=>{const{present:t,children:n}=e,r=D8(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),l=gt(r.ref,O8(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:l}):null};yr.displayName="Presence";function D8(e){const[t,n]=p.useState(),r=p.useRef(null),s=p.useRef(e),l=p.useRef("none"),c=e?"mounted":"unmounted",[d,h]=A8(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const m=$h(r.current);l.current=d==="mounted"?m:"none"},[d]),lr(()=>{const m=r.current,g=s.current;if(g!==e){const x=l.current,b=$h(m);e?h("MOUNT"):b==="none"||(m==null?void 0:m.display)==="none"?h("UNMOUNT"):h(g&&x!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),lr(()=>{if(t){let m;const g=t.ownerDocument.defaultView??window,v=b=>{const C=$h(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&C&&(h("ANIMATION_END"),!s.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",m=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},x=b=>{b.target===t&&(l.current=$h(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{g.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:p.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function $h(e){return(e==null?void 0:e.animationName)||"none"}function O8(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 zy=0;function bp(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??i1()),document.body.insertAdjacentElement("beforeend",e[1]??i1()),zy++,()=>{zy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zy--}},[])}function i1(){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 ds=function(){return ds=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},ds.apply(this,arguments)};function rj(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 M8(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,l;r<s;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var um="right-scroll-bar-position",dm="width-before-scroll-bar",k8="with-scroll-bars-hidden",I8="--removed-body-scroll-bar-size";function $y(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function L8(e,t){var n=p.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 P8=typeof window<"u"?p.useLayoutEffect:p.useEffect,l1=new WeakMap;function U8(e,t){var n=L8(null,function(r){return e.forEach(function(s){return $y(s,r)})});return P8(function(){var r=l1.get(n);if(r){var s=new Set(r),l=new Set(e),c=n.current;s.forEach(function(d){l.has(d)||$y(d,null)}),l.forEach(function(d){s.has(d)||$y(d,c)})}l1.set(n,e)},[e]),n}function F8(e){return e}function H8(e,t){t===void 0&&(t=F8);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(l){var c=t(l,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var h=function(){var g=c;c=[],g.forEach(l)},m=function(){return Promise.resolve().then(h)};m(),n={push:function(g){c.push(g),m()},filter:function(g){return c=c.filter(g),n}}}};return s}function V8(e){e===void 0&&(e={});var t=H8(null);return t.options=ds({async:!0,ssr:!1},e),t}var aj=function(e){var t=e.sideCar,n=rj(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 p.createElement(r,ds({},n))};aj.isSideCarExport=!0;function z8(e,t){return e.useMedium(t),aj}var sj=V8(),By=function(){},Sp=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:By,onWheelCapture:By,onTouchMoveCapture:By}),s=r[0],l=r[1],c=e.forwardProps,d=e.children,h=e.className,m=e.removeScrollBar,g=e.enabled,v=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,C=e.inert,E=e.allowPinchZoom,R=e.as,T=R===void 0?"div":R,_=e.gapMode,O=rj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=x,j=U8([n,t]),D=ds(ds({},O),s);return p.createElement(p.Fragment,null,g&&p.createElement(A,{sideCar:sj,removeScrollBar:m,shards:v,noRelative:b,noIsolation:w,inert:C,setCallbacks:l,allowPinchZoom:!!E,lockRef:n,gapMode:_}),c?p.cloneElement(p.Children.only(d),ds(ds({},D),{ref:j})):p.createElement(T,ds({},D,{className:h,ref:j}),d))});Sp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Sp.classNames={fullWidth:dm,zeroRight:um};var $8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function B8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$8();return t&&e.setAttribute("nonce",t),e}function G8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function q8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var K8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=B8())&&(G8(t,n),q8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Z8=function(){var e=K8();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oj=function(){var e=Z8(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Y8={left:0,top:0,right:0,gap:0},Gy=function(e){return parseInt(e||"",10)||0},W8=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[Gy(n),Gy(r),Gy(s)]},Q8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Y8;var t=W8(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])}},X8=oj(),Tc="data-scroll-locked",J8=function(e,t,n,r){var s=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
407
+ .`.concat(k8,` {
408
+ overflow: hidden `).concat(r,`;
409
+ padding-right: `).concat(d,"px ").concat(r,`;
410
+ }
411
+ body[`).concat(Tc,`] {
412
+ overflow: hidden `).concat(r,`;
413
+ overscroll-behavior: contain;
414
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
415
+ padding-left: `.concat(s,`px;
416
+ padding-top: `).concat(l,`px;
417
+ padding-right: `).concat(c,`px;
418
+ margin-left:0;
419
+ margin-top:0;
420
+ margin-right: `).concat(d,"px ").concat(r,`;
421
+ `),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
422
+ }
423
+
424
+ .`).concat(um,` {
425
+ right: `).concat(d,"px ").concat(r,`;
426
+ }
427
+
428
+ .`).concat(dm,` {
429
+ margin-right: `).concat(d,"px ").concat(r,`;
430
+ }
431
+
432
+ .`).concat(um," .").concat(um,` {
433
+ right: 0 `).concat(r,`;
434
+ }
435
+
436
+ .`).concat(dm," .").concat(dm,` {
437
+ margin-right: 0 `).concat(r,`;
438
+ }
439
+
440
+ body[`).concat(Tc,`] {
441
+ `).concat(I8,": ").concat(d,`px;
442
+ }
443
+ `)},c1=function(){var e=parseInt(document.body.getAttribute(Tc)||"0",10);return isFinite(e)?e:0},e9=function(){p.useEffect(function(){return document.body.setAttribute(Tc,(c1()+1).toString()),function(){var e=c1()-1;e<=0?document.body.removeAttribute(Tc):document.body.setAttribute(Tc,e.toString())}},[])},t9=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;e9();var l=p.useMemo(function(){return Q8(s)},[s]);return p.createElement(X8,{styles:J8(l,!t,s,n?"":"!important")})},Ux=!1;if(typeof window<"u")try{var Bh=Object.defineProperty({},"passive",{get:function(){return Ux=!0,!0}});window.addEventListener("test",Bh,Bh),window.removeEventListener("test",Bh,Bh)}catch{Ux=!1}var lc=Ux?{passive:!1}:!1,n9=function(e){return e.tagName==="TEXTAREA"},ij=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!n9(e)&&n[t]==="visible")},r9=function(e){return ij(e,"overflowY")},a9=function(e){return ij(e,"overflowX")},u1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=lj(e,r);if(s){var l=cj(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},s9=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},o9=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},lj=function(e,t){return e==="v"?r9(t):a9(t)},cj=function(e,t){return e==="v"?s9(t):o9(t)},i9=function(e,t){return e==="h"&&t==="rtl"?-1:1},l9=function(e,t,n,r,s){var l=i9(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,h=t.contains(d),m=!1,g=c>0,v=0,x=0;do{if(!d)break;var b=cj(e,d),w=b[0],C=b[1],E=b[2],R=C-E-l*w;(w||R)&&lj(e,d)&&(v+=R,x+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!h&&d!==document.body||h&&(t.contains(d)||t===d));return(g&&Math.abs(v)<1||!g&&Math.abs(x)<1)&&(m=!0),m},Gh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},d1=function(e){return[e.deltaX,e.deltaY]},f1=function(e){return e&&"current"in e?e.current:e},c9=function(e,t){return e[0]===t[0]&&e[1]===t[1]},u9=function(e){return`
444
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
445
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
446
+ `)},d9=0,cc=[];function f9(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(d9++)[0],l=p.useState(oj)[0],c=p.useRef(e);p.useEffect(function(){c.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=M8([e.lockRef.current],(e.shards||[]).map(f1),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=p.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!c.current.allowPinchZoom;var R=Gh(C),T=n.current,_="deltaX"in C?C.deltaX:T[0]-R[0],O="deltaY"in C?C.deltaY:T[1]-R[1],A,j=C.target,D=Math.abs(_)>Math.abs(O)?"h":"v";if("touches"in C&&D==="h"&&j.type==="range")return!1;var k=u1(D,j);if(!k)return!0;if(k?A=D:(A=D==="v"?"h":"v",k=u1(D,j)),!k)return!1;if(!r.current&&"changedTouches"in C&&(_||O)&&(r.current=A),!A)return!0;var V=r.current||A;return l9(V,E,C,V==="h"?_:O)},[]),h=p.useCallback(function(C){var E=C;if(!(!cc.length||cc[cc.length-1]!==l)){var R="deltaY"in E?d1(E):Gh(E),T=t.current.filter(function(A){return A.name===E.type&&(A.target===E.target||E.target===A.shadowParent)&&c9(A.delta,R)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var _=(c.current.shards||[]).map(f1).filter(Boolean).filter(function(A){return A.contains(E.target)}),O=_.length>0?d(E,_[0]):!c.current.noIsolation;O&&E.cancelable&&E.preventDefault()}}},[]),m=p.useCallback(function(C,E,R,T){var _={name:C,delta:E,target:R,should:T,shadowParent:h9(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(O){return O!==_})},1)},[]),g=p.useCallback(function(C){n.current=Gh(C),r.current=void 0},[]),v=p.useCallback(function(C){m(C.type,d1(C),C.target,d(C,e.lockRef.current))},[]),x=p.useCallback(function(C){m(C.type,Gh(C),C.target,d(C,e.lockRef.current))},[]);p.useEffect(function(){return cc.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",h,lc),document.addEventListener("touchmove",h,lc),document.addEventListener("touchstart",g,lc),function(){cc=cc.filter(function(C){return C!==l}),document.removeEventListener("wheel",h,lc),document.removeEventListener("touchmove",h,lc),document.removeEventListener("touchstart",g,lc)}},[]);var b=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(l,{styles:u9(s)}):null,b?p.createElement(t9,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function h9(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const m9=z8(sj,f9);var ef=p.forwardRef(function(e,t){return p.createElement(Sp,ds({},e,{ref:t,sideCar:m9}))});ef.classNames=Sp.classNames;var p9=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},uc=new WeakMap,qh=new WeakMap,Kh={},qy=0,uj=function(e){return e&&(e.host||uj(e.parentNode))},g9=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uj(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})},v9=function(e,t,n,r){var s=g9(t,Array.isArray(e)?e:[e]);Kh[n]||(Kh[n]=new WeakMap);var l=Kh[n],c=[],d=new Set,h=new Set(s),m=function(v){!v||d.has(v)||(d.add(v),m(v.parentNode))};s.forEach(m);var g=function(v){!v||h.has(v)||Array.prototype.forEach.call(v.children,function(x){if(d.has(x))g(x);else try{var b=x.getAttribute(r),w=b!==null&&b!=="false",C=(uc.get(x)||0)+1,E=(l.get(x)||0)+1;uc.set(x,C),l.set(x,E),c.push(x),C===1&&w&&qh.set(x,!0),E===1&&x.setAttribute(n,"true"),w||x.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",x,R)}})};return g(t),d.clear(),qy++,function(){c.forEach(function(v){var x=uc.get(v)-1,b=l.get(v)-1;uc.set(v,x),l.set(v,b),x||(qh.has(v)||v.removeAttribute(r),qh.delete(v)),b||v.removeAttribute(n)}),qy--,qy||(uc=new WeakMap,uc=new WeakMap,qh=new WeakMap,Kh={})}},Cp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=p9(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),v9(r,s,n,"aria-hidden")):function(){return null}},wp="Dialog",[dj,fj]=jr(wp),[y9,Qa]=dj(wp),hj=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=p.useRef(null),h=p.useRef(null),[m,g]=ra({prop:r,defaultProp:s??!1,onChange:l,caller:wp});return o.jsx(y9,{scope:t,triggerRef:d,contentRef:h,contentId:Kn(),titleId:Kn(),descriptionId:Kn(),open:m,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(v=>!v),[g]),modal:c,children:n})};hj.displayName=wp;var mj="DialogTrigger",pj=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Qa(mj,n),l=gt(t,s.triggerRef);return o.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Xb(s.open),...r,ref:l,onClick:Te(e.onClick,s.onOpenToggle)})});pj.displayName=mj;var Wb="DialogPortal",[x9,gj]=dj(Wb,{forceMount:void 0}),vj=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,l=Qa(Wb,t);return o.jsx(x9,{scope:t,forceMount:n,children:p.Children.map(r,c=>o.jsx(yr,{present:n||l.open,children:o.jsx(gl,{asChild:!0,container:s,children:c})}))})};vj.displayName=Wb;var Nm="DialogOverlay",yj=p.forwardRef((e,t)=>{const n=gj(Nm,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=Qa(Nm,e.__scopeDialog);return l.modal?o.jsx(yr,{present:r||l.open,children:o.jsx(S9,{...s,ref:t})}):null});yj.displayName=Nm;var b9=ii("DialogOverlay.RemoveScroll"),S9=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Qa(Nm,n);return o.jsx(ef,{as:b9,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx(Ze.div,{"data-state":Xb(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),nl="DialogContent",xj=p.forwardRef((e,t)=>{const n=gj(nl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=Qa(nl,e.__scopeDialog);return o.jsx(yr,{present:r||l.open,children:l.modal?o.jsx(C9,{...s,ref:t}):o.jsx(w9,{...s,ref:t})})});xj.displayName=nl;var C9=p.forwardRef((e,t)=>{const n=Qa(nl,e.__scopeDialog),r=p.useRef(null),s=gt(t,n.contentRef,r);return p.useEffect(()=>{const l=r.current;if(l)return Cp(l)},[]),o.jsx(bj,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault())})}),w9=p.forwardRef((e,t)=>{const n=Qa(nl,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(bj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,m;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),bj=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=e,d=Qa(nl,n),h=p.useRef(null),m=gt(t,h);return bp(),o.jsxs(o.Fragment,{children:[o.jsx(Jd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx(pl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Xb(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(R9,{titleId:d.titleId}),o.jsx(_9,{contentRef:h,descriptionId:d.descriptionId})]})]})}),Qb="DialogTitle",Sj=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Qa(Qb,n);return o.jsx(Ze.h2,{id:s.titleId,...r,ref:t})});Sj.displayName=Qb;var Cj="DialogDescription",wj=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Qa(Cj,n);return o.jsx(Ze.p,{id:s.descriptionId,...r,ref:t})});wj.displayName=Cj;var Ej="DialogClose",Rj=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Qa(Ej,n);return o.jsx(Ze.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});Rj.displayName=Ej;function Xb(e){return e?"open":"closed"}var Tj="DialogTitleWarning",[E9,_j]=i8(Tj,{contentName:nl,titleName:Qb,docsSlug:"dialog"}),R9=({titleId:e})=>{const t=_j(Tj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
447
+
448
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
449
+
450
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},T9="DialogDescriptionWarning",_9=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_j(T9).contentName}}.`;return p.useEffect(()=>{var l;const s=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ep=hj,j9=pj,Rp=vj,Tp=yj,_p=xj,Jb=Sj,e0=wj,jp=Rj;function yi({...e}){return o.jsx(Ep,{"data-slot":"sheet",...e})}function N9({...e}){return o.jsx(Rp,{"data-slot":"sheet-portal",...e})}function A9({className:e,...t}){return o.jsx(Tp,{"data-slot":"sheet-overlay",className:de("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 xi({className:e,children:t,side:n="right",...r}){return o.jsxs(N9,{children:[o.jsx(A9,{}),o.jsxs(_p,{"data-slot":"sheet-content",className:de("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-[480px] border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full min-w-[480px] border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,o.jsxs(jp,{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:[o.jsx(Ad,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function bi({className:e,...t}){return o.jsx("div",{"data-slot":"sheet-header",className:de("flex flex-col gap-1 border-b p-4",e),...t})}function vl({className:e,...t}){return o.jsx(Jb,{"data-slot":"sheet-title",className:de("text-foreground font-semibold",e),...t})}function $c({className:e,...t}){return o.jsx(e0,{"data-slot":"sheet-description",className:de("text-muted-foreground text-sm",e),...t})}function pr({className:e,...t}){return o.jsx("div",{"data-slot":"skeleton",className:de("bg-accent animate-pulse rounded-md",e),...t})}const D9=["top","right","bottom","left"],li=Math.min,ta=Math.max,Am=Math.round,Zh=Math.floor,ys=e=>({x:e,y:e}),O9={left:"right",right:"left",bottom:"top",top:"bottom"},M9={start:"end",end:"start"};function Fx(e,t,n){return ta(e,li(t,n))}function lo(e,t){return typeof e=="function"?e(t):e}function co(e){return e.split("-")[0]}function Bc(e){return e.split("-")[1]}function t0(e){return e==="x"?"y":"x"}function n0(e){return e==="y"?"height":"width"}const k9=new Set(["top","bottom"]);function fs(e){return k9.has(co(e))?"y":"x"}function r0(e){return t0(fs(e))}function I9(e,t,n){n===void 0&&(n=!1);const r=Bc(e),s=r0(e),l=n0(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Dm(c)),[c,Dm(c)]}function L9(e){const t=Dm(e);return[Hx(e),t,Hx(t)]}function Hx(e){return e.replace(/start|end/g,t=>M9[t])}const h1=["left","right"],m1=["right","left"],P9=["top","bottom"],U9=["bottom","top"];function F9(e,t,n){switch(e){case"top":case"bottom":return n?t?m1:h1:t?h1:m1;case"left":case"right":return t?P9:U9;default:return[]}}function H9(e,t,n,r){const s=Bc(e);let l=F9(co(e),n==="start",r);return s&&(l=l.map(c=>c+"-"+s),t&&(l=l.concat(l.map(Hx)))),l}function Dm(e){return e.replace(/left|right|bottom|top/g,t=>O9[t])}function V9(e){return{top:0,right:0,bottom:0,left:0,...e}}function jj(e){return typeof e!="number"?V9(e):{top:e,right:e,bottom:e,left:e}}function Om(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 p1(e,t,n){let{reference:r,floating:s}=e;const l=fs(t),c=r0(t),d=n0(c),h=co(t),m=l==="y",g=r.x+r.width/2-s.width/2,v=r.y+r.height/2-s.height/2,x=r[d]/2-s[d]/2;let b;switch(h){case"top":b={x:g,y:r.y-s.height};break;case"bottom":b={x:g,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:v};break;case"left":b={x:r.x-s.width,y:v};break;default:b={x:r.x,y:r.y}}switch(Bc(t)){case"start":b[c]-=x*(n&&m?-1:1);break;case"end":b[c]+=x*(n&&m?-1:1);break}return b}const z9=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:v}=p1(m,r,h),x=r,b={},w=0;for(let C=0;C<d.length;C++){const{name:E,fn:R}=d[C],{x:T,y:_,data:O,reset:A}=await R({x:g,y:v,initialPlacement:r,placement:x,strategy:s,middlewareData:b,rects:m,platform:c,elements:{reference:e,floating:t}});g=T??g,v=_??v,b={...b,[E]:{...b[E],...O}},A&&w<=50&&(w++,typeof A=="object"&&(A.placement&&(x=A.placement),A.rects&&(m=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:g,y:v}=p1(m,x,h)),C=-1)}return{x:g,y:v,placement:x,strategy:s,middlewareData:b}};async function Dd(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:l,rects:c,elements:d,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:x=!1,padding:b=0}=lo(t,e),w=jj(b),E=d[x?v==="floating"?"reference":"floating":v],R=Om(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(E)))==null||n?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:g,strategy:h})),T=v==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,_=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),O=await(l.isElement==null?void 0:l.isElement(_))?await(l.getScale==null?void 0:l.getScale(_))||{x:1,y:1}:{x:1,y:1},A=Om(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:_,strategy:h}):T);return{top:(R.top-A.top+w.top)/O.y,bottom:(A.bottom-R.bottom+w.bottom)/O.y,left:(R.left-A.left+w.left)/O.x,right:(A.right-R.right+w.right)/O.x}}const $9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:l,platform:c,elements:d,middlewareData:h}=t,{element:m,padding:g=0}=lo(e,t)||{};if(m==null)return{};const v=jj(g),x={x:n,y:r},b=r0(s),w=n0(b),C=await c.getDimensions(m),E=b==="y",R=E?"top":"left",T=E?"bottom":"right",_=E?"clientHeight":"clientWidth",O=l.reference[w]+l.reference[b]-x[b]-l.floating[w],A=x[b]-l.reference[b],j=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let D=j?j[_]:0;(!D||!await(c.isElement==null?void 0:c.isElement(j)))&&(D=d.floating[_]||l.floating[w]);const k=O/2-A/2,V=D/2-C[w]/2-1,B=li(v[R],V),z=li(v[T],V),J=B,oe=D-C[w]-z,K=D/2-C[w]/2+k,Y=Fx(J,K,oe),I=!h.arrow&&Bc(s)!=null&&K!==Y&&l.reference[w]/2-(K<J?B:z)-C[w]/2<0,W=I?K<J?K-J:K-oe:0;return{[b]:x[b]+W,data:{[b]:Y,centerOffset:K-Y-W,...I&&{alignmentOffset:W}},reset:I}}}),B9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:l,rects:c,initialPlacement:d,platform:h,elements:m}=t,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...E}=lo(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const R=co(s),T=fs(d),_=co(d)===d,O=await(h.isRTL==null?void 0:h.isRTL(m.floating)),A=x||(_||!C?[Dm(d)]:L9(d)),j=w!=="none";!x&&j&&A.push(...H9(d,C,w,O));const D=[d,...A],k=await Dd(t,E),V=[];let B=((r=l.flip)==null?void 0:r.overflows)||[];if(g&&V.push(k[R]),v){const K=I9(s,c,O);V.push(k[K[0]],k[K[1]])}if(B=[...B,{placement:s,overflows:V}],!V.every(K=>K<=0)){var z,J;const K=(((z=l.flip)==null?void 0:z.index)||0)+1,Y=D[K];if(Y&&(!(v==="alignment"?T!==fs(Y):!1)||B.every(G=>fs(G.placement)===T?G.overflows[0]>0:!0)))return{data:{index:K,overflows:B},reset:{placement:Y}};let I=(J=B.filter(W=>W.overflows[0]<=0).sort((W,G)=>W.overflows[1]-G.overflows[1])[0])==null?void 0:J.placement;if(!I)switch(b){case"bestFit":{var oe;const W=(oe=B.filter(G=>{if(j){const ie=fs(G.placement);return ie===T||ie==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(ie=>ie>0).reduce((ie,L)=>ie+L,0)]).sort((G,ie)=>G[1]-ie[1])[0])==null?void 0:oe[0];W&&(I=W);break}case"initialPlacement":I=d;break}if(s!==I)return{reset:{placement:I}}}return{}}}};function g1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function v1(e){return D9.some(t=>e[t]>=0)}const G9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=lo(e,t);switch(r){case"referenceHidden":{const l=await Dd(t,{...s,elementContext:"reference"}),c=g1(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:v1(c)}}}case"escaped":{const l=await Dd(t,{...s,altBoundary:!0}),c=g1(l,n.floating);return{data:{escapedOffsets:c,escaped:v1(c)}}}default:return{}}}}},Nj=new Set(["left","top"]);async function q9(e,t){const{placement:n,platform:r,elements:s}=e,l=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=co(n),d=Bc(n),h=fs(n)==="y",m=Nj.has(c)?-1:1,g=l&&h?-1:1,v=lo(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:w}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof w=="number"&&(b=d==="end"?w*-1:w),h?{x:b*g,y:x*m}:{x:x*m,y:b*g}}const K9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:l,placement:c,middlewareData:d}=t,h=await q9(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:l+h.y,data:{...h,placement:c}}}}},Z9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:E=>{let{x:R,y:T}=E;return{x:R,y:T}}},...h}=lo(e,t),m={x:n,y:r},g=await Dd(t,h),v=fs(co(s)),x=t0(v);let b=m[x],w=m[v];if(l){const E=x==="y"?"top":"left",R=x==="y"?"bottom":"right",T=b+g[E],_=b-g[R];b=Fx(T,b,_)}if(c){const E=v==="y"?"top":"left",R=v==="y"?"bottom":"right",T=w+g[E],_=w-g[R];w=Fx(T,w,_)}const C=d.fn({...t,[x]:b,[v]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[x]:l,[v]:c}}}}}},Y9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:h=!0,crossAxis:m=!0}=lo(e,t),g={x:n,y:r},v=fs(s),x=t0(v);let b=g[x],w=g[v];const C=lo(d,t),E=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const _=x==="y"?"height":"width",O=l.reference[x]-l.floating[_]+E.mainAxis,A=l.reference[x]+l.reference[_]-E.mainAxis;b<O?b=O:b>A&&(b=A)}if(m){var R,T;const _=x==="y"?"width":"height",O=Nj.has(co(s)),A=l.reference[v]-l.floating[_]+(O&&((R=c.offset)==null?void 0:R[v])||0)+(O?0:E.crossAxis),j=l.reference[v]+l.reference[_]+(O?0:((T=c.offset)==null?void 0:T[v])||0)-(O?E.crossAxis:0);w<A?w=A:w>j&&(w=j)}return{[x]:b,[v]:w}}}},W9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:l,platform:c,elements:d}=t,{apply:h=()=>{},...m}=lo(e,t),g=await Dd(t,m),v=co(s),x=Bc(s),b=fs(s)==="y",{width:w,height:C}=l.floating;let E,R;v==="top"||v==="bottom"?(E=v,R=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(R=v,E=x==="end"?"top":"bottom");const T=C-g.top-g.bottom,_=w-g.left-g.right,O=li(C-g[E],T),A=li(w-g[R],_),j=!t.middlewareData.shift;let D=O,k=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=T),j&&!x){const B=ta(g.left,0),z=ta(g.right,0),J=ta(g.top,0),oe=ta(g.bottom,0);b?k=w-2*(B!==0||z!==0?B+z:ta(g.left,g.right)):D=C-2*(J!==0||oe!==0?J+oe:ta(g.top,g.bottom))}await h({...t,availableWidth:k,availableHeight:D});const V=await c.getDimensions(d.floating);return w!==V.width||C!==V.height?{reset:{rects:!0}}:{}}}};function Np(){return typeof window<"u"}function Gc(e){return Aj(e)?(e.nodeName||"").toLowerCase():"#document"}function na(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _s(e){var t;return(t=(Aj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Aj(e){return Np()?e instanceof Node||e instanceof na(e).Node:!1}function Ka(e){return Np()?e instanceof Element||e instanceof na(e).Element:!1}function Cs(e){return Np()?e instanceof HTMLElement||e instanceof na(e).HTMLElement:!1}function y1(e){return!Np()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof na(e).ShadowRoot}const Q9=new Set(["inline","contents"]);function tf(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Za(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Q9.has(s)}const X9=new Set(["table","td","th"]);function J9(e){return X9.has(Gc(e))}const eP=[":popover-open",":modal"];function Ap(e){return eP.some(t=>{try{return e.matches(t)}catch{return!1}})}const tP=["transform","translate","scale","rotate","perspective"],nP=["transform","translate","scale","rotate","perspective","filter"],rP=["paint","layout","strict","content"];function a0(e){const t=s0(),n=Ka(e)?Za(e):e;return tP.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)||nP.some(r=>(n.willChange||"").includes(r))||rP.some(r=>(n.contain||"").includes(r))}function aP(e){let t=ci(e);for(;Cs(t)&&!Oc(t);){if(a0(t))return t;if(Ap(t))return null;t=ci(t)}return null}function s0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const sP=new Set(["html","body","#document"]);function Oc(e){return sP.has(Gc(e))}function Za(e){return na(e).getComputedStyle(e)}function Dp(e){return Ka(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ci(e){if(Gc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||y1(e)&&e.host||_s(e);return y1(t)?t.host:t}function Dj(e){const t=ci(e);return Oc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cs(t)&&tf(t)?t:Dj(t)}function Od(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Dj(e),l=s===((r=e.ownerDocument)==null?void 0:r.body),c=na(s);if(l){const d=Vx(c);return t.concat(c,c.visualViewport||[],tf(s)?s:[],d&&n?Od(d):[])}return t.concat(s,Od(s,[],n))}function Vx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Oj(e){const t=Za(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Cs(e),l=s?e.offsetWidth:n,c=s?e.offsetHeight:r,d=Am(n)!==l||Am(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function o0(e){return Ka(e)?e:e.contextElement}function _c(e){const t=o0(e);if(!Cs(t))return ys(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:l}=Oj(t);let c=(l?Am(n.width):n.width)/r,d=(l?Am(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const oP=ys(0);function Mj(e){const t=na(e);return!s0()||!t.visualViewport?oP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==na(e)?!1:t}function rl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=o0(e);let c=ys(1);t&&(r?Ka(r)&&(c=_c(r)):c=_c(e));const d=iP(l,n,r)?Mj(l):ys(0);let h=(s.left+d.x)/c.x,m=(s.top+d.y)/c.y,g=s.width/c.x,v=s.height/c.y;if(l){const x=na(l),b=r&&Ka(r)?na(r):r;let w=x,C=Vx(w);for(;C&&r&&b!==w;){const E=_c(C),R=C.getBoundingClientRect(),T=Za(C),_=R.left+(C.clientLeft+parseFloat(T.paddingLeft))*E.x,O=R.top+(C.clientTop+parseFloat(T.paddingTop))*E.y;h*=E.x,m*=E.y,g*=E.x,v*=E.y,h+=_,m+=O,w=na(C),C=Vx(w)}}return Om({width:g,height:v,x:h,y:m})}function Op(e,t){const n=Dp(e).scrollLeft;return t?t.left+n:rl(_s(e)).left+n}function kj(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Op(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function lP(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const l=s==="fixed",c=_s(r),d=t?Ap(t.floating):!1;if(r===c||d&&l)return n;let h={scrollLeft:0,scrollTop:0},m=ys(1);const g=ys(0),v=Cs(r);if((v||!v&&!l)&&((Gc(r)!=="body"||tf(c))&&(h=Dp(r)),Cs(r))){const b=rl(r);m=_c(r),g.x=b.x+r.clientLeft,g.y=b.y+r.clientTop}const x=c&&!v&&!l?kj(c,h):ys(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-h.scrollLeft*m.x+g.x+x.x,y:n.y*m.y-h.scrollTop*m.y+g.y+x.y}}function cP(e){return Array.from(e.getClientRects())}function uP(e){const t=_s(e),n=Dp(e),r=e.ownerDocument.body,s=ta(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=ta(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Op(e);const d=-n.scrollTop;return Za(r).direction==="rtl"&&(c+=ta(t.clientWidth,r.clientWidth)-s),{width:s,height:l,x:c,y:d}}const x1=25;function dP(e,t){const n=na(e),r=_s(e),s=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,h=0;if(s){l=s.width,c=s.height;const g=s0();(!g||g&&t==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}const m=Op(r);if(m<=0){const g=r.ownerDocument,v=g.body,x=getComputedStyle(v),b=g.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(r.clientWidth-v.clientWidth-b);w<=x1&&(l-=w)}else m<=x1&&(l+=m);return{width:l,height:c,x:d,y:h}}const fP=new Set(["absolute","fixed"]);function hP(e,t){const n=rl(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,l=Cs(e)?_c(e):ys(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,h=s*l.x,m=r*l.y;return{width:c,height:d,x:h,y:m}}function b1(e,t,n){let r;if(t==="viewport")r=dP(e,n);else if(t==="document")r=uP(_s(e));else if(Ka(t))r=hP(t,n);else{const s=Mj(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Om(r)}function Ij(e,t){const n=ci(e);return n===t||!Ka(n)||Oc(n)?!1:Za(n).position==="fixed"||Ij(n,t)}function mP(e,t){const n=t.get(e);if(n)return n;let r=Od(e,[],!1).filter(d=>Ka(d)&&Gc(d)!=="body"),s=null;const l=Za(e).position==="fixed";let c=l?ci(e):e;for(;Ka(c)&&!Oc(c);){const d=Za(c),h=a0(c);!h&&d.position==="fixed"&&(s=null),(l?!h&&!s:!h&&d.position==="static"&&!!s&&fP.has(s.position)||tf(c)&&!h&&Ij(e,c))?r=r.filter(g=>g!==c):s=d,c=ci(c)}return t.set(e,r),r}function pP(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?Ap(t)?[]:mP(t,this._c):[].concat(n),r],d=c[0],h=c.reduce((m,g)=>{const v=b1(t,g,s);return m.top=ta(v.top,m.top),m.right=li(v.right,m.right),m.bottom=li(v.bottom,m.bottom),m.left=ta(v.left,m.left),m},b1(t,d,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function gP(e){const{width:t,height:n}=Oj(e);return{width:t,height:n}}function vP(e,t,n){const r=Cs(t),s=_s(t),l=n==="fixed",c=rl(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const h=ys(0);function m(){h.x=Op(s)}if(r||!r&&!l)if((Gc(t)!=="body"||tf(s))&&(d=Dp(t)),r){const b=rl(t,!0,l,t);h.x=b.x+t.clientLeft,h.y=b.y+t.clientTop}else s&&m();l&&!r&&s&&m();const g=s&&!r&&!l?kj(s,d):ys(0),v=c.left+d.scrollLeft-h.x-g.x,x=c.top+d.scrollTop-h.y-g.y;return{x:v,y:x,width:c.width,height:c.height}}function Ky(e){return Za(e).position==="static"}function S1(e,t){if(!Cs(e)||Za(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _s(e)===n&&(n=n.ownerDocument.body),n}function Lj(e,t){const n=na(e);if(Ap(e))return n;if(!Cs(e)){let s=ci(e);for(;s&&!Oc(s);){if(Ka(s)&&!Ky(s))return s;s=ci(s)}return n}let r=S1(e,t);for(;r&&J9(r)&&Ky(r);)r=S1(r,t);return r&&Oc(r)&&Ky(r)&&!a0(r)?n:r||aP(e)||n}const yP=async function(e){const t=this.getOffsetParent||Lj,n=this.getDimensions,r=await n(e.floating);return{reference:vP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xP(e){return Za(e).direction==="rtl"}const bP={convertOffsetParentRelativeRectToViewportRelativeRect:lP,getDocumentElement:_s,getClippingRect:pP,getOffsetParent:Lj,getElementRects:yP,getClientRects:cP,getDimensions:gP,getScale:_c,isElement:Ka,isRTL:xP};function Pj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SP(e,t){let n=null,r;const s=_s(e);function l(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),l();const m=e.getBoundingClientRect(),{left:g,top:v,width:x,height:b}=m;if(d||t(),!x||!b)return;const w=Zh(v),C=Zh(s.clientWidth-(g+x)),E=Zh(s.clientHeight-(v+b)),R=Zh(g),_={rootMargin:-w+"px "+-C+"px "+-E+"px "+-R+"px",threshold:ta(0,li(1,h))||1};let O=!0;function A(j){const D=j[0].intersectionRatio;if(D!==h){if(!O)return c();D?c(!1,D):r=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!Pj(m,e.getBoundingClientRect())&&c(),O=!1}try{n=new IntersectionObserver(A,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return c(!0),l}function CP(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,m=o0(e),g=s||l?[...m?Od(m):[],...Od(t)]:[];g.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),l&&R.addEventListener("resize",n)});const v=m&&d?SP(m,n):null;let x=-1,b=null;c&&(b=new ResizeObserver(R=>{let[T]=R;T&&T.target===m&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var _;(_=b)==null||_.observe(t)})),n()}),m&&!h&&b.observe(m),b.observe(t));let w,C=h?rl(e):null;h&&E();function E(){const R=rl(e);C&&!Pj(C,R)&&n(),C=R,w=requestAnimationFrame(E)}return n(),()=>{var R;g.forEach(T=>{s&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),v==null||v(),(R=b)==null||R.disconnect(),b=null,h&&cancelAnimationFrame(w)}}const wP=K9,EP=Z9,RP=B9,TP=W9,_P=G9,C1=$9,jP=Y9,NP=(e,t,n)=>{const r=new Map,s={platform:bP,...n},l={...s.platform,_c:r};return z9(e,t,{...s,platform:l})};var AP=typeof document<"u",DP=function(){},fm=AP?p.useLayoutEffect:DP;function Mm(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(!Mm(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 l=s[r];if(!(l==="_owner"&&e.$$typeof)&&!Mm(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Uj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function w1(e,t){const n=Uj(e);return Math.round(t*n)/n}function Zy(e){const t=p.useRef(e);return fm(()=>{t.current=e}),t}function OP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:h,open:m}=e,[g,v]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=p.useState(r);Mm(x,r)||b(r);const[w,C]=p.useState(null),[E,R]=p.useState(null),T=p.useCallback(G=>{G!==j.current&&(j.current=G,C(G))},[]),_=p.useCallback(G=>{G!==D.current&&(D.current=G,R(G))},[]),O=l||w,A=c||E,j=p.useRef(null),D=p.useRef(null),k=p.useRef(g),V=h!=null,B=Zy(h),z=Zy(s),J=Zy(m),oe=p.useCallback(()=>{if(!j.current||!D.current)return;const G={placement:t,strategy:n,middleware:x};z.current&&(G.platform=z.current),NP(j.current,D.current,G).then(ie=>{const L={...ie,isPositioned:J.current!==!1};K.current&&!Mm(k.current,L)&&(k.current=L,Ba.flushSync(()=>{v(L)}))})},[x,t,n,z,J]);fm(()=>{m===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,v(G=>({...G,isPositioned:!1})))},[m]);const K=p.useRef(!1);fm(()=>(K.current=!0,()=>{K.current=!1}),[]),fm(()=>{if(O&&(j.current=O),A&&(D.current=A),O&&A){if(B.current)return B.current(O,A,oe);oe()}},[O,A,oe,B,V]);const Y=p.useMemo(()=>({reference:j,floating:D,setReference:T,setFloating:_}),[T,_]),I=p.useMemo(()=>({reference:O,floating:A}),[O,A]),W=p.useMemo(()=>{const G={position:n,left:0,top:0};if(!I.floating)return G;const ie=w1(I.floating,g.x),L=w1(I.floating,g.y);return d?{...G,transform:"translate("+ie+"px, "+L+"px)",...Uj(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:L}},[n,d,I.floating,g.x,g.y]);return p.useMemo(()=>({...g,update:oe,refs:Y,elements:I,floatingStyles:W}),[g,oe,Y,I,W])}const MP=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?C1({element:r.current,padding:s}).fn(n):{}:r?C1({element:r,padding:s}).fn(n):{}}}},kP=(e,t)=>({...wP(e),options:[e,t]}),IP=(e,t)=>({...EP(e),options:[e,t]}),LP=(e,t)=>({...jP(e),options:[e,t]}),PP=(e,t)=>({...RP(e),options:[e,t]}),UP=(e,t)=>({...TP(e),options:[e,t]}),FP=(e,t)=>({..._P(e),options:[e,t]}),HP=(e,t)=>({...MP(e),options:[e,t]});var VP="Arrow",Fj=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...l}=e;return o.jsx(Ze.svg,{...l,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});Fj.displayName=VP;var zP=Fj;function i0(e){const[t,n]=p.useState(void 0);return lr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,d;if("borderBoxSize"in l){const h=l.borderBoxSize,m=Array.isArray(h)?h[0]:h;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var l0="Popper",[Hj,js]=jr(l0),[$P,Vj]=Hj(l0),zj=e=>{const{__scopePopper:t,children:n}=e,[r,s]=p.useState(null);return o.jsx($P,{scope:t,anchor:r,onAnchorChange:s,children:n})};zj.displayName=l0;var $j="PopperAnchor",Bj=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,l=Vj($j,n),c=p.useRef(null),d=gt(t,c),h=p.useRef(null);return p.useEffect(()=>{const m=h.current;h.current=(r==null?void 0:r.current)||c.current,m!==h.current&&l.onAnchorChange(h.current)}),r?null:o.jsx(Ze.div,{...s,ref:d})});Bj.displayName=$j;var c0="PopperContent",[BP,GP]=Hj(c0),Gj=p.forwardRef((e,t)=>{var fe,Ee,De,be,Je,Xe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:x=!1,updatePositionStrategy:b="optimized",onPlaced:w,...C}=e,E=Vj(c0,n),[R,T]=p.useState(null),_=gt(t,Ht=>T(Ht)),[O,A]=p.useState(null),j=i0(O),D=(j==null?void 0:j.width)??0,k=(j==null?void 0:j.height)??0,V=r+(l!=="center"?"-"+l:""),B=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},z=Array.isArray(m)?m:[m],J=z.length>0,oe={padding:B,boundary:z.filter(KP),altBoundary:J},{refs:K,floatingStyles:Y,placement:I,isPositioned:W,middlewareData:G}=OP({strategy:"fixed",placement:V,whileElementsMounted:(...Ht)=>CP(...Ht,{animationFrame:b==="always"}),elements:{reference:E.anchor},middleware:[kP({mainAxis:s+k,alignmentAxis:c}),h&&IP({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?LP():void 0,...oe}),h&&PP({...oe}),UP({...oe,apply:({elements:Ht,rects:Ne,availableWidth:vt,availableHeight:ut})=>{const{width:Tt,height:Ia}=Ne.reference,ur=Ht.floating.style;ur.setProperty("--radix-popper-available-width",`${vt}px`),ur.setProperty("--radix-popper-available-height",`${ut}px`),ur.setProperty("--radix-popper-anchor-width",`${Tt}px`),ur.setProperty("--radix-popper-anchor-height",`${Ia}px`)}}),O&&HP({element:O,padding:d}),ZP({arrowWidth:D,arrowHeight:k}),x&&FP({strategy:"referenceHidden",...oe})]}),[ie,L]=Zj(I),Z=Ss(w);lr(()=>{W&&(Z==null||Z())},[W,Z]);const U=(fe=G.arrow)==null?void 0:fe.x,q=(Ee=G.arrow)==null?void 0:Ee.y,le=((De=G.arrow)==null?void 0:De.centerOffset)!==0,[me,ve]=p.useState();return lr(()=>{R&&ve(window.getComputedStyle(R).zIndex)},[R]),o.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:W?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(be=G.transformOrigin)==null?void 0:be.x,(Je=G.transformOrigin)==null?void 0:Je.y].join(" "),...((Xe=G.hide)==null?void 0:Xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(BP,{scope:n,placedSide:ie,onArrowChange:A,arrowX:U,arrowY:q,shouldHideArrow:le,children:o.jsx(Ze.div,{"data-side":ie,"data-align":L,...C,ref:_,style:{...C.style,animation:W?void 0:"none"}})})})});Gj.displayName=c0;var qj="PopperArrow",qP={top:"bottom",right:"left",bottom:"top",left:"right"},Kj=p.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,l=GP(qj,r),c=qP[l.placedSide];return o.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:o.jsx(zP,{...s,ref:n,style:{...s.style,display:"block"}})})});Kj.displayName=qj;function KP(e){return e!==null}var ZP=e=>({name:"transformOrigin",options:e,fn(t){var E,R,T;const{placement:n,rects:r,middlewareData:s}=t,c=((E=s.arrow)==null?void 0:E.centerOffset)!==0,d=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[m,g]=Zj(n),v={start:"0%",center:"50%",end:"100%"}[g],x=(((R=s.arrow)==null?void 0:R.x)??0)+d/2,b=(((T=s.arrow)==null?void 0:T.y)??0)+h/2;let w="",C="";return m==="bottom"?(w=c?v:`${x}px`,C=`${-h}px`):m==="top"?(w=c?v:`${x}px`,C=`${r.floating.height+h}px`):m==="right"?(w=`${-h}px`,C=c?v:`${b}px`):m==="left"&&(w=`${r.floating.width+h}px`,C=c?v:`${b}px`),{data:{x:w,y:C}}}});function Zj(e){const[t,n="center"]=e.split("-");return[t,n]}var nf=zj,qc=Bj,rf=Gj,af=Kj,Yj=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"}),YP="VisuallyHidden",Wj=p.forwardRef((e,t)=>o.jsx(Ze.span,{...e,ref:t,style:{...Yj,...e.style}}));Wj.displayName=YP;var WP=Wj,[Mp,Bte]=jr("Tooltip",[js]),kp=js(),Qj="TooltipProvider",QP=700,zx="tooltip.open",[XP,u0]=Mp(Qj),Xj=e=>{const{__scopeTooltip:t,delayDuration:n=QP,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:l}=e,c=p.useRef(!0),d=p.useRef(!1),h=p.useRef(0);return p.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),o.jsx(XP,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(h.current),c.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:p.useCallback(m=>{d.current=m},[]),disableHoverableContent:s,children:l})};Xj.displayName=Qj;var Md="Tooltip",[JP,sf]=Mp(Md),Jj=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,h=u0(Md,e.__scopeTooltip),m=kp(t),[g,v]=p.useState(null),x=Kn(),b=p.useRef(0),w=c??h.disableHoverableContent,C=d??h.delayDuration,E=p.useRef(!1),[R,T]=ra({prop:r,defaultProp:s??!1,onChange:D=>{D?(h.onOpen(),document.dispatchEvent(new CustomEvent(zx))):h.onClose(),l==null||l(D)},caller:Md}),_=p.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),O=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E.current=!1,T(!0)},[T]),A=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),j=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{E.current=!0,T(!0),b.current=0},C)},[C,T]);return p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),o.jsx(nf,{...m,children:o.jsx(JP,{scope:t,contentId:x,open:R,stateAttribute:_,trigger:g,onTriggerChange:v,onTriggerEnter:p.useCallback(()=>{h.isOpenDelayedRef.current?j():O()},[h.isOpenDelayedRef,j,O]),onTriggerLeave:p.useCallback(()=>{w?A():(window.clearTimeout(b.current),b.current=0)},[A,w]),onOpen:O,onClose:A,disableHoverableContent:w,children:n})})};Jj.displayName=Md;var $x="TooltipTrigger",e2=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=sf($x,n),l=u0($x,n),c=kp(n),d=p.useRef(null),h=gt(t,d,s.onTriggerChange),m=p.useRef(!1),g=p.useRef(!1),v=p.useCallback(()=>m.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),o.jsx(qc,{asChild:!0,...c,children:o.jsx(Ze.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:Te(e.onPointerMove,x=>{x.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Te(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Te(e.onBlur,s.onClose),onClick:Te(e.onClick,s.onClose)})})});e2.displayName=$x;var d0="TooltipPortal",[eU,tU]=Mp(d0,{forceMount:void 0}),t2=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,l=sf(d0,t);return o.jsx(eU,{scope:t,forceMount:n,children:o.jsx(yr,{present:n||l.open,children:o.jsx(gl,{asChild:!0,container:s,children:r})})})};t2.displayName=d0;var Mc="TooltipContent",n2=p.forwardRef((e,t)=>{const n=tU(Mc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...l}=e,c=sf(Mc,e.__scopeTooltip);return o.jsx(yr,{present:r||c.open,children:c.disableHoverableContent?o.jsx(r2,{side:s,...l,ref:t}):o.jsx(nU,{side:s,...l,ref:t})})}),nU=p.forwardRef((e,t)=>{const n=sf(Mc,e.__scopeTooltip),r=u0(Mc,e.__scopeTooltip),s=p.useRef(null),l=gt(t,s),[c,d]=p.useState(null),{trigger:h,onClose:m}=n,g=s.current,{onPointerInTransitChange:v}=r,x=p.useCallback(()=>{d(null),v(!1)},[v]),b=p.useCallback((w,C)=>{const E=w.currentTarget,R={x:w.clientX,y:w.clientY},T=oU(R,E.getBoundingClientRect()),_=iU(R,T),O=lU(C.getBoundingClientRect()),A=uU([..._,...O]);d(A),v(!0)},[v]);return p.useEffect(()=>()=>x(),[x]),p.useEffect(()=>{if(h&&g){const w=E=>b(E,g),C=E=>b(E,h);return h.addEventListener("pointerleave",w),g.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",C)}}},[h,g,b,x]),p.useEffect(()=>{if(c){const w=C=>{const E=C.target,R={x:C.clientX,y:C.clientY},T=(h==null?void 0:h.contains(E))||(g==null?void 0:g.contains(E)),_=!cU(R,c);T?x():_&&(x(),m())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[h,g,c,m,x]),o.jsx(r2,{...e,ref:l})}),[rU,aU]=Mp(Md,{isInside:!1}),sU=D_("TooltipContent"),r2=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,h=sf(Mc,n),m=kp(n),{onClose:g}=h;return p.useEffect(()=>(document.addEventListener(zx,g),()=>document.removeEventListener(zx,g)),[g]),p.useEffect(()=>{if(h.trigger){const v=x=>{const b=x.target;b!=null&&b.contains(h.trigger)&&g()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[h.trigger,g]),o.jsx(pl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:g,children:o.jsxs(rf,{"data-state":h.stateAttribute,...m,...d,ref:t,style:{...d.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:[o.jsx(sU,{children:r}),o.jsx(rU,{scope:n,isInside:!0,children:o.jsx(WP,{id:h.contentId,role:"tooltip",children:s||r})})]})})});n2.displayName=Mc;var a2="TooltipArrow",s2=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=kp(n);return aU(a2,n).isInside?null:o.jsx(af,{...s,...r,ref:t})});s2.displayName=a2;function oU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,s,l)){case l:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function iU(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 lU(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 cU(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],h=t[c],m=d.x,g=d.y,v=h.x,x=h.y;g>r!=x>r&&n<(v-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function uU(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),dU(t)}function dU(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 l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.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 l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.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 fU=Xj,hU=Jj,mU=e2,pU=t2,gU=n2,vU=s2;function hs({delayDuration:e=0,...t}){return o.jsx(fU,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Dt({...e}){return o.jsx(hs,{children:o.jsx(hU,{"data-slot":"tooltip",...e})})}function Ot({...e}){return o.jsx(mU,{"data-slot":"tooltip-trigger",...e})}function Mt({className:e,sideOffset:t=0,children:n,...r}){return o.jsx(pU,{children:o.jsxs(gU,{"data-slot":"tooltip-content",sideOffset:t,className:de("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,o.jsx(vU,{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 yU="sidebar_state",xU=3600*24*7,bU="16rem",SU="18rem",CU="3rem",wU="b",o2=p.createContext(null);function of(){const e=p.useContext(o2);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function EU({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:l,...c}){const d=S6(),[h,m]=p.useState(!1),[g,v]=p.useState(e),x=t??g,b=p.useCallback(R=>{const T=typeof R=="function"?R(x):R;n?n(T):v(T),document.cookie=`${yU}=${T}; path=/; max-age=${xU}`},[n,x]),w=p.useCallback(()=>d?m(R=>!R):b(R=>!R),[d,b,m]);p.useEffect(()=>{const R=T=>{T.key===wU&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);const C=x?"expanded":"collapsed",E=p.useMemo(()=>({state:C,open:x,setOpen:b,isMobile:d,openMobile:h,setOpenMobile:m,toggleSidebar:w}),[C,x,b,d,h,m,w]);return o.jsx(o2.Provider,{value:E,children:o.jsx(hs,{delayDuration:0,children:o.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":bU,"--sidebar-width-icon":CU,...s},className:de("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:l})})})}function RU({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...l}){const{isMobile:c,state:d,openMobile:h,setOpenMobile:m}=of();return n==="none"?o.jsx("div",{"data-slot":"sidebar",className:de("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:s}):c?o.jsx(yi,{open:h,onOpenChange:m,...l,children:o.jsxs(xi,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":SU},side:e,children:[o.jsxs(bi,{className:"sr-only",children:[o.jsx(vl,{children:"Sidebar"}),o.jsx($c,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):o.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[o.jsx("div",{"data-slot":"sidebar-gap",className:de("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)")}),o.jsx("div",{"data-slot":"sidebar-container",className:de("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),...l,children:o.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 TU({className:e,onClick:t,...n}){const{toggleSidebar:r}=of();return o.jsxs(we,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:de("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[o.jsx(X5,{}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function _U({className:e,...t}){const{toggleSidebar:n}=of();return o.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:de("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 jU({className:e,...t}){return o.jsx("main",{"data-slot":"sidebar-inset",className:de("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 NU({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:de("flex flex-col gap-2 p-2",e),...t})}function AU({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:de("flex flex-col gap-2 p-2",e),...t})}function DU({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:de("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function E1({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:de("relative flex w-full min-w-0 flex-col p-2",e),...t})}function R1({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:de("w-full text-sm",e),...t})}function OU({className:e,...t}){return o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:de("flex w-full min-w-0 flex-col gap-1",e),...t})}function MU({className:e,...t}){return o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:de("group/menu-item relative",e),...t})}const kU=Wd("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 IU({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:l,...c}){const d=e?gp:"button",{isMobile:h,state:m}=of(),g=o.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:de(kU({variant:n,size:r}),l),...c});return s?(typeof s=="string"&&(s={children:s}),o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:g}),o.jsx(Mt,{side:"right",align:"center",hidden:m!=="collapsed"||h,...s})]})):g}function Ip(e){const t=e+"CollectionProvider",[n,r]=jr(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:E,children:R}=C,T=je.useRef(null),_=je.useRef(new Map).current;return o.jsx(s,{scope:E,itemMap:_,collectionRef:T,children:R})};c.displayName=t;const d=e+"CollectionSlot",h=ii(d),m=je.forwardRef((C,E)=>{const{scope:R,children:T}=C,_=l(d,R),O=gt(E,_.collectionRef);return o.jsx(h,{ref:O,children:T})});m.displayName=d;const g=e+"CollectionItemSlot",v="data-radix-collection-item",x=ii(g),b=je.forwardRef((C,E)=>{const{scope:R,children:T,..._}=C,O=je.useRef(null),A=gt(E,O),j=l(g,R);return je.useEffect(()=>(j.itemMap.set(O,{ref:O,..._}),()=>void j.itemMap.delete(O))),o.jsx(x,{[v]:"",ref:A,children:T})});b.displayName=g;function w(C){const E=l(e+"CollectionConsumer",C);return je.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const _=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((j,D)=>_.indexOf(j.ref.current)-_.indexOf(D.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:b},w,r]}var LU=p.createContext(void 0);function Lp(e){const t=p.useContext(LU);return e||t||"ltr"}var Yy="rovingFocusGroup.onEntryFocus",PU={bubbles:!1,cancelable:!0},lf="RovingFocusGroup",[Bx,i2,UU]=Ip(lf),[FU,l2]=jr(lf,[UU]),[HU,VU]=FU(lf),c2=p.forwardRef((e,t)=>o.jsx(Bx.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Bx.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(zU,{...e,ref:t})})}));c2.displayName=lf;var zU=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...v}=e,x=p.useRef(null),b=gt(t,x),w=Lp(l),[C,E]=ra({prop:c,defaultProp:d??null,onChange:h,caller:lf}),[R,T]=p.useState(!1),_=Ss(m),O=i2(n),A=p.useRef(!1),[j,D]=p.useState(0);return p.useEffect(()=>{const k=x.current;if(k)return k.addEventListener(Yy,_),()=>k.removeEventListener(Yy,_)},[_]),o.jsx(HU,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:C,onItemFocus:p.useCallback(k=>E(k),[E]),onItemShiftTab:p.useCallback(()=>T(!0),[]),onFocusableItemAdd:p.useCallback(()=>D(k=>k+1),[]),onFocusableItemRemove:p.useCallback(()=>D(k=>k-1),[]),children:o.jsx(Ze.div,{tabIndex:R||j===0?-1:0,"data-orientation":r,...v,ref:b,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{A.current=!0}),onFocus:Te(e.onFocus,k=>{const V=!A.current;if(k.target===k.currentTarget&&V&&!R){const B=new CustomEvent(Yy,PU);if(k.currentTarget.dispatchEvent(B),!B.defaultPrevented){const z=O().filter(I=>I.focusable),J=z.find(I=>I.active),oe=z.find(I=>I.id===C),Y=[J,oe,...z].filter(Boolean).map(I=>I.ref.current);f2(Y,g)}}A.current=!1}),onBlur:Te(e.onBlur,()=>T(!1))})})}),u2="RovingFocusGroupItem",d2=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:l,children:c,...d}=e,h=Kn(),m=l||h,g=VU(u2,n),v=g.currentTabStopId===m,x=i2(n),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:C}=g;return p.useEffect(()=>{if(r)return b(),()=>w()},[r,b,w]),o.jsx(Bx.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:o.jsx(Ze.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:Te(e.onMouseDown,E=>{r?g.onItemFocus(m):E.preventDefault()}),onFocus:Te(e.onFocus,()=>g.onItemFocus(m)),onKeyDown:Te(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){g.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const R=GU(E,g.orientation,g.dir);if(R!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let _=x().filter(O=>O.focusable).map(O=>O.ref.current);if(R==="last")_.reverse();else if(R==="prev"||R==="next"){R==="prev"&&_.reverse();const O=_.indexOf(E.currentTarget);_=g.loop?qU(_,O+1):_.slice(O+1)}setTimeout(()=>f2(_))}}),children:typeof c=="function"?c({isCurrentTabStop:v,hasTabStop:C!=null}):c})})});d2.displayName=u2;var $U={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function BU(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function GU(e,t,n){const r=BU(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $U[r]}function f2(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var KU=c2,ZU=d2,Gx=["Enter"," "],YU=["ArrowDown","PageUp","Home"],h2=["ArrowUp","PageDown","End"],WU=[...YU,...h2],QU={ltr:[...Gx,"ArrowRight"],rtl:[...Gx,"ArrowLeft"]},XU={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cf="Menu",[kd,JU,eF]=Ip(cf),[yl,m2]=jr(cf,[eF,js,l2]),Pp=js(),p2=l2(),[tF,xl]=yl(cf),[nF,uf]=yl(cf),g2=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:l,modal:c=!0}=e,d=Pp(t),[h,m]=p.useState(null),g=p.useRef(!1),v=Ss(l),x=Lp(s);return p.useEffect(()=>{const b=()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>g.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),o.jsx(nf,{...d,children:o.jsx(tF,{scope:t,open:n,onOpenChange:v,content:h,onContentChange:m,children:o.jsx(nF,{scope:t,onClose:p.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:g,dir:x,modal:c,children:r})})})};g2.displayName=cf;var rF="MenuAnchor",f0=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Pp(n);return o.jsx(qc,{...s,...r,ref:t})});f0.displayName=rF;var h0="MenuPortal",[aF,v2]=yl(h0,{forceMount:void 0}),y2=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,l=xl(h0,t);return o.jsx(aF,{scope:t,forceMount:n,children:o.jsx(yr,{present:n||l.open,children:o.jsx(gl,{asChild:!0,container:s,children:r})})})};y2.displayName=h0;var ja="MenuContent",[sF,m0]=yl(ja),x2=p.forwardRef((e,t)=>{const n=v2(ja,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=xl(ja,e.__scopeMenu),c=uf(ja,e.__scopeMenu);return o.jsx(kd.Provider,{scope:e.__scopeMenu,children:o.jsx(yr,{present:r||l.open,children:o.jsx(kd.Slot,{scope:e.__scopeMenu,children:c.modal?o.jsx(oF,{...s,ref:t}):o.jsx(iF,{...s,ref:t})})})})}),oF=p.forwardRef((e,t)=>{const n=xl(ja,e.__scopeMenu),r=p.useRef(null),s=gt(t,r);return p.useEffect(()=>{const l=r.current;if(l)return Cp(l)},[]),o.jsx(p0,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),iF=p.forwardRef((e,t)=>{const n=xl(ja,e.__scopeMenu);return o.jsx(p0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),lF=ii("MenuContent.ScrollLock"),p0=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:h,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:x,onDismiss:b,disableOutsideScroll:w,...C}=e,E=xl(ja,n),R=uf(ja,n),T=Pp(n),_=p2(n),O=JU(n),[A,j]=p.useState(null),D=p.useRef(null),k=gt(t,D,E.onContentChange),V=p.useRef(0),B=p.useRef(""),z=p.useRef(0),J=p.useRef(null),oe=p.useRef("right"),K=p.useRef(0),Y=w?ef:p.Fragment,I=w?{as:lF,allowPinchZoom:!0}:void 0,W=ie=>{var fe,Ee;const L=B.current+ie,Z=O().filter(De=>!De.disabled),U=document.activeElement,q=(fe=Z.find(De=>De.ref.current===U))==null?void 0:fe.textValue,le=Z.map(De=>De.textValue),me=bF(le,L,q),ve=(Ee=Z.find(De=>De.textValue===me))==null?void 0:Ee.ref.current;(function De(be){B.current=be,window.clearTimeout(V.current),be!==""&&(V.current=window.setTimeout(()=>De(""),1e3))})(L),ve&&setTimeout(()=>ve.focus())};p.useEffect(()=>()=>window.clearTimeout(V.current),[]),bp();const G=p.useCallback(ie=>{var Z,U;return oe.current===((Z=J.current)==null?void 0:Z.side)&&CF(ie,(U=J.current)==null?void 0:U.area)},[]);return o.jsx(sF,{scope:n,searchRef:B,onItemEnter:p.useCallback(ie=>{G(ie)&&ie.preventDefault()},[G]),onItemLeave:p.useCallback(ie=>{var L;G(ie)||((L=D.current)==null||L.focus(),j(null))},[G]),onTriggerLeave:p.useCallback(ie=>{G(ie)&&ie.preventDefault()},[G]),pointerGraceTimerRef:z,onPointerGraceIntentChange:p.useCallback(ie=>{J.current=ie},[]),children:o.jsx(Y,{...I,children:o.jsx(Jd,{asChild:!0,trapped:s,onMountAutoFocus:Te(l,ie=>{var L;ie.preventDefault(),(L=D.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:o.jsx(pl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:x,onDismiss:b,children:o.jsx(KU,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:j,onEntryFocus:Te(h,ie=>{R.isUsingKeyboardRef.current||ie.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(rf,{role:"menu","aria-orientation":"vertical","data-state":I2(E.open),"data-radix-menu-content":"",dir:R.dir,...T,...C,ref:k,style:{outline:"none",...C.style},onKeyDown:Te(C.onKeyDown,ie=>{const Z=ie.target.closest("[data-radix-menu-content]")===ie.currentTarget,U=ie.ctrlKey||ie.altKey||ie.metaKey,q=ie.key.length===1;Z&&(ie.key==="Tab"&&ie.preventDefault(),!U&&q&&W(ie.key));const le=D.current;if(ie.target!==le||!WU.includes(ie.key))return;ie.preventDefault();const ve=O().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);h2.includes(ie.key)&&ve.reverse(),yF(ve)}),onBlur:Te(e.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(V.current),B.current="")}),onPointerMove:Te(e.onPointerMove,Id(ie=>{const L=ie.target,Z=K.current!==ie.clientX;if(ie.currentTarget.contains(L)&&Z){const U=ie.clientX>K.current?"right":"left";oe.current=U,K.current=ie.clientX}}))})})})})})})});x2.displayName=ja;var cF="MenuGroup",g0=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ze.div,{role:"group",...r,ref:t})});g0.displayName=cF;var uF="MenuLabel",b2=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ze.div,{...r,ref:t})});b2.displayName=uF;var km="MenuItem",T1="menu.itemSelect",Up=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,l=p.useRef(null),c=uf(km,e.__scopeMenu),d=m0(km,e.__scopeMenu),h=gt(t,l),m=p.useRef(!1),g=()=>{const v=l.current;if(!n&&v){const x=new CustomEvent(T1,{bubbles:!0,cancelable:!0});v.addEventListener(T1,b=>r==null?void 0:r(b),{once:!0}),Q_(v,x),x.defaultPrevented?m.current=!1:c.onClose()}};return o.jsx(S2,{...s,ref:h,disabled:n,onClick:Te(e.onClick,g),onPointerDown:v=>{var x;(x=e.onPointerDown)==null||x.call(e,v),m.current=!0},onPointerUp:Te(e.onPointerUp,v=>{var x;m.current||(x=v.currentTarget)==null||x.click()}),onKeyDown:Te(e.onKeyDown,v=>{const x=d.searchRef.current!=="";n||x&&v.key===" "||Gx.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Up.displayName=km;var S2=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...l}=e,c=m0(km,n),d=p2(n),h=p.useRef(null),m=gt(t,h),[g,v]=p.useState(!1),[x,b]=p.useState("");return p.useEffect(()=>{const w=h.current;w&&b((w.textContent??"").trim())},[l.children]),o.jsx(kd.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:o.jsx(ZU,{asChild:!0,...d,focusable:!r,children:o.jsx(Ze.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:m,onPointerMove:Te(e.onPointerMove,Id(w=>{r?c.onItemLeave(w):(c.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,Id(w=>c.onItemLeave(w))),onFocus:Te(e.onFocus,()=>v(!0)),onBlur:Te(e.onBlur,()=>v(!1))})})})}),dF="MenuCheckboxItem",C2=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return o.jsx(_2,{scope:e.__scopeMenu,checked:n,children:o.jsx(Up,{role:"menuitemcheckbox","aria-checked":Im(n)?"mixed":n,...s,ref:t,"data-state":y0(n),onSelect:Te(s.onSelect,()=>r==null?void 0:r(Im(n)?!0:!n),{checkForDefaultPrevented:!1})})})});C2.displayName=dF;var w2="MenuRadioGroup",[fF,hF]=yl(w2,{value:void 0,onValueChange:()=>{}}),E2=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,l=Ss(r);return o.jsx(fF,{scope:e.__scopeMenu,value:n,onValueChange:l,children:o.jsx(g0,{...s,ref:t})})});E2.displayName=w2;var R2="MenuRadioItem",T2=p.forwardRef((e,t)=>{const{value:n,...r}=e,s=hF(R2,e.__scopeMenu),l=n===s.value;return o.jsx(_2,{scope:e.__scopeMenu,checked:l,children:o.jsx(Up,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":y0(l),onSelect:Te(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});T2.displayName=R2;var v0="MenuItemIndicator",[_2,mF]=yl(v0,{checked:!1}),j2=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,l=mF(v0,n);return o.jsx(yr,{present:r||Im(l.checked)||l.checked===!0,children:o.jsx(Ze.span,{...s,ref:t,"data-state":y0(l.checked)})})});j2.displayName=v0;var pF="MenuSeparator",N2=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});N2.displayName=pF;var gF="MenuArrow",A2=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Pp(n);return o.jsx(af,{...s,...r,ref:t})});A2.displayName=gF;var vF="MenuSub",[Gte,D2]=yl(vF),gd="MenuSubTrigger",O2=p.forwardRef((e,t)=>{const n=xl(gd,e.__scopeMenu),r=uf(gd,e.__scopeMenu),s=D2(gd,e.__scopeMenu),l=m0(gd,e.__scopeMenu),c=p.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:h}=l,m={__scopeMenu:e.__scopeMenu},g=p.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return p.useEffect(()=>g,[g]),p.useEffect(()=>{const v=d.current;return()=>{window.clearTimeout(v),h(null)}},[d,h]),o.jsx(f0,{asChild:!0,...m,children:o.jsx(S2,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":I2(n.open),...e,ref:io(t,s.onTriggerChange),onClick:v=>{var x;(x=e.onClick)==null||x.call(e,v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,Id(v=>{l.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:Te(e.onPointerLeave,Id(v=>{var b,w;g();const x=(b=n.content)==null?void 0:b.getBoundingClientRect();if(x){const C=(w=n.content)==null?void 0:w.dataset.side,E=C==="right",R=E?-5:5,T=x[E?"left":"right"],_=x[E?"right":"left"];l.onPointerGraceIntentChange({area:[{x:v.clientX+R,y:v.clientY},{x:T,y:x.top},{x:_,y:x.top},{x:_,y:x.bottom},{x:T,y:x.bottom}],side:C}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(v),v.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,v=>{var b;const x=l.searchRef.current!=="";e.disabled||x&&v.key===" "||QU[r.dir].includes(v.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),v.preventDefault())})})})});O2.displayName=gd;var M2="MenuSubContent",k2=p.forwardRef((e,t)=>{const n=v2(ja,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=xl(ja,e.__scopeMenu),c=uf(ja,e.__scopeMenu),d=D2(M2,e.__scopeMenu),h=p.useRef(null),m=gt(t,h);return o.jsx(kd.Provider,{scope:e.__scopeMenu,children:o.jsx(yr,{present:r||l.open,children:o.jsx(kd.Slot,{scope:e.__scopeMenu,children:o.jsx(p0,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:m,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var v;c.isUsingKeyboardRef.current&&((v=h.current)==null||v.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Te(e.onFocusOutside,g=>{g.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,g=>{c.onClose(),g.preventDefault()}),onKeyDown:Te(e.onKeyDown,g=>{var b;const v=g.currentTarget.contains(g.target),x=XU[c.dir].includes(g.key);v&&x&&(l.onOpenChange(!1),(b=d.trigger)==null||b.focus(),g.preventDefault())})})})})})});k2.displayName=M2;function I2(e){return e?"open":"closed"}function Im(e){return e==="indeterminate"}function y0(e){return Im(e)?"indeterminate":e?"checked":"unchecked"}function yF(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function bF(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=xF(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const h=c.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function SF(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],h=t[c],m=d.x,g=d.y,v=h.x,x=h.y;g>r!=x>r&&n<(v-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function CF(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return SF(n,t)}function Id(e){return t=>t.pointerType==="mouse"?e(t):void 0}var wF=g2,EF=f0,RF=y2,TF=x2,_F=g0,jF=b2,NF=Up,AF=C2,DF=E2,OF=T2,MF=j2,kF=N2,IF=A2,LF=O2,PF=k2,Fp="DropdownMenu",[UF,qte]=jr(Fp,[m2]),Nr=m2(),[FF,L2]=UF(Fp),P2=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,h=Nr(t),m=p.useRef(null),[g,v]=ra({prop:s,defaultProp:l??!1,onChange:c,caller:Fp});return o.jsx(FF,{scope:t,triggerId:Kn(),triggerRef:m,contentId:Kn(),open:g,onOpenChange:v,onOpenToggle:p.useCallback(()=>v(x=>!x),[v]),modal:d,children:o.jsx(wF,{...h,open:g,onOpenChange:v,dir:r,modal:d,children:n})})};P2.displayName=Fp;var U2="DropdownMenuTrigger",F2=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,l=L2(U2,n),c=Nr(n);return o.jsx(EF,{asChild:!0,...c,children:o.jsx(Ze.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:io(t,l.triggerRef),onPointerDown:Te(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(l.onOpenToggle(),l.open||d.preventDefault())}),onKeyDown:Te(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&l.onOpenToggle(),d.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});F2.displayName=U2;var HF="DropdownMenuPortal",H2=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return o.jsx(RF,{...r,...n})};H2.displayName=HF;var V2="DropdownMenuContent",z2=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=L2(V2,n),l=Nr(n),c=p.useRef(!1);return o.jsx(TF,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,d=>{var h;c.current||(h=s.triggerRef.current)==null||h.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,d=>{const h=d.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0,g=h.button===2||m;(!s.modal||g)&&(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)"}})});z2.displayName=V2;var VF="DropdownMenuGroup",zF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(_F,{...s,...r,ref:t})});zF.displayName=VF;var $F="DropdownMenuLabel",BF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(jF,{...s,...r,ref:t})});BF.displayName=$F;var GF="DropdownMenuItem",$2=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(NF,{...s,...r,ref:t})});$2.displayName=GF;var qF="DropdownMenuCheckboxItem",KF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(AF,{...s,...r,ref:t})});KF.displayName=qF;var ZF="DropdownMenuRadioGroup",YF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(DF,{...s,...r,ref:t})});YF.displayName=ZF;var WF="DropdownMenuRadioItem",QF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(OF,{...s,...r,ref:t})});QF.displayName=WF;var XF="DropdownMenuItemIndicator",JF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(MF,{...s,...r,ref:t})});JF.displayName=XF;var e7="DropdownMenuSeparator",B2=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(kF,{...s,...r,ref:t})});B2.displayName=e7;var t7="DropdownMenuArrow",n7=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(IF,{...s,...r,ref:t})});n7.displayName=t7;var r7="DropdownMenuSubTrigger",a7=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(LF,{...s,...r,ref:t})});a7.displayName=r7;var s7="DropdownMenuSubContent",o7=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(PF,{...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)"}})});o7.displayName=s7;var i7=P2,l7=F2,c7=H2,G2=z2,q2=$2,K2=B2;const xr=i7,br=l7,cr=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx(c7,{children:o.jsx(G2,{ref:r,sideOffset:t,className:de("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),...n})}));cr.displayName=G2.displayName;const Ft=p.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(q2,{ref:r,className:de("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Ft.displayName=q2.displayName;const Aa=p.forwardRef(({className:e,...t},n)=>o.jsx(K2,{ref:n,className:de("bg-muted -mx-1 my-1 h-px",e),...t}));Aa.displayName=K2.displayName;const u7="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",d7=({width:e=45,height:t=36,className:n=""})=>o.jsx("img",{src:u7,alt:"OWOX Logo",width:e,height:t,className:n}),f7=({className:e,size:t=24})=>o.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:o.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"})}),h7=({className:e,size:t=24})=>o.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:[o.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"}),o.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"}),o.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"}),o.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"}),o.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"}),o.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"}),o.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"})]}),m7=({className:e,size:t=24})=>o.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:[o.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),o.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),o.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),o.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),o.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),o.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),o.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),o.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),o.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),o.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),o.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),o.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),o.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),o.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),o.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"})]}),Z2=({className:e,size:t=24})=>o.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:[o.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"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),p7=({className:e,size:t=24})=>o.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:[o.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"}),o.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"}),o.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"}),o.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"})]}),g7=({className:e,size:t=24})=>o.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:[o.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"}),o.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),o.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),o.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),o.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),o.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),o.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),o.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),o.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),o.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),o.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"})]}),v7=({className:e,size:t=24})=>o.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:[o.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"}),o.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"}),o.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"}),o.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"}),o.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"}),o.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"}),o.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"})]}),y7=({className:e,size:t=24})=>o.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:o.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"})}),x7=({className:e,size:t=24})=>o.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:[o.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),o.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),o.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),o.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),o.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),o.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),o.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),b7=({className:e,size:t=24})=>o.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:[o.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"}),o.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)"}),o.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"}),o.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)"}),o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),o.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),o.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{"stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),df=({className:e,size:t=24,base64:n})=>o.jsx("img",{src:n??void 0,alt:"icon",className:e,style:{width:t,height:t}});function ui({className:e,...t}){return o.jsx("textarea",{"data-slot":"textarea",className:de("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 S7({value:e,onChange:t,keysToMask:n=[],className:r,displayOnly:s=!1,showCopyButton:l=!1}){const c=(C,E)=>{if(!C||E.length===0)return!1;try{const R=JSON.parse(C),T=_=>typeof _!="object"||_===null?!1:Array.isArray(_)?_.some(O=>typeof O=="object"&&O!==null&&T(O)):Object.keys(_).some(O=>E.includes(O)||typeof _[O]=="object"&&_[O]!==null&&T(_[O]));return T(R)}catch{return!1}},d=s?!1:!e||n.length===0||!c(e,n),[h,m]=p.useState(d),[g,v]=p.useState(!1);p.useEffect(()=>{s?m(!1):(!e||n.length===0||!c(e,n))&&m(!0)},[e,n,s]),p.useEffect(()=>{if(g){const C=setTimeout(()=>{v(!1)},2e3);return()=>{clearTimeout(C)}}},[g]);const x=()=>{navigator.clipboard.writeText(e),v(!0)},b=C=>{if(!C)return"";try{const E=JSON.parse(C),R=O=>{if(typeof O!="object"||O===null)return O;const A=Array.isArray(O)?[...O]:{...O};return Array.isArray(A)?A.forEach((j,D)=>{typeof j=="object"&&j!==null&&(A[D]=R(j))}):Object.entries(A).forEach(([j,D])=>{if(n.includes(j))if(typeof D=="string"){const k=D.length;k>30?A[j]="*".repeat(Math.min(20,Math.ceil(k/3))):k>10?A[j]="*".repeat(Math.min(10,Math.ceil(k/2))):A[j]="*".repeat(k)}else A[j]="***";else typeof D=="object"&&D!==null&&(A[j]=R(D))}),A},_=R(typeof E=="object"?E:{});return JSON.stringify(_,null,2)}catch{return C}},w=e&&n.length>0&&c(e,n);return o.jsxs("div",{className:"relative",children:[!h&&w&&!s&&o.jsx(hs,{children:o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx("div",{className:"absolute top-2 left-2 z-10",children:o.jsx(k5,{className:"h-4 w-4 text-gray-500"})})}),o.jsx(Mt,{children:o.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),s?o.jsx("div",{className:`p-2 font-mono ${r??""} min-h-[150px] cursor-not-allowed whitespace-pre-wrap opacity-70`,children:b(e)}):o.jsx(ui,{value:h?e:b(e),onChange:C=>{(h||!w)&&t&&t(C.target.value)},onFocus:C=>{!h&&w&&C.target.blur()},readOnly:!!(!h&&w),className:`font-mono ${r??""} ${!h&&w?"cursor-not-allowed opacity-70":""} min-h-[150px]`,rows:8}),w&&!s&&o.jsx(we,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{m(!h)},children:h?o.jsx(hs,{children:o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(x5,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),o.jsx(Mt,{children:o.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):o.jsx(hs,{children:o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(S5,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),o.jsx(Mt,{children:o.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),l&&o.jsx(we,{type:"button",variant:"ghost",className:`absolute ${w&&!s?"top-2 right-24":"top-2 right-2"}`,onClick:x,children:o.jsx(hs,{children:o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx("div",{className:"flex items-center gap-1",children:g?o.jsxs(o.Fragment,{children:[o.jsx(vr,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copied!"})]}):o.jsxs(o.Fragment,{children:[o.jsx(_m,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copy"})]})})}),o.jsx(Mt,{children:o.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var At;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},e.getValidEnumValues=s=>{const l=e.objectKeys(s).filter(d=>typeof s[s[d]]!="number"),c={};for(const d of l)c[d]=s[d];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(l){return s[l]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},e.find=(s,l)=>{for(const c of s)if(l(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,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}e.joinValues=r,e.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(At||(At={}));var _1;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(_1||(_1={}));const Pe=At.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Go=e=>{switch(typeof e){case"undefined":return Pe.undefined;case"string":return Pe.string;case"number":return Number.isNaN(e)?Pe.nan:Pe.number;case"boolean":return Pe.boolean;case"function":return Pe.function;case"bigint":return Pe.bigint;case"symbol":return Pe.symbol;case"object":return Array.isArray(e)?Pe.array:e===null?Pe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Pe.promise:typeof Map<"u"&&e instanceof Map?Pe.map:typeof Set<"u"&&e instanceof Set?Pe.set:typeof Date<"u"&&e instanceof Date?Pe.date:Pe.object;default:return Pe.unknown}},Se=At.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 uo 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(l){return l.message},r={_errors:[]},s=l=>{for(const c of l.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 d=r,h=0;for(;h<c.path.length;){const m=c.path[h];h===c.path.length-1?(d[m]=d[m]||{_errors:[]},d[m]._errors.push(n(c))):d[m]=d[m]||{_errors:[]},d=d[m],h++}}};return s(this),r}static assert(t){if(!(t instanceof uo))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,At.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 l=s.path[0];n[l]=n[l]||[],n[l].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}uo.create=e=>new uo(e);const qx=(e,t)=>{let n;switch(e.code){case Se.invalid_type:e.received===Pe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,At.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${At.joinValues(e.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${At.joinValues(e.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${At.joinValues(e.options)}, received '${e.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:At.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Se.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="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 Se.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=t.defaultError,At.assertNever(e)}return{message:n}};let C7=qx;function w7(){return C7}const E7=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let d="";const h=r.filter(m=>!!m).slice().reverse();for(const m of h)d=m(c,{data:t,defaultError:d}).message;return{...s,path:l,message:d}};function Me(e,t){const n=w7(),r=E7({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===qx?void 0:qx].filter(s=>!!s)});e.common.issues.push(r)}class _r{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 it;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 l=await s.key,c=await s.value;r.push({key:l,value:c})}return _r.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return it;l.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(r[l.value]=c.value)}return{status:t.value,value:r}}}const it=Object.freeze({status:"aborted"}),vd=e=>({status:"dirty",value:e}),ka=e=>({status:"valid",value:e}),j1=e=>e.status==="aborted",N1=e=>e.status==="dirty",kc=e=>e.status==="valid",Lm=e=>typeof Promise<"u"&&e instanceof Promise;var Ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ge||(Ge={}));class ws{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 A1=(e,t)=>{if(kc(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 uo(e.common.issues);return this._error=n,this._error}}};function mt(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,d)=>{const{message:h}=e;return c.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:h??r??d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:h??n??d.defaultError}},description:s}}class Rt{get description(){return this._def.description}_getType(t){return Go(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Go(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _r,ctx:{common:t.parent.common,data:t.data,parsedType:Go(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Lm(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:Go(t)},s=this._parseSync({data:t,path:r.path,parent:r});return A1(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:Go(t)};if(!this["~standard"].async)try{const l=this._parseSync({data:t,path:[],parent:n});return kc(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(s=(r=l==null?void 0:l.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(l=>kc(l)?{value:l.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:Go(t)},s=this._parse({data:t,path:r.path,parent:r}),l=await(Lm(s)?s:Promise.resolve(s));return A1(r,l)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=t(s),d=()=>l.addIssue({code:Se.custom,...r(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(d(),!1)):c?!0:(d(),!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 ol({schema:this,typeName:lt.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 ro.create(this,this._def)}nullable(){return il.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xs.create(this)}promise(){return Bm.create(this,this._def)}or(t){return Fm.create([this,t],this._def)}and(t){return Hm.create(this,t,this._def)}transform(t){return new ol({...mt(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Gm({...mt(this._def),innerType:this,defaultValue:n,typeName:lt.ZodDefault})}brand(){return new X2({typeName:lt.ZodBranded,type:this,...mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new qm({...mt(this._def),innerType:this,catchValue:n,typeName:lt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return b0.create(this,t)}readonly(){return Km.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const R7=/^c[^\s-]{8,}$/i,T7=/^[0-9a-z]+$/,_7=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j7=/^[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,N7=/^[a-z0-9_-]{21}$/i,A7=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,D7=/^[-+]?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)?)??$/,O7=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,M7="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Wy;const k7=/^(?:(?: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])$/,I7=/^(?:(?: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])$/,L7=/^(([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]))$/,P7=/^(([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])$/,U7=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,F7=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Y2="((\\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])))",H7=new RegExp(`^${Y2}$`);function W2(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 V7(e){return new RegExp(`^${W2(e)}$`)}function z7(e){let t=`${Y2}T${W2(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 $7(e,t){return!!((t==="v4"||!t)&&k7.test(e)||(t==="v6"||!t)&&L7.test(e))}function B7(e,t){if(!A7.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 G7(e,t){return!!((t==="v4"||!t)&&I7.test(e)||(t==="v6"||!t)&&P7.test(e))}class no extends Rt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Pe.string){const l=this._getOrReturnCtx(t);return Me(l,{code:Se.invalid_type,expected:Pe.string,received:l.parsedType}),it}const r=new _r;let s;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="max")t.data.length>l.value&&(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="length"){const c=t.data.length>l.value,d=t.data.length<l.value;(c||d)&&(s=this._getOrReturnCtx(t,s),c?Me(s,{code:Se.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&Me(s,{code:Se.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),r.dirty())}else if(l.kind==="email")O7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"email",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")Wy||(Wy=new RegExp(M7,"u")),Wy.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"emoji",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")j7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"uuid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")N7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"nanoid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")R7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"cuid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")T7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"cuid2",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")_7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"ulid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Me(s,{validation:"url",code:Se.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"regex",code:Se.invalid_string,message:l.message}),r.dirty())):l.kind==="trim"?t.data=t.data.trim():l.kind==="includes"?t.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),r.dirty()):l.kind==="toLowerCase"?t.data=t.data.toLowerCase():l.kind==="toUpperCase"?t.data=t.data.toUpperCase():l.kind==="startsWith"?t.data.startsWith(l.value)||(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?z7(l).test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?H7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?V7(l).test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?D7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"duration",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?$7(t.data,l.version)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"ip",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?B7(t.data,l.alg)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"jwt",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?G7(t.data,l.version)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"cidr",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?U7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"base64",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?F7.test(t.data)||(s=this._getOrReturnCtx(t,s),Me(s,{validation:"base64url",code:Se.invalid_string,message:l.message}),r.dirty()):At.assertNever(l);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Se.invalid_string,...Ge.errToObj(r)})}_addCheck(t){return new no({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ge.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,...Ge.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,...Ge.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ge.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ge.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ge.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ge.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ge.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ge.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ge.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ge.errToObj(n)})}nonempty(t){return this.min(1,Ge.errToObj(t))}trim(){return new no({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new no({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new no({...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}}no.create=e=>new no({checks:[],typeName:lt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...mt(e)});function q7(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,l=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return l%c/10**s}class Ic extends Rt{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)!==Pe.number){const l=this._getOrReturnCtx(t);return Me(l,{code:Se.invalid_type,expected:Pe.number,received:l.parsedType}),it}let r;const s=new _r;for(const l of this._def.checks)l.kind==="int"?At.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Me(r,{code:Se.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:Se.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:Se.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?q7(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),Me(r,{code:Se.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Me(r,{code:Se.not_finite,message:l.message}),s.dirty()):At.assertNever(l);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,s){return new Ic({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(s)}]})}_addCheck(t){return new Ic({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.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"&&At.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)}}Ic.create=e=>new Ic({checks:[],typeName:lt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...mt(e)});class Ld extends Rt{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)!==Pe.bigint)return this._getInvalidInput(t);let r;const s=new _r;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:Se.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:Se.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:Se.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):At.assertNever(l);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Me(n,{code:Se.invalid_type,expected:Pe.bigint,received:n.parsedType}),it}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,s){return new Ld({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(s)}]})}_addCheck(t){return new Ld({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.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}}Ld.create=e=>new Ld({checks:[],typeName:lt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...mt(e)});class Kx extends Rt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Pe.boolean){const r=this._getOrReturnCtx(t);return Me(r,{code:Se.invalid_type,expected:Pe.boolean,received:r.parsedType}),it}return ka(t.data)}}Kx.create=e=>new Kx({typeName:lt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...mt(e)});class Pm extends Rt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Pe.date){const l=this._getOrReturnCtx(t);return Me(l,{code:Se.invalid_type,expected:Pe.date,received:l.parsedType}),it}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return Me(l,{code:Se.invalid_date}),it}const r=new _r;let s;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),r.dirty()):l.kind==="max"?t.data.getTime()>l.value&&(s=this._getOrReturnCtx(t,s),Me(s,{code:Se.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):At.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Pm({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ge.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ge.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}}Pm.create=e=>new Pm({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:lt.ZodDate,...mt(e)});class D1 extends Rt{_parse(t){if(this._getType(t)!==Pe.symbol){const r=this._getOrReturnCtx(t);return Me(r,{code:Se.invalid_type,expected:Pe.symbol,received:r.parsedType}),it}return ka(t.data)}}D1.create=e=>new D1({typeName:lt.ZodSymbol,...mt(e)});class Zx extends Rt{_parse(t){if(this._getType(t)!==Pe.undefined){const r=this._getOrReturnCtx(t);return Me(r,{code:Se.invalid_type,expected:Pe.undefined,received:r.parsedType}),it}return ka(t.data)}}Zx.create=e=>new Zx({typeName:lt.ZodUndefined,...mt(e)});class Um extends Rt{_parse(t){if(this._getType(t)!==Pe.null){const r=this._getOrReturnCtx(t);return Me(r,{code:Se.invalid_type,expected:Pe.null,received:r.parsedType}),it}return ka(t.data)}}Um.create=e=>new Um({typeName:lt.ZodNull,...mt(e)});class O1 extends Rt{constructor(){super(...arguments),this._any=!0}_parse(t){return ka(t.data)}}O1.create=e=>new O1({typeName:lt.ZodAny,...mt(e)});class Yx extends Rt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ka(t.data)}}Yx.create=e=>new Yx({typeName:lt.ZodUnknown,...mt(e)});class di extends Rt{_parse(t){const n=this._getOrReturnCtx(t);return Me(n,{code:Se.invalid_type,expected:Pe.never,received:n.parsedType}),it}}di.create=e=>new di({typeName:lt.ZodNever,...mt(e)});class M1 extends Rt{_parse(t){if(this._getType(t)!==Pe.undefined){const r=this._getOrReturnCtx(t);return Me(r,{code:Se.invalid_type,expected:Pe.void,received:r.parsedType}),it}return ka(t.data)}}M1.create=e=>new M1({typeName:lt.ZodVoid,...mt(e)});class xs extends Rt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Pe.array)return Me(n,{code:Se.invalid_type,expected:Pe.array,received:n.parsedType}),it;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,d=n.data.length<s.exactLength.value;(c||d)&&(Me(n,{code:c?Se.too_big:Se.too_small,minimum:d?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&&(Me(n,{code:Se.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&&(Me(n,{code:Se.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,d)=>s.type._parseAsync(new ws(n,c,n.path,d)))).then(c=>_r.mergeArray(r,c));const l=[...n.data].map((c,d)=>s.type._parseSync(new ws(n,c,n.path,d)));return _r.mergeArray(r,l)}get element(){return this._def.type}min(t,n){return new xs({...this._def,minLength:{value:t,message:Ge.toString(n)}})}max(t,n){return new xs({...this._def,maxLength:{value:t,message:Ge.toString(n)}})}length(t,n){return new xs({...this._def,exactLength:{value:t,message:Ge.toString(n)}})}nonempty(t){return this.min(1,t)}}xs.create=(e,t)=>new xs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...mt(t)});function vc(e){if(e instanceof On){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ro.create(vc(r))}return new On({...e._def,shape:()=>t})}else return e instanceof xs?new xs({...e._def,type:vc(e.element)}):e instanceof ro?ro.create(vc(e.unwrap())):e instanceof il?il.create(vc(e.unwrap())):e instanceof al?al.create(e.items.map(t=>vc(t))):e}class On extends Rt{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=At.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Pe.object){const m=this._getOrReturnCtx(t);return Me(m,{code:Se.invalid_type,expected:Pe.object,received:m.parsedType}),it}const{status:r,ctx:s}=this._processInputParams(t),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof di&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||d.push(m);const h=[];for(const m of c){const g=l[m],v=s.data[m];h.push({key:{status:"valid",value:m},value:g._parse(new ws(s,v,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof di){const m=this._def.unknownKeys;if(m==="passthrough")for(const g of d)h.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(m==="strict")d.length>0&&(Me(s,{code:Se.unrecognized_keys,keys:d}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const g of d){const v=s.data[g];h.push({key:{status:"valid",value:g},value:m._parse(new ws(s,v,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const g of h){const v=await g.key,x=await g.value;m.push({key:v,value:x,alwaysSet:g.alwaysSet})}return m}).then(m=>_r.mergeObjectSync(r,m)):_r.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(t){return Ge.errToObj,new On({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var l,c;const s=((c=(l=this._def).errorMap)==null?void 0:c.call(l,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ge.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new On({...this._def,unknownKeys:"strip"})}passthrough(){return new On({...this._def,unknownKeys:"passthrough"})}extend(t){return new On({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new On({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:lt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new On({...this._def,catchall:t})}pick(t){const n={};for(const r of At.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new On({...this._def,shape:()=>n})}omit(t){const n={};for(const r of At.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new On({...this._def,shape:()=>n})}deepPartial(){return vc(this)}partial(t){const n={};for(const r of At.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new On({...this._def,shape:()=>n})}required(t){const n={};for(const r of At.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof ro;)l=l._def.innerType;n[r]=l}return new On({...this._def,shape:()=>n})}keyof(){return Q2(At.objectKeys(this.shape))}}On.create=(e,t)=>new On({shape:()=>e,unknownKeys:"strip",catchall:di.create(),typeName:lt.ZodObject,...mt(t)});On.strictCreate=(e,t)=>new On({shape:()=>e,unknownKeys:"strict",catchall:di.create(),typeName:lt.ZodObject,...mt(t)});On.lazycreate=(e,t)=>new On({shape:e,unknownKeys:"strip",catchall:di.create(),typeName:lt.ZodObject,...mt(t)});class Fm extends Rt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new uo(d.ctx.common.issues));return Me(n,{code:Se.invalid_union,unionErrors:c}),it}if(n.common.async)return Promise.all(r.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const h of r){const m={...n,common:{...n.common,issues:[]},parent:null},g=h._parseSync({data:n.data,path:n.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!l&&(l={result:g,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(h=>new uo(h));return Me(n,{code:Se.invalid_union,unionErrors:d}),it}}get options(){return this._def.options}}Fm.create=(e,t)=>new Fm({options:e,typeName:lt.ZodUnion,...mt(t)});const Qs=e=>e instanceof Qx?Qs(e.schema):e instanceof ol?Qs(e.innerType()):e instanceof zm?[e.value]:e instanceof sl?e.options:e instanceof $m?At.objectValues(e.enum):e instanceof Gm?Qs(e._def.innerType):e instanceof Zx?[void 0]:e instanceof Um?[null]:e instanceof ro?[void 0,...Qs(e.unwrap())]:e instanceof il?[null,...Qs(e.unwrap())]:e instanceof X2||e instanceof Km?Qs(e.unwrap()):e instanceof qm?Qs(e._def.innerType):[];class x0 extends Rt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Pe.object)return Me(n,{code:Se.invalid_type,expected:Pe.object,received:n.parsedType}),it;const r=this.discriminator,s=n.data[r],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(Me(n,{code:Se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),it)}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 l of n){const c=Qs(l.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const d of c){if(s.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);s.set(d,l)}}return new x0({typeName:lt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...mt(r)})}}function Wx(e,t){const n=Go(e),r=Go(t);if(e===t)return{valid:!0,data:e};if(n===Pe.object&&r===Pe.object){const s=At.objectKeys(t),l=At.objectKeys(e).filter(d=>s.indexOf(d)!==-1),c={...e,...t};for(const d of l){const h=Wx(e[d],t[d]);if(!h.valid)return{valid:!1};c[d]=h.data}return{valid:!0,data:c}}else if(n===Pe.array&&r===Pe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let l=0;l<e.length;l++){const c=e[l],d=t[l],h=Wx(c,d);if(!h.valid)return{valid:!1};s.push(h.data)}return{valid:!0,data:s}}else return n===Pe.date&&r===Pe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Hm extends Rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(l,c)=>{if(j1(l)||j1(c))return it;const d=Wx(l.value,c.value);return d.valid?((N1(l)||N1(c))&&n.dirty(),{status:n.value,value:d.data}):(Me(r,{code:Se.invalid_intersection_types}),it)};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(([l,c])=>s(l,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}))}}Hm.create=(e,t,n)=>new Hm({left:e,right:t,typeName:lt.ZodIntersection,...mt(n)});class al extends Rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Pe.array)return Me(r,{code:Se.invalid_type,expected:Pe.array,received:r.parsedType}),it;if(r.data.length<this._def.items.length)return Me(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),it;!this._def.rest&&r.data.length>this._def.items.length&&(Me(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...r.data].map((c,d)=>{const h=this._def.items[d]||this._def.rest;return h?h._parse(new ws(r,c,r.path,d)):null}).filter(c=>!!c);return r.common.async?Promise.all(l).then(c=>_r.mergeArray(n,c)):_r.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new al({...this._def,rest:t})}}al.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new al({items:e,typeName:lt.ZodTuple,rest:null,...mt(t)})};class Vm extends Rt{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!==Pe.object)return Me(r,{code:Se.invalid_type,expected:Pe.object,received:r.parsedType}),it;const s=[],l=this._def.keyType,c=this._def.valueType;for(const d in r.data)s.push({key:l._parse(new ws(r,d,r.path,d)),value:c._parse(new ws(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?_r.mergeObjectAsync(n,s):_r.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Rt?new Vm({keyType:t,valueType:n,typeName:lt.ZodRecord,...mt(r)}):new Vm({keyType:no.create(),valueType:t,typeName:lt.ZodRecord,...mt(n)})}}class k1 extends Rt{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!==Pe.map)return Me(r,{code:Se.invalid_type,expected:Pe.map,received:r.parsedType}),it;const s=this._def.keyType,l=this._def.valueType,c=[...r.data.entries()].map(([d,h],m)=>({key:s._parse(new ws(r,d,r.path,[m,"key"])),value:l._parse(new ws(r,h,r.path,[m,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const h of c){const m=await h.key,g=await h.value;if(m.status==="aborted"||g.status==="aborted")return it;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(m.value,g.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const h of c){const m=h.key,g=h.value;if(m.status==="aborted"||g.status==="aborted")return it;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(m.value,g.value)}return{status:n.value,value:d}}}}k1.create=(e,t,n)=>new k1({valueType:t,keyType:e,typeName:lt.ZodMap,...mt(n)});class Pd extends Rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Pe.set)return Me(r,{code:Se.invalid_type,expected:Pe.set,received:r.parsedType}),it;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Me(r,{code:Se.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&&(Me(r,{code:Se.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(h){const m=new Set;for(const g of h){if(g.status==="aborted")return it;g.status==="dirty"&&n.dirty(),m.add(g.value)}return{status:n.value,value:m}}const d=[...r.data.values()].map((h,m)=>l._parse(new ws(r,h,r.path,m)));return r.common.async?Promise.all(d).then(h=>c(h)):c(d)}min(t,n){return new Pd({...this._def,minSize:{value:t,message:Ge.toString(n)}})}max(t,n){return new Pd({...this._def,maxSize:{value:t,message:Ge.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Pd.create=(e,t)=>new Pd({valueType:e,minSize:null,maxSize:null,typeName:lt.ZodSet,...mt(t)});class Qx extends Rt{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})}}Qx.create=(e,t)=>new Qx({getter:e,typeName:lt.ZodLazy,...mt(t)});class zm extends Rt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Me(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),it}return{status:"valid",value:t.data}}get value(){return this._def.value}}zm.create=(e,t)=>new zm({value:e,typeName:lt.ZodLiteral,...mt(t)});function Q2(e,t){return new sl({values:e,typeName:lt.ZodEnum,...mt(t)})}class sl extends Rt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Me(n,{expected:At.joinValues(r),received:n.parsedType,code:Se.invalid_type}),it}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 Me(n,{received:n.data,code:Se.invalid_enum_value,options:r}),it}return ka(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 sl.create(t,{...this._def,...n})}exclude(t,n=this._def){return sl.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}sl.create=Q2;class $m extends Rt{_parse(t){const n=At.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Pe.string&&r.parsedType!==Pe.number){const s=At.objectValues(n);return Me(r,{expected:At.joinValues(s),received:r.parsedType,code:Se.invalid_type}),it}if(this._cache||(this._cache=new Set(At.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=At.objectValues(n);return Me(r,{received:r.data,code:Se.invalid_enum_value,options:s}),it}return ka(t.data)}get enum(){return this._def.values}}$m.create=(e,t)=>new $m({values:e,typeName:lt.ZodNativeEnum,...mt(t)});class Bm extends Rt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Pe.promise&&n.common.async===!1)return Me(n,{code:Se.invalid_type,expected:Pe.promise,received:n.parsedType}),it;const r=n.parsedType===Pe.promise?n.data:Promise.resolve(n.data);return ka(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Bm.create=(e,t)=>new Bm({type:e,typeName:lt.ZodPromise,...mt(t)});class ol extends Rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,l={addIssue:c=>{Me(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(r.data,l);if(r.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return it;const h=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return h.status==="aborted"?it:h.status==="dirty"||n.value==="dirty"?vd(h.value):h});{if(n.value==="aborted")return it;const d=this._def.schema._parseSync({data:c,path:r.path,parent:r});return d.status==="aborted"?it:d.status==="dirty"||n.value==="dirty"?vd(d.value):d}}if(s.type==="refinement"){const c=d=>{const h=s.refinement(d,l);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(r.common.async===!1){const d=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return d.status==="aborted"?it:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(d=>d.status==="aborted"?it:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.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(!kc(c))return it;const d=s.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>kc(c)?Promise.resolve(s.transform(c.value,l)).then(d=>({status:n.value,value:d})):it);At.assertNever(s)}}ol.create=(e,t,n)=>new ol({schema:e,typeName:lt.ZodEffects,effect:t,...mt(n)});ol.createWithPreprocess=(e,t,n)=>new ol({schema:t,effect:{type:"preprocess",transform:e},typeName:lt.ZodEffects,...mt(n)});class ro extends Rt{_parse(t){return this._getType(t)===Pe.undefined?ka(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ro.create=(e,t)=>new ro({innerType:e,typeName:lt.ZodOptional,...mt(t)});class il extends Rt{_parse(t){return this._getType(t)===Pe.null?ka(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}il.create=(e,t)=>new il({innerType:e,typeName:lt.ZodNullable,...mt(t)});class Gm extends Rt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Pe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Gm.create=(e,t)=>new Gm({innerType:e,typeName:lt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...mt(t)});class qm extends Rt{_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 Lm(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new uo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new uo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}qm.create=(e,t)=>new qm({innerType:e,typeName:lt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...mt(t)});class I1 extends Rt{_parse(t){if(this._getType(t)!==Pe.nan){const r=this._getOrReturnCtx(t);return Me(r,{code:Se.invalid_type,expected:Pe.nan,received:r.parsedType}),it}return{status:"valid",value:t.data}}}I1.create=e=>new I1({typeName:lt.ZodNaN,...mt(e)});class X2 extends Rt{_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 b0 extends Rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?it:l.status==="dirty"?(n.dirty(),vd(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?it: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 b0({in:t,out:n,typeName:lt.ZodPipeline})}}class Km extends Rt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(kc(s)&&(s.value=Object.freeze(s.value)),s);return Lm(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Km.create=(e,t)=>new Km({innerType:e,typeName:lt.ZodReadonly,...mt(t)});var lt;(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"})(lt||(lt={}));const an=no.create,K7=Ic.create,Z7=Kx.create,Y7=Um.create,W7=Yx.create;di.create;const L1=xs.create,rn=On.create,Q7=Fm.create,J2=x0.create;Hm.create;al.create;const X7=Vm.create,Ns=zm.create;sl.create;const S0=$m.create;Bm.create;ro.create;const J7=il.create,Qy=it,eN=rn({serviceAccount:an().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Se.custom,message:"Service Account must be a valid JSON object"}),Qy):n.client_email?e:(t.addIssue({code:Se.custom,message:"Service Account must contain a client_email field"}),Qy)}catch(n){return console.error(n),t.addIssue({code:Se.custom,message:"Service Account must be a valid JSON string"}),Qy}})}),eH=[{title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:f7},{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:w5},{type:"separator"},{title:"Leave your feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:H5},{title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:Hc},{type:"separator"},{title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:o6}];function tH(){const[e,t]=p.useState(!1);return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(xr,{open:e,onOpenChange:t,children:[o.jsx(br,{asChild:!0,children:o.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:[o.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:o.jsx(d7,{width:24,height:24})}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[o.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:"Community Edition"})]}),o.jsx(Oa,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})}),o.jsx(cr,{align:"start",sideOffset:8,className:"w-56",children:eH.map((n,r)=>{if(n.type==="separator")return o.jsx(Aa,{},`separator-${String(r)}`);const s=n.icon;return o.jsx(Ft,{asChild:!0,children:o.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[o.jsx(s,{className:"size-4"}),n.title]})},n.href)})})]})})})})}var ms=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(ms||{});const tN=p.createContext(null);function nN(e,t){return function(){return e.apply(t,arguments)}}const{toString:nH}=Object.prototype,{getPrototypeOf:C0}=Object,{iterator:Hp,toStringTag:rN}=Symbol,Vp=(e=>t=>{const n=nH.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Xa=e=>(e=e.toLowerCase(),t=>Vp(t)===e),zp=e=>t=>typeof t===e,{isArray:Kc}=Array,Ud=zp("undefined");function ff(e){return e!==null&&!Ud(e)&&e.constructor!==null&&!Ud(e.constructor)&&Pr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const aN=Xa("ArrayBuffer");function rH(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&aN(e.buffer),t}const aH=zp("string"),Pr=zp("function"),sN=zp("number"),hf=e=>e!==null&&typeof e=="object",sH=e=>e===!0||e===!1,hm=e=>{if(Vp(e)!=="object")return!1;const t=C0(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(rN in e)&&!(Hp in e)},oH=e=>{if(!hf(e)||ff(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},iH=Xa("Date"),lH=Xa("File"),cH=Xa("Blob"),uH=Xa("FileList"),dH=e=>hf(e)&&Pr(e.pipe),fH=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Pr(e.append)&&((t=Vp(e))==="formdata"||t==="object"&&Pr(e.toString)&&e.toString()==="[object FormData]"))},hH=Xa("URLSearchParams"),[mH,pH,gH,vH]=["ReadableStream","Request","Response","Headers"].map(Xa),yH=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Kc(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(ff(e))return;const l=n?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;let d;for(r=0;r<c;r++)d=l[r],t.call(null,e[d],d,e)}}function oN(e,t){if(ff(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 Qi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,iN=e=>!Ud(e)&&e!==Qi;function Xx(){const{caseless:e}=iN(this)&&this||{},t={},n=(r,s)=>{const l=e&&oN(t,s)||s;hm(t[l])&&hm(r)?t[l]=Xx(t[l],r):hm(r)?t[l]=Xx({},r):Kc(r)?t[l]=r.slice():t[l]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&mf(arguments[r],n);return t}const xH=(e,t,n,{allOwnKeys:r}={})=>(mf(t,(s,l)=>{n&&Pr(s)?e[l]=nN(s,n):e[l]=s},{allOwnKeys:r}),e),bH=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),SH=(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)},CH=(e,t,n,r)=>{let s,l,c;const d={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),l=s.length;l-- >0;)c=s[l],(!r||r(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&C0(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},wH=(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},EH=e=>{if(!e)return null;if(Kc(e))return e;let t=e.length;if(!sN(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},RH=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&C0(Uint8Array)),TH=(e,t)=>{const r=(e&&e[Hp]).call(e);let s;for(;(s=r.next())&&!s.done;){const l=s.value;t.call(e,l[0],l[1])}},_H=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},jH=Xa("HTMLFormElement"),NH=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),P1=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),AH=Xa("RegExp"),lN=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};mf(n,(s,l)=>{let c;(c=t(s,l,e))!==!1&&(r[l]=c||s)}),Object.defineProperties(e,r)},DH=e=>{lN(e,(t,n)=>{if(Pr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Pr(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+"'")})}})},OH=(e,t)=>{const n={},r=s=>{s.forEach(l=>{n[l]=!0})};return Kc(e)?r(e):r(String(e).split(t)),n},MH=()=>{},kH=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function IH(e){return!!(e&&Pr(e.append)&&e[rN]==="FormData"&&e[Hp])}const LH=e=>{const t=new Array(10),n=(r,s)=>{if(hf(r)){if(t.indexOf(r)>=0)return;if(ff(r))return r;if(!("toJSON"in r)){t[s]=r;const l=Kc(r)?[]:{};return mf(r,(c,d)=>{const h=n(c,s+1);!Ud(h)&&(l[d]=h)}),t[s]=void 0,l}}return r};return n(e,0)},PH=Xa("AsyncFunction"),UH=e=>e&&(hf(e)||Pr(e))&&Pr(e.then)&&Pr(e.catch),cN=((e,t)=>e?setImmediate:t?((n,r)=>(Qi.addEventListener("message",({source:s,data:l})=>{s===Qi&&l===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Qi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Pr(Qi.postMessage)),FH=typeof queueMicrotask<"u"?queueMicrotask.bind(Qi):typeof process<"u"&&process.nextTick||cN,HH=e=>e!=null&&Pr(e[Hp]),ce={isArray:Kc,isArrayBuffer:aN,isBuffer:ff,isFormData:fH,isArrayBufferView:rH,isString:aH,isNumber:sN,isBoolean:sH,isObject:hf,isPlainObject:hm,isEmptyObject:oH,isReadableStream:mH,isRequest:pH,isResponse:gH,isHeaders:vH,isUndefined:Ud,isDate:iH,isFile:lH,isBlob:cH,isRegExp:AH,isFunction:Pr,isStream:dH,isURLSearchParams:hH,isTypedArray:RH,isFileList:uH,forEach:mf,merge:Xx,extend:xH,trim:yH,stripBOM:bH,inherits:SH,toFlatObject:CH,kindOf:Vp,kindOfTest:Xa,endsWith:wH,toArray:EH,forEachEntry:TH,matchAll:_H,isHTMLForm:jH,hasOwnProperty:P1,hasOwnProp:P1,reduceDescriptors:lN,freezeMethods:DH,toObjectSet:OH,toCamelCase:NH,noop:MH,toFiniteNumber:kH,findKey:oN,global:Qi,isContextDefined:iN,isSpecCompliantForm:IH,toJSONObject:LH,isAsyncFn:PH,isThenable:UH,setImmediate:cN,asap:FH,isIterable:HH};function ft(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)}ce.inherits(ft,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:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const uN=ft.prototype,dN={};["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=>{dN[e]={value:e}});Object.defineProperties(ft,dN);Object.defineProperty(uN,"isAxiosError",{value:!0});ft.from=(e,t,n,r,s,l)=>{const c=Object.create(uN);return ce.toFlatObject(e,c,function(h){return h!==Error.prototype},d=>d!=="isAxiosError"),ft.call(c,e.message,t,n,r,s),c.cause=e,c.name=e.name,l&&Object.assign(c,l),c};const VH=null;function Jx(e){return ce.isPlainObject(e)||ce.isArray(e)}function fN(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function U1(e,t,n){return e?e.concat(t).map(function(s,l){return s=fN(s),!n&&l?"["+s+"]":s}).join(n?".":""):t}function zH(e){return ce.isArray(e)&&!e.some(Jx)}const $H=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function $p(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,E){return!ce.isUndefined(E[C])});const r=n.metaTokens,s=n.visitor||g,l=n.dots,c=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(s))throw new TypeError("visitor must be a function");function m(w){if(w===null)return"";if(ce.isDate(w))return w.toISOString();if(ce.isBoolean(w))return w.toString();if(!h&&ce.isBlob(w))throw new ft("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(w)||ce.isTypedArray(w)?h&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function g(w,C,E){let R=w;if(w&&!E&&typeof w=="object"){if(ce.endsWith(C,"{}"))C=r?C:C.slice(0,-2),w=JSON.stringify(w);else if(ce.isArray(w)&&zH(w)||(ce.isFileList(w)||ce.endsWith(C,"[]"))&&(R=ce.toArray(w)))return C=fN(C),R.forEach(function(_,O){!(ce.isUndefined(_)||_===null)&&t.append(c===!0?U1([C],O,l):c===null?C:C+"[]",m(_))}),!1}return Jx(w)?!0:(t.append(U1(E,C,l),m(w)),!1)}const v=[],x=Object.assign($H,{defaultVisitor:g,convertValue:m,isVisitable:Jx});function b(w,C){if(!ce.isUndefined(w)){if(v.indexOf(w)!==-1)throw Error("Circular reference detected in "+C.join("."));v.push(w),ce.forEach(w,function(R,T){(!(ce.isUndefined(R)||R===null)&&s.call(t,R,ce.isString(T)?T.trim():T,C,x))===!0&&b(R,C?C.concat(T):[T])}),v.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return b(e),t}function F1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function w0(e,t){this._pairs=[],e&&$p(e,this,t)}const hN=w0.prototype;hN.append=function(t,n){this._pairs.push([t,n])};hN.toString=function(t){const n=t?function(r){return t.call(this,r,F1)}:F1;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function BH(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function mN(e,t,n){if(!t)return e;const r=n&&n.encode||BH;ce.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let l;if(s?l=s(t,n):l=ce.isURLSearchParams(t)?t.toString():new w0(t,n).toString(r),l){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class H1{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){ce.forEach(this.handlers,function(r){r!==null&&t(r)})}}const pN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},GH=typeof URLSearchParams<"u"?URLSearchParams:w0,qH=typeof FormData<"u"?FormData:null,KH=typeof Blob<"u"?Blob:null,ZH={isBrowser:!0,classes:{URLSearchParams:GH,FormData:qH,Blob:KH},protocols:["http","https","file","blob","url","data"]},E0=typeof window<"u"&&typeof document<"u",eb=typeof navigator=="object"&&navigator||void 0,YH=E0&&(!eb||["ReactNative","NativeScript","NS"].indexOf(eb.product)<0),WH=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",QH=E0&&window.location.href||"http://localhost",XH=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:E0,hasStandardBrowserEnv:YH,hasStandardBrowserWebWorkerEnv:WH,navigator:eb,origin:QH},Symbol.toStringTag,{value:"Module"})),gr={...XH,...ZH};function JH(e,t){return $p(e,new gr.classes.URLSearchParams,{visitor:function(n,r,s,l){return gr.isNode&&ce.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function eV(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tV(e){const t={},n=Object.keys(e);let r;const s=n.length;let l;for(r=0;r<s;r++)l=n[r],t[l]=e[l];return t}function gN(e){function t(n,r,s,l){let c=n[l++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),h=l>=n.length;return c=!c&&ce.isArray(s)?s.length:c,h?(ce.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!d):((!s[c]||!ce.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],l)&&ce.isArray(s[c])&&(s[c]=tV(s[c])),!d)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(r,s)=>{t(eV(r),s,n,0)}),n}return null}function nV(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const pf={transitional:pN,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,l=ce.isObject(t);if(l&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return s?JSON.stringify(gN(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(l){if(r.indexOf("application/x-www-form-urlencoded")>-1)return JH(t,this.formSerializer).toString();if((d=ce.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return $p(d?{"files[]":t}:t,h&&new h,this.formSerializer)}}return l||s?(n.setContentType("application/json",!1),nV(t)):t}],transformResponse:[function(t){const n=this.transitional||pf.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(d){if(c)throw d.name==="SyntaxError"?ft.from(d,ft.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gr.classes.FormData,Blob:gr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{pf.headers[e]={}});const rV=ce.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"]),aV=e=>{const t={};let n,r,s;return e&&e.split(`
451
+ `).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&rV[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},V1=Symbol("internals");function od(e){return e&&String(e).trim().toLowerCase()}function mm(e){return e===!1||e==null?e:ce.isArray(e)?e.map(mm):String(e)}function sV(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 oV=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Xy(e,t,n,r,s){if(ce.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!ce.isString(t)){if(ce.isString(r))return t.indexOf(r)!==-1;if(ce.isRegExp(r))return r.test(t)}}function iV(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function lV(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,l,c){return this[r].call(this,t,s,l,c)},configurable:!0})})}let Ur=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function l(d,h,m){const g=od(h);if(!g)throw new Error("header name must be a non-empty string");const v=ce.findKey(s,g);(!v||s[v]===void 0||m===!0||m===void 0&&s[v]!==!1)&&(s[v||h]=mm(d))}const c=(d,h)=>ce.forEach(d,(m,g)=>l(m,g,h));if(ce.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(ce.isString(t)&&(t=t.trim())&&!oV(t))c(aV(t),n);else if(ce.isObject(t)&&ce.isIterable(t)){let d={},h,m;for(const g of t){if(!ce.isArray(g))throw TypeError("Object iterator must return a key-value pair");d[m=g[0]]=(h=d[m])?ce.isArray(h)?[...h,g[1]]:[h,g[1]]:g[1]}c(d,n)}else t!=null&&l(n,t,r);return this}get(t,n){if(t=od(t),t){const r=ce.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return sV(s);if(ce.isFunction(n))return n.call(this,s,r);if(ce.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=od(t),t){const r=ce.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Xy(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function l(c){if(c=od(c),c){const d=ce.findKey(r,c);d&&(!n||Xy(r,r[d],d,n))&&(delete r[d],s=!0)}}return ce.isArray(t)?t.forEach(l):l(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const l=n[r];(!t||Xy(this,this[l],l,t,!0))&&(delete this[l],s=!0)}return s}normalize(t){const n=this,r={};return ce.forEach(this,(s,l)=>{const c=ce.findKey(r,l);if(c){n[c]=mm(s),delete n[l];return}const d=t?iV(l):String(l).trim();d!==l&&delete n[l],n[d]=mm(s),r[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&ce.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(`
452
+ `)}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[V1]=this[V1]={accessors:{}}).accessors,s=this.prototype;function l(c){const d=od(c);r[d]||(lV(s,c),r[d]=!0)}return ce.isArray(t)?t.forEach(l):l(t),this}};Ur.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(Ur.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ce.freezeMethods(Ur);function Jy(e,t){const n=this||pf,r=t||n,s=Ur.from(r.headers);let l=r.data;return ce.forEach(e,function(d){l=d.call(n,l,s.normalize(),t?t.status:void 0)}),s.normalize(),l}function vN(e){return!!(e&&e.__CANCEL__)}function Zc(e,t,n){ft.call(this,e??"canceled",ft.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(Zc,ft,{__CANCEL__:!0});function yN(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ft("Request failed with status code "+n.status,[ft.ERR_BAD_REQUEST,ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function cV(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function uV(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,l=0,c;return t=t!==void 0?t:1e3,function(h){const m=Date.now(),g=r[l];c||(c=m),n[s]=h,r[s]=m;let v=l,x=0;for(;v!==s;)x+=n[v++],v=v%e;if(s=(s+1)%e,s===l&&(l=(l+1)%e),m-c<t)return;const b=g&&m-g;return b?Math.round(x*1e3/b):void 0}}function dV(e,t){let n=0,r=1e3/t,s,l;const c=(m,g=Date.now())=>{n=g,s=null,l&&(clearTimeout(l),l=null),e(...m)};return[(...m)=>{const g=Date.now(),v=g-n;v>=r?c(m,g):(s=m,l||(l=setTimeout(()=>{l=null,c(s)},r-v)))},()=>s&&c(s)]}const Zm=(e,t,n=3)=>{let r=0;const s=uV(50,250);return dV(l=>{const c=l.loaded,d=l.lengthComputable?l.total:void 0,h=c-r,m=s(h),g=c<=d;r=c;const v={loaded:c,total:d,progress:d?c/d:void 0,bytes:h,rate:m||void 0,estimated:m&&d&&g?(d-c)/m:void 0,event:l,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(v)},n)},z1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},$1=e=>(...t)=>ce.asap(()=>e(...t)),fV=gr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,gr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(gr.origin),gr.navigator&&/(msie|trident)/i.test(gr.navigator.userAgent)):()=>!0,hV=gr.hasStandardBrowserEnv?{write(e,t,n,r,s,l){const c=[e+"="+encodeURIComponent(t)];ce.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),ce.isString(r)&&c.push("path="+r),ce.isString(s)&&c.push("domain="+s),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function mV(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function pV(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xN(e,t,n){let r=!mV(t);return e&&(r||n==!1)?pV(e,t):t}const B1=e=>e instanceof Ur?{...e}:e;function ll(e,t){t=t||{};const n={};function r(m,g,v,x){return ce.isPlainObject(m)&&ce.isPlainObject(g)?ce.merge.call({caseless:x},m,g):ce.isPlainObject(g)?ce.merge({},g):ce.isArray(g)?g.slice():g}function s(m,g,v,x){if(ce.isUndefined(g)){if(!ce.isUndefined(m))return r(void 0,m,v,x)}else return r(m,g,v,x)}function l(m,g){if(!ce.isUndefined(g))return r(void 0,g)}function c(m,g){if(ce.isUndefined(g)){if(!ce.isUndefined(m))return r(void 0,m)}else return r(void 0,g)}function d(m,g,v){if(v in t)return r(m,g);if(v in e)return r(void 0,m)}const h={url:l,method:l,data:l,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:d,headers:(m,g,v)=>s(B1(m),B1(g),v,!0)};return ce.forEach(Object.keys({...e,...t}),function(g){const v=h[g]||s,x=v(e[g],t[g],g);ce.isUndefined(x)&&v!==d||(n[g]=x)}),n}const bN=e=>{const t=ll({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:l,headers:c,auth:d}=t;t.headers=c=Ur.from(c),t.url=mN(xN(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let h;if(ce.isFormData(n)){if(gr.hasStandardBrowserEnv||gr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((h=c.getContentType())!==!1){const[m,...g]=h?h.split(";").map(v=>v.trim()).filter(Boolean):[];c.setContentType([m||"multipart/form-data",...g].join("; "))}}if(gr.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(t)),r||r!==!1&&fV(t.url))){const m=s&&l&&hV.read(l);m&&c.set(s,m)}return t},gV=typeof XMLHttpRequest<"u",vV=gV&&function(e){return new Promise(function(n,r){const s=bN(e);let l=s.data;const c=Ur.from(s.headers).normalize();let{responseType:d,onUploadProgress:h,onDownloadProgress:m}=s,g,v,x,b,w;function C(){b&&b(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(g),s.signal&&s.signal.removeEventListener("abort",g)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function R(){if(!E)return;const _=Ur.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),A={data:!d||d==="text"||d==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:_,config:e,request:E};yN(function(D){n(D),C()},function(D){r(D),C()},A),E=null}"onloadend"in E?E.onloadend=R:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(R)},E.onabort=function(){E&&(r(new ft("Request aborted",ft.ECONNABORTED,e,E)),E=null)},E.onerror=function(){r(new ft("Network Error",ft.ERR_NETWORK,e,E)),E=null},E.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||pN;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new ft(O,A.clarifyTimeoutError?ft.ETIMEDOUT:ft.ECONNABORTED,e,E)),E=null},l===void 0&&c.setContentType(null),"setRequestHeader"in E&&ce.forEach(c.toJSON(),function(O,A){E.setRequestHeader(A,O)}),ce.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),d&&d!=="json"&&(E.responseType=s.responseType),m&&([x,w]=Zm(m,!0),E.addEventListener("progress",x)),h&&E.upload&&([v,b]=Zm(h),E.upload.addEventListener("progress",v),E.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(g=_=>{E&&(r(!_||_.type?new Zc(null,e,E):_),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(g),s.signal&&(s.signal.aborted?g():s.signal.addEventListener("abort",g)));const T=cV(s.url);if(T&&gr.protocols.indexOf(T)===-1){r(new ft("Unsupported protocol "+T+":",ft.ERR_BAD_REQUEST,e));return}E.send(l||null)})},yV=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const l=function(m){if(!s){s=!0,d();const g=m instanceof Error?m:this.reason;r.abort(g instanceof ft?g:new Zc(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,l(new ft(`timeout ${t} of ms exceeded`,ft.ETIMEDOUT))},t);const d=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(l):m.removeEventListener("abort",l)}),e=null)};e.forEach(m=>m.addEventListener("abort",l));const{signal:h}=r;return h.unsubscribe=()=>ce.asap(d),h}},xV=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},bV=async function*(e,t){for await(const n of SV(e))yield*xV(n,t)},SV=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()}},G1=(e,t,n,r)=>{const s=bV(e,t);let l=0,c,d=h=>{c||(c=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:m,value:g}=await s.next();if(m){d(),h.close();return}let v=g.byteLength;if(n){let x=l+=v;n(x)}h.enqueue(new Uint8Array(g))}catch(m){throw d(m),m}},cancel(h){return d(h),s.return()}},{highWaterMark:2})},Bp=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",SN=Bp&&typeof ReadableStream=="function",CV=Bp&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),CN=(e,...t)=>{try{return!!e(...t)}catch{return!1}},wV=SN&&CN(()=>{let e=!1;const t=new Request(gr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),q1=64*1024,tb=SN&&CN(()=>ce.isReadableStream(new Response("").body)),Ym={stream:tb&&(e=>e.body)};Bp&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ym[t]&&(Ym[t]=ce.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ft(`Response type '${t}' is not supported`,ft.ERR_NOT_SUPPORT,r)})})})(new Response);const EV=async e=>{if(e==null)return 0;if(ce.isBlob(e))return e.size;if(ce.isSpecCompliantForm(e))return(await new Request(gr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(e)||ce.isArrayBuffer(e))return e.byteLength;if(ce.isURLSearchParams(e)&&(e=e+""),ce.isString(e))return(await CV(e)).byteLength},RV=async(e,t)=>{const n=ce.toFiniteNumber(e.getContentLength());return n??EV(t)},TV=Bp&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:l,timeout:c,onDownloadProgress:d,onUploadProgress:h,responseType:m,headers:g,withCredentials:v="same-origin",fetchOptions:x}=bN(e);m=m?(m+"").toLowerCase():"text";let b=yV([s,l&&l.toAbortSignal()],c),w;const C=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let E;try{if(h&&wV&&n!=="get"&&n!=="head"&&(E=await RV(g,r))!==0){let A=new Request(t,{method:"POST",body:r,duplex:"half"}),j;if(ce.isFormData(r)&&(j=A.headers.get("content-type"))&&g.setContentType(j),A.body){const[D,k]=z1(E,Zm($1(h)));r=G1(A.body,q1,D,k)}}ce.isString(v)||(v=v?"include":"omit");const R="credentials"in Request.prototype;w=new Request(t,{...x,signal:b,method:n.toUpperCase(),headers:g.normalize().toJSON(),body:r,duplex:"half",credentials:R?v:void 0});let T=await fetch(w,x);const _=tb&&(m==="stream"||m==="response");if(tb&&(d||_&&C)){const A={};["status","statusText","headers"].forEach(V=>{A[V]=T[V]});const j=ce.toFiniteNumber(T.headers.get("content-length")),[D,k]=d&&z1(j,Zm($1(d),!0))||[];T=new Response(G1(T.body,q1,D,()=>{k&&k(),C&&C()}),A)}m=m||"text";let O=await Ym[ce.findKey(Ym,m)||"text"](T,e);return!_&&C&&C(),await new Promise((A,j)=>{yN(A,j,{data:O,headers:Ur.from(T.headers),status:T.status,statusText:T.statusText,config:e,request:w})})}catch(R){throw C&&C(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new ft("Network Error",ft.ERR_NETWORK,e,w),{cause:R.cause||R}):ft.from(R,R&&R.code,e,w)}}),nb={http:VH,xhr:vV,fetch:TV};ce.forEach(nb,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const K1=e=>`- ${e}`,_V=e=>ce.isFunction(e)||e===null||e===!1,wN={getAdapter:e=>{e=ce.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let l=0;l<t;l++){n=e[l];let c;if(r=n,!_V(n)&&(r=nb[(c=String(n)).toLowerCase()],r===void 0))throw new ft(`Unknown adapter '${c}'`);if(r)break;s[c||"#"+l]=r}if(!r){const l=Object.entries(s).map(([d,h])=>`adapter ${d} `+(h===!1?"is not supported by the environment":"is not available in the build"));let c=t?l.length>1?`since :
453
+ `+l.map(K1).join(`
454
+ `):" "+K1(l[0]):"as no adapter specified";throw new ft("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return r},adapters:nb};function ex(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Zc(null,e)}function Z1(e){return ex(e),e.headers=Ur.from(e.headers),e.data=Jy.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),wN.getAdapter(e.adapter||pf.adapter)(e).then(function(r){return ex(e),r.data=Jy.call(e,e.transformResponse,r),r.headers=Ur.from(r.headers),r},function(r){return vN(r)||(ex(e),r&&r.response&&(r.response.data=Jy.call(e,e.transformResponse,r.response),r.response.headers=Ur.from(r.response.headers))),Promise.reject(r)})}const EN="1.11.0",Gp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Gp[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Y1={};Gp.transitional=function(t,n,r){function s(l,c){return"[Axios v"+EN+"] Transitional option '"+l+"'"+c+(r?". "+r:"")}return(l,c,d)=>{if(t===!1)throw new ft(s(c," has been removed"+(n?" in "+n:"")),ft.ERR_DEPRECATED);return n&&!Y1[c]&&(Y1[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,c,d):!0}};Gp.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function jV(e,t,n){if(typeof e!="object")throw new ft("options must be an object",ft.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const l=r[s],c=t[l];if(c){const d=e[l],h=d===void 0||c(d,l,e);if(h!==!0)throw new ft("option "+l+" must be "+h,ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ft("Unknown option "+l,ft.ERR_BAD_OPTION)}}const pm={assertOptions:jV,validators:Gp},ls=pm.validators;let Ji=class{constructor(t){this.defaults=t||{},this.interceptors={request:new H1,response:new H1}}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 l=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
455
+ `+l):r.stack=l}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ll(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:l}=n;r!==void 0&&pm.assertOptions(r,{silentJSONParsing:ls.transitional(ls.boolean),forcedJSONParsing:ls.transitional(ls.boolean),clarifyTimeoutError:ls.transitional(ls.boolean)},!1),s!=null&&(ce.isFunction(s)?n.paramsSerializer={serialize:s}:pm.assertOptions(s,{encode:ls.function,serialize:ls.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),pm.assertOptions(n,{baseUrl:ls.spelling("baseURL"),withXsrfToken:ls.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=l&&ce.merge(l.common,l[n.method]);l&&ce.forEach(["delete","get","head","post","put","patch","common"],w=>{delete l[w]}),n.headers=Ur.concat(c,l);const d=[];let h=!0;this.interceptors.request.forEach(function(C){typeof C.runWhen=="function"&&C.runWhen(n)===!1||(h=h&&C.synchronous,d.unshift(C.fulfilled,C.rejected))});const m=[];this.interceptors.response.forEach(function(C){m.push(C.fulfilled,C.rejected)});let g,v=0,x;if(!h){const w=[Z1.bind(this),void 0];for(w.unshift(...d),w.push(...m),x=w.length,g=Promise.resolve(n);v<x;)g=g.then(w[v++],w[v++]);return g}x=d.length;let b=n;for(v=0;v<x;){const w=d[v++],C=d[v++];try{b=w(b)}catch(E){C.call(this,E);break}}try{g=Z1.call(this,b)}catch(w){return Promise.reject(w)}for(v=0,x=m.length;v<x;)g=g.then(m[v++],m[v++]);return g}getUri(t){t=ll(this.defaults,t);const n=xN(t.baseURL,t.url,t.allowAbsoluteUrls);return mN(n,t.params,t.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(t){Ji.prototype[t]=function(n,r){return this.request(ll(r||{},{method:t,url:n,data:(r||{}).data}))}});ce.forEach(["post","put","patch"],function(t){function n(r){return function(l,c,d){return this.request(ll(d||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}Ji.prototype[t]=n(),Ji.prototype[t+"Form"]=n(!0)});let NV=class RN{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const r=this;this.promise.then(s=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](s);r._listeners=null}),this.promise.then=s=>{let l;const c=new Promise(d=>{r.subscribe(d),l=d}).then(s);return c.cancel=function(){r.unsubscribe(l)},c},t(function(l,c,d){r.reason||(r.reason=new Zc(l,c,d),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 RN(function(s){t=s}),cancel:t}}};function AV(e){return function(n){return e.apply(null,n)}}function DV(e){return ce.isObject(e)&&e.isAxiosError===!0}const rb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rb).forEach(([e,t])=>{rb[t]=e});function TN(e){const t=new Ji(e),n=nN(Ji.prototype.request,t);return ce.extend(n,Ji.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return TN(ll(e,s))},n}const bn=TN(pf);bn.Axios=Ji;bn.CanceledError=Zc;bn.CancelToken=NV;bn.isCancel=vN;bn.VERSION=EN;bn.toFormData=$p;bn.AxiosError=ft;bn.Cancel=bn.CanceledError;bn.all=function(t){return Promise.all(t)};bn.spread=AV;bn.isAxiosError=DV;bn.mergeConfig=ll;bn.AxiosHeaders=Ur;bn.formToJSON=e=>gN(ce.isHTMLForm(e)?new FormData(e):e);bn.getAdapter=wN.getAdapter;bn.HttpStatusCode=rb;bn.default=bn;const{Axios:Yte,AxiosError:Wte,CanceledError:Qte,isCancel:Xte,CancelToken:Jte,VERSION:ene,all:tne,Cancel:nne,isAxiosError:rne,spread:ane,toFormData:sne,AxiosHeaders:one,HttpStatusCode:ine,formToJSON:lne,getAdapter:cne,mergeConfig:une}=bn,Fd={SIGN_IN:"/auth/sign-in",SIGN_OUT:"/auth/sign-out",ACCESS_TOKEN:"/auth/access-token",API_USER:"/auth/api/user"};function OV(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 _N=bn.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function MV(){const e=window.location.pathname+window.location.search,t=new URL(Fd.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function kV(){const e=new URL(Fd.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",Fd.SIGN_IN),window.location.href=e.toString()}async function W1(){try{return(await _N.post(Fd.ACCESS_TOKEN,{})).data}catch(e){const t=OV(e);throw new Error(t.message)}}async function IV(e){return(await _N.get(Fd.API_USER,{headers:{Authorization:`Bearer ${e}`}})).data}class LV{constructor(t,n){is(this,"getToken");is(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let R0=null;function PV(e){R0=e}function jN(){return R0}function dc(){R0=null}function UV(e,t){switch(t.type){case"SET_LOADING":return{...e,status:ms.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:ms.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:ms.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:ms.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const FV={status:ms.LOADING,session:null,user:null};function HV({children:e}){var m;const[t,n]=p.useReducer(UV,FV);p.useEffect(()=>{var g;if((g=t.session)!=null&&g.accessToken){const v=new LV(()=>{var x;return((x=t.session)==null?void 0:x.accessToken)??null},async()=>(await W1()).accessToken);PV(v)}else dc()},[(m=t.session)==null?void 0:m.accessToken]);const r=p.useCallback(()=>{MV()},[]),s=p.useCallback(async()=>{try{const v=(await W1()).accessToken;if(!v)throw new Error("Invalid token received");const x={accessToken:v},b=await IV(v);n({type:"SET_USER",payload:{user:b}}),n({type:"SET_AUTHENTICATED",payload:{session:x}})}catch(g){throw dc(),n({type:"SET_UNAUTHENTICATED"}),g}},[]),l=p.useCallback(async()=>{try{n({type:"SET_LOADING"});try{await s()}catch{n({type:"SET_UNAUTHENTICATED"}),r()}}catch(g){console.error("Failed to initialize auth:",g),dc(),n({type:"SET_UNAUTHENTICATED"})}},[s,r]),c=p.useCallback(()=>{dc(),n({type:"SET_UNAUTHENTICATED"}),kV()},[]),d=p.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);p.useEffect(()=>{l()},[l]),p.useEffect(()=>{const g=()=>{dc(),n({type:"SET_UNAUTHENTICATED"})},v=x=>{n({type:"SET_ERROR",payload:x.detail.message??"Access forbidden"})};return window.addEventListener("auth:logout",g),window.addEventListener("auth:forbidden",v),()=>{window.removeEventListener("auth:logout",g),window.removeEventListener("auth:forbidden",v),dc()}},[]);const h={...t,signIn:r,signOut:c,refreshToken:s,clearError:d};return o.jsx(tN.Provider,{value:h,children:e})}function NN(){const e=p.useContext(tN);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function VV(){const{status:e,session:t,user:n,error:r}=NN();return{status:e,session:t,user:n,error:r,isLoading:e===ms.LOADING,isAuthenticated:e===ms.AUTHENTICATED,isUnauthenticated:e===ms.UNAUTHENTICATED,hasError:e===ms.ERROR}}var zV=(e,t,n,r,s,l,c,d)=>{let h=document.documentElement,m=["light","dark"];function g(b){(Array.isArray(e)?e:[e]).forEach(w=>{let C=w==="class",E=C&&l?s.map(R=>l[R]||R):s;C?(h.classList.remove(...E),h.classList.add(l&&l[b]?l[b]:b)):h.setAttribute(w,b)}),v(b)}function v(b){d&&m.includes(b)&&(h.style.colorScheme=b)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)g(r);else try{let b=localStorage.getItem(t)||n,w=c&&b==="system"?x():b;g(w)}catch{}},Q1=["light","dark"],AN="(prefers-color-scheme: dark)",$V=typeof window>"u",T0=p.createContext(void 0),BV={setTheme:e=>{},themes:[]},DN=()=>{var e;return(e=p.useContext(T0))!=null?e:BV},GV=e=>p.useContext(T0)?p.createElement(p.Fragment,null,e.children):p.createElement(KV,{...e}),qV=["light","dark"],KV=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:l=qV,defaultTheme:c=n?"system":"light",attribute:d="data-theme",value:h,children:m,nonce:g,scriptProps:v})=>{let[x,b]=p.useState(()=>YV(s,c)),[w,C]=p.useState(()=>x==="system"?tx():x),E=h?Object.values(h):l,R=p.useCallback(A=>{let j=A;if(!j)return;A==="system"&&n&&(j=tx());let D=h?h[j]:j,k=t?WV(g):null,V=document.documentElement,B=z=>{z==="class"?(V.classList.remove(...E),D&&V.classList.add(D)):z.startsWith("data-")&&(D?V.setAttribute(z,D):V.removeAttribute(z))};if(Array.isArray(d)?d.forEach(B):B(d),r){let z=Q1.includes(c)?c:null,J=Q1.includes(j)?j:z;V.style.colorScheme=J}k==null||k()},[g]),T=p.useCallback(A=>{let j=typeof A=="function"?A(x):A;b(j);try{localStorage.setItem(s,j)}catch{}},[x]),_=p.useCallback(A=>{let j=tx(A);C(j),x==="system"&&n&&!e&&R("system")},[x,e]);p.useEffect(()=>{let A=window.matchMedia(AN);return A.addListener(_),_(A),()=>A.removeListener(_)},[_]),p.useEffect(()=>{let A=j=>{j.key===s&&(j.newValue?b(j.newValue):T(c))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[T]),p.useEffect(()=>{R(e??x)},[e,x]);let O=p.useMemo(()=>({theme:x,setTheme:T,forcedTheme:e,resolvedTheme:x==="system"?w:x,themes:n?[...l,"system"]:l,systemTheme:n?w:void 0}),[x,T,e,w,n,l]);return p.createElement(T0.Provider,{value:O},p.createElement(ZV,{forcedTheme:e,storageKey:s,attribute:d,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:h,themes:l,nonce:g,scriptProps:v}),m)},ZV=p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:l,value:c,themes:d,nonce:h,scriptProps:m})=>{let g=JSON.stringify([n,t,l,e,d,c,r,s]).slice(1,-1);return p.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(${zV.toString()})(${g})`}})}),YV=(e,t)=>{if($V)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},WV=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)}},tx=e=>(e||(e=window.matchMedia(AN)),e.matches?"dark":"light");function QV(e,t){var n,r,s,l;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():((l=(s=c[0])==null?void 0:s[0])==null?void 0:l.toUpperCase())||""}if(t!=null&&t.includes("@")){const c=t.split("@")[0];return c.length>2?`${c[0]}${c[1]}`.toUpperCase():c[0].toUpperCase()}return"U"}function XV(){const{user:e,signOut:t}=NN(),{setTheme:n,theme:r}=DN(),[s,l]=p.useState(!1);if(!e)return null;const c=QV(e.fullName,e.email),d=e.fullName??e.email??"Unknown User",h=[{title:`Switch to ${r==="light"?"dark":"light"} mode`,icon:r==="light"?B5:m6,onClick:()=>{n(r==="light"?"dark":"light")}},{title:"Sign out",icon:L5,onClick:t,className:"text-red-600 focus:text-red-600"}];return o.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(xr,{open:s,onOpenChange:l,children:[o.jsx(br,{asChild:!0,children:o.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":s?"true":"false","aria-haspopup":"menu","aria-expanded":s,"data-state":s?"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:[o.jsx("div",{className:"text-muted-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white text-sm font-medium dark:bg-white/10",children:e.avatar?o.jsx("img",{src:e.avatar,alt:d,className:"size-full rounded-full object-cover"}):o.jsx("span",{children:c})}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[o.jsx("span",{className:"truncate font-medium",children:d}),e.email&&e.fullName&&o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]}),o.jsx(Oa,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${s?"rotate-180":""}`})]})}),o.jsx(cr,{align:"start",side:"top",sideOffset:8,className:"w-56",children:h.map((m,g)=>{const v=m.icon,x=m.title==="Sign out";return o.jsxs("div",{children:[x&&o.jsx(Aa,{}),o.jsxs(Ft,{onClick:m.onClick,className:`flex items-center gap-2 ${m.className??""}`,children:[o.jsx(v,{className:"size-4"}),m.title]})]},`${m.title}-${String(g)}`)})})]})})}const JV=[{title:"Data Marts",url:"/data-marts",icon:$L},{title:"Storages",url:"/data-storages",icon:jm},{title:"Destinations",url:"/data-destinations",icon:Bb}];function ez({variant:e="inset",collapsible:t="icon"}){return o.jsxs(RU,{variant:e,collapsible:t,children:[o.jsx(NU,{children:o.jsx(tH,{})}),o.jsxs(DU,{children:[o.jsx(E1,{children:o.jsx(R1,{children:o.jsxs(Tm,{to:"/data-marts/create","data-sidebar":"menu-button","data-size":"md",className:"peer/menu-button ring-sidebar-ring bg-primary hover:bg-primary-hover text-primary-foreground hover:text-primary-foreground flex h-8 w-full items-center gap-2 overflow-hidden rounded-full p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[o.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:o.jsx(ha,{className:"size-4 shrink-0"})}),o.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:o.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})})}),o.jsx(E1,{children:o.jsx(R1,{children:o.jsx(OU,{children:JV.map(n=>o.jsx(MU,{children:o.jsx(Tm,{to:n.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:o.jsxs(Dt,{delayDuration:500,children:[o.jsx(Ot,{asChild:!0,children:o.jsxs(IU,{children:[p.createElement(n.icon,{className:"size-4 shrink-0 transition-all "}),o.jsx("span",{children:n.title})]})}),o.jsx(Mt,{side:"right",children:n.title})]})})},n.title))})})})]}),o.jsx(AU,{className:"py-2",children:o.jsx(XV,{})}),o.jsx(_U,{})]})}function tz({children:e,...t}){return o.jsx(GV,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}let nz={data:""},rz=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||nz,az=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,sz=/\/\*[^]*?\*\/| +/g,X1=/\n+/g,Yo=(e,t)=>{let n="",r="",s="";for(let l in e){let c=e[l];l[0]=="@"?l[1]=="i"?n=l+" "+c+";":r+=l[1]=="f"?Yo(c,l):l+"{"+Yo(c,l[1]=="k"?"":t)+"}":typeof c=="object"?r+=Yo(c,t?t.replace(/([^,])+/g,d=>l.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,h=>/&/.test(h)?h.replace(/&/g,d):d?d+" "+h:h)):l):c!=null&&(l=/^--/.test(l)?l:l.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Yo.p?Yo.p(l,c):l+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Ys={},ON=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+ON(e[n]);return t}return e},oz=(e,t,n,r,s)=>{let l=ON(e),c=Ys[l]||(Ys[l]=(h=>{let m=0,g=11;for(;m<h.length;)g=101*g+h.charCodeAt(m++)>>>0;return"go"+g})(l));if(!Ys[c]){let h=l!==e?e:(m=>{let g,v,x=[{}];for(;g=az.exec(m.replace(sz,""));)g[4]?x.shift():g[3]?(v=g[3].replace(X1," ").trim(),x.unshift(x[0][v]=x[0][v]||{})):x[0][g[1]]=g[2].replace(X1," ").trim();return x[0]})(e);Ys[c]=Yo(s?{["@keyframes "+c]:h}:h,n?"":"."+c)}let d=n&&Ys.g?Ys.g:null;return n&&(Ys.g=Ys[c]),((h,m,g,v)=>{v?m.data=m.data.replace(v,h):m.data.indexOf(h)===-1&&(m.data=g?h+m.data:m.data+h)})(Ys[c],t,r,d),c},iz=(e,t,n)=>e.reduce((r,s,l)=>{let c=t[l];if(c&&c.call){let d=c(n),h=d&&d.props&&d.props.className||/^go/.test(d)&&d;c=h?"."+h:d&&typeof d=="object"?d.props?"":Yo(d,""):d===!1?"":d}return r+s+(c??"")},"");function qp(e){let t=this||{},n=e.call?e(t.p):e;return oz(n.unshift?n.raw?iz(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,rz(t.target),t.g,t.o,t.k)}let MN,ab,sb;qp.bind({g:1});let fo=qp.bind({k:1});function lz(e,t,n,r){Yo.p=t,MN=e,ab=n,sb=r}function Si(e,t){let n=this||{};return function(){let r=arguments;function s(l,c){let d=Object.assign({},l),h=d.className||s.className;n.p=Object.assign({theme:ab&&ab()},d),n.o=/ *go\d+/.test(h),d.className=qp.apply(n,r)+(h?" "+h:"");let m=e;return e[0]&&(m=d.as||e,delete d.as),sb&&m[0]&&sb(d),MN(m,d)}return s}}var cz=e=>typeof e=="function",Wm=(e,t)=>cz(e)?e(t):e,uz=(()=>{let e=0;return()=>(++e).toString()})(),kN=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),dz=20,_0="default",IN=(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 IN(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 l=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(c=>({...c,pauseDuration:c.pauseDuration+l}))}}},gm=[],LN={toasts:[],pausedAt:void 0,settings:{toastLimit:dz}},ps={},PN=(e,t=_0)=>{ps[t]=IN(ps[t]||LN,e),gm.forEach(([n,r])=>{n===t&&r(ps[t])})},UN=e=>Object.keys(ps).forEach(t=>PN(e,t)),fz=e=>Object.keys(ps).find(t=>ps[t].toasts.some(n=>n.id===e)),Kp=(e=_0)=>t=>{PN(t,e)},hz={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},mz=(e={},t=_0)=>{let[n,r]=p.useState(ps[t]||LN),s=p.useRef(ps[t]);p.useEffect(()=>(s.current!==ps[t]&&r(ps[t]),gm.push([t,r]),()=>{let c=gm.findIndex(([d])=>d===t);c>-1&&gm.splice(c,1)}),[t]);let l=n.toasts.map(c=>{var d,h,m;return{...e,...e[c.type],...c,removeDelay:c.removeDelay||((d=e[c.type])==null?void 0:d.removeDelay)||(e==null?void 0:e.removeDelay),duration:c.duration||((h=e[c.type])==null?void 0:h.duration)||(e==null?void 0:e.duration)||hz[c.type],style:{...e.style,...(m=e[c.type])==null?void 0:m.style,...c.style}}});return{...n,toasts:l}},pz=(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)||uz()}),gf=e=>(t,n)=>{let r=pz(t,e,n);return Kp(r.toasterId||fz(r.id))({type:2,toast:r}),r.id},Vt=(e,t)=>gf("blank")(e,t);Vt.error=gf("error");Vt.success=gf("success");Vt.loading=gf("loading");Vt.custom=gf("custom");Vt.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Kp(t)(n):UN(n)};Vt.dismissAll=e=>Vt.dismiss(void 0,e);Vt.remove=(e,t)=>{let n={type:4,toastId:e};t?Kp(t)(n):UN(n)};Vt.removeAll=e=>Vt.remove(void 0,e);Vt.promise=(e,t,n)=>{let r=Vt.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let l=t.success?Wm(t.success,s):void 0;return l?Vt.success(l,{id:r,...n,...n==null?void 0:n.success}):Vt.dismiss(r),s}).catch(s=>{let l=t.error?Wm(t.error,s):void 0;l?Vt.error(l,{id:r,...n,...n==null?void 0:n.error}):Vt.dismiss(r)}),e};var gz=1e3,vz=(e,t="default")=>{let{toasts:n,pausedAt:r}=mz(e,t),s=p.useRef(new Map).current,l=p.useCallback((v,x=gz)=>{if(s.has(v))return;let b=setTimeout(()=>{s.delete(v),c({type:4,toastId:v})},x);s.set(v,b)},[]);p.useEffect(()=>{if(r)return;let v=Date.now(),x=n.map(b=>{if(b.duration===1/0)return;let w=(b.duration||0)+b.pauseDuration-(v-b.createdAt);if(w<0){b.visible&&Vt.dismiss(b.id);return}return setTimeout(()=>Vt.dismiss(b.id,t),w)});return()=>{x.forEach(b=>b&&clearTimeout(b))}},[n,r,t]);let c=p.useCallback(Kp(t),[t]),d=p.useCallback(()=>{c({type:5,time:Date.now()})},[c]),h=p.useCallback((v,x)=>{c({type:1,toast:{id:v,height:x}})},[c]),m=p.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),g=p.useCallback((v,x)=>{let{reverseOrder:b=!1,gutter:w=8,defaultPosition:C}=x||{},E=n.filter(_=>(_.position||C)===(v.position||C)&&_.height),R=E.findIndex(_=>_.id===v.id),T=E.filter((_,O)=>O<R&&_.visible).length;return E.filter(_=>_.visible).slice(...b?[T+1]:[0,T]).reduce((_,O)=>_+(O.height||0)+w,0)},[n]);return p.useEffect(()=>{n.forEach(v=>{if(v.dismissed)l(v.id,v.removeDelay);else{let x=s.get(v.id);x&&(clearTimeout(x),s.delete(v.id))}})},[n,l]),{toasts:n,handlers:{updateHeight:h,startPause:d,endPause:m,calculateOffset:g}}},yz=fo`
456
+ from {
457
+ transform: scale(0) rotate(45deg);
458
+ opacity: 0;
459
+ }
460
+ to {
461
+ transform: scale(1) rotate(45deg);
462
+ opacity: 1;
463
+ }`,xz=fo`
464
+ from {
465
+ transform: scale(0);
466
+ opacity: 0;
467
+ }
468
+ to {
469
+ transform: scale(1);
470
+ opacity: 1;
471
+ }`,bz=fo`
472
+ from {
473
+ transform: scale(0) rotate(90deg);
474
+ opacity: 0;
475
+ }
476
+ to {
477
+ transform: scale(1) rotate(90deg);
478
+ opacity: 1;
479
+ }`,Sz=Si("div")`
480
+ width: 20px;
481
+ opacity: 0;
482
+ height: 20px;
483
+ border-radius: 10px;
484
+ background: ${e=>e.primary||"#ff4b4b"};
485
+ position: relative;
486
+ transform: rotate(45deg);
487
+
488
+ animation: ${yz} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
489
+ forwards;
490
+ animation-delay: 100ms;
491
+
492
+ &:after,
493
+ &:before {
494
+ content: '';
495
+ animation: ${xz} 0.15s ease-out forwards;
496
+ animation-delay: 150ms;
497
+ position: absolute;
498
+ border-radius: 3px;
499
+ opacity: 0;
500
+ background: ${e=>e.secondary||"#fff"};
501
+ bottom: 9px;
502
+ left: 4px;
503
+ height: 2px;
504
+ width: 12px;
505
+ }
506
+
507
+ &:before {
508
+ animation: ${bz} 0.15s ease-out forwards;
509
+ animation-delay: 180ms;
510
+ transform: rotate(90deg);
511
+ }
512
+ `,Cz=fo`
513
+ from {
514
+ transform: rotate(0deg);
515
+ }
516
+ to {
517
+ transform: rotate(360deg);
518
+ }
519
+ `,wz=Si("div")`
520
+ width: 12px;
521
+ height: 12px;
522
+ box-sizing: border-box;
523
+ border: 2px solid;
524
+ border-radius: 100%;
525
+ border-color: ${e=>e.secondary||"#e0e0e0"};
526
+ border-right-color: ${e=>e.primary||"#616161"};
527
+ animation: ${Cz} 1s linear infinite;
528
+ `,Ez=fo`
529
+ from {
530
+ transform: scale(0) rotate(45deg);
531
+ opacity: 0;
532
+ }
533
+ to {
534
+ transform: scale(1) rotate(45deg);
535
+ opacity: 1;
536
+ }`,Rz=fo`
537
+ 0% {
538
+ height: 0;
539
+ width: 0;
540
+ opacity: 0;
541
+ }
542
+ 40% {
543
+ height: 0;
544
+ width: 6px;
545
+ opacity: 1;
546
+ }
547
+ 100% {
548
+ opacity: 1;
549
+ height: 10px;
550
+ }`,Tz=Si("div")`
551
+ width: 20px;
552
+ opacity: 0;
553
+ height: 20px;
554
+ border-radius: 10px;
555
+ background: ${e=>e.primary||"#61d345"};
556
+ position: relative;
557
+ transform: rotate(45deg);
558
+
559
+ animation: ${Ez} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
560
+ forwards;
561
+ animation-delay: 100ms;
562
+ &:after {
563
+ content: '';
564
+ box-sizing: border-box;
565
+ animation: ${Rz} 0.2s ease-out forwards;
566
+ opacity: 0;
567
+ animation-delay: 200ms;
568
+ position: absolute;
569
+ border-right: 2px solid;
570
+ border-bottom: 2px solid;
571
+ border-color: ${e=>e.secondary||"#fff"};
572
+ bottom: 6px;
573
+ left: 6px;
574
+ height: 10px;
575
+ width: 6px;
576
+ }
577
+ `,_z=Si("div")`
578
+ position: absolute;
579
+ `,jz=Si("div")`
580
+ position: relative;
581
+ display: flex;
582
+ justify-content: center;
583
+ align-items: center;
584
+ min-width: 20px;
585
+ min-height: 20px;
586
+ `,Nz=fo`
587
+ from {
588
+ transform: scale(0.6);
589
+ opacity: 0.4;
590
+ }
591
+ to {
592
+ transform: scale(1);
593
+ opacity: 1;
594
+ }`,Az=Si("div")`
595
+ position: relative;
596
+ transform: scale(0.6);
597
+ opacity: 0.4;
598
+ min-width: 20px;
599
+ animation: ${Nz} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
600
+ forwards;
601
+ `,Dz=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?p.createElement(Az,null,t):t:n==="blank"?null:p.createElement(jz,null,p.createElement(wz,{...r}),n!=="loading"&&p.createElement(_z,null,n==="error"?p.createElement(Sz,{...r}):p.createElement(Tz,{...r})))},Oz=e=>`
602
+ 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
603
+ 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
604
+ `,Mz=e=>`
605
+ 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
606
+ 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
607
+ `,kz="0%{opacity:0;} 100%{opacity:1;}",Iz="0%{opacity:1;} 100%{opacity:0;}",Lz=Si("div")`
608
+ display: flex;
609
+ align-items: center;
610
+ background: #fff;
611
+ color: #363636;
612
+ line-height: 1.3;
613
+ will-change: transform;
614
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
615
+ max-width: 350px;
616
+ pointer-events: auto;
617
+ padding: 8px 10px;
618
+ border-radius: 8px;
619
+ `,Pz=Si("div")`
620
+ display: flex;
621
+ justify-content: center;
622
+ margin: 4px 10px;
623
+ color: inherit;
624
+ flex: 1 1 auto;
625
+ white-space: pre-line;
626
+ `,Uz=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=kN()?[kz,Iz]:[Oz(n),Mz(n)];return{animation:t?`${fo(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${fo(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fz=p.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?Uz(e.position||t||"top-center",e.visible):{opacity:0},l=p.createElement(Dz,{toast:e}),c=p.createElement(Pz,{...e.ariaProps},Wm(e.message,e));return p.createElement(Lz,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:l,message:c}):p.createElement(p.Fragment,null,l,c))});lz(p.createElement);var Hz=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let l=p.useCallback(c=>{if(c){let d=()=>{let h=c.getBoundingClientRect().height;r(e,h)};d(),new MutationObserver(d).observe(c,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return p.createElement("div",{ref:l,className:t,style:n},s)},Vz=(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:kN()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},zz=qp`
627
+ z-index: 9999;
628
+ > * {
629
+ pointer-events: auto;
630
+ }
631
+ `,Yh=16,ni=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:l,containerStyle:c,containerClassName:d})=>{let{toasts:h,handlers:m}=vz(n,l);return p.createElement("div",{"data-rht-toaster":l||"",style:{position:"fixed",zIndex:9999,top:Yh,left:Yh,right:Yh,bottom:Yh,pointerEvents:"none",...c},className:d,onMouseEnter:m.startPause,onMouseLeave:m.endPause},h.map(g=>{let v=g.position||t,x=m.calculateOffset(g,{reverseOrder:e,gutter:r,defaultPosition:t}),b=Vz(v,x);return p.createElement(Hz,{id:g.id,key:g.id,onHeightUpdate:m.updateHeight,className:g.visible?zz:"",style:b},g.type==="custom"?Wm(g.message,g):s?s(g):p.createElement(Fz,{toast:g,position:v}))}))},ho=Vt;class $z{constructor(){is(this,"isRefreshingToken",!1);is(this,"refreshTokenPromise",null);is(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 Bz={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},_a=bn.create(Bz),ob=new $z;_a.interceptors.request.use(e=>{if(e.skipAuthHeader)return e;const t=jN(),n=(t==null?void 0:t.getAccessToken())??ob.getAccessToken();return n&&(e.headers.Authorization=`Bearer ${n}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));_a.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 l=jN();if(!l)throw new Error("No token provider available");const c=await ob.refreshToken(()=>l.refreshToken());return t.headers.Authorization=`Bearer ${c}`,await _a(t)}catch{return ob.clear(),window.dispatchEvent(new CustomEvent("auth:logout",{detail:{reason:"token_refresh_failed"}})),Promise.reject(new Error("Token refresh failed"))}}if(((r=e.response)==null?void 0:r.status)===403){const l=e.response.data;ho.error(l.message||"Access forbidden - insufficient permissions"),window.dispatchEvent(new CustomEvent("auth:forbidden",{detail:{message:l.message}}))}if(((s=e.response)==null?void 0:s.status)===400){const l=e.response.data;ho.error(l.message)}return Promise.reject(e)});class Yc{constructor(t){is(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await _a.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await _a.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await _a.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await _a.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await _a.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class Gz{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 Wo=new Gz;class qz{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const s=this.getTimezoneOffset(r,n),l=this.formatOffset(s),c=this.isDaylightSavingTime(r,n),d=this.getDisplayName(r,l);return{identifier:r,displayName:d,offsetMinutes:s,offsetString:l,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}),l=new Date(r.format(n)),c=new Date(s.format(n));return Math.round((c.getTime()-l.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),l=r%60;return`${n}${s.toString().padStart(2,"0")}:${l.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),l=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,s),d=this.getTimezoneOffset(t,n),h=Math.min(l,c);return d>h}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),l=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,s);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:s,isDST:l}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const Kz=new qz;function Zz({isLoading:e,className:t}){const[n,r]=p.useState(0),[s,l]=p.useState(!1);return p.useEffect(()=>{let c,d;return e?(l(!0),r(0),c=setInterval(()=>{r(h=>h<90?h+(90-h)/10:h)},200)):(r(100),d=setTimeout(()=>{l(!1)},300)),()=>{clearInterval(c),clearTimeout(d)}},[e]),o.jsx("div",{className:de("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!s&&"opacity-0",t),children:o.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const FN=p.createContext({isLoading:!1});function Yz({children:e}){const[t,n]=p.useState(0),r=t>0;return p.useEffect(()=>{const s=_a.interceptors.request.use(c=>(c.skipLoadingIndicator||n(d=>d+1),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c))),l=_a.interceptors.response.use(c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c)));return()=>{_a.interceptors.request.eject(s),_a.interceptors.response.eject(l)}},[]),o.jsx(FN.Provider,{value:{isLoading:r},children:e})}function Wz(){return p.useContext(FN)}function HN(){return o.jsx(ni,{position:"top-center",toastOptions:{duration:3e3,style:{background:"#363636",color:"#fff"},success:{style:{color:"#16a34a",background:"#fff"}},error:{style:{color:"#dc2626",background:"#fff"},duration:4e3}}})}function Qz({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 o.jsx("div",{className:s,children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&o.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function J1({message:e}){return o.jsx(Qz,{fullScreen:!0,message:e})}function eT(){return o.jsx("div",{className:"flex h-screen items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),o.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),o.jsx(we,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function Xz({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:l}=VV();return r?o.jsx(J1,{}):s?o.jsx(o.Fragment,{children:e}):l?n?(window.location.href=n,o.jsx(J1,{})):t?o.jsx(o.Fragment,{children:t}):o.jsx(eT,{}):t?o.jsx(o.Fragment,{children:t}):o.jsx(eT,{})}const tT="sidebar_state";function Jz(){const{state:e,isMobile:t}=of(),r=t||e==="collapsed",{isLoading:s}=Wz();return o.jsxs(o.Fragment,{children:[o.jsx(HN,{}),o.jsx(Zz,{isLoading:s}),o.jsxs(Xz,{redirectTo:"/auth/sign-in",children:[o.jsx(ez,{variant:"inset",collapsible:"icon"}),o.jsx(jU,{children:o.jsxs("div",{className:"relative h-full w-full",children:[r&&o.jsx("div",{className:"absolute top-7 left-4 z-10 md:hidden",children:o.jsx(TU,{})}),o.jsx(E_,{})]})})]})]})}function e$(){const[e,t]=p.useState(()=>Wo.get(tT,"boolean")??!0),n=r=>{t(r),Wo.set(tT,r)};return o.jsx(tz,{children:o.jsx(Yz,{children:o.jsx(EU,{open:e,onOpenChange:n,children:o.jsx(Jz,{})})})})}function t$(){return o.jsxs("div",{className:"app-container",children:[o.jsx("h1",{children:"About OWOX"}),o.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function n$(){return o.jsxs("div",{className:"app-container",children:[o.jsx("h1",{children:"404 - Page Not Found"}),o.jsx("p",{children:"The page you are looking for does not exist."}),o.jsx(gi,{to:"/",children:"Go back to home"})]})}const r$={items:[],loading:!1,error:null};function a$(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 VN=p.createContext(void 0);function s$({children:e}){const[t,n]=p.useReducer(a$,r$);return o.jsx(VN.Provider,{value:{state:t,dispatch:n},children:e})}function o$(){const e=p.useContext(VN);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class i$ extends Yc{constructor(){super("/data-marts")}async getDataMarts(){return this.get("/")}async getDataMartById(t){return this.get(`/${t}`)}async createDataMart(t){return this.post("",t)}async updateDataMart(t,n){return this.patch(`/${t}`,n)}async deleteDataMart(t){return this.delete(`/${t}`)}async updateDataMartDescription(t,n){return this.put(`/${t}/description`,{description:n})}async updateDataMartTitle(t,n){return this.put(`/${t}/title`,{title:n})}async updateDataMartDefinition(t,n){return this.put(`/${t}/definition`,n)}async publishDataMart(t){return this.put(`/${t}/publish`)}async runDataMart(t,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`)}async updateDataMartSchema(t,n){return this.put(`/${t}/schema`,n)}async validateSql(t,n,r,s=!0){const l={sql:n},c={...r?{signal:r.signal}:{},skipLoadingIndicator:s};return this.post(`/${t}/sql-dry-run`,l,c)}async getDataMartRuns(t,n=5,r=0){return(await this.get(`/${t}/runs`,{limit:n,offset:r})).runs}}const ir=new i$;var tr=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(tr||{}),Qe=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(Qe||{}),vm=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION_TYPE="MISSING_DEFINITION_TYPE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(vm||{});const l$={ALREADY_PUBLISHED:"Data mart is already published",INVALID_STORAGE:"Data mart must have a valid storage",MISSING_DEFINITION_TYPE:"Data mart must have an input source configured",MISSING_DEFINITION:"Data mart must have a valid definition"},zN={statuses:{[tr.DRAFT]:{code:tr.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[tr.PUBLISHED]:{code:tr.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},$N=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,BN=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,c$=e=>e?$N(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",u$=e=>e?BN(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",GN=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)},qN=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)},d$=e=>e?GN(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",f$=e=>e?qN(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required",h$=[{value:"US",label:"US (multiple regions)",group:"North America"},{value:"northamerica-northeast1",label:"Montréal",group:"North America"},{value:"northamerica-northeast2",label:"Toronto",group:"North America"},{value:"us-central1",label:"Iowa",group:"North America"},{value:"us-east1",label:"South Carolina",group:"North America"},{value:"us-east4",label:"Northern Virginia",group:"North America"},{value:"us-east5",label:"Columbus",group:"North America"},{value:"us-west1",label:"Oregon",group:"North America"},{value:"us-west2",label:"Los Angeles",group:"North America"},{value:"us-west3",label:"Salt Lake City",group:"North America"},{value:"us-west4",label:"Las Vegas",group:"North America"},{value:"EU",label:"EU (multiple regions)",group:"Europe"},{value:"europe-central2",label:"Warsaw",group:"Europe"},{value:"europe-north1",label:"Finland",group:"Europe"},{value:"europe-southwest1",label:"Madrid",group:"Europe"},{value:"europe-west1",label:"Belgium",group:"Europe"},{value:"europe-west2",label:"London",group:"Europe"},{value:"europe-west3",label:"Frankfurt",group:"Europe"},{value:"europe-west4",label:"Netherlands",group:"Europe"},{value:"europe-west6",label:"Zurich",group:"Europe"},{value:"europe-west8",label:"Milan",group:"Europe"},{value:"europe-west9",label:"Paris",group:"Europe"},{value:"europe-west12",label:"Turin",group:"Europe"},{value:"asia-east1",label:"Taiwan",group:"Asia Pacific"},{value:"asia-east2",label:"Hong Kong",group:"Asia Pacific"},{value:"asia-northeast1",label:"Tokyo",group:"Asia Pacific"},{value:"asia-northeast2",label:"Osaka",group:"Asia Pacific"},{value:"asia-northeast3",label:"Seoul",group:"Asia Pacific"},{value:"asia-south1",label:"Mumbai",group:"Asia Pacific"},{value:"asia-south2",label:"Delhi",group:"Asia Pacific"},{value:"asia-southeast1",label:"Singapore",group:"Asia Pacific"},{value:"asia-southeast2",label:"Jakarta",group:"Asia Pacific"},{value:"australia-southeast1",label:"Sydney",group:"Asia Pacific"},{value:"australia-southeast2",label:"Melbourne",group:"Asia Pacific"},{value:"southamerica-east1",label:"São Paulo",group:"Other"},{value:"southamerica-west1",label:"Santiago",group:"Other"},{value:"me-central1",label:"Doha",group:"Other"},{value:"me-central2",label:"Dammam",group:"Other"},{value:"me-west1",label:"Tel Aviv",group:"Other"},{value:"africa-south1",label:"Johannesburg",group:"Other"}];function m$(e){return"projectId"in e}function p$(e){return"outputBucket"in e}var Ie=(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))(Ie||{}),eo=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(eo||{});const g$=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,s=r==="";return o.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[o.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!s?o.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):o.jsx("span",{className:"text-sm",children:s||r===void 0?o.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},v$=({type:e,config:t})=>{const n={[Ie.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[Ie.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[Ie.SNOWFLAKE]:[],[Ie.DATABRICKS]:[],[Ie.AWS_REDSHIFT]:[],[Ie.AZURE_SYNAPSE]:[]},r=t&&(e===Ie.GOOGLE_BIGQUERY&&m$(t)||e===Ie.AWS_ATHENA&&p$(t));return o.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:l})=>{let c;return r&&(c=(e===Ie.GOOGLE_BIGQUERY,t[l])),o.jsx(g$,{label:s,value:c},l)})})},y$=({type:e,config:t})=>o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"space-y-1",children:[o.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),o.jsx(v$,{type:e,config:t})]})}),x$=Wd("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 Rr({className:e,variant:t,asChild:n=!1,...r}){const s=n?gp:"span";return o.jsx(s,{"data-slot":"badge",className:de(x$({variant:t}),e),...r})}function KN(e){return e.type===Ie.GOOGLE_BIGQUERY}function ZN(e){return e.type===Ie.AWS_ATHENA}const Ci={types:{[Ie.GOOGLE_BIGQUERY]:{type:Ie.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:h7,status:eo.ACTIVE},[Ie.AWS_ATHENA]:{type:Ie.AWS_ATHENA,displayName:"AWS Athena",icon:m7,status:eo.ACTIVE},[Ie.SNOWFLAKE]:{type:Ie.SNOWFLAKE,displayName:"Snowflake",icon:v7,status:eo.COMING_SOON},[Ie.DATABRICKS]:{type:Ie.DATABRICKS,displayName:"Databricks",icon:y7,status:eo.COMING_SOON},[Ie.AWS_REDSHIFT]:{type:Ie.AWS_REDSHIFT,displayName:"AWS Redshift",icon:x7,status:eo.COMING_SOON},[Ie.AZURE_SYNAPSE]:{type:Ie.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:b7,status:eo.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function b$({dataStorage:e,isLoading:t=!1}){if(t)return o.jsx("div",{className:"space-y-4",children:o.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,d)=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(pr,{className:"h-5 w-24"}),o.jsx(pr,{className:"h-6 w-40"})]},d))})});if(!e)return o.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:s,modifiedAt:l}=e;return o.jsx("div",{className:"space-y-2",children:o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:e.title}),o.jsx(Rr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:d}=Ci.getInfo(n);return o.jsxs(o.Fragment,{children:[o.jsx(d,{}),c]})})()})]}),o.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:o.jsx(y$,{type:n,config:r})}),o.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[o.jsxs("div",{children:[o.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))]}),o.jsxs("div",{children:[o.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(l))]})]})]})})}function S$(e){const t=e.split(".");return t.length!==2?(console.error("Invalid fully qualified name format:",e),null):{dataset:t[0],table:t[1]}}function C$(e,t,n){const r=encodeURIComponent(e),s=encodeURIComponent(t),l=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${s}!3s${l}`}function w$(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function E$(e,t){const n=S$(t);if(!n)return null;const{dataset:r,table:s}=n;return KN(e)?C$(e.config.projectId,r,s):ZN(e)?w$(e.config.region):null}function R$(e,t){const n=E$(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function T$(e){return KN(e)?"Open table in Google BigQuery":ZN(e)?"Open region in AWS Athena":"Open data in storage"}const _$=rn({accessKeyId:an().min(1,"Access Key ID is required"),secretAccessKey:an().min(1,"Secret Access Key is required")}),j$=rn({projectId:an().min(1,"Project ID is required"),location:an().min(1,"Location is required")}),N$=rn({region:an().min(1,"Region is required"),outputBucket:an().min(1,"Output Bucket is required")}),YN=rn({title:an().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),A$=YN.extend({type:Ns(Ie.GOOGLE_BIGQUERY),credentials:eN,config:j$}),D$=YN.extend({type:Ns(Ie.AWS_ATHENA),credentials:_$,config:N$}),O$=J2("type",[A$,D$]),M$=(e,t)=>{if(!e)return!1;switch(t){case Ie.GOOGLE_BIGQUERY:return $N(e);case Ie.AWS_ATHENA:return GN(e);default:return!1}},k$=(e,t)=>{if(!e)return!1;switch(t){case Ie.GOOGLE_BIGQUERY:return BN(e);case Ie.AWS_ATHENA:return qN(e);default:return!1}},I$=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case Ie.GOOGLE_BIGQUERY:return c$(e);case Ie.AWS_ATHENA:return d$(e);default:return"Unsupported storage type"}},L$=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case Ie.GOOGLE_BIGQUERY:return u$(e);case Ie.AWS_ATHENA:return f$(e);default:return"Unsupported storage type"}},WN=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"project.dataset.table";case Ie.AWS_ATHENA:return"database.table or catalog.database.table";default:return""}},P$=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"project.dataset.table_*";case Ie.AWS_ATHENA:return"database.table_* or catalog.database.table_*";default:return""}},QN=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case Ie.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";default:return""}},U$=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case Ie.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';default:return""}};var xn=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(xn||{});const F$={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:""},H$=e=>F$[e],V$={[xn.SUCCESS]:{icon:vp,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"}},[xn.ERROR]:{icon:Z5,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"}},[xn.WARNING]:{icon:Kb,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"}},[xn.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"}},[xn.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 vf({type:e=xn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:l,colors:c}=V$[e],d=h=>{const m="inline-flex items-center gap-1 text-sm",g=H$(h),v=c[h];return de(m,g,v,s)};return o.jsxs("span",{className:d(t),children:[n&&o.jsx(l,{className:"h-4 w-4","data-testid":"icon"}),r]})}var Tr=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(Tr||{}),nr=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e))(nr||{}),Va=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(Va||{});const nT=(e,t,n=!1)=>{var c,d;const r=e.split(`
632
+ `).filter(h=>h.trim()!=="");if(r.length>=3){const h=r[0],m=r[1],g=r.slice(2).join(`
633
+ `);if(h.includes("T")&&h.includes("Z")){const v=nx(g);return{id:`log-${t.toString()}`,timestamp:h,level:n?Tr.ERROR:Tr.INFO,message:v.message,metadata:{at:((c=v.metadata)==null?void 0:c.at)??h,type:((d=v.metadata)==null?void 0:d.type)??(m!=="unknown"?m:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const h=nx(s[3]);return{id:`log-${t.toString()}`,timestamp:s[1],level:n?Tr.ERROR:s[2],message:h.message,metadata:h.metadata}}const l=nx(e);return{id:`log-${t.toString()}`,timestamp:new Date().toISOString(),level:n?Tr.ERROR:Tr.INFO,message:l.message,metadata:l.metadata}},nx=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 l=s[0],c=r[l];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}},ib=e=>{const t=new Date(e),n=String(t.getFullYear()),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0"),l=String(t.getHours()).padStart(2,"0"),c=String(t.getMinutes()).padStart(2,"0"),d=String(t.getSeconds()).padStart(2,"0");return`${n}-${r}-${s} ${l}:${c}:${d}`},z$=e=>{var t;return(t=e.metadata)!=null&&t.at?ib(e.metadata.at):ib(e.timestamp)},XN=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},$$=e=>{const t=e.logs.length,n=e.errors.length,r=t+n,s=[`Run #${e.id.slice(-8)}`,`${String(r)} messages`];return n>0&&s.push(`${String(n)} errors`),s.join(" • ")},B$=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)};function G$(e){return o.jsx("div",{className:"flex items-center gap-2",children:(()=>{switch(e){case nr.SUCCESS:return o.jsx(I_,{className:"h-4 w-4 text-green-500"});case nr.FAILED:return o.jsx(yp,{className:"h-4 w-4 text-red-500"});case nr.RUNNING:return o.jsx(Xd,{className:"text-primary h-4 w-4 animate-spin"});case nr.CANCELLED:return o.jsx(FL,{className:"h-4 w-4 text-gray-500"});default:return o.jsx(a5,{className:"h-4 w-4 text-gray-500"})}})()})}function q$(e){switch(e){case Tr.INFO:return o.jsx(Fr,{className:"h-3 w-3 text-blue-500"});case Tr.WARNING:return o.jsx(Kb,{className:"h-3 w-3 text-yellow-500"});case Tr.ERROR:return o.jsx(yp,{className:"h-3 w-3 text-red-500"});case Tr.SYSTEM:return o.jsx(Hc,{className:"text-muted-foreground h-3 w-3"});default:return o.jsx(Fr,{className:"text-muted-foreground h-3 w-3"})}}function K$(e){switch(e){case Tr.INFO:return"text-blue-600 dark:text-blue-400";case Tr.WARNING:return"text-yellow-600 dark:text-yellow-400";case Tr.ERROR:return"text-red-600 dark:text-red-400";case Tr.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function Z$({status:e}){switch(e){case nr.RUNNING:return o.jsx(Rr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case nr.SUCCESS:return o.jsx(Rr,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case nr.FAILED:return o.jsx(Rr,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case nr.CANCELLED:return o.jsx(Rr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});default:return o.jsx(Rr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}function Y$({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:l,dataMartId:c}){const d=g=>{g.stopPropagation()},h=async g=>{if(g.stopPropagation(),c)try{await l(c,s.id),Vt.success("Data mart run cancelled successfully")}catch(v){Vt.error(v instanceof Error?v.message:"Failed to cancel data mart run")}},m=g=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${g?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`;return o.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[o.jsx("button",{onClick:g=>{g.stopPropagation(),t(Va.STRUCTURED)},className:`${m(e===Va.STRUCTURED)} rounded-l-lg`,children:"Structured"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(Va.RAW)},className:`${m(e===Va.RAW)} rounded-none`,children:"Raw"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(Va.CONFIGURATION)},className:`${m(e===Va.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==Va.CONFIGURATION&&o.jsxs("div",{className:"relative",children:[o.jsx(vi,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),o.jsx(zt,{type:"text",placeholder:"Search logs...",value:n,onChange:g=>{r(g.target.value)},onClick:d,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"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[s.status===nr.RUNNING&&o.jsxs(we,{variant:"destructive",size:"sm",onClick:g=>void h(g),children:[o.jsx(Ad,{className:"h-4 w-4"}),"Cancel"]}),o.jsxs(we,{variant:"outline",size:"sm",onClick:g=>{g.stopPropagation(),B$(s)},className:"flex items-center gap-2",children:[o.jsx(h5,{className:"h-4 w-4"}),"JSON"]})]})]})}function W$({logs:e}){const t=n=>{n.stopPropagation()};return e.length===0?o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No logs found"})}):o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((n,r)=>o.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-sm text-xs ${r===e.length-1?"border-b-0":""}`,onClick:t,children:[o.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:z$(n)}),o.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[q$(n.level),o.jsx("span",{className:`text-xs font-medium ${K$(n.level)}`,children:XN(n)})]}),o.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${n.level===Tr.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:n.message.includes(`
634
+ `)?o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:n.message}):o.jsx("span",{children:n.message})})]},n.id))})})}var Qm=(e=>(e.ERROR="error",e.DEFAULT="default",e))(Qm||{});function Xm({text:e,section:t,variant:n="default",copiedSection:r,onCopy:s,iconOnly:l=!1}){const c=n==="error",d=r===t,h="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 o.jsx("button",{onClick:g=>{s(e,t),g.stopPropagation()},className:`${h} ${m}`,title:`Copy ${t} to clipboard`,children:l?o.jsx(o.Fragment,{children:d?o.jsx(vr,{className:"h-3 w-3"}):o.jsx(_m,{className:"h-3 w-3"})}):d?o.jsxs(o.Fragment,{children:[o.jsx(vr,{className:"h-3 w-3"}),"Copied"]}):o.jsxs(o.Fragment,{children:[o.jsx(_m,{className:"h-3 w-3"}),"Copy"]})})}function j0(){const[e,t]=p.useState(null),n=async(s,l)=>{try{await navigator.clipboard.writeText(s),t(l),setTimeout(()=>{t(null)},2e3)}catch(c){console.error("Failed to copy text: ",c)}};return{copiedSection:e,copyToClipboard:n,handleCopy:(s,l)=>{n(s,l)}}}function Q$({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=j0(),s=l=>{l.stopPropagation()};return o.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:s,children:[t.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[o.jsx(Hc,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),o.jsx(Xm,{text:t.join(`
635
+ `),section:"errors",variant:Qm.ERROR,copiedSection:n,onCopy:r})]}),o.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((l,c)=>o.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:l},c))})]}),e.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[o.jsx(Fr,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),o.jsx(Xm,{text:e.join(`
636
+ `),section:"logs",variant:Qm.DEFAULT,copiedSection:n,onCopy:r})]}),o.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((l,c)=>o.jsx("div",{className:"mb-1 leading-relaxed",children:l},c))})]})]})}function X$({definitionRun:e}){const{copiedSection:t,handleCopy:n}=j0(),r=s=>{s.stopPropagation()};return o.jsx("div",{className:"border-border rounded-lg border",onClick:r,children:e!=null?o.jsxs("div",{className:"p-4",children:[o.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[o.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),o.jsx(Xm,{text:JSON.stringify(e,null,2),section:"configuration",variant:Qm.DEFAULT,copiedSection:t,onCopy:n})]}),o.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)})]}):o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}function J$({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,cancelDataMartRun:d,dataMartId:h}){const{copiedSection:m,handleCopy:g}=j0(),v=()=>{if(e.logs.length===0&&e.errors.length===0)return[];const b=e.logs.map((E,R)=>nT(E,R)),w=e.errors.map((E,R)=>nT(E,e.logs.length+R,!0));return[...b,...w].filter(E=>{const R=XN(E);return l===""||E.message.toLowerCase().includes(l.toLowerCase())||R.toLowerCase().includes(l.toLowerCase())})},x=()=>{if(r===Va.STRUCTURED){const b=v();return o.jsx(W$,{logs:b})}else return r===Va.RAW?o.jsx(Q$,{logs:e.logs,errors:e.errors}):o.jsx(X$,{definitionRun:e.definitionRun})};return o.jsxs("div",{className:"dm-card-block",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[o.jsxs("div",{className:"flex items-center gap-3",children:[G$(e.status),o.jsx("div",{className:"text-foreground font-mono text-sm font-medium",children:ib(new Date(e.createdAt).toISOString())}),o.jsxs("div",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[o.jsx(z5,{className:"h-3 w-3"}),$$(e)]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Z$,{status:e.status}),o.jsx(ml,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&o.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),o.jsx(Xm,{text:e.id,section:"run-id",onCopy:g,copiedSection:m,iconOnly:!0})]}),o.jsx(Y$,{logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,run:e,cancelDataMartRun:d,dataMartId:h}),x()]})]})}const JN=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,eB=/[#&]gid=([0-9]+)/;function eA(e){return JN.test(e)}function tB(e){const t=JN.exec(e);return t?t[2]:""}function nB(e){const t=eB.exec(e);return t?t[1]:"0"}function rB(e){return{spreadsheetId:tB(e),sheetId:parseInt(nB(e),10)}}function N0(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function aB(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 rx(e){return aB(e,"client_email")}const tA=p.createContext(void 0);var tt=(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))(tt||{}),aa=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e))(aa||{}),dn=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e))(dn||{}),fn=(e=>(e.EDIT="edit",e.CREATE="create",e))(fn||{});const sB={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function oB(e,t){switch(t.type){case tt.FETCH_REPORTS_START:case tt.FETCH_REPORT_START:case tt.CREATE_REPORT_START:case tt.UPDATE_REPORT_START:case tt.DELETE_REPORT_START:return{...e,loading:!0,error:null};case tt.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case tt.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case tt.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case tt.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case tt.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 tt.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case tt.FETCH_REPORTS_ERROR:case tt.FETCH_REPORT_ERROR:case tt.FETCH_DESTINATIONS_ERROR:case tt.CREATE_REPORT_ERROR:case tt.UPDATE_REPORT_ERROR:case tt.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case tt.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case tt.CLEAR_ERROR:return{...e,error:null};case tt.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case tt.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case tt.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case tt.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==dn.RUNNING||(n==null?void 0:n.lastRunStatus)!==dn.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 nA({children:e}){const[t,n]=p.useReducer(oB,sB);return o.jsx(tA.Provider,{value:{state:t,dispatch:n},children:e})}function iB(){const e=p.useContext(tA);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class lB extends Yc{constructor(){super("/reports")}async createReport(t){return this.post("",t)}async getReportById(t){return this.get(`/${t}`)}async getReportsByDataMartId(t){return this.get(`/data-mart/${t}`)}async getReportsByProject(){return this.get("/")}async updateReport(t,n){return this.put(`/${t}`,n)}async deleteReport(t){return this.delete(`/${t}`)}async runReport(t){return this.post(`/${t}/run`)}}const Xs=new lB,cB={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class uB{constructor(){is(this,"pollingTimers",new Map);is(this,"pollCounters",new Map);is(this,"config",cB)}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 l=await Xs.getReportById(t);if(n(l),l.lastRunStatus!==dn.RUNNING){this.stopPolling(t);return}const d=s<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,h=setTimeout(()=>{r()},d);this.pollingTimers.set(t,h)}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 Wh=new uB;class dB extends Yc{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 Zi=new dB;var It=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e))(It||{}),jc=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e))(jc||{}),el=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e))(el||{});class fB{mapFromDto(t){let n="";try{t.credentials.type===el.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:It.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:el.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:It.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:el.GOOGLE_SHEETS_CREDENTIALS}}}}class hB{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:It.LOOKER_STUDIO,projectId:t.projectId,credentials: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={deploymentUrl:n.credentials.deploymentUrl,type:el.LOOKER_STUDIO_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:It.LOOKER_STUDIO,credentials:{deploymentUrl:n.credentials.deploymentUrl,type:el.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===el.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const rA={getMapper(e){switch(e){case It.GOOGLE_SHEETS:return new fB;case It.LOOKER_STUDIO:return new hB;default:throw new Error(`Unknown destination type: ${e}`)}}};function yc(e){return rA.getMapper(e.type).mapFromDto(e)}class mB{mapFromDto(t){if(t.type!==aa.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:aa.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class pB{mapFromDto(t){if(t.type!==aa.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:aa.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const gB={getMapper(e){switch(e){case aa.GOOGLE_SHEETS_CONFIG:return new mB;case aa.LOOKER_STUDIO_CONFIG:return new pB;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function vB(e){return gB.getMapper(e.type).mapFromDto(e)}function Yi(e){const t=vB(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:yc(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)}}function bl(){const{state:e,dispatch:t}=iB(),n=p.useCallback(async()=>{t({type:tt.FETCH_DESTINATIONS_START});try{const E=await Zi.getDataDestinations();t({type:tt.FETCH_DESTINATIONS_SUCCESS,payload:E})}catch(E){t({type:tt.FETCH_DESTINATIONS_ERROR,payload:E instanceof Error?E.message:"Failed to fetch destinations"})}},[t]),r=p.useCallback(async()=>{t({type:tt.FETCH_REPORTS_START});try{const R=(await Xs.getReportsByProject()).map(Yi);t({type:tt.FETCH_REPORTS_SUCCESS,payload:R})}catch(E){t({type:tt.FETCH_REPORTS_ERROR,payload:E instanceof Error?E.message:"Failed to fetch reports"})}},[t]),s=p.useCallback(async E=>{t({type:tt.FETCH_REPORTS_START});try{const T=(await Xs.getReportsByDataMartId(E)).map(Yi);t({type:tt.FETCH_REPORTS_SUCCESS,payload:T})}catch(R){t({type:tt.FETCH_REPORTS_ERROR,payload:R instanceof Error?R.message:"Failed to fetch reports"})}},[t]),l=p.useCallback(async E=>{t({type:tt.FETCH_REPORT_START});try{const R=await Xs.getReportById(E),T=Yi(R);t({type:tt.FETCH_REPORT_SUCCESS,payload:T})}catch(R){t({type:tt.FETCH_REPORT_ERROR,payload:R instanceof Error?R.message:"Failed to fetch report"})}},[t]),c=p.useCallback(async E=>{t({type:tt.CREATE_REPORT_START});try{const R=await Xs.createReport(E),T=Yi(R);return t({type:tt.CREATE_REPORT_SUCCESS,payload:T}),T}catch(R){return t({type:tt.CREATE_REPORT_ERROR,payload:R instanceof Error?R.message:"Failed to сreate report"}),null}},[t]),d=p.useCallback(async(E,R)=>{t({type:tt.UPDATE_REPORT_START});try{const T=await Xs.updateReport(E,R),_=Yi(T);return t({type:tt.UPDATE_REPORT_SUCCESS,payload:_}),_}catch(T){return t({type:tt.UPDATE_REPORT_ERROR,payload:T instanceof Error?T.message:"Failed to update report"}),null}},[t]),h=p.useCallback(async E=>{t({type:tt.DELETE_REPORT_START});try{await Xs.deleteReport(E),t({type:tt.DELETE_REPORT_SUCCESS,payload:E})}catch(R){t({type:tt.DELETE_REPORT_ERROR,payload:R instanceof Error?R.message:"Failed to delete report"})}},[t]),m=p.useCallback(()=>{t({type:tt.CLEAR_CURRENT_REPORT})},[t]),g=p.useCallback(()=>{t({type:tt.CLEAR_ERROR})},[t]),v=p.useCallback(E=>{Wh.stopPolling(E),t({type:tt.STOP_POLLING_REPORT,payload:E})},[t]),x=p.useCallback(E=>{e.polledReportIds.includes(E)&&v(E),t({type:tt.START_POLLING_REPORT,payload:E}),Wh.startPolling(E,R=>{const T=Yi(R);t({type:tt.UPDATE_POLLED_REPORT,payload:T})})},[t,e.polledReportIds,v]),b=p.useCallback(()=>{Wh.stopAllPolling(),t({type:tt.STOP_ALL_POLLING})},[t]),w=p.useCallback(E=>{Wh.setConfig(E)},[]),C=p.useCallback(async E=>{try{v(E),await Xs.runReport(E),await l(E),x(E)}catch(R){console.error("Failed to run report:",R)}},[l,x,v]);return p.useEffect(()=>()=>{b()},[b]),{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:l,createReport:c,updateReport:d,deleteReport:h,runReport:C,startPollingReport:x,stopPollingReport:v,stopAllPolling:b,setPollingConfig:w,clearCurrentReport:m,clearError:g}}dn.SUCCESS+"",dn.SUCCESS,dn.RUNNING+"",dn.RUNNING,dn.ERROR+"",dn.ERROR;var ax,Zp="HoverCard",[aA,dne]=jr(Zp,[js]),Yp=js(),[yB,Wp]=aA(Zp),sA=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:l,openDelay:c=700,closeDelay:d=300}=e,h=Yp(t),m=p.useRef(0),g=p.useRef(0),v=p.useRef(!1),x=p.useRef(!1),[b,w]=ra({prop:r,defaultProp:s??!1,onChange:l,caller:Zp}),C=p.useCallback(()=>{clearTimeout(g.current),m.current=window.setTimeout(()=>w(!0),c)},[c,w]),E=p.useCallback(()=>{clearTimeout(m.current),!v.current&&!x.current&&(g.current=window.setTimeout(()=>w(!1),d))},[d,w]),R=p.useCallback(()=>w(!1),[w]);return p.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(g.current)},[]),o.jsx(yB,{scope:t,open:b,onOpenChange:w,onOpen:C,onClose:E,onDismiss:R,hasSelectionRef:v,isPointerDownOnContentRef:x,children:o.jsx(nf,{...h,children:n})})};sA.displayName=Zp;var oA="HoverCardTrigger",iA=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Wp(oA,n),l=Yp(n);return o.jsx(qc,{asChild:!0,...l,children:o.jsx(Ze.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,ep(s.onOpen)),onPointerLeave:Te(e.onPointerLeave,ep(s.onClose)),onFocus:Te(e.onFocus,s.onOpen),onBlur:Te(e.onBlur,s.onClose),onTouchStart:Te(e.onTouchStart,c=>c.preventDefault())})})});iA.displayName=oA;var A0="HoverCardPortal",[xB,bB]=aA(A0,{forceMount:void 0}),lA=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,l=Wp(A0,t);return o.jsx(xB,{scope:t,forceMount:n,children:o.jsx(yr,{present:n||l.open,children:o.jsx(gl,{asChild:!0,container:s,children:r})})})};lA.displayName=A0;var Jm="HoverCardContent",cA=p.forwardRef((e,t)=>{const n=bB(Jm,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,l=Wp(Jm,e.__scopeHoverCard);return o.jsx(yr,{present:r||l.open,children:o.jsx(SB,{"data-state":l.open?"open":"closed",...s,onPointerEnter:Te(e.onPointerEnter,ep(l.onOpen)),onPointerLeave:Te(e.onPointerLeave,ep(l.onClose)),ref:t})})});cA.displayName=Jm;var SB=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,...d}=e,h=Wp(Jm,n),m=Yp(n),g=p.useRef(null),v=gt(t,g),[x,b]=p.useState(!1);return p.useEffect(()=>{if(x){const w=document.body;return ax=w.style.userSelect||w.style.webkitUserSelect,w.style.userSelect="none",w.style.webkitUserSelect="none",()=>{w.style.userSelect=ax,w.style.webkitUserSelect=ax}}},[x]),p.useEffect(()=>{if(g.current){const w=()=>{b(!1),h.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var E;((E=document.getSelection())==null?void 0:E.toString())!==""&&(h.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",w),()=>{document.removeEventListener("pointerup",w),h.hasSelectionRef.current=!1,h.isPointerDownOnContentRef.current=!1}}},[h.isPointerDownOnContentRef,h.hasSelectionRef]),p.useEffect(()=>{g.current&&EB(g.current).forEach(C=>C.setAttribute("tabindex","-1"))}),o.jsx(pl,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Te(l,w=>{w.preventDefault()}),onDismiss:h.onDismiss,children:o.jsx(rf,{...m,...d,onPointerDown:Te(d.onPointerDown,w=>{w.currentTarget.contains(w.target)&&b(!0),h.hasSelectionRef.current=!1,h.isPointerDownOnContentRef.current=!0}),ref:v,style:{...d.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)"}})})}),CB="HoverCardArrow",wB=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Yp(n);return o.jsx(af,{...s,...r,ref:t})});wB.displayName=CB;function ep(e){return t=>t.pointerType==="touch"?void 0:e()}function EB(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 RB=sA,TB=iA,_B=lA,jB=cA;const D0=({...e})=>o.jsx(RB,{"data-slot":"hover-card",...e});D0.displayName="HoverCard";const O0=p.forwardRef(({...e},t)=>o.jsx(TB,{"data-slot":"hover-card-trigger",ref:t,...e}));O0.displayName="HoverCardTrigger";const M0=p.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...s},l)=>{const c=d=>{d.stopPropagation(),r&&r(d)};return o.jsx(_B,{children:o.jsx(jB,{ref:l,align:t,sideOffset:n,className:de("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})})});M0.displayName="HoverCardContent";const k0=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:de("border-border flex gap-4 border-b pb-4",e),...t}));k0.displayName="HoverCardHeader";const I0=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:de("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));I0.displayName="HoverCardHeaderIcon";const L0=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:de("flex flex-col space-y-1",e),...t}));L0.displayName="HoverCardHeaderText";const P0=p.forwardRef(({className:e,...t},n)=>o.jsx("h2",{ref:n,className:de("text-md pt-1 leading-snug font-semibold",e),...t}));P0.displayName="HoverCardHeaderTitle";const U0=p.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:de("text-muted-foreground text-sm",e),...t}));U0.displayName="HoverCardHeaderDescription";const F0=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:de("flex flex-col",e),...t}));F0.displayName="HoverCardBody";const Qo=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:de("border-border flex items-center justify-between border-b py-4",e),...t}));Qo.displayName="HoverCardItem";const Xo=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:de("text-muted-foreground text-sm",e),...t}));Xo.displayName="HoverCardItemLabel";const Jo=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:de("text-sm",e),...t}));Jo.displayName="HoverCardItemValue";const H0=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:de("pt-4 pb-2",e),...t}));H0.displayName="HoverCardFooter";const Hd={types:{[It.GOOGLE_SHEETS]:{type:It.GOOGLE_SHEETS,displayName:"Google Sheets",icon:Z2,status:jc.ACTIVE},[It.LOOKER_STUDIO]:{type:It.LOOKER_STUDIO,displayName:"Looker Studio",icon:p7,status:jc.ACTIVE},[It.ODATA]:{type:It.ODATA,displayName:"OData",icon:g7,status:jc.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},NB=rn({deploymentUrl:an().min(1,"Deployment URL is required").url("The deployment URL should include the protocol (https://) and domain name. A port may also be included if necessary (e.g., https://example.com:8080)").refine(e=>e.startsWith("https://"),{message:"Deployment URL must use HTTPS protocol"}),destinationId:an().optional(),destinationSecretKey:an().optional()}),uA=rn({title:an().min(1,"Title is required"),type:S0(It)}),AB=uA.extend({type:Ns(It.GOOGLE_SHEETS),credentials:eN}),DB=uA.extend({type:Ns(It.LOOKER_STUDIO),credentials:NB}),OB=J2("type",[AB,DB]),dA=p.createContext(void 0);var jt=(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))(jt||{});const MB={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function kB(e,t){switch(t.type){case jt.FETCH_DESTINATIONS_START:case jt.FETCH_DESTINATION_START:case jt.CREATE_DESTINATION_START:case jt.UPDATE_DESTINATION_START:case jt.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case jt.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case jt.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case jt.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case jt.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 jt.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case jt.FETCH_DESTINATIONS_ERROR:case jt.FETCH_DESTINATION_ERROR:case jt.CREATE_DESTINATION_ERROR:case jt.UPDATE_DESTINATION_ERROR:case jt.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case jt.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case jt.CLEAR_ERROR:return{...e,error:null};default:return e}}function Qp({children:e}){const[t,n]=p.useReducer(kB,MB);return o.jsx(dA.Provider,{value:{state:t,dispatch:n},children:e})}function IB(){const e=p.useContext(dA);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}function Xp(){const{state:e,dispatch:t}=IB(),n=p.useCallback(async()=>{t({type:jt.FETCH_DESTINATIONS_START});try{const g=(await Zi.getDataDestinations()).map(yc);t({type:jt.FETCH_DESTINATIONS_SUCCESS,payload:g})}catch(m){t({type:jt.FETCH_DESTINATIONS_ERROR,payload:m instanceof Error?m.message:"Failed to load destinations"})}},[t]),r=p.useCallback(async m=>{try{const g=await Zi.getDataDestinationById(m),v=yc(g);t({type:jt.FETCH_DESTINATION_SUCCESS,payload:v})}catch(g){t({type:jt.FETCH_DESTINATION_ERROR,payload:g instanceof Error?g.message:"Failed to load destination"})}},[t]),s=p.useCallback(async m=>{t({type:jt.CREATE_DESTINATION_START});try{const g=await Zi.createDataDestination(m),v=yc(g);return t({type:jt.CREATE_DESTINATION_SUCCESS,payload:v}),v}catch(g){return t({type:jt.CREATE_DESTINATION_ERROR,payload:g instanceof Error?g.message:"Failed to create destination"}),null}},[t]),l=p.useCallback(async(m,g)=>{t({type:jt.UPDATE_DESTINATION_START});try{const v=await Zi.updateDataDestination(m,g),x=yc(v);return t({type:jt.UPDATE_DESTINATION_SUCCESS,payload:x}),x}catch(v){return t({type:jt.UPDATE_DESTINATION_ERROR,payload:v instanceof Error?v.message:"Failed to update destination"}),null}},[t]),c=p.useCallback(async m=>{t({type:jt.DELETE_DESTINATION_START});try{await Zi.deleteDataDestination(m),t({type:jt.DELETE_DESTINATION_SUCCESS,payload:m})}catch(g){t({type:jt.DELETE_DESTINATION_ERROR,payload:g instanceof Error?g.message:"Failed to delete destination"})}},[t]),d=p.useCallback(()=>{t({type:jt.CLEAR_CURRENT_DESTINATION})},[t]),h=p.useCallback(async m=>{try{const g=await Zi.rotateSecretKey(m);return yc(g)}catch(g){throw console.error("Failed to rotate secret key:",g),g}},[]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:r,createDataDestination:s,updateDataDestination:l,deleteDataDestination:c,clearCurrentDataDestination:d,rotateSecretKey:h}}function V0(e){return JSON.stringify(e,null,2)}function Jp(e){return e.type===aa.GOOGLE_SHEETS_CONFIG}function fA(e){return e.type===aa.LOOKER_STUDIO_CONFIG}function cl({date:e,className:t=""}){const n=p.useMemo(()=>{const r=new Date,s=e.getTime()-r.getTime(),l=Math.abs(s),c=s<0,d=Math.floor(l/(1e3*60)),h=Math.floor(l/(1e3*60*60)),m=Math.floor(l/(1e3*60*60*24)),g=Math.floor(m/7),v=Math.floor(m/30),x=Math.floor(m/365),b=C=>C.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),w=C=>C.toLocaleDateString("en-US",{weekday:"long"});if(d<1)return c?"Just now":"In a moment";if(d<60)return c?d===1?"1 minute ago":`${d} minutes ago`:d===1?"In 1 minute":`In ${d} minutes`;if(h<24)return c?h===1?"1 hour ago":`${h} hours ago`:h===1?"In 1 hour":`In ${h} hours`;if(m===1){const C=b(e);return c?`Yesterday at ${C}`:`Tomorrow at ${C}`}if(m<7){const C=w(e),E=b(e);return c?`Last ${C} at ${E}`:`This ${C} at ${E}`}if(m<14){const C=w(e),E=b(e);return c?`Last ${C} at ${E}`:`Next ${C} at ${E}`}return g<4?c?g===2?"2 weeks ago":"3 weeks ago":g===2?"In 2 weeks":"In 3 weeks":v<12?c?v===1?"1 month ago":`${v} months ago`:v===1?"In 1 month":`In ${v} months`:c?x===1?"1 year ago":`${x} years ago`:x===1?"In 1 year":`In ${x} years`},[e]);return o.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const LB=()=>{const e=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},PB=je.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=LB(),l=p.useMemo(()=>t.lastRunStatus?{statusType:HB(t.lastRunStatus),statusText:zB(t.lastRunStatus)}:null,[t.lastRunStatus]),c=p.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:s.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,s]),d=p.useMemo(()=>Jp(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),h=p.useCallback(()=>{if(!d.isGoogleSheets||!d.spreadsheetId||!d.sheetId)return;const m=N0(d.spreadsheetId,d.sheetId);window.open(m,"_blank","noopener,noreferrer")},[d]);return o.jsxs(D0,{children:[o.jsx(O0,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(M0,{children:[o.jsxs(k0,{children:[o.jsx(I0,{children:o.jsx(Z2,{size:20})}),o.jsxs(L0,{children:[o.jsx(P0,{children:t.title||"Unnamed Report"}),o.jsxs(U0,{children:["Last modified ",o.jsx(cl,{date:new Date(t.modifiedAt)})]})]})]}),o.jsxs(F0,{children:[o.jsxs(Qo,{children:[o.jsx(Xo,{children:"Last run status:"}),o.jsx(Jo,{children:l?o.jsx(vf,{type:l.statusType,variant:"ghost",children:l.statusText}):"Not run yet"})]}),o.jsxs(Qo,{children:[o.jsx(Xo,{children:"Last run date:"}),o.jsx(Jo,{children:t.lastRunDate?o.jsx(cl,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&o.jsxs(Qo,{children:[o.jsx(Xo,{children:"Error message:"}),o.jsx(Jo,{children:t.lastRunError})]}),o.jsxs(Qo,{children:[o.jsx(Xo,{children:"Total runs:"}),o.jsxs(Jo,{children:[t.runsCount||0," runs",c.createdAt&&o.jsxs(o.Fragment,{children:[", since ",c.createdAt]})]})]})]}),d.isGoogleSheets&&o.jsx(H0,{children:o.jsxs(we,{className:"w-full",variant:"default",onClick:h,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",o.jsx(Qd,{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)),UB=e=>{switch(e){case tr.DRAFT:return xn.NEUTRAL;case tr.PUBLISHED:return xn.SUCCESS;default:return xn.NEUTRAL}},FB=e=>{switch(e){case nr.SUCCESS:return xn.SUCCESS;case nr.RUNNING:return xn.INFO;case nr.FAILED:case nr.CANCELLED:return xn.ERROR;default:return xn.NEUTRAL}},HB=e=>{switch(e){case dn.SUCCESS:return xn.SUCCESS;case dn.RUNNING:return xn.INFO;case dn.ERROR:return xn.ERROR;default:return xn.NEUTRAL}},VB=e=>{switch(e){case nr.SUCCESS:return"Success";case nr.RUNNING:return"Running";case nr.FAILED:return"Failed";case nr.CANCELLED:return"Cancelled";default:return"Unknown"}},zB=e=>{switch(e){case dn.SUCCESS:return"Success";case dn.RUNNING:return"Running";case dn.ERROR:return"Failed";default:return"Unknown"}},hA=e=>rn({fullyQualifiedName:an().min(1,"Fully qualified name is required").refine(t=>M$(t,e),t=>({message:I$(t,e)}))}),$B=e=>rn({pattern:an().min(1,"Table pattern is required").refine(t=>k$(t,e),t=>({message:L$(t,e)}))}),BB=e=>{const t=[];return e.status.code===tr.PUBLISHED&&t.push(vm.ALREADY_PUBLISHED),e.definitionType||t.push(vm.MISSING_DEFINITION_TYPE),e.definition||t.push(vm.MISSING_DEFINITION),t},GB=e=>e.map(t=>l$[t]);function qB(e){return e.map(t=>({id:t.id,title:t.title,status:zN.getInfo(t.status),storageType:t.storage.type,storageTitle:t.storage.title||void 0,definitionType:t.definitionType,triggersCount:t.triggersCount,reportsCount:t.reportsCount,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),definition:t.definition}))}function mA(){const{state:e,dispatch:t}=o$(),n=p.useCallback(async()=>{t({type:"SET_LOADING"});try{const l=await ir.getDataMarts(),c=qB(l);t({type:"SET_ITEMS",payload:c})}catch(l){t({type:"SET_ERROR",payload:l instanceof Error?l.message:"Failed to load data marts"})}},[t]),r=p.useCallback(async l=>{t({type:"SET_LOADING"});try{await ir.deleteDataMart(l)}catch(c){throw t({type:"SET_ERROR",payload:c instanceof Error?c.message:"Failed to delete data mart"}),c}},[t]),s=p.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:s,deleteDataMart:r}}/**
637
+ * table-core
638
+ *
639
+ * Copyright (c) TanStack
640
+ *
641
+ * This source code is licensed under the MIT license found in the
642
+ * LICENSE.md file in the root directory of this source tree.
643
+ *
644
+ * @license MIT
645
+ */function ei(e,t){return typeof e=="function"?e(t):e}function sa(e,t){return n=>{t.setState(r=>({...r,[e]:ei(n,r[e])}))}}function eg(e){return e instanceof Function}function KB(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ZB(e,t){const n=[],r=s=>{s.forEach(l=>{n.push(l);const c=t(l);c!=null&&c.length&&r(c)})};return r(e),n}function rt(e,t,n){let r=[],s;return l=>{let c;n.key&&n.debug&&(c=Date.now());const d=e(l);if(!(d.length!==r.length||d.some((g,v)=>r[v]!==g)))return s;r=d;let m;if(n.key&&n.debug&&(m=Date.now()),s=t(...d),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-c)*100)/100,v=Math.round((Date.now()-m)*100)/100,x=v/16,b=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${b(v,5)} /${b(g,5)} ms`,`
646
+ font-size: .6rem;
647
+ font-weight: bold;
648
+ color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function at(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 YB(e,t,n,r){const s=()=>{var c;return(c=l.getValue())!=null?c:e.options.renderFallbackValue},l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:rt(()=>[e,n,t,l],(c,d,h,m)=>({table:c,column:d,row:h,cell:m,getValue:m.getValue,renderValue:m.renderValue}),at(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(l,n,t,e)},{}),l}function WB(e,t,n,r){var s,l;const d={...e._getDefaultColumnDef(),...t},h=d.accessorKey;let m=(s=(l=d.id)!=null?l:h?typeof String.prototype.replaceAll=="function"?h.replaceAll(".","_"):h.replace(/\./g,"_"):void 0)!=null?s:typeof d.header=="string"?d.header:void 0,g;if(d.accessorFn?g=d.accessorFn:h&&(h.includes(".")?g=x=>{let b=x;for(const C of h.split(".")){var w;b=(w=b)==null?void 0:w[C]}return b}:g=x=>x[d.accessorKey]),!m)throw new Error;let v={id:`${String(m)}`,accessorFn:g,parent:r,depth:n,columnDef:d,columns:[],getFlatColumns:rt(()=>[!0],()=>{var x;return[v,...(x=v.columns)==null?void 0:x.flatMap(b=>b.getFlatColumns())]},at(e.options,"debugColumns")),getLeafColumns:rt(()=>[e._getOrderColumnsFn()],x=>{var b;if((b=v.columns)!=null&&b.length){let w=v.columns.flatMap(C=>C.getLeafColumns());return x(w)}return[v]},at(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(v,e);return v}const mr="debugHeaders";function rT(e,t,n){var r;let l={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=[],d=h=>{h.subHeaders&&h.subHeaders.length&&h.subHeaders.map(d),c.push(h)};return d(l),c},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(l,e)}),l}const QB={createTable:e=>{e.getHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var l,c;const d=(l=r==null?void 0:r.map(v=>n.find(x=>x.id===v)).filter(Boolean))!=null?l:[],h=(c=s==null?void 0:s.map(v=>n.find(x=>x.id===v)).filter(Boolean))!=null?c:[],m=n.filter(v=>!(r!=null&&r.includes(v.id))&&!(s!=null&&s.includes(v.id)));return Qh(t,[...d,...m,...h],e)},at(e.options,mr)),e.getCenterHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(s!=null&&s.includes(l.id))),Qh(t,n,e,"center")),at(e.options,mr)),e.getLeftHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return Qh(t,l,e,"left")},at(e.options,mr)),e.getRightHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return Qh(t,l,e,"right")},at(e.options,mr)),e.getFooterGroups=rt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),at(e.options,mr)),e.getLeftFooterGroups=rt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),at(e.options,mr)),e.getCenterFooterGroups=rt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),at(e.options,mr)),e.getRightFooterGroups=rt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),at(e.options,mr)),e.getFlatHeaders=rt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,mr)),e.getLeftFlatHeaders=rt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,mr)),e.getCenterFlatHeaders=rt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,mr)),e.getRightFlatHeaders=rt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,mr)),e.getCenterLeafHeaders=rt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,mr)),e.getLeftLeafHeaders=rt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,mr)),e.getRightLeafHeaders=rt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,mr)),e.getLeafHeaders=rt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,l,c,d,h,m;return[...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[],...(h=(m=r[0])==null?void 0:m.headers)!=null?h:[]].map(g=>g.getLeafHeaders()).flat()},at(e.options,mr))}};function Qh(e,t,n,r){var s,l;let c=0;const d=function(x,b){b===void 0&&(b=1),c=Math.max(c,b),x.filter(w=>w.getIsVisible()).forEach(w=>{var C;(C=w.columns)!=null&&C.length&&d(w.columns,b+1)},0)};d(e);let h=[];const m=(x,b)=>{const w={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},C=[];x.forEach(E=>{const R=[...C].reverse()[0],T=E.column.depth===w.depth;let _,O=!1;if(T&&E.column.parent?_=E.column.parent:(_=E.column,O=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(E);else{const A=rT(n,_,{id:[r,b,_.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${C.filter(j=>j.column===_).length}`:void 0,depth:b,index:C.length});A.subHeaders.push(E),C.push(A)}w.headers.push(E),E.headerGroup=w}),h.push(w),b>0&&m(C,b-1)},g=t.map((x,b)=>rT(n,x,{depth:c,index:b}));m(g,c-1),h.reverse();const v=x=>x.filter(w=>w.column.getIsVisible()).map(w=>{let C=0,E=0,R=[0];w.subHeaders&&w.subHeaders.length?(R=[],v(w.subHeaders).forEach(_=>{let{colSpan:O,rowSpan:A}=_;C+=O,R.push(A)})):C=1;const T=Math.min(...R);return E=E+T,w.colSpan=C,w.rowSpan=E,{colSpan:C,rowSpan:E}});return v((s=(l=h[0])==null?void 0:l.headers)!=null?s:[]),h}const z0=(e,t,n,r,s,l,c)=>{let d={id:t,index:r,original:n,depth:s,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:h=>{if(d._valuesCache.hasOwnProperty(h))return d._valuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return d._valuesCache[h]=m.accessorFn(d.original,r),d._valuesCache[h]},getUniqueValues:h=>{if(d._uniqueValuesCache.hasOwnProperty(h))return d._uniqueValuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(d._uniqueValuesCache[h]=m.columnDef.getUniqueValues(d.original,r),d._uniqueValuesCache[h]):(d._uniqueValuesCache[h]=[d.getValue(h)],d._uniqueValuesCache[h])},renderValue:h=>{var m;return(m=d.getValue(h))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ZB(d.subRows,h=>h.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let h=[],m=d;for(;;){const g=m.getParentRow();if(!g)break;h.push(g),m=g}return h.reverse()},getAllCells:rt(()=>[e.getAllLeafColumns()],h=>h.map(m=>YB(e,d,m,m.id)),at(e.options,"debugRows")),_getAllCellsByColumnId:rt(()=>[d.getAllCells()],h=>h.reduce((m,g)=>(m[g.column.id]=g,m),{}),at(e.options,"debugRows"))};for(let h=0;h<e._features.length;h++){const m=e._features[h];m==null||m.createRow==null||m.createRow(d,e)}return d},XB={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()}}},pA=(e,t,n)=>{var r,s;const l=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(l))};pA.autoRemove=e=>Ga(e);const gA=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};gA.autoRemove=e=>Ga(e);const vA=(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())};vA.autoRemove=e=>Ga(e);const yA=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};yA.autoRemove=e=>Ga(e);const xA=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});xA.autoRemove=e=>Ga(e)||!(e!=null&&e.length);const bA=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});bA.autoRemove=e=>Ga(e)||!(e!=null&&e.length);const SA=(e,t,n)=>e.getValue(t)===n;SA.autoRemove=e=>Ga(e);const CA=(e,t,n)=>e.getValue(t)==n;CA.autoRemove=e=>Ga(e);const $0=(e,t,n)=>{let[r,s]=n;const l=e.getValue(t);return l>=r&&l<=s};$0.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,l=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(s)?1/0:s;if(l>c){const d=l;l=c,c=d}return[l,c]};$0.autoRemove=e=>Ga(e)||Ga(e[0])&&Ga(e[1]);const Js={includesString:pA,includesStringSensitive:gA,equalsString:vA,arrIncludes:yA,arrIncludesAll:xA,arrIncludesSome:bA,equals:SA,weakEquals:CA,inNumberRange:$0};function Ga(e){return e==null||e===""}const JB={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:sa("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"?Js.includesString:typeof r=="number"?Js.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Js.equals:Array.isArray(r)?Js.arrIncludes:Js.weakEquals},e.getFilterFn=()=>{var n,r;return eg(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:Js[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(),l=r==null?void 0:r.find(g=>g.id===e.id),c=ei(n,l?l.value:void 0);if(aT(s,c,e)){var d;return(d=r==null?void 0:r.filter(g=>g.id!==e.id))!=null?d:[]}const h={id:e.id,value:c};if(l){var m;return(m=r==null?void 0:r.map(g=>g.id===e.id?h:g))!=null?m:[]}return r!=null&&r.length?[...r,h]:[h]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var l;return(l=ei(t,s))==null?void 0:l.filter(c=>{const d=n.find(h=>h.id===c.id);if(d){const h=d.getFilterFn();if(aT(h,c.value,d))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 aT(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const eG=(e,t,n)=>n.reduce((r,s)=>{const l=s.getValue(e);return r+(typeof l=="number"?l:0)},0),tG=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},nG=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},rG=(e,t,n)=>{let r,s;return n.forEach(l=>{const c=l.getValue(e);c!=null&&(r===void 0?c>=c&&(r=s=c):(r>c&&(r=c),s<c&&(s=c)))}),[r,s]},aG=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},sG=(e,t)=>{if(!t.length)return;const n=t.map(l=>l.getValue(e));if(!KB(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((l,c)=>l-c);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},oG=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),iG=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,lG=(e,t)=>t.length,sx={sum:eG,min:tG,max:nG,extent:rG,mean:aG,median:sG,unique:oG,uniqueCount:iG,count:lG},cG={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:sa("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 sx.sum;if(Object.prototype.toString.call(r)==="[object Date]")return sx.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return eg(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:sx[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 uG(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(l=>!t.includes(l.id));return n==="remove"?r:[...t.map(l=>e.find(c=>c.id===l)).filter(Boolean),...r]}const dG={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:sa("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=rt(n=>[bd(t,n)],n=>n.findIndex(r=>r.id===e.id),at(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=bd(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=bd(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=rt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let l=[];if(!(t!=null&&t.length))l=s;else{const c=[...t],d=[...s];for(;d.length&&c.length;){const h=c.shift(),m=d.findIndex(g=>g.id===h);m>-1&&l.push(d.splice(m,1)[0])}l=[...l,...d]}return uG(l,n,r)},at(e.options,"debugTable"))}},ox=()=>({left:[],right:[]}),fG={getInitialState:e=>({columnPinning:ox(),...e}),getDefaultOptions:e=>({onColumnPinningChange:sa("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var l,c;if(n==="right"){var d,h;return{left:((d=s==null?void 0:s.left)!=null?d:[]).filter(v=>!(r!=null&&r.includes(v))),right:[...((h=s==null?void 0:s.right)!=null?h:[]).filter(v=>!(r!=null&&r.includes(v))),...r]}}if(n==="left"){var m,g;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).filter(v=>!(r!=null&&r.includes(v))),...r],right:((g=s==null?void 0:s.right)!=null?g:[]).filter(v=>!(r!=null&&r.includes(v)))}}return{left:((l=s==null?void 0:s.left)!=null?l:[]).filter(v=>!(r!=null&&r.includes(v))),right:((c=s==null?void 0:s.right)!=null?c:[]).filter(v=>!(r!=null&&r.includes(v)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,l,c;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((l=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(d=>d.id),{left:r,right:s}=t.getState().columnPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"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=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const l=[...r??[],...s??[]];return n.filter(c=>!l.includes(c.column.id))},at(t.options,"debugRows")),e.getLeftVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),at(t.options,"debugRows")),e.getRightVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),at(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?ox():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:ox())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,l;return!!((s=r.left)!=null&&s.length||(l=r.right)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getRightLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getCenterLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(l=>!s.includes(l.id))},at(e.options,"debugColumns"))}};function hG(e){return e||(typeof document<"u"?document:null)}const Xh={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ix=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),mG={getDefaultColumnDef:()=>Xh,getInitialState:e=>({columnSizing:{},columnSizingInfo:ix(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:sa("columnSizing",e),onColumnSizingInfoChange:sa("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Xh.minSize,(r=l??e.columnDef.size)!=null?r:Xh.size),(s=e.columnDef.maxSize)!=null?s:Xh.maxSize)},e.getStart=rt(n=>[n,bd(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,l)=>s+l.getSize(),0),at(t.options,"debugColumns")),e.getAfter=rt(n=>[n,bd(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,l)=>s+l.getSize(),0),at(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 l;n+=(l=s.column.getSize())!=null?l: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 l=>{if(!r||!s||(l.persist==null||l.persist(),lx(l)&&l.touches&&l.touches.length>1))return;const c=e.getSize(),d=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[r.id,r.getSize()]],h=lx(l)?Math.round(l.touches[0].clientX):l.clientX,m={},g=(R,T)=>{typeof T=="number"&&(t.setColumnSizingInfo(_=>{var O,A;const j=t.options.columnResizeDirection==="rtl"?-1:1,D=(T-((O=_==null?void 0:_.startOffset)!=null?O:0))*j,k=Math.max(D/((A=_==null?void 0:_.startSize)!=null?A:0),-.999999);return _.columnSizingStart.forEach(V=>{let[B,z]=V;m[B]=Math.round(Math.max(z+z*k,0)*100)/100}),{..._,deltaOffset:D,deltaPercentage:k}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...m})))},v=R=>g("move",R),x=R=>{g("end",R),t.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=hG(n),w={moveHandler:R=>v(R.clientX),upHandler:R=>{b==null||b.removeEventListener("mousemove",w.moveHandler),b==null||b.removeEventListener("mouseup",w.upHandler),x(R.clientX)}},C={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),v(R.touches[0].clientX),!1),upHandler:R=>{var T;b==null||b.removeEventListener("touchmove",C.moveHandler),b==null||b.removeEventListener("touchend",C.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),x((T=R.touches[0])==null?void 0:T.clientX)}},E=pG()?{passive:!1}:!1;lx(l)?(b==null||b.addEventListener("touchmove",C.moveHandler,E),b==null||b.addEventListener("touchend",C.upHandler,E)):(b==null||b.addEventListener("mousemove",w.moveHandler,E),b==null||b.addEventListener("mouseup",w.upHandler,E)),t.setColumnSizingInfo(R=>({...R,startOffset:h,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,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?ix():(n=e.initialState.columnSizingInfo)!=null?n:ix())},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 Jh=null;function pG(){if(typeof Jh=="boolean")return Jh;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 Jh=e,Jh}function lx(e){return e.type==="touchstart"}const gG={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:sa("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(l=>l.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=rt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),at(t.options,"debugRows")),e.getVisibleCells=rt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],at(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>rt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),at(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,l)=>({...s,[l.id]:n||!(l.getCanHide!=null&&l.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 bd(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const vG={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()}}},yG={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:sa("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,l;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Js.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return eg(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Js[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},xG={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:sa("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,l;e.setExpanded(r?{}:(s=(l=e.initialState)==null?void 0:l.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(l=>{const c=l.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 l=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(d=>{c[d]=!0}):c=r,n=(s=n)!=null?s:!l,!l&&n)return{...c,[e.id]:!0};if(l&&!n){const{[e.id]:d,...h}=c;return h}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()}}}},lb=0,cb=10,cx=()=>({pageIndex:lb,pageSize:cb}),bG={getInitialState:e=>({...e,pagination:{...cx(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:sa("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=l=>ei(r,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?cx():(s=e.initialState.pagination)!=null?s:cx())},e.setPageIndex=r=>{e.setPagination(s=>{let l=ei(r,s.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,c)),{...s,pageIndex:l}})},e.resetPageIndex=r=>{var s,l;e.setPageIndex(r?lb:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:lb)},e.resetPageSize=r=>{var s,l;e.setPageSize(r?cb:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:cb)},e.setPageSize=r=>{e.setPagination(s=>{const l=Math.max(1,ei(r,s.pageSize)),c=s.pageSize*s.pageIndex,d=Math.floor(c/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=r=>e.setPagination(s=>{var l;let c=ei(r,(l=e.options.pageCount)!=null?l:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=rt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((l,c)=>c)),s},at(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}}},ux=()=>({top:[],bottom:[]}),SG={getInitialState:e=>({rowPinning:ux(),...e}),getDefaultOptions:e=>({onRowPinningChange:sa("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const l=r?e.getLeafRows().map(h=>{let{id:m}=h;return m}):[],c=s?e.getParentRows().map(h=>{let{id:m}=h;return m}):[],d=new Set([...c,e.id,...l]);t.setRowPinning(h=>{var m,g;if(n==="bottom"){var v,x;return{top:((v=h==null?void 0:h.top)!=null?v:[]).filter(C=>!(d!=null&&d.has(C))),bottom:[...((x=h==null?void 0:h.bottom)!=null?x:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)]}}if(n==="top"){var b,w;return{top:[...((b=h==null?void 0:h.top)!=null?b:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)],bottom:((w=h==null?void 0:h.bottom)!=null?w:[]).filter(C=>!(d!=null&&d.has(C)))}}return{top:((m=h==null?void 0:h.top)!=null?m:[]).filter(C=>!(d!=null&&d.has(C))),bottom:((g=h==null?void 0:h.bottom)!=null?g:[]).filter(C=>!(d!=null&&d.has(C)))}})},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,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const l=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(c=>{let{id:d}=c;return d});return(r=l==null?void 0:l.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?ux():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:ux())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,l;return!!((s=r.top)!=null&&s.length||(l=r.bottom)!=null&&l.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 d=e.getRow(c,!0);return d.getIsAllParentsExpanded()?d:null}):(n??[]).map(c=>t.find(d=>d.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),at(e.options,"debugRows")),e.getBottomRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),at(e.options,"debugRows")),e.getCenterRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(l=>!s.has(l.id))},at(e.options,"debugRows"))}},CG={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:sa("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(l=>{l.getCanSelect()&&(r[l.id]=!0)}):s.forEach(l=>{delete r[l.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(l=>{ub(s,l.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?dx(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getFilteredSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?dx(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getGroupedSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?dx(e,n):{rows:[],flatRows:[],rowsById:{}},at(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(l=>{var c;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return l;const d={...l};return ub(d,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return B0(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return db(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return db(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)}}}},ub=(e,t,n,r,s)=>{var l;const c=s.getRow(t,!0);n?(c.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(l=c.subRows)!=null&&l.length&&c.getCanSelectSubRows()&&c.subRows.forEach(d=>ub(e,d.id,n,r,s))};function dx(e,t){const n=e.getState().rowSelection,r=[],s={},l=function(c,d){return c.map(h=>{var m;const g=B0(h,n);if(g&&(r.push(h),s[h.id]=h),(m=h.subRows)!=null&&m.length&&(h={...h,subRows:l(h.subRows)}),g)return h}).filter(Boolean)};return{rows:l(t.rows),flatRows:r,rowsById:s}}function B0(e,t){var n;return(n=t[e.id])!=null?n:!1}function db(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,l=!1;return e.subRows.forEach(c=>{if(!(l&&!s)&&(c.getCanSelect()&&(B0(c,t)?l=!0:s=!1),c.subRows&&c.subRows.length)){const d=db(c,t);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const fb=/([0-9]+)/gm,wG=(e,t,n)=>wA(fi(e.getValue(n)).toLowerCase(),fi(t.getValue(n)).toLowerCase()),EG=(e,t,n)=>wA(fi(e.getValue(n)),fi(t.getValue(n))),RG=(e,t,n)=>G0(fi(e.getValue(n)).toLowerCase(),fi(t.getValue(n)).toLowerCase()),TG=(e,t,n)=>G0(fi(e.getValue(n)),fi(t.getValue(n))),_G=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},jG=(e,t,n)=>G0(e.getValue(n),t.getValue(n));function G0(e,t){return e===t?0:e>t?1:-1}function fi(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function wA(e,t){const n=e.split(fb).filter(Boolean),r=t.split(fb).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),l=r.shift(),c=parseInt(s,10),d=parseInt(l,10),h=[c,d].sort();if(isNaN(h[0])){if(s>l)return 1;if(l>s)return-1;continue}if(isNaN(h[1]))return isNaN(c)?-1:1;if(c>d)return 1;if(d>c)return-1}return n.length-r.length}const id={alphanumeric:wG,alphanumericCaseSensitive:EG,text:RG,textCaseSensitive:TG,datetime:_G,basic:jG},NG={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:sa("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 l=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return id.datetime;if(typeof l=="string"&&(r=!0,l.split(fb).length>1))return id.alphanumeric}return r?id.text:id.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 eg(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:id[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),l=typeof n<"u"&&n!==null;t.setSorting(c=>{const d=c==null?void 0:c.find(b=>b.id===e.id),h=c==null?void 0:c.findIndex(b=>b.id===e.id);let m=[],g,v=l?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?d?g="toggle":g="add":c!=null&&c.length&&h!==c.length-1?g="replace":d?g="toggle":g="replace",g==="toggle"&&(l||s||(g="remove")),g==="add"){var x;m=[...c,{id:e.id,desc:v}],m.splice(0,m.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else g==="toggle"?m=c.map(b=>b.id===e.id?{...b,desc:v}:b):g==="remove"?m=c.filter(b=>b.id!==e.id):m=[{id:e.id,desc:v}];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 l=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==l&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:c==="desc"?"asc":"desc":l},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())}},AG=[QB,gG,dG,fG,XB,JB,vG,yG,NG,cG,xG,bG,SG,CG,mG];function DG(e){var t,n;const r=[...AG,...(t=e._features)!=null?t:[]];let s={_features:r};const l=s._features.reduce((x,b)=>Object.assign(x,b.getDefaultOptions==null?void 0:b.getDefaultOptions(s)),{}),c=x=>s.options.mergeOptions?s.options.mergeOptions(l,x):{...l,...x};let h={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var b;h=(b=x.getInitialState==null?void 0:x.getInitialState(h))!=null?b:h});const m=[];let g=!1;const v={_features:r,options:{...l,...e},initialState:h,_queue:x=>{m.push(x),g||(g=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();g=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const b=ei(x,s.options);s.options=c(b)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,b,w)=>{var C;return(C=s.options.getRowId==null?void 0:s.options.getRowId(x,b,w))!=null?C:`${w?[w.id,b].join("."):b}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,b)=>{let w=(b?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!w&&(w=s.getCoreRowModel().rowsById[x],!w))throw new Error;return w},_getDefaultColumnDef:rt(()=>[s.options.defaultColumn],x=>{var b;return x=(b=x)!=null?b:{},{header:w=>{const C=w.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:w=>{var C,E;return(C=(E=w.renderValue())==null||E.toString==null?void 0:E.toString())!=null?C:null},...s._features.reduce((w,C)=>Object.assign(w,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...x}},at(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:rt(()=>[s._getColumnDefs()],x=>{const b=function(w,C,E){return E===void 0&&(E=0),w.map(R=>{const T=WB(s,R,E,C),_=R;return T.columns=_.columns?b(_.columns,T,E+1):[],T})};return b(x)},at(e,"debugColumns")),getAllFlatColumns:rt(()=>[s.getAllColumns()],x=>x.flatMap(b=>b.getFlatColumns()),at(e,"debugColumns")),_getAllFlatColumnsById:rt(()=>[s.getAllFlatColumns()],x=>x.reduce((b,w)=>(b[w.id]=w,b),{}),at(e,"debugColumns")),getAllLeafColumns:rt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,b)=>{let w=x.flatMap(C=>C.getLeafColumns());return b(w)},at(e,"debugColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,v);for(let x=0;x<s._features.length;x++){const b=s._features[x];b==null||b.createTable==null||b.createTable(s)}return s}function Wc(){return e=>rt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,l,c){l===void 0&&(l=0);const d=[];for(let m=0;m<s.length;m++){const g=z0(e,e._getRowId(s[m],m,c),s[m],m,l,void 0,c==null?void 0:c.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,d.push(g),e.options.getSubRows){var h;g.originalSubRows=e.options.getSubRows(s[m],m),(h=g.originalSubRows)!=null&&h.length&&(g.subRows=r(g.originalSubRows,l+1,g))}}return d};return n.rows=r(t),n},at(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function OG(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 MG(e,t,n){return n.options.filterFromLeafRows?kG(e,t,n):IG(e,t,n)}function kG(e,t,n){var r;const s=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(h,m){m===void 0&&(m=0);const g=[];for(let x=0;x<h.length;x++){var v;let b=h[x];const w=z0(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(w.columnFilters=b.columnFilters,(v=b.subRows)!=null&&v.length&&m<c){if(w.subRows=d(b.subRows,m+1),b=w,t(b)&&!w.subRows.length){g.push(b),l[b.id]=b,s.push(b);continue}if(t(b)||w.subRows.length){g.push(b),l[b.id]=b,s.push(b);continue}}else b=w,t(b)&&(g.push(b),l[b.id]=b,s.push(b))}return g};return{rows:d(e),flatRows:s,rowsById:l}}function IG(e,t,n){var r;const s=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(h,m){m===void 0&&(m=0);const g=[];for(let x=0;x<h.length;x++){let b=h[x];if(t(b)){var v;if((v=b.subRows)!=null&&v.length&&m<c){const C=z0(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);C.subRows=d(b.subRows,m+1),b=C}g.push(b),s.push(b),l[b.id]=b}}return g};return{rows:d(e),flatRows:s,rowsById:l}}function yf(){return e=>rt(()=>[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=[],l=[];(n??[]).forEach(x=>{var b;const w=e.getColumn(x.id);if(!w)return;const C=w.getFilterFn();C&&s.push({id:x.id,filterFn:C,resolvedValue:(b=C.resolveFilterValue==null?void 0:C.resolveFilterValue(x.value))!=null?b:x.value})});const c=(n??[]).map(x=>x.id),d=e.getGlobalFilterFn(),h=e.getAllLeafColumns().filter(x=>x.getCanGlobalFilter());r&&d&&h.length&&(c.push("__global__"),h.forEach(x=>{var b;l.push({id:x.id,filterFn:d,resolvedValue:(b=d.resolveFilterValue==null?void 0:d.resolveFilterValue(r))!=null?b:r})}));let m,g;for(let x=0;x<t.flatRows.length;x++){const b=t.flatRows[x];if(b.columnFilters={},s.length)for(let w=0;w<s.length;w++){m=s[w];const C=m.id;b.columnFilters[C]=m.filterFn(b,C,m.resolvedValue,E=>{b.columnFiltersMeta[C]=E})}if(l.length){for(let w=0;w<l.length;w++){g=l[w];const C=g.id;if(g.filterFn(b,C,g.resolvedValue,E=>{b.columnFiltersMeta[C]=E})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const v=x=>{for(let b=0;b<c.length;b++)if(x.columnFilters[c[b]]===!1)return!1;return!0};return MG(t.rows,v,e)},at(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function tg(e){return t=>rt(()=>[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:l}=n;let{rows:c,flatRows:d,rowsById:h}=r;const m=s*l,g=m+s;c=c.slice(m,g);let v;t.options.paginateExpandedRows?v={rows:c,flatRows:d,rowsById:h}:v=OG({rows:c,flatRows:d,rowsById:h}),v.flatRows=[];const x=b=>{v.flatRows.push(b),b.subRows.length&&b.subRows.forEach(x)};return v.rows.forEach(x),v},at(t.options,"debugTable"))}function xf(){return e=>rt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],l=r.filter(h=>{var m;return(m=e.getColumn(h.id))==null?void 0:m.getCanSort()}),c={};l.forEach(h=>{const m=e.getColumn(h.id);m&&(c[h.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const d=h=>{const m=h.map(g=>({...g}));return m.sort((g,v)=>{for(let b=0;b<l.length;b+=1){var x;const w=l[b],C=c[w.id],E=C.sortUndefined,R=(x=w==null?void 0:w.desc)!=null?x:!1;let T=0;if(E){const _=g.getValue(w.id),O=v.getValue(w.id),A=_===void 0,j=O===void 0;if(A||j){if(E==="first")return A?-1:1;if(E==="last")return A?1:-1;T=A&&j?0:A?E:-E}}if(T===0&&(T=C.sortingFn(g,v,w.id)),T!==0)return R&&(T*=-1),C.invertSorting&&(T*=-1),T}return g.index-v.index}),m.forEach(g=>{var v;s.push(g),(v=g.subRows)!=null&&v.length&&(g.subRows=d(g.subRows))}),m};return{rows:d(n.rows),flatRows:s,rowsById:n.rowsById}},at(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
649
+ * react-table
650
+ *
651
+ * Copyright (c) TanStack
652
+ *
653
+ * This source code is licensed under the MIT license found in the
654
+ * LICENSE.md file in the root directory of this source tree.
655
+ *
656
+ * @license MIT
657
+ */function Lc(e,t){return e?LG(e)?p.createElement(e,t):e:null}function LG(e){return PG(e)||typeof e=="function"||UG(e)}function PG(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function UG(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Qc(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=p.useState(()=>({current:DG(t)})),[r,s]=p.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...e,state:{...r,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function Xc({className:e,...t}){return o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:de("w-full caption-bottom text-sm",e),...t})})}function Jc({className:e,...t}){return o.jsx("thead",{"data-slot":"table-header",className:de("[&_tr]:border-b",e),...t})}function eu({className:e,...t}){return o.jsx("tbody",{"data-slot":"table-body",className:de("[&_tr:last-child]:border-0",e),...t})}function Zn({className:e,...t}){return o.jsx("tr",{"data-slot":"table-row",className:de("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function tu({className:e,...t}){return o.jsx("th",{"data-slot":"table-head",className:de("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function oa({className:e,...t}){return o.jsx("td",{"data-slot":"table-cell",className:de("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var EA="AlertDialog",[FG,fne]=jr(EA,[fj]),mo=fj(),RA=e=>{const{__scopeAlertDialog:t,...n}=e,r=mo(t);return o.jsx(Ep,{...r,...n,modal:!0})};RA.displayName=EA;var HG="AlertDialogTrigger",VG=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mo(n);return o.jsx(j9,{...s,...r,ref:t})});VG.displayName=HG;var zG="AlertDialogPortal",TA=e=>{const{__scopeAlertDialog:t,...n}=e,r=mo(t);return o.jsx(Rp,{...r,...n})};TA.displayName=zG;var $G="AlertDialogOverlay",_A=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mo(n);return o.jsx(Tp,{...s,...r,ref:t})});_A.displayName=$G;var Nc="AlertDialogContent",[BG,GG]=FG(Nc),qG=D_("AlertDialogContent"),jA=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,l=mo(n),c=p.useRef(null),d=gt(t,c),h=p.useRef(null);return o.jsx(E9,{contentName:Nc,titleName:NA,docsSlug:"alert-dialog",children:o.jsx(BG,{scope:n,cancelRef:h,children:o.jsxs(_p,{role:"alertdialog",...l,...s,ref:d,onOpenAutoFocus:Te(s.onOpenAutoFocus,m=>{var g;m.preventDefault(),(g=h.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[o.jsx(qG,{children:r}),o.jsx(ZG,{contentRef:c})]})})})});jA.displayName=Nc;var NA="AlertDialogTitle",AA=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mo(n);return o.jsx(Jb,{...s,...r,ref:t})});AA.displayName=NA;var DA="AlertDialogDescription",OA=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mo(n);return o.jsx(e0,{...s,...r,ref:t})});OA.displayName=DA;var KG="AlertDialogAction",MA=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mo(n);return o.jsx(jp,{...s,...r,ref:t})});MA.displayName=KG;var kA="AlertDialogCancel",IA=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=GG(kA,n),l=mo(n),c=gt(t,s);return o.jsx(jp,{...l,...r,ref:c})});IA.displayName=kA;var ZG=({contentRef:e})=>{const t=`\`${Nc}\` requires a description for the component to be accessible for screen reader users.
658
+
659
+ You can add a description to the \`${Nc}\` by passing a \`${DA}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
660
+
661
+ 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 \`${Nc}\`. 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.
662
+
663
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},YG=RA,WG=TA,QG=_A,XG=jA,JG=MA,eq=IA,tq=AA,nq=OA;function rq({...e}){return o.jsx(YG,{"data-slot":"alert-dialog",...e})}function aq({...e}){return o.jsx(WG,{"data-slot":"alert-dialog-portal",...e})}function sq({className:e,...t}){return o.jsx(QG,{"data-slot":"alert-dialog-overlay",className:de("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 oq({className:e,...t}){return o.jsxs(aq,{children:[o.jsx(sq,{}),o.jsx(XG,{"data-slot":"alert-dialog-content",className:de("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 iq({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-header",className:de("flex flex-col gap-2 text-center sm:text-left",e),...t})}function lq({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-footer",className:de("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function cq({className:e,...t}){return o.jsx(tq,{"data-slot":"alert-dialog-title",className:de("text-lg font-semibold",e),...t})}function uq({className:e,...t}){return o.jsx(nq,{"data-slot":"alert-dialog-description",className:de("text-muted-foreground text-sm",e),...t})}function dq({className:e,...t}){return o.jsx(JG,{className:de(Yb(),e),...t})}function fq({className:e,...t}){return o.jsx(eq,{className:de(Yb({variant:"outline"}),e),...t})}function hq(){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(W5,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Data Mart"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"Data Marts help you organize and analyze your data effectively."}),o.jsx(gi,{to:"/data-marts/create",children:o.jsxs(we,{variant:"outline",children:[o.jsx(ha,{className:"h-4 w-4"}),"New Data Mart"]})})]})}function mq(){return o.jsx(pr,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const fc={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},pq={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 bf({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=fc.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=fc.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:l=fc.DEFAULT_EXCLUDED_COLUMNS}){const c=p.useMemo(()=>({SORTING:`${t}${fc.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${fc.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),d=p.useMemo(()=>pq.extractColumnIds(e),[e]),h=p.useMemo(()=>d.filter(C=>!s.includes(C)),[d,s]),m=p.useCallback(()=>{const C=Wo.get(c.SORTING,"json");return C&&Array.isArray(C)&&C.length>0?C:[{id:h.includes(n)?n:h[0]??fc.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,h,n]),g=p.useCallback(()=>{const C=Wo.get(c.COLUMN_VISIBILITY,"json");if(C&&typeof C=="object"&&!Array.isArray(C)){const E={};for(const R of d)l.includes(R)||(E[R]=C[R]);return E}return r},[c.COLUMN_VISIBILITY,d,l,r]),[v,x]=p.useState(m),[b,w]=p.useState(g);return p.useEffect(()=>{v.length>0&&h.includes(v[0].id)&&Wo.set(c.SORTING,v)},[v,h,c.SORTING]),p.useEffect(()=>{const C={};for(const E of d){if(l.includes(E))continue;const R=b[E];typeof R=="boolean"&&(C[E]=R)}Wo.set(c.COLUMN_VISIBILITY,C)},[b,d,l,c.COLUMN_VISIBILITY]),{sorting:v,setSorting:x,columnVisibility:b,setColumnVisibility:w}}function gq({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var A;const l=Zd(),{sorting:c,setSorting:d,columnVisibility:h,setColumnVisibility:m}=bf({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1}}),[g,v]=p.useState([]),[x,b]=p.useState({}),[w,C]=p.useState(!1),[E,R]=p.useState(!1),T=async()=>{try{R(!0);const D=O.getSelectedRowModel().rows.map(k=>k.original.id);for(const k of D)await n(k);Vt.success(`Successfully deleted ${String(D.length)} data mart${D.length!==1?"s":""}`),b({}),await r()}catch(j){console.error("Error deleting data marts:",j),Vt.error("Failed to delete some data marts. Please try again.")}finally{R(!1),C(!1)}},_=Object.keys(x).length>0,O=Qc({data:t,columns:[{id:"select",size:40,header:({table:j})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":j.getIsAllRowsSelected(),"data-state":j.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:j.getToggleAllRowsSelectedHandler(),children:j.getIsAllRowsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(vr,{className:"size-3.5"})})}),cell:({row:j})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":j.getIsSelected(),"data-state":j.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:j.getToggleSelectedHandler(),children:j.getIsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(vr,{className:"size-3.5"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Wc(),getPaginationRowModel:tg(),onSortingChange:d,getSortedRowModel:xf(),onColumnFiltersChange:v,getFilteredRowModel:yf(),onColumnVisibilityChange:m,onRowSelectionChange:b,state:{sorting:c,columnFilters:g,columnVisibility:h,rowSelection:x},enableRowSelection:!0});return s?o.jsxs("div",{children:[o.jsx(ni,{}),o.jsx(mq,{})]}):t.length?o.jsxs("div",{className:"dm-card",children:[o.jsx(ni,{}),o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsxs("div",{className:"dm-card-toolbar-left",children:[_&&o.jsx(we,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{C(!0)},disabled:E,children:o.jsx(xp,{className:"h-4 w-4"})}),o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(vi,{className:"dm-card-toolbar-search-icon"}),o.jsx(zt,{placeholder:"Search by title",value:(A=O.getColumn("title"))==null?void 0:A.getFilterValue(),onChange:j=>{var D;return(D=O.getColumn("title"))==null?void 0:D.setFilterValue(j.target.value)},className:"dm-card-toolbar-search-input"})]})]}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsx(gi,{to:"/data-marts/create",children:o.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[o.jsx(ha,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Xc,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[o.jsx(Jc,{className:"dm-card-table-header",children:O.getHeaderGroups().map(j=>o.jsx(Zn,{className:"dm-card-table-header-row",children:j.headers.map(D=>o.jsx(tu,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:D.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:D.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(D.getSize())}%`},children:D.isPlaceholder?null:Lc(D.column.columnDef.header,D.getContext())},D.id))},j.id))}),o.jsx(eu,{className:"dm-card-table-body",children:O.getRowModel().rows.length?O.getRowModel().rows.map(j=>o.jsx(Zn,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:D=>{if(D.target instanceof HTMLElement&&(D.target.closest('[role="checkbox"]')||D.target.closest(".actions-cell")||D.target.closest('[role="menuitem"]')||D.target.closest('[data-state="open"]')))return;const k=j.original.id;l(`/data-marts/${k}/data-setup`)},children:j.getVisibleCells().map(D=>o.jsx(oa,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${D.column.id==="actions"?"actions-cell":""} ${D.column.id==="createdAt"?"whitespace-nowrap":""}`,style:D.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:D.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(D.column.getSize())}%`},children:Lc(D.column.columnDef.cell,D.getContext())},D.id))},j.id)):o.jsx(Zn,{children:o.jsx(oa,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{O.previousPage()},disabled:!O.getCanPreviousPage(),children:"Previous"}),o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{O.nextPage()},disabled:!O.getCanNextPage(),children:"Next"})]}),o.jsx(rq,{open:w,onOpenChange:C,children:o.jsxs(oq,{children:[o.jsxs(iq,{children:[o.jsx(cq,{children:"Are you sure?"}),o.jsxs(uq,{children:["You're about to delete ",Object.keys(x).length," selected data mart",Object.keys(x).length!==1?"s":"",". This action cannot be undone."]})]}),o.jsxs(lq,{children:[o.jsx(fq,{disabled:E,children:"Cancel"}),o.jsx(dq,{onClick:()=>{T()},disabled:E,className:"bg-destructive hover:bg-destructive/90",children:E?"Deleting...":"Delete"})]})]})})]}):o.jsxs("div",{className:"dm-card",children:[o.jsx(ni,{}),o.jsx(hq,{})]})}function Ki({column:e,children:t}){return o.jsxs(we,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(bs,{className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Oa,{className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(bs,{className:"text-muted-foreground h-4 w-4"})})]})]})}function q0({...e}){return o.jsx(Ep,{"data-slot":"dialog",...e})}function vq({...e}){return o.jsx(Rp,{"data-slot":"dialog-portal",...e})}function yq({className:e,...t}){return o.jsx(Tp,{"data-slot":"dialog-overlay",className:de("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 K0({className:e,children:t,showCloseButton:n=!0,...r}){return o.jsxs(vq,{"data-slot":"dialog-portal",children:[o.jsx(yq,{}),o.jsxs(_p,{"data-slot":"dialog-content",className:de("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&&o.jsxs(jp,{"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:[o.jsx(Ad,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Z0({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-header",className:de("flex flex-col gap-2 text-center sm:text-left",e),...t})}function xq({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-footer",className:de("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function ng({className:e,...t}){return o.jsx(Jb,{"data-slot":"dialog-title",className:de("text-lg leading-none font-semibold",e),...t})}function rg({className:e,...t}){return o.jsx(e0,{"data-slot":"dialog-description",className:de("text-muted-foreground text-sm",e),...t})}const bq=Wd("",{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 Vd({className:e,variant:t,...n}){return t==="brand"?o.jsx(we,{variant:"default",className:de(bq({variant:t}),e),...n}):o.jsx(we,{variant:t,className:e,...n})}const ia=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:l,onConfirm:c,onCancel:d,variant:h="destructive",children:m})=>{const g=()=>{t(!1),d==null||d()};return o.jsx(q0,{open:e,onOpenChange:t,children:o.jsxs(K0,{children:[o.jsxs(Z0,{children:[o.jsx(ng,{children:n}),o.jsx(rg,{children:r})]}),m,o.jsxs(xq,{children:[l&&o.jsx(Vd,{variant:"secondary",onClick:g,children:l}),o.jsx(Vd,{variant:h,onClick:c,children:s})]})]})})},Sq=({row:e,onDeleteSuccess:t})=>{const[n,r]=p.useState(!1),[s,l]=p.useState(!1),{deleteDataMart:c,refreshList:d}=mA(),h=async()=>{try{await c(e.original.id),r(!1),await d(),t==null||t()}catch(m){console.error("Failed to delete data mart:",m)}};return o.jsxs("div",{className:"text-right",children:[o.jsxs(xr,{open:s,onOpenChange:l,children:[o.jsx(br,{asChild:!0,children:o.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:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(cr,{align:"end",children:[o.jsx(Ft,{children:o.jsx(gi,{to:`/data-marts/${e.original.id}/data-setup`,className:"dm-card-table-body-row-actiondropdownitem",children:"Open"})}),o.jsx(Aa,{}),o.jsx(Ft,{className:"dm-card-table-body-row-actiondropdownitem text-red-600",onClick:()=>{r(!0)},children:"Delete"})]})]}),o.jsx(ia,{open:n,onOpenChange:r,title:"Delete Data Mart",description:"Are you sure you want to delete this data mart? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>void h(),variant:"destructive"})]})};var yn=(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))(yn||{});const Bo={[yn.TITLE]:"Title",[yn.DEFINITION_TYPE]:"Input Source",[yn.STORAGE_TYPE]:"Storage",[yn.STATUS]:"Status",[yn.TRIGGERS_COUNT]:"Triggers",[yn.REPORTS_COUNT]:"Reports",[yn.CREATED_AT]:"Created at"};function Cq({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(xr,{children:[o.jsx(br,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=Bo[t.id]||t.id;return o.jsx(Ft,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(vr,{className:"size-3.5"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const sT={types:{[Qe.SQL]:{type:Qe.SQL,displayName:"SQL",icon:L_},[Qe.TABLE]:{type:Qe.TABLE,displayName:"Table",icon:g6},[Qe.VIEW]:{type:Qe.VIEW,displayName:"View",icon:_5},[Qe.TABLE_PATTERN]:{type:Qe.TABLE_PATTERN,displayName:"Pattern",icon:PL},[Qe.CONNECTOR]:{type:Qe.CONNECTOR,displayName:"Connector",icon:P_}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}},wq=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:yn.TITLE,size:40,header:({column:n})=>o.jsx(Ki,{column:n,children:Bo[yn.TITLE]}),cell:({row:n})=>o.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===Qe.CONNECTOR){const s=n.definition,l=t.find(c=>c.name===s.connector.source.name);return(l==null?void 0:l.displayName)??(l==null?void 0:l.name)??"Unknown"}else{const{displayName:s}=sT.getInfo(r);return s}},id:yn.DEFINITION_TYPE,size:15,header:({column:n})=>o.jsx(Ki,{column:n,children:Bo[yn.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case Qe.CONNECTOR:{const s=n.original.definition,l=t.find(c=>c.name===s.connector.source.name);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(l==null?void 0:l.logoBase64)&&o.jsx(df,{base64:l.logoBase64,size:18}),(l==null?void 0:l.displayName)??"Unknown"]})}default:{const{displayName:s,icon:l}=sT.getInfo(r);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(l,{className:"h-4 w-4"}),s]})}}}},{accessorKey:yn.STORAGE_TYPE,size:15,header:({column:n})=>o.jsx(Ki,{column:n,children:Bo[yn.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:l,icon:c}=Ci.getInfo(r),d=s??l;return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),d]})}},{accessorKey:yn.CREATED_AT,size:15,header:({column:n})=>o.jsx(Ki,{column:n,children:Bo[yn.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 o.jsx("div",{className:"text-muted-foreground",children:s})}},{accessorKey:yn.STATUS,size:15,header:({column:n})=>o.jsx(Ki,{column:n,children:Bo[yn.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return o.jsx(vf,{type:UB(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:yn.TRIGGERS_COUNT,size:15,header:({column:n})=>o.jsx(Ki,{column:n,children:Bo[yn.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:yn.REPORTS_COUNT,size:15,header:({column:n})=>o.jsx(Ki,{column:n,children:Bo[yn.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>o.jsx(Cq,{table:n}),cell:({row:n})=>o.jsx(Sq,{row:n,onDeleteSuccess:e})}];var Gn=(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))(Gn||{});const Eq={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function Rq(e,t){switch(t.type){case Gn.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case Gn.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case Gn.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case Gn.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case Gn.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case Gn.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case Gn.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case Gn.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case Gn.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const LA=p.createContext(void 0);function Pc({children:e}){const[t,n]=p.useReducer(Rq,Eq);return o.jsx(LA.Provider,{value:{state:t,dispatch:n},children:e})}function Tq(){const e=p.useContext(LA);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var us=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(us||{});class fx extends Yc{constructor(){super("/connectors")}async getAvailableConnectors(){return this.get("/")}async getConnectorSpecification(t){return this.get(`/${t}/specification`)}async getConnectorFields(t){return this.get(`/${t}/fields`)}}function _q(e){return e.map(t=>({name:t.name,displayName:t.title??t.name,description:t.description??"",logoBase64:t.logo,docUrl:t.docUrl}))}function Sl(){const{state:e,dispatch:t}=Tq(),n=p.useMemo(()=>_q(e.connectors),[e.connectors]),r=p.useCallback(async()=>{t({type:Gn.FETCH_CONNECTORS_START});try{const d=await new fx().getAvailableConnectors();t({type:Gn.FETCH_CONNECTORS_SUCCESS,payload:d})}catch(c){t({type:Gn.FETCH_CONNECTORS_ERROR,payload:c instanceof Error?c.message:"Unknown error"})}},[t]),s=p.useCallback(async c=>{t({type:Gn.FETCH_CONNECTOR_SPECIFICATION_START});try{const h=await new fx().getConnectorSpecification(c);t({type:Gn.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:h})}catch(d){t({type:Gn.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:d instanceof Error?d.message:"Unknown error"})}},[t]),l=p.useCallback(async c=>{t({type:Gn.FETCH_CONNECTOR_FIELDS_START});try{const h=await new fx().getConnectorFields(c);t({type:Gn.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:h})}catch(d){t({type:Gn.FETCH_CONNECTOR_FIELDS_ERROR,payload:d instanceof Error?d.message:"Unknown error"})}},[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:l}}const jq=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=mA(),{connectors:l,fetchAvailableConnectors:c}=Sl();return p.useEffect(()=>{c()},[c]),p.useEffect(()=>{t()},[t]),o.jsx(gq,{columns:wq({connectors:l}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function Nq(){return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(s$,{children:o.jsx(Pc,{children:o.jsx(jq,{})})})})]})}const PA=p.createContext(void 0),ld=e=>{const t=BB(e);return{...e,canPublish:t.length===0,validationErrors:t}},UA={dataMart:null,isLoading:!1,error:null,runs:[]};function Aq(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:ld(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:ld({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:ld({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:ld({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:ld({...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 UA;default:return e}}function wi(){const e=p.useContext(PA);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class Dq{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:Ie.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 Oq{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:Ie.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}}const FA={getMapper(e){switch(e){case Ie.GOOGLE_BIGQUERY:return new Dq;case Ie.AWS_ATHENA:return new Oq;default:throw new Error(`Unknown storage type: ${e}`)}}};function ym(e){return FA.getMapper(e.type).mapFromDto(e)}function Mq(e){const t=FA.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function kq(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Iq(e){return{type:e}}function Lq(e){return{sqlQuery:e.sqlQuery}}function Pq(e){return{sqlQuery:e.sqlQuery}}function Uq(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Fq(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Hq(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Vq(e){return{fullyQualifiedName:e.fullyQualifiedName}}function zq(e){return{pattern:e.pattern}}function $q(e){return{pattern:e.pattern}}function Bq(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 Gq(e){const t=e.connector;return{connector:{source:{name:t.source.name,configuration:t.source.configuration,node:t.source.node,fields:t.source.fields},storage:{fullyQualifiedName:t.storage.fullyQualifiedName}}}}function qq(e,t){if(!e||!t)return null;switch(e){case Qe.SQL:return Pq(t);case Qe.TABLE:return Fq(t);case Qe.VIEW:return Vq(t);case Qe.TABLE_PATTERN:return $q(t);case Qe.CONNECTOR:return Gq(t);default:return console.warn(`Unknown definition type: ${String(e)}`),null}}function hc(e){return{id:e.id,title:e.title,description:e.description,status:zN.getInfo(e.status),storage:ym(e.storage),definitionType:e.definitionType,definition:qq(e.definitionType,e.definition),schema:e.schema,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,validationErrors:[]}}function Kq(e){return{id:e.id,title:e.title}}const Bn=e=>{var n;return(n=e.response)==null?void 0:n.data};function HA({children:e}){const[t,n]=p.useReducer(Aq,UA),r=p.useCallback(async A=>{try{n({type:"FETCH_DATA_MART_START"});const j=await ir.getDataMartById(A),D=hc(j);n({type:"FETCH_DATA_MART_SUCCESS",payload:D})}catch(j){n({type:"FETCH_DATA_MART_ERROR",payload:Bn(j)})}},[]),s=async A=>{try{n({type:"CREATE_DATA_MART_START"});const j=await ir.createDataMart(A),D=Kq(j);return n({type:"CREATE_DATA_MART_SUCCESS",payload:D}),D}catch(j){throw n({type:"CREATE_DATA_MART_ERROR",payload:Bn(j)}),j}},l=async(A,j)=>{try{n({type:"UPDATE_DATA_MART_START"});const D=await ir.updateDataMart(A,j),k=hc(D);n({type:"UPDATE_DATA_MART_SUCCESS",payload:k})}catch(D){n({type:"UPDATE_DATA_MART_ERROR",payload:Bn(D)})}},c=async A=>{try{n({type:"DELETE_DATA_MART_START"}),await ir.deleteDataMart(A),n({type:"DELETE_DATA_MART_SUCCESS"})}catch(j){n({type:"DELETE_DATA_MART_ERROR",payload:Bn(j)})}},d=async(A,j)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await ir.updateDataMartTitle(A,j),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:j})}catch(D){n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:Bn(D)})}},h=async(A,j)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await ir.updateDataMartDescription(A,j),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:j??""})}catch(D){n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:Bn(D)})}},m=p.useCallback(A=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:A})},[]),g=async(A,j,D)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let k;switch(j){case Qe.SQL:k={definitionType:j,definition:Lq(D)};break;case Qe.TABLE:k={definitionType:j,definition:Uq(D)};break;case Qe.VIEW:k={definitionType:j,definition:Hq(D)};break;case Qe.TABLE_PATTERN:k={definitionType:j,definition:zq(D)};break;case Qe.CONNECTOR:{k={definitionType:Qe.CONNECTOR,definition:Bq(D)};break}default:throw new Error(`Unsupported definition type: ${String(j)}`)}const V=await ir.updateDataMartDefinition(A,k),B=hc(V);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:j,definition:D}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:B})}catch(k){n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:Bn(k)})}},v=async A=>{try{n({type:"PUBLISH_DATA_MART_START"});const j=await ir.publishDataMart(A),D=hc(j);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:D})}catch(j){throw n({type:"PUBLISH_DATA_MART_ERROR",payload:Bn(j)}),j}},x=async A=>{try{n({type:"RUN_DATA_MART_START"}),await ir.runDataMart(A.id,A.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(j){n({type:"RUN_DATA_MART_ERROR",payload:Bn(j)})}},b=async(A,j)=>{try{await ir.cancelDataMartRun(A,j),await E(A)}catch(D){n({type:"RUN_DATA_MART_ERROR",payload:Bn(D)})}},w=async A=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const j=await ir.actualizeDataMartSchema(A),D=hc(j);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:D})}catch(j){n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:Bn(j)})}},C=async(A,j)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const D=await ir.updateDataMartSchema(A,{schema:j}),k=hc(D);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:k})}catch(D){n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:Bn(D)})}},E=p.useCallback(async(A,j=5,D=0)=>{try{n({type:"FETCH_DATA_MART_RUNS_START"});const k=await ir.getDataMartRuns(A,j,D);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:k}),k}catch(k){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:Bn(k)}),k}},[]),R=p.useCallback(async(A,j,D=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const k=await ir.getDataMartRuns(A,D,j);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:k}),k}catch(k){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:Bn(k)}),k}},[]),T=p.useCallback(()=>{n({type:"RESET"})},[]),_=p.useCallback(()=>t.error?t.error.message:null,[t.error]),O={...t,getDataMart:r,createDataMart:s,updateDataMart:l,deleteDataMart:c,updateDataMartTitle:d,updateDataMartDescription:h,updateDataMartStorage:m,updateDataMartDefinition:g,publishDataMart:v,runDataMart:x,cancelDataMartRun:b,actualizeDataMartSchema:w,updateDataMartSchema:C,getDataMartRuns:E,loadMoreDataMartRuns:R,getErrorMessage:_,reset:T};return o.jsx(PA.Provider,{value:O,children:e})}var Sf=e=>e.type==="checkbox",Xi=e=>e instanceof Date,Er=e=>e==null;const VA=e=>typeof e=="object";var _n=e=>!Er(e)&&!Array.isArray(e)&&VA(e)&&!Xi(e),zA=e=>_n(e)&&e.target?Sf(e.target)?e.target.checked:e.target.value:e,Zq=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,$A=(e,t)=>e.has(Zq(t)),Yq=e=>{const t=e.constructor&&e.constructor.prototype;return _n(t)&&t.hasOwnProperty("isPrototypeOf")},Y0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function $n(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(!(Y0&&(e instanceof Blob||r))&&(n||_n(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!Yq(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=$n(e[s]));else return e;return t}var ag=e=>/^\w*$/.test(e),Rn=e=>e===void 0,W0=e=>Array.isArray(e)?e.filter(Boolean):[],Q0=e=>W0(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ae=(e,t,n)=>{if(!t||!_n(e))return n;const r=(ag(t)?[t]:Q0(t)).reduce((s,l)=>Er(s)?s:s[l],e);return Rn(r)||r===e?Rn(e[t])?n:e[t]:r},Jr=e=>typeof e=="boolean",Gt=(e,t,n)=>{let r=-1;const s=ag(t)?[t]:Q0(t),l=s.length,c=l-1;for(;++r<l;){const d=s[r];let h=n;if(r!==c){const m=e[d];h=_n(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=h,e=e[d]}};const tp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},za={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ws={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},X0=je.createContext(null);X0.displayName="HookFormContext";const nu=()=>je.useContext(X0),BA=e=>{const{children:t,...n}=e;return je.createElement(X0.Provider,{value:n},t)};var GA=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(s,l,{get:()=>{const c=l;return t._proxyFormState[c]!==za.all&&(t._proxyFormState[c]=!r||za.all),n&&(n[c]=!0),e[c]}});return s};const J0=typeof window<"u"?je.useLayoutEffect:je.useEffect;function qA(e){const t=nu(),{control:n=t.control,disabled:r,name:s,exact:l}=e||{},[c,d]=je.useState(n._formState),h=je.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return J0(()=>n._subscribe({name:s,formState:h.current,exact:l,callback:m=>{!r&&d({...n._formState,...m})}}),[s,r,l]),je.useEffect(()=>{h.current.isValid&&n._setValid(!0)},[n]),je.useMemo(()=>GA(c,n,h.current,!1),[c,n])}var gs=e=>typeof e=="string",KA=(e,t,n,r,s)=>gs(e)?(r&&t.watch.add(e),Ae(n,e,s)):Array.isArray(e)?e.map(l=>(r&&t.watch.add(l),Ae(n,l))):(r&&(t.watchAll=!0),n),hb=e=>Er(e)||!VA(e);function to(e,t,n=new WeakSet){if(hb(e)||hb(t))return e===t;if(Xi(e)&&Xi(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 l of r){const c=e[l];if(!s.includes(l))return!1;if(l!=="ref"){const d=t[l];if(Xi(c)&&Xi(d)||_n(c)&&_n(d)||Array.isArray(c)&&Array.isArray(d)?!to(c,d,n):c!==d)return!1}}return!0}function Wq(e){const t=nu(),{control:n=t.control,name:r,defaultValue:s,disabled:l,exact:c,compute:d}=e||{},h=je.useRef(s),m=je.useRef(d),g=je.useRef(void 0);m.current=d;const v=je.useMemo(()=>n._getWatch(r,h.current),[n,r]),[x,b]=je.useState(m.current?m.current(v):v);return J0(()=>n._subscribe({name:r,formState:{values:!0},exact:c,callback:w=>{if(!l){const C=KA(r,n._names,w.values||n._formValues,!1,h.current);if(m.current){const E=m.current(C);to(E,g.current)||(b(E),g.current=E)}else b(C)}}}),[n,l,r,c]),je.useEffect(()=>n._removeUnmounted()),x}function Qq(e){const t=nu(),{name:n,disabled:r,control:s=t.control,shouldUnregister:l,defaultValue:c}=e,d=$A(s._names.array,n),h=je.useMemo(()=>Ae(s._formValues,n,Ae(s._defaultValues,n,c)),[s,n,c]),m=Wq({control:s,name:n,defaultValue:h,exact:!0}),g=qA({control:s,name:n,exact:!0}),v=je.useRef(e),x=je.useRef(s.register(n,{...e.rules,value:m,...Jr(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const b=je.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ae(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ae(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ae(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ae(g.validatingFields,n)},error:{enumerable:!0,get:()=>Ae(g.errors,n)}}),[g,n]),w=je.useCallback(T=>x.current.onChange({target:{value:zA(T),name:n},type:tp.CHANGE}),[n]),C=je.useCallback(()=>x.current.onBlur({target:{value:Ae(s._formValues,n),name:n},type:tp.BLUR}),[n,s._formValues]),E=je.useCallback(T=>{const _=Ae(s._fields,n);_&&T&&(_._f.ref={focus:()=>T.focus&&T.focus(),select:()=>T.select&&T.select(),setCustomValidity:O=>T.setCustomValidity(O),reportValidity:()=>T.reportValidity()})},[s._fields,n]),R=je.useMemo(()=>({name:n,value:m,...Jr(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:w,onBlur:C,ref:E}),[n,r,g.disabled,w,C,E,m]);return je.useEffect(()=>{const T=s._options.shouldUnregister||l;s.register(n,{...v.current.rules,...Jr(v.current.disabled)?{disabled:v.current.disabled}:{}});const _=(O,A)=>{const j=Ae(s._fields,O);j&&j._f&&(j._f.mount=A)};if(_(n,!0),T){const O=$n(Ae(s._options.defaultValues,n));Gt(s._defaultValues,n,O),Rn(Ae(s._formValues,n))&&Gt(s._formValues,n,O)}return!d&&s.register(n),()=>{(d?T&&!s._state.action:T)?s.unregister(n):_(n,!1)}},[n,s,d,l]),je.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),je.useMemo(()=>({field:R,formState:g,fieldState:b}),[R,g,b])}const Xq=e=>e.render(Qq(e));var eS=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Sd=e=>Array.isArray(e)?e:[e],oT=()=>{let e=[];return{get observers(){return e},next:s=>{for(const l of e)l.next&&l.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(l=>l!==s)}}),unsubscribe:()=>{e=[]}}},Ir=e=>_n(e)&&!Object.keys(e).length,tS=e=>e.type==="file",$a=e=>typeof e=="function",np=e=>{if(!Y0)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ZA=e=>e.type==="select-multiple",nS=e=>e.type==="radio",Jq=e=>nS(e)||Sf(e),hx=e=>np(e)&&e.isConnected;function eK(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Rn(e)?r++:e[t[r++]];return e}function tK(e){for(const t in e)if(e.hasOwnProperty(t)&&!Rn(e[t]))return!1;return!0}function Dn(e,t){const n=Array.isArray(t)?t:ag(t)?[t]:Q0(t),r=n.length===1?e:eK(e,n),s=n.length-1,l=n[s];return r&&delete r[l],s!==0&&(_n(r)&&Ir(r)||Array.isArray(r)&&tK(r))&&Dn(e,n.slice(0,-1)),e}var YA=e=>{for(const t in e)if($a(e[t]))return!0;return!1};function rp(e,t={}){const n=Array.isArray(e);if(_n(e)||n)for(const r in e)Array.isArray(e[r])||_n(e[r])&&!YA(e[r])?(t[r]=Array.isArray(e[r])?[]:{},rp(e[r],t[r])):Er(e[r])||(t[r]=!0);return t}function WA(e,t,n){const r=Array.isArray(e);if(_n(e)||r)for(const s in e)Array.isArray(e[s])||_n(e[s])&&!YA(e[s])?Rn(t)||hb(n[s])?n[s]=Array.isArray(e[s])?rp(e[s],[]):{...rp(e[s])}:WA(e[s],Er(t)?{}:t[s],n[s]):n[s]=!to(e[s],t[s]);return n}var cd=(e,t)=>WA(e,t,rp(t));const iT={value:!1,isValid:!1},lT={value:!0,isValid:!0};var QA=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Rn(e[0].attributes.value)?Rn(e[0].value)||e[0].value===""?lT:{value:e[0].value,isValid:!0}:lT:iT}return iT},XA=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Rn(e)?e:t?e===""?NaN:e&&+e:n&&gs(e)?new Date(e):r?r(e):e;const cT={isValid:!1,value:null};var JA=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,cT):cT;function uT(e){const t=e.ref;return tS(t)?t.files:nS(t)?JA(e.refs).value:ZA(t)?[...t.selectedOptions].map(({value:n})=>n):Sf(t)?QA(e.refs).value:XA(Rn(t.value)?e.ref.value:t.value,e)}var nK=(e,t,n,r)=>{const s={};for(const l of e){const c=Ae(t,l);c&&Gt(s,l,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},ap=e=>e instanceof RegExp,ud=e=>Rn(e)?e:ap(e)?e.source:_n(e)?ap(e.value)?e.value.source:e.value:e,dT=e=>({isOnSubmit:!e||e===za.onSubmit,isOnBlur:e===za.onBlur,isOnChange:e===za.onChange,isOnAll:e===za.all,isOnTouch:e===za.onTouched});const fT="AsyncFunction";var rK=e=>!!e&&!!e.validate&&!!($a(e.validate)&&e.validate.constructor.name===fT||_n(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===fT)),aK=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),hT=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Cd=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const l=Ae(e,s);if(l){const{_f:c,...d}=l;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(Cd(d,t))break}else if(_n(d)&&Cd(d,t))break}}};function mT(e,t,n){const r=Ae(e,n);if(r||ag(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const l=s.join("."),c=Ae(t,l),d=Ae(e,l);if(c&&!Array.isArray(c)&&n!==l)return{name:n};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};s.pop()}return{name:n}}var sK=(e,t,n,r)=>{n(e);const{name:s,...l}=e;return Ir(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(c=>t[c]===(!r||za.all))},oK=(e,t,n)=>!e||!t||e===t||Sd(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),iK=(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,lK=(e,t)=>!W0(Ae(e,t)).length&&Dn(e,t),cK=(e,t,n)=>{const r=Sd(Ae(e,n));return Gt(r,"root",t[n]),Gt(e,n,r),e},xm=e=>gs(e);function pT(e,t,n="validate"){if(xm(e)||Array.isArray(e)&&e.every(xm)||Jr(e)&&!e)return{type:n,message:xm(e)?e:"",ref:t}}var mc=e=>_n(e)&&!ap(e)?e:{value:e,message:""},gT=async(e,t,n,r,s,l)=>{const{ref:c,refs:d,required:h,maxLength:m,minLength:g,min:v,max:x,pattern:b,validate:w,name:C,valueAsNumber:E,mount:R}=e._f,T=Ae(n,C);if(!R||t.has(C))return{};const _=d?d[0]:c,O=J=>{s&&_.reportValidity&&(_.setCustomValidity(Jr(J)?"":J||""),_.reportValidity())},A={},j=nS(c),D=Sf(c),k=j||D,V=(E||tS(c))&&Rn(c.value)&&Rn(T)||np(c)&&c.value===""||T===""||Array.isArray(T)&&!T.length,B=eS.bind(null,C,r,A),z=(J,oe,K,Y=Ws.maxLength,I=Ws.minLength)=>{const W=J?oe:K;A[C]={type:J?Y:I,message:W,ref:c,...B(J?Y:I,W)}};if(l?!Array.isArray(T)||!T.length:h&&(!k&&(V||Er(T))||Jr(T)&&!T||D&&!QA(d).isValid||j&&!JA(d).isValid)){const{value:J,message:oe}=xm(h)?{value:!!h,message:h}:mc(h);if(J&&(A[C]={type:Ws.required,message:oe,ref:_,...B(Ws.required,oe)},!r))return O(oe),A}if(!V&&(!Er(v)||!Er(x))){let J,oe;const K=mc(x),Y=mc(v);if(!Er(T)&&!isNaN(T)){const I=c.valueAsNumber||T&&+T;Er(K.value)||(J=I>K.value),Er(Y.value)||(oe=I<Y.value)}else{const I=c.valueAsDate||new Date(T),W=L=>new Date(new Date().toDateString()+" "+L),G=c.type=="time",ie=c.type=="week";gs(K.value)&&T&&(J=G?W(T)>W(K.value):ie?T>K.value:I>new Date(K.value)),gs(Y.value)&&T&&(oe=G?W(T)<W(Y.value):ie?T<Y.value:I<new Date(Y.value))}if((J||oe)&&(z(!!J,K.message,Y.message,Ws.max,Ws.min),!r))return O(A[C].message),A}if((m||g)&&!V&&(gs(T)||l&&Array.isArray(T))){const J=mc(m),oe=mc(g),K=!Er(J.value)&&T.length>+J.value,Y=!Er(oe.value)&&T.length<+oe.value;if((K||Y)&&(z(K,J.message,oe.message),!r))return O(A[C].message),A}if(b&&!V&&gs(T)){const{value:J,message:oe}=mc(b);if(ap(J)&&!T.match(J)&&(A[C]={type:Ws.pattern,message:oe,ref:c,...B(Ws.pattern,oe)},!r))return O(oe),A}if(w){if($a(w)){const J=await w(T,n),oe=pT(J,_);if(oe&&(A[C]={...oe,...B(Ws.validate,oe.message)},!r))return O(oe.message),A}else if(_n(w)){let J={};for(const oe in w){if(!Ir(J)&&!r)break;const K=pT(await w[oe](T,n),_,oe);K&&(J={...K,...B(oe,K.message)},O(K.message),r&&(A[C]=J))}if(!Ir(J)&&(A[C]={ref:_,...J},!r))return A}}return O(!0),A};const uK={mode:za.onSubmit,reValidateMode:za.onChange,shouldFocusError:!0};function dK(e={}){let t={...uK,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:$a(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=_n(t.defaultValues)||_n(t.values)?$n(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:$n(s),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},h,m=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let v={...g};const x={array:oT(),state:oT()},b=t.criteriaMode===za.all,w=H=>te=>{clearTimeout(m),m=setTimeout(H,te)},C=async H=>{if(!t.disabled&&(g.isValid||v.isValid||H)){const te=t.resolver?Ir((await D()).errors):await V(r,!0);te!==n.isValid&&x.state.next({isValid:te})}},E=(H,te)=>{!t.disabled&&(g.isValidating||g.validatingFields||v.isValidating||v.validatingFields)&&((H||Array.from(d.mount)).forEach(ue=>{ue&&(te?Gt(n.validatingFields,ue,te):Dn(n.validatingFields,ue))}),x.state.next({validatingFields:n.validatingFields,isValidating:!Ir(n.validatingFields)}))},R=(H,te=[],ue,_e,Re=!0,Ce=!0)=>{if(_e&&ue&&!t.disabled){if(c.action=!0,Ce&&Array.isArray(Ae(r,H))){const ke=ue(Ae(r,H),_e.argA,_e.argB);Re&&Gt(r,H,ke)}if(Ce&&Array.isArray(Ae(n.errors,H))){const ke=ue(Ae(n.errors,H),_e.argA,_e.argB);Re&&Gt(n.errors,H,ke),lK(n.errors,H)}if((g.touchedFields||v.touchedFields)&&Ce&&Array.isArray(Ae(n.touchedFields,H))){const ke=ue(Ae(n.touchedFields,H),_e.argA,_e.argB);Re&&Gt(n.touchedFields,H,ke)}(g.dirtyFields||v.dirtyFields)&&(n.dirtyFields=cd(s,l)),x.state.next({name:H,isDirty:z(H,te),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Gt(l,H,te)},T=(H,te)=>{Gt(n.errors,H,te),x.state.next({errors:n.errors})},_=H=>{n.errors=H,x.state.next({errors:n.errors,isValid:!1})},O=(H,te,ue,_e)=>{const Re=Ae(r,H);if(Re){const Ce=Ae(l,H,Rn(ue)?Ae(s,H):ue);Rn(Ce)||_e&&_e.defaultChecked||te?Gt(l,H,te?Ce:uT(Re._f)):K(H,Ce),c.mount&&C()}},A=(H,te,ue,_e,Re)=>{let Ce=!1,ke=!1;const Be={name:H};if(!t.disabled){if(!ue||_e){(g.isDirty||v.isDirty)&&(ke=n.isDirty,n.isDirty=Be.isDirty=z(),Ce=ke!==Be.isDirty);const ct=to(Ae(s,H),te);ke=!!Ae(n.dirtyFields,H),ct?Dn(n.dirtyFields,H):Gt(n.dirtyFields,H,!0),Be.dirtyFields=n.dirtyFields,Ce=Ce||(g.dirtyFields||v.dirtyFields)&&ke!==!ct}if(ue){const ct=Ae(n.touchedFields,H);ct||(Gt(n.touchedFields,H,ue),Be.touchedFields=n.touchedFields,Ce=Ce||(g.touchedFields||v.touchedFields)&&ct!==ue)}Ce&&Re&&x.state.next(Be)}return Ce?Be:{}},j=(H,te,ue,_e)=>{const Re=Ae(n.errors,H),Ce=(g.isValid||v.isValid)&&Jr(te)&&n.isValid!==te;if(t.delayError&&ue?(h=w(()=>T(H,ue)),h(t.delayError)):(clearTimeout(m),h=null,ue?Gt(n.errors,H,ue):Dn(n.errors,H)),(ue?!to(Re,ue):Re)||!Ir(_e)||Ce){const ke={..._e,...Ce&&Jr(te)?{isValid:te}:{},errors:n.errors,name:H};n={...n,...ke},x.state.next(ke)}},D=async H=>{E(H,!0);const te=await t.resolver(l,t.context,nK(H||d.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return E(H),te},k=async H=>{const{errors:te}=await D(H);if(H)for(const ue of H){const _e=Ae(te,ue);_e?Gt(n.errors,ue,_e):Dn(n.errors,ue)}else n.errors=te;return te},V=async(H,te,ue={valid:!0})=>{for(const _e in H){const Re=H[_e];if(Re){const{_f:Ce,...ke}=Re;if(Ce){const Be=d.array.has(Ce.name),ct=Re._f&&rK(Re._f);ct&&g.validatingFields&&E([_e],!0);const Et=await gT(Re,d.disabled,l,b,t.shouldUseNativeValidation&&!te,Be);if(ct&&g.validatingFields&&E([_e]),Et[Ce.name]&&(ue.valid=!1,te))break;!te&&(Ae(Et,Ce.name)?Be?cK(n.errors,Et,Ce.name):Gt(n.errors,Ce.name,Et[Ce.name]):Dn(n.errors,Ce.name))}!Ir(ke)&&await V(ke,te,ue)}}return ue.valid},B=()=>{for(const H of d.unMount){const te=Ae(r,H);te&&(te._f.refs?te._f.refs.every(ue=>!hx(ue)):!hx(te._f.ref))&&fe(H)}d.unMount=new Set},z=(H,te)=>!t.disabled&&(H&&te&&Gt(l,H,te),!to(L(),s)),J=(H,te,ue)=>KA(H,d,{...c.mount?l:Rn(te)?s:gs(H)?{[H]:te}:te},ue,te),oe=H=>W0(Ae(c.mount?l:s,H,t.shouldUnregister?Ae(s,H,[]):[])),K=(H,te,ue={})=>{const _e=Ae(r,H);let Re=te;if(_e){const Ce=_e._f;Ce&&(!Ce.disabled&&Gt(l,H,XA(te,Ce)),Re=np(Ce.ref)&&Er(te)?"":te,ZA(Ce.ref)?[...Ce.ref.options].forEach(ke=>ke.selected=Re.includes(ke.value)):Ce.refs?Sf(Ce.ref)?Ce.refs.forEach(ke=>{(!ke.defaultChecked||!ke.disabled)&&(Array.isArray(Re)?ke.checked=!!Re.find(Be=>Be===ke.value):ke.checked=Re===ke.value||!!Re)}):Ce.refs.forEach(ke=>ke.checked=ke.value===Re):tS(Ce.ref)?Ce.ref.value="":(Ce.ref.value=Re,Ce.ref.type||x.state.next({name:H,values:$n(l)})))}(ue.shouldDirty||ue.shouldTouch)&&A(H,Re,ue.shouldTouch,ue.shouldDirty,!0),ue.shouldValidate&&ie(H)},Y=(H,te,ue)=>{for(const _e in te){if(!te.hasOwnProperty(_e))return;const Re=te[_e],Ce=H+"."+_e,ke=Ae(r,Ce);(d.array.has(H)||_n(Re)||ke&&!ke._f)&&!Xi(Re)?Y(Ce,Re,ue):K(Ce,Re,ue)}},I=(H,te,ue={})=>{const _e=Ae(r,H),Re=d.array.has(H),Ce=$n(te);Gt(l,H,Ce),Re?(x.array.next({name:H,values:$n(l)}),(g.isDirty||g.dirtyFields||v.isDirty||v.dirtyFields)&&ue.shouldDirty&&x.state.next({name:H,dirtyFields:cd(s,l),isDirty:z(H,Ce)})):_e&&!_e._f&&!Er(Ce)?Y(H,Ce,ue):K(H,Ce,ue),hT(H,d)&&x.state.next({...n,name:H}),x.state.next({name:c.mount?H:void 0,values:$n(l)})},W=async H=>{c.mount=!0;const te=H.target;let ue=te.name,_e=!0;const Re=Ae(r,ue),Ce=ct=>{_e=Number.isNaN(ct)||Xi(ct)&&isNaN(ct.getTime())||to(ct,Ae(l,ue,ct))},ke=dT(t.mode),Be=dT(t.reValidateMode);if(Re){let ct,Et;const La=te.type?uT(Re._f):zA(H),Wt=H.type===tp.BLUR||H.type===tp.FOCUS_OUT,As=!aK(Re._f)&&!t.resolver&&!Ae(n.errors,ue)&&!Re._f.deps||iK(Wt,Ae(n.touchedFields,ue),n.isSubmitted,Be,ke),Vr=hT(ue,d,Wt);Gt(l,ue,La),Wt?(!te||!te.readOnly)&&(Re._f.onBlur&&Re._f.onBlur(H),h&&h(0)):Re._f.onChange&&Re._f.onChange(H);const zr=A(ue,La,Wt),Sr=!Ir(zr)||Vr;if(!Wt&&x.state.next({name:ue,type:H.type,values:$n(l)}),As)return(g.isValid||v.isValid)&&(t.mode==="onBlur"?Wt&&C():Wt||C()),Sr&&x.state.next({name:ue,...Vr?{}:zr});if(!Wt&&Vr&&x.state.next({...n}),t.resolver){const{errors:$r}=await D([ue]);if(Ce(La),_e){const Ar=mT(n.errors,r,ue),es=mT($r,r,Ar.name||ue);ct=es.error,ue=es.name,Et=Ir($r)}}else E([ue],!0),ct=(await gT(Re,d.disabled,l,b,t.shouldUseNativeValidation))[ue],E([ue]),Ce(La),_e&&(ct?Et=!1:(g.isValid||v.isValid)&&(Et=await V(r,!0)));_e&&(Re._f.deps&&ie(Re._f.deps),j(ue,Et,ct,zr))}},G=(H,te)=>{if(Ae(n.errors,te)&&H.focus)return H.focus(),1},ie=async(H,te={})=>{let ue,_e;const Re=Sd(H);if(t.resolver){const Ce=await k(Rn(H)?H:Re);ue=Ir(Ce),_e=H?!Re.some(ke=>Ae(Ce,ke)):ue}else H?(_e=(await Promise.all(Re.map(async Ce=>{const ke=Ae(r,Ce);return await V(ke&&ke._f?{[Ce]:ke}:ke)}))).every(Boolean),!(!_e&&!n.isValid)&&C()):_e=ue=await V(r);return x.state.next({...!gs(H)||(g.isValid||v.isValid)&&ue!==n.isValid?{}:{name:H},...t.resolver||!H?{isValid:ue}:{},errors:n.errors}),te.shouldFocus&&!_e&&Cd(r,G,H?Re:d.mount),_e},L=H=>{const te={...c.mount?l:s};return Rn(H)?te:gs(H)?Ae(te,H):H.map(ue=>Ae(te,ue))},Z=(H,te)=>({invalid:!!Ae((te||n).errors,H),isDirty:!!Ae((te||n).dirtyFields,H),error:Ae((te||n).errors,H),isValidating:!!Ae(n.validatingFields,H),isTouched:!!Ae((te||n).touchedFields,H)}),U=H=>{H&&Sd(H).forEach(te=>Dn(n.errors,te)),x.state.next({errors:H?n.errors:{}})},q=(H,te,ue)=>{const _e=(Ae(r,H,{_f:{}})._f||{}).ref,Re=Ae(n.errors,H)||{},{ref:Ce,message:ke,type:Be,...ct}=Re;Gt(n.errors,H,{...ct,...te,ref:_e}),x.state.next({name:H,errors:n.errors,isValid:!1}),ue&&ue.shouldFocus&&_e&&_e.focus&&_e.focus()},le=(H,te)=>$a(H)?x.state.subscribe({next:ue=>"values"in ue&&H(J(void 0,te),ue)}):J(H,te,!0),me=H=>x.state.subscribe({next:te=>{oK(H.name,te.name,H.exact)&&sK(te,H.formState||g,Tt,H.reRenderRoot)&&H.callback({values:{...l},...n,...te,defaultValues:s})}}).unsubscribe,ve=H=>(c.mount=!0,v={...v,...H.formState},me({...H,formState:v})),fe=(H,te={})=>{for(const ue of H?Sd(H):d.mount)d.mount.delete(ue),d.array.delete(ue),te.keepValue||(Dn(r,ue),Dn(l,ue)),!te.keepError&&Dn(n.errors,ue),!te.keepDirty&&Dn(n.dirtyFields,ue),!te.keepTouched&&Dn(n.touchedFields,ue),!te.keepIsValidating&&Dn(n.validatingFields,ue),!t.shouldUnregister&&!te.keepDefaultValue&&Dn(s,ue);x.state.next({values:$n(l)}),x.state.next({...n,...te.keepDirty?{isDirty:z()}:{}}),!te.keepIsValid&&C()},Ee=({disabled:H,name:te})=>{(Jr(H)&&c.mount||H||d.disabled.has(te))&&(H?d.disabled.add(te):d.disabled.delete(te))},De=(H,te={})=>{let ue=Ae(r,H);const _e=Jr(te.disabled)||Jr(t.disabled);return Gt(r,H,{...ue||{},_f:{...ue&&ue._f?ue._f:{ref:{name:H}},name:H,mount:!0,...te}}),d.mount.add(H),ue?Ee({disabled:Jr(te.disabled)?te.disabled:t.disabled,name:H}):O(H,!0,te.value),{..._e?{disabled:te.disabled||t.disabled}:{},...t.progressive?{required:!!te.required,min:ud(te.min),max:ud(te.max),minLength:ud(te.minLength),maxLength:ud(te.maxLength),pattern:ud(te.pattern)}:{},name:H,onChange:W,onBlur:W,ref:Re=>{if(Re){De(H,te),ue=Ae(r,H);const Ce=Rn(Re.value)&&Re.querySelectorAll&&Re.querySelectorAll("input,select,textarea")[0]||Re,ke=Jq(Ce),Be=ue._f.refs||[];if(ke?Be.find(ct=>ct===Ce):Ce===ue._f.ref)return;Gt(r,H,{_f:{...ue._f,...ke?{refs:[...Be.filter(hx),Ce,...Array.isArray(Ae(s,H))?[{}]:[]],ref:{type:Ce.type,name:H}}:{ref:Ce}}}),O(H,!1,void 0,Ce)}else ue=Ae(r,H,{}),ue._f&&(ue._f.mount=!1),(t.shouldUnregister||te.shouldUnregister)&&!($A(d.array,H)&&c.action)&&d.unMount.add(H)}}},be=()=>t.shouldFocusError&&Cd(r,G,d.mount),Je=H=>{Jr(H)&&(x.state.next({disabled:H}),Cd(r,(te,ue)=>{const _e=Ae(r,ue);_e&&(te.disabled=_e._f.disabled||H,Array.isArray(_e._f.refs)&&_e._f.refs.forEach(Re=>{Re.disabled=_e._f.disabled||H}))},0,!1))},Xe=(H,te)=>async ue=>{let _e;ue&&(ue.preventDefault&&ue.preventDefault(),ue.persist&&ue.persist());let Re=$n(l);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:Ce,values:ke}=await D();n.errors=Ce,Re=$n(ke)}else await V(r);if(d.disabled.size)for(const Ce of d.disabled)Dn(Re,Ce);if(Dn(n.errors,"root"),Ir(n.errors)){x.state.next({errors:{}});try{await H(Re,ue)}catch(Ce){_e=Ce}}else te&&await te({...n.errors},ue),be(),setTimeout(be);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ir(n.errors)&&!_e,submitCount:n.submitCount+1,errors:n.errors}),_e)throw _e},Ht=(H,te={})=>{Ae(r,H)&&(Rn(te.defaultValue)?I(H,$n(Ae(s,H))):(I(H,te.defaultValue),Gt(s,H,$n(te.defaultValue))),te.keepTouched||Dn(n.touchedFields,H),te.keepDirty||(Dn(n.dirtyFields,H),n.isDirty=te.defaultValue?z(H,$n(Ae(s,H))):z()),te.keepError||(Dn(n.errors,H),g.isValid&&C()),x.state.next({...n}))},Ne=(H,te={})=>{const ue=H?$n(H):s,_e=$n(ue),Re=Ir(H),Ce=Re?s:_e;if(te.keepDefaultValues||(s=ue),!te.keepValues){if(te.keepDirtyValues){const ke=new Set([...d.mount,...Object.keys(cd(s,l))]);for(const Be of Array.from(ke))Ae(n.dirtyFields,Be)?Gt(Ce,Be,Ae(l,Be)):I(Be,Ae(Ce,Be))}else{if(Y0&&Rn(H))for(const ke of d.mount){const Be=Ae(r,ke);if(Be&&Be._f){const ct=Array.isArray(Be._f.refs)?Be._f.refs[0]:Be._f.ref;if(np(ct)){const Et=ct.closest("form");if(Et){Et.reset();break}}}}if(te.keepFieldsRef)for(const ke of d.mount)I(ke,Ae(Ce,ke));else r={}}l=t.shouldUnregister?te.keepDefaultValues?$n(s):{}:$n(Ce),x.array.next({values:{...Ce}}),x.state.next({values:{...Ce}})}d={mount:te.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!g.isValid||!!te.keepIsValid||!!te.keepDirtyValues,c.watch=!!t.shouldUnregister,x.state.next({submitCount:te.keepSubmitCount?n.submitCount:0,isDirty:Re?!1:te.keepDirty?n.isDirty:!!(te.keepDefaultValues&&!to(H,s)),isSubmitted:te.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Re?{}:te.keepDirtyValues?te.keepDefaultValues&&l?cd(s,l):n.dirtyFields:te.keepDefaultValues&&H?cd(s,H):te.keepDirty?n.dirtyFields:{},touchedFields:te.keepTouched?n.touchedFields:{},errors:te.keepErrors?n.errors:{},isSubmitSuccessful:te.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},vt=(H,te)=>Ne($a(H)?H(l):H,te),ut=(H,te={})=>{const ue=Ae(r,H),_e=ue&&ue._f;if(_e){const Re=_e.refs?_e.refs[0]:_e.ref;Re.focus&&(Re.focus(),te.shouldSelect&&$a(Re.select)&&Re.select())}},Tt=H=>{n={...n,...H}},ur={control:{register:De,unregister:fe,getFieldState:Z,handleSubmit:Xe,setError:q,_subscribe:me,_runSchema:D,_focusError:be,_getWatch:J,_getDirty:z,_setValid:C,_setFieldArray:R,_setDisabledField:Ee,_setErrors:_,_getFieldArray:oe,_reset:Ne,_resetDefaultValues:()=>$a(t.defaultValues)&&t.defaultValues().then(H=>{vt(H,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:B,_disableForm:Je,_subjects:x,_proxyFormState:g,get _fields(){return r},get _formValues(){return l},get _state(){return c},set _state(H){c=H},get _defaultValues(){return s},get _names(){return d},set _names(H){d=H},get _formState(){return n},get _options(){return t},set _options(H){t={...t,...H}}},subscribe:ve,trigger:ie,register:De,handleSubmit:Xe,watch:le,setValue:I,getValues:L,reset:vt,resetField:Ht,clearErrors:U,unregister:fe,setError:q,setFocus:ut,getFieldState:Z};return{...ur,formControl:ur}}function Ei(e={}){const t=je.useRef(void 0),n=je.useRef(void 0),[r,s]=je.useState({isDirty:!1,isValidating:!1,isLoading:$a(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:$a(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!$a(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...d}=dK(e);t.current={...d,formState:r}}const l=t.current.control;return l._options=e,J0(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>s({...l._formState}),reRenderRoot:!0});return s(d=>({...d,isReady:!0})),l._formState.isReady=!0,c},[l]),je.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),je.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),je.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),je.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),je.useEffect(()=>{if(l._proxyFormState.isDirty){const c=l._getDirty();c!==r.isDirty&&l._subjects.state.next({isDirty:c})}},[l,r.isDirty]),je.useEffect(()=>{e.values&&!to(e.values,n.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),n.current=e.values,s(c=>({...c}))):l._resetDefaultValues()},[l,e.values]),je.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),t.current.formState=GA(r,l),t.current}var fK="Label",eD=p.forwardRef((e,t)=>o.jsx(Ze.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())}}));eD.displayName=fK;var hK=eD;function la({className:e,...t}){return o.jsx(hK,{"data-slot":"label",className:de("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 Cl=BA,tD=p.createContext({}),qt=({...e})=>o.jsx(tD.Provider,{value:{name:e.name},children:o.jsx(Xq,{...e})}),Cf=()=>{const e=p.useContext(tD),t=p.useContext(nD),{getFieldState:n}=nu(),r=qA({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:l}=t;return{id:l,name:e.name,formItemId:`${l}-form-item`,formDescriptionId:`${l}-form-item-description`,formMessageId:`${l}-form-item-message`,...s}},nD=p.createContext({});function Kt({className:e="",...t}){const n=p.useId();return o.jsx(nD.Provider,{value:{id:n},children:o.jsx("div",{"data-slot":"form-item",className:de("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 Zt({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:l,formItemId:c}=Cf();return o.jsxs(la,{"data-slot":"form-label","data-error":!!l,className:de("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...s,children:[o.jsx("span",{children:r}),t&&o.jsxs(Dt,{...n,children:[o.jsx(Ot,{asChild:!0,children:o.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:o.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(Mt,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function Yt({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=Cf();return o.jsx(gp,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function Mn({className:e,...t}){const{formDescriptionId:n}=Cf();return o.jsx("div",{"data-slot":"form-description",id:n,className:de("text-muted-foreground text-sm",e),...t})}function tn({className:e,...t}){const{error:n,formMessageId:r}=Cf(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?o.jsx("p",{"data-slot":"form-message",id:r,className:de("text-destructive text-sm",e),...t,children:s}):null}function wl({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 o.jsx("div",{className:r,children:o.jsx("div",{className:de("flex min-h-full flex-col gap-4",t),children:e})})}function El({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 o.jsx("div",{className:de(r,e),children:t})}function Es({title:e,children:t}){return o.jsxs("section",{className:"mb-4",children:[e&&o.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function mK({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:l="vertical",className:c=""}){const{formItemId:d}=Cf();return o.jsxs("label",{htmlFor:`${d}-${e}`,className:de("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",s&&"cursor-not-allowed opacity-50",l==="horizontal"?"flex-row":"flex-col",n?"bg-muted border-input border-b":"hover:bg-muted border-border bg-transparent",c),children:[o.jsx("input",{type:"radio",id:`${d}-${e}`,value:e,checked:n,onChange:r,disabled:s,className:de("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")}),o.jsx("span",{className:de("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function pK({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return o.jsx("div",{tabIndex:-1,className:de(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(l=>o.jsx(mK,{value:l.value,label:l.label,checked:t===l.value,onChange:c=>n(c.target.value),disabled:l.disabled,orientation:r},l.value))})}const Ri=p.forwardRef(({children:e,className:t="",...n},r)=>o.jsx("form",{ref:r,className:de("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));Ri.displayName="AppForm";function vT(e,[t,n]){return Math.min(n,Math.max(t,e))}function rS(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var gK=[" ","Enter","ArrowUp","ArrowDown"],vK=[" ","Enter"],ul="Select",[sg,og,yK]=Ip(ul),[ru,hne]=jr(ul,[yK,js]),ig=js(),[xK,Ti]=ru(ul),[bK,SK]=ru(ul),rD=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:h,dir:m,name:g,autoComplete:v,disabled:x,required:b,form:w}=e,C=ig(t),[E,R]=p.useState(null),[T,_]=p.useState(null),[O,A]=p.useState(!1),j=Lp(m),[D,k]=ra({prop:r,defaultProp:s??!1,onChange:l,caller:ul}),[V,B]=ra({prop:c,defaultProp:d,onChange:h,caller:ul}),z=p.useRef(null),J=E?w||!!E.closest("form"):!0,[oe,K]=p.useState(new Set),Y=Array.from(oe).map(I=>I.props.value).join(";");return o.jsx(nf,{...C,children:o.jsxs(xK,{required:b,scope:t,trigger:E,onTriggerChange:R,valueNode:T,onValueNodeChange:_,valueNodeHasChildren:O,onValueNodeHasChildrenChange:A,contentId:Kn(),value:V,onValueChange:B,open:D,onOpenChange:k,dir:j,triggerPointerDownPosRef:z,disabled:x,children:[o.jsx(sg.Provider,{scope:t,children:o.jsx(bK,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(I=>{K(W=>new Set(W).add(I))},[]),onNativeOptionRemove:p.useCallback(I=>{K(W=>{const G=new Set(W);return G.delete(I),G})},[]),children:n})}),J?o.jsxs(TD,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:v,value:V,onChange:I=>B(I.target.value),disabled:x,form:w,children:[V===void 0?o.jsx("option",{value:""}):null,Array.from(oe)]},Y):null]})})};rD.displayName=ul;var aD="SelectTrigger",sD=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,l=ig(n),c=Ti(aD,n),d=c.disabled||r,h=gt(t,c.onTriggerChange),m=og(n),g=p.useRef("touch"),[v,x,b]=jD(C=>{const E=m().filter(_=>!_.disabled),R=E.find(_=>_.value===c.value),T=ND(E,C,R);T!==void 0&&c.onValueChange(T.value)}),w=C=>{d||(c.onOpenChange(!0),b()),C&&(c.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return o.jsx(qc,{asChild:!0,...l,children:o.jsx(Ze.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:d,"data-disabled":d?"":void 0,"data-placeholder":_D(c.value)?"":void 0,...s,ref:h,onClick:Te(s.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&w(C)}),onPointerDown:Te(s.onPointerDown,C=>{g.current=C.pointerType;const E=C.target;E.hasPointerCapture(C.pointerId)&&E.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(w(C),C.preventDefault())}),onKeyDown:Te(s.onKeyDown,C=>{const E=v.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&x(C.key),!(E&&C.key===" ")&&gK.includes(C.key)&&(w(),C.preventDefault())})})})});sD.displayName=aD;var oD="SelectValue",iD=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:l,placeholder:c="",...d}=e,h=Ti(oD,n),{onValueNodeHasChildrenChange:m}=h,g=l!==void 0,v=gt(t,h.onValueNodeChange);return lr(()=>{m(g)},[m,g]),o.jsx(Ze.span,{...d,ref:v,style:{pointerEvents:"none"},children:_D(h.value)?o.jsx(o.Fragment,{children:c}):l})});iD.displayName=oD;var CK="SelectIcon",lD=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(Ze.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});lD.displayName=CK;var wK="SelectPortal",cD=e=>o.jsx(gl,{asChild:!0,...e});cD.displayName=wK;var dl="SelectContent",uD=p.forwardRef((e,t)=>{const n=Ti(dl,e.__scopeSelect),[r,s]=p.useState();if(lr(()=>{s(new DocumentFragment)},[]),!n.open){const l=r;return l?Ba.createPortal(o.jsx(dD,{scope:e.__scopeSelect,children:o.jsx(sg.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),l):null}return o.jsx(fD,{...e,ref:t})});uD.displayName=dl;var Ha=10,[dD,_i]=ru(dl),EK="SelectContentImpl",RK=ii("SelectContent.RemoveScroll"),fD=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:c,side:d,sideOffset:h,align:m,alignOffset:g,arrowPadding:v,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:E,...R}=e,T=Ti(dl,n),[_,O]=p.useState(null),[A,j]=p.useState(null),D=gt(t,fe=>O(fe)),[k,V]=p.useState(null),[B,z]=p.useState(null),J=og(n),[oe,K]=p.useState(!1),Y=p.useRef(!1);p.useEffect(()=>{if(_)return Cp(_)},[_]),bp();const I=p.useCallback(fe=>{const[Ee,...De]=J().map(Xe=>Xe.ref.current),[be]=De.slice(-1),Je=document.activeElement;for(const Xe of fe)if(Xe===Je||(Xe==null||Xe.scrollIntoView({block:"nearest"}),Xe===Ee&&A&&(A.scrollTop=0),Xe===be&&A&&(A.scrollTop=A.scrollHeight),Xe==null||Xe.focus(),document.activeElement!==Je))return},[J,A]),W=p.useCallback(()=>I([k,_]),[I,k,_]);p.useEffect(()=>{oe&&W()},[oe,W]);const{onOpenChange:G,triggerPointerDownPosRef:ie}=T;p.useEffect(()=>{if(_){let fe={x:0,y:0};const Ee=be=>{var Je,Xe;fe={x:Math.abs(Math.round(be.pageX)-(((Je=ie.current)==null?void 0:Je.x)??0)),y:Math.abs(Math.round(be.pageY)-(((Xe=ie.current)==null?void 0:Xe.y)??0))}},De=be=>{fe.x<=10&&fe.y<=10?be.preventDefault():_.contains(be.target)||G(!1),document.removeEventListener("pointermove",Ee),ie.current=null};return ie.current!==null&&(document.addEventListener("pointermove",Ee),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ee),document.removeEventListener("pointerup",De,{capture:!0})}}},[_,G,ie]),p.useEffect(()=>{const fe=()=>G(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[G]);const[L,Z]=jD(fe=>{const Ee=J().filter(Je=>!Je.disabled),De=Ee.find(Je=>Je.ref.current===document.activeElement),be=ND(Ee,fe,De);be&&setTimeout(()=>be.ref.current.focus())}),U=p.useCallback((fe,Ee,De)=>{const be=!Y.current&&!De;(T.value!==void 0&&T.value===Ee||be)&&(V(fe),be&&(Y.current=!0))},[T.value]),q=p.useCallback(()=>_==null?void 0:_.focus(),[_]),le=p.useCallback((fe,Ee,De)=>{const be=!Y.current&&!De;(T.value!==void 0&&T.value===Ee||be)&&z(fe)},[T.value]),me=r==="popper"?mb:hD,ve=me===mb?{side:d,sideOffset:h,align:m,alignOffset:g,arrowPadding:v,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:E}:{};return o.jsx(dD,{scope:n,content:_,viewport:A,onViewportChange:j,itemRefCallback:U,selectedItem:k,onItemLeave:q,itemTextRefCallback:le,focusSelectedItem:W,selectedItemText:B,position:r,isPositioned:oe,searchRef:L,children:o.jsx(ef,{as:RK,allowPinchZoom:!0,children:o.jsx(Jd,{asChild:!0,trapped:T.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:Te(s,fe=>{var Ee;(Ee=T.trigger)==null||Ee.focus({preventScroll:!0}),fe.preventDefault()}),children:o.jsx(pl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:o.jsx(me,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:fe=>fe.preventDefault(),...R,...ve,onPlaced:()=>K(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Te(R.onKeyDown,fe=>{const Ee=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!Ee&&fe.key.length===1&&Z(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let be=J().filter(Je=>!Je.disabled).map(Je=>Je.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const Je=fe.target,Xe=be.indexOf(Je);be=be.slice(Xe+1)}setTimeout(()=>I(be)),fe.preventDefault()}})})})})})})});fD.displayName=EK;var TK="SelectItemAlignedPosition",hD=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,l=Ti(dl,n),c=_i(dl,n),[d,h]=p.useState(null),[m,g]=p.useState(null),v=gt(t,D=>g(D)),x=og(n),b=p.useRef(!1),w=p.useRef(!0),{viewport:C,selectedItem:E,selectedItemText:R,focusSelectedItem:T}=c,_=p.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&m&&C&&E&&R){const D=l.trigger.getBoundingClientRect(),k=m.getBoundingClientRect(),V=l.valueNode.getBoundingClientRect(),B=R.getBoundingClientRect();if(l.dir!=="rtl"){const Je=B.left-k.left,Xe=V.left-Je,Ht=D.left-Xe,Ne=D.width+Ht,vt=Math.max(Ne,k.width),ut=window.innerWidth-Ha,Tt=vT(Xe,[Ha,Math.max(Ha,ut-vt)]);d.style.minWidth=Ne+"px",d.style.left=Tt+"px"}else{const Je=k.right-B.right,Xe=window.innerWidth-V.right-Je,Ht=window.innerWidth-D.right-Xe,Ne=D.width+Ht,vt=Math.max(Ne,k.width),ut=window.innerWidth-Ha,Tt=vT(Xe,[Ha,Math.max(Ha,ut-vt)]);d.style.minWidth=Ne+"px",d.style.right=Tt+"px"}const z=x(),J=window.innerHeight-Ha*2,oe=C.scrollHeight,K=window.getComputedStyle(m),Y=parseInt(K.borderTopWidth,10),I=parseInt(K.paddingTop,10),W=parseInt(K.borderBottomWidth,10),G=parseInt(K.paddingBottom,10),ie=Y+I+oe+G+W,L=Math.min(E.offsetHeight*5,ie),Z=window.getComputedStyle(C),U=parseInt(Z.paddingTop,10),q=parseInt(Z.paddingBottom,10),le=D.top+D.height/2-Ha,me=J-le,ve=E.offsetHeight/2,fe=E.offsetTop+ve,Ee=Y+I+fe,De=ie-Ee;if(Ee<=le){const Je=z.length>0&&E===z[z.length-1].ref.current;d.style.bottom="0px";const Xe=m.clientHeight-C.offsetTop-C.offsetHeight,Ht=Math.max(me,ve+(Je?q:0)+Xe+W),Ne=Ee+Ht;d.style.height=Ne+"px"}else{const Je=z.length>0&&E===z[0].ref.current;d.style.top="0px";const Ht=Math.max(le,Y+C.offsetTop+(Je?U:0)+ve)+De;d.style.height=Ht+"px",C.scrollTop=Ee-le+C.offsetTop}d.style.margin=`${Ha}px 0`,d.style.minHeight=L+"px",d.style.maxHeight=J+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[x,l.trigger,l.valueNode,d,m,C,E,R,l.dir,r]);lr(()=>_(),[_]);const[O,A]=p.useState();lr(()=>{m&&A(window.getComputedStyle(m).zIndex)},[m]);const j=p.useCallback(D=>{D&&w.current===!0&&(_(),T==null||T(),w.current=!1)},[_,T]);return o.jsx(jK,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:b,onScrollButtonChange:j,children:o.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:o.jsx(Ze.div,{...s,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});hD.displayName=TK;var _K="SelectPopperPosition",mb=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ha,...l}=e,c=ig(n);return o.jsx(rf,{...c,...l,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...l.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)"}})});mb.displayName=_K;var[jK,aS]=ru(dl,{}),pb="SelectViewport",mD=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,l=_i(pb,n),c=aS(pb,n),d=gt(t,l.onViewportChange),h=p.useRef(0);return o.jsxs(o.Fragment,{children:[o.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}),o.jsx(sg.Slot,{scope:n,children:o.jsx(Ze.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Te(s.onScroll,m=>{const g=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:x}=c;if(x!=null&&x.current&&v){const b=Math.abs(h.current-g.scrollTop);if(b>0){const w=window.innerHeight-Ha*2,C=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(C,E);if(R<w){const T=R+b,_=Math.min(w,T),O=T-_;v.style.height=_+"px",v.style.bottom==="0px"&&(g.scrollTop=O>0?O:0,v.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})});mD.displayName=pb;var pD="SelectGroup",[NK,AK]=ru(pD),gD=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Kn();return o.jsx(NK,{scope:n,id:s,children:o.jsx(Ze.div,{role:"group","aria-labelledby":s,...r,ref:t})})});gD.displayName=pD;var vD="SelectLabel",DK=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=AK(vD,n);return o.jsx(Ze.div,{id:s.id,...r,ref:t})});DK.displayName=vD;var sp="SelectItem",[OK,yD]=ru(sp),xD=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:l,...c}=e,d=Ti(sp,n),h=_i(sp,n),m=d.value===r,[g,v]=p.useState(l??""),[x,b]=p.useState(!1),w=gt(t,T=>{var _;return(_=h.itemRefCallback)==null?void 0:_.call(h,T,r,s)}),C=Kn(),E=p.useRef("touch"),R=()=>{s||(d.onValueChange(r),d.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 o.jsx(OK,{scope:n,value:r,disabled:s,textId:C,isSelected:m,onItemTextChange:p.useCallback(T=>{v(_=>_||((T==null?void 0:T.textContent)??"").trim())},[]),children:o.jsx(sg.ItemSlot,{scope:n,value:r,disabled:s,textValue:g,children:o.jsx(Ze.div,{role:"option","aria-labelledby":C,"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:w,onFocus:Te(c.onFocus,()=>b(!0)),onBlur:Te(c.onBlur,()=>b(!1)),onClick:Te(c.onClick,()=>{E.current!=="mouse"&&R()}),onPointerUp:Te(c.onPointerUp,()=>{E.current==="mouse"&&R()}),onPointerDown:Te(c.onPointerDown,T=>{E.current=T.pointerType}),onPointerMove:Te(c.onPointerMove,T=>{var _;E.current=T.pointerType,s?(_=h.onItemLeave)==null||_.call(h):E.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(c.onPointerLeave,T=>{var _;T.currentTarget===document.activeElement&&((_=h.onItemLeave)==null||_.call(h))}),onKeyDown:Te(c.onKeyDown,T=>{var O;((O=h.searchRef)==null?void 0:O.current)!==""&&T.key===" "||(vK.includes(T.key)&&R(),T.key===" "&&T.preventDefault())})})})})});xD.displayName=sp;var yd="SelectItemText",bD=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...l}=e,c=Ti(yd,n),d=_i(yd,n),h=yD(yd,n),m=SK(yd,n),[g,v]=p.useState(null),x=gt(t,R=>v(R),h.onItemTextChange,R=>{var T;return(T=d.itemTextRefCallback)==null?void 0:T.call(d,R,h.value,h.disabled)}),b=g==null?void 0:g.textContent,w=p.useMemo(()=>o.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:C,onNativeOptionRemove:E}=m;return lr(()=>(C(w),()=>E(w)),[C,E,w]),o.jsxs(o.Fragment,{children:[o.jsx(Ze.span,{id:h.textId,...l,ref:x}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Ba.createPortal(l.children,c.valueNode):null]})});bD.displayName=yd;var SD="SelectItemIndicator",CD=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return yD(SD,n).isSelected?o.jsx(Ze.span,{"aria-hidden":!0,...r,ref:t}):null});CD.displayName=SD;var gb="SelectScrollUpButton",wD=p.forwardRef((e,t)=>{const n=_i(gb,e.__scopeSelect),r=aS(gb,e.__scopeSelect),[s,l]=p.useState(!1),c=gt(t,r.onScrollButtonChange);return lr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=h.scrollTop>0;l(m)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?o.jsx(RD,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});wD.displayName=gb;var vb="SelectScrollDownButton",ED=p.forwardRef((e,t)=>{const n=_i(vb,e.__scopeSelect),r=aS(vb,e.__scopeSelect),[s,l]=p.useState(!1),c=gt(t,r.onScrollButtonChange);return lr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=h.scrollHeight-h.clientHeight,g=Math.ceil(h.scrollTop)<m;l(g)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?o.jsx(RD,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});ED.displayName=vb;var RD=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,l=_i("SelectScrollButton",n),c=p.useRef(null),d=og(n),h=p.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return p.useEffect(()=>()=>h(),[h]),lr(()=>{var g;const m=d().find(v=>v.ref.current===document.activeElement);(g=m==null?void 0:m.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),o.jsx(Ze.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Te(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Te(s.onPointerMove,()=>{var m;(m=l.onItemLeave)==null||m.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Te(s.onPointerLeave,()=>{h()})})}),MK="SelectSeparator",kK=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(Ze.div,{"aria-hidden":!0,...r,ref:t})});kK.displayName=MK;var yb="SelectArrow",IK=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ig(n),l=Ti(yb,n),c=_i(yb,n);return l.open&&c.position==="popper"?o.jsx(af,{...s,...r,ref:t}):null});IK.displayName=yb;var LK="SelectBubbleInput",TD=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=p.useRef(null),l=gt(r,s),c=rS(t);return p.useEffect(()=>{const d=s.current;if(!d)return;const h=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==t&&g){const v=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(v)}},[c,t]),o.jsx(Ze.select,{...n,style:{...Yj,...n.style},ref:l,defaultValue:t})});TD.displayName=LK;function _D(e){return e===""||e===void 0}function jD(e){const t=Ss(e),n=p.useRef(""),r=p.useRef(0),s=p.useCallback(c=>{const d=n.current+c;t(d),(function h(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>h(""),1e3))})(d)},[t]),l=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,l]}function ND(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=PK(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const h=c.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function PK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var UK=rD,FK=sD,HK=iD,VK=lD,zK=cD,$K=uD,BK=mD,GK=gD,qK=xD,KK=bD,ZK=CD,YK=wD,WK=ED;function ca({...e}){return o.jsx(UK,{"data-slot":"select",...e})}function lg({...e}){return o.jsx(GK,{"data-slot":"select-group",...e})}function ua({...e}){return o.jsx(HK,{"data-slot":"select-value",...e})}function da({className:e,size:t="default",children:n,...r}){return o.jsxs(FK,{"data-slot":"select-trigger","data-size":t,className:de("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,o.jsx(VK,{asChild:!0,children:o.jsx(Oa,{className:"size-4 opacity-50"})})]})}function fa({className:e,children:t,position:n="popper",...r}){return o.jsx(zK,{children:o.jsxs($K,{"data-slot":"select-content",className:de("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:[o.jsx(QK,{}),o.jsx(BK,{className:de("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),o.jsx(XK,{})]})})}function kn({className:e,children:t,...n}){return o.jsxs(qK,{"data-slot":"select-item",className:de("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:[o.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o.jsx(ZK,{children:o.jsx(vr,{className:"size-4"})})}),o.jsx(KK,{children:t})]})}function QK({className:e,...t}){return o.jsx(YK,{"data-slot":"select-scroll-up-button",className:de("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(bs,{className:"size-4"})})}function XK({className:e,...t}){return o.jsx(WK,{"data-slot":"select-scroll-down-button",className:de("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Oa,{className:"size-4"})})}const JK=rn({title:an().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:an().min(1,"Storage is required")});function eZ(){const{createDataMart:e,isLoading:t,error:n}=wi();return{handleCreate:p.useCallback(async s=>{try{return await e(s)}catch(l){return console.error(l),null}},[e]),isSubmitting:t,serverError:n}}function tZ(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:h,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:v,loadMoreDataMartRuns:x,reset:b,dataMart:w,isLoading:C,error:E,getErrorMessage:R,runs:T}=wi();return p.useEffect(()=>(e?t(e):b(),()=>{b()}),[e,t,b]),{dataMart:w,isLoading:C,error:E,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:h,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:v,loadMoreDataMartRuns:x,runs:T}}const yT=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ae(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},xb=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?yT(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>yT(s,n,e))}},xT=(e,t)=>{t.shouldUseNativeValidation&&xb(e,t);const n={};for(const r in e){const s=Ae(t.fields,r),l=Object.assign(e[r]||{},{ref:s&&s.ref});if(nZ(t.names||Object.keys(e),r)){const c=Object.assign({},Ae(n,r));Gt(c,"root",l),Gt(n,r,c)}else Gt(n,r,l)}return n},nZ=(e,t)=>{const n=bT(t);return e.some(r=>bT(r).match(`^${n}\\.\\d+`))};function bT(e){return e.replace(/\]|\[/g,"")}function AD(e,t,n){function r(d,h){var m;Object.defineProperty(d,"_zod",{value:d._zod??{},enumerable:!1}),(m=d._zod).traits??(m.traits=new Set),d._zod.traits.add(e),t(d,h);for(const g in c.prototype)g in d||Object.defineProperty(d,g,{value:c.prototype[g].bind(d)});d._zod.constr=c,d._zod.def=h}const s=(n==null?void 0:n.Parent)??Object;class l extends s{}Object.defineProperty(l,"name",{value:e});function c(d){var h;const m=n!=null&&n.Parent?new l:this;r(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:d=>{var h,m;return n!=null&&n.Parent&&d instanceof n.Parent?!0:(m=(h=d==null?void 0:d._zod)==null?void 0:h.traits)==null?void 0:m.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class rZ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const aZ={};function DD(e){return aZ}function sZ(e,t){return typeof t=="bigint"?t.toString():t}const OD=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function em(e){return typeof e=="string"?e:e==null?void 0:e.message}function MD(e,t,n){var s,l,c,d,h,m;const r={...e,path:e.path??[]};if(!e.message){const g=em((c=(l=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:l.error)==null?void 0:c.call(l,e))??em((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??em((h=n.customError)==null?void 0:h.call(n,e))??em((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=g}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const kD=(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,sZ,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oZ=AD("$ZodError",kD),ID=AD("$ZodError",kD,{Parent:Error}),iZ=e=>(t,n,r,s)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise)throw new rZ;if(c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(h=>MD(h,l,DD())));throw OD(d,s==null?void 0:s.callee),d}return c.value},lZ=iZ(ID),cZ=e=>async(t,n,r,s)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(h=>MD(h,l,DD())));throw OD(d,s==null?void 0:s.callee),d}return c.value},uZ=cZ(ID);function ST(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function dZ(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var d=r.unionErrors[0].errors[0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(g){return g.errors.forEach(function(v){return e.push(v)})}),t){var h=n[c].types,m=h&&h[r.code];n[c]=eS(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function fZ(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if(r.code==="invalid_union"&&r.errors.length>0){var d=r.errors[0][0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(g){return g.forEach(function(v){return e.push(v)})}),t){var h=n[c].types,m=h&&h[r.code];n[c]=eS(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function Rl(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,l){try{return Promise.resolve(ST(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return l.shouldUseNativeValidation&&xb({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return Array.isArray(d==null?void 0:d.issues)})(c))return{values:{},errors:xT(dZ(c.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,l){try{return Promise.resolve(ST(function(){return Promise.resolve((n.mode==="sync"?lZ:uZ)(e,r,t)).then(function(c){return l.shouldUseNativeValidation&&xb({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return d instanceof oZ})(c))return{values:{},errors:xT(fZ(c.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const LD=p.createContext(void 0);function hZ(){const e=p.useContext(LD);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var Nt=(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))(Nt||{});const mZ={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function pZ(e,t){switch(t.type){case Nt.FETCH_STORAGES_START:case Nt.FETCH_STORAGE_START:case Nt.CREATE_STORAGE_START:case Nt.UPDATE_STORAGE_START:return{...e,error:null};case Nt.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case Nt.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case Nt.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case Nt.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case Nt.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 Nt.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case Nt.FETCH_STORAGES_ERROR:case Nt.FETCH_STORAGE_ERROR:case Nt.CREATE_STORAGE_ERROR:case Nt.UPDATE_STORAGE_ERROR:case Nt.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case Nt.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case Nt.CLEAR_ERROR:return{...e,error:null};default:return e}}function sS({children:e}){const[t,n]=p.useReducer(pZ,mZ);return o.jsx(LD.Provider,{value:{state:t,dispatch:n},children:e})}class gZ extends Yc{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 dd=new gZ;function cg(){const{state:e,dispatch:t}=hZ(),n=p.useCallback(async()=>{t({type:Nt.FETCH_STORAGES_START});try{const h=await dd.getDataStorages();t({type:Nt.FETCH_STORAGES_SUCCESS,payload:h.map(kq)})}catch(h){t({type:Nt.FETCH_STORAGES_ERROR,payload:Bn(h)})}},[t]),r=p.useCallback(async h=>{try{const m=await dd.getDataStorageById(h),g=ym(m);t({type:Nt.FETCH_STORAGE_SUCCESS,payload:g})}catch(m){t({type:Nt.FETCH_STORAGE_ERROR,payload:Bn(m)})}},[t]),s=p.useCallback(async h=>{t({type:Nt.CREATE_STORAGE_START});try{const m=Iq(h),g=await dd.createDataStorage(m),v=ym(g);return t({type:Nt.CREATE_STORAGE_SUCCESS,payload:v}),v}catch(m){return t({type:Nt.CREATE_STORAGE_ERROR,payload:Bn(m)}),null}},[t]),l=p.useCallback(async(h,m)=>{t({type:Nt.UPDATE_STORAGE_START});try{const g=Mq(m),v=await dd.updateDataStorage(h,g),x=ym(v);return t({type:Nt.UPDATE_STORAGE_SUCCESS,payload:x}),x}catch(g){return t({type:Nt.UPDATE_STORAGE_ERROR,payload:Bn(g)}),null}},[t]),c=p.useCallback(async h=>{t({type:Nt.DELETE_STORAGE_START});try{await dd.deleteDataStorage(h),t({type:Nt.DELETE_STORAGE_SUCCESS,payload:h})}catch(m){t({type:Nt.DELETE_STORAGE_ERROR,payload:Bn(m)})}},[t]),d=p.useCallback(()=>{t({type:Nt.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:s,updateDataStorage:l,deleteDataStorage:c,clearCurrentDataStorage:d}}function vZ({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=eZ(),{dataStorages:l,loading:c,fetchDataStorages:d}=cg();p.useEffect(()=>{d()},[d]);const h=Ei({resolver:Rl(JK),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),m=async g=>{const v=await n(g);v&&t&&t(v)};return o.jsx(Cl,{...h,children:o.jsxs(Ri,{onSubmit:g=>{h.handleSubmit(m)(g)},children:[o.jsxs(wl,{variant:"light",children:[s&&o.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),o.jsx(qt,{control:h.control,name:"title",render:({field:g})=>o.jsxs(Kt,{children:[o.jsx(Zt,{children:"Title"}),o.jsx(Yt,{children:o.jsx(zt,{id:"title",placeholder:"Enter title",...g,disabled:r})}),o.jsx(tn,{})]})}),o.jsx(qt,{control:h.control,name:"storageId",render:({field:g})=>o.jsxs(Kt,{children:[o.jsx(Zt,{children:"Storage"}),o.jsx(Yt,{children:o.jsxs(ca,{onValueChange:v=>{g.onChange(v)},value:g.value,disabled:r||c,children:[o.jsx(da,{className:"w-full",children:o.jsx(ua,{placeholder:"Select a storage"})}),o.jsx(fa,{children:o.jsxs(lg,{children:[c&&o.jsx(kn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&l.length===0&&o.jsx(kn,{value:"empty",disabled:!0,children:"No storages available"}),!c&&l.map(v=>{const x=Ci.getInfo(v.type).icon;return o.jsx(kn,{value:v.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(x,{size:20}),o.jsx("span",{children:v.title})]})},v.id)})]})})]})}),o.jsx(tn,{})]})})]}),o.jsxs(El,{variant:"light",children:[o.jsx(we,{type:"submit",children:"Create Data Mart"}),o.jsx(we,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})})}function yZ({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[l,c]=p.useState(e),[d,h]=p.useState(!1),m=p.useRef(null);p.useEffect(()=>{c(e)},[e]),p.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${String(m.current.scrollHeight)}px`)},[l]);const g=async()=>{if(l.trim()===""){c(e);return}if(l.trim()!==e)try{h(!0),await t(l.trim())}catch(x){c(e),console.error(x)}finally{h(!1)}},v=x=>{if(x.key==="Enter"&&!x.shiftKey){if(x.preventDefault(),l.trim()===""){ho.error(r),c(e);return}g()}else x.key==="Escape"&&c(e)};return o.jsx("h2",{className:de("m-0 cursor-pointer p-0 hover:opacity-80",n),children:o.jsx(ui,{ref:m,value:l,onChange:x=>{c(x.target.value);const b=x.target;b.style.height="auto",b.style.height=`${String(b.scrollHeight)}px`},onBlur:()=>void g(),onKeyDown:v,className:de("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":d}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:s},disabled:d})})}var xc=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(xc||{}),PD=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(PD||{});function xZ({configuration:e,onClose:t,onSubmit:n}){const[r,s]=p.useState(new Set),l=p.useId(),c=Ei({defaultValues:{runType:xc.INCREMENTAL}}),{loading:d,loadingSpecification:h,connectorSpecification:m,fetchConnectorSpecification:g}=Sl(),v=p.useCallback(async C=>{!r.has(C)&&!h&&(s(E=>new Set(E).add(C)),await g(C))},[r,h,g]);p.useEffect(()=>{e!=null&&e.connector.source.name&&v(e.connector.source.name)},[e,d,v]);const x=C=>{n&&n(C)},b=()=>{t&&t()},w=C=>{if(!C)return"text";switch(C){case us.DATE:return"date";case us.NUMBER:return"number";default:return"text"}};return h?o.jsx("div",{children:"Loading..."}):m?o.jsx(Cl,{...c,children:o.jsxs(Ri,{id:l,noValidate:!0,onSubmit:C=>void c.handleSubmit(x)(C),children:[o.jsxs(wl,{children:[o.jsx(Es,{title:"General",children:o.jsx(qt,{control:c.control,name:"runType",render:({field:C})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),o.jsx(Yt,{children:o.jsxs(o.Fragment,{children:[o.jsx(pK,{options:[{value:xc.INCREMENTAL,label:"Incremental load"},{value:xc.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:C.value,onChange:C.onChange,orientation:"horizontal"}),o.jsx(Mn,{children:c.watch("runType")===xc.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")===xc.MANUAL_BACKFILL&&o.jsx(Es,{title:"Run configuration",children:m.filter(C=>{var E;return(E=C.attributes)==null?void 0:E.includes(PD.MANUAL_BACKFILL)}).map(C=>o.jsx(qt,{control:c.control,name:`data.${C.name}`,render:()=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:C.description,children:C.title??C.name}),o.jsx(Yt,{children:o.jsx(zt,{id:C.name,placeholder:C.description,type:w(C.requiredType),defaultValue:typeof C.default=="string"||typeof C.default=="number"?C.default.toString():void 0,...c.register(`data.${C.name}`,{required:!0})})}),o.jsx(tn,{})]},C.name)}))})]}),o.jsxs(El,{children:[o.jsx(we,{type:"submit",disabled:!c.formState.isValid||h,children:"Run"}),o.jsx(we,{type:"button",variant:"outline",onClick:b,children:"Cancel"})]})]})}):o.jsx("div",{children:"No connector specification found"})}function bZ({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return o.jsx(yi,{open:e,onOpenChange:t,children:o.jsxs(xi,{children:[o.jsx(bi,{children:o.jsx(vl,{children:"Manual Run"})}),o.jsx(xZ,{configuration:n,onClose:t,onSubmit:r})]})})}function UD({children:e,configuration:t,onManualRun:n,open:r}){const[s,l]=p.useState(r??!1),c=()=>{l(!0)},d=m=>{n(m),l(!1)},h=()=>e?o.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return o.jsxs(o.Fragment,{children:[h(),s&&o.jsx(Pc,{children:o.jsx(bZ,{isOpen:s,onClose:()=>{l(!1)},configuration:t,onSubmit:d})})]})}function SZ({id:e}){const t=Zd(),{dataMart:n,deleteDataMart:r,updateDataMartTitle:s,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:h,publishDataMart:m,runDataMart:g,cancelDataMartRun:v,getDataMartRuns:x,loadMoreDataMartRuns:b,isLoading:w,error:C,getErrorMessage:E,runs:R}=tZ(e),[T,_]=p.useState(!1),[O,A]=p.useState(!1),j=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],D=async B=>{n&&await s(n.id,B)},k=async()=>{if(n){A(!0);try{await m(n.id),Vt.success("Data mart published successfully")}catch(B){Vt.error(B instanceof Error?B.message:"Failed to publish data mart")}finally{A(!1)}}},V=async B=>{if(n){if(n.status.code!==tr.PUBLISHED){Vt.error("Manual run is only available for published data marts");return}await g({id:n.id,payload:B}),Vt.success("Manual run triggered successfully")}};return n?o.jsxs("div",{className:"px-12 py-6",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("button",{onClick:()=>void t("/data-marts"),className:"rounded p-1 hover:bg-gray-100",title:"Back to Data Marts",children:o.jsx(ML,{className:"h-5 w-5 text-gray-400"})}),o.jsx(yZ,{title:n.title,onUpdate:D,className:"text-xl font-medium"})]}),o.jsxs("div",{className:"flex items-center gap-2"+(O?" opacity-50":""),style:{minWidth:"120px"},children:[o.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx("div",{children:o.jsx(vf,{type:n.status.code===tr.PUBLISHED?xn.SUCCESS:xn.NEUTRAL,variant:"subtle",children:n.status.displayName})})}),o.jsx(Mt,{children:n.status.code===tr.PUBLISHED?"Published data mart is available for scheduled runs":"Draft data mart is not available for scheduled runs. Publish to make it available"})]}),n.status.code===tr.DRAFT&&o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx("div",{children:o.jsxs(Vd,{variant:"default",onClick:()=>{k()},disabled:O||!n.canPublish,className:"ml-2 flex items-center gap-1",children:[o.jsx(vp,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!n.canPublish&&o.jsxs(Mt,{children:[o.jsx("div",{children:"Data mart cannot be published. Please fix the validation issues:"}),n.validationErrors.length>0&&o.jsx("ul",{className:"mt-2 list-disc pl-5",children:GB(n.validationErrors).map((B,z)=>o.jsx("li",{children:B},z))})]})]})]}),o.jsxs(xr,{children:[o.jsx(br,{asChild:!0,children:o.jsx(Vd,{variant:"ghost",children:o.jsx(p5,{className:"h-5 w-5"})})}),o.jsxs(cr,{align:"end",children:[n.definitionType===Qe.CONNECTOR&&o.jsxs(o.Fragment,{children:[o.jsx(UD,{configuration:n.definition??null,onManualRun:B=>{V({runType:B.runType,data:B.data})},children:o.jsxs(Ft,{onClick:B=>{B.preventDefault()},children:[o.jsx(qb,{className:"mr-2 h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})}),o.jsx(Aa,{})]}),o.jsxs(Ft,{className:"text-red-600",onClick:()=>{_(!0)},children:[o.jsx(xp,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})]}),o.jsx("div",{children:o.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:j.map(B=>o.jsx(Tm,{to:B.path,className:({isActive:z})=>de("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",z?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:B.name},B.name))})}),o.jsx("div",{className:"pt-4",children:o.jsx(E_,{context:{dataMart:n,isLoading:w,error:C,getErrorMessage:E,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:h,runDataMart:g,cancelDataMartRun:v,getDataMartRuns:x,loadMoreDataMartRuns:b,runs:R}})}),o.jsx(ia,{open:T,onOpenChange:_,title:"Delete Data Mart",description:o.jsxs(o.Fragment,{children:["Are you sure you want to delete ",o.jsxs("strong",{children:['"',n.title,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await r(n.id),_(!1),t("/data-marts")}catch(B){console.error("Failed to delete data mart:",B)}})()}})]}):o.jsx("div",{className:"p-4",children:"No data mart found"})}function CZ({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:s="100%",minHeight:l="100px"}){const[c,d]=p.useState(e??""),[h,m]=p.useState(!1),[g,v]=p.useState(!1),x=p.useRef(null);p.useEffect(()=>{d(e??"")},[e]),p.useEffect(()=>{if(x.current&&h){x.current.focus();const R=x.current.value.length;x.current.setSelectionRange(R,R),b(x.current)}},[h]);const b=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},w=R=>{d(R.target.value),b(R.target)},C=async()=>{const R=c.trim();if(R===(e??"")){m(!1);return}try{v(!0),await t(R===""?null:R),m(!1),ho.success("Description updated")}catch(_){console.error("Failed to update description:",_),ho.error("Failed to update description"),d(e??"")}finally{v(!1)}},E=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),C()):R.key==="Escape"&&(R.preventDefault(),d(e??""),m(!1))};return h?o.jsxs("div",{className:"w-full",children:[o.jsx(ui,{ref:x,value:c,onChange:w,onBlur:()=>void C(),onKeyDown:E,placeholder:r,className:de("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":g}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:l,minWidth:s},disabled:g}),o.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[o.jsxs("span",{children:["Press"," ",o.jsx("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-1 py-0.5 font-sans",children:"Ctrl+Enter"})," ","to save •"," "]}),o.jsxs("span",{children:[o.jsx("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-1 py-0.5 font-sans",children:"Esc"})," ","to cancel •"," "]}),o.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):o.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:o.jsx("div",{onClick:()=>{m(!0)},className:de("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 wZ(){const{dataMart:e,updateDataMartDescription:t}=Ts(),n=async r=>{await t(e.id,r)};return o.jsxs("div",{children:[o.jsx(HN,{}),o.jsx(CZ,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})]})}function EZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CT(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 wT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CT(Object(n),!0).forEach(function(r){EZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RZ(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,l;for(l=0;l<r.length;l++)s=r[l],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function TZ(e,t){if(e==null)return{};var n=RZ(e,t),r,s;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s<l.length;s++)r=l[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _Z(e,t){return jZ(e)||NZ(e,t)||AZ(e,t)||DZ()}function jZ(e){if(Array.isArray(e))return e}function NZ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,l=void 0;try{for(var c=e[Symbol.iterator](),d;!(r=(d=c.next()).done)&&(n.push(d.value),!(t&&n.length===t));r=!0);}catch(h){s=!0,l=h}finally{try{!r&&c.return!=null&&c.return()}finally{if(s)throw l}}return n}}function AZ(e,t){if(e){if(typeof e=="string")return ET(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ET(e,t)}}function ET(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function DZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
664
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RT(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 TT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RT(Object(n),!0).forEach(function(r){OZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MZ(){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,l){return l(s)},r)}}function xd(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),h=0;h<c;h++)d[h]=arguments[h];return t.apply(n,[].concat(s,d))}}}function op(e){return{}.toString.call(e).includes("Object")}function kZ(e){return!Object.keys(e).length}function zd(e){return typeof e=="function"}function IZ(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function LZ(e,t){return op(t)||ri("changeType"),Object.keys(t).some(function(n){return!IZ(e,n)})&&ri("changeField"),t}function PZ(e){zd(e)||ri("selectorType")}function UZ(e){zd(e)||op(e)||ri("handlerType"),op(e)&&Object.values(e).some(function(t){return!zd(t)})&&ri("handlersType")}function FZ(e){e||ri("initialIsRequired"),op(e)||ri("initialType"),kZ(e)&&ri("initialContent")}function HZ(e,t){throw new Error(e[t]||e.default)}var VZ={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"},ri=xd(HZ)(VZ),tm={changes:LZ,selector:PZ,handler:UZ,initial:FZ};function zZ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};tm.initial(e),tm.handler(t);var n={current:e},r=xd(GZ)(n,t),s=xd(BZ)(n),l=xd(tm.changes)(e),c=xd($Z)(n);function d(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return tm.selector(m),m(n.current)}function h(m){MZ(r,s,l,c)(m)}return[d,h]}function $Z(e,t){return zd(t)?t(e.current):t}function BZ(e,t){return e.current=TT(TT({},e.current),t),t}function GZ(e,t,n){return zd(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 qZ={create:zZ},KZ={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function ZZ(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),h=0;h<c;h++)d[h]=arguments[h];return t.apply(n,[].concat(s,d))}}}function YZ(e){return{}.toString.call(e).includes("Object")}function WZ(e){return e||_T("configIsRequired"),YZ(e)||_T("configType"),e.urls?(QZ(),{paths:{vs:e.urls.monacoBase}}):e}function QZ(){console.warn(FD.deprecation)}function XZ(e,t){throw new Error(e[t]||e.default)}var FD={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!
665
+ You are using deprecated way of configuration.
666
+
667
+ Instead of using
668
+ monaco.config({ urls: { monacoBase: '...' } })
669
+ use
670
+ monaco.config({ paths: { vs: '...' } })
671
+
672
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
673
+ `},_T=ZZ(XZ)(FD),JZ={config:WZ},eY=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(l,c){return c(l)},s)}};function HD(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],HD(e[n],t[n]))}),wT(wT({},e),t)}var tY={type:"cancelation",msg:"operation is manually canceled"};function mx(e){var t=!1,n=new Promise(function(r,s){e.then(function(l){return t?s(tY):r(l)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var nY=qZ.create({config:KZ,isInitialized:!1,resolve:null,reject:null,monaco:null}),VD=_Z(nY,2),wf=VD[0],ug=VD[1];function rY(e){var t=JZ.config(e),n=t.monaco,r=TZ(t,["monaco"]);ug(function(s){return{config:HD(s.config,r),monaco:n}})}function aY(){var e=wf(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(ug({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),mx(px);if(window.monaco&&window.monaco.editor)return zD(window.monaco),e.resolve(window.monaco),mx(px);eY(sY,iY)(lY)}return mx(px)}function sY(e){return document.body.appendChild(e)}function oY(e){var t=document.createElement("script");return e&&(t.src=e),t}function iY(e){var t=wf(function(r){var s=r.config,l=r.reject;return{config:s,reject:l}}),n=oY("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function lY(){var e=wf(function(n){var r=n.config,s=n.resolve,l=n.reject;return{config:r,resolve:s,reject:l}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){zD(n),e.resolve(n)},function(n){e.reject(n)})}function zD(e){wf().monaco||ug({monaco:e})}function cY(){return wf(function(e){var t=e.monaco;return t})}var px=new Promise(function(e,t){return ug({resolve:e,reject:t})}),$D={config:rY,init:aY,__getMonacoInstance:cY},uY={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},gx=uY,dY={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},fY=dY;function hY({children:e}){return je.createElement("div",{style:fY.container},e)}var mY=hY,pY=mY;function gY({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:l,wrapperProps:c}){return je.createElement("section",{style:{...gx.wrapper,width:e,height:t},...c},!n&&je.createElement(pY,null,r),je.createElement("div",{ref:s,style:{...gx.fullWidth,...!n&&gx.hide},className:l}))}var vY=gY,BD=p.memo(vY);function yY(e){p.useEffect(e,[])}var GD=yY;function xY(e,t,n=!0){let r=p.useRef(!0);p.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var ea=xY;function wd(){}function wc(e,t,n,r){return bY(e,r)||SY(e,t,n,r)}function bY(e,t){return e.editor.getModel(qD(e,t))}function SY(e,t,n,r){return e.editor.createModel(t,n,r?qD(e,r):void 0)}function qD(e,t){return e.Uri.parse(t)}function CY({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:l,modifiedModelPath:c,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:h=!1,theme:m="light",loading:g="Loading...",options:v={},height:x="100%",width:b="100%",className:w,wrapperProps:C={},beforeMount:E=wd,onMount:R=wd}){let[T,_]=p.useState(!1),[O,A]=p.useState(!0),j=p.useRef(null),D=p.useRef(null),k=p.useRef(null),V=p.useRef(R),B=p.useRef(E),z=p.useRef(!1);GD(()=>{let Y=$D.init();return Y.then(I=>(D.current=I)&&A(!1)).catch(I=>(I==null?void 0:I.type)!=="cancelation"&&console.error("Monaco initialization: error:",I)),()=>j.current?K():Y.cancel()}),ea(()=>{if(j.current&&D.current){let Y=j.current.getOriginalEditor(),I=wc(D.current,e||"",r||n||"text",l||"");I!==Y.getModel()&&Y.setModel(I)}},[l],T),ea(()=>{if(j.current&&D.current){let Y=j.current.getModifiedEditor(),I=wc(D.current,t||"",s||n||"text",c||"");I!==Y.getModel()&&Y.setModel(I)}},[c],T),ea(()=>{let Y=j.current.getModifiedEditor();Y.getOption(D.current.editor.EditorOption.readOnly)?Y.setValue(t||""):t!==Y.getValue()&&(Y.executeEdits("",[{range:Y.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),Y.pushUndoStop())},[t],T),ea(()=>{var Y,I;(I=(Y=j.current)==null?void 0:Y.getModel())==null||I.original.setValue(e||"")},[e],T),ea(()=>{let{original:Y,modified:I}=j.current.getModel();D.current.editor.setModelLanguage(Y,r||n||"text"),D.current.editor.setModelLanguage(I,s||n||"text")},[n,r,s],T),ea(()=>{var Y;(Y=D.current)==null||Y.editor.setTheme(m)},[m],T),ea(()=>{var Y;(Y=j.current)==null||Y.updateOptions(v)},[v],T);let J=p.useCallback(()=>{var W;if(!D.current)return;B.current(D.current);let Y=wc(D.current,e||"",r||n||"text",l||""),I=wc(D.current,t||"",s||n||"text",c||"");(W=j.current)==null||W.setModel({original:Y,modified:I})},[n,t,s,e,r,l,c]),oe=p.useCallback(()=>{var Y;!z.current&&k.current&&(j.current=D.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...v}),J(),(Y=D.current)==null||Y.editor.setTheme(m),_(!0),z.current=!0)},[v,m,J]);p.useEffect(()=>{T&&V.current(j.current,D.current)},[T]),p.useEffect(()=>{!O&&!T&&oe()},[O,T,oe]);function K(){var I,W,G,ie;let Y=(I=j.current)==null?void 0:I.getModel();d||((W=Y==null?void 0:Y.original)==null||W.dispose()),h||((G=Y==null?void 0:Y.modified)==null||G.dispose()),(ie=j.current)==null||ie.dispose()}return je.createElement(BD,{width:b,height:x,isEditorReady:T,loading:g,_ref:k,className:w,wrapperProps:C})}var wY=CY;p.memo(wY);function EY(e){let t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}var RY=EY,nm=new Map;function TY({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:l,theme:c="light",line:d,loading:h="Loading...",options:m={},overrideServices:g={},saveViewState:v=!0,keepCurrentModel:x=!1,width:b="100%",height:w="100%",className:C,wrapperProps:E={},beforeMount:R=wd,onMount:T=wd,onChange:_,onValidate:O=wd}){let[A,j]=p.useState(!1),[D,k]=p.useState(!0),V=p.useRef(null),B=p.useRef(null),z=p.useRef(null),J=p.useRef(T),oe=p.useRef(R),K=p.useRef(),Y=p.useRef(r),I=RY(l),W=p.useRef(!1),G=p.useRef(!1);GD(()=>{let Z=$D.init();return Z.then(U=>(V.current=U)&&k(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>B.current?L():Z.cancel()}),ea(()=>{var U,q,le,me;let Z=wc(V.current,e||r||"",t||s||"",l||n||"");Z!==((U=B.current)==null?void 0:U.getModel())&&(v&&nm.set(I,(q=B.current)==null?void 0:q.saveViewState()),(le=B.current)==null||le.setModel(Z),v&&((me=B.current)==null||me.restoreViewState(nm.get(l))))},[l],A),ea(()=>{var Z;(Z=B.current)==null||Z.updateOptions(m)},[m],A),ea(()=>{!B.current||r===void 0||(B.current.getOption(V.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(G.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),G.current=!1))},[r],A),ea(()=>{var U,q;let Z=(U=B.current)==null?void 0:U.getModel();Z&&s&&((q=V.current)==null||q.editor.setModelLanguage(Z,s))},[s],A),ea(()=>{var Z;d!==void 0&&((Z=B.current)==null||Z.revealLine(d))},[d],A),ea(()=>{var Z;(Z=V.current)==null||Z.editor.setTheme(c)},[c],A);let ie=p.useCallback(()=>{var Z;if(!(!z.current||!V.current)&&!W.current){oe.current(V.current);let U=l||n,q=wc(V.current,r||e||"",t||s||"",U||"");B.current=(Z=V.current)==null?void 0:Z.editor.create(z.current,{model:q,automaticLayout:!0,...m},g),v&&B.current.restoreViewState(nm.get(U)),V.current.editor.setTheme(c),d!==void 0&&B.current.revealLine(d),j(!0),W.current=!0}},[e,t,n,r,s,l,m,g,v,c,d]);p.useEffect(()=>{A&&J.current(B.current,V.current)},[A]),p.useEffect(()=>{!D&&!A&&ie()},[D,A,ie]),Y.current=r,p.useEffect(()=>{var Z,U;A&&_&&((Z=K.current)==null||Z.dispose(),K.current=(U=B.current)==null?void 0:U.onDidChangeModelContent(q=>{G.current||_(B.current.getValue(),q)}))},[A,_]),p.useEffect(()=>{if(A){let Z=V.current.editor.onDidChangeMarkers(U=>{var le;let q=(le=B.current.getModel())==null?void 0:le.uri;if(q&&U.find(me=>me.path===q.path)){let me=V.current.editor.getModelMarkers({resource:q});O==null||O(me)}});return()=>{Z==null||Z.dispose()}}return()=>{}},[A,O]);function L(){var Z,U;(Z=K.current)==null||Z.dispose(),x?v&&nm.set(l,B.current.saveViewState()):(U=B.current.getModel())==null||U.dispose(),B.current.dispose()}return je.createElement(BD,{width:b,height:w,isEditorReady:A,loading:h,_ref:z,className:C,wrapperProps:E})}var _Y=TY,jY=p.memo(_Y);function NY({initialValue:e,onChange:t}){const[n,r]=p.useState((e==null?void 0:e.sqlQuery)??""),{theme:s}=DN();p.useEffect(()=>{e!=null&&e.sqlQuery&&e.sqlQuery!==n&&r(e.sqlQuery)},[e,n]);function l(c){c!==void 0&&(r(c),t({sqlQuery:c}))}return o.jsx("div",{className:"shadow-xs",children:o.jsx(jY,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:l,theme:s==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function bb({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:l}){const c=e;return o.jsxs("div",{className:de("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",l),onClick:s,children:[o.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx(c,{className:"h-6 w-6"})}),o.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[o.jsx("div",{className:"text-md font-medium",children:t}),n&&o.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),o.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,s&&o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-gray-700/25",children:o.jsx(ml,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var jT=1,AY=.9,DY=.8,OY=.17,vx=.1,yx=.999,MY=.9999,kY=.99,IY=/[\\\/_+.#"@\[\(\{&]/,LY=/[\\\/_+.#"@\[\(\{&]/g,PY=/[\s-]/,KD=/[\s-]/g;function Sb(e,t,n,r,s,l,c){if(l===t.length)return s===e.length?jT:kY;var d=`${s},${l}`;if(c[d]!==void 0)return c[d];for(var h=r.charAt(l),m=n.indexOf(h,s),g=0,v,x,b,w;m>=0;)v=Sb(e,t,n,r,m+1,l+1,c),v>g&&(m===s?v*=jT:IY.test(e.charAt(m-1))?(v*=DY,b=e.slice(s,m-1).match(LY),b&&s>0&&(v*=Math.pow(yx,b.length))):PY.test(e.charAt(m-1))?(v*=AY,w=e.slice(s,m-1).match(KD),w&&s>0&&(v*=Math.pow(yx,w.length))):(v*=OY,s>0&&(v*=Math.pow(yx,m-s))),e.charAt(m)!==t.charAt(l)&&(v*=MY)),(v<vx&&n.charAt(m-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(m-1)!==r.charAt(l))&&(x=Sb(e,t,n,r,m+1,l+2,c),x*vx>v&&(v=x*vx)),v>g&&(g=v),m=n.indexOf(h,m+1);return c[d]=g,g}function NT(e){return e.toLowerCase().replace(KD," ")}function UY(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Sb(e,t,NT(e),NT(t),0,0,{})}var fd='[cmdk-group=""]',xx='[cmdk-group-items=""]',FY='[cmdk-group-heading=""]',ZD='[cmdk-item=""]',AT=`${ZD}:not([aria-disabled="true"])`,Cb="cmdk-item-select",bc="data-value",HY=(e,t,n)=>UY(e,t,n),YD=p.createContext(void 0),Ef=()=>p.useContext(YD),WD=p.createContext(void 0),oS=()=>p.useContext(WD),QD=p.createContext(void 0),XD=p.forwardRef((e,t)=>{let n=Sc(()=>{var U,q;return{search:"",value:(q=(U=e.value)!=null?U:e.defaultValue)!=null?q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Sc(()=>new Set),s=Sc(()=>new Map),l=Sc(()=>new Map),c=Sc(()=>new Set),d=JD(e),{label:h,children:m,value:g,onValueChange:v,filter:x,shouldFilter:b,loop:w,disablePointerSelection:C=!1,vimBindings:E=!0,...R}=e,T=Kn(),_=Kn(),O=Kn(),A=p.useRef(null),j=QY();fl(()=>{if(g!==void 0){let U=g.trim();n.current.value=U,D.emit()}},[g]),fl(()=>{j(6,oe)},[]);let D=p.useMemo(()=>({subscribe:U=>(c.current.add(U),()=>c.current.delete(U)),snapshot:()=>n.current,setState:(U,q,le)=>{var me,ve,fe,Ee;if(!Object.is(n.current[U],q)){if(n.current[U]=q,U==="search")J(),B(),j(1,z);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let De=document.getElementById(O);De?De.focus():(me=document.getElementById(T))==null||me.focus()}if(j(7,()=>{var De;n.current.selectedItemId=(De=K())==null?void 0:De.id,D.emit()}),le||j(5,oe),((ve=d.current)==null?void 0:ve.value)!==void 0){let De=q??"";(Ee=(fe=d.current).onValueChange)==null||Ee.call(fe,De);return}}D.emit()}},emit:()=>{c.current.forEach(U=>U())}}),[]),k=p.useMemo(()=>({value:(U,q,le)=>{var me;q!==((me=l.current.get(U))==null?void 0:me.value)&&(l.current.set(U,{value:q,keywords:le}),n.current.filtered.items.set(U,V(q,le)),j(2,()=>{B(),D.emit()}))},item:(U,q)=>(r.current.add(U),q&&(s.current.has(q)?s.current.get(q).add(U):s.current.set(q,new Set([U]))),j(3,()=>{J(),B(),n.current.value||z(),D.emit()}),()=>{l.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let le=K();j(4,()=>{J(),(le==null?void 0:le.getAttribute("id"))===U&&z(),D.emit()})}),group:U=>(s.current.has(U)||s.current.set(U,new Set),()=>{l.current.delete(U),s.current.delete(U)}),filter:()=>d.current.shouldFilter,label:h||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:T,inputId:O,labelId:_,listInnerRef:A}),[]);function V(U,q){var le,me;let ve=(me=(le=d.current)==null?void 0:le.filter)!=null?me:HY;return U?ve(U,n.current.search,q):0}function B(){if(!n.current.search||d.current.shouldFilter===!1)return;let U=n.current.filtered.items,q=[];n.current.filtered.groups.forEach(me=>{let ve=s.current.get(me),fe=0;ve.forEach(Ee=>{let De=U.get(Ee);fe=Math.max(De,fe)}),q.push([me,fe])});let le=A.current;Y().sort((me,ve)=>{var fe,Ee;let De=me.getAttribute("id"),be=ve.getAttribute("id");return((fe=U.get(be))!=null?fe:0)-((Ee=U.get(De))!=null?Ee:0)}).forEach(me=>{let ve=me.closest(xx);ve?ve.appendChild(me.parentElement===ve?me:me.closest(`${xx} > *`)):le.appendChild(me.parentElement===le?me:me.closest(`${xx} > *`))}),q.sort((me,ve)=>ve[1]-me[1]).forEach(me=>{var ve;let fe=(ve=A.current)==null?void 0:ve.querySelector(`${fd}[${bc}="${encodeURIComponent(me[0])}"]`);fe==null||fe.parentElement.appendChild(fe)})}function z(){let U=Y().find(le=>le.getAttribute("aria-disabled")!=="true"),q=U==null?void 0:U.getAttribute(bc);D.setState("value",q||void 0)}function J(){var U,q,le,me;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ve=0;for(let fe of r.current){let Ee=(q=(U=l.current.get(fe))==null?void 0:U.value)!=null?q:"",De=(me=(le=l.current.get(fe))==null?void 0:le.keywords)!=null?me:[],be=V(Ee,De);n.current.filtered.items.set(fe,be),be>0&&ve++}for(let[fe,Ee]of s.current)for(let De of Ee)if(n.current.filtered.items.get(De)>0){n.current.filtered.groups.add(fe);break}n.current.filtered.count=ve}function oe(){var U,q,le;let me=K();me&&(((U=me.parentElement)==null?void 0:U.firstChild)===me&&((le=(q=me.closest(fd))==null?void 0:q.querySelector(FY))==null||le.scrollIntoView({block:"nearest"})),me.scrollIntoView({block:"nearest"}))}function K(){var U;return(U=A.current)==null?void 0:U.querySelector(`${ZD}[aria-selected="true"]`)}function Y(){var U;return Array.from(((U=A.current)==null?void 0:U.querySelectorAll(AT))||[])}function I(U){let q=Y()[U];q&&D.setState("value",q.getAttribute(bc))}function W(U){var q;let le=K(),me=Y(),ve=me.findIndex(Ee=>Ee===le),fe=me[ve+U];(q=d.current)!=null&&q.loop&&(fe=ve+U<0?me[me.length-1]:ve+U===me.length?me[0]:me[ve+U]),fe&&D.setState("value",fe.getAttribute(bc))}function G(U){let q=K(),le=q==null?void 0:q.closest(fd),me;for(;le&&!me;)le=U>0?YY(le,fd):WY(le,fd),me=le==null?void 0:le.querySelector(AT);me?D.setState("value",me.getAttribute(bc)):W(U)}let ie=()=>I(Y().length-1),L=U=>{U.preventDefault(),U.metaKey?ie():U.altKey?G(1):W(1)},Z=U=>{U.preventDefault(),U.metaKey?I(0):U.altKey?G(-1):W(-1)};return p.createElement(Ze.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:U=>{var q;(q=R.onKeyDown)==null||q.call(R,U);let le=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||le))switch(U.key){case"n":case"j":{E&&U.ctrlKey&&L(U);break}case"ArrowDown":{L(U);break}case"p":case"k":{E&&U.ctrlKey&&Z(U);break}case"ArrowUp":{Z(U);break}case"Home":{U.preventDefault(),I(0);break}case"End":{U.preventDefault(),ie();break}case"Enter":{U.preventDefault();let me=K();if(me){let ve=new Event(Cb);me.dispatchEvent(ve)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:JY},h),dg(e,U=>p.createElement(WD.Provider,{value:D},p.createElement(YD.Provider,{value:k},U))))}),VY=p.forwardRef((e,t)=>{var n,r;let s=Kn(),l=p.useRef(null),c=p.useContext(QD),d=Ef(),h=JD(e),m=(r=(n=h.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;fl(()=>{if(!m)return d.item(s,c==null?void 0:c.id)},[m]);let g=eO(s,l,[e.value,e.children,l],e.keywords),v=oS(),x=hi(j=>j.value&&j.value===g.current),b=hi(j=>m||d.filter()===!1?!0:j.search?j.filtered.items.get(s)>0:!0);p.useEffect(()=>{let j=l.current;if(!(!j||e.disabled))return j.addEventListener(Cb,w),()=>j.removeEventListener(Cb,w)},[b,e.onSelect,e.disabled]);function w(){var j,D;C(),(D=(j=h.current).onSelect)==null||D.call(j,g.current)}function C(){v.setState("value",g.current,!0)}if(!b)return null;let{disabled:E,value:R,onSelect:T,forceMount:_,keywords:O,...A}=e;return p.createElement(Ze.div,{ref:io(l,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!x,"data-disabled":!!E,"data-selected":!!x,onPointerMove:E||d.getDisablePointerSelection()?void 0:C,onClick:E?void 0:w},e.children)}),zY=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...l}=e,c=Kn(),d=p.useRef(null),h=p.useRef(null),m=Kn(),g=Ef(),v=hi(b=>s||g.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);fl(()=>g.group(c),[]),eO(c,d,[e.value,e.heading,h]);let x=p.useMemo(()=>({id:c,forceMount:s}),[s]);return p.createElement(Ze.div,{ref:io(d,t),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},n&&p.createElement("div",{ref:h,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),dg(e,b=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},p.createElement(QD.Provider,{value:x},b))))}),$Y=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=p.useRef(null),l=hi(c=>!c.search);return!n&&!l?null:p.createElement(Ze.div,{ref:io(s,t),...r,"cmdk-separator":"",role:"separator"})}),BY=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,l=oS(),c=hi(m=>m.search),d=hi(m=>m.selectedItemId),h=Ef();return p.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),p.createElement(Ze.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,"aria-activedescendant":d,id:h.inputId,type:"text",value:s?e.value:c,onChange:m=>{s||l.setState("search",m.target.value),n==null||n(m.target.value)}})}),GY=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,l=p.useRef(null),c=p.useRef(null),d=hi(m=>m.selectedItemId),h=Ef();return p.useEffect(()=>{if(c.current&&l.current){let m=c.current,g=l.current,v,x=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let b=m.offsetHeight;g.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(v),x.unobserve(m)}}},[]),p.createElement(Ze.div,{ref:io(l,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:h.listId},dg(e,m=>p.createElement("div",{ref:io(c,h.listInnerRef),"cmdk-list-sizer":""},m)))}),qY=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:l,container:c,...d}=e;return p.createElement(Ep,{open:n,onOpenChange:r},p.createElement(Rp,{container:c},p.createElement(Tp,{"cmdk-overlay":"",className:s}),p.createElement(_p,{"aria-label":e.label,"cmdk-dialog":"",className:l},p.createElement(XD,{ref:t,...d}))))}),KY=p.forwardRef((e,t)=>hi(n=>n.filtered.count===0)?p.createElement(Ze.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ZY=p.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...l}=e;return p.createElement(Ze.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},dg(e,c=>p.createElement("div",{"aria-hidden":!0},c)))}),au=Object.assign(XD,{List:GY,Item:VY,Input:BY,Group:zY,Separator:$Y,Dialog:qY,Empty:KY,Loading:ZY});function YY(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function WY(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function JD(e){let t=p.useRef(e);return fl(()=>{t.current=e}),t}var fl=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Sc(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function hi(e){let t=oS(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function eO(e,t,n,r=[]){let s=p.useRef(),l=Ef();return fl(()=>{var c;let d=(()=>{var m;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(m=g.current.textContent)==null?void 0:m.trim():s.current}})(),h=r.map(m=>m.trim());l.value(e,d,h),(c=t.current)==null||c.setAttribute(bc,d),s.current=d}),s}var QY=()=>{let[e,t]=p.useState(),n=Sc(()=>new Map);return fl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function XY(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function dg({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(XY(t),{ref:t.ref},n(t.props.children)):n(t)}var JY={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function tO({className:e,...t}){return o.jsx(au,{"data-slot":"command",className:de("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function nO({className:e,...t}){return o.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[o.jsx(vi,{className:"size-4 shrink-0 opacity-50"}),o.jsx(au.Input,{"data-slot":"command-input",className:de("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 eW({className:e,...t}){return o.jsx(au.List,{"data-slot":"command-list",className:de("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function rO({...e}){return o.jsx(au.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function aO({className:e,...t}){return o.jsx(au.Group,{"data-slot":"command-group",className:de("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 sO({className:e,...t}){return o.jsx(au.Item,{"data-slot":"command-item",className:de("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var fg="Popover",[oO,mne]=jr(fg,[js]),Rf=js(),[tW,ji]=oO(fg),iO=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!1}=e,d=Rf(t),h=p.useRef(null),[m,g]=p.useState(!1),[v,x]=ra({prop:r,defaultProp:s??!1,onChange:l,caller:fg});return o.jsx(nf,{...d,children:o.jsx(tW,{scope:t,contentId:Kn(),triggerRef:h,open:v,onOpenChange:x,onOpenToggle:p.useCallback(()=>x(b=>!b),[x]),hasCustomAnchor:m,onCustomAnchorAdd:p.useCallback(()=>g(!0),[]),onCustomAnchorRemove:p.useCallback(()=>g(!1),[]),modal:c,children:n})})};iO.displayName=fg;var lO="PopoverAnchor",nW=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ji(lO,n),l=Rf(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=s;return p.useEffect(()=>(c(),()=>d()),[c,d]),o.jsx(qc,{...l,...r,ref:t})});nW.displayName=lO;var cO="PopoverTrigger",uO=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ji(cO,n),l=Rf(n),c=gt(t,s.triggerRef),d=o.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":pO(s.open),...r,ref:c,onClick:Te(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?d:o.jsx(qc,{asChild:!0,...l,children:d})});uO.displayName=cO;var iS="PopoverPortal",[rW,aW]=oO(iS,{forceMount:void 0}),dO=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,l=ji(iS,t);return o.jsx(rW,{scope:t,forceMount:n,children:o.jsx(yr,{present:n||l.open,children:o.jsx(gl,{asChild:!0,container:s,children:r})})})};dO.displayName=iS;var Uc="PopoverContent",fO=p.forwardRef((e,t)=>{const n=aW(Uc,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,l=ji(Uc,e.__scopePopover);return o.jsx(yr,{present:r||l.open,children:l.modal?o.jsx(oW,{...s,ref:t}):o.jsx(iW,{...s,ref:t})})});fO.displayName=Uc;var sW=ii("PopoverContent.RemoveScroll"),oW=p.forwardRef((e,t)=>{const n=ji(Uc,e.__scopePopover),r=p.useRef(null),s=gt(t,r),l=p.useRef(!1);return p.useEffect(()=>{const c=r.current;if(c)return Cp(c)},[]),o.jsx(ef,{as:sW,allowPinchZoom:!0,children:o.jsx(hO,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,c=>{var d;c.preventDefault(),l.current||(d=n.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,m=d.button===2||h;l.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Te(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),iW=p.forwardRef((e,t)=>{const n=ji(Uc,e.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(hO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,m;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),hO=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,...v}=e,x=ji(Uc,n),b=Rf(n);return bp(),o.jsx(Jd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx(pl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:g,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:o.jsx(rf,{"data-state":pO(x.open),role:"dialog",id:x.contentId,...b,...v,ref:t,style:{...v.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)"}})})})}),mO="PopoverClose",lW=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ji(mO,n);return o.jsx(Ze.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});lW.displayName=mO;var cW="PopoverArrow",uW=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Rf(n);return o.jsx(af,{...s,...r,ref:t})});uW.displayName=cW;function pO(e){return e?"open":"closed"}var dW=iO,fW=uO,hW=dO,mW=fO;function lS({...e}){return o.jsx(dW,{"data-slot":"popover",...e})}function cS({...e}){return o.jsx(fW,{"data-slot":"popover-trigger",...e})}function uS({className:e,align:t="center",sideOffset:n=4,...r}){return o.jsx(hW,{children:o.jsx(mW,{"data-slot":"popover-content",align:t,sideOffset:n,className:de("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 dS({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:s="No results found.",className:l,disabled:c=!1}){const[d,h]=p.useState(!1),[m,g]=p.useState(""),v=p.useMemo(()=>{const w={};return e.forEach(C=>{const E=C.group??"";Object.prototype.hasOwnProperty.call(w,E)||(w[E]=[]),w[E].push(C)}),w},[e]),x=e.find(w=>w.value===t),b=p.useCallback(w=>{n(w),requestAnimationFrame(()=>{g(""),h(!1)})},[n]);return o.jsxs(lS,{open:d,onOpenChange:h,modal:!0,children:[o.jsx(cS,{asChild:!0,children:o.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":d,className:de("w-full justify-between",!t&&"text-muted-foreground",l),disabled:c,children:[x?x.label:r,o.jsx(Gb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(uS,{className:"max-h-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:o.jsxs(tO,{children:[o.jsx(nO,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:g}),o.jsx(rO,{children:s}),Object.entries(v).map(([w,C])=>{const E=m?C.filter(R=>R.label.toLowerCase().includes(m.toLowerCase())):C;return E.length===0?null:o.jsx(aO,{heading:w,children:E.map(R=>o.jsxs(sO,{value:R.value,onSelect:()=>{b(R.value)},children:[o.jsx(vr,{className:de("mr-2 h-4 w-4",t===R.value?"opacity-100":"opacity-0")}),R.label]},R.value))},w||"default")})]})})]})}var hg="Collapsible",[pW,gO]=jr(hg),[gW,fS]=pW(hg),vO=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:l,onOpenChange:c,...d}=e,[h,m]=ra({prop:r,defaultProp:s??!1,onChange:c,caller:hg});return o.jsx(gW,{scope:n,disabled:l,contentId:Kn(),open:h,onOpenToggle:p.useCallback(()=>m(g=>!g),[m]),children:o.jsx(Ze.div,{"data-state":mS(h),"data-disabled":l?"":void 0,...d,ref:t})})});vO.displayName=hg;var yO="CollapsibleTrigger",xO=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=fS(yO,n);return o.jsx(Ze.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":mS(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Te(e.onClick,s.onOpenToggle)})});xO.displayName=yO;var hS="CollapsibleContent",bO=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=fS(hS,e.__scopeCollapsible);return o.jsx(yr,{present:n||s.open,children:({present:l})=>o.jsx(vW,{...r,ref:t,present:l})})});bO.displayName=hS;var vW=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...l}=e,c=fS(hS,n),[d,h]=p.useState(r),m=p.useRef(null),g=gt(t,m),v=p.useRef(0),x=v.current,b=p.useRef(0),w=b.current,C=c.open||d,E=p.useRef(C),R=p.useRef(void 0);return p.useEffect(()=>{const T=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(T)},[]),lr(()=>{const T=m.current;if(T){R.current=R.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const _=T.getBoundingClientRect();v.current=_.height,b.current=_.width,E.current||(T.style.transitionDuration=R.current.transitionDuration,T.style.animationName=R.current.animationName),h(r)}},[c.open,r]),o.jsx(Ze.div,{"data-state":mS(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!C,...l,ref:g,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:C&&s})});function mS(e){return e?"open":"closed"}var yW=vO,xW=xO,bW=bO,Ja="Accordion",SW=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[pS,CW,wW]=Ip(Ja),[mg,pne]=jr(Ja,[wW,gO]),gS=gO(),SO=je.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,l=r;return o.jsx(pS.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?o.jsx(_W,{...l,ref:t}):o.jsx(TW,{...s,ref:t})})});SO.displayName=Ja;var[CO,EW]=mg(Ja),[wO,RW]=mg(Ja,{collapsible:!1}),TW=je.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:l=!1,...c}=e,[d,h]=ra({prop:n,defaultProp:r??"",onChange:s,caller:Ja});return o.jsx(CO,{scope:e.__scopeAccordion,value:je.useMemo(()=>d?[d]:[],[d]),onItemOpen:h,onItemClose:je.useCallback(()=>l&&h(""),[l,h]),children:o.jsx(wO,{scope:e.__scopeAccordion,collapsible:l,children:o.jsx(EO,{...c,ref:t})})})}),_W=je.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...l}=e,[c,d]=ra({prop:n,defaultProp:r??[],onChange:s,caller:Ja}),h=je.useCallback(g=>d((v=[])=>[...v,g]),[d]),m=je.useCallback(g=>d((v=[])=>v.filter(x=>x!==g)),[d]);return o.jsx(CO,{scope:e.__scopeAccordion,value:c,onItemOpen:h,onItemClose:m,children:o.jsx(wO,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(EO,{...l,ref:t})})})}),[jW,pg]=mg(Ja),EO=je.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:l="vertical",...c}=e,d=je.useRef(null),h=gt(d,t),m=CW(n),v=Lp(s)==="ltr",x=Te(e.onKeyDown,b=>{var k;if(!SW.includes(b.key))return;const w=b.target,C=m().filter(V=>{var B;return!((B=V.ref.current)!=null&&B.disabled)}),E=C.findIndex(V=>V.ref.current===w),R=C.length;if(E===-1)return;b.preventDefault();let T=E;const _=0,O=R-1,A=()=>{T=E+1,T>O&&(T=_)},j=()=>{T=E-1,T<_&&(T=O)};switch(b.key){case"Home":T=_;break;case"End":T=O;break;case"ArrowRight":l==="horizontal"&&(v?A():j());break;case"ArrowDown":l==="vertical"&&A();break;case"ArrowLeft":l==="horizontal"&&(v?j():A());break;case"ArrowUp":l==="vertical"&&j();break}const D=T%R;(k=C[D].ref.current)==null||k.focus()});return o.jsx(jW,{scope:n,disabled:r,direction:s,orientation:l,children:o.jsx(pS.Slot,{scope:n,children:o.jsx(Ze.div,{...c,"data-orientation":l,ref:h,onKeyDown:r?void 0:x})})})}),ip="AccordionItem",[NW,vS]=mg(ip),RO=je.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,l=pg(ip,n),c=EW(ip,n),d=gS(n),h=Kn(),m=r&&c.value.includes(r)||!1,g=l.disabled||e.disabled;return o.jsx(NW,{scope:n,open:m,disabled:g,triggerId:h,children:o.jsx(yW,{"data-orientation":l.orientation,"data-state":DO(m),...d,...s,ref:t,disabled:g,open:m,onOpenChange:v=>{v?c.onItemOpen(r):c.onItemClose(r)}})})});RO.displayName=ip;var TO="AccordionHeader",_O=je.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=pg(Ja,n),l=vS(TO,n);return o.jsx(Ze.h3,{"data-orientation":s.orientation,"data-state":DO(l.open),"data-disabled":l.disabled?"":void 0,...r,ref:t})});_O.displayName=TO;var wb="AccordionTrigger",jO=je.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=pg(Ja,n),l=vS(wb,n),c=RW(wb,n),d=gS(n);return o.jsx(pS.ItemSlot,{scope:n,children:o.jsx(xW,{"aria-disabled":l.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:l.triggerId,...d,...r,ref:t})})});jO.displayName=wb;var NO="AccordionContent",AO=je.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=pg(Ja,n),l=vS(NO,n),c=gS(n);return o.jsx(bW,{role:"region","aria-labelledby":l.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}})});AO.displayName=NO;function DO(e){return e?"open":"closed"}var AW=SO,DW=RO,OW=_O,MW=jO,kW=AO;const yS={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:o.jsx(U5,{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}},OO=p.createContext("default");function rr({variant:e="default",...t}){return o.jsx(OO.Provider,{value:e,children:o.jsx(AW,{"data-slot":"accordion",...t})})}function xS(e){const t=p.useContext(OO);return e??t??"default"}function Ln({className:e,variant:t,...n}){const r=xS(t),{itemClass:s}=yS[r];return o.jsx(DW,{"data-slot":"accordion-item",className:de(s,e),...n})}function Pn({className:e,children:t,variant:n,...r}){const s=xS(n),{triggerClass:l,icon:c,chevronClass:d,headerClass:h}=yS[s];return o.jsx(OW,{className:h,children:o.jsxs(MW,{"data-slot":"accordion-trigger",className:de(l,e),...r,children:[c,t,o.jsx(Oa,{className:d,"aria-hidden":"true"})]})})}function Un({className:e,children:t,variant:n,...r}){const s=xS(n),{contentClass:l,contentInnerClass:c}=yS[s];return o.jsx(kW,{"data-slot":"accordion-content",className:de(l,e),...r,children:o.jsx("div",{className:c,children:t})})}function In({href:e,children:t,className:n,...r}){return o.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:de("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,o.jsx(Qd,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function IW(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"service-account-details",children:[o.jsx(Pn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(Un,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(In,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Assign the ",o.jsx("strong",{children:"bigquery.dataEditor"})," and ",o.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function LW(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"project-id-details",children:[o.jsx(Pn,{children:"How do I find my Project ID?"}),o.jsxs(Un,{children:[o.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(In,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),o.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),o.jsxs("li",{children:["Find your project in the list. The ",o.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),o.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function PW(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"gbq-location-details",children:[o.jsx(Pn,{children:"How do I find my dataset location?"}),o.jsxs(Un,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(In,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),o.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),o.jsxs("li",{children:["Click each dataset name to open its details. The ",o.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",o.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),o.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."}),o.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const MO=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}},UW=({form:e})=>{const[t,n]=p.useState(!1);if(e.watch("type")!==Ie.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?MO(l):null;return o.jsxs(o.Fragment,{children:[o.jsxs(Es,{title:"Connection Settings",children:[o.jsx(qt,{control:e.control,name:"config.projectId",render:({field:d})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),o.jsx(Yt,{children:o.jsx(zt,{...d,placeholder:"Enter a Project Id"})}),o.jsx(Mn,{children:o.jsx(LW,{})}),o.jsx(tn,{})]})}),o.jsx(qt,{control:e.control,name:"config.location",render:({field:d})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),o.jsx(Yt,{children:o.jsx(dS,{options:h$,value:d.value,onValueChange:d.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),o.jsx(Mn,{children:o.jsx(PW,{})}),o.jsx(tn,{})]})})]}),o.jsx(Es,{title:"Authentication",children:o.jsx(qt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(Kt,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Zt,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&l&&o.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(Yt,{children:!t&&c?o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(In,{href:c.url,children:c.email})}),o.jsx(Mt,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx(ui,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(Mn,{children:o.jsx(IW,{})}),o.jsx(tn,{})]})})})]})};function FW(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"athena-region-details",children:[o.jsx(Pn,{children:"How do I find my Athena region?"}),o.jsxs(Un,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(In,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),o.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),o.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function HW(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"athena-output-bucket-details",children:[o.jsx(Pn,{children:"How do I find a bucket?"}),o.jsxs(Un,{children:[o.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",o.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(In,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),o.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),o.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),o.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function VW(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"athena-access-key-id-details",children:[o.jsx(Pn,{children:"How do I get my AWS Access Key ID?"}),o.jsxs(Un,{children:[o.jsx("p",{className:"mb-2",children:"Before accessing your AWS Access Key ID, make sure you have a user or role with the necessary permissions to use Athena and Glue in your AWS account."}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(In,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/users",children:"IAM Users"})," ","or"," ",o.jsx(In,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/roles",children:"IAM Roles"})," ","in the AWS Console."]}),o.jsx("li",{children:"Either choose an existing user/role or create a new one."}),o.jsxs("li",{children:["In the ",o.jsx("strong",{children:"Permissions"})," tab, attach the following policies:",o.jsxs("ul",{className:"mt-2 ml-4 list-inside list-disc space-y-1",children:[o.jsx("li",{children:o.jsx("code",{className:"text-sm font-semibold",children:"AmazonAthenaFullAccess"})}),o.jsx("li",{children:o.jsx("code",{className:"text-sm font-semibold",children:"AWSGlueFullAccess"})}),o.jsx("li",{children:o.jsx("code",{className:"text-sm font-semibold",children:"AmazonS3FullAccess"})})]})]}),o.jsx("li",{children:"After setting up permissions, continue with the steps below to create or find the access keys."})]}),o.jsx(J_,{className:"my-4"}),o.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(In,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),o.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function zW(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"athena-secret-access-key-details",children:[o.jsx(Pn,{children:"How do I get my AWS Secret Access Key?"}),o.jsxs(Un,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(In,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),o.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 $W=({form:e})=>{const[t,n]=p.useState("");return p.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")!==Ie.AWS_ATHENA?null:o.jsxs(o.Fragment,{children:[o.jsxs(Es,{title:"Connection Settings",children:[o.jsx(qt,{control:e.control,name:"config.region",render:({field:r})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),o.jsx(Yt,{children:o.jsx(zt,{...r,placeholder:"Enter a region"})}),o.jsx(Mn,{children:o.jsx(FW,{})}),o.jsx(tn,{})]})}),o.jsx(qt,{control:e.control,name:"config.outputBucket",render:({field:r})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),o.jsx(Yt,{children:o.jsx(zt,{...r,placeholder:"Enter an output bucket"})}),o.jsx(Mn,{children:o.jsx(HW,{})}),o.jsx(tn,{})]})})]}),o.jsxs(Es,{title:"Authentication",children:[o.jsx(qt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),o.jsx(Yt,{children:o.jsx(zt,{...r,placeholder:"Enter an access key id"})}),o.jsx(Mn,{children:o.jsx(VW,{})}),o.jsx(tn,{})]})}),o.jsx(qt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),o.jsx(Yt,{children:o.jsx(zt,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),o.jsx(Mn,{children:o.jsx(zW,{})}),o.jsx(tn,{})]})})]})]})};function BW(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"bigquery-api-details",children:[o.jsx(Pn,{children:"How do I enable the BigQuery API?"}),o.jsxs(Un,{children:[o.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",o.jsx(In,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function GW(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"athena-api-details",children:[o.jsx(Pn,{children:"How do I activate Athena API?"}),o.jsxs(Un,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(In,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),o.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),o.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function kO(e){return JSON.parse(JSON.stringify(e))}function qW({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Ei({resolver:Rl(O$),defaultValues:e}),{watch:l,control:c,formState:{isDirty:d,isSubmitting:h}}=s,m=l("type");je.useEffect(()=>{r==null||r(d)},[d,r]);const g=async v=>{const{dirtyFields:x}=s.formState,b=kO(v);return x.credentials||delete b.credentials,t(b)};return o.jsx(Cl,{...s,children:o.jsxs(Ri,{onSubmit:v=>{s.handleSubmit(g)(v)},noValidate:!0,children:[o.jsxs(wl,{children:[o.jsxs(Es,{title:"General",children:[o.jsx(qt,{control:c,name:"title",render:({field:v})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),o.jsx(Yt,{children:o.jsx(zt,{...v,placeholder:"Storage title"})}),o.jsx(tn,{})]})}),o.jsx(qt,{control:c,name:"type",render:({field:v})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),o.jsx(Yt,{children:o.jsxs(ca,{value:v.value,onValueChange:v.onChange,disabled:!!e,children:[o.jsx(da,{className:"w-full",children:o.jsx(ua,{placeholder:"Select a storage type"})}),o.jsx(fa,{children:o.jsx(lg,{children:Ci.getAllTypes().map(({type:x,displayName:b,icon:w,status:C})=>o.jsx(kn,{value:x,disabled:C===eo.COMING_SOON,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(w,{size:20}),b]})},x))})})]})}),o.jsxs(Mn,{children:[m===Ie.GOOGLE_BIGQUERY&&o.jsx(BW,{}),m===Ie.AWS_ATHENA&&o.jsx(GW,{})]}),o.jsx(tn,{})]})})]}),m===Ie.GOOGLE_BIGQUERY&&o.jsx(UW,{form:s}),m===Ie.AWS_ATHENA&&o.jsx($W,{form:s})]}),o.jsxs(El,{children:[o.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!d||h,children:"Save"}),o.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function IO({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=cg(),[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),h(!1),t()},[t]),v=p.useCallback(b=>{h(b)},[]),x=async b=>{if(n){const w=await s(n.id,b);w&&(r(w),t())}};return o.jsxs(o.Fragment,{children:[o.jsx(yi,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(xi,{children:[o.jsxs(bi,{children:[o.jsx(vl,{children:"Configure Storage Provider"}),o.jsx($c,{children:"Customize settings for your storage provider"})]}),o.jsx(qW,{initialData:n??void 0,onSubmit:x,onCancel:m,onDirtyChange:v})]})}),o.jsx(ia,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const KW=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=p.useState(!1),s=Ci.getInfo(e.type),l=()=>{r(!0)},c=()=>{r(!1)},d=()=>{if(!(()=>{switch(e.type){case Ie.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case Ie.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);default:return!1}})())return"Storage configuration is incomplete";const m=(v,x)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[v,":"]})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:x})]}),g=(v,x,b)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[v,":"]})," ",o.jsx(In,{href:b,onClick:w=>{w.stopPropagation()},children:x})]});switch(e.type){case Ie.GOOGLE_BIGQUERY:{const v=e.config.projectId,x=e.config.location,b=`https://console.cloud.google.com/bigquery?project=${v}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[g("Project ID",v,b),o.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",x)]})}case Ie.AWS_ATHENA:{const v=e.config.region,x=e.config.outputBucket,b=`https://s3.console.aws.amazon.com/s3/buckets/${x}?region=${v}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",v),o.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Bucket",x,b)]})}default:return"Unknown storage type configuration"}};return o.jsxs(o.Fragment,{children:[o.jsx(ni,{}),o.jsx(bb,{title:e.title,icon:s.icon,subtitle:d(),onClick:l}),o.jsx(sS,{children:o.jsx(IO,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:h=>{t&&t(h),Vt.success("Saved")}})})]})};function ZW({initialType:e,onTypeSelect:t}){var c;const[n,r]=p.useState(e??null),s=d=>{r(d),t(d)},l=[{type:Qe.SQL,label:"SQL",description:"SQL query"},{type:Qe.TABLE,label:"Table",description:"Existing table"},{type:Qe.VIEW,label:"View",description:"Existing view"},{type:Qe.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:Qe.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return o.jsxs("div",{className:"dm-card-block",children:[o.jsx(la,{className:"text-foreground",children:"Definition Type"}),o.jsxs(ca,{value:n??"",onValueChange:d=>{s(d)},children:[o.jsx(da,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:o.jsx(ua,{placeholder:"Select definition type",children:n&&((c=l.find(d=>d.type===n))==null?void 0:c.label)})}),o.jsx(fa,{children:o.jsx(lg,{children:l.map(d=>o.jsxs(kn,{value:d.type,children:[d.label,o.jsx("span",{className:"text-muted-foreground/80 ml-2",children:d.description})]},d.type))})})]})]})}const YW=rn({definitionType:Ns(Qe.SQL),definition:rn({sqlQuery:an().min(1,"SQL query is required")})}),WW=e=>{const t=hA(e);return rn({definitionType:Ns(Qe.TABLE),definition:t})},QW=e=>{const t=hA(e);return rn({definitionType:Ns(Qe.VIEW),definition:t})},XW=e=>{const t=$B(e);return rn({definitionType:Ns(Qe.TABLE_PATTERN),definition:t})},JW=rn({definitionType:Ns(Qe.CONNECTOR),definition:rn({connector:rn({source:rn({name:an().min(1,"Connector name is required"),configuration:L1(X7(W7())).min(1,"At least one configuration is required"),node:an().min(1,"Node is required"),fields:L1(an()).min(1,"At least one field is required")}),storage:rn({fullyQualifiedName:an().min(1,"fully qualified name is required")})})})}),eQ=(e,t)=>{if(!e)return rn({definitionType:J7(S0(Qe)),definition:rn({}).optional()});switch(e){case Qe.SQL:return YW;case Qe.TABLE:return WW(t);case Qe.VIEW:return QW(t);case Qe.TABLE_PATTERN:return XW(t);case Qe.CONNECTOR:return JW;default:return rn({})}};function tQ({control:e}){return o.jsx(qt,{control:e,name:"definition.sqlQuery",render:({field:t})=>o.jsxs(Kt,{className:"dm-card-block",children:[o.jsx(Zt,{className:"text-foreground",children:"SQL Query"}),o.jsx(Yt,{children:o.jsx(NY,{initialValue:{sqlQuery:t.value},onChange:n=>{t.onChange(n.sqlQuery)}})}),o.jsx(tn,{})]})})}function nQ({control:e,storageType:t}){const n=WN(t),r=QN(t);return o.jsx(qt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(Kt,{className:"dm-card-block",children:[o.jsx(Zt,{children:"Fully Qualified Table Name"}),o.jsx(Yt,{children:o.jsx(zt,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(Mn,{className:"text-muted-foreground/75",children:r}),o.jsx(tn,{})]})})}function rQ({control:e,storageType:t}){const n=WN(t),r=QN(t);return o.jsx(qt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(Kt,{className:"dm-card-block",children:[o.jsx(Zt,{children:"Fully Qualified View Name"}),o.jsx(Yt,{children:o.jsx(zt,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(Mn,{className:"text-muted-foreground/75",children:r}),o.jsx(tn,{})]})})}function aQ({control:e,storageType:t}){const n=P$(t),r=U$(t);return o.jsx(qt,{control:e,name:"definition.pattern",render:({field:s})=>o.jsxs(Kt,{className:"dm-card-block",children:[o.jsx(Zt,{children:"Table Pattern"}),o.jsx(Yt,{children:o.jsx(zt,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(Mn,{className:"text-muted-foreground/75",children:r}),o.jsx(tn,{})]})})}const LO=e=>{switch(e){case Qe.SQL:return{sqlQuery:""};case Qe.TABLE:return{fullyQualifiedName:""};case Qe.VIEW:return{fullyQualifiedName:""};case Qe.TABLE_PATTERN:return{pattern:""};case Qe.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}};function bm({className:e,...t}){return o.jsx("div",{"data-slot":"card",className:de("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Sm({className:e,...t}){return o.jsx("div",{"data-slot":"card-header",className:de("@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 Eb({className:e,...t}){return o.jsx("div",{"data-slot":"card-title",className:de("leading-none font-semibold",e),...t})}function sQ({className:e,...t}){return o.jsx("div",{"data-slot":"card-description",className:de("text-muted-foreground text-sm",e),...t})}function Rb({className:e,...t}){return o.jsx("div",{"data-slot":"card-content",className:de("px-6",e),...t})}function oQ({className:e,...t}){return o.jsx("div",{"data-slot":"card-footer",className:de("flex items-center px-6 [.border-t]:pt-6",e),...t})}const iQ=Wd("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 bS({className:e,variant:t,...n}){return o.jsx("div",{"data-slot":"alert",role:"alert",className:de(iQ({variant:t}),e),...n})}function PO({className:e,...t}){return o.jsx("div",{"data-slot":"alert-title",className:de("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function SS({className:e,...t}){return o.jsx("div",{"data-slot":"alert-description",className:de("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function lQ({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:l}){return n?o.jsx("div",{className:"space-y-4",children:o.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6}).map((c,d)=>o.jsxs(bm,{children:[o.jsxs(Sm,{children:[o.jsx(pr,{className:"h-4 w-3/4"}),o.jsx(pr,{className:"h-3 w-1/2"})]}),o.jsx(Rb,{children:o.jsx(pr,{className:"h-10 w-full"})})]},d))})}):r?o.jsxs(bS,{variant:"destructive",children:[o.jsx(Hc,{className:"h-4 w-4"}),o.jsx(SS,{children:"Failed to load available connectors. Please try again."})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-2",children:e.map(c=>o.jsx(bm,{className:`cursor-pointer transition-all duration-200 hover:shadow-md ${(t==null?void 0:t.name)===c.name?"ring-primary border-primary":"hover:border-muted-foreground/25"}`,onClick:()=>{s(c)},onDoubleClick:()=>{s(c),l==null||l(c)},children:o.jsx(Sm,{children:o.jsx("div",{className:"flex items-center justify-between",children:o.jsxs("div",{className:"flex items-center gap-2",children:[c.logoBase64&&o.jsx(df,{base64:c.logoBase64,size:16}),o.jsx(Eb,{className:"text-base",children:c.displayName})]})})})},c.name))}),e.length===0&&o.jsxs("div",{className:"py-8 text-center",children:[o.jsx(P_,{className:"text-muted-foreground mx-auto mb-4 h-12 w-12"}),o.jsx("h4",{className:"text-muted-foreground text-lg font-medium",children:"No connectors available"}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Contact your administrator to add connector configurations."})]}),o.jsx("div",{className:"flex flex-col gap-4",children:o.jsxs(bm,{className:"bg-muted cursor-pointer transition-all duration-200 hover:shadow-md",children:[o.jsx(Sm,{className:"pb-3",children:o.jsx(Eb,{className:"text-base",children:"Custom code"})}),o.jsx(Rb,{children:o.jsx("p",{className:"text-muted-foreground text-sm",children:"Coming soon..."})})]})})]})}function cQ(e,t,n){const{name:r,title:s,requiredType:l,options:c,placeholder:d,default:h}=e,m=s??r,g=r;if(c&&c.length>0){const v=c.map(x=>({value:x,label:x}));return o.jsx(dS,{options:v,value:t[r]||h||"",onValueChange:x=>{n(r,x)},placeholder:d??`Select ${m.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}switch(l){case us.BOOLEAN:return o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("input",{type:"checkbox",id:g,name:r,checked:t[r]||h||!1,onChange:v=>{n(r,v.target.checked)},className:"text-primary focus:ring-primary border-border h-4 w-4 rounded"}),o.jsx(la,{htmlFor:g,className:"cursor-pointer text-sm",children:m})]});case us.NUMBER:return o.jsx(zt,{id:g,name:r,type:"number",value:t[r]||h||"",placeholder:d??`Enter ${m.toLowerCase()}`,onChange:v=>{const x=parseFloat(v.target.value)||0;n(r,x)}});case us.ARRAY:return o.jsx(ui,{id:g,name:r,value:Array.isArray(t[r])?t[r].join(`
674
+ `):Array.isArray(h)?h.join(`
675
+ `):"",placeholder:d??`Enter ${m.toLowerCase()} (one per line)`,rows:4,onChange:v=>{const x=v.target.value.split(`
676
+ `).filter(b=>b.trim());n(r,x)}});case us.OBJECT:return o.jsx(ui,{id:g,name:r,value:t[r]&&typeof t[r]=="object"?JSON.stringify(t[r],null,2):typeof h=="object"?JSON.stringify(h,null,2):"",placeholder:d??`Enter ${m.toLowerCase()} as JSON`,rows:6,className:"font-mono",onChange:v=>{try{const x=JSON.parse(v.target.value);n(r,x)}catch{n(r,v.target.value)}}});case us.DATE:{const v=x=>{if(!x||typeof x!="string"&&typeof x!="number")return"";const b=typeof x=="string"?x:x.toString();try{const w=new Date(b);return isNaN(w.getTime())?"":w.toISOString().split("T")[0]}catch{return""}};return o.jsx(zt,{id:g,name:r,type:"date",value:t[r]||v(h)||"",placeholder:d??`Enter ${m.toLowerCase()}`,onChange:x=>{n(r,x.target.value)}})}case us.STRING:default:return o.jsx(zt,{id:g,name:r,type:"text",value:t[r]||h||"",placeholder:d??`Enter ${m.toLowerCase()}`,onChange:v=>{n(r,v.target.value)}})}}function DT({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:s,loading:l=!1}){const[c,d]=p.useState({}),h=p.useRef(!1),m=p.useRef(!1);p.useEffect(()=>{if(t){m.current=!0;const b={...s??{}};t.forEach(w=>{b[w.name]===void 0&&w.default!==void 0&&(b[w.name]=w.default)}),d(b),h.current=!0,setTimeout(()=>{m.current=!1},0)}},[t,s]),p.useEffect(()=>{h.current&&s&&Object.keys(s).length>0&&(m.current=!0,d(s),setTimeout(()=>{m.current=!1},0))},[s]),p.useEffect(()=>{h.current&&!m.current&&Object.keys(c).length>0&&(n==null||n(c))},[c,n]);const g=(b,w)=>{d(C=>({...C,[b]:w}))},v=(b,w)=>w.filter(E=>E.required&&E.showInUI!==!1&&E.name!=="Fields").every(E=>{const R=b[E.name];return!(R==null||typeof R=="string"&&R.trim()===""||Array.isArray(R)&&R.length===0)});if(p.useEffect(()=>{if(t&&r){const b=v(c,t);r(b)}},[c,t,r]),l)return o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-lg font-medium",children:"Configuration"}),o.jsx("p",{className:"text-muted-foreground mb-8 text-sm",children:"Loading connector configuration..."}),o.jsx("div",{className:"flex flex-col gap-4",children:Array.from({length:3}).map((b,w)=>o.jsxs("div",{className:"mb-2 space-y-1",children:[o.jsx(pr,{className:"h-4 w-32"}),o.jsx(pr,{className:"h-10 w-full"}),o.jsx(pr,{className:"h-3 w-48"})]},w))})]});if(!t||t.length===0)return null;const x=[...t].filter(b=>b.showInUI!==!1&&b.name!=="Fields").sort((b,w)=>{const C=E=>{const R=E.default!=null&&E.default!=="";return E.required&&!R?1:E.required&&R?2:!E.required&&!R?3:4};return C(b)-C(w)});return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.logoBase64&&o.jsx(df,{base64:e.logoBase64,size:32}),o.jsxs("h4",{className:"text-lg font-medium",children:[e.displayName," configuration"]})]}),e.docUrl&&o.jsx("a",{href:e.docUrl,target:"_blank",rel:"noopener noreferrer",children:o.jsxs(we,{variant:"link",className:"mb-2 cursor-pointer text-sm",children:["View documentation ",o.jsx(Qd,{className:"h-4 w-4"})]})}),o.jsx("div",{className:"flex flex-col gap-4",children:x.map(b=>o.jsxs("div",{className:"mb-2 space-y-1",children:[b.requiredType!==us.BOOLEAN&&o.jsxs(la,{htmlFor:b.name,className:"group flex items-center justify-between gap-2 text-sm font-medium",children:[o.jsxs("span",{children:[b.title??b.name,b.required&&o.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),b.description&&o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx("button",{type:"button",tabIndex:-1,className:"opacity-60 transition-opacity hover:opacity-100","aria-label":"Help information",children:o.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(Mt,{side:"top",align:"center",role:"tooltip",children:b.description})]})]}),cQ(b,c,g)]},b.name))})]})}function uQ({connectorFields:e,selectedField:t,connectorName:n,loading:r=!1,onFieldSelect:s}){const l=n?`Select node for ${n}`:"Select node";return r?o.jsxs("div",{className:"space-y-4",children:[o.jsx("h4",{className:"text-lg font-medium",children:l}),o.jsx("div",{className:"flex flex-col gap-4",children:Array.from({length:3}).map((c,d)=>o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(pr,{className:"h-4 w-4 rounded-full"}),o.jsx(pr,{className:"h-4 w-32"})]},d))})]}):!e||e.length===0?o.jsxs("div",{className:"space-y-4",children:[o.jsx("h4",{className:"text-lg font-medium",children:l}),o.jsx("p",{className:"text-destructive text-sm",children:n?`No nodes found for ${n}`:"No nodes found"}),o.jsx("p",{className:"text-muted-foreground text-muted-foreground text-sm",children:"This connector might not be fully implemented yet or there could be other issues. Please create an issue on GitHub to report this problem."})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsx("h4",{className:"text-lg font-medium",children:l}),o.jsxs("p",{className:"text-muted-foreground text-sm",children:["Can't find the node you need? Open an"," ",o.jsx(In,{href:"https://github.com/OWOX/owox-data-marts/issues",children:"issue here"}),"."]}),o.jsx("div",{className:"flex flex-col gap-4",children:e.map(c=>o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("input",{type:"radio",id:c.name,name:"selectedField",value:c.name,className:"text-primary focus:ring-primary border-border h-4 w-4",onChange:d=>{s(d.target.value)},checked:t===c.name}),o.jsx("label",{htmlFor:c.name,className:"text-muted-foreground cursor-pointer text-sm",children:o.jsx("div",{className:"flex items-center gap-2",children:c.overview??c.name})}),c.name&&o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(Fr,{className:"text-muted-foreground/75 inline-block h-4 w-4 cursor-help"})}),o.jsxs(Mt,{children:[o.jsxs("p",{children:["Table name: ",c.destinationName??c.name]}),c.description&&o.jsx("p",{children:c.description}),c.documentation&&o.jsx("p",{children:c.documentation})]})]})]},c.name))})]})}var cs=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(cs||{});function OT({connectorFields:e,selectedField:t,selectedFields:n,onFieldToggle:r,onSelectAllFields:s}){const l=p.useRef(null),c=p.useRef(null),[d,h]=p.useState(""),[m,g]=p.useState(cs.ORIGINAL),v=e==null?void 0:e.find(D=>D.name===t),x=p.useMemo(()=>(v==null?void 0:v.fields)??[],[v==null?void 0:v.fields]),b=p.useMemo(()=>(v==null?void 0:v.uniqueKeys)??[],[v==null?void 0:v.uniqueKeys]),w=p.useMemo(()=>{const D=new Map;return x.forEach((k,V)=>D.set(k.name,V)),D},[x]),C=p.useMemo(()=>{const D=x.filter(V=>V.name.toLowerCase().includes(d.toLowerCase().trim())),k=(V,B)=>{const z=b.includes(V.name),J=b.includes(B.name);if(z&&!J)return-1;if(!z&&J)return 1;if(m===cs.ASC)return V.name.localeCompare(B.name);if(m===cs.DESC)return B.name.localeCompare(V.name);const oe=w.get(V.name)??0,K=w.get(B.name)??0;return oe-K};return[...D].sort(k)},[x,d,b,m,w]),E=x.map(D=>D.name),R=E.filter(D=>!b.includes(D)),T=n.filter(D=>R.includes(D)).length,_=n.filter(D=>E.includes(D)).length,O=R.length>0&&T===R.length,A=T>0&&T<R.length;if(p.useEffect(()=>{l.current&&(l.current.indeterminate=A)},[A]),p.useEffect(()=>{if(b.length>0){const D=b.filter(k=>x.some(V=>V.name===k)&&!n.includes(k));D.length>0&&D.forEach(k=>{r(k,!0)})}},[t,b,x,n,r]),!t||!e||!x.length)return null;const j=D=>{const k=D.target.checked;s?s(R,k):R.forEach(V=>{const B=n.includes(V);k&&!B?r(V,!0):!k&&B&&r(V,!1)})};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("h4",{className:"text-lg font-medium",children:["Selected field for node: ",t]}),o.jsxs("p",{className:"text-muted-foreground text-sm",children:["Can’t find the field you need? Open an"," ",o.jsx(In,{href:"https://github.com/OWOX/owox-data-marts/issues",children:"issue here"}),"."]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("input",{ref:l,type:"checkbox",id:"master-checkbox",className:"text-primary focus:ring-primary border-border h-4 w-4",checked:O,onChange:j}),o.jsxs("label",{htmlFor:"master-checkbox",className:"cursor-pointer text-sm font-medium",children:["Select all fields (",_,"/",E.length,")"]})]}),o.jsxs("div",{className:"flex items-center gap-2 pr-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(vi,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var D;(D=c.current)==null||D.focus()}}),o.jsx("input",{ref:c,type:"text",placeholder:"Search",value:d,onChange:D=>{h(D.target.value)},className:"focus:border-primary h-8 w-48 rounded-none border-0 bg-transparent pl-9 text-sm outline-none focus:border-b"})]}),o.jsxs(xr,{children:[o.jsx(br,{asChild:!0,children:o.jsxs(we,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[m===cs.ASC&&o.jsx(KR,{className:"h-4 w-4"}),m===cs.DESC&&o.jsx(qR,{className:"h-4 w-4"}),m===cs.ORIGINAL&&o.jsx(ZR,{className:"h-4 w-4"})]})}),o.jsxs(cr,{align:"end",children:[o.jsxs(Ft,{onSelect:()=>{g(cs.ASC)},children:[o.jsx(KR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),o.jsxs(Ft,{onSelect:()=>{g(cs.DESC)},children:[o.jsx(qR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),o.jsxs(Ft,{onSelect:()=>{g(cs.ORIGINAL)},children:[o.jsx(ZR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]})]}),o.jsx("div",{className:"border-border border-t"}),o.jsxs("div",{className:"flex flex-col gap-3",children:[C.map(D=>{const k=b.includes(D.name);return o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("input",{type:"checkbox",id:`field-${D.name}`,name:"selectedFields",value:D.name,className:"text-primary focus:ring-primary border-border h-4 w-4",onChange:V=>{k||r(D.name,V.target.checked)},checked:n.includes(D.name),disabled:k}),o.jsx("label",{htmlFor:`field-${D.name}`,className:`cursor-pointer text-sm ${k?"text-foreground font-medium":"text-muted-foreground"}`,children:o.jsxs("div",{className:"flex items-center gap-2",children:[D.name,k&&o.jsx(YR,{className:"text-primary h-3 w-3"})]})}),D.name&&o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(Fr,{className:"text-muted-foreground/75 inline-block h-4 w-4 cursor-help"})}),o.jsxs(Mt,{children:[k&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(YR,{className:"text-secondary h-3 w-3"}),o.jsx("p",{className:"font-semibold",children:"Unique key"})]}),o.jsxs("p",{children:["Type: ",D.type]}),D.description&&o.jsx("p",{children:D.description})]})]})]},D.name)}),C.length===0&&d&&o.jsxs("div",{className:"text-muted-foreground py-4 text-center text-sm",children:['No fields match "',d,'"']})]})]})]})}const UO=p.createContext(void 0),FO={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function dQ(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 FO;default:return e}}class fQ extends Yc{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 pc=new fQ;var hn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(hn||{});const Ec={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class Tb{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!==hn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await Xs.getReportById(n.reportId),s=Yi(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:hn.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 hQ{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:hn.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 bx={getMapper(e){switch(e){case hn.REPORT_RUN:return new Tb;case hn.CONNECTOR_RUN:return new hQ;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},hd={mapFromDto(e){return bx.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 hn.REPORT_RUN:return new Tb().enhanceWithReportData(n);case hn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new Tb,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===hn.REPORT_RUN),l=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case hn.REPORT_RUN:return l.find(d=>d.id===c.id)??c;case hn.CONNECTOR_RUN:{const d=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:d}}}default:return c}})},mapToCreateRequest(e){return bx.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return bx.getMapper(e.type).mapToUpdateRequest(e)}};function mQ({children:e}){const[t,n]=p.useReducer(dQ,FO),{dataMart:r}=wi(),{fetchAvailableConnectors:s}=Sl();if(!r)throw new Error("Trigger provider must be used within a data mart context");const l=p.useCallback(async b=>{await s(),n({type:"FETCH_TRIGGERS_START"});try{const w=await pc.getScheduledTriggers(b),C=await hd.mapFromDtoListWithReportData(w,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:C})}catch(w){n({type:"FETCH_TRIGGERS_ERROR",payload:w instanceof Error?w.message:"Failed to fetch scheduled triggers"})}},[r,s]),c=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGERS_START"});try{const E=(await pc.getScheduledTriggers(b)).filter(T=>T.type===w),R=await hd.mapFromDtoListWithReportData(E,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(C){n({type:"FETCH_TRIGGERS_ERROR",payload:C instanceof Error?C.message:"Failed to fetch scheduled triggers"})}},[r]),d=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGER_START"});try{const C=await pc.getScheduledTrigger(b,w),E=await hd.mapFromDtoWithReportData(C,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:E})}catch(C){n({type:"FETCH_TRIGGER_ERROR",payload:C instanceof Error?C.message:"Failed to fetch scheduled trigger"})}},[r]),h=p.useCallback(async(b,w,C,E,R,T)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:w,cronExpression:C,timeZone:E,isActive:R,triggerConfig:T},O=await pc.createScheduledTrigger(b,_),A=await hd.mapFromDtoWithReportData(O,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:A}),A}catch(_){throw n({type:"CREATE_TRIGGER_ERROR",payload:_ instanceof Error?_.message:"Failed to create scheduled trigger"}),_}},[r]),m=p.useCallback(async(b,w,C,E,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const T={cronExpression:C,timeZone:E,isActive:R},_=await pc.updateScheduledTrigger(b,w,T),O=await hd.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:O})}catch(T){throw n({type:"UPDATE_TRIGGER_ERROR",payload:T instanceof Error?T.message:"Failed to update scheduled trigger"}),T}},[r]),g=p.useCallback(async(b,w)=>{n({type:"DELETE_TRIGGER_START"});try{await pc.deleteScheduledTrigger(b,w),n({type:"DELETE_TRIGGER_SUCCESS",payload:w})}catch(C){throw n({type:"DELETE_TRIGGER_ERROR",payload:C instanceof Error?C.message:"Failed to delete scheduled trigger"}),C}},[]),v=p.useCallback(b=>{n({type:"SELECT_TRIGGER",payload:b})},[]),x=p.useCallback(()=>{n({type:"RESET"})},[]);return o.jsx(UO.Provider,{value:{...t,getScheduledTriggers:l,getScheduledTriggersByType:c,getScheduledTrigger:d,createScheduledTrigger:h,updateScheduledTrigger:m,deleteScheduledTrigger:g,selectScheduledTrigger:v,reset:x},children:e})}function HO(){const e=p.useContext(UO);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function pQ(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:l,deleteScheduledTrigger:c,selectScheduledTrigger:d,reset:h,triggers:m,selectedTrigger:g,isLoading:v,error:x}=HO();return p.useEffect(()=>(e?t(e):h(),()=>{h()}),[e,t,h]),{triggers:m,selectedTrigger:g,isLoading:v,error:x,getScheduledTriggers:b=>t(b),getScheduledTriggersByType:(b,w)=>n(b,w),getScheduledTrigger:(b,w)=>r(b,w),createScheduledTrigger:(b,w,C,E,R,T)=>s(b,w,C,E,R,T),updateScheduledTrigger:(b,w,C,E,R)=>l(b,w,C,E,R),deleteScheduledTrigger:(b,w)=>c(b,w),selectScheduledTrigger:d}}const gQ=rn({type:Ns(Ec.SCHEDULED_REPORT_RUN),reportId:an().min(1,"Report ID is required")}),vQ=Y7(),yQ=rn({type:S0(hn),cronExpression:an().min(1,"Cron expression is required"),timeZone:an().min(1,"Time zone is required"),isActive:Z7(),triggerConfig:Q7([gQ,vQ])});function xQ({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=Ei({resolver:Rl(yQ),defaultValues:{type:e?e.type:n??hn.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:Ec.SCHEDULED_REPORT_RUN,reportId:t??""}}});p.useEffect(()=>{t&&s.getValues("type")===hn.REPORT_RUN&&s.setValue("triggerConfig",{type:Ec.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),p.useEffect(()=>{n&&(s.setValue("type",n),n===hn.REPORT_RUN?s.setValue("triggerConfig",{type:Ec.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const l=d=>{s.setValue("type",d),d===hn.REPORT_RUN?s.setValue("triggerConfig",{type:Ec.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null)},c=async d=>{try{await r(d)}catch(h){console.error("Error submitting form:",h)}};return{form:s,handleTypeChange:l,handleSubmit:s.handleSubmit(c),isDirty:s.formState.isDirty}}function bQ({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=bl(),{dataMart:l}=wi();p.useEffect(()=>{l&&s(l.id)},[s,l]);const c=r.filter(d=>d.dataDestination.type===It.GOOGLE_SHEETS);return o.jsxs(ca,{value:e,onValueChange:t,disabled:n,children:[o.jsx(da,{className:"w-full",children:o.jsx(ua,{placeholder:"Select a report"})}),o.jsx(fa,{children:c.map(d=>o.jsx(kn,{value:d.id,children:d.title},d.id))})]})}var gg="Switch",[SQ,gne]=jr(gg),[CQ,wQ]=SQ(gg),VO=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:h="on",onCheckedChange:m,form:g,...v}=e,[x,b]=p.useState(null),w=gt(t,_=>b(_)),C=p.useRef(!1),E=x?g||!!x.closest("form"):!0,[R,T]=ra({prop:s,defaultProp:l??!1,onChange:m,caller:gg});return o.jsxs(CQ,{scope:n,checked:R,disabled:d,children:[o.jsx(Ze.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":GO(R),"data-disabled":d?"":void 0,disabled:d,value:h,...v,ref:w,onClick:Te(e.onClick,_=>{T(O=>!O),E&&(C.current=_.isPropagationStopped(),C.current||_.stopPropagation())})}),E&&o.jsx(BO,{control:x,bubbles:!C.current,name:r,value:h,checked:R,required:c,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});VO.displayName=gg;var zO="SwitchThumb",$O=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=wQ(zO,n);return o.jsx(Ze.span,{"data-state":GO(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});$O.displayName=zO;var EQ="SwitchBubbleInput",BO=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},l)=>{const c=p.useRef(null),d=gt(c,l),h=rS(n),m=i0(t);return p.useEffect(()=>{const g=c.current;if(!g)return;const v=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(v,"checked").set;if(h!==n&&b){const w=new Event("click",{bubbles:r});b.call(g,n),g.dispatchEvent(w)}},[h,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:d,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});BO.displayName=EQ;function GO(e){return e?"checked":"unchecked"}var RQ=VO,TQ=$O;function qO({className:e,...t}){return o.jsx(RQ,{"data-slot":"switch",className:de("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(TQ,{"data-slot":"switch-thumb",className:de("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 _Q(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 _b(e,t="UTC"){const n=_Q(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:l,month:c,dayOfWeek:d}=n;if(r.startsWith("*/")&&s==="*"&&l==="*"&&c==="*"&&d==="*"){const v=Number.parseInt(r.substring(2));if(!isNaN(v))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:v,timezone:t}}if(r!=="*"&&s.startsWith("*/")&&l==="*"&&c==="*"&&d==="*"){const v=Number.parseInt(s.substring(2));if(!isNaN(v)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:v,timezone:t}}const h=Number.parseInt(r),m=Number.parseInt(s),g=!isNaN(h)&&!isNaN(m)?`${m.toString().padStart(2,"0")}:${h.toString().padStart(2,"0")}`:"09:00";if(!isNaN(h)&&!isNaN(m)&&l==="*"&&c==="*"&&d==="*")return{type:"daily",time:g,weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};if(!isNaN(h)&&!isNaN(m)&&l==="*"&&c==="*"&&d!=="*"){const v=d.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=0&&x<=6);if(v.length>0)return{type:"weekly",time:g,weekdays:v,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(h)&&!isNaN(m)&&l!=="*"&&c==="*"&&d==="*"){const v=l.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=1&&x<=31);if(v.length>0)return{type:"monthly",time:g,weekdays:[1,2,3,4,5],monthDays:v,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 KO({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:l=3}){const[c,d]=p.useState(!1),h=v=>{const x=t.includes(v)?t.filter(b=>b!==v):[...t,v].sort((b,w)=>b-w);n(x)},m=(v,x)=>{x.preventDefault(),x.stopPropagation(),n(t.filter(b=>b!==v))},g=()=>{if(t.length===0)return o.jsx("span",{className:"text-muted-foreground text-sm",children:r});const v=t.map(x=>e.find(b=>b.value===x)).filter(Boolean);return v.length<=l?o.jsx("div",{className:"flex flex-wrap gap-1",children:v.map(x=>o.jsxs(Rr,{variant:"secondary",className:"h-5 text-xs",children:[x.label,o.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:b=>m(x.value,b),children:o.jsx(Ad,{className:"h-2 w-2"})})]},x.value))}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(Rr,{variant:"secondary",className:"h-5 text-xs",children:[v[0].label,o.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(v[0].value,x),children:o.jsx(Ad,{className:"h-2 w-2"})})]}),v.length>1&&o.jsxs(Rr,{variant:"outline",className:"h-5 text-xs",children:["+",v.length-1]})]})};return o.jsxs(lS,{open:c,onOpenChange:d,modal:!0,children:[o.jsx(cS,{asChild:!0,children:o.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[o.jsx("div",{className:"flex-1 text-left",children:g()}),o.jsx(Gb,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),o.jsx(uS,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:o.jsxs(tO,{className:"h-full overflow-visible",children:[o.jsx(nO,{placeholder:s,className:"h-8"}),o.jsxs(eW,{className:"h-full max-h-[350px] overflow-y-auto",children:[o.jsx(rO,{children:"No items found."}),o.jsx(aO,{className:"h-full overflow-visible",children:e.map(v=>o.jsxs(sO,{value:v.value.toString(),onSelect:()=>h(v.value),className:"text-sm",children:[o.jsx(vr,{className:de("mr-2 h-3 w-3",t.includes(v.value)?"opacity-100":"opacity-0")}),v.label]},v.value))})]})]})})]})}const ZO=[{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"}],rm=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function YO(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 l;return(l=ZO.find(c=>c.value===s))==null?void 0:l.label}).join(", ")} at ${n}`;case"monthly":{const s=[...e.monthDays].sort((c,d)=>c-d).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 jQ(e,t,n=!0){const r=_b(e,t);return YO(r,n)}const NQ=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),jb=[5,10,15,30],Nb=[1,2,3,4,6,8,12],AQ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(la,{children:"Type"}),o.jsxs(ca,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[o.jsx(da,{className:"w-full",children:o.jsx(ua,{})}),o.jsxs(fa,{children:[o.jsx(kn,{value:"daily",children:"Daily"}),o.jsx(kn,{value:"weekly",children:"Weekly"}),o.jsx(kn,{value:"monthly",children:"Monthly"}),o.jsx(kn,{value:"interval",children:"Interval"})]})]})]}),DQ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(la,{children:"Time"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(zt,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),MT=({value:e,onChange:t,disabled:n,timezones:r})=>o.jsxs("div",{className:"w-full space-y-2",children:[o.jsx(la,{children:"Timezone"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(dS,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),OQ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(la,{children:"Days of Week"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(KO,{options:ZO,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),MQ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(la,{children:"Days of Month"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(KO,{options:NQ,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),kQ=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:s})=>o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(la,{children:"Type"}),o.jsxs(ca,{value:e,onValueChange:l=>{n(l)},disabled:s,children:[o.jsx(da,{className:"w-full",children:o.jsx(ua,{})}),o.jsxs(fa,{children:[o.jsx(kn,{value:"minutes",children:"Minutes"}),o.jsx(kn,{value:"hours",children:"Hours"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(la,{children:"Every"}),o.jsxs(ca,{value:t.toString(),onValueChange:l=>{r(Number.parseInt(l)||1)},disabled:s,children:[o.jsx(da,{className:"w-full",children:o.jsx(ua,{})}),o.jsx(fa,{children:(e==="minutes"?jb:Nb).map(l=>o.jsxs(kn,{value:l.toString(),children:[l," ",e==="minutes"?"min":"hr"]},l))})]})]})]}),IQ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(la,{className:"text-sm",children:"Cron Expression"}),o.jsx(zt,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),o.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function LQ({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:l=!0,showSaveButton:c=!1}){const[d,h]=p.useState(n),[m,g]=p.useState(t??rm()),[v,x]=p.useState(!1),b=p.useMemo(()=>Kz.getTimezonesWithOffset().map(K=>({value:K.identifier,label:K.displayName,offset:K.offsetString,isDST:K.isDST})),[]),[w,C]=p.useState(()=>_b(e,m)),[E,R]=p.useState(""),[T,_]=p.useState("");p.useEffect(()=>{h(n)},[n]),p.useEffect(()=>{const K=t??rm();g(K)},[t]),p.useEffect(()=>{if(e){const K=_b(e,m);C(K)}},[e,m]);const O=K=>{const[Y,I]=K.time.split(":").map(Number);switch(K.type){case"daily":return`${String(I)} ${String(Y)} * * *`;case"weekly":return`${String(I)} ${String(Y)} * * ${K.weekdays.join(",")}`;case"monthly":return`${String(I)} ${String(Y)} ${K.monthDays.join(",")} * *`;case"interval":return K.intervalType==="minutes"?`*/${String(K.intervalValue)} * * * *`:`0 */${String(K.intervalValue)} * * *`;case"custom":return K.customCron;default:return`${String(I)} ${String(Y)} * * *`}},A=p.useCallback(K=>{C(Y=>{if(Y.intervalType===K)return console.log("Type unchanged, skipping update"),Y;const W=(K==="minutes"?jb:Nb)[0];return{...Y,intervalType:K,intervalValue:W}})},[]),j=p.useCallback(K=>{C(Y=>(Y.intervalType==="minutes"?jb:Nb).includes(K)?{...Y,intervalValue:K}:Y)},[]),D=p.useMemo(()=>K=>YO(K,d),[d]);p.useEffect(()=>{const K=O(w);R(K),_(D(w))},[w,d,m,D]);const k=p.useRef(""),V=p.useRef(""),B=p.useRef(!1);p.useEffect(()=>{const K=O(w);r&&(k.current!==K||V.current!==m||B.current!==d)&&(r({cron:K,timezone:m,enabled:d}),k.current=K,V.current=m,B.current=d)},[w,m,d,r]);const z=K=>{h(K)},J=K=>{g(K),C(Y=>({...Y,timezone:K}))},oe=["daily","weekly","monthly"].includes(w.type);return o.jsxs("div",{className:s,children:[o.jsx("div",{className:"mb-4 space-y-4 pt-0",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-foreground flex items-center gap-1.5 font-medium",children:"Schedule Settings"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(la,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:d?"Enabled":"Disabled"}),o.jsx(qO,{id:"schedule-enabled",checked:d,onCheckedChange:z})]})]})}),o.jsxs("div",{className:"space-y-4 pt-0",children:[o.jsxs("div",{className:`space-y-4 ${d?"":"opacity-50"}`,children:[o.jsx(AQ,{value:w.type,onChange:K=>{C(Y=>({...Y,type:K}))},disabled:!d}),w.type!=="custom"&&w.type!=="interval"&&o.jsxs("div",{className:"flex gap-3",children:[o.jsx(DQ,{value:w.time,onChange:K=>{C(Y=>({...Y,time:K}))},disabled:!d}),oe&&o.jsx(MT,{value:m,onChange:J,disabled:!d,timezones:b})]}),(w.type==="interval"||w.type==="custom")&&o.jsx(MT,{value:m,onChange:J,disabled:!d,timezones:b}),w.type==="weekly"&&o.jsx(OQ,{value:w.weekdays,onChange:K=>{C(Y=>({...Y,weekdays:K}))},disabled:!d}),w.type==="monthly"&&o.jsx(MQ,{value:w.monthDays,onChange:K=>{C(Y=>({...Y,monthDays:K}))},disabled:!d}),w.type==="interval"&&o.jsx(kQ,{intervalType:w.intervalType,intervalValue:w.intervalValue,onTypeChange:A,onValueChange:j,disabled:!d}),w.type==="custom"&&o.jsx(IQ,{value:w.customCron,onChange:K=>{C(Y=>({...Y,customCron:K}))},disabled:!d})]}),l&&o.jsxs(o.Fragment,{children:[o.jsx(J_,{className:"my-3"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{x(!v)},children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(F_,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),v?o.jsx(bs,{className:"text-muted-foreground h-4 w-4"}):o.jsx(Oa,{className:"text-muted-foreground h-4 w-4"})]}),v&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),o.jsx(Rr,{variant:d?"default":"secondary",className:"text-xs",children:d?"Enabled":"Disabled"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),o.jsx(Rr,{variant:"secondary",className:"font-mono text-xs",children:E})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),o.jsx(Rr,{variant:"outline",className:"text-xs",children:m})]}),o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),o.jsx("span",{className:"flex-1 text-right text-xs",children:T})]})]}),d&&oe&&m!==rm()&&o.jsxs(bS,{className:"border-amber-200 bg-amber-50",children:[o.jsx(Hc,{className:"h-4 w-4"}),o.jsx(PO,{children:"Time Zone"}),o.jsxs(SS,{children:["Schedule runs in ",m," (not your local ",rm()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&o.jsx(we,{className:"w-full",disabled:!d,children:"Save Schedule"})]})]})}function PQ(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"trigger-type-options-description-details",children:[o.jsx(Pn,{children:"How do I choose a type?"}),o.jsxs(Un,{children:[o.jsxs("p",{className:"mb-2",children:[o.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)."]}),o.jsxs("p",{className:"mb-2",children:[o.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 UQ(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"trigger-type-change-description-details",children:[o.jsx(Pn,{children:"How do I change the trigger type?"}),o.jsx(Un,{children:o.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 FQ(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"report-change-description-details",children:[o.jsx(Pn,{children:"How do I change a report?"}),o.jsx(Un,{children:o.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 HQ(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"report-select-description-details",children:[o.jsx(Pn,{children:"How do I choose the report?"}),o.jsxs(Un,{children:[o.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),o.jsxs("p",{children:["You can use an existing one or create a new one on the ",o.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function VQ({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:l}){const[c,d]=p.useState(!1),{form:h,handleTypeChange:m,handleSubmit:g,isDirty:v}=xQ({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async E=>{d(!0);try{await r(E)}finally{d(!1)}}});p.useEffect(()=>{l==null||l(v)},[v,l]);const{control:x,watch:b}=h,C=b("type")===hn.REPORT_RUN;return o.jsx(Cl,{...h,children:o.jsxs(Ri,{onSubmit:E=>void g(E),noValidate:!1,children:[o.jsxs(wl,{children:[o.jsx(qt,{control:x,name:"type",render:({field:E})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),o.jsxs(ca,{onValueChange:R=>{E.onChange(R),m(R)},defaultValue:E.value,disabled:!!n||!!e||!!b("triggerConfig.reportId"),children:[o.jsx(Yt,{children:o.jsx(da,{className:"w-full",children:o.jsx(ua,{placeholder:"Select trigger type"})})}),o.jsxs(fa,{children:[o.jsx(kn,{value:hn.REPORT_RUN,children:"Report Run"}),o.jsx(kn,{value:hn.CONNECTOR_RUN,children:"Connector Run"})]})]}),o.jsx(Mn,{children:e?o.jsx(UQ,{}):o.jsx(PQ,{})}),o.jsx(tn,{})]})}),C&&o.jsx(qt,{control:x,name:"triggerConfig.reportId",render:({field:E})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),o.jsx(Yt,{children:o.jsx(nA,{children:o.jsx(bQ,{value:E.value,onChange:E.onChange,disabled:!!t||!!e})})}),o.jsx(Mn,{children:e!=null&&e.triggerConfig?o.jsx(FQ,{}):o.jsx(HQ,{})}),o.jsx(tn,{})]})}),o.jsx(LQ,{showPreview:!1,cron:b("cronExpression"),timezone:b("timeZone"),enabled:b("isActive"),onChange:E=>{h.setValue("cronExpression",E.cron,{shouldDirty:!0}),h.setValue("timeZone",E.timezone,{shouldDirty:!0}),h.setValue("isActive",E.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"})]}),o.jsxs(El,{children:[o.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!v||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),s&&o.jsx(we,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function zQ({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=p.useMemo(()=>jQ(e,t,n),[e,t,n]);return o.jsxs("div",{children:[o.jsx("div",{children:r}),n&&o.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function $Q({table:e}){return o.jsx("div",{className:"text-right",children:o.jsxs(xr,{children:[o.jsx(br,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(Ft,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta.title??t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(vr,{className:"size-3.5"})})}),o.jsx("span",{children:t.columnDef.meta.title??t.id})]})},t.id))})]})})}function BQ({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),d=()=>{c(!1),n(e.id)};return o.jsxs("div",{className:"text-right",onClick:h=>{h.stopPropagation()},children:[o.jsxs(xr,{open:r,onOpenChange:s,children:[o.jsx(br,{asChild:!0,children:o.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:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(cr,{align:"end",children:[o.jsx(Ft,{className:"dm-card-table-body-row-actiondropdownitem",onClick:()=>{t(e.id)},children:"Edit"}),o.jsx(Aa,{}),o.jsx(Ft,{className:"dm-card-table-body-row-actiondropdownitem text-red-600",onClick:()=>{c(!0)},children:"Delete"})]})]}),o.jsx(ia,{open:l,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:d,variant:"destructive"})]})}function GQ(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function qQ({connector:e}){const{connectors:t}=Sl(),n=GQ(e,t);return o.jsx(o.Fragment,{children:n})}function WO({connector:e}){return o.jsx(qQ,{connector:e})}function KQ(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 ZQ=e=>{const{connectors:t}=Sl();return p.useMemo(()=>t.find(n=>n.name===e),[t,e])},YQ=je.memo(function({connector:t,children:n}){const r=ZQ(t.source.name),{dataMart:s,runs:l,getDataMartRuns:c}=wi();p.useEffect(()=>{s!=null&&s.id&&c(s.id)},[s==null?void 0:s.id,c]);const d=p.useMemo(()=>r!=null&&r.logoBase64?o.jsx(df,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),h=p.useCallback(()=>{s!=null&&s.storage&&R$(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=p.useMemo(()=>KQ(l),[l]),g=p.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:FB(m.lastRunStatus),statusText:VB(m.lastRunStatus),date:m.lastRunDate},[m]),v=p.useMemo(()=>(s==null?void 0:s.storage)&&T$(s.storage),[s]),x=p.useMemo(()=>{const b=t.source.fields.length.toString();return`${t.source.node} • ${b} fields`},[t.source.node,t.source.fields.length]);return o.jsxs(D0,{children:[o.jsx(O0,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(M0,{children:[o.jsxs(k0,{children:[o.jsx(I0,{children:d}),o.jsxs(L0,{children:[o.jsx(P0,{children:o.jsx(WO,{connector:t})}),o.jsx(U0,{children:x})]})]}),o.jsxs(F0,{children:[o.jsxs(Qo,{children:[o.jsx(Xo,{children:"Last run status:"}),o.jsx(Jo,{children:g?o.jsx(vf,{type:g.statusType,variant:"ghost",children:g.statusText}):"Not run yet"})]}),o.jsxs(Qo,{children:[o.jsx(Xo,{children:"Last run date:"}),o.jsx(Jo,{children:g?o.jsx(cl,{date:g.date}):"Never run"})]}),o.jsxs(Qo,{children:[o.jsx(Xo,{children:"Total runs:"}),o.jsxs(Jo,{children:[m.totalRuns," runs",m.firstRunDate&&o.jsxs(o.Fragment,{children:[", since"," ",m.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),o.jsx(H0,{children:o.jsxs(we,{className:"w-full",variant:"default",onClick:h,title:"Open Storage","aria-label":"Open Storage",children:[v,o.jsx(Qd,{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 WQ(e){const t=e.triggerConfig;return o.jsxs("div",{className:"inline gap-1",children:[t.report.title,o.jsx(PB,{report:t.report,children:o.jsx(Fr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function QQ(e){const t=e.triggerConfig,{connector:n}=t.connector;return o.jsxs("div",{className:"inline gap-1",children:[o.jsx(WO,{connector:n}),o.jsx(YQ,{connector:n,children:o.jsx(Fr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function XQ({trigger:e}){switch(e.type){case hn.REPORT_RUN:return WQ(e);case hn.CONNECTOR_RUN:return QQ(e);default:return o.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function JQ({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===hn.REPORT_RUN?"Report Run":"Connector Run";return o.jsx(Rr,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>o.jsx(XQ,{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,l=n.getValue("isActive");return o.jsx(zQ,{cronExpression:String(r),timeZone:s,isEnabled:l})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(cl,{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 o.jsx("div",{className:"text-sm",children:r?o.jsx(cl,{date:new Date(r)}):o.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 o.jsx(vf,{type:r?xn.SUCCESS:xn.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>o.jsx($Q,{table:n}),cell:({row:n})=>o.jsx(BQ,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function eX({searchInputId:e,onAddTrigger:t,filterValue:n,onFilterChange:r}){return o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(vi,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),o.jsx(zt,{id:e,placeholder:"Search triggers",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search triggers"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:t,"aria-label":"Add new trigger",children:[o.jsx(ha,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]})}function tX({table:e,onPreviousClick:t,onNextClick:n}){return o.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),o.jsx(we,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function nX(e){const[t,n]=p.useState(""),r=p.useCallback(s=>{const l=s.target.value;n(l),e.setGlobalFilter(l)},[e]);return{value:t,onChange:r}}function QO({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){const{createScheduledTrigger:l,updateScheduledTrigger:c,selectedTrigger:d}=HO(),[h,m]=p.useState(!1),[g,v]=p.useState(!1),x=p.useCallback(()=>{g?m(!0):t()},[g,t]),b=p.useCallback(()=>{m(!1),v(!1),t()},[t]),w=p.useCallback(_=>{v(_)},[]),C=p.useCallback(()=>{v(!1),t()},[t]),E=!!d,R=p.useMemo(()=>d?{type:d.type,cronExpression:d.cronExpression,timeZone:d.timeZone,isActive:d.isActive,triggerConfig:d.type===hn.REPORT_RUN?{type:Ec.SCHEDULED_REPORT_RUN,reportId:d.triggerConfig.reportId}:null}:void 0,[d]),T=async _=>{E?await c(n,d.id,_.cronExpression,_.timeZone,_.isActive):await l(n,_.type,_.cronExpression,_.timeZone,_.isActive,_.triggerConfig),C()};return o.jsxs(o.Fragment,{children:[o.jsx(yi,{open:e,onOpenChange:_=>{_||x()},children:o.jsxs(xi,{children:[o.jsxs(bi,{children:[o.jsxs(vl,{children:[E?"Edit":"Create"," Scheduled Trigger"]}),o.jsx($c,{children:"Configure automatic runs for your reports or connectors."})]}),o.jsx(VQ,{preSelectedReportId:r,preSelectedType:s,initialData:R,onSubmit:T,onCancel:x,onDirtyChange:w})]})}),o.jsx(ia,{open:h,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:b,variant:"destructive"})]})}function rX({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,l]=p.useState(!1),c=p.useCallback(()=>{l(!0)},[]),d=p.useCallback(()=>{l(!1)},[]),h=p.useCallback(A=>{r(A)},[r]),m=p.useMemo(()=>JQ({onEditTrigger:n,onDeleteTrigger:h}),[n,h]),{sorting:g,setSorting:v,columnVisibility:x,setColumnVisibility:b}=bf({columns:m,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),w=Qc({data:e,columns:m,getCoreRowModel:Wc(),getPaginationRowModel:tg(),onSortingChange:v,getSortedRowModel:xf(),getFilteredRowModel:yf(),state:{sorting:g,columnVisibility:x},onColumnVisibilityChange:b,enableGlobalFilter:!0,enableColumnResizing:!1}),{value:C,onChange:E}=nX(w),R=p.useCallback(()=>{w.previousPage()},[w]),T=p.useCallback(()=>{w.nextPage()},[w]);return o.jsxs(o.Fragment,{children:[o.jsx(eX,{table:w,searchInputId:"scheduled-triggers-search-input",onAddTrigger:c,filterValue:C,onFilterChange:E}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Xc,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[o.jsx(Jc,{className:"dm-card-table-header",children:w.getHeaderGroups().map(A=>o.jsx(Zn,{className:"dm-card-table-header-row",children:A.headers.map(j=>o.jsx(tu,{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))},A.id))}),o.jsx(eu,{className:"dm-card-table-body",children:w.getRowModel().rows.length?w.getRowModel().rows.map((A,j)=>o.jsx(Zn,{onClick:()=>{n(A.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":j+1,children:A.getVisibleCells().map((D,k)=>o.jsx(oa,{className:`whitespace-normal ${D.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":k+1,style:D.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:D.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(D.column.getSize())}%`},children:typeof D.column.columnDef.cell=="function"?D.column.columnDef.cell(D.getContext()):D.column.columnDef.cell},D.id))},A.id)):o.jsx(Zn,{children:o.jsx(oa,{colSpan:m.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),o.jsx(tX,{table:w,onPreviousClick:R,onNextClick:T}),o.jsx(QO,{isOpen:s,onClose:d,dataMartId:t})]})}function aX({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=pQ(e),[l,c]=p.useState(!1);p.useEffect(()=>{s&&c(!0)},[s]);const d=g=>{const v=t.find(x=>x.id===g);v&&r(v)},h=()=>{c(!1),r(null)},m=async g=>{try{await n(e,g),Vt.success("Trigger deleted successfully")}catch(v){console.error("Error deleting trigger:",v),Vt.error("Failed to delete trigger")}};return o.jsxs(o.Fragment,{children:[o.jsx(rX,{triggers:t,dataMartId:e,onEditTrigger:d,onDeleteTrigger:g=>void m(g)}),o.jsx(QO,{isOpen:l,onClose:h,dataMartId:e})]})}function XO(){return o.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:o.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[o.jsx(H_,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"Time Triggers"}),o.jsxs("p",{className:"text-muted-foreground",children:["Go to the ",o.jsx("span",{className:"font-medium",children:"Triggers tab"})," to set up automatic runs."]})]})]})})}function sX({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:s}){const l=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[d,h]=p.useState(""),[m,g]=p.useState(""),[v,x]=p.useState(null),[b,w]=p.useState(null),C=_=>_.trim()?/^[A-Za-z][A-Za-z0-9_]*$/.test(_)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",E=p.useCallback((_,O,A,j)=>{s({fullyQualifiedName:`${_}.${O}`,isValid:!!(_&&O&&A===null&&j===null)})},[s]);p.useEffect(()=>{let _="",O="";if(t!=null&&t.fullyQualifiedName){const V=t.fullyQualifiedName.split(".");_=V[0]??"",O=V[1]??""}else _=`${c}_owox`,O=l;const A=C(_),j=C(O);h(_),g(O),x(A),w(j);const D=`${_}.${O}`,k=!!(_&&O&&A===null&&j===null);(!t||t.fullyQualifiedName!==D||t.isValid!==k)&&E(_,O,A,j)},[t,l,c,E]);const R=_=>{h(_);const O=C(_);x(O),E(_,m,O,b)},T=_=>{g(_);const O=C(_);w(O),E(d,_,v,O)};return o.jsxs("div",{className:"space-y-4",children:[o.jsx("h4",{className:"text-lg font-medium",children:"Setup target"}),o.jsxs("div",{className:"flex flex-col gap-4",children:[e===Ie.GOOGLE_BIGQUERY&&o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("label",{htmlFor:"dataset-name",className:"text-muted-foreground text-sm",children:"Enter dataset name for Google BigQuery where the connector data will be stored. The dataset will be created automatically if it doesn't exist."}),o.jsx(zt,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!v,"aria-describedby":v?"dataset-name-error":void 0,onChange:_=>{R(_.target.value)},required:!0}),v&&o.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:v})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("label",{htmlFor:"table-name",className:"text-muted-foreground text-sm",children:"Enter table name where the connector data will be stored. The table will be created automatically if it doesn't exist."}),o.jsx(zt,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"table-name-error":void 0,onChange:_=>{T(_.target.value)},required:!0}),b&&o.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:b})]}),o.jsxs("div",{className:"text-muted-foreground mt-2 text-sm",children:["Full path:"," ",o.jsxs("span",{className:"text-foreground/90",children:[d||"[dataset]",".",m||"[table]"]})]})]}),e===Ie.AWS_ATHENA&&o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("label",{htmlFor:"database-name",className:"text-muted-foreground text-sm",children:"Enter database name for Amazon Athena where the connector data will be stored. The database will be created automatically if it doesn't exist."}),o.jsx(zt,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!v,"aria-describedby":v?"database-name-error":void 0,onChange:_=>{R(_.target.value)},required:!0}),v&&o.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:v})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("label",{htmlFor:"athena-table-name",className:"text-muted-foreground text-sm",children:"Enter table name where the connector data will be stored. The table will be created automatically if it doesn't exist."}),o.jsx(zt,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"athena-table-name-error":void 0,onChange:_=>{T(_.target.value)},required:!0}),b&&o.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:b})]}),o.jsxs("div",{className:"text-muted-foreground mt-2 text-sm",children:["Full path:"," ",o.jsxs("span",{className:"text-foreground/90",children:[d||"[database]",".",m||"[table]"]})]})]}),o.jsx(XO,{})]})]})}function oX({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:l,onBack:c,onFinish:d,nextLabel:h="Next",backLabel:m="Back",finishLabel:g="Finish"}){const v=e===t;return o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{className:"flex-1",children:r&&o.jsxs(we,{variant:"outline",onClick:c,disabled:s,className:"flex items-center gap-2",children:[o.jsx(KL,{className:"h-4 w-4"}),m]})}),o.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),o.jsx("div",{className:"flex flex-1 justify-end",children:v?o.jsx(we,{onClick:d,disabled:!n||s,className:"flex items-center gap-2",children:g}):o.jsxs(we,{onClick:l,disabled:!n||s,className:"flex items-center gap-2",children:[h,o.jsx(ml,{className:"h-4 w-4"})]})})]})}function iX({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:s="full"}){const[l,c]=p.useState(null),[d,h]=p.useState(""),[m,g]=p.useState([]),[v,x]=p.useState(1),[b,w]=p.useState({}),[C,E]=p.useState(!1),[R,T]=p.useState(new Set),[_,O]=p.useState(new Set),{connectors:A,connectorSpecification:j,connectorFields:D,loading:k,loadingSpecification:V,loadingFields:B,error:z,fetchAvailableConnectors:J,fetchConnectorSpecification:oe,fetchConnectorFields:K}=Sl(),[Y,I]=p.useState(null),G=(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"}]).length,ie=p.useCallback(async Ne=>{!R.has(Ne)&&!V&&(T(vt=>new Set(vt).add(Ne)),await oe(Ne))},[R,V,oe]),L=p.useCallback(async Ne=>{_.has(Ne)||(O(vt=>new Set(vt).add(Ne)),await K(Ne))},[_,K]);p.useEffect(()=>{if(A.length===0&&!k&&J(),r&&A.length>0&&!l){const{source:Ne,storage:vt}=r;h(Ne.node),g(Ne.fields),w(Ne.configuration[0]||{}),I({fullyQualifiedName:vt.fullyQualifiedName,isValid:!0});const ut=A.find(Tt=>Tt.name===Ne.name);ut&&(c(ut),ie(ut.name),!n&&s!=="fields-only"&&L(ut.name),s==="fields-only"&&L(ut.name))}if(n&&A.length>0&&!l&&!r){const Ne=A[0];c(Ne),ie(Ne.name)}},[s,r,A,n,k,J,ie,L,l]);const Z=Ne=>{c(Ne),w({}),E(!1),T(vt=>{const ut=new Set(vt);return ut.delete(Ne.name),ut}),ie(Ne.name),L(Ne.name)},U=Ne=>{h(Ne),g([])},q=(Ne,vt)=>{g(vt?ut=>ut.includes(Ne)?ut:[...ut,Ne]:ut=>ut.filter(Tt=>Tt!==Ne))},le=(Ne,vt)=>{g(vt?ut=>{const Tt=Ne.filter(Ia=>!ut.includes(Ia));return[...ut,...Tt]}:ut=>ut.filter(Tt=>!Ne.includes(Tt)))},me=Ne=>{I(Ne)},ve=p.useCallback(Ne=>{w(Ne)},[]),fe=p.useCallback(Ne=>{E(Ne)},[]);p.useEffect(()=>{j&&(j.some(vt=>vt.required&&vt.showInUI!==!1&&vt.name!=="Fields")||E(!0))},[j]);const Ee=()=>{v<G&&x(v+1)},De=()=>{v>1&&x(v-1)},be=()=>{if(n)return l!==null&&C;if(s==="fields-only")switch(v){case 1:return m.length>0;default:return!1}switch(v){case 1:return l!==null;case 2:return C;case 3:return d!=="";case 4:return m.length>0;case 5:return Y!==null&&Y.fullyQualifiedName!==""&&Y.isValid;default:return!1}},Je=()=>v>1,Xe=(Ne,vt)=>{if(!Ne)return vt;const ut=Ne.find(Tt=>Tt.name===vt);return(ut==null?void 0:ut.destinationName)??vt},Ht=()=>{if(n&&v===1)return j&&l?o.jsx(DT,{connector:l,connectorSpecification:j,onConfigurationChange:ve,onValidationChange:fe,initialConfiguration:b,loading:V}):null;if(s==="fields-only")switch(v){case 1:return d&&D?o.jsx(OT,{connectorFields:D,selectedField:d,selectedFields:m,onFieldToggle:q,onSelectAllFields:le}):null;default:return null}switch(v){case 1:return o.jsx(lQ,{connectors:A,selectedConnector:l,loading:k,error:z,onConnectorSelect:Z,onConnectorDoubleClick:()=>{x(Ne=>Ne<G?Ne+1:Ne)}});case 2:return l&&j?o.jsx(DT,{connector:l,connectorSpecification:j,onConfigurationChange:ve,onValidationChange:fe,initialConfiguration:b,loading:V}):null;case 3:return l&&D?o.jsx(uQ,{connectorFields:D,selectedField:d,connectorName:l.displayName,loading:B,onFieldSelect:U}):null;case 4:return d&&D?o.jsx(OT,{connectorFields:D,selectedField:d,selectedFields:m,onFieldToggle:q,onSelectAllFields:le}):null;case 5:return d&&D?o.jsx(sX,{dataStorageType:t,destinationName:Xe(D,d),connectorName:(l==null?void 0:l.displayName)??"",target:Y,onTargetChange:me}):null;default:return null}};return o.jsxs("div",{className:"flex h-full flex-col p-4",children:[o.jsx("div",{className:"mb-6 flex-1 overflow-x-visible overflow-y-auto",children:Ht()}),o.jsx("div",{className:"bg-background -mx-4 border-t px-4 pt-4",children:o.jsx(oX,{currentStep:v,totalSteps:G,canGoNext:be(),canGoBack:Je(),isLoading:V||B,onNext:Ee,onBack:De,onFinish:()=>{n&&l?e({source:{name:l.name,configuration:[b],node:(r==null?void 0:r.source.node)??d,fields:(r==null?void 0:r.source.fields)??m},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}):s==="fields-only"&&r?e({source:{...r.source,fields:m},storage:r.storage}):l&&Y&&e({source:{name:l.name,configuration:[b],node:d,fields:m},storage:{fullyQualifiedName:Y.fullyQualifiedName}})}})})]})}function JO({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:l=null,mode:c="full"}){return o.jsx(yi,{open:e,onOpenChange:t,children:o.jsxs(xi,{className:"flex h-screen min-w-[480px] flex-col",children:[o.jsxs(bi,{children:[o.jsx(ng,{children:c==="fields-only"?"Edit Fields":l!=null&&l.source.name?"Table filled by connector":"Setup Connector"}),o.jsx(rg,{children:c==="fields-only"?"Select which fields to include in your data mart":"Setup your connector to use in your data mart"})]}),o.jsx("div",{className:"flex-1 overflow-x-visible overflow-y-auto",children:o.jsx(iX,{onSubmit:d=>{r(d),t()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:l,mode:c})})]})})}const CS=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null})=>{const[l,c]=p.useState(!1),d=()=>{c(!0)},h=()=>{c(!1)},m=()=>n?o.jsx("div",{onClick:d,style:{cursor:"pointer"},children:n}):null;return o.jsxs(o.Fragment,{children:[o.jsx(ni,{}),m(),l&&o.jsx(Pc,{children:o.jsx(JO,{isOpen:l,onClose:h,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s})})]})};function lX({storageType:e,onSetupConnector:t}){return o.jsx("div",{className:"space-y-4",children:o.jsx(CS,{dataStorageType:e,onSubmit:t,configurationOnly:!1,children:o.jsxs(we,{type:"button",variant:"outline",className:"flex h-24 w-full items-center justify-center gap-2 rounded-md border-0 border-b border-gray-200 bg-white shadow-none hover:bg-white hover:shadow-xs dark:bg-white/2",children:[o.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:o.jsx(c6,{className:"h-4 w-4",strokeWidth:2.25})}),o.jsx("span",{children:"Setup Connector"}),o.jsx(ml,{className:"h-6 w-6"})]})})})}const cX=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"Google BigQuery";case Ie.AWS_ATHENA:return"AWS Athena";default:return e}},Cc=e=>typeof e=="object"&&"connector"in e,md=e=>{if(!Cc(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&&n.fullyQualifiedName.split(".").length===2;return r&&s};function uX({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,dataMartStatus:s,totalConfigurations:l,dataStorage:c}){const d=Ci.getInfo(c.type),{connectors:h,fetchAvailableConnectors:m}=Sl();p.useEffect(()=>{m()},[m]);const g=C=>{const E=h.find(R=>R.name===C);if(E!=null&&E.logoBase64)return()=>o.jsx(df,{base64:E.logoBase64,size:24})},v=()=>{const C=t.connector.source.node||"No node selected";return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-muted-foreground/75",children:"Node:"})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:C}),o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(F_,{className:"h-4 w-4"})}),o.jsx(Mt,{children:"Open connector configuration"})]})]})},x=(C,E,R)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[C,":"]})," ",o.jsx(In,{href:R,onClick:T=>{T.stopPropagation()},children:E})]}),b=()=>{switch(c.type){case Ie.GOOGLE_BIGQUERY:{const C=c.config.projectId,E=t.connector.storage.fullyQualifiedName,R=E.split(".")[0],T=E.split(".")[1],_=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${R}`,O=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${R}!3s${T}`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x("Dataset",R,_),o.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Table",T,O),o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(Fr,{className:"h-4 w-4"})}),o.jsx(Mt,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Ie.AWS_ATHENA:{const C=c.config.region,E=t.connector.storage.fullyQualifiedName,[R,T]=E.split("."),_=`https://console.aws.amazon.com/athena/home?region=${C}#/query-editor`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x("Database",R,_),o.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Table",T,_),o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(Fr,{className:"h-4 w-4"})}),o.jsx(Mt,{children:"The database 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"}},w=()=>!(s===tr.PUBLISHED&&l===1);return o.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[o.jsx("div",{className:"flex-grow",children:o.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[o.jsx(CS,{dataStorageType:c.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:o.jsx(bb,{icon:g(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:v(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),o.jsx(bb,{title:cX(c.type),icon:d.icon,subtitle:b(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),o.jsx("div",{className:"shrink-0 px-4",children:o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(we,{type:"button",variant:"ghost",onClick:()=>{w()&&n(e)},disabled:!w(),children:o.jsx(xp,{className:"h-4 w-4"})})}),!w()&&o.jsx(Mt,{children:"Cannot remove the last configuration in published pipeline"})]})})]})}function dX({storageType:e,onAddConfiguration:t,existingConnector:n}){return o.jsx("div",{children:o.jsx(CS,{dataStorageType:e,onSubmit:r=>{const s=r.source.configuration[0]||{};t(s)},configurationOnly:!0,existingConnector:n,children:o.jsxs(we,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(ha,{className:"h-4 w-4"}),o.jsx("span",{children:"Configuration"})]})})})}function fX({control:e,storageType:t}){const{dataMart:n,runDataMart:r}=Ts(),{setValue:s,getValues:l,trigger:c}=nu(),[d,h]=p.useState(!1),m=()=>{setTimeout(()=>void c("definition"),0)},g=(n==null?void 0:n.status)??tr.DRAFT,v=_=>{const O=_.source,A=_.storage;s("definition",{connector:{source:O,storage:A}},{shouldDirty:!0,shouldTouch:!0}),m()},x=async _=>{if(n){if(n.status.code!==tr.PUBLISHED){ho.error("Manual run is only available for published data marts");return}await r({id:n.id,payload:_}),ho.success("Manual run triggered successfully")}},b=_=>O=>{const j=l().definition;if(typeof j=="object"&&Cc(j)){const D=[...j.connector.source.configuration];D[_]=O.source.configuration[0]||{};const k={connector:{...j.connector,source:{...j.connector.source,configuration:D}}};s("definition",k,{shouldDirty:!0,shouldTouch:!0}),m()}},w=_=>{const A=l().definition;if(typeof A=="object"&&Cc(A)){const j={connector:{...A.connector,source:{...A.connector.source,fields:_.source.fields}}};s("definition",j,{shouldDirty:!0,shouldTouch:!0}),m()}h(!1)},C=_=>{x({runType:_.runType,data:_.data})},E=_=>{const O=_.connector.source.fields.length;return o.jsxs(we,{type:"button",variant:"outline",onClick:()=>{h(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(e6,{className:"h-4 w-4"}),o.jsxs("span",{children:["Edit Fields (",String(O),")"]})]})},R=_=>{const A=l().definition;if(Cc(A)&&A.connector.source.configuration.length<=1){const j=LO(Qe.CONNECTOR);s("definition",j,{shouldDirty:!0,shouldTouch:!0}),m()}if(typeof A=="object"&&Cc(A)&&A.connector.source.configuration.length>1){const j={...A.connector.source,configuration:A.connector.source.configuration.filter((k,V)=>V!==_)},D={connector:{...A.connector,source:j}};s("definition",D,{shouldDirty:!0,shouldTouch:!0}),m()}},T=_=>{const A=l().definition;if(Cc(A)){const j={...A.connector.source,configuration:[...A.connector.source.configuration,_]},D={connector:{...A.connector,source:j}};s("definition",D,{shouldDirty:!0,shouldTouch:!0}),m()}};return o.jsxs(o.Fragment,{children:[o.jsx(qt,{control:e,name:"definition",render:({field:_})=>o.jsxs(Kt,{children:[o.jsx(Yt,{children:o.jsx("div",{className:"space-y-3",children:!md(_.value)||g===tr.DRAFT?o.jsx(lX,{storageType:t,onSetupConnector:v}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(dX,{storageType:t,onAddConfiguration:T,existingConnector:md(_.value)?{source:_.value.connector.source,storage:_.value.connector.storage}:void 0}),md(_.value)&&E(_.value)]}),o.jsx("div",{className:"flex items-center gap-2",children:n&&n.definitionType===Qe.CONNECTOR&&o.jsx(UD,{configuration:n.definition,onManualRun:C,children:o.jsxs(we,{variant:"outline",children:[o.jsx(qb,{className:"h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})})})]}),o.jsx("div",{className:"space-y-3",children:md(_.value)&&(n!=null&&n.storage)?_.value.connector.source.configuration.map((O,A)=>{const j=_.value;return o.jsx(Pc,{children:o.jsx(uX,{configIndex:A,connectorDef:j,dataStorage:n.storage,onRemoveConfiguration:R,onUpdateConfiguration:b,dataMartStatus:typeof g=="object"?g.code:g,totalConfigurations:j.connector.source.configuration.length},A)},A)}):null})]})})}),o.jsx(tn,{})]})}),o.jsx(Pc,{children:o.jsx(JO,{isOpen:d,onClose:()=>{h(!1)},onSubmit:w,dataStorageType:t,existingConnector:md(l().definition)?{source:l().definition.connector.source,storage:l().definition.connector.storage}:void 0,mode:"fields-only"})})]})}function hX({definitionType:e,storageType:t}){const{control:n}=nu();return o.jsxs("div",{className:"space-y-2",children:[e===Qe.SQL&&o.jsx(tQ,{control:n}),e===Qe.TABLE&&o.jsx(nQ,{control:n,storageType:t}),e===Qe.VIEW&&o.jsx(rQ,{control:n,storageType:t}),e===Qe.TABLE_PATTERN&&o.jsx(aQ,{control:n,storageType:t}),e===Qe.CONNECTOR&&o.jsx(fX,{control:n,storageType:t})]})}function mX(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]}`}function pX(e,t){const[n,r]=p.useState(e);return p.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const gX=300;function vX({sql:e,dataMartId:t,debounceDelay:n=gX,className:r="",onValidationStateChange:s}){const[l,c]=p.useState({isLoading:!1,isValid:null,error:null,bytes:null}),d=p.useRef(null),h=pX(e.trim(),n);p.useEffect(()=>{if(!h){const x={isLoading:!1,isValid:null,error:null,bytes:null};c(x),s==null||s(x);return}d.current&&d.current.abort(),d.current=new AbortController;const g=d.current;return(async()=>{const x={isLoading:!0,isValid:null,error:null,bytes:null};c(x),s==null||s(x);try{const b=await ir.validateSql(t,h,g);if(!g.signal.aborted){const w={isLoading:!1,isValid:b.isValid,error:b.error,bytes:b.bytes??null};c(w),s==null||s(w)}}catch(b){if(!g.signal.aborted){const w={isLoading:!1,isValid:!1,error:b instanceof Error?b.message:"Validation error",bytes:null};c(w),s==null||s(w)}}})(),()=>{g.abort()}},[h,t,s]);const m=()=>l.isLoading?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(Xd,{className:"h-4 w-4 animate-spin"}),o.jsx("span",{className:"text-sm",children:"Validating..."})]}):l.isValid===null?o.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[o.jsx(jm,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:"Type a query to get started"})]}):l.isValid?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(I_,{className:"h-4 w-4 text-green-600"}),o.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),l.bytes!==null&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(jm,{className:"h-3 w-3 text-gray-600"}),o.jsx("span",{className:"text-xs text-gray-600",children:mX(l.bytes)})]})}),o.jsx(Mt,{children:o.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):o.jsxs("div",{className:"flex h-9 items-center gap-2",children:[o.jsx(yp,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),l.error&&o.jsx("span",{className:"text-xs text-red-500",children:l.error})]});return o.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:m()})}function yX(){const{dataMart:e,updateDataMartDefinition:t}=Ts();if(!e)throw new Error("Data mart not found");const{definitionType:n,definition:r,id:s,storage:{type:l}}=e,[c,d]=p.useState(n),[h,m]=p.useState({isValid:null,isLoading:!1,error:null}),g=p.useCallback(()=>{if(!c)return;const z={definitionType:c,definition:LO(c)};return r?{definitionType:c,definition:r}:z},[c,r]),v=p.useCallback(()=>{if(!c)return;const z=eQ(c,l);return Rl(z)},[c,l]),x=Ei({resolver:v(),defaultValues:g(),mode:"onChange"}),{handleSubmit:b,reset:w,watch:C,formState:{isDirty:E,isValid:R}}=x,T=(z,J)=>{if(z!==Qe.SQL)return"";const oe=J;return(oe==null?void 0:oe.sqlQuery)??""},_=C("definition"),O=T(c,_);p.useEffect(()=>{c&&w(g())},[c,w,g]);const A=p.useCallback(z=>{m({isLoading:z.isLoading,isValid:z.isValid,error:z.error})},[]),j=z=>{d(z)},D=async z=>{if(c&&s)try{await t(s,z.definitionType,z.definition),w(z)}catch(J){console.error("Failed to update data mart definition:",J)}},k=z=>{if(z.preventDefault(),c===Qe.SQL&&h.isValid===!1){console.error("Cannot submit form with invalid SQL:",h.error);return}b(D)(z)},V=()=>{w(g())},B=()=>c?o.jsxs("form",{onSubmit:k,className:"space-y-4",children:[o.jsx(hX,{definitionType:c,storageType:l}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(we,{variant:"default",type:"submit",disabled:!R||!E||c===Qe.SQL&&(h.isValid===!1||h.isLoading),children:"Save"}),o.jsx(we,{type:"button",variant:"ghost",onClick:V,disabled:!E,children:"Discard"}),c===Qe.SQL&&O&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-6 w-px bg-gray-300"}),o.jsx(vX,{sql:O,dataMartId:s,onValidationStateChange:A})]})]})]}):null;return o.jsx(BA,{...x,children:o.jsxs("div",{className:"space-y-4",children:[!n&&o.jsx(ZW,{initialType:c,onTypeSelect:j}),B()]})})}function xX(e){switch(e){case Ie.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case Ie.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function e4(e){return e.type==="bigquery-data-mart-schema"}function t4(e){return e.type==="athena-data-mart-schema"}function kT(e){return e!==null&&typeof e=="object"&&"mode"in e}function IT(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function bX(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function Sx(e){return e==null?e:JSON.parse(JSON.stringify(e))}function SX(e){const t=Sx(e),[n,r]=p.useState(t),[s,l]=p.useState(!1);p.useEffect(()=>{const h=Sx(e);r(h),l(!1)},[e]);const c=p.useCallback(h=>{n?e4(n)&&h.every(kT)?(r({...n,fields:h}),l(!0)):t4(n)&&h.every(IT)&&(r({...n,fields:h}),l(!0)):h.length>0&&(kT(h[0])?(r({type:"bigquery-data-mart-schema",fields:h}),l(!0)):IT(h[0])&&(r({type:"athena-data-mart-schema",fields:h}),l(!0)))},[n]),d=p.useCallback(()=>{const h=Sx(e);r(h),l(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:d,setIsDirty:l}}function CX(e,t){const n=p.useRef(!1),r=p.useRef(!1),[s,l]=p.useState("idle");return p.useEffect(()=>{e||(n.current||r.current)&&(l(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:s,startSaveOperation:()=>{n.current=!0,l("idle")},startActualizeOperation:()=>{r.current=!0,l("idle")},resetOperationStatus:()=>{l("idle")}}}function wX(e){const t=p.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]=p.useState({});return p.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function n4(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 l=e;return l.fields&&l.fields.length>0?l.fields.some(c=>n4(c,t)):!1}function r4(e,t,n=""){const r=[];return e.forEach((s,l)=>{const c=n?`${n}.${String(l)}`:String(l),d=s.name?s.name.toLowerCase().includes(t):!1,h=s.alias?s.alias.toLowerCase().includes(t):!1,m=s.description?s.description.toLowerCase().includes(t):!1;if((d||h||m)&&r.push(c),s.fields&&s.fields.length>0){const g=r4(s.fields,t,c);g.length>0&&(r.includes(c)||r.push(c),r.push(...g))}}),r}function EX(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return n4(r,s)}function RX(e){const[t,n]=p.useState(""),r=p.useCallback(l=>{n(l),e.setGlobalFilter(l)},[e]),s=t.toLowerCase();return{value:t,onChange:r,searchValue:s}}var qa=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(qa||{}),$d=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))($d||{}),En=(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))(En||{}),wS=(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))(wS||{});function TX(e){const[t,n]=p.useState(new Set),[r,s]=p.useState(null),l=p.useRef(""),c=p.useMemo(()=>{const w=C=>C.some(E=>E.type===En.RECORD||E.type===En.STRUCT||E.fields&&w(E.fields));return w(e)},[e]),d=p.useCallback(w=>{n(C=>{const E=new Set(C);return E.has(w)?E.delete(w):E.add(w),E})},[]),h=p.useCallback(()=>{const w=[],C=(E,R="")=>{E.forEach((T,_)=>{const O=R?`${R}.${String(_)}`:String(_);(T.type===En.RECORD||T.type===En.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(O),C(T.fields,O))})};C(e),n(E=>w.every(T=>E.has(T))?new Set:new Set(w))},[e]),m=p.useMemo(()=>{const w=[],C=(E,R="",T=0)=>{E.forEach((_,O)=>{const A=R?`${R}.${String(O)}`:String(O),j=_.type===En.RECORD||_.type===En.STRUCT;w.push({..._,path:A,level:T}),j&&_.fields&&t.has(A)&&C(_.fields,A,T+1)})};return C(e),w},[e,t]),g=p.useCallback(w=>{if(w!==l.current)if(l.current=w,w){r===null&&s(new Set(t));const E=r4(e,w).filter(R=>{const T=R.split(".").map(Number);let _=e,O;for(let A=0;A<T.length;A++){if(O=_[T[A]],!O)return!1;if((O.type===En.RECORD||O.type===En.STRUCT)&&O.fields&&O.fields.length>0)return!0;A<T.length-1&&(_=O.fields??[])}return!1});n(R=>{const T=new Set(R);return E.forEach(_=>{T.add(_)}),T})}else r!==null&&(n(r),s(null))},[e,t,r]),v=p.useCallback(w=>{const C=m[w];return C.type===En.RECORD||C.type===En.STRUCT},[m]),x=p.useMemo(()=>e.map(w=>({...w,fields:void 0})),[e]),b=p.useMemo(()=>{const w=[],C=(E,R="")=>{E.forEach((T,_)=>{const O=R?`${R}.${String(_)}`:String(_);(T.type===En.RECORD||T.type===En.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(O),C(T.fields,O))})};return C(e),w.length===0?!1:w.every(E=>t.has(E))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:d,toggleAllRecords:h,flattenedFields:m,handleSearchChange:g,isRecordType:v,topLevelFields:x,allExpanded:b}}function _X(e,t,n,r){const s=p.useCallback((h,m)=>{if(n){const g=[...e],v=t[h].path;if(!v)g[h]={...g[h],...m};else{const x=v.split(".").map(Number);let b=g,w;for(let E=0;E<x.length-1;E++)w=b[x[E]],b=w.fields??[];const C=x[x.length-1];b[C]&&(b[C]={...b[C],...m})}n(g)}},[e,t,n]),l=p.useCallback(()=>{if(n){const h={name:"",type:En.STRING,mode:$d.NULLABLE,isPrimaryKey:!1,status:qa.DISCONNECTED};n([...e,h])}},[e,n]),c=p.useCallback(h=>{if(n){const m=[...e],g=t[h].path;if(!g)m.splice(h,1);else{const v=g.split(".").map(Number);let x=m,b;for(let C=0;C<v.length-1;C++)b=x[v[C]],x=b.fields??[];const w=v[v.length-1];x.splice(w,1)}n(m)}},[e,t,n]),d=p.useCallback(h=>{var m,g;if(n&&r){const v=[...e],x=t[h].path,b={name:"",type:En.STRING,mode:$d.NULLABLE,isPrimaryKey:!1,status:qa.DISCONNECTED};if(!x)(m=v[h]).fields??(m.fields=[]),v[h].fields.push(b);else{const w=x.split(".").map(Number);let C=v;for(let E=0;E<w.length;E++){const R=w[E];E===w.length-1?((g=C[R]).fields??(g.fields=[]),C[R].fields.push(b)):C=C[R].fields??[]}}n(v)}},[e,t,n,r]);return{updateField:s,handleAddRow:l,handleDeleteRow:c,handleAddNestedField:d}}function a4(e,t,n){return{handleDragEnd:p.useCallback(s=>{const{active:l,over:c}=s;if(!c||l.id===c.id||!t)return;if(!n){const x=Number(l.id),b=Number(c.id),w=[...e],[C]=w.splice(x,1);w.splice(b,0,C),t(w);return}const d=n.findIndex((x,b)=>(x.path??String(b))===l.id),h=n.findIndex((x,b)=>(x.path??String(b))===c.id);if(d===-1||h===-1)return;const m=n[d].path,g=n[h].path,v=[...e];if(!m&&!g){const[x]=v.splice(d,1);v.splice(h,0,x),t(v);return}if(m&&g){const x=m.split(".").map(Number),b=g.split(".").map(Number);if(x.length===b.length&&x.slice(0,-1).join(".")===b.slice(0,-1).join(".")){let w=v;for(let T=0;T<x.length-1;T++)w=w[x[T]].fields??[];const C=x[x.length-1],E=b[b.length-1],[R]=w.splice(C,1);w.splice(E,0,R),t(v)}}},[e,n,t])}}function jX(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const vg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function su(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ES(e){return"nodeType"in e}function Hr(e){var t,n;return e?su(e)?e:ES(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function RS(e){const{Document:t}=Hr(e);return e instanceof t}function Tf(e){return su(e)?!1:e instanceof Hr(e).HTMLElement}function s4(e){return e instanceof Hr(e).SVGElement}function ou(e){return e?su(e)?e.document:ES(e)?RS(e)?e:Tf(e)||s4(e)?e.ownerDocument:document:document:document}const Rs=vg?p.useLayoutEffect:p.useEffect;function TS(e){const t=p.useRef(e);return Rs(()=>{t.current=e}),p.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 NX(){const e=p.useRef(null),t=p.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Bd(e,t){t===void 0&&(t=[e]);const n=p.useRef(e);return Rs(()=>{n.current!==e&&(n.current=e)},t),n}function _f(e,t){const n=p.useRef();return p.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function lp(e){const t=TS(e),n=p.useRef(null),r=p.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Ab(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let Cx={};function jf(e,t){return p.useMemo(()=>{if(t)return t;const n=Cx[e]==null?0:Cx[e]+1;return Cx[e]=n,e+"-"+n},[e,t])}function o4(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((l,c)=>{const d=Object.entries(c);for(const[h,m]of d){const g=l[h];g!=null&&(l[h]=g+e*m)}return l},{...t})}}const Ac=o4(1),cp=o4(-1);function AX(e){return"clientX"in e&&"clientY"in e}function _S(e){if(!e)return!1;const{KeyboardEvent:t}=Hr(e.target);return t&&e instanceof t}function DX(e){if(!e)return!1;const{TouchEvent:t}=Hr(e.target);return t&&e instanceof t}function Db(e){if(DX(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 AX(e)?{x:e.clientX,y:e.clientY}:null}const Gd=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[Gd.Translate.toString(e),Gd.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),LT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function OX(e){return e.matches(LT)?e:e.querySelector(LT)}const MX={display:"none"};function kX(e){let{id:t,value:n}=e;return je.createElement("div",{id:t,style:MX},n)}function IX(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 je.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function LX(){const[e,t]=p.useState("");return{announce:p.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const i4=p.createContext(null);function PX(e){const t=p.useContext(i4);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function UX(){const[e]=p.useState(()=>new Set),t=p.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[p.useCallback(r=>{let{type:s,event:l}=r;e.forEach(c=>{var d;return(d=c[s])==null?void 0:d.call(c,l)})},[e]),t]}const FX={draggable:`
677
+ To pick up a draggable item, press the space bar.
678
+ While dragging, use the arrow keys to move the item.
679
+ Press space again to drop the item in its new position, or press escape to cancel.
680
+ `},HX={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 VX(e){let{announcements:t=HX,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=FX}=e;const{announce:l,announcement:c}=LX(),d=jf("DndLiveRegion"),[h,m]=p.useState(!1);if(p.useEffect(()=>{m(!0)},[]),PX(p.useMemo(()=>({onDragStart(v){let{active:x}=v;l(t.onDragStart({active:x}))},onDragMove(v){let{active:x,over:b}=v;t.onDragMove&&l(t.onDragMove({active:x,over:b}))},onDragOver(v){let{active:x,over:b}=v;l(t.onDragOver({active:x,over:b}))},onDragEnd(v){let{active:x,over:b}=v;l(t.onDragEnd({active:x,over:b}))},onDragCancel(v){let{active:x,over:b}=v;l(t.onDragCancel({active:x,over:b}))}}),[l,t])),!h)return null;const g=je.createElement(je.Fragment,null,je.createElement(kX,{id:r,value:s.draggable}),je.createElement(IX,{id:d,announcement:c}));return n?Ba.createPortal(g,n):g}var qn;(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"})(qn||(qn={}));function up(){}function l4(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function c4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ya=Object.freeze({x:0,y:0});function zX(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $X(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function BX(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function GX(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function PT(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 u4=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=PT(t,t.left,t.top),l=[];for(const c of r){const{id:d}=c,h=n.get(d);if(h){const m=zX(PT(h),s);l.push({id:d,data:{droppableContainer:c,value:m}})}}return l.sort($X)};function qX(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),l=Math.min(t.top+t.height,e.top+e.height),c=s-r,d=l-n;if(r<s&&n<l){const h=t.width*t.height,m=e.width*e.height,g=c*d,v=g/(h+m-g);return Number(v.toFixed(4))}return 0}const KX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const l of r){const{id:c}=l,d=n.get(c);if(d){const h=qX(d,t);h>0&&s.push({id:c,data:{droppableContainer:l,value:h}})}}return s.sort(BX)};function ZX(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function d4(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ya}function YX(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return s.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const WX=YX(1);function QX(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 XX(e,t,n){const r=QX(t);if(!r)return e;const{scaleX:s,scaleY:l,x:c,y:d}=r,h=e.left-c-(1-s)*parseFloat(n),m=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),g=s?e.width/s:e.width,v=l?e.height/l:e.height;return{width:g,height:v,top:m,right:h+g,bottom:m+v,left:h}}const JX={ignoreTransform:!1};function iu(e,t){t===void 0&&(t=JX);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:g}=Hr(e).getComputedStyle(e);m&&(n=XX(n,m,g))}const{top:r,left:s,width:l,height:c,bottom:d,right:h}=n;return{top:r,left:s,width:l,height:c,bottom:d,right:h}}function UT(e){return iu(e,{ignoreTransform:!0})}function eJ(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function tJ(e,t){return t===void 0&&(t=Hr(e).getComputedStyle(e)),t.position==="fixed"}function nJ(e,t){t===void 0&&(t=Hr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const l=t[s];return typeof l=="string"?n.test(l):!1})}function jS(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(RS(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Tf(s)||s4(s)||n.includes(s))return n;const l=Hr(e).getComputedStyle(s);return s!==e&&nJ(s,l)&&n.push(s),tJ(s,l)?n:r(s.parentNode)}return e?r(e):n}function f4(e){const[t]=jS(e,1);return t??null}function wx(e){return!vg||!e?null:su(e)?e:ES(e)?RS(e)||e===ou(e).scrollingElement?window:Tf(e)?e:null:null}function h4(e){return su(e)?e.scrollX:e.scrollLeft}function m4(e){return su(e)?e.scrollY:e.scrollTop}function Ob(e){return{x:h4(e),y:m4(e)}}var er;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(er||(er={}));function p4(e){return!vg||!e?!1:e===document.scrollingElement}function g4(e){const t={x:0,y:0},n=p4(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,l=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,d=e.scrollLeft>=r.x;return{isTop:s,isLeft:l,isBottom:c,isRight:d,maxScroll:r,minScroll:t}}const rJ={x:.2,y:.2};function aJ(e,t,n,r,s){let{top:l,left:c,right:d,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=rJ);const{isTop:m,isBottom:g,isLeft:v,isRight:x}=g4(e),b={x:0,y:0},w={x:0,y:0},C={height:t.height*s.y,width:t.width*s.x};return!m&&l<=t.top+C.height?(b.y=er.Backward,w.y=r*Math.abs((t.top+C.height-l)/C.height)):!g&&h>=t.bottom-C.height&&(b.y=er.Forward,w.y=r*Math.abs((t.bottom-C.height-h)/C.height)),!x&&d>=t.right-C.width?(b.x=er.Forward,w.x=r*Math.abs((t.right-C.width-d)/C.width)):!v&&c<=t.left+C.width&&(b.x=er.Backward,w.x=r*Math.abs((t.left+C.width-c)/C.width)),{direction:b,speed:w}}function sJ(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,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 v4(e){return e.reduce((t,n)=>Ac(t,Ob(n)),Ya)}function oJ(e){return e.reduce((t,n)=>t+h4(n),0)}function iJ(e){return e.reduce((t,n)=>t+m4(n),0)}function lJ(e,t){if(t===void 0&&(t=iu),!e)return;const{top:n,left:r,bottom:s,right:l}=t(e);f4(e)&&(s<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const cJ=[["x",["left","right"],oJ],["y",["top","bottom"],iJ]];class NS{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=jS(n),s=v4(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of cJ)for(const h of c)Object.defineProperty(this,h,{get:()=>{const m=d(r),g=s[l]-m;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ed{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 uJ(e){const{EventTarget:t}=Hr(e);return e instanceof t?e:ou(e)}function Ex(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 Ta;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ta||(Ta={}));function FT(e){e.preventDefault()}function dJ(e){e.stopPropagation()}var Ut;(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"})(Ut||(Ut={}));const y4={start:[Ut.Space,Ut.Enter],cancel:[Ut.Esc],end:[Ut.Space,Ut.Enter,Ut.Tab]},fJ=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ut.Right:return{...n,x:n.x+25};case Ut.Left:return{...n,x:n.x-25};case Ut.Down:return{...n,y:n.y+25};case Ut.Up:return{...n,y:n.y-25}}};class x4{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 Ed(ou(n)),this.windowListeners=new Ed(Hr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ta.Resize,this.handleCancel),this.windowListeners.add(Ta.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ta.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&lJ(r),n(Ya)}handleKeyDown(t){if(_S(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:l=y4,coordinateGetter:c=fJ,scrollBehavior:d="smooth"}=s,{code:h}=t;if(l.end.includes(h)){this.handleEnd(t);return}if(l.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:m}=r.current,g=m?{x:m.left,y:m.top}:Ya;this.referenceCoordinates||(this.referenceCoordinates=g);const v=c(t,{active:n,context:r.current,currentCoordinates:g});if(v){const x=cp(v,g),b={x:0,y:0},{scrollableAncestors:w}=r.current;for(const C of w){const E=t.code,{isTop:R,isRight:T,isLeft:_,isBottom:O,maxScroll:A,minScroll:j}=g4(C),D=sJ(C),k={x:Math.min(E===Ut.Right?D.right-D.width/2:D.right,Math.max(E===Ut.Right?D.left:D.left+D.width/2,v.x)),y:Math.min(E===Ut.Down?D.bottom-D.height/2:D.bottom,Math.max(E===Ut.Down?D.top:D.top+D.height/2,v.y))},V=E===Ut.Right&&!T||E===Ut.Left&&!_,B=E===Ut.Down&&!O||E===Ut.Up&&!R;if(V&&k.x!==v.x){const z=C.scrollLeft+x.x,J=E===Ut.Right&&z<=A.x||E===Ut.Left&&z>=j.x;if(J&&!x.y){C.scrollTo({left:z,behavior:d});return}J?b.x=C.scrollLeft-z:b.x=E===Ut.Right?C.scrollLeft-A.x:C.scrollLeft-j.x,b.x&&C.scrollBy({left:-b.x,behavior:d});break}else if(B&&k.y!==v.y){const z=C.scrollTop+x.y,J=E===Ut.Down&&z<=A.y||E===Ut.Up&&z>=j.y;if(J&&!x.x){C.scrollTo({top:z,behavior:d});return}J?b.y=C.scrollTop-z:b.y=E===Ut.Down?C.scrollTop-A.y:C.scrollTop-j.y,b.y&&C.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(t,Ac(cp(v,this.referenceCoordinates),b))}}}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()}}x4.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=y4,onActivation:s}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function HT(e){return!!(e&&"distance"in e)}function VT(e){return!!(e&&"delay"in e)}class AS{constructor(t,n,r){var s;r===void 0&&(r=uJ(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:l}=t,{target:c}=l;this.props=t,this.events=n,this.document=ou(c),this.documentListeners=new Ed(this.document),this.listeners=new Ed(r),this.windowListeners=new Ed(Hr(c)),this.initialCoordinates=(s=Db(l))!=null?s:Ya,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(Ta.Resize,this.handleCancel),this.windowListeners.add(Ta.DragStart,FT),this.windowListeners.add(Ta.VisibilityChange,this.handleCancel),this.windowListeners.add(Ta.ContextMenu,FT),this.documentListeners.add(Ta.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(VT(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(HT(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(Ta.Click,dJ,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ta.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!s)return;const h=(n=Db(t))!=null?n:Ya,m=cp(s,h);if(!r&&d){if(HT(d)){if(d.tolerance!=null&&Ex(m,d.tolerance))return this.handleCancel();if(Ex(m,d.distance))return this.handleStart()}if(VT(d)&&Ex(m,d.tolerance))return this.handleCancel();this.handlePending(d,m);return}t.cancelable&&t.preventDefault(),c(h)}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===Ut.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const hJ={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class yg extends AS{constructor(t){const{event:n}=t,r=ou(n.target);super(t,hJ,r)}}yg.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 mJ={move:{name:"mousemove"},end:{name:"mouseup"}};var Mb;(function(e){e[e.RightClick=2]="RightClick"})(Mb||(Mb={}));class pJ extends AS{constructor(t){super(t,mJ,ou(t.event.target))}}pJ.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Mb.RightClick?!1:(r==null||r({event:n}),!0)}}];const Rx={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class gJ extends AS{constructor(t){super(t,Rx)}static setup(){return window.addEventListener(Rx.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Rx.move.name,t)};function t(){}}}gJ.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 Rd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Rd||(Rd={}));var dp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(dp||(dp={}));function vJ(e){let{acceleration:t,activator:n=Rd.Pointer,canScroll:r,draggingRect:s,enabled:l,interval:c=5,order:d=dp.TreeOrder,pointerCoordinates:h,scrollableAncestors:m,scrollableAncestorRects:g,delta:v,threshold:x}=e;const b=xJ({delta:v,disabled:!l}),[w,C]=NX(),E=p.useRef({x:0,y:0}),R=p.useRef({x:0,y:0}),T=p.useMemo(()=>{switch(n){case Rd.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case Rd.DraggableRect:return s}},[n,s,h]),_=p.useRef(null),O=p.useCallback(()=>{const j=_.current;if(!j)return;const D=E.current.x*R.current.x,k=E.current.y*R.current.y;j.scrollBy(D,k)},[]),A=p.useMemo(()=>d===dp.TreeOrder?[...m].reverse():m,[d,m]);p.useEffect(()=>{if(!l||!m.length||!T){C();return}for(const j of A){if((r==null?void 0:r(j))===!1)continue;const D=m.indexOf(j),k=g[D];if(!k)continue;const{direction:V,speed:B}=aJ(j,k,T,t,x);for(const z of["x","y"])b[z][V[z]]||(B[z]=0,V[z]=0);if(B.x>0||B.y>0){C(),_.current=j,w(O,c),E.current=B,R.current=V;return}}E.current={x:0,y:0},R.current={x:0,y:0},C()},[t,O,r,C,l,c,JSON.stringify(T),JSON.stringify(b),w,m,A,g,JSON.stringify(x)])}const yJ={x:{[er.Backward]:!1,[er.Forward]:!1},y:{[er.Backward]:!1,[er.Forward]:!1}};function xJ(e){let{delta:t,disabled:n}=e;const r=Ab(t);return _f(s=>{if(n||!r||!s)return yJ;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[er.Backward]:s.x[er.Backward]||l.x===-1,[er.Forward]:s.x[er.Forward]||l.x===1},y:{[er.Backward]:s.y[er.Backward]||l.y===-1,[er.Forward]:s.y[er.Forward]||l.y===1}}},[n,t,r])}function bJ(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return _f(s=>{var l;return t==null?null:(l=r??s)!=null?l:null},[r,t])}function SJ(e,t){return p.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,l=s.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...l]},[]),[e,t])}var qd;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(qd||(qd={}));var kb;(function(e){e.Optimized="optimized"})(kb||(kb={}));const zT=new Map;function CJ(e,t){let{dragging:n,dependencies:r,config:s}=t;const[l,c]=p.useState(null),{frequency:d,measure:h,strategy:m}=s,g=p.useRef(e),v=E(),x=Bd(v),b=p.useCallback(function(R){R===void 0&&(R=[]),!x.current&&c(T=>T===null?R:T.concat(R.filter(_=>!T.includes(_))))},[x]),w=p.useRef(null),C=_f(R=>{if(v&&!n)return zT;if(!R||R===zT||g.current!==e||l!=null){const T=new Map;for(let _ of e){if(!_)continue;if(l&&l.length>0&&!l.includes(_.id)&&_.rect.current){T.set(_.id,_.rect.current);continue}const O=_.node.current,A=O?new NS(h(O),O):null;_.rect.current=A,A&&T.set(_.id,A)}return T}return R},[e,l,n,v,h]);return p.useEffect(()=>{g.current=e},[e]),p.useEffect(()=>{v||b()},[n,v]),p.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),p.useEffect(()=>{v||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{b(),w.current=null},d))},[d,v,b,...r]),{droppableRects:C,measureDroppableContainers:b,measuringScheduled:l!=null};function E(){switch(m){case qd.Always:return!1;case qd.BeforeDragging:return n;default:return!n}}}function b4(e,t){return _f(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function wJ(e,t){return b4(e,t)}function EJ(e){let{callback:t,disabled:n}=e;const r=TS(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function xg(e){let{callback:t,disabled:n}=e;const r=TS(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function RJ(e){return new NS(iu(e),e)}function $T(e,t,n){t===void 0&&(t=RJ);const[r,s]=p.useState(null);function l(){s(h=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=h??n)!=null?m:null}const g=t(e);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const c=EJ({callback(h){if(e)for(const m of h){const{type:g,target:v}=m;if(g==="childList"&&v instanceof HTMLElement&&v.contains(e)){l();break}}}}),d=xg({callback:l});return Rs(()=>{l(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),r}function TJ(e){const t=b4(e);return d4(e,t)}const BT=[];function _J(e){const t=p.useRef(e),n=_f(r=>e?r&&r!==BT&&e&&t.current&&e.parentNode===t.current.parentNode?r:jS(e):BT,[e]);return p.useEffect(()=>{t.current=e},[e]),n}function jJ(e){const[t,n]=p.useState(null),r=p.useRef(e),s=p.useCallback(l=>{const c=wx(l.target);c&&n(d=>d?(d.set(c,Ob(c)),new Map(d)):null)},[]);return p.useEffect(()=>{const l=r.current;if(e!==l){c(l);const d=e.map(h=>{const m=wx(h);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,Ob(m)]):null}).filter(h=>h!=null);n(d.length?new Map(d):null),r.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(h=>{const m=wx(h);m==null||m.removeEventListener("scroll",s)})}},[s,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>Ac(l,c),Ya):v4(e):Ya,[e,t])}function GT(e,t){t===void 0&&(t=[]);const n=p.useRef(null);return p.useEffect(()=>{n.current=null},t),p.useEffect(()=>{const r=e!==Ya;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?cp(e,n.current):Ya}function NJ(e){p.useEffect(()=>{if(!vg)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 AJ(e,t){return p.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:l}=r;return n[s]=c=>{l(c,t)},n},{}),[e,t])}function S4(e){return p.useMemo(()=>e?eJ(e):null,[e])}const qT=[];function DJ(e,t){t===void 0&&(t=iu);const[n]=e,r=S4(n?Hr(n):null),[s,l]=p.useState(qT);function c(){l(()=>e.length?e.map(h=>p4(h)?r:new NS(t(h),h)):qT)}const d=xg({callback:c});return Rs(()=>{d==null||d.disconnect(),c(),e.forEach(h=>d==null?void 0:d.observe(h))},[e]),s}function OJ(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Tf(t)?t:e}function MJ(e){let{measure:t}=e;const[n,r]=p.useState(null),s=p.useCallback(m=>{for(const{target:g}of m)if(Tf(g)){r(v=>{const x=t(g);return v?{...v,width:x.width,height:x.height}:x});break}},[t]),l=xg({callback:s}),c=p.useCallback(m=>{const g=OJ(m);l==null||l.disconnect(),g&&(l==null||l.observe(g)),r(g?t(g):null)},[t,l]),[d,h]=lp(c);return p.useMemo(()=>({nodeRef:d,rect:n,setRef:h}),[n,d,h])}const kJ=[{sensor:yg,options:{}},{sensor:x4,options:{}}],IJ={current:{}},Cm={draggable:{measure:UT},droppable:{measure:UT,strategy:qd.WhileDragging,frequency:kb.Optimized},dragOverlay:{measure:iu}};class Td 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 LJ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Td,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:up},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Cm,measureDroppableContainers:up,windowRect:null,measuringScheduled:!1},PJ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:up,draggableNodes:new Map,over:null,measureDroppableContainers:up},bg=p.createContext(PJ),C4=p.createContext(LJ);function UJ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Td}}}function FJ(e,t){switch(t.type){case qn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case qn.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 qn.DragEnd:case qn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case qn.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Td(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case qn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const c=new Td(e.droppable.containers);return c.set(n,{...l,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case qn.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new Td(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function HJ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=p.useContext(bg),l=Ab(r),c=Ab(n==null?void 0:n.id);return p.useEffect(()=>{if(!t&&!r&&l&&c!=null){if(!_S(l)||document.activeElement===l.target)return;const d=s.get(c);if(!d)return;const{activatorNode:h,node:m}=d;if(!h.current&&!m.current)return;requestAnimationFrame(()=>{for(const g of[h.current,m.current]){if(!g)continue;const v=OX(g);if(v){v.focus();break}}})}},[r,t,s,c,l]),null}function VJ(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,l)=>l({transform:s,...r}),n):n}function zJ(e){return p.useMemo(()=>({draggable:{...Cm.draggable,...e==null?void 0:e.draggable},droppable:{...Cm.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Cm.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 $J(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const l=p.useRef(!1),{x:c,y:d}=typeof s=="boolean"?{x:s,y:s}:s;Rs(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!r)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const g=n(m),v=d4(g,r);if(c||(v.x=0),d||(v.y=0),l.current=!0,Math.abs(v.x)>0||Math.abs(v.y)>0){const x=f4(m);x&&x.scrollBy({top:v.y,left:v.x})}},[t,c,d,r,n])}const w4=p.createContext({...Ya,scaleX:1,scaleY:1});var qo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(qo||(qo={}));const E4=p.memo(function(t){var n,r,s,l;let{id:c,accessibility:d,autoScroll:h=!0,children:m,sensors:g=kJ,collisionDetection:v=KX,measuring:x,modifiers:b,...w}=t;const C=p.useReducer(FJ,void 0,UJ),[E,R]=C,[T,_]=UX(),[O,A]=p.useState(qo.Uninitialized),j=O===qo.Initialized,{draggable:{active:D,nodes:k,translate:V},droppable:{containers:B}}=E,z=D!=null?k.get(D):null,J=p.useRef({initial:null,translated:null}),oe=p.useMemo(()=>{var on;return D!=null?{id:D,data:(on=z==null?void 0:z.data)!=null?on:IJ,rect:J}:null},[D,z]),K=p.useRef(null),[Y,I]=p.useState(null),[W,G]=p.useState(null),ie=Bd(w,Object.values(w)),L=jf("DndDescribedBy",c),Z=p.useMemo(()=>B.getEnabled(),[B]),U=zJ(x),{droppableRects:q,measureDroppableContainers:le,measuringScheduled:me}=CJ(Z,{dragging:j,dependencies:[V.x,V.y],config:U.droppable}),ve=bJ(k,D),fe=p.useMemo(()=>W?Db(W):null,[W]),Ee=go(),De=wJ(ve,U.draggable.measure);$J({activeNode:D!=null?k.get(D):null,config:Ee.layoutShiftCompensation,initialRect:De,measure:U.draggable.measure});const be=$T(ve,U.draggable.measure,De),Je=$T(ve?ve.parentElement:null),Xe=p.useRef({activatorEvent:null,active:null,activeNode:ve,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ht=B.getNodeFor((n=Xe.current.over)==null?void 0:n.id),Ne=MJ({measure:U.dragOverlay.measure}),vt=(r=Ne.nodeRef.current)!=null?r:ve,ut=j?(s=Ne.rect)!=null?s:be:null,Tt=!!(Ne.nodeRef.current&&Ne.rect),Ia=TJ(Tt?null:be),ur=S4(vt?Hr(vt):null),H=_J(j?Ht??ve:null),te=DJ(H),ue=VJ(b,{transform:{x:V.x-Ia.x,y:V.y-Ia.y,scaleX:1,scaleY:1},activatorEvent:W,active:oe,activeNodeRect:be,containerNodeRect:Je,draggingNodeRect:ut,over:Xe.current.over,overlayNodeRect:Ne.rect,scrollableAncestors:H,scrollableAncestorRects:te,windowRect:ur}),_e=fe?Ac(fe,V):null,Re=jJ(H),Ce=GT(Re),ke=GT(Re,[be]),Be=Ac(ue,Ce),ct=ut?WX(ut,ue):null,Et=oe&&ct?v({active:oe,collisionRect:ct,droppableRects:q,droppableContainers:Z,pointerCoordinates:_e}):null,La=GX(Et,"id"),[Wt,As]=p.useState(null),Vr=Tt?ue:Ac(ue,ke),zr=ZX(Vr,(l=Wt==null?void 0:Wt.rect)!=null?l:null,be),Sr=p.useRef(null),$r=p.useCallback((on,Yn)=>{let{sensor:Sn,options:dr}=Yn;if(K.current==null)return;const Wn=k.get(K.current);if(!Wn)return;const Fn=on.nativeEvent,F=new Sn({active:K.current,activeNode:Wn,event:Fn,options:dr,context:Xe,onAbort(ne){if(!k.get(ne))return;const{onDragAbort:xe}=ie.current,Oe={id:ne};xe==null||xe(Oe),T({type:"onDragAbort",event:Oe})},onPending(ne,pe,xe,Oe){if(!k.get(ne))return;const{onDragPending:Le}=ie.current,Fe={id:ne,constraint:pe,initialCoordinates:xe,offset:Oe};Le==null||Le(Fe),T({type:"onDragPending",event:Fe})},onStart(ne){const pe=K.current;if(pe==null)return;const xe=k.get(pe);if(!xe)return;const{onDragStart:Oe}=ie.current,Ue={activatorEvent:Fn,active:{id:pe,data:xe.data,rect:J}};Ba.unstable_batchedUpdates(()=>{Oe==null||Oe(Ue),A(qo.Initializing),R({type:qn.DragStart,initialCoordinates:ne,active:pe}),T({type:"onDragStart",event:Ue}),I(Sr.current),G(Fn)})},onMove(ne){R({type:qn.DragMove,coordinates:ne})},onEnd:X(qn.DragEnd),onCancel:X(qn.DragCancel)});Sr.current=F;function X(ne){return async function(){const{active:xe,collisions:Oe,over:Ue,scrollAdjustedTranslate:Le}=Xe.current;let Fe=null;if(xe&&Le){const{cancelDrop:Ye}=ie.current;Fe={activatorEvent:Fn,active:xe,collisions:Oe,delta:Le,over:Ue},ne===qn.DragEnd&&typeof Ye=="function"&&await Promise.resolve(Ye(Fe))&&(ne=qn.DragCancel)}K.current=null,Ba.unstable_batchedUpdates(()=>{R({type:ne}),A(qo.Uninitialized),As(null),I(null),G(null),Sr.current=null;const Ye=ne===qn.DragEnd?"onDragEnd":"onDragCancel";if(Fe){const qe=ie.current[Ye];qe==null||qe(Fe),T({type:Ye,event:Fe})}})}}},[k]),Ar=p.useCallback((on,Yn)=>(Sn,dr)=>{const Wn=Sn.nativeEvent,Fn=k.get(dr);if(K.current!==null||!Fn||Wn.dndKit||Wn.defaultPrevented)return;const F={active:Fn};on(Sn,Yn.options,F)===!0&&(Wn.dndKit={capturedBy:Yn.sensor},K.current=dr,$r(Sn,Yn))},[k,$r]),es=SJ(g,Ar);NJ(g),Rs(()=>{be&&O===qo.Initializing&&A(qo.Initialized)},[be,O]),p.useEffect(()=>{const{onDragMove:on}=ie.current,{active:Yn,activatorEvent:Sn,collisions:dr,over:Wn}=Xe.current;if(!Yn||!Sn)return;const Fn={active:Yn,activatorEvent:Sn,collisions:dr,delta:{x:Be.x,y:Be.y},over:Wn};Ba.unstable_batchedUpdates(()=>{on==null||on(Fn),T({type:"onDragMove",event:Fn})})},[Be.x,Be.y]),p.useEffect(()=>{const{active:on,activatorEvent:Yn,collisions:Sn,droppableContainers:dr,scrollAdjustedTranslate:Wn}=Xe.current;if(!on||K.current==null||!Yn||!Wn)return;const{onDragOver:Fn}=ie.current,F=dr.get(La),X=F&&F.rect.current?{id:F.id,rect:F.rect.current,data:F.data,disabled:F.disabled}:null,ne={active:on,activatorEvent:Yn,collisions:Sn,delta:{x:Wn.x,y:Wn.y},over:X};Ba.unstable_batchedUpdates(()=>{As(X),Fn==null||Fn(ne),T({type:"onDragOver",event:ne})})},[La]),Rs(()=>{Xe.current={activatorEvent:W,active:oe,activeNode:ve,collisionRect:ct,collisions:Et,droppableRects:q,draggableNodes:k,draggingNode:vt,draggingNodeRect:ut,droppableContainers:B,over:Wt,scrollableAncestors:H,scrollAdjustedTranslate:Be},J.current={initial:ut,translated:ct}},[oe,ve,Et,ct,k,vt,ut,q,B,Wt,H,Be]),vJ({...Ee,delta:V,draggingRect:ct,pointerCoordinates:_e,scrollableAncestors:H,scrollableAncestorRects:te});const po=p.useMemo(()=>({active:oe,activeNode:ve,activeNodeRect:be,activatorEvent:W,collisions:Et,containerNodeRect:Je,dragOverlay:Ne,draggableNodes:k,droppableContainers:B,droppableRects:q,over:Wt,measureDroppableContainers:le,scrollableAncestors:H,scrollableAncestorRects:te,measuringConfiguration:U,measuringScheduled:me,windowRect:ur}),[oe,ve,be,W,Et,Je,Ne,k,B,q,Wt,le,H,te,U,me,ur]),Tl=p.useMemo(()=>({activatorEvent:W,activators:es,active:oe,activeNodeRect:be,ariaDescribedById:{draggable:L},dispatch:R,draggableNodes:k,over:Wt,measureDroppableContainers:le}),[W,es,oe,be,R,L,k,Wt,le]);return je.createElement(i4.Provider,{value:_},je.createElement(bg.Provider,{value:Tl},je.createElement(C4.Provider,{value:po},je.createElement(w4.Provider,{value:zr},m)),je.createElement(HJ,{disabled:(d==null?void 0:d.restoreFocus)===!1})),je.createElement(VX,{...d,hiddenTextDescribedById:L}));function go(){const on=(Y==null?void 0:Y.autoScrollEnabled)===!1,Yn=typeof h=="object"?h.enabled===!1:h===!1,Sn=j&&!on&&!Yn;return typeof h=="object"?{...h,enabled:Sn}:{enabled:Sn}}}),BJ=p.createContext(null),KT="button",GJ="Draggable";function qJ(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const l=jf(GJ),{activators:c,activatorEvent:d,active:h,activeNodeRect:m,ariaDescribedById:g,draggableNodes:v,over:x}=p.useContext(bg),{role:b=KT,roleDescription:w="draggable",tabIndex:C=0}=s??{},E=(h==null?void 0:h.id)===t,R=p.useContext(E?w4:BJ),[T,_]=lp(),[O,A]=lp(),j=AJ(c,t),D=Bd(n);Rs(()=>(v.set(t,{id:t,key:l,node:T,activatorNode:O,data:D}),()=>{const V=v.get(t);V&&V.key===l&&v.delete(t)}),[v,t]);const k=p.useMemo(()=>({role:b,tabIndex:C,"aria-disabled":r,"aria-pressed":E&&b===KT?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,b,C,E,w,g.draggable]);return{active:h,activatorEvent:d,activeNodeRect:m,attributes:k,isDragging:E,listeners:r?void 0:j,node:T,over:x,setNodeRef:_,setActivatorNodeRef:A,transform:R}}function KJ(){return p.useContext(C4)}const ZJ="Droppable",YJ={timeout:25};function WJ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const l=jf(ZJ),{active:c,dispatch:d,over:h,measureDroppableContainers:m}=p.useContext(bg),g=p.useRef({disabled:n}),v=p.useRef(!1),x=p.useRef(null),b=p.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:E}={...YJ,...s},R=Bd(C??r),T=p.useCallback(()=>{if(!v.current){v.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(R.current)?R.current:[R.current]),b.current=null},E)},[E]),_=xg({callback:T,disabled:w||!c}),O=p.useCallback((k,V)=>{_&&(V&&(_.unobserve(V),v.current=!1),k&&_.observe(k))},[_]),[A,j]=lp(O),D=Bd(t);return p.useEffect(()=>{!_||!A.current||(_.disconnect(),v.current=!1,_.observe(A.current))},[A,_]),p.useEffect(()=>(d({type:qn.RegisterDroppable,element:{id:r,key:l,disabled:n,node:A,rect:x,data:D}}),()=>d({type:qn.UnregisterDroppable,key:l,id:r})),[r]),p.useEffect(()=>{n!==g.current.disabled&&(d({type:qn.SetDroppableDisabled,id:r,key:l,disabled:n}),g.current.disabled=n)},[r,l,n,d]),{active:c,rect:x,isOver:(h==null?void 0:h.id)===r,node:A,over:h,setNodeRef:j}}function R4(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function QJ(e,t){return e.reduce((n,r,s)=>{const l=t.get(r);return l&&(n[s]=l),n},Array(e.length))}function am(e){return e!==null&&e>=0}function XJ(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 JJ(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const T4=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const l=R4(t,r,n),c=t[s],d=l[s];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},sm={scaleX:1,scaleY:1},_4=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:r;if(!d)return null;if(s===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(d.top+d.height):m.top-d.top,...sm}:null}const h=eee(l,s,n);return s>n&&s<=c?{x:0,y:-d.height-h,...sm}:s<n&&s>=c?{x:0,y:d.height+h,...sm}:{x:0,y:0,...sm}};function eee(e,t,n){const r=e[t],s=e[t-1],l=e[t+1];return r?n<t?s?r.top-(s.top+s.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const j4="Sortable",N4=je.createContext({activeIndex:-1,containerId:j4,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:T4,disabled:{draggable:!1,droppable:!1}});function A4(e){let{children:t,id:n,items:r,strategy:s=T4,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:h,over:m,measureDroppableContainers:g}=KJ(),v=jf(j4,n),x=d.rect!==null,b=p.useMemo(()=>r.map(j=>typeof j=="object"&&"id"in j?j.id:j),[r]),w=c!=null,C=c?b.indexOf(c.id):-1,E=m?b.indexOf(m.id):-1,R=p.useRef(b),T=!XJ(b,R.current),_=E!==-1&&C===-1||T,O=JJ(l);Rs(()=>{T&&w&&g(b)},[T,b,w,g]),p.useEffect(()=>{R.current=b},[b]);const A=p.useMemo(()=>({activeIndex:C,containerId:v,disabled:O,disableTransforms:_,items:b,overIndex:E,useDragOverlay:x,sortedRects:QJ(b,h),strategy:s}),[C,v,O.draggable,O.droppable,_,b,E,h,x,s]);return je.createElement(N4.Provider,{value:A},t)}const tee=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return R4(n,r,s).indexOf(t)},nee=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:l,newIndex:c,previousItems:d,previousContainerId:h,transition:m}=e;return!m||!r||d!==l&&s===c?!1:n?!0:c!==s&&t===h},ree={duration:200,easing:"ease"},D4="transform",aee=Gd.Transition.toString({property:D4,duration:0,easing:"linear"}),see={roleDescription:"sortable"};function oee(e){let{disabled:t,index:n,node:r,rect:s}=e;const[l,c]=p.useState(null),d=p.useRef(n);return Rs(()=>{if(!t&&n!==d.current&&r.current){const h=s.current;if(h){const m=iu(r.current,{ignoreTransform:!0}),g={x:h.left-m.left,y:h.top-m.top,scaleX:h.width/m.width,scaleY:h.height/m.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,r,s]),p.useEffect(()=>{l&&c(null)},[l]),l}function iee(e){let{animateLayoutChanges:t=nee,attributes:n,disabled:r,data:s,getNewIndex:l=tee,id:c,strategy:d,resizeObserverConfig:h,transition:m=ree}=e;const{items:g,containerId:v,activeIndex:x,disabled:b,disableTransforms:w,sortedRects:C,overIndex:E,useDragOverlay:R,strategy:T}=p.useContext(N4),_=lee(r,b),O=g.indexOf(c),A=p.useMemo(()=>({sortable:{containerId:v,index:O,items:g},...s}),[v,s,O,g]),j=p.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:D,node:k,isOver:V,setNodeRef:B}=WJ({id:c,data:A,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...h}}),{active:z,activatorEvent:J,activeNodeRect:oe,attributes:K,setNodeRef:Y,listeners:I,isDragging:W,over:G,setActivatorNodeRef:ie,transform:L}=qJ({id:c,data:A,attributes:{...see,...n},disabled:_.draggable}),Z=jX(B,Y),U=!!z,q=U&&!w&&am(x)&&am(E),le=!R&&W,me=le&&q?L:null,fe=q?me??(d??T)({rects:C,activeNodeRect:oe,activeIndex:x,overIndex:E,index:O}):null,Ee=am(x)&&am(E)?l({id:c,items:g,activeIndex:x,overIndex:E}):O,De=z==null?void 0:z.id,be=p.useRef({activeId:De,items:g,newIndex:Ee,containerId:v}),Je=g!==be.current.items,Xe=t({active:z,containerId:v,isDragging:W,isSorting:U,id:c,index:O,items:g,newIndex:be.current.newIndex,previousItems:be.current.items,previousContainerId:be.current.containerId,transition:m,wasDragging:be.current.activeId!=null}),Ht=oee({disabled:!Xe,index:O,node:k,rect:D});return p.useEffect(()=>{U&&be.current.newIndex!==Ee&&(be.current.newIndex=Ee),v!==be.current.containerId&&(be.current.containerId=v),g!==be.current.items&&(be.current.items=g)},[U,Ee,v,g]),p.useEffect(()=>{if(De===be.current.activeId)return;if(De&&!be.current.activeId){be.current.activeId=De;return}const vt=setTimeout(()=>{be.current.activeId=De},50);return()=>clearTimeout(vt)},[De]),{active:z,activeIndex:x,attributes:K,data:A,rect:D,index:O,newIndex:Ee,items:g,isOver:V,isSorting:U,isDragging:W,listeners:I,node:k,overIndex:E,over:G,setNodeRef:Z,setActivatorNodeRef:ie,setDroppableNodeRef:B,setDraggableNodeRef:Y,transform:Ht??fe,transition:Ne()};function Ne(){if(Ht||Je&&be.current.newIndex===O)return aee;if(!(le&&!_S(J)||!m)&&(U||Xe))return Gd.Transition.toString({...m,property:D4})}}function lee(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}}Ut.Down,Ut.Right,Ut.Up,Ut.Left;function Dc({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:s=!1,className:l,saveButtonText:c="Save",cancelButtonText:d="Discard"}){const[h,m]=p.useState(!1),[g,v]=p.useState(e),x=p.useRef(null),b=T=>{v(T.target.value)},w=()=>{n&&g!==e&&n(g.trim()),m(!1)},C=()=>{v(e),m(!1)},E=T=>{T.key==="Enter"&&!T.shiftKey?(r===1||T.ctrlKey)&&(T.preventDefault(),w()):T.key==="Escape"&&(T.preventDefault(),C())},R=T=>{m(T),T?(v(e),setTimeout(()=>{x.current&&x.current.focus()},0)):C()};return o.jsxs(lS,{open:h,onOpenChange:R,children:[o.jsx(cS,{asChild:!0,children:o.jsx("div",{className:de("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",l),children:e||t})}),o.jsxs(uS,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[o.jsx(ui,{ref:x,value:g,onChange:b,onKeyDown:E,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),o.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:d}),o.jsx(we,{size:"sm",onClick:w,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function cee({isAllExpanded:e,onToggle:t}){return o.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?o.jsx(QL,{className:"h-4 w-4"}):o.jsx(Gb,{className:"h-4 w-4"})})}function uee({isExpanded:e,onToggle:t,ariaLabel:n}){return o.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?o.jsx(Oa,{className:"h-4 w-4"}):o.jsx(ml,{className:"h-4 w-4"})})}function dee({className:e="",...t}){return o.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:o.jsx(R5,{className:"h-4 w-4 text-gray-400"})})}function O4({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:l,transition:c,isDragging:d}=iee({id:e}),h={transform:Gd.Transform.toString(l),transition:c,opacity:d?.75:1},m=p.Children.toArray(t),g=[o.jsx(oa,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:o.jsx(dee,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return o.jsx(Zn,{ref:s,style:h,className:"group",children:g})}function M4({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[s,l]=p.useState(!1),c=()=>{t&&t(e.index),l(!1)},d=r&&n&&r(e.index),h=!!t,m=d&&h;return o.jsxs("div",{className:"px-3 text-right",children:[o.jsxs(xr,{children:[o.jsx(br,{asChild:!0,children:o.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:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(cr,{align:"end",children:[d&&o.jsxs(Ft,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[o.jsx(ha,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&o.jsx(Aa,{}),h&&o.jsxs(Ft,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:()=>{l(!0)},children:[o.jsx(xp,{className:"mr-2 h-4 w-4"}),"Delete field"]})]})]}),o.jsx(ia,{open:s,onOpenChange:l,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function fee({mode:e,onModeChange:t}){const n=Object.values($d),r=s=>{t&&t(s)};return o.jsxs(ca,{value:e,onValueChange:r,children:[o.jsx(da,{className:"h-90 cursor-pointer",size:"sm",children:o.jsx(ua,{placeholder:"Select field mode"})}),o.jsx(fa,{className:"max-h-[300px]",children:n.map(s=>o.jsx(kn,{value:s,children:s},s))})]})}var Sg="Checkbox",[hee,vne]=jr(Sg),[mee,DS]=hee(Sg);function pee(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:l,form:c,name:d,onCheckedChange:h,required:m,value:g="on",internal_do_not_use_render:v}=e,[x,b]=ra({prop:n,defaultProp:s??!1,onChange:h,caller:Sg}),[w,C]=p.useState(null),[E,R]=p.useState(null),T=p.useRef(!1),_=w?!!c||!!w.closest("form"):!0,O={checked:x,disabled:l,setChecked:b,control:w,setControl:C,name:d,form:c,value:g,hasConsumerStoppedPropagationRef:T,required:m,defaultChecked:ai(s)?!1:s,isFormControl:_,bubbleInput:E,setBubbleInput:R};return o.jsx(mee,{scope:t,...O,children:gee(v)?v(O):r})}var k4="CheckboxTrigger",I4=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:l,value:c,disabled:d,checked:h,required:m,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:x,isFormControl:b,bubbleInput:w}=DS(k4,e),C=gt(s,g),E=p.useRef(h);return p.useEffect(()=>{const R=l==null?void 0:l.form;if(R){const T=()=>v(E.current);return R.addEventListener("reset",T),()=>R.removeEventListener("reset",T)}},[l,v]),o.jsx(Ze.button,{type:"button",role:"checkbox","aria-checked":ai(h)?"mixed":h,"aria-required":m,"data-state":V4(h),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:C,onKeyDown:Te(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Te(n,R=>{v(T=>ai(T)?!0:!T),w&&b&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});I4.displayName=k4;var L4=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:h,onCheckedChange:m,form:g,...v}=e;return o.jsx(pee,{__scopeCheckbox:n,checked:s,defaultChecked:l,disabled:d,required:c,onCheckedChange:m,name:r,form:g,value:h,internal_do_not_use_render:({isFormControl:x})=>o.jsxs(o.Fragment,{children:[o.jsx(I4,{...v,ref:t,__scopeCheckbox:n}),x&&o.jsx(H4,{__scopeCheckbox:n})]})})});L4.displayName=Sg;var P4="CheckboxIndicator",U4=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,l=DS(P4,n);return o.jsx(yr,{present:r||ai(l.checked)||l.checked===!0,children:o.jsx(Ze.span,{"data-state":V4(l.checked),"data-disabled":l.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});U4.displayName=P4;var F4="CheckboxBubbleInput",H4=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:l,defaultChecked:c,required:d,disabled:h,name:m,value:g,form:v,bubbleInput:x,setBubbleInput:b}=DS(F4,e),w=gt(n,b),C=rS(l),E=i0(r);p.useEffect(()=>{const T=x;if(!T)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,j=!s.current;if(C!==l&&A){const D=new Event("click",{bubbles:j});T.indeterminate=ai(l),A.call(T,ai(l)?!1:l),T.dispatchEvent(D)}},[x,C,l,s]);const R=p.useRef(ai(l)?!1:l);return o.jsx(Ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:d,disabled:h,name:m,value:g,form:v,...t,tabIndex:-1,ref:w,style:{...t.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});H4.displayName=F4;function gee(e){return typeof e=="function"}function ai(e){return e==="indeterminate"}function V4(e){return ai(e)?"indeterminate":e?"checked":"unchecked"}function vee({className:e,...t}){return o.jsx(L4,{"data-slot":"checkbox",className:de("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:o.jsx(U4,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:o.jsx(vr,{className:"size-3.5"})})})}function z4({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return o.jsx(vee,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const ZT={[qa.CONNECTED]:{icon:vp,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[qa.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:Kb,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[qa.DISCONNECTED]:{icon:q5,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function $4({status:e}){if(!e||!(e in ZT))return null;const t=ZT[e],{icon:n,color:r,label:s,description:l}=t,c=`schema-field-status-tooltip-${e}`;return o.jsx(hs,{children:o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(n,{className:de("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),o.jsxs(Mt,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs font-medium",children:s}),o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:l})]})]})})}function B4({type:e,storageType:t,onTypeChange:n}){const r=t===Ie.GOOGLE_BIGQUERY?Object.values(En):Object.values(wS),s=l=>{n&&(Ie.GOOGLE_BIGQUERY,n(l))};return o.jsxs(ca,{value:e,onValueChange:s,children:[o.jsx(da,{className:"cursor-pointer",size:"sm",children:o.jsx(ua,{placeholder:"Select field type"})}),o.jsx(fa,{className:"max-h-[300px]",children:r.map(l=>o.jsx(kn,{value:l,children:l},l))})]})}function yee({table:e}){return o.jsx("div",{className:"px-3 text-right",children:o.jsxs(xr,{children:[o.jsx(br,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(Ft,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(vr,{className:"size-3.5"})})}),o.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function xee({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:s=500,className:l,"aria-label":c}){const[d,h]=p.useState(n),m=p.useRef(!0);p.useEffect(()=>{(n===""||m.current)&&(h(n),m.current=!1)},[n]);const g=p.useCallback(v=>{const x=v.target.value;h(x);const b=setTimeout(()=>{r(x)},s);return()=>{clearTimeout(b)}},[r,s]);return o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(vi,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),o.jsx(zt,{id:e,placeholder:t,value:d,onChange:g,className:l??"dm-card-toolbar-search-input","aria-label":c??t})]})}function bee({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:s}){return o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsx(xee,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),o.jsxs("div",{className:"dm-card-toolbar-right",children:[s&&o.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(s).map(([l,c])=>c===0?null:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx($4,{status:l}),o.jsx("span",{className:"text-sm font-medium text-gray-500",children:c})]},l))}),o.jsxs(we,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,"aria-label":"Add new field",children:[o.jsx(ha,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const See={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function YT(e,t={}){const n=See[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 Cee({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:l,dragContextProps:c,rowComponent:d=Zn,getRowId:h}){const m=t,g=l,v=d,{columnVisibility:x,setColumnVisibility:b}=wX(m),w=Qc({data:e,columns:m,getCoreRowModel:Wc(),getFilteredRowModel:yf(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:x},onColumnVisibilityChange:b,enableGlobalFilter:!0,globalFilterFn:EX,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:C,onChange:E,searchValue:R}=RX(w),T=p.useRef("");p.useEffect(()=>{s&&R!==T.current&&(T.current=R,s(R))},[R,s]);const _=p.useMemo(()=>{const j={[qa.CONNECTED]:0,[qa.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[qa.DISCONNECTED]:0};return(r??e).forEach(k=>{k.status in j&&j[k.status]++}),j},[e,r]);return o.jsxs("div",{className:"space-y-4",children:[n&&o.jsx(bee,{table:w,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:C,onFilterChange:E,statusCounts:_}),o.jsx("div",{className:"dm-card-table-wrap mb-0",children:o.jsxs(Xc,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[o.jsx(Jc,{className:"dm-card-table-header",children:w.getHeaderGroups().map(j=>o.jsx(Zn,{className:"dm-card-table-header-row",children:j.headers.map(D=>o.jsx(tu,{className:"bg-secondary dark:bg-background",style:YT(D.column.id,{width:D.getSize()!==0?D.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:D.isPlaceholder?null:typeof D.column.columnDef.header=="function"?D.column.columnDef.header(D.getContext()):D.column.columnDef.header},D.id))},j.id))}),o.jsx(eu,{className:"dm-card-table-body",children:w.getRowModel().rows.length?o.jsx(g,{...c,children:w.getRowModel().rows.map(j=>o.jsx(v,{id:h?h(j):j.index,row:j,children:j.getVisibleCells().map(D=>o.jsx(oa,{className:"bg-background dark:bg-muted",style:YT(D.column.id,{width:D.column.getSize()!==0?D.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:D.column.columnDef.cell&&typeof D.column.columnDef.cell=="function"?D.column.columnDef.cell(D.getContext()):null},D.id))},j.id))}):o.jsx(Zn,{children:o.jsx(oa,{colSpan:m.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&o.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,"aria-label":"Add new field",children:[o.jsx(ha,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function G4({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:l=[],fieldsForStatusCount:c,onSearchChange:d,nameColumnHeader:h,nameColumnCell:m,primaryKeyColumnCell:g,aliasColumnCell:v,descriptionColumnCell:x,actionsColumnCell:b,dragContext:w,dragContextProps:C,rowComponent:E,getRowId:R}){const T=p.useCallback((D,k)=>{if(t){const V=[...e];V[D]={...V[D],...k},t(V)}},[e,t]),_=p.useCallback(()=>{if(t){const D=r();t([...e,D])}},[e,t,r]),O=p.useCallback(D=>{if(t){const k=[...e];k.splice(D,1),t(k)}},[e,t]),A=p.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:D})=>o.jsx($4,{status:D.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:h??(()=>o.jsxs(Dt,{children:[o.jsx(Ot,{className:"cursor-default",children:"Name"}),o.jsx(Mt,{children:"Field name in the output schema"})]})),size:80,cell:({row:D})=>m?m({row:D,updateField:T}):o.jsx(Dc,{value:bX(D.getValue("name")),onValueChange:k=>{T(D.index,{name:k})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>o.jsxs(Dt,{children:[o.jsx(Ot,{className:"cursor-default",children:"PK"}),o.jsx(Mt,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:D})=>g?g({row:D,updateField:T}):o.jsx(z4,{isPrimaryKey:D.getValue("isPrimaryKey"),onPrimaryKeyChange:k=>{T(D.index,{isPrimaryKey:k})}}),enableHiding:!1},{accessorKey:"alias",header:()=>o.jsxs(Dt,{children:[o.jsx(Ot,{className:"cursor-default",children:"Alias"}),o.jsx(Mt,{children:"Alternative name for the field"})]}),size:80,cell:({row:D})=>v?v({row:D,updateField:T}):o.jsx(Dc,{value:D.getValue("alias"),onValueChange:k=>{T(D.index,{alias:k})},placeholder:"-"})},{accessorKey:"description",header:()=>o.jsxs(Dt,{children:[o.jsx(Ot,{className:"cursor-default",children:"Description"}),o.jsx(Mt,{children:"Detailed information about the field"})]}),cell:({row:D})=>x?x({row:D,updateField:T}):o.jsx(Dc,{value:D.getValue("description"),onValueChange:k=>{T(D.index,{description:k})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:D})=>o.jsx(yee,{table:D}),cell:({row:D,table:k})=>b?b({row:D,table:k}):o.jsx(M4,{row:D,onDeleteRow:t?O:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[T,O,t,h,m,g,v,x,b]),j=p.useMemo(()=>{const k={accessorKey:"type",header:()=>o.jsxs(Dt,{children:[o.jsx(Ot,{className:"cursor-default pl-[12px]",children:"Type"}),o.jsx(Mt,{children:"Data type of the field"})]}),size:80,cell:B=>s({row:B.row,updateField:T}),enableHiding:!1},V=[...A];if(V.splice(3,0,k),l.length>0){const B=[...l];B.sort((z,J)=>{const oe=z.columnIndex??1/0,K=J.columnIndex??1/0;return oe-K}),B.forEach(z=>{if(z.columnIndex!==void 0){const J=Math.min(Math.max(0,z.columnIndex),V.length);V.splice(J,0,z)}else V.splice(V.length-1,0,z)})}return V},[A,s,T,l]);return o.jsx(Cee,{fields:e,columns:j,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:d,dragContext:w,dragContextProps:C,rowComponent:E,getRowId:R})}function wee({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:l,flattenedFields:c,handleSearchChange:d,isRecordType:h,topLevelFields:m,allExpanded:g}=TX(e),{updateField:v,handleDeleteRow:x,handleAddNestedField:b,handleAddRow:w}=_X(e,c,t,z=>z),C=p.useCallback(()=>({name:"",type:En.STRING,mode:$d.NULLABLE,isPrimaryKey:!1,status:qa.DISCONNECTED}),[]),E=p.useCallback(({row:z})=>o.jsx(B4,{type:z.getValue("type"),storageType:Ie.GOOGLE_BIGQUERY,onTypeChange:J=>{v(z.index,{type:J})}}),[v]),R=p.useMemo(()=>[{accessorKey:"mode",header:()=>o.jsxs(Dt,{children:[o.jsx(Ot,{className:"cursor-default pl-[12px]",children:"Mode"}),o.jsx(Mt,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
681
+ NULLABLE - field can be NULL
682
+ REQUIRED - field cant be NULL
683
+ REPEATED - field is an Array of Type`})]}),size:80,cell:({row:z})=>o.jsx(fee,{mode:z.getValue("mode"),onModeChange:J=>{v(z.index,{mode:J})}}),columnIndex:4}],[v]),T=p.useCallback(()=>o.jsxs("div",{className:"flex items-center",children:[r&&o.jsx(cee,{isAllExpanded:g,onToggle:l}),o.jsxs(Dt,{children:[o.jsx(Ot,{className:"cursor-default",children:"Name"}),o.jsx(Mt,{children:"Field name in the output schema"})]})]}),[r,g,l]),_=p.useCallback(({row:z})=>{const J=c[z.index],K=(J.type===En.RECORD||J.type===En.STRUCT)&&J.fields&&J.fields.length>0,Y=J.path??"",I=J.level??0,W=n.has(Y);return o.jsxs("div",{className:"flex items-center",children:[I>0&&o.jsx("div",{style:{width:`${String(I*16-(K?4:0))}px`},className:"flex-shrink-0"}),K?o.jsx(uee,{isExpanded:W,onToggle:()=>{s(Y)},ariaLabel:W?"Collapse nested fields":"Expand nested fields"}):r&&o.jsx("div",{className:"w-5"}),o.jsx(Dc,{value:z.getValue("name"),onValueChange:G=>{v(z.index,{name:G})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,v]),O=p.useCallback(({row:z})=>{const J=c[z.index],oe=J.type===En.RECORD||J.type===En.STRUCT;return(J.level??0)===0&&!oe?o.jsx(z4,{isPrimaryKey:z.getValue("isPrimaryKey"),onPrimaryKeyChange:Y=>{v(z.index,{isPrimaryKey:Y})}}):o.jsx("div",{})},[c,v]),A=p.useCallback(({row:z})=>o.jsx(Dc,{value:z.getValue("description"),onValueChange:J=>{v(z.index,{description:J})},minRows:5,placeholder:"-"}),[v]),j=p.useCallback(({row:z})=>o.jsx(Dc,{value:z.getValue("alias"),onValueChange:J=>{v(z.index,{alias:J})},placeholder:"-"}),[v]),D=p.useCallback(({row:z})=>o.jsx(M4,{row:z,onDeleteRow:t?x:void 0,onAddNestedField:t?b:void 0,isRecordType:h}),[t,x,b,h]),{handleDragEnd:k}=a4(e,t,c),V=p.useCallback(z=>{const J=c[z.index];return J.path??String(c.indexOf(J))},[c]),B=c4(l4(yg,{activationConstraint:{distance:5}}));return o.jsx(E4,{sensors:B,collisionDetection:u4,onDragEnd:k,children:o.jsx(G4,{fields:c,onFieldsChange:t,onAddRow:w,createNewField:C,renderTypeCell:E,additionalColumns:R,fieldsForStatusCount:m,onSearchChange:d,nameColumnHeader:T,nameColumnCell:_,primaryKeyColumnCell:O,aliasColumnCell:j,descriptionColumnCell:A,actionsColumnCell:D,dragContext:A4,dragContextProps:{items:c.map(z=>z.path??String(c.indexOf(z))),strategy:_4},rowComponent:O4,getRowId:V})})}function Eee({fields:e,onFieldsChange:t}){const n=p.useCallback(()=>({name:"",type:wS.STRING,isPrimaryKey:!1,status:qa.DISCONNECTED}),[]),r=p.useCallback(({row:c,updateField:d})=>o.jsx(B4,{type:c.getValue("type"),storageType:Ie.AWS_ATHENA,onTypeChange:h=>{d(c.index,{type:h})}}),[]),{handleDragEnd:s}=a4(e,t),l=c4(l4(yg,{activationConstraint:{distance:5}}));return o.jsx(E4,{sensors:l,collisionDetection:u4,onDragEnd:s,children:o.jsx(G4,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:A4,dragContextProps:{items:e.map((c,d)=>d),strategy:_4},rowComponent:O4})})}function Ree({schema:e,storageType:t,onFieldsChange:n}){const r=p.useMemo(()=>{if(!e){const s=xX(t);return n(s.fields),s}return e},[e,t,n]);return e4(r)?o.jsx(wee,{fields:r.fields,onFieldsChange:n}):t4(r)?o.jsx(Eee,{fields:r.fields,onFieldsChange:n}):o.jsx("div",{className:"p-4 text-center",children:o.jsx("p",{children:"Unsupported schema type"})})}function Tee(){const{dataMart:e,updateDataMartSchema:t,actualizeDataMartSchema:n,isLoading:r,error:s}=Ts(),l=e==null?void 0:e.schema,{schema:c,isDirty:d,updateSchema:h,resetSchema:m}=SX(l),{operationStatus:g,startSaveOperation:v,startActualizeOperation:x}=CX(r,s);p.useEffect(()=>{g==="success"&&m()},[g,m]);const b=p.useCallback(T=>{h(T)},[h]);if(!e)return o.jsx("div",{children:"Error: Data mart not found"});const{id:w}=e,C=()=>{w&&c&&(v(),t(w,c))},E=()=>{w&&(x(),n(w))},R=()=>{m()};return o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx(Ree,{schema:c,storageType:e.storage.type,onFieldsChange:b}),o.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[o.jsxs("div",{className:"flex space-x-4",children:[o.jsx(we,{variant:"default",onClick:C,disabled:!d,children:"Save"}),o.jsx(we,{type:"button",variant:"ghost",onClick:R,disabled:!d,children:"Discard"})]}),o.jsx("div",{children:o.jsx(we,{type:"button",variant:"outline",onClick:E,children:"Refresh schema"})})]})]})})}function _ee(){const{id:e}=SI();return e?o.jsx("div",{className:"dm-page",children:o.jsx(HA,{children:o.jsx(SZ,{id:e})})}):o.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}const OS=p.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function ao({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=p.useContext(OS);return o.jsxs("div",{className:"flex items-center gap-2 self-center",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.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:o.jsx(e,{size:18})}),o.jsx(Eb,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&o.jsx(sQ,{className:de("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&o.jsx(hs,{children:o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.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:[o.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),o.jsx("span",{className:"sr-only",children:t})]})}),o.jsx(Mt,{children:o.jsx("p",{children:t})})]})})]})}ao.displayName="CollapsibleCardHeaderTitle";function Cg({children:e,className:t}){const n=r=>{r.stopPropagation()};return o.jsx("div",{className:de("flex items-center gap-2 self-center",t),onClick:n,children:e})}Cg.displayName="CollapsibleCardHeaderActions";function so({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=p.useContext(OS);let s,l;return p.Children.forEach(e,c=>{if(p.isValidElement(c))switch(c.type){case ao:s=c;break;case Cg:l=c;break}}),o.jsxs(Sm,{className:de("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[s,o.jsxs("div",{className:"flex items-center gap-2",children:[l,t&&o.jsx("div",{className:de("flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 hover:bg-gray-200/50 dark:hover:bg-gray-700/25"),children:o.jsx("div",{className:de("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:o.jsx(Oa,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}so.displayName="CollapsibleCardHeader";function oo({children:e}){return o.jsx(Rb,{className:"px-4 pt-1",children:e})}oo.displayName="CollapsibleCardContent";function si({left:e,right:t}){return o.jsxs(oQ,{className:"flex items-center gap-2 px-4 py-4",children:[o.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&o.jsx("div",{className:"flex items-center",children:t})]})}si.displayName="CollapsibleCardFooter";const WT="collapsed-card-";function tl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:l,name:c}){const d=c?Wo.get(`${WT}${c}`,"boolean")??s:s,[h,m]=p.useState(d);p.useEffect(()=>{c&&Wo.set(`${WT}${c}`,h)},[h,c]);const g=()=>{const C=!h;m(C),l==null||l(C)};let v,x,b;p.Children.forEach(e,C=>{if(p.isValidElement(C))switch(C.type){case so:v=C;break;case oo:x=C;break;case si:b=C;break}});const w={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 o.jsx(OS.Provider,{value:{isCollapsed:h,collapsible:r,handleCollapse:g},children:o.jsxs(bm,{className:de(w[n],t),children:[v,o.jsx("div",{className:de("grid transition-all duration-200",h?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:o.jsxs("div",{className:"overflow-hidden",children:[x,b]})})]})})}function jee(){const{dataMart:e,updateDataMartStorage:t}=wi();return o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs(tl,{collapsible:!0,name:"data-storage",children:[o.jsx(so,{children:o.jsx(ao,{icon:jm,tooltip:"Configure where your data will be stored",children:"Storage"})}),o.jsx(oo,{children:(e==null?void 0:e.storage)&&o.jsx(KW,{dataStorage:e.storage,onDataStorageChange:t})}),o.jsx(si,{})]}),o.jsxs(tl,{collapsible:!0,name:"input-source",children:[o.jsx(so,{children:o.jsx(ao,{icon:L_,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),o.jsx(oo,{children:e&&o.jsx(yX,{})}),o.jsx(si,{})]}),o.jsxs(tl,{collapsible:!0,name:"output-schema",children:[o.jsx(so,{children:o.jsx(ao,{icon:i5,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),o.jsx(oo,{children:e&&o.jsx(Tee,{})}),o.jsx(si,{})]})]})}function Nee(){const[e,t]=p.useState(null),[n,r]=p.useState(!1),[s,l]=p.useState(fn.EDIT),c=p.useCallback(()=>{l(fn.CREATE),t(null),r(!0)},[]),d=p.useCallback(g=>{t(g),l(fn.EDIT),r(!0)},[]),h=p.useCallback(()=>{r(!1)},[]),m=p.useCallback(g=>s===fn.EDIT&&e?g.find(v=>v.id===e):void 0,[s,e]);return{editId:e,editOpen:n,editMode:s,handleAddReport:c,handleEditRow:d,handleCloseEditForm:h,getEditReport:m}}function Aee(e){const t=Hd.getInfo(e.type),n=t.status===jc.ACTIVE;return{destinationInfo:t,isVisible:n}}function Dee(){const[e,t]=p.useState(!1),[n,r]=p.useState(!1),[s,l]=p.useState(null);return{isAddReportOpen:e,isEditReportOpen:n,editingReport:s,handleAddReport:()=>{t(!0)},handleEditReport:g=>{l(g),r(!0)},handleCloseAddReport:()=>{t(!1)},handleCloseEditReport:()=>{r(!1),l(null)}}}function Oee({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),[d,h]=p.useState(!1),{deleteReport:m,fetchReportsByDataMartId:g,runReport:v}=bl(),x=`actions-menu-${e.original.id}`,b=p.useCallback(async()=>{try{await m(e.original.id),await g(e.original.dataMart.id),t==null||t(),h(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[m,g,t,e.original.id,e.original.dataMart.id]),w=p.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),C=p.useCallback(async()=>{try{s(!0),await v(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[v,e.original.id]),E=p.useCallback(()=>{h(!0),c(!1)},[]);return o.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[o.jsxs(xr,{open:l,onOpenChange:c,children:[o.jsx(br,{asChild:!0,children:o.jsxs(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":l,"aria-controls":x,children:[o.jsx("span",{className:"sr-only",children:"Open menu"}),o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),o.jsxs(cr,{id:x,align:"end",role:"menu",children:[o.jsx(Ft,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem",children:"Edit report"}),Jp(e.original.destinationConfig)&&o.jsxs(o.Fragment,{children:[o.jsx(Aa,{}),o.jsxs(Ft,{onClick:R=>{R.stopPropagation(),C()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,className:"flex items-center gap-1",children:[r?"Running...":"Run report",o.jsx(qb,{className:"h-3 w-3","aria-hidden":"true"})]}),o.jsx(Ft,{asChild:!0,children:o.jsxs("a",{href:N0(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1",role:"menuitem",onClick:R=>{R.stopPropagation()},children:["Open document",o.jsx(f6,{className:"h-3 w-3","aria-hidden":"true"})]})})]}),o.jsx(Aa,{}),o.jsx(Ft,{className:"text-red-600",onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:"Delete"})]})]}),o.jsx(ia,{open:d,onOpenChange:h,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{b()},variant:"destructive"})]})}const Mee={[dn.SUCCESS]:{icon:vp,color:"text-green-500",label:"Success"},[dn.ERROR]:{icon:yp,color:"text-red-500",label:"Fail"},[dn.RUNNING]:{icon:Xd,color:"text-primary animate-spin",label:"In progress"}};function kee({status:e,error:t}){if(!e)return null;const n=Mee[e],{icon:r,color:s,label:l}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,d=()=>e===dn.ERROR&&t?`${l}: ${t}`:l;return o.jsx(hs,{children:o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(r,{className:de("h-5 w-5",s),role:"img","aria-label":d(),"aria-describedby":c,tabIndex:0})}),o.jsxs(Mt,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs",children:l}),e===dn.ERROR&&t&&o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}function Tx({column:e,children:t,label:n}){const r=e.getIsSorted(),s=p.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),l=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",d=n??(typeof t=="string"?t:"Column");return o.jsxs(we,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${d} - ${l()}. Click to sort.`,"aria-sort":c(),children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&o.jsx(bs,{className:"text-foreground h-4 w-4"}),r==="desc"&&o.jsx(Oa,{className:"text-foreground h-4 w-4"}),!r&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(bs,{className:"text-muted-foreground h-4 w-4"})})]})]})}var ti=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(ti||{});const q4={[ti.TITLE]:"Title",[ti.LAST_RUN_DATE]:"Last Run Date",[ti.LAST_RUN_STATUS]:"Last Run Status"};function Iee({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(xr,{children:[o.jsx(br,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=q4[t.id]||t.id;return o.jsx(Ft,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(vr,{className:"size-3.5"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const QT=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},Lee=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:ti.TITLE,header:({column:n})=>o.jsx(Tx,{column:n,children:q4[ti.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:ti.LAST_RUN_DATE,header:({column:n})=>o.jsx(Tx,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(cl,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:ti.LAST_RUN_STATUS,header:({column:n})=>o.jsx(Tx,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?o.jsx(kee,{status:n.original.lastRunStatus,error:n.original.lastRunError}):o.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>o.jsx(Iee,{table:n}),cell:({row:n})=>o.jsx(Oee,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function Pee({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){p.useEffect(()=>{{const s=setTimeout(()=>{const l=document.getElementById(e);if(l){const c=l;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 Uee=rn({title:an().min(1,"Title is required"),documentUrl:an().refine(eA,"Enter a valid Google Sheets URL"),dataDestinationId:an().min(1,"Destination is required")});function Fee({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:s}){const[l,c]=p.useState(null),[d,h]=p.useState(!1),{updateReport:m,createReport:g,error:v,clearError:x}=bl();p.useEffect(()=>{d&&v&&(c(v),h(!1))},[v,d]);const b=Ei({resolver:Rl(Uee),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&Jp(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(s==null?void 0:s.id)??""},mode:"onTouched"}),{register:w,handleSubmit:C,formState:E,reset:R}=b,{errors:T,isDirty:_}=E,O=p.useCallback(async A=>{try{c(null),x(),h(!0);const{spreadsheetId:j,sheetId:D}=rB(A.documentUrl);if(!j){c("Invalid Google Sheets URL");return}let k;if(t===fn.CREATE)k=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:{type:aa.GOOGLE_SHEETS_CONFIG,spreadsheetId:j,sheetId:D}});else{if(!e){c("Initial report is required for edit mode");return}k=await m(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:{type:aa.GOOGLE_SHEETS_CONFIG,spreadsheetId:j,sheetId:D}})}if(!k||v){c(v??"An error occurred while submitting the form");return}r==null||r()}catch(j){console.error("Error submitting form:",j),c("An error occurred while submitting the form")}},[t,e,n,g,m,r,x,v]);return{form:b,register:w,handleSubmit:C,errors:T,isDirty:_,reset:R,formError:l,isSubmitting:d,setFormError:c,getValues:b.getValues,onSubmit:O}}function Hee(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"service-account-details",children:[o.jsx(Pn,{children:"How do I get a correct document link?"}),o.jsxs(Un,{children:[o.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open your Google Sheets document and select the specific ",o.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),o.jsxs("li",{children:["Share the document with the service account email and grant it ",o.jsx("strong",{children:"Editor"})," ","access."]}),o.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",o.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),o.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function _x(e){return"serviceAccount"in e}function Vee({value:e,children:t}){const[n,r]=p.useState(!1),s=async()=>{e&&(await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3))};return o.jsx(hs,{children:o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>l.key==="Enter"&&s(),className:de("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:[o.jsx("span",{className:"truncate",children:t||e||"No data"}),n?o.jsx(vr,{className:"h-4 w-4 text-green-500"}):o.jsx(_m,{className:"h-4 w-4"})]})}),o.jsx(Mt,{children:o.jsx("p",{children:n?"Copied!":"Click to copy"})})]})})}const zee=p.forwardRef(({initialReport:e,mode:t=fn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:l,preSelectedDestination:c},d)=>{const h="google-sheets-edit-form",m="google-sheets-title-input",g="google-sheets-document-url-input",v="google-sheets-data-destination-select",{dataMart:x}=Ts(),{dataDestinations:b,fetchDataDestinations:w,loading:C}=Xp(),[E,R]=p.useState([]);p.useEffect(()=>{x&&w()},[x,w]),p.useEffect(()=>{if(b.length>0){const B=b.filter(z=>z.type===It.GOOGLE_SHEETS);R(B)}},[b]),Pee({elementId:m,isOpen:!0,delay:150});const{isDirty:T,reset:_,form:O,isSubmitting:A,formError:j,onSubmit:D}=Fee({initialReport:e,mode:t,dataMartId:(x==null?void 0:x.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});p.useEffect(()=>{r&&r(j)},[j,r]),p.useEffect(()=>{if(t===fn.EDIT&&e&&Jp(e.destinationConfig))_({title:e.title,documentUrl:N0(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===fn.CREATE){const B=(c==null?void 0:c.id)??"";_({title:"",documentUrl:"",dataDestinationId:B})}},[e,t,_,c]),p.useEffect(()=>{n==null||n(T)},[T,n]);const k=O.watch("documentUrl"),V=k&&eA(k.trim());return o.jsx(Cl,{...O,children:o.jsxs(Ri,{id:h,ref:d,noValidate:!0,onSubmit:B=>void O.handleSubmit(D)(B),children:[o.jsxs(wl,{children:[o.jsxs(Es,{title:"General",children:[o.jsx(qt,{control:O.control,name:"title",render:({field:B})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),o.jsx(Yt,{children:o.jsx(zt,{id:m,placeholder:"Enter a report title",...B})}),o.jsx(tn,{})]})}),o.jsx(qt,{control:O.control,name:"dataDestinationId",render:({field:B})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Select one of your existing destinations",children:"Destination"}),o.jsxs(ca,{onValueChange:B.onChange,value:B.value,disabled:C||E.length===0,children:[o.jsx(Yt,{children:o.jsx(da,{id:v,className:"w-full max-w-full overflow-hidden",children:o.jsx(ua,{className:"truncate",placeholder:"Select a destination",children:B.value&&E.length>0&&(()=>{const z=E.find(J=>J.id===B.value);if(z){const oe=Hd.getInfo(z.type).icon;return o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(oe,{className:"flex-shrink-0",size:18}),o.jsx("div",{className:"flex min-w-0 flex-col",children:o.jsx("span",{className:"truncate",children:z.title})})]})}return null})()})})}),o.jsx(fa,{children:E.map(z=>{const oe=Hd.getInfo(z.type).icon;return o.jsx(kn,{value:z.id,children:o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(oe,{className:"flex-shrink-0",size:18}),o.jsxs("div",{className:"flex min-w-0 flex-col",children:[o.jsx("span",{className:"truncate",children:z.title}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(_x(z.credentials)&&rx(z.credentials.serviceAccount))??"No email found"})]})]})},z.id)})})]}),E.length===0&&!C&&o.jsxs(bS,{className:"mt-2",children:[o.jsx(Hc,{className:"h-4 w-4"}),o.jsx(PO,{children:"No destinations available"}),o.jsxs(SS,{children:["You need to create a Destination before you can create a report."," ",o.jsx(gi,{to:"/data-destinations",className:"font-medium text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:"Go to Destinations"})]})]}),B.value&&E.length>0&&(()=>{const z=E.find(J=>J.id===B.value);return z?o.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[o.jsx(Zt,{children:"Service Account Email"}),o.jsx(Vee,{value:_x(z.credentials)?rx(z.credentials.serviceAccount)??"No email found":"",children:_x(z.credentials)?rx(z.credentials.serviceAccount):"No email found"})]}):null})(),o.jsx(tn,{})]})}),o.jsx(qt,{control:O.control,name:"documentUrl",render:({field:B})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),o.jsx(Yt,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(zt,{id:g,placeholder:"Document URL",className:"flex-1",...B}),o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${V?"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:()=>{V&&window.open(k.trim(),"_blank","noopener,noreferrer")},disabled:!V,"aria-label":V?"Open document in new tab":"Document link is not valid",children:o.jsx(Qd,{className:"h-4 w-4","aria-hidden":"true"})})}),o.jsx(Mt,{side:"top",align:"center",role:"tooltip",children:V?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),o.jsx(Mn,{children:o.jsx(Hee,{})}),o.jsx(tn,{})]})})]}),o.jsx(Es,{title:"Automate Report Runs",children:o.jsx(XO,{})})]}),o.jsxs(El,{children:[o.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":t===fn.CREATE?"Create new report":"Save changes to report",disabled:!T||A,children:A?t===fn.CREATE?"Creating...":"Saving...":t===fn.CREATE?"Create new report":"Save changes to report"}),l&&o.jsx(we,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function K4({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),h(!1),t()},[t]),v=p.useCallback(b=>{h(b)},[]),x=p.useCallback(()=>{h(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(yi,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(xi,{children:[o.jsxs(bi,{children:[o.jsx(vl,{children:r===fn.CREATE?"Create new report":"Edit report"}),o.jsx($c,{children:r===fn.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),o.jsx(Qp,{children:o.jsx(zee,{initialReport:n,mode:r,onDirtyChange:v,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),o.jsx(ia,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const $ee=rn({cacheLifetime:K7().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function Bee({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,l]=p.useState(null),{createReport:c,updateReport:d}=bl(),h=Ei({resolver:Rl($ee),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&fA(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:h,onSubmit:async g=>{try{l(null);const{cacheLifetime:v}=g,x={type:aa.LOOKER_STUDIO_CONFIG,cacheLifetime:v};e?await d(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(v){console.error("Error submitting form:",v),l("Failed to save report. Please try again.")}},formError:s,isSubmitting:h.formState.isSubmitting,isDirty:h.formState.isDirty,reset:h.reset}}function Gee(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"cache-lifetime-details",children:[o.jsx(Pn,{children:"What is the Cache Lifetime for Looker Studio?"}),o.jsx(Un,{children:o.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 qee=[{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"}],Kee=p.forwardRef(({initialReport:e,mode:t=fn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:l,preSelectedDestination:c},d)=>{const h="looker-studio-edit-form",{dataMart:m}=Ts(),{isDirty:g,reset:v,form:x,isSubmitting:b,formError:w,onSubmit:C}=Bee({initialReport:e,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return p.useEffect(()=>{r&&r(w)},[w,r]),p.useEffect(()=>{t===fn.EDIT&&e&&fA(e.destinationConfig)?v({cacheLifetime:e.destinationConfig.cacheLifetime}):t===fn.CREATE&&v({cacheLifetime:300})},[e,t,v]),p.useEffect(()=>{n==null||n(g)},[g,n]),o.jsx(Cl,{...x,children:o.jsxs(Ri,{id:h,ref:d,noValidate:!0,onSubmit:E=>void x.handleSubmit(C)(E),children:[o.jsx(wl,{children:o.jsx(Es,{title:"Cache Configuration",children:o.jsx(qt,{control:x.control,name:"cacheLifetime",render:({field:E})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),o.jsxs(ca,{onValueChange:R=>{E.onChange(parseInt(R,10))},value:E.value.toString(),defaultValue:"300",children:[o.jsx(Yt,{children:o.jsx(da,{className:"w-full",children:o.jsx(ua,{placeholder:"Select cache time"})})}),o.jsx(fa,{children:qee.map(R=>o.jsx(kn,{value:R.value.toString(),children:R.label},R.value))})]}),o.jsx(tn,{}),o.jsx(Mn,{children:o.jsx(Gee,{})})]})})})}),o.jsxs(El,{children:[o.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":t===fn.CREATE?"Create new report":"Save changes to report",disabled:!g||b,children:b?t===fn.CREATE?"Creating...":"Saving...":t===fn.CREATE?"Create new report":"Save changes to report"}),l&&o.jsx(we,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Zee({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),h(!1),t()},[t]),v=p.useCallback(b=>{h(b)},[]),x=p.useCallback(()=>{h(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(yi,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(xi,{children:[o.jsxs(bi,{children:[o.jsx(vl,{children:(s==null?void 0:s.title)??"Looker Studio"}),o.jsx($c,{children:r===fn.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),o.jsx(Qp,{children:o.jsx(Kee,{initialReport:n,mode:r,onDirtyChange:v,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),o.jsx(ia,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function Yee({destination:e,onEditReport:t}){const{dataMart:n}=Ts(),{fetchReportsByDataMartId:r,reports:s,stopAllPolling:l,setPollingConfig:c}=bl(),{editOpen:d,editMode:h,handleCloseEditForm:m,getEditReport:g}=Nee(),v=p.useMemo(()=>s.filter(O=>O.dataDestination.type===It.GOOGLE_SHEETS&&O.dataDestination.id===e.id),[s,e.id]),x=g(s);p.useEffect(()=>{c({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[c]),p.useEffect(()=>{(async()=>{try{if(!n)return;await r(n.id)}catch(A){console.error(A)}})()},[r,n]),p.useEffect(()=>()=>{l()},[n==null?void 0:n.id,l]);const b=p.useMemo(()=>Lee({onDeleteSuccess:()=>{},onEditReport:O=>{t(O)}}),[t]),{sorting:w,setSorting:C,columnVisibility:E,setColumnVisibility:R}=bf({columns:b,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),T=Qc({data:v,columns:b,getCoreRowModel:Wc(),onSortingChange:C,getSortedRowModel:xf(),state:{sorting:w,columnVisibility:E},onColumnVisibilityChange:R}),_=`google-sheets-reports-table-${e.id}`;return o.jsxs("div",{className:"w-full",children:[o.jsx(ni,{}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Xc,{id:_,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[o.jsx(Jc,{className:"dm-card-table-header",children:T.getHeaderGroups().map(O=>o.jsx(Zn,{className:"dm-card-table-header-row",children:O.headers.map(A=>o.jsx(tu,{className:QT(A.column.columnDef._align),style:A.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(A.column.getSize())}%`},scope:"col",children:A.isPlaceholder?null:typeof A.column.columnDef.header=="function"?A.column.columnDef.header(A.getContext()):A.column.columnDef.header},A.id))},O.id))}),o.jsx(eu,{className:"dm-card-table-body",children:T.getRowModel().rows.length?T.getRowModel().rows.map((O,A)=>o.jsx(Zn,{onClick:()=>{const j=s.find(D=>D.id===O.original.id);j&&t(j)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":A+1,children:O.getVisibleCells().map((j,D)=>o.jsx(oa,{className:`px-6 whitespace-normal ${QT(j.column.columnDef._align)}`,style:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.column.getSize())}%`},role:"cell","aria-colindex":D+1,children:typeof j.column.columnDef.cell=="function"?j.column.columnDef.cell(j.getContext()):j.column.columnDef.cell},j.id))},O.id)):o.jsx(Zn,{children:o.jsx(oa,{colSpan:b.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})}),o.jsx(K4,{isOpen:d,onClose:m,initialReport:x,mode:h})]})}function Wee({children:e,className:t,...n}){return o.jsx("div",{className:de("flex flex-shrink-0 items-start justify-center py-5 pl-6",t),...n,children:e})}function Qee({children:e,className:t,...n}){return o.jsx("div",{className:de("flex flex-grow flex-col gap-1 px-0 py-4",t),...n,children:e})}function Xee({children:e,className:t,...n}){return o.jsx("div",{className:de("text-md font-medium",t),...n,children:e})}function Jee({children:e,className:t,...n}){return o.jsx("div",{className:de("text-muted-foreground text-sm",t),...n,children:e})}function ete({children:e,className:t,...n}){return o.jsx("div",{className:de("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:e})}function tte(e,t){const{dataMart:n}=Ts(),{reports:r,createReport:s,deleteReport:l,fetchReportsByDataMartId:c}=bl(),[d,h]=p.useState(!1),m=p.useMemo(()=>r.find(w=>w.dataDestination.type===It.LOOKER_STUDIO&&w.dataDestination.id===e.id),[r,e.id]),g=p.useMemo(()=>(t==null?void 0:t.code)===tr.PUBLISHED,[t==null?void 0:t.code]),v=p.useMemo(()=>!!m,[m]),x=p.useMemo(()=>v?"Available in Looker Studio":"Not available in Looker Studio",[v]),b=p.useCallback(async w=>{if(!(!n||!g)){h(!0);try{if(w){const C={title:`Looker Studio Report - ${e.title}`,dataMartId:n.id,dataDestinationId:e.id,destinationConfig:{type:aa.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await s(C),await c(n.id)}else m&&(await l(m.id),await c(n.id))}catch(C){console.error("Failed to toggle Looker Studio report:",C)}finally{h(!1)}}},[n,g,e,m,s,l,c]);return{existingReport:m,isLoading:d,isEnabled:g,isChecked:v,dynamicTitle:x,handleSwitchChange:b}}function nte({destination:e,dataMartStatus:t,onEditReport:n,className:r,...s}){const{existingReport:l,isLoading:c,isEnabled:d,isChecked:h,dynamicTitle:m,handleSwitchChange:g}=tte(e,t),v=p.useCallback(()=>{l&&n(l)},[l,n]),x=p.useCallback(b=>{b.stopPropagation()},[]);return o.jsxs("div",{className:de("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",l&&"cursor-pointer dark:hover:bg-white/5",r),onClick:l?()=>{v()}:void 0,...s,children:[o.jsx(Wee,{onClick:x,children:c?o.jsx(Xd,{className:"text-muted-foreground h-5 w-5 animate-spin"}):o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx("span",{children:o.jsx(qO,{checked:h,onCheckedChange:b=>{g(b)},disabled:!d,"aria-label":`${h?"Disable":"Enable"} Looker Studio access`})})}),o.jsx(Mt,{children:d?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:h?"Data Mart is accessible for Looker Studio":"Data Mart is not accessible for Looker Studio"}),o.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:h?"Turn off to remove access":"Turn on to enable access"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"To enable Looker Studio reports, publish the Data Mart first"}),o.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Data Marts must be published before creating reports"})]})})]})}),o.jsxs(Qee,{children:[o.jsx(Xee,{children:m}),o.jsx(Jee,{children:h&&l?o.jsx(o.Fragment,{children:l.lastRunDate?o.jsxs(o.Fragment,{children:["Last fetched"," ",l.lastRunStatus===dn.SUCCESS&&"successfully ",o.jsx(cl,{date:new Date(l.lastRunDate)}),l.lastRunStatus===dn.ERROR&&" but failed with error",l.lastRunError&&o.jsx("div",{className:"mt-1 text-red-600 dark:text-red-400",children:l.lastRunError})]}):"Data not fetched yet, still waiting for Looker Studio's first visit"}):"Turn on to enable access"})]}),h&&l&&o.jsx(ete,{children:o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-gray-700/25",children:o.jsx(ml,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})}function rte(){return o.jsx("div",{className:"dm-card",children:o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(Bb,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),o.jsx(we,{variant:"outline",asChild:!0,children:o.jsxs(gi,{to:"/data-destinations",className:"flex items-center gap-1",children:["Go to Destinations",o.jsx(ml,{className:"h-4 w-4"})]})})]})})}function ate({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=Aee(e),{isAddReportOpen:s,isEditReportOpen:l,editingReport:c,handleAddReport:d,handleEditReport:h,handleCloseAddReport:m,handleCloseEditReport:g}=Dee();return r?o.jsxs(o.Fragment,{children:[o.jsxs(tl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[o.jsxs(so,{children:[o.jsx(ao,{icon:n.icon,children:e.title}),o.jsx(Cg,{children:o.jsx(ste,{destinationType:e.type,dataMartStatus:t,onAddReport:d})})]}),o.jsx(oo,{children:o.jsx(ote,{destination:e,dataMartStatus:t,onEditReport:h})}),o.jsx(si,{})]}),o.jsx(XT,{destination:e,isOpen:s,onClose:m,mode:fn.CREATE}),o.jsx(XT,{destination:e,isOpen:l,onClose:g,mode:fn.EDIT,initialReport:c})]}):null}function ste({destinationType:e,dataMartStatus:t,onAddReport:n}){if(e!==It.GOOGLE_SHEETS)return null;const r=(t==null?void 0:t.code)===tr.DRAFT;return o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx("span",{children:o.jsxs(we,{onClick:n,variant:"outline",size:"sm","aria-label":"Add new Google Sheets report",disabled:r,children:[o.jsx(ha,{className:"h-4 w-4"}),"Add Report"]})})}),r&&o.jsx(Mt,{children:o.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function XT({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case It.GOOGLE_SHEETS:return o.jsx(K4,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case It.LOOKER_STUDIO:return o.jsx(Zee,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function ote({destination:e,dataMartStatus:t,onEditReport:n}){switch(e.type){case It.GOOGLE_SHEETS:return o.jsx(Yee,{destination:e,onEditReport:n});case It.LOOKER_STUDIO:return o.jsx(nte,{destination:e,dataMartStatus:t,onEditReport:n});default:return null}}function Z4(){return o.jsx("div",{className:"flex flex-col gap-4",children:o.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>o.jsx("div",{className:"border-border rounded-lg border p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(pr,{className:"h-4 w-4 rounded-full"}),o.jsx(pr,{className:"h-4 w-40"}),o.jsx(pr,{className:"h-3 w-32"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(pr,{className:"h-6 w-16 rounded-full"}),o.jsx(pr,{className:"h-4 w-4"})]})]})},t))})})}function ite(){const{dataMart:e}=Ts(),{fetchReportsByDataMartId:t}=bl(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=Xp(),[l,c]=p.useState(!0);return p.useEffect(()=>{(async()=>{c(!0);try{if(!e)return;await Promise.all([r(),t(e.id)])}catch(h){console.error(h)}finally{c(!1)}})()},[r,t,e]),e?o.jsx("div",{className:"flex flex-col gap-4",children:l||s?o.jsx(Z4,{}):n.length===0?o.jsx(rte,{}):n.map(d=>o.jsx(ate,{destination:d,dataMartStatus:e.status},d.id))}):null}function lte(){return o.jsx(Qp,{children:o.jsx(nA,{children:o.jsx(ite,{})})})}function JT(){return o.jsxs(tl,{children:[o.jsx(so,{children:o.jsx(ao,{icon:VL,tooltip:"Description of the Data Mart",children:"Description"})}),o.jsx(oo,{children:o.jsx(wZ,{})}),o.jsx(si,{})]})}function cte(){const{dataMart:e}=wi();return o.jsxs(tl,{children:[o.jsx(so,{children:o.jsx(ao,{icon:H_,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"})}),o.jsx(oo,{children:o.jsx(Pc,{children:o.jsx(mQ,{children:e&&o.jsx(aX,{dataMartId:e.id})})})}),o.jsx(si,{})]})}function ute(){const e=Zd(),t=n=>{e(`/data-marts/${n.id}/data-setup`)};return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsx("div",{className:"mx-auto my-auto w-lg",children:o.jsxs("div",{className:"dm-card !rounded-xl !p-8",children:[o.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),o.jsx(sS,{children:o.jsx(HA,{children:o.jsx(vZ,{initialData:{title:"New Data Mart"},onSuccess:t})})})]})})})}function Y4({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:l,clearCurrentDataStorage:c}=cg();p.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const d=()=>{c(),t()};return o.jsx(q0,{open:e,onOpenChange:h=>{h||d()},children:o.jsxs(K0,{children:[o.jsxs(Z0,{children:[o.jsx(ng,{children:"Storage Details"}),o.jsx(rg,{children:"View detailed information about this storage."})]}),o.jsx("div",{className:"py-4",children:o.jsx(b$,{dataStorage:s,isLoading:l})})]})})}function jx({column:e,children:t}){return o.jsxs(we,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(bs,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Oa,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(bs,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}const dte=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,l]=p.useState(!1);return o.jsx("div",{className:"text-right",children:o.jsxs(xr,{open:s,onOpenChange:l,children:[o.jsx(br,{asChild:!0,children:o.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:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(cr,{align:"end",children:[o.jsx(Ft,{onClick:()=>t==null?void 0:t(e),className:"dm-card-table-body-row-actiondropdownitem",children:"View details"}),o.jsx(Ft,{onClick:()=>void(n==null?void 0:n(e)),className:"dm-card-table-body-row-actiondropdownitem",children:"Edit"}),o.jsx(Aa,{}),o.jsx(Ft,{onClick:()=>r==null?void 0:r(e),className:"dm-card-table-body-row-actiondropdownitem text-red-600",children:"Delete"})]})]})})};function fte({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(xr,{children:[o.jsx(br,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(Ft,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(vr,{className:"size-3.5"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const hte=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(jx,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(jx,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=Ci.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(jx,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(fte,{table:r}),cell:({row:r})=>o.jsx(dte,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function mte({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(u5,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),o.jsxs(we,{variant:"outline",onClick:e,children:[o.jsx(ha,{className:"h-4 w-4"}),"New Storage"]})]})}function pte({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=bf({columns:e,storageKeyPrefix:"data-storage-list"}),[h,m]=p.useState([]),[g,v]=p.useState({}),[x,b]=p.useState(!1),[w]=p.useState(null),C=Qc({data:t,columns:[...e],getCoreRowModel:Wc(),getPaginationRowModel:tg(),onSortingChange:l,getSortedRowModel:xf(),onColumnFiltersChange:m,getFilteredRowModel:yf(),onColumnVisibilityChange:d,onRowSelectionChange:v,state:{sorting:s,columnFilters:h,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),E=(T,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(T)};return t.length?o.jsxs("div",{children:[w&&o.jsx(Y4,{isOpen:x,onClose:()=>{b(!1)},id:w.id}),o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(vi,{className:"dm-card-toolbar-search-icon"}),o.jsx(zt,{placeholder:"Search by title",value:(R=C.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:T=>{var _;return(_=C.getColumn("title"))==null?void 0:_.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(ha,{className:"h-4 w-4"}),"New Storage"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Xc,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[o.jsx(Jc,{className:"dm-card-table-header",children:C.getHeaderGroups().map(T=>o.jsx(Zn,{className:"dm-card-table-header-row",children:T.headers.map(_=>o.jsx(tu,{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:Lc(_.column.columnDef.header,_.getContext())},_.id))},T.id))}),o.jsx(eu,{className:"dm-card-table-body",children:C.getRowModel().rows.length?C.getRowModel().rows.map(T=>o.jsx(Zn,{"data-state":T.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const O=T.original.id;E(O,_)},children:T.getVisibleCells().map(_=>o.jsx(oa,{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:Lc(_.column.columnDef.cell,_.getContext())},_.id))},T.id)):o.jsx(Zn,{children:o.jsx(oa,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{C.previousPage()},disabled:!C.getCanPreviousPage(),children:"Previous"}),o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{C.nextPage()},disabled:!C.getCanNextPage(),children:"Next"})]})]})]}):o.jsxs("div",{className:"dm-card",children:[o.jsx(ni,{}),o.jsx(mte,{onOpenTypeDialog:r})]})}const gte=({isOpen:e,onClose:t,onSelect:n})=>o.jsx(q0,{open:e,onOpenChange:t,children:o.jsxs(K0,{className:"sm:max-w-sm",children:[o.jsxs(Z0,{children:[o.jsx(ng,{children:"New Storage"}),o.jsx(rg,{children:"Choose the type of storage you want to create"})]}),o.jsx("div",{className:"flex flex-col gap-4 py-4",children:Ci.getAllTypes().map(r=>{const s=r.icon,l=r.status===eo.ACTIVE;return o.jsxs(we,{variant:"outline",className:"flex px-4 py-6",onClick:()=>void n(r.type),disabled:!l,children:[o.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[o.jsx(s,{size:24}),o.jsx("span",{className:"font-medium",children:r.displayName})]}),!l&&o.jsx(Rr,{variant:"secondary",children:"Coming soon"})]},r.type)})})]})}),vte=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=p.useState(e),{dataStorages:s,currentDataStorage:l,clearCurrentDataStorage:c,fetchDataStorages:d,getDataStorageById:h,deleteDataStorage:m,createDataStorage:g}=cg();p.useEffect(()=>{d()},[d]),p.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[x,b]=p.useState(!1),[w,C]=p.useState(!1),[E,R]=p.useState(null),[T,_]=p.useState(!1),[O,A]=p.useState(null),j=async I=>{try{const W=await g(I);v(),W!=null&&W.id&&(await h(W.id),b(!0))}catch(W){console.error("Failed to create storage:",W)}},D=I=>{A(I),_(!0)},k=()=>{_(!1),A(null)},V=async I=>{await h(I),b(!0)},B=I=>{R(I),C(!0)},z=async()=>{if(E)try{await m(E),await d()}catch(I){console.error("Failed to delete storage:",I)}finally{C(!1),R(null)}},J=async()=>{try{b(!1),await d()}catch(I){console.error("Failed to save storage:",I)}},oe=()=>{b(!1),c()},K=s.map(I=>({id:I.id,title:I.title,type:I.type,createdAt:I.createdAt,modifiedAt:I.modifiedAt})),Y=hte({onViewDetails:D,onEdit:V,onDelete:B});return o.jsxs("div",{children:[o.jsx(pte,{columns:Y,data:K,onEdit:V,onOpenTypeDialog:()=>{r(!0)}}),o.jsx(Y4,{isOpen:T,onClose:k,id:O??""}),o.jsx(gte,{isOpen:n,onClose:v,onSelect:j}),o.jsx(IO,{isOpen:x,onClose:oe,dataStorage:l,onSaveSuccess:()=>void J()}),o.jsx(ia,{open:w,onOpenChange:C,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{z()},onCancel:()=>{R(null)},variant:"destructive"})]})},yte=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(sS,{children:o.jsx(vte,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function xte({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(Bb,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),o.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."}),o.jsxs(we,{variant:"outline",onClick:e,children:[o.jsx(ha,{className:"h-4 w-4"}),"New Destination"]})]})}function bte({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var w;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=bf({columns:e,storageKeyPrefix:"data-destination-list"}),[h,m]=p.useState([]),[g,v]=p.useState({}),x=Qc({data:t,columns:[...e],getCoreRowModel:Wc(),getPaginationRowModel:tg(),onSortingChange:l,getSortedRowModel:xf(),onColumnFiltersChange:m,getFilteredRowModel:yf(),onColumnVisibilityChange:d,onRowSelectionChange:v,state:{sorting:s,columnFilters:h,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),b=(C,E)=>{E.target instanceof HTMLElement&&(E.target.closest('[role="checkbox"]')||E.target.closest(".actions-cell")||E.target.closest('[role="menuitem"]'))||n==null||n(C)};return t.length?o.jsx("div",{children:o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(vi,{className:"dm-card-toolbar-search-icon"}),o.jsx(zt,{placeholder:"Search by title",value:(w=x.getColumn("title"))==null?void 0:w.getFilterValue(),onChange:C=>{var E;return(E=x.getColumn("title"))==null?void 0:E.setFilterValue(C.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(ha,{className:"h-4 w-4"}),"New Destination"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Xc,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[o.jsx(Jc,{className:"dm-card-table-header",children:x.getHeaderGroups().map(C=>o.jsx(Zn,{className:"dm-card-table-header-row",children:C.headers.map(E=>o.jsx(tu,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.getSize())}%`},children:E.isPlaceholder?null:Lc(E.column.columnDef.header,E.getContext())},E.id))},C.id))}),o.jsx(eu,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map(C=>o.jsx(Zn,{"data-state":C.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:E=>{const R=C.original.id;b(R,E)},children:C.getVisibleCells().map(E=>o.jsx(oa,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${E.column.id==="actions"?"actions-cell":""} ${E.column.id==="createdAt"?"whitespace-nowrap":""}`,style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.column.getSize())}%`},children:Lc(E.column.columnDef.cell,E.getContext())},E.id))},C.id)):o.jsx(Zn,{children:o.jsx(oa,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.previousPage()},disabled:!x.getCanPreviousPage(),children:"Previous"}),o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.nextPage()},disabled:!x.getCanNextPage(),children:"Next"})]})]})}):o.jsx("div",{className:"dm-card",children:o.jsx(xte,{onOpenTypeDialog:r})})}function Nx({column:e,children:t}){return o.jsxs(we,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(bs,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Oa,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(bs,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}function MS(e){return"deploymentUrl"in e}const Ste=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:l})=>{const[c,d]=p.useState(!1),h=()=>{if(n&&MS(n)){const v=V0(n);navigator.clipboard.writeText(v),ho.success("JSON Config copied to clipboard")}},m=t===It.LOOKER_STUDIO,g=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return o.jsx(o.Fragment,{children:o.jsx("div",{className:"text-right",children:o.jsxs(xr,{open:c,onOpenChange:d,children:[o.jsx(br,{asChild:!0,children:o.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:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(cr,{align:"end",children:[o.jsx(Ft,{onClick:()=>void(r==null?void 0:r(e)),className:"dm-card-table-body-row-actiondropdownitem",children:"Edit"}),m&&g&&o.jsxs(o.Fragment,{children:[o.jsx(Aa,{}),o.jsx(Ft,{onClick:h,className:"dm-card-table-body-row-actiondropdownitem",children:"Copy JSON Config"}),o.jsx(Ft,{onClick:()=>{l==null||l(e)},className:"dm-card-table-body-row-actiondropdownitem",children:"Rotate Secret Key"})]}),o.jsx(Aa,{}),o.jsx(Ft,{onClick:()=>s==null?void 0:s(e),className:"dm-card-table-body-row-actiondropdownitem text-red-600",children:"Delete"})]})]})})})};function Cte({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(xr,{children:[o.jsx(br,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ma,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(cr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(Ft,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(vr,{className:"size-3.5"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const wte=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(Nx,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{className:"overflow-hidden text-ellipsis",children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(Nx,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=Hd.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(Nx,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(Cte,{table:r}),cell:({row:r})=>o.jsx(Ste,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}];function Ete(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"service-account-details",children:[o.jsx(Pn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(Un,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(In,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function Rte({form:e}){const[t,n]=p.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?MO(l):null;return o.jsx(qt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(Kt,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Zt,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&l&&o.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(Yt,{children:!t&&c?o.jsxs(Dt,{children:[o.jsx(Ot,{asChild:!0,children:o.jsx(In,{href:c.url,children:c.email})}),o.jsx(Mt,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx(ui,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(Mn,{children:o.jsx(Ete,{})}),o.jsx(tn,{})]})})}function Tte(){return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Ln,{value:"json-config-details",children:[o.jsx(Pn,{children:"What is the JSON Config for Looker Studio?"}),o.jsxs(Un,{children:[o.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),o.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[o.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),o.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 _te({form:e}){const t=e.getValues("credentials"),n=p.useMemo(()=>MS(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=p.useMemo(()=>V0(n),[n]);return o.jsxs(o.Fragment,{children:[o.jsx(qt,{control:e.control,name:"credentials.deploymentUrl",render:({field:s})=>o.jsxs(Kt,{className:"w-full",children:[o.jsx(Zt,{tooltip:"Enter the deployment URL that the Looker Studio connector will use",children:"Deployment URL"}),o.jsx(Yt,{children:o.jsx(zt,{placeholder:"https://example.com",...s,value:s.value||""})}),o.jsx(Mn,{children:"The deployment URL that the Looker Studio connector will use to access your data"}),o.jsx(tn,{})]})}),n.destinationSecretKey&&o.jsx(qt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>o.jsxs(Kt,{children:[o.jsx(Zt,{children:"JSON Config"}),o.jsx(Yt,{children:o.jsx(S7,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),o.jsx(tn,{}),o.jsx(Mn,{children:o.jsx(Tte,{})})]})})]})}const jte=()=>o.jsxs(Ln,{value:"sheets-api-details",children:[o.jsx(Pn,{children:"How do I enable the Google Sheets API?"}),o.jsxs(Un,{children:[o.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",o.jsx(In,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]}),Nte=()=>o.jsxs(Ln,{value:"looker-studio-details",children:[o.jsx(Pn,{children:"How do I connect to Looker Studio?"}),o.jsxs(Un,{children:[o.jsx("p",{className:"mb-2",children:"To send data to Looker Studio, you need to provide a deployment URL that the Looker Studio connector will use to access your data."}),o.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),o.jsx(In,{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"})]})]}),Ate=()=>o.jsxs(Ln,{value:"odata-details",children:[o.jsx(Pn,{children:"How do I use OData?"}),o.jsxs(Un,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]}),Dte={[It.GOOGLE_SHEETS]:jte,[It.LOOKER_STUDIO]:Nte,[It.ODATA]:Ate};function Ote({destinationType:e}){const t=Dte[e];return o.jsx(rr,{variant:"common",type:"single",collapsible:!0,children:o.jsx(t,{})})}function Mte({form:e,initialData:t}){return o.jsx(qt,{control:e.control,name:"type",render:({field:n})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Select the destination to send your data",children:"Destination Type"}),o.jsxs(ca,{onValueChange:n.onChange,defaultValue:n.value,disabled:!!t,children:[o.jsx(Yt,{children:o.jsx(da,{className:"w-full",children:o.jsx(ua,{placeholder:"Select a destination type"})})}),o.jsx(fa,{children:o.jsx(lg,{children:Hd.getAllTypes().map(({type:r,displayName:s,icon:l,status:c})=>{const d=c===jc.COMING_SOON;return o.jsx(kn,{value:r,disabled:d,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(l,{size:18}),s,d&&o.jsx(Rr,{variant:"secondary",children:c})]})},r)})})})]}),o.jsx(Mn,{children:o.jsx(Ote,{destinationType:n.value})}),o.jsx(tn,{})]})})}function kte({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Ei({resolver:Rl(OB),defaultValues:e??{title:"",type:It.GOOGLE_SHEETS},mode:"onTouched"}),l=s.watch("type");p.useEffect(()=>{r==null||r(s.formState.isDirty)},[s.formState.isDirty,r]);const c=async d=>{const{dirtyFields:h}=s.formState,m=kO(d);return h.credentials||delete m.credentials,t(m)};return o.jsx(Cl,{...s,children:o.jsxs(Ri,{onSubmit:d=>{s.handleSubmit(c)(d)},children:[o.jsxs(wl,{children:[o.jsx(qt,{control:s.control,name:"title",render:({field:d})=>o.jsxs(Kt,{children:[o.jsx(Zt,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),o.jsx(Yt,{children:o.jsx(zt,{placeholder:"Enter title",...d})}),o.jsx(tn,{})]})}),o.jsx(Mte,{form:s,initialData:e}),l===It.GOOGLE_SHEETS&&o.jsx(Rte,{form:s}),l===It.LOOKER_STUDIO&&o.jsx(_te,{form:s})]}),o.jsxs(El,{children:[o.jsxs(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!s.formState.isDirty||s.formState.isSubmitting,children:[s.formState.isSubmitting&&o.jsx(Xd,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),o.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Ite({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r}){const{updateDataDestination:s,createDataDestination:l}=Xp(),[c,d]=p.useState(!1),[h,m]=p.useState(!1),g=p.useCallback(()=>{h?d(!0):t()},[h,t]),v=p.useCallback(()=>{d(!1),m(!1),t()},[t]),x=p.useCallback(w=>{m(w)},[]),b=async w=>{const C=rA.getMapper(w.type);if(n){const E=C.mapToUpdateRequest(w),R=await s(n.id,E);R&&r(R)}else{const E=C.mapToCreateRequest(w);console.log(E);const R=await l(E);R&&r(R)}t()};return o.jsxs(o.Fragment,{children:[o.jsx(yi,{open:e,onOpenChange:w=>{w||g()},children:o.jsxs(xi,{children:[o.jsxs(bi,{children:[o.jsx(vl,{children:"Configure destination"}),o.jsx($c,{children:"Customize settings for your destination"})]}),o.jsx(kte,{initialData:n??void 0,onSubmit:b,onCancel:g,onDirtyChange:x})]})}),o.jsx(ia,{open:c,onOpenChange:d,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:v,variant:"destructive"})]})}const Lte=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:l,getDataDestinationById:c,deleteDataDestination:d,rotateSecretKey:h}=Xp(),m=p.useCallback(()=>{s(),v(!0),t==null||t()},[s,t]),[g,v]=p.useState(!1),[x,b]=p.useState(!1),[w,C]=p.useState(!1),[E,R]=p.useState(null),[T,_]=p.useState(null);p.useEffect(()=>{l()},[l]),p.useEffect(()=>{e&&m()},[e,m]);const O=async oe=>{await c(oe),v(!0)},A=oe=>{R(oe),b(!0)},j=oe=>{_(oe),C(!0)},D=async()=>{if(T)try{const oe=await h(T);if(MS(oe.credentials)){ho.success("New JSON Config copied to clipboard");const K=V0(oe.credentials);navigator.clipboard.writeText(K)}await l()}catch(oe){console.error("Failed to rotate secret key:",oe)}finally{C(!1),_(null)}},k=async()=>{if(E)try{await d(E),await l()}catch(oe){console.error("Failed to delete destination:",oe)}finally{b(!1),R(null)}},V=async()=>{try{v(!1),await l()}catch(oe){console.error("Failed to save destination:",oe)}},B=()=>{v(!1),s()},z=n.map(oe=>({id:oe.id,title:oe.title,type:oe.type,createdAt:oe.createdAt,modifiedAt:oe.modifiedAt,credentials:oe.credentials})),J=wte({onEdit:O,onDelete:A,onRotateSecretKey:j});return o.jsxs("div",{children:[o.jsx(bte,{columns:J,data:z,onEdit:O,onDelete:A,onRotateSecretKey:j,onOpenTypeDialog:m}),o.jsx(Ite,{isOpen:g,onClose:B,dataDestination:r,onSaveSuccess:()=>void V()}),o.jsx(ia,{open:x,onOpenChange:b,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{k()},onCancel:()=>{R(null)},variant:"destructive"}),o.jsx(ia,{open:w,onOpenChange:C,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void D(),onCancel:()=>{C(!1)},variant:"destructive",children:o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),o.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[o.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),o.jsx("li",{children:"Go to your Looker Studio Connector"}),o.jsx("li",{children:"Update the configuration with the new JSON Config"}),o.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),o.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},Pte=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(Qp,{children:o.jsx(Lte,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Ute(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:l=[],isLoading:c}=Ts(),[d,h]=p.useState(!1),[m,g]=p.useState(!0),[v,x]=p.useState(0),[b,w]=p.useState(null),[C,E]=p.useState(Va.STRUCTURED),[R,T]=p.useState(""),_=p.useCallback(async()=>{if(!(t!=null&&t.id))return;const j=await n(t.id,20,0);x(j.length),g(j.length===20)},[t==null?void 0:t.id,n,20]),O=p.useCallback(async()=>{if(!(t!=null&&t.id)||d)return;h(!0);const j=await r(t.id,v,20);x(D=>D+j.length),g(j.length===20),h(!1)},[t==null?void 0:t.id,r,v,d,20]);p.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const A=j=>{w(b===j?null:j)};return c?o.jsx(Z4,{}):o.jsx("div",{className:"flex flex-col gap-4 pb-4",children:l.length===0?o.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):o.jsxs("div",{className:"space-y-2",children:[l.map(j=>o.jsx(J$,{run:j,isExpanded:b===j.id,onToggle:A,logViewType:C,setLogViewType:E,searchTerm:R,setSearchTerm:T,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id},j.id)),m&&o.jsx("div",{className:"flex justify-center pt-4",children:o.jsx(Vd,{variant:"outline",size:"sm",onClick:()=>void O(),disabled:d,className:"flex items-center gap-2",children:d?o.jsxs(o.Fragment,{children:[o.jsx(U_,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}function Fte(){const{dataMart:e,isLoading:t,getDataMartRuns:n}=wi(),r=async()=>{e!=null&&e.id&&await n(e.id,20,0)};return o.jsx("div",{className:"flex flex-col gap-4",children:o.jsxs(tl,{collapsible:!1,name:"run-history",children:[o.jsxs(so,{children:[o.jsx(ao,{icon:N5,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"}),o.jsx(Cg,{children:o.jsxs(we,{variant:"outline",size:"sm",onClick:()=>void r(),disabled:t,className:"flex cursor-pointer items-center gap-2",children:[o.jsx(U_,{className:"h-4 w-4"}),"Refresh"]})})]}),o.jsx(oo,{children:o.jsx(Ute,{})})]})})}const Hte=[{path:"overview",element:o.jsx(JT,{})},{path:"data-setup",element:o.jsx(jee,{})},{path:"reports",element:o.jsx(lte,{})},{path:"triggers",element:o.jsx(cte,{})},{path:"run-history",element:o.jsx(Fte,{})},{index:!0,element:o.jsx(JT,{})}],Vte=[{path:"/",element:o.jsx(e$,{}),children:[{index:!0,element:o.jsx(HI,{to:"/data-marts",replace:!0})},{path:"about",element:o.jsx(t$,{})},{path:"data-marts",element:o.jsx(Nq,{})},{path:"data-marts/create",element:o.jsx(ute,{})},{path:"data-marts/:id",element:o.jsx(_ee,{}),children:Hte},{path:"data-storages",element:o.jsx(yte,{})},{path:"data-destinations",element:o.jsx(Pte,{})},{path:"*",element:o.jsx(n$,{})}]}];function zte(){const e=uL(Vte);return o.jsx(HV,{children:o.jsx(CL,{router:e})})}const W4=document.getElementById("root");if(!W4)throw new Error("Root element not found");hk.createRoot(W4).render(o.jsx(p.StrictMode,{children:o.jsx(zte,{})}));