@baseplate-dev/project-builder-web 0.2.0 → 0.2.1
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-DeLjV85y.js → web-DNtY4wq3.js} +2 -2
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-DeLjV85y.js.map → web-DNtY4wq3.js.map} +1 -1
- package/dist/assets/__federation_shared_@baseplate-dev/{project-builder-lib-CEcnKpIc.js → project-builder-lib-zvGcQ6PN.js} +2 -2
- package/dist/assets/__federation_shared_@baseplate-dev/{project-builder-lib-CEcnKpIc.js.map → project-builder-lib-zvGcQ6PN.js.map} +1 -1
- package/dist/assets/__federation_shared_@baseplate-dev/{ui-components-BngA7Gbo.js → ui-components-DQh2UKHB.js} +2 -2
- package/dist/assets/__federation_shared_@baseplate-dev/{ui-components-BngA7Gbo.js.map → ui-components-DQh2UKHB.js.map} +1 -1
- package/dist/assets/{_virtual___federation_fn_import-DTGz4eK3.js → _virtual___federation_fn_import-BawTfoQI.js} +2 -2
- package/dist/assets/{_virtual___federation_fn_import-DTGz4eK3.js.map → _virtual___federation_fn_import-BawTfoQI.js.map} +1 -1
- package/dist/assets/index-BDJ79UQH.css +1 -0
- package/dist/assets/index-C6NlRicZ.js +78 -0
- package/dist/assets/index-C6NlRicZ.js.map +1 -0
- package/dist/assets/{index.esm-BCWxrcvn.js → index.esm-H0JGW0RR.js} +2 -2
- package/dist/assets/{index.esm-BCWxrcvn.js.map → index.esm-H0JGW0RR.js.map} +1 -1
- package/dist/assets/model-merger-D2RoujrB.js +2 -0
- package/dist/assets/model-merger-D2RoujrB.js.map +1 -0
- package/dist/assets/{not-empty-CxPFIhu9.js → not-empty-CznDVwM8.js} +2 -2
- package/dist/assets/{not-empty-CxPFIhu9.js.map → not-empty-CznDVwM8.js.map} +1 -1
- package/dist/index.html +5 -5
- package/package.json +6 -6
- package/dist/assets/index-BM00URXH.js +0 -78
- package/dist/assets/index-BM00URXH.js.map +0 -1
- package/dist/assets/index-BievMsrf.css +0 -1
- package/dist/assets/model-merger-xMPe_PFP.js +0 -2
- package/dist/assets/model-merger-xMPe_PFP.js.map +0 -1
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import{i as C}from"./_virtual___federation_fn_import-DTGz4eK3.js";import{j as o,c as wm,u as fa,g as lm,s as Yd,a as jw,b as gi,d as bs,e as it,f as Sw,h as ww}from"./index.esm-BCWxrcvn.js";import{r as Cw,g as Cm}from"./index-9Ra4Lmds.js";import{r as Ew}from"./index-B0D_rfGi.js";import{c as Te,G as Gi,M as O0,a as gx,b as Dw,d as vx,e as Tw,f as Rw,n as bx,g as Nw,h as Em,i as yx,j as xx,k as Mw,l as Aw,m as Yi,o as jx,p as ys,q as Vl,r as Dm,s as $w,t as Lw,u as Ow,v as Uw,w as Sx,x as zw,y as Bw,z as _w,A as qw}from"./not-empty-CxPFIhu9.js";import{s as Zn,o as Fw,p as Hw,i as wx,c as Pw,f as kw}from"./index-DC_DCd-Q.js";import{i as Iw}from"./isEqual-C420KeG-.js";import{c as Vw}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 Xd={exports:{}},Yr={},Qd={exports:{}},Kd={};/**
|
|
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 U0;function Gw(){return U0||(U0=1,function(a){function n(U,k){var Y=U.length;U.push(k);e:for(;0<Y;){var te=Y-1>>>1,re=U[te];if(0<c(re,k))U[te]=k,U[Y]=re,Y=te;else break e}}function l(U){return U.length===0?null:U[0]}function s(U){if(U.length===0)return null;var k=U[0],Y=U.pop();if(Y!==k){U[0]=Y;e:for(var te=0,re=U.length,ge=re>>>1;te<ge;){var ie=2*(te+1)-1,ce=U[ie],Se=ie+1,je=U[Se];if(0>c(ce,Y))Se<re&&0>c(je,ce)?(U[te]=je,U[Se]=Y,te=Se):(U[te]=ce,U[ie]=Y,te=ie);else if(Se<re&&0>c(je,Y))U[te]=je,U[Se]=Y,te=Se;else break e}}return k}function c(U,k){var Y=U.sortIndex-k.sortIndex;return Y!==0?Y:U.id-k.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,x=3,j=!1,D=!1,S=!1,R=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function q(U){for(var k=l(g);k!==null;){if(k.callback===null)s(g);else if(k.startTime<=U)s(g),k.sortIndex=k.expirationTime,n(m,k);else break;k=l(g)}}function G(U){if(S=!1,q(U),!D)if(l(m)!==null)D=!0,Q||(Q=!0,se());else{var k=l(g);k!==null&&Z(G,k.startTime-U)}}var Q=!1,T=-1,O=5,W=-1;function ae(){return R?!0:!(a.unstable_now()-W<O)}function ne(){if(R=!1,Q){var U=a.unstable_now();W=U;var k=!0;try{e:{D=!1,S&&(S=!1,A(T),T=-1),j=!0;var Y=x;try{t:{for(q(U),b=l(m);b!==null&&!(b.expirationTime>U&&ae());){var te=b.callback;if(typeof te=="function"){b.callback=null,x=b.priorityLevel;var re=te(b.expirationTime<=U);if(U=a.unstable_now(),typeof re=="function"){b.callback=re,q(U),k=!0;break t}b===l(m)&&s(m),q(U)}else s(m);b=l(m)}if(b!==null)k=!0;else{var ge=l(g);ge!==null&&Z(G,ge.startTime-U),k=!1}}break e}finally{b=null,x=Y,j=!1}k=void 0}}finally{k?se():Q=!1}}}var se;if(typeof B=="function")se=function(){B(ne)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,V=Ee.port2;Ee.port1.onmessage=ne,se=function(){V.postMessage(null)}}else se=function(){E(ne,0)};function Z(U,k){T=E(function(){U(a.unstable_now())},k)}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"):O=0<U?Math.floor(1e3/U):5},a.unstable_getCurrentPriorityLevel=function(){return x},a.unstable_next=function(U){switch(x){case 1:case 2:case 3:var k=3;break;default:k=x}var Y=x;x=k;try{return U()}finally{x=Y}},a.unstable_requestPaint=function(){R=!0},a.unstable_runWithPriority=function(U,k){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var Y=x;x=U;try{return k()}finally{x=Y}},a.unstable_scheduleCallback=function(U,k,Y){var te=a.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?te+Y:te):Y=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=Y+re,U={id:v++,callback:k,priorityLevel:U,startTime:Y,expirationTime:re,sortIndex:-1},Y>te?(U.sortIndex=Y,n(g,U),l(m)===null&&U===l(g)&&(S?(A(T),T=-1):S=!0,Z(G,Y-te))):(U.sortIndex=re,n(m,U),D||j||(D=!0,Q||(Q=!0,se()))),U},a.unstable_shouldYield=ae,a.unstable_wrapCallback=function(U){var k=x;return function(){var Y=x;x=k;try{return U.apply(this,arguments)}finally{x=Y}}}}(Kd)),Kd}var z0;function Yw(){return z0||(z0=1,Qd.exports=Gw()),Qd.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 B0;function Xw(){if(B0)return Yr;B0=1;var a=Yw(),n=Cw(),l=Ew();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 y=!1,w=u.child;w;){if(w===i){y=!0,i=u,r=h;break}if(w===r){y=!0,r=u,i=h;break}w=w.sibling}if(!y){for(w=h.child;w;){if(w===i){y=!0,i=h,r=u;break}if(w===r){y=!0,r=h,i=u;break}w=w.sibling}if(!y)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"),x=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),B=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function V(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case R:return"Profiler";case S:return"StrictMode";case G:return"Suspense";case Q:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case B:return(e.displayName||"Context")+".Provider";case A:return(e._context.displayName||"Context")+".Consumer";case q: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:V(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return V(e(t))}catch{}}return null}var Z=Array.isArray,U=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},te=[],re=-1;function ge(e){return{current:e}}function ie(e){0>re||(e.current=te[re],te[re]=null,re--)}function ce(e,t){re++,te[re]=e.current,e.current=t}var Se=ge(null),je=ge(null),Ue=ge(null),Ot=ge(null);function Dt(e,t){switch(ce(Ue,t),ce(je,e),ce(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?o0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=o0(t),e=c0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ie(Se),ce(Se,e)}function Tt(){ie(Se),ie(je),ie(Ue)}function Be(e){e.memoizedState!==null&&ce(Ot,e);var t=Se.current,i=c0(t,e.type);t!==i&&(ce(je,e),ce(Se,i))}function Dn(e){je.current===e&&(ie(Se),ie(je)),Ot.current===e&&(ie(Ot),Pr._currentValue=Y)}var ke=Object.prototype.hasOwnProperty,Ut=a.unstable_scheduleCallback,Vt=a.unstable_cancelCallback,ea=a.unstable_shouldYield,Gt=a.unstable_requestPaint,Xt=a.unstable_now,Zi=a.unstable_getCurrentPriorityLevel,ga=a.unstable_ImmediatePriority,fn=a.unstable_UserBlockingPriority,Hn=a.unstable_NormalPriority,Pa=a.unstable_LowPriority,bi=a.unstable_IdlePriority,Tn=a.log,va=a.unstable_setDisableYieldValue,ta=null,rt=null;function st(e){if(typeof Tn=="function"&&va(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(ta,e)}catch{}}var Ve=Math.clz32?Math.clz32:Wi,yi=Math.log,Qt=Math.LN2;function Wi(e){return e>>>=0,e===0?32:31-(yi(e)/Qt|0)|0}var Kt=256,ba=4194304;function nn(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 na(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var u=0,h=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var w=r&134217727;return w!==0?(r=w&~h,r!==0?u=nn(r):(y&=w,y!==0?u=nn(y):i||(i=w&~e,i!==0&&(u=nn(i))))):(w=r&~h,w!==0?u=nn(w):y!==0?u=nn(y):i||(i=r&~e,i!==0&&(u=nn(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 ya(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 ji(){var e=ba;return ba<<=1,(ba&62914560)===0&&(ba=4194304),e}function ja(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 y=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 w=e.entanglements,N=e.expirationTimes,F=e.hiddenUpdates;for(i=y&~i;0<i;){var X=31-Ve(i),J=1<<X;w[X]=0,N[X]=-1;var P=F[X];if(P!==null)for(F[X]=null,X=0;X<P.length;X++){var I=P[X];I!==null&&(I.lane&=-536870913)}i&=~J}r!==0&&jt(e,r,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(y&~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 hn(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=k.p;return e!==0?e:(e=window.event,e===void 0?32:R0(e.type))}function aa(e,t){var i=k.p;try{return k.p=e,t()}finally{k.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,fe="__reactHandles$"+Ze,be="__reactResources$"+Ze,oe="__reactMarker$"+Ze;function he(e){delete e[M],delete e[L],delete e[ee],delete e[le],delete e[fe]}function ue(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=h0(e);e!==null;){if(i=e[M])return i;e=h0(e)}return t}e=i,i=e.parentNode}return null}function me(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 Ce(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[be];return t||(t=e[be]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Oe(e){e[oe]=!0}var Ge=new Set,_e={};function Ie(e,t){mn(e,t),mn(e+"Capture",t)}function mn(e,t){for(_e[e]=t,e=0;e<t.length;e++)Ge.add(t[e])}var Si=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]*$"),Rn={},pn={};function er(e){return ke.call(pn,e)?!0:ke.call(Rn,e)?!1:Si.test(e)?pn[e]=!0:(Rn[e]=!0,!1)}function ia(e,t,i){if(er(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 Nn(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 an(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 ka,ze;function Ye(e){if(ka===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ka=t&&t[1]||"",ze=-1<i.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+ka+e+ze}var la=!1;function Sa(e,t){if(!e||la)return"";la=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(I){var P=I}Reflect.construct(e,[],J)}else{try{J.call()}catch(I){P=I}e.call(J.prototype)}}else{try{throw Error()}catch(I){P=I}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(I){if(I&&P&&typeof I.stack=="string")return[I.stack,P.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(),y=h[0],w=h[1];if(y&&w){var N=y.split(`
|
|
20
|
-
`),F=w.split(`
|
|
21
|
-
`);for(u=r=0;r<N.length&&!N[r].includes("DetermineComponentFrameRoot");)r++;for(;u<F.length&&!F[u].includes("DetermineComponentFrameRoot");)u++;if(r===N.length||u===F.length)for(r=N.length-1,u=F.length-1;1<=r&&0<=u&&N[r]!==F[u];)u--;for(;1<=r&&0<=u;r--,u--)if(N[r]!==F[u]){if(r!==1||u!==1)do if(r--,u--,0>u||N[r]!==F[u]){var X=`
|
|
22
|
-
`+N[r].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=r&&0<=u);break}}}finally{la=!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 Sa(e.type,!1);case 11:return Sa(e.type.render,!1);case 1:return Sa(e.type,!0);case 31:return Ye("Activity");default:return""}}function wa(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 Ms(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function g2(e){var t=Ms(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(y){r=""+y,h.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(y){r=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function As(e){e._valueTracker||(e._valueTracker=g2(e))}function ip(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),r="";return e&&(r=Ms(e)?e.checked?"true":"false":e.value),e=r,e!==i?(t.setValue(e),!0):!1}function $s(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 v2=/[\n"\\]/g;function Mn(e){return e.replace(v2,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ic(e,t,i,r,u,h,y,w){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zt(t)):e.value!==""+Zt(t)&&(e.value=""+Zt(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?Vc(e,y,Zt(t)):i!=null?Vc(e,y,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"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+Zt(w):e.removeAttribute("name")}function lp(e,t,i,r,u,h,y,w){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,w||t===e.value||(e.value=t),e.defaultValue=t}r=r??u,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=w?e.checked:!!r,e.defaultChecked=!!r,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y)}function Vc(e,t,i){t==="number"&&$s(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Ji(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 rp(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 sp(e,t,i,r){if(t==null){if(r!=null){if(i!=null)throw Error(s(92));if(Z(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 el(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var b2=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 op(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||b2.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function cp(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&&op(e,u,r)}else for(var h in t)t.hasOwnProperty(h)&&op(e,h,t[h])}function Gc(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 y2=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 Ls(e){return x2.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Yc=null;function Xc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tl=null,nl=null;function up(e){var t=me(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="'+Mn(""+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&&ip(r)}break e;case"textarea":rp(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Ji(e,!!i.multiple,t,!1)}}}var Qc=!1;function dp(e,t,i){if(Qc)return e(t,i);Qc=!0;try{var r=e(t);return r}finally{if(Qc=!1,(tl!==null||nl!==null)&&(yo(),tl&&(t=tl,e=nl,nl=tl=null,up(t),e)))for(t=0;t<e.length;t++)up(e[t])}}function tr(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 Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kc=!1;if(Ca)try{var nr={};Object.defineProperty(nr,"passive",{get:function(){Kc=!0}}),window.addEventListener("test",nr,nr),window.removeEventListener("test",nr,nr)}catch{Kc=!1}var Ia=null,Zc=null,Os=null;function fp(){if(Os)return Os;var e,t=Zc,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 y=i-e;for(r=1;r<=y&&t[i-r]===u[h-r];r++);return Os=u.slice(e,1<r?1-r:void 0)}function Us(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 zs(){return!0}function hp(){return!1}function ln(e){function t(i,r,u,h,y){this._reactName=i,this._targetInst=u,this.type=r,this.nativeEvent=h,this.target=y,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(i=e[w],this[w]=i?i(h):h[w]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?zs:hp,this.isPropagationStopped=hp,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=zs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=zs)},persist:function(){},isPersistent:zs}),t}var wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bs=ln(wi),ar=v({},wi,{view:0,detail:0}),j2=ln(ar),Wc,Jc,ir,_s=v({},ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tu,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!==ir&&(ir&&e.type==="mousemove"?(Wc=e.screenX-ir.screenX,Jc=e.screenY-ir.screenY):Jc=Wc=0,ir=e),Wc)},movementY:function(e){return"movementY"in e?e.movementY:Jc}}),mp=ln(_s),S2=v({},_s,{dataTransfer:0}),w2=ln(S2),C2=v({},ar,{relatedTarget:0}),eu=ln(C2),E2=v({},wi,{animationName:0,elapsedTime:0,pseudoElement:0}),D2=ln(E2),T2=v({},wi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),R2=ln(T2),N2=v({},wi,{data:0}),pp=ln(N2),M2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},A2={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"},$2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$2[e])?!!t[e]:!1}function tu(){return L2}var O2=v({},ar,{key:function(e){if(e.key){var t=M2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Us(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?A2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tu,charCode:function(e){return e.type==="keypress"?Us(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Us(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),U2=ln(O2),z2=v({},_s,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gp=ln(z2),B2=v({},ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tu}),_2=ln(B2),q2=v({},wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),F2=ln(q2),H2=v({},_s,{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}),P2=ln(H2),k2=v({},wi,{newState:0,oldState:0}),I2=ln(k2),V2=[9,13,27,32],nu=Ca&&"CompositionEvent"in window,lr=null;Ca&&"documentMode"in document&&(lr=document.documentMode);var G2=Ca&&"TextEvent"in window&&!lr,vp=Ca&&(!nu||lr&&8<lr&&11>=lr),bp=" ",yp=!1;function xp(e,t){switch(e){case"keyup":return V2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var al=!1;function Y2(e,t){switch(e){case"compositionend":return jp(t);case"keypress":return t.which!==32?null:(yp=!0,bp);case"textInput":return e=t.data,e===bp&&yp?null:e;default:return null}}function X2(e,t){if(al)return e==="compositionend"||!nu&&xp(e,t)?(e=fp(),Os=Zc=Ia=null,al=!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 vp&&t.locale!=="ko"?null:t.data;default:return null}}var Q2={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 Sp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Q2[e.type]:t==="textarea"}function wp(e,t,i,r){tl?nl?nl.push(r):nl=[r]:tl=r,t=Eo(t,"onChange"),0<t.length&&(i=new Bs("onChange","change",null,i,r),e.push({event:i,listeners:t}))}var rr=null,sr=null;function K2(e){a0(e,0)}function qs(e){var t=Ce(e);if(ip(t))return e}function Cp(e,t){if(e==="change")return t}var Ep=!1;if(Ca){var au;if(Ca){var iu="oninput"in document;if(!iu){var Dp=document.createElement("div");Dp.setAttribute("oninput","return;"),iu=typeof Dp.oninput=="function"}au=iu}else au=!1;Ep=au&&(!document.documentMode||9<document.documentMode)}function Tp(){rr&&(rr.detachEvent("onpropertychange",Rp),sr=rr=null)}function Rp(e){if(e.propertyName==="value"&&qs(sr)){var t=[];wp(t,sr,e,Xc(e)),dp(K2,t)}}function Z2(e,t,i){e==="focusin"?(Tp(),rr=t,sr=i,rr.attachEvent("onpropertychange",Rp)):e==="focusout"&&Tp()}function W2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qs(sr)}function J2(e,t){if(e==="click")return qs(t)}function eS(e,t){if(e==="input"||e==="change")return qs(t)}function tS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gn=typeof Object.is=="function"?Object.is:tS;function or(e,t){if(gn(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(!ke.call(t,u)||!gn(e[u],t[u]))return!1}return!0}function Np(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mp(e,t){var i=Np(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=Np(i)}}function Ap(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ap(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $p(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$s(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=$s(e.document)}return t}function lu(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 nS=Ca&&"documentMode"in document&&11>=document.documentMode,il=null,ru=null,cr=null,su=!1;function Lp(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;su||il==null||il!==$s(r)||(r=il,"selectionStart"in r&&lu(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}),cr&&or(cr,r)||(cr=r,r=Eo(ru,"onSelect"),0<r.length&&(t=new Bs("onSelect","select",null,t,i),e.push({event:t,listeners:r}),t.target=il)))}function Ci(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ll={animationend:Ci("Animation","AnimationEnd"),animationiteration:Ci("Animation","AnimationIteration"),animationstart:Ci("Animation","AnimationStart"),transitionrun:Ci("Transition","TransitionRun"),transitionstart:Ci("Transition","TransitionStart"),transitioncancel:Ci("Transition","TransitionCancel"),transitionend:Ci("Transition","TransitionEnd")},ou={},Op={};Ca&&(Op=document.createElement("div").style,"AnimationEvent"in window||(delete ll.animationend.animation,delete ll.animationiteration.animation,delete ll.animationstart.animation),"TransitionEvent"in window||delete ll.transitionend.transition);function Ei(e){if(ou[e])return ou[e];if(!ll[e])return e;var t=ll[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Op)return ou[e]=t[i];return e}var Up=Ei("animationend"),zp=Ei("animationiteration"),Bp=Ei("animationstart"),aS=Ei("transitionrun"),iS=Ei("transitionstart"),lS=Ei("transitioncancel"),_p=Ei("transitionend"),qp=new Map,cu="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(" ");cu.push("scrollEnd");function Pn(e,t){qp.set(e,t),Ie(t,[e])}var Fp=new WeakMap;function An(e,t){if(typeof e=="object"&&e!==null){var i=Fp.get(e);return i!==void 0?i:(t={value:e,source:t,stack:wa(t)},Fp.set(e,t),t)}return{value:e,source:t,stack:wa(t)}}var $n=[],rl=0,uu=0;function Fs(){for(var e=rl,t=uu=rl=0;t<e;){var i=$n[t];$n[t++]=null;var r=$n[t];$n[t++]=null;var u=$n[t];$n[t++]=null;var h=$n[t];if($n[t++]=null,r!==null&&u!==null){var y=r.pending;y===null?u.next=u:(u.next=y.next,y.next=u),r.pending=u}h!==0&&Hp(i,u,h)}}function Hs(e,t,i,r){$n[rl++]=e,$n[rl++]=t,$n[rl++]=i,$n[rl++]=r,uu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function du(e,t,i,r){return Hs(e,t,i,r),Ps(e)}function sl(e,t){return Hs(e,null,null,t),Ps(e)}function Hp(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 Ps(e){if(50<Or)throw Or=0,vd=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ol={};function rS(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 vn(e,t,i,r){return new rS(e,t,i,r)}function fu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ea(e,t){var i=e.alternate;return i===null?(i=vn(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 Pp(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 ks(e,t,i,r,u,h){var y=0;if(r=e,typeof e=="function")fu(e)&&(y=1);else if(typeof e=="string")y=ow(e,i,Se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case W:return e=vn(31,i,t,u),e.elementType=W,e.lanes=h,e;case D:return Di(i.children,u,h,t);case S:y=8,u|=24;break;case R:return e=vn(12,i,t,u|2),e.elementType=R,e.lanes=h,e;case G:return e=vn(13,i,t,u),e.elementType=G,e.lanes=h,e;case Q:return e=vn(19,i,t,u),e.elementType=Q,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:case B:y=10;break e;case A:y=9;break e;case q:y=11;break e;case T:y=14;break e;case O:y=16,r=null;break e}y=29,i=Error(s(130,e===null?"null":typeof e,"")),r=null}return t=vn(y,i,t,u),t.elementType=e,t.type=r,t.lanes=h,t}function Di(e,t,i,r){return e=vn(7,e,r,t),e.lanes=i,e}function hu(e,t,i){return e=vn(6,e,null,t),e.lanes=i,e}function mu(e,t,i){return t=vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var cl=[],ul=0,Is=null,Vs=0,Ln=[],On=0,Ti=null,Da=1,Ta="";function Ri(e,t){cl[ul++]=Vs,cl[ul++]=Is,Is=e,Vs=t}function kp(e,t,i){Ln[On++]=Da,Ln[On++]=Ta,Ln[On++]=Ti,Ti=e;var r=Da;e=Ta;var u=32-Ve(r)-1;r&=~(1<<u),i+=1;var h=32-Ve(t)+u;if(30<h){var y=u-u%5;h=(r&(1<<y)-1).toString(32),r>>=y,u-=y,Da=1<<32-Ve(t)+u|i<<u|r,Ta=h+e}else Da=1<<h|i<<u|r,Ta=e}function pu(e){e.return!==null&&(Ri(e,1),kp(e,1,0))}function gu(e){for(;e===Is;)Is=cl[--ul],cl[ul]=null,Vs=cl[--ul],cl[ul]=null;for(;e===Ti;)Ti=Ln[--On],Ln[On]=null,Ta=Ln[--On],Ln[On]=null,Da=Ln[--On],Ln[On]=null}var Wt=null,ht=null,He=!1,Ni=null,ra=!1,vu=Error(s(519));function Mi(e){var t=Error(s(418,""));throw fr(An(t,e)),vu}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<zr.length;i++)Le(zr[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),lp(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),As(t);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),sp(t,r.value,r.defaultValue,r.children),As(t)}i=r.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||r.suppressHydrationWarning===!0||s0(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=Do),t=!0):t=!1,t||Mi(e)}function Vp(e){for(Wt=e.return;Wt;)switch(Wt.tag){case 5:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:Wt=Wt.return}}function ur(e){if(e!==Wt)return!1;if(!He)return Vp(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")||Ld(e.type,e.memoizedProps)),i=!i),i&&ht&&Mi(e),Vp(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,ri(e.type)?(e=Bd,Bd=null,ht=e):ht=t):ht=Wt?In(e.stateNode.nextSibling):null;return!0}function dr(){ht=Wt=null,He=!1}function Gp(){var e=Ni;return e!==null&&(on===null?on=e:on.push.apply(on,e),Ni=null),e}function fr(e){Ni===null?Ni=[e]:Ni.push(e)}var bu=ge(null),Ai=null,Ra=null;function Va(e,t,i){ce(bu,t._currentValue),t._currentValue=i}function Na(e){e._currentValue=bu.current,ie(bu)}function yu(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 y=u.child;h=h.firstContext;e:for(;h!==null;){var w=h;h=u;for(var N=0;N<t.length;N++)if(w.context===t[N]){h.lanes|=i,w=h.alternate,w!==null&&(w.lanes|=i),yu(h.return,i,e),r||(y=null);break e}h=w.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(s(341));y.lanes|=i,h=y.alternate,h!==null&&(h.lanes|=i),yu(y,i,e),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===e){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function hr(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 y=u.alternate;if(y===null)throw Error(s(387));if(y=y.memoizedProps,y!==null){var w=u.type;gn(u.pendingProps.value,y.value)||(e!==null?e.push(w):e=[w])}}else if(u===Ot.current){if(y=u.alternate,y===null)throw Error(s(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Pr):e=[Pr])}u=u.return}e!==null&&xu(t,e,i,r),t.flags|=262144}function Gs(e){for(e=e.firstContext;e!==null;){if(!gn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $i(e){Ai=e,Ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yt(e){return Yp(Ai,e)}function Ys(e,t){return Ai===null&&$i(e),Yp(e,t)}function Yp(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ra===null){if(e===null)throw Error(s(308));Ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ra=Ra.next=t;return i}var sS=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()})}},oS=a.unstable_scheduleCallback,cS=a.unstable_NormalPriority,wt={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ju(){return{controller:new sS,data:new Map,refCount:0}}function mr(e){e.refCount--,e.refCount===0&&oS(cS,function(){e.controller.abort()})}var pr=null,Su=0,dl=0,fl=null;function uS(e,t){if(pr===null){var i=pr=[];Su=0,dl=Cd(),fl={status:"pending",value:void 0,then:function(r){i.push(r)}}}return Su++,t.then(Xp,Xp),t}function Xp(){if(--Su===0&&pr!==null){fl!==null&&(fl.status="fulfilled");var e=pr;pr=null,dl=0,fl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function dS(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 Qp=U.S;U.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&uS(e,t),Qp!==null&&Qp(e,t)};var Li=ge(null);function wu(){var e=Li.current;return e!==null?e:at.pooledCache}function Xs(e,t){t===null?ce(Li,Li.current):ce(Li,t.pool)}function Kp(){var e=wu();return e===null?null:{parent:wt._currentValue,pool:e}}var gr=Error(s(460)),Zp=Error(s(474)),Qs=Error(s(542)),Cu={then:function(){}};function Wp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ks(){}function Jp(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Ks,Ks),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tg(e),e;default:if(typeof t.status=="string")t.then(Ks,Ks);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,tg(e),e}throw vr=t,gr}}var vr=null;function eg(){if(vr===null)throw Error(s(459));var e=vr;return vr=null,e}function tg(e){if(e===gr||e===Qs)throw Error(s(483))}var Ga=!1;function Eu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Du(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 Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xa(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=Ps(e),Hp(e,null,i),t}return Hs(e,r,t,i),Ps(e)}function br(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,hn(e,i)}}function Tu(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 y={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?u=h=y:h=h.next=y,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 Ru=!1;function yr(){if(Ru){var e=fl;if(e!==null)throw e}}function xr(e,t,i,r){Ru=!1;var u=e.updateQueue;Ga=!1;var h=u.firstBaseUpdate,y=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var N=w,F=N.next;N.next=null,y===null?h=F:y.next=F,y=N;var X=e.alternate;X!==null&&(X=X.updateQueue,w=X.lastBaseUpdate,w!==y&&(w===null?X.firstBaseUpdate=F:w.next=F,X.lastBaseUpdate=N))}if(h!==null){var J=u.baseState;y=0,X=F=N=null,w=h;do{var P=w.lane&-536870913,I=P!==w.lane;if(I?(qe&P)===P:(r&P)===P){P!==0&&P===dl&&(Ru=!0),X!==null&&(X=X.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var we=e,ye=w;P=t;var et=i;switch(ye.tag){case 1:if(we=ye.payload,typeof we=="function"){J=we.call(et,J,P);break e}J=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ye.payload,P=typeof we=="function"?we.call(et,J,P):we,P==null)break e;J=v({},J,P);break e;case 2:Ga=!0}}P=w.callback,P!==null&&(e.flags|=64,I&&(e.flags|=8192),I=u.callbacks,I===null?u.callbacks=[P]:I.push(P))}else I={lane:P,tag:w.tag,payload:w.payload,callback:w.callback,next:null},X===null?(F=X=I,N=J):X=X.next=I,y|=P;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;I=w,w=I.next,I.next=null,u.lastBaseUpdate=I,u.shared.pending=null}}while(!0);X===null&&(N=J),u.baseState=N,u.firstBaseUpdate=F,u.lastBaseUpdate=X,h===null&&(u.shared.lanes=0),ni|=y,e.lanes=y,e.memoizedState=J}}function ng(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function ag(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)ng(i[e],t)}var hl=ge(null),Zs=ge(0);function ig(e,t){e=za,ce(Zs,e),ce(hl,t),za=e|t.baseLanes}function Nu(){ce(Zs,za),ce(hl,hl.current)}function Mu(){za=Zs.current,ie(hl),ie(Zs)}var Qa=0,Me=null,We=null,bt=null,Ws=!1,ml=!1,Oi=!1,Js=0,jr=0,pl=null,fS=0;function pt(){throw Error(s(321))}function Au(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!gn(e[i],t[i]))return!1;return!0}function $u(e,t,i,r,u,h){return Qa=h,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Hg:Pg,Oi=!1,h=i(r,u),Oi=!1,ml&&(h=rg(t,i,r,u)),lg(e),h}function lg(e){U.H=lo;var t=We!==null&&We.next!==null;if(Qa=0,bt=We=Me=null,Ws=!1,jr=0,pl=null,t)throw Error(s(300));e===null||Nt||(e=e.dependencies,e!==null&&Gs(e)&&(Nt=!0))}function rg(e,t,i,r){Me=e;var u=0;do{if(ml&&(pl=null),jr=0,ml=!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=yS,h=t(i,r)}while(ml);return h}function hS(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Sr(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Me.flags|=1024),t}function Lu(){var e=Js!==0;return Js=0,e}function Ou(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Uu(e){if(Ws){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ws=!1}Qa=0,bt=We=Me=null,ml=!1,jr=Js=0,pl=null}function rn(){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 yt(){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 zu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sr(e){var t=jr;return jr+=1,pl===null&&(pl=[]),e=Jp(pl,e,t),t=Me,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Hg:Pg),e}function eo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sr(e);if(e.$$typeof===B)return Yt(e)}throw Error(s(438,String(e)))}function Bu(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=zu(),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]=ae;return t.index++,i}function Ma(e,t){return typeof t=="function"?t(e):t}function to(e){var t=yt();return _u(t,We,e)}function _u(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 y=u.next;u.next=h.next,h.next=y}t.baseQueue=u=h,r.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var w=y=null,N=null,F=t,X=!1;do{var J=F.lane&-536870913;if(J!==F.lane?(qe&J)===J:(Qa&J)===J){var P=F.revertLane;if(P===0)N!==null&&(N=N.next={lane:0,revertLane:0,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),J===dl&&(X=!0);else if((Qa&P)===P){F=F.next,P===dl&&(X=!0);continue}else J={lane:0,revertLane:F.revertLane,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},N===null?(w=N=J,y=h):N=N.next=J,Me.lanes|=P,ni|=P;J=F.action,Oi&&i(h,J),h=F.hasEagerState?F.eagerState:i(h,J)}else P={lane:J,revertLane:F.revertLane,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},N===null?(w=N=P,y=h):N=N.next=P,Me.lanes|=J,ni|=J;F=F.next}while(F!==null&&F!==t);if(N===null?y=h:N.next=w,!gn(h,e.memoizedState)&&(Nt=!0,X&&(i=fl,i!==null)))throw i;e.memoizedState=h,e.baseState=y,e.baseQueue=N,r.lastRenderedState=h}return u===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function qu(e){var t=yt(),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 y=u=u.next;do h=e(h,y.action),y=y.next;while(y!==u);gn(h,t.memoizedState)||(Nt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),i.lastRenderedState=h}return[h,r]}function sg(e,t,i){var r=Me,u=yt(),h=He;if(h){if(i===void 0)throw Error(s(407));i=i()}else i=t();var y=!gn((We||u).memoizedState,i);y&&(u.memoizedState=i,Nt=!0),u=u.queue;var w=ug.bind(null,r,u,e);if(wr(2048,8,w,[e]),u.getSnapshot!==t||y||bt!==null&&bt.memoizedState.tag&1){if(r.flags|=2048,gl(9,no(),cg.bind(null,r,u,i,t),null),at===null)throw Error(s(349));h||(Qa&124)!==0||og(r,t,i)}return i}function og(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Me.updateQueue,t===null?(t=zu(),Me.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function cg(e,t,i,r){t.value=i,t.getSnapshot=r,dg(t)&&fg(e)}function ug(e,t,i){return i(function(){dg(t)&&fg(e)})}function dg(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!gn(e,i)}catch{return!0}}function fg(e){var t=sl(e,2);t!==null&&Sn(t,e,2)}function Fu(e){var t=rn();if(typeof e=="function"){var i=e;if(e=i(),Oi){st(!0);try{i()}finally{st(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:e},t}function hg(e,t,i,r){return e.baseState=i,_u(e,We,typeof r=="function"?r:Ma)}function mS(e,t,i,r,u){if(io(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(y){h.listeners.push(y)}};U.T!==null?i(!0):h.isTransition=!1,r(h),i=t.pending,i===null?(h.next=t.pending=h,mg(t,h)):(h.next=i.next,t.pending=i.next=h)}}function mg(e,t){var i=t.action,r=t.payload,u=e.state;if(t.isTransition){var h=U.T,y={};U.T=y;try{var w=i(u,r),N=U.S;N!==null&&N(y,w),pg(e,t,w)}catch(F){Hu(e,t,F)}finally{U.T=h}}else try{h=i(u,r),pg(e,t,h)}catch(F){Hu(e,t,F)}}function pg(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(r){gg(e,t,r)},function(r){return Hu(e,t,r)}):gg(e,t,i)}function gg(e,t,i){t.status="fulfilled",t.value=i,vg(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,mg(e,i)))}function Hu(e,t,i){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=i,vg(t),t=t.next;while(t!==r)}e.action=null}function vg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function bg(e,t){return t}function yg(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=ra;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}}Mi(r)}r=!1}r&&(t=i[0])}}return i=rn(),i.memoizedState=i.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bg,lastRenderedState:t},i.queue=r,i=_g.bind(null,Me,r),r.dispatch=i,r=Fu(!1),h=Gu.bind(null,Me,!1,r.queue),r=rn(),u={state:t,dispatch:null,action:e,pending:null},r.queue=u,i=mS.bind(null,Me,u,h,i),u.dispatch=i,r.memoizedState=e,[t,i,!1]}function xg(e){var t=yt();return jg(t,We,e)}function jg(e,t,i){if(t=_u(e,t,bg)[0],e=to(Ma)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Sr(t)}catch(y){throw y===gr?Qs:y}else r=t;t=yt();var u=t.queue,h=u.dispatch;return i!==t.memoizedState&&(Me.flags|=2048,gl(9,no(),pS.bind(null,u,i),null)),[r,h,e]}function pS(e,t){e.action=t}function Sg(e){var t=yt(),i=We;if(i!==null)return jg(t,i,e);yt(),t=t.memoizedState,i=yt();var r=i.queue.dispatch;return i.memoizedState=e,[t,r,!1]}function gl(e,t,i,r){return e={tag:e,create:i,deps:r,inst:t,next:null},t=Me.updateQueue,t===null&&(t=zu(),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 no(){return{destroy:void 0,resource:void 0}}function wg(){return yt().memoizedState}function ao(e,t,i,r){var u=rn();r=r===void 0?null:r,Me.flags|=e,u.memoizedState=gl(1|t,no(),i,r)}function wr(e,t,i,r){var u=yt();r=r===void 0?null:r;var h=u.memoizedState.inst;We!==null&&r!==null&&Au(r,We.memoizedState.deps)?u.memoizedState=gl(t,h,i,r):(Me.flags|=e,u.memoizedState=gl(1|t,h,i,r))}function Cg(e,t){ao(8390656,8,e,t)}function Eg(e,t){wr(2048,8,e,t)}function Dg(e,t){return wr(4,2,e,t)}function Tg(e,t){return wr(4,4,e,t)}function Rg(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 Ng(e,t,i){i=i!=null?i.concat([e]):null,wr(4,4,Rg.bind(null,t,e),i)}function Pu(){}function Mg(e,t){var i=yt();t=t===void 0?null:t;var r=i.memoizedState;return t!==null&&Au(t,r[1])?r[0]:(i.memoizedState=[e,t],e)}function Ag(e,t){var i=yt();t=t===void 0?null:t;var r=i.memoizedState;if(t!==null&&Au(t,r[1]))return r[0];if(r=e(),Oi){st(!0);try{e()}finally{st(!1)}}return i.memoizedState=[r,t],r}function ku(e,t,i){return i===void 0||(Qa&1073741824)!==0?e.memoizedState=t:(e.memoizedState=i,e=Ov(),Me.lanes|=e,ni|=e,i)}function $g(e,t,i,r){return gn(i,t)?i:hl.current!==null?(e=ku(e,i,r),gn(e,t)||(Nt=!0),e):(Qa&42)===0?(Nt=!0,e.memoizedState=i):(e=Ov(),Me.lanes|=e,ni|=e,t)}function Lg(e,t,i,r,u){var h=k.p;k.p=h!==0&&8>h?h:8;var y=U.T,w={};U.T=w,Gu(e,!1,t,i);try{var N=u(),F=U.S;if(F!==null&&F(w,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var X=dS(N,r);Cr(e,t,X,jn(e))}else Cr(e,t,r,jn(e))}catch(J){Cr(e,t,{then:function(){},status:"rejected",reason:J},jn())}finally{k.p=h,U.T=y}}function gS(){}function Iu(e,t,i,r){if(e.tag!==5)throw Error(s(476));var u=Og(e).queue;Lg(e,u,t,Y,i===null?gS:function(){return Ug(e),i(r)})}function Og(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:Y},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ug(e){var t=Og(e).next.queue;Cr(e,t,{},jn())}function Vu(){return Yt(Pr)}function zg(){return yt().memoizedState}function Bg(){return yt().memoizedState}function vS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=jn();e=Ya(i);var r=Xa(t,e,i);r!==null&&(Sn(r,t,i),br(r,t,i)),t={cache:ju()},e.payload=t;return}t=t.return}}function bS(e,t,i){var r=jn();i={lane:r,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null},io(e)?qg(t,i):(i=du(e,t,i,r),i!==null&&(Sn(i,e,r),Fg(i,t,r)))}function _g(e,t,i){var r=jn();Cr(e,t,i,r)}function Cr(e,t,i,r){var u={lane:r,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null};if(io(e))qg(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var y=t.lastRenderedState,w=h(y,i);if(u.hasEagerState=!0,u.eagerState=w,gn(w,y))return Hs(e,t,u,0),at===null&&Fs(),!1}catch{}finally{}if(i=du(e,t,u,r),i!==null)return Sn(i,e,r),Fg(i,t,r),!0}return!1}function Gu(e,t,i,r){if(r={lane:2,revertLane:Cd(),action:r,hasEagerState:!1,eagerState:null,next:null},io(e)){if(t)throw Error(s(479))}else t=du(e,i,r,2),t!==null&&Sn(t,e,2)}function io(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function qg(e,t){ml=Ws=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Fg(e,t,i){if((i&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,hn(e,i)}}var lo={readContext:Yt,use:eo,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},Hg={readContext:Yt,use:eo,useCallback:function(e,t){return rn().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:Cg,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ao(4194308,4,Rg.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ao(4194308,4,e,t)},useInsertionEffect:function(e,t){ao(4,2,e,t)},useMemo:function(e,t){var i=rn();t=t===void 0?null:t;var r=e();if(Oi){st(!0);try{e()}finally{st(!1)}}return i.memoizedState=[r,t],r},useReducer:function(e,t,i){var r=rn();if(i!==void 0){var u=i(t);if(Oi){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=bS.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=rn();return e={current:e},t.memoizedState=e},useState:function(e){e=Fu(e);var t=e.queue,i=_g.bind(null,Me,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Pu,useDeferredValue:function(e,t){var i=rn();return ku(i,e,t)},useTransition:function(){var e=Fu(!1);return e=Lg.bind(null,Me,e.queue,!0,!1),rn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var r=Me,u=rn();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||og(r,t,i)}u.memoizedState=i;var h={value:i,getSnapshot:t};return u.queue=h,Cg(ug.bind(null,r,h,e),[e]),r.flags|=2048,gl(9,no(),cg.bind(null,r,h,i,t),null),i},useId:function(){var e=rn(),t=at.identifierPrefix;if(He){var i=Ta,r=Da;i=(r&~(1<<32-Ve(r)-1)).toString(32)+i,t="«"+t+"R"+i,i=Js++,0<i&&(t+="H"+i.toString(32)),t+="»"}else i=fS++,t="«"+t+"r"+i.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Vu,useFormState:yg,useActionState:yg,useOptimistic:function(e){var t=rn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Gu.bind(null,Me,!0,i),i.dispatch=t,[e,t]},useMemoCache:Bu,useCacheRefresh:function(){return rn().memoizedState=vS.bind(null,Me)}},Pg={readContext:Yt,use:eo,useCallback:Mg,useContext:Yt,useEffect:Eg,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Tg,useMemo:Ag,useReducer:to,useRef:wg,useState:function(){return to(Ma)},useDebugValue:Pu,useDeferredValue:function(e,t){var i=yt();return $g(i,We.memoizedState,e,t)},useTransition:function(){var e=to(Ma)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Sr(e),t]},useSyncExternalStore:sg,useId:zg,useHostTransitionStatus:Vu,useFormState:xg,useActionState:xg,useOptimistic:function(e,t){var i=yt();return hg(i,We,e,t)},useMemoCache:Bu,useCacheRefresh:Bg},yS={readContext:Yt,use:eo,useCallback:Mg,useContext:Yt,useEffect:Eg,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Tg,useMemo:Ag,useReducer:qu,useRef:wg,useState:function(){return qu(Ma)},useDebugValue:Pu,useDeferredValue:function(e,t){var i=yt();return We===null?ku(i,e,t):$g(i,We.memoizedState,e,t)},useTransition:function(){var e=qu(Ma)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Sr(e),t]},useSyncExternalStore:sg,useId:zg,useHostTransitionStatus:Vu,useFormState:Sg,useActionState:Sg,useOptimistic:function(e,t){var i=yt();return We!==null?hg(i,We,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Bu,useCacheRefresh:Bg},vl=null,Er=0;function ro(e){var t=Er;return Er+=1,vl===null&&(vl=[]),Jp(vl,e,t)}function Dr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function so(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 kg(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=Ea(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 y(z){return e&&z.alternate===null&&(z.flags|=67108866),z}function w(z,$,_,K){return $===null||$.tag!==6?($=hu(_,z.mode,K),$.return=z,$):($=u($,_),$.return=z,$)}function N(z,$,_,K){var pe=_.type;return pe===D?X(z,$,_.props.children,K,_.key):$!==null&&($.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&kg(pe)===$.type)?($=u($,_.props),Dr($,_),$.return=z,$):($=ks(_.type,_.key,_.props,null,z.mode,K),Dr($,_),$.return=z,$)}function F(z,$,_,K){return $===null||$.tag!==4||$.stateNode.containerInfo!==_.containerInfo||$.stateNode.implementation!==_.implementation?($=mu(_,z.mode,K),$.return=z,$):($=u($,_.children||[]),$.return=z,$)}function X(z,$,_,K,pe){return $===null||$.tag!==7?($=Di(_,z.mode,K,pe),$.return=z,$):($=u($,_),$.return=z,$)}function J(z,$,_){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=hu(""+$,z.mode,_),$.return=z,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case x:return _=ks($.type,$.key,$.props,null,z.mode,_),Dr(_,$),_.return=z,_;case j:return $=mu($,z.mode,_),$.return=z,$;case O:var K=$._init;return $=K($._payload),J(z,$,_)}if(Z($)||se($))return $=Di($,z.mode,_,null),$.return=z,$;if(typeof $.then=="function")return J(z,ro($),_);if($.$$typeof===B)return J(z,Ys(z,$),_);so(z,$)}return null}function P(z,$,_,K){var pe=$!==null?$.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return pe!==null?null:w(z,$,""+_,K);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case x:return _.key===pe?N(z,$,_,K):null;case j:return _.key===pe?F(z,$,_,K):null;case O:return pe=_._init,_=pe(_._payload),P(z,$,_,K)}if(Z(_)||se(_))return pe!==null?null:X(z,$,_,K,null);if(typeof _.then=="function")return P(z,$,ro(_),K);if(_.$$typeof===B)return P(z,$,Ys(z,_),K);so(z,_)}return null}function I(z,$,_,K,pe){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return z=z.get(_)||null,w($,z,""+K,pe);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case x:return z=z.get(K.key===null?_:K.key)||null,N($,z,K,pe);case j:return z=z.get(K.key===null?_:K.key)||null,F($,z,K,pe);case O:var Ae=K._init;return K=Ae(K._payload),I(z,$,_,K,pe)}if(Z(K)||se(K))return z=z.get(_)||null,X($,z,K,pe,null);if(typeof K.then=="function")return I(z,$,_,ro(K),pe);if(K.$$typeof===B)return I(z,$,_,Ys($,K),pe);so($,K)}return null}function we(z,$,_,K){for(var pe=null,Ae=null,ve=$,xe=$=0,At=null;ve!==null&&xe<_.length;xe++){ve.index>xe?(At=ve,ve=null):At=ve.sibling;var Fe=P(z,ve,_[xe],K);if(Fe===null){ve===null&&(ve=At);break}e&&ve&&Fe.alternate===null&&t(z,ve),$=h(Fe,$,xe),Ae===null?pe=Fe:Ae.sibling=Fe,Ae=Fe,ve=At}if(xe===_.length)return i(z,ve),He&&Ri(z,xe),pe;if(ve===null){for(;xe<_.length;xe++)ve=J(z,_[xe],K),ve!==null&&($=h(ve,$,xe),Ae===null?pe=ve:Ae.sibling=ve,Ae=ve);return He&&Ri(z,xe),pe}for(ve=r(ve);xe<_.length;xe++)At=I(ve,z,xe,_[xe],K),At!==null&&(e&&At.alternate!==null&&ve.delete(At.key===null?xe:At.key),$=h(At,$,xe),Ae===null?pe=At:Ae.sibling=At,Ae=At);return e&&ve.forEach(function(di){return t(z,di)}),He&&Ri(z,xe),pe}function ye(z,$,_,K){if(_==null)throw Error(s(151));for(var pe=null,Ae=null,ve=$,xe=$=0,At=null,Fe=_.next();ve!==null&&!Fe.done;xe++,Fe=_.next()){ve.index>xe?(At=ve,ve=null):At=ve.sibling;var di=P(z,ve,Fe.value,K);if(di===null){ve===null&&(ve=At);break}e&&ve&&di.alternate===null&&t(z,ve),$=h(di,$,xe),Ae===null?pe=di:Ae.sibling=di,Ae=di,ve=At}if(Fe.done)return i(z,ve),He&&Ri(z,xe),pe;if(ve===null){for(;!Fe.done;xe++,Fe=_.next())Fe=J(z,Fe.value,K),Fe!==null&&($=h(Fe,$,xe),Ae===null?pe=Fe:Ae.sibling=Fe,Ae=Fe);return He&&Ri(z,xe),pe}for(ve=r(ve);!Fe.done;xe++,Fe=_.next())Fe=I(ve,z,xe,Fe.value,K),Fe!==null&&(e&&Fe.alternate!==null&&ve.delete(Fe.key===null?xe:Fe.key),$=h(Fe,$,xe),Ae===null?pe=Fe:Ae.sibling=Fe,Ae=Fe);return e&&ve.forEach(function(xw){return t(z,xw)}),He&&Ri(z,xe),pe}function et(z,$,_,K){if(typeof _=="object"&&_!==null&&_.type===D&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case x:e:{for(var pe=_.key;$!==null;){if($.key===pe){if(pe=_.type,pe===D){if($.tag===7){i(z,$.sibling),K=u($,_.props.children),K.return=z,z=K;break e}}else if($.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&kg(pe)===$.type){i(z,$.sibling),K=u($,_.props),Dr(K,_),K.return=z,z=K;break e}i(z,$);break}else t(z,$);$=$.sibling}_.type===D?(K=Di(_.props.children,z.mode,K,_.key),K.return=z,z=K):(K=ks(_.type,_.key,_.props,null,z.mode,K),Dr(K,_),K.return=z,z=K)}return y(z);case j:e:{for(pe=_.key;$!==null;){if($.key===pe)if($.tag===4&&$.stateNode.containerInfo===_.containerInfo&&$.stateNode.implementation===_.implementation){i(z,$.sibling),K=u($,_.children||[]),K.return=z,z=K;break e}else{i(z,$);break}else t(z,$);$=$.sibling}K=mu(_,z.mode,K),K.return=z,z=K}return y(z);case O:return pe=_._init,_=pe(_._payload),et(z,$,_,K)}if(Z(_))return we(z,$,_,K);if(se(_)){if(pe=se(_),typeof pe!="function")throw Error(s(150));return _=pe.call(_),ye(z,$,_,K)}if(typeof _.then=="function")return et(z,$,ro(_),K);if(_.$$typeof===B)return et(z,$,Ys(z,_),K);so(z,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,$!==null&&$.tag===6?(i(z,$.sibling),K=u($,_),K.return=z,z=K):(i(z,$),K=hu(_,z.mode,K),K.return=z,z=K),y(z)):i(z,$)}return function(z,$,_,K){try{Er=0;var pe=et(z,$,_,K);return vl=null,pe}catch(ve){if(ve===gr||ve===Qs)throw ve;var Ae=vn(29,ve,null,z.mode);return Ae.lanes=K,Ae.return=z,Ae}finally{}}}var bl=Ig(!0),Vg=Ig(!1),Un=ge(null),sa=null;function Ka(e){var t=e.alternate;ce(Ct,Ct.current&1),ce(Un,e),sa===null&&(t===null||hl.current!==null||t.memoizedState!==null)&&(sa=e)}function Gg(e){if(e.tag===22){if(ce(Ct,Ct.current),ce(Un,e),sa===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(sa=e)}}else Za()}function Za(){ce(Ct,Ct.current),ce(Un,Un.current)}function Aa(e){ie(Un),sa===e&&(sa=null),ie(Ct)}var Ct=ge(0);function oo(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==="$?"||zd(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 Yu(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 Xu={enqueueSetState:function(e,t,i){e=e._reactInternals;var r=jn(),u=Ya(r);u.payload=t,i!=null&&(u.callback=i),t=Xa(e,u,r),t!==null&&(Sn(t,e,r),br(t,e,r))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var r=jn(),u=Ya(r);u.tag=1,u.payload=t,i!=null&&(u.callback=i),t=Xa(e,u,r),t!==null&&(Sn(t,e,r),br(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=jn(),r=Ya(i);r.tag=2,t!=null&&(r.callback=t),t=Xa(e,r,i),t!==null&&(Sn(t,e,i),br(t,e,i))}};function Yg(e,t,i,r,u,h,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,h,y):t.prototype&&t.prototype.isPureReactComponent?!or(i,r)||!or(u,h):!0}function Xg(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&&Xu.enqueueReplaceState(t,t.state,null)}function Ui(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 co=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 Qg(e){co(e)}function Kg(e){console.error(e)}function Zg(e){co(e)}function uo(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Wg(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 Qu(e,t,i){return i=Ya(i),i.tag=3,i.payload={element:null},i.callback=function(){uo(e,t)},i}function Jg(e){return e=Ya(e),e.tag=3,e}function ev(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(){Wg(t,i,r)}}var y=i.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Wg(t,i,r),typeof u!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var w=r.stack;this.componentDidCatch(r.value,{componentStack:w!==null?w:""})})}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&&hr(t,i,u,!0),i=Un.current,i!==null){switch(i.tag){case 13:return sa===null?yd():i.alternate===null&&mt===0&&(mt=3),i.flags&=-257,i.flags|=65536,i.lanes=u,r===Cu?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([r]):t.add(r),jd(e,r,u)),!1;case 22:return i.flags|=65536,r===Cu?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)),jd(e,r,u)),!1}throw Error(s(435,i.tag))}return jd(e,r,u),yd(),!1}if(He)return t=Un.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,r!==vu&&(e=Error(s(422),{cause:r}),fr(An(e,i)))):(r!==vu&&(t=Error(s(423),{cause:r}),fr(An(t,i))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,r=An(r,i),u=Qu(e.stateNode,r,u),Tu(e,u),mt!==4&&(mt=2)),!1;var h=Error(s(520),{cause:r});if(h=An(h,i),Lr===null?Lr=[h]:Lr.push(h),mt!==4&&(mt=2),t===null)return!0;r=An(r,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=u&-u,i.lanes|=e,e=Qu(i.stateNode,r,e),Tu(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"&&(ai===null||!ai.has(h))))return i.flags|=65536,u&=-u,i.lanes|=u,u=Jg(u),ev(u,e,i,r),Tu(i,u),!1}i=i.return}while(i!==null);return!1}var tv=Error(s(461)),Nt=!1;function Bt(e,t,i,r){t.child=e===null?Vg(t,null,i,r):bl(t,e.child,i,r)}function nv(e,t,i,r,u){i=i.render;var h=t.ref;if("ref"in r){var y={};for(var w in r)w!=="ref"&&(y[w]=r[w])}else y=r;return $i(t),r=$u(e,t,i,y,h,u),w=Lu(),e!==null&&!Nt?(Ou(e,t,u),$a(e,t,u)):(He&&w&&pu(t),t.flags|=1,Bt(e,t,r,u),t.child)}function av(e,t,i,r,u){if(e===null){var h=i.type;return typeof h=="function"&&!fu(h)&&h.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=h,iv(e,t,h,r,u)):(e=ks(i.type,null,r,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!ad(e,u)){var y=h.memoizedProps;if(i=i.compare,i=i!==null?i:or,i(y,r)&&e.ref===t.ref)return $a(e,t,u)}return t.flags|=1,e=Ea(h,r),e.ref=t.ref,e.return=t,t.child=e}function iv(e,t,i,r,u){if(e!==null){var h=e.memoizedProps;if(or(h,r)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=r=h,ad(e,u))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,$a(e,t,u)}return Ku(e,t,i,r,u)}function lv(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 rv(e,t,r,i)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xs(t,h!==null?h.cachePool:null),h!==null?ig(t,h):Nu(),Gg(t);else return t.lanes=t.childLanes=536870912,rv(e,t,h!==null?h.baseLanes|i:i,i)}else h!==null?(Xs(t,h.cachePool),ig(t,h),Za(),t.memoizedState=null):(e!==null&&Xs(t,null),Nu(),Za());return Bt(e,t,u,i),t.child}function rv(e,t,i,r){var u=wu();return u=u===null?null:{parent:wt._currentValue,pool:u},t.memoizedState={baseLanes:i,cachePool:u},e!==null&&Xs(t,null),Nu(),Gg(t),e!==null&&hr(e,t,r,!0),null}function fo(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 Ku(e,t,i,r,u){return $i(t),i=$u(e,t,i,r,void 0,u),r=Lu(),e!==null&&!Nt?(Ou(e,t,u),$a(e,t,u)):(He&&r&&pu(t),t.flags|=1,Bt(e,t,i,u),t.child)}function sv(e,t,i,r,u,h){return $i(t),t.updateQueue=null,i=rg(t,r,i,u),lg(e),r=Lu(),e!==null&&!Nt?(Ou(e,t,h),$a(e,t,h)):(He&&r&&pu(t),t.flags|=1,Bt(e,t,i,h),t.child)}function ov(e,t,i,r,u){if($i(t),t.stateNode===null){var h=ol,y=i.contextType;typeof y=="object"&&y!==null&&(h=Yt(y)),h=new i(r,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Xu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=r,h.state=t.memoizedState,h.refs={},Eu(t),y=i.contextType,h.context=typeof y=="object"&&y!==null?Yt(y):ol,h.state=t.memoizedState,y=i.getDerivedStateFromProps,typeof y=="function"&&(Yu(t,i,y,r),h.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(y=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),y!==h.state&&Xu.enqueueReplaceState(h,h.state,null),xr(t,r,h,u),yr(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){h=t.stateNode;var w=t.memoizedProps,N=Ui(i,w);h.props=N;var F=h.context,X=i.contextType;y=ol,typeof X=="object"&&X!==null&&(y=Yt(X));var J=i.getDerivedStateFromProps;X=typeof J=="function"||typeof h.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,X||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(w||F!==y)&&Xg(t,h,r,y),Ga=!1;var P=t.memoizedState;h.state=P,xr(t,r,h,u),yr(),F=t.memoizedState,w||P!==F||Ga?(typeof J=="function"&&(Yu(t,i,J,r),F=t.memoizedState),(N=Ga||Yg(t,i,N,r,P,F,y))?(X||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=F),h.props=r,h.state=F,h.context=y,r=N):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{h=t.stateNode,Du(e,t),y=t.memoizedProps,X=Ui(i,y),h.props=X,J=t.pendingProps,P=h.context,F=i.contextType,N=ol,typeof F=="object"&&F!==null&&(N=Yt(F)),w=i.getDerivedStateFromProps,(F=typeof w=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==J||P!==N)&&Xg(t,h,r,N),Ga=!1,P=t.memoizedState,h.state=P,xr(t,r,h,u),yr();var I=t.memoizedState;y!==J||P!==I||Ga||e!==null&&e.dependencies!==null&&Gs(e.dependencies)?(typeof w=="function"&&(Yu(t,i,w,r),I=t.memoizedState),(X=Ga||Yg(t,i,X,r,P,I,N)||e!==null&&e.dependencies!==null&&Gs(e.dependencies))?(F||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(r,I,N),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(r,I,N)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=I),h.props=r,h.state=I,h.context=N,r=X):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),r=!1)}return h=r,fo(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=bl(t,e.child,null,u),t.child=bl(t,null,i,u)):Bt(e,t,i,u),t.memoizedState=h.state,e=t.child):e=$a(e,t,u),e}function cv(e,t,i,r){return dr(),t.flags|=256,Bt(e,t,i,r),t.child}var Zu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wu(e){return{baseLanes:e,cachePool:Kp()}}function Ju(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=zn),e}function uv(e,t,i){var r=t.pendingProps,u=!1,h=(t.flags&128)!==0,y;if((y=h)||(y=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),y&&(u=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(u?Ka(t):Za(),He){var w=ht,N;if(N=w){e:{for(N=w,w=ra;N.nodeType!==8;){if(!w){w=null;break e}if(N=In(N.nextSibling),N===null){w=null;break e}}w=N}w!==null?(t.memoizedState={dehydrated:w,treeContext:Ti!==null?{id:Da,overflow:Ta}:null,retryLane:536870912,hydrationErrors:null},N=vn(18,null,null,0),N.stateNode=w,N.return=t,t.child=N,Wt=t,ht=null,N=!0):N=!1}N||Mi(t)}if(w=t.memoizedState,w!==null&&(w=w.dehydrated,w!==null))return zd(w)?t.lanes=32:t.lanes=536870912,null;Aa(t)}return w=r.children,r=r.fallback,u?(Za(),u=t.mode,w=ho({mode:"hidden",children:w},u),r=Di(r,u,i,null),w.return=t,r.return=t,w.sibling=r,t.child=w,u=t.child,u.memoizedState=Wu(i),u.childLanes=Ju(e,y,i),t.memoizedState=Zu,r):(Ka(t),ed(t,w))}if(N=e.memoizedState,N!==null&&(w=N.dehydrated,w!==null)){if(h)t.flags&256?(Ka(t),t.flags&=-257,t=td(e,t,i)):t.memoizedState!==null?(Za(),t.child=e.child,t.flags|=128,t=null):(Za(),u=r.fallback,w=t.mode,r=ho({mode:"visible",children:r.children},w),u=Di(u,w,i,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,bl(t,e.child,null,i),r=t.child,r.memoizedState=Wu(i),r.childLanes=Ju(e,y,i),t.memoizedState=Zu,t=u);else if(Ka(t),zd(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var F=y.dgst;y=F,r=Error(s(419)),r.stack="",r.digest=y,fr({value:r,source:null,stack:null}),t=td(e,t,i)}else if(Nt||hr(e,t,i,!1),y=(i&e.childLanes)!==0,Nt||y){if(y=at,y!==null&&(r=i&-i,r=(r&42)!==0?1:St(r),r=(r&(y.suspendedLanes|i))!==0?0:r,r!==0&&r!==N.retryLane))throw N.retryLane=r,sl(e,r),Sn(y,e,r),tv;w.data==="$?"||yd(),t=td(e,t,i)}else w.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,ht=In(w.nextSibling),Wt=t,He=!0,Ni=null,ra=!1,e!==null&&(Ln[On++]=Da,Ln[On++]=Ta,Ln[On++]=Ti,Da=e.id,Ta=e.overflow,Ti=t),t=ed(t,r.children),t.flags|=4096);return t}return u?(Za(),u=r.fallback,w=t.mode,N=e.child,F=N.sibling,r=Ea(N,{mode:"hidden",children:r.children}),r.subtreeFlags=N.subtreeFlags&65011712,F!==null?u=Ea(F,u):(u=Di(u,w,i,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,r=u,u=t.child,w=e.child.memoizedState,w===null?w=Wu(i):(N=w.cachePool,N!==null?(F=wt._currentValue,N=N.parent!==F?{parent:F,pool:F}:N):N=Kp(),w={baseLanes:w.baseLanes|i,cachePool:N}),u.memoizedState=w,u.childLanes=Ju(e,y,i),t.memoizedState=Zu,r):(Ka(t),i=e.child,e=i.sibling,i=Ea(i,{mode:"visible",children:r.children}),i.return=t,i.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=i,t.memoizedState=null,i)}function ed(e,t){return t=ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ho(e,t){return e=vn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function td(e,t,i){return bl(t,e.child,null,i),e=ed(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dv(e,t,i){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),yu(e.return,t,i)}function nd(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 fv(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&&dv(e,i,t);else if(e.tag===19)dv(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(ce(Ct,r),u){case"forwards":for(i=t.child,u=null;i!==null;)e=i.alternate,e!==null&&oo(e)===null&&(u=i),i=i.sibling;i=u,i===null?(u=t.child,t.child=null):(u=i.sibling,i.sibling=null),nd(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&&oo(e)===null){t.child=u;break}e=u.sibling,u.sibling=i,i=u,u=e}nd(t,!0,i,null,h);break;case"together":nd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $a(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ni|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(hr(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=Ea(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ea(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function ad(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Gs(e)))}function jS(e,t,i){switch(t.tag){case 3:Dt(t,t.stateNode.containerInfo),Va(t,wt,e.memoizedState.cache),dr();break;case 27:case 5:Be(t);break;case 4:Dt(t,t.stateNode.containerInfo);break;case 10:Va(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Ka(t),t.flags|=128,null):(i&t.child.childLanes)!==0?uv(e,t,i):(Ka(t),e=$a(e,t,i),e!==null?e.sibling:null);Ka(t);break;case 19:var u=(e.flags&128)!==0;if(r=(i&t.childLanes)!==0,r||(hr(e,t,i,!1),r=(i&t.childLanes)!==0),u){if(r)return fv(e,t,i);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ce(Ct,Ct.current),r)break;return null;case 22:case 23:return t.lanes=0,lv(e,t,i);case 24:Va(t,wt,e.memoizedState.cache)}return $a(e,t,i)}function hv(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!ad(e,i)&&(t.flags&128)===0)return Nt=!1,jS(e,t,i);Nt=(e.flags&131072)!==0}else Nt=!1,He&&(t.flags&1048576)!==0&&kp(t,Vs,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")fu(r)?(e=Ui(r,e),t.tag=1,t=ov(null,t,r,e,i)):(t.tag=0,t=Ku(null,t,r,e,i));else{if(r!=null){if(u=r.$$typeof,u===q){t.tag=11,t=nv(null,t,r,e,i);break e}else if(u===T){t.tag=14,t=av(null,t,r,e,i);break e}}throw t=V(r)||r,Error(s(306,t,""))}}return t;case 0:return Ku(e,t,t.type,t.pendingProps,i);case 1:return r=t.type,u=Ui(r,t.pendingProps),ov(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,Du(e,t),xr(t,r,null,i);var y=t.memoizedState;if(r=y.cache,Va(t,wt,r),r!==h.cache&&xu(t,[wt],i,!0),yr(),r=y.element,h.isDehydrated)if(h={element:r,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=cv(e,t,r,i);break e}else if(r!==u){u=An(Error(s(424)),t),fr(u),t=cv(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,Ni=null,ra=!0,i=Vg(t,null,r,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(dr(),r===u){t=$a(e,t,i);break e}Bt(e,t,r,i)}t=t.child}return t;case 26:return fo(e,t),e===null?(i=v0(t.type,null,t.pendingProps,null))?t.memoizedState=i:He||(i=t.type,e=t.pendingProps,r=To(Ue.current).createElement(i),r[M]=t,r[L]=e,qt(r,i,e),Oe(r),t.stateNode=r):t.memoizedState=v0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&He&&(r=t.stateNode=m0(t.type,t.pendingProps,Ue.current),Wt=t,ra=!0,u=ht,ri(t.type)?(Bd=u,ht=In(r.firstChild)):ht=u),Bt(e,t,t.pendingProps.children,i),fo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((u=r=ht)&&(r=QS(r,t.type,t.pendingProps,ra),r!==null?(t.stateNode=r,Wt=t,ht=In(r.firstChild),ra=!1,u=!0):u=!1),u||Mi(t)),Be(t),u=t.type,h=t.pendingProps,y=e!==null?e.memoizedProps:null,r=h.children,Ld(u,h)?r=null:y!==null&&Ld(u,y)&&(t.flags|=32),t.memoizedState!==null&&(u=$u(e,t,hS,null,null,i),Pr._currentValue=u),fo(e,t),Bt(e,t,r,i),t.child;case 6:return e===null&&He&&((e=i=ht)&&(i=KS(i,t.pendingProps,ra),i!==null?(t.stateNode=i,Wt=t,ht=null,e=!0):e=!1),e||Mi(t)),null;case 13:return uv(e,t,i);case 4:return Dt(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bl(t,null,r,i):Bt(e,t,r,i),t.child;case 11:return nv(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,Va(t,t.type,r.value),Bt(e,t,r.children,i),t.child;case 9:return u=t.type._context,r=t.pendingProps.children,$i(t),u=Yt(u),r=r(u),t.flags|=1,Bt(e,t,r,i),t.child;case 14:return av(e,t,t.type,t.pendingProps,i);case 15:return iv(e,t,t.type,t.pendingProps,i);case 19:return fv(e,t,i);case 31:return r=t.pendingProps,i=t.mode,r={mode:r.mode,children:r.children},e===null?(i=ho(r,i),i.ref=t.ref,t.child=i,i.return=t,t=i):(i=Ea(e.child,r),i.ref=t.ref,t.child=i,i.return=t,t=i),t;case 22:return lv(e,t,i);case 24:return $i(t),r=Yt(wt),e===null?(u=wu(),u===null&&(u=at,h=ju(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=i),u=h),t.memoizedState={parent:r,cache:u},Eu(t),Va(t,wt,u)):((e.lanes&i)!==0&&(Du(e,t),xr(t,null,null,i),yr()),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),Va(t,wt,r)):(r=h.cache,Va(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 La(e){e.flags|=4}function mv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!S0(t)){if(t=Un.current,t!==null&&((qe&4194048)===qe?sa!==null:(qe&62914560)!==qe&&(qe&536870912)===0||t!==sa))throw vr=Cu,Zp;e.flags|=8192}}function mo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ji():536870912,e.lanes|=t,Sl|=t)}function Tr(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 SS(e,t,i){var r=t.pendingProps;switch(gu(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),Na(wt),Tt(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ur(t)?La(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Gp())),ut(t),null;case 26:return i=t.memoizedState,e===null?(La(t),i!==null?(ut(t),mv(t,i)):(ut(t),t.flags&=-16777217)):i?i!==e.memoizedState?(La(t),ut(t),mv(t,i)):(ut(t),t.flags&=-16777217):(e.memoizedProps!==r&&La(t),ut(t),t.flags&=-16777217),null;case 27:Dn(t),i=Ue.current;var u=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==r&&La(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return ut(t),null}e=Se.current,ur(t)?Ip(t):(e=m0(u,r,i),t.stateNode=e,La(t))}return ut(t),null;case 5:if(Dn(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&La(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return ut(t),null}if(e=Se.current,ur(t))Ip(t);else{switch(u=To(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&&La(t)}}return ut(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&La(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(s(166));if(e=Ue.current,ur(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||s0(e.nodeValue,i)),e||Mi(t)}else e=To(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=ur(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 dr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),u=!1}else u=Gp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Aa(t),t):(Aa(t),null)}if(Aa(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),mo(t,t.updateQueue),ut(t),null;case 4:return Tt(),e===null&&Rd(t.stateNode.containerInfo),ut(t),null;case 10:return Na(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)Tr(u,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=oo(e),h!==null){for(t.flags|=128,Tr(u,!1),e=h.updateQueue,t.updateQueue=e,mo(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Pp(i,e),i=i.sibling;return ce(Ct,Ct.current&1|2),t.child}e=e.sibling}u.tail!==null&&Xt()>vo&&(t.flags|=128,r=!0,Tr(u,!1),t.lanes=4194304)}else{if(!r)if(e=oo(h),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,mo(t,e),Tr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!h.alternate&&!He)return ut(t),null}else 2*Xt()-u.renderingStartTime>vo&&i!==536870912&&(t.flags|=128,r=!0,Tr(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,ce(Ct,r?e&1|2:e&1),t):(ut(t),null);case 22:case 23:return Aa(t),Mu(),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&&mo(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(Li),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Na(wt),ut(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function wS(e,t){switch(gu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Na(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 Dn(t),null;case 13:if(Aa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));dr()}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 Na(t.type),null;case 22:case 23:return Aa(t),Mu(),e!==null&&ie(Li),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Na(wt),null;case 25:return null;default:return null}}function pv(e,t){switch(gu(t),t.tag){case 3:Na(wt),Tt();break;case 26:case 27:case 5:Dn(t);break;case 4:Tt();break;case 13:Aa(t);break;case 19:ie(Ct);break;case 10:Na(t.type);break;case 22:case 23:Aa(t),Mu(),e!==null&&ie(Li);break;case 24:Na(wt)}}function Rr(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,y=i.inst;r=h(),y.destroy=r}i=i.next}while(i!==u)}}catch(w){tt(t,t.return,w)}}function Wa(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 y=r.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,u=t;var N=i,F=w;try{F()}catch(X){tt(u,N,X)}}}r=r.next}while(r!==h)}}catch(X){tt(t,t.return,X)}}function gv(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{ag(t,i)}catch(r){tt(e,e.return,r)}}}function vv(e,t,i){i.props=Ui(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(r){tt(e,t,r)}}function Nr(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 oa(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 bv(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 id(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 yv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ri(e.type)||e.tag===4}function ld(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yv(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&&ri(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 rd(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=Do));else if(r!==4&&(r===27&&ri(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(rd(e,t,i),e=e.sibling;e!==null;)rd(e,t,i),e=e.sibling}function po(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&&ri(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(po(e,t,i),e=e.sibling;e!==null;)po(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 Oa=!1,gt=!1,sd=!1,jv=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function CS(e,t){if(e=e.containerInfo,Ad=Lo,e=$p(e),lu(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 y=0,w=-1,N=-1,F=0,X=0,J=e,P=null;t:for(;;){for(var I;J!==i||u!==0&&J.nodeType!==3||(w=y+u),J!==h||r!==0&&J.nodeType!==3||(N=y+r),J.nodeType===3&&(y+=J.nodeValue.length),(I=J.firstChild)!==null;)P=J,J=I;for(;;){if(J===e)break t;if(P===i&&++F===u&&(w=y),P===h&&++X===r&&(N=y),(I=J.nextSibling)!==null)break;J=P,P=J.parentNode}J=I}i=w===-1||N===-1?null:{start:w,end:N}}else i=null}i=i||{start:0,end:0}}else i=null;for($d={focusedElem:e,selectionRange:i},Lo=!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 we=Ui(i.type,u,i.elementType===i.type);e=r.getSnapshotBeforeUpdate(we,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)Ud(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ud(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 Sv(e,t,i){var r=i.flags;switch(i.tag){case 0:case 11:case 15:Ja(e,i),r&4&&Rr(5,i);break;case 1:if(Ja(e,i),r&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(y){tt(i,i.return,y)}else{var u=Ui(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){tt(i,i.return,y)}}r&64&&gv(i),r&512&&Nr(i,i.return);break;case 3:if(Ja(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{ag(e,t)}catch(y){tt(i,i.return,y)}}break;case 27:t===null&&r&4&&xv(i);case 26:case 5:Ja(e,i),t===null&&r&4&&bv(i),r&512&&Nr(i,i.return);break;case 12:Ja(e,i);break;case 13:Ja(e,i),r&4&&Ev(e,i),r&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=LS.bind(null,i),ZS(e,i))));break;case 22:if(r=i.memoizedState!==null||Oa,!r){t=t!==null&&t.memoizedState!==null||gt,u=Oa;var h=gt;Oa=r,(gt=t)&&!h?ei(e,i,(i.subtreeFlags&8772)!==0):Ja(e,i),Oa=u,gt=h}break;case 30:break;default:Ja(e,i)}}function wv(e){var t=e.alternate;t!==null&&(e.alternate=null,wv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&he(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,sn=!1;function Ua(e,t,i){for(i=i.child;i!==null;)Cv(e,t,i),i=i.sibling}function Cv(e,t,i){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(ta,i)}catch{}switch(i.tag){case 26:gt||oa(i,t),Ua(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:gt||oa(i,t);var r=ot,u=sn;ri(i.type)&&(ot=i.stateNode,sn=!1),Ua(e,t,i),_r(i.stateNode),ot=r,sn=u;break;case 5:gt||oa(i,t);case 6:if(r=ot,u=sn,ot=null,Ua(e,t,i),ot=r,sn=u,ot!==null)if(sn)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&&(sn?(e=ot,f0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Gr(e)):f0(ot,i.stateNode));break;case 4:r=ot,u=sn,ot=i.stateNode.containerInfo,sn=!0,Ua(e,t,i),ot=r,sn=u;break;case 0:case 11:case 14:case 15:gt||Wa(2,i,t),gt||Wa(4,i,t),Ua(e,t,i);break;case 1:gt||(oa(i,t),r=i.stateNode,typeof r.componentWillUnmount=="function"&&vv(i,t,r)),Ua(e,t,i);break;case 21:Ua(e,t,i);break;case 22:gt=(r=gt)||i.memoizedState!==null,Ua(e,t,i),gt=r;break;default:Ua(e,t,i)}}function Ev(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gr(e)}catch(i){tt(t,t.return,i)}}function ES(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new jv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new jv),t;default:throw Error(s(435,e.tag))}}function od(e,t){var i=ES(e);t.forEach(function(r){var u=OS.bind(null,e,r);i.has(r)||(i.add(r),r.then(u,u))})}function bn(e,t){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var u=i[r],h=e,y=t,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(ri(w.type)){ot=w.stateNode,sn=!1;break e}break;case 5:ot=w.stateNode,sn=!1;break e;case 3:case 4:ot=w.stateNode.containerInfo,sn=!0;break e}w=w.return}if(ot===null)throw Error(s(160));Cv(h,y,u),ot=null,sn=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Dv(t,e),t=t.sibling}var kn=null;function Dv(e,t){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bn(t,e),yn(e),r&4&&(Wa(3,e,e.return),Rr(3,e),Wa(5,e,e.return));break;case 1:bn(t,e),yn(e),r&512&&(gt||i===null||oa(i,i.return)),r&64&&Oa&&(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=kn;if(bn(t,e),yn(e),r&512&&(gt||i===null||oa(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[oe]||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 y=x0("link","href",u).get(r+(i.href||""));if(y){for(var w=0;w<y.length;w++)if(h=y[w],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)){y.splice(w,1);break t}}h=u.createElement(r),qt(h,r,i),u.head.appendChild(h);break;case"meta":if(y=x0("meta","content",u).get(r+(i.content||""))){for(w=0;w<y.length;w++)if(h=y[w],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)){y.splice(w,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 j0(u,e.type,e.stateNode);else e.stateNode=y0(u,r,e.memoizedProps);else h!==r?(h===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):h.count--,r===null?j0(u,e.type,e.stateNode):y0(u,r,e.memoizedProps)):r===null&&e.stateNode!==null&&id(e,e.memoizedProps,i.memoizedProps)}break;case 27:bn(t,e),yn(e),r&512&&(gt||i===null||oa(i,i.return)),i!==null&&r&4&&id(e,e.memoizedProps,i.memoizedProps);break;case 5:if(bn(t,e),yn(e),r&512&&(gt||i===null||oa(i,i.return)),e.flags&32){u=e.stateNode;try{el(u,"")}catch(I){tt(e,e.return,I)}}r&4&&e.stateNode!=null&&(u=e.memoizedProps,id(e,u,i!==null?i.memoizedProps:u)),r&1024&&(sd=!0);break;case 6:if(bn(t,e),yn(e),r&4){if(e.stateNode===null)throw Error(s(162));r=e.memoizedProps,i=e.stateNode;try{i.nodeValue=r}catch(I){tt(e,e.return,I)}}break;case 3:if(Mo=null,u=kn,kn=Ro(t.containerInfo),bn(t,e),kn=u,yn(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{Gr(t.containerInfo)}catch(I){tt(e,e.return,I)}sd&&(sd=!1,Tv(e));break;case 4:r=kn,kn=Ro(e.stateNode.containerInfo),bn(t,e),yn(e),kn=r;break;case 12:bn(t,e),yn(e);break;case 13:bn(t,e),yn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(md=Xt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,od(e,r)));break;case 22:u=e.memoizedState!==null;var N=i!==null&&i.memoizedState!==null,F=Oa,X=gt;if(Oa=F||u,gt=X||N,bn(t,e),gt=X,Oa=F,yn(e),r&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(i===null||N||Oa||gt||zi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){N=i=t;try{if(h=N.stateNode,u)y=h.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{w=N.stateNode;var J=N.memoizedProps.style,P=J!=null&&J.hasOwnProperty("display")?J.display:null;w.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(I){tt(N,N.return,I)}}}else if(t.tag===6){if(i===null){N=t;try{N.stateNode.nodeValue=u?"":N.memoizedProps}catch(I){tt(N,N.return,I)}}}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,od(e,i))));break;case 19:bn(t,e),yn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,od(e,r)));break;case 30:break;case 21:break;default:bn(t,e),yn(e)}}function yn(e){var t=e.flags;if(t&2){try{for(var i,r=e.return;r!==null;){if(yv(r)){i=r;break}r=r.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var u=i.stateNode,h=ld(e);po(e,h,u);break;case 5:var y=i.stateNode;i.flags&32&&(el(y,""),i.flags&=-33);var w=ld(e);po(e,w,y);break;case 3:case 4:var N=i.stateNode.containerInfo,F=ld(e);rd(e,F,N);break;default:throw Error(s(161))}}catch(X){tt(e,e.return,X)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Sv(e,t.alternate,t),t=t.sibling}function zi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wa(4,t,t.return),zi(t);break;case 1:oa(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&vv(t,t.return,i),zi(t);break;case 27:_r(t.stateNode);case 26:case 5:oa(t,t.return),zi(t);break;case 22:t.memoizedState===null&&zi(t);break;case 30:zi(t);break;default:zi(t)}e=e.sibling}}function ei(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,u=e,h=t,y=h.flags;switch(h.tag){case 0:case 11:case 15:ei(u,h,i),Rr(4,h);break;case 1:if(ei(u,h,i),r=h,u=r.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(F){tt(r,r.return,F)}if(r=h,u=r.updateQueue,u!==null){var w=r.stateNode;try{var N=u.shared.hiddenCallbacks;if(N!==null)for(u.shared.hiddenCallbacks=null,u=0;u<N.length;u++)ng(N[u],w)}catch(F){tt(r,r.return,F)}}i&&y&64&&gv(h),Nr(h,h.return);break;case 27:xv(h);case 26:case 5:ei(u,h,i),i&&r===null&&y&4&&bv(h),Nr(h,h.return);break;case 12:ei(u,h,i);break;case 13:ei(u,h,i),i&&y&4&&Ev(u,h);break;case 22:h.memoizedState===null&&ei(u,h,i),Nr(h,h.return);break;case 30:break;default:ei(u,h,i)}t=t.sibling}}function cd(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&&mr(i))}function ud(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e))}function ca(e,t,i,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rv(e,t,i,r),t=t.sibling}function Rv(e,t,i,r){var u=t.flags;switch(t.tag){case 0:case 11:case 15:ca(e,t,i,r),u&2048&&Rr(9,t);break;case 1:ca(e,t,i,r);break;case 3:ca(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&&mr(e)));break;case 12:if(u&2048){ca(e,t,i,r),e=t.stateNode;try{var h=t.memoizedProps,y=h.id,w=h.onPostCommit;typeof w=="function"&&w(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){tt(t,t.return,N)}}else ca(e,t,i,r);break;case 13:ca(e,t,i,r);break;case 23:break;case 22:h=t.stateNode,y=t.alternate,t.memoizedState!==null?h._visibility&2?ca(e,t,i,r):Mr(e,t):h._visibility&2?ca(e,t,i,r):(h._visibility|=2,yl(e,t,i,r,(t.subtreeFlags&10256)!==0)),u&2048&&cd(y,t);break;case 24:ca(e,t,i,r),u&2048&&ud(t.alternate,t);break;default:ca(e,t,i,r)}}function yl(e,t,i,r,u){for(u=u&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var h=e,y=t,w=i,N=r,F=y.flags;switch(y.tag){case 0:case 11:case 15:yl(h,y,w,N,u),Rr(8,y);break;case 23:break;case 22:var X=y.stateNode;y.memoizedState!==null?X._visibility&2?yl(h,y,w,N,u):Mr(h,y):(X._visibility|=2,yl(h,y,w,N,u)),u&&F&2048&&cd(y.alternate,y);break;case 24:yl(h,y,w,N,u),u&&F&2048&&ud(y.alternate,y);break;default:yl(h,y,w,N,u)}t=t.sibling}}function Mr(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:Mr(i,r),u&2048&&cd(r.alternate,r);break;case 24:Mr(i,r),u&2048&&ud(r.alternate,r);break;default:Mr(i,r)}t=t.sibling}}var Ar=8192;function xl(e){if(e.subtreeFlags&Ar)for(e=e.child;e!==null;)Nv(e),e=e.sibling}function Nv(e){switch(e.tag){case 26:xl(e),e.flags&Ar&&e.memoizedState!==null&&uw(kn,e.memoizedState,e.memoizedProps);break;case 5:xl(e);break;case 3:case 4:var t=kn;kn=Ro(e.stateNode.containerInfo),xl(e),kn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Ar,Ar=16777216,xl(e),Ar=t):xl(e));break;default:xl(e)}}function Mv(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 $r(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,$v(r,e)}Mv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Av(e),e=e.sibling}function Av(e){switch(e.tag){case 0:case 11:case 15:$r(e),e.flags&2048&&Wa(9,e,e.return);break;case 3:$r(e);break;case 12:$r(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,go(e)):$r(e);break;default:$r(e)}}function go(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,$v(r,e)}Mv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wa(8,t,t.return),go(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,go(t));break;default:go(t)}e=e.sibling}}function $v(e,t){for(;Mt!==null;){var i=Mt;switch(i.tag){case 0:case 11:case 15:Wa(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:mr(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(wv(r),r===i){Mt=null;break e}if(u!==null){u.return=h,Mt=u;break e}Mt=h}}}var DS={getCacheForType:function(e){var t=Yt(wt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i}},TS=typeof WeakMap=="function"?WeakMap:Map,Xe=0,at=null,$e=null,qe=0,Qe=0,xn=null,ti=!1,jl=!1,dd=!1,za=0,mt=0,ni=0,Bi=0,fd=0,zn=0,Sl=0,Lr=null,on=null,hd=!1,md=0,vo=1/0,bo=null,ai=null,_t=0,ii=null,wl=null,Cl=0,pd=0,gd=null,Lv=null,Or=0,vd=null;function jn(){if((Xe&2)!==0&&qe!==0)return qe&-qe;if(U.T!==null){var e=dl;return e!==0?e:Cd()}return Rt()}function Ov(){zn===0&&(zn=(qe&536870912)===0||He?xa():536870912);var e=Un.current;return e!==null&&(e.flags|=32),zn}function Sn(e,t,i){(e===at&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(El(e,0),li(e,qe,zn,!1)),nt(e,i),((Xe&2)===0||e!==at)&&(e===at&&((Xe&2)===0&&(Bi|=i),mt===4&&li(e,qe,zn,!1)),ua(e))}function Uv(e,t,i){if((Xe&6)!==0)throw Error(s(327));var r=!i&&(t&124)===0&&(t&e.expiredLanes)===0||ya(e,t),u=r?MS(e,t):xd(e,t,!0),h=r;do{if(u===0){jl&&!r&&li(e,t,0,!1);break}else{if(i=e.current.alternate,h&&!RS(i)){u=xd(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var w=e;u=Lr;var N=w.current.memoizedState.isDehydrated;if(N&&(El(w,y).flags|=256),y=xd(w,y,!1),y!==2){if(dd&&!N){w.errorRecoveryDisabledLanes|=h,Bi|=h,u=4;break e}h=on,on=u,h!==null&&(on===null?on=h:on.push.apply(on,h))}u=y}if(h=!1,u!==2)continue}}if(u===1){El(e,0),li(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:li(r,t,zn,!ti);break e;case 2:on=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(u=md+300-Xt(),10<u)){if(li(r,t,zn,!ti),na(r,0,!0)!==0)break e;r.timeoutHandle=u0(zv.bind(null,r,i,on,bo,hd,t,zn,Bi,Sl,ti,h,2,-0,0),u);break e}zv(r,i,on,bo,hd,t,zn,Bi,Sl,ti,h,0,-0,0)}}break}while(!0);ua(e)}function zv(e,t,i,r,u,h,y,w,N,F,X,J,P,I){if(e.timeoutHandle=-1,J=t.subtreeFlags,(J&8192||(J&16785408)===16785408)&&(Hr={stylesheets:null,count:0,unsuspend:cw},Nv(t),J=dw(),J!==null)){e.cancelPendingCommit=J(kv.bind(null,e,t,h,i,r,u,y,w,N,X,1,P,I)),li(e,h,y,!F);return}kv(e,t,h,i,r,u,y,w,N)}function RS(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(!gn(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 li(e,t,i,r){t&=~fd,t&=~Bi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var u=t;0<u;){var h=31-Ve(u),y=1<<h;r[h]=-1,u&=~y}i!==0&&jt(e,i,t)}function yo(){return(Xe&6)===0?(Ur(0),!1):!0}function bd(){if($e!==null){if(Qe===0)var e=$e.return;else e=$e,Ra=Ai=null,Uu(e),vl=null,Er=0,e=$e;for(;e!==null;)pv(e.alternate,e),e=e.return;$e=null}}function El(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,GS(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),bd(),at=e,$e=i=Ea(e.current,null),qe=t,Qe=0,xn=null,ti=!1,jl=ya(e,t),dd=!1,Sl=zn=fd=Bi=ni=mt=0,on=Lr=null,hd=!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 za=t,Fs(),i}function Bv(e,t){Me=null,U.H=lo,t===gr||t===Qs?(t=eg(),Qe=3):t===Zp?(t=eg(),Qe=4):Qe=t===tv?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,xn=t,$e===null&&(mt=1,uo(e,An(t,e.current)))}function _v(){var e=U.H;return U.H=lo,e===null?lo:e}function qv(){var e=U.A;return U.A=DS,e}function yd(){mt=4,ti||(qe&4194048)!==qe&&Un.current!==null||(jl=!0),(ni&134217727)===0&&(Bi&134217727)===0||at===null||li(at,qe,zn,!1)}function xd(e,t,i){var r=Xe;Xe|=2;var u=_v(),h=qv();(at!==e||qe!==t)&&(bo=null,El(e,t)),t=!1;var y=mt;e:do try{if(Qe!==0&&$e!==null){var w=$e,N=xn;switch(Qe){case 8:bd(),y=6;break e;case 3:case 2:case 9:case 6:Un.current===null&&(t=!0);var F=Qe;if(Qe=0,xn=null,Dl(e,w,N,F),i&&jl){y=0;break e}break;default:F=Qe,Qe=0,xn=null,Dl(e,w,N,F)}}NS(),y=mt;break}catch(X){Bv(e,X)}while(!0);return t&&e.shellSuspendCounter++,Ra=Ai=null,Xe=r,U.H=u,U.A=h,$e===null&&(at=null,qe=0,Fs()),y}function NS(){for(;$e!==null;)Fv($e)}function MS(e,t){var i=Xe;Xe|=2;var r=_v(),u=qv();at!==e||qe!==t?(bo=null,vo=Xt()+500,El(e,t)):jl=ya(e,t);e:do try{if(Qe!==0&&$e!==null){t=$e;var h=xn;t:switch(Qe){case 1:Qe=0,xn=null,Dl(e,t,h,1);break;case 2:case 9:if(Wp(h)){Qe=0,xn=null,Hv(t);break}t=function(){Qe!==2&&Qe!==9||at!==e||(Qe=7),ua(e)},h.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:Wp(h)?(Qe=0,xn=null,Hv(t)):(Qe=0,xn=null,Dl(e,t,h,7));break;case 5:var y=null;switch($e.tag){case 26:y=$e.memoizedState;case 5:case 27:var w=$e;if(!y||S0(y)){Qe=0,xn=null;var N=w.sibling;if(N!==null)$e=N;else{var F=w.return;F!==null?($e=F,xo(F)):$e=null}break t}}Qe=0,xn=null,Dl(e,t,h,5);break;case 6:Qe=0,xn=null,Dl(e,t,h,6);break;case 8:bd(),mt=6;break e;default:throw Error(s(462))}}AS();break}catch(X){Bv(e,X)}while(!0);return Ra=Ai=null,U.H=r,U.A=u,Xe=i,$e!==null?0:(at=null,qe=0,Fs(),mt)}function AS(){for(;$e!==null&&!ea();)Fv($e)}function Fv(e){var t=hv(e.alternate,e,za);e.memoizedProps=e.pendingProps,t===null?xo(e):$e=t}function Hv(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=sv(i,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=sv(i,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:Uu(t);default:pv(i,t),t=$e=Pp(t,za),t=hv(i,t,za)}e.memoizedProps=e.pendingProps,t===null?xo(e):$e=t}function Dl(e,t,i,r){Ra=Ai=null,Uu(t),vl=null,Er=0;var u=t.return;try{if(xS(e,u,t,i,qe)){mt=1,uo(e,An(i,e.current)),$e=null;return}}catch(h){if(u!==null)throw $e=u,h;mt=1,uo(e,An(i,e.current)),$e=null;return}t.flags&32768?(He||r===1?e=!0:jl||(qe&536870912)!==0?e=!1:(ti=e=!0,(r===2||r===9||r===3||r===6)&&(r=Un.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pv(t,e)):xo(t)}function xo(e){var t=e;do{if((t.flags&32768)!==0){Pv(t,ti);return}e=t.return;var i=SS(t.alternate,t,za);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 Pv(e,t){do{var i=wS(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 kv(e,t,i,r,u,h,y,w,N){e.cancelPendingCommit=null;do jo();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|=uu,zt(e,i,h,y,w,N),e===at&&($e=at=null,qe=0),wl=t,ii=e,Cl=i,pd=h,gd=u,Lv=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,US(Hn,function(){return Xv(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=U.T,U.T=null,u=k.p,k.p=2,y=Xe,Xe|=4;try{CS(e,t,i)}finally{Xe=y,k.p=u,U.T=r}}_t=1,Iv(),Vv(),Gv()}}function Iv(){if(_t===1){_t=0;var e=ii,t=wl,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null;var r=k.p;k.p=2;var u=Xe;Xe|=4;try{Dv(t,e);var h=$d,y=$p(e.containerInfo),w=h.focusedElem,N=h.selectionRange;if(y!==w&&w&&w.ownerDocument&&Ap(w.ownerDocument.documentElement,w)){if(N!==null&&lu(w)){var F=N.start,X=N.end;if(X===void 0&&(X=F),"selectionStart"in w)w.selectionStart=F,w.selectionEnd=Math.min(X,w.value.length);else{var J=w.ownerDocument||document,P=J&&J.defaultView||window;if(P.getSelection){var I=P.getSelection(),we=w.textContent.length,ye=Math.min(N.start,we),et=N.end===void 0?ye:Math.min(N.end,we);!I.extend&&ye>et&&(y=et,et=ye,ye=y);var z=Mp(w,ye),$=Mp(w,et);if(z&&$&&(I.rangeCount!==1||I.anchorNode!==z.node||I.anchorOffset!==z.offset||I.focusNode!==$.node||I.focusOffset!==$.offset)){var _=J.createRange();_.setStart(z.node,z.offset),I.removeAllRanges(),ye>et?(I.addRange(_),I.extend($.node,$.offset)):(_.setEnd($.node,$.offset),I.addRange(_))}}}}for(J=[],I=w;I=I.parentNode;)I.nodeType===1&&J.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<J.length;w++){var K=J[w];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Lo=!!Ad,$d=Ad=null}finally{Xe=u,k.p=r,U.T=i}}e.current=t,_t=2}}function Vv(){if(_t===2){_t=0;var e=ii,t=wl,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=U.T,U.T=null;var r=k.p;k.p=2;var u=Xe;Xe|=4;try{Sv(e,t.alternate,t)}finally{Xe=u,k.p=r,U.T=i}}_t=3}}function Gv(){if(_t===4||_t===3){_t=0,Gt();var e=ii,t=wl,i=Cl,r=Lv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?_t=5:(_t=0,wl=ii=null,Yv(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ai=null),dt(i),t=t.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(ta,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=U.T,u=k.p,k.p=2,U.T=null;try{for(var h=e.onRecoverableError,y=0;y<r.length;y++){var w=r[y];h(w.value,{componentStack:w.stack})}}finally{U.T=t,k.p=u}}(Cl&3)!==0&&jo(),ua(e),u=e.pendingLanes,(i&4194090)!==0&&(u&42)!==0?e===vd?Or++:(Or=0,vd=e):Or=0,Ur(0)}}function Yv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mr(t)))}function jo(e){return Iv(),Vv(),Gv(),Xv()}function Xv(){if(_t!==5)return!1;var e=ii,t=pd;pd=0;var i=dt(Cl),r=U.T,u=k.p;try{k.p=32>i?32:i,U.T=null,i=gd,gd=null;var h=ii,y=Cl;if(_t=0,wl=ii=null,Cl=0,(Xe&6)!==0)throw Error(s(331));var w=Xe;if(Xe|=4,Av(h.current),Rv(h,h.current,y,i),Xe=w,Ur(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(ta,h)}catch{}return!0}finally{k.p=u,U.T=r,Yv(e,t)}}function Qv(e,t,i){t=An(i,t),t=Qu(e.stateNode,t,2),e=Xa(e,t,2),e!==null&&(nt(e,2),ua(e))}function tt(e,t,i){if(e.tag===3)Qv(e,e,i);else for(;t!==null;){if(t.tag===3){Qv(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ai===null||!ai.has(r))){e=An(i,e),i=Jg(2),r=Xa(t,i,2),r!==null&&(ev(i,r,t,e),nt(r,2),ua(r));break}}t=t.return}}function jd(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new TS;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)||(dd=!0,u.add(i),e=$S.bind(null,e,t,i),t.then(e,e))}function $S(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()-md?(Xe&2)===0&&El(e,0):fd|=i,Sl===qe&&(Sl=0)),ua(e)}function Kv(e,t){t===0&&(t=ji()),e=sl(e,t),e!==null&&(nt(e,t),ua(e))}function LS(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Kv(e,i)}function OS(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),Kv(e,i)}function US(e,t){return Ut(e,t)}var So=null,Tl=null,Sd=!1,wo=!1,wd=!1,_i=0;function ua(e){e!==Tl&&e.next===null&&(Tl===null?So=Tl=e:Tl=Tl.next=e),wo=!0,Sd||(Sd=!0,BS())}function Ur(e,t){if(!wd&&wo){wd=!0;do for(var i=!1,r=So;r!==null;){if(e!==0){var u=r.pendingLanes;if(u===0)var h=0;else{var y=r.suspendedLanes,w=r.pingedLanes;h=(1<<31-Ve(42|e)+1)-1,h&=u&~(y&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,e0(r,h))}else h=qe,h=na(r,r===at?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(h&3)===0||ya(r,h)||(i=!0,e0(r,h));r=r.next}while(i);wd=!1}}function zS(){Zv()}function Zv(){wo=Sd=!1;var e=0;_i!==0&&(VS()&&(e=_i),_i=0);for(var t=Xt(),i=null,r=So;r!==null;){var u=r.next,h=Wv(r,t);h===0?(r.next=null,i===null?So=u:i.next=u,u===null&&(Tl=i)):(i=r,(e!==0||(h&3)!==0)&&(wo=!0)),r=u}Ur(e)}function Wv(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var y=31-Ve(h),w=1<<y,N=u[y];N===-1?((w&i)===0||(w&r)!==0)&&(u[y]=xi(w,t)):N<=t&&(e.expiredLanes|=w),h&=~w}if(t=at,i=qe,i=na(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||ya(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(r!==null&&Vt(r),dt(i)){case 2:case 8:i=fn;break;case 32:i=Hn;break;case 268435456:i=bi;break;default:i=Hn}return r=Jv.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 Jv(e,t){if(_t!==0&&_t!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(jo()&&e.callbackNode!==i)return null;var r=qe;return r=na(e,e===at?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Uv(e,r,t),Wv(e,Xt()),e.callbackNode!=null&&e.callbackNode===i?Jv.bind(null,e):null)}function e0(e,t){if(jo())return null;Uv(e,t,!0)}function BS(){YS(function(){(Xe&6)!==0?Ut(ga,zS):Zv()})}function Cd(){return _i===0&&(_i=xa()),_i}function t0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ls(""+e)}function n0(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 _S(e,t,i,r,u){if(t==="submit"&&i&&i.stateNode===u){var h=t0((u[L]||null).action),y=r.submitter;y&&(t=(t=y[L]||null)?t0(t.formAction):y.getAttribute("formAction"),t!==null&&(h=t,y=null));var w=new Bs("action","action",null,r,u);e.push({event:w,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(_i!==0){var N=y?n0(u,y):new FormData(u);Iu(i,{pending:!0,data:N,method:u.method,action:h},null,N)}}else typeof h=="function"&&(w.preventDefault(),N=y?n0(u,y):new FormData(u),Iu(i,{pending:!0,data:N,method:u.method,action:h},h,N))},currentTarget:u}]})}}for(var Ed=0;Ed<cu.length;Ed++){var Dd=cu[Ed],qS=Dd.toLowerCase(),FS=Dd[0].toUpperCase()+Dd.slice(1);Pn(qS,"on"+FS)}Pn(Up,"onAnimationEnd"),Pn(zp,"onAnimationIteration"),Pn(Bp,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(aS,"onTransitionRun"),Pn(iS,"onTransitionStart"),Pn(lS,"onTransitionCancel"),Pn(_p,"onTransitionEnd"),mn("onMouseEnter",["mouseout","mouseover"]),mn("onMouseLeave",["mouseout","mouseover"]),mn("onPointerEnter",["pointerout","pointerover"]),mn("onPointerLeave",["pointerout","pointerover"]),Ie("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ie("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ie("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ie("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ie("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ie("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zr="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(" "),HS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zr));function a0(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 y=r.length-1;0<=y;y--){var w=r[y],N=w.instance,F=w.currentTarget;if(w=w.listener,N!==h&&u.isPropagationStopped())break e;h=w,u.currentTarget=F;try{h(u)}catch(X){co(X)}u.currentTarget=null,h=N}else for(y=0;y<r.length;y++){if(w=r[y],N=w.instance,F=w.currentTarget,w=w.listener,N!==h&&u.isPropagationStopped())break e;h=w,u.currentTarget=F;try{h(u)}catch(X){co(X)}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)||(i0(t,e,2,!1),i.add(r))}function Td(e,t,i){var r=0;t&&(r|=4),i0(i,e,r,t)}var Co="_reactListening"+Math.random().toString(36).slice(2);function Rd(e){if(!e[Co]){e[Co]=!0,Ge.forEach(function(i){i!=="selectionchange"&&(HS.has(i)||Td(i,!1,e),Td(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Co]||(t[Co]=!0,Td("selectionchange",!1,t))}}function i0(e,t,i,r){switch(R0(t)){case 2:var u=mw;break;case 8:u=pw;break;default:u=Pd}i=u.bind(null,t,i,e),u=void 0,!Kc||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 Nd(e,t,i,r,u){var h=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var y=r.tag;if(y===3||y===4){var w=r.stateNode.containerInfo;if(w===u)break;if(y===4)for(y=r.return;y!==null;){var N=y.tag;if((N===3||N===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;w!==null;){if(y=ue(w),y===null)return;if(N=y.tag,N===5||N===6||N===26||N===27){r=h=y;continue e}w=w.parentNode}}r=r.return}dp(function(){var F=h,X=Xc(i),J=[];e:{var P=qp.get(e);if(P!==void 0){var I=Bs,we=e;switch(e){case"keypress":if(Us(i)===0)break e;case"keydown":case"keyup":I=U2;break;case"focusin":we="focus",I=eu;break;case"focusout":we="blur",I=eu;break;case"beforeblur":case"afterblur":I=eu;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":I=mp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=w2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=_2;break;case Up:case zp:case Bp:I=D2;break;case _p:I=F2;break;case"scroll":case"scrollend":I=j2;break;case"wheel":I=P2;break;case"copy":case"cut":case"paste":I=R2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=gp;break;case"toggle":case"beforetoggle":I=I2}var ye=(t&4)!==0,et=!ye&&(e==="scroll"||e==="scrollend"),z=ye?P!==null?P+"Capture":null:P;ye=[];for(var $=F,_;$!==null;){var K=$;if(_=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||_===null||z===null||(K=tr($,z),K!=null&&ye.push(Br($,K,_))),et)break;$=$.return}0<ye.length&&(P=new I(P,we,null,i,X),J.push({event:P,listeners:ye}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",I=e==="mouseout"||e==="pointerout",P&&i!==Yc&&(we=i.relatedTarget||i.fromElement)&&(ue(we)||we[H]))break e;if((I||P)&&(P=X.window===X?X:(P=X.ownerDocument)?P.defaultView||P.parentWindow:window,I?(we=i.relatedTarget||i.toElement,I=F,we=we?ue(we):null,we!==null&&(et=d(we),ye=we.tag,we!==et||ye!==5&&ye!==27&&ye!==6)&&(we=null)):(I=null,we=F),I!==we)){if(ye=mp,K="onMouseLeave",z="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(ye=gp,K="onPointerLeave",z="onPointerEnter",$="pointer"),et=I==null?P:Ce(I),_=we==null?P:Ce(we),P=new ye(K,$+"leave",I,i,X),P.target=et,P.relatedTarget=_,K=null,ue(X)===F&&(ye=new ye(z,$+"enter",we,i,X),ye.target=_,ye.relatedTarget=et,K=ye),et=K,I&&we)t:{for(ye=I,z=we,$=0,_=ye;_;_=Rl(_))$++;for(_=0,K=z;K;K=Rl(K))_++;for(;0<$-_;)ye=Rl(ye),$--;for(;0<_-$;)z=Rl(z),_--;for(;$--;){if(ye===z||z!==null&&ye===z.alternate)break t;ye=Rl(ye),z=Rl(z)}ye=null}else ye=null;I!==null&&l0(J,P,I,ye,!1),we!==null&&et!==null&&l0(J,et,we,ye,!0)}}e:{if(P=F?Ce(F):window,I=P.nodeName&&P.nodeName.toLowerCase(),I==="select"||I==="input"&&P.type==="file")var pe=Cp;else if(Sp(P))if(Ep)pe=eS;else{pe=W2;var Ae=Z2}else I=P.nodeName,!I||I.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?F&&Gc(F.elementType)&&(pe=Cp):pe=J2;if(pe&&(pe=pe(e,F))){wp(J,pe,i,X);break e}Ae&&Ae(e,P,F),e==="focusout"&&F&&P.type==="number"&&F.memoizedProps.value!=null&&Vc(P,"number",P.value)}switch(Ae=F?Ce(F):window,e){case"focusin":(Sp(Ae)||Ae.contentEditable==="true")&&(il=Ae,ru=F,cr=null);break;case"focusout":cr=ru=il=null;break;case"mousedown":su=!0;break;case"contextmenu":case"mouseup":case"dragend":su=!1,Lp(J,i,X);break;case"selectionchange":if(nS)break;case"keydown":case"keyup":Lp(J,i,X)}var ve;if(nu)e:{switch(e){case"compositionstart":var xe="onCompositionStart";break e;case"compositionend":xe="onCompositionEnd";break e;case"compositionupdate":xe="onCompositionUpdate";break e}xe=void 0}else al?xp(e,i)&&(xe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(xe="onCompositionStart");xe&&(vp&&i.locale!=="ko"&&(al||xe!=="onCompositionStart"?xe==="onCompositionEnd"&&al&&(ve=fp()):(Ia=X,Zc="value"in Ia?Ia.value:Ia.textContent,al=!0)),Ae=Eo(F,xe),0<Ae.length&&(xe=new pp(xe,e,null,i,X),J.push({event:xe,listeners:Ae}),ve?xe.data=ve:(ve=jp(i),ve!==null&&(xe.data=ve)))),(ve=G2?Y2(e,i):X2(e,i))&&(xe=Eo(F,"onBeforeInput"),0<xe.length&&(Ae=new pp("onBeforeInput","beforeinput",null,i,X),J.push({event:Ae,listeners:xe}),Ae.data=ve)),_S(J,e,F,i,X)}a0(J,t)})}function Br(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Eo(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=tr(e,i),u!=null&&r.unshift(Br(e,u,h)),u=tr(e,t),u!=null&&r.push(Br(e,u,h))),e.tag===3)return r;e=e.return}return[]}function Rl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function l0(e,t,i,r,u){for(var h=t._reactName,y=[];i!==null&&i!==r;){var w=i,N=w.alternate,F=w.stateNode;if(w=w.tag,N!==null&&N===r)break;w!==5&&w!==26&&w!==27||F===null||(N=F,u?(F=tr(i,h),F!=null&&y.unshift(Br(i,F,N))):u||(F=tr(i,h),F!=null&&y.push(Br(i,F,N)))),i=i.return}y.length!==0&&e.push({event:t,listeners:y})}var PS=/\r\n?/g,kS=/\u0000|\uFFFD/g;function r0(e){return(typeof e=="string"?e:""+e).replace(PS,`
|
|
25
|
-
`).replace(kS,"")}function s0(e,t){return t=r0(t),r0(e)===t}function Do(){}function Je(e,t,i,r,u,h){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||el(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&el(e,""+r);break;case"className":Nn(e,"class",r);break;case"tabIndex":Nn(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Nn(e,i,r);break;case"style":cp(e,r,h);break;case"data":if(t!=="object"){Nn(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=Ls(""+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=Ls(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=Do);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=Ls(""+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),ia(e,"popover",r);break;case"xlinkActuate":an(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":an(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":an(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":an(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":an(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":an(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":an(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":an(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":an(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":ia(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=y2.get(i)||i,ia(e,i,r))}}function Md(e,t,i,r,u,h){switch(i){case"style":cp(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"?el(e,r):(typeof r=="number"||typeof r=="bigint")&&el(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=Do);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,""):ia(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 y=i[h];if(y!=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,y,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 w=h=y=u=null,N=null,F=null;for(r in i)if(i.hasOwnProperty(r)){var X=i[r];if(X!=null)switch(r){case"name":u=X;break;case"type":y=X;break;case"checked":N=X;break;case"defaultChecked":F=X;break;case"value":h=X;break;case"defaultValue":w=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(s(137,t));break;default:Je(e,t,r,X,i,null)}}lp(e,h,w,N,F,y,u,!1),As(e);return;case"select":Le("invalid",e),r=y=h=null;for(u in i)if(i.hasOwnProperty(u)&&(w=i[u],w!=null))switch(u){case"value":h=w;break;case"defaultValue":y=w;break;case"multiple":r=w;default:Je(e,t,u,w,i,null)}t=h,i=y,e.multiple=!!r,t!=null?Ji(e,!!r,t,!1):i!=null&&Ji(e,!!r,i,!0);return;case"textarea":Le("invalid",e),h=u=r=null;for(y in i)if(i.hasOwnProperty(y)&&(w=i[y],w!=null))switch(y){case"value":r=w;break;case"defaultValue":u=w;break;case"children":h=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(s(91));break;default:Je(e,t,y,w,i,null)}sp(e,r,u,h),As(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<zr.length;r++)Le(zr[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(F in i)if(i.hasOwnProperty(F)&&(r=i[F],r!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Je(e,t,F,r,i,null)}return;default:if(Gc(t)){for(X in i)i.hasOwnProperty(X)&&(r=i[X],r!==void 0&&Md(e,t,X,r,i,void 0));return}}for(w in i)i.hasOwnProperty(w)&&(r=i[w],r!=null&&Je(e,t,w,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,y=null,w=null,N=null,F=null,X=null;for(I in i){var J=i[I];if(i.hasOwnProperty(I)&&J!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":N=J;default:r.hasOwnProperty(I)||Je(e,t,I,null,r,J)}}for(var P in r){var I=r[P];if(J=i[P],r.hasOwnProperty(P)&&(I!=null||J!=null))switch(P){case"type":h=I;break;case"name":u=I;break;case"checked":F=I;break;case"defaultChecked":X=I;break;case"value":y=I;break;case"defaultValue":w=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(s(137,t));break;default:I!==J&&Je(e,t,P,I,r,J)}}Ic(e,y,w,N,F,X,h,u);return;case"select":I=y=w=P=null;for(h in i)if(N=i[h],i.hasOwnProperty(h)&&N!=null)switch(h){case"value":break;case"multiple":I=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":P=h;break;case"defaultValue":w=h;break;case"multiple":y=h;default:h!==N&&Je(e,t,u,h,r,N)}t=w,i=y,r=I,P!=null?Ji(e,!!i,P,!1):!!r!=!!i&&(t!=null?Ji(e,!!i,t,!0):Ji(e,!!i,i?[]:"",!1));return;case"textarea":I=P=null;for(w in i)if(u=i[w],i.hasOwnProperty(w)&&u!=null&&!r.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Je(e,t,w,null,r,u)}for(y in r)if(u=r[y],h=i[y],r.hasOwnProperty(y)&&(u!=null||h!=null))switch(y){case"value":P=u;break;case"defaultValue":I=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==h&&Je(e,t,y,u,r,h)}rp(e,P,I);return;case"option":for(var we in i)if(P=i[we],i.hasOwnProperty(we)&&P!=null&&!r.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:Je(e,t,we,null,r,P)}for(N in r)if(P=r[N],I=i[N],r.hasOwnProperty(N)&&P!==I&&(P!=null||I!=null))switch(N){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:Je(e,t,N,P,r,I)}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)P=i[ye],i.hasOwnProperty(ye)&&P!=null&&!r.hasOwnProperty(ye)&&Je(e,t,ye,null,r,P);for(F in r)if(P=r[F],I=i[F],r.hasOwnProperty(F)&&P!==I&&(P!=null||I!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(s(137,t));break;default:Je(e,t,F,P,r,I)}return;default:if(Gc(t)){for(var et in i)P=i[et],i.hasOwnProperty(et)&&P!==void 0&&!r.hasOwnProperty(et)&&Md(e,t,et,void 0,r,P);for(X in r)P=r[X],I=i[X],!r.hasOwnProperty(X)||P===I||P===void 0&&I===void 0||Md(e,t,X,P,r,I);return}}for(var z in i)P=i[z],i.hasOwnProperty(z)&&P!=null&&!r.hasOwnProperty(z)&&Je(e,t,z,null,r,P);for(J in r)P=r[J],I=i[J],!r.hasOwnProperty(J)||P===I||P==null&&I==null||Je(e,t,J,P,r,I)}var Ad=null,$d=null;function To(e){return e.nodeType===9?e:e.ownerDocument}function o0(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 c0(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 Ld(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 Od=null;function VS(){var e=window.event;return e&&e.type==="popstate"?e===Od?!1:(Od=e,!0):(Od=null,!1)}var u0=typeof setTimeout=="function"?setTimeout:void 0,GS=typeof clearTimeout=="function"?clearTimeout:void 0,d0=typeof Promise=="function"?Promise:void 0,YS=typeof queueMicrotask=="function"?queueMicrotask:typeof d0<"u"?function(e){return d0.resolve(null).then(e).catch(XS)}:u0;function XS(e){setTimeout(function(){throw e})}function ri(e){return e==="head"}function f0(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 y=e.ownerDocument;if(i&1&&_r(y.documentElement),i&2&&_r(y.body),i&4)for(i=y.head,_r(i),y=i.firstChild;y;){var w=y.nextSibling,N=y.nodeName;y[oe]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&y.rel.toLowerCase()==="stylesheet"||i.removeChild(y),y=w}}if(u===0){e.removeChild(h),Gr(t);return}u--}else i==="$"||i==="$?"||i==="$!"?u++:r=i.charCodeAt(0)-48;else r=0;i=h}while(i);Gr(t)}function Ud(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":Ud(i),he(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function QS(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[oe])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 KS(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 zd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function ZS(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 Bd=null;function h0(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 m0(e,t,i){switch(t=To(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 _r(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);he(e)}var Bn=new Map,p0=new Set;function Ro(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ba=k.d;k.d={f:WS,r:JS,D:ew,C:tw,L:nw,m:aw,X:lw,S:iw,M:rw};function WS(){var e=Ba.f(),t=yo();return e||t}function JS(e){var t=me(e);t!==null&&t.tag===5&&t.type==="form"?Ug(t):Ba.r(e)}var Nl=typeof document>"u"?null:document;function g0(e,t,i){var r=Nl;if(r&&typeof t=="string"&&t){var u=Mn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof i=="string"&&(u+='[crossorigin="'+i+'"]'),p0.has(u)||(p0.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 ew(e){Ba.D(e),g0("dns-prefetch",e,null)}function tw(e,t){Ba.C(e,t),g0("preconnect",e,t)}function nw(e,t,i){Ba.L(e,t,i);var r=Nl;if(r&&e&&t){var u='link[rel="preload"][as="'+Mn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(u+='[imagesrcset="'+Mn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(u+='[imagesizes="'+Mn(i.imageSizes)+'"]')):u+='[href="'+Mn(e)+'"]';var h=u;switch(t){case"style":h=Ml(e);break;case"script":h=Al(e)}Bn.has(h)||(e=v({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Bn.set(h,e),r.querySelector(u)!==null||t==="style"&&r.querySelector(qr(h))||t==="script"&&r.querySelector(Fr(h))||(t=r.createElement("link"),qt(t,"link",e),Oe(t),r.head.appendChild(t)))}}function aw(e,t){Ba.m(e,t);var i=Nl;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Mn(r)+'"][href="'+Mn(e)+'"]',h=u;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Al(e)}if(!Bn.has(h)&&(e=v({rel:"modulepreload",href:e},t),Bn.set(h,e),i.querySelector(u)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Fr(h)))return}r=i.createElement("link"),qt(r,"link",e),Oe(r),i.head.appendChild(r)}}}function iw(e,t,i){Ba.S(e,t,i);var r=Nl;if(r&&e){var u=Ne(r).hoistableStyles,h=Ml(e);t=t||"default";var y=u.get(h);if(!y){var w={loading:0,preload:null};if(y=r.querySelector(qr(h)))w.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Bn.get(h))&&_d(e,i);var N=y=r.createElement("link");Oe(N),qt(N,"link",e),N._p=new Promise(function(F,X){N.onload=F,N.onerror=X}),N.addEventListener("load",function(){w.loading|=1}),N.addEventListener("error",function(){w.loading|=2}),w.loading|=4,No(y,t,r)}y={type:"stylesheet",instance:y,count:1,state:w},u.set(h,y)}}}function lw(e,t){Ba.X(e,t);var i=Nl;if(i&&e){var r=Ne(i).hoistableScripts,u=Al(e),h=r.get(u);h||(h=i.querySelector(Fr(u)),h||(e=v({src:e,async:!0},t),(t=Bn.get(u))&&qd(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 rw(e,t){Ba.M(e,t);var i=Nl;if(i&&e){var r=Ne(i).hoistableScripts,u=Al(e),h=r.get(u);h||(h=i.querySelector(Fr(u)),h||(e=v({src:e,async:!0,type:"module"},t),(t=Bn.get(u))&&qd(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 v0(e,t,i,r){var u=(u=Ue.current)?Ro(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=Ml(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=Ml(i.href);var h=Ne(u).hoistableStyles,y=h.get(e);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,y),(h=u.querySelector(qr(e)))&&!h._p&&(y.instance=h,y.state.loading=5),Bn.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},Bn.set(e,i),h||sw(u,e,i,y.state))),t&&r===null)throw Error(s(528,""));return y}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=Al(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 Ml(e){return'href="'+Mn(e)+'"'}function qr(e){return'link[rel="stylesheet"]['+e+"]"}function b0(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function sw(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 Al(e){return'[src="'+Mn(e)+'"]'}function Fr(e){return"script[async]"+e}function y0(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Mn(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),No(r,i.precedence,e),t.instance=r;case"stylesheet":u=Ml(i.href);var h=e.querySelector(qr(u));if(h)return t.state.loading|=4,t.instance=h,Oe(h),h;r=b0(i),(u=Bn.get(u))&&_d(r,u),h=(e.ownerDocument||e).createElement("link"),Oe(h);var y=h;return y._p=new Promise(function(w,N){y.onload=w,y.onerror=N}),qt(h,"link",r),t.state.loading|=4,No(h,i.precedence,e),t.instance=h;case"script":return h=Al(i.src),(u=e.querySelector(Fr(h)))?(t.instance=u,Oe(u),u):(r=i,(u=Bn.get(h))&&(r=v({},i),qd(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,No(r,i.precedence,e));return t.instance}function No(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,y=0;y<r.length;y++){var w=r[y];if(w.dataset.precedence===t)h=w;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 _d(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function qd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Mo=null;function x0(e,t,i){if(Mo===null){var r=new Map,u=Mo=new Map;u.set(i,r)}else u=Mo,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[oe]||h[M]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var y=h.getAttribute(t)||"";y=e+y;var w=r.get(y);w?w.push(h):r.set(y,[h])}}return r}function j0(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function ow(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 S0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Hr=null;function cw(){}function uw(e,t,i){if(Hr===null)throw Error(s(475));var r=Hr;if(t.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var u=Ml(i.href),h=e.querySelector(qr(u));if(h){e=h._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(r.count++,r=Ao.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=h,Oe(h);return}h=e.ownerDocument||e,i=b0(i),(u=Bn.get(u))&&_d(i,u),h=h.createElement("link"),Oe(h);var y=h;y._p=new Promise(function(w,N){y.onload=w,y.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=Ao.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}function dw(){if(Hr===null)throw Error(s(475));var e=Hr;return e.stylesheets&&e.count===0&&Fd(e,e.stylesheets),0<e.count?function(t){var i=setTimeout(function(){if(e.stylesheets&&Fd(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 Ao(){if(this.count--,this.count===0){if(this.stylesheets)Fd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $o=null;function Fd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$o=new Map,t.forEach(fw,e),$o=null,Ao.call(e))}function fw(e,t){if(!(t.state.loading&4)){var i=$o.get(e);if(i)var r=i.get(null);else{i=new Map,$o.set(e,i);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var y=u[h];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(i.set(y.dataset.precedence,y),r=y)}r&&i.set(null,r)}u=t.instance,y=u.getAttribute("data-precedence"),h=i.get(y)||r,h===r&&i.set(null,u),i.set(y,u),this.count++,r=Ao.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 Pr={$$typeof:B,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function hw(e,t,i,r,u,h,y,w){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=ja(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ja(0),this.hiddenUpdates=ja(null),this.identifierPrefix=r,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function w0(e,t,i,r,u,h,y,w,N,F,X,J){return e=new hw(e,t,i,y,w,N,F,J),t=1,h===!0&&(t|=24),h=vn(3,null,null,t),e.current=h,h.stateNode=e,t=ju(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:r,isDehydrated:i,cache:t},Eu(h),e}function C0(e){return e?(e=ol,e):ol}function E0(e,t,i,r,u,h){u=C0(u),r.context===null?r.context=u:r.pendingContext=u,r=Ya(t),r.payload={element:i},h=h===void 0?null:h,h!==null&&(r.callback=h),i=Xa(e,r,t),i!==null&&(Sn(i,e,t),br(i,e,t))}function D0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Hd(e,t){D0(e,t),(e=e.alternate)&&D0(e,t)}function T0(e){if(e.tag===13){var t=sl(e,67108864);t!==null&&Sn(t,e,67108864),Hd(e,67108864)}}var Lo=!0;function mw(e,t,i,r){var u=U.T;U.T=null;var h=k.p;try{k.p=2,Pd(e,t,i,r)}finally{k.p=h,U.T=u}}function pw(e,t,i,r){var u=U.T;U.T=null;var h=k.p;try{k.p=8,Pd(e,t,i,r)}finally{k.p=h,U.T=u}}function Pd(e,t,i,r){if(Lo){var u=kd(r);if(u===null)Nd(e,t,r,Oo,i),N0(e,r);else if(vw(u,e,t,i,r))r.stopPropagation();else if(N0(e,r),t&4&&-1<gw.indexOf(e)){for(;u!==null;){var h=me(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var y=nn(h.pendingLanes);if(y!==0){var w=h;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var N=1<<31-Ve(y);w.entanglements[1]|=N,y&=~N}ua(h),(Xe&6)===0&&(vo=Xt()+500,Ur(0))}}break;case 13:w=sl(h,2),w!==null&&Sn(w,h,2),yo(),Hd(h,2)}if(h=kd(r),h===null&&Nd(e,t,r,Oo,i),h===u)break;u=h}u!==null&&r.stopPropagation()}else Nd(e,t,r,null,i)}}function kd(e){return e=Xc(e),Id(e)}var Oo=null;function Id(e){if(Oo=null,e=ue(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 Oo=e,null}function R0(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(Zi()){case ga:return 2;case fn:return 8;case Hn:case Pa:return 32;case bi:return 268435456;default:return 32}default:return 32}}var Vd=!1,si=null,oi=null,ci=null,kr=new Map,Ir=new Map,ui=[],gw="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 N0(e,t){switch(e){case"focusin":case"focusout":si=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ci=null;break;case"pointerover":case"pointerout":kr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ir.delete(t.pointerId)}}function Vr(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=me(t),t!==null&&T0(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function vw(e,t,i,r,u){switch(t){case"focusin":return si=Vr(si,e,t,i,r,u),!0;case"dragenter":return oi=Vr(oi,e,t,i,r,u),!0;case"mouseover":return ci=Vr(ci,e,t,i,r,u),!0;case"pointerover":var h=u.pointerId;return kr.set(h,Vr(kr.get(h)||null,e,t,i,r,u)),!0;case"gotpointercapture":return h=u.pointerId,Ir.set(h,Vr(Ir.get(h)||null,e,t,i,r,u)),!0}return!1}function M0(e){var t=ue(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,aa(e.priority,function(){if(i.tag===13){var r=jn();r=St(r);var u=sl(i,r);u!==null&&Sn(u,i,r),Hd(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 Uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=kd(e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);Yc=r,i.target.dispatchEvent(r),Yc=null}else return t=me(i),t!==null&&T0(t),e.blockedOn=i,!1;t.shift()}return!0}function A0(e,t,i){Uo(e)&&i.delete(t)}function bw(){Vd=!1,si!==null&&Uo(si)&&(si=null),oi!==null&&Uo(oi)&&(oi=null),ci!==null&&Uo(ci)&&(ci=null),kr.forEach(A0),Ir.forEach(A0)}function zo(e,t){e.blockedOn===t&&(e.blockedOn=null,Vd||(Vd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,bw)))}var Bo=null;function $0(e){Bo!==e&&(Bo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Bo===e&&(Bo=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=me(i);h!==null&&(e.splice(t,3),t-=3,Iu(h,{pending:!0,data:u,method:i.method,action:r},r,u))}}))}function Gr(e){function t(N){return zo(N,e)}si!==null&&zo(si,e),oi!==null&&zo(oi,e),ci!==null&&zo(ci,e),kr.forEach(t),Ir.forEach(t);for(var i=0;i<ui.length;i++){var r=ui[i];r.blockedOn===e&&(r.blockedOn=null)}for(;0<ui.length&&(i=ui[0],i.blockedOn===null);)M0(i),i.blockedOn===null&&ui.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],y=u[L]||null;if(typeof h=="function")y||$0(i);else if(y){var w=null;if(h&&h.hasAttribute("formAction")){if(u=h,y=h[L]||null)w=y.formAction;else if(Id(u)!==null)continue}else w=y.action;typeof w=="function"?i[r+1]=w:(i.splice(r,3),r-=3),$0(i)}}}function Gd(e){this._internalRoot=e}_o.prototype.render=Gd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var i=t.current,r=jn();E0(i,r,e,t,null,null)},_o.prototype.unmount=Gd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;E0(e.current,2,null,e,null,null),yo(),t[H]=null}};function _o(e){this._internalRoot=e}_o.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rt();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ui.length&&t!==0&&t<ui[i].priority;i++);ui.splice(i,0,e),i===0&&M0(e)}};var L0=n.version;if(L0!=="19.1.0")throw Error(s(527,L0,"19.1.0"));k.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 yw={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qo.isDisabled&&qo.supportsFiber)try{ta=qo.inject(yw),rt=qo}catch{}}return Yr.createRoot=function(e,t){if(!c(e))throw Error(s(299));var i=!1,r="",u=Qg,h=Kg,y=Zg,w=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&&(y=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(w=t.unstable_transitionCallbacks)),t=w0(e,1,!1,null,null,i,r,u,h,y,w,null),e[H]=t.current,Rd(e),new Gd(t)},Yr.hydrateRoot=function(e,t,i){if(!c(e))throw Error(s(299));var r=!1,u="",h=Qg,y=Kg,w=Zg,N=null,F=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&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(N=i.unstable_transitionCallbacks),i.formState!==void 0&&(F=i.formState)),t=w0(e,1,!0,t,i??null,r,u,h,y,w,N,F),t.context=C0(null),i=t.current,r=jn(),r=St(r),u=Ya(r),u.callback=null,Xa(i,u,r),i=r,t.current.lanes=i,nt(t,i),ua(t),e[H]=t.current,Rd(e),new _o(t)},Yr.version="19.1.0",Yr}var _0;function Qw(){if(_0)return Xd.exports;_0=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(),Xd.exports=Xw(),Xd.exports}var Kw=Qw();/**
|
|
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 q0="popstate";function Zw(a){a===void 0&&(a={});function n(s,c){let{pathname:d,search:f,hash:p}=s.location;return os("",{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 Jw(n,l,null,a)}function De(a,n){if(a===!1||a===null||typeof a>"u")throw new Error(n)}function Pl(a,n){if(!a){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Ww(){return Math.random().toString(36).substr(2,8)}function F0(a,n){return{usr:a.state,key:a.key,idx:n}}function os(a,n,l,s){return l===void 0&&(l=null),ct({pathname:typeof a=="string"?a:a.pathname,search:"",hash:""},typeof n=="string"?Fa(n):n,{state:l,key:n&&n.key||s||Ww()})}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 Fa(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 Jw(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:S.location,delta:E})}function x(R,E){p=vt.Push;let A=os(S.location,R,E);g=v()+1;let B=F0(A,g),q=S.createHref(A);try{f.pushState(B,"",q)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;c.location.assign(q)}d&&m&&m({action:p,location:S.location,delta:1})}function j(R,E){p=vt.Replace;let A=os(S.location,R,E);g=v();let B=F0(A,g),q=S.createHref(A);f.replaceState(B,"",q),d&&m&&m({action:p,location:S.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 S={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(q0,b),m=R,()=>{c.removeEventListener(q0,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:x,replace:j,go(R){return f.go(R)}};return S}var Ke;(function(a){a.data="data",a.deferred="deferred",a.redirect="redirect",a.error="error"})(Ke||(Ke={}));const e4=new Set(["lazy","caseSensitive","path","id","index","children"]);function t4(a){return a.index===!0}function gc(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`),t4(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=gc(c.children,n,f,s)),m}})}function Hi(a,n,l){return l===void 0&&(l="/"),hc(a,n,l,!1)}function hc(a,n,l,s){let c=typeof n=="string"?Fa(n):n,d=Xn(c.pathname||"/",l);if(d==null)return null;let f=Ex(a);n4(f);let p=null;for(let m=0;p==null&&m<f.length;++m){let g=Tx(d);p=d4(f[m],g,s)}return p}function Cx(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 Ex(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=qa([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+'".')),Ex(d.children,n,v,g)),!(d.path==null&&!d.index)&&n.push({path:g,score:c4(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 Dx(d.path))c(d,f,m)}),n}function Dx(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=Dx(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 n4(a){a.sort((n,l)=>n.score!==l.score?l.score-n.score:u4(n.routesMeta.map(s=>s.childrenIndex),l.routesMeta.map(s=>s.childrenIndex)))}const a4=/^:[\w-]+$/,i4=3,l4=2,r4=1,s4=10,o4=-2,H0=a=>a==="*";function c4(a,n){let l=a.split("/"),s=l.length;return l.some(H0)&&(s+=o4),n&&(s+=l4),l.filter(c=>!H0(c)).reduce((c,d)=>c+(a4.test(d)?i4:d===""?r4:s4),s)}function u4(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 d4(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=cs({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),x=m.route;if(!b&&g&&l&&!s[s.length-1].route.index&&(b=cs({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:qa([d,b.pathname]),pathnameBase:p4(qa([d,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(d=qa([d,b.pathnameBase]))}return f}function cs(a,n){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[l,s]=f4(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:x,isOptional:j}=v;if(x==="*"){let S=p[b]||"";f=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const D=p[b];return j&&!D?g[x]=void 0:g[x]=(D||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:f,pattern:a}}function f4(a,n,l){n===void 0&&(n=!1),l===void 0&&(l=!0),Pl(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 Tx(a){try{return a.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Pl(!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 Xn(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 h4(a,n){n===void 0&&(n="/");let{pathname:l,search:s="",hash:c=""}=typeof a=="string"?Fa(a):a;return{pathname:l?l.startsWith("/")?l:m4(l,n):n,search:g4(s),hash:v4(c)}}function m4(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 Zd(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 Rx(a){return a.filter((n,l)=>l===0||n.route.path&&n.route.path.length>0)}function Mc(a,n){let l=Rx(a);return n?l.map((s,c)=>c===l.length-1?s.pathname:s.pathnameBase):l.map(s=>s.pathnameBase)}function Ac(a,n,l,s){s===void 0&&(s=!1);let c;typeof a=="string"?c=Fa(a):(c=ct({},a),De(!c.pathname||!c.pathname.includes("?"),Zd("?","pathname","search",c)),De(!c.pathname||!c.pathname.includes("#"),Zd("#","pathname","hash",c)),De(!c.search||!c.search.includes("#"),Zd("#","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 x=f.split("/");for(;x[0]==="..";)x.shift(),b-=1;c.pathname=x.join("/")}p=b>=0?n[b]:"/"}let m=h4(c,p),g=f&&f!=="/"&&f.endsWith("/"),v=(d||f===".")&&l.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}const qa=a=>a.join("/").replace(/\/\/+/g,"/"),p4=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),g4=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,v4=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;class b4 extends Error{}class vc{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 us(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}const Nx=["post","put","patch","delete"],y4=new Set(Nx),x4=["get",...Nx],j4=new Set(x4),S4=new Set([301,302,303,307,308]),w4=new Set([307,308]),Wd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},C4={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Bl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Tm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,E4=a=>({hasErrorBoundary:!!a.hasErrorBoundary}),Mx="remix-router-transitions";function D4(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=E4;let d={},f=gc(a.routes,c,void 0,d),p,m=a.basename||"/",g=a.dataStrategy||M4,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),x=null,j=new Set,D=null,S=null,R=null,E=a.hydrationData!=null,A=Hi(f,a.history.location,m),B=!1,q=null;if(A==null&&!v){let M=cn(404,{pathname:a.history.location.pathname}),{matches:L,route:H}=W0(f);A=L,q={[H.id]:M}}A&&!a.hydrationData&&dt(A,f,a.history.location.pathname).active&&(A=null);let G;if(A)if(A.some(M=>M.route.lazy))G=!1;else if(!A.some(M=>M.route.loader))G=!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);G=A.slice(0,H+1).every(ee=>!sm(ee.route,M,L))}else G=A.every(H=>!sm(H.route,M,L))}else G=a.hydrationData!=null;else if(G=!1,A=[],b.v7_partialHydration){let M=dt(null,f,a.history.location.pathname);M.active&&M.matches&&(B=!0,A=M.matches)}let Q,T={historyAction:a.history.action,location:a.history.location,matches:A,initialized:G,navigation:Wd,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||q,fetchers:new Map,blockers:new Map},O=vt.Pop,W=!1,ae,ne=!1,se=new Map,Ee=null,V=!1,Z=!1,U=[],k=new Set,Y=new Map,te=0,re=-1,ge=new Map,ie=new Set,ce=new Map,Se=new Map,je=new Set,Ue=new Map,Ot=new Map,Dt;function Tt(){if(x=a.history.listen(M=>{let{action:L,location:H,delta:ee}=M;if(Dt){Dt(),Dt=void 0;return}Pl(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=ji({currentLocation:T.location,nextLocation:H,historyAction:L});if(le&&ee!=null){let fe=new Promise(be=>{Dt=be});a.history.go(ee*-1),xa(le,{state:"blocked",location:H,proceed(){xa(le,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),fe.then(()=>a.history.go(ee))},reset(){let be=new Map(T.blockers);be.set(le,Bl),ke({blockers:be})}});return}return Gt(L,H)}),l){I4(n,se);let M=()=>V4(n,se);n.addEventListener("pagehide",M),Ee=()=>n.removeEventListener("pagehide",M)}return T.initialized||Gt(vt.Pop,T.location,{initialHydration:!0}),Q}function Be(){x&&x(),Ee&&Ee(),j.clear(),ae&&ae.abort(),T.fetchers.forEach((M,L)=>Qt(L)),T.blockers.forEach((M,L)=>xi(L))}function Dn(M){return j.add(M),()=>j.delete(M)}function ke(M,L){L===void 0&&(L={}),T=ct({},T,M);let H=[],ee=[];b.v7_fetcherPersist&&T.fetchers.forEach((le,fe)=>{le.state==="idle"&&(je.has(fe)?ee.push(fe):H.push(fe))}),je.forEach(le=>{!T.fetchers.has(le)&&!Y.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=>je.delete(le))}function Ut(M,L,H){var ee,le;let{flushSync:fe}=H===void 0?{}:H,be=T.actionData!=null&&T.navigation.formMethod!=null&&Vn(T.navigation.formMethod)&&T.navigation.state==="loading"&&((ee=M.state)==null?void 0:ee._isRedirect)!==!0,oe;L.actionData?Object.keys(L.actionData).length>0?oe=L.actionData:oe=null:be?oe=T.actionData:oe=null;let he=L.loaderData?K0(T.loaderData,L.loaderData,L.matches||[],L.errors):T.loaderData,ue=T.blockers;ue.size>0&&(ue=new Map(ue),ue.forEach((Ne,Oe)=>ue.set(Oe,Bl)));let me=W===!0||T.navigation.formMethod!=null&&Vn(T.navigation.formMethod)&&((le=M.state)==null?void 0:le._isRedirect)!==!0;p&&(f=p,p=void 0),V||O===vt.Pop||(O===vt.Push?a.history.push(M,M.state):O===vt.Replace&&a.history.replace(M,M.state));let Ce;if(O===vt.Pop){let Ne=se.get(T.location.pathname);Ne&&Ne.has(M.pathname)?Ce={currentLocation:T.location,nextLocation:M}:se.has(M.pathname)&&(Ce={currentLocation:M,nextLocation:T.location})}else if(ne){let Ne=se.get(T.location.pathname);Ne?Ne.add(M.pathname):(Ne=new Set([M.pathname]),se.set(T.location.pathname,Ne)),Ce={currentLocation:T.location,nextLocation:M}}ke(ct({},L,{actionData:oe,loaderData:he,historyAction:O,location:M,initialized:!0,navigation:Wd,revalidation:"idle",restoreScrollPosition:St(M,L.matches||T.matches),preventScrollReset:me,blockers:ue}),{viewTransitionOpts:Ce,flushSync:fe===!0}),O=vt.Pop,W=!1,ne=!1,V=!1,Z=!1,U=[]}async function Vt(M,L){if(typeof M=="number"){a.history.go(M);return}let H=rm(T.location,T.matches,m,b.v7_prependBasename,M,b.v7_relativeSplatPath,L?.fromRouteId,L?.relative),{path:ee,submission:le,error:fe}=P0(b.v7_normalizeFormMethod,!1,H,L),be=T.location,oe=os(T.location,ee,L&&L.state);oe=ct({},oe,a.history.encodeLocation(oe));let he=L&&L.replace!=null?L.replace:void 0,ue=vt.Push;he===!0?ue=vt.Replace:he===!1||le!=null&&Vn(le.formMethod)&&le.formAction===T.location.pathname+T.location.search&&(ue=vt.Replace);let me=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Ce=(L&&L.flushSync)===!0,Ne=ji({currentLocation:be,nextLocation:oe,historyAction:ue});if(Ne){xa(Ne,{state:"blocked",location:oe,proceed(){xa(Ne,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),Vt(M,L)},reset(){let Oe=new Map(T.blockers);Oe.set(Ne,Bl),ke({blockers:Oe})}});return}return await Gt(ue,oe,{submission:le,pendingError:fe,preventScrollReset:me,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Ce})}function ea(){if(rt(),ke({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){Gt(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}Gt(O||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ne===!0})}}async function Gt(M,L,H){ae&&ae.abort(),ae=null,O=M,V=(H&&H.startUninterruptedRevalidation)===!0,hn(T.location,T.matches),W=(H&&H.preventScrollReset)===!0,ne=(H&&H.enableViewTransition)===!0;let ee=p||f,le=H&&H.overrideNavigation,fe=H!=null&&H.initialHydration&&T.matches&&T.matches.length>0&&!B?T.matches:Hi(ee,L,m),be=(H&&H.flushSync)===!0;if(fe&&T.initialized&&!Z&&z4(T.location,L)&&!(H&&H.submission&&Vn(H.submission.formMethod))){Ut(L,{matches:fe},{flushSync:be});return}let oe=dt(fe,ee,L.pathname);if(oe.active&&oe.matches&&(fe=oe.matches),!fe){let{error:Ge,notFoundMatches:_e,route:Ie}=ja(L.pathname);Ut(L,{matches:_e,loaderData:{},errors:{[Ie.id]:Ge}},{flushSync:be});return}ae=new AbortController;let he=$l(a.history,L,ae.signal,H&&H.submission),ue;if(H&&H.pendingError)ue=[Pi(fe).route.id,{type:Ke.error,error:H.pendingError}];else if(H&&H.submission&&Vn(H.submission.formMethod)){let Ge=await Xt(he,L,H.submission,fe,oe.active,{replace:H.replace,flushSync:be});if(Ge.shortCircuited)return;if(Ge.pendingActionResult){let[_e,Ie]=Ge.pendingActionResult;if(wn(Ie)&&us(Ie.error)&&Ie.error.status===404){ae=null,Ut(L,{matches:Ge.matches,loaderData:{},errors:{[_e]:Ie.error}});return}}fe=Ge.matches||fe,ue=Ge.pendingActionResult,le=Jd(L,H.submission),be=!1,oe.active=!1,he=$l(a.history,he.url,he.signal)}let{shortCircuited:me,matches:Ce,loaderData:Ne,errors:Oe}=await Zi(he,L,fe,oe.active,le,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,be,ue);me||(ae=null,Ut(L,ct({matches:Ce||fe},Z0(ue),{loaderData:Ne,errors:Oe})))}async function Xt(M,L,H,ee,le,fe){fe===void 0&&(fe={}),rt();let be=P4(L,H);if(ke({navigation:be},{flushSync:fe.flushSync===!0}),le){let ue=await Rt(ee,L.pathname,M.signal);if(ue.type==="aborted")return{shortCircuited:!0};if(ue.type==="error"){let me=Pi(ue.partialMatches).route.id;return{matches:ue.partialMatches,pendingActionResult:[me,{type:Ke.error,error:ue.error}]}}else if(ue.matches)ee=ue.matches;else{let{notFoundMatches:me,error:Ce,route:Ne}=ja(L.pathname);return{matches:me,pendingActionResult:[Ne.id,{type:Ke.error,error:Ce}]}}}let oe,he=ts(ee,L);if(!he.route.action&&!he.route.lazy)oe={type:Ke.error,error:cn(405,{method:M.method,pathname:L.pathname,routeId:he.route.id})};else if(oe=(await va("action",T,M,[he],ee,null))[he.route.id],M.signal.aborted)return{shortCircuited:!0};if(ki(oe)){let ue;return fe&&fe.replace!=null?ue=fe.replace:ue=Y0(oe.response.headers.get("Location"),new URL(M.url),m)===T.location.pathname+T.location.search,await Tn(M,oe,!0,{submission:H,replace:ue}),{shortCircuited:!0}}if(pi(oe))throw cn(400,{type:"defer-action"});if(wn(oe)){let ue=Pi(ee,he.route.id);return(fe&&fe.replace)!==!0&&(O=vt.Push),{matches:ee,pendingActionResult:[ue.route.id,oe]}}return{matches:ee,pendingActionResult:[he.route.id,oe]}}async function Zi(M,L,H,ee,le,fe,be,oe,he,ue,me){let Ce=le||Jd(L,fe),Ne=fe||be||eb(Ce),Oe=!V&&(!b.v7_partialHydration||!he);if(ee){if(Oe){let Ye=ga(me);ke(ct({navigation:Ce},Ye!==void 0?{actionData:Ye}:{}),{flushSync:ue})}let ze=await Rt(H,L.pathname,M.signal);if(ze.type==="aborted")return{shortCircuited:!0};if(ze.type==="error"){let Ye=Pi(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:la,route:Sa}=ja(L.pathname);return{matches:la,loaderData:{},errors:{[Sa.id]:Ye}}}}let Ge=p||f,[_e,Ie]=I0(a.history,T,H,Ne,L,b.v7_partialHydration&&he===!0,b.v7_skipActionErrorRevalidation,Z,U,k,je,ce,ie,Ge,m,me);if(nt(ze=>!(H&&H.some(Ye=>Ye.route.id===ze))||_e&&_e.some(Ye=>Ye.route.id===ze)),re=++te,_e.length===0&&Ie.length===0){let ze=nn();return Ut(L,ct({matches:H,loaderData:{},errors:me&&wn(me[1])?{[me[0]]:me[1].error}:null},Z0(me),ze?{fetchers:new Map(T.fetchers)}:{}),{flushSync:ue}),{shortCircuited:!0}}if(Oe){let ze={};if(!ee){ze.navigation=Ce;let Ye=ga(me);Ye!==void 0&&(ze.actionData=Ye)}Ie.length>0&&(ze.fetchers=fn(Ie)),ke(ze,{flushSync:ue})}Ie.forEach(ze=>{Kt(ze.key),ze.controller&&Y.set(ze.key,ze.controller)});let mn=()=>Ie.forEach(ze=>Kt(ze.key));ae&&ae.signal.addEventListener("abort",mn);let{loaderResults:Si,fetcherResults:Rn}=await ta(T,H,_e,Ie,M);if(M.signal.aborted)return{shortCircuited:!0};ae&&ae.signal.removeEventListener("abort",mn),Ie.forEach(ze=>Y.delete(ze.key));let pn=Fo(Si);if(pn)return await Tn(M,pn.result,!0,{replace:oe}),{shortCircuited:!0};if(pn=Fo(Rn),pn)return ie.add(pn.key),await Tn(M,pn.result,!0,{replace:oe}),{shortCircuited:!0};let{loaderData:er,errors:ia}=Q0(T,H,Si,me,Ie,Rn,Ue);Ue.forEach((ze,Ye)=>{ze.subscribe(la=>{(la||ze.done)&&Ue.delete(Ye)})}),b.v7_partialHydration&&he&&T.errors&&(ia=ct({},T.errors,ia));let Nn=nn(),an=na(re),ka=Nn||an||Ie.length>0;return ct({matches:H,loaderData:er,errors:ia},ka?{fetchers:new Map(T.fetchers)}:{})}function ga(M){if(M&&!wn(M[1]))return{[M[0]]:M[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function fn(M){return M.forEach(L=>{let H=T.fetchers.get(L.key),ee=Xr(void 0,H?H.data:void 0);T.fetchers.set(L.key,ee)}),new Map(T.fetchers)}function Hn(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,fe=p||f,be=rm(T.location,T.matches,m,b.v7_prependBasename,H,b.v7_relativeSplatPath,L,ee?.relative),oe=Hi(fe,be,m),he=dt(oe,fe,be);if(he.active&&he.matches&&(oe=he.matches),!oe){Ve(M,L,cn(404,{pathname:be}),{flushSync:le});return}let{path:ue,submission:me,error:Ce}=P0(b.v7_normalizeFormMethod,!0,be,ee);if(Ce){Ve(M,L,Ce,{flushSync:le});return}let Ne=ts(oe,ue),Oe=(ee&&ee.preventScrollReset)===!0;if(me&&Vn(me.formMethod)){Pa(M,L,ue,Ne,oe,he.active,le,Oe,me);return}ce.set(M,{routeId:L,path:ue}),bi(M,L,ue,Ne,oe,he.active,le,Oe,me)}async function Pa(M,L,H,ee,le,fe,be,oe,he){rt(),ce.delete(M);function ue(ft){if(!ft.route.action&&!ft.route.lazy){let wa=cn(405,{method:he.formMethod,pathname:H,routeId:L});return Ve(M,L,wa,{flushSync:be}),!0}return!1}if(!fe&&ue(ee))return;let me=T.fetchers.get(M);st(M,k4(he,me),{flushSync:be});let Ce=new AbortController,Ne=$l(a.history,H,Ce.signal,he);if(fe){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:be});return}else if(ft.matches){if(le=ft.matches,ee=ts(le,H),ue(ee))return}else{Ve(M,L,cn(404,{pathname:H}),{flushSync:be});return}}Y.set(M,Ce);let Oe=te,_e=(await va("action",T,Ne,[ee],le,M))[ee.route.id];if(Ne.signal.aborted){Y.get(M)===Ce&&Y.delete(M);return}if(b.v7_fetcherPersist&&je.has(M)){if(ki(_e)||wn(_e)){st(M,fi(void 0));return}}else{if(ki(_e))if(Y.delete(M),re>Oe){st(M,fi(void 0));return}else return ie.add(M),st(M,Xr(he)),Tn(Ne,_e,!1,{fetcherSubmission:he,preventScrollReset:oe});if(wn(_e)){Ve(M,L,_e.error);return}}if(pi(_e))throw cn(400,{type:"defer-action"});let Ie=T.navigation.location||T.location,mn=$l(a.history,Ie,Ce.signal),Si=p||f,Rn=T.navigation.state!=="idle"?Hi(Si,T.navigation.location,m):T.matches;De(Rn,"Didn't find any matches after fetcher action");let pn=++te;ge.set(M,pn);let er=Xr(he,_e.data);T.fetchers.set(M,er);let[ia,Nn]=I0(a.history,T,Rn,he,Ie,!1,b.v7_skipActionErrorRevalidation,Z,U,k,je,ce,ie,Si,m,[ee.route.id,_e]);Nn.filter(ft=>ft.key!==M).forEach(ft=>{let wa=ft.key,Zt=T.fetchers.get(wa),Ms=Xr(void 0,Zt?Zt.data:void 0);T.fetchers.set(wa,Ms),Kt(wa),ft.controller&&Y.set(wa,ft.controller)}),ke({fetchers:new Map(T.fetchers)});let an=()=>Nn.forEach(ft=>Kt(ft.key));Ce.signal.addEventListener("abort",an);let{loaderResults:ka,fetcherResults:ze}=await ta(T,Rn,ia,Nn,mn);if(Ce.signal.aborted)return;Ce.signal.removeEventListener("abort",an),ge.delete(M),Y.delete(M),Nn.forEach(ft=>Y.delete(ft.key));let Ye=Fo(ka);if(Ye)return Tn(mn,Ye.result,!1,{preventScrollReset:oe});if(Ye=Fo(ze),Ye)return ie.add(Ye.key),Tn(mn,Ye.result,!1,{preventScrollReset:oe});let{loaderData:la,errors:Sa}=Q0(T,Rn,ka,void 0,Nn,ze,Ue);if(T.fetchers.has(M)){let ft=fi(_e.data);T.fetchers.set(M,ft)}na(pn),T.navigation.state==="loading"&&pn>re?(De(O,"Expected pending action"),ae&&ae.abort(),Ut(T.navigation.location,{matches:Rn,loaderData:la,errors:Sa,fetchers:new Map(T.fetchers)})):(ke({errors:Sa,loaderData:K0(T.loaderData,la,Rn,Sa),fetchers:new Map(T.fetchers)}),Z=!1)}async function bi(M,L,H,ee,le,fe,be,oe,he){let ue=T.fetchers.get(M);st(M,Xr(he,ue?ue.data:void 0),{flushSync:be});let me=new AbortController,Ce=$l(a.history,H,me.signal);if(fe){let _e=await Rt(le,new URL(Ce.url).pathname,Ce.signal,M);if(_e.type==="aborted")return;if(_e.type==="error"){Ve(M,L,_e.error,{flushSync:be});return}else if(_e.matches)le=_e.matches,ee=ts(le,H);else{Ve(M,L,cn(404,{pathname:H}),{flushSync:be});return}}Y.set(M,me);let Ne=te,Ge=(await va("loader",T,Ce,[ee],le,M))[ee.route.id];if(pi(Ge)&&(Ge=await Rm(Ge,Ce.signal,!0)||Ge),Y.get(M)===me&&Y.delete(M),!Ce.signal.aborted){if(je.has(M)){st(M,fi(void 0));return}if(ki(Ge))if(re>Ne){st(M,fi(void 0));return}else{ie.add(M),await Tn(Ce,Ge,!1,{preventScrollReset:oe});return}if(wn(Ge)){Ve(M,L,Ge.error);return}De(!pi(Ge),"Unhandled fetcher deferred data"),st(M,fi(Ge.data))}}async function Tn(M,L,H,ee){let{submission:le,fetcherSubmission:fe,preventScrollReset:be,replace:oe}=ee===void 0?{}:ee;L.response.headers.has("X-Remix-Revalidate")&&(Z=!0);let he=L.response.headers.get("Location");De(he,"Expected a Location header on the redirect Response"),he=Y0(he,new URL(M.url),m);let ue=os(T.location,he,{_isRedirect:!0});if(l){let _e=!1;if(L.response.headers.has("X-Remix-Reload-Document"))_e=!0;else if(Tm.test(he)){const Ie=a.history.createURL(he);_e=Ie.origin!==n.location.origin||Xn(Ie.pathname,m)==null}if(_e){oe?n.location.replace(he):n.location.assign(he);return}}ae=null;let me=oe===!0||L.response.headers.has("X-Remix-Replace")?vt.Replace:vt.Push,{formMethod:Ce,formAction:Ne,formEncType:Oe}=T.navigation;!le&&!fe&&Ce&&Ne&&Oe&&(le=eb(T.navigation));let Ge=le||fe;if(w4.has(L.response.status)&&Ge&&Vn(Ge.formMethod))await Gt(me,ue,{submission:ct({},Ge,{formAction:he}),preventScrollReset:be||W,enableViewTransition:H?ne:void 0});else{let _e=Jd(ue,le);await Gt(me,ue,{overrideNavigation:_e,fetcherSubmission:fe,preventScrollReset:be||W,enableViewTransition:H?ne:void 0})}}async function va(M,L,H,ee,le,fe){let be,oe={};try{be=await A4(g,M,L,H,ee,le,fe,d,c)}catch(he){return ee.forEach(ue=>{oe[ue.route.id]={type:Ke.error,error:he}}),oe}for(let[he,ue]of Object.entries(be))if(B4(ue)){let me=ue.result;oe[he]={type:Ke.redirect,response:O4(me,H,he,le,m,b.v7_relativeSplatPath)}}else oe[he]=await L4(ue);return oe}async function ta(M,L,H,ee,le){let fe=M.matches,be=va("loader",M,le,H,L,null),oe=Promise.all(ee.map(async me=>{if(me.matches&&me.match&&me.controller){let Ne=(await va("loader",M,$l(a.history,me.path,me.controller.signal),[me.match],me.matches,me.key))[me.match.route.id];return{[me.key]:Ne}}else return Promise.resolve({[me.key]:{type:Ke.error,error:cn(404,{pathname:me.path})}})})),he=await be,ue=(await oe).reduce((me,Ce)=>Object.assign(me,Ce),{});return await Promise.all([F4(L,he,le.signal,fe,M.loaderData),H4(L,ue,ee)]),{loaderResults:he,fetcherResults:ue}}function rt(){Z=!0,U.push(...nt()),ce.forEach((M,L)=>{Y.has(L)&&k.add(L),Kt(L)})}function st(M,L,H){H===void 0&&(H={}),T.fetchers.set(M,L),ke({fetchers:new Map(T.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function Ve(M,L,H,ee){ee===void 0&&(ee={});let le=Pi(T.matches,L);Qt(M),ke({errors:{[le.route.id]:H},fetchers:new Map(T.fetchers)},{flushSync:(ee&&ee.flushSync)===!0})}function yi(M){return Se.set(M,(Se.get(M)||0)+1),je.has(M)&&je.delete(M),T.fetchers.get(M)||C4}function Qt(M){let L=T.fetchers.get(M);Y.has(M)&&!(L&&L.state==="loading"&&ge.has(M))&&Kt(M),ce.delete(M),ge.delete(M),ie.delete(M),b.v7_fetcherPersist&&je.delete(M),k.delete(M),T.fetchers.delete(M)}function Wi(M){let L=(Se.get(M)||0)-1;L<=0?(Se.delete(M),je.add(M),b.v7_fetcherPersist||Qt(M)):Se.set(M,L),ke({fetchers:new Map(T.fetchers)})}function Kt(M){let L=Y.get(M);L&&(L.abort(),Y.delete(M))}function ba(M){for(let L of M){let H=yi(L),ee=fi(H.data);T.fetchers.set(L,ee)}}function nn(){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 ba(M),L}function na(M){let L=[];for(let[H,ee]of ge)if(ee<M){let le=T.fetchers.get(H);De(le,"Expected fetcher: "+H),le.state==="loading"&&(Kt(H),ge.delete(H),L.push(H))}return ba(L),L.length>0}function ya(M,L){let H=T.blockers.get(M)||Bl;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)||Bl;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),ke({blockers:ee})}function ji(M){let{currentLocation:L,nextLocation:H,historyAction:ee}=M;if(Ot.size===0)return;Ot.size>1&&Pl(!1,"A router only supports one blocker at a time");let le=Array.from(Ot.entries()),[fe,be]=le[le.length-1],oe=T.blockers.get(fe);if(!(oe&&oe.state==="proceeding")&&be({currentLocation:L,nextLocation:H,historyAction:ee}))return fe}function ja(M){let L=cn(404,{pathname:M}),H=p||f,{matches:ee,route:le}=W0(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,S=H||null,!E&&T.navigation===Wd){E=!0;let ee=St(T.location,T.matches);ee!=null&&ke({restoreScrollPosition:ee})}return()=>{D=null,R=null,S=null}}function jt(M,L){return S&&S(M,L.map(ee=>Cx(ee,T.loaderData)))||M.key}function hn(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:hc(L,H,m,!0)}}else return{active:!0,matches:hc(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 fe=p==null,be=p||f,oe=d;try{await v({signal:H,path:L,matches:le,fetcherKey:ee,patch:(me,Ce)=>{H.aborted||G0(me,Ce,be,oe,c)}})}catch(me){return{type:"error",error:me,partialMatches:le}}finally{fe&&!H.aborted&&(f=[...f])}if(H.aborted)return{type:"aborted"};let he=Hi(be,L,m);if(he)return{type:"success",matches:he};let ue=hc(be,L,m,!0);if(!ue||le.length===ue.length&&le.every((me,Ce)=>me.route.id===ue[Ce].route.id))return{type:"success",matches:null};le=ue}}function aa(M){d={},p=gc(M,c,void 0,d)}function Ze(M,L){let H=p==null;G0(M,L,p||f,d,c),H&&(f=[...f],ke({}))}return Q={get basename(){return m},get future(){return b},get state(){return T},get routes(){return f},get window(){return n},initialize:Tt,subscribe:Dn,enableScrollRestoration:zt,navigate:Vt,fetch:Hn,revalidate:ea,createHref:M=>a.history.createHref(M),encodeLocation:M=>a.history.encodeLocation(M),getFetcher:yi,deleteFetcher:Wi,dispose:Be,getBlocker:ya,deleteBlocker:xi,patchRoutes:Ze,_internalFetchControllers:Y,_internalActiveDeferreds:Ue,_internalSetRoutes:aa},Q}function T4(a){return a!=null&&("formData"in a&&a.formData!=null||"body"in a&&a.body!==void 0)}function rm(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=Ac(c||".",Mc(m,d),Xn(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=Nm(v.search);if(g.route.index&&!b)v.search=v.search?v.search.replace(/^\?/,"?index&"):"?index";else if(!g.route.index&&b){let x=new URLSearchParams(v.search),j=x.getAll("index");x.delete("index"),j.filter(S=>S).forEach(S=>x.append("index",S));let D=x.toString();v.search=D?"?"+D:""}}return s&&l!=="/"&&(v.pathname=v.pathname==="/"?l:qa([l,v.pathname])),Ii(v)}function P0(a,n,l,s){if(!s||!T4(s))return{path:l};if(s.formMethod&&!q4(s.formMethod))return{path:l,error:cn(405,{method:s.formMethod})};let c=()=>({path:l,error:cn(400,{type:"invalid-body"})}),d=s.formMethod||"get",f=a?d.toUpperCase():d.toLowerCase(),p=Lx(l);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!Vn(f))return c();let x=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((j,D)=>{let[S,R]=D;return""+j+S+"="+R+`
|
|
35
|
-
`},""):String(s.body);return{path:l,submission:{formMethod:f,formAction:p,formEncType:s.formEncType,formData:void 0,json:void 0,text:x}}}else if(s.formEncType==="application/json"){if(!Vn(f))return c();try{let x=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:x,text:void 0}}}catch{return c()}}}De(typeof FormData=="function","FormData is not available in this environment");let m,g;if(s.formData)m=om(s.formData),g=s.formData;else if(s.body instanceof FormData)m=om(s.body),g=s.body;else if(s.body instanceof URLSearchParams)m=s.body,g=X0(m);else if(s.body==null)m=new URLSearchParams,g=new FormData;else try{m=new URLSearchParams(s.body),g=X0(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(Vn(v.formMethod))return{path:l,submission:v};let b=Fa(l);return n&&b.search&&Nm(b.search)&&m.append("index",""),b.search="?"+m,{path:Ii(b),submission:v}}function k0(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,x,j,D,S){let R=S?wn(S[1])?S[1].error:S[1].data:void 0,E=a.createURL(n.location),A=a.createURL(c),B=l;d&&n.errors?B=k0(l,Object.keys(n.errors)[0],!0):S&&wn(S[1])&&(B=k0(l,S[0]));let q=S?S[1].statusCode:void 0,G=f&&q&&q>=400,Q=B.filter((O,W)=>{let{route:ae}=O;if(ae.lazy)return!0;if(ae.loader==null)return!1;if(d)return sm(ae,n.loaderData,n.errors);if(R4(n.loaderData,n.matches[W],O)||m.some(Ee=>Ee===O.route.id))return!0;let ne=n.matches[W],se=O;return V0(O,ct({currentUrl:E,currentParams:ne.params,nextUrl:A,nextParams:se.params},s,{actionResult:R,actionStatus:q,defaultShouldRevalidate:G?!1:p||E.pathname+E.search===A.pathname+A.search||E.search!==A.search||Ax(ne,se)}))}),T=[];return b.forEach((O,W)=>{if(d||!l.some(V=>V.route.id===O.routeId)||v.has(W))return;let ae=Hi(j,O.path,D);if(!ae){T.push({key:W,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let ne=n.fetchers.get(W),se=ts(ae,O.path),Ee=!1;x.has(W)?Ee=!1:g.has(W)?(g.delete(W),Ee=!0):ne&&ne.state!=="idle"&&ne.data===void 0?Ee=p:Ee=V0(se,ct({currentUrl:E,currentParams:n.matches[n.matches.length-1].params,nextUrl:A,nextParams:l[l.length-1].params},s,{actionResult:R,actionStatus:q,defaultShouldRevalidate:G?!1:p})),Ee&&T.push({key:W,routeId:O.routeId,path:O.path,matches:ae,match:se,controller:new AbortController})}),[Q,T]}function sm(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 R4(a,n,l){let s=!n||l.route.id!==n.route.id,c=a[l.route.id]===void 0;return s||c}function Ax(a,n){let l=a.route.path;return a.pathname!==n.pathname||l!=null&&l.endsWith("*")&&a.params["*"]!==n.params["*"]}function V0(a,n){if(a.route.shouldRevalidate){let l=a.route.shouldRevalidate(n);if(typeof l=="boolean")return l}return n.defaultShouldRevalidate}function G0(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=>$x(g,v))),m=gc(p,c,[a||"_","patch",String(((d=f)==null?void 0:d.length)||"0")],s);f.push(...m)}function $x(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=>$x(l,d))}):!1}async function N4(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";Pl(!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&&!e4.has(f)&&(d[f]=s[f])}Object.assign(c,d),Object.assign(c,ct({},n(c),{lazy:void 0}))}async function M4(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 A4(a,n,l,s,c,d,f,p,m,g){let v=d.map(j=>j.route.lazy?N4(j.route,m,p):void 0),b=d.map((j,D)=>{let S=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?$4(n,s,j,S,A,g):Promise.resolve({type:Ke.data,result:void 0}))})}),x=await a({matches:b,request:s,params:d[0].params,fetcherKey:f,context:g});try{await Promise.all(v)}catch{}return x}async function $4(a,n,l,s,c,d){let f,p,m=g=>{let v,b=new Promise((D,S)=>v=S);p=()=>v(),n.signal.addEventListener("abort",p);let x=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(S=>x(S)):x())}}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(x=>{v=x}),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 cn(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 cn(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 L4(a){let{result:n,type:l}=a;if(Ox(n)){let b;try{let x=n.headers.get("Content-Type");x&&/\bapplication\/json\b/.test(x)?n.body==null?b=null:b=await n.json():b=await n.text()}catch(x){return{type:Ke.error,error:x}}return l===Ke.error?{type:Ke.error,error:new vc(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(J0(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 vc(((s=n.init)==null?void 0:s.status)||500,void 0,n.data),statusCode:us(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:us(n)?n.status:void 0}}if(_4(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(J0(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 O4(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"),!Tm.test(f)){let p=s.slice(0,s.findIndex(m=>m.route.id===l)+1);f=rm(new URL(n.url),p,c,!0,f,d),a.headers.set("Location",f)}return a}function Y0(a,n,l){if(Tm.test(a)){let s=a,c=s.startsWith("//")?new URL(n.protocol+s):new URL(s),d=Xn(c.pathname,l)!=null;if(c.origin===n.origin&&d)return c.pathname+c.search+c.hash}return a}function $l(a,n,l,s){let c=a.createURL(Lx(n)).toString(),d={signal:l};if(s&&Vn(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=om(s.formData):d.body=s.formData}return new Request(c,d)}function om(a){let n=new URLSearchParams;for(let[l,s]of a.entries())n.append(l,typeof s=="string"?s:s.name);return n}function X0(a){let n=new FormData;for(let[l,s]of a.entries())n.append(l,s);return n}function U4(a,n,l,s,c){let d={},f=null,p,m=!1,g={},v=l&&wn(l[1])?l[1].error:void 0;return a.forEach(b=>{if(!(b.route.id in n))return;let x=b.route.id,j=n[x];if(De(!ki(j),"Cannot handle redirect results in processLoaderData"),wn(j)){let D=j.error;v!==void 0&&(D=v,v=void 0),f=f||{};{let S=Pi(a,x);f[S.route.id]==null&&(f[S.route.id]=D)}d[x]=void 0,m||(m=!0,p=us(j.error)?j.error.status:500),j.headers&&(g[x]=j.headers)}else pi(j)?(s.set(x,j.deferredData),d[x]=j.deferredData.data,j.statusCode!=null&&j.statusCode!==200&&!m&&(p=j.statusCode),j.headers&&(g[x]=j.headers)):(d[x]=j.data,j.statusCode&&j.statusCode!==200&&!m&&(p=j.statusCode),j.headers&&(g[x]=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 Q0(a,n,l,s,c,d,f){let{loaderData:p,errors:m}=U4(n,l,s,f);return c.forEach(g=>{let{key:v,match:b,controller:x}=g,j=d[v];if(De(j,"Did not find corresponding fetcher result"),!(x&&x.signal.aborted))if(wn(j)){let D=Pi(a.matches,b?.route.id);m&&m[D.route.id]||(m=ct({},m,{[D.route.id]:j.error})),a.fetchers.delete(v)}else if(ki(j))De(!1,"Unhandled fetcher revalidation redirect");else if(pi(j))De(!1,"Unhandled fetcher deferred data");else{let D=fi(j.data);a.fetchers.set(v,D)}}),{loaderData:p,errors:m}}function K0(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 Z0(a){return a?wn(a[1])?{actionData:{}}:{actionData:{[a[0]]:a[1].data}}:{}}function Pi(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 W0(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 cn(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 vc(a||500,p,new Error(m),!0)}function Fo(a){let n=Object.entries(a);for(let l=n.length-1;l>=0;l--){let[s,c]=n[l];if(ki(c))return{key:s,result:c}}}function Lx(a){let n=typeof a=="string"?Fa(a):a;return Ii(ct({},n,{hash:""}))}function z4(a,n){return a.pathname!==n.pathname||a.search!==n.search?!1:a.hash===""?n.hash!=="":a.hash===n.hash?!0:n.hash!==""}function B4(a){return Ox(a.result)&&S4.has(a.result.status)}function pi(a){return a.type===Ke.deferred}function wn(a){return a.type===Ke.error}function ki(a){return(a&&a.type)===Ke.redirect}function J0(a){return typeof a=="object"&&a!=null&&"type"in a&&"data"in a&&"init"in a&&a.type==="DataWithResponseInit"}function _4(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 Ox(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.headers=="object"&&typeof a.body<"u"}function q4(a){return j4.has(a.toLowerCase())}function Vn(a){return y4.has(a.toLowerCase())}async function F4(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(x=>x?.route.id===p);if(!g)continue;let v=s.find(x=>x.route.id===g.route.id),b=v!=null&&!Ax(v,g)&&(c&&c[g.route.id])!==void 0;pi(m)&&b&&await Rm(m,l,!1).then(x=>{x&&(n[p]=x)})}}async function H4(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)&&pi(p)&&(De(f,"Expected an AbortController for revalidating fetcher deferred result"),await Rm(p,f.signal,!0).then(g=>{g&&(n[c]=g)}))}}async function Rm(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 Nm(a){return new URLSearchParams(a).getAll("index").some(n=>n==="")}function ts(a,n){let l=typeof n=="string"?Fa(n).search:n.search;if(a[a.length-1].route.index&&Nm(l||""))return a[a.length-1];let s=Rx(a);return s[s.length-1]}function eb(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 Jd(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 P4(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 Xr(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 k4(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 fi(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(Mx);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 V4(a,n){if(n.size>0){let l={};for(let[s,c]of n)l[s]=[...c];try{a.sessionStorage.setItem(Mx,JSON.stringify(l))}catch(s){Pl(!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 de=await C("react");function Vi(){return Vi=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},Vi.apply(this,arguments)}const xs=de.createContext(null),Mm=de.createContext(null),tb=de.createContext(null),Ha=de.createContext(null),$c=de.createContext(null),ma=de.createContext({outlet:null,matches:[],isDataRoute:!1}),Ux=de.createContext(null);function G4(a,n){let{relative:l}=n===void 0?{}:n;Xi()||De(!1);let{basename:s,navigator:c}=de.useContext(Ha),{hash:d,pathname:f,search:p}=Lc(a,{relative:l}),m=f;return s!=="/"&&(m=f==="/"?s:qa([s,f])),c.createHref({pathname:m,search:p,hash:d})}function Xi(){return de.useContext($c)!=null}function Qi(){return Xi()||De(!1),de.useContext($c).location}function nb(a){Xi()||De(!1);let{pathname:n}=Qi();return de.useMemo(()=>cs(a,Tx(n)),[n,a])}function zx(a){de.useContext(Ha).static||de.useLayoutEffect(a)}function un(){let{isDataRoute:a}=de.useContext(ma);return a?sC():Y4()}function Y4(){Xi()||De(!1);let a=de.useContext(xs),{basename:n,future:l,navigator:s}=de.useContext(Ha),{matches:c}=de.useContext(ma),{pathname:d}=Qi(),f=JSON.stringify(Mc(c,l.v7_relativeSplatPath)),p=de.useRef(!1);return zx(()=>{p.current=!0}),de.useCallback(function(g,v){if(v===void 0&&(v={}),!p.current)return;if(typeof g=="number"){s.go(g);return}let b=Ac(g,JSON.parse(f),d,v.relative==="path");a==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:qa([n,b.pathname])),(v.replace?s.replace:s.push)(b,v.state,v)},[n,s,f,d,a])}const X4=de.createContext(null);function Q4(a){let n=de.useContext(ma).outlet;return n&&de.createElement(X4.Provider,{value:a},n)}function Ki(){let{matches:a}=de.useContext(ma),n=a[a.length-1];return n?n.params:{}}function Lc(a,n){let{relative:l}=n===void 0?{}:n,{future:s}=de.useContext(Ha),{matches:c}=de.useContext(ma),{pathname:d}=Qi(),f=JSON.stringify(Mc(c,s.v7_relativeSplatPath));return de.useMemo(()=>Ac(a,JSON.parse(f),d,l==="path"),[a,f,d,l])}function K4(a,n){return Bx(a,n)}function Bx(a,n,l,s){Xi()||De(!1);let{navigator:c,static:d}=de.useContext(Ha),{matches:f}=de.useContext(ma),p=f[f.length-1],m=p?p.params:{};p&&p.pathname;let g=p?p.pathnameBase:"/";p&&p.route;let v=Qi(),b;if(n){var x;let E=typeof n=="string"?Fa(n):n;g==="/"||(x=E.pathname)!=null&&x.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 S=!d&&l&&l.matches&&l.matches.length>0?l.matches:Hi(a,{pathname:D}),R=tC(S&&S.map(E=>Object.assign({},E,{params:Object.assign({},m,E.params),pathname:qa([g,c.encodeLocation?c.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?g:qa([g,c.encodeLocation?c.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),f,l,s);return n&&R?de.createElement($c.Provider,{value:{location:Vi({pathname:"/",search:"",hash:"",state:null,key:"default"},b),navigationType:vt.Pop}},R):R}function Z4(){let a=iC(),n=us(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 de.createElement(de.Fragment,null,de.createElement("h2",null,"Unexpected Application Error!"),de.createElement("h3",{style:{fontStyle:"italic"}},n),l?de.createElement("pre",{style:c},l):null,null)}const W4=de.createElement(Z4,null);class J4 extends de.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?de.createElement(ma.Provider,{value:this.props.routeContext},de.createElement(Ux.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function eC(a){let{routeContext:n,match:l,children:s}=a,c=de.useContext(xs);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),de.createElement(ma.Provider,{value:n},s)}function tC(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:x,errors:j}=l,D=b.route.loader&&x[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,x)=>{let j,D=!1,S=null,R=null;l&&(j=p&&b.route.id?p[b.route.id]:void 0,S=b.route.errorElement||W4,m&&(g<0&&x===0?(oC("route-fallback"),D=!0,R=null):g===x&&(D=!0,R=b.route.hydrateFallbackElement||null)));let E=n.concat(f.slice(0,x+1)),A=()=>{let B;return j?B=S:D?B=R:b.route.Component?B=de.createElement(b.route.Component,null):b.route.element?B=b.route.element:B=v,de.createElement(eC,{match:b,routeContext:{outlet:v,matches:E,isDataRoute:l!=null},children:B})};return l&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?de.createElement(J4,{location:l.location,revalidation:l.revalidation,component:S,error:j,children:A(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):A()},null)}var Am=function(a){return a.UseBlocker="useBlocker",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a}(Am||{}),_x=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}(_x||{});function qx(a){let n=de.useContext(xs);return n||De(!1),n}function $m(a){let n=de.useContext(Mm);return n||De(!1),n}function nC(a){let n=de.useContext(ma);return n||De(!1),n}function Fx(a){let n=nC(),l=n.matches[n.matches.length-1];return l.route.id||De(!1),l.route.id}function aC(){let{matches:a,loaderData:n}=$m();return de.useMemo(()=>a.map(l=>Cx(l,n)),[a,n])}function iC(){var a;let n=de.useContext(Ux),l=$m(_x.UseRouteError),s=Fx();return n!==void 0?n:(a=l.errors)==null?void 0:a[s]}let lC=0;function rC(a){let{router:n,basename:l}=qx(Am.UseBlocker),s=$m(),[c,d]=de.useState(""),f=de.useCallback(p=>{if(typeof a!="function")return!!a;if(l==="/")return a(p);let{currentLocation:m,nextLocation:g,historyAction:v}=p;return a({currentLocation:Vi({},m,{pathname:Xn(m.pathname,l)||m.pathname}),nextLocation:Vi({},g,{pathname:Xn(g.pathname,l)||g.pathname}),historyAction:v})},[l,a]);return de.useEffect(()=>{let p=String(++lC);return d(p),()=>n.deleteBlocker(p)},[n]),de.useEffect(()=>{c!==""&&n.getBlocker(c,f)},[n,c,f]),c&&s.blockers.has(c)?s.blockers.get(c):Bl}function sC(){let{router:a}=qx(Am.UseNavigateStable),n=Fx(),l=de.useRef(!1);return zx(()=>{l.current=!0}),de.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?a.navigate(c):a.navigate(c,Vi({fromRouteId:n},d)))},[a,n])}const ab={};function oC(a,n,l){ab[a]||(ab[a]=!0)}function cC(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 uC="startTransition";de[uC];function Lm(a){let{to:n,replace:l,state:s,relative:c}=a;Xi()||De(!1);let{future:d,static:f}=de.useContext(Ha),{matches:p}=de.useContext(ma),{pathname:m}=Qi(),g=un(),v=Ac(n,Mc(p,d.v7_relativeSplatPath),m,c==="path"),b=JSON.stringify(v);return de.useEffect(()=>g(JSON.parse(b),{replace:l,state:s,relative:c}),[g,b,c,l,s]),null}function vi(a){return Q4(a.context)}function ds(a){De(!1)}function dC(a){let{basename:n="/",children:l=null,location:s,navigationType:c=vt.Pop,navigator:d,static:f=!1,future:p}=a;Xi()&&De(!1);let m=n.replace(/^\/*/,"/"),g=de.useMemo(()=>({basename:m,navigator:d,static:f,future:Vi({v7_relativeSplatPath:!1},p)}),[m,p,d,f]);typeof s=="string"&&(s=Fa(s));let{pathname:v="/",search:b="",hash:x="",state:j=null,key:D="default"}=s,S=de.useMemo(()=>{let R=Xn(v,m);return R==null?null:{location:{pathname:R,search:b,hash:x,state:j,key:D},navigationType:c}},[m,v,b,x,j,D,c]);return S==null?null:de.createElement(Ha.Provider,{value:g},de.createElement($c.Provider,{children:l,value:S}))}function Hx(a){let{children:n,location:l}=a;return K4(cm(n),l)}var _n=function(a){return a[a.pending=0]="pending",a[a.success=1]="success",a[a.error=2]="error",a}(_n||{});const fC=new Promise(()=>{});class $B extends de.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=_n.pending;if(!(s instanceof Promise))d=_n.success,c=Promise.resolve(),Object.defineProperty(c,"_tracked",{get:()=>!0}),Object.defineProperty(c,"_data",{get:()=>s});else if(this.state.error){d=_n.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?_n.error:"_data"in c?_n.success:_n.pending):(d=_n.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===_n.error&&c._error instanceof b4)throw fC;if(d===_n.error&&!l)throw c._error;if(d===_n.error)return de.createElement(tb.Provider,{value:c,children:l});if(d===_n.success)return de.createElement(tb.Provider,{value:c,children:n});throw c}}function cm(a,n){n===void 0&&(n=[]);let l=[];return de.Children.forEach(a,(s,c)=>{if(!de.isValidElement(s))return;let d=[...n,c];if(s.type===de.Fragment){l.push.apply(l,cm(s.props.children,d));return}s.type!==ds&&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=cm(s.props.children,d)),l.push(f)}),l}function hC(a){let n={hasErrorBoundary:a.ErrorBoundary!=null||a.errorElement!=null};return a.Component&&Object.assign(n,{element:de.createElement(a.Component),Component:void 0}),a.HydrateFallback&&Object.assign(n,{hydrateFallbackElement:de.createElement(a.HydrateFallback),HydrateFallback:void 0}),a.ErrorBoundary&&Object.assign(n,{errorElement:de.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"),mC=await C("react-dom");function kl(){return kl=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},kl.apply(this,arguments)}function Px(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 pC(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function gC(a,n){return a.button===0&&(!n||n==="_self")&&!pC(a)}const vC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],bC=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],yC="6";try{window.__reactRouterVersion=yC}catch{}function xC(a,n){return D4({basename:void 0,future:kl({},void 0,{v7_prependBasename:!0}),history:Zw({window:void 0}),hydrationData:jC(),routes:a,mapRouteProperties:hC,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function jC(){var a;let n=(a=window)==null?void 0:a.__staticRouterHydrationData;return n&&n.errors&&(n=kl({},n,{errors:SC(n.errors)})),n}function SC(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 vc(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 kx=Re.createContext({isTransitioning:!1}),wC=Re.createContext(new Map),CC="startTransition",ib=Re[CC],EC="flushSync",lb=mC[EC],DC="useId";Re[DC];function TC(a){ib?ib(a):a()}function Qr(a){lb?lb(a):a()}class RC{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 NC(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(),[x,j]=Re.useState(),[D,S]=Re.useState(),R=Re.useRef(new Map),{v7_startTransition:E}=s||{},A=Re.useCallback(O=>{E?TC(O):O()},[E]),B=Re.useCallback((O,W)=>{let{deletedFetchers:ae,flushSync:ne,viewTransitionOpts:se}=W;O.fetchers.forEach((V,Z)=>{V.data!==void 0&&R.current.set(Z,V.data)}),ae.forEach(V=>R.current.delete(V));let Ee=l.window==null||l.window.document==null||typeof l.window.document.startViewTransition!="function";if(!se||Ee){ne?Qr(()=>d(O)):A(()=>d(O));return}if(ne){Qr(()=>{x&&(v&&v.resolve(),x.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:se.currentLocation,nextLocation:se.nextLocation})});let V=l.window.document.startViewTransition(()=>{Qr(()=>d(O))});V.finished.finally(()=>{Qr(()=>{b(void 0),j(void 0),p(void 0),g({isTransitioning:!1})})}),Qr(()=>j(V));return}x?(v&&v.resolve(),x.skipTransition(),S({state:O,currentLocation:se.currentLocation,nextLocation:se.nextLocation})):(p(O),g({isTransitioning:!0,flushSync:!1,currentLocation:se.currentLocation,nextLocation:se.nextLocation}))},[l.window,x,v,R,A]);Re.useLayoutEffect(()=>l.subscribe(B),[l,B]),Re.useEffect(()=>{m.isTransitioning&&!m.flushSync&&b(new RC)},[m]),Re.useEffect(()=>{if(v&&f&&l.window){let O=f,W=v.promise,ae=l.window.document.startViewTransition(async()=>{A(()=>d(O)),await W});ae.finished.finally(()=>{b(void 0),j(void 0),p(void 0),g({isTransitioning:!1})}),j(ae)}},[A,f,v,l.window]),Re.useEffect(()=>{v&&f&&c.location.key===f.location.key&&v.resolve()},[v,x,c.location,f]),Re.useEffect(()=>{!m.isTransitioning&&D&&(p(D.state),g({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),S(void 0))},[m.isTransitioning,D]),Re.useEffect(()=>{},[]);let q=Re.useMemo(()=>({createHref:l.createHref,encodeLocation:l.encodeLocation,go:O=>l.navigate(O),push:(O,W,ae)=>l.navigate(O,{state:W,preventScrollReset:ae?.preventScrollReset}),replace:(O,W,ae)=>l.navigate(O,{replace:!0,state:W,preventScrollReset:ae?.preventScrollReset})}),[l]),G=l.basename||"/",Q=Re.useMemo(()=>({router:l,navigator:q,static:!1,basename:G}),[l,q,G]),T=Re.useMemo(()=>({v7_relativeSplatPath:l.future.v7_relativeSplatPath}),[l.future.v7_relativeSplatPath]);return Re.useEffect(()=>cC(s,l.future),[s,l.future]),Re.createElement(Re.Fragment,null,Re.createElement(xs.Provider,{value:Q},Re.createElement(Mm.Provider,{value:c},Re.createElement(wC.Provider,{value:R.current},Re.createElement(kx.Provider,{value:m},Re.createElement(dC,{basename:G,location:c.location,navigationType:c.historyAction,navigator:q,future:T},c.initialized||l.future.v7_partialHydration?Re.createElement(MC,{routes:l.routes,future:l.future,state:c}):n))))),null)}const MC=Re.memo(AC);function AC(a){let{routes:n,future:l,state:s}=a;return Bx(n,void 0,s,l)}const $C=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kt=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,x=Px(n,vC),{basename:j}=Re.useContext(Ha),D,S=!1;if(typeof g=="string"&&LC.test(g)&&(D=g,$C))try{let B=new URL(window.location.href),q=g.startsWith("//")?new URL(B.protocol+g):new URL(g),G=Xn(q.pathname,j);q.origin===B.origin&&G!=null?g=G+q.search+q.hash:S=!0}catch{}let R=G4(g,{relative:c}),E=UC(g,{replace:f,state:p,target:m,preventScrollReset:v,relative:c,viewTransition:b});function A(B){s&&s(B),B.defaultPrevented||E(B)}return Re.createElement("a",kl({},x,{href:D||R,onClick:S||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=Px(n,bC),x=Lc(m,{relative:b.relative}),j=Qi(),D=Re.useContext(Mm),{navigator:S,basename:R}=Re.useContext(Ha),E=D!=null&&zC(x)&&g===!0,A=S.encodeLocation?S.encodeLocation(x).pathname:x.pathname,B=j.pathname,q=D&&D.navigation&&D.navigation.location?D.navigation.location.pathname:null;c||(B=B.toLowerCase(),q=q?q.toLowerCase():null,A=A.toLowerCase()),q&&R&&(q=Xn(q,R)||q);const G=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let Q=B===A||!f&&B.startsWith(A)&&B.charAt(G)==="/",T=q!=null&&(q===A||!f&&q.startsWith(A)&&q.charAt(A.length)==="/"),O={isActive:Q,isPending:T,isTransitioning:E},W=Q?s:void 0,ae;typeof d=="function"?ae=d(O):ae=[d,Q?"active":null,T?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let ne=typeof p=="function"?p(O):p;return Re.createElement(kt,kl({},b,{"aria-current":W,className:ae,ref:l,style:ne,to:m,viewTransition:g}),typeof v=="function"?v(O):v)});var um;(function(a){a.UseScrollRestoration="useScrollRestoration",a.UseSubmit="useSubmit",a.UseSubmitFetcher="useSubmitFetcher",a.UseFetcher="useFetcher",a.useViewTransitionState="useViewTransitionState"})(um||(um={}));var rb;(function(a){a.UseFetcher="useFetcher",a.UseFetchers="useFetchers",a.UseScrollRestoration="useScrollRestoration"})(rb||(rb={}));function OC(a){let n=Re.useContext(xs);return n||De(!1),n}function UC(a,n){let{target:l,replace:s,state:c,preventScrollReset:d,relative:f,viewTransition:p}=n===void 0?{}:n,m=un(),g=Qi(),v=Lc(a,{relative:f});return Re.useCallback(b=>{if(gC(b,l)){b.preventDefault();let x=s!==void 0?s:Ii(g)===Ii(v);m(a,{replace:x,state:c,preventScrollReset:d,relative:f,viewTransition:p})}},[g,m,v,s,c,l,a,d,f,p])}function zC(a,n){n===void 0&&(n={});let l=Re.useContext(kx);l==null&&De(!1);let{basename:s}=OC(um.useViewTransitionState),c=Lc(a,{relative:n.relative});if(!l.isTransitioning)return!1;let d=Xn(l.currentLocation.pathname,s)||l.currentLocation.pathname,f=Xn(l.nextLocation.pathname,s)||l.nextLocation.pathname;return cs(c.pathname,f)!=null||cs(c.pathname,d)!=null}function Oc(a,n,l){return(s,c)=>({label:(s.key&&c.safeNameFromId(a.idFromKey(s.key)))??n,url:l?.replace(":key",s.key??"")})}const{createContext:BC,Component:_C,createElement:sb,useContext:LB,useState:OB,useMemo:UB,forwardRef:zB}=await C("react"),Ix=BC(null),ef={didCatch:!1,error:null};let qC=class extends _C{constructor(n){super(n),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ef}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(ef)}}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&&FC(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(ef)}}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(Ix.Provider,{value:{didCatch:d,error:f,resetErrorBoundary:this.resetErrorBoundary}},p)}};function FC(){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]))}function pa(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(HC,n)}};return n}function HC(a,n){return n(a)}function PC(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 kC(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 pa(p=>(l++,c.push(p),d(),{unsubscribe(){l--,f();const m=c.findIndex(g=>g===p);m>-1&&c.splice(m,1)}}))}}function IC(a){return n=>pa(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 Vx(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=pa(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 Gx(a){return pa(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 Yx=()=>{},ob=a=>{Object.freeze&&Object.freeze(a)};function Xx(a,n,l){var s,c;const d=n.join(".");return(s=l)[c=d]??(s[c]=new Proxy(Yx,{get(f,p){if(!(typeof p!="string"||p==="then"))return Xx(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)}),ob(v.args),ob(v.path),a(v)}})),l[d]}const VC=a=>Xx(a,[],Object.create(null)),GC=a=>new Proxy(Yx,{get(n,l){if(l!=="then")return a(l)}});function fs(a){return!!a&&!Array.isArray(a)&&typeof a=="object"}const cb=a=>a();function ub(a=0){return new Promise(n=>setTimeout(n,a))}function YC(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 tf extends Error{constructor(){super("Unable to transform response from server")}}function Qx(a,n){let l;try{l=YC(a,n)}catch{throw new tf}if(!l.ok&&(!fs(l.error.error)||typeof l.error.error.code!="number"))throw new tf;if(l.ok&&!fs(l.result))throw new tf;return l}var db,fb;(db=Symbol).dispose??(db.dispose=Symbol());(fb=Symbol).asyncDispose??(fb.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 XC(a){return a instanceof Jt||a instanceof Error&&a.name==="TRPCClientError"}function QC(a){return fs(a)&&fs(a.error)&&typeof a.error.code=="number"&&typeof a.error.message=="string"}function KC(a,n){return typeof a=="string"?a:fs(a)&&typeof a.message=="string"?a.message:n}class Jt extends Error{static from(n,l={}){const s=n;return XC(s)?(l.meta&&(s.meta={...s.meta,...l.meta}),s):QC(s)?new Jt(s.error.message,{...l,result:s}):new Jt(KC(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 nf(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class ZC{$request(n){return Gx({links:this.links,op:{...n,context:n.context??{},id:++this.requestId}}).pipe(kC())}async requestAsPromise(n){try{const l=this.$request(n);return(await PC(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){nf(this,"links",void 0),nf(this,"runtime",void 0),nf(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=n.links.map(l=>l(this.runtime))}}const WC=Symbol.for("trpc_untypedClient"),JC={query:"query",mutate:"mutation",subscribe:"subscription"},eE=a=>JC[a];function tE(a){const n=VC(({path:l,args:s})=>{const c=[...l],d=eE(c.pop()),f=c.join(".");return a[d](f,...s)});return GC(l=>l===WC?a:n[l])}function nE(a){const n=new ZC(a);return tE(n)}const hb=a=>typeof a=="function";function aE(a){if(a)return a;if(typeof window<"u"&&hb(window.fetch))return window.fetch;if(typeof globalThis<"u"&&hb(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const mb=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function pb(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(x,j)=>{const D=g.items[j];try{const S=await Promise.resolve(x);D.resolve?.(S)}catch(S){D.reject?.(S)}D.batch=null,D.reject=null,D.resolve=null}));for(const x of g.items)x.reject?.(new Error("Missing result")),x.batch=null}).catch(b=>{for(const x of g.items)x.reject?.(b),x.batch=null})}}function f(p){const m={aborted:!1,key:p,batch:null,resolve:mb,reject:mb},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 iE(...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 Kx(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 lE(a){return{url:a.url.toString(),fetch:a.fetch,transformer:Kx(a.transformer),methodOverride:a.methodOverride}}function rE(a){const n={};for(let l=0;l<a.length;l++){const s=a[l];n[l]=s}return n}const sE={query:"GET",mutation:"POST",subscription:"PATCH"};function Zx(a){return"input"in a?a.transformer.input.serialize(a.input):rE(a.inputs.map(n=>a.transformer.input.serialize(n)))}const Wx=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=Zx(a);d!==void 0&&a.methodOverride!=="POST"&&c.push(`input=${encodeURIComponent(JSON.stringify(d))}`)}return c.length&&(s+="?"+c.join("&")),s},oE=a=>{if(a.type==="query"&&a.methodOverride!=="POST")return;const n=Zx(a);return n!==void 0?JSON.stringify(n):void 0},cE=a=>hE({...a,contentTypeHeader:"application/json",getUrl:Wx,getBody:oE});class uE extends Error{constructor(){const n="AbortError";super(n),this.name=n,this.message=n}}const dE=a=>{if(a?.aborted)throw a.throwIfAborted?.(),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new uE};async function fE(a){dE(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 aE(a.fetch)(n,{method:a.methodOverride??sE[s],signal:a.signal,body:l,headers:d})}async function hE(a){const n={},l=await fE(a);n.response=l;const s=await l.json();return n.responseJSON=s,{json:s,meta:n}}function mE(a){const n=lE(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 Wx({...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),x=iE(...g.map(R=>R.signal)),j=await cE({...n,path:v,inputs:b,type:m,headers(){return a.headers?typeof a.headers=="function"?a.headers({opList:g}):a.headers:{}},signal:x});return(Array.isArray(j.json)?j.json:g.map(()=>j.json)).map(R=>({meta:j.meta,json:R}))}}),d=pb(c("query")),f=pb(c("mutation")),p={query:d,mutation:f};return({op:m})=>pa(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 x;return b.then(j=>{x=j;const D=Qx(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:x?.meta}))}),()=>{}})}}function pE(a){return typeof FormData>"u"?!1:a instanceof FormData}const af={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 gE(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]=af.ansi.regular[l],[b,x]=af.ansi.bold[l];p.push(n==="up"?g:v,n==="up"?">>":"<<",l,n==="up"?b:x,`#${d}`,c,"\x1B[0m")}else{const[g,v]=af.css[l],b=`
|
|
54
|
-
background-color: #${n==="up"?g:v};
|
|
55
|
-
color: ${n==="up"?"black":"white"};
|
|
56
|
-
padding: 2px;
|
|
57
|
-
`;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 vE=({c:a=console,colorMode:n="css",withContext:l})=>s=>{const c=s.input,d=pE(c)?Object.fromEntries(c):c,{parts:f,args:p}=gE({...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 bE(a={}){const{enabled:n=()=>!0}=a,l=a.colorMode??(typeof window>"u"?"ansi":"css"),s=a.withContext??l==="css",{logger:c=vE({c:a.console,colorMode:l,withContext:s})}=a;return()=>({op:d,next:f})=>pa(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(IC({next(v){g(v)},error(v){g(v)}})).subscribe(p)})}function gb(a){return Array.isArray(a)?a:[a]}function yE(a){return n=>{const l=gb(a.true).map(c=>c(n)),s=gb(a.false).map(c=>c(n));return c=>pa(d=>{const f=a.condition(c.op)?l:s;return Gx({op:c.op,links:f}).subscribe(d)})}}const xE={enabled:!1,closeMs:0},jE={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},SE=a=>a===0?0:Math.min(1e3*2**a,3e4),Jx=(a,...n)=>typeof a=="function"?a(...n):a;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 hi extends Error{constructor(n){super(n.message,{cause:n.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,hi.prototype)}}class wE{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){lf(this,"onTimeout",void 0),lf(this,"timeoutMs",void 0),lf(this,"timeout",void 0),this.onTimeout=n,this.timeoutMs=l}}function ej(){let a,n;return{promise:new Promise((s,c)=>{a=s,n=c}),resolve:a,reject:n}}async function CE(a){const n=await Jx(a.url);if(!a.connectionParams)return n;const s=`${n.includes("?")?"&":"?"}connectionParams=1`;return n+s}async function EE(a){const n={method:"connectionParams",data:await Jx(a)};return JSON.stringify(n)}function vb(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class DE{register(n,l){const{promise:s,resolve:c}=ej();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(){vb(this,"outgoingRequests",new Array),vb(this,"pendingRequests",{})}}function Fi(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}function TE(a){const{promise:n,resolve:l,reject:s}=ej();return a.addEventListener("open",()=>{a.removeEventListener("error",s),l()}),a.addEventListener("error",s),n}function RE(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 hs{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=++hs.connectCount;const n=CE(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&&RE(l,this.keepAliveOpts),l.addEventListener("close",()=>{this.ws===l&&(this.ws=null)}),await TE(l),this.urlOptions.connectionParams&&l.send(await EE(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(n){if(Fi(this,"id",++hs.connectCount),Fi(this,"WebSocketPonyfill",void 0),Fi(this,"urlOptions",void 0),Fi(this,"keepAliveOpts",void 0),Fi(this,"wsObservable",Vx(null)),Fi(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}}Fi(hs,"connectCount",0);function NE(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 _a(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class ME{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 hi({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 hi({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 pa(m=>{const g=this.batchSend({id:n,method:l,params:{input:f.input.serialize(c),path:s,lastEventId:p}},{...m,next(v){const b=Qx(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 NE(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 ub(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 hi({message:"WebSocket closed",cause:s}))),this.requestManager.delete(d.id))};n.addEventListener("open",()=>{cb(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 hi({message:"WebSocket closed",cause:s}))}),n.addEventListener("error",s=>{l(s),this.callbacks.onError?.(s),this.reconnect(new hi({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 hi({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(),cb(async()=>{this.activeConnection.isOpen()||await this.open(),await ub(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){_a(this,"connectionState",void 0),_a(this,"allowReconnect",!1),_a(this,"requestManager",new DE),_a(this,"activeConnection",void 0),_a(this,"reconnectRetryDelay",void 0),_a(this,"inactivityTimeout",void 0),_a(this,"callbacks",void 0),_a(this,"lazyMode",void 0),_a(this,"reconnecting",null),this.callbacks={onOpen:n.onOpen,onClose:n.onClose,onError:n.onError};const l={...xE,...n.lazy};this.inactivityTimeout=new wE(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},l.closeMs),this.activeConnection=new hs({WebSocketPonyfill:n.WebSocket,urlOptions:n,keepAlive:{...jE,...n.keepAlive}}),this.activeConnection.wsObservable.subscribe({next:s=>{s&&this.setupWebSocketListeners(s)}}),this.reconnectRetryDelay=n.retryDelayMs??SE,this.lazyMode=l.enabled,this.connectionState=Vx({type:"state",state:l.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch(()=>null)}}function AE(a){return new ME(a)}function $E(a){const{client:n}=a,l=Kx(a.transformer);return()=>({op:s})=>pa(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 da extends Error{constructor(n,l){super(n),this.title=l,this.name="UserVisibleError"}}class bb extends da{constructor(n){super(`Cannot delete because of references: ${n.map(l=>l.ref.path.join(".")).join(", ")}`),this.issues=n}}class tj extends da{constructor(n="The item you are looking for could not be found"){super(n,"Not found")}}function LE(a){return a.issues.map(l=>{const{path:s,message:c}=l;return`${s.join(".")}: ${c}`}).join("; ")}var mc={exports:{}},OE=mc.exports,yb;function UE(){return yb||(yb=1,function(a){(function(n,l){a.exports?a.exports=l():n.log=l()})(OE,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(S,R){var E=S[R];if(typeof E.bind=="function")return E.bind(S);try{return Function.prototype.bind.call(E,S)}catch{return function(){return Function.prototype.apply.apply(E,[S,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(S){return S==="debug"&&(S="log"),typeof console===l?!1:S==="trace"&&s?m:console[S]!==void 0?p(console,S):console.log!==void 0?p(console,"log"):n}function v(){for(var S=this.getLevel(),R=0;R<c.length;R++){var E=c[R];this[E]=R<S?n:this.methodFactory(E,S,this.name)}if(this.log=this.debug,typeof console===l&&S<this.levels.SILENT)return"No console available for logging"}function b(S){return function(){typeof console!==l&&(v.call(this),this[S].apply(this,arguments))}}function x(S,R,E){return g(S)||b.apply(this,arguments)}function j(S,R){var E=this,A,B,q,G="loglevel";typeof S=="string"?G+=":"+S:typeof S=="symbol"&&(G=void 0);function Q(ne){var se=(c[ne]||"silent").toUpperCase();if(!(typeof window===l||!G)){try{window.localStorage[G]=se;return}catch{}try{window.document.cookie=encodeURIComponent(G)+"="+se+";"}catch{}}}function T(){var ne;if(!(typeof window===l||!G)){try{ne=window.localStorage[G]}catch{}if(typeof ne===l)try{var se=window.document.cookie,Ee=encodeURIComponent(G),V=se.indexOf(Ee+"=");V!==-1&&(ne=/^([^;]+)/.exec(se.slice(V+Ee.length+1))[1])}catch{}return E.levels[ne]===void 0&&(ne=void 0),ne}}function O(){if(!(typeof window===l||!G)){try{window.localStorage.removeItem(G)}catch{}try{window.document.cookie=encodeURIComponent(G)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function W(ne){var se=ne;if(typeof se=="string"&&E.levels[se.toUpperCase()]!==void 0&&(se=E.levels[se.toUpperCase()]),typeof se=="number"&&se>=0&&se<=E.levels.SILENT)return se;throw new TypeError("log.setLevel() called with invalid level: "+ne)}E.name=S,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=R||x,E.getLevel=function(){return q??B??A},E.setLevel=function(ne,se){return q=W(ne),se!==!1&&Q(q),v.call(E)},E.setDefaultLevel=function(ne){B=W(ne),T()||E.setLevel(ne,!1)},E.resetLevel=function(){q=null,O(),v.call(E)},E.enableAll=function(ne){E.setLevel(E.levels.TRACE,ne)},E.disableAll=function(ne){E.setLevel(E.levels.SILENT,ne)},E.rebuild=function(){if(f!==E&&(A=W(f.getLevel())),v.call(E),f===E)for(var ne in d)d[ne].rebuild()},A=W(f?f.getLevel():"WARN");var ae=T();ae!=null&&(q=W(ae)),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})}(mc)),mc.exports}var zE=UE();const BE=Cm(zE),nj=BE;nj.enableAll();function _l(a){nj.error(a)}function _E(a){if(a instanceof Jt){const n=a;if(n.data?.isUserVisible&&n.message)return[n.message,n.data.descriptionText].filter(Boolean).join(`
|
|
58
|
-
`);if(n.message.includes("Failed to fetch"))return"Could not connect to the server. Please start the server and try again."}return a instanceof da?a.message:"Check console logs for more details."}function Gl(a,n="Sorry, something went wrong."){const l=_E(a);return`${n} ${l}`}function Cn(a,n){return _l(a),Gl(a,n)}const{Button:qE,ErrorDisplay:FE}=await C("@baseplate-dev/ui-components"),{useContext:HE}=await C("react");function PE({resetButtonLabel:a}){const{resetErrorBoundary:n,error:l}=HE(Ix)??{resetErrorBoundary:()=>{},error:void 0},s=l instanceof da?l.title:void 0,c=!(l instanceof da),d=Gl(l,"");return o.jsx(FE,{header:s,error:d,actions:c&&o.jsx(qE,{onClick:n,children:a})})}function Yl({children:a,resetButtonLabel:n,onReset:l}){return o.jsx(qC,{fallback:o.jsx(PE,{resetButtonLabel:n??"Reload Page"}),onError:s=>{_l(s)},onReset:()=>{l?l():globalThis.location.reload()},children:a})}var rf,xb;function kE(){if(xb)return rf;xb=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,B){return g[E]+", "+g[A]+", "+g[B]},b=0;b<6;++b)for(var x=0;x<6;++x)for(var j=0;j<6;++j)this.PALETTE_COLORS.push(v(b,x,j));for(var D=8,S=0;S<24;++S,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,x=p.split(/\033\[/),j=x.shift();m==null&&(m={}),m.clearLine=/\r/.test(p);var D=x.map(function(R){return v.processChunk(R,m,g)});if(m&&m.json){var S=b.processChunkJson("");return S.content=j,S.clearLine=m.clearLine,D.unshift(S),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",x={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!x.content}},j=p.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!j)return x;x.content=j[4];var D=j[2].split(";");if(j[1]!==""||j[3]!=="m"||!g)return x;for(var S=this;D.length>0;){var R=D.shift(),E=parseInt(R);if(isNaN(E)||E===0)S.fg=S.bg=null,S.decorations=[];else if(E===1)S.decorations.push("bold");else if(E===2)S.decorations.push("dim");else if(E===3)S.decorations.push("italic");else if(E===4)S.decorations.push("underline");else if(E===5)S.decorations.push("blink");else if(E===7)S.decorations.push("reverse");else if(E===8)S.decorations.push("hidden");else if(E===9)S.decorations.push("strikethrough");else if(E===21)S.removeDecoration("bold");else if(E===22)S.removeDecoration("bold"),S.removeDecoration("dim");else if(E===23)S.removeDecoration("italic");else if(E===24)S.removeDecoration("underline");else if(E===25)S.removeDecoration("blink");else if(E===27)S.removeDecoration("reverse");else if(E===28)S.removeDecoration("hidden");else if(E===29)S.removeDecoration("strikethrough");else if(E===39)S.fg=null;else if(E===49)S.bg=null;else if(E>=30&&E<38)S.fg=l[0][E%10][b];else if(E>=90&&E<98)S.fg=l[1][E%10][b];else if(E>=40&&E<48)S.bg=l[0][E%10][b];else if(E>=100&&E<108)S.bg=l[1][E%10][b];else if(E===38||E===48){var A=E===38;if(D.length>=1){var B=D.shift();if(B==="5"&&D.length>=1){var q=parseInt(D.shift());if(q>=0&&q<=255)if(!v)this.PALETTE_COLORS||S.setupPalette(),A?S.fg=this.PALETTE_COLORS[q]:S.bg=this.PALETTE_COLORS[q];else{var G=q>=16?"ansi-palette-"+q:l[q>7?1:0][q%8].class;A?S.fg=G:S.bg=G}}else if(B==="2"&&D.length>=3){var Q=parseInt(D.shift()),T=parseInt(D.shift()),O=parseInt(D.shift());if(Q>=0&&Q<=255&&T>=0&&T<=255&&O>=0&&O<=255){var W=Q+", "+T+", "+O;v?A?(S.fg="ansi-truecolor",S.fg_truecolor=W):(S.bg="ansi-truecolor",S.bg_truecolor=W):A?S.fg=W:S.bg=W}}}}}return S.fg===null&&S.bg===null&&S.decorations.length===0||(x.fg=S.fg,x.bg=S.bg,x.fg_truecolor=S.fg_truecolor,x.bg_truecolor=S.bg_truecolor,x.decorations=S.decorations,x.decoration=S.decorations.slice(-1).pop()||null,x.was_processed=!0),x}},{key:"processChunk",value:function(p,m,g){var v=this;m=m||{};var b=this.processChunkJson(p,m,g),x=m.use_classes;if(b.decorations=b.decorations.filter(function(A){if(A==="reverse"){b.fg||(b.fg=l[0][7][x?"class":"color"]),b.bg||(b.bg=l[0][0][x?"class":"color"]);var B=b.fg;b.fg=b.bg,b.bg=B;var q=b.fg_truecolor;return b.fg_truecolor=b.bg_truecolor,b.bg_truecolor=q,b.isInverted=!0,!1}return!0}),m.json)return b;if(b.isEmpty())return"";if(!b.was_processed)return b.content;var j=[],D=[],S=[],R={},E=function(B){var q=[],G=void 0;for(G in B)B.hasOwnProperty(G)&&q.push("data-"+G+'="'+v.escapeForHtml(B[G])+'"');return q.length>0?" "+q.join(" "):""};return b.isInverted&&(R["ansi-is-inverted"]="true"),b.fg&&(x?(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&&(x?(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(x){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"?S.push("line-through"):S.push(A)}),S.length&&D.push("text-decoration:"+S.join(" ")),x?'<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 rf=c,rf}var IE=kE();const VE=Cm(IE);function GE({text:a}){const n=a.split(`
|
|
59
|
-
`).map((l,s)=>{const c=VE.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})}const{useBlockerDialogState:sf}=await C("@baseplate-dev/project-builder-lib/web"),{Button:of,Dialog:YE,DialogContent:XE,DialogDescription:QE,DialogFooter:KE,DialogHeader:ZE,DialogTitle:WE}=await C("@baseplate-dev/ui-components"),{useCallback:jb,useEffect:JE,useState:e6}=await C("react");function t6(){const a=sf(x=>x.activeBlockers.length>0?x.activeBlockers[0]:null),n=sf(x=>x.requestedBlockers),l=sf(x=>x.clearRequestedBlockers),s=rC(({currentLocation:x,nextLocation:j})=>!!a&&x.pathname!==j.pathname),[c,d]=e6(!1),f=jb(()=>{s.reset?.(),l()},[s,l]),p=jb(async x=>{d(!0);try{if(x&&!await x()){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;JE(()=>{m&&!a&&!c&&p().catch(x=>{_l(x)})},[m,p,a,c]);const g=o.jsx(of,{onClick:f,variant:"secondary",children:"Cancel"}),v=a?.buttonContinueWithoutSaveText&&o.jsx(of,{onClick:()=>p(a.onContinueWithoutSave).catch(x=>{_l(x)}),disabled:c,variant:"secondary",children:a.buttonContinueWithoutSaveText??"Continue without saving"}),b=o.jsx(of,{disabled:c,onClick:()=>{p(a?.onContinue).catch(x=>{_l(x)})},children:a?.buttonContinueText??"Continue"});return o.jsx(YE,{open:m,onOpenChange:x=>{x||f()},children:o.jsx(XE,{children:o.jsxs("div",{className:"space-y-4",children:[o.jsx(ZE,{children:o.jsx(WE,{children:a?.title})}),o.jsx(QE,{children:a?.content}),o.jsx(KE,{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:Po}=await C("@baseplate-dev/ui-components"),{useState:n6}=await C("react");function aj({className:a,defaultOpen:n,children:l,collapsedContents:s,onRemove:c}){const[d,f]=n6(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(Po,{variant:"link",size:"none",onClick:()=>{f(!1)},children:"Close"}),o.jsx(Po,{variant:"link",size:"none",onClick:c,children:"Remove"})]}),l]}):o.jsxs("div",{className:"flex flex-row items-center space-x-4",children:[o.jsx(Po,{variant:"link",size:"none",onClick:()=>{f(!0)},children:"Edit"}),s,o.jsx(Po,{variant:"link",size:"none",onClick:c,children:"Remove"})]})})}function ij(a){a?localStorage.setItem("projectId",a):localStorage.removeItem("projectId")}function a6(){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 ij(l),l}return null}const En=wm(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:a6(),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}))}})),i6={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{z:cf}=await C("zod"),l6=cf.object({VITE_PREVIEW_MODE:cf.enum(["true","false"]).nullish().transform(a=>a==="true"),VITE_ENABLE_TEMPLATE_EXTRACTOR:cf.enum(["true","false"]).nullish().transform(a=>a==="true")}),lj=l6.parse(i6),Fn=lj.VITE_PREVIEW_MODE,rj=lj.VITE_ENABLE_TEMPLATE_EXTRACTOR;function r6(a){return typeof a=="string"?new TextEncoder().encode(a):a}async function sj(a){const n=r6(a),l=await crypto.subtle.digest("SHA-256",n);return[...new Uint8Array(l)].map(c=>c.toString(16).padStart(2,"0")).join("")}class s6{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 o6(){return new s6}function c6(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 u6=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function d6(a){return Array.from(a.match(u6)??[])}function ql(a){const n=d6(a);if(n.length===0)return"";const[l,...s]=n;return`${l.toLowerCase()}${s.map(c=>Vw(c)).join("")}`}function Sb(a){return a.substring(0,1).toUpperCase()+a.substring(1)}function f6(a){return a instanceof Jt}function wb({maxAttempts:a=5}){return()=>({op:n,next:l})=>pa(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 Om=o6(),h6=AE({url:`${globalThis.location.origin.replace(/^http/,"ws")}/trpc`,onOpen(){Om.emit("open",void 0)}}),Lt=nE({links:[yE({condition:a=>a.type==="subscription",true:[bE({enabled:a=>a.direction==="down"&&a.result instanceof Error}),wb({}),$E({client:h6})],false:[wb({maxAttempts:10}),mE({url:"/trpc"})]})]}),{toast:m6}=await C("@baseplate-dev/ui-components"),{useEffect:uf,useRef:ko,useState:p6}=await C("react"),oj=({className:a})=>{const[n,l]=p6(""),s=ko(!0),c=ko(null),d=ko(null),{currentProjectId:f}=En();uf(()=>{f&&(Fn||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=>{m6.error(Gl(g,"Error loading sync console output"))}))},[f]),uf(()=>{if(!f)return;const g=Lt.sync.onConsoleEmitted.subscribe({id:f},{onData:b=>{l(x=>x?`${x}
|
|
62
|
-
${b.message}`:b.message)}}),v=Lt.sync.onSyncStarted.subscribe({id:f},{onData:()=>{l("")}});return()=>{g.unsubscribe(),v.unsubscribe()}},[f]),uf(()=>{s.current&&d.current?.scrollIntoView({behavior:"smooth"})},[n]);const p=ko(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(GE,{text:n}),o.jsx("div",{ref:d})]})};oj.displayName="Console";const{Alert:g6,Button:v6,Dialog:b6,DialogContent:y6,DialogHeader:x6,DialogTitle:j6,FormItem:S6,FormLabel:w6,FormMessage:C6}=await C("@baseplate-dev/ui-components"),{useState:E6}=await C("react");function ms({className:a,onChange:n,renderTable:l,renderForm:s,value:c,itemName:d,defaultValue:f={}}){const[p,m]=E6(),g=c??[],v=b=>{p?.idx===void 0?n([...g,b]):n(g.map((x,j)=>j===p.idx?b:x)),m(void 0)};return o.jsxs("div",{className:Te("space-y-2",a),children:[o.jsx(v6,{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((x,j)=>j!==b))}}):o.jsx(g6,{variant:"default",children:"No items currently"}),o.jsx(b6,{open:!!p,onOpenChange:b=>{b||m(void 0)},children:o.jsxs(y6,{"aria-describedby":void 0,children:[o.jsx(x6,{children:o.jsxs(j6,{children:["Edit ",d??"Item"]})}),s({initialData:p?.data,onSubmit:v})]})})]})}ms.Labelled=function({label:n,className:l,error:s,...c}){return o.jsx("div",{className:Te("",l),children:o.jsxs(S6,{className:l,children:[n&&o.jsx(w6,{children:n}),o.jsx(ms,{...c}),o.jsx(C6,{children:s})]})})};ms.LabelledController=function({control:n,name:l,...s}){const{field:c,fieldState:{error:d}}=fa({name:l,control:n});return o.jsx(ms.Labelled,{...s,error:d?.message,onChange:f=>{c.onChange(f)},value:c.value})};const{Button:D6,ErrorDisplay:T6}=await C("@baseplate-dev/ui-components");function Uc(){const a=un();return o.jsx(T6,{className:"flex-1",header:"Page not found",error:"Sorry, we were unable to find the page you were looking for.",actions:o.jsx(D6,{onClick:()=>{a("/")},children:"Back to Home"})})}const{useMemo:R6}=await C("react"),cj=wm(a=>({dialogOptions:void 0,setDialogOptions:n=>{a({dialogOptions:n})}}));function uj(){const a=cj(n=>n.setDialogOptions);return R6(()=>({showRefIssues:n=>{a(n)},clearRefIssues:()=>{a(void 0)}}),[a])}const{useEffect:N6,useRef:M6}=await C("react");function Um(a){const n=M6(void 0);return N6(()=>{n.current=a},[a]),n.current}const dj={};function A6(a,n){const l=dj[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("{key}",n.type.keyFromId(n.id)).replace("{parentId}",c?.id??"").replace("{parentKey}",c?.type.keyFromId(c.id)??"")}function js(a,n){dj[a.name]=n}const{useProjectDefinition:$6}=await C("@baseplate-dev/project-builder-lib/web"),{Button:L6,Dialog:O6,DialogContent:U6,DialogDescription:z6,DialogFooter:B6,DialogHeader:_6,DialogTitle:q6,Table:F6,TableBody:H6,TableCell:df,TableHead:ff,TableHeader:P6,TableRow:Cb}=await C("@baseplate-dev/ui-components");function k6(){const{dialogOptions:a,setDialogOptions:n}=cj(),{definitionContainer:l}=$6(),{entities:s}=l,c=Um(a),{issues:d}=a??c??{};return o.jsx(O6,{open:!!a,onOpenChange:()=>{n(void 0)},children:o.jsxs(U6,{width:"lg",children:[o.jsx(_6,{children:o.jsx(q6,{children:"Unable to delete"})}),o.jsx(z6,{children:"There were other references that needed to be fixed before you could delete this item."}),o.jsxs(F6,{children:[o.jsx(P6,{children:o.jsxs(Cb,{children:[o.jsx(ff,{children:"Entity"}),o.jsx(ff,{children:"Path"}),o.jsx(ff,{children:"Referenced Entity"})]})}),o.jsx(H6,{children:d?.map(f=>{const p=s.find(x=>x.id===f.entityId),m=f.ref.path.join(".");let g;for(const x of s){const j=x.path.join(".");m.startsWith(j)&&(!g||g.path.length<j.length)&&(g=x)}const v=g?m.slice(Math.max(0,g.path.join(".").length+1)):m,b=g?A6(l,g):void 0;return o.jsxs(Cb,{children:[o.jsx(df,{children:g?o.jsxs("div",{className:"text-style-prose",children:[o.jsx("div",{children:b?o.jsx(kt,{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(df,{children:v}),o.jsx(df,{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(B6,{children:o.jsx(L6,{onClick:()=>{n(void 0)},children:"OK"})})]})})}const{useMemo:zm,useLayoutEffect:I6,useEffect:fj,useRef:Xl,useCallback:bc}=await C("react");function V6(){for(var a=arguments.length,n=new Array(a),l=0;l<a;l++)n[l]=arguments[l];return zm(()=>s=>{n.forEach(c=>c(s))},n)}const zc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ql(a){const n=Object.prototype.toString.call(a);return n==="[object Window]"||n==="[object global]"}function Bm(a){return"nodeType"in a}function dn(a){var n,l;return a?Ql(a)?a:Bm(a)&&(n=(l=a.ownerDocument)==null?void 0:l.defaultView)!=null?n:window:window}function _m(a){const{Document:n}=dn(a);return a instanceof n}function Ss(a){return Ql(a)?!1:a instanceof dn(a).HTMLElement}function hj(a){return a instanceof dn(a).SVGElement}function Kl(a){return a?Ql(a)?a.document:Bm(a)?_m(a)?a:Ss(a)||hj(a)?a.ownerDocument:document:document:document}const ha=zc?I6:fj;function qm(a){const n=Xl(a);return ha(()=>{n.current=a}),bc(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 G6(){const a=Xl(null),n=bc((s,c)=>{a.current=setInterval(s,c)},[]),l=bc(()=>{a.current!==null&&(clearInterval(a.current),a.current=null)},[]);return[n,l]}function ps(a,n){n===void 0&&(n=[a]);const l=Xl(a);return ha(()=>{l.current!==a&&(l.current=a)},n),l}function ws(a,n){const l=Xl();return zm(()=>{const s=a(l.current);return l.current=s,s},[...n])}function yc(a){const n=qm(a),l=Xl(null),s=bc(c=>{c!==l.current&&n?.(c,l.current),l.current=c},[]);return[l,s]}function dm(a){const n=Xl();return fj(()=>{n.current=a},[a]),n.current}let hf={};function Cs(a,n){return zm(()=>{if(n)return n;const l=hf[a]==null?0:hf[a]+1;return hf[a]=l,a+"-"+l},[a,n])}function mj(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 Fl=mj(1),xc=mj(-1);function Y6(a){return"clientX"in a&&"clientY"in a}function Fm(a){if(!a)return!1;const{KeyboardEvent:n}=dn(a.target);return n&&a instanceof n}function X6(a){if(!a)return!1;const{TouchEvent:n}=dn(a.target);return n&&a instanceof n}function fm(a){if(X6(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 Y6(a)?{x:a.clientX,y:a.clientY}:null}const gs=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[gs.Translate.toString(a),gs.Scale.toString(a)].join(" ")}},Transition:{toString(a){let{property:n,duration:l,easing:s}=a;return n+" "+l+"ms "+s}}}),Eb="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Q6(a){return a.matches(Eb)?a:a.querySelector(Eb)}const Hm=await C("react"),{useState:K6,useCallback:Z6}=Hm,W6={display:"none"};function J6(a){let{id:n,value:l}=a;return Hm.createElement("div",{id:n,style:W6},l)}function e5(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 Hm.createElement("div",{id:n,style:c,role:"status","aria-live":s,"aria-atomic":!0},l)}function t5(){const[a,n]=K6("");return{announce:Z6(s=>{s!=null&&n(s)},[]),announcement:a}}const Gn=await C("react"),{createContext:Es,useContext:Il,useEffect:xt,useState:Yn,useCallback:Qn,useMemo:Ft,useRef:Pt,memo:n5,useReducer:a5,cloneElement:_B,forwardRef:qB}=Gn,{createPortal:i5,unstable_batchedUpdates:Io}=await C("react-dom"),pj=Es(null);function l5(a){const n=Il(pj);xt(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(a)},[a,n])}function r5(){const[a]=Yn(()=>new Set),n=Qn(s=>(a.add(s),()=>a.delete(s)),[a]);return[Qn(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 s5={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
|
-
`},o5={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 c5(a){let{announcements:n=o5,container:l,hiddenTextDescribedById:s,screenReaderInstructions:c=s5}=a;const{announce:d,announcement:f}=t5(),p=Cs("DndLiveRegion"),[m,g]=Yn(!1);if(xt(()=>{g(!0)},[]),l5(Ft(()=>({onDragStart(b){let{active:x}=b;d(n.onDragStart({active:x}))},onDragMove(b){let{active:x,over:j}=b;n.onDragMove&&d(n.onDragMove({active:x,over:j}))},onDragOver(b){let{active:x,over:j}=b;d(n.onDragOver({active:x,over:j}))},onDragEnd(b){let{active:x,over:j}=b;d(n.onDragEnd({active:x,over:j}))},onDragCancel(b){let{active:x,over:j}=b;d(n.onDragCancel({active:x,over:j}))}}),[d,n])),!m)return null;const v=Gn.createElement(Gn.Fragment,null,Gn.createElement(J6,{id:s,value:c.draggable}),Gn.createElement(e5,{id:p,announcement:f}));return l?i5(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 jc(){}const Kn=Object.freeze({x:0,y:0});function u5(a,n){return Math.sqrt(Math.pow(a.x-n.x,2)+Math.pow(a.y-n.y,2))}function d5(a,n){let{data:{value:l}}=a,{data:{value:s}}=n;return l-s}function f5(a,n){let{data:{value:l}}=a,{data:{value:s}}=n;return s-l}function h5(a,n){if(!a||a.length===0)return null;const[l]=a;return l[n]}function Db(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 m5=a=>{let{collisionRect:n,droppableRects:l,droppableContainers:s}=a;const c=Db(n,n.left,n.top),d=[];for(const f of s){const{id:p}=f,m=l.get(p);if(m){const g=u5(Db(m),c);d.push({id:p,data:{droppableContainer:f,value:g}})}}return d.sort(d5)};function p5(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 g5=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=p5(p,n);m>0&&c.push({id:f,data:{droppableContainer:d,value:m}})}}return c.sort(f5)};function v5(a,n,l){return{...a,scaleX:n&&l?n.width/l.width:1,scaleY:n&&l?n.height/l.height:1}}function gj(a,n){return a&&n?{x:a.left-n.left,y:a.top-n.top}:Kn}function b5(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 y5=b5(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 j5(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 S5={ignoreTransform:!1};function Zl(a,n){n===void 0&&(n=S5);let l=a.getBoundingClientRect();if(n.ignoreTransform){const{transform:g,transformOrigin:v}=dn(a).getComputedStyle(a);g&&(l=j5(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 Tb(a){return Zl(a,{ignoreTransform:!0})}function w5(a){const n=a.innerWidth,l=a.innerHeight;return{top:0,left:0,right:n,bottom:l,width:n,height:l}}function C5(a,n){return n===void 0&&(n=dn(a).getComputedStyle(a)),n.position==="fixed"}function E5(a,n){n===void 0&&(n=dn(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 Pm(a,n){const l=[];function s(c){if(n!=null&&l.length>=n||!c)return l;if(_m(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!Ss(c)||hj(c)||l.includes(c))return l;const d=dn(a).getComputedStyle(c);return c!==a&&E5(c,d)&&l.push(c),C5(c,d)?l:s(c.parentNode)}return a?s(a):l}function vj(a){const[n]=Pm(a,1);return n??null}function mf(a){return!zc||!a?null:Ql(a)?a:Bm(a)?_m(a)||a===Kl(a).scrollingElement?window:Ss(a)?a:null:null}function bj(a){return Ql(a)?a.scrollX:a.scrollLeft}function yj(a){return Ql(a)?a.scrollY:a.scrollTop}function hm(a){return{x:bj(a),y:yj(a)}}var $t;(function(a){a[a.Forward=1]="Forward",a[a.Backward=-1]="Backward"})($t||($t={}));function xj(a){return!zc||!a?!1:a===document.scrollingElement}function jj(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 D5={x:.2,y:.2};function T5(a,n,l,s,c){let{top:d,left:f,right:p,bottom:m}=l;s===void 0&&(s=10),c===void 0&&(c=D5);const{isTop:g,isBottom:v,isLeft:b,isRight:x}=jj(a),j={x:0,y:0},D={x:0,y:0},S={height:n.height*c.y,width:n.width*c.x};return!g&&d<=n.top+S.height?(j.y=$t.Backward,D.y=s*Math.abs((n.top+S.height-d)/S.height)):!v&&m>=n.bottom-S.height&&(j.y=$t.Forward,D.y=s*Math.abs((n.bottom-S.height-m)/S.height)),!x&&p>=n.right-S.width?(j.x=$t.Forward,D.x=s*Math.abs((n.right-S.width-p)/S.width)):!b&&f<=n.left+S.width&&(j.x=$t.Backward,D.x=s*Math.abs((n.left+S.width-f)/S.width)),{direction:j,speed:D}}function R5(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 Sj(a){return a.reduce((n,l)=>Fl(n,hm(l)),Kn)}function N5(a){return a.reduce((n,l)=>n+bj(l),0)}function M5(a){return a.reduce((n,l)=>n+yj(l),0)}function A5(a,n){if(n===void 0&&(n=Zl),!a)return;const{top:l,left:s,bottom:c,right:d}=n(a);vj(a)&&(c<=0||d<=0||l>=window.innerHeight||s>=window.innerWidth)&&a.scrollIntoView({block:"center",inline:"center"})}const $5=[["x",["left","right"],N5],["y",["top","bottom"],M5]];class km{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=Pm(l),c=Sj(s);this.rect={...n},this.width=n.width,this.height=n.height;for(const[d,f,p]of $5)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 is{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 L5(a){const{EventTarget:n}=dn(a);return a instanceof n?a:Kl(a)}function pf(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 qn;(function(a){a.Click="click",a.DragStart="dragstart",a.Keydown="keydown",a.ContextMenu="contextmenu",a.Resize="resize",a.SelectionChange="selectionchange",a.VisibilityChange="visibilitychange"})(qn||(qn={}));function Rb(a){a.preventDefault()}function O5(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 wj={start:[Pe.Space,Pe.Enter],cancel:[Pe.Esc],end:[Pe.Space,Pe.Enter,Pe.Tab]},U5=(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 Cj{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 is(Kl(l)),this.windowListeners=new is(dn(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qn.Resize,this.handleCancel),this.windowListeners.add(qn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:l}=this.props,s=n.node.current;s&&A5(s),l(Kn)}handleKeyDown(n){if(Fm(n)){const{active:l,context:s,options:c}=this.props,{keyboardCodes:d=wj,coordinateGetter:f=U5,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}:Kn;this.referenceCoordinates||(this.referenceCoordinates=v);const b=f(n,{active:l,context:s.current,currentCoordinates:v});if(b){const x=xc(b,v),j={x:0,y:0},{scrollableAncestors:D}=s.current;for(const S of D){const R=n.code,{isTop:E,isRight:A,isLeft:B,isBottom:q,maxScroll:G,minScroll:Q}=jj(S),T=R5(S),O={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&&!B,ae=R===Pe.Down&&!q||R===Pe.Up&&!E;if(W&&O.x!==b.x){const ne=S.scrollLeft+x.x,se=R===Pe.Right&&ne<=G.x||R===Pe.Left&&ne>=Q.x;if(se&&!x.y){S.scrollTo({left:ne,behavior:p});return}se?j.x=S.scrollLeft-ne:j.x=R===Pe.Right?S.scrollLeft-G.x:S.scrollLeft-Q.x,j.x&&S.scrollBy({left:-j.x,behavior:p});break}else if(ae&&O.y!==b.y){const ne=S.scrollTop+x.y,se=R===Pe.Down&&ne<=G.y||R===Pe.Up&&ne>=Q.y;if(se&&!x.x){S.scrollTo({top:ne,behavior:p});return}se?j.y=S.scrollTop-ne:j.y=R===Pe.Down?S.scrollTop-G.y:S.scrollTop-Q.y,j.y&&S.scrollBy({top:-j.y,behavior:p});break}}this.handleMove(n,Fl(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()}}Cj.activators=[{eventName:"onKeyDown",handler:(a,n,l)=>{let{keyboardCodes:s=wj,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 Nb(a){return!!(a&&"distance"in a)}function Mb(a){return!!(a&&"delay"in a)}class Im{constructor(n,l,s){var c;s===void 0&&(s=L5(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=Kl(f),this.documentListeners=new is(this.document),this.listeners=new is(s),this.windowListeners=new is(dn(f)),this.initialCoordinates=(c=fm(d))!=null?c:Kn,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(qn.Resize,this.handleCancel),this.windowListeners.add(qn.DragStart,Rb),this.windowListeners.add(qn.VisibilityChange,this.handleCancel),this.windowListeners.add(qn.ContextMenu,Rb),this.documentListeners.add(qn.Keydown,this.handleKeydown),l){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Mb(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(Nb(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(qn.Click,O5,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qn.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=fm(n))!=null?l:Kn,g=xc(c,m);if(!s&&p){if(Nb(p)){if(p.tolerance!=null&&pf(g,p.tolerance))return this.handleCancel();if(pf(g,p.distance))return this.handleStart()}if(Mb(p)&&pf(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 z5={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ej extends Im{constructor(n){const{event:l}=n,s=Kl(l.target);super(n,z5,s)}}Ej.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 B5={move:{name:"mousemove"},end:{name:"mouseup"}};var mm;(function(a){a[a.RightClick=2]="RightClick"})(mm||(mm={}));class _5 extends Im{constructor(n){super(n,B5,Kl(n.event.target))}}_5.activators=[{eventName:"onMouseDown",handler:(a,n)=>{let{nativeEvent:l}=a,{onActivation:s}=n;return l.button===mm.RightClick?!1:(s?.({event:l}),!0)}}];const gf={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class q5 extends Im{constructor(n){super(n,gf)}static setup(){return window.addEventListener(gf.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(gf.move.name,n)};function n(){}}}q5.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 ls;(function(a){a[a.Pointer=0]="Pointer",a[a.DraggableRect=1]="DraggableRect"})(ls||(ls={}));var Sc;(function(a){a[a.TreeOrder=0]="TreeOrder",a[a.ReversedTreeOrder=1]="ReversedTreeOrder"})(Sc||(Sc={}));function F5(a){let{acceleration:n,activator:l=ls.Pointer,canScroll:s,draggingRect:c,enabled:d,interval:f=5,order:p=Sc.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:v,delta:b,threshold:x}=a;const j=P5({delta:b,disabled:!d}),[D,S]=G6(),R=Pt({x:0,y:0}),E=Pt({x:0,y:0}),A=Ft(()=>{switch(l){case ls.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case ls.DraggableRect:return c}},[l,c,m]),B=Pt(null),q=Qn(()=>{const Q=B.current;if(!Q)return;const T=R.current.x*E.current.x,O=R.current.y*E.current.y;Q.scrollBy(T,O)},[]),G=Ft(()=>p===Sc.TreeOrder?[...g].reverse():g,[p,g]);xt(()=>{if(!d||!g.length||!A){S();return}for(const Q of G){if(s?.(Q)===!1)continue;const T=g.indexOf(Q),O=v[T];if(!O)continue;const{direction:W,speed:ae}=T5(Q,O,A,n,x);for(const ne of["x","y"])j[ne][W[ne]]||(ae[ne]=0,W[ne]=0);if(ae.x>0||ae.y>0){S(),B.current=Q,D(q,f),R.current=ae,E.current=W;return}}R.current={x:0,y:0},E.current={x:0,y:0},S()},[n,q,s,S,d,f,JSON.stringify(A),JSON.stringify(j),D,g,G,v,JSON.stringify(x)])}const H5={x:{[$t.Backward]:!1,[$t.Forward]:!1},y:{[$t.Backward]:!1,[$t.Forward]:!1}};function P5(a){let{delta:n,disabled:l}=a;const s=dm(n);return ws(c=>{if(l||!s||!c)return H5;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 k5(a,n){const l=n!=null?a.get(n):void 0,s=l?l.node.current:null;return ws(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 vs;(function(a){a[a.Always=0]="Always",a[a.BeforeDragging=1]="BeforeDragging",a[a.WhileDragging=2]="WhileDragging"})(vs||(vs={}));var pm;(function(a){a.Optimized="optimized"})(pm||(pm={}));const Ab=new Map;function V5(a,n){let{dragging:l,dependencies:s,config:c}=n;const[d,f]=Yn(null),{frequency:p,measure:m,strategy:g}=c,v=Pt(a),b=R(),x=ps(b),j=Qn(function(E){E===void 0&&(E=[]),!x.current&&f(A=>A===null?E:A.concat(E.filter(B=>!A.includes(B))))},[x]),D=Pt(null),S=ws(E=>{if(b&&!l)return Ab;if(!E||E===Ab||v.current!==a||d!=null){const A=new Map;for(let B of a){if(!B)continue;if(d&&d.length>0&&!d.includes(B.id)&&B.rect.current){A.set(B.id,B.rect.current);continue}const q=B.node.current,G=q?new km(m(q),q):null;B.rect.current=G,G&&A.set(B.id,G)}return A}return E},[a,d,l,b,m]);return xt(()=>{v.current=a},[a]),xt(()=>{b||j()},[l,b]),xt(()=>{d&&d.length>0&&f(null)},[JSON.stringify(d)]),xt(()=>{b||typeof p!="number"||D.current!==null||(D.current=setTimeout(()=>{j(),D.current=null},p))},[p,b,j,...s]),{droppableRects:S,measureDroppableContainers:j,measuringScheduled:d!=null};function R(){switch(g){case vs.Always:return!1;case vs.BeforeDragging:return l;default:return!l}}}function Dj(a,n){return ws(l=>a?l||(typeof n=="function"?n(a):a):null,[n,a])}function G5(a,n){return Dj(a,n)}function Y5(a){let{callback:n,disabled:l}=a;const s=qm(n),c=Ft(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:d}=window;return new d(s)},[s,l]);return xt(()=>()=>c?.disconnect(),[c]),c}function Bc(a){let{callback:n,disabled:l}=a;const s=qm(n),c=Ft(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:d}=window;return new d(s)},[l]);return xt(()=>()=>c?.disconnect(),[c]),c}function X5(a){return new km(Zl(a),a)}function $b(a,n,l){n===void 0&&(n=X5);const[s,c]=Yn(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=Y5({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=Bc({callback:d});return ha(()=>{d(),a?(p?.observe(a),f?.observe(document.body,{childList:!0,subtree:!0})):(p?.disconnect(),f?.disconnect())},[a]),s}function Q5(a){const n=Dj(a);return gj(a,n)}const Lb=[];function K5(a){const n=Pt(a),l=ws(s=>a?s&&s!==Lb&&a&&n.current&&a.parentNode===n.current.parentNode?s:Pm(a):Lb,[a]);return xt(()=>{n.current=a},[a]),l}function Z5(a){const[n,l]=Yn(null),s=Pt(a),c=Qn(d=>{const f=mf(d.target);f&&l(p=>p?(p.set(f,hm(f)),new Map(p)):null)},[]);return xt(()=>{const d=s.current;if(a!==d){f(d);const p=a.map(m=>{const g=mf(m);return g?(g.addEventListener("scroll",c,{passive:!0}),[g,hm(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=mf(m);g?.removeEventListener("scroll",c)})}},[c,a]),Ft(()=>a.length?n?Array.from(n.values()).reduce((d,f)=>Fl(d,f),Kn):Sj(a):Kn,[a,n])}function Ob(a,n){n===void 0&&(n=[]);const l=Pt(null);return xt(()=>{l.current=null},n),xt(()=>{const s=a!==Kn;s&&!l.current&&(l.current=a),!s&&l.current&&(l.current=null)},[a]),l.current?xc(a,l.current):Kn}function W5(a){xt(()=>{if(!zc)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 J5(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 Tj(a){return Ft(()=>a?w5(a):null,[a])}const Ub=[];function e3(a,n){n===void 0&&(n=Zl);const[l]=a,s=Tj(l?dn(l):null),[c,d]=Yn(Ub);function f(){d(()=>a.length?a.map(m=>xj(m)?s:new km(n(m),m)):Ub)}const p=Bc({callback:f});return ha(()=>{p?.disconnect(),f(),a.forEach(m=>p?.observe(m))},[a]),c}function t3(a){if(!a)return null;if(a.children.length>1)return a;const n=a.children[0];return Ss(n)?n:a}function n3(a){let{measure:n}=a;const[l,s]=Yn(null),c=Qn(g=>{for(const{target:v}of g)if(Ss(v)){s(b=>{const x=n(v);return b?{...b,width:x.width,height:x.height}:x});break}},[n]),d=Bc({callback:c}),f=Qn(g=>{const v=t3(g);d?.disconnect(),v&&d?.observe(v),s(v?n(v):null)},[n,d]),[p,m]=yc(f);return Ft(()=>({nodeRef:p,rect:l,setRef:m}),[l,p,m])}const a3=[{sensor:Ej,options:{}},{sensor:Cj,options:{}}],i3={current:{}},pc={draggable:{measure:Tb},droppable:{measure:Tb,strategy:vs.WhileDragging,frequency:pm.Optimized},dragOverlay:{measure:Zl}};class rs 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 l3={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new rs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:jc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pc,measureDroppableContainers:jc,windowRect:null,measuringScheduled:!1},r3={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:jc,draggableNodes:new Map,over:null,measureDroppableContainers:jc},_c=Es(r3),Rj=Es(l3);function s3(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new rs}}}function o3(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 rs(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 rs(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 rs(a.droppable.containers);return d.delete(l),{...a,droppable:{...a.droppable,containers:d}}}default:return a}}function c3(a){let{disabled:n}=a;const{active:l,activatorEvent:s,draggableNodes:c}=Il(_c),d=dm(s),f=dm(l?.id);return xt(()=>{if(!n&&!s&&d&&f!=null){if(!Fm(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=Q6(v);if(b){b.focus();break}}})}},[s,n,c,f,d]),null}function u3(a,n){let{transform:l,...s}=n;return a!=null&&a.length?a.reduce((c,d)=>d({transform:c,...s}),l):l}function d3(a){return Ft(()=>({draggable:{...pc.draggable,...a?.draggable},droppable:{...pc.droppable,...a?.droppable},dragOverlay:{...pc.dragOverlay,...a?.dragOverlay}}),[a?.draggable,a?.droppable,a?.dragOverlay])}function f3(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;ha(()=>{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=gj(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 x=vj(g);x&&x.scrollBy({top:b.y,left:b.x})}},[n,f,p,s,l])}const Nj=Es({...Kn,scaleX:1,scaleY:1});var mi;(function(a){a[a.Uninitialized=0]="Uninitialized",a[a.Initializing=1]="Initializing",a[a.Initialized=2]="Initialized"})(mi||(mi={}));const h3=n5(function(n){var l,s,c,d;let{id:f,accessibility:p,autoScroll:m=!0,children:g,sensors:v=a3,collisionDetection:b=g5,measuring:x,modifiers:j,...D}=n;const S=a5(o3,void 0,s3),[R,E]=S,[A,B]=r5(),[q,G]=Yn(mi.Uninitialized),Q=q===mi.Initialized,{draggable:{active:T,nodes:O,translate:W},droppable:{containers:ae}}=R,ne=T!=null?O.get(T):null,se=Pt({initial:null,translated:null}),Ee=Ft(()=>{var nt;return T!=null?{id:T,data:(nt=ne?.data)!=null?nt:i3,rect:se}:null},[T,ne]),V=Pt(null),[Z,U]=Yn(null),[k,Y]=Yn(null),te=ps(D,Object.values(D)),re=Cs("DndDescribedBy",f),ge=Ft(()=>ae.getEnabled(),[ae]),ie=d3(x),{droppableRects:ce,measureDroppableContainers:Se,measuringScheduled:je}=V5(ge,{dragging:Q,dependencies:[W.x,W.y],config:ie.droppable}),Ue=k5(O,T),Ot=Ft(()=>k?fm(k):null,[k]),Dt=ja(),Tt=G5(Ue,ie.draggable.measure);f3({activeNode:T!=null?O.get(T):null,config:Dt.layoutShiftCompensation,initialRect:Tt,measure:ie.draggable.measure});const Be=$b(Ue,ie.draggable.measure,Tt),Dn=$b(Ue?Ue.parentElement:null),ke=Pt({activatorEvent:null,active:null,activeNode:Ue,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:ae,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ut=ae.getNodeFor((l=ke.current.over)==null?void 0:l.id),Vt=n3({measure:ie.dragOverlay.measure}),ea=(s=Vt.nodeRef.current)!=null?s:Ue,Gt=Q?(c=Vt.rect)!=null?c:Be:null,Xt=!!(Vt.nodeRef.current&&Vt.rect),Zi=Q5(Xt?null:Be),ga=Tj(ea?dn(ea):null),fn=K5(Q?Ut??Ue:null),Hn=e3(fn),Pa=u3(j,{transform:{x:W.x-Zi.x,y:W.y-Zi.y,scaleX:1,scaleY:1},activatorEvent:k,active:Ee,activeNodeRect:Be,containerNodeRect:Dn,draggingNodeRect:Gt,over:ke.current.over,overlayNodeRect:Vt.rect,scrollableAncestors:fn,scrollableAncestorRects:Hn,windowRect:ga}),bi=Ot?Fl(Ot,W):null,Tn=Z5(fn),va=Ob(Tn),ta=Ob(Tn,[Be]),rt=Fl(Pa,va),st=Gt?y5(Gt,Pa):null,Ve=Ee&&st?b({active:Ee,collisionRect:st,droppableRects:ce,droppableContainers:ge,pointerCoordinates:bi}):null,yi=h5(Ve,"id"),[Qt,Wi]=Yn(null),Kt=Xt?Pa:Fl(Pa,ta),ba=v5(Kt,(d=Qt?.rect)!=null?d:null,Be),nn=Pt(null),na=Qn((nt,zt)=>{let{sensor:jt,options:hn}=zt;if(V.current==null)return;const St=O.get(V.current);if(!St)return;const dt=nt.nativeEvent,Rt=new jt({active:V.current,activeNode:St,event:dt,options:hn,context:ke,onAbort(Ze){if(!O.get(Ze))return;const{onDragAbort:L}=te.current,H={id:Ze};L?.(H),A({type:"onDragAbort",event:H})},onPending(Ze,M,L,H){if(!O.get(Ze))return;const{onDragPending:le}=te.current,fe={id:Ze,constraint:M,initialCoordinates:L,offset:H};le?.(fe),A({type:"onDragPending",event:fe})},onStart(Ze){const M=V.current;if(M==null)return;const L=O.get(M);if(!L)return;const{onDragStart:H}=te.current,ee={activatorEvent:dt,active:{id:M,data:L.data,rect:se}};Io(()=>{H?.(ee),G(mi.Initializing),E({type:Et.DragStart,initialCoordinates:Ze,active:M}),A({type:"onDragStart",event:ee}),U(nn.current),Y(dt)})},onMove(Ze){E({type:Et.DragMove,coordinates:Ze})},onEnd:aa(Et.DragEnd),onCancel:aa(Et.DragCancel)});nn.current=Rt;function aa(Ze){return async function(){const{active:L,collisions:H,over:ee,scrollAdjustedTranslate:le}=ke.current;let fe=null;if(L&&le){const{cancelDrop:be}=te.current;fe={activatorEvent:dt,active:L,collisions:H,delta:le,over:ee},Ze===Et.DragEnd&&typeof be=="function"&&await Promise.resolve(be(fe))&&(Ze=Et.DragCancel)}V.current=null,Io(()=>{E({type:Ze}),G(mi.Uninitialized),Wi(null),U(null),Y(null),nn.current=null;const be=Ze===Et.DragEnd?"onDragEnd":"onDragCancel";if(fe){const oe=te.current[be];oe?.(fe),A({type:be,event:fe})}})}}},[O]),ya=Qn((nt,zt)=>(jt,hn)=>{const St=jt.nativeEvent,dt=O.get(hn);if(V.current!==null||!dt||St.dndKit||St.defaultPrevented)return;const Rt={active:dt};nt(jt,zt.options,Rt)===!0&&(St.dndKit={capturedBy:zt.sensor},V.current=hn,na(jt,zt))},[O,na]),xi=I5(v,ya);W5(v),ha(()=>{Be&&q===mi.Initializing&&G(mi.Initialized)},[Be,q]),xt(()=>{const{onDragMove:nt}=te.current,{active:zt,activatorEvent:jt,collisions:hn,over:St}=ke.current;if(!zt||!jt)return;const dt={active:zt,activatorEvent:jt,collisions:hn,delta:{x:rt.x,y:rt.y},over:St};Io(()=>{nt?.(dt),A({type:"onDragMove",event:dt})})},[rt.x,rt.y]),xt(()=>{const{active:nt,activatorEvent:zt,collisions:jt,droppableContainers:hn,scrollAdjustedTranslate:St}=ke.current;if(!nt||V.current==null||!zt||!St)return;const{onDragOver:dt}=te.current,Rt=hn.get(yi),aa=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:aa};Io(()=>{Wi(aa),dt?.(Ze),A({type:"onDragOver",event:Ze})})},[yi]),ha(()=>{ke.current={activatorEvent:k,active:Ee,activeNode:Ue,collisionRect:st,collisions:Ve,droppableRects:ce,draggableNodes:O,draggingNode:ea,draggingNodeRect:Gt,droppableContainers:ae,over:Qt,scrollableAncestors:fn,scrollAdjustedTranslate:rt},se.current={initial:Gt,translated:st}},[Ee,Ue,Ve,st,O,ea,Gt,ce,ae,Qt,fn,rt]),F5({...Dt,delta:W,draggingRect:st,pointerCoordinates:bi,scrollableAncestors:fn,scrollableAncestorRects:Hn});const xa=Ft(()=>({active:Ee,activeNode:Ue,activeNodeRect:Be,activatorEvent:k,collisions:Ve,containerNodeRect:Dn,dragOverlay:Vt,draggableNodes:O,droppableContainers:ae,droppableRects:ce,over:Qt,measureDroppableContainers:Se,scrollableAncestors:fn,scrollableAncestorRects:Hn,measuringConfiguration:ie,measuringScheduled:je,windowRect:ga}),[Ee,Ue,Be,k,Ve,Dn,Vt,O,ae,ce,Qt,Se,fn,Hn,ie,je,ga]),ji=Ft(()=>({activatorEvent:k,activators:xi,active:Ee,activeNodeRect:Be,ariaDescribedById:{draggable:re},dispatch:E,draggableNodes:O,over:Qt,measureDroppableContainers:Se}),[k,xi,Ee,Be,E,re,O,Qt,Se]);return Gn.createElement(pj.Provider,{value:B},Gn.createElement(_c.Provider,{value:ji},Gn.createElement(Rj.Provider,{value:xa},Gn.createElement(Nj.Provider,{value:ba},g)),Gn.createElement(c3,{disabled:p?.restoreFocus===!1})),Gn.createElement(c5,{...p,hiddenTextDescribedById:re}));function ja(){const nt=Z?.autoScrollEnabled===!1,zt=typeof m=="object"?m.enabled===!1:m===!1,jt=Q&&!nt&&!zt;return typeof m=="object"?{...m,enabled:jt}:{enabled:jt}}}),m3=Es(null),zb="button",p3="Draggable";function g3(a){let{id:n,data:l,disabled:s=!1,attributes:c}=a;const d=Cs(p3),{activators:f,activatorEvent:p,active:m,activeNodeRect:g,ariaDescribedById:v,draggableNodes:b,over:x}=Il(_c),{role:j=zb,roleDescription:D="draggable",tabIndex:S=0}=c??{},R=m?.id===n,E=Il(R?Nj:m3),[A,B]=yc(),[q,G]=yc(),Q=J5(f,n),T=ps(l);ha(()=>(b.set(n,{id:n,key:d,node:A,activatorNode:q,data:T}),()=>{const W=b.get(n);W&&W.key===d&&b.delete(n)}),[b,n]);const O=Ft(()=>({role:j,tabIndex:S,"aria-disabled":s,"aria-pressed":R&&j===zb?!0:void 0,"aria-roledescription":D,"aria-describedby":v.draggable}),[s,j,S,R,D,v.draggable]);return{active:m,activatorEvent:p,activeNodeRect:g,attributes:O,isDragging:R,listeners:s?void 0:Q,node:A,over:x,setNodeRef:B,setActivatorNodeRef:G,transform:E}}function v3(){return Il(Rj)}const b3="Droppable",y3={timeout:25};function x3(a){let{data:n,disabled:l=!1,id:s,resizeObserverConfig:c}=a;const d=Cs(b3),{active:f,dispatch:p,over:m,measureDroppableContainers:g}=Il(_c),v=Pt({disabled:l}),b=Pt(!1),x=Pt(null),j=Pt(null),{disabled:D,updateMeasurementsFor:S,timeout:R}={...y3,...c},E=ps(S??s),A=Qn(()=>{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]),B=Bc({callback:A,disabled:D||!f}),q=Qn((O,W)=>{B&&(W&&(B.unobserve(W),b.current=!1),O&&B.observe(O))},[B]),[G,Q]=yc(q),T=ps(n);return xt(()=>{!B||!G.current||(B.disconnect(),b.current=!1,B.observe(G.current))},[G,B]),xt(()=>(p({type:Et.RegisterDroppable,element:{id:s,key:d,disabled:l,node:G,rect:x,data:T}}),()=>p({type:Et.UnregisterDroppable,key:d,id:s})),[s]),xt(()=>{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:x,isOver:m?.id===s,node:G,over:m,setNodeRef:Q}}const j3=a=>{let{transform:n}=a;return{...n,x:0}},Vm=await C("react"),{useMemo:wc,useRef:Gm,useEffect:Cc,useState:S3,useContext:w3}=Vm;function Mj(a,n,l){const s=a.slice();return s.splice(l<0?s.length+l:l,0,s.splice(n,1)[0]),s}function C3(a,n){return a.reduce((l,s,c)=>{const d=n.get(s);return d&&(l[c]=d),l},Array(a.length))}function Vo(a){return a!==null&&a>=0}function E3(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 D3(a){return typeof a=="boolean"?{draggable:a,droppable:a}:a}const Aj=a=>{let{rects:n,activeIndex:l,overIndex:s,index:c}=a;const d=Mj(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}},Go={scaleX:1,scaleY:1},T3=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,...Go}:null}const m=R3(d,c,l);return c>l&&c<=f?{x:0,y:-p.height-m,...Go}:c<l&&c>=f?{x:0,y:p.height+m,...Go}:{x:0,y:0,...Go}};function R3(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 $j="Sortable",Lj=Vm.createContext({activeIndex:-1,containerId:$j,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Aj,disabled:{draggable:!1,droppable:!1}});function N3(a){let{children:n,id:l,items:s,strategy:c=Aj,disabled:d=!1}=a;const{active:f,dragOverlay:p,droppableRects:m,over:g,measureDroppableContainers:v}=v3(),b=Cs($j,l),x=p.rect!==null,j=wc(()=>s.map(Q=>typeof Q=="object"&&"id"in Q?Q.id:Q),[s]),D=f!=null,S=f?j.indexOf(f.id):-1,R=g?j.indexOf(g.id):-1,E=Gm(j),A=!E3(j,E.current),B=R!==-1&&S===-1||A,q=D3(d);ha(()=>{A&&D&&v(j)},[A,j,D,v]),Cc(()=>{E.current=j},[j]);const G=wc(()=>({activeIndex:S,containerId:b,disabled:q,disableTransforms:B,items:j,overIndex:R,useDragOverlay:x,sortedRects:C3(j,m),strategy:c}),[S,b,q.draggable,q.droppable,B,j,R,m,x,c]);return Vm.createElement(Lj.Provider,{value:G},n)}const M3=a=>{let{id:n,items:l,activeIndex:s,overIndex:c}=a;return Mj(l,s,c).indexOf(n)},A3=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},$3={duration:200,easing:"ease"},Oj="transform",L3=gs.Transition.toString({property:Oj,duration:0,easing:"linear"}),O3={roleDescription:"sortable"};function U3(a){let{disabled:n,index:l,node:s,rect:c}=a;const[d,f]=S3(null),p=Gm(l);return ha(()=>{if(!n&&l!==p.current&&s.current){const m=c.current;if(m){const g=Zl(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]),Cc(()=>{d&&f(null)},[d]),d}function z3(a){let{animateLayoutChanges:n=A3,attributes:l,disabled:s,data:c,getNewIndex:d=M3,id:f,strategy:p,resizeObserverConfig:m,transition:g=$3}=a;const{items:v,containerId:b,activeIndex:x,disabled:j,disableTransforms:D,sortedRects:S,overIndex:R,useDragOverlay:E,strategy:A}=w3(Lj),B=B3(s,j),q=v.indexOf(f),G=wc(()=>({sortable:{containerId:b,index:q,items:v},...c}),[b,c,q,v]),Q=wc(()=>v.slice(v.indexOf(f)),[v,f]),{rect:T,node:O,isOver:W,setNodeRef:ae}=x3({id:f,data:G,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:Q,...m}}),{active:ne,activatorEvent:se,activeNodeRect:Ee,attributes:V,setNodeRef:Z,listeners:U,isDragging:k,over:Y,setActivatorNodeRef:te,transform:re}=g3({id:f,data:G,attributes:{...O3,...l},disabled:B.draggable}),ge=V6(ae,Z),ie=!!ne,ce=ie&&!D&&Vo(x)&&Vo(R),Se=!E&&k,je=Se&&ce?re:null,Ot=ce?je??(p??A)({rects:S,activeNodeRect:Ee,activeIndex:x,overIndex:R,index:q}):null,Dt=Vo(x)&&Vo(R)?d({id:f,items:v,activeIndex:x,overIndex:R}):q,Tt=ne?.id,Be=Gm({activeId:Tt,items:v,newIndex:Dt,containerId:b}),Dn=v!==Be.current.items,ke=n({active:ne,containerId:b,isDragging:k,isSorting:ie,id:f,index:q,items:v,newIndex:Be.current.newIndex,previousItems:Be.current.items,previousContainerId:Be.current.containerId,transition:g,wasDragging:Be.current.activeId!=null}),Ut=U3({disabled:!ke,index:q,node:O,rect:T});return Cc(()=>{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]),Cc(()=>{if(Tt===Be.current.activeId)return;if(Tt!=null&&Be.current.activeId==null){Be.current.activeId=Tt;return}const ea=setTimeout(()=>{Be.current.activeId=Tt},50);return()=>clearTimeout(ea)},[Tt]),{active:ne,activeIndex:x,attributes:V,data:G,rect:T,index:q,newIndex:Dt,items:v,isOver:W,isSorting:ie,isDragging:k,listeners:U,node:O,overIndex:R,over:Y,setNodeRef:ge,setActivatorNodeRef:te,setDroppableNodeRef:ae,setDraggableNodeRef:Z,transform:Ut??Ot,transition:Vt()};function Vt(){if(Ut||Dn&&Be.current.newIndex===q)return L3;if(!(Se&&!Fm(se)||!g)&&(ie||ke))return gs.Transition.toString({...g,property:Oj})}}function B3(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 _3(a){return Gi({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:q3}=await C("@baseplate-dev/ui-components");function F3({id:a,children:n}){const{attributes:l,listeners:s,setNodeRef:c,transform:d,transition:f}=z3({id:a}),p={transform:gs.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(q3,{className:"cursor-grab",variant:"ghost",size:"icon",children:o.jsx(_3,{})})}),o.jsx("div",{className:"flex-1",children:n})]})}function Uj({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(h3,{collisionDetection:m5,onDragEnd:l,modifiers:[j3],children:o.jsx("div",{className:"flex w-full flex-col gap-4",children:o.jsx(N3,{items:a.map(({id:s})=>s),strategy:T3,children:a.map(s=>o.jsx(F3,{id:s.id,children:s.element},s.id))})})})}const Bb=a=>Symbol.iterator in a,_b=a=>"entries"in a,qb=(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},H3=(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 P3(a,n){return Object.is(a,n)?!0:typeof a!="object"||a===null||typeof n!="object"||n===null?!1:!Bb(a)||!Bb(n)?qb({entries:()=>Object.entries(a)},{entries:()=>Object.entries(n)}):_b(a)&&_b(n)?qb(a,n):H3(a,n)}const k3=await C("react");function I3(a){const n=k3.useRef(void 0);return l=>{const s=a(l);return P3(n.current,s)?n.current:n.current=s}}class Ec extends Error{constructor(n){super(`Project not found for project ID: ${n}`),this.name="ProjectNotFoundError"}}function Wl(a){return n=>{throw f6(n)&&n.data?.code==="NOT_FOUND"?new Ec(a):n}}async function V3(a){return Fn?[]:Lt.plugins.getAvailablePlugins.mutate({projectId:a}).catch(Wl(a))}async function G3(a){if(Fn){const s=await(await fetch("/preview-app.json")).text();return{contents:s,hash:await sj(s)}}return(await Lt.projects.readDefinition.query({id:a}).catch(Wl(a))).contents}async function Y3(a,n,l){return Fn?{type:"success"}:(await Lt.projects.writeDefinition.mutate({id:a,newContents:n,oldContentsHash:l}).catch(Wl(a))).result}function X3(a,n){if(Fn)return()=>{};const l=Lt.projects.onProjectJsonChanged.subscribe({id:a},{onData:n});return()=>{l.unsubscribe()}}async function Q3(){return Fn?[{id:"preview-project",name:"Preview Project",directory:"~/preview-project"}]:Lt.projects.list.query()}async function K3(a){Fn||await Lt.sync.startSync.mutate({id:a}).catch(Wl(a))}async function Z3(a){return Fn?{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(Wl(a))}async function W3(a){Fn||await Lt.sync.cancelSync.mutate({id:a}).catch(Wl(a))}async function J3(){return Fn?{version:"preview",featureFlags:[],userConfig:{}}:Lt.version.get.query()}const{toast:Yo}=await C("@baseplate-dev/ui-components"),{useEffect:eD}=await C("react"),zj={status:"not-started",packages:{}},Bj=wm(a=>({metadata:zj,setMetadata:n=>{a({metadata:n})}}));function tD(){const{currentProjectId:a}=En(),{setMetadata:n}=Bj();eD(()=>{if(n(zj),!a)return;let l=!1;const s=()=>{Z3(a).then(p=>{l||n(p)}).catch(p=>{p instanceof Ec||Yo.error(Cn(p,"Failed to fetch sync metadata."))})};if(s(),Fn)return;const c=Om.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 Dc(a){return Bj(I3(n=>a?a(n.metadata):n.metadata))}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 Kr=(a,n,l)=>{const s=a!==1?n+"s":n;return a+" "+s+" "+l},nD=({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 gm(){return gm=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},gm.apply(null,arguments)}const aD=await C("react"),{useEffect:Fb,useState:iD}=await C("react"),ns=60,as=ns*60,Hl=as*24,Qo=Hl*7,Hb=Hl*30,Pb=Hl*365,lD=()=>Date.now();function _j({date:a,formatter:n,component:l="time",live:s=!0,minPeriod:c=0,maxPeriod:d=Qo,title:f,now:p=lD,...m}){const[g,v]=iD(p());Fb(()=>{if(!s)return;const T=(()=>{const O=Xo(a).valueOf();if(!O)return console.warn("[react-timeago] Invalid Date provided"),0;const W=Math.round(Math.abs(g-O)/1e3),ae=W<ns?1e3:W<as?1e3*ns:W<Hl?1e3*as:1e3*Qo,ne=Math.min(Math.max(ae,c*1e3),d*1e3);return ne?setTimeout(()=>{v(p())},ne):0})();return()=>{T&&clearTimeout(T)}},[a,s,d,c,p,g]),Fb(()=>{v(p())},[a]);const b=l,x=Xo(a).valueOf();if(!x)return null;const j=Math.round(Math.abs(g-x)/1e3),D=x<g?"ago":"from now",[S,R]=j<ns?[Math.round(j),"second"]:j<as?[Math.round(j/ns),"minute"]:j<Hl?[Math.round(j/as),"hour"]:j<Qo?[Math.round(j/Hl),"day"]:j<Hb?[Math.round(j/Qo),"week"]:j<Pb?[Math.round(j/Hb),"month"]:[Math.round(j/Pb),"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,B=(Q=Q,T=T,O=O,W=x,ae=Kr,ne=ne)=>Kr(Q,T,O),q=n||Kr;let G;try{G=q(S,R,D,x,B,p),G||(G=Kr(S,R,D,x,B,p))}catch(Q){console.error("[react-timeago] Formatter threw an error:",Q),G=Kr(S,R,D)}return aD.createElement(b,gm({},A,{title:E}),G)}const qj=await C("react"),Fj=qj.createContext(null);function Hj(){const a=qj.useContext(Fj);if(!a)throw new Error("useClientVersion must be used within a <ClientVersionContext.Provider>");return a}const rD=nD({locale:"en"}),Pj=(...a)=>a[1]==="second"?"Just now":rD(...a),{Badge:sD,Button:vf,Table:oD,TableBody:cD,TableCell:bf,TableHead:yf,TableHeader:uD,TableRow:kb,toast:Zr,Tooltip:dD,TooltipContent:fD,TooltipTrigger:hD}=await C("@baseplate-dev/ui-components");function mD(a){switch(a){case"success":return o.jsx(Rw,{className:"text-success-foreground"});case"unknown-error":case"command-error":return o.jsx(Tw,{className:"text-error-foreground"});case"conflicts":return o.jsx(vx,{className:"text-warning-foreground"});case"cancelled":return o.jsx(Dw,{className:"text-secondary-foreground"});case"not-synced":return o.jsx(O0,{className:"text-secondary-foreground"});case"in-progress":return o.jsx(gx,{className:"text-secondary-foreground"});default:return o.jsx(O0,{className:"text-secondary-foreground"})}}function pD(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 gD(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 vD(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 bD({packageId:a,filesWithConflicts:n}){const l=Hj(),{currentProjectId:s}=En();if(n.length===0)return null;const c=p=>{s&&Lt.sync.openEditor.mutate({id:s,packageId:a,relativePath:p}).catch(m=>{Zr.error(Cn(m,"Failed to open editor"))})},d=p=>{s&&Lt.sync.keepConflictFile.mutate({id:s,packageId:a,relativePath:p.relativePath}).then(()=>{Zr.success(`File ${p.relativePath} was kept!`)}).catch(m=>{Zr.error(Cn(m,"Failed to keep file"))})},f=p=>{s&&Lt.sync.deleteConflictFile.mutate({id:s,packageId:a,relativePath:p.relativePath}).then(()=>{Zr.success(`File ${p.relativePath} was deleted!`)}).catch(m=>{Zr.error(Cn(m,"Failed to delete file"))})};return o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium",children:"Merge Conflicts"}),o.jsxs(oD,{children:[o.jsx(uD,{children:o.jsxs(kb,{children:[o.jsx(yf,{className:"w-3/5",children:"Name"}),o.jsx(yf,{className:"w-1/5",children:o.jsx("div",{className:"flex items-center gap-2",children:"Type"})}),o.jsx(yf,{className:"w-1/5",children:"Actions"})]})}),o.jsx(cD,{children:n.map(p=>o.jsxs(kb,{children:[o.jsx(bf,{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(bf,{children:o.jsxs(dD,{children:[o.jsx(hD,{children:o.jsx("span",{children:gD(p.conflictType)})}),o.jsx(fD,{side:"left",className:"max-w-sm",children:vD(p.conflictType)})]})}),o.jsxs(bf,{children:[p.conflictType==="merge-conflict"&&l.userConfig.sync?.editor&&o.jsx(vf,{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(vf,{variant:"outline",size:"sm",onClick:()=>{d(p)},children:"Keep"}),o.jsx(vf,{variant:"destructive",size:"sm",onClick:()=>{f(p)},children:"Delete"})]})]})]},p.relativePath))})]})]})}function yD({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(_j,{date:new Date(n.result.completedAt),formatter:Pj}):"-"}),o.jsxs(sD,{variant:n.status==="unknown-error"||n.status==="command-error"?"destructive":"secondary",className:"flex items-center gap-1",children:[mD(n.status),pD(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(bD,{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:Ib,AlertDescription:Vb,AlertTitle:Gb}=await C("@baseplate-dev/ui-components");function xD({className:a}){const n=Dc();if(n.globalErrors?.length)return o.jsxs(Ib,{variant:"error",children:[o.jsx(Gb,{children:"Error compiling project."}),o.jsx(Vb,{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(Ib,{variant:"default",children:[o.jsx(Gb,{children:"No packages found to be synced."}),o.jsx(Vb,{children:"Sync status will appear here once packages have been added."})]});const s=Object.entries(n.packages),c=Zn(s,[([,d])=>d.order]);return o.jsx("div",{className:Te("space-y-3",a),children:c.map(([d,f])=>o.jsx(yD,{packageId:d,packageInfo:f},d))})}const{useBlockBeforeContinue:jD,useProjectDefinition:SD}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Ko,Dialog:wD,DialogContent:CD,DialogDescription:ED,DialogFooter:DD,DialogHeader:TD,DialogTitle:RD,DialogTrigger:ND,Tabs:MD,TabsContent:Yb,TabsList:AD,TabsTrigger:Xb,toast:xf}=await C("@baseplate-dev/ui-components"),{useRef:$D,useState:LD}=await C("react");function OD({className:a}){const[n,l]=LD(!1),{definitionContainer:s}=SD(),{currentProjectId:c}=En(),d=jD(),f=$D(s);f.current=s;const p=Dc(b=>b.status==="in-progress"),m=Dc(b=>Object.values(b.packages).some(x=>x.status==="conflicts")),g=()=>{if(c){if(m){xf.warning("Conflicts must be resolved before syncing");return}K3(c).catch(b=>xf.error(Cn(b))),l(!0)}},v=()=>{c&&W3(c).catch(b=>xf.error(Gl(b)))};return o.jsx("div",{className:Te(a),children:o.jsxs(wD,{open:n,onOpenChange:b=>{l(b)},children:[o.jsx(ND,{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(vx,{}):o.jsx(gx,{}),p?"Syncing...":m?"Resolve conflicts":"Sync"]})}),o.jsxs(CD,{width:"lg","aria-description":"Sync project dialog",children:[o.jsxs(TD,{children:[o.jsx(RD,{children:"Sync Project"}),o.jsx(ED,{children:"Sync the project configuration to the codebase of your project."})]}),o.jsxs(MD,{defaultValue:"packages",className:"mt-4 min-w-0",children:[o.jsxs(AD,{className:"grid w-full grid-cols-2",children:[o.jsx(Xb,{value:"packages",children:"Packages"}),o.jsx(Xb,{value:"console-log",children:"Console log"})]}),o.jsx(Yb,{value:"packages",className:"mt-4",children:o.jsx(xD,{})}),o.jsx(Yb,{value:"console-log",className:"mt-4",children:o.jsx(oj,{})})]}),o.jsxs(DD,{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:UD}=await C("@baseplate-dev/project-builder-lib/web"),{Breadcrumb:zD,BreadcrumbItem:Qb,BreadcrumbLink:BD,BreadcrumbList:_D,BreadcrumbPage:qD,BreadcrumbSeparator:Kb,Button:FD,DropdownMenu:HD,DropdownMenuContent:PD,DropdownMenuGroup:kD,DropdownMenuItem:ID,DropdownMenuTrigger:VD}=await C("@baseplate-dev/ui-components"),{Fragment:GD}=await C("react");function YD(){const{definitionContainer:a}=UD(),l=aC().map(m=>{const g=m.handle?.crumb;if(!g)return null;const v=typeof g=="function"?g(m.params,a):g,{label:b,url:x}=typeof v=="string"?{label:v,url:void 0}:v;return{id:m.id,label:b,url:x}}).filter(bx),s=En(m=>m.projects),c=En(m=>m.setCurrentProjectId),d=un(),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(HD,{children:[o.jsx(VD,{asChild:!0,children:o.jsxs(FD,{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:[Sb(p)," project"]}),o.jsx(Nw,{})]})}),o.jsx(PD,{children:o.jsx(kD,{children:f.map(m=>o.jsx(ID,{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(zD,{children:o.jsxs(_D,{children:[s.length<=1&&o.jsxs(o.Fragment,{children:[o.jsxs(Qb,{children:[Sb(p)," project"]}),l.length>0&&o.jsx(Kb,{})]}),l.map((m,g)=>o.jsxs(GD,{children:[g!==0&&o.jsx(Kb,{className:"hidden sm:block"}),g===l.length-1?o.jsx(qD,{children:m.label}):o.jsx(Qb,{className:"hidden sm:block",children:m.url?o.jsx(BD,{asChild:!0,children:o.jsx(kt,{to:m.url,children:m.label})}):m.label})]},m.id))]})})]})}function Ym(a){return Gi({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 Tc(a){return Gi({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 Wr(a){return Gi({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 XD(){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(kt,{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:Em,label:"Apps"}),o.jsx(Zo,{to:"/data",icon:Ym,label:"Data"}),o.jsx(Zo,{to:"/plugins",icon:yx,label:"Plugins"}),o.jsx(Zo,{to:"/settings",icon:xx,label:"Settings"})]})]})})}const{SheetClose:QD}=await C("@baseplate-dev/ui-components");function Jr({icon:a,to:n,label:l,end:s}){return o.jsx(QD,{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 KD(){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(Jr,{to:"/",icon:Mw,label:"Home",end:!0}),o.jsx(Jr,{to:"/apps",icon:Em,label:"Apps"}),o.jsx(Jr,{to:"/data/models",icon:Ym,label:"Models"}),o.jsx(Jr,{to:"/plugins",icon:yx,label:"Plugins"}),o.jsx(Jr,{to:"/settings",icon:xx,label:"Settings"})]})]})}function ZD({className:a}){const n=Dc(l=>l.completedAt);return n?o.jsxs("div",{className:Te("text-style-muted",a),children:["Last Sync: ",o.jsx(_j,{date:n,formatter:Pj})]}):null}const{Button:WD,Sheet:JD,SheetContent:e8,SheetTrigger:t8}=await C("@baseplate-dev/ui-components");function n8({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(XD,{})}),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(JD,{children:[o.jsx(t8,{asChild:!0,children:o.jsxs(WD,{size:"icon",variant:"outline",className:"sm:hidden",children:[o.jsx(Aw,{className:"size-5"}),o.jsx("span",{className:"sr-only",children:"Toggle Menu"})]})}),o.jsx(e8,{side:"left",className:"max-w-xs",children:o.jsx(KD,{})})]}),o.jsxs("div",{className:"flex w-full items-center justify-between py-3",children:[o.jsx(YD,{}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(ZD,{}),o.jsx(OD,{})]})]})]}),o.jsx("main",{className:"h-[calc(100vh-var(--topbar-height)-1px)] overflow-auto",children:o.jsx(Yl,{children:o.jsx(vi,{})})})]})]})}const{ErrorableLoader:a8}=await C("@baseplate-dev/ui-components"),{useCallback:i8,useEffect:Zb,useMemo:l8,useState:Wb}=await C("react");function r8({children:a}){const[n,l]=Wb(),[s,c]=Wb(),d=i8(()=>{J3().then(m=>{l(m)}).catch(m=>{c(Cn(m,"Failed to fetch version info."))})},[]);Zb(()=>(d(),Om.on("open",d)),[d]);const f=Um(n?.version);Zb(()=>{n&&f&&f!==n.version&&globalThis.location.reload()},[n,f]);const p=l8(()=>n?{version:n.version,featureFlags:n.featureFlags,userConfig:n.userConfig}:void 0,[n]);return p?o.jsx(Fj.Provider,{value:p,children:a}):o.jsx(a8,{error:s})}var Wo={exports:{}},jf,Jb;function qc(){if(Jb)return jf;Jb=1;const a="2.0.0",n=256,l=Number.MAX_SAFE_INTEGER||9007199254740991,s=16,c=n-6;return jf={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},jf}var Sf,e1;function Fc(){if(e1)return Sf;e1=1;var a={};return Sf=typeof process=="object"&&a&&a.NODE_DEBUG&&/\bsemver\b/i.test(a.NODE_DEBUG)?(...l)=>console.error("SEMVER",...l):()=>{},Sf}var t1;function Ds(){return t1||(t1=1,function(a,n){const{MAX_SAFE_COMPONENT_LENGTH:l,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:c}=qc(),d=Fc();n=a.exports={};const f=n.re=[],p=n.safeRe=[],m=n.src=[],g=n.safeSrc=[],v=n.t={};let b=0;const x="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",c],[x,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},S=(R,E,A)=>{const B=D(E),q=b++;d(R,q,E),v[R]=q,m[q]=E,g[q]=B,f[q]=new RegExp(E,A?"g":void 0),p[q]=new RegExp(B,A?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${x}*`),S("MAINVERSION",`(${m[v.NUMERICIDENTIFIER]})\\.(${m[v.NUMERICIDENTIFIER]})\\.(${m[v.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${m[v.NUMERICIDENTIFIERLOOSE]})\\.(${m[v.NUMERICIDENTIFIERLOOSE]})\\.(${m[v.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${m[v.NONNUMERICIDENTIFIER]}|${m[v.NUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${m[v.NONNUMERICIDENTIFIER]}|${m[v.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASE",`(?:-(${m[v.PRERELEASEIDENTIFIER]}(?:\\.${m[v.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${m[v.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${m[v.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${x}+`),S("BUILD",`(?:\\+(${m[v.BUILDIDENTIFIER]}(?:\\.${m[v.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${m[v.MAINVERSION]}${m[v.PRERELEASE]}?${m[v.BUILD]}?`),S("FULL",`^${m[v.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${m[v.MAINVERSIONLOOSE]}${m[v.PRERELEASELOOSE]}?${m[v.BUILD]}?`),S("LOOSE",`^${m[v.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${m[v.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${m[v.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${m[v.XRANGEIDENTIFIER]})(?:\\.(${m[v.XRANGEIDENTIFIER]})(?:\\.(${m[v.XRANGEIDENTIFIER]})(?:${m[v.PRERELEASE]})?${m[v.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${m[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[v.XRANGEIDENTIFIERLOOSE]})(?:${m[v.PRERELEASELOOSE]})?${m[v.BUILD]}?)?)?`),S("XRANGE",`^${m[v.GTLT]}\\s*${m[v.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${m[v.GTLT]}\\s*${m[v.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${l}})(?:\\.(\\d{1,${l}}))?(?:\\.(\\d{1,${l}}))?`),S("COERCE",`${m[v.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",m[v.COERCEPLAIN]+`(?:${m[v.PRERELEASE]})?(?:${m[v.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",m[v.COERCE],!0),S("COERCERTLFULL",m[v.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${m[v.LONETILDE]}\\s+`,!0),n.tildeTrimReplace="$1~",S("TILDE",`^${m[v.LONETILDE]}${m[v.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${m[v.LONETILDE]}${m[v.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${m[v.LONECARET]}\\s+`,!0),n.caretTrimReplace="$1^",S("CARET",`^${m[v.LONECARET]}${m[v.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${m[v.LONECARET]}${m[v.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${m[v.GTLT]}\\s*(${m[v.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${m[v.GTLT]}\\s*(${m[v.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${m[v.GTLT]}\\s*(${m[v.LOOSEPLAIN]}|${m[v.XRANGEPLAIN]})`,!0),n.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${m[v.XRANGEPLAIN]})\\s+-\\s+(${m[v.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${m[v.XRANGEPLAINLOOSE]})\\s+-\\s+(${m[v.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Wo,Wo.exports)),Wo.exports}var wf,n1;function Xm(){if(n1)return wf;n1=1;const a=Object.freeze({loose:!0}),n=Object.freeze({});return wf=s=>s?typeof s!="object"?a:s:n,wf}var Cf,a1;function kj(){if(a1)return Cf;a1=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 Cf={compareIdentifiers:n,rcompareIdentifiers:(s,c)=>n(c,s)},Cf}var Ef,i1;function en(){if(i1)return Ef;i1=1;const a=Fc(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:l}=qc(),{safeRe:s,t:c}=Ds(),d=Xm(),{compareIdentifiers:f}=kj();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(x=>{if(/^[0-9]+$/.test(x)){const j=+x;if(j>=0&&j<l)return j}return x}):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],x=g.prerelease[v];if(a("prerelease compare",v,b,x),b===void 0&&x===void 0)return 0;if(x===void 0)return 1;if(b===void 0)return-1;if(b===x)continue;return f(b,x)}while(++v)}compareBuild(g){g instanceof p||(g=new p(g,this.options));let v=0;do{const b=this.build[v],x=g.build[v];if(a("build compare",v,b,x),b===void 0&&x===void 0)return 0;if(x===void 0)return 1;if(b===void 0)return-1;if(b===x)continue;return f(b,x)}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 x=`-${v}`.match(this.options.loose?s[c.PRERELEASELOOSE]:s[c.PRERELEASE]);if(!x||x[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 x=Number(b)?1:0;if(this.prerelease.length===0)this.prerelease=[x];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(x)}}if(v){let j=[v,x];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 Ef=p,Ef}var Df,l1;function Jl(){if(l1)return Df;l1=1;const a=en();return Df=(l,s,c=!1)=>{if(l instanceof a)return l;try{return new a(l,s)}catch(d){if(!c)return null;throw d}},Df}var Tf,r1;function s8(){if(r1)return Tf;r1=1;const a=Jl();return Tf=(l,s)=>{const c=a(l,s);return c?c.version:null},Tf}var Rf,s1;function o8(){if(s1)return Rf;s1=1;const a=Jl();return Rf=(l,s)=>{const c=a(l.trim().replace(/^[=v]+/,""),s);return c?c.version:null},Rf}var Nf,o1;function c8(){if(o1)return Nf;o1=1;const a=en();return Nf=(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}},Nf}var Mf,c1;function u8(){if(c1)return Mf;c1=1;const a=Jl();return Mf=(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 x=v?"pre":"";return c.major!==d.major?x+"major":c.minor!==d.minor?x+"minor":c.patch!==d.patch?x+"patch":"prerelease"},Mf}var Af,u1;function d8(){if(u1)return Af;u1=1;const a=en();return Af=(l,s)=>new a(l,s).major,Af}var $f,d1;function f8(){if(d1)return $f;d1=1;const a=en();return $f=(l,s)=>new a(l,s).minor,$f}var Lf,f1;function h8(){if(f1)return Lf;f1=1;const a=en();return Lf=(l,s)=>new a(l,s).patch,Lf}var Of,h1;function m8(){if(h1)return Of;h1=1;const a=Jl();return Of=(l,s)=>{const c=a(l,s);return c&&c.prerelease.length?c.prerelease:null},Of}var Uf,m1;function Wn(){if(m1)return Uf;m1=1;const a=en();return Uf=(l,s,c)=>new a(l,c).compare(new a(s,c)),Uf}var zf,p1;function p8(){if(p1)return zf;p1=1;const a=Wn();return zf=(l,s,c)=>a(s,l,c),zf}var Bf,g1;function g8(){if(g1)return Bf;g1=1;const a=Wn();return Bf=(l,s)=>a(l,s,!0),Bf}var _f,v1;function Qm(){if(v1)return _f;v1=1;const a=en();return _f=(l,s,c)=>{const d=new a(l,c),f=new a(s,c);return d.compare(f)||d.compareBuild(f)},_f}var qf,b1;function v8(){if(b1)return qf;b1=1;const a=Qm();return qf=(l,s)=>l.sort((c,d)=>a(c,d,s)),qf}var Ff,y1;function b8(){if(y1)return Ff;y1=1;const a=Qm();return Ff=(l,s)=>l.sort((c,d)=>a(d,c,s)),Ff}var Hf,x1;function Hc(){if(x1)return Hf;x1=1;const a=Wn();return Hf=(l,s,c)=>a(l,s,c)>0,Hf}var Pf,j1;function Km(){if(j1)return Pf;j1=1;const a=Wn();return Pf=(l,s,c)=>a(l,s,c)<0,Pf}var kf,S1;function Ij(){if(S1)return kf;S1=1;const a=Wn();return kf=(l,s,c)=>a(l,s,c)===0,kf}var If,w1;function Vj(){if(w1)return If;w1=1;const a=Wn();return If=(l,s,c)=>a(l,s,c)!==0,If}var Vf,C1;function Zm(){if(C1)return Vf;C1=1;const a=Wn();return Vf=(l,s,c)=>a(l,s,c)>=0,Vf}var Gf,E1;function Wm(){if(E1)return Gf;E1=1;const a=Wn();return Gf=(l,s,c)=>a(l,s,c)<=0,Gf}var Yf,D1;function Gj(){if(D1)return Yf;D1=1;const a=Ij(),n=Vj(),l=Hc(),s=Zm(),c=Km(),d=Wm();return Yf=(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}`)}},Yf}var Xf,T1;function y8(){if(T1)return Xf;T1=1;const a=en(),n=Jl(),{safeRe:l,t:s}=Ds();return Xf=(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]}`:"",x=f.includePrerelease&&p[6]?`+${p[6]}`:"";return n(`${m}.${g}.${v}${b}${x}`,f)},Xf}var Qf,R1;function x8(){if(R1)return Qf;R1=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 Qf=a,Qf}var Kf,N1;function Jn(){if(N1)return Kf;N1=1;const a=/\s+/g;class n{constructor(Z,U){if(U=c(U),Z instanceof n)return Z.loose===!!U.loose&&Z.includePrerelease===!!U.includePrerelease?Z:new n(Z.raw,U);if(Z instanceof d)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=U,this.loose=!!U.loose,this.includePrerelease=!!U.includePrerelease,this.raw=Z.trim().replace(a," "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(Y=>!S(Y[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const Y of this.set)if(Y.length===1&&R(Y[0])){this.set=[Y];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){Z>0&&(this.formatted+="||");const U=this.set[Z];for(let k=0;k<U.length;k++)k>0&&(this.formatted+=" "),this.formatted+=U[k].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){const k=((this.options.includePrerelease&&j)|(this.options.loose&&D))+":"+Z,Y=s.get(k);if(Y)return Y;const te=this.options.loose,re=te?m[g.HYPHENRANGELOOSE]:m[g.HYPHENRANGE];Z=Z.replace(re,se(this.options.includePrerelease)),f("hyphen replace",Z),Z=Z.replace(m[g.COMPARATORTRIM],v),f("comparator trim",Z),Z=Z.replace(m[g.TILDETRIM],b),f("tilde trim",Z),Z=Z.replace(m[g.CARETTRIM],x),f("caret trim",Z);let ge=Z.split(" ").map(je=>A(je,this.options)).join(" ").split(/\s+/).map(je=>ne(je,this.options));te&&(ge=ge.filter(je=>(f("loose invalid filter",je,this.options),!!je.match(m[g.COMPARATORLOOSE])))),f("range list",ge);const ie=new Map,ce=ge.map(je=>new d(je,this.options));for(const je of ce){if(S(je))return[je];ie.set(je.value,je)}ie.size>1&&ie.has("")&&ie.delete("");const Se=[...ie.values()];return s.set(k,Se),Se}intersects(Z,U){if(!(Z instanceof n))throw new TypeError("a Range is required");return this.set.some(k=>E(k,U)&&Z.set.some(Y=>E(Y,U)&&k.every(te=>Y.every(re=>te.intersects(re,U)))))}test(Z){if(!Z)return!1;if(typeof Z=="string")try{Z=new p(Z,this.options)}catch{return!1}for(let U=0;U<this.set.length;U++)if(Ee(this.set[U],Z,this.options))return!0;return!1}}Kf=n;const l=x8(),s=new l,c=Xm(),d=Pc(),f=Fc(),p=en(),{safeRe:m,t:g,comparatorTrimReplace:v,tildeTrimReplace:b,caretTrimReplace:x}=Ds(),{FLAG_INCLUDE_PRERELEASE:j,FLAG_LOOSE:D}=qc(),S=V=>V.value==="<0.0.0-0",R=V=>V.value==="",E=(V,Z)=>{let U=!0;const k=V.slice();let Y=k.pop();for(;U&&k.length;)U=k.every(te=>Y.intersects(te,Z)),Y=k.pop();return U},A=(V,Z)=>(f("comp",V,Z),V=Q(V,Z),f("caret",V),V=q(V,Z),f("tildes",V),V=O(V,Z),f("xrange",V),V=ae(V,Z),f("stars",V),V),B=V=>!V||V.toLowerCase()==="x"||V==="*",q=(V,Z)=>V.trim().split(/\s+/).map(U=>G(U,Z)).join(" "),G=(V,Z)=>{const U=Z.loose?m[g.TILDELOOSE]:m[g.TILDE];return V.replace(U,(k,Y,te,re,ge)=>{f("tilde",V,k,Y,te,re,ge);let ie;return B(Y)?ie="":B(te)?ie=`>=${Y}.0.0 <${+Y+1}.0.0-0`:B(re)?ie=`>=${Y}.${te}.0 <${Y}.${+te+1}.0-0`:ge?(f("replaceTilde pr",ge),ie=`>=${Y}.${te}.${re}-${ge} <${Y}.${+te+1}.0-0`):ie=`>=${Y}.${te}.${re} <${Y}.${+te+1}.0-0`,f("tilde return",ie),ie})},Q=(V,Z)=>V.trim().split(/\s+/).map(U=>T(U,Z)).join(" "),T=(V,Z)=>{f("caret",V,Z);const U=Z.loose?m[g.CARETLOOSE]:m[g.CARET],k=Z.includePrerelease?"-0":"";return V.replace(U,(Y,te,re,ge,ie)=>{f("caret",V,Y,te,re,ge,ie);let ce;return B(te)?ce="":B(re)?ce=`>=${te}.0.0${k} <${+te+1}.0.0-0`:B(ge)?te==="0"?ce=`>=${te}.${re}.0${k} <${te}.${+re+1}.0-0`:ce=`>=${te}.${re}.0${k} <${+te+1}.0.0-0`:ie?(f("replaceCaret pr",ie),te==="0"?re==="0"?ce=`>=${te}.${re}.${ge}-${ie} <${te}.${re}.${+ge+1}-0`:ce=`>=${te}.${re}.${ge}-${ie} <${te}.${+re+1}.0-0`:ce=`>=${te}.${re}.${ge}-${ie} <${+te+1}.0.0-0`):(f("no pr"),te==="0"?re==="0"?ce=`>=${te}.${re}.${ge}${k} <${te}.${re}.${+ge+1}-0`:ce=`>=${te}.${re}.${ge}${k} <${te}.${+re+1}.0-0`:ce=`>=${te}.${re}.${ge} <${+te+1}.0.0-0`),f("caret return",ce),ce})},O=(V,Z)=>(f("replaceXRanges",V,Z),V.split(/\s+/).map(U=>W(U,Z)).join(" ")),W=(V,Z)=>{V=V.trim();const U=Z.loose?m[g.XRANGELOOSE]:m[g.XRANGE];return V.replace(U,(k,Y,te,re,ge,ie)=>{f("xRange",V,k,Y,te,re,ge,ie);const ce=B(te),Se=ce||B(re),je=Se||B(ge),Ue=je;return Y==="="&&Ue&&(Y=""),ie=Z.includePrerelease?"-0":"",ce?Y===">"||Y==="<"?k="<0.0.0-0":k="*":Y&&Ue?(Se&&(re=0),ge=0,Y===">"?(Y=">=",Se?(te=+te+1,re=0,ge=0):(re=+re+1,ge=0)):Y==="<="&&(Y="<",Se?te=+te+1:re=+re+1),Y==="<"&&(ie="-0"),k=`${Y+te}.${re}.${ge}${ie}`):Se?k=`>=${te}.0.0${ie} <${+te+1}.0.0-0`:je&&(k=`>=${te}.${re}.0${ie} <${te}.${+re+1}.0-0`),f("xRange return",k),k})},ae=(V,Z)=>(f("replaceStars",V,Z),V.trim().replace(m[g.STAR],"")),ne=(V,Z)=>(f("replaceGTE0",V,Z),V.trim().replace(m[Z.includePrerelease?g.GTE0PRE:g.GTE0],"")),se=V=>(Z,U,k,Y,te,re,ge,ie,ce,Se,je,Ue)=>(B(k)?U="":B(Y)?U=`>=${k}.0.0${V?"-0":""}`:B(te)?U=`>=${k}.${Y}.0${V?"-0":""}`:re?U=`>=${U}`:U=`>=${U}${V?"-0":""}`,B(ce)?ie="":B(Se)?ie=`<${+ce+1}.0.0-0`:B(je)?ie=`<${ce}.${+Se+1}.0-0`:Ue?ie=`<=${ce}.${Se}.${je}-${Ue}`:V?ie=`<${ce}.${Se}.${+je+1}-0`:ie=`<=${ie}`,`${U} ${ie}`.trim()),Ee=(V,Z,U)=>{for(let k=0;k<V.length;k++)if(!V[k].test(Z))return!1;if(Z.prerelease.length&&!U.includePrerelease){for(let k=0;k<V.length;k++)if(f(V[k].semver),V[k].semver!==d.ANY&&V[k].semver.prerelease.length>0){const Y=V[k].semver;if(Y.major===Z.major&&Y.minor===Z.minor&&Y.patch===Z.patch)return!0}return!1}return!0};return Kf}var Zf,M1;function Pc(){if(M1)return Zf;M1=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],x=v.match(b);if(!x)throw new TypeError(`Invalid comparator: ${v}`);this.operator=x[1]!==void 0?x[1]:"",this.operator==="="&&(this.operator=""),x[2]?this.semver=new p(x[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(">")))}}Zf=n;const l=Xm(),{safeRe:s,t:c}=Ds(),d=Gj(),f=Fc(),p=en(),m=Jn();return Zf}var Wf,A1;function kc(){if(A1)return Wf;A1=1;const a=Jn();return Wf=(l,s,c)=>{try{s=new a(s,c)}catch{return!1}return s.test(l)},Wf}var Jf,$1;function j8(){if($1)return Jf;$1=1;const a=Jn();return Jf=(l,s)=>new a(l,s).set.map(c=>c.map(d=>d.value).join(" ").trim().split(" ")),Jf}var eh,L1;function S8(){if(L1)return eh;L1=1;const a=en(),n=Jn();return eh=(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},eh}var th,O1;function w8(){if(O1)return th;O1=1;const a=en(),n=Jn();return th=(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},th}var nh,U1;function C8(){if(U1)return nh;U1=1;const a=en(),n=Jn(),l=Hc();return nh=(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},nh}var ah,z1;function E8(){if(z1)return ah;z1=1;const a=Jn();return ah=(l,s)=>{try{return new a(l,s).range||"*"}catch{return null}},ah}var ih,B1;function Jm(){if(B1)return ih;B1=1;const a=en(),n=Pc(),{ANY:l}=n,s=Jn(),c=kc(),d=Hc(),f=Km(),p=Wm(),m=Zm();return ih=(v,b,x,j)=>{v=new a(v,j),b=new s(b,j);let D,S,R,E,A;switch(x){case">":D=d,S=p,R=f,E=">",A=">=";break;case"<":D=f,S=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 B=0;B<b.set.length;++B){const q=b.set[B];let G=null,Q=null;if(q.forEach(T=>{T.semver===l&&(T=new n(">=0.0.0")),G=G||T,Q=Q||T,D(T.semver,G.semver,j)?G=T:R(T.semver,Q.semver,j)&&(Q=T)}),G.operator===E||G.operator===A||(!Q.operator||Q.operator===E)&&S(v,Q.semver))return!1;if(Q.operator===A&&R(v,Q.semver))return!1}return!0},ih}var lh,_1;function D8(){if(_1)return lh;_1=1;const a=Jm();return lh=(l,s,c)=>a(l,s,">",c),lh}var rh,q1;function T8(){if(q1)return rh;q1=1;const a=Jm();return rh=(l,s,c)=>a(l,s,"<",c),rh}var sh,F1;function R8(){if(F1)return sh;F1=1;const a=Jn();return sh=(l,s,c)=>(l=new a(l,c),s=new a(s,c),l.intersects(s,c)),sh}var oh,H1;function N8(){if(H1)return oh;H1=1;const a=kc(),n=Wn();return oh=(l,s,c)=>{const d=[];let f=null,p=null;const m=l.sort((x,j)=>n(x,j,c));for(const x of m)a(x,s,c)?(p=x,f||(f=x)):(p&&d.push([f,p]),p=null,f=null);f&&d.push([f,null]);const g=[];for(const[x,j]of d)x===j?g.push(x):!j&&x===m[0]?g.push("*"):j?x===m[0]?g.push(`<=${j}`):g.push(`${x} - ${j}`):g.push(`>=${x}`);const v=g.join(" || "),b=typeof s.raw=="string"?s.raw:String(s);return v.length<b.length?v:s},oh}var ch,P1;function M8(){if(P1)return ch;P1=1;const a=Jn(),n=Pc(),{ANY:l}=n,s=kc(),c=Wn(),d=(b,x,j={})=>{if(b===x)return!0;b=new a(b,j),x=new a(x,j);let D=!1;e:for(const S of b.set){for(const R of x.set){const E=m(S,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,x,j)=>{if(b===x)return!0;if(b.length===1&&b[0].semver===l){if(x.length===1&&x[0].semver===l)return!0;j.includePrerelease?b=f:b=p}if(x.length===1&&x[0].semver===l){if(j.includePrerelease)return!0;x=p}const D=new Set;let S,R;for(const O of b)O.operator===">"||O.operator===">="?S=g(S,O,j):O.operator==="<"||O.operator==="<="?R=v(R,O,j):D.add(O.semver);if(D.size>1)return null;let E;if(S&&R){if(E=c(S.semver,R.semver,j),E>0)return null;if(E===0&&(S.operator!==">="||R.operator!=="<="))return null}for(const O of D){if(S&&!s(O,String(S),j)||R&&!s(O,String(R),j))return null;for(const W of x)if(!s(O,String(W),j))return!1;return!0}let A,B,q,G,Q=R&&!j.includePrerelease&&R.semver.prerelease.length?R.semver:!1,T=S&&!j.includePrerelease&&S.semver.prerelease.length?S.semver:!1;Q&&Q.prerelease.length===1&&R.operator==="<"&&Q.prerelease[0]===0&&(Q=!1);for(const O of x){if(G=G||O.operator===">"||O.operator===">=",q=q||O.operator==="<"||O.operator==="<=",S){if(T&&O.semver.prerelease&&O.semver.prerelease.length&&O.semver.major===T.major&&O.semver.minor===T.minor&&O.semver.patch===T.patch&&(T=!1),O.operator===">"||O.operator===">="){if(A=g(S,O,j),A===O&&A!==S)return!1}else if(S.operator===">="&&!s(S.semver,String(O),j))return!1}if(R){if(Q&&O.semver.prerelease&&O.semver.prerelease.length&&O.semver.major===Q.major&&O.semver.minor===Q.minor&&O.semver.patch===Q.patch&&(Q=!1),O.operator==="<"||O.operator==="<="){if(B=v(R,O,j),B===O&&B!==R)return!1}else if(R.operator==="<="&&!s(R.semver,String(O),j))return!1}if(!O.operator&&(R||S)&&E!==0)return!1}return!(S&&q&&!R&&E!==0||R&&G&&!S&&E!==0||T||Q)},g=(b,x,j)=>{if(!b)return x;const D=c(b.semver,x.semver,j);return D>0?b:D<0||x.operator===">"&&b.operator===">="?x:b},v=(b,x,j)=>{if(!b)return x;const D=c(b.semver,x.semver,j);return D<0?b:D>0||x.operator==="<"&&b.operator==="<="?x:b};return ch=d,ch}var uh,k1;function A8(){if(k1)return uh;k1=1;const a=Ds(),n=qc(),l=en(),s=kj(),c=Jl(),d=s8(),f=o8(),p=c8(),m=u8(),g=d8(),v=f8(),b=h8(),x=m8(),j=Wn(),D=p8(),S=g8(),R=Qm(),E=v8(),A=b8(),B=Hc(),q=Km(),G=Ij(),Q=Vj(),T=Zm(),O=Wm(),W=Gj(),ae=y8(),ne=Pc(),se=Jn(),Ee=kc(),V=j8(),Z=S8(),U=w8(),k=C8(),Y=E8(),te=Jm(),re=D8(),ge=T8(),ie=R8(),ce=N8(),Se=M8();return uh={parse:c,valid:d,clean:f,inc:p,diff:m,major:g,minor:v,patch:b,prerelease:x,compare:j,rcompare:D,compareLoose:S,compareBuild:R,sort:E,rsort:A,gt:B,lt:q,eq:G,neq:Q,gte:T,lte:O,cmp:W,coerce:ae,Comparator:ne,Range:se,satisfies:Ee,toComparators:V,maxSatisfying:Z,minSatisfying:U,minVersion:k,validRange:Y,outside:te,gtr:re,ltr:ge,intersects:ie,simplifyRange:ce,subset:Se,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},uh}var $8=A8();const L8=Cm($8),{createPluginImplementationStore:O8,isMigrateableProjectDefinition:U8,ProjectDefinitionContainer:z8,runPluginMigrations:B8,runSchemaMigrations:_8,SchemaMigrationError:q8}=await C("@baseplate-dev/project-builder-lib"),{ZodError:F8}=await C("zod");function H8(a,n){try{const l=JSON.parse(a);if(!U8(l))throw new da("The project configuration is not valid project definition with a schemaVersion property. Please check the file and try again.");const{migratedDefinition:s}=_8(l),c=O8(n.pluginStore,s),d=B8(s,c);return z8.fromSerializedConfig(d,n)}catch(l){throw l instanceof SyntaxError?new da("The project configuration is not a valid JSON file. Please check the file and try again."):l instanceof F8?new da(`The project configuration is not valid: ${LE(l)}`):l instanceof q8?new da(l.message):l}}const{useCallback:P8,useEffect:k8,useMemo:I8,useRef:V8}=await C("react");function G8({schemaParserContext:a,projectDefinitionFilePayload:n}){const l=V8(void 0),{projectDefinitionContainer:s,error:c}=I8(()=>{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:H8(n.contents,a),hash:n.hash},error:void 0}}catch(d){return{projectDefinitionContainer:void 0,error:d}}},[a,n]);return k8(()=>{c&&console.error(c)},[c]),{projectDefinitionContainer:s?.container,cacheProjectDefinitionContainer:P8((d,f)=>{l.current={container:d,contents:f}},[]),error:c}}class Y8{projectId;_definitionFileContentsHash;_pendingDefinitionFileContentsHash;constructor(n){this.projectId=n}async downloadDefinitionContents(){const{contents:n,hash:l}=await G3(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 sj(n);const l=await Y3(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 X3(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:X8,useEffect:Q8,useState:dh}=await C("react");function K8(){const[a,n]=dh(),[l,s]=dh(),[c,d]=dh(),{currentProjectId:f,projectsLoaded:p,resetCurrentProjectId:m}=En();Q8(()=>{if(n(void 0),s(void 0),!f||!p){d(void 0);return}const v=new Y8(f);return d(v),v.downloadDefinitionContents().then(b=>{n(b)}).catch(b=>{b instanceof Ec?m():s(b)}),v.listenForDefinitionFileChanges(b=>{n(b)})},[f,p,m]);const g=X8(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 Ec&&m(),b})},[c,m]);return{projectDefinitionFilePayload:a,uploadProjectDefinitionContents:g,error:l}}function Z8(a,n){return()=>{}}const Yj={placeholder:{url:"http://localhost:3001/remoteEntry.js",format:"esm",from:"vite"}},I1={},W8=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 Ll(a,n){return J8(a).then(l=>()=>n==="webpack"&&Object.prototype.toString.call(l).indexOf("Module")>-1&&l.default?l.default:l)}function Xj(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]=Xj(l[s],n[s]));return l}const V1=a=>Xj({react:{"19.1.0":{get:()=>Ll(new URL("__federation_shared_react-CTQ9xfiH.js",import.meta.url).href,a),loaded:1}},"react-dom":{"19.1.0":{get:()=>Ll(new URL("__federation_shared_react-dom-DPv53nVg.js",import.meta.url).href,a),loaded:1}},zod:{"3.24.1":{get:()=>Ll(new URL("__federation_shared_zod-DQ8g46gT.js",import.meta.url).href,a),loaded:1}},"@baseplate-dev/project-builder-lib":{"*":{get:()=>Ll(new URL("__federation_shared_@baseplate-dev/project-builder-lib-CEcnKpIc.js",import.meta.url).href,a),loaded:1}},"@baseplate-dev/project-builder-lib/web":{"*":{get:()=>Ll(new URL("__federation_shared_@baseplate-dev/project-builder-lib/web-DeLjV85y.js",import.meta.url).href,a),loaded:1}},"@baseplate-dev/ui-components":{"*":{get:()=>Ll(new URL("__federation_shared_@baseplate-dev/ui-components-BngA7Gbo.js",import.meta.url).href,a),loaded:1}}},(globalThis.__federation_shared__||{}).default||{});async function J8(a){return I1[a]??=import(a),I1[a]}async function e7(a){const n=Yj[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(V1(n.from)),n.inited=!0),l(n.lib)};return W8(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=V1(n.from);f.init(p),n.lib=f,n.lib.init(p),n.inited=!0}l(n.lib)}).catch(s)})})}function t7(a){return a?.__esModule||a?.[Symbol.toStringTag]==="Module"?a.default:a}function n7(a,n){return e7(a).then(l=>l.get(n).then(s=>s()))}function a7(a,n){Yj[a]=n}let Qj=Math.random();function i7(){Qj=Math.random()}async function l7(a,n){const l=`${a}/${n.id}`,s=`/api/plugins/${a}/${n.id}/web/assets/remoteEntry.js?rnd=${Qj}`;return a7(l,{url:s,externalType:"url",format:"esm",from:"vite"}),(await Promise.all(n.webModulePaths.map(p=>n7(l,p)))).map(p=>t7(p)).map((p,m)=>({key:n.webModulePaths[m],module:p}))}const{webConfigSpec:r7}=await C("@baseplate-dev/project-builder-lib"),{adminCrudInputWebSpec:s7,modelTransformerWebSpec:o7}=await C("@baseplate-dev/project-builder-lib/web");async function c7(a,n){return{pluginStore:{availablePlugins:await Promise.all(n.map(async l=>{const s=await l7(a,l);return{metadata:l,modules:s}})),builtinSpecImplementations:[r7,o7,s7]}}}class u7{projectId;_pluginsMetadata;_schemaParserContext;constructor(n){this.projectId=n}async loadSchemaParserContext(){return this._pluginsMetadata??=await V3(this.projectId),i7(),this._schemaParserContext=await c7(this.projectId,this._pluginsMetadata),this._schemaParserContext}listenForPluginAssetsChanges(n,l){return Z8()}}const{toast:G1}=await C("@baseplate-dev/ui-components"),{useEffect:d7,useState:Y1}=await C("react");function f7(){const{currentProjectId:a,projectsLoaded:n}=En(),[l,s]=Y1(void 0),[c,d]=Y1();return d7(()=>{if(s(void 0),d(void 0),!a||!n)return;const f=new u7(a);return f.loadSchemaParserContext().then(p=>{s(p)}).catch(p=>{G1.error(Cn(p)),d(p)}),f.listenForPluginAssetsChanges(p=>{s(p)},p=>{G1.error(Cn(p))})},[a,n]),{schemaParserContext:l,error:c}}const X1=(a,n,l)=>{if(a&&"reportValidity"in a){const s=lm(l,n);a.setCustomValidity(s&&s.message||""),a.reportValidity()}},Kj=(a,n)=>{for(const l in n.fields){const s=n.fields[l];s&&s.ref&&"reportValidity"in s.ref?X1(s.ref,l,a):s&&s.refs&&s.refs.forEach(c=>X1(c,l,a))}},h7=(a,n)=>{n.shouldUseNativeValidation&&Kj(a,n);const l={};for(const s in a){const c=lm(n.fields,s),d=Object.assign(a[s]||{},{ref:c&&c.ref});if(m7(n.names||Object.keys(a),s)){const f=Object.assign({},lm(l,s));Yd(f,"root",d),Yd(l,s,f)}else Yd(l,s,d)}return l},m7=(a,n)=>{const l=Q1(n);return a.some(s=>Q1(s).match(`^${l}\\.\\d+`))};function Q1(a){return a.replace(/\]|\[/g,"")}function p7(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]=jw(f,n,l,c,g?[].concat(g,s.message):s.message)}a.shift()}return l}function It(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&&Kj({},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:h7(p7(f.errors,!d.shouldUseNativeValidation&&d.criteriaMode==="all"),d)};throw f}))}catch(f){return Promise.reject(f)}}}const{generalSettingsSchema:g7}=await C("@baseplate-dev/project-builder-lib"),{Button:v7,Card:b7,CardContent:y7,InputFieldController:K1,toast:x7}=await C("@baseplate-dev/ui-components");function j7({existingProject:a,saveProject:n}){const{control:l,handleSubmit:s,formState:{isSubmitting:c}}=gi({defaultValues:a?.settings.general,resolver:It(g7)}),d=s(f=>{n(f).catch(p=>{x7.error(Cn(p,"Failed to save project"))})});return o.jsx(b7,{className:"w-80 animate-in fade-in zoom-in-70 sm:w-120",children:o.jsxs(y7,{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(K1,{name:"name",label:"Project Name",description:"Lowercase letters and dashes, e.g. my-project",control:l,placeholder:"e.g. my-project"}),o.jsx(K1,{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(v7,{className:"mx-auto",type:"submit",disabled:c,children:"Initialize Project"})]})]})})}const{createPluginImplementationStore:S7,createProjectDefinitionSchemaWithContext:w7,fixRefDeletions:C7,ProjectDefinitionContainer:E7}=await C("@baseplate-dev/project-builder-lib"),{ProjectDefinitionContext:D7}=await C("@baseplate-dev/project-builder-lib/web"),{Button:fh,ErrorableLoader:T7,ErrorDisplay:R7,toast:Z1}=await C("@baseplate-dev/ui-components"),{useMemo:N7,useState:M7}=await C("react");function A7({children:a}){const{schemaParserContext:n,error:l}=f7(),{projectDefinitionFilePayload:s,uploadProjectDefinitionContents:c,error:d}=K8(),{projectDefinitionContainer:f,error:p,cacheProjectDefinitionContainer:m}=G8({schemaParserContext:n,projectDefinitionFilePayload:s}),{projects:g,resetCurrentProjectId:v}=En(),{version:b}=Hj(),{showRefIssues:x}=uj(),[j,D]=M7(!1);tD();const S=!!s?.updatedExternally,R=N7(()=>{if(!f||!n)return;const{definition:A}=f,B=n;async function q(Q){D(!0);try{const T=Hw(A,Q),O=w7(T,B),W=C7(O,T);if(W.type==="failure")throw new bb(W.issues);const ae=W.value;ae.cliVersion=b;const ne=new E7(W.refPayload,B,O.pluginStore),se=ne.toSerializedContents();m(ne,se),await c(se)}finally{D(!1)}}async function G(Q,T={}){return q(Q).then(()=>(Z1.success(T.successMessage??"Successfully saved!"),T.onSuccess?.(),{success:!0})).catch(O=>(O instanceof bb&&!T.disableDeleteRefDialog?x({issues:O.issues}):Z1.error(Cn(O,"Failed to save project definition.")),{success:!1}))}return{definition:A,definitionContainer:f,saveDefinition:q,saveDefinitionWithFeedback:G,saveDefinitionWithFeedbackSync:(Q,T)=>{G(Q,T)},isSavingDefinition:j,pluginContainer:f.pluginStore,schemaParserContext:n,updatedExternally:S,definitionSchemaCreatorOptions:{plugins:S7(n.pluginStore,A)}}},[b,f,j,n,S,c,x,m]),E=l??d??p;return R?R.definition.isInitialized?R.definition.cliVersion&&b&&b!=="preview"&&L8.gt(R.definition.cliVersion,b)?o.jsx(R7,{header:"Upgrade your Baseplate client",actions:o.jsxs("div",{className:"flex flex-col space-y-4",children:[o.jsx(fh,{onClick:()=>{globalThis.location.reload()},children:"Refresh Page"}),g.length>1&&o.jsx(fh,{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(D7.Provider,{value:R,children:a}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(j7,{existingProject:R.definition,saveProject:async A=>{await R.saveDefinition(B=>{B.settings.general={...A,packageScope:""},B.isInitialized=!0})}})}):o.jsx(T7,{error:E&&Gl(E,""),header:"Failed to load project config",actions:o.jsx("div",{className:"flex flex-col space-y-4",children:g.length>1&&o.jsx(fh,{variant:"secondary",onClick:()=>{v()},children:"Switch Project"})})})}const{Button:W1,Dialog:$7,DialogContent:L7,DialogHeader:O7,DialogTitle:U7,Table:z7,TableBody:B7,TableCell:hh,TableHead:mh,TableHeader:_7,TableRow:J1}=await C("@baseplate-dev/ui-components");function q7({onClose:a,isOpen:n}){const{currentProjectId:l,setCurrentProjectId:s,projects:c}=En(),d=un();return o.jsx($7,{onOpenChange:a??(()=>{}),open:n,children:o.jsxs(L7,{width:"lg",children:[o.jsx(O7,{children:o.jsx(U7,{children:"Pick Project"})}),o.jsxs(z7,{children:[o.jsx(_7,{children:o.jsxs(J1,{children:[o.jsx(mh,{children:"Name"}),o.jsx(mh,{children:"Directory"}),o.jsx(mh,{})]})}),o.jsx(B7,{children:c.map(f=>o.jsxs(J1,{children:[o.jsx(hh,{children:o.jsx("strong",{children:f.name})}),o.jsx(hh,{children:f.directory}),o.jsx(hh,{children:l===f.id?o.jsx(W1,{variant:"link",disabled:!0,children:"Selected"}):o.jsx(W1,{variant:"link",onClick:()=>{s(f.id),d("/"),a&&a()},children:"Select"})})]},f.id))})]})]})})}const{ErrorableLoader:F7}=await C("@baseplate-dev/ui-components"),{useEffect:ey,useState:H7}=await C("react");function P7({children:a}){const[n,l]=H7(),{currentProjectId:s,projectsLoaded:c,setProjects:d}=En();return ey(()=>{Q3().then(f=>{d(f)}).catch(f=>{l(Cn(f,"Failed to fetch projects."))})},[d]),ey(()=>{ij(s)},[s]),c?s?o.jsx(o.Fragment,{children:a}):o.jsx(q7,{isOpen:!0}):o.jsx(F7,{error:n})}const{ErrorHandlerContext:k7}=await C("@baseplate-dev/project-builder-lib/web"),{ConfirmDialog:I7,Toaster:V7,TooltipProvider:G7}=await C("@baseplate-dev/ui-components"),{useMemo:Y7}=await C("react");function X7(){const a=Y7(()=>({formatError:Gl,logAndFormatError:Cn,logError:_l}),[]);return o.jsx(Yl,{children:o.jsx(k7.Provider,{value:a,children:o.jsxs(G7,{children:[o.jsx(r8,{children:o.jsx(P7,{children:o.jsxs(A7,{children:[o.jsx(vi,{}),o.jsx(k6,{})]})})}),o.jsx(V7,{}),o.jsx(I7,{}),o.jsx(t6,{})]})})})}function Ts(){return o.jsx(Uc,{})}const Rs={path:"*",element:o.jsx(Ts,{})},{appEntityType:Q7}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:K7}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Z7,NavigationMenu:W7,NavigationMenuItemWithLink:J7,NavigationMenuList:eT,SidebarLayout:tT,SidebarLayoutContent:nT,SidebarLayoutSidebar:aT}=await C("@baseplate-dev/ui-components");function iT(){const{definition:a}=K7(),{apps:n}=a,l=Zn(n,[s=>s.name]);return o.jsxs(tT,{className:"flex-1",children:[o.jsxs(aT,{className:"space-y-4",width:"sm",children:[o.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[o.jsx(kt,{to:"/apps",children:o.jsx("h2",{children:"Apps"})}),o.jsx(kt,{to:"/apps/new",className:"inline-block",children:o.jsx(Z7,{variant:"secondary",children:"New App"})})]}),o.jsx(W7,{orientation:"vertical",children:o.jsx(eT,{children:l.map(s=>o.jsx(J7,{asChild:!0,children:o.jsx(Ht,{to:`/apps/edit/${Q7.keyFromId(s.id)}`,children:s.name})},s.id))})})]}),o.jsx(nT,{className:"p-4",children:o.jsx(vi,{})})]})}const{useProjectDefinition:lT}=await C("@baseplate-dev/project-builder-lib/web"),{useMemo:rT}=await C("react");function tn(a){const{definitionSchemaCreatorOptions:n}=lT();return rT(()=>a(n),[n,a])}const{authConfigSpec:sT,createAdminAppSchema:oT,zPluginWrapper:cT}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:uT,useProjectDefinition:dT,useResettableForm:fT}=await C("@baseplate-dev/project-builder-lib/web"),{Button:hT,InputFieldController:ty,MultiComboboxFieldController:mT}=await C("@baseplate-dev/ui-components"),{useMemo:pT}=await C("react");function gT({className:a,appConfig:n}){const{definition:l,saveDefinitionWithFeedback:s,pluginContainer:c,isSavingDefinition:d}=dT(),f=tn(oT),p=pT(()=>cT(f,c),[c,f]),m=fT({resolver:It(p),values:n}),{control:g,handleSubmit:v,reset:b}=m,x=v(D=>s(S=>{S.apps=S.apps.map(R=>R.id===n.id?D:R)}));uT({control:g,reset:b,onSubmit:x});const j=c.getPluginSpecOptional(sT)?.getAuthRoles(l).map(D=>({label:D.name,value:D.id}));return o.jsx("div",{className:Te("",a),children:o.jsxs("form",{onSubmit:x,className:"space-y-4",children:[o.jsx(ty,{label:"Name",control:g,name:"name"}),o.jsx(ty,{label:"Package Location (optional) e.g. packages/web",control:g,name:"packageLocation"}),j&&o.jsx(mT,{label:"Allowed Roles?",control:g,options:j,name:"allowedRoles"}),o.jsx(hT,{type:"submit",disabled:d,children:"Save"})]})})}const{ModelUtils:vT}=await C("@baseplate-dev/project-builder-lib"),{createAdminCrudInputWebConfig:bT,useProjectDefinition:yT}=await C("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:ny}=await C("@baseplate-dev/ui-components");function xT({formProps:a,name:n,model:l,embeddedFormOptions:s}){const{definition:c}=yT(),d=vT.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(ny,{label:"Relation Name",control:p,name:`${f}.modelRelationRef`,options:d}),o.jsx(ny,{label:"Embedded Form",control:p,name:`${f}.embeddedFormRef`,options:s})]})}const jT=bT({name:"embedded",pluginId:void 0,label:"Embedded",getNewInput:()=>({label:"",type:"embedded",modelRelationRef:"",embeddedFormRef:""}),Form:xT}),{createAdminCrudInputWebConfig:ST}=await C("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:ay}=await C("@baseplate-dev/ui-components");function wT({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(ay,{label:"Relation Name",control:f,name:`${d}.localRelationRef`,options:c}),o.jsx(ay,{label:"Embedded Form",control:f,name:`${d}.embeddedFormRef`,options:s})]})}const CT=ST({name:"embeddedLocal",pluginId:void 0,label:"Embedded Local",getNewInput:()=>({label:"",type:"embeddedLocal",embeddedFormRef:"",localRelationRef:""}),Form:wT}),{createAdminCrudInputWebConfig:ET}=await C("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:DT}=await C("@baseplate-dev/ui-components");function TT({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(DT,{label:"Enum Field",control:d,name:`${c}.modelFieldRef`,options:s})}const RT=ET({name:"enum",pluginId:void 0,label:"Enum",getNewInput:()=>({label:"",type:"enum",modelFieldRef:""}),Form:TT}),{createAdminCrudInputWebConfig:NT}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:Jo,SelectFieldController:MT}=await C("@baseplate-dev/ui-components");function AT({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(MT,{label:"Local Relation Name",control:d,name:`${c}.localRelationRef`,options:s}),o.jsx(Jo,{label:"Label Expression (e.g. name)",control:d,name:`${c}.labelExpression`}),o.jsx(Jo,{label:"Value Expression (e.g. id)",control:d,name:`${c}.valueExpression`}),o.jsx(Jo,{label:"Default Label (optional)",control:d,name:`${c}.defaultLabel`}),o.jsx(Jo,{label:"Empty Label (optional) - only if field is nullable",control:d,name:`${c}.nullLabel`})]})}const $T=NT({name:"foreign",pluginId:void 0,label:"Foreign",getNewInput:()=>({label:"",type:"foreign",localRelationRef:"",labelExpression:"",valueExpression:"",defaultLabel:"",nullLabel:""}),Form:AT}),{createAdminCrudInputWebConfig:LT}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:OT,SelectFieldController:UT}=await C("@baseplate-dev/ui-components");function zT({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(UT,{label:"Field",control:d,name:`${c}.modelFieldRef`,options:s}),o.jsx(OT,{label:"Validation (zod), e.g. z.string().min(1) (optional)",control:d,name:`${c}.validation`})]})}const BT=LT({name:"text",pluginId:void 0,label:"Text",getNewInput:()=>({label:"",type:"text",modelFieldRef:""}),Form:zT}),iy=[jT,CT,RT,$T,BT],{ModelUtils:_T}=await C("@baseplate-dev/project-builder-lib"),{adminCrudInputWebSpec:qT,useProjectDefinition:FT}=await C("@baseplate-dev/project-builder-lib/web"),{Button:HT,InputFieldController:PT,SelectFieldController:kT}=await C("@baseplate-dev/ui-components");function IT({idx:a,formProps:n,embeddedFormOptions:l}){const{control:s}=n,c=it({control:s,name:"modelRef"}),{definition:d,pluginContainer:f}=FT(),p=c?_T.byIdOrThrow(d,c):void 0,m=f.getPluginSpec(qT),g=m.getInputWebConfigs(iy).map(j=>({label:j.label,value:j.name})),v=it({control:s,name:`form.fields.${a}.type`}),b=m.getInputWebConfig(v,iy),x=b.Form;return o.jsxs("div",{className:"space-y-4",children:[o.jsx(kT,{label:"Type",control:s,options:g,name:`form.fields.${a}.type`}),o.jsx(PT,{label:"Label",control:s,name:`form.fields.${a}.label`}),x&&p&&o.jsx(x,{formProps:n,name:`form.fields.${a}`,model:p,embeddedFormOptions:l,pluginId:b.pluginId})]})}function Zj({className:a,formProps:n,embeddedFormOptions:l}){const{control:s}=n,{fields:c,append:d,remove:f}=bs({control:s,name:"form.fields"});return o.jsxs("div",{className:Te("space-y-4",a),children:[c.map((p,m)=>o.jsx(aj,{collapsedContents:o.jsxs("div",{children:[p.label," (",p.type,")"]}),onRemove:()=>{f(m)},defaultOpen:!p.label,children:o.jsx(IT,{idx:m,formProps:n,embeddedFormOptions:l},p.id)},p.id)),o.jsx(HT,{onClick:()=>{d({type:"text",label:""})},children:"Add Field"})]})}const{adminCrudDisplayTypes:VT,ModelUtils:GT}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:YT}=await C("@baseplate-dev/project-builder-lib/web"),{Button:XT,InputFieldController:ph,SelectFieldController:gh}=await C("@baseplate-dev/ui-components");function QT({idx:a,control:n,fieldOptions:l,localRelationOptions:s}){const c=VT.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(gh,{label:"Type",control:n,options:c,name:`table.columns.${a}.display.type`}),o.jsx(ph,{label:"Label",control:n,name:`table.columns.${a}.label`}),d==="text"&&o.jsx(gh,{label:"Field",control:n,name:`table.columns.${a}.display.modelFieldRef`,options:l}),d==="foreign"&&o.jsxs(o.Fragment,{children:[o.jsx(gh,{label:"Local Relation Name",control:n,name:`table.columns.${a}.display.localRelationRef`,options:s}),o.jsx(ph,{label:"Label Expression (e.g. name)",control:n,name:`table.columns.${a}.display.labelExpression`}),o.jsx(ph,{label:"Value Expression (e.g. id)",control:n,name:`table.columns.${a}.display.valueExpression`})]})]})}function Wj({className:a,control:n}){const l=it({control:n,name:"modelRef"}),{definition:s,definitionContainer:c}=YT(),d=l?GT.byIdOrThrow(s,l):void 0,{fields:f,append:p,remove:m}=bs({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,x)=>o.jsx(aj,{collapsedContents:o.jsxs("div",{children:[b.label," (",b.display.type,")"]}),onRemove:()=>{m(x)},defaultOpen:!b.label,children:o.jsx(QT,{idx:x,control:n,fieldOptions:v,localRelationOptions:g},b.id)},b.id)),o.jsx(XT,{onClick:()=>{p({display:{type:"text",modelFieldRef:""},label:""})},children:"Add Column"})]})}const{createAdminCrudEmbeddedFormSchema:KT,zPluginWrapper:ZT}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:Jj}=await C("@baseplate-dev/project-builder-lib/web"),{Button:vm,CheckboxFieldController:WT,InputFieldController:JT,SelectFieldController:ly,Table:eR,TableBody:tR,TableCell:ec,TableHead:tc,TableHeader:nR,TableRow:ry,toast:aR}=await C("@baseplate-dev/ui-components"),{useId:iR}=await C("react");function lR({items:a,edit:n,remove:l}){const{definitionContainer:s}=Jj();return o.jsxs(eR,{className:"max-w-6xl",children:[o.jsx(nR,{children:o.jsxs(ry,{children:[o.jsx(tc,{children:"Form Name"}),o.jsx(tc,{children:"Model Name"}),o.jsx(tc,{children:"Type"}),o.jsx(tc,{children:"Actions"})]})}),o.jsx(tR,{children:a.map((c,d)=>o.jsxs(ry,{children:[o.jsx(ec,{children:c.name}),o.jsx(ec,{children:s.nameFromId(c.modelRef)}),o.jsx(ec,{children:c.type}),o.jsxs(ec,{className:"space-x-4",children:[o.jsx(vm,{variant:"link",size:"none",onClick:()=>{n(d)},children:"Edit"}),o.jsx(vm,{variant:"linkDestructive",size:"none",onClick:()=>{l(d)},children:"Remove"})]})]},c.id))})]})}const rR=[{label:"Object",value:"object"},{label:"List",value:"list"}];function sR({initialData:a,onSubmit:n,embeddedFormOptions:l}){const{definition:s,pluginContainer:c}=Jj(),d=tn(KT),f=ZT(d,c),p=gi({resolver:It(f),defaultValues:a}),{handleSubmit:m,control:g,watch:v}=p,b=s.models.map(D=>({label:D.name,value:D.id})),x=v("type"),j=iR();return o.jsxs("form",{onSubmit:D=>{D.stopPropagation(),m(n)(D).catch(S=>{aR.error(Cn(S))})},id:j,className:"space-y-4",children:[o.jsx(JT,{label:"Name",control:g,name:"name"}),o.jsx(ly,{label:"Type",control:g,name:"type",options:rR}),o.jsx(WT,{label:"Include ID Field? (useful for list types)",control:g,name:"includeIdField"}),o.jsx(ly,{label:"Model",control:g,options:b,name:"modelRef"}),x==="list"&&o.jsxs(o.Fragment,{children:[o.jsx("h2",{children:"Table"}),o.jsx(Wj,{control:g})]}),o.jsx("h2",{children:"Form"}),o.jsx(Zj,{formProps:p,embeddedFormOptions:l}),o.jsx(vm,{type:"submit",form:j,children:"Save"})]})}const{useProjectDefinition:oR}=await C("@baseplate-dev/project-builder-lib/web"),{CheckboxFieldController:cR,SelectFieldController:uR}=await C("@baseplate-dev/ui-components");function dR({className:a,formProps:n}){const{control:l}=n,{definition:s}=oR(),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(uR,{label:"Model",control:l,options:c,name:"modelRef"}),o.jsx(cR,{label:"Disable Create?",control:l,name:"disableCreate"}),o.jsx("h2",{children:"Table"}),o.jsx(Wj,{control:l}),o.jsx("h2",{children:"Form"}),o.jsx(Zj,{formProps:n,embeddedFormOptions:d}),o.jsx("h2",{children:"Embedded Forms"}),o.jsx(ms.LabelledController,{control:l,name:"embeddedForms",renderForm:f=>o.jsx(sR,{...f,embeddedFormOptions:d}),renderTable:f=>o.jsx(lR,{...f}),defaultValue:{type:"object"}})]})}const{adminSectionEntityType:vh,createAdminSectionSchema:fR,zPluginWrapper:hR}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:mR,useProjectDefinition:pR,useResettableForm:gR}=await C("@baseplate-dev/project-builder-lib/web"),{Button:sy,ComboboxFieldController:vR,InputFieldController:oy,SelectFieldController:bR,useConfirmDialog:yR}=await C("@baseplate-dev/ui-components"),{useEffect:xR}=await C("react"),jR=[{label:"Crud",value:"crud"}];function cy({className:a,appConfig:n}){const{requestConfirm:l}=yR(),{sectionId:s}=Ki(),{saveDefinitionWithFeedback:c,saveDefinitionWithFeedbackSync:d,isSavingDefinition:f,definition:p,pluginContainer:m}=pR(),g=un(),v=s?vh.idFromKey(s):void 0,b=v?n.sections?.find(T=>T.id===v):void 0,x=tn(fR),j=hR(x,m),D=gR({values:b,defaultValues:{type:"crud"},resolver:It(j)}),{control:S,handleSubmit:R,watch:E,reset:A}=D;xR(()=>{A(b??{type:"crud"})},[A,b]);const B=R(T=>{const O=T.id||vh.generateNewId();return c(W=>{const ae=W.apps.find(ne=>ne.id===n.id);if(ae?.type!=="admin")throw new Error("Cannot add a section to a non-admin app");ae.sections=Zn([...(ae.sections??[]).filter(ne=>!v||ne.id!==v),{...T,id:O}],[ne=>ne.name])},{onSuccess:()=>{v||g(`edit/${vh.keyFromId(O)}`)}})});mR({control:S,reset:A,onSubmit:B});const q=E("type");function G(){l({title:"Delete Section",content:`Are you sure you want to delete ${b?.name??"this section"}?`,onConfirm:()=>{d(T=>{const O=T.apps.find(W=>W.id===n.id);if(O?.type!=="admin")throw new Error("Cannot add a section to a non-admin app");O.sections=(O.sections??[]).filter(W=>!v||W.id!==v)},{successMessage:"Successfully deleted section!",onSuccess:()=>{g("..")}})}})}const Q=p.features.map(T=>({label:T.name,value:T.id}));return o.jsx("div",{className:Te("",a),children:o.jsxs("form",{onSubmit:B,className:"space-y-4",children:[v&&o.jsx(sy,{variant:"link",size:"none",onClick:()=>{G()},children:"Delete Section"}),o.jsx(oy,{label:"Name",control:S,name:"name"}),o.jsx(vR,{label:"Feature",control:S,options:Q,name:"featureRef"}),o.jsx(oy,{label:"Icon",control:S,name:"icon"}),o.jsx(bR,{label:"Type",control:S,name:"type",options:jR}),(()=>{switch(q){case"crud":return o.jsx(dR,{formProps:D});default:return o.jsxs("div",{children:["Unsupported type ",q]})}})(),o.jsx(sy,{type:"submit",disabled:f,children:"Save"})]})})}const{adminSectionEntityType:e2}=await C("@baseplate-dev/project-builder-lib"),{NavigationMenu:SR,NavigationMenuItemWithLink:uy,NavigationMenuList:wR,SidebarLayout:CR,SidebarLayoutContent:ER,SidebarLayoutSidebar:DR}=await C("@baseplate-dev/ui-components");js(e2,"/apps/edit/{parentKey}/sections/edit/{key}");function TR({className:a,appConfig:n}){const l=Zn(n.sections??[],[s=>s.name]);return o.jsxs(CR,{className:a,children:[o.jsxs(DR,{className:"space-y-4",width:"sm",children:[o.jsx("div",{className:"flex items-center justify-between",children:o.jsx("h2",{children:"Sections"})}),o.jsx(SR,{orientation:"vertical",children:o.jsxs(wR,{children:[o.jsx("li",{children:o.jsx(uy,{asChild:!0,children:o.jsx(kt,{to:"new",className:"text-green-500",children:"New Section"})})}),l.map(s=>o.jsx("li",{children:o.jsx(uy,{asChild:!0,children:o.jsx(kt,{to:`edit/${e2.keyFromId(s.id)}`,children:s.name})})},s.id))]})})]}),o.jsx(ER,{className:"p-4",children:o.jsxs(Hx,{children:[o.jsx(ds,{path:"new",element:o.jsx(cy,{appConfig:n},"new")}),o.jsx(ds,{path:"edit/:sectionId",element:o.jsx(cy,{appConfig:n})})]})})]})}const{Alert:RR,AlertDescription:NR,AlertTitle:MR,NavigationTabs:AR,NavigationTabsItem:dy}=await C("@baseplate-dev/ui-components");function $R({className:a,appConfig:n}){return o.jsxs("div",{className:Te("",a),children:[o.jsxs(RR,{variant:"warning",className:"mb-4",children:[o.jsx(MR,{children:"⚠️ Development Preview"}),o.jsx(NR,{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(AR,{children:[o.jsx(dy,{asChild:!0,children:o.jsx(Ht,{to:"",end:!0,children:"General"})}),o.jsx(dy,{asChild:!0,children:o.jsx(Ht,{to:"sections",children:"Sections"})})]}),o.jsx("div",{className:"mt-4 border-t",children:o.jsxs(Hx,{children:[o.jsx(ds,{index:!0,element:o.jsx("div",{className:"p-4",children:o.jsx(gT,{appConfig:n})})}),o.jsx(ds,{path:"/sections/*",element:o.jsx(TR,{appConfig:n})})]})})]})}const{createBackendAppSchema:LR}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:OR,useProjectDefinition:UR,useResettableForm:zR}=await C("@baseplate-dev/project-builder-lib/web"),{Button:BR,CheckboxFieldController:Ol,InputFieldController:fy}=await C("@baseplate-dev/ui-components");function _R({className:a,appConfig:n}){const{saveDefinitionWithFeedback:l,isSavingDefinition:s}=UR(),c=tn(LR),d=zR({resolver:It(c),values:n}),{control:f,handleSubmit:p,reset:m}=d,g=p(v=>l(b=>{b.apps=b.apps.map(x=>x.id===n.id?v:x)}));return OR({control:f,reset:m,onSubmit:g}),o.jsx("div",{className:Te("",a),children:o.jsxs("form",{onSubmit:g,className:"space-y-4",children:[o.jsx(fy,{label:"Name",control:f,name:"name"}),o.jsx(fy,{label:"Package Location (optional) e.g. packages/backend",control:f,name:"packageLocation"}),o.jsx(Ol,{label:"Enable Stripe?",control:f,name:"enableStripe"}),o.jsx(Ol,{label:"Enable Postmark?",control:f,name:"enablePostmark"}),o.jsx(Ol,{label:"Enable Redis?",control:f,name:"enableRedis"}),o.jsx(Ol,{label:"Enable Bull Queue?",control:f,name:"enableBullQueue"}),o.jsx(Ol,{label:"Enable GraphQL Subscriptions?",control:f,name:"enableSubscriptions"}),o.jsx(Ol,{label:"Enable Axios?",control:f,name:"enableAxios"}),o.jsx(BR,{type:"submit",disabled:s,children:"Save"})]})})}const{authConfigSpec:qR,createWebAppSchema:FR}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:HR,useProjectDefinition:hy,useResettableForm:PR}=await C("@baseplate-dev/project-builder-lib/web"),{Button:kR,CheckboxFieldController:bh,InputFieldController:nc,MultiComboboxFieldController:IR}=await C("@baseplate-dev/ui-components");function VR({className:a,appConfig:n}){const{saveDefinitionWithFeedback:l,isSavingDefinition:s}=hy(),c=tn(FR),d=PR({resolver:It(c),values:n}),{control:f,handleSubmit:p,reset:m}=d,{definition:g,pluginContainer:v}=hy(),b=p(j=>l(D=>{D.apps=D.apps.map(S=>S.id===n.id?j:S)}));HR({control:f,reset:m,onSubmit:b});const x=v.getPluginSpecOptional(qR)?.getAuthRoles(g).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(nc,{label:"Name",control:f,name:"name"}),o.jsx(nc,{label:"Package Location (optional) e.g. packages/web",control:f,name:"packageLocation"}),o.jsx(nc,{label:"Page Title",control:f,name:"title"}),o.jsx(nc,{label:"Description Meta Tag",control:f,name:"description"}),o.jsx(bh,{label:"Include Auth?",control:f,name:"includeAuth"}),o.jsx(bh,{label:"Include Upload Components?",control:f,name:"includeUploadComponents"}),o.jsx(bh,{label:"Enable Subscriptions?",control:f,name:"enableSubscriptions"}),x&&o.jsx(IR,{label:"Allowed Roles?",control:f,options:x,name:"allowedRoles"}),o.jsx(kR,{type:"submit",disabled:s,children:"Save"})]})})}const{appEntityType:GR}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:YR}=await C("@baseplate-dev/project-builder-lib/web"),{Button:yh,Dialog:XR,DialogClose:QR,DialogContent:KR,DialogFooter:ZR,DialogHeader:WR,DialogTitle:JR,DialogTrigger:e9,ErrorDisplay:t9}=await C("@baseplate-dev/ui-components");function n9(){const{key:a}=Ki(),{saveDefinitionWithFeedbackSync:n,definition:l,isSavingDefinition:s}=YR(),c=a?GR.idFromKey(a):void 0,d=c&&l.apps.find(g=>g.id===c),f=un();if(!a||!d)return o.jsx(Uc,{});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(XR,{children:[o.jsx(e9,{asChild:!0,children:o.jsx(yh,{variant:"secondary",children:"Delete"})}),o.jsxs(KR,{children:[o.jsx(WR,{children:o.jsxs(JR,{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(ZR,{children:[o.jsx(QR,{children:o.jsx(yh,{variant:"secondary",children:"Cancel"})}),o.jsx(yh,{variant:"destructive",onClick:p,disabled:s,children:"Unlink App"})]})]})]})]}),o.jsx("div",{children:(()=>{switch(d.type){case"backend":return o.jsx(_R,{appConfig:d},d.id);case"web":return o.jsx(VR,{appConfig:d},d.id);case"admin":return o.jsx($R,{appConfig:d},d.id);default:return o.jsx(t9,{error:`Unknown app type: ${d.type}`})}})()})]})}const{appEntityType:a9}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:i9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:xh,Card:l9,EmptyDisplay:r9}=await C("@baseplate-dev/ui-components");function s9(){const{definition:a}=i9(),{apps:n}=a,l=Zn(n,[s=>s.name]);return l.length===0?o.jsx(r9,{icon:Em,header:"No Apps",subtitle:"You haven't created any apps yet",actions:o.jsx(kt,{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(kt,{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(l9,{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(kt,{to:`/apps/edit/${a9.keyFromId(s.id)}`,className:"inline-block",children:o.jsx(xh,{variant:"secondary",children:"Edit"})})]},s.id))})]})}const{appEntityType:my,baseAppSchema:o9}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:c9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:u9,Card:d9,CardContent:f9,InputFieldController:h9,SelectFieldController:m9,toast:p9}=await C("@baseplate-dev/ui-components");function g9(){const{saveDefinitionWithFeedback:a,isSavingDefinition:n}=c9(),l=un(),s=gi({resolver:It(o9),defaultValues:{id:my.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=Zn(v,[b=>b.name])},{onSuccess:()=>{l(`../edit/${my.keyFromId(m.id)}`),p9.success(`Sucessfully created ${m.name}!`)}}));return o.jsxs("div",{className:"space-y-4",children:[o.jsx("h1",{children:"New App"}),o.jsx(d9,{children:o.jsx(f9,{children:o.jsxs("form",{onSubmit:p,className:"space-y-4",children:[o.jsx(h9,{label:"Name",control:c,name:"name",description:"The name of the app, such as 'backend' or 'web'"}),o.jsx(m9,{label:"Type",control:c,name:"type",options:f}),o.jsx(u9,{type:"submit",disabled:n,children:"Create"})]})})})]})}const{appEntityType:v9}=await C("@baseplate-dev/project-builder-lib"),b9=[{element:o.jsx(iT,{}),children:[{index:!0,element:o.jsx(s9,{})},{path:"new",element:o.jsx(g9,{}),handle:{crumb:"New App"}},{path:"edit/:key/*",element:o.jsx(n9,{}),handle:{crumb:Oc(v9,"Edit App")}},{path:"*",element:o.jsx(Ts,{})}]}],{modelEntityType:py,modelEnumEntityType:gy}=await C("@baseplate-dev/project-builder-lib");function t2(a){return`/data/models/edit/${py.isId(a)?py.keyFromId(a):a}`}function n2(a){return`/data/enums/edit/${gy.isId(a)?gy.keyFromId(a):a}`}const{FeatureComboboxFieldController:y9}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:x9}=await C("@baseplate-dev/ui-components");function a2({className:a,control:n}){return o.jsxs("div",{className:Te("max-w-md space-y-4",a),children:[o.jsx(x9,{label:"Name",control:n,name:"name",description:"The name of the enum (PascalCase)"}),o.jsx(y9,{label:"Feature",control:n,name:"featureRef",description:"The feature this enum belongs to (dash-case)",canCreate:!0})]})}const{createEnumBaseSchema:j9,EnumUtils:S9,FeatureUtils:w9,modelEnumEntityType:bm}=await C("@baseplate-dev/project-builder-lib"),{usePluginEnhancedSchema:C9,useProjectDefinition:E9,useResettableForm:D9}=await C("@baseplate-dev/project-builder-lib/web"),{useEventCallback:T9}=await C("@baseplate-dev/ui-components"),{useMemo:jh}=await C("react");function R9(){return{id:bm.generateNewId(),name:"",featureRef:"",isExposed:!1,values:[]}}function ep({schema:a,onSubmitSuccess:n,isCreate:l}={}){const{key:s}=Ki(),{definition:c,saveDefinitionWithFeedback:d,isSavingDefinition:f}=E9(),p=un(),m=l?void 0:bm.idFromKey(s),g=m?S9.byId(c,m):void 0;if(!l&&!g)throw new tj("Enum not found");const v=jh(()=>R9(),[]),b=tn(j9),x=C9(a??b),j=jh(()=>{const q=g??v;return a?x.parse(q):q},[g,v,a,x]),D=D9({resolver:It(x),defaultValues:j}),{reset:S,handleSubmit:R,setError:E}=D,A=T9(n),B=jh(()=>R(q=>{const G={...g,...q,id:g?.id??bm.generateNewId()};if(c.enums?.find(T=>T.id!==G.id&&T.name.toLowerCase()===G.name.toLowerCase())){E("name",{message:`Enum with name ${G.name} already exists.`});return}return d(T=>{G.featureRef=w9.ensureFeatureByNameRecursively(T,G.featureRef),T.enums=Zn([...T.enums?.filter(O=>O.id!==G.id)??[],G],[O=>O.name])},{successMessage:l?"Successfully created enum!":"Successfully saved enum!",onSuccess:()=>{l?(p(n2(G.id)),S(v)):S(q),A?.()}})}),[p,S,d,E,R,c,l,g,v,A]);return{form:D,onSubmit:B,defaultValues:j,isSavingDefinition:f}}const{useBlockBeforeContinue:N9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:vy,Dialog:M9,DialogClose:A9,DialogContent:$9,DialogDescription:L9,DialogFooter:O9,DialogHeader:U9,DialogTitle:z9,DialogTrigger:B9,SwitchFieldController:_9,useControlledState:q9}=await C("@baseplate-dev/ui-components");function i2({children:a,open:n,onOpenChange:l}){const[s,c]=q9(n,l,!1),{onSubmit:d,form:{control:f},isSavingDefinition:p}=ep({isCreate:!0,onSubmitSuccess:()=>{c(!1)}}),m=N9();return o.jsxs(M9,{open:s,onOpenChange:g=>{g?m({onContinue:()=>{c(!0)}}):c(!1)},children:[o.jsx(B9,{asChild:!0,children:a}),o.jsxs($9,{children:[o.jsxs(U9,{children:[o.jsx(z9,{children:"New Enum"}),o.jsx(L9,{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(a2,{control:f}),o.jsx(_9,{label:"Expose in GraphQL schema",control:f,name:"isExposed",description:"Whether to expose this enum in the GraphQL schema"}),o.jsxs(O9,{children:[o.jsx(A9,{asChild:!0,children:o.jsx(vy,{variant:"secondary",children:"Cancel"})}),o.jsx(vy,{type:"submit",disabled:p,children:"Create Enum"})]})]})]})]})}const{useProjectDefinition:F9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:by,InputField:H9,NavigationMenu:P9,NavigationMenuItemWithLink:k9,NavigationMenuList:I9,ScrollArea:V9}=await C("@baseplate-dev/ui-components"),{useState:yy}=await C("react");function G9({className:a}){const{definition:{enums:n=[]}}=F9(),[l,s]=yy(""),c=n.filter(m=>m.name.toLowerCase().includes(l.toLowerCase())),d=Zn(c,[m=>m.name]),[f,p]=yy(!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(i2,{children:o.jsxs(by,{variant:"secondary",className:"w-full",children:[o.jsx(Yi,{}),"New Enum"]})}),n.length>0&&o.jsxs("div",{className:"relative",children:[o.jsx(H9,{value:l,onChange:m=>{s(m)},placeholder:"Search"}),l&&o.jsx(by,{variant:"ghost",className:"absolute top-1/2 right-4 -translate-y-1/2",size:"icon",onClick:()=>{s("")},children:o.jsx(jx,{})})]})]}),o.jsxs(V9,{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(P9,{orientation:"vertical",children:o.jsx(I9,{children:d.map(m=>o.jsx("li",{children:o.jsx(k9,{asChild:!0,children:o.jsx(Ht,{to:n2(m.id),children:m.name})})},m.id))})})]})]})}const{createModelSchema:Y9,FeatureUtils:X9,modelEntityType:ym,modelScalarFieldEntityType:Q9,ModelUtils:K9}=await C("@baseplate-dev/project-builder-lib"),{usePluginEnhancedSchema:Z9,useProjectDefinition:W9,useResettableForm:J9}=await C("@baseplate-dev/project-builder-lib/web"),{toast:ac,useEventCallback:eN}=await C("@baseplate-dev/ui-components"),{useMemo:Sh}=await C("react");function tN(){const a=Q9.generateNewId();return{id:ym.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 Ns({onSubmitSuccess:a,isCreate:n,schema:l}={}){const{key:s}=Ki(),{definition:c,saveDefinitionWithFeedback:d}=W9(),f=un(),p=n?void 0:ym.idFromKey(s),m=p?K9.byIdOrThrow(c,p):void 0;if(!n&&!m)throw new tj("The model you were looking for could not be found.");const g=Sh(()=>tN(),[]),v=tn(Y9),b=Z9(l??v),x=Sh(()=>{const B=m??g;return l?b.parse(B):B},[m,g,l,b]),j=J9({resolver:It(b),defaultValues:x}),{reset:D,handleSubmit:S,setError:R}=j,E=eN(a),A=Sh(()=>S(B=>{const q={...m,...B,id:m?.id??ym.generateNewId()};if(q.model.fields.length===0){ac.error("Model must have at least one field.");return}if(q.model.primaryKeyFieldRefs.length===0){ac.error("Model must have at least one primary key field.");return}if(c.models.find(T=>T.id!==B.id&&T.name.toLowerCase()===q.name.toLowerCase())){R("name",{message:`Model with name ${q.name} already exists.`});return}const{service:Q}=q;if(Q.create.enabled){if(!Q.create.fields?.length&&!Q.create.transformerNames?.length){ac.error("Create method must have at least one field or transformer.");return}}else Q.create={enabled:!1};if(Q.update.enabled){if(!Q.update.fields?.length&&!Q.update.transformerNames?.length){ac.error("Update method must have at least one field or transformer.");return}}else Q.update={enabled:!1};return Q.delete.enabled||(Q.delete={enabled:!1}),!Q.create.enabled&&!Q.update.enabled&&!Q.delete.enabled&&(q.service={create:{enabled:!1},update:{enabled:!1},delete:{enabled:!1},transformers:[]}),d(T=>{q.featureRef=X9.ensureFeatureByNameRecursively(T,q.featureRef),T.models=Zn([...T.models.filter(O=>O.id!==q.id),q],[O=>O.name])},{successMessage:n?"Successfully created model!":"Successfully saved model!",onSuccess:()=>{n?(f(t2(q.id)),D(g)):D(B),E?.()}})}),[D,R,S,d,n,f,E,c,g,m]);return{form:j,onSubmit:A,originalModel:m,defaultValues:x}}const{FeatureComboboxFieldController:nN}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:aN}=await C("@baseplate-dev/ui-components");function l2({className:a,control:n}){return o.jsxs("div",{className:Te("space-y-4",a),children:[o.jsx(aN,{control:n,label:"Name",name:"name",description:"The name of the model (PascalCase)"}),o.jsx(nN,{control:n,name:"featureRef",description:"The feature this model belongs to (dash-case)",canCreate:!0})]})}const{useBlockBeforeContinue:iN}=await C("@baseplate-dev/project-builder-lib/web"),{Button:xy,Dialog:lN,DialogClose:rN,DialogContent:sN,DialogDescription:oN,DialogFooter:cN,DialogHeader:uN,DialogTitle:dN,DialogTrigger:fN,useControlledState:hN}=await C("@baseplate-dev/ui-components");function xm({children:a,open:n,onOpenChange:l}){const[s,c]=hN(n,l,!1),{onSubmit:d,form:{control:f}}=Ns({isCreate:!0,onSubmitSuccess:()=>{c(!1)}}),p=iN();return o.jsxs(lN,{open:s,onOpenChange:m=>{m?p({onContinue:()=>{c(!0)}}):c(!1)},children:[o.jsx(fN,{asChild:!0,children:a}),o.jsxs(sN,{children:[o.jsxs(uN,{children:[o.jsx(dN,{children:"New Model"}),o.jsx(oN,{children:"Models define the structure of your data."})]}),o.jsxs("form",{onSubmit:d,className:"space-y-4",children:[o.jsx(l2,{control:f}),o.jsxs(cN,{children:[o.jsx(rN,{asChild:!0,children:o.jsx(xy,{variant:"secondary",children:"Cancel"})}),o.jsx(xy,{type:"submit",children:"Create Model"})]})]})]})]})}const{useProjectDefinition:mN}=await C("@baseplate-dev/project-builder-lib/web"),{Button:jy,InputField:pN,NavigationMenu:gN,NavigationMenuItemWithLink:vN,NavigationMenuList:bN,ScrollArea:yN}=await C("@baseplate-dev/ui-components"),{useState:Sy}=await C("react");function xN({className:a}){const{definition:{models:n}}=mN(),[l,s]=Sy(""),c=n.filter(m=>m.name.toLowerCase().includes(l.toLowerCase())),d=Zn(c,[m=>m.name]),[f,p]=Sy(!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(jy,{variant:"secondary",className:"w-full",children:[o.jsx(Yi,{}),"New Model"]})}),n.length>0&&o.jsxs("div",{className:"relative",children:[o.jsx(pN,{value:l,onChange:m=>{s(m)},placeholder:"Search"}),l&&o.jsx(jy,{variant:"ghost",className:"absolute top-1/2 right-4 -translate-y-1/2",onClick:()=>{s("")},size:"icon",children:o.jsx(jx,{})})]})]}),o.jsxs(yN,{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(gN,{orientation:"vertical",children:o.jsx(bN,{children:d.map(m=>o.jsx(vN,{asChild:!0,children:o.jsx(Ht,{to:t2(m.id),children:m.name})},m.id))})})]})]})}const{useProjectDefinition:jN}=await C("@baseplate-dev/project-builder-lib/web"),{NavigationTabs:SN,NavigationTabsItem:wy,SidebarLayout:wN,SidebarLayoutContent:CN,SidebarLayoutSidebar:EN}=await C("@baseplate-dev/ui-components");function DN(){const{definition:{models:a=[],enums:n=[]}}=jN(),l=c6([...a,...n],d=>d.name.length)?.name,s=nb("/data/models/*"),c=nb("/data/enums/*");return o.jsxs(wN,{className:"flex-1",children:[o.jsxs(EN,{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(SN,{className:"w-full",children:[o.jsx(wy,{asChild:!0,children:o.jsx(Ht,{to:"models",children:"Models"})}),o.jsx(wy,{asChild:!0,children:o.jsx(Ht,{to:"enums",children:"Enums"})})]})}),s?o.jsx(xN,{}):null,c?o.jsx(G9,{}):null]}),o.jsx(CN,{className:"h-[calc(100vh-var(--topbar-height)-1px)]",children:o.jsx(Yl,{children:o.jsx(vi,{})})})]})}const{SectionListSection:TN,SectionListSectionContent:RN,SectionListSectionHeader:NN,SectionListSectionTitle:MN,SwitchFieldController:AN}=await C("@baseplate-dev/ui-components");function $N({control:a}){return o.jsxs(TN,{children:[o.jsx(NN,{children:o.jsx(MN,{children:"GraphQL"})}),o.jsx(RN,{className:"space-y-4",children:o.jsx(AN,{label:"Expose in GraphQL schema",control:a,name:"isExposed",description:"Whether to expose this enum in the GraphQL schema"})})]})}function LN(a){return a.split("_").map(s=>s.charAt(0).toUpperCase()+s.slice(1).toLowerCase()).join(" ")}const{modelEnumValueEntityType:ON}=await C("@baseplate-dev/project-builder-lib"),{Button:Cy,InputFieldController:Ey,Label:Dy,SectionListSection:UN,SectionListSectionContent:zN,SectionListSectionDescription:BN,SectionListSectionHeader:_N,SectionListSectionTitle:qN}=await C("@baseplate-dev/ui-components");function FN({control:a,setValue:n}){const{fields:l,remove:s,append:c,move:d}=bs({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(Ey,{control:a,name:`values.${v}.name`}),o.jsx(Ey,{control:a,name:`values.${v}.friendlyName`,onFocus:()=>{!f[v].friendlyName&&f[v].name&&n(`values.${v}.friendlyName`,LN(f[v].name))}}),o.jsxs(Cy,{variant:"ghost",size:"icon",onClick:()=>{s(v)},children:[o.jsx(ys,{}),o.jsx("div",{className:"sr-only",children:"Delete Enum"})]})]})}));return o.jsxs(UN,{children:[o.jsxs(_N,{children:[o.jsx(qN,{children:"Values"}),o.jsx(BN,{children:"Configure the allowed values for this enum."})]}),o.jsxs(zN,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:Te(p,"pl-12"),children:[o.jsx(Dy,{children:"Value Name, e.g. ACTIVE"}),o.jsx(Dy,{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(Uj,{listItems:m,sortItems:d})]}),o.jsx(Cy,{size:"sm",variant:"secondary",onClick:()=>{c({id:ON.generateNewId(),name:"",friendlyName:""})},children:"Add Value"})]})]})}const{createEnumBaseSchema:HN}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:PN}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:kN,SectionList:IN}=await C("@baseplate-dev/ui-components");function VN(){const a=tn(HN),{form:n,onSubmit:l,isSavingDefinition:s}=ep({schema:a.omit({name:!0,featureRef:!0})}),{control:c,setValue:d}=n;return PN({control:c,reset:n.reset,onSubmit:l}),o.jsx(Yl,{children:o.jsxs("form",{onSubmit:l,className:"mx-4 max-w-7xl min-w-[700px] flex-1 space-y-4 pb-4",children:[o.jsxs(IN,{children:[o.jsx($N,{control:c}),o.jsx(FN,{control:c,setValue:d})]}),o.jsx(kN,{form:n,disabled:s})]})})}const{Button:Ty,Dialog:GN,DialogClose:YN,DialogContent:XN,DialogFooter:QN,DialogHeader:KN,DialogTitle:ZN,DialogTrigger:WN,useControlledState:JN}=await C("@baseplate-dev/ui-components");function eM({open:a,onOpenChange:n,asChild:l,children:s}){const[c,d]=JN(a,n,!1),{form:{control:f,reset:p},onSubmit:m,defaultValues:g,isSavingDefinition:v}=ep({onSubmitSuccess(){d(!1)}});return o.jsxs(GN,{open:c,onOpenChange:b=>{d(b),b||p(g)},children:[o.jsx(WN,{asChild:l,children:s}),o.jsx(XN,{"aria-describedby":void 0,children:o.jsxs("form",{onSubmit:m,className:"space-y-4",children:[o.jsx(KN,{children:o.jsx(ZN,{children:"Edit Enum Info"})}),o.jsx(a2,{control:f}),o.jsxs(QN,{children:[o.jsx(YN,{asChild:!0,children:o.jsx(Ty,{variant:"secondary",children:"Cancel"})}),o.jsx(Ty,{type:"submit",disabled:v,children:"Save"})]})]})})]})}const{FeatureUtils:tM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:nM}=await C("@baseplate-dev/project-builder-lib/web"),{Button:aM,useConfirmDialog:iM}=await C("@baseplate-dev/ui-components");function lM({className:a,enumDefinition:n}){const{definition:l,saveDefinitionWithFeedbackSync:s,isSavingDefinition:c}=nM(),d=un(),{requestConfirm:f}=iM(),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(eM,{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(Vl,{className:"invisible size-4 group-hover:visible"})]})}),n.featureRef&&o.jsx("div",{className:"text-xs text-muted-foreground",children:tM.getFeatureById(l,n.featureRef)?.name})]}),o.jsx("div",{className:"flex gap-8",children:o.jsxs(aM,{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(ys,{className:"text-destructive"}),o.jsx("div",{className:"sr-only",children:"Delete Enum"})]})})]})}const{EnumUtils:rM,modelEnumEntityType:sM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:oM}=await C("@baseplate-dev/project-builder-lib/web");function cM(){const{key:a}=Ki(),{definition:n}=oM(),l=sM.idFromKey(a),s=rM.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(lM,{enumDefinition:s})}),o.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",children:o.jsx(vi,{})})]},l):o.jsx(Uc,{})}const{modelEnumEntityType:uM}=await C("@baseplate-dev/project-builder-lib"),dM={path:"edit/:key/*",element:o.jsx(cM,{}),handle:{crumb:Oc(uM,"Edit Enum","/data/enums/edit/:key")},children:[{index:!0,element:o.jsx(VN,{})},Rs]},{Button:fM}=await C("@baseplate-dev/ui-components");function hM(){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(i2,{children:o.jsx(fM,{variant:"link",size:"none",children:"create a new enum"})}),"."]})]})}const mM={path:"enums/*",handle:{crumb:{label:"Enums",url:"/data/enums"}},children:[{index:!0,element:o.jsx(hM,{})},dM,Rs]},{Button:Ry,Dialog:pM,DialogClose:gM,DialogContent:vM,DialogFooter:bM,DialogHeader:yM,DialogTitle:xM,DialogTrigger:jM,useControlledState:SM}=await C("@baseplate-dev/ui-components");function wM({open:a,onOpenChange:n,children:l,asChild:s}){const[c,d]=SM(a,n,!1),{form:{control:f,reset:p},onSubmit:m,defaultValues:g}=Ns({onSubmitSuccess(){d(!1)}});return o.jsxs(pM,{open:c,onOpenChange:v=>{d(v),v||p(g)},children:[l&&o.jsx(jM,{asChild:s,children:l}),o.jsx(vM,{"aria-describedby":void 0,children:o.jsxs("form",{onSubmit:m,className:"space-y-4",children:[o.jsx(yM,{children:o.jsx(xM,{children:"Edit Model Info"})}),o.jsx(l2,{control:f}),o.jsxs(bM,{children:[o.jsx(gM,{asChild:!0,children:o.jsx(Ry,{variant:"secondary",children:"Cancel"})}),o.jsx(Ry,{type:"submit",children:"Save"})]})]})})]})}const{FeatureUtils:CM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:EM}=await C("@baseplate-dev/project-builder-lib/web"),{Button:DM,useConfirmDialog:TM}=await C("@baseplate-dev/ui-components");function RM({className:a,model:n}){const{definition:l,saveDefinitionWithFeedbackSync:s,isSavingDefinition:c}=EM(),d=un(),{requestConfirm:f}=TM(),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(wM,{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(Vl,{className:"invisible size-4 group-hover:visible"})]})}),n.featureRef&&o.jsx("div",{className:"text-xs text-muted-foreground",children:CM.getFeatureById(l,n.featureRef)?.name})]}),o.jsx("div",{className:"flex gap-8",children:o.jsxs(DM,{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(ys,{className:"text-destructive"}),o.jsx("div",{className:"sr-only",children:"Delete Model"})]})})]})}const{modelEntityType:NM,ModelUtils:MM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:AM}=await C("@baseplate-dev/project-builder-lib/web"),{NavigationTabs:$M,NavigationTabsItem:wh}=await C("@baseplate-dev/ui-components");function LM(){const{key:a}=Ki(),{definition:n}=AM(),l=NM.idFromKey(a),s=MM.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(RM,{model:s}),o.jsxs($M,{children:[o.jsx(wh,{asChild:!0,children:o.jsx(Ht,{to:"",end:!0,children:"Fields"})}),o.jsx(wh,{asChild:!0,children:o.jsx(Ht,{to:"service",children:"Service"})}),o.jsx(wh,{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(vi,{})})]},l):o.jsx(Uc,{})}const{useRef:OM}=await C("react");function UM(a){const n=OM(void 0);return l=>{const s=a(l);return Iw(n.current,s)?n.current:(n.current=s,s)}}const{ModelUtils:zM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:BM}=await C("@baseplate-dev/project-builder-lib/web"),{createContext:_M,useContext:qM,useEffect:FM,useMemo:HM}=await C("react"),r2=_M(void 0);function tp({children:a,watch:n,initialModel:l,getValues:s}){const{definition:c}=BM(),d=zM.byIdOrThrow(c,l.id),f=HM(()=>ww(p=>({model:{...d,...l},setModel:m=>{p({model:{...d,...m}})},getValues:s})),[l,s,d]);return FM(()=>{const{unsubscribe:p}=n(m=>{f.getState().setModel(m)});return p},[n,f]),o.jsx(r2.Provider,{value:f,children:a})}function lt(a){const n=qM(r2);if(!n)throw new Error("useEditedModelConfig must be used within a EditedModelContextProvider");return Sw(n,UM(l=>a(l.model)))}const{authConfigSpec:PM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:kM}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:IM,AlertDescription:VM,AlertTitle:GM,MultiSwitchField:Ch,SectionListSection:YM,SectionListSectionContent:XM,SectionListSectionDescription:QM,SectionListSectionHeader:KM,SectionListSectionTitle:ZM,SwitchFieldController:Eh}=await C("@baseplate-dev/ui-components");function WM({control:a}){const{definition:n,pluginContainer:l}=kM(),s=l.getPluginSpecOptional(PM)?.getAuthRoles(n).map(x=>({label:x.name,value:x.id})),c=it({control:a,name:"graphql.objectType.enabled"}),d=lt(x=>x.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(YM,{children:[o.jsx("div",{children:o.jsxs(KM,{className:"sticky top-2",children:[o.jsx(ZM,{children:"Mutations"}),o.jsx(QM,{children:"Configure the GraphQL mutations that can be performed on this model."})]})}),o.jsxs(XM,{className:"space-y-8",children:[(!p||!g||!b)&&o.jsxs(IM,{className:"max-w-md",children:[o.jsx(Dm,{}),o.jsxs(GM,{children:["Service methods disabled (",[!p&&"Create",!g&&"Update",!b&&"Delete"].filter(Boolean).join(", "),")"]}),o.jsxs(VM,{children:["Enable the appropriate methods on the"," ",o.jsx(kt,{to:"../service",className:"font-semibold",children:"the service tab"})," ","to expose mutations"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx(Eh,{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(Ch.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(Eh,{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(Ch.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(Eh,{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(Ch.Controller,{control:a,name:"graphql.mutations.delete.roles",label:"Allowed Roles",options:s,className:"ml-[52px]"})]})]})]})}function Dh(a){return Gi({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 Th(a){return Gi({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:JM,ModelTransformerUtils:eA,ModelUtils:s2}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:tA}=await C("@baseplate-dev/project-builder-lib/web"),{MultiComboboxFieldController:Ny,SelectFieldController:nA}=await C("@baseplate-dev/ui-components"),{useEffect:aA}=await C("react");function iA({formProps:a,name:n}){const l=n,s=a,{control:c,setValue:d}=s,{definition:f,definitionContainer:p,pluginContainer:m}=tA(),g=it({control:c,name:l}),v=lt(E=>{const A=s2.getRelationsToModel(f,E.id),B=E.service?.transformers?.filter(q=>q.type==="embeddedRelation"&&q.id!==g.id);return A.filter(({relation:q})=>!B?.some(G=>G.foreignRelationRef===q.foreignId))}),b=v.map(E=>({label:`${E.relation.foreignRelationName} (${E.model.name})`,value:E.relation.foreignId})),x=g.type==="embeddedRelation"?g:null,j=v.find(E=>E.relation.foreignId===x?.foreignRelationRef),D=Um(x?.foreignRelationRef);aA(()=>{D!==void 0&&D!==x?.foreignRelationRef&&(d(`${l}.embeddedFieldNames`,[]),j?.model.id&&d(`${l}.modelRef`,j.model.id))},[l,d,j,x?.foreignRelationRef,D,v]);const S=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:eA.getTransformName(p,E,m),value:E.id}))??[];return o.jsxs("div",{className:"space-y-4",children:[o.jsx(nA,{control:c,name:`${l}.foreignRelationRef`,options:b,label:"Relation",placeholder:"Select relation"}),o.jsx(Ny,{control:c,disabled:S.length===0,options:S,name:`${l}.embeddedFieldNames`,label:"Embedded Field Names"}),R.length>0&&o.jsx(Ny,{control:c,options:R,name:`${l}.embeddedTransformerNames`,label:"Embedded Transformers"})]})}const lA={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=s2.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:JM.generateNewId(),foreignRelationRef:"",type:"embeddedRelation",embeddedFieldNames:[],modelRef:""}),Form:iA,pluginId:void 0},{modelTransformerEntityType:rA}=await C("@baseplate-dev/project-builder-lib"),{createNewModelTransformerWebConfig:sA}=await C("@baseplate-dev/project-builder-lib/web"),np=[lA,sA({name:"password",label:"Password",description:"Hashes the input value of value 'password' using Argon2id",getNewTransformer:()=>({id:rA.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})],ap={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 oA(a){const n=/([_\s-]*[A-Z]+(?![^\s\-_A-Z])|[_\s-]*[A-Z]*[^\s\-_A-Z]+)/g;return a.match(n)??[]}function My(a,n){return a.length<=n?a:`${a.slice(0,Math.max(0,n-3))}...`}function cA(a,n=20){if(a.length<=n)return a;if(a.length<=3)return"...";const l=oA(a);if(l.length===1)return My(a,n);const s=l[0],c=(l.at(-1)??"").replace(/^[_\s-]+/,""),d=c.length;if(s.length+d+3>n)return My(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:uA}=await C("@baseplate-dev/ui-components");function ss({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(uA,{variant:"outline",className:"text-muted-foreground",children:cA(l,20)})]})}const{ModelUtils:dA}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:fA}=await C("@baseplate-dev/project-builder-lib/web"),{Badge:Rh,Button:Nh,Label:Mh,SectionListSection:hA,SectionListSectionContent:mA,SectionListSectionDescription:pA,SectionListSectionHeader:gA,SectionListSectionTitle:vA,Switch:Ah,SwitchFieldController:bA}=await C("@baseplate-dev/ui-components"),{useState:$h}=await C("react"),yA="border-collapse text-left [&_td]:py-1 [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-10 [&_th]:py-2";function Lh(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 xA({control:a}){const{definitionContainer:n,definition:l}=fA(),s=lt(T=>T.id),c=it({control:a,name:"graphql.objectType.enabled"}),d=lt(T=>T.model.fields),{field:{value:f=[],onChange:p}}=fa({control:a,name:"graphql.objectType.fields"}),m=d.length>10,[g,v]=$h(m),b=lt(T=>T.model.relations)??[],{field:{value:x=[],onChange:j}}=fa({control:a,name:"graphql.objectType.localRelations"}),D=b.length>4,[S,R]=$h(D),E=dA.getRelationsToModel(l,s),{field:{value:A=[],onChange:B}}=fa({control:a,name:"graphql.objectType.foreignRelations"}),q=E.length>4,[G,Q]=$h(q);return o.jsxs(hA,{children:[o.jsx("div",{children:o.jsxs(gA,{className:"sticky top-2",children:[o.jsx(vA,{children:"Object Type"}),o.jsx(pA,{children:"Configure the object type that will be exposed in the GraphQL schema for this model."})]})}),o.jsxs(mA,{className:"space-y-4",children:[o.jsx(bA,{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:yA,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(Mh,{children:"Exposed Fields"}),o.jsxs(Rh,{variant:"outline",className:"mr-5 font-medium text-muted-foreground",children:[f.length,"/",d.length," active"]}),m?o.jsx(Nh,{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(Dh,{}):o.jsx(Th,{})}):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(ss,{type:T.type==="enum"&&T.options?.enumRef?n.nameFromId(T.options.enumRef):ap[T.type].label,children:T.name})}),o.jsx("td",{className:"pl-8",children:o.jsx(Ah,{"aria-label":`Expose ${T.name} field`,disabled:!c,checked:f.includes(T.id),onCheckedChange:O=>{p(Lh(d,f,O,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(Mh,{children:"Exposed Local Relations"}),o.jsxs(Rh,{variant:"outline",className:"mr-5 font-medium text-muted-foreground",children:[x.length,"/",b.length," ","active"]}),D?o.jsx(Nh,{onClick:()=>{R(!S)},className:"flex items-center gap-4",title:S?"Expand fields":"Collapse fields",type:"button",variant:"ghost",size:"icon",children:S?o.jsx(Dh,{}):o.jsx(Th,{})}):null]})}),o.jsx("th",{})]}):null,!S&&b.map(T=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(ss,{type:n.nameFromId(T.modelRef),children:T.name})}),o.jsx("td",{className:"pl-8",children:o.jsx(Ah,{"aria-label":`Expose ${T.name} relation`,disabled:!c,checked:x.includes(T.id),onCheckedChange:O=>{j(Lh(b,x,O,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(Mh,{children:"Exposed Foreign Relations"}),o.jsxs(Rh,{variant:"outline",className:"mr-5 font-medium text-muted-foreground",children:[A.length,"/",E.length," ","active"]}),q?o.jsx(Nh,{onClick:()=>{Q(!G)},className:"flex items-center gap-4",title:G?"Expand fields":"Collapse fields",type:"button",variant:"ghost",size:"icon",children:G?o.jsx(Dh,{}):o.jsx(Th,{})}):null]})}),o.jsx("th",{})]}):null,!G&&E.map(({model:T,relation:O})=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(ss,{type:T.name,children:O.foreignRelationName})}),o.jsx("td",{className:"pl-8",children:o.jsx(Ah,{"aria-label":`Expose ${O.foreignRelationName} relation`,disabled:!c,checked:A.includes(O.foreignId),onCheckedChange:W=>{B(Lh(E.map(({relation:ae})=>({id:ae.foreignId})),A,W,O.foreignId))}})})]},O.id))]})]})]})]})}const{authConfigSpec:jA}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:SA}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:wA,AlertDescription:CA,AlertTitle:EA,MultiSwitchField:Ay,SectionListSection:DA,SectionListSectionContent:TA,SectionListSectionDescription:RA,SectionListSectionHeader:NA,SectionListSectionTitle:MA,SwitchFieldController:$y}=await C("@baseplate-dev/ui-components");function AA({control:a}){const{definition:n,pluginContainer:l}=SA(),s=it({control:a,name:"graphql.objectType.enabled"}),c=l.getPluginSpecOptional(jA)?.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(DA,{children:[o.jsx("div",{children:o.jsxs(NA,{className:"sticky top-2",children:[o.jsx(MA,{children:"Queries"}),o.jsx(RA,{children:"Configure the GraphQL queries that can be performed on this model."})]})}),o.jsxs(TA,{className:"space-y-8",children:[!s&&o.jsxs(wA,{className:"max-w-md",children:[o.jsx(Dm,{}),o.jsx(EA,{children:"Object type missing"}),o.jsx(CA,{children:"Enable the object type to expose queries and mutations"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx($y,{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(Ay.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($y,{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(Ay.Controller,{control:a,name:"graphql.queries.list.roles",label:"Allowed Roles",options:c,className:"ml-[52px]"})]})]})]})}const{createModelBaseSchema:$A}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:LA}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:OA,SectionList:UA}=await C("@baseplate-dev/ui-components");function zA(){const a=tn($A),{form:n,onSubmit:l,defaultValues:s}=Ns({schema:a.omit({name:!0,featureRef:!0})}),{control:c,watch:d,getValues:f,reset:p}=n;return LA({control:c,reset:p,onSubmit:l}),o.jsx(tp,{initialModel:s,getValues:f,watch:d,children:o.jsx("form",{onSubmit:l,className:"space-y-4 p-4",children:o.jsxs(UA,{children:[o.jsx(xA,{control:c}),o.jsx(AA,{control:c}),o.jsx(WM,{control:c}),o.jsx(OA,{form:n})]})})})}const{modelScalarFieldEntityType:Ly}=await C("@baseplate-dev/project-builder-lib"),{Button:Oy,ButtonGroup:BA,DropdownMenu:_A,DropdownMenuContent:qA,DropdownMenuItem:FA,DropdownMenuTrigger:HA}=await C("@baseplate-dev/ui-components"),{useMemo:PA}=await C("react");function kA({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=PA(()=>{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=Ly.generateNewId();s.includes(g.name)||n({id:v,...g}),m&&l("model.primaryKeyFieldRefs",[v],{shouldDirty:!0})}};return o.jsxs(BA,{className:a,children:[o.jsx(Oy,{variant:"secondary",onClick:()=>{n({id:Ly.generateNewId(),name:"",type:"string",isOptional:!0,options:{default:""}})},size:"sm",children:"Add Field"}),o.jsxs(_A,{children:[o.jsx(HA,{disabled:d.length===0,asChild:!0,children:o.jsx(Oy,{variant:"secondary",size:"sm",children:o.jsx($w,{})})}),o.jsx(qA,{children:d.map(p=>o.jsx(FA,{onClick:()=>{f(p)},children:p.name},p.name))})]})]})}const{Button:Uy,DialogClose:IA,DialogFooter:VA,MultiComboboxFieldController:GA}=await C("@baseplate-dev/ui-components"),{useId:YA}=await C("react"),{z:Oh}=await C("zod"),XA=Oh.object({fields:Oh.array(Oh.string()).min(1,"At least one primary key is required")});function QA({className:a,control:n,onSubmitSuccess:l}){const s=lt(v=>v.model.fields),{field:{value:c=[],onChange:d}}=fa({name:"model.primaryKeyFieldRefs",control:n}),{control:f,handleSubmit:p}=gi({resolver:It(XA),values:{fields:c}}),m=p(v=>{d(v.fields),l?.()}),g=YA();return o.jsxs("form",{className:Te("space-y-4",a),onSubmit:v=>(v.stopPropagation(),m(v)),id:g,children:[o.jsx(GA,{control:f,name:"fields",options:s.map(v=>({value:v.id,label:v.name})),placeholder:"Select fields to use as primary keys"}),o.jsxs(VA,{children:[o.jsx(IA,{asChild:!0,children:o.jsx(Uy,{variant:"secondary",children:"Cancel"})}),o.jsx(Uy,{type:"submit",form:g,children:"Save"})]})]})}const{Dialog:KA,DialogContent:ZA,DialogDescription:WA,DialogHeader:JA,DialogTitle:e$,DialogTrigger:t$,useControlledState:n$}=await C("@baseplate-dev/ui-components");function o2({control:a,children:n,asChild:l,open:s,onOpenChange:c}){const[d,f]=n$(s,c,!1);return o.jsxs(KA,{open:d,onOpenChange:f,children:[n&&o.jsx(t$,{asChild:l,children:n}),o.jsxs(ZA,{children:[o.jsxs(JA,{children:[o.jsx(e$,{children:"Primary Keys"}),o.jsx(WA,{children:"Select the fields that will be used as the primary key for this model"})]}),o.jsx(QA,{control:a,onSubmitSuccess:()=>{f(!1)}})]})]})}const{BadgeWithIcon:a$}=await C("@baseplate-dev/ui-components"),{useState:i$}=await C("react");function l$({className:a,control:n,autoCollapse:l}){const[s,c]=i$(!1),d=!l||s;return o.jsx(o2,{control:n,children:o.jsx(a$,{icon:Lw,variant:"secondary",className:a,onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)},"aria-label":"Primary Key",title:"Primary Key",children:d&&"Primary"})})}const{createModelRelationFieldSchema:r$,ModelFieldUtils:s$,modelForeignRelationEntityType:o$,modelLocalRelationEntityType:c$,ModelUtils:zy}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:u$}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Uh,ComboboxField:d$,ComboboxFieldController:zh,DialogClose:f$,DialogFooter:h$,InputFieldController:By,SelectFieldController:m$,toast:_y}=await C("@baseplate-dev/ui-components"),c2=await C("react"),{useId:p$,useMemo:g$}=c2;function v$(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 qy(a,n,l,s){const c=(()=>{if(l.name)return l.name;if(l.modelRef){const p=zy.byIdOrThrow(a,l.modelRef);return ql(p.name)}})(),d=(()=>{if(!l.modelRef)return;const{model:{fields:p,primaryKeyFieldRefs:m},name:g}=zy.byIdOrThrow(a,l.modelRef),v=p.filter(x=>m.includes(x.id)),b=l.references??[];return v.map((x,j)=>{const D=j===0&&s?s:v.length===1?`${ql(g)}Id`:x.name;return{localRef:b[j]?.localRef??n.model.fields.find(R=>R.name===D)?.id,foreignRef:x.id}})})(),f=(()=>{if(!d)return;if(l.foreignRelationName)return l.foreignRelationName;const p=d.every(m=>m.localRef)&&s$.areScalarsUnique(n,d.map(m=>m.localRef));return ql(p?n.name:wx.pluralize(n.name))})();return{name:c??"",foreignRelationName:f??"",references:d??[]}}function b$({className:a,control:n,onSubmitSuccess:l,relationId:s,defaultFieldName:c}){const{definition:d}=u$(),f=lt(V=>V),p=f.name,{fields:m}=f.model,{field:{value:g=[],onChange:v}}=fa({name:"model.relations",control:n}),b=d.models.map(V=>({label:V.name,value:V.id})),x=s===void 0?void 0:g.find(V=>V.id===s),j=g$(()=>{if(x)return x;const V=v$(d,f,c);return{id:c$.generateNewId(),foreignId:o$.generateNewId(),modelRef:V??"",onDelete:"Restrict",onUpdate:"Restrict",...qy(d,f,{modelRef:V},c)}},[x,c,d,f]),D=tn(r$),{control:S,handleSubmit:R,setError:E,watch:A,setValue:B}=gi({resolver:It(D),defaultValues:j}),q=A(),G=q.modelRef?d.models.find(V=>V.id===q.modelRef):void 0,Q=G?.model.fields,T=m.map(V=>({label:V.name,value:V.id})),O=Q?.map(V=>({label:V.name,value:V.id}))??[],W=q.references.some(V=>m.find(Z=>Z.id===V.localRef)?.isOptional),ae=()=>{v(g.filter(V=>V.id!==s)),l?.()},ne=R(V=>{const{id:Z}=V;if(m.some(Y=>Y.name===V.name)||g.some(Y=>Y.name===V.name&&Y.id!==V.id)){E("name",{message:"The relation name cannot be the same as a field/relation name"});return}const U=V.references.map(Y=>Y.localRef);if(new Set(U).size!==U.length){_y.error("Local fields must be unique");return}const k=V.references.map(Y=>Y.foreignRef);if(new Set(k).size!==k.length){_y.error("Foreign fields must be unique");return}g.some(Y=>Y.id===Z)?v(g.map(Y=>Y.id===Z?V:Y)):v([...g,V]),l?.()}),se=p$(),Ee=!!G;return o.jsxs("form",{className:Te("space-y-4",a),onSubmit:V=>(V.stopPropagation(),ne(V)),id:se,children:[o.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2",children:[o.jsx(d$,{options:[{label:p,value:p}],value:p,disabled:!0,label:"Local Model"}),o.jsx(zh,{control:S,name:"modelRef",options:b,label:"Foreign Model",onChange:V=>{if(!V)return;const{foreignRelationName:Z,name:U,references:k}=qy(d,f,{...q,modelRef:V},c);Z&&B("foreignRelationName",Z),U&&B("name",U),B("references",k)}})]}),o.jsxs("div",{className:Te("grid grid-cols-2 gap-x-8 gap-y-2",!Ee&&"pointer-events-none opacity-50"),children:[o.jsx(By,{control:S,disabled:!Ee,name:"name",label:"Local Relation Name",description:o.jsxs("span",{children:["Name of the relation, e.g. ",ql(p),".",o.jsx("strong",{children:G?.name?ql(G.name):"user"})]})}),o.jsx(By,{control:S,disabled:!Ee,name:"foreignRelationName",label:"Foreign Relation Name",description:o.jsxs("span",{children:["Name of the relation on the foreign model, e.g."," ",ql(G?.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"}),q.references.map((V,Z)=>o.jsxs(c2.Fragment,{children:[o.jsx(zh,{disabled:!Ee,control:S,name:`references.${Z}.localRef`,options:T}),o.jsx(zh,{control:S,name:`references.${Z}.foreignRef`,options:O,disabled:!0})]},Z))]}),o.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 border-t pt-4",children:o.jsx(m$,{label:"On Delete",control:S,options:[{label:"Cascade (delete entire local row)",value:"Cascade"},{label:"Restrict (throw error)",value:"Restrict"},...W?[{label:"Set Null (set local field to null)",value:"SetNull"}]:[]],name:"onDelete",description:"What to do when the foreign row is deleted"})}),o.jsx(h$,{children:o.jsxs("div",{className:"flex w-full justify-between",children:[s&&o.jsx(Uh,{variant:"secondary",onClick:V=>{V.preventDefault(),ae()},children:"Delete"}),o.jsxs("div",{className:"flex gap-4",children:[o.jsx(f$,{asChild:!0,children:o.jsx(Uh,{variant:"secondary",children:"Cancel"})}),o.jsx(Uh,{type:"submit",form:se,disabled:!Ee,children:"Save"})]})]})})]})}const{Dialog:y$,DialogContent:x$,DialogDescription:j$,DialogHeader:S$,DialogTitle:w$,DialogTrigger:C$,useControlledState:E$}=await C("@baseplate-dev/ui-components");function Rc({control:a,children:n,asChild:l,open:s,onOpenChange:c,relationId:d,defaultFieldName:f}){const[p,m]=E$(s,c,!1);return o.jsxs(y$,{open:p,onOpenChange:m,children:[n&&o.jsx(C$,{asChild:l,children:n}),o.jsxs(x$,{width:"lg",children:[o.jsxs(S$,{children:[o.jsx(w$,{children:d?"Edit Relation":"Create Relation"}),o.jsx(j$,{children:"Set up the relation between this model and another model"})]}),o.jsx(b$,{control:a,onSubmitSuccess:()=>{m(!1)},relationId:d,defaultFieldName:f})]})]})}const{useProjectDefinition:D$}=await C("@baseplate-dev/project-builder-lib/web"),{BadgeWithIcon:T$}=await C("@baseplate-dev/ui-components"),{useState:R$}=await C("react");function N$({className:a,control:n,relation:l,autoCollapse:s}){const{definitionContainer:c}=D$(),[d,f]=R$(!1),p=!s||d;return o.jsx(Rc,{control:n,relationId:l.id,children:o.jsx(T$,{icon:Ow,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:M$}=await C("@baseplate-dev/project-builder-lib"),{Button:Bh,DialogClose:A$,DialogFooter:$$,MultiComboboxFieldController:L$}=await C("@baseplate-dev/ui-components"),{useId:O$}=await C("react"),{z:ic}=await C("zod"),U$=ic.object({id:ic.string().optional(),fields:ic.array(ic.string()).min(1,"At least one field is required")});function z$({className:a,control:n,onSubmitSuccess:l,constraintId:s}){const c=lt(j=>j.model.fields),{field:{value:d=[],onChange:f}}=fa({name:"model.uniqueConstraints",control:n}),p=s===void 0?void 0:d.find(j=>j.id===s),{control:m,handleSubmit:g}=gi({resolver:It(U$),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??M$.generateNewId(),fields:j.fields.map(R=>({fieldRef:R}))},{id:S}=D;d.some(R=>R.id===S)?f(d.map(R=>R.id===S?D:R)):f([...d,D]),l?.()}),x=O$();return o.jsxs("form",{className:Te("space-y-4",a),onSubmit:j=>(j.stopPropagation(),b(j)),id:x,children:[o.jsx(L$,{control:m,name:"fields",options:c.map(j=>({value:j.id,label:j.name})),placeholder:"Select fields to use as primary keys"}),o.jsx($$,{children:o.jsxs("div",{className:"flex w-full justify-between",children:[s&&o.jsx(Bh,{variant:"secondary",onClick:j=>{j.preventDefault(),v()},children:"Delete"}),o.jsxs("div",{className:"flex gap-4",children:[o.jsx(A$,{asChild:!0,children:o.jsx(Bh,{variant:"secondary",children:"Cancel"})}),o.jsx(Bh,{type:"submit",form:x,children:"Save"})]})]})})]})}const{Dialog:B$,DialogContent:_$,DialogDescription:q$,DialogHeader:F$,DialogTitle:H$,DialogTrigger:P$,useControlledState:k$}=await C("@baseplate-dev/ui-components");function Nc({control:a,children:n,asChild:l,open:s,onOpenChange:c,constraintId:d}){const[f,p]=k$(s,c,!1);return o.jsxs(B$,{open:f,onOpenChange:p,children:[n&&o.jsx(P$,{asChild:l,children:n}),o.jsxs(_$,{children:[o.jsxs(F$,{children:[o.jsx(H$,{children:"Unique Constraint"}),o.jsx(q$,{children:"Select the fields that will be part of this unique constraint."})]}),o.jsx(z$,{control:a,onSubmitSuccess:()=>{p(!1)},constraintId:d})]})]})}const{BadgeWithIcon:I$}=await C("@baseplate-dev/ui-components"),{useState:V$}=await C("react");function G$({className:a,control:n,constraintId:l,autoCollapse:s}){const[c,d]=V$(!1),f=!s||c,p=lt(m=>m.model.uniqueConstraints?.find(g=>g.id===l)?.fields.length??0);return o.jsx(Nc,{control:n,constraintId:l,children:o.jsx(I$,{variant:"secondary",icon:Uw,className:Te("",a),onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},"aria-label":"Unique Constraint",title:"Unique Constraint",children:f&&`Unique ${p>1?`(${p})`:""}`})})}function Y$({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(x=>x.fieldRef===s.id)).map(b=>b.id)??[]),f=lt(({model:v})=>{const b=v.fields[l];return v.relations?.filter(x=>x.references.some(j=>j.localRef===b.id))??[]}),m=(c?1:0)+d.length+f.length>2,g=[c&&o.jsx(l$,{control:n,autoCollapse:m},"primary"),...d.map(v=>o.jsx(G$,{control:n,constraintId:v,autoCollapse:m},v)),...f.map(v=>o.jsx(N$,{control:n,relation:v,autoCollapse:m},v.id))];return o.jsx("div",{className:Te("flex gap-4",a),children:g})}const{EnumUtils:X$}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:Q$}=await C("@baseplate-dev/project-builder-lib/web"),{Button:qi,ComboboxField:K$,DropdownMenu:Fy,DropdownMenuContent:Hy,DropdownMenuGroup:Py,DropdownMenuItem:_h,DropdownMenuTrigger:ky,InputField:Iy,InputFieldController:qh,SelectFieldController:Z$}=await C("@baseplate-dev/ui-components");function W$({control:a,idx:n,setValue:l}){const{definition:s}=Q$(),c=it({control:a,name:`model.fields.${n}.type`}),{field:{value:d,onChange:f}}=fa({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(Z$,{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(qi,{title:"Reset",onClick:()=>{l(`model.fields.${n}.options.default`,"",{shouldDirty:!0})},variant:"ghost",size:"icon",children:o.jsx(Wr,{})})]});if(["string","int","float"].includes(c))return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(qh,{control:a,placeholder:"NULL",name:`model.fields.${n}.options.default`,className:"flex-1"}),p&&o.jsx(qi,{title:"Reset",onClick:()=>{l(`model.fields.${n}.options.default`,void 0,{shouldDirty:!0})},variant:"ghost",size:"icon",children:o.jsx(Wr,{})})]});if(c==="uuid")return d?.genUuid?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Iy,{disabled:!0,value:"Random UUID v4",className:"flex-1"}),o.jsx(qi,{title:"Reset",onClick:()=>{f({...d,genUuid:!1})},variant:"ghost",size:"icon",children:o.jsx(Wr,{})})]}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(qh,{control:a,placeholder:"NULL",name:`model.fields.${n}.options.default`,className:"flex-1"}),o.jsxs(Fy,{children:[o.jsx(ky,{asChild:!0,children:o.jsx(qi,{title:"Options",variant:"ghost",size:"icon",children:o.jsx(Tc,{})})}),o.jsx(Hy,{children:o.jsx(Py,{children:o.jsx(_h,{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(Iy,{disabled:!0,value:g?"Last Updated":"Now",className:"flex-1"}),o.jsx(qi,{title:"Reset",onClick:()=>{f({...d,defaultToNow:!1,updatedAt:!1})},variant:"ghost",size:"icon",children:o.jsx(Wr,{})})]}):o.jsxs("div",{className:"flex items-center space-x-1",children:[o.jsx(qh,{placeholder:"NULL",control:a,name:`model.fields.${n}.options.default`,className:"flex-1"}),o.jsxs(Fy,{children:[o.jsx(ky,{asChild:!0,children:o.jsx(qi,{title:"Options",variant:"ghost",size:"icon",children:o.jsx(Tc,{})})}),o.jsx(Hy,{children:o.jsxs(Py,{children:[o.jsx(_h,{onSelect:()=>{f({...d,defaultToNow:!0,updatedAt:!1})},children:"Now"}),o.jsx(_h,{onSelect:()=>{f({...d,defaultToNow:!0,updatedAt:!0})},children:"Last Updated At"})]})})]})]})}if(c==="enum"&&d?.enumRef){const g=X$.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(K$,{placeholder:"NULL",value:d.defaultEnumValueRef??null,onChange:v=>{f({...d,defaultEnumValueRef:v||void 0})},options:g,className:"flex-1"}),d.defaultEnumValueRef&&o.jsx(qi,{title:"Reset",onClick:()=>{f({...d,defaultEnumValueRef:""})},variant:"ghost",size:"icon",children:o.jsx(Wr,{})})]})}return o.jsx("div",{})}const{SCALAR_FIELD_TYPES:J$}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:eL}=await C("@baseplate-dev/project-builder-lib/web"),{ComboboxField:tL}=await C("@baseplate-dev/ui-components");function nL({control:a,idx:n}){const{definition:l}=eL(),s=(l.enums??[]).map(b=>({label:b.name,value:`enum-${b.id}`,description:"Enum type"})),c=[...J$.filter(b=>b!=="enum").map(b=>ap[b]),...s],{field:{value:d,onChange:f}}=fa({name:`model.fields.${n}.type`,control:a}),{field:{value:p,onChange:m}}=fa({name:`model.fields.${n}.options`,control:a}),g=b=>{if(b?.startsWith("enum-")){const x=b.replace("enum-","");m({enumRef:x}),f("enum")}else f(b)},v=p?.enumRef;return o.jsx("div",{className:"space-y-2",children:o.jsx(tL,{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:aL}=await C("@baseplate-dev/project-builder-lib"),{Button:Vy,DropdownMenu:iL,DropdownMenuContent:lL,DropdownMenuGroup:rL,DropdownMenuItem:Ul,DropdownMenuTrigger:sL,InputFieldController:oL,SwitchFieldController:cL,toast:uL}=await C("@baseplate-dev/ui-components"),{useState:es}=await C("react");function dL({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(ae=>ae.fieldRef===d.id)),x=f?.filter(W=>W.references.some(ae=>ae.localRef===d.id))??[],j=(()=>{if(x.length>0)return`Unable to remove field as it is being used in relations ${x.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(ae=>ae.fieldRef===d.id)))return"Unable to remove field as it is being used in in a unique constraint"})();function D(){if(j){uL.error(j);return}c(l),m&&!g&&s("model.primaryKeyFieldRefs",[],{shouldDirty:!0})}const[S,R]=es(!1),[E,A]=es(!1),[B,q]=es(),[G,Q]=es(!1),[T,O]=es();return o.jsxs("div",{className:Te("items-start",a),children:[o.jsx("div",{children:o.jsx(oL,{control:n,name:`model.fields.${l}.name`})}),o.jsx("div",{children:o.jsx(nL,{control:n,idx:l})}),o.jsx("div",{children:o.jsx(cL,{control:n,name:`model.fields.${l}.isOptional`})}),o.jsx("div",{className:"mr-4",children:o.jsx(W$,{control:n,idx:l,setValue:s})}),o.jsx("div",{children:o.jsx(Y$,{control:n,idx:l})}),o.jsx("div",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(iL,{children:[o.jsx(sL,{asChild:!0,children:o.jsx(Vy,{variant:"ghost",size:"icon",children:o.jsx(Tc,{})})}),o.jsx(lL,{children:o.jsxs(rL,{children:[x.length===0&&o.jsx(Ul,{onSelect:()=>{Q(!0),O(void 0)},children:"Add Relation"}),x.length>0&&x.map(W=>o.jsxs(Ul,{onSelect:()=>{Q(!0),O(W.id)},children:["Edit Relation ",x.length>1&&W.name]},W.id)),!g&&!m&&o.jsx(Ul,{onSelect:()=>{s("model.primaryKeyFieldRefs",[d.id],{shouldDirty:!0})},children:"Set as Primary Key"}),m&&o.jsx(Ul,{onSelect:()=>{R(!0)},children:"Edit Primary Key"}),b.length===0&&(g||!m)&&o.jsx(Ul,{onSelect:()=>{s("model.uniqueConstraints",[...v,{id:aL.generateNewId(),fields:[{fieldRef:d.id}]}],{shouldDirty:!0})},children:"Make Unique"}),b.length>0&&b.map((W,ae)=>o.jsxs(Ul,{onSelect:()=>{q(W.id),A(!0)},children:["Edit Unique Constraint"," ",b.length>1&&ae+1]},W.id))]})})]}),o.jsx(o2,{control:n,open:S,onOpenChange:R}),o.jsx(Nc,{control:n,open:E,onOpenChange:A,constraintId:B}),o.jsx(Rc,{control:n,open:G,onOpenChange:Q,relationId:T,defaultFieldName:d.name}),o.jsx(Vy,{variant:"ghost",onClick:()=>{D()},size:"icon",children:o.jsx(Sx,{})})]})})]})}function fL({className:a,control:n,setValue:l}){const{fields:s,remove:c,append:d,move:f}=bs({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(dL,{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(Uj,{listItems:m,sortItems:f})]}),o.jsx(kA,{appendField:d,setValue:l})]})}const{useProjectDefinition:hL}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Fh,RecordView:mL,RecordViewActions:pL,RecordViewItem:lc,RecordViewItemList:gL,SectionListSection:vL,SectionListSectionContent:bL,SectionListSectionDescription:yL,SectionListSectionHeader:xL,SectionListSectionTitle:jL,useConfirmDialog:SL}=await C("@baseplate-dev/ui-components");function wL({control:a,setValue:n}){const{requestConfirm:l}=SL(),{definitionContainer:s}=hL(),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(vL,{children:[o.jsxs(xL,{children:[o.jsx(jL,{children:"Relations"}),o.jsx(yL,{children:"Define relations to enforce uniqueness on one or more fields."})]}),o.jsxs(bL,{className:"space-y-4",children:[c.map(p=>o.jsxs(mL,{children:[o.jsxs(gL,{children:[o.jsx(lc,{title:"Name",children:p.name}),o.jsx(lc,{title:"Local Field",children:p.references.map(m=>d[m.localRef]).join(", ")}),o.jsx(lc,{title:"Foreign Model",children:s.nameFromId(p.modelRef)}),o.jsx(lc,{title:"On Delete",children:p.onDelete})]}),o.jsxs(pL,{children:[o.jsx(Rc,{relationId:p.id,control:a,asChild:!0,children:o.jsx(Fh,{variant:"ghost",size:"icon",title:"Edit",children:o.jsx(Vl,{})})}),o.jsx(Fh,{variant:"ghostDestructive",size:"icon",title:"Delete",onClick:()=>{f(p.id)},children:o.jsx(ys,{})})]})]},p.id)),o.jsx(Rc,{control:a,asChild:!0,children:o.jsxs(Fh,{variant:"secondary",size:"sm",children:[o.jsx(Yi,{}),"Add Relation"]})})]})]})}const{Button:Hh,RecordView:CL,RecordViewActions:EL,RecordViewItem:DL,RecordViewItemList:TL,SectionListSection:RL,SectionListSectionContent:NL,SectionListSectionDescription:ML,SectionListSectionHeader:AL,SectionListSectionTitle:$L,useConfirmDialog:LL}=await C("@baseplate-dev/ui-components");function OL({control:a,setValue:n}){const{requestConfirm:l}=LL(),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(RL,{children:[o.jsxs(AL,{children:[o.jsx($L,{children:"Unique Constraints"}),o.jsx(ML,{children:"Define unique constraints to enforce uniqueness on one or more fields."})]}),o.jsxs(NL,{className:"space-y-4",children:[s.map(f=>o.jsxs(CL,{children:[o.jsx(TL,{children:o.jsx(DL,{title:"Fields",children:f.fields.map(p=>c[p.fieldRef]??"<invalid>").join(", ")})}),o.jsxs(EL,{children:[o.jsx(Nc,{constraintId:f.id,control:a,asChild:!0,children:o.jsx(Hh,{variant:"ghost",size:"icon",title:"Edit",children:o.jsx(Vl,{})})}),o.jsx(Hh,{variant:"ghostDestructive",size:"icon",title:"Delete",onClick:()=>{d(f.id)},children:o.jsx(ys,{})})]})]},f.id)),o.jsx(Nc,{control:a,asChild:!0,children:o.jsxs(Hh,{variant:"secondary",size:"sm",children:[o.jsx(Yi,{}),"Add Unique Constraint"]})})]})]})}const{createModelBaseSchema:UL,modelEntityType:zL,modelLocalRelationEntityType:BL,modelScalarFieldEntityType:_L}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:qL}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:FL,SectionList:HL}=await C("@baseplate-dev/ui-components");js(zL,"/data/models/edit/{key}");js(_L,"/data/models/edit/{parentKey}");js(BL,"/data/models/edit/{parentKey}");function PL(){const a=tn(UL),{form:n,onSubmit:l,defaultValues:s}=Ns({schema:a.omit({name:!0,featureRef:!0})}),{control:c,watch:d,getValues:f,setValue:p,reset:m}=n;return qL({control:c,reset:m,onSubmit:l}),o.jsx(Yl,{children:o.jsx(tp,{initialModel:s,getValues:f,watch:d,children:o.jsxs("form",{onSubmit:l,className:"max-w-7xl min-w-[700px] flex-1 space-y-4 px-4 pb-4",children:[o.jsx(fL,{control:c,setValue:p}),o.jsxs(HL,{children:[o.jsx(wL,{control:c,setValue:p}),o.jsx(OL,{control:c,setValue:p})]}),o.jsx(FL,{form:n})]})})})}const{ModelTransformerUtils:kL}=await C("@baseplate-dev/project-builder-lib"),{modelTransformerWebSpec:IL,useProjectDefinition:VL}=await C("@baseplate-dev/project-builder-lib/web"),{Label:Gy,SectionListSection:GL,SectionListSectionContent:YL,SectionListSectionDescription:XL,SectionListSectionHeader:QL,SectionListSectionTitle:KL,SwitchField:rc}=await C("@baseplate-dev/ui-components");function ZL({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}=VL();if(!f&&!p)return null;const b=c?.fields??[],x=d?.fields??[],j=c?.transformerNames??[],D=d?.transformerNames??[],S="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(IL);return o.jsxs(GL,{className:a,children:[o.jsxs(QL,{children:[o.jsx(KL,{children:"Create / Update Fields"}),o.jsx(XL,{children:"Configure the fields that can be created or updated by the service method"})]}),o.jsx(YL,{className:"max-w-xl space-y-4",children:o.jsxs("table",{className:S,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"w-full",children:o.jsx(Gy,{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(ss,{type:E.type==="enum"&&E.options?.enumRef?g.nameFromId(E.options.enumRef):ap[E.type].label,children:E.name})}),f&&o.jsx("td",{className:"pl-8",children:o.jsx(rc,{value:b.includes(E.id),onChange:A=>{l("service.create.fields",A?[...b,E.id]:b.filter(B=>B!==E.id),{shouldDirty:!0})}})}),p&&o.jsx("td",{className:"pl-8",children:o.jsx(rc,{value:x.includes(E.id),onChange:A=>{l("service.update.fields",A?[...x,E.id]:x.filter(B=>B!==E.id),{shouldDirty:!0})}})})]},E.id)),m.length>0&&o.jsx("tr",{children:o.jsx("th",{children:o.jsx(Gy,{children:"Transformers"})})}),m.map(E=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(ss,{type:R.getTransformerWebConfig(E.type,np).label,children:kL.getTransformName(g,E,v)})}),f&&o.jsx("td",{className:"pl-8",children:o.jsx(rc,{value:j.includes(E.id),onChange:A=>{l("service.create.transformerNames",A?[...j,E.id]:j.filter(B=>B!==E.id),{shouldDirty:!0})}})}),p&&o.jsx("td",{className:"pl-8",children:o.jsx(rc,{value:D.includes(E.id),onChange:A=>{l("service.update.transformerNames",A?[...D,E.id]:D.filter(B=>B!==E.id),{shouldDirty:!0})}})})]},E.id))]})]})})]})}const{createTransformerSchema:WL,modelTransformerEntityType:JL}=await C("@baseplate-dev/project-builder-lib"),{usePluginEnhancedSchema:eO}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Yy,DialogClose:tO,DialogFooter:nO}=await C("@baseplate-dev/ui-components"),{useId:aO}=await C("react"),{z:iO}=await C("zod");function lO({className:a,webConfig:{Form:n,pluginId:l},transformer:s,onUpdate:c,isCreate:d}){const f=lt(D=>D),p=tn(WL),m=eO(iO.object({transformer:p})),g=gi({resolver:It(m),defaultValues:{transformer:s}}),{handleSubmit:v,formState:{isDirty:b}}=g,x=v(D=>{c({...D.transformer,id:D.transformer.id?D.transformer.id:JL.generateNewId()})}),j=aO();return n?o.jsxs("form",{className:Te("space-y-4",a),id:j,onSubmit:D=>(D.stopPropagation(),x(D)),children:[o.jsx(n,{formProps:g,name:"transformer",originalModel:f,pluginId:l}),o.jsxs(nO,{children:[o.jsx(tO,{asChild:!0,children:o.jsx(Yy,{variant:"secondary",children:"Cancel"})}),o.jsx(Yy,{type:"submit",disabled:!d&&!b,form:j,children:"Save"})]})]}):null}const{Dialog:rO,DialogContent:sO,DialogDescription:oO,DialogHeader:cO,DialogTitle:uO,DialogTrigger:dO,useControlledState:fO}=await C("@baseplate-dev/ui-components");function u2({children:a,transformer:n,asChild:l,webConfig:s,open:c,onOpenChange:d,onUpdate:f,isCreate:p}){const[m,g]=fO(c,d,!1);return o.jsxs(rO,{open:m,onOpenChange:g,children:[a&&o.jsx(dO,{asChild:l,children:a}),o.jsxs(sO,{children:[o.jsxs(cO,{children:[o.jsxs(uO,{children:[p?"Create":"Edit"," ",s?.label," Transformer"]}),o.jsx(oO,{children:s?.instructions??"Manage the transformer for the service"})]}),s&&o.jsx(lO,{transformer:n,onUpdate:v=>{g(!1),f(v)},webConfig:s,isCreate:p})]})]})}const{modelTransformerWebSpec:d2,useProjectDefinition:f2}=await C("@baseplate-dev/project-builder-lib/web"),{Button:jm,DropdownMenu:hO,DropdownMenuContent:mO,DropdownMenuGroup:pO,DropdownMenuItem:gO,DropdownMenuTrigger:vO,RecordView:bO,RecordViewActions:yO,RecordViewItem:Xy,RecordViewItemList:xO,SectionListSection:jO,SectionListSectionContent:SO,SectionListSectionDescription:wO,SectionListSectionHeader:CO,SectionListSectionTitle:EO,useConfirmDialog:DO}=await C("@baseplate-dev/ui-components"),{useState:Qy}=await C("react");function TO({formProps:a,idx:n,onRemove:l,onUpdate:s}){const{pluginContainer:c,definitionContainer:d}=f2(),{control:f}=a,p=it({control:f,name:`service.transformers.${n}`}),g=c.getPluginSpec(d2).getTransformerWebConfig(p.type,np),v=g.getSummary(p,d);return o.jsxs(bO,{children:[o.jsxs(xO,{children:[o.jsx(Xy,{title:"Type",children:g.label}),v.map(b=>o.jsx(Xy,{title:b.label,children:b.description},b.label))]}),o.jsxs(yO,{children:[g.Form&&o.jsx(u2,{webConfig:g,transformer:p,onUpdate:b=>{s(b,n)},asChild:!0,isCreate:!1,children:o.jsx(jm,{variant:"ghost",size:"icon",title:"Edit",children:o.jsx(Vl,{})})}),o.jsx(jm,{variant:"ghost",size:"icon",onClick:()=>{l(n)},title:"Remove",className:"text-destructive hover:text-destructive-hover",children:o.jsx(Sx,{})})]})]})}function RO({className:a,formProps:n}){const{control:l}=n,{fields:s,remove:c,append:d,update:f}=bs({control:l,name:"service.transformers"}),{pluginContainer:p,definitionContainer:m}=f2(),{requestConfirm:g}=DO(),v=p.getPluginSpec(d2),b=lt(E=>E),x=v.getTransformerWebConfigs(np).filter(E=>E.allowNewTransformer?E.allowNewTransformer(m,b):!0),[j,D]=Qy(!1),[S,R]=Qy(0);return o.jsxs(jO,{className:a,children:[o.jsxs(CO,{children:[o.jsx(EO,{children:"Transformers"}),o.jsx(wO,{children:"Transformers are used to operate on the data from the client into the shape that the database ORM expects."})]}),o.jsxs(SO,{className:"max-w-xl space-y-4",children:[s.map((E,A)=>o.jsx(TO,{formProps:n,idx:A,onUpdate:(B,q)=>{f(q,B)},onRemove:B=>{g({title:"Confirm delete",content:"Are you sure you want to delete this transformer?",buttonConfirmText:"Delete",buttonConfirmVariant:"destructive",onConfirm:()=>{c(B)}})}},E.id)),x.length>0&&o.jsxs(hO,{children:[o.jsx(vO,{asChild:!0,children:o.jsxs(jm,{variant:"secondary",size:"sm",children:[o.jsx(Yi,{}),"Add Transformer"]})}),o.jsx(mO,{children:o.jsx(pO,{children:x.map((E,A)=>o.jsx(gO,{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(u2,{webConfig:x[S],transformer:x[S]?.getNewTransformer(m,b),onUpdate:E=>{d(E)},open:j,onOpenChange:D,isCreate:!0})]})]})}const{createModelBaseSchema:NO,modelTransformerEntityType:MO}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:AO}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:$O,SectionList:LO,SectionListSection:OO,SectionListSectionContent:UO,SectionListSectionDescription:zO,SectionListSectionHeader:BO,SectionListSectionTitle:_O,SwitchFieldController:Ph}=await C("@baseplate-dev/ui-components");js(MO,"/data/models/edit/{parentKey}");function qO(){const a=tn(NO),{form:n,onSubmit:l,defaultValues:s}=Ns({schema:a.omit({name:!0,featureRef:!0})}),{control:c,watch:d,getValues:f,setValue:p,reset:m}=n;return AO({control:c,reset:m,onSubmit:l}),o.jsx(tp,{initialModel:s,getValues:f,watch:d,children:o.jsxs("form",{onSubmit:l,className:"w-full max-w-7xl space-y-4 p-4",children:[o.jsxs(LO,{children:[o.jsxs(OO,{children:[o.jsxs(BO,{children:[o.jsx(_O,{children:"Methods"}),o.jsx(zO,{children:"Enable or disable which service methods will be generated"})]}),o.jsxs(UO,{className:"flex gap-8",children:[o.jsx(Ph,{label:"Create",name:"service.create.enabled",control:c}),o.jsx(Ph,{label:"Update",name:"service.update.enabled",control:c}),o.jsx(Ph,{label:"Delete",name:"service.delete.enabled",control:c})]})]}),o.jsx(ZL,{control:c,setValue:p}),o.jsx(RO,{formProps:n})]}),o.jsx($O,{form:n})]})})}const{modelEntityType:FO}=await C("@baseplate-dev/project-builder-lib"),HO={path:"edit",children:[{index:!0,element:o.jsx(Lm,{to:"../",replace:!0})},{path:":key",element:o.jsx(LM,{}),handle:{crumb:Oc(FO,"Edit Model","/data/models/edit/:key")},children:[{index:!0,element:o.jsx(PL,{})},{path:"service",element:o.jsx(qO,{}),handle:{crumb:"Service"}},{path:"graphql",element:o.jsx(zA,{}),handle:{crumb:"GraphQL"}},Rs]}]},{useProjectDefinition:PO}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Ky,EmptyDisplay:kO}=await C("@baseplate-dev/ui-components");function IO(){const{definition:a}=PO();return a.models.length===0?o.jsx(kO,{icon:Ym,header:"No Models",subtitle:"Create a model to get started",actions:o.jsx(xm,{children:o.jsx(Ky,{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(Ky,{variant:"link",size:"none",children:"create a new model"})}),"."]})]})}const VO={path:"models/*",handle:{crumb:{label:"Models",url:"/data/models"}},children:[{index:!0,element:o.jsx(IO,{})},HO,Rs]},GO={element:o.jsx(DN,{}),path:"/data",children:[{index:!0,element:o.jsx(Lm,{to:"./models"})},VO,mM]},{Button:kh,Card:Ih,CardDescription:Vh,CardFooter:Gh,CardHeader:Yh,CardTitle:Xh}=await C("@baseplate-dev/ui-components");function YO(){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(Yh,{children:[o.jsx(Xh,{children:"Models"}),o.jsx(Vh,{children:"Models are the core of your app. They define the data that your app will store and manipulate."})]}),o.jsx(Gh,{children:o.jsx(kt,{to:"/models",children:o.jsx(kh,{children:"Configure Models"})})})]}),o.jsxs(Ih,{children:[o.jsxs(Yh,{children:[o.jsx(Xh,{children:"Plugins"}),o.jsx(Vh,{children:"Baseplate comes with a number of plugins that you can enable or disable, such as email and authentication."})]}),o.jsx(Gh,{children:o.jsx(kt,{to:"/plugins",children:o.jsx(kh,{children:"Configure Plugins"})})})]}),o.jsxs(Ih,{children:[o.jsxs(Yh,{children:[o.jsx(Xh,{children:"Apps & Repositories"}),o.jsx(Vh,{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(Gh,{children:o.jsx(kt,{className:"inline-block",to:"/apps",children:o.jsx(kh,{children:"Configure Apps"})})})]})]})]})})}function XO(a,n,l){return`/api/plugins/${a}/${n}/static/${l}`}const{createPluginImplementationStore:QO}=await C("@baseplate-dev/project-builder-lib");function h2(a,n,l){const s={...l,plugins:[...l.plugins??[],{id:n.id,version:n.version,name:n.name,packageName:n.packageName}]};return QO(a,s)}const{pluginEntityType:Zy,webConfigSpec:Wy}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:KO}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Qh,Card:ZO,CardContent:WO,CardDescription:JO,CardHeader:eU,CardTitle:tU}=await C("@baseplate-dev/ui-components");function Jy({className:a,plugin:n,isActive:l}){const{currentProjectId:s}=En(),{saveDefinitionWithFeedbackSync:c,schemaParserContext:d,definitionContainer:f,pluginContainer:p,isSavingDefinition:m}=KO(),g=un();function v(){if(h2(d.pluginStore,n,f.definition).getPluginSpec(Wy).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:Zy.idFromKey(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(S=>S.id!==Zy.idFromKey(n.id))},{successMessage:`Disabled ${n.displayName}!`})}const j=p.getPluginSpec(Wy).getWebConfigComponent(n.id);return o.jsxs(ZO,{className:a,children:[o.jsx(eU,{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:XO(s,n.id,n.icon),className:"size-12 rounded-xl bg-muted",alt:`${n.displayName} logo`}):o.jsx(zw,{className:"size-12 bg-muted p-2"})}),o.jsxs("div",{children:[o.jsx(tU,{children:n.displayName}),o.jsx(JO,{children:n.packageName})]})]}),o.jsx("div",{children:l?j?o.jsx(kt,{to:`/plugins/edit/${n.id}`,children:o.jsx(Qh,{variant:"secondary",children:"Configure"})}):o.jsx(Qh,{variant:"secondary",onClick:b,disabled:m,children:"Disable"}):o.jsx(Qh,{variant:"secondary",onClick:v,disabled:m,children:"Enable"})})]})}),o.jsx(WO,{children:o.jsx("div",{className:"text-sm",children:o.jsx("p",{children:n.description})})})]})}const{useProjectDefinition:nU}=await C("@baseplate-dev/project-builder-lib/web"),{EmptyDisplay:aU,ErrorableLoader:iU}=await C("@baseplate-dev/ui-components"),{useEffect:lU,useState:ex}=await C("react");function rU(){const{currentProjectId:a}=En(),[n,l]=ex(null),{definition:s}=nU(),[c,d]=ex(null);if(lU(()=>{if(l(null),!!a){if(Fn){l([]);return}Lt.plugins.getAvailablePlugins.mutate({projectId:a}).then(l).catch(d)}},[a]),!n)return o.jsx(iU,{error:c});if(n.length===0)return o.jsx(aU,{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(Jy,{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(Jy,{plugin:g,isActive:!1},g.id))]})]})}const{pluginEntityType:sU,PluginUtils:oU,webConfigSpec:tx}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:cU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:uU,DropdownMenu:dU,DropdownMenuContent:fU,DropdownMenuGroup:hU,DropdownMenuItem:mU,DropdownMenuTrigger:pU,useConfirmDialog:gU}=await C("@baseplate-dev/ui-components"),{useMemo:vU}=await C("react");function bU(){const{definitionContainer:a,pluginContainer:n,schemaParserContext:l,saveDefinitionWithFeedbackSync:s,isSavingDefinition:c}=cU(),{id:d}=Ki(),{requestConfirm:f}=gU(),p=un(),m=oU.byId(a.definition,d??""),g=vU(()=>{if(!d)return;const S=n.getPluginSpec(tx).getWebConfigComponent(d);if(S)return S;const R=l.pluginStore.availablePlugins.find(A=>A.metadata.id===d);return R?h2(l.pluginStore,R.metadata,a.definition).getPluginSpec(tx).getWebConfigComponent(d):void 0},[d,l,a,n]),v=l.pluginStore.availablePlugins.find(D=>D.metadata.id===d);if(!g||!v)return o.jsx(Ts,{});const{metadata:b}=v;function x(){s(D=>{D.plugins=(D.plugins??[]).filter(S=>S.id!==sU.idFromKey(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(dU,{children:[o.jsx(pU,{asChild:!0,children:o.jsx(uU,{variant:"ghost",size:"icon",children:o.jsx(Tc,{"aria-label":"More Actions"})})}),o.jsx(fU,{children:o.jsx(hU,{children:o.jsx(mU,{disabled:c,onSelect:()=>{f({title:"Disable Plugin",content:`Are you sure you want to disable the ${b.displayName} plugin?`,onConfirm:x})},children:"Disable Plugin"})})})]})]}),o.jsx(g,{definition:m,metadata:b,onSave:j})]})})}const{pluginEntityType:yU}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:xU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:jU,NavigationMenu:SU,NavigationMenuItem:wU,NavigationMenuLink:CU,NavigationMenuList:EU,SidebarLayout:DU,SidebarLayoutContent:TU,SidebarLayoutSidebar:RU}=await C("@baseplate-dev/ui-components");function NU(){const{definition:a,schemaParserContext:n}=xU(),{availablePlugins:l}=n.pluginStore,s=(a.plugins??[]).map(c=>l.find(f=>f.metadata.id===yU.keyFromId(c.id))?.metadata).filter(bx);return o.jsxs(DU,{className:"flex-1",children:[o.jsxs(RU,{className:"flex flex-col gap-4",width:"sm",children:[o.jsx(kt,{to:"/plugins",children:o.jsxs(jU,{variant:"secondary",className:"w-full",size:"sm",children:[o.jsx(Yi,{}),"Add new plugin"]})}),o.jsx(SU,{orientation:"vertical",children:o.jsxs(EU,{children:[s.map(c=>o.jsx(CU,{asChild:!0,children:o.jsx(Ht,{to:`/plugins/edit/${c.id}`,children:c.displayName})},c.id)),s.length===0&&o.jsx(wU,{className:"mt-4 w-full text-center opacity-80",children:"No plugins enabled"})]})})]}),o.jsx(TU,{className:"h-[calc(100vh-var(--topbar-height)-1px)]",children:o.jsx(Yl,{children:o.jsx(vi,{})})})]})}const{pluginEntityType:MU}=await C("@baseplate-dev/project-builder-lib"),AU=[{element:o.jsx(NU,{}),children:[{index:!0,element:o.jsx(rU,{})},{path:"edit/:id",element:o.jsx(bU,{}),handle:{crumb:Oc(MU,"Edit Plugin")}},{path:"*",element:o.jsx(Ts,{})}]}],{NavigationMenu:$U,NavigationMenuLink:sc,NavigationMenuList:LU,SidebarLayout:OU,SidebarLayoutContent:UU,SidebarLayoutSidebar:zU}=await C("@baseplate-dev/ui-components");function BU(){return o.jsxs(OU,{className:"h-full flex-1",children:[o.jsx(zU,{className:"space-y-4",width:"sm",children:o.jsx($U,{orientation:"vertical",children:o.jsxs(LU,{children:[o.jsx(sc,{asChild:!0,children:o.jsx(Ht,{to:"/settings/project-settings",children:"Project settings"})}),o.jsx(sc,{asChild:!0,children:o.jsx(Ht,{to:"/settings/hierarchy",children:"Hierarchy"})}),o.jsx(sc,{asChild:!0,children:o.jsx(Ht,{to:"/settings/theme-builder",children:"Theme builder"})}),rj&&o.jsx(sc,{asChild:!0,children:o.jsx(Ht,{to:"/settings/template-extractor",children:"Template extractor"})})]})})}),o.jsx(UU,{className:"h-full",children:o.jsx(vi,{})})]})}function _U(a){return Gi({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:qU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:nx,ComboboxFieldController:FU,Dialog:HU,DialogContent:PU,DialogFooter:kU,DialogHeader:IU,DialogTitle:VU,InputFieldController:GU}=await C("@baseplate-dev/ui-components"),{useEffect:YU,useMemo:XU}=await C("react"),{z:oc}=await C("zod"),QU=oc.object({id:oc.string(),childName:oc.string().min(1).regex(/^[a-z0-9-]+$/,"Must be lowercase, numbers, and dashes only"),parentRef:oc.string().nullish()});function KU({feature:a,open:n,onClose:l}){const{definitionContainer:{definition:s},saveDefinitionWithFeedback:c}=qU(),d=XU(()=>({id:a?.id??"",childName:a?.name.split("/").pop()??"",parentRef:a?.parentRef??null}),[a]),{control:f,handleSubmit:p,reset:m,formState:{isSubmitting:g}}=gi({resolver:It(QU),values:d});YU(()=>{n&&m(d)},[n,d,m]);const v=p(x=>c(j=>{const D=j.features.find(A=>A.id===x.parentRef)?.name,S=x.parentRef?`${D}/${x.childName}`:x.childName;if(j.features.some(A=>A.id!==x.id&&A.name===S))throw new da("Feature with this name already exists");const R=[...j.features.filter(A=>A.id!==x.id),{id:x.id,name:S,parentRef:x.parentRef}];function E(A){const B=R.filter(q=>A?new RegExp(`^${A.name}/[^/]+$`).exec(q.name):!q.name.includes("/"));for(const q of B){const G=q.name.split("/").pop();if(!G)throw new Error("Invalid feature name");q.name=A?`${A.name}/${G}`:G,E(q)}}E(),j.features=Zn(R,[A=>A.name])},{onSuccess:()=>{l?.()}})),b=[{label:"None",value:null},...s.features.filter(x=>x.id!==a?.id).map(x=>({label:x.name,value:x.id}))];return o.jsx(HU,{open:n,onOpenChange:x=>{x||l?.()},children:o.jsx(PU,{children:o.jsxs("form",{className:"space-y-4",onSubmit:v,children:[o.jsx(IU,{children:o.jsxs(VU,{children:[a?.name?"Edit":"Add"," Feature"]})}),o.jsx(GU,{control:f,name:"childName",label:"Name",autoComplete:"off","data-1p-ignore":!0}),o.jsx(FU,{control:f,name:"parentRef",label:"Parent Feature",options:b}),o.jsxs(kU,{children:[o.jsx(nx,{onClick:l,variant:"secondary",children:"Cancel"}),o.jsx(nx,{type:"submit",disabled:g,children:"Save"})]})]})})})}const{featureEntityType:m2}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:ZU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Sm,buttonVariants:WU,cn:JU,useConfirmDialog:ez}=await C("@baseplate-dev/ui-components"),{useState:ax}=await C("react");function tz(){const{definitionContainer:a,saveDefinitionWithFeedbackSync:n}=ZU(),{requestConfirm:l}=ez(),{showRefIssues:s}=uj(),[c,d]=ax(),[f,p]=ax(!1),{features:m}=a.definition,g=v=>{function b(j){const D=j.features.findIndex(S=>S.id===v.id);if(D===-1)throw new Error("Feature not found");j.features.splice(D,1)}const x=a.fixRefDeletions(b);if(x.type==="failure"){s({issues:x.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(nz,{feature:v,setFeatureToEdit:d,setShowFeatureForm:p,handleRemoveFeature:g},v.id))}),o.jsx(Sm,{onClick:()=>{d({id:m2.generateNewId(),name:"",parentRef:null}),p(!0)},variant:"secondary",size:"sm",children:"Add Feature"}),o.jsx(KU,{feature:c,open:f,onClose:()=>{p(!1)}})]})]})})}function nz({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(_U,{className:"size-8 shrink-0 p-2"})]}),o.jsxs("div",{className:JU(WU({variant:"secondary",size:"sm"}),"group w-full"),style:{justifyContent:"flex-start"},children:[c,o.jsx("div",{className:"flex-1"}),o.jsx(Vl,{className:"opacity-0 transition-opacity group-hover:opacity-100"})]})]})}),o.jsx(Sm,{className:"shrink-0",variant:"ghost",onClick:()=>{n({id:m2.generateNewId(),name:"",parentRef:a.id}),l(!0)},size:"icon",title:`Add Sub-Feature to ${a.name}`,children:o.jsx(Yi,{})}),o.jsx(Sm,{className:"shrink-0",variant:"ghost",onClick:()=>{s(a)},size:"icon",title:`Delete ${a.name}`,children:o.jsx(Bw,{})})]})}const{generalSettingsSchema:az}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:iz,useProjectDefinition:lz,useResettableForm:rz}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:sz,InputFieldController:Kh,SectionList:oz,SectionListSection:cz,SectionListSectionContent:uz,SectionListSectionHeader:dz,SectionListSectionTitle:fz}=await C("@baseplate-dev/ui-components");function hz(){const{definition:a,saveDefinitionWithFeedback:n}=lz(),l=rz({resolver:It(az),defaultValues:a.settings.general}),{handleSubmit:s,control:c,reset:d}=l,f=s(p=>n(m=>{m.settings.general=p}));return iz({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(oz,{children:o.jsxs(cz,{children:[o.jsx(dz,{children:o.jsx(fz,{children:"Settings"})}),o.jsxs(uz,{className:"flex max-w-80 flex-col gap-4",children:[o.jsx(Kh,{name:"name",label:"Project Name",description:"Lowercase letters and dashes, e.g. my-project",control:c,placeholder:"e.g. my-project"}),o.jsx(Kh,{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(Kh,{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(sz,{form:l})]})}const{createTemplateExtractorSchema:mz}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:pz,useProjectDefinition:gz,useResettableForm:vz}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:bz,AlertDescription:yz,AlertTitle:xz,CheckboxFieldController:jz,FormActionBar:Sz,SectionList:wz,SectionListSection:Cz,SectionListSectionContent:Ez,SectionListSectionHeader:Dz,SectionListSectionTitle:Tz,TextareaFieldController:Rz}=await C("@baseplate-dev/ui-components");function Nz(){const{definition:a,saveDefinitionWithFeedback:n}=gz(),l=a.settings.templateExtractor,s=tn(mz),c=vz({resolver:It(s),defaultValues:l}),{handleSubmit:d,control:f,reset:p}=c,m=d(g=>n(v=>{v.settings.templateExtractor=g}));return pz({control:f,reset:p,onSubmit:m}),rj?o.jsxs("form",{className:"relative h-full max-h-full pb-(--action-bar-height)",onSubmit:m,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(wz,{children:o.jsxs(Cz,{children:[o.jsx(Dz,{children:o.jsx(Tz,{children:"Settings"})}),o.jsxs(Ez,{className:"flex max-w-md flex-col gap-4",children:[o.jsx(jz,{name:"writeMetadata",label:"Write Metadata",description:"Write metadata to the project to enable template extraction",control:f}),o.jsx(Rz,{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:f})]})]})})]}),o.jsx(Sz,{form:c})]}):o.jsxs(bz,{variant:"error",className:"mx-auto my-16 max-w-2xl",children:[o.jsx(xz,{children:"Template Extractor is disabled"}),o.jsxs(yz,{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:ix}=await C("@baseplate-dev/project-builder-lib"),{TextareaField:Mz}=await C("@baseplate-dev/ui-components"),{useMemo:Az}=await C("react");function lx(a){return Object.entries(a).map(([n,l])=>` ${n}: ${l};`).join(`
|
|
69
|
-
`)}function $z({className:a,control:n}){const l=it({control:n,name:"colors"}),s=Az(()=>`
|
|
70
|
-
:root {
|
|
71
|
-
${lx(ix(l.light))}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.dark, html[data-theme='dark'] {
|
|
75
|
-
${lx(ix(l.dark))}
|
|
76
|
-
}
|
|
77
|
-
`.trim(),[l]);return o.jsx("div",{className:Te("",a),children:o.jsx(Mz,{className:"h-60",readOnly:!0,value:s})})}const{convertHexToOklch:Lz,convertOklchToColorName:Oz,convertOklchToHex:Uz,getDefaultThemeColorFromShade:zz,THEME_COLORS:Bz}=await C("@baseplate-dev/project-builder-lib"),{Button:rx,ColorPickerFieldController:_z,Tooltip:qz,TooltipContent:Fz,TooltipTrigger:Hz}=await C("@baseplate-dev/ui-components");function sx({className:a,control:n,mode:l,setValue:s}){const c=Object.entries(Bz),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,x=(g>0?c[g-1][1].groupKey:void 0)!==m.groupKey,j=f[v],D=zz(d,l,v);return o.jsxs("div",{className:Te(x?"col-start-1":void 0,"relative"),children:[o.jsx(_z,{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(qz,{delayDuration:500,children:[o.jsx(Hz,{asChild:!0,children:o.jsx(rx,{variant:"ghost",size:"icon","aria-label":"Color Info",className:"opacity-30",children:o.jsx(Dm,{})})}),o.jsx(Fz,{align:"start",side:"bottom",className:"max-w-[400px]",children:o.jsx("div",{className:"font-normal",children:m.description})})]})]}),parseColor:Uz,serializeColor:Lz,formatColorName:S=>{const R=Object.entries(d.base.shades).find(([,A])=>A===S)?.[0];if(R)return`base-${R}`;const E=Object.entries(d.primary.shades).find(([,A])=>A===S)?.[0];return E?`primary-${E}`:Oz(S)},name:`colors.${l}.${v}`}),j!==D&&o.jsx(rx,{className:"absolute right-2 bottom-1",onClick:()=>{s(`colors.${l}.${v}`,D)},size:"icon",variant:"ghost","aria-label":"Reset Color",children:o.jsx(_w,{})})]},p)})})})}const{generateCssFromThemeConfig:Pz}=await C("@baseplate-dev/project-builder-lib"),{Badge:cc,Button:zl,Card:kz,CardContent:Iz,CardDescription:Vz,CardHeader:Gz,CardTitle:Yz,Combobox:Xz,ComboboxContent:Qz,ComboboxEmpty:Kz,ComboboxInput:Zz,ComboboxItem:Zh}=await C("@baseplate-dev/ui-components");function Wz({className:a,control:n,mode:l}){const s=it({control:n,name:`colors.${l}`}),c=Pz(s);return o.jsx("div",{className:Te("size-full rounded-xl border border-border bg-background p-4",a),style:c,children:o.jsxs(kz,{children:[o.jsxs(Gz,{children:[o.jsx(Yz,{children:"Color Preview"}),o.jsx(Vz,{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(uc,{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(uc,{children:"Combobox"}),o.jsxs(Xz,{children:[o.jsx(Zz,{placeholder:"Select an option"}),o.jsxs(Qz,{style:c,children:[o.jsx(Zh,{value:"opt1",label:"Option 1",children:"Option 1"}),o.jsx(Zh,{value:"green",label:"Option 2",children:"Option 2"}),o.jsx(Zh,{value:"blue",label:"Option 3",children:"Option 3"}),o.jsx(Kz,{children:"No results found"})]})]})]}),o.jsxs("div",{children:[o.jsx(uc,{children:"Badges"}),o.jsxs("div",{className:"flex flex-wrap gap-1",children:[o.jsx(cc,{variant:"default",children:"Default"}),o.jsx(cc,{variant:"destructive",children:"Destructive"}),o.jsx(cc,{variant:"secondary",children:"Secondary"}),o.jsx(cc,{variant:"outline",children:"Outline"})]})]}),o.jsxs("div",{children:[o.jsx(uc,{children:"Buttons"}),o.jsxs("div",{className:"flex flex-wrap gap-2 rounded-lg border border-border p-1",children:[o.jsx(zl,{type:"button",children:"Primary"}),o.jsx(zl,{variant:"destructive",type:"button",children:"Destructive"}),o.jsx(zl,{variant:"ghost",type:"button",children:"Ghost"}),o.jsx(zl,{variant:"link",type:"button",children:"Link"}),o.jsx(zl,{variant:"secondary",type:"button",children:"Secondary"}),o.jsx(zl,{variant:"outline",type:"button",children:"Outline"})]})]})]})]})})}function uc({children:a}){return o.jsx("h4",{className:"text-lg font-semibold",children:a})}function Jz(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:eB}=await C("@baseplate-dev/project-builder-lib");function Wh(a,n){return`${a}-${n}`}function tB(a){const l=Pw("rgb")(a);if(!l)throw new Error(`Invalid color: ${a}`);const s=Jz(l);return Object.fromEntries(eB.map(c=>{const d={mode:"rgb",r:s[Wh(c,"r")],g:s[Wh(c,"g")],b:s[Wh(c,"b")]};return[c,kw(d)]}))}const{COLOR_PALETTES:Jh,convertHexToOklch:ox,convertOklchToHex:cx,PALETTE_SHADES:nB}=await C("@baseplate-dev/project-builder-lib"),{Button:aB,ColorPickerFieldController:ux,ComboboxFieldController:iB}=await C("@baseplate-dev/ui-components"),{useCallback:lB}=await C("react");function dx({control:a,getValues:n,setValue:l,onShadesChange:s,type:c}){const d=[{value:"custom",label:"Custom Base"},...Object.keys(Jh).map(g=>({value:g,label:wx.capitalize(g)}))],f=it({control:a,name:`palettes.${c}.paletteName`}),p=lB(g=>{if(!g||!Object.prototype.hasOwnProperty.call(Jh,g))return;const v=Jh[g];l(`palettes.${c}.shades`,v),s?.(v)},[l,s,c]),m=()=>{const g=n(`palettes.${c}.customBase`);if(!g)return;const v=tB(g);l(`palettes.${c}.shades`,v),s?.(v)};return o.jsxs("div",{className:"flex max-w-fit flex-col gap-4",children:[o.jsx(iB,{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(ux,{className:"flex-1 space-x-1",wrapperClassName:"items-center",control:a,name:`palettes.${c}.customBase`,label:"Custom Base Color",placeholder:"Choose a color",parseColor:cx,serializeColor:ox}),o.jsx(aB,{variant:"secondary",onClick:m,size:"sm",children:"Generate"})]}),o.jsx("div",{className:"flex gap-3",children:nB.map(g=>o.jsx(ux,{wrapperClassName:"flex flex-col items-center",hideText:!0,control:a,name:`palettes.${c}.shades.${g}`,label:g,parseColor:cx,serializeColor:ox,onChange:()=>s?.(n(`palettes.${c}.shades`))},g))})]})}const{createThemeSchema:rB,generateDefaultTheme:sB,generateThemeColorsFromShade:fx}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:oB,useProjectDefinition:cB,useResettableForm:uB}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:dB,AlertDescription:fB,AlertTitle:hB,Button:mB,FormActionBar:pB,SectionList:gB,SectionListSection:em,SectionListSectionContent:tm,SectionListSectionDescription:nm,SectionListSectionHeader:am,SectionListSectionTitle:im,Tabs:hx,TabsContent:dc,TabsList:mx,TabsTrigger:fc}=await C("@baseplate-dev/ui-components"),{useCallback:px,useMemo:vB,useState:bB}=await C("react");function yB(){const{definition:a,saveDefinitionWithFeedback:n}=cB(),l=tn(rB),s=vB(()=>a.settings.theme??sB(),[a.settings.theme]),c=uB({resolver:It(l),values:s}),{control:d,handleSubmit:f,setValue:p,getValues:m,reset:g}=c,v=f(S=>n(R=>{R.settings.theme=S}));oB({control:d,reset:g,onSubmit:v});const b=px(S=>{const R=m("palettes");p("colors",{light:fx(R,"light",S?void 0:{palettes:s.palettes,config:s.colors.light}),dark:fx(R,"dark",S?void 0:{palettes:s.palettes,config:s.colors.dark})})},[m,p,s]),x=px(()=>{b()},[b]),[j,D]=bB("light");return o.jsxs("form",{className:"relative h-full max-h-full pb-(--action-bar-height)",onSubmit:v,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(dB,{className:"max-w-fit",children:[o.jsx(qw,{}),o.jsx(hB,{children:"Work in Progress"}),o.jsx(fB,{children:"This page is still a work in progress. It is not being used for generation at the moment."})]}),o.jsxs(gB,{children:[o.jsxs(em,{children:[o.jsxs(am,{children:[o.jsx(im,{children:"Theme Palettes"}),o.jsx(nm,{children:"Pick the colors for your theme"})]}),o.jsx(tm,{className:"max-w-3xl",children:o.jsxs(hx,{defaultValue:"base",children:[o.jsxs(mx,{children:[o.jsx(fc,{value:"base",children:"Base"}),o.jsx(fc,{value:"primary",children:"Primary"})]}),o.jsx(dc,{value:"base",children:o.jsx(dx,{control:d,getValues:m,setValue:p,type:"base",onShadesChange:x})}),o.jsx(dc,{value:"primary",children:o.jsx(dx,{control:d,getValues:m,setValue:p,type:"primary",onShadesChange:x})})]})})]}),o.jsxs(em,{children:[o.jsxs(am,{children:[o.jsx(im,{children:"Theme Colors"}),o.jsx(nm,{children:"Pick the colors for your theme"}),o.jsx("div",{className:"sticky top-44",children:o.jsx(Wz,{control:d,mode:j},j)})]}),o.jsxs(tm,{className:"flex flex-col gap-4",children:[o.jsxs(hx,{value:j,onValueChange:D,children:[o.jsxs(mx,{children:[o.jsx(fc,{value:"light",children:"Light"}),o.jsx(fc,{value:"dark",children:"Dark"})]}),o.jsx(dc,{value:"light",children:o.jsx(sx,{control:d,setValue:p,mode:"light"})}),o.jsx(dc,{value:"dark",children:o.jsx(sx,{control:d,setValue:p,mode:"dark"})})]}),o.jsx(mB,{onClick:()=>{b(!0)},variant:"outline",size:"sm",type:"button",className:"w-fit",children:"Reset Colors"})]})]}),o.jsxs(em,{children:[o.jsxs(am,{children:[o.jsx(im,{children:"CSS Preview"}),o.jsx(nm,{children:"Preview the CSS for your theme"})]}),o.jsx(tm,{className:"flex flex-col gap-4",children:o.jsx($z,{control:d})})]})]})]})]}),o.jsx(pB,{form:c})]})}const xB={element:o.jsx(BU,{}),path:"/settings",handle:{crumb:"Settings"},children:[{index:!0,element:o.jsx(Lm,{to:"./project-settings"})},{path:"project-settings",element:o.jsx(hz,{}),handle:{crumb:"Project settings"}},{path:"hierarchy",element:o.jsx(tz,{}),handle:{crumb:"Hierarchy"}},{path:"theme-builder",element:o.jsx(yB,{}),handle:{crumb:"Theme builder"}},{path:"template-extractor",element:o.jsx(Nz,{}),handle:{crumb:"Template extractor"}},{path:"*",element:o.jsx(Ts,{})}]},jB=xC([{element:o.jsx(X7,{}),children:[{element:o.jsx(n8,{}),children:[{path:"/",element:o.jsx(YO,{}),handle:{crumb:{label:"Home",url:"/"}}},{path:"/apps/*",children:b9,handle:{crumb:{label:"Apps",url:"/apps"}}},GO,{path:"/plugins/*",children:AU,handle:{crumb:{label:"Plugins",url:"/plugins"}}},xB,Rs]}]}]),SB=await C("react"),p2=document.querySelector("#root");if(!p2)throw new Error("Failed to find root element");const wB=Kw.createRoot(p2);wB.render(o.jsx(SB.StrictMode,{children:o.jsx(NC,{router:jB})}));
|
|
78
|
-
//# sourceMappingURL=index-BM00URXH.js.map
|