@zuplo/editor 1.0.28124355979 → 1.0.28135348347
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/static/js/{editor.main-9KBOhT8U.js → editor.main-gzibWb3g.js} +2 -2
- package/dist/client/static/js/{editor.main-9KBOhT8U.js.map → editor.main-gzibWb3g.js.map} +1 -1
- package/dist/client/static/js/{main-BEh0m7Be.js → main-Drc9R0A_.js} +3 -3
- package/dist/client/static/js/{main-BEh0m7Be.js.map → main-Drc9R0A_.js.map} +1 -1
- package/dist/client/static/js/{main.local-C97uAca_.js → main.local-D-vywwLs.js} +14 -14
- package/dist/client/static/js/{main.local-C97uAca_.js.map → main.local-D-vywwLs.js.map} +1 -1
- package/dist/client/static/js/{monaco.contribution-DGCewYX7.js → monaco.contribution-PZSNFXTm.js} +3 -3
- package/dist/client/static/js/{monaco.contribution-DGCewYX7.js.map → monaco.contribution-PZSNFXTm.js.map} +1 -1
- package/dist/client/static/js/{tsMode-SkJEGTfF.js → tsMode-CluuwJTp.js} +2 -2
- package/dist/client/static/js/{tsMode-SkJEGTfF.js.map → tsMode-CluuwJTp.js.map} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/static/js/editor.main-
|
|
2
|
-
import{a as e,i as t,n,r,t as i}from"./chunk-D9Tnb9aB.js";import{t as a}from"./main-BEh0m7Be.js";var o=i((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),s=i(((e,t)=>{t.exports=o()})),c=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),l=i(((e,t)=>{t.exports=c()})),u=i((e=>{var t=s();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=i.p;try{if(c.T=null,i.p=2,e)return e()}finally{c.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),d=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=u()})),f=i((e=>{var t=l(),n=s(),r=d();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(o(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return f(a),e;if(s===r)return f(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=s;break}if(l===r){c=!0,r=a,n=s;break}l=l.sibling}if(!c){for(l=s.child;l;){if(l===n){c=!0,n=s,r=a;break}if(l===r){c=!0,r=s,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},z=[],ee=-1;function te(e){return{current:e}}function ne(e){0>ee||(e.current=z[ee],z[ee]=null,ee--)}function B(e,t){ee++,z[ee]=e.current,e.current=t}var re=te(null),ie=te(null),ae=te(null),oe=te(null);function se(e,t){switch(B(ae,t),B(ie,e),B(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dd(t),e=Od(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ne(re),B(re,e)}function ce(){ne(re),ne(ie),ne(ae)}function le(e){e.memoizedState!==null&&B(oe,e);var t=re.current,n=Od(t,e.type);t!==n&&(B(ie,e),B(re,n))}function ue(e){ie.current===e&&(ne(re),ne(ie)),oe.current===e&&(ne(oe),Ef._currentValue=R)}var de,fe;function pe(e){if(de===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||``,fe=-1<e.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/static/js/editor.main-gzibWb3g.js","/static/js/chunk-D9Tnb9aB.js","/static/js/main-Drc9R0A_.js","/static/js/editor.api2-BgpEDUgR.js","/static/css/editor-DU9oqspw.css","/static/js/workers-BAYC34vF.js","/static/js/monaco.contribution-PZSNFXTm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,n,r,t as i}from"./chunk-D9Tnb9aB.js";import{t as a}from"./main-Drc9R0A_.js";var o=i((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),s=i(((e,t)=>{t.exports=o()})),c=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),l=i(((e,t)=>{t.exports=c()})),u=i((e=>{var t=s();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=i.p;try{if(c.T=null,i.p=2,e)return e()}finally{c.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),d=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=u()})),f=i((e=>{var t=l(),n=s(),r=d();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(o(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return f(a),e;if(s===r)return f(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=s;break}if(l===r){c=!0,r=a,n=s;break}l=l.sibling}if(!c){for(l=s.child;l;){if(l===n){c=!0,n=s,r=a;break}if(l===r){c=!0,r=s,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},z=[],ee=-1;function te(e){return{current:e}}function ne(e){0>ee||(e.current=z[ee],z[ee]=null,ee--)}function B(e,t){ee++,z[ee]=e.current,e.current=t}var re=te(null),ie=te(null),ae=te(null),oe=te(null);function se(e,t){switch(B(ae,t),B(ie,e),B(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dd(t),e=Od(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ne(re),B(re,e)}function ce(){ne(re),ne(ie),ne(ae)}function le(e){e.memoizedState!==null&&B(oe,e);var t=re.current,n=Od(t,e.type);t!==n&&(B(ie,e),B(re,n))}function ue(e){ie.current===e&&(ne(re),ne(ie)),oe.current===e&&(ne(oe),Ef._currentValue=R)}var de,fe;function pe(e){if(de===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||``,fe=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+de+e+fe}var me=!1;function he(e,t){if(!e||me)return``;me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
5
|
`),l=s.split(`
|
|
@@ -93,7 +93,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
93
93
|
`},SSe=0,kw=[];function CSe(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(SSe++)[0],a=g.useState(Sw)[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nxe([e.lockRef.current],(e.shards||[]).map(ySe),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ow(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=dSe(d,u);if(!f)return!0;if(f?l=d:(l=d===`v`?`h`:`v`,f=dSe(d,u)),!f)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return _Se(p,t,e,p===`h`?s:c,!0)},[]),c=g.useCallback(function(e){var n=e;if(!(!kw.length||kw[kw.length-1]!==a)){var r=`deltaY`in n?vSe(n):Ow(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&bSe(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ySe).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=g.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:wSe(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=g.useCallback(function(e){n.current=Ow(e),r.current=void 0},[]),d=g.useCallback(function(t){l(t.type,vSe(t),t.target,s(t,e.lockRef.current))},[]),f=g.useCallback(function(t){l(t.type,Ow(t),t.target,s(t,e.lockRef.current))},[]);g.useEffect(function(){return kw.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Dw),document.addEventListener(`touchmove`,c,Dw),document.addEventListener(`touchstart`,u,Dw),function(){kw=kw.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Dw),document.removeEventListener(`touchmove`,c,Dw),document.removeEventListener(`touchstart`,u,Dw)}},[]);var p=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(a,{styles:xSe(i)}):null,p?g.createElement(oSe,{gapMode:e.gapMode}):null)}function wSe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var TSe=Wxe(Gxe,CSe),Aw=g.forwardRef(function(e,t){return g.createElement(xw,hw({},e,{ref:t,sideCar:TSe}))});Aw.classNames=xw.classNames;var jw=[`Enter`,` `],ESe=[`ArrowDown`,`PageUp`,`Home`],DSe=[`ArrowUp`,`PageDown`,`End`],OSe=[...ESe,...DSe],kSe={ltr:[...jw,`ArrowRight`],rtl:[...jw,`ArrowLeft`]},ASe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Mw=`Menu`,[Nw,jSe,MSe]=yp(Mw),[Pw,NSe]=gp(Mw,[MSe,ew,sw]),Fw=ew(),PSe=sw(),[FSe,Iw]=Pw(Mw),[ISe,Lw]=Pw(Mw),LSe=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Fw(t),[c,l]=g.useState(null),u=g.useRef(!1),d=Tp(a),f=nC(i);return g.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,W.jsx)(nw,{...s,children:(0,W.jsx)(FSe,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,W.jsx)(ISe,{scope:t,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};LSe.displayName=Mw;var RSe=`MenuAnchor`,Rw=g.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Fw(n);return(0,W.jsx)(rw,{...i,...r,ref:t})});Rw.displayName=RSe;var zw=`MenuPortal`,[zSe,BSe]=Pw(zw,{forceMount:void 0}),VSe=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Iw(zw,t);return(0,W.jsx)(zSe,{scope:t,forceMount:n,children:(0,W.jsx)(jp,{present:n||a.open,children:(0,W.jsx)(Ap,{asChild:!0,container:i,children:r})})})};VSe.displayName=zw;var Bw=`MenuContent`,[HSe,Vw]=Pw(Bw),USe=g.forwardRef((e,t)=>{let n=BSe(Bw,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Iw(Bw,e.__scopeMenu),o=Lw(Bw,e.__scopeMenu);return(0,W.jsx)(Nw.Provider,{scope:e.__scopeMenu,children:(0,W.jsx)(jp,{present:r||a.open,children:(0,W.jsx)(Nw.Slot,{scope:e.__scopeMenu,children:o.modal?(0,W.jsx)(WSe,{...i,ref:t}):(0,W.jsx)(GSe,{...i,ref:t})})})})}),WSe=g.forwardRef((e,t)=>{let n=Iw(Bw,e.__scopeMenu),r=g.useRef(null),i=mp(t,r);return g.useEffect(()=>{let e=r.current;if(e)return mw(e)},[]),(0,W.jsx)(Hw,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:fp(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),GSe=g.forwardRef((e,t)=>{let n=Iw(Bw,e.__scopeMenu);return(0,W.jsx)(Hw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),KSe=_p(`MenuContent.ScrollLock`),Hw=g.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,_=Iw(Bw,n),v=Lw(Bw,n),y=Fw(n),b=PSe(n),x=jSe(n),[S,C]=g.useState(null),w=g.useRef(null),T=mp(t,w,_.onContentChange),E=g.useRef(0),D=g.useRef(``),O=g.useRef(0),k=g.useRef(null),A=g.useRef(`right`),j=g.useRef(0),M=m?Aw:g.Fragment,N=m?{as:KSe,allowPinchZoom:!0}:void 0,P=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=SCe(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};g.useEffect(()=>()=>window.clearTimeout(E.current),[]),iC();let F=g.useCallback(e=>A.current===k.current?.side&&wCe(e,k.current?.area),[]);return(0,W.jsx)(HSe,{scope:n,searchRef:D,onItemEnter:g.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:g.useCallback(e=>{F(e)||(w.current?.focus(),C(null))},[F]),onTriggerLeave:g.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:O,onPointerGraceIntentChange:g.useCallback(e=>{k.current=e},[]),children:(0,W.jsx)(M,{...N,children:(0,W.jsx)(sC,{asChild:!0,trapped:i,onMountAutoFocus:fp(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,W.jsx)(Dp,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,W.jsx)(cw,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:fp(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,W.jsx)(fxe,{role:`menu`,"aria-orientation":`vertical`,"data-state":yCe(_.open),"data-radix-menu-content":``,dir:v.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:fp(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&P(e.key));let i=w.current;if(e.target!==i||!OSe.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);DSe.includes(e.key)&&a.reverse(),bCe(a)}),onBlur:fp(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:fp(e.onPointerMove,Zw(e=>{let t=e.target,n=j.current!==e.clientX;e.currentTarget.contains(t)&&n&&(A.current=e.clientX>j.current?`right`:`left`,j.current=e.clientX)}))})})})})})})});USe.displayName=Bw;var qSe=`MenuGroup`,Uw=g.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,W.jsx)(Op.div,{role:`group`,...r,ref:t})});Uw.displayName=qSe;var JSe=`MenuLabel`,YSe=g.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,W.jsx)(Op.div,{...r,ref:t})});YSe.displayName=JSe;var Ww=`MenuItem`,XSe=`menu.itemSelect`,Gw=g.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=g.useRef(null),o=Lw(Ww,e.__scopeMenu),s=Vw(Ww,e.__scopeMenu),c=mp(t,a),l=g.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(XSe,{bubbles:!0,cancelable:!0});e.addEventListener(XSe,e=>r?.(e),{once:!0}),fte(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,W.jsx)(ZSe,{...i,ref:c,disabled:n,onClick:fp(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:fp(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:fp(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||jw.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Gw.displayName=Ww;var ZSe=g.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Vw(Ww,n),s=PSe(n),c=g.useRef(null),l=mp(t,c),[u,d]=g.useState(!1),[f,p]=g.useState(``);return g.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,W.jsx)(Nw.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,W.jsx)(lw,{asChild:!0,...s,focusable:!r,children:(0,W.jsx)(Op.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:fp(e.onPointerMove,Zw(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:fp(e.onPointerLeave,Zw(e=>o.onItemLeave(e))),onFocus:fp(e.onFocus,()=>d(!0)),onBlur:fp(e.onBlur,()=>d(!1))})})})}),QSe=`MenuCheckboxItem`,$Se=g.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,W.jsx)(oCe,{scope:e.__scopeMenu,checked:n,children:(0,W.jsx)(Gw,{role:`menuitemcheckbox`,"aria-checked":Yw(n)?`mixed`:n,...i,ref:t,"data-state":Xw(n),onSelect:fp(i.onSelect,()=>r?.(Yw(n)?!0:!n),{checkForDefaultPrevented:!1})})})});$Se.displayName=QSe;var eCe=`MenuRadioGroup`,[tCe,nCe]=Pw(eCe,{value:void 0,onValueChange:()=>{}}),rCe=g.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Tp(r);return(0,W.jsx)(tCe,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,W.jsx)(Uw,{...i,ref:t})})});rCe.displayName=eCe;var iCe=`MenuRadioItem`,aCe=g.forwardRef((e,t)=>{let{value:n,...r}=e,i=nCe(iCe,e.__scopeMenu),a=n===i.value;return(0,W.jsx)(oCe,{scope:e.__scopeMenu,checked:a,children:(0,W.jsx)(Gw,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Xw(a),onSelect:fp(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});aCe.displayName=iCe;var Kw=`MenuItemIndicator`,[oCe,sCe]=Pw(Kw,{checked:!1}),cCe=g.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=sCe(Kw,n);return(0,W.jsx)(jp,{present:r||Yw(a.checked)||a.checked===!0,children:(0,W.jsx)(Op.span,{...i,ref:t,"data-state":Xw(a.checked)})})});cCe.displayName=Kw;var lCe=`MenuSeparator`,uCe=g.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,W.jsx)(Op.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});uCe.displayName=lCe;var dCe=`MenuArrow`,fCe=g.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Fw(n);return(0,W.jsx)(pxe,{...i,...r,ref:t})});fCe.displayName=dCe;var qw=`MenuSub`,[pCe,mCe]=Pw(qw),hCe=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Iw(qw,t),o=Fw(t),[s,c]=g.useState(null),[l,u]=g.useState(null),d=Tp(i);return g.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,W.jsx)(nw,{...o,children:(0,W.jsx)(FSe,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,W.jsx)(pCe,{scope:t,contentId:lC(),triggerId:lC(),trigger:s,onTriggerChange:c,children:n})})})};hCe.displayName=qw;var Jw=`MenuSubTrigger`,gCe=g.forwardRef((e,t)=>{let n=Iw(Jw,e.__scopeMenu),r=Lw(Jw,e.__scopeMenu),i=mCe(Jw,e.__scopeMenu),a=Vw(Jw,e.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>u,[u]),g.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,W.jsx)(Rw,{asChild:!0,...l,children:(0,W.jsx)(ZSe,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":yCe(n.open),...e,ref:pp(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:fp(e.onPointerMove,Zw(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:fp(e.onPointerLeave,Zw(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:fp(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||kSe[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});gCe.displayName=Jw;var _Ce=`MenuSubContent`,vCe=g.forwardRef((e,t)=>{let n=BSe(Bw,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Iw(Bw,e.__scopeMenu),o=Lw(Bw,e.__scopeMenu),s=mCe(_Ce,e.__scopeMenu),c=g.useRef(null),l=mp(t,c);return(0,W.jsx)(Nw.Provider,{scope:e.__scopeMenu,children:(0,W.jsx)(jp,{present:r||a.open,children:(0,W.jsx)(Nw.Slot,{scope:e.__scopeMenu,children:(0,W.jsx)(Hw,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:fp(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:fp(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:fp(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ASe[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});vCe.displayName=_Ce;function yCe(e){return e?`open`:`closed`}function Yw(e){return e===`indeterminate`}function Xw(e){return Yw(e)?`indeterminate`:e?`checked`:`unchecked`}function bCe(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xCe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function SCe(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=xCe(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function CCe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function wCe(e,t){return t?CCe({x:e.clientX,y:e.clientY},t):!1}function Zw(e){return t=>t.pointerType===`mouse`?e(t):void 0}var TCe=LSe,ECe=Rw,DCe=VSe,OCe=USe,kCe=Uw,ACe=YSe,jCe=Gw,MCe=$Se,NCe=rCe,PCe=aCe,FCe=cCe,ICe=uCe,LCe=fCe,RCe=hCe,zCe=gCe,BCe=vCe,Qw=`DropdownMenu`,[VCe,HCe]=gp(Qw,[NSe]),$w=NSe(),[UCe,WCe]=VCe(Qw),GCe=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$w(t),l=g.useRef(null),[u,d]=Np({prop:i,defaultProp:a??!1,onChange:o,caller:Qw});return(0,W.jsx)(UCe,{scope:t,triggerId:lC(),triggerRef:l,contentId:lC(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,W.jsx)(TCe,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};GCe.displayName=Qw;var KCe=`DropdownMenuTrigger`,qCe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=WCe(KCe,n),o=$w(n);return(0,W.jsx)(ECe,{asChild:!0,...o,children:(0,W.jsx)(Op.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:pp(t,a.triggerRef),onPointerDown:fp(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:fp(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});qCe.displayName=KCe;var JCe=`DropdownMenuPortal`,YCe=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$w(t);return(0,W.jsx)(DCe,{...r,...n})};YCe.displayName=JCe;var XCe=`DropdownMenuContent`,ZCe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=WCe(XCe,n),a=$w(n),o=g.useRef(!1);return(0,W.jsx)(OCe,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:fp(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:fp(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.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)`}})});ZCe.displayName=XCe;var QCe=`DropdownMenuGroup`,$Ce=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(kCe,{...i,...r,ref:t})});$Ce.displayName=QCe;var ewe=`DropdownMenuLabel`,twe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(ACe,{...i,...r,ref:t})});twe.displayName=ewe;var nwe=`DropdownMenuItem`,rwe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(jCe,{...i,...r,ref:t})});rwe.displayName=nwe;var iwe=`DropdownMenuCheckboxItem`,awe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(MCe,{...i,...r,ref:t})});awe.displayName=iwe;var owe=`DropdownMenuRadioGroup`,swe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(NCe,{...i,...r,ref:t})});swe.displayName=owe;var cwe=`DropdownMenuRadioItem`,lwe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(PCe,{...i,...r,ref:t})});lwe.displayName=cwe;var uwe=`DropdownMenuItemIndicator`,dwe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(FCe,{...i,...r,ref:t})});dwe.displayName=uwe;var fwe=`DropdownMenuSeparator`,pwe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(ICe,{...i,...r,ref:t})});pwe.displayName=fwe;var mwe=`DropdownMenuArrow`,hwe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(LCe,{...i,...r,ref:t})});hwe.displayName=mwe;var gwe=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=$w(t),[s,c]=Np({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,W.jsx)(RCe,{...o,open:s,onOpenChange:c,children:n})},_we=`DropdownMenuSubTrigger`,vwe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(zCe,{...i,...r,ref:t})});vwe.displayName=_we;var ywe=`DropdownMenuSubContent`,bwe=g.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$w(n);return(0,W.jsx)(BCe,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});bwe.displayName=ywe;var xwe=GCe,Swe=qCe,Cwe=YCe,wwe=ZCe,Twe=$Ce,Ewe=twe,Dwe=rwe,Owe=awe,kwe=dwe,Awe=pwe,jwe=gwe,Mwe=vwe,Nwe=bwe;function eT({...e}){return(0,W.jsx)(xwe,{"data-slot":`dropdown-menu`,...e})}function tT({...e}){return(0,W.jsx)(Swe,{"data-slot":`dropdown-menu-trigger`,...e})}function nT({className:e,sideOffset:t=4,...n}){return(0,W.jsx)(Cwe,{children:(0,W.jsx)(wwe,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:G(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,e),...n})})}function Pwe({...e}){return(0,W.jsx)(Twe,{"data-slot":`dropdown-menu-group`,...e})}function rT({className:e,inset:t,variant:n=`default`,...r}){return(0,W.jsx)(Dwe,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:G(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r})}function Fwe({className:e,children:t,checked:n,...r}){return(0,W.jsxs)(Owe,{"data-slot":`dropdown-menu-checkbox-item`,className:G(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 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`,e),checked:n,...r,children:[(0,W.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,W.jsx)(kwe,{children:(0,W.jsx)(vm,{className:`size-4`})})}),t]})}function iT({className:e,inset:t,...n}){return(0,W.jsx)(Ewe,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:G(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function aT({className:e,...t}){return(0,W.jsx)(Awe,{"data-slot":`dropdown-menu-separator`,className:G(`bg-border -mx-1 my-1 h-px`,e),...t})}function Iwe({...e}){return(0,W.jsx)(jwe,{"data-slot":`dropdown-menu-sub`,...e})}function Lwe({className:e,inset:t,children:n,...r}){return(0,W.jsxs)(Mwe,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:G(`focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,W.jsx)(bm,{className:`ml-auto size-4`})]})}function Rwe({className:e,...t}){return(0,W.jsx)(Nwe,{"data-slot":`dropdown-menu-sub-content`,className:G(`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] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg`,e),...t})}var zwe=um(``,{variants:{variant:{default:`cursor-pointer text-indigo-600 dark:text-indigo-300 hover:underline`,neutral:`cursor-pointer hover:underline`,ghost:`cursor-pointer hover:no-underline`},showIcon:{true:`inline-flex items-center gap-x-1`}},defaultVariants:{variant:`default`}}),oT=({className:e,variant:t,showIcon:n,children:r,...i})=>(0,W.jsxs)(`a`,{target:`_blank`,rel:`noreferrer`,className:G(zwe({variant:t,showIcon:n,className:e})),...i,children:[r,n&&(0,W.jsx)(Pm,{className:`size-[1em]`})]}),Bwe=(0,g.createContext)({});function Vwe(e){let t=(0,g.useRef)(null);return t.current===null&&(t.current=e()),t.current}var sT=(0,g.createContext)(null),Hwe=(0,g.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Uwe(e=!0){let t=(0,g.useContext)(sT);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,g.useId)();(0,g.useEffect)(()=>{e&&i(a)},[e]);let o=(0,g.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var cT=typeof window<`u`,Wwe=cT?g.useLayoutEffect:g.useEffect,lT=e=>e,uT=lT,dT=lT,fT={skipAnimations:!1,useManualTiming:!1};function Gwe(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var pT=[`read`,`resolveKeyframes`,`update`,`preRender`,`render`,`postRender`],Kwe=40;function qwe(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=pT.reduce((e,t)=>(e[t]=Gwe(a),e),{}),{read:s,resolveKeyframes:c,update:l,preRender:u,render:d,postRender:f}=o,p=()=>{let a=fT.useManualTiming?i.timestamp:performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,Kwe),1),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:pT.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||m(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<pT.length;t++)o[pT[t]].cancel(e)},state:i,steps:o}}var{schedule:mT,cancel:hT,state:gT,steps:_T}=qwe(typeof requestAnimationFrame<`u`?requestAnimationFrame:lT,!0),Jwe=(0,g.createContext)({strict:!1}),Ywe={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},vT={};for(let e in Ywe)vT[e]={isEnabled:t=>Ywe[e].some(e=>!!t[e])};function Xwe(e){for(let t in e)vT[t]={...vT[t],...e[t]}}var Zwe=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function yT(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Zwe.has(e)}function Qwe(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var $we=n((()=>{})),eTe=r({default:()=>nTe}),tTe,nTe,rTe=n((()=>{$we(),tTe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,nTe=Qwe(function(e){return tTe.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),iTe=e=>!yT(e);function aTe(e){e&&(iTe=t=>t.startsWith(`on`)?!yT(t):e(t))}try{aTe((rTe(),t(eTe)).default)}catch{}function oTe(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(iTe(i)||n===!0&&yT(i)||!t&&!yT(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}function sTe(e){if(typeof Proxy>`u`)return e;let t=new Map;return new Proxy((...t)=>e(...t),{get:(n,r)=>r===`create`?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}var bT=(0,g.createContext)({});function xT(e){return typeof e==`string`||Array.isArray(e)}function ST(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}var CT=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],wT=[`initial`,...CT];function TT(e){return ST(e.animate)||wT.some(t=>xT(e[t]))}function cTe(e){return!!(TT(e)||e.variants)}function lTe(e,t){if(TT(e)){let{initial:t,animate:n}=e;return{initial:t===!1||xT(t)?t:void 0,animate:xT(n)?n:void 0}}return e.inherit===!1?{}:t}function uTe(e){let{initial:t,animate:n}=lTe(e,(0,g.useContext)(bT));return(0,g.useMemo)(()=>({initial:t,animate:n}),[dTe(t),dTe(n)])}function dTe(e){return Array.isArray(e)?e.join(` `):e}var fTe=Symbol.for(`motionComponentSymbol`);function ET(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function pTe(e,t,n){return(0,g.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):ET(n)&&(n.current=r))},[t])}var DT=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),mTe=`data-`+DT(`framerAppearId`),{schedule:OT,cancel:hTe}=qwe(queueMicrotask,!1),gTe=(0,g.createContext)({});function _Te(e,t,n,r,i){let{visualElement:a}=(0,g.useContext)(bT),o=(0,g.useContext)(Jwe),s=(0,g.useContext)(sT),c=(0,g.useContext)(Hwe).reducedMotion,l=(0,g.useRef)(null);r||=o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:a,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:c}));let u=l.current,d=(0,g.useContext)(gTe);u&&!u.projection&&i&&(u.type===`html`||u.type===`svg`)&&vTe(l.current,n,i,d);let f=(0,g.useRef)(!1);(0,g.useInsertionEffect)(()=>{u&&f.current&&u.update(n,s)});let p=n[mTe],m=(0,g.useRef)(!!p&&!window.MotionHandoffIsComplete?.call(window,p)&&window.MotionHasOptimisedAnimation?.call(window,p));return Wwe(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),OT.render(u.render),m.current&&u.animationState&&u.animationState.animateChanges())}),(0,g.useEffect)(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&=(queueMicrotask(()=>{var e;(e=window.MotionHandoffMarkAsComplete)==null||e.call(window,p)}),!1))}),u}function vTe(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:yTe(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&ET(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,layoutScroll:c,layoutRoot:l})}function yTe(e){if(e)return e.options.allowProjection===!1?yTe(e.parent):e.projection}function bTe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&Xwe(e);function a(a,o){let s,c={...(0,g.useContext)(Hwe),...a,layoutId:xTe(a)},{isStatic:l}=c,u=uTe(a),d=r(a,l);if(!l&&cT){STe(c,e);let n=CTe(c);s=n.MeasureLayout,u.visualElement=_Te(i,d,c,t,n.ProjectionNode)}return(0,W.jsxs)(bT.Provider,{value:u,children:[s&&u.visualElement?(0,W.jsx)(s,{visualElement:u.visualElement,...c}):null,n(i,a,pTe(d,u.visualElement,o),d,l,u.visualElement)]})}a.displayName=`motion.${typeof i==`string`?i:`create(${i.displayName??i.name??``})`}`;let o=(0,g.forwardRef)(a);return o[fTe]=i,o}function xTe({layoutId:e}){let t=(0,g.useContext)(Bwe).id;return t&&e!==void 0?t+`-`+e:e}function STe(e,t){(0,g.useContext)(Jwe).strict}function CTe(e){let{drag:t,layout:n}=vT;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var wTe=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function kT(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(wTe.indexOf(e)>-1||/[A-Z]/u.test(e))}function TTe(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function AT(e,t,n,r){if(typeof t==`function`){let[i,a]=TTe(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=TTe(r);t=t(n===void 0?e.custom:n,i,a)}return t}var jT=e=>Array.isArray(e),ETe=e=>!!(e&&typeof e==`object`&&e.mix&&e.toValue),DTe=e=>jT(e)?e[e.length-1]||0:e,MT=e=>!!(e&&e.getVelocity);function NT(e){let t=MT(e)?e.get():e;return ETe(t)?t.toValue():t}function OTe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){let o={latestValues:ATe(r,i,a,e),renderState:t()};return n&&(o.onMount=e=>n({props:r,current:e,...o}),o.onUpdate=e=>n(e)),o}var kTe=e=>(t,n)=>{let r=(0,g.useContext)(bT),i=(0,g.useContext)(sT),a=()=>OTe(e,t,r,i);return n?a():Vwe(a)};function ATe(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=NT(a[e]);let{initial:o,animate:s}=e,c=TT(e),l=cTe(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!ST(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=AT(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var PT=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],FT=new Set(PT),jTe=e=>t=>typeof t==`string`&&t.startsWith(e),MTe=jTe(`--`),NTe=jTe(`var(--`),IT=e=>NTe(e)?PTe.test(e.split(`/*`)[0].trim()):!1,PTe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,FTe=(e,t)=>t&&typeof e==`number`?t.transform(e):e,LT=(e,t,n)=>n>t?t:n<e?e:n,RT={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},zT={...RT,transform:e=>LT(0,1,e)},BT={...RT,default:1},VT=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),HT=VT(`deg`),UT=VT(`%`),WT=VT(`px`),ITe=VT(`vh`),LTe=VT(`vw`),RTe={...UT,parse:e=>UT.parse(e)/100,transform:e=>UT.transform(e*100)},zTe={borderWidth:WT,borderTopWidth:WT,borderRightWidth:WT,borderBottomWidth:WT,borderLeftWidth:WT,borderRadius:WT,radius:WT,borderTopLeftRadius:WT,borderTopRightRadius:WT,borderBottomRightRadius:WT,borderBottomLeftRadius:WT,width:WT,maxWidth:WT,height:WT,maxHeight:WT,top:WT,right:WT,bottom:WT,left:WT,padding:WT,paddingTop:WT,paddingRight:WT,paddingBottom:WT,paddingLeft:WT,margin:WT,marginTop:WT,marginRight:WT,marginBottom:WT,marginLeft:WT,backgroundPositionX:WT,backgroundPositionY:WT},BTe={rotate:HT,rotateX:HT,rotateY:HT,rotateZ:HT,scale:BT,scaleX:BT,scaleY:BT,scaleZ:BT,skew:HT,skewX:HT,skewY:HT,distance:WT,translateX:WT,translateY:WT,translateZ:WT,x:WT,y:WT,z:WT,perspective:WT,transformPerspective:WT,opacity:zT,originX:RTe,originY:RTe,originZ:WT},VTe={...RT,transform:Math.round},GT={...zTe,...BTe,zIndex:VTe,size:WT,fillOpacity:zT,strokeOpacity:zT,numOctaves:VTe},HTe={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},UTe=PT.length;function WTe(e,t,n){let r=``,i=!0;for(let a=0;a<UTe;a++){let o=PT[a],s=e[o];if(s===void 0)continue;let c=!0;if(c=typeof s==`number`?s===(o.startsWith(`scale`)?1:0):parseFloat(s)===0,!c||n){let e=FTe(s,GT[o]);if(!c){i=!1;let t=HTe[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function KT(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(FT.has(e)){o=!0;continue}else if(MTe(e)){i[e]=n;continue}else{let t=FTe(n,GT[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=WTe(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var GTe={offset:`stroke-dashoffset`,array:`stroke-dasharray`},KTe={offset:`strokeDashoffset`,array:`strokeDasharray`};function qTe(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?GTe:KTe;e[a.offset]=WT.transform(-r);let o=WT.transform(t),s=WT.transform(n);e[a.array]=`${o} ${s}`}function JTe(e,t,n){return typeof e==`string`?e:WT.transform(t+n*e)}function YTe(e,t,n){return`${JTe(t,e.x,e.width)} ${JTe(n,e.y,e.height)}`}function qT(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:o,pathSpacing:s=1,pathOffset:c=0,...l},u,d){if(KT(e,l,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(i!==void 0||a!==void 0||p.transform)&&(p.transformOrigin=YTe(m,i===void 0?.5:i,a===void 0?.5:a)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&qTe(f,o,s,c,!1)}var JT=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),XTe=()=>({...JT(),attrs:{}}),YT=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function ZTe(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(let t in n)e.style.setProperty(t,n[t])}var QTe=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function $Te(e,t,n,r){ZTe(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(QTe.has(n)?n:DT(n),t.attrs[n])}var XT={};function eEe(e){Object.assign(XT,e)}function tEe(e,{layout:t,layoutId:n}){return FT.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!XT[e]||e===`opacity`)}function ZT(e,t,n){let{style:r}=e,i={};for(let a in r)(MT(r[a])||t.style&&MT(t.style[a])||tEe(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}function nEe(e,t,n){let r=ZT(e,t,n);for(let n in e)if(MT(e[n])||MT(t[n])){let t=PT.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}function rEe(e,t){try{t.dimensions=typeof e.getBBox==`function`?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var iEe=[`x`,`y`,`width`,`height`,`cx`,`cy`,`r`],aEe={useVisualState:kTe({scrapeMotionValuesFromProps:nEe,createRenderState:XTe,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(let e in i)if(FT.has(e)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let n=0;n<iEe.length;n++){let r=iEe[n];e[r]!==t[r]&&(o=!0)}o&&mT.read(()=>{rEe(n,r),mT.render(()=>{qT(r,i,YT(n.tagName),e.transformTemplate),$Te(n,r)})})}})},oEe={useVisualState:kTe({scrapeMotionValuesFromProps:ZT,createRenderState:JT})};function sEe(e,t,n){for(let r in t)!MT(t[r])&&!tEe(r,n)&&(e[r]=t[r])}function cEe({transformTemplate:e},t){return(0,g.useMemo)(()=>{let n=JT();return KT(n,t,e),Object.assign({},n.vars,n.style)},[t])}function lEe(e,t){let n=e.style||{},r={};return sEe(r,n,e),Object.assign(r,cEe(e,t)),r}function uEe(e,t){let n={},r=lEe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function dEe(e,t,n,r){let i=(0,g.useMemo)(()=>{let n=XTe();return qT(n,t,YT(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};sEe(t,e.style,e),i.style={...t,...i.style}}return i}function fEe(e=!1){return(t,n,r,{latestValues:i},a)=>{let o=(kT(t)?dEe:uEe)(n,i,a,t),s=oTe(n,typeof t==`string`,e),c=t===g.Fragment?{}:{...s,...o,ref:r},{children:l}=n,u=(0,g.useMemo)(()=>MT(l)?l.get():l,[l]);return(0,g.createElement)(t,{...c,children:u})}}function pEe(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return bTe({...kT(n)?aEe:oEe,preloadedFeatures:e,useRender:fEe(r),createVisualElement:t,Component:n})}}function mEe(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function QT(e,t,n){let r=e.getProps();return AT(r,t,n===void 0?r.custom:n,e)}function $T(e,t){return e?e[t]||e.default||e:void 0}var hEe=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...PT]),eE;function gEe(){eE=void 0}var tE={now:()=>(eE===void 0&&tE.set(gT.isProcessing||fT.useManualTiming?gT.timestamp:performance.now()),eE),set:e=>{eE=e,queueMicrotask(gEe)}};function nE(e,t){e.indexOf(t)===-1&&e.push(t)}function rE(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var iE=class{constructor(){this.subscriptions=[]}add(e){return nE(this.subscriptions,e),()=>rE(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function _Ee(e,t){return t?1e3/t*e:0}var vEe=30,yEe=e=>!isNaN(parseFloat(e)),bEe={current:void 0},xEe=class{constructor(e,t={}){this.version=`11.18.2`,this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{let n=tE.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=tE.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=yEe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new iE);let n=this.events[e].add(t);return e===`change`?()=>{n(),mT.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return bEe.current&&bEe.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=tE.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>vEe)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,vEe);return _Ee(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function aE(e,t){return new xEe(e,t)}function SEe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,aE(n))}function CEe(e,t){let{transitionEnd:n={},transition:r={},...i}=QT(e,t)||{};i={...i,...n};for(let t in i)SEe(e,t,DTe(i[t]))}function wEe(e){return!!(MT(e)&&e.add)}function oE(e,t){let n=e.getValue(`willChange`);if(wEe(n))return n.add(t)}function TEe(e){return e.props[mTe]}function sE(e){let t;return()=>(t===void 0&&(t=e()),t)}var EEe=sE(()=>window.ScrollTimeline!==void 0),DEe=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>`finished`in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){let n=this.animations.map(n=>{if(EEe()&&n.attachTimeline)return n.attachTimeline(e);if(typeof t==`function`)return t(n)});return()=>{n.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get startTime(){return this.getAll(`startTime`)}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll(`flatten`)}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}},OEe=class extends DEe{then(e,t){return Promise.all(this.animations).then(e).catch(t)}},cE=e=>e*1e3,lE=e=>e/1e3,kEe={current:!1};function uE(e){return typeof e==`function`}function AEe(e,t){e.timeline=t,e.onfinish=null}var dE=e=>Array.isArray(e)&&typeof e[0]==`number`,jEe={linearEasing:void 0};function MEe(e,t){let n=sE(e);return()=>jEe[t]??n()}var fE=MEe(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),pE=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},NEe=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=e(pE(0,i-1,t))+`, `;return`linear(${r.substring(0,r.length-2)})`};function PEe(e){return!!(typeof e==`function`&&fE()||!e||typeof e==`string`&&(e in hE||fE())||dE(e)||Array.isArray(e)&&e.every(PEe))}var mE=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,hE={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:mE([0,.65,.55,1]),circOut:mE([.55,0,1,.45]),backIn:mE([.31,.01,.66,-.59]),backOut:mE([.33,1.53,.69,.99])};function FEe(e,t){if(e)return typeof e==`function`&&fE()?NEe(e,t):dE(e)?mE(e):Array.isArray(e)?e.map(e=>FEe(e,t)||hE.easeOut):hE[e]}var IEe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,LEe=1e-7,REe=12;function zEe(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=IEe(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>LEe&&++s<REe);return o}function gE(e,t,n,r){if(e===t&&n===r)return lT;let i=t=>zEe(t,0,1,e,n);return e=>e===0||e===1?e:IEe(i(e),t,r)}var BEe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,VEe=e=>t=>1-e(1-t),HEe=gE(.33,1.53,.69,.99),_E=VEe(HEe),UEe=BEe(_E),WEe=e=>(e*=2)<1?.5*_E(e):.5*(2-2**(-10*(e-1))),vE=e=>1-Math.sin(Math.acos(e)),GEe=VEe(vE),KEe=BEe(vE),qEe=e=>/^0[^.\s]+$/u.test(e);function JEe(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||qEe(e)}var yE=e=>Math.round(e*1e5)/1e5,bE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function YEe(e){return e==null}var XEe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xE=(e,t)=>n=>!!(typeof n==`string`&&XEe.test(n)&&n.startsWith(e)||t&&!YEe(n)&&Object.prototype.hasOwnProperty.call(n,t)),ZEe=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(bE);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},QEe=e=>LT(0,255,e),SE={...RT,transform:e=>Math.round(QEe(e))},CE={test:xE(`rgb`,`red`),parse:ZEe(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+SE.transform(e)+`, `+SE.transform(t)+`, `+SE.transform(n)+`, `+yE(zT.transform(r))+`)`};function $Ee(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var wE={test:xE(`#`),parse:$Ee,transform:CE.transform},TE={test:xE(`hsl`,`hue`),parse:ZEe(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+UT.transform(yE(t))+`, `+UT.transform(yE(n))+`, `+yE(zT.transform(r))+`)`},EE={test:e=>CE.test(e)||wE.test(e)||TE.test(e),parse:e=>CE.test(e)?CE.parse(e):TE.test(e)?TE.parse(e):wE.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?CE.transform(e):TE.transform(e)},eDe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function tDe(e){return isNaN(e)&&typeof e==`string`&&(e.match(bE)?.length||0)+(e.match(eDe)?.length||0)>0}var nDe=`number`,rDe=`color`,iDe=`var`,aDe=`var(`,oDe="${}",sDe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function DE(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(sDe,e=>(EE.test(e)?(r.color.push(a),i.push(rDe),n.push(EE.parse(e))):e.startsWith(aDe)?(r.var.push(a),i.push(iDe),n.push(e)):(r.number.push(a),i.push(nDe),n.push(parseFloat(e))),++a,oDe)).split(oDe),indexes:r,types:i}}function cDe(e){return DE(e).values}function lDe(e){let{split:t,types:n}=DE(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===nDe?i+=yE(e[a]):t===rDe?i+=EE.transform(e[a]):i+=e[a]}return i}}var uDe=e=>typeof e==`number`?0:e;function dDe(e){let t=cDe(e);return lDe(e)(t.map(uDe))}var OE={test:tDe,parse:cDe,createTransformer:lDe,getAnimatableNone:dDe},fDe=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function pDe(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(bE)||[];if(!r)return e;let i=n.replace(r,``),a=fDe.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var mDe=/\b([a-z-]*)\(.*?\)/gu,kE={...OE,getAnimatableNone:e=>{let t=e.match(mDe);return t?t.map(pDe).join(` `):e}},hDe={...GT,color:EE,backgroundColor:EE,outlineColor:EE,fill:EE,stroke:EE,borderColor:EE,borderTopColor:EE,borderRightColor:EE,borderBottomColor:EE,borderLeftColor:EE,filter:kE,WebkitFilter:kE},AE=e=>hDe[e];function gDe(e,t){let n=AE(e);return n!==kE&&(n=OE),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var _De=new Set([`auto`,`none`,`0`]);function vDe(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!_De.has(t)&&DE(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=gDe(n,i)}var yDe=e=>e===RT||e===WT,bDe=(e,t)=>parseFloat(e.split(`, `)[t]),xDe=(e,t)=>(n,{transform:r})=>{if(r===`none`||!r)return 0;let i=r.match(/^matrix3d\((.+)\)$/u);if(i)return bDe(i[1],t);{let t=r.match(/^matrix\((.+)\)$/u);return t?bDe(t[1],e):0}},SDe=new Set([`x`,`y`,`z`]),CDe=PT.filter(e=>!SDe.has(e));function wDe(e){let t=[];return CDe.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var jE={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:xDe(4,13),y:xDe(5,14)};jE.translateX=jE.x,jE.translateY=jE.y;var ME=new Set,NE=!1,PE=!1;function TDe(){if(PE){let e=Array.from(ME).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=wDe(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{var r;(r=e.getValue(t))==null||r.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}PE=!1,NE=!1,ME.forEach(e=>e.complete()),ME.clear()}function EDe(){ME.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(PE=!0)})}function DDe(){EDe(),TDe()}var FE=class{constructor(e,t,n,r,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ME.add(this),NE||(NE=!0,mT.read(EDe),mT.resolveKeyframes(TDe))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let i=0;i<e.length;i++)if(e[i]===null)if(i===0){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}else e[i]=e[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ME.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ME.delete(this))}resume(){this.isComplete||this.scheduleResolve()}},ODe=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),kDe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ADe(e){let t=kDe.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}var jDe=4;function MDe(e,t,n=1){dT(n<=jDe,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,i]=ADe(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ODe(e)?parseFloat(e):e}return IT(i)?MDe(i,t,n+1):i}var NDe=e=>t=>t.test(e),PDe=[RT,WT,UT,HT,LTe,ITe,{test:e=>e===`auto`,parse:e=>e}],FDe=e=>PDe.find(NDe(e)),IDe=class extends FE{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),IT(r))){let i=MDe(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!hEe.has(n)||e.length!==2)return;let[r,i]=e,a=FDe(r),o=FDe(i);if(a!==o)if(yDe(a)&&yDe(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)JEe(e[t])&&n.push(t);n.length&&vDe(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=jE[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=jE[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},LDe=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(OE.test(e)||e===`0`)&&!e.startsWith(`url(`));function RDe(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function zDe(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=LDe(i,t),s=LDe(a,t);return uT(o===s,`You are trying to animate ${t} from "${i}" to "${a}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${a} via the \`style\` property.`),!o||!s?!1:RDe(e)||(n===`spring`||uE(n))&&r}var BDe=e=>e!==null;function IE(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(BDe),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}var VDe=40,HDe=class{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=tE.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>VDe?this.resolvedAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&DDe(),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=tE.now(),this.hasAttemptedResolve=!0;let{name:n,type:r,velocity:i,delay:a,onComplete:o,onUpdate:s,isGenerator:c}=this.options;if(!c&&!zDe(e,n,r,i))if(kEe.current||!a){s&&s(IE(e,this.options,t)),o&&o(),this.resolveFinishedPromise();return}else this.options.duration=0;let l=this.initPlayback(e,t);l!==!1&&(this._resolved={keyframes:e,finalKeyframe:t,...l},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type=`keyframes`,this.options.ease=`linear`}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}},UDe=2e4;function WDe(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}var LE=(e,t,n)=>e+(t-e)*n;function RE(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function GDe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=RE(s,r,e+1/3),a=RE(s,r,e),o=RE(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function zE(e,t){return n=>n>0?t:e}var BE=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},KDe=[wE,CE,TE],qDe=e=>KDe.find(t=>t.test(e));function JDe(e){let t=qDe(e);if(uT(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===TE&&(n=GDe(n)),n}var YDe=(e,t)=>{let n=JDe(e),r=JDe(t);if(!n||!r)return zE(e,t);let i={...n};return e=>(i.red=BE(n.red,r.red,e),i.green=BE(n.green,r.green,e),i.blue=BE(n.blue,r.blue,e),i.alpha=LE(n.alpha,r.alpha,e),CE.transform(i))},XDe=(e,t)=>n=>t(e(n)),VE=(...e)=>e.reduce(XDe),HE=new Set([`none`,`hidden`]);function ZDe(e,t){return HE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function QDe(e,t){return n=>LE(e,t,n)}function UE(e){return typeof e==`number`?QDe:typeof e==`string`?IT(e)?zE:EE.test(e)?YDe:nOe:Array.isArray(e)?$De:typeof e==`object`?EE.test(e)?YDe:eOe:zE}function $De(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>UE(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function eOe(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=UE(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function tOe(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var nOe=(e,t)=>{let n=OE.createTransformer(t),r=DE(e),i=DE(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?HE.has(e)&&!i.values.length||HE.has(t)&&!r.values.length?ZDe(e,t):VE($De(tOe(r,i),i.values),n):(uT(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),zE(e,t))};function rOe(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?LE(e,t,n):UE(e)(e,t)}var iOe=5;function aOe(e,t,n){let r=Math.max(t-iOe,0);return _Ee(n-e(r),t-r)}var WE={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},GE=.001;function oOe({duration:e=WE.duration,bounce:t=WE.bounce,velocity:n=WE.velocity,mass:r=WE.mass}){let i,a;uT(e<=cE(WE.maxDuration),`Spring duration must be 10 seconds or less`);let o=1-t;o=LT(WE.minDamping,WE.maxDamping,o),e=LT(WE.minDuration,WE.maxDuration,lE(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=KE(t,o),c=Math.exp(-i);return GE-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=KE(t**2,o);return(-i(t)+GE>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-GE+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=cOe(i,a,s);if(e=cE(e),isNaN(c))return{stiffness:WE.stiffness,damping:WE.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var sOe=12;function cOe(e,t,n){let r=n;for(let n=1;n<sOe;n++)r-=e(r)/t(r);return r}function KE(e,t){return e*Math.sqrt(1-t*t)}var lOe=[`duration`,`bounce`],uOe=[`stiffness`,`damping`,`mass`];function dOe(e,t){return t.some(t=>e[t]!==void 0)}function fOe(e){let t={velocity:WE.velocity,stiffness:WE.stiffness,damping:WE.damping,mass:WE.mass,isResolvedFromDuration:!1,...e};if(!dOe(e,uOe)&&dOe(e,lOe))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*LT(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:WE.mass,stiffness:i,damping:a}}else{let n=oOe(e);t={...t,...n,mass:WE.mass},t.isResolvedFromDuration=!0}return t}function pOe(e=WE.visualDuration,t=WE.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=fOe({...n,velocity:-lE(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=lE(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?WE.restSpeed.granular:WE.restSpeed.default,i||=v?WE.restDelta.granular:WE.restDelta.default;let y;if(h<1){let e=KE(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=0;h<1&&(n=e===0?cE(m):aOe(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(WDe(b),UDe),t=NEe(t=>b.next(e*t).value,e,30);return e+`ms `+t}};return b}function mOe({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=pOe({keyframes:[f.value,m(f.value)],velocity:aOe(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}var hOe=gE(.42,0,1,1),gOe=gE(0,0,.58,1),_Oe=gE(.42,0,.58,1),vOe=e=>Array.isArray(e)&&typeof e[0]!=`number`,yOe={linear:lT,easeIn:hOe,easeInOut:_Oe,easeOut:gOe,circIn:vE,circInOut:KEe,circOut:GEe,backIn:_E,backInOut:UEe,backOut:HEe,anticipate:WEe},bOe=e=>{if(dE(e)){dT(e.length===4,`Cubic bezier arrays must contain four numerical values.`);let[t,n,r,i]=e;return gE(t,n,r,i)}else if(typeof e==`string`)return dT(yOe[e]!==void 0,`Invalid easing type '${e}'`),yOe[e];return e};function xOe(e,t,n){let r=[],i=n||rOe,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=VE(Array.isArray(t)?t[n]||lT:t,a)),r.push(a)}return r}function SOe(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(dT(a===t.length,`Both input and output ranges must be the same length`),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=xOe(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=pE(e[r],e[r+1],n);return s[r](i)};return n?t=>l(LT(e[0],e[a-1],t)):l}function COe(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=pE(0,t,r);e.push(LE(n,1,i))}}function wOe(e){let t=[0];return COe(t,e.length-1),t}function TOe(e,t){return e.map(e=>e*t)}function EOe(e,t){return e.map(()=>t||_Oe).splice(0,e.length-1)}function qE({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=vOe(r)?r.map(bOe):bOe(r),a={done:!1,value:t[0]},o=SOe(TOe(n&&n.length===t.length?n:wOe(t),e),t,{ease:Array.isArray(i)?i:EOe(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var DOe=e=>{let t=({timestamp:t})=>e(t);return{start:()=>mT.update(t,!0),stop:()=>hT(t),now:()=>gT.isProcessing?gT.timestamp:tE.now()}},OOe={decay:mOe,inertia:mOe,tween:qE,keyframes:qE,spring:pOe},kOe=e=>e/100,JE=class extends HDe{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState=`running`,this.startTime=null,this.state=`idle`,this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state===`idle`)return;this.teardown();let{onStop:e}=this.options;e&&e()};let{name:t,motionValue:n,element:r,keyframes:i}=this.options;this.resolver=new(r?.KeyframeResolver||FE)(i,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){let{type:t=`keyframes`,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=this.options,o=uE(t)?t:OOe[t]||qE,s,c;o!==qE&&typeof e[0]!=`number`&&(s=VE(kOe,rOe(e[0],e[1])),e=[0,100]);let l=o({...this.options,keyframes:e});i===`mirror`&&(c=o({...this.options,keyframes:[...e].reverse(),velocity:-a})),l.calculatedDuration===null&&(l.calculatedDuration=WDe(l));let{calculatedDuration:u}=l,d=u+r,f=d*(n+1)-r;return{generator:l,mirroredGenerator:c,mapPercentToKeyframes:s,calculatedDuration:u,resolvedDuration:d,totalDuration:f}}onPostResolved(){let{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState===`paused`||!e?this.pause():this.state=this.pendingPlayState}tick(e,t=!1){let{resolved:n}=this;if(!n){let{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}let{finalKeyframe:r,generator:i,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:s,calculatedDuration:c,totalDuration:l,resolvedDuration:u}=n;if(this.startTime===null)return i.next(0);let{delay:d,repeat:f,repeatType:p,repeatDelay:m,onUpdate:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-l/this.speed,this.startTime)),t?this.currentTime=e:this.holdTime===null?this.currentTime=Math.round(e-this.startTime)*this.speed:this.currentTime=this.holdTime;let g=this.currentTime-d*(this.speed>=0?1:-1),_=this.speed>=0?g<0:g>l;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=l);let v=this.currentTime,y=i;if(f){let e=Math.min(this.currentTime,l)/u,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,f+1),t%2&&(p===`reverse`?(n=1-n,m&&(n-=m/u)):p===`mirror`&&(y=a)),v=LT(0,1,n)*u}let b=_?{done:!1,value:s[0]}:y.next(v);o&&(b.value=o(b.value));let{done:x}=b;!_&&c!==null&&(x=this.speed>=0?this.currentTime>=l:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&r!==void 0&&(b.value=IE(s,this.options,r)),h&&h(b.value),S&&this.finish(),b}get duration(){let{resolved:e}=this;return e?lE(e.calculatedDuration):0}get time(){return lE(this.currentTime)}set time(e){e=cE(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=lE(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState=`running`;return}if(this.isStopped)return;let{driver:e=DOe,onPlay:t,startTime:n}=this.options;this.driver||=e(e=>this.tick(e)),t&&t();let r=this.driver.now();this.holdTime===null?this.startTime?this.state===`finished`&&(this.startTime=r):this.startTime=n??this.calcStartTime():this.startTime=r-this.holdTime,this.state===`finished`&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state=`running`,this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState=`paused`;return}this.state=`paused`,this.holdTime=this.currentTime??0}complete(){this.state!==`running`&&this.play(),this.pendingPlayState=this.state=`finished`,this.holdTime=null}finish(){this.teardown(),this.state=`finished`;let{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state=`idle`,this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}},AOe=new Set([`opacity`,`clipPath`,`filter`,`transform`]);function jOe(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeInOut`,times:c}={}){let l={[t]:n};c&&(l.offset=c);let u=FEe(s,i);return Array.isArray(u)&&(l.easing=u),e.animate(l,{delay:r,duration:i,easing:Array.isArray(u)?`linear`:u,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`})}var MOe=sE(()=>Object.hasOwnProperty.call(Element.prototype,`animate`)),YE=10,NOe=2e4;function POe(e){return uE(e.type)||e.type===`spring`||!PEe(e.ease)}function FOe(e,t){let n=new JE({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},i=[],a=0;for(;!r.done&&a<NOe;)r=n.sample(a),i.push(r.value),a+=YE;return{times:void 0,keyframes:i,duration:a-YE,ease:`linear`}}var IOe={anticipate:WEe,backInOut:UEe,circInOut:KEe};function LOe(e){return e in IOe}var ROe=class extends HDe{constructor(e){super(e);let{name:t,motionValue:n,element:r,keyframes:i}=this.options;this.resolver=new IDe(i,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:r,ease:i,type:a,motionValue:o,name:s,startTime:c}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof i==`string`&&fE()&&LOe(i)&&(i=IOe[i]),POe(this.options)){let{onComplete:t,onUpdate:o,motionValue:s,element:c,...l}=this.options,u=FOe(e,l);e=u.keyframes,e.length===1&&(e[1]=e[0]),n=u.duration,r=u.times,i=u.ease,a=`keyframes`}let l=jOe(o.owner.current,s,e,{...this.options,duration:n,times:r,ease:i});return l.startTime=c??this.calcStartTime(),this.pendingTimeline?(AEe(l,this.pendingTimeline),this.pendingTimeline=void 0):l.onfinish=()=>{let{onComplete:n}=this.options;o.set(IE(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:l,duration:n,times:r,type:a,ease:i,keyframes:e}}get duration(){let{resolved:e}=this;if(!e)return 0;let{duration:t}=e;return lE(t)}get time(){let{resolved:e}=this;if(!e)return 0;let{animation:t}=e;return lE(t.currentTime||0)}set time(e){let{resolved:t}=this;if(!t)return;let{animation:n}=t;n.currentTime=cE(e)}get speed(){let{resolved:e}=this;if(!e)return 1;let{animation:t}=e;return t.playbackRate}set speed(e){let{resolved:t}=this;if(!t)return;let{animation:n}=t;n.playbackRate=e}get state(){let{resolved:e}=this;if(!e)return`idle`;let{animation:t}=e;return t.playState}get startTime(){let{resolved:e}=this;if(!e)return null;let{animation:t}=e;return t.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{let{resolved:t}=this;if(!t)return lT;let{animation:n}=t;AEe(n,e)}return lT}play(){if(this.isStopped)return;let{resolved:e}=this;if(!e)return;let{animation:t}=e;t.playState===`finished`&&this.updateFinishedPromise(),t.play()}pause(){let{resolved:e}=this;if(!e)return;let{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state===`idle`)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:e}=this;if(!e)return;let{animation:t,keyframes:n,duration:r,type:i,ease:a,times:o}=e;if(t.playState===`idle`||t.playState===`finished`)return;if(this.time){let{motionValue:e,onUpdate:t,onComplete:s,element:c,...l}=this.options,u=new JE({...l,keyframes:n,duration:r,type:i,ease:a,times:o,isGenerator:!0}),d=cE(this.time);e.setWithVelocity(u.sample(d-YE).value,u.sample(d).value,YE)}let{onStop:s}=this.options;s&&s(),this.cancel()}complete(){let{resolved:e}=this;e&&e.animation.finish()}cancel(){let{resolved:e}=this;e&&e.animation.cancel()}static supports(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!t||!t.owner||!(t.owner.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return MOe()&&n&&AOe.has(n)&&!s&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}},zOe={type:`spring`,stiffness:500,damping:25,restSpeed:10},BOe=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),VOe={type:`keyframes`,duration:.8},HOe={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},UOe=(e,{keyframes:t})=>t.length>2?VOe:FT.has(e)?e.startsWith(`scale`)?BOe(t[1]):zOe:HOe;function WOe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var XE=(e,t,n,r={},i,a)=>o=>{let s=$T(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=cE(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};WOe(s)||(u={...u,...UOe(e,u)}),u.duration&&=cE(u.duration),u.repeatDelay&&=cE(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),(kEe.current||fT.skipAnimations)&&(d=!0,u.duration=0,u.delay=0),d&&!a&&t.get()!==void 0){let e=IE(u.keyframes,s);if(e!==void 0)return mT.update(()=>{u.onUpdate(e),u.onComplete()}),new OEe([])}return!a&&ROe.supports(u)?new ROe(u):new JE(u)};function GOe({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function KOe(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t;r&&(a=r);let c=[],l=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||l&&GOe(l,t))continue;let o={delay:n,...$T(a||{},t)},u=!1;if(window.MotionHandoffAnimation){let n=TEe(e);if(n){let e=window.MotionHandoffAnimation(n,t,mT);e!==null&&(o.startTime=e,u=!0)}}oE(e,t),r.start(XE(t,r,i,e.shouldReduceMotion&&hEe.has(t)?{type:!1}:o,e,u));let d=r.animation;d&&c.push(d)}return o&&Promise.all(c).then(()=>{mT.update(()=>{o&&CEe(e,o)})}),c}function ZE(e,t,n={}){let r=QT(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(KOe(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return qOe(e,t,a+r,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function qOe(e,t,n=0,r=0,i=1,a){let o=[],s=(e.variantChildren.size-1)*r,c=i===1?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(JOe).forEach((e,r)=>{e.notify(`AnimationStart`,t),o.push(ZE(e,t,{...a,delay:n+c(r)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(o)}function JOe(e,t){return e.sortNodePosition(t)}function YOe(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>ZE(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=ZE(e,t,n);else{let i=typeof t==`function`?QT(e,t,n.custom):t;r=Promise.all(KOe(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var XOe=wT.length;function ZOe(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&ZOe(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<XOe;n++){let r=wT[n],i=e.props[r];(xT(i)||i===!1)&&(t[r]=i)}return t}var QOe=[...CT].reverse(),$Oe=CT.length;function eke(e){return t=>Promise.all(t.map(({animation:t,options:n})=>YOe(e,t,n)))}function tke(e){let t=eke(e),n=rke(),r=!0,i=t=>(n,r)=>{let i=QT(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=ZOe(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<$Oe;t++){let f=QOe[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=xT(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||ST(m)||typeof m==`boolean`)continue;let v=nke(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:C={}}=p,w={...C,...S},T=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in w){let t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=jT(t)&&jT(n)?!mEe(t,n):t!==n,r?t==null?l.add(e):T(e):t!==void 0&&l.has(e)?T(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1),y&&(!(_&&v)||b)&&c.push(...x.map(e=>({animation:e,options:{type:f}})))}if(l.size){let t={};l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){var i;if(n[t].isActive===r)return Promise.resolve();(i=e.variantChildren)==null||i.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let a=o(t);for(let e in n)n[e].protectedKeys={};return a}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=rke(),r=!0}}}function nke(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!mEe(t,e):!1}function QE(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function rke(){return{animate:QE(!0),whileInView:QE(),whileHover:QE(),whileTap:QE(),whileDrag:QE(),whileFocus:QE(),exit:QE()}}var $E=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},ike=class extends $E{constructor(e){super(e),e.animationState||=tke(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();ST(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}},ake=0,oke={animation:{Feature:ike},exit:{Feature:class extends $E{constructor(){super(...arguments),this.id=ake++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},eD={x:!1,y:!1};function ske(){return eD.x||eD.y}function cke(e){return e===`x`||e===`y`?eD[e]?null:(eD[e]=!0,()=>{eD[e]=!1}):eD.x||eD.y?null:(eD.x=eD.y=!0,()=>{eD.x=eD.y=!1})}var tD=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function nD(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function rD(e){return{point:{x:e.pageX,y:e.pageY}}}var lke=e=>t=>tD(t)&&e(t,rD(t));function iD(e,t,n,r){return nD(e,t,lke(n),r)}var uke=(e,t)=>Math.abs(e-t);function dke(e,t){let n=uke(e.x,t.x),r=uke(e.y,t.y);return Math.sqrt(n**2+r**2)}var fke=class{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=oD(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=dke(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=gT;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=aD(t,this.transformPagePoint),mT.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=oD(e.type===`pointercancel`?this.lastMoveEventInfo:aD(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!tD(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;let a=aD(rD(e),this.transformPagePoint),{point:o}=a,{timestamp:s}=gT;this.history=[{...o,timestamp:s}];let{onSessionStart:c}=t;c&&c(e,oD(a,this.history)),this.removeListeners=VE(iD(this.contextWindow,`pointermove`,this.handlePointerMove),iD(this.contextWindow,`pointerup`,this.handlePointerUp),iD(this.contextWindow,`pointercancel`,this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),hT(this.updatePoint)}};function aD(e,t){return t?{point:t(e.point)}:e}function pke(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oD({point:e},t){return{point:e,delta:pke(e,hke(t)),offset:pke(e,mke(t)),velocity:gke(t,.1)}}function mke(e){return e[0]}function hke(e){return e[e.length-1]}function gke(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=hke(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>cE(t)));)n--;if(!r)return{x:0,y:0};let a=lE(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var _ke=1e-4,vke=1-_ke,yke=1+_ke,bke=.01,xke=0-bke,Ske=0+bke;function sD(e){return e.max-e.min}function Cke(e,t,n){return Math.abs(e-t)<=n}function wke(e,t,n,r=.5){e.origin=r,e.originPoint=LE(t.min,t.max,e.origin),e.scale=sD(n)/sD(t),e.translate=LE(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vke&&e.scale<=yke||isNaN(e.scale))&&(e.scale=1),(e.translate>=xke&&e.translate<=Ske||isNaN(e.translate))&&(e.translate=0)}function cD(e,t,n,r){wke(e.x,t.x,n.x,r?r.originX:void 0),wke(e.y,t.y,n.y,r?r.originY:void 0)}function Tke(e,t,n){e.min=n.min+t.min,e.max=e.min+sD(t)}function Eke(e,t,n){Tke(e.x,t.x,n.x),Tke(e.y,t.y,n.y)}function Dke(e,t,n){e.min=t.min-n.min,e.max=e.min+sD(t)}function lD(e,t,n){Dke(e.x,t.x,n.x),Dke(e.y,t.y,n.y)}function Oke(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?LE(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?LE(n,e,r.max):Math.min(e,n)),e}function kke(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Ake(e,{top:t,left:n,bottom:r,right:i}){return{x:kke(e.x,n,i),y:kke(e.y,t,r)}}function jke(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Mke(e,t){return{x:jke(e.x,t.x),y:jke(e.y,t.y)}}function Nke(e,t){let n=.5,r=sD(e),i=sD(t);return i>r?n=pE(t.min,t.max-r,e.min):r>i&&(n=pE(e.min,e.max-i,t.min)),LT(0,1,n)}function Pke(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var uD=.35;function Fke(e=uD){return e===!1?e=0:e===!0&&(e=uD),{x:Ike(e,`left`,`right`),y:Ike(e,`top`,`bottom`)}}function Ike(e,t,n){return{min:Lke(e,t),max:Lke(e,n)}}function Lke(e,t){return typeof e==`number`?e:e[t]||0}var Rke=()=>({translate:0,scale:1,origin:0,originPoint:0}),dD=()=>({x:Rke(),y:Rke()}),zke=()=>({min:0,max:0}),fD=()=>({x:zke(),y:zke()});function pD(e){return[e(`x`),e(`y`)]}function Bke({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Vke({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Hke(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function mD(e){return e===void 0||e===1}function hD({scale:e,scaleX:t,scaleY:n}){return!mD(e)||!mD(t)||!mD(n)}function gD(e){return hD(e)||Uke(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Uke(e){return Wke(e.x)||Wke(e.y)}function Wke(e){return e&&e!==`0%`}function _D(e,t,n){return n+t*(e-n)}function Gke(e,t,n,r,i){return i!==void 0&&(e=_D(e,i,r)),_D(e,n,r)+t}function vD(e,t=0,n=1,r,i){e.min=Gke(e.min,t,n,r,i),e.max=Gke(e.max,t,n,r,i)}function Kke(e,{x:t,y:n}){vD(e.x,t.translate,t.scale,t.originPoint),vD(e.y,n.translate,n.scale,n.originPoint)}var qke=.999999999999,Jke=1.0000000000001;function Yke(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&bD(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Kke(e,o)),r&&gD(a.latestValues)&&bD(e,a.latestValues))}t.x<Jke&&t.x>qke&&(t.x=1),t.y<Jke&&t.y>qke&&(t.y=1)}function yD(e,t){e.min+=t,e.max+=t}function Xke(e,t,n,r,i=.5){vD(e,t,n,LE(e.min,e.max,i),r)}function bD(e,t){Xke(e.x,t.x,t.scaleX,t.scale,t.originX),Xke(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zke(e,t){return Bke(Hke(e.getBoundingClientRect(),t))}function Qke(e,t,n){let r=Zke(e,n),{scroll:i}=t;return i&&(yD(r.x,i.offset.x),yD(r.y,i.offset.y)),r}var $ke=({current:e})=>e?e.ownerDocument.defaultView:null,eAe=new WeakMap,tAe=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fD(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){let{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;let r=e=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(rD(e).point)},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=cke(n),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pD(e=>{let t=this.getAxisMotionValue(e).get()||0;if(UT.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=sD(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&mT.postRender(()=>i(e,t)),oE(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},a=(e,t)=>{let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=nAe(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},o=(e,t)=>this.stop(e,t),s=()=>pD(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new fke(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:$ke(this.visualElement)})}stop(e,t){let n=this.isDragging;if(this.cancel(),!n)return;let{velocity:r}=t;this.startAnimation(r);let{onDragEnd:i}=this.getProps();i&&mT.postRender(()=>i(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!xD(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Oke(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&ET(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Ake(n.layoutBox,e):this.constraints=!1,this.elastic=Fke(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&pD(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Pke(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!ET(e))return!1;let n=e.current;dT(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Qke(n,r.root,this.visualElement.getTransformPagePoint()),a=Mke(r.layout.layoutBox,i);if(t){let e=t(Vke(a));this.hasMutatedConstraints=!!e,e&&(a=Bke(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=pD(o=>{if(!xD(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return oE(this.visualElement,e),n.start(XE(e,n,0,t,this.visualElement,!1))}stopAnimation(){pD(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){pD(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){pD(t=>{let{drag:n}=this.getProps();if(!xD(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t];i.set(e[t]-LE(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ET(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};pD(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Nke({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),pD(t=>{if(!xD(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(LE(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;eAe.set(this.visualElement,this);let e=this.visualElement.current,t=iD(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();ET(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),mT.read(n);let a=nD(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(pD(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=uD,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function xD(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function nAe(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var rAe=class extends $E{constructor(e){super(e),this.removeGroupControls=lT,this.removeListeners=lT,this.controls=new tAe(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||lT}unmount(){this.removeGroupControls(),this.removeListeners()}},iAe=e=>(t,n)=>{e&&mT.postRender(()=>e(t,n))},aAe=class extends $E{constructor(){super(...arguments),this.removePointerDownListener=lT}onPointerDown(e){this.session=new fke(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$ke(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:iAe(e),onStart:iAe(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&mT.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=iD(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},SD={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function oAe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var CD={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(WT.test(e))e=parseFloat(e);else return e;return`${oAe(e,t.target.x)}% ${oAe(e,t.target.y)}%`}},sAe={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=OE.parse(e);if(i.length>5)return r;let a=OE.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=LE(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},cAe=class extends g.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;eEe(uAe),i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),SD.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,a=n.projection;return a?(a.isPresent=i,r||e.layoutDependency!==t||t===void 0?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||mT.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),OT.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function lAe(e){let[t,n]=Uwe(),r=(0,g.useContext)(Bwe);return(0,W.jsx)(cAe,{...e,layoutGroup:r,switchLayoutGroup:(0,g.useContext)(gTe),isPresent:t,safeToRemove:n})}var uAe={borderRadius:{...CD,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:CD,borderTopRightRadius:CD,borderBottomLeftRadius:CD,borderBottomRightRadius:CD,boxShadow:sAe};function dAe(e,t,n){let r=MT(e)?e:aE(e);return r.start(XE(``,r,t,n)),r.animation}function fAe(e){return e instanceof SVGElement&&e.tagName!==`svg`}var pAe=(e,t)=>e.depth-t.depth,mAe=class{constructor(){this.children=[],this.isDirty=!1}add(e){nE(this.children,e),this.isDirty=!0}remove(e){rE(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(pAe),this.isDirty=!1,this.children.forEach(e)}};function hAe(e,t){let n=tE.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(hT(r),e(a-t))};return mT.read(r,!0),()=>hT(r)}var gAe=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],_Ae=gAe.length,vAe=e=>typeof e==`string`?parseFloat(e):e,yAe=e=>typeof e==`number`||WT.test(e);function bAe(e,t,n,r,i,a){i?(e.opacity=LE(0,n.opacity===void 0?1:n.opacity,SAe(r)),e.opacityExit=LE(t.opacity===void 0?1:t.opacity,0,CAe(r))):a&&(e.opacity=LE(t.opacity===void 0?1:t.opacity,n.opacity===void 0?1:n.opacity,r));for(let i=0;i<_Ae;i++){let a=`border${gAe[i]}Radius`,o=xAe(t,a),s=xAe(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||yAe(o)===yAe(s)?(e[a]=Math.max(LE(vAe(o),vAe(s),r),0),(UT.test(s)||UT.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=LE(t.rotate||0,n.rotate||0,r))}function xAe(e,t){return e[t]===void 0?e.borderRadius:e[t]}var SAe=wAe(0,.5,GEe),CAe=wAe(.5,.95,lT);function wAe(e,t,n){return r=>r<e?0:r>t?1:n(pE(e,t,r))}function TAe(e,t){e.min=t.min,e.max=t.max}function wD(e,t){TAe(e.x,t.x),TAe(e.y,t.y)}function EAe(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function DAe(e,t,n,r,i){return e-=t,e=_D(e,1/n,r),i!==void 0&&(e=_D(e,1/i,r)),e}function OAe(e,t=0,n=1,r=.5,i,a=e,o=e){if(UT.test(t)&&(t=parseFloat(t),t=LE(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=LE(a.min,a.max,r);e===a&&(s-=t),e.min=DAe(e.min,t,n,s,i),e.max=DAe(e.max,t,n,s,i)}function kAe(e,t,[n,r,i],a,o){OAe(e,t[n],t[r],t[i],t.scale,a,o)}var AAe=[`x`,`scaleX`,`originX`],jAe=[`y`,`scaleY`,`originY`];function MAe(e,t,n,r){kAe(e.x,t,AAe,n?n.x:void 0,r?r.x:void 0),kAe(e.y,t,jAe,n?n.y:void 0,r?r.y:void 0)}function NAe(e){return e.translate===0&&e.scale===1}function PAe(e){return NAe(e.x)&&NAe(e.y)}function FAe(e,t){return e.min===t.min&&e.max===t.max}function IAe(e,t){return FAe(e.x,t.x)&&FAe(e.y,t.y)}function LAe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function RAe(e,t){return LAe(e.x,t.x)&&LAe(e.y,t.y)}function TD(e){return sD(e.x)/sD(e.y)}function ED(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var zAe=class{constructor(){this.members=[]}add(e){nE(this.members,e),e.scheduleRender()}remove(e){if(rE(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function BAe(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var DD={type:`projectionFrame`,totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},OD=typeof window<`u`&&window.MotionDebug!==void 0,kD=[``,`X`,`Y`,`Z`],VAe={visibility:`hidden`},AD=1e3,HAe=0;function jD(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function MD(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=TEe(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,mT,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&MD(r)}function ND({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=HAe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,OD&&(DD.totalNodes=DD.resolvedTargetDeltas=DD.recalculatedProjection=0),this.nodes.forEach(GAe),this.nodes.forEach(XAe),this.nodes.forEach(ZAe),this.nodes.forEach(KAe),OD&&window.MotionDebug.record(DD)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new mAe)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new iE),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=fAe(t),this.instance=t;let{layoutId:r,layout:i,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||r)&&(this.isLayoutDirty=!0),e){let n,r=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=hAe(r,250),SD.hasAnimatedSinceResize&&(SD.hasAnimatedSinceResize=!1,this.nodes.forEach(FD))})}r&&this.root.registerSharedNode(r,this),this.options.animate!==!1&&a&&(r||i)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let i=this.options.transition||a.getDefaultTransition()||nje,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=a.getProps(),c=!this.targetLayout||!RAe(this.targetLayout,r)||n,l=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,l);let t={...$T(i,`layout`),onPlay:o,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||FD(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,hT(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(QAe),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&MD(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(PD);return}this.isUpdating||this.nodes.forEach(JAe),this.isUpdating=!1,this.nodes.forEach(YAe),this.nodes.forEach(UAe),this.nodes.forEach(WAe),this.clearAllSnapshots();let e=tE.now();gT.delta=LT(0,1e3/60,e-gT.timestamp),gT.timestamp=e,gT.isProcessing=!0,_T.update.process(gT),_T.preRender.process(gT),_T.render.process(gT),gT.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,OT.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qAe),this.sharedNodes.forEach($Ae)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,mT.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){mT.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected=fD(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!PAe(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&(t||gD(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),rje(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return fD();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ije))){let{scroll:e}=this.root;e&&(yD(t.x,e.offset.x),yD(t.y,e.offset.y))}return t}removeElementScroll(e){let t=fD();if(wD(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&wD(t,e),yD(t.x,i.offset.x),yD(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=fD();wD(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&bD(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),gD(r.latestValues)&&bD(n,r.latestValues)}return gD(this.latestValues)&&bD(n,this.latestValues),n}removeTransform(e){let t=fD();wD(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!gD(n.latestValues))continue;hD(n.latestValues)&&n.updateSnapshot();let r=fD();wD(r,n.measurePageBox()),MAe(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return gD(this.latestValues)&&MAe(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==gT.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!(!this.layout||!(r||i))){if(this.resolvedRelativeTargetAt=gT.timestamp,!this.targetDelta&&!this.relativeTarget){let e=this.getClosestProjectingParent();e&&e.layout&&this.animationProgress!==1?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fD(),this.relativeTargetOrigin=fD(),lD(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),wD(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=fD(),this.targetWithTransforms=fD()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Eke(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):wD(this.target,this.layout.layoutBox),Kke(this.target,this.targetDelta)):wD(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&this.animationProgress!==1?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fD(),this.relativeTargetOrigin=fD(),lD(this.relativeTargetOrigin,this.target,e.target),wD(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}OD&&DD.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||hD(this.parent.latestValues)||Uke(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===gT.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;wD(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Yke(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=fD());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(EAe(this.prevProjectionDelta.x,this.projectionDelta.x),EAe(this.prevProjectionDelta.y,this.projectionDelta.y)),cD(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!ED(this.projectionDelta.x,this.prevProjectionDelta.x)||!ED(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),OD&&DD.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if((t=this.options.visualElement)==null||t.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=dD(),this.projectionDelta=dD(),this.projectionDeltaWithTransform=dD()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=dD();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=fD(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(tje));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;ID(a.x,e.x,n),ID(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(lD(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),eje(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&IAe(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=fD(),wD(d,this.relativeTarget)),s&&(this.animationValues=i,bAe(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&=(hT(this.pendingAnimation),void 0),this.pendingAnimation=mT.update(()=>{SD.hasAnimatedSinceResize=!0,this.currentAnimation=dAe(0,AD,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(AD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&VD(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||fD();let t=sD(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=sD(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}wD(t,n),bD(t,i),cD(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new zAe),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&jD(`z`,e,r,this.animationValues);for(let t=0;t<kD.length;t++)jD(`rotate${kD[t]}`,e,r,this.animationValues),jD(`skew${kD[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}getProjectionStyles(e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return VAe;let t={visibility:``},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.opacity=``,t.pointerEvents=NT(e?.pointerEvents)||``,t.transform=n?n(this.latestValues,``):`none`,t;let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){let t={};return this.options.layoutId&&(t.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,t.pointerEvents=NT(e?.pointerEvents)||``),this.hasProjected&&!gD(this.latestValues)&&(t.transform=n?n({},``):`none`,this.hasProjected=!1),t}let i=r.animationValues||r.latestValues;this.applyTransformsToTarget(),t.transform=BAe(this.projectionDeltaWithTransform,this.treeScale,i),n&&(t.transform=n(i,t.transform));let{x:a,y:o}=this.projectionDelta;t.transformOrigin=`${a.origin*100}% ${o.origin*100}% 0`,r.animationValues?t.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:t.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let e in XT){if(i[e]===void 0)continue;let{correct:n,applyTo:a}=XT[e],o=t.transform===`none`?i[e]:n(i[e],r);if(a){let e=a.length;for(let n=0;n<e;n++)t[a[n]]=o}else t[e]=o}return this.options.layoutId&&(t.pointerEvents=r===this?NT(e?.pointerEvents)||``:`none`),t}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(PD),this.root.sharedNodes.clear()}}}function UAe(e){e.updateLayout()}function WAe(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?pD(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=sD(r);r.min=n[e].min,r.max=r.min+i}):VD(i,t.layoutBox,n)&&pD(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=sD(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=dD();cD(o,n,t.layoutBox);let s=dD();a?cD(s,e.applyTransform(r,!0),t.measuredBox):cD(s,n,t.layoutBox);let c=!PAe(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=fD();lD(o,t.layoutBox,i.layoutBox);let s=fD();lD(s,n,a.layoutBox),RAe(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeTargetChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function GAe(e){OD&&DD.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function KAe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function qAe(e){e.clearSnapshot()}function PD(e){e.clearMeasurements()}function JAe(e){e.isLayoutDirty=!1}function YAe(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function FD(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function XAe(e){e.resolveTargetDelta()}function ZAe(e){e.calcProjection()}function QAe(e){e.resetSkewAndRotation()}function $Ae(e){e.removeLeadSnapshot()}function ID(e,t,n){e.translate=LE(t.translate,0,n),e.scale=LE(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function LD(e,t,n,r){e.min=LE(t.min,n.min,r),e.max=LE(t.max,n.max,r)}function eje(e,t,n,r){LD(e.x,t.x,n.x,r),LD(e.y,t.y,n.y,r)}function tje(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var nje={duration:.45,ease:[.4,0,.1,1]},RD=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),zD=RD(`applewebkit/`)&&!RD(`chrome/`)?Math.round:lT;function BD(e){e.min=zD(e.min),e.max=zD(e.max)}function rje(e){BD(e.x),BD(e.y)}function VD(e,t,n){return e===`position`||e===`preserve-aspect`&&!Cke(TD(t),TD(n),.2)}function ije(e){return e!==e.root&&e.scroll?.wasRoot}var aje=ND({attachResizeListener:(e,t)=>nD(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),HD={current:void 0},UD=ND({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!HD.current){let e=new aje({});e.mount(window),e.setOptions({layoutScroll:!0}),HD.current=e}return HD.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),oje={pan:{Feature:aAe},drag:{Feature:rAe,ProjectionNode:UD,MeasureLayout:lAe}};function sje(e,t,n){if(e instanceof Element)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function WD(e,t){let n=sje(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function GD(e){return t=>{t.pointerType===`touch`||ske()||e(t)}}function cje(e,t,n={}){let[r,i,a]=WD(e,n),o=GD(e=>{let{target:n}=e,r=t(e);if(typeof r!=`function`||!n)return;let a=GD(e=>{r(e),n.removeEventListener(`pointerleave`,a)});n.addEventListener(`pointerleave`,a,i)});return r.forEach(e=>{e.addEventListener(`pointerenter`,o,i)}),a}function KD(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&mT.postRender(()=>i(t,rD(t)))}var lje=class extends $E{mount(){let{current:e}=this.node;e&&(this.unmount=cje(e,e=>(KD(this.node,e,`Start`),e=>KD(this.node,e,`End`))))}unmount(){}},uje=class extends $E{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=VE(nD(this.node.current,`focus`,()=>this.onFocus()),nD(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}},qD=(e,t)=>t?e===t?!0:qD(e,t.parentElement):!1,dje=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function fje(e){return dje.has(e.tagName)||e.tabIndex!==-1}var JD=new WeakSet;function YD(e){return t=>{t.key===`Enter`&&e(t)}}function XD(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var pje=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=YD(()=>{if(JD.has(n))return;XD(n,`down`);let e=YD(()=>{XD(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>XD(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function ZD(e){return tD(e)&&!ske()}function mje(e,t,n={}){let[r,i,a]=WD(e,n),o=e=>{let r=e.currentTarget;if(!ZD(e)||JD.has(r))return;JD.add(r);let a=t(e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),!(!ZD(e)||!JD.has(r))&&(JD.delete(r),typeof a==`function`&&a(e,{success:t}))},s=e=>{o(e,n.useGlobalTarget||qD(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{!fje(e)&&e.getAttribute(`tabindex`)===null&&(e.tabIndex=0),(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),e.addEventListener(`focus`,e=>pje(e,i),i)}),a}function QD(e,t,n){let{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&mT.postRender(()=>i(t,rD(t)))}var hje=class extends $E{mount(){let{current:e}=this.node;e&&(this.unmount=mje(e,e=>(QD(this.node,e,`Start`),(e,{success:t})=>QD(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}},$D=new WeakMap,eO=new WeakMap,gje=e=>{let t=$D.get(e.target);t&&t(e)},_je=e=>{e.forEach(gje)};function vje({root:e,...t}){let n=e||document;eO.has(n)||eO.set(n,{});let r=eO.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(_je,{root:e,...t})),r[i]}function yje(e,t,n){let r=vje(t);return $D.set(e,n),r.observe(e),()=>{$D.delete(e),r.unobserve(e)}}var bje={some:0,all:1},xje=class extends $E{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:bje[r]};return yje(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Sje(e,t))&&this.startObserver()}unmount(){}};function Sje({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Cje={inView:{Feature:xje},tap:{Feature:hje},focus:{Feature:uje},hover:{Feature:lje}},wje={layout:{ProjectionNode:UD,MeasureLayout:lAe}},tO={current:null},nO={current:!1};function Tje(){if(nO.current=!0,cT)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>tO.current=e.matches;e.addListener(t),t()}else tO.current=!1}var Eje=[...PDe,EE,OE],Dje=e=>Eje.find(NDe(e)),rO=new WeakMap;function Oje(e,t,n){for(let r in t){let i=t[r],a=n[r];if(MT(i))e.addValue(r,i);else if(MT(a))e.addValue(r,aE(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,aE(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var iO=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],kje=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=FE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=tE.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,mT.render(this.render,!1,!0))};let{latestValues:s,renderState:c,onUpdate:l}=a;this.onUpdate=l,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=TT(t),this.isVariantNode=cTe(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];s[e]!==void 0&&MT(t)&&t.set(s[e],!1)}}mount(e){this.current=e,rO.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),nO.current||Tje(),this.shouldReduceMotion=this.reducedMotionConfig===`never`?!1:this.reducedMotionConfig===`always`?!0:tO.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){rO.delete(this.current),this.projection&&this.projection.unmount(),hT(this.notifyUpdate),hT(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=FT.has(e),r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&mT.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=t.on(`renderRequest`,this.scheduleRender),a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i(),a&&a(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in vT){let t=vT[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fD()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<iO.length;t++){let n=iO[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Oje(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=aE(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ODe(n)||qEe(n))?n=parseFloat(n):!Dje(n)&&OE.test(t)&&(n=gDe(e,t)),this.setBaseTarget(e,MT(n)?n.get():n)),MT(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=AT(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!MT(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new iE),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}},aO=class extends kje{constructor(){super(...arguments),this.KeyframeResolver=IDe}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;MT(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Aje(e){return window.getComputedStyle(e)}var jje=class extends aO{constructor(){super(...arguments),this.type=`html`,this.renderInstance=ZTe}readValueFromInstance(e,t){if(FT.has(t)){let e=AE(t);return e&&e.default||0}else{let n=Aje(e),r=(MTe(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Zke(e,t)}build(e,t,n){KT(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ZT(e,t,n)}},Mje=class extends aO{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=fD}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(FT.has(t)){let e=AE(t);return e&&e.default||0}return t=QTe.has(t)?t:DT(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return nEe(e,t,n)}build(e,t,n){qT(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){$Te(e,t,n,r)}mount(e){this.isSVGTag=YT(e.tagName),super.mount(e)}},Nje=(e,t)=>kT(e)?new Mje(t):new jje(t,{allowProjection:e!==g.Fragment}),oO=sTe(pEe({...oke,...Cje,...oje,...wje},Nje)),sO={"in-progress":`Build in progress`,failed:`Last build failed`,success:`Gateway deployed`,idle:`No deployment yet`},cO=({status:e,className:t})=>e===`in-progress`?(0,W.jsx)(Km,{size:14,"aria-label":sO[e],className:G(`animate-spin text-yellow-500`,t)}):(0,W.jsx)(`span`,{role:`img`,"aria-label":sO[e],className:G(`w-2 h-2 shrink-0 rounded-full`,{"bg-green-500":e===`success`,"bg-red-500":e===`failed`,"bg-neutral-400":e===`idle`},t)}),Pje=({children:e,className:t,...n})=>(0,W.jsx)(`div`,{className:G(`sticky flex flex-col w-full border-b px-4 py-3 bg-white dark:bg-[#141412] z-10`,t),style:{top:`var(--banner-height, 0px)`},...n,children:e}),Fje=2e3,lO=(e,{onCopy:t,showToast:n=!0}={showToast:!0,onCopy:()=>{}})=>{let r=typeof e==`string`?()=>e:e,[i,a]=(0,g.useState)(`idle`),o=(0,g.useRef)(void 0),s=ch();(0,g.useEffect)(()=>{a(`idle`)},[e]);let c=()=>{a(`copied`),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{a(`idle`)},Fje)};return{copyToClipboard:async()=>{setTimeout(()=>a(e=>e===`idle`?`loading`:e),5);let i=typeof e==`string`?e:await r();try{await navigator.clipboard.writeText(i)}catch{a(`failed`),s.error(`Failed to copy to clipboard`);return}c(),t?.(),n&&s.success((0,W.jsxs)(`div`,{className:`flex gap-2 items-center text-xs font-medium`,children:[(0,W.jsx)(Ore,{strokeWidth:2,size:16}),(0,W.jsx)(`div`,{children:`Copied to clipboard`})]}))},state:i}},uO=(e,t=`api`)=>Ije(e,t)?.url,Ije=(e,t=`api`)=>e.deploymentVersion?.stages.find(e=>e.stage===t),Lje=({count:e})=>!e||e===0?null:(0,W.jsx)(`span`,{className:`absolute top-1 right-0 h-2 w-2 rounded-full bg-blue-400`}),dO=({children:e,to:t,badgeCount:n,end:r})=>(0,W.jsx)(Fr,{end:r,to:t,className:({isActive:e,isPending:t})=>G(`font-medium relative items-center px-2 py-1 rounded-md text-neutral-900 dark:text-white text-sm transition-colors`,`rounded-md hover:text-zuplo-600`,e&&`text-zuplo-700`,t&&`text-zuplo-700 animate-pulse`),children:({isActive:t})=>(0,W.jsxs)(W.Fragment,{children:[t&&(0,W.jsx)(oO.div,{layoutId:`local-navigation-item-background`,transition:{type:`spring`,bounce:.1,duration:.4},className:`absolute inset-0 rounded-md -z-10 bg-zuplo-100`}),e,(0,W.jsx)(Lje,{count:n})]})}),Rje=()=>{let e=lh(),[t,n]=(0,g.useState)(!1),r=uO(e.environment),{copyToClipboard:i,state:a}=lO(r??``);return(0,W.jsxs)(eT,{open:t,onOpenChange:n,children:[(0,W.jsx)(tT,{asChild:!0,children:(0,W.jsxs)(Y,{variant:`outline`,size:`sm`,className:`gap-2 flex justify-between h-8 mt-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(cO,{status:`success`}),`Deployment URLs`]}),(0,W.jsx)(ym,{size:16})]})}),(0,W.jsx)(nT,{className:`divide-y p-0`,align:`end`,children:r?(0,W.jsxs)(`div`,{className:`p-4`,children:[(0,W.jsx)(`div`,{className:`font-medium text-lg`,children:`Local Development`}),(0,W.jsx)(`div`,{className:`h-2`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`uppercase text-muted-foreground font-semibold text-xs`,children:`Gateway`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(cO,{status:`success`}),(0,W.jsx)(`div`,{className:`text-sm max-w-52 truncate break-all`,children:(0,W.jsx)(oT,{href:r,target:`_blank`,variant:`ghost`,rel:`noopener noreferrer`,className:`hover:underline`,children:r})}),(0,W.jsx)(`button`,{type:`button`,className:`p-1 hover:bg-muted rounded-md transition-colors`,onClick:()=>{i(),n(!1)},children:a===`copied`?(0,W.jsx)(vm,{size:16,className:`text-green-500`}):(0,W.jsx)(Mm,{size:16})})]})]})]}):(0,W.jsxs)(`div`,{className:`w-60 p-5 text-center`,children:[(0,W.jsx)(`div`,{className:`text-2xl font-medium`,children:`🙈`}),(0,W.jsx)(`div`,{className:`text-md mt-4`,children:`Deployment URL not configured. Make sure your local gateway is running.`})]})})]})},zje=()=>(0,W.jsxs)(Pje,{className:`flex-row justify-between`,children:[(0,W.jsxs)(`nav`,{"aria-label":`Sidebar`,className:`flex gap-2 items-center`,children:[(0,W.jsx)(dO,{end:!0,to:`/dev/project/local`,children:`Project`}),(0,W.jsx)(dO,{to:`/dev/project/local/edit`,children:`Code`})]}),(0,W.jsx)(Rje,{})]}),fO=(0,g.createContext)({chromeBottom:0});function Bje({height:e,children:t}){let n={chromeBottom:(0,g.useContext)(fO).chromeBottom+e};return(0,W.jsx)(fO.Provider,{value:n,children:t})}function Vje(){return(0,g.useContext)(fO).chromeBottom}var Hje=({children:e,className:t,offset:n=0})=>{let r=Vje();return(0,W.jsx)(`div`,{className:G(t),style:{height:`calc(100vh - ${r+n}px)`},children:e})};function pO(e,t,n){let{reference:r,floating:i}=e,a=xC(t),o=SC(t),s=bC(o),c=_C(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(vC(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var Uje=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pO(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=pO(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function mO(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=gC(t,e),p=TC(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=EC(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=EC(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Wje=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=gC(e,t)||{};if(l==null)return{};let d=TC(u),f={x:n,y:r},p=SC(i),m=bC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=uC(d[_],T),D=uC(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=hC(O,A,k),M=!c.arrow&&vC(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Gje=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=gC(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=_C(r),_=xC(o),v=_C(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[wC(o)]:Dye(o)),x=p!==`none`;!d&&x&&b.push(...Nye(o,m,p,y));let S=[o,...b],C=await mO(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Eye(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==xC(t))||T.every(e=>xC(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=xC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function hO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gO(e){return Sye.some(t=>e[t]>=0)}var Kje=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=gC(e,t);switch(r){case`referenceHidden`:{let e=hO(await mO(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:gO(e)}}}case`escaped`:{let e=hO(await mO(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:gO(e)}}}default:return{}}}}},_O=new Set([`left`,`top`]);async function qje(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_C(n),s=vC(n),c=xC(n)===`y`,l=_O.has(o)?-1:1,u=a&&c?-1:1,d=gC(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Jje=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await qje(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Yje=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=gC(e,t),l={x:n,y:r},u=await mO(t,c),d=xC(_C(i)),f=yC(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=hC(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=hC(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Xje=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=gC(e,t),u={x:n,y:r},d=xC(i),f=yC(d),p=u[f],m=u[d],h=gC(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=_O.has(_C(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Zje=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=gC(e,t),u=await mO(t,l),d=_C(i),f=vC(i),p=xC(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=uC(h-u[g],v),x=uC(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=dC(u.left,0),t=dC(u.right,0),n=dC(u.top,0),r=dC(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:dC(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:dC(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function vO(e){let t=zC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=NC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=fC(n)!==a||fC(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function yO(e){return MC(e)?e:e.contextElement}function bO(e){let t=yO(e);if(!NC(t))return mC(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=vO(t),o=(a?fC(n.width):n.width)/r,s=(a?fC(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Qje=mC(0);function xO(e){let t=AC(e);return!LC()||!t.visualViewport?Qje:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $je(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==AC(e)?!1:t}function SO(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=yO(e),o=mC(1);t&&(r?MC(r)&&(o=bO(r)):o=bO(e));let s=$je(a,n,r)?xO(a):mC(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=AC(a),t=r&&MC(r)?AC(r):r,n=e,i=UC(n);for(;i&&r&&t!==n;){let e=bO(i),t=i.getBoundingClientRect(),r=zC(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=AC(i),i=UC(n)}}return EC({width:u,height:d,x:c,y:l})}function CO(e,t){let n=BC(e).scrollLeft;return t?t.left+n:SO(jC(e)).left+n}function wO(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-CO(e,n),y:n.top+t.scrollTop}}function eMe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=jC(r),s=t?FC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=mC(1),u=mC(0),d=NC(r);if((d||!d&&!a)&&((kC(r)!==`body`||PC(o))&&(c=BC(r)),NC(r))){let e=SO(r);l=bO(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?wO(o,c):mC(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function tMe(e){return Array.from(e.getClientRects())}function nMe(e){let t=jC(e),n=BC(e),r=e.ownerDocument.body,i=dC(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=dC(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+CO(e),s=-n.scrollTop;return zC(r).direction===`rtl`&&(o+=dC(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var TO=25;function rMe(e,t){let n=AC(e),r=jC(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=LC();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=CO(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=TO&&(a-=o)}else l<=TO&&(a+=l);return{width:a,height:o,x:s,y:c}}var iMe=new Set([`absolute`,`fixed`]);function aMe(e,t){let n=SO(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=NC(e)?bO(e):mC(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function EO(e,t,n){let r;if(t===`viewport`)r=rMe(e,n);else if(t===`document`)r=nMe(jC(e));else if(MC(t))r=aMe(t,n);else{let n=xO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return EC(r)}function DO(e,t){let n=VC(e);return n===t||!MC(n)||RC(n)?!1:zC(n).position===`fixed`||DO(n,t)}function oMe(e,t){let n=t.get(e);if(n)return n;let r=HC(e,[],!1).filter(e=>MC(e)&&kC(e)!==`body`),i=null,a=zC(e).position===`fixed`,o=a?VC(e):e;for(;MC(o)&&!RC(o);){let t=zC(o),n=IC(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&iMe.has(i.position)||PC(o)&&!n&&DO(e,o))?r=r.filter(e=>e!==o):i=t,o=VC(o)}return t.set(e,r),r}function sMe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?FC(t)?[]:oMe(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=EO(t,n,i);return e.top=dC(r.top,e.top),e.right=uC(r.right,e.right),e.bottom=uC(r.bottom,e.bottom),e.left=dC(r.left,e.left),e},EO(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function cMe(e){let{width:t,height:n}=vO(e);return{width:t,height:n}}function lMe(e,t,n){let r=NC(t),i=jC(t),a=n===`fixed`,o=SO(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=mC(0);function l(){c.x=CO(i)}if(r||!r&&!a)if((kC(t)!==`body`||PC(i))&&(s=BC(t)),r){let e=SO(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?wO(i,s):mC(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function OO(e){return zC(e).position===`static`}function kO(e,t){if(!NC(e)||zC(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return jC(e)===n&&(n=n.ownerDocument.body),n}function AO(e,t){let n=AC(e);if(FC(e))return n;if(!NC(e)){let t=VC(e);for(;t&&!RC(t);){if(MC(t)&&!OO(t))return t;t=VC(t)}return n}let r=kO(e,t);for(;r&&Zye(r)&&OO(r);)r=kO(r,t);return r&&RC(r)&&OO(r)&&!IC(r)?n:r||nbe(e)||n}var uMe=async function(e){let t=this.getOffsetParent||AO,n=this.getDimensions,r=await n(e.floating);return{reference:lMe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dMe(e){return zC(e).direction===`rtl`}var fMe={convertOffsetParentRelativeRectToViewportRelativeRect:eMe,getDocumentElement:jC,getClippingRect:sMe,getOffsetParent:AO,getElementRects:uMe,getClientRects:tMe,getDimensions:cMe,getScale:bO,isElement:MC,isRTL:dMe};function jO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pMe(e,t){let n=null,r,i=jC(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=pC(d),h=pC(i.clientWidth-(u+f)),g=pC(i.clientHeight-(d+p)),_=pC(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:dC(0,uC(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!jO(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function mMe(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=yO(e),u=i||a?[...l?HC(l):[],...HC(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?pMe(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?SO(e):null;c&&g();function g(){let t=SO(e);h&&!jO(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var hMe=Jje,gMe=Yje,_Me=Gje,vMe=Zje,yMe=Kje,MO=Wje,bMe=Xje,xMe=(e,t,n)=>{let r=new Map,i={platform:fMe,...n},a={...i.platform,_c:r};return Uje(e,t,{...i,platform:a})},NO=typeof document<`u`?g.useLayoutEffect:function(){};function PO(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!PO(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!PO(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function FO(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function IO(e,t){let n=FO(e);return Math.round(t*n)/n}function LO(e){let t=g.useRef(e);return NO(()=>{t.current=e}),t}function SMe(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=g.useState(r);PO(f,r)||p(r);let[m,h]=g.useState(null),[_,v]=g.useState(null),y=g.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=g.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||_,C=g.useRef(null),w=g.useRef(null),T=g.useRef(u),E=c!=null,D=LO(c),O=LO(i),k=LO(l),A=g.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),xMe(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!PO(T.current,t)&&(T.current=t,ap.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);NO(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=g.useRef(!1);NO(()=>(j.current=!0,()=>{j.current=!1}),[]),NO(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=g.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=g.useMemo(()=>({reference:x,floating:S}),[x,S]),P=g.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=IO(N.floating,u.x),r=IO(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...FO(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var CMe=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:MO({element:r.current,padding:i}).fn(n):r?MO({element:r,padding:i}).fn(n):{}}}},wMe=(e,t)=>({...hMe(e),options:[e,t]}),TMe=(e,t)=>({...gMe(e),options:[e,t]}),EMe=(e,t)=>({...bMe(e),options:[e,t]}),DMe=(e,t)=>({..._Me(e),options:[e,t]}),OMe=(e,t)=>({...vMe(e),options:[e,t]}),kMe=(e,t)=>({...yMe(e),options:[e,t]}),AMe=(e,t)=>({...CMe(e),options:[e,t]}),jMe=`Arrow`,RO=g.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,W.jsx)(wp.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,W.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});RO.displayName=jMe;var MMe=RO,zO=`Popper`,[BO,VO]=gp(zO),[NMe,HO]=BO(zO),UO=e=>{let{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return(0,W.jsx)(NMe,{scope:t,anchor:r,onAnchorChange:i,children:n})};UO.displayName=zO;var WO=`PopperAnchor`,GO=g.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=HO(WO,n),o=g.useRef(null),s=mp(t,o),c=g.useRef(null);return g.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,W.jsx)(wp.div,{...i,ref:s})});GO.displayName=WO;var KO=`PopperContent`,[PMe,FMe]=BO(KO),qO=g.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,_=HO(KO,n),[v,y]=g.useState(null),b=mp(t,e=>y(e)),[x,S]=g.useState(null),C=QC(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(LMe),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=SMe({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>mMe(...e,{animationFrame:p===`always`}),elements:{reference:_.anchor},middleware:[wMe({mainAxis:i+T,alignmentAxis:o}),c&&TMe({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?EMe():void 0,...A}),c&&DMe({...A}),OMe({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&AMe({element:x,padding:s}),RMe({arrowWidth:w,arrowHeight:T}),f&&kMe({strategy:`referenceHidden`,...A})]}),[I,L]=XO(N),R=Tp(m);kp(()=>{P&&R?.()},[P,R]);let z=F.arrow?.x,ee=F.arrow?.y,te=F.arrow?.centerOffset!==0,[ne,B]=g.useState();return kp(()=>{v&&B(window.getComputedStyle(v).zIndex)},[v]),(0,W.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ne,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,W.jsx)(PMe,{scope:n,placedSide:I,onArrowChange:S,arrowX:z,arrowY:ee,shouldHideArrow:te,children:(0,W.jsx)(wp.div,{"data-side":I,"data-align":L,...h,ref:b,style:{...h.style,animation:P?void 0:`none`}})})})});qO.displayName=KO;var JO=`PopperArrow`,IMe={top:`bottom`,right:`left`,bottom:`top`,left:`right`},YO=g.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=FMe(JO,n),a=IMe[i.placedSide];return(0,W.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,W.jsx)(MMe,{...r,ref:t,style:{...r.style,display:`block`}})})});YO.displayName=JO;function LMe(e){return e!==null}var RMe=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=XO(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function XO(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var ZO=UO,QO=GO,$O=qO,ek=YO,zMe=`Portal`,tk=g.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=g.useState(!1);kp(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ap.createPortal((0,W.jsx)(wp.div,{...r,ref:t}),o):null});tk.displayName=zMe;function BMe(e,t){return g.useReducer((e,n)=>t[e][n]??e,e)}var nk=e=>{let{present:t,children:n}=e,r=VMe(t),i=typeof n==`function`?n({present:r.isPresent}):g.Children.only(n),a=mp(r.ref,HMe(i));return typeof n==`function`||r.isPresent?g.cloneElement(i,{ref:a}):null};nk.displayName=`Presence`;function VMe(e){let[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),a=g.useRef(`none`),[o,s]=BMe(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return g.useEffect(()=>{let e=rk(r.current);a.current=o===`mounted`?e:`none`},[o]),kp(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=rk(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),kp(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=rk(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=rk(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:g.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function rk(e){return e?.animationName||`none`}function HMe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ik=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`}),UMe=`VisuallyHidden`,ak=g.forwardRef((e,t)=>(0,W.jsx)(wp.span,{...e,ref:t,style:{...ik,...e.style}}));ak.displayName=UMe;var WMe=ak,[ok,GMe]=gp(`Tooltip`,[VO]),sk=VO(),ck=`TooltipProvider`,KMe=700,lk=`tooltip.open`,[qMe,uk]=ok(ck),dk=e=>{let{__scopeTooltip:t,delayDuration:n=KMe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=g.useRef(!0),s=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,W.jsx)(qMe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};dk.displayName=ck;var fk=`Tooltip`,[JMe,pk]=ok(fk),mk=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=uk(fk,e.__scopeTooltip),l=sk(t),[u,d]=g.useState(null),f=lC(),p=g.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,_=g.useRef(!1),[v,y]=Np({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(lk))):c.onClose(),a?.(e)},caller:fk}),b=g.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),x=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,_.current=!1,y(!0)},[y]),S=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{_.current=!0,y(!0),p.current=0},h)},[h,y]);return g.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,W.jsx)(ZO,{...l,children:(0,W.jsx)(JMe,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:g.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};mk.displayName=fk;var hk=`TooltipTrigger`,gk=g.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=pk(hk,n),a=uk(hk,n),o=sk(n),s=mp(t,g.useRef(null),i.onTriggerChange),c=g.useRef(!1),l=g.useRef(!1),u=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,W.jsx)(QO,{asChild:!0,...o,children:(0,W.jsx)(wp.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:bp(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:bp(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:bp(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:bp(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:bp(e.onBlur,i.onClose),onClick:bp(e.onClick,i.onClose)})})});gk.displayName=hk;var _k=`TooltipPortal`,[YMe,XMe]=ok(_k,{forceMount:void 0}),vk=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=pk(_k,t);return(0,W.jsx)(YMe,{scope:t,forceMount:n,children:(0,W.jsx)(nk,{present:n||a.open,children:(0,W.jsx)(tk,{asChild:!0,container:i,children:r})})})};vk.displayName=_k;var yk=`TooltipContent`,bk=g.forwardRef((e,t)=>{let n=XMe(yk,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=pk(yk,e.__scopeTooltip);return(0,W.jsx)(nk,{present:r||o.open,children:o.disableHoverableContent?(0,W.jsx)(xk,{side:i,...a,ref:t}):(0,W.jsx)(ZMe,{side:i,...a,ref:t})})}),ZMe=g.forwardRef((e,t)=>{let n=pk(yk,e.__scopeTooltip),r=uk(yk,e.__scopeTooltip),i=g.useRef(null),a=mp(t,i),[o,s]=g.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{s(null),d(!1)},[d]),p=g.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=nNe(r,tNe(r,n.getBoundingClientRect())),a=rNe(t.getBoundingClientRect());s(aNe([...i,...a])),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),g.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!iNe(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,W.jsx)(xk,{...e,ref:a})}),[QMe,$Me]=ok(fk,{isInside:!1}),eNe=Cp(`TooltipContent`),xk=g.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=pk(yk,n),l=sk(n),{onClose:u}=c;return g.useEffect(()=>(document.addEventListener(lk,u),()=>document.removeEventListener(lk,u)),[u]),g.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,W.jsx)(Dp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,W.jsxs)($O,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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:[(0,W.jsx)(eNe,{children:r}),(0,W.jsx)(QMe,{scope:n,isInside:!0,children:(0,W.jsx)(WMe,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});bk.displayName=yk;var Sk=`TooltipArrow`,Ck=g.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=sk(n);return $Me(Sk,n).isInside?null:(0,W.jsx)(ek,{...i,...r,ref:t})});Ck.displayName=Sk;function tNe(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function nNe(e,t,n=5){let 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 rNe(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function iNe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function aNe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),oNe(t)}function oNe(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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 sNe=dk,wk=mk,Tk=gk,cNe=vk,lNe=bk,Ek=Ck;function Dk({delayDuration:e=0,...t}){return(0,W.jsx)(sNe,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Ok({...e}){return(0,W.jsx)(Dk,{children:(0,W.jsx)(wk,{"data-slot":`tooltip`,...e})})}function kk({...e}){return(0,W.jsx)(Tk,{"data-slot":`tooltip-trigger`,...e})}function Ak({className:e,sideOffset:t=0,children:n,...r}){return(0,W.jsx)(cNe,{children:(0,W.jsxs)(lNe,{"data-slot":`tooltip-content`,sideOffset:t,className:G(`bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance`,e),...r,children:[n,(0,W.jsx)(Ek,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}var jk=({className:e,...t})=>(0,W.jsx)(Ek,{...t,className:G(`fill-white -translate-y-px drop-shadow-md [clip-path:inset(0_-10px_-10px_-10px)]`,e)}),Mk=({children:e,content:t,open:n,defaultOpen:r,onOpenChange:i,side:a=`top`,align:o=`center`,className:s,asChild:c=!0,...l})=>t?(0,W.jsxs)(wk,{open:n,defaultOpen:r,onOpenChange:i,children:[(0,W.jsx)(Tk,{asChild:c,children:e}),(0,W.jsxs)(Ak,{side:a,align:o,className:s,...l,children:[t,(0,W.jsx)(jk,{})]})]}):e,Nk={width:5,height:5,borderRadius:`50%`},uNe=({className:e,color:t=`white`})=>(0,W.jsxs)(oO.div,{className:`flex items-center gap-1`,initial:`hidden`,animate:`visible`,variants:{visible:{transition:{staggerChildren:.2}}},children:[(0,W.jsx)(oO.div,{className:G(t===`white`?`bg-white/60`:`bg-zuplo-600/60`,e),variants:{hidden:{opacity:0,y:3},visible:{opacity:1,y:0,transition:{y:{type:`spring`,stiffness:300,damping:10,repeat:1/0,repeatType:`reverse`}}}},style:Nk}),(0,W.jsx)(oO.div,{className:G(t===`white`?`bg-white/60`:`bg-zuplo-600/60`,e),variants:{hidden:{opacity:0,y:3},visible:{opacity:1,y:0,transition:{y:{type:`spring`,stiffness:300,damping:10,repeat:1/0,repeatType:`reverse`}}}},style:Nk}),(0,W.jsx)(oO.div,{className:G(t===`white`?`bg-white/60`:`bg-zuplo-600/60`,e),variants:{hidden:{opacity:0,y:3},visible:{opacity:1,y:0,transition:{y:{type:`spring`,stiffness:300,damping:10,repeat:1/0,repeatType:`reverse`}}}},style:Nk})]}),Pk=({children:e,className:t,loading:n,alternative:r,variant:i=`default`})=>(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(`div`,{className:G(t,`transition-opacity`,n&&`opacity-0`),children:e}),(0,W.jsx)(`div`,{className:G(`absolute top-1/2 left-1/2 opacity-0 transform -translate-x-1/2 -translate-y-1/2`,n&&`opacity-100`),children:r??(0,W.jsx)(uNe,{color:i===`default`?`white`:`primary`})})]});function Fk(){return Fk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fk.apply(null,arguments)}function Ik(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function dNe(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function Lk(...e){return t=>e.forEach(e=>dNe(e,t))}function Rk(...e){return(0,g.useCallback)(Lk(...e),e)}function fNe(e,t){let n=(0,g.createContext)(t);function r(e){let{children:t,...r}=e,i=(0,g.useMemo)(()=>r,Object.values(r));return(0,g.createElement)(n.Provider,{value:i},t)}function i(r){let i=(0,g.useContext)(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return r.displayName=e+`Provider`,[r,i]}function pNe(e,t=[]){let n=[];function r(t,r){let i=(0,g.createContext)(r),a=n.length;n=[...n,r];function o(t){let{scope:n,children:r,...o}=t,s=n?.[e][a]||i,c=(0,g.useMemo)(()=>o,Object.values(o));return(0,g.createElement)(s.Provider,{value:c},r)}function s(n,o){let s=(0,g.useContext)(o?.[e][a]||i);if(s)return s;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return o.displayName=t+`Provider`,[o,s]}let i=()=>{let t=n.map(e=>(0,g.createContext)(e));return function(n){let r=n?.[e]||t;return(0,g.useMemo)(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,mNe(i,...t)]}function mNe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return(0,g.useMemo)(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var zk=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},hNe=g.useId||(()=>void 0),gNe=0;function Bk(e){let[t,n]=g.useState(hNe());return zk(()=>{e||n(e=>e??String(gNe++))},[e]),e||(t?`radix-${t}`:``)}function Vk(e){let t=(0,g.useRef)(e);return(0,g.useEffect)(()=>{t.current=e}),(0,g.useMemo)(()=>(...e)=>t.current?.call(t,...e),[])}function _Ne({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=vNe({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=Vk(n);return[o,(0,g.useCallback)(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function vNe({defaultProp:e,onChange:t}){let n=(0,g.useState)(e),[r]=n,i=(0,g.useRef)(r),a=Vk(t);return(0,g.useEffect)(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}function Hk(){return Hk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hk.apply(null,arguments)}var Uk=(0,g.forwardRef)((e,t)=>{let{children:n,...r}=e,i=g.Children.toArray(n),a=i.find(bNe);if(a){let e=a.props.children,n=i.map(t=>t===a?g.Children.count(e)>1?g.Children.only(null):(0,g.isValidElement)(e)?e.props.children:null:t);return(0,g.createElement)(Wk,Hk({},r,{ref:t}),(0,g.isValidElement)(e)?(0,g.cloneElement)(e,void 0,n):null)}return(0,g.createElement)(Wk,Hk({},r,{ref:t}),n)});Uk.displayName=`Slot`;var Wk=(0,g.forwardRef)((e,t)=>{let{children:n,...r}=e;return(0,g.isValidElement)(n)?(0,g.cloneElement)(n,{...xNe(r,n.props),ref:t?Lk(t,n.ref):n.ref}):g.Children.count(n)>1?g.Children.only(null):null});Wk.displayName=`SlotClone`;var yNe=({children:e})=>(0,g.createElement)(g.Fragment,null,e);function bNe(e){return(0,g.isValidElement)(e)&&e.type===yNe}function xNe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{a(...e),i(...e)}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}var Gk=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=(0,g.forwardRef)((e,n)=>{let{asChild:r,...i}=e,a=r?Uk:t;return(0,g.useEffect)(()=>{window[Symbol.for(`radix-ui`)]=!0},[]),(0,g.createElement)(a,Hk({},i,{ref:n}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),SNe=(0,g.forwardRef)((e,t)=>{let{container:n=globalThis==null?void 0:globalThis.document?.body,...r}=e;return n?ap.createPortal((0,g.createElement)(Gk.div,Hk({},r,{ref:t})),n):null});function CNe(e,t){return(0,g.useReducer)((e,n)=>t[e][n]??e,e)}var Kk=e=>{let{present:t,children:n}=e,r=wNe(t),i=typeof n==`function`?n({present:r.isPresent}):g.Children.only(n),a=Rk(r.ref,i.ref);return typeof n==`function`||r.isPresent?(0,g.cloneElement)(i,{ref:a}):null};Kk.displayName=`Presence`;function wNe(e){let[t,n]=(0,g.useState)(),r=(0,g.useRef)({}),i=(0,g.useRef)(e),a=(0,g.useRef)(`none`),[o,s]=CNe(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return(0,g.useEffect)(()=>{let e=qk(r.current);a.current=o===`mounted`?e:`none`},[o]),zk(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=qk(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),zk(()=>{if(t){let e=e=>{let n=qk(r.current).includes(e.animationName);e.target===t&&n&&(0,ap.flushSync)(()=>s(`ANIMATION_END`))},n=e=>{e.target===t&&(a.current=qk(r.current))};return t.addEventListener(`animationstart`,n),t.addEventListener(`animationcancel`,e),t.addEventListener(`animationend`,e),()=>{t.removeEventListener(`animationstart`,n),t.removeEventListener(`animationcancel`,e),t.removeEventListener(`animationend`,e)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:(0,g.useCallback)(e=>{e&&(r.current=getComputedStyle(e)),n(e)},[])}}function qk(e){return e?.animationName||`none`}var Jk=0;function TNe(){(0,g.useEffect)(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Yk()),document.body.insertAdjacentElement(`beforeend`,e[1]??Yk()),Jk++,()=>{Jk===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Jk--}},[])}function Yk(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.cssText=`outline: none; opacity: 0; position: fixed; pointer-events: none`,e}var Xk=Hxe(),Zk=function(){},Qk=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Zk,onWheelCapture:Zk,onTouchMoveCapture:Zk}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,h=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=gw(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noIsolation`,`inert`,`allowPinchZoom`,`as`]),b=f,x=zxe([n,t]),S=hw(hw({},y),i);return g.createElement(g.Fragment,null,u&&g.createElement(b,{sideCar:Xk,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!h,lockRef:n}),o?g.cloneElement(g.Children.only(s),hw(hw({},S),{ref:x})):g.createElement(v,hw({},S,{className:c,ref:x}),s))});Qk.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Qk.classNames={fullWidth:vw,zeroRight:_w};var $k=!1;if(typeof window<`u`)try{var eA=Object.defineProperty({},`passive`,{get:function(){return $k=!0,!0}});window.addEventListener(`test`,eA,eA),window.removeEventListener(`test`,eA,eA)}catch{$k=!1}var tA=$k?{passive:!1}:!1,ENe=function(e){return e.tagName===`TEXTAREA`},nA=function(e,t){var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ENe(e)&&n[t]===`visible`)},DNe=function(e){return nA(e,`overflowY`)},ONe=function(e){return nA(e,`overflowX`)},rA=function(e,t){var n=t;do{if(typeof ShadowRoot<`u`&&n instanceof ShadowRoot&&(n=n.host),iA(e,n)){var r=aA(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},kNe=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ANe=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},iA=function(e,t){return e===`v`?DNe(t):ONe(t)},aA=function(e,t){return e===`v`?kNe(t):ANe(t)},jNe=function(e,t){return e===`h`&&t===`rtl`?-1:1},MNe=function(e,t,n,r,i){var a=jNe(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{var p=aA(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&iA(e,s)&&(d+=h,f+=m),s=s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&d===0||!i&&o>d)||!u&&(i&&f===0||!i&&-o>f))&&(l=!0),l},oA=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sA=function(e){return[e.deltaX,e.deltaY]},cA=function(e){return e&&`current`in e?e.current:e},NNe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},PNe=function(e){return`
|
|
94
94
|
.block-interactivity-${e} {pointer-events: none;}
|
|
95
95
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
96
|
-
`},FNe=0,lA=[];function INe(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(FNe++)[0],a=g.useState(function(){return Sw()})[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nxe([e.lockRef.current],(e.shards||[]).map(cA),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2)return!o.current.allowPinchZoom;var i=oA(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=rA(d,u);if(!f)return!0;if(f?l=d:(l=d===`v`?`h`:`v`,f=rA(d,u)),!f)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return MNe(p,t,e,p===`h`?s:c,!0)},[]),c=g.useCallback(function(e){var n=e;if(!(!lA.length||lA[lA.length-1]!==a)){var r=`deltaY`in n?sA(n):oA(n),i=t.current.filter(function(e){return e.name===n.type&&e.target===n.target&&NNe(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(cA).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=g.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=g.useCallback(function(e){n.current=oA(e),r.current=void 0},[]),d=g.useCallback(function(t){l(t.type,sA(t),t.target,s(t,e.lockRef.current))},[]),f=g.useCallback(function(t){l(t.type,oA(t),t.target,s(t,e.lockRef.current))},[]);g.useEffect(function(){return lA.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,tA),document.addEventListener(`touchmove`,c,tA),document.addEventListener(`touchstart`,u,tA),function(){lA=lA.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,tA),document.removeEventListener(`touchmove`,c,tA),document.removeEventListener(`touchstart`,u,tA)}},[]);var p=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(a,{styles:PNe(i)}):null,p?g.createElement(oSe,{gapMode:`margin`}):null)}var LNe=Wxe(Xk,INe),uA=g.forwardRef(function(e,t){return g.createElement(Qk,hw({},e,{ref:t,sideCar:LNe}))});uA.classNames=Qk.classNames;var dA=`Dialog`,[fA,RNe]=pNe(dA),[zNe,pA]=fA(dA),BNe=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=(0,g.useRef)(null),c=(0,g.useRef)(null),[l=!1,u]=_Ne({prop:r,defaultProp:i,onChange:a});return(0,g.createElement)(zNe,{scope:t,triggerRef:s,contentRef:c,contentId:Bk(),titleId:Bk(),descriptionId:Bk(),open:l,onOpenChange:u,onOpenToggle:(0,g.useCallback)(()=>u(e=>!e),[u]),modal:o},n)},VNe=`DialogTrigger`,HNe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA(VNe,n),a=Rk(t,i.triggerRef);return(0,g.createElement)(Gk.button,Fk({type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":bA(i.open)},r,{ref:a,onClick:Ik(e.onClick,i.onOpenToggle)}))}),mA=`DialogPortal`,[UNe,hA]=fA(mA,{forceMount:void 0}),WNe=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=pA(mA,t);return(0,g.createElement)(UNe,{scope:t,forceMount:n},g.Children.map(r,e=>(0,g.createElement)(Kk,{present:n||a.open},(0,g.createElement)(SNe,{asChild:!0,container:i},e))))},gA=`DialogOverlay`,GNe=(0,g.forwardRef)((e,t)=>{let n=hA(gA,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pA(gA,e.__scopeDialog);return a.modal?(0,g.createElement)(Kk,{present:r||a.open},(0,g.createElement)(KNe,Fk({},i,{ref:t}))):null}),KNe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA(gA,n);return(0,g.createElement)(uA,{as:Uk,allowPinchZoom:!0,shards:[i.contentRef]},(0,g.createElement)(Gk.div,Fk({"data-state":bA(i.open)},r,{ref:t,style:{pointerEvents:`auto`,...r.style}})))}),_A=`DialogContent`,qNe=(0,g.forwardRef)((e,t)=>{let n=hA(_A,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pA(_A,e.__scopeDialog);return(0,g.createElement)(Kk,{present:r||a.open},a.modal?(0,g.createElement)(JNe,Fk({},i,{ref:t})):(0,g.createElement)(YNe,Fk({},i,{ref:t})))}),JNe=(0,g.forwardRef)((e,t)=>{let n=pA(_A,e.__scopeDialog),r=(0,g.useRef)(null),i=Rk(t,n.contentRef,r);return(0,g.useEffect)(()=>{let e=r.current;if(e)return mw(e)},[]),(0,g.createElement)(vA,Fk({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ik(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),(t=n.triggerRef.current)==null||t.focus()}),onPointerDownOutside:Ik(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Ik(e.onFocusOutside,e=>e.preventDefault())}))}),YNe=(0,g.forwardRef)((e,t)=>{let n=pA(_A,e.__scopeDialog),r=(0,g.useRef)(!1),i=(0,g.useRef)(!1);return(0,g.createElement)(vA,Fk({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var a;if((a=e.onCloseAutoFocus)==null||a.call(e,t),!t.defaultPrevented){var o;r.current||(o=n.triggerRef.current)==null||o.focus(),t.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:t=>{var a;(a=e.onInteractOutside)==null||a.call(e,t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let o=t.target;n.triggerRef.current?.contains(o)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}}))}),vA=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=pA(_A,n),c=Rk(t,(0,g.useRef)(null));return TNe(),(0,g.createElement)(g.Fragment,null,(0,g.createElement)(sC,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a},(0,g.createElement)(Dp,Fk({role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":bA(s.open)},o,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),yA=`DialogTitle`,XNe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA(yA,n);return(0,g.createElement)(Gk.h2,Fk({id:i.titleId},r,{ref:t}))}),ZNe=`DialogDescription`,QNe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA(ZNe,n);return(0,g.createElement)(Gk.p,Fk({id:i.descriptionId},r,{ref:t}))}),$Ne=`DialogClose`,ePe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA($Ne,n);return(0,g.createElement)(Gk.button,Fk({type:`button`},r,{ref:t,onClick:Ik(e.onClick,()=>i.onOpenChange(!1))}))});function bA(e){return e?`open`:`closed`}var[tPe,nPe]=fNe(`DialogTitleWarning`,{contentName:_A,titleName:yA,docsSlug:`dialog`}),xA=BNe,SA=HNe,CA=WNe,wA=GNe,TA=qNe,EA=XNe,DA=QNe,OA=ePe;function kA({...e}){return(0,W.jsx)(xA,{"data-slot":`dialog`,...e})}function AA({...e}){return(0,W.jsx)(SA,{"data-slot":`dialog-trigger`,...e})}function rPe({...e}){return(0,W.jsx)(CA,{"data-slot":`dialog-portal`,...e})}function jA({...e}){return(0,W.jsx)(OA,{"data-slot":`dialog-close`,...e})}function iPe({className:e,...t}){return(0,W.jsx)(wA,{"data-slot":`dialog-overlay`,className:G(`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 MA({className:e,children:t,showCloseButton:n=!0,...r}){return(0,W.jsxs)(rPe,{"data-slot":`dialog-portal`,children:[(0,W.jsx)(iPe,{}),(0,W.jsxs)(TA,{"data-slot":`dialog-content`,className:G(`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&&(0,W.jsxs)(OA,{"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:[(0,W.jsx)(nh,{}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function NA({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`dialog-header`,className:G(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function PA({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`dialog-footer`,className:G(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function FA({className:e,...t}){return(0,W.jsx)(EA,{"data-slot":`dialog-title`,className:G(`text-lg leading-none font-semibold`,e),...t})}function IA({className:e,...t}){return(0,W.jsx)(DA,{"data-slot":`dialog-description`,className:G(`text-muted-foreground text-sm`,e),...t})}function aPe({open:e,editors:t,onSelect:n,onCancel:r}){let[i,a]=(0,g.useState)(null);return(0,W.jsx)(kA,{open:e,onOpenChange:e=>!e&&r(),children:(0,W.jsxs)(MA,{className:`sm:max-w-md`,children:[(0,W.jsxs)(NA,{children:[(0,W.jsx)(FA,{children:`Choose Your Editor`}),(0,W.jsx)(IA,{children:`Select which editor you'd like to use for opening files. This preference will be saved for future use.`})]}),(0,W.jsx)(`div`,{className:`space-y-2 py-4`,children:t.map(e=>(0,W.jsx)(`button`,{type:`button`,className:`w-full text-left px-4 py-3 rounded-md border transition-colors ${i===e.id?`border-blue-500 bg-blue-50 dark:bg-blue-950/40`:`border-gray-200 dark:border-neutral-700 hover:border-gray-300 dark:hover:border-neutral-600 hover:bg-gray-50 dark:hover:bg-neutral-800/60`}`,onClick:()=>a(e.id),children:(0,W.jsx)(`div`,{className:`font-medium`,children:e.name})},e.id))}),(0,W.jsxs)(PA,{children:[(0,W.jsx)(Y,{variant:`ghost`,onClick:r,children:`Cancel`}),(0,W.jsx)(Y,{variant:`default`,onClick:()=>{i&&n(i)},disabled:!i,children:`Save Preference`})]})]})})}var LA=`/api/v1/editor`;function oPe(){let[e]=Hr(),[t,n]=(0,g.useState)(null),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)([]),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(!0);(0,g.useEffect)(()=>{(async()=>{try{let e=await fetch(`${LA}/list`);if(!e.ok)throw Error(`Failed to fetch editors: ${e.status}`);o((await e.json()).editors);let t=await fetch(`${LA}/detect`);if(!t.ok)throw Error(`Failed to detect editor: ${t.status}`);let r=await t.json();r.editor&&r.name&&(n(r.editor),i(r.name))}catch(e){jf.error(`Failed to load editor preference`,{error:e})}finally{u(!1)}})()},[]);let d=(0,g.useCallback)(async e=>{try{if((await fetch(`${LA}/preference`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({editor:e})})).ok){let t=a.find(t=>t.id===e);t&&(n(e),i(t.name)),c(!1)}}catch(e){jf.error(`Failed to save editor preference`,{error:e})}},[a]),f=(0,g.useCallback)(async()=>{let n=e.get(`path`);if(!n){jf.warn(`No file path in URL`);return}if(!t){c(!0);return}try{let e=await fetch(`${LA}/open`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({file:n})});if(!e.ok){let t=await e.json();jf.error(`Failed to open file in editor`,{error:t.message});return}let t=await e.json();t.url&&window.open(t.url,`_blank`)}catch(e){jf.error(`Failed to open file in editor`,{error:e})}},[e,t]);return{hasEditor:!!t,editorName:r,isLoading:l,showPreferenceDialog:s,setShowPreferenceDialog:c,availableEditors:a,savePreference:d,openInEditor:f}}var RA=`$import(@zuplo/runtime)`,sPe=e=>new Promise(t=>setTimeout(t,e)),zA=e=>{let t=(0,g.useRef)(e);return t.current=e,(0,g.useEffect)(()=>{t.current=e},[e]),t},BA=e=>{let[t,n]=(0,g.useState)(`idle`),[r,i]=(0,g.useState)(),[a,o]=(0,g.useState)(null);return{state:t,error:r,execute:(0,g.useCallback)(async(...t)=>{n(`loading`),o(null),i(void 0);try{let r=await e(...t);return n(`hasValue`),o(r),r}catch(e){throw i(e instanceof Error?e:Error(e)),n(`hasError`),e}},[e]),value:a}},VA=function(e){return e.PRODUCTION=`PRODUCTION`,e.PREVIEW=`PREVIEW`,e.WORKING_COPY=`WORKING_COPY`,e}({});function cPe(e,...t){return e==null?!1:t.includes(e)}var HA=()=>({isReadOnly:lh().environment.environmentType!==VA.WORKING_COPY});function UA(){return new URLSearchParams(Sn().search)}function WA(e,t){let[n,r]=Hr(),i=Object.fromEntries(n);return[n.get(e)??t,t=>r(t===void 0?Object.fromEntries(Object.entries(i).filter(([t])=>t!==e)):{...i,[e]:t})]}function lPe(e,t){let[n,r]=Hr();return[n.get(e)?n.getAll(e):t,t=>r({...Object.fromEntries(n),[e]:t})]}var uPe=i(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),dPe=e(i(((e,t)=>{var n=uPe();t.exports=f;var r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,a=`\0CLOSE`+Math.random()+`\0`,o=`\0COMMA`+Math.random()+`\0`,s=`\0PERIOD`+Math.random()+`\0`;function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function l(e){return e.split(`\\\\`).join(r).split(`\\{`).join(i).split(`\\}`).join(a).split(`\\,`).join(o).split(`\\.`).join(s)}function u(e){return e.split(r).join(`\\`).split(i).join(`{`).split(a).join(`}`).split(o).join(`,`).split(s).join(`.`)}function d(e){if(!e)return[``];var t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);var i=r.pre,a=r.body,o=r.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=d(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function f(e){return e?(e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),_(l(e),!0).map(u)):[]}function p(e){return`{`+e+`}`}function m(e){return/^-?0\d/.test(e)}function h(e,t){return e<=t}function g(e,t){return e>=t}function _(e,t){var r=[],i=n(`{`,`}`,e);if(!i)return[e];var o=i.pre,s=i.post.length?_(i.post,!1):[``];if(/\$$/.test(i.pre))for(var l=0;l<s.length;l++){var u=o+`{`+i.body+`}`+s[l];r.push(u)}else{var f=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),v=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),y=f||v,b=i.body.indexOf(`,`)>=0;if(!y&&!b)return i.post.match(/,(?!,).*\}/)?(e=i.pre+`{`+i.body+a+i.post,_(e)):[e];var x;if(y)x=i.body.split(/\.\./);else if(x=d(i.body),x.length===1&&(x=_(x[0],!1).map(p),x.length===1))return s.map(function(e){return i.pre+x[0]+e});var S;if(y){var C=c(x[0]),w=c(x[1]),T=Math.max(x[0].length,x[1].length),E=x.length==3?Math.abs(c(x[2])):1,D=h;w<C&&(E*=-1,D=g);var O=x.some(m);S=[];for(var k=C;D(k,w);k+=E){var A;if(v)A=String.fromCharCode(k),A===`\\`&&(A=``);else if(A=String(k),O){var j=T-A.length;if(j>0){var M=Array(j+1).join(`0`);A=k<0?`-`+M+A.slice(1):M+A}}S.push(A)}}else{S=[];for(var N=0;N<x.length;N++)S.push.apply(S,_(x[N],!1))}for(var N=0;N<S.length;N++)for(var l=0;l<s.length;l++){var u=o+S[N]+s[l];(!t||y||u)&&r.push(u)}}return r}}))()),fPe=1024*64,GA=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>fPe)throw TypeError(`pattern is too long`)},pPe={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},KA=e=>e.replace(/[[\]\\-]/g,`\\$&`),mPe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),qA=e=>e.join(``),hPe=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(pPe))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(KA(d)+`-`+KA(t)):t===d&&r.push(KA(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(KA(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(KA(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[mPe(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+qA(r)+`]`,p=`[`+(l?``:`^`)+qA(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},JA=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`),gPe=new Set([`!`,`?`,`+`,`*`,`@`]),YA=e=>gPe.has(e),XA=e=>YA(e.type),_Pe=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),vPe=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),yPe=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),ZA=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),bPe=`(?!\\.\\.?(?:$|/))`,QA=`(?!\\.)`,xPe=new Set([`[`,`.`]),SPe=new Set([`..`,`.`]),CPe=new Set(`().*{}+?[]^$\\!`),wPe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),$A=`[^/]`,ej=$A+`*?`,tj=$A+`+?`,nj=class e{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...t){for(let n of t)if(n!==``){if(typeof n!=`string`&&!(n instanceof e&&n.#i===this))throw Error(`invalid part: `+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let t=this.#i;for(let n=0;n<this.#a;n++){let r=t.#r[n];if(!(r instanceof e&&r.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(t){let n=new e(this.type,t);for(let e of this.#r)n.copyIn(e);return n}static#f(t,n,r,i,a){let o=i.maxExtglobRecursion??2,s=!1,c=!1,l=-1,u=!1;if(n.type===null){let d=r,f=``;for(;d<t.length;){let r=t.charAt(d++);if(s||r===`\\`){s=!s,f+=r;continue}if(c){d===l+1?(r===`^`||r===`!`)&&(u=!0):r===`]`&&!(d===l+2&&u)&&(c=!1),f+=r;continue}else if(r===`[`){c=!0,l=d,u=!1,f+=r;continue}if(!i.noext&&YA(r)&&t.charAt(d)===`(`&&a<=o){n.push(f),f=``;let o=new e(r,n);d=e.#f(t,o,d,i,a+1),n.push(o);continue}f+=r}return n.push(f),d}let d=r+1,f=new e(null,n),p=[],m=``;for(;d<t.length;){let r=t.charAt(d++);if(s||r===`\\`){s=!s,m+=r;continue}if(c){d===l+1?(r===`^`||r===`!`)&&(u=!0):r===`]`&&!(d===l+2&&u)&&(c=!1),m+=r;continue}else if(r===`[`){c=!0,l=d,u=!1,m+=r;continue}if(YA(r)&&t.charAt(d)===`(`&&(a<=o||n&&n.#h(r))){let o=n&&n.#h(r)?0:1;f.push(m),m=``;let s=new e(r,f);f.push(s),d=e.#f(t,s,d,i,a+o);continue}if(r===`|`){f.push(m),m=``,p.push(f),f=new e(null,n);continue}if(r===`)`)return m===``&&n.#r.length===0&&(n.#u=!0),f.push(m),m=``,n.push(...p,f),d;m+=r}return n.type=null,n.#t=void 0,n.#r=[t.substring(r-1)],d}#p(e){return this.#m(e,vPe)}#m(e,t=_Pe){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=yPe){return!!t.get(this.type)?.includes(e)}#g(t,n){let r=t.#r[0],i=new e(null,r,this.options);i.#r.push(``),r.push(i),this.#_(t,n)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!ZA.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=ZA.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}#x(){if(XA(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}static fromGlob(t,n={}){let r=new e(null,void 0,n);return e.#f(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(){if(this.#e===this&&(this.#x(),this.#d()),!XA(this)){let t=this.isStart()&&this.isEnd(),n=this.#r.map(n=>{let[r,i,a,o]=typeof n==`string`?e.#S(n,this.#t,t):n.toRegExpSource();return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),r=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&SPe.has(this.#r[0]))){let e=xPe,t=this.#c.dot&&e.has(n.charAt(0))||n.startsWith(`\\.`)&&e.has(n.charAt(2))||n.startsWith(`\\.\\.`)&&e.has(n.charAt(4)),i=!this.#c.dot&&e.has(n.charAt(0));r=t?bPe:i?QA:``}let i=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(i=`(?:$|\\/)`),[r+n+i,JA(n),this.#t=!!this.#t,this.#n]}let t=this.type===`!`?`(?:(?!(?:`:`(?:`,n=this.#r.map(e=>{if(typeof e==`string`)throw Error(`string type in extglob ast??`);let[t,n,r,i]=e.toRegExpSource();return this.#n=this.#n||i,t}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`);if(this.isStart()&&this.isEnd()&&!n&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,JA(this.toString()),!1,!1]}let r=``;if(this.type===`!`&&this.#u)r=(this.isStart()&&!this.#c.dot?QA:``)+tj;else{let e=this.type===`!`?`))`+(this.isStart()&&!this.#c.dot?QA:``)+ej+`)`:this.type===`@`?`)`:`)${this.type}`;r=t+n+e}return[r,JA(n),this.#t=!!this.#t,this.#n]}static#S(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(c!==`*`&&(o=!1),r){r=!1,i+=(CPe.has(c)?`\\`:``)+c;continue}if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=hPe(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?tj:ej,t=!0;continue}if(c===`?`){i+=$A,t=!0;continue}i+=wPe(c)}return[i,JA(e),!!t,a]}},TPe=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),rj=(e,t,n={})=>(GA(t),!n.nocomment&&t.charAt(0)===`#`?!1:new fj(t,n).match(e)),EPe=/^\*+([^+@!?\*\[\(]*)$/,DPe=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),OPe=e=>t=>t.endsWith(e),kPe=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),APe=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),jPe=/^\*+\.\*+$/,MPe=e=>!e.startsWith(`.`)&&e.includes(`.`),NPe=e=>e!==`.`&&e!==`..`&&e.includes(`.`),PPe=/^\.\*+$/,FPe=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),IPe=/^\*+$/,LPe=e=>e.length!==0&&!e.startsWith(`.`),RPe=e=>e.length!==0&&e!==`.`&&e!==`..`,zPe=/^\?+([^+@!?\*\[\(]*)?$/,BPe=([e,t=``])=>{let n=ij([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},VPe=([e,t=``])=>{let n=aj([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},HPe=([e,t=``])=>{let n=aj([e]);return t?e=>n(e)&&e.endsWith(t):n},UPe=([e,t=``])=>{let n=ij([e]);return t?e=>n(e)&&e.endsWith(t):n},ij=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},aj=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},oj=typeof process==`object`&&process?{}.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,sj={win32:{sep:`\\`},posix:{sep:`/`}};rj.sep=oj===`win32`?sj.win32.sep:sj.posix.sep;var cj=Symbol(`globstar **`);rj.GLOBSTAR=cj;var WPe=`[^/]*?`,GPe=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,KPe=`(?:(?!(?:\\/|^)\\.).)*?`;rj.filter=(e,t={})=>n=>rj(n,e,t);var lj=(e,t={})=>Object.assign({},e,t);rj.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return rj;let t=rj;return Object.assign((n,r,i={})=>t(n,r,lj(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,lj(e,n))}static defaults(n){return t.defaults(lj(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,lj(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,lj(e,r))}},unescape:(n,r={})=>t.unescape(n,lj(e,r)),escape:(n,r={})=>t.escape(n,lj(e,r)),filter:(n,r={})=>t.filter(n,lj(e,r)),defaults:n=>t.defaults(lj(e,n)),makeRe:(n,r={})=>t.makeRe(n,lj(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,lj(e,r)),match:(n,r,i={})=>t.match(n,r,lj(e,i)),sep:t.sep,GLOBSTAR:cj})};var uj=(e,t={})=>(GA(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,dPe.default)(e));rj.braceExpand=uj,rj.makeRe=(e,t={})=>new fj(e,t).makeRe(),rj.match=(e,t,n={})=>{let r=new fj(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};var dj=/[?*]|[+@!]\(.*?\)|\[|\]/,qPe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),fj=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){GA(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||oj,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!dj.test(e[2]))&&!dj.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);r&&(e[t]=r,e[n]=[])}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=e[0]===``&&e[1]===``&&e[2]===`?`&&typeof e[3]==`string`&&/^[a-z]:$/i.test(e[3]),a=t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]);if(n&&a){let n=e[3],a=t[3];n.toLowerCase()===a.toLowerCase()&&(e[3]=a,r=3,i=3)}else if(a&&typeof e[0]==`string`){let n=t[3],r=e[0];n.toLowerCase()===r.toLowerCase()&&(t[3]=r,i=3)}else if(n&&typeof t[0]==`string`){let n=e[3];n.toLowerCase()===t[0].toLowerCase()&&(t[0]=n,r=3)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(cj)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(cj,i),o=t.lastIndexOf(cj),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===cj?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===cj)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return uj(this.pattern,this.options)}parse(e){GA(e);let t=this.options;if(e===`**`)return cj;if(e===``)return``;let n,r=null;(n=e.match(IPe))?r=t.dot?RPe:LPe:(n=e.match(EPe))?r=(t.nocase?t.dot?APe:kPe:t.dot?OPe:DPe)(n[1]):(n=e.match(zPe))?r=(t.nocase?t.dot?VPe:BPe:t.dot?HPe:UPe)(n):(n=e.match(jPe))?r=t.dot?NPe:MPe:(n=e.match(PPe))&&(r=FPe);let i=nj.fromGlob(e,this.options).toMMPattern();return r?Object.assign(i,{test:r}):i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?WPe:t.dot?GPe:KPe,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?qPe(e):e===cj?cj:e._src});return t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==cj||a===cj||(a===void 0?i!==void 0&&i!==cj?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|`+n+`)?`:i!==cj&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=cj))}),t.filter(e=>e!==cj).join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return rj.defaults(e).Minimatch}};rj.AST=nj,rj.Minimatch=fj,rj.escape=TPe,rj.unescape=JA;function pj(e){let t=new Date;switch(e){case`7d`:t.setUTCDate(t.getUTCDate()-7);break;case`30d`:t.setUTCDate(t.getUTCDate()-30);break;case`3m`:t.setUTCMonth(t.getUTCMonth()-3);break}return t.toISOString()}async function mj(e,t){let n=t.pageSize??30,{page:r,pageSize:i,order:a=`DESC`,orderBy:o=`periodStart`,...s}=t,{data:c,error:l}=await E_.GET(`/v3/metering/{bucketId}/billing/invoices`,{params:{path:{bucketId:e},query:{page:r,pageSize:n,expand:[`lines`],order:a,orderBy:o,...s}}});if(l||!c)throw l??Error(`Failed to load invoices`);return c}var JPe=15;async function YPe(e,t,n=6){let r=await mj(e,{page:1,pageSize:n,createdAfter:pj(`3m`),order:`DESC`,orderBy:`periodStart`,customers:[t]}),i=r.items??[];if(i.length===0||i.every(e=>e.customer?.id===t))return r;let a=[],o=1;for(;a.length<n&&o<=JPe;){let r=await mj(e,{page:o,pageSize:30,createdAfter:pj(`3m`),order:`DESC`,orderBy:`periodStart`}),i=r.items??[];if(i.length===0)break;for(let e of i)if(e.customer?.id===t&&(a.push(e),a.length>=n))break;let s=r.pageSize??30,c=Math.max(1,Math.ceil((r.totalCount??0)/s));if(o>=c)break;o++}let s=a.slice(0,n);return{...r,items:s,totalCount:s.length,page:1,pageSize:n}}var hj={orderBy:`createdAt`,order:`DESC`},gj=`/v3/metering/{bucketId}/plans`,XPe=`/v3/metering/{bucketId}/customers`;function ZPe(e){if(!e)return;let t={};return e.page!=null&&(t.page=e.page,t.pageSize=e.pageSize??30),e.status?.length&&(t.status=e.status),Object.keys(t).length>0?t:void 0}function QPe(e,t){let n=ZPe(t);return n?{params:{path:{bucketId:e},query:n}}:{params:{path:{bucketId:e}}}}function $Pe(e){if(!e)return;let t={orderBy:e.orderBy??hj.orderBy,order:e.order??hj.order};return e.page!=null&&(t.page=e.page,t.pageSize=e.pageSize??30),e.planKey&&(t.planKey=e.planKey),e.name&&(t.name=e.name),e.key&&(t.key=e.key),e.primaryEmail&&(t.primaryEmail=e.primaryEmail),Object.keys(t).length>0?t:void 0}function eFe(e,t){let n=$Pe(t);return n?{params:{path:{bucketId:e},query:n}}:{params:{path:{bucketId:e}}}}function tFe(e){let t={page:e.page??1,pageSize:e.pageSize??30};return e.includeArchived!=null&&(t.includeArchived=e.includeArchived),t}function nFe(e,t,n){return Array.isArray(e)?{items:e,totalCount:e.length,page:t,pageSize:n}:e}var _j={ai:{providerAssignments:{list:(e,t)=>D_.queryOptions(`get`,`/v1/accounts/{accountName}/projects/{projectName}/ai-provider-assignments`,{params:{path:{accountName:e,projectName:t}}},{select:e=>e.data})}},deployments:{list:(e,t)=>D_.queryOptions(`get`,`/v1/accounts/{accountName}/projects/{projectName}/deployments`,{params:{path:{accountName:e,projectName:t}}}),versions:{list:e=>D_.queryOptions(`get`,`/v1/deployments/{deploymentName}/versions`,{params:{path:{deploymentName:e}}})}},mcp:{origins:{list:e=>D_.queryOptions(`get`,`/v1/buckets/{bucketId}/mcp/configurations/{configurationId}/origins`,{params:{path:e}})},teams:{list:e=>D_.queryOptions(`get`,`/v1/buckets/{bucketId}/mcp/configurations/teams`,{params:{path:e}})},server:{listTeams:e=>D_.queryOptions(`get`,`/v1/buckets/{bucketId}/mcp/configurations/{configurationId}/servers/{virtualServerId}/teams`,{params:{path:e}})},servers:{list:e=>D_.queryOptions(`get`,`/v1/buckets/{bucketId}/mcp/configurations/{configurationId}/servers`,{params:{path:e}})}},metering:{customers:{list:(e,t)=>D_.queryOptions(`get`,XPe,eFe(e,t),t?.page==null?void 0:{placeholderData:o_}),get:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/customers/{customerIdOrKey}`,{params:{path:{bucketId:e,customerIdOrKey:t}}}),subscriptions:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/customers/{customerIdOrKey}/subscriptions`,{params:{path:{bucketId:e,customerIdOrKey:t}}})},plans:{list:(e,t)=>D_.queryOptions(`get`,gj,QPe(e,t),t?.page==null?void 0:{placeholderData:o_}),get:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/plans/{planId}`,{params:{path:{bucketId:e,planId:t}}}),listByKey:(e,t)=>D_.queryOptions(`get`,gj,{params:{path:{bucketId:e},query:{key:[t]}}})},meters:{list:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/meters`,{params:{path:{bucketId:e}}})},configuration:{get:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/monetization-configuration`,{params:{path:{bucketId:e}}})},features:{list:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/features`,{params:{path:{bucketId:e},query:t?{includeArchived:t}:void 0}},{select:e=>Array.isArray(e)?e:e.items}),listPaginated:(e,t)=>{let n=t.page??1,r=t.pageSize??30;return D_.queryOptions(`get`,`/v3/metering/{bucketId}/features`,{params:{path:{bucketId:e},query:tFe(t)}},{select:e=>nFe(e,n,r),placeholderData:o_})}},planInvites:{list:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/plan-invites`,{params:{path:{bucketId:e}}})},billingReadiness:{get:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/billing-readiness`,{params:{path:{bucketId:e}}})},stripe:{setup:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/setup/stripe`,{params:{path:{bucketId:e}}})},subscriptions:{get:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}`,{params:{path:{bucketId:e,subscriptionId:t}}}),access:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}/access`,{params:{path:{bucketId:e,subscriptionId:t}}})},invoices:{list:(e,t,n,r,i,a)=>({queryKey:[`metering`,e,`invoices`,t,n,r??`all`,a,i],queryFn:()=>mj(e,{page:n,pageSize:30,createdAfter:pj(t),order:i,orderBy:a,...r?.length?{statuses:r}:{}}),placeholderData:o_}),forCustomer:(e,t)=>({queryKey:[`metering`,e,`invoices`,`customer`,t],queryFn:()=>YPe(e,t)})}}},rFe=async e=>vj(e,await a(()=>import(`./editor.main-9KBOhT8U.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),vj=(e,t)=>{let n=e.split(`.`).pop();if(n)return t.languages.getLanguages().find(e=>e.extensions?.includes(`.${n}`))},yj=e=>{let t=Object.entries(e).flatMap(([e,t])=>t?[[e,t]]:[]);return new URLSearchParams(t).toString()},X={user:{preferences:()=>({url:`${U}/v1/users/me/preferences`})},authApiKey:e=>({url:`${U}/v1/auth/api-keys/${e}`}),authAccountApiKeys:e=>({url:`${U}/v1/auth/api-keys?accountName=${e}`}),authCurrentUserAccountRoles:e=>({url:`${U}/v1/auth/users/me?accountName=${e}`}),authUserAccountRoles:(e,t)=>({url:`${U}/v1/auth/users/${t}?accountName=${e}`}),authProjectUsersRoles:(e,t,{includeInheritedRoles:n}={includeInheritedRoles:!1})=>({url:`${U}/v1/auth/users?accountName=${e}&projectName=${t}&includeInheritedRoles=${n}`}),authAccountUsersRoles:e=>({url:`${U}/v1/auth/users?accountName=${e}`}),mfaFactors:()=>({url:`${U}/v1/mfa/factors`}),accountMemberInviteDetails:e=>({url:`${U}/v1/account-member-invites/${e}`}),accountMemberInvites:e=>({url:`${U}/v1/accounts/${e}/account-member-invites`}),accountAuditLogs:(e,t)=>{let n=new URLSearchParams;t?.limit&&n.append(`limit`,t.limit.toString()),t?.offset&&n.append(`offset`,t.offset.toString()),t?.action&&n.append(`action`,t.action),t?.startDate&&n.append(`startDate`,t.startDate),t?.endDate&&n.append(`endDate`,t.endDate),t?.actor&&n.append(`actor`,t.actor),t?.success!==void 0&&n.append(`success`,t.success.toString());let r=n.toString();return{url:`${U}/v1/accounts/${e}/audit-logs${r?`?${r}`:``}`}},account:e=>({url:`${U}/v1/accounts/${e}`}),accounts:()=>({url:`${U}/v1/accounts`}),accountSourceControlRepoList:e=>({url:`${U}/v1/accounts/${e}/$repo-list`}),accountSourceControlAzureProjects:(e,t)=>({url:`${U}/v1/accounts/${e}/source-control/$azure-projects?organization=${t}`}),accountSourceControlNamespaces:e=>({url:`${U}/v1/accounts/${e}/$namespaces`}),accountSourceControlRepos:(e,t,n)=>({url:`${U}/v1/accounts/${e}/$repos?${new URLSearchParams({namespace:t,query:n??``})}`}),accountsSourceControlConfigurations:()=>({url:`${U}/v1/user/me/source-control-configs`}),accountUsageAnalyticsByDate:(e,t,n)=>({url:`${U}/v1/analytics/${e}/usage?from=${t}&to=${n}&version=2`}),billing:e=>({url:`${U}/v1/accounts/${e}/billings`}),buildLogs:(e,t)=>({url:`${U}/v2/deployments/${e}/build-logs/${t}`}),cdnContent:e=>({url:`${Hf}${e}`}),chatIdentity:()=>({url:`${U}/v1/chat-identity`}),knockIdentity:()=>({url:`${U}/v1/knock-identity`}),bucketConfigurations:e=>({url:`${U}/v1/buckets/${e}/configurations`}),bucketConfigurationTeams:e=>({url:`${U}/v1/buckets/${e}/configurations/teams`}),bucketConfigurationApps:e=>({url:`${U}/v1/buckets/${e}/configurations/apps`}),bucketConfiguration:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations/${t}`}),bucketConfigurationUsage:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/usage`}),bucketConfigurationMembers:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members`}),bucketConfigurationMember:(e,t,n)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`}),supportedAiProviders:e=>({url:`${U}/v1/buckets/${e}/providers`}),aiProviderAssignments:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/ai-provider-assignments`}),hierarchicalQuota:e=>({url:`${U}/v1/hierarchical-quota/${e}`}),bucketConfigurationRequestCount:(e,t,n,r,i)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/request-count?${yj({startDate:n,endDate:r,granularity:i})}`}),bucketConfigurationCostUsage:(e,t,n,r,i)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/cost-usage?${yj({startDate:n,endDate:r,granularity:i})}`}),bucketConfigurationTokenUsage:(e,t,n,r,i,a)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/token-usage?${yj({startDate:n,endDate:r,granularity:i,tokenType:a})}`}),bucketConfigurationTtfb:(e,t,n,r,i)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/ttfb?${yj({startDate:n,endDate:r,granularity:i})}`}),bucketConfigurationBlocksErrorsWarnings:(e,t,n,r,i)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/blocks-errors-warnings?${yj({startDate:n,endDate:r,granularity:i})}`}),consumer:(e,t)=>({url:`${U}/v1/api-keys/${e}/consumers/${t}`}),consumersForBucket:(e,t)=>{let n=yj({limit:t?.limit?.toString(),offset:t?.offset?.toString(),name:t?.name,email:t?.email});return{url:`${U}/v1/api-keys/${e}/consumers${n?`?${n}`:``}`}},customDomains:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/custom-domains`}),accountCustomDomains:e=>({url:`${U}/v1/accounts/${e}/custom-domains`}),deploymentVersions:e=>({url:`${U}/v1/deployments/${e}/versions`}),environments:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/deployments`}),environmentVariables:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/environment-variables`}),file:(e,t)=>({url:`${U}/v1/deployments/${e}/fs/file?path=${t}`}),fsStats:e=>({url:`${U}/v1/deployments/${e}/fs/stats`}),gitBranches:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$branches`}),projectSyncStatus:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/sync-status`}),maxRpsAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/max-rps?filter=${t}&limit=10${r?`&${r}`:``}`}},meteringBucket:(e,t)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/`}),meteringPlans:(e,t)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/plans`}),meteringSubscriptions:(e,t)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/subscriptions`}),meteringSubscriptionQuotas:(e,t,n)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/subscriptions/${n}/quotas`}),primaryAnalytics:(e,t)=>({url:`${U}/v2/deployments/${e}/analytics/metrics?filter=${t}`}),project:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}`}),projects:e=>({url:`${U}/v1/accounts/${e}/projects`}),permissions:(e,t)=>({url:`${U}/v1/permissions/${e}/${t}`}),permissionsProject:(e,t)=>({url:`${U}/v1/permissions/project/${e}|${t}`}),permissionsAiTeam:e=>({url:`${U}/v1/permissions/ai_team/${e}`}),logViewerRequests:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.cursor&&n.append(`cursor`,t.cursor),t.limit&&n.append(`limit`,t.limit.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/deployments/${e}/logs/requests?${n}`}},logViewerRequestDetail:(e,t,n)=>{let r=new URLSearchParams;n&&r.append(`timestamp`,n);let i=r.toString();return{url:`${U}/v2/deployments/${e}/logs/requests/${t}${i?`?${i}`:``}`}},logViewerHistogram:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/deployments/${e}/logs/histogram?${n}`}},logViewerFacets:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.facets&&n.append(`facets`,t.facets),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/deployments/${e}/logs/facets?${n}`}},logViewerRequestsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.cursor&&n.append(`cursor`,t.cursor),t.limit&&n.append(`limit`,t.limit.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/logs/requests?${n}`}},logViewerRequestDetailScoped:(e,t,n)=>{let r=new URLSearchParams;return r.append(`account`,e.accountName),e.projectName&&r.append(`project`,e.projectName),e.deploymentName&&r.append(`deploymentName`,e.deploymentName),n&&r.append(`timestamp`,n),{url:`${U}/v2/logs/requests/${t}?${r}`}},logViewerHistogramScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/logs/histogram?${n}`}},logViewerFacetsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.facets&&n.append(`facets`,t.facets),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/logs/facets?${n}`}},tracesListScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),t.limit&&n.append(`limit`,String(t.limit)),t.cursor&&n.append(`cursor`,t.cursor),{url:`${U}/v2/traces?${n}`}},traceDetailScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),{url:`${U}/v2/traces/${encodeURIComponent(t)}?${n}`}},traceStatsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),{url:`${U}/v2/trace-stats?${n}`}},traceFacetsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.facets&&n.append(`facets`,t.facets),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),{url:`${U}/v2/trace-facets?${n}`}},topRpsAnalytics:(e,t,n,r)=>{let i=yj(r);return{url:`${U}/v2/deployments/${e}/analytics/top-rps?filter=${t}${n?`&sortBy=${n}`:``}&limit=10${i?`&${i}`:``}`}},topRpsByIpAnalytics:(e,t,n,r)=>{let i=yj(r);return{url:`${U}/v2/deployments/${e}/analytics/top-rps-by-ip?filter=${t}${n?`&sortBy=${n}`:``}&limit=10${i?`&${i}`:``}`}},topTenIpAddressesAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/top-ip-addresses?filter=${t}&limit=10${r?`&${r}`:``}`}},topTenLocationsAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/top-locations?filter=${t}&limit=10${r?`&${r}`:``}`}},topTenRoutesAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/top-routes?filter=${t}&limit=10${r?`&${r}`:``}`}},topTenSubsAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/top-subs?filter=${t}&limit=10${r?`&${r}`:``}`}},usersMe:()=>({url:`${U}/v1/users/me`}),identityConnections:e=>({url:`${U}/v1/accounts/${e}/identity-connections`}),identityConnectionTicket:e=>({url:`${U}/v1/accounts/${e}/identity-connections/ticket`}),mcpBucketConfigurations:e=>({url:`${U}/v1/buckets/${e}/mcp/configurations`}),mcpBucketConfigurationTeam:(e,t)=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams/${t}`}),mcpBucketConfigurationsTeams:e=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams`}),mcpGatewayIdpMetadata:(e,t)=>({url:`${U}/v1/buckets/${e}/mcp/${t}/idp-metadata`}),mcpGatewayOrigins:(e,t,n)=>{let r=new URLSearchParams;n?.limit&&r.append(`limit`,n.limit.toString()),n?.offset&&r.append(`offset`,n.offset.toString());let i=r.toString();return{url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/origins${i?`?${i}`:``}`}},mcpGatewayOriginServer:(e,t,n)=>({url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/origins/${n}`}),mcpGatewayVirtualServers:(e,t,n)=>{let r=new URLSearchParams;n?.limit&&r.append(`limit`,n.limit.toString()),n?.offset&&r.append(`offset`,n.offset.toString());let i=r.toString();return{url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/servers${i?`?${i}`:``}`}},mcpGatewayVirtualServer:(e,t,n)=>({url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/servers/${n}`}),mcpGatewayVirtualServerTools:(e,t,n)=>({url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/servers/${n}/tools`}),analyticsRequests:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return e.compare&&t.append(`compare`,`previous`),{url:`${U}/v2/analytics/requests?${t}`}},analyticsRequestsField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${U}/v2/analytics/requests/fields/${e}?${n}`}},analyticsConsumers:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/consumers?${t}`}},analyticsAgents:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.includeOther===!0&&t.append(`includeOther`,`true`),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/agents?${t}`}},analyticsAgentsTimeSeries:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.includeOther===!0&&t.append(`includeOther`,`true`),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/agents/timeseries?${t}`}},analyticsBackend:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/backend?${t}`}},analyticsEdge:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/edge?${t}`}},analyticsAiGateway:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/ai-gateway?${t}`}},analyticsAiGatewayField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${U}/v2/analytics/ai-gateway/fields/${e}?${n}`}},analyticsAiGatewayTimeseries:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),t.append(`groupBy`,e.groupBy),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.limitGroups&&t.append(`limitGroups`,e.limitGroups.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/ai-gateway/timeseries?${t}`}},analyticsMcp:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/mcp?${t}`}},analyticsGraphql:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/graphql?${t}`}},analyticsMcpField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${U}/v2/analytics/mcp/fields/${e}?${n}`}},analyticsMcpCapabilities:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.view&&t.append(`view`,e.view),e.capabilityType&&t.append(`capabilityType`,e.capabilityType),e.limit&&t.append(`limit`,e.limit.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/mcp/capabilities?${t}`}},analyticsMcpEvents:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.limit!=null&&t.append(`limit`,e.limit.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/mcp/events?${t}`}},analyticsMcpBreakdown:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${U}/v2/analytics/mcp/breakdowns/${e}?${n}`}},analyticsUsage:e=>{let t=new URLSearchParams;return t.append(`account`,e.accountName),t.append(`from`,e.from),t.append(`to`,e.to),{url:`${U}/v2/analytics/usage?${t}`}}},bj={auth:{createApiKey:e=>({url:`${U}/v1/auth/api-keys`,method:`POST`,json:!0,body:JSON.stringify(e),invalidateKeys:[X.authAccountApiKeys(e.accountName)],acceptableStatuses:[200]}),deleteApiKey:(e,t)=>({url:`${U}/v1/auth/api-keys/${e}`,method:`DELETE`,invalidateKeys:[X.authApiKey(e),X.authAccountApiKeys(t)],acceptableStatuses:[204]}),updateUsersRole:({userId:e,accountName:t,projectName:n,role:r})=>({url:`${U}/v1/auth/users/${e}`,method:`PATCH`,json:!0,body:JSON.stringify({accountName:t,projectName:n,role:r}),parseResponse:!1,invalidateKeys:n?[X.authProjectUsersRoles(t,n,{includeInheritedRoles:!1}),X.authProjectUsersRoles(t,n,{includeInheritedRoles:!0}),X.authAccountUsersRoles(t)]:[X.authAccountUsersRoles(t)],acceptableStatuses:[201,200]})},accounts:{createAccount:e=>({url:`${U}/v1/accounts`,method:`POST`,json:!0,body:JSON.stringify(e),invalidateKeys:[X.accounts()],acceptableStatuses:[201]}),deleteAccount:e=>({url:`${U}/v1/accounts/${e.name}`,method:`DELETE`,invalidateKeys:[X.accounts()],acceptableStatuses:[200]}),createCustomDomain:({accountName:e,projectName:t,isAlias:n,hostname:r,deploymentName:i,stage:a})=>({url:`${U}/v1/accounts/${e}/custom-domains`,method:`POST`,body:JSON.stringify({hostname:r,isAlias:n,deploymentName:i,stage:a}),invalidateKeys:[X.accounts(),X.projects(e),X.environments(e,t),X.customDomains(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[200]}),deleteAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${U}/v1/accounts/${e}/account-member-invites/${t}`,method:`DELETE`,invalidateKeys:[X.accountMemberInvites(e)],acceptableStatuses:[204]}),deleteCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${U}/v1/accounts/${e}/custom-domains?hostname=${n}&deploymentName=${r}`,method:`DELETE`,invalidateKeys:[X.accounts(),X.projects(e),X.environments(e,t),X.customDomains(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[204]}),editCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${U}/v1/accounts/${e}/custom-domains`,method:`PATCH`,body:JSON.stringify({hostname:n,deploymentName:r}),invalidateKeys:[X.accounts(),X.projects(e),X.environments(e,t),X.customDomains(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[200]}),resendAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${U}/v1/accounts/${e}/account-member-invites/${t}/$resend`,method:`PATCH`,body:JSON.stringify({}),invalidateKeys:[X.accountMemberInvites(e)],acceptableStatuses:[201]}),billingUpgrade:(e,t,n,r)=>({method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({successUrl:n,cancelUrl:r}),url:`${U}/v1/accounts/${e}/upgrade/${t}`}),updateAccount:({accountName:e,...t})=>({url:`${U}/v1/accounts/${e}`,method:`PATCH`,body:JSON.stringify(t),json:!0,invalidateKeys:[X.accounts()],acceptableStatuses:[200]})},ai:{createBucketConfiguration:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations`,method:`POST`,json:!0,body:JSON.stringify(t),acceptableStatuses:[201,200],invalidateKeys:[X.bucketConfigurations(e),X.bucketConfigurationTeams(e)]}),updateBucketConfiguration:(e,t,n)=>({url:`${U}/v1/buckets/${e}/configurations/${t}`,method:`PATCH`,json:!0,body:JSON.stringify(n),acceptableStatuses:[200,201],invalidateKeys:[X.bucketConfigurationTeams(e),X.bucketConfiguration(e,t),X.bucketConfigurations(e)]}),deleteBucketConfiguration:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations/${t}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[X.bucketConfigurations(e)]}),createBucketConfigurationMember:(e,t,n,r)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members`,method:`POST`,json:!0,body:JSON.stringify({sub:n,role:r}),acceptableStatuses:[201,200],invalidateKeys:[X.bucketConfiguration(e,t),X.bucketConfigurationMembers(e,t)]}),putBucketConfigurationMemberRole:(e,t,n,r)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`PUT`,json:!0,body:JSON.stringify({role:r}),acceptableStatuses:[204,200],invalidateKeys:[X.bucketConfiguration(e,t),X.bucketConfigurationMembers(e,t),X.bucketConfigurationTeams(e)]}),deleteBucketConfigurationMember:(e,t,n)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[X.bucketConfigurationMembers(e,t)]}),updateBucketConfigurationMember:(e,t,n,r)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`PATCH`,json:!0,body:JSON.stringify({role:r}),acceptableStatuses:[200],invalidateKeys:[X.bucketConfigurationMembers(e,t)]}),createBucketAiProvider:(e,{name:t,baseURL:n,label:r,description:i})=>({url:`${U}/v1/buckets/${e}/providers`,method:`POST`,json:!0,body:JSON.stringify({label:r,baseURL:n,name:t,description:i})}),createAiProviderModel:(e,t,{model:n,kind:r,inputCostPerToken:i,outputCostPerToken:a,status:o})=>({url:`${U}/v1/buckets/${e}/providers/${t}/models`,method:`POST`,json:!0,body:JSON.stringify({model:n,kind:r,inputCostPerToken:i,outputCostPerToken:a,status:o}),invalidateKeys:[X.supportedAiProviders(e)],acceptableStatuses:[200]}),createAiProviderAssignment:(e,t,n)=>({url:`${U}/v1/accounts/${e}/projects/${t}/ai-provider-assignments`,method:`POST`,body:JSON.stringify({...n,metadata:JSON.stringify(n.metadata)}),headers:{"content-type":`application/json`},invalidateKeys:[X.aiProviderAssignments(e,t)],acceptableStatuses:[201]}),updateAiProviderAssignment:(e,t,n,r)=>({url:`${U}/v1/accounts/${e}/projects/${t}/ai-provider-assignments/${n}`,method:`PATCH`,body:JSON.stringify({...r,...r.metadata?{metadata:JSON.stringify(r.metadata)}:{}}),headers:{"content-type":`application/json`},invalidateKeys:[X.aiProviderAssignments(e,t)],acceptableStatuses:[200]}),deleteAiProviderAssignment:(e,t,n)=>({url:`${U}/v1/accounts/${e}/projects/${t}/ai-provider-assignments/${n}`,method:`DELETE`,invalidateKeys:[X.aiProviderAssignments(e,t)],acceptableStatuses:[204]})},projects:{createProject:(e,t,{productType:n,...r}={})=>({url:`${U}/v1/accounts/${e}/projects`,method:`POST`,body:JSON.stringify({name:t,productType:n,options:r}),removeKeys:[X.projects(e)],acceptableStatuses:[201]}),createProjectWithRepo:(e,t,n,r,i)=>({url:`${U}/v1/accounts/${e}/projects/$create-with-repo`,method:`POST`,body:JSON.stringify({projectName:t,orgName:n,repositoryName:r,defaultBranch:i}),removeKeys:[X.projects(e)],acceptableStatuses:[201]}),createProjectFromRepo:(e,t,n,r)=>({url:`${U}/v1/accounts/${e}/projects/$create-from-repo`,method:`POST`,body:JSON.stringify({projectName:t,sourceRepoUrl:n,defaultBranch:r}),removeKeys:[X.projects(e)],acceptableStatuses:[201]}),createRepoFromProject:(e,t,n,r,i,a)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$create-repo`,method:`POST`,body:JSON.stringify({orgName:n,repositoryName:r,defaultBranch:i,otherParams:a}),invalidateKeys:[X.projects(e),X.environments(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[201]}),connectProjectToRepo:(e,t,n,r,i,a)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$connect`,method:`PATCH`,body:JSON.stringify({orgName:n,repositoryURL:r,defaultBranch:i,forceConnect:a}),invalidateKeys:[X.projects(e),X.environments(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[201]}),disconnectProjectFromRepo:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$disconnect`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[X.projects(e)],acceptableStatuses:[201]}),initProject:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$init`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[X.projects(e)],acceptableStatuses:[201]}),deleteProject:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}`,method:`DELETE`,invalidateKeys:[X.projects(e),_j.deployments.list(e,t).queryKey],removeKeys:[X.environments(e,t)],acceptableStatuses:[204]}),archiveProject:e=>({url:`${U}/v1/deployments/${e}/archive`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[200]}),updateDefaultBranch:({accountName:e,projectName:t,defaultBranch:n,sourceRepoUrl:r})=>({url:`${U}/v1/accounts/${e}/projects/${t}/$update-default-branch`,method:`PATCH`,body:JSON.stringify({defaultBranch:n,sourceRepoUrl:r}),headers:{"content-type":`application/json`},invalidateKeys:[X.projects(e),_j.deployments.list(e,t).queryKey],removeKeys:[X.environments(e,t)],acceptableStatuses:[200]})},consumers:{createConsumer:e=>{let t={...e.consumer,accountName:e.accountName,projectName:e.projectName,environmentType:e.environmentType};return{url:`${U}/v1/api-keys/${e.bucketId}/consumers`,method:`POST`,body:JSON.stringify(t),headers:{"content-type":`application/json`},invalidateKeys:[X.consumersForBucket(e.bucketId)],acceptableStatuses:[201]}},updateConsumer:e=>({url:`${U}/v1/api-keys/${e.bucketId}/consumers/${e.consumer.id}`,method:`PATCH`,body:JSON.stringify({...e.consumer}),headers:{"content-type":`application/json`},invalidateKeys:[X.consumersForBucket(e.bucketId)],acceptableStatuses:[200]}),removeConsumer:e=>({url:`${U}/v1/api-keys/${e.bucketId}/consumers/${e.consumer.id}`,method:`DELETE`,invalidateKeys:[X.consumersForBucket(e.bucketId)]})},environmentVariables:{updateEnvironmentVariable:e=>({url:`${U}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.variableData.id}`,method:`PATCH`,body:JSON.stringify(e.variableData),invalidateKeys:[X.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[200]}),createEnvironmentVariable:e=>({url:`${U}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables`,method:`POST`,body:JSON.stringify(e.variableData),invalidateKeys:[X.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[201]}),deleteEnvironmentVariable:e=>({url:`${U}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.id}`,method:`DELETE`,invalidateKeys:[X.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[204]})},users:{updatePreferences:e=>({url:`${U}/v1/users/me/preferences`,method:`PUT`,invalidateKeys:[X.user.preferences()],body:JSON.stringify({data:e}),headers:{"content-type":`application/json`},acceptableStatuses:[200]}),requestVerificationEmail:()=>({url:`${U}/v1/users/me/$send-verification-email`,method:`POST`,invalidateKeys:[],acceptableStatuses:[201]}),enrollMfaFactor:e=>({url:`${U}/v1/mfa/factors/enroll`,method:`POST`,body:JSON.stringify({factor:e}),invalidateKeys:[X.mfaFactors()],acceptableStatuses:[200],json:!0}),deleteMfaEnrollment:e=>({url:`${U}/v1/mfa/factors/enrollments/${e}`,method:`DELETE`,invalidateKeys:[X.mfaFactors()],acceptableStatuses:[200]})},sourceControlCredentials:{tokenExchangeSourceControlCredentials:(e,t,n)=>({url:`${U}/v1/accounts/${e}/source-control-configs/${t}/$token-exchange`,method:`POST`,body:JSON.stringify({code:n}),invalidateKeys:[X.accountsSourceControlConfigurations()],acceptableStatuses:[201]}),revokeSourceControlCredentials:(e,t)=>({url:`${U}/v1/accounts/${e}/source-control-configs/${t}/$revoke-token`,method:`DELETE`,invalidateKeys:[X.accountsSourceControlConfigurations()],acceptableStatuses:[204]})},sourceControlOperations:{commitPush:(e,t,n,r)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$commit-push`,method:`POST`,body:JSON.stringify({branchName:r,commitMessage:n}),acceptableStatuses:[201]}),sync:(e,t,n)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$sync`,method:`POST`,body:JSON.stringify({branchName:n}),acceptableStatuses:[201,200],invalidateKeys:[]})},testDesigner:{makeTestRequest:({environmentName:e,testRequest:t,overrideUrl:n})=>{let r={body:t.body,deployment:e,headers:t.headers,method:t.method,overrideUrl:n,path:t.pathname};return{url:`${zf}/v1/test`,method:`POST`,body:JSON.stringify(r),acceptableStatuses:[200],headers:{"content-type":`application/json`}}}},featureRequest:{requestFeature:({email:e,featureName:t,information:n})=>{let r={featureName:t,information:{email:e,...n}};return{url:`${U}/v1/feature-access-request`,method:`POST`,body:JSON.stringify(r),acceptableStatuses:[200],headers:{"content-type":`application/json`}}}},fileTransactions:{saveFile:({environmentName:e,file:t})=>{let n={"content-type":`text/plain`};return t.lastModified&&(n[`if-unmodified-since`]=new Date(t.lastModified).toUTCString()),{url:`${U}/v1/deployments/${e}/fs/file?path=${t.path}`,method:`POST`,body:t.content,headers:n,acceptableStatuses:[204,200],invalidateKeys:[X.file(e,t.path),X.deploymentVersions(e),_j.deployments.versions.list(e).queryKey]}},renameFile:({environmentName:e,path:t,newPath:n})=>({url:`${U}/v1/deployments/${e}/fs/file?path=${t}`,method:`PATCH`,body:JSON.stringify({newPath:n}),acceptableStatuses:[204,200],headers:{"content-type":`application/json`},invalidateKeys:[]}),saveMultipleFiles:async({environmentName:e,files:t})=>{let n=new FormData,r={};for(let e of t)if(e.lastModified){let t=`x-if-unmodified-since-${encodeURIComponent(e.path)}`;r[t]=new Date(e.lastModified).toUTCString()}for(let{content:e,path:r}of t){let t=(await rFe(r))?.id;n.append(`files[]`,new File([e??``],r,{type:t===`text/typescript`?`text/javascript`:t}),r)}let i=t.map(({path:t})=>X.file(e,t));return{url:`${U}/v1/deployments/${e}/fs/files`,method:`POST`,body:n,headers:r,acceptableStatuses:[204,200],invalidateKeys:[...i,X.deploymentVersions(e),_j.deployments.versions.list(e).queryKey]}},deleteFile:({environmentName:e,filePath:t})=>({url:`${U}/v1/deployments/${e}/fs/delete?path=${t}`,method:`DELETE`,acceptableStatuses:[204,200]})},directories:{createDirectory:({environmentName:e,path:t})=>({url:`${U}/v1/deployments/${e}/fs/dir?path=${t}`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[201]})},environments:{redeploy:({environmentName:e,isWorkingCopy:t,version:n})=>({url:t?`${U}/v1/deployments/${e}/$redeploy`:`${U}/v1/deployments/${e}/versions/${n}/$redeploy`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[200],invalidateKeys:[X.deploymentVersions(e),_j.deployments.versions.list(e).queryKey]}),delete:({environmentName:e})=>({url:`${U}/v1/deployments/${e}`,method:`DELETE`,body:JSON.stringify({}),acceptableStatuses:[200]})},accountInvite:{acceptAccountInvite:e=>({url:`${U}/v1/account-member-invites/${e}`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[X.accounts()],acceptableStatuses:[201]}),createAccountInvite:(e,t,n)=>{let r=n?.project?.name?[X.authProjectUsersRoles(e,n.project.name),n.team?.id?X.bucketConfigurationMembers(n.team?.bucketId,n.team?.id):[],X.authProjectUsersRoles(e,n.project.name,{includeInheritedRoles:!1}),X.authProjectUsersRoles(e,n.project.name,{includeInheritedRoles:!0})].flat():[];return{url:`${U}/v1/accounts/${e}/account-member-invites`,method:`POST`,body:JSON.stringify({userEmail:t,metadata:n}),invalidateKeys:[X.accountMemberInvites(e),X.authAccountUsersRoles(e),...r],acceptableStatuses:[201]}}},identity:{chatIdentity:e=>({url:`${U}/v1/chat-identity`,method:`POST`,json:!0,headers:{"content-type":`application/json`},body:JSON.stringify(e),invalidateKeys:[X.chatIdentity()],acceptableStatuses:[200]})},metering:{createMeteringPlan:(e,t,n)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/plans`,method:`POST`,headers:{"Content-Type":`application/json`},invalidateKeys:[X.meteringPlans(e,t),X.meteringBucket(e,t)],body:JSON.stringify(n)}),deleteMeteringPlan:(e,t,n)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/plans/${n}`,invalidateKeys:[X.meteringPlans(e,t),X.meteringBucket(e,t)],method:`DELETE`}),updateMeteringPlan:(e,t,{id:n,...r})=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/plans/${n}`,invalidateKeys:[X.meteringPlans(e,t),X.meteringBucket(e,t)],method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)})},mcpGateway:{deleteMcpTeam:(e,t)=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams/${t}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[X.mcpBucketConfigurationsTeams(e)]}),createMcpTeam:(e,t)=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams`,method:`POST`,json:!0,body:JSON.stringify(t),acceptableStatuses:[201,200],invalidateKeys:[X.mcpBucketConfigurationsTeams(e)]}),updateMcpTeam:(e,t,n)=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams/${t}`,method:`PATCH`,json:!0,body:JSON.stringify(n),acceptableStatuses:[201,200],invalidateKeys:[X.mcpBucketConfigurations(e),X.mcpBucketConfigurationsTeams(e),X.mcpBucketConfigurationTeam(e,t)]})},logs:{sourcemap:e=>({url:`${U}/v1/logs/sourcemap`,method:`POST`,json:!0,body:JSON.stringify(e),acceptableStatuses:[200]})},identityConnections:{createTicket:e=>({url:`${U}/v1/accounts/${e}/identity-connections/ticket`,method:`POST`,json:!0,body:JSON.stringify({}),invalidateKeys:[X.identityConnections(e)],acceptableStatuses:[200]})},migration:{migrateDevPortal:e=>({url:`${U}/v1/migrate/dev-portal`,method:`POST`,json:!1,body:JSON.stringify({deploymentName:e}),headers:{"content-type":`application/json`},acceptableStatuses:[200]})}},xj=e=>{let t=y_(),n=Wg(),r=Aoe();return{fetch:async i=>{let a=Xf(),o;try{o=await qse(t=>{let n=new Headers(i.headers);return i.json&&i.method!==`DELETE`&&n.set(`content-type`,`application/json`),n.set(`authorization`,`Bearer ${t}`),n.set(`zuplo-request-id`,a),fetch(i.url,{...e,method:i.method,headers:n,body:i.body})},n,r)}catch(e){throw e instanceof Lf&&e.setTraceId(a),e instanceof TypeError?new If({type:`https://zup.fail/api-request-failed`,title:`API request failed`,status:500,instance:i.url,traceId:a}):e}if(!(i.acceptableStatuses??[200]).includes(o.status)){let e=new Lf(`Unexpected response: ${o.status} calling ${i.method}: ${i.url}`,{traceId:a});throw await e.tryReadResponse(o),e}return i.invalidateKeys?.forEach(e=>{if(Array.isArray(e))t.invalidateQueries({queryKey:e,exact:!1});else if(`url`in e&&e.url){let n=e.url.split(`?`)[0];t.invalidateQueries({predicate:e=>{let t=e.queryKey[0];return typeof t==`string`&&t.split(`?`)[0]===n}})}}),i.removeKeys?.forEach(e=>{t.removeQueries({queryKey:[e.url]})}),i.parseResponse===!1?o:i.json?await o.json():o}}},iFe=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.directories.createDirectory(t))})},aFe=`API request failed`;async function Sj(e,t,n={}){let{text:r,extractData:i}=n;if(!e||typeof e!=`string`)throw new If({type:`https://zup.fail/missing-url`,title:`Missing URL`});let a=Xf(),o;try{o=await qse(t=>{let n=new Request(e);return n.headers.set(`authorization`,`Bearer ${t}`),n.headers.set(`zuplo-request-id`,a),fetch(n)},t,()=>{$f().then(({handleLogout:e})=>e())})}catch(t){throw t instanceof TypeError?new If({type:`https://zup.fail/api-request-failed`,title:aFe,instance:e,traceId:a},{cause:t}):(t instanceof Lf&&t.setTraceId(a),t)}if(!o.ok){let e=new Lf(`Error while making request. Please try again or contact support if the problem persists.`,{traceId:a});throw await e.tryReadResponse(o),e}try{let e=r?await o.clone().text():await o.clone().json();return i?e.data:e}catch(t){let n=await o.clone().text();throw Ef.captureException(t,{message:`Failed to parse response of ${e} to JSON`,responseText:n,status:o.status,traceId:a,requestUrl:e}),t}}function oFe(e,t={}){let n=Wg();return Use({queries:e.map(e=>({queryKey:[e.url,t.extractData],queryFn:()=>Sj(e.url,n,t)}))})}function Cj(e,{text:t,extractData:n=!0,...r}={}){let i=Wg();return w_({queryKey:[e.url,n],queryFn:async({queryKey:e})=>{let[r]=e;return Sj(r,i,{text:t,extractData:n})},...r})}function wj(e,{enabled:t,text:n,extractData:r,...i}={}){let a=Wg();return C_({enabled:t,queryKey:[e.url,r],queryFn:async({queryKey:e})=>{let[t]=e;return Sj(t,a,{text:n,extractData:r})},...i})}var Tj={".ts":`typescript`,".tsx":`typescript`,".js":`javascript`,".jsx":`javascript`,".mjs":`javascript`,".cjs":`javascript`,".json":`json`,".html":`html`,".htm":`html`,".xml":`xml`,".svg":`xml`,".yaml":`yaml`,".yml":`yaml`,".md":`markdown`,".mdx":`markdown`,".css":`css`,".scss":`scss`,".sass":`sass`,".less":`less`,".py":`python`,".rs":`rust`,".go":`go`,".java":`java`,".c":`c`,".cpp":`cpp`,".cs":`csharp`,".php":`php`,".rb":`ruby`,".sh":`shell`,".bash":`shell`,".zsh":`shell`,".sql":`sql`,".graphql":`graphql`,".gql":`graphql`,".env":`plaintext`,".toml":`toml`,".ini":`ini`,".properties":`properties`,".dockerfile":`dockerfile`,Dockerfile:`dockerfile`,".makefile":`makefile`,Makefile:`makefile`};function Ej(e){let t=e.split(`/`).pop()||``;if(Tj[t])return Tj[t];let n=t.lastIndexOf(`.`);return n===-1?`plaintext`:Tj[t.slice(n)]||`plaintext`}var sFe=(e,t,n)=>wj(X.file(e,t),{...n,text:!0,select:e=>({content:e,contentType:`text/plain`,language:Ej(t),path:t})}),Dj=()=>{let e=xj();return T_({mutationFn:async t=>{let n=await e.fetch({...bj.fileTransactions.saveFile(t),parseResponse:!1}),r=n.headers.get(`Last-Modified`),i=r?new Date(r).getTime():void 0;return{...await n.json(),lastModified:i}}})},Oj=e=>{let t=xj();return T_({mutationFn:async e=>{if(!e.environmentName||!e.files)throw Error(`No environment name or files provided`);return await(await t.fetch(await bj.fileTransactions.saveMultipleFiles(e))).json()},mutationKey:Oj.mutationKey,...e})};Oj.mutationKey=[`saveStatus`];var cFe=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.fileTransactions.deleteFile(t))})},lFe=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.fileTransactions.renameFile(t))})},kj=null,Aj=null;function uFe(){return Aj??=a(()=>import(`./editor.main-9KBOhT8U.js`).then(e=>(kj=e,e)),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),Aj}function jj(){let[e,t]=(0,g.useState)(kj);return(0,g.useEffect)(()=>{if(kj){t(kj);return}let e=!0;return uFe().then(n=>{e&&t(n)}),()=>{e=!1}},[]),e}function Mj(e,t,n){let r=(0,g.useRef)(!1);(0,g.useEffect)(()=>{if(!e)return;if(!r.current){r.current=!0;return}let i=requestAnimationFrame(()=>{if(n.current)try{e.editor.setTheme(t)}catch{}});return()=>cancelAnimationFrame(i)},[e,t,n])}var Nj={display:`flex`,position:`relative`,textAlign:`initial`};function dFe({value:e,defaultValue:t,language:n,defaultLanguage:r,path:i,theme:a=`vs`,line:o,options:s={},overrideServices:c,onChange:l,onMount:u,beforeMount:d,className:f,width:p=`100%`,height:m=`100%`,keepCurrentModel:h=!1,wrapperProps:_}){let v=jj(),y=(0,g.useRef)(null),b=(0,g.useRef)(null),x=(0,g.useRef)(l);x.current=l;let S=(0,g.useRef)(h);S.current=h;let C=(0,g.useRef)(!1);return(0,g.useEffect)(()=>{if(!v)return;let l=y.current;if(!l)return;d?.(v);let f=i?v.Uri.parse(i):void 0,p=f&&v.editor.getModel(f)||v.editor.createModel(e??t??``,n??r,f),m=v.editor.create(l,{...s,model:p,theme:a},c);b.current=m,o!=null&&m.revealLine(o);let h=m.onDidChangeModelContent(e=>{C.current||x.current?.(m.getValue(),e)});return u?.(m,v),()=>{h.dispose();let e=m.getModel();m.dispose(),S.current||e?.dispose(),b.current=null}},[v]),(0,g.useEffect)(()=>{let t=b.current;if(!t||e===void 0)return;let n=t.getModel();!n||e===n.getValue()||(C.current=!0,t.executeEdits(``,[{range:n.getFullModelRange(),text:e,forceMoveMarkers:!0}]),t.pushUndoStop(),C.current=!1)},[e]),(0,g.useEffect)(()=>{let e=b.current?.getModel();v&&e&&n&&v.editor.setModelLanguage(e,n)},[v,n]),Mj(v,a,b),(0,g.useEffect)(()=>{b.current?.updateOptions(s)},[s]),(0,g.useEffect)(()=>{o!=null&&b.current?.revealLine(o)},[o]),(0,W.jsx)(`section`,{..._,style:{...Nj,width:p,height:m},children:(0,W.jsx)(`div`,{ref:y,className:f,style:{width:`100%`}})})}function fFe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,theme:a=`vs`,options:o={},onMount:s,beforeMount:c,className:l,width:u=`100%`,height:d=`100%`,keepCurrentOriginalModel:f=!1,keepCurrentModifiedModel:p=!1,wrapperProps:m}){let h=jj(),_=(0,g.useRef)(null),v=(0,g.useRef)(null),y=(0,g.useRef)(f);y.current=f;let b=(0,g.useRef)(p);return b.current=p,(0,g.useEffect)(()=>{if(!h)return;let l=_.current;if(!l)return;c?.(h);let u=h.editor.createDiffEditor(l,{...o,theme:a});return v.current=u,u.setModel({original:h.editor.createModel(e??``,r??n),modified:h.editor.createModel(t??``,i??n)}),s?.(u,h),()=>{let e=u.getModel();u.dispose(),y.current||e?.original.dispose(),b.current||e?.modified.dispose(),v.current=null}},[h]),(0,g.useEffect)(()=>{let t=v.current?.getModel();t&&e!=null&&e!==t.original.getValue()&&t.original.setValue(e)},[e]),(0,g.useEffect)(()=>{let e=v.current?.getModel();e&&t!=null&&t!==e.modified.getValue()&&e.modified.setValue(t)},[t]),Mj(h,a,v),(0,W.jsx)(`section`,{...m,style:{...Nj,width:u,height:d},children:(0,W.jsx)(`div`,{ref:_,className:l,style:{width:`100%`}})})}var Pj=(e=[])=>{let t=On(),n=Object.keys(t);if(e.some(e=>!n.includes(e)))throw Error(`${e.join(`, `)} are required`);return t};function Fj(e,t){let n=t.map(e=>e.fileGlob),r=t.flatMap(e=>{let t=[e.folderName];return e.subdirectoryGlob?t.concat(e.subdirectoryGlob):t});return e.filter(e=>e.type===$r.Directory&&r.some(t=>rj(e.path,t))?!0:n.find(t=>rj(e.path,t))!==void 0)}function pFe(e,t){return(0,g.useCallback)(async()=>Fj(await rp(t,`/`),e),[t,e])}function Ij(){let{logEvent:e}=Vg(),t=Wj(),n=fh(),r=dh(e=>e.showSaveConflict);return Oj({onMutate:({files:e})=>{e.forEach(e=>{t({...e,saveState:ei.saving})})},onSuccess:async(e,{files:n})=>{n.forEach(n=>{let r=e.files?.[n.path];jf.debug(`Updated ${n.path} after save - lastModified: ${r}`),t({...n,lastModified:r,saveState:ei.unmodified})})},onError:(i,{files:a})=>{if(i instanceof Error&&`status`in i&&i.status===412){let e=i;if(e.instance)try{let t=JSON.parse(e.instance).conflictedFiles;t&&t.length>0&&r(t[0])}catch(e){jf.error(`Failed to parse conflict error instance data`,{error:e})}return}a.forEach(e=>{t({...e,saveState:ei.modified})}),e(`file-save-failed`,{fileNames:n.map(e=>e.path).join(`, `)})}})}function Lj(){let e=lh(),{logEvent:t,captureException:n}=Vg(),r=Uj(),i=Wj(),a=cFe(),{isReadOnly:o}=HA(),{execute:s}=BA(async s=>{if(o)return{success:!1,error:Error(`Unable to delete file - environment is read-only`)};let c=s.saveState;i({...s,saveState:ei.removing});try{return await a.mutateAsync({environmentName:e.environment.name,filePath:s.path}),r(s.path),t(`file-deleted`,{fileName:s.path,account:e.account.name,project:e.project.name,environment:e.environment.name}),{success:!0}}catch(r){return t(`file-deletion-failed`,{account:e.account.name,project:e.project.name,environment:e.environment.name}),n(r),i({...s,saveState:c}),{success:!1,error:r}}});return s}function Rj(){let e=jj(),{logEvent:t,captureException:n}=Vg(),r=Wj(),i=dh(e=>e.projectTreeNodes),a=Dj(),o=lh([`account`,`project`,`environment`]),{execute:s}=BA(async(s,c,l,u,d)=>{if(!e)return;let f=l??u.defaultFileTemplate,p=u.createExtensions[f],m=`${c}/${!p||s.toLowerCase().endsWith(`.${p}`)||s===u.predefinedTemplateFilename?.[f]?s:`${s}.${p}`}`,h=(l&&u.newFileTemplates[l]?.trimStart())??d??``,g=i.find(e=>e.path===m);if(g)return g;if(i.length===0){let e=(await rp(o.environment.name,c).catch(()=>[])).find(e=>e.path===m);if(e)return e}let _={content:h,path:m},v={saveState:ei.new,type:$r.File,..._};try{r(v),e.editor.createModel(_.content??``,void 0,e.Uri.file(m));let n=await a.mutateAsync({environmentName:o.environment.name,file:_,accountName:o.account.name,projectName:o.project.name});return r({...v,lastModified:n.lastModified,saveState:ei.unmodified}),t(`file-added`,{account:o.account.name,project:o.project.name,environment:o.environment.name,fileName:v.path,strategy:u.name}),_}catch(e){t(`file-creation-failed`,{environment:o.environment.name}),n(e),r({...v,saveState:ei.modified});return}});return s}function mFe(e){let t=jj(),{logEvent:n,captureException:r}=Vg(),i=Pj([`account`,`project`]),a=Wj(),o=Uj(),s=lFe(),{execute:c}=BA(async(c,l)=>{if(t)try{a({...c,saveState:ei.removing}),await s.mutateAsync({environmentName:e,path:c.path,newPath:l}),a({...c,saveState:ei.new,path:l}),t.editor.createModel(c.content??``,void 0,t.Uri.file(l));let r=t.editor.getModel(t.Uri.file(c.path));a({...c,path:l}),r?.dispose(),o(c.path),n(`file-renamed`,{fileName:c.path,environment:e})}catch(t){n(`file-rename-failed`,{account:i.account,project:i.project,environment:e}),r(t),a({...c,saveState:ei.unmodified});return}});return c}function hFe(e){let t=jj(),{logEvent:n,captureException:r}=Vg(),i=Wj(),a=iFe(),{execute:o}=BA(async(o,s,c)=>{if(!t)return Error(`Failed to acquire monaco instance. Please refresh the page.`);let l=`${s}/${o}`,u={path:l},d={saveState:ei.new,type:$r.Directory,...u};try{return i(d),await a.mutateAsync({environmentName:e,path:l}),i({...d,saveState:ei.unmodified}),n(`directory-added`,{fileName:d.path,strategy:c.name,environment:e}),u}catch(t){return n(`directory-creation-failed`,{environment:e}),r(t),i({...d,saveState:ei.modified}),t}});return o}function zj(){return Vj(UA().get(`path`))}function Bj(){let e=jj(),t=Wj();return(0,g.useCallback)((n,r=!1,i=ei.modified)=>{if(t({...n,saveState:i}),r&&e){let t=e.editor.getModel(e.Uri.file(n.path));t&&t.setValue(n.content??``)}},[e,t])}function Vj(e){return dh(t=>e?t.filesByPath[e]:void 0)}function gFe(e){let t=dh(e=>e.projectTreeNodes),n=[],r=Object.values(e);return t.filter(e=>e.type===$r.Directory).forEach(e=>{let t=r.find(t=>t.folderName===e.path);if(t)return n.push(t)}),r.sort((e,t)=>e.order-t.order)}function Hj(e){return dh(e=>e.projectTreeNodes).filter(t=>!t.path&&!e.fileGlob?!1:t.type===$r.Directory&&e.subdirectoryGlob?rj(t.path,e.subdirectoryGlob):rj(t.path,e.fileGlob))}function Uj(){let e=jj(),t=dh(e=>e.removeFile),n=dh(e=>e.filterProjectTreeNodes);return r=>{e&&e.editor.getModel(e.Uri.file(r))?.dispose(),t(r),n(e=>e.path!==r)}}function Wj(){return dh(e=>e.updateFile)}var _Fe=e=>{let t=Bj(),n=Vj(e);return e=>{n&&t(n,!0,e)}};function Gj(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Kj(e){return`$import(${e})`}function vFe(e){let t=e.split(`/`).pop();return t?t.replace(`.ts`,``):``}function qj(e,t){let n=/\$import\((.*?)\)/g.exec(e);if(!n||n.length!==2)return`INVALID IMPORT STATEMENT`;let r=n[1];return t!==void 0&&r.indexOf(t)===0?r.substring(t.length):r}var Jj=e=>{let t=``;switch(e){case`GITLAB`:t=`GitLab`;break;case`GITHUB`:t=`GitHub`;break;case`BITBUCKET`:t=`Bitbucket`;break;case`AZURE`:t=`Azure DevOps`;break;default:t=e;break}return t},yFe=(e,t)=>{let n=t.accounts.filter(t=>t.name===e),r;if(n[0].sourceControlConfigurations&&n[0].sourceControlConfigurations.length>0)r=n[0].sourceControlConfigurations[0];else{let e=t.global.filter(e=>e.provider===n[0].sourceControlProvider);r=e.length>0?e[0]:null}return r};function Yj(e){if(!e)return``;if(typeof e==`object`){if(e instanceof Lf)return e.detail??e.title??e.message;if(`message`in e)return e.message}return typeof e==`string`?e:``}var Xj=({error:e,size:t=24})=>{switch(e.status){case 401:return(0,W.jsx)(qm,{size:t});case 403:return(0,W.jsx)(mre,{size:t});case 404:return(0,W.jsx)(wre,{size:t});default:return(0,W.jsx)(Cm,{size:t})}},bFe=({error:e})=>(0,W.jsx)(`div`,{className:`flex items-center gap-2 rounded-full border-2 border-neutral-100 bg-neutral-50 text-neutral-300 p-4`,children:(0,W.jsx)(Xj,{error:e})}),xFe=({error:e})=>{switch(e.status){case 401:return(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/accounts/managing-account-members`,children:`Learn more about Managing Account Members`});default:return null}},SFe=({error:e,title:t=`Unable to access`,children:n,className:r,variant:i=`default`})=>(0,W.jsxs)(PS,{variant:i,className:G(`w-full flex items-center gap-8`,r),children:[(0,W.jsx)(bFe,{error:e}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(FS,{children:t}),(0,W.jsxs)(IS,{className:`flex flex-col gap-2`,children:[Yj(e),(0,W.jsx)(xFe,{error:e}),n]})]})]}),Zj=({successMessage:e}={})=>{let t=ch();return{onSuccess:n=>{t.success(n??e,{icon:(0,W.jsx)(vm,{size:18})})},onError:e=>t.error(Yj(e),{icon:e instanceof Lf?(0,W.jsx)(Xj,{error:e,size:18}):(0,W.jsx)(Cm,{size:18})})}},Qj=(e,t,n)=>C_({..._j.deployments.list(e,t),...n,select:e=>e.data}),$j=(e,t={})=>Wse({..._j.deployments.versions.list(e),...t,select:e=>({...e,data:e.data?.map(e=>({...e,stages:[...e.stages].sort((e,t)=>e.stage.localeCompare(t.stage))}))})}),eM=(e,t={})=>w_($j(e,t)),CFe=()=>{let e=lh(),t=Ij(),n=fh();return eM(e.environment.name),{isPending:t.isPending,isSuccess:t.isSuccess,saveAndDeploy:(0,g.useCallback)(async()=>t.mutateAsync({environmentName:e.environment.name,accountName:e.account.name,projectName:e.project.name,files:n}).catch(e=>{if(!(e instanceof Error&&`status`in e&&e.status===409))throw e}),[t,n,!1,e.environment.name,e.account.name,e.project.name])}},wFe=(e={})=>{let{isReadOnly:t=!1,onSave:n}=e,{saveAndDeploy:r,isPending:i,isSuccess:a}=CFe(),[o,s]=(0,g.useState)(null),c=dh(e=>{let t=0;for(let n of e.projectTreeNodes){let r=n.path?e.filesByPath[n.path]:void 0;r&&r.saveState===ei.modified&&t++}return t}),l=dh(e=>{let t=0;for(let n of e.projectTreeNodes){let r=n.path?e.filesByPath[n.path]:void 0;r&&(r.saveState===ei.modified||r.saveState===ei.saving)&&t++}return t}),u=(0,g.useRef)(null),d=e=>{s(e),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{s(null)},1600)},f=zA(r),p=zA(n),m=sh(e=>e.addToast),h=(0,g.useRef)(!1),_=(0,g.useRef)(!1);return(0,g.useEffect)(()=>{let e=h.current;!e&&i?_.current=l>0:e&&!i&&a&&_.current&&(m({message:`Changes saved`,icon:(0,g.createElement)(vm,{size:18}),duration:2e3}),_.current=!1),h.current=i},[i,a,l,m]),(0,g.useEffect)(()=>{let e=async e=>{try{if(e.code===`KeyS`&&(e.metaKey||e.ctrlKey)){if(e.preventDefault(),t){d(`Read only environment`);return}let n=document.activeElement;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement){let e=n.selectionEnd;n.blur(),n.focus(),(n instanceof HTMLInputElement&&n.type!==`checkbox`||n instanceof HTMLTextAreaElement)&&n.setSelectionRange(e,e),await sPe(100)}if(c===0){d(`No unsaved changes`);return}p.current?.(),await f.current()}}catch(e){jf.error(`Error saving files`,{error:e}),s(`Error saving files`)}};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t,c,f,p]),{showTooltip:o,isSaving:i,unsavedChangesCount:c,saveAll:r}},TFe=()=>{let{showTooltip:e,saveAll:t,isSaving:n,unsavedChangesCount:r}=wFe(),{hasEditor:i,editorName:a,isLoading:o,showPreferenceDialog:s,setShowPreferenceDialog:c,availableEditors:l,savePreference:u,openInEditor:d}=oPe();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`sticky bottom-0 h-12 border-t bg-surface-sunken items-center flex px-2 gap-x-2`,children:[(0,W.jsx)(Mk,{open:!!e,content:e??``,children:(0,W.jsx)(Y,{variant:r>0||n?`default`:`ghost`,size:`sm`,className:`text-xs`,"data-test":`save`,disabled:n,onClick:async()=>{await t()},children:(0,W.jsxs)(Pk,{className:`flex items-center gap-1 text-xs relative`,loading:n,children:[`Save`,(0,W.jsx)(`span`,{className:r>0?`text-white`:`text-muted-foreground`,children:`[⌘+S]`})]})})}),!o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`h-6 w-px bg-border`}),(0,W.jsx)(Mk,{content:i?`Open in ${a}`:`Choose editor to open files`,children:(0,W.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:d,className:`text-xs`,children:[(0,W.jsx)(Pm,{size:14}),`Open in Editor`]})})]})]}),(0,W.jsx)(aPe,{open:s,editors:l,onSelect:u,onCancel:()=>c(!1)})]})},tM=(0,g.createContext)(null);tM.displayName=`PanelGroupContext`;var nM={group:`data-panel-group`,groupDirection:`data-panel-group-direction`,groupId:`data-panel-group-id`,panel:`data-panel`,panelCollapsible:`data-panel-collapsible`,panelId:`data-panel-id`,panelSize:`data-panel-size`,resizeHandle:`data-resize-handle`,resizeHandleActive:`data-resize-handle-active`,resizeHandleEnabled:`data-panel-resize-handle-enabled`,resizeHandleId:`data-panel-resize-handle-id`,resizeHandleState:`data-resize-handle-state`},rM=10,iM=g.useLayoutEffect,aM=g.useId,EFe=typeof aM==`function`?aM:()=>null,DFe=0;function oM(e=null){let t=EFe(),n=(0,g.useRef)(e||t||null);return n.current===null&&(n.current=``+ DFe++),e??n.current}function sM({children:e,className:t=``,collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:a,id:o,maxSize:s,minSize:c,onCollapse:l,onExpand:u,onResize:d,order:f,style:p,tagName:m=`div`,...h}){let _=(0,g.useContext)(tM);if(_===null)throw Error(`Panel components must be rendered within a PanelGroup container`);let{collapsePanel:v,expandPanel:y,getPanelSize:b,getPanelStyle:x,groupId:S,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:T,resizePanel:E,unregisterPanel:D}=_,O=oM(o),k=(0,g.useRef)({callbacks:{onCollapse:l,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:s,minSize:c},id:O,idIsFromProps:o!==void 0,order:f});(0,g.useRef)({didLogMissingDefaultSizeWarning:!1}),iM(()=>{let{callbacks:e,constraints:t}=k.current,a={...t};k.current.id=O,k.current.idIsFromProps=o!==void 0,k.current.order=f,e.onCollapse=l,e.onExpand=u,e.onResize=d,t.collapsedSize=n,t.collapsible=r,t.defaultSize=i,t.maxSize=s,t.minSize=c,(a.collapsedSize!==t.collapsedSize||a.collapsible!==t.collapsible||a.maxSize!==t.maxSize||a.minSize!==t.minSize)&&w(k.current,a)}),iM(()=>{let e=k.current;return T(e),()=>{D(e)}},[f,O,T,D]),(0,g.useImperativeHandle)(a,()=>({collapse:()=>{v(k.current)},expand:e=>{y(k.current,e)},getId(){return O},getSize(){return b(k.current)},isCollapsed(){return C(k.current)},isExpanded(){return!C(k.current)},resize:e=>{E(k.current,e)}}),[v,y,b,C,O,E]);let A=x(k.current,i);return(0,g.createElement)(m,{...h,children:e,className:t,id:O,style:{...A,...p},[nM.groupId]:S,[nM.panel]:``,[nM.panelCollapsible]:r||void 0,[nM.panelId]:O,[nM.panelSize]:parseFloat(``+A.flexGrow).toFixed(1)})}var cM=(0,g.forwardRef)((e,t)=>(0,g.createElement)(sM,{...e,forwardedRef:t}));sM.displayName=`Panel`,cM.displayName=`forwardRef(Panel)`;var OFe;function kFe(){return OFe}var lM=null,AFe=!0,uM=-1,dM=null;function jFe(e,t){if(t){let e=(t&xM)!==0,n=(t&SM)!==0,r=(t&CM)!==0,i=(t&wM)!==0;if(e)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}switch(e){case`horizontal`:return`ew-resize`;case`intersection`:return`move`;case`vertical`:return`ns-resize`}}function MFe(){dM!==null&&(document.head.removeChild(dM),lM=null,dM=null,uM=-1)}function fM(e,t){if(!AFe)return;let n=jFe(e,t);if(lM!==n){if(lM=n,dM===null){dM=document.createElement(`style`);let e=kFe();e&&dM.setAttribute(`nonce`,e),document.head.appendChild(dM)}if(uM>=0){var r;(r=dM.sheet)==null||r.removeRule(uM)}uM=dM.sheet?.insertRule(`*{cursor: ${n} !important;}`)??-1}}function pM(e){return e.type===`keydown`}function mM(e){return e.type.startsWith(`pointer`)}function hM(e){return e.type.startsWith(`mouse`)}function gM(e){if(mM(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(hM(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function NFe(){if(typeof matchMedia==`function`)return matchMedia(`(pointer:coarse)`).matches?`coarse`:`fine`}function PFe(e,t,n){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function FFe(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:yM(e),b:yM(t)},r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;zM(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:vM(_M(n.a)),b:vM(_M(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var IFe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function LFe(e){let t=getComputedStyle(bM(e)??e).display;return t===`flex`||t===`inline-flex`}function RFe(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||LFe(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||IFe.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function _M(e){let t=e.length;for(;t--;){let n=e[t];if(zM(n,`Missing node`),RFe(n))return n}return null}function vM(e){return e&&Number(getComputedStyle(e).zIndex)||0}function yM(e){let t=[];for(;e;)t.push(e),e=bM(e);return t}function bM(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}var xM=1,SM=2,CM=4,wM=8,zFe=NFe()===`coarse`,TM=[],EM=!1,DM=new Map,OM=new Map,kM=new Set;function BFe(e,t,n,r,i){let{ownerDocument:a}=t,o={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},s=DM.get(a)??0;return DM.set(a,s+1),kM.add(o),LM(),function(){OM.delete(e),kM.delete(o);let t=DM.get(a)??1;if(DM.set(a,t-1),LM(),t===1&&DM.delete(a),TM.includes(o)){let e=TM.indexOf(o);e>=0&&TM.splice(e,1),FM(),i(`up`,!0,null)}}}function VFe(e){let{target:t}=e,{x:n,y:r}=gM(e);EM=!0,NM({target:t,x:n,y:r}),LM(),TM.length>0&&(RM(`down`,e),e.preventDefault(),MM(t)||e.stopImmediatePropagation())}function AM(e){let{x:t,y:n}=gM(e);if(EM&&e.buttons===0&&(EM=!1,RM(`up`,e)),!EM){let{target:r}=e;NM({target:r,x:t,y:n})}RM(`move`,e),FM(),TM.length>0&&e.preventDefault()}function jM(e){let{target:t}=e,{x:n,y:r}=gM(e);OM.clear(),EM=!1,TM.length>0&&(e.preventDefault(),MM(t)||e.stopImmediatePropagation()),RM(`up`,e),NM({target:t,x:n,y:r}),FM(),LM()}function MM(e){let t=e;for(;t;){if(t.hasAttribute(nM.resizeHandle))return!0;t=t.parentElement}return!1}function NM({target:e,x:t,y:n}){TM.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),kM.forEach(e=>{let{element:i,hitAreaMargins:a}=e,o=i.getBoundingClientRect(),{bottom:s,left:c,right:l,top:u}=o,d=zFe?a.coarse:a.fine;if(t>=c-d&&t<=l+d&&n>=u-d&&n<=s+d){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&FFe(r,i)>0){let e=r,t=!1;for(;e&&!e.contains(i);){if(PFe(e.getBoundingClientRect(),o,!0)){t=!0;break}e=e.parentElement}if(t)return}TM.push(e)}})}function PM(e,t){OM.set(e,t)}function FM(){let e=!1,t=!1;TM.forEach(n=>{let{direction:r}=n;r===`horizontal`?e=!0:t=!0});let n=0;OM.forEach(e=>{n|=e}),e&&t?fM(`intersection`,n):e?fM(`horizontal`,n):t?fM(`vertical`,n):MFe()}var IM=new AbortController;function LM(){IM.abort(),IM=new AbortController;let e={capture:!0,signal:IM.signal};kM.size&&(EM?(TM.length>0&&DM.forEach((t,n)=>{let{body:r}=n;t>0&&(r.addEventListener(`contextmenu`,jM,e),r.addEventListener(`pointerleave`,AM,e),r.addEventListener(`pointermove`,AM,e))}),window.addEventListener(`pointerup`,jM,e),window.addEventListener(`pointercancel`,jM,e)):DM.forEach((t,n)=>{let{body:r}=n;t>0&&(r.addEventListener(`pointerdown`,VFe,e),r.addEventListener(`pointermove`,AM,e))}))}function RM(e,t){kM.forEach(n=>{let{setResizeHandlerState:r}=n;r(e,TM.includes(n),t)})}function HFe(){let[e,t]=(0,g.useState)(0);return(0,g.useCallback)(()=>t(e=>e+1),[])}function zM(e,t){if(!e)throw console.error(t),Error(t)}function BM(e,t,n=rM){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function VM(e,t,n=rM){return BM(e,t,n)===0}function HM(e,t,n){return BM(e,t,n)===0}function UFe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(!HM(i,a,n))return!1}return!0}function UM({panelConstraints:e,panelIndex:t,size:n}){let r=e[t];zM(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r;if(BM(n,s)<0)if(a){let e=(i+s)/2;n=BM(n,e)<0?i:s}else n=s;return n=Math.min(o,n),n=parseFloat(n.toFixed(rM)),n}function WM({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(HM(e,0))return t;let o=[...t],[s,c]=r;zM(s!=null,`Invalid first pivot index`),zM(c!=null,`Invalid second pivot index`);let l=0;if(a===`keyboard`){{let r=e<0?c:s,i=n[r];zM(i,`Panel constraints not found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(zM(n!=null,`Previous layout not found for panel index ${r}`),HM(n,a)){let t=l-n;BM(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let r=e<0?s:c,i=n[r];zM(i,`No panel constraints found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(zM(n!=null,`Previous layout not found for panel index ${r}`),HM(n,l)){let t=n-a;BM(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?c:s,a=0;for(;;){let e=t[i];zM(e!=null,`Previous layout not found for panel index ${i}`);let o=UM({panelConstraints:n,panelIndex:i,size:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let o=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-o:o}{let r=e<0?s:c;for(;r>=0&&r<n.length;){let i=Math.abs(e)-Math.abs(l),a=t[r];zM(a!=null,`Previous layout not found for panel index ${r}`);let s=a-i,c=UM({panelConstraints:n,panelIndex:r,size:s});if(!HM(a,c)&&(l+=a-c,o[r]=c,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?r--:r++}}if(UFe(i,o))return i;{let r=e<0?c:s,i=t[r];zM(i!=null,`Previous layout not found for panel index ${r}`);let a=i+l,u=UM({panelConstraints:n,panelIndex:r,size:a});if(o[r]=u,!HM(u,a)){let t=a-u,r=e<0?c:s;for(;r>=0&&r<n.length;){let i=o[r];zM(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=UM({panelConstraints:n,panelIndex:r,size:a});if(HM(i,s)||(t-=s-i,o[r]=s),HM(t,0))break;e>0?r--:r++}}}return HM(o.reduce((e,t)=>t+e,0),100)?o:i}function WFe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];return zM(s!=null,`No pivot index found`),t.forEach((e,t)=>{let{constraints:n}=e,{maxSize:c=100,minSize:l=0}=n;t===s?(r=l,i=c):(a+=l,o+=c)}),{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function GM(e,t=document){return Array.from(t.querySelectorAll(`[${nM.resizeHandleId}][data-panel-group-id="${e}"]`))}function KM(e,t,n=document){return GM(e,n).findIndex(e=>e.getAttribute(nM.resizeHandleId)===t)??null}function qM(e,t,n){let r=KM(e,t,n);return r==null?[-1,-1]:[r,r+1]}function JM(e,t=document){return t instanceof HTMLElement&&t?.dataset?.panelGroupId==e?t:t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`)||null}function YM(e,t=document){return t.querySelector(`[${nM.resizeHandleId}="${e}"]`)||null}function GFe(e,t,n,r=document){let i=YM(t,r),a=GM(e,r),o=i?a.indexOf(i):-1;return[n[o]?.id??null,n[o+1]?.id??null]}function KFe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:a,setLayout:o}){(0,g.useRef)({didWarnAboutMissingResizeHandle:!1}),iM(()=>{if(!a)return;let e=GM(n,a);for(let t=0;t<i.length-1;t++){let{valueMax:n,valueMin:a,valueNow:o}=WFe({layout:r,panelsArray:i,pivotIndices:[t,t+1]}),s=e[t];if(s!=null){let e=i[t];zM(e,`No panel data found for index "${t}"`),s.setAttribute(`aria-controls`,e.id),s.setAttribute(`aria-valuemax`,``+Math.round(n)),s.setAttribute(`aria-valuemin`,``+Math.round(a)),s.setAttribute(`aria-valuenow`,o==null?``:``+Math.round(o))}}return()=>{e.forEach((e,t)=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)})}},[n,r,i,a]),(0,g.useEffect)(()=>{if(!a)return;let e=t.current;zM(e,`Eager values not found`);let{panelDataArray:i}=e;zM(JM(n,a)!=null,`No group found for id "${n}"`);let s=GM(n,a);zM(s,`No resize handles found for group id "${n}"`);let c=s.map(e=>{let t=e.getAttribute(nM.resizeHandleId);zM(t,`Resize handle element has no handle id attribute`);let[s,c]=GFe(n,t,i,a);if(s==null||c==null)return()=>{};let l=e=>{if(!e.defaultPrevented)switch(e.key){case`Enter`:{e.preventDefault();let c=i.findIndex(e=>e.id===s);if(c>=0){let e=i[c];zM(e,`No panel data found for index ${c}`);let s=r[c],{collapsedSize:l=0,collapsible:u,minSize:d=0}=e.constraints;if(s!=null&&u){let e=WM({delta:HM(s,l)?d-l:l-s,initialLayout:r,panelConstraints:i.map(e=>e.constraints),pivotIndices:qM(n,t,a),prevLayout:r,trigger:`keyboard`});r!==e&&o(e)}}break}}};return e.addEventListener(`keydown`,l),()=>{e.removeEventListener(`keydown`,l)}});return()=>{c.forEach(e=>e())}},[a,e,t,n,r,i,o])}function XM(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ZM(e,t){let n=e===`horizontal`,{x:r,y:i}=gM(t);return n?r:i}function qFe(e,t,n,r,i){let a=n===`horizontal`,o=YM(t,i);zM(o,`No resize handle element found for id "${t}"`);let s=o.getAttribute(nM.groupId);zM(s,`Resize handle element has no group id attribute`);let{initialCursorPosition:c}=r,l=ZM(n,e),u=JM(s,i);zM(u,`No group element found for id "${s}"`);let d=u.getBoundingClientRect(),f=a?d.width:d.height;return(l-c)/f*100}function JFe(e,t,n,r,i,a){if(pM(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100;break}return a}else return r==null?0:qFe(e,t,n,r,a)}function YFe({panelDataArray:e}){let t=Array(e.length),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a<e.length;a++){let e=n[a];zM(e,`Panel constraints not found for index ${a}`);let{defaultSize:o}=e;o!=null&&(r++,t[a]=o,i-=o)}for(let a=0;a<e.length;a++){let o=n[a];zM(o,`Panel constraints not found for index ${a}`);let{defaultSize:s}=o;if(s!=null)continue;let c=e.length-r,l=i/c;r++,t[a]=l,i-=l}return t}function QM(e,t,n){t.forEach((t,r)=>{let i=e[r];zM(i,`Panel data not found for index ${r}`);let{callbacks:a,constraints:o,id:s}=i,{collapsedSize:c=0,collapsible:l}=o,u=n[s];if(u==null||t!==u){n[s]=t;let{onCollapse:e,onExpand:r,onResize:i}=a;i&&i(t,u),l&&(e||r)&&(r&&(u==null||VM(u,c))&&!VM(t,c)&&r(),e&&(u==null||!VM(u,c))&&VM(t,c)&&e())}})}function $M(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function XFe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e==null?`1`:e.toPrecision(a):r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function ZFe(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function eN(e){try{if(typeof localStorage<`u`)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error(`localStorage not supported in this environment`)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function tN(e){return`react-resizable-panels:${e}`}function nN(e){return e.map(e=>{let{constraints:t,id:n,idIsFromProps:r,order:i}=e;return r?n:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(`,`)}function rN(e,t){try{let n=tN(e),r=t.getItem(n);if(r){let e=JSON.parse(r);if(typeof e==`object`&&e)return e}}catch{}return null}function QFe(e,t,n){return(rN(e,n)??{})[nN(t)]??null}function $Fe(e,t,n,r,i){let a=tN(e),o=nN(t),s=rN(e,i)??{};s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}function iN({layout:e,panelConstraints:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!HM(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];zM(t!=null,`No layout data found for index ${e}`),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];zM(r!=null,`No layout data found for index ${e}`);let a=UM({panelConstraints:t,panelIndex:e,size:r});r!=a&&(i+=r-a,n[e]=a)}if(!HM(i,0))for(let e=0;e<t.length;e++){let r=n[e];zM(r!=null,`No layout data found for index ${e}`);let a=r+i,o=UM({panelConstraints:t,panelIndex:e,size:a});if(r!==o&&(i-=o-r,n[e]=o,HM(i,0)))break}return n}var eIe=100,aN={getItem:e=>(eN(aN),aN.getItem(e)),setItem:(e,t)=>{eN(aN),aN.setItem(e,t)}},oN={};function sN({autoSaveId:e=null,children:t,className:n=``,direction:r,forwardedRef:i,id:a=null,onLayout:o=null,keyboardResizeBy:s=null,storage:c=aN,style:l,tagName:u=`div`,...d}){let f=oM(a),p=(0,g.useRef)(null),[m,h]=(0,g.useState)(null),[_,v]=(0,g.useState)([]),y=HFe(),b=(0,g.useRef)({}),x=(0,g.useRef)(new Map),S=(0,g.useRef)(0),C=(0,g.useRef)({autoSaveId:e,direction:r,dragState:m,id:f,keyboardResizeBy:s,onLayout:o,storage:c}),w=(0,g.useRef)({layout:_,panelDataArray:[],panelDataArrayChanged:!1});(0,g.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,g.useImperativeHandle)(i,()=>({getId:()=>C.current.id,getLayout:()=>{let{layout:e}=w.current;return e},setLayout:e=>{let{onLayout:t}=C.current,{layout:n,panelDataArray:r}=w.current,i=iN({layout:e,panelConstraints:r.map(e=>e.constraints)});XM(n,i)||(v(i),w.current.layout=i,t&&t(i),QM(r,i,b.current))}}),[]),iM(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=m,C.current.id=f,C.current.onLayout=o,C.current.storage=c}),KFe({committedValuesRef:C,eagerValuesRef:w,groupId:f,layout:_,panelDataArray:w.current.panelDataArray,setLayout:v,panelGroupElement:p.current}),(0,g.useEffect)(()=>{let{panelDataArray:t}=w.current;if(e){if(_.length===0||_.length!==t.length)return;let n=oN[e];n??(n=ZFe($Fe,eIe),oN[e]=n);let r=[...t],i=new Map(x.current);n(e,r,i,_,c)}},[e,_,c]),(0,g.useEffect)(()=>{});let T=(0,g.useCallback)(e=>{let{onLayout:t}=C.current,{layout:n,panelDataArray:r}=w.current;if(e.constraints.collapsible){let i=r.map(e=>e.constraints),{collapsedSize:a=0,panelSize:o,pivotIndices:s}=uN(r,e,n);if(zM(o!=null,`Panel size not found for panel "${e.id}"`),!VM(o,a)){x.current.set(e.id,o);let c=WM({delta:lN(r,e)===r.length-1?o-a:a-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:`imperative-api`});$M(n,c)||(v(c),w.current.layout=c,t&&t(c),QM(r,c,b.current))}}},[]),E=(0,g.useCallback)((e,t)=>{let{onLayout:n}=C.current,{layout:r,panelDataArray:i}=w.current;if(e.constraints.collapsible){let a=i.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:c=0,pivotIndices:l}=uN(i,e,r),u=t??c;if(VM(s,o)){let t=x.current.get(e.id),o=t!=null&&t>=u?t:u,c=WM({delta:lN(i,e)===i.length-1?s-o:o-s,initialLayout:r,panelConstraints:a,pivotIndices:l,prevLayout:r,trigger:`imperative-api`});$M(r,c)||(v(c),w.current.layout=c,n&&n(c),QM(i,c,b.current))}}},[]),D=(0,g.useCallback)(e=>{let{layout:t,panelDataArray:n}=w.current,{panelSize:r}=uN(n,e,t);return zM(r!=null,`Panel size not found for panel "${e.id}"`),r},[]),O=(0,g.useCallback)((e,t)=>{let{panelDataArray:n}=w.current;return XFe({defaultSize:t,dragState:m,layout:_,panelData:n,panelIndex:lN(n,e)})},[m,_]),k=(0,g.useCallback)(e=>{let{layout:t,panelDataArray:n}=w.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=uN(n,e,t);return zM(a!=null,`Panel size not found for panel "${e.id}"`),i===!0&&VM(a,r)},[]),A=(0,g.useCallback)(e=>{let{layout:t,panelDataArray:n}=w.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=uN(n,e,t);return zM(a!=null,`Panel size not found for panel "${e.id}"`),!i||BM(a,r)>0},[]),j=(0,g.useCallback)(e=>{let{panelDataArray:t}=w.current;t.push(e),t.sort((e,t)=>{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),w.current.panelDataArrayChanged=!0,y()},[y]);iM(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;let{autoSaveId:e,onLayout:t,storage:n}=C.current,{layout:r,panelDataArray:i}=w.current,a=null;if(e){let t=QFe(e,i,n);t&&(x.current=new Map(Object.entries(t.expandToSizes)),a=t.layout)}a??=YFe({panelDataArray:i});let o=iN({layout:a,panelConstraints:i.map(e=>e.constraints)});XM(r,o)||(v(o),w.current.layout=o,t&&t(o),QM(i,o,b.current))}}),iM(()=>{let e=w.current;return()=>{e.layout=[]}},[]);let M=(0,g.useCallback)(e=>{let t=!1,n=p.current;return n&&window.getComputedStyle(n,null).getPropertyValue(`direction`)===`rtl`&&(t=!0),function(n){n.preventDefault();let r=p.current;if(!r)return()=>null;let{direction:i,dragState:a,id:o,keyboardResizeBy:s,onLayout:c}=C.current,{layout:l,panelDataArray:u}=w.current,{initialLayout:d}=a??{},f=qM(o,e,r),m=JFe(n,e,i,a,s,r),h=i===`horizontal`;h&&t&&(m=-m);let g=u.map(e=>e.constraints),_=WM({delta:m,initialLayout:d??l,panelConstraints:g,pivotIndices:f,prevLayout:l,trigger:pM(n)?`keyboard`:`mouse-or-touch`}),y=!$M(l,_);(mM(n)||hM(n))&&S.current!=m&&(S.current=m,!y&&m!==0?h?PM(e,m<0?xM:SM):PM(e,m<0?CM:wM):PM(e,0)),y&&(v(_),w.current.layout=_,c&&c(_),QM(u,_,b.current))}},[]),N=(0,g.useCallback)((e,t)=>{let{onLayout:n}=C.current,{layout:r,panelDataArray:i}=w.current,a=i.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=uN(i,e,r);zM(o!=null,`Panel size not found for panel "${e.id}"`);let c=WM({delta:lN(i,e)===i.length-1?o-t:t-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:`imperative-api`});$M(r,c)||(v(c),w.current.layout=c,n&&n(c),QM(i,c,b.current))},[]),P=(0,g.useCallback)((e,t)=>{let{layout:n,panelDataArray:r}=w.current,{collapsedSize:i=0,collapsible:a}=t,{collapsedSize:o=0,collapsible:s,maxSize:c=100,minSize:l=0}=e.constraints,{panelSize:u}=uN(r,e,n);u!=null&&(a&&s&&VM(u,i)?VM(i,o)||N(e,o):u<l?N(e,l):u>c&&N(e,c))},[N]),F=(0,g.useCallback)((e,t)=>{let{direction:n}=C.current,{layout:r}=w.current;if(!p.current)return;let i=YM(e,p.current);zM(i,`Drag handle element not found for id "${e}"`);let a=ZM(n,t);h({dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r})},[]),I=(0,g.useCallback)(()=>{h(null)},[]),L=(0,g.useCallback)(e=>{let{panelDataArray:t}=w.current,n=lN(t,e);n>=0&&(t.splice(n,1),delete b.current[e.id],w.current.panelDataArrayChanged=!0,y())},[y]),R=(0,g.useMemo)(()=>({collapsePanel:T,direction:r,dragState:m,expandPanel:E,getPanelSize:D,getPanelStyle:O,groupId:f,isPanelCollapsed:k,isPanelExpanded:A,reevaluatePanelConstraints:P,registerPanel:j,registerResizeHandle:M,resizePanel:N,startDragging:F,stopDragging:I,unregisterPanel:L,panelGroupElement:p.current}),[T,m,r,E,D,O,f,k,A,P,j,M,N,F,I,L]),z={display:`flex`,flexDirection:r===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`};return(0,g.createElement)(tM.Provider,{value:R},(0,g.createElement)(u,{...d,children:t,className:n,id:a,ref:p,style:{...z,...l},[nM.group]:``,[nM.groupDirection]:r,[nM.groupId]:f}))}var cN=(0,g.forwardRef)((e,t)=>(0,g.createElement)(sN,{...e,forwardedRef:t}));sN.displayName=`PanelGroup`,cN.displayName=`forwardRef(PanelGroup)`;function lN(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function uN(e,t,n){let r=lN(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}function tIe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){(0,g.useEffect)(()=>{if(e||n==null||r==null)return;let i=YM(t,r);if(i==null)return;let a=e=>{if(!e.defaultPrevented)switch(e.key){case`ArrowDown`:case`ArrowLeft`:case`ArrowRight`:case`ArrowUp`:case`End`:case`Home`:e.preventDefault(),n(e);break;case`F6`:{e.preventDefault();let n=i.getAttribute(nM.groupId);zM(n,`No group element found for id "${n}"`);let a=GM(n,r),o=KM(n,t,r);zM(o!==null,`No resize element found for id "${t}"`),a[e.shiftKey?o>0?o-1:a.length-1:o+1<a.length?o+1:0].focus();break}}};return i.addEventListener(`keydown`,a),()=>{i.removeEventListener(`keydown`,a)}},[r,e,t,n])}function dN({children:e=null,className:t=``,disabled:n=!1,hitAreaMargins:r,id:i,onBlur:a,onClick:o,onDragging:s,onFocus:c,onPointerDown:l,onPointerUp:u,style:d={},tabIndex:f=0,tagName:p=`div`,...m}){let h=(0,g.useRef)(null),_=(0,g.useRef)({onClick:o,onDragging:s,onPointerDown:l,onPointerUp:u});(0,g.useEffect)(()=>{_.current.onClick=o,_.current.onDragging=s,_.current.onPointerDown=l,_.current.onPointerUp=u});let v=(0,g.useContext)(tM);if(v===null)throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);let{direction:y,groupId:b,registerResizeHandle:x,startDragging:S,stopDragging:C,panelGroupElement:w}=v,T=oM(i),[E,D]=(0,g.useState)(`inactive`),[O,k]=(0,g.useState)(!1),[A,j]=(0,g.useState)(null),M=(0,g.useRef)({state:E});iM(()=>{M.current.state=E}),(0,g.useEffect)(()=>{if(n)j(null);else{let e=x(T);j(()=>e)}},[n,T,x]);let N=r?.coarse??15,P=r?.fine??5;(0,g.useEffect)(()=>{if(n||A==null)return;let e=h.current;zM(e,`Element ref not attached`);let t=!1;return BFe(T,e,y,{coarse:N,fine:P},(e,n,r)=>{if(!n){D(`inactive`);return}switch(e){case`down`:{D(`drag`),t=!1,zM(r,`Expected event to be defined for "down" action`),S(T,r);let{onDragging:e,onPointerDown:n}=_.current;e?.(!0),n?.();break}case`move`:{let{state:e}=M.current;t=!0,e!==`drag`&&D(`hover`),zM(r,`Expected event to be defined for "move" action`),A(r);break}case`up`:{D(`hover`),C();let{onClick:e,onDragging:n,onPointerUp:r}=_.current;n?.(!1),r?.(),t||e?.();break}}})},[N,y,n,P,x,T,A,S,C]),tIe({disabled:n,handleId:T,resizeHandler:A,panelGroupElement:w});let F={touchAction:`none`,userSelect:`none`};return(0,g.createElement)(p,{...m,children:e,className:t,id:i,onBlur:()=>{k(!1),a?.()},onFocus:()=>{k(!0),c?.()},ref:h,role:`separator`,style:{...F,...d},tabIndex:f,[nM.groupDirection]:y,[nM.groupId]:b,[nM.resizeHandle]:``,[nM.resizeHandleActive]:E===`drag`?`pointer`:O?`keyboard`:void 0,[nM.resizeHandleEnabled]:!n,[nM.resizeHandleId]:T,[nM.resizeHandleState]:E})}dN.displayName=`PanelResizeHandle`;var fN=({className:e,...t})=>(0,W.jsx)(cN,{className:G(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...t}),pN=cM,mN=({withHandle:e,className:t,...n})=>(0,W.jsx)(dN,{className:G(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90`,t),...n,children:e&&(0,W.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border`,children:(0,W.jsx)(zre,{className:`h-2.5 w-2.5`})})});function hN({className:e,...t}){return(0,W.jsx)(`div`,{className:G(`animate-pulse rounded-md bg-primary/10`,e),...t})}var nIe=(0,g.createContext)(null),gN={didCatch:!1,error:null},rIe=class extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=gN}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(gN))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&iIe(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(gN))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,g.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,g.createElement)(nIe.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function iIe(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}var _N=({children:e,fallback:t})=>{let n=Bg();return(0,W.jsx)(rIe,{onError:(e,t)=>{let r={componentStack:t.componentStack};(e instanceof If||e instanceof Lf)&&(r.errorType=e.type,r.errorStatus=e.status,r.errorDetail=e.detail,r.errorInstance=e.instance,r.traceId=e.traceId),n.captureException(e,r)},fallbackRender:({error:e,resetErrorBoundary:n})=>t({error:e,resetError:n}),children:e})},vN=({className:e})=>(0,W.jsxs)(`svg`,{className:e,viewBox:`0 0 86 86`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,children:[(0,W.jsx)(`title`,{children:`open-api-icon`}),(0,W.jsx)(`g`,{id:`Page-1`,stroke:`none`,strokeWidth:`1`,fill:`none`,fillRule:`evenodd`,children:(0,W.jsxs)(`g`,{id:`open-api-icon`,fill:`currentColor`,children:[(0,W.jsx)(`path`,{d:`M35,16 C39.1263484,16 43.0859173,16.7140679 46.7618776,18.0253747 L36.7225172,28.0635294 C36.1538485,28.0214262 35.5794264,28 35,28 C22.2974508,28 12,38.2974508 12,51 C12,63.7025492 22.2974508,74 35,74 C47.7025492,74 58,63.7025492 58,51 C58,50.4205736 57.9785738,49.8461515 57.9364706,49.2774828 L67.9749824,39.2391236 C69.2860617,42.9148016 70,46.8740262 70,51 C70,70.3299662 54.3299662,86 35,86 C15.6700338,86 0,70.3299662 0,51 C0,31.6700338 15.6700338,16 35,16 Z`,id:`Combined-Shape`}),(0,W.jsx)(`circle`,{id:`Oval`,cx:`35`,cy:`51`,r:`13`}),(0,W.jsx)(`circle`,{id:`Oval-Copy`,cx:`73`,cy:`13`,r:`13`}),(0,W.jsx)(`rect`,{id:`Rectangle`,transform:`translate(54.091883, 31.908117) rotate(-45.000000) translate(-54.091883, -31.908117) `,x:`27.0918831`,y:`26.4081169`,width:`54`,height:`11`})]})})]});function yN(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function aIe(e,t=[]){let n=[];function r(t,r){let i=g.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=g.useMemo(()=>o,Object.values(o));return(0,W.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=g.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>g.createContext(e));return function(n){let r=n?.[e]||t;return g.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,oIe(i,...t)]}function oIe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function bN(e,t=[]){let n=[];function r(t,r){let i=g.createContext(r),a=n.length;n=[...n,r];function o(t){let{scope:n,children:r,...o}=t,s=n?.[e][a]||i,c=g.useMemo(()=>o,Object.values(o));return(0,W.jsx)(s.Provider,{value:c,children:r})}function s(n,o){let s=o?.[e][a]||i,c=g.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return o.displayName=t+`Provider`,[o,s]}let i=()=>{let t=n.map(e=>g.createContext(e));return function(n){let r=n?.[e]||t;return g.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,sIe(i,...t)]}function sIe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function cIe(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function xN(...e){return t=>e.forEach(e=>cIe(e,t))}function SN(...e){return g.useCallback(xN(...e),e)}var CN=g.forwardRef((e,t)=>{let{children:n,...r}=e,i=g.Children.toArray(n),a=i.find(uIe);if(a){let e=a.props.children,n=i.map(t=>t===a?g.Children.count(e)>1?g.Children.only(null):g.isValidElement(e)?e.props.children:null:t);return(0,W.jsx)(wN,{...r,ref:t,children:g.isValidElement(e)?g.cloneElement(e,void 0,n):null})}return(0,W.jsx)(wN,{...r,ref:t,children:n})});CN.displayName=`Slot`;var wN=g.forwardRef((e,t)=>{let{children:n,...r}=e;if(g.isValidElement(n)){let e=fIe(n);return g.cloneElement(n,{...dIe(r,n.props),ref:t?xN(t,e):e})}return g.Children.count(n)>1?g.Children.only(null):null});wN.displayName=`SlotClone`;var lIe=({children:e})=>(0,W.jsx)(W.Fragment,{children:e});function uIe(e){return g.isValidElement(e)&&e.type===lIe}function dIe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{a(...e),i(...e)}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function fIe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function pIe(e){let t=e+`CollectionProvider`,[n,r]=bN(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=g.useRef(null),a=g.useRef(new Map).current;return(0,W.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=g.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,W.jsx)(CN,{ref:SN(t,a(s,n).collectionRef),children:r})});c.displayName=s;let l=e+`CollectionItemSlot`,u=`data-radix-collection-item`,d=g.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=g.useRef(null),s=SN(t,o),c=a(l,n);return g.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,W.jsx)(CN,{[u]:``,ref:s,children:r})});d.displayName=l;function f(t){let n=a(e+`CollectionConsumer`,t);return g.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${u}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:c,ItemSlot:d},f,r]}var TN=globalThis?.document?g.useLayoutEffect:()=>{},mIe=g.useId||(()=>void 0),hIe=0;function EN(e){let[t,n]=g.useState(mIe());return TN(()=>{e||n(e=>e??String(hIe++))},[e]),e||(t?`radix-${t}`:``)}var DN=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=g.forwardRef((e,n)=>{let{asChild:r,...i}=e,a=r?CN:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,W.jsx)(a,{...i,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ON(e){let t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...e)=>t.current?.(...e),[])}function kN({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=gIe({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=ON(n);return[o,g.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function gIe({defaultProp:e,onChange:t}){let n=g.useState(e),[r]=n,i=g.useRef(r),a=ON(t);return g.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var _Ie=g.createContext(void 0);function AN(e){let t=g.useContext(_Ie);return e||t||`ltr`}var jN=`rovingFocusGroup.onEntryFocus`,vIe={bubbles:!1,cancelable:!0},MN=`RovingFocusGroup`,[NN,PN,yIe]=pIe(MN),[bIe,FN]=bN(MN,[yIe]),[xIe,SIe]=bIe(MN),IN=g.forwardRef((e,t)=>(0,W.jsx)(NN.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(NN.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(CIe,{...e,ref:t})})}));IN.displayName=MN;var CIe=g.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=g.useRef(null),p=SN(t,f),m=AN(a),[h=null,_]=kN({prop:o,defaultProp:s,onChange:c}),[v,y]=g.useState(!1),b=ON(l),x=PN(n),S=g.useRef(!1),[C,w]=g.useState(0);return g.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(jN,b),()=>e.removeEventListener(jN,b)},[b]),(0,W.jsx)(xIe,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:g.useCallback(e=>_(e),[_]),onItemShiftTab:g.useCallback(()=>y(!0),[]),onFocusableItemAdd:g.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:g.useCallback(()=>w(e=>e-1),[]),children:(0,W.jsx)(DN.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:yN(e.onMouseDown,()=>{S.current=!0}),onFocus:yN(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(jN,vIe);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);zN([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:yN(e.onBlur,()=>y(!1))})})}),LN=`RovingFocusGroupItem`,RN=g.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...o}=e,s=EN(),c=a||s,l=SIe(LN,n),u=l.currentTabStopId===c,d=PN(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=l;return g.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),(0,W.jsx)(NN.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:(0,W.jsx)(DN.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...o,ref:t,onMouseDown:yN(e.onMouseDown,e=>{r?l.onItemFocus(c):e.preventDefault()}),onFocus:yN(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:yN(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){l.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=EIe(e,l.orientation,l.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=d().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=l.loop?DIe(n,r+1):n.slice(r+1)}setTimeout(()=>zN(n))}})})})});RN.displayName=LN;var wIe={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function TIe(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function EIe(e,t,n){let r=TIe(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return wIe[r]}function zN(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function DIe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OIe=IN,kIe=RN;function AIe(e,t){return g.useReducer((e,n)=>t[e][n]??e,e)}var BN=e=>{let{present:t,children:n}=e,r=jIe(t),i=typeof n==`function`?n({present:r.isPresent}):g.Children.only(n),a=SN(r.ref,MIe(i));return typeof n==`function`||r.isPresent?g.cloneElement(i,{ref:a}):null};BN.displayName=`Presence`;function jIe(e){let[t,n]=g.useState(),r=g.useRef({}),i=g.useRef(e),a=g.useRef(`none`),[o,s]=AIe(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return g.useEffect(()=>{let e=VN(r.current);a.current=o===`mounted`?e:`none`},[o]),TN(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=VN(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),TN(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=VN(r.current).includes(a.animationName);if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=VN(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:g.useCallback(e=>{e&&(r.current=getComputedStyle(e)),n(e)},[])}}function VN(e){return e?.animationName||`none`}function MIe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var HN=`Tabs`,[NIe,PIe]=aIe(HN,[FN]),UN=FN(),[FIe,WN]=NIe(HN),GN=g.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=AN(s),[d,f]=kN({prop:r,onChange:i,defaultProp:a});return(0,W.jsx)(FIe,{scope:n,baseId:EN(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,W.jsx)(DN.div,{dir:u,"data-orientation":o,...l,ref:t})})});GN.displayName=HN;var KN=`TabsList`,qN=g.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=WN(KN,n),o=UN(n);return(0,W.jsx)(OIe,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,W.jsx)(DN.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});qN.displayName=KN;var JN=`TabsTrigger`,YN=g.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=WN(JN,n),s=UN(n),c=QN(o.baseId,r),l=$N(o.baseId,r),u=r===o.value;return(0,W.jsx)(kIe,{asChild:!0,...s,focusable:!i,active:u,children:(0,W.jsx)(DN.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:yN(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:yN(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:yN(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});YN.displayName=JN;var XN=`TabsContent`,ZN=g.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=WN(XN,n),c=QN(s.baseId,r),l=$N(s.baseId,r),u=r===s.value,d=g.useRef(u);return g.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,W.jsx)(BN,{present:i||u,children:({present:n})=>(0,W.jsx)(DN.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});ZN.displayName=XN;function QN(e,t){return`${e}-trigger-${t}`}function $N(e,t){return`${e}-content-${t}`}var eP=GN,tP=qN,nP=YN,rP=ZN,iP=eP,IIe=um(`inline-flex items-center justify-center rounded-md bg-muted text-muted-foreground`,{variants:{variant:{default:``,underline:`w-full justify-start gap-6 rounded-none border-b border-border bg-transparent`},size:{sm:`h-8 px-1 py-1`,default:`h-10 p-1`}},compoundVariants:[{variant:`underline`,className:`h-auto p-0`}],defaultVariants:{variant:`default`,size:`default`}}),LIe=um(`inline-flex items-center justify-center whitespace-nowrap rounded-xs font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-xs text-sm`,{variants:{variant:{default:``,underline:`gap-1.5 border-b-2 border-transparent text-muted-foreground hover:text-foreground data-[state=active]:border-brand data-[state=active]:bg-transparent data-[state=active]:text-brand data-[state=active]:shadow-none`},size:{sm:`px-2 py-0.5 rounded-sm`,default:`px-3 py-1.5`}},compoundVariants:[{variant:`underline`,className:`rounded-none px-1 py-2`}],defaultVariants:{variant:`default`,size:`default`}}),aP=g.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,W.jsx)(tP,{ref:i,className:G(IIe({variant:t,size:n}),e),...r}));aP.displayName=tP.displayName;var oP=g.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,W.jsx)(nP,{ref:i,className:G(LIe({variant:t,size:n}),e),...r}));oP.displayName=nP.displayName;var sP=g.forwardRef(({className:e,...t},n)=>(0,W.jsx)(rP,{ref:n,className:G(`data-[state=inactive]:hidden`,`mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));sP.displayName=rP.displayName;var RIe=[`@zuplo/runtime`,`@zuplo/graphql`,`@zuplo/otel`],cP=[{name:`@zuplo/test`,version:`0.0.0`,types:`types/@zuplo/test/latest/types.d.ts`},{name:`chai`,version:`0.0.0`,types:`types/@types/chai/latest/index.d.ts`},{name:`openapi-types`,version:`0.0.0`,types:`types/openapi-types/latest/index.d.ts`}],zIe=[{types:`types/@zuplo/runtime/types/environment.d.ts`,name:`@app/environment`},{types:`types/@zuplo/runtime/types/custom.d.ts`,name:`lib.custom.ts`},{types:`types/@zuplo/runtime/latest/global.d.ts`,name:`global.d.ts`}];async function BIe(){try{return await(await fetch(`https://cdn.zuplo.com/types/remote-modules.d.ts`)).text()}catch(e){Ef.captureException(e)}}async function VIe(e,t){try{let n=await fetch(`${Hf}/types/${e}/${t}/package.json`);if(!n.ok)throw Error(`Error loading package.json for ${e}`);return await n.json()}catch(e){Ef.captureException(e)}}async function HIe(){try{let e=await fetch(`${Hf}/types/@zuplo/bundled/bundles.json`);if(!e.ok)throw Error(`Error loading bundles from CDN`);let t=await e.json();return[...cP,...t.bundles]}catch(e){Ef.captureException(e)}return[...cP]}async function lP(e){try{let t=await fetch(`${Hf}/${e}`);if(!t.ok)throw Error(`Error loading type definition: ${e}`);return await t.text()}catch(e){Ef.captureException(e)}}var uP=async(e,t,n)=>{let r=`https://cdn.jsdelivr.net/npm/${e}@${t}${n}`,i=await fetch(r);return i.ok?i.text():Error(`OK`)};async function UIe(e){await Promise.all(RIe.map(async t=>{let n=await VIe(t,`latest`);n&&(e.typescript.typescriptDefaults.addExtraLib(JSON.stringify(n),`file:///node_modules/${t}/package.json`),await Promise.all(Object.entries(n.exports).map(async([n,r])=>{let i=await lP(`types/${t}/latest/${r.types.substring(2)}`);if(i){let r=n===`.`?`index.d.ts`:`${n}.d.ts`;e.typescript.typescriptDefaults.addExtraLib(i,`file:///node_modules/${t}/${r}`)}})))}))}async function dP(e){let t=Object.keys(e.typescript.typescriptDefaults.getExtraLibs()),n=await HIe();await Promise.allSettled([...zIe.map(async({types:t,name:n})=>{let r=await lP(t);r&&e.typescript.typescriptDefaults.addExtraLib(r,n)}),...n.map(async n=>{if(t.includes(n.name))return;let r={name:n.name,version:n.version,types:`./index.d.ts`},i=await lP(n.types);i&&(e.typescript.typescriptDefaults.addExtraLib(JSON.stringify(r),`file:///node_modules/${n.name}/package.json`),e.typescript.typescriptDefaults.addExtraLib(i,`file:///node_modules/${n.name}/index.d.ts`))})])}var fP=null,WIe=`
|
|
96
|
+
`},FNe=0,lA=[];function INe(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(FNe++)[0],a=g.useState(function(){return Sw()})[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nxe([e.lockRef.current],(e.shards||[]).map(cA),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2)return!o.current.allowPinchZoom;var i=oA(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=rA(d,u);if(!f)return!0;if(f?l=d:(l=d===`v`?`h`:`v`,f=rA(d,u)),!f)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return MNe(p,t,e,p===`h`?s:c,!0)},[]),c=g.useCallback(function(e){var n=e;if(!(!lA.length||lA[lA.length-1]!==a)){var r=`deltaY`in n?sA(n):oA(n),i=t.current.filter(function(e){return e.name===n.type&&e.target===n.target&&NNe(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(cA).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=g.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=g.useCallback(function(e){n.current=oA(e),r.current=void 0},[]),d=g.useCallback(function(t){l(t.type,sA(t),t.target,s(t,e.lockRef.current))},[]),f=g.useCallback(function(t){l(t.type,oA(t),t.target,s(t,e.lockRef.current))},[]);g.useEffect(function(){return lA.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,tA),document.addEventListener(`touchmove`,c,tA),document.addEventListener(`touchstart`,u,tA),function(){lA=lA.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,tA),document.removeEventListener(`touchmove`,c,tA),document.removeEventListener(`touchstart`,u,tA)}},[]);var p=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(a,{styles:PNe(i)}):null,p?g.createElement(oSe,{gapMode:`margin`}):null)}var LNe=Wxe(Xk,INe),uA=g.forwardRef(function(e,t){return g.createElement(Qk,hw({},e,{ref:t,sideCar:LNe}))});uA.classNames=Qk.classNames;var dA=`Dialog`,[fA,RNe]=pNe(dA),[zNe,pA]=fA(dA),BNe=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=(0,g.useRef)(null),c=(0,g.useRef)(null),[l=!1,u]=_Ne({prop:r,defaultProp:i,onChange:a});return(0,g.createElement)(zNe,{scope:t,triggerRef:s,contentRef:c,contentId:Bk(),titleId:Bk(),descriptionId:Bk(),open:l,onOpenChange:u,onOpenToggle:(0,g.useCallback)(()=>u(e=>!e),[u]),modal:o},n)},VNe=`DialogTrigger`,HNe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA(VNe,n),a=Rk(t,i.triggerRef);return(0,g.createElement)(Gk.button,Fk({type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":bA(i.open)},r,{ref:a,onClick:Ik(e.onClick,i.onOpenToggle)}))}),mA=`DialogPortal`,[UNe,hA]=fA(mA,{forceMount:void 0}),WNe=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=pA(mA,t);return(0,g.createElement)(UNe,{scope:t,forceMount:n},g.Children.map(r,e=>(0,g.createElement)(Kk,{present:n||a.open},(0,g.createElement)(SNe,{asChild:!0,container:i},e))))},gA=`DialogOverlay`,GNe=(0,g.forwardRef)((e,t)=>{let n=hA(gA,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pA(gA,e.__scopeDialog);return a.modal?(0,g.createElement)(Kk,{present:r||a.open},(0,g.createElement)(KNe,Fk({},i,{ref:t}))):null}),KNe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA(gA,n);return(0,g.createElement)(uA,{as:Uk,allowPinchZoom:!0,shards:[i.contentRef]},(0,g.createElement)(Gk.div,Fk({"data-state":bA(i.open)},r,{ref:t,style:{pointerEvents:`auto`,...r.style}})))}),_A=`DialogContent`,qNe=(0,g.forwardRef)((e,t)=>{let n=hA(_A,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pA(_A,e.__scopeDialog);return(0,g.createElement)(Kk,{present:r||a.open},a.modal?(0,g.createElement)(JNe,Fk({},i,{ref:t})):(0,g.createElement)(YNe,Fk({},i,{ref:t})))}),JNe=(0,g.forwardRef)((e,t)=>{let n=pA(_A,e.__scopeDialog),r=(0,g.useRef)(null),i=Rk(t,n.contentRef,r);return(0,g.useEffect)(()=>{let e=r.current;if(e)return mw(e)},[]),(0,g.createElement)(vA,Fk({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ik(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),(t=n.triggerRef.current)==null||t.focus()}),onPointerDownOutside:Ik(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Ik(e.onFocusOutside,e=>e.preventDefault())}))}),YNe=(0,g.forwardRef)((e,t)=>{let n=pA(_A,e.__scopeDialog),r=(0,g.useRef)(!1),i=(0,g.useRef)(!1);return(0,g.createElement)(vA,Fk({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var a;if((a=e.onCloseAutoFocus)==null||a.call(e,t),!t.defaultPrevented){var o;r.current||(o=n.triggerRef.current)==null||o.focus(),t.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:t=>{var a;(a=e.onInteractOutside)==null||a.call(e,t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let o=t.target;n.triggerRef.current?.contains(o)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}}))}),vA=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=pA(_A,n),c=Rk(t,(0,g.useRef)(null));return TNe(),(0,g.createElement)(g.Fragment,null,(0,g.createElement)(sC,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a},(0,g.createElement)(Dp,Fk({role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":bA(s.open)},o,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),yA=`DialogTitle`,XNe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA(yA,n);return(0,g.createElement)(Gk.h2,Fk({id:i.titleId},r,{ref:t}))}),ZNe=`DialogDescription`,QNe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA(ZNe,n);return(0,g.createElement)(Gk.p,Fk({id:i.descriptionId},r,{ref:t}))}),$Ne=`DialogClose`,ePe=(0,g.forwardRef)((e,t)=>{let{__scopeDialog:n,...r}=e,i=pA($Ne,n);return(0,g.createElement)(Gk.button,Fk({type:`button`},r,{ref:t,onClick:Ik(e.onClick,()=>i.onOpenChange(!1))}))});function bA(e){return e?`open`:`closed`}var[tPe,nPe]=fNe(`DialogTitleWarning`,{contentName:_A,titleName:yA,docsSlug:`dialog`}),xA=BNe,SA=HNe,CA=WNe,wA=GNe,TA=qNe,EA=XNe,DA=QNe,OA=ePe;function kA({...e}){return(0,W.jsx)(xA,{"data-slot":`dialog`,...e})}function AA({...e}){return(0,W.jsx)(SA,{"data-slot":`dialog-trigger`,...e})}function rPe({...e}){return(0,W.jsx)(CA,{"data-slot":`dialog-portal`,...e})}function jA({...e}){return(0,W.jsx)(OA,{"data-slot":`dialog-close`,...e})}function iPe({className:e,...t}){return(0,W.jsx)(wA,{"data-slot":`dialog-overlay`,className:G(`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 MA({className:e,children:t,showCloseButton:n=!0,...r}){return(0,W.jsxs)(rPe,{"data-slot":`dialog-portal`,children:[(0,W.jsx)(iPe,{}),(0,W.jsxs)(TA,{"data-slot":`dialog-content`,className:G(`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&&(0,W.jsxs)(OA,{"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:[(0,W.jsx)(nh,{}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function NA({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`dialog-header`,className:G(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function PA({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`dialog-footer`,className:G(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function FA({className:e,...t}){return(0,W.jsx)(EA,{"data-slot":`dialog-title`,className:G(`text-lg leading-none font-semibold`,e),...t})}function IA({className:e,...t}){return(0,W.jsx)(DA,{"data-slot":`dialog-description`,className:G(`text-muted-foreground text-sm`,e),...t})}function aPe({open:e,editors:t,onSelect:n,onCancel:r}){let[i,a]=(0,g.useState)(null);return(0,W.jsx)(kA,{open:e,onOpenChange:e=>!e&&r(),children:(0,W.jsxs)(MA,{className:`sm:max-w-md`,children:[(0,W.jsxs)(NA,{children:[(0,W.jsx)(FA,{children:`Choose Your Editor`}),(0,W.jsx)(IA,{children:`Select which editor you'd like to use for opening files. This preference will be saved for future use.`})]}),(0,W.jsx)(`div`,{className:`space-y-2 py-4`,children:t.map(e=>(0,W.jsx)(`button`,{type:`button`,className:`w-full text-left px-4 py-3 rounded-md border transition-colors ${i===e.id?`border-blue-500 bg-blue-50 dark:bg-blue-950/40`:`border-gray-200 dark:border-neutral-700 hover:border-gray-300 dark:hover:border-neutral-600 hover:bg-gray-50 dark:hover:bg-neutral-800/60`}`,onClick:()=>a(e.id),children:(0,W.jsx)(`div`,{className:`font-medium`,children:e.name})},e.id))}),(0,W.jsxs)(PA,{children:[(0,W.jsx)(Y,{variant:`ghost`,onClick:r,children:`Cancel`}),(0,W.jsx)(Y,{variant:`default`,onClick:()=>{i&&n(i)},disabled:!i,children:`Save Preference`})]})]})})}var LA=`/api/v1/editor`;function oPe(){let[e]=Hr(),[t,n]=(0,g.useState)(null),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)([]),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(!0);(0,g.useEffect)(()=>{(async()=>{try{let e=await fetch(`${LA}/list`);if(!e.ok)throw Error(`Failed to fetch editors: ${e.status}`);o((await e.json()).editors);let t=await fetch(`${LA}/detect`);if(!t.ok)throw Error(`Failed to detect editor: ${t.status}`);let r=await t.json();r.editor&&r.name&&(n(r.editor),i(r.name))}catch(e){jf.error(`Failed to load editor preference`,{error:e})}finally{u(!1)}})()},[]);let d=(0,g.useCallback)(async e=>{try{if((await fetch(`${LA}/preference`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({editor:e})})).ok){let t=a.find(t=>t.id===e);t&&(n(e),i(t.name)),c(!1)}}catch(e){jf.error(`Failed to save editor preference`,{error:e})}},[a]),f=(0,g.useCallback)(async()=>{let n=e.get(`path`);if(!n){jf.warn(`No file path in URL`);return}if(!t){c(!0);return}try{let e=await fetch(`${LA}/open`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({file:n})});if(!e.ok){let t=await e.json();jf.error(`Failed to open file in editor`,{error:t.message});return}let t=await e.json();t.url&&window.open(t.url,`_blank`)}catch(e){jf.error(`Failed to open file in editor`,{error:e})}},[e,t]);return{hasEditor:!!t,editorName:r,isLoading:l,showPreferenceDialog:s,setShowPreferenceDialog:c,availableEditors:a,savePreference:d,openInEditor:f}}var RA=`$import(@zuplo/runtime)`,sPe=e=>new Promise(t=>setTimeout(t,e)),zA=e=>{let t=(0,g.useRef)(e);return t.current=e,(0,g.useEffect)(()=>{t.current=e},[e]),t},BA=e=>{let[t,n]=(0,g.useState)(`idle`),[r,i]=(0,g.useState)(),[a,o]=(0,g.useState)(null);return{state:t,error:r,execute:(0,g.useCallback)(async(...t)=>{n(`loading`),o(null),i(void 0);try{let r=await e(...t);return n(`hasValue`),o(r),r}catch(e){throw i(e instanceof Error?e:Error(e)),n(`hasError`),e}},[e]),value:a}},VA=function(e){return e.PRODUCTION=`PRODUCTION`,e.PREVIEW=`PREVIEW`,e.WORKING_COPY=`WORKING_COPY`,e}({});function cPe(e,...t){return e==null?!1:t.includes(e)}var HA=()=>({isReadOnly:lh().environment.environmentType!==VA.WORKING_COPY});function UA(){return new URLSearchParams(Sn().search)}function WA(e,t){let[n,r]=Hr(),i=Object.fromEntries(n);return[n.get(e)??t,t=>r(t===void 0?Object.fromEntries(Object.entries(i).filter(([t])=>t!==e)):{...i,[e]:t})]}function lPe(e,t){let[n,r]=Hr();return[n.get(e)?n.getAll(e):t,t=>r({...Object.fromEntries(n),[e]:t})]}var uPe=i(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),dPe=e(i(((e,t)=>{var n=uPe();t.exports=f;var r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,a=`\0CLOSE`+Math.random()+`\0`,o=`\0COMMA`+Math.random()+`\0`,s=`\0PERIOD`+Math.random()+`\0`;function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function l(e){return e.split(`\\\\`).join(r).split(`\\{`).join(i).split(`\\}`).join(a).split(`\\,`).join(o).split(`\\.`).join(s)}function u(e){return e.split(r).join(`\\`).split(i).join(`{`).split(a).join(`}`).split(o).join(`,`).split(s).join(`.`)}function d(e){if(!e)return[``];var t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);var i=r.pre,a=r.body,o=r.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=d(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function f(e){return e?(e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),_(l(e),!0).map(u)):[]}function p(e){return`{`+e+`}`}function m(e){return/^-?0\d/.test(e)}function h(e,t){return e<=t}function g(e,t){return e>=t}function _(e,t){var r=[],i=n(`{`,`}`,e);if(!i)return[e];var o=i.pre,s=i.post.length?_(i.post,!1):[``];if(/\$$/.test(i.pre))for(var l=0;l<s.length;l++){var u=o+`{`+i.body+`}`+s[l];r.push(u)}else{var f=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),v=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),y=f||v,b=i.body.indexOf(`,`)>=0;if(!y&&!b)return i.post.match(/,(?!,).*\}/)?(e=i.pre+`{`+i.body+a+i.post,_(e)):[e];var x;if(y)x=i.body.split(/\.\./);else if(x=d(i.body),x.length===1&&(x=_(x[0],!1).map(p),x.length===1))return s.map(function(e){return i.pre+x[0]+e});var S;if(y){var C=c(x[0]),w=c(x[1]),T=Math.max(x[0].length,x[1].length),E=x.length==3?Math.abs(c(x[2])):1,D=h;w<C&&(E*=-1,D=g);var O=x.some(m);S=[];for(var k=C;D(k,w);k+=E){var A;if(v)A=String.fromCharCode(k),A===`\\`&&(A=``);else if(A=String(k),O){var j=T-A.length;if(j>0){var M=Array(j+1).join(`0`);A=k<0?`-`+M+A.slice(1):M+A}}S.push(A)}}else{S=[];for(var N=0;N<x.length;N++)S.push.apply(S,_(x[N],!1))}for(var N=0;N<S.length;N++)for(var l=0;l<s.length;l++){var u=o+S[N]+s[l];(!t||y||u)&&r.push(u)}}return r}}))()),fPe=1024*64,GA=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>fPe)throw TypeError(`pattern is too long`)},pPe={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},KA=e=>e.replace(/[[\]\\-]/g,`\\$&`),mPe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),qA=e=>e.join(``),hPe=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(pPe))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(KA(d)+`-`+KA(t)):t===d&&r.push(KA(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(KA(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(KA(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[mPe(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+qA(r)+`]`,p=`[`+(l?``:`^`)+qA(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},JA=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`),gPe=new Set([`!`,`?`,`+`,`*`,`@`]),YA=e=>gPe.has(e),XA=e=>YA(e.type),_Pe=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),vPe=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),yPe=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),ZA=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),bPe=`(?!\\.\\.?(?:$|/))`,QA=`(?!\\.)`,xPe=new Set([`[`,`.`]),SPe=new Set([`..`,`.`]),CPe=new Set(`().*{}+?[]^$\\!`),wPe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),$A=`[^/]`,ej=$A+`*?`,tj=$A+`+?`,nj=class e{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...t){for(let n of t)if(n!==``){if(typeof n!=`string`&&!(n instanceof e&&n.#i===this))throw Error(`invalid part: `+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let t=this.#i;for(let n=0;n<this.#a;n++){let r=t.#r[n];if(!(r instanceof e&&r.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(t){let n=new e(this.type,t);for(let e of this.#r)n.copyIn(e);return n}static#f(t,n,r,i,a){let o=i.maxExtglobRecursion??2,s=!1,c=!1,l=-1,u=!1;if(n.type===null){let d=r,f=``;for(;d<t.length;){let r=t.charAt(d++);if(s||r===`\\`){s=!s,f+=r;continue}if(c){d===l+1?(r===`^`||r===`!`)&&(u=!0):r===`]`&&!(d===l+2&&u)&&(c=!1),f+=r;continue}else if(r===`[`){c=!0,l=d,u=!1,f+=r;continue}if(!i.noext&&YA(r)&&t.charAt(d)===`(`&&a<=o){n.push(f),f=``;let o=new e(r,n);d=e.#f(t,o,d,i,a+1),n.push(o);continue}f+=r}return n.push(f),d}let d=r+1,f=new e(null,n),p=[],m=``;for(;d<t.length;){let r=t.charAt(d++);if(s||r===`\\`){s=!s,m+=r;continue}if(c){d===l+1?(r===`^`||r===`!`)&&(u=!0):r===`]`&&!(d===l+2&&u)&&(c=!1),m+=r;continue}else if(r===`[`){c=!0,l=d,u=!1,m+=r;continue}if(YA(r)&&t.charAt(d)===`(`&&(a<=o||n&&n.#h(r))){let o=n&&n.#h(r)?0:1;f.push(m),m=``;let s=new e(r,f);f.push(s),d=e.#f(t,s,d,i,a+o);continue}if(r===`|`){f.push(m),m=``,p.push(f),f=new e(null,n);continue}if(r===`)`)return m===``&&n.#r.length===0&&(n.#u=!0),f.push(m),m=``,n.push(...p,f),d;m+=r}return n.type=null,n.#t=void 0,n.#r=[t.substring(r-1)],d}#p(e){return this.#m(e,vPe)}#m(e,t=_Pe){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=yPe){return!!t.get(this.type)?.includes(e)}#g(t,n){let r=t.#r[0],i=new e(null,r,this.options);i.#r.push(``),r.push(i),this.#_(t,n)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!ZA.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=ZA.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}#x(){if(XA(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}static fromGlob(t,n={}){let r=new e(null,void 0,n);return e.#f(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(){if(this.#e===this&&(this.#x(),this.#d()),!XA(this)){let t=this.isStart()&&this.isEnd(),n=this.#r.map(n=>{let[r,i,a,o]=typeof n==`string`?e.#S(n,this.#t,t):n.toRegExpSource();return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),r=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&SPe.has(this.#r[0]))){let e=xPe,t=this.#c.dot&&e.has(n.charAt(0))||n.startsWith(`\\.`)&&e.has(n.charAt(2))||n.startsWith(`\\.\\.`)&&e.has(n.charAt(4)),i=!this.#c.dot&&e.has(n.charAt(0));r=t?bPe:i?QA:``}let i=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(i=`(?:$|\\/)`),[r+n+i,JA(n),this.#t=!!this.#t,this.#n]}let t=this.type===`!`?`(?:(?!(?:`:`(?:`,n=this.#r.map(e=>{if(typeof e==`string`)throw Error(`string type in extglob ast??`);let[t,n,r,i]=e.toRegExpSource();return this.#n=this.#n||i,t}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`);if(this.isStart()&&this.isEnd()&&!n&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,JA(this.toString()),!1,!1]}let r=``;if(this.type===`!`&&this.#u)r=(this.isStart()&&!this.#c.dot?QA:``)+tj;else{let e=this.type===`!`?`))`+(this.isStart()&&!this.#c.dot?QA:``)+ej+`)`:this.type===`@`?`)`:`)${this.type}`;r=t+n+e}return[r,JA(n),this.#t=!!this.#t,this.#n]}static#S(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(c!==`*`&&(o=!1),r){r=!1,i+=(CPe.has(c)?`\\`:``)+c;continue}if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=hPe(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?tj:ej,t=!0;continue}if(c===`?`){i+=$A,t=!0;continue}i+=wPe(c)}return[i,JA(e),!!t,a]}},TPe=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),rj=(e,t,n={})=>(GA(t),!n.nocomment&&t.charAt(0)===`#`?!1:new fj(t,n).match(e)),EPe=/^\*+([^+@!?\*\[\(]*)$/,DPe=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),OPe=e=>t=>t.endsWith(e),kPe=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),APe=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),jPe=/^\*+\.\*+$/,MPe=e=>!e.startsWith(`.`)&&e.includes(`.`),NPe=e=>e!==`.`&&e!==`..`&&e.includes(`.`),PPe=/^\.\*+$/,FPe=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),IPe=/^\*+$/,LPe=e=>e.length!==0&&!e.startsWith(`.`),RPe=e=>e.length!==0&&e!==`.`&&e!==`..`,zPe=/^\?+([^+@!?\*\[\(]*)?$/,BPe=([e,t=``])=>{let n=ij([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},VPe=([e,t=``])=>{let n=aj([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},HPe=([e,t=``])=>{let n=aj([e]);return t?e=>n(e)&&e.endsWith(t):n},UPe=([e,t=``])=>{let n=ij([e]);return t?e=>n(e)&&e.endsWith(t):n},ij=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},aj=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},oj=typeof process==`object`&&process?{}.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,sj={win32:{sep:`\\`},posix:{sep:`/`}};rj.sep=oj===`win32`?sj.win32.sep:sj.posix.sep;var cj=Symbol(`globstar **`);rj.GLOBSTAR=cj;var WPe=`[^/]*?`,GPe=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,KPe=`(?:(?!(?:\\/|^)\\.).)*?`;rj.filter=(e,t={})=>n=>rj(n,e,t);var lj=(e,t={})=>Object.assign({},e,t);rj.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return rj;let t=rj;return Object.assign((n,r,i={})=>t(n,r,lj(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,lj(e,n))}static defaults(n){return t.defaults(lj(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,lj(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,lj(e,r))}},unescape:(n,r={})=>t.unescape(n,lj(e,r)),escape:(n,r={})=>t.escape(n,lj(e,r)),filter:(n,r={})=>t.filter(n,lj(e,r)),defaults:n=>t.defaults(lj(e,n)),makeRe:(n,r={})=>t.makeRe(n,lj(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,lj(e,r)),match:(n,r,i={})=>t.match(n,r,lj(e,i)),sep:t.sep,GLOBSTAR:cj})};var uj=(e,t={})=>(GA(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,dPe.default)(e));rj.braceExpand=uj,rj.makeRe=(e,t={})=>new fj(e,t).makeRe(),rj.match=(e,t,n={})=>{let r=new fj(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};var dj=/[?*]|[+@!]\(.*?\)|\[|\]/,qPe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),fj=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){GA(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||oj,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!dj.test(e[2]))&&!dj.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);r&&(e[t]=r,e[n]=[])}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=e[0]===``&&e[1]===``&&e[2]===`?`&&typeof e[3]==`string`&&/^[a-z]:$/i.test(e[3]),a=t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]);if(n&&a){let n=e[3],a=t[3];n.toLowerCase()===a.toLowerCase()&&(e[3]=a,r=3,i=3)}else if(a&&typeof e[0]==`string`){let n=t[3],r=e[0];n.toLowerCase()===r.toLowerCase()&&(t[3]=r,i=3)}else if(n&&typeof t[0]==`string`){let n=e[3];n.toLowerCase()===t[0].toLowerCase()&&(t[0]=n,r=3)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(cj)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(cj,i),o=t.lastIndexOf(cj),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===cj?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===cj)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return uj(this.pattern,this.options)}parse(e){GA(e);let t=this.options;if(e===`**`)return cj;if(e===``)return``;let n,r=null;(n=e.match(IPe))?r=t.dot?RPe:LPe:(n=e.match(EPe))?r=(t.nocase?t.dot?APe:kPe:t.dot?OPe:DPe)(n[1]):(n=e.match(zPe))?r=(t.nocase?t.dot?VPe:BPe:t.dot?HPe:UPe)(n):(n=e.match(jPe))?r=t.dot?NPe:MPe:(n=e.match(PPe))&&(r=FPe);let i=nj.fromGlob(e,this.options).toMMPattern();return r?Object.assign(i,{test:r}):i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?WPe:t.dot?GPe:KPe,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?qPe(e):e===cj?cj:e._src});return t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==cj||a===cj||(a===void 0?i!==void 0&&i!==cj?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|`+n+`)?`:i!==cj&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=cj))}),t.filter(e=>e!==cj).join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return rj.defaults(e).Minimatch}};rj.AST=nj,rj.Minimatch=fj,rj.escape=TPe,rj.unescape=JA;function pj(e){let t=new Date;switch(e){case`7d`:t.setUTCDate(t.getUTCDate()-7);break;case`30d`:t.setUTCDate(t.getUTCDate()-30);break;case`3m`:t.setUTCMonth(t.getUTCMonth()-3);break}return t.toISOString()}async function mj(e,t){let n=t.pageSize??30,{page:r,pageSize:i,order:a=`DESC`,orderBy:o=`periodStart`,...s}=t,{data:c,error:l}=await E_.GET(`/v3/metering/{bucketId}/billing/invoices`,{params:{path:{bucketId:e},query:{page:r,pageSize:n,expand:[`lines`],order:a,orderBy:o,...s}}});if(l||!c)throw l??Error(`Failed to load invoices`);return c}var JPe=15;async function YPe(e,t,n=6){let r=await mj(e,{page:1,pageSize:n,createdAfter:pj(`3m`),order:`DESC`,orderBy:`periodStart`,customers:[t]}),i=r.items??[];if(i.length===0||i.every(e=>e.customer?.id===t))return r;let a=[],o=1;for(;a.length<n&&o<=JPe;){let r=await mj(e,{page:o,pageSize:30,createdAfter:pj(`3m`),order:`DESC`,orderBy:`periodStart`}),i=r.items??[];if(i.length===0)break;for(let e of i)if(e.customer?.id===t&&(a.push(e),a.length>=n))break;let s=r.pageSize??30,c=Math.max(1,Math.ceil((r.totalCount??0)/s));if(o>=c)break;o++}let s=a.slice(0,n);return{...r,items:s,totalCount:s.length,page:1,pageSize:n}}var hj={orderBy:`createdAt`,order:`DESC`},gj=`/v3/metering/{bucketId}/plans`,XPe=`/v3/metering/{bucketId}/customers`;function ZPe(e){if(!e)return;let t={};return e.page!=null&&(t.page=e.page,t.pageSize=e.pageSize??30),e.status?.length&&(t.status=e.status),Object.keys(t).length>0?t:void 0}function QPe(e,t){let n=ZPe(t);return n?{params:{path:{bucketId:e},query:n}}:{params:{path:{bucketId:e}}}}function $Pe(e){if(!e)return;let t={orderBy:e.orderBy??hj.orderBy,order:e.order??hj.order};return e.page!=null&&(t.page=e.page,t.pageSize=e.pageSize??30),e.planKey&&(t.planKey=e.planKey),e.name&&(t.name=e.name),e.key&&(t.key=e.key),e.primaryEmail&&(t.primaryEmail=e.primaryEmail),Object.keys(t).length>0?t:void 0}function eFe(e,t){let n=$Pe(t);return n?{params:{path:{bucketId:e},query:n}}:{params:{path:{bucketId:e}}}}function tFe(e){let t={page:e.page??1,pageSize:e.pageSize??30};return e.includeArchived!=null&&(t.includeArchived=e.includeArchived),t}function nFe(e,t,n){return Array.isArray(e)?{items:e,totalCount:e.length,page:t,pageSize:n}:e}var _j={ai:{providerAssignments:{list:(e,t)=>D_.queryOptions(`get`,`/v1/accounts/{accountName}/projects/{projectName}/ai-provider-assignments`,{params:{path:{accountName:e,projectName:t}}},{select:e=>e.data})}},deployments:{list:(e,t)=>D_.queryOptions(`get`,`/v1/accounts/{accountName}/projects/{projectName}/deployments`,{params:{path:{accountName:e,projectName:t}}}),versions:{list:e=>D_.queryOptions(`get`,`/v1/deployments/{deploymentName}/versions`,{params:{path:{deploymentName:e}}})}},mcp:{origins:{list:e=>D_.queryOptions(`get`,`/v1/buckets/{bucketId}/mcp/configurations/{configurationId}/origins`,{params:{path:e}})},teams:{list:e=>D_.queryOptions(`get`,`/v1/buckets/{bucketId}/mcp/configurations/teams`,{params:{path:e}})},server:{listTeams:e=>D_.queryOptions(`get`,`/v1/buckets/{bucketId}/mcp/configurations/{configurationId}/servers/{virtualServerId}/teams`,{params:{path:e}})},servers:{list:e=>D_.queryOptions(`get`,`/v1/buckets/{bucketId}/mcp/configurations/{configurationId}/servers`,{params:{path:e}})}},metering:{customers:{list:(e,t)=>D_.queryOptions(`get`,XPe,eFe(e,t),t?.page==null?void 0:{placeholderData:o_}),get:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/customers/{customerIdOrKey}`,{params:{path:{bucketId:e,customerIdOrKey:t}}}),subscriptions:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/customers/{customerIdOrKey}/subscriptions`,{params:{path:{bucketId:e,customerIdOrKey:t}}})},plans:{list:(e,t)=>D_.queryOptions(`get`,gj,QPe(e,t),t?.page==null?void 0:{placeholderData:o_}),get:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/plans/{planId}`,{params:{path:{bucketId:e,planId:t}}}),listByKey:(e,t)=>D_.queryOptions(`get`,gj,{params:{path:{bucketId:e},query:{key:[t]}}})},meters:{list:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/meters`,{params:{path:{bucketId:e}}})},configuration:{get:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/monetization-configuration`,{params:{path:{bucketId:e}}})},features:{list:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/features`,{params:{path:{bucketId:e},query:t?{includeArchived:t}:void 0}},{select:e=>Array.isArray(e)?e:e.items}),listPaginated:(e,t)=>{let n=t.page??1,r=t.pageSize??30;return D_.queryOptions(`get`,`/v3/metering/{bucketId}/features`,{params:{path:{bucketId:e},query:tFe(t)}},{select:e=>nFe(e,n,r),placeholderData:o_})}},planInvites:{list:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/plan-invites`,{params:{path:{bucketId:e}}})},billingReadiness:{get:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/billing-readiness`,{params:{path:{bucketId:e}}})},stripe:{setup:e=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/setup/stripe`,{params:{path:{bucketId:e}}})},subscriptions:{get:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}`,{params:{path:{bucketId:e,subscriptionId:t}}}),access:(e,t)=>D_.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}/access`,{params:{path:{bucketId:e,subscriptionId:t}}})},invoices:{list:(e,t,n,r,i,a)=>({queryKey:[`metering`,e,`invoices`,t,n,r??`all`,a,i],queryFn:()=>mj(e,{page:n,pageSize:30,createdAfter:pj(t),order:i,orderBy:a,...r?.length?{statuses:r}:{}}),placeholderData:o_}),forCustomer:(e,t)=>({queryKey:[`metering`,e,`invoices`,`customer`,t],queryFn:()=>YPe(e,t)})}}},rFe=async e=>vj(e,await a(()=>import(`./editor.main-gzibWb3g.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),vj=(e,t)=>{let n=e.split(`.`).pop();if(n)return t.languages.getLanguages().find(e=>e.extensions?.includes(`.${n}`))},yj=e=>{let t=Object.entries(e).flatMap(([e,t])=>t?[[e,t]]:[]);return new URLSearchParams(t).toString()},X={user:{preferences:()=>({url:`${U}/v1/users/me/preferences`})},authApiKey:e=>({url:`${U}/v1/auth/api-keys/${e}`}),authAccountApiKeys:e=>({url:`${U}/v1/auth/api-keys?accountName=${e}`}),authCurrentUserAccountRoles:e=>({url:`${U}/v1/auth/users/me?accountName=${e}`}),authUserAccountRoles:(e,t)=>({url:`${U}/v1/auth/users/${t}?accountName=${e}`}),authProjectUsersRoles:(e,t,{includeInheritedRoles:n}={includeInheritedRoles:!1})=>({url:`${U}/v1/auth/users?accountName=${e}&projectName=${t}&includeInheritedRoles=${n}`}),authAccountUsersRoles:e=>({url:`${U}/v1/auth/users?accountName=${e}`}),mfaFactors:()=>({url:`${U}/v1/mfa/factors`}),accountMemberInviteDetails:e=>({url:`${U}/v1/account-member-invites/${e}`}),accountMemberInvites:e=>({url:`${U}/v1/accounts/${e}/account-member-invites`}),accountAuditLogs:(e,t)=>{let n=new URLSearchParams;t?.limit&&n.append(`limit`,t.limit.toString()),t?.offset&&n.append(`offset`,t.offset.toString()),t?.action&&n.append(`action`,t.action),t?.startDate&&n.append(`startDate`,t.startDate),t?.endDate&&n.append(`endDate`,t.endDate),t?.actor&&n.append(`actor`,t.actor),t?.success!==void 0&&n.append(`success`,t.success.toString());let r=n.toString();return{url:`${U}/v1/accounts/${e}/audit-logs${r?`?${r}`:``}`}},account:e=>({url:`${U}/v1/accounts/${e}`}),accounts:()=>({url:`${U}/v1/accounts`}),accountSourceControlRepoList:e=>({url:`${U}/v1/accounts/${e}/$repo-list`}),accountSourceControlAzureProjects:(e,t)=>({url:`${U}/v1/accounts/${e}/source-control/$azure-projects?organization=${t}`}),accountSourceControlNamespaces:e=>({url:`${U}/v1/accounts/${e}/$namespaces`}),accountSourceControlRepos:(e,t,n)=>({url:`${U}/v1/accounts/${e}/$repos?${new URLSearchParams({namespace:t,query:n??``})}`}),accountsSourceControlConfigurations:()=>({url:`${U}/v1/user/me/source-control-configs`}),accountUsageAnalyticsByDate:(e,t,n)=>({url:`${U}/v1/analytics/${e}/usage?from=${t}&to=${n}&version=2`}),billing:e=>({url:`${U}/v1/accounts/${e}/billings`}),buildLogs:(e,t)=>({url:`${U}/v2/deployments/${e}/build-logs/${t}`}),cdnContent:e=>({url:`${Hf}${e}`}),chatIdentity:()=>({url:`${U}/v1/chat-identity`}),knockIdentity:()=>({url:`${U}/v1/knock-identity`}),bucketConfigurations:e=>({url:`${U}/v1/buckets/${e}/configurations`}),bucketConfigurationTeams:e=>({url:`${U}/v1/buckets/${e}/configurations/teams`}),bucketConfigurationApps:e=>({url:`${U}/v1/buckets/${e}/configurations/apps`}),bucketConfiguration:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations/${t}`}),bucketConfigurationUsage:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/usage`}),bucketConfigurationMembers:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members`}),bucketConfigurationMember:(e,t,n)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`}),supportedAiProviders:e=>({url:`${U}/v1/buckets/${e}/providers`}),aiProviderAssignments:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/ai-provider-assignments`}),hierarchicalQuota:e=>({url:`${U}/v1/hierarchical-quota/${e}`}),bucketConfigurationRequestCount:(e,t,n,r,i)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/request-count?${yj({startDate:n,endDate:r,granularity:i})}`}),bucketConfigurationCostUsage:(e,t,n,r,i)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/cost-usage?${yj({startDate:n,endDate:r,granularity:i})}`}),bucketConfigurationTokenUsage:(e,t,n,r,i,a)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/token-usage?${yj({startDate:n,endDate:r,granularity:i,tokenType:a})}`}),bucketConfigurationTtfb:(e,t,n,r,i)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/ttfb?${yj({startDate:n,endDate:r,granularity:i})}`}),bucketConfigurationBlocksErrorsWarnings:(e,t,n,r,i)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/blocks-errors-warnings?${yj({startDate:n,endDate:r,granularity:i})}`}),consumer:(e,t)=>({url:`${U}/v1/api-keys/${e}/consumers/${t}`}),consumersForBucket:(e,t)=>{let n=yj({limit:t?.limit?.toString(),offset:t?.offset?.toString(),name:t?.name,email:t?.email});return{url:`${U}/v1/api-keys/${e}/consumers${n?`?${n}`:``}`}},customDomains:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/custom-domains`}),accountCustomDomains:e=>({url:`${U}/v1/accounts/${e}/custom-domains`}),deploymentVersions:e=>({url:`${U}/v1/deployments/${e}/versions`}),environments:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/deployments`}),environmentVariables:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/environment-variables`}),file:(e,t)=>({url:`${U}/v1/deployments/${e}/fs/file?path=${t}`}),fsStats:e=>({url:`${U}/v1/deployments/${e}/fs/stats`}),gitBranches:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$branches`}),projectSyncStatus:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/sync-status`}),maxRpsAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/max-rps?filter=${t}&limit=10${r?`&${r}`:``}`}},meteringBucket:(e,t)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/`}),meteringPlans:(e,t)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/plans`}),meteringSubscriptions:(e,t)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/subscriptions`}),meteringSubscriptionQuotas:(e,t,n)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/subscriptions/${n}/quotas`}),primaryAnalytics:(e,t)=>({url:`${U}/v2/deployments/${e}/analytics/metrics?filter=${t}`}),project:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}`}),projects:e=>({url:`${U}/v1/accounts/${e}/projects`}),permissions:(e,t)=>({url:`${U}/v1/permissions/${e}/${t}`}),permissionsProject:(e,t)=>({url:`${U}/v1/permissions/project/${e}|${t}`}),permissionsAiTeam:e=>({url:`${U}/v1/permissions/ai_team/${e}`}),logViewerRequests:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.cursor&&n.append(`cursor`,t.cursor),t.since&&n.append(`since`,t.since),t.sinceId&&n.append(`sinceId`,t.sinceId),t.limit&&n.append(`limit`,t.limit.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/deployments/${e}/logs/requests?${n}`}},logViewerRequestDetail:(e,t,n)=>{let r=new URLSearchParams;n&&r.append(`timestamp`,n);let i=r.toString();return{url:`${U}/v2/deployments/${e}/logs/requests/${t}${i?`?${i}`:``}`}},logViewerHistogram:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/deployments/${e}/logs/histogram?${n}`}},logViewerFacets:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.facets&&n.append(`facets`,t.facets),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/deployments/${e}/logs/facets?${n}`}},logViewerRequestsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.cursor&&n.append(`cursor`,t.cursor),t.since&&n.append(`since`,t.since),t.sinceId&&n.append(`sinceId`,t.sinceId),t.limit&&n.append(`limit`,t.limit.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/logs/requests?${n}`}},logViewerRequestDetailScoped:(e,t,n)=>{let r=new URLSearchParams;return r.append(`account`,e.accountName),e.projectName&&r.append(`project`,e.projectName),e.deploymentName&&r.append(`deploymentName`,e.deploymentName),n&&r.append(`timestamp`,n),{url:`${U}/v2/logs/requests/${t}?${r}`}},logViewerHistogramScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/logs/histogram?${n}`}},logViewerFacetsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.facets&&n.append(`facets`,t.facets),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${U}/v2/logs/facets?${n}`}},tracesListScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),t.limit&&n.append(`limit`,String(t.limit)),t.cursor&&n.append(`cursor`,t.cursor),{url:`${U}/v2/traces?${n}`}},traceDetailScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),{url:`${U}/v2/traces/${encodeURIComponent(t)}?${n}`}},traceStatsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),{url:`${U}/v2/trace-stats?${n}`}},traceFacetsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.facets&&n.append(`facets`,t.facets),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),{url:`${U}/v2/trace-facets?${n}`}},topRpsAnalytics:(e,t,n,r)=>{let i=yj(r);return{url:`${U}/v2/deployments/${e}/analytics/top-rps?filter=${t}${n?`&sortBy=${n}`:``}&limit=10${i?`&${i}`:``}`}},topRpsByIpAnalytics:(e,t,n,r)=>{let i=yj(r);return{url:`${U}/v2/deployments/${e}/analytics/top-rps-by-ip?filter=${t}${n?`&sortBy=${n}`:``}&limit=10${i?`&${i}`:``}`}},topTenIpAddressesAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/top-ip-addresses?filter=${t}&limit=10${r?`&${r}`:``}`}},topTenLocationsAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/top-locations?filter=${t}&limit=10${r?`&${r}`:``}`}},topTenRoutesAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/top-routes?filter=${t}&limit=10${r?`&${r}`:``}`}},topTenSubsAnalytics:(e,t,n)=>{let r=yj(n);return{url:`${U}/v2/deployments/${e}/analytics/top-subs?filter=${t}&limit=10${r?`&${r}`:``}`}},usersMe:()=>({url:`${U}/v1/users/me`}),identityConnections:e=>({url:`${U}/v1/accounts/${e}/identity-connections`}),identityConnectionTicket:e=>({url:`${U}/v1/accounts/${e}/identity-connections/ticket`}),mcpBucketConfigurations:e=>({url:`${U}/v1/buckets/${e}/mcp/configurations`}),mcpBucketConfigurationTeam:(e,t)=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams/${t}`}),mcpBucketConfigurationsTeams:e=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams`}),mcpGatewayIdpMetadata:(e,t)=>({url:`${U}/v1/buckets/${e}/mcp/${t}/idp-metadata`}),mcpGatewayOrigins:(e,t,n)=>{let r=new URLSearchParams;n?.limit&&r.append(`limit`,n.limit.toString()),n?.offset&&r.append(`offset`,n.offset.toString());let i=r.toString();return{url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/origins${i?`?${i}`:``}`}},mcpGatewayOriginServer:(e,t,n)=>({url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/origins/${n}`}),mcpGatewayVirtualServers:(e,t,n)=>{let r=new URLSearchParams;n?.limit&&r.append(`limit`,n.limit.toString()),n?.offset&&r.append(`offset`,n.offset.toString());let i=r.toString();return{url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/servers${i?`?${i}`:``}`}},mcpGatewayVirtualServer:(e,t,n)=>({url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/servers/${n}`}),mcpGatewayVirtualServerTools:(e,t,n)=>({url:`${U}/v1/buckets/${t}/mcp/configurations/${e}/servers/${n}/tools`}),analyticsRequests:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return e.compare&&t.append(`compare`,`previous`),{url:`${U}/v2/analytics/requests?${t}`}},analyticsRequestsField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${U}/v2/analytics/requests/fields/${e}?${n}`}},analyticsConsumers:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/consumers?${t}`}},analyticsAgents:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.includeOther===!0&&t.append(`includeOther`,`true`),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/agents?${t}`}},analyticsAgentsTimeSeries:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.includeOther===!0&&t.append(`includeOther`,`true`),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/agents/timeseries?${t}`}},analyticsBackend:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/backend?${t}`}},analyticsEdge:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/edge?${t}`}},analyticsAiGateway:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/ai-gateway?${t}`}},analyticsAiGatewayField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${U}/v2/analytics/ai-gateway/fields/${e}?${n}`}},analyticsAiGatewayTimeseries:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),t.append(`groupBy`,e.groupBy),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.limitGroups&&t.append(`limitGroups`,e.limitGroups.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/ai-gateway/timeseries?${t}`}},analyticsMcp:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/mcp?${t}`}},analyticsGraphql:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/graphql?${t}`}},analyticsMcpField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${U}/v2/analytics/mcp/fields/${e}?${n}`}},analyticsMcpCapabilities:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.view&&t.append(`view`,e.view),e.capabilityType&&t.append(`capabilityType`,e.capabilityType),e.limit&&t.append(`limit`,e.limit.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/mcp/capabilities?${t}`}},analyticsMcpEvents:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.limit!=null&&t.append(`limit`,e.limit.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${U}/v2/analytics/mcp/events?${t}`}},analyticsMcpBreakdown:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${U}/v2/analytics/mcp/breakdowns/${e}?${n}`}},analyticsUsage:e=>{let t=new URLSearchParams;return t.append(`account`,e.accountName),t.append(`from`,e.from),t.append(`to`,e.to),{url:`${U}/v2/analytics/usage?${t}`}}},bj={auth:{createApiKey:e=>({url:`${U}/v1/auth/api-keys`,method:`POST`,json:!0,body:JSON.stringify(e),invalidateKeys:[X.authAccountApiKeys(e.accountName)],acceptableStatuses:[200]}),deleteApiKey:(e,t)=>({url:`${U}/v1/auth/api-keys/${e}`,method:`DELETE`,invalidateKeys:[X.authApiKey(e),X.authAccountApiKeys(t)],acceptableStatuses:[204]}),updateUsersRole:({userId:e,accountName:t,projectName:n,role:r})=>({url:`${U}/v1/auth/users/${e}`,method:`PATCH`,json:!0,body:JSON.stringify({accountName:t,projectName:n,role:r}),parseResponse:!1,invalidateKeys:n?[X.authProjectUsersRoles(t,n,{includeInheritedRoles:!1}),X.authProjectUsersRoles(t,n,{includeInheritedRoles:!0}),X.authAccountUsersRoles(t)]:[X.authAccountUsersRoles(t)],acceptableStatuses:[201,200]})},accounts:{createAccount:e=>({url:`${U}/v1/accounts`,method:`POST`,json:!0,body:JSON.stringify(e),invalidateKeys:[X.accounts()],acceptableStatuses:[201]}),deleteAccount:e=>({url:`${U}/v1/accounts/${e.name}`,method:`DELETE`,invalidateKeys:[X.accounts()],acceptableStatuses:[200]}),createCustomDomain:({accountName:e,projectName:t,isAlias:n,hostname:r,deploymentName:i,stage:a})=>({url:`${U}/v1/accounts/${e}/custom-domains`,method:`POST`,body:JSON.stringify({hostname:r,isAlias:n,deploymentName:i,stage:a}),invalidateKeys:[X.accounts(),X.projects(e),X.environments(e,t),X.customDomains(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[200]}),deleteAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${U}/v1/accounts/${e}/account-member-invites/${t}`,method:`DELETE`,invalidateKeys:[X.accountMemberInvites(e)],acceptableStatuses:[204]}),deleteCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${U}/v1/accounts/${e}/custom-domains?hostname=${n}&deploymentName=${r}`,method:`DELETE`,invalidateKeys:[X.accounts(),X.projects(e),X.environments(e,t),X.customDomains(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[204]}),editCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${U}/v1/accounts/${e}/custom-domains`,method:`PATCH`,body:JSON.stringify({hostname:n,deploymentName:r}),invalidateKeys:[X.accounts(),X.projects(e),X.environments(e,t),X.customDomains(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[200]}),resendAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${U}/v1/accounts/${e}/account-member-invites/${t}/$resend`,method:`PATCH`,body:JSON.stringify({}),invalidateKeys:[X.accountMemberInvites(e)],acceptableStatuses:[201]}),billingUpgrade:(e,t,n,r)=>({method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({successUrl:n,cancelUrl:r}),url:`${U}/v1/accounts/${e}/upgrade/${t}`}),updateAccount:({accountName:e,...t})=>({url:`${U}/v1/accounts/${e}`,method:`PATCH`,body:JSON.stringify(t),json:!0,invalidateKeys:[X.accounts()],acceptableStatuses:[200]})},ai:{createBucketConfiguration:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations`,method:`POST`,json:!0,body:JSON.stringify(t),acceptableStatuses:[201,200],invalidateKeys:[X.bucketConfigurations(e),X.bucketConfigurationTeams(e)]}),updateBucketConfiguration:(e,t,n)=>({url:`${U}/v1/buckets/${e}/configurations/${t}`,method:`PATCH`,json:!0,body:JSON.stringify(n),acceptableStatuses:[200,201],invalidateKeys:[X.bucketConfigurationTeams(e),X.bucketConfiguration(e,t),X.bucketConfigurations(e)]}),deleteBucketConfiguration:(e,t)=>({url:`${U}/v1/buckets/${e}/configurations/${t}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[X.bucketConfigurations(e)]}),createBucketConfigurationMember:(e,t,n,r)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members`,method:`POST`,json:!0,body:JSON.stringify({sub:n,role:r}),acceptableStatuses:[201,200],invalidateKeys:[X.bucketConfiguration(e,t),X.bucketConfigurationMembers(e,t)]}),putBucketConfigurationMemberRole:(e,t,n,r)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`PUT`,json:!0,body:JSON.stringify({role:r}),acceptableStatuses:[204,200],invalidateKeys:[X.bucketConfiguration(e,t),X.bucketConfigurationMembers(e,t),X.bucketConfigurationTeams(e)]}),deleteBucketConfigurationMember:(e,t,n)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[X.bucketConfigurationMembers(e,t)]}),updateBucketConfigurationMember:(e,t,n,r)=>({url:`${U}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`PATCH`,json:!0,body:JSON.stringify({role:r}),acceptableStatuses:[200],invalidateKeys:[X.bucketConfigurationMembers(e,t)]}),createBucketAiProvider:(e,{name:t,baseURL:n,label:r,description:i})=>({url:`${U}/v1/buckets/${e}/providers`,method:`POST`,json:!0,body:JSON.stringify({label:r,baseURL:n,name:t,description:i})}),createAiProviderModel:(e,t,{model:n,kind:r,inputCostPerToken:i,outputCostPerToken:a,status:o})=>({url:`${U}/v1/buckets/${e}/providers/${t}/models`,method:`POST`,json:!0,body:JSON.stringify({model:n,kind:r,inputCostPerToken:i,outputCostPerToken:a,status:o}),invalidateKeys:[X.supportedAiProviders(e)],acceptableStatuses:[200]}),createAiProviderAssignment:(e,t,n)=>({url:`${U}/v1/accounts/${e}/projects/${t}/ai-provider-assignments`,method:`POST`,body:JSON.stringify({...n,metadata:JSON.stringify(n.metadata)}),headers:{"content-type":`application/json`},invalidateKeys:[X.aiProviderAssignments(e,t)],acceptableStatuses:[201]}),updateAiProviderAssignment:(e,t,n,r)=>({url:`${U}/v1/accounts/${e}/projects/${t}/ai-provider-assignments/${n}`,method:`PATCH`,body:JSON.stringify({...r,...r.metadata?{metadata:JSON.stringify(r.metadata)}:{}}),headers:{"content-type":`application/json`},invalidateKeys:[X.aiProviderAssignments(e,t)],acceptableStatuses:[200]}),deleteAiProviderAssignment:(e,t,n)=>({url:`${U}/v1/accounts/${e}/projects/${t}/ai-provider-assignments/${n}`,method:`DELETE`,invalidateKeys:[X.aiProviderAssignments(e,t)],acceptableStatuses:[204]})},projects:{createProject:(e,t,{productType:n,...r}={})=>({url:`${U}/v1/accounts/${e}/projects`,method:`POST`,body:JSON.stringify({name:t,productType:n,options:r}),removeKeys:[X.projects(e)],acceptableStatuses:[201]}),createProjectWithRepo:(e,t,n,r,i)=>({url:`${U}/v1/accounts/${e}/projects/$create-with-repo`,method:`POST`,body:JSON.stringify({projectName:t,orgName:n,repositoryName:r,defaultBranch:i}),removeKeys:[X.projects(e)],acceptableStatuses:[201]}),createProjectFromRepo:(e,t,n,r)=>({url:`${U}/v1/accounts/${e}/projects/$create-from-repo`,method:`POST`,body:JSON.stringify({projectName:t,sourceRepoUrl:n,defaultBranch:r}),removeKeys:[X.projects(e)],acceptableStatuses:[201]}),createRepoFromProject:(e,t,n,r,i,a)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$create-repo`,method:`POST`,body:JSON.stringify({orgName:n,repositoryName:r,defaultBranch:i,otherParams:a}),invalidateKeys:[X.projects(e),X.environments(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[201]}),connectProjectToRepo:(e,t,n,r,i,a)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$connect`,method:`PATCH`,body:JSON.stringify({orgName:n,repositoryURL:r,defaultBranch:i,forceConnect:a}),invalidateKeys:[X.projects(e),X.environments(e,t),_j.deployments.list(e,t).queryKey],acceptableStatuses:[201]}),disconnectProjectFromRepo:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$disconnect`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[X.projects(e)],acceptableStatuses:[201]}),initProject:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$init`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[X.projects(e)],acceptableStatuses:[201]}),deleteProject:(e,t)=>({url:`${U}/v1/accounts/${e}/projects/${t}`,method:`DELETE`,invalidateKeys:[X.projects(e),_j.deployments.list(e,t).queryKey],removeKeys:[X.environments(e,t)],acceptableStatuses:[204]}),archiveProject:e=>({url:`${U}/v1/deployments/${e}/archive`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[200]}),updateDefaultBranch:({accountName:e,projectName:t,defaultBranch:n,sourceRepoUrl:r})=>({url:`${U}/v1/accounts/${e}/projects/${t}/$update-default-branch`,method:`PATCH`,body:JSON.stringify({defaultBranch:n,sourceRepoUrl:r}),headers:{"content-type":`application/json`},invalidateKeys:[X.projects(e),_j.deployments.list(e,t).queryKey],removeKeys:[X.environments(e,t)],acceptableStatuses:[200]})},consumers:{createConsumer:e=>{let t={...e.consumer,accountName:e.accountName,projectName:e.projectName,environmentType:e.environmentType};return{url:`${U}/v1/api-keys/${e.bucketId}/consumers`,method:`POST`,body:JSON.stringify(t),headers:{"content-type":`application/json`},invalidateKeys:[X.consumersForBucket(e.bucketId)],acceptableStatuses:[201]}},updateConsumer:e=>({url:`${U}/v1/api-keys/${e.bucketId}/consumers/${e.consumer.id}`,method:`PATCH`,body:JSON.stringify({...e.consumer}),headers:{"content-type":`application/json`},invalidateKeys:[X.consumersForBucket(e.bucketId)],acceptableStatuses:[200]}),removeConsumer:e=>({url:`${U}/v1/api-keys/${e.bucketId}/consumers/${e.consumer.id}`,method:`DELETE`,invalidateKeys:[X.consumersForBucket(e.bucketId)]})},environmentVariables:{updateEnvironmentVariable:e=>({url:`${U}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.variableData.id}`,method:`PATCH`,body:JSON.stringify(e.variableData),invalidateKeys:[X.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[200]}),createEnvironmentVariable:e=>({url:`${U}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables`,method:`POST`,body:JSON.stringify(e.variableData),invalidateKeys:[X.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[201]}),deleteEnvironmentVariable:e=>({url:`${U}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.id}`,method:`DELETE`,invalidateKeys:[X.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[204]})},users:{updatePreferences:e=>({url:`${U}/v1/users/me/preferences`,method:`PUT`,invalidateKeys:[X.user.preferences()],body:JSON.stringify({data:e}),headers:{"content-type":`application/json`},acceptableStatuses:[200]}),requestVerificationEmail:()=>({url:`${U}/v1/users/me/$send-verification-email`,method:`POST`,invalidateKeys:[],acceptableStatuses:[201]}),enrollMfaFactor:e=>({url:`${U}/v1/mfa/factors/enroll`,method:`POST`,body:JSON.stringify({factor:e}),invalidateKeys:[X.mfaFactors()],acceptableStatuses:[200],json:!0}),deleteMfaEnrollment:e=>({url:`${U}/v1/mfa/factors/enrollments/${e}`,method:`DELETE`,invalidateKeys:[X.mfaFactors()],acceptableStatuses:[200]})},sourceControlCredentials:{tokenExchangeSourceControlCredentials:(e,t,n)=>({url:`${U}/v1/accounts/${e}/source-control-configs/${t}/$token-exchange`,method:`POST`,body:JSON.stringify({code:n}),invalidateKeys:[X.accountsSourceControlConfigurations()],acceptableStatuses:[201]}),revokeSourceControlCredentials:(e,t)=>({url:`${U}/v1/accounts/${e}/source-control-configs/${t}/$revoke-token`,method:`DELETE`,invalidateKeys:[X.accountsSourceControlConfigurations()],acceptableStatuses:[204]})},sourceControlOperations:{commitPush:(e,t,n,r)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$commit-push`,method:`POST`,body:JSON.stringify({branchName:r,commitMessage:n}),acceptableStatuses:[201]}),sync:(e,t,n)=>({url:`${U}/v1/accounts/${e}/projects/${t}/$sync`,method:`POST`,body:JSON.stringify({branchName:n}),acceptableStatuses:[201,200],invalidateKeys:[]})},testDesigner:{makeTestRequest:({environmentName:e,testRequest:t,overrideUrl:n})=>{let r={body:t.body,deployment:e,headers:t.headers,method:t.method,overrideUrl:n,path:t.pathname};return{url:`${zf}/v1/test`,method:`POST`,body:JSON.stringify(r),acceptableStatuses:[200],headers:{"content-type":`application/json`}}}},featureRequest:{requestFeature:({email:e,featureName:t,information:n})=>{let r={featureName:t,information:{email:e,...n}};return{url:`${U}/v1/feature-access-request`,method:`POST`,body:JSON.stringify(r),acceptableStatuses:[200],headers:{"content-type":`application/json`}}}},fileTransactions:{saveFile:({environmentName:e,file:t})=>{let n={"content-type":`text/plain`};return t.lastModified&&(n[`if-unmodified-since`]=new Date(t.lastModified).toUTCString()),{url:`${U}/v1/deployments/${e}/fs/file?path=${t.path}`,method:`POST`,body:t.content,headers:n,acceptableStatuses:[204,200],invalidateKeys:[X.file(e,t.path),X.deploymentVersions(e),_j.deployments.versions.list(e).queryKey]}},renameFile:({environmentName:e,path:t,newPath:n})=>({url:`${U}/v1/deployments/${e}/fs/file?path=${t}`,method:`PATCH`,body:JSON.stringify({newPath:n}),acceptableStatuses:[204,200],headers:{"content-type":`application/json`},invalidateKeys:[]}),saveMultipleFiles:async({environmentName:e,files:t})=>{let n=new FormData,r={};for(let e of t)if(e.lastModified){let t=`x-if-unmodified-since-${encodeURIComponent(e.path)}`;r[t]=new Date(e.lastModified).toUTCString()}for(let{content:e,path:r}of t){let t=(await rFe(r))?.id;n.append(`files[]`,new File([e??``],r,{type:t===`text/typescript`?`text/javascript`:t}),r)}let i=t.map(({path:t})=>X.file(e,t));return{url:`${U}/v1/deployments/${e}/fs/files`,method:`POST`,body:n,headers:r,acceptableStatuses:[204,200],invalidateKeys:[...i,X.deploymentVersions(e),_j.deployments.versions.list(e).queryKey]}},deleteFile:({environmentName:e,filePath:t})=>({url:`${U}/v1/deployments/${e}/fs/delete?path=${t}`,method:`DELETE`,acceptableStatuses:[204,200]})},directories:{createDirectory:({environmentName:e,path:t})=>({url:`${U}/v1/deployments/${e}/fs/dir?path=${t}`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[201]})},environments:{redeploy:({environmentName:e,isWorkingCopy:t,version:n})=>({url:t?`${U}/v1/deployments/${e}/$redeploy`:`${U}/v1/deployments/${e}/versions/${n}/$redeploy`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[200],invalidateKeys:[X.deploymentVersions(e),_j.deployments.versions.list(e).queryKey]}),delete:({environmentName:e})=>({url:`${U}/v1/deployments/${e}`,method:`DELETE`,body:JSON.stringify({}),acceptableStatuses:[200]})},accountInvite:{acceptAccountInvite:e=>({url:`${U}/v1/account-member-invites/${e}`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[X.accounts()],acceptableStatuses:[201]}),createAccountInvite:(e,t,n)=>{let r=n?.project?.name?[X.authProjectUsersRoles(e,n.project.name),n.team?.id?X.bucketConfigurationMembers(n.team?.bucketId,n.team?.id):[],X.authProjectUsersRoles(e,n.project.name,{includeInheritedRoles:!1}),X.authProjectUsersRoles(e,n.project.name,{includeInheritedRoles:!0})].flat():[];return{url:`${U}/v1/accounts/${e}/account-member-invites`,method:`POST`,body:JSON.stringify({userEmail:t,metadata:n}),invalidateKeys:[X.accountMemberInvites(e),X.authAccountUsersRoles(e),...r],acceptableStatuses:[201]}}},identity:{chatIdentity:e=>({url:`${U}/v1/chat-identity`,method:`POST`,json:!0,headers:{"content-type":`application/json`},body:JSON.stringify(e),invalidateKeys:[X.chatIdentity()],acceptableStatuses:[200]})},metering:{createMeteringPlan:(e,t,n)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/plans`,method:`POST`,headers:{"Content-Type":`application/json`},invalidateKeys:[X.meteringPlans(e,t),X.meteringBucket(e,t)],body:JSON.stringify(n)}),deleteMeteringPlan:(e,t,n)=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/plans/${n}`,invalidateKeys:[X.meteringPlans(e,t),X.meteringBucket(e,t)],method:`DELETE`}),updateMeteringPlan:(e,t,{id:n,...r})=>({url:`${U}/v1/metering/accounts/${e}/buckets/${t}/plans/${n}`,invalidateKeys:[X.meteringPlans(e,t),X.meteringBucket(e,t)],method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)})},mcpGateway:{deleteMcpTeam:(e,t)=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams/${t}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[X.mcpBucketConfigurationsTeams(e)]}),createMcpTeam:(e,t)=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams`,method:`POST`,json:!0,body:JSON.stringify(t),acceptableStatuses:[201,200],invalidateKeys:[X.mcpBucketConfigurationsTeams(e)]}),updateMcpTeam:(e,t,n)=>({url:`${U}/v1/buckets/${e}/mcp/configurations/teams/${t}`,method:`PATCH`,json:!0,body:JSON.stringify(n),acceptableStatuses:[201,200],invalidateKeys:[X.mcpBucketConfigurations(e),X.mcpBucketConfigurationsTeams(e),X.mcpBucketConfigurationTeam(e,t)]})},logs:{sourcemap:e=>({url:`${U}/v1/logs/sourcemap`,method:`POST`,json:!0,body:JSON.stringify(e),acceptableStatuses:[200]})},identityConnections:{createTicket:e=>({url:`${U}/v1/accounts/${e}/identity-connections/ticket`,method:`POST`,json:!0,body:JSON.stringify({}),invalidateKeys:[X.identityConnections(e)],acceptableStatuses:[200]})},migration:{migrateDevPortal:e=>({url:`${U}/v1/migrate/dev-portal`,method:`POST`,json:!1,body:JSON.stringify({deploymentName:e}),headers:{"content-type":`application/json`},acceptableStatuses:[200]})}},xj=e=>{let t=y_(),n=Wg(),r=Aoe();return{fetch:async i=>{let a=Xf(),o;try{o=await qse(t=>{let n=new Headers(i.headers);return i.json&&i.method!==`DELETE`&&n.set(`content-type`,`application/json`),n.set(`authorization`,`Bearer ${t}`),n.set(`zuplo-request-id`,a),fetch(i.url,{...e,method:i.method,headers:n,body:i.body})},n,r)}catch(e){throw e instanceof Lf&&e.setTraceId(a),e instanceof TypeError?new If({type:`https://zup.fail/api-request-failed`,title:`API request failed`,status:500,instance:i.url,traceId:a}):e}if(!(i.acceptableStatuses??[200]).includes(o.status)){let e=new Lf(`Unexpected response: ${o.status} calling ${i.method}: ${i.url}`,{traceId:a});throw await e.tryReadResponse(o),e}return i.invalidateKeys?.forEach(e=>{if(Array.isArray(e))t.invalidateQueries({queryKey:e,exact:!1});else if(`url`in e&&e.url){let n=e.url.split(`?`)[0];t.invalidateQueries({predicate:e=>{let t=e.queryKey[0];return typeof t==`string`&&t.split(`?`)[0]===n}})}}),i.removeKeys?.forEach(e=>{t.removeQueries({queryKey:[e.url]})}),i.parseResponse===!1?o:i.json?await o.json():o}}},iFe=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.directories.createDirectory(t))})},aFe=`API request failed`;async function Sj(e,t,n={}){let{text:r,extractData:i}=n;if(!e||typeof e!=`string`)throw new If({type:`https://zup.fail/missing-url`,title:`Missing URL`});let a=Xf(),o;try{o=await qse(t=>{let n=new Request(e);return n.headers.set(`authorization`,`Bearer ${t}`),n.headers.set(`zuplo-request-id`,a),fetch(n)},t,()=>{$f().then(({handleLogout:e})=>e())})}catch(t){throw t instanceof TypeError?new If({type:`https://zup.fail/api-request-failed`,title:aFe,instance:e,traceId:a},{cause:t}):(t instanceof Lf&&t.setTraceId(a),t)}if(!o.ok){let e=new Lf(`Error while making request. Please try again or contact support if the problem persists.`,{traceId:a});throw await e.tryReadResponse(o),e}try{let e=r?await o.clone().text():await o.clone().json();return i?e.data:e}catch(t){let n=await o.clone().text();throw Ef.captureException(t,{message:`Failed to parse response of ${e} to JSON`,responseText:n,status:o.status,traceId:a,requestUrl:e}),t}}function oFe(e,t={}){let n=Wg();return Use({queries:e.map(e=>({queryKey:[e.url,t.extractData],queryFn:()=>Sj(e.url,n,t)}))})}function Cj(e,{text:t,extractData:n=!0,...r}={}){let i=Wg();return w_({queryKey:[e.url,n],queryFn:async({queryKey:e})=>{let[r]=e;return Sj(r,i,{text:t,extractData:n})},...r})}function wj(e,{enabled:t,text:n,extractData:r,...i}={}){let a=Wg();return C_({enabled:t,queryKey:[e.url,r],queryFn:async({queryKey:e})=>{let[t]=e;return Sj(t,a,{text:n,extractData:r})},...i})}var Tj={".ts":`typescript`,".tsx":`typescript`,".js":`javascript`,".jsx":`javascript`,".mjs":`javascript`,".cjs":`javascript`,".json":`json`,".html":`html`,".htm":`html`,".xml":`xml`,".svg":`xml`,".yaml":`yaml`,".yml":`yaml`,".md":`markdown`,".mdx":`markdown`,".css":`css`,".scss":`scss`,".sass":`sass`,".less":`less`,".py":`python`,".rs":`rust`,".go":`go`,".java":`java`,".c":`c`,".cpp":`cpp`,".cs":`csharp`,".php":`php`,".rb":`ruby`,".sh":`shell`,".bash":`shell`,".zsh":`shell`,".sql":`sql`,".graphql":`graphql`,".gql":`graphql`,".env":`plaintext`,".toml":`toml`,".ini":`ini`,".properties":`properties`,".dockerfile":`dockerfile`,Dockerfile:`dockerfile`,".makefile":`makefile`,Makefile:`makefile`};function Ej(e){let t=e.split(`/`).pop()||``;if(Tj[t])return Tj[t];let n=t.lastIndexOf(`.`);return n===-1?`plaintext`:Tj[t.slice(n)]||`plaintext`}var sFe=(e,t,n)=>wj(X.file(e,t),{...n,text:!0,select:e=>({content:e,contentType:`text/plain`,language:Ej(t),path:t})}),Dj=()=>{let e=xj();return T_({mutationFn:async t=>{let n=await e.fetch({...bj.fileTransactions.saveFile(t),parseResponse:!1}),r=n.headers.get(`Last-Modified`),i=r?new Date(r).getTime():void 0;return{...await n.json(),lastModified:i}}})},Oj=e=>{let t=xj();return T_({mutationFn:async e=>{if(!e.environmentName||!e.files)throw Error(`No environment name or files provided`);return await(await t.fetch(await bj.fileTransactions.saveMultipleFiles(e))).json()},mutationKey:Oj.mutationKey,...e})};Oj.mutationKey=[`saveStatus`];var cFe=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.fileTransactions.deleteFile(t))})},lFe=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.fileTransactions.renameFile(t))})},kj=null,Aj=null;function uFe(){return Aj??=a(()=>import(`./editor.main-gzibWb3g.js`).then(e=>(kj=e,e)),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),Aj}function jj(){let[e,t]=(0,g.useState)(kj);return(0,g.useEffect)(()=>{if(kj){t(kj);return}let e=!0;return uFe().then(n=>{e&&t(n)}),()=>{e=!1}},[]),e}function Mj(e,t,n){let r=(0,g.useRef)(!1);(0,g.useEffect)(()=>{if(!e)return;if(!r.current){r.current=!0;return}let i=requestAnimationFrame(()=>{if(n.current)try{e.editor.setTheme(t)}catch{}});return()=>cancelAnimationFrame(i)},[e,t,n])}var Nj={display:`flex`,position:`relative`,textAlign:`initial`};function dFe({value:e,defaultValue:t,language:n,defaultLanguage:r,path:i,theme:a=`vs`,line:o,options:s={},overrideServices:c,onChange:l,onMount:u,beforeMount:d,className:f,width:p=`100%`,height:m=`100%`,keepCurrentModel:h=!1,wrapperProps:_}){let v=jj(),y=(0,g.useRef)(null),b=(0,g.useRef)(null),x=(0,g.useRef)(l);x.current=l;let S=(0,g.useRef)(h);S.current=h;let C=(0,g.useRef)(!1);return(0,g.useEffect)(()=>{if(!v)return;let l=y.current;if(!l)return;d?.(v);let f=i?v.Uri.parse(i):void 0,p=f&&v.editor.getModel(f)||v.editor.createModel(e??t??``,n??r,f),m=v.editor.create(l,{...s,model:p,theme:a},c);b.current=m,o!=null&&m.revealLine(o);let h=m.onDidChangeModelContent(e=>{C.current||x.current?.(m.getValue(),e)});return u?.(m,v),()=>{h.dispose();let e=m.getModel();m.dispose(),S.current||e?.dispose(),b.current=null}},[v]),(0,g.useEffect)(()=>{let t=b.current;if(!t||e===void 0)return;let n=t.getModel();!n||e===n.getValue()||(C.current=!0,t.executeEdits(``,[{range:n.getFullModelRange(),text:e,forceMoveMarkers:!0}]),t.pushUndoStop(),C.current=!1)},[e]),(0,g.useEffect)(()=>{let e=b.current?.getModel();v&&e&&n&&v.editor.setModelLanguage(e,n)},[v,n]),Mj(v,a,b),(0,g.useEffect)(()=>{b.current?.updateOptions(s)},[s]),(0,g.useEffect)(()=>{o!=null&&b.current?.revealLine(o)},[o]),(0,W.jsx)(`section`,{..._,style:{...Nj,width:p,height:m},children:(0,W.jsx)(`div`,{ref:y,className:f,style:{width:`100%`}})})}function fFe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,theme:a=`vs`,options:o={},onMount:s,beforeMount:c,className:l,width:u=`100%`,height:d=`100%`,keepCurrentOriginalModel:f=!1,keepCurrentModifiedModel:p=!1,wrapperProps:m}){let h=jj(),_=(0,g.useRef)(null),v=(0,g.useRef)(null),y=(0,g.useRef)(f);y.current=f;let b=(0,g.useRef)(p);return b.current=p,(0,g.useEffect)(()=>{if(!h)return;let l=_.current;if(!l)return;c?.(h);let u=h.editor.createDiffEditor(l,{...o,theme:a});return v.current=u,u.setModel({original:h.editor.createModel(e??``,r??n),modified:h.editor.createModel(t??``,i??n)}),s?.(u,h),()=>{let e=u.getModel();u.dispose(),y.current||e?.original.dispose(),b.current||e?.modified.dispose(),v.current=null}},[h]),(0,g.useEffect)(()=>{let t=v.current?.getModel();t&&e!=null&&e!==t.original.getValue()&&t.original.setValue(e)},[e]),(0,g.useEffect)(()=>{let e=v.current?.getModel();e&&t!=null&&t!==e.modified.getValue()&&e.modified.setValue(t)},[t]),Mj(h,a,v),(0,W.jsx)(`section`,{...m,style:{...Nj,width:u,height:d},children:(0,W.jsx)(`div`,{ref:_,className:l,style:{width:`100%`}})})}var Pj=(e=[])=>{let t=On(),n=Object.keys(t);if(e.some(e=>!n.includes(e)))throw Error(`${e.join(`, `)} are required`);return t};function Fj(e,t){let n=t.map(e=>e.fileGlob),r=t.flatMap(e=>{let t=[e.folderName];return e.subdirectoryGlob?t.concat(e.subdirectoryGlob):t});return e.filter(e=>e.type===$r.Directory&&r.some(t=>rj(e.path,t))?!0:n.find(t=>rj(e.path,t))!==void 0)}function pFe(e,t){return(0,g.useCallback)(async()=>Fj(await rp(t,`/`),e),[t,e])}function Ij(){let{logEvent:e}=Vg(),t=Wj(),n=fh(),r=dh(e=>e.showSaveConflict);return Oj({onMutate:({files:e})=>{e.forEach(e=>{t({...e,saveState:ei.saving})})},onSuccess:async(e,{files:n})=>{n.forEach(n=>{let r=e.files?.[n.path];jf.debug(`Updated ${n.path} after save - lastModified: ${r}`),t({...n,lastModified:r,saveState:ei.unmodified})})},onError:(i,{files:a})=>{if(i instanceof Error&&`status`in i&&i.status===412){let e=i;if(e.instance)try{let t=JSON.parse(e.instance).conflictedFiles;t&&t.length>0&&r(t[0])}catch(e){jf.error(`Failed to parse conflict error instance data`,{error:e})}return}a.forEach(e=>{t({...e,saveState:ei.modified})}),e(`file-save-failed`,{fileNames:n.map(e=>e.path).join(`, `)})}})}function Lj(){let e=lh(),{logEvent:t,captureException:n}=Vg(),r=Uj(),i=Wj(),a=cFe(),{isReadOnly:o}=HA(),{execute:s}=BA(async s=>{if(o)return{success:!1,error:Error(`Unable to delete file - environment is read-only`)};let c=s.saveState;i({...s,saveState:ei.removing});try{return await a.mutateAsync({environmentName:e.environment.name,filePath:s.path}),r(s.path),t(`file-deleted`,{fileName:s.path,account:e.account.name,project:e.project.name,environment:e.environment.name}),{success:!0}}catch(r){return t(`file-deletion-failed`,{account:e.account.name,project:e.project.name,environment:e.environment.name}),n(r),i({...s,saveState:c}),{success:!1,error:r}}});return s}function Rj(){let e=jj(),{logEvent:t,captureException:n}=Vg(),r=Wj(),i=dh(e=>e.projectTreeNodes),a=Dj(),o=lh([`account`,`project`,`environment`]),{execute:s}=BA(async(s,c,l,u,d)=>{if(!e)return;let f=l??u.defaultFileTemplate,p=u.createExtensions[f],m=`${c}/${!p||s.toLowerCase().endsWith(`.${p}`)||s===u.predefinedTemplateFilename?.[f]?s:`${s}.${p}`}`,h=(l&&u.newFileTemplates[l]?.trimStart())??d??``,g=i.find(e=>e.path===m);if(g)return g;if(i.length===0){let e=(await rp(o.environment.name,c).catch(()=>[])).find(e=>e.path===m);if(e)return e}let _={content:h,path:m},v={saveState:ei.new,type:$r.File,..._};try{r(v),e.editor.createModel(_.content??``,void 0,e.Uri.file(m));let n=await a.mutateAsync({environmentName:o.environment.name,file:_,accountName:o.account.name,projectName:o.project.name});return r({...v,lastModified:n.lastModified,saveState:ei.unmodified}),t(`file-added`,{account:o.account.name,project:o.project.name,environment:o.environment.name,fileName:v.path,strategy:u.name}),_}catch(e){t(`file-creation-failed`,{environment:o.environment.name}),n(e),r({...v,saveState:ei.modified});return}});return s}function mFe(e){let t=jj(),{logEvent:n,captureException:r}=Vg(),i=Pj([`account`,`project`]),a=Wj(),o=Uj(),s=lFe(),{execute:c}=BA(async(c,l)=>{if(t)try{a({...c,saveState:ei.removing}),await s.mutateAsync({environmentName:e,path:c.path,newPath:l}),a({...c,saveState:ei.new,path:l}),t.editor.createModel(c.content??``,void 0,t.Uri.file(l));let r=t.editor.getModel(t.Uri.file(c.path));a({...c,path:l}),r?.dispose(),o(c.path),n(`file-renamed`,{fileName:c.path,environment:e})}catch(t){n(`file-rename-failed`,{account:i.account,project:i.project,environment:e}),r(t),a({...c,saveState:ei.unmodified});return}});return c}function hFe(e){let t=jj(),{logEvent:n,captureException:r}=Vg(),i=Wj(),a=iFe(),{execute:o}=BA(async(o,s,c)=>{if(!t)return Error(`Failed to acquire monaco instance. Please refresh the page.`);let l=`${s}/${o}`,u={path:l},d={saveState:ei.new,type:$r.Directory,...u};try{return i(d),await a.mutateAsync({environmentName:e,path:l}),i({...d,saveState:ei.unmodified}),n(`directory-added`,{fileName:d.path,strategy:c.name,environment:e}),u}catch(t){return n(`directory-creation-failed`,{environment:e}),r(t),i({...d,saveState:ei.modified}),t}});return o}function zj(){return Vj(UA().get(`path`))}function Bj(){let e=jj(),t=Wj();return(0,g.useCallback)((n,r=!1,i=ei.modified)=>{if(t({...n,saveState:i}),r&&e){let t=e.editor.getModel(e.Uri.file(n.path));t&&t.setValue(n.content??``)}},[e,t])}function Vj(e){return dh(t=>e?t.filesByPath[e]:void 0)}function gFe(e){let t=dh(e=>e.projectTreeNodes),n=[],r=Object.values(e);return t.filter(e=>e.type===$r.Directory).forEach(e=>{let t=r.find(t=>t.folderName===e.path);if(t)return n.push(t)}),r.sort((e,t)=>e.order-t.order)}function Hj(e){return dh(e=>e.projectTreeNodes).filter(t=>!t.path&&!e.fileGlob?!1:t.type===$r.Directory&&e.subdirectoryGlob?rj(t.path,e.subdirectoryGlob):rj(t.path,e.fileGlob))}function Uj(){let e=jj(),t=dh(e=>e.removeFile),n=dh(e=>e.filterProjectTreeNodes);return r=>{e&&e.editor.getModel(e.Uri.file(r))?.dispose(),t(r),n(e=>e.path!==r)}}function Wj(){return dh(e=>e.updateFile)}var _Fe=e=>{let t=Bj(),n=Vj(e);return e=>{n&&t(n,!0,e)}};function Gj(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Kj(e){return`$import(${e})`}function vFe(e){let t=e.split(`/`).pop();return t?t.replace(`.ts`,``):``}function qj(e,t){let n=/\$import\((.*?)\)/g.exec(e);if(!n||n.length!==2)return`INVALID IMPORT STATEMENT`;let r=n[1];return t!==void 0&&r.indexOf(t)===0?r.substring(t.length):r}var Jj=e=>{let t=``;switch(e){case`GITLAB`:t=`GitLab`;break;case`GITHUB`:t=`GitHub`;break;case`BITBUCKET`:t=`Bitbucket`;break;case`AZURE`:t=`Azure DevOps`;break;default:t=e;break}return t},yFe=(e,t)=>{let n=t.accounts.filter(t=>t.name===e),r;if(n[0].sourceControlConfigurations&&n[0].sourceControlConfigurations.length>0)r=n[0].sourceControlConfigurations[0];else{let e=t.global.filter(e=>e.provider===n[0].sourceControlProvider);r=e.length>0?e[0]:null}return r};function Yj(e){if(!e)return``;if(typeof e==`object`){if(e instanceof Lf)return e.detail??e.title??e.message;if(`message`in e)return e.message}return typeof e==`string`?e:``}var Xj=({error:e,size:t=24})=>{switch(e.status){case 401:return(0,W.jsx)(qm,{size:t});case 403:return(0,W.jsx)(mre,{size:t});case 404:return(0,W.jsx)(wre,{size:t});default:return(0,W.jsx)(Cm,{size:t})}},bFe=({error:e})=>(0,W.jsx)(`div`,{className:`flex items-center gap-2 rounded-full border-2 border-neutral-100 bg-neutral-50 text-neutral-300 p-4`,children:(0,W.jsx)(Xj,{error:e})}),xFe=({error:e})=>{switch(e.status){case 401:return(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/accounts/managing-account-members`,children:`Learn more about Managing Account Members`});default:return null}},SFe=({error:e,title:t=`Unable to access`,children:n,className:r,variant:i=`default`})=>(0,W.jsxs)(PS,{variant:i,className:G(`w-full flex items-center gap-8`,r),children:[(0,W.jsx)(bFe,{error:e}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(FS,{children:t}),(0,W.jsxs)(IS,{className:`flex flex-col gap-2`,children:[Yj(e),(0,W.jsx)(xFe,{error:e}),n]})]})]}),Zj=({successMessage:e}={})=>{let t=ch();return{onSuccess:n=>{t.success(n??e,{icon:(0,W.jsx)(vm,{size:18})})},onError:e=>t.error(Yj(e),{icon:e instanceof Lf?(0,W.jsx)(Xj,{error:e,size:18}):(0,W.jsx)(Cm,{size:18})})}},Qj=(e,t,n)=>C_({..._j.deployments.list(e,t),...n,select:e=>e.data}),$j=(e,t={})=>Wse({..._j.deployments.versions.list(e),...t,select:e=>({...e,data:e.data?.map(e=>({...e,stages:[...e.stages].sort((e,t)=>e.stage.localeCompare(t.stage))}))})}),eM=(e,t={})=>w_($j(e,t)),CFe=()=>{let e=lh(),t=Ij(),n=fh();return eM(e.environment.name),{isPending:t.isPending,isSuccess:t.isSuccess,saveAndDeploy:(0,g.useCallback)(async()=>t.mutateAsync({environmentName:e.environment.name,accountName:e.account.name,projectName:e.project.name,files:n}).catch(e=>{if(!(e instanceof Error&&`status`in e&&e.status===409))throw e}),[t,n,!1,e.environment.name,e.account.name,e.project.name])}},wFe=(e={})=>{let{isReadOnly:t=!1,onSave:n}=e,{saveAndDeploy:r,isPending:i,isSuccess:a}=CFe(),[o,s]=(0,g.useState)(null),c=dh(e=>{let t=0;for(let n of e.projectTreeNodes){let r=n.path?e.filesByPath[n.path]:void 0;r&&r.saveState===ei.modified&&t++}return t}),l=dh(e=>{let t=0;for(let n of e.projectTreeNodes){let r=n.path?e.filesByPath[n.path]:void 0;r&&(r.saveState===ei.modified||r.saveState===ei.saving)&&t++}return t}),u=(0,g.useRef)(null),d=e=>{s(e),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{s(null)},1600)},f=zA(r),p=zA(n),m=sh(e=>e.addToast),h=(0,g.useRef)(!1),_=(0,g.useRef)(!1);return(0,g.useEffect)(()=>{let e=h.current;!e&&i?_.current=l>0:e&&!i&&a&&_.current&&(m({message:`Changes saved`,icon:(0,g.createElement)(vm,{size:18}),duration:2e3}),_.current=!1),h.current=i},[i,a,l,m]),(0,g.useEffect)(()=>{let e=async e=>{try{if(e.code===`KeyS`&&(e.metaKey||e.ctrlKey)){if(e.preventDefault(),t){d(`Read only environment`);return}let n=document.activeElement;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement){let e=n.selectionEnd;n.blur(),n.focus(),(n instanceof HTMLInputElement&&n.type!==`checkbox`||n instanceof HTMLTextAreaElement)&&n.setSelectionRange(e,e),await sPe(100)}if(c===0){d(`No unsaved changes`);return}p.current?.(),await f.current()}}catch(e){jf.error(`Error saving files`,{error:e}),s(`Error saving files`)}};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t,c,f,p]),{showTooltip:o,isSaving:i,unsavedChangesCount:c,saveAll:r}},TFe=()=>{let{showTooltip:e,saveAll:t,isSaving:n,unsavedChangesCount:r}=wFe(),{hasEditor:i,editorName:a,isLoading:o,showPreferenceDialog:s,setShowPreferenceDialog:c,availableEditors:l,savePreference:u,openInEditor:d}=oPe();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`sticky bottom-0 h-12 border-t bg-surface-sunken items-center flex px-2 gap-x-2`,children:[(0,W.jsx)(Mk,{open:!!e,content:e??``,children:(0,W.jsx)(Y,{variant:r>0||n?`default`:`ghost`,size:`sm`,className:`text-xs`,"data-test":`save`,disabled:n,onClick:async()=>{await t()},children:(0,W.jsxs)(Pk,{className:`flex items-center gap-1 text-xs relative`,loading:n,children:[`Save`,(0,W.jsx)(`span`,{className:r>0?`text-white`:`text-muted-foreground`,children:`[⌘+S]`})]})})}),!o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`h-6 w-px bg-border`}),(0,W.jsx)(Mk,{content:i?`Open in ${a}`:`Choose editor to open files`,children:(0,W.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:d,className:`text-xs`,children:[(0,W.jsx)(Pm,{size:14}),`Open in Editor`]})})]})]}),(0,W.jsx)(aPe,{open:s,editors:l,onSelect:u,onCancel:()=>c(!1)})]})},tM=(0,g.createContext)(null);tM.displayName=`PanelGroupContext`;var nM={group:`data-panel-group`,groupDirection:`data-panel-group-direction`,groupId:`data-panel-group-id`,panel:`data-panel`,panelCollapsible:`data-panel-collapsible`,panelId:`data-panel-id`,panelSize:`data-panel-size`,resizeHandle:`data-resize-handle`,resizeHandleActive:`data-resize-handle-active`,resizeHandleEnabled:`data-panel-resize-handle-enabled`,resizeHandleId:`data-panel-resize-handle-id`,resizeHandleState:`data-resize-handle-state`},rM=10,iM=g.useLayoutEffect,aM=g.useId,EFe=typeof aM==`function`?aM:()=>null,DFe=0;function oM(e=null){let t=EFe(),n=(0,g.useRef)(e||t||null);return n.current===null&&(n.current=``+ DFe++),e??n.current}function sM({children:e,className:t=``,collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:a,id:o,maxSize:s,minSize:c,onCollapse:l,onExpand:u,onResize:d,order:f,style:p,tagName:m=`div`,...h}){let _=(0,g.useContext)(tM);if(_===null)throw Error(`Panel components must be rendered within a PanelGroup container`);let{collapsePanel:v,expandPanel:y,getPanelSize:b,getPanelStyle:x,groupId:S,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:T,resizePanel:E,unregisterPanel:D}=_,O=oM(o),k=(0,g.useRef)({callbacks:{onCollapse:l,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:s,minSize:c},id:O,idIsFromProps:o!==void 0,order:f});(0,g.useRef)({didLogMissingDefaultSizeWarning:!1}),iM(()=>{let{callbacks:e,constraints:t}=k.current,a={...t};k.current.id=O,k.current.idIsFromProps=o!==void 0,k.current.order=f,e.onCollapse=l,e.onExpand=u,e.onResize=d,t.collapsedSize=n,t.collapsible=r,t.defaultSize=i,t.maxSize=s,t.minSize=c,(a.collapsedSize!==t.collapsedSize||a.collapsible!==t.collapsible||a.maxSize!==t.maxSize||a.minSize!==t.minSize)&&w(k.current,a)}),iM(()=>{let e=k.current;return T(e),()=>{D(e)}},[f,O,T,D]),(0,g.useImperativeHandle)(a,()=>({collapse:()=>{v(k.current)},expand:e=>{y(k.current,e)},getId(){return O},getSize(){return b(k.current)},isCollapsed(){return C(k.current)},isExpanded(){return!C(k.current)},resize:e=>{E(k.current,e)}}),[v,y,b,C,O,E]);let A=x(k.current,i);return(0,g.createElement)(m,{...h,children:e,className:t,id:O,style:{...A,...p},[nM.groupId]:S,[nM.panel]:``,[nM.panelCollapsible]:r||void 0,[nM.panelId]:O,[nM.panelSize]:parseFloat(``+A.flexGrow).toFixed(1)})}var cM=(0,g.forwardRef)((e,t)=>(0,g.createElement)(sM,{...e,forwardedRef:t}));sM.displayName=`Panel`,cM.displayName=`forwardRef(Panel)`;var OFe;function kFe(){return OFe}var lM=null,AFe=!0,uM=-1,dM=null;function jFe(e,t){if(t){let e=(t&xM)!==0,n=(t&SM)!==0,r=(t&CM)!==0,i=(t&wM)!==0;if(e)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}switch(e){case`horizontal`:return`ew-resize`;case`intersection`:return`move`;case`vertical`:return`ns-resize`}}function MFe(){dM!==null&&(document.head.removeChild(dM),lM=null,dM=null,uM=-1)}function fM(e,t){if(!AFe)return;let n=jFe(e,t);if(lM!==n){if(lM=n,dM===null){dM=document.createElement(`style`);let e=kFe();e&&dM.setAttribute(`nonce`,e),document.head.appendChild(dM)}if(uM>=0){var r;(r=dM.sheet)==null||r.removeRule(uM)}uM=dM.sheet?.insertRule(`*{cursor: ${n} !important;}`)??-1}}function pM(e){return e.type===`keydown`}function mM(e){return e.type.startsWith(`pointer`)}function hM(e){return e.type.startsWith(`mouse`)}function gM(e){if(mM(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(hM(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function NFe(){if(typeof matchMedia==`function`)return matchMedia(`(pointer:coarse)`).matches?`coarse`:`fine`}function PFe(e,t,n){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function FFe(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:yM(e),b:yM(t)},r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;zM(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:vM(_M(n.a)),b:vM(_M(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var IFe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function LFe(e){let t=getComputedStyle(bM(e)??e).display;return t===`flex`||t===`inline-flex`}function RFe(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||LFe(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||IFe.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function _M(e){let t=e.length;for(;t--;){let n=e[t];if(zM(n,`Missing node`),RFe(n))return n}return null}function vM(e){return e&&Number(getComputedStyle(e).zIndex)||0}function yM(e){let t=[];for(;e;)t.push(e),e=bM(e);return t}function bM(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}var xM=1,SM=2,CM=4,wM=8,zFe=NFe()===`coarse`,TM=[],EM=!1,DM=new Map,OM=new Map,kM=new Set;function BFe(e,t,n,r,i){let{ownerDocument:a}=t,o={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},s=DM.get(a)??0;return DM.set(a,s+1),kM.add(o),LM(),function(){OM.delete(e),kM.delete(o);let t=DM.get(a)??1;if(DM.set(a,t-1),LM(),t===1&&DM.delete(a),TM.includes(o)){let e=TM.indexOf(o);e>=0&&TM.splice(e,1),FM(),i(`up`,!0,null)}}}function VFe(e){let{target:t}=e,{x:n,y:r}=gM(e);EM=!0,NM({target:t,x:n,y:r}),LM(),TM.length>0&&(RM(`down`,e),e.preventDefault(),MM(t)||e.stopImmediatePropagation())}function AM(e){let{x:t,y:n}=gM(e);if(EM&&e.buttons===0&&(EM=!1,RM(`up`,e)),!EM){let{target:r}=e;NM({target:r,x:t,y:n})}RM(`move`,e),FM(),TM.length>0&&e.preventDefault()}function jM(e){let{target:t}=e,{x:n,y:r}=gM(e);OM.clear(),EM=!1,TM.length>0&&(e.preventDefault(),MM(t)||e.stopImmediatePropagation()),RM(`up`,e),NM({target:t,x:n,y:r}),FM(),LM()}function MM(e){let t=e;for(;t;){if(t.hasAttribute(nM.resizeHandle))return!0;t=t.parentElement}return!1}function NM({target:e,x:t,y:n}){TM.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),kM.forEach(e=>{let{element:i,hitAreaMargins:a}=e,o=i.getBoundingClientRect(),{bottom:s,left:c,right:l,top:u}=o,d=zFe?a.coarse:a.fine;if(t>=c-d&&t<=l+d&&n>=u-d&&n<=s+d){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&FFe(r,i)>0){let e=r,t=!1;for(;e&&!e.contains(i);){if(PFe(e.getBoundingClientRect(),o,!0)){t=!0;break}e=e.parentElement}if(t)return}TM.push(e)}})}function PM(e,t){OM.set(e,t)}function FM(){let e=!1,t=!1;TM.forEach(n=>{let{direction:r}=n;r===`horizontal`?e=!0:t=!0});let n=0;OM.forEach(e=>{n|=e}),e&&t?fM(`intersection`,n):e?fM(`horizontal`,n):t?fM(`vertical`,n):MFe()}var IM=new AbortController;function LM(){IM.abort(),IM=new AbortController;let e={capture:!0,signal:IM.signal};kM.size&&(EM?(TM.length>0&&DM.forEach((t,n)=>{let{body:r}=n;t>0&&(r.addEventListener(`contextmenu`,jM,e),r.addEventListener(`pointerleave`,AM,e),r.addEventListener(`pointermove`,AM,e))}),window.addEventListener(`pointerup`,jM,e),window.addEventListener(`pointercancel`,jM,e)):DM.forEach((t,n)=>{let{body:r}=n;t>0&&(r.addEventListener(`pointerdown`,VFe,e),r.addEventListener(`pointermove`,AM,e))}))}function RM(e,t){kM.forEach(n=>{let{setResizeHandlerState:r}=n;r(e,TM.includes(n),t)})}function HFe(){let[e,t]=(0,g.useState)(0);return(0,g.useCallback)(()=>t(e=>e+1),[])}function zM(e,t){if(!e)throw console.error(t),Error(t)}function BM(e,t,n=rM){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function VM(e,t,n=rM){return BM(e,t,n)===0}function HM(e,t,n){return BM(e,t,n)===0}function UFe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(!HM(i,a,n))return!1}return!0}function UM({panelConstraints:e,panelIndex:t,size:n}){let r=e[t];zM(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r;if(BM(n,s)<0)if(a){let e=(i+s)/2;n=BM(n,e)<0?i:s}else n=s;return n=Math.min(o,n),n=parseFloat(n.toFixed(rM)),n}function WM({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(HM(e,0))return t;let o=[...t],[s,c]=r;zM(s!=null,`Invalid first pivot index`),zM(c!=null,`Invalid second pivot index`);let l=0;if(a===`keyboard`){{let r=e<0?c:s,i=n[r];zM(i,`Panel constraints not found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(zM(n!=null,`Previous layout not found for panel index ${r}`),HM(n,a)){let t=l-n;BM(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let r=e<0?s:c,i=n[r];zM(i,`No panel constraints found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(zM(n!=null,`Previous layout not found for panel index ${r}`),HM(n,l)){let t=n-a;BM(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?c:s,a=0;for(;;){let e=t[i];zM(e!=null,`Previous layout not found for panel index ${i}`);let o=UM({panelConstraints:n,panelIndex:i,size:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let o=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-o:o}{let r=e<0?s:c;for(;r>=0&&r<n.length;){let i=Math.abs(e)-Math.abs(l),a=t[r];zM(a!=null,`Previous layout not found for panel index ${r}`);let s=a-i,c=UM({panelConstraints:n,panelIndex:r,size:s});if(!HM(a,c)&&(l+=a-c,o[r]=c,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?r--:r++}}if(UFe(i,o))return i;{let r=e<0?c:s,i=t[r];zM(i!=null,`Previous layout not found for panel index ${r}`);let a=i+l,u=UM({panelConstraints:n,panelIndex:r,size:a});if(o[r]=u,!HM(u,a)){let t=a-u,r=e<0?c:s;for(;r>=0&&r<n.length;){let i=o[r];zM(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=UM({panelConstraints:n,panelIndex:r,size:a});if(HM(i,s)||(t-=s-i,o[r]=s),HM(t,0))break;e>0?r--:r++}}}return HM(o.reduce((e,t)=>t+e,0),100)?o:i}function WFe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];return zM(s!=null,`No pivot index found`),t.forEach((e,t)=>{let{constraints:n}=e,{maxSize:c=100,minSize:l=0}=n;t===s?(r=l,i=c):(a+=l,o+=c)}),{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function GM(e,t=document){return Array.from(t.querySelectorAll(`[${nM.resizeHandleId}][data-panel-group-id="${e}"]`))}function KM(e,t,n=document){return GM(e,n).findIndex(e=>e.getAttribute(nM.resizeHandleId)===t)??null}function qM(e,t,n){let r=KM(e,t,n);return r==null?[-1,-1]:[r,r+1]}function JM(e,t=document){return t instanceof HTMLElement&&t?.dataset?.panelGroupId==e?t:t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`)||null}function YM(e,t=document){return t.querySelector(`[${nM.resizeHandleId}="${e}"]`)||null}function GFe(e,t,n,r=document){let i=YM(t,r),a=GM(e,r),o=i?a.indexOf(i):-1;return[n[o]?.id??null,n[o+1]?.id??null]}function KFe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:a,setLayout:o}){(0,g.useRef)({didWarnAboutMissingResizeHandle:!1}),iM(()=>{if(!a)return;let e=GM(n,a);for(let t=0;t<i.length-1;t++){let{valueMax:n,valueMin:a,valueNow:o}=WFe({layout:r,panelsArray:i,pivotIndices:[t,t+1]}),s=e[t];if(s!=null){let e=i[t];zM(e,`No panel data found for index "${t}"`),s.setAttribute(`aria-controls`,e.id),s.setAttribute(`aria-valuemax`,``+Math.round(n)),s.setAttribute(`aria-valuemin`,``+Math.round(a)),s.setAttribute(`aria-valuenow`,o==null?``:``+Math.round(o))}}return()=>{e.forEach((e,t)=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)})}},[n,r,i,a]),(0,g.useEffect)(()=>{if(!a)return;let e=t.current;zM(e,`Eager values not found`);let{panelDataArray:i}=e;zM(JM(n,a)!=null,`No group found for id "${n}"`);let s=GM(n,a);zM(s,`No resize handles found for group id "${n}"`);let c=s.map(e=>{let t=e.getAttribute(nM.resizeHandleId);zM(t,`Resize handle element has no handle id attribute`);let[s,c]=GFe(n,t,i,a);if(s==null||c==null)return()=>{};let l=e=>{if(!e.defaultPrevented)switch(e.key){case`Enter`:{e.preventDefault();let c=i.findIndex(e=>e.id===s);if(c>=0){let e=i[c];zM(e,`No panel data found for index ${c}`);let s=r[c],{collapsedSize:l=0,collapsible:u,minSize:d=0}=e.constraints;if(s!=null&&u){let e=WM({delta:HM(s,l)?d-l:l-s,initialLayout:r,panelConstraints:i.map(e=>e.constraints),pivotIndices:qM(n,t,a),prevLayout:r,trigger:`keyboard`});r!==e&&o(e)}}break}}};return e.addEventListener(`keydown`,l),()=>{e.removeEventListener(`keydown`,l)}});return()=>{c.forEach(e=>e())}},[a,e,t,n,r,i,o])}function XM(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ZM(e,t){let n=e===`horizontal`,{x:r,y:i}=gM(t);return n?r:i}function qFe(e,t,n,r,i){let a=n===`horizontal`,o=YM(t,i);zM(o,`No resize handle element found for id "${t}"`);let s=o.getAttribute(nM.groupId);zM(s,`Resize handle element has no group id attribute`);let{initialCursorPosition:c}=r,l=ZM(n,e),u=JM(s,i);zM(u,`No group element found for id "${s}"`);let d=u.getBoundingClientRect(),f=a?d.width:d.height;return(l-c)/f*100}function JFe(e,t,n,r,i,a){if(pM(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100;break}return a}else return r==null?0:qFe(e,t,n,r,a)}function YFe({panelDataArray:e}){let t=Array(e.length),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a<e.length;a++){let e=n[a];zM(e,`Panel constraints not found for index ${a}`);let{defaultSize:o}=e;o!=null&&(r++,t[a]=o,i-=o)}for(let a=0;a<e.length;a++){let o=n[a];zM(o,`Panel constraints not found for index ${a}`);let{defaultSize:s}=o;if(s!=null)continue;let c=e.length-r,l=i/c;r++,t[a]=l,i-=l}return t}function QM(e,t,n){t.forEach((t,r)=>{let i=e[r];zM(i,`Panel data not found for index ${r}`);let{callbacks:a,constraints:o,id:s}=i,{collapsedSize:c=0,collapsible:l}=o,u=n[s];if(u==null||t!==u){n[s]=t;let{onCollapse:e,onExpand:r,onResize:i}=a;i&&i(t,u),l&&(e||r)&&(r&&(u==null||VM(u,c))&&!VM(t,c)&&r(),e&&(u==null||!VM(u,c))&&VM(t,c)&&e())}})}function $M(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function XFe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e==null?`1`:e.toPrecision(a):r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function ZFe(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function eN(e){try{if(typeof localStorage<`u`)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error(`localStorage not supported in this environment`)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function tN(e){return`react-resizable-panels:${e}`}function nN(e){return e.map(e=>{let{constraints:t,id:n,idIsFromProps:r,order:i}=e;return r?n:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(`,`)}function rN(e,t){try{let n=tN(e),r=t.getItem(n);if(r){let e=JSON.parse(r);if(typeof e==`object`&&e)return e}}catch{}return null}function QFe(e,t,n){return(rN(e,n)??{})[nN(t)]??null}function $Fe(e,t,n,r,i){let a=tN(e),o=nN(t),s=rN(e,i)??{};s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}function iN({layout:e,panelConstraints:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!HM(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];zM(t!=null,`No layout data found for index ${e}`),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];zM(r!=null,`No layout data found for index ${e}`);let a=UM({panelConstraints:t,panelIndex:e,size:r});r!=a&&(i+=r-a,n[e]=a)}if(!HM(i,0))for(let e=0;e<t.length;e++){let r=n[e];zM(r!=null,`No layout data found for index ${e}`);let a=r+i,o=UM({panelConstraints:t,panelIndex:e,size:a});if(r!==o&&(i-=o-r,n[e]=o,HM(i,0)))break}return n}var eIe=100,aN={getItem:e=>(eN(aN),aN.getItem(e)),setItem:(e,t)=>{eN(aN),aN.setItem(e,t)}},oN={};function sN({autoSaveId:e=null,children:t,className:n=``,direction:r,forwardedRef:i,id:a=null,onLayout:o=null,keyboardResizeBy:s=null,storage:c=aN,style:l,tagName:u=`div`,...d}){let f=oM(a),p=(0,g.useRef)(null),[m,h]=(0,g.useState)(null),[_,v]=(0,g.useState)([]),y=HFe(),b=(0,g.useRef)({}),x=(0,g.useRef)(new Map),S=(0,g.useRef)(0),C=(0,g.useRef)({autoSaveId:e,direction:r,dragState:m,id:f,keyboardResizeBy:s,onLayout:o,storage:c}),w=(0,g.useRef)({layout:_,panelDataArray:[],panelDataArrayChanged:!1});(0,g.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,g.useImperativeHandle)(i,()=>({getId:()=>C.current.id,getLayout:()=>{let{layout:e}=w.current;return e},setLayout:e=>{let{onLayout:t}=C.current,{layout:n,panelDataArray:r}=w.current,i=iN({layout:e,panelConstraints:r.map(e=>e.constraints)});XM(n,i)||(v(i),w.current.layout=i,t&&t(i),QM(r,i,b.current))}}),[]),iM(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=m,C.current.id=f,C.current.onLayout=o,C.current.storage=c}),KFe({committedValuesRef:C,eagerValuesRef:w,groupId:f,layout:_,panelDataArray:w.current.panelDataArray,setLayout:v,panelGroupElement:p.current}),(0,g.useEffect)(()=>{let{panelDataArray:t}=w.current;if(e){if(_.length===0||_.length!==t.length)return;let n=oN[e];n??(n=ZFe($Fe,eIe),oN[e]=n);let r=[...t],i=new Map(x.current);n(e,r,i,_,c)}},[e,_,c]),(0,g.useEffect)(()=>{});let T=(0,g.useCallback)(e=>{let{onLayout:t}=C.current,{layout:n,panelDataArray:r}=w.current;if(e.constraints.collapsible){let i=r.map(e=>e.constraints),{collapsedSize:a=0,panelSize:o,pivotIndices:s}=uN(r,e,n);if(zM(o!=null,`Panel size not found for panel "${e.id}"`),!VM(o,a)){x.current.set(e.id,o);let c=WM({delta:lN(r,e)===r.length-1?o-a:a-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:`imperative-api`});$M(n,c)||(v(c),w.current.layout=c,t&&t(c),QM(r,c,b.current))}}},[]),E=(0,g.useCallback)((e,t)=>{let{onLayout:n}=C.current,{layout:r,panelDataArray:i}=w.current;if(e.constraints.collapsible){let a=i.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:c=0,pivotIndices:l}=uN(i,e,r),u=t??c;if(VM(s,o)){let t=x.current.get(e.id),o=t!=null&&t>=u?t:u,c=WM({delta:lN(i,e)===i.length-1?s-o:o-s,initialLayout:r,panelConstraints:a,pivotIndices:l,prevLayout:r,trigger:`imperative-api`});$M(r,c)||(v(c),w.current.layout=c,n&&n(c),QM(i,c,b.current))}}},[]),D=(0,g.useCallback)(e=>{let{layout:t,panelDataArray:n}=w.current,{panelSize:r}=uN(n,e,t);return zM(r!=null,`Panel size not found for panel "${e.id}"`),r},[]),O=(0,g.useCallback)((e,t)=>{let{panelDataArray:n}=w.current;return XFe({defaultSize:t,dragState:m,layout:_,panelData:n,panelIndex:lN(n,e)})},[m,_]),k=(0,g.useCallback)(e=>{let{layout:t,panelDataArray:n}=w.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=uN(n,e,t);return zM(a!=null,`Panel size not found for panel "${e.id}"`),i===!0&&VM(a,r)},[]),A=(0,g.useCallback)(e=>{let{layout:t,panelDataArray:n}=w.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=uN(n,e,t);return zM(a!=null,`Panel size not found for panel "${e.id}"`),!i||BM(a,r)>0},[]),j=(0,g.useCallback)(e=>{let{panelDataArray:t}=w.current;t.push(e),t.sort((e,t)=>{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),w.current.panelDataArrayChanged=!0,y()},[y]);iM(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;let{autoSaveId:e,onLayout:t,storage:n}=C.current,{layout:r,panelDataArray:i}=w.current,a=null;if(e){let t=QFe(e,i,n);t&&(x.current=new Map(Object.entries(t.expandToSizes)),a=t.layout)}a??=YFe({panelDataArray:i});let o=iN({layout:a,panelConstraints:i.map(e=>e.constraints)});XM(r,o)||(v(o),w.current.layout=o,t&&t(o),QM(i,o,b.current))}}),iM(()=>{let e=w.current;return()=>{e.layout=[]}},[]);let M=(0,g.useCallback)(e=>{let t=!1,n=p.current;return n&&window.getComputedStyle(n,null).getPropertyValue(`direction`)===`rtl`&&(t=!0),function(n){n.preventDefault();let r=p.current;if(!r)return()=>null;let{direction:i,dragState:a,id:o,keyboardResizeBy:s,onLayout:c}=C.current,{layout:l,panelDataArray:u}=w.current,{initialLayout:d}=a??{},f=qM(o,e,r),m=JFe(n,e,i,a,s,r),h=i===`horizontal`;h&&t&&(m=-m);let g=u.map(e=>e.constraints),_=WM({delta:m,initialLayout:d??l,panelConstraints:g,pivotIndices:f,prevLayout:l,trigger:pM(n)?`keyboard`:`mouse-or-touch`}),y=!$M(l,_);(mM(n)||hM(n))&&S.current!=m&&(S.current=m,!y&&m!==0?h?PM(e,m<0?xM:SM):PM(e,m<0?CM:wM):PM(e,0)),y&&(v(_),w.current.layout=_,c&&c(_),QM(u,_,b.current))}},[]),N=(0,g.useCallback)((e,t)=>{let{onLayout:n}=C.current,{layout:r,panelDataArray:i}=w.current,a=i.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=uN(i,e,r);zM(o!=null,`Panel size not found for panel "${e.id}"`);let c=WM({delta:lN(i,e)===i.length-1?o-t:t-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:`imperative-api`});$M(r,c)||(v(c),w.current.layout=c,n&&n(c),QM(i,c,b.current))},[]),P=(0,g.useCallback)((e,t)=>{let{layout:n,panelDataArray:r}=w.current,{collapsedSize:i=0,collapsible:a}=t,{collapsedSize:o=0,collapsible:s,maxSize:c=100,minSize:l=0}=e.constraints,{panelSize:u}=uN(r,e,n);u!=null&&(a&&s&&VM(u,i)?VM(i,o)||N(e,o):u<l?N(e,l):u>c&&N(e,c))},[N]),F=(0,g.useCallback)((e,t)=>{let{direction:n}=C.current,{layout:r}=w.current;if(!p.current)return;let i=YM(e,p.current);zM(i,`Drag handle element not found for id "${e}"`);let a=ZM(n,t);h({dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r})},[]),I=(0,g.useCallback)(()=>{h(null)},[]),L=(0,g.useCallback)(e=>{let{panelDataArray:t}=w.current,n=lN(t,e);n>=0&&(t.splice(n,1),delete b.current[e.id],w.current.panelDataArrayChanged=!0,y())},[y]),R=(0,g.useMemo)(()=>({collapsePanel:T,direction:r,dragState:m,expandPanel:E,getPanelSize:D,getPanelStyle:O,groupId:f,isPanelCollapsed:k,isPanelExpanded:A,reevaluatePanelConstraints:P,registerPanel:j,registerResizeHandle:M,resizePanel:N,startDragging:F,stopDragging:I,unregisterPanel:L,panelGroupElement:p.current}),[T,m,r,E,D,O,f,k,A,P,j,M,N,F,I,L]),z={display:`flex`,flexDirection:r===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`};return(0,g.createElement)(tM.Provider,{value:R},(0,g.createElement)(u,{...d,children:t,className:n,id:a,ref:p,style:{...z,...l},[nM.group]:``,[nM.groupDirection]:r,[nM.groupId]:f}))}var cN=(0,g.forwardRef)((e,t)=>(0,g.createElement)(sN,{...e,forwardedRef:t}));sN.displayName=`PanelGroup`,cN.displayName=`forwardRef(PanelGroup)`;function lN(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function uN(e,t,n){let r=lN(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}function tIe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){(0,g.useEffect)(()=>{if(e||n==null||r==null)return;let i=YM(t,r);if(i==null)return;let a=e=>{if(!e.defaultPrevented)switch(e.key){case`ArrowDown`:case`ArrowLeft`:case`ArrowRight`:case`ArrowUp`:case`End`:case`Home`:e.preventDefault(),n(e);break;case`F6`:{e.preventDefault();let n=i.getAttribute(nM.groupId);zM(n,`No group element found for id "${n}"`);let a=GM(n,r),o=KM(n,t,r);zM(o!==null,`No resize element found for id "${t}"`),a[e.shiftKey?o>0?o-1:a.length-1:o+1<a.length?o+1:0].focus();break}}};return i.addEventListener(`keydown`,a),()=>{i.removeEventListener(`keydown`,a)}},[r,e,t,n])}function dN({children:e=null,className:t=``,disabled:n=!1,hitAreaMargins:r,id:i,onBlur:a,onClick:o,onDragging:s,onFocus:c,onPointerDown:l,onPointerUp:u,style:d={},tabIndex:f=0,tagName:p=`div`,...m}){let h=(0,g.useRef)(null),_=(0,g.useRef)({onClick:o,onDragging:s,onPointerDown:l,onPointerUp:u});(0,g.useEffect)(()=>{_.current.onClick=o,_.current.onDragging=s,_.current.onPointerDown=l,_.current.onPointerUp=u});let v=(0,g.useContext)(tM);if(v===null)throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);let{direction:y,groupId:b,registerResizeHandle:x,startDragging:S,stopDragging:C,panelGroupElement:w}=v,T=oM(i),[E,D]=(0,g.useState)(`inactive`),[O,k]=(0,g.useState)(!1),[A,j]=(0,g.useState)(null),M=(0,g.useRef)({state:E});iM(()=>{M.current.state=E}),(0,g.useEffect)(()=>{if(n)j(null);else{let e=x(T);j(()=>e)}},[n,T,x]);let N=r?.coarse??15,P=r?.fine??5;(0,g.useEffect)(()=>{if(n||A==null)return;let e=h.current;zM(e,`Element ref not attached`);let t=!1;return BFe(T,e,y,{coarse:N,fine:P},(e,n,r)=>{if(!n){D(`inactive`);return}switch(e){case`down`:{D(`drag`),t=!1,zM(r,`Expected event to be defined for "down" action`),S(T,r);let{onDragging:e,onPointerDown:n}=_.current;e?.(!0),n?.();break}case`move`:{let{state:e}=M.current;t=!0,e!==`drag`&&D(`hover`),zM(r,`Expected event to be defined for "move" action`),A(r);break}case`up`:{D(`hover`),C();let{onClick:e,onDragging:n,onPointerUp:r}=_.current;n?.(!1),r?.(),t||e?.();break}}})},[N,y,n,P,x,T,A,S,C]),tIe({disabled:n,handleId:T,resizeHandler:A,panelGroupElement:w});let F={touchAction:`none`,userSelect:`none`};return(0,g.createElement)(p,{...m,children:e,className:t,id:i,onBlur:()=>{k(!1),a?.()},onFocus:()=>{k(!0),c?.()},ref:h,role:`separator`,style:{...F,...d},tabIndex:f,[nM.groupDirection]:y,[nM.groupId]:b,[nM.resizeHandle]:``,[nM.resizeHandleActive]:E===`drag`?`pointer`:O?`keyboard`:void 0,[nM.resizeHandleEnabled]:!n,[nM.resizeHandleId]:T,[nM.resizeHandleState]:E})}dN.displayName=`PanelResizeHandle`;var fN=({className:e,...t})=>(0,W.jsx)(cN,{className:G(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...t}),pN=cM,mN=({withHandle:e,className:t,...n})=>(0,W.jsx)(dN,{className:G(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90`,t),...n,children:e&&(0,W.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border`,children:(0,W.jsx)(zre,{className:`h-2.5 w-2.5`})})});function hN({className:e,...t}){return(0,W.jsx)(`div`,{className:G(`animate-pulse rounded-md bg-primary/10`,e),...t})}var nIe=(0,g.createContext)(null),gN={didCatch:!1,error:null},rIe=class extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=gN}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(gN))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&iIe(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(gN))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,g.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,g.createElement)(nIe.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function iIe(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}var _N=({children:e,fallback:t})=>{let n=Bg();return(0,W.jsx)(rIe,{onError:(e,t)=>{let r={componentStack:t.componentStack};(e instanceof If||e instanceof Lf)&&(r.errorType=e.type,r.errorStatus=e.status,r.errorDetail=e.detail,r.errorInstance=e.instance,r.traceId=e.traceId),n.captureException(e,r)},fallbackRender:({error:e,resetErrorBoundary:n})=>t({error:e,resetError:n}),children:e})},vN=({className:e})=>(0,W.jsxs)(`svg`,{className:e,viewBox:`0 0 86 86`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,children:[(0,W.jsx)(`title`,{children:`open-api-icon`}),(0,W.jsx)(`g`,{id:`Page-1`,stroke:`none`,strokeWidth:`1`,fill:`none`,fillRule:`evenodd`,children:(0,W.jsxs)(`g`,{id:`open-api-icon`,fill:`currentColor`,children:[(0,W.jsx)(`path`,{d:`M35,16 C39.1263484,16 43.0859173,16.7140679 46.7618776,18.0253747 L36.7225172,28.0635294 C36.1538485,28.0214262 35.5794264,28 35,28 C22.2974508,28 12,38.2974508 12,51 C12,63.7025492 22.2974508,74 35,74 C47.7025492,74 58,63.7025492 58,51 C58,50.4205736 57.9785738,49.8461515 57.9364706,49.2774828 L67.9749824,39.2391236 C69.2860617,42.9148016 70,46.8740262 70,51 C70,70.3299662 54.3299662,86 35,86 C15.6700338,86 0,70.3299662 0,51 C0,31.6700338 15.6700338,16 35,16 Z`,id:`Combined-Shape`}),(0,W.jsx)(`circle`,{id:`Oval`,cx:`35`,cy:`51`,r:`13`}),(0,W.jsx)(`circle`,{id:`Oval-Copy`,cx:`73`,cy:`13`,r:`13`}),(0,W.jsx)(`rect`,{id:`Rectangle`,transform:`translate(54.091883, 31.908117) rotate(-45.000000) translate(-54.091883, -31.908117) `,x:`27.0918831`,y:`26.4081169`,width:`54`,height:`11`})]})})]});function yN(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function aIe(e,t=[]){let n=[];function r(t,r){let i=g.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=g.useMemo(()=>o,Object.values(o));return(0,W.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=g.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>g.createContext(e));return function(n){let r=n?.[e]||t;return g.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,oIe(i,...t)]}function oIe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function bN(e,t=[]){let n=[];function r(t,r){let i=g.createContext(r),a=n.length;n=[...n,r];function o(t){let{scope:n,children:r,...o}=t,s=n?.[e][a]||i,c=g.useMemo(()=>o,Object.values(o));return(0,W.jsx)(s.Provider,{value:c,children:r})}function s(n,o){let s=o?.[e][a]||i,c=g.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return o.displayName=t+`Provider`,[o,s]}let i=()=>{let t=n.map(e=>g.createContext(e));return function(n){let r=n?.[e]||t;return g.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,sIe(i,...t)]}function sIe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function cIe(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function xN(...e){return t=>e.forEach(e=>cIe(e,t))}function SN(...e){return g.useCallback(xN(...e),e)}var CN=g.forwardRef((e,t)=>{let{children:n,...r}=e,i=g.Children.toArray(n),a=i.find(uIe);if(a){let e=a.props.children,n=i.map(t=>t===a?g.Children.count(e)>1?g.Children.only(null):g.isValidElement(e)?e.props.children:null:t);return(0,W.jsx)(wN,{...r,ref:t,children:g.isValidElement(e)?g.cloneElement(e,void 0,n):null})}return(0,W.jsx)(wN,{...r,ref:t,children:n})});CN.displayName=`Slot`;var wN=g.forwardRef((e,t)=>{let{children:n,...r}=e;if(g.isValidElement(n)){let e=fIe(n);return g.cloneElement(n,{...dIe(r,n.props),ref:t?xN(t,e):e})}return g.Children.count(n)>1?g.Children.only(null):null});wN.displayName=`SlotClone`;var lIe=({children:e})=>(0,W.jsx)(W.Fragment,{children:e});function uIe(e){return g.isValidElement(e)&&e.type===lIe}function dIe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{a(...e),i(...e)}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function fIe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function pIe(e){let t=e+`CollectionProvider`,[n,r]=bN(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=g.useRef(null),a=g.useRef(new Map).current;return(0,W.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=g.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,W.jsx)(CN,{ref:SN(t,a(s,n).collectionRef),children:r})});c.displayName=s;let l=e+`CollectionItemSlot`,u=`data-radix-collection-item`,d=g.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=g.useRef(null),s=SN(t,o),c=a(l,n);return g.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,W.jsx)(CN,{[u]:``,ref:s,children:r})});d.displayName=l;function f(t){let n=a(e+`CollectionConsumer`,t);return g.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${u}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:c,ItemSlot:d},f,r]}var TN=globalThis?.document?g.useLayoutEffect:()=>{},mIe=g.useId||(()=>void 0),hIe=0;function EN(e){let[t,n]=g.useState(mIe());return TN(()=>{e||n(e=>e??String(hIe++))},[e]),e||(t?`radix-${t}`:``)}var DN=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=g.forwardRef((e,n)=>{let{asChild:r,...i}=e,a=r?CN:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,W.jsx)(a,{...i,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ON(e){let t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...e)=>t.current?.(...e),[])}function kN({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=gIe({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=ON(n);return[o,g.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function gIe({defaultProp:e,onChange:t}){let n=g.useState(e),[r]=n,i=g.useRef(r),a=ON(t);return g.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var _Ie=g.createContext(void 0);function AN(e){let t=g.useContext(_Ie);return e||t||`ltr`}var jN=`rovingFocusGroup.onEntryFocus`,vIe={bubbles:!1,cancelable:!0},MN=`RovingFocusGroup`,[NN,PN,yIe]=pIe(MN),[bIe,FN]=bN(MN,[yIe]),[xIe,SIe]=bIe(MN),IN=g.forwardRef((e,t)=>(0,W.jsx)(NN.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(NN.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(CIe,{...e,ref:t})})}));IN.displayName=MN;var CIe=g.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=g.useRef(null),p=SN(t,f),m=AN(a),[h=null,_]=kN({prop:o,defaultProp:s,onChange:c}),[v,y]=g.useState(!1),b=ON(l),x=PN(n),S=g.useRef(!1),[C,w]=g.useState(0);return g.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(jN,b),()=>e.removeEventListener(jN,b)},[b]),(0,W.jsx)(xIe,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:g.useCallback(e=>_(e),[_]),onItemShiftTab:g.useCallback(()=>y(!0),[]),onFocusableItemAdd:g.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:g.useCallback(()=>w(e=>e-1),[]),children:(0,W.jsx)(DN.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:yN(e.onMouseDown,()=>{S.current=!0}),onFocus:yN(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(jN,vIe);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);zN([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:yN(e.onBlur,()=>y(!1))})})}),LN=`RovingFocusGroupItem`,RN=g.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...o}=e,s=EN(),c=a||s,l=SIe(LN,n),u=l.currentTabStopId===c,d=PN(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=l;return g.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),(0,W.jsx)(NN.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:(0,W.jsx)(DN.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...o,ref:t,onMouseDown:yN(e.onMouseDown,e=>{r?l.onItemFocus(c):e.preventDefault()}),onFocus:yN(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:yN(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){l.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=EIe(e,l.orientation,l.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=d().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=l.loop?DIe(n,r+1):n.slice(r+1)}setTimeout(()=>zN(n))}})})})});RN.displayName=LN;var wIe={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function TIe(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function EIe(e,t,n){let r=TIe(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return wIe[r]}function zN(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function DIe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OIe=IN,kIe=RN;function AIe(e,t){return g.useReducer((e,n)=>t[e][n]??e,e)}var BN=e=>{let{present:t,children:n}=e,r=jIe(t),i=typeof n==`function`?n({present:r.isPresent}):g.Children.only(n),a=SN(r.ref,MIe(i));return typeof n==`function`||r.isPresent?g.cloneElement(i,{ref:a}):null};BN.displayName=`Presence`;function jIe(e){let[t,n]=g.useState(),r=g.useRef({}),i=g.useRef(e),a=g.useRef(`none`),[o,s]=AIe(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return g.useEffect(()=>{let e=VN(r.current);a.current=o===`mounted`?e:`none`},[o]),TN(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=VN(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),TN(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=VN(r.current).includes(a.animationName);if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=VN(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:g.useCallback(e=>{e&&(r.current=getComputedStyle(e)),n(e)},[])}}function VN(e){return e?.animationName||`none`}function MIe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var HN=`Tabs`,[NIe,PIe]=aIe(HN,[FN]),UN=FN(),[FIe,WN]=NIe(HN),GN=g.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=AN(s),[d,f]=kN({prop:r,onChange:i,defaultProp:a});return(0,W.jsx)(FIe,{scope:n,baseId:EN(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,W.jsx)(DN.div,{dir:u,"data-orientation":o,...l,ref:t})})});GN.displayName=HN;var KN=`TabsList`,qN=g.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=WN(KN,n),o=UN(n);return(0,W.jsx)(OIe,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,W.jsx)(DN.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});qN.displayName=KN;var JN=`TabsTrigger`,YN=g.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=WN(JN,n),s=UN(n),c=QN(o.baseId,r),l=$N(o.baseId,r),u=r===o.value;return(0,W.jsx)(kIe,{asChild:!0,...s,focusable:!i,active:u,children:(0,W.jsx)(DN.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:yN(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:yN(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:yN(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});YN.displayName=JN;var XN=`TabsContent`,ZN=g.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=WN(XN,n),c=QN(s.baseId,r),l=$N(s.baseId,r),u=r===s.value,d=g.useRef(u);return g.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,W.jsx)(BN,{present:i||u,children:({present:n})=>(0,W.jsx)(DN.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});ZN.displayName=XN;function QN(e,t){return`${e}-trigger-${t}`}function $N(e,t){return`${e}-content-${t}`}var eP=GN,tP=qN,nP=YN,rP=ZN,iP=eP,IIe=um(`inline-flex items-center justify-center rounded-md bg-muted text-muted-foreground`,{variants:{variant:{default:``,underline:`w-full justify-start gap-6 rounded-none border-b border-border bg-transparent`},size:{sm:`h-8 px-1 py-1`,default:`h-10 p-1`}},compoundVariants:[{variant:`underline`,className:`h-auto p-0`}],defaultVariants:{variant:`default`,size:`default`}}),LIe=um(`inline-flex items-center justify-center whitespace-nowrap rounded-xs font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-xs text-sm`,{variants:{variant:{default:``,underline:`gap-1.5 border-b-2 border-transparent text-muted-foreground hover:text-foreground data-[state=active]:border-brand data-[state=active]:bg-transparent data-[state=active]:text-brand data-[state=active]:shadow-none`},size:{sm:`px-2 py-0.5 rounded-sm`,default:`px-3 py-1.5`}},compoundVariants:[{variant:`underline`,className:`rounded-none px-1 py-2`}],defaultVariants:{variant:`default`,size:`default`}}),aP=g.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,W.jsx)(tP,{ref:i,className:G(IIe({variant:t,size:n}),e),...r}));aP.displayName=tP.displayName;var oP=g.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,W.jsx)(nP,{ref:i,className:G(LIe({variant:t,size:n}),e),...r}));oP.displayName=nP.displayName;var sP=g.forwardRef(({className:e,...t},n)=>(0,W.jsx)(rP,{ref:n,className:G(`data-[state=inactive]:hidden`,`mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));sP.displayName=rP.displayName;var RIe=[`@zuplo/runtime`,`@zuplo/graphql`,`@zuplo/otel`],cP=[{name:`@zuplo/test`,version:`0.0.0`,types:`types/@zuplo/test/latest/types.d.ts`},{name:`chai`,version:`0.0.0`,types:`types/@types/chai/latest/index.d.ts`},{name:`openapi-types`,version:`0.0.0`,types:`types/openapi-types/latest/index.d.ts`}],zIe=[{types:`types/@zuplo/runtime/types/environment.d.ts`,name:`@app/environment`},{types:`types/@zuplo/runtime/types/custom.d.ts`,name:`lib.custom.ts`},{types:`types/@zuplo/runtime/latest/global.d.ts`,name:`global.d.ts`}];async function BIe(){try{return await(await fetch(`https://cdn.zuplo.com/types/remote-modules.d.ts`)).text()}catch(e){Ef.captureException(e)}}async function VIe(e,t){try{let n=await fetch(`${Hf}/types/${e}/${t}/package.json`);if(!n.ok)throw Error(`Error loading package.json for ${e}`);return await n.json()}catch(e){Ef.captureException(e)}}async function HIe(){try{let e=await fetch(`${Hf}/types/@zuplo/bundled/bundles.json`);if(!e.ok)throw Error(`Error loading bundles from CDN`);let t=await e.json();return[...cP,...t.bundles]}catch(e){Ef.captureException(e)}return[...cP]}async function lP(e){try{let t=await fetch(`${Hf}/${e}`);if(!t.ok)throw Error(`Error loading type definition: ${e}`);return await t.text()}catch(e){Ef.captureException(e)}}var uP=async(e,t,n)=>{let r=`https://cdn.jsdelivr.net/npm/${e}@${t}${n}`,i=await fetch(r);return i.ok?i.text():Error(`OK`)};async function UIe(e){await Promise.all(RIe.map(async t=>{let n=await VIe(t,`latest`);n&&(e.typescript.typescriptDefaults.addExtraLib(JSON.stringify(n),`file:///node_modules/${t}/package.json`),await Promise.all(Object.entries(n.exports).map(async([n,r])=>{let i=await lP(`types/${t}/latest/${r.types.substring(2)}`);if(i){let r=n===`.`?`index.d.ts`:`${n}.d.ts`;e.typescript.typescriptDefaults.addExtraLib(i,`file:///node_modules/${t}/${r}`)}})))}))}async function dP(e){let t=Object.keys(e.typescript.typescriptDefaults.getExtraLibs()),n=await HIe();await Promise.allSettled([...zIe.map(async({types:t,name:n})=>{let r=await lP(t);r&&e.typescript.typescriptDefaults.addExtraLib(r,n)}),...n.map(async n=>{if(t.includes(n.name))return;let r={name:n.name,version:n.version,types:`./index.d.ts`},i=await lP(n.types);i&&(e.typescript.typescriptDefaults.addExtraLib(JSON.stringify(r),`file:///node_modules/${n.name}/package.json`),e.typescript.typescriptDefaults.addExtraLib(i,`file:///node_modules/${n.name}/index.d.ts`))})])}var fP=null,WIe=`
|
|
97
97
|
declare module "@zuplo/zudoku-plugin-monetization" {
|
|
98
98
|
export interface ZuploMonetizationPluginOptions {
|
|
99
99
|
pricing?: {
|
|
@@ -1648,21 +1648,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1648
1648
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OKt(e,t){if(e){if(typeof e==`string`)return kKt(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 kKt(e,t)}}function kKt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function AKt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function jKt(e){if(Array.isArray(e))return e}function I5(){return I5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I5.apply(this,arguments)}var MKt=function(e,t){return g.isValidElement(e)?g.cloneElement(e,t):(0,Z0.default)(e)?e(t):g.createElement(`line`,I5({},t,{className:`recharts-reference-line-line`}))},NKt=function(e,t,n,r,i,a,o,s,c){var l=i.x,u=i.y,d=i.width,f=i.height;if(n){var p=c.y,m=e.y.apply(p,{position:a});if(D5(c,`discard`)&&!e.y.isInRange(m))return null;var h=[{x:l+d,y:m},{x:l,y:m}];return s===`left`?h.reverse():h}if(t){var g=c.x,_=e.x.apply(g,{position:a});if(D5(c,`discard`)&&!e.x.isInRange(_))return null;var v=[{x:_,y:u+f},{x:_,y:u}];return o===`top`?v.reverse():v}if(r){var y=c.segment.map(function(t){return e.apply(t,{position:a})});return D5(c,`discard`)&&(0,pKt.default)(y,function(t){return!e.isInRange(t)})?null:y}return null};function PKt(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,s=e.className,c=e.alwaysShow,l=lKt(),u=uKt(i),d=dKt(a),f=fKt();if(!l||!f)return null;l2(c===void 0,`The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.`);var p=NKt(j5({x:u.scale,y:d.scale}),z0(t),z0(n),r&&r.length===2,f,e.position,u.orientation,d.orientation,e);if(!p)return null;var m=EKt(p,2),h=m[0],_=h.x,v=h.y,y=m[1],b=y.x,x=y.y,S=CKt(CKt({clipPath:D5(e,`hidden`)?`url(#${l})`:void 0},r2(e,!0)),{},{x1:_,y1:v,x2:b,y2:x});return g.createElement(c2,{className:Gp(`recharts-reference-line`,s)},MKt(o,S),G6.renderCallByParent(e,JGt({x1:_,y1:v,x2:b,y2:x})))}var L5=function(e){function t(){return mKt(this,t),_Kt(this,t,arguments)}return xKt(t,e),gKt(t,[{key:`render`,value:function(){return g.createElement(PKt,this.props)}}])}(g.Component);F5(L5,`displayName`,`ReferenceLine`),F5(L5,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,fill:`none`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1,position:`middle`});function R5(){return R5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R5.apply(this,arguments)}function z5(e){"@babel/helpers - typeof";return z5=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},z5(e)}function FKt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IKt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?FKt(Object(n),!0).forEach(function(t){H5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FKt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LKt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function RKt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,GKt(r.key),r)}}function zKt(e,t,n){return t&&RKt(e.prototype,t),n&&RKt(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function BKt(e,t,n){return t=B5(t),VKt(e,UKt()?Reflect.construct(t,n||[],B5(e).constructor):t.apply(e,n))}function VKt(e,t){if(t&&(z5(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return HKt(e)}function HKt(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function UKt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UKt=function(){return!!e})()}function B5(e){return B5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},B5(e)}function WKt(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&V5(e,t)}function V5(e,t){return V5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},V5(e,t)}function H5(e,t,n){return t=GKt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GKt(e){var t=KKt(e,`string`);return z5(t)==`symbol`?t:t+``}function KKt(e,t){if(z5(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(z5(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var qKt=function(e){var t=e.x,n=e.y,r=e.xAxis,i=e.yAxis,a=j5({x:r.scale,y:i.scale}),o=a.apply({x:t,y:n},{bandAware:!0});return D5(e,`discard`)&&!a.isInRange(o)?null:o},U5=function(e){function t(){return LKt(this,t),BKt(this,t,arguments)}return WKt(t,e),zKt(t,[{key:`render`,value:function(){var e=this.props,n=e.x,r=e.y,i=e.r,a=e.alwaysShow,o=e.clipPathId,s=z0(n),c=z0(r);if(l2(a===void 0,`The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.`),!s||!c)return null;var l=qKt(this.props);if(!l)return null;var u=l.x,d=l.y,f=this.props,p=f.shape,m=f.className,h=IKt(IKt({clipPath:D5(this.props,`hidden`)?`url(#${o})`:void 0},r2(this.props,!0)),{},{cx:u,cy:d});return g.createElement(c2,{className:Gp(`recharts-reference-dot`,m)},t.renderDot(p,h),G6.renderCallByParent(this.props,{x:u-i,y:d-i,width:2*i,height:2*i}))}}])}(g.Component);H5(U5,`displayName`,`ReferenceDot`),H5(U5,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#fff`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1}),H5(U5,`renderDot`,function(e,t){return g.isValidElement(e)?g.cloneElement(e,t):(0,Z0.default)(e)?e(t):g.createElement(B8,R5({},t,{cx:t.cx,cy:t.cy,className:`recharts-reference-dot-dot`}))});function W5(){return W5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W5.apply(this,arguments)}function G5(e){"@babel/helpers - typeof";return G5=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},G5(e)}function JKt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YKt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?JKt(Object(n),!0).forEach(function(t){J5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JKt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function XKt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ZKt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,iqt(r.key),r)}}function QKt(e,t,n){return t&&ZKt(e.prototype,t),n&&ZKt(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function $Kt(e,t,n){return t=K5(t),eqt(e,nqt()?Reflect.construct(t,n||[],K5(e).constructor):t.apply(e,n))}function eqt(e,t){if(t&&(G5(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return tqt(e)}function tqt(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function nqt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nqt=function(){return!!e})()}function K5(e){return K5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},K5(e)}function rqt(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&q5(e,t)}function q5(e,t){return q5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},q5(e,t)}function J5(e,t,n){return t=iqt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iqt(e){var t=aqt(e,`string`);return G5(t)==`symbol`?t:t+``}function aqt(e,t){if(G5(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(G5(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var oqt=function(e,t,n,r,i){var a=i.x1,o=i.x2,s=i.y1,c=i.y2,l=i.xAxis,u=i.yAxis;if(!l||!u)return null;var d=j5({x:l.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:`start`}):d.x.rangeMin,y:n?d.y.apply(s,{position:`start`}):d.y.rangeMin},p={x:t?d.x.apply(o,{position:`end`}):d.x.rangeMax,y:r?d.y.apply(c,{position:`end`}):d.y.rangeMax};return D5(i,`discard`)&&(!d.isInRange(f)||!d.isInRange(p))?null:qGt(f,p)},Y5=function(e){function t(){return XKt(this,t),$Kt(this,t,arguments)}return rqt(t,e),QKt(t,[{key:`render`,value:function(){var e=this.props,n=e.x1,r=e.x2,i=e.y1,a=e.y2,o=e.className,s=e.alwaysShow,c=e.clipPathId;l2(s===void 0,`The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.`);var l=z0(n),u=z0(r),d=z0(i),f=z0(a),p=this.props.shape;if(!l&&!u&&!d&&!f&&!p)return null;var m=oqt(l,u,d,f,this.props);if(!m&&!p)return null;var h=D5(this.props,`hidden`)?`url(#${c})`:void 0;return g.createElement(c2,{className:Gp(`recharts-reference-area`,o)},t.renderRect(p,YKt(YKt({clipPath:h},r2(this.props,!0)),m)),G6.renderCallByParent(this.props,m))}}])}(g.Component);J5(Y5,`displayName`,`ReferenceArea`),J5(Y5,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#ccc`,fillOpacity:.5,stroke:`none`,strokeWidth:1}),J5(Y5,`renderRect`,function(e,t){return g.isValidElement(e)?g.cloneElement(e,t):(0,Z0.default)(e)?e(t):g.createElement(F8,W5({},t,{className:`recharts-reference-area-rect`}))});function sqt(e){return dqt(e)||uqt(e)||lqt(e)||cqt()}function cqt(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1649
1649
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lqt(e,t){if(e){if(typeof e==`string`)return X5(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 X5(e,t)}}function uqt(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function dqt(e){if(Array.isArray(e))return X5(e)}function X5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Z5=function(e,t,n,r,i){var a=t2(e,L5),o=t2(e,U5),s=[].concat(sqt(a),sqt(o)),c=t2(e,Y5),l=`${r}Id`,u=r[0],d=t;if(s.length&&(d=s.reduce(function(e,t){if(t.props[l]===n&&D5(t.props,`extendDomain`)&&R0(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),c.length){var f=`${u}1`,p=`${u}2`;d=c.reduce(function(e,t){if(t.props[l]===n&&D5(t.props,`extendDomain`)&&R0(t.props[f])&&R0(t.props[p])){var r=t.props[f],i=t.props[p];return[Math.min(e[0],r,i),Math.max(e[1],r,i)]}return e},d)}return i&&i.length&&(d=i.reduce(function(e,t){return R0(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},Q5=new(e(i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))())).default,$5=`recharts.syncMouseEvents`;function e7(e){"@babel/helpers - typeof";return e7=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e7(e)}function fqt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function pqt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,hqt(r.key),r)}}function mqt(e,t,n){return t&&pqt(e.prototype,t),n&&pqt(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function t7(e,t,n){return t=hqt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hqt(e){var t=gqt(e,`string`);return e7(t)==`symbol`?t:t+``}function gqt(e,t){if(e7(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(e7(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var _qt=function(){function e(){fqt(this,e),t7(this,`activeIndex`,0),t7(this,`coordinateList`,[]),t7(this,`layout`,`horizontal`)}return mqt(e,[{key:`setDetails`,value:function(e){var t=e.coordinateList,n=t===void 0?null:t,r=e.container,i=r===void 0?null:r,a=e.layout,o=a===void 0?null:a,s=e.offset,c=s===void 0?null:s,l=e.mouseHandlerCallback,u=l===void 0?null:l;this.coordinateList=n??this.coordinateList??[],this.container=i??this.container,this.layout=o??this.layout,this.offset=c??this.offset,this.mouseHandlerCallback=u??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:`focus`,value:function(){this.spoofMouse()}},{key:`keyboardEvent`,value:function(e){if(this.coordinateList.length!==0)switch(e.key){case`ArrowRight`:if(this.layout!==`horizontal`)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case`ArrowLeft`:if(this.layout!==`horizontal`)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break;default:break}}},{key:`setIndex`,value:function(e){this.activeIndex=e}},{key:`spoofMouse`,value:function(){if(this.layout===`horizontal`&&this.coordinateList.length!==0){var e=this.container.getBoundingClientRect(),t=e.x,n=e.y,r=e.height,i=this.coordinateList[this.activeIndex].coordinate,a=window?.scrollX||0,o=window?.scrollY||0,s=t+i+a,c=n+this.offset.top+r/2+o;this.mouseHandlerCallback({pageX:s,pageY:c})}}}])}();function vqt(e,t,n){if(n===`number`&&t===!0&&Array.isArray(e)){var r=e?.[0],i=e?.[1];if(r&&i&&R0(r)&&R0(i))return!0}return!1}function yqt(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function bqt(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[B6(t,n,r,i),B6(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function xqt(e,t,n){var r,i,a,o;if(e===`horizontal`)r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e===`vertical`)i=t.y,o=i,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e===`centric`){var s=t.cx,c=t.cy,l=t.innerRadius,u=t.outerRadius,d=t.angle,f=B6(s,c,l,d),p=B6(s,c,u,d);r=f.x,i=f.y,a=p.x,o=p.y}else return bqt(t);return[{x:r,y:i},{x:a,y:o}]}function n7(e){"@babel/helpers - typeof";return n7=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n7(e)}function Sqt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Sqt(Object(n),!0).forEach(function(t){Cqt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sqt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Cqt(e,t,n){return t=wqt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wqt(e){var t=Tqt(e,`string`);return n7(t)==`symbol`?t:t+``}function Tqt(e,t){if(n7(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(n7(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Eqt(e){var t=e.element,n=e.tooltipEventType,r=e.isActive,i=e.activeCoordinate,a=e.activePayload,o=e.offset,s=e.activeTooltipIndex,c=e.tooltipAxisBandSize,l=e.layout,u=e.chartName,d=t.props.cursor??t.type.defaultProps?.cursor;if(!t||!d||!r||!i||u!==`ScatterChart`&&n!==`axis`)return null;var f,p=i8;if(u===`ScatterChart`)f=i,p=PUt;else if(u===`BarChart`)f=yqt(l,i,o,c),p=F8;else if(l===`radial`){var m=bqt(i),h=m.cx,_=m.cy,v=m.radius;f={cx:h,cy:_,startAngle:m.startAngle,endAngle:m.endAngle,innerRadius:v,outerRadius:v},p=BBt}else f={points:xqt(l,i,o)},p=i8;var y=r7(r7(r7(r7({stroke:`#ccc`,pointerEvents:`none`},o),f),r2(d,!1)),{},{payload:a,payloadIndex:s,className:Gp(`recharts-tooltip-cursor`,d.className)});return(0,g.isValidElement)(d)?(0,g.cloneElement)(d,y):(0,g.createElement)(p,y)}var Dqt=e(INt()),Oqt=[`item`],kqt=[`children`,`className`,`width`,`height`,`style`,`compact`,`title`,`desc`];function i7(e){"@babel/helpers - typeof";return i7=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i7(e)}function a7(){return a7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a7.apply(this,arguments)}function Aqt(e,t){return Nqt(e)||Mqt(e,t)||Gqt(e,t)||jqt()}function jqt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1650
1650
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mqt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Nqt(e){if(Array.isArray(e))return e}function Pqt(e,t){if(e==null)return{};var n=Fqt(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fqt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Iqt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Lqt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Yqt(r.key),r)}}function Rqt(e,t,n){return t&&Lqt(e.prototype,t),n&&Lqt(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function zqt(e,t,n){return t=o7(t),Bqt(e,Hqt()?Reflect.construct(t,n||[],o7(e).constructor):t.apply(e,n))}function Bqt(e,t){if(t&&(i7(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Vqt(e)}function Vqt(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Hqt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hqt=function(){return!!e})()}function o7(e){return o7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o7(e)}function Uqt(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&s7(e,t)}function s7(e,t){return s7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s7(e,t)}function c7(e){return qqt(e)||Kqt(e)||Gqt(e)||Wqt()}function Wqt(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1651
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gqt(e,t){if(e){if(typeof e==`string`)return l7(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 l7(e,t)}}function Kqt(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function qqt(e){if(Array.isArray(e))return l7(e)}function l7(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Jqt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Jqt(Object(n),!0).forEach(function(t){u7(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jqt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u7(e,t,n){return t=Yqt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yqt(e){var t=Xqt(e,`string`);return i7(t)==`symbol`?t:t+``}function Xqt(e,t){if(i7(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i7(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Zqt={xAxis:[`bottom`,`top`],yAxis:[`left`,`right`]},Qqt={width:`100%`,height:`100%`},$qt={x:0,y:0};function d7(e){return e}var eJt=function(e,t){return t===`horizontal`?e.x:t===`vertical`?e.y:t===`centric`?e.angle:e.radius},tJt=function(e,t,n,r){var i=t.find(function(e){return e&&e.index===n});if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.y};if(e===`vertical`)return{x:r.x,y:i.coordinate};if(e===`centric`){var a=i.coordinate,o=r.radius;return Q(Q(Q({},r),B6(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return Q(Q(Q({},r),B6(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return $qt},f7=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,i=t.dataEndIndex,a=(n??[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(c7(e),c7(n)):e},[]);return a.length>0?a:e&&e.length&&R0(r)&&R0(i)?e.slice(r,i+1):[]};function nJt(e){return e===`number`?[0,`auto`]:void 0}var p7=function(e,t,n,r){var i=e.graphicalItems,a=e.tooltipAxis,o=f7(t,e);return n<0||!i||!i.length||n>=o.length?null:i.reduce(function(i,s){var c=s.props.data??t;c&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(c=c.slice(e.dataStartIndex,e.dataEndIndex+1));var l=a.dataKey&&!a.allowDuplicatedCategory?U0(c===void 0?o:c,a.dataKey,r):c&&c[n]||o[n];return l?[].concat(c7(i),[Dzt(s,l)]):i},[])},rJt=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},a=eJt(i,n),o=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,l=azt(a,o,c,s);if(l>=0&&c){var u=c[l]&&c[l].value;return{activeTooltipIndex:l,activeLabel:u,activePayload:p7(e,t,l,u),activeCoordinate:tJt(n,o,l,i)}}return null},iJt=function(e,t){var n=t.axes,r=t.graphicalItems,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=e.stackOffset,f=pzt(l,i);return n.reduce(function(t,n){var p=n.type.defaultProps===void 0?n.props:Q(Q({},n.type.defaultProps),n.props),m=p.type,h=p.dataKey,g=p.allowDataOverflow,_=p.allowDuplicatedCategory,v=p.scale,y=p.ticks,b=p.includeHidden,x=p[a];if(t[x])return t;var S=f7(e.data,{graphicalItems:r.filter(function(e){return(a in e.props?e.props[a]:e.type.defaultProps?.[a])===x}),dataStartIndex:s,dataEndIndex:c}),C=S.length,w,T,E;vqt(p.domain,g,m)&&(w=F6(p.domain,null,g),f&&(m===`number`||v!==`auto`)&&(E=A6(S,h,`category`)));var D=nJt(m);if(!w||w.length===0){var O=p.domain??D;if(h){if(w=A6(S,h,m),m===`category`&&f){var k=zOt(w);_&&k?(T=w,w=(0,y5.default)(0,C)):_||(w=Ezt(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(c7(e),[t])},[]))}else if(m===`category`)w=_?w.filter(function(e){return e!==``&&!(0,X0.default)(e)}):Ezt(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0||t===``||(0,X0.default)(t)?e:[].concat(c7(e),[t])},[]);else if(m===`number`){var A=dzt(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===x&&(b||!n)}),h,i,l);A&&(w=A)}f&&(m===`number`||v!==`auto`)&&(E=A6(S,h,`category`))}else w=f?(0,y5.default)(0,C):o&&o[x]&&o[x].hasStack&&m===`number`?d===`expand`?[0,1]:Czt(o[x].stackGroups,s,c):fzt(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps.hide;return t===x&&(b||!n)}),m,l,!0);if(m===`number`)w=Z5(u,w,x,i,y),O&&(w=F6(O,w,g));else if(m===`category`&&O){var j=O;w.every(function(e){return j.indexOf(e)>=0})&&(w=j)}}return Q(Q({},t),{},u7({},x,Q(Q({},p),{},{axisType:i,domain:w,categoricalDomain:E,duplicateDomain:T,originalDomain:p.domain??D,isCategorical:f,layout:l})))},{})},aJt=function(e,t){var n=t.graphicalItems,r=t.Axis,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=f7(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:c}),f=d.length,p=pzt(l,i),m=-1;return n.reduce(function(e,t){var h=(t.type.defaultProps===void 0?t.props:Q(Q({},t.type.defaultProps),t.props))[a],g=nJt(`number`);if(!e[h]){m++;var _;return p?_=(0,y5.default)(0,f):o&&o[h]&&o[h].hasStack?(_=Czt(o[h].stackGroups,s,c),_=Z5(u,_,h,i)):(_=F6(g,fzt(d,n.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===h&&!n}),`number`,l),r.defaultProps.allowDataOverflow),_=Z5(u,_,h,i)),Q(Q({},e),{},u7({},h,Q(Q({axisType:i},r.defaultProps),{},{hide:!0,orientation:(0,F0.default)(Zqt,`${i}.${m%2}`,null),domain:_,originalDomain:g,isCategorical:p,layout:l})))}return e},{})},oJt=function(e,t){var n=t.axisType,r=n===void 0?`xAxis`:n,i=t.AxisComp,a=t.graphicalItems,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.children,u=`${r}Id`,d=t2(l,i),f={};return d&&d.length?f=iJt(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(f=aJt(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c})),f},sJt=function(e){var t=H0(e),n=M6(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:(0,l4.default)(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:I6(t,n)}},cJt=function(e){var t=e.children,n=e.defaultShowTooltip,r=n2(t,E5),i=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},lJt=function(e){return!e||!e.length?!1:e.some(function(e){var t=Q0(e&&e.type);return t&&t.indexOf(`Bar`)>=0})},uJt=function(e){return e===`horizontal`?{numericAxisName:`yAxis`,cateAxisName:`xAxis`}:e===`vertical`?{numericAxisName:`xAxis`,cateAxisName:`yAxis`}:e===`centric`?{numericAxisName:`radiusAxis`,cateAxisName:`angleAxis`}:{numericAxisName:`angleAxis`,cateAxisName:`radiusAxis`}},dJt=function(e,t){var n=e.props,r=e.graphicalItems,i=e.xAxisMap,a=i===void 0?{}:i,o=e.yAxisMap,s=o===void 0?{}:o,c=n.width,l=n.height,u=n.children,d=n.margin||{},f=n2(u,E5),p=n2(u,o4),m=Object.keys(s).reduce(function(e,t){var n=s[t],r=n.orientation;return!n.mirror&&!n.hide?Q(Q({},e),{},u7({},r,e[r]+n.width)):e},{left:d.left||0,right:d.right||0}),h=Q(Q({},Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return!n.mirror&&!n.hide?Q(Q({},e),{},u7({},r,(0,F0.default)(e,`${r}`)+n.height)):e},{top:d.top||0,bottom:d.bottom||0})),m),g=h.bottom;f&&(h.bottom+=f.props.height||E5.defaultProps.height),p&&t&&(h=czt(h,r,n,t));var _=c-h.left-h.right,v=l-h.top-h.bottom;return Q(Q({brushBottom:g},h),{},{width:Math.max(_,0),height:Math.max(v,0)})},fJt=function(e,t){if(t===`xAxis`)return e[t].width;if(t===`yAxis`)return e[t].height},pJt=function(e){var t=e.chartName,n=e.GraphicalChild,r=e.defaultTooltipEventType,i=r===void 0?`axis`:r,a=e.validateTooltipEventTypes,o=a===void 0?[`axis`]:a,s=e.axisComponents,c=e.legendContent,l=e.formatAxisMap,u=e.defaultProps,d=function(e,t){var n=t.graphicalItems,r=t.stackGroups,i=t.offset,a=t.updateId,o=t.dataStartIndex,c=t.dataEndIndex,l=e.barSize,u=e.layout,d=e.barGap,f=e.barCategoryGap,p=e.maxBarSize,m=uJt(u),h=m.numericAxisName,g=m.cateAxisName,_=lJt(n),v=[];return n.forEach(function(n,m){var y=f7(e.data,{graphicalItems:[n],dataStartIndex:o,dataEndIndex:c}),b=n.type.defaultProps===void 0?n.props:Q(Q({},n.type.defaultProps),n.props),x=b.dataKey,S=b.maxBarSize,C=b[`${h}Id`],w=b[`${g}Id`],T=s.reduce(function(e,n){var r=t[`${n.axisType}Map`],i=b[`${n.axisType}Id`];!(r&&r[i]||n.axisType===`zAxis`)&&m6(!1);var a=r[i];return Q(Q({},e),{},u7(u7({},n.axisType,a),`${n.axisType}Ticks`,M6(a)))},{}),E=T[g],D=T[`${g}Ticks`],O=r&&r[C]&&r[C].hasStack&&xzt(n,r[C].stackGroups),k=Q0(n.type).indexOf(`Bar`)>=0,A=I6(E,D),j=[],M=_&&ozt({barSize:l,stackGroups:r,totalSize:fJt(T,g)});if(k){var N=(0,X0.default)(S)?p:S,P=I6(E,D,!0)??N??0;j=szt({barGap:d,barCategoryGap:f,bandSize:P===A?A:P,sizeList:M[w],maxBarSize:N}),P!==A&&(j=j.map(function(e){return Q(Q({},e),{},{position:Q(Q({},e.position),{},{offset:e.position.offset-P/2})})}))}var F=n&&n.type&&n.type.getComposedData;F&&v.push({props:Q(Q({},F(Q(Q({},T),{},{displayedData:y,props:e,dataKey:x,item:n,bandSize:A,barPosition:j,offset:i,stackedData:O,layout:u,dataStartIndex:o,dataEndIndex:c}))),{},u7(u7(u7({key:n.key||`item-${m}`},h,T[h]),g,T[g]),`animationId`,a)),childIndex:okt(n,e.children),item:n})}),v},f=function(e,r){var i=e.props,a=e.dataStartIndex,o=e.dataEndIndex,c=e.updateId;if(!$Ot({props:i}))return null;var u=i.children,f=i.layout,p=i.stackOffset,m=i.data,h=i.reverseStackOrder,g=uJt(f),_=g.numericAxisName,v=g.cateAxisName,y=t2(u,n),b=yzt(m,y,`${_}Id`,`${v}Id`,p,h),x=s.reduce(function(e,t){var n=`${t.axisType}Map`;return Q(Q({},e),{},u7({},n,oJt(i,Q(Q({},t),{},{graphicalItems:y,stackGroups:t.axisType===_&&b,dataStartIndex:a,dataEndIndex:o}))))},{}),S=dJt(Q(Q({},x),{},{props:i,graphicalItems:y}),r?.legendBBox);Object.keys(x).forEach(function(e){x[e]=l(i,x[e],S,e.replace(`Map`,``),t)});var C=x[`${v}Map`],w=sJt(C);return Q(Q({formattedGraphicalItems:d(i,Q(Q({},x),{},{dataStartIndex:a,dataEndIndex:o,updateId:c,graphicalItems:y,stackGroups:b,offset:S})),graphicalItems:y,offset:S,stackGroups:b},w),x)},p=function(e){function n(e){var r;return Iqt(this,n),r=zqt(this,n,[e]),u7(r,`eventEmitterSymbol`,Symbol(`rechartsEventEmitter`)),u7(r,`accessibilityManager`,new _qt),u7(r,`handleLegendBBoxUpdate`,function(e){if(e){var t=r.state,n=t.dataStartIndex,i=t.dataEndIndex,a=t.updateId;r.setState(Q({legendBBox:e},f({props:r.props,dataStartIndex:n,dataEndIndex:i,updateId:a},Q(Q({},r.state),{},{legendBBox:e}))))}}),u7(r,`handleReceiveSyncEvent`,function(e,t,n){if(r.props.syncId===e){if(n===r.eventEmitterSymbol&&typeof r.props.syncMethod!=`function`)return;r.applySyncEvent(t)}}),u7(r,`handleBrushChange`,function(e){var t=e.startIndex,n=e.endIndex;if(t!==r.state.dataStartIndex||n!==r.state.dataEndIndex){var i=r.state.updateId;r.setState(function(){return Q({dataStartIndex:t,dataEndIndex:n},f({props:r.props,dataStartIndex:t,dataEndIndex:n,updateId:i},r.state))}),r.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),u7(r,`handleMouseEnter`,function(e){var t=r.getMouseInfo(e);if(t){var n=Q(Q({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseEnter;(0,Z0.default)(i)&&i(n,e)}}),u7(r,`triggeredAfterMouseMove`,function(e){var t=r.getMouseInfo(e),n=t?Q(Q({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseMove;(0,Z0.default)(i)&&i(n,e)}),u7(r,`handleItemMouseEnter`,function(e){r.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),u7(r,`handleItemMouseLeave`,function(){r.setState(function(){return{isTooltipActive:!1}})}),u7(r,`handleMouseMove`,function(e){e.persist(),r.throttleTriggeredAfterMouseMove(e)}),u7(r,`handleMouseLeave`,function(e){r.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};r.setState(t),r.triggerSyncEvent(t);var n=r.props.onMouseLeave;(0,Z0.default)(n)&&n(t,e)}),u7(r,`handleOuterEvent`,function(e){var t=akt(e),n=(0,F0.default)(r.props,`${t}`);t&&(0,Z0.default)(n)&&n((/.*touch.*/i.test(t)?r.getMouseInfo(e.changedTouches[0]):r.getMouseInfo(e))??{},e)}),u7(r,`handleClick`,function(e){var t=r.getMouseInfo(e);if(t){var n=Q(Q({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onClick;(0,Z0.default)(i)&&i(n,e)}}),u7(r,`handleMouseDown`,function(e){var t=r.props.onMouseDown;(0,Z0.default)(t)&&t(r.getMouseInfo(e),e)}),u7(r,`handleMouseUp`,function(e){var t=r.props.onMouseUp;(0,Z0.default)(t)&&t(r.getMouseInfo(e),e)}),u7(r,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),u7(r,`handleTouchStart`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseDown(e.changedTouches[0])}),u7(r,`handleTouchEnd`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseUp(e.changedTouches[0])}),u7(r,`handleDoubleClick`,function(e){var t=r.props.onDoubleClick;(0,Z0.default)(t)&&t(r.getMouseInfo(e),e)}),u7(r,`handleContextMenu`,function(e){var t=r.props.onContextMenu;(0,Z0.default)(t)&&t(r.getMouseInfo(e),e)}),u7(r,`triggerSyncEvent`,function(e){r.props.syncId!==void 0&&Q5.emit($5,r.props.syncId,e,r.eventEmitterSymbol)}),u7(r,`applySyncEvent`,function(e){var t=r.props,n=t.layout,i=t.syncMethod,a=r.state.updateId,o=e.dataStartIndex,s=e.dataEndIndex;if(e.dataStartIndex!==void 0||e.dataEndIndex!==void 0)r.setState(Q({dataStartIndex:o,dataEndIndex:s},f({props:r.props,dataStartIndex:o,dataEndIndex:s,updateId:a},r.state)));else if(e.activeTooltipIndex!==void 0){var c=e.chartX,l=e.chartY,u=e.activeTooltipIndex,d=r.state,p=d.offset,m=d.tooltipTicks;if(!p)return;if(typeof i==`function`)u=i(m,e);else if(i===`value`){u=-1;for(var h=0;h<m.length;h++)if(m[h].value===e.activeLabel){u=h;break}}var g=Q(Q({},p),{},{x:p.left,y:p.top}),_=Math.min(c,g.x+g.width),v=Math.min(l,g.y+g.height),y=m[u]&&m[u].value,b=p7(r.state,r.props.data,u),x=m[u]?{x:n===`horizontal`?m[u].coordinate:_,y:n===`horizontal`?v:m[u].coordinate}:$qt;r.setState(Q(Q({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else r.setState(e)}),u7(r,`renderCursor`,function(e){var n=r.state,i=n.isTooltipActive,a=n.activeCoordinate,o=n.activePayload,s=n.offset,c=n.activeTooltipIndex,l=n.tooltipAxisBandSize,u=r.getTooltipEventType(),d=e.props.active??i,f=r.props.layout,p=e.key||`_recharts-cursor`;return g.createElement(Eqt,{key:p,activeCoordinate:a,activePayload:o,activeTooltipIndex:c,chartName:t,element:e,isActive:d,layout:f,offset:s,tooltipAxisBandSize:l,tooltipEventType:u})}),u7(r,`renderPolarAxis`,function(e,t,n){var i=(0,F0.default)(e,`type.axisType`),a=(0,F0.default)(r.state,`${i}Map`),o=e.type.defaultProps,s=o===void 0?e.props:Q(Q({},o),e.props),c=a&&a[s[`${i}Id`]];return(0,g.cloneElement)(e,Q(Q({},c),{},{className:Gp(i,c.className),key:e.key||`${t}-${n}`,ticks:M6(c,!0)}))}),u7(r,`renderPolarGrid`,function(e){var t=e.props,n=t.radialLines,i=t.polarAngles,a=t.polarRadius,o=r.state,s=o.radiusAxisMap,c=o.angleAxisMap,l=H0(s),u=H0(c),d=u.cx,f=u.cy,p=u.innerRadius,m=u.outerRadius;return(0,g.cloneElement)(e,{polarAngles:Array.isArray(i)?i:M6(u,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:M6(l,!0).map(function(e){return e.coordinate}),cx:d,cy:f,innerRadius:p,outerRadius:m,key:e.key||`polar-grid`,radialLines:n})}),u7(r,`renderLegend`,function(){var e=r.state.formattedGraphicalItems,t=r.props,n=t.children,i=t.width,a=t.height,o=r.props.margin||{},s=YRt({children:n,formattedGraphicalItems:e,legendWidth:i-(o.left||0)-(o.right||0),legendContent:c});if(!s)return null;var l=s.item;return(0,g.cloneElement)(l,Q(Q({},Pqt(s,Oqt)),{},{chartWidth:i,chartHeight:a,margin:o,onBBoxUpdate:r.handleLegendBBoxUpdate}))}),u7(r,`renderTooltip`,function(){var e=r.props,t=e.children,n=e.accessibilityLayer,i=n2(t,T4);if(!i)return null;var a=r.state,o=a.isTooltipActive,s=a.activeCoordinate,c=a.activePayload,l=a.activeLabel,u=a.offset,d=i.props.active??o;return(0,g.cloneElement)(i,{viewBox:Q(Q({},u),{},{x:u.left,y:u.top}),active:d,label:l,payload:d?c:[],coordinate:s,accessibilityLayer:n})}),u7(r,`renderBrush`,function(e){var t=r.props,n=t.margin,i=t.data,a=r.state,o=a.offset,s=a.dataStartIndex,c=a.dataEndIndex,l=a.updateId;return(0,g.cloneElement)(e,{key:e.key||`_recharts-brush`,onChange:P6(r.handleBrushChange,e.props.onChange),data:i,x:R0(e.props.x)?e.props.x:o.left,y:R0(e.props.y)?e.props.y:o.top+o.height+o.brushBottom-(n.bottom||0),width:R0(e.props.width)?e.props.width:o.width,startIndex:s,endIndex:c,updateId:`brush-${l}`})}),u7(r,`renderReferenceElement`,function(e,t,n){if(!e)return null;var i=r.clipPathId,a=r.state,o=a.xAxisMap,s=a.yAxisMap,c=a.offset,l=e.type.defaultProps||{},u=e.props,d=u.xAxisId,f=d===void 0?l.xAxisId:d,p=u.yAxisId,m=p===void 0?l.yAxisId:p;return(0,g.cloneElement)(e,{key:e.key||`${t}-${n}`,xAxis:o[f],yAxis:s[m],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:i})}),u7(r,`renderActivePoints`,function(e){var t=e.item,r=e.activePoint,i=e.basePoint,a=e.childIndex,o=e.isRange,s=[],c=t.props.key,l=t.item.type.defaultProps===void 0?t.item.props:Q(Q({},t.item.type.defaultProps),t.item.props),u=l.activeDot,d=l.dataKey,f=Q(Q({index:a,dataKey:d,cx:r.x,cy:r.y,r:4,fill:j6(t.item),strokeWidth:2,stroke:`#fff`,payload:r.payload,value:r.value},r2(u,!1)),J0(u));return s.push(n.renderActiveDot(u,f,`${c}-activePoint-${a}`)),i?s.push(n.renderActiveDot(u,Q(Q({},f),{},{cx:i.x,cy:i.y}),`${c}-basePoint-${a}`)):o&&s.push(null),s}),u7(r,`renderGraphicChild`,function(e,t,n){var i=r.filterFormatItem(e,t,n);if(!i)return null;var a=r.getTooltipEventType(),o=r.state,s=o.isTooltipActive,c=o.tooltipAxis,l=o.activeTooltipIndex,u=o.activeLabel,d=r.props.children,f=n2(d,T4),p=i.props,m=p.points,h=p.isRange,_=p.baseLine,v=i.item.type.defaultProps===void 0?i.item.props:Q(Q({},i.item.type.defaultProps),i.item.props),y=v.activeDot,b=v.hide,x=v.activeBar,S=v.activeShape,C=!!(!b&&s&&f&&(y||x||S)),w={};a!==`axis`&&f&&f.props.trigger===`click`?w={onClick:P6(r.handleItemMouseEnter,e.props.onClick)}:a!==`axis`&&(w={onMouseLeave:P6(r.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:P6(r.handleItemMouseEnter,e.props.onMouseEnter)});var T=(0,g.cloneElement)(e,Q(Q({},i.props),w));function E(e){return typeof c.dataKey==`function`?c.dataKey(e.payload):null}if(C)if(l>=0){var D,O;if(c.dataKey&&!c.allowDuplicatedCategory){var k=typeof c.dataKey==`function`?E:`payload.${c.dataKey.toString()}`;D=U0(m,k,u),O=h&&_&&U0(_,k,u)}else D=m?.[l],O=h&&_&&_[l];if(S||x){var A=e.props.activeIndex===void 0?l:e.props.activeIndex;return[(0,g.cloneElement)(e,Q(Q(Q({},i.props),w),{},{activeIndex:A})),null,null]}if(!(0,X0.default)(D))return[T].concat(c7(r.renderActivePoints({item:i,activePoint:D,basePoint:O,childIndex:l,isRange:h})))}else{var j=(r.getItemByXY(r.state.activeCoordinate)??{graphicalItem:T}).graphicalItem,M=j.item,N=M===void 0?e:M,P=j.childIndex;return[(0,g.cloneElement)(N,Q(Q(Q({},i.props),w),{},{activeIndex:P})),null,null]}return h?[T,null,null]:[T,null]}),u7(r,`renderCustomized`,function(e,t,n){return(0,g.cloneElement)(e,Q(Q({key:`recharts-customized-${n}`},r.props),r.state))}),u7(r,`renderMap`,{CartesianGrid:{handler:d7,once:!0},ReferenceArea:{handler:r.renderReferenceElement},ReferenceLine:{handler:d7},ReferenceDot:{handler:r.renderReferenceElement},XAxis:{handler:d7},YAxis:{handler:d7},Brush:{handler:r.renderBrush,once:!0},Bar:{handler:r.renderGraphicChild},Line:{handler:r.renderGraphicChild},Area:{handler:r.renderGraphicChild},Radar:{handler:r.renderGraphicChild},RadialBar:{handler:r.renderGraphicChild},Scatter:{handler:r.renderGraphicChild},Pie:{handler:r.renderGraphicChild},Funnel:{handler:r.renderGraphicChild},Tooltip:{handler:r.renderCursor,once:!0},PolarGrid:{handler:r.renderPolarGrid,once:!0},PolarAngleAxis:{handler:r.renderPolarAxis},PolarRadiusAxis:{handler:r.renderPolarAxis},Customized:{handler:r.renderCustomized}}),r.clipPathId=`${e.id??B0(`recharts`)}-clip`,r.throttleTriggeredAfterMouseMove=(0,Dqt.default)(r.triggeredAfterMouseMove,e.throttleDelay??1e3/60),r.state={},r}return Uqt(n,e),Rqt(n,[{key:`componentDidMount`,value:function(){this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:this.props.margin.left??0,top:this.props.margin.top??0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:`displayDefaultTooltip`,value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,i=e.layout,a=n2(t,T4);if(a){var o=a.props.defaultIndex;if(!(typeof o!=`number`||o<0||o>this.state.tooltipTicks.length-1)){var s=this.state.tooltipTicks[o]&&this.state.tooltipTicks[o].value,c=p7(this.state,n,o,s),l=this.state.tooltipTicks[o].coordinate,u=(this.state.offset.top+r)/2,d=i===`horizontal`?{x:l,y:u}:{y:l,x:u},f=this.state.formattedGraphicalItems.find(function(e){return e.item.type.name===`Scatter`});f&&(d=Q(Q({},d),f.props.points[o].tooltipPosition),c=f.props.points[o].tooltipPayload);var p={activeTooltipIndex:o,isTooltipActive:!0,activeLabel:s,activePayload:c,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(o)}}}},{key:`getSnapshotBeforeUpdate`,value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:this.props.margin.left??0,top:this.props.margin.top??0}}),null):null}},{key:`componentDidUpdate`,value:function(e){i2([n2(e.children,T4)],[n2(this.props.children,T4)])||this.displayDefaultTooltip()}},{key:`componentWillUnmount`,value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:`getTooltipEventType`,value:function(){var e=n2(this.props.children,T4);if(e&&typeof e.props.shared==`boolean`){var t=e.props.shared?`axis`:`item`;return o.indexOf(t)>=0?t:i}return i}},{key:`getMouseInfo`,value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=qNt(n),i={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,o=this.inRange(i.chartX,i.chartY,a);if(!o)return null;var s=this.state,c=s.xAxisMap,l=s.yAxisMap,u=this.getTooltipEventType(),d=rJt(this.state,this.props.data,this.props.layout,o);if(u!==`axis`&&c&&l){var f=H0(c).scale,p=H0(l).scale,m=f&&f.invert?f.invert(i.chartX):null,h=p&&p.invert?p.invert(i.chartY):null;return Q(Q({},i),{},{xValue:m,yValue:h},d)}return d?Q(Q({},i),d):null}},{key:`inRange`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=this.props.layout,i=e/n,a=t/n;if(r===`horizontal`||r===`vertical`){var o=this.state.offset;return i>=o.left&&i<=o.left+o.width&&a>=o.top&&a<=o.top+o.height?{x:i,y:a}:null}var s=this.state,c=s.angleAxisMap,l=s.radiusAxisMap;if(c&&l){var u=H0(c);return Gzt({x:i,y:a},u)}return null}},{key:`parseEventsOfWrapper`,value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=n2(e,T4),r={};return n&&t===`axis`&&(r=n.props.trigger===`click`?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),Q(Q({},J0(this.props,this.handleOuterEvent)),r)}},{key:`addListener`,value:function(){Q5.on($5,this.handleReceiveSyncEvent)}},{key:`removeListener`,value:function(){Q5.removeListener($5,this.handleReceiveSyncEvent)}},{key:`filterFormatItem`,value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,i=0,a=r.length;i<a;i++){var o=r[i];if(o.item===e||o.props.key===e.key||t===Q0(o.item.type)&&n===o.childIndex)return o}return null}},{key:`renderClipPath`,value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,r=t.top,i=t.height,a=t.width;return g.createElement(`defs`,null,g.createElement(`clipPath`,{id:e},g.createElement(`rect`,{x:n,y:r,height:i,width:a})))}},{key:`getXScales`,value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=Aqt(t,2),r=n[0],i=n[1];return Q(Q({},e),{},u7({},r,i.scale))},{}):null}},{key:`getYScales`,value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=Aqt(t,2),r=n[0],i=n[1];return Q(Q({},e),{},u7({},r,i.scale))},{}):null}},{key:`getXScaleByAxisId`,value:function(e){var t;return(t=this.state.xAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getYScaleByAxisId`,value:function(e){var t;return(t=this.state.yAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getItemByXY`,value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var i=0,a=n.length;i<a;i++){var o=n[i],s=o.props,c=o.item,l=c.type.defaultProps===void 0?c.props:Q(Q({},c.type.defaultProps),c.props),u=Q0(c.type);if(u===`Bar`){var d=(s.data||[]).find(function(t){return dUt(e,t)});if(d)return{graphicalItem:o,payload:d}}else if(u===`RadialBar`){var f=(s.data||[]).find(function(t){return Gzt(e,t)});if(f)return{graphicalItem:o,payload:f}}else if(s5(o,r)||c5(o,r)||l5(o,r)){var p=XWt({graphicalItem:o,activeTooltipItem:r,itemData:l.data}),m=l.activeIndex===void 0?p:l.activeIndex;return{graphicalItem:Q(Q({},o),{},{childIndex:m}),payload:l5(o,r)?l.data[p]:o.props.data[p]}}}return null}},{key:`render`,value:function(){var e=this;if(!$Ot(this))return null;var t=this.props,n=t.children,r=t.className,i=t.width,a=t.height,o=t.style,s=t.compact,c=t.title,l=t.desc,u=r2(Pqt(t,kqt),!1);if(s)return g.createElement(cKt,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},g.createElement(o2,a7({},u,{width:i,height:a,title:c,desc:l}),this.renderClipPath(),ikt(n,this.renderMap)));this.props.accessibilityLayer&&(u.tabIndex=this.props.tabIndex??0,u.role=this.props.role??`application`,u.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},u.onFocus=function(){e.accessibilityManager.focus()});var d=this.parseEventsOfWrapper();return g.createElement(cKt,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},g.createElement(`div`,a7({className:Gp(`recharts-wrapper`,r),style:Q({position:`relative`,cursor:`default`,width:i,height:a},o)},d,{ref:function(t){e.container=t}}),g.createElement(o2,a7({},u,{width:i,height:a,title:c,desc:l,style:Qqt}),this.renderClipPath(),ikt(n,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(g.Component);u7(p,`displayName`,t),u7(p,`defaultProps`,Q({layout:`horizontal`,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`},u)),u7(p,`getDerivedStateFromProps`,function(e,t){var n=e.dataKey,r=e.data,i=e.children,a=e.width,o=e.height,s=e.layout,c=e.stackOffset,l=e.margin,u=t.dataStartIndex,d=t.dataEndIndex;if(t.updateId===void 0){var p=cJt(e);return Q(Q(Q({},p),{},{updateId:0},f(Q(Q({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(n!==t.prevDataKey||r!==t.prevData||a!==t.prevWidth||o!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!W0(l,t.prevMargin)){var m=cJt(e),h={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=Q(Q({},rJt(t,r,s)),{},{updateId:t.updateId+1}),_=Q(Q(Q({},m),h),g);return Q(Q(Q({},_),f(Q({props:e},_),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(!i2(i,t.prevChildren)){var v=n2(i,E5),y=v?v.props?.startIndex??u:u,b=v?v.props?.endIndex??d:d,x=y!==u||b!==d,S=!(0,X0.default)(r)&&!x?t.updateId:t.updateId+1;return Q(Q({updateId:S},f(Q(Q({props:e},t),{},{updateId:S,dataStartIndex:y,dataEndIndex:b}),t)),{},{prevChildren:i,dataStartIndex:y,dataEndIndex:b})}return null}),u7(p,`renderActiveDot`,function(e,t,n){var r=(0,g.isValidElement)(e)?(0,g.cloneElement)(e,t):(0,Z0.default)(e)?e(t):g.createElement(B8,t);return g.createElement(c2,{className:`recharts-active-dot`,key:n},r)});var m=(0,g.forwardRef)(function(e,t){return g.createElement(p,a7({},e,{ref:t}))});return m.displayName=p.displayName,m}({chartName:`PieChart`,GraphicalChild:_5,validateTooltipEventTypes:[`item`],defaultTooltipEventType:`item`,legendContent:`children`,axisComponents:[{axisType:`angleAxis`,AxisComp:n5},{axisType:`radiusAxis`,AxisComp:Y8}],formatAxisMap:Bzt,defaultProps:{layout:`centric`,startAngle:0,endAngle:360,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`}}),mJt={success:`fill-green-500`,failed:`fill-red-600`,skipped:`fill-neutral-500`,"in-progress":`fill-blue-500`},hJt=({deployment:e,className:t,size:n=20,innerRadius:r=45})=>(0,W.jsx)(pJt,{width:n,height:n,margin:{top:0,left:0,right:0,bottom:0},className:G(`relative`,t),children:(0,W.jsx)(_5,{className:G(`stroke-white dark:stroke-gray-950 [&_.recharts-pie-sector]:outline-hidden`),data:e.stages.map(e=>({name:e.stage,status:e.status,value:1,className:mJt[e.status]})),cx:`50%`,cy:`50%`,startAngle:90,endAngle:-270,innerRadius:`${r}%`,outerRadius:`100%`,stroke:``,strokeLinejoin:`round`,dataKey:`value`,nameKey:`name`,isAnimationActive:!1,style:{outline:`none`}})}),gJt=({item:e,isSelected:t,onSelect:n})=>{let r=new Date(e.createdOn),i=QDt(r)?`${f0(r,`H:mm:ss`)} Today`:ZDt(r)?`${f0(r,`H:mm:ss ccc d, MMM`)}`:`${f0(r,`H:mm:ss ccc d`)} ${f0(r,`MMM yyy`)}`;return(0,W.jsxs)(`div`,{className:(0,EP.default)(`flex items-center gap-2 px-3 cursor-pointer h-10 border-border border-b`,{"bg-gray-100":t,"hover:bg-gray-50 hover:text-gray-900":!t}),onClick:()=>n(),children:[(0,W.jsx)(`div`,{className:`flex justify-center items-center w-5 shrink-0`,children:(0,W.jsx)(hJt,{deployment:e})}),(0,W.jsx)(`span`,{className:`w-full text-sm truncate`,children:i})]})},_Jt=()=>gz(`auto-open-feedback`,void 0),vJt=()=>{let[,e]=WA(`build`);return{openBuildFeedback:t=>e(t)}},yJt=()=>{let[e]=_Jt(),{environment:t}=lh([`account`,`project`,`environment`]),{data:n}=eM(t.name),r=n?.data?.at(0),{openBuildFeedback:i}=vJt(),a=(0,g.useRef)(e),o=(0,g.useRef)(i);(0,g.useEffect)(()=>{o.current=i},[i]),(0,g.useEffect)(()=>{a.current=e},[e]),(0,g.useEffect)(()=>{a.current===!0&&r?.id&&r.stages.some(({status:e})=>e===`failed`)&&o.current(r.id)},[r?.id,r?.stages])},bJt=()=>{let[e,t]=_Jt();return(0,W.jsxs)(Ok,{open:e===void 0,children:[(0,W.jsx)(kk,{asChild:!0,children:(0,W.jsxs)(`label`,{className:`flex gap-2 items-center text-xs font-medium cursor-pointer`,children:[(0,W.jsx)(AV,{checked:e,onCheckedChange:()=>t(e=>!e)}),`Auto-open feedback`]})}),(0,W.jsxs)(Ak,{className:`mr-2`,children:[`Try automatically open build feedback next time`,(0,W.jsx)(jk,{})]})]})},xJt={"in-progress":`Building`,success:`Finished`,failed:`Failed`,skipped:`Skipped`},SJt=({status:e})=>xJt[e],CJt={lint:`Lint`,build:`Build`,deploy:`Deploy`},wJt=({step:e})=>CJt[e]??e,TJt={"dev-portal":`devPortal`,api:`api`},EJt=e=>e.map(([e,t,n])=>({timestamp:e,severity:t,message:n})).sort((e,t)=>e.timestamp.localeCompare(t.timestamp)),DJt=e=>e.filter(e=>e.severity===`warn`).length,OJt=(e,t)=>{let n=e[TJt[t]];return n?EJt(Object.values(n).flat()):[]},kJt=(e,t,n)=>{let r=e[TJt[t]];if(!r)return[];let i=r[n];return i?EJt(i):[]},AJt=({text:e})=>e.split(/(https?:\/\/\S+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,W.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:e},`${e}-${t}`):e),m7=e(i(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))}))(),1);function jJt({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}var MJt=jJt();function NJt(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(MJt,``)}var PJt=({logs:e,children:t,className:n})=>(0,W.jsx)(`div`,{className:G(`grid grid-cols-[auto_1fr] auto-rows-min gap-x-5 py-4 text-xs h-full overflow-auto`,`bg-neutral-950 font-mono text-white`,n),children:t||(e.length>0?e.map(({timestamp:e,severity:t,message:n},r)=>(0,W.jsxs)(`div`,{className:G(`grid grid-cols-subgrid col-span-full px-4 py-1 hover:bg-neutral-800 text-neutral-200`,{"text-red-400":t===`error`,"text-yellow-400":t===`warn`,"text-green-500":/^\x1b\[32m/.test(n)}),children:[(0,W.jsx)(`div`,{className:`select-none`,children:(0,m7.default)(e).format(`HH:mm:ss.SSS`)}),(0,W.jsx)(`pre`,{className:`whitespace-pre-wrap`,children:(0,W.jsx)(AJt,{text:NJt(n).trim()})})]},`${e}-${r}`)):(0,W.jsx)(`div`,{className:`text-neutral-300 italic px-4`,children:`No logs available`}))}),FJt=({stage:e,buildLogs:t,isLoading:n})=>(0,W.jsx)(`div`,{className:`divide-y divide-neutral-800`,children:[...e.steps??[]].sort((e,t)=>e.ordinal-t.ordinal).map(r=>{let i=kJt(t,e.stage,r.step),a=DJt(i);return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 text-xs font-medium bg-neutral-900 text-neutral-300`,children:[(0,W.jsx)(qz,{status:r.status}),(0,W.jsx)(wJt,{step:r.step}),a>0&&(0,W.jsxs)(LS,{variant:`warn`,children:[a,` warning`,a>1?`s`:``]})]}),(0,W.jsx)(PJt,{logs:i,children:n&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-0.5 col-span-full px-4`,children:[(0,W.jsx)(hN,{className:`h-4 w-3/6 bg-white/20`}),(0,W.jsx)(hN,{className:`h-4 w-2/6 bg-white/20`})]})})]},r.id)})}),IJt=(e,t)=>e?t(e):void 0,LJt=({deployment:e,defaultOpen:t})=>{let{environment:n}=lh([`environment`]),r=Dxt(n.name,e.id,{});return r.isPending?(0,W.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,W.jsx)(hN,{className:`h-10 w-full`}),(0,W.jsx)(hN,{className:`h-10 w-full`})]}):r.isError?(0,W.jsx)(PS,{variant:`warning`,children:(0,W.jsx)(IS,{className:`text-center`,children:(0,W.jsx)(`div`,{className:`text-neutral-600 text-lg`,children:r.error?r.error.status===401||r.error.status===403?`You don't have permission to view build logs for this deployment.`:r.error.status===404?`Deployment not found. The selected deployment may have been deleted or doesn't exist.`:r.error.status===500?`Server error occurred while loading build logs. Please try again or contact support if the problem persists.`:`Unable to load build logs. Please try again or contact support if the problem persists.`:`Could not load logs. Please try again or contact support if the problem persists.`})})}):(0,W.jsx)(lV,{className:`divide-y overflow-hidden`,children:e.stages.map((n,i)=>(0,W.jsx)(RJt,{stage:n,stageIndex:i,stageCount:e.stages.length,buildLogs:r.data,isLoading:r.isLoading,defaultOpen:t},n.id))})},RJt=({stage:e,stageIndex:t,stageCount:n,buildLogs:r,isLoading:i,defaultOpen:a})=>{let o=e.steps&&e.steps.length>0;return(0,W.jsxs)(Uz,{defaultOpen:a,children:[(0,W.jsx)(Wz,{asChild:!0,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2 p-2 w-full hover:bg-accent cursor-pointer group`,children:[(0,W.jsx)(qz,{status:e.status}),(0,W.jsxs)(`div`,{className:`font-medium`,children:[(0,W.jsxs)(`span`,{className:`font-mono text-xs me-2`,children:[`(`,t+1,`/`,n,`)`]}),`Building `,(0,W.jsx)(Kz,{stage:e.stage})]}),(0,W.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:(0,W.jsx)(SJt,{status:e.status})}),(0,W.jsx)(`div`,{className:`text-xs text-amber-400`,children:IJt(DJt(OJt(r,e.stage)),e=>(0,W.jsxs)(LS,{variant:`warn`,children:[e,` warning`,e>1?`s`:``]}))}),(0,W.jsx)(`div`,{className:`ms-2 flex items-center justify-center`,children:(0,W.jsx)(ym,{className:`w-4 h-4 transition-transform group-data-[state=closed]:-rotate-90`})})]})}),(0,W.jsx)(Gz,{children:o?(0,W.jsx)(FJt,{stage:e,buildLogs:r,isLoading:i}):(0,W.jsx)(PJt,{logs:OJt(r,e.stage),children:i&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-0.5 col-span-full px-4`,children:[(0,W.jsx)(hN,{className:`h-4 w-3/6 bg-white/20`}),(0,W.jsx)(hN,{className:`h-4 w-2/6 bg-white/20`})]})})})]})},zJt=({build:e})=>(0,W.jsx)(`div`,{className:`p-4 w-full`,children:(0,W.jsx)(LJt,{deployment:e,defaultOpen:!0})}),BJt=()=>{let[e,t]=WA(`build`);yJt();let{environment:n}=lh([`account`,`project`,`environment`]),{data:r}=eM(n.name),i=r?.data?.find(t=>t.id===e);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(mN,{}),(0,W.jsxs)(pN,{className:`min-h-36 shadow-[rgb(215_215_215/15%)_0px_-4px_3px_0px] dark:shadow-[rgb(0_0_0/40%)_0px_-4px_3px_0px]`,defaultSize:30,children:[(0,W.jsxs)(`div`,{className:`flex gap-2 border-b h-8 items-center justify-between group bg-surface-muted px-3`,children:[(0,W.jsx)(`div`,{className:`divide-neutral-200`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2 group rounded-none relative text-xs font-medium`,title:e,children:[(0,W.jsx)(kre,{size:16}),e?`Build ${e.slice(0,8)}`:`Builds`]})}),(0,W.jsxs)(`div`,{className:`flex flex-row gap-2`,children:[(0,W.jsx)(bJt,{}),(0,W.jsx)(Y,{variant:`ghost`,size:`icon-xs`,onClick:()=>t(void 0),children:(0,W.jsx)(nh,{size:18})})]})]}),(0,W.jsxs)(`div`,{className:`h-[calc(100%-2rem)]`,children:[r?.data?.length===0&&(0,W.jsx)(`div`,{className:`p-3 text-sm`,children:`Start changing your local copy to see build information.`}),(0,W.jsxs)(`div`,{className:`divide-x grid grid-cols-[min-content_1fr] w-full h-full`,children:[(0,W.jsx)(`div`,{className:`overflow-y-auto`,children:r?.data?.map(n=>(0,W.jsx)(gJt,{item:n,isSelected:n.id===e,onSelect:()=>t(n.id)},`${n.id}`))}),(0,W.jsx)(`div`,{className:`overflow-y-auto`,children:e&&i?(0,W.jsx)(zJt,{build:i}):(0,W.jsx)(`div`,{className:`p-3 text-sm`,children:`Select a build to view more information.`})})]})]})]})]})};function h7(e,t){return e.filter(e=>e.isActive?.(t)??!0)}function VJt(e,t){return e.findIndex(e=>e.id===t)}function HJt(e,t){return h7(e,t)[0]?.id??e[0]?.id??``}function UJt(e,t){let n=e.initialAnswers(t);return{answers:n,currentStepId:HJt(e.steps,n),history:[],tasks:{},status:`active`}}function WJt(e,t,n){let r=h7(e,t);if(r.some(e=>e.id===n))return n;let i=e.findIndex(e=>e.id===n),a=new Set(r.map(e=>e.id));for(let t=i;t>=0;t--)if(a.has(e[t].id))return e[t].id;return r[0]?.id??n}function GJt(e,t,n){switch(n.type){case`PATCH_ANSWERS`:{let r={...t.answers,...n.partial};return{...t,answers:r,currentStepId:WJt(e,r,t.currentStepId)}}case`NEXT`:{let n=h7(e,t.answers),r=n[VJt(n,t.currentStepId)+1];return r?{...t,currentStepId:r.id,history:[...t.history,t.currentStepId]}:t}case`BACK`:{let n=t.history[t.history.length-1];return n===void 0?t:{...t,currentStepId:WJt(e,t.answers,n),history:t.history.slice(0,-1)}}case`GOTO`:return!h7(e,t.answers).some(e=>e.id===n.stepId)||n.stepId===t.currentStepId?t:{...t,currentStepId:n.stepId,history:[...t.history,t.currentStepId]};case`SET_TASK`:return{...t,tasks:{...t.tasks,[n.stepId]:n.task}};case`COMPLETE`:return{...t,status:`completed`};case`RESET`:return{answers:n.answers,currentStepId:n.firstStepId,history:[],tasks:{},status:`active`};default:return t}}function KJt({selected:e,onClick:t,title:n,description:r,icon:i,indicator:a=`radio`,role:o,disabled:s,className:c}){return(0,W.jsxs)(`button`,{type:`button`,onClick:t,disabled:s,role:o,"aria-checked":o?e:void 0,"aria-pressed":o?void 0:e,className:G(`flex w-full flex-col items-start gap-1 rounded-md border bg-surface p-4 text-left transition-colors`,s?`cursor-not-allowed opacity-50`:`cursor-pointer hover:border-neutral-300 dark:hover:border-neutral-600 hover:bg-neutral-50 dark:hover:bg-neutral-800`,e&&!s&&`border-zuplo-500 bg-zuplo-50/30 hover:bg-zuplo-50/30`,c),children:[(0,W.jsxs)(`div`,{className:`flex w-full items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i&&(0,W.jsx)(`div`,{className:G(`rounded-md border p-1.5`,e?`border-zuplo-500 text-zuplo-500`:`text-foreground`),children:i}),(0,W.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n})]}),a!==`none`&&(0,W.jsx)(qJt,{kind:a,selected:e})]}),r&&(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r})]})}function qJt({kind:e,selected:t}){return e===`checkbox`?(0,W.jsx)(`span`,{className:G(`flex size-4 shrink-0 items-center justify-center rounded border-2`,t?`border-zuplo-500 bg-zuplo-500 text-white`:`border-neutral-300 dark:border-neutral-600`),children:t&&(0,W.jsx)(vm,{size:12,strokeWidth:3})}):(0,W.jsx)(`span`,{className:G(`size-4 shrink-0 rounded-full border-2`,t?`border-zuplo-500 bg-zuplo-500 ring-2 ring-inset ring-white`:`border-neutral-300 dark:border-neutral-600`)})}var JJt=e=>G(`grid gap-3`,e===1&&`grid-cols-1`,e===2&&`grid-cols-1 sm:grid-cols-2`,e===3&&`grid-cols-1 sm:grid-cols-3`);function YJt({value:e,onChange:t,options:n,columns:r=1}){return(0,W.jsx)(`div`,{className:JJt(r),role:`radiogroup`,children:n.map(n=>(0,W.jsx)(KJt,{selected:e===n.value,onClick:()=>t(n.value),title:n.title,description:n.description,icon:n.icon,disabled:n.disabled,indicator:`radio`,role:`radio`},n.value))})}function XJt({values:e,onChange:t,options:n,columns:r=1}){let i=n=>t(e.includes(n)?e.filter(e=>e!==n):[...e,n]);return(0,W.jsx)(`div`,{className:JJt(r),children:n.map(t=>(0,W.jsx)(KJt,{selected:e.includes(t.value),onClick:()=>i(t.value),title:t.title,description:t.description,icon:t.icon,disabled:t.disabled,indicator:`checkbox`,role:`checkbox`},t.value))})}var ZJt=`sm:max-w-2xl p-0 gap-0 flex max-h-[85vh] flex-col overflow-hidden`,QJt=`flex-1 min-h-0 overflow-y-auto px-6 py-5 flex flex-col gap-4`;function $Jt({label:e,className:t}){return(0,W.jsxs)(`output`,{className:G(`flex items-center gap-3 rounded-md border bg-neutral-50 px-4 py-3 text-sm text-neutral-700`,t),children:[(0,W.jsx)(Km,{className:`size-4 shrink-0 animate-spin text-zuplo-500`}),(0,W.jsx)(`span`,{children:e??`Working…`})]})}function eYt({message:e,onRetry:t,retryable:n=!0}){return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm`,role:`alert`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(th,{className:`mt-0.5 size-4 shrink-0`}),(0,W.jsx)(`span`,{className:`font-medium`,children:e})]}),n&&(0,W.jsx)(`div`,{children:(0,W.jsx)(Y,{size:`sm`,variant:`outline`,onClick:t,children:`Try again`})})]})}function g7({children:e}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-emerald-700`,children:[(0,W.jsx)(Em,{className:`size-4 shrink-0`}),(0,W.jsx)(`span`,{children:e})]})}function tYt({steps:e,currentIndex:t}){return e.length<=1?null:(0,W.jsx)(`ol`,{className:`flex flex-nowrap items-center gap-1.5 overflow-hidden`,children:e.map((n,r)=>{let i=r<t,a=r===t;return(0,W.jsxs)(`li`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:G(`flex size-5 shrink-0 items-center justify-center rounded-full border text-[11px] font-medium`,i&&`border-zuplo-500 bg-zuplo-500 text-white`,a&&`border-zuplo-500 text-zuplo-600`,!i&&!a&&`border-neutral-300 text-neutral-400`),children:i?(0,W.jsx)(vm,{size:12,strokeWidth:3}):r+1}),a&&(0,W.jsx)(`span`,{className:`whitespace-nowrap text-xs font-medium text-foreground`,children:n.title}),r<e.length-1&&(0,W.jsx)(`span`,{className:`h-px w-3 shrink-0 bg-border`,"aria-hidden":!0})]},n.id)})})}var _7={status:`pending`},nYt={status:`skipped`},rYt=e=>({status:`applied`,result:e}),iYt=1;function v7(e,t){return`zpl_wizard:${e}:${t.account}/${t.project}/${t.environment}`}function y7(){try{return typeof window>`u`?void 0:window.sessionStorage}catch{return}}function aYt(e,t,n){let r=y7();if(!r)return;let i=r.getItem(v7(e,t));if(i)try{let e=JSON.parse(i);if(e.v!==iYt)return;let t=h7(n,e.answers),r=t.some(t=>t.id===e.currentStepId)?e.currentStepId:t[0]?.id??e.currentStepId;return{answers:e.answers,currentStepId:r,history:e.history??[],tasks:e.tasks??{},status:e.status??`active`}}catch{return}}function oYt(e,t,n){let r=y7();if(!r)return;let i={v:iYt,answers:n.answers,currentStepId:n.currentStepId,history:n.history,tasks:Object.fromEntries(Object.entries(n.tasks).filter(([,e])=>e.state!==`running`)),status:n.status};try{r.setItem(v7(e,t),JSON.stringify(i))}catch{}}function sYt(e,t){y7()?.removeItem(v7(e,t))}function cYt(e){return e instanceof Error?e.message:typeof e==`string`?e:`Something went wrong`}function lYt(e,t,n){let{id:r,steps:i}=e,[a,o]=(0,g.useReducer)((0,g.useCallback)((e,t)=>GJt(i,e,t),[i]),void 0,()=>aYt(r,t,i)??UJt(e,t)),s=(0,g.useRef)(a);s.current=a;let c=(0,g.useRef)(n);c.current=n,(0,g.useEffect)(()=>{oYt(r,t,a)},[r,t,a]);let l=(0,g.useMemo)(()=>h7(i,a.answers),[i,a.answers]),u=VJt(l,a.currentStepId),d=l[u],f=(0,g.useCallback)(e=>{o({type:`PATCH_ANSWERS`,partial:e})},[]),p=(0,g.useRef)(null),m=(0,g.useRef)(null),h=(0,g.useRef)(new Set),_=(0,g.useCallback)(async(e,t,n)=>{m.current={stepId:e.id,kind:t},o({type:`SET_TASK`,stepId:e.id,task:{state:`running`}}),p.current?.abort();let r=new AbortController;p.current=r;try{return await n({answers:s.current.answers,patch:f,signal:r.signal,setProgress:t=>o({type:`SET_TASK`,stepId:e.id,task:{state:`running`,progress:t}}),services:c.current}),o({type:`SET_TASK`,stepId:e.id,task:{state:`idle`}}),!0}catch(t){return o({type:`SET_TASK`,stepId:e.id,task:{state:`error`,error:cYt(t),retryable:!0}}),!1}},[f]),v=(0,g.useCallback)(e=>i.find(t=>t.id===e),[i]),y=(0,g.useCallback)(()=>{let e=s.current;return h7(i,e.answers).find(t=>t.id===e.currentStepId)},[i]),b=(0,g.useCallback)(async()=>{let e=y();e&&(e.onExit&&!await _(e,`exit`,e.onExit)||o({type:`NEXT`}))},[y,_]),x=(0,g.useCallback)(()=>o({type:`BACK`}),[]),S=(0,g.useCallback)(()=>{let e=y();e?.onSkip&&o({type:`PATCH_ANSWERS`,partial:e.onSkip(s.current.answers)}),o({type:`NEXT`})},[y]),C=(0,g.useCallback)(e=>o({type:`GOTO`,stepId:e}),[]),w=(0,g.useCallback)(()=>{let e=m.current;if(!e)return;let t=v(e.stepId);t&&(e.kind===`exit`?b():t.onEnter&&_(t,`enter`,t.onEnter))},[b,_,v]),T=(0,g.useCallback)(()=>{sYt(r,t),h.current.clear();let n=UJt(e,t);o({type:`RESET`,answers:n.answers,firstStepId:n.currentStepId})},[e,r,t]),E=(0,g.useCallback)(()=>{sYt(r,t),o({type:`COMPLETE`})},[r,t]);(0,g.useEffect)(()=>{if(!d?.onEnter||h.current.has(d.id))return;let e=a.tasks[d.id];e?.state===`running`||e?.state===`error`||(h.current.add(d.id),_(d,`enter`,d.onEnter))},[d,_,a.tasks]);let D=d?.canAdvance?.(a.answers)??!0;return{answers:a.answers,patch:f,currentStep:d,activeSteps:l,index:u,isFirst:u<=0,isLast:u===l.length-1,progress:{current:u+1,total:l.length},canAdvance:D===!0,advanceBlockedReason:D===!0?void 0:D,task:d?a.tasks[d.id]:void 0,status:a.status,next:b,back:x,skip:S,goTo:C,retry:w,reset:T,complete:E}}var uYt=(0,g.createContext)(null),dYt=uYt.Provider;function b7(){let e=(0,g.useContext)(uYt);if(!e)throw Error(`useWizard must be used within a <WizardShell>`);return e}function fYt({showBack:e,isLast:t,canAdvance:n,blockedReason:r,skippable:i,busy:a,nextLabel:o,skipLabel:s,onBack:c,onSkip:l,onNext:u,onFinish:d}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-t px-6 py-4`,children:[e&&(0,W.jsx)(Y,{variant:`outline`,onClick:c,disabled:a,children:`Back`}),(0,W.jsx)(`div`,{className:`flex-1`}),i&&(0,W.jsx)(Y,{variant:`ghost`,onClick:l,disabled:a,children:s??`Skip`}),(0,W.jsxs)(Y,{variant:`brand`,onClick:t?d:u,disabled:a||!n,title:n?void 0:r,children:[a&&(0,W.jsx)(Km,{className:`size-4 animate-spin`}),o??(t?`Finish`:`Continue`)]})]})}function pYt({definition:e,launch:t,services:n,onClose:r,onComplete:i}){let a=lYt(e,t,n),{currentStep:o,activeSteps:s,index:c,isFirst:l,task:u,status:d,answers:f}=a,p=u?.state===`running`;if((0,g.useEffect)(()=>{d===`completed`&&i(f)},[d,f,i]),!o||d===`completed`)return null;let m=o.Component;return(0,W.jsx)(dYt,{value:a,children:(0,W.jsx)(kA,{open:!0,onOpenChange:e=>{!e&&!p&&r()},children:(0,W.jsxs)(MA,{className:ZJt,showCloseButton:!p,onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,W.jsxs)(NA,{className:`shrink-0 gap-2 border-b px-6 py-4`,children:[(0,W.jsx)(FA,{children:e.title}),o.description&&(0,W.jsx)(IA,{children:o.description}),(0,W.jsx)(`div`,{className:`pt-1`,children:(0,W.jsx)(tYt,{steps:s,currentIndex:c})})]}),(0,W.jsxs)(`div`,{className:QJt,children:[(0,W.jsx)(m,{}),!o.ownsStatus&&u?.state===`running`&&(0,W.jsx)($Jt,{label:u.progress?.label}),!o.ownsStatus&&u?.state===`error`&&(0,W.jsx)(eYt,{message:u.error,retryable:u.retryable,onRetry:a.retry})]}),(0,W.jsx)(fYt,{showBack:!l&&!o.isFinal,isLast:a.isLast,canAdvance:a.canAdvance,blockedReason:a.advanceBlockedReason,skippable:o.skippable,busy:p,nextLabel:o.nextLabel,skipLabel:o.skipLabel,onBack:a.back,onSkip:a.skip,onNext:a.next,onFinish:a.complete})]})})})}var mYt=`api-key-inbound`,hYt=`rate-limit-inbound`,gYt={second:1/60,"10s":1/6,"30s":.5,minute:1},_Yt={second:`second`,"10s":`10 seconds`,"30s":`30 seconds`,minute:`minute`};function vYt(){return{name:mYt,policyType:`api-key-inbound`,handler:{export:`ApiKeyInboundPolicy`,module:`$import(@zuplo/runtime)`,options:{allowUnauthenticatedRequests:!1,cacheTtlSeconds:60}}}}function yYt(e){return{name:hYt,policyType:`rate-limit-inbound`,handler:{export:`RateLimitInboundPolicy`,module:`$import(@zuplo/runtime)`,options:{rateLimitBy:e.rateLimitBy,requestsAllowed:e.requests,timeWindowMinutes:gYt[e.period]}}}}var bYt=async({answers:e,patch:t,services:n,setProgress:r})=>{if(e.apiKey.status===`applied`)return;let{keyName:i,managerEmail:a}=e.apiKeyDraft;r({label:`Creating your API key consumer…`});let{created:o}=await n.createConsumer({keyName:i,managerEmail:a});t({apiKey:rYt({keyName:i,managerEmail:a,consumerCreated:o,policyName:mYt})})};function xYt(e,t){if(t.selectedPolicies.includes(`api-key`)&&e.commitPolicyToAllRoutes(vYt()),t.selectedPolicies.includes(`rate-limit`)){let n=t.selectedPolicies.includes(`api-key`)?`user`:`ip`;e.commitPolicyToAllRoutes(yYt({requests:t.rateLimitDraft.requests,period:t.rateLimitDraft.period,rateLimitBy:n}))}}async function SYt(e,t=4){for(let n=1;n<=t;n++)try{return await e.save()}catch(e){if(n===t)throw e;await new Promise(e=>setTimeout(e,2**(n-1)*500))}return{}}var CYt=()=>{let e=lh(),t=uO(e.environment);return{deploymentDevPortalUrl:uO(e.environment,`dev-portal`),deploymentUrl:t?new URL(t).toString().replace(/\/$/,``):void 0}};function wYt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Add gateway policies to your endpoints. There are many more you can add manually later.`}),(0,W.jsx)(XJt,{values:e.selectedPolicies,onChange:e=>t({selectedPolicies:e}),options:[{value:`api-key`,title:`API Key Authentication`,description:`Arguably the best authentication method for B2B APIs — used by the greats like Stripe, OpenAI, and more.`},{value:`rate-limit`,title:`Rate Limiting`,description:`Protect your API from accidental misuse — the most common, and unprotected, form of DoS you'll face.`}]})]})}function TYt(){let{answers:e,patch:t}=b7(),{keyName:n,managerEmail:r}=e.apiKeyDraft;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`We'll create an API key in your development environment so you can test right away.`}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`Key name`}),(0,W.jsx)(jV,{value:n,placeholder:`test-key`,onChange:n=>t({apiKeyDraft:{...e.apiKeyDraft,keyName:n.target.value}})})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`Manager email`}),(0,W.jsx)(jV,{type:`email`,value:r,onChange:n=>t({apiKeyDraft:{...e.apiKeyDraft,managerEmail:n.target.value}})})]}),e.apiKey.status===`applied`&&(0,W.jsx)(g7,{children:e.apiKey.result.consumerCreated?`API key consumer created.`:`API key policy added — you can create a consumer later from Services.`})]})}var EYt=[`minute`,`30s`,`10s`,`second`];function DYt(){let{answers:e,patch:t}=b7(),{period:n,requests:r}=e.rateLimitDraft;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`Period`}),(0,W.jsxs)(wW,{value:n,onValueChange:n=>t({rateLimitDraft:{...e.rateLimitDraft,period:n}}),children:[(0,W.jsx)(EW,{className:`w-48`,children:(0,W.jsx)(TW,{})}),(0,W.jsx)(DW,{children:EYt.map(e=>(0,W.jsx)(OW,{value:e,children:e===`minute`?`Minute`:e===`second`?`Second`:_Yt[e]},e))})]})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`span`,{className:`text-sm font-medium`,children:[`Requests per `,_Yt[n],` allowed`]}),(0,W.jsx)(jV,{type:`number`,min:1,hideNumberArrows:!0,className:`w-48`,value:Number.isFinite(r)?r:``,onChange:n=>t({rateLimitDraft:{...e.rateLimitDraft,requests:Number(n.target.value)}})})]}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It's more fun to test with a low count per minute — you can change this later. (For sub-minute periods we convert to a fractional window.)`})]})}var OYt=[`api`,`dev-portal`];function kYt(){let e=lh([`environment`]),{answers:t,task:n,retry:r}=b7(),{deploymentDevPortalUrl:i}=CYt(),a=t.saved.status===`applied`,o=n?.state===`error`,s=C_($j(e.environment.name,{refetchInterval:4e3})).data?.data?.at(-1)?.stages??[],c=s.find(e=>e.stage===`dev-portal`),l=s.some(e=>e.status===`failed`),u=a&&!l&&c?.status===`success`,d=c?.url??i;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(g7,{children:`Your gateway is configured.`}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border bg-neutral-50 px-4 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[o||l?(0,W.jsx)(th,{className:`size-4 shrink-0 text-destructive`}):u?(0,W.jsx)(Em,{className:`size-4 shrink-0 text-emerald-600`}):(0,W.jsx)(Km,{className:`size-4 shrink-0 animate-spin text-zuplo-500`}),o?`Couldn't save your changes`:a?l?`The deploy hit a problem`:u?`Your developer portal is ready`:`Building your developer portal…`:`Saving your changes…`]}),(0,W.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:OYt.map(e=>(0,W.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(qz,{status:s.find(t=>t.stage===e)?.status??`in-progress`}),(0,W.jsx)(Kz,{stage:e})]},e))})]}),u&&d?(0,W.jsx)(Y,{asChild:!0,size:`lg`,variant:`outline`,className:`border-zuplo-500 bg-white font-bold text-blue-600 hover:bg-blue-50 hover:text-blue-700`,children:(0,W.jsxs)(`a`,{href:d,target:`_blank`,rel:`noreferrer`,children:[`Open developer portal`,(0,W.jsx)(Pm,{size:16})]})}):o?(0,W.jsx)(Y,{variant:`outline`,size:`lg`,onClick:r,children:`Retry saving your changes`}):(0,W.jsxs)(Y,{variant:`outline`,size:`lg`,disabled:!0,children:[(0,W.jsx)(Km,{className:`size-4 animate-spin`}),`Saving your changes…`]})]})}function AYt(e){return{apiTypes:[],rest:_7,graphqlUrl:`https://api.rickandmorty.zuplo.io/v1/graphql`,graphql:_7,mcpUrl:`https://api.rickandmorty.zuplo.io/v1/mcp`,mcp:_7,selectedPolicies:[],apiKeyDraft:{keyName:`test-key`,managerEmail:e},rateLimitDraft:{period:`minute`,requests:1},apiKey:_7,rateLimit:_7,saved:_7,committed:!1}}var jYt=`/graphql`,MYt=`/mcp`;function x7(e){try{let t=new URL(e.trim());return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function S7(e,t,n){return e.openApiManager.operationArray?.some(e=>e.additionalOperationContext.path===t&&e.additionalOperationContext.method===n)??!1}async function NYt(e,t){let n=e.openApiManager;if(t.restMode===`import`&&t.restImport)n.updateOpenApiData(t.restImport.doc);else if(t.restMode===`todo-template`)for(let t of v5e())S7(e,t.path,t.method)||n.addOperation(t.path,t.method,t.operation,{avoidConflict:!0});t.apiTypes.includes(`GraphQL`)&&t.graphql.status!==`skipped`&&x7(t.graphqlUrl)&&!S7(e,`/graphql`,`post`)&&(RW(e.policyManager),n.addOperation(jYt,`post`,h5e(t.graphqlUrl.trim()),{avoidConflict:!0})),t.apiTypes.includes(`MCP`)&&t.mcp.status!==`skipped`&&x7(t.mcpUrl)&&!S7(e,`/mcp`,`post`)&&(n.addOperation(MYt,`post`,g5e({url:t.mcpUrl.trim()}),{avoidConflict:!0}),await e.ensureMcpRuntime())}var PYt=async({answers:e,patch:t,services:n,setProgress:r})=>{if(e.saved.status===`applied`)return;r({label:`Saving your changes…`}),e.committed||(await NYt(n,e),xYt(n,e),t({committed:!0}));let{buildId:i}=await SYt(n);t({saved:rYt({buildId:i})})};function C7(e){let t=e.restMode===`import`&&!!e.restImport||e.restMode===`todo-template`,n=e.apiTypes.includes(`GraphQL`)&&e.graphql.status!==`skipped`&&x7(e.graphqlUrl),r=e.apiTypes.includes(`MCP`)&&e.mcp.status!==`skipped`&&x7(e.mcpUrl);return t||n||r}var FYt=`50`,IYt=[`JSON`,`YML`,`YAML`];function LYt({onFileParsed:e,disabled:t}){let[n,r]=(0,g.useState)();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(k0e,{handleChange:async t=>{r(void 0);try{let n=await K3e(t);e(t.name,n)}catch(e){r(e instanceof Error?e.message:`Could not parse the file.`)}},name:`file`,types:IYt,maxSize:FYt,disabled:t,children:(0,W.jsxs)(`div`,{className:G(`flex h-40 w-full flex-col items-center justify-center gap-1 rounded-md border border-dashed border-neutral-400 bg-neutral-50 text-sm`,t?`opacity-50`:`cursor-pointer`),children:[(0,W.jsx)(`div`,{children:`Drag your OpenAPI file here, or click to choose.`}),(0,W.jsxs)(`div`,{className:`text-muted-foreground`,children:[`JSON, YML and YAML are supported (max `,FYt,`MB).`]})]})}),n&&(0,W.jsxs)(`div`,{className:`text-sm text-destructive`,children:[`Parsing error: `,n]})]})}function RYt({name:e,doc:t}){let n=SV(e,t.paths);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`text-sm`,children:[`Importing `,(0,W.jsx)(`span`,{className:`font-medium`,children:e}),` —`,` `,n.length,` operation`,n.length===1?``:`s`,`.`]}),(0,W.jsx)(`div`,{className:`flex max-h-72 flex-col gap-2 overflow-y-auto rounded-md bg-neutral-50 p-3 text-sm`,children:n.map(e=>(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`w-14 shrink-0`,children:(0,W.jsx)(EV,{method:e.additionalOperationContext.method,className:`px-0`})}),(0,W.jsx)(`span`,{className:`truncate`,children:e.additionalOperationContext.path})]},`${e.additionalOperationContext.method}-${e.additionalOperationContext.path}`))})]})}var zYt=(e,t)=>`z${e}-${t}`.toLowerCase().replaceAll(`_`,`-`),BYt=(e,t)=>wj(X.projects(e),{throwOnError:!0,extractData:!0,...t}),VYt=e=>oFe(e.map(e=>X.projects(e)),{extractData:!0}),HYt=(e,t)=>wj(X.project(e,t)),UYt=(e,t)=>{let n=xj();return T_({mutationFn:async()=>{await n.fetch(bj.projects.deleteProject(e,t))}})},WYt=e=>{let t=xj();return T_({mutationFn:async n=>{await t.fetch(bj.projects.createRepoFromProject(e,n.projectName,n.orgName,n.repositoryName,n.defaultBranch,n.otherParams))}})},GYt=(e,t)=>{let n=xj();return T_({mutationFn:async r=>await n.fetch(bj.projects.connectProjectToRepo(e,t,r.orgName,r.repositoryURL,r.defaultBranch,r.forceConnect))})},KYt=(e,t)=>{let n=xj();return T_({mutationFn:async()=>{await n.fetch(bj.projects.disconnectProjectFromRepo(e,t))}})},qYt=(e,t)=>{let n=xj();return T_({mutationFn:async r=>{await n.fetch(bj.projects.updateDefaultBranch({accountName:e,projectName:t,defaultBranch:r.defaultBranch,sourceRepoUrl:r.sourceRepoUrl}))}})};function JYt(e,t){return`https://dev.zuplo.com/v1/accounts/${e}/key-buckets/${t}`}var YYt=()=>{let e=lh([`account`,`project`]),t=HYt(e.account.name,e.project.name),n=e.project.id;return{...t,data:t.data?.defaultConfiguration.flatMap(t=>t.apiKeyBucket?{name:zYt(e.project.id,t.environmentType),id:t.apiKeyBucket,url:JYt(n,zYt(n,t.environmentType)),env:t.environmentType}:[]).sort((e,t)=>t.env.localeCompare(e.env))}},XYt=()=>{let e=xj(),t=Zj();return T_({mutationFn:t=>e.fetch(bj.consumers.createConsumer(t)),onSuccess:()=>t.onSuccess(`Consumer created`),onError:t.onError})},ZYt=`/config/routes.oas.json`,QYt=`/config/policies.json`,$Yt=`/modules/zuplo.runtime.ts`;function eXt(){let e=dh.getState(),t=[];for(let n of e.projectTreeNodes){let r=n.path?e.filesByPath[n.path]:void 0;r&&r.saveState===ei.modified&&t.push(r)}return t}var tXt=(0,g.createContext)(null),nXt=tXt.Provider;function rXt(){let e=(0,g.useContext)(tXt);if(!e)throw Error(`useApiGatewayServices must be used within an ApiGatewayServicesProvider`);return e}function iXt(){let e=lh([`account`,`project`,`environment`]),{email:t}=_oe(),n=Vj(ZYt),r=Vj(QYt),i=Vj($Yt),a=Bj(),o=XYt(),s=Ij(),c=Rj(),{editStrategies:l}=MX(),u=YYt(),d=(0,g.useMemo)(()=>n&&n.content!==void 0?new wV(n,a):void 0,[n,a]),f=(0,g.useMemo)(()=>r&&r.content!==void 0&&n&&n.content!==void 0?new BW(r,[n],a):void 0,[r,n,a]),p=e.account.name,m=e.project.name,h=e.environment.name,_=u.data?.find(e=>e.env===VA.WORKING_COPY)?.id;return(0,g.useMemo)(()=>!d||!f?null:{openApiManager:d,policyManager:f,userEmail:t??``,allOperationIdentifiers:()=>f.getAllOperations().map(e=>({filePath:e.additionalOperationContext.oasFilePath,path:e.additionalOperationContext.path,method:e.additionalOperationContext.method})),createConsumer:async({keyName:e,managerEmail:t})=>_?(await o.mutateAsync({bucketId:_,accountName:p,projectName:m,environmentType:VA.WORKING_COPY,consumer:{sub:e,externalUsers:[{email:t}]}}),{created:!0}):{created:!1},ensureMcpRuntime:async()=>{if(i?.content!==void 0)return;let e=l.find(e=>e.folderName===`/modules`&&`createExtensions`in e);e&&await c(`zuplo.runtime`,`/modules`,void 0,e,w5e)},save:async()=>{let e=eXt();return e.length===0?{}:{buildId:(await s.mutateAsync({environmentName:h,accountName:p,projectName:m,files:e})).buildId}},commitPolicyToAllRoutes:e=>{let t=dh.getState(),n=t.filesByPath[ZYt],r=t.filesByPath[QYt];if(!n||!r)return;let i=new BW(r,[n],a),o=i.getAllOperations().map(e=>({filePath:e.additionalOperationContext.oasFilePath,path:e.additionalOperationContext.path,method:e.additionalOperationContext.method}));i.getPolicyListEnforced().some(t=>t.name===e.name)?i.applyPolicy(e.name,o):i.createPolicy(e,o)}},[d,f,t,_,i,a,l,c,o,s,p,m,h])}function aXt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`What types of endpoints do you want to manage (add auth, rate-limiting, monetization, etc.)?`}),(0,W.jsx)(XJt,{values:e.apiTypes,onChange:e=>t({apiTypes:e}),options:[{value:`REST`,title:`REST or RESTish`,description:`Traditional endpoints with GET, POST, PUT and basic HTTP semantics.`},{value:`GraphQL`,title:`GraphQL`,description:`A GraphQL POST endpoint.`},{value:`MCP`,title:`MCP Servers`,description:`MCP servers for use by AI.`}]})]})}function oXt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`How do you want to set up your endpoints?`}),(0,W.jsx)(YJt,{value:e.restMode,onChange:e=>t({restMode:e}),options:[{value:`import`,title:`Import an OpenAPI / Swagger document`,description:`Bring your existing API definition.`},{value:`todo-template`,title:`Start from a simple TODO template`,description:`A small REST CRUD API to explore.`},{value:`manual`,title:`Nothing, I'll add routes manually`,description:`Start empty and add routes yourself.`}]})]})}function sXt(){let{answers:e,patch:t}=b7(),n=rXt(),r=e.restImport;return r?(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Your OpenAPI document is ready to review.`}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border bg-neutral-50 px-4 py-3 text-sm`,children:[(0,W.jsxs)(`span`,{children:[`Selected `,(0,W.jsx)(`span`,{className:`font-medium`,children:r.name}),` —`,` `,r.operationCount,` operation`,r.operationCount===1?``:`s`,`.`]}),(0,W.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t({restImport:void 0}),children:`Choose a different file`})]})]}):(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Upload your OpenAPI / Swagger document — we'll show you what gets imported on the next step.`}),(0,W.jsx)(LYt,{onFileParsed:(e,r)=>{let i=r6e(r,new Set(n.openApiManager.operationArray?.map(e=>e.operationId).filter(e=>!!e))),a=SV(e,i.paths).length;t({restImport:{name:e,doc:i,operationCount:a}})}})]})}function cXt(){let{answers:e}=b7(),t=e.restImport;return t?(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Review the operations that will be added to your gateway, then continue.`}),(0,W.jsx)(RYt,{name:t.name,doc:t.doc})]}):(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No file selected — go back and upload an OpenAPI document.`})}function lXt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`What is the URL of your GraphQL endpoint?`}),(0,W.jsx)(jV,{value:e.graphqlUrl,placeholder:`https://example.com/graphql`,onChange:e=>t({graphqlUrl:e.target.value})})]}),e.graphql.status===`applied`&&(0,W.jsxs)(g7,{children:[`GraphQL endpoint added at `,e.graphql.result.path,`.`]})]})}function uXt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`What is the URL of your MCP server?`}),(0,W.jsx)(jV,{value:e.mcpUrl,placeholder:`https://example.com/mcp`,onChange:e=>t({mcpUrl:e.target.value})})]}),e.mcp.status===`applied`&&(0,W.jsxs)(g7,{children:[`MCP endpoint added at `,e.mcp.result.path,`.`]})]})}var dXt=/.+@.+\..+/,fXt={id:`api-gateway-basic`,title:`Set up your API gateway`,initialAnswers:e=>AYt(String(e.params.userEmail??``)),steps:[{id:`api-types`,title:`API types`,Component:aXt,canAdvance:e=>e.apiTypes.length>0||`Pick at least one API type`},{id:`rest-setup`,title:`REST`,isActive:e=>e.apiTypes.includes(`REST`),Component:oXt,canAdvance:e=>e.restMode?!0:`Choose how to set up your endpoints`},{id:`rest-import-upload`,title:`Upload`,isActive:e=>e.apiTypes.includes(`REST`)&&e.restMode===`import`,Component:sXt,canAdvance:e=>e.restImport?!0:`Upload an OpenAPI file to continue`},{id:`rest-import-review`,title:`Review`,isActive:e=>e.apiTypes.includes(`REST`)&&e.restMode===`import`,Component:cXt,canAdvance:e=>e.restImport?!0:`Upload an OpenAPI file first`},{id:`graphql-url`,title:`GraphQL`,isActive:e=>e.apiTypes.includes(`GraphQL`),Component:lXt,skippable:!0,skipLabel:`I'll add it manually`,onSkip:()=>({graphql:nYt}),canAdvance:e=>x7(e.graphqlUrl)||`Enter a valid URL, or skip`},{id:`mcp-url`,title:`MCP`,isActive:e=>e.apiTypes.includes(`MCP`),Component:uXt,skippable:!0,skipLabel:`I'll add it manually`,onSkip:()=>({mcp:nYt}),canAdvance:e=>x7(e.mcpUrl)||`Enter a valid URL, or skip`},{id:`policies`,title:`Policies`,isActive:C7,Component:wYt},{id:`api-key`,title:`API Key`,isActive:e=>C7(e)&&e.selectedPolicies.includes(`api-key`),Component:TYt,canAdvance:e=>e.apiKeyDraft.keyName.trim().length>0&&dXt.test(e.apiKeyDraft.managerEmail)||`Enter a key name and a valid manager email`,onExit:bYt},{id:`rate-limit`,title:`Rate limiting`,isActive:e=>C7(e)&&e.selectedPolicies.includes(`rate-limit`),Component:DYt,canAdvance:e=>e.rateLimitDraft.requests>=1||`Enter at least 1 request`},{id:`success`,title:`Done`,Component:kYt,isFinal:!0,nextLabel:`Go to my project`,onEnter:PYt,ownsStatus:!0,canAdvance:e=>!C7(e)||e.saved.status===`applied`||`Saving your changes…`}]},pXt={[fXt.id]:fXt},mXt=`wizard`;function hXt(){let[e]=WA(mXt);return e?(0,W.jsx)(gXt,{wizardId:e}):null}function gXt({wizardId:e}){let t=lh([`account`,`project`,`environment`]),n=iXt(),[,r]=WA(mXt),i=pXt[e];if(!i||!n)return null;let a={params:{userEmail:n.userEmail},account:t.account.name,project:t.project.name,environment:t.environment.name},o=()=>r(void 0);return(0,W.jsx)(nXt,{value:n,children:(0,W.jsx)(pYt,{definition:i,launch:a,services:n,onClose:o,onComplete:o})})}var _Xt=`/modules/zuplo.runtime.ts`,vXt=`editor-file-tree-open`;function yXt(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(vXt);if(e===null)return null;let t=JSON.parse(e);return typeof t==`boolean`?t:null}catch{return null}}function bXt(){let e=lh(),{editStrategies:t}=MX(),[n,r]=WA(`path`),[i]=WA(`build`),{monaco:a,reloadFiles:o}=C1(),s=zA(o.execute),c=e.environment.name,{isReadOnly:l}=HA(),[u,d]=(0,g.useState)(yXt),f=u??!1,p=e=>{d(e);try{window.localStorage.setItem(vXt,JSON.stringify(e))}catch{}},m=dh(e=>e.projectTreeNodes),h=dh(e=>e.setPendingNewFile),_=`${e.account.name}/${e.project.name}/${e.environment.name}`,[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(_);b!==_&&(x(_),y(!1)),(0,g.useEffect)(()=>{if(v)return;if(n){y(!0);return}if(m.length===0)return;let e=m.find(e=>e.path&&Nie.test(e.path));y(!0),e&&r(e.path)},[n,m,r,v]);let S=m.some(e=>e.path===_Xt),C=m.length===0,w=!n&&(C||!v),T=(e,t)=>{p(!0),h({strategyFolder:e,template:t})},{isError:E,error:D}=C_({queryKey:[`reloadFiles`,e.account.name,e.project.name,e.environment.name],queryFn:async({signal:t})=>(await s.current({accountName:e.account.name,projectName:e.project.name,environmentName:e.environment.name},t),!0),refetchOnWindowFocus:!1,enabled:!!a&&!!c});if(E&&D instanceof Lf)return(0,W.jsx)(`div`,{className:`w-full h-full flex items-center justify-center`,children:(0,W.jsxs)(PS,{className:`max-w-md`,children:[(0,W.jsx)(FS,{children:D.title}),(0,W.jsxs)(IS,{className:`flex flex-col gap-2`,children:[Yj(D),(0,W.jsx)(eDt,{})]})]})});let O=(0,W.jsxs)(fN,{direction:`vertical`,autoSaveId:`bottom-pane`,className:`relative`,children:[(0,W.jsx)(pN,{minSize:10,children:n?(0,W.jsx)(_N,{fallback:e=>(0,W.jsx)(DQe,{...e}),children:(0,W.jsx)(xXt,{})}):w?(0,W.jsx)(SXt,{}):null}),l&&(0,W.jsx)(`a`,{href:`https://zuplo.com/docs/articles/environments`,target:`_blank`,rel:`noreferrer`,children:(0,W.jsx)(`div`,{className:`absolute mx-auto border-zuplo-200 left-0 right-0 bottom-12 bg-zuplo-100 text-zuplo-700 h-8 rounded-full shadow-md border w-36 items-center justify-center flex text-sm font-medium`,children:`Read-only`})}),i!==void 0&&(0,W.jsx)(BJt,{})]});return(0,W.jsxs)(`div`,{className:`flex h-full w-full`,children:[!f&&(0,W.jsxs)(`div`,{className:`flex flex-col items-center bg-surface-sunken border-r shrink-0 w-9 py-1.5 gap-0.5`,children:[(0,W.jsx)(w7,{label:`Expand file tree`,onClick:()=>p(!0),testId:`expand-file-tree`,children:(0,W.jsx)(tie,{size:14})}),(0,W.jsx)(`div`,{className:`my-1 h-px w-5 bg-neutral-200 dark:bg-neutral-700`,"aria-hidden":!0}),!l&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(w7,{label:`New OpenAPI Spec`,onClick:()=>T(`/config`,`OpenAPI Spec`),testId:`sidebar-new-open-api-spec`,children:(0,W.jsx)(vN,{className:`size-3.5`})}),(0,W.jsx)(w7,{label:`New Module`,onClick:()=>T(`/modules`,`Request Handler`),testId:`sidebar-new-module`,children:(0,W.jsx)(Fre,{size:14})}),!S&&(0,W.jsx)(w7,{label:`New Runtime Extension`,onClick:()=>T(`/modules`,`zuplo.runtime.ts`),testId:`sidebar-new-runtime-extension`,children:(0,W.jsx)(hie,{size:14})}),(0,W.jsx)(w7,{label:`New Schema`,onClick:()=>T(`/schemas`,`Schema`),testId:`sidebar-new-schema`,children:(0,W.jsx)(bre,{size:14})})]}),(0,W.jsx)(`div`,{className:`flex-1`}),(0,W.jsx)(`span`,{className:`text-[10px] font-medium text-neutral-500 uppercase tracking-wider select-none pb-1`,style:{writingMode:`vertical-rl`},children:`Files`})]}),f?(0,W.jsxs)(fN,{direction:`horizontal`,autoSaveId:`file-tree`,className:`flex-1 min-w-0`,children:[(0,W.jsx)(pN,{minSize:10,defaultSize:20,className:`bg-surface-sunken min-w-[270px]`,children:(0,W.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between h-10 px-2 border-b shrink-0`,children:[(0,W.jsx)(`span`,{className:`text-xs font-medium text-neutral-600 dark:text-neutral-400 uppercase tracking-wide pl-1`,children:`Files`}),(0,W.jsx)(Y,{variant:`ghost`,size:`icon-xs`,onClick:()=>p(!1),"aria-label":`Collapse file tree`,title:`Collapse file tree`,children:(0,W.jsx)(eie,{size:14})})]}),(0,W.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,W.jsx)(jYe,{directoryStrategies:t})})]})}),(0,W.jsx)(mN,{}),(0,W.jsx)(pN,{minSize:70,children:O})]}):(0,W.jsx)(`div`,{className:`flex-1 min-w-0`,children:O}),(0,W.jsx)(hXt,{})]})}var xXt=()=>{let[e]=WA(`path`);if(!e)throw Error(`Invalid state - FileViewer should not be displayed if no path`);let t=e.toLowerCase();if(t===`/docs/sidebar.json`)return(0,W.jsx)(CGe,{});if(t.includes(`.oas.json`))return(0,W.jsx)(yCt,{});if(t===`/config/policies.json`)return(0,W.jsx)(kTt,{});if(t.endsWith(`.md`)||t.endsWith(`.mdx`)){let e=t.split(`/`),n=e[e.length-1];return(0,W.jsx)(SGe,{fileName:n})}return t.endsWith(`.ts`)||t.endsWith(`.css`)?(0,W.jsx)(rF,{maxHeightVh:100}):t.startsWith(`/schemas`)&&t.endsWith(`.json`)?(0,W.jsx)(rF,{}):t===`/config/dev-portal.json`?(0,W.jsxs)(`div`,{className:`size-full`,children:[(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsx)(NTt,{})}),(0,W.jsx)(rF,{})]}):(0,W.jsx)(rF,{})},SXt=()=>(0,W.jsxs)(`div`,{className:`p-6 flex flex-col gap-2`,"data-test":`editor-loading`,children:[(0,W.jsx)(hN,{className:`w-40 h-4`}),(0,W.jsx)(hN,{className:`w-56 h-4`}),(0,W.jsx)(hN,{className:`w-28 h-4`}),(0,W.jsx)(hN,{className:`w-64 h-4`}),(0,W.jsx)(hN,{className:`w-56 h-4`}),(0,W.jsx)(hN,{className:`w-56 h-4`}),(0,W.jsx)(hN,{className:`w-56 h-4`})]}),w7=({label:e,onClick:t,testId:n,children:r})=>(0,W.jsx)(Mk,{content:e,side:`right`,children:(0,W.jsx)(`button`,{type:`button`,onClick:t,"aria-label":e,"data-test":n,className:`group flex items-center justify-center size-7 rounded-md text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100 hover:bg-neutral-200 dark:hover:bg-neutral-800 transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-zuplo-500`,children:r})});function CXt(){return(0,W.jsxs)(Hje,{children:[(0,W.jsx)(bXt,{}),(0,W.jsx)(TFe,{})]})}var wXt=`/static/img/hero-Ct8-h_EN.svg`,TXt=`/static/img/hero-dark-Z9HfvwEQ.svg`,EXt=[{label:`Monetization`,value:`monetization`,badge:`Beta`,items:[{title:`Monetization Overview`,description:`Learn more about our first-party metering and billing solution built directly into the Zuplo platform.`,icon:ez,link:{href:{web:`https://zuplo.com/docs/articles/monetization/index`,local:`https://zuplo.com/docs/articles/monetization/index`},text:`Read the docs`}},{title:`Monetization Quickstart`,description:`Get up and running with API monetization in minutes using Zuplo's built-in billing and metering.`,icon:iz,link:{href:{web:`https://zuplo.com/docs/articles/monetization/quickstart`,local:`https://zuplo.com/docs/articles/monetization/quickstart`},text:`Get Started`}},{title:`Pricing Models`,description:`Explore the different pricing models available for monetizing your APIs with Zuplo.`,icon:tz,link:{href:{web:`https://zuplo.com/docs/articles/monetization/pricing-models`,local:`https://zuplo.com/docs/articles/monetization/pricing-models`},text:`Read the docs`}}]},{label:`MCP`,value:`mcp`,items:[{title:`Installing the MCP Inspector`,description:`Set up the MCP Inspector locally and start testing your MCP server with ease.`,icon:Oqe,link:{href:{web:`https://zuplo.com/docs/handlers/mcp-server#mcp-inspector`,local:`https://zuplo.com/docs/handlers/mcp-server#mcp-inspector`},text:`Get Started`}},{title:`MCP Quickstart`,description:`Learn how to start using Model Context Protocol to pass context into any model call.`,icon:iz,link:{href:{web:`https://zuplo.com/docs/articles/mcp-quickstart`,local:`https://zuplo.com/docs/articles/mcp-quickstart`},text:`Get Started`}},{title:`Using OAuth with MCP`,description:`Authenticate users securely by integrating OAuth flows into your Model Context Protocol setup.`,icon:Pqe,link:{href:{web:`https://zuplo.com/docs/articles/configuring-auth0-for-mcp-auth`,local:`https://zuplo.com/docs/articles/configuring-auth0-for-mcp-auth`},text:`Get Started`}}]},{label:`Rate Limiting`,value:`rate-limiting`,items:[{title:`Adding Rate Limiting`,description:`Control traffic and protect your APIs by setting up flexible, customizable rate limits.`,icon:tz,link:{href:{web:`https://zuplo.com/docs/articles/step-2-add-rate-limiting`,local:`https://zuplo.com/docs/articles/step-2-add-rate-limiting-local`},text:`Get Started`}},{title:`Complex Rate Limiting`,description:`Implement advanced rules to rate limit by user, IP, plan, or custom logic.`,icon:Tqe,link:{href:{web:`https://zuplo.com/docs/policies/complex-rate-limit-inbound`,local:`https://zuplo.com/docs/policies/complex-rate-limit-inbound`},text:`Get Started`}},{title:`Dynamic Rate Limits`,description:`Set rate limits that adapt in real-time based on headers, tokens, or user context.`,icon:Mqe,link:{href:{web:`https://zuplo.com/examples/dynamic-rate-limits`,local:`https://zuplo.com/examples/dynamic-rate-limits`},text:`Get Started`}}]},{label:`Authentication`,value:`authentication`,items:[{title:`Using API Keys`,description:`Authenticate and manage access to your APIs with simple, secure API key workflows.`,icon:Lqe,link:{href:{web:`https://zuplo.com/docs/policies/api-key-inbound`,local:`https://zuplo.com/docs/policies/api-key-inbound`},text:`Get Started`}},{title:`Using Auth0`,description:`Connect your APIs to Auth0 for streamlined authentication and powerful identity management.`,icon:Vqe,link:{href:{web:`https://zuplo.com/docs/policies/auth0-jwt-auth-inbound`,local:`https://zuplo.com/docs/policies/auth0-jwt-auth-inbound`},text:`Get Started`}},{title:`Using Okta`,description:`Integrate Okta with your APIs to enable secure, enterprise-grade authentication and authorization.`,icon:jqe,link:{href:{web:`https://zuplo.com/docs/policies/okta-jwt-auth-inbound`,local:`https://zuplo.com/docs/policies/okta-jwt-auth-inbound`},text:`Get Started`}}]},{label:`Dev Portal`,value:`dev-portal`,items:[{title:`Setup your API Reference`,description:`Instantly generate an interactive reference by importing your OpenAPI spec—no manual work needed.`,icon:wqe,link:{href:{web:`https://zuplo.com/docs/dev-portal/zudoku/configuration/api-reference`,local:`https://zuplo.com/docs/dev-portal/zudoku/configuration/api-reference`},text:`Get Started`}},{title:`Adding Authentication`,description:`Guide users through secure API access by adding auth flows to your developer portal.`,icon:Iqe,link:{href:{web:`https://zuplo.com/docs/dev-portal/zudoku/configuration/authentication`,local:`https://zuplo.com/docs/dev-portal/zudoku/configuration/authentication`},text:`Get Started`}},{title:`Creating API Catalogs`,description:`Organize your APIs into searchable, user-friendly catalogs for easier discovery and onboarding.`,icon:ez,link:{href:{web:`https://zuplo.com/docs/dev-portal/zudoku/guides/using-multiple-apis`,local:`https://zuplo.com/docs/dev-portal/zudoku/guides/using-multiple-apis`},text:`Get Started`}}]}],DXt=({mode:e=`web`})=>(0,W.jsxs)(eP,{defaultValue:`monetization`,className:`flex flex-col my-8`,children:[(0,W.jsx)(tP,{className:`flex gap-8 border-b border-gray-200 dark:border-neutral-700 mb-8 ml-1`,children:EXt.map(e=>(0,W.jsxs)(nP,{value:e.value,className:`relative py-2 text-sm font-medium text-gray-600 dark:text-neutral-400 hover:text-gray-900 dark:hover:text-neutral-100 data-[state=active]:text-gray-900 dark:data-[state=active]:text-neutral-100 border-b-2 border-transparent data-[state=active]:border-black dark:data-[state=active]:border-white transition-colors`,children:[e.label,`badge`in e&&e.badge&&(0,W.jsx)(LS,{variant:`invert`,className:`ml-2`,children:e.badge})]},e.value))}),EXt.map(t=>(0,W.jsx)(rP,{value:t.value,className:`grid grid-cols-3 gap-4`,children:t.items.map(t=>(0,W.jsxs)(lV,{className:`flex flex-col gap-2 text-muted-foreground`,children:[(0,W.jsxs)(uV,{className:`flex gap-2`,children:[(0,W.jsx)(t.icon,{size:24,weight:`duotone`,className:`[&_[opacity='0.2']]:fill-pink-500`}),(0,W.jsx)(dV,{className:`gap-x-2 text-lg font-semibold`,children:t.title})]}),(0,W.jsx)(pV,{className:`text-md`,children:t.description}),(0,W.jsx)(mV,{className:`flex-1 items-end! border-0 mb-4`,children:(0,W.jsx)(Y,{variant:`outline`,className:`w-full`,asChild:!0,children:(0,W.jsx)(oT,{href:t.link.href[e],variant:`ghost`,children:t.link.text})})})]},t.title))},t.value))]}),OXt=({title:e,url:t,className:n})=>{let{copyToClipboard:r,state:i}=lO(t??``);return(0,W.jsxs)(lV,{className:G(`col-span-full md:col-span-5 py-2 px-4 flex items-center text-sm gap-x-2`,n),children:[(0,W.jsx)(`div`,{className:`bg-green-600 rounded-full w-4 h-4 p-0.5`,children:(0,W.jsx)(vm,{className:`text-white`,size:12})}),(0,W.jsx)(`span`,{className:`font-semibold`,children:e}),(0,W.jsx)(`div`,{className:`flex-1`,children:t?(0,W.jsx)(oT,{href:t,className:`ml-2 font-medium line-clamp-1 break-all`,children:t}):(0,W.jsx)(hN,{className:`ml-2 h-4 w-8/12`})}),(0,W.jsx)(Y,{variant:`secondary`,size:`sm`,onClick:r,children:(0,W.jsxs)(Pk,{loading:i===`copied`,alternative:(0,W.jsx)(vm,{size:12,className:`text-green-600`,strokeWidth:3}),className:`flex`,children:[(0,W.jsx)(Mm,{size:16,className:`mr-2`,strokeWidth:1.5}),`Copy URL`]})})]})},kXt=({size:e=24,...t})=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,fill:`none`,viewBox:`0 0 16 16`,...t,children:(0,W.jsx)(`path`,{fill:`#000`,d:`m7.47 12.412 3.348-.592.031-.007-1.722-2.049a291.474 291.474 0 0 1-1.723-2.058c0-.01 1.779-4.909 1.789-4.926a788.95 788.95 0 0 1 2.934 5.066l2.95 5.115.023.039-10.948-.001 3.317-.587zM.9 11.788c0-.003.811-1.412 1.803-3.131L4.507 5.53l2.102-1.764C7.765 2.797 8.714 2 8.717 2a.37.37 0 0 1-.033.085L6.4 6.981l-2.24 4.808-1.63.002c-.897.001-1.63 0-1.63-.003z`})}),AXt=({className:e,size:t=24})=>(0,W.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,className:e,children:(0,W.jsx)(`path`,{d:`M.778 1.211c-.424-.006-.772.334-.778.758 0 .045.002.09.01.134l3.263 19.811c.084.499.515.867 1.022.872H19.95c.382.004.708-.271.77-.646l3.27-20.03c.068-.418-.216-.813-.635-.881-.045-.008-.089-.011-.133-.01L.778 1.211zM14.52 15.528H9.522L8.17 8.464h7.561l-1.211 7.064z`})}),jXt=({className:e,size:t=24})=>(0,W.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,className:e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 2C6.477 2 2 6.463 2 11.97c0 4.404 2.865 8.14 6.839 9.458.5.092.682-.216.682-.48 0-.236-.008-.864-.013-1.695-2.782.602-3.369-1.337-3.369-1.337-.454-1.151-1.11-1.458-1.11-1.458-.908-.618.069-.606.069-.606 1.003.07 1.531 1.027 1.531 1.027.892 1.524 2.341 1.084 2.91.828.092-.643.35-1.083.636-1.332-2.22-.251-4.555-1.107-4.555-4.927 0-1.088.39-1.979 1.029-2.675-.103-.252-.446-1.266.098-2.638 0 0 .84-.268 2.75 1.022A9.606 9.606 0 0112 6.82c.85.004 1.705.114 2.504.336 1.909-1.29 2.747-1.022 2.747-1.022.546 1.372.202 2.386.1 2.638.64.696 1.028 1.587 1.028 2.675 0 3.83-2.339 4.673-4.566 4.92.359.307.678.915.678 1.846 0 1.332-.012 2.407-.012 2.734 0 .267.18.577.688.48C19.137 20.107 22 16.373 22 11.969 22 6.463 17.522 2 12 2z`})}),MXt=({className:e,size:t=24})=>(0,W.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,className:e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z`})});function T7({providerName:e,className:t,size:n=24}){switch(e?.toLowerCase()){case`gitlab`:return(0,W.jsx)(MXt,{className:t,size:n});case`bitbucket`:return(0,W.jsx)(AXt,{className:t,size:n});case`azure`:return(0,W.jsx)(kXt,{className:t,size:n});default:return(0,W.jsx)(jXt,{className:t,size:n})}}var NXt=({onSuccess:e}={})=>{let t=xj(),{logEvent:n,captureException:r}=Vg();return T_({mutationFn:async e=>(await t.fetch(bj.accounts.createCustomDomain({accountName:e.accountName,isAlias:e.isAlias,projectName:e.projectName,hostname:e.hostname,deploymentName:e.deploymentName,stage:e.stage}))).json(),onSuccess:(t,r)=>{n(`account-custom-domain-creation-success`,{account:r.accountName}),e?.(t)},onError:e=>{n(`account-custom-domain-creation-failed`),r(e)}})},PXt=()=>{let e=xj();return T_({mutationFn:async t=>{await e.fetch(bj.accounts.editCustomDomain({accountName:t.accountName,projectName:t.projectName,hostname:t.hostname,deploymentName:t.deploymentName}))}})},FXt=()=>{let e=xj();return T_({mutationFn:async t=>{await e.fetch(bj.accounts.deleteCustomDomain({accountName:t.accountName,projectName:t.projectName,hostname:t.hostname,deploymentName:t.deploymentName}))}})},IXt=(e,t)=>wj(X.customDomains(e,t),{extractData:!0}),LXt=(0,g.forwardRef)(({icon:e,label:t,count:n,expanded:r,onToggle:i,children:a},o)=>(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-gray-200 dark:border-neutral-700 bg-surface shadow-xs`,children:[(0,W.jsxs)(`button`,{ref:o,type:`button`,onClick:i,"aria-expanded":r,className:`flex w-full items-center justify-between gap-2 px-3.5 py-2 text-sm transition hover:bg-gray-50 dark:hover:bg-neutral-800`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2 font-medium text-gray-800 dark:text-neutral-200`,children:[(0,W.jsx)(e,{size:14,className:`text-gray-500 dark:text-neutral-400`,strokeWidth:2}),t]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(LS,{variant:`secondary`,size:`sm`,className:`px-1.5 font-mono`,children:n??0}),r?(0,W.jsx)(xm,{size:14,className:`text-gray-500 dark:text-neutral-400`}):(0,W.jsx)(ym,{size:14,className:`text-gray-400 dark:text-neutral-500`})]})]}),r?(0,W.jsx)(`div`,{className:`border-t border-gray-100 dark:border-neutral-800`,children:a}):null]}));LXt.displayName=`ExpandableNode`;var RXt=({selected:e,onChange:t,options:n,listLabel:r,className:i,classNameOptions:a,testId:o,placeholder:s,matchWidth:c=!0,selectorElement:l,disabled:u,labelPrefixElement:d=null,isLoadingData:f=!1})=>(0,W.jsxs)($B,{value:e,onChange:t,disabled:u,children:[r&&(0,W.jsx)($B.Label,{className:`block text-sm font-medium text-gray-700`,children:r}),(0,W.jsxs)(`div`,{className:(0,EP.default)({relative:c},i),children:[(0,W.jsxs)($B.Button,{"data-test":o,className:(0,EP.default)(`w-full relative`,`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-background 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`,u?`bg-gray-200`:`bg-white`,i),children:[e?.icon&&(0,W.jsx)(`span`,{className:`absolute pr-10`,children:f?(0,W.jsx)(IL,{className:`w-4 h-4 mr-2`,borderPositionAndSize:`border-l-2`}):e.icon}),(0,W.jsxs)(`span`,{className:(0,EP.default)(`block truncate`,{"ml-7":e?.icon}),children:[d,e?.label??s]}),(0,W.jsx)(`span`,{className:`flex items-center pointer-events-none`,children:l??(0,W.jsx)(Sm,{className:`h-5 w-5 text-gray-400`,"aria-hidden":`true`})})]}),(0,W.jsx)(sV,{as:g.Fragment,leave:`transition ease-in duration-100`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,W.jsx)($B.Options,{className:(0,EP.default)(`absolute z-20 mt-1 bg-white shadow-lg rounded-md py-1 text-base border overflow-auto focus:outline-hidden sm:text-sm`,a),children:n.map((t,n)=>(0,W.jsx)($B.Option,{"data-test":`${o}-${n}`,className:({active:e})=>(0,EP.default)(e?`bg-gray-50`:``,t.disabled?`cursor-not-allowed`:`cursor-pointer`,`text-gray-900 select-none relative py-2 px-3`),value:t,disabled:t.disabled??!1,children:t.description?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`font-semibold block text-sm leading-7`,children:t.label}),(0,W.jsx)(`span`,{className:`text-xs`,children:t.description})]}):(0,W.jsxs)(`div`,{className:`flex flex-row font-normal items-center`,children:[t.icon&&(0,W.jsx)(`div`,{children:t.icon}),` `,(0,W.jsx)(`div`,{children:t.label}),t.icon&&e&&e.value.toString()===t.value.toString()&&(0,W.jsx)(`div`,{className:`absolute right-0`,children:(0,W.jsx)(vm,{className:`mr-3 h-5 w-5`})})]})},`${n}-${t.value}`))})})]})]});function zXt(e,t=500){let[n,r]=(0,g.useState)(e);return(0,g.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>{clearTimeout(n)}},[e,t]),n}var BXt=({projects:e,isLoadingProjects:t,selectedProject:n,onProjectChange:r})=>(0,W.jsx)(RXt,{testId:`project-selector`,placeholder:`Select Project`,options:(e||[]).map(e=>({label:e.name,value:e.id,icon:(0,W.jsx)(zm,{className:`mr-1.5`,size:16})})),selected:n,onChange:r,className:`flex-1 items-center w-full h-9`,isLoadingData:t});function E7({title:e,className:t}){return(0,W.jsx)(`div`,{className:G(`text-2xl font-medium`,t),children:e})}var VXt=({showHeader:e})=>(0,W.jsxs)(W.Fragment,{children:[e&&(0,W.jsx)(E7,{title:`Source Control Settings`}),(0,W.jsxs)(`div`,{className:`w-full sm:max-w-md md:max-w-2xl lg:max-w-5xl animate-pulse`,children:[e&&(0,W.jsx)(`div`,{className:`h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 mb-9 mt-7 w-[650px]`}),(0,W.jsxs)(`div`,{className:`flex flex-col md:flex-row lg:flex-row sm:gap-4`,children:[(0,W.jsx)(`div`,{className:`inline-block w-full max-w-sm md:max-w-xs mr-4 h-10 bg-gray-200 rounded-md dark:bg-gray-700`}),(0,W.jsx)(`div`,{className:`inline-block w-full max-w-sm md:max-w-xs mr-4 h-10 bg-gray-200 rounded-md dark:bg-gray-700`}),(0,W.jsx)(`div`,{className:`inline-block w-full max-w-sm md:max-w-xs right-0 h-10 bg-gray-200 rounded-md dark:bg-gray-700`})]}),(0,W.jsx)(`div`,{className:`h-5 mt-5 mb-3`,children:(0,W.jsx)(`div`,{className:`h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 mb-9 mt-7 w-[650px]`})}),(0,W.jsx)(`div`,{className:`mt-5 h-96 relative bg-gray-200 rounded-md dark:bg-gray-700`})]})]}),D7=`GITLAB`,O7=`GITHUB`,k7=`BITBUCKET`,A7=`AZURE`,HXt=({installUrl:e,selectedOrg:t,projectName:n,className:r,provider:i=O7,disabled:a})=>{let{logEvent:o}=Vg(),[s,c]=(0,g.useState)(!1),l=e=>{o(`source-control-create-repo-continue-clicked`,{sourceControlNamespace:e??`none`,sourceControlProvider:i,project:n});let t;switch(i){case A7:t=e?`https://dev.azure.com/${e}/_createproject`:`https://dev.azure.com/`;break;case D7:t=e?`https://gitlab.com/projects/new?namespace_id=${e}`:`https://gitlab.com/projects/new`;break;case k7:t=e?`https://bitbucket.org/repo/create?owner=${e}`:`https://bitbucket.org/repo/create`;break;default:t=e===null?`https://github.com/new?name=${n}&description=Zuplo%20API%20Gateway`:`https://github.com/organizations/${e}/repositories/new?owner=${e}&name=${n}&description=Zuplo%20API%20Gateway`;break}window.open(t),c(!1)};return(0,W.jsxs)(kA,{open:s,onOpenChange:c,children:[(0,W.jsx)(AA,{asChild:!0,children:(0,W.jsx)(Y,{className:r,disabled:a,children:`Create new repository`})}),(0,W.jsxs)(MA,{className:`max-w-xl! w-full`,children:[(0,W.jsxs)(NA,{children:[(0,W.jsx)(FA,{children:`Create new repository`}),(0,W.jsx)(IA,{})]}),(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`We're about to help you create a new repository in`,` `,Jj(i),`.`]}),(0,W.jsxs)(`div`,{className:`rounded-md bg-muted/50 p-3 text-sm space-y-2 border`,children:[(0,W.jsx)(`p`,{className:`font-medium`,children:`What you'll need to do:`}),i===`AZURE`&&(0,W.jsxs)(`ul`,{className:`list-disc list-inside space-y-1 text-muted-foreground`,children:[(0,W.jsx)(`li`,{children:`Create a project and repository in Azure DevOps`}),(0,W.jsx)(`li`,{children:`Return to Zuplo to connect it`})]}),i===`GITHUB`&&(0,W.jsxs)(`ul`,{className:`list-disc list-inside space-y-1 text-muted-foreground`,children:[(0,W.jsx)(`li`,{children:`Create your new repository on GitHub`}),(0,W.jsxs)(`li`,{children:[`Ensure the`,` `,(0,W.jsx)(oT,{href:e,children:`Zuplo GitHub App`}),` `,`has access to your new repo`]}),(0,W.jsx)(`li`,{children:`Return to Zuplo to see and connect it`})]}),(i===`GITLAB`||i===`BITBUCKET`)&&(0,W.jsxs)(`ul`,{className:`list-disc list-inside space-y-1 text-muted-foreground`,children:[(0,W.jsxs)(`li`,{children:[`Create your repository in `,Jj(i)]}),(0,W.jsx)(`li`,{children:`Return to Zuplo to connect it`})]})]}),(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Need help?`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/source-control`,children:`View our troubleshooting guide`})]})]}),(0,W.jsx)(PA,{children:(0,W.jsxs)(Y,{"data-test":`navigate-new-${i.toLowerCase()}-repo`,onClick:()=>l(t),children:[`Continue to `,Jj(i)]})})]})]})},UXt=({accountName:e,projectName:t,orgName:n,repositoryUrl:r,provider:i,handleErrors:a})=>{let{logEvent:o,captureException:s}=Vg(),[c,l]=(0,g.useState)(!1),u=GYt(e,t),d=async(n,r,d)=>{try{if(n===null)throw Error(`Invalid ${Jj(i)} account/organization selected, please try again.`);if(r===null)throw Error(`Invalid repository selected, please try again.`);let s=await(await u.mutateAsync({orgName:n,repositoryURL:r,defaultBranch:`main`,forceConnect:d},{onError:r=>{let i=Yj(r);a(i),o(`source-control-repo-connection-failed`,{account:e,project:t,sourceControlNamespace:n,errorMessage:i})}})).json();s.connected===!1&&s.emptyRepository===!1?l(!0):c&&l(!1),s.connected&&o(`source-control-repo-connected`,{account:e,project:t,sourceControlNamespace:n})}catch(r){s(r);let i=Yj(r);o(`source-control-repo-connection-failed`,{account:e,project:t,sourceControlNamespace:n,errorMessage:i}),a(i),c&&l(!1)}};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(dX,{open:c,onOpenChange:l,title:`Connecting project to repository`,description:`The repository you picked is not empty. Connecting will just create an association between this project and the repo. No changes will be pushed or pulled — you must do that manually using the ${Jj(i)} button. Do you still want to connect?`,actionLabel:`Connect`,isPending:u.isPending,onConfirm:()=>d(n,r,!0)}),(0,W.jsx)(Y,{"data-test":`connect-repo-button`,variant:`outline`,size:`sm`,onClick:()=>d(n,r,!1),children:(0,W.jsx)(Pk,{variant:`primary`,loading:u.isPending,children:`Connect`})})]})},WXt=({repositories:e,account:t,project:n,selectedNamespace:r,provider:i,maxItems:a=5,onConnectError:o})=>{let s=i===`azure`;return(0,W.jsx)(W.Fragment,{children:e.slice(0,a).map((e,a)=>(0,W.jsxs)(`div`,{className:(0,EP.default)(`flex flex-row items-center justify-center h-16 border-gray-300 px-5 lg:gap-5 gap-2`,{"border-t":a!==0}),children:[(0,W.jsxs)(`div`,{className:`flex text-sm flex-1 gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col flex-1`,children:[(0,W.jsx)(`span`,{className:`font-medium line-clamp-1`,children:e.name}),s&&e.metadata?.projectName?(0,W.jsxs)(`span`,{className:`text-gray-400 text-xs`,children:[`Project: `,e.metadata.projectName]}):(0,W.jsxs)(`span`,{className:`text-gray-400 hidden md:inline-block lg:inline-block`,children:[`Updated on`,` `,new Date(e.updatedAt).toLocaleDateString([],{day:`numeric`,month:`short`,year:`numeric`})]})]}),e.private&&(0,W.jsxs)(`div`,{className:`flex justify-center items-center text-gray-400 gap-1`,children:[(0,W.jsx)(qm,{className:`h-4 w-4`,"aria-hidden":`false`,"aria-label":`Private Git repository`}),(0,W.jsx)(`span`,{className:`hidden lg:block`,children:`Private Repository`})]})]}),(0,W.jsx)(UXt,{accountName:t.name,projectName:n.name,orgName:r?.label||``,repositoryUrl:e.url,provider:i,handleErrors:o})]},e.id))})},GXt={[O7]:{name:`GitHub`,icon:(e=20)=>(0,W.jsx)(jXt,{className:`mr-1.5`,size:e}),supportsProjects:!1,placeholder:{namespace:`Select GitHub Account`,search:`Search repositories`},messages:{noRepoAtHand:`No repository at hand? We can help you create a new one.`,selectAccount:`Make sure to select a Git account or organization on the top left.`,grantAccess:`Make sure to grant Zuplo access to the Git account & its repositories you'd like to connect to.`}},[A7]:{name:`Azure DevOps`,icon:(e=20)=>(0,W.jsx)(kXt,{className:`mr-1.5`,size:e}),supportsProjects:!0,placeholder:{namespace:`Select Organization`,project:`Select Project`,search:`Search repositories`},messages:{noRepoInProject:`No repository in this project? Create a new one.`,noRepoAtHand:`No project at hand? We can help you create one.`,selectAccount:`Please select a project to view repositories.`,grantAccess:`No repositories in this project yet.`}},[D7]:{name:`GitLab`,icon:(e=20)=>(0,W.jsx)(Bm,{className:`mr-1.5`,size:e}),supportsProjects:!1,placeholder:{namespace:`Select GitLab Group`,search:`Search repositories`},messages:{noRepoAtHand:`No repository at hand? Create a new one.`,selectAccount:`Select a GitLab group or namespace.`,grantAccess:`Connect your GitLab account to see repositories.`}},[k7]:{name:`Bitbucket`,icon:(e=20)=>(0,W.jsx)(xre,{className:`mr-1.5`,size:e}),supportsProjects:!1,placeholder:{namespace:`Select Bitbucket Project`,search:`Search repositories`},messages:{noRepoAtHand:`No repository at hand? Create a new one.`,selectAccount:`Select a Bitbucket project.`,grantAccess:`Connect your Bitbucket account to see repositories.`}}},KXt=e=>GXt[e]||GXt.GITHUB,j7=({account:e,project:t})=>{let{logEvent:n}=Vg(),r=WYt(e.name),[i,a]=(0,g.useState)(t.name),[o,s]=(0,g.useState)(!1);return{newRepoName:i,setNewRepoName:a,showCreateRepoForm:o,setShowCreateRepoForm:s,createRepoMutation:r,isCreating:r.isPending,handleCreateRepo:async({namespace:o,repoName:c,otherParams:l})=>{let u=c||i||t.name;await r.mutateAsync({projectName:t.name,orgName:o,repositoryName:u,defaultBranch:`main`,otherParams:l}),n(`source-control-repo-created`,{sourceControlRepository:u,sourceControlNamespace:o,account:e.name,project:t.name}),a(``),s(!1)},reset:()=>{s(!1),a(t.name)},transformRepoToRepository:(e,t)=>({id:e.url,url:e.url,provider:t,name:e.name,slug:e.name,defaultBranch:e.defaultBranch,namespace:e.organization,owner:{id:0,name:e.organization},private:!0,updatedAt:new Date().toISOString(),ownerType:e.isUserRepo?`user`:`team`,metadata:e.metadata}),logEvent:n}},qXt=e=>{let{account:t,project:n,sourceControlConfig:r,selectedNamespace:i,searchTerm:a}=e,o=j7(e),[s,c]=(0,g.useState)(null),l=r.provider===A7,{data:u,isLoading:d}=pYe(t.name,i?.value||``,{enabled:l&&!!i}),{data:f,isLoading:p}=dYe(t.name),m=o.transformRepoToRepository;return{repositories:(0,g.useMemo)(()=>!f?.data||!i||!s?[]:(f.data[i.label]||[]).filter(e=>e.metadata?.projectName===s.label).filter(e=>!a||e.name.toLowerCase().includes(a.toLowerCase())).map(e=>m(e,`azure`)),[f,i,s,a,m]),isLoadingRepos:p&&!!s,projects:u?.data,selectedProject:s,isLoadingProjects:d,onProjectChange:e=>{c(e),o.logEvent(`source-control-project-selected`,{account:t.name,project:n.name,sourceControlProvider:r.provider})},reset:()=>{c(null),o.reset()}}},JXt=e=>{let{account:t,sourceControlConfig:n,selectedNamespace:r,searchTerm:i}=e,a=j7(e),o=n.provider===k7,{data:s,isLoading:c,refetch:l}=mYe(t.name,r?r.value:``,i,{enabled:o&&r!==null});return{repositories:s?.repositories||[],isLoadingRepos:c,onCreateRepo:async()=>{if(!r)throw Error(`Please select a project`);await a.handleCreateRepo({namespace:r.value}),l()},reset:a.reset,showCreateRepoForm:a.showCreateRepoForm,setShowCreateRepoForm:a.setShowCreateRepoForm,newRepoName:a.newRepoName,setNewRepoName:a.setNewRepoName,isCreating:a.isCreating}},YXt=e=>{let{account:t,sourceControlConfig:n,selectedNamespace:r,searchTerm:i}=e,a=j7(e),o=n.provider===O7,{data:s,isLoading:c}=mYe(t.name,r?r.value:``,i,{enabled:o&&r!==null});return{...a,repositories:s?.repositories||[],isLoadingRepos:c,reset:a.reset}},XXt=e=>{let{account:t,selectedNamespace:n,searchTerm:r}=e,i=j7(e),{data:a}=fYe(t.name),{data:o,isLoading:s,refetch:c}=dYe(t.name),l=i.transformRepoToRepository;return{repositories:(0,g.useMemo)(()=>{if(!o?.data||!n)return[];let e=a?.find(e=>e.installationId===Number(n.value))?.slug||n.label;return(o.data[e]||[]).filter(e=>!r||e.name.toLowerCase().includes(r.toLowerCase())).map(e=>l(e,`gitlab`))},[o,n,r,a,l]),isLoadingRepos:s,onCreateRepo:async()=>{if(!n)throw Error(`Please select a namespace`);await i.handleCreateRepo({namespace:n.value}),c()},reset:i.reset,showCreateRepoForm:i.showCreateRepoForm,setShowCreateRepoForm:i.setShowCreateRepoForm,newRepoName:i.newRepoName,setNewRepoName:i.setNewRepoName,isCreating:i.isCreating}},ZXt=250,QXt=({account:e,project:t,sourceControlConfig:n})=>{let{logEvent:r}=Vg(),i=n.provider,a=KXt(i),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(null),[u,d]=(0,g.useState)(``),f=zXt(u,ZXt),{data:p,isLoading:m,isFetching:h,error:_}=fYe(e.name),v={account:e,project:t,sourceControlConfig:n,selectedNamespace:c,searchTerm:f},y=qXt(v),b=XXt(v),x=JXt(v),S=YXt(v),C=(()=>{switch(i){case A7:return y;case D7:return b;case k7:return x;default:return S}})();(0,g.useEffect)(()=>{let e=Yj(_);e&&s(e)},[_]),(0,g.useEffect)(()=>{if(p&&p.length>0){let e=p[0];l({label:e.name,value:i===`AZURE`?e.slug:e.installationId.toString(),icon:a.icon(20)})}},[p,i,a]);let w=a=>{if(a.value===`add-github-account`){r(`source-control-add-account-selected`,{sourceControlNamespace:a.value,account:e.name,project:t.name,sourceControlProvider:i}),n.installUrl&&window.open(n.installUrl);return}r(`source-control-namespace-selected`,{sourceControlNamespace:a.value,sourceControlProvider:i,account:e.name,project:t.name}),s(``),l(a),C.reset()},T=[];p?.forEach(e=>{T.push({label:e.name,value:i===`AZURE`?e.slug:e.installationId,icon:a.icon(20)})}),i===`GITHUB`&&T.push({label:`Add GitHub Account`,value:`add-github-account`,icon:(0,W.jsx)(Jm,{className:`mr-1.5`,size:16})});let E=()=>a.supportsProjects&&C.selectedProject?C.repositories.length>0?`Showing ${C.repositories.length} repositories from project: ${C.selectedProject.label}`:a.messages.grantAccess:!a.supportsProjects&&C.repositories.length>0?`Showing ${Math.min(C.repositories.length,5)} repositories`:a.supportsProjects&&!C.selectedProject?a.messages.selectAccount:`Select an account to view repositories`,D=()=>(0,W.jsx)(HXt,{installUrl:n.installUrl??``,selectedOrg:c?.label??``,projectName:t.name,provider:i,className:`w-full md:w-auto`}),O=m||C.isLoadingRepos,k=!a.supportsProjects||C.selectedProject;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(qR,{error:o}),(0,W.jsxs)(`div`,{className:`w-full flex items-center text-sm mt-2 gap-2 justify-center`,children:[(0,W.jsx)(`p`,{className:`flex-1 hidden md:block`,children:a.supportsProjects&&C.selectedProject?a.messages.noRepoInProject:a.messages.noRepoAtHand}),D()]}),O&&c===null&&(0,W.jsx)(VXt,{showHeader:!1}),!m&&(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(RXt,{testId:`namespace-selector`,placeholder:a.placeholder.namespace,options:T,selected:c,onChange:w,className:`flex-1 items-center h-9`,isLoadingData:h}),i===`AZURE`&&c&&(0,W.jsx)(BXt,{projects:C.projects,isLoadingProjects:C.isLoadingProjects||!1,selectedProject:C.selectedProject||null,onProjectChange:C.onProjectChange||(()=>{})}),(0,W.jsxs)(QJ,{className:`flex-2 w-full`,children:[(0,W.jsx)(eY,{value:u,onChange:e=>d(e.target.value),placeholder:a.placeholder.search}),(0,W.jsx)($J,{align:`inline-start`,children:(0,W.jsx)(Xm,{className:`opacity-75`})}),u&&(0,W.jsx)($J,{align:`inline-end`,children:(0,W.jsx)(Y,{variant:`ghost`,size:`icon-sm`,onClick:()=>d(``),children:(0,W.jsx)(nh,{})})})]})]}),(0,W.jsx)(lV,{className:`flex flex-col`,children:C.isLoadingRepos&&k?(0,W.jsxs)(`div`,{className:`flex flex-row items-center p-2 justify-center align-middle h-80`,children:[(0,W.jsx)(IL,{className:`w-4 h-4 mr-2`,borderPositionAndSize:`border-l-2`}),(0,W.jsx)(`span`,{children:`Loading repositories...`})]}):k&&C.repositories.length>0?(0,W.jsx)(WXt,{repositories:C.repositories,account:e,project:t,selectedNamespace:c,provider:i,onConnectError:s}):k?(0,W.jsxs)(`div`,{className:`flex flex-col text-sm text-center gap-2 items-center justify-center h-80`,children:[(0,W.jsx)(`h2`,{className:`text-base`,children:`No Results Found`}),(0,W.jsx)(`p`,{children:u?`Your search for "${u}" did not return any results.`:a.messages.grantAccess})]}):(0,W.jsx)(`div`,{className:`flex items-center justify-center h-80`,children:(0,W.jsx)(`p`,{children:a.messages.selectAccount})})}),(0,W.jsxs)(`div`,{className:`flex whitespace-pre-line text-gray-500 text-sm justify-between gap-4`,children:[(0,W.jsx)(`span`,{children:E()}),(i===`GITHUB`||i===`GITLAB`||i===`BITBUCKET`)&&n.installUrl&&(0,W.jsxs)(oT,{href:n.installUrl,className:`whitespace-pre`,children:[`Adjust `,a.name,` Permissions →`]})]})]})},$Xt=({provider:e,url:t,org:n,name:r,children:i})=>(0,W.jsx)(lV,{className:`flex gap-2 flex-col`,offset:`md`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(T7,{providerName:e}),(0,W.jsx)(`div`,{className:`flex flex-col flex-1`,children:(0,W.jsxs)(`a`,{className:`text-sm font-semibold hover:text-zuplo-pink-hover underline flex gap-1 items-center`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:[n,`/`,r,(0,W.jsx)(Pm,{className:`h-4 w-4`})]})}),i]})}),eZt=({account:e,project:t})=>{let{logEvent:n}=Vg(),r=lh([`account`,`project`]);if(!t.sourceRepoUrl)throw Error(`No sourceRepoUrl on project '${r.account.name}'`);let i=t.sourceRepoUrl.replace(`.git`,``),a,o,s=!1;try{s=new URL(t.sourceRepoUrl).hostname===`dev.azure.com`}catch{s=!1}if(s){let e=t.sourceRepoUrl.match(/^https:\/\/dev\.azure\.com\/([^/]+)\/([^/]+)\/_git\/([^/]+)/);if(e){a=e[1];let t=e[2],n=e[3].replace(`.git`,``);a=`${e[1]}/${t}`,o=n}else{let e=t.sourceRepoUrl.split(`/`);a=e[e.length-2],o=e[e.length-1]}}else{let e=t.sourceRepoUrl.split(`/`);a=e[e.length-2],o=e[e.length-1]}let c=KYt(e.name,t.name),l=async()=>{await c.mutateAsync(),n(`source-control-repo-disconnected`,{account:r.account.name,project:r.project.name})};return(0,W.jsx)($Xt,{org:a,name:o,url:i,provider:t.sourceControlProvider.toLowerCase(),children:(0,W.jsx)(Y,{"data-test":`disconnect-repo-button`,onClick:l,variant:`secondary`,className:`self-end`,disabled:c.isPending,children:(0,W.jsx)(Pk,{className:`flex items-center gap-1`,loading:c.isPending,children:`Disconnect`})})})},tZt=({provider:e,onClose:t})=>{if(!e)return null;let n=Jj(e);return(0,W.jsx)(kA,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,W.jsxs)(MA,{children:[(0,W.jsxs)(NA,{children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(T7,{providerName:e.toLowerCase(),size:28}),(0,W.jsxs)(FA,{children:[n,` Integration`]})]}),(0,W.jsxs)(IA,{className:`pt-2`,children:[n,` source control integration is available on Enterprise plans. Contact our sales team or book a demo to learn more about connecting your `,n,` repositories to Zuplo.`]})]}),(0,W.jsxs)(PA,{className:`mt-2`,children:[(0,W.jsx)(Y,{variant:`outline`,asChild:!0,children:(0,W.jsx)(oT,{href:`mailto:${eC}?subject=${encodeURIComponent(`${n} Source Control Integration`)}`,variant:`ghost`,children:`Contact Sales`})}),(0,W.jsx)(Y,{asChild:!0,children:(0,W.jsx)(oT,{href:$S,variant:`ghost`,children:`Book a Demo`})})]})]})})},nZt=`sourceControlConnect`,rZt=()=>{let{logEvent:e}=Vg(),t=y_(),[n,r]=(0,g.useState)(!1);return{connect:(n,i)=>{let{id:a,provider:o,clientId:s,scopes:c,redirectUri:l,providerUrl:u}=i;e(`source-control-provider-clicked`,{provider:o}),e(`source-control-connect-clicked`,{account:n,sourceControlProvider:o}),localStorage.removeItem(nZt),localStorage.setItem(nZt,`${n}::${a}`),r(!0);let d=i=>{i.key===`sourceControlConnect`&&i.oldValue===`${n}::${a}`&&i.newValue===null&&(e(`source-control-access-granted`,{account:n,sourceControlProvider:o}),r(!1),window.removeEventListener(`storage`,d),t.invalidateQueries({queryKey:[X.accountsSourceControlConfigurations().url],exact:!1}))};if(window.addEventListener(`storage`,d,!1),o===`GITHUB`){let e=c===``?`https://github.com/login/oauth/authorize?client_id=${s}`:`https://github.com/login/oauth/authorize?client_id=${s}&scope=${c}`;window.open(e)}o===`GITLAB`&&window.open(`${u}/oauth/authorize?client_id=${s}&redirect_uri=${l}&response_type=code&scope=${c}`),o===`BITBUCKET`&&window.open(`${u}/site/oauth2/authorize?client_id=${s}&response_type=code`),o===`AZURE`&&window.open(`https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=${s}&redirect_uri=${encodeURIComponent(l)}&response_type=code&response_mode=query&scope=${encodeURIComponent(c)}`)},isConnecting:n}},iZt=({accountName:e,sourceControlConfig:t})=>{let{connect:n,isConnecting:r}=rZt(),{provider:i}=t;return(0,W.jsx)(`div`,{children:(0,W.jsx)(Y,{variant:`outline`,className:`gap-2`,disabled:r,onClick:()=>n(e,t),children:(0,W.jsx)(Pk,{loading:r,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(T7,{providerName:i}),(0,W.jsx)(`span`,{children:`Connect to ${Jj(i)}`})]})})})})},aZt=[{key:D7,label:`GitLab`},{key:k7,label:`Bitbucket`}],oZt=({account:e,project:t,sourceControlConfig:n})=>{let{logEvent:r}=Vg(),[i,a]=(0,g.useState)(null);if(n?.userHasCredentials&&t.sourceRepoUrl)return(0,W.jsx)(eZt,{account:e,project:t});if(n&&!t.sourceRepoUrl&&n.userHasCredentials)return(0,W.jsx)(QXt,{account:e,project:t,sourceControlConfig:n});let o=n?Jj(n.provider):null;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(lV,{offset:`md`,className:`flex flex-col gap-4`,children:[(0,W.jsxs)(`div`,{className:`text-sm whitespace-pre-line text-gray-500`,children:[n&&t.sourceRepoUrl&&(0,W.jsxs)(`p`,{className:`mb-3`,children:[`This project is currently associated with a `,o,` `,`repository but you have not connected to your `,o,` `,`account.`]}),(0,W.jsx)(`p`,{children:`Connect to a source control provider to enable source control on your project.`})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[n&&(0,W.jsx)(iZt,{accountName:e.name,sourceControlConfig:n}),aZt.map(({key:e,label:t})=>(0,W.jsxs)(Y,{variant:`outline`,className:`gap-2`,onClick:()=>{r(`source-control-provider-clicked`,{provider:e}),a(e)},children:[(0,W.jsx)(T7,{providerName:e.toLowerCase(),size:20}),(0,W.jsxs)(`span`,{children:[`Connect to `,t]})]},e))]})]}),(0,W.jsx)(tZt,{provider:i,onClose:()=>a(null)})]})},sZt=()=>wj(X.accountsSourceControlConfigurations()),cZt=()=>{let{account:e,project:t}=lh([`account`,`project`]),{logEvent:n}=Vg();return(0,W.jsxs)(`div`,{className:`flex flex-col space-y-4`,children:[(0,W.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Support`}),(0,W.jsx)(lV,{offset:`md`,className:`p-6`,children:(0,W.jsxs)(`div`,{className:`flex w-full gap-4 items-center`,children:[(0,W.jsx)(`div`,{className:`rounded-lg bg-gray-100 dark:bg-neutral-800 w-20 h-20 grid place-items-center`,children:(0,W.jsx)(rie,{size:38,strokeWidth:1.6,fill:`#FF99E5`,fillOpacity:.2})}),(0,W.jsxs)(`div`,{className:`flex-1`,children:[(0,W.jsx)(dV,{className:`text-base`,children:`Talk to an API expert`}),(0,W.jsx)(fV,{className:`text-md`,children:`Get a free technical consultation with one of our API experts.`})]}),(0,W.jsx)(Y,{onClick:()=>{n(`getting-started-book-a-meeting-clicked`,{account:e.name}),window.open($S,`_blank`)},className:`min-w-40`,variant:`secondary`,asChild:!0,children:(0,W.jsxs)(oT,{href:$S,variant:`ghost`,children:[(0,W.jsx)(Cre,{}),`Book a Meeting`]})})]})}),(0,W.jsx)(lV,{offset:`md`,className:`p-6`,children:(0,W.jsxs)(`div`,{className:`flex w-full gap-4 items-center`,children:[(0,W.jsx)(`div`,{className:`rounded-lg bg-gray-100 dark:bg-neutral-800 w-20 h-20 grid place-items-center`,children:(0,W.jsx)(Gm,{size:38,strokeWidth:1.6,fill:`#FF99E5`,fillOpacity:.2})}),(0,W.jsxs)(`div`,{className:`flex-1`,children:[(0,W.jsx)(dV,{className:`text-base`,children:`Feeling Stuck?`}),(0,W.jsx)(fV,{className:`text-md`,children:`Check out our various support options to get help with your API`})]}),(0,W.jsx)(Y,{className:`min-w-40`,variant:`secondary`,asChild:!0,children:(0,W.jsxs)(Pr,{to:Ce(YR.Support,{account:e.name}),children:[(0,W.jsx)(Gm,{}),`Get Help`]})})]})}),(0,W.jsx)(lV,{offset:`md`,className:`p-6`,children:(0,W.jsxs)(`div`,{className:`flex w-full gap-4 items-center`,children:[(0,W.jsx)(`div`,{className:`rounded-lg bg-gray-100 dark:bg-neutral-800 w-20 h-20 grid place-items-center`,children:(0,W.jsx)(rie,{size:38,strokeWidth:1.6,fill:`#FF99E5`,fillOpacity:.2})}),(0,W.jsxs)(`div`,{className:`flex-1`,children:[(0,W.jsx)(dV,{className:`text-base`,children:`Join the Zuplo API Community`}),(0,W.jsx)(fV,{className:`text-md`,children:`Come chat with fellow Zuplo users and the Zuplo team in our Discord channel.`})]}),(0,W.jsx)(Y,{onClick:()=>{n(`getting-started-join-discord-clicked`,{account:e.name,project:t.name}),window.open(ZS,`_blank`)},className:`min-w-40`,variant:`secondary`,asChild:!0,children:(0,W.jsxs)(oT,{href:ZS,variant:`ghost`,children:[(0,W.jsx)(Yre,{size:16}),`Join Us`]})})]})})]})},lZt=()=>{let{account:e,project:t,environment:n}=Pj([`account`,`project`,`environment`]);return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(uV,{children:[(0,W.jsx)(dV,{className:`text-base`,children:`Welcome to your Gateway`}),(0,W.jsx)(fV,{className:`text-base`,children:`You can get started by configuring your routes and setting up policies in our visual Route Designer.`})]}),(0,W.jsxs)(mV,{className:`border-0 gap-2 py-6`,children:[(0,W.jsx)(Y,{asChild:!0,size:`sm`,className:`gap-2 px-8`,variant:`brand-outline`,children:(0,W.jsxs)(Pr,{to:Ce(YR.Code,{account:e,project:t,environment:n}),children:[(0,W.jsx)(Am,{size:16}),`Start Building`]})}),(0,W.jsx)(Y,{className:`px-8`,variant:`secondary`,size:`sm`,asChild:!0,children:(0,W.jsxs)(oT,{variant:`ghost`,href:`https://zuplo.com/docs/articles/step-1-setup-basic-gateway`,children:[(0,W.jsx)(Lm,{size:16}),`Quickstart`]})})]})]})},uZt=()=>{let[e,t]=(0,g.useState)(!1);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(lV,{className:`col-span-full md:col-span-3 py-2 px-4 flex items-center text-sm gap-x-2`,children:[(0,W.jsx)(`div`,{className:`rounded-full w-4 h-4 p-0.5 bg-gray-500`,children:(0,W.jsx)(km,{className:`text-white`,size:12})}),(0,W.jsx)(`span`,{className:`font-semibold flex-1 line-clamp-1 break-all`,children:`Developer Portal`}),(0,W.jsxs)(Y,{variant:`secondary`,size:`sm`,onClick:()=>t(!0),children:[(0,W.jsx)(Lm,{}),`Open\xA0Portal`]})]}),(0,W.jsx)(kA,{open:e,onOpenChange:t,children:(0,W.jsxs)(MA,{children:[(0,W.jsxs)(NA,{children:[(0,W.jsx)(FA,{children:`Run Developer Portal Locally`}),(0,W.jsx)(IA,{children:`To view and edit your API documentation, you need to run the developer portal locally.`})]}),(0,W.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(`p`,{className:`text-sm font-semibold`,children:`Steps to run the portal:`}),(0,W.jsxs)(`ol`,{className:`list-decimal list-inside space-y-2 text-sm text-gray-600`,children:[(0,W.jsxs)(`li`,{children:[`Open a terminal in the`,` `,(0,W.jsx)(`code`,{className:`bg-gray-100 px-1 rounded-sm`,children:`/docs`}),` `,`folder of your Zuplo project`]}),(0,W.jsxs)(`li`,{children:[`Run`,` `,(0,W.jsx)(`code`,{className:`bg-gray-100 px-1 rounded-sm`,children:`npm run dev`})]}),(0,W.jsx)(`li`,{children:`The portal will open in your browser automatically`})]})]}),(0,W.jsx)(`div`,{className:`bg-blue-50 dark:bg-blue-950/40 border border-blue-200 dark:border-blue-800 rounded-md p-3`,children:(0,W.jsxs)(`p`,{className:`text-xs text-blue-800 dark:text-blue-200`,children:[(0,W.jsx)(`strong`,{children:`Tip:`}),` The developer portal will automatically reload when you make changes to your OpenAPI documentation.`]})})]}),(0,W.jsxs)(PA,{children:[(0,W.jsx)(Y,{variant:`secondary`,onClick:()=>t(!1),children:`Close`}),(0,W.jsx)(Y,{asChild:!0,variant:`outline`,children:(0,W.jsx)(oT,{href:`https://zuplo.com/docs/dev-portal`,children:`View Documentation`})})]})]})})]})},dZt=()=>{let{project:e,environment:t}=lh(),n=uO(t);return(0,W.jsx)(`div`,{className:`bg-neutral-50 dark:bg-neutral-950 h-full overflow-y-auto`,children:(0,W.jsxs)(`div`,{className:`pt-4 max-w-6xl pb-16 m-auto px-5 flex flex-col gap-4`,children:[(0,W.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e.name}),(0,W.jsxs)(`div`,{className:`grid grid-cols-8 gap-3`,children:[(0,W.jsx)(OXt,{title:`Gateway`,url:n}),(0,W.jsx)(uZt,{})]}),(0,W.jsxs)(lV,{className:`relative grid md:grid-cols-2 overflow-hidden min-h-[220px]`,children:[(0,W.jsx)(lZt,{}),(0,W.jsxs)(`div`,{className:`hidden md:block self-end h-full w-full`,children:[(0,W.jsx)(`img`,{src:wXt,alt:e.name,className:`w-full h-full object-cover object-left dark:hidden`}),(0,W.jsx)(`img`,{src:TXt,alt:``,"aria-hidden":!0,className:`hidden w-full h-full object-cover object-left dark:block`})]})]}),(0,W.jsx)(DXt,{mode:`local`}),(0,W.jsx)(cZt,{})]})})},fZt=()=>gP().brand,pZt=((e,...t)=>(...n)=>e(...t,...n))(wj,X.accounts()),mZt=e=>wj(X.accountMemberInvites(e),{extractData:!0}),hZt=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.accounts.deleteAccountMemberInvite(t))})},gZt=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.accounts.resendAccountMemberInvite(t))})},_Zt=({account:e,navigateTo:t})=>{let{data:n,isLoading:r}=BYt(e),i=[...n??[]].sort((e,t)=>e.name.toLowerCase().localeCompare(t.name.toLowerCase()));return r?(0,W.jsx)(X1,{heading:e,forceMount:!0,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,W.jsx)(Km,{className:`h-4 w-4 animate-spin`}),(0,W.jsx)(`span`,{children:`Loading projects...`})]})}):(0,W.jsx)(X1,{heading:e,children:i.map(n=>(0,W.jsxs)(Z1,{value:`${e}/${n.name}`,keywords:[n.name,e],onSelect:()=>t(Ce(YR.Overview,{account:e,project:n.name})),children:[(0,W.jsx)(gm,{className:`mr-3 h-4 w-4 text-neutral-600`}),(0,W.jsx)(`span`,{children:n.name})]},n.id))})},vZt=({accounts:e,navigateTo:t})=>{let n=e?.map(e=>e.name)??[],r=VYt(n),i=(e??[]).map(e=>e.name).sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())),a=n.flatMap((e,t)=>(r[t]?.data??[]).map(t=>({account:e,project:t}))).sort((e,t)=>e.project.name.toLowerCase().localeCompare(t.project.name.toLowerCase()));return(0,W.jsxs)(X1,{children:[i.map(e=>(0,W.jsxs)(Z1,{value:e,keywords:[e],onSelect:()=>t(Ce(YR.AccountProjects,{account:e})),children:[(0,W.jsx)(_m,{className:`mr-3 h-4 w-4 text-neutral-600`}),(0,W.jsx)(`span`,{className:`truncate`,children:e}),(0,W.jsx)(`span`,{className:`ml-auto shrink-0 pl-3 text-xs text-muted-foreground`,children:`Account`})]},`account:${e}`)),a.map(({account:e,project:n})=>(0,W.jsxs)(Z1,{value:`${e}/${n.name}`,keywords:[n.name,e],onSelect:()=>t(Ce(YR.Overview,{account:e,project:n.name})),children:[(0,W.jsx)(gm,{className:`mr-3 h-4 w-4 text-neutral-600`}),(0,W.jsx)(`span`,{className:`truncate`,children:n.name}),(0,W.jsx)(`span`,{className:`ml-auto shrink-0 pl-3 text-xs text-muted-foreground`,children:e})]},n.id))]})},yZt=({accounts:e,navigateTo:t,search:n})=>n.trim()?(0,W.jsx)(vZt,{accounts:e,navigateTo:t}):(0,W.jsxs)(W.Fragment,{children:[e?.map(e=>(0,W.jsx)(_Zt,{navigateTo:t,account:e.name},`projects-${e.name}`)),(0,W.jsx)(X1,{heading:`Accounts`,children:e?.map(e=>(0,W.jsxs)(Z1,{onSelect:()=>{t(Ce(YR.AccountProjects,{account:e.name}))},children:[(0,W.jsx)(_m,{className:`mr-2 h-4 w-4`}),(0,W.jsx)(`span`,{children:e.name})]},e.name))})]}),bZt=({account:e,navigateTo:t,project:n,environment:r})=>(0,W.jsx)(X1,{heading:`Files`,children:dh(e=>e.projectTreeNodes).filter(e=>e.path&&e.type===$r.File).map(i=>(0,W.jsxs)(Z1,{onSelect:()=>t(Ce(`${YR.Code}?path=${i.path}`,{account:e,project:n,environment:r})),children:[(0,W.jsx)(`div`,{className:`mr-3`,children:(0,W.jsx)(Rm,{className:`h-4 w-4 text-neutral-500`})}),(0,W.jsx)(`span`,{className:`line-clamp-1`,children:i.path.substring(1)})]},i.path))}),xZt=e=>e.plan===`FREE_V1`,SZt=({account:e,className:t,source:n})=>{let r=e.customDomainsInUse,i=e.entitlements.customDomains,a=xZt(e),o=`${Ce(YR.AccountSettings,{account:e.name})}/upgrade-billing?source=${n}`;return(0,W.jsxs)(lV,{variant:`default`,className:t,children:[(0,W.jsx)(uV,{children:a?`Custom domains require a paid plan`:`Custom domain limit reached`}),(0,W.jsx)(pV,{className:`text-sm leading-relaxed`,children:a?(0,W.jsx)(`p`,{children:`Custom domains let you serve your APIs and developer portal from your own domain. Upgrade to the Builder plan to add custom domains to your account.`}):(0,W.jsxs)(`p`,{children:[`Your account is using`,` `,(0,W.jsxs)(`span`,{className:`font-medium`,children:[r,` of `,i]}),` `,`custom domains. Contact our team to increase your limit.`]})}),(0,W.jsxs)(mV,{className:`flex flex-wrap items-center gap-2`,children:[a?(0,W.jsx)(Y,{asChild:!0,children:(0,W.jsx)(CX,{variant:`ghost`,to:o,children:`Upgrade to Builder`})}):(0,W.jsx)(Y,{asChild:!0,children:(0,W.jsx)(oT,{href:$S,variant:`ghost`,children:`Contact Sales`})}),(0,W.jsx)(Y,{variant:`outline`,asChild:!0,children:(0,W.jsx)(oT,{href:`https://zuplo.com/pricing?utm_source=pzc`,variant:`ghost`,children:`View Plans`})})]})]})},CZt=({used:e,max:t,label:n,account:r,navigationSource:i,className:a,hideAtLimit:o=!1})=>{if(t<=0)return null;let s=e>=t,c=r.plan.startsWith(`FREE`),l=`${Ce(YR.AccountSettings,{account:r.name})}/upgrade-billing${i?`?source=${i}`:``}`;return s?o?null:(0,W.jsxs)(PS,{variant:`warning`,className:a,children:[(0,W.jsx)(th,{}),(0,W.jsx)(IS,{children:(0,W.jsxs)(`p`,{children:[`You've reached the limit of `,t,` `,n,` on your plan (`,e,` of`,` `,t,` used).`,` `,c?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(CX,{to:l,className:`hover:text-zuplo-pink-hover text-zuplo-pink underline`,children:`Upgrade your plan`}),` `,`to add more.`]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(oT,{href:`mailto:${eC}`,className:`text-zuplo-pink hover:text-zuplo-pink-hover underline`,children:`Contact sales`}),` `,`to increase your limit.`]})]})})]}):(0,W.jsxs)(`p`,{className:G(`text-sm text-muted-foreground`,a),children:[`Using `,e,` of `,t,` `,n,`.`]})},wZt=({className:e})=>(0,W.jsxs)(lV,{variant:`info`,className:e,children:[(0,W.jsx)(uV,{children:`Managed Dedicated Project`}),(0,W.jsx)(pV,{className:`flex-1 leading-loose mt-1 text-sm`,children:(0,W.jsxs)(`p`,{className:`leading-loose`,children:[`This project uses Akamai managed dedicated hosting. Custom domains for Akamai must be configured through Akamai CDN. See`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/dedicated/akamai/cdn`,children:`Akamai custom domain documentation`}),`.`]})})]}),TZt={[VA.PRODUCTION]:`bg-amber-50 text-amber-800 ring-amber-200 dark:bg-amber-900/30 dark:text-amber-200 dark:ring-amber-800/60`,[VA.PREVIEW]:`bg-blue-50 text-blue-700 ring-blue-200 dark:bg-blue-900/30 dark:text-blue-200 dark:ring-blue-800/60`,[VA.WORKING_COPY]:`bg-muted text-muted-foreground ring-border`},EZt=({environmentType:e,className:t})=>{if(!e)return null;let n=e,r=TZt[n];return r?(0,W.jsx)(`span`,{className:G(`inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[10px] font-medium tracking-wide ring-1 ring-inset`,r,t),children:Q1(n)}):null},DZt=[VA.WORKING_COPY,VA.PRODUCTION,VA.PREVIEW],M7=({environments:e,value:t,onValueChange:n,disabled:r,placeholder:i=`Select an environment`,getOptionValue:a=e=>e.name,sentinel:o,className:s,triggerClassName:c,triggerSize:l=`default`,modal:u=!1,showTriggerBadge:d=!0,id:f,...p})=>{let[m,h]=g.useState(!1),_=g.useMemo(()=>{let t=new Map;for(let n of e){if(!n.environmentType)continue;let e=n.environmentType,r=t.get(e)??[];r.push(n),t.set(e,r)}return DZt.flatMap(e=>{let n=t.get(e);return n&&n.length>0?[{type:e,envs:n}]:[]})},[e]),v=g.useMemo(()=>e.find(e=>a(e)===t),[e,t,a]),y=o!=null&&o.value===t,b=()=>y?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(hm,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`truncate text-sm`,children:o?.label})]}):v?(0,W.jsx)(OZt,{env:v,showBadge:d}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:i});return(0,W.jsxs)(kX,{open:m,onOpenChange:h,modal:u,children:[(0,W.jsx)(AX,{asChild:!0,children:(0,W.jsxs)(Y,{id:f,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":m,disabled:r,size:l,className:G(`border-input font-normal w-full justify-between`,c),"data-test":p[`data-test`],children:[(0,W.jsx)(`div`,{className:`flex items-center gap-2 min-w-0 flex-1`,children:b()}),(0,W.jsx)(ym,{className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,W.jsx)(jX,{className:G(`min-w-[320px] w-(--radix-popover-trigger-width) max-w-[480px] p-0 rounded-md shadow-md`,s),side:`bottom`,align:`start`,children:(0,W.jsxs)(K1,{filter:(e,t)=>{let n=e.toLowerCase(),r=t.toLowerCase().trim();return!r||n.startsWith(`__sentinel__`)||n.includes(r)?1:0},children:[(0,W.jsx)(q1,{placeholder:`Search environments...`,className:`h-10`}),(0,W.jsxs)(J1,{className:`max-h-[360px]`,children:[(0,W.jsx)(Y1,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No environments match.`}),o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X1,{children:(0,W.jsxs)(Z1,{value:`__sentinel__ ${o.label}`,onSelect:()=>{n(o.value),h(!1)},className:`flex items-center gap-2.5 px-2.5 py-2 cursor-pointer data-[selected=true]:bg-accent`,children:[(0,W.jsx)(hm,{className:G(`size-3.5 shrink-0`,t===o.value?`text-foreground`:`text-muted-foreground`)}),(0,W.jsx)(`span`,{className:G(`flex-1 truncate text-sm`,t===o.value&&`font-medium`),children:o.label}),(0,W.jsx)(vm,{className:G(`size-4 shrink-0 text-muted-foreground`,t===o.value?`opacity-100`:`opacity-0`)})]})}),_.length>0&&(0,W.jsx)(KEt,{})]}),_.map(({type:e,envs:r})=>(0,W.jsx)(X1,{heading:Q1(e),children:r.map(e=>{let r=a(e);return(0,W.jsx)(kZt,{env:e,isSelected:!y&&r===t,onPick:()=>{n(r),h(!1)}},e.name)})},e))]})]})})]})},OZt=({env:e,showBadge:t})=>{let n=e.environmentType,r=n===VA.WORKING_COPY,i=r?oz:Bm,a=r?`working copy`:e.branchName??e.label;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(i,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsx)(`span`,{className:G(`truncate min-w-0 flex-1 text-sm text-left`,r?``:`font-mono`),children:a}),t&&(0,W.jsx)(EZt,{environmentType:n,className:`ml-1`})]})},kZt=({env:e,isSelected:t,onPick:n})=>{let r=e.environmentType===VA.WORKING_COPY,i=r?oz:Bm,a=r?`working copy`:e.branchName??e.label;return(0,W.jsxs)(Z1,{value:[e.branchName,e.name,e.label,Q1(e.environmentType)].filter(Boolean).join(` `),onSelect:n,className:`flex items-center gap-2.5 px-2.5 py-2 cursor-pointer data-[selected=true]:bg-accent`,children:[(0,W.jsx)(i,{strokeWidth:1.5,className:G(`size-3.5 shrink-0`,t?`text-foreground`:`text-muted-foreground`)}),(0,W.jsx)(`span`,{className:G(`flex-1 min-w-0 truncate text-sm`,r?``:`font-mono`,t&&`font-medium`),children:a}),(0,W.jsx)(vm,{className:G(`size-4 shrink-0 text-muted-foreground`,t?`opacity-100`:`opacity-0`)})]})},N7=`Switch`,[AZt,jZt]=gp(N7),[MZt,NZt]=AZt(N7),PZt=g.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=g.useState(null),m=mp(t,e=>p(e)),h=g.useRef(!1),_=f?u||!!f.closest(`form`):!0,[v,y]=Np({prop:i,defaultProp:a??!1,onChange:l,caller:N7});return(0,W.jsxs)(MZt,{scope:n,checked:v,disabled:s,children:[(0,W.jsx)(Op.button,{type:`button`,role:`switch`,"aria-checked":v,"aria-required":o,"data-state":zZt(v),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:fp(e.onClick,e=>{y(e=>!e),_&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),_&&(0,W.jsx)(RZt,{control:f,bubbles:!h.current,name:r,value:c,checked:v,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});PZt.displayName=N7;var FZt=`SwitchThumb`,IZt=g.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=NZt(FZt,n);return(0,W.jsx)(Op.span,{"data-state":zZt(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});IZt.displayName=FZt;var LZt=`SwitchBubbleInput`,RZt=g.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=g.useRef(null),s=mp(o,a),c=DV(n),l=QC(t);return g.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,W.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});RZt.displayName=LZt;function zZt(e){return e?`checked`:`unchecked`}var BZt=PZt,VZt=IZt;function HZt({className:e,...t}){return(0,W.jsx)(BZt,{"data-slot":`switch`,className:G(`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:(0,W.jsx)(VZt,{"data-slot":`switch-thumb`,className:G(`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`)})})}var P7=({customDomain:e,cname:t,documentationUrl:n=`https://www.zuplo.com/docs/guides/custom-domain-setup`})=>(0,W.jsxs)(`div`,{className:`text-left text-sm text-gray-800 whitespace-pre-line w-full mb-2`,children:[(0,W.jsx)(`p`,{children:`We've set things up on our end, now you need to configure your DNS with a new entry.`}),(0,W.jsx)(`br`,{}),(0,W.jsx)(lV,{variant:`muted`,className:`font-mono p-4 text-sm`,children:(0,W.jsxs)(`ol`,{children:[(0,W.jsx)(`li`,{className:`leading-6`,children:`Type: CNAME`}),(0,W.jsxs)(`li`,{className:`leading-6`,children:[`Name: `,e,` `,(0,W.jsx)(bQ,{textToCopy:e??``})]}),(0,W.jsxs)(`li`,{className:`leading-6`,children:[`Value: `,t,` `,(0,W.jsx)(bQ,{textToCopy:t??``})]}),(0,W.jsx)(`li`,{className:`leading-6`,children:`TTL: 60s or auto`})]})}),(0,W.jsx)(`br`,{}),(0,W.jsx)(`p`,{children:`Note that it does sometimes take a few hours for records to propagate and for the SSL certificate to be created.`}),(0,W.jsx)(`br`,{}),(0,W.jsxs)(`p`,{children:[`For more information see our`,` `,(0,W.jsx)(oT,{href:n,children:`documentation on custom domains`}),`.`]})]}),F7=()=>(0,W.jsxs)(`div`,{className:`text-left text-sm text-gray-800 whitespace-pre-line w-full mb-2`,children:[(0,W.jsx)(`p`,{children:`This custom domain is setup with an advanced configuration. In order to make changes to this domain, please contact support.`}),(0,W.jsx)(`br`,{}),(0,W.jsxs)(`p`,{children:[`For more information see our`,` `,(0,W.jsx)(oT,{href:`https://www.zuplo.com/docs/guides/custom-domain-setup`,children:`documentation on custom domains`}),`.`]})]}),UZt=/^(?!https?:\/\/)[a-zA-Z0-9.-]*\.[a-zA-Z]+$/,WZt=`https://zuplo.com/docs/dedicated/custom-domains`,GZt=Nv({hostname:jv().regex(UZt,`Please enter a valid domain name (e.g. api.example.com)`),environment:jv().min(1),stage:Fv([`api`,`dev-portal`]),isAlias:Mv().optional()}),KZt=({account:e,projectName:t,disabled:n=!1,isManagedDedicatedProject:r=!1})=>{let i=wG({resolver:TG(GZt),defaultValues:{hostname:``,environment:``,stage:`api`,isAlias:!1}}),[a,o]=(0,g.useState)(!1),[s,c]=i.watch([`isAlias`,`stage`]),{data:l}=Qj(e.name,t),{aliasDomains:u}=e.entitlements,{data:d}=BYt(e.name),f=d?.find(e=>e.name===t),p=f?YDt(new Date(Number(f.createdOn)),new Date(`2025-04-01`)):!1,m=l?l.filter(e=>e.environmentType!==VA.WORKING_COPY):[],h=NXt({onSuccess:()=>{s&&o(!1)}}),_=(0,g.useCallback)(()=>{i.reset(),h.isSuccess&&h.reset(),o(!1)},[i,h]),v=qmt(i.formState.isDirty&&!h.isSuccess,_);return(0,W.jsxs)(kA,{open:a,onOpenChange:e=>{e?o(!0):v.guardedClose()},children:[(0,W.jsx)(AA,{asChild:!0,children:(0,W.jsx)(Y,{"data-test":`create-custom-domain-modal-btn`,disabled:n,title:n?`You reached the limit of custom domains`:``,children:`Add Custom Domain`})}),(0,W.jsxs)(MA,{children:[(0,W.jsx)(NA,{children:(0,W.jsx)(FA,{children:`Add Custom Domain`})}),(0,W.jsx)(`div`,{className:`space-y-4`,children:h.isSuccess?(0,W.jsxs)(W.Fragment,{children:[r&&c===`api`?h.data?.cname?(0,W.jsx)(P7,{customDomain:i.getValues(`hostname`),cname:h.data.cname,documentationUrl:WZt}):(0,W.jsx)(F7,{}):!u&&h.data?.cname&&(0,W.jsx)(P7,{customDomain:i.getValues(`hostname`),cname:h.data?.cname}),!r&&!u&&!h.data?.cname&&c===`api`&&(0,W.jsx)(F7,{}),(0,W.jsx)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:(0,W.jsx)(jA,{asChild:!0,children:(0,W.jsx)(Y,{"data-test":`ok-create-custom-domain-btn`,children:`Done`})})})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(qR,{error:h.error}),(0,W.jsxs)(`div`,{className:`text-left text-sm text-foreground whitespace-pre-line w-full mb-2`,children:[m.length>0&&(0,W.jsxs)(EG,{...i,children:[p&&(0,W.jsxs)(PS,{variant:`warning`,children:[(0,W.jsx)(FS,{children:`Preview Notice`}),(0,W.jsxs)(IS,{children:[`Custom domains for the Dev Portal are currently in preview and only available after the migration to our preview version.`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/custom-domains`,target:`_blank`,children:`Learn more`})]})]}),(0,W.jsxs)(`form`,{onSubmit:i.handleSubmit(async n=>{await h.mutateAsync({accountName:e.name,projectName:t,isAlias:n.stage===`dev-portal`||r?!1:n.isAlias??!1,hostname:n.hostname,deploymentName:n.environment,stage:n.stage})}),children:[(0,W.jsx)(DG,{control:i.control,name:`environment`,render:({field:e})=>(0,W.jsxs)(kG,{className:`mt-2`,children:[(0,W.jsx)(MW,{htmlFor:`environment-field`,children:`Which environment do you want to apply your new domain to?`}),(0,W.jsx)(M7,{id:`environment-field`,"data-test":`environment-field`,environments:m,value:e.value,onValueChange:e.onChange,disabled:h.isPending,placeholder:`Select an environment`}),(0,W.jsx)(MG,{})]})}),(0,W.jsx)(DG,{control:i.control,name:`stage`,render:({field:e})=>(0,W.jsxs)(kG,{className:`mt-2`,children:[(0,W.jsx)(MW,{className:`block`,htmlFor:`environment-field`,children:`What do you want the custom domain to be assigned to?`}),(0,W.jsxs)(wW,{onValueChange:t=>{(t===`api`||t===`dev-portal`)&&e.onChange(t)},disabled:h.isPending,...e,children:[(0,W.jsx)(EW,{children:(0,W.jsx)(TW,{placeholder:`Select an environment`})}),(0,W.jsxs)(DW,{children:[(0,W.jsx)(OW,{value:`api`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Vm,{size:16}),` Gateway`]})}),(0,W.jsx)(OW,{value:`dev-portal`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(uie,{size:16}),` Dev Portal`,(0,W.jsx)(LS,{className:``,variant:`info`,children:`New`})]})})]})]}),(0,W.jsx)(MG,{})]})}),(0,W.jsx)(DG,{control:i.control,name:`hostname`,render:({field:e})=>(0,W.jsxs)(kG,{className:`mt-2`,children:[(0,W.jsx)(MW,{htmlFor:`hostname-field`,children:`Your custom domain (e.g. example.com or api.example.com)`}),(0,W.jsx)(jV,{type:`text`,autoComplete:`off`,placeholder:`api.example.com`,id:`hostname-field`,"data-test":`hostname-field`,...e,disabled:h.isPending}),(0,W.jsx)(MG,{})]})}),(0,W.jsx)(DG,{control:i.control,name:`isAlias`,render:({field:e})=>(0,W.jsx)(kG,{className:G((!u||c===`dev-portal`||r)&&`hidden`,`mt-2`),children:(0,W.jsxs)(lV,{className:`p-4 flex items-center gap-3`,children:[(0,W.jsxs)(MW,{className:`flex flex-col gap-2`,htmlFor:`isAlias`,children:[`Is this an alias domain?`,(0,W.jsxs)(`span`,{className:`text-sm font-normal text-muted-foreground`,children:[`If your API Gateway is behind a CDN or WAF, your clients may use a different domain. Use an`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/custom-domains#alias-domains`,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`alias domain`}),` `,`so public URLs like docs and OpenAPI match the client-facing domain.`]})]}),(0,W.jsx)(HZt,{className:`mx-3`,id:`isAlias`,"data-test":`isAlias`,checked:e.value??!1,onCheckedChange:e.onChange,disabled:h.isPending}),(0,W.jsx)(MG,{})]})})}),(0,W.jsxs)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:[(0,W.jsx)(jA,{asChild:!0,children:(0,W.jsx)(Y,{type:`button`,"data-test":`cancel-create-custom-domain-btn`,disabled:h.isPending,variant:`secondary`,children:`Cancel`})}),(0,W.jsx)(Y,{type:`submit`,"data-test":`create-custom-domain-btn`,disabled:h.isPending,children:(0,W.jsx)(Pk,{loading:h.isPending,children:`Create`})})]})]})]}),m.length===0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{children:`Custom domains can only be configured on edge deployment environments and this project only has a working-copy environment.`}),(0,W.jsx)(`br`,{}),(0,W.jsxs)(`p`,{children:[` `,`For more information on this see our`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/environments`,children:`documentation on environments`}),`.`]})]})]})]})})]}),(0,W.jsx)(Kmt,{open:v.showConfirm,onOpenChange:v.setShowConfirm,onDiscard:v.handleDiscard})]})},qZt=`https://zuplo.com/docs/dedicated/custom-domains`,JZt=({customDomain:e,isManagedDedicatedProject:t,isAkamaiManagedDedicatedProject:n})=>{let[r,i]=(0,g.useState)(void 0),a=()=>{s(),i(void 0)},[o,s]=QR(()=>{let i=r?.deployments.at(0)?.stage,o=r?.deployments.at(0)?.cname,s=typeof o==`string`&&o.length>0;return(0,W.jsx)(cV,{onClose:a,isOpen:!0,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(`div`,{className:`text-xl font-medium`,children:`Configure your custom domain`}),n?(0,W.jsx)(wZt,{}):t&&i===`api`?s?(0,W.jsx)(P7,{customDomain:r?.hostname,cname:o,documentationUrl:qZt}):(0,W.jsx)(F7,{}):e.provider===`custom`?(0,W.jsx)(F7,{}):e.provider===`amazon`?s?(0,W.jsx)(P7,{customDomain:r?.hostname,cname:o,documentationUrl:qZt}):(0,W.jsx)(F7,{}):s?(0,W.jsx)(P7,{customDomain:r?.hostname,cname:o}):(0,W.jsx)(F7,{})]})})},[r]),c=e=>{i(e),o()};return(0,W.jsx)(Y,{onClick:()=>{c(e)},"data-test":`view-domain-configuration-btn`,title:`View Configuration`,variant:`ghost`,size:`icon`,children:(0,W.jsx)(Um,{size:18})})},YZt=/held zone/i;function XZt(e){return!!e?.some(e=>YZt.test(e))}var ZZt=new Set([`pending`,`pending_migration`,`pending_provisioned`,`active_redeploying`,`provisioned`]),QZt=new Set([`blocked`,`pending_blocked`,`moved`,`deleted`,`pending_deletion`,`test_blocked`,`test_failed`]),$Zt=new Set([`initializing`,`pending_validation`,`pending_issuance`,`pending_deployment`,`pending_cleanup`,`staging_deployment`,`holding_deployment`]),eQt=new Set([`expired`,`deactivating`,`inactive`,`initializing_timed_out`,`validation_timed_out`,`issuance_timed_out`,`deployment_timed_out`,`deletion_timed_out`,`deleted`,`pending_deletion`,`pending_expiration`]);function tQt(e){if(e.provider===`alias`)return null;if(e.provider===`custom`||e.provider===`amazon`)return{level:`unknown`,label:`Externally managed`,description:`This domain's status isn't reported to Zuplo — verification and certificates are handled by your dedicated infrastructure provider.`};let t=e.verificationErrors&&e.verificationErrors.length>0,n=e.status??null,r=e.sslStatus??null;if(!n&&!r&&!t)return{level:`pending`,label:`Initializing`,description:`We're waiting for the domain provider to report a status. This usually takes a few seconds after the domain is created.`};if(XZt(e.verificationErrors))return{level:`error`,label:`Zone hold`,description:`Cloudflare is blocking this hostname because the parent domain has a zone hold on another Cloudflare account. The zone owner needs to release the hold before we can finish provisioning.`,helpUrl:`https://developers.cloudflare.com/fundamentals/account/account-security/zone-holds/`,helpLabel:`How to release a zone hold`};if(t)return{level:`error`,label:`Needs attention`,description:`The domain provider reported verification errors. Review the details to resolve them.`};if(n&&QZt.has(n))return{level:`error`,label:I7(n),description:`The domain is in a state that prevents it from serving traffic. Contact support if this persists.`};if(r&&eQt.has(r))return{level:`error`,label:`SSL error`,description:`The SSL certificate is in the "${I7(r)}" state. The domain may not serve HTTPS traffic until this is resolved.`};let i=n===`active`||n===`test_active`||n===`test_active_apex`;return i&&(r===`active`||r===`staging_active`||r===`backup_issued`)?{level:`active`,label:`Active`,description:`The domain is verified and serving traffic over HTTPS.`}:i&&r&&$Zt.has(r)?{level:`pending`,label:`Issuing certificate`,description:`The domain is verified. We're still provisioning the SSL certificate — this usually takes a few minutes.`}:n&&ZZt.has(n)?{level:`pending`,label:`Verifying domain`,description:`We're waiting for DNS verification. Double-check the CNAME record at your DNS provider.`}:n||r?{level:`pending`,label:I7(n??r??`pending`),description:`The domain is still being set up. If this state persists, contact support.`}:{level:`unknown`,label:`Unknown`,description:`No status information is available for this domain.`}}function I7(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}var nQt={active:{dot:`bg-green-500`,pulse:!1,pill:`bg-green-50 text-green-700 border-green-200 hover:bg-green-100 dark:bg-green-950 dark:text-green-300 dark:border-green-800 dark:hover:bg-green-900`},pending:{dot:`bg-amber-500`,pulse:!0,pill:`bg-amber-50 text-amber-800 border-amber-200 hover:bg-amber-100 dark:bg-amber-950 dark:text-amber-300 dark:border-amber-800 dark:hover:bg-amber-900`},error:{dot:`bg-red-500`,pulse:!1,pill:`bg-red-50 text-red-700 border-red-200 hover:bg-red-100 dark:bg-red-950 dark:text-red-300 dark:border-red-800 dark:hover:bg-red-900`},unknown:{dot:`bg-gray-400`,pulse:!1,pill:`bg-gray-50 text-gray-700 border-gray-200 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700`}},rQt=({domain:e})=>{let t=tQt(e);if(!t)return null;let n=nQt[t.level],r=e.verificationErrors??[];return(0,W.jsxs)(kX,{children:[(0,W.jsx)(AX,{asChild:!0,children:(0,W.jsxs)(`button`,{type:`button`,className:G(`inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,n.pill),"aria-label":`${e.hostname} status: ${t.label}`,children:[(0,W.jsxs)(`span`,{className:`relative flex size-2 items-center justify-center`,children:[n.pulse&&(0,W.jsx)(`span`,{className:G(`absolute inline-flex h-full w-full animate-ping rounded-full opacity-75`,n.dot)}),(0,W.jsx)(`span`,{className:G(`relative inline-flex size-2 rounded-full`,n.dot)})]}),t.label]})}),(0,W.jsx)(jX,{align:`start`,className:`w-96`,children:(0,W.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:G(`inline-flex size-2 rounded-full`,n.dot)}),(0,W.jsx)(`span`,{className:`font-medium`,children:t.label})]}),(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:t.description}),t.helpUrl&&(0,W.jsx)(oT,{href:t.helpUrl,className:`text-xs`,children:t.helpLabel??`Learn more`}),r.length>0&&(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Verification errors`}),(0,W.jsx)(`ul`,{className:`list-disc pl-5 space-y-1 text-red-700 dark:text-red-400`,children:r.map(e=>(0,W.jsx)(`li`,{children:e},e))})]})]})})]})},iQt=({account:e,currentDomainConfig:t})=>{let{logEvent:n,captureException:r}=Vg(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),c=e=>{let t=e.target.value;a(t)},l=FXt(),u=async()=>{try{if(s(``),!t.hostname||t.hostname.trim()===``){s(`The current domain configuration does not have a hostname associated with it`);return}await l.mutateAsync({accountName:e.name,projectName:t.projectName??``,hostname:t.hostname,deploymentName:t.deployments[0]?.deploymentName}),n(`account-custom-domain-delete-success`,{account:e.name}),d()}catch(t){r(t);let i=Yj(t);s(i),n(`account-custom-domain-delete-failed`,{account:e.name,errorMessage:i})}},d=()=>{p(),a(``),s(``)},[f,p]=QR(()=>(0,W.jsx)(cV,{onClose:d,isOpen:!0,maxWidth:`max-w-xl`,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(`div`,{className:`text-xl font-medium`,children:`Delete custom domain`}),(0,W.jsx)(qR,{error:o,className:`mb-3`}),(0,W.jsxs)(`div`,{className:`text-sm text-foreground whitespace-pre-line w-full mb-2`,children:[(0,W.jsxs)(`div`,{className:`relative bg-yellow-100 dark:bg-yellow-950/40 rounded-sm p-4 text-yellow-900 dark:text-yellow-200 text-sm whitespace-pre-line w-full mb-2`,children:[(0,W.jsxs)(`div`,{className:`flex space-x-2 items-center`,children:[(0,W.jsx)(Cm,{className:`h-5 w-5 text-yellow-900 dark:text-yellow-200`}),(0,W.jsx)(`span`,{className:`text-sm font-medium antialiased mt-0.5`,children:`Caution: Your project will no longer be accessible with this domain.`})]}),(0,W.jsxs)(`p`,{className:`px-2 mt-4`,children:[`You are about to delete the custom domain`,` `,(0,W.jsx)(`span`,{className:`font-medium antialiased`,children:t.hostname}),` `,`from your project. Requests using it will no longer reach your zup.`]})]}),(0,W.jsx)(`br`,{}),(0,W.jsxs)(`label`,{className:`block mb-2`,htmlFor:`hostname-field`,children:[`Please type`,` `,(0,W.jsx)(`span`,{className:`font-medium antialiased`,children:t.hostname}),` `,`to confirm.`]}),(0,W.jsx)(`input`,{className:`shadow-xs focus:ring-indigo-500 focus:border-indigo-500 block w-full text-sm border-border rounded-md mb-4 placeholder-gray-400 dark:placeholder-neutral-500 disabled:opacity-50`,type:`text`,autoComplete:`off`,value:i,onChange:c,id:`hostname-field`,"data-test":`hostname-field`}),(0,W.jsx)(`div`,{className:` text-red-500`,children:`I understand the consequences, delete this custom domain`})]}),(0,W.jsxs)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:[(0,W.jsx)(Y,{onClick:d,"data-test":`cancel-delete-custom-domain-btn`,variant:`outline`,disabled:l.isPending,children:`Cancel`}),(0,W.jsx)(Y,{"data-test":`delete-custom-domain-btn`,onClick:u,disabled:l.isPending||i!==t.hostname,children:(0,W.jsx)(Pk,{loading:l.isPending,children:`Delete`})})]})]})}),[l.isPending,o,t,i]);return(0,W.jsx)(Y,{type:`button`,title:`Delete Custom Domain`,onClick:f,"data-test-id":`delete-custom-domain-btn`,variant:`ghost`,size:`icon-sm`,children:(0,W.jsx)(Pk,{loading:l.isPending,children:(0,W.jsx)(eh,{size:18})})})},aQt=/^(?!https?:\/\/)[a-zA-Z0-9.-]*\.[a-zA-Z]+$/,oQt=({account:e,projectName:t,currentDomainConfig:n})=>{let{logEvent:r,captureException:i}=Vg(),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(n.deployments[0]?.deploymentName),d=n.hostname,{data:f,error:p}=Qj(e.name,t),m=Yj(p);(0,g.useEffect)(()=>{m&&o(m)},[m]);let h=f?f.filter(e=>e.environmentType!==VA.WORKING_COPY):[],_=PXt(),v=async n=>{if(n.preventDefault(),!l||l.trim()===``){o(`Please select an environment from the options available`);return}if(!d||d.trim()===``){o(`Please provide a value on the custom domain field.`);return}if(d&&!aQt.test(d)){o(`A custom domain value should only be the domain name. It should not start with 'http(s)' and should end with an alpha character.`);return}try{o(``),await _.mutateAsync({accountName:e.name,projectName:t,hostname:d,deploymentName:l}),c(!0),r(`account-custom-domain-edit-success`,{account:e.name})}catch(t){i(t);let n=Yj(t);r(`account-custom-domain-edit-failed`,{account:e.name,errorMessage:n}),o(n),c(!1)}},y=()=>{x(),u(n.deployments[0]?.deploymentName),o(``),c(!1)},[b,x]=QR(()=>(0,W.jsx)(cV,{onClose:y,isOpen:!0,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(`div`,{className:`text-xl font-medium`,children:`Edit your custom domain`}),(0,W.jsx)(qR,{error:a}),(0,W.jsxs)(`div`,{className:`text-left text-sm text-foreground whitespace-pre-line w-full mb-2`,children:[s===!1&&(0,W.jsxs)(`form`,{onSubmit:v,children:[(0,W.jsx)(`label`,{className:`block mb-2`,htmlFor:`environment-field`,children:`Which environment do you want to apply your custom domain to ?`}),(0,W.jsx)(`div`,{className:`mb-9`,children:(0,W.jsx)(M7,{id:`environment-field`,"data-test":`environment-field`,environments:h,value:l??``,onValueChange:e=>u(e),disabled:_.isPending,placeholder:`Select an environment`})}),(0,W.jsx)(`label`,{className:`block mb-2`,htmlFor:`hostname-field`,children:`Your custom domain`}),(0,W.jsx)(`input`,{className:`shadow-xs focus:ring-indigo-500 focus:border-indigo-500 block w-full text-sm border-border rounded-md mb-9 placeholder-gray-400 dark:placeholder-neutral-500 disabled:opacity-50`,type:`text`,autoComplete:`off`,placeholder:`api.example.com`,id:`hostname-field`,value:d,disabled:!0,"data-test":`hostname-field`}),(0,W.jsxs)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:[(0,W.jsx)(Y,{variant:`outline`,type:`button`,onClick:y,"data-test":`cancel-edit-custom-domain-btn`,disabled:_.isPending,children:`Cancel`}),(0,W.jsx)(Y,{"data-test":`save-edit-custom-domain-btn`,type:`submit`,disabled:_.isPending||l===n.deployments[0]?.deploymentName,children:(0,W.jsx)(Pk,{loading:_.isPending,children:`Save`})})]})]}),s===!0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`text-left text-sm text-foreground whitespace-pre-line w-full mb-2`,children:(0,W.jsxs)(`p`,{children:[`Successfully edited custom domain`,` `,(0,W.jsx)(oT,{href:`https://${d}`,children:d}),` `,`to map to deployment `,l]})}),(0,W.jsx)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:(0,W.jsx)(Y,{variant:`outline`,className:`w-24 justify-center`,type:`button`,onClick:y,"data-test":`ok-edit-custom-domain-btn`,disabled:!s,children:`OK`})})]})]})]})}),[h,a]),S=()=>{b()};return(0,W.jsx)(Y,{onClick:()=>S(),title:`Edit Custom Domain`,"data-test-id":`edit-custom-domain-btn`,variant:`ghost`,size:`icon-sm`,children:(0,W.jsx)(Pk,{loading:_.isPending,children:(0,W.jsx)(Ire,{size:18})})})},sQt=({classNames:e,projectType:t,feature:n,helpUrl:r})=>(0,W.jsxs)(lV,{variant:`danger`,className:e,children:[(0,W.jsx)(uV,{children:t===`managed-dedicated`?`Managed Dedicated Project`:t===`self-hosted`?`Self Hosted Project`:`Managed Edge Project`}),(0,W.jsx)(pV,{className:`flex-1 leading-loose mt-1 text-sm`,children:(0,W.jsxs)(`p`,{className:`leading-loose`,children:[`Your project is running on a `,t===`managed-dedicated`?`managed dedicated`:t===`self-hosted`?`self hosted`:`managed edge hosted`,` environment. For information on how to setup up `,n,`, please refer to`,` `,(0,W.jsx)(oT,{href:r,children:`the documentation`}),`.`]})})]});function cQt({projectType:e,defaultConfiguration:t}){return e===`managed-dedicated`&&t.some(e=>!!e.managedDedicatedConfiguration)}function lQt({projectType:e,defaultConfiguration:t}){return e===`managed-dedicated`&&t.some(e=>e.managedDedicatedConfiguration?.vendor===`akamai`)}function uQt(){return(0,W.jsx)(`button`,{type:`button`,disabled:!0,title:`Locked custom domain`,className:`items-center justify-center p-2 hover:bg-gray-100 rounded-sm cursor-pointer`,children:(0,W.jsx)(qm,{className:`h-5 w-5 mx-auto`,"aria-hidden":`true`})})}var dQt=()=>{let e=lh([`account`,`project`]),t=IXt(e.account.name,e.project.name),n=HYt(e.account.name,e.project.name);if(!t.data||!n.data)return(0,W.jsx)(hV,{});let r=t.data?.filter(t=>t.projectName&&t.projectName===e.project.name&&t.deployments[0]).sort((e,t)=>e.deployments[0].deploymentName.localeCompare(t.deployments[0].deploymentName)),i=e.account.customDomainsInUse>=e.account.entitlements.customDomains,a=lQt({projectType:e.project.type,defaultConfiguration:n.data.defaultConfiguration}),o=cQt({projectType:e.project.type,defaultConfiguration:n.data.defaultConfiguration});return(0,W.jsxs)(`div`,{className:`flex gap-4 flex-col`,children:[(0,W.jsx)(E7,{title:`Custom Domains`}),(0,W.jsx)(PS,{variant:`outline`,className:`text-sm`,children:(0,W.jsx)(IS,{children:(0,W.jsxs)(`p`,{children:[(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/custom-domains`,children:`Custom domains`}),` `,`allow you to use your own domain name for your API and developer portal. For complex custom domain configurations, please contact us at`,` `,(0,W.jsx)(oT,{href:`mailto:${QS}`,children:QS}),` `,`or use the chat widget at the bottom right.`]})})}),i&&e.account.entitlements.customDomains>0&&e.project.type!==`self-hosted`&&!a&&(0,W.jsx)(SZt,{account:e.account,source:`custom-domain-limit`}),!i&&e.project.type!==`self-hosted`&&!a&&(0,W.jsx)(CZt,{used:e.account.customDomainsInUse,max:e.account.entitlements.customDomains,label:`custom domains`,account:e.account,hideAtLimit:!0}),r.length>0&&(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(t=>{let n=t.deployments[0],r=o&&n?.stage===`api`,i=t.provider===`custom`&&!r,s=t.provider===`alias`,c=n.stage===`dev-portal`;return(0,W.jsxs)(lV,{className:`p-4 flex items-center justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`shrink-0 flex size-9 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:c?(0,W.jsx)(uie,{className:`size-4`}):(0,W.jsx)(Vm,{className:`size-4`})}),(0,W.jsxs)(`div`,{className:`flex flex-col min-w-0 gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,W.jsxs)(`a`,{href:`https://${t.hostname}`,target:`_blank`,rel:`noreferrer`,className:`font-medium text-sm hover:text-zuplo-pink transition-colors inline-flex items-center gap-1 truncate`,children:[(0,W.jsx)(`span`,{className:`truncate`,children:t.hostname}),(0,W.jsx)(Pm,{className:`size-3 shrink-0 opacity-60`})]}),(0,W.jsx)(rQt,{domain:t}),n.isDefault&&(0,W.jsx)(LS,{variant:`outline`,className:`text-xs`,children:`Default`}),s&&(0,W.jsx)(LS,{variant:`outline`,className:`text-xs`,children:`Alias`})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground flex-wrap`,children:[(0,W.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:c?`Dev Portal`:`API`}),(0,W.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(JEt,{env:n.environmentType??null}),` `,`(`,n.deploymentName,`)`]}),n.branch&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono`,children:[(0,W.jsx)(Bm,{className:`size-3`}),n.branch]})]})]})]})]}),(0,W.jsxs)(`div`,{className:`shrink-0 flex items-center gap-1`,children:[!s&&(0,W.jsx)(JZt,{customDomain:t,isManagedDedicatedProject:o,isAkamaiManagedDedicatedProject:a}),a||i?(0,W.jsx)(uQt,{}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(oQt,{account:e.account,projectName:e.project.name,currentDomainConfig:t}),(0,W.jsx)(iQt,{account:e.account,currentDomainConfig:t})]})]})]},t.id)})}),e.project.type===`self-hosted`?(0,W.jsx)(sQt,{classNames:`mt-5`,feature:`custom domains`,helpUrl:`https://zuplo.com/docs/dedicated/custom-domains`,projectType:e.project.type}):a?(0,W.jsx)(wZt,{className:`mt-5`}):e.account.entitlements.customDomains>0?(0,W.jsx)(`div`,{className:`mt-2`,children:(0,W.jsx)(KZt,{disabled:i,account:e.account,projectName:e.project.name,isManagedDedicatedProject:o})}):(0,W.jsx)(SZt,{account:e.account,source:`custom-domain`,className:`mt-5`})]})},fQt=`__NULL_BRANCH`,pQt=e=>{let t=[];return e.production&&t.push(`production`),e.preview&&t.push(`preview`),e.workingCopy&&t.push(`working-copy`),t},mQt=({previewEnvironments:e,defaultBranch:t})=>{let{register:n,watch:r,setValue:i,getValues:a,control:o}=iG(),s=r(`personalOverride`),c=r(`preview`),l=r(`workingCopy`),u=a(),d=u.production||u.preview||u.workingCopy;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 mt-4`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium`,children:`Environments`}),(0,W.jsx)(L7,{id:`production`,testId:`production-checkbox`,register:n(`production`),title:`Production`,description:t?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(Bm,{className:`size-3`}),(0,W.jsx)(`span`,{className:`font-mono`,children:t})]}):`The branch deployed to production`}),(0,W.jsx)(L7,{id:`preview`,testId:`preview-checkbox`,register:n(`preview`),title:`Preview`,description:(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(Bm,{className:`size-3`}),`All non-production branches`]}),action:(0,W.jsx)(cG,{control:o,name:`targetBranch`,render:({field:t})=>(0,W.jsx)(M7,{environments:e,value:t.value??`__NULL_BRANCH`,onValueChange:t.onChange,disabled:!c,getOptionValue:e=>e.branchName??``,sentinel:{value:fQt,label:`All other branches`},triggerClassName:`w-72 h-10`,showTriggerBadge:!1,"data-test":`preview-branch-picker`})})}),(0,W.jsx)(L7,{id:`workingCopy`,testId:`working-copy-checkbox`,register:n(`workingCopy`),title:`Development`,description:(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(oz,{className:`size-3`}),`Your Working Copy & Local Dev`]}),action:l&&(0,W.jsx)(`button`,{type:`button`,"data-test":`personal-override-button`,className:`text-xs text-zuplo-pink hover:underline whitespace-nowrap`,onClick:()=>{i(`personalOverride`,!s,{shouldDirty:!0,shouldTouch:!0})},children:s?`Clear personal override`:`Set personal override`})}),l&&s&&(0,W.jsxs)(`div`,{className:`ml-7 rounded-md border border-dashed bg-muted/40 p-3 flex flex-col gap-1.5`,children:[(0,W.jsx)(`label`,{htmlFor:`personal-value`,className:`text-sm font-medium`,children:`Personal override`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Only applied in your own Working Copy & Local Dev. Other developers won’t see this value.`}),(0,W.jsx)(jV,{id:`personal-value`,"data-test":`personal-override-input`,...n(`personalValue`)})]}),!d&&(0,W.jsx)(PS,{children:(0,W.jsx)(IS,{children:`You must select at least one environment`})})]})},L7=({id:e,testId:t,register:n,title:r,description:i,action:a})=>(0,W.jsxs)(`div`,{className:G(`flex min-h-16 items-center gap-3 rounded-md border bg-background px-4 py-3`,`transition-colors hover:border-foreground/20`),children:[(0,W.jsx)(`input`,{id:e,"data-test":t,type:`checkbox`,className:`size-4 rounded-sm border border-gray-300 shadow-sm shrink-0`,...n}),(0,W.jsxs)(`label`,{htmlFor:e,className:`flex-1 min-w-0 cursor-pointer`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium leading-tight`,children:r}),(0,W.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:i})]}),a&&(0,W.jsx)(`div`,{className:`shrink-0`,children:a})]}),hQt=({mode:e})=>{let{register:t,formState:n}=iG();return(0,W.jsxs)(`div`,{className:`flex flex-col`,children:[n.errors.name?.message&&(0,W.jsx)(qR,{error:n.errors.name.message,"data-test":`variable-name-input-error-validation-message`}),(0,W.jsx)(`span`,{className:`text-sm`,children:`Name`}),(0,W.jsx)(`div`,{className:`flex flex-col items-top gap-2`,children:(0,W.jsx)(jV,{id:`name`,onInput:e=>{let t=e.target,n=t.selectionStart;t.value=t.value.toUpperCase().replace(/[^A-Z0-9_]/g,`_`),t.setSelectionRange(n,n)},...t(`name`,{disabled:e===`edit`,pattern:{value:/^[^0-9a-z\W][A-Z0-9_]*$/,message:`Name must be SCREAMING_SNAKE_CASE and must start with a letter`}}),title:e===`edit`?`Name cannot be changed, create a new variable instead`:``,type:`text`,"data-test":`variable-name-input`})})]})},gQt=({variable:e,previewEnvironments:t,defaultBranch:n,onClose:r,isSaving:i,error:a,mode:o,onSubmit:s})=>{let c=wG({defaultValues:{preview:e.targets.includes(`preview`),production:e.targets.includes(`production`),workingCopy:e.targets.includes(`working-copy`),name:e.name,isSecret:e.type===`secret`,value:o===`edit`&&e.type===`secret`?`*******`:e.value??null,personalOverride:e.personalValue!==void 0,personalValue:e.personalValue??null,targetBranch:e.targetBranch??`__NULL_BRANCH`},mode:`onChange`}),{getValues:l,control:u,register:d,watch:f}=c,{isValid:p,dirtyFields:m,touchedFields:h}=G5e({control:u}),_=l(),v=_.production||_.preview||_.workingCopy,y=!i&&v&&p,b=()=>{s(l(),m,h)},x=(0,g.useRef)(null),S=(0,g.useRef)(null);return(0,W.jsx)(H5e,{...c,children:(0,W.jsx)(cV,{isOpen:!0,maxWidth:`max-w-2xl`,onClose:r,children:(0,W.jsx)(`div`,{className:`flex flex-col mt-6`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(qR,{error:a}),(0,W.jsx)(hQt,{mode:o}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`text-sm`,children:`Value`}),(0,W.jsx)(cG,{control:u,name:`value`,render:({fieldState:{isDirty:e},field:{value:t,disabled:n,...r}})=>(0,W.jsxs)(`div`,{className:G(`rounded-sm border border-border w-full relative max-h-48`,n&&`bg-gray-100 dark:bg-neutral-800`),ref:S,children:[(0,W.jsxs)(`pre`,{className:G(`font-mono text-zuplo-pink p-2 overflow-hidden max-h-48 text-sm whitespace-pre`,n&&`invisible`),ref:x,children:[[...t??``].map((e,t)=>{switch(e){case`
|
|
1651
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gqt(e,t){if(e){if(typeof e==`string`)return l7(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 l7(e,t)}}function Kqt(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function qqt(e){if(Array.isArray(e))return l7(e)}function l7(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Jqt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Jqt(Object(n),!0).forEach(function(t){u7(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jqt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u7(e,t,n){return t=Yqt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yqt(e){var t=Xqt(e,`string`);return i7(t)==`symbol`?t:t+``}function Xqt(e,t){if(i7(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i7(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Zqt={xAxis:[`bottom`,`top`],yAxis:[`left`,`right`]},Qqt={width:`100%`,height:`100%`},$qt={x:0,y:0};function d7(e){return e}var eJt=function(e,t){return t===`horizontal`?e.x:t===`vertical`?e.y:t===`centric`?e.angle:e.radius},tJt=function(e,t,n,r){var i=t.find(function(e){return e&&e.index===n});if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.y};if(e===`vertical`)return{x:r.x,y:i.coordinate};if(e===`centric`){var a=i.coordinate,o=r.radius;return Q(Q(Q({},r),B6(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return Q(Q(Q({},r),B6(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return $qt},f7=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,i=t.dataEndIndex,a=(n??[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(c7(e),c7(n)):e},[]);return a.length>0?a:e&&e.length&&R0(r)&&R0(i)?e.slice(r,i+1):[]};function nJt(e){return e===`number`?[0,`auto`]:void 0}var p7=function(e,t,n,r){var i=e.graphicalItems,a=e.tooltipAxis,o=f7(t,e);return n<0||!i||!i.length||n>=o.length?null:i.reduce(function(i,s){var c=s.props.data??t;c&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(c=c.slice(e.dataStartIndex,e.dataEndIndex+1));var l=a.dataKey&&!a.allowDuplicatedCategory?U0(c===void 0?o:c,a.dataKey,r):c&&c[n]||o[n];return l?[].concat(c7(i),[Dzt(s,l)]):i},[])},rJt=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},a=eJt(i,n),o=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,l=azt(a,o,c,s);if(l>=0&&c){var u=c[l]&&c[l].value;return{activeTooltipIndex:l,activeLabel:u,activePayload:p7(e,t,l,u),activeCoordinate:tJt(n,o,l,i)}}return null},iJt=function(e,t){var n=t.axes,r=t.graphicalItems,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=e.stackOffset,f=pzt(l,i);return n.reduce(function(t,n){var p=n.type.defaultProps===void 0?n.props:Q(Q({},n.type.defaultProps),n.props),m=p.type,h=p.dataKey,g=p.allowDataOverflow,_=p.allowDuplicatedCategory,v=p.scale,y=p.ticks,b=p.includeHidden,x=p[a];if(t[x])return t;var S=f7(e.data,{graphicalItems:r.filter(function(e){return(a in e.props?e.props[a]:e.type.defaultProps?.[a])===x}),dataStartIndex:s,dataEndIndex:c}),C=S.length,w,T,E;vqt(p.domain,g,m)&&(w=F6(p.domain,null,g),f&&(m===`number`||v!==`auto`)&&(E=A6(S,h,`category`)));var D=nJt(m);if(!w||w.length===0){var O=p.domain??D;if(h){if(w=A6(S,h,m),m===`category`&&f){var k=zOt(w);_&&k?(T=w,w=(0,y5.default)(0,C)):_||(w=Ezt(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(c7(e),[t])},[]))}else if(m===`category`)w=_?w.filter(function(e){return e!==``&&!(0,X0.default)(e)}):Ezt(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0||t===``||(0,X0.default)(t)?e:[].concat(c7(e),[t])},[]);else if(m===`number`){var A=dzt(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===x&&(b||!n)}),h,i,l);A&&(w=A)}f&&(m===`number`||v!==`auto`)&&(E=A6(S,h,`category`))}else w=f?(0,y5.default)(0,C):o&&o[x]&&o[x].hasStack&&m===`number`?d===`expand`?[0,1]:Czt(o[x].stackGroups,s,c):fzt(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps.hide;return t===x&&(b||!n)}),m,l,!0);if(m===`number`)w=Z5(u,w,x,i,y),O&&(w=F6(O,w,g));else if(m===`category`&&O){var j=O;w.every(function(e){return j.indexOf(e)>=0})&&(w=j)}}return Q(Q({},t),{},u7({},x,Q(Q({},p),{},{axisType:i,domain:w,categoricalDomain:E,duplicateDomain:T,originalDomain:p.domain??D,isCategorical:f,layout:l})))},{})},aJt=function(e,t){var n=t.graphicalItems,r=t.Axis,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=f7(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:c}),f=d.length,p=pzt(l,i),m=-1;return n.reduce(function(e,t){var h=(t.type.defaultProps===void 0?t.props:Q(Q({},t.type.defaultProps),t.props))[a],g=nJt(`number`);if(!e[h]){m++;var _;return p?_=(0,y5.default)(0,f):o&&o[h]&&o[h].hasStack?(_=Czt(o[h].stackGroups,s,c),_=Z5(u,_,h,i)):(_=F6(g,fzt(d,n.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===h&&!n}),`number`,l),r.defaultProps.allowDataOverflow),_=Z5(u,_,h,i)),Q(Q({},e),{},u7({},h,Q(Q({axisType:i},r.defaultProps),{},{hide:!0,orientation:(0,F0.default)(Zqt,`${i}.${m%2}`,null),domain:_,originalDomain:g,isCategorical:p,layout:l})))}return e},{})},oJt=function(e,t){var n=t.axisType,r=n===void 0?`xAxis`:n,i=t.AxisComp,a=t.graphicalItems,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.children,u=`${r}Id`,d=t2(l,i),f={};return d&&d.length?f=iJt(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(f=aJt(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c})),f},sJt=function(e){var t=H0(e),n=M6(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:(0,l4.default)(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:I6(t,n)}},cJt=function(e){var t=e.children,n=e.defaultShowTooltip,r=n2(t,E5),i=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},lJt=function(e){return!e||!e.length?!1:e.some(function(e){var t=Q0(e&&e.type);return t&&t.indexOf(`Bar`)>=0})},uJt=function(e){return e===`horizontal`?{numericAxisName:`yAxis`,cateAxisName:`xAxis`}:e===`vertical`?{numericAxisName:`xAxis`,cateAxisName:`yAxis`}:e===`centric`?{numericAxisName:`radiusAxis`,cateAxisName:`angleAxis`}:{numericAxisName:`angleAxis`,cateAxisName:`radiusAxis`}},dJt=function(e,t){var n=e.props,r=e.graphicalItems,i=e.xAxisMap,a=i===void 0?{}:i,o=e.yAxisMap,s=o===void 0?{}:o,c=n.width,l=n.height,u=n.children,d=n.margin||{},f=n2(u,E5),p=n2(u,o4),m=Object.keys(s).reduce(function(e,t){var n=s[t],r=n.orientation;return!n.mirror&&!n.hide?Q(Q({},e),{},u7({},r,e[r]+n.width)):e},{left:d.left||0,right:d.right||0}),h=Q(Q({},Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return!n.mirror&&!n.hide?Q(Q({},e),{},u7({},r,(0,F0.default)(e,`${r}`)+n.height)):e},{top:d.top||0,bottom:d.bottom||0})),m),g=h.bottom;f&&(h.bottom+=f.props.height||E5.defaultProps.height),p&&t&&(h=czt(h,r,n,t));var _=c-h.left-h.right,v=l-h.top-h.bottom;return Q(Q({brushBottom:g},h),{},{width:Math.max(_,0),height:Math.max(v,0)})},fJt=function(e,t){if(t===`xAxis`)return e[t].width;if(t===`yAxis`)return e[t].height},pJt=function(e){var t=e.chartName,n=e.GraphicalChild,r=e.defaultTooltipEventType,i=r===void 0?`axis`:r,a=e.validateTooltipEventTypes,o=a===void 0?[`axis`]:a,s=e.axisComponents,c=e.legendContent,l=e.formatAxisMap,u=e.defaultProps,d=function(e,t){var n=t.graphicalItems,r=t.stackGroups,i=t.offset,a=t.updateId,o=t.dataStartIndex,c=t.dataEndIndex,l=e.barSize,u=e.layout,d=e.barGap,f=e.barCategoryGap,p=e.maxBarSize,m=uJt(u),h=m.numericAxisName,g=m.cateAxisName,_=lJt(n),v=[];return n.forEach(function(n,m){var y=f7(e.data,{graphicalItems:[n],dataStartIndex:o,dataEndIndex:c}),b=n.type.defaultProps===void 0?n.props:Q(Q({},n.type.defaultProps),n.props),x=b.dataKey,S=b.maxBarSize,C=b[`${h}Id`],w=b[`${g}Id`],T=s.reduce(function(e,n){var r=t[`${n.axisType}Map`],i=b[`${n.axisType}Id`];!(r&&r[i]||n.axisType===`zAxis`)&&m6(!1);var a=r[i];return Q(Q({},e),{},u7(u7({},n.axisType,a),`${n.axisType}Ticks`,M6(a)))},{}),E=T[g],D=T[`${g}Ticks`],O=r&&r[C]&&r[C].hasStack&&xzt(n,r[C].stackGroups),k=Q0(n.type).indexOf(`Bar`)>=0,A=I6(E,D),j=[],M=_&&ozt({barSize:l,stackGroups:r,totalSize:fJt(T,g)});if(k){var N=(0,X0.default)(S)?p:S,P=I6(E,D,!0)??N??0;j=szt({barGap:d,barCategoryGap:f,bandSize:P===A?A:P,sizeList:M[w],maxBarSize:N}),P!==A&&(j=j.map(function(e){return Q(Q({},e),{},{position:Q(Q({},e.position),{},{offset:e.position.offset-P/2})})}))}var F=n&&n.type&&n.type.getComposedData;F&&v.push({props:Q(Q({},F(Q(Q({},T),{},{displayedData:y,props:e,dataKey:x,item:n,bandSize:A,barPosition:j,offset:i,stackedData:O,layout:u,dataStartIndex:o,dataEndIndex:c}))),{},u7(u7(u7({key:n.key||`item-${m}`},h,T[h]),g,T[g]),`animationId`,a)),childIndex:okt(n,e.children),item:n})}),v},f=function(e,r){var i=e.props,a=e.dataStartIndex,o=e.dataEndIndex,c=e.updateId;if(!$Ot({props:i}))return null;var u=i.children,f=i.layout,p=i.stackOffset,m=i.data,h=i.reverseStackOrder,g=uJt(f),_=g.numericAxisName,v=g.cateAxisName,y=t2(u,n),b=yzt(m,y,`${_}Id`,`${v}Id`,p,h),x=s.reduce(function(e,t){var n=`${t.axisType}Map`;return Q(Q({},e),{},u7({},n,oJt(i,Q(Q({},t),{},{graphicalItems:y,stackGroups:t.axisType===_&&b,dataStartIndex:a,dataEndIndex:o}))))},{}),S=dJt(Q(Q({},x),{},{props:i,graphicalItems:y}),r?.legendBBox);Object.keys(x).forEach(function(e){x[e]=l(i,x[e],S,e.replace(`Map`,``),t)});var C=x[`${v}Map`],w=sJt(C);return Q(Q({formattedGraphicalItems:d(i,Q(Q({},x),{},{dataStartIndex:a,dataEndIndex:o,updateId:c,graphicalItems:y,stackGroups:b,offset:S})),graphicalItems:y,offset:S,stackGroups:b},w),x)},p=function(e){function n(e){var r;return Iqt(this,n),r=zqt(this,n,[e]),u7(r,`eventEmitterSymbol`,Symbol(`rechartsEventEmitter`)),u7(r,`accessibilityManager`,new _qt),u7(r,`handleLegendBBoxUpdate`,function(e){if(e){var t=r.state,n=t.dataStartIndex,i=t.dataEndIndex,a=t.updateId;r.setState(Q({legendBBox:e},f({props:r.props,dataStartIndex:n,dataEndIndex:i,updateId:a},Q(Q({},r.state),{},{legendBBox:e}))))}}),u7(r,`handleReceiveSyncEvent`,function(e,t,n){if(r.props.syncId===e){if(n===r.eventEmitterSymbol&&typeof r.props.syncMethod!=`function`)return;r.applySyncEvent(t)}}),u7(r,`handleBrushChange`,function(e){var t=e.startIndex,n=e.endIndex;if(t!==r.state.dataStartIndex||n!==r.state.dataEndIndex){var i=r.state.updateId;r.setState(function(){return Q({dataStartIndex:t,dataEndIndex:n},f({props:r.props,dataStartIndex:t,dataEndIndex:n,updateId:i},r.state))}),r.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),u7(r,`handleMouseEnter`,function(e){var t=r.getMouseInfo(e);if(t){var n=Q(Q({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseEnter;(0,Z0.default)(i)&&i(n,e)}}),u7(r,`triggeredAfterMouseMove`,function(e){var t=r.getMouseInfo(e),n=t?Q(Q({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseMove;(0,Z0.default)(i)&&i(n,e)}),u7(r,`handleItemMouseEnter`,function(e){r.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),u7(r,`handleItemMouseLeave`,function(){r.setState(function(){return{isTooltipActive:!1}})}),u7(r,`handleMouseMove`,function(e){e.persist(),r.throttleTriggeredAfterMouseMove(e)}),u7(r,`handleMouseLeave`,function(e){r.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};r.setState(t),r.triggerSyncEvent(t);var n=r.props.onMouseLeave;(0,Z0.default)(n)&&n(t,e)}),u7(r,`handleOuterEvent`,function(e){var t=akt(e),n=(0,F0.default)(r.props,`${t}`);t&&(0,Z0.default)(n)&&n((/.*touch.*/i.test(t)?r.getMouseInfo(e.changedTouches[0]):r.getMouseInfo(e))??{},e)}),u7(r,`handleClick`,function(e){var t=r.getMouseInfo(e);if(t){var n=Q(Q({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onClick;(0,Z0.default)(i)&&i(n,e)}}),u7(r,`handleMouseDown`,function(e){var t=r.props.onMouseDown;(0,Z0.default)(t)&&t(r.getMouseInfo(e),e)}),u7(r,`handleMouseUp`,function(e){var t=r.props.onMouseUp;(0,Z0.default)(t)&&t(r.getMouseInfo(e),e)}),u7(r,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),u7(r,`handleTouchStart`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseDown(e.changedTouches[0])}),u7(r,`handleTouchEnd`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseUp(e.changedTouches[0])}),u7(r,`handleDoubleClick`,function(e){var t=r.props.onDoubleClick;(0,Z0.default)(t)&&t(r.getMouseInfo(e),e)}),u7(r,`handleContextMenu`,function(e){var t=r.props.onContextMenu;(0,Z0.default)(t)&&t(r.getMouseInfo(e),e)}),u7(r,`triggerSyncEvent`,function(e){r.props.syncId!==void 0&&Q5.emit($5,r.props.syncId,e,r.eventEmitterSymbol)}),u7(r,`applySyncEvent`,function(e){var t=r.props,n=t.layout,i=t.syncMethod,a=r.state.updateId,o=e.dataStartIndex,s=e.dataEndIndex;if(e.dataStartIndex!==void 0||e.dataEndIndex!==void 0)r.setState(Q({dataStartIndex:o,dataEndIndex:s},f({props:r.props,dataStartIndex:o,dataEndIndex:s,updateId:a},r.state)));else if(e.activeTooltipIndex!==void 0){var c=e.chartX,l=e.chartY,u=e.activeTooltipIndex,d=r.state,p=d.offset,m=d.tooltipTicks;if(!p)return;if(typeof i==`function`)u=i(m,e);else if(i===`value`){u=-1;for(var h=0;h<m.length;h++)if(m[h].value===e.activeLabel){u=h;break}}var g=Q(Q({},p),{},{x:p.left,y:p.top}),_=Math.min(c,g.x+g.width),v=Math.min(l,g.y+g.height),y=m[u]&&m[u].value,b=p7(r.state,r.props.data,u),x=m[u]?{x:n===`horizontal`?m[u].coordinate:_,y:n===`horizontal`?v:m[u].coordinate}:$qt;r.setState(Q(Q({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else r.setState(e)}),u7(r,`renderCursor`,function(e){var n=r.state,i=n.isTooltipActive,a=n.activeCoordinate,o=n.activePayload,s=n.offset,c=n.activeTooltipIndex,l=n.tooltipAxisBandSize,u=r.getTooltipEventType(),d=e.props.active??i,f=r.props.layout,p=e.key||`_recharts-cursor`;return g.createElement(Eqt,{key:p,activeCoordinate:a,activePayload:o,activeTooltipIndex:c,chartName:t,element:e,isActive:d,layout:f,offset:s,tooltipAxisBandSize:l,tooltipEventType:u})}),u7(r,`renderPolarAxis`,function(e,t,n){var i=(0,F0.default)(e,`type.axisType`),a=(0,F0.default)(r.state,`${i}Map`),o=e.type.defaultProps,s=o===void 0?e.props:Q(Q({},o),e.props),c=a&&a[s[`${i}Id`]];return(0,g.cloneElement)(e,Q(Q({},c),{},{className:Gp(i,c.className),key:e.key||`${t}-${n}`,ticks:M6(c,!0)}))}),u7(r,`renderPolarGrid`,function(e){var t=e.props,n=t.radialLines,i=t.polarAngles,a=t.polarRadius,o=r.state,s=o.radiusAxisMap,c=o.angleAxisMap,l=H0(s),u=H0(c),d=u.cx,f=u.cy,p=u.innerRadius,m=u.outerRadius;return(0,g.cloneElement)(e,{polarAngles:Array.isArray(i)?i:M6(u,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:M6(l,!0).map(function(e){return e.coordinate}),cx:d,cy:f,innerRadius:p,outerRadius:m,key:e.key||`polar-grid`,radialLines:n})}),u7(r,`renderLegend`,function(){var e=r.state.formattedGraphicalItems,t=r.props,n=t.children,i=t.width,a=t.height,o=r.props.margin||{},s=YRt({children:n,formattedGraphicalItems:e,legendWidth:i-(o.left||0)-(o.right||0),legendContent:c});if(!s)return null;var l=s.item;return(0,g.cloneElement)(l,Q(Q({},Pqt(s,Oqt)),{},{chartWidth:i,chartHeight:a,margin:o,onBBoxUpdate:r.handleLegendBBoxUpdate}))}),u7(r,`renderTooltip`,function(){var e=r.props,t=e.children,n=e.accessibilityLayer,i=n2(t,T4);if(!i)return null;var a=r.state,o=a.isTooltipActive,s=a.activeCoordinate,c=a.activePayload,l=a.activeLabel,u=a.offset,d=i.props.active??o;return(0,g.cloneElement)(i,{viewBox:Q(Q({},u),{},{x:u.left,y:u.top}),active:d,label:l,payload:d?c:[],coordinate:s,accessibilityLayer:n})}),u7(r,`renderBrush`,function(e){var t=r.props,n=t.margin,i=t.data,a=r.state,o=a.offset,s=a.dataStartIndex,c=a.dataEndIndex,l=a.updateId;return(0,g.cloneElement)(e,{key:e.key||`_recharts-brush`,onChange:P6(r.handleBrushChange,e.props.onChange),data:i,x:R0(e.props.x)?e.props.x:o.left,y:R0(e.props.y)?e.props.y:o.top+o.height+o.brushBottom-(n.bottom||0),width:R0(e.props.width)?e.props.width:o.width,startIndex:s,endIndex:c,updateId:`brush-${l}`})}),u7(r,`renderReferenceElement`,function(e,t,n){if(!e)return null;var i=r.clipPathId,a=r.state,o=a.xAxisMap,s=a.yAxisMap,c=a.offset,l=e.type.defaultProps||{},u=e.props,d=u.xAxisId,f=d===void 0?l.xAxisId:d,p=u.yAxisId,m=p===void 0?l.yAxisId:p;return(0,g.cloneElement)(e,{key:e.key||`${t}-${n}`,xAxis:o[f],yAxis:s[m],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:i})}),u7(r,`renderActivePoints`,function(e){var t=e.item,r=e.activePoint,i=e.basePoint,a=e.childIndex,o=e.isRange,s=[],c=t.props.key,l=t.item.type.defaultProps===void 0?t.item.props:Q(Q({},t.item.type.defaultProps),t.item.props),u=l.activeDot,d=l.dataKey,f=Q(Q({index:a,dataKey:d,cx:r.x,cy:r.y,r:4,fill:j6(t.item),strokeWidth:2,stroke:`#fff`,payload:r.payload,value:r.value},r2(u,!1)),J0(u));return s.push(n.renderActiveDot(u,f,`${c}-activePoint-${a}`)),i?s.push(n.renderActiveDot(u,Q(Q({},f),{},{cx:i.x,cy:i.y}),`${c}-basePoint-${a}`)):o&&s.push(null),s}),u7(r,`renderGraphicChild`,function(e,t,n){var i=r.filterFormatItem(e,t,n);if(!i)return null;var a=r.getTooltipEventType(),o=r.state,s=o.isTooltipActive,c=o.tooltipAxis,l=o.activeTooltipIndex,u=o.activeLabel,d=r.props.children,f=n2(d,T4),p=i.props,m=p.points,h=p.isRange,_=p.baseLine,v=i.item.type.defaultProps===void 0?i.item.props:Q(Q({},i.item.type.defaultProps),i.item.props),y=v.activeDot,b=v.hide,x=v.activeBar,S=v.activeShape,C=!!(!b&&s&&f&&(y||x||S)),w={};a!==`axis`&&f&&f.props.trigger===`click`?w={onClick:P6(r.handleItemMouseEnter,e.props.onClick)}:a!==`axis`&&(w={onMouseLeave:P6(r.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:P6(r.handleItemMouseEnter,e.props.onMouseEnter)});var T=(0,g.cloneElement)(e,Q(Q({},i.props),w));function E(e){return typeof c.dataKey==`function`?c.dataKey(e.payload):null}if(C)if(l>=0){var D,O;if(c.dataKey&&!c.allowDuplicatedCategory){var k=typeof c.dataKey==`function`?E:`payload.${c.dataKey.toString()}`;D=U0(m,k,u),O=h&&_&&U0(_,k,u)}else D=m?.[l],O=h&&_&&_[l];if(S||x){var A=e.props.activeIndex===void 0?l:e.props.activeIndex;return[(0,g.cloneElement)(e,Q(Q(Q({},i.props),w),{},{activeIndex:A})),null,null]}if(!(0,X0.default)(D))return[T].concat(c7(r.renderActivePoints({item:i,activePoint:D,basePoint:O,childIndex:l,isRange:h})))}else{var j=(r.getItemByXY(r.state.activeCoordinate)??{graphicalItem:T}).graphicalItem,M=j.item,N=M===void 0?e:M,P=j.childIndex;return[(0,g.cloneElement)(N,Q(Q(Q({},i.props),w),{},{activeIndex:P})),null,null]}return h?[T,null,null]:[T,null]}),u7(r,`renderCustomized`,function(e,t,n){return(0,g.cloneElement)(e,Q(Q({key:`recharts-customized-${n}`},r.props),r.state))}),u7(r,`renderMap`,{CartesianGrid:{handler:d7,once:!0},ReferenceArea:{handler:r.renderReferenceElement},ReferenceLine:{handler:d7},ReferenceDot:{handler:r.renderReferenceElement},XAxis:{handler:d7},YAxis:{handler:d7},Brush:{handler:r.renderBrush,once:!0},Bar:{handler:r.renderGraphicChild},Line:{handler:r.renderGraphicChild},Area:{handler:r.renderGraphicChild},Radar:{handler:r.renderGraphicChild},RadialBar:{handler:r.renderGraphicChild},Scatter:{handler:r.renderGraphicChild},Pie:{handler:r.renderGraphicChild},Funnel:{handler:r.renderGraphicChild},Tooltip:{handler:r.renderCursor,once:!0},PolarGrid:{handler:r.renderPolarGrid,once:!0},PolarAngleAxis:{handler:r.renderPolarAxis},PolarRadiusAxis:{handler:r.renderPolarAxis},Customized:{handler:r.renderCustomized}}),r.clipPathId=`${e.id??B0(`recharts`)}-clip`,r.throttleTriggeredAfterMouseMove=(0,Dqt.default)(r.triggeredAfterMouseMove,e.throttleDelay??1e3/60),r.state={},r}return Uqt(n,e),Rqt(n,[{key:`componentDidMount`,value:function(){this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:this.props.margin.left??0,top:this.props.margin.top??0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:`displayDefaultTooltip`,value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,i=e.layout,a=n2(t,T4);if(a){var o=a.props.defaultIndex;if(!(typeof o!=`number`||o<0||o>this.state.tooltipTicks.length-1)){var s=this.state.tooltipTicks[o]&&this.state.tooltipTicks[o].value,c=p7(this.state,n,o,s),l=this.state.tooltipTicks[o].coordinate,u=(this.state.offset.top+r)/2,d=i===`horizontal`?{x:l,y:u}:{y:l,x:u},f=this.state.formattedGraphicalItems.find(function(e){return e.item.type.name===`Scatter`});f&&(d=Q(Q({},d),f.props.points[o].tooltipPosition),c=f.props.points[o].tooltipPayload);var p={activeTooltipIndex:o,isTooltipActive:!0,activeLabel:s,activePayload:c,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(o)}}}},{key:`getSnapshotBeforeUpdate`,value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:this.props.margin.left??0,top:this.props.margin.top??0}}),null):null}},{key:`componentDidUpdate`,value:function(e){i2([n2(e.children,T4)],[n2(this.props.children,T4)])||this.displayDefaultTooltip()}},{key:`componentWillUnmount`,value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:`getTooltipEventType`,value:function(){var e=n2(this.props.children,T4);if(e&&typeof e.props.shared==`boolean`){var t=e.props.shared?`axis`:`item`;return o.indexOf(t)>=0?t:i}return i}},{key:`getMouseInfo`,value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=qNt(n),i={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,o=this.inRange(i.chartX,i.chartY,a);if(!o)return null;var s=this.state,c=s.xAxisMap,l=s.yAxisMap,u=this.getTooltipEventType(),d=rJt(this.state,this.props.data,this.props.layout,o);if(u!==`axis`&&c&&l){var f=H0(c).scale,p=H0(l).scale,m=f&&f.invert?f.invert(i.chartX):null,h=p&&p.invert?p.invert(i.chartY):null;return Q(Q({},i),{},{xValue:m,yValue:h},d)}return d?Q(Q({},i),d):null}},{key:`inRange`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=this.props.layout,i=e/n,a=t/n;if(r===`horizontal`||r===`vertical`){var o=this.state.offset;return i>=o.left&&i<=o.left+o.width&&a>=o.top&&a<=o.top+o.height?{x:i,y:a}:null}var s=this.state,c=s.angleAxisMap,l=s.radiusAxisMap;if(c&&l){var u=H0(c);return Gzt({x:i,y:a},u)}return null}},{key:`parseEventsOfWrapper`,value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=n2(e,T4),r={};return n&&t===`axis`&&(r=n.props.trigger===`click`?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),Q(Q({},J0(this.props,this.handleOuterEvent)),r)}},{key:`addListener`,value:function(){Q5.on($5,this.handleReceiveSyncEvent)}},{key:`removeListener`,value:function(){Q5.removeListener($5,this.handleReceiveSyncEvent)}},{key:`filterFormatItem`,value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,i=0,a=r.length;i<a;i++){var o=r[i];if(o.item===e||o.props.key===e.key||t===Q0(o.item.type)&&n===o.childIndex)return o}return null}},{key:`renderClipPath`,value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,r=t.top,i=t.height,a=t.width;return g.createElement(`defs`,null,g.createElement(`clipPath`,{id:e},g.createElement(`rect`,{x:n,y:r,height:i,width:a})))}},{key:`getXScales`,value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=Aqt(t,2),r=n[0],i=n[1];return Q(Q({},e),{},u7({},r,i.scale))},{}):null}},{key:`getYScales`,value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=Aqt(t,2),r=n[0],i=n[1];return Q(Q({},e),{},u7({},r,i.scale))},{}):null}},{key:`getXScaleByAxisId`,value:function(e){var t;return(t=this.state.xAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getYScaleByAxisId`,value:function(e){var t;return(t=this.state.yAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getItemByXY`,value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var i=0,a=n.length;i<a;i++){var o=n[i],s=o.props,c=o.item,l=c.type.defaultProps===void 0?c.props:Q(Q({},c.type.defaultProps),c.props),u=Q0(c.type);if(u===`Bar`){var d=(s.data||[]).find(function(t){return dUt(e,t)});if(d)return{graphicalItem:o,payload:d}}else if(u===`RadialBar`){var f=(s.data||[]).find(function(t){return Gzt(e,t)});if(f)return{graphicalItem:o,payload:f}}else if(s5(o,r)||c5(o,r)||l5(o,r)){var p=XWt({graphicalItem:o,activeTooltipItem:r,itemData:l.data}),m=l.activeIndex===void 0?p:l.activeIndex;return{graphicalItem:Q(Q({},o),{},{childIndex:m}),payload:l5(o,r)?l.data[p]:o.props.data[p]}}}return null}},{key:`render`,value:function(){var e=this;if(!$Ot(this))return null;var t=this.props,n=t.children,r=t.className,i=t.width,a=t.height,o=t.style,s=t.compact,c=t.title,l=t.desc,u=r2(Pqt(t,kqt),!1);if(s)return g.createElement(cKt,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},g.createElement(o2,a7({},u,{width:i,height:a,title:c,desc:l}),this.renderClipPath(),ikt(n,this.renderMap)));this.props.accessibilityLayer&&(u.tabIndex=this.props.tabIndex??0,u.role=this.props.role??`application`,u.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},u.onFocus=function(){e.accessibilityManager.focus()});var d=this.parseEventsOfWrapper();return g.createElement(cKt,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},g.createElement(`div`,a7({className:Gp(`recharts-wrapper`,r),style:Q({position:`relative`,cursor:`default`,width:i,height:a},o)},d,{ref:function(t){e.container=t}}),g.createElement(o2,a7({},u,{width:i,height:a,title:c,desc:l,style:Qqt}),this.renderClipPath(),ikt(n,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(g.Component);u7(p,`displayName`,t),u7(p,`defaultProps`,Q({layout:`horizontal`,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`},u)),u7(p,`getDerivedStateFromProps`,function(e,t){var n=e.dataKey,r=e.data,i=e.children,a=e.width,o=e.height,s=e.layout,c=e.stackOffset,l=e.margin,u=t.dataStartIndex,d=t.dataEndIndex;if(t.updateId===void 0){var p=cJt(e);return Q(Q(Q({},p),{},{updateId:0},f(Q(Q({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(n!==t.prevDataKey||r!==t.prevData||a!==t.prevWidth||o!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!W0(l,t.prevMargin)){var m=cJt(e),h={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=Q(Q({},rJt(t,r,s)),{},{updateId:t.updateId+1}),_=Q(Q(Q({},m),h),g);return Q(Q(Q({},_),f(Q({props:e},_),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(!i2(i,t.prevChildren)){var v=n2(i,E5),y=v?v.props?.startIndex??u:u,b=v?v.props?.endIndex??d:d,x=y!==u||b!==d,S=!(0,X0.default)(r)&&!x?t.updateId:t.updateId+1;return Q(Q({updateId:S},f(Q(Q({props:e},t),{},{updateId:S,dataStartIndex:y,dataEndIndex:b}),t)),{},{prevChildren:i,dataStartIndex:y,dataEndIndex:b})}return null}),u7(p,`renderActiveDot`,function(e,t,n){var r=(0,g.isValidElement)(e)?(0,g.cloneElement)(e,t):(0,Z0.default)(e)?e(t):g.createElement(B8,t);return g.createElement(c2,{className:`recharts-active-dot`,key:n},r)});var m=(0,g.forwardRef)(function(e,t){return g.createElement(p,a7({},e,{ref:t}))});return m.displayName=p.displayName,m}({chartName:`PieChart`,GraphicalChild:_5,validateTooltipEventTypes:[`item`],defaultTooltipEventType:`item`,legendContent:`children`,axisComponents:[{axisType:`angleAxis`,AxisComp:n5},{axisType:`radiusAxis`,AxisComp:Y8}],formatAxisMap:Bzt,defaultProps:{layout:`centric`,startAngle:0,endAngle:360,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`}}),mJt={success:`fill-green-500`,failed:`fill-red-600`,skipped:`fill-neutral-500`,"in-progress":`fill-blue-500`},hJt=({deployment:e,className:t,size:n=20,innerRadius:r=45})=>(0,W.jsx)(pJt,{width:n,height:n,margin:{top:0,left:0,right:0,bottom:0},className:G(`relative`,t),children:(0,W.jsx)(_5,{className:G(`stroke-white dark:stroke-gray-950 [&_.recharts-pie-sector]:outline-hidden`),data:e.stages.map(e=>({name:e.stage,status:e.status,value:1,className:mJt[e.status]})),cx:`50%`,cy:`50%`,startAngle:90,endAngle:-270,innerRadius:`${r}%`,outerRadius:`100%`,stroke:``,strokeLinejoin:`round`,dataKey:`value`,nameKey:`name`,isAnimationActive:!1,style:{outline:`none`}})}),gJt=({item:e,isSelected:t,onSelect:n})=>{let r=new Date(e.createdOn),i=QDt(r)?`${f0(r,`H:mm:ss`)} Today`:ZDt(r)?`${f0(r,`H:mm:ss ccc d, MMM`)}`:`${f0(r,`H:mm:ss ccc d`)} ${f0(r,`MMM yyy`)}`;return(0,W.jsxs)(`div`,{className:(0,EP.default)(`flex items-center gap-2 px-3 cursor-pointer h-10 border-border border-b`,{"bg-gray-100":t,"hover:bg-gray-50 hover:text-gray-900":!t}),onClick:()=>n(),children:[(0,W.jsx)(`div`,{className:`flex justify-center items-center w-5 shrink-0`,children:(0,W.jsx)(hJt,{deployment:e})}),(0,W.jsx)(`span`,{className:`w-full text-sm truncate`,children:i})]})},_Jt=()=>gz(`auto-open-feedback`,void 0),vJt=()=>{let[,e]=WA(`build`);return{openBuildFeedback:t=>e(t)}},yJt=()=>{let[e]=_Jt(),{environment:t}=lh([`account`,`project`,`environment`]),{data:n}=eM(t.name),r=n?.data?.at(0),{openBuildFeedback:i}=vJt(),a=(0,g.useRef)(e),o=(0,g.useRef)(i);(0,g.useEffect)(()=>{o.current=i},[i]),(0,g.useEffect)(()=>{a.current=e},[e]),(0,g.useEffect)(()=>{a.current===!0&&r?.id&&r.stages.some(({status:e})=>e===`failed`)&&o.current(r.id)},[r?.id,r?.stages])},bJt=()=>{let[e,t]=_Jt();return(0,W.jsxs)(Ok,{open:e===void 0,children:[(0,W.jsx)(kk,{asChild:!0,children:(0,W.jsxs)(`label`,{className:`flex gap-2 items-center text-xs font-medium cursor-pointer`,children:[(0,W.jsx)(AV,{checked:e,onCheckedChange:()=>t(e=>!e)}),`Auto-open feedback`]})}),(0,W.jsxs)(Ak,{className:`mr-2`,children:[`Try automatically open build feedback next time`,(0,W.jsx)(jk,{})]})]})},xJt={"in-progress":`Building`,success:`Finished`,failed:`Failed`,skipped:`Skipped`},SJt=({status:e})=>xJt[e],CJt={lint:`Lint`,build:`Build`,deploy:`Deploy`},wJt=({step:e})=>CJt[e]??e,TJt={"dev-portal":`devPortal`,api:`api`},EJt=e=>e.map(([e,t,n])=>({timestamp:e,severity:t,message:n})).sort((e,t)=>e.timestamp.localeCompare(t.timestamp)),DJt=e=>e.filter(e=>e.severity===`warn`).length,OJt=(e,t)=>{let n=e[TJt[t]];return n?EJt(Object.values(n).flat()):[]},kJt=(e,t,n)=>{let r=e[TJt[t]];if(!r)return[];let i=r[n];return i?EJt(i):[]},AJt=({text:e})=>e.split(/(https?:\/\/\S+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,W.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:e},`${e}-${t}`):e),m7=e(i(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))}))(),1);function jJt({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}var MJt=jJt();function NJt(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(MJt,``)}var PJt=({logs:e,children:t,className:n})=>(0,W.jsx)(`div`,{className:G(`grid grid-cols-[auto_1fr] auto-rows-min gap-x-5 py-4 text-xs h-full overflow-auto`,`bg-neutral-950 font-mono text-white`,n),children:t||(e.length>0?e.map(({timestamp:e,severity:t,message:n},r)=>(0,W.jsxs)(`div`,{className:G(`grid grid-cols-subgrid col-span-full px-4 py-1 hover:bg-neutral-800 text-neutral-200`,{"text-red-400":t===`error`,"text-yellow-400":t===`warn`,"text-green-500":/^\x1b\[32m/.test(n)}),children:[(0,W.jsx)(`div`,{className:`select-none`,children:(0,m7.default)(e).format(`HH:mm:ss.SSS`)}),(0,W.jsx)(`pre`,{className:`whitespace-pre-wrap`,children:(0,W.jsx)(AJt,{text:NJt(n).trim()})})]},`${e}-${r}`)):(0,W.jsx)(`div`,{className:`text-neutral-300 italic px-4`,children:`No logs available`}))}),FJt=({stage:e,buildLogs:t,isLoading:n})=>(0,W.jsx)(`div`,{className:`divide-y divide-neutral-800`,children:[...e.steps??[]].sort((e,t)=>e.ordinal-t.ordinal).map(r=>{let i=kJt(t,e.stage,r.step),a=DJt(i);return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 text-xs font-medium bg-neutral-900 text-neutral-300`,children:[(0,W.jsx)(qz,{status:r.status}),(0,W.jsx)(wJt,{step:r.step}),a>0&&(0,W.jsxs)(LS,{variant:`warn`,children:[a,` warning`,a>1?`s`:``]})]}),(0,W.jsx)(PJt,{logs:i,children:n&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-0.5 col-span-full px-4`,children:[(0,W.jsx)(hN,{className:`h-4 w-3/6 bg-white/20`}),(0,W.jsx)(hN,{className:`h-4 w-2/6 bg-white/20`})]})})]},r.id)})}),IJt=(e,t)=>e?t(e):void 0,LJt=({deployment:e,defaultOpen:t})=>{let{environment:n}=lh([`environment`]),r=Dxt(n.name,e.id,{});return r.isPending?(0,W.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,W.jsx)(hN,{className:`h-10 w-full`}),(0,W.jsx)(hN,{className:`h-10 w-full`})]}):r.isError?(0,W.jsx)(PS,{variant:`warning`,children:(0,W.jsx)(IS,{className:`text-center`,children:(0,W.jsx)(`div`,{className:`text-neutral-600 text-lg`,children:r.error?r.error.status===401||r.error.status===403?`You don't have permission to view build logs for this deployment.`:r.error.status===404?`Deployment not found. The selected deployment may have been deleted or doesn't exist.`:r.error.status===500?`Server error occurred while loading build logs. Please try again or contact support if the problem persists.`:`Unable to load build logs. Please try again or contact support if the problem persists.`:`Could not load logs. Please try again or contact support if the problem persists.`})})}):(0,W.jsx)(lV,{className:`divide-y overflow-hidden`,children:e.stages.map((n,i)=>(0,W.jsx)(RJt,{stage:n,stageIndex:i,stageCount:e.stages.length,buildLogs:r.data,isLoading:r.isLoading,defaultOpen:t},n.id))})},RJt=({stage:e,stageIndex:t,stageCount:n,buildLogs:r,isLoading:i,defaultOpen:a})=>{let o=e.steps&&e.steps.length>0;return(0,W.jsxs)(Uz,{defaultOpen:a,children:[(0,W.jsx)(Wz,{asChild:!0,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2 p-2 w-full hover:bg-accent cursor-pointer group`,children:[(0,W.jsx)(qz,{status:e.status}),(0,W.jsxs)(`div`,{className:`font-medium`,children:[(0,W.jsxs)(`span`,{className:`font-mono text-xs me-2`,children:[`(`,t+1,`/`,n,`)`]}),`Building `,(0,W.jsx)(Kz,{stage:e.stage})]}),(0,W.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:(0,W.jsx)(SJt,{status:e.status})}),(0,W.jsx)(`div`,{className:`text-xs text-amber-400`,children:IJt(DJt(OJt(r,e.stage)),e=>(0,W.jsxs)(LS,{variant:`warn`,children:[e,` warning`,e>1?`s`:``]}))}),(0,W.jsx)(`div`,{className:`ms-2 flex items-center justify-center`,children:(0,W.jsx)(ym,{className:`w-4 h-4 transition-transform group-data-[state=closed]:-rotate-90`})})]})}),(0,W.jsx)(Gz,{children:o?(0,W.jsx)(FJt,{stage:e,buildLogs:r,isLoading:i}):(0,W.jsx)(PJt,{logs:OJt(r,e.stage),children:i&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-0.5 col-span-full px-4`,children:[(0,W.jsx)(hN,{className:`h-4 w-3/6 bg-white/20`}),(0,W.jsx)(hN,{className:`h-4 w-2/6 bg-white/20`})]})})})]})},zJt=({build:e})=>(0,W.jsx)(`div`,{className:`p-4 w-full`,children:(0,W.jsx)(LJt,{deployment:e,defaultOpen:!0})}),BJt=()=>{let[e,t]=WA(`build`);yJt();let{environment:n}=lh([`account`,`project`,`environment`]),{data:r}=eM(n.name),i=r?.data?.find(t=>t.id===e);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(mN,{}),(0,W.jsxs)(pN,{className:`min-h-36 shadow-[rgb(215_215_215/15%)_0px_-4px_3px_0px] dark:shadow-[rgb(0_0_0/40%)_0px_-4px_3px_0px]`,defaultSize:30,children:[(0,W.jsxs)(`div`,{className:`flex gap-2 border-b h-8 items-center justify-between group bg-surface-muted px-3`,children:[(0,W.jsx)(`div`,{className:`divide-neutral-200`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2 group rounded-none relative text-xs font-medium`,title:e,children:[(0,W.jsx)(kre,{size:16}),e?`Build ${e.slice(0,8)}`:`Builds`]})}),(0,W.jsxs)(`div`,{className:`flex flex-row gap-2`,children:[(0,W.jsx)(bJt,{}),(0,W.jsx)(Y,{variant:`ghost`,size:`icon-xs`,onClick:()=>t(void 0),children:(0,W.jsx)(nh,{size:18})})]})]}),(0,W.jsxs)(`div`,{className:`h-[calc(100%-2rem)]`,children:[r?.data?.length===0&&(0,W.jsx)(`div`,{className:`p-3 text-sm`,children:`Start changing your local copy to see build information.`}),(0,W.jsxs)(`div`,{className:`divide-x grid grid-cols-[min-content_1fr] w-full h-full`,children:[(0,W.jsx)(`div`,{className:`overflow-y-auto`,children:r?.data?.map(n=>(0,W.jsx)(gJt,{item:n,isSelected:n.id===e,onSelect:()=>t(n.id)},`${n.id}`))}),(0,W.jsx)(`div`,{className:`overflow-y-auto`,children:e&&i?(0,W.jsx)(zJt,{build:i}):(0,W.jsx)(`div`,{className:`p-3 text-sm`,children:`Select a build to view more information.`})})]})]})]})]})};function h7(e,t){return e.filter(e=>e.isActive?.(t)??!0)}function VJt(e,t){return e.findIndex(e=>e.id===t)}function HJt(e,t){return h7(e,t)[0]?.id??e[0]?.id??``}function UJt(e,t){let n=e.initialAnswers(t);return{answers:n,currentStepId:HJt(e.steps,n),history:[],tasks:{},status:`active`}}function WJt(e,t,n){let r=h7(e,t);if(r.some(e=>e.id===n))return n;let i=e.findIndex(e=>e.id===n),a=new Set(r.map(e=>e.id));for(let t=i;t>=0;t--)if(a.has(e[t].id))return e[t].id;return r[0]?.id??n}function GJt(e,t,n){switch(n.type){case`PATCH_ANSWERS`:{let r={...t.answers,...n.partial};return{...t,answers:r,currentStepId:WJt(e,r,t.currentStepId)}}case`NEXT`:{let n=h7(e,t.answers),r=n[VJt(n,t.currentStepId)+1];return r?{...t,currentStepId:r.id,history:[...t.history,t.currentStepId]}:t}case`BACK`:{let n=t.history[t.history.length-1];return n===void 0?t:{...t,currentStepId:WJt(e,t.answers,n),history:t.history.slice(0,-1)}}case`GOTO`:return!h7(e,t.answers).some(e=>e.id===n.stepId)||n.stepId===t.currentStepId?t:{...t,currentStepId:n.stepId,history:[...t.history,t.currentStepId]};case`SET_TASK`:return{...t,tasks:{...t.tasks,[n.stepId]:n.task}};case`COMPLETE`:return{...t,status:`completed`};case`RESET`:return{answers:n.answers,currentStepId:n.firstStepId,history:[],tasks:{},status:`active`};default:return t}}function KJt({selected:e,onClick:t,title:n,description:r,icon:i,indicator:a=`radio`,role:o,disabled:s,className:c}){return(0,W.jsxs)(`button`,{type:`button`,onClick:t,disabled:s,role:o,"aria-checked":o?e:void 0,"aria-pressed":o?void 0:e,className:G(`flex w-full flex-col items-start gap-1 rounded-md border bg-surface p-4 text-left transition-colors`,s?`cursor-not-allowed opacity-50`:`cursor-pointer hover:border-neutral-300 dark:hover:border-neutral-600 hover:bg-neutral-50 dark:hover:bg-neutral-800`,e&&!s&&`border-zuplo-500 bg-zuplo-50/30 hover:bg-zuplo-50/30`,c),children:[(0,W.jsxs)(`div`,{className:`flex w-full items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i&&(0,W.jsx)(`div`,{className:G(`rounded-md border p-1.5`,e?`border-zuplo-500 text-zuplo-500`:`text-foreground`),children:i}),(0,W.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n})]}),a!==`none`&&(0,W.jsx)(qJt,{kind:a,selected:e})]}),r&&(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r})]})}function qJt({kind:e,selected:t}){return e===`checkbox`?(0,W.jsx)(`span`,{className:G(`flex size-4 shrink-0 items-center justify-center rounded border-2`,t?`border-zuplo-500 bg-zuplo-500 text-white`:`border-neutral-300 dark:border-neutral-600`),children:t&&(0,W.jsx)(vm,{size:12,strokeWidth:3})}):(0,W.jsx)(`span`,{className:G(`size-4 shrink-0 rounded-full border-2`,t?`border-zuplo-500 bg-zuplo-500 ring-2 ring-inset ring-white`:`border-neutral-300 dark:border-neutral-600`)})}var JJt=e=>G(`grid gap-3`,e===1&&`grid-cols-1`,e===2&&`grid-cols-1 sm:grid-cols-2`,e===3&&`grid-cols-1 sm:grid-cols-3`);function YJt({value:e,onChange:t,options:n,columns:r=1}){return(0,W.jsx)(`div`,{className:JJt(r),role:`radiogroup`,children:n.map(n=>(0,W.jsx)(KJt,{selected:e===n.value,onClick:()=>t(n.value),title:n.title,description:n.description,icon:n.icon,disabled:n.disabled,indicator:`radio`,role:`radio`},n.value))})}function XJt({values:e,onChange:t,options:n,columns:r=1}){let i=n=>t(e.includes(n)?e.filter(e=>e!==n):[...e,n]);return(0,W.jsx)(`div`,{className:JJt(r),children:n.map(t=>(0,W.jsx)(KJt,{selected:e.includes(t.value),onClick:()=>i(t.value),title:t.title,description:t.description,icon:t.icon,disabled:t.disabled,indicator:`checkbox`,role:`checkbox`},t.value))})}var ZJt=`sm:max-w-2xl p-0 gap-0 flex max-h-[85vh] flex-col overflow-hidden`,QJt=`flex-1 min-h-0 overflow-y-auto px-6 py-5 flex flex-col gap-4`;function $Jt({label:e,className:t}){return(0,W.jsxs)(`output`,{className:G(`flex items-center gap-3 rounded-md border bg-neutral-50 px-4 py-3 text-sm text-neutral-700`,t),children:[(0,W.jsx)(Km,{className:`size-4 shrink-0 animate-spin text-zuplo-500`}),(0,W.jsx)(`span`,{children:e??`Working…`})]})}function eYt({message:e,onRetry:t,retryable:n=!0}){return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm`,role:`alert`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(th,{className:`mt-0.5 size-4 shrink-0`}),(0,W.jsx)(`span`,{className:`font-medium`,children:e})]}),n&&(0,W.jsx)(`div`,{children:(0,W.jsx)(Y,{size:`sm`,variant:`outline`,onClick:t,children:`Try again`})})]})}function g7({children:e}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-emerald-700`,children:[(0,W.jsx)(Em,{className:`size-4 shrink-0`}),(0,W.jsx)(`span`,{children:e})]})}function tYt({steps:e,currentIndex:t}){return e.length<=1?null:(0,W.jsx)(`ol`,{className:`flex flex-nowrap items-center gap-1.5 overflow-hidden`,children:e.map((n,r)=>{let i=r<t,a=r===t;return(0,W.jsxs)(`li`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:G(`flex size-5 shrink-0 items-center justify-center rounded-full border text-[11px] font-medium`,i&&`border-zuplo-500 bg-zuplo-500 text-white`,a&&`border-zuplo-500 text-zuplo-600`,!i&&!a&&`border-neutral-300 text-neutral-400`),children:i?(0,W.jsx)(vm,{size:12,strokeWidth:3}):r+1}),a&&(0,W.jsx)(`span`,{className:`whitespace-nowrap text-xs font-medium text-foreground`,children:n.title}),r<e.length-1&&(0,W.jsx)(`span`,{className:`h-px w-3 shrink-0 bg-border`,"aria-hidden":!0})]},n.id)})})}var _7={status:`pending`},nYt={status:`skipped`},rYt=e=>({status:`applied`,result:e}),iYt=1;function v7(e,t){return`zpl_wizard:${e}:${t.account}/${t.project}/${t.environment}`}function y7(){try{return typeof window>`u`?void 0:window.sessionStorage}catch{return}}function aYt(e,t,n){let r=y7();if(!r)return;let i=r.getItem(v7(e,t));if(i)try{let e=JSON.parse(i);if(e.v!==iYt)return;let t=h7(n,e.answers),r=t.some(t=>t.id===e.currentStepId)?e.currentStepId:t[0]?.id??e.currentStepId;return{answers:e.answers,currentStepId:r,history:e.history??[],tasks:e.tasks??{},status:e.status??`active`}}catch{return}}function oYt(e,t,n){let r=y7();if(!r)return;let i={v:iYt,answers:n.answers,currentStepId:n.currentStepId,history:n.history,tasks:Object.fromEntries(Object.entries(n.tasks).filter(([,e])=>e.state!==`running`)),status:n.status};try{r.setItem(v7(e,t),JSON.stringify(i))}catch{}}function sYt(e,t){y7()?.removeItem(v7(e,t))}function cYt(e){return e instanceof Error?e.message:typeof e==`string`?e:`Something went wrong`}function lYt(e,t,n){let{id:r,steps:i}=e,[a,o]=(0,g.useReducer)((0,g.useCallback)((e,t)=>GJt(i,e,t),[i]),void 0,()=>aYt(r,t,i)??UJt(e,t)),s=(0,g.useRef)(a);s.current=a;let c=(0,g.useRef)(n);c.current=n,(0,g.useEffect)(()=>{oYt(r,t,a)},[r,t,a]);let l=(0,g.useMemo)(()=>h7(i,a.answers),[i,a.answers]),u=VJt(l,a.currentStepId),d=l[u],f=(0,g.useCallback)(e=>{o({type:`PATCH_ANSWERS`,partial:e})},[]),p=(0,g.useRef)(null),m=(0,g.useRef)(null),h=(0,g.useRef)(new Set),_=(0,g.useCallback)(async(e,t,n)=>{m.current={stepId:e.id,kind:t},o({type:`SET_TASK`,stepId:e.id,task:{state:`running`}}),p.current?.abort();let r=new AbortController;p.current=r;try{return await n({answers:s.current.answers,patch:f,signal:r.signal,setProgress:t=>o({type:`SET_TASK`,stepId:e.id,task:{state:`running`,progress:t}}),services:c.current}),o({type:`SET_TASK`,stepId:e.id,task:{state:`idle`}}),!0}catch(t){return o({type:`SET_TASK`,stepId:e.id,task:{state:`error`,error:cYt(t),retryable:!0}}),!1}},[f]),v=(0,g.useCallback)(e=>i.find(t=>t.id===e),[i]),y=(0,g.useCallback)(()=>{let e=s.current;return h7(i,e.answers).find(t=>t.id===e.currentStepId)},[i]),b=(0,g.useCallback)(async()=>{let e=y();e&&(e.onExit&&!await _(e,`exit`,e.onExit)||o({type:`NEXT`}))},[y,_]),x=(0,g.useCallback)(()=>o({type:`BACK`}),[]),S=(0,g.useCallback)(()=>{let e=y();e?.onSkip&&o({type:`PATCH_ANSWERS`,partial:e.onSkip(s.current.answers)}),o({type:`NEXT`})},[y]),C=(0,g.useCallback)(e=>o({type:`GOTO`,stepId:e}),[]),w=(0,g.useCallback)(()=>{let e=m.current;if(!e)return;let t=v(e.stepId);t&&(e.kind===`exit`?b():t.onEnter&&_(t,`enter`,t.onEnter))},[b,_,v]),T=(0,g.useCallback)(()=>{sYt(r,t),h.current.clear();let n=UJt(e,t);o({type:`RESET`,answers:n.answers,firstStepId:n.currentStepId})},[e,r,t]),E=(0,g.useCallback)(()=>{sYt(r,t),o({type:`COMPLETE`})},[r,t]);(0,g.useEffect)(()=>{if(!d?.onEnter||h.current.has(d.id))return;let e=a.tasks[d.id];e?.state===`running`||e?.state===`error`||(h.current.add(d.id),_(d,`enter`,d.onEnter))},[d,_,a.tasks]);let D=d?.canAdvance?.(a.answers)??!0;return{answers:a.answers,patch:f,currentStep:d,activeSteps:l,index:u,isFirst:u<=0,isLast:u===l.length-1,progress:{current:u+1,total:l.length},canAdvance:D===!0,advanceBlockedReason:D===!0?void 0:D,task:d?a.tasks[d.id]:void 0,status:a.status,next:b,back:x,skip:S,goTo:C,retry:w,reset:T,complete:E}}var uYt=(0,g.createContext)(null),dYt=uYt.Provider;function b7(){let e=(0,g.useContext)(uYt);if(!e)throw Error(`useWizard must be used within a <WizardShell>`);return e}function fYt({showBack:e,isLast:t,canAdvance:n,blockedReason:r,skippable:i,busy:a,nextLabel:o,skipLabel:s,onBack:c,onSkip:l,onNext:u,onFinish:d}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-t px-6 py-4`,children:[e&&(0,W.jsx)(Y,{variant:`outline`,onClick:c,disabled:a,children:`Back`}),(0,W.jsx)(`div`,{className:`flex-1`}),i&&(0,W.jsx)(Y,{variant:`ghost`,onClick:l,disabled:a,children:s??`Skip`}),(0,W.jsxs)(Y,{variant:`brand`,onClick:t?d:u,disabled:a||!n,title:n?void 0:r,children:[a&&(0,W.jsx)(Km,{className:`size-4 animate-spin`}),o??(t?`Finish`:`Continue`)]})]})}function pYt({definition:e,launch:t,services:n,onClose:r,onComplete:i}){let a=lYt(e,t,n),{currentStep:o,activeSteps:s,index:c,isFirst:l,task:u,status:d,answers:f}=a,p=u?.state===`running`;if((0,g.useEffect)(()=>{d===`completed`&&i(f)},[d,f,i]),!o||d===`completed`)return null;let m=o.Component;return(0,W.jsx)(dYt,{value:a,children:(0,W.jsx)(kA,{open:!0,onOpenChange:e=>{!e&&!p&&r()},children:(0,W.jsxs)(MA,{className:ZJt,showCloseButton:!p,onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,W.jsxs)(NA,{className:`shrink-0 gap-2 border-b px-6 py-4`,children:[(0,W.jsx)(FA,{children:e.title}),o.description&&(0,W.jsx)(IA,{children:o.description}),(0,W.jsx)(`div`,{className:`pt-1`,children:(0,W.jsx)(tYt,{steps:s,currentIndex:c})})]}),(0,W.jsxs)(`div`,{className:QJt,children:[(0,W.jsx)(m,{}),!o.ownsStatus&&u?.state===`running`&&(0,W.jsx)($Jt,{label:u.progress?.label}),!o.ownsStatus&&u?.state===`error`&&(0,W.jsx)(eYt,{message:u.error,retryable:u.retryable,onRetry:a.retry})]}),(0,W.jsx)(fYt,{showBack:!l&&!o.isFinal,isLast:a.isLast,canAdvance:a.canAdvance,blockedReason:a.advanceBlockedReason,skippable:o.skippable,busy:p,nextLabel:o.nextLabel,skipLabel:o.skipLabel,onBack:a.back,onSkip:a.skip,onNext:a.next,onFinish:a.complete})]})})})}var mYt=`api-key-inbound`,hYt=`rate-limit-inbound`,gYt={second:1/60,"10s":1/6,"30s":.5,minute:1},_Yt={second:`second`,"10s":`10 seconds`,"30s":`30 seconds`,minute:`minute`};function vYt(){return{name:mYt,policyType:`api-key-inbound`,handler:{export:`ApiKeyInboundPolicy`,module:`$import(@zuplo/runtime)`,options:{allowUnauthenticatedRequests:!1,cacheTtlSeconds:60}}}}function yYt(e){return{name:hYt,policyType:`rate-limit-inbound`,handler:{export:`RateLimitInboundPolicy`,module:`$import(@zuplo/runtime)`,options:{rateLimitBy:e.rateLimitBy,requestsAllowed:e.requests,timeWindowMinutes:gYt[e.period]}}}}var bYt=async({answers:e,patch:t,services:n,setProgress:r})=>{if(e.apiKey.status===`applied`)return;let{keyName:i,managerEmail:a}=e.apiKeyDraft;r({label:`Creating your API key consumer…`});let{created:o}=await n.createConsumer({keyName:i,managerEmail:a});t({apiKey:rYt({keyName:i,managerEmail:a,consumerCreated:o,policyName:mYt})})};function xYt(e,t){if(t.selectedPolicies.includes(`api-key`)&&e.commitPolicyToAllRoutes(vYt()),t.selectedPolicies.includes(`rate-limit`)){let n=t.selectedPolicies.includes(`api-key`)?`user`:`ip`;e.commitPolicyToAllRoutes(yYt({requests:t.rateLimitDraft.requests,period:t.rateLimitDraft.period,rateLimitBy:n}))}}async function SYt(e,t=4){for(let n=1;n<=t;n++)try{return await e.save()}catch(e){if(n===t)throw e;await new Promise(e=>setTimeout(e,2**(n-1)*500))}return{}}var CYt=()=>{let e=lh(),t=uO(e.environment);return{deploymentDevPortalUrl:uO(e.environment,`dev-portal`),deploymentUrl:t?new URL(t).toString().replace(/\/$/,``):void 0}};function wYt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Add gateway policies to your endpoints. There are many more you can add manually later.`}),(0,W.jsx)(XJt,{values:e.selectedPolicies,onChange:e=>t({selectedPolicies:e}),options:[{value:`api-key`,title:`API Key Authentication`,description:`Arguably the best authentication method for B2B APIs — used by the greats like Stripe, OpenAI, and more.`},{value:`rate-limit`,title:`Rate Limiting`,description:`Protect your API from accidental misuse — the most common, and unprotected, form of DoS you'll face.`}]})]})}function TYt(){let{answers:e,patch:t}=b7(),{keyName:n,managerEmail:r}=e.apiKeyDraft;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`We'll create an API key in your development environment so you can test right away.`}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`Key name`}),(0,W.jsx)(jV,{value:n,placeholder:`test-key`,onChange:n=>t({apiKeyDraft:{...e.apiKeyDraft,keyName:n.target.value}})})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`Manager email`}),(0,W.jsx)(jV,{type:`email`,value:r,onChange:n=>t({apiKeyDraft:{...e.apiKeyDraft,managerEmail:n.target.value}})})]}),e.apiKey.status===`applied`&&(0,W.jsx)(g7,{children:e.apiKey.result.consumerCreated?`API key consumer created.`:`API key policy added — you can create a consumer later from Services.`})]})}var EYt=[`minute`,`30s`,`10s`,`second`];function DYt(){let{answers:e,patch:t}=b7(),{period:n,requests:r}=e.rateLimitDraft;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`Period`}),(0,W.jsxs)(wW,{value:n,onValueChange:n=>t({rateLimitDraft:{...e.rateLimitDraft,period:n}}),children:[(0,W.jsx)(EW,{className:`w-48`,children:(0,W.jsx)(TW,{})}),(0,W.jsx)(DW,{children:EYt.map(e=>(0,W.jsx)(OW,{value:e,children:e===`minute`?`Minute`:e===`second`?`Second`:_Yt[e]},e))})]})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`span`,{className:`text-sm font-medium`,children:[`Requests per `,_Yt[n],` allowed`]}),(0,W.jsx)(jV,{type:`number`,min:1,hideNumberArrows:!0,className:`w-48`,value:Number.isFinite(r)?r:``,onChange:n=>t({rateLimitDraft:{...e.rateLimitDraft,requests:Number(n.target.value)}})})]}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It's more fun to test with a low count per minute — you can change this later. (For sub-minute periods we convert to a fractional window.)`})]})}var OYt=[`api`,`dev-portal`];function kYt(){let e=lh([`environment`]),{answers:t,task:n,retry:r}=b7(),{deploymentDevPortalUrl:i}=CYt(),a=t.saved.status===`applied`,o=n?.state===`error`,s=C_($j(e.environment.name,{refetchInterval:4e3})).data?.data?.at(-1)?.stages??[],c=s.find(e=>e.stage===`dev-portal`),l=s.some(e=>e.status===`failed`),u=a&&!l&&c?.status===`success`,d=c?.url??i;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(g7,{children:`Your gateway is configured.`}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border bg-neutral-50 px-4 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[o||l?(0,W.jsx)(th,{className:`size-4 shrink-0 text-destructive`}):u?(0,W.jsx)(Em,{className:`size-4 shrink-0 text-emerald-600`}):(0,W.jsx)(Km,{className:`size-4 shrink-0 animate-spin text-zuplo-500`}),o?`Couldn't save your changes`:a?l?`The deploy hit a problem`:u?`Your developer portal is ready`:`Building your developer portal…`:`Saving your changes…`]}),(0,W.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:OYt.map(e=>(0,W.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(qz,{status:s.find(t=>t.stage===e)?.status??`in-progress`}),(0,W.jsx)(Kz,{stage:e})]},e))})]}),u&&d?(0,W.jsx)(Y,{asChild:!0,size:`lg`,variant:`outline`,className:`border-zuplo-500 bg-white font-bold text-blue-600 hover:bg-blue-50 hover:text-blue-700`,children:(0,W.jsxs)(`a`,{href:d,target:`_blank`,rel:`noreferrer`,children:[`Open developer portal`,(0,W.jsx)(Pm,{size:16})]})}):o?(0,W.jsx)(Y,{variant:`outline`,size:`lg`,onClick:r,children:`Retry saving your changes`}):(0,W.jsxs)(Y,{variant:`outline`,size:`lg`,disabled:!0,children:[(0,W.jsx)(Km,{className:`size-4 animate-spin`}),`Saving your changes…`]})]})}function AYt(e){return{apiTypes:[],rest:_7,graphqlUrl:`https://api.rickandmorty.zuplo.io/v1/graphql`,graphql:_7,mcpUrl:`https://api.rickandmorty.zuplo.io/v1/mcp`,mcp:_7,selectedPolicies:[],apiKeyDraft:{keyName:`test-key`,managerEmail:e},rateLimitDraft:{period:`minute`,requests:1},apiKey:_7,rateLimit:_7,saved:_7,committed:!1}}var jYt=`/graphql`,MYt=`/mcp`;function x7(e){try{let t=new URL(e.trim());return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function S7(e,t,n){return e.openApiManager.operationArray?.some(e=>e.additionalOperationContext.path===t&&e.additionalOperationContext.method===n)??!1}async function NYt(e,t){let n=e.openApiManager;if(t.restMode===`import`&&t.restImport)n.updateOpenApiData(t.restImport.doc);else if(t.restMode===`todo-template`)for(let t of v5e())S7(e,t.path,t.method)||n.addOperation(t.path,t.method,t.operation,{avoidConflict:!0});t.apiTypes.includes(`GraphQL`)&&t.graphql.status!==`skipped`&&x7(t.graphqlUrl)&&!S7(e,`/graphql`,`post`)&&(RW(e.policyManager),n.addOperation(jYt,`post`,h5e(t.graphqlUrl.trim()),{avoidConflict:!0})),t.apiTypes.includes(`MCP`)&&t.mcp.status!==`skipped`&&x7(t.mcpUrl)&&!S7(e,`/mcp`,`post`)&&(n.addOperation(MYt,`post`,g5e({url:t.mcpUrl.trim()}),{avoidConflict:!0}),await e.ensureMcpRuntime())}var PYt=async({answers:e,patch:t,services:n,setProgress:r})=>{if(e.saved.status===`applied`)return;r({label:`Saving your changes…`}),e.committed||(await NYt(n,e),xYt(n,e),t({committed:!0}));let{buildId:i}=await SYt(n);t({saved:rYt({buildId:i})})};function C7(e){let t=e.restMode===`import`&&!!e.restImport||e.restMode===`todo-template`,n=e.apiTypes.includes(`GraphQL`)&&e.graphql.status!==`skipped`&&x7(e.graphqlUrl),r=e.apiTypes.includes(`MCP`)&&e.mcp.status!==`skipped`&&x7(e.mcpUrl);return t||n||r}var FYt=`50`,IYt=[`JSON`,`YML`,`YAML`];function LYt({onFileParsed:e,disabled:t}){let[n,r]=(0,g.useState)();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(k0e,{handleChange:async t=>{r(void 0);try{let n=await K3e(t);e(t.name,n)}catch(e){r(e instanceof Error?e.message:`Could not parse the file.`)}},name:`file`,types:IYt,maxSize:FYt,disabled:t,children:(0,W.jsxs)(`div`,{className:G(`flex h-40 w-full flex-col items-center justify-center gap-1 rounded-md border border-dashed border-neutral-400 bg-neutral-50 text-sm`,t?`opacity-50`:`cursor-pointer`),children:[(0,W.jsx)(`div`,{children:`Drag your OpenAPI file here, or click to choose.`}),(0,W.jsxs)(`div`,{className:`text-muted-foreground`,children:[`JSON, YML and YAML are supported (max `,FYt,`MB).`]})]})}),n&&(0,W.jsxs)(`div`,{className:`text-sm text-destructive`,children:[`Parsing error: `,n]})]})}function RYt({name:e,doc:t}){let n=SV(e,t.paths);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`text-sm`,children:[`Importing `,(0,W.jsx)(`span`,{className:`font-medium`,children:e}),` —`,` `,n.length,` operation`,n.length===1?``:`s`,`.`]}),(0,W.jsx)(`div`,{className:`flex max-h-72 flex-col gap-2 overflow-y-auto rounded-md bg-neutral-50 p-3 text-sm`,children:n.map(e=>(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`w-14 shrink-0`,children:(0,W.jsx)(EV,{method:e.additionalOperationContext.method,className:`px-0`})}),(0,W.jsx)(`span`,{className:`truncate`,children:e.additionalOperationContext.path})]},`${e.additionalOperationContext.method}-${e.additionalOperationContext.path}`))})]})}var zYt=(e,t)=>`z${e}-${t}`.toLowerCase().replaceAll(`_`,`-`),BYt=(e,t)=>wj(X.projects(e),{throwOnError:!0,extractData:!0,...t}),VYt=e=>oFe(e.map(e=>X.projects(e)),{extractData:!0}),HYt=(e,t)=>wj(X.project(e,t)),UYt=(e,t)=>{let n=xj();return T_({mutationFn:async()=>{await n.fetch(bj.projects.deleteProject(e,t))}})},WYt=e=>{let t=xj();return T_({mutationFn:async n=>{await t.fetch(bj.projects.createRepoFromProject(e,n.projectName,n.orgName,n.repositoryName,n.defaultBranch,n.otherParams))}})},GYt=(e,t)=>{let n=xj();return T_({mutationFn:async r=>await n.fetch(bj.projects.connectProjectToRepo(e,t,r.orgName,r.repositoryURL,r.defaultBranch,r.forceConnect))})},KYt=(e,t)=>{let n=xj();return T_({mutationFn:async()=>{await n.fetch(bj.projects.disconnectProjectFromRepo(e,t))}})},qYt=(e,t)=>{let n=xj();return T_({mutationFn:async r=>{await n.fetch(bj.projects.updateDefaultBranch({accountName:e,projectName:t,defaultBranch:r.defaultBranch,sourceRepoUrl:r.sourceRepoUrl}))}})};function JYt(e,t){return`https://dev.zuplo.com/v1/accounts/${e}/key-buckets/${t}`}var YYt=()=>{let e=lh([`account`,`project`]),t=HYt(e.account.name,e.project.name),n=e.project.id;return{...t,data:t.data?.defaultConfiguration.flatMap(t=>t.apiKeyBucket?{name:zYt(e.project.id,t.environmentType),id:t.apiKeyBucket,url:JYt(n,zYt(n,t.environmentType)),env:t.environmentType}:[]).sort((e,t)=>t.env.localeCompare(e.env))}},XYt=()=>{let e=xj(),t=Zj();return T_({mutationFn:t=>e.fetch(bj.consumers.createConsumer(t)),onSuccess:()=>t.onSuccess(`Consumer created`),onError:t.onError})},ZYt=`/config/routes.oas.json`,QYt=`/config/policies.json`,$Yt=`/modules/zuplo.runtime.ts`;function eXt(){let e=dh.getState(),t=[];for(let n of e.projectTreeNodes){let r=n.path?e.filesByPath[n.path]:void 0;r&&r.saveState===ei.modified&&t.push(r)}return t}var tXt=(0,g.createContext)(null),nXt=tXt.Provider;function rXt(){let e=(0,g.useContext)(tXt);if(!e)throw Error(`useApiGatewayServices must be used within an ApiGatewayServicesProvider`);return e}function iXt(){let e=lh([`account`,`project`,`environment`]),{email:t}=_oe(),n=Vj(ZYt),r=Vj(QYt),i=Vj($Yt),a=Bj(),o=XYt(),s=Ij(),c=Rj(),{editStrategies:l}=MX(),u=YYt(),d=(0,g.useMemo)(()=>n&&n.content!==void 0?new wV(n,a):void 0,[n,a]),f=(0,g.useMemo)(()=>r&&r.content!==void 0&&n&&n.content!==void 0?new BW(r,[n],a):void 0,[r,n,a]),p=e.account.name,m=e.project.name,h=e.environment.name,_=u.data?.find(e=>e.env===VA.WORKING_COPY)?.id;return(0,g.useMemo)(()=>!d||!f?null:{openApiManager:d,policyManager:f,userEmail:t??``,allOperationIdentifiers:()=>f.getAllOperations().map(e=>({filePath:e.additionalOperationContext.oasFilePath,path:e.additionalOperationContext.path,method:e.additionalOperationContext.method})),createConsumer:async({keyName:e,managerEmail:t})=>_?(await o.mutateAsync({bucketId:_,accountName:p,projectName:m,environmentType:VA.WORKING_COPY,consumer:{sub:e,externalUsers:[{email:t}]}}),{created:!0}):{created:!1},ensureMcpRuntime:async()=>{if(i?.content!==void 0)return;let e=l.find(e=>e.folderName===`/modules`&&`createExtensions`in e);e&&await c(`zuplo.runtime`,`/modules`,void 0,e,w5e)},save:async()=>{let e=eXt();return e.length===0?{}:{buildId:(await s.mutateAsync({environmentName:h,accountName:p,projectName:m,files:e})).buildId}},commitPolicyToAllRoutes:e=>{let t=dh.getState(),n=t.filesByPath[ZYt],r=t.filesByPath[QYt];if(!n||!r)return;let i=new BW(r,[n],a),o=i.getAllOperations().map(e=>({filePath:e.additionalOperationContext.oasFilePath,path:e.additionalOperationContext.path,method:e.additionalOperationContext.method}));i.getPolicyListEnforced().some(t=>t.name===e.name)?i.applyPolicy(e.name,o):i.createPolicy(e,o)}},[d,f,t,_,i,a,l,c,o,s,p,m,h])}function aXt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`What types of endpoints do you want to manage (add auth, rate-limiting, monetization, etc.)?`}),(0,W.jsx)(XJt,{values:e.apiTypes,onChange:e=>t({apiTypes:e}),options:[{value:`REST`,title:`REST or RESTish`,description:`Traditional endpoints with GET, POST, PUT and basic HTTP semantics.`},{value:`GraphQL`,title:`GraphQL`,description:`A GraphQL POST endpoint.`},{value:`MCP`,title:`MCP Servers`,description:`MCP servers for use by AI.`}]})]})}function oXt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`How do you want to set up your endpoints?`}),(0,W.jsx)(YJt,{value:e.restMode,onChange:e=>t({restMode:e}),options:[{value:`import`,title:`Import an OpenAPI / Swagger document`,description:`Bring your existing API definition.`},{value:`todo-template`,title:`Start from a simple TODO template`,description:`A small REST CRUD API to explore.`},{value:`manual`,title:`Nothing, I'll add routes manually`,description:`Start empty and add routes yourself.`}]})]})}function sXt(){let{answers:e,patch:t}=b7(),n=rXt(),r=e.restImport;return r?(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Your OpenAPI document is ready to review.`}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border bg-neutral-50 px-4 py-3 text-sm`,children:[(0,W.jsxs)(`span`,{children:[`Selected `,(0,W.jsx)(`span`,{className:`font-medium`,children:r.name}),` —`,` `,r.operationCount,` operation`,r.operationCount===1?``:`s`,`.`]}),(0,W.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t({restImport:void 0}),children:`Choose a different file`})]})]}):(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Upload your OpenAPI / Swagger document — we'll show you what gets imported on the next step.`}),(0,W.jsx)(LYt,{onFileParsed:(e,r)=>{let i=r6e(r,new Set(n.openApiManager.operationArray?.map(e=>e.operationId).filter(e=>!!e))),a=SV(e,i.paths).length;t({restImport:{name:e,doc:i,operationCount:a}})}})]})}function cXt(){let{answers:e}=b7(),t=e.restImport;return t?(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Review the operations that will be added to your gateway, then continue.`}),(0,W.jsx)(RYt,{name:t.name,doc:t.doc})]}):(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No file selected — go back and upload an OpenAPI document.`})}function lXt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`What is the URL of your GraphQL endpoint?`}),(0,W.jsx)(jV,{value:e.graphqlUrl,placeholder:`https://example.com/graphql`,onChange:e=>t({graphqlUrl:e.target.value})})]}),e.graphql.status===`applied`&&(0,W.jsxs)(g7,{children:[`GraphQL endpoint added at `,e.graphql.result.path,`.`]})]})}function uXt(){let{answers:e,patch:t}=b7();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:`What is the URL of your MCP server?`}),(0,W.jsx)(jV,{value:e.mcpUrl,placeholder:`https://example.com/mcp`,onChange:e=>t({mcpUrl:e.target.value})})]}),e.mcp.status===`applied`&&(0,W.jsxs)(g7,{children:[`MCP endpoint added at `,e.mcp.result.path,`.`]})]})}var dXt=/.+@.+\..+/,fXt={id:`api-gateway-basic`,title:`Set up your API gateway`,initialAnswers:e=>AYt(String(e.params.userEmail??``)),steps:[{id:`api-types`,title:`API types`,Component:aXt,canAdvance:e=>e.apiTypes.length>0||`Pick at least one API type`},{id:`rest-setup`,title:`REST`,isActive:e=>e.apiTypes.includes(`REST`),Component:oXt,canAdvance:e=>e.restMode?!0:`Choose how to set up your endpoints`},{id:`rest-import-upload`,title:`Upload`,isActive:e=>e.apiTypes.includes(`REST`)&&e.restMode===`import`,Component:sXt,canAdvance:e=>e.restImport?!0:`Upload an OpenAPI file to continue`},{id:`rest-import-review`,title:`Review`,isActive:e=>e.apiTypes.includes(`REST`)&&e.restMode===`import`,Component:cXt,canAdvance:e=>e.restImport?!0:`Upload an OpenAPI file first`},{id:`graphql-url`,title:`GraphQL`,isActive:e=>e.apiTypes.includes(`GraphQL`),Component:lXt,skippable:!0,skipLabel:`I'll add it manually`,onSkip:()=>({graphql:nYt}),canAdvance:e=>x7(e.graphqlUrl)||`Enter a valid URL, or skip`},{id:`mcp-url`,title:`MCP`,isActive:e=>e.apiTypes.includes(`MCP`),Component:uXt,skippable:!0,skipLabel:`I'll add it manually`,onSkip:()=>({mcp:nYt}),canAdvance:e=>x7(e.mcpUrl)||`Enter a valid URL, or skip`},{id:`policies`,title:`Policies`,isActive:C7,Component:wYt},{id:`api-key`,title:`API Key`,isActive:e=>C7(e)&&e.selectedPolicies.includes(`api-key`),Component:TYt,canAdvance:e=>e.apiKeyDraft.keyName.trim().length>0&&dXt.test(e.apiKeyDraft.managerEmail)||`Enter a key name and a valid manager email`,onExit:bYt},{id:`rate-limit`,title:`Rate limiting`,isActive:e=>C7(e)&&e.selectedPolicies.includes(`rate-limit`),Component:DYt,canAdvance:e=>e.rateLimitDraft.requests>=1||`Enter at least 1 request`},{id:`success`,title:`Done`,Component:kYt,isFinal:!0,nextLabel:`Go to my project`,onEnter:PYt,ownsStatus:!0,canAdvance:e=>!C7(e)||e.saved.status===`applied`||`Saving your changes…`}]},pXt={[fXt.id]:fXt},mXt=`wizard`;function hXt(){let[e]=WA(mXt);return e?(0,W.jsx)(gXt,{wizardId:e}):null}function gXt({wizardId:e}){let t=lh([`account`,`project`,`environment`]),n=iXt(),[,r]=WA(mXt),i=pXt[e];if(!i||!n)return null;let a={params:{userEmail:n.userEmail},account:t.account.name,project:t.project.name,environment:t.environment.name},o=()=>r(void 0);return(0,W.jsx)(nXt,{value:n,children:(0,W.jsx)(pYt,{definition:i,launch:a,services:n,onClose:o,onComplete:o})})}var _Xt=`/modules/zuplo.runtime.ts`,vXt=`editor-file-tree-open`;function yXt(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(vXt);if(e===null)return null;let t=JSON.parse(e);return typeof t==`boolean`?t:null}catch{return null}}function bXt(){let e=lh(),{editStrategies:t}=MX(),[n,r]=WA(`path`),[i]=WA(`build`),{monaco:a,reloadFiles:o}=C1(),s=zA(o.execute),c=e.environment.name,{isReadOnly:l}=HA(),[u,d]=(0,g.useState)(yXt),f=u??!1,p=e=>{d(e);try{window.localStorage.setItem(vXt,JSON.stringify(e))}catch{}},m=dh(e=>e.projectTreeNodes),h=dh(e=>e.setPendingNewFile),_=`${e.account.name}/${e.project.name}/${e.environment.name}`,[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(_);b!==_&&(x(_),y(!1)),(0,g.useEffect)(()=>{if(v)return;if(n){y(!0);return}if(m.length===0)return;let e=m.find(e=>e.path&&Nie.test(e.path));y(!0),e&&r(e.path)},[n,m,r,v]);let S=m.some(e=>e.path===_Xt),C=m.length===0,w=!n&&(C||!v),T=(e,t)=>{p(!0),h({strategyFolder:e,template:t})},{isError:E,error:D}=C_({queryKey:[`reloadFiles`,e.account.name,e.project.name,e.environment.name],queryFn:async({signal:t})=>(await s.current({accountName:e.account.name,projectName:e.project.name,environmentName:e.environment.name},t),!0),refetchOnWindowFocus:!1,enabled:!!a&&!!c});if(E&&D instanceof Lf)return(0,W.jsx)(`div`,{className:`w-full h-full flex items-center justify-center`,children:(0,W.jsxs)(PS,{className:`max-w-md`,children:[(0,W.jsx)(FS,{children:D.title}),(0,W.jsxs)(IS,{className:`flex flex-col gap-2`,children:[Yj(D),(0,W.jsx)(eDt,{})]})]})});let O=(0,W.jsxs)(fN,{direction:`vertical`,autoSaveId:`bottom-pane`,className:`relative`,children:[(0,W.jsx)(pN,{minSize:10,children:n?(0,W.jsx)(_N,{fallback:e=>(0,W.jsx)(DQe,{...e}),children:(0,W.jsx)(xXt,{})}):w?(0,W.jsx)(SXt,{}):null}),l&&(0,W.jsx)(`a`,{href:`https://zuplo.com/docs/articles/environments`,target:`_blank`,rel:`noreferrer`,children:(0,W.jsx)(`div`,{className:`absolute mx-auto border-zuplo-200 left-0 right-0 bottom-12 bg-zuplo-100 text-zuplo-700 h-8 rounded-full shadow-md border w-36 items-center justify-center flex text-sm font-medium`,children:`Read-only`})}),i!==void 0&&(0,W.jsx)(BJt,{})]});return(0,W.jsxs)(`div`,{className:`flex h-full w-full`,children:[!f&&(0,W.jsxs)(`div`,{className:`flex flex-col items-center bg-surface-sunken border-r shrink-0 w-9 py-1.5 gap-0.5`,children:[(0,W.jsx)(w7,{label:`Expand file tree`,onClick:()=>p(!0),testId:`expand-file-tree`,children:(0,W.jsx)(tie,{size:14})}),(0,W.jsx)(`div`,{className:`my-1 h-px w-5 bg-neutral-200 dark:bg-neutral-700`,"aria-hidden":!0}),!l&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(w7,{label:`New OpenAPI Spec`,onClick:()=>T(`/config`,`OpenAPI Spec`),testId:`sidebar-new-open-api-spec`,children:(0,W.jsx)(vN,{className:`size-3.5`})}),(0,W.jsx)(w7,{label:`New Module`,onClick:()=>T(`/modules`,`Request Handler`),testId:`sidebar-new-module`,children:(0,W.jsx)(Fre,{size:14})}),!S&&(0,W.jsx)(w7,{label:`New Runtime Extension`,onClick:()=>T(`/modules`,`zuplo.runtime.ts`),testId:`sidebar-new-runtime-extension`,children:(0,W.jsx)(hie,{size:14})}),(0,W.jsx)(w7,{label:`New Schema`,onClick:()=>T(`/schemas`,`Schema`),testId:`sidebar-new-schema`,children:(0,W.jsx)(bre,{size:14})})]}),(0,W.jsx)(`div`,{className:`flex-1`}),(0,W.jsx)(`span`,{className:`text-[10px] font-medium text-neutral-500 uppercase tracking-wider select-none pb-1`,style:{writingMode:`vertical-rl`},children:`Files`})]}),f?(0,W.jsxs)(fN,{direction:`horizontal`,autoSaveId:`file-tree`,className:`flex-1 min-w-0`,children:[(0,W.jsx)(pN,{minSize:10,defaultSize:20,className:`bg-surface-sunken min-w-[270px]`,children:(0,W.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between h-10 px-2 border-b shrink-0`,children:[(0,W.jsx)(`span`,{className:`text-xs font-medium text-neutral-600 dark:text-neutral-400 uppercase tracking-wide pl-1`,children:`Files`}),(0,W.jsx)(Y,{variant:`ghost`,size:`icon-xs`,onClick:()=>p(!1),"aria-label":`Collapse file tree`,title:`Collapse file tree`,children:(0,W.jsx)(eie,{size:14})})]}),(0,W.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,W.jsx)(jYe,{directoryStrategies:t})})]})}),(0,W.jsx)(mN,{}),(0,W.jsx)(pN,{minSize:70,children:O})]}):(0,W.jsx)(`div`,{className:`flex-1 min-w-0`,children:O}),(0,W.jsx)(hXt,{})]})}var xXt=()=>{let[e]=WA(`path`);if(!e)throw Error(`Invalid state - FileViewer should not be displayed if no path`);let t=e.toLowerCase();if(t===`/docs/sidebar.json`)return(0,W.jsx)(CGe,{});if(t.includes(`.oas.json`))return(0,W.jsx)(yCt,{});if(t===`/config/policies.json`)return(0,W.jsx)(kTt,{});if(t.endsWith(`.md`)||t.endsWith(`.mdx`)){let e=t.split(`/`),n=e[e.length-1];return(0,W.jsx)(SGe,{fileName:n})}return t.endsWith(`.ts`)||t.endsWith(`.css`)?(0,W.jsx)(rF,{maxHeightVh:100}):t.startsWith(`/schemas`)&&t.endsWith(`.json`)?(0,W.jsx)(rF,{}):t===`/config/dev-portal.json`?(0,W.jsxs)(`div`,{className:`size-full`,children:[(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsx)(NTt,{})}),(0,W.jsx)(rF,{})]}):(0,W.jsx)(rF,{})},SXt=()=>(0,W.jsxs)(`div`,{className:`p-6 flex flex-col gap-2`,"data-test":`editor-loading`,children:[(0,W.jsx)(hN,{className:`w-40 h-4`}),(0,W.jsx)(hN,{className:`w-56 h-4`}),(0,W.jsx)(hN,{className:`w-28 h-4`}),(0,W.jsx)(hN,{className:`w-64 h-4`}),(0,W.jsx)(hN,{className:`w-56 h-4`}),(0,W.jsx)(hN,{className:`w-56 h-4`}),(0,W.jsx)(hN,{className:`w-56 h-4`})]}),w7=({label:e,onClick:t,testId:n,children:r})=>(0,W.jsx)(Mk,{content:e,side:`right`,children:(0,W.jsx)(`button`,{type:`button`,onClick:t,"aria-label":e,"data-test":n,className:`group flex items-center justify-center size-7 rounded-md text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100 hover:bg-neutral-200 dark:hover:bg-neutral-800 transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-zuplo-500`,children:r})});function CXt(){return(0,W.jsxs)(Hje,{children:[(0,W.jsx)(bXt,{}),(0,W.jsx)(TFe,{})]})}var wXt=`/static/img/hero-Ct8-h_EN.svg`,TXt=`/static/img/hero-dark-Z9HfvwEQ.svg`,EXt=[{label:`Monetization`,value:`monetization`,badge:`Beta`,items:[{title:`Monetization Overview`,description:`Learn more about our first-party metering and billing solution built directly into the Zuplo platform.`,icon:ez,link:{href:{web:`https://zuplo.com/docs/articles/monetization/index`,local:`https://zuplo.com/docs/articles/monetization/index`},text:`Read the docs`}},{title:`Monetization Quickstart`,description:`Get up and running with API monetization in minutes using Zuplo's built-in billing and metering.`,icon:iz,link:{href:{web:`https://zuplo.com/docs/articles/monetization/quickstart`,local:`https://zuplo.com/docs/articles/monetization/quickstart`},text:`Get Started`}},{title:`Pricing Models`,description:`Explore the different pricing models available for monetizing your APIs with Zuplo.`,icon:tz,link:{href:{web:`https://zuplo.com/docs/articles/monetization/pricing-models`,local:`https://zuplo.com/docs/articles/monetization/pricing-models`},text:`Read the docs`}}]},{label:`MCP`,value:`mcp`,items:[{title:`Installing the MCP Inspector`,description:`Set up the MCP Inspector locally and start testing your MCP server with ease.`,icon:Oqe,link:{href:{web:`https://zuplo.com/docs/handlers/mcp-server#mcp-inspector`,local:`https://zuplo.com/docs/handlers/mcp-server#mcp-inspector`},text:`Get Started`}},{title:`MCP Quickstart`,description:`Learn how to start using Model Context Protocol to pass context into any model call.`,icon:iz,link:{href:{web:`https://zuplo.com/docs/articles/mcp-quickstart`,local:`https://zuplo.com/docs/articles/mcp-quickstart`},text:`Get Started`}},{title:`Using OAuth with MCP`,description:`Authenticate users securely by integrating OAuth flows into your Model Context Protocol setup.`,icon:Pqe,link:{href:{web:`https://zuplo.com/docs/articles/configuring-auth0-for-mcp-auth`,local:`https://zuplo.com/docs/articles/configuring-auth0-for-mcp-auth`},text:`Get Started`}}]},{label:`Rate Limiting`,value:`rate-limiting`,items:[{title:`Adding Rate Limiting`,description:`Control traffic and protect your APIs by setting up flexible, customizable rate limits.`,icon:tz,link:{href:{web:`https://zuplo.com/docs/articles/step-2-add-rate-limiting`,local:`https://zuplo.com/docs/articles/step-2-add-rate-limiting-local`},text:`Get Started`}},{title:`Complex Rate Limiting`,description:`Implement advanced rules to rate limit by user, IP, plan, or custom logic.`,icon:Tqe,link:{href:{web:`https://zuplo.com/docs/policies/complex-rate-limit-inbound`,local:`https://zuplo.com/docs/policies/complex-rate-limit-inbound`},text:`Get Started`}},{title:`Dynamic Rate Limits`,description:`Set rate limits that adapt in real-time based on headers, tokens, or user context.`,icon:Mqe,link:{href:{web:`https://zuplo.com/examples/dynamic-rate-limits`,local:`https://zuplo.com/examples/dynamic-rate-limits`},text:`Get Started`}}]},{label:`Authentication`,value:`authentication`,items:[{title:`Using API Keys`,description:`Authenticate and manage access to your APIs with simple, secure API key workflows.`,icon:Lqe,link:{href:{web:`https://zuplo.com/docs/policies/api-key-inbound`,local:`https://zuplo.com/docs/policies/api-key-inbound`},text:`Get Started`}},{title:`Using Auth0`,description:`Connect your APIs to Auth0 for streamlined authentication and powerful identity management.`,icon:Vqe,link:{href:{web:`https://zuplo.com/docs/policies/auth0-jwt-auth-inbound`,local:`https://zuplo.com/docs/policies/auth0-jwt-auth-inbound`},text:`Get Started`}},{title:`Using Okta`,description:`Integrate Okta with your APIs to enable secure, enterprise-grade authentication and authorization.`,icon:jqe,link:{href:{web:`https://zuplo.com/docs/policies/okta-jwt-auth-inbound`,local:`https://zuplo.com/docs/policies/okta-jwt-auth-inbound`},text:`Get Started`}}]},{label:`Dev Portal`,value:`dev-portal`,items:[{title:`Setup your API Reference`,description:`Instantly generate an interactive reference by importing your OpenAPI spec—no manual work needed.`,icon:wqe,link:{href:{web:`https://zuplo.com/docs/dev-portal/zudoku/configuration/api-reference`,local:`https://zuplo.com/docs/dev-portal/zudoku/configuration/api-reference`},text:`Get Started`}},{title:`Adding Authentication`,description:`Guide users through secure API access by adding auth flows to your developer portal.`,icon:Iqe,link:{href:{web:`https://zuplo.com/docs/dev-portal/zudoku/configuration/authentication`,local:`https://zuplo.com/docs/dev-portal/zudoku/configuration/authentication`},text:`Get Started`}},{title:`Creating API Catalogs`,description:`Organize your APIs into searchable, user-friendly catalogs for easier discovery and onboarding.`,icon:ez,link:{href:{web:`https://zuplo.com/docs/dev-portal/zudoku/guides/using-multiple-apis`,local:`https://zuplo.com/docs/dev-portal/zudoku/guides/using-multiple-apis`},text:`Get Started`}}]}],DXt=({mode:e=`web`})=>(0,W.jsxs)(eP,{defaultValue:`monetization`,className:`flex flex-col my-8`,children:[(0,W.jsx)(tP,{className:`flex gap-8 border-b border-gray-200 dark:border-neutral-700 mb-8 ml-1`,children:EXt.map(e=>(0,W.jsxs)(nP,{value:e.value,className:`relative py-2 text-sm font-medium text-gray-600 dark:text-neutral-400 hover:text-gray-900 dark:hover:text-neutral-100 data-[state=active]:text-gray-900 dark:data-[state=active]:text-neutral-100 border-b-2 border-transparent data-[state=active]:border-black dark:data-[state=active]:border-white transition-colors`,children:[e.label,`badge`in e&&e.badge&&(0,W.jsx)(LS,{variant:`invert`,className:`ml-2`,children:e.badge})]},e.value))}),EXt.map(t=>(0,W.jsx)(rP,{value:t.value,className:`grid grid-cols-3 gap-4`,children:t.items.map(t=>(0,W.jsxs)(lV,{className:`flex flex-col gap-2 text-muted-foreground`,children:[(0,W.jsxs)(uV,{className:`flex gap-2`,children:[(0,W.jsx)(t.icon,{size:24,weight:`duotone`,className:`[&_[opacity='0.2']]:fill-pink-500`}),(0,W.jsx)(dV,{className:`gap-x-2 text-lg font-semibold`,children:t.title})]}),(0,W.jsx)(pV,{className:`text-md`,children:t.description}),(0,W.jsx)(mV,{className:`flex-1 items-end! border-0 mb-4`,children:(0,W.jsx)(Y,{variant:`outline`,className:`w-full`,asChild:!0,children:(0,W.jsx)(oT,{href:t.link.href[e],variant:`ghost`,children:t.link.text})})})]},t.title))},t.value))]}),OXt=({title:e,url:t,className:n})=>{let{copyToClipboard:r,state:i}=lO(t??``);return(0,W.jsxs)(lV,{className:G(`col-span-full md:col-span-5 py-2 px-4 flex items-center text-sm gap-x-2`,n),children:[(0,W.jsx)(`div`,{className:`bg-green-600 rounded-full w-4 h-4 p-0.5`,children:(0,W.jsx)(vm,{className:`text-white`,size:12})}),(0,W.jsx)(`span`,{className:`font-semibold`,children:e}),(0,W.jsx)(`div`,{className:`flex-1`,children:t?(0,W.jsx)(oT,{href:t,className:`ml-2 font-medium line-clamp-1 break-all`,children:t}):(0,W.jsx)(hN,{className:`ml-2 h-4 w-8/12`})}),(0,W.jsx)(Y,{variant:`secondary`,size:`sm`,onClick:r,children:(0,W.jsxs)(Pk,{loading:i===`copied`,alternative:(0,W.jsx)(vm,{size:12,className:`text-green-600`,strokeWidth:3}),className:`flex`,children:[(0,W.jsx)(Mm,{size:16,className:`mr-2`,strokeWidth:1.5}),`Copy URL`]})})]})},kXt=({size:e=24,...t})=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,fill:`none`,viewBox:`0 0 16 16`,...t,children:(0,W.jsx)(`path`,{fill:`#000`,d:`m7.47 12.412 3.348-.592.031-.007-1.722-2.049a291.474 291.474 0 0 1-1.723-2.058c0-.01 1.779-4.909 1.789-4.926a788.95 788.95 0 0 1 2.934 5.066l2.95 5.115.023.039-10.948-.001 3.317-.587zM.9 11.788c0-.003.811-1.412 1.803-3.131L4.507 5.53l2.102-1.764C7.765 2.797 8.714 2 8.717 2a.37.37 0 0 1-.033.085L6.4 6.981l-2.24 4.808-1.63.002c-.897.001-1.63 0-1.63-.003z`})}),AXt=({className:e,size:t=24})=>(0,W.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,className:e,children:(0,W.jsx)(`path`,{d:`M.778 1.211c-.424-.006-.772.334-.778.758 0 .045.002.09.01.134l3.263 19.811c.084.499.515.867 1.022.872H19.95c.382.004.708-.271.77-.646l3.27-20.03c.068-.418-.216-.813-.635-.881-.045-.008-.089-.011-.133-.01L.778 1.211zM14.52 15.528H9.522L8.17 8.464h7.561l-1.211 7.064z`})}),jXt=({className:e,size:t=24})=>(0,W.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,className:e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 2C6.477 2 2 6.463 2 11.97c0 4.404 2.865 8.14 6.839 9.458.5.092.682-.216.682-.48 0-.236-.008-.864-.013-1.695-2.782.602-3.369-1.337-3.369-1.337-.454-1.151-1.11-1.458-1.11-1.458-.908-.618.069-.606.069-.606 1.003.07 1.531 1.027 1.531 1.027.892 1.524 2.341 1.084 2.91.828.092-.643.35-1.083.636-1.332-2.22-.251-4.555-1.107-4.555-4.927 0-1.088.39-1.979 1.029-2.675-.103-.252-.446-1.266.098-2.638 0 0 .84-.268 2.75 1.022A9.606 9.606 0 0112 6.82c.85.004 1.705.114 2.504.336 1.909-1.29 2.747-1.022 2.747-1.022.546 1.372.202 2.386.1 2.638.64.696 1.028 1.587 1.028 2.675 0 3.83-2.339 4.673-4.566 4.92.359.307.678.915.678 1.846 0 1.332-.012 2.407-.012 2.734 0 .267.18.577.688.48C19.137 20.107 22 16.373 22 11.969 22 6.463 17.522 2 12 2z`})}),MXt=({className:e,size:t=24})=>(0,W.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,className:e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z`})});function T7({providerName:e,className:t,size:n=24}){switch(e?.toLowerCase()){case`gitlab`:return(0,W.jsx)(MXt,{className:t,size:n});case`bitbucket`:return(0,W.jsx)(AXt,{className:t,size:n});case`azure`:return(0,W.jsx)(kXt,{className:t,size:n});default:return(0,W.jsx)(jXt,{className:t,size:n})}}var NXt=({onSuccess:e}={})=>{let t=xj(),{logEvent:n,captureException:r}=Vg();return T_({mutationFn:async e=>(await t.fetch(bj.accounts.createCustomDomain({accountName:e.accountName,isAlias:e.isAlias,projectName:e.projectName,hostname:e.hostname,deploymentName:e.deploymentName,stage:e.stage}))).json(),onSuccess:(t,r)=>{n(`account-custom-domain-creation-success`,{account:r.accountName}),e?.(t)},onError:e=>{n(`account-custom-domain-creation-failed`),r(e)}})},PXt=()=>{let e=xj();return T_({mutationFn:async t=>{await e.fetch(bj.accounts.editCustomDomain({accountName:t.accountName,projectName:t.projectName,hostname:t.hostname,deploymentName:t.deploymentName}))}})},FXt=()=>{let e=xj();return T_({mutationFn:async t=>{await e.fetch(bj.accounts.deleteCustomDomain({accountName:t.accountName,projectName:t.projectName,hostname:t.hostname,deploymentName:t.deploymentName}))}})},IXt=(e,t)=>wj(X.customDomains(e,t),{extractData:!0}),LXt=(0,g.forwardRef)(({icon:e,label:t,count:n,expanded:r,onToggle:i,children:a},o)=>(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-gray-200 dark:border-neutral-700 bg-surface shadow-xs`,children:[(0,W.jsxs)(`button`,{ref:o,type:`button`,onClick:i,"aria-expanded":r,className:`flex w-full items-center justify-between gap-2 px-3.5 py-2 text-sm transition hover:bg-gray-50 dark:hover:bg-neutral-800`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2 font-medium text-gray-800 dark:text-neutral-200`,children:[(0,W.jsx)(e,{size:14,className:`text-gray-500 dark:text-neutral-400`,strokeWidth:2}),t]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(LS,{variant:`secondary`,size:`sm`,className:`px-1.5 font-mono`,children:n??0}),r?(0,W.jsx)(xm,{size:14,className:`text-gray-500 dark:text-neutral-400`}):(0,W.jsx)(ym,{size:14,className:`text-gray-400 dark:text-neutral-500`})]})]}),r?(0,W.jsx)(`div`,{className:`border-t border-gray-100 dark:border-neutral-800`,children:a}):null]}));LXt.displayName=`ExpandableNode`;var RXt=({selected:e,onChange:t,options:n,listLabel:r,className:i,classNameOptions:a,testId:o,placeholder:s,matchWidth:c=!0,selectorElement:l,disabled:u,labelPrefixElement:d=null,isLoadingData:f=!1})=>(0,W.jsxs)($B,{value:e,onChange:t,disabled:u,children:[r&&(0,W.jsx)($B.Label,{className:`block text-sm font-medium text-gray-700`,children:r}),(0,W.jsxs)(`div`,{className:(0,EP.default)({relative:c},i),children:[(0,W.jsxs)($B.Button,{"data-test":o,className:(0,EP.default)(`w-full relative`,`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-background 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`,u?`bg-gray-200`:`bg-white`,i),children:[e?.icon&&(0,W.jsx)(`span`,{className:`absolute pr-10`,children:f?(0,W.jsx)(IL,{className:`w-4 h-4 mr-2`,borderPositionAndSize:`border-l-2`}):e.icon}),(0,W.jsxs)(`span`,{className:(0,EP.default)(`block truncate`,{"ml-7":e?.icon}),children:[d,e?.label??s]}),(0,W.jsx)(`span`,{className:`flex items-center pointer-events-none`,children:l??(0,W.jsx)(Sm,{className:`h-5 w-5 text-gray-400`,"aria-hidden":`true`})})]}),(0,W.jsx)(sV,{as:g.Fragment,leave:`transition ease-in duration-100`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,W.jsx)($B.Options,{className:(0,EP.default)(`absolute z-20 mt-1 bg-white shadow-lg rounded-md py-1 text-base border overflow-auto focus:outline-hidden sm:text-sm`,a),children:n.map((t,n)=>(0,W.jsx)($B.Option,{"data-test":`${o}-${n}`,className:({active:e})=>(0,EP.default)(e?`bg-gray-50`:``,t.disabled?`cursor-not-allowed`:`cursor-pointer`,`text-gray-900 select-none relative py-2 px-3`),value:t,disabled:t.disabled??!1,children:t.description?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`font-semibold block text-sm leading-7`,children:t.label}),(0,W.jsx)(`span`,{className:`text-xs`,children:t.description})]}):(0,W.jsxs)(`div`,{className:`flex flex-row font-normal items-center`,children:[t.icon&&(0,W.jsx)(`div`,{children:t.icon}),` `,(0,W.jsx)(`div`,{children:t.label}),t.icon&&e&&e.value.toString()===t.value.toString()&&(0,W.jsx)(`div`,{className:`absolute right-0`,children:(0,W.jsx)(vm,{className:`mr-3 h-5 w-5`})})]})},`${n}-${t.value}`))})})]})]});function zXt(e,t=500){let[n,r]=(0,g.useState)(e);return(0,g.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>{clearTimeout(n)}},[e,t]),n}var BXt=({projects:e,isLoadingProjects:t,selectedProject:n,onProjectChange:r})=>(0,W.jsx)(RXt,{testId:`project-selector`,placeholder:`Select Project`,options:(e||[]).map(e=>({label:e.name,value:e.id,icon:(0,W.jsx)(zm,{className:`mr-1.5`,size:16})})),selected:n,onChange:r,className:`flex-1 items-center w-full h-9`,isLoadingData:t});function E7({title:e,className:t}){return(0,W.jsx)(`div`,{className:G(`text-2xl font-medium`,t),children:e})}var VXt=({showHeader:e})=>(0,W.jsxs)(W.Fragment,{children:[e&&(0,W.jsx)(E7,{title:`Source Control Settings`}),(0,W.jsxs)(`div`,{className:`w-full sm:max-w-md md:max-w-2xl lg:max-w-5xl animate-pulse`,children:[e&&(0,W.jsx)(`div`,{className:`h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 mb-9 mt-7 w-[650px]`}),(0,W.jsxs)(`div`,{className:`flex flex-col md:flex-row lg:flex-row sm:gap-4`,children:[(0,W.jsx)(`div`,{className:`inline-block w-full max-w-sm md:max-w-xs mr-4 h-10 bg-gray-200 rounded-md dark:bg-gray-700`}),(0,W.jsx)(`div`,{className:`inline-block w-full max-w-sm md:max-w-xs mr-4 h-10 bg-gray-200 rounded-md dark:bg-gray-700`}),(0,W.jsx)(`div`,{className:`inline-block w-full max-w-sm md:max-w-xs right-0 h-10 bg-gray-200 rounded-md dark:bg-gray-700`})]}),(0,W.jsx)(`div`,{className:`h-5 mt-5 mb-3`,children:(0,W.jsx)(`div`,{className:`h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 mb-9 mt-7 w-[650px]`})}),(0,W.jsx)(`div`,{className:`mt-5 h-96 relative bg-gray-200 rounded-md dark:bg-gray-700`})]})]}),D7=`GITLAB`,O7=`GITHUB`,k7=`BITBUCKET`,A7=`AZURE`,HXt=({installUrl:e,selectedOrg:t,projectName:n,className:r,provider:i=O7,disabled:a})=>{let{logEvent:o}=Vg(),[s,c]=(0,g.useState)(!1),l=e=>{o(`source-control-create-repo-continue-clicked`,{sourceControlNamespace:e??`none`,sourceControlProvider:i,project:n});let t;switch(i){case A7:t=e?`https://dev.azure.com/${e}/_createproject`:`https://dev.azure.com/`;break;case D7:t=e?`https://gitlab.com/projects/new?namespace_id=${e}`:`https://gitlab.com/projects/new`;break;case k7:t=e?`https://bitbucket.org/repo/create?owner=${e}`:`https://bitbucket.org/repo/create`;break;default:t=e===null?`https://github.com/new?name=${n}&description=Zuplo%20API%20Gateway`:`https://github.com/organizations/${e}/repositories/new?owner=${e}&name=${n}&description=Zuplo%20API%20Gateway`;break}window.open(t),c(!1)};return(0,W.jsxs)(kA,{open:s,onOpenChange:c,children:[(0,W.jsx)(AA,{asChild:!0,children:(0,W.jsx)(Y,{className:r,disabled:a,children:`Create new repository`})}),(0,W.jsxs)(MA,{className:`max-w-xl! w-full`,children:[(0,W.jsxs)(NA,{children:[(0,W.jsx)(FA,{children:`Create new repository`}),(0,W.jsx)(IA,{})]}),(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`We're about to help you create a new repository in`,` `,Jj(i),`.`]}),(0,W.jsxs)(`div`,{className:`rounded-md bg-muted/50 p-3 text-sm space-y-2 border`,children:[(0,W.jsx)(`p`,{className:`font-medium`,children:`What you'll need to do:`}),i===`AZURE`&&(0,W.jsxs)(`ul`,{className:`list-disc list-inside space-y-1 text-muted-foreground`,children:[(0,W.jsx)(`li`,{children:`Create a project and repository in Azure DevOps`}),(0,W.jsx)(`li`,{children:`Return to Zuplo to connect it`})]}),i===`GITHUB`&&(0,W.jsxs)(`ul`,{className:`list-disc list-inside space-y-1 text-muted-foreground`,children:[(0,W.jsx)(`li`,{children:`Create your new repository on GitHub`}),(0,W.jsxs)(`li`,{children:[`Ensure the`,` `,(0,W.jsx)(oT,{href:e,children:`Zuplo GitHub App`}),` `,`has access to your new repo`]}),(0,W.jsx)(`li`,{children:`Return to Zuplo to see and connect it`})]}),(i===`GITLAB`||i===`BITBUCKET`)&&(0,W.jsxs)(`ul`,{className:`list-disc list-inside space-y-1 text-muted-foreground`,children:[(0,W.jsxs)(`li`,{children:[`Create your repository in `,Jj(i)]}),(0,W.jsx)(`li`,{children:`Return to Zuplo to connect it`})]})]}),(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Need help?`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/source-control`,children:`View our troubleshooting guide`})]})]}),(0,W.jsx)(PA,{children:(0,W.jsxs)(Y,{"data-test":`navigate-new-${i.toLowerCase()}-repo`,onClick:()=>l(t),children:[`Continue to `,Jj(i)]})})]})]})},UXt=({accountName:e,projectName:t,orgName:n,repositoryUrl:r,provider:i,handleErrors:a})=>{let{logEvent:o,captureException:s}=Vg(),[c,l]=(0,g.useState)(!1),u=GYt(e,t),d=async(n,r,d)=>{try{if(n===null)throw Error(`Invalid ${Jj(i)} account/organization selected, please try again.`);if(r===null)throw Error(`Invalid repository selected, please try again.`);let s=await(await u.mutateAsync({orgName:n,repositoryURL:r,defaultBranch:`main`,forceConnect:d},{onError:r=>{let i=Yj(r);a(i),o(`source-control-repo-connection-failed`,{account:e,project:t,sourceControlNamespace:n,errorMessage:i})}})).json();s.connected===!1&&s.emptyRepository===!1?l(!0):c&&l(!1),s.connected&&o(`source-control-repo-connected`,{account:e,project:t,sourceControlNamespace:n})}catch(r){s(r);let i=Yj(r);o(`source-control-repo-connection-failed`,{account:e,project:t,sourceControlNamespace:n,errorMessage:i}),a(i),c&&l(!1)}};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(dX,{open:c,onOpenChange:l,title:`Connecting project to repository`,description:`The repository you picked is not empty. Connecting will just create an association between this project and the repo. No changes will be pushed or pulled — you must do that manually using the ${Jj(i)} button. Do you still want to connect?`,actionLabel:`Connect`,isPending:u.isPending,onConfirm:()=>d(n,r,!0)}),(0,W.jsx)(Y,{"data-test":`connect-repo-button`,variant:`outline`,size:`sm`,onClick:()=>d(n,r,!1),children:(0,W.jsx)(Pk,{variant:`primary`,loading:u.isPending,children:`Connect`})})]})},WXt=({repositories:e,account:t,project:n,selectedNamespace:r,provider:i,maxItems:a=5,onConnectError:o})=>{let s=i===`azure`;return(0,W.jsx)(W.Fragment,{children:e.slice(0,a).map((e,a)=>(0,W.jsxs)(`div`,{className:(0,EP.default)(`flex flex-row items-center justify-center h-16 border-gray-300 px-5 lg:gap-5 gap-2`,{"border-t":a!==0}),children:[(0,W.jsxs)(`div`,{className:`flex text-sm flex-1 gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col flex-1`,children:[(0,W.jsx)(`span`,{className:`font-medium line-clamp-1`,children:e.name}),s&&e.metadata?.projectName?(0,W.jsxs)(`span`,{className:`text-gray-400 text-xs`,children:[`Project: `,e.metadata.projectName]}):(0,W.jsxs)(`span`,{className:`text-gray-400 hidden md:inline-block lg:inline-block`,children:[`Updated on`,` `,new Date(e.updatedAt).toLocaleDateString([],{day:`numeric`,month:`short`,year:`numeric`})]})]}),e.private&&(0,W.jsxs)(`div`,{className:`flex justify-center items-center text-gray-400 gap-1`,children:[(0,W.jsx)(qm,{className:`h-4 w-4`,"aria-hidden":`false`,"aria-label":`Private Git repository`}),(0,W.jsx)(`span`,{className:`hidden lg:block`,children:`Private Repository`})]})]}),(0,W.jsx)(UXt,{accountName:t.name,projectName:n.name,orgName:r?.label||``,repositoryUrl:e.url,provider:i,handleErrors:o})]},e.id))})},GXt={[O7]:{name:`GitHub`,icon:(e=20)=>(0,W.jsx)(jXt,{className:`mr-1.5`,size:e}),supportsProjects:!1,placeholder:{namespace:`Select GitHub Account`,search:`Search repositories`},messages:{noRepoAtHand:`No repository at hand? We can help you create a new one.`,selectAccount:`Make sure to select a Git account or organization on the top left.`,grantAccess:`Make sure to grant Zuplo access to the Git account & its repositories you'd like to connect to.`}},[A7]:{name:`Azure DevOps`,icon:(e=20)=>(0,W.jsx)(kXt,{className:`mr-1.5`,size:e}),supportsProjects:!0,placeholder:{namespace:`Select Organization`,project:`Select Project`,search:`Search repositories`},messages:{noRepoInProject:`No repository in this project? Create a new one.`,noRepoAtHand:`No project at hand? We can help you create one.`,selectAccount:`Please select a project to view repositories.`,grantAccess:`No repositories in this project yet.`}},[D7]:{name:`GitLab`,icon:(e=20)=>(0,W.jsx)(Bm,{className:`mr-1.5`,size:e}),supportsProjects:!1,placeholder:{namespace:`Select GitLab Group`,search:`Search repositories`},messages:{noRepoAtHand:`No repository at hand? Create a new one.`,selectAccount:`Select a GitLab group or namespace.`,grantAccess:`Connect your GitLab account to see repositories.`}},[k7]:{name:`Bitbucket`,icon:(e=20)=>(0,W.jsx)(xre,{className:`mr-1.5`,size:e}),supportsProjects:!1,placeholder:{namespace:`Select Bitbucket Project`,search:`Search repositories`},messages:{noRepoAtHand:`No repository at hand? Create a new one.`,selectAccount:`Select a Bitbucket project.`,grantAccess:`Connect your Bitbucket account to see repositories.`}}},KXt=e=>GXt[e]||GXt.GITHUB,j7=({account:e,project:t})=>{let{logEvent:n}=Vg(),r=WYt(e.name),[i,a]=(0,g.useState)(t.name),[o,s]=(0,g.useState)(!1);return{newRepoName:i,setNewRepoName:a,showCreateRepoForm:o,setShowCreateRepoForm:s,createRepoMutation:r,isCreating:r.isPending,handleCreateRepo:async({namespace:o,repoName:c,otherParams:l})=>{let u=c||i||t.name;await r.mutateAsync({projectName:t.name,orgName:o,repositoryName:u,defaultBranch:`main`,otherParams:l}),n(`source-control-repo-created`,{sourceControlRepository:u,sourceControlNamespace:o,account:e.name,project:t.name}),a(``),s(!1)},reset:()=>{s(!1),a(t.name)},transformRepoToRepository:(e,t)=>({id:e.url,url:e.url,provider:t,name:e.name,slug:e.name,defaultBranch:e.defaultBranch,namespace:e.organization,owner:{id:0,name:e.organization},private:!0,updatedAt:new Date().toISOString(),ownerType:e.isUserRepo?`user`:`team`,metadata:e.metadata}),logEvent:n}},qXt=e=>{let{account:t,project:n,sourceControlConfig:r,selectedNamespace:i,searchTerm:a}=e,o=j7(e),[s,c]=(0,g.useState)(null),l=r.provider===A7,{data:u,isLoading:d}=pYe(t.name,i?.value||``,{enabled:l&&!!i}),{data:f,isLoading:p}=dYe(t.name),m=o.transformRepoToRepository;return{repositories:(0,g.useMemo)(()=>!f?.data||!i||!s?[]:(f.data[i.label]||[]).filter(e=>e.metadata?.projectName===s.label).filter(e=>!a||e.name.toLowerCase().includes(a.toLowerCase())).map(e=>m(e,`azure`)),[f,i,s,a,m]),isLoadingRepos:p&&!!s,projects:u?.data,selectedProject:s,isLoadingProjects:d,onProjectChange:e=>{c(e),o.logEvent(`source-control-project-selected`,{account:t.name,project:n.name,sourceControlProvider:r.provider})},reset:()=>{c(null),o.reset()}}},JXt=e=>{let{account:t,sourceControlConfig:n,selectedNamespace:r,searchTerm:i}=e,a=j7(e),o=n.provider===k7,{data:s,isLoading:c,refetch:l}=mYe(t.name,r?r.value:``,i,{enabled:o&&r!==null});return{repositories:s?.repositories||[],isLoadingRepos:c,onCreateRepo:async()=>{if(!r)throw Error(`Please select a project`);await a.handleCreateRepo({namespace:r.value}),l()},reset:a.reset,showCreateRepoForm:a.showCreateRepoForm,setShowCreateRepoForm:a.setShowCreateRepoForm,newRepoName:a.newRepoName,setNewRepoName:a.setNewRepoName,isCreating:a.isCreating}},YXt=e=>{let{account:t,sourceControlConfig:n,selectedNamespace:r,searchTerm:i}=e,a=j7(e),o=n.provider===O7,{data:s,isLoading:c}=mYe(t.name,r?r.value:``,i,{enabled:o&&r!==null});return{...a,repositories:s?.repositories||[],isLoadingRepos:c,reset:a.reset}},XXt=e=>{let{account:t,selectedNamespace:n,searchTerm:r}=e,i=j7(e),{data:a}=fYe(t.name),{data:o,isLoading:s,refetch:c}=dYe(t.name),l=i.transformRepoToRepository;return{repositories:(0,g.useMemo)(()=>{if(!o?.data||!n)return[];let e=a?.find(e=>e.installationId===Number(n.value))?.slug||n.label;return(o.data[e]||[]).filter(e=>!r||e.name.toLowerCase().includes(r.toLowerCase())).map(e=>l(e,`gitlab`))},[o,n,r,a,l]),isLoadingRepos:s,onCreateRepo:async()=>{if(!n)throw Error(`Please select a namespace`);await i.handleCreateRepo({namespace:n.value}),c()},reset:i.reset,showCreateRepoForm:i.showCreateRepoForm,setShowCreateRepoForm:i.setShowCreateRepoForm,newRepoName:i.newRepoName,setNewRepoName:i.setNewRepoName,isCreating:i.isCreating}},ZXt=250,QXt=({account:e,project:t,sourceControlConfig:n})=>{let{logEvent:r}=Vg(),i=n.provider,a=KXt(i),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(null),[u,d]=(0,g.useState)(``),f=zXt(u,ZXt),{data:p,isLoading:m,isFetching:h,error:_}=fYe(e.name),v={account:e,project:t,sourceControlConfig:n,selectedNamespace:c,searchTerm:f},y=qXt(v),b=XXt(v),x=JXt(v),S=YXt(v),C=(()=>{switch(i){case A7:return y;case D7:return b;case k7:return x;default:return S}})();(0,g.useEffect)(()=>{let e=Yj(_);e&&s(e)},[_]),(0,g.useEffect)(()=>{if(p&&p.length>0){let e=p[0];l({label:e.name,value:i===`AZURE`?e.slug:e.installationId.toString(),icon:a.icon(20)})}},[p,i,a]);let w=a=>{if(a.value===`add-github-account`){r(`source-control-add-account-selected`,{sourceControlNamespace:a.value,account:e.name,project:t.name,sourceControlProvider:i}),n.installUrl&&window.open(n.installUrl);return}r(`source-control-namespace-selected`,{sourceControlNamespace:a.value,sourceControlProvider:i,account:e.name,project:t.name}),s(``),l(a),C.reset()},T=[];p?.forEach(e=>{T.push({label:e.name,value:i===`AZURE`?e.slug:e.installationId,icon:a.icon(20)})}),i===`GITHUB`&&T.push({label:`Add GitHub Account`,value:`add-github-account`,icon:(0,W.jsx)(Jm,{className:`mr-1.5`,size:16})});let E=()=>a.supportsProjects&&C.selectedProject?C.repositories.length>0?`Showing ${C.repositories.length} repositories from project: ${C.selectedProject.label}`:a.messages.grantAccess:!a.supportsProjects&&C.repositories.length>0?`Showing ${Math.min(C.repositories.length,5)} repositories`:a.supportsProjects&&!C.selectedProject?a.messages.selectAccount:`Select an account to view repositories`,D=()=>(0,W.jsx)(HXt,{installUrl:n.installUrl??``,selectedOrg:c?.label??``,projectName:t.name,provider:i,className:`w-full md:w-auto`}),O=m||C.isLoadingRepos,k=!a.supportsProjects||C.selectedProject;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(qR,{error:o}),(0,W.jsxs)(`div`,{className:`w-full flex items-center text-sm mt-2 gap-2 justify-center`,children:[(0,W.jsx)(`p`,{className:`flex-1 hidden md:block`,children:a.supportsProjects&&C.selectedProject?a.messages.noRepoInProject:a.messages.noRepoAtHand}),D()]}),O&&c===null&&(0,W.jsx)(VXt,{showHeader:!1}),!m&&(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(RXt,{testId:`namespace-selector`,placeholder:a.placeholder.namespace,options:T,selected:c,onChange:w,className:`flex-1 items-center h-9`,isLoadingData:h}),i===`AZURE`&&c&&(0,W.jsx)(BXt,{projects:C.projects,isLoadingProjects:C.isLoadingProjects||!1,selectedProject:C.selectedProject||null,onProjectChange:C.onProjectChange||(()=>{})}),(0,W.jsxs)(QJ,{className:`flex-2 w-full`,children:[(0,W.jsx)(eY,{value:u,onChange:e=>d(e.target.value),placeholder:a.placeholder.search}),(0,W.jsx)($J,{align:`inline-start`,children:(0,W.jsx)(Xm,{className:`opacity-75`})}),u&&(0,W.jsx)($J,{align:`inline-end`,children:(0,W.jsx)(Y,{variant:`ghost`,size:`icon-sm`,onClick:()=>d(``),children:(0,W.jsx)(nh,{})})})]})]}),(0,W.jsx)(lV,{className:`flex flex-col`,children:C.isLoadingRepos&&k?(0,W.jsxs)(`div`,{className:`flex flex-row items-center p-2 justify-center align-middle h-80`,children:[(0,W.jsx)(IL,{className:`w-4 h-4 mr-2`,borderPositionAndSize:`border-l-2`}),(0,W.jsx)(`span`,{children:`Loading repositories...`})]}):k&&C.repositories.length>0?(0,W.jsx)(WXt,{repositories:C.repositories,account:e,project:t,selectedNamespace:c,provider:i,onConnectError:s}):k?(0,W.jsxs)(`div`,{className:`flex flex-col text-sm text-center gap-2 items-center justify-center h-80`,children:[(0,W.jsx)(`h2`,{className:`text-base`,children:`No Results Found`}),(0,W.jsx)(`p`,{children:u?`Your search for "${u}" did not return any results.`:a.messages.grantAccess})]}):(0,W.jsx)(`div`,{className:`flex items-center justify-center h-80`,children:(0,W.jsx)(`p`,{children:a.messages.selectAccount})})}),(0,W.jsxs)(`div`,{className:`flex whitespace-pre-line text-gray-500 text-sm justify-between gap-4`,children:[(0,W.jsx)(`span`,{children:E()}),(i===`GITHUB`||i===`GITLAB`||i===`BITBUCKET`)&&n.installUrl&&(0,W.jsxs)(oT,{href:n.installUrl,className:`whitespace-pre`,children:[`Adjust `,a.name,` Permissions →`]})]})]})},$Xt=({provider:e,url:t,org:n,name:r,children:i})=>(0,W.jsx)(lV,{className:`flex gap-2 flex-col`,offset:`md`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(T7,{providerName:e}),(0,W.jsx)(`div`,{className:`flex flex-col flex-1`,children:(0,W.jsxs)(`a`,{className:`text-sm font-semibold hover:text-zuplo-pink-hover underline flex gap-1 items-center`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:[n,`/`,r,(0,W.jsx)(Pm,{className:`h-4 w-4`})]})}),i]})}),eZt=({account:e,project:t})=>{let{logEvent:n}=Vg(),r=lh([`account`,`project`]);if(!t.sourceRepoUrl)throw Error(`No sourceRepoUrl on project '${r.account.name}'`);let i=t.sourceRepoUrl.replace(`.git`,``),a,o,s=!1;try{s=new URL(t.sourceRepoUrl).hostname===`dev.azure.com`}catch{s=!1}if(s){let e=t.sourceRepoUrl.match(/^https:\/\/dev\.azure\.com\/([^/]+)\/([^/]+)\/_git\/([^/]+)/);if(e){a=e[1];let t=e[2],n=e[3].replace(`.git`,``);a=`${e[1]}/${t}`,o=n}else{let e=t.sourceRepoUrl.split(`/`);a=e[e.length-2],o=e[e.length-1]}}else{let e=t.sourceRepoUrl.split(`/`);a=e[e.length-2],o=e[e.length-1]}let c=KYt(e.name,t.name),l=async()=>{await c.mutateAsync(),n(`source-control-repo-disconnected`,{account:r.account.name,project:r.project.name})};return(0,W.jsx)($Xt,{org:a,name:o,url:i,provider:t.sourceControlProvider.toLowerCase(),children:(0,W.jsx)(Y,{"data-test":`disconnect-repo-button`,onClick:l,variant:`secondary`,className:`self-end`,disabled:c.isPending,children:(0,W.jsx)(Pk,{className:`flex items-center gap-1`,loading:c.isPending,children:`Disconnect`})})})},tZt=({provider:e,onClose:t})=>{if(!e)return null;let n=Jj(e);return(0,W.jsx)(kA,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,W.jsxs)(MA,{children:[(0,W.jsxs)(NA,{children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(T7,{providerName:e.toLowerCase(),size:28}),(0,W.jsxs)(FA,{children:[n,` Integration`]})]}),(0,W.jsxs)(IA,{className:`pt-2`,children:[n,` source control integration is available on Enterprise plans. Contact our sales team or book a demo to learn more about connecting your `,n,` repositories to Zuplo.`]})]}),(0,W.jsxs)(PA,{className:`mt-2`,children:[(0,W.jsx)(Y,{variant:`outline`,asChild:!0,children:(0,W.jsx)(oT,{href:`mailto:${eC}?subject=${encodeURIComponent(`${n} Source Control Integration`)}`,variant:`ghost`,children:`Contact Sales`})}),(0,W.jsx)(Y,{asChild:!0,children:(0,W.jsx)(oT,{href:$S,variant:`ghost`,children:`Book a Demo`})})]})]})})},nZt=`sourceControlConnect`,rZt=()=>{let{logEvent:e}=Vg(),t=y_(),[n,r]=(0,g.useState)(!1);return{connect:(n,i)=>{let{id:a,provider:o,clientId:s,scopes:c,redirectUri:l,providerUrl:u}=i;e(`source-control-provider-clicked`,{provider:o}),e(`source-control-connect-clicked`,{account:n,sourceControlProvider:o}),localStorage.removeItem(nZt),localStorage.setItem(nZt,`${n}::${a}`),r(!0);let d=i=>{i.key===`sourceControlConnect`&&i.oldValue===`${n}::${a}`&&i.newValue===null&&(e(`source-control-access-granted`,{account:n,sourceControlProvider:o}),r(!1),window.removeEventListener(`storage`,d),t.invalidateQueries({queryKey:[X.accountsSourceControlConfigurations().url],exact:!1}))};if(window.addEventListener(`storage`,d,!1),o===`GITHUB`){let e=c===``?`https://github.com/login/oauth/authorize?client_id=${s}`:`https://github.com/login/oauth/authorize?client_id=${s}&scope=${c}`;window.open(e)}o===`GITLAB`&&window.open(`${u}/oauth/authorize?client_id=${s}&redirect_uri=${l}&response_type=code&scope=${c}`),o===`BITBUCKET`&&window.open(`${u}/site/oauth2/authorize?client_id=${s}&response_type=code`),o===`AZURE`&&window.open(`https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=${s}&redirect_uri=${encodeURIComponent(l)}&response_type=code&response_mode=query&scope=${encodeURIComponent(c)}`)},isConnecting:n}},iZt=({accountName:e,sourceControlConfig:t})=>{let{connect:n,isConnecting:r}=rZt(),{provider:i}=t;return(0,W.jsx)(`div`,{children:(0,W.jsx)(Y,{variant:`outline`,className:`gap-2`,disabled:r,onClick:()=>n(e,t),children:(0,W.jsx)(Pk,{loading:r,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(T7,{providerName:i}),(0,W.jsx)(`span`,{children:`Connect to ${Jj(i)}`})]})})})})},aZt=[{key:D7,label:`GitLab`},{key:k7,label:`Bitbucket`}],oZt=({account:e,project:t,sourceControlConfig:n})=>{let{logEvent:r}=Vg(),[i,a]=(0,g.useState)(null);if(n?.userHasCredentials&&t.sourceRepoUrl)return(0,W.jsx)(eZt,{account:e,project:t});if(n&&!t.sourceRepoUrl&&n.userHasCredentials)return(0,W.jsx)(QXt,{account:e,project:t,sourceControlConfig:n});let o=n?Jj(n.provider):null;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(lV,{offset:`md`,className:`flex flex-col gap-4`,children:[(0,W.jsxs)(`div`,{className:`text-sm whitespace-pre-line text-gray-500`,children:[n&&t.sourceRepoUrl&&(0,W.jsxs)(`p`,{className:`mb-3`,children:[`This project is currently associated with a `,o,` `,`repository but you have not connected to your `,o,` `,`account.`]}),(0,W.jsx)(`p`,{children:`Connect to a source control provider to enable source control on your project.`})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[n&&(0,W.jsx)(iZt,{accountName:e.name,sourceControlConfig:n}),aZt.map(({key:e,label:t})=>(0,W.jsxs)(Y,{variant:`outline`,className:`gap-2`,onClick:()=>{r(`source-control-provider-clicked`,{provider:e}),a(e)},children:[(0,W.jsx)(T7,{providerName:e.toLowerCase(),size:20}),(0,W.jsxs)(`span`,{children:[`Connect to `,t]})]},e))]})]}),(0,W.jsx)(tZt,{provider:i,onClose:()=>a(null)})]})},sZt=()=>wj(X.accountsSourceControlConfigurations()),cZt=()=>{let{account:e,project:t}=lh([`account`,`project`]),{logEvent:n}=Vg();return(0,W.jsxs)(`div`,{className:`flex flex-col space-y-4`,children:[(0,W.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Support`}),(0,W.jsx)(lV,{offset:`md`,className:`p-6`,children:(0,W.jsxs)(`div`,{className:`flex w-full gap-4 items-center`,children:[(0,W.jsx)(`div`,{className:`rounded-lg bg-gray-100 dark:bg-neutral-800 w-20 h-20 grid place-items-center`,children:(0,W.jsx)(rie,{size:38,strokeWidth:1.6,fill:`#FF99E5`,fillOpacity:.2})}),(0,W.jsxs)(`div`,{className:`flex-1`,children:[(0,W.jsx)(dV,{className:`text-base`,children:`Talk to an API expert`}),(0,W.jsx)(fV,{className:`text-md`,children:`Get a free technical consultation with one of our API experts.`})]}),(0,W.jsx)(Y,{onClick:()=>{n(`getting-started-book-a-meeting-clicked`,{account:e.name}),window.open($S,`_blank`)},className:`min-w-40`,variant:`secondary`,asChild:!0,children:(0,W.jsxs)(oT,{href:$S,variant:`ghost`,children:[(0,W.jsx)(Cre,{}),`Book a Meeting`]})})]})}),(0,W.jsx)(lV,{offset:`md`,className:`p-6`,children:(0,W.jsxs)(`div`,{className:`flex w-full gap-4 items-center`,children:[(0,W.jsx)(`div`,{className:`rounded-lg bg-gray-100 dark:bg-neutral-800 w-20 h-20 grid place-items-center`,children:(0,W.jsx)(Gm,{size:38,strokeWidth:1.6,fill:`#FF99E5`,fillOpacity:.2})}),(0,W.jsxs)(`div`,{className:`flex-1`,children:[(0,W.jsx)(dV,{className:`text-base`,children:`Feeling Stuck?`}),(0,W.jsx)(fV,{className:`text-md`,children:`Check out our various support options to get help with your API`})]}),(0,W.jsx)(Y,{className:`min-w-40`,variant:`secondary`,asChild:!0,children:(0,W.jsxs)(Pr,{to:Ce(YR.Support,{account:e.name}),children:[(0,W.jsx)(Gm,{}),`Get Help`]})})]})}),(0,W.jsx)(lV,{offset:`md`,className:`p-6`,children:(0,W.jsxs)(`div`,{className:`flex w-full gap-4 items-center`,children:[(0,W.jsx)(`div`,{className:`rounded-lg bg-gray-100 dark:bg-neutral-800 w-20 h-20 grid place-items-center`,children:(0,W.jsx)(rie,{size:38,strokeWidth:1.6,fill:`#FF99E5`,fillOpacity:.2})}),(0,W.jsxs)(`div`,{className:`flex-1`,children:[(0,W.jsx)(dV,{className:`text-base`,children:`Join the Zuplo API Community`}),(0,W.jsx)(fV,{className:`text-md`,children:`Come chat with fellow Zuplo users and the Zuplo team in our Discord channel.`})]}),(0,W.jsx)(Y,{onClick:()=>{n(`getting-started-join-discord-clicked`,{account:e.name,project:t.name}),window.open(ZS,`_blank`)},className:`min-w-40`,variant:`secondary`,asChild:!0,children:(0,W.jsxs)(oT,{href:ZS,variant:`ghost`,children:[(0,W.jsx)(Yre,{size:16}),`Join Us`]})})]})})]})},lZt=()=>{let{account:e,project:t,environment:n}=Pj([`account`,`project`,`environment`]);return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(uV,{children:[(0,W.jsx)(dV,{className:`text-base`,children:`Welcome to your Gateway`}),(0,W.jsx)(fV,{className:`text-base`,children:`You can get started by configuring your routes and setting up policies in our visual Route Designer.`})]}),(0,W.jsxs)(mV,{className:`border-0 gap-2 py-6`,children:[(0,W.jsx)(Y,{asChild:!0,size:`sm`,className:`gap-2 px-8`,variant:`brand-outline`,children:(0,W.jsxs)(Pr,{to:Ce(YR.Code,{account:e,project:t,environment:n}),children:[(0,W.jsx)(Am,{size:16}),`Start Building`]})}),(0,W.jsx)(Y,{className:`px-8`,variant:`secondary`,size:`sm`,asChild:!0,children:(0,W.jsxs)(oT,{variant:`ghost`,href:`https://zuplo.com/docs/articles/step-1-setup-basic-gateway`,children:[(0,W.jsx)(Lm,{size:16}),`Quickstart`]})})]})]})},uZt=()=>{let[e,t]=(0,g.useState)(!1);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(lV,{className:`col-span-full md:col-span-3 py-2 px-4 flex items-center text-sm gap-x-2`,children:[(0,W.jsx)(`div`,{className:`rounded-full w-4 h-4 p-0.5 bg-gray-500`,children:(0,W.jsx)(km,{className:`text-white`,size:12})}),(0,W.jsx)(`span`,{className:`font-semibold flex-1 line-clamp-1 break-all`,children:`Developer Portal`}),(0,W.jsxs)(Y,{variant:`secondary`,size:`sm`,onClick:()=>t(!0),children:[(0,W.jsx)(Lm,{}),`Open\xA0Portal`]})]}),(0,W.jsx)(kA,{open:e,onOpenChange:t,children:(0,W.jsxs)(MA,{children:[(0,W.jsxs)(NA,{children:[(0,W.jsx)(FA,{children:`Run Developer Portal Locally`}),(0,W.jsx)(IA,{children:`To view and edit your API documentation, you need to run the developer portal locally.`})]}),(0,W.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(`p`,{className:`text-sm font-semibold`,children:`Steps to run the portal:`}),(0,W.jsxs)(`ol`,{className:`list-decimal list-inside space-y-2 text-sm text-gray-600`,children:[(0,W.jsxs)(`li`,{children:[`Open a terminal in the`,` `,(0,W.jsx)(`code`,{className:`bg-gray-100 px-1 rounded-sm`,children:`/docs`}),` `,`folder of your Zuplo project`]}),(0,W.jsxs)(`li`,{children:[`Run`,` `,(0,W.jsx)(`code`,{className:`bg-gray-100 px-1 rounded-sm`,children:`npm run dev`})]}),(0,W.jsx)(`li`,{children:`The portal will open in your browser automatically`})]})]}),(0,W.jsx)(`div`,{className:`bg-blue-50 dark:bg-blue-950/40 border border-blue-200 dark:border-blue-800 rounded-md p-3`,children:(0,W.jsxs)(`p`,{className:`text-xs text-blue-800 dark:text-blue-200`,children:[(0,W.jsx)(`strong`,{children:`Tip:`}),` The developer portal will automatically reload when you make changes to your OpenAPI documentation.`]})})]}),(0,W.jsxs)(PA,{children:[(0,W.jsx)(Y,{variant:`secondary`,onClick:()=>t(!1),children:`Close`}),(0,W.jsx)(Y,{asChild:!0,variant:`outline`,children:(0,W.jsx)(oT,{href:`https://zuplo.com/docs/dev-portal`,children:`View Documentation`})})]})]})})]})},dZt=()=>{let{project:e,environment:t}=lh(),n=uO(t);return(0,W.jsx)(`div`,{className:`bg-neutral-50 dark:bg-neutral-950 h-full overflow-y-auto`,children:(0,W.jsxs)(`div`,{className:`pt-4 max-w-6xl pb-16 m-auto px-5 flex flex-col gap-4`,children:[(0,W.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e.name}),(0,W.jsxs)(`div`,{className:`grid grid-cols-8 gap-3`,children:[(0,W.jsx)(OXt,{title:`Gateway`,url:n}),(0,W.jsx)(uZt,{})]}),(0,W.jsxs)(lV,{className:`relative grid md:grid-cols-2 overflow-hidden min-h-[220px]`,children:[(0,W.jsx)(lZt,{}),(0,W.jsxs)(`div`,{className:`hidden md:block self-end h-full w-full`,children:[(0,W.jsx)(`img`,{src:wXt,alt:e.name,className:`w-full h-full object-cover object-left dark:hidden`}),(0,W.jsx)(`img`,{src:TXt,alt:``,"aria-hidden":!0,className:`hidden w-full h-full object-cover object-left dark:block`})]})]}),(0,W.jsx)(DXt,{mode:`local`}),(0,W.jsx)(cZt,{})]})})},fZt=()=>gP().brand,pZt=((e,...t)=>(...n)=>e(...t,...n))(wj,X.accounts()),mZt=e=>wj(X.accountMemberInvites(e),{extractData:!0}),hZt=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.accounts.deleteAccountMemberInvite(t))})},gZt=()=>{let e=xj();return T_({mutationFn:async t=>await e.fetch(bj.accounts.resendAccountMemberInvite(t))})},_Zt=({account:e,navigateTo:t})=>{let{data:n,isLoading:r}=BYt(e),i=[...n??[]].sort((e,t)=>e.name.toLowerCase().localeCompare(t.name.toLowerCase()));return r?(0,W.jsx)(X1,{heading:e,forceMount:!0,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,W.jsx)(Km,{className:`h-4 w-4 animate-spin`}),(0,W.jsx)(`span`,{children:`Loading projects...`})]})}):(0,W.jsx)(X1,{heading:e,children:i.map(n=>(0,W.jsxs)(Z1,{value:`${e}/${n.name}`,keywords:[n.name,e],onSelect:()=>t(Ce(YR.Overview,{account:e,project:n.name})),children:[(0,W.jsx)(gm,{className:`mr-3 h-4 w-4 text-neutral-600`}),(0,W.jsx)(`span`,{children:n.name})]},n.id))})},vZt=({accounts:e,navigateTo:t})=>{let n=e?.map(e=>e.name)??[],r=VYt(n),i=(e??[]).map(e=>e.name).sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())),a=n.flatMap((e,t)=>(r[t]?.data??[]).map(t=>({account:e,project:t}))).sort((e,t)=>e.project.name.toLowerCase().localeCompare(t.project.name.toLowerCase()));return(0,W.jsxs)(X1,{children:[i.map(e=>(0,W.jsxs)(Z1,{value:e,keywords:[e],onSelect:()=>t(Ce(YR.AccountProjects,{account:e})),children:[(0,W.jsx)(_m,{className:`mr-3 h-4 w-4 text-neutral-600`}),(0,W.jsx)(`span`,{className:`truncate`,children:e}),(0,W.jsx)(`span`,{className:`ml-auto shrink-0 pl-3 text-xs text-muted-foreground`,children:`Account`})]},`account:${e}`)),a.map(({account:e,project:n})=>(0,W.jsxs)(Z1,{value:`${e}/${n.name}`,keywords:[n.name,e],onSelect:()=>t(Ce(YR.Overview,{account:e,project:n.name})),children:[(0,W.jsx)(gm,{className:`mr-3 h-4 w-4 text-neutral-600`}),(0,W.jsx)(`span`,{className:`truncate`,children:n.name}),(0,W.jsx)(`span`,{className:`ml-auto shrink-0 pl-3 text-xs text-muted-foreground`,children:e})]},n.id))]})},yZt=({accounts:e,navigateTo:t,search:n})=>n.trim()?(0,W.jsx)(vZt,{accounts:e,navigateTo:t}):(0,W.jsxs)(W.Fragment,{children:[e?.map(e=>(0,W.jsx)(_Zt,{navigateTo:t,account:e.name},`projects-${e.name}`)),(0,W.jsx)(X1,{heading:`Accounts`,children:e?.map(e=>(0,W.jsxs)(Z1,{onSelect:()=>{t(Ce(YR.AccountProjects,{account:e.name}))},children:[(0,W.jsx)(_m,{className:`mr-2 h-4 w-4`}),(0,W.jsx)(`span`,{children:e.name})]},e.name))})]}),bZt=({account:e,navigateTo:t,project:n,environment:r})=>(0,W.jsx)(X1,{heading:`Files`,children:dh(e=>e.projectTreeNodes).filter(e=>e.path&&e.type===$r.File).map(i=>(0,W.jsxs)(Z1,{onSelect:()=>t(Ce(`${YR.Code}?path=${i.path}`,{account:e,project:n,environment:r})),children:[(0,W.jsx)(`div`,{className:`mr-3`,children:(0,W.jsx)(Rm,{className:`h-4 w-4 text-neutral-500`})}),(0,W.jsx)(`span`,{className:`line-clamp-1`,children:i.path.substring(1)})]},i.path))}),xZt=e=>e.plan===`FREE_V1`,SZt=({account:e,className:t,source:n})=>{let r=e.customDomainsInUse,i=e.entitlements.customDomains,a=xZt(e),o=`${Ce(YR.AccountSettings,{account:e.name})}/upgrade-billing?source=${n}`;return(0,W.jsxs)(lV,{variant:`default`,className:t,children:[(0,W.jsx)(uV,{children:a?`Custom domains require a paid plan`:`Custom domain limit reached`}),(0,W.jsx)(pV,{className:`text-sm leading-relaxed`,children:a?(0,W.jsx)(`p`,{children:`Custom domains let you serve your APIs and developer portal from your own domain. Upgrade to the Builder plan to add custom domains to your account.`}):(0,W.jsxs)(`p`,{children:[`Your account is using`,` `,(0,W.jsxs)(`span`,{className:`font-medium`,children:[r,` of `,i]}),` `,`custom domains. Contact our team to increase your limit.`]})}),(0,W.jsxs)(mV,{className:`flex flex-wrap items-center gap-2`,children:[a?(0,W.jsx)(Y,{asChild:!0,children:(0,W.jsx)(CX,{variant:`ghost`,to:o,children:`Upgrade to Builder`})}):(0,W.jsx)(Y,{asChild:!0,children:(0,W.jsx)(oT,{href:$S,variant:`ghost`,children:`Contact Sales`})}),(0,W.jsx)(Y,{variant:`outline`,asChild:!0,children:(0,W.jsx)(oT,{href:`https://zuplo.com/pricing?utm_source=pzc`,variant:`ghost`,children:`View Plans`})})]})]})},CZt=({used:e,max:t,label:n,account:r,navigationSource:i,className:a,hideAtLimit:o=!1})=>{if(t<=0)return null;let s=e>=t,c=r.plan.startsWith(`FREE`),l=`${Ce(YR.AccountSettings,{account:r.name})}/upgrade-billing${i?`?source=${i}`:``}`;return s?o?null:(0,W.jsxs)(PS,{variant:`warning`,className:a,children:[(0,W.jsx)(th,{}),(0,W.jsx)(IS,{children:(0,W.jsxs)(`p`,{children:[`You've reached the limit of `,t,` `,n,` on your plan (`,e,` of`,` `,t,` used).`,` `,c?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(CX,{to:l,className:`hover:text-zuplo-pink-hover text-zuplo-pink underline`,children:`Upgrade your plan`}),` `,`to add more.`]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(oT,{href:`mailto:${eC}`,className:`text-zuplo-pink hover:text-zuplo-pink-hover underline`,children:`Contact sales`}),` `,`to increase your limit.`]})]})})]}):(0,W.jsxs)(`p`,{className:G(`text-sm text-muted-foreground`,a),children:[`Using `,e,` of `,t,` `,n,`.`]})},wZt=({className:e})=>(0,W.jsxs)(lV,{variant:`info`,className:e,children:[(0,W.jsx)(uV,{children:`Managed Dedicated Project`}),(0,W.jsx)(pV,{className:`flex-1 leading-loose mt-1 text-sm`,children:(0,W.jsxs)(`p`,{className:`leading-loose`,children:[`This project uses Akamai managed dedicated hosting. Custom domains for Akamai must be configured through Akamai CDN. See`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/dedicated/akamai/cdn`,children:`Akamai custom domain documentation`}),`.`]})})]}),TZt={[VA.PRODUCTION]:`bg-amber-50 text-amber-800 ring-amber-200 dark:bg-amber-900/30 dark:text-amber-200 dark:ring-amber-800/60`,[VA.PREVIEW]:`bg-blue-50 text-blue-700 ring-blue-200 dark:bg-blue-900/30 dark:text-blue-200 dark:ring-blue-800/60`,[VA.WORKING_COPY]:`bg-muted text-muted-foreground ring-border`},EZt=({environmentType:e,className:t})=>{if(!e)return null;let n=e,r=TZt[n];return r?(0,W.jsx)(`span`,{className:G(`inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[10px] font-medium tracking-wide ring-1 ring-inset`,r,t),children:Q1(n)}):null},DZt=[VA.WORKING_COPY,VA.PRODUCTION,VA.PREVIEW],M7=({environments:e,value:t,onValueChange:n,disabled:r,placeholder:i=`Select an environment`,getOptionValue:a=e=>e.name,sentinel:o,className:s,triggerClassName:c,triggerSize:l=`default`,modal:u=!1,showTriggerBadge:d=!0,id:f,...p})=>{let[m,h]=g.useState(!1),_=g.useMemo(()=>{let t=new Map;for(let n of e){if(!n.environmentType)continue;let e=n.environmentType,r=t.get(e)??[];r.push(n),t.set(e,r)}return DZt.flatMap(e=>{let n=t.get(e);return n&&n.length>0?[{type:e,envs:n}]:[]})},[e]),v=g.useMemo(()=>e.find(e=>a(e)===t),[e,t,a]),y=o!=null&&o.value===t,b=()=>y?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(hm,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`truncate text-sm`,children:o?.label})]}):v?(0,W.jsx)(OZt,{env:v,showBadge:d}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:i});return(0,W.jsxs)(kX,{open:m,onOpenChange:h,modal:u,children:[(0,W.jsx)(AX,{asChild:!0,children:(0,W.jsxs)(Y,{id:f,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":m,disabled:r,size:l,className:G(`border-input font-normal w-full justify-between`,c),"data-test":p[`data-test`],children:[(0,W.jsx)(`div`,{className:`flex items-center gap-2 min-w-0 flex-1`,children:b()}),(0,W.jsx)(ym,{className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,W.jsx)(jX,{className:G(`min-w-[320px] w-(--radix-popover-trigger-width) max-w-[480px] p-0 rounded-md shadow-md`,s),side:`bottom`,align:`start`,children:(0,W.jsxs)(K1,{filter:(e,t)=>{let n=e.toLowerCase(),r=t.toLowerCase().trim();return!r||n.startsWith(`__sentinel__`)||n.includes(r)?1:0},children:[(0,W.jsx)(q1,{placeholder:`Search environments...`,className:`h-10`}),(0,W.jsxs)(J1,{className:`max-h-[360px]`,children:[(0,W.jsx)(Y1,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No environments match.`}),o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X1,{children:(0,W.jsxs)(Z1,{value:`__sentinel__ ${o.label}`,onSelect:()=>{n(o.value),h(!1)},className:`flex items-center gap-2.5 px-2.5 py-2 cursor-pointer data-[selected=true]:bg-accent`,children:[(0,W.jsx)(hm,{className:G(`size-3.5 shrink-0`,t===o.value?`text-foreground`:`text-muted-foreground`)}),(0,W.jsx)(`span`,{className:G(`flex-1 truncate text-sm`,t===o.value&&`font-medium`),children:o.label}),(0,W.jsx)(vm,{className:G(`size-4 shrink-0 text-muted-foreground`,t===o.value?`opacity-100`:`opacity-0`)})]})}),_.length>0&&(0,W.jsx)(KEt,{})]}),_.map(({type:e,envs:r})=>(0,W.jsx)(X1,{heading:Q1(e),children:r.map(e=>{let r=a(e);return(0,W.jsx)(kZt,{env:e,isSelected:!y&&r===t,onPick:()=>{n(r),h(!1)}},e.name)})},e))]})]})})]})},OZt=({env:e,showBadge:t})=>{let n=e.environmentType,r=n===VA.WORKING_COPY,i=r?oz:Bm,a=r?`working copy`:e.branchName??e.label;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(i,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsx)(`span`,{className:G(`truncate min-w-0 flex-1 text-sm text-left`,r?``:`font-mono`),children:a}),t&&(0,W.jsx)(EZt,{environmentType:n,className:`ml-1`})]})},kZt=({env:e,isSelected:t,onPick:n})=>{let r=e.environmentType===VA.WORKING_COPY,i=r?oz:Bm,a=r?`working copy`:e.branchName??e.label;return(0,W.jsxs)(Z1,{value:[e.branchName,e.name,e.label,Q1(e.environmentType)].filter(Boolean).join(` `),onSelect:n,className:`flex items-center gap-2.5 px-2.5 py-2 cursor-pointer data-[selected=true]:bg-accent`,children:[(0,W.jsx)(i,{strokeWidth:1.5,className:G(`size-3.5 shrink-0`,t?`text-foreground`:`text-muted-foreground`)}),(0,W.jsx)(`span`,{className:G(`flex-1 min-w-0 truncate text-sm`,r?``:`font-mono`,t&&`font-medium`),children:a}),(0,W.jsx)(vm,{className:G(`size-4 shrink-0 text-muted-foreground`,t?`opacity-100`:`opacity-0`)})]})},N7=`Switch`,[AZt,jZt]=gp(N7),[MZt,NZt]=AZt(N7),PZt=g.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=g.useState(null),m=mp(t,e=>p(e)),h=g.useRef(!1),_=f?u||!!f.closest(`form`):!0,[v,y]=Np({prop:i,defaultProp:a??!1,onChange:l,caller:N7});return(0,W.jsxs)(MZt,{scope:n,checked:v,disabled:s,children:[(0,W.jsx)(Op.button,{type:`button`,role:`switch`,"aria-checked":v,"aria-required":o,"data-state":zZt(v),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:fp(e.onClick,e=>{y(e=>!e),_&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),_&&(0,W.jsx)(RZt,{control:f,bubbles:!h.current,name:r,value:c,checked:v,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});PZt.displayName=N7;var FZt=`SwitchThumb`,IZt=g.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=NZt(FZt,n);return(0,W.jsx)(Op.span,{"data-state":zZt(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});IZt.displayName=FZt;var LZt=`SwitchBubbleInput`,RZt=g.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=g.useRef(null),s=mp(o,a),c=DV(n),l=QC(t);return g.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,W.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});RZt.displayName=LZt;function zZt(e){return e?`checked`:`unchecked`}var BZt=PZt,VZt=IZt;function HZt({className:e,...t}){return(0,W.jsx)(BZt,{"data-slot":`switch`,className:G(`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:(0,W.jsx)(VZt,{"data-slot":`switch-thumb`,className:G(`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`)})})}var P7=({customDomain:e,cname:t,documentationUrl:n=`https://www.zuplo.com/docs/guides/custom-domain-setup`})=>(0,W.jsxs)(`div`,{className:`text-left text-sm text-gray-800 whitespace-pre-line w-full mb-2`,children:[(0,W.jsx)(`p`,{children:`We've set things up on our end, now you need to configure your DNS with a new entry.`}),(0,W.jsx)(`br`,{}),(0,W.jsx)(lV,{variant:`muted`,className:`font-mono p-4 text-sm`,children:(0,W.jsxs)(`ol`,{children:[(0,W.jsx)(`li`,{className:`leading-6`,children:`Type: CNAME`}),(0,W.jsxs)(`li`,{className:`leading-6`,children:[`Name: `,e,` `,(0,W.jsx)(bQ,{textToCopy:e??``})]}),(0,W.jsxs)(`li`,{className:`leading-6`,children:[`Value: `,t,` `,(0,W.jsx)(bQ,{textToCopy:t??``})]}),(0,W.jsx)(`li`,{className:`leading-6`,children:`TTL: 60s or auto`})]})}),(0,W.jsx)(`br`,{}),(0,W.jsx)(`p`,{children:`Note that it does sometimes take a few hours for records to propagate and for the SSL certificate to be created.`}),(0,W.jsx)(`br`,{}),(0,W.jsxs)(`p`,{children:[`For more information see our`,` `,(0,W.jsx)(oT,{href:n,children:`documentation on custom domains`}),`.`]})]});function UZt({projectType:e,defaultConfiguration:t}){return e===`managed-dedicated`&&t.some(e=>!!e.managedDedicatedConfiguration)}function WZt({stage:e,isManagedDedicatedProject:t,isAkamaiManagedDedicatedProject:n,formIsAlias:r}){return e===`dev-portal`?!1:n?!0:t?!1:r??!1}function GZt({projectType:e,defaultConfiguration:t}){return e===`managed-dedicated`&&t.some(e=>e.managedDedicatedConfiguration?.vendor===`akamai`)}var F7=()=>(0,W.jsxs)(`div`,{className:`text-left text-sm text-gray-800 whitespace-pre-line w-full mb-2`,children:[(0,W.jsx)(`p`,{children:`This custom domain is setup with an advanced configuration. In order to make changes to this domain, please contact support.`}),(0,W.jsx)(`br`,{}),(0,W.jsxs)(`p`,{children:[`For more information see our`,` `,(0,W.jsx)(oT,{href:`https://www.zuplo.com/docs/guides/custom-domain-setup`,children:`documentation on custom domains`}),`.`]})]}),KZt=/^(?!https?:\/\/)[a-zA-Z0-9.-]*\.[a-zA-Z]+$/,qZt=`https://zuplo.com/docs/dedicated/custom-domains`,JZt=Nv({hostname:jv().regex(KZt,`Please enter a valid domain name (e.g. api.example.com)`),environment:jv().min(1),stage:Fv([`api`,`dev-portal`]),isAlias:Mv().optional()}),YZt=({account:e,projectName:t,disabled:n=!1,isManagedDedicatedProject:r=!1,isAkamaiManagedDedicatedProject:i=!1})=>{let a=wG({resolver:TG(JZt),defaultValues:{hostname:``,environment:``,stage:`api`,isAlias:i}}),[o,s]=(0,g.useState)(!1),[c,l]=a.watch([`isAlias`,`stage`]),{data:u}=Qj(e.name,t),{aliasDomains:d}=e.entitlements,{data:f}=BYt(e.name),p=f?.find(e=>e.name===t),m=p?YDt(new Date(Number(p.createdOn)),new Date(`2025-04-01`)):!1,h=u?u.filter(e=>e.environmentType!==VA.WORKING_COPY):[],_=NXt({onSuccess:()=>{c&&s(!1)}}),v=(0,g.useCallback)(()=>{a.reset(),_.isSuccess&&_.reset(),s(!1)},[a,_]),y=qmt(a.formState.isDirty&&!_.isSuccess,v);return(0,W.jsxs)(kA,{open:o,onOpenChange:e=>{e?s(!0):y.guardedClose()},children:[(0,W.jsx)(AA,{asChild:!0,children:(0,W.jsx)(Y,{"data-test":`create-custom-domain-modal-btn`,disabled:n,title:n?`You reached the limit of custom domains`:``,children:`Add Custom Domain`})}),(0,W.jsxs)(MA,{children:[(0,W.jsx)(NA,{children:(0,W.jsx)(FA,{children:`Add Custom Domain`})}),(0,W.jsx)(`div`,{className:`space-y-4`,children:_.isSuccess?(0,W.jsxs)(W.Fragment,{children:[r&&!c&&l===`api`?_.data?.cname?(0,W.jsx)(P7,{customDomain:a.getValues(`hostname`),cname:_.data.cname,documentationUrl:qZt}):(0,W.jsx)(F7,{}):!d&&_.data?.cname&&(0,W.jsx)(P7,{customDomain:a.getValues(`hostname`),cname:_.data?.cname}),!r&&!d&&!_.data?.cname&&l===`api`&&(0,W.jsx)(F7,{}),(0,W.jsx)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:(0,W.jsx)(jA,{asChild:!0,children:(0,W.jsx)(Y,{"data-test":`ok-create-custom-domain-btn`,children:`Done`})})})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(qR,{error:_.error}),(0,W.jsxs)(`div`,{className:`text-left text-sm text-foreground whitespace-pre-line w-full mb-2`,children:[h.length>0&&(0,W.jsxs)(EG,{...a,children:[i&&(0,W.jsx)(PS,{variant:`info`,children:(0,W.jsx)(IS,{children:`Make sure this hostname is already configured in your Akamai CDN. Registering it here records the alias domain with Zuplo so your public URLs match the client-facing domain.`})}),m&&!i&&(0,W.jsxs)(PS,{variant:`warning`,children:[(0,W.jsx)(FS,{children:`Preview Notice`}),(0,W.jsxs)(IS,{children:[`Custom domains for the Dev Portal are currently in preview and only available after the migration to our preview version.`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/custom-domains`,target:`_blank`,children:`Learn more`})]})]}),(0,W.jsxs)(`form`,{onSubmit:a.handleSubmit(async n=>{await _.mutateAsync({accountName:e.name,projectName:t,isAlias:WZt({stage:n.stage,isManagedDedicatedProject:r,isAkamaiManagedDedicatedProject:i,formIsAlias:n.isAlias}),hostname:n.hostname,deploymentName:n.environment,stage:n.stage})}),children:[(0,W.jsx)(DG,{control:a.control,name:`environment`,render:({field:e})=>(0,W.jsxs)(kG,{className:`mt-2`,children:[(0,W.jsx)(MW,{htmlFor:`environment-field`,children:`Which environment do you want to apply your new domain to?`}),(0,W.jsx)(M7,{id:`environment-field`,"data-test":`environment-field`,environments:h,value:e.value,onValueChange:e.onChange,disabled:_.isPending,placeholder:`Select an environment`}),(0,W.jsx)(MG,{})]})}),!i&&(0,W.jsx)(DG,{control:a.control,name:`stage`,render:({field:e})=>(0,W.jsxs)(kG,{className:`mt-2`,children:[(0,W.jsx)(MW,{className:`block`,htmlFor:`stage-field`,children:`What do you want the custom domain to be assigned to?`}),(0,W.jsxs)(wW,{onValueChange:t=>{(t===`api`||t===`dev-portal`)&&e.onChange(t)},disabled:_.isPending,...e,children:[(0,W.jsx)(EW,{id:`stage-field`,children:(0,W.jsx)(TW,{placeholder:`Select a stage`})}),(0,W.jsxs)(DW,{children:[(0,W.jsx)(OW,{value:`api`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Vm,{size:16}),` Gateway`]})}),(0,W.jsx)(OW,{value:`dev-portal`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(uie,{size:16}),` Dev Portal`,(0,W.jsx)(LS,{className:``,variant:`info`,children:`New`})]})})]})]}),(0,W.jsx)(MG,{})]})}),(0,W.jsx)(DG,{control:a.control,name:`hostname`,render:({field:e})=>(0,W.jsxs)(kG,{className:`mt-2`,children:[(0,W.jsx)(MW,{htmlFor:`hostname-field`,children:`Your custom domain (e.g. example.com or api.example.com)`}),(0,W.jsx)(jV,{type:`text`,autoComplete:`off`,placeholder:`api.example.com`,id:`hostname-field`,"data-test":`hostname-field`,...e,disabled:_.isPending}),(0,W.jsx)(MG,{})]})}),(0,W.jsx)(DG,{control:a.control,name:`isAlias`,render:({field:e})=>(0,W.jsx)(kG,{className:G((!d||l===`dev-portal`||r)&&`hidden`,`mt-2`),children:(0,W.jsxs)(lV,{className:`p-4 flex items-center gap-3`,children:[(0,W.jsxs)(MW,{className:`flex flex-col gap-2`,htmlFor:`isAlias`,children:[`Is this an alias domain?`,(0,W.jsxs)(`span`,{className:`text-sm font-normal text-muted-foreground`,children:[`If your API Gateway is behind a CDN or WAF, your clients may use a different domain. Use an`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/custom-domains#alias-domains`,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`alias domain`}),` `,`so public URLs like docs and OpenAPI match the client-facing domain.`]})]}),(0,W.jsx)(HZt,{className:`mx-3`,id:`isAlias`,"data-test":`isAlias`,checked:e.value??!1,onCheckedChange:e.onChange,disabled:_.isPending}),(0,W.jsx)(MG,{})]})})}),(0,W.jsxs)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:[(0,W.jsx)(jA,{asChild:!0,children:(0,W.jsx)(Y,{type:`button`,"data-test":`cancel-create-custom-domain-btn`,disabled:_.isPending,variant:`secondary`,children:`Cancel`})}),(0,W.jsx)(Y,{type:`submit`,"data-test":`create-custom-domain-btn`,disabled:_.isPending,children:(0,W.jsx)(Pk,{loading:_.isPending,children:`Create`})})]})]})]}),h.length===0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{children:`Custom domains can only be configured on edge deployment environments and this project only has a working-copy environment.`}),(0,W.jsx)(`br`,{}),(0,W.jsxs)(`p`,{children:[` `,`For more information on this see our`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/environments`,children:`documentation on environments`}),`.`]})]})]})]})})]}),(0,W.jsx)(Kmt,{open:y.showConfirm,onOpenChange:y.setShowConfirm,onDiscard:y.handleDiscard})]})},XZt=`https://zuplo.com/docs/dedicated/custom-domains`,ZZt=({customDomain:e,isManagedDedicatedProject:t,isAkamaiManagedDedicatedProject:n})=>{let[r,i]=(0,g.useState)(void 0),a=()=>{s(),i(void 0)},[o,s]=QR(()=>{let i=r?.deployments.at(0)?.stage,o=r?.deployments.at(0)?.cname,s=typeof o==`string`&&o.length>0;return(0,W.jsx)(cV,{onClose:a,isOpen:!0,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(`div`,{className:`text-xl font-medium`,children:`Configure your custom domain`}),n?(0,W.jsx)(wZt,{}):t&&i===`api`?s?(0,W.jsx)(P7,{customDomain:r?.hostname,cname:o,documentationUrl:XZt}):(0,W.jsx)(F7,{}):e.provider===`custom`?(0,W.jsx)(F7,{}):e.provider===`amazon`?s?(0,W.jsx)(P7,{customDomain:r?.hostname,cname:o,documentationUrl:XZt}):(0,W.jsx)(F7,{}):s?(0,W.jsx)(P7,{customDomain:r?.hostname,cname:o}):(0,W.jsx)(F7,{})]})})},[r]),c=e=>{i(e),o()};return(0,W.jsx)(Y,{onClick:()=>{c(e)},"data-test":`view-domain-configuration-btn`,title:`View Configuration`,variant:`ghost`,size:`icon`,children:(0,W.jsx)(Um,{size:18})})},QZt=/held zone/i;function $Zt(e){return!!e?.some(e=>QZt.test(e))}var eQt=new Set([`pending`,`pending_migration`,`pending_provisioned`,`active_redeploying`,`provisioned`]),tQt=new Set([`blocked`,`pending_blocked`,`moved`,`deleted`,`pending_deletion`,`test_blocked`,`test_failed`]),nQt=new Set([`initializing`,`pending_validation`,`pending_issuance`,`pending_deployment`,`pending_cleanup`,`staging_deployment`,`holding_deployment`]),rQt=new Set([`expired`,`deactivating`,`inactive`,`initializing_timed_out`,`validation_timed_out`,`issuance_timed_out`,`deployment_timed_out`,`deletion_timed_out`,`deleted`,`pending_deletion`,`pending_expiration`]);function iQt(e){if(e.provider===`alias`)return null;if(e.provider===`custom`||e.provider===`amazon`)return{level:`unknown`,label:`Externally managed`,description:`This domain's status isn't reported to Zuplo — verification and certificates are handled by your dedicated infrastructure provider.`};let t=e.verificationErrors&&e.verificationErrors.length>0,n=e.status??null,r=e.sslStatus??null;if(!n&&!r&&!t)return{level:`pending`,label:`Initializing`,description:`We're waiting for the domain provider to report a status. This usually takes a few seconds after the domain is created.`};if($Zt(e.verificationErrors))return{level:`error`,label:`Zone hold`,description:`Cloudflare is blocking this hostname because the parent domain has a zone hold on another Cloudflare account. The zone owner needs to release the hold before we can finish provisioning.`,helpUrl:`https://developers.cloudflare.com/fundamentals/account/account-security/zone-holds/`,helpLabel:`How to release a zone hold`};if(t)return{level:`error`,label:`Needs attention`,description:`The domain provider reported verification errors. Review the details to resolve them.`};if(n&&tQt.has(n))return{level:`error`,label:I7(n),description:`The domain is in a state that prevents it from serving traffic. Contact support if this persists.`};if(r&&rQt.has(r))return{level:`error`,label:`SSL error`,description:`The SSL certificate is in the "${I7(r)}" state. The domain may not serve HTTPS traffic until this is resolved.`};let i=n===`active`||n===`test_active`||n===`test_active_apex`;return i&&(r===`active`||r===`staging_active`||r===`backup_issued`)?{level:`active`,label:`Active`,description:`The domain is verified and serving traffic over HTTPS.`}:i&&r&&nQt.has(r)?{level:`pending`,label:`Issuing certificate`,description:`The domain is verified. We're still provisioning the SSL certificate — this usually takes a few minutes.`}:n&&eQt.has(n)?{level:`pending`,label:`Verifying domain`,description:`We're waiting for DNS verification. Double-check the CNAME record at your DNS provider.`}:n||r?{level:`pending`,label:I7(n??r??`pending`),description:`The domain is still being set up. If this state persists, contact support.`}:{level:`unknown`,label:`Unknown`,description:`No status information is available for this domain.`}}function I7(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}var aQt={active:{dot:`bg-green-500`,pulse:!1,pill:`bg-green-50 text-green-700 border-green-200 hover:bg-green-100 dark:bg-green-950 dark:text-green-300 dark:border-green-800 dark:hover:bg-green-900`},pending:{dot:`bg-amber-500`,pulse:!0,pill:`bg-amber-50 text-amber-800 border-amber-200 hover:bg-amber-100 dark:bg-amber-950 dark:text-amber-300 dark:border-amber-800 dark:hover:bg-amber-900`},error:{dot:`bg-red-500`,pulse:!1,pill:`bg-red-50 text-red-700 border-red-200 hover:bg-red-100 dark:bg-red-950 dark:text-red-300 dark:border-red-800 dark:hover:bg-red-900`},unknown:{dot:`bg-gray-400`,pulse:!1,pill:`bg-gray-50 text-gray-700 border-gray-200 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700`}},oQt=({domain:e})=>{let t=iQt(e);if(!t)return null;let n=aQt[t.level],r=e.verificationErrors??[];return(0,W.jsxs)(kX,{children:[(0,W.jsx)(AX,{asChild:!0,children:(0,W.jsxs)(`button`,{type:`button`,className:G(`inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,n.pill),"aria-label":`${e.hostname} status: ${t.label}`,children:[(0,W.jsxs)(`span`,{className:`relative flex size-2 items-center justify-center`,children:[n.pulse&&(0,W.jsx)(`span`,{className:G(`absolute inline-flex h-full w-full animate-ping rounded-full opacity-75`,n.dot)}),(0,W.jsx)(`span`,{className:G(`relative inline-flex size-2 rounded-full`,n.dot)})]}),t.label]})}),(0,W.jsx)(jX,{align:`start`,className:`w-96`,children:(0,W.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:G(`inline-flex size-2 rounded-full`,n.dot)}),(0,W.jsx)(`span`,{className:`font-medium`,children:t.label})]}),(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:t.description}),t.helpUrl&&(0,W.jsx)(oT,{href:t.helpUrl,className:`text-xs`,children:t.helpLabel??`Learn more`}),r.length>0&&(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Verification errors`}),(0,W.jsx)(`ul`,{className:`list-disc pl-5 space-y-1 text-red-700 dark:text-red-400`,children:r.map(e=>(0,W.jsx)(`li`,{children:e},e))})]})]})})]})},sQt=({account:e,currentDomainConfig:t})=>{let{logEvent:n,captureException:r}=Vg(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),c=e=>{let t=e.target.value;a(t)},l=FXt(),u=async()=>{try{if(s(``),!t.hostname||t.hostname.trim()===``){s(`The current domain configuration does not have a hostname associated with it`);return}await l.mutateAsync({accountName:e.name,projectName:t.projectName??``,hostname:t.hostname,deploymentName:t.deployments[0]?.deploymentName}),n(`account-custom-domain-delete-success`,{account:e.name}),d()}catch(t){r(t);let i=Yj(t);s(i),n(`account-custom-domain-delete-failed`,{account:e.name,errorMessage:i})}},d=()=>{p(),a(``),s(``)},[f,p]=QR(()=>(0,W.jsx)(cV,{onClose:d,isOpen:!0,maxWidth:`max-w-xl`,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(`div`,{className:`text-xl font-medium`,children:`Delete custom domain`}),(0,W.jsx)(qR,{error:o,className:`mb-3`}),(0,W.jsxs)(`div`,{className:`text-sm text-foreground whitespace-pre-line w-full mb-2`,children:[(0,W.jsxs)(`div`,{className:`relative bg-yellow-100 dark:bg-yellow-950/40 rounded-sm p-4 text-yellow-900 dark:text-yellow-200 text-sm whitespace-pre-line w-full mb-2`,children:[(0,W.jsxs)(`div`,{className:`flex space-x-2 items-center`,children:[(0,W.jsx)(Cm,{className:`h-5 w-5 text-yellow-900 dark:text-yellow-200`}),(0,W.jsx)(`span`,{className:`text-sm font-medium antialiased mt-0.5`,children:`Caution: Your project will no longer be accessible with this domain.`})]}),(0,W.jsxs)(`p`,{className:`px-2 mt-4`,children:[`You are about to delete the custom domain`,` `,(0,W.jsx)(`span`,{className:`font-medium antialiased`,children:t.hostname}),` `,`from your project. Requests using it will no longer reach your zup.`]})]}),(0,W.jsx)(`br`,{}),(0,W.jsxs)(`label`,{className:`block mb-2`,htmlFor:`hostname-field`,children:[`Please type`,` `,(0,W.jsx)(`span`,{className:`font-medium antialiased`,children:t.hostname}),` `,`to confirm.`]}),(0,W.jsx)(`input`,{className:`shadow-xs focus:ring-indigo-500 focus:border-indigo-500 block w-full text-sm border-border rounded-md mb-4 placeholder-gray-400 dark:placeholder-neutral-500 disabled:opacity-50`,type:`text`,autoComplete:`off`,value:i,onChange:c,id:`hostname-field`,"data-test":`hostname-field`}),(0,W.jsx)(`div`,{className:` text-red-500`,children:`I understand the consequences, delete this custom domain`})]}),(0,W.jsxs)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:[(0,W.jsx)(Y,{onClick:d,"data-test":`cancel-delete-custom-domain-btn`,variant:`outline`,disabled:l.isPending,children:`Cancel`}),(0,W.jsx)(Y,{"data-test":`delete-custom-domain-btn`,onClick:u,disabled:l.isPending||i!==t.hostname,children:(0,W.jsx)(Pk,{loading:l.isPending,children:`Delete`})})]})]})}),[l.isPending,o,t,i]);return(0,W.jsx)(Y,{type:`button`,title:`Delete Custom Domain`,onClick:f,"data-test-id":`delete-custom-domain-btn`,variant:`ghost`,size:`icon-sm`,children:(0,W.jsx)(Pk,{loading:l.isPending,children:(0,W.jsx)(eh,{size:18})})})},cQt=/^(?!https?:\/\/)[a-zA-Z0-9.-]*\.[a-zA-Z]+$/,lQt=({account:e,projectName:t,currentDomainConfig:n})=>{let{logEvent:r,captureException:i}=Vg(),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(n.deployments[0]?.deploymentName),d=n.hostname,{data:f,error:p}=Qj(e.name,t),m=Yj(p);(0,g.useEffect)(()=>{m&&o(m)},[m]);let h=f?f.filter(e=>e.environmentType!==VA.WORKING_COPY):[],_=PXt(),v=async n=>{if(n.preventDefault(),!l||l.trim()===``){o(`Please select an environment from the options available`);return}if(!d||d.trim()===``){o(`Please provide a value on the custom domain field.`);return}if(d&&!cQt.test(d)){o(`A custom domain value should only be the domain name. It should not start with 'http(s)' and should end with an alpha character.`);return}try{o(``),await _.mutateAsync({accountName:e.name,projectName:t,hostname:d,deploymentName:l}),c(!0),r(`account-custom-domain-edit-success`,{account:e.name})}catch(t){i(t);let n=Yj(t);r(`account-custom-domain-edit-failed`,{account:e.name,errorMessage:n}),o(n),c(!1)}},y=()=>{x(),u(n.deployments[0]?.deploymentName),o(``),c(!1)},[b,x]=QR(()=>(0,W.jsx)(cV,{onClose:y,isOpen:!0,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(`div`,{className:`text-xl font-medium`,children:`Edit your custom domain`}),(0,W.jsx)(qR,{error:a}),(0,W.jsxs)(`div`,{className:`text-left text-sm text-foreground whitespace-pre-line w-full mb-2`,children:[s===!1&&(0,W.jsxs)(`form`,{onSubmit:v,children:[(0,W.jsx)(`label`,{className:`block mb-2`,htmlFor:`environment-field`,children:`Which environment do you want to apply your custom domain to ?`}),(0,W.jsx)(`div`,{className:`mb-9`,children:(0,W.jsx)(M7,{id:`environment-field`,"data-test":`environment-field`,environments:h,value:l??``,onValueChange:e=>u(e),disabled:_.isPending,placeholder:`Select an environment`})}),(0,W.jsx)(`label`,{className:`block mb-2`,htmlFor:`hostname-field`,children:`Your custom domain`}),(0,W.jsx)(`input`,{className:`shadow-xs focus:ring-indigo-500 focus:border-indigo-500 block w-full text-sm border-border rounded-md mb-9 placeholder-gray-400 dark:placeholder-neutral-500 disabled:opacity-50`,type:`text`,autoComplete:`off`,placeholder:`api.example.com`,id:`hostname-field`,value:d,disabled:!0,"data-test":`hostname-field`}),(0,W.jsxs)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:[(0,W.jsx)(Y,{variant:`outline`,type:`button`,onClick:y,"data-test":`cancel-edit-custom-domain-btn`,disabled:_.isPending,children:`Cancel`}),(0,W.jsx)(Y,{"data-test":`save-edit-custom-domain-btn`,type:`submit`,disabled:_.isPending||l===n.deployments[0]?.deploymentName,children:(0,W.jsx)(Pk,{loading:_.isPending,children:`Save`})})]})]}),s===!0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`text-left text-sm text-foreground whitespace-pre-line w-full mb-2`,children:(0,W.jsxs)(`p`,{children:[`Successfully edited custom domain`,` `,(0,W.jsx)(oT,{href:`https://${d}`,children:d}),` `,`to map to deployment `,l]})}),(0,W.jsx)(`div`,{className:`mt-5 sm:mt-4 flex justify-end gap-x-4`,children:(0,W.jsx)(Y,{variant:`outline`,className:`w-24 justify-center`,type:`button`,onClick:y,"data-test":`ok-edit-custom-domain-btn`,disabled:!s,children:`OK`})})]})]})]})}),[h,a]),S=()=>{b()};return(0,W.jsx)(Y,{onClick:()=>S(),title:`Edit Custom Domain`,"data-test-id":`edit-custom-domain-btn`,variant:`ghost`,size:`icon-sm`,children:(0,W.jsx)(Pk,{loading:_.isPending,children:(0,W.jsx)(Ire,{size:18})})})},uQt=({classNames:e,projectType:t,feature:n,helpUrl:r})=>(0,W.jsxs)(lV,{variant:`danger`,className:e,children:[(0,W.jsx)(uV,{children:t===`managed-dedicated`?`Managed Dedicated Project`:t===`self-hosted`?`Self Hosted Project`:`Managed Edge Project`}),(0,W.jsx)(pV,{className:`flex-1 leading-loose mt-1 text-sm`,children:(0,W.jsxs)(`p`,{className:`leading-loose`,children:[`Your project is running on a `,t===`managed-dedicated`?`managed dedicated`:t===`self-hosted`?`self hosted`:`managed edge hosted`,` environment. For information on how to setup up `,n,`, please refer to`,` `,(0,W.jsx)(oT,{href:r,children:`the documentation`}),`.`]})})]});function dQt(){return(0,W.jsx)(`button`,{type:`button`,disabled:!0,title:`Locked custom domain`,className:`items-center justify-center p-2 hover:bg-gray-100 rounded-sm cursor-pointer`,children:(0,W.jsx)(qm,{className:`h-5 w-5 mx-auto`,"aria-hidden":`true`})})}var fQt=()=>{let e=lh([`account`,`project`]),t=IXt(e.account.name,e.project.name),n=HYt(e.account.name,e.project.name);if(!t.data||!n.data)return(0,W.jsx)(hV,{});let r=t.data?.filter(t=>t.projectName&&t.projectName===e.project.name&&t.deployments[0]).sort((e,t)=>e.deployments[0].deploymentName.localeCompare(t.deployments[0].deploymentName)),i=e.account.customDomainsInUse>=e.account.entitlements.customDomains,a=GZt({projectType:e.project.type,defaultConfiguration:n.data.defaultConfiguration}),o=UZt({projectType:e.project.type,defaultConfiguration:n.data.defaultConfiguration});return(0,W.jsxs)(`div`,{className:`flex gap-4 flex-col`,children:[(0,W.jsx)(E7,{title:`Custom Domains`}),(0,W.jsx)(PS,{variant:`outline`,className:`text-sm`,children:(0,W.jsx)(IS,{children:(0,W.jsxs)(`p`,{children:[(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/custom-domains`,children:`Custom domains`}),` `,`allow you to use your own domain name for your API and developer portal. For complex custom domain configurations, please contact us at`,` `,(0,W.jsx)(oT,{href:`mailto:${QS}`,children:QS}),` `,`or use the chat widget at the bottom right.`]})})}),i&&e.account.entitlements.customDomains>0&&e.project.type!==`self-hosted`&&!a&&(0,W.jsx)(SZt,{account:e.account,source:`custom-domain-limit`}),!i&&e.project.type!==`self-hosted`&&!a&&(0,W.jsx)(CZt,{used:e.account.customDomainsInUse,max:e.account.entitlements.customDomains,label:`custom domains`,account:e.account,hideAtLimit:!0}),r.length>0&&(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(t=>{let n=t.deployments[0],r=o&&n?.stage===`api`,i=t.provider===`custom`&&!r,s=t.provider===`alias`,c=n.stage===`dev-portal`,l=a&&!s||i;return(0,W.jsxs)(lV,{className:`p-4 flex items-center justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`shrink-0 flex size-9 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:c?(0,W.jsx)(uie,{className:`size-4`}):(0,W.jsx)(Vm,{className:`size-4`})}),(0,W.jsxs)(`div`,{className:`flex flex-col min-w-0 gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,W.jsxs)(`a`,{href:`https://${t.hostname}`,target:`_blank`,rel:`noreferrer`,className:`font-medium text-sm hover:text-zuplo-pink transition-colors inline-flex items-center gap-1 truncate`,children:[(0,W.jsx)(`span`,{className:`truncate`,children:t.hostname}),(0,W.jsx)(Pm,{className:`size-3 shrink-0 opacity-60`})]}),(0,W.jsx)(oQt,{domain:t}),n.isDefault&&(0,W.jsx)(LS,{variant:`outline`,className:`text-xs`,children:`Default`}),s&&(0,W.jsx)(LS,{variant:`outline`,className:`text-xs`,children:`Alias`})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground flex-wrap`,children:[(0,W.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:c?`Dev Portal`:`API`}),(0,W.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(JEt,{env:n.environmentType??null}),` `,`(`,n.deploymentName,`)`]}),n.branch&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono`,children:[(0,W.jsx)(Bm,{className:`size-3`}),n.branch]})]})]})]})]}),(0,W.jsxs)(`div`,{className:`shrink-0 flex items-center gap-1`,children:[!s&&(0,W.jsx)(ZZt,{customDomain:t,isManagedDedicatedProject:o,isAkamaiManagedDedicatedProject:a}),l?(0,W.jsx)(dQt,{}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(lQt,{account:e.account,projectName:e.project.name,currentDomainConfig:t}),(0,W.jsx)(sQt,{account:e.account,currentDomainConfig:t})]})]})]},t.id)})}),e.project.type===`self-hosted`?(0,W.jsx)(uQt,{classNames:`mt-5`,feature:`custom domains`,helpUrl:`https://zuplo.com/docs/dedicated/custom-domains`,projectType:e.project.type}):a?e.account.entitlements.aliasDomains?(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 mt-2`,children:[(0,W.jsx)(PS,{variant:`info`,className:`text-sm`,children:(0,W.jsx)(IS,{children:(0,W.jsxs)(`p`,{children:[`This project uses Akamai managed dedicated hosting. Configure the hostname in your Akamai CDN first — see the`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/dedicated/akamai/cdn`,children:`Akamai custom domain documentation`}),`. Once it's set up there, add the domain below to register it with Zuplo.`]})})}),(0,W.jsx)(`div`,{children:(0,W.jsx)(YZt,{account:e.account,projectName:e.project.name,isManagedDedicatedProject:o,isAkamaiManagedDedicatedProject:!0})})]}):(0,W.jsx)(wZt,{className:`mt-5`}):e.account.entitlements.customDomains>0?(0,W.jsx)(`div`,{className:`mt-2`,children:(0,W.jsx)(YZt,{disabled:i,account:e.account,projectName:e.project.name,isManagedDedicatedProject:o})}):(0,W.jsx)(SZt,{account:e.account,source:`custom-domain`,className:`mt-5`})]})},pQt=`__NULL_BRANCH`,mQt=e=>{let t=[];return e.production&&t.push(`production`),e.preview&&t.push(`preview`),e.workingCopy&&t.push(`working-copy`),t},hQt=({previewEnvironments:e,defaultBranch:t})=>{let{register:n,watch:r,setValue:i,getValues:a,control:o}=iG(),s=r(`personalOverride`),c=r(`preview`),l=r(`workingCopy`),u=a(),d=u.production||u.preview||u.workingCopy;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 mt-4`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium`,children:`Environments`}),(0,W.jsx)(L7,{id:`production`,testId:`production-checkbox`,register:n(`production`),title:`Production`,description:t?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(Bm,{className:`size-3`}),(0,W.jsx)(`span`,{className:`font-mono`,children:t})]}):`The branch deployed to production`}),(0,W.jsx)(L7,{id:`preview`,testId:`preview-checkbox`,register:n(`preview`),title:`Preview`,description:(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(Bm,{className:`size-3`}),`All non-production branches`]}),action:(0,W.jsx)(cG,{control:o,name:`targetBranch`,render:({field:t})=>(0,W.jsx)(M7,{environments:e,value:t.value??`__NULL_BRANCH`,onValueChange:t.onChange,disabled:!c,getOptionValue:e=>e.branchName??``,sentinel:{value:pQt,label:`All other branches`},triggerClassName:`w-72 h-10`,showTriggerBadge:!1,"data-test":`preview-branch-picker`})})}),(0,W.jsx)(L7,{id:`workingCopy`,testId:`working-copy-checkbox`,register:n(`workingCopy`),title:`Development`,description:(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(oz,{className:`size-3`}),`Your Working Copy & Local Dev`]}),action:l&&(0,W.jsx)(`button`,{type:`button`,"data-test":`personal-override-button`,className:`text-xs text-zuplo-pink hover:underline whitespace-nowrap`,onClick:()=>{i(`personalOverride`,!s,{shouldDirty:!0,shouldTouch:!0})},children:s?`Clear personal override`:`Set personal override`})}),l&&s&&(0,W.jsxs)(`div`,{className:`ml-7 rounded-md border border-dashed bg-muted/40 p-3 flex flex-col gap-1.5`,children:[(0,W.jsx)(`label`,{htmlFor:`personal-value`,className:`text-sm font-medium`,children:`Personal override`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Only applied in your own Working Copy & Local Dev. Other developers won’t see this value.`}),(0,W.jsx)(jV,{id:`personal-value`,"data-test":`personal-override-input`,...n(`personalValue`)})]}),!d&&(0,W.jsx)(PS,{children:(0,W.jsx)(IS,{children:`You must select at least one environment`})})]})},L7=({id:e,testId:t,register:n,title:r,description:i,action:a})=>(0,W.jsxs)(`div`,{className:G(`flex min-h-16 items-center gap-3 rounded-md border bg-background px-4 py-3`,`transition-colors hover:border-foreground/20`),children:[(0,W.jsx)(`input`,{id:e,"data-test":t,type:`checkbox`,className:`size-4 rounded-sm border border-gray-300 shadow-sm shrink-0`,...n}),(0,W.jsxs)(`label`,{htmlFor:e,className:`flex-1 min-w-0 cursor-pointer`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium leading-tight`,children:r}),(0,W.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:i})]}),a&&(0,W.jsx)(`div`,{className:`shrink-0`,children:a})]}),gQt=({mode:e})=>{let{register:t,formState:n}=iG();return(0,W.jsxs)(`div`,{className:`flex flex-col`,children:[n.errors.name?.message&&(0,W.jsx)(qR,{error:n.errors.name.message,"data-test":`variable-name-input-error-validation-message`}),(0,W.jsx)(`span`,{className:`text-sm`,children:`Name`}),(0,W.jsx)(`div`,{className:`flex flex-col items-top gap-2`,children:(0,W.jsx)(jV,{id:`name`,onInput:e=>{let t=e.target,n=t.selectionStart;t.value=t.value.toUpperCase().replace(/[^A-Z0-9_]/g,`_`),t.setSelectionRange(n,n)},...t(`name`,{disabled:e===`edit`,pattern:{value:/^[^0-9a-z\W][A-Z0-9_]*$/,message:`Name must be SCREAMING_SNAKE_CASE and must start with a letter`}}),title:e===`edit`?`Name cannot be changed, create a new variable instead`:``,type:`text`,"data-test":`variable-name-input`})})]})},_Qt=({variable:e,previewEnvironments:t,defaultBranch:n,onClose:r,isSaving:i,error:a,mode:o,onSubmit:s})=>{let c=wG({defaultValues:{preview:e.targets.includes(`preview`),production:e.targets.includes(`production`),workingCopy:e.targets.includes(`working-copy`),name:e.name,isSecret:e.type===`secret`,value:o===`edit`&&e.type===`secret`?`*******`:e.value??null,personalOverride:e.personalValue!==void 0,personalValue:e.personalValue??null,targetBranch:e.targetBranch??`__NULL_BRANCH`},mode:`onChange`}),{getValues:l,control:u,register:d,watch:f}=c,{isValid:p,dirtyFields:m,touchedFields:h}=G5e({control:u}),_=l(),v=_.production||_.preview||_.workingCopy,y=!i&&v&&p,b=()=>{s(l(),m,h)},x=(0,g.useRef)(null),S=(0,g.useRef)(null);return(0,W.jsx)(H5e,{...c,children:(0,W.jsx)(cV,{isOpen:!0,maxWidth:`max-w-2xl`,onClose:r,children:(0,W.jsx)(`div`,{className:`flex flex-col mt-6`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(qR,{error:a}),(0,W.jsx)(gQt,{mode:o}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`text-sm`,children:`Value`}),(0,W.jsx)(cG,{control:u,name:`value`,render:({fieldState:{isDirty:e},field:{value:t,disabled:n,...r}})=>(0,W.jsxs)(`div`,{className:G(`rounded-sm border border-border w-full relative max-h-48`,n&&`bg-gray-100 dark:bg-neutral-800`),ref:S,children:[(0,W.jsxs)(`pre`,{className:G(`font-mono text-zuplo-pink p-2 overflow-hidden max-h-48 text-sm whitespace-pre`,n&&`invisible`),ref:x,children:[[...t??``].map((e,t)=>{switch(e){case`
|
|
1652
1652
|
`:return(0,W.jsxs)(`span`,{className:`text-zuplo-pink pl-[0.5px]`,children:[`↵`,`
|
|
1653
1653
|
`]},t);case` `:return(0,W.jsx)(`span`,{className:`text-gray-300 dark:text-neutral-600`,children:`␣`},t)}return(0,W.jsx)(`span`,{className:`invisible`,children:e},t)}),`
|
|
1654
|
-
`]}),(0,W.jsx)(`textarea`,{onScroll:e=>{e.target instanceof HTMLTextAreaElement&&x.current?.scrollTo({top:e.target.scrollTop,left:e.target.scrollLeft,behavior:`instant`})},onFocus:()=>{!e&&f(`isSecret`)&&r.onChange(``)},spellCheck:!1,disabled:n,...r,className:G(`absolute top-0 left-0 h-full flex-1 border min-w-0 block p-2 rounded-sm`,`bg-transparent border-0 w-full font-mono text-sm overflow-auto resize-none outline-hidden whitespace-pre`,`disabled:opacity-50 disabled:hover:cursor-not-allowed disabled:cursor-not-allowed`),"data-test":`variable-value-input`,value:t??``})]},`value`)})]}),(0,W.jsxs)(`label`,{className:G(`flex flex-row border rounded-sm bg-blue-50 dark:bg-blue-950/40 border-blue-100 dark:border-blue-900/60 p-4 gap-4`,o===`edit`&&`bg-gray-100 dark:bg-neutral-800 border-border opacity-30`),children:[(0,W.jsx)(`input`,{...d(`isSecret`),id:`is-secret`,disabled:o===`edit`,className:`rounded-sm border border-border shadow-sm mt-0.5`,type:`checkbox`,"data-test":`is-secret-checkbox`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{htmlFor:`is-secret`,className:`whitespace-nowrap`,children:`Secret`}),(0,W.jsx)(`div`,{className:`text-sm`,children:`Secrets are environment variables that are encrypted and not visible after they are set. Secrets are used for storing sensitive information like API keys and auth token.`})]})]}),(0,W.jsx)(
|
|
1654
|
+
`]}),(0,W.jsx)(`textarea`,{onScroll:e=>{e.target instanceof HTMLTextAreaElement&&x.current?.scrollTo({top:e.target.scrollTop,left:e.target.scrollLeft,behavior:`instant`})},onFocus:()=>{!e&&f(`isSecret`)&&r.onChange(``)},spellCheck:!1,disabled:n,...r,className:G(`absolute top-0 left-0 h-full flex-1 border min-w-0 block p-2 rounded-sm`,`bg-transparent border-0 w-full font-mono text-sm overflow-auto resize-none outline-hidden whitespace-pre`,`disabled:opacity-50 disabled:hover:cursor-not-allowed disabled:cursor-not-allowed`),"data-test":`variable-value-input`,value:t??``})]},`value`)})]}),(0,W.jsxs)(`label`,{className:G(`flex flex-row border rounded-sm bg-blue-50 dark:bg-blue-950/40 border-blue-100 dark:border-blue-900/60 p-4 gap-4`,o===`edit`&&`bg-gray-100 dark:bg-neutral-800 border-border opacity-30`),children:[(0,W.jsx)(`input`,{...d(`isSecret`),id:`is-secret`,disabled:o===`edit`,className:`rounded-sm border border-border shadow-sm mt-0.5`,type:`checkbox`,"data-test":`is-secret-checkbox`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{htmlFor:`is-secret`,className:`whitespace-nowrap`,children:`Secret`}),(0,W.jsx)(`div`,{className:`text-sm`,children:`Secrets are environment variables that are encrypted and not visible after they are set. Secrets are used for storing sensitive information like API keys and auth token.`})]})]}),(0,W.jsx)(hQt,{previewEnvironments:t,defaultBranch:n,variable:e}),(0,W.jsxs)(`div`,{className:`flex flex-row space-x-2 mt-3 justify-between`,children:[(0,W.jsx)(Y,{onClick:()=>r(),variant:`secondary`,children:`Cancel`}),(0,W.jsxs)(Y,{disabled:!y,type:`button`,"data-test":`save-variable`,onClick:b,children:[i&&(0,W.jsx)(IL,{borderPositionAndSize:`w-4 h-4 border-2 border-white mr-2`}),`Save`]})]})]})})})})};function vQt({variable:e,previewEnvironments:t,onClose:n,account:r,project:i}){let a=ch(),{logEvent:o,captureException:s}=Vg(),c=Zht(),l=(e,t,s)=>{o(`env-var-edited`,{type:e,targets:t.join(`,`),personalOverride:`${s}`,account:r,project:i.name});let c=t.filter(e=>e!==`working-copy`);i.sourceRepoUrl!=null&&c.length>0&&a.success(`Redeploy your project to apply changes.`,{title:`Redeploy required`,icon:(0,W.jsx)(Ym,{className:`h-6 w-6`})}),n()};return(0,W.jsx)(_Qt,{variable:e,previewEnvironments:t,defaultBranch:i.defaultBranch,mode:`edit`,onSubmit:(t,n,a)=>{let u=mQt(t),d={id:e.id,name:e.name,value:a.value?t.value??void 0:void 0,targets:a.production||a.preview||a.workingCopy?u:void 0};if(n.targetBranch){let e=t.targetBranch;d.targetBranch=e===`__NULL_BRANCH`?null:e}a.preview&&t.preview===!1&&(d.targetBranch=null),n.personalOverride&&t.personalOverride&&(d.personalValue=``),n.personalValue&&(d.personalValue=t.personalValue),(n.workingCopy&&t.workingCopy===!1||n.personalOverride&&t.personalOverride===!1)&&(d.personalValue=null),c.mutate({accountName:r,projectName:i.name,variableData:d},{onSuccess:()=>l(d.type??`config`,d.targets??e.targets,t.personalOverride),onError:e=>{o(`env-var-edit-failed`,{account:r,project:i.name}),s(e)}})},onClose:n,isSaving:c.isPending,error:c.error})}var yQt=e=>{let t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width>e.getBoundingClientRect().width},bQt=()=>{let[e,t]=(0,g.useState)(!1);return{tooltipProps:(0,g.useMemo)(()=>{if(!e)return{open:!1}},[e]),triggerProps:(0,g.useMemo)(()=>({ref:e=>{e&&t(yQt(e))}}),[])}};function xQt({isSecret:e}){return e?(0,W.jsx)(qm,{className:`h-4 w-auto`}):(0,W.jsx)(Am,{className:`h-4 w-auto`})}var SQt=({variable:e,asIcon:t=!1})=>(0,W.jsxs)(tgt,{children:[(0,W.jsx)(ngt,{asChild:!0,children:t?(0,W.jsx)(Y,{variant:`ghost`,size:`icon`,className:`flex items-center`,children:(0,W.jsx)(Am,{className:`w-4 h-4`})}):(0,W.jsxs)(Y,{variant:`secondary`,size:`default`,className:`flex items-center gap-2`,children:[(0,W.jsx)(Am,{className:`w-4 h-4`}),`Get Code Snippet`]})}),(0,W.jsxs)(xX,{side:`right`,className:`sm:max-w-none w-1/3 min-w-[500px]`,children:[(0,W.jsx)(`div`,{className:`text-lg font-semibold border-b`,children:`Code Snippets`}),(0,W.jsx)(`p`,{className:`my-2 text-sm`,children:`Use this Code Snippet anywhere in your modules to access your environment variable.`}),(0,W.jsx)(lV,{offset:`md`,className:`bg-gray-200 text-xs `,children:(0,W.jsxs)(`pre`,{id:`codePre`,"data-lang":`typescript`,className:`pre font-mono text-gray-900 overflow-x-auto`,children:[`import `,`{`,` environment `,`}`,` from "@zuplo/runtime";`,`\r
|
|
1655
1655
|
\r
|
|
1656
|
-
`,`const ${e.name} = environment.${e.name};\r\n`]})})]})]}),SQt=e=>{let t=[];return e.targets.includes(`production`)&&t.push(`production`),e.targets.includes(`preview`)&&t.push(e.targetBranch??`preview`),e.targets.includes(`working-copy`)&&t.push(`development`),t.join(`, `)};function CQt({variable:e,account:t,project:n,previewEnvironments:r}){let i=$ht(),{logEvent:a}=Vg(),[o,s]=(0,g.useState)(),[c,l]=(0,g.useState)(!1),{tooltipProps:u,triggerProps:d}=yQt(),{tooltipProps:f,triggerProps:p}=yQt(),[m,h]=QR(()=>{let r=async()=>{h(),await i.mutateAsync({accountName:t,projectName:n.name,id:e.id}),a(`env-var-deleted`,{account:t,project:n.name,id:e.id})},s=`Error deleting Environment Variable`,c=`We found an error trying to remove the variable.`;return o instanceof Lf&&(s=o.title??s,c=o.detail??c),(0,W.jsx)(FL,{alertType:`ERROR`,bodyText:c,onPrimaryButtonClick:r,onSecondaryButtonClick:h,primaryButtonText:`Try again`,secondaryButtonText:`Cancel`,hideModal:h,title:s})},[e,r,o]),_=async()=>{try{await i.mutateAsync({accountName:t,projectName:n.name,id:e.id}),a(`env-var-deleted`,{account:t,project:n.name,id:e.id}),l(!1)}catch(r){a(`env-var-deletion-failed`,{account:t,project:n.name,id:e.id}),l(!1),s(r instanceof Error?r:Error(r)),m()}},[v,y]=QR(()=>(0,W.jsx)(_Qt,{project:n,variable:e,previewEnvironments:r,onClose:y,account:t}),[e,r]),b=e.personalValue??e.value;return(0,W.jsxs)(lV,{className:`grid grid-cols-subgrid col-span-full gap-4 items-center p-4 mt-2`,children:[(0,W.jsxs)(JR,{open:c,onOpenChange:l,onClickDelete:_,isPending:i.isPending,deleteButtonText:`Confirm`,children:[`Are you sure you want to delete the variable '`,e.name,`'`]}),(0,W.jsx)(`div`,{className:`rounded-full border w-10 h-10 flex items-center justify-center`,children:(0,W.jsx)(bQt,{isSecret:e.type===`secret`})}),(0,W.jsxs)(`div`,{className:`flex flex-row justify-between items-center truncate`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col truncate`,children:[(0,W.jsxs)(Ok,{...f,delayDuration:0,children:[(0,W.jsx)(kk,{...p,asChild:!0,children:(0,W.jsx)(`span`,{className:`font-mono text-sm truncate`,"data-test":`env-variable-name`,children:e.name})}),(0,W.jsxs)(Ak,{className:`font-mono`,children:[(0,W.jsx)(jk,{}),e.name]})]}),(0,W.jsx)(`div`,{className:`text-sm text-neutral-500 line-clamp-2`,children:SQt(e)})]}),e.personalValue&&(0,W.jsx)(`div`,{className:`bg-zuplo-highlight rounded-full text-2xs text-white px-2 py-1 mx-2 flex-none`,children:`PERSONAL`})]}),(0,W.jsx)(`div`,{"data-test":`env-variable-value`,className:`truncate flex text-xs font-mono`,children:b?(0,W.jsxs)(Ok,{...u,children:[(0,W.jsx)(kk,{asChild:!0,...d,children:(0,W.jsx)(`div`,{className:`bg-neutral-100 p-1 px-2 rounded-sm max-w-96 truncate`,children:e.type===`config`?b:`************`})}),(0,W.jsxs)(Ak,{className:`text-xs`,children:[(0,W.jsx)(jk,{}),b]})]}):(0,W.jsx)(LS,{variant:`outline`,children:`No value`})}),(0,W.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,W.jsx)(xQt,{variable:e,asIcon:!0}),(0,W.jsx)(Y,{size:`icon`,variant:`ghost`,type:`button`,"data-test":`env-variable-edit`,onClick:()=>{v()},children:(0,W.jsx)(Zm,{size:18})}),(0,W.jsx)(Y,{size:`icon`,variant:`ghost`,"data-test":`env-variable-delete`,onClick:()=>{l(!0)},children:i.isPending?(0,W.jsx)(IL,{className:`w-4 h-4`,borderPositionAndSize:`border-2`}):(0,W.jsx)(eh,{size:18})})]})]},e.name)}var wQt=({previewEnvironments:e,ape:t,onClose:n})=>{let{logEvent:r,captureException:i}=Vg(),a=ch(),o={id:`temp`,name:``,type:`config`,targets:[`production`,`preview`,`working-copy`]},s=Qht(),c=(e,i,o)=>{r(`env-var-created`,{type:e,targets:i.join(`,`),personalOverride:`${o}`,account:t.account.name,project:t.project.name});let s=i.filter(e=>e!==`working-copy`);t.project.sourceRepoUrl!=null&&s.length>0&&a.success(`Redeploy your environment to apply changes.`,{title:`Environment variable created`}),n()};return(0,W.jsx)(gQt,{variable:o,previewEnvironments:e,defaultBranch:t.project.defaultBranch,mode:`new`,onSubmit:e=>{let n={};n.name=e.name??void 0,n.value=e.value??``,n.type=e.isSecret?`secret`:`config`,n.targets=pQt(e),n.targetBranch=e.preview&&e.targetBranch!==`__NULL_BRANCH`?e.targetBranch:void 0,n.personalValue=e.workingCopy&&e.personalOverride?e.personalValue??``:void 0,s.mutate({accountName:t.account.name,projectName:t.project.name,variableData:n},{onSuccess:()=>c(n.type??`config`,n.targets??[],e.personalOverride),onError:e=>{r(`env-var-creation-failed`,{account:t.account.name,project:t.project.name}),i(e)}})},onClose:n,isSaving:s.isPending,error:s.error})},R7=`___EMPTY___`;function TQt(){let e=lh([`account`,`project`]),{logEvent:t}=Vg(),n=Xht(e.account.name,e.project.name),r=!!e.project.sourceRepoUrl,i=Qj(e.account.name,e.project.name),a=[{label:`All`,value:R7},{label:`Production`,value:`production`},{label:`Preview (other branches)`,value:`preview`},{label:`Development`,value:`working-copy`}],[o,s]=(0,g.useState)(R7),[c,l]=(0,g.useState)(R7),[u,d]=(0,g.useState)(``),f=i.data?.filter(e=>!cPe(e.environmentType,VA.PRODUCTION,VA.WORKING_COPY))??[],p=f.map(e=>e.branchName),m=(0,g.useMemo)(()=>[R7,...p],[p]),h=(0,g.useMemo)(()=>n.data??[],[n.data]),_=(0,g.useMemo)(()=>h.filter(e=>o===R7||e.targets.includes(o)),[h,o]),v=_X(u,(0,g.useMemo)(()=>o!==`preview`||c===R7?_:_.filter(e=>e.targets.includes(`preview`)&&e.targetBranch===c),[_,o,c]),{key:`id`,getText:e=>[e.name,e.type,e.value,...e.targets,e.targetBranch].filter(Boolean)}),[y,b]=QR(()=>(0,W.jsx)(wQt,{ape:e,previewEnvironments:f,onClose:b}),[f]);return n.isError?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(E7,{title:`Environment Variables`,className:`mb-4`}),(0,W.jsx)(SFe,{error:n.error})]}):!n.data||r&&!i.data?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(E7,{title:`Environment Variables`,className:`mb-4`}),(0,W.jsx)(hV,{})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(E7,{title:`Environment Variables`}),(0,W.jsx)(`p`,{className:`text-sm my-1`,children:`To provide your environments with environment variables during build and runtime, you can enter them here for your chosen environment.`}),(0,W.jsx)(`p`,{className:`text-sm my-1 mt-2`,children:`A new deployment is necessary for your changes to take effect.`}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,W.jsx)(`div`,{className:`flex flex-row justify-end gap-x-2`,children:(0,W.jsx)(Y,{onClick:y,children:`Add variable`})}),(0,W.jsxs)(`div`,{className:`flex flex-row items-center gap-3`,children:[(0,W.jsx)(jV,{type:`search`,placeholder:`Search variables`,value:u,onChange:n=>{d(n.currentTarget.value),t(`env-var-filter-changed`,{account:e.account.name,project:e.project.name,query:n.currentTarget.value})}}),(0,W.jsxs)(wW,{value:o,onValueChange:e=>{s(e),e!==`preview`&&l(``)},children:[(0,W.jsx)(EW,{className:`w-52`,"data-test":`env-variable-filter`,children:(0,W.jsx)(TW,{})}),(0,W.jsx)(DW,{className:`w-52`,children:a.map((e,t)=>(0,W.jsx)(OW,{value:e.value,"data-test":`env-variable-filter-${t}`,children:e.label},e.value))})]}),o===`preview`?(0,W.jsxs)(wW,{value:c,onValueChange:e=>{l(e)},children:[(0,W.jsx)(EW,{className:`w-52`,"data-test":`env-variable-branch-filter`,children:(0,W.jsx)(TW,{})}),(0,W.jsx)(DW,{className:`w-52`,children:m.map(e=>(0,W.jsx)(OW,{value:e,children:e===R7?`All branches`:e},e))})]}):null]})]}),(0,W.jsx)(`div`,{className:`grid-cols-[min-content_minmax(auto,250px)_1fr_auto] grid`,children:v.map(t=>(0,W.jsx)(CQt,{account:e.account.name,project:e.project,previewEnvironments:f,variable:t},t.id))}),v.length===0?(0,W.jsx)(`div`,{className:`w-full flex text-center justify-center h-full items-center text-neutral-500 mt-10`,children:o===R7&&c===``&&u===``?(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`text-zuplo-pink cursor-pointer`,onClick:y,children:`Create`}),` `,`an environment variable and it will show up here.`,(0,W.jsxs)(`p`,{children:[`Not sure where to start?`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/deployments/environment-variables`,children:`Read the docs`}),`.`]})]}):`No variables matching your filter`}):null]})}var EQt=({projectName:e,closeModalAction:t,accountName:n,onFinishDeletion:r})=>{let{logEvent:i,captureException:a}=Vg(),[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(null),u=t=>{s(t.target.value===e)},d=UYt(n,e);return(0,W.jsx)(TGe,{alertType:`DELETE`,isOpen:!0,title:`Delete Project`,setIsOpen:t,secondaryButtonContent:`Cancel`,secondaryButtonTestID:`project-list-close-delete-project-modal`,onSecondaryButtonClick:t,primaryButtonTestID:`project-list-delete-project-button`,secondaryButtonDisabled:d.isPending,primaryButtonDisabled:!o||d.isPending,primaryButtonContent:`Delete`,onPrimaryButtonClick:async()=>{try{l(null),await d.mutateAsync(),i(`project-deleted`,{account:n,project:e}),r?.(),t()}catch(t){i(`project-deletion-failed`,{account:n,project:e}),a(t),l(Yj(t))}},bodyElement:(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(qR,{error:c}),(0,W.jsx)(`p`,{className:`text-sm`,children:`This cannot be undone! Your GitHub repository will be untouched.`}),(0,W.jsxs)(`p`,{className:`text-sm`,children:[`Please type `,(0,W.jsx)(`strong`,{onDoubleClick:e=>{let t=e.currentTarget,n=new Range;n.setStart(t,0),n.setEnd(t,1),document.getSelection()?.removeAllRanges(),document.getSelection()?.addRange(n)},children:e}),` `,`to confirm.`]}),(0,W.jsx)(jV,{disabled:d.isPending,type:`text`,className:`mt-2`,autoFocus:!0,autoComplete:`off`,onChange:u})]})})};function DQt(){let e=Pj([`account`,`project`]),t=Tn(),[n,r]=QR(()=>(0,W.jsx)(EQt,{projectName:e.project,accountName:e.account,closeModalAction:r,onFinishDeletion:()=>t(`/`)}),[]);return(0,W.jsxs)(lV,{children:[(0,W.jsxs)(uV,{children:[(0,W.jsx)(dV,{children:`Delete Project`}),(0,W.jsx)(fV,{children:`Permanently delete this project and all associated data. This cannot be undone, there is no going back.`})]}),(0,W.jsx)(pV,{className:`leading-loose text-sm`,children:`Your GitHub repository will remain untouched.`}),(0,W.jsx)(mV,{children:(0,W.jsxs)(Y,{"data-test":`delete-button`,variant:`destructive-outline`,onClick:n,children:[(0,W.jsx)(eh,{size:16}),`Delete Project`]})})]})}var OQt=({children:e,copyValue:t})=>{let{logEvent:n}=Vg();return(0,W.jsxs)(`div`,{className:`mb-2 md:mb-0`,children:[e,t&&(0,W.jsx)(bQ,{className:`relative top-1`,onClick:()=>{n(`project-information-property-copied`)},textToCopy:t})]})},kQt=()=>{let{logEvent:e}=Vg(),t=lh([`account`,`project`]);if(!Qj(t.account.name,t.project.name).data)return(0,W.jsx)(`div`,{className:`p-6`,children:(0,W.jsx)(hV,{})});let n=[];return n.push({label:`Project Name`,value:t.project.name}),n.push({label:`Account Name`,value:t.account.name}),(0,W.jsxs)(lV,{children:[(0,W.jsxs)(uV,{children:[(0,W.jsx)(dV,{children:`Project Information`}),(0,W.jsx)(fV,{})]}),(0,W.jsx)(pV,{children:(0,W.jsx)(`div`,{className:`grid gap-2 grid-cols-1 md:grid-cols-[150px_1fr] text-sm mt-2`,children:n.map(t=>(0,W.jsxs)(g.Fragment,{children:[(0,W.jsx)(`div`,{className:`font-medium`,children:t.label}),(0,W.jsx)(OQt,{copyValue:t.value,children:t.isLink?(0,W.jsx)(oT,{href:t.value,onClick:()=>{e(`project-information-link-clicked`,{label:t.label,value:t.value})},className:`break-all`,children:t.value}):t.value})]},t.value))})})]})},AQt=()=>(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 md:gap-6 mb-6`,children:[(0,W.jsx)(E7,{title:`General`}),(0,W.jsx)(kQt,{}),(0,W.jsx)(DQt,{})]}),jQt=[`admin`,`developer`,`member`,`no-access`],MQt={admin:`Admin`,developer:`Developer`,member:`Member`,"no-access":`No Access`},z7=(e,t)=>e!==`no-access`&&(t||e===`admin`),NQt=({value:e,hiddenRoles:t=[],...n})=>{let r=ch(),i=lh([`account`]).account.entitlements.rbacEnabled,a=jQt.filter(e=>!t.concat([`no-access`]).includes(e));return(0,W.jsxs)(wW,{...n,value:e,onValueChange:e=>{z7(e,i)?n.onValueChange?.(e):r.toast((0,W.jsxs)(W.Fragment,{children:[`This role is not available for your account. Please upgrade to the Enterprise plan.`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/accounts/roles-and-permissions`,target:`_blank`,children:`Learn more about roles and permissions.`})]}))},children:[(0,W.jsx)(EW,{className:`min-w-40`,children:(0,W.jsx)(TW,{placeholder:`Select a role`})}),(0,W.jsx)(DW,{className:`min-w-40`,children:a.map(e=>(0,W.jsx)(OW,{value:e,onClick:t=>{z7(e,i)||(t.preventDefault(),t.stopPropagation(),window.open(`https://zuplo.com/docs/articles/accounts/roles-and-permissions`,`_blank`))},children:(0,W.jsxs)(`div`,{className:`grid grid-cols-2`,children:[MQt[e],!z7(e,i)&&(0,W.jsx)(LS,{variant:`outline`,className:``,children:`Enterprise`})]})},e))})]})},PQt={zuplo:e=>(0,W.jsx)(`svg`,{viewBox:`0 0 308 308`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,W.jsxs)(`g`,{fillRule:`nonzero`,fill:`none`,children:[(0,W.jsx)(`path`,{d:`M0 0h308v308H0z`}),(0,W.jsx)(`path`,{d:`M214.523 182.007h-74.088l78.939-79.076a5.34 5.34 0 0 0-.807-8.204 5.314 5.314 0 0 0-2.957-.899H90.239V41.364h137.515a53.31 53.31 0 0 1 28.617 7.922 53.444 53.444 0 0 1 19.967 22.011 52.117 52.117 0 0 1 4.221 31.194 52.062 52.062 0 0 1-14.508 27.924l-51.528 51.592Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M90.24 119.097h74.092l-78.781 78.917a5.431 5.431 0 0 0-1.172 5.912 5.423 5.423 0 0 0 5.001 3.351h125.017v52.464H77.016a53.322 53.322 0 0 1-28.616-7.923 53.453 53.453 0 0 1-19.968-22.011 52.109 52.109 0 0 1-4.219-31.194 52.059 52.059 0 0 1 14.51-27.924l51.517-51.592Z`,fill:`currentColor`})]})}),akamai:e=>(0,W.jsxs)(`svg`,{viewBox:`344.42 285.18 451 489.75`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,...e,children:[(0,W.jsx)(`path`,{d:`M592.85,764.11c-100.8-30.77-174.12-123.92-174.12-234.05s74.88-205.29,177.4-235.02c10.48-3.06,7.73-9.86-4.91-9.86-136.28,0-246.8,109.69-246.8,244.89s110.51,244.86,246.8,244.86c12.63,0,13.14-7.3,1.63-10.81Z`}),(0,W.jsx)(`path`,{d:`M465.48,587.42c-.68-6.58-1.01-13.23-1.01-19.94,0-107.36,87.05-194.39,194.43-194.39,101.52,0,132,45.31,135.78,42.35,4.12-3.26-36.84-93.07-156.05-93.07-107.39,0-194.44,87.03-194.44,194.39,0,24.84,4.65,48.52,13.13,70.31,3.58,9.14,9.08,9.22,8.17.35Z`}),(0,W.jsx)(`path`,{d:`M546.92,447.31c50.53-22.03,114.01-22.7,176.42-.89,41.91,14.62,66.2,35.5,68.19,34.64,3.31-1.43-24.38-45.28-74.36-64.24-60.51-22.93-125.69-10.93-173.18,26.32-5.22,4.11-3.25,6.87,2.93,4.17Z`})]})},FQt=({variant:e=`full`,className:t,width:n,height:r})=>{let i=fZt();if(e===`mark`){let e=PQt[i.id];return(0,W.jsx)(e,{className:t,width:n,height:r,role:`img`,"aria-label":i.logoAlt})}return e===`full`&&i.logoDark?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`img`,{src:i.logo,alt:i.logoAlt,className:G(t,`dark:hidden`),width:n,height:r}),(0,W.jsx)(`img`,{src:i.logoDark,alt:i.logoAlt,className:G(t,`hidden dark:inline`),width:n,height:r})]}):(0,W.jsx)(`img`,{src:e===`white`?i.logoWhite:i.logo,alt:i.logoAlt,className:G(t),width:n,height:r})},IQt=()=>(0,W.jsx)(`div`,{className:`h-0 flex flex-col items-center -translate-y-14 mb-2`,children:(0,W.jsx)(FQt,{variant:`white`,className:`h-17 w-auto rounded-full bg-zuplo-pink p-4 shadow-xs`})}),LQt=(e,t,n)=>{let[r,i]=(0,g.useState)(t),a=zA(n);return[e===void 0?r:e,(0,g.useCallback)(t=>{e===void 0?i(t):a.current?.(t)},[e,a])]},RQt=Nv({email:jv().email(`Invalid email address`),role:Fv([`admin`,`developer`,`member`])}),zQt=({inviteOnly:e=!1,account:t,project:n,team:r,description:i,hiddenRoles:a,children:o,open:s,onOpenChange:c,excludeUserIds:l,changeRoleForUserIds:u})=>{let d=lh([`account`]),{logEvent:f}=Vg(),[p,m]=LQt(s,!1,c),[h,_]=(0,g.useState)(!1),[v,y]=(0,g.useState)(!1),b=xj(),{onError:x,onSuccess:S}=Zj(),C=d.account.entitlements.rbacEnabled,w=wG({resolver:TG(RQt),defaultValues:{email:``,role:C?`member`:`admin`}}),T=C?`member`:`admin`,E=wj(X.authAccountUsersRoles(t),{extractData:!0}),D=w.watch(`email`),O=zA(()=>{w.reset(),_(!1)});(0,g.useEffect)(()=>{p||O.current()},[p,O]);let k=T_({mutationFn:({email:e,role:i})=>{let a=r&&n?{account:{role:T},project:{name:n,role:T},team:{...r,role:i}}:n?{account:{role:T},project:{name:n,role:i}}:{account:{role:i}},o=E?.data?.find(t=>t.email===e)?.id;return!h&&o&&u?.includes(o)?b.fetch(bj.auth.updateUsersRole({accountName:t,projectName:n,userId:o,role:i})):b.fetch(bj.accountInvite.createAccountInvite(t,e,a))},onError:x,onSuccess:()=>{S(h?`Invitation sent to ${w.getValues(`email`)}`:`Member added to ${d.account.label??d.account.name}`),m(!1)}}),A=_X(D,(E?.data??[]).filter(e=>!l||l.includes(e.id)===!1),{getText:e=>[e.name,e.email],key:`email`}),j=e=>{f(`account-invite-submitted`,{role:e.role,teamId:r?.id??``,project:n,account:t}),k.mutate({email:e.email,role:e.role})};return(0,W.jsxs)(kA,{open:p,onOpenChange:e=>{e||w.reset(),m(e)},children:[o&&(0,W.jsx)(AA,{asChild:!0,children:o}),(0,W.jsxs)(MA,{className:`max-w-md`,children:[(0,W.jsx)(Ggt,{}),(0,W.jsx)(IQt,{}),(0,W.jsxs)(NA,{className:`mt-2`,children:[(0,W.jsxs)(FA,{children:[`Invite to `,d.account.label??d.account.name]}),(0,W.jsx)(IA,{className:`opacity-75`,children:i??`Once you invite someone to your account, they can be granted access to account projects.`})]}),(0,W.jsx)(EG,{...w,children:(0,W.jsxs)(`form`,{onSubmit:w.handleSubmit(j),className:`mt-2 space-y-4`,children:[(0,W.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,W.jsx)(DG,{control:w.control,name:`email`,render:({field:t})=>(0,W.jsxs)(kG,{className:`w-full`,children:[(0,W.jsx)(AG,{children:`Member`}),(0,W.jsx)(jG,{children:(0,W.jsx)(`div`,{className:`relative`,children:(0,W.jsx)(kX,{open:v&&D.length>0,onOpenChange:y,modal:!1,children:(0,W.jsxs)(K1,{shouldFilter:!1,loop:!0,children:[(0,W.jsx)(Tgt,{asChild:!0,children:(0,W.jsx)(V1.Input,{asChild:!0,value:D,onValueChange:t.onChange,onKeyDown:e=>{if(e.key===`Enter`&&v===!1){e.currentTarget.form?.requestSubmit(),e.preventDefault();return}y(e.key!==`Escape`)},onMouseDown:()=>y(e=>!!D||!e),onFocus:()=>y(!0),onBlur:()=>y(!1),children:(0,W.jsx)(jV,{placeholder:`Email address or member name`})})}),!open&&(0,W.jsx)(J1,{"aria-hidden":`true`,className:`hidden`}),(0,W.jsx)(jX,{asChild:!0,align:`start`,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{e.target instanceof Element&&e.target.hasAttribute(`cmdk-input`)&&e.preventDefault()},className:`w-(--radix-popover-trigger-width) p-0`,children:(0,W.jsxs)(J1,{className:`max-h-[200px] overflow-y-auto`,children:[(0,W.jsx)(Y1,{children:`No members found.`}),(0,W.jsxs)(X1,{children:[!e&&A.map((e,n)=>(0,W.jsx)(Z1,{value:n.toString(),onSelect:()=>{t.onChange(e.email),_(!1),y(!1)},children:(0,W.jsx)(`span`,{children:e.name})},e.id)),D.length>0&&(0,W.jsxs)(Z1,{value:A.length.toString(),onSelect:()=>{_(!0),y(!1)},children:[(0,W.jsx)(jre,{size:16,className:`mr-2`}),` `,`Invite "`,D.includes(`@`)?D:`${D}@example.com`,`" to Account`]})]})]})})]})})})}),(0,W.jsx)(MG,{})]})}),(0,W.jsx)(DG,{control:w.control,name:`role`,render:({field:e})=>(0,W.jsxs)(kG,{children:[(0,W.jsx)(AG,{children:`Role`}),(0,W.jsx)(jG,{children:(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{asChild:!0,children:(0,W.jsx)(NQt,{value:e.value,onValueChange:e.onChange,hiddenRoles:a})}),(0,W.jsx)(Ak,{children:C?(0,W.jsx)(`p`,{children:`New users will be assigned the member role. You can change their role later.`}):(0,W.jsx)(`p`,{children:`New users will be assigned the admin role. You can change their role later.`})})]})}),(0,W.jsx)(MG,{})]})})]}),(0,W.jsx)(PA,{children:(0,W.jsx)(Y,{type:`submit`,className:`justify-end`,children:(0,W.jsxs)(Pk,{loading:k.isPending,children:[h?`Send Invite`:`Add member`,(0,W.jsx)(PSt,{className:`bg-white/20`,children:(0,W.jsx)(NSt,{onPress:w.handleSubmit(j),hotkey:`meta+Enter`})})]})})})]})})]})]})},BQt=()=>{let{account:e}=lh([`account`]);return e.entitlements.rbacEnabled?null:(0,W.jsxs)(PS,{variant:`info`,className:`text-sm`,children:[(0,W.jsx)(wm,{size:22}),(0,W.jsx)(IS,{children:(0,W.jsxs)(`p`,{children:[`Role-based access control (RBAC) is not enabled for this account.`,` `,(0,W.jsx)(CX,{to:`mailto:${eC}?subject=Fine-grain%20access%20control`,children:`Contact sales`}),` `,`for more information.`]})})]})},VQt=({name:e,sub:t,email:n})=>{let{copyToClipboard:r}=lO(t??n??``);return(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{onDoubleClick:()=>{r()},className:`text-left`,children:e}),(0,W.jsxs)(Ak,{className:`flex items-center gap-2`,children:[t&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Lre,{size:16}),` Sub `,t]}),n&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Jre,{size:16}),` Email `,n]})]})]})},HQt=e(i(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))}))());function UQt({accountName:e,invite:t}){let n=ch(),[r,i]=(0,g.useState)(!1),a=hZt();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Y,{size:`icon`,variant:`ghost`,title:`Remove invitation`,disabled:a.isPending,onClick:()=>i(!0),children:(0,W.jsx)(eh,{size:18})}),(0,W.jsxs)(JR,{open:r,onOpenChange:i,title:`Delete account invite`,deleteButtonText:`Delete invitation`,isPending:a.isPending,onClickDelete:async()=>{try{await a.mutateAsync({accountName:e,inviteId:t.id}),n.success(`Invitation was removed`),i(!1)}catch(e){n.error(Yj(e))}},children:[`You are about to delete the account invite sent to `,t.email,`. The invitation can no longer be used to join your account.`]})]})}function WQt({accountName:e,invite:t}){let n=ch(),r=gZt(),[i,a]=(0,g.useState)(!1);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{asChild:!0,children:(0,W.jsx)(Y,{size:`icon`,variant:`ghost`,disabled:r.isPending,onClick:()=>a(!0),children:(0,W.jsx)(Vre,{size:18})})}),(0,W.jsx)(Ak,{children:`Resend invitation`})]}),(0,W.jsx)(dX,{open:i,onOpenChange:a,title:`Do you want to resend the invitation?`,description:`You are about to resend the account membership invite for "${t.email}" to join "${e}".`,actionLabel:`Resend invitation`,isPending:r.isPending,onConfirm:async()=>{try{await r.mutateAsync({accountName:e,inviteId:t.id}),n.success(`Invitation has been resent`),a(!1)}catch(e){n.error(Yj(e)),a(!1)}}})]})}var GQt=({date:e,withTime:t})=>(0,W.jsxs)(`span`,{children:[e.toLocaleDateString(),t&&` ${e.toLocaleTimeString()}`]}),KQt=({email:e,className:t})=>{let{copyToClipboard:n}=lO(e);return(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{onDoubleClick:n,className:G(`cursor-pointer`,t),children:e}),(0,W.jsxs)(Ak,{children:[`Copy `,(0,W.jsxs)(`span`,{className:`font-mono`,children:[`"`,e,`"`]}),` to clipboard`]})]})};m7.default.extend(HQt.default);function qQt(){let{account:e}=Pj([`account`]),t=mZt(e).data??[];return t.length===0?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`text-lg font-medium`,children:`Pending account invitations`}),(0,W.jsx)(`div`,{className:`grid grid-cols-4 gap-2`,children:t.map(t=>(0,W.jsxs)(uz,{variant:`outline`,size:`sm`,className:G(`col-span-full grid grid-cols-subgrid justify-between py-1`,(0,m7.default)().diff((0,m7.default)(t.createdOn),`minutes`)<5&&`bg-zuplo-50/50`),children:[(0,W.jsx)(`div`,{className:`text-ellipsis overflow-hidden truncate`,children:(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{children:(0,W.jsxs)(LS,{variant:`outline`,children:[`Invited `,(0,m7.default)(t.createdOn).fromNow()]})}),(0,W.jsx)(Ak,{children:(0,W.jsx)(GQt,{date:new Date(t.createdOn),withTime:!0})})]})}),(0,W.jsx)(KQt,{email:t.email,className:`text-left text-ellipsis overflow-hidden truncate`}),(0,W.jsxs)(`div`,{className:`flex justify-end col-span-2`,children:[(0,W.jsx)(WQt,{accountName:e,invite:t}),(0,W.jsx)(UQt,{accountName:e,invite:t})]})]},t.id))})]})}var JQt=5;function YQt(){let e=lh([`account`,`project`]),t=ch(),{user:n}=Lg(),r=xj(),i=T_({mutationFn:({userId:t,role:n})=>r.fetch(bj.auth.updateUsersRole({accountName:e.account.name,projectName:e.project.name,userId:t,role:n})),onError:e=>t.error(Yj(e))}),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(!1),l=Cj(X.accountMemberInvites(e.account.name)),u=Cj(X.authProjectUsersRoles(e.account.name,e.project.name,{includeInheritedRoles:!1}),{extractData:!0}),d=u.data?.map(e=>e.id),f=Cj(X.authProjectUsersRoles(e.account.name,e.project.name,{includeInheritedRoles:!0}),{extractData:!0}),p=f.data?.filter(e=>!d?.includes(e.id)),m=u.data?.filter(e=>e.project.role!==`no-access`),h=e.account.entitlements.rbacEnabled,_=(m?.map(({id:e})=>e)??[]).concat(h?[]:p?.map(({id:e})=>e)??[]);return(0,W.jsxs)(`div`,{className:`flex gap-2 flex-col text-sm`,children:[(0,W.jsx)(E7,{title:`Project access`}),(0,W.jsx)(`div`,{className:`text-lg font-medium`,children:`Members with inherited access`}),(0,W.jsx)(`p`,{children:`Account Admins and developers automatically have access to all projects.`}),p?.map(e=>(0,W.jsx)(uz,{variant:`outline`,size:`sm`,children:(0,W.jsxs)(fz,{className:`grid grid-cols-[1fr_max-content] gap-1`,children:[(0,W.jsx)(pz,{children:(0,W.jsx)(VQt,{name:e.name,email:e.email})}),(0,W.jsx)(mz,{className:`max-w-52`,children:(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{children:(0,W.jsx)(LS,{variant:`outline`,children:e.project.role===`admin`?`Full access`:`Read only`})}),(0,W.jsx)(Ak,{children:MQt[e.project.role]})]})})]})},e.id)).slice(0,a?void 0:JQt),(p?.length??0)>JQt&&(0,W.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>{o(!a)},children:a?`Show less`:`Show more`}),l.data?.length>0&&(0,W.jsx)(qQt,{}),(0,W.jsxs)(`div`,{className:`flex justify-between mt-4`,children:[(0,W.jsx)(`div`,{className:`text-lg font-medium`,children:`Members with project access`}),(0,W.jsx)(zQt,{account:e.account.name,project:e.project.name,changeRoleForUserIds:f.data?.map(({id:e})=>e)??[],excludeUserIds:_,open:s,onOpenChange:c,description:`Inviting a user to a project will grant them access to the project and add them to the account as a member.`,children:(0,W.jsxs)(Y,{children:[(0,W.jsx)(Jm,{}),`Add to project`]})})]}),(0,W.jsxs)(`p`,{className:`text-sm`,children:[`Account members can create or be added to projects.\xA0`,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/add-project-collaborators`,children:`Learn more`}),`.`]}),(0,W.jsx)(qR,{error:u.error}),i.isError&&(0,W.jsx)(BQt,{}),m?.length===0&&(0,W.jsx)(uz,{variant:`outline`,className:`justify-center`,children:`No members have been added directly to this project yet.`}),(m?.length??0)>0&&(0,W.jsxs)(lV,{className:`grid grid-cols-[auto_auto_auto] gap-x-4 text-sm`,children:[(0,W.jsx)(XQt,{className:`font-medium`,children:(0,W.jsx)(`div`,{className:`row-span-full`,children:`Name`})}),!u.isError&&m?.map(t=>(0,W.jsxs)(XQt,{children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(VQt,{name:t.name,sub:t.sub}),t.sub===n?.sub&&(0,W.jsx)(LS,{variant:`outline`,className:`ml-4`,children:`You`})]}),(0,W.jsx)(`div`,{className:G(`text-ellipsis overflow-hidden truncate`,t.email===t.name&&`hidden`),title:t.email,children:t.email})]}),(0,W.jsx)(`div`,{className:`max-w-60 w-full`,children:(0,W.jsx)(NQt,{hiddenRoles:e.account.entitlements.rbacEnabled?[]:[`member`,`developer`],value:t.project.role,disabled:!!(t.sub===n?.sub||i.isPending),onValueChange:e=>{if(!jQt.includes(e))throw Error(`Invalid role`);i.mutate({userId:t.id,role:e})}})}),(0,W.jsx)(`div`,{className:`flex justify-end`,children:(0,W.jsx)(Y,{variant:`ghost`,size:`icon-lg`,onClick:()=>{i.mutate({role:`no-access`,userId:t.id})},children:(0,W.jsx)(eh,{size:16})})})]},t.sub))]})]})}var XQt=NX(`div`,`grid grid-cols-subgrid col-span-full w-full border-b px-4 py-3 items-center`),ZQt=({accountName:e,projectName:t,sourceRepoUrl:n,defaultBranch:r})=>{let{logEvent:i,captureException:a}=Vg(),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(r),[u,d]=(0,g.useState)(!1),f=qYt(e,t);(0,g.useEffect)(()=>{u||(s(``),l(r))},[u,r]);let p=n.split(`/`),m=p[p.length-2],h=p[p.length-1],_=async()=>{try{if(s(``),!c||c===r){s(`Select a new default branch.`);return}await f.mutateAsync({defaultBranch:c,sourceRepoUrl:n}),i(`project-update-default-branch-success`,{account:e}),d(!1)}catch(t){a(t);let n=Yj(t);s(n),i(`project-update-default-branch-failed`,{account:e,errorMessage:n})}};return(0,W.jsxs)(lV,{children:[(0,W.jsx)(uV,{children:`Default Branch`}),(0,W.jsxs)(pV,{className:`mt-1 text-sm`,children:[(0,W.jsx)(fV,{children:`The default branch is considered the “base” branch in your repository, against which all pull requests and code commits are automatically made. This is the branch used for your project's production deployments.`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(jV,{type:`text`,autoComplete:`off`,id:`default-branch-field`,value:r??`main`,disabled:!0,className:`max-w-52`,"data-test":`default-branch-field`}),(0,W.jsxs)(kA,{onOpenChange:e=>d(e),open:u,children:[(0,W.jsx)(AA,{children:(0,W.jsx)(Y,{type:`button`,"data-test":`update-default-branch`,variant:`outline`,children:`Update`})}),(0,W.jsxs)(MA,{children:[(0,W.jsx)(NA,{children:(0,W.jsx)(FA,{children:`Switch default branch to another branch`})}),(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(qR,{error:o}),(0,W.jsxs)(IA,{className:`text-foreground`,children:[`Choose another branch in`,` `,(0,W.jsxs)(oT,{href:n,children:[m,`/`,h]}),` `,`to use as the default branch of the project instead of`,` `,r,`.`,(0,W.jsx)(jV,{type:`text`,autoComplete:`off`,placeholder:`Type a branch name`,id:`default-branch-field`,className:`mt-4`,"data-test":`default-branch-field`,value:c,onChange:e=>l(e.target.value)})]})]}),(0,W.jsxs)(PA,{children:[(0,W.jsx)(jA,{children:(0,W.jsx)(Y,{"data-test":`cancel-update-default-branch-btn`,disabled:f.isPending,variant:`ghost`,children:`Cancel`})}),(0,W.jsx)(Y,{"data-test":`update-default-branch-btn`,type:`button`,onClick:_,disabled:f.isPending,variant:`outline`,children:(0,W.jsx)(Pk,{loading:f.isPending,alternative:`Updating...`,children:`Switch branch`})})]})]})]})]})]})]})},QQt=({children:e})=>(0,W.jsx)(lV,{children:(0,W.jsxs)(pV,{className:`flex items-center gap-3 py-4`,children:[(0,W.jsx)(_re,{className:`size-5 text-muted-foreground shrink-0`}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e})]})}),$Qt=()=>{let e=lh([`account`,`project`]),{logEvent:t}=Vg(),n=sZt();if((0,g.useEffect)(()=>{t(`source-control-settings-viewed`,{account:e.account.name,project:e.project.name})},[e.account.name,e.project.name,t]),!n.data)return(0,W.jsx)(VXt,{showHeader:!0});let r=yFe(e.account.name,n.data);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 md:gap-6 mb-6`,children:[(0,W.jsx)(E7,{title:`Source Control Settings`}),(0,W.jsxs)(QQt,{children:[`Learn more about deploying with source control in our`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/step-4-deploying-to-the-edge`,showIcon:!0,children:`documentation`}),`.`]}),e.project.sourceRepoUrl!==null&&(0,W.jsx)(ZQt,{accountName:e.account.name,projectName:e.project.name,sourceRepoUrl:e.project.sourceRepoUrl,defaultBranch:e.project.defaultBranch??void 0}),(0,W.jsxs)(lV,{children:[(0,W.jsx)(uV,{children:`Connected Git Repository`}),(0,W.jsxs)(pV,{children:[(0,W.jsx)(fV,{children:`Seamlessly create Environments for every branch and deployments for any commits pushed to your Git repository.`}),(0,W.jsx)(oZt,{account:e.account,project:e.project,sourceControlConfig:r})]})]})]})},e$t=({connected:e,bucketId:t,bucketName:n})=>(0,W.jsxs)(mV,{variant:`muted`,className:`text-sm font-medium text-gray-600 h-12 col-span-full flex justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-center`,children:[`Connected to`,` `,e?.map(e=>(0,W.jsx)(YEt,{env:e,children:(0,W.jsx)(LS,{variant:`secondary`,className:`ml-2 capitalize`,children:(0,W.jsx)(JEt,{env:e})})},e))]}),(0,W.jsx)(`div`,{className:`flex gap-2`,children:(0,W.jsxs)(kX,{children:[(0,W.jsx)(AX,{asChild:!0,children:(0,W.jsxs)(PX,{size:`sm`,children:[(0,W.jsx)($re,{size:16}),` Bucket Details`]})}),(0,W.jsx)(jX,{align:`end`,className:`w-96`,children:(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`div`,{className:`text-xs text-gray-600`,children:`Bucket Name`}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`div`,{className:`text-xs font-mono truncate`,children:n||`N/A`}),n&&(0,W.jsx)(bQ,{textToCopy:n})]})]}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`div`,{className:`text-xs text-gray-600`,children:`Bucket ID`}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`div`,{className:`text-xs font-mono truncate`,children:t||`N/A`}),t&&(0,W.jsx)(bQ,{textToCopy:t})]})]})]})})]})})]}),t$t=({environments:e,name:t,id:n})=>{let{account:r,project:i}=Pj([`account`,`project`]);return(0,W.jsxs)(lV,{className:`grid grid-cols-subgrid col-span-full`,children:[(0,W.jsx)(uV,{className:`col-span-full`}),(0,W.jsxs)(pV,{className:`grid grid-cols-subgrid col-span-full`,children:[(0,W.jsxs)(`div`,{className:`flex flex-row gap-4 items-center`,children:[(0,W.jsxs)(`div`,{className:`flex p-1 items-center relative bg-indigo-200 text-indigo-500 border-indigo-500 rounded-lg border`,children:[(0,W.jsx)(Wm,{size:24,strokeWidth:1.25,absoluteStrokeWidth:!0}),(0,W.jsx)(Qre,{size:22,strokeWidth:1.25,fill:`#fff`,className:`absolute -right-2 -bottom-1.5`})]}),(0,W.jsxs)(`div`,{className:`flex flex-col`,children:[(0,W.jsx)(`div`,{className:`font-medium text-sm`,children:`API Key Service`}),(0,W.jsx)(`div`,{className:`text-sm`,children:`Contains API Keys for your users`})]})]}),(0,W.jsx)(`div`,{}),(0,W.jsx)(Y,{variant:`outline`,asChild:!0,className:`self-center`,children:(0,W.jsx)(Pr,{to:Ce(`/:account/:project/services/keys/:bucketId`,{bucketId:t,account:r,project:i}),"data-test":`service-${e?.join(`-`)}`,children:`Configure`})})]}),(0,W.jsx)(e$t,{connected:e,bucketId:n,bucketName:t})]})},B7=new Map,V7=e=>{let t=B7.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},n$t=(e,t,n)=>{if(e===void 0)return{type:`untracked`,connection:t.connect(n)};let r=B7.get(n.name);if(r)return{type:`tracked`,store:e,...r};let i={connection:t.connect(n),stores:{}};return B7.set(n.name,i),{type:`tracked`,store:e,...i}},r$t=(e,t={})=>(n,r,i)=>{let{enabled:a,anonymousActionType:o,store:s,...c}=t,l;try{l=(a??!0)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return e(n,r,i);let{connection:u,...d}=n$t(s,l,c),f=!0;i.setState=(e,t,a)=>{let l=n(e,t);if(!f)return l;let d=a===void 0?{type:o||`anonymous`}:typeof a==`string`?{type:a}:a;return s===void 0?(u?.send(d,r()),l):(u?.send({...d,type:`${s}/${d.type}`},{...V7(c.name),[s]:i.getState()}),l)};let p=(...e)=>{let t=f;f=!1,n(...e),f=t},m=e(i.setState,r,i);if(d.type===`untracked`?u?.init(m):(d.stores[d.store]=i,u?.init(Object.fromEntries(Object.entries(d.stores).map(([e,t])=>[e,e===d.store?m:t.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch==`function`){let e=!1,t=i.dispatch;i.dispatch=(...n)=>{n[0].type===`__setState`&&!e&&(console.warn(`[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.`),e=!0),t(...n)}}return u.subscribe(e=>{switch(e.type){case`ACTION`:if(typeof e.payload!=`string`){console.error(`[zustand devtools middleware] Unsupported action format`);return}return H7(e.payload,e=>{if(e.type===`__setState`){if(s===void 0){p(e.state);return}Object.keys(e.state).length!==1&&console.error(`
|
|
1656
|
+
`,`const ${e.name} = environment.${e.name};\r\n`]})})]})]}),CQt=e=>{let t=[];return e.targets.includes(`production`)&&t.push(`production`),e.targets.includes(`preview`)&&t.push(e.targetBranch??`preview`),e.targets.includes(`working-copy`)&&t.push(`development`),t.join(`, `)};function wQt({variable:e,account:t,project:n,previewEnvironments:r}){let i=$ht(),{logEvent:a}=Vg(),[o,s]=(0,g.useState)(),[c,l]=(0,g.useState)(!1),{tooltipProps:u,triggerProps:d}=bQt(),{tooltipProps:f,triggerProps:p}=bQt(),[m,h]=QR(()=>{let r=async()=>{h(),await i.mutateAsync({accountName:t,projectName:n.name,id:e.id}),a(`env-var-deleted`,{account:t,project:n.name,id:e.id})},s=`Error deleting Environment Variable`,c=`We found an error trying to remove the variable.`;return o instanceof Lf&&(s=o.title??s,c=o.detail??c),(0,W.jsx)(FL,{alertType:`ERROR`,bodyText:c,onPrimaryButtonClick:r,onSecondaryButtonClick:h,primaryButtonText:`Try again`,secondaryButtonText:`Cancel`,hideModal:h,title:s})},[e,r,o]),_=async()=>{try{await i.mutateAsync({accountName:t,projectName:n.name,id:e.id}),a(`env-var-deleted`,{account:t,project:n.name,id:e.id}),l(!1)}catch(r){a(`env-var-deletion-failed`,{account:t,project:n.name,id:e.id}),l(!1),s(r instanceof Error?r:Error(r)),m()}},[v,y]=QR(()=>(0,W.jsx)(vQt,{project:n,variable:e,previewEnvironments:r,onClose:y,account:t}),[e,r]),b=e.personalValue??e.value;return(0,W.jsxs)(lV,{className:`grid grid-cols-subgrid col-span-full gap-4 items-center p-4 mt-2`,children:[(0,W.jsxs)(JR,{open:c,onOpenChange:l,onClickDelete:_,isPending:i.isPending,deleteButtonText:`Confirm`,children:[`Are you sure you want to delete the variable '`,e.name,`'`]}),(0,W.jsx)(`div`,{className:`rounded-full border w-10 h-10 flex items-center justify-center`,children:(0,W.jsx)(xQt,{isSecret:e.type===`secret`})}),(0,W.jsxs)(`div`,{className:`flex flex-row justify-between items-center truncate`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col truncate`,children:[(0,W.jsxs)(Ok,{...f,delayDuration:0,children:[(0,W.jsx)(kk,{...p,asChild:!0,children:(0,W.jsx)(`span`,{className:`font-mono text-sm truncate`,"data-test":`env-variable-name`,children:e.name})}),(0,W.jsxs)(Ak,{className:`font-mono`,children:[(0,W.jsx)(jk,{}),e.name]})]}),(0,W.jsx)(`div`,{className:`text-sm text-neutral-500 line-clamp-2`,children:CQt(e)})]}),e.personalValue&&(0,W.jsx)(`div`,{className:`bg-zuplo-highlight rounded-full text-2xs text-white px-2 py-1 mx-2 flex-none`,children:`PERSONAL`})]}),(0,W.jsx)(`div`,{"data-test":`env-variable-value`,className:`truncate flex text-xs font-mono`,children:b?(0,W.jsxs)(Ok,{...u,children:[(0,W.jsx)(kk,{asChild:!0,...d,children:(0,W.jsx)(`div`,{className:`bg-neutral-100 p-1 px-2 rounded-sm max-w-96 truncate`,children:e.type===`config`?b:`************`})}),(0,W.jsxs)(Ak,{className:`text-xs`,children:[(0,W.jsx)(jk,{}),b]})]}):(0,W.jsx)(LS,{variant:`outline`,children:`No value`})}),(0,W.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,W.jsx)(SQt,{variable:e,asIcon:!0}),(0,W.jsx)(Y,{size:`icon`,variant:`ghost`,type:`button`,"data-test":`env-variable-edit`,onClick:()=>{v()},children:(0,W.jsx)(Zm,{size:18})}),(0,W.jsx)(Y,{size:`icon`,variant:`ghost`,"data-test":`env-variable-delete`,onClick:()=>{l(!0)},children:i.isPending?(0,W.jsx)(IL,{className:`w-4 h-4`,borderPositionAndSize:`border-2`}):(0,W.jsx)(eh,{size:18})})]})]},e.name)}var TQt=({previewEnvironments:e,ape:t,onClose:n})=>{let{logEvent:r,captureException:i}=Vg(),a=ch(),o={id:`temp`,name:``,type:`config`,targets:[`production`,`preview`,`working-copy`]},s=Qht(),c=(e,i,o)=>{r(`env-var-created`,{type:e,targets:i.join(`,`),personalOverride:`${o}`,account:t.account.name,project:t.project.name});let s=i.filter(e=>e!==`working-copy`);t.project.sourceRepoUrl!=null&&s.length>0&&a.success(`Redeploy your environment to apply changes.`,{title:`Environment variable created`}),n()};return(0,W.jsx)(_Qt,{variable:o,previewEnvironments:e,defaultBranch:t.project.defaultBranch,mode:`new`,onSubmit:e=>{let n={};n.name=e.name??void 0,n.value=e.value??``,n.type=e.isSecret?`secret`:`config`,n.targets=mQt(e),n.targetBranch=e.preview&&e.targetBranch!==`__NULL_BRANCH`?e.targetBranch:void 0,n.personalValue=e.workingCopy&&e.personalOverride?e.personalValue??``:void 0,s.mutate({accountName:t.account.name,projectName:t.project.name,variableData:n},{onSuccess:()=>c(n.type??`config`,n.targets??[],e.personalOverride),onError:e=>{r(`env-var-creation-failed`,{account:t.account.name,project:t.project.name}),i(e)}})},onClose:n,isSaving:s.isPending,error:s.error})},R7=`___EMPTY___`;function EQt(){let e=lh([`account`,`project`]),{logEvent:t}=Vg(),n=Xht(e.account.name,e.project.name),r=!!e.project.sourceRepoUrl,i=Qj(e.account.name,e.project.name),a=[{label:`All`,value:R7},{label:`Production`,value:`production`},{label:`Preview (other branches)`,value:`preview`},{label:`Development`,value:`working-copy`}],[o,s]=(0,g.useState)(R7),[c,l]=(0,g.useState)(R7),[u,d]=(0,g.useState)(``),f=i.data?.filter(e=>!cPe(e.environmentType,VA.PRODUCTION,VA.WORKING_COPY))??[],p=f.map(e=>e.branchName),m=(0,g.useMemo)(()=>[R7,...p],[p]),h=(0,g.useMemo)(()=>n.data??[],[n.data]),_=(0,g.useMemo)(()=>h.filter(e=>o===R7||e.targets.includes(o)),[h,o]),v=_X(u,(0,g.useMemo)(()=>o!==`preview`||c===R7?_:_.filter(e=>e.targets.includes(`preview`)&&e.targetBranch===c),[_,o,c]),{key:`id`,getText:e=>[e.name,e.type,e.value,...e.targets,e.targetBranch].filter(Boolean)}),[y,b]=QR(()=>(0,W.jsx)(TQt,{ape:e,previewEnvironments:f,onClose:b}),[f]);return n.isError?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(E7,{title:`Environment Variables`,className:`mb-4`}),(0,W.jsx)(SFe,{error:n.error})]}):!n.data||r&&!i.data?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(E7,{title:`Environment Variables`,className:`mb-4`}),(0,W.jsx)(hV,{})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(E7,{title:`Environment Variables`}),(0,W.jsx)(`p`,{className:`text-sm my-1`,children:`To provide your environments with environment variables during build and runtime, you can enter them here for your chosen environment.`}),(0,W.jsx)(`p`,{className:`text-sm my-1 mt-2`,children:`A new deployment is necessary for your changes to take effect.`}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,W.jsx)(`div`,{className:`flex flex-row justify-end gap-x-2`,children:(0,W.jsx)(Y,{onClick:y,children:`Add variable`})}),(0,W.jsxs)(`div`,{className:`flex flex-row items-center gap-3`,children:[(0,W.jsx)(jV,{type:`search`,placeholder:`Search variables`,value:u,onChange:n=>{d(n.currentTarget.value),t(`env-var-filter-changed`,{account:e.account.name,project:e.project.name,query:n.currentTarget.value})}}),(0,W.jsxs)(wW,{value:o,onValueChange:e=>{s(e),e!==`preview`&&l(``)},children:[(0,W.jsx)(EW,{className:`w-52`,"data-test":`env-variable-filter`,children:(0,W.jsx)(TW,{})}),(0,W.jsx)(DW,{className:`w-52`,children:a.map((e,t)=>(0,W.jsx)(OW,{value:e.value,"data-test":`env-variable-filter-${t}`,children:e.label},e.value))})]}),o===`preview`?(0,W.jsxs)(wW,{value:c,onValueChange:e=>{l(e)},children:[(0,W.jsx)(EW,{className:`w-52`,"data-test":`env-variable-branch-filter`,children:(0,W.jsx)(TW,{})}),(0,W.jsx)(DW,{className:`w-52`,children:m.map(e=>(0,W.jsx)(OW,{value:e,children:e===R7?`All branches`:e},e))})]}):null]})]}),(0,W.jsx)(`div`,{className:`grid-cols-[min-content_minmax(auto,250px)_1fr_auto] grid`,children:v.map(t=>(0,W.jsx)(wQt,{account:e.account.name,project:e.project,previewEnvironments:f,variable:t},t.id))}),v.length===0?(0,W.jsx)(`div`,{className:`w-full flex text-center justify-center h-full items-center text-neutral-500 mt-10`,children:o===R7&&c===``&&u===``?(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`text-zuplo-pink cursor-pointer`,onClick:y,children:`Create`}),` `,`an environment variable and it will show up here.`,(0,W.jsxs)(`p`,{children:[`Not sure where to start?`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/deployments/environment-variables`,children:`Read the docs`}),`.`]})]}):`No variables matching your filter`}):null]})}var DQt=({projectName:e,closeModalAction:t,accountName:n,onFinishDeletion:r})=>{let{logEvent:i,captureException:a}=Vg(),[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(null),u=t=>{s(t.target.value===e)},d=UYt(n,e);return(0,W.jsx)(TGe,{alertType:`DELETE`,isOpen:!0,title:`Delete Project`,setIsOpen:t,secondaryButtonContent:`Cancel`,secondaryButtonTestID:`project-list-close-delete-project-modal`,onSecondaryButtonClick:t,primaryButtonTestID:`project-list-delete-project-button`,secondaryButtonDisabled:d.isPending,primaryButtonDisabled:!o||d.isPending,primaryButtonContent:`Delete`,onPrimaryButtonClick:async()=>{try{l(null),await d.mutateAsync(),i(`project-deleted`,{account:n,project:e}),r?.(),t()}catch(t){i(`project-deletion-failed`,{account:n,project:e}),a(t),l(Yj(t))}},bodyElement:(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(qR,{error:c}),(0,W.jsx)(`p`,{className:`text-sm`,children:`This cannot be undone! Your GitHub repository will be untouched.`}),(0,W.jsxs)(`p`,{className:`text-sm`,children:[`Please type `,(0,W.jsx)(`strong`,{onDoubleClick:e=>{let t=e.currentTarget,n=new Range;n.setStart(t,0),n.setEnd(t,1),document.getSelection()?.removeAllRanges(),document.getSelection()?.addRange(n)},children:e}),` `,`to confirm.`]}),(0,W.jsx)(jV,{disabled:d.isPending,type:`text`,className:`mt-2`,autoFocus:!0,autoComplete:`off`,onChange:u})]})})};function OQt(){let e=Pj([`account`,`project`]),t=Tn(),[n,r]=QR(()=>(0,W.jsx)(DQt,{projectName:e.project,accountName:e.account,closeModalAction:r,onFinishDeletion:()=>t(`/`)}),[]);return(0,W.jsxs)(lV,{children:[(0,W.jsxs)(uV,{children:[(0,W.jsx)(dV,{children:`Delete Project`}),(0,W.jsx)(fV,{children:`Permanently delete this project and all associated data. This cannot be undone, there is no going back.`})]}),(0,W.jsx)(pV,{className:`leading-loose text-sm`,children:`Your GitHub repository will remain untouched.`}),(0,W.jsx)(mV,{children:(0,W.jsxs)(Y,{"data-test":`delete-button`,variant:`destructive-outline`,onClick:n,children:[(0,W.jsx)(eh,{size:16}),`Delete Project`]})})]})}var kQt=({children:e,copyValue:t})=>{let{logEvent:n}=Vg();return(0,W.jsxs)(`div`,{className:`mb-2 md:mb-0`,children:[e,t&&(0,W.jsx)(bQ,{className:`relative top-1`,onClick:()=>{n(`project-information-property-copied`)},textToCopy:t})]})},AQt=()=>{let{logEvent:e}=Vg(),t=lh([`account`,`project`]);if(!Qj(t.account.name,t.project.name).data)return(0,W.jsx)(`div`,{className:`p-6`,children:(0,W.jsx)(hV,{})});let n=[];return n.push({label:`Project Name`,value:t.project.name}),n.push({label:`Account Name`,value:t.account.name}),(0,W.jsxs)(lV,{children:[(0,W.jsxs)(uV,{children:[(0,W.jsx)(dV,{children:`Project Information`}),(0,W.jsx)(fV,{})]}),(0,W.jsx)(pV,{children:(0,W.jsx)(`div`,{className:`grid gap-2 grid-cols-1 md:grid-cols-[150px_1fr] text-sm mt-2`,children:n.map(t=>(0,W.jsxs)(g.Fragment,{children:[(0,W.jsx)(`div`,{className:`font-medium`,children:t.label}),(0,W.jsx)(kQt,{copyValue:t.value,children:t.isLink?(0,W.jsx)(oT,{href:t.value,onClick:()=>{e(`project-information-link-clicked`,{label:t.label,value:t.value})},className:`break-all`,children:t.value}):t.value})]},t.value))})})]})},jQt=()=>(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 md:gap-6 mb-6`,children:[(0,W.jsx)(E7,{title:`General`}),(0,W.jsx)(AQt,{}),(0,W.jsx)(OQt,{})]}),MQt=[`admin`,`developer`,`member`,`no-access`],NQt={admin:`Admin`,developer:`Developer`,member:`Member`,"no-access":`No Access`},z7=(e,t)=>e!==`no-access`&&(t||e===`admin`),PQt=({value:e,hiddenRoles:t=[],...n})=>{let r=ch(),i=lh([`account`]).account.entitlements.rbacEnabled,a=MQt.filter(e=>!t.concat([`no-access`]).includes(e));return(0,W.jsxs)(wW,{...n,value:e,onValueChange:e=>{z7(e,i)?n.onValueChange?.(e):r.toast((0,W.jsxs)(W.Fragment,{children:[`This role is not available for your account. Please upgrade to the Enterprise plan.`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/accounts/roles-and-permissions`,target:`_blank`,children:`Learn more about roles and permissions.`})]}))},children:[(0,W.jsx)(EW,{className:`min-w-40`,children:(0,W.jsx)(TW,{placeholder:`Select a role`})}),(0,W.jsx)(DW,{className:`min-w-40`,children:a.map(e=>(0,W.jsx)(OW,{value:e,onClick:t=>{z7(e,i)||(t.preventDefault(),t.stopPropagation(),window.open(`https://zuplo.com/docs/articles/accounts/roles-and-permissions`,`_blank`))},children:(0,W.jsxs)(`div`,{className:`grid grid-cols-2`,children:[NQt[e],!z7(e,i)&&(0,W.jsx)(LS,{variant:`outline`,className:``,children:`Enterprise`})]})},e))})]})},FQt={zuplo:e=>(0,W.jsx)(`svg`,{viewBox:`0 0 308 308`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,W.jsxs)(`g`,{fillRule:`nonzero`,fill:`none`,children:[(0,W.jsx)(`path`,{d:`M0 0h308v308H0z`}),(0,W.jsx)(`path`,{d:`M214.523 182.007h-74.088l78.939-79.076a5.34 5.34 0 0 0-.807-8.204 5.314 5.314 0 0 0-2.957-.899H90.239V41.364h137.515a53.31 53.31 0 0 1 28.617 7.922 53.444 53.444 0 0 1 19.967 22.011 52.117 52.117 0 0 1 4.221 31.194 52.062 52.062 0 0 1-14.508 27.924l-51.528 51.592Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M90.24 119.097h74.092l-78.781 78.917a5.431 5.431 0 0 0-1.172 5.912 5.423 5.423 0 0 0 5.001 3.351h125.017v52.464H77.016a53.322 53.322 0 0 1-28.616-7.923 53.453 53.453 0 0 1-19.968-22.011 52.109 52.109 0 0 1-4.219-31.194 52.059 52.059 0 0 1 14.51-27.924l51.517-51.592Z`,fill:`currentColor`})]})}),akamai:e=>(0,W.jsxs)(`svg`,{viewBox:`344.42 285.18 451 489.75`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,...e,children:[(0,W.jsx)(`path`,{d:`M592.85,764.11c-100.8-30.77-174.12-123.92-174.12-234.05s74.88-205.29,177.4-235.02c10.48-3.06,7.73-9.86-4.91-9.86-136.28,0-246.8,109.69-246.8,244.89s110.51,244.86,246.8,244.86c12.63,0,13.14-7.3,1.63-10.81Z`}),(0,W.jsx)(`path`,{d:`M465.48,587.42c-.68-6.58-1.01-13.23-1.01-19.94,0-107.36,87.05-194.39,194.43-194.39,101.52,0,132,45.31,135.78,42.35,4.12-3.26-36.84-93.07-156.05-93.07-107.39,0-194.44,87.03-194.44,194.39,0,24.84,4.65,48.52,13.13,70.31,3.58,9.14,9.08,9.22,8.17.35Z`}),(0,W.jsx)(`path`,{d:`M546.92,447.31c50.53-22.03,114.01-22.7,176.42-.89,41.91,14.62,66.2,35.5,68.19,34.64,3.31-1.43-24.38-45.28-74.36-64.24-60.51-22.93-125.69-10.93-173.18,26.32-5.22,4.11-3.25,6.87,2.93,4.17Z`})]})},IQt=({variant:e=`full`,className:t,width:n,height:r})=>{let i=fZt();if(e===`mark`){let e=FQt[i.id];return(0,W.jsx)(e,{className:t,width:n,height:r,role:`img`,"aria-label":i.logoAlt})}return e===`full`&&i.logoDark?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`img`,{src:i.logo,alt:i.logoAlt,className:G(t,`dark:hidden`),width:n,height:r}),(0,W.jsx)(`img`,{src:i.logoDark,alt:i.logoAlt,className:G(t,`hidden dark:inline`),width:n,height:r})]}):(0,W.jsx)(`img`,{src:e===`white`?i.logoWhite:i.logo,alt:i.logoAlt,className:G(t),width:n,height:r})},LQt=()=>(0,W.jsx)(`div`,{className:`h-0 flex flex-col items-center -translate-y-14 mb-2`,children:(0,W.jsx)(IQt,{variant:`white`,className:`h-17 w-auto rounded-full bg-zuplo-pink p-4 shadow-xs`})}),RQt=(e,t,n)=>{let[r,i]=(0,g.useState)(t),a=zA(n);return[e===void 0?r:e,(0,g.useCallback)(t=>{e===void 0?i(t):a.current?.(t)},[e,a])]},zQt=Nv({email:jv().email(`Invalid email address`),role:Fv([`admin`,`developer`,`member`])}),BQt=({inviteOnly:e=!1,account:t,project:n,team:r,description:i,hiddenRoles:a,children:o,open:s,onOpenChange:c,excludeUserIds:l,changeRoleForUserIds:u})=>{let d=lh([`account`]),{logEvent:f}=Vg(),[p,m]=RQt(s,!1,c),[h,_]=(0,g.useState)(!1),[v,y]=(0,g.useState)(!1),b=xj(),{onError:x,onSuccess:S}=Zj(),C=d.account.entitlements.rbacEnabled,w=wG({resolver:TG(zQt),defaultValues:{email:``,role:C?`member`:`admin`}}),T=C?`member`:`admin`,E=wj(X.authAccountUsersRoles(t),{extractData:!0}),D=w.watch(`email`),O=zA(()=>{w.reset(),_(!1)});(0,g.useEffect)(()=>{p||O.current()},[p,O]);let k=T_({mutationFn:({email:e,role:i})=>{let a=r&&n?{account:{role:T},project:{name:n,role:T},team:{...r,role:i}}:n?{account:{role:T},project:{name:n,role:i}}:{account:{role:i}},o=E?.data?.find(t=>t.email===e)?.id;return!h&&o&&u?.includes(o)?b.fetch(bj.auth.updateUsersRole({accountName:t,projectName:n,userId:o,role:i})):b.fetch(bj.accountInvite.createAccountInvite(t,e,a))},onError:x,onSuccess:()=>{S(h?`Invitation sent to ${w.getValues(`email`)}`:`Member added to ${d.account.label??d.account.name}`),m(!1)}}),A=_X(D,(E?.data??[]).filter(e=>!l||l.includes(e.id)===!1),{getText:e=>[e.name,e.email],key:`email`}),j=e=>{f(`account-invite-submitted`,{role:e.role,teamId:r?.id??``,project:n,account:t}),k.mutate({email:e.email,role:e.role})};return(0,W.jsxs)(kA,{open:p,onOpenChange:e=>{e||w.reset(),m(e)},children:[o&&(0,W.jsx)(AA,{asChild:!0,children:o}),(0,W.jsxs)(MA,{className:`max-w-md`,children:[(0,W.jsx)(Ggt,{}),(0,W.jsx)(LQt,{}),(0,W.jsxs)(NA,{className:`mt-2`,children:[(0,W.jsxs)(FA,{children:[`Invite to `,d.account.label??d.account.name]}),(0,W.jsx)(IA,{className:`opacity-75`,children:i??`Once you invite someone to your account, they can be granted access to account projects.`})]}),(0,W.jsx)(EG,{...w,children:(0,W.jsxs)(`form`,{onSubmit:w.handleSubmit(j),className:`mt-2 space-y-4`,children:[(0,W.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,W.jsx)(DG,{control:w.control,name:`email`,render:({field:t})=>(0,W.jsxs)(kG,{className:`w-full`,children:[(0,W.jsx)(AG,{children:`Member`}),(0,W.jsx)(jG,{children:(0,W.jsx)(`div`,{className:`relative`,children:(0,W.jsx)(kX,{open:v&&D.length>0,onOpenChange:y,modal:!1,children:(0,W.jsxs)(K1,{shouldFilter:!1,loop:!0,children:[(0,W.jsx)(Tgt,{asChild:!0,children:(0,W.jsx)(V1.Input,{asChild:!0,value:D,onValueChange:t.onChange,onKeyDown:e=>{if(e.key===`Enter`&&v===!1){e.currentTarget.form?.requestSubmit(),e.preventDefault();return}y(e.key!==`Escape`)},onMouseDown:()=>y(e=>!!D||!e),onFocus:()=>y(!0),onBlur:()=>y(!1),children:(0,W.jsx)(jV,{placeholder:`Email address or member name`})})}),!open&&(0,W.jsx)(J1,{"aria-hidden":`true`,className:`hidden`}),(0,W.jsx)(jX,{asChild:!0,align:`start`,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{e.target instanceof Element&&e.target.hasAttribute(`cmdk-input`)&&e.preventDefault()},className:`w-(--radix-popover-trigger-width) p-0`,children:(0,W.jsxs)(J1,{className:`max-h-[200px] overflow-y-auto`,children:[(0,W.jsx)(Y1,{children:`No members found.`}),(0,W.jsxs)(X1,{children:[!e&&A.map((e,n)=>(0,W.jsx)(Z1,{value:n.toString(),onSelect:()=>{t.onChange(e.email),_(!1),y(!1)},children:(0,W.jsx)(`span`,{children:e.name})},e.id)),D.length>0&&(0,W.jsxs)(Z1,{value:A.length.toString(),onSelect:()=>{_(!0),y(!1)},children:[(0,W.jsx)(jre,{size:16,className:`mr-2`}),` `,`Invite "`,D.includes(`@`)?D:`${D}@example.com`,`" to Account`]})]})]})})]})})})}),(0,W.jsx)(MG,{})]})}),(0,W.jsx)(DG,{control:w.control,name:`role`,render:({field:e})=>(0,W.jsxs)(kG,{children:[(0,W.jsx)(AG,{children:`Role`}),(0,W.jsx)(jG,{children:(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{asChild:!0,children:(0,W.jsx)(PQt,{value:e.value,onValueChange:e.onChange,hiddenRoles:a})}),(0,W.jsx)(Ak,{children:C?(0,W.jsx)(`p`,{children:`New users will be assigned the member role. You can change their role later.`}):(0,W.jsx)(`p`,{children:`New users will be assigned the admin role. You can change their role later.`})})]})}),(0,W.jsx)(MG,{})]})})]}),(0,W.jsx)(PA,{children:(0,W.jsx)(Y,{type:`submit`,className:`justify-end`,children:(0,W.jsxs)(Pk,{loading:k.isPending,children:[h?`Send Invite`:`Add member`,(0,W.jsx)(PSt,{className:`bg-white/20`,children:(0,W.jsx)(NSt,{onPress:w.handleSubmit(j),hotkey:`meta+Enter`})})]})})})]})})]})]})},VQt=()=>{let{account:e}=lh([`account`]);return e.entitlements.rbacEnabled?null:(0,W.jsxs)(PS,{variant:`info`,className:`text-sm`,children:[(0,W.jsx)(wm,{size:22}),(0,W.jsx)(IS,{children:(0,W.jsxs)(`p`,{children:[`Role-based access control (RBAC) is not enabled for this account.`,` `,(0,W.jsx)(CX,{to:`mailto:${eC}?subject=Fine-grain%20access%20control`,children:`Contact sales`}),` `,`for more information.`]})})]})},HQt=({name:e,sub:t,email:n})=>{let{copyToClipboard:r}=lO(t??n??``);return(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{onDoubleClick:()=>{r()},className:`text-left`,children:e}),(0,W.jsxs)(Ak,{className:`flex items-center gap-2`,children:[t&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Lre,{size:16}),` Sub `,t]}),n&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Jre,{size:16}),` Email `,n]})]})]})},UQt=e(i(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))}))());function WQt({accountName:e,invite:t}){let n=ch(),[r,i]=(0,g.useState)(!1),a=hZt();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Y,{size:`icon`,variant:`ghost`,title:`Remove invitation`,disabled:a.isPending,onClick:()=>i(!0),children:(0,W.jsx)(eh,{size:18})}),(0,W.jsxs)(JR,{open:r,onOpenChange:i,title:`Delete account invite`,deleteButtonText:`Delete invitation`,isPending:a.isPending,onClickDelete:async()=>{try{await a.mutateAsync({accountName:e,inviteId:t.id}),n.success(`Invitation was removed`),i(!1)}catch(e){n.error(Yj(e))}},children:[`You are about to delete the account invite sent to `,t.email,`. The invitation can no longer be used to join your account.`]})]})}function GQt({accountName:e,invite:t}){let n=ch(),r=gZt(),[i,a]=(0,g.useState)(!1);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{asChild:!0,children:(0,W.jsx)(Y,{size:`icon`,variant:`ghost`,disabled:r.isPending,onClick:()=>a(!0),children:(0,W.jsx)(Vre,{size:18})})}),(0,W.jsx)(Ak,{children:`Resend invitation`})]}),(0,W.jsx)(dX,{open:i,onOpenChange:a,title:`Do you want to resend the invitation?`,description:`You are about to resend the account membership invite for "${t.email}" to join "${e}".`,actionLabel:`Resend invitation`,isPending:r.isPending,onConfirm:async()=>{try{await r.mutateAsync({accountName:e,inviteId:t.id}),n.success(`Invitation has been resent`),a(!1)}catch(e){n.error(Yj(e)),a(!1)}}})]})}var KQt=({date:e,withTime:t})=>(0,W.jsxs)(`span`,{children:[e.toLocaleDateString(),t&&` ${e.toLocaleTimeString()}`]}),qQt=({email:e,className:t})=>{let{copyToClipboard:n}=lO(e);return(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{onDoubleClick:n,className:G(`cursor-pointer`,t),children:e}),(0,W.jsxs)(Ak,{children:[`Copy `,(0,W.jsxs)(`span`,{className:`font-mono`,children:[`"`,e,`"`]}),` to clipboard`]})]})};m7.default.extend(UQt.default);function JQt(){let{account:e}=Pj([`account`]),t=mZt(e).data??[];return t.length===0?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`text-lg font-medium`,children:`Pending account invitations`}),(0,W.jsx)(`div`,{className:`grid grid-cols-4 gap-2`,children:t.map(t=>(0,W.jsxs)(uz,{variant:`outline`,size:`sm`,className:G(`col-span-full grid grid-cols-subgrid justify-between py-1`,(0,m7.default)().diff((0,m7.default)(t.createdOn),`minutes`)<5&&`bg-zuplo-50/50`),children:[(0,W.jsx)(`div`,{className:`text-ellipsis overflow-hidden truncate`,children:(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{children:(0,W.jsxs)(LS,{variant:`outline`,children:[`Invited `,(0,m7.default)(t.createdOn).fromNow()]})}),(0,W.jsx)(Ak,{children:(0,W.jsx)(KQt,{date:new Date(t.createdOn),withTime:!0})})]})}),(0,W.jsx)(qQt,{email:t.email,className:`text-left text-ellipsis overflow-hidden truncate`}),(0,W.jsxs)(`div`,{className:`flex justify-end col-span-2`,children:[(0,W.jsx)(GQt,{accountName:e,invite:t}),(0,W.jsx)(WQt,{accountName:e,invite:t})]})]},t.id))})]})}var YQt=5;function XQt(){let e=lh([`account`,`project`]),t=ch(),{user:n}=Lg(),r=xj(),i=T_({mutationFn:({userId:t,role:n})=>r.fetch(bj.auth.updateUsersRole({accountName:e.account.name,projectName:e.project.name,userId:t,role:n})),onError:e=>t.error(Yj(e))}),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(!1),l=Cj(X.accountMemberInvites(e.account.name)),u=Cj(X.authProjectUsersRoles(e.account.name,e.project.name,{includeInheritedRoles:!1}),{extractData:!0}),d=u.data?.map(e=>e.id),f=Cj(X.authProjectUsersRoles(e.account.name,e.project.name,{includeInheritedRoles:!0}),{extractData:!0}),p=f.data?.filter(e=>!d?.includes(e.id)),m=u.data?.filter(e=>e.project.role!==`no-access`),h=e.account.entitlements.rbacEnabled,_=(m?.map(({id:e})=>e)??[]).concat(h?[]:p?.map(({id:e})=>e)??[]);return(0,W.jsxs)(`div`,{className:`flex gap-2 flex-col text-sm`,children:[(0,W.jsx)(E7,{title:`Project access`}),(0,W.jsx)(`div`,{className:`text-lg font-medium`,children:`Members with inherited access`}),(0,W.jsx)(`p`,{children:`Account Admins and developers automatically have access to all projects.`}),p?.map(e=>(0,W.jsx)(uz,{variant:`outline`,size:`sm`,children:(0,W.jsxs)(fz,{className:`grid grid-cols-[1fr_max-content] gap-1`,children:[(0,W.jsx)(pz,{children:(0,W.jsx)(HQt,{name:e.name,email:e.email})}),(0,W.jsx)(mz,{className:`max-w-52`,children:(0,W.jsxs)(Ok,{children:[(0,W.jsx)(kk,{children:(0,W.jsx)(LS,{variant:`outline`,children:e.project.role===`admin`?`Full access`:`Read only`})}),(0,W.jsx)(Ak,{children:NQt[e.project.role]})]})})]})},e.id)).slice(0,a?void 0:YQt),(p?.length??0)>YQt&&(0,W.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>{o(!a)},children:a?`Show less`:`Show more`}),l.data?.length>0&&(0,W.jsx)(JQt,{}),(0,W.jsxs)(`div`,{className:`flex justify-between mt-4`,children:[(0,W.jsx)(`div`,{className:`text-lg font-medium`,children:`Members with project access`}),(0,W.jsx)(BQt,{account:e.account.name,project:e.project.name,changeRoleForUserIds:f.data?.map(({id:e})=>e)??[],excludeUserIds:_,open:s,onOpenChange:c,description:`Inviting a user to a project will grant them access to the project and add them to the account as a member.`,children:(0,W.jsxs)(Y,{children:[(0,W.jsx)(Jm,{}),`Add to project`]})})]}),(0,W.jsxs)(`p`,{className:`text-sm`,children:[`Account members can create or be added to projects.\xA0`,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/add-project-collaborators`,children:`Learn more`}),`.`]}),(0,W.jsx)(qR,{error:u.error}),i.isError&&(0,W.jsx)(VQt,{}),m?.length===0&&(0,W.jsx)(uz,{variant:`outline`,className:`justify-center`,children:`No members have been added directly to this project yet.`}),(m?.length??0)>0&&(0,W.jsxs)(lV,{className:`grid grid-cols-[auto_auto_auto] gap-x-4 text-sm`,children:[(0,W.jsx)(ZQt,{className:`font-medium`,children:(0,W.jsx)(`div`,{className:`row-span-full`,children:`Name`})}),!u.isError&&m?.map(t=>(0,W.jsxs)(ZQt,{children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(HQt,{name:t.name,sub:t.sub}),t.sub===n?.sub&&(0,W.jsx)(LS,{variant:`outline`,className:`ml-4`,children:`You`})]}),(0,W.jsx)(`div`,{className:G(`text-ellipsis overflow-hidden truncate`,t.email===t.name&&`hidden`),title:t.email,children:t.email})]}),(0,W.jsx)(`div`,{className:`max-w-60 w-full`,children:(0,W.jsx)(PQt,{hiddenRoles:e.account.entitlements.rbacEnabled?[]:[`member`,`developer`],value:t.project.role,disabled:!!(t.sub===n?.sub||i.isPending),onValueChange:e=>{if(!MQt.includes(e))throw Error(`Invalid role`);i.mutate({userId:t.id,role:e})}})}),(0,W.jsx)(`div`,{className:`flex justify-end`,children:(0,W.jsx)(Y,{variant:`ghost`,size:`icon-lg`,onClick:()=>{i.mutate({role:`no-access`,userId:t.id})},children:(0,W.jsx)(eh,{size:16})})})]},t.sub))]})]})}var ZQt=NX(`div`,`grid grid-cols-subgrid col-span-full w-full border-b px-4 py-3 items-center`),QQt=({accountName:e,projectName:t,sourceRepoUrl:n,defaultBranch:r})=>{let{logEvent:i,captureException:a}=Vg(),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(r),[u,d]=(0,g.useState)(!1),f=qYt(e,t);(0,g.useEffect)(()=>{u||(s(``),l(r))},[u,r]);let p=n.split(`/`),m=p[p.length-2],h=p[p.length-1],_=async()=>{try{if(s(``),!c||c===r){s(`Select a new default branch.`);return}await f.mutateAsync({defaultBranch:c,sourceRepoUrl:n}),i(`project-update-default-branch-success`,{account:e}),d(!1)}catch(t){a(t);let n=Yj(t);s(n),i(`project-update-default-branch-failed`,{account:e,errorMessage:n})}};return(0,W.jsxs)(lV,{children:[(0,W.jsx)(uV,{children:`Default Branch`}),(0,W.jsxs)(pV,{className:`mt-1 text-sm`,children:[(0,W.jsx)(fV,{children:`The default branch is considered the “base” branch in your repository, against which all pull requests and code commits are automatically made. This is the branch used for your project's production deployments.`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(jV,{type:`text`,autoComplete:`off`,id:`default-branch-field`,value:r??`main`,disabled:!0,className:`max-w-52`,"data-test":`default-branch-field`}),(0,W.jsxs)(kA,{onOpenChange:e=>d(e),open:u,children:[(0,W.jsx)(AA,{children:(0,W.jsx)(Y,{type:`button`,"data-test":`update-default-branch`,variant:`outline`,children:`Update`})}),(0,W.jsxs)(MA,{children:[(0,W.jsx)(NA,{children:(0,W.jsx)(FA,{children:`Switch default branch to another branch`})}),(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(qR,{error:o}),(0,W.jsxs)(IA,{className:`text-foreground`,children:[`Choose another branch in`,` `,(0,W.jsxs)(oT,{href:n,children:[m,`/`,h]}),` `,`to use as the default branch of the project instead of`,` `,r,`.`,(0,W.jsx)(jV,{type:`text`,autoComplete:`off`,placeholder:`Type a branch name`,id:`default-branch-field`,className:`mt-4`,"data-test":`default-branch-field`,value:c,onChange:e=>l(e.target.value)})]})]}),(0,W.jsxs)(PA,{children:[(0,W.jsx)(jA,{children:(0,W.jsx)(Y,{"data-test":`cancel-update-default-branch-btn`,disabled:f.isPending,variant:`ghost`,children:`Cancel`})}),(0,W.jsx)(Y,{"data-test":`update-default-branch-btn`,type:`button`,onClick:_,disabled:f.isPending,variant:`outline`,children:(0,W.jsx)(Pk,{loading:f.isPending,alternative:`Updating...`,children:`Switch branch`})})]})]})]})]})]})]})},$Qt=({children:e})=>(0,W.jsx)(lV,{children:(0,W.jsxs)(pV,{className:`flex items-center gap-3 py-4`,children:[(0,W.jsx)(_re,{className:`size-5 text-muted-foreground shrink-0`}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e})]})}),e$t=()=>{let e=lh([`account`,`project`]),{logEvent:t}=Vg(),n=sZt();if((0,g.useEffect)(()=>{t(`source-control-settings-viewed`,{account:e.account.name,project:e.project.name})},[e.account.name,e.project.name,t]),!n.data)return(0,W.jsx)(VXt,{showHeader:!0});let r=yFe(e.account.name,n.data);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 md:gap-6 mb-6`,children:[(0,W.jsx)(E7,{title:`Source Control Settings`}),(0,W.jsxs)($Qt,{children:[`Learn more about deploying with source control in our`,` `,(0,W.jsx)(oT,{href:`https://zuplo.com/docs/articles/step-4-deploying-to-the-edge`,showIcon:!0,children:`documentation`}),`.`]}),e.project.sourceRepoUrl!==null&&(0,W.jsx)(QQt,{accountName:e.account.name,projectName:e.project.name,sourceRepoUrl:e.project.sourceRepoUrl,defaultBranch:e.project.defaultBranch??void 0}),(0,W.jsxs)(lV,{children:[(0,W.jsx)(uV,{children:`Connected Git Repository`}),(0,W.jsxs)(pV,{children:[(0,W.jsx)(fV,{children:`Seamlessly create Environments for every branch and deployments for any commits pushed to your Git repository.`}),(0,W.jsx)(oZt,{account:e.account,project:e.project,sourceControlConfig:r})]})]})]})},t$t=({connected:e,bucketId:t,bucketName:n})=>(0,W.jsxs)(mV,{variant:`muted`,className:`text-sm font-medium text-gray-600 h-12 col-span-full flex justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-center`,children:[`Connected to`,` `,e?.map(e=>(0,W.jsx)(YEt,{env:e,children:(0,W.jsx)(LS,{variant:`secondary`,className:`ml-2 capitalize`,children:(0,W.jsx)(JEt,{env:e})})},e))]}),(0,W.jsx)(`div`,{className:`flex gap-2`,children:(0,W.jsxs)(kX,{children:[(0,W.jsx)(AX,{asChild:!0,children:(0,W.jsxs)(PX,{size:`sm`,children:[(0,W.jsx)($re,{size:16}),` Bucket Details`]})}),(0,W.jsx)(jX,{align:`end`,className:`w-96`,children:(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`div`,{className:`text-xs text-gray-600`,children:`Bucket Name`}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`div`,{className:`text-xs font-mono truncate`,children:n||`N/A`}),n&&(0,W.jsx)(bQ,{textToCopy:n})]})]}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`div`,{className:`text-xs text-gray-600`,children:`Bucket ID`}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`div`,{className:`text-xs font-mono truncate`,children:t||`N/A`}),t&&(0,W.jsx)(bQ,{textToCopy:t})]})]})]})})]})})]}),n$t=({environments:e,name:t,id:n})=>{let{account:r,project:i}=Pj([`account`,`project`]);return(0,W.jsxs)(lV,{className:`grid grid-cols-subgrid col-span-full`,children:[(0,W.jsx)(uV,{className:`col-span-full`}),(0,W.jsxs)(pV,{className:`grid grid-cols-subgrid col-span-full`,children:[(0,W.jsxs)(`div`,{className:`flex flex-row gap-4 items-center`,children:[(0,W.jsxs)(`div`,{className:`flex p-1 items-center relative bg-indigo-200 text-indigo-500 border-indigo-500 rounded-lg border`,children:[(0,W.jsx)(Wm,{size:24,strokeWidth:1.25,absoluteStrokeWidth:!0}),(0,W.jsx)(Qre,{size:22,strokeWidth:1.25,fill:`#fff`,className:`absolute -right-2 -bottom-1.5`})]}),(0,W.jsxs)(`div`,{className:`flex flex-col`,children:[(0,W.jsx)(`div`,{className:`font-medium text-sm`,children:`API Key Service`}),(0,W.jsx)(`div`,{className:`text-sm`,children:`Contains API Keys for your users`})]})]}),(0,W.jsx)(`div`,{}),(0,W.jsx)(Y,{variant:`outline`,asChild:!0,className:`self-center`,children:(0,W.jsx)(Pr,{to:Ce(`/:account/:project/services/keys/:bucketId`,{bucketId:t,account:r,project:i}),"data-test":`service-${e?.join(`-`)}`,children:`Configure`})})]}),(0,W.jsx)(t$t,{connected:e,bucketId:n,bucketName:t})]})},B7=new Map,V7=e=>{let t=B7.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},r$t=(e,t,n)=>{if(e===void 0)return{type:`untracked`,connection:t.connect(n)};let r=B7.get(n.name);if(r)return{type:`tracked`,store:e,...r};let i={connection:t.connect(n),stores:{}};return B7.set(n.name,i),{type:`tracked`,store:e,...i}},i$t=(e,t={})=>(n,r,i)=>{let{enabled:a,anonymousActionType:o,store:s,...c}=t,l;try{l=(a??!0)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return e(n,r,i);let{connection:u,...d}=r$t(s,l,c),f=!0;i.setState=(e,t,a)=>{let l=n(e,t);if(!f)return l;let d=a===void 0?{type:o||`anonymous`}:typeof a==`string`?{type:a}:a;return s===void 0?(u?.send(d,r()),l):(u?.send({...d,type:`${s}/${d.type}`},{...V7(c.name),[s]:i.getState()}),l)};let p=(...e)=>{let t=f;f=!1,n(...e),f=t},m=e(i.setState,r,i);if(d.type===`untracked`?u?.init(m):(d.stores[d.store]=i,u?.init(Object.fromEntries(Object.entries(d.stores).map(([e,t])=>[e,e===d.store?m:t.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch==`function`){let e=!1,t=i.dispatch;i.dispatch=(...n)=>{n[0].type===`__setState`&&!e&&(console.warn(`[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.`),e=!0),t(...n)}}return u.subscribe(e=>{switch(e.type){case`ACTION`:if(typeof e.payload!=`string`){console.error(`[zustand devtools middleware] Unsupported action format`);return}return H7(e.payload,e=>{if(e.type===`__setState`){if(s===void 0){p(e.state);return}Object.keys(e.state).length!==1&&console.error(`
|
|
1657
1657
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
1658
1658
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
1659
1659
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
1660
|
-
`);let t=e.state[s];if(t==null)return;JSON.stringify(i.getState())!==JSON.stringify(t)&&p(t);return}i.dispatchFromDevtools&&typeof i.dispatch==`function`&&i.dispatch(e)});case`DISPATCH`:switch(e.payload.type){case`RESET`:return p(m),s===void 0?u?.init(i.getState()):u?.init(V7(c.name));case`COMMIT`:if(s===void 0){u?.init(i.getState());return}return u?.init(V7(c.name));case`ROLLBACK`:return H7(e.state,e=>{if(s===void 0){p(e),u?.init(i.getState());return}p(e[s]),u?.init(V7(c.name))});case`JUMP_TO_STATE`:case`JUMP_TO_ACTION`:return H7(e.state,e=>{if(s===void 0){p(e);return}JSON.stringify(i.getState())!==JSON.stringify(e[s])&&p(e[s])});case`IMPORT_STATE`:{let{nextLiftedState:t}=e.payload,n=t.computedStates.slice(-1)[0]?.state;if(!n)return;p(s===void 0?n:n[s]),u?.send(null,t);return}case`PAUSE_RECORDING`:return f=!f}return}}),m},H7=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){console.error(`[zustand devtools middleware] Could not parse the received json`,e)}n!==void 0&&t(n)};function i$t(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var U7=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return U7(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return U7(t)(e)}}}},a$t=dp()(r$t(((e,t)=>(n,r,i)=>{let a={storage:i$t(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=new Set,c=new Set,l=a.storage;if(!l)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let u=()=>{let e=a.partialize({...r()});return l.setItem(a.name,{state:e,version:a.version})},d=i.setState;i.setState=(e,t)=>{d(e,t),u()};let f=e((...e)=>{n(...e),u()},r,i);i.getInitialState=()=>f;let p,m=()=>{if(!l)return;o=!1,s.forEach(e=>e(r()??f));let e=a.onRehydrateStorage?.call(a,r()??f)||void 0;return U7(l.getItem.bind(l))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(e=>{let[t,i]=e;if(p=a.merge(i,r()??f),n(p,!0),t)return u()}).then(()=>{e?.(p,void 0),p=r(),o=!0,c.forEach(e=>e(p))}).catch(t=>{e?.(void 0,t)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(l=e.storage)},clearStorage:()=>{l?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},a.skipHydration||m(),p||f})(e=>({setEnvironment:t=>e(e=>({...e,environment:{...t,time:Date.now()}})),setAccount:t=>e(e=>({...e,account:{accountName:t,time:Date.now()}}))}),{name:`mru`}))),o$t=()=>{let e=Pj([]),{environment:t,setEnvironment:n}=a$t(),r=Qj(t?.accountName??``,t?.projectName??``,{enabled:!!t?.accountName&&!!t.projectName}).data?.find(e=>e.urlParameter===t?.environmentName);return e.account!==t?.accountName||e.project!==t?.projectName?{setEnvironment:n}:{setEnvironment:n,account:t?.accountName,project:t?.projectName,environment:r?t?.environmentName:void 0}};localStorage.removeItem(`MRU_DATA`);var s$t=()=>{let e=lh([`account`,`project`]),t=o$t(),n=Qj(e.account.name,e.project.name),r=YYt(),i=n.data?.find(e=>e.urlParameter===t.environment),a=r.data?.filter(e=>e.env===i?.environmentType)??[];return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 md:gap-6 mb-6`,children:[(0,W.jsx)(E7,{title:`API Key Consumer`}),(0,W.jsxs)(PS,{variant:`outline`,className:`text-sm`,children:[(0,W.jsx)(pre,{size:20}),(0,W.jsx)(FS,{children:`This page has moved`}),(0,W.jsx)(IS,{children:`API Key Consumers are stored in buckets. Each bucket is associated with one or more environments. You can find all API Key Services in the Services section.`})]}),a.length>0&&(0,W.jsx)(`div`,{className:`font-medium`,children:`Most recently used`}),a.map(e=>(0,W.jsx)(`div`,{className:`grid grid-cols-[1fr_1fr_8rem] gap-6`,children:(0,W.jsx)(t$t,{id:e.id,name:e.name,environments:[e.env]})},e.name)),(0,W.jsx)(Y,{variant:`outline`,className:`self-center`,asChild:!0,children:(0,W.jsx)(Pr,{to:`/${e.account.name}/${e.project.name}/services`,children:`Go to Services`})})]})},c$t=()=>{let{account:e,project:t}=Pj([`account`,`project`]);return(0,W.jsx)(Kn,{to:Ce(YR.Environments,{account:e,project:t})})},l$t=({to:e})=>(0,W.jsx)(Kn,{to:`/accounts/${lh([`account`]).account.name}/settings/${e}`,replace:!0}),u$t=[{key:`general`,group:`project-level`,icon:(0,W.jsx)(pie,{className:`w-4 h-4`}),name:`General`,view:(0,W.jsx)(AQt,{}),testID:`settings-general`},{key:`api-key-consumers`,group:`project-level`,icon:(0,W.jsx)(gre,{className:`w-4 h-4`}),name:`API Key Consumers`,view:(0,W.jsx)(s$t,{})},{key:`environment-variables`,group:`project-level`,icon:(0,W.jsx)(die,{className:`w-4 h-4`}),name:`Environment Variables`,view:(0,W.jsx)(TQt,{}),testID:`settings-environment-variables`},{key:`share-project`,group:`project-level`,icon:(0,W.jsx)(_ie,{className:`w-4 h-4`}),name:`Members & Access`,view:(0,W.jsx)(YQt,{}),testID:`settings-share-project`},{key:`source-control-settings`,group:`project-level`,icon:(0,W.jsx)(Rre,{className:`w-4 h-4`}),name:`Source Control`,view:(0,W.jsx)($Qt,{}),testID:`settings-source-control-settings`},{key:`custom-domain`,group:`project-level`,icon:(0,W.jsx)(Ure,{className:`w-4 h-4`}),name:`Custom Domains`,view:(0,W.jsx)(dQt,{}),testID:`settings-custom-domain`},{key:`upgrade-billing`,group:`account-level`,icon:(0,W.jsx)(wm,{className:`w-4 h-4`}),name:`Billing`,view:(0,W.jsx)(l$t,{to:`upgrade-billing`}),redirect:!0,testID:`settings-upgrade-billing`},{key:`environments`,group:`account-level`,redirect:!0,icon:(0,W.jsx)(Vm,{className:`h-4 w-4`}),name:`Environments`,view:(0,W.jsx)(c$t,{}),testID:`settings-environments`},{key:`zuplo-api-keys`,group:`account-level`,redirect:!0,icon:(0,W.jsx)(Wm,{className:`w-4 h-4`}),name:`Zuplo API Keys`,view:(0,W.jsx)(l$t,{to:`api-keys`}),testID:`settings-zuplo-api-keys`}],d$t=({account:e,project:t,environment:n,navigateTo:r})=>!e||!t||!n?null:(0,W.jsx)(X1,{heading:`Settings`,children:u$t.map(n=>(0,W.jsxs)(Z1,{onSelect:()=>r(Ce(`${YR.Settings}/${n.key}`,{account:e,project:t})),children:[n.icon,(0,W.jsx)(`span`,{className:`ml-3`,children:n.name})]},n.key))}),f$t=(e,t,n)=>{let[r=e,...i]=n??[],a=R1(r,t);return a>0?1+a:i.reduce((e,n)=>Math.max(e,R1(n,t)),0)},W7=({path:e,children:t,navigateTo:n,...r})=>(0,W.jsxs)(Z1,{onSelect:()=>n(Ce(e,r)),children:[(0,W.jsx)(`div`,{className:`mr-2`,children:t??(0,W.jsx)(fre,{className:` h-4 w-4`})}),(0,W.jsx)(`span`,{children:Object.entries(YR).find(([,t])=>t===e)?.at(0)})]});function p$t(){let{isAuthenticated:e}=Lg(),t=fZt(),{account:n,project:r,environment:i}=On(),a=Tn(),o=n&&r&&i,s={account:n,project:r,environment:i},[c,l]=(0,g.useState)(``),u=pZt({enabled:e});VYt(e?u.data?.map(e=>e.name)??[]:[]);let[d,f]=(0,g.useState)(!1);OQ(`meta+k`,()=>{f(!0)});let p=e=>{f(e),e||l(``)},m=e=>{a(e),p(!1)};return(0,W.jsxs)(GEt,{open:d,onOpenChange:p,filter:f$t,children:[(0,W.jsx)(q1,{placeholder:`What do you want to do?`,onValueChange:l,className:`text-md`}),(0,W.jsxs)(J1,{children:[(0,W.jsx)(Y1,{children:(0,W.jsxs)(`div`,{className:`text-muted-foreground my-3`,children:[`No results found "`,c,`".`]})}),o&&(0,W.jsx)(bZt,{navigateTo:m,account:n,project:r,environment:i}),n&&r&&i&&(0,W.jsx)(d$t,{navigateTo:m,...s}),(0,W.jsx)(yZt,{navigateTo:m,accounts:u.data,search:c}),(0,W.jsxs)(X1,{title:t.shortName,children:[(0,W.jsx)(W7,{path:YR.Profile,navigateTo:m,children:(0,W.jsx)(gie,{})}),(0,W.jsx)(W7,{path:YR.Logout,navigateTo:m,children:(0,W.jsx)(qre,{})}),n&&r&&(0,W.jsx)(W7,{path:YR.Settings,navigateTo:m,account:n,project:r,children:(0,W.jsx)(sie,{})}),n&&(0,W.jsx)(W7,{path:YR.AccountSettings,navigateTo:m,account:n,children:(0,W.jsx)(sie,{})})]})]})]})}var m$t=Date.now(),h$t=300*1e3,g$t=14400*1e3,_$t=1440*60*1e3,v$t=async e=>{try{let t=await fetch(e,{method:`HEAD`,cache:`no-cache`});if(!t.ok)return!1;let n=t.headers.get(`date`),r=t.headers.get(`last-modified`);if(!n||!r)return!1;let i=new Date(n).getTime(),a=new Date(r).getTime();if(Number.isNaN(i)||Number.isNaN(a))return!1;let o=i-a>=_$t;return a>m$t&&i>m$t&&o}catch{return!1}},y$t=({enabled:e})=>{let t=(0,g.useRef)(0),n=Bg(),{data:r}=C_({enabled:e,refetchInterval:h$t,refetchIntervalInBackground:!1,networkMode:`online`,retry:!1,queryFn:async()=>{let e=await v$t(window.location.href),r=Date.now();return e&&r-t.current>=g$t?(t.current=r,n.capture(`show-update-toast`),!0):!1},queryKey:[`update-check`]});return(0,W.jsxs)(rh,{open:r??!1,duration:1/0,className:`data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp`,children:[(0,W.jsxs)(Cie,{children:[(0,W.jsx)(ah,{children:`Update available`}),(0,W.jsx)(oh,{children:`A new version of the Zuplo Portal is available. Click to reload.`})]}),(0,W.jsx)(Tie,{altText:`Reload`,children:(0,W.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),children:`Reload`})}),(0,W.jsx)(ih,{})]})},b$t=({enableUpdateNotifications:e})=>(0,W.jsx)(PKe,{children:(0,W.jsxs)(xie,{children:[(0,W.jsx)(y$t,{enabled:e}),(0,W.jsx)(p$t,{}),(0,W.jsx)(Eie,{}),(0,W.jsx)(qn,{}),(0,W.jsx)(Sie,{})]})});function x$t(){return(0,W.jsx)(`div`,{className:`m-auto`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 my-5`,children:[(0,W.jsx)(`div`,{children:(0,W.jsx)(LS,{variant:`outline`,children:`404`})}),(0,W.jsx)(`span`,{className:`text-2xl font-medium`,children:`Oops! Page not found.`}),(0,W.jsx)(`span`,{children:`Sorry, we could not find the page you were looking for.`}),(0,W.jsx)(`div`,{className:`h-2`}),(0,W.jsx)(nye,{hasGoHome:!0})]})})}var S$t=()=>{let{environment:e}=Pj([`environment`]),[t,n]=(0,g.useState)(null),r=dh(e=>e.updateFile),i=dh(e=>e.filesByPath);return{conflict:t,checkForConflictsBeforeSave:(0,g.useCallback)(async(t,r)=>{let a=i[t];try{let i=await np(e,t);return a.lastModified&&i.lastModified&&i.lastModified>a.lastModified?(jf.warn(`File ${t} was modified on disk. Showing conflict dialog before save.`),new Promise(e=>{n({filePath:t,localContent:a.content??``,remoteContent:i.content??``,remoteLastModified:i.lastModified,onProceed:async()=>{await r(),e(!0)}})})):(await r(),!0)}catch(e){return jf.error(`Error checking for conflicts`,{error:e}),await r(),!0}},[e,i]),showConflict:(0,g.useCallback)(e=>{jf.info(`Showing conflict dialog for ${e.filePath}`),n(e)},[]),resolveConflict:(0,g.useCallback)(async a=>{if(!t)return;let o=i[t.filePath];if(!o){n(null);return}if(a===`remote`)r({...o,content:t.remoteContent,lastModified:t.remoteLastModified,saveState:ei.unmodified}),jf.info(`Using disk version for ${t.filePath}, canceling save`),n(null);else if(jf.info(`User chose local version for ${t.filePath}${t.onProceed?`, proceeding with save`:`, saving to disk`}`),t.onProceed)await t.onProceed(),n(null);else try{await ip(e,{path:o.path,content:o.content},{forceSave:!0});let i=await np(e,t.filePath);r({...o,lastModified:i.lastModified,saveState:ei.unmodified}),jf.info(`Successfully saved local version for ${t.filePath}`),n(null)}catch(e){jf.error(`Error saving local version for ${t.filePath}`,{error:e}),r({...o,saveState:ei.modified})}},[t,i,r,e]),cancelConflict:(0,g.useCallback)(async()=>{if(!t)return;let a=i[t.filePath];if(a){let n=await np(e,t.filePath);r({...a,lastModified:n.lastModified,saveState:ei.modified}),jf.info(`Conflict dialog canceled for ${t.filePath}, file marked as modified`)}n(null)},[t,i,r,e])}};function C$t({open:e,filePath:t,localContent:n,remoteContent:r,onResolve:i,onCancel:a}){let[o,s]=(0,g.useState)(`local`),c=Ej(t);return(0,W.jsx)(kA,{open:e,onOpenChange:e=>!e&&a(),children:(0,W.jsxs)(MA,{className:`max-w-7xl max-h-[90vh] p-0`,showCloseButton:!1,children:[(0,W.jsx)(`div`,{className:`p-6 pb-0`,children:(0,W.jsxs)(NA,{children:[(0,W.jsx)(FA,{className:`text-lg font-semibold text-left mb-1`,children:`File Conflict Detected`}),(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground text-left`,children:[(0,W.jsx)(`span`,{className:`font-mono font-semibold`,children:t}),` has been modified both locally and on disk`]})]})}),(0,W.jsxs)(`div`,{className:`flex-1 min-h-0 flex flex-col px-6`,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-2`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`flex flex-col py-3 cursor-pointer transition-all border-t-4 border-x ${o===`local`?`border-t-pink-500 border-x-pink-200 bg-pink-50`:`border-t-border border-x-border bg-gray-50 dark:bg-neutral-900 hover:bg-gray-100 dark:hover:bg-neutral-800`}`,style:{paddingLeft:`26px`,paddingRight:`24px`},onClick:()=>s(`local`),"aria-pressed":o===`local`,children:[(0,W.jsx)(`div`,{className:`font-semibold text-sm`,children:`Browser Version`}),(0,W.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Current editor content`})]}),(0,W.jsxs)(`button`,{type:`button`,className:`flex flex-col px-6 py-3 cursor-pointer transition-all border-t-4 border-x ${o===`remote`?`border-t-pink-500 border-x-pink-200 bg-pink-50`:`border-t-border border-x-border bg-gray-50 dark:bg-neutral-900 hover:bg-gray-100 dark:hover:bg-neutral-800`}`,onClick:()=>s(`remote`),"aria-pressed":o===`remote`,children:[(0,W.jsx)(`div`,{className:`font-semibold text-sm`,children:`Disk Version`}),(0,W.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`File on disk`})]})]}),(0,W.jsx)(`div`,{className:`border border-t-0 overflow-hidden shadow-xs flex-1 min-h-[55vh]`,children:(0,W.jsx)(CP,{original:n,modified:r,language:c,options:{readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,wordWrap:`off`}})})]}),(0,W.jsxs)(PA,{className:`px-6 pb-6 flex-row justify-between items-center`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o===`local`?(0,W.jsx)(W.Fragment,{children:`Browser version will be saved to disk`}):(0,W.jsx)(W.Fragment,{children:`Disk version will replace browser content`})}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(Y,{variant:`ghost`,onClick:a,children:`Cancel`}),(0,W.jsxs)(Y,{variant:`default`,onClick:()=>i(o),children:[`Apply `,o===`local`?`Browser`:`Disk`,` Version`]})]})]})]})})}function w$t(){let{environment:e}=Pj([`environment`]),{conflict:t,showConflict:n,resolveConflict:r,cancelConflict:i}=S$t(),a=dh(e=>e.filesByPath),o=dh(e=>e.saveConflictPath),s=dh(e=>e.clearSaveConflict);return(0,g.useEffect)(()=>{if(o){jf.info(`Save conflict detected for ${o}`);let t=a[o];t?np(e,o).then(e=>{n({filePath:o,localContent:t.content??``,remoteContent:e.content??``,remoteLastModified:e.lastModified})}).catch(e=>{jf.error(`Error fetching file for conflict dialog`,{error:e})}):jf.warn(`No file model found for ${o}`),s()}},[o,a,s,n,e]),t?(0,W.jsx)(C$t,{open:!0,filePath:t.filePath,localContent:t.localContent,remoteContent:t.remoteContent,onResolve:r,onCancel:i}):null}var T$t=()=>{let e=lh(),{monaco:t,reloadFiles:n}=C1(),r=zA(n.execute),i=e.environment.name,{error:a}=C_({queryKey:[`reloadFiles`,e.account.name,e.project.name,i],queryFn:async()=>{try{return await r.current({accountName:e.account.name,projectName:e.project.name,environmentName:e.environment.name}),!0}catch(e){throw jf.error(`Failed to reload files`,{error:e}),e}},refetchOnWindowFocus:!1,enabled:!!t&&!!i,retry:3,retryDelay:e=>Math.min(1e3*2**e,3e4)});return a?(0,W.jsx)(`div`,{className:`flex items-center justify-center h-full bg-gray-50`,children:(0,W.jsxs)(`div`,{className:`text-center p-8 max-w-lg`,children:[(0,W.jsx)(`h2`,{className:`text-xl font-semibold text-gray-900 mb-2`,children:`Failed to Load Files`}),(0,W.jsx)(`p`,{className:`text-gray-600 mb-4`,children:`Unable to load project files from the local server. Please check that the dev server is running and try again.`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`px-4 py-2 bg-blue-600 text-white rounded-sm hover:bg-blue-700`,children:`Retry`})]})}):null},E$t=()=>{let{account:e,project:t}=Pj([`account`,`project`]),n=dh(e=>e.resetStore);return(0,g.useEffect)(()=>{n()},[t,e,n]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(T$t,{}),(0,W.jsx)(w$t,{}),(0,W.jsx)(jTt,{}),(0,W.jsx)(qn,{})]})};g.createContext({en:{translations:{archiveNotification:`Archive this notification`,archiveRead:`Archive Read`,markAllAsRead:`Mark all as read`,notifications:`Notifications`,emptyFeedTitle:`No notifications yet`,emptyFeedBody:`We'll let you know when we've got something new for you.`,all:`All`,unread:`Unread`,read:`Read`,unseen:`Unseen`,msTeamsChannelSetError:`Error setting channel.`,msTeamsConnect:`Connect to Microsoft Teams`,msTeamsConnected:`Connected`,msTeamsConnecting:`Connecting to Microsoft Teams…`,msTeamsConnectionErrorExists:`Try reconnecting to Microsoft Teams to find and select channels from your teams.`,msTeamsConnectionErrorOccurred:`There was an error connecting to Microsoft Teams. Try reconnecting to find and select channels from your teams.`,msTeamsConnectContainerDescription:`Connect to get notifications in Microsoft Teams`,msTeamsDisconnect:`Disconnect`,msTeamsDisconnecting:`Disconnecting from Microsoft Teams…`,msTeamsError:`Error`,msTeamsReconnect:`Reconnect`,msTeamsTenantIdNotSet:`Microsoft Teams tenant ID not set.`,slackConnectChannel:`Connect channel`,slackChannelId:`Slack channel ID`,slackConnecting:`Connecting to Slack...`,slackDisconnecting:`Disconnecting...`,slackConnect:`Connect to Slack`,slackConnected:`Connected`,slackConnectContainerDescription:`Connect to get notifications in your Slack workspace.`,slackSearchbarDisconnected:`Slack is not connected.`,slackSearchbarNoChannelsConnected:`Search channels`,slackSearchbarNoChannelsFound:`No slack channels.`,slackSearchbarChannelsError:`Error fetching channels.`,slackSearchChannels:`Search channels`,slackConnectionErrorExists:`Try reconnecting to Slack to find and select channels from your workspace.`,slackConnectionErrorOccurred:`There was an error connecting to Slack. Try reconnecting to find and select channels from your workspace.`,slackChannelAlreadyConnected:`Error: already connected`,slackError:`Error`,slackDisconnect:`Disconnect`,slackChannelSetError:`Error setting channel.`,slackAccessTokenNotSet:`Access token not set.`,slackReconnect:`Reconnect`},locale:`en`},de:{translations:{archiveNotification:`Benachrichtigung archivieren`,archiveRead:`Gelesenes Archivieren`,markAllAsRead:`Alle als gelesen markieren`,notifications:`Benachrichtigungen`,emptyFeedTitle:`Noch keine Benachrichtigungen`,emptyFeedBody:`Wir werden dich benachrichtigen, sobald wir etwas Neues für dich haben.`,all:`Alle`,unread:`Ungelesen`,read:`Gelesen`,unseen:`Ungesehen`,slackConnectChannel:`Kanal verbinden`,slackChannelId:`Slack Kanal ID`,slackConnecting:`Verbinden mit Slack...`,slackDisconnecting:`Trennen der Verbindung...`,slackConnect:`Mit Slack verbinden`,slackConnected:`Verbunden`,slackConnectContainerDescription:`Verbinden, um Benachrichtigungen in Ihrem Slack-Arbeitsbereich zu erhalten.`,slackSearchbarDisconnected:`Slack ist nicht verbunden.`,slackSearchbarNoChannelsConnected:`Suchkanäle`,slackSearchbarNoChannelsFound:`Keine schlaffen Kanäle.`,slackSearchbarChannelsError:`Fehler beim Abrufen von Kanälen.`,slackSearchChannels:`Suchkanäle`,slackConnectionErrorExists:`Versuchen Sie, sich erneut mit Slack zu verbinden, um Kanäle in Ihrem Arbeitsbereich zu finden und auszuwählen.`,slackConnectionErrorOccurred:`Es ist ein Fehler beim Verbinden mit Slack aufgetreten. Versuchen Sie, sich erneut zu verbinden, um Kanäle in Ihrem Arbeitsbereich zu finden und auszuwählen.`,slackChannelAlreadyConnected:`Fehler: bereits verbunden`,slackError:`Fehler`,slackDisconnect:`Trennen Sie die Verbindung.`,slackChannelSetError:`Fehlereinstellung Kanal.`,slackAccessTokenNotSet:`Zugriffstoken nicht gesetzt.`,slackReconnect:`Neu verbinden`},locale:`de`}}.en),i(((e,t)=>{(function(n){var r=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(e){return Object.prototype.toString.call(e)===`[object Array]`},a=10,o=typeof process==`object`&&typeof process.nextTick==`function`,s=typeof Symbol==`function`,c=typeof Reflect==`object`,l=typeof setImmediate==`function`?setImmediate:setTimeout,u=s?c&&typeof Reflect.ownKeys==`function`?Reflect.ownKeys:function(e){var t=Object.getOwnPropertyNames(e);return t.push.apply(t,Object.getOwnPropertySymbols(e)),t}:Object.keys;function d(){this._events={},this._conf&&f.call(this,this._conf)}function f(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners!==n&&(this._maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(e,t){var n=`(node) warning: possible EventEmitter memory leak detected. `+e+` listeners added. Use emitter.setMaxListeners() to increase limit.`;if(this.verboseMemoryLeak&&(n+=` Event name: `+t+`.`),typeof process<`u`&&process.emitWarning){var r=Error(n);r.name=`MaxListenersExceededWarning`,r.emitter=this,r.count=e,process.emitWarning(r)}else console.error(n),console.trace&&console.trace()}var m=function(e,t,n){var r=arguments.length;switch(r){case 0:return[];case 1:return[e];case 2:return[e,t];case 3:return[e,t,n];default:for(var i=Array(r);r--;)i[r]=arguments[r];return i}};function h(e,t){for(var r={},i,a=e.length,o=t?t.length:0,s=0;s<a;s++)i=e[s],r[i]=s<o?t[s]:n;return r}function g(e,t,n){this._emitter=e,this._target=t,this._listeners={},this._listenersCount=0;var r,i;if((n.on||n.off)&&(r=n.on,i=n.off),t.addEventListener?(r=t.addEventListener,i=t.removeEventListener):t.addListener?(r=t.addListener,i=t.removeListener):t.on&&(r=t.on,i=t.off),!r&&!i)throw Error(`target does not implement any known event API`);if(typeof r!=`function`)throw TypeError(`on method must be a function`);if(typeof i!=`function`)throw TypeError(`off method must be a function`);this._on=r,this._off=i;var a=e._observers;a?a.push(this):e._observers=[this]}Object.assign(g.prototype,{subscribe:function(e,t,n){var r=this,i=this._target,a=this._emitter,o=this._listeners,s=function(){var r=m.apply(null,arguments),o={data:r,name:t,original:e};if(n){n.call(i,o)!==!1&&a.emit.apply(a,[o.name].concat(r));return}a.emit.apply(a,[t].concat(r))};if(o[e])throw Error(`Event '`+e+`' is already listening`);this._listenersCount++,a._newListener&&a._removeListener&&!r._onNewListener?(this._onNewListener=function(n){n===t&&o[e]===null&&(o[e]=s,r._on.call(i,e,s))},a.on(`newListener`,this._onNewListener),this._onRemoveListener=function(n){n===t&&!a.hasListeners(n)&&o[e]&&(o[e]=null,r._off.call(i,e,s))},o[e]=null,a.on(`removeListener`,this._onRemoveListener)):(o[e]=s,r._on.call(i,e,s))},unsubscribe:function(e){var t=this,n=this._listeners,r=this._emitter,i,a,o=this._off,s=this._target,c;if(e&&typeof e!=`string`)throw TypeError(`event must be a string`);function l(){t._onNewListener&&(r.off(`newListener`,t._onNewListener),r.off(`removeListener`,t._onRemoveListener),t._onNewListener=null,t._onRemoveListener=null);var e=C.call(r,t);r._observers.splice(e,1)}if(e){if(i=n[e],!i)return;o.call(s,e,i),delete n[e],--this._listenersCount||l()}else{for(a=u(n),c=a.length;c-- >0;)e=a[c],o.call(s,e,n[e]);this._listeners={},this._listenersCount=0,l()}}});function _(e,t,i,a){var o=Object.assign({},t);if(!e)return o;if(typeof e!=`object`)throw TypeError(`options must be an object`);var s=Object.keys(e),c=s.length,l,u,d;function f(e){throw Error(`Invalid "`+l+`" option value`+(e?`. Reason: `+e:``))}for(var p=0;p<c;p++){if(l=s[p],!a&&!r.call(t,l))throw Error(`Unknown "`+l+`" option`);u=e[l],u!==n&&(d=i[l],o[l]=d?d(u,f):u)}return o}function v(e,t){return(typeof e!=`function`||!e.hasOwnProperty(`prototype`))&&t(`value must be a constructor`),e}function y(e){var t=`value must be type of `+e.join(`|`),n=e.length,r=e[0],i=e[1];return n===1?function(e,n){if(typeof e===r)return e;n(t)}:n===2?function(e,n){var a=typeof e;if(a===r||a===i)return e;n(t)}:function(r,i){for(var a=typeof r,o=n;o-- >0;)if(a===e[o])return r;i(t)}}var b=y([`function`]),x=y([`object`,`function`]);function S(e,t,n){var r,i,a=0,o,s=new e(function(c,l,u){n=_(n,{timeout:0,overload:!1},{timeout:function(e,t){return e*=1,(typeof e!=`number`||e<0||!Number.isFinite(e))&&t(`timeout must be a positive number`),e}}),r=!n.overload&&typeof e.prototype.cancel==`function`&&typeof u==`function`;function d(){i&&=null,a&&=(clearTimeout(a),0)}var f=function(e){d(),c(e)},p=function(e){d(),l(e)};r?t(f,p,u):(i=[function(e){p(e||Error(`canceled`))}],t(f,p,function(e){if(o)throw Error(`Unable to subscribe on cancel event asynchronously`);if(typeof e!=`function`)throw TypeError(`onCancel callback must be a function`);i.push(e)}),o=!0),n.timeout>0&&(a=setTimeout(function(){var e=Error(`timeout`);e.code=`ETIMEDOUT`,a=0,s.cancel(e),l(e)},n.timeout))});return r||(s.cancel=function(e){if(i){for(var t=i.length,n=1;n<t;n++)i[n](e);i[0](e),i=null}}),s}function C(e){var t=this._observers;if(!t)return-1;for(var n=t.length,r=0;r<n;r++)if(t[r]._target===e)return r;return-1}function w(e,t,n,r,i){if(!n)return null;if(r===0){var a=typeof t;if(a===`string`){var o,s,c=0,l=0,d=this.delimiter,f=d.length;if((s=t.indexOf(d))!==-1){o=[,,,,,];do o[c++]=t.slice(l,s),l=s+f;while((s=t.indexOf(d,l))!==-1);o[c++]=t.slice(l),t=o,i=c}else t=[t],i=1}else a===`object`?i=t.length:(t=[t],i=1)}var p=null,m,h,g,_,v,y=t[r],b=t[r+1],x,S;if(r===i)n._listeners&&(typeof n._listeners==`function`?(e&&e.push(n._listeners),p=[n]):(e&&e.push.apply(e,n._listeners),p=[n]));else if(y===`*`){for(x=u(n),s=x.length;s-- >0;)m=x[s],m!==`_listeners`&&(S=w(e,t,n[m],r+1,i),S&&(p?p.push.apply(p,S):p=S));return p}else if(y===`**`){for(v=r+1===i||r+2===i&&b===`*`,v&&n._listeners&&(p=w(e,t,n,i,i)),x=u(n),s=x.length;s-- >0;)m=x[s],m!==`_listeners`&&(m===`*`||m===`**`?(n[m]._listeners&&!v&&(S=w(e,t,n[m],i,i),S&&(p?p.push.apply(p,S):p=S)),S=w(e,t,n[m],r,i)):S=m===b?w(e,t,n[m],r+2,i):w(e,t,n[m],r,i),S&&(p?p.push.apply(p,S):p=S));return p}else n[y]&&(p=w(e,t,n[y],r+1,i));if(h=n[`*`],h&&w(e,t,h,r+1,i),g=n[`**`],g)if(r<i)for(g._listeners&&w(e,t,g,i,i),x=u(g),s=x.length;s-- >0;)m=x[s],m!==`_listeners`&&(m===b?w(e,t,g[m],r+2,i):m===y?w(e,t,g[m],r+1,i):(_={},_[m]=g[m],w(e,t,{"**":_},r+1,i)));else g._listeners?w(e,t,g,i,i):g[`*`]&&g[`*`]._listeners&&w(e,t,g[`*`],i,i);return p}function T(e,t,n){var r=0,i=0,a,o=this.delimiter,s=o.length,c;if(typeof e==`string`)if((a=e.indexOf(o))!==-1){c=[,,,,,];do c[r++]=e.slice(i,a),i=a+s;while((a=e.indexOf(o,i))!==-1);c[r++]=e.slice(i)}else c=[e],r=1;else c=e,r=e.length;if(r>1){for(a=0;a+1<r;a++)if(c[a]===`**`&&c[a+1]===`**`)return}var l=this.listenerTree,u;for(a=0;a<r;a++)if(u=c[a],l=l[u]||(l[u]={}),a===r-1)return l._listeners?(typeof l._listeners==`function`&&(l._listeners=[l._listeners]),n?l._listeners.unshift(t):l._listeners.push(t),!l._listeners.warned&&this._maxListeners>0&&l._listeners.length>this._maxListeners&&(l._listeners.warned=!0,p.call(this,l._listeners.length,u))):l._listeners=t,!0;return!0}function E(e,t,n,r){for(var i=u(e),a=i.length,o,s,c,l=e._listeners,d;a-- >0;)s=i[a],o=e[s],c=s===`_listeners`?n:n?n.concat(s):[s],d=r||typeof s==`symbol`,l&&t.push(d?c:c.join(this.delimiter)),typeof o==`object`&&E.call(this,o,t,c,d);return t}function D(e){for(var t=u(e),n=t.length,r,i,a;n-- >0;)i=t[n],r=e[i],r&&(a=!0,i!==`_listeners`&&!D(r)&&delete e[i]);return a}function O(e,t,n){this.emitter=e,this.event=t,this.listener=n}O.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function k(e,t,r){if(r===!0)a=!0;else if(r===!1)i=!0;else{if(!r||typeof r!=`object`)throw TypeError(`options should be an object or true`);var i=r.async,a=r.promisify,s=r.nextTick,c=r.objectify}if(i||s||a){var u=t,d=t._origin||t;if(s&&!o)throw Error(`process.nextTick is not supported`);a===n&&(a=t.constructor.name===`AsyncFunction`),t=function(){var e=arguments,t=this,n=this.event;return a?s?Promise.resolve():new Promise(function(e){l(e)}).then(function(){return t.event=n,u.apply(t,e)}):(s?process.nextTick:l)(function(){t.event=n,u.apply(t,e)})},t._async=!0,t._origin=d}return[t,c?new O(this,e,t):this]}function A(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,f.call(this,e)}A.EventEmitter2=A,A.prototype.listenTo=function(e,t,r){if(typeof e!=`object`)throw TypeError(`target musts be an object`);var a=this;r=_(r,{on:n,off:n,reducers:n},{on:b,off:b,reducers:x});function o(t){if(typeof t!=`object`)throw TypeError(`events must be an object`);for(var n=r.reducers,i=C.call(a,e),o=i===-1?new g(a,e,r):a._observers[i],s=u(t),c=s.length,l,d=typeof n==`function`,f=0;f<c;f++)l=s[f],o.subscribe(l,t[l]||l,d?n:n&&n[l])}return i(t)?o(h(t)):o(typeof t==`string`?h(t.split(/\s+/)):t),this},A.prototype.stopListeningTo=function(e,t){var n=this._observers;if(!n)return!1;var r=n.length,i,a=!1;if(e&&typeof e!=`object`)throw TypeError(`target should be an object`);for(;r-- >0;)i=n[r],(!e||i._target===e)&&(i.unsubscribe(t),a=!0);return a},A.prototype.delimiter=`.`,A.prototype.setMaxListeners=function(e){e!==n&&(this._maxListeners=e,this._conf||={},this._conf.maxListeners=e)},A.prototype.getMaxListeners=function(){return this._maxListeners},A.prototype.event=``,A.prototype.once=function(e,t,n){return this._once(e,t,!1,n)},A.prototype.prependOnceListener=function(e,t,n){return this._once(e,t,!0,n)},A.prototype._once=function(e,t,n,r){return this._many(e,1,t,n,r)},A.prototype.many=function(e,t,n,r){return this._many(e,t,n,!1,r)},A.prototype.prependMany=function(e,t,n,r){return this._many(e,t,n,!0,r)},A.prototype._many=function(e,t,n,r,i){var a=this;if(typeof n!=`function`)throw Error(`many only accepts instances of Function`);function o(){return--t===0&&a.off(e,o),n.apply(this,arguments)}return o._origin=n,this._on(e,o,r,i)},A.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var e=arguments[0],t,n=this.wildcard,r,i,a,o,c;if(e===`newListener`&&!this._newListener&&!this._events.newListener)return!1;if(n&&(t=e,e!==`newListener`&&e!==`removeListener`&&typeof e==`object`)){if(i=e.length,s){for(a=0;a<i;a++)if(typeof e[a]==`symbol`){c=!0;break}}c||(e=e.join(this.delimiter))}var l=arguments.length,u;if(this._all&&this._all.length)for(u=this._all.slice(),a=0,i=u.length;a<i;a++)switch(this.event=e,l){case 1:u[a].call(this,e);break;case 2:u[a].call(this,e,arguments[1]);break;case 3:u[a].call(this,e,arguments[1],arguments[2]);break;default:u[a].apply(this,arguments)}if(n)u=[],w.call(this,u,t,this.listenerTree,0,i);else if(u=this._events[e],typeof u==`function`){switch(this.event=e,l){case 1:u.call(this);break;case 2:u.call(this,arguments[1]);break;case 3:u.call(this,arguments[1],arguments[2]);break;default:for(r=Array(l-1),o=1;o<l;o++)r[o-1]=arguments[o];u.apply(this,r)}return!0}else u&&=u.slice();if(u&&u.length){if(l>3)for(r=Array(l-1),o=1;o<l;o++)r[o-1]=arguments[o];for(a=0,i=u.length;a<i;a++)switch(this.event=e,l){case 1:u[a].call(this);break;case 2:u[a].call(this,arguments[1]);break;case 3:u[a].call(this,arguments[1],arguments[2]);break;default:u[a].apply(this,r)}return!0}else if(!this.ignoreErrors&&!this._all&&e===`error`)throw arguments[1]instanceof Error?arguments[1]:Error(`Uncaught, unspecified 'error' event.`);return!!this._all},A.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var e=arguments[0],t=this.wildcard,n,r,i,a,o,c;if(e===`newListener`&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(t&&(n=e,e!==`newListener`&&e!==`removeListener`&&typeof e==`object`)){if(a=e.length,s){for(o=0;o<a;o++)if(typeof e[o]==`symbol`){r=!0;break}}r||(e=e.join(this.delimiter))}var l=[],u=arguments.length,f;if(this._all)for(o=0,a=this._all.length;o<a;o++)switch(this.event=e,u){case 1:l.push(this._all[o].call(this,e));break;case 2:l.push(this._all[o].call(this,e,arguments[1]));break;case 3:l.push(this._all[o].call(this,e,arguments[1],arguments[2]));break;default:l.push(this._all[o].apply(this,arguments))}if(t?(f=[],w.call(this,f,n,this.listenerTree,0)):f=this._events[e],typeof f==`function`)switch(this.event=e,u){case 1:l.push(f.call(this));break;case 2:l.push(f.call(this,arguments[1]));break;case 3:l.push(f.call(this,arguments[1],arguments[2]));break;default:for(i=Array(u-1),c=1;c<u;c++)i[c-1]=arguments[c];l.push(f.apply(this,i))}else if(f&&f.length){if(f=f.slice(),u>3)for(i=Array(u-1),c=1;c<u;c++)i[c-1]=arguments[c];for(o=0,a=f.length;o<a;o++)switch(this.event=e,u){case 1:l.push(f[o].call(this));break;case 2:l.push(f[o].call(this,arguments[1]));break;case 3:l.push(f[o].call(this,arguments[1],arguments[2]));break;default:l.push(f[o].apply(this,i))}}else if(!this.ignoreErrors&&!this._all&&e===`error`)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject(`Uncaught, unspecified 'error' event.`);return Promise.all(l)},A.prototype.on=function(e,t,n){return this._on(e,t,!1,n)},A.prototype.prependListener=function(e,t,n){return this._on(e,t,!0,n)},A.prototype.onAny=function(e){return this._onAny(e,!1)},A.prototype.prependAny=function(e){return this._onAny(e,!0)},A.prototype.addListener=A.prototype.on,A.prototype._onAny=function(e,t){if(typeof e!=`function`)throw Error(`onAny only accepts instances of Function`);return this._all||=[],t?this._all.unshift(e):this._all.push(e),this},A.prototype._on=function(e,t,r,i){if(typeof e==`function`)return this._onAny(e,t),this;if(typeof t!=`function`)throw Error(`on only accepts instances of Function`);this._events||d.call(this);var a=this,o;return i!==n&&(o=k.call(this,e,t,i),t=o[0],a=o[1]),this._newListener&&this.emit(`newListener`,e,t),this.wildcard?(T.call(this,e,t,r),a):(this._events[e]?(typeof this._events[e]==`function`&&(this._events[e]=[this._events[e]]),r?this._events[e].unshift(t):this._events[e].push(t),!this._events[e].warned&&this._maxListeners>0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,p.call(this,this._events[e].length,e))):this._events[e]=t,a)},A.prototype.off=function(e,t){if(typeof t!=`function`)throw Error(`removeListener only takes instances of Function`);var n,r=[];if(this.wildcard){var a=typeof e==`string`?e.split(this.delimiter):e.slice();if(r=w.call(this,null,a,this.listenerTree,0),!r)return this}else{if(!this._events[e])return this;n=this._events[e],r.push({_listeners:n})}for(var o=0;o<r.length;o++){var s=r[o];if(n=s._listeners,i(n)){for(var c=-1,l=0,u=n.length;l<u;l++)if(n[l]===t||n[l].listener&&n[l].listener===t||n[l]._origin&&n[l]._origin===t){c=l;break}if(c<0)continue;return this.wildcard?s._listeners.splice(c,1):this._events[e].splice(c,1),n.length===0&&(this.wildcard?delete s._listeners:delete this._events[e]),this._removeListener&&this.emit(`removeListener`,e,t),this}else (n===t||n.listener&&n.listener===t||n._origin&&n._origin===t)&&(this.wildcard?delete s._listeners:delete this._events[e],this._removeListener&&this.emit(`removeListener`,e,t))}return this.listenerTree&&D(this.listenerTree),this},A.prototype.offAny=function(e){var t=0,n=0,r;if(e&&this._all&&this._all.length>0){for(r=this._all,t=0,n=r.length;t<n;t++)if(e===r[t])return r.splice(t,1),this._removeListener&&this.emit(`removeListenerAny`,e),this}else{if(r=this._all,this._removeListener)for(t=0,n=r.length;t<n;t++)this.emit(`removeListenerAny`,r[t]);this._all=[]}return this},A.prototype.removeListener=A.prototype.off,A.prototype.removeAllListeners=function(e){if(e===n)return!this._events||d.call(this),this;if(this.wildcard){var t=w.call(this,null,e,this.listenerTree,0),r,i;if(!t)return this;for(i=0;i<t.length;i++)r=t[i],r._listeners=null;this.listenerTree&&D(this.listenerTree)}else this._events&&(this._events[e]=null);return this},A.prototype.listeners=function(e){var t=this._events,r,i,a,o,s;if(e===n){if(this.wildcard)throw Error(`event name required for wildcard emitter`);if(!t)return[];for(r=u(t),o=r.length,a=[];o-- >0;)i=t[r[o]],typeof i==`function`?a.push(i):a.push.apply(a,i);return a}else{if(this.wildcard){if(s=this.listenerTree,!s)return[];var c=[],l=typeof e==`string`?e.split(this.delimiter):e.slice();return w.call(this,c,l,s,0),c}return!t||(i=t[e],!i)?[]:typeof i==`function`?[i]:i}},A.prototype.eventNames=function(e){var t=this._events;return this.wildcard?E.call(this,this.listenerTree,[],null,e):t?u(t):[]},A.prototype.listenerCount=function(e){return this.listeners(e).length},A.prototype.hasListeners=function(e){if(this.wildcard){var t=[],r=typeof e==`string`?e.split(this.delimiter):e.slice();return w.call(this,t,r,this.listenerTree,0),t.length>0}var i=this._events,a=this._all;return!!(a&&a.length||i&&(e===n?u(i).length:i[e]))},A.prototype.listenersAny=function(){return this._all?this._all:[]},A.prototype.waitFor=function(e,t){var r=this,i=typeof t;return i===`number`?t={timeout:t}:i===`function`&&(t={filter:t}),t=_(t,{timeout:0,filter:n,handleError:!1,Promise,overload:!1},{filter:b,Promise:v}),S(t.Promise,function(n,i,a){function o(){var a=t.filter;if(!(a&&!a.apply(r,arguments)))if(r.off(e,o),t.handleError){var s=arguments[0];s?i(s):n(m.apply(null,arguments).slice(1))}else n(m.apply(null,arguments))}a(function(){r.off(e,o)}),r._on(e,o,!1)},{timeout:t.timeout,overload:t.overload})};function j(e,t,n){n=_(n,{Promise,timeout:0,overload:!1},{Promise:v});var r=n.Promise;return S(r,function(n,r,i){var a;if(typeof e.addEventListener==`function`){a=function(){n(m.apply(null,arguments))},i(function(){e.removeEventListener(t,a)}),e.addEventListener(t,a,{once:!0});return}var o=function(){s&&e.removeListener(`error`,s),n(m.apply(null,arguments))},s;t!==`error`&&(s=function(n){e.removeListener(t,o),r(n)},e.once(`error`,s)),i(function(){s&&e.removeListener(`error`,s),e.removeListener(t,o)}),e.once(t,o)},{timeout:n.timeout,overload:n.overload})}var M=A.prototype;if(Object.defineProperties(A,{defaultMaxListeners:{get:function(){return M._maxListeners},set:function(e){if(typeof e!=`number`||e<0||Number.isNaN(e))throw TypeError(`n must be a non-negative number`);M._maxListeners=e},enumerable:!0},once:{value:j,writable:!0,configurable:!0}}),Object.defineProperties(M,{_maxListeners:{value:a,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define==`function`&&define.amd)define(function(){return A});else if(typeof e==`object`)t.exports=A;else{var N=Function(``,`return this`)();N.EventEmitter2=A}})()}))();var D$t=(e=>(e.loading=`loading`,e.fetchMore=`fetchMore`,e.ready=`ready`,e.error=`error`,e))(D$t||{}),G7=new WeakMap,K7=new WeakMap,q7={current:[]},J7=!1,O$t=0,Y7=new Set,X7=new Map;function k$t(e){let t=Array.from(e).sort((e,t)=>e instanceof F$t&&e.options.deps.includes(t)?1:t instanceof F$t&&t.options.deps.includes(e)?-1:0);for(let e of t){if(q7.current.includes(e))continue;q7.current.push(e),e.recompute();let t=K7.get(e);if(t)for(let e of t){let t=G7.get(e);t&&k$t(t)}}}function A$t(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function j$t(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function M$t(e){if(O$t>0&&!X7.has(e)&&X7.set(e,e.prevState),Y7.add(e),!(O$t>0)&&!J7)try{for(J7=!0;Y7.size>0;){let e=Array.from(Y7);Y7.clear();for(let t of e)t.prevState=X7.get(t)??t.prevState,A$t(t);for(let t of e){let e=G7.get(t);e&&(q7.current.push(t),k$t(e))}for(let t of e){let e=G7.get(t);if(e)for(let t of e)j$t(t)}}}finally{J7=!1,q7.current=[],X7.clear()}}function N$t(e){return typeof e==`function`}var P$t=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):N$t(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),M$t(this)}},F$t=class e{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),(t=(e=this.options).onUpdate)==null||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let t of this.options.deps)t instanceof e&&t.checkIfRecalculationNeededDeeply();let t=!1,n=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let e=0;e<r.length;e++)if(r[e]!==n[e]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(let e of this._subscriptions)e()}),this.subscribe=e=>{var t;this.listeners.add(e);let n=(t=this.options).onSubscribe?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(let n of t)if(n instanceof e)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof P$t){let e=G7.get(n);e||(e=new Set,G7.set(n,e)),e.add(this);let t=K7.get(this);t||(t=new Set,K7.set(this,t)),t.add(n)}}unregisterFromGraph(t=this.options.deps){for(let n of t)if(n instanceof e)this.unregisterFromGraph(n.options.deps);else if(n instanceof P$t){let e=G7.get(n);e&&e.delete(this);let t=K7.get(this);t&&t.delete(n)}}};({NewMessage:`new-message`}).NewMessage,D$t.ready;var I$t=class extends Error{};I$t.prototype.name=`InvalidTokenError`;function L$t(e,t){return function(){return e.apply(t,arguments)}}var{toString:R$t}=Object.prototype,{getPrototypeOf:Z7}=Object,{iterator:Q7,toStringTag:z$t}=Symbol,$7=(e=>t=>{let n=R$t.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),e9=e=>(e=e.toLowerCase(),t=>$7(t)===e),t9=e=>t=>typeof t===e,{isArray:n9}=Array,r9=t9(`undefined`);function i9(e){return e!==null&&!r9(e)&&e.constructor!==null&&!r9(e.constructor)&&a9(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var B$t=e9(`ArrayBuffer`);function V$t(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&B$t(e.buffer),t}var H$t=t9(`string`),a9=t9(`function`),U$t=t9(`number`),o9=e=>typeof e==`object`&&!!e,W$t=e=>e===!0||e===!1,s9=e=>{if($7(e)!==`object`)return!1;let t=Z7(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(z$t in e)&&!(Q7 in e)},G$t=e=>{if(!o9(e)||i9(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},K$t=e9(`Date`),q$t=e9(`File`),J$t=e9(`Blob`),Y$t=e9(`FileList`),X$t=e=>o9(e)&&a9(e.pipe),Z$t=e=>{let t;return e&&(typeof FormData==`function`&&e instanceof FormData||a9(e.append)&&((t=$7(e))===`formdata`||t===`object`&&a9(e.toString)&&e.toString()===`[object FormData]`))},Q$t=e9(`URLSearchParams`),[$$t,e1t,t1t,n1t]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(e9),r1t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function c9(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),n9(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(i9(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function i1t(e,t){if(i9(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var l9=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,a1t=e=>!r9(e)&&e!==l9;function u9(){let{caseless:e,skipUndefined:t}=a1t(this)&&this||{},n={},r=(r,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=e&&i1t(n,i)||i;s9(n[a])&&s9(r)?n[a]=u9(n[a],r):s9(r)?n[a]=u9({},r):n9(r)?n[a]=r.slice():(!t||!r9(r))&&(n[a]=r)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&c9(arguments[e],r);return n}var o1t=(e,t,n,{allOwnKeys:r}={})=>(c9(t,(t,r)=>{n&&a9(t)?Object.defineProperty(e,r,{value:L$t(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),s1t=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),c1t=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,`constructor`,{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},l1t=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Z7(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},u1t=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},d1t=e=>{if(!e)return null;if(n9(e))return e;let t=e.length;if(!U$t(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},f1t=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&Z7(Uint8Array)),p1t=(e,t)=>{let n=(e&&e[Q7]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},m1t=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},h1t=e9(`HTMLFormElement`),g1t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),_1t=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),v1t=e9(`RegExp`),y1t=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};c9(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},b1t=e=>{y1t(e,(t,n)=>{if(a9(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(a9(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},x1t=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return n9(e)?r(e):r(String(e).split(t)),n},S1t=()=>{},C1t=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function w1t(e){return!!(e&&a9(e.append)&&e[z$t]===`FormData`&&e[Q7])}var T1t=e=>{let t=Array(10),n=(e,r)=>{if(o9(e)){if(t.indexOf(e)>=0)return;if(i9(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=n9(e)?[]:{};return c9(e,(e,t)=>{let a=n(e,r+1);!r9(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},E1t=e9(`AsyncFunction`),D1t=e=>e&&(o9(e)||a9(e))&&a9(e.then)&&a9(e.catch),O1t=((e,t)=>e?setImmediate:t?((e,t)=>(l9.addEventListener(`message`,({source:n,data:r})=>{n===l9&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),l9.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,a9(l9.postMessage)),$={isArray:n9,isArrayBuffer:B$t,isBuffer:i9,isFormData:Z$t,isArrayBufferView:V$t,isString:H$t,isNumber:U$t,isBoolean:W$t,isObject:o9,isPlainObject:s9,isEmptyObject:G$t,isReadableStream:$$t,isRequest:e1t,isResponse:t1t,isHeaders:n1t,isUndefined:r9,isDate:K$t,isFile:q$t,isBlob:J$t,isRegExp:v1t,isFunction:a9,isStream:X$t,isURLSearchParams:Q$t,isTypedArray:f1t,isFileList:Y$t,forEach:c9,merge:u9,extend:o1t,trim:r1t,stripBOM:s1t,inherits:c1t,toFlatObject:l1t,kindOf:$7,kindOfTest:e9,endsWith:u1t,toArray:d1t,forEachEntry:p1t,matchAll:m1t,isHTMLForm:h1t,hasOwnProperty:_1t,hasOwnProp:_1t,reduceDescriptors:y1t,freezeMethods:b1t,toObjectSet:x1t,toCamelCase:g1t,noop:S1t,toFiniteNumber:C1t,findKey:i1t,global:l9,isContextDefined:a1t,isSpecCompliantForm:w1t,toJSONObject:T1t,isAsyncFn:E1t,isThenable:D1t,setImmediate:O1t,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(l9):typeof process<`u`&&process.nextTick||O1t,isIterable:e=>e!=null&&a9(e[Q7])},d9=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){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:$.toJSONObject(this.config),code:this.code,status:this.status}}};d9.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,d9.ERR_BAD_OPTION=`ERR_BAD_OPTION`,d9.ECONNABORTED=`ECONNABORTED`,d9.ETIMEDOUT=`ETIMEDOUT`,d9.ERR_NETWORK=`ERR_NETWORK`,d9.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,d9.ERR_DEPRECATED=`ERR_DEPRECATED`,d9.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,d9.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,d9.ERR_CANCELED=`ERR_CANCELED`,d9.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,d9.ERR_INVALID_URL=`ERR_INVALID_URL`;function f9(e){return $.isPlainObject(e)||$.isArray(e)}function k1t(e){return $.endsWith(e,`[]`)?e.slice(0,-2):e}function A1t(e,t,n){return e?e.concat(t).map(function(e,t){return e=k1t(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function j1t(e){return $.isArray(e)&&!e.some(f9)}var M1t=$.toFlatObject($,{},null,function(e){return/^is[A-Z]/.test(e)});function p9(e,t,n){if(!$.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!$.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||l,a=n.dots,o=n.indexes,s=(n.Blob||typeof Blob<`u`&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(i))throw TypeError(`visitor must be a function`);function c(e){if(e===null)return``;if($.isDate(e))return e.toISOString();if($.isBoolean(e))return e.toString();if(!s&&$.isBlob(e))throw new d9(`Blob is not supported. Use a Buffer instead.`);return $.isArrayBuffer(e)||$.isTypedArray(e)?s&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let s=e;if(e&&!i&&typeof e==`object`){if($.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&j1t(e)||($.isFileList(e)||$.endsWith(n,`[]`))&&(s=$.toArray(e)))return n=k1t(n),s.forEach(function(e,r){!($.isUndefined(e)||e===null)&&t.append(o===!0?A1t([n],r,a):o===null?n:n+`[]`,c(e))}),!1}return f9(e)?!0:(t.append(A1t(i,n,a),c(e)),!1)}let u=[],d=Object.assign(M1t,{defaultVisitor:l,convertValue:c,isVisitable:f9});function f(e,n){if(!$.isUndefined(e)){if(u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),$.forEach(e,function(e,r){(!($.isUndefined(e)||e===null)&&i.call(t,e,$.isString(r)?r.trim():r,n,d))===!0&&f(e,n?n.concat(r):[r])}),u.pop()}}if(!$.isObject(e))throw TypeError(`data must be an object`);return f(e),t}function N1t(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function m9(e,t){this._pairs=[],e&&p9(e,this,t)}var P1t=m9.prototype;P1t.append=function(e,t){this._pairs.push([e,t])},P1t.toString=function(e){let t=e?function(t){return e.call(this,t,N1t)}:N1t;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function F1t(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function I1t(e,t,n){if(!t)return e;let r=n&&n.encode||F1t,i=$.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):$.isURLSearchParams(t)?t.toString():new m9(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var L1t=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){$.forEach(this.handlers,function(t){t!==null&&e(t)})}},h9={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},R1t={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:m9,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},z1t=r({hasBrowserEnv:()=>g9,hasStandardBrowserEnv:()=>B1t,hasStandardBrowserWebWorkerEnv:()=>V1t,navigator:()=>_9,origin:()=>H1t}),g9=typeof window<`u`&&typeof document<`u`,_9=typeof navigator==`object`&&navigator||void 0,B1t=g9&&(!_9||[`ReactNative`,`NativeScript`,`NS`].indexOf(_9.product)<0),V1t=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,H1t=g9&&window.location.href||`http://localhost`,v9={...z1t,...R1t};function U1t(e,t){return p9(e,new v9.classes.URLSearchParams,{visitor:function(e,t,n,r){return v9.isNode&&$.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function W1t(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function G1t(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function K1t(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&$.isArray(r)?r.length:a,s?($.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!$.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&$.isArray(r[a])&&(r[a]=G1t(r[a])),!o)}if($.isFormData(e)&&$.isFunction(e.entries)){let n={};return $.forEachEntry(e,(e,r)=>{t(W1t(e),r,n,0)}),n}return null}function q1t(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var y9={transitional:h9,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=$.isObject(e);if(i&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return r?JSON.stringify(K1t(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e)||$.isReadableStream(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return U1t(e,this.formSerializer).toString();if((a=$.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let t=this.env&&this.env.FormData;return p9(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType(`application/json`,!1),q1t(e)):e}],transformResponse:[function(e){let t=this.transitional||y9.transitional,n=t&&t.forcedJSONParsing,r=this.responseType===`json`;if($.isResponse(e)||$.isReadableStream(e))return e;if(e&&$.isString(e)&&(n&&!this.responseType||r)){let n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n)throw e.name===`SyntaxError`?d9.from(e,d9.ERR_BAD_RESPONSE,this,null,this.response):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:v9.classes.FormData,Blob:v9.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};$.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{y9.headers[e]={}});var J1t=$.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`]),Y1t=e=>{let t={},n,r,i;return e&&e.split(`
|
|
1661
|
-
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&
|
|
1662
|
-
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[X1t]=this[X1t]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=b9(e);t[r]||(e0t(n,e),t[r]=!0)}return $.isArray(e)?e.forEach(r):r(e),this}};C9.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),$.reduceDescriptors(C9.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),$.freezeMethods(C9);function w9(e,t){let n=this||y9,r=t||n,i=C9.from(r.headers),a=r.data;return $.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function t0t(e){return!!(e&&e.__CANCEL__)}var T9=class extends d9{constructor(e,t,n){super(e??`canceled`,d9.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function n0t(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new d9(`Request failed with status code `+n.status,[d9.ERR_BAD_REQUEST,d9.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function r0t(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function i0t(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function a0t(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var E9=(e,t,n=3)=>{let r=0,i=i0t(50,250);return a0t(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,c=i(s),l=a<=o;r=a,e({loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},o0t=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},s0t=e=>(...t)=>$.asap(()=>e(...t)),c0t=v9.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,v9.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(v9.origin),v9.navigator&&/(msie|trident)/i.test(v9.navigator.userAgent)):()=>!0,l0t=v9.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];$.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),$.isString(r)&&s.push(`path=${r}`),$.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),$.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function u0t(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function d0t(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function f0t(e,t,n){let r=!u0t(t);return e&&(r||n==0)?d0t(e,t):t}var p0t=e=>e instanceof C9?{...e}:e;function D9(e,t){t||={};let n={};function r(e,t,n,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function i(e,t,n,i){if(!$.isUndefined(t))return r(e,t,n,i);if(!$.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!$.isUndefined(t))return r(void 0,t)}function o(e,t){if(!$.isUndefined(t))return r(void 0,t);if(!$.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(a in t)return r(n,i);if(a in e)return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(p0t(e),p0t(t),n,!0)};return $.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=$.hasOwnProp(c,r)?c[r]:i,o=a(e[r],t[r],r);$.isUndefined(o)&&a!==s||(n[r]=o)}),n}var m0t=e=>{let t=D9({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=C9.from(o),t.url=I1t(f0t(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``))),$.isFormData(n)){if(v9.hasStandardBrowserEnv||v9.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if($.isFunction(n.getHeaders)){let e=n.getHeaders(),t=[`content-type`,`content-length`];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)})}}if(v9.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||r!==!1&&c0t(t.url))){let e=i&&a&&l0t.read(a);e&&o.set(i,e)}return t},h0t=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=m0t(e),i=r.data,a=C9.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=C9.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());n0t(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf(`file:`)===0)||setTimeout(g)},h.onabort=function(){h&&=(n(new d9(`Request aborted`,d9.ECONNABORTED,e,h)),null)},h.onerror=function(t){let r=new d9(t&&t.message?t.message:`Network Error`,d9.ERR_NETWORK,e,h);r.event=t||null,n(r),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||h9;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new d9(t,i.clarifyTimeoutError?d9.ETIMEDOUT:d9.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&$.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),$.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=E9(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=E9(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new T9(null,e,h):t),h.abort(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=r0t(r.url);if(_&&v9.protocols.indexOf(_)===-1){n(new d9(`Unsupported protocol `+_+`:`,d9.ERR_BAD_REQUEST,e));return}h.send(i||null)})},g0t=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof d9?t:new T9(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new d9(`timeout of ${t}ms exceeded`,d9.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>$.asap(o),s}},_0t=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},v0t=async function*(e,t){for await(let n of y0t(e))yield*_0t(n,t)},y0t=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},b0t=(e,t,n,r)=>{let i=v0t(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},x0t=64*1024,{isFunction:O9}=$,S0t=(({Request:e,Response:t})=>({Request:e,Response:t}))($.global),{ReadableStream:C0t,TextEncoder:w0t}=$.global,T0t=(e,...t)=>{try{return!!e(...t)}catch{return!1}},E0t=e=>{e=$.merge.call({skipUndefined:!0},S0t,e);let{fetch:t,Request:n,Response:r}=e,i=t?O9(t):typeof fetch==`function`,a=O9(n),o=O9(r);if(!i)return!1;let s=i&&O9(C0t),c=i&&(typeof w0t==`function`?(e=>t=>e.encode(t))(new w0t):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=a&&s&&T0t(()=>{let e=!1,t=new n(v9.origin,{body:new C0t,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`);return e&&!t}),u=o&&s&&T0t(()=>$.isReadableStream(new r(``).body)),d={stream:u&&(e=>e.body)};i&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new d9(`Response type '${e}' is not supported`,d9.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(e==null)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e))return(await new n(v9.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if($.isArrayBufferView(e)||$.isArrayBuffer(e))return e.byteLength;if($.isURLSearchParams(e)&&(e+=``),$.isString(e))return(await c(e)).byteLength},p=async(e,t)=>$.toFiniteNumber(e.getContentLength())??f(t);return async e=>{let{url:i,method:o,data:s,signal:c,cancelToken:f,timeout:m,onDownloadProgress:h,onUploadProgress:g,responseType:_,headers:v,withCredentials:y=`same-origin`,fetchOptions:b}=m0t(e),x=t||fetch;_=_?(_+``).toLowerCase():`text`;let S=g0t([c,f&&f.toAbortSignal()],m),C=null,w=S&&S.unsubscribe&&(()=>{S.unsubscribe()}),T;try{if(g&&l&&o!==`get`&&o!==`head`&&(T=await p(v,s))!==0){let e=new n(i,{method:`POST`,body:s,duplex:`half`}),t;if($.isFormData(s)&&(t=e.headers.get(`content-type`))&&v.setContentType(t),e.body){let[t,n]=o0t(T,E9(s0t(g)));s=b0t(e.body,x0t,t,n)}}$.isString(y)||(y=y?`include`:`omit`);let t=a&&`credentials`in n.prototype,c={...b,signal:S,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:`half`,credentials:t?y:void 0};C=a&&new n(i,c);let f=await(a?x(C,b):x(i,c)),m=u&&(_===`stream`||_===`response`);if(u&&(h||m&&w)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=f[t]});let t=$.toFiniteNumber(f.headers.get(`content-length`)),[n,i]=h&&o0t(t,E9(s0t(h),!0))||[];f=new r(b0t(f.body,x0t,n,()=>{i&&i(),w&&w()}),e)}_||=`text`;let E=await d[$.findKey(d,_)||`text`](f,e);return!m&&w&&w(),await new Promise((t,n)=>{n0t(t,n,{data:E,headers:C9.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:C})})}catch(t){throw w&&w(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new d9(`Network Error`,d9.ERR_NETWORK,e,C,t&&t.response),{cause:t.cause||t}):d9.from(t,t&&t.code,e,C,t&&t.response)}}},D0t=new Map,O0t=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=D0t;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:E0t(t)),l=c;return c};O0t();var k9={http:null,xhr:h0t,fetch:{get:O0t}};$.forEach(k9,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});var k0t=e=>`- ${e}`,A0t=e=>$.isFunction(e)||e===null||e===!1;function j0t(e,t){e=$.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!A0t(r)&&(i=k9[(n=String(r)).toLowerCase()],i===void 0))throw new d9(`Unknown adapter '${n}'`);if(i&&($.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new d9(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
1663
|
-
`+e.map(
|
|
1664
|
-
`):` `+
|
|
1665
|
-
`+n):e.stack=n}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=D9(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&M9.assertOptions(n,{silentJSONParsing:N9.transitional(N9.boolean),forcedJSONParsing:N9.transitional(N9.boolean),clarifyTimeoutError:N9.transitional(N9.boolean),legacyInterceptorReqResOrdering:N9.transitional(N9.boolean)},!1),r!=null&&($.isFunction(r)?t.paramsSerializer={serialize:r}:M9.assertOptions(r,{encode:N9.function,serialize:N9.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),M9.assertOptions(t,{baseUrl:N9.spelling(`baseURL`),withXsrfToken:N9.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&$.merge(i.common,i[t.method]);i&&$.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=C9.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||h9;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[N0t.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=N0t.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=D9(this.defaults,e),I1t(f0t(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};$.forEach([`delete`,`get`,`head`,`options`],function(e){P9.prototype[e]=function(t,n){return this.request(D9(n||{},{method:e,url:t,data:(n||{}).data}))}}),$.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(D9(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}P9.prototype[e]=t(),P9.prototype[e+`Form`]=t(!0)});var L0t=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new T9(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function R0t(e){return function(t){return e.apply(null,t)}}function z0t(e){return $.isObject(e)&&e.isAxiosError===!0}var F9={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(F9).forEach(([e,t])=>{F9[t]=e});function B0t(e){let t=new P9(e),n=L$t(P9.prototype.request,t);return $.extend(n,P9.prototype,t,{allOwnKeys:!0}),$.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return B0t(D9(e,t))},n}var I9=B0t(y9);I9.Axios=P9,I9.CanceledError=T9,I9.CancelToken=L0t,I9.isCancel=t0t,I9.VERSION=P0t,I9.toFormData=p9,I9.AxiosError=d9,I9.Cancel=I9.CanceledError,I9.all=function(e){return Promise.all(e)},I9.spread=R0t,I9.isAxiosError=z0t,I9.mergeConfig=D9,I9.AxiosHeaders=C9,I9.formToJSON=e=>K1t($.isHTMLForm(e)?new FormData(e):e),I9.getAdapter=M0t.getAdapter,I9.HttpStatusCode=F9,I9.default=I9;var V0t=e(i(((e,t)=>{var n=new Set(`ENOTFOUND.ENETUNREACH.UNABLE_TO_GET_ISSUER_CERT.UNABLE_TO_GET_CRL.UNABLE_TO_DECRYPT_CERT_SIGNATURE.UNABLE_TO_DECRYPT_CRL_SIGNATURE.UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY.CERT_SIGNATURE_FAILURE.CRL_SIGNATURE_FAILURE.CERT_NOT_YET_VALID.CERT_HAS_EXPIRED.CRL_NOT_YET_VALID.CRL_HAS_EXPIRED.ERROR_IN_CERT_NOT_BEFORE_FIELD.ERROR_IN_CERT_NOT_AFTER_FIELD.ERROR_IN_CRL_LAST_UPDATE_FIELD.ERROR_IN_CRL_NEXT_UPDATE_FIELD.OUT_OF_MEM.DEPTH_ZERO_SELF_SIGNED_CERT.SELF_SIGNED_CERT_IN_CHAIN.UNABLE_TO_GET_ISSUER_CERT_LOCALLY.UNABLE_TO_VERIFY_LEAF_SIGNATURE.CERT_CHAIN_TOO_LONG.CERT_REVOKED.INVALID_CA.PATH_LENGTH_EXCEEDED.INVALID_PURPOSE.CERT_UNTRUSTED.CERT_REJECTED.HOSTNAME_MISMATCH`.split(`.`));t.exports=e=>!n.has(e&&e.code)}))()),H0t=`axios-retry`;function U0t(e){return e.response||!e.code||[`ERR_CANCELED`,`ECONNABORTED`].includes(e.code)?!1:(0,V0t.default)(e)}var W0t=[`get`,`head`,`options`],G0t=W0t.concat([`put`,`delete`]);function L9(e){return e.code!==`ECONNABORTED`&&(!e.response||e.response.status===429||e.response.status>=500&&e.response.status<=599)}function K0t(e){return e.config?.method?L9(e)&&W0t.indexOf(e.config.method)!==-1:!1}function q0t(e){return e.config?.method?L9(e)&&G0t.indexOf(e.config.method)!==-1:!1}function J0t(e){return U0t(e)||q0t(e)}function R9(e=void 0){let t=e?.response?.headers[`retry-after`];if(!t)return 0;let n=(Number(t)||0)*1e3;return n===0&&(n=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,n)}function Y0t(e=0,t=void 0){return Math.max(0,R9(t))}function X0t(e=0,t=void 0,n=100){let r=2**e*n,i=Math.max(r,R9(t));return i+i*.2*Math.random()}function Z0t(e=100){return(t=0,n=void 0)=>{let r=t*e;return Math.max(r,R9(n))}}var Q0t={retries:3,retryCondition:J0t,retryDelay:Y0t,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function $0t(e,t){return{...Q0t,...t,...e[H0t]}}function e2t(e,t,n=!1){let r=$0t(e,t||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),e[H0t]=r,r}function t2t(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}async function n2t(e,t){let{retries:n,retryCondition:r}=e,i=(e.retryCount||0)<n&&r(t);if(typeof i==`object`)try{return await i!==!1}catch{return!1}return i}async function r2t(e,t,n,r){t.retryCount+=1;let{retryDelay:i,shouldResetTimeout:a,onRetry:o}=t,s=i(t.retryCount,n);if(t2t(e,r),!a&&r.timeout&&t.lastRequestTime){let e=Date.now()-t.lastRequestTime,i=r.timeout-e-s;if(i<=0)return Promise.reject(n);r.timeout=i}return r.transformRequest=[e=>e],await o(t.retryCount,n,r),r.signal?.aborted?Promise.resolve(e(r)):new Promise(t=>{let n=()=>{clearTimeout(i),t(e(r))},i=setTimeout(()=>{t(e(r)),r.signal?.removeEventListener&&r.signal.removeEventListener(`abort`,n)},s);r.signal?.addEventListener&&r.signal.addEventListener(`abort`,n,{once:!0})})}async function i2t(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}var z9=(e,t)=>({requestInterceptorId:e.interceptors.request.use(e=>(e2t(e,t,!0),e[`axios-retry`]?.validateResponse&&(e.validateStatus=()=>!1),e)),responseInterceptorId:e.interceptors.response.use(null,async n=>{let{config:r}=n;if(!r)return Promise.reject(n);let i=e2t(r,t);return n.response&&i.validateResponse?.(n.response)?n.response:await n2t(i,n)?r2t(e,i,n,r):(await i2t(i,n),Promise.reject(n))})});z9.isNetworkError=U0t,z9.isSafeRequestError=K0t,z9.isIdempotentRequestError=q0t,z9.isNetworkOrIdempotentRequestError=J0t,z9.exponentialDelay=X0t,z9.linearDelay=Z0t,z9.isRetryableError=L9;var a2t=(typeof self<`u`?self:null)||(typeof window<`u`?window:null)||a2t,B9=class{type=3;name=``;prefix=``;value=``;suffix=``;modifier=3;constructor(e,t,n,r,i,a){this.type=e,this.name=t,this.prefix=n,this.value=r,this.suffix=i,this.modifier=a}hasCustomName(){return this.name!==``&&typeof this.name!=`number`}},o2t=/[$_\p{ID_Start}]/u,s2t=/[$_\u200C\u200D\p{ID_Continue}]/u,V9=`.*`;function c2t(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function l2t(e,t=!1){let n=[],r=0;for(;r<e.length;){let i=e[r],a=function(i){if(!t)throw TypeError(i);n.push({type:`INVALID_CHAR`,index:r,value:e[r++]})};if(i===`*`){n.push({type:`ASTERISK`,index:r,value:e[r++]});continue}if(i===`+`||i===`?`){n.push({type:`OTHER_MODIFIER`,index:r,value:e[r++]});continue}if(i===`\\`){n.push({type:`ESCAPED_CHAR`,index:r++,value:e[r++]});continue}if(i===`{`){n.push({type:`OPEN`,index:r,value:e[r++]});continue}if(i===`}`){n.push({type:`CLOSE`,index:r,value:e[r++]});continue}if(i===`:`){let t=``,i=r+1;for(;i<e.length;){let n=e.substr(i,1);if(i===r+1&&o2t.test(n)||i!==r+1&&s2t.test(n)){t+=e[i++];continue}break}if(!t){a(`Missing parameter name at ${r}`);continue}n.push({type:`NAME`,index:r,value:t}),r=i;continue}if(i===`(`){let t=1,i=``,o=r+1,s=!1;if(e[o]===`?`){a(`Pattern cannot start with "?" at ${o}`);continue}for(;o<e.length;){if(!c2t(e[o],!1)){a(`Invalid character '${e[o]}' at ${o}.`),s=!0;break}if(e[o]===`\\`){i+=e[o++]+e[o++];continue}if(e[o]===`)`){if(t--,t===0){o++;break}}else if(e[o]===`(`&&(t++,e[o+1]!==`?`)){a(`Capturing groups are not allowed at ${o}`),s=!0;break}i+=e[o++]}if(s)continue;if(t){a(`Unbalanced pattern at ${r}`);continue}if(!i){a(`Missing pattern at ${r}`);continue}n.push({type:`REGEX`,index:r,value:i}),r=o;continue}n.push({type:`CHAR`,index:r,value:e[r++]})}return n.push({type:`END`,index:r,value:``}),n}function u2t(e,t={}){let n=l2t(e);t.delimiter??=`/#?`,t.prefixes??=`./`;let r=`[^${H9(t.delimiter)}]+?`,i=[],a=0,o=0,s=new Set,c=e=>{if(o<n.length&&n[o].type===e)return n[o++].value},l=()=>c(`OTHER_MODIFIER`)??c(`ASTERISK`),u=e=>{let t=c(e);if(t!==void 0)return t;let{type:r,index:i}=n[o];throw TypeError(`Unexpected ${r} at ${i}, expected ${e}`)},d=()=>{let e=``,t;for(;t=c(`CHAR`)??c(`ESCAPED_CHAR`);)e+=t;return e},f=t.encodePart||(e=>e),p=``,m=e=>{p+=e},h=()=>{p.length&&(i.push(new B9(3,``,``,f(p),``,3)),p=``)},g=(e,t,n,o,c)=>{let l=3;switch(c){case`?`:l=1;break;case`*`:l=0;break;case`+`:l=2;break}if(!t&&!n&&l===3){m(e);return}if(h(),!t&&!n){if(!e)return;i.push(new B9(3,``,``,f(e),``,l));return}let u;u=n?n===`*`?V9:n:r;let d=2;u===r?(d=1,u=``):u===V9&&(d=0,u=``);let p;if(t?p=t:n&&(p=a++),s.has(p))throw TypeError(`Duplicate name '${p}'.`);s.add(p),i.push(new B9(d,p,f(e),u,f(o),l))};for(;o<n.length;){let e=c(`CHAR`),n=c(`NAME`),r=c(`REGEX`);if(!n&&!r&&(r=c(`ASTERISK`)),n||r){let i=e??``;t.prefixes.indexOf(i)===-1&&(m(i),i=``),h();let a=l();g(i,n,r,``,a);continue}let i=e??c(`ESCAPED_CHAR`);if(i){m(i);continue}if(c(`OPEN`)){let e=d(),t=c(`NAME`),n=c(`REGEX`);!t&&!n&&(n=c(`ASTERISK`));let r=d();u(`CLOSE`);let i=l();g(e,t,n,r,i);continue}h(),u(`END`)}return i}function H9(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,`\\$1`)}function d2t(e){return e&&e.ignoreCase?`ui`:`u`}function f2t(e,t,n){return p2t(u2t(e,n),t,n)}function U9(e){switch(e){case 0:return`*`;case 1:return`?`;case 2:return`+`;case 3:return``}}function p2t(e,t,n={}){n.delimiter??=`/#?`,n.prefixes??=`./`,n.sensitive??=!1,n.strict??=!1,n.end??=!0,n.start??=!0,n.endsWith=``;let r=n.start?`^`:``;for(let i of e){if(i.type===3){i.modifier===3?r+=H9(i.value):r+=`(?:${H9(i.value)})${U9(i.modifier)}`;continue}t&&t.push(i.name);let e=`[^${H9(n.delimiter)}]+?`,a=i.value;if(i.type===1?a=e:i.type===0&&(a=V9),!i.prefix.length&&!i.suffix.length){i.modifier===3||i.modifier===1?r+=`(${a})${U9(i.modifier)}`:r+=`((?:${a})${U9(i.modifier)})`;continue}if(i.modifier===3||i.modifier===1){r+=`(?:${H9(i.prefix)}(${a})${H9(i.suffix)})`,r+=U9(i.modifier);continue}r+=`(?:${H9(i.prefix)}`,r+=`((?:${a})(?:`,r+=H9(i.suffix),r+=H9(i.prefix),r+=`(?:${a}))*)${H9(i.suffix)})`,i.modifier===0&&(r+=`?`)}let i=`[${H9(n.endsWith)}]|$`,a=`[${H9(n.delimiter)}]`;if(n.end)return n.strict||(r+=`${a}?`),n.endsWith.length?r+=`(?=${i})`:r+=`$`,new RegExp(r,d2t(n));n.strict||(r+=`(?:${a}(?=${i}))?`);let o=!1;if(e.length){let t=e[e.length-1];t.type===3&&t.modifier===3&&(o=n.delimiter.indexOf(t)>-1)}return o||(r+=`(?=${a}|${i})`),new RegExp(r,d2t(n))}var W9={delimiter:``,prefixes:``,sensitive:!0,strict:!0},m2t={delimiter:`.`,prefixes:``,sensitive:!0,strict:!0},h2t={delimiter:`/`,prefixes:`/`,sensitive:!0,strict:!0};function g2t(e,t){return e.length?e[0]===`/`?!0:!t||e.length<2?!1:(e[0]==`\\`||e[0]==`{`)&&e[1]==`/`:!1}function _2t(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function v2t(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function y2t(e){return!e||e.length<2?!1:e[0]===`[`||(e[0]===`\\`||e[0]===`{`)&&e[1]===`[`}var b2t=[`ftp`,`file`,`http`,`https`,`ws`,`wss`];function x2t(e){if(!e)return!0;for(let t of b2t)if(e.test(t))return!0;return!1}function S2t(e,t){if(e=_2t(e,`#`),t||e===``)return e;let n=new URL(`https://example.com`);return n.hash=e,n.hash?n.hash.substring(1,n.hash.length):``}function C2t(e,t){if(e=_2t(e,`?`),t||e===``)return e;let n=new URL(`https://example.com`);return n.search=e,n.search?n.search.substring(1,n.search.length):``}function w2t(e,t){return t||e===``?e:y2t(e)?P2t(e):N2t(e)}function T2t(e,t){if(t||e===``)return e;let n=new URL(`https://example.com`);return n.password=e,n.password}function E2t(e,t){if(t||e===``)return e;let n=new URL(`https://example.com`);return n.username=e,n.username}function D2t(e,t,n){if(n||e===``)return e;if(t&&!b2t.includes(t))return new URL(`${t}:${e}`).pathname;let r=e[0]==`/`;return e=new URL(r?e:`/-`+e,`https://example.com`).pathname,r||(e=e.substring(2,e.length)),e}function O2t(e,t,n){return A2t(t)===e&&(e=``),n||e===``?e:F2t(e)}function k2t(e,t){return e=v2t(e,`:`),t||e===``?e:G9(e)}function A2t(e){switch(e){case`ws`:case`http`:return`80`;case`wws`:case`https`:return`443`;case`ftp`:return`21`;default:return``}}function G9(e){if(e===``)return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw TypeError(`Invalid protocol '${e}'.`)}function j2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.username=e,t.username}function M2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.password=e,t.password}function N2t(e){if(e===``)return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw TypeError(`Invalid hostname '${e}'`);let t=new URL(`https://example.com`);return t.hostname=e,t.hostname}function P2t(e){if(e===``)return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function F2t(e){if(e===``||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw TypeError(`Invalid port '${e}'.`)}function I2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.pathname=e[0]===`/`?e:`/-`+e,e[0]===`/`?t.pathname:t.pathname.substring(2,t.pathname.length)}function L2t(e){return e===``?e:new URL(`data:${e}`).pathname}function R2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.search=e,t.search.substring(1,t.search.length)}function z2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.hash=e,t.hash.substring(1,t.hash.length)}var B2t=class{#e;#t=[];#n={};#r=0;#i=1;#a=0;#o=0;#s=0;#c=0;#l=!1;constructor(e){this.#e=e}get result(){return this.#n}parse(){for(this.#t=l2t(this.#e,!0);this.#r<this.#t.length;this.#r+=this.#i){if(this.#i=1,this.#t[this.#r].type===`END`){if(this.#o===0){this.#f(),this.#C()?this.#u(9,1):this.#S()?this.#u(8,1):this.#u(7,0);continue}else if(this.#o===2){this.#p(5);continue}this.#u(10,0);break}if(this.#s>0)if(this.#T())--this.#s;else continue;if(this.#w()){this.#s+=1;continue}switch(this.#o){case 0:this.#g()&&this.#p(1);break;case 1:if(this.#g()){this.#k();let e=7,t=1;this.#_()?(e=2,t=3):this.#l&&(e=2),this.#u(e,t)}break;case 2:this.#v()?this.#p(3):(this.#x()||this.#S()||this.#C())&&this.#p(5);break;case 3:this.#y()?this.#u(4,1):this.#v()&&this.#u(5,1);break;case 4:this.#v()&&this.#u(5,1);break;case 5:this.#E()?this.#c+=1:this.#D()&&--this.#c,this.#b()&&!this.#c?this.#u(6,1):this.#x()?this.#u(7,0):this.#S()?this.#u(8,1):this.#C()&&this.#u(9,1);break;case 6:this.#x()?this.#u(7,0):this.#S()?this.#u(8,1):this.#C()&&this.#u(9,1);break;case 7:this.#S()?this.#u(8,1):this.#C()&&this.#u(9,1);break;case 8:this.#C()&&this.#u(9,1);break;case 9:break;case 10:break}}this.#n.hostname!==void 0&&this.#n.port===void 0&&(this.#n.port=``)}#u(e,t){switch(this.#o){case 0:break;case 1:this.#n.protocol=this.#O();break;case 2:break;case 3:this.#n.username=this.#O();break;case 4:this.#n.password=this.#O();break;case 5:this.#n.hostname=this.#O();break;case 6:this.#n.port=this.#O();break;case 7:this.#n.pathname=this.#O();break;case 8:this.#n.search=this.#O();break;case 9:this.#n.hash=this.#O();break;case 10:break}this.#o!==0&&e!==10&&([1,2,3,4].includes(this.#o)&&[6,7,8,9].includes(e)&&(this.#n.hostname??=``),[1,2,3,4,5,6].includes(this.#o)&&[8,9].includes(e)&&(this.#n.pathname??=this.#l?`/`:``),[1,2,3,4,5,6,7].includes(this.#o)&&e===9&&(this.#n.search??=``)),this.#d(e,t)}#d(e,t){this.#o=e,this.#a=this.#r+t,this.#r+=t,this.#i=0}#f(){this.#r=this.#a,this.#i=0}#p(e){this.#f(),this.#o=e}#m(e){return e<0&&(e=this.#t.length-e),e<this.#t.length?this.#t[e]:this.#t[this.#t.length-1]}#h(e,t){let n=this.#m(e);return n.value===t&&(n.type===`CHAR`||n.type===`ESCAPED_CHAR`||n.type===`INVALID_CHAR`)}#g(){return this.#h(this.#r,`:`)}#_(){return this.#h(this.#r+1,`/`)&&this.#h(this.#r+2,`/`)}#v(){return this.#h(this.#r,`@`)}#y(){return this.#h(this.#r,`:`)}#b(){return this.#h(this.#r,`:`)}#x(){return this.#h(this.#r,`/`)}#S(){if(this.#h(this.#r,`?`))return!0;if(this.#t[this.#r].value!==`?`)return!1;let e=this.#m(this.#r-1);return e.type!==`NAME`&&e.type!==`REGEX`&&e.type!==`CLOSE`&&e.type!==`ASTERISK`}#C(){return this.#h(this.#r,`#`)}#w(){return this.#t[this.#r].type==`OPEN`}#T(){return this.#t[this.#r].type==`CLOSE`}#E(){return this.#h(this.#r,`[`)}#D(){return this.#h(this.#r,`]`)}#O(){let e=this.#t[this.#r],t=this.#m(this.#a).index;return this.#e.substring(t,e.index)}#k(){let e={};Object.assign(e,W9),e.encodePart=G9,this.#l=x2t(f2t(this.#O(),void 0,e))}},K9=[`protocol`,`username`,`password`,`hostname`,`port`,`pathname`,`search`,`hash`],q9=`*`;function V2t(e,t){if(typeof e!=`string`)throw TypeError(`parameter 1 is not of type 'string'.`);let n=new URL(e,t);return{protocol:n.protocol.substring(0,n.protocol.length-1),username:n.username,password:n.password,hostname:n.hostname,port:n.port,pathname:n.pathname,search:n.search===``?void 0:n.search.substring(1,n.search.length),hash:n.hash===``?void 0:n.hash.substring(1,n.hash.length)}}function J9(e,t){return t?X9(e):e}function Y9(e,t,n){let r;if(typeof t.baseURL==`string`)try{r=new URL(t.baseURL),t.protocol===void 0&&(e.protocol=J9(r.protocol.substring(0,r.protocol.length-1),n)),!n&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&(e.username=J9(r.username,n)),!n&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&t.password===void 0&&(e.password=J9(r.password,n)),t.protocol===void 0&&t.hostname===void 0&&(e.hostname=J9(r.hostname,n)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&(e.port=J9(r.port,n)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&(e.pathname=J9(r.pathname,n)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&(e.search=J9(r.search.substring(1,r.search.length),n)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&t.hash===void 0&&(e.hash=J9(r.hash.substring(1,r.hash.length),n))}catch{throw TypeError(`invalid baseURL '${t.baseURL}'.`)}if(typeof t.protocol==`string`&&(e.protocol=k2t(t.protocol,n)),typeof t.username==`string`&&(e.username=E2t(t.username,n)),typeof t.password==`string`&&(e.password=T2t(t.password,n)),typeof t.hostname==`string`&&(e.hostname=w2t(t.hostname,n)),typeof t.port==`string`&&(e.port=O2t(t.port,e.protocol,n)),typeof t.pathname==`string`){if(e.pathname=t.pathname,r&&!g2t(e.pathname,n)){let t=r.pathname.lastIndexOf(`/`);t>=0&&(e.pathname=J9(r.pathname.substring(0,t+1),n)+e.pathname)}e.pathname=D2t(e.pathname,e.protocol,n)}return typeof t.search==`string`&&(e.search=C2t(t.search,n)),typeof t.hash==`string`&&(e.hash=S2t(t.hash,n)),e}function X9(e){return e.replace(/([+*?:{}()\\])/g,`\\$1`)}function H2t(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,`\\$1`)}function U2t(e,t){t.delimiter??=`/#?`,t.prefixes??=`./`,t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith=``;let n=`[^${H2t(t.delimiter)}]+?`,r=/[$_\u200C\u200D\p{ID_Continue}]/u,i=``;for(let a=0;a<e.length;++a){let o=e[a];if(o.type===3){if(o.modifier===3){i+=X9(o.value);continue}i+=`{${X9(o.value)}}${U9(o.modifier)}`;continue}let s=o.hasCustomName(),c=!!o.suffix.length||!!o.prefix.length&&(o.prefix.length!==1||!t.prefixes.includes(o.prefix)),l=a>0?e[a-1]:null,u=a<e.length-1?e[a+1]:null;if(!c&&s&&o.type===1&&o.modifier===3&&u&&!u.prefix.length&&!u.suffix.length)if(u.type===3){let e=u.value.length>0?u.value[0]:``;c=r.test(e)}else c=!u.hasCustomName();if(!c&&!o.prefix.length&&l&&l.type===3){let e=l.value[l.value.length-1];c=t.prefixes.includes(e)}c&&(i+=`{`),i+=X9(o.prefix),s&&(i+=`:${o.name}`),o.type===2?i+=`(${o.value})`:o.type===1?s||(i+=`(${n})`):o.type===0&&(!s&&(!l||l.type===3||l.modifier!==3||c||o.prefix!==``)?i+=`*`:i+=`(.*)`),o.type===1&&s&&o.suffix.length&&r.test(o.suffix[0])&&(i+=`\\`),i+=X9(o.suffix),c&&(i+=`}`),o.modifier!==3&&(i+=U9(o.modifier))}return i}var W2t=class{#e;#t={};#n={};#r={};#i={};#a=!1;constructor(e={},t,n){try{let r;if(typeof t==`string`?r=t:n=t,typeof e==`string`){let t=new B2t(e);if(t.parse(),e=t.result,r===void 0&&typeof e.protocol!=`string`)throw TypeError(`A base URL must be provided for a relative constructor string.`);e.baseURL=r}else{if(!e||typeof e!=`object`)throw TypeError(`parameter 1 is not of type 'string' and cannot convert to dictionary.`);if(r)throw TypeError(`parameter 1 is not of type 'string'.`)}typeof n>`u`&&(n={ignoreCase:!1});let i={ignoreCase:n.ignoreCase===!0};this.#e=Y9({pathname:q9,protocol:q9,username:q9,password:q9,hostname:q9,port:q9,search:q9,hash:q9},e,!0),A2t(this.#e.protocol)===this.#e.port&&(this.#e.port=``);let a;for(a of K9){if(!(a in this.#e))continue;let e={},t=this.#e[a];switch(this.#n[a]=[],a){case`protocol`:Object.assign(e,W9),e.encodePart=G9;break;case`username`:Object.assign(e,W9),e.encodePart=j2t;break;case`password`:Object.assign(e,W9),e.encodePart=M2t;break;case`hostname`:Object.assign(e,m2t),y2t(t)?e.encodePart=P2t:e.encodePart=N2t;break;case`port`:Object.assign(e,W9),e.encodePart=F2t;break;case`pathname`:x2t(this.#t.protocol)?(Object.assign(e,h2t,i),e.encodePart=I2t):(Object.assign(e,W9,i),e.encodePart=L2t);break;case`search`:Object.assign(e,W9,i),e.encodePart=R2t;break;case`hash`:Object.assign(e,W9,i),e.encodePart=z2t;break}try{this.#i[a]=u2t(t,e),this.#t[a]=p2t(this.#i[a],this.#n[a],e),this.#r[a]=U2t(this.#i[a],e),this.#a=this.#a||this.#i[a].some(e=>e.type===2)}catch{throw TypeError(`invalid ${a} pattern '${this.#e[a]}'.`)}}}catch(e){throw TypeError(`Failed to construct 'URLPattern': ${e.message}`)}}test(e={},t){let n={pathname:``,protocol:``,username:``,password:``,hostname:``,port:``,search:``,hash:``};if(typeof e!=`string`&&t)throw TypeError(`parameter 1 is not of type 'string'.`);if(typeof e>`u`)return!1;try{n=typeof e==`object`?Y9(n,e,!1):Y9(n,V2t(e,t),!1)}catch{return!1}let r;for(r of K9)if(!this.#t[r].exec(n[r]))return!1;return!0}exec(e={},t){let n={pathname:``,protocol:``,username:``,password:``,hostname:``,port:``,search:``,hash:``};if(typeof e!=`string`&&t)throw TypeError(`parameter 1 is not of type 'string'.`);if(typeof e>`u`)return;try{n=typeof e==`object`?Y9(n,e,!1):Y9(n,V2t(e,t),!1)}catch{return null}let r={};t?r.inputs=[e,t]:r.inputs=[e];let i;for(i of K9){let e=this.#t[i].exec(n[i]);if(!e)return null;let t={};for(let[n,r]of this.#n[i].entries())(typeof r==`string`||typeof r==`number`)&&(t[r]=e[n+1]);r[i]={input:n[i]??``,groups:t}}return r}static compareComponent(e,t,n){let r=(e,t)=>{for(let n of[`type`,`modifier`,`prefix`,`value`,`suffix`]){if(e[n]<t[n])return-1;if(e[n]!==t[n])return 1}return 0},i=new B9(3,``,``,``,``,3),a=new B9(0,``,``,``,``,3),o=(e,t)=>{let n=0;for(;n<Math.min(e.length,t.length);++n){let i=r(e[n],t[n]);if(i)return i}return e.length===t.length?0:r(e[n]??i,t[n]??i)};return!t.#r[e]&&!n.#r[e]?0:t.#r[e]&&!n.#r[e]?o(t.#i[e],[a]):!t.#r[e]&&n.#r[e]?o([a],n.#i[e]):o(t.#i[e],n.#i[e])}get protocol(){return this.#r.protocol}get username(){return this.#r.username}get password(){return this.#r.password}get hostname(){return this.#r.hostname}get port(){return this.#r.port}get pathname(){return this.#r.pathname}get search(){return this.#r.search}get hash(){return this.#r.hash}get hasRegExpGroups(){return this.#a}};globalThis.URLPattern||(globalThis.URLPattern=W2t),hx(),g.createContext(null),g.createContext(void 0),g.createContext(void 0),g.createContext(null),g.createContext(null);var G2t=(0,g.memo)(()=>null);function K2t(){let[e,t]=(0,g.useState)(0);return(0,g.useEffect)(()=>{let e=()=>{let e=document.getElementById(`_sidebar`);e&&t(e.getBoundingClientRect().height+(parseFloat(getComputedStyle(document.documentElement).getPropertyValue(`--banner-height`))||0))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var q2t=kr(Zn((0,W.jsxs)(Jn,{path:`/`,element:(0,W.jsx)(b$t,{enableUpdateNotifications:!1}),errorElement:(0,W.jsx)(aye,{id:`root`}),children:[(0,W.jsx)(Jn,{index:!0,element:(0,W.jsx)(Kn,{replace:!0,to:window.localEditorConfig.defaultPath})}),(0,W.jsx)(Jn,{path:`mcp-oauth-callback`,element:(0,W.jsx)(m_e,{})}),(0,W.jsx)(Jn,{path:`/:account/:project/:environment`,element:(0,W.jsx)(E$t,{}),children:(0,W.jsxs)(Jn,{element:(0,W.jsx)(({navigation:e})=>{let[t,n]=(0,g.useState)(0);(0,g.useEffect)(()=>{let e=()=>{n(document.querySelector(`[data-banner="true"]`)?.offsetHeight||0)};e();let t=new MutationObserver(e);return t.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`class`,`style`]}),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let r=K2t();return(0,W.jsxs)(`div`,{className:`min-h-screen flex flex-col`,style:{"--banner-height":`${t}px`},children:[(0,W.jsx)(G2t,{}),(0,W.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 grid-rows-[min-content_auto]`,children:[e,(0,W.jsx)(Bje,{height:r,children:(0,W.jsx)(g.Suspense,{fallback:null,children:(0,W.jsx)(qn,{})})})]})]})},{navigation:(0,W.jsx)(zje,{})}),children:[(0,W.jsx)(Jn,{index:!0,element:(0,W.jsx)(dZt,{})}),(0,W.jsx)(Jn,{path:`edit`,element:(0,W.jsx)(CXt,{})})]})}),(0,W.jsx)(Jn,{path:`*`,element:(0,W.jsx)(()=>(0,W.jsx)(`div`,{className:`flex items-center justify-center min-h-screen`,children:(0,W.jsx)(x$t,{})}),{})})]}))),J2t=({error:e})=>{let t,n,r=`N/A`,i=e.message,a,o;(e instanceof If||e instanceof Lf)&&(t=e.type,n=e.message,r=e.status??r,i=e.detail,a=e.instance,o=e.traceId),n||=`Oh zup! Something went wrong.`;let s=t??`https://zuplo.com/docs/search?q=${n.replaceAll(` `,`+`)}`,c=t&&Mf.includes(t);i||=r===403?`It looks like you might not have permission to access this resources.`:r===404?`We can't find this. If you believe this is a mistake let us know.`:`An error has occurred. If the problem persists let us know.`;let l=e?.stack?.split(`
|
|
1660
|
+
`);let t=e.state[s];if(t==null)return;JSON.stringify(i.getState())!==JSON.stringify(t)&&p(t);return}i.dispatchFromDevtools&&typeof i.dispatch==`function`&&i.dispatch(e)});case`DISPATCH`:switch(e.payload.type){case`RESET`:return p(m),s===void 0?u?.init(i.getState()):u?.init(V7(c.name));case`COMMIT`:if(s===void 0){u?.init(i.getState());return}return u?.init(V7(c.name));case`ROLLBACK`:return H7(e.state,e=>{if(s===void 0){p(e),u?.init(i.getState());return}p(e[s]),u?.init(V7(c.name))});case`JUMP_TO_STATE`:case`JUMP_TO_ACTION`:return H7(e.state,e=>{if(s===void 0){p(e);return}JSON.stringify(i.getState())!==JSON.stringify(e[s])&&p(e[s])});case`IMPORT_STATE`:{let{nextLiftedState:t}=e.payload,n=t.computedStates.slice(-1)[0]?.state;if(!n)return;p(s===void 0?n:n[s]),u?.send(null,t);return}case`PAUSE_RECORDING`:return f=!f}return}}),m},H7=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){console.error(`[zustand devtools middleware] Could not parse the received json`,e)}n!==void 0&&t(n)};function a$t(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var U7=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return U7(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return U7(t)(e)}}}},o$t=dp()(i$t(((e,t)=>(n,r,i)=>{let a={storage:a$t(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=new Set,c=new Set,l=a.storage;if(!l)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let u=()=>{let e=a.partialize({...r()});return l.setItem(a.name,{state:e,version:a.version})},d=i.setState;i.setState=(e,t)=>{d(e,t),u()};let f=e((...e)=>{n(...e),u()},r,i);i.getInitialState=()=>f;let p,m=()=>{if(!l)return;o=!1,s.forEach(e=>e(r()??f));let e=a.onRehydrateStorage?.call(a,r()??f)||void 0;return U7(l.getItem.bind(l))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(e=>{let[t,i]=e;if(p=a.merge(i,r()??f),n(p,!0),t)return u()}).then(()=>{e?.(p,void 0),p=r(),o=!0,c.forEach(e=>e(p))}).catch(t=>{e?.(void 0,t)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(l=e.storage)},clearStorage:()=>{l?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},a.skipHydration||m(),p||f})(e=>({setEnvironment:t=>e(e=>({...e,environment:{...t,time:Date.now()}})),setAccount:t=>e(e=>({...e,account:{accountName:t,time:Date.now()}}))}),{name:`mru`}))),s$t=()=>{let e=Pj([]),{environment:t,setEnvironment:n}=o$t(),r=Qj(t?.accountName??``,t?.projectName??``,{enabled:!!t?.accountName&&!!t.projectName}).data?.find(e=>e.urlParameter===t?.environmentName);return e.account!==t?.accountName||e.project!==t?.projectName?{setEnvironment:n}:{setEnvironment:n,account:t?.accountName,project:t?.projectName,environment:r?t?.environmentName:void 0}};localStorage.removeItem(`MRU_DATA`);var c$t=()=>{let e=lh([`account`,`project`]),t=s$t(),n=Qj(e.account.name,e.project.name),r=YYt(),i=n.data?.find(e=>e.urlParameter===t.environment),a=r.data?.filter(e=>e.env===i?.environmentType)??[];return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 md:gap-6 mb-6`,children:[(0,W.jsx)(E7,{title:`API Key Consumer`}),(0,W.jsxs)(PS,{variant:`outline`,className:`text-sm`,children:[(0,W.jsx)(pre,{size:20}),(0,W.jsx)(FS,{children:`This page has moved`}),(0,W.jsx)(IS,{children:`API Key Consumers are stored in buckets. Each bucket is associated with one or more environments. You can find all API Key Services in the Services section.`})]}),a.length>0&&(0,W.jsx)(`div`,{className:`font-medium`,children:`Most recently used`}),a.map(e=>(0,W.jsx)(`div`,{className:`grid grid-cols-[1fr_1fr_8rem] gap-6`,children:(0,W.jsx)(n$t,{id:e.id,name:e.name,environments:[e.env]})},e.name)),(0,W.jsx)(Y,{variant:`outline`,className:`self-center`,asChild:!0,children:(0,W.jsx)(Pr,{to:`/${e.account.name}/${e.project.name}/services`,children:`Go to Services`})})]})},l$t=()=>{let{account:e,project:t}=Pj([`account`,`project`]);return(0,W.jsx)(Kn,{to:Ce(YR.Environments,{account:e,project:t})})},u$t=({to:e})=>(0,W.jsx)(Kn,{to:`/accounts/${lh([`account`]).account.name}/settings/${e}`,replace:!0}),d$t=[{key:`general`,group:`project-level`,icon:(0,W.jsx)(pie,{className:`w-4 h-4`}),name:`General`,view:(0,W.jsx)(jQt,{}),testID:`settings-general`},{key:`api-key-consumers`,group:`project-level`,icon:(0,W.jsx)(gre,{className:`w-4 h-4`}),name:`API Key Consumers`,view:(0,W.jsx)(c$t,{})},{key:`environment-variables`,group:`project-level`,icon:(0,W.jsx)(die,{className:`w-4 h-4`}),name:`Environment Variables`,view:(0,W.jsx)(EQt,{}),testID:`settings-environment-variables`},{key:`share-project`,group:`project-level`,icon:(0,W.jsx)(_ie,{className:`w-4 h-4`}),name:`Members & Access`,view:(0,W.jsx)(XQt,{}),testID:`settings-share-project`},{key:`source-control-settings`,group:`project-level`,icon:(0,W.jsx)(Rre,{className:`w-4 h-4`}),name:`Source Control`,view:(0,W.jsx)(e$t,{}),testID:`settings-source-control-settings`},{key:`custom-domain`,group:`project-level`,icon:(0,W.jsx)(Ure,{className:`w-4 h-4`}),name:`Custom Domains`,view:(0,W.jsx)(fQt,{}),testID:`settings-custom-domain`},{key:`upgrade-billing`,group:`account-level`,icon:(0,W.jsx)(wm,{className:`w-4 h-4`}),name:`Billing`,view:(0,W.jsx)(u$t,{to:`upgrade-billing`}),redirect:!0,testID:`settings-upgrade-billing`},{key:`environments`,group:`account-level`,redirect:!0,icon:(0,W.jsx)(Vm,{className:`h-4 w-4`}),name:`Environments`,view:(0,W.jsx)(l$t,{}),testID:`settings-environments`},{key:`zuplo-api-keys`,group:`account-level`,redirect:!0,icon:(0,W.jsx)(Wm,{className:`w-4 h-4`}),name:`Zuplo API Keys`,view:(0,W.jsx)(u$t,{to:`api-keys`}),testID:`settings-zuplo-api-keys`}],f$t=({account:e,project:t,environment:n,navigateTo:r})=>!e||!t||!n?null:(0,W.jsx)(X1,{heading:`Settings`,children:d$t.map(n=>(0,W.jsxs)(Z1,{onSelect:()=>r(Ce(`${YR.Settings}/${n.key}`,{account:e,project:t})),children:[n.icon,(0,W.jsx)(`span`,{className:`ml-3`,children:n.name})]},n.key))}),p$t=(e,t,n)=>{let[r=e,...i]=n??[],a=R1(r,t);return a>0?1+a:i.reduce((e,n)=>Math.max(e,R1(n,t)),0)},W7=({path:e,children:t,navigateTo:n,...r})=>(0,W.jsxs)(Z1,{onSelect:()=>n(Ce(e,r)),children:[(0,W.jsx)(`div`,{className:`mr-2`,children:t??(0,W.jsx)(fre,{className:` h-4 w-4`})}),(0,W.jsx)(`span`,{children:Object.entries(YR).find(([,t])=>t===e)?.at(0)})]});function m$t(){let{isAuthenticated:e}=Lg(),t=fZt(),{account:n,project:r,environment:i}=On(),a=Tn(),o=n&&r&&i,s={account:n,project:r,environment:i},[c,l]=(0,g.useState)(``),u=pZt({enabled:e});VYt(e?u.data?.map(e=>e.name)??[]:[]);let[d,f]=(0,g.useState)(!1);OQ(`meta+k`,()=>{f(!0)});let p=e=>{f(e),e||l(``)},m=e=>{a(e),p(!1)};return(0,W.jsxs)(GEt,{open:d,onOpenChange:p,filter:p$t,children:[(0,W.jsx)(q1,{placeholder:`What do you want to do?`,onValueChange:l,className:`text-md`}),(0,W.jsxs)(J1,{children:[(0,W.jsx)(Y1,{children:(0,W.jsxs)(`div`,{className:`text-muted-foreground my-3`,children:[`No results found "`,c,`".`]})}),o&&(0,W.jsx)(bZt,{navigateTo:m,account:n,project:r,environment:i}),n&&r&&i&&(0,W.jsx)(f$t,{navigateTo:m,...s}),(0,W.jsx)(yZt,{navigateTo:m,accounts:u.data,search:c}),(0,W.jsxs)(X1,{title:t.shortName,children:[(0,W.jsx)(W7,{path:YR.Profile,navigateTo:m,children:(0,W.jsx)(gie,{})}),(0,W.jsx)(W7,{path:YR.Logout,navigateTo:m,children:(0,W.jsx)(qre,{})}),n&&r&&(0,W.jsx)(W7,{path:YR.Settings,navigateTo:m,account:n,project:r,children:(0,W.jsx)(sie,{})}),n&&(0,W.jsx)(W7,{path:YR.AccountSettings,navigateTo:m,account:n,children:(0,W.jsx)(sie,{})})]})]})]})}var h$t=Date.now(),g$t=300*1e3,_$t=14400*1e3,v$t=1440*60*1e3,y$t=async e=>{try{let t=await fetch(e,{method:`HEAD`,cache:`no-cache`});if(!t.ok)return!1;let n=t.headers.get(`date`),r=t.headers.get(`last-modified`);if(!n||!r)return!1;let i=new Date(n).getTime(),a=new Date(r).getTime();if(Number.isNaN(i)||Number.isNaN(a))return!1;let o=i-a>=v$t;return a>h$t&&i>h$t&&o}catch{return!1}},b$t=({enabled:e})=>{let t=(0,g.useRef)(0),n=Bg(),{data:r}=C_({enabled:e,refetchInterval:g$t,refetchIntervalInBackground:!1,networkMode:`online`,retry:!1,queryFn:async()=>{let e=await y$t(window.location.href),r=Date.now();return e&&r-t.current>=_$t?(t.current=r,n.capture(`show-update-toast`),!0):!1},queryKey:[`update-check`]});return(0,W.jsxs)(rh,{open:r??!1,duration:1/0,className:`data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp`,children:[(0,W.jsxs)(Cie,{children:[(0,W.jsx)(ah,{children:`Update available`}),(0,W.jsx)(oh,{children:`A new version of the Zuplo Portal is available. Click to reload.`})]}),(0,W.jsx)(Tie,{altText:`Reload`,children:(0,W.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),children:`Reload`})}),(0,W.jsx)(ih,{})]})},x$t=({enableUpdateNotifications:e})=>(0,W.jsx)(PKe,{children:(0,W.jsxs)(xie,{children:[(0,W.jsx)(b$t,{enabled:e}),(0,W.jsx)(m$t,{}),(0,W.jsx)(Eie,{}),(0,W.jsx)(qn,{}),(0,W.jsx)(Sie,{})]})});function S$t(){return(0,W.jsx)(`div`,{className:`m-auto`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 my-5`,children:[(0,W.jsx)(`div`,{children:(0,W.jsx)(LS,{variant:`outline`,children:`404`})}),(0,W.jsx)(`span`,{className:`text-2xl font-medium`,children:`Oops! Page not found.`}),(0,W.jsx)(`span`,{children:`Sorry, we could not find the page you were looking for.`}),(0,W.jsx)(`div`,{className:`h-2`}),(0,W.jsx)(nye,{hasGoHome:!0})]})})}var C$t=()=>{let{environment:e}=Pj([`environment`]),[t,n]=(0,g.useState)(null),r=dh(e=>e.updateFile),i=dh(e=>e.filesByPath);return{conflict:t,checkForConflictsBeforeSave:(0,g.useCallback)(async(t,r)=>{let a=i[t];try{let i=await np(e,t);return a.lastModified&&i.lastModified&&i.lastModified>a.lastModified?(jf.warn(`File ${t} was modified on disk. Showing conflict dialog before save.`),new Promise(e=>{n({filePath:t,localContent:a.content??``,remoteContent:i.content??``,remoteLastModified:i.lastModified,onProceed:async()=>{await r(),e(!0)}})})):(await r(),!0)}catch(e){return jf.error(`Error checking for conflicts`,{error:e}),await r(),!0}},[e,i]),showConflict:(0,g.useCallback)(e=>{jf.info(`Showing conflict dialog for ${e.filePath}`),n(e)},[]),resolveConflict:(0,g.useCallback)(async a=>{if(!t)return;let o=i[t.filePath];if(!o){n(null);return}if(a===`remote`)r({...o,content:t.remoteContent,lastModified:t.remoteLastModified,saveState:ei.unmodified}),jf.info(`Using disk version for ${t.filePath}, canceling save`),n(null);else if(jf.info(`User chose local version for ${t.filePath}${t.onProceed?`, proceeding with save`:`, saving to disk`}`),t.onProceed)await t.onProceed(),n(null);else try{await ip(e,{path:o.path,content:o.content},{forceSave:!0});let i=await np(e,t.filePath);r({...o,lastModified:i.lastModified,saveState:ei.unmodified}),jf.info(`Successfully saved local version for ${t.filePath}`),n(null)}catch(e){jf.error(`Error saving local version for ${t.filePath}`,{error:e}),r({...o,saveState:ei.modified})}},[t,i,r,e]),cancelConflict:(0,g.useCallback)(async()=>{if(!t)return;let a=i[t.filePath];if(a){let n=await np(e,t.filePath);r({...a,lastModified:n.lastModified,saveState:ei.modified}),jf.info(`Conflict dialog canceled for ${t.filePath}, file marked as modified`)}n(null)},[t,i,r,e])}};function w$t({open:e,filePath:t,localContent:n,remoteContent:r,onResolve:i,onCancel:a}){let[o,s]=(0,g.useState)(`local`),c=Ej(t);return(0,W.jsx)(kA,{open:e,onOpenChange:e=>!e&&a(),children:(0,W.jsxs)(MA,{className:`max-w-7xl max-h-[90vh] p-0`,showCloseButton:!1,children:[(0,W.jsx)(`div`,{className:`p-6 pb-0`,children:(0,W.jsxs)(NA,{children:[(0,W.jsx)(FA,{className:`text-lg font-semibold text-left mb-1`,children:`File Conflict Detected`}),(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground text-left`,children:[(0,W.jsx)(`span`,{className:`font-mono font-semibold`,children:t}),` has been modified both locally and on disk`]})]})}),(0,W.jsxs)(`div`,{className:`flex-1 min-h-0 flex flex-col px-6`,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-2`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`flex flex-col py-3 cursor-pointer transition-all border-t-4 border-x ${o===`local`?`border-t-pink-500 border-x-pink-200 bg-pink-50`:`border-t-border border-x-border bg-gray-50 dark:bg-neutral-900 hover:bg-gray-100 dark:hover:bg-neutral-800`}`,style:{paddingLeft:`26px`,paddingRight:`24px`},onClick:()=>s(`local`),"aria-pressed":o===`local`,children:[(0,W.jsx)(`div`,{className:`font-semibold text-sm`,children:`Browser Version`}),(0,W.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Current editor content`})]}),(0,W.jsxs)(`button`,{type:`button`,className:`flex flex-col px-6 py-3 cursor-pointer transition-all border-t-4 border-x ${o===`remote`?`border-t-pink-500 border-x-pink-200 bg-pink-50`:`border-t-border border-x-border bg-gray-50 dark:bg-neutral-900 hover:bg-gray-100 dark:hover:bg-neutral-800`}`,onClick:()=>s(`remote`),"aria-pressed":o===`remote`,children:[(0,W.jsx)(`div`,{className:`font-semibold text-sm`,children:`Disk Version`}),(0,W.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`File on disk`})]})]}),(0,W.jsx)(`div`,{className:`border border-t-0 overflow-hidden shadow-xs flex-1 min-h-[55vh]`,children:(0,W.jsx)(CP,{original:n,modified:r,language:c,options:{readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,wordWrap:`off`}})})]}),(0,W.jsxs)(PA,{className:`px-6 pb-6 flex-row justify-between items-center`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o===`local`?(0,W.jsx)(W.Fragment,{children:`Browser version will be saved to disk`}):(0,W.jsx)(W.Fragment,{children:`Disk version will replace browser content`})}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(Y,{variant:`ghost`,onClick:a,children:`Cancel`}),(0,W.jsxs)(Y,{variant:`default`,onClick:()=>i(o),children:[`Apply `,o===`local`?`Browser`:`Disk`,` Version`]})]})]})]})})}function T$t(){let{environment:e}=Pj([`environment`]),{conflict:t,showConflict:n,resolveConflict:r,cancelConflict:i}=C$t(),a=dh(e=>e.filesByPath),o=dh(e=>e.saveConflictPath),s=dh(e=>e.clearSaveConflict);return(0,g.useEffect)(()=>{if(o){jf.info(`Save conflict detected for ${o}`);let t=a[o];t?np(e,o).then(e=>{n({filePath:o,localContent:t.content??``,remoteContent:e.content??``,remoteLastModified:e.lastModified})}).catch(e=>{jf.error(`Error fetching file for conflict dialog`,{error:e})}):jf.warn(`No file model found for ${o}`),s()}},[o,a,s,n,e]),t?(0,W.jsx)(w$t,{open:!0,filePath:t.filePath,localContent:t.localContent,remoteContent:t.remoteContent,onResolve:r,onCancel:i}):null}var E$t=()=>{let e=lh(),{monaco:t,reloadFiles:n}=C1(),r=zA(n.execute),i=e.environment.name,{error:a}=C_({queryKey:[`reloadFiles`,e.account.name,e.project.name,i],queryFn:async()=>{try{return await r.current({accountName:e.account.name,projectName:e.project.name,environmentName:e.environment.name}),!0}catch(e){throw jf.error(`Failed to reload files`,{error:e}),e}},refetchOnWindowFocus:!1,enabled:!!t&&!!i,retry:3,retryDelay:e=>Math.min(1e3*2**e,3e4)});return a?(0,W.jsx)(`div`,{className:`flex items-center justify-center h-full bg-gray-50`,children:(0,W.jsxs)(`div`,{className:`text-center p-8 max-w-lg`,children:[(0,W.jsx)(`h2`,{className:`text-xl font-semibold text-gray-900 mb-2`,children:`Failed to Load Files`}),(0,W.jsx)(`p`,{className:`text-gray-600 mb-4`,children:`Unable to load project files from the local server. Please check that the dev server is running and try again.`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`px-4 py-2 bg-blue-600 text-white rounded-sm hover:bg-blue-700`,children:`Retry`})]})}):null},D$t=()=>{let{account:e,project:t}=Pj([`account`,`project`]),n=dh(e=>e.resetStore);return(0,g.useEffect)(()=>{n()},[t,e,n]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(E$t,{}),(0,W.jsx)(T$t,{}),(0,W.jsx)(jTt,{}),(0,W.jsx)(qn,{})]})};g.createContext({en:{translations:{archiveNotification:`Archive this notification`,archiveRead:`Archive Read`,markAllAsRead:`Mark all as read`,notifications:`Notifications`,emptyFeedTitle:`No notifications yet`,emptyFeedBody:`We'll let you know when we've got something new for you.`,all:`All`,unread:`Unread`,read:`Read`,unseen:`Unseen`,msTeamsChannelSetError:`Error setting channel.`,msTeamsConnect:`Connect to Microsoft Teams`,msTeamsConnected:`Connected`,msTeamsConnecting:`Connecting to Microsoft Teams…`,msTeamsConnectionErrorExists:`Try reconnecting to Microsoft Teams to find and select channels from your teams.`,msTeamsConnectionErrorOccurred:`There was an error connecting to Microsoft Teams. Try reconnecting to find and select channels from your teams.`,msTeamsConnectContainerDescription:`Connect to get notifications in Microsoft Teams`,msTeamsDisconnect:`Disconnect`,msTeamsDisconnecting:`Disconnecting from Microsoft Teams…`,msTeamsError:`Error`,msTeamsReconnect:`Reconnect`,msTeamsTenantIdNotSet:`Microsoft Teams tenant ID not set.`,slackConnectChannel:`Connect channel`,slackChannelId:`Slack channel ID`,slackConnecting:`Connecting to Slack...`,slackDisconnecting:`Disconnecting...`,slackConnect:`Connect to Slack`,slackConnected:`Connected`,slackConnectContainerDescription:`Connect to get notifications in your Slack workspace.`,slackSearchbarDisconnected:`Slack is not connected.`,slackSearchbarNoChannelsConnected:`Search channels`,slackSearchbarNoChannelsFound:`No slack channels.`,slackSearchbarChannelsError:`Error fetching channels.`,slackSearchChannels:`Search channels`,slackConnectionErrorExists:`Try reconnecting to Slack to find and select channels from your workspace.`,slackConnectionErrorOccurred:`There was an error connecting to Slack. Try reconnecting to find and select channels from your workspace.`,slackChannelAlreadyConnected:`Error: already connected`,slackError:`Error`,slackDisconnect:`Disconnect`,slackChannelSetError:`Error setting channel.`,slackAccessTokenNotSet:`Access token not set.`,slackReconnect:`Reconnect`},locale:`en`},de:{translations:{archiveNotification:`Benachrichtigung archivieren`,archiveRead:`Gelesenes Archivieren`,markAllAsRead:`Alle als gelesen markieren`,notifications:`Benachrichtigungen`,emptyFeedTitle:`Noch keine Benachrichtigungen`,emptyFeedBody:`Wir werden dich benachrichtigen, sobald wir etwas Neues für dich haben.`,all:`Alle`,unread:`Ungelesen`,read:`Gelesen`,unseen:`Ungesehen`,slackConnectChannel:`Kanal verbinden`,slackChannelId:`Slack Kanal ID`,slackConnecting:`Verbinden mit Slack...`,slackDisconnecting:`Trennen der Verbindung...`,slackConnect:`Mit Slack verbinden`,slackConnected:`Verbunden`,slackConnectContainerDescription:`Verbinden, um Benachrichtigungen in Ihrem Slack-Arbeitsbereich zu erhalten.`,slackSearchbarDisconnected:`Slack ist nicht verbunden.`,slackSearchbarNoChannelsConnected:`Suchkanäle`,slackSearchbarNoChannelsFound:`Keine schlaffen Kanäle.`,slackSearchbarChannelsError:`Fehler beim Abrufen von Kanälen.`,slackSearchChannels:`Suchkanäle`,slackConnectionErrorExists:`Versuchen Sie, sich erneut mit Slack zu verbinden, um Kanäle in Ihrem Arbeitsbereich zu finden und auszuwählen.`,slackConnectionErrorOccurred:`Es ist ein Fehler beim Verbinden mit Slack aufgetreten. Versuchen Sie, sich erneut zu verbinden, um Kanäle in Ihrem Arbeitsbereich zu finden und auszuwählen.`,slackChannelAlreadyConnected:`Fehler: bereits verbunden`,slackError:`Fehler`,slackDisconnect:`Trennen Sie die Verbindung.`,slackChannelSetError:`Fehlereinstellung Kanal.`,slackAccessTokenNotSet:`Zugriffstoken nicht gesetzt.`,slackReconnect:`Neu verbinden`},locale:`de`}}.en),i(((e,t)=>{(function(n){var r=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(e){return Object.prototype.toString.call(e)===`[object Array]`},a=10,o=typeof process==`object`&&typeof process.nextTick==`function`,s=typeof Symbol==`function`,c=typeof Reflect==`object`,l=typeof setImmediate==`function`?setImmediate:setTimeout,u=s?c&&typeof Reflect.ownKeys==`function`?Reflect.ownKeys:function(e){var t=Object.getOwnPropertyNames(e);return t.push.apply(t,Object.getOwnPropertySymbols(e)),t}:Object.keys;function d(){this._events={},this._conf&&f.call(this,this._conf)}function f(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners!==n&&(this._maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(e,t){var n=`(node) warning: possible EventEmitter memory leak detected. `+e+` listeners added. Use emitter.setMaxListeners() to increase limit.`;if(this.verboseMemoryLeak&&(n+=` Event name: `+t+`.`),typeof process<`u`&&process.emitWarning){var r=Error(n);r.name=`MaxListenersExceededWarning`,r.emitter=this,r.count=e,process.emitWarning(r)}else console.error(n),console.trace&&console.trace()}var m=function(e,t,n){var r=arguments.length;switch(r){case 0:return[];case 1:return[e];case 2:return[e,t];case 3:return[e,t,n];default:for(var i=Array(r);r--;)i[r]=arguments[r];return i}};function h(e,t){for(var r={},i,a=e.length,o=t?t.length:0,s=0;s<a;s++)i=e[s],r[i]=s<o?t[s]:n;return r}function g(e,t,n){this._emitter=e,this._target=t,this._listeners={},this._listenersCount=0;var r,i;if((n.on||n.off)&&(r=n.on,i=n.off),t.addEventListener?(r=t.addEventListener,i=t.removeEventListener):t.addListener?(r=t.addListener,i=t.removeListener):t.on&&(r=t.on,i=t.off),!r&&!i)throw Error(`target does not implement any known event API`);if(typeof r!=`function`)throw TypeError(`on method must be a function`);if(typeof i!=`function`)throw TypeError(`off method must be a function`);this._on=r,this._off=i;var a=e._observers;a?a.push(this):e._observers=[this]}Object.assign(g.prototype,{subscribe:function(e,t,n){var r=this,i=this._target,a=this._emitter,o=this._listeners,s=function(){var r=m.apply(null,arguments),o={data:r,name:t,original:e};if(n){n.call(i,o)!==!1&&a.emit.apply(a,[o.name].concat(r));return}a.emit.apply(a,[t].concat(r))};if(o[e])throw Error(`Event '`+e+`' is already listening`);this._listenersCount++,a._newListener&&a._removeListener&&!r._onNewListener?(this._onNewListener=function(n){n===t&&o[e]===null&&(o[e]=s,r._on.call(i,e,s))},a.on(`newListener`,this._onNewListener),this._onRemoveListener=function(n){n===t&&!a.hasListeners(n)&&o[e]&&(o[e]=null,r._off.call(i,e,s))},o[e]=null,a.on(`removeListener`,this._onRemoveListener)):(o[e]=s,r._on.call(i,e,s))},unsubscribe:function(e){var t=this,n=this._listeners,r=this._emitter,i,a,o=this._off,s=this._target,c;if(e&&typeof e!=`string`)throw TypeError(`event must be a string`);function l(){t._onNewListener&&(r.off(`newListener`,t._onNewListener),r.off(`removeListener`,t._onRemoveListener),t._onNewListener=null,t._onRemoveListener=null);var e=C.call(r,t);r._observers.splice(e,1)}if(e){if(i=n[e],!i)return;o.call(s,e,i),delete n[e],--this._listenersCount||l()}else{for(a=u(n),c=a.length;c-- >0;)e=a[c],o.call(s,e,n[e]);this._listeners={},this._listenersCount=0,l()}}});function _(e,t,i,a){var o=Object.assign({},t);if(!e)return o;if(typeof e!=`object`)throw TypeError(`options must be an object`);var s=Object.keys(e),c=s.length,l,u,d;function f(e){throw Error(`Invalid "`+l+`" option value`+(e?`. Reason: `+e:``))}for(var p=0;p<c;p++){if(l=s[p],!a&&!r.call(t,l))throw Error(`Unknown "`+l+`" option`);u=e[l],u!==n&&(d=i[l],o[l]=d?d(u,f):u)}return o}function v(e,t){return(typeof e!=`function`||!e.hasOwnProperty(`prototype`))&&t(`value must be a constructor`),e}function y(e){var t=`value must be type of `+e.join(`|`),n=e.length,r=e[0],i=e[1];return n===1?function(e,n){if(typeof e===r)return e;n(t)}:n===2?function(e,n){var a=typeof e;if(a===r||a===i)return e;n(t)}:function(r,i){for(var a=typeof r,o=n;o-- >0;)if(a===e[o])return r;i(t)}}var b=y([`function`]),x=y([`object`,`function`]);function S(e,t,n){var r,i,a=0,o,s=new e(function(c,l,u){n=_(n,{timeout:0,overload:!1},{timeout:function(e,t){return e*=1,(typeof e!=`number`||e<0||!Number.isFinite(e))&&t(`timeout must be a positive number`),e}}),r=!n.overload&&typeof e.prototype.cancel==`function`&&typeof u==`function`;function d(){i&&=null,a&&=(clearTimeout(a),0)}var f=function(e){d(),c(e)},p=function(e){d(),l(e)};r?t(f,p,u):(i=[function(e){p(e||Error(`canceled`))}],t(f,p,function(e){if(o)throw Error(`Unable to subscribe on cancel event asynchronously`);if(typeof e!=`function`)throw TypeError(`onCancel callback must be a function`);i.push(e)}),o=!0),n.timeout>0&&(a=setTimeout(function(){var e=Error(`timeout`);e.code=`ETIMEDOUT`,a=0,s.cancel(e),l(e)},n.timeout))});return r||(s.cancel=function(e){if(i){for(var t=i.length,n=1;n<t;n++)i[n](e);i[0](e),i=null}}),s}function C(e){var t=this._observers;if(!t)return-1;for(var n=t.length,r=0;r<n;r++)if(t[r]._target===e)return r;return-1}function w(e,t,n,r,i){if(!n)return null;if(r===0){var a=typeof t;if(a===`string`){var o,s,c=0,l=0,d=this.delimiter,f=d.length;if((s=t.indexOf(d))!==-1){o=[,,,,,];do o[c++]=t.slice(l,s),l=s+f;while((s=t.indexOf(d,l))!==-1);o[c++]=t.slice(l),t=o,i=c}else t=[t],i=1}else a===`object`?i=t.length:(t=[t],i=1)}var p=null,m,h,g,_,v,y=t[r],b=t[r+1],x,S;if(r===i)n._listeners&&(typeof n._listeners==`function`?(e&&e.push(n._listeners),p=[n]):(e&&e.push.apply(e,n._listeners),p=[n]));else if(y===`*`){for(x=u(n),s=x.length;s-- >0;)m=x[s],m!==`_listeners`&&(S=w(e,t,n[m],r+1,i),S&&(p?p.push.apply(p,S):p=S));return p}else if(y===`**`){for(v=r+1===i||r+2===i&&b===`*`,v&&n._listeners&&(p=w(e,t,n,i,i)),x=u(n),s=x.length;s-- >0;)m=x[s],m!==`_listeners`&&(m===`*`||m===`**`?(n[m]._listeners&&!v&&(S=w(e,t,n[m],i,i),S&&(p?p.push.apply(p,S):p=S)),S=w(e,t,n[m],r,i)):S=m===b?w(e,t,n[m],r+2,i):w(e,t,n[m],r,i),S&&(p?p.push.apply(p,S):p=S));return p}else n[y]&&(p=w(e,t,n[y],r+1,i));if(h=n[`*`],h&&w(e,t,h,r+1,i),g=n[`**`],g)if(r<i)for(g._listeners&&w(e,t,g,i,i),x=u(g),s=x.length;s-- >0;)m=x[s],m!==`_listeners`&&(m===b?w(e,t,g[m],r+2,i):m===y?w(e,t,g[m],r+1,i):(_={},_[m]=g[m],w(e,t,{"**":_},r+1,i)));else g._listeners?w(e,t,g,i,i):g[`*`]&&g[`*`]._listeners&&w(e,t,g[`*`],i,i);return p}function T(e,t,n){var r=0,i=0,a,o=this.delimiter,s=o.length,c;if(typeof e==`string`)if((a=e.indexOf(o))!==-1){c=[,,,,,];do c[r++]=e.slice(i,a),i=a+s;while((a=e.indexOf(o,i))!==-1);c[r++]=e.slice(i)}else c=[e],r=1;else c=e,r=e.length;if(r>1){for(a=0;a+1<r;a++)if(c[a]===`**`&&c[a+1]===`**`)return}var l=this.listenerTree,u;for(a=0;a<r;a++)if(u=c[a],l=l[u]||(l[u]={}),a===r-1)return l._listeners?(typeof l._listeners==`function`&&(l._listeners=[l._listeners]),n?l._listeners.unshift(t):l._listeners.push(t),!l._listeners.warned&&this._maxListeners>0&&l._listeners.length>this._maxListeners&&(l._listeners.warned=!0,p.call(this,l._listeners.length,u))):l._listeners=t,!0;return!0}function E(e,t,n,r){for(var i=u(e),a=i.length,o,s,c,l=e._listeners,d;a-- >0;)s=i[a],o=e[s],c=s===`_listeners`?n:n?n.concat(s):[s],d=r||typeof s==`symbol`,l&&t.push(d?c:c.join(this.delimiter)),typeof o==`object`&&E.call(this,o,t,c,d);return t}function D(e){for(var t=u(e),n=t.length,r,i,a;n-- >0;)i=t[n],r=e[i],r&&(a=!0,i!==`_listeners`&&!D(r)&&delete e[i]);return a}function O(e,t,n){this.emitter=e,this.event=t,this.listener=n}O.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function k(e,t,r){if(r===!0)a=!0;else if(r===!1)i=!0;else{if(!r||typeof r!=`object`)throw TypeError(`options should be an object or true`);var i=r.async,a=r.promisify,s=r.nextTick,c=r.objectify}if(i||s||a){var u=t,d=t._origin||t;if(s&&!o)throw Error(`process.nextTick is not supported`);a===n&&(a=t.constructor.name===`AsyncFunction`),t=function(){var e=arguments,t=this,n=this.event;return a?s?Promise.resolve():new Promise(function(e){l(e)}).then(function(){return t.event=n,u.apply(t,e)}):(s?process.nextTick:l)(function(){t.event=n,u.apply(t,e)})},t._async=!0,t._origin=d}return[t,c?new O(this,e,t):this]}function A(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,f.call(this,e)}A.EventEmitter2=A,A.prototype.listenTo=function(e,t,r){if(typeof e!=`object`)throw TypeError(`target musts be an object`);var a=this;r=_(r,{on:n,off:n,reducers:n},{on:b,off:b,reducers:x});function o(t){if(typeof t!=`object`)throw TypeError(`events must be an object`);for(var n=r.reducers,i=C.call(a,e),o=i===-1?new g(a,e,r):a._observers[i],s=u(t),c=s.length,l,d=typeof n==`function`,f=0;f<c;f++)l=s[f],o.subscribe(l,t[l]||l,d?n:n&&n[l])}return i(t)?o(h(t)):o(typeof t==`string`?h(t.split(/\s+/)):t),this},A.prototype.stopListeningTo=function(e,t){var n=this._observers;if(!n)return!1;var r=n.length,i,a=!1;if(e&&typeof e!=`object`)throw TypeError(`target should be an object`);for(;r-- >0;)i=n[r],(!e||i._target===e)&&(i.unsubscribe(t),a=!0);return a},A.prototype.delimiter=`.`,A.prototype.setMaxListeners=function(e){e!==n&&(this._maxListeners=e,this._conf||={},this._conf.maxListeners=e)},A.prototype.getMaxListeners=function(){return this._maxListeners},A.prototype.event=``,A.prototype.once=function(e,t,n){return this._once(e,t,!1,n)},A.prototype.prependOnceListener=function(e,t,n){return this._once(e,t,!0,n)},A.prototype._once=function(e,t,n,r){return this._many(e,1,t,n,r)},A.prototype.many=function(e,t,n,r){return this._many(e,t,n,!1,r)},A.prototype.prependMany=function(e,t,n,r){return this._many(e,t,n,!0,r)},A.prototype._many=function(e,t,n,r,i){var a=this;if(typeof n!=`function`)throw Error(`many only accepts instances of Function`);function o(){return--t===0&&a.off(e,o),n.apply(this,arguments)}return o._origin=n,this._on(e,o,r,i)},A.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var e=arguments[0],t,n=this.wildcard,r,i,a,o,c;if(e===`newListener`&&!this._newListener&&!this._events.newListener)return!1;if(n&&(t=e,e!==`newListener`&&e!==`removeListener`&&typeof e==`object`)){if(i=e.length,s){for(a=0;a<i;a++)if(typeof e[a]==`symbol`){c=!0;break}}c||(e=e.join(this.delimiter))}var l=arguments.length,u;if(this._all&&this._all.length)for(u=this._all.slice(),a=0,i=u.length;a<i;a++)switch(this.event=e,l){case 1:u[a].call(this,e);break;case 2:u[a].call(this,e,arguments[1]);break;case 3:u[a].call(this,e,arguments[1],arguments[2]);break;default:u[a].apply(this,arguments)}if(n)u=[],w.call(this,u,t,this.listenerTree,0,i);else if(u=this._events[e],typeof u==`function`){switch(this.event=e,l){case 1:u.call(this);break;case 2:u.call(this,arguments[1]);break;case 3:u.call(this,arguments[1],arguments[2]);break;default:for(r=Array(l-1),o=1;o<l;o++)r[o-1]=arguments[o];u.apply(this,r)}return!0}else u&&=u.slice();if(u&&u.length){if(l>3)for(r=Array(l-1),o=1;o<l;o++)r[o-1]=arguments[o];for(a=0,i=u.length;a<i;a++)switch(this.event=e,l){case 1:u[a].call(this);break;case 2:u[a].call(this,arguments[1]);break;case 3:u[a].call(this,arguments[1],arguments[2]);break;default:u[a].apply(this,r)}return!0}else if(!this.ignoreErrors&&!this._all&&e===`error`)throw arguments[1]instanceof Error?arguments[1]:Error(`Uncaught, unspecified 'error' event.`);return!!this._all},A.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var e=arguments[0],t=this.wildcard,n,r,i,a,o,c;if(e===`newListener`&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(t&&(n=e,e!==`newListener`&&e!==`removeListener`&&typeof e==`object`)){if(a=e.length,s){for(o=0;o<a;o++)if(typeof e[o]==`symbol`){r=!0;break}}r||(e=e.join(this.delimiter))}var l=[],u=arguments.length,f;if(this._all)for(o=0,a=this._all.length;o<a;o++)switch(this.event=e,u){case 1:l.push(this._all[o].call(this,e));break;case 2:l.push(this._all[o].call(this,e,arguments[1]));break;case 3:l.push(this._all[o].call(this,e,arguments[1],arguments[2]));break;default:l.push(this._all[o].apply(this,arguments))}if(t?(f=[],w.call(this,f,n,this.listenerTree,0)):f=this._events[e],typeof f==`function`)switch(this.event=e,u){case 1:l.push(f.call(this));break;case 2:l.push(f.call(this,arguments[1]));break;case 3:l.push(f.call(this,arguments[1],arguments[2]));break;default:for(i=Array(u-1),c=1;c<u;c++)i[c-1]=arguments[c];l.push(f.apply(this,i))}else if(f&&f.length){if(f=f.slice(),u>3)for(i=Array(u-1),c=1;c<u;c++)i[c-1]=arguments[c];for(o=0,a=f.length;o<a;o++)switch(this.event=e,u){case 1:l.push(f[o].call(this));break;case 2:l.push(f[o].call(this,arguments[1]));break;case 3:l.push(f[o].call(this,arguments[1],arguments[2]));break;default:l.push(f[o].apply(this,i))}}else if(!this.ignoreErrors&&!this._all&&e===`error`)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject(`Uncaught, unspecified 'error' event.`);return Promise.all(l)},A.prototype.on=function(e,t,n){return this._on(e,t,!1,n)},A.prototype.prependListener=function(e,t,n){return this._on(e,t,!0,n)},A.prototype.onAny=function(e){return this._onAny(e,!1)},A.prototype.prependAny=function(e){return this._onAny(e,!0)},A.prototype.addListener=A.prototype.on,A.prototype._onAny=function(e,t){if(typeof e!=`function`)throw Error(`onAny only accepts instances of Function`);return this._all||=[],t?this._all.unshift(e):this._all.push(e),this},A.prototype._on=function(e,t,r,i){if(typeof e==`function`)return this._onAny(e,t),this;if(typeof t!=`function`)throw Error(`on only accepts instances of Function`);this._events||d.call(this);var a=this,o;return i!==n&&(o=k.call(this,e,t,i),t=o[0],a=o[1]),this._newListener&&this.emit(`newListener`,e,t),this.wildcard?(T.call(this,e,t,r),a):(this._events[e]?(typeof this._events[e]==`function`&&(this._events[e]=[this._events[e]]),r?this._events[e].unshift(t):this._events[e].push(t),!this._events[e].warned&&this._maxListeners>0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,p.call(this,this._events[e].length,e))):this._events[e]=t,a)},A.prototype.off=function(e,t){if(typeof t!=`function`)throw Error(`removeListener only takes instances of Function`);var n,r=[];if(this.wildcard){var a=typeof e==`string`?e.split(this.delimiter):e.slice();if(r=w.call(this,null,a,this.listenerTree,0),!r)return this}else{if(!this._events[e])return this;n=this._events[e],r.push({_listeners:n})}for(var o=0;o<r.length;o++){var s=r[o];if(n=s._listeners,i(n)){for(var c=-1,l=0,u=n.length;l<u;l++)if(n[l]===t||n[l].listener&&n[l].listener===t||n[l]._origin&&n[l]._origin===t){c=l;break}if(c<0)continue;return this.wildcard?s._listeners.splice(c,1):this._events[e].splice(c,1),n.length===0&&(this.wildcard?delete s._listeners:delete this._events[e]),this._removeListener&&this.emit(`removeListener`,e,t),this}else (n===t||n.listener&&n.listener===t||n._origin&&n._origin===t)&&(this.wildcard?delete s._listeners:delete this._events[e],this._removeListener&&this.emit(`removeListener`,e,t))}return this.listenerTree&&D(this.listenerTree),this},A.prototype.offAny=function(e){var t=0,n=0,r;if(e&&this._all&&this._all.length>0){for(r=this._all,t=0,n=r.length;t<n;t++)if(e===r[t])return r.splice(t,1),this._removeListener&&this.emit(`removeListenerAny`,e),this}else{if(r=this._all,this._removeListener)for(t=0,n=r.length;t<n;t++)this.emit(`removeListenerAny`,r[t]);this._all=[]}return this},A.prototype.removeListener=A.prototype.off,A.prototype.removeAllListeners=function(e){if(e===n)return!this._events||d.call(this),this;if(this.wildcard){var t=w.call(this,null,e,this.listenerTree,0),r,i;if(!t)return this;for(i=0;i<t.length;i++)r=t[i],r._listeners=null;this.listenerTree&&D(this.listenerTree)}else this._events&&(this._events[e]=null);return this},A.prototype.listeners=function(e){var t=this._events,r,i,a,o,s;if(e===n){if(this.wildcard)throw Error(`event name required for wildcard emitter`);if(!t)return[];for(r=u(t),o=r.length,a=[];o-- >0;)i=t[r[o]],typeof i==`function`?a.push(i):a.push.apply(a,i);return a}else{if(this.wildcard){if(s=this.listenerTree,!s)return[];var c=[],l=typeof e==`string`?e.split(this.delimiter):e.slice();return w.call(this,c,l,s,0),c}return!t||(i=t[e],!i)?[]:typeof i==`function`?[i]:i}},A.prototype.eventNames=function(e){var t=this._events;return this.wildcard?E.call(this,this.listenerTree,[],null,e):t?u(t):[]},A.prototype.listenerCount=function(e){return this.listeners(e).length},A.prototype.hasListeners=function(e){if(this.wildcard){var t=[],r=typeof e==`string`?e.split(this.delimiter):e.slice();return w.call(this,t,r,this.listenerTree,0),t.length>0}var i=this._events,a=this._all;return!!(a&&a.length||i&&(e===n?u(i).length:i[e]))},A.prototype.listenersAny=function(){return this._all?this._all:[]},A.prototype.waitFor=function(e,t){var r=this,i=typeof t;return i===`number`?t={timeout:t}:i===`function`&&(t={filter:t}),t=_(t,{timeout:0,filter:n,handleError:!1,Promise,overload:!1},{filter:b,Promise:v}),S(t.Promise,function(n,i,a){function o(){var a=t.filter;if(!(a&&!a.apply(r,arguments)))if(r.off(e,o),t.handleError){var s=arguments[0];s?i(s):n(m.apply(null,arguments).slice(1))}else n(m.apply(null,arguments))}a(function(){r.off(e,o)}),r._on(e,o,!1)},{timeout:t.timeout,overload:t.overload})};function j(e,t,n){n=_(n,{Promise,timeout:0,overload:!1},{Promise:v});var r=n.Promise;return S(r,function(n,r,i){var a;if(typeof e.addEventListener==`function`){a=function(){n(m.apply(null,arguments))},i(function(){e.removeEventListener(t,a)}),e.addEventListener(t,a,{once:!0});return}var o=function(){s&&e.removeListener(`error`,s),n(m.apply(null,arguments))},s;t!==`error`&&(s=function(n){e.removeListener(t,o),r(n)},e.once(`error`,s)),i(function(){s&&e.removeListener(`error`,s),e.removeListener(t,o)}),e.once(t,o)},{timeout:n.timeout,overload:n.overload})}var M=A.prototype;if(Object.defineProperties(A,{defaultMaxListeners:{get:function(){return M._maxListeners},set:function(e){if(typeof e!=`number`||e<0||Number.isNaN(e))throw TypeError(`n must be a non-negative number`);M._maxListeners=e},enumerable:!0},once:{value:j,writable:!0,configurable:!0}}),Object.defineProperties(M,{_maxListeners:{value:a,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define==`function`&&define.amd)define(function(){return A});else if(typeof e==`object`)t.exports=A;else{var N=Function(``,`return this`)();N.EventEmitter2=A}})()}))();var O$t=(e=>(e.loading=`loading`,e.fetchMore=`fetchMore`,e.ready=`ready`,e.error=`error`,e))(O$t||{}),G7=new WeakMap,K7=new WeakMap,q7={current:[]},J7=!1,k$t=0,Y7=new Set,X7=new Map;function A$t(e){let t=Array.from(e).sort((e,t)=>e instanceof I$t&&e.options.deps.includes(t)?1:t instanceof I$t&&t.options.deps.includes(e)?-1:0);for(let e of t){if(q7.current.includes(e))continue;q7.current.push(e),e.recompute();let t=K7.get(e);if(t)for(let e of t){let t=G7.get(e);t&&A$t(t)}}}function j$t(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function M$t(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function N$t(e){if(k$t>0&&!X7.has(e)&&X7.set(e,e.prevState),Y7.add(e),!(k$t>0)&&!J7)try{for(J7=!0;Y7.size>0;){let e=Array.from(Y7);Y7.clear();for(let t of e)t.prevState=X7.get(t)??t.prevState,j$t(t);for(let t of e){let e=G7.get(t);e&&(q7.current.push(t),A$t(e))}for(let t of e){let e=G7.get(t);if(e)for(let t of e)M$t(t)}}}finally{J7=!1,q7.current=[],X7.clear()}}function P$t(e){return typeof e==`function`}var F$t=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):P$t(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),N$t(this)}},I$t=class e{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),(t=(e=this.options).onUpdate)==null||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let t of this.options.deps)t instanceof e&&t.checkIfRecalculationNeededDeeply();let t=!1,n=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let e=0;e<r.length;e++)if(r[e]!==n[e]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(let e of this._subscriptions)e()}),this.subscribe=e=>{var t;this.listeners.add(e);let n=(t=this.options).onSubscribe?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(let n of t)if(n instanceof e)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof F$t){let e=G7.get(n);e||(e=new Set,G7.set(n,e)),e.add(this);let t=K7.get(this);t||(t=new Set,K7.set(this,t)),t.add(n)}}unregisterFromGraph(t=this.options.deps){for(let n of t)if(n instanceof e)this.unregisterFromGraph(n.options.deps);else if(n instanceof F$t){let e=G7.get(n);e&&e.delete(this);let t=K7.get(this);t&&t.delete(n)}}};({NewMessage:`new-message`}).NewMessage,O$t.ready;var L$t=class extends Error{};L$t.prototype.name=`InvalidTokenError`;function R$t(e,t){return function(){return e.apply(t,arguments)}}var{toString:z$t}=Object.prototype,{getPrototypeOf:Z7}=Object,{iterator:Q7,toStringTag:B$t}=Symbol,$7=(e=>t=>{let n=z$t.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),e9=e=>(e=e.toLowerCase(),t=>$7(t)===e),t9=e=>t=>typeof t===e,{isArray:n9}=Array,r9=t9(`undefined`);function i9(e){return e!==null&&!r9(e)&&e.constructor!==null&&!r9(e.constructor)&&a9(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var V$t=e9(`ArrayBuffer`);function H$t(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&V$t(e.buffer),t}var U$t=t9(`string`),a9=t9(`function`),W$t=t9(`number`),o9=e=>typeof e==`object`&&!!e,G$t=e=>e===!0||e===!1,s9=e=>{if($7(e)!==`object`)return!1;let t=Z7(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(B$t in e)&&!(Q7 in e)},K$t=e=>{if(!o9(e)||i9(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},q$t=e9(`Date`),J$t=e9(`File`),Y$t=e9(`Blob`),X$t=e9(`FileList`),Z$t=e=>o9(e)&&a9(e.pipe),Q$t=e=>{let t;return e&&(typeof FormData==`function`&&e instanceof FormData||a9(e.append)&&((t=$7(e))===`formdata`||t===`object`&&a9(e.toString)&&e.toString()===`[object FormData]`))},$$t=e9(`URLSearchParams`),[e1t,t1t,n1t,r1t]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(e9),i1t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function c9(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),n9(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(i9(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function a1t(e,t){if(i9(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var l9=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,o1t=e=>!r9(e)&&e!==l9;function u9(){let{caseless:e,skipUndefined:t}=o1t(this)&&this||{},n={},r=(r,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=e&&a1t(n,i)||i;s9(n[a])&&s9(r)?n[a]=u9(n[a],r):s9(r)?n[a]=u9({},r):n9(r)?n[a]=r.slice():(!t||!r9(r))&&(n[a]=r)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&c9(arguments[e],r);return n}var s1t=(e,t,n,{allOwnKeys:r}={})=>(c9(t,(t,r)=>{n&&a9(t)?Object.defineProperty(e,r,{value:R$t(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),c1t=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),l1t=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,`constructor`,{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},u1t=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Z7(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},d1t=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},f1t=e=>{if(!e)return null;if(n9(e))return e;let t=e.length;if(!W$t(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},p1t=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&Z7(Uint8Array)),m1t=(e,t)=>{let n=(e&&e[Q7]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},h1t=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},g1t=e9(`HTMLFormElement`),_1t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),v1t=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),y1t=e9(`RegExp`),b1t=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};c9(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},x1t=e=>{b1t(e,(t,n)=>{if(a9(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(a9(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},S1t=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return n9(e)?r(e):r(String(e).split(t)),n},C1t=()=>{},w1t=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function T1t(e){return!!(e&&a9(e.append)&&e[B$t]===`FormData`&&e[Q7])}var E1t=e=>{let t=Array(10),n=(e,r)=>{if(o9(e)){if(t.indexOf(e)>=0)return;if(i9(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=n9(e)?[]:{};return c9(e,(e,t)=>{let a=n(e,r+1);!r9(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},D1t=e9(`AsyncFunction`),O1t=e=>e&&(o9(e)||a9(e))&&a9(e.then)&&a9(e.catch),k1t=((e,t)=>e?setImmediate:t?((e,t)=>(l9.addEventListener(`message`,({source:n,data:r})=>{n===l9&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),l9.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,a9(l9.postMessage)),$={isArray:n9,isArrayBuffer:V$t,isBuffer:i9,isFormData:Q$t,isArrayBufferView:H$t,isString:U$t,isNumber:W$t,isBoolean:G$t,isObject:o9,isPlainObject:s9,isEmptyObject:K$t,isReadableStream:e1t,isRequest:t1t,isResponse:n1t,isHeaders:r1t,isUndefined:r9,isDate:q$t,isFile:J$t,isBlob:Y$t,isRegExp:y1t,isFunction:a9,isStream:Z$t,isURLSearchParams:$$t,isTypedArray:p1t,isFileList:X$t,forEach:c9,merge:u9,extend:s1t,trim:i1t,stripBOM:c1t,inherits:l1t,toFlatObject:u1t,kindOf:$7,kindOfTest:e9,endsWith:d1t,toArray:f1t,forEachEntry:m1t,matchAll:h1t,isHTMLForm:g1t,hasOwnProperty:v1t,hasOwnProp:v1t,reduceDescriptors:b1t,freezeMethods:x1t,toObjectSet:S1t,toCamelCase:_1t,noop:C1t,toFiniteNumber:w1t,findKey:a1t,global:l9,isContextDefined:o1t,isSpecCompliantForm:T1t,toJSONObject:E1t,isAsyncFn:D1t,isThenable:O1t,setImmediate:k1t,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(l9):typeof process<`u`&&process.nextTick||k1t,isIterable:e=>e!=null&&a9(e[Q7])},d9=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){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:$.toJSONObject(this.config),code:this.code,status:this.status}}};d9.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,d9.ERR_BAD_OPTION=`ERR_BAD_OPTION`,d9.ECONNABORTED=`ECONNABORTED`,d9.ETIMEDOUT=`ETIMEDOUT`,d9.ERR_NETWORK=`ERR_NETWORK`,d9.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,d9.ERR_DEPRECATED=`ERR_DEPRECATED`,d9.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,d9.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,d9.ERR_CANCELED=`ERR_CANCELED`,d9.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,d9.ERR_INVALID_URL=`ERR_INVALID_URL`;function f9(e){return $.isPlainObject(e)||$.isArray(e)}function A1t(e){return $.endsWith(e,`[]`)?e.slice(0,-2):e}function j1t(e,t,n){return e?e.concat(t).map(function(e,t){return e=A1t(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function M1t(e){return $.isArray(e)&&!e.some(f9)}var N1t=$.toFlatObject($,{},null,function(e){return/^is[A-Z]/.test(e)});function p9(e,t,n){if(!$.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!$.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||l,a=n.dots,o=n.indexes,s=(n.Blob||typeof Blob<`u`&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(i))throw TypeError(`visitor must be a function`);function c(e){if(e===null)return``;if($.isDate(e))return e.toISOString();if($.isBoolean(e))return e.toString();if(!s&&$.isBlob(e))throw new d9(`Blob is not supported. Use a Buffer instead.`);return $.isArrayBuffer(e)||$.isTypedArray(e)?s&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let s=e;if(e&&!i&&typeof e==`object`){if($.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&M1t(e)||($.isFileList(e)||$.endsWith(n,`[]`))&&(s=$.toArray(e)))return n=A1t(n),s.forEach(function(e,r){!($.isUndefined(e)||e===null)&&t.append(o===!0?j1t([n],r,a):o===null?n:n+`[]`,c(e))}),!1}return f9(e)?!0:(t.append(j1t(i,n,a),c(e)),!1)}let u=[],d=Object.assign(N1t,{defaultVisitor:l,convertValue:c,isVisitable:f9});function f(e,n){if(!$.isUndefined(e)){if(u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),$.forEach(e,function(e,r){(!($.isUndefined(e)||e===null)&&i.call(t,e,$.isString(r)?r.trim():r,n,d))===!0&&f(e,n?n.concat(r):[r])}),u.pop()}}if(!$.isObject(e))throw TypeError(`data must be an object`);return f(e),t}function P1t(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function m9(e,t){this._pairs=[],e&&p9(e,this,t)}var F1t=m9.prototype;F1t.append=function(e,t){this._pairs.push([e,t])},F1t.toString=function(e){let t=e?function(t){return e.call(this,t,P1t)}:P1t;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function I1t(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function L1t(e,t,n){if(!t)return e;let r=n&&n.encode||I1t,i=$.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):$.isURLSearchParams(t)?t.toString():new m9(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var R1t=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){$.forEach(this.handlers,function(t){t!==null&&e(t)})}},h9={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},z1t={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:m9,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},B1t=r({hasBrowserEnv:()=>g9,hasStandardBrowserEnv:()=>V1t,hasStandardBrowserWebWorkerEnv:()=>H1t,navigator:()=>_9,origin:()=>U1t}),g9=typeof window<`u`&&typeof document<`u`,_9=typeof navigator==`object`&&navigator||void 0,V1t=g9&&(!_9||[`ReactNative`,`NativeScript`,`NS`].indexOf(_9.product)<0),H1t=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,U1t=g9&&window.location.href||`http://localhost`,v9={...B1t,...z1t};function W1t(e,t){return p9(e,new v9.classes.URLSearchParams,{visitor:function(e,t,n,r){return v9.isNode&&$.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function G1t(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function K1t(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function q1t(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&$.isArray(r)?r.length:a,s?($.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!$.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&$.isArray(r[a])&&(r[a]=K1t(r[a])),!o)}if($.isFormData(e)&&$.isFunction(e.entries)){let n={};return $.forEachEntry(e,(e,r)=>{t(G1t(e),r,n,0)}),n}return null}function J1t(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var y9={transitional:h9,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=$.isObject(e);if(i&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return r?JSON.stringify(q1t(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e)||$.isReadableStream(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return W1t(e,this.formSerializer).toString();if((a=$.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let t=this.env&&this.env.FormData;return p9(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType(`application/json`,!1),J1t(e)):e}],transformResponse:[function(e){let t=this.transitional||y9.transitional,n=t&&t.forcedJSONParsing,r=this.responseType===`json`;if($.isResponse(e)||$.isReadableStream(e))return e;if(e&&$.isString(e)&&(n&&!this.responseType||r)){let n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n)throw e.name===`SyntaxError`?d9.from(e,d9.ERR_BAD_RESPONSE,this,null,this.response):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:v9.classes.FormData,Blob:v9.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};$.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{y9.headers[e]={}});var Y1t=$.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`]),X1t=e=>{let t={},n,r,i;return e&&e.split(`
|
|
1661
|
+
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Y1t[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},Z1t=Symbol(`internals`);function b9(e){return e&&String(e).trim().toLowerCase()}function x9(e){return e===!1||e==null?e:$.isArray(e)?e.map(x9):String(e)}function Q1t(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var $1t=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function S9(e,t,n,r,i){if($.isFunction(r))return r.call(this,t,n);if(i&&(t=n),$.isString(t)){if($.isString(r))return t.indexOf(r)!==-1;if($.isRegExp(r))return r.test(t)}}function e0t(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function t0t(e,t){let n=$.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var C9=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=b9(t);if(!i)throw Error(`header name must be a non-empty string`);let a=$.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=x9(e))}let a=(e,t)=>$.forEach(e,(e,n)=>i(e,n,t));if($.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if($.isString(e)&&(e=e.trim())&&!$1t(e))a(X1t(e),t);else if($.isObject(e)&&$.isIterable(e)){let n={},r,i;for(let t of e){if(!$.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?$.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=b9(e),e){let n=$.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Q1t(e);if($.isFunction(t))return t.call(this,e,n);if($.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=b9(e),e){let n=$.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||S9(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=b9(e),e){let i=$.findKey(n,e);i&&(!t||S9(n,n[i],i,t))&&(delete n[i],r=!0)}}return $.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||S9(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return $.forEach(this,(r,i)=>{let a=$.findKey(n,i);if(a){t[a]=x9(r),delete t[i];return}let o=e?e0t(i):String(i).trim();o!==i&&delete t[i],t[o]=x9(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return $.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&$.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
|
|
1662
|
+
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[Z1t]=this[Z1t]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=b9(e);t[r]||(t0t(n,e),t[r]=!0)}return $.isArray(e)?e.forEach(r):r(e),this}};C9.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),$.reduceDescriptors(C9.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),$.freezeMethods(C9);function w9(e,t){let n=this||y9,r=t||n,i=C9.from(r.headers),a=r.data;return $.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function n0t(e){return!!(e&&e.__CANCEL__)}var T9=class extends d9{constructor(e,t,n){super(e??`canceled`,d9.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function r0t(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new d9(`Request failed with status code `+n.status,[d9.ERR_BAD_REQUEST,d9.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function i0t(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function a0t(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function o0t(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var E9=(e,t,n=3)=>{let r=0,i=a0t(50,250);return o0t(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,c=i(s),l=a<=o;r=a,e({loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},s0t=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},c0t=e=>(...t)=>$.asap(()=>e(...t)),l0t=v9.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,v9.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(v9.origin),v9.navigator&&/(msie|trident)/i.test(v9.navigator.userAgent)):()=>!0,u0t=v9.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];$.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),$.isString(r)&&s.push(`path=${r}`),$.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),$.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function d0t(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function f0t(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function p0t(e,t,n){let r=!d0t(t);return e&&(r||n==0)?f0t(e,t):t}var m0t=e=>e instanceof C9?{...e}:e;function D9(e,t){t||={};let n={};function r(e,t,n,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function i(e,t,n,i){if(!$.isUndefined(t))return r(e,t,n,i);if(!$.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!$.isUndefined(t))return r(void 0,t)}function o(e,t){if(!$.isUndefined(t))return r(void 0,t);if(!$.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(a in t)return r(n,i);if(a in e)return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(m0t(e),m0t(t),n,!0)};return $.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=$.hasOwnProp(c,r)?c[r]:i,o=a(e[r],t[r],r);$.isUndefined(o)&&a!==s||(n[r]=o)}),n}var h0t=e=>{let t=D9({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=C9.from(o),t.url=L1t(p0t(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``))),$.isFormData(n)){if(v9.hasStandardBrowserEnv||v9.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if($.isFunction(n.getHeaders)){let e=n.getHeaders(),t=[`content-type`,`content-length`];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)})}}if(v9.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||r!==!1&&l0t(t.url))){let e=i&&a&&u0t.read(a);e&&o.set(i,e)}return t},g0t=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=h0t(e),i=r.data,a=C9.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=C9.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());r0t(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf(`file:`)===0)||setTimeout(g)},h.onabort=function(){h&&=(n(new d9(`Request aborted`,d9.ECONNABORTED,e,h)),null)},h.onerror=function(t){let r=new d9(t&&t.message?t.message:`Network Error`,d9.ERR_NETWORK,e,h);r.event=t||null,n(r),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||h9;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new d9(t,i.clarifyTimeoutError?d9.ETIMEDOUT:d9.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&$.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),$.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=E9(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=E9(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new T9(null,e,h):t),h.abort(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=i0t(r.url);if(_&&v9.protocols.indexOf(_)===-1){n(new d9(`Unsupported protocol `+_+`:`,d9.ERR_BAD_REQUEST,e));return}h.send(i||null)})},_0t=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof d9?t:new T9(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new d9(`timeout of ${t}ms exceeded`,d9.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>$.asap(o),s}},v0t=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},y0t=async function*(e,t){for await(let n of b0t(e))yield*v0t(n,t)},b0t=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},x0t=(e,t,n,r)=>{let i=y0t(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},S0t=64*1024,{isFunction:O9}=$,C0t=(({Request:e,Response:t})=>({Request:e,Response:t}))($.global),{ReadableStream:w0t,TextEncoder:T0t}=$.global,E0t=(e,...t)=>{try{return!!e(...t)}catch{return!1}},D0t=e=>{e=$.merge.call({skipUndefined:!0},C0t,e);let{fetch:t,Request:n,Response:r}=e,i=t?O9(t):typeof fetch==`function`,a=O9(n),o=O9(r);if(!i)return!1;let s=i&&O9(w0t),c=i&&(typeof T0t==`function`?(e=>t=>e.encode(t))(new T0t):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=a&&s&&E0t(()=>{let e=!1,t=new n(v9.origin,{body:new w0t,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`);return e&&!t}),u=o&&s&&E0t(()=>$.isReadableStream(new r(``).body)),d={stream:u&&(e=>e.body)};i&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new d9(`Response type '${e}' is not supported`,d9.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(e==null)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e))return(await new n(v9.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if($.isArrayBufferView(e)||$.isArrayBuffer(e))return e.byteLength;if($.isURLSearchParams(e)&&(e+=``),$.isString(e))return(await c(e)).byteLength},p=async(e,t)=>$.toFiniteNumber(e.getContentLength())??f(t);return async e=>{let{url:i,method:o,data:s,signal:c,cancelToken:f,timeout:m,onDownloadProgress:h,onUploadProgress:g,responseType:_,headers:v,withCredentials:y=`same-origin`,fetchOptions:b}=h0t(e),x=t||fetch;_=_?(_+``).toLowerCase():`text`;let S=_0t([c,f&&f.toAbortSignal()],m),C=null,w=S&&S.unsubscribe&&(()=>{S.unsubscribe()}),T;try{if(g&&l&&o!==`get`&&o!==`head`&&(T=await p(v,s))!==0){let e=new n(i,{method:`POST`,body:s,duplex:`half`}),t;if($.isFormData(s)&&(t=e.headers.get(`content-type`))&&v.setContentType(t),e.body){let[t,n]=s0t(T,E9(c0t(g)));s=x0t(e.body,S0t,t,n)}}$.isString(y)||(y=y?`include`:`omit`);let t=a&&`credentials`in n.prototype,c={...b,signal:S,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:`half`,credentials:t?y:void 0};C=a&&new n(i,c);let f=await(a?x(C,b):x(i,c)),m=u&&(_===`stream`||_===`response`);if(u&&(h||m&&w)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=f[t]});let t=$.toFiniteNumber(f.headers.get(`content-length`)),[n,i]=h&&s0t(t,E9(c0t(h),!0))||[];f=new r(x0t(f.body,S0t,n,()=>{i&&i(),w&&w()}),e)}_||=`text`;let E=await d[$.findKey(d,_)||`text`](f,e);return!m&&w&&w(),await new Promise((t,n)=>{r0t(t,n,{data:E,headers:C9.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:C})})}catch(t){throw w&&w(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new d9(`Network Error`,d9.ERR_NETWORK,e,C,t&&t.response),{cause:t.cause||t}):d9.from(t,t&&t.code,e,C,t&&t.response)}}},O0t=new Map,k0t=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=O0t;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:D0t(t)),l=c;return c};k0t();var k9={http:null,xhr:g0t,fetch:{get:k0t}};$.forEach(k9,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});var A0t=e=>`- ${e}`,j0t=e=>$.isFunction(e)||e===null||e===!1;function M0t(e,t){e=$.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!j0t(r)&&(i=k9[(n=String(r)).toLowerCase()],i===void 0))throw new d9(`Unknown adapter '${n}'`);if(i&&($.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new d9(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
1663
|
+
`+e.map(A0t).join(`
|
|
1664
|
+
`):` `+A0t(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var N0t={getAdapter:M0t,adapters:k9};function A9(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new T9(null,e)}function P0t(e){return A9(e),e.headers=C9.from(e.headers),e.data=w9.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),N0t.getAdapter(e.adapter||y9.adapter,e)(e).then(function(t){return A9(e),t.data=w9.call(e,e.transformResponse,t),t.headers=C9.from(t.headers),t},function(t){return n0t(t)||(A9(e),t&&t.response&&(t.response.data=w9.call(e,e.transformResponse,t.response),t.response.headers=C9.from(t.response.headers))),Promise.reject(t)})}var F0t=`1.13.5`,j9={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{j9[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var I0t={};j9.transitional=function(e,t,n){function r(e,t){return`[Axios v`+F0t+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new d9(r(i,` has been removed`+(t?` in `+t:``)),d9.ERR_DEPRECATED);return t&&!I0t[i]&&(I0t[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},j9.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function L0t(e,t,n){if(typeof e!=`object`)throw new d9(`options must be an object`,d9.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=t[a];if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new d9(`option `+a+` must be `+n,d9.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new d9(`Unknown option `+a,d9.ERR_BAD_OPTION)}}var M9={assertOptions:L0t,validators:j9},N9=M9.validators,P9=class{constructor(e){this.defaults=e||{},this.interceptors={request:new R1t,response:new R1t}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack?t.stack.replace(/^.+\n/,``):``;try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,``))&&(e.stack+=`
|
|
1665
|
+
`+n):e.stack=n}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=D9(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&M9.assertOptions(n,{silentJSONParsing:N9.transitional(N9.boolean),forcedJSONParsing:N9.transitional(N9.boolean),clarifyTimeoutError:N9.transitional(N9.boolean),legacyInterceptorReqResOrdering:N9.transitional(N9.boolean)},!1),r!=null&&($.isFunction(r)?t.paramsSerializer={serialize:r}:M9.assertOptions(r,{encode:N9.function,serialize:N9.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),M9.assertOptions(t,{baseUrl:N9.spelling(`baseURL`),withXsrfToken:N9.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&$.merge(i.common,i[t.method]);i&&$.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=C9.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||h9;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[P0t.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=P0t.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=D9(this.defaults,e),L1t(p0t(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};$.forEach([`delete`,`get`,`head`,`options`],function(e){P9.prototype[e]=function(t,n){return this.request(D9(n||{},{method:e,url:t,data:(n||{}).data}))}}),$.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(D9(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}P9.prototype[e]=t(),P9.prototype[e+`Form`]=t(!0)});var R0t=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new T9(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function z0t(e){return function(t){return e.apply(null,t)}}function B0t(e){return $.isObject(e)&&e.isAxiosError===!0}var F9={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(F9).forEach(([e,t])=>{F9[t]=e});function V0t(e){let t=new P9(e),n=R$t(P9.prototype.request,t);return $.extend(n,P9.prototype,t,{allOwnKeys:!0}),$.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return V0t(D9(e,t))},n}var I9=V0t(y9);I9.Axios=P9,I9.CanceledError=T9,I9.CancelToken=R0t,I9.isCancel=n0t,I9.VERSION=F0t,I9.toFormData=p9,I9.AxiosError=d9,I9.Cancel=I9.CanceledError,I9.all=function(e){return Promise.all(e)},I9.spread=z0t,I9.isAxiosError=B0t,I9.mergeConfig=D9,I9.AxiosHeaders=C9,I9.formToJSON=e=>q1t($.isHTMLForm(e)?new FormData(e):e),I9.getAdapter=N0t.getAdapter,I9.HttpStatusCode=F9,I9.default=I9;var H0t=e(i(((e,t)=>{var n=new Set(`ENOTFOUND.ENETUNREACH.UNABLE_TO_GET_ISSUER_CERT.UNABLE_TO_GET_CRL.UNABLE_TO_DECRYPT_CERT_SIGNATURE.UNABLE_TO_DECRYPT_CRL_SIGNATURE.UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY.CERT_SIGNATURE_FAILURE.CRL_SIGNATURE_FAILURE.CERT_NOT_YET_VALID.CERT_HAS_EXPIRED.CRL_NOT_YET_VALID.CRL_HAS_EXPIRED.ERROR_IN_CERT_NOT_BEFORE_FIELD.ERROR_IN_CERT_NOT_AFTER_FIELD.ERROR_IN_CRL_LAST_UPDATE_FIELD.ERROR_IN_CRL_NEXT_UPDATE_FIELD.OUT_OF_MEM.DEPTH_ZERO_SELF_SIGNED_CERT.SELF_SIGNED_CERT_IN_CHAIN.UNABLE_TO_GET_ISSUER_CERT_LOCALLY.UNABLE_TO_VERIFY_LEAF_SIGNATURE.CERT_CHAIN_TOO_LONG.CERT_REVOKED.INVALID_CA.PATH_LENGTH_EXCEEDED.INVALID_PURPOSE.CERT_UNTRUSTED.CERT_REJECTED.HOSTNAME_MISMATCH`.split(`.`));t.exports=e=>!n.has(e&&e.code)}))()),U0t=`axios-retry`;function W0t(e){return e.response||!e.code||[`ERR_CANCELED`,`ECONNABORTED`].includes(e.code)?!1:(0,H0t.default)(e)}var G0t=[`get`,`head`,`options`],K0t=G0t.concat([`put`,`delete`]);function L9(e){return e.code!==`ECONNABORTED`&&(!e.response||e.response.status===429||e.response.status>=500&&e.response.status<=599)}function q0t(e){return e.config?.method?L9(e)&&G0t.indexOf(e.config.method)!==-1:!1}function J0t(e){return e.config?.method?L9(e)&&K0t.indexOf(e.config.method)!==-1:!1}function Y0t(e){return W0t(e)||J0t(e)}function R9(e=void 0){let t=e?.response?.headers[`retry-after`];if(!t)return 0;let n=(Number(t)||0)*1e3;return n===0&&(n=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,n)}function X0t(e=0,t=void 0){return Math.max(0,R9(t))}function Z0t(e=0,t=void 0,n=100){let r=2**e*n,i=Math.max(r,R9(t));return i+i*.2*Math.random()}function Q0t(e=100){return(t=0,n=void 0)=>{let r=t*e;return Math.max(r,R9(n))}}var $0t={retries:3,retryCondition:Y0t,retryDelay:X0t,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function e2t(e,t){return{...$0t,...t,...e[U0t]}}function t2t(e,t,n=!1){let r=e2t(e,t||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),e[U0t]=r,r}function n2t(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}async function r2t(e,t){let{retries:n,retryCondition:r}=e,i=(e.retryCount||0)<n&&r(t);if(typeof i==`object`)try{return await i!==!1}catch{return!1}return i}async function i2t(e,t,n,r){t.retryCount+=1;let{retryDelay:i,shouldResetTimeout:a,onRetry:o}=t,s=i(t.retryCount,n);if(n2t(e,r),!a&&r.timeout&&t.lastRequestTime){let e=Date.now()-t.lastRequestTime,i=r.timeout-e-s;if(i<=0)return Promise.reject(n);r.timeout=i}return r.transformRequest=[e=>e],await o(t.retryCount,n,r),r.signal?.aborted?Promise.resolve(e(r)):new Promise(t=>{let n=()=>{clearTimeout(i),t(e(r))},i=setTimeout(()=>{t(e(r)),r.signal?.removeEventListener&&r.signal.removeEventListener(`abort`,n)},s);r.signal?.addEventListener&&r.signal.addEventListener(`abort`,n,{once:!0})})}async function a2t(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}var z9=(e,t)=>({requestInterceptorId:e.interceptors.request.use(e=>(t2t(e,t,!0),e[`axios-retry`]?.validateResponse&&(e.validateStatus=()=>!1),e)),responseInterceptorId:e.interceptors.response.use(null,async n=>{let{config:r}=n;if(!r)return Promise.reject(n);let i=t2t(r,t);return n.response&&i.validateResponse?.(n.response)?n.response:await r2t(i,n)?i2t(e,i,n,r):(await a2t(i,n),Promise.reject(n))})});z9.isNetworkError=W0t,z9.isSafeRequestError=q0t,z9.isIdempotentRequestError=J0t,z9.isNetworkOrIdempotentRequestError=Y0t,z9.exponentialDelay=Z0t,z9.linearDelay=Q0t,z9.isRetryableError=L9;var o2t=(typeof self<`u`?self:null)||(typeof window<`u`?window:null)||o2t,B9=class{type=3;name=``;prefix=``;value=``;suffix=``;modifier=3;constructor(e,t,n,r,i,a){this.type=e,this.name=t,this.prefix=n,this.value=r,this.suffix=i,this.modifier=a}hasCustomName(){return this.name!==``&&typeof this.name!=`number`}},s2t=/[$_\p{ID_Start}]/u,c2t=/[$_\u200C\u200D\p{ID_Continue}]/u,V9=`.*`;function l2t(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function u2t(e,t=!1){let n=[],r=0;for(;r<e.length;){let i=e[r],a=function(i){if(!t)throw TypeError(i);n.push({type:`INVALID_CHAR`,index:r,value:e[r++]})};if(i===`*`){n.push({type:`ASTERISK`,index:r,value:e[r++]});continue}if(i===`+`||i===`?`){n.push({type:`OTHER_MODIFIER`,index:r,value:e[r++]});continue}if(i===`\\`){n.push({type:`ESCAPED_CHAR`,index:r++,value:e[r++]});continue}if(i===`{`){n.push({type:`OPEN`,index:r,value:e[r++]});continue}if(i===`}`){n.push({type:`CLOSE`,index:r,value:e[r++]});continue}if(i===`:`){let t=``,i=r+1;for(;i<e.length;){let n=e.substr(i,1);if(i===r+1&&s2t.test(n)||i!==r+1&&c2t.test(n)){t+=e[i++];continue}break}if(!t){a(`Missing parameter name at ${r}`);continue}n.push({type:`NAME`,index:r,value:t}),r=i;continue}if(i===`(`){let t=1,i=``,o=r+1,s=!1;if(e[o]===`?`){a(`Pattern cannot start with "?" at ${o}`);continue}for(;o<e.length;){if(!l2t(e[o],!1)){a(`Invalid character '${e[o]}' at ${o}.`),s=!0;break}if(e[o]===`\\`){i+=e[o++]+e[o++];continue}if(e[o]===`)`){if(t--,t===0){o++;break}}else if(e[o]===`(`&&(t++,e[o+1]!==`?`)){a(`Capturing groups are not allowed at ${o}`),s=!0;break}i+=e[o++]}if(s)continue;if(t){a(`Unbalanced pattern at ${r}`);continue}if(!i){a(`Missing pattern at ${r}`);continue}n.push({type:`REGEX`,index:r,value:i}),r=o;continue}n.push({type:`CHAR`,index:r,value:e[r++]})}return n.push({type:`END`,index:r,value:``}),n}function d2t(e,t={}){let n=u2t(e);t.delimiter??=`/#?`,t.prefixes??=`./`;let r=`[^${H9(t.delimiter)}]+?`,i=[],a=0,o=0,s=new Set,c=e=>{if(o<n.length&&n[o].type===e)return n[o++].value},l=()=>c(`OTHER_MODIFIER`)??c(`ASTERISK`),u=e=>{let t=c(e);if(t!==void 0)return t;let{type:r,index:i}=n[o];throw TypeError(`Unexpected ${r} at ${i}, expected ${e}`)},d=()=>{let e=``,t;for(;t=c(`CHAR`)??c(`ESCAPED_CHAR`);)e+=t;return e},f=t.encodePart||(e=>e),p=``,m=e=>{p+=e},h=()=>{p.length&&(i.push(new B9(3,``,``,f(p),``,3)),p=``)},g=(e,t,n,o,c)=>{let l=3;switch(c){case`?`:l=1;break;case`*`:l=0;break;case`+`:l=2;break}if(!t&&!n&&l===3){m(e);return}if(h(),!t&&!n){if(!e)return;i.push(new B9(3,``,``,f(e),``,l));return}let u;u=n?n===`*`?V9:n:r;let d=2;u===r?(d=1,u=``):u===V9&&(d=0,u=``);let p;if(t?p=t:n&&(p=a++),s.has(p))throw TypeError(`Duplicate name '${p}'.`);s.add(p),i.push(new B9(d,p,f(e),u,f(o),l))};for(;o<n.length;){let e=c(`CHAR`),n=c(`NAME`),r=c(`REGEX`);if(!n&&!r&&(r=c(`ASTERISK`)),n||r){let i=e??``;t.prefixes.indexOf(i)===-1&&(m(i),i=``),h();let a=l();g(i,n,r,``,a);continue}let i=e??c(`ESCAPED_CHAR`);if(i){m(i);continue}if(c(`OPEN`)){let e=d(),t=c(`NAME`),n=c(`REGEX`);!t&&!n&&(n=c(`ASTERISK`));let r=d();u(`CLOSE`);let i=l();g(e,t,n,r,i);continue}h(),u(`END`)}return i}function H9(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,`\\$1`)}function f2t(e){return e&&e.ignoreCase?`ui`:`u`}function p2t(e,t,n){return m2t(d2t(e,n),t,n)}function U9(e){switch(e){case 0:return`*`;case 1:return`?`;case 2:return`+`;case 3:return``}}function m2t(e,t,n={}){n.delimiter??=`/#?`,n.prefixes??=`./`,n.sensitive??=!1,n.strict??=!1,n.end??=!0,n.start??=!0,n.endsWith=``;let r=n.start?`^`:``;for(let i of e){if(i.type===3){i.modifier===3?r+=H9(i.value):r+=`(?:${H9(i.value)})${U9(i.modifier)}`;continue}t&&t.push(i.name);let e=`[^${H9(n.delimiter)}]+?`,a=i.value;if(i.type===1?a=e:i.type===0&&(a=V9),!i.prefix.length&&!i.suffix.length){i.modifier===3||i.modifier===1?r+=`(${a})${U9(i.modifier)}`:r+=`((?:${a})${U9(i.modifier)})`;continue}if(i.modifier===3||i.modifier===1){r+=`(?:${H9(i.prefix)}(${a})${H9(i.suffix)})`,r+=U9(i.modifier);continue}r+=`(?:${H9(i.prefix)}`,r+=`((?:${a})(?:`,r+=H9(i.suffix),r+=H9(i.prefix),r+=`(?:${a}))*)${H9(i.suffix)})`,i.modifier===0&&(r+=`?`)}let i=`[${H9(n.endsWith)}]|$`,a=`[${H9(n.delimiter)}]`;if(n.end)return n.strict||(r+=`${a}?`),n.endsWith.length?r+=`(?=${i})`:r+=`$`,new RegExp(r,f2t(n));n.strict||(r+=`(?:${a}(?=${i}))?`);let o=!1;if(e.length){let t=e[e.length-1];t.type===3&&t.modifier===3&&(o=n.delimiter.indexOf(t)>-1)}return o||(r+=`(?=${a}|${i})`),new RegExp(r,f2t(n))}var W9={delimiter:``,prefixes:``,sensitive:!0,strict:!0},h2t={delimiter:`.`,prefixes:``,sensitive:!0,strict:!0},g2t={delimiter:`/`,prefixes:`/`,sensitive:!0,strict:!0};function _2t(e,t){return e.length?e[0]===`/`?!0:!t||e.length<2?!1:(e[0]==`\\`||e[0]==`{`)&&e[1]==`/`:!1}function v2t(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function y2t(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function b2t(e){return!e||e.length<2?!1:e[0]===`[`||(e[0]===`\\`||e[0]===`{`)&&e[1]===`[`}var x2t=[`ftp`,`file`,`http`,`https`,`ws`,`wss`];function S2t(e){if(!e)return!0;for(let t of x2t)if(e.test(t))return!0;return!1}function C2t(e,t){if(e=v2t(e,`#`),t||e===``)return e;let n=new URL(`https://example.com`);return n.hash=e,n.hash?n.hash.substring(1,n.hash.length):``}function w2t(e,t){if(e=v2t(e,`?`),t||e===``)return e;let n=new URL(`https://example.com`);return n.search=e,n.search?n.search.substring(1,n.search.length):``}function T2t(e,t){return t||e===``?e:b2t(e)?F2t(e):P2t(e)}function E2t(e,t){if(t||e===``)return e;let n=new URL(`https://example.com`);return n.password=e,n.password}function D2t(e,t){if(t||e===``)return e;let n=new URL(`https://example.com`);return n.username=e,n.username}function O2t(e,t,n){if(n||e===``)return e;if(t&&!x2t.includes(t))return new URL(`${t}:${e}`).pathname;let r=e[0]==`/`;return e=new URL(r?e:`/-`+e,`https://example.com`).pathname,r||(e=e.substring(2,e.length)),e}function k2t(e,t,n){return j2t(t)===e&&(e=``),n||e===``?e:I2t(e)}function A2t(e,t){return e=y2t(e,`:`),t||e===``?e:G9(e)}function j2t(e){switch(e){case`ws`:case`http`:return`80`;case`wws`:case`https`:return`443`;case`ftp`:return`21`;default:return``}}function G9(e){if(e===``)return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw TypeError(`Invalid protocol '${e}'.`)}function M2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.username=e,t.username}function N2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.password=e,t.password}function P2t(e){if(e===``)return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw TypeError(`Invalid hostname '${e}'`);let t=new URL(`https://example.com`);return t.hostname=e,t.hostname}function F2t(e){if(e===``)return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function I2t(e){if(e===``||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw TypeError(`Invalid port '${e}'.`)}function L2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.pathname=e[0]===`/`?e:`/-`+e,e[0]===`/`?t.pathname:t.pathname.substring(2,t.pathname.length)}function R2t(e){return e===``?e:new URL(`data:${e}`).pathname}function z2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.search=e,t.search.substring(1,t.search.length)}function B2t(e){if(e===``)return e;let t=new URL(`https://example.com`);return t.hash=e,t.hash.substring(1,t.hash.length)}var V2t=class{#e;#t=[];#n={};#r=0;#i=1;#a=0;#o=0;#s=0;#c=0;#l=!1;constructor(e){this.#e=e}get result(){return this.#n}parse(){for(this.#t=u2t(this.#e,!0);this.#r<this.#t.length;this.#r+=this.#i){if(this.#i=1,this.#t[this.#r].type===`END`){if(this.#o===0){this.#f(),this.#C()?this.#u(9,1):this.#S()?this.#u(8,1):this.#u(7,0);continue}else if(this.#o===2){this.#p(5);continue}this.#u(10,0);break}if(this.#s>0)if(this.#T())--this.#s;else continue;if(this.#w()){this.#s+=1;continue}switch(this.#o){case 0:this.#g()&&this.#p(1);break;case 1:if(this.#g()){this.#k();let e=7,t=1;this.#_()?(e=2,t=3):this.#l&&(e=2),this.#u(e,t)}break;case 2:this.#v()?this.#p(3):(this.#x()||this.#S()||this.#C())&&this.#p(5);break;case 3:this.#y()?this.#u(4,1):this.#v()&&this.#u(5,1);break;case 4:this.#v()&&this.#u(5,1);break;case 5:this.#E()?this.#c+=1:this.#D()&&--this.#c,this.#b()&&!this.#c?this.#u(6,1):this.#x()?this.#u(7,0):this.#S()?this.#u(8,1):this.#C()&&this.#u(9,1);break;case 6:this.#x()?this.#u(7,0):this.#S()?this.#u(8,1):this.#C()&&this.#u(9,1);break;case 7:this.#S()?this.#u(8,1):this.#C()&&this.#u(9,1);break;case 8:this.#C()&&this.#u(9,1);break;case 9:break;case 10:break}}this.#n.hostname!==void 0&&this.#n.port===void 0&&(this.#n.port=``)}#u(e,t){switch(this.#o){case 0:break;case 1:this.#n.protocol=this.#O();break;case 2:break;case 3:this.#n.username=this.#O();break;case 4:this.#n.password=this.#O();break;case 5:this.#n.hostname=this.#O();break;case 6:this.#n.port=this.#O();break;case 7:this.#n.pathname=this.#O();break;case 8:this.#n.search=this.#O();break;case 9:this.#n.hash=this.#O();break;case 10:break}this.#o!==0&&e!==10&&([1,2,3,4].includes(this.#o)&&[6,7,8,9].includes(e)&&(this.#n.hostname??=``),[1,2,3,4,5,6].includes(this.#o)&&[8,9].includes(e)&&(this.#n.pathname??=this.#l?`/`:``),[1,2,3,4,5,6,7].includes(this.#o)&&e===9&&(this.#n.search??=``)),this.#d(e,t)}#d(e,t){this.#o=e,this.#a=this.#r+t,this.#r+=t,this.#i=0}#f(){this.#r=this.#a,this.#i=0}#p(e){this.#f(),this.#o=e}#m(e){return e<0&&(e=this.#t.length-e),e<this.#t.length?this.#t[e]:this.#t[this.#t.length-1]}#h(e,t){let n=this.#m(e);return n.value===t&&(n.type===`CHAR`||n.type===`ESCAPED_CHAR`||n.type===`INVALID_CHAR`)}#g(){return this.#h(this.#r,`:`)}#_(){return this.#h(this.#r+1,`/`)&&this.#h(this.#r+2,`/`)}#v(){return this.#h(this.#r,`@`)}#y(){return this.#h(this.#r,`:`)}#b(){return this.#h(this.#r,`:`)}#x(){return this.#h(this.#r,`/`)}#S(){if(this.#h(this.#r,`?`))return!0;if(this.#t[this.#r].value!==`?`)return!1;let e=this.#m(this.#r-1);return e.type!==`NAME`&&e.type!==`REGEX`&&e.type!==`CLOSE`&&e.type!==`ASTERISK`}#C(){return this.#h(this.#r,`#`)}#w(){return this.#t[this.#r].type==`OPEN`}#T(){return this.#t[this.#r].type==`CLOSE`}#E(){return this.#h(this.#r,`[`)}#D(){return this.#h(this.#r,`]`)}#O(){let e=this.#t[this.#r],t=this.#m(this.#a).index;return this.#e.substring(t,e.index)}#k(){let e={};Object.assign(e,W9),e.encodePart=G9,this.#l=S2t(p2t(this.#O(),void 0,e))}},K9=[`protocol`,`username`,`password`,`hostname`,`port`,`pathname`,`search`,`hash`],q9=`*`;function H2t(e,t){if(typeof e!=`string`)throw TypeError(`parameter 1 is not of type 'string'.`);let n=new URL(e,t);return{protocol:n.protocol.substring(0,n.protocol.length-1),username:n.username,password:n.password,hostname:n.hostname,port:n.port,pathname:n.pathname,search:n.search===``?void 0:n.search.substring(1,n.search.length),hash:n.hash===``?void 0:n.hash.substring(1,n.hash.length)}}function J9(e,t){return t?X9(e):e}function Y9(e,t,n){let r;if(typeof t.baseURL==`string`)try{r=new URL(t.baseURL),t.protocol===void 0&&(e.protocol=J9(r.protocol.substring(0,r.protocol.length-1),n)),!n&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&(e.username=J9(r.username,n)),!n&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&t.password===void 0&&(e.password=J9(r.password,n)),t.protocol===void 0&&t.hostname===void 0&&(e.hostname=J9(r.hostname,n)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&(e.port=J9(r.port,n)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&(e.pathname=J9(r.pathname,n)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&(e.search=J9(r.search.substring(1,r.search.length),n)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&t.hash===void 0&&(e.hash=J9(r.hash.substring(1,r.hash.length),n))}catch{throw TypeError(`invalid baseURL '${t.baseURL}'.`)}if(typeof t.protocol==`string`&&(e.protocol=A2t(t.protocol,n)),typeof t.username==`string`&&(e.username=D2t(t.username,n)),typeof t.password==`string`&&(e.password=E2t(t.password,n)),typeof t.hostname==`string`&&(e.hostname=T2t(t.hostname,n)),typeof t.port==`string`&&(e.port=k2t(t.port,e.protocol,n)),typeof t.pathname==`string`){if(e.pathname=t.pathname,r&&!_2t(e.pathname,n)){let t=r.pathname.lastIndexOf(`/`);t>=0&&(e.pathname=J9(r.pathname.substring(0,t+1),n)+e.pathname)}e.pathname=O2t(e.pathname,e.protocol,n)}return typeof t.search==`string`&&(e.search=w2t(t.search,n)),typeof t.hash==`string`&&(e.hash=C2t(t.hash,n)),e}function X9(e){return e.replace(/([+*?:{}()\\])/g,`\\$1`)}function U2t(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,`\\$1`)}function W2t(e,t){t.delimiter??=`/#?`,t.prefixes??=`./`,t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith=``;let n=`[^${U2t(t.delimiter)}]+?`,r=/[$_\u200C\u200D\p{ID_Continue}]/u,i=``;for(let a=0;a<e.length;++a){let o=e[a];if(o.type===3){if(o.modifier===3){i+=X9(o.value);continue}i+=`{${X9(o.value)}}${U9(o.modifier)}`;continue}let s=o.hasCustomName(),c=!!o.suffix.length||!!o.prefix.length&&(o.prefix.length!==1||!t.prefixes.includes(o.prefix)),l=a>0?e[a-1]:null,u=a<e.length-1?e[a+1]:null;if(!c&&s&&o.type===1&&o.modifier===3&&u&&!u.prefix.length&&!u.suffix.length)if(u.type===3){let e=u.value.length>0?u.value[0]:``;c=r.test(e)}else c=!u.hasCustomName();if(!c&&!o.prefix.length&&l&&l.type===3){let e=l.value[l.value.length-1];c=t.prefixes.includes(e)}c&&(i+=`{`),i+=X9(o.prefix),s&&(i+=`:${o.name}`),o.type===2?i+=`(${o.value})`:o.type===1?s||(i+=`(${n})`):o.type===0&&(!s&&(!l||l.type===3||l.modifier!==3||c||o.prefix!==``)?i+=`*`:i+=`(.*)`),o.type===1&&s&&o.suffix.length&&r.test(o.suffix[0])&&(i+=`\\`),i+=X9(o.suffix),c&&(i+=`}`),o.modifier!==3&&(i+=U9(o.modifier))}return i}var G2t=class{#e;#t={};#n={};#r={};#i={};#a=!1;constructor(e={},t,n){try{let r;if(typeof t==`string`?r=t:n=t,typeof e==`string`){let t=new V2t(e);if(t.parse(),e=t.result,r===void 0&&typeof e.protocol!=`string`)throw TypeError(`A base URL must be provided for a relative constructor string.`);e.baseURL=r}else{if(!e||typeof e!=`object`)throw TypeError(`parameter 1 is not of type 'string' and cannot convert to dictionary.`);if(r)throw TypeError(`parameter 1 is not of type 'string'.`)}typeof n>`u`&&(n={ignoreCase:!1});let i={ignoreCase:n.ignoreCase===!0};this.#e=Y9({pathname:q9,protocol:q9,username:q9,password:q9,hostname:q9,port:q9,search:q9,hash:q9},e,!0),j2t(this.#e.protocol)===this.#e.port&&(this.#e.port=``);let a;for(a of K9){if(!(a in this.#e))continue;let e={},t=this.#e[a];switch(this.#n[a]=[],a){case`protocol`:Object.assign(e,W9),e.encodePart=G9;break;case`username`:Object.assign(e,W9),e.encodePart=M2t;break;case`password`:Object.assign(e,W9),e.encodePart=N2t;break;case`hostname`:Object.assign(e,h2t),b2t(t)?e.encodePart=F2t:e.encodePart=P2t;break;case`port`:Object.assign(e,W9),e.encodePart=I2t;break;case`pathname`:S2t(this.#t.protocol)?(Object.assign(e,g2t,i),e.encodePart=L2t):(Object.assign(e,W9,i),e.encodePart=R2t);break;case`search`:Object.assign(e,W9,i),e.encodePart=z2t;break;case`hash`:Object.assign(e,W9,i),e.encodePart=B2t;break}try{this.#i[a]=d2t(t,e),this.#t[a]=m2t(this.#i[a],this.#n[a],e),this.#r[a]=W2t(this.#i[a],e),this.#a=this.#a||this.#i[a].some(e=>e.type===2)}catch{throw TypeError(`invalid ${a} pattern '${this.#e[a]}'.`)}}}catch(e){throw TypeError(`Failed to construct 'URLPattern': ${e.message}`)}}test(e={},t){let n={pathname:``,protocol:``,username:``,password:``,hostname:``,port:``,search:``,hash:``};if(typeof e!=`string`&&t)throw TypeError(`parameter 1 is not of type 'string'.`);if(typeof e>`u`)return!1;try{n=typeof e==`object`?Y9(n,e,!1):Y9(n,H2t(e,t),!1)}catch{return!1}let r;for(r of K9)if(!this.#t[r].exec(n[r]))return!1;return!0}exec(e={},t){let n={pathname:``,protocol:``,username:``,password:``,hostname:``,port:``,search:``,hash:``};if(typeof e!=`string`&&t)throw TypeError(`parameter 1 is not of type 'string'.`);if(typeof e>`u`)return;try{n=typeof e==`object`?Y9(n,e,!1):Y9(n,H2t(e,t),!1)}catch{return null}let r={};t?r.inputs=[e,t]:r.inputs=[e];let i;for(i of K9){let e=this.#t[i].exec(n[i]);if(!e)return null;let t={};for(let[n,r]of this.#n[i].entries())(typeof r==`string`||typeof r==`number`)&&(t[r]=e[n+1]);r[i]={input:n[i]??``,groups:t}}return r}static compareComponent(e,t,n){let r=(e,t)=>{for(let n of[`type`,`modifier`,`prefix`,`value`,`suffix`]){if(e[n]<t[n])return-1;if(e[n]!==t[n])return 1}return 0},i=new B9(3,``,``,``,``,3),a=new B9(0,``,``,``,``,3),o=(e,t)=>{let n=0;for(;n<Math.min(e.length,t.length);++n){let i=r(e[n],t[n]);if(i)return i}return e.length===t.length?0:r(e[n]??i,t[n]??i)};return!t.#r[e]&&!n.#r[e]?0:t.#r[e]&&!n.#r[e]?o(t.#i[e],[a]):!t.#r[e]&&n.#r[e]?o([a],n.#i[e]):o(t.#i[e],n.#i[e])}get protocol(){return this.#r.protocol}get username(){return this.#r.username}get password(){return this.#r.password}get hostname(){return this.#r.hostname}get port(){return this.#r.port}get pathname(){return this.#r.pathname}get search(){return this.#r.search}get hash(){return this.#r.hash}get hasRegExpGroups(){return this.#a}};globalThis.URLPattern||(globalThis.URLPattern=G2t),hx(),g.createContext(null),g.createContext(void 0),g.createContext(void 0),g.createContext(null),g.createContext(null);var K2t=(0,g.memo)(()=>null);function q2t(){let[e,t]=(0,g.useState)(0);return(0,g.useEffect)(()=>{let e=()=>{let e=document.getElementById(`_sidebar`);e&&t(e.getBoundingClientRect().height+(parseFloat(getComputedStyle(document.documentElement).getPropertyValue(`--banner-height`))||0))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var J2t=kr(Zn((0,W.jsxs)(Jn,{path:`/`,element:(0,W.jsx)(x$t,{enableUpdateNotifications:!1}),errorElement:(0,W.jsx)(aye,{id:`root`}),children:[(0,W.jsx)(Jn,{index:!0,element:(0,W.jsx)(Kn,{replace:!0,to:window.localEditorConfig.defaultPath})}),(0,W.jsx)(Jn,{path:`mcp-oauth-callback`,element:(0,W.jsx)(m_e,{})}),(0,W.jsx)(Jn,{path:`/:account/:project/:environment`,element:(0,W.jsx)(D$t,{}),children:(0,W.jsxs)(Jn,{element:(0,W.jsx)(({navigation:e})=>{let[t,n]=(0,g.useState)(0);(0,g.useEffect)(()=>{let e=()=>{n(document.querySelector(`[data-banner="true"]`)?.offsetHeight||0)};e();let t=new MutationObserver(e);return t.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`class`,`style`]}),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let r=q2t();return(0,W.jsxs)(`div`,{className:`min-h-screen flex flex-col`,style:{"--banner-height":`${t}px`},children:[(0,W.jsx)(K2t,{}),(0,W.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 grid-rows-[min-content_auto]`,children:[e,(0,W.jsx)(Bje,{height:r,children:(0,W.jsx)(g.Suspense,{fallback:null,children:(0,W.jsx)(qn,{})})})]})]})},{navigation:(0,W.jsx)(zje,{})}),children:[(0,W.jsx)(Jn,{index:!0,element:(0,W.jsx)(dZt,{})}),(0,W.jsx)(Jn,{path:`edit`,element:(0,W.jsx)(CXt,{})})]})}),(0,W.jsx)(Jn,{path:`*`,element:(0,W.jsx)(()=>(0,W.jsx)(`div`,{className:`flex items-center justify-center min-h-screen`,children:(0,W.jsx)(S$t,{})}),{})})]}))),Y2t=({error:e})=>{let t,n,r=`N/A`,i=e.message,a,o;(e instanceof If||e instanceof Lf)&&(t=e.type,n=e.message,r=e.status??r,i=e.detail,a=e.instance,o=e.traceId),n||=`Oh zup! Something went wrong.`;let s=t??`https://zuplo.com/docs/search?q=${n.replaceAll(` `,`+`)}`,c=t&&Mf.includes(t);i||=r===403?`It looks like you might not have permission to access this resources.`:r===404?`We can't find this. If you believe this is a mistake let us know.`:`An error has occurred. If the problem persists let us know.`;let l=e?.stack?.split(`
|
|
1666
1666
|
`).splice(0,5).join(`
|
|
1667
|
-
`);return(0,W.jsxs)(`div`,{className:`flex flex-col w-full mx-auto max-w-[800px] justify-center gap-4 items-center bg-white p-8`,children:[(0,W.jsxs)(`main`,{className:`flex flex-col gap-10`,children:[(0,W.jsx)(Cm,{className:`self-center shrink-0 w-14 h-14 text-pink-600`}),(0,W.jsxs)(`div`,{className:`text-center`,children:[(0,W.jsxs)(`p`,{className:`text-base font-semibold text-pink-600`,children:[`Status: `,r]}),(0,W.jsx)(`h1`,{className:`mt-2 text-2xl font-medium text-pink-600`,children:n}),(0,W.jsx)(`p`,{className:`mt-2 text-base`,children:i}),(0,W.jsxs)(`div`,{className:`mt-6 flex items-center justify-center gap-x-2`,children:[(0,W.jsx)(oT,{href:s,children:`Search docs for error`}),(0,W.jsx)(`span`,{"aria-hidden":`true`,children:` ·`}),(0,W.jsx)(oT,{href:`https://status.zuplo.com/`,children:`Check the status page`})]})]}),!c&&(0,W.jsxs)(Uz,{className:`flex flex-col`,children:[(0,W.jsx)(Wz,{className:`mb-2`,asChild:!0,children:(0,W.jsxs)(Y,{variant:`ghost`,children:[`Technical Details `,(0,W.jsx)(ym,{size:18})]})}),(0,W.jsx)(Gz,{children:(0,W.jsxs)(`div`,{className:`border rounded-sm border-solid grid grid-cols-[min-content_1fr] gap-x-3 gap-y-1.5 p-4 text-sm`,children:[(0,W.jsx)(`div`,{children:`Timestamp:`}),(0,W.jsx)(`div`,{children:new Date().toISOString()}),void 0,o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{children:`Trace ID:`}),(0,W.jsx)(`div`,{children:o})]}),t&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{children:`Type:`}),(0,W.jsx)(`a`,{className:`underline`,href:t,target:`_blank`,children:t})]}),a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{children:`Instance:`}),(0,W.jsx)(`div`,{children:a})]}),(0,W.jsx)(`div`,{children:`URL:`}),(0,W.jsx)(`div`,{className:`break-all`,children:window.location.pathname+window.location.search}),(0,W.jsx)(`div`,{children:`Stacktrace:`}),(0,W.jsx)(`pre`,{className:`bg-gray-100 rounded-sm overflow-scroll p-2`,children:l})]})})]})]}),(0,W.jsx)(`div`,{className:`self-center`,children:(0,W.jsxs)(`div`,{className:`flex justify-center space-x-4`,children:[(0,W.jsx)(Y,{asChild:!0,children:(0,W.jsxs)(`a`,{href:`/`,children:[(0,W.jsx)(Hm,{className:`w-4 h-4 text-base`}),`Go Home`]})}),(0,W.jsx)(Y,{className:`px-4 py-2 text-base`,variant:`outline`,asChild:!0,children:(0,W.jsxs)(`a`,{target:`_blank`,href:`mailto:${QS}`,rel:`noreferrer`,children:[(0,W.jsx)(Jre,{className:`w-4 h-4`}),` Email Support`]})}),(0,W.jsx)(tC,{text:`Chat on Discord`})]})})]})},
|
|
1668
|
-
//# sourceMappingURL=main.local-
|
|
1667
|
+
`);return(0,W.jsxs)(`div`,{className:`flex flex-col w-full mx-auto max-w-[800px] justify-center gap-4 items-center bg-white p-8`,children:[(0,W.jsxs)(`main`,{className:`flex flex-col gap-10`,children:[(0,W.jsx)(Cm,{className:`self-center shrink-0 w-14 h-14 text-pink-600`}),(0,W.jsxs)(`div`,{className:`text-center`,children:[(0,W.jsxs)(`p`,{className:`text-base font-semibold text-pink-600`,children:[`Status: `,r]}),(0,W.jsx)(`h1`,{className:`mt-2 text-2xl font-medium text-pink-600`,children:n}),(0,W.jsx)(`p`,{className:`mt-2 text-base`,children:i}),(0,W.jsxs)(`div`,{className:`mt-6 flex items-center justify-center gap-x-2`,children:[(0,W.jsx)(oT,{href:s,children:`Search docs for error`}),(0,W.jsx)(`span`,{"aria-hidden":`true`,children:` ·`}),(0,W.jsx)(oT,{href:`https://status.zuplo.com/`,children:`Check the status page`})]})]}),!c&&(0,W.jsxs)(Uz,{className:`flex flex-col`,children:[(0,W.jsx)(Wz,{className:`mb-2`,asChild:!0,children:(0,W.jsxs)(Y,{variant:`ghost`,children:[`Technical Details `,(0,W.jsx)(ym,{size:18})]})}),(0,W.jsx)(Gz,{children:(0,W.jsxs)(`div`,{className:`border rounded-sm border-solid grid grid-cols-[min-content_1fr] gap-x-3 gap-y-1.5 p-4 text-sm`,children:[(0,W.jsx)(`div`,{children:`Timestamp:`}),(0,W.jsx)(`div`,{children:new Date().toISOString()}),void 0,o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{children:`Trace ID:`}),(0,W.jsx)(`div`,{children:o})]}),t&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{children:`Type:`}),(0,W.jsx)(`a`,{className:`underline`,href:t,target:`_blank`,children:t})]}),a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{children:`Instance:`}),(0,W.jsx)(`div`,{children:a})]}),(0,W.jsx)(`div`,{children:`URL:`}),(0,W.jsx)(`div`,{className:`break-all`,children:window.location.pathname+window.location.search}),(0,W.jsx)(`div`,{children:`Stacktrace:`}),(0,W.jsx)(`pre`,{className:`bg-gray-100 rounded-sm overflow-scroll p-2`,children:l})]})})]})]}),(0,W.jsx)(`div`,{className:`self-center`,children:(0,W.jsxs)(`div`,{className:`flex justify-center space-x-4`,children:[(0,W.jsx)(Y,{asChild:!0,children:(0,W.jsxs)(`a`,{href:`/`,children:[(0,W.jsx)(Hm,{className:`w-4 h-4 text-base`}),`Go Home`]})}),(0,W.jsx)(Y,{className:`px-4 py-2 text-base`,variant:`outline`,asChild:!0,children:(0,W.jsxs)(`a`,{target:`_blank`,href:`mailto:${QS}`,rel:`noreferrer`,children:[(0,W.jsx)(Jre,{className:`w-4 h-4`}),` Email Support`]})}),(0,W.jsx)(tC,{text:`Chat on Discord`})]})})]})},X2t=2,Z9=new kse({defaultOptions:{queries:{retry:(e,t)=>Ff(t)?e<=X2t:!1},mutations:{onSettled:async(e,t,n,r,i)=>{let{meta:a}=i;if(a?.invalidates&&Array.isArray(a.invalidates))for(let{queryKey:e}of a.invalidates)await Z9.invalidateQueries({queryKey:e})}}}}),Z2t=3e3,Q2t=8e3;async function $2t(){let e=new AbortController,t=setTimeout(()=>e.abort(),Q2t);try{return await fetch(`/favicon.ico?_probe=${Date.now()}`,{method:`GET`,cache:`no-store`,signal:e.signal}),!0}catch{return!1}finally{clearTimeout(t)}}var e4t=()=>{let[e,t]=(0,g.useState)(()=>!d_.isOnline()),[n,r]=(0,g.useState)(!1),i=(0,g.useRef)(!1),a=(0,g.useCallback)(()=>{t(!1),r(!1),Z9.invalidateQueries()},[]),o=(0,g.useCallback)(async()=>{if(i.current)return;i.current=!0,r(!0);let e=await $2t();i.current=!1,e?a():r(!1)},[a]);return(0,g.useEffect)(()=>d_.subscribe(e=>{e?o():t(!0)}),[o]),(0,g.useEffect)(()=>Z9.getQueryCache().subscribe(e=>{e.type===`updated`&&e.action.type===`error`&&Ff(e.action.error)&&t(!0)}),[]),(0,g.useEffect)(()=>{if(!e)return;o();let t=window.setInterval(()=>{o()},Z2t);return()=>{window.clearInterval(t)}},[e,o]),e?(0,W.jsx)(rye,{isReconnecting:n,onRetry:()=>{o()}}):null},t4t=`zuplo-app-loader`;function n4t(e){typeof document>`u`||document.getElementById(t4t)?.setAttribute(`data-active`,e?`true`:`false`)}var r4t=250,i4t=(0,g.createContext)(null);function a4t(e,t){let n=new Set(e.requirements),r={...e.timestamps};switch(t.type){case`add`:return n.add(t.id),r[t.id]=Date.now(),{requirements:[...n],timestamps:r};case`remove`:return n.delete(t.id),delete r[t.id],{requirements:[...n],timestamps:r};default:throw Error()}}var o4t=({children:e})=>{let[t,n]=(0,g.useReducer)(a4t,{requirements:[],timestamps:{}}),r=(0,g.useRef)(null),i=(0,g.useRef)(new Set),a=t.requirements.length>0,[o,s]=(0,g.useState)(!0),c=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(a){c.current&&=(clearTimeout(c.current),null),s(!0);return}return c.current=setTimeout(()=>{s(!1),c.current=null},r4t),()=>{c.current&&=(clearTimeout(c.current),null)}},[a]),(0,g.useEffect)(()=>{n4t(o)},[o]);let l=(0,g.useCallback)(e=>n({type:`add`,id:e}),[]),u=(0,g.useCallback)(e=>n({type:`remove`,id:e}),[]);return(0,g.useEffect)(()=>(t.requirements.length>0?r.current=setInterval(()=>{let e=Date.now();t.requirements.forEach(n=>{let r=t.timestamps[n];r&&e-r>2e3&&(i.current.has(n)||(console.warn(`🐌 Slow loading detected: "${n}" has been loading for ${Math.round((e-r)/1e3)} seconds`),i.current.add(n)))})},2e3):(r.current&&=(clearInterval(r.current),null),i.current.clear()),()=>{r.current&&clearInterval(r.current)}),[t.requirements,t.timestamps]),(0,W.jsx)(i4t.Provider,{value:{add:l,remove:u},children:e})},s4t={zuplo:{id:`zuplo`,productName:`Zuplo Portal`,shortName:`Zuplo`,logo:`/zuplo.svg`,logoWhite:`/zuplo_white.svg`,favicon:`/favicon.ico`,docsUrl:`https://zuplo.com/docs`,logoAlt:`Zuplo`},akamai:{id:`akamai`,productName:`Akamai AI and API Manager`,shortName:`Akamai`,logo:`/brand/akamai/logo.svg`,logoDark:`/brand/akamai/logo-dark.svg`,logoWhite:`/brand/akamai/logo-white.svg`,favicon:`/brand/akamai/favicon.svg`,docsUrl:`https://techdocs.akamai.com`,logoAlt:`Akamai AI and API Manager`}},c4t=e=>e===`zuplo`||e===`akamai`,l4t=e=>s4t[e]??s4t.zuplo,Q9=`zuplo-color-scheme`,$9=`zuplo-brand`;`${Q9}${$9}`;var u4t=e=>e===`light`||e===`dark`||e===`system`,d4t=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches,f4t=(e,t)=>e===`system`?t?`dark`:`light`:e,p4t=()=>{try{let e=localStorage.getItem(Q9);return u4t(e)?e:`light`}catch{return`light`}},m4t=e=>{try{localStorage.setItem(Q9,e)}catch{}},h4t=()=>{try{let e=localStorage.getItem($9);return c4t(e)?e:null}catch{return null}},g4t=e=>{try{localStorage.setItem($9,e)}catch{}},_4t=e=>{if(typeof document>`u`)return;let t=document.documentElement;t.classList.toggle(`dark`,e===`dark`),t.style.colorScheme=e},v4t=e=>{if(typeof document>`u`)return;let t=document.documentElement;e===`zuplo`?t.removeAttribute(`data-brand`):t.setAttribute(`data-brand`,e)},y4t=()=>h4t()??`zuplo`,b4t=e=>{let t=document.querySelector(`link[rel~="icon"]`);t&&(t.href=e)},x4t=({children:e})=>{let[t,n]=(0,g.useState)(p4t),[r,i]=(0,g.useState)(d4t),[a,o]=(0,g.useState)(y4t),s=f4t(t,r),c=l4t(a);(0,g.useEffect)(()=>{if(t!==`system`||typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);i(e.matches);let n=e=>i(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[t]),(0,g.useEffect)(()=>{_4t(s)},[s]);let l=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(v4t(a),l.current===null){let e=document.querySelector(`link[rel~="icon"]`);l.current={title:document.title,favicon:e?.getAttribute(`href`)??null}}a===`zuplo`?(document.title=l.current.title,l.current.favicon&&b4t(l.current.favicon)):(document.title=c.productName,b4t(c.favicon))},[a,c]);let u=(0,g.useCallback)(e=>{m4t(e),n(e)},[]),d=(0,g.useCallback)(()=>{u(s===`dark`?`light`:`dark`)},[s,u]),f=(0,g.useCallback)((e,t)=>{t?.persist!==!1&&g4t(e),o(e)},[]),p=(0,g.useMemo)(()=>({brand:c,brandId:a,setBrand:f,colorScheme:s,colorSchemePreference:t,setColorSchemePreference:u,toggleColorScheme:d}),[c,a,f,s,t,u,d]);return(0,W.jsx)(hP.Provider,{value:p,children:e})},S4t=({children:e})=>(0,W.jsx)(g.Suspense,{fallback:null,children:(0,W.jsx)(x4t,{children:(0,W.jsxs)(jse,{client:Z9,children:[(0,W.jsx)(_N,{fallback:Y2t,children:(0,W.jsx)(o4t,{children:(0,W.jsx)(Dk,{children:(0,W.jsx)(xpt,{children:e})})})}),(0,W.jsx)(e4t,{})]})})});w(),v(),(0,h.createRoot)(document.getElementById(`zuplo-portal`)).render((0,W.jsx)(g.StrictMode,{children:(0,W.jsx)(()=>{let[e,t]=(0,g.useState)(!0);if(typeof window.localEditorConfig!=`object`)return(0,W.jsx)(`p`,{children:`Local editor config is missing. This is an invalid state.`});let{apeContext:n}=window.localEditorConfig;return(0,W.jsx)(Die.Provider,{value:n,children:(0,W.jsx)(Zse,{children:(0,W.jsx)(Yse,{children:(0,W.jsxs)(S4t,{children:[(0,W.jsx)(Pie,{onDisconnect:()=>t(!1),onConnect:()=>t(!0)}),!e&&(0,W.jsx)(Fie,{}),(0,W.jsx)(lee,{router:J2t})]})})})})},{})}));
|
|
1668
|
+
//# sourceMappingURL=main.local-D-vywwLs.js.map
|