@baseplate-dev/project-builder-web 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BGBGspyb.js → web-DeLjV85y.js} +2 -2
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-DeLjV85y.js.map +1 -0
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-CEcnKpIc.js +5 -0
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-CEcnKpIc.js.map +1 -0
- package/dist/assets/__federation_shared_@baseplate-dev/ui-components-BngA7Gbo.js +46 -0
- package/dist/assets/__federation_shared_@baseplate-dev/ui-components-BngA7Gbo.js.map +1 -0
- package/dist/assets/{_virtual___federation_fn_import-BmKkWdrw.js → _virtual___federation_fn_import-DTGz4eK3.js} +2 -2
- package/dist/assets/{_virtual___federation_fn_import-BmKkWdrw.js.map → _virtual___federation_fn_import-DTGz4eK3.js.map} +1 -1
- package/dist/assets/index-BM00URXH.js +78 -0
- package/dist/assets/index-BM00URXH.js.map +1 -0
- package/dist/assets/index-BievMsrf.css +1 -0
- package/dist/assets/{index.esm-CXwuLN4f.js → index.esm-BCWxrcvn.js} +2 -2
- package/dist/assets/{index.esm-CXwuLN4f.js.map → index.esm-BCWxrcvn.js.map} +1 -1
- package/dist/assets/model-merger-xMPe_PFP.js +2 -0
- package/dist/assets/model-merger-xMPe_PFP.js.map +1 -0
- package/dist/assets/not-empty-CxPFIhu9.js +2 -0
- package/dist/assets/not-empty-CxPFIhu9.js.map +1 -0
- package/dist/index.html +5 -5
- package/package.json +16 -6
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BGBGspyb.js.map +0 -1
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-BtVlDHx3.js +0 -5
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-BtVlDHx3.js.map +0 -1
- package/dist/assets/__federation_shared_@baseplate-dev/ui-components-DrVfzkV2.js +0 -46
- package/dist/assets/__federation_shared_@baseplate-dev/ui-components-DrVfzkV2.js.map +0 -1
- package/dist/assets/index-DGF099Eg.js +0 -2
- package/dist/assets/index-DGF099Eg.js.map +0 -1
- package/dist/assets/index-Tk1hPTzZ.css +0 -1
- package/dist/assets/index-YQe87MH8.js +0 -78
- package/dist/assets/index-YQe87MH8.js.map +0 -1
- package/dist/assets/model-merger-BKlenUIb.js +0 -2
- package/dist/assets/model-merger-BKlenUIb.js.map +0 -1
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import{i as C}from"./_virtual___federation_fn_import-BmKkWdrw.js";import{j as o,c as Sm,u as da,g as im,s as Gd,a as yw,b as pi,d as vs,e as it,f as jw,h as Sw}from"./index.esm-CXwuLN4f.js";import{r as ww,g as wm}from"./index-9Ra4Lmds.js";import{r as Cw}from"./index-B0D_rfGi.js";import{c as Te,G as Vi,M as L0,a as py,b as Ew,d as gy,e as Dw,f as Tw,n as vy,g as Rw,h as Cm,i as by,j as xy,k as Nw,l as Mw,m as Gi,o as yy,p as bs,q as kl,r as Em,s as Aw,t as $w,u as Lw,v as Ow,w as jy,x as Uw,y as zw,z as Bw,A as _w}from"./index-DGF099Eg.js";import{p as qw,s as Kn,o as Fw,i as Sy,c as Hw,f as Pw}from"./index-DC_DCd-Q.js";import{i as Iw}from"./isEqual-C420KeG-.js";import{c as kw}from"./capitalize-gOJXDbsR.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();var Yd={exports:{}},Gr={},Xd={exports:{}},Qd={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* scheduler.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var O0;function Vw(){return O0||(O0=1,function(a){function n(U,F){var X=U.length;U.push(F);e:for(;0<X;){var te=X-1>>>1,re=U[te];if(0<c(re,F))U[te]=F,U[X]=re,X=te;else break e}}function l(U){return U.length===0?null:U[0]}function s(U){if(U.length===0)return null;var F=U[0],X=U.pop();if(X!==F){U[0]=X;e:for(var te=0,re=U.length,ve=re>>>1;te<ve;){var ie=2*(te+1)-1,ue=U[ie],we=ie+1,Se=U[we];if(0>c(ue,X))we<re&&0>c(Se,ue)?(U[te]=Se,U[we]=X,te=we):(U[te]=ue,U[ie]=X,te=ie);else if(we<re&&0>c(Se,X))U[te]=Se,U[we]=X,te=we;else break e}}return F}function c(U,F){var X=U.sortIndex-F.sortIndex;return X!==0?X:U.id-F.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var f=Date,p=f.now();a.unstable_now=function(){return f.now()-p}}var m=[],g=[],v=1,b=null,y=3,j=!1,D=!1,w=!1,R=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function P(U){for(var F=l(g);F!==null;){if(F.callback===null)s(g);else if(F.startTime<=U)s(g),F.sortIndex=F.expirationTime,n(m,F);else break;F=l(g)}}function V(U){if(w=!1,P(U),!D)if(l(m)!==null)D=!0,G||(G=!0,oe());else{var F=l(g);F!==null&&J(V,F.startTime-U)}}var G=!1,T=-1,B=5,W=-1;function ne(){return R?!0:!(a.unstable_now()-W<B)}function ae(){if(R=!1,G){var U=a.unstable_now();W=U;var F=!0;try{e:{D=!1,w&&(w=!1,A(T),T=-1),j=!0;var X=y;try{t:{for(P(U),b=l(m);b!==null&&!(b.expirationTime>U&&ne());){var te=b.callback;if(typeof te=="function"){b.callback=null,y=b.priorityLevel;var re=te(b.expirationTime<=U);if(U=a.unstable_now(),typeof re=="function"){b.callback=re,P(U),F=!0;break t}b===l(m)&&s(m),P(U)}else s(m);b=l(m)}if(b!==null)F=!0;else{var ve=l(g);ve!==null&&J(V,ve.startTime-U),F=!1}}break e}finally{b=null,y=X,j=!1}F=void 0}}finally{F?oe():G=!1}}}var oe;if(typeof O=="function")oe=function(){O(ae)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,Z=se.port2;se.port1.onmessage=ae,oe=function(){Z.postMessage(null)}}else oe=function(){E(ae,0)};function J(U,F){T=E(function(){U(a.unstable_now())},F)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(U){U.callback=null},a.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<U?Math.floor(1e3/U):5},a.unstable_getCurrentPriorityLevel=function(){return y},a.unstable_next=function(U){switch(y){case 1:case 2:case 3:var F=3;break;default:F=y}var X=y;y=F;try{return U()}finally{y=X}},a.unstable_requestPaint=function(){R=!0},a.unstable_runWithPriority=function(U,F){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var X=y;y=U;try{return F()}finally{y=X}},a.unstable_scheduleCallback=function(U,F,X){var te=a.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?te+X:te):X=te,U){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=X+re,U={id:v++,callback:F,priorityLevel:U,startTime:X,expirationTime:re,sortIndex:-1},X>te?(U.sortIndex=X,n(g,U),l(m)===null&&U===l(g)&&(w?(A(T),T=-1):w=!0,J(V,X-te))):(U.sortIndex=re,n(m,U),D||j||(D=!0,G||(G=!0,oe()))),U},a.unstable_shouldYield=ne,a.unstable_wrapCallback=function(U){var F=y;return function(){var X=y;y=F;try{return U.apply(this,arguments)}finally{y=X}}}}(Qd)),Qd}var U0;function Gw(){return U0||(U0=1,Xd.exports=Vw()),Xd.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-dom-client.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var z0;function Yw(){if(z0)return Gr;z0=1;var a=Gw(),n=ww(),l=Cw();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(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 p(e){if(d(e)!==e)throw Error(s(188))}function m(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,r=t;;){var u=i.return;if(u===null)break;var h=u.alternate;if(h===null){if(r=u.return,r!==null){i=r;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===i)return p(u),e;if(h===r)return p(u),t;h=h.sibling}throw Error(s(188))}if(i.return!==r.return)i=u,r=h;else{for(var x=!1,S=u.child;S;){if(S===i){x=!0,i=u,r=h;break}if(S===r){x=!0,r=u,i=h;break}S=S.sibling}if(!x){for(S=h.child;S;){if(S===i){x=!0,i=h,r=u;break}if(S===r){x=!0,r=h,i=u;break}S=S.sibling}if(!x)throw Error(s(189))}}if(i.alternate!==r)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function Z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case R:return"Profiler";case w:return"StrictMode";case V:return"Suspense";case G:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case O:return(e.displayName||"Context")+".Provider";case A:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return t=e.displayName||null,t!==null?t:Z(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return Z(e(t))}catch{}}return null}var J=Array.isArray,U=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},te=[],re=-1;function ve(e){return{current:e}}function ie(e){0>re||(e.current=te[re],te[re]=null,re--)}function ue(e,t){re++,te[re]=e.current,e.current=t}var we=ve(null),Se=ve(null),Ue=ve(null),Ot=ve(null);function Dt(e,t){switch(ue(Ue,t),ue(Se,e),ue(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?s0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=s0(t),e=o0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ie(we),ue(we,e)}function Tt(){ie(we),ie(Se),ie(Ue)}function Be(e){e.memoizedState!==null&&ue(Ot,e);var t=we.current,i=o0(t,e.type);t!==i&&(ue(Se,e),ue(we,i))}function En(e){Se.current===e&&(ie(we),ie(Se)),Ot.current===e&&(ie(Ot),Hr._currentValue=X)}var Ie=Object.prototype.hasOwnProperty,Ut=a.unstable_scheduleCallback,Vt=a.unstable_cancelCallback,Jn=a.unstable_shouldYield,Gt=a.unstable_requestPaint,Xt=a.unstable_now,Ki=a.unstable_getCurrentPriorityLevel,pa=a.unstable_ImmediatePriority,dn=a.unstable_UserBlockingPriority,Fn=a.unstable_NormalPriority,Ha=a.unstable_LowPriority,vi=a.unstable_IdlePriority,Dn=a.log,ga=a.unstable_setDisableYieldValue,ea=null,rt=null;function st(e){if(typeof Dn=="function"&&ga(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(ea,e)}catch{}}var Ve=Math.clz32?Math.clz32:Zi,bi=Math.log,Qt=Math.LN2;function Zi(e){return e>>>=0,e===0?32:31-(bi(e)/Qt|0)|0}var Kt=256,va=4194304;function tn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ta(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var u=0,h=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=r&134217727;return S!==0?(r=S&~h,r!==0?u=tn(r):(x&=S,x!==0?u=tn(x):i||(i=S&~e,i!==0&&(u=tn(i))))):(S=r&~h,S!==0?u=tn(S):x!==0?u=tn(x):i||(i=r&~e,i!==0&&(u=tn(i)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,i=t&-t,h>=i||h===32&&(i&4194048)!==0)?t:u}function ba(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xi(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xa(){var e=Kt;return Kt<<=1,(Kt&4194048)===0&&(Kt=256),e}function yi(){var e=va;return va<<=1,(va&62914560)===0&&(va=4194304),e}function ya(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function zt(e,t,i,r,u,h){var x=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var S=e.entanglements,N=e.expirationTimes,q=e.hiddenUpdates;for(i=x&~i;0<i;){var Y=31-Ve(i),K=1<<Y;S[Y]=0,N[Y]=-1;var I=q[Y];if(I!==null)for(q[Y]=null,Y=0;Y<I.length;Y++){var k=I[Y];k!==null&&(k.lane&=-536870913)}i&=~K}r!==0&&jt(e,r,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~t))}function jt(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ve(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|i&4194090}function fn(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var r=31-Ve(i),u=1<<r;u&t|e[r]&t&&(e[r]|=t),i&=~u}}function St(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function dt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rt(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:T0(e.type))}function na(e,t){var i=F.p;try{return F.p=e,t()}finally{F.p=i}}var Ze=Math.random().toString(36).slice(2),M="__reactFiber$"+Ze,L="__reactProps$"+Ze,H="__reactContainer$"+Ze,ee="__reactEvents$"+Ze,le="__reactListeners$"+Ze,he="__reactHandles$"+Ze,xe="__reactResources$"+Ze,ce="__reactMarker$"+Ze;function me(e){delete e[M],delete e[L],delete e[ee],delete e[le],delete e[he]}function de(e){var t=e[M];if(t)return t;for(var i=e.parentNode;i;){if(t=i[H]||i[M]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=f0(e);e!==null;){if(i=e[M])return i;e=f0(e)}return t}e=i,i=e.parentNode}return null}function pe(e){if(e=e[M]||e[H]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Ee(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Ne(e){var t=e[xe];return t||(t=e[xe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Oe(e){e[ce]=!0}var Ge=new Set,_e={};function ke(e,t){hn(e,t),hn(e+"Capture",t)}function hn(e,t){for(_e[e]=t,e=0;e<t.length;e++)Ge.add(t[e])}var ji=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tn={},mn={};function Jl(e){return Ie.call(mn,e)?!0:Ie.call(Tn,e)?!1:ji.test(e)?mn[e]=!0:(Tn[e]=!0,!1)}function aa(e,t,i){if(Jl(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Rn(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function nn(e,t,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+r)}}var Pa,ze;function Ye(e){if(Pa===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Pa=t&&t[1]||"",ze=-1<i.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+Pa+e+ze}var ia=!1;function ja(e,t){if(!e||ia)return"";ia=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(k){var I=k}Reflect.construct(e,[],K)}else{try{K.call()}catch(k){I=k}e.call(K.prototype)}}else{try{throw Error()}catch(k){I=k}(K=e())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(k){if(k&&I&&typeof k.stack=="string")return[k.stack,I.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=r.DetermineComponentFrameRoot(),x=h[0],S=h[1];if(x&&S){var N=x.split(`
|
|
20
|
-
`),q=S.split(`
|
|
21
|
-
`);for(u=r=0;r<N.length&&!N[r].includes("DetermineComponentFrameRoot");)r++;for(;u<q.length&&!q[u].includes("DetermineComponentFrameRoot");)u++;if(r===N.length||u===q.length)for(r=N.length-1,u=q.length-1;1<=r&&0<=u&&N[r]!==q[u];)u--;for(;1<=r&&0<=u;r--,u--)if(N[r]!==q[u]){if(r!==1||u!==1)do if(r--,u--,0>u||N[r]!==q[u]){var Y=`
|
|
22
|
-
`+N[r].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=r&&0<=u);break}}}finally{ia=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ye(i):""}function ft(e){switch(e.tag){case 26:case 27:case 5:return Ye(e.type);case 16:return Ye("Lazy");case 13:return Ye("Suspense");case 19:return Ye("SuspenseList");case 0:case 15:return ja(e.type,!1);case 11:return ja(e.type.render,!1);case 1:return ja(e.type,!0);case 31:return Ye("Activity");default:return""}}function Sa(e){try{var t="";do t+=ft(e),e=e.return;while(e);return t}catch(i){return`
|
|
23
|
-
Error generating stack: `+i.message+`
|
|
24
|
-
`+i.stack}}function Zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ns(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function p2(e){var t=Ns(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,h=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(x){r=""+x,h.call(this,x)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(x){r=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ms(e){e._valueTracker||(e._valueTracker=p2(e))}function ap(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),r="";return e&&(r=Ns(e)?e.checked?"true":"false":e.value),e=r,e!==i?(t.setValue(e),!0):!1}function As(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var g2=/[\n"\\]/g;function Nn(e){return e.replace(g2,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ic(e,t,i,r,u,h,x,S){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zt(t)):e.value!==""+Zt(t)&&(e.value=""+Zt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?kc(e,x,Zt(t)):i!=null?kc(e,x,Zt(i)):r!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+Zt(S):e.removeAttribute("name")}function ip(e,t,i,r,u,h,x,S){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||t!=null))return;i=i!=null?""+Zt(i):"",t=t!=null?""+Zt(t):i,S||t===e.value||(e.value=t),e.defaultValue=t}r=r??u,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=S?e.checked:!!r,e.defaultChecked=!!r,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x)}function kc(e,t,i){t==="number"&&As(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Wi(e,t,i,r){if(e=e.options,t){t={};for(var u=0;u<i.length;u++)t["$"+i[u]]=!0;for(i=0;i<e.length;i++)u=t.hasOwnProperty("$"+e[i].value),e[i].selected!==u&&(e[i].selected=u),u&&r&&(e[i].defaultSelected=!0)}else{for(i=""+Zt(i),t=null,u=0;u<e.length;u++){if(e[u].value===i){e[u].selected=!0,r&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function lp(e,t,i){if(t!=null&&(t=""+Zt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Zt(i):""}function rp(e,t,i,r){if(t==null){if(r!=null){if(i!=null)throw Error(s(92));if(J(r)){if(1<r.length)throw Error(s(93));r=r[0]}i=r}i==null&&(i=""),t=i}i=Zt(t),e.defaultValue=i,r=e.textContent,r===i&&r!==""&&r!==null&&(e.value=r)}function Ji(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var v2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function sp(e,t,i){var r=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,i):typeof i!="number"||i===0||v2.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function op(e,t,i){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,i!=null){for(var r in i)!i.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var u in t)r=t[u],t.hasOwnProperty(u)&&i[u]!==r&&sp(e,u,r)}else for(var h in t)t.hasOwnProperty(h)&&sp(e,h,t[h])}function Vc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var b2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),x2=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $s(e){return x2.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Gc=null;function Yc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var el=null,tl=null;function cp(e){var t=pe(e);if(t&&(e=t.stateNode)){var i=e[L]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ic(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Nn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var r=i[t];if(r!==e&&r.form===e.form){var u=r[L]||null;if(!u)throw Error(s(90));Ic(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<i.length;t++)r=i[t],r.form===e.form&&ap(r)}break e;case"textarea":lp(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Wi(e,!!i.multiple,t,!1)}}}var Xc=!1;function up(e,t,i){if(Xc)return e(t,i);Xc=!0;try{var r=e(t);return r}finally{if(Xc=!1,(el!==null||tl!==null)&&(bo(),el&&(t=el,e=tl,tl=el=null,cp(t),e)))for(t=0;t<e.length;t++)cp(e[t])}}function er(e,t){var i=e.stateNode;if(i===null)return null;var r=i[L]||null;if(r===null)return null;i=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var wa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qc=!1;if(wa)try{var tr={};Object.defineProperty(tr,"passive",{get:function(){Qc=!0}}),window.addEventListener("test",tr,tr),window.removeEventListener("test",tr,tr)}catch{Qc=!1}var Ia=null,Kc=null,Ls=null;function dp(){if(Ls)return Ls;var e,t=Kc,i=t.length,r,u="value"in Ia?Ia.value:Ia.textContent,h=u.length;for(e=0;e<i&&t[e]===u[e];e++);var x=i-e;for(r=1;r<=x&&t[i-r]===u[h-r];r++);return Ls=u.slice(e,1<r?1-r:void 0)}function Os(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Us(){return!0}function fp(){return!1}function an(e){function t(i,r,u,h,x){this._reactName=i,this._targetInst=u,this.type=r,this.nativeEvent=h,this.target=x,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(i=e[S],this[S]=i?i(h):h[S]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Us:fp,this.isPropagationStopped=fp,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Us)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Us)},persist:function(){},isPersistent:Us}),t}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zs=an(Si),nr=v({},Si,{view:0,detail:0}),y2=an(nr),Zc,Wc,ar,Bs=v({},nr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ar&&(ar&&e.type==="mousemove"?(Zc=e.screenX-ar.screenX,Wc=e.screenY-ar.screenY):Wc=Zc=0,ar=e),Zc)},movementY:function(e){return"movementY"in e?e.movementY:Wc}}),hp=an(Bs),j2=v({},Bs,{dataTransfer:0}),S2=an(j2),w2=v({},nr,{relatedTarget:0}),Jc=an(w2),C2=v({},Si,{animationName:0,elapsedTime:0,pseudoElement:0}),E2=an(C2),D2=v({},Si,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),T2=an(D2),R2=v({},Si,{data:0}),mp=an(R2),N2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},A2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=A2[e])?!!t[e]:!1}function eu(){return $2}var L2=v({},nr,{key:function(e){if(e.key){var t=N2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Os(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?M2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eu,charCode:function(e){return e.type==="keypress"?Os(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Os(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),O2=an(L2),U2=v({},Bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pp=an(U2),z2=v({},nr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eu}),B2=an(z2),_2=v({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0}),q2=an(_2),F2=v({},Bs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),H2=an(F2),P2=v({},Si,{newState:0,oldState:0}),I2=an(P2),k2=[9,13,27,32],tu=wa&&"CompositionEvent"in window,ir=null;wa&&"documentMode"in document&&(ir=document.documentMode);var V2=wa&&"TextEvent"in window&&!ir,gp=wa&&(!tu||ir&&8<ir&&11>=ir),vp=" ",bp=!1;function xp(e,t){switch(e){case"keyup":return k2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nl=!1;function G2(e,t){switch(e){case"compositionend":return yp(t);case"keypress":return t.which!==32?null:(bp=!0,vp);case"textInput":return e=t.data,e===vp&&bp?null:e;default:return null}}function Y2(e,t){if(nl)return e==="compositionend"||!tu&&xp(e,t)?(e=dp(),Ls=Kc=Ia=null,nl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return gp&&t.locale!=="ko"?null:t.data;default:return null}}var X2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!X2[e.type]:t==="textarea"}function Sp(e,t,i,r){el?tl?tl.push(r):tl=[r]:el=r,t=Co(t,"onChange"),0<t.length&&(i=new zs("onChange","change",null,i,r),e.push({event:i,listeners:t}))}var lr=null,rr=null;function Q2(e){n0(e,0)}function _s(e){var t=Ee(e);if(ap(t))return e}function wp(e,t){if(e==="change")return t}var Cp=!1;if(wa){var nu;if(wa){var au="oninput"in document;if(!au){var Ep=document.createElement("div");Ep.setAttribute("oninput","return;"),au=typeof Ep.oninput=="function"}nu=au}else nu=!1;Cp=nu&&(!document.documentMode||9<document.documentMode)}function Dp(){lr&&(lr.detachEvent("onpropertychange",Tp),rr=lr=null)}function Tp(e){if(e.propertyName==="value"&&_s(rr)){var t=[];Sp(t,rr,e,Yc(e)),up(Q2,t)}}function K2(e,t,i){e==="focusin"?(Dp(),lr=t,rr=i,lr.attachEvent("onpropertychange",Tp)):e==="focusout"&&Dp()}function Z2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _s(rr)}function W2(e,t){if(e==="click")return _s(t)}function J2(e,t){if(e==="input"||e==="change")return _s(t)}function eS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pn=typeof Object.is=="function"?Object.is:eS;function sr(e,t){if(pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(r=0;r<i.length;r++){var u=i[r];if(!Ie.call(t,u)||!pn(e[u],t[u]))return!1}return!0}function Rp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Np(e,t){var i=Rp(e);e=0;for(var r;i;){if(i.nodeType===3){if(r=e+i.textContent.length,e<=t&&r>=t)return{node:i,offset:t-e};e=r}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Rp(i)}}function Mp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ap(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=As(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=As(e.document)}return t}function iu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var tS=wa&&"documentMode"in document&&11>=document.documentMode,al=null,lu=null,or=null,ru=!1;function $p(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ru||al==null||al!==As(r)||(r=al,"selectionStart"in r&&iu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),or&&sr(or,r)||(or=r,r=Co(lu,"onSelect"),0<r.length&&(t=new zs("onSelect","select",null,t,i),e.push({event:t,listeners:r}),t.target=al)))}function wi(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var il={animationend:wi("Animation","AnimationEnd"),animationiteration:wi("Animation","AnimationIteration"),animationstart:wi("Animation","AnimationStart"),transitionrun:wi("Transition","TransitionRun"),transitionstart:wi("Transition","TransitionStart"),transitioncancel:wi("Transition","TransitionCancel"),transitionend:wi("Transition","TransitionEnd")},su={},Lp={};wa&&(Lp=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function Ci(e){if(su[e])return su[e];if(!il[e])return e;var t=il[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Lp)return su[e]=t[i];return e}var Op=Ci("animationend"),Up=Ci("animationiteration"),zp=Ci("animationstart"),nS=Ci("transitionrun"),aS=Ci("transitionstart"),iS=Ci("transitioncancel"),Bp=Ci("transitionend"),_p=new Map,ou="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ou.push("scrollEnd");function Hn(e,t){_p.set(e,t),ke(t,[e])}var qp=new WeakMap;function Mn(e,t){if(typeof e=="object"&&e!==null){var i=qp.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Sa(t)},qp.set(e,t),t)}return{value:e,source:t,stack:Sa(t)}}var An=[],ll=0,cu=0;function qs(){for(var e=ll,t=cu=ll=0;t<e;){var i=An[t];An[t++]=null;var r=An[t];An[t++]=null;var u=An[t];An[t++]=null;var h=An[t];if(An[t++]=null,r!==null&&u!==null){var x=r.pending;x===null?u.next=u:(u.next=x.next,x.next=u),r.pending=u}h!==0&&Fp(i,u,h)}}function Fs(e,t,i,r){An[ll++]=e,An[ll++]=t,An[ll++]=i,An[ll++]=r,cu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function uu(e,t,i,r){return Fs(e,t,i,r),Hs(e)}function rl(e,t){return Fs(e,null,null,t),Hs(e)}function Fp(e,t,i){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i);for(var u=!1,h=e.return;h!==null;)h.childLanes|=i,r=h.alternate,r!==null&&(r.childLanes|=i),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-Ve(i),e=h.hiddenUpdates,r=e[u],r===null?e[u]=[t]:r.push(t),t.lane=i|536870912),h):null}function Hs(e){if(50<Lr)throw Lr=0,gd=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var sl={};function lS(e,t,i,r){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(e,t,i,r){return new lS(e,t,i,r)}function du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ca(e,t){var i=e.alternate;return i===null?(i=gn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Hp(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ps(e,t,i,r,u,h){var x=0;if(r=e,typeof e=="function")du(e)&&(x=1);else if(typeof e=="string")x=sw(e,i,we.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case W:return e=gn(31,i,t,u),e.elementType=W,e.lanes=h,e;case D:return Ei(i.children,u,h,t);case w:x=8,u|=24;break;case R:return e=gn(12,i,t,u|2),e.elementType=R,e.lanes=h,e;case V:return e=gn(13,i,t,u),e.elementType=V,e.lanes=h,e;case G:return e=gn(19,i,t,u),e.elementType=G,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:case O:x=10;break e;case A:x=9;break e;case P:x=11;break e;case T:x=14;break e;case B:x=16,r=null;break e}x=29,i=Error(s(130,e===null?"null":typeof e,"")),r=null}return t=gn(x,i,t,u),t.elementType=e,t.type=r,t.lanes=h,t}function Ei(e,t,i,r){return e=gn(7,e,r,t),e.lanes=i,e}function fu(e,t,i){return e=gn(6,e,null,t),e.lanes=i,e}function hu(e,t,i){return t=gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ol=[],cl=0,Is=null,ks=0,$n=[],Ln=0,Di=null,Ea=1,Da="";function Ti(e,t){ol[cl++]=ks,ol[cl++]=Is,Is=e,ks=t}function Pp(e,t,i){$n[Ln++]=Ea,$n[Ln++]=Da,$n[Ln++]=Di,Di=e;var r=Ea;e=Da;var u=32-Ve(r)-1;r&=~(1<<u),i+=1;var h=32-Ve(t)+u;if(30<h){var x=u-u%5;h=(r&(1<<x)-1).toString(32),r>>=x,u-=x,Ea=1<<32-Ve(t)+u|i<<u|r,Da=h+e}else Ea=1<<h|i<<u|r,Da=e}function mu(e){e.return!==null&&(Ti(e,1),Pp(e,1,0))}function pu(e){for(;e===Is;)Is=ol[--cl],ol[cl]=null,ks=ol[--cl],ol[cl]=null;for(;e===Di;)Di=$n[--Ln],$n[Ln]=null,Da=$n[--Ln],$n[Ln]=null,Ea=$n[--Ln],$n[Ln]=null}var Wt=null,ht=null,He=!1,Ri=null,la=!1,gu=Error(s(519));function Ni(e){var t=Error(s(418,""));throw dr(Mn(t,e)),gu}function Ip(e){var t=e.stateNode,i=e.type,r=e.memoizedProps;switch(t[M]=e,t[L]=r,i){case"dialog":Le("cancel",t),Le("close",t);break;case"iframe":case"object":case"embed":Le("load",t);break;case"video":case"audio":for(i=0;i<Ur.length;i++)Le(Ur[i],t);break;case"source":Le("error",t);break;case"img":case"image":case"link":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"input":Le("invalid",t),ip(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),Ms(t);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),rp(t,r.value,r.defaultValue,r.children),Ms(t)}i=r.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||r.suppressHydrationWarning===!0||r0(t.textContent,i)?(r.popover!=null&&(Le("beforetoggle",t),Le("toggle",t)),r.onScroll!=null&&Le("scroll",t),r.onScrollEnd!=null&&Le("scrollend",t),r.onClick!=null&&(t.onclick=Eo),t=!0):t=!1,t||Ni(e)}function kp(e){for(Wt=e.return;Wt;)switch(Wt.tag){case 5:case 13:la=!1;return;case 27:case 3:la=!0;return;default:Wt=Wt.return}}function cr(e){if(e!==Wt)return!1;if(!He)return kp(e),He=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||$d(e.type,e.memoizedProps)),i=!i),i&&ht&&Ni(e),kp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(i=e.data,i==="/$"){if(t===0){ht=In(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++;e=e.nextSibling}ht=null}}else t===27?(t=ht,li(e.type)?(e=zd,zd=null,ht=e):ht=t):ht=Wt?In(e.stateNode.nextSibling):null;return!0}function ur(){ht=Wt=null,He=!1}function Vp(){var e=Ri;return e!==null&&(sn===null?sn=e:sn.push.apply(sn,e),Ri=null),e}function dr(e){Ri===null?Ri=[e]:Ri.push(e)}var vu=ve(null),Mi=null,Ta=null;function ka(e,t,i){ue(vu,t._currentValue),t._currentValue=i}function Ra(e){e._currentValue=vu.current,ie(vu)}function bu(e,t,i){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===i)break;e=e.return}}function xu(e,t,i,r){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var x=u.child;h=h.firstContext;e:for(;h!==null;){var S=h;h=u;for(var N=0;N<t.length;N++)if(S.context===t[N]){h.lanes|=i,S=h.alternate,S!==null&&(S.lanes|=i),bu(h.return,i,e),r||(x=null);break e}h=S.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(s(341));x.lanes|=i,h=x.alternate,h!==null&&(h.lanes|=i),bu(x,i,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function fr(e,t,i,r){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(s(387));if(x=x.memoizedProps,x!==null){var S=u.type;pn(u.pendingProps.value,x.value)||(e!==null?e.push(S):e=[S])}}else if(u===Ot.current){if(x=u.alternate,x===null)throw Error(s(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Hr):e=[Hr])}u=u.return}e!==null&&xu(t,e,i,r),t.flags|=262144}function Vs(e){for(e=e.firstContext;e!==null;){if(!pn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ai(e){Mi=e,Ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yt(e){return Gp(Mi,e)}function Gs(e,t){return Mi===null&&Ai(e),Gp(e,t)}function Gp(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ta===null){if(e===null)throw Error(s(308));Ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ta=Ta.next=t;return i}var rS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},sS=a.unstable_scheduleCallback,oS=a.unstable_NormalPriority,wt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yu(){return{controller:new rS,data:new Map,refCount:0}}function hr(e){e.refCount--,e.refCount===0&&sS(oS,function(){e.controller.abort()})}var mr=null,ju=0,ul=0,dl=null;function cS(e,t){if(mr===null){var i=mr=[];ju=0,ul=wd(),dl={status:"pending",value:void 0,then:function(r){i.push(r)}}}return ju++,t.then(Yp,Yp),t}function Yp(){if(--ju===0&&mr!==null){dl!==null&&(dl.status="fulfilled");var e=mr;mr=null,ul=0,dl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function uS(e,t){var i=[],r={status:"pending",value:null,reason:null,then:function(u){i.push(u)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var u=0;u<i.length;u++)(0,i[u])(t)},function(u){for(r.status="rejected",r.reason=u,u=0;u<i.length;u++)(0,i[u])(void 0)}),r}var Xp=U.S;U.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&cS(e,t),Xp!==null&&Xp(e,t)};var $i=ve(null);function Su(){var e=$i.current;return e!==null?e:at.pooledCache}function Ys(e,t){t===null?ue($i,$i.current):ue($i,t.pool)}function Qp(){var e=Su();return e===null?null:{parent:wt._currentValue,pool:e}}var pr=Error(s(460)),Kp=Error(s(474)),Xs=Error(s(542)),wu={then:function(){}};function Zp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qs(){}function Wp(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Qs,Qs),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,eg(e),e;default:if(typeof t.status=="string")t.then(Qs,Qs);else{if(e=at,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=r}},function(r){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,eg(e),e}throw gr=t,pr}}var gr=null;function Jp(){if(gr===null)throw Error(s(459));var e=gr;return gr=null,e}function eg(e){if(e===pr||e===Xs)throw Error(s(483))}var Va=!1;function Cu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ga(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,i){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Xe&2)!==0){var u=r.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),r.pending=t,t=Hs(e),Fp(e,null,i),t}return Fs(e,r,t,i),Hs(e)}function vr(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,fn(e,i)}}function Du(e,t){var i=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,i===r)){var u=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var x={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?u=h=x:h=h.next=x,i=i.next}while(i!==null);h===null?u=h=t:h=h.next=t}else u=h=t;i={baseState:r.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:r.shared,callbacks:r.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Tu=!1;function br(){if(Tu){var e=dl;if(e!==null)throw e}}function xr(e,t,i,r){Tu=!1;var u=e.updateQueue;Va=!1;var h=u.firstBaseUpdate,x=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var N=S,q=N.next;N.next=null,x===null?h=q:x.next=q,x=N;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,S=Y.lastBaseUpdate,S!==x&&(S===null?Y.firstBaseUpdate=q:S.next=q,Y.lastBaseUpdate=N))}if(h!==null){var K=u.baseState;x=0,Y=q=N=null,S=h;do{var I=S.lane&-536870913,k=I!==S.lane;if(k?(qe&I)===I:(r&I)===I){I!==0&&I===ul&&(Tu=!0),Y!==null&&(Y=Y.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Ce=e,ye=S;I=t;var et=i;switch(ye.tag){case 1:if(Ce=ye.payload,typeof Ce=="function"){K=Ce.call(et,K,I);break e}K=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=ye.payload,I=typeof Ce=="function"?Ce.call(et,K,I):Ce,I==null)break e;K=v({},K,I);break e;case 2:Va=!0}}I=S.callback,I!==null&&(e.flags|=64,k&&(e.flags|=8192),k=u.callbacks,k===null?u.callbacks=[I]:k.push(I))}else k={lane:I,tag:S.tag,payload:S.payload,callback:S.callback,next:null},Y===null?(q=Y=k,N=K):Y=Y.next=k,x|=I;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;k=S,S=k.next,k.next=null,u.lastBaseUpdate=k,u.shared.pending=null}}while(!0);Y===null&&(N=K),u.baseState=N,u.firstBaseUpdate=q,u.lastBaseUpdate=Y,h===null&&(u.shared.lanes=0),ti|=x,e.lanes=x,e.memoizedState=K}}function tg(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function ng(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)tg(i[e],t)}var fl=ve(null),Ks=ve(0);function ag(e,t){e=Ua,ue(Ks,e),ue(fl,t),Ua=e|t.baseLanes}function Ru(){ue(Ks,Ua),ue(fl,fl.current)}function Nu(){Ua=Ks.current,ie(fl),ie(Ks)}var Xa=0,Me=null,We=null,bt=null,Zs=!1,hl=!1,Li=!1,Ws=0,yr=0,ml=null,dS=0;function pt(){throw Error(s(321))}function Mu(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!pn(e[i],t[i]))return!1;return!0}function Au(e,t,i,r,u,h){return Xa=h,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Fg:Hg,Li=!1,h=i(r,u),Li=!1,hl&&(h=lg(t,i,r,u)),ig(e),h}function ig(e){U.H=io;var t=We!==null&&We.next!==null;if(Xa=0,bt=We=Me=null,Zs=!1,yr=0,ml=null,t)throw Error(s(300));e===null||Nt||(e=e.dependencies,e!==null&&Vs(e)&&(Nt=!0))}function lg(e,t,i,r){Me=e;var u=0;do{if(hl&&(ml=null),yr=0,hl=!1,25<=u)throw Error(s(301));if(u+=1,bt=We=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}U.H=bS,h=t(i,r)}while(hl);return h}function fS(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?jr(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Me.flags|=1024),t}function $u(){var e=Ws!==0;return Ws=0,e}function Lu(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Ou(e){if(Zs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Zs=!1}Xa=0,bt=We=Me=null,hl=!1,yr=Ws=0,ml=null}function ln(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Me.memoizedState=bt=e:bt=bt.next=e,bt}function xt(){if(We===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=bt===null?Me.memoizedState:bt.next;if(t!==null)bt=t,We=e;else{if(e===null)throw Me.alternate===null?Error(s(467)):Error(s(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},bt===null?Me.memoizedState=bt=e:bt=bt.next=e}return bt}function Uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jr(e){var t=yr;return yr+=1,ml===null&&(ml=[]),e=Wp(ml,e,t),t=Me,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Fg:Hg),e}function Js(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return jr(e);if(e.$$typeof===O)return Yt(e)}throw Error(s(438,String(e)))}function zu(e){var t=null,i=Me.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var r=Me.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Uu(),Me.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),r=0;r<e;r++)i[r]=ne;return t.index++,i}function Na(e,t){return typeof t=="function"?t(e):t}function eo(e){var t=xt();return Bu(t,We,e)}function Bu(e,t,i){var r=e.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=i;var u=e.baseQueue,h=r.pending;if(h!==null){if(u!==null){var x=u.next;u.next=h.next,h.next=x}t.baseQueue=u=h,r.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var S=x=null,N=null,q=t,Y=!1;do{var K=q.lane&-536870913;if(K!==q.lane?(qe&K)===K:(Xa&K)===K){var I=q.revertLane;if(I===0)N!==null&&(N=N.next={lane:0,revertLane:0,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),K===ul&&(Y=!0);else if((Xa&I)===I){q=q.next,I===ul&&(Y=!0);continue}else K={lane:0,revertLane:q.revertLane,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},N===null?(S=N=K,x=h):N=N.next=K,Me.lanes|=I,ti|=I;K=q.action,Li&&i(h,K),h=q.hasEagerState?q.eagerState:i(h,K)}else I={lane:K,revertLane:q.revertLane,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},N===null?(S=N=I,x=h):N=N.next=I,Me.lanes|=K,ti|=K;q=q.next}while(q!==null&&q!==t);if(N===null?x=h:N.next=S,!pn(h,e.memoizedState)&&(Nt=!0,Y&&(i=dl,i!==null)))throw i;e.memoizedState=h,e.baseState=x,e.baseQueue=N,r.lastRenderedState=h}return u===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function _u(e){var t=xt(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var r=i.dispatch,u=i.pending,h=t.memoizedState;if(u!==null){i.pending=null;var x=u=u.next;do h=e(h,x.action),x=x.next;while(x!==u);pn(h,t.memoizedState)||(Nt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),i.lastRenderedState=h}return[h,r]}function rg(e,t,i){var r=Me,u=xt(),h=He;if(h){if(i===void 0)throw Error(s(407));i=i()}else i=t();var x=!pn((We||u).memoizedState,i);x&&(u.memoizedState=i,Nt=!0),u=u.queue;var S=cg.bind(null,r,u,e);if(Sr(2048,8,S,[e]),u.getSnapshot!==t||x||bt!==null&&bt.memoizedState.tag&1){if(r.flags|=2048,pl(9,to(),og.bind(null,r,u,i,t),null),at===null)throw Error(s(349));h||(Xa&124)!==0||sg(r,t,i)}return i}function sg(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Me.updateQueue,t===null?(t=Uu(),Me.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function og(e,t,i,r){t.value=i,t.getSnapshot=r,ug(t)&&dg(e)}function cg(e,t,i){return i(function(){ug(t)&&dg(e)})}function ug(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!pn(e,i)}catch{return!0}}function dg(e){var t=rl(e,2);t!==null&&jn(t,e,2)}function qu(e){var t=ln();if(typeof e=="function"){var i=e;if(e=i(),Li){st(!0);try{i()}finally{st(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:e},t}function fg(e,t,i,r){return e.baseState=i,Bu(e,We,typeof r=="function"?r:Na)}function hS(e,t,i,r,u){if(ao(e))throw Error(s(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};U.T!==null?i(!0):h.isTransition=!1,r(h),i=t.pending,i===null?(h.next=t.pending=h,hg(t,h)):(h.next=i.next,t.pending=i.next=h)}}function hg(e,t){var i=t.action,r=t.payload,u=e.state;if(t.isTransition){var h=U.T,x={};U.T=x;try{var S=i(u,r),N=U.S;N!==null&&N(x,S),mg(e,t,S)}catch(q){Fu(e,t,q)}finally{U.T=h}}else try{h=i(u,r),mg(e,t,h)}catch(q){Fu(e,t,q)}}function mg(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(r){pg(e,t,r)},function(r){return Fu(e,t,r)}):pg(e,t,i)}function pg(e,t,i){t.status="fulfilled",t.value=i,gg(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,hg(e,i)))}function Fu(e,t,i){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=i,gg(t),t=t.next;while(t!==r)}e.action=null}function gg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function vg(e,t){return t}function bg(e,t){if(He){var i=at.formState;if(i!==null){e:{var r=Me;if(He){if(ht){t:{for(var u=ht,h=la;u.nodeType!==8;){if(!h){u=null;break t}if(u=In(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){ht=In(u.nextSibling),r=u.data==="F!";break e}}Ni(r)}r=!1}r&&(t=i[0])}}return i=ln(),i.memoizedState=i.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vg,lastRenderedState:t},i.queue=r,i=Bg.bind(null,Me,r),r.dispatch=i,r=qu(!1),h=Vu.bind(null,Me,!1,r.queue),r=ln(),u={state:t,dispatch:null,action:e,pending:null},r.queue=u,i=hS.bind(null,Me,u,h,i),u.dispatch=i,r.memoizedState=e,[t,i,!1]}function xg(e){var t=xt();return yg(t,We,e)}function yg(e,t,i){if(t=Bu(e,t,vg)[0],e=eo(Na)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=jr(t)}catch(x){throw x===pr?Xs:x}else r=t;t=xt();var u=t.queue,h=u.dispatch;return i!==t.memoizedState&&(Me.flags|=2048,pl(9,to(),mS.bind(null,u,i),null)),[r,h,e]}function mS(e,t){e.action=t}function jg(e){var t=xt(),i=We;if(i!==null)return yg(t,i,e);xt(),t=t.memoizedState,i=xt();var r=i.queue.dispatch;return i.memoizedState=e,[t,r,!1]}function pl(e,t,i,r){return e={tag:e,create:i,deps:r,inst:t,next:null},t=Me.updateQueue,t===null&&(t=Uu(),Me.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(r=i.next,i.next=e,e.next=r,t.lastEffect=e),e}function to(){return{destroy:void 0,resource:void 0}}function Sg(){return xt().memoizedState}function no(e,t,i,r){var u=ln();r=r===void 0?null:r,Me.flags|=e,u.memoizedState=pl(1|t,to(),i,r)}function Sr(e,t,i,r){var u=xt();r=r===void 0?null:r;var h=u.memoizedState.inst;We!==null&&r!==null&&Mu(r,We.memoizedState.deps)?u.memoizedState=pl(t,h,i,r):(Me.flags|=e,u.memoizedState=pl(1|t,h,i,r))}function wg(e,t){no(8390656,8,e,t)}function Cg(e,t){Sr(2048,8,e,t)}function Eg(e,t){return Sr(4,2,e,t)}function Dg(e,t){return Sr(4,4,e,t)}function Tg(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rg(e,t,i){i=i!=null?i.concat([e]):null,Sr(4,4,Tg.bind(null,t,e),i)}function Hu(){}function Ng(e,t){var i=xt();t=t===void 0?null:t;var r=i.memoizedState;return t!==null&&Mu(t,r[1])?r[0]:(i.memoizedState=[e,t],e)}function Mg(e,t){var i=xt();t=t===void 0?null:t;var r=i.memoizedState;if(t!==null&&Mu(t,r[1]))return r[0];if(r=e(),Li){st(!0);try{e()}finally{st(!1)}}return i.memoizedState=[r,t],r}function Pu(e,t,i){return i===void 0||(Xa&1073741824)!==0?e.memoizedState=t:(e.memoizedState=i,e=Lv(),Me.lanes|=e,ti|=e,i)}function Ag(e,t,i,r){return pn(i,t)?i:fl.current!==null?(e=Pu(e,i,r),pn(e,t)||(Nt=!0),e):(Xa&42)===0?(Nt=!0,e.memoizedState=i):(e=Lv(),Me.lanes|=e,ti|=e,t)}function $g(e,t,i,r,u){var h=F.p;F.p=h!==0&&8>h?h:8;var x=U.T,S={};U.T=S,Vu(e,!1,t,i);try{var N=u(),q=U.S;if(q!==null&&q(S,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var Y=uS(N,r);wr(e,t,Y,yn(e))}else wr(e,t,r,yn(e))}catch(K){wr(e,t,{then:function(){},status:"rejected",reason:K},yn())}finally{F.p=h,U.T=x}}function pS(){}function Iu(e,t,i,r){if(e.tag!==5)throw Error(s(476));var u=Lg(e).queue;$g(e,u,t,X,i===null?pS:function(){return Og(e),i(r)})}function Lg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:X},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Og(e){var t=Lg(e).next.queue;wr(e,t,{},yn())}function ku(){return Yt(Hr)}function Ug(){return xt().memoizedState}function zg(){return xt().memoizedState}function gS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=yn();e=Ga(i);var r=Ya(t,e,i);r!==null&&(jn(r,t,i),vr(r,t,i)),t={cache:yu()},e.payload=t;return}t=t.return}}function vS(e,t,i){var r=yn();i={lane:r,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null},ao(e)?_g(t,i):(i=uu(e,t,i,r),i!==null&&(jn(i,e,r),qg(i,t,r)))}function Bg(e,t,i){var r=yn();wr(e,t,i,r)}function wr(e,t,i,r){var u={lane:r,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null};if(ao(e))_g(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var x=t.lastRenderedState,S=h(x,i);if(u.hasEagerState=!0,u.eagerState=S,pn(S,x))return Fs(e,t,u,0),at===null&&qs(),!1}catch{}finally{}if(i=uu(e,t,u,r),i!==null)return jn(i,e,r),qg(i,t,r),!0}return!1}function Vu(e,t,i,r){if(r={lane:2,revertLane:wd(),action:r,hasEagerState:!1,eagerState:null,next:null},ao(e)){if(t)throw Error(s(479))}else t=uu(e,i,r,2),t!==null&&jn(t,e,2)}function ao(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function _g(e,t){hl=Zs=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function qg(e,t,i){if((i&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,fn(e,i)}}var io={readContext:Yt,use:Js,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt},Fg={readContext:Yt,use:Js,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:wg,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,no(4194308,4,Tg.bind(null,t,e),i)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){no(4,2,e,t)},useMemo:function(e,t){var i=ln();t=t===void 0?null:t;var r=e();if(Li){st(!0);try{e()}finally{st(!1)}}return i.memoizedState=[r,t],r},useReducer:function(e,t,i){var r=ln();if(i!==void 0){var u=i(t);if(Li){st(!0);try{i(t)}finally{st(!1)}}}else u=t;return r.memoizedState=r.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},r.queue=e,e=e.dispatch=vS.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:function(e){e=qu(e);var t=e.queue,i=Bg.bind(null,Me,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Hu,useDeferredValue:function(e,t){var i=ln();return Pu(i,e,t)},useTransition:function(){var e=qu(!1);return e=$g.bind(null,Me,e.queue,!0,!1),ln().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var r=Me,u=ln();if(He){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),at===null)throw Error(s(349));(qe&124)!==0||sg(r,t,i)}u.memoizedState=i;var h={value:i,getSnapshot:t};return u.queue=h,wg(cg.bind(null,r,h,e),[e]),r.flags|=2048,pl(9,to(),og.bind(null,r,h,i,t),null),i},useId:function(){var e=ln(),t=at.identifierPrefix;if(He){var i=Da,r=Ea;i=(r&~(1<<32-Ve(r)-1)).toString(32)+i,t="«"+t+"R"+i,i=Ws++,0<i&&(t+="H"+i.toString(32)),t+="»"}else i=dS++,t="«"+t+"r"+i.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:ku,useFormState:bg,useActionState:bg,useOptimistic:function(e){var t=ln();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Vu.bind(null,Me,!0,i),i.dispatch=t,[e,t]},useMemoCache:zu,useCacheRefresh:function(){return ln().memoizedState=gS.bind(null,Me)}},Hg={readContext:Yt,use:Js,useCallback:Ng,useContext:Yt,useEffect:Cg,useImperativeHandle:Rg,useInsertionEffect:Eg,useLayoutEffect:Dg,useMemo:Mg,useReducer:eo,useRef:Sg,useState:function(){return eo(Na)},useDebugValue:Hu,useDeferredValue:function(e,t){var i=xt();return Ag(i,We.memoizedState,e,t)},useTransition:function(){var e=eo(Na)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:jr(e),t]},useSyncExternalStore:rg,useId:Ug,useHostTransitionStatus:ku,useFormState:xg,useActionState:xg,useOptimistic:function(e,t){var i=xt();return fg(i,We,e,t)},useMemoCache:zu,useCacheRefresh:zg},bS={readContext:Yt,use:Js,useCallback:Ng,useContext:Yt,useEffect:Cg,useImperativeHandle:Rg,useInsertionEffect:Eg,useLayoutEffect:Dg,useMemo:Mg,useReducer:_u,useRef:Sg,useState:function(){return _u(Na)},useDebugValue:Hu,useDeferredValue:function(e,t){var i=xt();return We===null?Pu(i,e,t):Ag(i,We.memoizedState,e,t)},useTransition:function(){var e=_u(Na)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:jr(e),t]},useSyncExternalStore:rg,useId:Ug,useHostTransitionStatus:ku,useFormState:jg,useActionState:jg,useOptimistic:function(e,t){var i=xt();return We!==null?fg(i,We,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:zu,useCacheRefresh:zg},gl=null,Cr=0;function lo(e){var t=Cr;return Cr+=1,gl===null&&(gl=[]),Wp(gl,e,t)}function Er(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ro(e,t){throw t.$$typeof===b?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Pg(e){var t=e._init;return t(e._payload)}function Ig(e){function t(z,$){if(e){var _=z.deletions;_===null?(z.deletions=[$],z.flags|=16):_.push($)}}function i(z,$){if(!e)return null;for(;$!==null;)t(z,$),$=$.sibling;return null}function r(z){for(var $=new Map;z!==null;)z.key!==null?$.set(z.key,z):$.set(z.index,z),z=z.sibling;return $}function u(z,$){return z=Ca(z,$),z.index=0,z.sibling=null,z}function h(z,$,_){return z.index=_,e?(_=z.alternate,_!==null?(_=_.index,_<$?(z.flags|=67108866,$):_):(z.flags|=67108866,$)):(z.flags|=1048576,$)}function x(z){return e&&z.alternate===null&&(z.flags|=67108866),z}function S(z,$,_,Q){return $===null||$.tag!==6?($=fu(_,z.mode,Q),$.return=z,$):($=u($,_),$.return=z,$)}function N(z,$,_,Q){var ge=_.type;return ge===D?Y(z,$,_.props.children,Q,_.key):$!==null&&($.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===B&&Pg(ge)===$.type)?($=u($,_.props),Er($,_),$.return=z,$):($=Ps(_.type,_.key,_.props,null,z.mode,Q),Er($,_),$.return=z,$)}function q(z,$,_,Q){return $===null||$.tag!==4||$.stateNode.containerInfo!==_.containerInfo||$.stateNode.implementation!==_.implementation?($=hu(_,z.mode,Q),$.return=z,$):($=u($,_.children||[]),$.return=z,$)}function Y(z,$,_,Q,ge){return $===null||$.tag!==7?($=Ei(_,z.mode,Q,ge),$.return=z,$):($=u($,_),$.return=z,$)}function K(z,$,_){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=fu(""+$,z.mode,_),$.return=z,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case y:return _=Ps($.type,$.key,$.props,null,z.mode,_),Er(_,$),_.return=z,_;case j:return $=hu($,z.mode,_),$.return=z,$;case B:var Q=$._init;return $=Q($._payload),K(z,$,_)}if(J($)||oe($))return $=Ei($,z.mode,_,null),$.return=z,$;if(typeof $.then=="function")return K(z,lo($),_);if($.$$typeof===O)return K(z,Gs(z,$),_);ro(z,$)}return null}function I(z,$,_,Q){var ge=$!==null?$.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return ge!==null?null:S(z,$,""+_,Q);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case y:return _.key===ge?N(z,$,_,Q):null;case j:return _.key===ge?q(z,$,_,Q):null;case B:return ge=_._init,_=ge(_._payload),I(z,$,_,Q)}if(J(_)||oe(_))return ge!==null?null:Y(z,$,_,Q,null);if(typeof _.then=="function")return I(z,$,lo(_),Q);if(_.$$typeof===O)return I(z,$,Gs(z,_),Q);ro(z,_)}return null}function k(z,$,_,Q,ge){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return z=z.get(_)||null,S($,z,""+Q,ge);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return z=z.get(Q.key===null?_:Q.key)||null,N($,z,Q,ge);case j:return z=z.get(Q.key===null?_:Q.key)||null,q($,z,Q,ge);case B:var Ae=Q._init;return Q=Ae(Q._payload),k(z,$,_,Q,ge)}if(J(Q)||oe(Q))return z=z.get(_)||null,Y($,z,Q,ge,null);if(typeof Q.then=="function")return k(z,$,_,lo(Q),ge);if(Q.$$typeof===O)return k(z,$,_,Gs($,Q),ge);ro($,Q)}return null}function Ce(z,$,_,Q){for(var ge=null,Ae=null,be=$,je=$=0,At=null;be!==null&&je<_.length;je++){be.index>je?(At=be,be=null):At=be.sibling;var Fe=I(z,be,_[je],Q);if(Fe===null){be===null&&(be=At);break}e&&be&&Fe.alternate===null&&t(z,be),$=h(Fe,$,je),Ae===null?ge=Fe:Ae.sibling=Fe,Ae=Fe,be=At}if(je===_.length)return i(z,be),He&&Ti(z,je),ge;if(be===null){for(;je<_.length;je++)be=K(z,_[je],Q),be!==null&&($=h(be,$,je),Ae===null?ge=be:Ae.sibling=be,Ae=be);return He&&Ti(z,je),ge}for(be=r(be);je<_.length;je++)At=k(be,z,je,_[je],Q),At!==null&&(e&&At.alternate!==null&&be.delete(At.key===null?je:At.key),$=h(At,$,je),Ae===null?ge=At:Ae.sibling=At,Ae=At);return e&&be.forEach(function(ui){return t(z,ui)}),He&&Ti(z,je),ge}function ye(z,$,_,Q){if(_==null)throw Error(s(151));for(var ge=null,Ae=null,be=$,je=$=0,At=null,Fe=_.next();be!==null&&!Fe.done;je++,Fe=_.next()){be.index>je?(At=be,be=null):At=be.sibling;var ui=I(z,be,Fe.value,Q);if(ui===null){be===null&&(be=At);break}e&&be&&ui.alternate===null&&t(z,be),$=h(ui,$,je),Ae===null?ge=ui:Ae.sibling=ui,Ae=ui,be=At}if(Fe.done)return i(z,be),He&&Ti(z,je),ge;if(be===null){for(;!Fe.done;je++,Fe=_.next())Fe=K(z,Fe.value,Q),Fe!==null&&($=h(Fe,$,je),Ae===null?ge=Fe:Ae.sibling=Fe,Ae=Fe);return He&&Ti(z,je),ge}for(be=r(be);!Fe.done;je++,Fe=_.next())Fe=k(be,z,je,Fe.value,Q),Fe!==null&&(e&&Fe.alternate!==null&&be.delete(Fe.key===null?je:Fe.key),$=h(Fe,$,je),Ae===null?ge=Fe:Ae.sibling=Fe,Ae=Fe);return e&&be.forEach(function(xw){return t(z,xw)}),He&&Ti(z,je),ge}function et(z,$,_,Q){if(typeof _=="object"&&_!==null&&_.type===D&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case y:e:{for(var ge=_.key;$!==null;){if($.key===ge){if(ge=_.type,ge===D){if($.tag===7){i(z,$.sibling),Q=u($,_.props.children),Q.return=z,z=Q;break e}}else if($.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===B&&Pg(ge)===$.type){i(z,$.sibling),Q=u($,_.props),Er(Q,_),Q.return=z,z=Q;break e}i(z,$);break}else t(z,$);$=$.sibling}_.type===D?(Q=Ei(_.props.children,z.mode,Q,_.key),Q.return=z,z=Q):(Q=Ps(_.type,_.key,_.props,null,z.mode,Q),Er(Q,_),Q.return=z,z=Q)}return x(z);case j:e:{for(ge=_.key;$!==null;){if($.key===ge)if($.tag===4&&$.stateNode.containerInfo===_.containerInfo&&$.stateNode.implementation===_.implementation){i(z,$.sibling),Q=u($,_.children||[]),Q.return=z,z=Q;break e}else{i(z,$);break}else t(z,$);$=$.sibling}Q=hu(_,z.mode,Q),Q.return=z,z=Q}return x(z);case B:return ge=_._init,_=ge(_._payload),et(z,$,_,Q)}if(J(_))return Ce(z,$,_,Q);if(oe(_)){if(ge=oe(_),typeof ge!="function")throw Error(s(150));return _=ge.call(_),ye(z,$,_,Q)}if(typeof _.then=="function")return et(z,$,lo(_),Q);if(_.$$typeof===O)return et(z,$,Gs(z,_),Q);ro(z,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,$!==null&&$.tag===6?(i(z,$.sibling),Q=u($,_),Q.return=z,z=Q):(i(z,$),Q=fu(_,z.mode,Q),Q.return=z,z=Q),x(z)):i(z,$)}return function(z,$,_,Q){try{Cr=0;var ge=et(z,$,_,Q);return gl=null,ge}catch(be){if(be===pr||be===Xs)throw be;var Ae=gn(29,be,null,z.mode);return Ae.lanes=Q,Ae.return=z,Ae}finally{}}}var vl=Ig(!0),kg=Ig(!1),On=ve(null),ra=null;function Qa(e){var t=e.alternate;ue(Ct,Ct.current&1),ue(On,e),ra===null&&(t===null||fl.current!==null||t.memoizedState!==null)&&(ra=e)}function Vg(e){if(e.tag===22){if(ue(Ct,Ct.current),ue(On,e),ra===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(ra=e)}}else Ka()}function Ka(){ue(Ct,Ct.current),ue(On,On.current)}function Ma(e){ie(On),ra===e&&(ra=null),ie(Ct)}var Ct=ve(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||Ud(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Gu(e,t,i,r){t=e.memoizedState,i=i(r,t),i=i==null?t:v({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Yu={enqueueSetState:function(e,t,i){e=e._reactInternals;var r=yn(),u=Ga(r);u.payload=t,i!=null&&(u.callback=i),t=Ya(e,u,r),t!==null&&(jn(t,e,r),vr(t,e,r))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var r=yn(),u=Ga(r);u.tag=1,u.payload=t,i!=null&&(u.callback=i),t=Ya(e,u,r),t!==null&&(jn(t,e,r),vr(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=yn(),r=Ga(i);r.tag=2,t!=null&&(r.callback=t),t=Ya(e,r,i),t!==null&&(jn(t,e,i),vr(t,e,i))}};function Gg(e,t,i,r,u,h,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,h,x):t.prototype&&t.prototype.isPureReactComponent?!sr(i,r)||!sr(u,h):!0}function Yg(e,t,i,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,r),t.state!==e&&Yu.enqueueReplaceState(t,t.state,null)}function Oi(e,t){var i=t;if("ref"in t){i={};for(var r in t)r!=="ref"&&(i[r]=t[r])}if(e=e.defaultProps){i===t&&(i=v({},i));for(var u in e)i[u]===void 0&&(i[u]=e[u])}return i}var oo=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!==null&&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)};function Xg(e){oo(e)}function Qg(e){console.error(e)}function Kg(e){oo(e)}function co(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Zg(e,t,i){try{var r=e.onCaughtError;r(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Xu(e,t,i){return i=Ga(i),i.tag=3,i.payload={element:null},i.callback=function(){co(e,t)},i}function Wg(e){return e=Ga(e),e.tag=3,e}function Jg(e,t,i,r){var u=i.type.getDerivedStateFromError;if(typeof u=="function"){var h=r.value;e.payload=function(){return u(h)},e.callback=function(){Zg(t,i,r)}}var x=i.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Zg(t,i,r),typeof u!="function"&&(ni===null?ni=new Set([this]):ni.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})})}function xS(e,t,i,r,u){if(i.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=i.alternate,t!==null&&fr(t,i,u,!0),i=On.current,i!==null){switch(i.tag){case 13:return ra===null?bd():i.alternate===null&&mt===0&&(mt=3),i.flags&=-257,i.flags|=65536,i.lanes=u,r===wu?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([r]):t.add(r),yd(e,r,u)),!1;case 22:return i.flags|=65536,r===wu?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([r]):i.add(r)),yd(e,r,u)),!1}throw Error(s(435,i.tag))}return yd(e,r,u),bd(),!1}if(He)return t=On.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,r!==gu&&(e=Error(s(422),{cause:r}),dr(Mn(e,i)))):(r!==gu&&(t=Error(s(423),{cause:r}),dr(Mn(t,i))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,r=Mn(r,i),u=Xu(e.stateNode,r,u),Du(e,u),mt!==4&&(mt=2)),!1;var h=Error(s(520),{cause:r});if(h=Mn(h,i),$r===null?$r=[h]:$r.push(h),mt!==4&&(mt=2),t===null)return!0;r=Mn(r,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=u&-u,i.lanes|=e,e=Xu(i.stateNode,r,e),Du(i,e),!1;case 1:if(t=i.type,h=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(ni===null||!ni.has(h))))return i.flags|=65536,u&=-u,i.lanes|=u,u=Wg(u),Jg(u,e,i,r),Du(i,u),!1}i=i.return}while(i!==null);return!1}var ev=Error(s(461)),Nt=!1;function Bt(e,t,i,r){t.child=e===null?kg(t,null,i,r):vl(t,e.child,i,r)}function tv(e,t,i,r,u){i=i.render;var h=t.ref;if("ref"in r){var x={};for(var S in r)S!=="ref"&&(x[S]=r[S])}else x=r;return Ai(t),r=Au(e,t,i,x,h,u),S=$u(),e!==null&&!Nt?(Lu(e,t,u),Aa(e,t,u)):(He&&S&&mu(t),t.flags|=1,Bt(e,t,r,u),t.child)}function nv(e,t,i,r,u){if(e===null){var h=i.type;return typeof h=="function"&&!du(h)&&h.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=h,av(e,t,h,r,u)):(e=Ps(i.type,null,r,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!nd(e,u)){var x=h.memoizedProps;if(i=i.compare,i=i!==null?i:sr,i(x,r)&&e.ref===t.ref)return Aa(e,t,u)}return t.flags|=1,e=Ca(h,r),e.ref=t.ref,e.return=t,t.child=e}function av(e,t,i,r,u){if(e!==null){var h=e.memoizedProps;if(sr(h,r)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=r=h,nd(e,u))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,Aa(e,t,u)}return Qu(e,t,i,r,u)}function iv(e,t,i){var r=t.pendingProps,u=r.children,h=e!==null?e.memoizedState:null;if(r.mode==="hidden"){if((t.flags&128)!==0){if(r=h!==null?h.baseLanes|i:i,e!==null){for(u=t.child=e.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;t.childLanes=h&~r}else t.childLanes=0,t.child=null;return lv(e,t,r,i)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ys(t,h!==null?h.cachePool:null),h!==null?ag(t,h):Ru(),Vg(t);else return t.lanes=t.childLanes=536870912,lv(e,t,h!==null?h.baseLanes|i:i,i)}else h!==null?(Ys(t,h.cachePool),ag(t,h),Ka(),t.memoizedState=null):(e!==null&&Ys(t,null),Ru(),Ka());return Bt(e,t,u,i),t.child}function lv(e,t,i,r){var u=Su();return u=u===null?null:{parent:wt._currentValue,pool:u},t.memoizedState={baseLanes:i,cachePool:u},e!==null&&Ys(t,null),Ru(),Vg(t),e!==null&&fr(e,t,r,!0),null}function uo(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Qu(e,t,i,r,u){return Ai(t),i=Au(e,t,i,r,void 0,u),r=$u(),e!==null&&!Nt?(Lu(e,t,u),Aa(e,t,u)):(He&&r&&mu(t),t.flags|=1,Bt(e,t,i,u),t.child)}function rv(e,t,i,r,u,h){return Ai(t),t.updateQueue=null,i=lg(t,r,i,u),ig(e),r=$u(),e!==null&&!Nt?(Lu(e,t,h),Aa(e,t,h)):(He&&r&&mu(t),t.flags|=1,Bt(e,t,i,h),t.child)}function sv(e,t,i,r,u){if(Ai(t),t.stateNode===null){var h=sl,x=i.contextType;typeof x=="object"&&x!==null&&(h=Yt(x)),h=new i(r,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Yu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=r,h.state=t.memoizedState,h.refs={},Cu(t),x=i.contextType,h.context=typeof x=="object"&&x!==null?Yt(x):sl,h.state=t.memoizedState,x=i.getDerivedStateFromProps,typeof x=="function"&&(Gu(t,i,x,r),h.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&Yu.enqueueReplaceState(h,h.state,null),xr(t,r,h,u),br(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){h=t.stateNode;var S=t.memoizedProps,N=Oi(i,S);h.props=N;var q=h.context,Y=i.contextType;x=sl,typeof Y=="object"&&Y!==null&&(x=Yt(Y));var K=i.getDerivedStateFromProps;Y=typeof K=="function"||typeof h.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,Y||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S||q!==x)&&Yg(t,h,r,x),Va=!1;var I=t.memoizedState;h.state=I,xr(t,r,h,u),br(),q=t.memoizedState,S||I!==q||Va?(typeof K=="function"&&(Gu(t,i,K,r),q=t.memoizedState),(N=Va||Gg(t,i,N,r,I,q,x))?(Y||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=q),h.props=r,h.state=q,h.context=x,r=N):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{h=t.stateNode,Eu(e,t),x=t.memoizedProps,Y=Oi(i,x),h.props=Y,K=t.pendingProps,I=h.context,q=i.contextType,N=sl,typeof q=="object"&&q!==null&&(N=Yt(q)),S=i.getDerivedStateFromProps,(q=typeof S=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==K||I!==N)&&Yg(t,h,r,N),Va=!1,I=t.memoizedState,h.state=I,xr(t,r,h,u),br();var k=t.memoizedState;x!==K||I!==k||Va||e!==null&&e.dependencies!==null&&Vs(e.dependencies)?(typeof S=="function"&&(Gu(t,i,S,r),k=t.memoizedState),(Y=Va||Gg(t,i,Y,r,I,k,N)||e!==null&&e.dependencies!==null&&Vs(e.dependencies))?(q||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(r,k,N),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(r,k,N)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=k),h.props=r,h.state=k,h.context=N,r=Y):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),r=!1)}return h=r,uo(e,t),r=(t.flags&128)!==0,h||r?(h=t.stateNode,i=r&&typeof i.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&r?(t.child=vl(t,e.child,null,u),t.child=vl(t,null,i,u)):Bt(e,t,i,u),t.memoizedState=h.state,e=t.child):e=Aa(e,t,u),e}function ov(e,t,i,r){return ur(),t.flags|=256,Bt(e,t,i,r),t.child}var Ku={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zu(e){return{baseLanes:e,cachePool:Qp()}}function Wu(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Un),e}function cv(e,t,i){var r=t.pendingProps,u=!1,h=(t.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),x&&(u=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(u?Qa(t):Ka(),He){var S=ht,N;if(N=S){e:{for(N=S,S=la;N.nodeType!==8;){if(!S){S=null;break e}if(N=In(N.nextSibling),N===null){S=null;break e}}S=N}S!==null?(t.memoizedState={dehydrated:S,treeContext:Di!==null?{id:Ea,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},N=gn(18,null,null,0),N.stateNode=S,N.return=t,t.child=N,Wt=t,ht=null,N=!0):N=!1}N||Ni(t)}if(S=t.memoizedState,S!==null&&(S=S.dehydrated,S!==null))return Ud(S)?t.lanes=32:t.lanes=536870912,null;Ma(t)}return S=r.children,r=r.fallback,u?(Ka(),u=t.mode,S=fo({mode:"hidden",children:S},u),r=Ei(r,u,i,null),S.return=t,r.return=t,S.sibling=r,t.child=S,u=t.child,u.memoizedState=Zu(i),u.childLanes=Wu(e,x,i),t.memoizedState=Ku,r):(Qa(t),Ju(t,S))}if(N=e.memoizedState,N!==null&&(S=N.dehydrated,S!==null)){if(h)t.flags&256?(Qa(t),t.flags&=-257,t=ed(e,t,i)):t.memoizedState!==null?(Ka(),t.child=e.child,t.flags|=128,t=null):(Ka(),u=r.fallback,S=t.mode,r=fo({mode:"visible",children:r.children},S),u=Ei(u,S,i,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,vl(t,e.child,null,i),r=t.child,r.memoizedState=Zu(i),r.childLanes=Wu(e,x,i),t.memoizedState=Ku,t=u);else if(Qa(t),Ud(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var q=x.dgst;x=q,r=Error(s(419)),r.stack="",r.digest=x,dr({value:r,source:null,stack:null}),t=ed(e,t,i)}else if(Nt||fr(e,t,i,!1),x=(i&e.childLanes)!==0,Nt||x){if(x=at,x!==null&&(r=i&-i,r=(r&42)!==0?1:St(r),r=(r&(x.suspendedLanes|i))!==0?0:r,r!==0&&r!==N.retryLane))throw N.retryLane=r,rl(e,r),jn(x,e,r),ev;S.data==="$?"||bd(),t=ed(e,t,i)}else S.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,ht=In(S.nextSibling),Wt=t,He=!0,Ri=null,la=!1,e!==null&&($n[Ln++]=Ea,$n[Ln++]=Da,$n[Ln++]=Di,Ea=e.id,Da=e.overflow,Di=t),t=Ju(t,r.children),t.flags|=4096);return t}return u?(Ka(),u=r.fallback,S=t.mode,N=e.child,q=N.sibling,r=Ca(N,{mode:"hidden",children:r.children}),r.subtreeFlags=N.subtreeFlags&65011712,q!==null?u=Ca(q,u):(u=Ei(u,S,i,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,r=u,u=t.child,S=e.child.memoizedState,S===null?S=Zu(i):(N=S.cachePool,N!==null?(q=wt._currentValue,N=N.parent!==q?{parent:q,pool:q}:N):N=Qp(),S={baseLanes:S.baseLanes|i,cachePool:N}),u.memoizedState=S,u.childLanes=Wu(e,x,i),t.memoizedState=Ku,r):(Qa(t),i=e.child,e=i.sibling,i=Ca(i,{mode:"visible",children:r.children}),i.return=t,i.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=i,t.memoizedState=null,i)}function Ju(e,t){return t=fo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function fo(e,t){return e=gn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function ed(e,t,i){return vl(t,e.child,null,i),e=Ju(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uv(e,t,i){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),bu(e.return,t,i)}function td(e,t,i,r,u){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:i,tailMode:u}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=r,h.tail=i,h.tailMode=u)}function dv(e,t,i){var r=t.pendingProps,u=r.revealOrder,h=r.tail;if(Bt(e,t,r.children,i),r=Ct.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uv(e,i,t);else if(e.tag===19)uv(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(ue(Ct,r),u){case"forwards":for(i=t.child,u=null;i!==null;)e=i.alternate,e!==null&&so(e)===null&&(u=i),i=i.sibling;i=u,i===null?(u=t.child,t.child=null):(u=i.sibling,i.sibling=null),td(t,!1,u,i,h);break;case"backwards":for(i=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&so(e)===null){t.child=u;break}e=u.sibling,u.sibling=i,i=u,u=e}td(t,!0,i,null,h);break;case"together":td(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Aa(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ti|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(fr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=Ca(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ca(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function nd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Vs(e)))}function yS(e,t,i){switch(t.tag){case 3:Dt(t,t.stateNode.containerInfo),ka(t,wt,e.memoizedState.cache),ur();break;case 27:case 5:Be(t);break;case 4:Dt(t,t.stateNode.containerInfo);break;case 10:ka(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Qa(t),t.flags|=128,null):(i&t.child.childLanes)!==0?cv(e,t,i):(Qa(t),e=Aa(e,t,i),e!==null?e.sibling:null);Qa(t);break;case 19:var u=(e.flags&128)!==0;if(r=(i&t.childLanes)!==0,r||(fr(e,t,i,!1),r=(i&t.childLanes)!==0),u){if(r)return dv(e,t,i);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ue(Ct,Ct.current),r)break;return null;case 22:case 23:return t.lanes=0,iv(e,t,i);case 24:ka(t,wt,e.memoizedState.cache)}return Aa(e,t,i)}function fv(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!nd(e,i)&&(t.flags&128)===0)return Nt=!1,yS(e,t,i);Nt=(e.flags&131072)!==0}else Nt=!1,He&&(t.flags&1048576)!==0&&Pp(t,ks,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,u=r._init;if(r=u(r._payload),t.type=r,typeof r=="function")du(r)?(e=Oi(r,e),t.tag=1,t=sv(null,t,r,e,i)):(t.tag=0,t=Qu(null,t,r,e,i));else{if(r!=null){if(u=r.$$typeof,u===P){t.tag=11,t=tv(null,t,r,e,i);break e}else if(u===T){t.tag=14,t=nv(null,t,r,e,i);break e}}throw t=Z(r)||r,Error(s(306,t,""))}}return t;case 0:return Qu(e,t,t.type,t.pendingProps,i);case 1:return r=t.type,u=Oi(r,t.pendingProps),sv(e,t,r,u,i);case 3:e:{if(Dt(t,t.stateNode.containerInfo),e===null)throw Error(s(387));r=t.pendingProps;var h=t.memoizedState;u=h.element,Eu(e,t),xr(t,r,null,i);var x=t.memoizedState;if(r=x.cache,ka(t,wt,r),r!==h.cache&&xu(t,[wt],i,!0),br(),r=x.element,h.isDehydrated)if(h={element:r,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=ov(e,t,r,i);break e}else if(r!==u){u=Mn(Error(s(424)),t),dr(u),t=ov(e,t,r,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ht=In(e.firstChild),Wt=t,He=!0,Ri=null,la=!0,i=kg(t,null,r,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(ur(),r===u){t=Aa(e,t,i);break e}Bt(e,t,r,i)}t=t.child}return t;case 26:return uo(e,t),e===null?(i=g0(t.type,null,t.pendingProps,null))?t.memoizedState=i:He||(i=t.type,e=t.pendingProps,r=Do(Ue.current).createElement(i),r[M]=t,r[L]=e,qt(r,i,e),Oe(r),t.stateNode=r):t.memoizedState=g0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&He&&(r=t.stateNode=h0(t.type,t.pendingProps,Ue.current),Wt=t,la=!0,u=ht,li(t.type)?(zd=u,ht=In(r.firstChild)):ht=u),Bt(e,t,t.pendingProps.children,i),uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((u=r=ht)&&(r=XS(r,t.type,t.pendingProps,la),r!==null?(t.stateNode=r,Wt=t,ht=In(r.firstChild),la=!1,u=!0):u=!1),u||Ni(t)),Be(t),u=t.type,h=t.pendingProps,x=e!==null?e.memoizedProps:null,r=h.children,$d(u,h)?r=null:x!==null&&$d(u,x)&&(t.flags|=32),t.memoizedState!==null&&(u=Au(e,t,fS,null,null,i),Hr._currentValue=u),uo(e,t),Bt(e,t,r,i),t.child;case 6:return e===null&&He&&((e=i=ht)&&(i=QS(i,t.pendingProps,la),i!==null?(t.stateNode=i,Wt=t,ht=null,e=!0):e=!1),e||Ni(t)),null;case 13:return cv(e,t,i);case 4:return Dt(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vl(t,null,r,i):Bt(e,t,r,i),t.child;case 11:return tv(e,t,t.type,t.pendingProps,i);case 7:return Bt(e,t,t.pendingProps,i),t.child;case 8:return Bt(e,t,t.pendingProps.children,i),t.child;case 12:return Bt(e,t,t.pendingProps.children,i),t.child;case 10:return r=t.pendingProps,ka(t,t.type,r.value),Bt(e,t,r.children,i),t.child;case 9:return u=t.type._context,r=t.pendingProps.children,Ai(t),u=Yt(u),r=r(u),t.flags|=1,Bt(e,t,r,i),t.child;case 14:return nv(e,t,t.type,t.pendingProps,i);case 15:return av(e,t,t.type,t.pendingProps,i);case 19:return dv(e,t,i);case 31:return r=t.pendingProps,i=t.mode,r={mode:r.mode,children:r.children},e===null?(i=fo(r,i),i.ref=t.ref,t.child=i,i.return=t,t=i):(i=Ca(e.child,r),i.ref=t.ref,t.child=i,i.return=t,t=i),t;case 22:return iv(e,t,i);case 24:return Ai(t),r=Yt(wt),e===null?(u=Su(),u===null&&(u=at,h=yu(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=i),u=h),t.memoizedState={parent:r,cache:u},Cu(t),ka(t,wt,u)):((e.lanes&i)!==0&&(Eu(e,t),xr(t,null,null,i),br()),u=e.memoizedState,h=t.memoizedState,u.parent!==r?(u={parent:r,cache:r},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ka(t,wt,r)):(r=h.cache,ka(t,wt,r),r!==u.cache&&xu(t,[wt],i,!0))),Bt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function $a(e){e.flags|=4}function hv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!j0(t)){if(t=On.current,t!==null&&((qe&4194048)===qe?ra!==null:(qe&62914560)!==qe&&(qe&536870912)===0||t!==ra))throw gr=wu,Kp;e.flags|=8192}}function ho(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?yi():536870912,e.lanes|=t,jl|=t)}function Dr(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,r=0;if(t)for(var u=e.child;u!==null;)i|=u.lanes|u.childLanes,r|=u.subtreeFlags&65011712,r|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)i|=u.lanes|u.childLanes,r|=u.subtreeFlags,r|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=r,e.childLanes=i,t}function jS(e,t,i){var r=t.pendingProps;switch(pu(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return ut(t),null;case 3:return i=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ra(wt),Tt(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(cr(t)?$a(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Vp())),ut(t),null;case 26:return i=t.memoizedState,e===null?($a(t),i!==null?(ut(t),hv(t,i)):(ut(t),t.flags&=-16777217)):i?i!==e.memoizedState?($a(t),ut(t),hv(t,i)):(ut(t),t.flags&=-16777217):(e.memoizedProps!==r&&$a(t),ut(t),t.flags&=-16777217),null;case 27:En(t),i=Ue.current;var u=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==r&&$a(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return ut(t),null}e=we.current,cr(t)?Ip(t):(e=h0(u,r,i),t.stateNode=e,$a(t))}return ut(t),null;case 5:if(En(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&$a(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return ut(t),null}if(e=we.current,cr(t))Ip(t);else{switch(u=Do(Ue.current),e){case 1:e=u.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:e=u.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":e=u.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":e=u.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":e=u.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof r.is=="string"?u.createElement("select",{is:r.is}):u.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e=typeof r.is=="string"?u.createElement(i,{is:r.is}):u.createElement(i)}}e[M]=t,e[L]=r;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)e.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=e;e:switch(qt(e,i,r),i){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&$a(t)}}return ut(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&$a(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(s(166));if(e=Ue.current,cr(t)){if(e=t.stateNode,i=t.memoizedProps,r=null,u=Wt,u!==null)switch(u.tag){case 27:case 5:r=u.memoizedProps}e[M]=t,e=!!(e.nodeValue===i||r!==null&&r.suppressHydrationWarning===!0||r0(e.nodeValue,i)),e||Ni(t)}else e=Do(e).createTextNode(r),e[M]=t,t.stateNode=e}return ut(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=cr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[M]=t}else ur(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),u=!1}else u=Vp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Ma(t),t):(Ma(t),null)}if(Ma(t),(t.flags&128)!==0)return t.lanes=i,t;if(i=r!==null,e=e!==null&&e.memoizedState!==null,i){r=t.child,u=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(u=r.alternate.memoizedState.cachePool.pool);var h=null;r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==u&&(r.flags|=2048)}return i!==e&&i&&(t.child.flags|=8192),ho(t,t.updateQueue),ut(t),null;case 4:return Tt(),e===null&&Td(t.stateNode.containerInfo),ut(t),null;case 10:return Ra(t.type),ut(t),null;case 19:if(ie(Ct),u=t.memoizedState,u===null)return ut(t),null;if(r=(t.flags&128)!==0,h=u.rendering,h===null)if(r)Dr(u,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=so(e),h!==null){for(t.flags|=128,Dr(u,!1),e=h.updateQueue,t.updateQueue=e,ho(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Hp(i,e),i=i.sibling;return ue(Ct,Ct.current&1|2),t.child}e=e.sibling}u.tail!==null&&Xt()>go&&(t.flags|=128,r=!0,Dr(u,!1),t.lanes=4194304)}else{if(!r)if(e=so(h),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,ho(t,e),Dr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!h.alternate&&!He)return ut(t),null}else 2*Xt()-u.renderingStartTime>go&&i!==536870912&&(t.flags|=128,r=!0,Dr(u,!1),t.lanes=4194304);u.isBackwards?(h.sibling=t.child,t.child=h):(e=u.last,e!==null?e.sibling=h:t.child=h,u.last=h)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Xt(),t.sibling=null,e=Ct.current,ue(Ct,r?e&1|2:e&1),t):(ut(t),null);case 22:case 23:return Ma(t),Nu(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(i&536870912)!==0&&(t.flags&128)===0&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),i=t.updateQueue,i!==null&&ho(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==i&&(t.flags|=2048),e!==null&&ie($i),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ra(wt),ut(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function SS(e,t){switch(pu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ra(wt),Tt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return En(t),null;case 13:if(Ma(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));ur()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(Ct),null;case 4:return Tt(),null;case 10:return Ra(t.type),null;case 22:case 23:return Ma(t),Nu(),e!==null&&ie($i),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ra(wt),null;case 25:return null;default:return null}}function mv(e,t){switch(pu(t),t.tag){case 3:Ra(wt),Tt();break;case 26:case 27:case 5:En(t);break;case 4:Tt();break;case 13:Ma(t);break;case 19:ie(Ct);break;case 10:Ra(t.type);break;case 22:case 23:Ma(t),Nu(),e!==null&&ie($i);break;case 24:Ra(wt)}}function Tr(e,t){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var u=r.next;i=u;do{if((i.tag&e)===e){r=void 0;var h=i.create,x=i.inst;r=h(),x.destroy=r}i=i.next}while(i!==u)}}catch(S){tt(t,t.return,S)}}function Za(e,t,i){try{var r=t.updateQueue,u=r!==null?r.lastEffect:null;if(u!==null){var h=u.next;r=h;do{if((r.tag&e)===e){var x=r.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,u=t;var N=i,q=S;try{q()}catch(Y){tt(u,N,Y)}}}r=r.next}while(r!==h)}}catch(Y){tt(t,t.return,Y)}}function pv(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{ng(t,i)}catch(r){tt(e,e.return,r)}}}function gv(e,t,i){i.props=Oi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(r){tt(e,t,r)}}function Rr(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof i=="function"?e.refCleanup=i(r):i.current=r}}catch(u){tt(e,t,u)}}function sa(e,t){var i=e.ref,r=e.refCleanup;if(i!==null)if(typeof r=="function")try{r()}catch(u){tt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(u){tt(e,t,u)}else i.current=null}function vv(e){var t=e.type,i=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&r.focus();break e;case"img":i.src?r.src=i.src:i.srcSet&&(r.srcset=i.srcSet)}}catch(u){tt(e,e.return,u)}}function ad(e,t,i){try{var r=e.stateNode;IS(r,e.type,i,t),r[L]=t}catch(u){tt(e,e.return,u)}}function bv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&li(e.type)||e.tag===4}function id(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&li(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ld(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Eo));else if(r!==4&&(r===27&&li(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(ld(e,t,i),e=e.sibling;e!==null;)ld(e,t,i),e=e.sibling}function mo(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(r!==4&&(r===27&&li(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(mo(e,t,i),e=e.sibling;e!==null;)mo(e,t,i),e=e.sibling}function xv(e){var t=e.stateNode,i=e.memoizedProps;try{for(var r=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);qt(t,r,i),t[M]=e,t[L]=i}catch(h){tt(e,e.return,h)}}var La=!1,gt=!1,rd=!1,yv=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function wS(e,t){if(e=e.containerInfo,Md=$o,e=Ap(e),iu(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var u=r.anchorOffset,h=r.focusNode;r=r.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var x=0,S=-1,N=-1,q=0,Y=0,K=e,I=null;t:for(;;){for(var k;K!==i||u!==0&&K.nodeType!==3||(S=x+u),K!==h||r!==0&&K.nodeType!==3||(N=x+r),K.nodeType===3&&(x+=K.nodeValue.length),(k=K.firstChild)!==null;)I=K,K=k;for(;;){if(K===e)break t;if(I===i&&++q===u&&(S=x),I===h&&++Y===r&&(N=x),(k=K.nextSibling)!==null)break;K=I,I=K.parentNode}K=k}i=S===-1||N===-1?null:{start:S,end:N}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ad={focusedElem:e,selectionRange:i},$o=!1,Mt=t;Mt!==null;)if(t=Mt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Mt=e;else for(;Mt!==null;){switch(t=Mt,h=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,i=t,u=h.memoizedProps,h=h.memoizedState,r=i.stateNode;try{var Ce=Oi(i.type,u,i.elementType===i.type);e=r.getSnapshotBeforeUpdate(Ce,h),r.__reactInternalSnapshotBeforeUpdate=e}catch(ye){tt(i,i.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Od(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Od(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,Mt=e;break}Mt=t.return}}function jv(e,t,i){var r=i.flags;switch(i.tag){case 0:case 11:case 15:Wa(e,i),r&4&&Tr(5,i);break;case 1:if(Wa(e,i),r&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(x){tt(i,i.return,x)}else{var u=Oi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){tt(i,i.return,x)}}r&64&&pv(i),r&512&&Rr(i,i.return);break;case 3:if(Wa(e,i),r&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{ng(e,t)}catch(x){tt(i,i.return,x)}}break;case 27:t===null&&r&4&&xv(i);case 26:case 5:Wa(e,i),t===null&&r&4&&vv(i),r&512&&Rr(i,i.return);break;case 12:Wa(e,i);break;case 13:Wa(e,i),r&4&&Cv(e,i),r&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=$S.bind(null,i),KS(e,i))));break;case 22:if(r=i.memoizedState!==null||La,!r){t=t!==null&&t.memoizedState!==null||gt,u=La;var h=gt;La=r,(gt=t)&&!h?Ja(e,i,(i.subtreeFlags&8772)!==0):Wa(e,i),La=u,gt=h}break;case 30:break;default:Wa(e,i)}}function Sv(e){var t=e.alternate;t!==null&&(e.alternate=null,Sv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&me(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ot=null,rn=!1;function Oa(e,t,i){for(i=i.child;i!==null;)wv(e,t,i),i=i.sibling}function wv(e,t,i){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(ea,i)}catch{}switch(i.tag){case 26:gt||sa(i,t),Oa(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:gt||sa(i,t);var r=ot,u=rn;li(i.type)&&(ot=i.stateNode,rn=!1),Oa(e,t,i),Br(i.stateNode),ot=r,rn=u;break;case 5:gt||sa(i,t);case 6:if(r=ot,u=rn,ot=null,Oa(e,t,i),ot=r,rn=u,ot!==null)if(rn)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(i.stateNode)}catch(h){tt(i,t,h)}else try{ot.removeChild(i.stateNode)}catch(h){tt(i,t,h)}break;case 18:ot!==null&&(rn?(e=ot,d0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Vr(e)):d0(ot,i.stateNode));break;case 4:r=ot,u=rn,ot=i.stateNode.containerInfo,rn=!0,Oa(e,t,i),ot=r,rn=u;break;case 0:case 11:case 14:case 15:gt||Za(2,i,t),gt||Za(4,i,t),Oa(e,t,i);break;case 1:gt||(sa(i,t),r=i.stateNode,typeof r.componentWillUnmount=="function"&&gv(i,t,r)),Oa(e,t,i);break;case 21:Oa(e,t,i);break;case 22:gt=(r=gt)||i.memoizedState!==null,Oa(e,t,i),gt=r;break;default:Oa(e,t,i)}}function Cv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vr(e)}catch(i){tt(t,t.return,i)}}function CS(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new yv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new yv),t;default:throw Error(s(435,e.tag))}}function sd(e,t){var i=CS(e);t.forEach(function(r){var u=LS.bind(null,e,r);i.has(r)||(i.add(r),r.then(u,u))})}function vn(e,t){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var u=i[r],h=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(li(S.type)){ot=S.stateNode,rn=!1;break e}break;case 5:ot=S.stateNode,rn=!1;break e;case 3:case 4:ot=S.stateNode.containerInfo,rn=!0;break e}S=S.return}if(ot===null)throw Error(s(160));wv(h,x,u),ot=null,rn=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Ev(t,e),t=t.sibling}var Pn=null;function Ev(e,t){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vn(t,e),bn(e),r&4&&(Za(3,e,e.return),Tr(3,e),Za(5,e,e.return));break;case 1:vn(t,e),bn(e),r&512&&(gt||i===null||sa(i,i.return)),r&64&&La&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?r:i.concat(r))));break;case 26:var u=Pn;if(vn(t,e),bn(e),r&512&&(gt||i===null||sa(i,i.return)),r&4){var h=i!==null?i.memoizedState:null;if(r=e.memoizedState,i===null)if(r===null)if(e.stateNode===null){e:{r=e.type,i=e.memoizedProps,u=u.ownerDocument||u;t:switch(r){case"title":h=u.getElementsByTagName("title")[0],(!h||h[ce]||h[M]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(r),u.head.insertBefore(h,u.querySelector("head > title"))),qt(h,r,i),h[M]=e,Oe(h),r=h;break e;case"link":var x=x0("link","href",u).get(r+(i.href||""));if(x){for(var S=0;S<x.length;S++)if(h=x[S],h.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&h.getAttribute("rel")===(i.rel==null?null:i.rel)&&h.getAttribute("title")===(i.title==null?null:i.title)&&h.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){x.splice(S,1);break t}}h=u.createElement(r),qt(h,r,i),u.head.appendChild(h);break;case"meta":if(x=x0("meta","content",u).get(r+(i.content||""))){for(S=0;S<x.length;S++)if(h=x[S],h.getAttribute("content")===(i.content==null?null:""+i.content)&&h.getAttribute("name")===(i.name==null?null:i.name)&&h.getAttribute("property")===(i.property==null?null:i.property)&&h.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&h.getAttribute("charset")===(i.charSet==null?null:i.charSet)){x.splice(S,1);break t}}h=u.createElement(r),qt(h,r,i),u.head.appendChild(h);break;default:throw Error(s(468,r))}h[M]=e,Oe(h),r=h}e.stateNode=r}else y0(u,e.type,e.stateNode);else e.stateNode=b0(u,r,e.memoizedProps);else h!==r?(h===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):h.count--,r===null?y0(u,e.type,e.stateNode):b0(u,r,e.memoizedProps)):r===null&&e.stateNode!==null&&ad(e,e.memoizedProps,i.memoizedProps)}break;case 27:vn(t,e),bn(e),r&512&&(gt||i===null||sa(i,i.return)),i!==null&&r&4&&ad(e,e.memoizedProps,i.memoizedProps);break;case 5:if(vn(t,e),bn(e),r&512&&(gt||i===null||sa(i,i.return)),e.flags&32){u=e.stateNode;try{Ji(u,"")}catch(k){tt(e,e.return,k)}}r&4&&e.stateNode!=null&&(u=e.memoizedProps,ad(e,u,i!==null?i.memoizedProps:u)),r&1024&&(rd=!0);break;case 6:if(vn(t,e),bn(e),r&4){if(e.stateNode===null)throw Error(s(162));r=e.memoizedProps,i=e.stateNode;try{i.nodeValue=r}catch(k){tt(e,e.return,k)}}break;case 3:if(No=null,u=Pn,Pn=To(t.containerInfo),vn(t,e),Pn=u,bn(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{Vr(t.containerInfo)}catch(k){tt(e,e.return,k)}rd&&(rd=!1,Dv(e));break;case 4:r=Pn,Pn=To(e.stateNode.containerInfo),vn(t,e),bn(e),Pn=r;break;case 12:vn(t,e),bn(e);break;case 13:vn(t,e),bn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(hd=Xt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,sd(e,r)));break;case 22:u=e.memoizedState!==null;var N=i!==null&&i.memoizedState!==null,q=La,Y=gt;if(La=q||u,gt=Y||N,vn(t,e),gt=Y,La=q,bn(e),r&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(i===null||N||La||gt||Ui(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){N=i=t;try{if(h=N.stateNode,u)x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=N.stateNode;var K=N.memoizedProps.style,I=K!=null&&K.hasOwnProperty("display")?K.display:null;S.style.display=I==null||typeof I=="boolean"?"":(""+I).trim()}}catch(k){tt(N,N.return,k)}}}else if(t.tag===6){if(i===null){N=t;try{N.stateNode.nodeValue=u?"":N.memoizedProps}catch(k){tt(N,N.return,k)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(i=r.retryQueue,i!==null&&(r.retryQueue=null,sd(e,i))));break;case 19:vn(t,e),bn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,sd(e,r)));break;case 30:break;case 21:break;default:vn(t,e),bn(e)}}function bn(e){var t=e.flags;if(t&2){try{for(var i,r=e.return;r!==null;){if(bv(r)){i=r;break}r=r.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var u=i.stateNode,h=id(e);mo(e,h,u);break;case 5:var x=i.stateNode;i.flags&32&&(Ji(x,""),i.flags&=-33);var S=id(e);mo(e,S,x);break;case 3:case 4:var N=i.stateNode.containerInfo,q=id(e);ld(e,q,N);break;default:throw Error(s(161))}}catch(Y){tt(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Dv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)jv(e,t.alternate,t),t=t.sibling}function Ui(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Za(4,t,t.return),Ui(t);break;case 1:sa(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&gv(t,t.return,i),Ui(t);break;case 27:Br(t.stateNode);case 26:case 5:sa(t,t.return),Ui(t);break;case 22:t.memoizedState===null&&Ui(t);break;case 30:Ui(t);break;default:Ui(t)}e=e.sibling}}function Ja(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,u=e,h=t,x=h.flags;switch(h.tag){case 0:case 11:case 15:Ja(u,h,i),Tr(4,h);break;case 1:if(Ja(u,h,i),r=h,u=r.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(q){tt(r,r.return,q)}if(r=h,u=r.updateQueue,u!==null){var S=r.stateNode;try{var N=u.shared.hiddenCallbacks;if(N!==null)for(u.shared.hiddenCallbacks=null,u=0;u<N.length;u++)tg(N[u],S)}catch(q){tt(r,r.return,q)}}i&&x&64&&pv(h),Rr(h,h.return);break;case 27:xv(h);case 26:case 5:Ja(u,h,i),i&&r===null&&x&4&&vv(h),Rr(h,h.return);break;case 12:Ja(u,h,i);break;case 13:Ja(u,h,i),i&&x&4&&Cv(u,h);break;case 22:h.memoizedState===null&&Ja(u,h,i),Rr(h,h.return);break;case 30:break;default:Ja(u,h,i)}t=t.sibling}}function od(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&hr(i))}function cd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hr(e))}function oa(e,t,i,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tv(e,t,i,r),t=t.sibling}function Tv(e,t,i,r){var u=t.flags;switch(t.tag){case 0:case 11:case 15:oa(e,t,i,r),u&2048&&Tr(9,t);break;case 1:oa(e,t,i,r);break;case 3:oa(e,t,i,r),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hr(e)));break;case 12:if(u&2048){oa(e,t,i,r),e=t.stateNode;try{var h=t.memoizedProps,x=h.id,S=h.onPostCommit;typeof S=="function"&&S(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){tt(t,t.return,N)}}else oa(e,t,i,r);break;case 13:oa(e,t,i,r);break;case 23:break;case 22:h=t.stateNode,x=t.alternate,t.memoizedState!==null?h._visibility&2?oa(e,t,i,r):Nr(e,t):h._visibility&2?oa(e,t,i,r):(h._visibility|=2,bl(e,t,i,r,(t.subtreeFlags&10256)!==0)),u&2048&&od(x,t);break;case 24:oa(e,t,i,r),u&2048&&cd(t.alternate,t);break;default:oa(e,t,i,r)}}function bl(e,t,i,r,u){for(u=u&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var h=e,x=t,S=i,N=r,q=x.flags;switch(x.tag){case 0:case 11:case 15:bl(h,x,S,N,u),Tr(8,x);break;case 23:break;case 22:var Y=x.stateNode;x.memoizedState!==null?Y._visibility&2?bl(h,x,S,N,u):Nr(h,x):(Y._visibility|=2,bl(h,x,S,N,u)),u&&q&2048&&od(x.alternate,x);break;case 24:bl(h,x,S,N,u),u&&q&2048&&cd(x.alternate,x);break;default:bl(h,x,S,N,u)}t=t.sibling}}function Nr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,r=t,u=r.flags;switch(r.tag){case 22:Nr(i,r),u&2048&&od(r.alternate,r);break;case 24:Nr(i,r),u&2048&&cd(r.alternate,r);break;default:Nr(i,r)}t=t.sibling}}var Mr=8192;function xl(e){if(e.subtreeFlags&Mr)for(e=e.child;e!==null;)Rv(e),e=e.sibling}function Rv(e){switch(e.tag){case 26:xl(e),e.flags&Mr&&e.memoizedState!==null&&cw(Pn,e.memoizedState,e.memoizedProps);break;case 5:xl(e);break;case 3:case 4:var t=Pn;Pn=To(e.stateNode.containerInfo),xl(e),Pn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Mr,Mr=16777216,xl(e),Mr=t):xl(e));break;default:xl(e)}}function Nv(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ar(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];Mt=r,Av(r,e)}Nv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Mv(e),e=e.sibling}function Mv(e){switch(e.tag){case 0:case 11:case 15:Ar(e),e.flags&2048&&Za(9,e,e.return);break;case 3:Ar(e);break;case 12:Ar(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,po(e)):Ar(e);break;default:Ar(e)}}function po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];Mt=r,Av(r,e)}Nv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Za(8,t,t.return),po(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,po(t));break;default:po(t)}e=e.sibling}}function Av(e,t){for(;Mt!==null;){var i=Mt;switch(i.tag){case 0:case 11:case 15:Za(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var r=i.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:hr(i.memoizedState.cache)}if(r=i.child,r!==null)r.return=i,Mt=r;else e:for(i=e;Mt!==null;){r=Mt;var u=r.sibling,h=r.return;if(Sv(r),r===i){Mt=null;break e}if(u!==null){u.return=h,Mt=u;break e}Mt=h}}}var ES={getCacheForType:function(e){var t=Yt(wt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i}},DS=typeof WeakMap=="function"?WeakMap:Map,Xe=0,at=null,$e=null,qe=0,Qe=0,xn=null,ei=!1,yl=!1,ud=!1,Ua=0,mt=0,ti=0,zi=0,dd=0,Un=0,jl=0,$r=null,sn=null,fd=!1,hd=0,go=1/0,vo=null,ni=null,_t=0,ai=null,Sl=null,wl=0,md=0,pd=null,$v=null,Lr=0,gd=null;function yn(){if((Xe&2)!==0&&qe!==0)return qe&-qe;if(U.T!==null){var e=ul;return e!==0?e:wd()}return Rt()}function Lv(){Un===0&&(Un=(qe&536870912)===0||He?xa():536870912);var e=On.current;return e!==null&&(e.flags|=32),Un}function jn(e,t,i){(e===at&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(Cl(e,0),ii(e,qe,Un,!1)),nt(e,i),((Xe&2)===0||e!==at)&&(e===at&&((Xe&2)===0&&(zi|=i),mt===4&&ii(e,qe,Un,!1)),ca(e))}function Ov(e,t,i){if((Xe&6)!==0)throw Error(s(327));var r=!i&&(t&124)===0&&(t&e.expiredLanes)===0||ba(e,t),u=r?NS(e,t):xd(e,t,!0),h=r;do{if(u===0){yl&&!r&&ii(e,t,0,!1);break}else{if(i=e.current.alternate,h&&!TS(i)){u=xd(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var S=e;u=$r;var N=S.current.memoizedState.isDehydrated;if(N&&(Cl(S,x).flags|=256),x=xd(S,x,!1),x!==2){if(ud&&!N){S.errorRecoveryDisabledLanes|=h,zi|=h,u=4;break e}h=sn,sn=u,h!==null&&(sn===null?sn=h:sn.push.apply(sn,h))}u=x}if(h=!1,u!==2)continue}}if(u===1){Cl(e,0),ii(e,t,0,!0);break}e:{switch(r=e,h=u,h){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:ii(r,t,Un,!ei);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(u=hd+300-Xt(),10<u)){if(ii(r,t,Un,!ei),ta(r,0,!0)!==0)break e;r.timeoutHandle=c0(Uv.bind(null,r,i,sn,vo,fd,t,Un,zi,jl,ei,h,2,-0,0),u);break e}Uv(r,i,sn,vo,fd,t,Un,zi,jl,ei,h,0,-0,0)}}break}while(!0);ca(e)}function Uv(e,t,i,r,u,h,x,S,N,q,Y,K,I,k){if(e.timeoutHandle=-1,K=t.subtreeFlags,(K&8192||(K&16785408)===16785408)&&(Fr={stylesheets:null,count:0,unsuspend:ow},Rv(t),K=uw(),K!==null)){e.cancelPendingCommit=K(Pv.bind(null,e,t,h,i,r,u,x,S,N,Y,1,I,k)),ii(e,h,x,!q);return}Pv(e,t,h,i,r,u,x,S,N)}function TS(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var r=0;r<i.length;r++){var u=i[r],h=u.getSnapshot;u=u.value;try{if(!pn(h(),u))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ii(e,t,i,r){t&=~dd,t&=~zi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var u=t;0<u;){var h=31-Ve(u),x=1<<h;r[h]=-1,u&=~x}i!==0&&jt(e,i,t)}function bo(){return(Xe&6)===0?(Or(0),!1):!0}function vd(){if($e!==null){if(Qe===0)var e=$e.return;else e=$e,Ta=Mi=null,Ou(e),gl=null,Cr=0,e=$e;for(;e!==null;)mv(e.alternate,e),e=e.return;$e=null}}function Cl(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,VS(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),vd(),at=e,$e=i=Ca(e.current,null),qe=t,Qe=0,xn=null,ei=!1,yl=ba(e,t),ud=!1,jl=Un=dd=zi=ti=mt=0,sn=$r=null,fd=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var u=31-Ve(r),h=1<<u;t|=e[u],r&=~h}return Ua=t,qs(),i}function zv(e,t){Me=null,U.H=io,t===pr||t===Xs?(t=Jp(),Qe=3):t===Kp?(t=Jp(),Qe=4):Qe=t===ev?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,xn=t,$e===null&&(mt=1,co(e,Mn(t,e.current)))}function Bv(){var e=U.H;return U.H=io,e===null?io:e}function _v(){var e=U.A;return U.A=ES,e}function bd(){mt=4,ei||(qe&4194048)!==qe&&On.current!==null||(yl=!0),(ti&134217727)===0&&(zi&134217727)===0||at===null||ii(at,qe,Un,!1)}function xd(e,t,i){var r=Xe;Xe|=2;var u=Bv(),h=_v();(at!==e||qe!==t)&&(vo=null,Cl(e,t)),t=!1;var x=mt;e:do try{if(Qe!==0&&$e!==null){var S=$e,N=xn;switch(Qe){case 8:vd(),x=6;break e;case 3:case 2:case 9:case 6:On.current===null&&(t=!0);var q=Qe;if(Qe=0,xn=null,El(e,S,N,q),i&&yl){x=0;break e}break;default:q=Qe,Qe=0,xn=null,El(e,S,N,q)}}RS(),x=mt;break}catch(Y){zv(e,Y)}while(!0);return t&&e.shellSuspendCounter++,Ta=Mi=null,Xe=r,U.H=u,U.A=h,$e===null&&(at=null,qe=0,qs()),x}function RS(){for(;$e!==null;)qv($e)}function NS(e,t){var i=Xe;Xe|=2;var r=Bv(),u=_v();at!==e||qe!==t?(vo=null,go=Xt()+500,Cl(e,t)):yl=ba(e,t);e:do try{if(Qe!==0&&$e!==null){t=$e;var h=xn;t:switch(Qe){case 1:Qe=0,xn=null,El(e,t,h,1);break;case 2:case 9:if(Zp(h)){Qe=0,xn=null,Fv(t);break}t=function(){Qe!==2&&Qe!==9||at!==e||(Qe=7),ca(e)},h.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:Zp(h)?(Qe=0,xn=null,Fv(t)):(Qe=0,xn=null,El(e,t,h,7));break;case 5:var x=null;switch($e.tag){case 26:x=$e.memoizedState;case 5:case 27:var S=$e;if(!x||j0(x)){Qe=0,xn=null;var N=S.sibling;if(N!==null)$e=N;else{var q=S.return;q!==null?($e=q,xo(q)):$e=null}break t}}Qe=0,xn=null,El(e,t,h,5);break;case 6:Qe=0,xn=null,El(e,t,h,6);break;case 8:vd(),mt=6;break e;default:throw Error(s(462))}}MS();break}catch(Y){zv(e,Y)}while(!0);return Ta=Mi=null,U.H=r,U.A=u,Xe=i,$e!==null?0:(at=null,qe=0,qs(),mt)}function MS(){for(;$e!==null&&!Jn();)qv($e)}function qv(e){var t=fv(e.alternate,e,Ua);e.memoizedProps=e.pendingProps,t===null?xo(e):$e=t}function Fv(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=rv(i,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=rv(i,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:Ou(t);default:mv(i,t),t=$e=Hp(t,Ua),t=fv(i,t,Ua)}e.memoizedProps=e.pendingProps,t===null?xo(e):$e=t}function El(e,t,i,r){Ta=Mi=null,Ou(t),gl=null,Cr=0;var u=t.return;try{if(xS(e,u,t,i,qe)){mt=1,co(e,Mn(i,e.current)),$e=null;return}}catch(h){if(u!==null)throw $e=u,h;mt=1,co(e,Mn(i,e.current)),$e=null;return}t.flags&32768?(He||r===1?e=!0:yl||(qe&536870912)!==0?e=!1:(ei=e=!0,(r===2||r===9||r===3||r===6)&&(r=On.current,r!==null&&r.tag===13&&(r.flags|=16384))),Hv(t,e)):xo(t)}function xo(e){var t=e;do{if((t.flags&32768)!==0){Hv(t,ei);return}e=t.return;var i=jS(t.alternate,t,Ua);if(i!==null){$e=i;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);mt===0&&(mt=5)}function Hv(e,t){do{var i=SS(e.alternate,e);if(i!==null){i.flags&=32767,$e=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=i}while(e!==null);mt=6,$e=null}function Pv(e,t,i,r,u,h,x,S,N){e.cancelPendingCommit=null;do yo();while(_t!==0);if((Xe&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(h=t.lanes|t.childLanes,h|=cu,zt(e,i,h,x,S,N),e===at&&($e=at=null,qe=0),Sl=t,ai=e,wl=i,md=h,pd=u,$v=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,OS(Fn,function(){return Yv(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=U.T,U.T=null,u=F.p,F.p=2,x=Xe,Xe|=4;try{wS(e,t,i)}finally{Xe=x,F.p=u,U.T=r}}_t=1,Iv(),kv(),Vv()}}function Iv(){if(_t===1){_t=0;var e=ai,t=Sl,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null;var r=F.p;F.p=2;var u=Xe;Xe|=4;try{Ev(t,e);var h=Ad,x=Ap(e.containerInfo),S=h.focusedElem,N=h.selectionRange;if(x!==S&&S&&S.ownerDocument&&Mp(S.ownerDocument.documentElement,S)){if(N!==null&&iu(S)){var q=N.start,Y=N.end;if(Y===void 0&&(Y=q),"selectionStart"in S)S.selectionStart=q,S.selectionEnd=Math.min(Y,S.value.length);else{var K=S.ownerDocument||document,I=K&&K.defaultView||window;if(I.getSelection){var k=I.getSelection(),Ce=S.textContent.length,ye=Math.min(N.start,Ce),et=N.end===void 0?ye:Math.min(N.end,Ce);!k.extend&&ye>et&&(x=et,et=ye,ye=x);var z=Np(S,ye),$=Np(S,et);if(z&&$&&(k.rangeCount!==1||k.anchorNode!==z.node||k.anchorOffset!==z.offset||k.focusNode!==$.node||k.focusOffset!==$.offset)){var _=K.createRange();_.setStart(z.node,z.offset),k.removeAllRanges(),ye>et?(k.addRange(_),k.extend($.node,$.offset)):(_.setEnd($.node,$.offset),k.addRange(_))}}}}for(K=[],k=S;k=k.parentNode;)k.nodeType===1&&K.push({element:k,left:k.scrollLeft,top:k.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<K.length;S++){var Q=K[S];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}$o=!!Md,Ad=Md=null}finally{Xe=u,F.p=r,U.T=i}}e.current=t,_t=2}}function kv(){if(_t===2){_t=0;var e=ai,t=Sl,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=U.T,U.T=null;var r=F.p;F.p=2;var u=Xe;Xe|=4;try{jv(e,t.alternate,t)}finally{Xe=u,F.p=r,U.T=i}}_t=3}}function Vv(){if(_t===4||_t===3){_t=0,Gt();var e=ai,t=Sl,i=wl,r=$v;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?_t=5:(_t=0,Sl=ai=null,Gv(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ni=null),dt(i),t=t.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(ea,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=U.T,u=F.p,F.p=2,U.T=null;try{for(var h=e.onRecoverableError,x=0;x<r.length;x++){var S=r[x];h(S.value,{componentStack:S.stack})}}finally{U.T=t,F.p=u}}(wl&3)!==0&&yo(),ca(e),u=e.pendingLanes,(i&4194090)!==0&&(u&42)!==0?e===gd?Lr++:(Lr=0,gd=e):Lr=0,Or(0)}}function Gv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,hr(t)))}function yo(e){return Iv(),kv(),Vv(),Yv()}function Yv(){if(_t!==5)return!1;var e=ai,t=md;md=0;var i=dt(wl),r=U.T,u=F.p;try{F.p=32>i?32:i,U.T=null,i=pd,pd=null;var h=ai,x=wl;if(_t=0,Sl=ai=null,wl=0,(Xe&6)!==0)throw Error(s(331));var S=Xe;if(Xe|=4,Mv(h.current),Tv(h,h.current,x,i),Xe=S,Or(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(ea,h)}catch{}return!0}finally{F.p=u,U.T=r,Gv(e,t)}}function Xv(e,t,i){t=Mn(i,t),t=Xu(e.stateNode,t,2),e=Ya(e,t,2),e!==null&&(nt(e,2),ca(e))}function tt(e,t,i){if(e.tag===3)Xv(e,e,i);else for(;t!==null;){if(t.tag===3){Xv(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ni===null||!ni.has(r))){e=Mn(i,e),i=Wg(2),r=Ya(t,i,2),r!==null&&(Jg(i,r,t,e),nt(r,2),ca(r));break}}t=t.return}}function yd(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new DS;var u=new Set;r.set(t,u)}else u=r.get(t),u===void 0&&(u=new Set,r.set(t,u));u.has(i)||(ud=!0,u.add(i),e=AS.bind(null,e,t,i),t.then(e,e))}function AS(e,t,i){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,at===e&&(qe&i)===i&&(mt===4||mt===3&&(qe&62914560)===qe&&300>Xt()-hd?(Xe&2)===0&&Cl(e,0):dd|=i,jl===qe&&(jl=0)),ca(e)}function Qv(e,t){t===0&&(t=yi()),e=rl(e,t),e!==null&&(nt(e,t),ca(e))}function $S(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Qv(e,i)}function LS(e,t){var i=0;switch(e.tag){case 13:var r=e.stateNode,u=e.memoizedState;u!==null&&(i=u.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(s(314))}r!==null&&r.delete(t),Qv(e,i)}function OS(e,t){return Ut(e,t)}var jo=null,Dl=null,jd=!1,So=!1,Sd=!1,Bi=0;function ca(e){e!==Dl&&e.next===null&&(Dl===null?jo=Dl=e:Dl=Dl.next=e),So=!0,jd||(jd=!0,zS())}function Or(e,t){if(!Sd&&So){Sd=!0;do for(var i=!1,r=jo;r!==null;){if(e!==0){var u=r.pendingLanes;if(u===0)var h=0;else{var x=r.suspendedLanes,S=r.pingedLanes;h=(1<<31-Ve(42|e)+1)-1,h&=u&~(x&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,Jv(r,h))}else h=qe,h=ta(r,r===at?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(h&3)===0||ba(r,h)||(i=!0,Jv(r,h));r=r.next}while(i);Sd=!1}}function US(){Kv()}function Kv(){So=jd=!1;var e=0;Bi!==0&&(kS()&&(e=Bi),Bi=0);for(var t=Xt(),i=null,r=jo;r!==null;){var u=r.next,h=Zv(r,t);h===0?(r.next=null,i===null?jo=u:i.next=u,u===null&&(Dl=i)):(i=r,(e!==0||(h&3)!==0)&&(So=!0)),r=u}Or(e)}function Zv(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-Ve(h),S=1<<x,N=u[x];N===-1?((S&i)===0||(S&r)!==0)&&(u[x]=xi(S,t)):N<=t&&(e.expiredLanes|=S),h&=~S}if(t=at,i=qe,i=ta(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,i===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Vt(r),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ba(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(r!==null&&Vt(r),dt(i)){case 2:case 8:i=dn;break;case 32:i=Fn;break;case 268435456:i=vi;break;default:i=Fn}return r=Wv.bind(null,e),i=Ut(i,r),e.callbackPriority=t,e.callbackNode=i,t}return r!==null&&r!==null&&Vt(r),e.callbackPriority=2,e.callbackNode=null,2}function Wv(e,t){if(_t!==0&&_t!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(yo()&&e.callbackNode!==i)return null;var r=qe;return r=ta(e,e===at?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ov(e,r,t),Zv(e,Xt()),e.callbackNode!=null&&e.callbackNode===i?Wv.bind(null,e):null)}function Jv(e,t){if(yo())return null;Ov(e,t,!0)}function zS(){GS(function(){(Xe&6)!==0?Ut(pa,US):Kv()})}function wd(){return Bi===0&&(Bi=xa()),Bi}function e0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:$s(""+e)}function t0(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function BS(e,t,i,r,u){if(t==="submit"&&i&&i.stateNode===u){var h=e0((u[L]||null).action),x=r.submitter;x&&(t=(t=x[L]||null)?e0(t.formAction):x.getAttribute("formAction"),t!==null&&(h=t,x=null));var S=new zs("action","action",null,r,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Bi!==0){var N=x?t0(u,x):new FormData(u);Iu(i,{pending:!0,data:N,method:u.method,action:h},null,N)}}else typeof h=="function"&&(S.preventDefault(),N=x?t0(u,x):new FormData(u),Iu(i,{pending:!0,data:N,method:u.method,action:h},h,N))},currentTarget:u}]})}}for(var Cd=0;Cd<ou.length;Cd++){var Ed=ou[Cd],_S=Ed.toLowerCase(),qS=Ed[0].toUpperCase()+Ed.slice(1);Hn(_S,"on"+qS)}Hn(Op,"onAnimationEnd"),Hn(Up,"onAnimationIteration"),Hn(zp,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(nS,"onTransitionRun"),Hn(aS,"onTransitionStart"),Hn(iS,"onTransitionCancel"),Hn(Bp,"onTransitionEnd"),hn("onMouseEnter",["mouseout","mouseover"]),hn("onMouseLeave",["mouseout","mouseover"]),hn("onPointerEnter",["pointerout","pointerover"]),hn("onPointerLeave",["pointerout","pointerover"]),ke("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ke("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ke("onBeforeInput",["compositionend","keypress","textInput","paste"]),ke("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ke("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ke("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ur="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),FS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ur));function n0(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var r=e[i],u=r.event;r=r.listeners;e:{var h=void 0;if(t)for(var x=r.length-1;0<=x;x--){var S=r[x],N=S.instance,q=S.currentTarget;if(S=S.listener,N!==h&&u.isPropagationStopped())break e;h=S,u.currentTarget=q;try{h(u)}catch(Y){oo(Y)}u.currentTarget=null,h=N}else for(x=0;x<r.length;x++){if(S=r[x],N=S.instance,q=S.currentTarget,S=S.listener,N!==h&&u.isPropagationStopped())break e;h=S,u.currentTarget=q;try{h(u)}catch(Y){oo(Y)}u.currentTarget=null,h=N}}}}function Le(e,t){var i=t[ee];i===void 0&&(i=t[ee]=new Set);var r=e+"__bubble";i.has(r)||(a0(t,e,2,!1),i.add(r))}function Dd(e,t,i){var r=0;t&&(r|=4),a0(i,e,r,t)}var wo="_reactListening"+Math.random().toString(36).slice(2);function Td(e){if(!e[wo]){e[wo]=!0,Ge.forEach(function(i){i!=="selectionchange"&&(FS.has(i)||Dd(i,!1,e),Dd(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wo]||(t[wo]=!0,Dd("selectionchange",!1,t))}}function a0(e,t,i,r){switch(T0(t)){case 2:var u=hw;break;case 8:u=mw;break;default:u=Hd}i=u.bind(null,t,i,e),u=void 0,!Qc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),r?u!==void 0?e.addEventListener(t,i,{capture:!0,passive:u}):e.addEventListener(t,i,!0):u!==void 0?e.addEventListener(t,i,{passive:u}):e.addEventListener(t,i,!1)}function Rd(e,t,i,r,u){var h=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var x=r.tag;if(x===3||x===4){var S=r.stateNode.containerInfo;if(S===u)break;if(x===4)for(x=r.return;x!==null;){var N=x.tag;if((N===3||N===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;S!==null;){if(x=de(S),x===null)return;if(N=x.tag,N===5||N===6||N===26||N===27){r=h=x;continue e}S=S.parentNode}}r=r.return}up(function(){var q=h,Y=Yc(i),K=[];e:{var I=_p.get(e);if(I!==void 0){var k=zs,Ce=e;switch(e){case"keypress":if(Os(i)===0)break e;case"keydown":case"keyup":k=O2;break;case"focusin":Ce="focus",k=Jc;break;case"focusout":Ce="blur",k=Jc;break;case"beforeblur":case"afterblur":k=Jc;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":k=hp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":k=S2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":k=B2;break;case Op:case Up:case zp:k=E2;break;case Bp:k=q2;break;case"scroll":case"scrollend":k=y2;break;case"wheel":k=H2;break;case"copy":case"cut":case"paste":k=T2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":k=pp;break;case"toggle":case"beforetoggle":k=I2}var ye=(t&4)!==0,et=!ye&&(e==="scroll"||e==="scrollend"),z=ye?I!==null?I+"Capture":null:I;ye=[];for(var $=q,_;$!==null;){var Q=$;if(_=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||_===null||z===null||(Q=er($,z),Q!=null&&ye.push(zr($,Q,_))),et)break;$=$.return}0<ye.length&&(I=new k(I,Ce,null,i,Y),K.push({event:I,listeners:ye}))}}if((t&7)===0){e:{if(I=e==="mouseover"||e==="pointerover",k=e==="mouseout"||e==="pointerout",I&&i!==Gc&&(Ce=i.relatedTarget||i.fromElement)&&(de(Ce)||Ce[H]))break e;if((k||I)&&(I=Y.window===Y?Y:(I=Y.ownerDocument)?I.defaultView||I.parentWindow:window,k?(Ce=i.relatedTarget||i.toElement,k=q,Ce=Ce?de(Ce):null,Ce!==null&&(et=d(Ce),ye=Ce.tag,Ce!==et||ye!==5&&ye!==27&&ye!==6)&&(Ce=null)):(k=null,Ce=q),k!==Ce)){if(ye=hp,Q="onMouseLeave",z="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(ye=pp,Q="onPointerLeave",z="onPointerEnter",$="pointer"),et=k==null?I:Ee(k),_=Ce==null?I:Ee(Ce),I=new ye(Q,$+"leave",k,i,Y),I.target=et,I.relatedTarget=_,Q=null,de(Y)===q&&(ye=new ye(z,$+"enter",Ce,i,Y),ye.target=_,ye.relatedTarget=et,Q=ye),et=Q,k&&Ce)t:{for(ye=k,z=Ce,$=0,_=ye;_;_=Tl(_))$++;for(_=0,Q=z;Q;Q=Tl(Q))_++;for(;0<$-_;)ye=Tl(ye),$--;for(;0<_-$;)z=Tl(z),_--;for(;$--;){if(ye===z||z!==null&&ye===z.alternate)break t;ye=Tl(ye),z=Tl(z)}ye=null}else ye=null;k!==null&&i0(K,I,k,ye,!1),Ce!==null&&et!==null&&i0(K,et,Ce,ye,!0)}}e:{if(I=q?Ee(q):window,k=I.nodeName&&I.nodeName.toLowerCase(),k==="select"||k==="input"&&I.type==="file")var ge=wp;else if(jp(I))if(Cp)ge=J2;else{ge=Z2;var Ae=K2}else k=I.nodeName,!k||k.toLowerCase()!=="input"||I.type!=="checkbox"&&I.type!=="radio"?q&&Vc(q.elementType)&&(ge=wp):ge=W2;if(ge&&(ge=ge(e,q))){Sp(K,ge,i,Y);break e}Ae&&Ae(e,I,q),e==="focusout"&&q&&I.type==="number"&&q.memoizedProps.value!=null&&kc(I,"number",I.value)}switch(Ae=q?Ee(q):window,e){case"focusin":(jp(Ae)||Ae.contentEditable==="true")&&(al=Ae,lu=q,or=null);break;case"focusout":or=lu=al=null;break;case"mousedown":ru=!0;break;case"contextmenu":case"mouseup":case"dragend":ru=!1,$p(K,i,Y);break;case"selectionchange":if(tS)break;case"keydown":case"keyup":$p(K,i,Y)}var be;if(tu)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else nl?xp(e,i)&&(je="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(je="onCompositionStart");je&&(gp&&i.locale!=="ko"&&(nl||je!=="onCompositionStart"?je==="onCompositionEnd"&&nl&&(be=dp()):(Ia=Y,Kc="value"in Ia?Ia.value:Ia.textContent,nl=!0)),Ae=Co(q,je),0<Ae.length&&(je=new mp(je,e,null,i,Y),K.push({event:je,listeners:Ae}),be?je.data=be:(be=yp(i),be!==null&&(je.data=be)))),(be=V2?G2(e,i):Y2(e,i))&&(je=Co(q,"onBeforeInput"),0<je.length&&(Ae=new mp("onBeforeInput","beforeinput",null,i,Y),K.push({event:Ae,listeners:je}),Ae.data=be)),BS(K,e,q,i,Y)}n0(K,t)})}function zr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Co(e,t){for(var i=t+"Capture",r=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=er(e,i),u!=null&&r.unshift(zr(e,u,h)),u=er(e,t),u!=null&&r.push(zr(e,u,h))),e.tag===3)return r;e=e.return}return[]}function Tl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function i0(e,t,i,r,u){for(var h=t._reactName,x=[];i!==null&&i!==r;){var S=i,N=S.alternate,q=S.stateNode;if(S=S.tag,N!==null&&N===r)break;S!==5&&S!==26&&S!==27||q===null||(N=q,u?(q=er(i,h),q!=null&&x.unshift(zr(i,q,N))):u||(q=er(i,h),q!=null&&x.push(zr(i,q,N)))),i=i.return}x.length!==0&&e.push({event:t,listeners:x})}var HS=/\r\n?/g,PS=/\u0000|\uFFFD/g;function l0(e){return(typeof e=="string"?e:""+e).replace(HS,`
|
|
25
|
-
`).replace(PS,"")}function r0(e,t){return t=l0(t),l0(e)===t}function Eo(){}function Je(e,t,i,r,u,h){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ji(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ji(e,""+r);break;case"className":Rn(e,"class",r);break;case"tabIndex":Rn(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Rn(e,i,r);break;case"style":op(e,r,h);break;case"data":if(t!=="object"){Rn(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=$s(""+r),e.setAttribute(i,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(i==="formAction"?(t!=="input"&&Je(e,t,"name",u.name,u,null),Je(e,t,"formEncType",u.formEncType,u,null),Je(e,t,"formMethod",u.formMethod,u,null),Je(e,t,"formTarget",u.formTarget,u,null)):(Je(e,t,"encType",u.encType,u,null),Je(e,t,"method",u.method,u,null),Je(e,t,"target",u.target,u,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=$s(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=Eo);break;case"onScroll":r!=null&&Le("scroll",e);break;case"onScrollEnd":r!=null&&Le("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(s(61));if(i=r.__html,i!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=i}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}i=$s(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""+r):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":r===!0?e.setAttribute(i,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,r):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(i,r):e.removeAttribute(i);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(i):e.setAttribute(i,r);break;case"popover":Le("beforetoggle",e),Le("toggle",e),aa(e,"popover",r);break;case"xlinkActuate":nn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":nn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":nn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":nn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":nn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":nn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":nn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":nn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":nn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":aa(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=b2.get(i)||i,aa(e,i,r))}}function Nd(e,t,i,r,u,h){switch(i){case"style":op(e,r,h);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(s(61));if(i=r.__html,i!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=i}}break;case"children":typeof r=="string"?Ji(e,r):(typeof r=="number"||typeof r=="bigint")&&Ji(e,""+r);break;case"onScroll":r!=null&&Le("scroll",e);break;case"onScrollEnd":r!=null&&Le("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Eo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_e.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(u=i.endsWith("Capture"),t=i.slice(2,u?i.length-7:void 0),h=e[L]||null,h=h!=null?h[i]:null,typeof h=="function"&&e.removeEventListener(t,h,u),typeof r=="function")){typeof h!="function"&&h!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,r,u);break e}i in e?e[i]=r:r===!0?e.setAttribute(i,""):aa(e,i,r)}}}function qt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var r=!1,u=!1,h;for(h in i)if(i.hasOwnProperty(h)){var x=i[h];if(x!=null)switch(h){case"src":r=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Je(e,t,h,x,i,null)}}u&&Je(e,t,"srcSet",i.srcSet,i,null),r&&Je(e,t,"src",i.src,i,null);return;case"input":Le("invalid",e);var S=h=x=u=null,N=null,q=null;for(r in i)if(i.hasOwnProperty(r)){var Y=i[r];if(Y!=null)switch(r){case"name":u=Y;break;case"type":x=Y;break;case"checked":N=Y;break;case"defaultChecked":q=Y;break;case"value":h=Y;break;case"defaultValue":S=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,t));break;default:Je(e,t,r,Y,i,null)}}ip(e,h,S,N,q,x,u,!1),Ms(e);return;case"select":Le("invalid",e),r=x=h=null;for(u in i)if(i.hasOwnProperty(u)&&(S=i[u],S!=null))switch(u){case"value":h=S;break;case"defaultValue":x=S;break;case"multiple":r=S;default:Je(e,t,u,S,i,null)}t=h,i=x,e.multiple=!!r,t!=null?Wi(e,!!r,t,!1):i!=null&&Wi(e,!!r,i,!0);return;case"textarea":Le("invalid",e),h=u=r=null;for(x in i)if(i.hasOwnProperty(x)&&(S=i[x],S!=null))switch(x){case"value":r=S;break;case"defaultValue":u=S;break;case"children":h=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:Je(e,t,x,S,i,null)}rp(e,r,u,h),Ms(e);return;case"option":for(N in i)if(i.hasOwnProperty(N)&&(r=i[N],r!=null))switch(N){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Je(e,t,N,r,i,null)}return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(r=0;r<Ur.length;r++)Le(Ur[r],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in i)if(i.hasOwnProperty(q)&&(r=i[q],r!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Je(e,t,q,r,i,null)}return;default:if(Vc(t)){for(Y in i)i.hasOwnProperty(Y)&&(r=i[Y],r!==void 0&&Nd(e,t,Y,r,i,void 0));return}}for(S in i)i.hasOwnProperty(S)&&(r=i[S],r!=null&&Je(e,t,S,r,i,null))}function IS(e,t,i,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,x=null,S=null,N=null,q=null,Y=null;for(k in i){var K=i[k];if(i.hasOwnProperty(k)&&K!=null)switch(k){case"checked":break;case"value":break;case"defaultValue":N=K;default:r.hasOwnProperty(k)||Je(e,t,k,null,r,K)}}for(var I in r){var k=r[I];if(K=i[I],r.hasOwnProperty(I)&&(k!=null||K!=null))switch(I){case"type":h=k;break;case"name":u=k;break;case"checked":q=k;break;case"defaultChecked":Y=k;break;case"value":x=k;break;case"defaultValue":S=k;break;case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(s(137,t));break;default:k!==K&&Je(e,t,I,k,r,K)}}Ic(e,x,S,N,q,Y,h,u);return;case"select":k=x=S=I=null;for(h in i)if(N=i[h],i.hasOwnProperty(h)&&N!=null)switch(h){case"value":break;case"multiple":k=N;default:r.hasOwnProperty(h)||Je(e,t,h,null,r,N)}for(u in r)if(h=r[u],N=i[u],r.hasOwnProperty(u)&&(h!=null||N!=null))switch(u){case"value":I=h;break;case"defaultValue":S=h;break;case"multiple":x=h;default:h!==N&&Je(e,t,u,h,r,N)}t=S,i=x,r=k,I!=null?Wi(e,!!i,I,!1):!!r!=!!i&&(t!=null?Wi(e,!!i,t,!0):Wi(e,!!i,i?[]:"",!1));return;case"textarea":k=I=null;for(S in i)if(u=i[S],i.hasOwnProperty(S)&&u!=null&&!r.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Je(e,t,S,null,r,u)}for(x in r)if(u=r[x],h=i[x],r.hasOwnProperty(x)&&(u!=null||h!=null))switch(x){case"value":I=u;break;case"defaultValue":k=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==h&&Je(e,t,x,u,r,h)}lp(e,I,k);return;case"option":for(var Ce in i)if(I=i[Ce],i.hasOwnProperty(Ce)&&I!=null&&!r.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:Je(e,t,Ce,null,r,I)}for(N in r)if(I=r[N],k=i[N],r.hasOwnProperty(N)&&I!==k&&(I!=null||k!=null))switch(N){case"selected":e.selected=I&&typeof I!="function"&&typeof I!="symbol";break;default:Je(e,t,N,I,r,k)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in i)I=i[ye],i.hasOwnProperty(ye)&&I!=null&&!r.hasOwnProperty(ye)&&Je(e,t,ye,null,r,I);for(q in r)if(I=r[q],k=i[q],r.hasOwnProperty(q)&&I!==k&&(I!=null||k!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(s(137,t));break;default:Je(e,t,q,I,r,k)}return;default:if(Vc(t)){for(var et in i)I=i[et],i.hasOwnProperty(et)&&I!==void 0&&!r.hasOwnProperty(et)&&Nd(e,t,et,void 0,r,I);for(Y in r)I=r[Y],k=i[Y],!r.hasOwnProperty(Y)||I===k||I===void 0&&k===void 0||Nd(e,t,Y,I,r,k);return}}for(var z in i)I=i[z],i.hasOwnProperty(z)&&I!=null&&!r.hasOwnProperty(z)&&Je(e,t,z,null,r,I);for(K in r)I=r[K],k=i[K],!r.hasOwnProperty(K)||I===k||I==null&&k==null||Je(e,t,K,I,r,k)}var Md=null,Ad=null;function Do(e){return e.nodeType===9?e:e.ownerDocument}function s0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function o0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function $d(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ld=null;function kS(){var e=window.event;return e&&e.type==="popstate"?e===Ld?!1:(Ld=e,!0):(Ld=null,!1)}var c0=typeof setTimeout=="function"?setTimeout:void 0,VS=typeof clearTimeout=="function"?clearTimeout:void 0,u0=typeof Promise=="function"?Promise:void 0,GS=typeof queueMicrotask=="function"?queueMicrotask:typeof u0<"u"?function(e){return u0.resolve(null).then(e).catch(YS)}:c0;function YS(e){setTimeout(function(){throw e})}function li(e){return e==="head"}function d0(e,t){var i=t,r=0,u=0;do{var h=i.nextSibling;if(e.removeChild(i),h&&h.nodeType===8)if(i=h.data,i==="/$"){if(0<r&&8>r){i=r;var x=e.ownerDocument;if(i&1&&Br(x.documentElement),i&2&&Br(x.body),i&4)for(i=x.head,Br(i),x=i.firstChild;x;){var S=x.nextSibling,N=x.nodeName;x[ce]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&x.rel.toLowerCase()==="stylesheet"||i.removeChild(x),x=S}}if(u===0){e.removeChild(h),Vr(t);return}u--}else i==="$"||i==="$?"||i==="$!"?u++:r=i.charCodeAt(0)-48;else r=0;i=h}while(i);Vr(t)}function Od(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Od(i),me(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function XS(e,t,i,r){for(;e.nodeType===1;){var u=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[ce])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=In(e.nextSibling),e===null)break}return null}function QS(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=In(e.nextSibling),e===null))return null;return e}function Ud(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function KS(e,t){var i=e.ownerDocument;if(e.data!=="$?"||i.readyState==="complete")t();else{var r=function(){t(),i.removeEventListener("DOMContentLoaded",r)};i.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function In(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var zd=null;function f0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}function h0(e,t,i){switch(t=Do(i),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Br(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);me(e)}var zn=new Map,m0=new Set;function To(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var za=F.d;F.d={f:ZS,r:WS,D:JS,C:ew,L:tw,m:nw,X:iw,S:aw,M:lw};function ZS(){var e=za.f(),t=bo();return e||t}function WS(e){var t=pe(e);t!==null&&t.tag===5&&t.type==="form"?Og(t):za.r(e)}var Rl=typeof document>"u"?null:document;function p0(e,t,i){var r=Rl;if(r&&typeof t=="string"&&t){var u=Nn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof i=="string"&&(u+='[crossorigin="'+i+'"]'),m0.has(u)||(m0.add(u),e={rel:e,crossOrigin:i,href:t},r.querySelector(u)===null&&(t=r.createElement("link"),qt(t,"link",e),Oe(t),r.head.appendChild(t)))}}function JS(e){za.D(e),p0("dns-prefetch",e,null)}function ew(e,t){za.C(e,t),p0("preconnect",e,t)}function tw(e,t,i){za.L(e,t,i);var r=Rl;if(r&&e&&t){var u='link[rel="preload"][as="'+Nn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(u+='[imagesrcset="'+Nn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(u+='[imagesizes="'+Nn(i.imageSizes)+'"]')):u+='[href="'+Nn(e)+'"]';var h=u;switch(t){case"style":h=Nl(e);break;case"script":h=Ml(e)}zn.has(h)||(e=v({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),zn.set(h,e),r.querySelector(u)!==null||t==="style"&&r.querySelector(_r(h))||t==="script"&&r.querySelector(qr(h))||(t=r.createElement("link"),qt(t,"link",e),Oe(t),r.head.appendChild(t)))}}function nw(e,t){za.m(e,t);var i=Rl;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Nn(r)+'"][href="'+Nn(e)+'"]',h=u;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ml(e)}if(!zn.has(h)&&(e=v({rel:"modulepreload",href:e},t),zn.set(h,e),i.querySelector(u)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(qr(h)))return}r=i.createElement("link"),qt(r,"link",e),Oe(r),i.head.appendChild(r)}}}function aw(e,t,i){za.S(e,t,i);var r=Rl;if(r&&e){var u=Ne(r).hoistableStyles,h=Nl(e);t=t||"default";var x=u.get(h);if(!x){var S={loading:0,preload:null};if(x=r.querySelector(_r(h)))S.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},i),(i=zn.get(h))&&Bd(e,i);var N=x=r.createElement("link");Oe(N),qt(N,"link",e),N._p=new Promise(function(q,Y){N.onload=q,N.onerror=Y}),N.addEventListener("load",function(){S.loading|=1}),N.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ro(x,t,r)}x={type:"stylesheet",instance:x,count:1,state:S},u.set(h,x)}}}function iw(e,t){za.X(e,t);var i=Rl;if(i&&e){var r=Ne(i).hoistableScripts,u=Ml(e),h=r.get(u);h||(h=i.querySelector(qr(u)),h||(e=v({src:e,async:!0},t),(t=zn.get(u))&&_d(e,t),h=i.createElement("script"),Oe(h),qt(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(u,h))}}function lw(e,t){za.M(e,t);var i=Rl;if(i&&e){var r=Ne(i).hoistableScripts,u=Ml(e),h=r.get(u);h||(h=i.querySelector(qr(u)),h||(e=v({src:e,async:!0,type:"module"},t),(t=zn.get(u))&&_d(e,t),h=i.createElement("script"),Oe(h),qt(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(u,h))}}function g0(e,t,i,r){var u=(u=Ue.current)?To(u):null;if(!u)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Nl(i.href),i=Ne(u).hoistableStyles,r=i.get(t),r||(r={type:"style",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Nl(i.href);var h=Ne(u).hoistableStyles,x=h.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,x),(h=u.querySelector(_r(e)))&&!h._p&&(x.instance=h,x.state.loading=5),zn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},zn.set(e,i),h||rw(u,e,i,x.state))),t&&r===null)throw Error(s(528,""));return x}if(t&&r!==null)throw Error(s(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ml(i),i=Ne(u).hoistableScripts,r=i.get(t),r||(r={type:"script",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Nl(e){return'href="'+Nn(e)+'"'}function _r(e){return'link[rel="stylesheet"]['+e+"]"}function v0(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function rw(e,t,i,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),qt(t,"link",i),Oe(t),e.head.appendChild(t))}function Ml(e){return'[src="'+Nn(e)+'"]'}function qr(e){return"script[async]"+e}function b0(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Nn(i.href)+'"]');if(r)return t.instance=r,Oe(r),r;var u=v({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Oe(r),qt(r,"style",u),Ro(r,i.precedence,e),t.instance=r;case"stylesheet":u=Nl(i.href);var h=e.querySelector(_r(u));if(h)return t.state.loading|=4,t.instance=h,Oe(h),h;r=v0(i),(u=zn.get(u))&&Bd(r,u),h=(e.ownerDocument||e).createElement("link"),Oe(h);var x=h;return x._p=new Promise(function(S,N){x.onload=S,x.onerror=N}),qt(h,"link",r),t.state.loading|=4,Ro(h,i.precedence,e),t.instance=h;case"script":return h=Ml(i.src),(u=e.querySelector(qr(h)))?(t.instance=u,Oe(u),u):(r=i,(u=zn.get(h))&&(r=v({},i),_d(r,u)),e=e.ownerDocument||e,u=e.createElement("script"),Oe(u),qt(u,"link",r),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ro(r,i.precedence,e));return t.instance}function Ro(e,t,i){for(var r=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=r.length?r[r.length-1]:null,h=u,x=0;x<r.length;x++){var S=r[x];if(S.dataset.precedence===t)h=S;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Bd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _d(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var No=null;function x0(e,t,i){if(No===null){var r=new Map,u=No=new Map;u.set(i,r)}else u=No,r=u.get(i),r||(r=new Map,u.set(i,r));if(r.has(e))return r;for(r.set(e,null),i=i.getElementsByTagName(e),u=0;u<i.length;u++){var h=i[u];if(!(h[ce]||h[M]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(t)||"";x=e+x;var S=r.get(x);S?S.push(h):r.set(x,[h])}}return r}function y0(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function sw(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function j0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Fr=null;function ow(){}function cw(e,t,i){if(Fr===null)throw Error(s(475));var r=Fr;if(t.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var u=Nl(i.href),h=e.querySelector(_r(u));if(h){e=h._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(r.count++,r=Mo.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=h,Oe(h);return}h=e.ownerDocument||e,i=v0(i),(u=zn.get(u))&&Bd(i,u),h=h.createElement("link"),Oe(h);var x=h;x._p=new Promise(function(S,N){x.onload=S,x.onerror=N}),qt(h,"link",i),t.instance=h}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(r.count++,t=Mo.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}function uw(){if(Fr===null)throw Error(s(475));var e=Fr;return e.stylesheets&&e.count===0&&qd(e,e.stylesheets),0<e.count?function(t){var i=setTimeout(function(){if(e.stylesheets&&qd(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(i)}}:null}function Mo(){if(this.count--,this.count===0){if(this.stylesheets)qd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ao=null;function qd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ao=new Map,t.forEach(dw,e),Ao=null,Mo.call(e))}function dw(e,t){if(!(t.state.loading&4)){var i=Ao.get(e);if(i)var r=i.get(null);else{i=new Map,Ao.set(e,i);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var x=u[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(i.set(x.dataset.precedence,x),r=x)}r&&i.set(null,r)}u=t.instance,x=u.getAttribute("data-precedence"),h=i.get(x)||r,h===r&&i.set(null,u),i.set(x,u),this.count++,r=Mo.bind(this),u.addEventListener("load",r),u.addEventListener("error",r),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Hr={$$typeof:O,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function fw(e,t,i,r,u,h,x,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ya(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ya(0),this.hiddenUpdates=ya(null),this.identifierPrefix=r,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function S0(e,t,i,r,u,h,x,S,N,q,Y,K){return e=new fw(e,t,i,x,S,N,q,K),t=1,h===!0&&(t|=24),h=gn(3,null,null,t),e.current=h,h.stateNode=e,t=yu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:r,isDehydrated:i,cache:t},Cu(h),e}function w0(e){return e?(e=sl,e):sl}function C0(e,t,i,r,u,h){u=w0(u),r.context===null?r.context=u:r.pendingContext=u,r=Ga(t),r.payload={element:i},h=h===void 0?null:h,h!==null&&(r.callback=h),i=Ya(e,r,t),i!==null&&(jn(i,e,t),vr(i,e,t))}function E0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Fd(e,t){E0(e,t),(e=e.alternate)&&E0(e,t)}function D0(e){if(e.tag===13){var t=rl(e,67108864);t!==null&&jn(t,e,67108864),Fd(e,67108864)}}var $o=!0;function hw(e,t,i,r){var u=U.T;U.T=null;var h=F.p;try{F.p=2,Hd(e,t,i,r)}finally{F.p=h,U.T=u}}function mw(e,t,i,r){var u=U.T;U.T=null;var h=F.p;try{F.p=8,Hd(e,t,i,r)}finally{F.p=h,U.T=u}}function Hd(e,t,i,r){if($o){var u=Pd(r);if(u===null)Rd(e,t,r,Lo,i),R0(e,r);else if(gw(u,e,t,i,r))r.stopPropagation();else if(R0(e,r),t&4&&-1<pw.indexOf(e)){for(;u!==null;){var h=pe(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=tn(h.pendingLanes);if(x!==0){var S=h;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var N=1<<31-Ve(x);S.entanglements[1]|=N,x&=~N}ca(h),(Xe&6)===0&&(go=Xt()+500,Or(0))}}break;case 13:S=rl(h,2),S!==null&&jn(S,h,2),bo(),Fd(h,2)}if(h=Pd(r),h===null&&Rd(e,t,r,Lo,i),h===u)break;u=h}u!==null&&r.stopPropagation()}else Rd(e,t,r,null,i)}}function Pd(e){return e=Yc(e),Id(e)}var Lo=null;function Id(e){if(Lo=null,e=de(e),e!==null){var t=d(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Lo=e,null}function T0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ki()){case pa:return 2;case dn:return 8;case Fn:case Ha:return 32;case vi:return 268435456;default:return 32}default:return 32}}var kd=!1,ri=null,si=null,oi=null,Pr=new Map,Ir=new Map,ci=[],pw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function R0(e,t){switch(e){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":si=null;break;case"mouseover":case"mouseout":oi=null;break;case"pointerover":case"pointerout":Pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ir.delete(t.pointerId)}}function kr(e,t,i,r,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:i,eventSystemFlags:r,nativeEvent:h,targetContainers:[u]},t!==null&&(t=pe(t),t!==null&&D0(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function gw(e,t,i,r,u){switch(t){case"focusin":return ri=kr(ri,e,t,i,r,u),!0;case"dragenter":return si=kr(si,e,t,i,r,u),!0;case"mouseover":return oi=kr(oi,e,t,i,r,u),!0;case"pointerover":var h=u.pointerId;return Pr.set(h,kr(Pr.get(h)||null,e,t,i,r,u)),!0;case"gotpointercapture":return h=u.pointerId,Ir.set(h,kr(Ir.get(h)||null,e,t,i,r,u)),!0}return!1}function N0(e){var t=de(e.target);if(t!==null){var i=d(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,na(e.priority,function(){if(i.tag===13){var r=yn();r=St(r);var u=rl(i,r);u!==null&&jn(u,i,r),Fd(i,r)}});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Pd(e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);Gc=r,i.target.dispatchEvent(r),Gc=null}else return t=pe(i),t!==null&&D0(t),e.blockedOn=i,!1;t.shift()}return!0}function M0(e,t,i){Oo(e)&&i.delete(t)}function vw(){kd=!1,ri!==null&&Oo(ri)&&(ri=null),si!==null&&Oo(si)&&(si=null),oi!==null&&Oo(oi)&&(oi=null),Pr.forEach(M0),Ir.forEach(M0)}function Uo(e,t){e.blockedOn===t&&(e.blockedOn=null,kd||(kd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,vw)))}var zo=null;function A0(e){zo!==e&&(zo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){zo===e&&(zo=null);for(var t=0;t<e.length;t+=3){var i=e[t],r=e[t+1],u=e[t+2];if(typeof r!="function"){if(Id(r||i)===null)continue;break}var h=pe(i);h!==null&&(e.splice(t,3),t-=3,Iu(h,{pending:!0,data:u,method:i.method,action:r},r,u))}}))}function Vr(e){function t(N){return Uo(N,e)}ri!==null&&Uo(ri,e),si!==null&&Uo(si,e),oi!==null&&Uo(oi,e),Pr.forEach(t),Ir.forEach(t);for(var i=0;i<ci.length;i++){var r=ci[i];r.blockedOn===e&&(r.blockedOn=null)}for(;0<ci.length&&(i=ci[0],i.blockedOn===null);)N0(i),i.blockedOn===null&&ci.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(r=0;r<i.length;r+=3){var u=i[r],h=i[r+1],x=u[L]||null;if(typeof h=="function")x||A0(i);else if(x){var S=null;if(h&&h.hasAttribute("formAction")){if(u=h,x=h[L]||null)S=x.formAction;else if(Id(u)!==null)continue}else S=x.action;typeof S=="function"?i[r+1]=S:(i.splice(r,3),r-=3),A0(i)}}}function Vd(e){this._internalRoot=e}Bo.prototype.render=Vd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var i=t.current,r=yn();C0(i,r,e,t,null,null)},Bo.prototype.unmount=Vd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;C0(e.current,2,null,e,null,null),bo(),t[H]=null}};function Bo(e){this._internalRoot=e}Bo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rt();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ci.length&&t!==0&&t<ci[i].priority;i++);ci.splice(i,0,e),i===0&&N0(e)}};var $0=n.version;if($0!=="19.1.0")throw Error(s(527,$0,"19.1.0"));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=m(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var bw={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_o.isDisabled&&_o.supportsFiber)try{ea=_o.inject(bw),rt=_o}catch{}}return Gr.createRoot=function(e,t){if(!c(e))throw Error(s(299));var i=!1,r="",u=Xg,h=Qg,x=Kg,S=null;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(S=t.unstable_transitionCallbacks)),t=S0(e,1,!1,null,null,i,r,u,h,x,S,null),e[H]=t.current,Td(e),new Vd(t)},Gr.hydrateRoot=function(e,t,i){if(!c(e))throw Error(s(299));var r=!1,u="",h=Xg,x=Qg,S=Kg,N=null,q=null;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(N=i.unstable_transitionCallbacks),i.formState!==void 0&&(q=i.formState)),t=S0(e,1,!0,t,i??null,r,u,h,x,S,N,q),t.context=w0(null),i=t.current,r=yn(),r=St(r),u=Ga(r),u.callback=null,Ya(i,u,r),i=r,t.current.lanes=i,nt(t,i),ca(t),e[H]=t.current,Td(e),new Bo(t)},Gr.version="19.1.0",Gr}var B0;function Xw(){if(B0)return Yd.exports;B0=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(n){console.error(n)}}return a(),Yd.exports=Yw(),Yd.exports}var Qw=Xw();/**
|
|
26
|
-
* @remix-run/router v1.23.0
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) Remix Software Inc.
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the MIT license found in the
|
|
31
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
32
|
-
*
|
|
33
|
-
* @license MIT
|
|
34
|
-
*/function ct(){return ct=Object.assign?Object.assign.bind():function(a){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(a[s]=l[s])}return a},ct.apply(this,arguments)}var vt;(function(a){a.Pop="POP",a.Push="PUSH",a.Replace="REPLACE"})(vt||(vt={}));const _0="popstate";function Kw(a){a===void 0&&(a={});function n(s,c){let{pathname:d,search:f,hash:p}=s.location;return ss("",{pathname:d,search:f,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(s,c){return typeof c=="string"?c:Ii(c)}return Ww(n,l,null,a)}function De(a,n){if(a===!1||a===null||typeof a>"u")throw new Error(n)}function Hl(a,n){if(!a){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Zw(){return Math.random().toString(36).substr(2,8)}function q0(a,n){return{usr:a.state,key:a.key,idx:n}}function ss(a,n,l,s){return l===void 0&&(l=null),ct({pathname:typeof a=="string"?a:a.pathname,search:"",hash:""},typeof n=="string"?qa(n):n,{state:l,key:n&&n.key||s||Zw()})}function Ii(a){let{pathname:n="/",search:l="",hash:s=""}=a;return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function qa(a){let n={};if(a){let l=a.indexOf("#");l>=0&&(n.hash=a.substr(l),a=a.substr(0,l));let s=a.indexOf("?");s>=0&&(n.search=a.substr(s),a=a.substr(0,s)),a&&(n.pathname=a)}return n}function Ww(a,n,l,s){s===void 0&&(s={});let{window:c=document.defaultView,v5Compat:d=!1}=s,f=c.history,p=vt.Pop,m=null,g=v();g==null&&(g=0,f.replaceState(ct({},f.state,{idx:g}),""));function v(){return(f.state||{idx:null}).idx}function b(){p=vt.Pop;let R=v(),E=R==null?null:R-g;g=R,m&&m({action:p,location:w.location,delta:E})}function y(R,E){p=vt.Push;let A=ss(w.location,R,E);g=v()+1;let O=q0(A,g),P=w.createHref(A);try{f.pushState(O,"",P)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;c.location.assign(P)}d&&m&&m({action:p,location:w.location,delta:1})}function j(R,E){p=vt.Replace;let A=ss(w.location,R,E);g=v();let O=q0(A,g),P=w.createHref(A);f.replaceState(O,"",P),d&&m&&m({action:p,location:w.location,delta:0})}function D(R){let E=c.location.origin!=="null"?c.location.origin:c.location.href,A=typeof R=="string"?R:Ii(R);return A=A.replace(/ $/,"%20"),De(E,"No window.location.(origin|href) available to create URL for href: "+A),new URL(A,E)}let w={get action(){return p},get location(){return a(c,f)},listen(R){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(_0,b),m=R,()=>{c.removeEventListener(_0,b),m=null}},createHref(R){return n(c,R)},createURL:D,encodeLocation(R){let E=D(R);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:j,go(R){return f.go(R)}};return w}var Ke;(function(a){a.data="data",a.deferred="deferred",a.redirect="redirect",a.error="error"})(Ke||(Ke={}));const Jw=new Set(["lazy","caseSensitive","path","id","index","children"]);function e4(a){return a.index===!0}function pc(a,n,l,s){return l===void 0&&(l=[]),s===void 0&&(s={}),a.map((c,d)=>{let f=[...l,String(d)],p=typeof c.id=="string"?c.id:f.join("-");if(De(c.index!==!0||!c.children,"Cannot specify children on an index route"),De(!s[p],'Found a route id collision on id "'+p+`". Route id's must be globally unique within Data Router usages`),e4(c)){let m=ct({},c,n(c),{id:p});return s[p]=m,m}else{let m=ct({},c,n(c),{id:p,children:void 0});return s[p]=m,c.children&&(m.children=pc(c.children,n,f,s)),m}})}function Fi(a,n,l){return l===void 0&&(l="/"),fc(a,n,l,!1)}function fc(a,n,l,s){let c=typeof n=="string"?qa(n):n,d=Yn(c.pathname||"/",l);if(d==null)return null;let f=Cy(a);t4(f);let p=null;for(let m=0;p==null&&m<f.length;++m){let g=Dy(d);p=u4(f[m],g,s)}return p}function wy(a,n){let{route:l,pathname:s,params:c}=a;return{id:l.id,pathname:s,params:c,data:n[l.id],handle:l.handle}}function Cy(a,n,l,s){n===void 0&&(n=[]),l===void 0&&(l=[]),s===void 0&&(s="");let c=(d,f,p)=>{let m={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};m.relativePath.startsWith("/")&&(De(m.relativePath.startsWith(s),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(s.length));let g=_a([s,m.relativePath]),v=l.concat(m);d.children&&d.children.length>0&&(De(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Cy(d.children,n,v,g)),!(d.path==null&&!d.index)&&n.push({path:g,score:o4(g,d.index),routesMeta:v})};return a.forEach((d,f)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))c(d,f);else for(let m of Ey(d.path))c(d,f,m)}),n}function Ey(a){let n=a.split("/");if(n.length===0)return[];let[l,...s]=n,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(s.length===0)return c?[d,""]:[d];let f=Ey(s.join("/")),p=[];return p.push(...f.map(m=>m===""?d:[d,m].join("/"))),c&&p.push(...f),p.map(m=>a.startsWith("/")&&m===""?"/":m)}function t4(a){a.sort((n,l)=>n.score!==l.score?l.score-n.score:c4(n.routesMeta.map(s=>s.childrenIndex),l.routesMeta.map(s=>s.childrenIndex)))}const n4=/^:[\w-]+$/,a4=3,i4=2,l4=1,r4=10,s4=-2,F0=a=>a==="*";function o4(a,n){let l=a.split("/"),s=l.length;return l.some(F0)&&(s+=s4),n&&(s+=i4),l.filter(c=>!F0(c)).reduce((c,d)=>c+(n4.test(d)?a4:d===""?l4:r4),s)}function c4(a,n){return a.length===n.length&&a.slice(0,-1).every((s,c)=>s===n[c])?a[a.length-1]-n[n.length-1]:0}function u4(a,n,l){l===void 0&&(l=!1);let{routesMeta:s}=a,c={},d="/",f=[];for(let p=0;p<s.length;++p){let m=s[p],g=p===s.length-1,v=d==="/"?n:n.slice(d.length)||"/",b=os({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),y=m.route;if(!b&&g&&l&&!s[s.length-1].route.index&&(b=os({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:_a([d,b.pathname]),pathnameBase:m4(_a([d,b.pathnameBase])),route:y}),b.pathnameBase!=="/"&&(d=_a([d,b.pathnameBase]))}return f}function os(a,n){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[l,s]=d4(a.path,a.caseSensitive,a.end),c=n.match(l);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:s.reduce((g,v,b)=>{let{paramName:y,isOptional:j}=v;if(y==="*"){let w=p[b]||"";f=d.slice(0,d.length-w.length).replace(/(.)\/+$/,"$1")}const D=p[b];return j&&!D?g[y]=void 0:g[y]=(D||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:f,pattern:a}}function d4(a,n,l){n===void 0&&(n=!1),l===void 0&&(l=!0),Hl(a==="*"||!a.endsWith("*")||a.endsWith("/*"),'Route path "'+a+'" will be treated as if it were '+('"'+a.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+a.replace(/\*$/,"/*")+'".'));let s=[],c="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,m)=>(s.push({paramName:p,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return a.endsWith("*")?(s.push({paramName:"*"}),c+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":a!==""&&a!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,n?void 0:"i"),s]}function Dy(a){try{return a.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Hl(!1,'The URL path "'+a+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+n+").")),a}}function Yn(a,n){if(n==="/")return a;if(!a.toLowerCase().startsWith(n.toLowerCase()))return null;let l=n.endsWith("/")?n.length-1:n.length,s=a.charAt(l);return s&&s!=="/"?null:a.slice(l)||"/"}function f4(a,n){n===void 0&&(n="/");let{pathname:l,search:s="",hash:c=""}=typeof a=="string"?qa(a):a;return{pathname:l?l.startsWith("/")?l:h4(l,n):n,search:p4(s),hash:g4(c)}}function h4(a,n){let l=n.replace(/\/+$/,"").split("/");return a.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function Kd(a,n,l,s){return"Cannot include a '"+a+"' character in a manually specified "+("`to."+n+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ty(a){return a.filter((n,l)=>l===0||n.route.path&&n.route.path.length>0)}function Nc(a,n){let l=Ty(a);return n?l.map((s,c)=>c===l.length-1?s.pathname:s.pathnameBase):l.map(s=>s.pathnameBase)}function Mc(a,n,l,s){s===void 0&&(s=!1);let c;typeof a=="string"?c=qa(a):(c=ct({},a),De(!c.pathname||!c.pathname.includes("?"),Kd("?","pathname","search",c)),De(!c.pathname||!c.pathname.includes("#"),Kd("#","pathname","hash",c)),De(!c.search||!c.search.includes("#"),Kd("#","search","hash",c)));let d=a===""||c.pathname==="",f=d?"/":c.pathname,p;if(f==null)p=l;else{let b=n.length-1;if(!s&&f.startsWith("..")){let y=f.split("/");for(;y[0]==="..";)y.shift(),b-=1;c.pathname=y.join("/")}p=b>=0?n[b]:"/"}let m=f4(c,p),g=f&&f!=="/"&&f.endsWith("/"),v=(d||f===".")&&l.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}const _a=a=>a.join("/").replace(/\/\/+/g,"/"),m4=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),p4=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,g4=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;class v4 extends Error{}class gc{constructor(n,l,s,c){c===void 0&&(c=!1),this.status=n,this.statusText=l||"",this.internal=c,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}}function cs(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}const Ry=["post","put","patch","delete"],b4=new Set(Ry),x4=["get",...Ry],y4=new Set(x4),j4=new Set([301,302,303,307,308]),S4=new Set([307,308]),Zd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},w4={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Dm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,C4=a=>({hasErrorBoundary:!!a.hasErrorBoundary}),Ny="remix-router-transitions";function E4(a){const n=a.window?a.window:typeof window<"u"?window:void 0,l=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u",s=!l;De(a.routes.length>0,"You must provide a non-empty routes array to createRouter");let c;if(a.mapRouteProperties)c=a.mapRouteProperties;else if(a.detectErrorBoundary){let M=a.detectErrorBoundary;c=L=>({hasErrorBoundary:M(L)})}else c=C4;let d={},f=pc(a.routes,c,void 0,d),p,m=a.basename||"/",g=a.dataStrategy||N4,v=a.patchRoutesOnNavigation,b=ct({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},a.future),y=null,j=new Set,D=null,w=null,R=null,E=a.hydrationData!=null,A=Fi(f,a.history.location,m),O=!1,P=null;if(A==null&&!v){let M=on(404,{pathname:a.history.location.pathname}),{matches:L,route:H}=Z0(f);A=L,P={[H.id]:M}}A&&!a.hydrationData&&dt(A,f,a.history.location.pathname).active&&(A=null);let V;if(A)if(A.some(M=>M.route.lazy))V=!1;else if(!A.some(M=>M.route.loader))V=!0;else if(b.v7_partialHydration){let M=a.hydrationData?a.hydrationData.loaderData:null,L=a.hydrationData?a.hydrationData.errors:null;if(L){let H=A.findIndex(ee=>L[ee.route.id]!==void 0);V=A.slice(0,H+1).every(ee=>!rm(ee.route,M,L))}else V=A.every(H=>!rm(H.route,M,L))}else V=a.hydrationData!=null;else if(V=!1,A=[],b.v7_partialHydration){let M=dt(null,f,a.history.location.pathname);M.active&&M.matches&&(O=!0,A=M.matches)}let G,T={historyAction:a.history.action,location:a.history.location,matches:A,initialized:V,navigation:Zd,restoreScrollPosition:a.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:a.hydrationData&&a.hydrationData.loaderData||{},actionData:a.hydrationData&&a.hydrationData.actionData||null,errors:a.hydrationData&&a.hydrationData.errors||P,fetchers:new Map,blockers:new Map},B=vt.Pop,W=!1,ne,ae=!1,oe=new Map,se=null,Z=!1,J=!1,U=[],F=new Set,X=new Map,te=0,re=-1,ve=new Map,ie=new Set,ue=new Map,we=new Map,Se=new Set,Ue=new Map,Ot=new Map,Dt;function Tt(){if(y=a.history.listen(M=>{let{action:L,location:H,delta:ee}=M;if(Dt){Dt(),Dt=void 0;return}Hl(Ot.size===0||ee!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let le=yi({currentLocation:T.location,nextLocation:H,historyAction:L});if(le&&ee!=null){let he=new Promise(xe=>{Dt=xe});a.history.go(ee*-1),xa(le,{state:"blocked",location:H,proceed(){xa(le,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),he.then(()=>a.history.go(ee))},reset(){let xe=new Map(T.blockers);xe.set(le,zl),Ie({blockers:xe})}});return}return Gt(L,H)}),l){I4(n,oe);let M=()=>k4(n,oe);n.addEventListener("pagehide",M),se=()=>n.removeEventListener("pagehide",M)}return T.initialized||Gt(vt.Pop,T.location,{initialHydration:!0}),G}function Be(){y&&y(),se&&se(),j.clear(),ne&&ne.abort(),T.fetchers.forEach((M,L)=>Qt(L)),T.blockers.forEach((M,L)=>xi(L))}function En(M){return j.add(M),()=>j.delete(M)}function Ie(M,L){L===void 0&&(L={}),T=ct({},T,M);let H=[],ee=[];b.v7_fetcherPersist&&T.fetchers.forEach((le,he)=>{le.state==="idle"&&(Se.has(he)?ee.push(he):H.push(he))}),Se.forEach(le=>{!T.fetchers.has(le)&&!X.has(le)&&ee.push(le)}),[...j].forEach(le=>le(T,{deletedFetchers:ee,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),b.v7_fetcherPersist?(H.forEach(le=>T.fetchers.delete(le)),ee.forEach(le=>Qt(le))):ee.forEach(le=>Se.delete(le))}function Ut(M,L,H){var ee,le;let{flushSync:he}=H===void 0?{}:H,xe=T.actionData!=null&&T.navigation.formMethod!=null&&kn(T.navigation.formMethod)&&T.navigation.state==="loading"&&((ee=M.state)==null?void 0:ee._isRedirect)!==!0,ce;L.actionData?Object.keys(L.actionData).length>0?ce=L.actionData:ce=null:xe?ce=T.actionData:ce=null;let me=L.loaderData?Q0(T.loaderData,L.loaderData,L.matches||[],L.errors):T.loaderData,de=T.blockers;de.size>0&&(de=new Map(de),de.forEach((Ne,Oe)=>de.set(Oe,zl)));let pe=W===!0||T.navigation.formMethod!=null&&kn(T.navigation.formMethod)&&((le=M.state)==null?void 0:le._isRedirect)!==!0;p&&(f=p,p=void 0),Z||B===vt.Pop||(B===vt.Push?a.history.push(M,M.state):B===vt.Replace&&a.history.replace(M,M.state));let Ee;if(B===vt.Pop){let Ne=oe.get(T.location.pathname);Ne&&Ne.has(M.pathname)?Ee={currentLocation:T.location,nextLocation:M}:oe.has(M.pathname)&&(Ee={currentLocation:M,nextLocation:T.location})}else if(ae){let Ne=oe.get(T.location.pathname);Ne?Ne.add(M.pathname):(Ne=new Set([M.pathname]),oe.set(T.location.pathname,Ne)),Ee={currentLocation:T.location,nextLocation:M}}Ie(ct({},L,{actionData:ce,loaderData:me,historyAction:B,location:M,initialized:!0,navigation:Zd,revalidation:"idle",restoreScrollPosition:St(M,L.matches||T.matches),preventScrollReset:pe,blockers:de}),{viewTransitionOpts:Ee,flushSync:he===!0}),B=vt.Pop,W=!1,ae=!1,Z=!1,J=!1,U=[]}async function Vt(M,L){if(typeof M=="number"){a.history.go(M);return}let H=lm(T.location,T.matches,m,b.v7_prependBasename,M,b.v7_relativeSplatPath,L?.fromRouteId,L?.relative),{path:ee,submission:le,error:he}=H0(b.v7_normalizeFormMethod,!1,H,L),xe=T.location,ce=ss(T.location,ee,L&&L.state);ce=ct({},ce,a.history.encodeLocation(ce));let me=L&&L.replace!=null?L.replace:void 0,de=vt.Push;me===!0?de=vt.Replace:me===!1||le!=null&&kn(le.formMethod)&&le.formAction===T.location.pathname+T.location.search&&(de=vt.Replace);let pe=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Ee=(L&&L.flushSync)===!0,Ne=yi({currentLocation:xe,nextLocation:ce,historyAction:de});if(Ne){xa(Ne,{state:"blocked",location:ce,proceed(){xa(Ne,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),Vt(M,L)},reset(){let Oe=new Map(T.blockers);Oe.set(Ne,zl),Ie({blockers:Oe})}});return}return await Gt(de,ce,{submission:le,pendingError:he,preventScrollReset:pe,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Ee})}function Jn(){if(rt(),Ie({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){Gt(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}Gt(B||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ae===!0})}}async function Gt(M,L,H){ne&&ne.abort(),ne=null,B=M,Z=(H&&H.startUninterruptedRevalidation)===!0,fn(T.location,T.matches),W=(H&&H.preventScrollReset)===!0,ae=(H&&H.enableViewTransition)===!0;let ee=p||f,le=H&&H.overrideNavigation,he=H!=null&&H.initialHydration&&T.matches&&T.matches.length>0&&!O?T.matches:Fi(ee,L,m),xe=(H&&H.flushSync)===!0;if(he&&T.initialized&&!J&&U4(T.location,L)&&!(H&&H.submission&&kn(H.submission.formMethod))){Ut(L,{matches:he},{flushSync:xe});return}let ce=dt(he,ee,L.pathname);if(ce.active&&ce.matches&&(he=ce.matches),!he){let{error:Ge,notFoundMatches:_e,route:ke}=ya(L.pathname);Ut(L,{matches:_e,loaderData:{},errors:{[ke.id]:Ge}},{flushSync:xe});return}ne=new AbortController;let me=Al(a.history,L,ne.signal,H&&H.submission),de;if(H&&H.pendingError)de=[Hi(he).route.id,{type:Ke.error,error:H.pendingError}];else if(H&&H.submission&&kn(H.submission.formMethod)){let Ge=await Xt(me,L,H.submission,he,ce.active,{replace:H.replace,flushSync:xe});if(Ge.shortCircuited)return;if(Ge.pendingActionResult){let[_e,ke]=Ge.pendingActionResult;if(Sn(ke)&&cs(ke.error)&&ke.error.status===404){ne=null,Ut(L,{matches:Ge.matches,loaderData:{},errors:{[_e]:ke.error}});return}}he=Ge.matches||he,de=Ge.pendingActionResult,le=Wd(L,H.submission),xe=!1,ce.active=!1,me=Al(a.history,me.url,me.signal)}let{shortCircuited:pe,matches:Ee,loaderData:Ne,errors:Oe}=await Ki(me,L,he,ce.active,le,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,xe,de);pe||(ne=null,Ut(L,ct({matches:Ee||he},K0(de),{loaderData:Ne,errors:Oe})))}async function Xt(M,L,H,ee,le,he){he===void 0&&(he={}),rt();let xe=H4(L,H);if(Ie({navigation:xe},{flushSync:he.flushSync===!0}),le){let de=await Rt(ee,L.pathname,M.signal);if(de.type==="aborted")return{shortCircuited:!0};if(de.type==="error"){let pe=Hi(de.partialMatches).route.id;return{matches:de.partialMatches,pendingActionResult:[pe,{type:Ke.error,error:de.error}]}}else if(de.matches)ee=de.matches;else{let{notFoundMatches:pe,error:Ee,route:Ne}=ya(L.pathname);return{matches:pe,pendingActionResult:[Ne.id,{type:Ke.error,error:Ee}]}}}let ce,me=es(ee,L);if(!me.route.action&&!me.route.lazy)ce={type:Ke.error,error:on(405,{method:M.method,pathname:L.pathname,routeId:me.route.id})};else if(ce=(await ga("action",T,M,[me],ee,null))[me.route.id],M.signal.aborted)return{shortCircuited:!0};if(Pi(ce)){let de;return he&&he.replace!=null?de=he.replace:de=G0(ce.response.headers.get("Location"),new URL(M.url),m)===T.location.pathname+T.location.search,await Dn(M,ce,!0,{submission:H,replace:de}),{shortCircuited:!0}}if(mi(ce))throw on(400,{type:"defer-action"});if(Sn(ce)){let de=Hi(ee,me.route.id);return(he&&he.replace)!==!0&&(B=vt.Push),{matches:ee,pendingActionResult:[de.route.id,ce]}}return{matches:ee,pendingActionResult:[me.route.id,ce]}}async function Ki(M,L,H,ee,le,he,xe,ce,me,de,pe){let Ee=le||Wd(L,he),Ne=he||xe||J0(Ee),Oe=!Z&&(!b.v7_partialHydration||!me);if(ee){if(Oe){let Ye=pa(pe);Ie(ct({navigation:Ee},Ye!==void 0?{actionData:Ye}:{}),{flushSync:de})}let ze=await Rt(H,L.pathname,M.signal);if(ze.type==="aborted")return{shortCircuited:!0};if(ze.type==="error"){let Ye=Hi(ze.partialMatches).route.id;return{matches:ze.partialMatches,loaderData:{},errors:{[Ye]:ze.error}}}else if(ze.matches)H=ze.matches;else{let{error:Ye,notFoundMatches:ia,route:ja}=ya(L.pathname);return{matches:ia,loaderData:{},errors:{[ja.id]:Ye}}}}let Ge=p||f,[_e,ke]=I0(a.history,T,H,Ne,L,b.v7_partialHydration&&me===!0,b.v7_skipActionErrorRevalidation,J,U,F,Se,ue,ie,Ge,m,pe);if(nt(ze=>!(H&&H.some(Ye=>Ye.route.id===ze))||_e&&_e.some(Ye=>Ye.route.id===ze)),re=++te,_e.length===0&&ke.length===0){let ze=tn();return Ut(L,ct({matches:H,loaderData:{},errors:pe&&Sn(pe[1])?{[pe[0]]:pe[1].error}:null},K0(pe),ze?{fetchers:new Map(T.fetchers)}:{}),{flushSync:de}),{shortCircuited:!0}}if(Oe){let ze={};if(!ee){ze.navigation=Ee;let Ye=pa(pe);Ye!==void 0&&(ze.actionData=Ye)}ke.length>0&&(ze.fetchers=dn(ke)),Ie(ze,{flushSync:de})}ke.forEach(ze=>{Kt(ze.key),ze.controller&&X.set(ze.key,ze.controller)});let hn=()=>ke.forEach(ze=>Kt(ze.key));ne&&ne.signal.addEventListener("abort",hn);let{loaderResults:ji,fetcherResults:Tn}=await ea(T,H,_e,ke,M);if(M.signal.aborted)return{shortCircuited:!0};ne&&ne.signal.removeEventListener("abort",hn),ke.forEach(ze=>X.delete(ze.key));let mn=qo(ji);if(mn)return await Dn(M,mn.result,!0,{replace:ce}),{shortCircuited:!0};if(mn=qo(Tn),mn)return ie.add(mn.key),await Dn(M,mn.result,!0,{replace:ce}),{shortCircuited:!0};let{loaderData:Jl,errors:aa}=X0(T,H,ji,pe,ke,Tn,Ue);Ue.forEach((ze,Ye)=>{ze.subscribe(ia=>{(ia||ze.done)&&Ue.delete(Ye)})}),b.v7_partialHydration&&me&&T.errors&&(aa=ct({},T.errors,aa));let Rn=tn(),nn=ta(re),Pa=Rn||nn||ke.length>0;return ct({matches:H,loaderData:Jl,errors:aa},Pa?{fetchers:new Map(T.fetchers)}:{})}function pa(M){if(M&&!Sn(M[1]))return{[M[0]]:M[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function dn(M){return M.forEach(L=>{let H=T.fetchers.get(L.key),ee=Yr(void 0,H?H.data:void 0);T.fetchers.set(L.key,ee)}),new Map(T.fetchers)}function Fn(M,L,H,ee){if(s)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Kt(M);let le=(ee&&ee.flushSync)===!0,he=p||f,xe=lm(T.location,T.matches,m,b.v7_prependBasename,H,b.v7_relativeSplatPath,L,ee?.relative),ce=Fi(he,xe,m),me=dt(ce,he,xe);if(me.active&&me.matches&&(ce=me.matches),!ce){Ve(M,L,on(404,{pathname:xe}),{flushSync:le});return}let{path:de,submission:pe,error:Ee}=H0(b.v7_normalizeFormMethod,!0,xe,ee);if(Ee){Ve(M,L,Ee,{flushSync:le});return}let Ne=es(ce,de),Oe=(ee&&ee.preventScrollReset)===!0;if(pe&&kn(pe.formMethod)){Ha(M,L,de,Ne,ce,me.active,le,Oe,pe);return}ue.set(M,{routeId:L,path:de}),vi(M,L,de,Ne,ce,me.active,le,Oe,pe)}async function Ha(M,L,H,ee,le,he,xe,ce,me){rt(),ue.delete(M);function de(ft){if(!ft.route.action&&!ft.route.lazy){let Sa=on(405,{method:me.formMethod,pathname:H,routeId:L});return Ve(M,L,Sa,{flushSync:xe}),!0}return!1}if(!he&&de(ee))return;let pe=T.fetchers.get(M);st(M,P4(me,pe),{flushSync:xe});let Ee=new AbortController,Ne=Al(a.history,H,Ee.signal,me);if(he){let ft=await Rt(le,new URL(Ne.url).pathname,Ne.signal,M);if(ft.type==="aborted")return;if(ft.type==="error"){Ve(M,L,ft.error,{flushSync:xe});return}else if(ft.matches){if(le=ft.matches,ee=es(le,H),de(ee))return}else{Ve(M,L,on(404,{pathname:H}),{flushSync:xe});return}}X.set(M,Ee);let Oe=te,_e=(await ga("action",T,Ne,[ee],le,M))[ee.route.id];if(Ne.signal.aborted){X.get(M)===Ee&&X.delete(M);return}if(b.v7_fetcherPersist&&Se.has(M)){if(Pi(_e)||Sn(_e)){st(M,di(void 0));return}}else{if(Pi(_e))if(X.delete(M),re>Oe){st(M,di(void 0));return}else return ie.add(M),st(M,Yr(me)),Dn(Ne,_e,!1,{fetcherSubmission:me,preventScrollReset:ce});if(Sn(_e)){Ve(M,L,_e.error);return}}if(mi(_e))throw on(400,{type:"defer-action"});let ke=T.navigation.location||T.location,hn=Al(a.history,ke,Ee.signal),ji=p||f,Tn=T.navigation.state!=="idle"?Fi(ji,T.navigation.location,m):T.matches;De(Tn,"Didn't find any matches after fetcher action");let mn=++te;ve.set(M,mn);let Jl=Yr(me,_e.data);T.fetchers.set(M,Jl);let[aa,Rn]=I0(a.history,T,Tn,me,ke,!1,b.v7_skipActionErrorRevalidation,J,U,F,Se,ue,ie,ji,m,[ee.route.id,_e]);Rn.filter(ft=>ft.key!==M).forEach(ft=>{let Sa=ft.key,Zt=T.fetchers.get(Sa),Ns=Yr(void 0,Zt?Zt.data:void 0);T.fetchers.set(Sa,Ns),Kt(Sa),ft.controller&&X.set(Sa,ft.controller)}),Ie({fetchers:new Map(T.fetchers)});let nn=()=>Rn.forEach(ft=>Kt(ft.key));Ee.signal.addEventListener("abort",nn);let{loaderResults:Pa,fetcherResults:ze}=await ea(T,Tn,aa,Rn,hn);if(Ee.signal.aborted)return;Ee.signal.removeEventListener("abort",nn),ve.delete(M),X.delete(M),Rn.forEach(ft=>X.delete(ft.key));let Ye=qo(Pa);if(Ye)return Dn(hn,Ye.result,!1,{preventScrollReset:ce});if(Ye=qo(ze),Ye)return ie.add(Ye.key),Dn(hn,Ye.result,!1,{preventScrollReset:ce});let{loaderData:ia,errors:ja}=X0(T,Tn,Pa,void 0,Rn,ze,Ue);if(T.fetchers.has(M)){let ft=di(_e.data);T.fetchers.set(M,ft)}ta(mn),T.navigation.state==="loading"&&mn>re?(De(B,"Expected pending action"),ne&&ne.abort(),Ut(T.navigation.location,{matches:Tn,loaderData:ia,errors:ja,fetchers:new Map(T.fetchers)})):(Ie({errors:ja,loaderData:Q0(T.loaderData,ia,Tn,ja),fetchers:new Map(T.fetchers)}),J=!1)}async function vi(M,L,H,ee,le,he,xe,ce,me){let de=T.fetchers.get(M);st(M,Yr(me,de?de.data:void 0),{flushSync:xe});let pe=new AbortController,Ee=Al(a.history,H,pe.signal);if(he){let _e=await Rt(le,new URL(Ee.url).pathname,Ee.signal,M);if(_e.type==="aborted")return;if(_e.type==="error"){Ve(M,L,_e.error,{flushSync:xe});return}else if(_e.matches)le=_e.matches,ee=es(le,H);else{Ve(M,L,on(404,{pathname:H}),{flushSync:xe});return}}X.set(M,pe);let Ne=te,Ge=(await ga("loader",T,Ee,[ee],le,M))[ee.route.id];if(mi(Ge)&&(Ge=await Tm(Ge,Ee.signal,!0)||Ge),X.get(M)===pe&&X.delete(M),!Ee.signal.aborted){if(Se.has(M)){st(M,di(void 0));return}if(Pi(Ge))if(re>Ne){st(M,di(void 0));return}else{ie.add(M),await Dn(Ee,Ge,!1,{preventScrollReset:ce});return}if(Sn(Ge)){Ve(M,L,Ge.error);return}De(!mi(Ge),"Unhandled fetcher deferred data"),st(M,di(Ge.data))}}async function Dn(M,L,H,ee){let{submission:le,fetcherSubmission:he,preventScrollReset:xe,replace:ce}=ee===void 0?{}:ee;L.response.headers.has("X-Remix-Revalidate")&&(J=!0);let me=L.response.headers.get("Location");De(me,"Expected a Location header on the redirect Response"),me=G0(me,new URL(M.url),m);let de=ss(T.location,me,{_isRedirect:!0});if(l){let _e=!1;if(L.response.headers.has("X-Remix-Reload-Document"))_e=!0;else if(Dm.test(me)){const ke=a.history.createURL(me);_e=ke.origin!==n.location.origin||Yn(ke.pathname,m)==null}if(_e){ce?n.location.replace(me):n.location.assign(me);return}}ne=null;let pe=ce===!0||L.response.headers.has("X-Remix-Replace")?vt.Replace:vt.Push,{formMethod:Ee,formAction:Ne,formEncType:Oe}=T.navigation;!le&&!he&&Ee&&Ne&&Oe&&(le=J0(T.navigation));let Ge=le||he;if(S4.has(L.response.status)&&Ge&&kn(Ge.formMethod))await Gt(pe,de,{submission:ct({},Ge,{formAction:me}),preventScrollReset:xe||W,enableViewTransition:H?ae:void 0});else{let _e=Wd(de,le);await Gt(pe,de,{overrideNavigation:_e,fetcherSubmission:he,preventScrollReset:xe||W,enableViewTransition:H?ae:void 0})}}async function ga(M,L,H,ee,le,he){let xe,ce={};try{xe=await M4(g,M,L,H,ee,le,he,d,c)}catch(me){return ee.forEach(de=>{ce[de.route.id]={type:Ke.error,error:me}}),ce}for(let[me,de]of Object.entries(xe))if(z4(de)){let pe=de.result;ce[me]={type:Ke.redirect,response:L4(pe,H,me,le,m,b.v7_relativeSplatPath)}}else ce[me]=await $4(de);return ce}async function ea(M,L,H,ee,le){let he=M.matches,xe=ga("loader",M,le,H,L,null),ce=Promise.all(ee.map(async pe=>{if(pe.matches&&pe.match&&pe.controller){let Ne=(await ga("loader",M,Al(a.history,pe.path,pe.controller.signal),[pe.match],pe.matches,pe.key))[pe.match.route.id];return{[pe.key]:Ne}}else return Promise.resolve({[pe.key]:{type:Ke.error,error:on(404,{pathname:pe.path})}})})),me=await xe,de=(await ce).reduce((pe,Ee)=>Object.assign(pe,Ee),{});return await Promise.all([q4(L,me,le.signal,he,M.loaderData),F4(L,de,ee)]),{loaderResults:me,fetcherResults:de}}function rt(){J=!0,U.push(...nt()),ue.forEach((M,L)=>{X.has(L)&&F.add(L),Kt(L)})}function st(M,L,H){H===void 0&&(H={}),T.fetchers.set(M,L),Ie({fetchers:new Map(T.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function Ve(M,L,H,ee){ee===void 0&&(ee={});let le=Hi(T.matches,L);Qt(M),Ie({errors:{[le.route.id]:H},fetchers:new Map(T.fetchers)},{flushSync:(ee&&ee.flushSync)===!0})}function bi(M){return we.set(M,(we.get(M)||0)+1),Se.has(M)&&Se.delete(M),T.fetchers.get(M)||w4}function Qt(M){let L=T.fetchers.get(M);X.has(M)&&!(L&&L.state==="loading"&&ve.has(M))&&Kt(M),ue.delete(M),ve.delete(M),ie.delete(M),b.v7_fetcherPersist&&Se.delete(M),F.delete(M),T.fetchers.delete(M)}function Zi(M){let L=(we.get(M)||0)-1;L<=0?(we.delete(M),Se.add(M),b.v7_fetcherPersist||Qt(M)):we.set(M,L),Ie({fetchers:new Map(T.fetchers)})}function Kt(M){let L=X.get(M);L&&(L.abort(),X.delete(M))}function va(M){for(let L of M){let H=bi(L),ee=di(H.data);T.fetchers.set(L,ee)}}function tn(){let M=[],L=!1;for(let H of ie){let ee=T.fetchers.get(H);De(ee,"Expected fetcher: "+H),ee.state==="loading"&&(ie.delete(H),M.push(H),L=!0)}return va(M),L}function ta(M){let L=[];for(let[H,ee]of ve)if(ee<M){let le=T.fetchers.get(H);De(le,"Expected fetcher: "+H),le.state==="loading"&&(Kt(H),ve.delete(H),L.push(H))}return va(L),L.length>0}function ba(M,L){let H=T.blockers.get(M)||zl;return Ot.get(M)!==L&&Ot.set(M,L),H}function xi(M){T.blockers.delete(M),Ot.delete(M)}function xa(M,L){let H=T.blockers.get(M)||zl;De(H.state==="unblocked"&&L.state==="blocked"||H.state==="blocked"&&L.state==="blocked"||H.state==="blocked"&&L.state==="proceeding"||H.state==="blocked"&&L.state==="unblocked"||H.state==="proceeding"&&L.state==="unblocked","Invalid blocker state transition: "+H.state+" -> "+L.state);let ee=new Map(T.blockers);ee.set(M,L),Ie({blockers:ee})}function yi(M){let{currentLocation:L,nextLocation:H,historyAction:ee}=M;if(Ot.size===0)return;Ot.size>1&&Hl(!1,"A router only supports one blocker at a time");let le=Array.from(Ot.entries()),[he,xe]=le[le.length-1],ce=T.blockers.get(he);if(!(ce&&ce.state==="proceeding")&&xe({currentLocation:L,nextLocation:H,historyAction:ee}))return he}function ya(M){let L=on(404,{pathname:M}),H=p||f,{matches:ee,route:le}=Z0(H);return nt(),{notFoundMatches:ee,route:le,error:L}}function nt(M){let L=[];return Ue.forEach((H,ee)=>{(!M||M(ee))&&(H.cancel(),L.push(ee),Ue.delete(ee))}),L}function zt(M,L,H){if(D=M,R=L,w=H||null,!E&&T.navigation===Zd){E=!0;let ee=St(T.location,T.matches);ee!=null&&Ie({restoreScrollPosition:ee})}return()=>{D=null,R=null,w=null}}function jt(M,L){return w&&w(M,L.map(ee=>wy(ee,T.loaderData)))||M.key}function fn(M,L){if(D&&R){let H=jt(M,L);D[H]=R()}}function St(M,L){if(D){let H=jt(M,L),ee=D[H];if(typeof ee=="number")return ee}return null}function dt(M,L,H){if(v)if(M){if(Object.keys(M[0].params).length>0)return{active:!0,matches:fc(L,H,m,!0)}}else return{active:!0,matches:fc(L,H,m,!0)||[]};return{active:!1,matches:null}}async function Rt(M,L,H,ee){if(!v)return{type:"success",matches:M};let le=M;for(;;){let he=p==null,xe=p||f,ce=d;try{await v({signal:H,path:L,matches:le,fetcherKey:ee,patch:(pe,Ee)=>{H.aborted||V0(pe,Ee,xe,ce,c)}})}catch(pe){return{type:"error",error:pe,partialMatches:le}}finally{he&&!H.aborted&&(f=[...f])}if(H.aborted)return{type:"aborted"};let me=Fi(xe,L,m);if(me)return{type:"success",matches:me};let de=fc(xe,L,m,!0);if(!de||le.length===de.length&&le.every((pe,Ee)=>pe.route.id===de[Ee].route.id))return{type:"success",matches:null};le=de}}function na(M){d={},p=pc(M,c,void 0,d)}function Ze(M,L){let H=p==null;V0(M,L,p||f,d,c),H&&(f=[...f],Ie({}))}return G={get basename(){return m},get future(){return b},get state(){return T},get routes(){return f},get window(){return n},initialize:Tt,subscribe:En,enableScrollRestoration:zt,navigate:Vt,fetch:Fn,revalidate:Jn,createHref:M=>a.history.createHref(M),encodeLocation:M=>a.history.encodeLocation(M),getFetcher:bi,deleteFetcher:Zi,dispose:Be,getBlocker:ba,deleteBlocker:xi,patchRoutes:Ze,_internalFetchControllers:X,_internalActiveDeferreds:Ue,_internalSetRoutes:na},G}function D4(a){return a!=null&&("formData"in a&&a.formData!=null||"body"in a&&a.body!==void 0)}function lm(a,n,l,s,c,d,f,p){let m,g;if(f){m=[];for(let b of n)if(m.push(b),b.route.id===f){g=b;break}}else m=n,g=n[n.length-1];let v=Mc(c||".",Nc(m,d),Yn(a.pathname,l)||a.pathname,p==="path");if(c==null&&(v.search=a.search,v.hash=a.hash),(c==null||c===""||c===".")&&g){let b=Rm(v.search);if(g.route.index&&!b)v.search=v.search?v.search.replace(/^\?/,"?index&"):"?index";else if(!g.route.index&&b){let y=new URLSearchParams(v.search),j=y.getAll("index");y.delete("index"),j.filter(w=>w).forEach(w=>y.append("index",w));let D=y.toString();v.search=D?"?"+D:""}}return s&&l!=="/"&&(v.pathname=v.pathname==="/"?l:_a([l,v.pathname])),Ii(v)}function H0(a,n,l,s){if(!s||!D4(s))return{path:l};if(s.formMethod&&!_4(s.formMethod))return{path:l,error:on(405,{method:s.formMethod})};let c=()=>({path:l,error:on(400,{type:"invalid-body"})}),d=s.formMethod||"get",f=a?d.toUpperCase():d.toLowerCase(),p=$y(l);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!kn(f))return c();let y=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((j,D)=>{let[w,R]=D;return""+j+w+"="+R+`
|
|
35
|
-
`},""):String(s.body);return{path:l,submission:{formMethod:f,formAction:p,formEncType:s.formEncType,formData:void 0,json:void 0,text:y}}}else if(s.formEncType==="application/json"){if(!kn(f))return c();try{let y=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:l,submission:{formMethod:f,formAction:p,formEncType:s.formEncType,formData:void 0,json:y,text:void 0}}}catch{return c()}}}De(typeof FormData=="function","FormData is not available in this environment");let m,g;if(s.formData)m=sm(s.formData),g=s.formData;else if(s.body instanceof FormData)m=sm(s.body),g=s.body;else if(s.body instanceof URLSearchParams)m=s.body,g=Y0(m);else if(s.body==null)m=new URLSearchParams,g=new FormData;else try{m=new URLSearchParams(s.body),g=Y0(m)}catch{return c()}let v={formMethod:f,formAction:p,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(kn(v.formMethod))return{path:l,submission:v};let b=qa(l);return n&&b.search&&Rm(b.search)&&m.append("index",""),b.search="?"+m,{path:Ii(b),submission:v}}function P0(a,n,l){l===void 0&&(l=!1);let s=a.findIndex(c=>c.route.id===n);return s>=0?a.slice(0,l?s+1:s):a}function I0(a,n,l,s,c,d,f,p,m,g,v,b,y,j,D,w){let R=w?Sn(w[1])?w[1].error:w[1].data:void 0,E=a.createURL(n.location),A=a.createURL(c),O=l;d&&n.errors?O=P0(l,Object.keys(n.errors)[0],!0):w&&Sn(w[1])&&(O=P0(l,w[0]));let P=w?w[1].statusCode:void 0,V=f&&P&&P>=400,G=O.filter((B,W)=>{let{route:ne}=B;if(ne.lazy)return!0;if(ne.loader==null)return!1;if(d)return rm(ne,n.loaderData,n.errors);if(T4(n.loaderData,n.matches[W],B)||m.some(se=>se===B.route.id))return!0;let ae=n.matches[W],oe=B;return k0(B,ct({currentUrl:E,currentParams:ae.params,nextUrl:A,nextParams:oe.params},s,{actionResult:R,actionStatus:P,defaultShouldRevalidate:V?!1:p||E.pathname+E.search===A.pathname+A.search||E.search!==A.search||My(ae,oe)}))}),T=[];return b.forEach((B,W)=>{if(d||!l.some(Z=>Z.route.id===B.routeId)||v.has(W))return;let ne=Fi(j,B.path,D);if(!ne){T.push({key:W,routeId:B.routeId,path:B.path,matches:null,match:null,controller:null});return}let ae=n.fetchers.get(W),oe=es(ne,B.path),se=!1;y.has(W)?se=!1:g.has(W)?(g.delete(W),se=!0):ae&&ae.state!=="idle"&&ae.data===void 0?se=p:se=k0(oe,ct({currentUrl:E,currentParams:n.matches[n.matches.length-1].params,nextUrl:A,nextParams:l[l.length-1].params},s,{actionResult:R,actionStatus:P,defaultShouldRevalidate:V?!1:p})),se&&T.push({key:W,routeId:B.routeId,path:B.path,matches:ne,match:oe,controller:new AbortController})}),[G,T]}function rm(a,n,l){if(a.lazy)return!0;if(!a.loader)return!1;let s=n!=null&&n[a.id]!==void 0,c=l!=null&&l[a.id]!==void 0;return!s&&c?!1:typeof a.loader=="function"&&a.loader.hydrate===!0?!0:!s&&!c}function T4(a,n,l){let s=!n||l.route.id!==n.route.id,c=a[l.route.id]===void 0;return s||c}function My(a,n){let l=a.route.path;return a.pathname!==n.pathname||l!=null&&l.endsWith("*")&&a.params["*"]!==n.params["*"]}function k0(a,n){if(a.route.shouldRevalidate){let l=a.route.shouldRevalidate(n);if(typeof l=="boolean")return l}return n.defaultShouldRevalidate}function V0(a,n,l,s,c){var d;let f;if(a){let g=s[a];De(g,"No route found to patch children into: routeId = "+a),g.children||(g.children=[]),f=g.children}else f=l;let p=n.filter(g=>!f.some(v=>Ay(g,v))),m=pc(p,c,[a||"_","patch",String(((d=f)==null?void 0:d.length)||"0")],s);f.push(...m)}function Ay(a,n){return"id"in a&&"id"in n&&a.id===n.id?!0:a.index===n.index&&a.path===n.path&&a.caseSensitive===n.caseSensitive?(!a.children||a.children.length===0)&&(!n.children||n.children.length===0)?!0:a.children.every((l,s)=>{var c;return(c=n.children)==null?void 0:c.some(d=>Ay(l,d))}):!1}async function R4(a,n,l){if(!a.lazy)return;let s=await a.lazy();if(!a.lazy)return;let c=l[a.id];De(c,"No route found in manifest");let d={};for(let f in s){let m=c[f]!==void 0&&f!=="hasErrorBoundary";Hl(!m,'Route "'+c.id+'" has a static property "'+f+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+f+'" will be ignored.')),!m&&!Jw.has(f)&&(d[f]=s[f])}Object.assign(c,d),Object.assign(c,ct({},n(c),{lazy:void 0}))}async function N4(a){let{matches:n}=a,l=n.filter(c=>c.shouldLoad);return(await Promise.all(l.map(c=>c.resolve()))).reduce((c,d,f)=>Object.assign(c,{[l[f].route.id]:d}),{})}async function M4(a,n,l,s,c,d,f,p,m,g){let v=d.map(j=>j.route.lazy?R4(j.route,m,p):void 0),b=d.map((j,D)=>{let w=v[D],R=c.some(A=>A.route.id===j.route.id);return ct({},j,{shouldLoad:R,resolve:async A=>(A&&s.method==="GET"&&(j.route.lazy||j.route.loader)&&(R=!0),R?A4(n,s,j,w,A,g):Promise.resolve({type:Ke.data,result:void 0}))})}),y=await a({matches:b,request:s,params:d[0].params,fetcherKey:f,context:g});try{await Promise.all(v)}catch{}return y}async function A4(a,n,l,s,c,d){let f,p,m=g=>{let v,b=new Promise((D,w)=>v=w);p=()=>v(),n.signal.addEventListener("abort",p);let y=D=>typeof g!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+a+'" [routeId: '+l.route.id+"]"))):g({request:n,params:l.params,context:d},...D!==void 0?[D]:[]),j=(async()=>{try{return{type:"data",result:await(c?c(w=>y(w)):y())}}catch(D){return{type:"error",result:D}}})();return Promise.race([j,b])};try{let g=l.route[a];if(s)if(g){let v,[b]=await Promise.all([m(g).catch(y=>{v=y}),s]);if(v!==void 0)throw v;f=b}else if(await s,g=l.route[a],g)f=await m(g);else if(a==="action"){let v=new URL(n.url),b=v.pathname+v.search;throw on(405,{method:n.method,pathname:b,routeId:l.route.id})}else return{type:Ke.data,result:void 0};else if(g)f=await m(g);else{let v=new URL(n.url),b=v.pathname+v.search;throw on(404,{pathname:b})}De(f.result!==void 0,"You defined "+(a==="action"?"an action":"a loader")+" for route "+('"'+l.route.id+"\" but didn't return anything from your `"+a+"` ")+"function. Please return a value or `null`.")}catch(g){return{type:Ke.error,result:g}}finally{p&&n.signal.removeEventListener("abort",p)}return f}async function $4(a){let{result:n,type:l}=a;if(Ly(n)){let b;try{let y=n.headers.get("Content-Type");y&&/\bapplication\/json\b/.test(y)?n.body==null?b=null:b=await n.json():b=await n.text()}catch(y){return{type:Ke.error,error:y}}return l===Ke.error?{type:Ke.error,error:new gc(n.status,n.statusText,b),statusCode:n.status,headers:n.headers}:{type:Ke.data,data:b,statusCode:n.status,headers:n.headers}}if(l===Ke.error){if(W0(n)){var s,c;if(n.data instanceof Error){var d,f;return{type:Ke.error,error:n.data,statusCode:(d=n.init)==null?void 0:d.status,headers:(f=n.init)!=null&&f.headers?new Headers(n.init.headers):void 0}}return{type:Ke.error,error:new gc(((s=n.init)==null?void 0:s.status)||500,void 0,n.data),statusCode:cs(n)?n.status:void 0,headers:(c=n.init)!=null&&c.headers?new Headers(n.init.headers):void 0}}return{type:Ke.error,error:n,statusCode:cs(n)?n.status:void 0}}if(B4(n)){var p,m;return{type:Ke.deferred,deferredData:n,statusCode:(p=n.init)==null?void 0:p.status,headers:((m=n.init)==null?void 0:m.headers)&&new Headers(n.init.headers)}}if(W0(n)){var g,v;return{type:Ke.data,data:n.data,statusCode:(g=n.init)==null?void 0:g.status,headers:(v=n.init)!=null&&v.headers?new Headers(n.init.headers):void 0}}return{type:Ke.data,data:n}}function L4(a,n,l,s,c,d){let f=a.headers.get("Location");if(De(f,"Redirects returned/thrown from loaders/actions must have a Location header"),!Dm.test(f)){let p=s.slice(0,s.findIndex(m=>m.route.id===l)+1);f=lm(new URL(n.url),p,c,!0,f,d),a.headers.set("Location",f)}return a}function G0(a,n,l){if(Dm.test(a)){let s=a,c=s.startsWith("//")?new URL(n.protocol+s):new URL(s),d=Yn(c.pathname,l)!=null;if(c.origin===n.origin&&d)return c.pathname+c.search+c.hash}return a}function Al(a,n,l,s){let c=a.createURL($y(n)).toString(),d={signal:l};if(s&&kn(s.formMethod)){let{formMethod:f,formEncType:p}=s;d.method=f.toUpperCase(),p==="application/json"?(d.headers=new Headers({"Content-Type":p}),d.body=JSON.stringify(s.json)):p==="text/plain"?d.body=s.text:p==="application/x-www-form-urlencoded"&&s.formData?d.body=sm(s.formData):d.body=s.formData}return new Request(c,d)}function sm(a){let n=new URLSearchParams;for(let[l,s]of a.entries())n.append(l,typeof s=="string"?s:s.name);return n}function Y0(a){let n=new FormData;for(let[l,s]of a.entries())n.append(l,s);return n}function O4(a,n,l,s,c){let d={},f=null,p,m=!1,g={},v=l&&Sn(l[1])?l[1].error:void 0;return a.forEach(b=>{if(!(b.route.id in n))return;let y=b.route.id,j=n[y];if(De(!Pi(j),"Cannot handle redirect results in processLoaderData"),Sn(j)){let D=j.error;v!==void 0&&(D=v,v=void 0),f=f||{};{let w=Hi(a,y);f[w.route.id]==null&&(f[w.route.id]=D)}d[y]=void 0,m||(m=!0,p=cs(j.error)?j.error.status:500),j.headers&&(g[y]=j.headers)}else mi(j)?(s.set(y,j.deferredData),d[y]=j.deferredData.data,j.statusCode!=null&&j.statusCode!==200&&!m&&(p=j.statusCode),j.headers&&(g[y]=j.headers)):(d[y]=j.data,j.statusCode&&j.statusCode!==200&&!m&&(p=j.statusCode),j.headers&&(g[y]=j.headers))}),v!==void 0&&l&&(f={[l[0]]:v},d[l[0]]=void 0),{loaderData:d,errors:f,statusCode:p||200,loaderHeaders:g}}function X0(a,n,l,s,c,d,f){let{loaderData:p,errors:m}=O4(n,l,s,f);return c.forEach(g=>{let{key:v,match:b,controller:y}=g,j=d[v];if(De(j,"Did not find corresponding fetcher result"),!(y&&y.signal.aborted))if(Sn(j)){let D=Hi(a.matches,b?.route.id);m&&m[D.route.id]||(m=ct({},m,{[D.route.id]:j.error})),a.fetchers.delete(v)}else if(Pi(j))De(!1,"Unhandled fetcher revalidation redirect");else if(mi(j))De(!1,"Unhandled fetcher deferred data");else{let D=di(j.data);a.fetchers.set(v,D)}}),{loaderData:p,errors:m}}function Q0(a,n,l,s){let c=ct({},n);for(let d of l){let f=d.route.id;if(n.hasOwnProperty(f)?n[f]!==void 0&&(c[f]=n[f]):a[f]!==void 0&&d.route.loader&&(c[f]=a[f]),s&&s.hasOwnProperty(f))break}return c}function K0(a){return a?Sn(a[1])?{actionData:{}}:{actionData:{[a[0]]:a[1].data}}:{}}function Hi(a,n){return(n?a.slice(0,a.findIndex(s=>s.route.id===n)+1):[...a]).reverse().find(s=>s.route.hasErrorBoundary===!0)||a[0]}function Z0(a){let n=a.length===1?a[0]:a.find(l=>l.index||!l.path||l.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function on(a,n){let{pathname:l,routeId:s,method:c,type:d,message:f}=n===void 0?{}:n,p="Unknown Server Error",m="Unknown @remix-run/router error";return a===400?(p="Bad Request",c&&l&&s?m="You made a "+c+' request to "'+l+'" but '+('did not provide a `loader` for route "'+s+'", ')+"so there is no way to handle the request.":d==="defer-action"?m="defer() is not supported in actions":d==="invalid-body"&&(m="Unable to encode submission body")):a===403?(p="Forbidden",m='Route "'+s+'" does not match URL "'+l+'"'):a===404?(p="Not Found",m='No route matches URL "'+l+'"'):a===405&&(p="Method Not Allowed",c&&l&&s?m="You made a "+c.toUpperCase()+' request to "'+l+'" but '+('did not provide an `action` for route "'+s+'", ')+"so there is no way to handle the request.":c&&(m='Invalid request method "'+c.toUpperCase()+'"')),new gc(a||500,p,new Error(m),!0)}function qo(a){let n=Object.entries(a);for(let l=n.length-1;l>=0;l--){let[s,c]=n[l];if(Pi(c))return{key:s,result:c}}}function $y(a){let n=typeof a=="string"?qa(a):a;return Ii(ct({},n,{hash:""}))}function U4(a,n){return a.pathname!==n.pathname||a.search!==n.search?!1:a.hash===""?n.hash!=="":a.hash===n.hash?!0:n.hash!==""}function z4(a){return Ly(a.result)&&j4.has(a.result.status)}function mi(a){return a.type===Ke.deferred}function Sn(a){return a.type===Ke.error}function Pi(a){return(a&&a.type)===Ke.redirect}function W0(a){return typeof a=="object"&&a!=null&&"type"in a&&"data"in a&&"init"in a&&a.type==="DataWithResponseInit"}function B4(a){let n=a;return n&&typeof n=="object"&&typeof n.data=="object"&&typeof n.subscribe=="function"&&typeof n.cancel=="function"&&typeof n.resolveData=="function"}function Ly(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.headers=="object"&&typeof a.body<"u"}function _4(a){return y4.has(a.toLowerCase())}function kn(a){return b4.has(a.toLowerCase())}async function q4(a,n,l,s,c){let d=Object.entries(n);for(let f=0;f<d.length;f++){let[p,m]=d[f],g=a.find(y=>y?.route.id===p);if(!g)continue;let v=s.find(y=>y.route.id===g.route.id),b=v!=null&&!My(v,g)&&(c&&c[g.route.id])!==void 0;mi(m)&&b&&await Tm(m,l,!1).then(y=>{y&&(n[p]=y)})}}async function F4(a,n,l){for(let s=0;s<l.length;s++){let{key:c,routeId:d,controller:f}=l[s],p=n[c];a.find(g=>g?.route.id===d)&&mi(p)&&(De(f,"Expected an AbortController for revalidating fetcher deferred result"),await Tm(p,f.signal,!0).then(g=>{g&&(n[c]=g)}))}}async function Tm(a,n,l){if(l===void 0&&(l=!1),!await a.deferredData.resolveData(n)){if(l)try{return{type:Ke.data,data:a.deferredData.unwrappedData}}catch(c){return{type:Ke.error,error:c}}return{type:Ke.data,data:a.deferredData.data}}}function Rm(a){return new URLSearchParams(a).getAll("index").some(n=>n==="")}function es(a,n){let l=typeof n=="string"?qa(n).search:n.search;if(a[a.length-1].route.index&&Rm(l||""))return a[a.length-1];let s=Ty(a);return s[s.length-1]}function J0(a){let{formMethod:n,formAction:l,formEncType:s,text:c,formData:d,json:f}=a;if(!(!n||!l||!s)){if(c!=null)return{formMethod:n,formAction:l,formEncType:s,formData:void 0,json:void 0,text:c};if(d!=null)return{formMethod:n,formAction:l,formEncType:s,formData:d,json:void 0,text:void 0};if(f!==void 0)return{formMethod:n,formAction:l,formEncType:s,formData:void 0,json:f,text:void 0}}}function Wd(a,n){return n?{state:"loading",location:a,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:a,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function H4(a,n){return{state:"submitting",location:a,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function Yr(a,n){return a?{state:"loading",formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function P4(a,n){return{state:"submitting",formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text,data:n?n.data:void 0}}function di(a){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function I4(a,n){try{let l=a.sessionStorage.getItem(Ny);if(l){let s=JSON.parse(l);for(let[c,d]of Object.entries(s||{}))d&&Array.isArray(d)&&n.set(c,new Set(d||[]))}}catch{}}function k4(a,n){if(n.size>0){let l={};for(let[s,c]of n)l[s]=[...c];try{a.sessionStorage.setItem(Ny,JSON.stringify(l))}catch(s){Hl(!1,"Failed to save applied view transitions in sessionStorage ("+s+").")}}}/**
|
|
36
|
-
* React Router v6.30.0
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Remix Software Inc.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
42
|
-
*
|
|
43
|
-
* @license MIT
|
|
44
|
-
*/const fe=await C("react");function ki(){return ki=Object.assign?Object.assign.bind():function(a){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(a[s]=l[s])}return a},ki.apply(this,arguments)}const xs=fe.createContext(null),Nm=fe.createContext(null),eb=fe.createContext(null),Fa=fe.createContext(null),Ac=fe.createContext(null),ha=fe.createContext({outlet:null,matches:[],isDataRoute:!1}),Oy=fe.createContext(null);function V4(a,n){let{relative:l}=n===void 0?{}:n;Yi()||De(!1);let{basename:s,navigator:c}=fe.useContext(Fa),{hash:d,pathname:f,search:p}=$c(a,{relative:l}),m=f;return s!=="/"&&(m=f==="/"?s:_a([s,f])),c.createHref({pathname:m,search:p,hash:d})}function Yi(){return fe.useContext(Ac)!=null}function Xi(){return Yi()||De(!1),fe.useContext(Ac).location}function tb(a){Yi()||De(!1);let{pathname:n}=Xi();return fe.useMemo(()=>os(a,Dy(n)),[n,a])}function Uy(a){fe.useContext(Fa).static||fe.useLayoutEffect(a)}function cn(){let{isDataRoute:a}=fe.useContext(ha);return a?rC():G4()}function G4(){Yi()||De(!1);let a=fe.useContext(xs),{basename:n,future:l,navigator:s}=fe.useContext(Fa),{matches:c}=fe.useContext(ha),{pathname:d}=Xi(),f=JSON.stringify(Nc(c,l.v7_relativeSplatPath)),p=fe.useRef(!1);return Uy(()=>{p.current=!0}),fe.useCallback(function(g,v){if(v===void 0&&(v={}),!p.current)return;if(typeof g=="number"){s.go(g);return}let b=Mc(g,JSON.parse(f),d,v.relative==="path");a==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:_a([n,b.pathname])),(v.replace?s.replace:s.push)(b,v.state,v)},[n,s,f,d,a])}const Y4=fe.createContext(null);function X4(a){let n=fe.useContext(ha).outlet;return n&&fe.createElement(Y4.Provider,{value:a},n)}function Qi(){let{matches:a}=fe.useContext(ha),n=a[a.length-1];return n?n.params:{}}function $c(a,n){let{relative:l}=n===void 0?{}:n,{future:s}=fe.useContext(Fa),{matches:c}=fe.useContext(ha),{pathname:d}=Xi(),f=JSON.stringify(Nc(c,s.v7_relativeSplatPath));return fe.useMemo(()=>Mc(a,JSON.parse(f),d,l==="path"),[a,f,d,l])}function Q4(a,n){return zy(a,n)}function zy(a,n,l,s){Yi()||De(!1);let{navigator:c,static:d}=fe.useContext(Fa),{matches:f}=fe.useContext(ha),p=f[f.length-1],m=p?p.params:{};p&&p.pathname;let g=p?p.pathnameBase:"/";p&&p.route;let v=Xi(),b;if(n){var y;let E=typeof n=="string"?qa(n):n;g==="/"||(y=E.pathname)!=null&&y.startsWith(g)||De(!1),b=E}else b=v;let j=b.pathname||"/",D=j;if(g!=="/"){let E=g.replace(/^\//,"").split("/");D="/"+j.replace(/^\//,"").split("/").slice(E.length).join("/")}let w=!d&&l&&l.matches&&l.matches.length>0?l.matches:Fi(a,{pathname:D}),R=eC(w&&w.map(E=>Object.assign({},E,{params:Object.assign({},m,E.params),pathname:_a([g,c.encodeLocation?c.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?g:_a([g,c.encodeLocation?c.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),f,l,s);return n&&R?fe.createElement(Ac.Provider,{value:{location:ki({pathname:"/",search:"",hash:"",state:null,key:"default"},b),navigationType:vt.Pop}},R):R}function K4(){let a=aC(),n=cs(a)?a.status+" "+a.statusText:a instanceof Error?a.message:JSON.stringify(a),l=a instanceof Error?a.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return fe.createElement(fe.Fragment,null,fe.createElement("h2",null,"Unexpected Application Error!"),fe.createElement("h3",{style:{fontStyle:"italic"}},n),l?fe.createElement("pre",{style:c},l):null,null)}const Z4=fe.createElement(K4,null);class W4 extends fe.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){console.error("React Router caught the following error during render",n,l)}render(){return this.state.error!==void 0?fe.createElement(ha.Provider,{value:this.props.routeContext},fe.createElement(Oy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function J4(a){let{routeContext:n,match:l,children:s}=a,c=fe.useContext(xs);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),fe.createElement(ha.Provider,{value:n},s)}function eC(a,n,l,s){var c;if(n===void 0&&(n=[]),l===void 0&&(l=null),s===void 0&&(s=null),a==null){var d;if(!l)return null;if(l.errors)a=l.matches;else if((d=s)!=null&&d.v7_partialHydration&&n.length===0&&!l.initialized&&l.matches.length>0)a=l.matches;else return null}let f=a,p=(c=l)==null?void 0:c.errors;if(p!=null){let v=f.findIndex(b=>b.route.id&&p?.[b.route.id]!==void 0);v>=0||De(!1),f=f.slice(0,Math.min(f.length,v+1))}let m=!1,g=-1;if(l&&s&&s.v7_partialHydration)for(let v=0;v<f.length;v++){let b=f[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(g=v),b.route.id){let{loaderData:y,errors:j}=l,D=b.route.loader&&y[b.route.id]===void 0&&(!j||j[b.route.id]===void 0);if(b.route.lazy||D){m=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((v,b,y)=>{let j,D=!1,w=null,R=null;l&&(j=p&&b.route.id?p[b.route.id]:void 0,w=b.route.errorElement||Z4,m&&(g<0&&y===0?(sC("route-fallback"),D=!0,R=null):g===y&&(D=!0,R=b.route.hydrateFallbackElement||null)));let E=n.concat(f.slice(0,y+1)),A=()=>{let O;return j?O=w:D?O=R:b.route.Component?O=fe.createElement(b.route.Component,null):b.route.element?O=b.route.element:O=v,fe.createElement(J4,{match:b,routeContext:{outlet:v,matches:E,isDataRoute:l!=null},children:O})};return l&&(b.route.ErrorBoundary||b.route.errorElement||y===0)?fe.createElement(W4,{location:l.location,revalidation:l.revalidation,component:w,error:j,children:A(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):A()},null)}var Mm=function(a){return a.UseBlocker="useBlocker",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a}(Mm||{}),By=function(a){return a.UseBlocker="useBlocker",a.UseLoaderData="useLoaderData",a.UseActionData="useActionData",a.UseRouteError="useRouteError",a.UseNavigation="useNavigation",a.UseRouteLoaderData="useRouteLoaderData",a.UseMatches="useMatches",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a.UseRouteId="useRouteId",a}(By||{});function _y(a){let n=fe.useContext(xs);return n||De(!1),n}function Am(a){let n=fe.useContext(Nm);return n||De(!1),n}function tC(a){let n=fe.useContext(ha);return n||De(!1),n}function qy(a){let n=tC(),l=n.matches[n.matches.length-1];return l.route.id||De(!1),l.route.id}function nC(){let{matches:a,loaderData:n}=Am();return fe.useMemo(()=>a.map(l=>wy(l,n)),[a,n])}function aC(){var a;let n=fe.useContext(Oy),l=Am(By.UseRouteError),s=qy();return n!==void 0?n:(a=l.errors)==null?void 0:a[s]}let iC=0;function lC(a){let{router:n,basename:l}=_y(Mm.UseBlocker),s=Am(),[c,d]=fe.useState(""),f=fe.useCallback(p=>{if(typeof a!="function")return!!a;if(l==="/")return a(p);let{currentLocation:m,nextLocation:g,historyAction:v}=p;return a({currentLocation:ki({},m,{pathname:Yn(m.pathname,l)||m.pathname}),nextLocation:ki({},g,{pathname:Yn(g.pathname,l)||g.pathname}),historyAction:v})},[l,a]);return fe.useEffect(()=>{let p=String(++iC);return d(p),()=>n.deleteBlocker(p)},[n]),fe.useEffect(()=>{c!==""&&n.getBlocker(c,f)},[n,c,f]),c&&s.blockers.has(c)?s.blockers.get(c):zl}function rC(){let{router:a}=_y(Mm.UseNavigateStable),n=qy(),l=fe.useRef(!1);return Uy(()=>{l.current=!0}),fe.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?a.navigate(c):a.navigate(c,ki({fromRouteId:n},d)))},[a,n])}const nb={};function sC(a,n,l){nb[a]||(nb[a]=!0)}function oC(a,n){a?.v7_startTransition,a?.v7_relativeSplatPath===void 0&&(!n||n.v7_relativeSplatPath),n&&(n.v7_fetcherPersist,n.v7_normalizeFormMethod,n.v7_partialHydration,n.v7_skipActionErrorRevalidation)}const cC="startTransition";fe[cC];function $m(a){let{to:n,replace:l,state:s,relative:c}=a;Yi()||De(!1);let{future:d,static:f}=fe.useContext(Fa),{matches:p}=fe.useContext(ha),{pathname:m}=Xi(),g=cn(),v=Mc(n,Nc(p,d.v7_relativeSplatPath),m,c==="path"),b=JSON.stringify(v);return fe.useEffect(()=>g(JSON.parse(b),{replace:l,state:s,relative:c}),[g,b,c,l,s]),null}function gi(a){return X4(a.context)}function us(a){De(!1)}function uC(a){let{basename:n="/",children:l=null,location:s,navigationType:c=vt.Pop,navigator:d,static:f=!1,future:p}=a;Yi()&&De(!1);let m=n.replace(/^\/*/,"/"),g=fe.useMemo(()=>({basename:m,navigator:d,static:f,future:ki({v7_relativeSplatPath:!1},p)}),[m,p,d,f]);typeof s=="string"&&(s=qa(s));let{pathname:v="/",search:b="",hash:y="",state:j=null,key:D="default"}=s,w=fe.useMemo(()=>{let R=Yn(v,m);return R==null?null:{location:{pathname:R,search:b,hash:y,state:j,key:D},navigationType:c}},[m,v,b,y,j,D,c]);return w==null?null:fe.createElement(Fa.Provider,{value:g},fe.createElement(Ac.Provider,{children:l,value:w}))}function Fy(a){let{children:n,location:l}=a;return Q4(om(n),l)}var Bn=function(a){return a[a.pending=0]="pending",a[a.success=1]="success",a[a.error=2]="error",a}(Bn||{});const dC=new Promise(()=>{});class AB extends fe.Component{constructor(n){super(n),this.state={error:null}}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,l){console.error("<Await> caught the following error during render",n,l)}render(){let{children:n,errorElement:l,resolve:s}=this.props,c=null,d=Bn.pending;if(!(s instanceof Promise))d=Bn.success,c=Promise.resolve(),Object.defineProperty(c,"_tracked",{get:()=>!0}),Object.defineProperty(c,"_data",{get:()=>s});else if(this.state.error){d=Bn.error;let f=this.state.error;c=Promise.reject().catch(()=>{}),Object.defineProperty(c,"_tracked",{get:()=>!0}),Object.defineProperty(c,"_error",{get:()=>f})}else s._tracked?(c=s,d="_error"in c?Bn.error:"_data"in c?Bn.success:Bn.pending):(d=Bn.pending,Object.defineProperty(s,"_tracked",{get:()=>!0}),c=s.then(f=>Object.defineProperty(s,"_data",{get:()=>f}),f=>Object.defineProperty(s,"_error",{get:()=>f})));if(d===Bn.error&&c._error instanceof v4)throw dC;if(d===Bn.error&&!l)throw c._error;if(d===Bn.error)return fe.createElement(eb.Provider,{value:c,children:l});if(d===Bn.success)return fe.createElement(eb.Provider,{value:c,children:n});throw c}}function om(a,n){n===void 0&&(n=[]);let l=[];return fe.Children.forEach(a,(s,c)=>{if(!fe.isValidElement(s))return;let d=[...n,c];if(s.type===fe.Fragment){l.push.apply(l,om(s.props.children,d));return}s.type!==us&&De(!1),!s.props.index||!s.props.children||De(!1);let f={id:s.props.id||d.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(f.children=om(s.props.children,d)),l.push(f)}),l}function fC(a){let n={hasErrorBoundary:a.ErrorBoundary!=null||a.errorElement!=null};return a.Component&&Object.assign(n,{element:fe.createElement(a.Component),Component:void 0}),a.HydrateFallback&&Object.assign(n,{hydrateFallbackElement:fe.createElement(a.HydrateFallback),HydrateFallback:void 0}),a.ErrorBoundary&&Object.assign(n,{errorElement:fe.createElement(a.ErrorBoundary),ErrorBoundary:void 0}),n}/**
|
|
45
|
-
* React Router DOM v6.30.0
|
|
46
|
-
*
|
|
47
|
-
* Copyright (c) Remix Software Inc.
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the MIT license found in the
|
|
50
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
51
|
-
*
|
|
52
|
-
* @license MIT
|
|
53
|
-
*/const Re=await C("react"),hC=await C("react-dom");function Pl(){return Pl=Object.assign?Object.assign.bind():function(a){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(a[s]=l[s])}return a},Pl.apply(this,arguments)}function Hy(a,n){if(a==null)return{};var l={},s=Object.keys(a),c,d;for(d=0;d<s.length;d++)c=s[d],!(n.indexOf(c)>=0)&&(l[c]=a[c]);return l}function mC(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function pC(a,n){return a.button===0&&(!n||n==="_self")&&!mC(a)}const gC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],vC=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],bC="6";try{window.__reactRouterVersion=bC}catch{}function xC(a,n){return E4({basename:void 0,future:Pl({},void 0,{v7_prependBasename:!0}),history:Kw({window:void 0}),hydrationData:yC(),routes:a,mapRouteProperties:fC,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function yC(){var a;let n=(a=window)==null?void 0:a.__staticRouterHydrationData;return n&&n.errors&&(n=Pl({},n,{errors:jC(n.errors)})),n}function jC(a){if(!a)return null;let n=Object.entries(a),l={};for(let[s,c]of n)if(c&&c.__type==="RouteErrorResponse")l[s]=new gc(c.status,c.statusText,c.data,c.internal===!0);else if(c&&c.__type==="Error"){if(c.__subType){let d=window[c.__subType];if(typeof d=="function")try{let f=new d(c.message);f.stack="",l[s]=f}catch{}}if(l[s]==null){let d=new Error(c.message);d.stack="",l[s]=d}}else l[s]=c;return l}const Py=Re.createContext({isTransitioning:!1}),SC=Re.createContext(new Map),wC="startTransition",ab=Re[wC],CC="flushSync",ib=hC[CC],EC="useId";Re[EC];function DC(a){ab?ab(a):a()}function Xr(a){ib?ib(a):a()}class TC{constructor(){this.status="pending",this.promise=new Promise((n,l)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",n(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",l(s))}})}}function RC(a){let{fallbackElement:n,router:l,future:s}=a,[c,d]=Re.useState(l.state),[f,p]=Re.useState(),[m,g]=Re.useState({isTransitioning:!1}),[v,b]=Re.useState(),[y,j]=Re.useState(),[D,w]=Re.useState(),R=Re.useRef(new Map),{v7_startTransition:E}=s||{},A=Re.useCallback(B=>{E?DC(B):B()},[E]),O=Re.useCallback((B,W)=>{let{deletedFetchers:ne,flushSync:ae,viewTransitionOpts:oe}=W;B.fetchers.forEach((Z,J)=>{Z.data!==void 0&&R.current.set(J,Z.data)}),ne.forEach(Z=>R.current.delete(Z));let se=l.window==null||l.window.document==null||typeof l.window.document.startViewTransition!="function";if(!oe||se){ae?Xr(()=>d(B)):A(()=>d(B));return}if(ae){Xr(()=>{y&&(v&&v.resolve(),y.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})});let Z=l.window.document.startViewTransition(()=>{Xr(()=>d(B))});Z.finished.finally(()=>{Xr(()=>{b(void 0),j(void 0),p(void 0),g({isTransitioning:!1})})}),Xr(()=>j(Z));return}y?(v&&v.resolve(),y.skipTransition(),w({state:B,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})):(p(B),g({isTransitioning:!0,flushSync:!1,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation}))},[l.window,y,v,R,A]);Re.useLayoutEffect(()=>l.subscribe(O),[l,O]),Re.useEffect(()=>{m.isTransitioning&&!m.flushSync&&b(new TC)},[m]),Re.useEffect(()=>{if(v&&f&&l.window){let B=f,W=v.promise,ne=l.window.document.startViewTransition(async()=>{A(()=>d(B)),await W});ne.finished.finally(()=>{b(void 0),j(void 0),p(void 0),g({isTransitioning:!1})}),j(ne)}},[A,f,v,l.window]),Re.useEffect(()=>{v&&f&&c.location.key===f.location.key&&v.resolve()},[v,y,c.location,f]),Re.useEffect(()=>{!m.isTransitioning&&D&&(p(D.state),g({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),w(void 0))},[m.isTransitioning,D]),Re.useEffect(()=>{},[]);let P=Re.useMemo(()=>({createHref:l.createHref,encodeLocation:l.encodeLocation,go:B=>l.navigate(B),push:(B,W,ne)=>l.navigate(B,{state:W,preventScrollReset:ne?.preventScrollReset}),replace:(B,W,ne)=>l.navigate(B,{replace:!0,state:W,preventScrollReset:ne?.preventScrollReset})}),[l]),V=l.basename||"/",G=Re.useMemo(()=>({router:l,navigator:P,static:!1,basename:V}),[l,P,V]),T=Re.useMemo(()=>({v7_relativeSplatPath:l.future.v7_relativeSplatPath}),[l.future.v7_relativeSplatPath]);return Re.useEffect(()=>oC(s,l.future),[s,l.future]),Re.createElement(Re.Fragment,null,Re.createElement(xs.Provider,{value:G},Re.createElement(Nm.Provider,{value:c},Re.createElement(SC.Provider,{value:R.current},Re.createElement(Py.Provider,{value:m},Re.createElement(uC,{basename:V,location:c.location,navigationType:c.historyAction,navigator:P,future:T},c.initialized||l.future.v7_partialHydration?Re.createElement(NC,{routes:l.routes,future:l.future,state:c}):n))))),null)}const NC=Re.memo(MC);function MC(a){let{routes:n,future:l,state:s}=a;return zy(n,void 0,s,l)}const AC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$C=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,It=Re.forwardRef(function(n,l){let{onClick:s,relative:c,reloadDocument:d,replace:f,state:p,target:m,to:g,preventScrollReset:v,viewTransition:b}=n,y=Hy(n,gC),{basename:j}=Re.useContext(Fa),D,w=!1;if(typeof g=="string"&&$C.test(g)&&(D=g,AC))try{let O=new URL(window.location.href),P=g.startsWith("//")?new URL(O.protocol+g):new URL(g),V=Yn(P.pathname,j);P.origin===O.origin&&V!=null?g=V+P.search+P.hash:w=!0}catch{}let R=V4(g,{relative:c}),E=OC(g,{replace:f,state:p,target:m,preventScrollReset:v,relative:c,viewTransition:b});function A(O){s&&s(O),O.defaultPrevented||E(O)}return Re.createElement("a",Pl({},y,{href:D||R,onClick:w||d?s:A,ref:l,target:m}))}),Ht=Re.forwardRef(function(n,l){let{"aria-current":s="page",caseSensitive:c=!1,className:d="",end:f=!1,style:p,to:m,viewTransition:g,children:v}=n,b=Hy(n,vC),y=$c(m,{relative:b.relative}),j=Xi(),D=Re.useContext(Nm),{navigator:w,basename:R}=Re.useContext(Fa),E=D!=null&&UC(y)&&g===!0,A=w.encodeLocation?w.encodeLocation(y).pathname:y.pathname,O=j.pathname,P=D&&D.navigation&&D.navigation.location?D.navigation.location.pathname:null;c||(O=O.toLowerCase(),P=P?P.toLowerCase():null,A=A.toLowerCase()),P&&R&&(P=Yn(P,R)||P);const V=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let G=O===A||!f&&O.startsWith(A)&&O.charAt(V)==="/",T=P!=null&&(P===A||!f&&P.startsWith(A)&&P.charAt(A.length)==="/"),B={isActive:G,isPending:T,isTransitioning:E},W=G?s:void 0,ne;typeof d=="function"?ne=d(B):ne=[d,G?"active":null,T?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let ae=typeof p=="function"?p(B):p;return Re.createElement(It,Pl({},b,{"aria-current":W,className:ne,ref:l,style:ae,to:m,viewTransition:g}),typeof v=="function"?v(B):v)});var cm;(function(a){a.UseScrollRestoration="useScrollRestoration",a.UseSubmit="useSubmit",a.UseSubmitFetcher="useSubmitFetcher",a.UseFetcher="useFetcher",a.useViewTransitionState="useViewTransitionState"})(cm||(cm={}));var lb;(function(a){a.UseFetcher="useFetcher",a.UseFetchers="useFetchers",a.UseScrollRestoration="useScrollRestoration"})(lb||(lb={}));function LC(a){let n=Re.useContext(xs);return n||De(!1),n}function OC(a,n){let{target:l,replace:s,state:c,preventScrollReset:d,relative:f,viewTransition:p}=n===void 0?{}:n,m=cn(),g=Xi(),v=$c(a,{relative:f});return Re.useCallback(b=>{if(pC(b,l)){b.preventDefault();let y=s!==void 0?s:Ii(g)===Ii(v);m(a,{replace:y,state:c,preventScrollReset:d,relative:f,viewTransition:p})}},[g,m,v,s,c,l,a,d,f,p])}function UC(a,n){n===void 0&&(n={});let l=Re.useContext(Py);l==null&&De(!1);let{basename:s}=LC(cm.useViewTransitionState),c=$c(a,{relative:n.relative});if(!l.isTransitioning)return!1;let d=Yn(l.currentLocation.pathname,s)||l.currentLocation.pathname,f=Yn(l.nextLocation.pathname,s)||l.nextLocation.pathname;return os(c.pathname,f)!=null||os(c.pathname,d)!=null}var Jd,rb;function zC(){if(rb)return Jd;rb=1;var a=function(){function d(f,p){for(var m=0;m<p.length;m++){var g=p[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(f,g.key,g)}}return function(f,p,m){return p&&d(f.prototype,p),m&&d(f,m),f}}();function n(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}var l=[[{color:"0, 0, 0",class:"ansi-black"},{color:"187, 0, 0",class:"ansi-red"},{color:"0, 187, 0",class:"ansi-green"},{color:"187, 187, 0",class:"ansi-yellow"},{color:"0, 0, 187",class:"ansi-blue"},{color:"187, 0, 187",class:"ansi-magenta"},{color:"0, 187, 187",class:"ansi-cyan"},{color:"255,255,255",class:"ansi-white"}],[{color:"85, 85, 85",class:"ansi-bright-black"},{color:"255, 85, 85",class:"ansi-bright-red"},{color:"0, 255, 0",class:"ansi-bright-green"},{color:"255, 255, 85",class:"ansi-bright-yellow"},{color:"85, 85, 255",class:"ansi-bright-blue"},{color:"255, 85, 255",class:"ansi-bright-magenta"},{color:"85, 255, 255",class:"ansi-bright-cyan"},{color:"255, 255, 255",class:"ansi-bright-white"}]],s=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&|%[A-Fa-f0-9]{2})+)/gm,c=function(){a(d,null,[{key:"escapeForHtml",value:function(p){return new d().escapeForHtml(p)}},{key:"linkify",value:function(p){return new d().linkify(p)}},{key:"ansiToHtml",value:function(p,m){return new d().ansiToHtml(p,m)}},{key:"ansiToJson",value:function(p,m){return new d().ansiToJson(p,m)}},{key:"ansiToText",value:function(p){return new d().ansiToText(p)}}]);function d(){n(this,d),this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}return a(d,[{key:"setupPalette",value:function(){this.PALETTE_COLORS=[];for(var p=0;p<2;++p)for(var m=0;m<8;++m)this.PALETTE_COLORS.push(l[p][m].color);for(var g=[0,95,135,175,215,255],v=function(E,A,O){return g[E]+", "+g[A]+", "+g[O]},b=0;b<6;++b)for(var y=0;y<6;++y)for(var j=0;j<6;++j)this.PALETTE_COLORS.push(v(b,y,j));for(var D=8,w=0;w<24;++w,D+=10)this.PALETTE_COLORS.push(v(D,D,D))}},{key:"escapeForHtml",value:function(p){return p.replace(/[&<>\"]/gm,function(m){return m=="&"?"&":m=='"'?""":m=="<"?"<":m==">"?">":""})}},{key:"linkify",value:function(p){return p.replace(s,function(m){return'<a href="'+m+'">'+m+"</a>"})}},{key:"ansiToHtml",value:function(p,m){return this.process(p,m,!0)}},{key:"ansiToJson",value:function(p,m){return m=m||{},m.json=!0,m.clearLine=!1,this.process(p,m,!0)}},{key:"ansiToText",value:function(p){return this.process(p,{},!1)}},{key:"process",value:function(p,m,g){var v=this,b=this,y=p.split(/\033\[/),j=y.shift();m==null&&(m={}),m.clearLine=/\r/.test(p);var D=y.map(function(R){return v.processChunk(R,m,g)});if(m&&m.json){var w=b.processChunkJson("");return w.content=j,w.clearLine=m.clearLine,D.unshift(w),m.remove_empty&&(D=D.filter(function(R){return!R.isEmpty()})),D}else D.unshift(j);return D.join("")}},{key:"processChunkJson",value:function(p,m,g){m=typeof m>"u"?{}:m;var v=m.use_classes=typeof m.use_classes<"u"&&m.use_classes,b=m.key=v?"class":"color",y={content:p,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:m.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:function(){return!y.content}},j=p.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!j)return y;y.content=j[4];var D=j[2].split(";");if(j[1]!==""||j[3]!=="m"||!g)return y;for(var w=this;D.length>0;){var R=D.shift(),E=parseInt(R);if(isNaN(E)||E===0)w.fg=w.bg=null,w.decorations=[];else if(E===1)w.decorations.push("bold");else if(E===2)w.decorations.push("dim");else if(E===3)w.decorations.push("italic");else if(E===4)w.decorations.push("underline");else if(E===5)w.decorations.push("blink");else if(E===7)w.decorations.push("reverse");else if(E===8)w.decorations.push("hidden");else if(E===9)w.decorations.push("strikethrough");else if(E===21)w.removeDecoration("bold");else if(E===22)w.removeDecoration("bold"),w.removeDecoration("dim");else if(E===23)w.removeDecoration("italic");else if(E===24)w.removeDecoration("underline");else if(E===25)w.removeDecoration("blink");else if(E===27)w.removeDecoration("reverse");else if(E===28)w.removeDecoration("hidden");else if(E===29)w.removeDecoration("strikethrough");else if(E===39)w.fg=null;else if(E===49)w.bg=null;else if(E>=30&&E<38)w.fg=l[0][E%10][b];else if(E>=90&&E<98)w.fg=l[1][E%10][b];else if(E>=40&&E<48)w.bg=l[0][E%10][b];else if(E>=100&&E<108)w.bg=l[1][E%10][b];else if(E===38||E===48){var A=E===38;if(D.length>=1){var O=D.shift();if(O==="5"&&D.length>=1){var P=parseInt(D.shift());if(P>=0&&P<=255)if(!v)this.PALETTE_COLORS||w.setupPalette(),A?w.fg=this.PALETTE_COLORS[P]:w.bg=this.PALETTE_COLORS[P];else{var V=P>=16?"ansi-palette-"+P:l[P>7?1:0][P%8].class;A?w.fg=V:w.bg=V}}else if(O==="2"&&D.length>=3){var G=parseInt(D.shift()),T=parseInt(D.shift()),B=parseInt(D.shift());if(G>=0&&G<=255&&T>=0&&T<=255&&B>=0&&B<=255){var W=G+", "+T+", "+B;v?A?(w.fg="ansi-truecolor",w.fg_truecolor=W):(w.bg="ansi-truecolor",w.bg_truecolor=W):A?w.fg=W:w.bg=W}}}}}return w.fg===null&&w.bg===null&&w.decorations.length===0||(y.fg=w.fg,y.bg=w.bg,y.fg_truecolor=w.fg_truecolor,y.bg_truecolor=w.bg_truecolor,y.decorations=w.decorations,y.decoration=w.decorations.slice(-1).pop()||null,y.was_processed=!0),y}},{key:"processChunk",value:function(p,m,g){var v=this;m=m||{};var b=this.processChunkJson(p,m,g),y=m.use_classes;if(b.decorations=b.decorations.filter(function(A){if(A==="reverse"){b.fg||(b.fg=l[0][7][y?"class":"color"]),b.bg||(b.bg=l[0][0][y?"class":"color"]);var O=b.fg;b.fg=b.bg,b.bg=O;var P=b.fg_truecolor;return b.fg_truecolor=b.bg_truecolor,b.bg_truecolor=P,b.isInverted=!0,!1}return!0}),m.json)return b;if(b.isEmpty())return"";if(!b.was_processed)return b.content;var j=[],D=[],w=[],R={},E=function(O){var P=[],V=void 0;for(V in O)O.hasOwnProperty(V)&&P.push("data-"+V+'="'+v.escapeForHtml(O[V])+'"');return P.length>0?" "+P.join(" "):""};return b.isInverted&&(R["ansi-is-inverted"]="true"),b.fg&&(y?(j.push(b.fg+"-fg"),b.fg_truecolor!==null&&(R["ansi-truecolor-fg"]=b.fg_truecolor,b.fg_truecolor=null)):j.push("color:rgb("+b.fg+")")),b.bg&&(y?(j.push(b.bg+"-bg"),b.bg_truecolor!==null&&(R["ansi-truecolor-bg"]=b.bg_truecolor,b.bg_truecolor=null)):j.push("background-color:rgb("+b.bg+")")),b.decorations.forEach(function(A){if(y){D.push("ansi-"+A);return}A==="bold"?D.push("font-weight:bold"):A==="dim"?D.push("opacity:0.5"):A==="italic"?D.push("font-style:italic"):A==="hidden"?D.push("visibility:hidden"):A==="strikethrough"?w.push("line-through"):w.push(A)}),w.length&&D.push("text-decoration:"+w.join(" ")),y?'<span class="'+j.concat(D).join(" ")+'"'+E(R)+">"+b.content+"</span>":'<span style="'+j.concat(D).join(";")+'"'+E(R)+">"+b.content+"</span>"}},{key:"removeDecoration",value:function(p){var m=this.decorations.indexOf(p);m>=0&&this.decorations.splice(m,1)}}]),d}();return Jd=c,Jd}var BC=zC();const _C=wm(BC);function qC({text:a}){const n=a.split(`
|
|
54
|
-
`).map((l,s)=>{const c=_C.ansiToJson(l,{use_classes:!1});return o.jsx("div",{children:c.map((d,f)=>{const{decorations:p}=d,m={};d.fg&&(m.color=`rgb(${d.fg})`),d.bg&&(m.backgroundColor=`rgb(${d.bg})`),p.includes("bold")&&(m.fontWeight="bold"),p.includes("italic")&&(m.fontStyle="italic"),p.includes("dim")&&(m.opacity=.5),p.includes("hidden")&&(m.visibility="hidden");const g=[];return p.includes("underline")&&g.push("underline"),p.includes("strikethrough")&&g.push("line-through"),p.includes("blink")&&g.push("blink"),g.length>0&&(m.textDecoration=g.join(" ")),o.jsx("span",{style:m,children:d.content},f)})},s)});return o.jsx(o.Fragment,{children:n})}var hc={exports:{}},FC=hc.exports,sb;function HC(){return sb||(sb=1,function(a){(function(n,l){a.exports?a.exports=l():n.log=l()})(FC,function(){var n=function(){},l="undefined",s=typeof window!==l&&typeof window.navigator!==l&&/Trident\/|MSIE /.test(window.navigator.userAgent),c=["trace","debug","info","warn","error"],d={},f=null;function p(w,R){var E=w[R];if(typeof E.bind=="function")return E.bind(w);try{return Function.prototype.bind.call(E,w)}catch{return function(){return Function.prototype.apply.apply(E,[w,arguments])}}}function m(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function g(w){return w==="debug"&&(w="log"),typeof console===l?!1:w==="trace"&&s?m:console[w]!==void 0?p(console,w):console.log!==void 0?p(console,"log"):n}function v(){for(var w=this.getLevel(),R=0;R<c.length;R++){var E=c[R];this[E]=R<w?n:this.methodFactory(E,w,this.name)}if(this.log=this.debug,typeof console===l&&w<this.levels.SILENT)return"No console available for logging"}function b(w){return function(){typeof console!==l&&(v.call(this),this[w].apply(this,arguments))}}function y(w,R,E){return g(w)||b.apply(this,arguments)}function j(w,R){var E=this,A,O,P,V="loglevel";typeof w=="string"?V+=":"+w:typeof w=="symbol"&&(V=void 0);function G(ae){var oe=(c[ae]||"silent").toUpperCase();if(!(typeof window===l||!V)){try{window.localStorage[V]=oe;return}catch{}try{window.document.cookie=encodeURIComponent(V)+"="+oe+";"}catch{}}}function T(){var ae;if(!(typeof window===l||!V)){try{ae=window.localStorage[V]}catch{}if(typeof ae===l)try{var oe=window.document.cookie,se=encodeURIComponent(V),Z=oe.indexOf(se+"=");Z!==-1&&(ae=/^([^;]+)/.exec(oe.slice(Z+se.length+1))[1])}catch{}return E.levels[ae]===void 0&&(ae=void 0),ae}}function B(){if(!(typeof window===l||!V)){try{window.localStorage.removeItem(V)}catch{}try{window.document.cookie=encodeURIComponent(V)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function W(ae){var oe=ae;if(typeof oe=="string"&&E.levels[oe.toUpperCase()]!==void 0&&(oe=E.levels[oe.toUpperCase()]),typeof oe=="number"&&oe>=0&&oe<=E.levels.SILENT)return oe;throw new TypeError("log.setLevel() called with invalid level: "+ae)}E.name=w,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=R||y,E.getLevel=function(){return P??O??A},E.setLevel=function(ae,oe){return P=W(ae),oe!==!1&&G(P),v.call(E)},E.setDefaultLevel=function(ae){O=W(ae),T()||E.setLevel(ae,!1)},E.resetLevel=function(){P=null,B(),v.call(E)},E.enableAll=function(ae){E.setLevel(E.levels.TRACE,ae)},E.disableAll=function(ae){E.setLevel(E.levels.SILENT,ae)},E.rebuild=function(){if(f!==E&&(A=W(f.getLevel())),v.call(E),f===E)for(var ae in d)d[ae].rebuild()},A=W(f?f.getLevel():"WARN");var ne=T();ne!=null&&(P=W(ne)),v.call(E)}f=new j,f.getLogger=function(R){if(typeof R!="symbol"&&typeof R!="string"||R==="")throw new TypeError("You must supply a name when creating a logger.");var E=d[R];return E||(E=d[R]=new j(R,f.methodFactory)),E};var D=typeof window!==l?window.log:void 0;return f.noConflict=function(){return typeof window!==l&&window.log===f&&(window.log=D),f},f.getLoggers=function(){return d},f.default=f,f})}(hc)),hc.exports}var PC=HC();const IC=wm(PC),Iy=IC;Iy.enableAll();function Bl(a){Iy.error(a)}const{useBlockerDialogState:ef}=await C("@baseplate-dev/project-builder-lib/web"),{Button:tf,Dialog:kC,DialogContent:VC,DialogDescription:GC,DialogFooter:YC,DialogHeader:XC,DialogTitle:QC}=await C("@baseplate-dev/ui-components"),{useCallback:ob,useEffect:KC,useState:ZC}=await C("react");function WC(){const a=ef(y=>y.activeBlockers.length>0?y.activeBlockers[0]:null),n=ef(y=>y.requestedBlockers),l=ef(y=>y.clearRequestedBlockers),s=lC(({currentLocation:y,nextLocation:j})=>!!a&&y.pathname!==j.pathname),[c,d]=ZC(!1),f=ob(()=>{s.reset?.(),l()},[s,l]),p=ob(async y=>{d(!0);try{if(y&&!await y()){f();return}s.state==="blocked"&&s.proceed();for(const j of n)j.onContinue();l()}finally{d(!1)}},[s,n,l,f]),m=s.state==="blocked"||n.length>0;KC(()=>{m&&!a&&!c&&p().catch(y=>{Bl(y)})},[m,p,a,c]);const g=o.jsx(tf,{onClick:f,variant:"secondary",children:"Cancel"}),v=a?.buttonContinueWithoutSaveText&&o.jsx(tf,{onClick:()=>p(a.onContinueWithoutSave).catch(y=>{Bl(y)}),disabled:c,variant:"secondary",children:a.buttonContinueWithoutSaveText??"Continue without saving"}),b=o.jsx(tf,{disabled:c,onClick:()=>{p(a?.onContinue).catch(y=>{Bl(y)})},children:a?.buttonContinueText??"Continue"});return o.jsx(kC,{open:m,onOpenChange:y=>{y||f()},children:o.jsx(VC,{children:o.jsxs("div",{className:"space-y-4",children:[o.jsx(XC,{children:o.jsx(QC,{children:a?.title})}),o.jsx(GC,{children:a?.content}),o.jsx(YC,{children:v?o.jsxs("div",{className:"flex w-full justify-between",children:[v,o.jsxs("div",{className:"space-x-2",children:[g,b]})]}):o.jsxs(o.Fragment,{children:[g,b]})})]})})})}const{Button:Fo}=await C("@baseplate-dev/ui-components"),{useState:JC}=await C("react");function ky({className:a,defaultOpen:n,children:l,collapsedContents:s,onRemove:c}){const[d,f]=JC(n);return o.jsx("div",{className:Te("",a),children:d?o.jsxs("div",{className:"border-gray-200 space-y-4 border",children:[o.jsxs("div",{className:"flex flex-row space-x-4",children:[o.jsx(Fo,{variant:"link",size:"none",onClick:()=>{f(!1)},children:"Close"}),o.jsx(Fo,{variant:"link",size:"none",onClick:c,children:"Remove"})]}),l]}):o.jsxs("div",{className:"flex flex-row items-center space-x-4",children:[o.jsx(Fo,{variant:"link",size:"none",onClick:()=>{f(!0)},children:"Edit"}),s,o.jsx(Fo,{variant:"link",size:"none",onClick:c,children:"Remove"})]})})}function Vy(a){a?localStorage.setItem("projectId",a):localStorage.removeItem("projectId")}function eE(){const a=localStorage.getItem("projectId");if(a)return a;if(globalThis.location.search.includes("projectId=")){const l=new URLSearchParams(globalThis.location.search).get("projectId");if(l)return Vy(l),l}return null}const Cn=Sm(a=>({projects:[],projectsLoaded:!1,setProjects:n=>{a(l=>({projects:n,projectsLoaded:!0,...n.some(s=>s.id===l.currentProjectId)?void 0:{currentProjectId:n.length===1?n[0].id:null}}))},currentProjectId:eE(),setCurrentProjectId:n=>{a(l=>({currentProjectId:l.projects.some(s=>s.id===n)?n:null}))},resetCurrentProjectId:()=>{a(n=>({currentProjectId:n.projects.length===1?n.projects[0].id:null}))}})),tE={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{z:nf}=await C("zod"),nE=nf.object({VITE_PREVIEW_MODE:nf.enum(["true","false"]).nullish().transform(a=>a==="true"),VITE_ENABLE_TEMPLATE_EXTRACTOR:nf.enum(["true","false"]).nullish().transform(a=>a==="true")}),Gy=nE.parse(tE),qn=Gy.VITE_PREVIEW_MODE,Yy=Gy.VITE_ENABLE_TEMPLATE_EXTRACTOR;function ma(a){const n={subscribe(l){let s=null,c=!1,d=!1,f=!1;function p(){if(s===null){f=!0;return}d||(d=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=a({next(m){c||l.next?.(m)},error(m){c||(c=!0,l.error?.(m),p())},complete(){c||(c=!0,l.complete?.(),p())}}),f&&p(),{unsubscribe:p}},pipe(...l){return l.reduce(aE,n)}};return n}function aE(a,n){return n(a)}function iE(a){const n=new AbortController;return new Promise((s,c)=>{let d=!1;function f(){d||(d=!0,p.unsubscribe())}n.signal.addEventListener("abort",()=>{c(n.signal.reason)});const p=a.subscribe({next(m){d=!0,s(m),f()},error(m){c(m)},complete(){n.abort(),f()}})})}function lE(a){return n=>{let l=0,s=null;const c=[];function d(){s||(s=n.subscribe({next(p){for(const m of c)m.next?.(p)},error(p){for(const m of c)m.error?.(p)},complete(){for(const p of c)p.complete?.()}}))}function f(){if(l===0&&s){const p=s;s=null,p.unsubscribe()}}return ma(p=>(l++,c.push(p),d(),{unsubscribe(){l--,f();const m=c.findIndex(g=>g===p);m>-1&&c.splice(m,1)}}))}}function rE(a){return n=>ma(l=>n.subscribe({next(s){a.next?.(s),l.next(s)},error(s){a.error?.(s),l.error(s)},complete(){a.complete?.(),l.complete()}}))}function Xy(a){let n=a;const l=[],s=f=>{n!==void 0&&f.next(n),l.push(f)},c=f=>{l.splice(l.indexOf(f),1)},d=ma(f=>(s(f),()=>{c(f)}));return d.next=f=>{if(n!==f){n=f;for(const p of l)p.next(f)}},d.get=()=>n,d}function Qy(a){return ma(n=>{function l(c=0,d=a.op){const f=a.links[c];if(!f)throw new Error("No more links to execute - did you forget to add an ending link?");return f({op:d,next(m){return l(c+1,m)}})}return l().subscribe(n)})}const Ky=()=>{},cb=a=>{Object.freeze&&Object.freeze(a)};function Zy(a,n,l){var s,c;const d=n.join(".");return(s=l)[c=d]??(s[c]=new Proxy(Ky,{get(f,p){if(!(typeof p!="string"||p==="then"))return Zy(a,[...n,p],l)},apply(f,p,m){const g=n[n.length-1];let v={args:m,path:n};return g==="call"?v={args:m.length>=2?[m[1]]:[],path:n.slice(0,-1)}:g==="apply"&&(v={args:m.length>=2?m[1]:[],path:n.slice(0,-1)}),cb(v.args),cb(v.path),a(v)}})),l[d]}const sE=a=>Zy(a,[],Object.create(null)),oE=a=>new Proxy(Ky,{get(n,l){if(l!=="then")return a(l)}});function ds(a){return!!a&&!Array.isArray(a)&&typeof a=="object"}const ub=a=>a();function db(a=0){return new Promise(n=>setTimeout(n,a))}function cE(a,n){if("error"in a){const s=n.deserialize(a.error);return{ok:!1,error:{...a,error:s}}}return{ok:!0,result:{...a.result,...(!a.result.type||a.result.type==="data")&&{type:"data",data:n.deserialize(a.result.data)}}}}class af extends Error{constructor(){super("Unable to transform response from server")}}function Wy(a,n){let l;try{l=cE(a,n)}catch{throw new af}if(!l.ok&&(!ds(l.error.error)||typeof l.error.error.code!="number"))throw new af;if(l.ok&&!ds(l.result))throw new af;return l}var fb,hb;(fb=Symbol).dispose??(fb.dispose=Symbol());(hb=Symbol).asyncDispose??(hb.asyncDispose=Symbol());typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||globalThis.process?.env?.JEST_WORKER_ID||globalThis.process?.env?.VITEST_WORKER_ID;function Ho(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}function uE(a){return a instanceof Jt||a instanceof Error&&a.name==="TRPCClientError"}function dE(a){return ds(a)&&ds(a.error)&&typeof a.error.code=="number"&&typeof a.error.message=="string"}function fE(a,n){return typeof a=="string"?a:ds(a)&&typeof a.message=="string"?a.message:n}class Jt extends Error{static from(n,l={}){const s=n;return uE(s)?(l.meta&&(s.meta={...s.meta,...l.meta}),s):dE(s)?new Jt(s.error.message,{...l,result:s}):new Jt(fE(s,"Unknown error"),{...l,cause:s})}constructor(n,l){const s=l?.cause;super(n,{cause:s}),Ho(this,"cause",void 0),Ho(this,"shape",void 0),Ho(this,"data",void 0),Ho(this,"meta",void 0),this.meta=l?.meta,this.cause=s,this.shape=l?.result?.error,this.data=l?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Jt.prototype)}}function lf(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class hE{$request(n){return Qy({links:this.links,op:{...n,context:n.context??{},id:++this.requestId}}).pipe(lE())}async requestAsPromise(n){try{const l=this.$request(n);return(await iE(l)).result.data}catch(l){throw Jt.from(l)}}query(n,l,s){return this.requestAsPromise({type:"query",path:n,input:l,context:s?.context,signal:s?.signal})}mutation(n,l,s){return this.requestAsPromise({type:"mutation",path:n,input:l,context:s?.context,signal:s?.signal})}subscription(n,l,s){return this.$request({type:"subscription",path:n,input:l,context:s.context,signal:s.signal}).subscribe({next(d){switch(d.result.type){case"state":{s.onConnectionStateChange?.(d.result);break}case"started":{s.onStarted?.({context:d.context});break}case"stopped":{s.onStopped?.();break}case"data":case void 0:{s.onData?.(d.result.data);break}}},error(d){s.onError?.(d)},complete(){s.onComplete?.()}})}constructor(n){lf(this,"links",void 0),lf(this,"runtime",void 0),lf(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=n.links.map(l=>l(this.runtime))}}const mE=Symbol.for("trpc_untypedClient"),pE={query:"query",mutate:"mutation",subscribe:"subscription"},gE=a=>pE[a];function vE(a){const n=sE(({path:l,args:s})=>{const c=[...l],d=gE(c.pop()),f=c.join(".");return a[d](f,...s)});return oE(l=>l===mE?a:n[l])}function bE(a){const n=new hE(a);return vE(n)}const mb=a=>typeof a=="function";function xE(a){if(a)return a;if(typeof window<"u"&&mb(window.fetch))return window.fetch;if(typeof globalThis<"u"&&mb(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const pb=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function gb(a){let n=null,l=null;const s=()=>{clearTimeout(l),l=null,n=null};function c(p){const m=[[]];let g=0;for(;;){const v=p[g];if(!v)break;const b=m[m.length-1];if(v.aborted){v.reject?.(new Error("Aborted")),g++;continue}if(a.validate(b.concat(v).map(j=>j.key))){b.push(v),g++;continue}if(b.length===0){v.reject?.(new Error("Input is too big for a single dispatch")),g++;continue}m.push([])}return m}function d(){const p=c(n);s();for(const m of p){if(!m.length)continue;const g={items:m};for(const b of m)b.batch=g;a.fetch(g.items.map(b=>b.key)).then(async b=>{await Promise.all(b.map(async(y,j)=>{const D=g.items[j];try{const w=await Promise.resolve(y);D.resolve?.(w)}catch(w){D.reject?.(w)}D.batch=null,D.reject=null,D.resolve=null}));for(const y of g.items)y.reject?.(new Error("Missing result")),y.batch=null}).catch(b=>{for(const y of g.items)y.reject?.(b),y.batch=null})}}function f(p){const m={aborted:!1,key:p,batch:null,resolve:pb,reject:pb},g=new Promise((v,b)=>{m.reject=b,m.resolve=v,n||(n=[]),n.push(m)});return l||(l=setTimeout(d)),g}return{load:f}}function yE(...a){const n=new AbortController,l=a.length;let s=0;const c=()=>{++s===l&&n.abort()};for(const d of a)d?.aborted?c():d?.addEventListener("abort",c,{once:!0});return n.signal}function Jy(a){const n=a;return n?"input"in n?n:{input:n,output:n}:{input:{serialize:l=>l,deserialize:l=>l},output:{serialize:l=>l,deserialize:l=>l}}}function jE(a){return{url:a.url.toString(),fetch:a.fetch,transformer:Jy(a.transformer),methodOverride:a.methodOverride}}function SE(a){const n={};for(let l=0;l<a.length;l++){const s=a[l];n[l]=s}return n}const wE={query:"GET",mutation:"POST",subscription:"PATCH"};function ej(a){return"input"in a?a.transformer.input.serialize(a.input):SE(a.inputs.map(n=>a.transformer.input.serialize(n)))}const tj=a=>{const n=a.url.split("?");let s=n[0].replace(/\/$/,"")+"/"+a.path;const c=[];if(n[1]&&c.push(n[1]),"inputs"in a&&c.push("batch=1"),a.type==="query"||a.type==="subscription"){const d=ej(a);d!==void 0&&a.methodOverride!=="POST"&&c.push(`input=${encodeURIComponent(JSON.stringify(d))}`)}return c.length&&(s+="?"+c.join("&")),s},CE=a=>{if(a.type==="query"&&a.methodOverride!=="POST")return;const n=ej(a);return n!==void 0?JSON.stringify(n):void 0},EE=a=>NE({...a,contentTypeHeader:"application/json",getUrl:tj,getBody:CE});class DE extends Error{constructor(){const n="AbortError";super(n),this.name=n,this.message=n}}const TE=a=>{if(a?.aborted)throw a.throwIfAborted?.(),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new DE};async function RE(a){TE(a.signal);const n=a.getUrl(a),l=a.getBody(a),{type:s}=a,c=await(async()=>{const f=await a.headers();return Symbol.iterator in f?Object.fromEntries(f):f})(),d={...a.contentTypeHeader?{"content-type":a.contentTypeHeader}:{},...a.trpcAcceptHeader?{"trpc-accept":a.trpcAcceptHeader}:void 0,...c};return xE(a.fetch)(n,{method:a.methodOverride??wE[s],signal:a.signal,body:l,headers:d})}async function NE(a){const n={},l=await RE(a);n.response=l;const s=await l.json();return n.responseJSON=s,{json:s,meta:n}}function ME(a){const n=jE(a),l=a.maxURLLength??1/0,s=a.maxItems??1/0;return()=>{const c=m=>({validate(g){if(l===1/0&&s===1/0)return!0;if(g.length>s)return!1;const v=g.map(j=>j.path).join(","),b=g.map(j=>j.input);return tj({...n,type:m,path:v,inputs:b,signal:null}).length<=l},async fetch(g){const v=g.map(R=>R.path).join(","),b=g.map(R=>R.input),y=yE(...g.map(R=>R.signal)),j=await EE({...n,path:v,inputs:b,type:m,headers(){return a.headers?typeof a.headers=="function"?a.headers({opList:g}):a.headers:{}},signal:y});return(Array.isArray(j.json)?j.json:g.map(()=>j.json)).map(R=>({meta:j.meta,json:R}))}}),d=gb(c("query")),f=gb(c("mutation")),p={query:d,mutation:f};return({op:m})=>ma(g=>{/* istanbul ignore if -- @preserve */if(m.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const b=p[m.type].load(m);let y;return b.then(j=>{y=j;const D=Wy(j.json,n.transformer.output);if(!D.ok){g.error(Jt.from(D.error,{meta:j.meta}));return}g.next({context:j.meta,result:D.result}),g.complete()}).catch(j=>{g.error(Jt.from(j,{meta:y?.meta}))}),()=>{}})}}function AE(a){return typeof FormData>"u"?!1:a instanceof FormData}const rf={css:{query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},ansi:{regular:{query:["\x1B[30;46m","\x1B[97;46m"],mutation:["\x1B[30;45m","\x1B[97;45m"],subscription:["\x1B[30;42m","\x1B[97;42m"]},bold:{query:["\x1B[1;30;46m","\x1B[1;97;46m"],mutation:["\x1B[1;30;45m","\x1B[1;97;45m"],subscription:["\x1B[1;30;42m","\x1B[1;97;42m"]}}};function $E(a){const{direction:n,type:l,withContext:s,path:c,id:d,input:f}=a,p=[],m=[];if(a.colorMode==="none")p.push(n==="up"?">>":"<<",l,`#${d}`,c);else if(a.colorMode==="ansi"){const[g,v]=rf.ansi.regular[l],[b,y]=rf.ansi.bold[l];p.push(n==="up"?g:v,n==="up"?">>":"<<",l,n==="up"?b:y,`#${d}`,c,"\x1B[0m")}else{const[g,v]=rf.css[l],b=`
|
|
55
|
-
background-color: #${n==="up"?g:v};
|
|
56
|
-
color: ${n==="up"?"black":"white"};
|
|
57
|
-
padding: 2px;
|
|
58
|
-
`;p.push("%c",n==="up"?">>":"<<",l,`#${d}`,`%c${c}%c`,"%O"),m.push(b,`${b}; font-weight: bold;`,`${b}; font-weight: normal;`)}return n==="up"?m.push(s?{input:f,context:a.context}:{input:f}):m.push({input:f,result:a.result,elapsedMs:a.elapsedMs,...s&&{context:a.context}}),{parts:p,args:m}}const LE=({c:a=console,colorMode:n="css",withContext:l})=>s=>{const c=s.input,d=AE(c)?Object.fromEntries(c):c,{parts:f,args:p}=$E({...s,colorMode:n,input:d,withContext:l}),m=s.direction==="down"&&s.result&&(s.result instanceof Error||"error"in s.result.result&&s.result.result.error)?"error":"log";a[m].apply(null,[f.join(" ")].concat(p))};function OE(a={}){const{enabled:n=()=>!0}=a,l=a.colorMode??(typeof window>"u"?"ansi":"css"),s=a.withContext??l==="css",{logger:c=LE({c:a.console,colorMode:l,withContext:s})}=a;return()=>({op:d,next:f})=>ma(p=>{n({...d,direction:"up"})&&c({...d,direction:"up"});const m=Date.now();function g(v){const b=Date.now()-m;n({...d,direction:"down",result:v})&&c({...d,direction:"down",elapsedMs:b,result:v})}return f(d).pipe(rE({next(v){g(v)},error(v){g(v)}})).subscribe(p)})}function vb(a){return Array.isArray(a)?a:[a]}function UE(a){return n=>{const l=vb(a.true).map(c=>c(n)),s=vb(a.false).map(c=>c(n));return c=>ma(d=>{const f=a.condition(c.op)?l:s;return Qy({op:c.op,links:f}).subscribe(d)})}}const zE={enabled:!1,closeMs:0},BE={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},_E=a=>a===0?0:Math.min(1e3*2**a,3e4),nj=(a,...n)=>typeof a=="function"?a(...n):a;function sf(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class fi extends Error{constructor(n){super(n.message,{cause:n.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,fi.prototype)}}class qE{reset(){this.timeout&&(clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}constructor(n,l){sf(this,"onTimeout",void 0),sf(this,"timeoutMs",void 0),sf(this,"timeout",void 0),this.onTimeout=n,this.timeoutMs=l}}function aj(){let a,n;return{promise:new Promise((s,c)=>{a=s,n=c}),resolve:a,reject:n}}async function FE(a){const n=await nj(a.url);if(!a.connectionParams)return n;const s=`${n.includes("?")?"&":"?"}connectionParams=1`;return n+s}async function HE(a){const n={method:"connectionParams",data:await nj(a)};return JSON.stringify(n)}function bb(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class PE{register(n,l){const{promise:s,resolve:c}=aj();return this.outgoingRequests.push({id:String(n.id),message:n,end:s,callbacks:{next:l.next,complete:()=>{l.complete(),c()},error:d=>{l.error(d),c()}}}),()=>{this.delete(n.id),l.complete(),c()}}delete(n){n!==null&&(this.outgoingRequests=this.outgoingRequests.filter(({id:l})=>l!==String(n)),delete this.pendingRequests[String(n)])}flush(){const n=this.outgoingRequests;this.outgoingRequests=[];for(const l of n)this.pendingRequests[l.id]=l;return n}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(n){return n===null?null:this.pendingRequests[String(n)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map(n=>({state:"outgoing",message:n.message,end:n.end,callbacks:n.callbacks})),...this.getPendingRequests().map(n=>({state:"pending",message:n.message,end:n.end,callbacks:n.callbacks}))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasOutgoingRequests(){return this.outgoingRequests.length>0}constructor(){bb(this,"outgoingRequests",new Array),bb(this,"pendingRequests",{})}}function qi(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}function IE(a){const{promise:n,resolve:l,reject:s}=aj();return a.addEventListener("open",()=>{a.removeEventListener("error",s),l()}),a.addEventListener("error",s),n}function kE(a,{intervalMs:n,pongTimeoutMs:l}){let s,c;function d(){s=setTimeout(()=>{a.send("PING"),c=setTimeout(()=>{a.close()},l)},n)}function f(){clearTimeout(s),d()}function p(){clearTimeout(c),f()}a.addEventListener("open",d),a.addEventListener("message",({data:m})=>{clearTimeout(s),d(),m==="PONG"&&p()}),a.addEventListener("close",()=>{clearTimeout(s),clearTimeout(c)})}class fs{get ws(){return this.wsObservable.get()}set ws(n){this.wsObservable.next(n)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++fs.connectCount;const n=FE(this.urlOptions).then(l=>new this.WebSocketPonyfill(l));this.openPromise=n.then(async l=>{this.ws=l,l.addEventListener("message",function({data:s}){s==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&kE(l,this.keepAliveOpts),l.addEventListener("close",()=>{this.ws===l&&(this.ws=null)}),await IE(l),this.urlOptions.connectionParams&&l.send(await HE(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(n){if(qi(this,"id",++fs.connectCount),qi(this,"WebSocketPonyfill",void 0),qi(this,"urlOptions",void 0),qi(this,"keepAliveOpts",void 0),qi(this,"wsObservable",Xy(null)),qi(this,"openPromise",null),this.WebSocketPonyfill=n.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=n.urlOptions,this.keepAliveOpts=n.keepAlive}}qi(fs,"connectCount",0);function VE(a){return a.isOpen()?{id:a.id,state:"open",ws:a.ws}:a.isClosed()?{id:a.id,state:"closed",ws:a.ws}:a.ws?{id:a.id,state:"connecting",ws:a.ws}:null}function Ba(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class GE{async open(){this.allowReconnect=!0,this.connectionState.get().state!=="connecting"&&this.connectionState.next({type:"state",state:"connecting",error:null});try{await this.activeConnection.open()}catch(n){return this.reconnect(new fi({message:"Initialization error",cause:n})),this.reconnecting}}async close(){this.allowReconnect=!1,this.inactivityTimeout.stop();const n=[];for(const l of this.requestManager.getRequests())l.message.method==="subscription"?l.callbacks.complete():l.state==="outgoing"?l.callbacks.error(Jt.from(new fi({message:"Closed before connection was established"}))):n.push(l.end);await Promise.all(n).catch(()=>null),await this.activeConnection.close().catch(()=>null),this.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:n,type:l,path:s,input:c,signal:d},transformer:f,lastEventId:p}){return ma(m=>{const g=this.batchSend({id:n,method:l,params:{input:f.input.serialize(c),path:s,lastEventId:p}},{...m,next(v){const b=Wy(v,f.output);if(!b.ok){m.error(Jt.from(b.error));return}m.next({result:b.result})}});return()=>{g(),l==="subscription"&&this.activeConnection.isOpen()&&this.send({id:n,method:"subscription.stop"}),d?.removeEventListener("abort",g)}})}get connection(){return VE(this.activeConnection)}reconnect(n){if(this.connectionState.next({type:"state",state:"connecting",error:Jt.from(n)}),this.reconnecting)return;const l=async s=>{try{await db(this.reconnectRetryDelay(s)),this.allowReconnect&&(await this.activeConnection.close(),await this.activeConnection.open(),this.requestManager.hasPendingRequests()&&this.send(this.requestManager.getPendingRequests().map(({message:c})=>c))),this.reconnecting=null}catch{await l(s+1)}};this.reconnecting=l(0)}setupWebSocketListeners(n){const l=s=>{const c=this.requestManager.getPendingRequests();for(const{message:d,callbacks:f}of c)d.method!=="subscription"&&(f.error(Jt.from(s??new fi({message:"WebSocket closed",cause:s}))),this.requestManager.delete(d.id))};n.addEventListener("open",()=>{ub(async()=>{this.lazyMode&&this.inactivityTimeout.start(),this.callbacks.onOpen?.(),this.connectionState.next({type:"state",state:"pending",error:null})}).catch(s=>{n.close(3e3),l(s)})}),n.addEventListener("message",({data:s})=>{if(this.inactivityTimeout.reset(),typeof s!="string"||["PING","PONG"].includes(s))return;const c=JSON.parse(s);if("method"in c){this.handleIncomingRequest(c);return}this.handleResponseMessage(c)}),n.addEventListener("close",s=>{l(s),this.callbacks.onClose?.(s),this.lazyMode||this.reconnect(new fi({message:"WebSocket closed",cause:s}))}),n.addEventListener("error",s=>{l(s),this.callbacks.onError?.(s),this.reconnect(new fi({message:"WebSocket closed",cause:s}))})}handleResponseMessage(n){const l=this.requestManager.getPendingRequest(n.id);if(!l)return;l.callbacks.next(n);let s=!0;"result"in n&&l.message.method==="subscription"&&(n.result.type==="data"&&(l.message.params.lastEventId=n.result.id),n.result.type!=="stopped"&&(s=!1)),s&&(l.callbacks.complete(),this.requestManager.delete(n.id))}handleIncomingRequest(n){n.method==="reconnect"&&this.reconnect(new fi({message:"Server requested reconnect"}))}send(n){if(!this.activeConnection.isOpen())throw new Error("Active connection is not open");const l=n instanceof Array?n:[n];this.activeConnection.ws.send(JSON.stringify(l.length===1?l[0]:l))}batchSend(n,l){return this.inactivityTimeout.reset(),ub(async()=>{this.activeConnection.isOpen()||await this.open(),await db(0),this.requestManager.hasOutgoingRequests()&&this.send(this.requestManager.flush().map(({message:s})=>s))}).catch(s=>{this.requestManager.delete(n.id),l.error(Jt.from(s))}),this.requestManager.register(n,l)}constructor(n){Ba(this,"connectionState",void 0),Ba(this,"allowReconnect",!1),Ba(this,"requestManager",new PE),Ba(this,"activeConnection",void 0),Ba(this,"reconnectRetryDelay",void 0),Ba(this,"inactivityTimeout",void 0),Ba(this,"callbacks",void 0),Ba(this,"lazyMode",void 0),Ba(this,"reconnecting",null),this.callbacks={onOpen:n.onOpen,onClose:n.onClose,onError:n.onError};const l={...zE,...n.lazy};this.inactivityTimeout=new qE(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},l.closeMs),this.activeConnection=new fs({WebSocketPonyfill:n.WebSocket,urlOptions:n,keepAlive:{...BE,...n.keepAlive}}),this.activeConnection.wsObservable.subscribe({next:s=>{s&&this.setupWebSocketListeners(s)}}),this.reconnectRetryDelay=n.retryDelayMs??_E,this.lazyMode=l.enabled,this.connectionState=Xy({type:"state",state:l.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch(()=>null)}}function YE(a){return new GE(a)}function XE(a){const{client:n}=a,l=Jy(a.transformer);return()=>({op:s})=>ma(c=>{const d=s.type==="subscription"?n.connectionState.subscribe({next(p){c.next({result:p,context:s.context})}}):null,f=n.request({op:s,transformer:l}).subscribe(c);return()=>{f.unsubscribe(),d?.unsubscribe()}})}class ua extends Error{constructor(n,l){super(n),this.title=l,this.name="UserVisibleError"}}class xb extends ua{constructor(n){super(`Cannot delete because of references: ${n.map(l=>l.ref.path.join(".")).join(", ")}`),this.issues=n}}class ij extends ua{constructor(n="The item you are looking for could not be found"){super(n,"Not found")}}function QE(a){return a.issues.map(l=>{const{path:s,message:c}=l;return`${s.join(".")}: ${c}`}).join("; ")}function KE(a){if(a instanceof Jt){const n=a;if(n.data?.isUserVisible&&n.message)return[n.message,n.data.descriptionText].filter(Boolean).join(`
|
|
59
|
-
`);if(n.message.includes("Failed to fetch"))return"Could not connect to the server. Please start the server and try again."}return a instanceof ua?a.message:"Check console logs for more details."}function Vl(a,n="Sorry, something went wrong."){const l=KE(a);return`${n} ${l}`}function wn(a,n){return Bl(a),Vl(a,n)}function ZE(a){return typeof a=="string"?new TextEncoder().encode(a):a}async function lj(a){const n=ZE(a),l=await crypto.subtle.digest("SHA-256",n);return[...new Uint8Array(l)].map(c=>c.toString(16).padStart(2,"0")).join("")}class WE{listenerMap=new Map;eventEmitterAbortController=new AbortController;on(n,l,s){const{signal:c}=s??{},d=this.listenerMap.get(n)??[];this.listenerMap.set(n,[...d,l]);const f=()=>{const p=(this.listenerMap.get(n)??[]).filter(m=>m!==l);p.length>0?this.listenerMap.set(n,p):this.listenerMap.delete(n)};return c?.addEventListener("abort",f,{once:!0}),f}async*onAsync(n,l){const s=[];let c,d=!1;const f=this.eventEmitterAbortController.signal;if(l.signal?.aborted||f.aborted)return;function p(){d=!0,c?.(void 0)}for(l.signal?.addEventListener("abort",p,{once:!0}),f.addEventListener("abort",p,{once:!0}),this.on(n,m=>{c?(c(m),c=void 0):s.push(m)},{signal:l.signal});!d;){const m=s.shift()??await new Promise(g=>{c=g});if(d)break;yield m}}emit(n,l){const s=this.listenerMap.get(n)??[];for(const c of s)c(l)}clearListeners(){this.listenerMap.clear(),this.eventEmitterAbortController.abort()}abortEventEmitter(){this.eventEmitterAbortController.abort()}}function JE(){return new WE}function e6(a,n){let l=a[0],s=-1/0;for(let c=0;c<a.length;c++){const d=a[c],f=n(d);f>s&&(s=f,l=d)}return l}const t6=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function n6(a){return Array.from(a.match(t6)??[])}function _l(a){const n=n6(a);if(n.length===0)return"";const[l,...s]=n;return`${l.toLowerCase()}${s.map(c=>kw(c)).join("")}`}function yb(a){return a.substring(0,1).toUpperCase()+a.substring(1)}function a6(a){return a instanceof Jt}function jb({maxAttempts:a=5}){return()=>({op:n,next:l})=>ma(s=>{let c=null,d=a,f=!1;function p(){c?.unsubscribe(),c=l(n).subscribe({error(m){m.message.includes("Failed to execute")&&d!==0?(d--,setTimeout(p,500)):s.error(m)},next(m){s.next(m)},complete(){f&&s.complete()}})}return p(),()=>{f=!0,c?.unsubscribe()}})}const Lm=JE(),i6=YE({url:`${globalThis.location.origin.replace(/^http/,"ws")}/trpc`,onOpen(){Lm.emit("open",void 0)}}),Lt=bE({links:[UE({condition:a=>a.type==="subscription",true:[OE({enabled:a=>a.direction==="down"&&a.result instanceof Error}),jb({}),XE({client:i6})],false:[jb({maxAttempts:10}),ME({url:"/trpc"})]})]}),{toast:l6}=await C("@baseplate-dev/ui-components"),{useEffect:of,useRef:Po,useState:r6}=await C("react"),rj=({className:a})=>{const[n,l]=r6(""),s=Po(!0),c=Po(null),d=Po(null),{currentProjectId:f}=Cn();of(()=>{f&&(qn||Lt.sync.getCurrentSyncConsoleOutput.query({id:f}).then(g=>{l(v=>{const b=g.join(`
|
|
60
|
-
`);return v===b?v:v?`${b}
|
|
61
|
-
${v}`:b})}).catch(g=>{l6.error(Vl(g,"Error loading sync console output"))}))},[f]),of(()=>{if(!f)return;const g=Lt.sync.onConsoleEmitted.subscribe({id:f},{onData:b=>{l(y=>y?`${y}
|
|
62
|
-
${b.message}`:b.message)}}),v=Lt.sync.onSyncStarted.subscribe({id:f},{onData:()=>{l("")}});return()=>{g.unsubscribe(),v.unsubscribe()}},[f]),of(()=>{s.current&&d.current?.scrollIntoView({behavior:"smooth"})},[n]);const p=Po(0),m=g=>{const v=c.current;p.current>g.currentTarget.scrollTop?s.current=!1:v&&v.scrollHeight-v.scrollTop-v.clientHeight<1&&(s.current=!0),p.current=g.currentTarget.scrollTop};return o.jsxs("code",{className:Te("border-gray-200 bg-slate-900 text-neutral-400 block h-72 w-full overflow-y-scroll border p-4 text-sm break-words whitespace-pre-wrap shadow-inner",a),ref:c,onScroll:m,children:[o.jsx(qC,{text:n}),o.jsx("div",{ref:d})]})};rj.displayName="Console";const{Alert:s6,Button:o6,Dialog:c6,DialogContent:u6,DialogHeader:d6,DialogTitle:f6,FormItem:h6,FormLabel:m6,FormMessage:p6}=await C("@baseplate-dev/ui-components"),{useState:g6}=await C("react");function hs({className:a,onChange:n,renderTable:l,renderForm:s,value:c,itemName:d,defaultValue:f={}}){const[p,m]=g6(),g=c??[],v=b=>{p?.idx===void 0?n([...g,b]):n(g.map((y,j)=>j===p.idx?b:y)),m(void 0)};return o.jsxs("div",{className:Te("space-y-2",a),children:[o.jsx(o6,{size:"sm",onClick:()=>{m({data:f})},children:"Add Item"}),g.length>0?l({items:g,edit:b=>{m({idx:b,data:g[b]})},remove:b=>{n(g.filter((y,j)=>j!==b))}}):o.jsx(s6,{variant:"default",children:"No items currently"}),o.jsx(c6,{open:!!p,onOpenChange:b=>{b||m(void 0)},children:o.jsxs(u6,{"aria-describedby":void 0,children:[o.jsx(d6,{children:o.jsxs(f6,{children:["Edit ",d??"Item"]})}),s({initialData:p?.data,onSubmit:v})]})})]})}hs.Labelled=function({label:n,className:l,error:s,...c}){return o.jsx("div",{className:Te("",l),children:o.jsxs(h6,{className:l,children:[n&&o.jsx(m6,{children:n}),o.jsx(hs,{...c}),o.jsx(p6,{children:s})]})})};hs.LabelledController=function({control:n,name:l,...s}){const{field:c,fieldState:{error:d}}=da({name:l,control:n});return o.jsx(hs.Labelled,{...s,error:d?.message,onChange:f=>{c.onChange(f)},value:c.value})};const{createContext:v6,Component:b6,createElement:Sb,useContext:$B,useState:LB,useMemo:OB,forwardRef:UB}=await C("react"),sj=v6(null),cf={didCatch:!1,error:null};let x6=class extends b6{constructor(n){super(n),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=cf}static getDerivedStateFromError(n){return{didCatch:!0,error:n}}resetErrorBoundary(){const{error:n}=this.state;if(n!==null){for(var l,s,c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];(l=(s=this.props).onReset)===null||l===void 0||l.call(s,{args:d,reason:"imperative-api"}),this.setState(cf)}}componentDidCatch(n,l){var s,c;(s=(c=this.props).onError)===null||s===void 0||s.call(c,n,l)}componentDidUpdate(n,l){const{didCatch:s}=this.state,{resetKeys:c}=this.props;if(s&&l.error!==null&&y6(n.resetKeys,c)){var d,f;(d=(f=this.props).onReset)===null||d===void 0||d.call(f,{next:c,prev:n.resetKeys,reason:"keys"}),this.setState(cf)}}render(){const{children:n,fallbackRender:l,FallbackComponent:s,fallback:c}=this.props,{didCatch:d,error:f}=this.state;let p=n;if(d){const m={error:f,resetErrorBoundary:this.resetErrorBoundary};if(typeof l=="function")p=l(m);else if(s)p=Sb(s,m);else if(c!==void 0)p=c;else throw f}return Sb(sj.Provider,{value:{didCatch:d,error:f,resetErrorBoundary:this.resetErrorBoundary}},p)}};function y6(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return a.length!==n.length||a.some((l,s)=>!Object.is(l,n[s]))}const{Button:j6,ErrorDisplay:S6}=await C("@baseplate-dev/ui-components"),{useContext:w6}=await C("react");function C6({resetButtonLabel:a}){const{resetErrorBoundary:n,error:l}=w6(sj)??{resetErrorBoundary:()=>{},error:void 0},s=l instanceof ua?l.title:void 0,c=!(l instanceof ua),d=Vl(l,"");return o.jsx(S6,{header:s,error:d,actions:c&&o.jsx(j6,{onClick:n,children:a})})}function Gl({children:a,resetButtonLabel:n,onReset:l}){return o.jsx(x6,{fallback:o.jsx(C6,{resetButtonLabel:n??"Reload Page"}),onError:s=>{Bl(s)},onReset:()=>{l?l():globalThis.location.reload()},children:a})}const{Button:E6,ErrorDisplay:D6}=await C("@baseplate-dev/ui-components");function Lc(){const a=cn();return o.jsx(D6,{className:"flex-1",header:"Page not found",error:"Sorry, we were unable to find the page you were looking for.",actions:o.jsx(E6,{onClick:()=>{a("/")},children:"Back to Home"})})}const{useMemo:T6}=await C("react"),oj=Sm(a=>({dialogOptions:void 0,setDialogOptions:n=>{a({dialogOptions:n})}}));function cj(){const a=oj(n=>n.setDialogOptions);return T6(()=>({showRefIssues:n=>{a(n)},clearRefIssues:()=>{a(void 0)}}),[a])}const{useEffect:R6,useRef:N6}=await C("react");function Om(a){const n=N6(void 0);return R6(()=>{n.current=a},[a]),n.current}const uj={};function M6(a,n){const l=uj[n.type.name];if(!l)return;const s=n.parentPath?.join("."),c=s?a.entities.find(d=>d.idPath.join(".")===s):void 0;return l.replace("{id}",n.id).replace("{uid}",n.type.toUid(n.id)).replace("{parentId}",c?.id??"").replace("{parentUid}",c?.type.toUid(c.id)??"")}function ys(a,n){uj[a.name]=n}const{useProjectDefinition:A6}=await C("@baseplate-dev/project-builder-lib/web"),{Button:$6,Dialog:L6,DialogContent:O6,DialogDescription:U6,DialogFooter:z6,DialogHeader:B6,DialogTitle:_6,Table:q6,TableBody:F6,TableCell:uf,TableHead:df,TableHeader:H6,TableRow:wb}=await C("@baseplate-dev/ui-components");function P6(){const{dialogOptions:a,setDialogOptions:n}=oj(),{definitionContainer:l}=A6(),{entities:s}=l,c=Om(a),{issues:d}=a??c??{};return o.jsx(L6,{open:!!a,onOpenChange:()=>{n(void 0)},children:o.jsxs(O6,{width:"lg",children:[o.jsx(B6,{children:o.jsx(_6,{children:"Unable to delete"})}),o.jsx(U6,{children:"There were other references that needed to be fixed before you could delete this item."}),o.jsxs(q6,{children:[o.jsx(H6,{children:o.jsxs(wb,{children:[o.jsx(df,{children:"Entity"}),o.jsx(df,{children:"Path"}),o.jsx(df,{children:"Referenced Entity"})]})}),o.jsx(F6,{children:d?.map(f=>{const p=s.find(y=>y.id===f.entityId),m=f.ref.path.join(".");let g;for(const y of s){const j=y.path.join(".");m.startsWith(j)&&(!g||g.path.length<j.length)&&(g=y)}const v=g?m.slice(Math.max(0,g.path.join(".").length+1)):m,b=g?M6(l,g):void 0;return o.jsxs(wb,{children:[o.jsx(uf,{children:g?o.jsxs("div",{className:"text-style-prose",children:[o.jsx("div",{children:b?o.jsx(It,{to:b,onClick:()=>{n(void 0)},children:o.jsx("strong",{children:g.name})}):o.jsx("strong",{children:g.name})}),o.jsx("div",{className:"text-muted-foreground",children:g.type.name})]}):o.jsx("strong",{children:"Root"})}),o.jsx(uf,{children:v}),o.jsx(uf,{children:p?o.jsxs("div",{children:[o.jsx("div",{children:p.name}),o.jsx("div",{className:"text-muted-foreground",children:p.type.name})]}):""})]},m)})})]}),o.jsx(z6,{children:o.jsx($6,{onClick:()=>{n(void 0)},children:"OK"})})]})})}const{useMemo:Um,useLayoutEffect:I6,useEffect:dj,useRef:Yl,useCallback:vc}=await C("react");function k6(){for(var a=arguments.length,n=new Array(a),l=0;l<a;l++)n[l]=arguments[l];return Um(()=>s=>{n.forEach(c=>c(s))},n)}const Oc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xl(a){const n=Object.prototype.toString.call(a);return n==="[object Window]"||n==="[object global]"}function zm(a){return"nodeType"in a}function un(a){var n,l;return a?Xl(a)?a:zm(a)&&(n=(l=a.ownerDocument)==null?void 0:l.defaultView)!=null?n:window:window}function Bm(a){const{Document:n}=un(a);return a instanceof n}function js(a){return Xl(a)?!1:a instanceof un(a).HTMLElement}function fj(a){return a instanceof un(a).SVGElement}function Ql(a){return a?Xl(a)?a.document:zm(a)?Bm(a)?a:js(a)||fj(a)?a.ownerDocument:document:document:document}const fa=Oc?I6:dj;function _m(a){const n=Yl(a);return fa(()=>{n.current=a}),vc(function(){for(var l=arguments.length,s=new Array(l),c=0;c<l;c++)s[c]=arguments[c];return n.current==null?void 0:n.current(...s)},[])}function V6(){const a=Yl(null),n=vc((s,c)=>{a.current=setInterval(s,c)},[]),l=vc(()=>{a.current!==null&&(clearInterval(a.current),a.current=null)},[]);return[n,l]}function ms(a,n){n===void 0&&(n=[a]);const l=Yl(a);return fa(()=>{l.current!==a&&(l.current=a)},n),l}function Ss(a,n){const l=Yl();return Um(()=>{const s=a(l.current);return l.current=s,s},[...n])}function bc(a){const n=_m(a),l=Yl(null),s=vc(c=>{c!==l.current&&n?.(c,l.current),l.current=c},[]);return[l,s]}function um(a){const n=Yl();return dj(()=>{n.current=a},[a]),n.current}let ff={};function ws(a,n){return Um(()=>{if(n)return n;const l=ff[a]==null?0:ff[a]+1;return ff[a]=l,a+"-"+l},[a,n])}function hj(a){return function(n){for(var l=arguments.length,s=new Array(l>1?l-1:0),c=1;c<l;c++)s[c-1]=arguments[c];return s.reduce((d,f)=>{const p=Object.entries(f);for(const[m,g]of p){const v=d[m];v!=null&&(d[m]=v+a*g)}return d},{...n})}}const ql=hj(1),xc=hj(-1);function G6(a){return"clientX"in a&&"clientY"in a}function qm(a){if(!a)return!1;const{KeyboardEvent:n}=un(a.target);return n&&a instanceof n}function Y6(a){if(!a)return!1;const{TouchEvent:n}=un(a.target);return n&&a instanceof n}function dm(a){if(Y6(a)){if(a.touches&&a.touches.length){const{clientX:n,clientY:l}=a.touches[0];return{x:n,y:l}}else if(a.changedTouches&&a.changedTouches.length){const{clientX:n,clientY:l}=a.changedTouches[0];return{x:n,y:l}}}return G6(a)?{x:a.clientX,y:a.clientY}:null}const ps=Object.freeze({Translate:{toString(a){if(!a)return;const{x:n,y:l}=a;return"translate3d("+(n?Math.round(n):0)+"px, "+(l?Math.round(l):0)+"px, 0)"}},Scale:{toString(a){if(!a)return;const{scaleX:n,scaleY:l}=a;return"scaleX("+n+") scaleY("+l+")"}},Transform:{toString(a){if(a)return[ps.Translate.toString(a),ps.Scale.toString(a)].join(" ")}},Transition:{toString(a){let{property:n,duration:l,easing:s}=a;return n+" "+l+"ms "+s}}}),Cb="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function X6(a){return a.matches(Cb)?a:a.querySelector(Cb)}const Fm=await C("react"),{useState:Q6,useCallback:K6}=Fm,Z6={display:"none"};function W6(a){let{id:n,value:l}=a;return Fm.createElement("div",{id:n,style:Z6},l)}function J6(a){let{id:n,announcement:l,ariaLiveType:s="assertive"}=a;const c={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Fm.createElement("div",{id:n,style:c,role:"status","aria-live":s,"aria-atomic":!0},l)}function e5(){const[a,n]=Q6("");return{announce:K6(s=>{s!=null&&n(s)},[]),announcement:a}}const Vn=await C("react"),{createContext:Cs,useContext:Il,useEffect:yt,useState:Gn,useCallback:Xn,useMemo:Ft,useRef:Pt,memo:t5,useReducer:n5,cloneElement:BB,forwardRef:_B}=Vn,{createPortal:a5,unstable_batchedUpdates:Io}=await C("react-dom"),mj=Cs(null);function i5(a){const n=Il(mj);yt(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(a)},[a,n])}function l5(){const[a]=Gn(()=>new Set),n=Xn(s=>(a.add(s),()=>a.delete(s)),[a]);return[Xn(s=>{let{type:c,event:d}=s;a.forEach(f=>{var p;return(p=f[c])==null?void 0:p.call(f,d)})},[a]),n]}const r5={draggable:`
|
|
63
|
-
To pick up a draggable item, press the space bar.
|
|
64
|
-
While dragging, use the arrow keys to move the item.
|
|
65
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
66
|
-
`},s5={onDragStart(a){let{active:n}=a;return"Picked up draggable item "+n.id+"."},onDragOver(a){let{active:n,over:l}=a;return l?"Draggable item "+n.id+" was moved over droppable area "+l.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(a){let{active:n,over:l}=a;return l?"Draggable item "+n.id+" was dropped over droppable area "+l.id:"Draggable item "+n.id+" was dropped."},onDragCancel(a){let{active:n}=a;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function o5(a){let{announcements:n=s5,container:l,hiddenTextDescribedById:s,screenReaderInstructions:c=r5}=a;const{announce:d,announcement:f}=e5(),p=ws("DndLiveRegion"),[m,g]=Gn(!1);if(yt(()=>{g(!0)},[]),i5(Ft(()=>({onDragStart(b){let{active:y}=b;d(n.onDragStart({active:y}))},onDragMove(b){let{active:y,over:j}=b;n.onDragMove&&d(n.onDragMove({active:y,over:j}))},onDragOver(b){let{active:y,over:j}=b;d(n.onDragOver({active:y,over:j}))},onDragEnd(b){let{active:y,over:j}=b;d(n.onDragEnd({active:y,over:j}))},onDragCancel(b){let{active:y,over:j}=b;d(n.onDragCancel({active:y,over:j}))}}),[d,n])),!m)return null;const v=Vn.createElement(Vn.Fragment,null,Vn.createElement(W6,{id:s,value:c.draggable}),Vn.createElement(J6,{id:p,announcement:f}));return l?a5(v,l):v}var Et;(function(a){a.DragStart="dragStart",a.DragMove="dragMove",a.DragEnd="dragEnd",a.DragCancel="dragCancel",a.DragOver="dragOver",a.RegisterDroppable="registerDroppable",a.SetDroppableDisabled="setDroppableDisabled",a.UnregisterDroppable="unregisterDroppable"})(Et||(Et={}));function yc(){}const Qn=Object.freeze({x:0,y:0});function c5(a,n){return Math.sqrt(Math.pow(a.x-n.x,2)+Math.pow(a.y-n.y,2))}function u5(a,n){let{data:{value:l}}=a,{data:{value:s}}=n;return l-s}function d5(a,n){let{data:{value:l}}=a,{data:{value:s}}=n;return s-l}function f5(a,n){if(!a||a.length===0)return null;const[l]=a;return l[n]}function Eb(a,n,l){return n===void 0&&(n=a.left),l===void 0&&(l=a.top),{x:n+a.width*.5,y:l+a.height*.5}}const h5=a=>{let{collisionRect:n,droppableRects:l,droppableContainers:s}=a;const c=Eb(n,n.left,n.top),d=[];for(const f of s){const{id:p}=f,m=l.get(p);if(m){const g=c5(Eb(m),c);d.push({id:p,data:{droppableContainer:f,value:g}})}}return d.sort(u5)};function m5(a,n){const l=Math.max(n.top,a.top),s=Math.max(n.left,a.left),c=Math.min(n.left+n.width,a.left+a.width),d=Math.min(n.top+n.height,a.top+a.height),f=c-s,p=d-l;if(s<c&&l<d){const m=n.width*n.height,g=a.width*a.height,v=f*p,b=v/(m+g-v);return Number(b.toFixed(4))}return 0}const p5=a=>{let{collisionRect:n,droppableRects:l,droppableContainers:s}=a;const c=[];for(const d of s){const{id:f}=d,p=l.get(f);if(p){const m=m5(p,n);m>0&&c.push({id:f,data:{droppableContainer:d,value:m}})}}return c.sort(d5)};function g5(a,n,l){return{...a,scaleX:n&&l?n.width/l.width:1,scaleY:n&&l?n.height/l.height:1}}function pj(a,n){return a&&n?{x:a.left-n.left,y:a.top-n.top}:Qn}function v5(a){return function(l){for(var s=arguments.length,c=new Array(s>1?s-1:0),d=1;d<s;d++)c[d-1]=arguments[d];return c.reduce((f,p)=>({...f,top:f.top+a*p.y,bottom:f.bottom+a*p.y,left:f.left+a*p.x,right:f.right+a*p.x}),{...l})}}const b5=v5(1);function x5(a){if(a.startsWith("matrix3d(")){const n=a.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(a.startsWith("matrix(")){const n=a.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function y5(a,n,l){const s=x5(n);if(!s)return a;const{scaleX:c,scaleY:d,x:f,y:p}=s,m=a.left-f-(1-c)*parseFloat(l),g=a.top-p-(1-d)*parseFloat(l.slice(l.indexOf(" ")+1)),v=c?a.width/c:a.width,b=d?a.height/d:a.height;return{width:v,height:b,top:g,right:m+v,bottom:g+b,left:m}}const j5={ignoreTransform:!1};function Kl(a,n){n===void 0&&(n=j5);let l=a.getBoundingClientRect();if(n.ignoreTransform){const{transform:g,transformOrigin:v}=un(a).getComputedStyle(a);g&&(l=y5(l,g,v))}const{top:s,left:c,width:d,height:f,bottom:p,right:m}=l;return{top:s,left:c,width:d,height:f,bottom:p,right:m}}function Db(a){return Kl(a,{ignoreTransform:!0})}function S5(a){const n=a.innerWidth,l=a.innerHeight;return{top:0,left:0,right:n,bottom:l,width:n,height:l}}function w5(a,n){return n===void 0&&(n=un(a).getComputedStyle(a)),n.position==="fixed"}function C5(a,n){n===void 0&&(n=un(a).getComputedStyle(a));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(c=>{const d=n[c];return typeof d=="string"?l.test(d):!1})}function Hm(a,n){const l=[];function s(c){if(n!=null&&l.length>=n||!c)return l;if(Bm(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!js(c)||fj(c)||l.includes(c))return l;const d=un(a).getComputedStyle(c);return c!==a&&C5(c,d)&&l.push(c),w5(c,d)?l:s(c.parentNode)}return a?s(a):l}function gj(a){const[n]=Hm(a,1);return n??null}function hf(a){return!Oc||!a?null:Xl(a)?a:zm(a)?Bm(a)||a===Ql(a).scrollingElement?window:js(a)?a:null:null}function vj(a){return Xl(a)?a.scrollX:a.scrollLeft}function bj(a){return Xl(a)?a.scrollY:a.scrollTop}function fm(a){return{x:vj(a),y:bj(a)}}var $t;(function(a){a[a.Forward=1]="Forward",a[a.Backward=-1]="Backward"})($t||($t={}));function xj(a){return!Oc||!a?!1:a===document.scrollingElement}function yj(a){const n={x:0,y:0},l=xj(a)?{height:window.innerHeight,width:window.innerWidth}:{height:a.clientHeight,width:a.clientWidth},s={x:a.scrollWidth-l.width,y:a.scrollHeight-l.height},c=a.scrollTop<=n.y,d=a.scrollLeft<=n.x,f=a.scrollTop>=s.y,p=a.scrollLeft>=s.x;return{isTop:c,isLeft:d,isBottom:f,isRight:p,maxScroll:s,minScroll:n}}const E5={x:.2,y:.2};function D5(a,n,l,s,c){let{top:d,left:f,right:p,bottom:m}=l;s===void 0&&(s=10),c===void 0&&(c=E5);const{isTop:g,isBottom:v,isLeft:b,isRight:y}=yj(a),j={x:0,y:0},D={x:0,y:0},w={height:n.height*c.y,width:n.width*c.x};return!g&&d<=n.top+w.height?(j.y=$t.Backward,D.y=s*Math.abs((n.top+w.height-d)/w.height)):!v&&m>=n.bottom-w.height&&(j.y=$t.Forward,D.y=s*Math.abs((n.bottom-w.height-m)/w.height)),!y&&p>=n.right-w.width?(j.x=$t.Forward,D.x=s*Math.abs((n.right-w.width-p)/w.width)):!b&&f<=n.left+w.width&&(j.x=$t.Backward,D.x=s*Math.abs((n.left+w.width-f)/w.width)),{direction:j,speed:D}}function T5(a){if(a===document.scrollingElement){const{innerWidth:d,innerHeight:f}=window;return{top:0,left:0,right:d,bottom:f,width:d,height:f}}const{top:n,left:l,right:s,bottom:c}=a.getBoundingClientRect();return{top:n,left:l,right:s,bottom:c,width:a.clientWidth,height:a.clientHeight}}function jj(a){return a.reduce((n,l)=>ql(n,fm(l)),Qn)}function R5(a){return a.reduce((n,l)=>n+vj(l),0)}function N5(a){return a.reduce((n,l)=>n+bj(l),0)}function M5(a,n){if(n===void 0&&(n=Kl),!a)return;const{top:l,left:s,bottom:c,right:d}=n(a);gj(a)&&(c<=0||d<=0||l>=window.innerHeight||s>=window.innerWidth)&&a.scrollIntoView({block:"center",inline:"center"})}const A5=[["x",["left","right"],R5],["y",["top","bottom"],N5]];class Pm{constructor(n,l){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=Hm(l),c=jj(s);this.rect={...n},this.width=n.width,this.height=n.height;for(const[d,f,p]of A5)for(const m of f)Object.defineProperty(this,m,{get:()=>{const g=p(s),v=c[d]-g;return this.rect[m]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class as{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...l)})},this.target=n}add(n,l,s){var c;(c=this.target)==null||c.addEventListener(n,l,s),this.listeners.push([n,l,s])}}function $5(a){const{EventTarget:n}=un(a);return a instanceof n?a:Ql(a)}function mf(a,n){const l=Math.abs(a.x),s=Math.abs(a.y);return typeof n=="number"?Math.sqrt(l**2+s**2)>n:"x"in n&&"y"in n?l>n.x&&s>n.y:"x"in n?l>n.x:"y"in n?s>n.y:!1}var _n;(function(a){a.Click="click",a.DragStart="dragstart",a.Keydown="keydown",a.ContextMenu="contextmenu",a.Resize="resize",a.SelectionChange="selectionchange",a.VisibilityChange="visibilitychange"})(_n||(_n={}));function Tb(a){a.preventDefault()}function L5(a){a.stopPropagation()}var Pe;(function(a){a.Space="Space",a.Down="ArrowDown",a.Right="ArrowRight",a.Left="ArrowLeft",a.Up="ArrowUp",a.Esc="Escape",a.Enter="Enter",a.Tab="Tab"})(Pe||(Pe={}));const Sj={start:[Pe.Space,Pe.Enter],cancel:[Pe.Esc],end:[Pe.Space,Pe.Enter,Pe.Tab]},O5=(a,n)=>{let{currentCoordinates:l}=n;switch(a.code){case Pe.Right:return{...l,x:l.x+25};case Pe.Left:return{...l,x:l.x-25};case Pe.Down:return{...l,y:l.y+25};case Pe.Up:return{...l,y:l.y-25}}};class wj{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:l}}=n;this.props=n,this.listeners=new as(Ql(l)),this.windowListeners=new as(un(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(_n.Resize,this.handleCancel),this.windowListeners.add(_n.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(_n.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:l}=this.props,s=n.node.current;s&&M5(s),l(Qn)}handleKeyDown(n){if(qm(n)){const{active:l,context:s,options:c}=this.props,{keyboardCodes:d=Sj,coordinateGetter:f=O5,scrollBehavior:p="smooth"}=c,{code:m}=n;if(d.end.includes(m)){this.handleEnd(n);return}if(d.cancel.includes(m)){this.handleCancel(n);return}const{collisionRect:g}=s.current,v=g?{x:g.left,y:g.top}:Qn;this.referenceCoordinates||(this.referenceCoordinates=v);const b=f(n,{active:l,context:s.current,currentCoordinates:v});if(b){const y=xc(b,v),j={x:0,y:0},{scrollableAncestors:D}=s.current;for(const w of D){const R=n.code,{isTop:E,isRight:A,isLeft:O,isBottom:P,maxScroll:V,minScroll:G}=yj(w),T=T5(w),B={x:Math.min(R===Pe.Right?T.right-T.width/2:T.right,Math.max(R===Pe.Right?T.left:T.left+T.width/2,b.x)),y:Math.min(R===Pe.Down?T.bottom-T.height/2:T.bottom,Math.max(R===Pe.Down?T.top:T.top+T.height/2,b.y))},W=R===Pe.Right&&!A||R===Pe.Left&&!O,ne=R===Pe.Down&&!P||R===Pe.Up&&!E;if(W&&B.x!==b.x){const ae=w.scrollLeft+y.x,oe=R===Pe.Right&&ae<=V.x||R===Pe.Left&&ae>=G.x;if(oe&&!y.y){w.scrollTo({left:ae,behavior:p});return}oe?j.x=w.scrollLeft-ae:j.x=R===Pe.Right?w.scrollLeft-V.x:w.scrollLeft-G.x,j.x&&w.scrollBy({left:-j.x,behavior:p});break}else if(ne&&B.y!==b.y){const ae=w.scrollTop+y.y,oe=R===Pe.Down&&ae<=V.y||R===Pe.Up&&ae>=G.y;if(oe&&!y.x){w.scrollTo({top:ae,behavior:p});return}oe?j.y=w.scrollTop-ae:j.y=R===Pe.Down?w.scrollTop-V.y:w.scrollTop-G.y,j.y&&w.scrollBy({top:-j.y,behavior:p});break}}this.handleMove(n,ql(xc(b,this.referenceCoordinates),j))}}}handleMove(n,l){const{onMove:s}=this.props;n.preventDefault(),s(l)}handleEnd(n){const{onEnd:l}=this.props;n.preventDefault(),this.detach(),l()}handleCancel(n){const{onCancel:l}=this.props;n.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}wj.activators=[{eventName:"onKeyDown",handler:(a,n,l)=>{let{keyboardCodes:s=Sj,onActivation:c}=n,{active:d}=l;const{code:f}=a.nativeEvent;if(s.start.includes(f)){const p=d.activatorNode.current;return p&&a.target!==p?!1:(a.preventDefault(),c?.({event:a.nativeEvent}),!0)}return!1}}];function Rb(a){return!!(a&&"distance"in a)}function Nb(a){return!!(a&&"delay"in a)}class Im{constructor(n,l,s){var c;s===void 0&&(s=$5(n.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=n,this.events=l;const{event:d}=n,{target:f}=d;this.props=n,this.events=l,this.document=Ql(f),this.documentListeners=new as(this.document),this.listeners=new as(s),this.windowListeners=new as(un(f)),this.initialCoordinates=(c=dm(d))!=null?c:Qn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:n,props:{options:{activationConstraint:l,bypassActivationConstraint:s}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(_n.Resize,this.handleCancel),this.windowListeners.add(_n.DragStart,Tb),this.windowListeners.add(_n.VisibilityChange,this.handleCancel),this.windowListeners.add(_n.ContextMenu,Tb),this.documentListeners.add(_n.Keydown,this.handleKeydown),l){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Nb(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(Rb(l)){this.handlePending(l);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(n,l){const{active:s,onPending:c}=this.props;c(s,n,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:n}=this,{onStart:l}=this.props;n&&(this.activated=!0,this.documentListeners.add(_n.Click,L5,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(_n.SelectionChange,this.removeTextSelection),l(n))}handleMove(n){var l;const{activated:s,initialCoordinates:c,props:d}=this,{onMove:f,options:{activationConstraint:p}}=d;if(!c)return;const m=(l=dm(n))!=null?l:Qn,g=xc(c,m);if(!s&&p){if(Rb(p)){if(p.tolerance!=null&&mf(g,p.tolerance))return this.handleCancel();if(mf(g,p.distance))return this.handleStart()}if(Nb(p)&&mf(g,p.tolerance))return this.handleCancel();this.handlePending(p,g);return}n.cancelable&&n.preventDefault(),f(m)}handleEnd(){const{onAbort:n,onEnd:l}=this.props;this.detach(),this.activated||n(this.props.active),l()}handleCancel(){const{onAbort:n,onCancel:l}=this.props;this.detach(),this.activated||n(this.props.active),l()}handleKeydown(n){n.code===Pe.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const U5={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Cj extends Im{constructor(n){const{event:l}=n,s=Ql(l.target);super(n,U5,s)}}Cj.activators=[{eventName:"onPointerDown",handler:(a,n)=>{let{nativeEvent:l}=a,{onActivation:s}=n;return!l.isPrimary||l.button!==0?!1:(s?.({event:l}),!0)}}];const z5={move:{name:"mousemove"},end:{name:"mouseup"}};var hm;(function(a){a[a.RightClick=2]="RightClick"})(hm||(hm={}));class B5 extends Im{constructor(n){super(n,z5,Ql(n.event.target))}}B5.activators=[{eventName:"onMouseDown",handler:(a,n)=>{let{nativeEvent:l}=a,{onActivation:s}=n;return l.button===hm.RightClick?!1:(s?.({event:l}),!0)}}];const pf={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _5 extends Im{constructor(n){super(n,pf)}static setup(){return window.addEventListener(pf.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(pf.move.name,n)};function n(){}}}_5.activators=[{eventName:"onTouchStart",handler:(a,n)=>{let{nativeEvent:l}=a,{onActivation:s}=n;const{touches:c}=l;return c.length>1?!1:(s?.({event:l}),!0)}}];var is;(function(a){a[a.Pointer=0]="Pointer",a[a.DraggableRect=1]="DraggableRect"})(is||(is={}));var jc;(function(a){a[a.TreeOrder=0]="TreeOrder",a[a.ReversedTreeOrder=1]="ReversedTreeOrder"})(jc||(jc={}));function q5(a){let{acceleration:n,activator:l=is.Pointer,canScroll:s,draggingRect:c,enabled:d,interval:f=5,order:p=jc.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:v,delta:b,threshold:y}=a;const j=H5({delta:b,disabled:!d}),[D,w]=V6(),R=Pt({x:0,y:0}),E=Pt({x:0,y:0}),A=Ft(()=>{switch(l){case is.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case is.DraggableRect:return c}},[l,c,m]),O=Pt(null),P=Xn(()=>{const G=O.current;if(!G)return;const T=R.current.x*E.current.x,B=R.current.y*E.current.y;G.scrollBy(T,B)},[]),V=Ft(()=>p===jc.TreeOrder?[...g].reverse():g,[p,g]);yt(()=>{if(!d||!g.length||!A){w();return}for(const G of V){if(s?.(G)===!1)continue;const T=g.indexOf(G),B=v[T];if(!B)continue;const{direction:W,speed:ne}=D5(G,B,A,n,y);for(const ae of["x","y"])j[ae][W[ae]]||(ne[ae]=0,W[ae]=0);if(ne.x>0||ne.y>0){w(),O.current=G,D(P,f),R.current=ne,E.current=W;return}}R.current={x:0,y:0},E.current={x:0,y:0},w()},[n,P,s,w,d,f,JSON.stringify(A),JSON.stringify(j),D,g,V,v,JSON.stringify(y)])}const F5={x:{[$t.Backward]:!1,[$t.Forward]:!1},y:{[$t.Backward]:!1,[$t.Forward]:!1}};function H5(a){let{delta:n,disabled:l}=a;const s=um(n);return Ss(c=>{if(l||!s||!c)return F5;const d={x:Math.sign(n.x-s.x),y:Math.sign(n.y-s.y)};return{x:{[$t.Backward]:c.x[$t.Backward]||d.x===-1,[$t.Forward]:c.x[$t.Forward]||d.x===1},y:{[$t.Backward]:c.y[$t.Backward]||d.y===-1,[$t.Forward]:c.y[$t.Forward]||d.y===1}}},[l,n,s])}function P5(a,n){const l=n!=null?a.get(n):void 0,s=l?l.node.current:null;return Ss(c=>{var d;return n==null?null:(d=s??c)!=null?d:null},[s,n])}function I5(a,n){return Ft(()=>a.reduce((l,s)=>{const{sensor:c}=s,d=c.activators.map(f=>({eventName:f.eventName,handler:n(f.handler,s)}));return[...l,...d]},[]),[a,n])}var gs;(function(a){a[a.Always=0]="Always",a[a.BeforeDragging=1]="BeforeDragging",a[a.WhileDragging=2]="WhileDragging"})(gs||(gs={}));var mm;(function(a){a.Optimized="optimized"})(mm||(mm={}));const Mb=new Map;function k5(a,n){let{dragging:l,dependencies:s,config:c}=n;const[d,f]=Gn(null),{frequency:p,measure:m,strategy:g}=c,v=Pt(a),b=R(),y=ms(b),j=Xn(function(E){E===void 0&&(E=[]),!y.current&&f(A=>A===null?E:A.concat(E.filter(O=>!A.includes(O))))},[y]),D=Pt(null),w=Ss(E=>{if(b&&!l)return Mb;if(!E||E===Mb||v.current!==a||d!=null){const A=new Map;for(let O of a){if(!O)continue;if(d&&d.length>0&&!d.includes(O.id)&&O.rect.current){A.set(O.id,O.rect.current);continue}const P=O.node.current,V=P?new Pm(m(P),P):null;O.rect.current=V,V&&A.set(O.id,V)}return A}return E},[a,d,l,b,m]);return yt(()=>{v.current=a},[a]),yt(()=>{b||j()},[l,b]),yt(()=>{d&&d.length>0&&f(null)},[JSON.stringify(d)]),yt(()=>{b||typeof p!="number"||D.current!==null||(D.current=setTimeout(()=>{j(),D.current=null},p))},[p,b,j,...s]),{droppableRects:w,measureDroppableContainers:j,measuringScheduled:d!=null};function R(){switch(g){case gs.Always:return!1;case gs.BeforeDragging:return l;default:return!l}}}function Ej(a,n){return Ss(l=>a?l||(typeof n=="function"?n(a):a):null,[n,a])}function V5(a,n){return Ej(a,n)}function G5(a){let{callback:n,disabled:l}=a;const s=_m(n),c=Ft(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:d}=window;return new d(s)},[s,l]);return yt(()=>()=>c?.disconnect(),[c]),c}function Uc(a){let{callback:n,disabled:l}=a;const s=_m(n),c=Ft(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:d}=window;return new d(s)},[l]);return yt(()=>()=>c?.disconnect(),[c]),c}function Y5(a){return new Pm(Kl(a),a)}function Ab(a,n,l){n===void 0&&(n=Y5);const[s,c]=Gn(null);function d(){c(m=>{if(!a)return null;if(a.isConnected===!1){var g;return(g=m??l)!=null?g:null}const v=n(a);return JSON.stringify(m)===JSON.stringify(v)?m:v})}const f=G5({callback(m){if(a)for(const g of m){const{type:v,target:b}=g;if(v==="childList"&&b instanceof HTMLElement&&b.contains(a)){d();break}}}}),p=Uc({callback:d});return fa(()=>{d(),a?(p?.observe(a),f?.observe(document.body,{childList:!0,subtree:!0})):(p?.disconnect(),f?.disconnect())},[a]),s}function X5(a){const n=Ej(a);return pj(a,n)}const $b=[];function Q5(a){const n=Pt(a),l=Ss(s=>a?s&&s!==$b&&a&&n.current&&a.parentNode===n.current.parentNode?s:Hm(a):$b,[a]);return yt(()=>{n.current=a},[a]),l}function K5(a){const[n,l]=Gn(null),s=Pt(a),c=Xn(d=>{const f=hf(d.target);f&&l(p=>p?(p.set(f,fm(f)),new Map(p)):null)},[]);return yt(()=>{const d=s.current;if(a!==d){f(d);const p=a.map(m=>{const g=hf(m);return g?(g.addEventListener("scroll",c,{passive:!0}),[g,fm(g)]):null}).filter(m=>m!=null);l(p.length?new Map(p):null),s.current=a}return()=>{f(a),f(d)};function f(p){p.forEach(m=>{const g=hf(m);g?.removeEventListener("scroll",c)})}},[c,a]),Ft(()=>a.length?n?Array.from(n.values()).reduce((d,f)=>ql(d,f),Qn):jj(a):Qn,[a,n])}function Lb(a,n){n===void 0&&(n=[]);const l=Pt(null);return yt(()=>{l.current=null},n),yt(()=>{const s=a!==Qn;s&&!l.current&&(l.current=a),!s&&l.current&&(l.current=null)},[a]),l.current?xc(a,l.current):Qn}function Z5(a){yt(()=>{if(!Oc)return;const n=a.map(l=>{let{sensor:s}=l;return s.setup==null?void 0:s.setup()});return()=>{for(const l of n)l?.()}},a.map(n=>{let{sensor:l}=n;return l}))}function W5(a,n){return Ft(()=>a.reduce((l,s)=>{let{eventName:c,handler:d}=s;return l[c]=f=>{d(f,n)},l},{}),[a,n])}function Dj(a){return Ft(()=>a?S5(a):null,[a])}const Ob=[];function J5(a,n){n===void 0&&(n=Kl);const[l]=a,s=Dj(l?un(l):null),[c,d]=Gn(Ob);function f(){d(()=>a.length?a.map(m=>xj(m)?s:new Pm(n(m),m)):Ob)}const p=Uc({callback:f});return fa(()=>{p?.disconnect(),f(),a.forEach(m=>p?.observe(m))},[a]),c}function e3(a){if(!a)return null;if(a.children.length>1)return a;const n=a.children[0];return js(n)?n:a}function t3(a){let{measure:n}=a;const[l,s]=Gn(null),c=Xn(g=>{for(const{target:v}of g)if(js(v)){s(b=>{const y=n(v);return b?{...b,width:y.width,height:y.height}:y});break}},[n]),d=Uc({callback:c}),f=Xn(g=>{const v=e3(g);d?.disconnect(),v&&d?.observe(v),s(v?n(v):null)},[n,d]),[p,m]=bc(f);return Ft(()=>({nodeRef:p,rect:l,setRef:m}),[l,p,m])}const n3=[{sensor:Cj,options:{}},{sensor:wj,options:{}}],a3={current:{}},mc={draggable:{measure:Db},droppable:{measure:Db,strategy:gs.WhileDragging,frequency:mm.Optimized},dragOverlay:{measure:Kl}};class ls extends Map{get(n){var l;return n!=null&&(l=super.get(n))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:l}=n;return!l})}getNodeFor(n){var l,s;return(l=(s=this.get(n))==null?void 0:s.node.current)!=null?l:void 0}}const i3={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ls,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mc,measureDroppableContainers:yc,windowRect:null,measuringScheduled:!1},l3={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yc,draggableNodes:new Map,over:null,measureDroppableContainers:yc},zc=Cs(l3),Tj=Cs(i3);function r3(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ls}}}function s3(a,n){switch(n.type){case Et.DragStart:return{...a,draggable:{...a.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case Et.DragMove:return a.draggable.active==null?a:{...a,draggable:{...a.draggable,translate:{x:n.coordinates.x-a.draggable.initialCoordinates.x,y:n.coordinates.y-a.draggable.initialCoordinates.y}}};case Et.DragEnd:case Et.DragCancel:return{...a,draggable:{...a.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Et.RegisterDroppable:{const{element:l}=n,{id:s}=l,c=new ls(a.droppable.containers);return c.set(s,l),{...a,droppable:{...a.droppable,containers:c}}}case Et.SetDroppableDisabled:{const{id:l,key:s,disabled:c}=n,d=a.droppable.containers.get(l);if(!d||s!==d.key)return a;const f=new ls(a.droppable.containers);return f.set(l,{...d,disabled:c}),{...a,droppable:{...a.droppable,containers:f}}}case Et.UnregisterDroppable:{const{id:l,key:s}=n,c=a.droppable.containers.get(l);if(!c||s!==c.key)return a;const d=new ls(a.droppable.containers);return d.delete(l),{...a,droppable:{...a.droppable,containers:d}}}default:return a}}function o3(a){let{disabled:n}=a;const{active:l,activatorEvent:s,draggableNodes:c}=Il(zc),d=um(s),f=um(l?.id);return yt(()=>{if(!n&&!s&&d&&f!=null){if(!qm(d)||document.activeElement===d.target)return;const p=c.get(f);if(!p)return;const{activatorNode:m,node:g}=p;if(!m.current&&!g.current)return;requestAnimationFrame(()=>{for(const v of[m.current,g.current]){if(!v)continue;const b=X6(v);if(b){b.focus();break}}})}},[s,n,c,f,d]),null}function c3(a,n){let{transform:l,...s}=n;return a!=null&&a.length?a.reduce((c,d)=>d({transform:c,...s}),l):l}function u3(a){return Ft(()=>({draggable:{...mc.draggable,...a?.draggable},droppable:{...mc.droppable,...a?.droppable},dragOverlay:{...mc.dragOverlay,...a?.dragOverlay}}),[a?.draggable,a?.droppable,a?.dragOverlay])}function d3(a){let{activeNode:n,measure:l,initialRect:s,config:c=!0}=a;const d=Pt(!1),{x:f,y:p}=typeof c=="boolean"?{x:c,y:c}:c;fa(()=>{if(!f&&!p||!n){d.current=!1;return}if(d.current||!s)return;const g=n?.node.current;if(!g||g.isConnected===!1)return;const v=l(g),b=pj(v,s);if(f||(b.x=0),p||(b.y=0),d.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const y=gj(g);y&&y.scrollBy({top:b.y,left:b.x})}},[n,f,p,s,l])}const Rj=Cs({...Qn,scaleX:1,scaleY:1});var hi;(function(a){a[a.Uninitialized=0]="Uninitialized",a[a.Initializing=1]="Initializing",a[a.Initialized=2]="Initialized"})(hi||(hi={}));const f3=t5(function(n){var l,s,c,d;let{id:f,accessibility:p,autoScroll:m=!0,children:g,sensors:v=n3,collisionDetection:b=p5,measuring:y,modifiers:j,...D}=n;const w=n5(s3,void 0,r3),[R,E]=w,[A,O]=l5(),[P,V]=Gn(hi.Uninitialized),G=P===hi.Initialized,{draggable:{active:T,nodes:B,translate:W},droppable:{containers:ne}}=R,ae=T!=null?B.get(T):null,oe=Pt({initial:null,translated:null}),se=Ft(()=>{var nt;return T!=null?{id:T,data:(nt=ae?.data)!=null?nt:a3,rect:oe}:null},[T,ae]),Z=Pt(null),[J,U]=Gn(null),[F,X]=Gn(null),te=ms(D,Object.values(D)),re=ws("DndDescribedBy",f),ve=Ft(()=>ne.getEnabled(),[ne]),ie=u3(y),{droppableRects:ue,measureDroppableContainers:we,measuringScheduled:Se}=k5(ve,{dragging:G,dependencies:[W.x,W.y],config:ie.droppable}),Ue=P5(B,T),Ot=Ft(()=>F?dm(F):null,[F]),Dt=ya(),Tt=V5(Ue,ie.draggable.measure);d3({activeNode:T!=null?B.get(T):null,config:Dt.layoutShiftCompensation,initialRect:Tt,measure:ie.draggable.measure});const Be=Ab(Ue,ie.draggable.measure,Tt),En=Ab(Ue?Ue.parentElement:null),Ie=Pt({activatorEvent:null,active:null,activeNode:Ue,collisionRect:null,collisions:null,droppableRects:ue,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:ne,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ut=ne.getNodeFor((l=Ie.current.over)==null?void 0:l.id),Vt=t3({measure:ie.dragOverlay.measure}),Jn=(s=Vt.nodeRef.current)!=null?s:Ue,Gt=G?(c=Vt.rect)!=null?c:Be:null,Xt=!!(Vt.nodeRef.current&&Vt.rect),Ki=X5(Xt?null:Be),pa=Dj(Jn?un(Jn):null),dn=Q5(G?Ut??Ue:null),Fn=J5(dn),Ha=c3(j,{transform:{x:W.x-Ki.x,y:W.y-Ki.y,scaleX:1,scaleY:1},activatorEvent:F,active:se,activeNodeRect:Be,containerNodeRect:En,draggingNodeRect:Gt,over:Ie.current.over,overlayNodeRect:Vt.rect,scrollableAncestors:dn,scrollableAncestorRects:Fn,windowRect:pa}),vi=Ot?ql(Ot,W):null,Dn=K5(dn),ga=Lb(Dn),ea=Lb(Dn,[Be]),rt=ql(Ha,ga),st=Gt?b5(Gt,Ha):null,Ve=se&&st?b({active:se,collisionRect:st,droppableRects:ue,droppableContainers:ve,pointerCoordinates:vi}):null,bi=f5(Ve,"id"),[Qt,Zi]=Gn(null),Kt=Xt?Ha:ql(Ha,ea),va=g5(Kt,(d=Qt?.rect)!=null?d:null,Be),tn=Pt(null),ta=Xn((nt,zt)=>{let{sensor:jt,options:fn}=zt;if(Z.current==null)return;const St=B.get(Z.current);if(!St)return;const dt=nt.nativeEvent,Rt=new jt({active:Z.current,activeNode:St,event:dt,options:fn,context:Ie,onAbort(Ze){if(!B.get(Ze))return;const{onDragAbort:L}=te.current,H={id:Ze};L?.(H),A({type:"onDragAbort",event:H})},onPending(Ze,M,L,H){if(!B.get(Ze))return;const{onDragPending:le}=te.current,he={id:Ze,constraint:M,initialCoordinates:L,offset:H};le?.(he),A({type:"onDragPending",event:he})},onStart(Ze){const M=Z.current;if(M==null)return;const L=B.get(M);if(!L)return;const{onDragStart:H}=te.current,ee={activatorEvent:dt,active:{id:M,data:L.data,rect:oe}};Io(()=>{H?.(ee),V(hi.Initializing),E({type:Et.DragStart,initialCoordinates:Ze,active:M}),A({type:"onDragStart",event:ee}),U(tn.current),X(dt)})},onMove(Ze){E({type:Et.DragMove,coordinates:Ze})},onEnd:na(Et.DragEnd),onCancel:na(Et.DragCancel)});tn.current=Rt;function na(Ze){return async function(){const{active:L,collisions:H,over:ee,scrollAdjustedTranslate:le}=Ie.current;let he=null;if(L&&le){const{cancelDrop:xe}=te.current;he={activatorEvent:dt,active:L,collisions:H,delta:le,over:ee},Ze===Et.DragEnd&&typeof xe=="function"&&await Promise.resolve(xe(he))&&(Ze=Et.DragCancel)}Z.current=null,Io(()=>{E({type:Ze}),V(hi.Uninitialized),Zi(null),U(null),X(null),tn.current=null;const xe=Ze===Et.DragEnd?"onDragEnd":"onDragCancel";if(he){const ce=te.current[xe];ce?.(he),A({type:xe,event:he})}})}}},[B]),ba=Xn((nt,zt)=>(jt,fn)=>{const St=jt.nativeEvent,dt=B.get(fn);if(Z.current!==null||!dt||St.dndKit||St.defaultPrevented)return;const Rt={active:dt};nt(jt,zt.options,Rt)===!0&&(St.dndKit={capturedBy:zt.sensor},Z.current=fn,ta(jt,zt))},[B,ta]),xi=I5(v,ba);Z5(v),fa(()=>{Be&&P===hi.Initializing&&V(hi.Initialized)},[Be,P]),yt(()=>{const{onDragMove:nt}=te.current,{active:zt,activatorEvent:jt,collisions:fn,over:St}=Ie.current;if(!zt||!jt)return;const dt={active:zt,activatorEvent:jt,collisions:fn,delta:{x:rt.x,y:rt.y},over:St};Io(()=>{nt?.(dt),A({type:"onDragMove",event:dt})})},[rt.x,rt.y]),yt(()=>{const{active:nt,activatorEvent:zt,collisions:jt,droppableContainers:fn,scrollAdjustedTranslate:St}=Ie.current;if(!nt||Z.current==null||!zt||!St)return;const{onDragOver:dt}=te.current,Rt=fn.get(bi),na=Rt&&Rt.rect.current?{id:Rt.id,rect:Rt.rect.current,data:Rt.data,disabled:Rt.disabled}:null,Ze={active:nt,activatorEvent:zt,collisions:jt,delta:{x:St.x,y:St.y},over:na};Io(()=>{Zi(na),dt?.(Ze),A({type:"onDragOver",event:Ze})})},[bi]),fa(()=>{Ie.current={activatorEvent:F,active:se,activeNode:Ue,collisionRect:st,collisions:Ve,droppableRects:ue,draggableNodes:B,draggingNode:Jn,draggingNodeRect:Gt,droppableContainers:ne,over:Qt,scrollableAncestors:dn,scrollAdjustedTranslate:rt},oe.current={initial:Gt,translated:st}},[se,Ue,Ve,st,B,Jn,Gt,ue,ne,Qt,dn,rt]),q5({...Dt,delta:W,draggingRect:st,pointerCoordinates:vi,scrollableAncestors:dn,scrollableAncestorRects:Fn});const xa=Ft(()=>({active:se,activeNode:Ue,activeNodeRect:Be,activatorEvent:F,collisions:Ve,containerNodeRect:En,dragOverlay:Vt,draggableNodes:B,droppableContainers:ne,droppableRects:ue,over:Qt,measureDroppableContainers:we,scrollableAncestors:dn,scrollableAncestorRects:Fn,measuringConfiguration:ie,measuringScheduled:Se,windowRect:pa}),[se,Ue,Be,F,Ve,En,Vt,B,ne,ue,Qt,we,dn,Fn,ie,Se,pa]),yi=Ft(()=>({activatorEvent:F,activators:xi,active:se,activeNodeRect:Be,ariaDescribedById:{draggable:re},dispatch:E,draggableNodes:B,over:Qt,measureDroppableContainers:we}),[F,xi,se,Be,E,re,B,Qt,we]);return Vn.createElement(mj.Provider,{value:O},Vn.createElement(zc.Provider,{value:yi},Vn.createElement(Tj.Provider,{value:xa},Vn.createElement(Rj.Provider,{value:va},g)),Vn.createElement(o3,{disabled:p?.restoreFocus===!1})),Vn.createElement(o5,{...p,hiddenTextDescribedById:re}));function ya(){const nt=J?.autoScrollEnabled===!1,zt=typeof m=="object"?m.enabled===!1:m===!1,jt=G&&!nt&&!zt;return typeof m=="object"?{...m,enabled:jt}:{enabled:jt}}}),h3=Cs(null),Ub="button",m3="Draggable";function p3(a){let{id:n,data:l,disabled:s=!1,attributes:c}=a;const d=ws(m3),{activators:f,activatorEvent:p,active:m,activeNodeRect:g,ariaDescribedById:v,draggableNodes:b,over:y}=Il(zc),{role:j=Ub,roleDescription:D="draggable",tabIndex:w=0}=c??{},R=m?.id===n,E=Il(R?Rj:h3),[A,O]=bc(),[P,V]=bc(),G=W5(f,n),T=ms(l);fa(()=>(b.set(n,{id:n,key:d,node:A,activatorNode:P,data:T}),()=>{const W=b.get(n);W&&W.key===d&&b.delete(n)}),[b,n]);const B=Ft(()=>({role:j,tabIndex:w,"aria-disabled":s,"aria-pressed":R&&j===Ub?!0:void 0,"aria-roledescription":D,"aria-describedby":v.draggable}),[s,j,w,R,D,v.draggable]);return{active:m,activatorEvent:p,activeNodeRect:g,attributes:B,isDragging:R,listeners:s?void 0:G,node:A,over:y,setNodeRef:O,setActivatorNodeRef:V,transform:E}}function g3(){return Il(Tj)}const v3="Droppable",b3={timeout:25};function x3(a){let{data:n,disabled:l=!1,id:s,resizeObserverConfig:c}=a;const d=ws(v3),{active:f,dispatch:p,over:m,measureDroppableContainers:g}=Il(zc),v=Pt({disabled:l}),b=Pt(!1),y=Pt(null),j=Pt(null),{disabled:D,updateMeasurementsFor:w,timeout:R}={...b3,...c},E=ms(w??s),A=Xn(()=>{if(!b.current){b.current=!0;return}j.current!=null&&clearTimeout(j.current),j.current=setTimeout(()=>{g(Array.isArray(E.current)?E.current:[E.current]),j.current=null},R)},[R]),O=Uc({callback:A,disabled:D||!f}),P=Xn((B,W)=>{O&&(W&&(O.unobserve(W),b.current=!1),B&&O.observe(B))},[O]),[V,G]=bc(P),T=ms(n);return yt(()=>{!O||!V.current||(O.disconnect(),b.current=!1,O.observe(V.current))},[V,O]),yt(()=>(p({type:Et.RegisterDroppable,element:{id:s,key:d,disabled:l,node:V,rect:y,data:T}}),()=>p({type:Et.UnregisterDroppable,key:d,id:s})),[s]),yt(()=>{l!==v.current.disabled&&(p({type:Et.SetDroppableDisabled,id:s,key:d,disabled:l}),v.current.disabled=l)},[s,d,l,p]),{active:f,rect:y,isOver:m?.id===s,node:V,over:m,setNodeRef:G}}const y3=a=>{let{transform:n}=a;return{...n,x:0}},km=await C("react"),{useMemo:Sc,useRef:Vm,useEffect:wc,useState:j3,useContext:S3}=km;function Nj(a,n,l){const s=a.slice();return s.splice(l<0?s.length+l:l,0,s.splice(n,1)[0]),s}function w3(a,n){return a.reduce((l,s,c)=>{const d=n.get(s);return d&&(l[c]=d),l},Array(a.length))}function ko(a){return a!==null&&a>=0}function C3(a,n){if(a===n)return!0;if(a.length!==n.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==n[l])return!1;return!0}function E3(a){return typeof a=="boolean"?{draggable:a,droppable:a}:a}const Mj=a=>{let{rects:n,activeIndex:l,overIndex:s,index:c}=a;const d=Nj(n,s,l),f=n[c],p=d[c];return!p||!f?null:{x:p.left-f.left,y:p.top-f.top,scaleX:p.width/f.width,scaleY:p.height/f.height}},Vo={scaleX:1,scaleY:1},D3=a=>{var n;let{activeIndex:l,activeNodeRect:s,index:c,rects:d,overIndex:f}=a;const p=(n=d[l])!=null?n:s;if(!p)return null;if(c===l){const g=d[f];return g?{x:0,y:l<f?g.top+g.height-(p.top+p.height):g.top-p.top,...Vo}:null}const m=T3(d,c,l);return c>l&&c<=f?{x:0,y:-p.height-m,...Vo}:c<l&&c>=f?{x:0,y:p.height+m,...Vo}:{x:0,y:0,...Vo}};function T3(a,n,l){const s=a[n],c=a[n-1],d=a[n+1];return s?l<n?c?s.top-(c.top+c.height):d?d.top-(s.top+s.height):0:d?d.top-(s.top+s.height):c?s.top-(c.top+c.height):0:0}const Aj="Sortable",$j=km.createContext({activeIndex:-1,containerId:Aj,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mj,disabled:{draggable:!1,droppable:!1}});function R3(a){let{children:n,id:l,items:s,strategy:c=Mj,disabled:d=!1}=a;const{active:f,dragOverlay:p,droppableRects:m,over:g,measureDroppableContainers:v}=g3(),b=ws(Aj,l),y=p.rect!==null,j=Sc(()=>s.map(G=>typeof G=="object"&&"id"in G?G.id:G),[s]),D=f!=null,w=f?j.indexOf(f.id):-1,R=g?j.indexOf(g.id):-1,E=Vm(j),A=!C3(j,E.current),O=R!==-1&&w===-1||A,P=E3(d);fa(()=>{A&&D&&v(j)},[A,j,D,v]),wc(()=>{E.current=j},[j]);const V=Sc(()=>({activeIndex:w,containerId:b,disabled:P,disableTransforms:O,items:j,overIndex:R,useDragOverlay:y,sortedRects:w3(j,m),strategy:c}),[w,b,P.draggable,P.droppable,O,j,R,m,y,c]);return km.createElement($j.Provider,{value:V},n)}const N3=a=>{let{id:n,items:l,activeIndex:s,overIndex:c}=a;return Nj(l,s,c).indexOf(n)},M3=a=>{let{containerId:n,isSorting:l,wasDragging:s,index:c,items:d,newIndex:f,previousItems:p,previousContainerId:m,transition:g}=a;return!g||!s||p!==d&&c===f?!1:l?!0:f!==c&&n===m},A3={duration:200,easing:"ease"},Lj="transform",$3=ps.Transition.toString({property:Lj,duration:0,easing:"linear"}),L3={roleDescription:"sortable"};function O3(a){let{disabled:n,index:l,node:s,rect:c}=a;const[d,f]=j3(null),p=Vm(l);return fa(()=>{if(!n&&l!==p.current&&s.current){const m=c.current;if(m){const g=Kl(s.current,{ignoreTransform:!0}),v={x:m.left-g.left,y:m.top-g.top,scaleX:m.width/g.width,scaleY:m.height/g.height};(v.x||v.y)&&f(v)}}l!==p.current&&(p.current=l)},[n,l,s,c]),wc(()=>{d&&f(null)},[d]),d}function U3(a){let{animateLayoutChanges:n=M3,attributes:l,disabled:s,data:c,getNewIndex:d=N3,id:f,strategy:p,resizeObserverConfig:m,transition:g=A3}=a;const{items:v,containerId:b,activeIndex:y,disabled:j,disableTransforms:D,sortedRects:w,overIndex:R,useDragOverlay:E,strategy:A}=S3($j),O=z3(s,j),P=v.indexOf(f),V=Sc(()=>({sortable:{containerId:b,index:P,items:v},...c}),[b,c,P,v]),G=Sc(()=>v.slice(v.indexOf(f)),[v,f]),{rect:T,node:B,isOver:W,setNodeRef:ne}=x3({id:f,data:V,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:G,...m}}),{active:ae,activatorEvent:oe,activeNodeRect:se,attributes:Z,setNodeRef:J,listeners:U,isDragging:F,over:X,setActivatorNodeRef:te,transform:re}=p3({id:f,data:V,attributes:{...L3,...l},disabled:O.draggable}),ve=k6(ne,J),ie=!!ae,ue=ie&&!D&&ko(y)&&ko(R),we=!E&&F,Se=we&&ue?re:null,Ot=ue?Se??(p??A)({rects:w,activeNodeRect:se,activeIndex:y,overIndex:R,index:P}):null,Dt=ko(y)&&ko(R)?d({id:f,items:v,activeIndex:y,overIndex:R}):P,Tt=ae?.id,Be=Vm({activeId:Tt,items:v,newIndex:Dt,containerId:b}),En=v!==Be.current.items,Ie=n({active:ae,containerId:b,isDragging:F,isSorting:ie,id:f,index:P,items:v,newIndex:Be.current.newIndex,previousItems:Be.current.items,previousContainerId:Be.current.containerId,transition:g,wasDragging:Be.current.activeId!=null}),Ut=O3({disabled:!Ie,index:P,node:B,rect:T});return wc(()=>{ie&&Be.current.newIndex!==Dt&&(Be.current.newIndex=Dt),b!==Be.current.containerId&&(Be.current.containerId=b),v!==Be.current.items&&(Be.current.items=v)},[ie,Dt,b,v]),wc(()=>{if(Tt===Be.current.activeId)return;if(Tt!=null&&Be.current.activeId==null){Be.current.activeId=Tt;return}const Jn=setTimeout(()=>{Be.current.activeId=Tt},50);return()=>clearTimeout(Jn)},[Tt]),{active:ae,activeIndex:y,attributes:Z,data:V,rect:T,index:P,newIndex:Dt,items:v,isOver:W,isSorting:ie,isDragging:F,listeners:U,node:B,overIndex:R,over:X,setNodeRef:ve,setActivatorNodeRef:te,setDroppableNodeRef:ne,setDraggableNodeRef:J,transform:Ut??Ot,transition:Vt()};function Vt(){if(Ut||En&&Be.current.newIndex===P)return $3;if(!(we&&!qm(oe)||!g)&&(ie||Ie))return ps.Transition.toString({...g,property:Lj})}}function z3(a,n){var l,s;return typeof a=="boolean"?{draggable:a,droppable:!1}:{draggable:(l=a?.draggable)!=null?l:n.draggable,droppable:(s=a?.droppable)!=null?s:n.droppable}}Pe.Down,Pe.Right,Pe.Up,Pe.Left;function B3(a){return Vi({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M2.49998 4.09998C2.27906 4.09998 2.09998 4.27906 2.09998 4.49998C2.09998 4.72089 2.27906 4.89998 2.49998 4.89998H12.5C12.7209 4.89998 12.9 4.72089 12.9 4.49998C12.9 4.27906 12.7209 4.09998 12.5 4.09998H2.49998ZM2.49998 6.09998C2.27906 6.09998 2.09998 6.27906 2.09998 6.49998C2.09998 6.72089 2.27906 6.89998 2.49998 6.89998H12.5C12.7209 6.89998 12.9 6.72089 12.9 6.49998C12.9 6.27906 12.7209 6.09998 12.5 6.09998H2.49998ZM2.09998 8.49998C2.09998 8.27906 2.27906 8.09998 2.49998 8.09998H12.5C12.7209 8.09998 12.9 8.27906 12.9 8.49998C12.9 8.72089 12.7209 8.89998 12.5 8.89998H2.49998C2.27906 8.89998 2.09998 8.72089 2.09998 8.49998ZM2.49998 10.1C2.27906 10.1 2.09998 10.2791 2.09998 10.5C2.09998 10.7209 2.27906 10.9 2.49998 10.9H12.5C12.7209 10.9 12.9 10.7209 12.9 10.5C12.9 10.2791 12.7209 10.1 12.5 10.1H2.49998Z",fill:"currentColor"},child:[]}]})(a)}const{Button:_3}=await C("@baseplate-dev/ui-components");function q3({id:a,children:n}){const{attributes:l,listeners:s,setNodeRef:c,transform:d,transition:f}=U3({id:a}),p={transform:ps.Transform.toString(d),transition:f};return o.jsxs("div",{className:"flex w-full items-center gap-2",ref:c,style:p,children:[o.jsx("div",{className:"flex w-10 items-center justify-center",...l,...s,children:o.jsx(_3,{className:"cursor-grab",variant:"ghost",size:"icon",children:o.jsx(B3,{})})}),o.jsx("div",{className:"flex-1",children:n})]})}function Oj({listItems:a,sortItems:n}){const l=({active:s,over:c})=>{if(c&&s.id!==c.id){const d=a.findIndex(p=>p.id===s.id),f=a.findIndex(p=>p.id===c.id);n(d,f)}};return o.jsx(f3,{collisionDetection:h5,onDragEnd:l,modifiers:[y3],children:o.jsx("div",{className:"flex w-full flex-col gap-4",children:o.jsx(R3,{items:a.map(({id:s})=>s),strategy:D3,children:a.map(s=>o.jsx(q3,{id:s.id,children:s.element},s.id))})})})}const Uj=await C("react"),zj=Uj.createContext(null);function Bj(){const a=Uj.useContext(zj);if(!a)throw new Error("useClientVersion must be used within a <ClientVersionContext.Provider>");return a}class Cc extends Error{constructor(n){super(`Project not found for project ID: ${n}`),this.name="ProjectNotFoundError"}}function Zl(a){return n=>{throw a6(n)&&n.data?.code==="NOT_FOUND"?new Cc(a):n}}async function F3(a){return qn?[]:Lt.plugins.getAvailablePlugins.mutate({projectId:a}).catch(Zl(a))}async function H3(a){if(qn){const s=await(await fetch("/preview-app.json")).text();return{contents:s,hash:await lj(s)}}return(await Lt.projects.readDefinition.query({id:a}).catch(Zl(a))).contents}async function P3(a,n,l){return qn?{type:"success"}:(await Lt.projects.writeDefinition.mutate({id:a,newContents:n,oldContentsHash:l}).catch(Zl(a))).result}function I3(a,n){if(qn)return()=>{};const l=Lt.projects.onProjectJsonChanged.subscribe({id:a},{onData:n});return()=>{l.unsubscribe()}}async function k3(){return qn?[{id:"preview-project",name:"Preview Project",directory:"~/preview-project"}]:Lt.projects.list.query()}async function V3(a){qn||await Lt.sync.startSync.mutate({id:a}).catch(Zl(a))}async function G3(a){return qn?{status:"success",startedAt:new Date().toISOString(),packages:{"app:NmEolDU3Iggt":{status:"not-synced",path:"packages/admin",name:"admin",order:0}}}:Lt.sync.getSyncMetadata.query({id:a}).catch(Zl(a))}async function Y3(a){qn||await Lt.sync.cancelSync.mutate({id:a}).catch(Zl(a))}async function X3(){return qn?{version:"preview",featureFlags:[],userConfig:{}}:Lt.version.get.query()}const{ErrorableLoader:Q3}=await C("@baseplate-dev/ui-components"),{useCallback:K3,useEffect:zb,useMemo:Z3,useState:Bb}=await C("react");function W3({children:a}){const[n,l]=Bb(),[s,c]=Bb(),d=K3(()=>{X3().then(m=>{l(m)}).catch(m=>{c(wn(m,"Failed to fetch version info."))})},[]);zb(()=>(d(),Lm.on("open",d)),[d]);const f=Om(n?.version);zb(()=>{n&&f&&f!==n.version&&globalThis.location.reload()},[n,f]);const p=Z3(()=>n?{version:n.version,featureFlags:n.featureFlags,userConfig:n.userConfig}:void 0,[n]);return p?o.jsx(zj.Provider,{value:p,children:a}):o.jsx(Q3,{error:s})}var Go={exports:{}},gf,_b;function Bc(){if(_b)return gf;_b=1;const a="2.0.0",n=256,l=Number.MAX_SAFE_INTEGER||9007199254740991,s=16,c=n-6;return gf={MAX_LENGTH:n,MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:l,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:a,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},gf}var vf,qb;function _c(){if(qb)return vf;qb=1;var a={};return vf=typeof process=="object"&&a&&a.NODE_DEBUG&&/\bsemver\b/i.test(a.NODE_DEBUG)?(...l)=>console.error("SEMVER",...l):()=>{},vf}var Fb;function Es(){return Fb||(Fb=1,function(a,n){const{MAX_SAFE_COMPONENT_LENGTH:l,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:c}=Bc(),d=_c();n=a.exports={};const f=n.re=[],p=n.safeRe=[],m=n.src=[],g=n.safeSrc=[],v=n.t={};let b=0;const y="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",c],[y,s]],D=R=>{for(const[E,A]of j)R=R.split(`${E}*`).join(`${E}{0,${A}}`).split(`${E}+`).join(`${E}{1,${A}}`);return R},w=(R,E,A)=>{const O=D(E),P=b++;d(R,P,E),v[R]=P,m[P]=E,g[P]=O,f[P]=new RegExp(E,A?"g":void 0),p[P]=new RegExp(O,A?"g":void 0)};w("NUMERICIDENTIFIER","0|[1-9]\\d*"),w("NUMERICIDENTIFIERLOOSE","\\d+"),w("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),w("MAINVERSION",`(${m[v.NUMERICIDENTIFIER]})\\.(${m[v.NUMERICIDENTIFIER]})\\.(${m[v.NUMERICIDENTIFIER]})`),w("MAINVERSIONLOOSE",`(${m[v.NUMERICIDENTIFIERLOOSE]})\\.(${m[v.NUMERICIDENTIFIERLOOSE]})\\.(${m[v.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASEIDENTIFIER",`(?:${m[v.NONNUMERICIDENTIFIER]}|${m[v.NUMERICIDENTIFIER]})`),w("PRERELEASEIDENTIFIERLOOSE",`(?:${m[v.NONNUMERICIDENTIFIER]}|${m[v.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASE",`(?:-(${m[v.PRERELEASEIDENTIFIER]}(?:\\.${m[v.PRERELEASEIDENTIFIER]})*))`),w("PRERELEASELOOSE",`(?:-?(${m[v.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${m[v.PRERELEASEIDENTIFIERLOOSE]})*))`),w("BUILDIDENTIFIER",`${y}+`),w("BUILD",`(?:\\+(${m[v.BUILDIDENTIFIER]}(?:\\.${m[v.BUILDIDENTIFIER]})*))`),w("FULLPLAIN",`v?${m[v.MAINVERSION]}${m[v.PRERELEASE]}?${m[v.BUILD]}?`),w("FULL",`^${m[v.FULLPLAIN]}$`),w("LOOSEPLAIN",`[v=\\s]*${m[v.MAINVERSIONLOOSE]}${m[v.PRERELEASELOOSE]}?${m[v.BUILD]}?`),w("LOOSE",`^${m[v.LOOSEPLAIN]}$`),w("GTLT","((?:<|>)?=?)"),w("XRANGEIDENTIFIERLOOSE",`${m[v.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),w("XRANGEIDENTIFIER",`${m[v.NUMERICIDENTIFIER]}|x|X|\\*`),w("XRANGEPLAIN",`[v=\\s]*(${m[v.XRANGEIDENTIFIER]})(?:\\.(${m[v.XRANGEIDENTIFIER]})(?:\\.(${m[v.XRANGEIDENTIFIER]})(?:${m[v.PRERELEASE]})?${m[v.BUILD]}?)?)?`),w("XRANGEPLAINLOOSE",`[v=\\s]*(${m[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[v.XRANGEIDENTIFIERLOOSE]})(?:${m[v.PRERELEASELOOSE]})?${m[v.BUILD]}?)?)?`),w("XRANGE",`^${m[v.GTLT]}\\s*${m[v.XRANGEPLAIN]}$`),w("XRANGELOOSE",`^${m[v.GTLT]}\\s*${m[v.XRANGEPLAINLOOSE]}$`),w("COERCEPLAIN",`(^|[^\\d])(\\d{1,${l}})(?:\\.(\\d{1,${l}}))?(?:\\.(\\d{1,${l}}))?`),w("COERCE",`${m[v.COERCEPLAIN]}(?:$|[^\\d])`),w("COERCEFULL",m[v.COERCEPLAIN]+`(?:${m[v.PRERELEASE]})?(?:${m[v.BUILD]})?(?:$|[^\\d])`),w("COERCERTL",m[v.COERCE],!0),w("COERCERTLFULL",m[v.COERCEFULL],!0),w("LONETILDE","(?:~>?)"),w("TILDETRIM",`(\\s*)${m[v.LONETILDE]}\\s+`,!0),n.tildeTrimReplace="$1~",w("TILDE",`^${m[v.LONETILDE]}${m[v.XRANGEPLAIN]}$`),w("TILDELOOSE",`^${m[v.LONETILDE]}${m[v.XRANGEPLAINLOOSE]}$`),w("LONECARET","(?:\\^)"),w("CARETTRIM",`(\\s*)${m[v.LONECARET]}\\s+`,!0),n.caretTrimReplace="$1^",w("CARET",`^${m[v.LONECARET]}${m[v.XRANGEPLAIN]}$`),w("CARETLOOSE",`^${m[v.LONECARET]}${m[v.XRANGEPLAINLOOSE]}$`),w("COMPARATORLOOSE",`^${m[v.GTLT]}\\s*(${m[v.LOOSEPLAIN]})$|^$`),w("COMPARATOR",`^${m[v.GTLT]}\\s*(${m[v.FULLPLAIN]})$|^$`),w("COMPARATORTRIM",`(\\s*)${m[v.GTLT]}\\s*(${m[v.LOOSEPLAIN]}|${m[v.XRANGEPLAIN]})`,!0),n.comparatorTrimReplace="$1$2$3",w("HYPHENRANGE",`^\\s*(${m[v.XRANGEPLAIN]})\\s+-\\s+(${m[v.XRANGEPLAIN]})\\s*$`),w("HYPHENRANGELOOSE",`^\\s*(${m[v.XRANGEPLAINLOOSE]})\\s+-\\s+(${m[v.XRANGEPLAINLOOSE]})\\s*$`),w("STAR","(<|>)?=?\\s*\\*"),w("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),w("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Go,Go.exports)),Go.exports}var bf,Hb;function Gm(){if(Hb)return bf;Hb=1;const a=Object.freeze({loose:!0}),n=Object.freeze({});return bf=s=>s?typeof s!="object"?a:s:n,bf}var xf,Pb;function _j(){if(Pb)return xf;Pb=1;const a=/^[0-9]+$/,n=(s,c)=>{const d=a.test(s),f=a.test(c);return d&&f&&(s=+s,c=+c),s===c?0:d&&!f?-1:f&&!d?1:s<c?-1:1};return xf={compareIdentifiers:n,rcompareIdentifiers:(s,c)=>n(c,s)},xf}var yf,Ib;function en(){if(Ib)return yf;Ib=1;const a=_c(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:l}=Bc(),{safeRe:s,t:c}=Es(),d=Gm(),{compareIdentifiers:f}=_j();class p{constructor(g,v){if(v=d(v),g instanceof p){if(g.loose===!!v.loose&&g.includePrerelease===!!v.includePrerelease)return g;g=g.version}else if(typeof g!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof g}".`);if(g.length>n)throw new TypeError(`version is longer than ${n} characters`);a("SemVer",g,v),this.options=v,this.loose=!!v.loose,this.includePrerelease=!!v.includePrerelease;const b=g.trim().match(v.loose?s[c.LOOSE]:s[c.FULL]);if(!b)throw new TypeError(`Invalid Version: ${g}`);if(this.raw=g,this.major=+b[1],this.minor=+b[2],this.patch=+b[3],this.major>l||this.major<0)throw new TypeError("Invalid major version");if(this.minor>l||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>l||this.patch<0)throw new TypeError("Invalid patch version");b[4]?this.prerelease=b[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const j=+y;if(j>=0&&j<l)return j}return y}):this.prerelease=[],this.build=b[5]?b[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(g){if(a("SemVer.compare",this.version,this.options,g),!(g instanceof p)){if(typeof g=="string"&&g===this.version)return 0;g=new p(g,this.options)}return g.version===this.version?0:this.compareMain(g)||this.comparePre(g)}compareMain(g){return g instanceof p||(g=new p(g,this.options)),f(this.major,g.major)||f(this.minor,g.minor)||f(this.patch,g.patch)}comparePre(g){if(g instanceof p||(g=new p(g,this.options)),this.prerelease.length&&!g.prerelease.length)return-1;if(!this.prerelease.length&&g.prerelease.length)return 1;if(!this.prerelease.length&&!g.prerelease.length)return 0;let v=0;do{const b=this.prerelease[v],y=g.prerelease[v];if(a("prerelease compare",v,b,y),b===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(b===void 0)return-1;if(b===y)continue;return f(b,y)}while(++v)}compareBuild(g){g instanceof p||(g=new p(g,this.options));let v=0;do{const b=this.build[v],y=g.build[v];if(a("build compare",v,b,y),b===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(b===void 0)return-1;if(b===y)continue;return f(b,y)}while(++v)}inc(g,v,b){if(g.startsWith("pre")){if(!v&&b===!1)throw new Error("invalid increment argument: identifier is empty");if(v){const y=`-${v}`.match(this.options.loose?s[c.PRERELEASELOOSE]:s[c.PRERELEASE]);if(!y||y[1]!==v)throw new Error(`invalid identifier: ${v}`)}}switch(g){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",v,b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",v,b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",v,b),this.inc("pre",v,b);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",v,b),this.inc("pre",v,b);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(b)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let j=this.prerelease.length;for(;--j>=0;)typeof this.prerelease[j]=="number"&&(this.prerelease[j]++,j=-2);if(j===-1){if(v===this.prerelease.join(".")&&b===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(v){let j=[v,y];b===!1&&(j=[v]),f(this.prerelease[0],v)===0?isNaN(this.prerelease[1])&&(this.prerelease=j):this.prerelease=j}break}default:throw new Error(`invalid increment argument: ${g}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return yf=p,yf}var jf,kb;function Wl(){if(kb)return jf;kb=1;const a=en();return jf=(l,s,c=!1)=>{if(l instanceof a)return l;try{return new a(l,s)}catch(d){if(!c)return null;throw d}},jf}var Sf,Vb;function J3(){if(Vb)return Sf;Vb=1;const a=Wl();return Sf=(l,s)=>{const c=a(l,s);return c?c.version:null},Sf}var wf,Gb;function eD(){if(Gb)return wf;Gb=1;const a=Wl();return wf=(l,s)=>{const c=a(l.trim().replace(/^[=v]+/,""),s);return c?c.version:null},wf}var Cf,Yb;function tD(){if(Yb)return Cf;Yb=1;const a=en();return Cf=(l,s,c,d,f)=>{typeof c=="string"&&(f=d,d=c,c=void 0);try{return new a(l instanceof a?l.version:l,c).inc(s,d,f).version}catch{return null}},Cf}var Ef,Xb;function nD(){if(Xb)return Ef;Xb=1;const a=Wl();return Ef=(l,s)=>{const c=a(l,null,!0),d=a(s,null,!0),f=c.compare(d);if(f===0)return null;const p=f>0,m=p?c:d,g=p?d:c,v=!!m.prerelease.length;if(!!g.prerelease.length&&!v){if(!g.patch&&!g.minor)return"major";if(g.compareMain(m)===0)return g.minor&&!g.patch?"minor":"patch"}const y=v?"pre":"";return c.major!==d.major?y+"major":c.minor!==d.minor?y+"minor":c.patch!==d.patch?y+"patch":"prerelease"},Ef}var Df,Qb;function aD(){if(Qb)return Df;Qb=1;const a=en();return Df=(l,s)=>new a(l,s).major,Df}var Tf,Kb;function iD(){if(Kb)return Tf;Kb=1;const a=en();return Tf=(l,s)=>new a(l,s).minor,Tf}var Rf,Zb;function lD(){if(Zb)return Rf;Zb=1;const a=en();return Rf=(l,s)=>new a(l,s).patch,Rf}var Nf,Wb;function rD(){if(Wb)return Nf;Wb=1;const a=Wl();return Nf=(l,s)=>{const c=a(l,s);return c&&c.prerelease.length?c.prerelease:null},Nf}var Mf,Jb;function Zn(){if(Jb)return Mf;Jb=1;const a=en();return Mf=(l,s,c)=>new a(l,c).compare(new a(s,c)),Mf}var Af,e1;function sD(){if(e1)return Af;e1=1;const a=Zn();return Af=(l,s,c)=>a(s,l,c),Af}var $f,t1;function oD(){if(t1)return $f;t1=1;const a=Zn();return $f=(l,s)=>a(l,s,!0),$f}var Lf,n1;function Ym(){if(n1)return Lf;n1=1;const a=en();return Lf=(l,s,c)=>{const d=new a(l,c),f=new a(s,c);return d.compare(f)||d.compareBuild(f)},Lf}var Of,a1;function cD(){if(a1)return Of;a1=1;const a=Ym();return Of=(l,s)=>l.sort((c,d)=>a(c,d,s)),Of}var Uf,i1;function uD(){if(i1)return Uf;i1=1;const a=Ym();return Uf=(l,s)=>l.sort((c,d)=>a(d,c,s)),Uf}var zf,l1;function qc(){if(l1)return zf;l1=1;const a=Zn();return zf=(l,s,c)=>a(l,s,c)>0,zf}var Bf,r1;function Xm(){if(r1)return Bf;r1=1;const a=Zn();return Bf=(l,s,c)=>a(l,s,c)<0,Bf}var _f,s1;function qj(){if(s1)return _f;s1=1;const a=Zn();return _f=(l,s,c)=>a(l,s,c)===0,_f}var qf,o1;function Fj(){if(o1)return qf;o1=1;const a=Zn();return qf=(l,s,c)=>a(l,s,c)!==0,qf}var Ff,c1;function Qm(){if(c1)return Ff;c1=1;const a=Zn();return Ff=(l,s,c)=>a(l,s,c)>=0,Ff}var Hf,u1;function Km(){if(u1)return Hf;u1=1;const a=Zn();return Hf=(l,s,c)=>a(l,s,c)<=0,Hf}var Pf,d1;function Hj(){if(d1)return Pf;d1=1;const a=qj(),n=Fj(),l=qc(),s=Qm(),c=Xm(),d=Km();return Pf=(p,m,g,v)=>{switch(m){case"===":return typeof p=="object"&&(p=p.version),typeof g=="object"&&(g=g.version),p===g;case"!==":return typeof p=="object"&&(p=p.version),typeof g=="object"&&(g=g.version),p!==g;case"":case"=":case"==":return a(p,g,v);case"!=":return n(p,g,v);case">":return l(p,g,v);case">=":return s(p,g,v);case"<":return c(p,g,v);case"<=":return d(p,g,v);default:throw new TypeError(`Invalid operator: ${m}`)}},Pf}var If,f1;function dD(){if(f1)return If;f1=1;const a=en(),n=Wl(),{safeRe:l,t:s}=Es();return If=(d,f)=>{if(d instanceof a)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;f=f||{};let p=null;if(!f.rtl)p=d.match(f.includePrerelease?l[s.COERCEFULL]:l[s.COERCE]);else{const j=f.includePrerelease?l[s.COERCERTLFULL]:l[s.COERCERTL];let D;for(;(D=j.exec(d))&&(!p||p.index+p[0].length!==d.length);)(!p||D.index+D[0].length!==p.index+p[0].length)&&(p=D),j.lastIndex=D.index+D[1].length+D[2].length;j.lastIndex=-1}if(p===null)return null;const m=p[2],g=p[3]||"0",v=p[4]||"0",b=f.includePrerelease&&p[5]?`-${p[5]}`:"",y=f.includePrerelease&&p[6]?`+${p[6]}`:"";return n(`${m}.${g}.${v}${b}${y}`,f)},If}var kf,h1;function fD(){if(h1)return kf;h1=1;class a{constructor(){this.max=1e3,this.map=new Map}get(l){const s=this.map.get(l);if(s!==void 0)return this.map.delete(l),this.map.set(l,s),s}delete(l){return this.map.delete(l)}set(l,s){if(!this.delete(l)&&s!==void 0){if(this.map.size>=this.max){const d=this.map.keys().next().value;this.delete(d)}this.map.set(l,s)}return this}}return kf=a,kf}var Vf,m1;function Wn(){if(m1)return Vf;m1=1;const a=/\s+/g;class n{constructor(J,U){if(U=c(U),J instanceof n)return J.loose===!!U.loose&&J.includePrerelease===!!U.includePrerelease?J:new n(J.raw,U);if(J instanceof d)return this.raw=J.value,this.set=[[J]],this.formatted=void 0,this;if(this.options=U,this.loose=!!U.loose,this.includePrerelease=!!U.includePrerelease,this.raw=J.trim().replace(a," "),this.set=this.raw.split("||").map(F=>this.parseRange(F.trim())).filter(F=>F.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const F=this.set[0];if(this.set=this.set.filter(X=>!w(X[0])),this.set.length===0)this.set=[F];else if(this.set.length>1){for(const X of this.set)if(X.length===1&&R(X[0])){this.set=[X];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let J=0;J<this.set.length;J++){J>0&&(this.formatted+="||");const U=this.set[J];for(let F=0;F<U.length;F++)F>0&&(this.formatted+=" "),this.formatted+=U[F].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(J){const F=((this.options.includePrerelease&&j)|(this.options.loose&&D))+":"+J,X=s.get(F);if(X)return X;const te=this.options.loose,re=te?m[g.HYPHENRANGELOOSE]:m[g.HYPHENRANGE];J=J.replace(re,oe(this.options.includePrerelease)),f("hyphen replace",J),J=J.replace(m[g.COMPARATORTRIM],v),f("comparator trim",J),J=J.replace(m[g.TILDETRIM],b),f("tilde trim",J),J=J.replace(m[g.CARETTRIM],y),f("caret trim",J);let ve=J.split(" ").map(Se=>A(Se,this.options)).join(" ").split(/\s+/).map(Se=>ae(Se,this.options));te&&(ve=ve.filter(Se=>(f("loose invalid filter",Se,this.options),!!Se.match(m[g.COMPARATORLOOSE])))),f("range list",ve);const ie=new Map,ue=ve.map(Se=>new d(Se,this.options));for(const Se of ue){if(w(Se))return[Se];ie.set(Se.value,Se)}ie.size>1&&ie.has("")&&ie.delete("");const we=[...ie.values()];return s.set(F,we),we}intersects(J,U){if(!(J instanceof n))throw new TypeError("a Range is required");return this.set.some(F=>E(F,U)&&J.set.some(X=>E(X,U)&&F.every(te=>X.every(re=>te.intersects(re,U)))))}test(J){if(!J)return!1;if(typeof J=="string")try{J=new p(J,this.options)}catch{return!1}for(let U=0;U<this.set.length;U++)if(se(this.set[U],J,this.options))return!0;return!1}}Vf=n;const l=fD(),s=new l,c=Gm(),d=Fc(),f=_c(),p=en(),{safeRe:m,t:g,comparatorTrimReplace:v,tildeTrimReplace:b,caretTrimReplace:y}=Es(),{FLAG_INCLUDE_PRERELEASE:j,FLAG_LOOSE:D}=Bc(),w=Z=>Z.value==="<0.0.0-0",R=Z=>Z.value==="",E=(Z,J)=>{let U=!0;const F=Z.slice();let X=F.pop();for(;U&&F.length;)U=F.every(te=>X.intersects(te,J)),X=F.pop();return U},A=(Z,J)=>(f("comp",Z,J),Z=G(Z,J),f("caret",Z),Z=P(Z,J),f("tildes",Z),Z=B(Z,J),f("xrange",Z),Z=ne(Z,J),f("stars",Z),Z),O=Z=>!Z||Z.toLowerCase()==="x"||Z==="*",P=(Z,J)=>Z.trim().split(/\s+/).map(U=>V(U,J)).join(" "),V=(Z,J)=>{const U=J.loose?m[g.TILDELOOSE]:m[g.TILDE];return Z.replace(U,(F,X,te,re,ve)=>{f("tilde",Z,F,X,te,re,ve);let ie;return O(X)?ie="":O(te)?ie=`>=${X}.0.0 <${+X+1}.0.0-0`:O(re)?ie=`>=${X}.${te}.0 <${X}.${+te+1}.0-0`:ve?(f("replaceTilde pr",ve),ie=`>=${X}.${te}.${re}-${ve} <${X}.${+te+1}.0-0`):ie=`>=${X}.${te}.${re} <${X}.${+te+1}.0-0`,f("tilde return",ie),ie})},G=(Z,J)=>Z.trim().split(/\s+/).map(U=>T(U,J)).join(" "),T=(Z,J)=>{f("caret",Z,J);const U=J.loose?m[g.CARETLOOSE]:m[g.CARET],F=J.includePrerelease?"-0":"";return Z.replace(U,(X,te,re,ve,ie)=>{f("caret",Z,X,te,re,ve,ie);let ue;return O(te)?ue="":O(re)?ue=`>=${te}.0.0${F} <${+te+1}.0.0-0`:O(ve)?te==="0"?ue=`>=${te}.${re}.0${F} <${te}.${+re+1}.0-0`:ue=`>=${te}.${re}.0${F} <${+te+1}.0.0-0`:ie?(f("replaceCaret pr",ie),te==="0"?re==="0"?ue=`>=${te}.${re}.${ve}-${ie} <${te}.${re}.${+ve+1}-0`:ue=`>=${te}.${re}.${ve}-${ie} <${te}.${+re+1}.0-0`:ue=`>=${te}.${re}.${ve}-${ie} <${+te+1}.0.0-0`):(f("no pr"),te==="0"?re==="0"?ue=`>=${te}.${re}.${ve}${F} <${te}.${re}.${+ve+1}-0`:ue=`>=${te}.${re}.${ve}${F} <${te}.${+re+1}.0-0`:ue=`>=${te}.${re}.${ve} <${+te+1}.0.0-0`),f("caret return",ue),ue})},B=(Z,J)=>(f("replaceXRanges",Z,J),Z.split(/\s+/).map(U=>W(U,J)).join(" ")),W=(Z,J)=>{Z=Z.trim();const U=J.loose?m[g.XRANGELOOSE]:m[g.XRANGE];return Z.replace(U,(F,X,te,re,ve,ie)=>{f("xRange",Z,F,X,te,re,ve,ie);const ue=O(te),we=ue||O(re),Se=we||O(ve),Ue=Se;return X==="="&&Ue&&(X=""),ie=J.includePrerelease?"-0":"",ue?X===">"||X==="<"?F="<0.0.0-0":F="*":X&&Ue?(we&&(re=0),ve=0,X===">"?(X=">=",we?(te=+te+1,re=0,ve=0):(re=+re+1,ve=0)):X==="<="&&(X="<",we?te=+te+1:re=+re+1),X==="<"&&(ie="-0"),F=`${X+te}.${re}.${ve}${ie}`):we?F=`>=${te}.0.0${ie} <${+te+1}.0.0-0`:Se&&(F=`>=${te}.${re}.0${ie} <${te}.${+re+1}.0-0`),f("xRange return",F),F})},ne=(Z,J)=>(f("replaceStars",Z,J),Z.trim().replace(m[g.STAR],"")),ae=(Z,J)=>(f("replaceGTE0",Z,J),Z.trim().replace(m[J.includePrerelease?g.GTE0PRE:g.GTE0],"")),oe=Z=>(J,U,F,X,te,re,ve,ie,ue,we,Se,Ue)=>(O(F)?U="":O(X)?U=`>=${F}.0.0${Z?"-0":""}`:O(te)?U=`>=${F}.${X}.0${Z?"-0":""}`:re?U=`>=${U}`:U=`>=${U}${Z?"-0":""}`,O(ue)?ie="":O(we)?ie=`<${+ue+1}.0.0-0`:O(Se)?ie=`<${ue}.${+we+1}.0-0`:Ue?ie=`<=${ue}.${we}.${Se}-${Ue}`:Z?ie=`<${ue}.${we}.${+Se+1}-0`:ie=`<=${ie}`,`${U} ${ie}`.trim()),se=(Z,J,U)=>{for(let F=0;F<Z.length;F++)if(!Z[F].test(J))return!1;if(J.prerelease.length&&!U.includePrerelease){for(let F=0;F<Z.length;F++)if(f(Z[F].semver),Z[F].semver!==d.ANY&&Z[F].semver.prerelease.length>0){const X=Z[F].semver;if(X.major===J.major&&X.minor===J.minor&&X.patch===J.patch)return!0}return!1}return!0};return Vf}var Gf,p1;function Fc(){if(p1)return Gf;p1=1;const a=Symbol("SemVer ANY");class n{static get ANY(){return a}constructor(v,b){if(b=l(b),v instanceof n){if(v.loose===!!b.loose)return v;v=v.value}v=v.trim().split(/\s+/).join(" "),f("comparator",v,b),this.options=b,this.loose=!!b.loose,this.parse(v),this.semver===a?this.value="":this.value=this.operator+this.semver.version,f("comp",this)}parse(v){const b=this.options.loose?s[c.COMPARATORLOOSE]:s[c.COMPARATOR],y=v.match(b);if(!y)throw new TypeError(`Invalid comparator: ${v}`);this.operator=y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new p(y[2],this.options.loose):this.semver=a}toString(){return this.value}test(v){if(f("Comparator.test",v,this.options.loose),this.semver===a||v===a)return!0;if(typeof v=="string")try{v=new p(v,this.options)}catch{return!1}return d(v,this.operator,this.semver,this.options)}intersects(v,b){if(!(v instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new m(v.value,b).test(this.value):v.operator===""?v.value===""?!0:new m(this.value,b).test(v.semver):(b=l(b),b.includePrerelease&&(this.value==="<0.0.0-0"||v.value==="<0.0.0-0")||!b.includePrerelease&&(this.value.startsWith("<0.0.0")||v.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&v.operator.startsWith(">")||this.operator.startsWith("<")&&v.operator.startsWith("<")||this.semver.version===v.semver.version&&this.operator.includes("=")&&v.operator.includes("=")||d(this.semver,"<",v.semver,b)&&this.operator.startsWith(">")&&v.operator.startsWith("<")||d(this.semver,">",v.semver,b)&&this.operator.startsWith("<")&&v.operator.startsWith(">")))}}Gf=n;const l=Gm(),{safeRe:s,t:c}=Es(),d=Hj(),f=_c(),p=en(),m=Wn();return Gf}var Yf,g1;function Hc(){if(g1)return Yf;g1=1;const a=Wn();return Yf=(l,s,c)=>{try{s=new a(s,c)}catch{return!1}return s.test(l)},Yf}var Xf,v1;function hD(){if(v1)return Xf;v1=1;const a=Wn();return Xf=(l,s)=>new a(l,s).set.map(c=>c.map(d=>d.value).join(" ").trim().split(" ")),Xf}var Qf,b1;function mD(){if(b1)return Qf;b1=1;const a=en(),n=Wn();return Qf=(s,c,d)=>{let f=null,p=null,m=null;try{m=new n(c,d)}catch{return null}return s.forEach(g=>{m.test(g)&&(!f||p.compare(g)===-1)&&(f=g,p=new a(f,d))}),f},Qf}var Kf,x1;function pD(){if(x1)return Kf;x1=1;const a=en(),n=Wn();return Kf=(s,c,d)=>{let f=null,p=null,m=null;try{m=new n(c,d)}catch{return null}return s.forEach(g=>{m.test(g)&&(!f||p.compare(g)===1)&&(f=g,p=new a(f,d))}),f},Kf}var Zf,y1;function gD(){if(y1)return Zf;y1=1;const a=en(),n=Wn(),l=qc();return Zf=(c,d)=>{c=new n(c,d);let f=new a("0.0.0");if(c.test(f)||(f=new a("0.0.0-0"),c.test(f)))return f;f=null;for(let p=0;p<c.set.length;++p){const m=c.set[p];let g=null;m.forEach(v=>{const b=new a(v.semver.version);switch(v.operator){case">":b.prerelease.length===0?b.patch++:b.prerelease.push(0),b.raw=b.format();case"":case">=":(!g||l(b,g))&&(g=b);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${v.operator}`)}}),g&&(!f||l(f,g))&&(f=g)}return f&&c.test(f)?f:null},Zf}var Wf,j1;function vD(){if(j1)return Wf;j1=1;const a=Wn();return Wf=(l,s)=>{try{return new a(l,s).range||"*"}catch{return null}},Wf}var Jf,S1;function Zm(){if(S1)return Jf;S1=1;const a=en(),n=Fc(),{ANY:l}=n,s=Wn(),c=Hc(),d=qc(),f=Xm(),p=Km(),m=Qm();return Jf=(v,b,y,j)=>{v=new a(v,j),b=new s(b,j);let D,w,R,E,A;switch(y){case">":D=d,w=p,R=f,E=">",A=">=";break;case"<":D=f,w=m,R=d,E="<",A="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(c(v,b,j))return!1;for(let O=0;O<b.set.length;++O){const P=b.set[O];let V=null,G=null;if(P.forEach(T=>{T.semver===l&&(T=new n(">=0.0.0")),V=V||T,G=G||T,D(T.semver,V.semver,j)?V=T:R(T.semver,G.semver,j)&&(G=T)}),V.operator===E||V.operator===A||(!G.operator||G.operator===E)&&w(v,G.semver))return!1;if(G.operator===A&&R(v,G.semver))return!1}return!0},Jf}var eh,w1;function bD(){if(w1)return eh;w1=1;const a=Zm();return eh=(l,s,c)=>a(l,s,">",c),eh}var th,C1;function xD(){if(C1)return th;C1=1;const a=Zm();return th=(l,s,c)=>a(l,s,"<",c),th}var nh,E1;function yD(){if(E1)return nh;E1=1;const a=Wn();return nh=(l,s,c)=>(l=new a(l,c),s=new a(s,c),l.intersects(s,c)),nh}var ah,D1;function jD(){if(D1)return ah;D1=1;const a=Hc(),n=Zn();return ah=(l,s,c)=>{const d=[];let f=null,p=null;const m=l.sort((y,j)=>n(y,j,c));for(const y of m)a(y,s,c)?(p=y,f||(f=y)):(p&&d.push([f,p]),p=null,f=null);f&&d.push([f,null]);const g=[];for(const[y,j]of d)y===j?g.push(y):!j&&y===m[0]?g.push("*"):j?y===m[0]?g.push(`<=${j}`):g.push(`${y} - ${j}`):g.push(`>=${y}`);const v=g.join(" || "),b=typeof s.raw=="string"?s.raw:String(s);return v.length<b.length?v:s},ah}var ih,T1;function SD(){if(T1)return ih;T1=1;const a=Wn(),n=Fc(),{ANY:l}=n,s=Hc(),c=Zn(),d=(b,y,j={})=>{if(b===y)return!0;b=new a(b,j),y=new a(y,j);let D=!1;e:for(const w of b.set){for(const R of y.set){const E=m(w,R,j);if(D=D||E!==null,E)continue e}if(D)return!1}return!0},f=[new n(">=0.0.0-0")],p=[new n(">=0.0.0")],m=(b,y,j)=>{if(b===y)return!0;if(b.length===1&&b[0].semver===l){if(y.length===1&&y[0].semver===l)return!0;j.includePrerelease?b=f:b=p}if(y.length===1&&y[0].semver===l){if(j.includePrerelease)return!0;y=p}const D=new Set;let w,R;for(const B of b)B.operator===">"||B.operator===">="?w=g(w,B,j):B.operator==="<"||B.operator==="<="?R=v(R,B,j):D.add(B.semver);if(D.size>1)return null;let E;if(w&&R){if(E=c(w.semver,R.semver,j),E>0)return null;if(E===0&&(w.operator!==">="||R.operator!=="<="))return null}for(const B of D){if(w&&!s(B,String(w),j)||R&&!s(B,String(R),j))return null;for(const W of y)if(!s(B,String(W),j))return!1;return!0}let A,O,P,V,G=R&&!j.includePrerelease&&R.semver.prerelease.length?R.semver:!1,T=w&&!j.includePrerelease&&w.semver.prerelease.length?w.semver:!1;G&&G.prerelease.length===1&&R.operator==="<"&&G.prerelease[0]===0&&(G=!1);for(const B of y){if(V=V||B.operator===">"||B.operator===">=",P=P||B.operator==="<"||B.operator==="<=",w){if(T&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===T.major&&B.semver.minor===T.minor&&B.semver.patch===T.patch&&(T=!1),B.operator===">"||B.operator===">="){if(A=g(w,B,j),A===B&&A!==w)return!1}else if(w.operator===">="&&!s(w.semver,String(B),j))return!1}if(R){if(G&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===G.major&&B.semver.minor===G.minor&&B.semver.patch===G.patch&&(G=!1),B.operator==="<"||B.operator==="<="){if(O=v(R,B,j),O===B&&O!==R)return!1}else if(R.operator==="<="&&!s(R.semver,String(B),j))return!1}if(!B.operator&&(R||w)&&E!==0)return!1}return!(w&&P&&!R&&E!==0||R&&V&&!w&&E!==0||T||G)},g=(b,y,j)=>{if(!b)return y;const D=c(b.semver,y.semver,j);return D>0?b:D<0||y.operator===">"&&b.operator===">="?y:b},v=(b,y,j)=>{if(!b)return y;const D=c(b.semver,y.semver,j);return D<0?b:D>0||y.operator==="<"&&b.operator==="<="?y:b};return ih=d,ih}var lh,R1;function wD(){if(R1)return lh;R1=1;const a=Es(),n=Bc(),l=en(),s=_j(),c=Wl(),d=J3(),f=eD(),p=tD(),m=nD(),g=aD(),v=iD(),b=lD(),y=rD(),j=Zn(),D=sD(),w=oD(),R=Ym(),E=cD(),A=uD(),O=qc(),P=Xm(),V=qj(),G=Fj(),T=Qm(),B=Km(),W=Hj(),ne=dD(),ae=Fc(),oe=Wn(),se=Hc(),Z=hD(),J=mD(),U=pD(),F=gD(),X=vD(),te=Zm(),re=bD(),ve=xD(),ie=yD(),ue=jD(),we=SD();return lh={parse:c,valid:d,clean:f,inc:p,diff:m,major:g,minor:v,patch:b,prerelease:y,compare:j,rcompare:D,compareLoose:w,compareBuild:R,sort:E,rsort:A,gt:O,lt:P,eq:V,neq:G,gte:T,lte:B,cmp:W,coerce:ne,Comparator:ae,Range:oe,satisfies:se,toComparators:Z,maxSatisfying:J,minSatisfying:U,minVersion:F,validRange:X,outside:te,gtr:re,ltr:ve,intersects:ie,simplifyRange:ue,subset:we,SemVer:l,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers},lh}var CD=wD();const ED=wm(CD),N1=a=>Symbol.iterator in a,M1=a=>"entries"in a,A1=(a,n)=>{const l=a instanceof Map?a:new Map(a.entries()),s=n instanceof Map?n:new Map(n.entries());if(l.size!==s.size)return!1;for(const[c,d]of l)if(!Object.is(d,s.get(c)))return!1;return!0},DD=(a,n)=>{const l=a[Symbol.iterator](),s=n[Symbol.iterator]();let c=l.next(),d=s.next();for(;!c.done&&!d.done;){if(!Object.is(c.value,d.value))return!1;c=l.next(),d=s.next()}return!!c.done&&!!d.done};function TD(a,n){return Object.is(a,n)?!0:typeof a!="object"||a===null||typeof n!="object"||n===null?!1:!N1(a)||!N1(n)?A1({entries:()=>Object.entries(a)},{entries:()=>Object.entries(n)}):M1(a)&&M1(n)?A1(a,n):DD(a,n)}const RD=await C("react");function ND(a){const n=RD.useRef(void 0);return l=>{const s=a(l);return TD(n.current,s)?n.current:n.current=s}}const{toast:Yo}=await C("@baseplate-dev/ui-components"),{useEffect:MD}=await C("react"),Pj={status:"not-started",packages:{}},Ij=Sm(a=>({metadata:Pj,setMetadata:n=>{a({metadata:n})}}));function AD(){const{currentProjectId:a}=Cn(),{setMetadata:n}=Ij();MD(()=>{if(n(Pj),!a)return;let l=!1;const s=()=>{G3(a).then(p=>{l||n(p)}).catch(p=>{p instanceof Cc||Yo.error(wn(p,"Failed to fetch sync metadata."))})};if(s(),qn)return;const c=Lm.on("open",s),d=Lt.sync.onSyncMetadataChanged.subscribe({id:a},{onData:p=>{n(p.syncMetadata)}}),f=Lt.sync.onSyncCompleted.subscribe({id:a},{onData:p=>{const{status:m}=p.syncMetadata;Object.values(p.syncMetadata.packages).some(v=>v.status==="conflicts")?Yo.warning("Sync completed with conflicts! Please review."):m==="success"?Yo.success("Sync completed successfully!"):m==="error"&&Yo.error("Sync failed with errors!")}});return()=>{d.unsubscribe(),f.unsubscribe(),c(),l=!0}},[a,n])}function Ec(a){return Ij(ND(n=>a?a(n.metadata):n.metadata))}const{createPluginImplementationStore:$D,isMigrateableProjectDefinition:LD,ProjectDefinitionContainer:OD,runPluginMigrations:UD,runSchemaMigrations:zD,SchemaMigrationError:BD}=await C("@baseplate-dev/project-builder-lib"),{ZodError:_D}=await C("zod");function qD(a,n){try{const l=JSON.parse(a);if(!LD(l))throw new ua("The project configuration is not valid project definition with a schemaVersion property. Please check the file and try again.");const{migratedDefinition:s}=zD(l),c=$D(n.pluginStore,s),d=UD(s,c);return OD.fromSerializedConfig(d,n)}catch(l){throw l instanceof SyntaxError?new ua("The project configuration is not a valid JSON file. Please check the file and try again."):l instanceof _D?new ua(`The project configuration is not valid: ${QE(l)}`):l instanceof BD?new ua(l.message):l}}const{useCallback:FD,useEffect:HD,useMemo:PD,useRef:ID}=await C("react");function kD({schemaParserContext:a,projectDefinitionFilePayload:n}){const l=ID(void 0),{projectDefinitionContainer:s,error:c}=PD(()=>{try{return!a||!n?{projectDefinitionContainer:void 0,error:void 0}:l.current?.contents===n.contents?{projectDefinitionContainer:{container:l.current.container,hash:n.hash},error:void 0}:{projectDefinitionContainer:{container:qD(n.contents,a),hash:n.hash},error:void 0}}catch(d){return{projectDefinitionContainer:void 0,error:d}}},[a,n]);return HD(()=>{c&&console.error(c)},[c]),{projectDefinitionContainer:s?.container,cacheProjectDefinitionContainer:FD((d,f)=>{l.current={container:d,contents:f}},[]),error:c}}class VD{projectId;_definitionFileContentsHash;_pendingDefinitionFileContentsHash;constructor(n){this.projectId=n}async downloadDefinitionContents(){const{contents:n,hash:l}=await H3(this.projectId),s=this._pendingDefinitionFileContentsHash!==l&&this._definitionFileContentsHash!==l;return this._definitionFileContentsHash=l,{contents:n,hash:l,updatedExternally:s}}async uploadDefinitionContents(n){if(!this._definitionFileContentsHash)throw new Error("Definition file must be downloaded before uploading");if(this._pendingDefinitionFileContentsHash)throw new Error("Only one upload can be pending at a time. Please wait for the current upload to complete before uploading again.");try{this._pendingDefinitionFileContentsHash=await lj(n);const l=await P3(this.projectId,n,this._definitionFileContentsHash);return l.type==="original-contents-mismatch"?(this._definitionFileContentsHash=l.currentPayload.hash,{contents:l.currentPayload.contents,hash:l.currentPayload.hash,updatedExternally:!0}):(this._definitionFileContentsHash=this._pendingDefinitionFileContentsHash,{contents:n,hash:this._pendingDefinitionFileContentsHash,updatedExternally:!1})}finally{this._pendingDefinitionFileContentsHash=void 0}}listenForDefinitionFileChanges(n){return I3(this.projectId,l=>{this._definitionFileContentsHash!==l.hash&&(this._definitionFileContentsHash=l.hash,n({contents:l.contents,hash:l.hash,updatedExternally:this._pendingDefinitionFileContentsHash!==l.hash}))})}}const{useCallback:GD,useEffect:YD,useState:rh}=await C("react");function XD(){const[a,n]=rh(),[l,s]=rh(),[c,d]=rh(),{currentProjectId:f,projectsLoaded:p,resetCurrentProjectId:m}=Cn();YD(()=>{if(n(void 0),s(void 0),!f||!p){d(void 0);return}const v=new VD(f);return d(v),v.downloadDefinitionContents().then(b=>{n(b)}).catch(b=>{b instanceof Cc?m():s(b)}),v.listenForDefinitionFileChanges(b=>{n(b)})},[f,p,m]);const g=GD(async v=>{if(!c)throw new Error("Project definition file manager not found");await c.uploadDefinitionContents(v).then(b=>{n(b)}).catch(b=>{throw b instanceof Cc&&m(),b})},[c,m]);return{projectDefinitionFilePayload:a,uploadProjectDefinitionContents:g,error:l}}function QD(a,n){return()=>{}}const kj={placeholder:{url:"http://localhost:3001/remoteEntry.js",format:"esm",from:"vite"}},$1={},KD=async(a,n)=>{const l=typeof a=="function"?await a():a,s=document.createElement("script");s.type="text/javascript",s.onload=n,s.src=l,document.getElementsByTagName("head")[0].appendChild(s)};function $l(a,n){return ZD(a).then(l=>()=>n==="webpack"&&Object.prototype.toString.call(l).indexOf("Module")>-1&&l.default?l.default:l)}function Vj(a,n){const l=Object.assign(a,n);for(const s of Object.keys(l))typeof l[s]=="object"&&typeof n[s]=="object"&&(l[s]=Vj(l[s],n[s]));return l}const L1=a=>Vj({react:{"19.1.0":{get:()=>$l(new URL("__federation_shared_react-CTQ9xfiH.js",import.meta.url).href,a),loaded:1}},"react-dom":{"19.1.0":{get:()=>$l(new URL("__federation_shared_react-dom-DPv53nVg.js",import.meta.url).href,a),loaded:1}},zod:{"3.24.1":{get:()=>$l(new URL("__federation_shared_zod-DQ8g46gT.js",import.meta.url).href,a),loaded:1}},"@baseplate-dev/project-builder-lib":{"*":{get:()=>$l(new URL("__federation_shared_@baseplate-dev/project-builder-lib-BtVlDHx3.js",import.meta.url).href,a),loaded:1}},"@baseplate-dev/project-builder-lib/web":{"*":{get:()=>$l(new URL("__federation_shared_@baseplate-dev/project-builder-lib/web-BGBGspyb.js",import.meta.url).href,a),loaded:1}},"@baseplate-dev/ui-components":{"*":{get:()=>$l(new URL("__federation_shared_@baseplate-dev/ui-components-DrVfzkV2.js",import.meta.url).href,a),loaded:1}}},(globalThis.__federation_shared__||{}).default||{});async function ZD(a){return $1[a]??=import(a),$1[a]}async function WD(a){const n=kj[a];if(n.inited)return n.lib;if(n.format==="var")return new Promise(l=>{const s=()=>{n.inited||(n.lib=window[a],n.lib.init(L1(n.from)),n.inited=!0),l(n.lib)};return KD(n.url,s)});if(["esm","systemjs"].includes(n.format))return new Promise((l,s)=>{(typeof n.url=="function"?n.url:()=>Promise.resolve(n.url))().then(d=>{import(d).then(f=>{if(!n.inited){const p=L1(n.from);f.init(p),n.lib=f,n.lib.init(p),n.inited=!0}l(n.lib)}).catch(s)})})}function JD(a){return a?.__esModule||a?.[Symbol.toStringTag]==="Module"?a.default:a}function e8(a,n){return WD(a).then(l=>l.get(n).then(s=>s()))}function t8(a,n){kj[a]=n}let Gj=Math.random();function n8(){Gj=Math.random()}async function a8(a,n){const l=`${a}/${n.id}`,s=`/api/plugins/${a}/${n.id}/web/assets/remoteEntry.js?rnd=${Gj}`;return t8(l,{url:s,externalType:"url",format:"esm",from:"vite"}),(await Promise.all(n.webModulePaths.map(p=>e8(l,p)))).map(p=>JD(p)).map((p,m)=>({key:n.webModulePaths[m],module:p}))}const{webConfigSpec:i8}=await C("@baseplate-dev/project-builder-lib"),{adminCrudInputWebSpec:l8,modelTransformerWebSpec:r8}=await C("@baseplate-dev/project-builder-lib/web");async function s8(a,n){return{pluginStore:{availablePlugins:await Promise.all(n.map(async l=>{const s=await a8(a,l);return{metadata:l,modules:s}})),builtinSpecImplementations:[i8,r8,l8]}}}class o8{projectId;_pluginsMetadata;_schemaParserContext;constructor(n){this.projectId=n}async loadSchemaParserContext(){return this._pluginsMetadata??=await F3(this.projectId),n8(),this._schemaParserContext=await s8(this.projectId,this._pluginsMetadata),this._schemaParserContext}listenForPluginAssetsChanges(n,l){return QD()}}const{toast:O1}=await C("@baseplate-dev/ui-components"),{useEffect:c8,useState:U1}=await C("react");function u8(){const{currentProjectId:a,projectsLoaded:n}=Cn(),[l,s]=U1(void 0),[c,d]=U1();return c8(()=>{if(s(void 0),d(void 0),!a||!n)return;const f=new o8(a);return f.loadSchemaParserContext().then(p=>{s(p)}).catch(p=>{O1.error(wn(p)),d(p)}),f.listenForPluginAssetsChanges(p=>{s(p)},p=>{O1.error(wn(p))})},[a,n]),{schemaParserContext:l,error:c}}const z1=(a,n,l)=>{if(a&&"reportValidity"in a){const s=im(l,n);a.setCustomValidity(s&&s.message||""),a.reportValidity()}},Yj=(a,n)=>{for(const l in n.fields){const s=n.fields[l];s&&s.ref&&"reportValidity"in s.ref?z1(s.ref,l,a):s&&s.refs&&s.refs.forEach(c=>z1(c,l,a))}},d8=(a,n)=>{n.shouldUseNativeValidation&&Yj(a,n);const l={};for(const s in a){const c=im(n.fields,s),d=Object.assign(a[s]||{},{ref:c&&c.ref});if(f8(n.names||Object.keys(a),s)){const f=Object.assign({},im(l,s));Gd(f,"root",d),Gd(l,s,f)}else Gd(l,s,d)}return l},f8=(a,n)=>{const l=B1(n);return a.some(s=>B1(s).match(`^${l}\\.\\d+`))};function B1(a){return a.replace(/\]|\[/g,"")}function h8(a,n){for(var l={};a.length;){var s=a[0],c=s.code,d=s.message,f=s.path.join(".");if(!l[f])if("unionErrors"in s){var p=s.unionErrors[0].errors[0];l[f]={message:p.message,type:p.code}}else l[f]={message:d,type:c};if("unionErrors"in s&&s.unionErrors.forEach(function(v){return v.errors.forEach(function(b){return a.push(b)})}),n){var m=l[f].types,g=m&&m[s.code];l[f]=yw(f,n,l,c,g?[].concat(g,s.message):s.message)}a.shift()}return l}function kt(a,n,l){return l===void 0&&(l={}),function(s,c,d){try{return Promise.resolve(function(f,p){try{var m=Promise.resolve(a[l.mode==="sync"?"parse":"parseAsync"](s,n)).then(function(g){return d.shouldUseNativeValidation&&Yj({},d),{errors:{},values:l.raw?Object.assign({},s):g}})}catch(g){return p(g)}return m&&m.then?m.then(void 0,p):m}(0,function(f){if(function(p){return Array.isArray(p?.errors)}(f))return{values:{},errors:d8(h8(f.errors,!d.shouldUseNativeValidation&&d.criteriaMode==="all"),d)};throw f}))}catch(f){return Promise.reject(f)}}}const{generalSettingsSchema:m8}=await C("@baseplate-dev/project-builder-lib"),{Button:p8,Card:g8,CardContent:v8,InputFieldController:_1,toast:b8}=await C("@baseplate-dev/ui-components");function x8({existingProject:a,saveProject:n}){const{control:l,handleSubmit:s,formState:{isSubmitting:c}}=pi({defaultValues:a?.settings.general,resolver:kt(m8)}),d=s(f=>{n(f).catch(p=>{b8.error(wn(p,"Failed to save project"))})});return o.jsx(g8,{className:"w-80 animate-in fade-in zoom-in-70 sm:w-120",children:o.jsxs(v8,{className:"flex flex-col space-y-4",children:[o.jsx("img",{className:"mx-auto w-16",src:"/images/logo.png",alt:"Baseplate Logo"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h1",{className:"text-center",children:"Welcome to Baseplate"}),o.jsx("p",{className:"text-center text-style-lead",children:"Let's get you set up!"})]}),o.jsxs("form",{onSubmit:d,className:"flex flex-col space-y-4",children:[o.jsx(_1,{name:"name",label:"Project Name",description:"Lowercase letters and dashes, e.g. my-project",control:l,placeholder:"e.g. my-project"}),o.jsx(_1,{name:"portOffset",label:"Port Offset",description:"Multiple of 1000, e.g. 4000. This will offset the ports used by the project, e.g. API at 4001, database at 4432, to avoid conflicts with other projects.",control:l,registerOptions:{valueAsNumber:!0}}),o.jsx(p8,{className:"mx-auto",type:"submit",disabled:c,children:"Initialize Project"})]})]})})}const{createProjectDefinitionSchemaWithContext:y8,fixRefDeletions:j8,ProjectDefinitionContainer:S8}=await C("@baseplate-dev/project-builder-lib"),{ProjectDefinitionContext:w8}=await C("@baseplate-dev/project-builder-lib/web"),{Button:sh,ErrorableLoader:C8,ErrorDisplay:E8,toast:q1}=await C("@baseplate-dev/ui-components"),{useMemo:D8,useState:T8}=await C("react");function R8({children:a}){const{schemaParserContext:n,error:l}=u8(),{projectDefinitionFilePayload:s,uploadProjectDefinitionContents:c,error:d}=XD(),{projectDefinitionContainer:f,error:p,cacheProjectDefinitionContainer:m}=kD({schemaParserContext:n,projectDefinitionFilePayload:s}),{projects:g,resetCurrentProjectId:v}=Cn(),{version:b}=Bj(),{showRefIssues:y}=cj(),[j,D]=T8(!1);AD();const w=!!s?.updatedExternally,R=D8(()=>{if(!f||!n)return;const{definition:A}=f,O=n;async function P(G){D(!0);try{const T=qw(A,G),B=y8(T,O),W=j8(B,T);if(W.type==="failure")throw new xb(W.issues);const ne=W.value;ne.cliVersion=b;const ae=new S8(W.refPayload,O,B.pluginStore),oe=ae.toSerializedContents();m(ae,oe),await c(oe)}finally{D(!1)}}async function V(G,T={}){return P(G).then(()=>(q1.success(T.successMessage??"Successfully saved!"),T.onSuccess?.(),{success:!0})).catch(B=>(B instanceof xb&&!T.disableDeleteRefDialog?y({issues:B.issues}):q1.error(wn(B,"Failed to save project definition.")),{success:!1}))}return{definition:A,definitionContainer:f,saveDefinition:P,saveDefinitionWithFeedback:V,saveDefinitionWithFeedbackSync:(G,T)=>{V(G,T)},isSavingDefinition:j,pluginContainer:f.pluginStore,schemaParserContext:n,updatedExternally:w}},[b,f,j,n,w,c,y,m]),E=l??d??p;return R?R.definition.isInitialized?R.definition.cliVersion&&b&&b!=="preview"&&ED.gt(R.definition.cliVersion,b)?o.jsx(E8,{header:"Upgrade your Baseplate client",actions:o.jsxs("div",{className:"flex flex-col space-y-4",children:[o.jsx(sh,{onClick:()=>{globalThis.location.reload()},children:"Refresh Page"}),g.length>1&&o.jsx(sh,{variant:"secondary",onClick:()=>{v()},children:"Switch Project"})]}),error:o.jsxs(o.Fragment,{children:["This project requires a newer version of the client (",R.definition.cliVersion,"). Please upgrade your client by running ",o.jsx("strong",{children:"pnpm install"}),"."]})}):o.jsx(w8.Provider,{value:R,children:a}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(x8,{existingProject:R.definition,saveProject:async A=>{await R.saveDefinition(O=>{O.settings.general={...A,packageScope:""},O.isInitialized=!0})}})}):o.jsx(C8,{error:E&&Vl(E,""),header:"Failed to load project config",actions:o.jsx("div",{className:"flex flex-col space-y-4",children:g.length>1&&o.jsx(sh,{variant:"secondary",onClick:()=>{v()},children:"Switch Project"})})})}const{Button:F1,Dialog:N8,DialogContent:M8,DialogHeader:A8,DialogTitle:$8,Table:L8,TableBody:O8,TableCell:oh,TableHead:ch,TableHeader:U8,TableRow:H1}=await C("@baseplate-dev/ui-components");function z8({onClose:a,isOpen:n}){const{currentProjectId:l,setCurrentProjectId:s,projects:c}=Cn(),d=cn();return o.jsx(N8,{onOpenChange:a??(()=>{}),open:n,children:o.jsxs(M8,{width:"lg",children:[o.jsx(A8,{children:o.jsx($8,{children:"Pick Project"})}),o.jsxs(L8,{children:[o.jsx(U8,{children:o.jsxs(H1,{children:[o.jsx(ch,{children:"Name"}),o.jsx(ch,{children:"Directory"}),o.jsx(ch,{})]})}),o.jsx(O8,{children:c.map(f=>o.jsxs(H1,{children:[o.jsx(oh,{children:o.jsx("strong",{children:f.name})}),o.jsx(oh,{children:f.directory}),o.jsx(oh,{children:l===f.id?o.jsx(F1,{variant:"link",disabled:!0,children:"Selected"}):o.jsx(F1,{variant:"link",onClick:()=>{s(f.id),d("/"),a&&a()},children:"Select"})})]},f.id))})]})]})})}const{ErrorableLoader:B8}=await C("@baseplate-dev/ui-components"),{useEffect:P1,useState:_8}=await C("react");function q8({children:a}){const[n,l]=_8(),{currentProjectId:s,projectsLoaded:c,setProjects:d}=Cn();return P1(()=>{k3().then(f=>{d(f)}).catch(f=>{l(wn(f,"Failed to fetch projects."))})},[d]),P1(()=>{Vy(s)},[s]),c?s?o.jsx(o.Fragment,{children:a}):o.jsx(z8,{isOpen:!0}):o.jsx(B8,{error:n})}const{ErrorHandlerContext:F8}=await C("@baseplate-dev/project-builder-lib/web"),{ConfirmDialog:H8,Toaster:P8,TooltipProvider:I8}=await C("@baseplate-dev/ui-components"),{useMemo:k8}=await C("react");function V8(){const a=k8(()=>({formatError:Vl,logAndFormatError:wn,logError:Bl}),[]);return o.jsx(Gl,{children:o.jsx(F8.Provider,{value:a,children:o.jsxs(I8,{children:[o.jsx(W3,{children:o.jsx(q8,{children:o.jsxs(R8,{children:[o.jsx(gi,{}),o.jsx(P6,{})]})})}),o.jsx(P8,{}),o.jsx(H8,{}),o.jsx(WC,{})]})})})}function Xo(a){const n=new Date(a);if(!Number.isNaN(n.valueOf()))return n;const l=String(a).match(/\d+/g);if(l==null||l.length<=2)return n;{const[s,c,...d]=l.map(m=>parseInt(m)),f=[s,c-1,...d];return new Date(Date.UTC(...f))}}const Qr=(a,n,l)=>{const s=a!==1?n+"s":n;return a+" "+s+" "+l},G8=({locale:a,...n})=>(l,s,c)=>{const d=Intl.RelativeTimeFormat;if(!d)throw new Error("Intl.RelativeTimeFormat is not supported");return new d(a,{style:"long",numeric:"auto",...n}).format(c==="ago"?-l:l,s)};function pm(){return pm=Object.assign?Object.assign.bind():function(a){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var s in l)({}).hasOwnProperty.call(l,s)&&(a[s]=l[s])}return a},pm.apply(null,arguments)}const Y8=await C("react"),{useEffect:I1,useState:X8}=await C("react"),ts=60,ns=ts*60,Fl=ns*24,Qo=Fl*7,k1=Fl*30,V1=Fl*365,Q8=()=>Date.now();function Xj({date:a,formatter:n,component:l="time",live:s=!0,minPeriod:c=0,maxPeriod:d=Qo,title:f,now:p=Q8,...m}){const[g,v]=X8(p());I1(()=>{if(!s)return;const T=(()=>{const B=Xo(a).valueOf();if(!B)return console.warn("[react-timeago] Invalid Date provided"),0;const W=Math.round(Math.abs(g-B)/1e3),ne=W<ts?1e3:W<ns?1e3*ts:W<Fl?1e3*ns:1e3*Qo,ae=Math.min(Math.max(ne,c*1e3),d*1e3);return ae?setTimeout(()=>{v(p())},ae):0})();return()=>{T&&clearTimeout(T)}},[a,s,d,c,p,g]),I1(()=>{v(p())},[a]);const b=l,y=Xo(a).valueOf();if(!y)return null;const j=Math.round(Math.abs(g-y)/1e3),D=y<g?"ago":"from now",[w,R]=j<ts?[Math.round(j),"second"]:j<ns?[Math.round(j/ts),"minute"]:j<Fl?[Math.round(j/ns),"hour"]:j<Qo?[Math.round(j/Fl),"day"]:j<k1?[Math.round(j/Qo),"week"]:j<V1?[Math.round(j/k1),"month"]:[Math.round(j/V1),"year"],E=typeof f>"u"?typeof a=="string"?a:Xo(a).toISOString().substring(0,16).replace("T"," "):f,A=b==="time"?{...m,dateTime:Xo(a).toISOString()}:m,O=(G=G,T=T,B=B,W=y,ne=Qr,ae=ae)=>Qr(G,T,B),P=n||Qr;let V;try{V=P(w,R,D,y,O,p),V||(V=Qr(w,R,D,y,O,p))}catch(G){console.error("[react-timeago] Formatter threw an error:",G),V=Qr(w,R,D)}return Y8.createElement(b,pm({},A,{title:E}),V)}const K8=G8({locale:"en"}),Qj=(...a)=>a[1]==="second"?"Just now":K8(...a),{Badge:Z8,Button:uh,Table:W8,TableBody:J8,TableCell:dh,TableHead:fh,TableHeader:e7,TableRow:G1,toast:Kr,Tooltip:t7,TooltipContent:n7,TooltipTrigger:a7}=await C("@baseplate-dev/ui-components");function i7(a){switch(a){case"success":return o.jsx(Tw,{className:"text-success-foreground"});case"unknown-error":case"command-error":return o.jsx(Dw,{className:"text-error-foreground"});case"conflicts":return o.jsx(gy,{className:"text-warning-foreground"});case"cancelled":return o.jsx(Ew,{className:"text-secondary-foreground"});case"not-synced":return o.jsx(L0,{className:"text-secondary-foreground"});case"in-progress":return o.jsx(py,{className:"text-secondary-foreground"});default:return o.jsx(L0,{className:"text-secondary-foreground"})}}function l7(a){switch(a){case"success":return"Synced";case"unknown-error":return"Sync error";case"command-error":return"Command error";case"conflicts":return"Conflicts";case"cancelled":return"Cancelled";case"not-synced":return"Not Synced";case"in-progress":return"Syncing...";default:return"Unknown"}}function r7(a){switch(a){case"merge-conflict":return"Merge Conflict";case"working-deleted":return"Deleted by User";case"generated-deleted":return"Deleted in Generated";default:return"Unknown"}}function s7(a){switch(a){case"merge-conflict":return"This file was modified in both the working codebase and the generated codebase. Please resolve the conflicts manually.";case"working-deleted":return"This file was deleted in the working codebase but modified in the generated codebase. Choose whether to keep or delete it.";case"generated-deleted":return"This file was deleted in the generated codebase but modified in the working codebase. Choose whether to keep or delete it.";default:return"Unknown conflict type"}}function o7({packageId:a,filesWithConflicts:n}){const l=Bj(),{currentProjectId:s}=Cn();if(n.length===0)return null;const c=p=>{s&&Lt.sync.openEditor.mutate({id:s,packageId:a,relativePath:p}).catch(m=>{Kr.error(wn(m,"Failed to open editor"))})},d=p=>{s&&Lt.sync.keepConflictFile.mutate({id:s,packageId:a,relativePath:p.relativePath}).then(()=>{Kr.success(`File ${p.relativePath} was kept!`)}).catch(m=>{Kr.error(wn(m,"Failed to keep file"))})},f=p=>{s&&Lt.sync.deleteConflictFile.mutate({id:s,packageId:a,relativePath:p.relativePath}).then(()=>{Kr.success(`File ${p.relativePath} was deleted!`)}).catch(m=>{Kr.error(wn(m,"Failed to delete file"))})};return o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium",children:"Merge Conflicts"}),o.jsxs(W8,{children:[o.jsx(e7,{children:o.jsxs(G1,{children:[o.jsx(fh,{className:"w-3/5",children:"Name"}),o.jsx(fh,{className:"w-1/5",children:o.jsx("div",{className:"flex items-center gap-2",children:"Type"})}),o.jsx(fh,{className:"w-1/5",children:"Actions"})]})}),o.jsx(J8,{children:n.map(p=>o.jsxs(G1,{children:[o.jsx(dh,{children:l.userConfig.sync?.editor?o.jsx("button",{className:"hover:underline",onClick:()=>{c(p.generatedConflictRelativePath??p.relativePath)},children:o.jsx("div",{className:"w-full text-start",children:p.generatedConflictRelativePath??p.relativePath})}):o.jsx("span",{children:p.generatedConflictRelativePath??p.relativePath})}),o.jsx(dh,{children:o.jsxs(t7,{children:[o.jsx(a7,{children:o.jsx("span",{children:r7(p.conflictType)})}),o.jsx(n7,{side:"left",className:"max-w-sm",children:s7(p.conflictType)})]})}),o.jsxs(dh,{children:[p.conflictType==="merge-conflict"&&l.userConfig.sync?.editor&&o.jsx(uh,{variant:"outline",size:"sm",onClick:()=>{c(p.generatedConflictRelativePath??p.relativePath)},children:"View"}),p.conflictType!=="merge-conflict"&&o.jsxs("div",{className:"flex gap-2",children:[o.jsx(uh,{variant:"outline",size:"sm",onClick:()=>{d(p)},children:"Keep"}),o.jsx(uh,{variant:"destructive",size:"sm",onClick:()=>{f(p)},children:"Delete"})]})]})]},p.relativePath))})]})]})}function c7({packageId:a,packageInfo:n,className:l}){const s=n.status==="unknown-error"||n.status==="command-error"||n.status==="conflicts",c=n.result?.filesWithConflicts??[];return o.jsxs("div",{className:Te("w-full rounded-md border",l),children:[o.jsxs("div",{className:"flex w-full items-center justify-between px-4 py-3",children:[o.jsx("span",{className:"font-medium",children:n.name}),o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx("span",{children:n.result?.completedAt?o.jsx(Xj,{date:new Date(n.result.completedAt),formatter:Qj}):"-"}),o.jsxs(Z8,{variant:n.status==="unknown-error"||n.status==="command-error"?"destructive":"secondary",className:"flex items-center gap-1",children:[i7(n.status),l7(n.status)]})]})]}),s&&o.jsxs("div",{className:"space-y-4 border-t p-4",children:[n.result?.errors&&n.result.errors.length>0&&o.jsxs("div",{className:"mt-2 space-y-1",children:[o.jsx("h4",{className:"font-medium",children:"Errors:"}),o.jsx("ul",{className:"list-disc pl-5 text-sm text-destructive",children:n.result.errors.map((d,f)=>o.jsx("li",{className:"font-mono whitespace-pre-wrap",children:d.message},f))})]}),o.jsx(o7,{packageId:a,filesWithConflicts:c}),n.result?.failedCommands&&n.result.failedCommands.length>0&&o.jsxs("div",{className:"mt-2 space-y-1",children:[o.jsx("h4",{className:"font-medium",children:"Failed Commands:"}),o.jsx("ul",{className:"list-disc pl-5 text-sm text-destructive",children:n.result.failedCommands.map((d,f)=>o.jsx("li",{children:o.jsx("code",{children:d.command})},f))})]})]})]})}const{Alert:Y1,AlertDescription:X1,AlertTitle:Q1}=await C("@baseplate-dev/ui-components");function u7({className:a}){const n=Ec();if(n.globalErrors?.length)return o.jsxs(Y1,{variant:"error",children:[o.jsx(Q1,{children:"Error compiling project."}),o.jsx(X1,{children:n.globalErrors.map(d=>o.jsx("div",{className:"font-mono whitespace-pre-wrap",children:d},d))})]});if(!(Object.keys(n.packages).length>0))return n.status==="not-started"||n.status==="in-progress"?o.jsx("div",{className:Te("flex h-40 items-center justify-center text-muted-foreground",a),children:o.jsx("span",{children:"Waiting for sync to start..."})}):o.jsxs(Y1,{variant:"default",children:[o.jsx(Q1,{children:"No packages found to be synced."}),o.jsx(X1,{children:"Sync status will appear here once packages have been added."})]});const s=Object.entries(n.packages),c=Kn(s,[([,d])=>d.order]);return o.jsx("div",{className:Te("space-y-3",a),children:c.map(([d,f])=>o.jsx(c7,{packageId:d,packageInfo:f},d))})}const{useBlockBeforeContinue:d7,useProjectDefinition:f7}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Ko,Dialog:h7,DialogContent:m7,DialogDescription:p7,DialogFooter:g7,DialogHeader:v7,DialogTitle:b7,DialogTrigger:x7,Tabs:y7,TabsContent:K1,TabsList:j7,TabsTrigger:Z1,toast:hh}=await C("@baseplate-dev/ui-components"),{useRef:S7,useState:w7}=await C("react");function C7({className:a}){const[n,l]=w7(!1),{definitionContainer:s}=f7(),{currentProjectId:c}=Cn(),d=d7(),f=S7(s);f.current=s;const p=Ec(b=>b.status==="in-progress"),m=Ec(b=>Object.values(b.packages).some(y=>y.status==="conflicts")),g=()=>{if(c){if(m){hh.warning("Conflicts must be resolved before syncing");return}V3(c).catch(b=>hh.error(wn(b))),l(!0)}},v=()=>{c&&Y3(c).catch(b=>hh.error(Vl(b)))};return o.jsx("div",{className:Te(a),children:o.jsxs(h7,{open:n,onOpenChange:b=>{l(b)},children:[o.jsx(x7,{asChild:!0,children:o.jsxs(Ko,{onClick:b=>{l(!0),!p&&!m&&(d({onContinue:g}),b.preventDefault())},size:"sm","data-testid":"sync-button",children:[m?o.jsx(gy,{}):o.jsx(py,{}),p?"Syncing...":m?"Resolve conflicts":"Sync"]})}),o.jsxs(m7,{width:"lg","aria-description":"Sync project dialog",children:[o.jsxs(v7,{children:[o.jsx(b7,{children:"Sync Project"}),o.jsx(p7,{children:"Sync the project configuration to the codebase of your project."})]}),o.jsxs(y7,{defaultValue:"packages",className:"mt-4 min-w-0",children:[o.jsxs(j7,{className:"grid w-full grid-cols-2",children:[o.jsx(Z1,{value:"packages",children:"Packages"}),o.jsx(Z1,{value:"console-log",children:"Console log"})]}),o.jsx(K1,{value:"packages",className:"mt-4",children:o.jsx(u7,{})}),o.jsx(K1,{value:"console-log",className:"mt-4",children:o.jsx(rj,{})})]}),o.jsxs(g7,{children:[p?o.jsx(Ko,{variant:"destructive",onClick:v,children:"Stop"}):o.jsx(Ko,{variant:"secondary",onClick:g,children:"Sync Again"}),o.jsx(Ko,{variant:"outline",onClick:()=>{l(!1)},children:"Close"})]})]})]})})}const{useProjectDefinition:E7}=await C("@baseplate-dev/project-builder-lib/web"),{Breadcrumb:D7,BreadcrumbItem:W1,BreadcrumbLink:T7,BreadcrumbList:R7,BreadcrumbPage:N7,BreadcrumbSeparator:J1,Button:M7,DropdownMenu:A7,DropdownMenuContent:$7,DropdownMenuGroup:L7,DropdownMenuItem:O7,DropdownMenuTrigger:U7}=await C("@baseplate-dev/ui-components"),{Fragment:z7}=await C("react");function B7(){const{definitionContainer:a}=E7(),l=nC().map(m=>{const g=m.handle?.crumb;if(!g)return null;const v=typeof g=="function"?g(m.params,a):g,{label:b,url:y}=typeof v=="string"?{label:v,url:void 0}:v;return{id:m.id,label:b,url:y}}).filter(vy),s=Cn(m=>m.projects),c=Cn(m=>m.setCurrentProjectId),d=cn(),f=Fw(s,["name"],["asc"]),p=a.definition.settings.general.name;return o.jsxs("div",{className:"flex items-center space-x-2",children:[s.length>1&&o.jsxs(A7,{children:[o.jsx(U7,{asChild:!0,children:o.jsxs(M7,{variant:"ghost",size:"none",className:"-ml-2 h-8 px-2 text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center text-sm",children:[yb(p)," project"]}),o.jsx(Rw,{})]})}),o.jsx($7,{children:o.jsx(L7,{children:f.map(m=>o.jsx(O7,{onSelect:()=>{c(m.id),d("/")},children:o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsx("div",{children:o.jsx("strong",{children:m.name})}),o.jsx("div",{className:"text-xs text-muted-foreground",children:m.directory})]})},m.id))})})]}),o.jsx(D7,{children:o.jsxs(R7,{children:[s.length<=1&&o.jsxs(o.Fragment,{children:[o.jsxs(W1,{children:[yb(p)," project"]}),l.length>0&&o.jsx(J1,{})]}),l.map((m,g)=>o.jsxs(z7,{children:[g!==0&&o.jsx(J1,{className:"hidden sm:block"}),g===l.length-1?o.jsx(N7,{children:m.label}):o.jsx(W1,{className:"hidden sm:block",children:m.url?o.jsx(T7,{asChild:!0,children:o.jsx(It,{to:m.url,children:m.label})}):m.label})]},m.id))]})})]})}function Wm(a){return Vi({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M3 12v3c0 1.657 3.134 3 7 3s7-1.343 7-3v-3c0 1.657-3.134 3-7 3s-7-1.343-7-3z"},child:[]},{tag:"path",attr:{d:"M3 7v3c0 1.657 3.134 3 7 3s7-1.343 7-3V7c0 1.657-3.134 3-7 3S3 8.657 3 7z"},child:[]},{tag:"path",attr:{d:"M17 5c0 1.657-3.134 3-7 3S3 6.657 3 5s3.134-3 7-3 7 1.343 7 3z"},child:[]}]})(a)}function Dc(a){return Vi({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"},child:[]}]})(a)}function Zr(a){return Vi({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"},child:[]}]})(a)}function Zo({icon:a,to:n,label:l,end:s}){return o.jsx(Ht,{to:n,className:'flex h-12 w-[50px] items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-[current="page"]:bg-accent/80 aria-[current="page"]:text-accent-foreground aria-[current="page"]:hover:bg-accent',end:s,children:o.jsxs("div",{className:"flex flex-col items-center space-y-1",children:[o.jsx(a,{className:"size-5"}),o.jsx("div",{className:"text-xs font-medium",children:l})]})})}function _7(){return o.jsx("nav",{className:"flex h-full flex-col items-center justify-between px-2 pt-2.5 pb-4",children:o.jsxs("div",{className:"space-y-8",children:[o.jsx(It,{to:"/",className:"group flex shrink-0 items-center justify-center",children:o.jsx("img",{src:"/images/logo.png",className:"size-8 transition-all group-hover:scale-110",alt:"Baseplate Home"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Zo,{to:"/apps",icon:Cm,label:"Apps"}),o.jsx(Zo,{to:"/data",icon:Wm,label:"Data"}),o.jsx(Zo,{to:"/plugins",icon:by,label:"Plugins"}),o.jsx(Zo,{to:"/settings",icon:xy,label:"Settings"})]})]})})}const{SheetClose:q7}=await C("@baseplate-dev/ui-components");function Wr({icon:a,to:n,label:l,end:s}){return o.jsx(q7,{asChild:!0,children:o.jsxs(Ht,{to:n,className:'flex items-center gap-4 px-2.5 py-4 text-muted-foreground transition-colors hover:text-accent-foreground aria-[current="page"]:bg-accent/80 aria-[current="page"]:text-accent-foreground',end:s,children:[o.jsx(a,{className:"size-5 transition-all group-hover:scale-110"}),l]})})}function F7(){return o.jsxs("nav",{className:"grid gap-6 text-lg font-medium",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("img",{src:"/images/logo.png",alt:"logo",className:"size-12"}),o.jsx("h3",{children:"Baseplate"})]}),o.jsxs("div",{children:[o.jsx(Wr,{to:"/",icon:Nw,label:"Home",end:!0}),o.jsx(Wr,{to:"/apps",icon:Cm,label:"Apps"}),o.jsx(Wr,{to:"/data/models",icon:Wm,label:"Models"}),o.jsx(Wr,{to:"/plugins",icon:by,label:"Plugins"}),o.jsx(Wr,{to:"/settings",icon:xy,label:"Settings"})]})]})}function H7({className:a}){const n=Ec(l=>l.completedAt);return n?o.jsxs("div",{className:Te("text-style-muted",a),children:["Last Sync: ",o.jsx(Xj,{date:n,formatter:Qj})]}):null}const{Button:P7,Sheet:I7,SheetContent:k7,SheetTrigger:V7}=await C("@baseplate-dev/ui-components");function G7({className:a}){return o.jsxs("div",{className:Te("flex h-screen w-full min-w-(--min-app-width) flex-col bg-background",a),style:{"--sidebar-width":"70px","--topbar-height":"52px","--action-bar-height":"52px","--min-app-width":"800px"},children:[o.jsx("aside",{className:"fixed inset-y-0 left-0 z-10 hidden w-(--sidebar-width) flex-col border-r bg-background sm:flex",children:o.jsx(_7,{})}),o.jsxs("div",{className:"flex h-full flex-col pt-(--topbar-height) sm:pl-(--sidebar-width)",children:[o.jsxs("header",{className:"fixed inset-x-0 top-0 z-30 flex h-(--topbar-height) items-center gap-4 border-b bg-background px-4 sm:left-(--sidebar-width) sm:px-4",children:[o.jsxs(I7,{children:[o.jsx(V7,{asChild:!0,children:o.jsxs(P7,{size:"icon",variant:"outline",className:"sm:hidden",children:[o.jsx(Mw,{className:"size-5"}),o.jsx("span",{className:"sr-only",children:"Toggle Menu"})]})}),o.jsx(k7,{side:"left",className:"max-w-xs",children:o.jsx(F7,{})})]}),o.jsxs("div",{className:"flex w-full items-center justify-between py-3",children:[o.jsx(B7,{}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(H7,{}),o.jsx(C7,{})]})]})]}),o.jsx("main",{className:"h-[calc(100vh-var(--topbar-height)-1px)] overflow-auto",children:o.jsx(Gl,{children:o.jsx(gi,{})})})]})]})}function Pc(a,n,l){return(s,c)=>({label:(s.uid&&c.safeNameFromId(a.fromUid(s.uid)))??n,url:l?.replace(":uid",s.uid??"")})}function Ds(){return o.jsx(Lc,{})}const Ts={path:"*",element:o.jsx(Ds,{})},{appEntityType:Y7}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:X7}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Q7,NavigationMenu:K7,NavigationMenuItemWithLink:Z7,NavigationMenuList:W7,SidebarLayout:J7,SidebarLayoutContent:eT,SidebarLayoutSidebar:tT}=await C("@baseplate-dev/ui-components");function nT(){const{definition:a}=X7(),{apps:n}=a,l=Kn(n,[s=>s.name]);return o.jsxs(J7,{className:"flex-1",children:[o.jsxs(tT,{className:"space-y-4",width:"sm",children:[o.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[o.jsx(It,{to:"/apps",children:o.jsx("h2",{children:"Apps"})}),o.jsx(It,{to:"/apps/new",className:"inline-block",children:o.jsx(Q7,{variant:"secondary",children:"New App"})})]}),o.jsx(K7,{orientation:"vertical",children:o.jsx(W7,{children:l.map(s=>o.jsx(Z7,{asChild:!0,children:o.jsx(Ht,{to:`/apps/edit/${Y7.toUid(s.id)}`,children:s.name})},s.id))})})]}),o.jsx(eT,{className:"p-4",children:o.jsx(gi,{})})]})}const{adminAppSchema:aT,authConfigSpec:iT,zPluginWrapper:lT}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:rT,useProjectDefinition:sT,useResettableForm:oT}=await C("@baseplate-dev/project-builder-lib/web"),{Button:cT,InputFieldController:ex,MultiComboboxFieldController:uT}=await C("@baseplate-dev/ui-components"),{useMemo:dT}=await C("react");function fT({className:a,appConfig:n}){const{definition:l,saveDefinitionWithFeedback:s,pluginContainer:c,isSavingDefinition:d}=sT(),f=dT(()=>lT(aT,c),[c]),p=oT({resolver:kt(f),values:n}),{control:m,handleSubmit:g,reset:v}=p,b=g(j=>s(D=>{D.apps=D.apps.map(w=>w.id===n.id?j:w)}));rT({control:m,reset:v,onSubmit:b});const y=c.getPluginSpecOptional(iT)?.getAuthRoles(l).map(j=>({label:j.name,value:j.id}));return o.jsx("div",{className:Te("",a),children:o.jsxs("form",{onSubmit:b,className:"space-y-4",children:[o.jsx(ex,{label:"Name",control:m,name:"name"}),o.jsx(ex,{label:"Package Location (optional) e.g. packages/web",control:m,name:"packageLocation"}),y&&o.jsx(uT,{label:"Allowed Roles?",control:m,options:y,name:"allowedRoles"}),o.jsx(cT,{type:"submit",disabled:d,children:"Save"})]})})}const{ModelUtils:hT}=await C("@baseplate-dev/project-builder-lib"),{createAdminCrudInputWebConfig:mT,useProjectDefinition:pT}=await C("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:tx}=await C("@baseplate-dev/ui-components");function gT({formProps:a,name:n,model:l,embeddedFormOptions:s}){const{definition:c}=pT(),d=hT.getRelationsToModel(c,l.id).map(m=>({label:`${m.relation.foreignRelationName} (${m.model.name})`,value:m.relation.foreignId})),f=n,p=a.control;return o.jsxs(o.Fragment,{children:[o.jsx(tx,{label:"Relation Name",control:p,name:`${f}.modelRelationRef`,options:d}),o.jsx(tx,{label:"Embedded Form",control:p,name:`${f}.embeddedFormRef`,options:s})]})}const vT=mT({name:"embedded",pluginId:void 0,label:"Embedded",getNewInput:()=>({label:"",type:"embedded",modelRelationRef:"",embeddedFormRef:""}),Form:gT}),{createAdminCrudInputWebConfig:bT}=await C("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:nx}=await C("@baseplate-dev/ui-components");function xT({formProps:a,name:n,model:l,embeddedFormOptions:s}){const c=l.model.relations?.map(p=>({label:`${p.name} (${p.modelRef})`,value:p.id}))??[],d=n,f=a.control;return o.jsxs(o.Fragment,{children:[o.jsx(nx,{label:"Relation Name",control:f,name:`${d}.localRelationRef`,options:c}),o.jsx(nx,{label:"Embedded Form",control:f,name:`${d}.embeddedFormRef`,options:s})]})}const yT=bT({name:"embeddedLocal",pluginId:void 0,label:"Embedded Local",getNewInput:()=>({label:"",type:"embeddedLocal",embeddedFormRef:"",localRelationRef:""}),Form:xT}),{createAdminCrudInputWebConfig:jT}=await C("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:ST}=await C("@baseplate-dev/ui-components");function wT({formProps:a,name:n,model:l}){const s=l.model.fields.filter(f=>f.type==="enum").map(f=>({label:f.name,value:f.id})),c=n,d=a.control;return o.jsx(ST,{label:"Enum Field",control:d,name:`${c}.modelFieldRef`,options:s})}const CT=jT({name:"enum",pluginId:void 0,label:"Enum",getNewInput:()=>({label:"",type:"enum",modelFieldRef:""}),Form:wT}),{createAdminCrudInputWebConfig:ET}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:Wo,SelectFieldController:DT}=await C("@baseplate-dev/ui-components");function TT({formProps:a,name:n,model:l}){const s=l.model.relations?.map(f=>({label:`${f.name} (${f.modelRef})`,value:f.id}))??[],c=n,d=a.control;return o.jsxs(o.Fragment,{children:[o.jsx(DT,{label:"Local Relation Name",control:d,name:`${c}.localRelationRef`,options:s}),o.jsx(Wo,{label:"Label Expression (e.g. name)",control:d,name:`${c}.labelExpression`}),o.jsx(Wo,{label:"Value Expression (e.g. id)",control:d,name:`${c}.valueExpression`}),o.jsx(Wo,{label:"Default Label (optional)",control:d,name:`${c}.defaultLabel`}),o.jsx(Wo,{label:"Empty Label (optional) - only if field is nullable",control:d,name:`${c}.nullLabel`})]})}const RT=ET({name:"foreign",pluginId:void 0,label:"Foreign",getNewInput:()=>({label:"",type:"foreign",localRelationRef:"",labelExpression:"",valueExpression:"",defaultLabel:"",nullLabel:""}),Form:TT}),{createAdminCrudInputWebConfig:NT}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:MT,SelectFieldController:AT}=await C("@baseplate-dev/ui-components");function $T({formProps:a,name:n,model:l}){const s=l.model.fields.map(f=>({label:f.name,value:f.id})),c=n,d=a.control;return o.jsxs(o.Fragment,{children:[o.jsx(AT,{label:"Field",control:d,name:`${c}.modelFieldRef`,options:s}),o.jsx(MT,{label:"Validation (zod), e.g. z.string().min(1) (optional)",control:d,name:`${c}.validation`})]})}const LT=NT({name:"text",pluginId:void 0,label:"Text",getNewInput:()=>({label:"",type:"text",modelFieldRef:""}),Form:$T}),ax=[vT,yT,CT,RT,LT],{ModelUtils:OT}=await C("@baseplate-dev/project-builder-lib"),{adminCrudInputWebSpec:UT,useProjectDefinition:zT}=await C("@baseplate-dev/project-builder-lib/web"),{Button:BT,InputFieldController:_T,SelectFieldController:qT}=await C("@baseplate-dev/ui-components");function FT({idx:a,formProps:n,embeddedFormOptions:l}){const{control:s}=n,c=it({control:s,name:"modelRef"}),{definition:d,pluginContainer:f}=zT(),p=c?OT.byIdOrThrow(d,c):void 0,m=f.getPluginSpec(UT),g=m.getInputWebConfigs(ax).map(j=>({label:j.label,value:j.name})),v=it({control:s,name:`form.fields.${a}.type`}),b=m.getInputWebConfig(v,ax),y=b.Form;return o.jsxs("div",{className:"space-y-4",children:[o.jsx(qT,{label:"Type",control:s,options:g,name:`form.fields.${a}.type`}),o.jsx(_T,{label:"Label",control:s,name:`form.fields.${a}.label`}),y&&p&&o.jsx(y,{formProps:n,name:`form.fields.${a}`,model:p,embeddedFormOptions:l,pluginId:b.pluginId})]})}function Kj({className:a,formProps:n,embeddedFormOptions:l}){const{control:s}=n,{fields:c,append:d,remove:f}=vs({control:s,name:"form.fields"});return o.jsxs("div",{className:Te("space-y-4",a),children:[c.map((p,m)=>o.jsx(ky,{collapsedContents:o.jsxs("div",{children:[p.label," (",p.type,")"]}),onRemove:()=>{f(m)},defaultOpen:!p.label,children:o.jsx(FT,{idx:m,formProps:n,embeddedFormOptions:l},p.id)},p.id)),o.jsx(BT,{onClick:()=>{d({type:"text",label:""})},children:"Add Field"})]})}const{adminCrudDisplayTypes:HT,ModelUtils:PT}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:IT}=await C("@baseplate-dev/project-builder-lib/web"),{Button:kT,InputFieldController:mh,SelectFieldController:ph}=await C("@baseplate-dev/ui-components");function VT({idx:a,control:n,fieldOptions:l,localRelationOptions:s}){const c=HT.map(f=>({label:f,value:f})),d=it({control:n,name:`table.columns.${a}.display.type`});return o.jsxs("div",{className:"space-y-4",children:[o.jsx(ph,{label:"Type",control:n,options:c,name:`table.columns.${a}.display.type`}),o.jsx(mh,{label:"Label",control:n,name:`table.columns.${a}.label`}),d==="text"&&o.jsx(ph,{label:"Field",control:n,name:`table.columns.${a}.display.modelFieldRef`,options:l}),d==="foreign"&&o.jsxs(o.Fragment,{children:[o.jsx(ph,{label:"Local Relation Name",control:n,name:`table.columns.${a}.display.localRelationRef`,options:s}),o.jsx(mh,{label:"Label Expression (e.g. name)",control:n,name:`table.columns.${a}.display.labelExpression`}),o.jsx(mh,{label:"Value Expression (e.g. id)",control:n,name:`table.columns.${a}.display.valueExpression`})]})]})}function Zj({className:a,control:n}){const l=it({control:n,name:"modelRef"}),{definition:s,definitionContainer:c}=IT(),d=l?PT.byIdOrThrow(s,l):void 0,{fields:f,append:p,remove:m}=vs({control:n,name:"table.columns"}),g=d?.model.relations?.map(b=>({label:`${b.name} (${c.nameFromId(b.modelRef)})`,value:b.id}))??[],v=d?.model.fields.map(b=>({label:b.name,value:b.id}))??[];return o.jsxs("div",{className:Te("space-y-4",a),children:[f.map((b,y)=>o.jsx(ky,{collapsedContents:o.jsxs("div",{children:[b.label," (",b.display.type,")"]}),onRemove:()=>{m(y)},defaultOpen:!b.label,children:o.jsx(VT,{idx:y,control:n,fieldOptions:v,localRelationOptions:g},b.id)},b.id)),o.jsx(kT,{onClick:()=>{p({display:{type:"text",modelFieldRef:""},label:""})},children:"Add Column"})]})}const{adminCrudEmbeddedFormSchema:GT,zPluginWrapper:YT}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:Wj}=await C("@baseplate-dev/project-builder-lib/web"),{Button:gm,CheckboxFieldController:XT,InputFieldController:QT,SelectFieldController:ix,Table:KT,TableBody:ZT,TableCell:Jo,TableHead:ec,TableHeader:WT,TableRow:lx,toast:JT}=await C("@baseplate-dev/ui-components"),{useId:eR}=await C("react");function tR({items:a,edit:n,remove:l}){const{definitionContainer:s}=Wj();return o.jsxs(KT,{className:"max-w-6xl",children:[o.jsx(WT,{children:o.jsxs(lx,{children:[o.jsx(ec,{children:"Form Name"}),o.jsx(ec,{children:"Model Name"}),o.jsx(ec,{children:"Type"}),o.jsx(ec,{children:"Actions"})]})}),o.jsx(ZT,{children:a.map((c,d)=>o.jsxs(lx,{children:[o.jsx(Jo,{children:c.name}),o.jsx(Jo,{children:s.nameFromId(c.modelRef)}),o.jsx(Jo,{children:c.type}),o.jsxs(Jo,{className:"space-x-4",children:[o.jsx(gm,{variant:"link",size:"none",onClick:()=>{n(d)},children:"Edit"}),o.jsx(gm,{variant:"linkDestructive",size:"none",onClick:()=>{l(d)},children:"Remove"})]})]},c.id))})]})}const nR=[{label:"Object",value:"object"},{label:"List",value:"list"}];function aR({initialData:a,onSubmit:n,embeddedFormOptions:l}){const{definition:s,pluginContainer:c}=Wj(),d=YT(GT,c),f=pi({resolver:kt(d),defaultValues:a}),{handleSubmit:p,control:m,watch:g}=f,v=s.models.map(j=>({label:j.name,value:j.id})),b=g("type"),y=eR();return o.jsxs("form",{onSubmit:j=>{j.stopPropagation(),p(n)(j).catch(D=>{JT.error(wn(D))})},id:y,className:"space-y-4",children:[o.jsx(QT,{label:"Name",control:m,name:"name"}),o.jsx(ix,{label:"Type",control:m,name:"type",options:nR}),o.jsx(XT,{label:"Include ID Field? (useful for list types)",control:m,name:"includeIdField"}),o.jsx(ix,{label:"Model",control:m,options:v,name:"modelRef"}),b==="list"&&o.jsxs(o.Fragment,{children:[o.jsx("h2",{children:"Table"}),o.jsx(Zj,{control:m})]}),o.jsx("h2",{children:"Form"}),o.jsx(Kj,{formProps:f,embeddedFormOptions:l}),o.jsx(gm,{type:"submit",form:y,children:"Save"})]})}const{useProjectDefinition:iR}=await C("@baseplate-dev/project-builder-lib/web"),{CheckboxFieldController:lR,SelectFieldController:rR}=await C("@baseplate-dev/ui-components");function sR({className:a,formProps:n}){const{control:l}=n,{definition:s}=iR(),c=s.models.map(f=>({label:f.name,value:f.id})),d=it({control:l,name:"embeddedForms"})?.map(f=>({label:f.name,value:f.id}))??[];return o.jsxs("div",{className:Te("space-y-4",a),children:[o.jsx(rR,{label:"Model",control:l,options:c,name:"modelRef"}),o.jsx(lR,{label:"Disable Create?",control:l,name:"disableCreate"}),o.jsx("h2",{children:"Table"}),o.jsx(Zj,{control:l}),o.jsx("h2",{children:"Form"}),o.jsx(Kj,{formProps:n,embeddedFormOptions:d}),o.jsx("h2",{children:"Embedded Forms"}),o.jsx(hs.LabelledController,{control:l,name:"embeddedForms",renderForm:f=>o.jsx(aR,{...f,embeddedFormOptions:d}),renderTable:f=>o.jsx(tR,{...f}),defaultValue:{type:"object"}})]})}const{adminSectionEntityType:gh,adminSectionSchema:oR,zPluginWrapper:cR}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:uR,useProjectDefinition:dR,useResettableForm:fR}=await C("@baseplate-dev/project-builder-lib/web"),{Button:rx,ComboboxFieldController:hR,InputFieldController:sx,SelectFieldController:mR,useConfirmDialog:pR}=await C("@baseplate-dev/ui-components"),{useEffect:gR}=await C("react"),vR=[{label:"Crud",value:"crud"}];function ox({className:a,appConfig:n}){const{requestConfirm:l}=pR(),{sectionId:s}=Qi(),{saveDefinitionWithFeedback:c,saveDefinitionWithFeedbackSync:d,isSavingDefinition:f,definition:p,pluginContainer:m}=dR(),g=cn(),v=s?gh.fromUid(s):void 0,b=v?n.sections?.find(G=>G.id===v):void 0,y=cR(oR,m),j=fR({values:b,defaultValues:{type:"crud"},resolver:kt(y)}),{control:D,handleSubmit:w,watch:R,reset:E}=j;gR(()=>{E(b??{type:"crud"})},[E,b]);const A=w(G=>{const T=G.id||gh.generateNewId();return c(B=>{const W=B.apps.find(ne=>ne.id===n.id);if(W?.type!=="admin")throw new Error("Cannot add a section to a non-admin app");W.sections=Kn([...(W.sections??[]).filter(ne=>!v||ne.id!==v),{...G,id:T}],[ne=>ne.name])},{onSuccess:()=>{v||g(`edit/${gh.toUid(T)}`)}})});uR({control:D,reset:E,onSubmit:A});const O=R("type");function P(){l({title:"Delete Section",content:`Are you sure you want to delete ${b?.name??"this section"}?`,onConfirm:()=>{d(G=>{const T=G.apps.find(B=>B.id===n.id);if(T?.type!=="admin")throw new Error("Cannot add a section to a non-admin app");T.sections=(T.sections??[]).filter(B=>!v||B.id!==v)},{successMessage:"Successfully deleted section!",onSuccess:()=>{g("..")}})}})}const V=p.features.map(G=>({label:G.name,value:G.id}));return o.jsx("div",{className:Te("",a),children:o.jsxs("form",{onSubmit:A,className:"space-y-4",children:[v&&o.jsx(rx,{variant:"link",size:"none",onClick:()=>{P()},children:"Delete Section"}),o.jsx(sx,{label:"Name",control:D,name:"name"}),o.jsx(hR,{label:"Feature",control:D,options:V,name:"featureRef"}),o.jsx(sx,{label:"Icon",control:D,name:"icon"}),o.jsx(mR,{label:"Type",control:D,name:"type",options:vR}),(()=>{switch(O){case"crud":return o.jsx(sR,{formProps:j});default:return o.jsxs("div",{children:["Unsupported type ",O]})}})(),o.jsx(rx,{type:"submit",disabled:f,children:"Save"})]})})}const{adminSectionEntityType:Jj}=await C("@baseplate-dev/project-builder-lib"),{NavigationMenu:bR,NavigationMenuItemWithLink:cx,NavigationMenuList:xR,SidebarLayout:yR,SidebarLayoutContent:jR,SidebarLayoutSidebar:SR}=await C("@baseplate-dev/ui-components");ys(Jj,"/apps/edit/{parentUid}/sections/edit/{uid}");function wR({className:a,appConfig:n}){const l=Kn(n.sections??[],[s=>s.name]);return o.jsxs(yR,{className:a,children:[o.jsxs(SR,{className:"space-y-4",width:"sm",children:[o.jsx("div",{className:"flex items-center justify-between",children:o.jsx("h2",{children:"Sections"})}),o.jsx(bR,{orientation:"vertical",children:o.jsxs(xR,{children:[o.jsx("li",{children:o.jsx(cx,{asChild:!0,children:o.jsx(It,{to:"new",className:"text-green-500",children:"New Section"})})}),l.map(s=>o.jsx("li",{children:o.jsx(cx,{asChild:!0,children:o.jsx(It,{to:`edit/${Jj.toUid(s.id)}`,children:s.name})})},s.id))]})})]}),o.jsx(jR,{className:"p-4",children:o.jsxs(Fy,{children:[o.jsx(us,{path:"new",element:o.jsx(ox,{appConfig:n},"new")}),o.jsx(us,{path:"edit/:sectionId",element:o.jsx(ox,{appConfig:n})})]})})]})}const{Alert:CR,AlertDescription:ER,AlertTitle:DR,NavigationTabs:TR,NavigationTabsItem:ux}=await C("@baseplate-dev/ui-components");function RR({className:a,appConfig:n}){return o.jsxs("div",{className:Te("",a),children:[o.jsxs(CR,{variant:"warning",className:"mb-4",children:[o.jsx(DR,{children:"⚠️ Development Preview"}),o.jsx(ER,{children:"The admin app functionality will likely be fully rewritten in future versions. This is provided for preview purposes only and should not be relied upon for production use."})]}),o.jsxs(TR,{children:[o.jsx(ux,{asChild:!0,children:o.jsx(Ht,{to:"",end:!0,children:"General"})}),o.jsx(ux,{asChild:!0,children:o.jsx(Ht,{to:"sections",children:"Sections"})})]}),o.jsx("div",{className:"mt-4 border-t",children:o.jsxs(Fy,{children:[o.jsx(us,{index:!0,element:o.jsx("div",{className:"p-4",children:o.jsx(fT,{appConfig:n})})}),o.jsx(us,{path:"/sections/*",element:o.jsx(wR,{appConfig:n})})]})})]})}const{backendAppSchema:NR}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:MR,useProjectDefinition:AR,useResettableForm:$R}=await C("@baseplate-dev/project-builder-lib/web"),{Button:LR,CheckboxFieldController:Ll,InputFieldController:dx}=await C("@baseplate-dev/ui-components");function OR({className:a,appConfig:n}){const{saveDefinitionWithFeedback:l,isSavingDefinition:s}=AR(),c=$R({resolver:kt(NR),values:n}),{control:d,handleSubmit:f,reset:p}=c,m=f(g=>l(v=>{v.apps=v.apps.map(b=>b.id===n.id?g:b)}));return MR({control:d,reset:p,onSubmit:m}),o.jsx("div",{className:Te("",a),children:o.jsxs("form",{onSubmit:m,className:"space-y-4",children:[o.jsx(dx,{label:"Name",control:d,name:"name"}),o.jsx(dx,{label:"Package Location (optional) e.g. packages/backend",control:d,name:"packageLocation"}),o.jsx(Ll,{label:"Enable Stripe?",control:d,name:"enableStripe"}),o.jsx(Ll,{label:"Enable Postmark?",control:d,name:"enablePostmark"}),o.jsx(Ll,{label:"Enable Redis?",control:d,name:"enableRedis"}),o.jsx(Ll,{label:"Enable Bull Queue?",control:d,name:"enableBullQueue"}),o.jsx(Ll,{label:"Enable GraphQL Subscriptions?",control:d,name:"enableSubscriptions"}),o.jsx(Ll,{label:"Enable Axios?",control:d,name:"enableAxios"}),o.jsx(LR,{type:"submit",disabled:s,children:"Save"})]})})}const{authConfigSpec:UR,webAppSchema:zR}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:BR,useProjectDefinition:fx,useResettableForm:_R}=await C("@baseplate-dev/project-builder-lib/web"),{Button:qR,CheckboxFieldController:vh,InputFieldController:tc,MultiComboboxFieldController:FR}=await C("@baseplate-dev/ui-components");function HR({className:a,appConfig:n}){const{saveDefinitionWithFeedback:l,isSavingDefinition:s}=fx(),c=_R({resolver:kt(zR),values:n}),{control:d,handleSubmit:f,reset:p}=c,{definition:m,pluginContainer:g}=fx(),v=f(y=>l(j=>{j.apps=j.apps.map(D=>D.id===n.id?y:D)}));BR({control:d,reset:p,onSubmit:v});const b=g.getPluginSpecOptional(UR)?.getAuthRoles(m).map(y=>({label:y.name,value:y.id}));return o.jsx("div",{className:Te("",a),children:o.jsxs("form",{onSubmit:v,className:"space-y-4",children:[o.jsx(tc,{label:"Name",control:d,name:"name"}),o.jsx(tc,{label:"Package Location (optional) e.g. packages/web",control:d,name:"packageLocation"}),o.jsx(tc,{label:"Page Title",control:d,name:"title"}),o.jsx(tc,{label:"Description Meta Tag",control:d,name:"description"}),o.jsx(vh,{label:"Include Auth?",control:d,name:"includeAuth"}),o.jsx(vh,{label:"Include Upload Components?",control:d,name:"includeUploadComponents"}),o.jsx(vh,{label:"Enable Subscriptions?",control:d,name:"enableSubscriptions"}),b&&o.jsx(FR,{label:"Allowed Roles?",control:d,options:b,name:"allowedRoles"}),o.jsx(qR,{type:"submit",disabled:s,children:"Save"})]})})}const{appEntityType:PR}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:IR}=await C("@baseplate-dev/project-builder-lib/web"),{Button:bh,Dialog:kR,DialogClose:VR,DialogContent:GR,DialogFooter:YR,DialogHeader:XR,DialogTitle:QR,DialogTrigger:KR,ErrorDisplay:ZR}=await C("@baseplate-dev/ui-components");function WR(){const{uid:a}=Qi(),{saveDefinitionWithFeedbackSync:n,definition:l,isSavingDefinition:s}=IR(),c=a?PR.fromUid(a):void 0,d=c&&l.apps.find(g=>g.id===c),f=cn();if(!a||!d)return o.jsx(Lc,{});const p=()=>{n(g=>{g.apps=g.apps.filter(v=>v.id!==c)},{successMessage:"Successfully unlinked app!",disableDeleteRefDialog:!0,onSuccess:()=>{f("/apps/new")}})},{packageScope:m}=l.settings.general;return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[o.jsxs("div",{children:[o.jsx("h2",{children:m?`@${m}/${d.name}`:d.name}),o.jsxs("p",{className:"text-base text-muted-foreground",children:[d.type," app"]})]}),o.jsxs(kR,{children:[o.jsx(KR,{asChild:!0,children:o.jsx(bh,{variant:"secondary",children:"Delete"})}),o.jsxs(GR,{children:[o.jsx(XR,{children:o.jsxs(QR,{children:["Delete ",d.name]})}),o.jsxs("p",{children:["Are you sure you want to delete ",o.jsx("strong",{children:d.name}),"?"]}),o.jsx("p",{className:"text-style-muted",children:"This action will unlink the app from the generation process, so it will no longer be updated or managed through Baseplate. If already generated, the app will remain on the file system. You can manually delete it afterwards if no longer needed."}),o.jsxs(YR,{children:[o.jsx(VR,{children:o.jsx(bh,{variant:"secondary",children:"Cancel"})}),o.jsx(bh,{variant:"destructive",onClick:p,disabled:s,children:"Unlink App"})]})]})]})]}),o.jsx("div",{children:(()=>{switch(d.type){case"backend":return o.jsx(OR,{appConfig:d},d.id);case"web":return o.jsx(HR,{appConfig:d},d.id);case"admin":return o.jsx(RR,{appConfig:d},d.id);default:return o.jsx(ZR,{error:`Unknown app type: ${d.type}`})}})()})]})}const{appEntityType:JR}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:e9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:xh,Card:t9,EmptyDisplay:n9}=await C("@baseplate-dev/ui-components");function a9(){const{definition:a}=e9(),{apps:n}=a,l=Kn(n,[s=>s.name]);return l.length===0?o.jsx(n9,{icon:Cm,header:"No Apps",subtitle:"You haven't created any apps yet",actions:o.jsx(It,{to:"/apps/new",className:"inline-block",children:o.jsx(xh,{children:"New App"})})}):o.jsxs("div",{className:"space-y-4",children:[o.jsx("h1",{children:"Apps"}),o.jsx("p",{children:"These are the apps that are defined in your project. You can edit them here."}),o.jsx(It,{to:"/apps/new",className:"inline-block",children:o.jsx(xh,{children:"New App"})}),o.jsx("div",{className:"max-w-xl space-y-4",children:l.map(s=>o.jsxs(t9,{className:"flex justify-between space-x-4 p-4",children:[o.jsxs("div",{children:[o.jsxs("h3",{children:[s.name," (",s.type,")"]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:s.packageLocation})]}),o.jsx(It,{to:`/apps/edit/${JR.toUid(s.id)}`,className:"inline-block",children:o.jsx(xh,{variant:"secondary",children:"Edit"})})]},s.id))})]})}const{appEntityType:hx,baseAppSchema:i9}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:l9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:r9,Card:s9,CardContent:o9,InputFieldController:c9,SelectFieldController:u9,toast:d9}=await C("@baseplate-dev/ui-components");function f9(){const{saveDefinitionWithFeedback:a,isSavingDefinition:n}=l9(),l=cn(),s=pi({resolver:kt(i9),defaultValues:{id:hx.generateNewId(),name:"",type:"backend"}}),{control:c,handleSubmit:d}=s,f=[{label:"Backend App",value:"backend"},{label:"Web App",value:"web"},{label:"Admin App",value:"admin"}],p=d(m=>a(g=>{const v=[...g.apps,m];g.apps=Kn(v,[b=>b.name])},{onSuccess:()=>{l(`../edit/${hx.toUid(m.id)}`),d9.success(`Sucessfully created ${m.name}!`)}}));return o.jsxs("div",{className:"space-y-4",children:[o.jsx("h1",{children:"New App"}),o.jsx(s9,{children:o.jsx(o9,{children:o.jsxs("form",{onSubmit:p,className:"space-y-4",children:[o.jsx(c9,{label:"Name",control:c,name:"name",description:"The name of the app, such as 'backend' or 'web'"}),o.jsx(u9,{label:"Type",control:c,name:"type",options:f}),o.jsx(r9,{type:"submit",disabled:n,children:"Create"})]})})})]})}const{appEntityType:h9}=await C("@baseplate-dev/project-builder-lib"),m9=[{element:o.jsx(nT,{}),children:[{index:!0,element:o.jsx(a9,{})},{path:"new",element:o.jsx(f9,{}),handle:{crumb:"New App"}},{path:"edit/:uid/*",element:o.jsx(WR,{}),handle:{crumb:Pc(h9,"Edit App")}},{path:"*",element:o.jsx(Ds,{})}]}],{modelEntityType:mx,modelEnumEntityType:px}=await C("@baseplate-dev/project-builder-lib");function e2(a){return`/data/models/edit/${mx.isId(a)?mx.toUid(a):a}`}function t2(a){return`/data/enums/edit/${px.isId(a)?px.toUid(a):a}`}const{FeatureComboboxFieldController:p9}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:g9}=await C("@baseplate-dev/ui-components");function n2({className:a,control:n}){return o.jsxs("div",{className:Te("max-w-md space-y-4",a),children:[o.jsx(g9,{label:"Name",control:n,name:"name",description:"The name of the enum (PascalCase)"}),o.jsx(p9,{label:"Feature",control:n,name:"featureRef",description:"The feature this enum belongs to (dash-case)",canCreate:!0})]})}const{enumSchema:v9,EnumUtils:b9,FeatureUtils:x9,modelEnumEntityType:vm}=await C("@baseplate-dev/project-builder-lib"),{usePluginEnhancedSchema:y9,useProjectDefinition:j9,useResettableForm:S9}=await C("@baseplate-dev/project-builder-lib/web"),{useEventCallback:w9}=await C("@baseplate-dev/ui-components"),{useMemo:yh}=await C("react");function C9(){return{id:vm.generateNewId(),name:"",featureRef:"",isExposed:!1,values:[]}}function Jm({schema:a,onSubmitSuccess:n,isCreate:l}={}){const{uid:s}=Qi(),{definition:c,saveDefinitionWithFeedback:d,isSavingDefinition:f}=j9(),p=cn(),m=l?void 0:vm.fromUid(s),g=m?b9.byId(c,m):void 0;if(!l&&!g)throw new ij("Enum not found");const v=yh(()=>C9(),[]),b=y9(a??v9),y=yh(()=>{const O=g??v;return a?b.parse(O):O},[g,v,a,b]),j=S9({resolver:kt(b),defaultValues:y}),{reset:D,handleSubmit:w,setError:R}=j,E=w9(n),A=yh(()=>w(O=>{const P={...g,...O,id:g?.id??vm.generateNewId()};if(c.enums?.find(G=>G.id!==P.id&&G.name.toLowerCase()===P.name.toLowerCase())){R("name",{message:`Enum with name ${P.name} already exists.`});return}return d(G=>{P.featureRef=x9.ensureFeatureByNameRecursively(G,P.featureRef),G.enums=Kn([...G.enums?.filter(T=>T.id!==P.id)??[],P],[T=>T.name])},{successMessage:l?"Successfully created enum!":"Successfully saved enum!",onSuccess:()=>{l?(p(t2(P.id)),D(v)):D(O),E?.()}})}),[p,D,d,R,w,c,l,g,v,E]);return{form:j,onSubmit:A,defaultValues:y,isSavingDefinition:f}}const{useBlockBeforeContinue:E9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:gx,Dialog:D9,DialogClose:T9,DialogContent:R9,DialogDescription:N9,DialogFooter:M9,DialogHeader:A9,DialogTitle:$9,DialogTrigger:L9,SwitchFieldController:O9,useControlledState:U9}=await C("@baseplate-dev/ui-components");function a2({children:a,open:n,onOpenChange:l}){const[s,c]=U9(n,l,!1),{onSubmit:d,form:{control:f},isSavingDefinition:p}=Jm({isCreate:!0,onSubmitSuccess:()=>{c(!1)}}),m=E9();return o.jsxs(D9,{open:s,onOpenChange:g=>{g?m({onContinue:()=>{c(!0)}}):c(!1)},children:[o.jsx(L9,{asChild:!0,children:a}),o.jsxs(R9,{children:[o.jsxs(A9,{children:[o.jsx($9,{children:"New Enum"}),o.jsx(N9,{children:"Enums are a list of values that can be used in your data models."})]}),o.jsxs("form",{onSubmit:d,className:"space-y-4",children:[o.jsx(n2,{control:f}),o.jsx(O9,{label:"Expose in GraphQL schema",control:f,name:"isExposed",description:"Whether to expose this enum in the GraphQL schema"}),o.jsxs(M9,{children:[o.jsx(T9,{asChild:!0,children:o.jsx(gx,{variant:"secondary",children:"Cancel"})}),o.jsx(gx,{type:"submit",disabled:p,children:"Create Enum"})]})]})]})]})}const{useProjectDefinition:z9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:vx,InputField:B9,NavigationMenu:_9,NavigationMenuItemWithLink:q9,NavigationMenuList:F9,ScrollArea:H9}=await C("@baseplate-dev/ui-components"),{useState:bx}=await C("react");function P9({className:a}){const{definition:{enums:n=[]}}=z9(),[l,s]=bx(""),c=n.filter(m=>m.name.toLowerCase().includes(l.toLowerCase())),d=Kn(c,[m=>m.name]),[f,p]=bx(!1);return o.jsxs("div",{className:Te(a,"flex flex-1 flex-col space-y-4 overflow-y-auto"),children:[o.jsxs("div",{className:"space-y-4 px-4",children:[o.jsx(a2,{children:o.jsxs(vx,{variant:"secondary",className:"w-full",children:[o.jsx(Gi,{}),"New Enum"]})}),n.length>0&&o.jsxs("div",{className:"relative",children:[o.jsx(B9,{value:l,onChange:m=>{s(m)},placeholder:"Search"}),l&&o.jsx(vx,{variant:"ghost",className:"absolute top-1/2 right-4 -translate-y-1/2",size:"icon",onClick:()=>{s("")},children:o.jsx(yy,{})})]})]}),o.jsxs(H9,{className:Te("flex-1 px-2",f&&"border-t"),onScrollCapture:m=>{const g=m.currentTarget.scrollTop>0;g!==f&&p(g)},children:[d.length===0&&l&&o.jsx("div",{className:"py-4 text-center text-style-muted",children:"No enums found"}),o.jsx(_9,{orientation:"vertical",children:o.jsx(F9,{children:d.map(m=>o.jsx("li",{children:o.jsx(q9,{asChild:!0,children:o.jsx(Ht,{to:t2(m.id),children:m.name})})},m.id))})})]})]})}const{FeatureUtils:I9,modelEntityType:bm,modelScalarFieldEntityType:k9,modelSchema:V9,ModelUtils:G9}=await C("@baseplate-dev/project-builder-lib"),{usePluginEnhancedSchema:Y9,useProjectDefinition:X9,useResettableForm:Q9}=await C("@baseplate-dev/project-builder-lib/web"),{toast:nc,useEventCallback:K9}=await C("@baseplate-dev/ui-components"),{useMemo:jh}=await C("react");function Z9(){const a=k9.generateNewId();return{id:bm.generateNewId(),name:"",featureRef:"",service:{create:{enabled:!1},update:{enabled:!1},delete:{enabled:!1},transformers:[]},model:{primaryKeyFieldRefs:[a],fields:[{id:a,name:"id",type:"uuid",isOptional:!1,options:{default:"",genUuid:!0}}]}}}function Rs({onSubmitSuccess:a,isCreate:n,schema:l}={}){const{uid:s}=Qi(),{definition:c,saveDefinitionWithFeedback:d}=X9(),f=cn(),p=n?void 0:bm.fromUid(s),m=p?G9.byIdOrThrow(c,p):void 0;if(!n&&!m)throw new ij("The model you were looking for could not be found.");const g=jh(()=>Z9(),[]),v=Y9(l??V9),b=jh(()=>{const A=m??g;return l?v.parse(A):A},[m,g,l,v]),y=Q9({resolver:kt(v),defaultValues:b}),{reset:j,handleSubmit:D,setError:w}=y,R=K9(a),E=jh(()=>D(A=>{const O={...m,...A,id:m?.id??bm.generateNewId()};if(O.model.fields.length===0){nc.error("Model must have at least one field.");return}if(O.model.primaryKeyFieldRefs.length===0){nc.error("Model must have at least one primary key field.");return}if(c.models.find(G=>G.id!==A.id&&G.name.toLowerCase()===O.name.toLowerCase())){w("name",{message:`Model with name ${O.name} already exists.`});return}const{service:V}=O;if(V.create.enabled){if(!V.create.fields?.length&&!V.create.transformerNames?.length){nc.error("Create method must have at least one field or transformer.");return}}else V.create={enabled:!1};if(V.update.enabled){if(!V.update.fields?.length&&!V.update.transformerNames?.length){nc.error("Update method must have at least one field or transformer.");return}}else V.update={enabled:!1};return V.delete.enabled||(V.delete={enabled:!1}),!V.create.enabled&&!V.update.enabled&&!V.delete.enabled&&(O.service={create:{enabled:!1},update:{enabled:!1},delete:{enabled:!1},transformers:[]}),d(G=>{O.featureRef=I9.ensureFeatureByNameRecursively(G,O.featureRef),G.models=Kn([...G.models.filter(T=>T.id!==O.id),O],[T=>T.name])},{successMessage:n?"Successfully created model!":"Successfully saved model!",onSuccess:()=>{n?(f(e2(O.id)),j(g)):j(A),R?.()}})}),[j,w,D,d,n,f,R,c,g,m]);return{form:y,onSubmit:E,originalModel:m,defaultValues:b}}const{FeatureComboboxFieldController:W9}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:J9}=await C("@baseplate-dev/ui-components");function i2({className:a,control:n}){return o.jsxs("div",{className:Te("space-y-4",a),children:[o.jsx(J9,{control:n,label:"Name",name:"name",description:"The name of the model (PascalCase)"}),o.jsx(W9,{control:n,name:"featureRef",description:"The feature this model belongs to (dash-case)",canCreate:!0})]})}const{useBlockBeforeContinue:eN}=await C("@baseplate-dev/project-builder-lib/web"),{Button:xx,Dialog:tN,DialogClose:nN,DialogContent:aN,DialogDescription:iN,DialogFooter:lN,DialogHeader:rN,DialogTitle:sN,DialogTrigger:oN,useControlledState:cN}=await C("@baseplate-dev/ui-components");function xm({children:a,open:n,onOpenChange:l}){const[s,c]=cN(n,l,!1),{onSubmit:d,form:{control:f}}=Rs({isCreate:!0,onSubmitSuccess:()=>{c(!1)}}),p=eN();return o.jsxs(tN,{open:s,onOpenChange:m=>{m?p({onContinue:()=>{c(!0)}}):c(!1)},children:[o.jsx(oN,{asChild:!0,children:a}),o.jsxs(aN,{children:[o.jsxs(rN,{children:[o.jsx(sN,{children:"New Model"}),o.jsx(iN,{children:"Models define the structure of your data."})]}),o.jsxs("form",{onSubmit:d,className:"space-y-4",children:[o.jsx(i2,{control:f}),o.jsxs(lN,{children:[o.jsx(nN,{asChild:!0,children:o.jsx(xx,{variant:"secondary",children:"Cancel"})}),o.jsx(xx,{type:"submit",children:"Create Model"})]})]})]})]})}const{useProjectDefinition:uN}=await C("@baseplate-dev/project-builder-lib/web"),{Button:yx,InputField:dN,NavigationMenu:fN,NavigationMenuItemWithLink:hN,NavigationMenuList:mN,ScrollArea:pN}=await C("@baseplate-dev/ui-components"),{useState:jx}=await C("react");function gN({className:a}){const{definition:{models:n}}=uN(),[l,s]=jx(""),c=n.filter(m=>m.name.toLowerCase().includes(l.toLowerCase())),d=Kn(c,[m=>m.name]),[f,p]=jx(!1);return o.jsxs("div",{className:Te(a,"flex flex-1 flex-col space-y-4 overflow-y-auto"),children:[o.jsxs("div",{className:"space-y-4 px-4",children:[o.jsx(xm,{children:o.jsxs(yx,{variant:"secondary",className:"w-full",children:[o.jsx(Gi,{}),"New Model"]})}),n.length>0&&o.jsxs("div",{className:"relative",children:[o.jsx(dN,{value:l,onChange:m=>{s(m)},placeholder:"Search"}),l&&o.jsx(yx,{variant:"ghost",className:"absolute top-1/2 right-4 -translate-y-1/2",onClick:()=>{s("")},size:"icon",children:o.jsx(yy,{})})]})]}),o.jsxs(pN,{className:Te("flex-1 px-2",f&&"border-t"),onScrollCapture:m=>{const g=m.currentTarget.scrollTop>0;g!==f&&p(g)},children:[d.length===0&&l&&o.jsx("div",{className:"py-4 text-center text-style-muted",children:"No models found"}),o.jsx(fN,{orientation:"vertical",children:o.jsx(mN,{children:d.map(m=>o.jsx(hN,{asChild:!0,children:o.jsx(Ht,{to:e2(m.id),children:m.name})},m.id))})})]})]})}const{useProjectDefinition:vN}=await C("@baseplate-dev/project-builder-lib/web"),{NavigationTabs:bN,NavigationTabsItem:Sx,SidebarLayout:xN,SidebarLayoutContent:yN,SidebarLayoutSidebar:jN}=await C("@baseplate-dev/ui-components");function SN(){const{definition:{models:a=[],enums:n=[]}}=vN(),l=e6([...a,...n],d=>d.name.length)?.name,s=tb("/data/models/*"),c=tb("/data/enums/*");return o.jsxs(xN,{className:"flex-1",children:[o.jsxs(jN,{className:"flex h-[calc(100vh-var(--topbar-height)-1px)] max-w-sm min-w-[230px] flex-col space-y-4",width:"auto",noPadding:!0,children:[o.jsx("div",{className:"invisible block h-1 overflow-hidden font-semibold text-transparent",children:l}),o.jsx("div",{className:"px-4",children:o.jsxs(bN,{className:"w-full",children:[o.jsx(Sx,{asChild:!0,children:o.jsx(Ht,{to:"models",children:"Models"})}),o.jsx(Sx,{asChild:!0,children:o.jsx(Ht,{to:"enums",children:"Enums"})})]})}),s?o.jsx(gN,{}):null,c?o.jsx(P9,{}):null]}),o.jsx(yN,{className:"h-[calc(100vh-var(--topbar-height)-1px)]",children:o.jsx(Gl,{children:o.jsx(gi,{})})})]})}const{SectionListSection:wN,SectionListSectionContent:CN,SectionListSectionHeader:EN,SectionListSectionTitle:DN,SwitchFieldController:TN}=await C("@baseplate-dev/ui-components");function RN({control:a}){return o.jsxs(wN,{children:[o.jsx(EN,{children:o.jsx(DN,{children:"GraphQL"})}),o.jsx(CN,{className:"space-y-4",children:o.jsx(TN,{label:"Expose in GraphQL schema",control:a,name:"isExposed",description:"Whether to expose this enum in the GraphQL schema"})})]})}function NN(a){return a.split("_").map(s=>s.charAt(0).toUpperCase()+s.slice(1).toLowerCase()).join(" ")}const{modelEnumValueEntityType:MN}=await C("@baseplate-dev/project-builder-lib"),{Button:wx,InputFieldController:Cx,Label:Ex,SectionListSection:AN,SectionListSectionContent:$N,SectionListSectionDescription:LN,SectionListSectionHeader:ON,SectionListSectionTitle:UN}=await C("@baseplate-dev/ui-components");function zN({control:a,setValue:n}){const{fields:l,remove:s,append:c,move:d}=vs({control:a,name:"values"}),f=it({control:a,name:"values"}),p="grid grid-cols-[repeat(2,minmax(130px,1fr))_80px] gap-3",m=l.map((g,v)=>({id:g.id,element:o.jsxs("div",{className:p,children:[o.jsx(Cx,{control:a,name:`values.${v}.name`}),o.jsx(Cx,{control:a,name:`values.${v}.friendlyName`,onFocus:()=>{!f[v].friendlyName&&f[v].name&&n(`values.${v}.friendlyName`,NN(f[v].name))}}),o.jsxs(wx,{variant:"ghost",size:"icon",onClick:()=>{s(v)},children:[o.jsx(bs,{}),o.jsx("div",{className:"sr-only",children:"Delete Enum"})]})]})}));return o.jsxs(AN,{children:[o.jsxs(ON,{children:[o.jsx(UN,{children:"Values"}),o.jsx(LN,{children:"Configure the allowed values for this enum."})]}),o.jsxs($N,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:Te(p,"pl-12"),children:[o.jsx(Ex,{children:"Value Name, e.g. ACTIVE"}),o.jsx(Ex,{children:"Value Friendly Name, e.g. Active"}),o.jsx("div",{})]}),l.length===0?o.jsx("p",{className:"pt-4 text-style-muted",children:"Add some values to get started"}):o.jsx(Oj,{listItems:m,sortItems:d})]}),o.jsx(wx,{size:"sm",variant:"secondary",onClick:()=>{c({id:MN.generateNewId(),name:"",friendlyName:""})},children:"Add Value"})]})]})}const{enumBaseSchema:BN}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:_N}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:qN,SectionList:FN}=await C("@baseplate-dev/ui-components");function HN(){const{form:a,onSubmit:n,isSavingDefinition:l}=Jm({schema:BN.omit({name:!0,featureRef:!0})}),{control:s,setValue:c}=a;return _N({control:s,reset:a.reset,onSubmit:n}),o.jsx(Gl,{children:o.jsxs("form",{onSubmit:n,className:"mx-4 max-w-7xl min-w-[700px] flex-1 space-y-4 pb-4",children:[o.jsxs(FN,{children:[o.jsx(RN,{control:s}),o.jsx(zN,{control:s,setValue:c})]}),o.jsx(qN,{form:a,disabled:l})]})})}const{Button:Dx,Dialog:PN,DialogClose:IN,DialogContent:kN,DialogFooter:VN,DialogHeader:GN,DialogTitle:YN,DialogTrigger:XN,useControlledState:QN}=await C("@baseplate-dev/ui-components");function KN({open:a,onOpenChange:n,asChild:l,children:s}){const[c,d]=QN(a,n,!1),{form:{control:f,reset:p},onSubmit:m,defaultValues:g,isSavingDefinition:v}=Jm({onSubmitSuccess(){d(!1)}});return o.jsxs(PN,{open:c,onOpenChange:b=>{d(b),b||p(g)},children:[o.jsx(XN,{asChild:l,children:s}),o.jsx(kN,{"aria-describedby":void 0,children:o.jsxs("form",{onSubmit:m,className:"space-y-4",children:[o.jsx(GN,{children:o.jsx(YN,{children:"Edit Enum Info"})}),o.jsx(n2,{control:f}),o.jsxs(VN,{children:[o.jsx(IN,{asChild:!0,children:o.jsx(Dx,{variant:"secondary",children:"Cancel"})}),o.jsx(Dx,{type:"submit",disabled:v,children:"Save"})]})]})})]})}const{FeatureUtils:ZN}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:WN}=await C("@baseplate-dev/project-builder-lib/web"),{Button:JN,useConfirmDialog:eM}=await C("@baseplate-dev/ui-components");function tM({className:a,enumDefinition:n}){const{definition:l,saveDefinitionWithFeedbackSync:s,isSavingDefinition:c}=WN(),d=cn(),{requestConfirm:f}=eM(),p=m=>{s(g=>{g.enums=g.enums?.filter(v=>v.id!==m)},{onSuccess:()=>{d("/data/enums")}})};return o.jsxs("div",{className:Te("flex items-center justify-between",a),children:[o.jsxs("div",{children:[o.jsx(KN,{asChild:!0,children:o.jsxs("button",{className:"group flex items-center space-x-2 hover:cursor-pointer",type:"button",title:"Edit Enum Info",children:[o.jsx("h1",{children:n.name}),o.jsx(kl,{className:"invisible size-4 group-hover:visible"})]})}),n.featureRef&&o.jsx("div",{className:"text-xs text-muted-foreground",children:ZN.getFeatureById(l,n.featureRef)?.name})]}),o.jsx("div",{className:"flex gap-8",children:o.jsxs(JN,{variant:"outline",size:"icon",onClick:()=>{f({title:"Confirm delete",content:`Are you sure you want to delete ${n.name}?`,buttonConfirmVariant:"destructive",buttonConfirmText:"Delete",onConfirm:()=>{p(n.id)}})},disabled:c,children:[o.jsx(bs,{className:"text-destructive"}),o.jsx("div",{className:"sr-only",children:"Delete Enum"})]})})]})}const{EnumUtils:nM,modelEnumEntityType:aM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:iM}=await C("@baseplate-dev/project-builder-lib/web");function lM(){const{uid:a}=Qi(),{definition:n}=iM(),l=aM.fromUid(a),s=nM.byId(n,l??"");return s?o.jsxs("div",{className:"relative flex h-full flex-1 flex-col overflow-hidden",children:[o.jsx("div",{className:"mx-4 max-w-7xl space-y-4 border-b py-4",children:o.jsx(tM,{enumDefinition:s})}),o.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",children:o.jsx(gi,{})})]},l):o.jsx(Lc,{})}const{modelEnumEntityType:rM}=await C("@baseplate-dev/project-builder-lib"),sM={path:"edit/:uid/*",element:o.jsx(lM,{}),handle:{crumb:Pc(rM,"Edit Enum","/data/enums/edit/:uid")},children:[{index:!0,element:o.jsx(HN,{})},Ts]},{Button:oM}=await C("@baseplate-dev/ui-components");function cM(){return o.jsxs("div",{className:"max-w-4xl space-y-4 p-4 text-style-prose",children:[o.jsx("h1",{children:"Enums"}),o.jsxs("p",{children:["Enums are a way to define a set of named values. They can be used to define a type that can only have a certain set of values. For example, you might have an enum called ",o.jsx("strong",{children:"Color"})," with values"," ",o.jsx("code",{children:"RED"}),", ",o.jsx("code",{children:"GREEN"}),", and ",o.jsx("code",{children:"BLUE"}),"."]}),o.jsxs("p",{children:["Choose an enum to edit from the sidebar or"," ",o.jsx(a2,{children:o.jsx(oM,{variant:"link",size:"none",children:"create a new enum"})}),"."]})]})}const uM={path:"enums/*",handle:{crumb:{label:"Enums",url:"/data/enums"}},children:[{index:!0,element:o.jsx(cM,{})},sM,Ts]},{Button:Tx,Dialog:dM,DialogClose:fM,DialogContent:hM,DialogFooter:mM,DialogHeader:pM,DialogTitle:gM,DialogTrigger:vM,useControlledState:bM}=await C("@baseplate-dev/ui-components");function xM({open:a,onOpenChange:n,children:l,asChild:s}){const[c,d]=bM(a,n,!1),{form:{control:f,reset:p},onSubmit:m,defaultValues:g}=Rs({onSubmitSuccess(){d(!1)}});return o.jsxs(dM,{open:c,onOpenChange:v=>{d(v),v||p(g)},children:[l&&o.jsx(vM,{asChild:s,children:l}),o.jsx(hM,{"aria-describedby":void 0,children:o.jsxs("form",{onSubmit:m,className:"space-y-4",children:[o.jsx(pM,{children:o.jsx(gM,{children:"Edit Model Info"})}),o.jsx(i2,{control:f}),o.jsxs(mM,{children:[o.jsx(fM,{asChild:!0,children:o.jsx(Tx,{variant:"secondary",children:"Cancel"})}),o.jsx(Tx,{type:"submit",children:"Save"})]})]})})]})}const{FeatureUtils:yM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:jM}=await C("@baseplate-dev/project-builder-lib/web"),{Button:SM,useConfirmDialog:wM}=await C("@baseplate-dev/ui-components");function CM({className:a,model:n}){const{definition:l,saveDefinitionWithFeedbackSync:s,isSavingDefinition:c}=jM(),d=cn(),{requestConfirm:f}=wM(),p=m=>{s(g=>{g.models=g.models.filter(v=>v.id!==m)},{onSuccess:()=>{d("/data/models")},successMessage:"Successfully deleted model!"})};return o.jsxs("div",{className:Te("flex items-center justify-between border-b py-4",a),children:[o.jsxs("div",{children:[o.jsx(xM,{asChild:!0,children:o.jsxs("button",{className:"group flex items-center space-x-2 hover:cursor-pointer",type:"button",title:"Edit Model Info",children:[o.jsx("h1",{children:n.name}),o.jsx(kl,{className:"invisible size-4 group-hover:visible"})]})}),n.featureRef&&o.jsx("div",{className:"text-xs text-muted-foreground",children:yM.getFeatureById(l,n.featureRef)?.name})]}),o.jsx("div",{className:"flex gap-8",children:o.jsxs(SM,{variant:"outline",size:"icon",disabled:c,onClick:()=>{f({title:"Confirm delete",content:`Are you sure you want to delete ${n.name}?`,buttonConfirmText:"Delete",buttonConfirmVariant:"destructive",onConfirm:()=>{p(n.id)}})},children:[o.jsx(bs,{className:"text-destructive"}),o.jsx("div",{className:"sr-only",children:"Delete Model"})]})})]})}const{modelEntityType:EM,ModelUtils:DM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:TM}=await C("@baseplate-dev/project-builder-lib/web"),{NavigationTabs:RM,NavigationTabsItem:Sh}=await C("@baseplate-dev/ui-components");function NM(){const{uid:a}=Qi(),{definition:n}=TM(),l=EM.fromUid(a),s=DM.byId(n,l??"");return s?o.jsxs("div",{className:"relative flex h-full flex-1 flex-col overflow-hidden",children:[o.jsxs("div",{className:"max-w-7xl space-y-4 px-4 pb-4",children:[o.jsx(CM,{model:s}),o.jsxs(RM,{children:[o.jsx(Sh,{asChild:!0,children:o.jsx(Ht,{to:"",end:!0,children:"Fields"})}),o.jsx(Sh,{asChild:!0,children:o.jsx(Ht,{to:"service",children:"Service"})}),o.jsx(Sh,{asChild:!0,children:o.jsx(Ht,{to:"graphql",children:"GraphQL"})})]})]}),o.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",style:{"--action-bar-height":"52px"},children:o.jsx(gi,{})})]},l):o.jsx(Lc,{})}const{useRef:MM}=await C("react");function AM(a){const n=MM(void 0);return l=>{const s=a(l);return Iw(n.current,s)?n.current:(n.current=s,s)}}const{ModelUtils:$M}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:LM}=await C("@baseplate-dev/project-builder-lib/web"),{createContext:OM,useContext:UM,useEffect:zM,useMemo:BM}=await C("react"),l2=OM(void 0);function ep({children:a,watch:n,initialModel:l,getValues:s}){const{definition:c}=LM(),d=$M.byIdOrThrow(c,l.id),f=BM(()=>Sw(p=>({model:{...d,...l},setModel:m=>{p({model:{...d,...m}})},getValues:s})),[l,s,d]);return zM(()=>{const{unsubscribe:p}=n(m=>{f.getState().setModel(m)});return p},[n,f]),o.jsx(l2.Provider,{value:f,children:a})}function lt(a){const n=UM(l2);if(!n)throw new Error("useEditedModelConfig must be used within a EditedModelContextProvider");return jw(n,AM(l=>a(l.model)))}const{authConfigSpec:_M}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:qM}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:FM,AlertDescription:HM,AlertTitle:PM,MultiSwitchField:wh,SectionListSection:IM,SectionListSectionContent:kM,SectionListSectionDescription:VM,SectionListSectionHeader:GM,SectionListSectionTitle:YM,SwitchFieldController:Ch}=await C("@baseplate-dev/ui-components");function XM({control:a}){const{definition:n,pluginContainer:l}=qM(),s=l.getPluginSpecOptional(_M)?.getAuthRoles(n).map(y=>({label:y.name,value:y.id})),c=it({control:a,name:"graphql.objectType.enabled"}),d=lt(y=>y.service??{}),f=it({control:a,name:"graphql.mutations.create.enabled"}),p=d.create?.enabled,m=it({control:a,name:"graphql.mutations.update.enabled"}),g=d.update?.enabled,v=it({control:a,name:"graphql.mutations.delete.enabled"}),b=d.delete?.enabled;return o.jsxs(IM,{children:[o.jsx("div",{children:o.jsxs(GM,{className:"sticky top-2",children:[o.jsx(YM,{children:"Mutations"}),o.jsx(VM,{children:"Configure the GraphQL mutations that can be performed on this model."})]})}),o.jsxs(kM,{className:"space-y-8",children:[(!p||!g||!b)&&o.jsxs(FM,{className:"max-w-md",children:[o.jsx(Em,{}),o.jsxs(PM,{children:["Service methods disabled (",[!p&&"Create",!g&&"Update",!b&&"Delete"].filter(Boolean).join(", "),")"]}),o.jsxs(HM,{children:["Enable the appropriate methods on the"," ",o.jsx(It,{to:"../service",className:"font-semibold",children:"the service tab"})," ","to expose mutations"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx(Ch,{control:a,name:"graphql.mutations.create.enabled",disabled:!c||!p,label:"Create Mutation",description:"Expose the create method in the GraphQL schema, e.g. createUser(input: $input)."}),f&&s&&o.jsx(wh.Controller,{control:a,name:"graphql.mutations.create.roles",label:"Allowed Roles",options:s,className:"ml-[52px]"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx(Ch,{control:a,name:"graphql.mutations.update.enabled",label:"Update Mutation",disabled:!c||!g,description:"Expose the update method in the GraphQL schema, e.g. updateUser(id: $id, input: $input)."}),m&&s&&o.jsx(wh.Controller,{control:a,name:"graphql.mutations.update.roles",label:"Allowed Roles",options:s,className:"ml-[52px]"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ch,{control:a,name:"graphql.mutations.delete.enabled",label:"Delete Mutation",disabled:!c||!b,description:"Expose the delete method in the GraphQL schema, e.g. deleteUser(id: $id)."}),v&&s&&o.jsx(wh.Controller,{control:a,name:"graphql.mutations.delete.roles",label:"Allowed Roles",options:s,className:"ml-[52px]"})]})]})]})}function Eh(a){return Vi({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"},child:[]}]})(a)}function Dh(a){return Vi({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z",clipRule:"evenodd"},child:[]}]})(a)}const{modelTransformerEntityType:QM,ModelTransformerUtils:KM,ModelUtils:r2}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:ZM}=await C("@baseplate-dev/project-builder-lib/web"),{MultiComboboxFieldController:Rx,SelectFieldController:WM}=await C("@baseplate-dev/ui-components"),{useEffect:JM}=await C("react");function eA({formProps:a,name:n}){const l=n,s=a,{control:c,setValue:d}=s,{definition:f,definitionContainer:p,pluginContainer:m}=ZM(),g=it({control:c,name:l}),v=lt(E=>{const A=r2.getRelationsToModel(f,E.id),O=E.service?.transformers?.filter(P=>P.type==="embeddedRelation"&&P.id!==g.id);return A.filter(({relation:P})=>!O?.some(V=>V.foreignRelationRef===P.foreignId))}),b=v.map(E=>({label:`${E.relation.foreignRelationName} (${E.model.name})`,value:E.relation.foreignId})),y=g.type==="embeddedRelation"?g:null,j=v.find(E=>E.relation.foreignId===y?.foreignRelationRef),D=Om(y?.foreignRelationRef);JM(()=>{D!==void 0&&D!==y?.foreignRelationRef&&(d(`${l}.embeddedFieldNames`,[]),j?.model.id&&d(`${l}.modelRef`,j.model.id))},[l,d,j,y?.foreignRelationRef,D,v]);const w=j?.model.model.fields.filter(E=>!j.relation.references.some(A=>A.localRef===E.id)).map(E=>({label:E.name,value:E.id}))??[],R=j?.model.service.transformers.map(E=>({label:KM.getTransformName(p,E,m),value:E.id}))??[];return o.jsxs("div",{className:"space-y-4",children:[o.jsx(WM,{control:c,name:`${l}.foreignRelationRef`,options:b,label:"Relation",placeholder:"Select relation"}),o.jsx(Rx,{control:c,disabled:w.length===0,options:w,name:`${l}.embeddedFieldNames`,label:"Embedded Field Names"}),R.length>0&&o.jsx(Rx,{control:c,options:R,name:`${l}.embeddedTransformerNames`,label:"Embedded Transformers"})]})}const tA={name:"embeddedRelation",label:"Embedded Relation",description:"Upsert records to a related model table",instructions:`This transformer allows you to upsert related records to a related model's table
|
|
67
|
-
e.g. UserRole records for a User. It will create, update, delete related records to fit the provided
|
|
68
|
-
input.`,getSummary(a,n){return[{label:"Embedded Relation",description:n.nameFromId(a.foreignRelationRef)}]},allowNewTransformer(a,n){const{definition:l}=a,s=r2.getRelationsToModel(l,n.id),c=n.service?.transformers?.filter(d=>d.type==="embeddedRelation");return s.some(({relation:d})=>!c?.some(f=>f.foreignRelationRef===d.foreignId))},getNewTransformer:()=>({id:QM.generateNewId(),foreignRelationRef:"",type:"embeddedRelation",embeddedFieldNames:[],modelRef:""}),Form:eA,pluginId:void 0},{modelTransformerEntityType:nA}=await C("@baseplate-dev/project-builder-lib"),{createNewModelTransformerWebConfig:aA}=await C("@baseplate-dev/project-builder-lib/web"),tp=[tA,aA({name:"password",label:"Password",description:"Hashes the input value of value 'password' using Argon2id",getNewTransformer:()=>({id:nA.generateNewId(),type:"password"}),allowNewTransformer(a,n){return!n.service?.transformers?.some(l=>l.type==="password")&&n.model.fields.some(l=>l.name==="passwordHash")},getSummary:()=>[],pluginId:void 0})],np={string:{label:"String",value:"string",description:"Variable length text"},int:{label:"Integer",value:"int",description:"Whole number"},float:{label:"Float",value:"float",description:"Decimal number"},decimal:{label:"Decimal",value:"decimal",description:"Precise decimal number"},boolean:{label:"Boolean",value:"boolean",description:"True or false value"},json:{label:"JSON",value:"json",description:"JSON data"},uuid:{label:"UUID",value:"uuid",description:"Unique identifier"},dateTime:{label:"DateTime",value:"dateTime",description:"Date and time"},date:{label:"Date",value:"date",description:"Calendar date"},enum:{label:"Enum",value:"enum",description:"List of values"}};function iA(a){const n=/([_\s-]*[A-Z]+(?![^\s\-_A-Z])|[_\s-]*[A-Z]*[^\s\-_A-Z]+)/g;return a.match(n)??[]}function Nx(a,n){return a.length<=n?a:`${a.slice(0,Math.max(0,n-3))}...`}function lA(a,n=20){if(a.length<=n)return a;if(a.length<=3)return"...";const l=iA(a);if(l.length===1)return Nx(a,n);const s=l[0],c=(l.at(-1)??"").replace(/^[_\s-]+/,""),d=c.length;if(s.length+d+3>n)return Nx(a,n);let f=s;for(let p=1;p<l.length-1;p++){const m=l[p].length;if(f.length+m+d+3>n)break;f+=l[p]}return`${f}...${c}`}const{Badge:rA}=await C("@baseplate-dev/ui-components");function rs({className:a,children:n,type:l}){return o.jsxs("div",{className:Te("flex h-8 w-full items-center justify-between gap-4 rounded-md border bg-muted px-3 text-sm",a),children:[o.jsx("div",{children:n}),o.jsx(rA,{variant:"outline",className:"text-muted-foreground",children:lA(l,20)})]})}const{ModelUtils:sA}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:oA}=await C("@baseplate-dev/project-builder-lib/web"),{Badge:Th,Button:Rh,Label:Nh,SectionListSection:cA,SectionListSectionContent:uA,SectionListSectionDescription:dA,SectionListSectionHeader:fA,SectionListSectionTitle:hA,Switch:Mh,SwitchFieldController:mA}=await C("@baseplate-dev/ui-components"),{useState:Ah}=await C("react"),pA="border-collapse text-left [&_td]:py-1 [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-10 [&_th]:py-2";function $h(a,n,l,s){return l?a.filter(c=>n.includes(c.id)||c.id===s).map(c=>c.id):n.filter(c=>c!==s)}function gA({control:a}){const{definitionContainer:n,definition:l}=oA(),s=lt(T=>T.id),c=it({control:a,name:"graphql.objectType.enabled"}),d=lt(T=>T.model.fields),{field:{value:f=[],onChange:p}}=da({control:a,name:"graphql.objectType.fields"}),m=d.length>10,[g,v]=Ah(m),b=lt(T=>T.model.relations)??[],{field:{value:y=[],onChange:j}}=da({control:a,name:"graphql.objectType.localRelations"}),D=b.length>4,[w,R]=Ah(D),E=sA.getRelationsToModel(l,s),{field:{value:A=[],onChange:O}}=da({control:a,name:"graphql.objectType.foreignRelations"}),P=E.length>4,[V,G]=Ah(P);return o.jsxs(cA,{children:[o.jsx("div",{children:o.jsxs(fA,{className:"sticky top-2",children:[o.jsx(hA,{children:"Object Type"}),o.jsx(dA,{children:"Configure the object type that will be exposed in the GraphQL schema for this model."})]})}),o.jsxs(uA,{className:"space-y-4",children:[o.jsx(mA,{control:a,name:"graphql.objectType.enabled",label:"Enable Object Type",description:"Must be enabled for queries, mutations, and any relations to this model"}),o.jsxs("table",{className:pA,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:o.jsxs("div",{className:"flex w-80 items-center gap-1",children:[o.jsx(Nh,{children:"Exposed Fields"}),o.jsxs(Th,{variant:"outline",className:"mr-5 font-medium text-muted-foreground",children:[f.length,"/",d.length," active"]}),m?o.jsx(Rh,{onClick:()=>{v(!g)},className:"flex items-center gap-4",title:g?"Expand fields":"Collapse fields",type:"button",variant:"ghost",size:"icon",children:g?o.jsx(Eh,{}):o.jsx(Dh,{})}):null]})}),o.jsx("th",{className:"pl-8"})]})}),o.jsxs("tbody",{children:[!g&&d.map(T=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(rs,{type:T.type==="enum"&&T.options?.enumRef?n.nameFromId(T.options.enumRef):np[T.type].label,children:T.name})}),o.jsx("td",{className:"pl-8",children:o.jsx(Mh,{"aria-label":`Expose ${T.name} field`,disabled:!c,checked:f.includes(T.id),onCheckedChange:B=>{p($h(d,f,B,T.id))}})})]},T.id)),b.length>0?o.jsxs("tr",{children:[o.jsx("th",{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Nh,{children:"Exposed Local Relations"}),o.jsxs(Th,{variant:"outline",className:"mr-5 font-medium text-muted-foreground",children:[y.length,"/",b.length," ","active"]}),D?o.jsx(Rh,{onClick:()=>{R(!w)},className:"flex items-center gap-4",title:w?"Expand fields":"Collapse fields",type:"button",variant:"ghost",size:"icon",children:w?o.jsx(Eh,{}):o.jsx(Dh,{})}):null]})}),o.jsx("th",{})]}):null,!w&&b.map(T=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(rs,{type:n.nameFromId(T.modelRef),children:T.name})}),o.jsx("td",{className:"pl-8",children:o.jsx(Mh,{"aria-label":`Expose ${T.name} relation`,disabled:!c,checked:y.includes(T.id),onCheckedChange:B=>{j($h(b,y,B,T.id))}})})]},T.id)),E.length>0?o.jsxs("tr",{children:[o.jsx("th",{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Nh,{children:"Exposed Foreign Relations"}),o.jsxs(Th,{variant:"outline",className:"mr-5 font-medium text-muted-foreground",children:[A.length,"/",E.length," ","active"]}),P?o.jsx(Rh,{onClick:()=>{G(!V)},className:"flex items-center gap-4",title:V?"Expand fields":"Collapse fields",type:"button",variant:"ghost",size:"icon",children:V?o.jsx(Eh,{}):o.jsx(Dh,{})}):null]})}),o.jsx("th",{})]}):null,!V&&E.map(({model:T,relation:B})=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(rs,{type:T.name,children:B.foreignRelationName})}),o.jsx("td",{className:"pl-8",children:o.jsx(Mh,{"aria-label":`Expose ${B.foreignRelationName} relation`,disabled:!c,checked:A.includes(B.foreignId),onCheckedChange:W=>{O($h(E.map(({relation:ne})=>({id:ne.foreignId})),A,W,B.foreignId))}})})]},B.id))]})]})]})]})}const{authConfigSpec:vA}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:bA}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:xA,AlertDescription:yA,AlertTitle:jA,MultiSwitchField:Mx,SectionListSection:SA,SectionListSectionContent:wA,SectionListSectionDescription:CA,SectionListSectionHeader:EA,SectionListSectionTitle:DA,SwitchFieldController:Ax}=await C("@baseplate-dev/ui-components");function TA({control:a}){const{definition:n,pluginContainer:l}=bA(),s=it({control:a,name:"graphql.objectType.enabled"}),c=l.getPluginSpecOptional(vA)?.getAuthRoles(n).map(p=>({label:p.name,value:p.id})),d=it({control:a,name:"graphql.queries.get.enabled"}),f=it({control:a,name:"graphql.queries.list.enabled"});return o.jsxs(SA,{children:[o.jsx("div",{children:o.jsxs(EA,{className:"sticky top-2",children:[o.jsx(DA,{children:"Queries"}),o.jsx(CA,{children:"Configure the GraphQL queries that can be performed on this model."})]})}),o.jsxs(wA,{className:"space-y-8",children:[!s&&o.jsxs(xA,{className:"max-w-md",children:[o.jsx(Em,{}),o.jsx(jA,{children:"Object type missing"}),o.jsx(yA,{children:"Enable the object type to expose queries and mutations"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx(Ax,{control:a,name:"graphql.queries.get.enabled",label:"Get By ID Query",disabled:!s,description:"Expose method for querying a single instance of this model by its ID, e.g. user(id: $id)."}),d&&c&&o.jsx(Mx.Controller,{control:a,name:"graphql.queries.get.roles",label:"Allowed Roles",options:c,className:"ml-[52px]"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx(Ax,{control:a,name:"graphql.queries.list.enabled",disabled:!s,label:"List Query",description:"Expose method for querying a list of instances of this model, e.g. users."}),f&&c&&o.jsx(Mx.Controller,{control:a,name:"graphql.queries.list.roles",label:"Allowed Roles",options:c,className:"ml-[52px]"})]})]})]})}const{modelBaseSchema:RA}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:NA}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:MA,SectionList:AA}=await C("@baseplate-dev/ui-components"),$A=RA.omit({name:!0,featureRef:!0});function LA(){const{form:a,onSubmit:n,defaultValues:l}=Rs({schema:$A}),{control:s,watch:c,getValues:d,reset:f}=a;return NA({control:s,reset:f,onSubmit:n}),o.jsx(ep,{initialModel:l,getValues:d,watch:c,children:o.jsx("form",{onSubmit:n,className:"space-y-4 p-4",children:o.jsxs(AA,{children:[o.jsx(gA,{control:s}),o.jsx(TA,{control:s}),o.jsx(XM,{control:s}),o.jsx(MA,{form:a})]})})})}const{modelScalarFieldEntityType:$x}=await C("@baseplate-dev/project-builder-lib"),{Button:Lx,ButtonGroup:OA,DropdownMenu:UA,DropdownMenuContent:zA,DropdownMenuItem:BA,DropdownMenuTrigger:_A}=await C("@baseplate-dev/ui-components"),{useMemo:qA}=await C("react");function FA({className:a,appendField:n,setValue:l}){const s=lt(p=>p.model.fields.map(m=>m.name)),c=lt(p=>p.model.primaryKeyFieldRefs.length),d=qA(()=>{const p=[];c||p.push({name:"ID (uuid)",fields:[{name:"id",type:"uuid",options:{genUuid:!0},isPrimaryKey:!0}]});const m=s.includes("createdAt"),g=s.includes("updatedAt");return(!m||!g)&&p.push({name:"Timestamps",fields:[{name:"createdAt",type:"dateTime",options:{defaultToNow:!0}},{name:"updatedAt",type:"dateTime",options:{updatedAt:!0,defaultToNow:!0}}]}),p},[s,c]),f=p=>{for(const{isPrimaryKey:m,...g}of p.fields){const v=$x.generateNewId();s.includes(g.name)||n({id:v,...g}),m&&l("model.primaryKeyFieldRefs",[v],{shouldDirty:!0})}};return o.jsxs(OA,{className:a,children:[o.jsx(Lx,{variant:"secondary",onClick:()=>{n({id:$x.generateNewId(),name:"",type:"string",isOptional:!0,options:{default:""}})},size:"sm",children:"Add Field"}),o.jsxs(UA,{children:[o.jsx(_A,{disabled:d.length===0,asChild:!0,children:o.jsx(Lx,{variant:"secondary",size:"sm",children:o.jsx(Aw,{})})}),o.jsx(zA,{children:d.map(p=>o.jsx(BA,{onClick:()=>{f(p)},children:p.name},p.name))})]})]})}const{Button:Ox,DialogClose:HA,DialogFooter:PA,MultiComboboxFieldController:IA}=await C("@baseplate-dev/ui-components"),{useId:kA}=await C("react"),{z:Lh}=await C("zod"),VA=Lh.object({fields:Lh.array(Lh.string()).min(1,"At least one primary key is required")});function GA({className:a,control:n,onSubmitSuccess:l}){const s=lt(v=>v.model.fields),{field:{value:c=[],onChange:d}}=da({name:"model.primaryKeyFieldRefs",control:n}),{control:f,handleSubmit:p}=pi({resolver:kt(VA),values:{fields:c}}),m=p(v=>{d(v.fields),l?.()}),g=kA();return o.jsxs("form",{className:Te("space-y-4",a),onSubmit:v=>(v.stopPropagation(),m(v)),id:g,children:[o.jsx(IA,{control:f,name:"fields",options:s.map(v=>({value:v.id,label:v.name})),placeholder:"Select fields to use as primary keys"}),o.jsxs(PA,{children:[o.jsx(HA,{asChild:!0,children:o.jsx(Ox,{variant:"secondary",children:"Cancel"})}),o.jsx(Ox,{type:"submit",form:g,children:"Save"})]})]})}const{Dialog:YA,DialogContent:XA,DialogDescription:QA,DialogHeader:KA,DialogTitle:ZA,DialogTrigger:WA,useControlledState:JA}=await C("@baseplate-dev/ui-components");function s2({control:a,children:n,asChild:l,open:s,onOpenChange:c}){const[d,f]=JA(s,c,!1);return o.jsxs(YA,{open:d,onOpenChange:f,children:[n&&o.jsx(WA,{asChild:l,children:n}),o.jsxs(XA,{children:[o.jsxs(KA,{children:[o.jsx(ZA,{children:"Primary Keys"}),o.jsx(QA,{children:"Select the fields that will be used as the primary key for this model"})]}),o.jsx(GA,{control:a,onSubmitSuccess:()=>{f(!1)}})]})]})}const{BadgeWithIcon:e$}=await C("@baseplate-dev/ui-components"),{useState:t$}=await C("react");function n$({className:a,control:n,autoCollapse:l}){const[s,c]=t$(!1),d=!l||s;return o.jsx(s2,{control:n,children:o.jsx(e$,{icon:$w,variant:"secondary",className:a,onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)},"aria-label":"Primary Key",title:"Primary Key",children:d&&"Primary"})})}const{ModelFieldUtils:a$,modelForeignRelationEntityType:i$,modelLocalRelationEntityType:l$,modelRelationFieldSchema:r$,ModelUtils:Ux}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:s$}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Oh,ComboboxField:o$,ComboboxFieldController:Uh,DialogClose:c$,DialogFooter:u$,InputFieldController:zx,SelectFieldController:d$,toast:Bx}=await C("@baseplate-dev/ui-components"),o2=await C("react"),{useId:f$,useMemo:h$}=o2;function m$(a,n,l){if(!l)return;const s=l.replace(/Id$/,""),c=m=>a.models.find(g=>g.id!==n.id&&m(g))?.id,d=c(m=>m.name.toLowerCase()===s.toLowerCase());if(d)return d;const f=c(m=>m.featureRef===m.featureRef&&m.name.toLowerCase().includes(s.toLowerCase()));return f||c(m=>m.name.toLowerCase().includes(s.toLowerCase()))}function _x(a,n,l,s){const c=(()=>{if(l.name)return l.name;if(l.modelRef){const p=Ux.byIdOrThrow(a,l.modelRef);return _l(p.name)}})(),d=(()=>{if(!l.modelRef)return;const{model:{fields:p,primaryKeyFieldRefs:m},name:g}=Ux.byIdOrThrow(a,l.modelRef),v=p.filter(y=>m.includes(y.id)),b=l.references??[];return v.map((y,j)=>{const D=j===0&&s?s:v.length===1?`${_l(g)}Id`:y.name;return{localRef:b[j]?.localRef??n.model.fields.find(R=>R.name===D)?.id,foreignRef:y.id}})})(),f=(()=>{if(!d)return;if(l.foreignRelationName)return l.foreignRelationName;const p=d.every(m=>m.localRef)&&a$.areScalarsUnique(n,d.map(m=>m.localRef));return _l(p?n.name:Sy.pluralize(n.name))})();return{name:c??"",foreignRelationName:f??"",references:d??[]}}function p$({className:a,control:n,onSubmitSuccess:l,relationId:s,defaultFieldName:c}){const{definition:d}=s$(),f=lt(se=>se),p=f.name,{fields:m}=f.model,{field:{value:g=[],onChange:v}}=da({name:"model.relations",control:n}),b=d.models.map(se=>({label:se.name,value:se.id})),y=s===void 0?void 0:g.find(se=>se.id===s),j=h$(()=>{if(y)return y;const se=m$(d,f,c);return{id:l$.generateNewId(),foreignId:i$.generateNewId(),modelRef:se??"",onDelete:"Restrict",onUpdate:"Restrict",..._x(d,f,{modelRef:se},c)}},[y,c,d,f]),{control:D,handleSubmit:w,setError:R,watch:E,setValue:A}=pi({resolver:kt(r$),defaultValues:j}),O=E(),P=O.modelRef?d.models.find(se=>se.id===O.modelRef):void 0,V=P?.model.fields,G=m.map(se=>({label:se.name,value:se.id})),T=V?.map(se=>({label:se.name,value:se.id}))??[],B=O.references.some(se=>m.find(Z=>Z.id===se.localRef)?.isOptional),W=()=>{v(g.filter(se=>se.id!==s)),l?.()},ne=w(se=>{const{id:Z}=se;if(m.some(F=>F.name===se.name)||g.some(F=>F.name===se.name&&F.id!==se.id)){R("name",{message:"The relation name cannot be the same as a field/relation name"});return}const J=se.references.map(F=>F.localRef);if(new Set(J).size!==J.length){Bx.error("Local fields must be unique");return}const U=se.references.map(F=>F.foreignRef);if(new Set(U).size!==U.length){Bx.error("Foreign fields must be unique");return}g.some(F=>F.id===Z)?v(g.map(F=>F.id===Z?se:F)):v([...g,se]),l?.()}),ae=f$(),oe=!!P;return o.jsxs("form",{className:Te("space-y-4",a),onSubmit:se=>(se.stopPropagation(),ne(se)),id:ae,children:[o.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2",children:[o.jsx(o$,{options:[{label:p,value:p}],value:p,disabled:!0,label:"Local Model"}),o.jsx(Uh,{control:D,name:"modelRef",options:b,label:"Foreign Model",onChange:se=>{if(!se)return;const{foreignRelationName:Z,name:J,references:U}=_x(d,f,{...O,modelRef:se},c);Z&&A("foreignRelationName",Z),J&&A("name",J),A("references",U)}})]}),o.jsxs("div",{className:Te("grid grid-cols-2 gap-x-8 gap-y-2",!oe&&"pointer-events-none opacity-50"),children:[o.jsx(zx,{control:D,disabled:!oe,name:"name",label:"Local Relation Name",description:o.jsxs("span",{children:["Name of the relation, e.g. ",_l(p),".",o.jsx("strong",{children:P?.name?_l(P.name):"user"})]})}),o.jsx(zx,{control:D,disabled:!oe,name:"foreignRelationName",label:"Foreign Relation Name",description:o.jsxs("span",{children:["Name of the relation on the foreign model, e.g."," ",_l(P?.name??"post"),".",o.jsx("strong",{children:j.foreignRelationName||"user"})]})}),o.jsx("div",{className:"text-sm font-medium",children:"Local Field"}),o.jsx("div",{className:"text-sm font-medium",children:"Foreign Field"}),O.references.map((se,Z)=>o.jsxs(o2.Fragment,{children:[o.jsx(Uh,{disabled:!oe,control:D,name:`references.${Z}.localRef`,options:G}),o.jsx(Uh,{control:D,name:`references.${Z}.foreignRef`,options:T,disabled:!0})]},Z))]}),o.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 border-t pt-4",children:o.jsx(d$,{label:"On Delete",control:D,options:[{label:"Cascade (delete entire local row)",value:"Cascade"},{label:"Restrict (throw error)",value:"Restrict"},...B?[{label:"Set Null (set local field to null)",value:"SetNull"}]:[]],name:"onDelete",description:"What to do when the foreign row is deleted"})}),o.jsx(u$,{children:o.jsxs("div",{className:"flex w-full justify-between",children:[s&&o.jsx(Oh,{variant:"secondary",onClick:se=>{se.preventDefault(),W()},children:"Delete"}),o.jsxs("div",{className:"flex gap-4",children:[o.jsx(c$,{asChild:!0,children:o.jsx(Oh,{variant:"secondary",children:"Cancel"})}),o.jsx(Oh,{type:"submit",form:ae,disabled:!oe,children:"Save"})]})]})})]})}const{Dialog:g$,DialogContent:v$,DialogDescription:b$,DialogHeader:x$,DialogTitle:y$,DialogTrigger:j$,useControlledState:S$}=await C("@baseplate-dev/ui-components");function Tc({control:a,children:n,asChild:l,open:s,onOpenChange:c,relationId:d,defaultFieldName:f}){const[p,m]=S$(s,c,!1);return o.jsxs(g$,{open:p,onOpenChange:m,children:[n&&o.jsx(j$,{asChild:l,children:n}),o.jsxs(v$,{width:"lg",children:[o.jsxs(x$,{children:[o.jsx(y$,{children:d?"Edit Relation":"Create Relation"}),o.jsx(b$,{children:"Set up the relation between this model and another model"})]}),o.jsx(p$,{control:a,onSubmitSuccess:()=>{m(!1)},relationId:d,defaultFieldName:f})]})]})}const{useProjectDefinition:w$}=await C("@baseplate-dev/project-builder-lib/web"),{BadgeWithIcon:C$}=await C("@baseplate-dev/ui-components"),{useState:E$}=await C("react");function D$({className:a,control:n,relation:l,autoCollapse:s}){const{definitionContainer:c}=w$(),[d,f]=E$(!1),p=!s||d;return o.jsx(Tc,{control:n,relationId:l.id,children:o.jsx(C$,{icon:Lw,variant:"secondary",className:Te("max-w-[100px]",a),onMouseEnter:()=>{f(!0)},onMouseLeave:()=>{f(!1)},"aria-label":"Relation",title:"Relation",children:p&&`${c.nameFromId(l.modelRef)} ${l.references.length>1?`(${l.references.length})`:""}`})})}const{modelUniqueConstraintEntityType:T$}=await C("@baseplate-dev/project-builder-lib"),{Button:zh,DialogClose:R$,DialogFooter:N$,MultiComboboxFieldController:M$}=await C("@baseplate-dev/ui-components"),{useId:A$}=await C("react"),{z:ac}=await C("zod"),$$=ac.object({id:ac.string().optional(),fields:ac.array(ac.string()).min(1,"At least one field is required")});function L$({className:a,control:n,onSubmitSuccess:l,constraintId:s}){const c=lt(j=>j.model.fields),{field:{value:d=[],onChange:f}}=da({name:"model.uniqueConstraints",control:n}),p=s===void 0?void 0:d.find(j=>j.id===s),{control:m,handleSubmit:g}=pi({resolver:kt($$),values:p?{id:p.id,fields:p.fields.map(j=>j.fieldRef)}:{fields:[]}}),v=()=>{f(d.filter(j=>j.id!==s)),l?.()},b=g(j=>{const D={id:j.id??T$.generateNewId(),fields:j.fields.map(R=>({fieldRef:R}))},{id:w}=D;d.some(R=>R.id===w)?f(d.map(R=>R.id===w?D:R)):f([...d,D]),l?.()}),y=A$();return o.jsxs("form",{className:Te("space-y-4",a),onSubmit:j=>(j.stopPropagation(),b(j)),id:y,children:[o.jsx(M$,{control:m,name:"fields",options:c.map(j=>({value:j.id,label:j.name})),placeholder:"Select fields to use as primary keys"}),o.jsx(N$,{children:o.jsxs("div",{className:"flex w-full justify-between",children:[s&&o.jsx(zh,{variant:"secondary",onClick:j=>{j.preventDefault(),v()},children:"Delete"}),o.jsxs("div",{className:"flex gap-4",children:[o.jsx(R$,{asChild:!0,children:o.jsx(zh,{variant:"secondary",children:"Cancel"})}),o.jsx(zh,{type:"submit",form:y,children:"Save"})]})]})})]})}const{Dialog:O$,DialogContent:U$,DialogDescription:z$,DialogHeader:B$,DialogTitle:_$,DialogTrigger:q$,useControlledState:F$}=await C("@baseplate-dev/ui-components");function Rc({control:a,children:n,asChild:l,open:s,onOpenChange:c,constraintId:d}){const[f,p]=F$(s,c,!1);return o.jsxs(O$,{open:f,onOpenChange:p,children:[n&&o.jsx(q$,{asChild:l,children:n}),o.jsxs(U$,{children:[o.jsxs(B$,{children:[o.jsx(_$,{children:"Unique Constraint"}),o.jsx(z$,{children:"Select the fields that will be part of this unique constraint."})]}),o.jsx(L$,{control:a,onSubmitSuccess:()=>{p(!1)},constraintId:d})]})]})}const{BadgeWithIcon:H$}=await C("@baseplate-dev/ui-components"),{useState:P$}=await C("react");function I$({className:a,control:n,constraintId:l,autoCollapse:s}){const[c,d]=P$(!1),f=!s||c,p=lt(m=>m.model.uniqueConstraints?.find(g=>g.id===l)?.fields.length??0);return o.jsx(Rc,{control:n,constraintId:l,children:o.jsx(H$,{variant:"secondary",icon:Ow,className:Te("",a),onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},"aria-label":"Unique Constraint",title:"Unique Constraint",children:f&&`Unique ${p>1?`(${p})`:""}`})})}function k$({className:a,control:n,idx:l}){const s=lt(v=>v.model.fields[l]),c=lt(v=>v.model.primaryKeyFieldRefs.includes(s.id)),d=lt(v=>v.model.uniqueConstraints?.filter(b=>b.fields.some(y=>y.fieldRef===s.id)).map(b=>b.id)??[]),f=lt(({model:v})=>{const b=v.fields[l];return v.relations?.filter(y=>y.references.some(j=>j.localRef===b.id))??[]}),m=(c?1:0)+d.length+f.length>2,g=[c&&o.jsx(n$,{control:n,autoCollapse:m},"primary"),...d.map(v=>o.jsx(I$,{control:n,constraintId:v,autoCollapse:m},v)),...f.map(v=>o.jsx(D$,{control:n,relation:v,autoCollapse:m},v.id))];return o.jsx("div",{className:Te("flex gap-4",a),children:g})}const{EnumUtils:V$}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:G$}=await C("@baseplate-dev/project-builder-lib/web"),{Button:_i,ComboboxField:Y$,DropdownMenu:qx,DropdownMenuContent:Fx,DropdownMenuGroup:Hx,DropdownMenuItem:Bh,DropdownMenuTrigger:Px,InputField:Ix,InputFieldController:_h,SelectFieldController:X$}=await C("@baseplate-dev/ui-components");function Q$({control:a,idx:n,setValue:l}){const{definition:s}=G$(),c=it({control:a,name:`model.fields.${n}.type`}),{field:{value:d,onChange:f}}=da({name:`model.fields.${n}.options`,control:a}),p=it({control:a,name:`model.fields.${n}.options.default`});if(c==="boolean")return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(X$,{control:a,className:"flex-1",name:`model.fields.${n}.options.default`,options:[{label:"True",value:"true"},{label:"False",value:"false"}],placeholder:"NULL"}),p&&o.jsx(_i,{title:"Reset",onClick:()=>{l(`model.fields.${n}.options.default`,"",{shouldDirty:!0})},variant:"ghost",size:"icon",children:o.jsx(Zr,{})})]});if(["string","int","float"].includes(c))return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(_h,{control:a,placeholder:"NULL",name:`model.fields.${n}.options.default`,className:"flex-1"}),p&&o.jsx(_i,{title:"Reset",onClick:()=>{l(`model.fields.${n}.options.default`,void 0,{shouldDirty:!0})},variant:"ghost",size:"icon",children:o.jsx(Zr,{})})]});if(c==="uuid")return d?.genUuid?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ix,{disabled:!0,value:"Random UUID v4",className:"flex-1"}),o.jsx(_i,{title:"Reset",onClick:()=>{f({...d,genUuid:!1})},variant:"ghost",size:"icon",children:o.jsx(Zr,{})})]}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(_h,{control:a,placeholder:"NULL",name:`model.fields.${n}.options.default`,className:"flex-1"}),o.jsxs(qx,{children:[o.jsx(Px,{asChild:!0,children:o.jsx(_i,{title:"Options",variant:"ghost",size:"icon",children:o.jsx(Dc,{})})}),o.jsx(Fx,{children:o.jsx(Hx,{children:o.jsx(Bh,{onSelect:()=>{f({...d,genUuid:!0})},children:"Random UUID v4"})})})]})]});if(c==="dateTime"||c==="date"){const{defaultToNow:m,updatedAt:g}=d??{};return m??g?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ix,{disabled:!0,value:g?"Last Updated":"Now",className:"flex-1"}),o.jsx(_i,{title:"Reset",onClick:()=>{f({...d,defaultToNow:!1,updatedAt:!1})},variant:"ghost",size:"icon",children:o.jsx(Zr,{})})]}):o.jsxs("div",{className:"flex items-center space-x-1",children:[o.jsx(_h,{placeholder:"NULL",control:a,name:`model.fields.${n}.options.default`,className:"flex-1"}),o.jsxs(qx,{children:[o.jsx(Px,{asChild:!0,children:o.jsx(_i,{title:"Options",variant:"ghost",size:"icon",children:o.jsx(Dc,{})})}),o.jsx(Fx,{children:o.jsxs(Hx,{children:[o.jsx(Bh,{onSelect:()=>{f({...d,defaultToNow:!0,updatedAt:!1})},children:"Now"}),o.jsx(Bh,{onSelect:()=>{f({...d,defaultToNow:!0,updatedAt:!0})},children:"Last Updated At"})]})})]})]})}if(c==="enum"&&d?.enumRef){const g=V$.byIdOrThrow(s,d.enumRef).values.map(v=>({label:v.friendlyName,value:v.id}));return o.jsxs("div",{className:"flex items-center space-x-1",children:[o.jsx(Y$,{placeholder:"NULL",value:d.defaultEnumValueRef??null,onChange:v=>{f({...d,defaultEnumValueRef:v||void 0})},options:g,className:"flex-1"}),d.defaultEnumValueRef&&o.jsx(_i,{title:"Reset",onClick:()=>{f({...d,defaultEnumValueRef:""})},variant:"ghost",size:"icon",children:o.jsx(Zr,{})})]})}return o.jsx("div",{})}const{SCALAR_FIELD_TYPES:K$}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:Z$}=await C("@baseplate-dev/project-builder-lib/web"),{ComboboxField:W$}=await C("@baseplate-dev/ui-components");function J$({control:a,idx:n}){const{definition:l}=Z$(),s=(l.enums??[]).map(b=>({label:b.name,value:`enum-${b.id}`,description:"Enum type"})),c=[...K$.filter(b=>b!=="enum").map(b=>np[b]),...s],{field:{value:d,onChange:f}}=da({name:`model.fields.${n}.type`,control:a}),{field:{value:p,onChange:m}}=da({name:`model.fields.${n}.options`,control:a}),g=b=>{if(b?.startsWith("enum-")){const y=b.replace("enum-","");m({enumRef:y}),f("enum")}else f(b)},v=p?.enumRef;return o.jsx("div",{className:"space-y-2",children:o.jsx(W$,{value:d==="enum"&&v?`enum-${v}`:d,onChange:g,options:c,renderItemLabel:b=>o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{children:b.label}),o.jsx("div",{className:"text-xs text-muted-foreground",children:b.description})]})})})}const{modelUniqueConstraintEntityType:eL}=await C("@baseplate-dev/project-builder-lib"),{Button:kx,DropdownMenu:tL,DropdownMenuContent:nL,DropdownMenuGroup:aL,DropdownMenuItem:Ol,DropdownMenuTrigger:iL,InputFieldController:lL,SwitchFieldController:rL,toast:sL}=await C("@baseplate-dev/ui-components"),{useState:Jr}=await C("react");function oL({className:a,control:n,idx:l,setValue:s,onRemove:c}){const d=lt(W=>W.model.fields[l]),f=lt(W=>W.model.relations),p=lt(W=>W.model),m=p.primaryKeyFieldRefs.includes(d.id),g=p.primaryKeyFieldRefs.length>1,v=p.uniqueConstraints??[],b=v.filter(W=>W.fields.some(ne=>ne.fieldRef===d.id)),y=f?.filter(W=>W.references.some(ne=>ne.localRef===d.id))??[],j=(()=>{if(y.length>0)return`Unable to remove field as it is being used in relations ${y.map(W=>W.name).join(", ")}`;if(m&&g)return"Unable to remove field as it is being used in in the primary key";if(p.uniqueConstraints?.some(W=>W.fields.some(ne=>ne.fieldRef===d.id)))return"Unable to remove field as it is being used in in a unique constraint"})();function D(){if(j){sL.error(j);return}c(l),m&&!g&&s("model.primaryKeyFieldRefs",[],{shouldDirty:!0})}const[w,R]=Jr(!1),[E,A]=Jr(!1),[O,P]=Jr(),[V,G]=Jr(!1),[T,B]=Jr();return o.jsxs("div",{className:Te("items-start",a),children:[o.jsx("div",{children:o.jsx(lL,{control:n,name:`model.fields.${l}.name`})}),o.jsx("div",{children:o.jsx(J$,{control:n,idx:l})}),o.jsx("div",{children:o.jsx(rL,{control:n,name:`model.fields.${l}.isOptional`})}),o.jsx("div",{className:"mr-4",children:o.jsx(Q$,{control:n,idx:l,setValue:s})}),o.jsx("div",{children:o.jsx(k$,{control:n,idx:l})}),o.jsx("div",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(tL,{children:[o.jsx(iL,{asChild:!0,children:o.jsx(kx,{variant:"ghost",size:"icon",children:o.jsx(Dc,{})})}),o.jsx(nL,{children:o.jsxs(aL,{children:[y.length===0&&o.jsx(Ol,{onSelect:()=>{G(!0),B(void 0)},children:"Add Relation"}),y.length>0&&y.map(W=>o.jsxs(Ol,{onSelect:()=>{G(!0),B(W.id)},children:["Edit Relation ",y.length>1&&W.name]},W.id)),!g&&!m&&o.jsx(Ol,{onSelect:()=>{s("model.primaryKeyFieldRefs",[d.id],{shouldDirty:!0})},children:"Set as Primary Key"}),m&&o.jsx(Ol,{onSelect:()=>{R(!0)},children:"Edit Primary Key"}),b.length===0&&(g||!m)&&o.jsx(Ol,{onSelect:()=>{s("model.uniqueConstraints",[...v,{id:eL.generateNewId(),fields:[{fieldRef:d.id}]}],{shouldDirty:!0})},children:"Make Unique"}),b.length>0&&b.map((W,ne)=>o.jsxs(Ol,{onSelect:()=>{P(W.id),A(!0)},children:["Edit Unique Constraint"," ",b.length>1&&ne+1]},W.id))]})})]}),o.jsx(s2,{control:n,open:w,onOpenChange:R}),o.jsx(Rc,{control:n,open:E,onOpenChange:A,constraintId:O}),o.jsx(Tc,{control:n,open:V,onOpenChange:G,relationId:T,defaultFieldName:d.name}),o.jsx(kx,{variant:"ghost",onClick:()=>{D()},size:"icon",children:o.jsx(jy,{})})]})})]})}function cL({className:a,control:n,setValue:l}){const{fields:s,remove:c,append:d,move:f}=vs({control:n,name:"model.fields"}),p="grid grid-cols-[repeat(2,minmax(130px,1fr))_60px_minmax(130px,1fr)_minmax(100px,1fr)_80px] gap-3",m=s.map((g,v)=>({id:g.id,element:o.jsx(oL,{className:p,control:n,setValue:l,idx:v,onRemove:c},g.id)}));return o.jsxs("div",{className:Te("space-y-4",a),children:[s.length===0?o.jsx("p",{className:"pt-4 text-style-muted",children:"Add some fields to get started"}):o.jsxs("div",{className:"flex w-full flex-col gap-2 bg-white",children:[o.jsxs("div",{className:Te(p,"sticky -top-0 z-10 bg-white py-2 text-sm font-semibold","pl-12"),children:[o.jsx("div",{children:"Name"}),o.jsx("div",{children:"Type"}),o.jsx("div",{children:"Optional"}),o.jsx("div",{children:"Default Value"}),o.jsx("div",{className:"sr-only",children:"Badges"}),o.jsx("div",{className:"sr-only",children:"Actions"})]}),o.jsx(Oj,{listItems:m,sortItems:f})]}),o.jsx(FA,{appendField:d,setValue:l})]})}const{useProjectDefinition:uL}=await C("@baseplate-dev/project-builder-lib/web"),{Button:qh,RecordView:dL,RecordViewActions:fL,RecordViewItem:ic,RecordViewItemList:hL,SectionListSection:mL,SectionListSectionContent:pL,SectionListSectionDescription:gL,SectionListSectionHeader:vL,SectionListSectionTitle:bL,useConfirmDialog:xL}=await C("@baseplate-dev/ui-components");function yL({control:a,setValue:n}){const{requestConfirm:l}=xL(),{definitionContainer:s}=uL(),c=lt(({model:p})=>p.relations??[]),d=lt(({model:p})=>Object.fromEntries(p.fields.map(m=>[m.id,m.name])));function f(p){const m=c.find(g=>g.id===p);l({title:"Delete Relation",content:`Are you sure you want to delete the relation "${m?.name??"<invalid>"}"?`,onConfirm:()=>{n("model.relations",c.filter(g=>g.id!==p))}})}return o.jsxs(mL,{children:[o.jsxs(vL,{children:[o.jsx(bL,{children:"Relations"}),o.jsx(gL,{children:"Define relations to enforce uniqueness on one or more fields."})]}),o.jsxs(pL,{className:"space-y-4",children:[c.map(p=>o.jsxs(dL,{children:[o.jsxs(hL,{children:[o.jsx(ic,{title:"Name",children:p.name}),o.jsx(ic,{title:"Local Field",children:p.references.map(m=>d[m.localRef]).join(", ")}),o.jsx(ic,{title:"Foreign Model",children:s.nameFromId(p.modelRef)}),o.jsx(ic,{title:"On Delete",children:p.onDelete})]}),o.jsxs(fL,{children:[o.jsx(Tc,{relationId:p.id,control:a,asChild:!0,children:o.jsx(qh,{variant:"ghost",size:"icon",title:"Edit",children:o.jsx(kl,{})})}),o.jsx(qh,{variant:"ghostDestructive",size:"icon",title:"Delete",onClick:()=>{f(p.id)},children:o.jsx(bs,{})})]})]},p.id)),o.jsx(Tc,{control:a,asChild:!0,children:o.jsxs(qh,{variant:"secondary",size:"sm",children:[o.jsx(Gi,{}),"Add Relation"]})})]})]})}const{Button:Fh,RecordView:jL,RecordViewActions:SL,RecordViewItem:wL,RecordViewItemList:CL,SectionListSection:EL,SectionListSectionContent:DL,SectionListSectionDescription:TL,SectionListSectionHeader:RL,SectionListSectionTitle:NL,useConfirmDialog:ML}=await C("@baseplate-dev/ui-components");function AL({control:a,setValue:n}){const{requestConfirm:l}=ML(),s=lt(({model:f})=>f.uniqueConstraints??[]),c=lt(({model:f})=>Object.fromEntries(f.fields.map(p=>[p.id,p.name])));function d(f){l({title:"Delete Unique Constraint",content:"Are you sure you want to delete this unique constraint?",onConfirm:()=>{n("model.uniqueConstraints",s.filter(p=>p.id!==f))}})}return o.jsxs(EL,{children:[o.jsxs(RL,{children:[o.jsx(NL,{children:"Unique Constraints"}),o.jsx(TL,{children:"Define unique constraints to enforce uniqueness on one or more fields."})]}),o.jsxs(DL,{className:"space-y-4",children:[s.map(f=>o.jsxs(jL,{children:[o.jsx(CL,{children:o.jsx(wL,{title:"Fields",children:f.fields.map(p=>c[p.fieldRef]??"<invalid>").join(", ")})}),o.jsxs(SL,{children:[o.jsx(Rc,{constraintId:f.id,control:a,asChild:!0,children:o.jsx(Fh,{variant:"ghost",size:"icon",title:"Edit",children:o.jsx(kl,{})})}),o.jsx(Fh,{variant:"ghostDestructive",size:"icon",title:"Delete",onClick:()=>{d(f.id)},children:o.jsx(bs,{})})]})]},f.id)),o.jsx(Rc,{control:a,asChild:!0,children:o.jsxs(Fh,{variant:"secondary",size:"sm",children:[o.jsx(Gi,{}),"Add Unique Constraint"]})})]})]})}const{modelBaseSchema:$L,modelEntityType:LL,modelLocalRelationEntityType:OL,modelScalarFieldEntityType:UL}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:zL}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:BL,SectionList:_L}=await C("@baseplate-dev/ui-components");ys(LL,"/data/models/edit/{uid}");ys(UL,"/data/models/edit/{parentUid}");ys(OL,"/data/models/edit/{parentUid}");const qL=$L.omit({name:!0,featureRef:!0});function FL(){const{form:a,onSubmit:n,defaultValues:l}=Rs({schema:qL}),{control:s,watch:c,getValues:d,setValue:f,reset:p}=a;return zL({control:s,reset:p,onSubmit:n}),o.jsx(Gl,{children:o.jsx(ep,{initialModel:l,getValues:d,watch:c,children:o.jsxs("form",{onSubmit:n,className:"max-w-7xl min-w-[700px] flex-1 space-y-4 px-4 pb-4",children:[o.jsx(cL,{control:s,setValue:f}),o.jsxs(_L,{children:[o.jsx(yL,{control:s,setValue:f}),o.jsx(AL,{control:s,setValue:f})]}),o.jsx(BL,{form:a})]})})})}const{ModelTransformerUtils:HL}=await C("@baseplate-dev/project-builder-lib"),{modelTransformerWebSpec:PL,useProjectDefinition:IL}=await C("@baseplate-dev/project-builder-lib/web"),{Label:Vx,SectionListSection:kL,SectionListSectionContent:VL,SectionListSectionDescription:GL,SectionListSectionHeader:YL,SectionListSectionTitle:XL,SwitchField:lc}=await C("@baseplate-dev/ui-components");function QL({className:a,control:n,setValue:l}){const s=lt(E=>E.model.fields),c=it({control:n,name:"service.create"}),d=it({control:n,name:"service.update"}),f=c?.enabled,p=d?.enabled,m=it({control:n,name:"service.transformers"})??[],{definitionContainer:g,pluginContainer:v}=IL();if(!f&&!p)return null;const b=c?.fields??[],y=d?.fields??[],j=c?.transformerNames??[],D=d?.transformerNames??[],w="w-full border-collapse text-left [&_td]:py-1 [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-10 [&_th]:py-2",R=v.getPluginSpec(PL);return o.jsxs(kL,{className:a,children:[o.jsxs(YL,{children:[o.jsx(XL,{children:"Create / Update Fields"}),o.jsx(GL,{children:"Configure the fields that can be created or updated by the service method"})]}),o.jsx(VL,{className:"max-w-xl space-y-4",children:o.jsxs("table",{className:w,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"w-full",children:o.jsx(Vx,{children:"Fields"})}),f&&o.jsx("th",{className:"pl-8",children:"Create"}),p&&o.jsx("th",{className:"pl-8",children:"Update"})]})}),o.jsxs("tbody",{children:[s.map(E=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(rs,{type:E.type==="enum"&&E.options?.enumRef?g.nameFromId(E.options.enumRef):np[E.type].label,children:E.name})}),f&&o.jsx("td",{className:"pl-8",children:o.jsx(lc,{value:b.includes(E.id),onChange:A=>{l("service.create.fields",A?[...b,E.id]:b.filter(O=>O!==E.id),{shouldDirty:!0})}})}),p&&o.jsx("td",{className:"pl-8",children:o.jsx(lc,{value:y.includes(E.id),onChange:A=>{l("service.update.fields",A?[...y,E.id]:y.filter(O=>O!==E.id),{shouldDirty:!0})}})})]},E.id)),m.length>0&&o.jsx("tr",{children:o.jsx("th",{children:o.jsx(Vx,{children:"Transformers"})})}),m.map(E=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(rs,{type:R.getTransformerWebConfig(E.type,tp).label,children:HL.getTransformName(g,E,v)})}),f&&o.jsx("td",{className:"pl-8",children:o.jsx(lc,{value:j.includes(E.id),onChange:A=>{l("service.create.transformerNames",A?[...j,E.id]:j.filter(O=>O!==E.id),{shouldDirty:!0})}})}),p&&o.jsx("td",{className:"pl-8",children:o.jsx(lc,{value:D.includes(E.id),onChange:A=>{l("service.update.transformerNames",A?[...D,E.id]:D.filter(O=>O!==E.id),{shouldDirty:!0})}})})]},E.id))]})]})})]})}const{modelTransformerEntityType:KL,transformerSchema:ZL}=await C("@baseplate-dev/project-builder-lib"),{usePluginEnhancedSchema:WL}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Gx,DialogClose:JL,DialogFooter:eO}=await C("@baseplate-dev/ui-components"),{useId:tO}=await C("react"),{z:nO}=await C("zod");function aO({className:a,webConfig:{Form:n,pluginId:l},transformer:s,onUpdate:c,isCreate:d}){const f=lt(j=>j),p=WL(nO.object({transformer:ZL})),m=pi({resolver:kt(p),defaultValues:{transformer:s}}),{handleSubmit:g,formState:{isDirty:v}}=m,b=g(j=>{c({...j.transformer,id:j.transformer.id?j.transformer.id:KL.generateNewId()})}),y=tO();return n?o.jsxs("form",{className:Te("space-y-4",a),id:y,onSubmit:j=>(j.stopPropagation(),b(j)),children:[o.jsx(n,{formProps:m,name:"transformer",originalModel:f,pluginId:l}),o.jsxs(eO,{children:[o.jsx(JL,{asChild:!0,children:o.jsx(Gx,{variant:"secondary",children:"Cancel"})}),o.jsx(Gx,{type:"submit",disabled:!d&&!v,form:y,children:"Save"})]})]}):null}const{Dialog:iO,DialogContent:lO,DialogDescription:rO,DialogHeader:sO,DialogTitle:oO,DialogTrigger:cO,useControlledState:uO}=await C("@baseplate-dev/ui-components");function c2({children:a,transformer:n,asChild:l,webConfig:s,open:c,onOpenChange:d,onUpdate:f,isCreate:p}){const[m,g]=uO(c,d,!1);return o.jsxs(iO,{open:m,onOpenChange:g,children:[a&&o.jsx(cO,{asChild:l,children:a}),o.jsxs(lO,{children:[o.jsxs(sO,{children:[o.jsxs(oO,{children:[p?"Create":"Edit"," ",s?.label," Transformer"]}),o.jsx(rO,{children:s?.instructions??"Manage the transformer for the service"})]}),s&&o.jsx(aO,{transformer:n,onUpdate:v=>{g(!1),f(v)},webConfig:s,isCreate:p})]})]})}const{modelTransformerWebSpec:u2,useProjectDefinition:d2}=await C("@baseplate-dev/project-builder-lib/web"),{Button:ym,DropdownMenu:dO,DropdownMenuContent:fO,DropdownMenuGroup:hO,DropdownMenuItem:mO,DropdownMenuTrigger:pO,RecordView:gO,RecordViewActions:vO,RecordViewItem:Yx,RecordViewItemList:bO,SectionListSection:xO,SectionListSectionContent:yO,SectionListSectionDescription:jO,SectionListSectionHeader:SO,SectionListSectionTitle:wO,useConfirmDialog:CO}=await C("@baseplate-dev/ui-components"),{useState:Xx}=await C("react");function EO({formProps:a,idx:n,onRemove:l,onUpdate:s}){const{pluginContainer:c,definitionContainer:d}=d2(),{control:f}=a,p=it({control:f,name:`service.transformers.${n}`}),g=c.getPluginSpec(u2).getTransformerWebConfig(p.type,tp),v=g.getSummary(p,d);return o.jsxs(gO,{children:[o.jsxs(bO,{children:[o.jsx(Yx,{title:"Type",children:g.label}),v.map(b=>o.jsx(Yx,{title:b.label,children:b.description},b.label))]}),o.jsxs(vO,{children:[g.Form&&o.jsx(c2,{webConfig:g,transformer:p,onUpdate:b=>{s(b,n)},asChild:!0,isCreate:!1,children:o.jsx(ym,{variant:"ghost",size:"icon",title:"Edit",children:o.jsx(kl,{})})}),o.jsx(ym,{variant:"ghost",size:"icon",onClick:()=>{l(n)},title:"Remove",className:"text-destructive hover:text-destructive-hover",children:o.jsx(jy,{})})]})]})}function DO({className:a,formProps:n}){const{control:l}=n,{fields:s,remove:c,append:d,update:f}=vs({control:l,name:"service.transformers"}),{pluginContainer:p,definitionContainer:m}=d2(),{requestConfirm:g}=CO(),v=p.getPluginSpec(u2),b=lt(E=>E),y=v.getTransformerWebConfigs(tp).filter(E=>E.allowNewTransformer?E.allowNewTransformer(m,b):!0),[j,D]=Xx(!1),[w,R]=Xx(0);return o.jsxs(xO,{className:a,children:[o.jsxs(SO,{children:[o.jsx(wO,{children:"Transformers"}),o.jsx(jO,{children:"Transformers are used to operate on the data from the client into the shape that the database ORM expects."})]}),o.jsxs(yO,{className:"max-w-xl space-y-4",children:[s.map((E,A)=>o.jsx(EO,{formProps:n,idx:A,onUpdate:(O,P)=>{f(P,O)},onRemove:O=>{g({title:"Confirm delete",content:"Are you sure you want to delete this transformer?",buttonConfirmText:"Delete",buttonConfirmVariant:"destructive",onConfirm:()=>{c(O)}})}},E.id)),y.length>0&&o.jsxs(dO,{children:[o.jsx(pO,{asChild:!0,children:o.jsxs(ym,{variant:"secondary",size:"sm",children:[o.jsx(Gi,{}),"Add Transformer"]})}),o.jsx(fO,{children:o.jsx(hO,{children:y.map((E,A)=>o.jsx(mO,{onSelect:()=>{E.Form?(R(A),D(!0)):d(E.getNewTransformer(m,b))},children:o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("div",{children:E.label}),o.jsx("div",{className:"text-style-muted",children:E.description})]})},E.name))})})]}),o.jsx(c2,{webConfig:y[w],transformer:y[w]?.getNewTransformer(m,b),onUpdate:E=>{d(E)},open:j,onOpenChange:D,isCreate:!0})]})]})}const{modelBaseSchema:TO,modelTransformerEntityType:RO}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:NO}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:MO,SectionList:AO,SectionListSection:$O,SectionListSectionContent:LO,SectionListSectionDescription:OO,SectionListSectionHeader:UO,SectionListSectionTitle:zO,SwitchFieldController:Hh}=await C("@baseplate-dev/ui-components");ys(RO,"/data/models/edit/{parentUid}");const BO=TO.omit({name:!0,featureRef:!0});function _O(){const{form:a,onSubmit:n,defaultValues:l}=Rs({schema:BO}),{control:s,watch:c,getValues:d,setValue:f,reset:p}=a;return NO({control:s,reset:p,onSubmit:n}),o.jsx(ep,{initialModel:l,getValues:d,watch:c,children:o.jsxs("form",{onSubmit:n,className:"w-full max-w-7xl space-y-4 p-4",children:[o.jsxs(AO,{children:[o.jsxs($O,{children:[o.jsxs(UO,{children:[o.jsx(zO,{children:"Methods"}),o.jsx(OO,{children:"Enable or disable which service methods will be generated"})]}),o.jsxs(LO,{className:"flex gap-8",children:[o.jsx(Hh,{label:"Create",name:"service.create.enabled",control:s}),o.jsx(Hh,{label:"Update",name:"service.update.enabled",control:s}),o.jsx(Hh,{label:"Delete",name:"service.delete.enabled",control:s})]})]}),o.jsx(QL,{control:s,setValue:f}),o.jsx(DO,{formProps:a})]}),o.jsx(MO,{form:a})]})})}const{modelEntityType:qO}=await C("@baseplate-dev/project-builder-lib"),FO={path:"edit",children:[{index:!0,element:o.jsx($m,{to:"../",replace:!0})},{path:":uid",element:o.jsx(NM,{}),handle:{crumb:Pc(qO,"Edit Model","/data/models/edit/:uid")},children:[{index:!0,element:o.jsx(FL,{})},{path:"service",element:o.jsx(_O,{}),handle:{crumb:"Service"}},{path:"graphql",element:o.jsx(LA,{}),handle:{crumb:"GraphQL"}},Ts]}]},{useProjectDefinition:HO}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Qx,EmptyDisplay:PO}=await C("@baseplate-dev/ui-components");function IO(){const{definition:a}=HO();return a.models.length===0?o.jsx(PO,{icon:Wm,header:"No Models",subtitle:"Create a model to get started",actions:o.jsx(xm,{children:o.jsx(Qx,{children:"New Model"})})}):o.jsxs("div",{className:"max-w-4xl space-y-4 p-4 text-style-prose",children:[o.jsx("h1",{children:"Models"}),o.jsx("p",{children:"Models are the building blocks of your app. They define the data structure of your app."}),o.jsxs("p",{children:["Choose a model to edit from the sidebar or"," ",o.jsx(xm,{children:o.jsx(Qx,{variant:"link",size:"none",children:"create a new model"})}),"."]})]})}const kO={path:"models/*",handle:{crumb:{label:"Models",url:"/data/models"}},children:[{index:!0,element:o.jsx(IO,{})},FO,Ts]},VO={element:o.jsx(SN,{}),path:"/data",children:[{index:!0,element:o.jsx($m,{to:"./models"})},kO,uM]},{Button:Ph,Card:Ih,CardDescription:kh,CardFooter:Vh,CardHeader:Gh,CardTitle:Yh}=await C("@baseplate-dev/ui-components");function GO(){return o.jsx("div",{className:"flex-1 bg-white",children:o.jsxs("div",{className:"mx-auto w-160 space-y-4 p-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h1",{children:"Baseplate Project Builder"}),o.jsxs("p",{children:["When you've set everything up, just click the"," ",o.jsx("strong",{children:"Sync"})," button and Baseplate will sync the project configuration to your codebase."]})]}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-1",children:[o.jsxs(Ih,{children:[o.jsxs(Gh,{children:[o.jsx(Yh,{children:"Models"}),o.jsx(kh,{children:"Models are the core of your app. They define the data that your app will store and manipulate."})]}),o.jsx(Vh,{children:o.jsx(It,{to:"/models",children:o.jsx(Ph,{children:"Configure Models"})})})]}),o.jsxs(Ih,{children:[o.jsxs(Gh,{children:[o.jsx(Yh,{children:"Plugins"}),o.jsx(kh,{children:"Baseplate comes with a number of plugins that you can enable or disable, such as email and authentication."})]}),o.jsx(Vh,{children:o.jsx(It,{to:"/plugins",children:o.jsx(Ph,{children:"Configure Plugins"})})})]}),o.jsxs(Ih,{children:[o.jsxs(Gh,{children:[o.jsx(Yh,{children:"Apps & Repositories"}),o.jsx(kh,{children:"Each app represents a separate application that can be run, e.g. backend, frontend, mobile app, etc. You can also configure how the apps are organized into repositories, e.g. monorepos."})]}),o.jsx(Vh,{children:o.jsx(It,{className:"inline-block",to:"/apps",children:o.jsx(Ph,{children:"Configure Apps"})})})]})]})]})})}function YO(a,n,l){return`/api/plugins/${a}/${n}/static/${l}`}const{createPluginImplementationStore:XO}=await C("@baseplate-dev/project-builder-lib");function f2(a,n,l){const s={...l,plugins:[...l.plugins??[],{id:n.id,version:n.version,name:n.name,packageName:n.packageName}]};return XO(a,s)}const{pluginEntityType:Kx,webConfigSpec:Zx}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:QO}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Xh,Card:KO,CardContent:ZO,CardDescription:WO,CardHeader:JO,CardTitle:eU}=await C("@baseplate-dev/ui-components");function Wx({className:a,plugin:n,isActive:l}){const{currentProjectId:s}=Cn(),{saveDefinitionWithFeedbackSync:c,schemaParserContext:d,definitionContainer:f,pluginContainer:p,isSavingDefinition:m}=QO(),g=cn();function v(){if(f2(d.pluginStore,n,f.definition).getPluginSpec(Zx).getWebConfigComponent(n.id)){g(`/plugins/edit/${n.id}`);return}c(E=>{E.plugins=[...(E.plugins??[]).filter(A=>A.packageName!==n.packageName||A.name!==n.name),{id:Kx.fromUid(n.id),packageName:n.packageName,name:n.name,version:n.version,config:{}}]},{successMessage:`Enabled ${n.displayName}!`})}function b(){c(D=>{D.plugins=(D.plugins??[]).filter(w=>w.id!==Kx.fromUid(n.id))},{successMessage:`Disabled ${n.displayName}!`})}const j=p.getPluginSpec(Zx).getWebConfigComponent(n.id);return o.jsxs(KO,{className:a,children:[o.jsx(JO,{children:o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-4",children:[o.jsx("div",{className:"rounded-xl border",children:n.icon&&s?o.jsx("img",{src:YO(s,n.id,n.icon),className:"size-12 rounded-xl bg-muted",alt:`${n.displayName} logo`}):o.jsx(Uw,{className:"size-12 bg-muted p-2"})}),o.jsxs("div",{children:[o.jsx(eU,{children:n.displayName}),o.jsx(WO,{children:n.packageName})]})]}),o.jsx("div",{children:l?j?o.jsx(It,{to:`/plugins/edit/${n.id}`,children:o.jsx(Xh,{variant:"secondary",children:"Configure"})}):o.jsx(Xh,{variant:"secondary",onClick:b,disabled:m,children:"Disable"}):o.jsx(Xh,{variant:"secondary",onClick:v,disabled:m,children:"Enable"})})]})}),o.jsx(ZO,{children:o.jsx("div",{className:"text-sm",children:o.jsx("p",{children:n.description})})})]})}const{useProjectDefinition:tU}=await C("@baseplate-dev/project-builder-lib/web"),{EmptyDisplay:nU,ErrorableLoader:aU}=await C("@baseplate-dev/ui-components"),{useEffect:iU,useState:Jx}=await C("react");function lU(){const{currentProjectId:a}=Cn(),[n,l]=Jx(null),{definition:s}=tU(),[c,d]=Jx(null);if(iU(()=>{if(l(null),!!a){if(qn){l([]);return}Lt.plugins.getAvailablePlugins.mutate({projectId:a}).then(l).catch(d)}},[a]),!n)return o.jsx(aU,{error:c});if(n.length===0)return o.jsx(nU,{header:"No plugins available.",subtitle:"Please install plugins via package.json."});const f=s.plugins??[],p=n.filter(g=>f.some(v=>v.packageName===g.packageName&&v.name===g.name)),m=n.filter(g=>!f.some(v=>v.packageName===g.packageName&&v.name===g.name));return o.jsxs("div",{className:"max-w-2xl space-y-4 p-4",children:[o.jsx("h1",{children:"Manage Plugins"}),o.jsx("p",{children:"Plugins are a way to extend the functionality of your project, such as adding authentication. You can enable, disable, and manage plugins from this page."}),o.jsxs("p",{children:["To add additional plugins, you can install them to your root package with ",o.jsx("strong",{children:"pnpm"}),"."]}),p.length===0?null:o.jsxs(o.Fragment,{children:[o.jsxs("h3",{children:["Active Plugins (",p.length,")"]}),p.map(g=>o.jsx(Wx,{plugin:g,isActive:!0},g.id))]}),m.length===0?null:o.jsxs(o.Fragment,{children:[o.jsxs("h3",{children:["Available Plugins (",m.length,")"]}),m.map(g=>o.jsx(Wx,{plugin:g,isActive:!1},g.id))]})]})}const{pluginEntityType:rU,PluginUtils:sU,webConfigSpec:ey}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:oU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:cU,DropdownMenu:uU,DropdownMenuContent:dU,DropdownMenuGroup:fU,DropdownMenuItem:hU,DropdownMenuTrigger:mU,useConfirmDialog:pU}=await C("@baseplate-dev/ui-components"),{useMemo:gU}=await C("react");function vU(){const{definitionContainer:a,pluginContainer:n,schemaParserContext:l,saveDefinitionWithFeedbackSync:s,isSavingDefinition:c}=oU(),{id:d}=Qi(),{requestConfirm:f}=pU(),p=cn(),m=sU.byId(a.definition,d??""),g=gU(()=>{if(!d)return;const w=n.getPluginSpec(ey).getWebConfigComponent(d);if(w)return w;const R=l.pluginStore.availablePlugins.find(A=>A.metadata.id===d);return R?f2(l.pluginStore,R.metadata,a.definition).getPluginSpec(ey).getWebConfigComponent(d):void 0},[d,l,a,n]),v=l.pluginStore.availablePlugins.find(D=>D.metadata.id===d);if(!g||!v)return o.jsx(Ds,{});const{metadata:b}=v;function y(){s(D=>{D.plugins=(D.plugins??[]).filter(w=>w.id!==rU.fromUid(b.id))},{successMessage:`Disabled ${b.displayName}!`,onSuccess:()=>{p("/plugins")}})}function j(){m||p("/plugins")}return o.jsx("div",{className:"relative flex h-full flex-1 flex-col gap-4 overflow-hidden",children:o.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("h1",{children:[b.displayName," Plugin"]}),m&&o.jsxs(uU,{children:[o.jsx(mU,{asChild:!0,children:o.jsx(cU,{variant:"ghost",size:"icon",children:o.jsx(Dc,{"aria-label":"More Actions"})})}),o.jsx(dU,{children:o.jsx(fU,{children:o.jsx(hU,{disabled:c,onSelect:()=>{f({title:"Disable Plugin",content:`Are you sure you want to disable the ${b.displayName} plugin?`,onConfirm:y})},children:"Disable Plugin"})})})]})]}),o.jsx(g,{definition:m,metadata:b,onSave:j})]})})}const{pluginEntityType:bU}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:xU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:yU,NavigationMenu:jU,NavigationMenuItem:SU,NavigationMenuLink:wU,NavigationMenuList:CU,SidebarLayout:EU,SidebarLayoutContent:DU,SidebarLayoutSidebar:TU}=await C("@baseplate-dev/ui-components");function RU(){const{definition:a,schemaParserContext:n}=xU(),{availablePlugins:l}=n.pluginStore,s=(a.plugins??[]).map(c=>l.find(f=>f.metadata.id===bU.toUid(c.id))?.metadata).filter(vy);return o.jsxs(EU,{className:"flex-1",children:[o.jsxs(TU,{className:"flex flex-col gap-4",width:"sm",children:[o.jsx(It,{to:"/plugins",children:o.jsxs(yU,{variant:"secondary",className:"w-full",size:"sm",children:[o.jsx(Gi,{}),"Add new plugin"]})}),o.jsx(jU,{orientation:"vertical",children:o.jsxs(CU,{children:[s.map(c=>o.jsx(wU,{asChild:!0,children:o.jsx(Ht,{to:`/plugins/edit/${c.id}`,children:c.displayName})},c.id)),s.length===0&&o.jsx(SU,{className:"mt-4 w-full text-center opacity-80",children:"No plugins enabled"})]})})]}),o.jsx(DU,{className:"h-[calc(100vh-var(--topbar-height)-1px)]",children:o.jsx(Gl,{children:o.jsx(gi,{})})})]})}const{pluginEntityType:NU}=await C("@baseplate-dev/project-builder-lib"),MU=[{element:o.jsx(RU,{}),children:[{index:!0,element:o.jsx(lU,{})},{path:"edit/:id",element:o.jsx(vU,{}),handle:{crumb:Pc(NU,"Edit Plugin")}},{path:"*",element:o.jsx(Ds,{})}]}],{NavigationMenu:AU,NavigationMenuLink:rc,NavigationMenuList:$U,SidebarLayout:LU,SidebarLayoutContent:OU,SidebarLayoutSidebar:UU}=await C("@baseplate-dev/ui-components");function zU(){return o.jsxs(LU,{className:"h-full flex-1",children:[o.jsx(UU,{className:"space-y-4",width:"sm",children:o.jsx(AU,{orientation:"vertical",children:o.jsxs($U,{children:[o.jsx(rc,{asChild:!0,children:o.jsx(Ht,{to:"/settings/project-settings",children:"Project settings"})}),o.jsx(rc,{asChild:!0,children:o.jsx(Ht,{to:"/settings/hierarchy",children:"Hierarchy"})}),o.jsx(rc,{asChild:!0,children:o.jsx(Ht,{to:"/settings/theme-builder",children:"Theme builder"})}),Yy&&o.jsx(rc,{asChild:!0,children:o.jsx(Ht,{to:"/settings/template-extractor",children:"Template extractor"})})]})})}),o.jsx(OU,{className:"h-full",children:o.jsx(gi,{})})]})}function BU(a){return Vi({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 10 20 15 15 20"},child:[]},{tag:"path",attr:{d:"M4 4v7a4 4 0 0 0 4 4h12"},child:[]}]})(a)}const{useProjectDefinition:_U}=await C("@baseplate-dev/project-builder-lib/web"),{Button:ty,ComboboxFieldController:qU,Dialog:FU,DialogContent:HU,DialogFooter:PU,DialogHeader:IU,DialogTitle:kU,InputFieldController:VU}=await C("@baseplate-dev/ui-components"),{useEffect:GU,useMemo:YU}=await C("react"),{z:sc}=await C("zod"),XU=sc.object({id:sc.string(),childName:sc.string().min(1).regex(/^[a-z0-9-]+$/,"Must be lowercase, numbers, and dashes only"),parentRef:sc.string().nullish()});function QU({feature:a,open:n,onClose:l}){const{definitionContainer:{definition:s},saveDefinitionWithFeedback:c}=_U(),d=YU(()=>({id:a?.id??"",childName:a?.name.split("/").pop()??"",parentRef:a?.parentRef??null}),[a]),{control:f,handleSubmit:p,reset:m,formState:{isSubmitting:g}}=pi({resolver:kt(XU),values:d});GU(()=>{n&&m(d)},[n,d,m]);const v=p(y=>c(j=>{const D=j.features.find(A=>A.id===y.parentRef)?.name,w=y.parentRef?`${D}/${y.childName}`:y.childName;if(j.features.some(A=>A.id!==y.id&&A.name===w))throw new ua("Feature with this name already exists");const R=[...j.features.filter(A=>A.id!==y.id),{id:y.id,name:w,parentRef:y.parentRef}];function E(A){const O=R.filter(P=>A?new RegExp(`^${A.name}/[^/]+$`).exec(P.name):!P.name.includes("/"));for(const P of O){const V=P.name.split("/").pop();if(!V)throw new Error("Invalid feature name");P.name=A?`${A.name}/${V}`:V,E(P)}}E(),j.features=Kn(R,[A=>A.name])},{onSuccess:()=>{l?.()}})),b=[{label:"None",value:null},...s.features.filter(y=>y.id!==a?.id).map(y=>({label:y.name,value:y.id}))];return o.jsx(FU,{open:n,onOpenChange:y=>{y||l?.()},children:o.jsx(HU,{children:o.jsxs("form",{className:"space-y-4",onSubmit:v,children:[o.jsx(IU,{children:o.jsxs(kU,{children:[a?.name?"Edit":"Add"," Feature"]})}),o.jsx(VU,{control:f,name:"childName",label:"Name",autoComplete:"off","data-1p-ignore":!0}),o.jsx(qU,{control:f,name:"parentRef",label:"Parent Feature",options:b}),o.jsxs(PU,{children:[o.jsx(ty,{onClick:l,variant:"secondary",children:"Cancel"}),o.jsx(ty,{type:"submit",disabled:g,children:"Save"})]})]})})})}const{featureEntityType:h2}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:KU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:jm,buttonVariants:ZU,cn:WU,useConfirmDialog:JU}=await C("@baseplate-dev/ui-components"),{useState:ny}=await C("react");function ez(){const{definitionContainer:a,saveDefinitionWithFeedbackSync:n}=KU(),{requestConfirm:l}=JU(),{showRefIssues:s}=cj(),[c,d]=ny(),[f,p]=ny(!1),{features:m}=a.definition,g=v=>{function b(j){const D=j.features.findIndex(w=>w.id===v.id);if(D===-1)throw new Error("Feature not found");j.features.splice(D,1)}const y=a.fixRefDeletions(b);if(y.type==="failure"){s({issues:y.issues});return}l({title:"Delete Feature",content:`Are you sure you want to delete ${v.name}?`,onConfirm:()=>{n(b,{successMessage:`Feature ${v.name} removed`})}})};return o.jsx("div",{className:"relative h-full max-h-full pb-(--action-bar-height)",children:o.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[o.jsxs("div",{className:"sticky top-0 space-y-2 border-b bg-background py-6",children:[o.jsx("h1",{children:"Hierarchy"}),o.jsx("p",{className:"max-w-3xl text-muted-foreground",children:"All business logic and features are organized in a hierarchy. The structure of the features in the list below is the way the folder structure will be created in your backend/admin applications."})]}),o.jsxs("div",{className:"py-6",children:[o.jsx("div",{className:"mb-4 flex max-w-md flex-col gap-1",children:m.map(v=>o.jsx(tz,{feature:v,setFeatureToEdit:d,setShowFeatureForm:p,handleRemoveFeature:g},v.id))}),o.jsx(jm,{onClick:()=>{d({id:h2.generateNewId(),name:"",parentRef:null}),p(!0)},variant:"secondary",size:"sm",children:"Add Feature"}),o.jsx(QU,{feature:c,open:f,onClose:()=>{p(!1)}})]})]})})}function tz({feature:a,setFeatureToEdit:n,setShowFeatureForm:l,handleRemoveFeature:s}){const c=a.name.split("/").pop()??"";return o.jsxs("div",{className:"flex space-x-1",children:[o.jsx("button",{className:"mr-1 flex w-full flex-row items-center space-x-3",onClick:()=>{n(a),l(!0)},children:o.jsxs("div",{className:"flex w-full items-center space-x-1 truncate",title:c,children:[a.name.includes("/")&&o.jsxs(o.Fragment,{children:[a.name.split("/").slice(0,-2).map(d=>o.jsx("div",{className:"w-8 shrink-0"},d)),o.jsx(BU,{className:"size-8 shrink-0 p-2"})]}),o.jsxs("div",{className:WU(ZU({variant:"secondary",size:"sm"}),"group w-full"),style:{justifyContent:"flex-start"},children:[c,o.jsx("div",{className:"flex-1"}),o.jsx(kl,{className:"opacity-0 transition-opacity group-hover:opacity-100"})]})]})}),o.jsx(jm,{className:"shrink-0",variant:"ghost",onClick:()=>{n({id:h2.generateNewId(),name:"",parentRef:a.id}),l(!0)},size:"icon",title:`Add Sub-Feature to ${a.name}`,children:o.jsx(Gi,{})}),o.jsx(jm,{className:"shrink-0",variant:"ghost",onClick:()=>{s(a)},size:"icon",title:`Delete ${a.name}`,children:o.jsx(zw,{})})]})}const{generalSettingsSchema:nz}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:az,useProjectDefinition:iz,useResettableForm:lz}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:rz,InputFieldController:Qh,SectionList:sz,SectionListSection:oz,SectionListSectionContent:cz,SectionListSectionHeader:uz,SectionListSectionTitle:dz}=await C("@baseplate-dev/ui-components");function fz(){const{definition:a,saveDefinitionWithFeedback:n}=iz(),l=lz({resolver:kt(nz),defaultValues:a.settings.general}),{handleSubmit:s,control:c,reset:d}=l,f=s(p=>n(m=>{m.settings.general=p}));return az({control:c,reset:d,onSubmit:f}),o.jsxs("form",{className:"relative h-full max-h-full pb-(--action-bar-height)",onSubmit:f,children:[o.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[o.jsx("div",{className:"sticky top-0 border-b bg-background py-6",children:o.jsx("h1",{children:"Project settings"})}),o.jsx(sz,{children:o.jsxs(oz,{children:[o.jsx(uz,{children:o.jsx(dz,{children:"Settings"})}),o.jsxs(cz,{className:"flex max-w-80 flex-col gap-4",children:[o.jsx(Qh,{name:"name",label:"Project Name",description:"Lowercase letters and dashes, e.g. my-project",control:c,placeholder:"e.g. my-project"}),o.jsx(Qh,{name:"portOffset",label:"Port Offset",description:"Multiple of 1000, e.g. 4000. This will offset the ports used by the project, e.g. API at 4001, database at 4432, to avoid conflicts with other projects.",control:c,registerOptions:{valueAsNumber:!0}}),o.jsx(Qh,{label:"Package Scope",name:"packageScope",description:"The scope for packages in this project, e.g. my-project will result in @my-project/app-name",control:c})]})]})})]}),o.jsx(rz,{form:l})]})}const{templateExtractorSchema:hz}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:mz,useProjectDefinition:pz,useResettableForm:gz}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:vz,AlertDescription:bz,AlertTitle:xz,CheckboxFieldController:yz,FormActionBar:jz,SectionList:Sz,SectionListSection:wz,SectionListSectionContent:Cz,SectionListSectionHeader:Ez,SectionListSectionTitle:Dz,TextareaFieldController:Tz}=await C("@baseplate-dev/ui-components");function Rz(){const{definition:a,saveDefinitionWithFeedback:n}=pz(),l=a.settings.templateExtractor,s=gz({resolver:kt(hz),defaultValues:l}),{handleSubmit:c,control:d,reset:f}=s,p=c(m=>n(g=>{g.settings.templateExtractor=m}));return mz({control:d,reset:f,onSubmit:p}),Yy?o.jsxs("form",{className:"relative h-full max-h-full pb-(--action-bar-height)",onSubmit:p,children:[o.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[o.jsx("div",{className:"sticky top-0 border-b bg-background py-6",children:o.jsx("h1",{children:"Template Extractor"})}),o.jsx(Sz,{children:o.jsxs(wz,{children:[o.jsx(Ez,{children:o.jsx(Dz,{children:"Settings"})}),o.jsxs(Cz,{className:"flex max-w-md flex-col gap-4",children:[o.jsx(yz,{name:"writeMetadata",label:"Write Metadata",description:"Write metadata to the project to enable template extraction",control:d}),o.jsx(Tz,{name:"fileIdRegexWhitelist",label:"File ID Regex Whitelist",description:"A list of file IDs to include in the template extractor metadata for generators that have a manually assigned file IDs, e.g. files generated by generators that have multiple instances. The list is delimited by a newline and must be a valid regex.",control:d})]})]})})]}),o.jsx(jz,{form:s})]}):o.jsxs(vz,{variant:"error",className:"mx-auto my-16 max-w-2xl",children:[o.jsx(xz,{children:"Template Extractor is disabled"}),o.jsxs(bz,{children:["Template extractor is disabled in the environment. Please enable it with ",o.jsx("code",{children:"VITE_ENABLE_TEMPLATE_EXTRACTOR=true"})," to use it."]})]})}const{generateCssFromThemeConfig:ay}=await C("@baseplate-dev/project-builder-lib"),{TextareaField:Nz}=await C("@baseplate-dev/ui-components"),{useMemo:Mz}=await C("react");function iy(a){return Object.entries(a).map(([n,l])=>` ${n}: ${l};`).join(`
|
|
69
|
-
`)}function Az({className:a,control:n}){const l=it({control:n,name:"colors"}),s=Mz(()=>`
|
|
70
|
-
:root {
|
|
71
|
-
${iy(ay(l.light))}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.dark, html[data-theme='dark'] {
|
|
75
|
-
${iy(ay(l.dark))}
|
|
76
|
-
}
|
|
77
|
-
`.trim(),[l]);return o.jsx("div",{className:Te("",a),children:o.jsx(Nz,{className:"h-60",readOnly:!0,value:s})})}const{convertHexToOklch:$z,convertOklchToColorName:Lz,convertOklchToHex:Oz,getDefaultThemeColorFromShade:Uz,THEME_COLORS:zz}=await C("@baseplate-dev/project-builder-lib"),{Button:ly,ColorPickerFieldController:Bz,Tooltip:_z,TooltipContent:qz,TooltipTrigger:Fz}=await C("@baseplate-dev/ui-components");function ry({className:a,control:n,mode:l,setValue:s}){const c=Object.entries(zz),d=it({control:n,name:"palettes"}),f=it({control:n,name:`colors.${l}`});return o.jsx("div",{className:Te("flex w-full max-w-xl gap-4",a),children:o.jsx("div",{className:"grid flex-1 grid-cols-1 gap-4 sm:grid-cols-2",children:c.map(([p,m],g)=>{const v=p,y=(g>0?c[g-1][1].groupKey:void 0)!==m.groupKey,j=f[v],D=Uz(d,l,v);return o.jsxs("div",{className:Te(y?"col-start-1":void 0,"relative"),children:[o.jsx(Bz,{control:n,className:"w-full",wrapperClassName:"flex-col items-start",label:o.jsxs("div",{className:"flex h-6 w-full items-center gap-1",children:[o.jsx("div",{children:m.name}),o.jsxs(_z,{delayDuration:500,children:[o.jsx(Fz,{asChild:!0,children:o.jsx(ly,{variant:"ghost",size:"icon","aria-label":"Color Info",className:"opacity-30",children:o.jsx(Em,{})})}),o.jsx(qz,{align:"start",side:"bottom",className:"max-w-[400px]",children:o.jsx("div",{className:"font-normal",children:m.description})})]})]}),parseColor:Oz,serializeColor:$z,formatColorName:w=>{const R=Object.entries(d.base.shades).find(([,A])=>A===w)?.[0];if(R)return`base-${R}`;const E=Object.entries(d.primary.shades).find(([,A])=>A===w)?.[0];return E?`primary-${E}`:Lz(w)},name:`colors.${l}.${v}`}),j!==D&&o.jsx(ly,{className:"absolute right-2 bottom-1",onClick:()=>{s(`colors.${l}.${v}`,D)},size:"icon",variant:"ghost","aria-label":"Reset Color",children:o.jsx(Bw,{})})]},p)})})})}const{generateCssFromThemeConfig:Hz}=await C("@baseplate-dev/project-builder-lib"),{Badge:oc,Button:Ul,Card:Pz,CardContent:Iz,CardDescription:kz,CardHeader:Vz,CardTitle:Gz,Combobox:Yz,ComboboxContent:Xz,ComboboxEmpty:Qz,ComboboxInput:Kz,ComboboxItem:Kh}=await C("@baseplate-dev/ui-components");function Zz({className:a,control:n,mode:l}){const s=it({control:n,name:`colors.${l}`}),c=Hz(s);return o.jsx("div",{className:Te("size-full rounded-xl border border-border bg-background p-4",a),style:c,children:o.jsxs(Pz,{children:[o.jsxs(Vz,{children:[o.jsx(Gz,{children:"Color Preview"}),o.jsx(kz,{children:"This is a preview of how your theme colors will be applied on various elements"})]}),o.jsxs(Iz,{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(cc,{children:"Paragraph Text"}),o.jsx("p",{className:"text-base",children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin faucibus."})]}),o.jsxs("div",{children:[o.jsx(cc,{children:"Combobox"}),o.jsxs(Yz,{children:[o.jsx(Kz,{placeholder:"Select an option"}),o.jsxs(Xz,{style:c,children:[o.jsx(Kh,{value:"opt1",label:"Option 1",children:"Option 1"}),o.jsx(Kh,{value:"green",label:"Option 2",children:"Option 2"}),o.jsx(Kh,{value:"blue",label:"Option 3",children:"Option 3"}),o.jsx(Qz,{children:"No results found"})]})]})]}),o.jsxs("div",{children:[o.jsx(cc,{children:"Badges"}),o.jsxs("div",{className:"flex flex-wrap gap-1",children:[o.jsx(oc,{variant:"default",children:"Default"}),o.jsx(oc,{variant:"destructive",children:"Destructive"}),o.jsx(oc,{variant:"secondary",children:"Secondary"}),o.jsx(oc,{variant:"outline",children:"Outline"})]})]}),o.jsxs("div",{children:[o.jsx(cc,{children:"Buttons"}),o.jsxs("div",{className:"flex flex-wrap gap-2 rounded-lg border border-border p-1",children:[o.jsx(Ul,{type:"button",children:"Primary"}),o.jsx(Ul,{variant:"destructive",type:"button",children:"Destructive"}),o.jsx(Ul,{variant:"ghost",type:"button",children:"Ghost"}),o.jsx(Ul,{variant:"link",type:"button",children:"Link"}),o.jsx(Ul,{variant:"secondary",type:"button",children:"Secondary"}),o.jsx(Ul,{variant:"outline",type:"button",children:"Outline"})]})]})]})]})})}function cc({children:a}){return o.jsx("h4",{className:"text-lg font-semibold",children:a})}function Wz(a){const n=new Float32Array([a.r,a.g,a.b]);return{"50-r":1/(1+1/Math.exp(1.8661608695983887+1.969373345375061*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.4601062536239624*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.7962396740913391*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"50-g":1/(1+1/Math.exp(1.9256014823913574+1.231925129890442*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.3603883981704712*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.8378368616104126*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"50-b":1/(1+1/Math.exp(1.5751663446426392+.6084778904914856*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.0512851476669312*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+1.9236465692520142*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"100-r":1/(1+1/Math.exp(1.6104178428649902+2.411083698272705*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.4946855306625366*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.5684743523597717*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"100-g":1/(1+1/Math.exp(1.6873022317886353+.7176924347877502*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.6131407022476196*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.15697577595710754*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"100-b":1/(1+1/Math.exp(1.0808522701263428-.09388591349124908*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.5177313685417175*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+2.6253278255462646*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"200-r":1/(1+1/Math.exp(1.3480290174484253+2.2088170051574707*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-1.1226733922958374*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.41870957612991333*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"200-g":1/(1+1/Math.exp(1.3919278383255005+.2666841745376587*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.5987523794174194*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.23637670278549194*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"200-b":1/(1+1/Math.exp(.6176453232765198-.6029531359672546*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.21029342710971832*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+2.906541109085083*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"300-r":1/(1+1/Math.exp(.9194338321685791+2.3936944007873535*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-1.68363356590271*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.36374539136886597*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"300-g":1/(1+1/Math.exp(1.1811708211898804-.08378893882036209*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.4275716543197632*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.6511568427085876*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"300-b":1/(1+1/Math.exp(-.04160493612289429-1.0422184467315674*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.1739543229341507*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+3.306165933609009*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"400-r":1/(1+1/Math.exp(.5908379554748535+2.6282155513763428*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.483553886413574*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.16029347479343414*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"400-g":1/(1+1/Math.exp(.9054368138313293-.38720616698265076*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.231947422027588*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.0837976932525635*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"400-b":1/(1+1/Math.exp(-.6404189467430115-1.6898466348648071*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.029696132987737656*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+3.7177767753601074*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"500-r":1/(1+1/Math.exp(.3420727550983429+2.987776756286621*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-3.3403704166412354*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.07194828987121582*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"500-g":1/(1+1/Math.exp(.5289734601974487-.5567987561225891*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.3352314233779907*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.4835448265075684*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"500-b":1/(1+1/Math.exp(-1.2478309869766235-2.2976744174957275*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.30013492703437805*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+4.339084625244141*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"600-r":1/(1+1/Math.exp(.18572008609771729+2.5128233432769775*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-3.407212495803833*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.20814435184001923*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"600-g":1/(1+1/Math.exp(.15741883218288422-.7273809909820557*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.2500137090682983*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.6501106023788452*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"600-b":1/(1+1/Math.exp(-1.3073996305465698-2.5112154483795166*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.7157139182090759*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+4.086366176605225*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"700-r":1/(1+1/Math.exp(-.25121745467185974+1.7795124053955078*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.7557551860809326*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.0411522202193737*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"700-g":1/(1+1/Math.exp(-.43503373861312866-.6766132712364197*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.150789737701416*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.3406033515930176*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"700-b":1/(1+1/Math.exp(-1.1124053001403809-2.359389305114746*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.943118691444397*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+3.267453908920288*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"800-r":1/(1+1/Math.exp(-.42729225754737854+1.2738885879516602*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.573699474334717*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.11818580329418182*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"800-g":1/(1+1/Math.exp(-.6730203628540039-.770199716091156*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.9060920476913452*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.2600882053375244*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"800-b":1/(1+1/Math.exp(-1.32567298412323-1.9301948547363281*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.8552113175392151*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+2.6513888835906982*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"900-r":1/(1+1/Math.exp(-.6309270858764648+1.0235852003097534*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.4659388065338135*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.15058130025863647*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"900-g":1/(1+1/Math.exp(-.9010928273200989-.7559532523155212*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.7665435075759888*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.1884112358093262*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"900-b":1/(1+1/Math.exp(-1.5088001489639282-1.5986618995666504*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.7353832125663757*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+2.180158853530884*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"950-r":1/(1+1/Math.exp(-1.166185975074768+.5363732576370239*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.587523937225342*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.061746854335069656*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"950-g":1/(1+1/Math.exp(-1.2907893657684326-1.3924223184585571*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.5465696454048157*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.2647709846496582*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"950-b":1/(1+1/Math.exp(-1.8633685111999512-1.8034374713897705*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.8856748938560486*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+1.8510282039642334*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0)))))}}const{PALETTE_SHADES:Jz}=await C("@baseplate-dev/project-builder-lib");function Zh(a,n){return`${a}-${n}`}function eB(a){const l=Hw("rgb")(a);if(!l)throw new Error(`Invalid color: ${a}`);const s=Wz(l);return Object.fromEntries(Jz.map(c=>{const d={mode:"rgb",r:s[Zh(c,"r")],g:s[Zh(c,"g")],b:s[Zh(c,"b")]};return[c,Pw(d)]}))}const{COLOR_PALETTES:Wh,convertHexToOklch:sy,convertOklchToHex:oy,PALETTE_SHADES:tB}=await C("@baseplate-dev/project-builder-lib"),{Button:nB,ColorPickerFieldController:cy,ComboboxFieldController:aB}=await C("@baseplate-dev/ui-components"),{useCallback:iB}=await C("react");function uy({control:a,getValues:n,setValue:l,onShadesChange:s,type:c}){const d=[{value:"custom",label:"Custom Base"},...Object.keys(Wh).map(g=>({value:g,label:Sy.capitalize(g)}))],f=it({control:a,name:`palettes.${c}.paletteName`}),p=iB(g=>{if(!g||!Object.prototype.hasOwnProperty.call(Wh,g))return;const v=Wh[g];l(`palettes.${c}.shades`,v),s?.(v)},[l,s,c]),m=()=>{const g=n(`palettes.${c}.customBase`);if(!g)return;const v=eB(g);l(`palettes.${c}.shades`,v),s?.(v)};return o.jsxs("div",{className:"flex max-w-fit flex-col gap-4",children:[o.jsx(aB,{name:`palettes.${c}.paletteName`,control:a,options:d,placeholder:"Choose a base palette",onChange:p}),f==="custom"&&o.jsxs("div",{className:"flex max-w-xl items-center justify-between",children:[o.jsx(cy,{className:"flex-1 space-x-1",wrapperClassName:"items-center",control:a,name:`palettes.${c}.customBase`,label:"Custom Base Color",placeholder:"Choose a color",parseColor:oy,serializeColor:sy}),o.jsx(nB,{variant:"secondary",onClick:m,size:"sm",children:"Generate"})]}),o.jsx("div",{className:"flex gap-3",children:tB.map(g=>o.jsx(cy,{wrapperClassName:"flex flex-col items-center",hideText:!0,control:a,name:`palettes.${c}.shades.${g}`,label:g,parseColor:oy,serializeColor:sy,onChange:()=>s?.(n(`palettes.${c}.shades`))},g))})]})}const{generateDefaultTheme:lB,generateThemeColorsFromShade:dy,themeSchema:rB}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:sB,useProjectDefinition:oB,useResettableForm:cB}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:uB,AlertDescription:dB,AlertTitle:fB,Button:hB,FormActionBar:mB,SectionList:pB,SectionListSection:Jh,SectionListSectionContent:em,SectionListSectionDescription:tm,SectionListSectionHeader:nm,SectionListSectionTitle:am,Tabs:fy,TabsContent:uc,TabsList:hy,TabsTrigger:dc}=await C("@baseplate-dev/ui-components"),{useCallback:my,useMemo:gB,useState:vB}=await C("react");function bB(){const{definition:a,saveDefinitionWithFeedback:n}=oB(),l=gB(()=>a.settings.theme??lB(),[a.settings.theme]),s=cB({resolver:kt(rB),values:l}),{control:c,handleSubmit:d,setValue:f,getValues:p,reset:m}=s,g=d(D=>n(w=>{w.settings.theme=D}));sB({control:c,reset:m,onSubmit:g});const v=my(D=>{const w=p("palettes");f("colors",{light:dy(w,"light",D?void 0:{palettes:l.palettes,config:l.colors.light}),dark:dy(w,"dark",D?void 0:{palettes:l.palettes,config:l.colors.dark})})},[p,f,l]),b=my(()=>{v()},[v]),[y,j]=vB("light");return o.jsxs("form",{className:"relative h-full max-h-full pb-(--action-bar-height)",onSubmit:g,children:[o.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[o.jsxs("div",{className:"sticky top-0 z-10 space-y-2 border-b bg-background py-6",children:[o.jsx("h1",{children:"Theme Builder"}),o.jsxs("p",{className:"max-w-3xl text-muted-foreground",children:["The theme of the UI is based off color variables used with"," ",o.jsx("a",{href:"https://ui.shadcn.com/docs/theming",target:"_blank",rel:"noreferrer",className:"underline",children:"the Shadn UI component library"}),". We generate the color variables based off the Tailwind color palette structure but you can customize them as you wish."]})]}),o.jsxs("div",{className:"pt-4",children:[o.jsxs(uB,{className:"max-w-fit",children:[o.jsx(_w,{}),o.jsx(fB,{children:"Work in Progress"}),o.jsx(dB,{children:"This page is still a work in progress. It is not being used for generation at the moment."})]}),o.jsxs(pB,{children:[o.jsxs(Jh,{children:[o.jsxs(nm,{children:[o.jsx(am,{children:"Theme Palettes"}),o.jsx(tm,{children:"Pick the colors for your theme"})]}),o.jsx(em,{className:"max-w-3xl",children:o.jsxs(fy,{defaultValue:"base",children:[o.jsxs(hy,{children:[o.jsx(dc,{value:"base",children:"Base"}),o.jsx(dc,{value:"primary",children:"Primary"})]}),o.jsx(uc,{value:"base",children:o.jsx(uy,{control:c,getValues:p,setValue:f,type:"base",onShadesChange:b})}),o.jsx(uc,{value:"primary",children:o.jsx(uy,{control:c,getValues:p,setValue:f,type:"primary",onShadesChange:b})})]})})]}),o.jsxs(Jh,{children:[o.jsxs(nm,{children:[o.jsx(am,{children:"Theme Colors"}),o.jsx(tm,{children:"Pick the colors for your theme"}),o.jsx("div",{className:"sticky top-44",children:o.jsx(Zz,{control:c,mode:y},y)})]}),o.jsxs(em,{className:"flex flex-col gap-4",children:[o.jsxs(fy,{value:y,onValueChange:j,children:[o.jsxs(hy,{children:[o.jsx(dc,{value:"light",children:"Light"}),o.jsx(dc,{value:"dark",children:"Dark"})]}),o.jsx(uc,{value:"light",children:o.jsx(ry,{control:c,setValue:f,mode:"light"})}),o.jsx(uc,{value:"dark",children:o.jsx(ry,{control:c,setValue:f,mode:"dark"})})]}),o.jsx(hB,{onClick:()=>{v(!0)},variant:"outline",size:"sm",type:"button",className:"w-fit",children:"Reset Colors"})]})]}),o.jsxs(Jh,{children:[o.jsxs(nm,{children:[o.jsx(am,{children:"CSS Preview"}),o.jsx(tm,{children:"Preview the CSS for your theme"})]}),o.jsx(em,{className:"flex flex-col gap-4",children:o.jsx(Az,{control:c})})]})]})]})]}),o.jsx(mB,{form:s})]})}const xB={element:o.jsx(zU,{}),path:"/settings",handle:{crumb:"Settings"},children:[{index:!0,element:o.jsx($m,{to:"./project-settings"})},{path:"project-settings",element:o.jsx(fz,{}),handle:{crumb:"Project settings"}},{path:"hierarchy",element:o.jsx(ez,{}),handle:{crumb:"Hierarchy"}},{path:"theme-builder",element:o.jsx(bB,{}),handle:{crumb:"Theme builder"}},{path:"template-extractor",element:o.jsx(Rz,{}),handle:{crumb:"Template extractor"}},{path:"*",element:o.jsx(Ds,{})}]},yB=xC([{element:o.jsx(V8,{}),children:[{element:o.jsx(G7,{}),children:[{path:"/",element:o.jsx(GO,{}),handle:{crumb:{label:"Home",url:"/"}}},{path:"/apps/*",children:m9,handle:{crumb:{label:"Apps",url:"/apps"}}},VO,{path:"/plugins/*",children:MU,handle:{crumb:{label:"Plugins",url:"/plugins"}}},xB,Ts]}]}]),jB=await C("react"),m2=document.querySelector("#root");if(!m2)throw new Error("Failed to find root element");const SB=Qw.createRoot(m2);SB.render(o.jsx(jB.StrictMode,{children:o.jsx(RC,{router:yB})}));
|
|
78
|
-
//# sourceMappingURL=index-YQe87MH8.js.map
|