@c-time/frelio-cms 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_redirects +1 -0
- package/dist/_routes.json +5 -0
- package/dist/assets/index-Dr4qYonI.js +504 -0
- package/dist/assets/index-Qi4Cp3k2.js +1 -0
- package/dist/assets/logo-DRV9kVVU.png +0 -0
- package/dist/index.html +12 -0
- package/package.json +62 -0
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
var zz=Object.defineProperty;var BE=t=>{throw TypeError(t)};var $z=(t,e,n)=>e in t?zz(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var St=(t,e,n)=>$z(t,typeof e!="symbol"?e+"":e,n),mS=(t,e,n)=>e.has(t)||BE("Cannot "+n);var X=(t,e,n)=>(mS(t,e,"read from private field"),n?n.call(t):e.get(t)),Dt=(t,e,n)=>e.has(t)?BE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),st=(t,e,n,r)=>(mS(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Xt=(t,e,n)=>(mS(t,e,"access private method"),n);var ry=(t,e,n,r)=>({set _(s){st(t,e,s,n)},get _(){return X(t,e,r)}});function Nz(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function tx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gS={exports:{}},xf={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var UE;function Fz(){if(UE)return xf;UE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var u in s)u!=="key"&&(i[u]=s[u])}else i=s;return s=i.ref,{$$typeof:t,type:r,key:l,ref:s!==void 0?s:null,props:i}}return xf.Fragment=e,xf.jsx=n,xf.jsxs=n,xf}var VE;function Bz(){return VE||(VE=1,gS.exports=Fz()),gS.exports}var a=Bz(),yS={exports:{}},Vt={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var HE;function Uz(){if(HE)return Vt;HE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function v(F){return F===null||typeof F!="object"?null:(F=y&&F[y]||F["@@iterator"],typeof F=="function"?F:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function D(F,J,ie){this.props=F,this.context=J,this.refs=j,this.updater=ie||C}D.prototype.isReactComponent={},D.prototype.setState=function(F,J){if(typeof F!="object"&&typeof F!="function"&&F!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,F,J,"setState")},D.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function M(){}M.prototype=D.prototype;function T(F,J,ie){this.props=F,this.context=J,this.refs=j,this.updater=ie||C}var E=T.prototype=new M;E.constructor=T,S(E,D.prototype),E.isPureReactComponent=!0;var k=Array.isArray;function A(){}var O={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function $(F,J,ie){var te=ie.ref;return{$$typeof:t,type:F,key:J,ref:te!==void 0?te:null,props:ie}}function R(F,J){return $(F.type,J,F.props)}function P(F){return typeof F=="object"&&F!==null&&F.$$typeof===t}function z(F){var J={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(ie){return J[ie]})}var N=/\/+/g;function H(F,J){return typeof F=="object"&&F!==null&&F.key!=null?z(""+F.key):J.toString(36)}function U(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(A,A):(F.status="pending",F.then(function(J){F.status==="pending"&&(F.status="fulfilled",F.value=J)},function(J){F.status==="pending"&&(F.status="rejected",F.reason=J)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function L(F,J,ie,te,de){var fe=typeof F;(fe==="undefined"||fe==="boolean")&&(F=null);var Re=!1;if(F===null)Re=!0;else switch(fe){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(F.$$typeof){case t:case e:Re=!0;break;case m:return Re=F._init,L(Re(F._payload),J,ie,te,de)}}if(Re)return de=de(F),Re=te===""?"."+H(F,0):te,k(de)?(ie="",Re!=null&&(ie=Re.replace(N,"$&/")+"/"),L(de,J,ie,"",function(we){return we})):de!=null&&(P(de)&&(de=R(de,ie+(de.key==null||F&&F.key===de.key?"":(""+de.key).replace(N,"$&/")+"/")+Re)),J.push(de)),1;Re=0;var Pe=te===""?".":te+":";if(k(F))for(var $e=0;$e<F.length;$e++)te=F[$e],fe=Pe+H(te,$e),Re+=L(te,J,ie,fe,de);else if($e=v(F),typeof $e=="function")for(F=$e.call(F),$e=0;!(te=F.next()).done;)te=te.value,fe=Pe+H(te,$e++),Re+=L(te,J,ie,fe,de);else if(fe==="object"){if(typeof F.then=="function")return L(U(F),J,ie,te,de);throw J=String(F),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return Re}function W(F,J,ie){if(F==null)return F;var te=[],de=0;return L(F,te,"","",function(fe){return J.call(ie,fe,de++)}),te}function K(F){if(F._status===-1){var J=F._result;J=J(),J.then(function(ie){(F._status===0||F._status===-1)&&(F._status=1,F._result=ie)},function(ie){(F._status===0||F._status===-1)&&(F._status=2,F._result=ie)}),F._status===-1&&(F._status=0,F._result=J)}if(F._status===1)return F._result.default;throw F._result}var Q=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},le={map:W,forEach:function(F,J,ie){W(F,function(){J.apply(this,arguments)},ie)},count:function(F){var J=0;return W(F,function(){J++}),J},toArray:function(F){return W(F,function(J){return J})||[]},only:function(F){if(!P(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return Vt.Activity=g,Vt.Children=le,Vt.Component=D,Vt.Fragment=n,Vt.Profiler=s,Vt.PureComponent=T,Vt.StrictMode=r,Vt.Suspense=p,Vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Vt.__COMPILER_RUNTIME={__proto__:null,c:function(F){return O.H.useMemoCache(F)}},Vt.cache=function(F){return function(){return F.apply(null,arguments)}},Vt.cacheSignal=function(){return null},Vt.cloneElement=function(F,J,ie){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var te=S({},F.props),de=F.key;if(J!=null)for(fe in J.key!==void 0&&(de=""+J.key),J)!I.call(J,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&J.ref===void 0||(te[fe]=J[fe]);var fe=arguments.length-2;if(fe===1)te.children=ie;else if(1<fe){for(var Re=Array(fe),Pe=0;Pe<fe;Pe++)Re[Pe]=arguments[Pe+2];te.children=Re}return $(F.type,de,te)},Vt.createContext=function(F){return F={$$typeof:l,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:i,_context:F},F},Vt.createElement=function(F,J,ie){var te,de={},fe=null;if(J!=null)for(te in J.key!==void 0&&(fe=""+J.key),J)I.call(J,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(de[te]=J[te]);var Re=arguments.length-2;if(Re===1)de.children=ie;else if(1<Re){for(var Pe=Array(Re),$e=0;$e<Re;$e++)Pe[$e]=arguments[$e+2];de.children=Pe}if(F&&F.defaultProps)for(te in Re=F.defaultProps,Re)de[te]===void 0&&(de[te]=Re[te]);return $(F,fe,de)},Vt.createRef=function(){return{current:null}},Vt.forwardRef=function(F){return{$$typeof:u,render:F}},Vt.isValidElement=P,Vt.lazy=function(F){return{$$typeof:m,_payload:{_status:-1,_result:F},_init:K}},Vt.memo=function(F,J){return{$$typeof:f,type:F,compare:J===void 0?null:J}},Vt.startTransition=function(F){var J=O.T,ie={};O.T=ie;try{var te=F(),de=O.S;de!==null&&de(ie,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(A,Q)}catch(fe){Q(fe)}finally{J!==null&&ie.types!==null&&(J.types=ie.types),O.T=J}},Vt.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Vt.use=function(F){return O.H.use(F)},Vt.useActionState=function(F,J,ie){return O.H.useActionState(F,J,ie)},Vt.useCallback=function(F,J){return O.H.useCallback(F,J)},Vt.useContext=function(F){return O.H.useContext(F)},Vt.useDebugValue=function(){},Vt.useDeferredValue=function(F,J){return O.H.useDeferredValue(F,J)},Vt.useEffect=function(F,J){return O.H.useEffect(F,J)},Vt.useEffectEvent=function(F){return O.H.useEffectEvent(F)},Vt.useId=function(){return O.H.useId()},Vt.useImperativeHandle=function(F,J,ie){return O.H.useImperativeHandle(F,J,ie)},Vt.useInsertionEffect=function(F,J){return O.H.useInsertionEffect(F,J)},Vt.useLayoutEffect=function(F,J){return O.H.useLayoutEffect(F,J)},Vt.useMemo=function(F,J){return O.H.useMemo(F,J)},Vt.useOptimistic=function(F,J){return O.H.useOptimistic(F,J)},Vt.useReducer=function(F,J,ie){return O.H.useReducer(F,J,ie)},Vt.useRef=function(F){return O.H.useRef(F)},Vt.useState=function(F){return O.H.useState(F)},Vt.useSyncExternalStore=function(F,J,ie){return O.H.useSyncExternalStore(F,J,ie)},Vt.useTransition=function(){return O.H.useTransition()},Vt.version="19.2.4",Vt}var WE;function fm(){return WE||(WE=1,yS.exports=Uz()),yS.exports}var b=fm();const We=tx(b),Xy=Nz({__proto__:null,default:We},[b]);var vS={exports:{}},bf={},xS={exports:{}},bS={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var qE;function Vz(){return qE||(qE=1,(function(t){function e(L,W){var K=L.length;L.push(W);e:for(;0<K;){var Q=K-1>>>1,le=L[Q];if(0<s(le,W))L[Q]=W,L[K]=le,K=Q;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var W=L[0],K=L.pop();if(K!==W){L[0]=K;e:for(var Q=0,le=L.length,F=le>>>1;Q<F;){var J=2*(Q+1)-1,ie=L[J],te=J+1,de=L[te];if(0>s(ie,K))te<le&&0>s(de,ie)?(L[Q]=de,L[te]=K,Q=te):(L[Q]=ie,L[J]=K,Q=J);else if(te<le&&0>s(de,K))L[Q]=de,L[te]=K,Q=te;else break e}}return W}function s(L,W){var K=L.sortIndex-W.sortIndex;return K!==0?K:L.id-W.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var p=[],f=[],m=1,g=null,y=3,v=!1,C=!1,S=!1,j=!1,D=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function E(L){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=L)r(f),W.sortIndex=W.expirationTime,e(p,W);else break;W=n(f)}}function k(L){if(S=!1,E(L),!C)if(n(p)!==null)C=!0,A||(A=!0,z());else{var W=n(f);W!==null&&U(k,W.startTime-L)}}var A=!1,O=-1,I=5,$=-1;function R(){return j?!0:!(t.unstable_now()-$<I)}function P(){if(j=!1,A){var L=t.unstable_now();$=L;var W=!0;try{e:{C=!1,S&&(S=!1,M(O),O=-1),v=!0;var K=y;try{t:{for(E(L),g=n(p);g!==null&&!(g.expirationTime>L&&R());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,y=g.priorityLevel;var le=Q(g.expirationTime<=L);if(L=t.unstable_now(),typeof le=="function"){g.callback=le,E(L),W=!0;break t}g===n(p)&&r(p),E(L)}else r(p);g=n(p)}if(g!==null)W=!0;else{var F=n(f);F!==null&&U(k,F.startTime-L),W=!1}}break e}finally{g=null,y=K,v=!1}W=void 0}}finally{W?z():A=!1}}}var z;if(typeof T=="function")z=function(){T(P)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,H=N.port2;N.port1.onmessage=P,z=function(){H.postMessage(null)}}else z=function(){D(P,0)};function U(L,W){O=D(function(){L(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(L){switch(y){case 1:case 2:case 3:var W=3;break;default:W=y}var K=y;y=W;try{return L()}finally{y=K}},t.unstable_requestPaint=function(){j=!0},t.unstable_runWithPriority=function(L,W){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var K=y;y=L;try{return W()}finally{y=K}},t.unstable_scheduleCallback=function(L,W,K){var Q=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?Q+K:Q):K=Q,L){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=K+le,L={id:m++,callback:W,priorityLevel:L,startTime:K,expirationTime:le,sortIndex:-1},K>Q?(L.sortIndex=K,e(f,L),n(p)===null&&L===n(f)&&(S?(M(O),O=-1):S=!0,U(k,K-Q))):(L.sortIndex=le,e(p,L),C||v||(C=!0,A||(A=!0,z()))),L},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(L){var W=y;return function(){var K=y;y=W;try{return L.apply(this,arguments)}finally{y=K}}}})(bS)),bS}var GE;function Hz(){return GE||(GE=1,xS.exports=Vz()),xS.exports}var SS={exports:{}},vs={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var ZE;function Wz(){if(ZE)return vs;ZE=1;var t=fm();function e(p){var f="https://react.dev/errors/"+p;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+p+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(p,f,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:p,containerInfo:f,implementation:m}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(p,f){if(p==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return vs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,vs.createPortal=function(p,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return i(p,f,null,m)},vs.flushSync=function(p){var f=l.T,m=r.p;try{if(l.T=null,r.p=2,p)return p()}finally{l.T=f,r.p=m,r.d.f()}},vs.preconnect=function(p,f){typeof p=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(p,f))},vs.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},vs.preinit=function(p,f){if(typeof p=="string"&&f&&typeof f.as=="string"){var m=f.as,g=u(m,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(p,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):m==="script"&&r.d.X(p,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},vs.preinitModule=function(p,f){if(typeof p=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=u(f.as,f.crossOrigin);r.d.M(p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(p)},vs.preload=function(p,f){if(typeof p=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,g=u(m,f.crossOrigin);r.d.L(p,m,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},vs.preloadModule=function(p,f){if(typeof p=="string")if(f){var m=u(f.as,f.crossOrigin);r.d.m(p,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(p)},vs.requestFormReset=function(p){r.d.r(p)},vs.unstable_batchedUpdates=function(p,f){return p(f)},vs.useFormState=function(p,f,m){return l.H.useFormState(p,f,m)},vs.useFormStatus=function(){return l.H.useHostTransitionStatus()},vs.version="19.2.4",vs}var KE;function UA(){if(KE)return SS.exports;KE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),SS.exports=Wz(),SS.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var QE;function qz(){if(QE)return bf;QE=1;var t=Hz(),e=fm(),n=UA();function r(o){var c="https://react.dev/errors/"+o;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var c=o,d=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(d=c.return),o=c.return;while(o)}return c.tag===3?d:null}function l(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function u(o){if(o.tag===31){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function p(o){if(i(o)!==o)throw Error(r(188))}function f(o){var c=o.alternate;if(!c){if(c=i(o),c===null)throw Error(r(188));return c!==o?null:o}for(var d=o,h=c;;){var x=d.return;if(x===null)break;var w=x.alternate;if(w===null){if(h=x.return,h!==null){d=h;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===d)return p(x),o;if(w===h)return p(x),c;w=w.sibling}throw Error(r(188))}if(d.return!==h.return)d=x,h=w;else{for(var _=!1,V=x.child;V;){if(V===d){_=!0,d=x,h=w;break}if(V===h){_=!0,h=x,d=w;break}V=V.sibling}if(!_){for(V=w.child;V;){if(V===d){_=!0,d=w,h=x;break}if(V===h){_=!0,h=w,d=x;break}V=V.sibling}if(!_)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:c}function m(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o;for(o=o.child;o!==null;){if(c=m(o),c!==null)return c;o=o.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),T=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function z(o){return o===null||typeof o!="object"?null:(o=P&&o[P]||o["@@iterator"],typeof o=="function"?o:null)}var N=Symbol.for("react.client.reference");function H(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===N?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case D:return"Profiler";case j:return"StrictMode";case k:return"Suspense";case A:return"SuspenseList";case $:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case C:return"Portal";case T:return o.displayName||"Context";case M:return(o._context.displayName||"Context")+".Consumer";case E:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case O:return c=o.displayName||null,c!==null?c:H(o.type)||"Memo";case I:c=o._payload,o=o._init;try{return H(o(c))}catch{}}return null}var U=Array.isArray,L=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},Q=[],le=-1;function F(o){return{current:o}}function J(o){0>le||(o.current=Q[le],Q[le]=null,le--)}function ie(o,c){le++,Q[le]=o.current,o.current=c}var te=F(null),de=F(null),fe=F(null),Re=F(null);function Pe(o,c){switch(ie(fe,c),ie(de,o),ie(te,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?uE(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=uE(c),o=dE(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}J(te),ie(te,o)}function $e(){J(te),J(de),J(fe)}function we(o){o.memoizedState!==null&&ie(Re,o);var c=te.current,d=dE(c,o.type);c!==d&&(ie(de,o),ie(te,d))}function be(o){de.current===o&&(J(te),J(de)),Re.current===o&&(J(Re),mf._currentValue=K)}var Ae,Ne;function Ie(o){if(Ae===void 0)try{throw Error()}catch(d){var c=d.stack.trim().match(/\n( *(at )?)/);Ae=c&&c[1]||"",Ne=-1<d.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Ae+o+Ne}var Fe=!1;function ct(o,c){if(!o||Fe)return"";Fe=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(c){var Le=function(){throw Error()};if(Object.defineProperty(Le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Le,[])}catch(Se){var ve=Se}Reflect.construct(o,[],Le)}else{try{Le.call()}catch(Se){ve=Se}o.call(Le.prototype)}}else{try{throw Error()}catch(Se){ve=Se}(Le=o())&&typeof Le.catch=="function"&&Le.catch(function(){})}}catch(Se){if(Se&&ve&&typeof Se.stack=="string")return[Se.stack,ve.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),_=w[0],V=w[1];if(_&&V){var Y=_.split(`
|
|
44
|
+
`),ge=V.split(`
|
|
45
|
+
`);for(x=h=0;h<Y.length&&!Y[h].includes("DetermineComponentFrameRoot");)h++;for(;x<ge.length&&!ge[x].includes("DetermineComponentFrameRoot");)x++;if(h===Y.length||x===ge.length)for(h=Y.length-1,x=ge.length-1;1<=h&&0<=x&&Y[h]!==ge[x];)x--;for(;1<=h&&0<=x;h--,x--)if(Y[h]!==ge[x]){if(h!==1||x!==1)do if(h--,x--,0>x||Y[h]!==ge[x]){var Te=`
|
|
46
|
+
`+Y[h].replace(" at new "," at ");return o.displayName&&Te.includes("<anonymous>")&&(Te=Te.replace("<anonymous>",o.displayName)),Te}while(1<=h&&0<=x);break}}}finally{Fe=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?Ie(d):""}function Me(o,c){switch(o.tag){case 26:case 27:case 5:return Ie(o.type);case 16:return Ie("Lazy");case 13:return o.child!==c&&c!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return ct(o.type,!1);case 11:return ct(o.type.render,!1);case 1:return ct(o.type,!0);case 31:return Ie("Activity");default:return""}}function tt(o){try{var c="",d=null;do c+=Me(o,d),d=o,o=o.return;while(o);return c}catch(h){return`
|
|
47
|
+
Error generating stack: `+h.message+`
|
|
48
|
+
`+h.stack}}var Ve=Object.prototype.hasOwnProperty,it=t.unstable_scheduleCallback,Z=t.unstable_cancelCallback,q=t.unstable_shouldYield,se=t.unstable_requestPaint,xe=t.unstable_now,ee=t.unstable_getCurrentPriorityLevel,ne=t.unstable_ImmediatePriority,he=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,ze=t.unstable_LowPriority,ke=t.unstable_IdlePriority,Be=t.log,xt=t.unstable_setDisableYieldValue,vt=null,kt=null;function Ge(o){if(typeof Be=="function"&&xt(o),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(vt,o)}catch{}}var gt=Math.clz32?Math.clz32:dr,dn=Math.log,$n=Math.LN2;function dr(o){return o>>>=0,o===0?32:31-(dn(o)/$n|0)|0}var tr=256,Lr=262144,jt=4194304;function _t(o){var c=o&42;if(c!==0)return c;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function an(o,c,d){var h=o.pendingLanes;if(h===0)return 0;var x=0,w=o.suspendedLanes,_=o.pingedLanes;o=o.warmLanes;var V=h&134217727;return V!==0?(h=V&~w,h!==0?x=_t(h):(_&=V,_!==0?x=_t(_):d||(d=V&~o,d!==0&&(x=_t(d))))):(V=h&~w,V!==0?x=_t(V):_!==0?x=_t(_):d||(d=h&~o,d!==0&&(x=_t(d)))),x===0?0:c!==0&&c!==x&&(c&w)===0&&(w=x&-x,d=c&-c,w>=d||w===32&&(d&4194048)!==0)?c:x}function Vn(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function Sn(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 ht(){var o=jt;return jt<<=1,(jt&62914560)===0&&(jt=4194304),o}function Tn(o){for(var c=[],d=0;31>d;d++)c.push(o);return c}function Je(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Ye(o,c,d,h,x,w){var _=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var V=o.entanglements,Y=o.expirationTimes,ge=o.hiddenUpdates;for(d=_&~d;0<d;){var Te=31-gt(d),Le=1<<Te;V[Te]=0,Y[Te]=-1;var ve=ge[Te];if(ve!==null)for(ge[Te]=null,Te=0;Te<ve.length;Te++){var Se=ve[Te];Se!==null&&(Se.lane&=-536870913)}d&=~Le}h!==0&&It(o,h,0),w!==0&&x===0&&o.tag!==0&&(o.suspendedLanes|=w&~(_&~c))}function It(o,c,d){o.pendingLanes|=c,o.suspendedLanes&=~c;var h=31-gt(c);o.entangledLanes|=c,o.entanglements[h]=o.entanglements[h]|1073741824|d&261930}function Mt(o,c){var d=o.entangledLanes|=c;for(o=o.entanglements;d;){var h=31-gt(d),x=1<<h;x&c|o[h]&c&&(o[h]|=c),d&=~x}}function sn(o,c){var d=c&-c;return d=(d&42)!==0?1:pr(d),(d&(o.suspendedLanes|c))!==0?0:d}function pr(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Rr(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function kr(){var o=W.p;return o!==0?o:(o=window.event,o===void 0?32:IE(o.type))}function cs(o,c){var d=W.p;try{return W.p=o,c()}finally{W.p=d}}var Cn=Math.random().toString(36).slice(2),pn="__reactFiber$"+Cn,sr="__reactProps$"+Cn,oo="__reactContainer$"+Cn,Oe="__reactEvents$"+Cn,Ee="__reactListeners$"+Cn,dt="__reactHandles$"+Cn,Ut="__reactResources$"+Cn,Wt="__reactMarker$"+Cn;function kn(o){delete o[pn],delete o[sr],delete o[Oe],delete o[Ee],delete o[dt]}function Jn(o){var c=o[pn];if(c)return c;for(var d=o.parentNode;d;){if(c=d[oo]||d[pn]){if(d=c.alternate,c.child!==null||d!==null&&d.child!==null)for(o=vE(o);o!==null;){if(d=o[pn])return d;o=vE(o)}return c}o=d,d=o.parentNode}return null}function Zr(o){if(o=o[pn]||o[oo]){var c=o.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return o}return null}function ca(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o.stateNode;throw Error(r(33))}function Ka(o){var c=o[Ut];return c||(c=o[Ut]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function Mr(o){o[Wt]=!0}var xc=new Set,bc={};function on(o,c){us(o,c),us(o+"Capture",c)}function us(o,c){for(bc[o]=c,o=0;o<c.length;o++)xc.add(c[o])}var _o=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]*$"),Qa={},Hm={};function k4(o){return Ve.call(Hm,o)?!0:Ve.call(Qa,o)?!1:_o.test(o)?Hm[o]=!0:(Qa[o]=!0,!1)}function Wm(o,c,d){if(k4(c))if(d===null)o.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(c);return;case"boolean":var h=c.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(c);return}}o.setAttribute(c,""+d)}}function qm(o,c,d){if(d===null)o.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttribute(c,""+d)}}function ua(o,c,d,h){if(h===null)o.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(c,d,""+h)}}function ki(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function nj(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function M4(o,c,d){var h=Object.getOwnPropertyDescriptor(o.constructor.prototype,c);if(!o.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var x=h.get,w=h.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return x.call(this)},set:function(_){d=""+_,w.call(this,_)}}),Object.defineProperty(o,c,{enumerable:h.enumerable}),{getValue:function(){return d},setValue:function(_){d=""+_},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function lb(o){if(!o._valueTracker){var c=nj(o)?"checked":"value";o._valueTracker=M4(o,c,""+o[c])}}function rj(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var d=c.getValue(),h="";return o&&(h=nj(o)?o.checked?"true":"false":o.value),o=h,o!==d?(c.setValue(o),!0):!1}function Gm(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var O4=/[\n"\\]/g;function Mi(o){return o.replace(O4,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function cb(o,c,d,h,x,w,_,V){o.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?o.type=_:o.removeAttribute("type"),c!=null?_==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+ki(c)):o.value!==""+ki(c)&&(o.value=""+ki(c)):_!=="submit"&&_!=="reset"||o.removeAttribute("value"),c!=null?ub(o,_,ki(c)):d!=null?ub(o,_,ki(d)):h!=null&&o.removeAttribute("value"),x==null&&w!=null&&(o.defaultChecked=!!w),x!=null&&(o.checked=x&&typeof x!="function"&&typeof x!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?o.name=""+ki(V):o.removeAttribute("name")}function sj(o,c,d,h,x,w,_,V){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(o.type=w),c!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||c!=null)){lb(o);return}d=d!=null?""+ki(d):"",c=c!=null?""+ki(c):d,V||c===o.value||(o.value=c),o.defaultValue=c}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=V?o.checked:!!h,o.defaultChecked=!!h,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(o.name=_),lb(o)}function ub(o,c,d){c==="number"&&Gm(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function ku(o,c,d,h){if(o=o.options,c){c={};for(var x=0;x<d.length;x++)c["$"+d[x]]=!0;for(d=0;d<o.length;d++)x=c.hasOwnProperty("$"+o[d].value),o[d].selected!==x&&(o[d].selected=x),x&&h&&(o[d].defaultSelected=!0)}else{for(d=""+ki(d),c=null,x=0;x<o.length;x++){if(o[x].value===d){o[x].selected=!0,h&&(o[x].defaultSelected=!0);return}c!==null||o[x].disabled||(c=o[x])}c!==null&&(c.selected=!0)}}function ij(o,c,d){if(c!=null&&(c=""+ki(c),c!==o.value&&(o.value=c),d==null)){o.defaultValue!==c&&(o.defaultValue=c);return}o.defaultValue=d!=null?""+ki(d):""}function oj(o,c,d,h){if(c==null){if(h!=null){if(d!=null)throw Error(r(92));if(U(h)){if(1<h.length)throw Error(r(93));h=h[0]}d=h}d==null&&(d=""),c=d}d=ki(c),o.defaultValue=d,h=o.textContent,h===d&&h!==""&&h!==null&&(o.value=h),lb(o)}function Mu(o,c){if(c){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=c;return}}o.textContent=c}var A4=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 aj(o,c,d){var h=c.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?h?o.setProperty(c,""):c==="float"?o.cssFloat="":o[c]="":h?o.setProperty(c,d):typeof d!="number"||d===0||A4.has(c)?c==="float"?o.cssFloat=d:o[c]=(""+d).trim():o[c]=d+"px"}function lj(o,c,d){if(c!=null&&typeof c!="object")throw Error(r(62));if(o=o.style,d!=null){for(var h in d)!d.hasOwnProperty(h)||c!=null&&c.hasOwnProperty(h)||(h.indexOf("--")===0?o.setProperty(h,""):h==="float"?o.cssFloat="":o[h]="");for(var x in c)h=c[x],c.hasOwnProperty(x)&&d[x]!==h&&aj(o,x,h)}else for(var w in c)c.hasOwnProperty(w)&&aj(o,w,c[w])}function db(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _4=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"]]),I4=/^[\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 Zm(o){return I4.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function da(){}var pb=null;function fb(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Ou=null,Au=null;function cj(o){var c=Zr(o);if(c&&(o=c.stateNode)){var d=o[sr]||null;e:switch(o=c.stateNode,c.type){case"input":if(cb(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),c=d.name,d.type==="radio"&&c!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Mi(""+c)+'"][type="radio"]'),c=0;c<d.length;c++){var h=d[c];if(h!==o&&h.form===o.form){var x=h[sr]||null;if(!x)throw Error(r(90));cb(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(c=0;c<d.length;c++)h=d[c],h.form===o.form&&rj(h)}break e;case"textarea":ij(o,d.value,d.defaultValue);break e;case"select":c=d.value,c!=null&&ku(o,!!d.multiple,c,!1)}}}var hb=!1;function uj(o,c,d){if(hb)return o(c,d);hb=!0;try{var h=o(c);return h}finally{if(hb=!1,(Ou!==null||Au!==null)&&(Pg(),Ou&&(c=Ou,o=Au,Au=Ou=null,cj(c),o)))for(c=0;c<o.length;c++)cj(o[c])}}function Op(o,c){var d=o.stateNode;if(d===null)return null;var h=d[sr]||null;if(h===null)return null;d=h[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(o=o.type,h=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!h;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(r(231,c,typeof d));return d}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mb=!1;if(pa)try{var Ap={};Object.defineProperty(Ap,"passive",{get:function(){mb=!0}}),window.addEventListener("test",Ap,Ap),window.removeEventListener("test",Ap,Ap)}catch{mb=!1}var Ja=null,gb=null,Km=null;function dj(){if(Km)return Km;var o,c=gb,d=c.length,h,x="value"in Ja?Ja.value:Ja.textContent,w=x.length;for(o=0;o<d&&c[o]===x[o];o++);var _=d-o;for(h=1;h<=_&&c[d-h]===x[w-h];h++);return Km=x.slice(o,1<h?1-h:void 0)}function Qm(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function Jm(){return!0}function pj(){return!1}function Vs(o){function c(d,h,x,w,_){this._reactName=d,this._targetInst=x,this.type=h,this.nativeEvent=w,this.target=_,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(d=o[V],this[V]=d?d(w):w[V]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Jm:pj,this.isPropagationStopped=pj,this}return g(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Jm)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Jm)},persist:function(){},isPersistent:Jm}),c}var Sc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ym=Vs(Sc),_p=g({},Sc,{view:0,detail:0}),P4=Vs(_p),yb,vb,Ip,Xm=g({},_p,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bb,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Ip&&(Ip&&o.type==="mousemove"?(yb=o.screenX-Ip.screenX,vb=o.screenY-Ip.screenY):vb=yb=0,Ip=o),yb)},movementY:function(o){return"movementY"in o?o.movementY:vb}}),fj=Vs(Xm),L4=g({},Xm,{dataTransfer:0}),z4=Vs(L4),$4=g({},_p,{relatedTarget:0}),xb=Vs($4),N4=g({},Sc,{animationName:0,elapsedTime:0,pseudoElement:0}),F4=Vs(N4),B4=g({},Sc,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),U4=Vs(B4),V4=g({},Sc,{data:0}),hj=Vs(V4),H4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},W4={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"},q4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function G4(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=q4[o])?!!c[o]:!1}function bb(){return G4}var Z4=g({},_p,{key:function(o){if(o.key){var c=H4[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=Qm(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?W4[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bb,charCode:function(o){return o.type==="keypress"?Qm(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Qm(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),K4=Vs(Z4),Q4=g({},Xm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mj=Vs(Q4),J4=g({},_p,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bb}),Y4=Vs(J4),X4=g({},Sc,{propertyName:0,elapsedTime:0,pseudoElement:0}),eL=Vs(X4),tL=g({},Xm,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),nL=Vs(tL),rL=g({},Sc,{newState:0,oldState:0}),sL=Vs(rL),iL=[9,13,27,32],Sb=pa&&"CompositionEvent"in window,Pp=null;pa&&"documentMode"in document&&(Pp=document.documentMode);var oL=pa&&"TextEvent"in window&&!Pp,gj=pa&&(!Sb||Pp&&8<Pp&&11>=Pp),yj=" ",vj=!1;function xj(o,c){switch(o){case"keyup":return iL.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bj(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var _u=!1;function aL(o,c){switch(o){case"compositionend":return bj(c);case"keypress":return c.which!==32?null:(vj=!0,yj);case"textInput":return o=c.data,o===yj&&vj?null:o;default:return null}}function lL(o,c){if(_u)return o==="compositionend"||!Sb&&xj(o,c)?(o=dj(),Km=gb=Ja=null,_u=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return gj&&c.locale!=="ko"?null:c.data;default:return null}}var cL={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 Sj(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!cL[o.type]:c==="textarea"}function Cj(o,c,d,h){Ou?Au?Au.push(h):Au=[h]:Ou=h,c=Ug(c,"onChange"),0<c.length&&(d=new Ym("onChange","change",null,d,h),o.push({event:d,listeners:c}))}var Lp=null,zp=null;function uL(o){sE(o,0)}function eg(o){var c=ca(o);if(rj(c))return o}function wj(o,c){if(o==="change")return c}var jj=!1;if(pa){var Cb;if(pa){var wb="oninput"in document;if(!wb){var Tj=document.createElement("div");Tj.setAttribute("oninput","return;"),wb=typeof Tj.oninput=="function"}Cb=wb}else Cb=!1;jj=Cb&&(!document.documentMode||9<document.documentMode)}function Dj(){Lp&&(Lp.detachEvent("onpropertychange",Ej),zp=Lp=null)}function Ej(o){if(o.propertyName==="value"&&eg(zp)){var c=[];Cj(c,zp,o,fb(o)),uj(uL,c)}}function dL(o,c,d){o==="focusin"?(Dj(),Lp=c,zp=d,Lp.attachEvent("onpropertychange",Ej)):o==="focusout"&&Dj()}function pL(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return eg(zp)}function fL(o,c){if(o==="click")return eg(c)}function hL(o,c){if(o==="input"||o==="change")return eg(c)}function mL(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var ri=typeof Object.is=="function"?Object.is:mL;function $p(o,c){if(ri(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var d=Object.keys(o),h=Object.keys(c);if(d.length!==h.length)return!1;for(h=0;h<d.length;h++){var x=d[h];if(!Ve.call(c,x)||!ri(o[x],c[x]))return!1}return!0}function Rj(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function kj(o,c){var d=Rj(o);o=0;for(var h;d;){if(d.nodeType===3){if(h=o+d.textContent.length,o<=c&&h>=c)return{node:d,offset:c-o};o=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=Rj(d)}}function Mj(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?Mj(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function Oj(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=Gm(o.document);c instanceof o.HTMLIFrameElement;){try{var d=typeof c.contentWindow.location.href=="string"}catch{d=!1}if(d)o=c.contentWindow;else break;c=Gm(o.document)}return c}function jb(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var gL=pa&&"documentMode"in document&&11>=document.documentMode,Iu=null,Tb=null,Np=null,Db=!1;function Aj(o,c,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Db||Iu==null||Iu!==Gm(h)||(h=Iu,"selectionStart"in h&&jb(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Np&&$p(Np,h)||(Np=h,h=Ug(Tb,"onSelect"),0<h.length&&(c=new Ym("onSelect","select",null,c,d),o.push({event:c,listeners:h}),c.target=Iu)))}function Cc(o,c){var d={};return d[o.toLowerCase()]=c.toLowerCase(),d["Webkit"+o]="webkit"+c,d["Moz"+o]="moz"+c,d}var Pu={animationend:Cc("Animation","AnimationEnd"),animationiteration:Cc("Animation","AnimationIteration"),animationstart:Cc("Animation","AnimationStart"),transitionrun:Cc("Transition","TransitionRun"),transitionstart:Cc("Transition","TransitionStart"),transitioncancel:Cc("Transition","TransitionCancel"),transitionend:Cc("Transition","TransitionEnd")},Eb={},_j={};pa&&(_j=document.createElement("div").style,"AnimationEvent"in window||(delete Pu.animationend.animation,delete Pu.animationiteration.animation,delete Pu.animationstart.animation),"TransitionEvent"in window||delete Pu.transitionend.transition);function wc(o){if(Eb[o])return Eb[o];if(!Pu[o])return o;var c=Pu[o],d;for(d in c)if(c.hasOwnProperty(d)&&d in _j)return Eb[o]=c[d];return o}var Ij=wc("animationend"),Pj=wc("animationiteration"),Lj=wc("animationstart"),yL=wc("transitionrun"),vL=wc("transitionstart"),xL=wc("transitioncancel"),zj=wc("transitionend"),$j=new Map,Rb="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(" ");Rb.push("scrollEnd");function ao(o,c){$j.set(o,c),on(c,[o])}var tg=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Oi=[],Lu=0,kb=0;function ng(){for(var o=Lu,c=kb=Lu=0;c<o;){var d=Oi[c];Oi[c++]=null;var h=Oi[c];Oi[c++]=null;var x=Oi[c];Oi[c++]=null;var w=Oi[c];if(Oi[c++]=null,h!==null&&x!==null){var _=h.pending;_===null?x.next=x:(x.next=_.next,_.next=x),h.pending=x}w!==0&&Nj(d,x,w)}}function rg(o,c,d,h){Oi[Lu++]=o,Oi[Lu++]=c,Oi[Lu++]=d,Oi[Lu++]=h,kb|=h,o.lanes|=h,o=o.alternate,o!==null&&(o.lanes|=h)}function Mb(o,c,d,h){return rg(o,c,d,h),sg(o)}function jc(o,c){return rg(o,null,null,c),sg(o)}function Nj(o,c,d){o.lanes|=d;var h=o.alternate;h!==null&&(h.lanes|=d);for(var x=!1,w=o.return;w!==null;)w.childLanes|=d,h=w.alternate,h!==null&&(h.childLanes|=d),w.tag===22&&(o=w.stateNode,o===null||o._visibility&1||(x=!0)),o=w,w=w.return;return o.tag===3?(w=o.stateNode,x&&c!==null&&(x=31-gt(d),o=w.hiddenUpdates,h=o[x],h===null?o[x]=[c]:h.push(c),c.lane=d|536870912),w):null}function sg(o){if(50<lf)throw lf=0,N0=null,Error(r(185));for(var c=o.return;c!==null;)o=c,c=o.return;return o.tag===3?o.stateNode:null}var zu={};function bL(o,c,d,h){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(o,c,d,h){return new bL(o,c,d,h)}function Ob(o){return o=o.prototype,!(!o||!o.isReactComponent)}function fa(o,c){var d=o.alternate;return d===null?(d=si(o.tag,c,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=c,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&65011712,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,c=o.dependencies,d.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d.refCleanup=o.refCleanup,d}function Fj(o,c){o.flags&=65011714;var d=o.alternate;return d===null?(o.childLanes=0,o.lanes=c,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=d.childLanes,o.lanes=d.lanes,o.child=d.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=d.memoizedProps,o.memoizedState=d.memoizedState,o.updateQueue=d.updateQueue,o.type=d.type,c=d.dependencies,o.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),o}function ig(o,c,d,h,x,w){var _=0;if(h=o,typeof o=="function")Ob(o)&&(_=1);else if(typeof o=="string")_=Tz(o,d,te.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case $:return o=si(31,d,c,x),o.elementType=$,o.lanes=w,o;case S:return Tc(d.children,x,w,c);case j:_=8,x|=24;break;case D:return o=si(12,d,c,x|2),o.elementType=D,o.lanes=w,o;case k:return o=si(13,d,c,x),o.elementType=k,o.lanes=w,o;case A:return o=si(19,d,c,x),o.elementType=A,o.lanes=w,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case T:_=10;break e;case M:_=9;break e;case E:_=11;break e;case O:_=14;break e;case I:_=16,h=null;break e}_=29,d=Error(r(130,o===null?"null":typeof o,"")),h=null}return c=si(_,d,c,x),c.elementType=o,c.type=h,c.lanes=w,c}function Tc(o,c,d,h){return o=si(7,o,h,c),o.lanes=d,o}function Ab(o,c,d){return o=si(6,o,null,c),o.lanes=d,o}function Bj(o){var c=si(18,null,null,0);return c.stateNode=o,c}function _b(o,c,d){return c=si(4,o.children!==null?o.children:[],o.key,c),c.lanes=d,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}var Uj=new WeakMap;function Ai(o,c){if(typeof o=="object"&&o!==null){var d=Uj.get(o);return d!==void 0?d:(c={value:o,source:c,stack:tt(c)},Uj.set(o,c),c)}return{value:o,source:c,stack:tt(c)}}var $u=[],Nu=0,og=null,Fp=0,_i=[],Ii=0,Ya=null,Io=1,Po="";function ha(o,c){$u[Nu++]=Fp,$u[Nu++]=og,og=o,Fp=c}function Vj(o,c,d){_i[Ii++]=Io,_i[Ii++]=Po,_i[Ii++]=Ya,Ya=o;var h=Io;o=Po;var x=32-gt(h)-1;h&=~(1<<x),d+=1;var w=32-gt(c)+x;if(30<w){var _=x-x%5;w=(h&(1<<_)-1).toString(32),h>>=_,x-=_,Io=1<<32-gt(c)+x|d<<x|h,Po=w+o}else Io=1<<w|d<<x|h,Po=o}function Ib(o){o.return!==null&&(ha(o,1),Vj(o,1,0))}function Pb(o){for(;o===og;)og=$u[--Nu],$u[Nu]=null,Fp=$u[--Nu],$u[Nu]=null;for(;o===Ya;)Ya=_i[--Ii],_i[Ii]=null,Po=_i[--Ii],_i[Ii]=null,Io=_i[--Ii],_i[Ii]=null}function Hj(o,c){_i[Ii++]=Io,_i[Ii++]=Po,_i[Ii++]=Ya,Io=c.id,Po=c.overflow,Ya=o}var ds=null,ir=null,mn=!1,Xa=null,Pi=!1,Lb=Error(r(519));function el(o){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bp(Ai(c,o)),Lb}function Wj(o){var c=o.stateNode,d=o.type,h=o.memoizedProps;switch(c[pn]=o,c[sr]=h,d){case"dialog":cn("cancel",c),cn("close",c);break;case"iframe":case"object":case"embed":cn("load",c);break;case"video":case"audio":for(d=0;d<uf.length;d++)cn(uf[d],c);break;case"source":cn("error",c);break;case"img":case"image":case"link":cn("error",c),cn("load",c);break;case"details":cn("toggle",c);break;case"input":cn("invalid",c),sj(c,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":cn("invalid",c);break;case"textarea":cn("invalid",c),oj(c,h.value,h.defaultValue,h.children)}d=h.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||c.textContent===""+d||h.suppressHydrationWarning===!0||lE(c.textContent,d)?(h.popover!=null&&(cn("beforetoggle",c),cn("toggle",c)),h.onScroll!=null&&cn("scroll",c),h.onScrollEnd!=null&&cn("scrollend",c),h.onClick!=null&&(c.onclick=da),c=!0):c=!1,c||el(o,!0)}function qj(o){for(ds=o.return;ds;)switch(ds.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:ds=ds.return}}function Fu(o){if(o!==ds)return!1;if(!mn)return qj(o),mn=!0,!1;var c=o.tag,d;if((d=c!==3&&c!==27)&&((d=c===5)&&(d=o.type,d=!(d!=="form"&&d!=="button")||eS(o.type,o.memoizedProps)),d=!d),d&&ir&&el(o),qj(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));ir=yE(o)}else if(c===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));ir=yE(o)}else c===27?(c=ir,hl(o.type)?(o=iS,iS=null,ir=o):ir=c):ir=ds?zi(o.stateNode.nextSibling):null;return!0}function Dc(){ir=ds=null,mn=!1}function zb(){var o=Xa;return o!==null&&(Gs===null?Gs=o:Gs.push.apply(Gs,o),Xa=null),o}function Bp(o){Xa===null?Xa=[o]:Xa.push(o)}var $b=F(null),Ec=null,ma=null;function tl(o,c,d){ie($b,c._currentValue),c._currentValue=d}function ga(o){o._currentValue=$b.current,J($b)}function Nb(o,c,d){for(;o!==null;){var h=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,h!==null&&(h.childLanes|=c)):h!==null&&(h.childLanes&c)!==c&&(h.childLanes|=c),o===d)break;o=o.return}}function Fb(o,c,d,h){var x=o.child;for(x!==null&&(x.return=o);x!==null;){var w=x.dependencies;if(w!==null){var _=x.child;w=w.firstContext;e:for(;w!==null;){var V=w;w=x;for(var Y=0;Y<c.length;Y++)if(V.context===c[Y]){w.lanes|=d,V=w.alternate,V!==null&&(V.lanes|=d),Nb(w.return,d,o),h||(_=null);break e}w=V.next}}else if(x.tag===18){if(_=x.return,_===null)throw Error(r(341));_.lanes|=d,w=_.alternate,w!==null&&(w.lanes|=d),Nb(_,d,o),_=null}else _=x.child;if(_!==null)_.return=x;else for(_=x;_!==null;){if(_===o){_=null;break}if(x=_.sibling,x!==null){x.return=_.return,_=x;break}_=_.return}x=_}}function Bu(o,c,d,h){o=null;for(var x=c,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var _=x.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var V=x.type;ri(x.pendingProps.value,_.value)||(o!==null?o.push(V):o=[V])}}else if(x===Re.current){if(_=x.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(o!==null?o.push(mf):o=[mf])}x=x.return}o!==null&&Fb(c,o,d,h),c.flags|=262144}function ag(o){for(o=o.firstContext;o!==null;){if(!ri(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Rc(o){Ec=o,ma=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function ps(o){return Gj(Ec,o)}function lg(o,c){return Ec===null&&Rc(o),Gj(o,c)}function Gj(o,c){var d=c._currentValue;if(c={context:c,memoizedValue:d,next:null},ma===null){if(o===null)throw Error(r(308));ma=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else ma=ma.next=c;return d}var SL=typeof AbortController<"u"?AbortController:function(){var o=[],c=this.signal={aborted:!1,addEventListener:function(d,h){o.push(h)}};this.abort=function(){c.aborted=!0,o.forEach(function(d){return d()})}},CL=t.unstable_scheduleCallback,wL=t.unstable_NormalPriority,zr={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bb(){return{controller:new SL,data:new Map,refCount:0}}function Up(o){o.refCount--,o.refCount===0&&CL(wL,function(){o.controller.abort()})}var Vp=null,Ub=0,Uu=0,Vu=null;function jL(o,c){if(Vp===null){var d=Vp=[];Ub=0,Uu=W0(),Vu={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Ub++,c.then(Zj,Zj),c}function Zj(){if(--Ub===0&&Vp!==null){Vu!==null&&(Vu.status="fulfilled");var o=Vp;Vp=null,Uu=0,Vu=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function TL(o,c){var d=[],h={status:"pending",value:null,reason:null,then:function(x){d.push(x)}};return o.then(function(){h.status="fulfilled",h.value=c;for(var x=0;x<d.length;x++)(0,d[x])(c)},function(x){for(h.status="rejected",h.reason=x,x=0;x<d.length;x++)(0,d[x])(void 0)}),h}var Kj=L.S;L.S=function(o,c){AD=xe(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&jL(o,c),Kj!==null&&Kj(o,c)};var kc=F(null);function Vb(){var o=kc.current;return o!==null?o:Yn.pooledCache}function cg(o,c){c===null?ie(kc,kc.current):ie(kc,c.pool)}function Qj(){var o=Vb();return o===null?null:{parent:zr._currentValue,pool:o}}var Hu=Error(r(460)),Hb=Error(r(474)),ug=Error(r(542)),dg={then:function(){}};function Jj(o){return o=o.status,o==="fulfilled"||o==="rejected"}function Yj(o,c,d){switch(d=o[d],d===void 0?o.push(c):d!==c&&(c.then(da,da),c=d),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,eT(o),o;default:if(typeof c.status=="string")c.then(da,da);else{if(o=Yn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=c,o.status="pending",o.then(function(h){if(c.status==="pending"){var x=c;x.status="fulfilled",x.value=h}},function(h){if(c.status==="pending"){var x=c;x.status="rejected",x.reason=h}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,eT(o),o}throw Oc=c,Hu}}function Mc(o){try{var c=o._init;return c(o._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(Oc=d,Hu):d}}var Oc=null;function Xj(){if(Oc===null)throw Error(r(459));var o=Oc;return Oc=null,o}function eT(o){if(o===Hu||o===ug)throw Error(r(483))}var Wu=null,Hp=0;function pg(o){var c=Hp;return Hp+=1,Wu===null&&(Wu=[]),Yj(Wu,o,c)}function Wp(o,c){c=c.props.ref,o.ref=c!==void 0?c:null}function fg(o,c){throw c.$$typeof===y?Error(r(525)):(o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o)))}function tT(o){function c(ae,re){if(o){var me=ae.deletions;me===null?(ae.deletions=[re],ae.flags|=16):me.push(re)}}function d(ae,re){if(!o)return null;for(;re!==null;)c(ae,re),re=re.sibling;return null}function h(ae){for(var re=new Map;ae!==null;)ae.key!==null?re.set(ae.key,ae):re.set(ae.index,ae),ae=ae.sibling;return re}function x(ae,re){return ae=fa(ae,re),ae.index=0,ae.sibling=null,ae}function w(ae,re,me){return ae.index=me,o?(me=ae.alternate,me!==null?(me=me.index,me<re?(ae.flags|=67108866,re):me):(ae.flags|=67108866,re)):(ae.flags|=1048576,re)}function _(ae){return o&&ae.alternate===null&&(ae.flags|=67108866),ae}function V(ae,re,me,_e){return re===null||re.tag!==6?(re=Ab(me,ae.mode,_e),re.return=ae,re):(re=x(re,me),re.return=ae,re)}function Y(ae,re,me,_e){var Rt=me.type;return Rt===S?Te(ae,re,me.props.children,_e,me.key):re!==null&&(re.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===I&&Mc(Rt)===re.type)?(re=x(re,me.props),Wp(re,me),re.return=ae,re):(re=ig(me.type,me.key,me.props,null,ae.mode,_e),Wp(re,me),re.return=ae,re)}function ge(ae,re,me,_e){return re===null||re.tag!==4||re.stateNode.containerInfo!==me.containerInfo||re.stateNode.implementation!==me.implementation?(re=_b(me,ae.mode,_e),re.return=ae,re):(re=x(re,me.children||[]),re.return=ae,re)}function Te(ae,re,me,_e,Rt){return re===null||re.tag!==7?(re=Tc(me,ae.mode,_e,Rt),re.return=ae,re):(re=x(re,me),re.return=ae,re)}function Le(ae,re,me){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=Ab(""+re,ae.mode,me),re.return=ae,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return me=ig(re.type,re.key,re.props,null,ae.mode,me),Wp(me,re),me.return=ae,me;case C:return re=_b(re,ae.mode,me),re.return=ae,re;case I:return re=Mc(re),Le(ae,re,me)}if(U(re)||z(re))return re=Tc(re,ae.mode,me,null),re.return=ae,re;if(typeof re.then=="function")return Le(ae,pg(re),me);if(re.$$typeof===T)return Le(ae,lg(ae,re),me);fg(ae,re)}return null}function ve(ae,re,me,_e){var Rt=re!==null?re.key:null;if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return Rt!==null?null:V(ae,re,""+me,_e);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case v:return me.key===Rt?Y(ae,re,me,_e):null;case C:return me.key===Rt?ge(ae,re,me,_e):null;case I:return me=Mc(me),ve(ae,re,me,_e)}if(U(me)||z(me))return Rt!==null?null:Te(ae,re,me,_e,null);if(typeof me.then=="function")return ve(ae,re,pg(me),_e);if(me.$$typeof===T)return ve(ae,re,lg(ae,me),_e);fg(ae,me)}return null}function Se(ae,re,me,_e,Rt){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return ae=ae.get(me)||null,V(re,ae,""+_e,Rt);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case v:return ae=ae.get(_e.key===null?me:_e.key)||null,Y(re,ae,_e,Rt);case C:return ae=ae.get(_e.key===null?me:_e.key)||null,ge(re,ae,_e,Rt);case I:return _e=Mc(_e),Se(ae,re,me,_e,Rt)}if(U(_e)||z(_e))return ae=ae.get(me)||null,Te(re,ae,_e,Rt,null);if(typeof _e.then=="function")return Se(ae,re,me,pg(_e),Rt);if(_e.$$typeof===T)return Se(ae,re,me,lg(re,_e),Rt);fg(re,_e)}return null}function mt(ae,re,me,_e){for(var Rt=null,Dn=null,bt=re,Zt=re=0,hn=null;bt!==null&&Zt<me.length;Zt++){bt.index>Zt?(hn=bt,bt=null):hn=bt.sibling;var En=ve(ae,bt,me[Zt],_e);if(En===null){bt===null&&(bt=hn);break}o&&bt&&En.alternate===null&&c(ae,bt),re=w(En,re,Zt),Dn===null?Rt=En:Dn.sibling=En,Dn=En,bt=hn}if(Zt===me.length)return d(ae,bt),mn&&ha(ae,Zt),Rt;if(bt===null){for(;Zt<me.length;Zt++)bt=Le(ae,me[Zt],_e),bt!==null&&(re=w(bt,re,Zt),Dn===null?Rt=bt:Dn.sibling=bt,Dn=bt);return mn&&ha(ae,Zt),Rt}for(bt=h(bt);Zt<me.length;Zt++)hn=Se(bt,ae,Zt,me[Zt],_e),hn!==null&&(o&&hn.alternate!==null&&bt.delete(hn.key===null?Zt:hn.key),re=w(hn,re,Zt),Dn===null?Rt=hn:Dn.sibling=hn,Dn=hn);return o&&bt.forEach(function(xl){return c(ae,xl)}),mn&&ha(ae,Zt),Rt}function Ot(ae,re,me,_e){if(me==null)throw Error(r(151));for(var Rt=null,Dn=null,bt=re,Zt=re=0,hn=null,En=me.next();bt!==null&&!En.done;Zt++,En=me.next()){bt.index>Zt?(hn=bt,bt=null):hn=bt.sibling;var xl=ve(ae,bt,En.value,_e);if(xl===null){bt===null&&(bt=hn);break}o&&bt&&xl.alternate===null&&c(ae,bt),re=w(xl,re,Zt),Dn===null?Rt=xl:Dn.sibling=xl,Dn=xl,bt=hn}if(En.done)return d(ae,bt),mn&&ha(ae,Zt),Rt;if(bt===null){for(;!En.done;Zt++,En=me.next())En=Le(ae,En.value,_e),En!==null&&(re=w(En,re,Zt),Dn===null?Rt=En:Dn.sibling=En,Dn=En);return mn&&ha(ae,Zt),Rt}for(bt=h(bt);!En.done;Zt++,En=me.next())En=Se(bt,ae,Zt,En.value,_e),En!==null&&(o&&En.alternate!==null&&bt.delete(En.key===null?Zt:En.key),re=w(En,re,Zt),Dn===null?Rt=En:Dn.sibling=En,Dn=En);return o&&bt.forEach(function(Lz){return c(ae,Lz)}),mn&&ha(ae,Zt),Rt}function qn(ae,re,me,_e){if(typeof me=="object"&&me!==null&&me.type===S&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case v:e:{for(var Rt=me.key;re!==null;){if(re.key===Rt){if(Rt=me.type,Rt===S){if(re.tag===7){d(ae,re.sibling),_e=x(re,me.props.children),_e.return=ae,ae=_e;break e}}else if(re.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===I&&Mc(Rt)===re.type){d(ae,re.sibling),_e=x(re,me.props),Wp(_e,me),_e.return=ae,ae=_e;break e}d(ae,re);break}else c(ae,re);re=re.sibling}me.type===S?(_e=Tc(me.props.children,ae.mode,_e,me.key),_e.return=ae,ae=_e):(_e=ig(me.type,me.key,me.props,null,ae.mode,_e),Wp(_e,me),_e.return=ae,ae=_e)}return _(ae);case C:e:{for(Rt=me.key;re!==null;){if(re.key===Rt)if(re.tag===4&&re.stateNode.containerInfo===me.containerInfo&&re.stateNode.implementation===me.implementation){d(ae,re.sibling),_e=x(re,me.children||[]),_e.return=ae,ae=_e;break e}else{d(ae,re);break}else c(ae,re);re=re.sibling}_e=_b(me,ae.mode,_e),_e.return=ae,ae=_e}return _(ae);case I:return me=Mc(me),qn(ae,re,me,_e)}if(U(me))return mt(ae,re,me,_e);if(z(me)){if(Rt=z(me),typeof Rt!="function")throw Error(r(150));return me=Rt.call(me),Ot(ae,re,me,_e)}if(typeof me.then=="function")return qn(ae,re,pg(me),_e);if(me.$$typeof===T)return qn(ae,re,lg(ae,me),_e);fg(ae,me)}return typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint"?(me=""+me,re!==null&&re.tag===6?(d(ae,re.sibling),_e=x(re,me),_e.return=ae,ae=_e):(d(ae,re),_e=Ab(me,ae.mode,_e),_e.return=ae,ae=_e),_(ae)):d(ae,re)}return function(ae,re,me,_e){try{Hp=0;var Rt=qn(ae,re,me,_e);return Wu=null,Rt}catch(bt){if(bt===Hu||bt===ug)throw bt;var Dn=si(29,bt,null,ae.mode);return Dn.lanes=_e,Dn.return=ae,Dn}finally{}}}var Ac=tT(!0),nT=tT(!1),nl=!1;function Wb(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qb(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function rl(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function sl(o,c,d){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(Mn&2)!==0){var x=h.pending;return x===null?c.next=c:(c.next=x.next,x.next=c),h.pending=c,c=sg(o),Nj(o,null,d),c}return rg(o,h,c,d),sg(o)}function qp(o,c,d){if(c=c.updateQueue,c!==null&&(c=c.shared,(d&4194048)!==0)){var h=c.lanes;h&=o.pendingLanes,d|=h,c.lanes=d,Mt(o,d)}}function Gb(o,c){var d=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,d===h)){var x=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var _={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?x=w=_:w=w.next=_,d=d.next}while(d!==null);w===null?x=w=c:w=w.next=c}else x=w=c;d={baseState:h.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=c}var Zb=!1;function Gp(){if(Zb){var o=Vu;if(o!==null)throw o}}function Zp(o,c,d,h){Zb=!1;var x=o.updateQueue;nl=!1;var w=x.firstBaseUpdate,_=x.lastBaseUpdate,V=x.shared.pending;if(V!==null){x.shared.pending=null;var Y=V,ge=Y.next;Y.next=null,_===null?w=ge:_.next=ge,_=Y;var Te=o.alternate;Te!==null&&(Te=Te.updateQueue,V=Te.lastBaseUpdate,V!==_&&(V===null?Te.firstBaseUpdate=ge:V.next=ge,Te.lastBaseUpdate=Y))}if(w!==null){var Le=x.baseState;_=0,Te=ge=Y=null,V=w;do{var ve=V.lane&-536870913,Se=ve!==V.lane;if(Se?(fn&ve)===ve:(h&ve)===ve){ve!==0&&ve===Uu&&(Zb=!0),Te!==null&&(Te=Te.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var mt=o,Ot=V;ve=c;var qn=d;switch(Ot.tag){case 1:if(mt=Ot.payload,typeof mt=="function"){Le=mt.call(qn,Le,ve);break e}Le=mt;break e;case 3:mt.flags=mt.flags&-65537|128;case 0:if(mt=Ot.payload,ve=typeof mt=="function"?mt.call(qn,Le,ve):mt,ve==null)break e;Le=g({},Le,ve);break e;case 2:nl=!0}}ve=V.callback,ve!==null&&(o.flags|=64,Se&&(o.flags|=8192),Se=x.callbacks,Se===null?x.callbacks=[ve]:Se.push(ve))}else Se={lane:ve,tag:V.tag,payload:V.payload,callback:V.callback,next:null},Te===null?(ge=Te=Se,Y=Le):Te=Te.next=Se,_|=ve;if(V=V.next,V===null){if(V=x.shared.pending,V===null)break;Se=V,V=Se.next,Se.next=null,x.lastBaseUpdate=Se,x.shared.pending=null}}while(!0);Te===null&&(Y=Le),x.baseState=Y,x.firstBaseUpdate=ge,x.lastBaseUpdate=Te,w===null&&(x.shared.lanes=0),cl|=_,o.lanes=_,o.memoizedState=Le}}function rT(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function sT(o,c){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)rT(d[o],c)}var qu=F(null),hg=F(0);function iT(o,c){o=Ta,ie(hg,o),ie(qu,c),Ta=o|c.baseLanes}function Kb(){ie(hg,Ta),ie(qu,qu.current)}function Qb(){Ta=hg.current,J(qu),J(hg)}var ii=F(null),Li=null;function il(o){var c=o.alternate;ie(Or,Or.current&1),ie(ii,o),Li===null&&(c===null||qu.current!==null||c.memoizedState!==null)&&(Li=o)}function Jb(o){ie(Or,Or.current),ie(ii,o),Li===null&&(Li=o)}function oT(o){o.tag===22?(ie(Or,Or.current),ie(ii,o),Li===null&&(Li=o)):ol()}function ol(){ie(Or,Or.current),ie(ii,ii.current)}function oi(o){J(ii),Li===o&&(Li=null),J(Or)}var Or=F(0);function mg(o){for(var c=o;c!==null;){if(c.tag===13){var d=c.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||rS(d)||sS(d)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var ya=0,qt=null,Hn=null,$r=null,gg=!1,Gu=!1,_c=!1,yg=0,Kp=0,Zu=null,DL=0;function xr(){throw Error(r(321))}function Yb(o,c){if(c===null)return!1;for(var d=0;d<c.length&&d<o.length;d++)if(!ri(o[d],c[d]))return!1;return!0}function Xb(o,c,d,h,x,w){return ya=w,qt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,L.H=o===null||o.memoizedState===null?VT:h0,_c=!1,w=d(h,x),_c=!1,Gu&&(w=lT(c,d,h,x)),aT(o),w}function aT(o){L.H=Yp;var c=Hn!==null&&Hn.next!==null;if(ya=0,$r=Hn=qt=null,gg=!1,Kp=0,Zu=null,c)throw Error(r(300));o===null||Nr||(o=o.dependencies,o!==null&&ag(o)&&(Nr=!0))}function lT(o,c,d,h){qt=o;var x=0;do{if(Gu&&(Zu=null),Kp=0,Gu=!1,25<=x)throw Error(r(301));if(x+=1,$r=Hn=null,o.updateQueue!=null){var w=o.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}L.H=HT,w=c(d,h)}while(Gu);return w}function EL(){var o=L.H,c=o.useState()[0];return c=typeof c.then=="function"?Qp(c):c,o=o.useState()[0],(Hn!==null?Hn.memoizedState:null)!==o&&(qt.flags|=1024),c}function e0(){var o=yg!==0;return yg=0,o}function t0(o,c,d){c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~d}function n0(o){if(gg){for(o=o.memoizedState;o!==null;){var c=o.queue;c!==null&&(c.pending=null),o=o.next}gg=!1}ya=0,$r=Hn=qt=null,Gu=!1,Kp=yg=0,Zu=null}function js(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $r===null?qt.memoizedState=$r=o:$r=$r.next=o,$r}function Ar(){if(Hn===null){var o=qt.alternate;o=o!==null?o.memoizedState:null}else o=Hn.next;var c=$r===null?qt.memoizedState:$r.next;if(c!==null)$r=c,Hn=o;else{if(o===null)throw qt.alternate===null?Error(r(467)):Error(r(310));Hn=o,o={memoizedState:Hn.memoizedState,baseState:Hn.baseState,baseQueue:Hn.baseQueue,queue:Hn.queue,next:null},$r===null?qt.memoizedState=$r=o:$r=$r.next=o}return $r}function vg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qp(o){var c=Kp;return Kp+=1,Zu===null&&(Zu=[]),o=Yj(Zu,o,c),c=qt,($r===null?c.memoizedState:$r.next)===null&&(c=c.alternate,L.H=c===null||c.memoizedState===null?VT:h0),o}function xg(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Qp(o);if(o.$$typeof===T)return ps(o)}throw Error(r(438,String(o)))}function r0(o){var c=null,d=qt.updateQueue;if(d!==null&&(c=d.memoCache),c==null){var h=qt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(c={data:h.data.map(function(x){return x.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),d===null&&(d=vg(),qt.updateQueue=d),d.memoCache=c,d=c.data[c.index],d===void 0)for(d=c.data[c.index]=Array(o),h=0;h<o;h++)d[h]=R;return c.index++,d}function va(o,c){return typeof c=="function"?c(o):c}function bg(o){var c=Ar();return s0(c,Hn,o)}function s0(o,c,d){var h=o.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=d;var x=o.baseQueue,w=h.pending;if(w!==null){if(x!==null){var _=x.next;x.next=w.next,w.next=_}c.baseQueue=x=w,h.pending=null}if(w=o.baseState,x===null)o.memoizedState=w;else{c=x.next;var V=_=null,Y=null,ge=c,Te=!1;do{var Le=ge.lane&-536870913;if(Le!==ge.lane?(fn&Le)===Le:(ya&Le)===Le){var ve=ge.revertLane;if(ve===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),Le===Uu&&(Te=!0);else if((ya&ve)===ve){ge=ge.next,ve===Uu&&(Te=!0);continue}else Le={lane:0,revertLane:ge.revertLane,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},Y===null?(V=Y=Le,_=w):Y=Y.next=Le,qt.lanes|=ve,cl|=ve;Le=ge.action,_c&&d(w,Le),w=ge.hasEagerState?ge.eagerState:d(w,Le)}else ve={lane:Le,revertLane:ge.revertLane,gesture:ge.gesture,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},Y===null?(V=Y=ve,_=w):Y=Y.next=ve,qt.lanes|=Le,cl|=Le;ge=ge.next}while(ge!==null&&ge!==c);if(Y===null?_=w:Y.next=V,!ri(w,o.memoizedState)&&(Nr=!0,Te&&(d=Vu,d!==null)))throw d;o.memoizedState=w,o.baseState=_,o.baseQueue=Y,h.lastRenderedState=w}return x===null&&(h.lanes=0),[o.memoizedState,h.dispatch]}function i0(o){var c=Ar(),d=c.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=o;var h=d.dispatch,x=d.pending,w=c.memoizedState;if(x!==null){d.pending=null;var _=x=x.next;do w=o(w,_.action),_=_.next;while(_!==x);ri(w,c.memoizedState)||(Nr=!0),c.memoizedState=w,c.baseQueue===null&&(c.baseState=w),d.lastRenderedState=w}return[w,h]}function cT(o,c,d){var h=qt,x=Ar(),w=mn;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=c();var _=!ri((Hn||x).memoizedState,d);if(_&&(x.memoizedState=d,Nr=!0),x=x.queue,l0(pT.bind(null,h,x,o),[o]),x.getSnapshot!==c||_||$r!==null&&$r.memoizedState.tag&1){if(h.flags|=2048,Ku(9,{destroy:void 0},dT.bind(null,h,x,d,c),null),Yn===null)throw Error(r(349));w||(ya&127)!==0||uT(h,c,d)}return d}function uT(o,c,d){o.flags|=16384,o={getSnapshot:c,value:d},c=qt.updateQueue,c===null?(c=vg(),qt.updateQueue=c,c.stores=[o]):(d=c.stores,d===null?c.stores=[o]:d.push(o))}function dT(o,c,d,h){c.value=d,c.getSnapshot=h,fT(c)&&hT(o)}function pT(o,c,d){return d(function(){fT(c)&&hT(o)})}function fT(o){var c=o.getSnapshot;o=o.value;try{var d=c();return!ri(o,d)}catch{return!0}}function hT(o){var c=jc(o,2);c!==null&&Zs(c,o,2)}function o0(o){var c=js();if(typeof o=="function"){var d=o;if(o=d(),_c){Ge(!0);try{d()}finally{Ge(!1)}}}return c.memoizedState=c.baseState=o,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:o},c}function mT(o,c,d,h){return o.baseState=d,s0(o,Hn,typeof h=="function"?h:va)}function RL(o,c,d,h,x){if(wg(o))throw Error(r(485));if(o=c.action,o!==null){var w={payload:x,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){w.listeners.push(_)}};L.T!==null?d(!0):w.isTransition=!1,h(w),d=c.pending,d===null?(w.next=c.pending=w,gT(c,w)):(w.next=d.next,c.pending=d.next=w)}}function gT(o,c){var d=c.action,h=c.payload,x=o.state;if(c.isTransition){var w=L.T,_={};L.T=_;try{var V=d(x,h),Y=L.S;Y!==null&&Y(_,V),yT(o,c,V)}catch(ge){a0(o,c,ge)}finally{w!==null&&_.types!==null&&(w.types=_.types),L.T=w}}else try{w=d(x,h),yT(o,c,w)}catch(ge){a0(o,c,ge)}}function yT(o,c,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(h){vT(o,c,h)},function(h){return a0(o,c,h)}):vT(o,c,d)}function vT(o,c,d){c.status="fulfilled",c.value=d,xT(c),o.state=d,c=o.pending,c!==null&&(d=c.next,d===c?o.pending=null:(d=d.next,c.next=d,gT(o,d)))}function a0(o,c,d){var h=o.pending;if(o.pending=null,h!==null){h=h.next;do c.status="rejected",c.reason=d,xT(c),c=c.next;while(c!==h)}o.action=null}function xT(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function bT(o,c){return c}function ST(o,c){if(mn){var d=Yn.formState;if(d!==null){e:{var h=qt;if(mn){if(ir){t:{for(var x=ir,w=Pi;x.nodeType!==8;){if(!w){x=null;break t}if(x=zi(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){ir=zi(x.nextSibling),h=x.data==="F!";break e}}el(h)}h=!1}h&&(c=d[0])}}return d=js(),d.memoizedState=d.baseState=c,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bT,lastRenderedState:c},d.queue=h,d=FT.bind(null,qt,h),h.dispatch=d,h=o0(!1),w=f0.bind(null,qt,!1,h.queue),h=js(),x={state:c,dispatch:null,action:o,pending:null},h.queue=x,d=RL.bind(null,qt,x,w,d),x.dispatch=d,h.memoizedState=o,[c,d,!1]}function CT(o){var c=Ar();return wT(c,Hn,o)}function wT(o,c,d){if(c=s0(o,c,bT)[0],o=bg(va)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var h=Qp(c)}catch(_){throw _===Hu?ug:_}else h=c;c=Ar();var x=c.queue,w=x.dispatch;return d!==c.memoizedState&&(qt.flags|=2048,Ku(9,{destroy:void 0},kL.bind(null,x,d),null)),[h,w,o]}function kL(o,c){o.action=c}function jT(o){var c=Ar(),d=Hn;if(d!==null)return wT(c,d,o);Ar(),c=c.memoizedState,d=Ar();var h=d.queue.dispatch;return d.memoizedState=o,[c,h,!1]}function Ku(o,c,d,h){return o={tag:o,create:d,deps:h,inst:c,next:null},c=qt.updateQueue,c===null&&(c=vg(),qt.updateQueue=c),d=c.lastEffect,d===null?c.lastEffect=o.next=o:(h=d.next,d.next=o,o.next=h,c.lastEffect=o),o}function TT(){return Ar().memoizedState}function Sg(o,c,d,h){var x=js();qt.flags|=o,x.memoizedState=Ku(1|c,{destroy:void 0},d,h===void 0?null:h)}function Cg(o,c,d,h){var x=Ar();h=h===void 0?null:h;var w=x.memoizedState.inst;Hn!==null&&h!==null&&Yb(h,Hn.memoizedState.deps)?x.memoizedState=Ku(c,w,d,h):(qt.flags|=o,x.memoizedState=Ku(1|c,w,d,h))}function DT(o,c){Sg(8390656,8,o,c)}function l0(o,c){Cg(2048,8,o,c)}function ML(o){qt.flags|=4;var c=qt.updateQueue;if(c===null)c=vg(),qt.updateQueue=c,c.events=[o];else{var d=c.events;d===null?c.events=[o]:d.push(o)}}function ET(o){var c=Ar().memoizedState;return ML({ref:c,nextImpl:o}),function(){if((Mn&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function RT(o,c){return Cg(4,2,o,c)}function kT(o,c){return Cg(4,4,o,c)}function MT(o,c){if(typeof c=="function"){o=o();var d=c(o);return function(){typeof d=="function"?d():c(null)}}if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function OT(o,c,d){d=d!=null?d.concat([o]):null,Cg(4,4,MT.bind(null,c,o),d)}function c0(){}function AT(o,c){var d=Ar();c=c===void 0?null:c;var h=d.memoizedState;return c!==null&&Yb(c,h[1])?h[0]:(d.memoizedState=[o,c],o)}function _T(o,c){var d=Ar();c=c===void 0?null:c;var h=d.memoizedState;if(c!==null&&Yb(c,h[1]))return h[0];if(h=o(),_c){Ge(!0);try{o()}finally{Ge(!1)}}return d.memoizedState=[h,c],h}function u0(o,c,d){return d===void 0||(ya&1073741824)!==0&&(fn&261930)===0?o.memoizedState=c:(o.memoizedState=d,o=ID(),qt.lanes|=o,cl|=o,d)}function IT(o,c,d,h){return ri(d,c)?d:qu.current!==null?(o=u0(o,d,h),ri(o,c)||(Nr=!0),o):(ya&42)===0||(ya&1073741824)!==0&&(fn&261930)===0?(Nr=!0,o.memoizedState=d):(o=ID(),qt.lanes|=o,cl|=o,c)}function PT(o,c,d,h,x){var w=W.p;W.p=w!==0&&8>w?w:8;var _=L.T,V={};L.T=V,f0(o,!1,c,d);try{var Y=x(),ge=L.S;if(ge!==null&&ge(V,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var Te=TL(Y,h);Jp(o,c,Te,ci(o))}else Jp(o,c,h,ci(o))}catch(Le){Jp(o,c,{then:function(){},status:"rejected",reason:Le},ci())}finally{W.p=w,_!==null&&V.types!==null&&(_.types=V.types),L.T=_}}function OL(){}function d0(o,c,d,h){if(o.tag!==5)throw Error(r(476));var x=LT(o).queue;PT(o,x,c,K,d===null?OL:function(){return zT(o),d(h)})}function LT(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:K},next:null};var d={};return c.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:d},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function zT(o){var c=LT(o);c.next===null&&(c=o.alternate.memoizedState),Jp(o,c.next.queue,{},ci())}function p0(){return ps(mf)}function $T(){return Ar().memoizedState}function NT(){return Ar().memoizedState}function AL(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var d=ci();o=rl(d);var h=sl(c,o,d);h!==null&&(Zs(h,c,d),qp(h,c,d)),c={cache:Bb()},o.payload=c;return}c=c.return}}function _L(o,c,d){var h=ci();d={lane:h,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},wg(o)?BT(c,d):(d=Mb(o,c,d,h),d!==null&&(Zs(d,o,h),UT(d,c,h)))}function FT(o,c,d){var h=ci();Jp(o,c,d,h)}function Jp(o,c,d,h){var x={lane:h,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(wg(o))BT(c,x);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=c.lastRenderedReducer,w!==null))try{var _=c.lastRenderedState,V=w(_,d);if(x.hasEagerState=!0,x.eagerState=V,ri(V,_))return rg(o,c,x,0),Yn===null&&ng(),!1}catch{}finally{}if(d=Mb(o,c,x,h),d!==null)return Zs(d,o,h),UT(d,c,h),!0}return!1}function f0(o,c,d,h){if(h={lane:2,revertLane:W0(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},wg(o)){if(c)throw Error(r(479))}else c=Mb(o,d,h,2),c!==null&&Zs(c,o,2)}function wg(o){var c=o.alternate;return o===qt||c!==null&&c===qt}function BT(o,c){Gu=gg=!0;var d=o.pending;d===null?c.next=c:(c.next=d.next,d.next=c),o.pending=c}function UT(o,c,d){if((d&4194048)!==0){var h=c.lanes;h&=o.pendingLanes,d|=h,c.lanes=d,Mt(o,d)}}var Yp={readContext:ps,use:xg,useCallback:xr,useContext:xr,useEffect:xr,useImperativeHandle:xr,useLayoutEffect:xr,useInsertionEffect:xr,useMemo:xr,useReducer:xr,useRef:xr,useState:xr,useDebugValue:xr,useDeferredValue:xr,useTransition:xr,useSyncExternalStore:xr,useId:xr,useHostTransitionStatus:xr,useFormState:xr,useActionState:xr,useOptimistic:xr,useMemoCache:xr,useCacheRefresh:xr};Yp.useEffectEvent=xr;var VT={readContext:ps,use:xg,useCallback:function(o,c){return js().memoizedState=[o,c===void 0?null:c],o},useContext:ps,useEffect:DT,useImperativeHandle:function(o,c,d){d=d!=null?d.concat([o]):null,Sg(4194308,4,MT.bind(null,c,o),d)},useLayoutEffect:function(o,c){return Sg(4194308,4,o,c)},useInsertionEffect:function(o,c){Sg(4,2,o,c)},useMemo:function(o,c){var d=js();c=c===void 0?null:c;var h=o();if(_c){Ge(!0);try{o()}finally{Ge(!1)}}return d.memoizedState=[h,c],h},useReducer:function(o,c,d){var h=js();if(d!==void 0){var x=d(c);if(_c){Ge(!0);try{d(c)}finally{Ge(!1)}}}else x=c;return h.memoizedState=h.baseState=x,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:x},h.queue=o,o=o.dispatch=_L.bind(null,qt,o),[h.memoizedState,o]},useRef:function(o){var c=js();return o={current:o},c.memoizedState=o},useState:function(o){o=o0(o);var c=o.queue,d=FT.bind(null,qt,c);return c.dispatch=d,[o.memoizedState,d]},useDebugValue:c0,useDeferredValue:function(o,c){var d=js();return u0(d,o,c)},useTransition:function(){var o=o0(!1);return o=PT.bind(null,qt,o.queue,!0,!1),js().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,d){var h=qt,x=js();if(mn){if(d===void 0)throw Error(r(407));d=d()}else{if(d=c(),Yn===null)throw Error(r(349));(fn&127)!==0||uT(h,c,d)}x.memoizedState=d;var w={value:d,getSnapshot:c};return x.queue=w,DT(pT.bind(null,h,w,o),[o]),h.flags|=2048,Ku(9,{destroy:void 0},dT.bind(null,h,w,d,c),null),d},useId:function(){var o=js(),c=Yn.identifierPrefix;if(mn){var d=Po,h=Io;d=(h&~(1<<32-gt(h)-1)).toString(32)+d,c="_"+c+"R_"+d,d=yg++,0<d&&(c+="H"+d.toString(32)),c+="_"}else d=DL++,c="_"+c+"r_"+d.toString(32)+"_";return o.memoizedState=c},useHostTransitionStatus:p0,useFormState:ST,useActionState:ST,useOptimistic:function(o){var c=js();c.memoizedState=c.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=d,c=f0.bind(null,qt,!0,d),d.dispatch=c,[o,c]},useMemoCache:r0,useCacheRefresh:function(){return js().memoizedState=AL.bind(null,qt)},useEffectEvent:function(o){var c=js(),d={impl:o};return c.memoizedState=d,function(){if((Mn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},h0={readContext:ps,use:xg,useCallback:AT,useContext:ps,useEffect:l0,useImperativeHandle:OT,useInsertionEffect:RT,useLayoutEffect:kT,useMemo:_T,useReducer:bg,useRef:TT,useState:function(){return bg(va)},useDebugValue:c0,useDeferredValue:function(o,c){var d=Ar();return IT(d,Hn.memoizedState,o,c)},useTransition:function(){var o=bg(va)[0],c=Ar().memoizedState;return[typeof o=="boolean"?o:Qp(o),c]},useSyncExternalStore:cT,useId:$T,useHostTransitionStatus:p0,useFormState:CT,useActionState:CT,useOptimistic:function(o,c){var d=Ar();return mT(d,Hn,o,c)},useMemoCache:r0,useCacheRefresh:NT};h0.useEffectEvent=ET;var HT={readContext:ps,use:xg,useCallback:AT,useContext:ps,useEffect:l0,useImperativeHandle:OT,useInsertionEffect:RT,useLayoutEffect:kT,useMemo:_T,useReducer:i0,useRef:TT,useState:function(){return i0(va)},useDebugValue:c0,useDeferredValue:function(o,c){var d=Ar();return Hn===null?u0(d,o,c):IT(d,Hn.memoizedState,o,c)},useTransition:function(){var o=i0(va)[0],c=Ar().memoizedState;return[typeof o=="boolean"?o:Qp(o),c]},useSyncExternalStore:cT,useId:$T,useHostTransitionStatus:p0,useFormState:jT,useActionState:jT,useOptimistic:function(o,c){var d=Ar();return Hn!==null?mT(d,Hn,o,c):(d.baseState=o,[o,d.queue.dispatch])},useMemoCache:r0,useCacheRefresh:NT};HT.useEffectEvent=ET;function m0(o,c,d,h){c=o.memoizedState,d=d(h,c),d=d==null?c:g({},c,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var g0={enqueueSetState:function(o,c,d){o=o._reactInternals;var h=ci(),x=rl(h);x.payload=c,d!=null&&(x.callback=d),c=sl(o,x,h),c!==null&&(Zs(c,o,h),qp(c,o,h))},enqueueReplaceState:function(o,c,d){o=o._reactInternals;var h=ci(),x=rl(h);x.tag=1,x.payload=c,d!=null&&(x.callback=d),c=sl(o,x,h),c!==null&&(Zs(c,o,h),qp(c,o,h))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var d=ci(),h=rl(d);h.tag=2,c!=null&&(h.callback=c),c=sl(o,h,d),c!==null&&(Zs(c,o,d),qp(c,o,d))}};function WT(o,c,d,h,x,w,_){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,w,_):c.prototype&&c.prototype.isPureReactComponent?!$p(d,h)||!$p(x,w):!0}function qT(o,c,d,h){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(d,h),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(d,h),c.state!==o&&g0.enqueueReplaceState(c,c.state,null)}function Ic(o,c){var d=c;if("ref"in c){d={};for(var h in c)h!=="ref"&&(d[h]=c[h])}if(o=o.defaultProps){d===c&&(d=g({},d));for(var x in o)d[x]===void 0&&(d[x]=o[x])}return d}function GT(o){tg(o)}function ZT(o){console.error(o)}function KT(o){tg(o)}function jg(o,c){try{var d=o.onUncaughtError;d(c.value,{componentStack:c.stack})}catch(h){setTimeout(function(){throw h})}}function QT(o,c,d){try{var h=o.onCaughtError;h(d.value,{componentStack:d.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function y0(o,c,d){return d=rl(d),d.tag=3,d.payload={element:null},d.callback=function(){jg(o,c)},d}function JT(o){return o=rl(o),o.tag=3,o}function YT(o,c,d,h){var x=d.type.getDerivedStateFromError;if(typeof x=="function"){var w=h.value;o.payload=function(){return x(w)},o.callback=function(){QT(c,d,h)}}var _=d.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(o.callback=function(){QT(c,d,h),typeof x!="function"&&(ul===null?ul=new Set([this]):ul.add(this));var V=h.stack;this.componentDidCatch(h.value,{componentStack:V!==null?V:""})})}function IL(o,c,d,h,x){if(d.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(c=d.alternate,c!==null&&Bu(c,d,x,!0),d=ii.current,d!==null){switch(d.tag){case 31:case 13:return Li===null?Lg():d.alternate===null&&br===0&&(br=3),d.flags&=-257,d.flags|=65536,d.lanes=x,h===dg?d.flags|=16384:(c=d.updateQueue,c===null?d.updateQueue=new Set([h]):c.add(h),U0(o,h,x)),!1;case 22:return d.flags|=65536,h===dg?d.flags|=16384:(c=d.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([h])},d.updateQueue=c):(d=c.retryQueue,d===null?c.retryQueue=new Set([h]):d.add(h)),U0(o,h,x)),!1}throw Error(r(435,d.tag))}return U0(o,h,x),Lg(),!1}if(mn)return c=ii.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=x,h!==Lb&&(o=Error(r(422),{cause:h}),Bp(Ai(o,d)))):(h!==Lb&&(c=Error(r(423),{cause:h}),Bp(Ai(c,d))),o=o.current.alternate,o.flags|=65536,x&=-x,o.lanes|=x,h=Ai(h,d),x=y0(o.stateNode,h,x),Gb(o,x),br!==4&&(br=2)),!1;var w=Error(r(520),{cause:h});if(w=Ai(w,d),af===null?af=[w]:af.push(w),br!==4&&(br=2),c===null)return!0;h=Ai(h,d),d=c;do{switch(d.tag){case 3:return d.flags|=65536,o=x&-x,d.lanes|=o,o=y0(d.stateNode,h,o),Gb(d,o),!1;case 1:if(c=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ul===null||!ul.has(w))))return d.flags|=65536,x&=-x,d.lanes|=x,x=JT(x),YT(x,o,d,h),Gb(d,x),!1}d=d.return}while(d!==null);return!1}var v0=Error(r(461)),Nr=!1;function fs(o,c,d,h){c.child=o===null?nT(c,null,d,h):Ac(c,o.child,d,h)}function XT(o,c,d,h,x){d=d.render;var w=c.ref;if("ref"in h){var _={};for(var V in h)V!=="ref"&&(_[V]=h[V])}else _=h;return Rc(c),h=Xb(o,c,d,_,w,x),V=e0(),o!==null&&!Nr?(t0(o,c,x),xa(o,c,x)):(mn&&V&&Ib(c),c.flags|=1,fs(o,c,h,x),c.child)}function eD(o,c,d,h,x){if(o===null){var w=d.type;return typeof w=="function"&&!Ob(w)&&w.defaultProps===void 0&&d.compare===null?(c.tag=15,c.type=w,tD(o,c,w,h,x)):(o=ig(d.type,null,h,c,c.mode,x),o.ref=c.ref,o.return=c,c.child=o)}if(w=o.child,!D0(o,x)){var _=w.memoizedProps;if(d=d.compare,d=d!==null?d:$p,d(_,h)&&o.ref===c.ref)return xa(o,c,x)}return c.flags|=1,o=fa(w,h),o.ref=c.ref,o.return=c,c.child=o}function tD(o,c,d,h,x){if(o!==null){var w=o.memoizedProps;if($p(w,h)&&o.ref===c.ref)if(Nr=!1,c.pendingProps=h=w,D0(o,x))(o.flags&131072)!==0&&(Nr=!0);else return c.lanes=o.lanes,xa(o,c,x)}return x0(o,c,d,h,x)}function nD(o,c,d,h){var x=h.children,w=o!==null?o.memoizedState:null;if(o===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((c.flags&128)!==0){if(w=w!==null?w.baseLanes|d:d,o!==null){for(h=c.child=o.child,x=0;h!==null;)x=x|h.lanes|h.childLanes,h=h.sibling;h=x&~w}else h=0,c.child=null;return rD(o,c,w,d,h)}if((d&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},o!==null&&cg(c,w!==null?w.cachePool:null),w!==null?iT(c,w):Kb(),oT(c);else return h=c.lanes=536870912,rD(o,c,w!==null?w.baseLanes|d:d,d,h)}else w!==null?(cg(c,w.cachePool),iT(c,w),ol(),c.memoizedState=null):(o!==null&&cg(c,null),Kb(),ol());return fs(o,c,x,d),c.child}function Xp(o,c){return o!==null&&o.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function rD(o,c,d,h,x){var w=Vb();return w=w===null?null:{parent:zr._currentValue,pool:w},c.memoizedState={baseLanes:d,cachePool:w},o!==null&&cg(c,null),Kb(),oT(c),o!==null&&Bu(o,c,h,!0),c.childLanes=x,null}function Tg(o,c){return c=Eg({mode:c.mode,children:c.children},o.mode),c.ref=o.ref,o.child=c,c.return=o,c}function sD(o,c,d){return Ac(c,o.child,null,d),o=Tg(c,c.pendingProps),o.flags|=2,oi(c),c.memoizedState=null,o}function PL(o,c,d){var h=c.pendingProps,x=(c.flags&128)!==0;if(c.flags&=-129,o===null){if(mn){if(h.mode==="hidden")return o=Tg(c,h),c.lanes=536870912,Xp(null,o);if(Jb(c),(o=ir)?(o=gE(o,Pi),o=o!==null&&o.data==="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Ya!==null?{id:Io,overflow:Po}:null,retryLane:536870912,hydrationErrors:null},d=Bj(o),d.return=c,c.child=d,ds=c,ir=null)):o=null,o===null)throw el(c);return c.lanes=536870912,null}return Tg(c,h)}var w=o.memoizedState;if(w!==null){var _=w.dehydrated;if(Jb(c),x)if(c.flags&256)c.flags&=-257,c=sD(o,c,d);else if(c.memoizedState!==null)c.child=o.child,c.flags|=128,c=null;else throw Error(r(558));else if(Nr||Bu(o,c,d,!1),x=(d&o.childLanes)!==0,Nr||x){if(h=Yn,h!==null&&(_=sn(h,d),_!==0&&_!==w.retryLane))throw w.retryLane=_,jc(o,_),Zs(h,o,_),v0;Lg(),c=sD(o,c,d)}else o=w.treeContext,ir=zi(_.nextSibling),ds=c,mn=!0,Xa=null,Pi=!1,o!==null&&Hj(c,o),c=Tg(c,h),c.flags|=4096;return c}return o=fa(o.child,{mode:h.mode,children:h.children}),o.ref=c.ref,c.child=o,o.return=c,o}function Dg(o,c){var d=c.ref;if(d===null)o!==null&&o.ref!==null&&(c.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(o===null||o.ref!==d)&&(c.flags|=4194816)}}function x0(o,c,d,h,x){return Rc(c),d=Xb(o,c,d,h,void 0,x),h=e0(),o!==null&&!Nr?(t0(o,c,x),xa(o,c,x)):(mn&&h&&Ib(c),c.flags|=1,fs(o,c,d,x),c.child)}function iD(o,c,d,h,x,w){return Rc(c),c.updateQueue=null,d=lT(c,h,d,x),aT(o),h=e0(),o!==null&&!Nr?(t0(o,c,w),xa(o,c,w)):(mn&&h&&Ib(c),c.flags|=1,fs(o,c,d,w),c.child)}function oD(o,c,d,h,x){if(Rc(c),c.stateNode===null){var w=zu,_=d.contextType;typeof _=="object"&&_!==null&&(w=ps(_)),w=new d(h,w),c.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=g0,c.stateNode=w,w._reactInternals=c,w=c.stateNode,w.props=h,w.state=c.memoizedState,w.refs={},Wb(c),_=d.contextType,w.context=typeof _=="object"&&_!==null?ps(_):zu,w.state=c.memoizedState,_=d.getDerivedStateFromProps,typeof _=="function"&&(m0(c,d,_,h),w.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(_=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),_!==w.state&&g0.enqueueReplaceState(w,w.state,null),Zp(c,h,w,x),Gp(),w.state=c.memoizedState),typeof w.componentDidMount=="function"&&(c.flags|=4194308),h=!0}else if(o===null){w=c.stateNode;var V=c.memoizedProps,Y=Ic(d,V);w.props=Y;var ge=w.context,Te=d.contextType;_=zu,typeof Te=="object"&&Te!==null&&(_=ps(Te));var Le=d.getDerivedStateFromProps;Te=typeof Le=="function"||typeof w.getSnapshotBeforeUpdate=="function",V=c.pendingProps!==V,Te||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(V||ge!==_)&&qT(c,w,h,_),nl=!1;var ve=c.memoizedState;w.state=ve,Zp(c,h,w,x),Gp(),ge=c.memoizedState,V||ve!==ge||nl?(typeof Le=="function"&&(m0(c,d,Le,h),ge=c.memoizedState),(Y=nl||WT(c,d,Y,h,ve,ge,_))?(Te||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(c.flags|=4194308)):(typeof w.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=h,c.memoizedState=ge),w.props=h,w.state=ge,w.context=_,h=Y):(typeof w.componentDidMount=="function"&&(c.flags|=4194308),h=!1)}else{w=c.stateNode,qb(o,c),_=c.memoizedProps,Te=Ic(d,_),w.props=Te,Le=c.pendingProps,ve=w.context,ge=d.contextType,Y=zu,typeof ge=="object"&&ge!==null&&(Y=ps(ge)),V=d.getDerivedStateFromProps,(ge=typeof V=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==Le||ve!==Y)&&qT(c,w,h,Y),nl=!1,ve=c.memoizedState,w.state=ve,Zp(c,h,w,x),Gp();var Se=c.memoizedState;_!==Le||ve!==Se||nl||o!==null&&o.dependencies!==null&&ag(o.dependencies)?(typeof V=="function"&&(m0(c,d,V,h),Se=c.memoizedState),(Te=nl||WT(c,d,Te,h,ve,Se,Y)||o!==null&&o.dependencies!==null&&ag(o.dependencies))?(ge||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,Se,Y),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,Se,Y)),typeof w.componentDidUpdate=="function"&&(c.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof w.componentDidUpdate!="function"||_===o.memoizedProps&&ve===o.memoizedState||(c.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===o.memoizedProps&&ve===o.memoizedState||(c.flags|=1024),c.memoizedProps=h,c.memoizedState=Se),w.props=h,w.state=Se,w.context=Y,h=Te):(typeof w.componentDidUpdate!="function"||_===o.memoizedProps&&ve===o.memoizedState||(c.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===o.memoizedProps&&ve===o.memoizedState||(c.flags|=1024),h=!1)}return w=h,Dg(o,c),h=(c.flags&128)!==0,w||h?(w=c.stateNode,d=h&&typeof d.getDerivedStateFromError!="function"?null:w.render(),c.flags|=1,o!==null&&h?(c.child=Ac(c,o.child,null,x),c.child=Ac(c,null,d,x)):fs(o,c,d,x),c.memoizedState=w.state,o=c.child):o=xa(o,c,x),o}function aD(o,c,d,h){return Dc(),c.flags|=256,fs(o,c,d,h),c.child}var b0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function S0(o){return{baseLanes:o,cachePool:Qj()}}function C0(o,c,d){return o=o!==null?o.childLanes&~d:0,c&&(o|=li),o}function lD(o,c,d){var h=c.pendingProps,x=!1,w=(c.flags&128)!==0,_;if((_=w)||(_=o!==null&&o.memoizedState===null?!1:(Or.current&2)!==0),_&&(x=!0,c.flags&=-129),_=(c.flags&32)!==0,c.flags&=-33,o===null){if(mn){if(x?il(c):ol(),(o=ir)?(o=gE(o,Pi),o=o!==null&&o.data!=="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Ya!==null?{id:Io,overflow:Po}:null,retryLane:536870912,hydrationErrors:null},d=Bj(o),d.return=c,c.child=d,ds=c,ir=null)):o=null,o===null)throw el(c);return sS(o)?c.lanes=32:c.lanes=536870912,null}var V=h.children;return h=h.fallback,x?(ol(),x=c.mode,V=Eg({mode:"hidden",children:V},x),h=Tc(h,x,d,null),V.return=c,h.return=c,V.sibling=h,c.child=V,h=c.child,h.memoizedState=S0(d),h.childLanes=C0(o,_,d),c.memoizedState=b0,Xp(null,h)):(il(c),w0(c,V))}var Y=o.memoizedState;if(Y!==null&&(V=Y.dehydrated,V!==null)){if(w)c.flags&256?(il(c),c.flags&=-257,c=j0(o,c,d)):c.memoizedState!==null?(ol(),c.child=o.child,c.flags|=128,c=null):(ol(),V=h.fallback,x=c.mode,h=Eg({mode:"visible",children:h.children},x),V=Tc(V,x,d,null),V.flags|=2,h.return=c,V.return=c,h.sibling=V,c.child=h,Ac(c,o.child,null,d),h=c.child,h.memoizedState=S0(d),h.childLanes=C0(o,_,d),c.memoizedState=b0,c=Xp(null,h));else if(il(c),sS(V)){if(_=V.nextSibling&&V.nextSibling.dataset,_)var ge=_.dgst;_=ge,h=Error(r(419)),h.stack="",h.digest=_,Bp({value:h,source:null,stack:null}),c=j0(o,c,d)}else if(Nr||Bu(o,c,d,!1),_=(d&o.childLanes)!==0,Nr||_){if(_=Yn,_!==null&&(h=sn(_,d),h!==0&&h!==Y.retryLane))throw Y.retryLane=h,jc(o,h),Zs(_,o,h),v0;rS(V)||Lg(),c=j0(o,c,d)}else rS(V)?(c.flags|=192,c.child=o.child,c=null):(o=Y.treeContext,ir=zi(V.nextSibling),ds=c,mn=!0,Xa=null,Pi=!1,o!==null&&Hj(c,o),c=w0(c,h.children),c.flags|=4096);return c}return x?(ol(),V=h.fallback,x=c.mode,Y=o.child,ge=Y.sibling,h=fa(Y,{mode:"hidden",children:h.children}),h.subtreeFlags=Y.subtreeFlags&65011712,ge!==null?V=fa(ge,V):(V=Tc(V,x,d,null),V.flags|=2),V.return=c,h.return=c,h.sibling=V,c.child=h,Xp(null,h),h=c.child,V=o.child.memoizedState,V===null?V=S0(d):(x=V.cachePool,x!==null?(Y=zr._currentValue,x=x.parent!==Y?{parent:Y,pool:Y}:x):x=Qj(),V={baseLanes:V.baseLanes|d,cachePool:x}),h.memoizedState=V,h.childLanes=C0(o,_,d),c.memoizedState=b0,Xp(o.child,h)):(il(c),d=o.child,o=d.sibling,d=fa(d,{mode:"visible",children:h.children}),d.return=c,d.sibling=null,o!==null&&(_=c.deletions,_===null?(c.deletions=[o],c.flags|=16):_.push(o)),c.child=d,c.memoizedState=null,d)}function w0(o,c){return c=Eg({mode:"visible",children:c},o.mode),c.return=o,o.child=c}function Eg(o,c){return o=si(22,o,null,c),o.lanes=0,o}function j0(o,c,d){return Ac(c,o.child,null,d),o=w0(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function cD(o,c,d){o.lanes|=c;var h=o.alternate;h!==null&&(h.lanes|=c),Nb(o.return,c,d)}function T0(o,c,d,h,x,w){var _=o.memoizedState;_===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:h,tail:d,tailMode:x,treeForkCount:w}:(_.isBackwards=c,_.rendering=null,_.renderingStartTime=0,_.last=h,_.tail=d,_.tailMode=x,_.treeForkCount=w)}function uD(o,c,d){var h=c.pendingProps,x=h.revealOrder,w=h.tail;h=h.children;var _=Or.current,V=(_&2)!==0;if(V?(_=_&1|2,c.flags|=128):_&=1,ie(Or,_),fs(o,c,h,d),h=mn?Fp:0,!V&&o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&cD(o,d,c);else if(o.tag===19)cD(o,d,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(x){case"forwards":for(d=c.child,x=null;d!==null;)o=d.alternate,o!==null&&mg(o)===null&&(x=d),d=d.sibling;d=x,d===null?(x=c.child,c.child=null):(x=d.sibling,d.sibling=null),T0(c,!1,x,d,w,h);break;case"backwards":case"unstable_legacy-backwards":for(d=null,x=c.child,c.child=null;x!==null;){if(o=x.alternate,o!==null&&mg(o)===null){c.child=x;break}o=x.sibling,x.sibling=d,d=x,x=o}T0(c,!0,d,null,w,h);break;case"together":T0(c,!1,null,null,void 0,h);break;default:c.memoizedState=null}return c.child}function xa(o,c,d){if(o!==null&&(c.dependencies=o.dependencies),cl|=c.lanes,(d&c.childLanes)===0)if(o!==null){if(Bu(o,c,d,!1),(d&c.childLanes)===0)return null}else return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,d=fa(o,o.pendingProps),c.child=d,d.return=c;o.sibling!==null;)o=o.sibling,d=d.sibling=fa(o,o.pendingProps),d.return=c;d.sibling=null}return c.child}function D0(o,c){return(o.lanes&c)!==0?!0:(o=o.dependencies,!!(o!==null&&ag(o)))}function LL(o,c,d){switch(c.tag){case 3:Pe(c,c.stateNode.containerInfo),tl(c,zr,o.memoizedState.cache),Dc();break;case 27:case 5:we(c);break;case 4:Pe(c,c.stateNode.containerInfo);break;case 10:tl(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Jb(c),null;break;case 13:var h=c.memoizedState;if(h!==null)return h.dehydrated!==null?(il(c),c.flags|=128,null):(d&c.child.childLanes)!==0?lD(o,c,d):(il(c),o=xa(o,c,d),o!==null?o.sibling:null);il(c);break;case 19:var x=(o.flags&128)!==0;if(h=(d&c.childLanes)!==0,h||(Bu(o,c,d,!1),h=(d&c.childLanes)!==0),x){if(h)return uD(o,c,d);c.flags|=128}if(x=c.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ie(Or,Or.current),h)break;return null;case 22:return c.lanes=0,nD(o,c,d,c.pendingProps);case 24:tl(c,zr,o.memoizedState.cache)}return xa(o,c,d)}function dD(o,c,d){if(o!==null)if(o.memoizedProps!==c.pendingProps)Nr=!0;else{if(!D0(o,d)&&(c.flags&128)===0)return Nr=!1,LL(o,c,d);Nr=(o.flags&131072)!==0}else Nr=!1,mn&&(c.flags&1048576)!==0&&Vj(c,Fp,c.index);switch(c.lanes=0,c.tag){case 16:e:{var h=c.pendingProps;if(o=Mc(c.elementType),c.type=o,typeof o=="function")Ob(o)?(h=Ic(o,h),c.tag=1,c=oD(null,c,o,h,d)):(c.tag=0,c=x0(null,c,o,h,d));else{if(o!=null){var x=o.$$typeof;if(x===E){c.tag=11,c=XT(null,c,o,h,d);break e}else if(x===O){c.tag=14,c=eD(null,c,o,h,d);break e}}throw c=H(o)||o,Error(r(306,c,""))}}return c;case 0:return x0(o,c,c.type,c.pendingProps,d);case 1:return h=c.type,x=Ic(h,c.pendingProps),oD(o,c,h,x,d);case 3:e:{if(Pe(c,c.stateNode.containerInfo),o===null)throw Error(r(387));h=c.pendingProps;var w=c.memoizedState;x=w.element,qb(o,c),Zp(c,h,null,d);var _=c.memoizedState;if(h=_.cache,tl(c,zr,h),h!==w.cache&&Fb(c,[zr],d,!0),Gp(),h=_.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:_.cache},c.updateQueue.baseState=w,c.memoizedState=w,c.flags&256){c=aD(o,c,h,d);break e}else if(h!==x){x=Ai(Error(r(424)),c),Bp(x),c=aD(o,c,h,d);break e}else{switch(o=c.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(ir=zi(o.firstChild),ds=c,mn=!0,Xa=null,Pi=!0,d=nT(c,null,h,d),c.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Dc(),h===x){c=xa(o,c,d);break e}fs(o,c,h,d)}c=c.child}return c;case 26:return Dg(o,c),o===null?(d=CE(c.type,null,c.pendingProps,null))?c.memoizedState=d:mn||(d=c.type,o=c.pendingProps,h=Vg(fe.current).createElement(d),h[pn]=c,h[sr]=o,hs(h,d,o),Mr(h),c.stateNode=h):c.memoizedState=CE(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return we(c),o===null&&mn&&(h=c.stateNode=xE(c.type,c.pendingProps,fe.current),ds=c,Pi=!0,x=ir,hl(c.type)?(iS=x,ir=zi(h.firstChild)):ir=x),fs(o,c,c.pendingProps.children,d),Dg(o,c),o===null&&(c.flags|=4194304),c.child;case 5:return o===null&&mn&&((x=h=ir)&&(h=pz(h,c.type,c.pendingProps,Pi),h!==null?(c.stateNode=h,ds=c,ir=zi(h.firstChild),Pi=!1,x=!0):x=!1),x||el(c)),we(c),x=c.type,w=c.pendingProps,_=o!==null?o.memoizedProps:null,h=w.children,eS(x,w)?h=null:_!==null&&eS(x,_)&&(c.flags|=32),c.memoizedState!==null&&(x=Xb(o,c,EL,null,null,d),mf._currentValue=x),Dg(o,c),fs(o,c,h,d),c.child;case 6:return o===null&&mn&&((o=d=ir)&&(d=fz(d,c.pendingProps,Pi),d!==null?(c.stateNode=d,ds=c,ir=null,o=!0):o=!1),o||el(c)),null;case 13:return lD(o,c,d);case 4:return Pe(c,c.stateNode.containerInfo),h=c.pendingProps,o===null?c.child=Ac(c,null,h,d):fs(o,c,h,d),c.child;case 11:return XT(o,c,c.type,c.pendingProps,d);case 7:return fs(o,c,c.pendingProps,d),c.child;case 8:return fs(o,c,c.pendingProps.children,d),c.child;case 12:return fs(o,c,c.pendingProps.children,d),c.child;case 10:return h=c.pendingProps,tl(c,c.type,h.value),fs(o,c,h.children,d),c.child;case 9:return x=c.type._context,h=c.pendingProps.children,Rc(c),x=ps(x),h=h(x),c.flags|=1,fs(o,c,h,d),c.child;case 14:return eD(o,c,c.type,c.pendingProps,d);case 15:return tD(o,c,c.type,c.pendingProps,d);case 19:return uD(o,c,d);case 31:return PL(o,c,d);case 22:return nD(o,c,d,c.pendingProps);case 24:return Rc(c),h=ps(zr),o===null?(x=Vb(),x===null&&(x=Yn,w=Bb(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=d),x=w),c.memoizedState={parent:h,cache:x},Wb(c),tl(c,zr,x)):((o.lanes&d)!==0&&(qb(o,c),Zp(c,null,null,d),Gp()),x=o.memoizedState,w=c.memoizedState,x.parent!==h?(x={parent:h,cache:h},c.memoizedState=x,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=x),tl(c,zr,h)):(h=w.cache,tl(c,zr,h),h!==x.cache&&Fb(c,[zr],d,!0))),fs(o,c,c.pendingProps.children,d),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function ba(o){o.flags|=4}function E0(o,c,d,h,x){if((c=(o.mode&32)!==0)&&(c=!1),c){if(o.flags|=16777216,(x&335544128)===x)if(o.stateNode.complete)o.flags|=8192;else if($D())o.flags|=8192;else throw Oc=dg,Hb}else o.flags&=-16777217}function pD(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!EE(c))if($D())o.flags|=8192;else throw Oc=dg,Hb}function Rg(o,c){c!==null&&(o.flags|=4),o.flags&16384&&(c=o.tag!==22?ht():536870912,o.lanes|=c,Xu|=c)}function ef(o,c){if(!mn)switch(o.tailMode){case"hidden":c=o.tail;for(var d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var h=null;d!==null;)d.alternate!==null&&(h=d),d=d.sibling;h===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function or(o){var c=o.alternate!==null&&o.alternate.child===o.child,d=0,h=0;if(c)for(var x=o.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=o,x=x.sibling;else for(x=o.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=o,x=x.sibling;return o.subtreeFlags|=h,o.childLanes=d,c}function zL(o,c,d){var h=c.pendingProps;switch(Pb(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return or(c),null;case 1:return or(c),null;case 3:return d=c.stateNode,h=null,o!==null&&(h=o.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),ga(zr),$e(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(Fu(c)?ba(c):o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,zb())),or(c),null;case 26:var x=c.type,w=c.memoizedState;return o===null?(ba(c),w!==null?(or(c),pD(c,w)):(or(c),E0(c,x,null,h,d))):w?w!==o.memoizedState?(ba(c),or(c),pD(c,w)):(or(c),c.flags&=-16777217):(o=o.memoizedProps,o!==h&&ba(c),or(c),E0(c,x,o,h,d)),null;case 27:if(be(c),d=fe.current,x=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==h&&ba(c);else{if(!h){if(c.stateNode===null)throw Error(r(166));return or(c),null}o=te.current,Fu(c)?Wj(c):(o=xE(x,h,d),c.stateNode=o,ba(c))}return or(c),null;case 5:if(be(c),x=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==h&&ba(c);else{if(!h){if(c.stateNode===null)throw Error(r(166));return or(c),null}if(w=te.current,Fu(c))Wj(c);else{var _=Vg(fe.current);switch(w){case 1:w=_.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:w=_.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":w=_.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":w=_.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":w=_.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof h.is=="string"?_.createElement("select",{is:h.is}):_.createElement("select"),h.multiple?w.multiple=!0:h.size&&(w.size=h.size);break;default:w=typeof h.is=="string"?_.createElement(x,{is:h.is}):_.createElement(x)}}w[pn]=c,w[sr]=h;e:for(_=c.child;_!==null;){if(_.tag===5||_.tag===6)w.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===c)break e;for(;_.sibling===null;){if(_.return===null||_.return===c)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}c.stateNode=w;e:switch(hs(w,x,h),x){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&ba(c)}}return or(c),E0(c,c.type,o===null?null:o.memoizedProps,c.pendingProps,d),null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==h&&ba(c);else{if(typeof h!="string"&&c.stateNode===null)throw Error(r(166));if(o=fe.current,Fu(c)){if(o=c.stateNode,d=c.memoizedProps,h=null,x=ds,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}o[pn]=c,o=!!(o.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||lE(o.nodeValue,d)),o||el(c,!0)}else o=Vg(o).createTextNode(h),o[pn]=c,c.stateNode=o}return or(c),null;case 31:if(d=c.memoizedState,o===null||o.memoizedState!==null){if(h=Fu(c),d!==null){if(o===null){if(!h)throw Error(r(318));if(o=c.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[pn]=c}else Dc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;or(c),o=!1}else d=zb(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return c.flags&256?(oi(c),c):(oi(c),null);if((c.flags&128)!==0)throw Error(r(558))}return or(c),null;case 13:if(h=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(x=Fu(c),h!==null&&h.dehydrated!==null){if(o===null){if(!x)throw Error(r(318));if(x=c.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[pn]=c}else Dc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;or(c),x=!1}else x=zb(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=x),x=!0;if(!x)return c.flags&256?(oi(c),c):(oi(c),null)}return oi(c),(c.flags&128)!==0?(c.lanes=d,c):(d=h!==null,o=o!==null&&o.memoizedState!==null,d&&(h=c.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool),w=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==x&&(h.flags|=2048)),d!==o&&d&&(c.child.flags|=8192),Rg(c,c.updateQueue),or(c),null);case 4:return $e(),o===null&&K0(c.stateNode.containerInfo),or(c),null;case 10:return ga(c.type),or(c),null;case 19:if(J(Or),h=c.memoizedState,h===null)return or(c),null;if(x=(c.flags&128)!==0,w=h.rendering,w===null)if(x)ef(h,!1);else{if(br!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(w=mg(o),w!==null){for(c.flags|=128,ef(h,!1),o=w.updateQueue,c.updateQueue=o,Rg(c,o),c.subtreeFlags=0,o=d,d=c.child;d!==null;)Fj(d,o),d=d.sibling;return ie(Or,Or.current&1|2),mn&&ha(c,h.treeForkCount),c.child}o=o.sibling}h.tail!==null&&xe()>_g&&(c.flags|=128,x=!0,ef(h,!1),c.lanes=4194304)}else{if(!x)if(o=mg(w),o!==null){if(c.flags|=128,x=!0,o=o.updateQueue,c.updateQueue=o,Rg(c,o),ef(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!mn)return or(c),null}else 2*xe()-h.renderingStartTime>_g&&d!==536870912&&(c.flags|=128,x=!0,ef(h,!1),c.lanes=4194304);h.isBackwards?(w.sibling=c.child,c.child=w):(o=h.last,o!==null?o.sibling=w:c.child=w,h.last=w)}return h.tail!==null?(o=h.tail,h.rendering=o,h.tail=o.sibling,h.renderingStartTime=xe(),o.sibling=null,d=Or.current,ie(Or,x?d&1|2:d&1),mn&&ha(c,h.treeForkCount),o):(or(c),null);case 22:case 23:return oi(c),Qb(),h=c.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(c.flags|=8192):h&&(c.flags|=8192),h?(d&536870912)!==0&&(c.flags&128)===0&&(or(c),c.subtreeFlags&6&&(c.flags|=8192)):or(c),d=c.updateQueue,d!==null&&Rg(c,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),h=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(h=c.memoizedState.cachePool.pool),h!==d&&(c.flags|=2048),o!==null&&J(kc),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),c.memoizedState.cache!==d&&(c.flags|=2048),ga(zr),or(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function $L(o,c){switch(Pb(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return ga(zr),$e(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return be(c),null;case 31:if(c.memoizedState!==null){if(oi(c),c.alternate===null)throw Error(r(340));Dc()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 13:if(oi(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Dc()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return J(Or),null;case 4:return $e(),null;case 10:return ga(c.type),null;case 22:case 23:return oi(c),Qb(),o!==null&&J(kc),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return ga(zr),null;case 25:return null;default:return null}}function fD(o,c){switch(Pb(c),c.tag){case 3:ga(zr),$e();break;case 26:case 27:case 5:be(c);break;case 4:$e();break;case 31:c.memoizedState!==null&&oi(c);break;case 13:oi(c);break;case 19:J(Or);break;case 10:ga(c.type);break;case 22:case 23:oi(c),Qb(),o!==null&&J(kc);break;case 24:ga(zr)}}function tf(o,c){try{var d=c.updateQueue,h=d!==null?d.lastEffect:null;if(h!==null){var x=h.next;d=x;do{if((d.tag&o)===o){h=void 0;var w=d.create,_=d.inst;h=w(),_.destroy=h}d=d.next}while(d!==x)}}catch(V){Fn(c,c.return,V)}}function al(o,c,d){try{var h=c.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var w=x.next;h=w;do{if((h.tag&o)===o){var _=h.inst,V=_.destroy;if(V!==void 0){_.destroy=void 0,x=c;var Y=d,ge=V;try{ge()}catch(Te){Fn(x,Y,Te)}}}h=h.next}while(h!==w)}}catch(Te){Fn(c,c.return,Te)}}function hD(o){var c=o.updateQueue;if(c!==null){var d=o.stateNode;try{sT(c,d)}catch(h){Fn(o,o.return,h)}}}function mD(o,c,d){d.props=Ic(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(h){Fn(o,c,h)}}function nf(o,c){try{var d=o.ref;if(d!==null){switch(o.tag){case 26:case 27:case 5:var h=o.stateNode;break;case 30:h=o.stateNode;break;default:h=o.stateNode}typeof d=="function"?o.refCleanup=d(h):d.current=h}}catch(x){Fn(o,c,x)}}function Lo(o,c){var d=o.ref,h=o.refCleanup;if(d!==null)if(typeof h=="function")try{h()}catch(x){Fn(o,c,x)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(x){Fn(o,c,x)}else d.current=null}function gD(o){var c=o.type,d=o.memoizedProps,h=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":d.autoFocus&&h.focus();break e;case"img":d.src?h.src=d.src:d.srcSet&&(h.srcset=d.srcSet)}}catch(x){Fn(o,o.return,x)}}function R0(o,c,d){try{var h=o.stateNode;oz(h,o.type,d,c),h[sr]=c}catch(x){Fn(o,o.return,x)}}function yD(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&hl(o.type)||o.tag===4}function k0(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||yD(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&hl(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function M0(o,c,d){var h=o.tag;if(h===5||h===6)o=o.stateNode,c?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(o,c):(c=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,c.appendChild(o),d=d._reactRootContainer,d!=null||c.onclick!==null||(c.onclick=da));else if(h!==4&&(h===27&&hl(o.type)&&(d=o.stateNode,c=null),o=o.child,o!==null))for(M0(o,c,d),o=o.sibling;o!==null;)M0(o,c,d),o=o.sibling}function kg(o,c,d){var h=o.tag;if(h===5||h===6)o=o.stateNode,c?d.insertBefore(o,c):d.appendChild(o);else if(h!==4&&(h===27&&hl(o.type)&&(d=o.stateNode),o=o.child,o!==null))for(kg(o,c,d),o=o.sibling;o!==null;)kg(o,c,d),o=o.sibling}function vD(o){var c=o.stateNode,d=o.memoizedProps;try{for(var h=o.type,x=c.attributes;x.length;)c.removeAttributeNode(x[0]);hs(c,h,d),c[pn]=o,c[sr]=d}catch(w){Fn(o,o.return,w)}}var Sa=!1,Fr=!1,O0=!1,xD=typeof WeakSet=="function"?WeakSet:Set,ns=null;function NL(o,c){if(o=o.containerInfo,Y0=Qg,o=Oj(o),jb(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var h=d.getSelection&&d.getSelection();if(h&&h.rangeCount!==0){d=h.anchorNode;var x=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var _=0,V=-1,Y=-1,ge=0,Te=0,Le=o,ve=null;t:for(;;){for(var Se;Le!==d||x!==0&&Le.nodeType!==3||(V=_+x),Le!==w||h!==0&&Le.nodeType!==3||(Y=_+h),Le.nodeType===3&&(_+=Le.nodeValue.length),(Se=Le.firstChild)!==null;)ve=Le,Le=Se;for(;;){if(Le===o)break t;if(ve===d&&++ge===x&&(V=_),ve===w&&++Te===h&&(Y=_),(Se=Le.nextSibling)!==null)break;Le=ve,ve=Le.parentNode}Le=Se}d=V===-1||Y===-1?null:{start:V,end:Y}}else d=null}d=d||{start:0,end:0}}else d=null;for(X0={focusedElem:o,selectionRange:d},Qg=!1,ns=c;ns!==null;)if(c=ns,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,ns=o;else for(;ns!==null;){switch(c=ns,w=c.alternate,o=c.flags,c.tag){case 0:if((o&4)!==0&&(o=c.updateQueue,o=o!==null?o.events:null,o!==null))for(d=0;d<o.length;d++)x=o[d],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&w!==null){o=void 0,d=c,x=w.memoizedProps,w=w.memoizedState,h=d.stateNode;try{var mt=Ic(d.type,x);o=h.getSnapshotBeforeUpdate(mt,w),h.__reactInternalSnapshotBeforeUpdate=o}catch(Ot){Fn(d,d.return,Ot)}}break;case 3:if((o&1024)!==0){if(o=c.stateNode.containerInfo,d=o.nodeType,d===9)nS(o);else if(d===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":nS(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=c.sibling,o!==null){o.return=c.return,ns=o;break}ns=c.return}}function bD(o,c,d){var h=d.flags;switch(d.tag){case 0:case 11:case 15:wa(o,d),h&4&&tf(5,d);break;case 1:if(wa(o,d),h&4)if(o=d.stateNode,c===null)try{o.componentDidMount()}catch(_){Fn(d,d.return,_)}else{var x=Ic(d.type,c.memoizedProps);c=c.memoizedState;try{o.componentDidUpdate(x,c,o.__reactInternalSnapshotBeforeUpdate)}catch(_){Fn(d,d.return,_)}}h&64&&hD(d),h&512&&nf(d,d.return);break;case 3:if(wa(o,d),h&64&&(o=d.updateQueue,o!==null)){if(c=null,d.child!==null)switch(d.child.tag){case 27:case 5:c=d.child.stateNode;break;case 1:c=d.child.stateNode}try{sT(o,c)}catch(_){Fn(d,d.return,_)}}break;case 27:c===null&&h&4&&vD(d);case 26:case 5:wa(o,d),c===null&&h&4&&gD(d),h&512&&nf(d,d.return);break;case 12:wa(o,d);break;case 31:wa(o,d),h&4&&wD(o,d);break;case 13:wa(o,d),h&4&&jD(o,d),h&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=ZL.bind(null,d),hz(o,d))));break;case 22:if(h=d.memoizedState!==null||Sa,!h){c=c!==null&&c.memoizedState!==null||Fr,x=Sa;var w=Fr;Sa=h,(Fr=c)&&!w?ja(o,d,(d.subtreeFlags&8772)!==0):wa(o,d),Sa=x,Fr=w}break;case 30:break;default:wa(o,d)}}function SD(o){var c=o.alternate;c!==null&&(o.alternate=null,SD(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&kn(c)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var fr=null,Hs=!1;function Ca(o,c,d){for(d=d.child;d!==null;)CD(o,c,d),d=d.sibling}function CD(o,c,d){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(vt,d)}catch{}switch(d.tag){case 26:Fr||Lo(d,c),Ca(o,c,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Fr||Lo(d,c);var h=fr,x=Hs;hl(d.type)&&(fr=d.stateNode,Hs=!1),Ca(o,c,d),pf(d.stateNode),fr=h,Hs=x;break;case 5:Fr||Lo(d,c);case 6:if(h=fr,x=Hs,fr=null,Ca(o,c,d),fr=h,Hs=x,fr!==null)if(Hs)try{(fr.nodeType===9?fr.body:fr.nodeName==="HTML"?fr.ownerDocument.body:fr).removeChild(d.stateNode)}catch(w){Fn(d,c,w)}else try{fr.removeChild(d.stateNode)}catch(w){Fn(d,c,w)}break;case 18:fr!==null&&(Hs?(o=fr,hE(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),ad(o)):hE(fr,d.stateNode));break;case 4:h=fr,x=Hs,fr=d.stateNode.containerInfo,Hs=!0,Ca(o,c,d),fr=h,Hs=x;break;case 0:case 11:case 14:case 15:al(2,d,c),Fr||al(4,d,c),Ca(o,c,d);break;case 1:Fr||(Lo(d,c),h=d.stateNode,typeof h.componentWillUnmount=="function"&&mD(d,c,h)),Ca(o,c,d);break;case 21:Ca(o,c,d);break;case 22:Fr=(h=Fr)||d.memoizedState!==null,Ca(o,c,d),Fr=h;break;default:Ca(o,c,d)}}function wD(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{ad(o)}catch(d){Fn(c,c.return,d)}}}function jD(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{ad(o)}catch(d){Fn(c,c.return,d)}}function FL(o){switch(o.tag){case 31:case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new xD),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new xD),c;default:throw Error(r(435,o.tag))}}function Mg(o,c){var d=FL(o);c.forEach(function(h){if(!d.has(h)){d.add(h);var x=KL.bind(null,o,h);h.then(x,x)}})}function Ws(o,c){var d=c.deletions;if(d!==null)for(var h=0;h<d.length;h++){var x=d[h],w=o,_=c,V=_;e:for(;V!==null;){switch(V.tag){case 27:if(hl(V.type)){fr=V.stateNode,Hs=!1;break e}break;case 5:fr=V.stateNode,Hs=!1;break e;case 3:case 4:fr=V.stateNode.containerInfo,Hs=!0;break e}V=V.return}if(fr===null)throw Error(r(160));CD(w,_,x),fr=null,Hs=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)TD(c,o),c=c.sibling}var lo=null;function TD(o,c){var d=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Ws(c,o),qs(o),h&4&&(al(3,o,o.return),tf(3,o),al(5,o,o.return));break;case 1:Ws(c,o),qs(o),h&512&&(Fr||d===null||Lo(d,d.return)),h&64&&Sa&&(o=o.updateQueue,o!==null&&(h=o.callbacks,h!==null&&(d=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=d===null?h:d.concat(h))));break;case 26:var x=lo;if(Ws(c,o),qs(o),h&512&&(Fr||d===null||Lo(d,d.return)),h&4){var w=d!==null?d.memoizedState:null;if(h=o.memoizedState,d===null)if(h===null)if(o.stateNode===null){e:{h=o.type,d=o.memoizedProps,x=x.ownerDocument||x;t:switch(h){case"title":w=x.getElementsByTagName("title")[0],(!w||w[Wt]||w[pn]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(h),x.head.insertBefore(w,x.querySelector("head > title"))),hs(w,h,d),w[pn]=o,Mr(w),h=w;break e;case"link":var _=TE("link","href",x).get(h+(d.href||""));if(_){for(var V=0;V<_.length;V++)if(w=_[V],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){_.splice(V,1);break t}}w=x.createElement(h),hs(w,h,d),x.head.appendChild(w);break;case"meta":if(_=TE("meta","content",x).get(h+(d.content||""))){for(V=0;V<_.length;V++)if(w=_[V],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){_.splice(V,1);break t}}w=x.createElement(h),hs(w,h,d),x.head.appendChild(w);break;default:throw Error(r(468,h))}w[pn]=o,Mr(w),h=w}o.stateNode=h}else DE(x,o.type,o.stateNode);else o.stateNode=jE(x,h,o.memoizedProps);else w!==h?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,h===null?DE(x,o.type,o.stateNode):jE(x,h,o.memoizedProps)):h===null&&o.stateNode!==null&&R0(o,o.memoizedProps,d.memoizedProps)}break;case 27:Ws(c,o),qs(o),h&512&&(Fr||d===null||Lo(d,d.return)),d!==null&&h&4&&R0(o,o.memoizedProps,d.memoizedProps);break;case 5:if(Ws(c,o),qs(o),h&512&&(Fr||d===null||Lo(d,d.return)),o.flags&32){x=o.stateNode;try{Mu(x,"")}catch(mt){Fn(o,o.return,mt)}}h&4&&o.stateNode!=null&&(x=o.memoizedProps,R0(o,x,d!==null?d.memoizedProps:x)),h&1024&&(O0=!0);break;case 6:if(Ws(c,o),qs(o),h&4){if(o.stateNode===null)throw Error(r(162));h=o.memoizedProps,d=o.stateNode;try{d.nodeValue=h}catch(mt){Fn(o,o.return,mt)}}break;case 3:if(qg=null,x=lo,lo=Hg(c.containerInfo),Ws(c,o),lo=x,qs(o),h&4&&d!==null&&d.memoizedState.isDehydrated)try{ad(c.containerInfo)}catch(mt){Fn(o,o.return,mt)}O0&&(O0=!1,DD(o));break;case 4:h=lo,lo=Hg(o.stateNode.containerInfo),Ws(c,o),qs(o),lo=h;break;case 12:Ws(c,o),qs(o);break;case 31:Ws(c,o),qs(o),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Mg(o,h)));break;case 13:Ws(c,o),qs(o),o.child.flags&8192&&o.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Ag=xe()),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Mg(o,h)));break;case 22:x=o.memoizedState!==null;var Y=d!==null&&d.memoizedState!==null,ge=Sa,Te=Fr;if(Sa=ge||x,Fr=Te||Y,Ws(c,o),Fr=Te,Sa=ge,qs(o),h&8192)e:for(c=o.stateNode,c._visibility=x?c._visibility&-2:c._visibility|1,x&&(d===null||Y||Sa||Fr||Pc(o)),d=null,c=o;;){if(c.tag===5||c.tag===26){if(d===null){Y=d=c;try{if(w=Y.stateNode,x)_=w.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{V=Y.stateNode;var Le=Y.memoizedProps.style,ve=Le!=null&&Le.hasOwnProperty("display")?Le.display:null;V.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(mt){Fn(Y,Y.return,mt)}}}else if(c.tag===6){if(d===null){Y=c;try{Y.stateNode.nodeValue=x?"":Y.memoizedProps}catch(mt){Fn(Y,Y.return,mt)}}}else if(c.tag===18){if(d===null){Y=c;try{var Se=Y.stateNode;x?mE(Se,!0):mE(Y.stateNode,!1)}catch(mt){Fn(Y,Y.return,mt)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===o)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}h&4&&(h=o.updateQueue,h!==null&&(d=h.retryQueue,d!==null&&(h.retryQueue=null,Mg(o,d))));break;case 19:Ws(c,o),qs(o),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Mg(o,h)));break;case 30:break;case 21:break;default:Ws(c,o),qs(o)}}function qs(o){var c=o.flags;if(c&2){try{for(var d,h=o.return;h!==null;){if(yD(h)){d=h;break}h=h.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var x=d.stateNode,w=k0(o);kg(o,w,x);break;case 5:var _=d.stateNode;d.flags&32&&(Mu(_,""),d.flags&=-33);var V=k0(o);kg(o,V,_);break;case 3:case 4:var Y=d.stateNode.containerInfo,ge=k0(o);M0(o,ge,Y);break;default:throw Error(r(161))}}catch(Te){Fn(o,o.return,Te)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function DD(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;DD(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function wa(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)bD(o,c.alternate,c),c=c.sibling}function Pc(o){for(o=o.child;o!==null;){var c=o;switch(c.tag){case 0:case 11:case 14:case 15:al(4,c,c.return),Pc(c);break;case 1:Lo(c,c.return);var d=c.stateNode;typeof d.componentWillUnmount=="function"&&mD(c,c.return,d),Pc(c);break;case 27:pf(c.stateNode);case 26:case 5:Lo(c,c.return),Pc(c);break;case 22:c.memoizedState===null&&Pc(c);break;case 30:Pc(c);break;default:Pc(c)}o=o.sibling}}function ja(o,c,d){for(d=d&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var h=c.alternate,x=o,w=c,_=w.flags;switch(w.tag){case 0:case 11:case 15:ja(x,w,d),tf(4,w);break;case 1:if(ja(x,w,d),h=w,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ge){Fn(h,h.return,ge)}if(h=w,x=h.updateQueue,x!==null){var V=h.stateNode;try{var Y=x.shared.hiddenCallbacks;if(Y!==null)for(x.shared.hiddenCallbacks=null,x=0;x<Y.length;x++)rT(Y[x],V)}catch(ge){Fn(h,h.return,ge)}}d&&_&64&&hD(w),nf(w,w.return);break;case 27:vD(w);case 26:case 5:ja(x,w,d),d&&h===null&&_&4&&gD(w),nf(w,w.return);break;case 12:ja(x,w,d);break;case 31:ja(x,w,d),d&&_&4&&wD(x,w);break;case 13:ja(x,w,d),d&&_&4&&jD(x,w);break;case 22:w.memoizedState===null&&ja(x,w,d),nf(w,w.return);break;case 30:break;default:ja(x,w,d)}c=c.sibling}}function A0(o,c){var d=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),o=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(o=c.memoizedState.cachePool.pool),o!==d&&(o!=null&&o.refCount++,d!=null&&Up(d))}function _0(o,c){o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Up(o))}function co(o,c,d,h){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)ED(o,c,d,h),c=c.sibling}function ED(o,c,d,h){var x=c.flags;switch(c.tag){case 0:case 11:case 15:co(o,c,d,h),x&2048&&tf(9,c);break;case 1:co(o,c,d,h);break;case 3:co(o,c,d,h),x&2048&&(o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Up(o)));break;case 12:if(x&2048){co(o,c,d,h),o=c.stateNode;try{var w=c.memoizedProps,_=w.id,V=w.onPostCommit;typeof V=="function"&&V(_,c.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Y){Fn(c,c.return,Y)}}else co(o,c,d,h);break;case 31:co(o,c,d,h);break;case 13:co(o,c,d,h);break;case 23:break;case 22:w=c.stateNode,_=c.alternate,c.memoizedState!==null?w._visibility&2?co(o,c,d,h):rf(o,c):w._visibility&2?co(o,c,d,h):(w._visibility|=2,Qu(o,c,d,h,(c.subtreeFlags&10256)!==0||!1)),x&2048&&A0(_,c);break;case 24:co(o,c,d,h),x&2048&&_0(c.alternate,c);break;default:co(o,c,d,h)}}function Qu(o,c,d,h,x){for(x=x&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var w=o,_=c,V=d,Y=h,ge=_.flags;switch(_.tag){case 0:case 11:case 15:Qu(w,_,V,Y,x),tf(8,_);break;case 23:break;case 22:var Te=_.stateNode;_.memoizedState!==null?Te._visibility&2?Qu(w,_,V,Y,x):rf(w,_):(Te._visibility|=2,Qu(w,_,V,Y,x)),x&&ge&2048&&A0(_.alternate,_);break;case 24:Qu(w,_,V,Y,x),x&&ge&2048&&_0(_.alternate,_);break;default:Qu(w,_,V,Y,x)}c=c.sibling}}function rf(o,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var d=o,h=c,x=h.flags;switch(h.tag){case 22:rf(d,h),x&2048&&A0(h.alternate,h);break;case 24:rf(d,h),x&2048&&_0(h.alternate,h);break;default:rf(d,h)}c=c.sibling}}var sf=8192;function Ju(o,c,d){if(o.subtreeFlags&sf)for(o=o.child;o!==null;)RD(o,c,d),o=o.sibling}function RD(o,c,d){switch(o.tag){case 26:Ju(o,c,d),o.flags&sf&&o.memoizedState!==null&&Dz(d,lo,o.memoizedState,o.memoizedProps);break;case 5:Ju(o,c,d);break;case 3:case 4:var h=lo;lo=Hg(o.stateNode.containerInfo),Ju(o,c,d),lo=h;break;case 22:o.memoizedState===null&&(h=o.alternate,h!==null&&h.memoizedState!==null?(h=sf,sf=16777216,Ju(o,c,d),sf=h):Ju(o,c,d));break;default:Ju(o,c,d)}}function kD(o){var c=o.alternate;if(c!==null&&(o=c.child,o!==null)){c.child=null;do c=o.sibling,o.sibling=null,o=c;while(o!==null)}}function of(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var h=c[d];ns=h,OD(h,o)}kD(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)MD(o),o=o.sibling}function MD(o){switch(o.tag){case 0:case 11:case 15:of(o),o.flags&2048&&al(9,o,o.return);break;case 3:of(o);break;case 12:of(o);break;case 22:var c=o.stateNode;o.memoizedState!==null&&c._visibility&2&&(o.return===null||o.return.tag!==13)?(c._visibility&=-3,Og(o)):of(o);break;default:of(o)}}function Og(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var h=c[d];ns=h,OD(h,o)}kD(o)}for(o=o.child;o!==null;){switch(c=o,c.tag){case 0:case 11:case 15:al(8,c,c.return),Og(c);break;case 22:d=c.stateNode,d._visibility&2&&(d._visibility&=-3,Og(c));break;default:Og(c)}o=o.sibling}}function OD(o,c){for(;ns!==null;){var d=ns;switch(d.tag){case 0:case 11:case 15:al(8,d,c);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var h=d.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Up(d.memoizedState.cache)}if(h=d.child,h!==null)h.return=d,ns=h;else e:for(d=o;ns!==null;){h=ns;var x=h.sibling,w=h.return;if(SD(h),h===d){ns=null;break e}if(x!==null){x.return=w,ns=x;break e}ns=w}}}var BL={getCacheForType:function(o){var c=ps(zr),d=c.data.get(o);return d===void 0&&(d=o(),c.data.set(o,d)),d},cacheSignal:function(){return ps(zr).controller.signal}},UL=typeof WeakMap=="function"?WeakMap:Map,Mn=0,Yn=null,ln=null,fn=0,Nn=0,ai=null,ll=!1,Yu=!1,I0=!1,Ta=0,br=0,cl=0,Lc=0,P0=0,li=0,Xu=0,af=null,Gs=null,L0=!1,Ag=0,AD=0,_g=1/0,Ig=null,ul=null,Kr=0,dl=null,ed=null,Da=0,z0=0,$0=null,_D=null,lf=0,N0=null;function ci(){return(Mn&2)!==0&&fn!==0?fn&-fn:L.T!==null?W0():kr()}function ID(){if(li===0)if((fn&536870912)===0||mn){var o=Lr;Lr<<=1,(Lr&3932160)===0&&(Lr=262144),li=o}else li=536870912;return o=ii.current,o!==null&&(o.flags|=32),li}function Zs(o,c,d){(o===Yn&&(Nn===2||Nn===9)||o.cancelPendingCommit!==null)&&(td(o,0),pl(o,fn,li,!1)),Je(o,d),((Mn&2)===0||o!==Yn)&&(o===Yn&&((Mn&2)===0&&(Lc|=d),br===4&&pl(o,fn,li,!1)),zo(o))}function PD(o,c,d){if((Mn&6)!==0)throw Error(r(327));var h=!d&&(c&127)===0&&(c&o.expiredLanes)===0||Vn(o,c),x=h?WL(o,c):B0(o,c,!0),w=h;do{if(x===0){Yu&&!h&&pl(o,c,0,!1);break}else{if(d=o.current.alternate,w&&!VL(d)){x=B0(o,c,!1),w=!1;continue}if(x===2){if(w=c,o.errorRecoveryDisabledLanes&w)var _=0;else _=o.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){c=_;e:{var V=o;x=af;var Y=V.current.memoizedState.isDehydrated;if(Y&&(td(V,_).flags|=256),_=B0(V,_,!1),_!==2){if(I0&&!Y){V.errorRecoveryDisabledLanes|=w,Lc|=w,x=4;break e}w=Gs,Gs=x,w!==null&&(Gs===null?Gs=w:Gs.push.apply(Gs,w))}x=_}if(w=!1,x!==2)continue}}if(x===1){td(o,0),pl(o,c,0,!0);break}e:{switch(h=o,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:pl(h,c,li,!ll);break e;case 2:Gs=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(x=Ag+300-xe(),10<x)){if(pl(h,c,li,!ll),an(h,0,!0)!==0)break e;Da=c,h.timeoutHandle=pE(LD.bind(null,h,d,Gs,Ig,L0,c,li,Lc,Xu,ll,w,"Throttled",-0,0),x);break e}LD(h,d,Gs,Ig,L0,c,li,Lc,Xu,ll,w,null,-0,0)}}break}while(!0);zo(o)}function LD(o,c,d,h,x,w,_,V,Y,ge,Te,Le,ve,Se){if(o.timeoutHandle=-1,Le=c.subtreeFlags,Le&8192||(Le&16785408)===16785408){Le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:da},RD(c,w,Le);var mt=(w&62914560)===w?Ag-xe():(w&4194048)===w?AD-xe():0;if(mt=Ez(Le,mt),mt!==null){Da=w,o.cancelPendingCommit=mt(HD.bind(null,o,c,w,d,h,x,_,V,Y,Te,Le,null,ve,Se)),pl(o,w,_,!ge);return}}HD(o,c,w,d,h,x,_,V,Y)}function VL(o){for(var c=o;;){var d=c.tag;if((d===0||d===11||d===15)&&c.flags&16384&&(d=c.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var h=0;h<d.length;h++){var x=d[h],w=x.getSnapshot;x=x.value;try{if(!ri(w(),x))return!1}catch{return!1}}if(d=c.child,c.subtreeFlags&16384&&d!==null)d.return=c,c=d;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function pl(o,c,d,h){c&=~P0,c&=~Lc,o.suspendedLanes|=c,o.pingedLanes&=~c,h&&(o.warmLanes|=c),h=o.expirationTimes;for(var x=c;0<x;){var w=31-gt(x),_=1<<w;h[w]=-1,x&=~_}d!==0&&It(o,d,c)}function Pg(){return(Mn&6)===0?(cf(0),!1):!0}function F0(){if(ln!==null){if(Nn===0)var o=ln.return;else o=ln,ma=Ec=null,n0(o),Wu=null,Hp=0,o=ln;for(;o!==null;)fD(o.alternate,o),o=o.return;ln=null}}function td(o,c){var d=o.timeoutHandle;d!==-1&&(o.timeoutHandle=-1,cz(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),Da=0,F0(),Yn=o,ln=d=fa(o.current,null),fn=c,Nn=0,ai=null,ll=!1,Yu=Vn(o,c),I0=!1,Xu=li=P0=Lc=cl=br=0,Gs=af=null,L0=!1,(c&8)!==0&&(c|=c&32);var h=o.entangledLanes;if(h!==0)for(o=o.entanglements,h&=c;0<h;){var x=31-gt(h),w=1<<x;c|=o[x],h&=~w}return Ta=c,ng(),d}function zD(o,c){qt=null,L.H=Yp,c===Hu||c===ug?(c=Xj(),Nn=3):c===Hb?(c=Xj(),Nn=4):Nn=c===v0?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,ai=c,ln===null&&(br=1,jg(o,Ai(c,o.current)))}function $D(){var o=ii.current;return o===null?!0:(fn&4194048)===fn?Li===null:(fn&62914560)===fn||(fn&536870912)!==0?o===Li:!1}function ND(){var o=L.H;return L.H=Yp,o===null?Yp:o}function FD(){var o=L.A;return L.A=BL,o}function Lg(){br=4,ll||(fn&4194048)!==fn&&ii.current!==null||(Yu=!0),(cl&134217727)===0&&(Lc&134217727)===0||Yn===null||pl(Yn,fn,li,!1)}function B0(o,c,d){var h=Mn;Mn|=2;var x=ND(),w=FD();(Yn!==o||fn!==c)&&(Ig=null,td(o,c)),c=!1;var _=br;e:do try{if(Nn!==0&&ln!==null){var V=ln,Y=ai;switch(Nn){case 8:F0(),_=6;break e;case 3:case 2:case 9:case 6:ii.current===null&&(c=!0);var ge=Nn;if(Nn=0,ai=null,nd(o,V,Y,ge),d&&Yu){_=0;break e}break;default:ge=Nn,Nn=0,ai=null,nd(o,V,Y,ge)}}HL(),_=br;break}catch(Te){zD(o,Te)}while(!0);return c&&o.shellSuspendCounter++,ma=Ec=null,Mn=h,L.H=x,L.A=w,ln===null&&(Yn=null,fn=0,ng()),_}function HL(){for(;ln!==null;)BD(ln)}function WL(o,c){var d=Mn;Mn|=2;var h=ND(),x=FD();Yn!==o||fn!==c?(Ig=null,_g=xe()+500,td(o,c)):Yu=Vn(o,c);e:do try{if(Nn!==0&&ln!==null){c=ln;var w=ai;t:switch(Nn){case 1:Nn=0,ai=null,nd(o,c,w,1);break;case 2:case 9:if(Jj(w)){Nn=0,ai=null,UD(c);break}c=function(){Nn!==2&&Nn!==9||Yn!==o||(Nn=7),zo(o)},w.then(c,c);break e;case 3:Nn=7;break e;case 4:Nn=5;break e;case 7:Jj(w)?(Nn=0,ai=null,UD(c)):(Nn=0,ai=null,nd(o,c,w,7));break;case 5:var _=null;switch(ln.tag){case 26:_=ln.memoizedState;case 5:case 27:var V=ln;if(_?EE(_):V.stateNode.complete){Nn=0,ai=null;var Y=V.sibling;if(Y!==null)ln=Y;else{var ge=V.return;ge!==null?(ln=ge,zg(ge)):ln=null}break t}}Nn=0,ai=null,nd(o,c,w,5);break;case 6:Nn=0,ai=null,nd(o,c,w,6);break;case 8:F0(),br=6;break e;default:throw Error(r(462))}}qL();break}catch(Te){zD(o,Te)}while(!0);return ma=Ec=null,L.H=h,L.A=x,Mn=d,ln!==null?0:(Yn=null,fn=0,ng(),br)}function qL(){for(;ln!==null&&!q();)BD(ln)}function BD(o){var c=dD(o.alternate,o,Ta);o.memoizedProps=o.pendingProps,c===null?zg(o):ln=c}function UD(o){var c=o,d=c.alternate;switch(c.tag){case 15:case 0:c=iD(d,c,c.pendingProps,c.type,void 0,fn);break;case 11:c=iD(d,c,c.pendingProps,c.type.render,c.ref,fn);break;case 5:n0(c);default:fD(d,c),c=ln=Fj(c,Ta),c=dD(d,c,Ta)}o.memoizedProps=o.pendingProps,c===null?zg(o):ln=c}function nd(o,c,d,h){ma=Ec=null,n0(c),Wu=null,Hp=0;var x=c.return;try{if(IL(o,x,c,d,fn)){br=1,jg(o,Ai(d,o.current)),ln=null;return}}catch(w){if(x!==null)throw ln=x,w;br=1,jg(o,Ai(d,o.current)),ln=null;return}c.flags&32768?(mn||h===1?o=!0:Yu||(fn&536870912)!==0?o=!1:(ll=o=!0,(h===2||h===9||h===3||h===6)&&(h=ii.current,h!==null&&h.tag===13&&(h.flags|=16384))),VD(c,o)):zg(c)}function zg(o){var c=o;do{if((c.flags&32768)!==0){VD(c,ll);return}o=c.return;var d=zL(c.alternate,c,Ta);if(d!==null){ln=d;return}if(c=c.sibling,c!==null){ln=c;return}ln=c=o}while(c!==null);br===0&&(br=5)}function VD(o,c){do{var d=$L(o.alternate,o);if(d!==null){d.flags&=32767,ln=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!c&&(o=o.sibling,o!==null)){ln=o;return}ln=o=d}while(o!==null);br=6,ln=null}function HD(o,c,d,h,x,w,_,V,Y){o.cancelPendingCommit=null;do $g();while(Kr!==0);if((Mn&6)!==0)throw Error(r(327));if(c!==null){if(c===o.current)throw Error(r(177));if(w=c.lanes|c.childLanes,w|=kb,Ye(o,d,w,_,V,Y),o===Yn&&(ln=Yn=null,fn=0),ed=c,dl=o,Da=d,z0=w,$0=x,_D=h,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,QL(je,function(){return KD(),null})):(o.callbackNode=null,o.callbackPriority=0),h=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||h){h=L.T,L.T=null,x=W.p,W.p=2,_=Mn,Mn|=4;try{NL(o,c,d)}finally{Mn=_,W.p=x,L.T=h}}Kr=1,WD(),qD(),GD()}}function WD(){if(Kr===1){Kr=0;var o=dl,c=ed,d=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||d){d=L.T,L.T=null;var h=W.p;W.p=2;var x=Mn;Mn|=4;try{TD(c,o);var w=X0,_=Oj(o.containerInfo),V=w.focusedElem,Y=w.selectionRange;if(_!==V&&V&&V.ownerDocument&&Mj(V.ownerDocument.documentElement,V)){if(Y!==null&&jb(V)){var ge=Y.start,Te=Y.end;if(Te===void 0&&(Te=ge),"selectionStart"in V)V.selectionStart=ge,V.selectionEnd=Math.min(Te,V.value.length);else{var Le=V.ownerDocument||document,ve=Le&&Le.defaultView||window;if(ve.getSelection){var Se=ve.getSelection(),mt=V.textContent.length,Ot=Math.min(Y.start,mt),qn=Y.end===void 0?Ot:Math.min(Y.end,mt);!Se.extend&&Ot>qn&&(_=qn,qn=Ot,Ot=_);var ae=kj(V,Ot),re=kj(V,qn);if(ae&&re&&(Se.rangeCount!==1||Se.anchorNode!==ae.node||Se.anchorOffset!==ae.offset||Se.focusNode!==re.node||Se.focusOffset!==re.offset)){var me=Le.createRange();me.setStart(ae.node,ae.offset),Se.removeAllRanges(),Ot>qn?(Se.addRange(me),Se.extend(re.node,re.offset)):(me.setEnd(re.node,re.offset),Se.addRange(me))}}}}for(Le=[],Se=V;Se=Se.parentNode;)Se.nodeType===1&&Le.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<Le.length;V++){var _e=Le[V];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}Qg=!!Y0,X0=Y0=null}finally{Mn=x,W.p=h,L.T=d}}o.current=c,Kr=2}}function qD(){if(Kr===2){Kr=0;var o=dl,c=ed,d=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||d){d=L.T,L.T=null;var h=W.p;W.p=2;var x=Mn;Mn|=4;try{bD(o,c.alternate,c)}finally{Mn=x,W.p=h,L.T=d}}Kr=3}}function GD(){if(Kr===4||Kr===3){Kr=0,se();var o=dl,c=ed,d=Da,h=_D;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Kr=5:(Kr=0,ed=dl=null,ZD(o,o.pendingLanes));var x=o.pendingLanes;if(x===0&&(ul=null),Rr(d),c=c.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(vt,c,void 0,(c.current.flags&128)===128)}catch{}if(h!==null){c=L.T,x=W.p,W.p=2,L.T=null;try{for(var w=o.onRecoverableError,_=0;_<h.length;_++){var V=h[_];w(V.value,{componentStack:V.stack})}}finally{L.T=c,W.p=x}}(Da&3)!==0&&$g(),zo(o),x=o.pendingLanes,(d&261930)!==0&&(x&42)!==0?o===N0?lf++:(lf=0,N0=o):lf=0,cf(0)}}function ZD(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,Up(c)))}function $g(){return WD(),qD(),GD(),KD()}function KD(){if(Kr!==5)return!1;var o=dl,c=z0;z0=0;var d=Rr(Da),h=L.T,x=W.p;try{W.p=32>d?32:d,L.T=null,d=$0,$0=null;var w=dl,_=Da;if(Kr=0,ed=dl=null,Da=0,(Mn&6)!==0)throw Error(r(331));var V=Mn;if(Mn|=4,MD(w.current),ED(w,w.current,_,d),Mn=V,cf(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(vt,w)}catch{}return!0}finally{W.p=x,L.T=h,ZD(o,c)}}function QD(o,c,d){c=Ai(d,c),c=y0(o.stateNode,c,2),o=sl(o,c,2),o!==null&&(Je(o,2),zo(o))}function Fn(o,c,d){if(o.tag===3)QD(o,o,d);else for(;c!==null;){if(c.tag===3){QD(c,o,d);break}else if(c.tag===1){var h=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ul===null||!ul.has(h))){o=Ai(d,o),d=JT(2),h=sl(c,d,2),h!==null&&(YT(d,h,c,o),Je(h,2),zo(h));break}}c=c.return}}function U0(o,c,d){var h=o.pingCache;if(h===null){h=o.pingCache=new UL;var x=new Set;h.set(c,x)}else x=h.get(c),x===void 0&&(x=new Set,h.set(c,x));x.has(d)||(I0=!0,x.add(d),o=GL.bind(null,o,c,d),c.then(o,o))}function GL(o,c,d){var h=o.pingCache;h!==null&&h.delete(c),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Yn===o&&(fn&d)===d&&(br===4||br===3&&(fn&62914560)===fn&&300>xe()-Ag?(Mn&2)===0&&td(o,0):P0|=d,Xu===fn&&(Xu=0)),zo(o)}function JD(o,c){c===0&&(c=ht()),o=jc(o,c),o!==null&&(Je(o,c),zo(o))}function ZL(o){var c=o.memoizedState,d=0;c!==null&&(d=c.retryLane),JD(o,d)}function KL(o,c){var d=0;switch(o.tag){case 31:case 13:var h=o.stateNode,x=o.memoizedState;x!==null&&(d=x.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(c),JD(o,d)}function QL(o,c){return it(o,c)}var Ng=null,rd=null,V0=!1,Fg=!1,H0=!1,fl=0;function zo(o){o!==rd&&o.next===null&&(rd===null?Ng=rd=o:rd=rd.next=o),Fg=!0,V0||(V0=!0,YL())}function cf(o,c){if(!H0&&Fg){H0=!0;do for(var d=!1,h=Ng;h!==null;){if(o!==0){var x=h.pendingLanes;if(x===0)var w=0;else{var _=h.suspendedLanes,V=h.pingedLanes;w=(1<<31-gt(42|o)+1)-1,w&=x&~(_&~V),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,tE(h,w))}else w=fn,w=an(h,h===Yn?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||Vn(h,w)||(d=!0,tE(h,w));h=h.next}while(d);H0=!1}}function JL(){YD()}function YD(){Fg=V0=!1;var o=0;fl!==0&&lz()&&(o=fl);for(var c=xe(),d=null,h=Ng;h!==null;){var x=h.next,w=XD(h,c);w===0?(h.next=null,d===null?Ng=x:d.next=x,x===null&&(rd=d)):(d=h,(o!==0||(w&3)!==0)&&(Fg=!0)),h=x}Kr!==0&&Kr!==5||cf(o),fl!==0&&(fl=0)}function XD(o,c){for(var d=o.suspendedLanes,h=o.pingedLanes,x=o.expirationTimes,w=o.pendingLanes&-62914561;0<w;){var _=31-gt(w),V=1<<_,Y=x[_];Y===-1?((V&d)===0||(V&h)!==0)&&(x[_]=Sn(V,c)):Y<=c&&(o.expiredLanes|=V),w&=~V}if(c=Yn,d=fn,d=an(o,o===c?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h=o.callbackNode,d===0||o===c&&(Nn===2||Nn===9)||o.cancelPendingCommit!==null)return h!==null&&h!==null&&Z(h),o.callbackNode=null,o.callbackPriority=0;if((d&3)===0||Vn(o,d)){if(c=d&-d,c===o.callbackPriority)return c;switch(h!==null&&Z(h),Rr(d)){case 2:case 8:d=he;break;case 32:d=je;break;case 268435456:d=ke;break;default:d=je}return h=eE.bind(null,o),d=it(d,h),o.callbackPriority=c,o.callbackNode=d,c}return h!==null&&h!==null&&Z(h),o.callbackPriority=2,o.callbackNode=null,2}function eE(o,c){if(Kr!==0&&Kr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if($g()&&o.callbackNode!==d)return null;var h=fn;return h=an(o,o===Yn?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h===0?null:(PD(o,h,c),XD(o,xe()),o.callbackNode!=null&&o.callbackNode===d?eE.bind(null,o):null)}function tE(o,c){if($g())return null;PD(o,c,!0)}function YL(){uz(function(){(Mn&6)!==0?it(ne,JL):YD()})}function W0(){if(fl===0){var o=Uu;o===0&&(o=tr,tr<<=1,(tr&261888)===0&&(tr=256)),fl=o}return fl}function nE(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Zm(""+o)}function rE(o,c){var d=c.ownerDocument.createElement("input");return d.name=c.name,d.value=c.value,o.id&&d.setAttribute("form",o.id),c.parentNode.insertBefore(d,c),o=new FormData(o),d.parentNode.removeChild(d),o}function XL(o,c,d,h,x){if(c==="submit"&&d&&d.stateNode===x){var w=nE((x[sr]||null).action),_=h.submitter;_&&(c=(c=_[sr]||null)?nE(c.formAction):_.getAttribute("formAction"),c!==null&&(w=c,_=null));var V=new Ym("action","action",null,h,x);o.push({event:V,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(fl!==0){var Y=_?rE(x,_):new FormData(x);d0(d,{pending:!0,data:Y,method:x.method,action:w},null,Y)}}else typeof w=="function"&&(V.preventDefault(),Y=_?rE(x,_):new FormData(x),d0(d,{pending:!0,data:Y,method:x.method,action:w},w,Y))},currentTarget:x}]})}}for(var q0=0;q0<Rb.length;q0++){var G0=Rb[q0],ez=G0.toLowerCase(),tz=G0[0].toUpperCase()+G0.slice(1);ao(ez,"on"+tz)}ao(Ij,"onAnimationEnd"),ao(Pj,"onAnimationIteration"),ao(Lj,"onAnimationStart"),ao("dblclick","onDoubleClick"),ao("focusin","onFocus"),ao("focusout","onBlur"),ao(yL,"onTransitionRun"),ao(vL,"onTransitionStart"),ao(xL,"onTransitionCancel"),ao(zj,"onTransitionEnd"),us("onMouseEnter",["mouseout","mouseover"]),us("onMouseLeave",["mouseout","mouseover"]),us("onPointerEnter",["pointerout","pointerover"]),us("onPointerLeave",["pointerout","pointerover"]),on("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),on("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),on("onBeforeInput",["compositionend","keypress","textInput","paste"]),on("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),on("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),on("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uf="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(" "),nz=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uf));function sE(o,c){c=(c&4)!==0;for(var d=0;d<o.length;d++){var h=o[d],x=h.event;h=h.listeners;e:{var w=void 0;if(c)for(var _=h.length-1;0<=_;_--){var V=h[_],Y=V.instance,ge=V.currentTarget;if(V=V.listener,Y!==w&&x.isPropagationStopped())break e;w=V,x.currentTarget=ge;try{w(x)}catch(Te){tg(Te)}x.currentTarget=null,w=Y}else for(_=0;_<h.length;_++){if(V=h[_],Y=V.instance,ge=V.currentTarget,V=V.listener,Y!==w&&x.isPropagationStopped())break e;w=V,x.currentTarget=ge;try{w(x)}catch(Te){tg(Te)}x.currentTarget=null,w=Y}}}}function cn(o,c){var d=c[Oe];d===void 0&&(d=c[Oe]=new Set);var h=o+"__bubble";d.has(h)||(iE(c,o,2,!1),d.add(h))}function Z0(o,c,d){var h=0;c&&(h|=4),iE(d,o,h,c)}var Bg="_reactListening"+Math.random().toString(36).slice(2);function K0(o){if(!o[Bg]){o[Bg]=!0,xc.forEach(function(d){d!=="selectionchange"&&(nz.has(d)||Z0(d,!1,o),Z0(d,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[Bg]||(c[Bg]=!0,Z0("selectionchange",!1,c))}}function iE(o,c,d,h){switch(IE(c)){case 2:var x=Mz;break;case 8:x=Oz;break;default:x=uS}d=x.bind(null,c,d,o),x=void 0,!mb||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(x=!0),h?x!==void 0?o.addEventListener(c,d,{capture:!0,passive:x}):o.addEventListener(c,d,!0):x!==void 0?o.addEventListener(c,d,{passive:x}):o.addEventListener(c,d,!1)}function Q0(o,c,d,h,x){var w=h;if((c&1)===0&&(c&2)===0&&h!==null)e:for(;;){if(h===null)return;var _=h.tag;if(_===3||_===4){var V=h.stateNode.containerInfo;if(V===x)break;if(_===4)for(_=h.return;_!==null;){var Y=_.tag;if((Y===3||Y===4)&&_.stateNode.containerInfo===x)return;_=_.return}for(;V!==null;){if(_=Jn(V),_===null)return;if(Y=_.tag,Y===5||Y===6||Y===26||Y===27){h=w=_;continue e}V=V.parentNode}}h=h.return}uj(function(){var ge=w,Te=fb(d),Le=[];e:{var ve=$j.get(o);if(ve!==void 0){var Se=Ym,mt=o;switch(o){case"keypress":if(Qm(d)===0)break e;case"keydown":case"keyup":Se=K4;break;case"focusin":mt="focus",Se=xb;break;case"focusout":mt="blur",Se=xb;break;case"beforeblur":case"afterblur":Se=xb;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=fj;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=z4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=Y4;break;case Ij:case Pj:case Lj:Se=F4;break;case zj:Se=eL;break;case"scroll":case"scrollend":Se=P4;break;case"wheel":Se=nL;break;case"copy":case"cut":case"paste":Se=U4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=mj;break;case"toggle":case"beforetoggle":Se=sL}var Ot=(c&4)!==0,qn=!Ot&&(o==="scroll"||o==="scrollend"),ae=Ot?ve!==null?ve+"Capture":null:ve;Ot=[];for(var re=ge,me;re!==null;){var _e=re;if(me=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||me===null||ae===null||(_e=Op(re,ae),_e!=null&&Ot.push(df(re,_e,me))),qn)break;re=re.return}0<Ot.length&&(ve=new Se(ve,mt,null,d,Te),Le.push({event:ve,listeners:Ot}))}}if((c&7)===0){e:{if(ve=o==="mouseover"||o==="pointerover",Se=o==="mouseout"||o==="pointerout",ve&&d!==pb&&(mt=d.relatedTarget||d.fromElement)&&(Jn(mt)||mt[oo]))break e;if((Se||ve)&&(ve=Te.window===Te?Te:(ve=Te.ownerDocument)?ve.defaultView||ve.parentWindow:window,Se?(mt=d.relatedTarget||d.toElement,Se=ge,mt=mt?Jn(mt):null,mt!==null&&(qn=i(mt),Ot=mt.tag,mt!==qn||Ot!==5&&Ot!==27&&Ot!==6)&&(mt=null)):(Se=null,mt=ge),Se!==mt)){if(Ot=fj,_e="onMouseLeave",ae="onMouseEnter",re="mouse",(o==="pointerout"||o==="pointerover")&&(Ot=mj,_e="onPointerLeave",ae="onPointerEnter",re="pointer"),qn=Se==null?ve:ca(Se),me=mt==null?ve:ca(mt),ve=new Ot(_e,re+"leave",Se,d,Te),ve.target=qn,ve.relatedTarget=me,_e=null,Jn(Te)===ge&&(Ot=new Ot(ae,re+"enter",mt,d,Te),Ot.target=me,Ot.relatedTarget=qn,_e=Ot),qn=_e,Se&&mt)t:{for(Ot=rz,ae=Se,re=mt,me=0,_e=ae;_e;_e=Ot(_e))me++;_e=0;for(var Rt=re;Rt;Rt=Ot(Rt))_e++;for(;0<me-_e;)ae=Ot(ae),me--;for(;0<_e-me;)re=Ot(re),_e--;for(;me--;){if(ae===re||re!==null&&ae===re.alternate){Ot=ae;break t}ae=Ot(ae),re=Ot(re)}Ot=null}else Ot=null;Se!==null&&oE(Le,ve,Se,Ot,!1),mt!==null&&qn!==null&&oE(Le,qn,mt,Ot,!0)}}e:{if(ve=ge?ca(ge):window,Se=ve.nodeName&&ve.nodeName.toLowerCase(),Se==="select"||Se==="input"&&ve.type==="file")var Dn=wj;else if(Sj(ve))if(jj)Dn=hL;else{Dn=pL;var bt=dL}else Se=ve.nodeName,!Se||Se.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?ge&&db(ge.elementType)&&(Dn=wj):Dn=fL;if(Dn&&(Dn=Dn(o,ge))){Cj(Le,Dn,d,Te);break e}bt&&bt(o,ve,ge),o==="focusout"&&ge&&ve.type==="number"&&ge.memoizedProps.value!=null&&ub(ve,"number",ve.value)}switch(bt=ge?ca(ge):window,o){case"focusin":(Sj(bt)||bt.contentEditable==="true")&&(Iu=bt,Tb=ge,Np=null);break;case"focusout":Np=Tb=Iu=null;break;case"mousedown":Db=!0;break;case"contextmenu":case"mouseup":case"dragend":Db=!1,Aj(Le,d,Te);break;case"selectionchange":if(gL)break;case"keydown":case"keyup":Aj(Le,d,Te)}var Zt;if(Sb)e:{switch(o){case"compositionstart":var hn="onCompositionStart";break e;case"compositionend":hn="onCompositionEnd";break e;case"compositionupdate":hn="onCompositionUpdate";break e}hn=void 0}else _u?xj(o,d)&&(hn="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(hn="onCompositionStart");hn&&(gj&&d.locale!=="ko"&&(_u||hn!=="onCompositionStart"?hn==="onCompositionEnd"&&_u&&(Zt=dj()):(Ja=Te,gb="value"in Ja?Ja.value:Ja.textContent,_u=!0)),bt=Ug(ge,hn),0<bt.length&&(hn=new hj(hn,o,null,d,Te),Le.push({event:hn,listeners:bt}),Zt?hn.data=Zt:(Zt=bj(d),Zt!==null&&(hn.data=Zt)))),(Zt=oL?aL(o,d):lL(o,d))&&(hn=Ug(ge,"onBeforeInput"),0<hn.length&&(bt=new hj("onBeforeInput","beforeinput",null,d,Te),Le.push({event:bt,listeners:hn}),bt.data=Zt)),XL(Le,o,ge,d,Te)}sE(Le,c)})}function df(o,c,d){return{instance:o,listener:c,currentTarget:d}}function Ug(o,c){for(var d=c+"Capture",h=[];o!==null;){var x=o,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=Op(o,d),x!=null&&h.unshift(df(o,x,w)),x=Op(o,c),x!=null&&h.push(df(o,x,w))),o.tag===3)return h;o=o.return}return[]}function rz(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function oE(o,c,d,h,x){for(var w=c._reactName,_=[];d!==null&&d!==h;){var V=d,Y=V.alternate,ge=V.stateNode;if(V=V.tag,Y!==null&&Y===h)break;V!==5&&V!==26&&V!==27||ge===null||(Y=ge,x?(ge=Op(d,w),ge!=null&&_.unshift(df(d,ge,Y))):x||(ge=Op(d,w),ge!=null&&_.push(df(d,ge,Y)))),d=d.return}_.length!==0&&o.push({event:c,listeners:_})}var sz=/\r\n?/g,iz=/\u0000|\uFFFD/g;function aE(o){return(typeof o=="string"?o:""+o).replace(sz,`
|
|
49
|
+
`).replace(iz,"")}function lE(o,c){return c=aE(c),aE(o)===c}function Wn(o,c,d,h,x,w){switch(d){case"children":typeof h=="string"?c==="body"||c==="textarea"&&h===""||Mu(o,h):(typeof h=="number"||typeof h=="bigint")&&c!=="body"&&Mu(o,""+h);break;case"className":qm(o,"class",h);break;case"tabIndex":qm(o,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":qm(o,d,h);break;case"style":lj(o,h,w);break;case"data":if(c!=="object"){qm(o,"data",h);break}case"src":case"href":if(h===""&&(c!=="a"||d!=="href")){o.removeAttribute(d);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(d);break}h=Zm(""+h),o.setAttribute(d,h);break;case"action":case"formAction":if(typeof h=="function"){o.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(d==="formAction"?(c!=="input"&&Wn(o,c,"name",x.name,x,null),Wn(o,c,"formEncType",x.formEncType,x,null),Wn(o,c,"formMethod",x.formMethod,x,null),Wn(o,c,"formTarget",x.formTarget,x,null)):(Wn(o,c,"encType",x.encType,x,null),Wn(o,c,"method",x.method,x,null),Wn(o,c,"target",x.target,x,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(d);break}h=Zm(""+h),o.setAttribute(d,h);break;case"onClick":h!=null&&(o.onclick=da);break;case"onScroll":h!=null&&cn("scroll",o);break;case"onScrollEnd":h!=null&&cn("scrollend",o);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"multiple":o.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":o.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){o.removeAttribute("xlink:href");break}d=Zm(""+h),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(d,""+h):o.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(d,""):o.removeAttribute(d);break;case"capture":case"download":h===!0?o.setAttribute(d,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(d,h):o.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?o.setAttribute(d,h):o.removeAttribute(d);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?o.removeAttribute(d):o.setAttribute(d,h);break;case"popover":cn("beforetoggle",o),cn("toggle",o),Wm(o,"popover",h);break;case"xlinkActuate":ua(o,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":ua(o,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":ua(o,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":ua(o,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":ua(o,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":ua(o,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":ua(o,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":ua(o,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":ua(o,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Wm(o,"is",h);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=_4.get(d)||d,Wm(o,d,h))}}function J0(o,c,d,h,x,w){switch(d){case"style":lj(o,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"children":typeof h=="string"?Mu(o,h):(typeof h=="number"||typeof h=="bigint")&&Mu(o,""+h);break;case"onScroll":h!=null&&cn("scroll",o);break;case"onScrollEnd":h!=null&&cn("scrollend",o);break;case"onClick":h!=null&&(o.onclick=da);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bc.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(x=d.endsWith("Capture"),c=d.slice(2,x?d.length-7:void 0),w=o[sr]||null,w=w!=null?w[d]:null,typeof w=="function"&&o.removeEventListener(c,w,x),typeof h=="function")){typeof w!="function"&&w!==null&&(d in o?o[d]=null:o.hasAttribute(d)&&o.removeAttribute(d)),o.addEventListener(c,h,x);break e}d in o?o[d]=h:h===!0?o.setAttribute(d,""):Wm(o,d,h)}}}function hs(o,c,d){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":cn("error",o),cn("load",o);var h=!1,x=!1,w;for(w in d)if(d.hasOwnProperty(w)){var _=d[w];if(_!=null)switch(w){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Wn(o,c,w,_,d,null)}}x&&Wn(o,c,"srcSet",d.srcSet,d,null),h&&Wn(o,c,"src",d.src,d,null);return;case"input":cn("invalid",o);var V=w=_=x=null,Y=null,ge=null;for(h in d)if(d.hasOwnProperty(h)){var Te=d[h];if(Te!=null)switch(h){case"name":x=Te;break;case"type":_=Te;break;case"checked":Y=Te;break;case"defaultChecked":ge=Te;break;case"value":w=Te;break;case"defaultValue":V=Te;break;case"children":case"dangerouslySetInnerHTML":if(Te!=null)throw Error(r(137,c));break;default:Wn(o,c,h,Te,d,null)}}sj(o,w,V,Y,ge,_,x,!1);return;case"select":cn("invalid",o),h=_=w=null;for(x in d)if(d.hasOwnProperty(x)&&(V=d[x],V!=null))switch(x){case"value":w=V;break;case"defaultValue":_=V;break;case"multiple":h=V;default:Wn(o,c,x,V,d,null)}c=w,d=_,o.multiple=!!h,c!=null?ku(o,!!h,c,!1):d!=null&&ku(o,!!h,d,!0);return;case"textarea":cn("invalid",o),w=x=h=null;for(_ in d)if(d.hasOwnProperty(_)&&(V=d[_],V!=null))switch(_){case"value":h=V;break;case"defaultValue":x=V;break;case"children":w=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(91));break;default:Wn(o,c,_,V,d,null)}oj(o,h,x,w);return;case"option":for(Y in d)if(d.hasOwnProperty(Y)&&(h=d[Y],h!=null))switch(Y){case"selected":o.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Wn(o,c,Y,h,d,null)}return;case"dialog":cn("beforetoggle",o),cn("toggle",o),cn("cancel",o),cn("close",o);break;case"iframe":case"object":cn("load",o);break;case"video":case"audio":for(h=0;h<uf.length;h++)cn(uf[h],o);break;case"image":cn("error",o),cn("load",o);break;case"details":cn("toggle",o);break;case"embed":case"source":case"link":cn("error",o),cn("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ge in d)if(d.hasOwnProperty(ge)&&(h=d[ge],h!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Wn(o,c,ge,h,d,null)}return;default:if(db(c)){for(Te in d)d.hasOwnProperty(Te)&&(h=d[Te],h!==void 0&&J0(o,c,Te,h,d,void 0));return}}for(V in d)d.hasOwnProperty(V)&&(h=d[V],h!=null&&Wn(o,c,V,h,d,null))}function oz(o,c,d,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,w=null,_=null,V=null,Y=null,ge=null,Te=null;for(Se in d){var Le=d[Se];if(d.hasOwnProperty(Se)&&Le!=null)switch(Se){case"checked":break;case"value":break;case"defaultValue":Y=Le;default:h.hasOwnProperty(Se)||Wn(o,c,Se,null,h,Le)}}for(var ve in h){var Se=h[ve];if(Le=d[ve],h.hasOwnProperty(ve)&&(Se!=null||Le!=null))switch(ve){case"type":w=Se;break;case"name":x=Se;break;case"checked":ge=Se;break;case"defaultChecked":Te=Se;break;case"value":_=Se;break;case"defaultValue":V=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(r(137,c));break;default:Se!==Le&&Wn(o,c,ve,Se,h,Le)}}cb(o,_,V,Y,ge,Te,w,x);return;case"select":Se=_=V=ve=null;for(w in d)if(Y=d[w],d.hasOwnProperty(w)&&Y!=null)switch(w){case"value":break;case"multiple":Se=Y;default:h.hasOwnProperty(w)||Wn(o,c,w,null,h,Y)}for(x in h)if(w=h[x],Y=d[x],h.hasOwnProperty(x)&&(w!=null||Y!=null))switch(x){case"value":ve=w;break;case"defaultValue":V=w;break;case"multiple":_=w;default:w!==Y&&Wn(o,c,x,w,h,Y)}c=V,d=_,h=Se,ve!=null?ku(o,!!d,ve,!1):!!h!=!!d&&(c!=null?ku(o,!!d,c,!0):ku(o,!!d,d?[]:"",!1));return;case"textarea":Se=ve=null;for(V in d)if(x=d[V],d.hasOwnProperty(V)&&x!=null&&!h.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:Wn(o,c,V,null,h,x)}for(_ in h)if(x=h[_],w=d[_],h.hasOwnProperty(_)&&(x!=null||w!=null))switch(_){case"value":ve=x;break;case"defaultValue":Se=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&Wn(o,c,_,x,h,w)}ij(o,ve,Se);return;case"option":for(var mt in d)if(ve=d[mt],d.hasOwnProperty(mt)&&ve!=null&&!h.hasOwnProperty(mt))switch(mt){case"selected":o.selected=!1;break;default:Wn(o,c,mt,null,h,ve)}for(Y in h)if(ve=h[Y],Se=d[Y],h.hasOwnProperty(Y)&&ve!==Se&&(ve!=null||Se!=null))switch(Y){case"selected":o.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Wn(o,c,Y,ve,h,Se)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ot in d)ve=d[Ot],d.hasOwnProperty(Ot)&&ve!=null&&!h.hasOwnProperty(Ot)&&Wn(o,c,Ot,null,h,ve);for(ge in h)if(ve=h[ge],Se=d[ge],h.hasOwnProperty(ge)&&ve!==Se&&(ve!=null||Se!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,c));break;default:Wn(o,c,ge,ve,h,Se)}return;default:if(db(c)){for(var qn in d)ve=d[qn],d.hasOwnProperty(qn)&&ve!==void 0&&!h.hasOwnProperty(qn)&&J0(o,c,qn,void 0,h,ve);for(Te in h)ve=h[Te],Se=d[Te],!h.hasOwnProperty(Te)||ve===Se||ve===void 0&&Se===void 0||J0(o,c,Te,ve,h,Se);return}}for(var ae in d)ve=d[ae],d.hasOwnProperty(ae)&&ve!=null&&!h.hasOwnProperty(ae)&&Wn(o,c,ae,null,h,ve);for(Le in h)ve=h[Le],Se=d[Le],!h.hasOwnProperty(Le)||ve===Se||ve==null&&Se==null||Wn(o,c,Le,ve,h,Se)}function cE(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function az(){if(typeof performance.getEntriesByType=="function"){for(var o=0,c=0,d=performance.getEntriesByType("resource"),h=0;h<d.length;h++){var x=d[h],w=x.transferSize,_=x.initiatorType,V=x.duration;if(w&&V&&cE(_)){for(_=0,V=x.responseEnd,h+=1;h<d.length;h++){var Y=d[h],ge=Y.startTime;if(ge>V)break;var Te=Y.transferSize,Le=Y.initiatorType;Te&&cE(Le)&&(Y=Y.responseEnd,_+=Te*(Y<V?1:(V-ge)/(Y-ge)))}if(--h,c+=8*(w+_)/(x.duration/1e3),o++,10<o)break}}if(0<o)return c/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Y0=null,X0=null;function Vg(o){return o.nodeType===9?o:o.ownerDocument}function uE(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dE(o,c){if(o===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&c==="foreignObject"?0:o}function eS(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var tS=null;function lz(){var o=window.event;return o&&o.type==="popstate"?o===tS?!1:(tS=o,!0):(tS=null,!1)}var pE=typeof setTimeout=="function"?setTimeout:void 0,cz=typeof clearTimeout=="function"?clearTimeout:void 0,fE=typeof Promise=="function"?Promise:void 0,uz=typeof queueMicrotask=="function"?queueMicrotask:typeof fE<"u"?function(o){return fE.resolve(null).then(o).catch(dz)}:pE;function dz(o){setTimeout(function(){throw o})}function hl(o){return o==="head"}function hE(o,c){var d=c,h=0;do{var x=d.nextSibling;if(o.removeChild(d),x&&x.nodeType===8)if(d=x.data,d==="/$"||d==="/&"){if(h===0){o.removeChild(x),ad(c);return}h--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")h++;else if(d==="html")pf(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,pf(d);for(var w=d.firstChild;w;){var _=w.nextSibling,V=w.nodeName;w[Wt]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&w.rel.toLowerCase()==="stylesheet"||d.removeChild(w),w=_}}else d==="body"&&pf(o.ownerDocument.body);d=x}while(d);ad(c)}function mE(o,c){var d=o;o=0;do{var h=d.nextSibling;if(d.nodeType===1?c?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(c?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),h&&h.nodeType===8)if(d=h.data,d==="/$"){if(o===0)break;o--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||o++;d=h}while(d)}function nS(o){var c=o.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var d=c;switch(c=c.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":nS(d),kn(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function pz(o,c,d,h){for(;o.nodeType===1;){var x=d;if(o.nodeName.toLowerCase()!==c.toLowerCase()){if(!h&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(h){if(!o[Wt])switch(c){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(w=o.getAttribute("rel"),w==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(w!==x.rel||o.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||o.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||o.getAttribute("title")!==(x.title==null?null:x.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(w=o.getAttribute("src"),(w!==(x.src==null?null:x.src)||o.getAttribute("type")!==(x.type==null?null:x.type)||o.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(c==="input"&&o.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&o.getAttribute("name")===w)return o}else return o;if(o=zi(o.nextSibling),o===null)break}return null}function fz(o,c,d){if(c==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=zi(o.nextSibling),o===null))return null;return o}function gE(o,c){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!c||(o=zi(o.nextSibling),o===null))return null;return o}function rS(o){return o.data==="$?"||o.data==="$~"}function sS(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function hz(o,c){var d=o.ownerDocument;if(o.data==="$~")o._reactRetry=c;else if(o.data!=="$?"||d.readyState!=="loading")c();else{var h=function(){c(),d.removeEventListener("DOMContentLoaded",h)};d.addEventListener("DOMContentLoaded",h),o._reactRetry=h}}function zi(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return o}var iS=null;function yE(o){o=o.nextSibling;for(var c=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(c===0)return zi(o.nextSibling);c--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||c++}o=o.nextSibling}return null}function vE(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(c===0)return o;c--}else d!=="/$"&&d!=="/&"||c++}o=o.previousSibling}return null}function xE(o,c,d){switch(c=Vg(d),o){case"html":if(o=c.documentElement,!o)throw Error(r(452));return o;case"head":if(o=c.head,!o)throw Error(r(453));return o;case"body":if(o=c.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function pf(o){for(var c=o.attributes;c.length;)o.removeAttributeNode(c[0]);kn(o)}var $i=new Map,bE=new Set;function Hg(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Ea=W.d;W.d={f:mz,r:gz,D:yz,C:vz,L:xz,m:bz,X:Cz,S:Sz,M:wz};function mz(){var o=Ea.f(),c=Pg();return o||c}function gz(o){var c=Zr(o);c!==null&&c.tag===5&&c.type==="form"?zT(c):Ea.r(o)}var sd=typeof document>"u"?null:document;function SE(o,c,d){var h=sd;if(h&&typeof c=="string"&&c){var x=Mi(c);x='link[rel="'+o+'"][href="'+x+'"]',typeof d=="string"&&(x+='[crossorigin="'+d+'"]'),bE.has(x)||(bE.add(x),o={rel:o,crossOrigin:d,href:c},h.querySelector(x)===null&&(c=h.createElement("link"),hs(c,"link",o),Mr(c),h.head.appendChild(c)))}}function yz(o){Ea.D(o),SE("dns-prefetch",o,null)}function vz(o,c){Ea.C(o,c),SE("preconnect",o,c)}function xz(o,c,d){Ea.L(o,c,d);var h=sd;if(h&&o&&c){var x='link[rel="preload"][as="'+Mi(c)+'"]';c==="image"&&d&&d.imageSrcSet?(x+='[imagesrcset="'+Mi(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(x+='[imagesizes="'+Mi(d.imageSizes)+'"]')):x+='[href="'+Mi(o)+'"]';var w=x;switch(c){case"style":w=id(o);break;case"script":w=od(o)}$i.has(w)||(o=g({rel:"preload",href:c==="image"&&d&&d.imageSrcSet?void 0:o,as:c},d),$i.set(w,o),h.querySelector(x)!==null||c==="style"&&h.querySelector(ff(w))||c==="script"&&h.querySelector(hf(w))||(c=h.createElement("link"),hs(c,"link",o),Mr(c),h.head.appendChild(c)))}}function bz(o,c){Ea.m(o,c);var d=sd;if(d&&o){var h=c&&typeof c.as=="string"?c.as:"script",x='link[rel="modulepreload"][as="'+Mi(h)+'"][href="'+Mi(o)+'"]',w=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=od(o)}if(!$i.has(w)&&(o=g({rel:"modulepreload",href:o},c),$i.set(w,o),d.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(hf(w)))return}h=d.createElement("link"),hs(h,"link",o),Mr(h),d.head.appendChild(h)}}}function Sz(o,c,d){Ea.S(o,c,d);var h=sd;if(h&&o){var x=Ka(h).hoistableStyles,w=id(o);c=c||"default";var _=x.get(w);if(!_){var V={loading:0,preload:null};if(_=h.querySelector(ff(w)))V.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":c},d),(d=$i.get(w))&&oS(o,d);var Y=_=h.createElement("link");Mr(Y),hs(Y,"link",o),Y._p=new Promise(function(ge,Te){Y.onload=ge,Y.onerror=Te}),Y.addEventListener("load",function(){V.loading|=1}),Y.addEventListener("error",function(){V.loading|=2}),V.loading|=4,Wg(_,c,h)}_={type:"stylesheet",instance:_,count:1,state:V},x.set(w,_)}}}function Cz(o,c){Ea.X(o,c);var d=sd;if(d&&o){var h=Ka(d).hoistableScripts,x=od(o),w=h.get(x);w||(w=d.querySelector(hf(x)),w||(o=g({src:o,async:!0},c),(c=$i.get(x))&&aS(o,c),w=d.createElement("script"),Mr(w),hs(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function wz(o,c){Ea.M(o,c);var d=sd;if(d&&o){var h=Ka(d).hoistableScripts,x=od(o),w=h.get(x);w||(w=d.querySelector(hf(x)),w||(o=g({src:o,async:!0,type:"module"},c),(c=$i.get(x))&&aS(o,c),w=d.createElement("script"),Mr(w),hs(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function CE(o,c,d,h){var x=(x=fe.current)?Hg(x):null;if(!x)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(c=id(d.href),d=Ka(x).hoistableStyles,h=d.get(c),h||(h={type:"style",instance:null,count:0,state:null},d.set(c,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=id(d.href);var w=Ka(x).hoistableStyles,_=w.get(o);if(_||(x=x.ownerDocument||x,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(o,_),(w=x.querySelector(ff(o)))&&!w._p&&(_.instance=w,_.state.loading=5),$i.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},$i.set(o,d),w||jz(x,o,d,_.state))),c&&h===null)throw Error(r(528,""));return _}if(c&&h!==null)throw Error(r(529,""));return null;case"script":return c=d.async,d=d.src,typeof d=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=od(d),d=Ka(x).hoistableScripts,h=d.get(c),h||(h={type:"script",instance:null,count:0,state:null},d.set(c,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function id(o){return'href="'+Mi(o)+'"'}function ff(o){return'link[rel="stylesheet"]['+o+"]"}function wE(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function jz(o,c,d,h){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?h.loading=1:(c=o.createElement("link"),h.preload=c,c.addEventListener("load",function(){return h.loading|=1}),c.addEventListener("error",function(){return h.loading|=2}),hs(c,"link",d),Mr(c),o.head.appendChild(c))}function od(o){return'[src="'+Mi(o)+'"]'}function hf(o){return"script[async]"+o}function jE(o,c,d){if(c.count++,c.instance===null)switch(c.type){case"style":var h=o.querySelector('style[data-href~="'+Mi(d.href)+'"]');if(h)return c.instance=h,Mr(h),h;var x=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),Mr(h),hs(h,"style",x),Wg(h,d.precedence,o),c.instance=h;case"stylesheet":x=id(d.href);var w=o.querySelector(ff(x));if(w)return c.state.loading|=4,c.instance=w,Mr(w),w;h=wE(d),(x=$i.get(x))&&oS(h,x),w=(o.ownerDocument||o).createElement("link"),Mr(w);var _=w;return _._p=new Promise(function(V,Y){_.onload=V,_.onerror=Y}),hs(w,"link",h),c.state.loading|=4,Wg(w,d.precedence,o),c.instance=w;case"script":return w=od(d.src),(x=o.querySelector(hf(w)))?(c.instance=x,Mr(x),x):(h=d,(x=$i.get(w))&&(h=g({},d),aS(h,x)),o=o.ownerDocument||o,x=o.createElement("script"),Mr(x),hs(x,"link",h),o.head.appendChild(x),c.instance=x);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(h=c.instance,c.state.loading|=4,Wg(h,d.precedence,o));return c.instance}function Wg(o,c,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,w=x,_=0;_<h.length;_++){var V=h[_];if(V.dataset.precedence===c)w=V;else if(w!==x)break}w?w.parentNode.insertBefore(o,w.nextSibling):(c=d.nodeType===9?d.head:d,c.insertBefore(o,c.firstChild))}function oS(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.title==null&&(o.title=c.title)}function aS(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.integrity==null&&(o.integrity=c.integrity)}var qg=null;function TE(o,c,d){if(qg===null){var h=new Map,x=qg=new Map;x.set(d,h)}else x=qg,h=x.get(d),h||(h=new Map,x.set(d,h));if(h.has(o))return h;for(h.set(o,null),d=d.getElementsByTagName(o),x=0;x<d.length;x++){var w=d[x];if(!(w[Wt]||w[pn]||o==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var _=w.getAttribute(c)||"";_=o+_;var V=h.get(_);V?V.push(w):h.set(_,[w])}}return h}function DE(o,c,d){o=o.ownerDocument||o,o.head.insertBefore(d,c==="title"?o.querySelector("head > title"):null)}function Tz(o,c,d){if(d===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return o=c.disabled,typeof c.precedence=="string"&&o==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function EE(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function Dz(o,c,d,h){if(d.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var x=id(h.href),w=c.querySelector(ff(x));if(w){c=w._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(o.count++,o=Gg.bind(o),c.then(o,o)),d.state.loading|=4,d.instance=w,Mr(w);return}w=c.ownerDocument||c,h=wE(h),(x=$i.get(x))&&oS(h,x),w=w.createElement("link"),Mr(w);var _=w;_._p=new Promise(function(V,Y){_.onload=V,_.onerror=Y}),hs(w,"link",h),d.instance=w}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(d,c),(c=d.state.preload)&&(d.state.loading&3)===0&&(o.count++,d=Gg.bind(o),c.addEventListener("load",d),c.addEventListener("error",d))}}var lS=0;function Ez(o,c){return o.stylesheets&&o.count===0&&Kg(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var h=setTimeout(function(){if(o.stylesheets&&Kg(o,o.stylesheets),o.unsuspend){var w=o.unsuspend;o.unsuspend=null,w()}},6e4+c);0<o.imgBytes&&lS===0&&(lS=62500*az());var x=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Kg(o,o.stylesheets),o.unsuspend)){var w=o.unsuspend;o.unsuspend=null,w()}},(o.imgBytes>lS?50:800)+c);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(h),clearTimeout(x)}}:null}function Gg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kg(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Zg=null;function Kg(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Zg=new Map,c.forEach(Rz,o),Zg=null,Gg.call(o))}function Rz(o,c){if(!(c.state.loading&4)){var d=Zg.get(o);if(d)var h=d.get(null);else{d=new Map,Zg.set(o,d);for(var x=o.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var _=x[w];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(d.set(_.dataset.precedence,_),h=_)}h&&d.set(null,h)}x=c.instance,_=x.getAttribute("data-precedence"),w=d.get(_)||h,w===h&&d.set(null,x),d.set(_,x),this.count++,h=Gg.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),w?w.parentNode.insertBefore(x,w.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(x,o.firstChild)),c.state.loading|=4}}var mf={$$typeof:T,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function kz(o,c,d,h,x,w,_,V,Y){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Tn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tn(0),this.hiddenUpdates=Tn(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function RE(o,c,d,h,x,w,_,V,Y,ge,Te,Le){return o=new kz(o,c,d,_,Y,ge,Te,Le,V),c=1,w===!0&&(c|=24),w=si(3,null,null,c),o.current=w,w.stateNode=o,c=Bb(),c.refCount++,o.pooledCache=c,c.refCount++,w.memoizedState={element:h,isDehydrated:d,cache:c},Wb(w),o}function kE(o){return o?(o=zu,o):zu}function ME(o,c,d,h,x,w){x=kE(x),h.context===null?h.context=x:h.pendingContext=x,h=rl(c),h.payload={element:d},w=w===void 0?null:w,w!==null&&(h.callback=w),d=sl(o,h,c),d!==null&&(Zs(d,o,c),qp(d,o,c))}function OE(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<c?d:c}}function cS(o,c){OE(o,c),(o=o.alternate)&&OE(o,c)}function AE(o){if(o.tag===13||o.tag===31){var c=jc(o,67108864);c!==null&&Zs(c,o,67108864),cS(o,67108864)}}function _E(o){if(o.tag===13||o.tag===31){var c=ci();c=pr(c);var d=jc(o,c);d!==null&&Zs(d,o,c),cS(o,c)}}var Qg=!0;function Mz(o,c,d,h){var x=L.T;L.T=null;var w=W.p;try{W.p=2,uS(o,c,d,h)}finally{W.p=w,L.T=x}}function Oz(o,c,d,h){var x=L.T;L.T=null;var w=W.p;try{W.p=8,uS(o,c,d,h)}finally{W.p=w,L.T=x}}function uS(o,c,d,h){if(Qg){var x=dS(h);if(x===null)Q0(o,c,h,Jg,d),PE(o,h);else if(_z(x,o,c,d,h))h.stopPropagation();else if(PE(o,h),c&4&&-1<Az.indexOf(o)){for(;x!==null;){var w=Zr(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var _=_t(w.pendingLanes);if(_!==0){var V=w;for(V.pendingLanes|=2,V.entangledLanes|=2;_;){var Y=1<<31-gt(_);V.entanglements[1]|=Y,_&=~Y}zo(w),(Mn&6)===0&&(_g=xe()+500,cf(0))}}break;case 31:case 13:V=jc(w,2),V!==null&&Zs(V,w,2),Pg(),cS(w,2)}if(w=dS(h),w===null&&Q0(o,c,h,Jg,d),w===x)break;x=w}x!==null&&h.stopPropagation()}else Q0(o,c,h,null,d)}}function dS(o){return o=fb(o),pS(o)}var Jg=null;function pS(o){if(Jg=null,o=Jn(o),o!==null){var c=i(o);if(c===null)o=null;else{var d=c.tag;if(d===13){if(o=l(c),o!==null)return o;o=null}else if(d===31){if(o=u(c),o!==null)return o;o=null}else if(d===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null)}}return Jg=o,null}function IE(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ee()){case ne:return 2;case he:return 8;case je:case ze:return 32;case ke:return 268435456;default:return 32}default:return 32}}var fS=!1,ml=null,gl=null,yl=null,gf=new Map,yf=new Map,vl=[],Az="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 PE(o,c){switch(o){case"focusin":case"focusout":ml=null;break;case"dragenter":case"dragleave":gl=null;break;case"mouseover":case"mouseout":yl=null;break;case"pointerover":case"pointerout":gf.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":yf.delete(c.pointerId)}}function vf(o,c,d,h,x,w){return o===null||o.nativeEvent!==w?(o={blockedOn:c,domEventName:d,eventSystemFlags:h,nativeEvent:w,targetContainers:[x]},c!==null&&(c=Zr(c),c!==null&&AE(c)),o):(o.eventSystemFlags|=h,c=o.targetContainers,x!==null&&c.indexOf(x)===-1&&c.push(x),o)}function _z(o,c,d,h,x){switch(c){case"focusin":return ml=vf(ml,o,c,d,h,x),!0;case"dragenter":return gl=vf(gl,o,c,d,h,x),!0;case"mouseover":return yl=vf(yl,o,c,d,h,x),!0;case"pointerover":var w=x.pointerId;return gf.set(w,vf(gf.get(w)||null,o,c,d,h,x)),!0;case"gotpointercapture":return w=x.pointerId,yf.set(w,vf(yf.get(w)||null,o,c,d,h,x)),!0}return!1}function LE(o){var c=Jn(o.target);if(c!==null){var d=i(c);if(d!==null){if(c=d.tag,c===13){if(c=l(d),c!==null){o.blockedOn=c,cs(o.priority,function(){_E(d)});return}}else if(c===31){if(c=u(d),c!==null){o.blockedOn=c,cs(o.priority,function(){_E(d)});return}}else if(c===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Yg(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var d=dS(o.nativeEvent);if(d===null){d=o.nativeEvent;var h=new d.constructor(d.type,d);pb=h,d.target.dispatchEvent(h),pb=null}else return c=Zr(d),c!==null&&AE(c),o.blockedOn=d,!1;c.shift()}return!0}function zE(o,c,d){Yg(o)&&d.delete(c)}function Iz(){fS=!1,ml!==null&&Yg(ml)&&(ml=null),gl!==null&&Yg(gl)&&(gl=null),yl!==null&&Yg(yl)&&(yl=null),gf.forEach(zE),yf.forEach(zE)}function Xg(o,c){o.blockedOn===c&&(o.blockedOn=null,fS||(fS=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Iz)))}var ey=null;function $E(o){ey!==o&&(ey=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ey===o&&(ey=null);for(var c=0;c<o.length;c+=3){var d=o[c],h=o[c+1],x=o[c+2];if(typeof h!="function"){if(pS(h||d)===null)continue;break}var w=Zr(d);w!==null&&(o.splice(c,3),c-=3,d0(w,{pending:!0,data:x,method:d.method,action:h},h,x))}}))}function ad(o){function c(Y){return Xg(Y,o)}ml!==null&&Xg(ml,o),gl!==null&&Xg(gl,o),yl!==null&&Xg(yl,o),gf.forEach(c),yf.forEach(c);for(var d=0;d<vl.length;d++){var h=vl[d];h.blockedOn===o&&(h.blockedOn=null)}for(;0<vl.length&&(d=vl[0],d.blockedOn===null);)LE(d),d.blockedOn===null&&vl.shift();if(d=(o.ownerDocument||o).$$reactFormReplay,d!=null)for(h=0;h<d.length;h+=3){var x=d[h],w=d[h+1],_=x[sr]||null;if(typeof w=="function")_||$E(d);else if(_){var V=null;if(w&&w.hasAttribute("formAction")){if(x=w,_=w[sr]||null)V=_.formAction;else if(pS(x)!==null)continue}else V=_.action;typeof V=="function"?d[h+1]=V:(d.splice(h,3),h-=3),$E(d)}}}function NE(){function o(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(_){return x=_})},focusReset:"manual",scroll:"manual"})}function c(){x!==null&&(x(),x=null),h||setTimeout(d,20)}function d(){if(!h&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,x=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(d,100),function(){h=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),x!==null&&(x(),x=null)}}}function hS(o){this._internalRoot=o}ty.prototype.render=hS.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));var d=c.current,h=ci();ME(d,h,o,c,null,null)},ty.prototype.unmount=hS.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;ME(o.current,2,null,o,null,null),Pg(),c[oo]=null}};function ty(o){this._internalRoot=o}ty.prototype.unstable_scheduleHydration=function(o){if(o){var c=kr();o={blockedOn:null,target:o,priority:c};for(var d=0;d<vl.length&&c!==0&&c<vl[d].priority;d++);vl.splice(d,0,o),d===0&&LE(o)}};var FE=e.version;if(FE!=="19.2.4")throw Error(r(527,FE,"19.2.4"));W.findDOMNode=function(o){var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(c),o=o!==null?m(o):null,o=o===null?null:o.stateNode,o};var Pz={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ny=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ny.isDisabled&&ny.supportsFiber)try{vt=ny.inject(Pz),kt=ny}catch{}}return bf.createRoot=function(o,c){if(!s(o))throw Error(r(299));var d=!1,h="",x=GT,w=ZT,_=KT;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(h=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(w=c.onCaughtError),c.onRecoverableError!==void 0&&(_=c.onRecoverableError)),c=RE(o,1,!1,null,null,d,h,null,x,w,_,NE),o[oo]=c.current,K0(o),new hS(c)},bf.hydrateRoot=function(o,c,d){if(!s(o))throw Error(r(299));var h=!1,x="",w=GT,_=ZT,V=KT,Y=null;return d!=null&&(d.unstable_strictMode===!0&&(h=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(_=d.onCaughtError),d.onRecoverableError!==void 0&&(V=d.onRecoverableError),d.formState!==void 0&&(Y=d.formState)),c=RE(o,1,!0,c,d??null,h,x,Y,w,_,V,NE),c.context=kE(null),d=c.current,h=ci(),h=pr(h),x=rl(h),x.callback=null,sl(d,x,h),d=h,c.current.lanes=d,Je(c,d),zo(c),o[oo]=c.current,K0(o),new ty(c)},bf.version="19.2.4",bf}var JE;function Gz(){if(JE)return vS.exports;JE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),vS.exports=qz(),vS.exports}var Zz=Gz();const Kz=tx(Zz);var gr=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(gr||{});function VA({update:t,notify:e,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:l,shallowPropagate:u};function r(f,m,g){const y=m.depsTail;if(y!==void 0&&y.dep===f)return;const v=y!==void 0?y.nextDep:m.deps;if(v!==void 0&&v.dep===f){v.version=g,m.depsTail=v;return}const C=f.subsTail;if(C!==void 0&&C.version===g&&C.sub===m)return;const S=m.depsTail=f.subsTail={version:g,dep:f,sub:m,prevDep:y,nextDep:v,prevSub:C,nextSub:void 0};v!==void 0&&(v.prevDep=S),y!==void 0?y.nextDep=S:m.deps=S,C!==void 0?C.nextSub=S:f.subs=S}function s(f,m=f.sub){const g=f.dep,y=f.prevDep,v=f.nextDep,C=f.nextSub,S=f.prevSub;return v!==void 0?v.prevDep=y:m.depsTail=y,y!==void 0?y.nextDep=v:m.deps=v,C!==void 0?C.prevSub=S:g.subsTail=S,S!==void 0?S.nextSub=C:(g.subs=C)===void 0&&n(g),v}function i(f){let m=f.nextSub,g;e:do{const y=f.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&p(f,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&e(y),v&1){const C=y.subs;if(C!==void 0){const S=(f=C).nextSub;S!==void 0&&(g={value:m,prev:g},m=S);continue}}if((f=m)!==void 0){m=f.nextSub;continue}for(;g!==void 0;)if(f=g.value,g=g.prev,f!==void 0){m=f.nextSub;continue e}break}while(!0)}function l(f,m){let g,y=0,v=!1;e:do{const C=f.dep,S=C.flags;if(m.flags&16)v=!0;else if((S&17)===17){if(t(C)){const j=C.subs;j.nextSub!==void 0&&u(j),v=!0}}else if((S&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(g={value:f,prev:g}),f=C.deps,m=C,++y;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;y--;){const j=m.subs,D=j.nextSub!==void 0;if(D?(f=g.value,g=g.prev):f=j,v){if(t(m)){D&&u(j),m=f.sub;continue}v=!1}else m.flags&=-33;m=f.sub;const M=f.nextDep;if(M!==void 0){f=M;continue e}}return v}while(!0)}function u(f){do{const m=f.sub,g=m.flags;(g&48)===32&&(m.flags=g|16,(g&6)===2&&e(m))}while((f=f.nextSub)!==void 0)}function p(f,m){let g=m.depsTail;for(;g!==void 0;){if(g===f)return!0;g=g.prevDep}return!1}}let dw=0,zc=0,eh=0;const za=[],{link:wue,unlink:HA,propagate:jue,checkDirty:Qz,shallowPropagate:Tue}=VA({update(t){return t.depsTail!==void 0?e3(t):t3(t)},notify(t){var r;let e=eh,n=e;do if(za[e++]=t,t.flags&=-3,t=(r=t.subs)==null?void 0:r.sub,t===void 0||!(t.flags&2))break;while(!0);for(eh=e;n<--e;){const s=za[n];za[n++]=za[e],za[e]=s}},unwatched(t){t.flags&1?t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=17,nx(t)):s3.call(t)}});function Jz(){return dw}function Yz(){++dw}function Xz(){--dw||r3()}function e3(t){t.depsTail=void 0,t.flags=5;try{const e=t.value;return e!==(t.value=t.getter(e))}finally{t.flags&=-5,nx(t)}}function t3(t){return t.flags=1,t.currentValue!==(t.currentValue=t.pendingValue)}function n3(t){const e=t.flags;if(e&16||e&32&&Qz(t.deps,t)){t.depsTail=void 0,t.flags=6;try{t.fn()}finally{t.flags&=-5,nx(t)}}else t.flags=2}function r3(){try{for(;zc<eh;){const t=za[zc];za[zc++]=void 0,n3(t)}}finally{for(;zc<eh;){const t=za[zc];za[zc++]=void 0,t.flags|=10}zc=0,eh=0}}function s3(){this.depsTail=void 0,this.flags=0,nx(this);const t=this.subs;t!==void 0&&HA(t)}function nx(t){const e=t.depsTail;let n=e!==void 0?e.nextDep:t.deps;for(;n!==void 0;)n=HA(n,t)}function WA(t,e,n){var i,l,u;const r=typeof t=="object",s=r?t:void 0;return{next:(i=r?t.next:t)==null?void 0:i.bind(s),error:(l=r?t.error:e)==null?void 0:l.bind(s),complete:(u=r?t.complete:n)==null?void 0:u.bind(s)}}const A1=[];let Fy=0;const{link:YE,unlink:i3,propagate:o3,checkDirty:qA,shallowPropagate:XE}=VA({update(t){return t._update()},notify(t){A1[_1++]=t,t.flags&=~gr.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=gr.Mutable|gr.Dirty,ev(t))}});let sy=0,_1=0,No;function ev(t){const e=t.depsTail;let n=e!==void 0?e.nextDep:t.deps;for(;n!==void 0;)n=i3(n,t)}function GA(){if(!(Jz()>0)){for(;sy<_1;){const t=A1[sy];A1[sy++]=void 0,t.notify()}sy=0,_1=0}}function a3(t,e){const n=typeof t=="function",r=t,s={_snapshot:n?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?gr.None:gr.Mutable,get(){return No!==void 0&&YE(s,No,Fy),s._snapshot},subscribe(i){const l=WA(i),u={current:!1},p=l3(()=>{var f;s.get(),u.current?(f=l.next)==null||f.call(l,s._snapshot):u.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(i){const l=No,u=Object.is;No=s,++Fy,s.depsTail=void 0,n&&(s.flags=gr.Mutable|gr.RecursedCheck);try{const p=s._snapshot,f=typeof i=="function"?i(p):i===void 0&&n?r(p):i;return p===void 0||!u(p,f)?(s._snapshot=f,!0):!1}finally{No=l,n&&(s.flags&=~gr.RecursedCheck),ev(s)}}};return n?(s.flags=gr.Mutable|gr.Dirty,s.get=function(){const i=s.flags;if(i&gr.Dirty||i&gr.Pending&&qA(s.deps,s)){if(s._update()){const l=s.subs;l!==void 0&&XE(l)}}else i&gr.Pending&&(s.flags=i&~gr.Pending);return No!==void 0&&YE(s,No,Fy),s._snapshot}):s.set=function(i){if(s._update(i)){const l=s.subs;l!==void 0&&(o3(l),XE(l),GA())}},s}function l3(t){const e=()=>{const r=No;No=n,++Fy,n.depsTail=void 0,n.flags=gr.Watching|gr.RecursedCheck;try{return t()}finally{No=r,n.flags&=~gr.RecursedCheck,ev(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:gr.Watching|gr.RecursedCheck,notify(){const r=this.flags;r&gr.Dirty||r&gr.Pending&&qA(this.deps,this)?e():this.flags=gr.Watching},stop(){this.flags=gr.None,this.depsTail=void 0,ev(this)}};return e(),n}let c3=class{constructor(e){this.atom=a3(e)}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(WA(e))}};function u3(t){try{Yz(),t()}finally{Xz(),GA()}}const ql="__TSR_index",eR="popstate",tR="beforeunload";function d3(t){let e=t.getLocation();const n=new Set,r=l=>{e=t.getLocation(),n.forEach(u=>u({location:e,action:l}))},s=l=>{t.notifyOnIndexChange??!0?r(l):e=t.getLocation()},i=async({task:l,navigateOpts:u,...p})=>{var y,v;if((u==null?void 0:u.ignoreBlocker)??!1){l();return}const m=((y=t.getBlockers)==null?void 0:y.call(t))??[],g=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&m.length&&g)for(const C of m){const S=tv(p.path,p.state);if(await C.blockerFn({currentLocation:e,nextLocation:S,action:p.type})){(v=t.onBlocked)==null||v.call(t);return}}l()};return{get location(){return e},get length(){return t.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,p)=>{const f=e.state[ql];u=nR(f+1,u),i({task:()=>{t.pushState(l,u),r({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:l,state:u})},replace:(l,u,p)=>{const f=e.state[ql];u=nR(f,u),i({task:()=>{t.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:l,state:u})},go:(l,u)=>{i({task:()=>{t.go(l),s({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{i({task:()=>{t.back((l==null?void 0:l.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{i({task:()=>{t.forward((l==null?void 0:l.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>e.state[ql]!==0,createHref:l=>t.createHref(l),block:l=>{var p;if(!t.setBlockers)return()=>{};const u=((p=t.getBlockers)==null?void 0:p.call(t))??[];return t.setBlockers([...u,l]),()=>{var m,g;const f=((m=t.getBlockers)==null?void 0:m.call(t))??[];(g=t.setBlockers)==null||g.call(t,f.filter(y=>y!==l))}},flush:()=>{var l;return(l=t.flush)==null?void 0:l.call(t)},destroy:()=>{var l;return(l=t.destroy)==null?void 0:l.call(t)},notify:r}}function nR(t,e){e||(e={});const n=pw();return{...e,key:n,__TSR_key:n,[ql]:t}}function p3(t){var I,$;const e=typeof document<"u"?window:void 0,n=e.history.pushState,r=e.history.replaceState;let s=[];const i=()=>s,l=R=>s=R,u=(R=>R),p=(()=>tv(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!((I=e.history.state)!=null&&I.__TSR_key)&&!(($=e.history.state)!=null&&$.key)){const R=pw();e.history.replaceState({[ql]:0,key:R,__TSR_key:R},"")}let f=p(),m,g=!1,y=!1,v=!1,C=!1;const S=()=>f;let j,D;const M=()=>{j&&(O._ignoreSubscribers=!0,(j.isPush?e.history.pushState:e.history.replaceState)(j.state,"",j.href),O._ignoreSubscribers=!1,j=void 0,D=void 0,m=void 0)},T=(R,P,z)=>{const N=u(P);D||(m=f),f=tv(P,z),j={href:N,state:z,isPush:(j==null?void 0:j.isPush)||R==="push"},D||(D=Promise.resolve().then(()=>M()))},E=R=>{f=p(),O.notify({type:R})},k=async()=>{if(y){y=!1;return}const R=p(),P=R.state[ql]-f.state[ql],z=P===1,N=P===-1,H=!z&&!N||g;g=!1;const U=H?"GO":N?"BACK":"FORWARD",L=H?{type:"GO",index:P}:{type:N?"BACK":"FORWARD"};if(v)v=!1;else{const W=i();if(typeof document<"u"&&W.length){for(const K of W)if(await K.blockerFn({currentLocation:f,nextLocation:R,action:U})){y=!0,e.history.go(1),O.notify(L);return}}}f=p(),O.notify(L)},A=R=>{if(C){C=!1;return}let P=!1;const z=i();if(typeof document<"u"&&z.length)for(const N of z){const H=N.enableBeforeUnload??!0;if(H===!0){P=!0;break}if(typeof H=="function"&&H()===!0){P=!0;break}}if(P)return R.preventDefault(),R.returnValue=""},O=d3({getLocation:S,getLength:()=>e.history.length,pushState:(R,P)=>T("push",R,P),replaceState:(R,P)=>T("replace",R,P),back:R=>(R&&(v=!0),C=!0,e.history.back()),forward:R=>{R&&(v=!0),C=!0,e.history.forward()},go:R=>{g=!0,e.history.go(R)},createHref:R=>u(R),flush:M,destroy:()=>{e.history.pushState=n,e.history.replaceState=r,e.removeEventListener(tR,A,{capture:!0}),e.removeEventListener(eR,k)},onBlocked:()=>{m&&f!==m&&(f=m)},getBlockers:i,setBlockers:l,notifyOnIndexChange:!1});return e.addEventListener(tR,A,{capture:!0}),e.addEventListener(eR,k),e.history.pushState=function(...R){const P=n.apply(e.history,R);return O._ignoreSubscribers||E("PUSH"),P},e.history.replaceState=function(...R){const P=r.apply(e.history,R);return O._ignoreSubscribers||E("REPLACE"),P},O}function f3(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function tv(t,e){const n=f3(t),r=n.indexOf("#"),s=n.indexOf("?"),i=pw();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:e||{[ql]:0,key:i,__TSR_key:i}}}function pw(){return(Math.random()+1).toString(36).substring(7)}const h3=!1;function th(t){let e;return u3(()=>{e=t()}),e}function gh(t){return t[t.length-1]}function m3(t){return typeof t=="function"}function Fl(t,e){return m3(t)?t(e):t}const g3=Object.prototype.hasOwnProperty,rR=Object.prototype.propertyIsEnumerable;function di(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=e,s=oR(t)&&oR(r);if(!s&&!(nv(t)&&nv(r)))return r;const i=s?t:sR(t);if(!i)return r;const l=s?r:sR(r);if(!l)return r;const u=i.length,p=l.length,f=s?new Array(p):{};let m=0;for(let g=0;g<p;g++){const y=s?g:l[g],v=t[y],C=r[y];if(v===C){f[y]=v,(s?g<u:g3.call(t,y))&&m++;continue}if(v===null||C===null||typeof v!="object"||typeof C!="object"){f[y]=C;continue}const S=di(v,C,n+1);f[y]=S,S===v&&m++}return u===p&&m===u?t:f}function sR(t){const e=Object.getOwnPropertyNames(t);for(const s of e)if(!rR.call(t,s))return!1;const n=Object.getOwnPropertySymbols(t);if(n.length===0)return e;const r=e;for(const s of n){if(!rR.call(t,s))return!1;r.push(s)}return r}function nv(t){if(!iR(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const n=e.prototype;return!(!iR(n)||!n.hasOwnProperty("isPrototypeOf"))}function iR(t){return Object.prototype.toString.call(t)==="[object Object]"}function oR(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function iu(t,e,n){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,s=t.length;r<s;r++)if(!iu(t[r],e[r],n))return!1;return!0}if(nv(t)&&nv(e)){const r=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const l in e)if((!r||e[l]!==void 0)&&!iu(t[l],e[l],n))return!1;return!0}let s=0;if(!r)s=Object.keys(t).length;else for(const l in t)t[l]!==void 0&&s++;let i=0;for(const l in e)if((!r||e[l]!==void 0)&&(i++,i>s||!iu(t[l],e[l],n)))return!1;return s===i}return!1}function Jd(t){let e,n;const r=new Promise((s,i)=>{e=s,n=i});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,e(s),t==null||t(s)},r.reject=s=>{r.status="rejected",n(s)},r}function Md(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function y3(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}function aR(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return y3(e)}const v3=["http:","https:","mailto:","tel:"];function rv(t,e){if(!t)return!1;try{const n=new URL(t);return!e.has(n.protocol)}catch{return!1}}function Sf(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const e=/%25|%5C/gi;let n=0,r="",s;for(;(s=e.exec(t))!==null;)r+=aR(t.slice(n,s.index))+s[0],n=e.lastIndex;r=r+aR(n?t.slice(n):t);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function x3(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}var b3="Invariant failed";function Ha(t,e){if(!t)throw new Error(b3)}function sv(t){const e=new Map;let n,r;const s=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,n=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const l=e.get(i);if(l)return s(l),l.value},set(i,l){if(e.size>=t&&n){const p=n;e.delete(p.key),p.next&&(n=p.next,p.next.prev=void 0),p===r&&(r=void 0)}const u=e.get(i);if(u)u.value=l,s(u);else{const p={key:i,value:l,prev:r};r&&(r.next=p),r=p,n||(n=p),e.set(i,p)}},clear(){e.clear(),n=void 0,r=void 0}}}const Yd=0,pu=1,fu=2,yh=3,Vc=4,ZA=5;function S3(t){const e=t.indexOf("{");if(e===-1)return null;const n=t.indexOf("}",e);return n===-1||e+1>=t.length?null:[e,n]}function fw(t,e,n=new Uint16Array(6)){const r=t.indexOf("/",e),s=r===-1?t.length:r,i=t.substring(e,s);if(!i||!i.includes("$"))return n[0]=Yd,n[1]=e,n[2]=e,n[3]=s,n[4]=s,n[5]=s,n;if(i==="$"){const u=t.length;return n[0]=fu,n[1]=e,n[2]=e,n[3]=u,n[4]=u,n[5]=u,n}if(i.charCodeAt(0)===36)return n[0]=pu,n[1]=e,n[2]=e+1,n[3]=s,n[4]=s,n[5]=s,n;const l=S3(i);if(l){const[u,p]=l,f=i.charCodeAt(u+1);if(f===45){if(u+2<i.length&&i.charCodeAt(u+2)===36){const m=u+3,g=p;if(m<g)return n[0]=yh,n[1]=e+u,n[2]=e+m,n[3]=e+g,n[4]=e+p+1,n[5]=s,n}}else if(f===36){const m=u+1,g=u+2;return g===p?(n[0]=fu,n[1]=e+u,n[2]=e+m,n[3]=e+g,n[4]=e+p+1,n[5]=t.length,n):(n[0]=pu,n[1]=e+u,n[2]=e+g,n[3]=e+p,n[4]=e+p+1,n[5]=s,n)}}return n[0]=Yd,n[1]=e,n[2]=e,n[3]=s,n[4]=s,n[5]=s,n}function rx(t,e,n,r,s,i,l){var p,f,m,g,y,v,C,S,j,D,M,T,E;l==null||l(n);let u=r;{const k=n.fullPath??n.from,A=k.length,O=((p=n.options)==null?void 0:p.caseSensitive)??t,I=!!((m=(f=n.options)==null?void 0:f.params)!=null&&m.parse&&((y=(g=n.options)==null?void 0:g.skipRouteOnParseError)!=null&&y.params));for(;u<A;){const R=fw(k,u,e);let P;const z=u,N=R[5];switch(u=N+1,i++,R[0]){case Yd:{const U=k.substring(R[2],R[3]);if(O){const L=(v=s.static)==null?void 0:v.get(U);if(L)P=L;else{s.static??(s.static=new Map);const W=Hc(n.fullPath??n.from);W.parent=s,W.depth=i,P=W,s.static.set(U,W)}}else{const L=U.toLowerCase(),W=(C=s.staticInsensitive)==null?void 0:C.get(L);if(W)P=W;else{s.staticInsensitive??(s.staticInsensitive=new Map);const K=Hc(n.fullPath??n.from);K.parent=s,K.depth=i,P=K,s.staticInsensitive.set(L,K)}}break}case pu:{const U=k.substring(z,R[1]),L=k.substring(R[4],N),W=O&&!!(U||L),K=U?W?U:U.toLowerCase():void 0,Q=L?W?L:L.toLowerCase():void 0,le=!I&&((S=s.dynamic)==null?void 0:S.find(F=>!F.skipOnParamError&&F.caseSensitive===W&&F.prefix===K&&F.suffix===Q));if(le)P=le;else{const F=wS(pu,n.fullPath??n.from,W,K,Q);P=F,F.depth=i,F.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(F)}break}case yh:{const U=k.substring(z,R[1]),L=k.substring(R[4],N),W=O&&!!(U||L),K=U?W?U:U.toLowerCase():void 0,Q=L?W?L:L.toLowerCase():void 0,le=!I&&((j=s.optional)==null?void 0:j.find(F=>!F.skipOnParamError&&F.caseSensitive===W&&F.prefix===K&&F.suffix===Q));if(le)P=le;else{const F=wS(yh,n.fullPath??n.from,W,K,Q);P=F,F.parent=s,F.depth=i,s.optional??(s.optional=[]),s.optional.push(F)}break}case fu:{const U=k.substring(z,R[1]),L=k.substring(R[4],N),W=O&&!!(U||L),K=U?W?U:U.toLowerCase():void 0,Q=L?W?L:L.toLowerCase():void 0,le=wS(fu,n.fullPath??n.from,W,K,Q);P=le,le.parent=s,le.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push(le)}}s=P}if(I&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const R=Hc(n.fullPath??n.from);R.kind=ZA,R.parent=s,i++,R.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(R),s=R}const $=(n.path||!n.children)&&!n.isRoot;if($&&k.endsWith("/")){const R=Hc(n.fullPath??n.from);R.kind=Vc,R.parent=s,i++,R.depth=i,s.index=R,s=R}s.parse=((M=(D=n.options)==null?void 0:D.params)==null?void 0:M.parse)??null,s.skipOnParamError=I,s.parsingPriority=((E=(T=n.options)==null?void 0:T.skipRouteOnParseError)==null?void 0:E.priority)??0,$&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const k of n.children)rx(t,e,k,u,s,i,l)}function CS(t,e){if(t.skipOnParamError&&!e.skipOnParamError)return-1;if(!t.skipOnParamError&&e.skipOnParamError)return 1;if(t.skipOnParamError&&e.skipOnParamError&&(t.parsingPriority||e.parsingPriority))return e.parsingPriority-t.parsingPriority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function jl(t){var e,n,r;if(t.pathless)for(const s of t.pathless)jl(s);if(t.static)for(const s of t.static.values())jl(s);if(t.staticInsensitive)for(const s of t.staticInsensitive.values())jl(s);if((e=t.dynamic)!=null&&e.length){t.dynamic.sort(CS);for(const s of t.dynamic)jl(s)}if((n=t.optional)!=null&&n.length){t.optional.sort(CS);for(const s of t.optional)jl(s)}if((r=t.wildcard)!=null&&r.length){t.wildcard.sort(CS);for(const s of t.wildcard)jl(s)}}function Hc(t){return{kind:Yd,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function wS(t,e,n,r,s){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function C3(t,e){const n=Hc("/"),r=new Uint16Array(6);for(const s of t)rx(!1,r,s,1,n,0);jl(n),e.masksTree=n,e.flatCache=sv(1e3)}function w3(t,e){t||(t="/");const n=e.flatCache.get(t);if(n)return n;const r=hw(t,e.masksTree);return e.flatCache.set(t,r),r}function j3(t,e,n,r,s){t||(t="/"),r||(r="/");const i=e?`case\0${t}`:t;let l=s.singleCache.get(i);if(!l){l=Hc("/");const u=new Uint16Array(6);rx(e,u,{from:t},1,l,0),s.singleCache.set(i,l)}return hw(r,l,n)}function T3(t,e,n=!1){const r=n?t:`nofuzz\0${t}`,s=e.matchCache.get(r);if(s!==void 0)return s;t||(t="/");let i;try{i=hw(t,e.segmentTree,n)}catch(l){if(l instanceof URIError)i=null;else throw l}return i&&(i.branch=R3(i.route)),e.matchCache.set(r,i),i}function D3(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function E3(t,e=!1,n){const r=Hc(t.fullPath),s=new Uint16Array(6),i={},l={};let u=0;return rx(e,s,t,1,r,0,f=>{if(n==null||n(f,u),Ha(!(f.id in i),`Duplicate routes found with id: ${String(f.id)}`),i[f.id]=f,u!==0&&f.path){const m=D3(f.fullPath);(!l[m]||f.fullPath.endsWith("/"))&&(l[m]=f)}u++}),jl(r),{processedTree:{segmentTree:r,singleCache:sv(1e3),matchCache:sv(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:l}}function hw(t,e,n=!1){const r=t.split("/"),s=M3(t,r,e,n);if(!s)return null;const[i]=KA(t,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function KA(t,e,n){var m,g,y,v,C,S,j,D,M,T;const r=k3(n.node);let s=null;const i={};let l=((m=n.extract)==null?void 0:m.part)??0,u=((g=n.extract)==null?void 0:g.node)??0,p=((y=n.extract)==null?void 0:y.path)??0,f=((v=n.extract)==null?void 0:v.segment)??0;for(;u<r.length;l++,u++,p++,f++){const E=r[u];if(E.kind===Vc)break;if(E.kind===ZA){f--,l--,p--;continue}const k=e[l],A=p;if(k&&(p+=k.length),E.kind===pu){s??(s=n.node.fullPath.split("/"));const O=s[f],I=((C=E.prefix)==null?void 0:C.length)??0;if(O.charCodeAt(I)===123){const R=((S=E.suffix)==null?void 0:S.length)??0,P=O.substring(I+2,O.length-R-1),z=k.substring(I,k.length-R);i[P]=decodeURIComponent(z)}else{const R=O.substring(1);i[R]=decodeURIComponent(k)}}else if(E.kind===yh){if(n.skipped&1<<u){l--,p=A-1;continue}s??(s=n.node.fullPath.split("/"));const O=s[f],I=((j=E.prefix)==null?void 0:j.length)??0,$=((D=E.suffix)==null?void 0:D.length)??0,R=O.substring(I+3,O.length-$-1),P=E.suffix||E.prefix?k.substring(I,k.length-$):k;P&&(i[R]=decodeURIComponent(P))}else if(E.kind===fu){const O=E,I=t.substring(A+(((M=O.prefix)==null?void 0:M.length)??0),t.length-(((T=O.suffix)==null?void 0:T.length)??0)),$=decodeURIComponent(I);i["*"]=$,i._splat=$;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:l,node:u,path:p,segment:f}]}function R3(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function k3(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function M3(t,e,n,r){if(t==="/"&&n.index)return{node:n.index,skipped:0};const s=!gh(e),i=s&&t!=="/",l=e.length-(s?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let p=null,f=null,m=null;for(;u.length;){const g=u.pop(),{node:y,index:v,skipped:C,depth:S,statics:j,dynamics:D,optionals:M}=g;let{extract:T,rawParams:E,parsedParams:k}=g;if(y.skipOnParamError){if(!jS(t,e,g))continue;E=g.rawParams,T=g.extract,k=g.parsedParams}r&&y.route&&y.kind!==Vc&&Cf(f,g)&&(f=g);const A=v===l;if(A&&(y.route&&!i&&Cf(m,g)&&(m=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const O=A?void 0:e[v];let I;if(A&&y.index){const $={node:y.index,index:v,skipped:C,depth:S+1,statics:j,dynamics:D,optionals:M,extract:T,rawParams:E,parsedParams:k};let R=!0;if(y.index.skipOnParamError&&(jS(t,e,$)||(R=!1)),R){if(j===l&&!D&&!M&&!C)return $;Cf(m,$)&&(m=$)}}if(y.wildcard&&Cf(p,g))for(const $ of y.wildcard){const{prefix:R,suffix:P}=$;if(R&&(A||!($.caseSensitive?O:I??(I=O.toLowerCase())).startsWith(R)))continue;if(P){if(A)continue;const N=e.slice(v).join("/").slice(-P.length);if(($.caseSensitive?N:N.toLowerCase())!==P)continue}const z={node:$,index:l,skipped:C,depth:S,statics:j,dynamics:D,optionals:M,extract:T,rawParams:E,parsedParams:k};if(!($.skipOnParamError&&!jS(t,e,z))){p=z;break}}if(y.optional){const $=C|1<<S,R=S+1;for(let P=y.optional.length-1;P>=0;P--){const z=y.optional[P];u.push({node:z,index:v,skipped:$,depth:R,statics:j,dynamics:D,optionals:M,extract:T,rawParams:E,parsedParams:k})}if(!A)for(let P=y.optional.length-1;P>=0;P--){const z=y.optional[P],{prefix:N,suffix:H}=z;if(N||H){const U=z.caseSensitive?O:I??(I=O.toLowerCase());if(N&&!U.startsWith(N)||H&&!U.endsWith(H))continue}u.push({node:z,index:v+1,skipped:C,depth:R,statics:j,dynamics:D,optionals:M+1,extract:T,rawParams:E,parsedParams:k})}}if(!A&&y.dynamic&&O)for(let $=y.dynamic.length-1;$>=0;$--){const R=y.dynamic[$],{prefix:P,suffix:z}=R;if(P||z){const N=R.caseSensitive?O:I??(I=O.toLowerCase());if(P&&!N.startsWith(P)||z&&!N.endsWith(z))continue}u.push({node:R,index:v+1,skipped:C,depth:S+1,statics:j,dynamics:D+1,optionals:M,extract:T,rawParams:E,parsedParams:k})}if(!A&&y.staticInsensitive){const $=y.staticInsensitive.get(I??(I=O.toLowerCase()));$&&u.push({node:$,index:v+1,skipped:C,depth:S+1,statics:j+1,dynamics:D,optionals:M,extract:T,rawParams:E,parsedParams:k})}if(!A&&y.static){const $=y.static.get(O);$&&u.push({node:$,index:v+1,skipped:C,depth:S+1,statics:j+1,dynamics:D,optionals:M,extract:T,rawParams:E,parsedParams:k})}if(y.pathless){const $=S+1;for(let R=y.pathless.length-1;R>=0;R--){const P=y.pathless[R];u.push({node:P,index:v,skipped:C,depth:$,statics:j,dynamics:D,optionals:M,extract:T,rawParams:E,parsedParams:k})}}}if(m&&p)return Cf(p,m)?m:p;if(m)return m;if(p)return p;if(r&&f){let g=f.index;for(let v=0;v<f.index;v++)g+=e[v].length;const y=g===t.length?"/":t.slice(g);return f.rawParams??(f.rawParams={}),f.rawParams["**"]=decodeURIComponent(y),f}return null}function jS(t,e,n){try{const[r,s]=KA(t,e,n);n.rawParams=r,n.extract=s;const i=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,i),!0}catch{return null}}function Cf(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===Vc)>(t.node.kind===Vc)||e.node.kind===Vc==(t.node.kind===Vc)&&e.depth>t.depth))):!0}function By(t){return mw(t.filter(e=>e!==void 0).join("/"))}function mw(t){return t.replace(/\/{2,}/g,"/")}function QA(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function $a(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function JA(t){return $a(QA(t))}function iv(t,e){return t!=null&&t.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function O3(t,e,n){return iv(t,n)===iv(e,n)}function A3({base:t,to:e,trailingSlash:n="never",cache:r}){const s=e.startsWith("/"),i=!s&&e===".";let l;if(r){l=s?e:i?t:t+"\0"+e;const g=r.get(l);if(g)return g}let u;if(i)u=t.split("/");else if(s)u=e.split("/");else{for(u=t.split("/");u.length>1&&gh(u)==="";)u.pop();const g=e.split("/");for(let y=0,v=g.length;y<v;y++){const C=g[y];C===""?y?y===v-1&&u.push(C):u=[C]:C===".."?u.pop():C==="."||u.push(C)}}u.length>1&&(gh(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let p,f="";for(let g=0;g<u.length;g++){g>0&&(f+="/");const y=u[g];if(!y)continue;p=fw(y,0,p);const v=p[0];if(v===Yd){f+=y;continue}const C=p[5],S=y.substring(0,p[1]),j=y.substring(p[4],C),D=y.substring(p[2],p[3]);v===pu?f+=S||j?`${S}{$${D}}${j}`:`$${D}`:v===fu?f+=S||j?`${S}{$}${j}`:"$":f+=`${S}{-$${D}}${j}`}f=mw(f);const m=f||"/";return l&&r&&r.set(l,m),m}function _3(t){const e=new Map(t.map(s=>[encodeURIComponent(s),s])),n=Array.from(e.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,i=>e.get(i)??i)}function TS(t,e,n){const r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>lR(s,n)).join("/"):lR(r,n)}function DS({path:t,params:e,decoder:n,...r}){let s=!1;const i={};if(!t||t==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!t.includes("$"))return{interpolatedPath:t,usedParams:i,isMissingParams:s};const l=t.length;let u=0,p,f="";for(;u<l;){const g=u;p=fw(t,g,p);const y=p[5];if(u=y+1,g===y)continue;const v=p[0];if(v===Yd){f+="/"+t.substring(g,y);continue}if(v===fu){const C=e._splat;i._splat=C,i["*"]=C;const S=t.substring(g,p[1]),j=t.substring(p[4],y);if(!C){s=!0,(S||j)&&(f+="/"+S+j);continue}const D=TS("_splat",e,n);f+="/"+S+D+j;continue}if(v===pu){const C=t.substring(p[2],p[3]);!s&&!(C in e)&&(s=!0),i[C]=e[C];const S=t.substring(g,p[1]),j=t.substring(p[4],y),D=TS(C,e,n)??"undefined";f+="/"+S+D+j;continue}if(v===yh){const C=t.substring(p[2],p[3]),S=e[C];if(S==null)continue;i[C]=S;const j=t.substring(g,p[1]),D=t.substring(p[4],y),M=TS(C,e,n)??"";f+="/"+j+M+D;continue}}return t.endsWith("/")&&(f+="/"),{usedParams:i,interpolatedPath:f||"/",isMissingParams:s}}function lR(t,e){const n=encodeURIComponent(t);return(e==null?void 0:e(n))??n}function xi(t){return!!(t!=null&&t.isNotFound)}function I3(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const I1="tsr-scroll-restoration-v1_3",P3=(t,e)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{t(...r),n=null},e))}};function L3(){const t=I3();if(!t)return null;const e=t.getItem(I1);let n=e?JSON.parse(e):{};return{state:n,set:r=>{n=Fl(r,n)||n;try{t.setItem(I1,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const iy=L3(),z3=t=>t.state.__TSR_key||t.href;function $3(t){const e=[];let n;for(;n=t.parentNode;)e.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,t)+1})`),t=n;return`${e.reverse().join(" > ")}`.toLowerCase()}let ov=!1;function N3({storageKey:t,key:e,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:s,location:i}){var f,m;let l;try{l=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(g){console.error(g);return}const u=e||((f=window.history.state)==null?void 0:f.__TSR_key),p=l[u];ov=!0;e:{if(r&&p&&Object.keys(p).length>0){for(const v in p){const C=p[v];if(v==="window")window.scrollTo({top:C.scrollY,left:C.scrollX,behavior:n});else if(v){const S=document.querySelector(v);S&&(S.scrollLeft=C.scrollX,S.scrollTop=C.scrollY)}}break e}const g=(i??window.location).hash.split("#",2)[1];if(g){const v=((m=window.history.state)==null?void 0:m.__hashScrollIntoViewOptions)??!0;if(v){const C=document.getElementById(g);C&&C.scrollIntoView(v)}break e}const y={top:0,left:0,behavior:n};if(window.scrollTo(y),s)for(const v of s){if(v==="window")continue;const C=typeof v=="function"?v():document.querySelector(v);C&&C.scrollTo(y)}}ov=!1}function F3(t,e){if(!iy||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isScrollRestorationSetup||!iy))return;t.isScrollRestorationSetup=!0,ov=!1;const r=t.options.getScrollRestorationKey||z3;window.history.scrollRestoration="manual";const s=i=>{if(ov||!t.isScrollRestoring)return;let l="";if(i.target===document||i.target===window)l="window";else{const p=i.target.getAttribute("data-scroll-restoration-id");p?l=`[data-scroll-restoration-id="${p}"]`:l=$3(i.target)}const u=r(t.state.location);iy.set(p=>{const f=p[u]||(p[u]={}),m=f[l]||(f[l]={});if(l==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(l){const g=document.querySelector(l);g&&(m.scrollX=g.scrollLeft||0,m.scrollY=g.scrollTop||0)}return p})};typeof document<"u"&&document.addEventListener("scroll",P3(s,100),!0),t.subscribe("onRendered",i=>{const l=r(i.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(N3({storageKey:I1,key:l,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&iy.set(u=>(u[l]||(u[l]={}),u)))})}function B3(t){if(typeof document<"u"&&document.querySelector){const e=t.state.location.state.__hashScrollIntoViewOptions??!0;if(e&&t.state.location.hash!==""){const n=document.getElementById(t.state.location.hash);n&&n.scrollIntoView(e)}}}function U3(t,e=String){const n=new URLSearchParams;for(const r in t){const s=t[r];s!==void 0&&n.set(r,e(s))}return n.toString()}function ES(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function V3(t){const e=new URLSearchParams(t),n={};for(const[r,s]of e.entries()){const i=n[r];i==null?n[r]=ES(s):Array.isArray(i)?i.push(ES(s)):n[r]=[i,ES(s)]}return n}const H3=q3(JSON.parse),W3=G3(JSON.stringify,JSON.parse);function q3(t){return e=>{e[0]==="?"&&(e=e.substring(1));const n=V3(e);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=t(s)}catch{}}return n}}function G3(t,e){const n=typeof e=="function";function r(s){if(typeof s=="object"&&s!==null)try{return t(s)}catch{}else if(n&&typeof s=="string")try{return e(s),t(s)}catch{}return s}return s=>{const i=U3(s,r);return i?`?${i}`:""}}const Vi="__root__";function Z3(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const n=new Response(null,{status:t.statusCode,headers:e});if(n.options=t,t.throw)throw n;return n}function Zi(t){return t instanceof Response&&!!t.options}const Uy=t=>{var e;if(!t.rendered)return t.rendered=!0,(e=t.onReady)==null?void 0:e.call(t)},sx=(t,e)=>!!(t.preload&&!t.router.state.matches.some(n=>n.id===e)),Od=(t,e,n=!0)=>{const r={...t.router.options.context??{}},s=n?e:e-1;for(let i=0;i<=s;i++){const l=t.matches[i];if(!l)continue;const u=t.router.getMatch(l.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},YA=(t,e,n)=>{var l;const r=t.router.routesById[e.routeId??""]??t.router.routeTree;!r.options.notFoundComponent&&((l=t.router.options)!=null&&l.defaultNotFoundComponent)&&(r.options.notFoundComponent=t.router.options.defaultNotFoundComponent);const s=n==="BEFORE_LOAD"&&r.parentRoute;s||Ha(r.options.notFoundComponent);const i=t.matches.find(u=>u.routeId===r.id);Ha(i,"Could not find match for route: "+r.id),t.updateMatch(i.id,u=>({...u,status:"notFound",error:e,isFetching:!1})),s&&(e.routeId=r.parentRoute.id,YA(t,e,n))},Bl=(t,e,n,r)=>{var s,i,l;if(!(!Zi(n)&&!xi(n))){if(Zi(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(e){(s=e._nonReactive.beforeLoadPromise)==null||s.resolve(),(i=e._nonReactive.loaderPromise)==null||i.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0;const u=Zi(n)?"redirected":"notFound";e._nonReactive.error=n,t.updateMatch(e.id,p=>({...p,status:u,context:Od(t,e.index),isFetching:!1,error:n})),xi(n)&&!n.routeId&&(n.routeId=e.routeId),(l=e._nonReactive.loadPromise)==null||l.resolve()}throw Zi(n)?(t.rendered=!0,n.options._fromLocation=t.location,n.redirectHandled=!0,n=t.router.resolveRedirect(n),n):(YA(t,n,r),n)}},XA=(t,e)=>!!t.router.getMatch(e)._nonReactive.dehydrated,wf=(t,e,n,r)=>{var u,p;const{id:s,routeId:i}=t.matches[e],l=t.router.looseRoutesById[i];if(n instanceof Promise)throw n;n.routerCode=r,t.firstBadMatchIndex??(t.firstBadMatchIndex=e),Bl(t,t.router.getMatch(s),n,r);try{(p=(u=l.options).onError)==null||p.call(u,n)}catch(f){n=f,Bl(t,t.router.getMatch(s),n,r)}t.updateMatch(s,f=>{var m,g;return(m=f._nonReactive.beforeLoadPromise)==null||m.resolve(),f._nonReactive.beforeLoadPromise=void 0,(g=f._nonReactive.loadPromise)==null||g.resolve(),{...f,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}})},e_=(t,e,n,r)=>{var l;if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!sx(t,e)&&(n.options.loader||n.options.beforeLoad||r_(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((l=t.router.options)==null?void 0:l.defaultPendingComponent)))){const u=setTimeout(()=>{Uy(t)},s);r._nonReactive.pendingTimeout=u}},K3=(t,e,n)=>{const r=t.router.getMatch(e);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;e_(t,e,n,r);const s=()=>{const i=t.router.getMatch(e);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Bl(t,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},Q3=(t,e,n,r)=>{const s=t.router.getMatch(e),i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Jd(()=>{i==null||i.resolve()});const{paramsError:l,searchError:u}=s;l&&wf(t,n,l,"PARSE_PARAMS"),u&&wf(t,n,u,"VALIDATE_SEARCH"),e_(t,e,r,s);const p=new AbortController;let f=!1;const m=()=>{f||(f=!0,t.updateMatch(e,E=>({...E,isFetching:"beforeLoad",fetchCount:E.fetchCount+1,abortController:p})))},g=()=>{var E;(E=s._nonReactive.beforeLoadPromise)==null||E.resolve(),s._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,k=>({...k,isFetching:!1}))};if(!r.options.beforeLoad){th(()=>{m(),g()});return}s._nonReactive.beforeLoadPromise=Jd();const y={...Od(t,n,!1),...s.__routeContext},{search:v,params:C,cause:S}=s,j=sx(t,e),D={search:v,abortController:p,params:C,preload:j,context:y,location:t.location,navigate:E=>t.router.navigate({...E,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:j?"preload":S,matches:t.matches,routeId:r.id,...t.router.options.additionalContext},M=E=>{if(E===void 0){th(()=>{m(),g()});return}(Zi(E)||xi(E))&&(m(),wf(t,n,E,"BEFORE_LOAD")),th(()=>{m(),t.updateMatch(e,k=>({...k,__beforeLoadContext:E})),g()})};let T;try{if(T=r.options.beforeLoad(D),Md(T))return m(),T.catch(E=>{wf(t,n,E,"BEFORE_LOAD")}).then(M)}catch(E){m(),wf(t,n,E,"BEFORE_LOAD")}M(T)},J3=(t,e)=>{const{id:n,routeId:r}=t.matches[e],s=t.router.looseRoutesById[r],i=()=>u(),l=()=>Q3(t,n,e,s),u=()=>{if(XA(t,n))return;const p=K3(t,n,s);return Md(p)?p.then(l):l()};return i()},Y3=(t,e,n)=>{var i,l,u,p,f,m;const r=t.router.getMatch(e);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:t.router.options.ssr,matches:t.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(l=(i=n.options).head)==null?void 0:l.call(i,s),(p=(u=n.options).scripts)==null?void 0:p.call(u,s),(m=(f=n.options).headers)==null?void 0:m.call(f,s)]).then(([g,y,v])=>{const C=g==null?void 0:g.meta,S=g==null?void 0:g.links,j=g==null?void 0:g.scripts,D=g==null?void 0:g.styles;return{meta:C,links:S,headScripts:j,headers:v,scripts:y,styles:D}})},t_=(t,e,n,r)=>{const s=t.matchPromises[n-1],{params:i,loaderDeps:l,abortController:u,cause:p}=t.router.getMatch(e),f=Od(t,n),m=sx(t,e);return{params:i,deps:l,preload:!!m,parentMatchPromise:s,abortController:u,context:f,location:t.location,navigate:g=>t.router.navigate({...g,_fromLocation:t.location}),cause:m?"preload":p,route:r,...t.router.options.additionalContext}},cR=async(t,e,n,r)=>{var s,i,l,u,p,f,m;try{const g=t.router.getMatch(e);try{(!(h3??t.router.isServer)||g.ssr===!0)&&n_(r);const y=(i=(s=r.options).loader)==null?void 0:i.call(s,t_(t,e,n,r)),v=r.options.loader&&Md(y);if(!!(v||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||g._nonReactive.minPendingPromise)&&t.updateMatch(e,j=>({...j,isFetching:"loader"})),r.options.loader){const j=v?await y:y;Bl(t,t.router.getMatch(e),j),j!==void 0&&t.updateMatch(e,D=>({...D,loaderData:j}))}r._lazyPromise&&await r._lazyPromise;const S=g._nonReactive.minPendingPromise;S&&await S,r._componentsPromise&&await r._componentsPromise,t.updateMatch(e,j=>({...j,error:void 0,context:Od(t,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(y){let v=y;if((v==null?void 0:v.name)==="AbortError"){if(g.abortController.signal.aborted){(l=g._nonReactive.loaderPromise)==null||l.resolve(),g._nonReactive.loaderPromise=void 0;return}t.updateMatch(e,S=>({...S,status:S.status==="pending"?"success":S.status,isFetching:!1,context:Od(t,n)}));return}const C=g._nonReactive.minPendingPromise;C&&await C,xi(y)&&await((p=(u=r.options.notFoundComponent)==null?void 0:u.preload)==null?void 0:p.call(u)),Bl(t,t.router.getMatch(e),y);try{(m=(f=r.options).onError)==null||m.call(f,y)}catch(S){v=S,Bl(t,t.router.getMatch(e),S)}t.updateMatch(e,S=>({...S,error:v,context:Od(t,n),status:"error",isFetching:!1}))}}catch(g){const y=t.router.getMatch(e);y&&(y._nonReactive.loaderPromise=void 0),Bl(t,y,g)}},X3=async(t,e)=>{var m,g;async function n(y,v,C,S){const j=Date.now()-v.updatedAt,D=y?S.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??t.router.options.defaultStaleTime??0,M=S.options.shouldReload,T=typeof M=="function"?M(t_(t,r,e,S)):M,{status:E,invalid:k}=C;i=E==="success"&&(k||(T??j>D)),y&&S.options.preload===!1||(i&&!t.sync?(l=!0,(async()=>{var A,O;try{await cR(t,r,e,S);const I=t.router.getMatch(r);(A=I._nonReactive.loaderPromise)==null||A.resolve(),(O=I._nonReactive.loadPromise)==null||O.resolve(),I._nonReactive.loaderPromise=void 0}catch(I){Zi(I)&&await t.router.navigate(I.options)}})()):(E!=="success"||i&&t.sync)&&await cR(t,r,e,S))}const{id:r,routeId:s}=t.matches[e];let i=!1,l=!1;const u=t.router.looseRoutesById[s];if(!XA(t,r)){const y=t.router.getMatch(r),v=sx(t,r);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!t.sync&&!y.preload)return y;await y._nonReactive.loaderPromise;const C=t.router.getMatch(r),S=C._nonReactive.error||C.error;S&&Bl(t,C,S),C.status==="pending"&&await n(v,y,C,u)}else{const C=v&&!t.router.state.matches.some(j=>j.id===r),S=t.router.getMatch(r);S._nonReactive.loaderPromise=Jd(),C!==S.preload&&t.updateMatch(r,j=>({...j,preload:C})),await n(v,y,S,u)}}const p=t.router.getMatch(r);l||((m=p._nonReactive.loaderPromise)==null||m.resolve(),(g=p._nonReactive.loadPromise)==null||g.resolve()),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,l||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;const f=l?p.isFetching:!1;return f!==p.isFetching||p.invalid!==!1?(t.updateMatch(r,y=>({...y,isFetching:f,invalid:!1})),t.router.getMatch(r)):p};async function uR(t){const e=Object.assign(t,{matchPromises:[]});e.router.state.matches.some(n=>n._forcePending)&&Uy(e);try{for(let u=0;u<e.matches.length;u++){const p=J3(e,u);Md(p)&&await p}const n=e.firstBadMatchIndex??e.matches.length;for(let u=0;u<n;u++)e.matchPromises.push(X3(e,u));const s=(await Promise.allSettled(e.matchPromises)).filter(u=>u.status==="rejected").map(u=>u.reason);let i;for(const u of s){if(Zi(u))throw u;!i&&xi(u)&&(i=u)}for(const u of e.matches){const{id:p,routeId:f}=u,m=e.router.looseRoutesById[f];try{const g=Y3(e,p,m);if(g){const y=await g;e.updateMatch(p,v=>({...v,...y}))}}catch(g){console.error(`Error executing head for route ${f}:`,g)}}if(i)throw i;const l=Uy(e);Md(l)&&await l}catch(n){if(xi(n)&&!e.preload){const r=Uy(e);throw Md(r)&&await r,n}if(Zi(n))throw n}return e.matches}async function n_(t){if(!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(e=>{const{id:n,...r}=e.options;Object.assign(t.options,r),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const e=()=>{var r;const n=[];for(const s of s_){const i=(r=t.options[s])==null?void 0:r.preload;i&&n.push(i())}if(n.length)return Promise.all(n).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(e):e()}return t._componentsPromise}function r_(t){var e;for(const n of s_)if((e=t.options[n])!=null&&e.preload)return!0;return!1}const s_=["component","errorComponent","pendingComponent","notFoundComponent"];function e$(t){return{input:({url:e})=>{for(const n of t)e=P1(n,e);return e},output:({url:e})=>{for(let n=t.length-1;n>=0;n--)e=i_(t[n],e);return e}}}function t$(t){const e=JA(t.basepath),n=`/${e}`,r=`${n}/`,s=t.caseSensitive?n:n.toLowerCase(),i=t.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=t.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===s?l.pathname="/":u.startsWith(i)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=By(["/",e,l.pathname]),l)}}function P1(t,e){var r;const n=(r=t==null?void 0:t.input)==null?void 0:r.call(t,{url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function i_(t,e){var r;const n=(r=t==null?void 0:t.output)==null?void 0:r.call(t,{url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function ou(t){const e=t.resolvedLocation,n=t.location,r=(e==null?void 0:e.pathname)!==n.pathname,s=(e==null?void 0:e.href)!==n.href,i=(e==null?void 0:e.hash)!==n.hash;return{fromLocation:e,toLocation:n,pathChanged:r,hrefChanged:s,hashChanged:i}}function n$(t){const e=t.filter(n=>n.status!=="redirected");return e.length===t.length?t:e}class r${constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{var y;n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,l=r==null?void 0:r.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=_3(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=p3()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let v;this.resolvePathCache=sv(1e3),v=this.buildRouteTree(),this.setRoutes(v)}!this.__store&&this.latestLocation&&(this.__store=new c3(i$(this.latestLocation)),F3(this));let u=!1;const p=this.options.basepath??"/",f=this.options.rewrite;if(i||s!==p||l!==f){this.basepath=p;const v=[],C=JA(p);C&&C!=="/"&&v.push(t$({basepath:p})),f&&v.push(f),this.rewrite=v.length===0?void 0:v.length===1?v[0]:e$(v),this.history&&this.updateLatestLocation(),u=!0}u&&this.__store&&this.__store.setState(v=>({...v,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof((y=window.CSS)==null?void 0:y.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=E3(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&C3(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:p,search:f,hash:m,href:g,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(p)){const M=this.options.parseSearch(f),T=this.options.stringifySearch(M);return{href:p+T+m,publicHref:g,pathname:Sf(p).path,external:!1,searchStr:T,search:di(r==null?void 0:r.search,M),hash:Sf(m.slice(1)).path,state:di(r==null?void 0:r.state,y)}}const v=new URL(g,this.origin),C=P1(this.rewrite,v),S=this.options.parseSearch(C.search),j=this.options.stringifySearch(S);return C.search=j,{href:C.href.replace(C.origin,""),publicHref:g,pathname:Sf(C.pathname).path,external:!!this.rewrite&&C.origin!==this.origin,searchStr:j,search:di(r==null?void 0:r.search,S),hash:Sf(C.hash.slice(1)).path,state:di(r==null?void 0:r.state,y)}},i=s(n),{__tempLocation:l,__tempKey:u}=i.state;if(l&&(!u||u===this.tempLocationKey)){const p=s(l);return p.state.key=i.state.key,p.state.__TSR_key=i.state.__TSR_key,delete p.state.__tempLocation,{...p,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>A3({base:n,to:mw(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>o$({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(i=>i.status==="pending"),r=this.state.matches.filter(i=>i.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(i=>{this.cancelMatch(i.id)})},this.buildLocation=n=>{const r=(i={})=>{var N,H;const l=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(l);i.from;const p=i.unsafeRelative==="path"?l.pathname:i.from??u.fullPath,f=this.resolvePathWithBase(p,"."),m=u.search,g={...u.params},y=i.to?this.resolvePathWithBase(f,`${i.to}`):this.resolvePathWithBase(f,"."),v=i.params===!1||i.params===null?{}:(i.params??!0)===!0?g:Object.assign(g,Fl(i.params,g)),C=DS({path:y,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,S=this.getMatchedRoutes(C);let j=S.matchedRoutes;(S.foundRoute?S.foundRoute.path!=="/"&&S.routeParams["**"]:$a(C))&&this.options.notFoundRoute&&(j=[...j,this.options.notFoundRoute]);let M=!1;if(Object.keys(v).length>0)for(const U of j){const L=((N=U.options.params)==null?void 0:N.stringify)??U.options.stringifyParams;L&&(M=!0,Object.assign(v,L(v)))}const T=n.leaveParams?y:Sf(M?DS({path:y,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:C).path;let E=m;if(n._includeValidateSearch&&((H=this.options.search)!=null&&H.strict)){const U={};j.forEach(L=>{if(L.options.validateSearch)try{Object.assign(U,Vy(L.options.validateSearch,{...U,...E}))}catch{}}),E=U}E=a$({search:E,dest:i,destRoutes:j,_includeValidateSearch:n._includeValidateSearch}),E=di(m,E);const k=this.options.stringifySearch(E),A=i.hash===!0?l.hash:i.hash?Fl(i.hash,l.hash):void 0,O=A?`#${A}`:"";let I=i.state===!0?l.state:i.state?Fl(i.state,l.state):{};I=di(l.state,I);const $=`${T}${k}${O}`;let R,P,z=!1;if(this.rewrite){const U=new URL($,this.origin),L=i_(this.rewrite,U);R=U.href.replace(U.origin,""),L.origin!==this.origin?(P=L.href,z=!0):P=L.pathname+L.search+L.hash}else R=x3($),P=R;return{publicHref:P,href:R,pathname:T,search:E,searchStr:k,state:I,hash:A??"",external:z,unmaskOnReload:i.unmaskOnReload}},s=(i={},l)=>{const u=r(i);let p=l?r(l):void 0;if(!p){const f={};if(this.options.routeMasks){const m=w3(u.pathname,this.processedTree);if(m){Object.assign(f,m.rawParams);const{from:g,params:y,...v}=m.route,C=y===!1||y===null?{}:(y??!0)===!0?f:Object.assign(f,Fl(y,f));l={from:n.from,...v,params:C},p=r(l)}}}return p&&(u.maskedLocation=p),u};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const i=()=>{const p=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];p.forEach(m=>{s.state[m]=this.latestLocation.state[m]});const f=iu(s.state,this.latestLocation.state);return p.forEach(m=>{delete s.state[m]}),f},l=$a(this.latestLocation.href)===$a(s.href),u=this.commitLocationPromise;if(this.commitLocationPromise=Jd(()=>{u==null||u.resolve()}),l&&i())this.load();else{let{maskedLocation:p,hashScrollIntoView:f,...m}=s;p&&(m={...p,state:{...p.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:l,href:u,...p}={})=>{if(u){const g=this.history.location.state.__TSR_index,y=tv(u,{__TSR_index:n?g:g+1}),v=new URL(y.pathname,this.origin),C=P1(this.rewrite,v);p.to=C.pathname,p.search=this.options.parseSearch(y.search),p.hash=y.hash.slice(1)}const f=this.buildLocation({...p,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const m=this.commitLocation({...f,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:i,...l})=>{var p;let u=!1;if(s)try{new URL(`${s}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(n!==void 0||!s){const m=this.buildLocation({to:n,...l});s=s??m.publicHref,i=i??m.publicHref}const f=!u&&i?i:s;if(rv(f,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const m=this.history,g=((p=m.getBlockers)==null?void 0:p.call(m))??[];for(const y of g)if(y!=null&&y.blockerFn&&await y.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...l,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(s=>!n.some(i=>i.id===s.id))}))},this.load=async n=>{let r,s,i;for(i=new Promise(u=>{this.startTransition(async()=>{var p;try{this.beforeLoad();const f=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ou({resolvedLocation:m,location:f})}),this.emit({type:"onBeforeLoad",...ou({resolvedLocation:m,location:f})}),await uR({router:this,sync:n==null?void 0:n.sync,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let g=[],y=[],v=[];th(()=>{this.__store.setState(C=>{const S=C.matches,j=C.pendingMatches||C.matches;return g=S.filter(D=>!j.some(M=>M.id===D.id)),y=j.filter(D=>!S.some(M=>M.id===D.id)),v=j.filter(D=>S.some(M=>M.id===D.id)),{...C,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...C.cachedMatches,...g.filter(D=>D.status!=="error"&&D.status!=="notFound"&&D.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([C,S])=>{C.forEach(j=>{var D,M;(M=(D=this.looseRoutesById[j.routeId].options)[S])==null||M.call(D,j)})})})})}})}catch(f){Zi(f)?(r=f,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):xi(f)&&(s=f),this.__store.setState(m=>({...m,statusCode:r?r.status:s?404:m.matches.some(g=>g.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===i&&((p=this.commitLocationPromise)==null||p.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(u=>u.status==="error")&&(l=500),l!==void 0&&this.__store.setState(u=>({...u,statusCode:l}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,l=this.state.resolvedLocation,u=typeof r.types=="function"?r.types(ou({resolvedLocation:l,location:i})):r.types;if(u===!1){n();return}s={update:n,types:u}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{var i;const s=(i=this.state.pendingMatches)!=null&&i.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";s&&(s==="cachedMatches"?this.__store.setState(l=>({...l,cachedMatches:n$(l.cachedMatches.map(u=>u.id===n?r(u):u))})):this.__store.setState(l=>{var u;return{...l,[s]:(u=l[s])==null?void 0:u.map(p=>p.id===n?r(p):p)}}))})},this.getMatch=n=>{var s;const r=i=>i.id===n;return this.state.cachedMatches.find(r)??((s=this.state.pendingMatches)==null?void 0:s.find(r))??this.state.matches.find(r)},this.invalidate=n=>{const r=s=>{var i;return((i=n==null?void 0:n.filter)==null?void 0:i.call(n,s))??!0?{...s,invalid:!0,...n!=null&&n.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.__store.setState(s=>{var i;return{...s,matches:s.matches.map(r),cachedMatches:s.cachedMatches.map(r),pendingMatches:(i=s.pendingMatches)==null?void 0:i.map(r)}}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),i=this.getParsedLocationHref(s);n.options.href=i,n.headers.set("Location",i)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;n.options.href=i,n.headers.set("Location",i)}}catch{}if(n.options.href&&!n.options._builtLocation&&rv(n.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${n.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(i=>!r(i))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const s=this.looseRoutesById[r.routeId];if(!s.options.loader)return!0;const i=(r.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=i};this.clearCache({filter:n})},this.loadRouteChunk=n_,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),l=new Set([...i,...this.state.cachedMatches.map(u=>u.id)]);th(()=>{s.forEach(u=>{l.has(u.id)||this.__store.setState(p=>({...p,cachedMatches:[...p.cachedMatches,u]}))})});try{return s=await uR({router:this,matches:s,location:r,preload:!0,updateMatch:(u,p)=>{i.has(u)?s=s.map(f=>f.id===u?p(f):f):this.updateMatch(u,p)}}),s}catch(u){if(Zi(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:r});xi(u)||console.error(u);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(s);if(r!=null&&r.pending&&this.state.status!=="pending")return!1;const u=((r==null?void 0:r.pending)===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,p=j3(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,u.pathname,this.processedTree);return!p||n.params&&!iu(p.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?iu(u.search,i.search,{partial:!0})?p.rawParams:!1:p.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??W3,parseSearch:e.parseSearch??H3,protocolAllowlist:e.protocolAllowlist??v3}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:n,processedTree:r}){this.routesById=e,this.routesByPath=n,this.processedTree=r;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}getParentContext(e){return(e==null?void 0:e.id)?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,n){var y,v;const r=this.getMatchedRoutes(e.pathname),{foundRoute:s,routeParams:i,parsedParams:l}=r;let{matchedRoutes:u}=r,p=!1;(s?s.path!=="/"&&i["**"]:$a(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:p=!0);const f=p?c$(this.options.notFoundMode,u):void 0,m=new Array(u.length),g=new Map(this.state.matches.map(C=>[C.routeId,C]));for(let C=0;C<u.length;C++){const S=u[C],j=m[C-1];let D,M,T;{const L=(j==null?void 0:j.search)??e.search,W=(j==null?void 0:j._strictSearch)??void 0;try{const K=Vy(S.options.validateSearch,{...L})??void 0;D={...L,...K},M={...W,...K},T=void 0}catch(K){let Q=K;if(K instanceof av||(Q=new av(K.message,{cause:K})),n!=null&&n.throwOnError)throw Q;D=L,M={},T=Q}}const E=((v=(y=S.options).loaderDeps)==null?void 0:v.call(y,{search:D}))??"",k=E?JSON.stringify(E):"",{interpolatedPath:A,usedParams:O}=DS({path:S.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),I=S.id+A+k,$=this.getMatch(I),R=g.get(S.id),P=($==null?void 0:$._strictParams)??O;let z;if(!$)try{dR(S,O,l,P)}catch(L){if(xi(L)||Zi(L)?z=L:z=new s$(L.message,{cause:L}),n!=null&&n.throwOnError)throw z}Object.assign(i,P);const N=R?"stay":"enter";let H;if($)H={...$,cause:N,params:(R==null?void 0:R.params)??i,_strictParams:P,search:di(R?R.search:$.search,D),_strictSearch:M};else{const L=S.options.loader||S.options.beforeLoad||S.lazyFn||r_(S)?"pending":"success";H={id:I,ssr:S.options.ssr,index:C,routeId:S.id,params:(R==null?void 0:R.params)??i,_strictParams:P,pathname:A,updatedAt:Date.now(),search:R?di(R.search,D):D,_strictSearch:M,searchError:void 0,status:L,isFetching:!1,error:void 0,paramsError:z,__routeContext:void 0,_nonReactive:{loadPromise:Jd()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:N,loaderDeps:R?di(R.loaderDeps,E):E,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:S.options.staticData||{},fullPath:S.fullPath}}n!=null&&n.preload||(H.globalNotFound=f===S.id),H.searchError=T;const U=this.getParentContext(j);H.context={...U,...H.__routeContext,...H.__beforeLoadContext},m[C]=H}for(let C=0;C<m.length;C++){const S=m[C],j=this.looseRoutesById[S.routeId],D=this.getMatch(S.id),M=g.get(S.routeId);if(S.params=M?di(M.params,i):i,!D){const T=m[C-1],E=this.getParentContext(T);if(j.options.context){const k={deps:S.loaderDeps,params:S.params,context:E??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:S.cause,abortController:S.abortController,preload:!!S.preload,matches:m,routeId:j.id};S.__routeContext=j.options.context(k)??void 0}S.context={...E,...S.__routeContext,...S.__beforeLoadContext}}}return m}matchRoutesLightweight(e){const{matchedRoutes:n,routeParams:r,parsedParams:s}=this.getMatchedRoutes(e.pathname),i=gh(n),l={...e.search};for(const m of n)try{Object.assign(l,Vy(m.options.validateSearch,l))}catch{}const u=gh(this.state.matches),p=u&&u.routeId===i.id&&e.pathname===this.state.location.pathname;let f;if(p)f=u.params;else{const m={...r};for(const g of n)try{dR(g,r,s??{},m)}catch{}f=m}return{matchedRoutes:n,fullPath:i.fullPath,search:l,params:f}}}class av extends Error{}class s$ extends Error{}function i$(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Vy(t,e){if(t==null)return{};if("~standard"in t){const n=t["~standard"].validate(e);if(n instanceof Promise)throw new av("Async validation not supported");if(n.issues)throw new av(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function o$({pathname:t,routesById:e,processedTree:n}){const r={},s=$a(t);let i,l;const u=T3(s,n,!0);return u&&(i=u.route,Object.assign(r,u.rawParams),l=Object.assign({},u.parsedParams)),{matchedRoutes:(u==null?void 0:u.branch)||[e[Vi]],routeParams:r,foundRoute:i,parsedParams:l}}function a$({search:t,dest:e,destRoutes:n,_includeValidateSearch:r}){return l$(n)(t,e,r??!1)}function l$(t){var s;const e={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of t){if("search"in i.options)(s=i.options.search)!=null&&s.middlewares&&e.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const l=({search:u,next:p})=>{let f=u;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(f=i.options.preSearchFilters.reduce((g,y)=>y(g),u));const m=p(f);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((g,y)=>y(g),m):m};e.middlewares.push(l)}if(i.options.validateSearch){const l=({search:u,next:p})=>{const f=p(u);if(!e._includeValidateSearch)return f;try{return{...f,...Vy(i.options.validateSearch,f)??void 0}}catch{return f}};e.middlewares.push(l)}}const n=({search:i})=>{const l=e.dest;return l.search?l.search===!0?i:Fl(l.search,i):{}};e.middlewares.push(n);const r=(i,l,u)=>{if(i>=u.length)return l;const p=u[i];return p({search:l,next:m=>r(i+1,m,u)})};return function(l,u,p){return e.dest=u,e._includeValidateSearch=p,r(0,l,e.middlewares)}}function c$(t,e){if(t!=="root")for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.children)return r.id}return Vi}function dR(t,e,n,r){var i;const s=((i=t.options.params)==null?void 0:i.parse)??t.options.parseParams;if(s)if(t.options.skipRouteOnParseError)for(const l in e)l in n&&(r[l]=n[l]);else{const l=s(r);Object.assign(r,l)}}const u$="Error preloading route! ☝️";class o_{constructor(e){if(this.init=n=>{var f,m;this.originalIndex=n.originalIndex;const r=this.options,s=!(r!=null&&r.path)&&!(r!=null&&r.id);this.parentRoute=(m=(f=this.options).getParentRoute)==null?void 0:m.call(f),s?this._path=Vi:this.parentRoute||Ha(!1);let i=s?Vi:r==null?void 0:r.path;i&&i!=="/"&&(i=QA(i));const l=(r==null?void 0:r.id)||i;let u=s?Vi:By([this.parentRoute.id===Vi?"":this.parentRoute.id,l]);i===Vi&&(i="/"),u!==Vi&&(u=By(["/",u]));const p=u===Vi?"/":By([this.parentRoute.fullPath,i]);this._path=i,this._id=u,this._fullPath=p,this._to=$a(p)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>Z3({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class d$ extends o_{constructor(e){super(e)}}const oy=typeof window<"u"?b.useLayoutEffect:b.useEffect;function RS(t){const e=b.useRef({value:t,prev:null}),n=e.current.value;return t!==n&&(e.current={value:t,prev:n}),e.current.prev}function p$(t,e,n={},r={}){b.useEffect(()=>{if(!t.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([i])=>{e(i)},n);return s.observe(t.current),()=>{s.disconnect()}},[e,n,r.disabled,t])}function f$(t){const e=b.useRef(null);return b.useImperativeHandle(t,()=>e.current,[]),e}function gw(t){const e=t.errorComponent??yw;return a.jsx(h$,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:n,reset:r})=>n?b.createElement(e,{error:n,reset:r}):t.children})}class h$ extends b.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,n){this.props.onCatch&&this.props.onCatch(e,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function yw({error:t}){const[e,n]=b.useState(!1);return a.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[a.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),a.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:e?"Hide Error":"Show Error"})]}),a.jsx("div",{style:{height:".25rem"}}),e?a.jsx("div",{children:a.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?a.jsx("code",{children:t.message}):null})}):null]})}function m$({children:t,fallback:e=null}){return a_()?a.jsx(We.Fragment,{children:t}):a.jsx(We.Fragment,{children:e})}function a_(){return We.useSyncExternalStore(g$,()=>!0,()=>!1)}function g$(){return()=>{}}var kS={exports:{}},MS={},OS={exports:{}},AS={};/**
|
|
50
|
+
* @license React
|
|
51
|
+
* use-sync-external-store-shim.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var pR;function y$(){if(pR)return AS;pR=1;var t=fm();function e(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,s=t.useEffect,i=t.useLayoutEffect,l=t.useDebugValue;function u(g,y){var v=y(),C=r({inst:{value:v,getSnapshot:y}}),S=C[0].inst,j=C[1];return i(function(){S.value=v,S.getSnapshot=y,p(S)&&j({inst:S})},[g,v,y]),s(function(){return p(S)&&j({inst:S}),g(function(){p(S)&&j({inst:S})})},[g]),l(v),v}function p(g){var y=g.getSnapshot;g=g.value;try{var v=y();return!n(g,v)}catch{return!0}}function f(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return AS.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:m,AS}var fR;function v$(){return fR||(fR=1,OS.exports=y$()),OS.exports}/**
|
|
58
|
+
* @license React
|
|
59
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/var hR;function x$(){if(hR)return MS;hR=1;var t=fm(),e=v$();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,i=t.useRef,l=t.useEffect,u=t.useMemo,p=t.useDebugValue;return MS.useSyncExternalStoreWithSelector=function(f,m,g,y,v){var C=i(null);if(C.current===null){var S={hasValue:!1,value:null};C.current=S}else S=C.current;C=u(function(){function D(A){if(!M){if(M=!0,T=A,A=y(A),v!==void 0&&S.hasValue){var O=S.value;if(v(O,A))return E=O}return E=A}if(O=E,r(T,A))return O;var I=y(A);return v!==void 0&&v(O,I)?(T=A,O):(T=A,E=I)}var M=!1,T,E,k=g===void 0?null:g;return[function(){return D(m())},k===null?void 0:function(){return D(k())}]},[m,g,y,v]);var j=s(f,C[0],C[1]);return l(function(){S.hasValue=!0,S.value=j},[j]),p(j),j},MS}var mR;function b$(){return mR||(mR=1,kS.exports=x$()),kS.exports}var S$=b$();function C$(t,e){return t===e}function w$(t,e,n=C$){const r=b.useCallback(l=>{if(!t)return()=>{};const{unsubscribe:u}=t.subscribe(l);return u},[t]),s=b.useCallback(()=>t==null?void 0:t.get(),[t]);return S$.useSyncExternalStoreWithSelector(r,s,s,e,n)}const _S=b.createContext(null);function l_(){return typeof document>"u"?_S:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=_S,_S)}function Ns(t){const e=b.useContext(l_());return t==null||t.warn,e}function bi(t){const e=Ns({warn:(t==null?void 0:t.router)===void 0}),n=(t==null?void 0:t.router)||e,r=b.useRef(void 0);return w$(n.__store,s=>{if(t!=null&&t.select){if(t.structuralSharing??n.options.defaultStructuralSharing){const i=di(r.current,t.select(s));return r.current=i,i}return t.select(s)}return s})}const ix=b.createContext(void 0),j$=b.createContext(void 0);function Qo(t){const e=b.useContext(t.from?j$:ix);return bi({select:r=>{const s=r.matches.find(i=>t.from?t.from===i.routeId:i.id===e);if(Ha(!((t.shouldThrow??!0)&&!s),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),s!==void 0)return t.select?t.select(s):s},structuralSharing:t.structuralSharing})}function vw(t){return Qo({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function xw(t){const{select:e,...n}=t;return Qo({...n,select:r=>e?e(r.loaderDeps):r.loaderDeps})}function uc(t){return Qo({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const n=t.strict===!1?e.params:e._strictParams;return t.select?t.select(n):n}})}function Di(t){return Qo({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function ur(t){const e=Ns();return b.useCallback(n=>e.navigate({...n,from:n.from??(t==null?void 0:t.from)}),[t==null?void 0:t.from,e])}var Ul=UA();const ay=tx(Ul);function T$(t,e){const n=Ns(),r=f$(e),{activeProps:s,inactiveProps:i,activeOptions:l,to:u,preload:p,preloadDelay:f,hashScrollIntoView:m,replace:g,startTransition:y,resetScroll:v,viewTransition:C,children:S,target:j,disabled:D,style:M,className:T,onClick:E,onFocus:k,onMouseEnter:A,onMouseLeave:O,onTouchStart:I,ignoreBlocker:$,params:R,search:P,hash:z,state:N,mask:H,reloadDocument:U,unsafeRelative:L,from:W,_fromLocation:K,...Q}=t,le=a_(),F=bi({select:ne=>{const he=ne.matches[ne.matches.length-1];return{search:he==null?void 0:he.search,hash:ne.location.hash,path:he==null?void 0:he.pathname}},structuralSharing:!0}),J=t.from,ie=b.useMemo(()=>({...t,from:J}),[n,F,J,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),te=b.useMemo(()=>n.buildLocation({...ie}),[n,ie]),de=te.maskedLocation?te.maskedLocation.publicHref:te.publicHref,fe=te.maskedLocation?te.maskedLocation.external:te.external,Re=b.useMemo(()=>O$(de,fe,n.history,D),[D,fe,de,n.history]),Pe=b.useMemo(()=>{if(Re!=null&&Re.external)return rv(Re.href,n.protocolAllowlist)?void 0:Re.href;if(!A$(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),rv(u,n.protocolAllowlist)?void 0:u}catch{}},[u,Re,n.protocolAllowlist]),$e=bi({select:ne=>{if(Pe)return!1;if(l!=null&&l.exact){if(!O3(ne.location.pathname,te.pathname,n.basepath))return!1}else{const he=iv(ne.location.pathname,n.basepath),je=iv(te.pathname,n.basepath);if(!(he.startsWith(je)&&(he.length===je.length||he[je.length]==="/")))return!1}return((l==null?void 0:l.includeSearch)??!0)&&!iu(ne.location.search,te.search,{partial:!(l!=null&&l.exact),ignoreUndefined:!(l!=null&&l.explicitUndefined)})?!1:l!=null&&l.includeHash?le&&ne.location.hash===te.hash:!0}}),we=$e?Fl(s,{})??D$:IS,be=$e?IS:Fl(i,{})??IS,Ae=[T,we.className,be.className].filter(Boolean).join(" "),Ne=(M||we.style||be.style)&&{...M,...we.style,...be.style},[Ie,Fe]=b.useState(!1),ct=b.useRef(!1),Me=t.reloadDocument||Pe?!1:p??n.options.defaultPreload,tt=f??n.options.defaultPreloadDelay??0,Ve=b.useCallback(()=>{n.preloadRoute({...ie,_builtLocation:te}).catch(ne=>{console.warn(ne),console.warn(u$)})},[n,ie,te]),it=b.useCallback(ne=>{ne!=null&&ne.isIntersecting&&Ve()},[Ve]);p$(r,it,M$,{disabled:!!D||Me!=="viewport"}),b.useEffect(()=>{ct.current||!D&&Me==="render"&&(Ve(),ct.current=!0)},[D,Ve,Me]);const Z=ne=>{const he=ne.currentTarget.getAttribute("target"),je=j!==void 0?j:he;if(!D&&!_$(ne)&&!ne.defaultPrevented&&(!je||je==="_self")&&ne.button===0){ne.preventDefault(),Ul.flushSync(()=>{Fe(!0)});const ze=n.subscribe("onResolved",()=>{ze(),Fe(!1)});n.navigate({...ie,replace:g,resetScroll:v,hashScrollIntoView:m,startTransition:y,viewTransition:C,ignoreBlocker:$})}};if(Pe)return{...Q,ref:r,href:Pe,...S&&{children:S},...j&&{target:j},...D&&{disabled:D},...M&&{style:M},...T&&{className:T},...E&&{onClick:E},...k&&{onFocus:k},...A&&{onMouseEnter:A},...O&&{onMouseLeave:O},...I&&{onTouchStart:I}};const q=ne=>{D||Me&&Ve()},se=q,xe=ne=>{if(!(D||!Me))if(!tt)Ve();else{const he=ne.target;if(jf.has(he))return;const je=setTimeout(()=>{jf.delete(he),Ve()},tt);jf.set(he,je)}},ee=ne=>{if(D||!Me||!tt)return;const he=ne.target,je=jf.get(he);je&&(clearTimeout(je),jf.delete(he))};return{...Q,...we,...be,href:Re==null?void 0:Re.href,ref:r,onClick:Tf([E,Z]),onFocus:Tf([k,q]),onMouseEnter:Tf([A,xe]),onMouseLeave:Tf([O,ee]),onTouchStart:Tf([I,se]),disabled:!!D,target:j,...Ne&&{style:Ne},...Ae&&{className:Ae},...D&&E$,...$e&&R$,...le&&Ie&&k$}}const IS={},D$={className:"active"},E$={role:"link","aria-disabled":!0},R$={"data-status":"active","aria-current":"page"},k$={"data-transitioning":"transitioning"},jf=new WeakMap,M$={rootMargin:"100px"},Tf=t=>e=>{for(const n of t)if(n){if(e.defaultPrevented)return;n(e)}};function O$(t,e,n,r){if(!r)return e?{href:t,external:!0}:{href:n.createHref(t)||"/",external:!1}}function A$(t){if(typeof t!="string")return!1;const e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}const gs=b.forwardRef((t,e)=>{const{_asChild:n,...r}=t,{type:s,...i}=T$(r,e),l=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...p}=i;return b.createElement("a",p,l)}return b.createElement(n,i,l)});function _$(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}let I$=class extends o_{constructor(e){super(e),this.useMatch=n=>Qo({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Qo({...n,from:this.id,select:r=>n!=null&&n.select?n.select(r.context):r.context}),this.useSearch=n=>Di({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>uc({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>xw({...n,from:this.id}),this.useLoaderData=n=>vw({...n,from:this.id}),this.useNavigate=()=>ur({from:this.fullPath}),this.Link=We.forwardRef((n,r)=>a.jsx(gs,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function P$(t){return new I$(t)}class L$ extends d${constructor(e){super(e),this.useMatch=n=>Qo({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Qo({...n,from:this.id,select:r=>n!=null&&n.select?n.select(r.context):r.context}),this.useSearch=n=>Di({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>uc({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>xw({...n,from:this.id}),this.useLoaderData=n=>vw({...n,from:this.id}),this.useNavigate=()=>ur({from:this.fullPath}),this.Link=We.forwardRef((n,r)=>a.jsx(gs,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function z$(t){return new L$(t)}function Ss(t){return typeof t=="object"?new gR(t,{silent:!0}).createRoute(t):new gR(t,{silent:!0}).createRoute}class gR{constructor(e,n){this.path=e,this.createRoute=r=>{this.silent;const s=P$(r);return s.isRoot=!1,s},this.silent=n==null?void 0:n.silent}}class yR{constructor(e){this.useMatch=n=>Qo({select:n==null?void 0:n.select,from:this.options.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Qo({from:this.options.id,select:r=>n!=null&&n.select?n.select(r.context):r.context}),this.useSearch=n=>Di({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useParams=n=>uc({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>xw({...n,from:this.options.id}),this.useLoaderData=n=>vw({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ns();return ur({from:n.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function vR(t){return typeof t=="object"?new yR(t):e=>new yR({id:t,...e})}function $$(){const t=Ns(),e=b.useRef({router:t,mounted:!1}),[n,r]=b.useState(!1),{hasPendingMatches:s,isLoading:i}=bi({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),l=RS(i),u=i||n||s,p=RS(u),f=i||s,m=RS(f);return t.startTransition=g=>{r(!0),b.startTransition(()=>{g(),r(!1)})},b.useEffect(()=>{const g=t.history.subscribe(t.load),y=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $a(t.latestLocation.publicHref)!==$a(y.publicHref)&&t.commitLocation({...y,replace:!0}),()=>{g()}},[t,t.history]),oy(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(y){console.error(y)}})()},[t]),oy(()=>{l&&!i&&t.emit({type:"onLoad",...ou(t.state)})},[l,t,i]),oy(()=>{m&&!f&&t.emit({type:"onBeforeRouteMount",...ou(t.state)})},[f,m,t]),oy(()=>{if(p&&!u){const g=ou(t.state);t.emit({type:"onResolved",...g}),t.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),g.hrefChanged&&B3(t)}},[u,p,t]),null}function N$(t){const e=bi({select:n=>`not-found-${n.location.pathname}-${n.status}`});return a.jsx(gw,{getResetKey:()=>e,onCatch:(n,r)=>{var s;if(xi(n))(s=t.onCatch)==null||s.call(t,n,r);else throw n},errorComponent:({error:n})=>{var r;if(xi(n))return(r=t.fallback)==null?void 0:r.call(t,n);throw n},children:t.children})}function F$(){return a.jsx("p",{children:"Not Found"})}function gd(t){return a.jsx(a.Fragment,{children:t.children})}function c_(t,e,n){return e.options.notFoundComponent?a.jsx(e.options.notFoundComponent,{...n}):t.options.defaultNotFoundComponent?a.jsx(t.options.defaultNotFoundComponent,{...n}):a.jsx(F$,{})}function B$(){return Ns().isScrollRestoring,null}const u_=b.memo(function({matchId:e}){var S,j;const n=Ns(),r=bi({select:D=>{var E;const M=D.matches.findIndex(k=>k.id===e),T=D.matches[M];return Ha(T),{routeId:T.routeId,ssr:T.ssr,_displayPending:T._displayPending,resetKey:D.loadedAt,parentRouteId:(E=D.matches[M-1])==null?void 0:E.routeId}},structuralSharing:!0}),s=n.routesById[r.routeId],i=s.options.pendingComponent??n.options.defaultPendingComponent,l=i?a.jsx(i,{}):null,u=s.options.errorComponent??n.options.defaultErrorComponent,p=s.options.onCatch??n.options.defaultOnCatch,f=s.isRoot?s.options.notFoundComponent??((S=n.options.notFoundRoute)==null?void 0:S.options.component):s.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",g=(!s.isRoot||s.options.wrapInSuspense||m)&&(s.options.wrapInSuspense??i??(((j=s.options.errorComponent)==null?void 0:j.preload)||m))?b.Suspense:gd,y=u?gw:gd,v=f?N$:gd,C=s.isRoot?s.options.shellComponent??gd:gd;return a.jsxs(C,{children:[a.jsx(ix.Provider,{value:e,children:a.jsx(g,{fallback:l,children:a.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:u||yw,onCatch:(D,M)=>{if(xi(D))throw D;p==null||p(D,M)},children:a.jsx(v,{fallback:D=>{if(!f||D.routeId&&D.routeId!==r.routeId||!D.routeId&&!s.isRoot)throw D;return b.createElement(f,D)},children:m||r._displayPending?a.jsx(m$,{fallback:l,children:a.jsx(xR,{matchId:e})}):a.jsx(xR,{matchId:e})})})})}),r.parentRouteId===Vi&&n.options.scrollRestoration?a.jsxs(a.Fragment,{children:[a.jsx(U$,{}),a.jsx(B$,{})]}):null]})});function U$(){const t=Ns(),e=b.useRef(void 0);return a.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...ou(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const xR=b.memo(function({matchId:e}){var p,f,m,g;const n=Ns(),{match:r,key:s,routeId:i}=bi({select:y=>{const v=y.matches.find(M=>M.id===e),C=v.routeId,S=n.routesById[C].options.remountDeps??n.options.defaultRemountDeps,j=S==null?void 0:S({routeId:C,loaderDeps:v.loaderDeps,params:v._strictParams,search:v._strictSearch});return{key:j?JSON.stringify(j):void 0,routeId:C,match:{id:v.id,status:v.status,error:v.error,invalid:v.invalid,_forcePending:v._forcePending,_displayPending:v._displayPending}}},structuralSharing:!0}),l=n.routesById[i],u=b.useMemo(()=>{const y=l.options.component??n.options.defaultComponent;return y?a.jsx(y,{},s):a.jsx(bw,{})},[s,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw(p=n.getMatch(r.id))==null?void 0:p._nonReactive.displayPendingPromise;if(r._forcePending)throw(f=n.getMatch(r.id))==null?void 0:f._nonReactive.minPendingPromise;if(r.status==="pending"){const y=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(y){const v=n.getMatch(r.id);if(v&&!v._nonReactive.minPendingPromise){const C=Jd();v._nonReactive.minPendingPromise=C,setTimeout(()=>{C.resolve(),v._nonReactive.minPendingPromise=void 0},y)}}throw(m=n.getMatch(r.id))==null?void 0:m._nonReactive.loadPromise}if(r.status==="notFound")return Ha(xi(r.error)),c_(n,l,r.error);if(r.status==="redirected")throw Ha(Zi(r.error)),(g=n.getMatch(r.id))==null?void 0:g._nonReactive.loadPromise;if(r.status==="error")throw r.error;return u}),bw=b.memo(function(){const e=Ns(),n=b.useContext(ix),r=bi({select:f=>{var m;return(m=f.matches.find(g=>g.id===n))==null?void 0:m.routeId}}),s=e.routesById[r],i=bi({select:f=>{const g=f.matches.find(y=>y.id===n);return Ha(g),g.globalNotFound}}),l=bi({select:f=>{var y;const m=f.matches,g=m.findIndex(v=>v.id===n);return(y=m[g+1])==null?void 0:y.id}}),u=e.options.defaultPendingComponent?a.jsx(e.options.defaultPendingComponent,{}):null;if(i)return c_(e,s,void 0);if(!l)return null;const p=a.jsx(u_,{matchId:l});return r===Vi?a.jsx(b.Suspense,{fallback:u,children:p}):p});function V$(){const t=Ns(),n=t.routesById[Vi].options.pendingComponent??t.options.defaultPendingComponent,r=n?a.jsx(n,{}):null,s=typeof document<"u"&&t.ssr?gd:b.Suspense,i=a.jsxs(s,{fallback:r,children:[a.jsx($$,{}),a.jsx(H$,{})]});return t.options.InnerWrap?a.jsx(t.options.InnerWrap,{children:i}):i}function H$(){const t=Ns(),e=bi({select:s=>{var i;return(i=s.matches[0])==null?void 0:i.id}}),n=bi({select:s=>s.loadedAt}),r=e?a.jsx(u_,{matchId:e}):null;return a.jsx(ix.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?r:a.jsx(gw,{getResetKey:()=>n,errorComponent:yw,onCatch:s=>{s.message||s.toString()},children:r})})}const W$=t=>new q$(t);class q$ extends r${constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=Ss,globalThis.createLazyFileRoute=vR):typeof window<"u"&&(window.createFileRoute=Ss,window.createLazyFileRoute=vR);function G$({router:t,children:e,...n}){Object.keys(n).length>0&&t.update({...t.options,...n,context:{...t.options.context,...n.context}});const r=l_(),s=a.jsx(r.Provider,{value:t,children:e});return t.options.Wrap?a.jsx(t.options.Wrap,{children:s}):s}function Z$({router:t,...e}){return a.jsx(G$,{router:t,...e,children:a.jsx(V$,{})})}function K$(t,e){if(t===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in t)return t;if(typeof t=="function")return{shouldBlockFn:async()=>await t(),enableBeforeUnload:!0,withResolver:!1};const n=!!(t.condition??!0),r=t.blockerFn;return{shouldBlockFn:async()=>n&&r!==void 0?await r():n,enableBeforeUnload:n,withResolver:r===void 0}}function d_(t,e){const{shouldBlockFn:n,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=K$(t),l=Ns(),{history:u}=l,[p,f]=b.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return b.useEffect(()=>{const m=async g=>{function y(M){const T=l.parseLocation(M),E=l.getMatchedRoutes(T.pathname);return E.foundRoute===void 0?{routeId:"__notFound__",fullPath:T.pathname,pathname:T.pathname,params:E.routeParams,search:l.options.parseSearch(M.search)}:{routeId:E.foundRoute.id,fullPath:E.foundRoute.fullPath,pathname:T.pathname,params:E.routeParams,search:l.options.parseSearch(M.search)}}const v=y(g.currentLocation),C=y(g.nextLocation);if(v.routeId==="__notFound__"&&C.routeId!=="__notFound__")return!1;const S=await n({action:g.action,current:v,next:C});if(!i)return S;if(!S)return!1;const D=await new Promise(M=>{f({status:"blocked",current:v,next:C,action:g.action,proceed:()=>M(!1),reset:()=>M(!0)})});return f({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),D};return s?void 0:u.block({blockerFn:m,enableBeforeUnload:r})},[n,r,s,i,u,l]),p}function ox(t){return bi({select:e=>e.location})}var gp=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Q$={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ol,uw,OA,J$=(OA=class{constructor(){Dt(this,Ol,Q$);Dt(this,uw,!1)}setTimeoutProvider(t){st(this,Ol,t)}setTimeout(t,e){return X(this,Ol).setTimeout(t,e)}clearTimeout(t){X(this,Ol).clearTimeout(t)}setInterval(t,e){return X(this,Ol).setInterval(t,e)}clearInterval(t){X(this,Ol).clearInterval(t)}},Ol=new WeakMap,uw=new WeakMap,OA),Wc=new J$;function Y$(t){setTimeout(t,0)}var hu=typeof window>"u"||"Deno"in globalThis;function ks(){}function X$(t,e){return typeof t=="function"?t(e):t}function L1(t){return typeof t=="number"&&t>=0&&t!==1/0}function p_(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Gl(t,e){return typeof t=="function"?t(e):t}function Hi(t,e){return typeof t=="function"?t(e):t}function bR(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:l,stale:u}=t;if(l){if(r){if(e.queryHash!==Sw(l,e.options))return!1}else if(!vh(e.queryKey,l))return!1}if(n!=="all"){const p=e.isActive();if(n==="active"&&!p||n==="inactive"&&p)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||s&&s!==e.state.fetchStatus||i&&!i(e))}function SR(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(mu(e.options.mutationKey)!==mu(i))return!1}else if(!vh(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Sw(t,e){return((e==null?void 0:e.queryKeyHashFn)||mu)(t)}function mu(t){return JSON.stringify(t,(e,n)=>z1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function vh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>vh(t[n],e[n])):!1}var eN=Object.prototype.hasOwnProperty;function f_(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=CR(t)&&CR(e);if(!r&&!(z1(t)&&z1(e)))return e;const i=(r?t:Object.keys(t)).length,l=r?e:Object.keys(e),u=l.length,p=r?new Array(u):{};let f=0;for(let m=0;m<u;m++){const g=r?m:l[m],y=t[g],v=e[g];if(y===v){p[g]=y,(r?m<i:eN.call(t,g))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){p[g]=v;continue}const C=f_(y,v,n+1);p[g]=C,C===y&&f++}return i===u&&f===i?t:p}function lv(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function CR(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function z1(t){if(!wR(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!wR(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function wR(t){return Object.prototype.toString.call(t)==="[object Object]"}function tN(t){return new Promise(e=>{Wc.setTimeout(e,t)})}function $1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?f_(t,e):e}function nN(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function rN(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Cw=Symbol();function h_(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Cw?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function ww(t,e){return typeof t=="function"?t(...e):!!t}function sN(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}var Qc,Al,Nd,AA,iN=(AA=class extends gp{constructor(){super();Dt(this,Qc);Dt(this,Al);Dt(this,Nd);st(this,Nd,e=>{if(!hu&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,Al)||this.setEventListener(X(this,Nd))}onUnsubscribe(){var e;this.hasListeners()||((e=X(this,Al))==null||e.call(this),st(this,Al,void 0))}setEventListener(e){var n;st(this,Nd,e),(n=X(this,Al))==null||n.call(this),st(this,Al,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){X(this,Qc)!==e&&(st(this,Qc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof X(this,Qc)=="boolean"?X(this,Qc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Qc=new WeakMap,Al=new WeakMap,Nd=new WeakMap,AA),jw=new iN;function N1(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var oN=Y$;function aN(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=oN;const i=u=>{e?t.push(u):s(()=>{n(u)})},l=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(p=>{n(p)})})})};return{batch:u=>{let p;e++;try{p=u()}finally{e--,e||l()}return p},batchCalls:u=>(...p)=>{i(()=>{u(...p)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var Xr=aN(),Fd,_l,Bd,_A,lN=(_A=class extends gp{constructor(){super();Dt(this,Fd,!0);Dt(this,_l);Dt(this,Bd);st(this,Bd,e=>{if(!hu&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){X(this,_l)||this.setEventListener(X(this,Bd))}onUnsubscribe(){var e;this.hasListeners()||((e=X(this,_l))==null||e.call(this),st(this,_l,void 0))}setEventListener(e){var n;st(this,Bd,e),(n=X(this,_l))==null||n.call(this),st(this,_l,e(this.setOnline.bind(this)))}setOnline(e){X(this,Fd)!==e&&(st(this,Fd,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return X(this,Fd)}},Fd=new WeakMap,_l=new WeakMap,Bd=new WeakMap,_A),cv=new lN;function cN(t){return Math.min(1e3*2**t,3e4)}function m_(t){return(t??"online")==="online"?cv.isOnline():!0}var F1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function g_(t){let e=!1,n=0,r;const s=N1(),i=()=>s.status!=="pending",l=S=>{var j;if(!i()){const D=new F1(S);y(D),(j=t.onCancel)==null||j.call(t,D)}},u=()=>{e=!0},p=()=>{e=!1},f=()=>jw.isFocused()&&(t.networkMode==="always"||cv.isOnline())&&t.canRun(),m=()=>m_(t.networkMode)&&t.canRun(),g=S=>{i()||(r==null||r(),s.resolve(S))},y=S=>{i()||(r==null||r(),s.reject(S))},v=()=>new Promise(S=>{var j;r=D=>{(i()||f())&&S(D)},(j=t.onPause)==null||j.call(t)}).then(()=>{var S;r=void 0,i()||(S=t.onContinue)==null||S.call(t)}),C=()=>{if(i())return;let S;const j=n===0?t.initialPromise:void 0;try{S=j??t.fn()}catch(D){S=Promise.reject(D)}Promise.resolve(S).then(g).catch(D=>{var A;if(i())return;const M=t.retry??(hu?0:3),T=t.retryDelay??cN,E=typeof T=="function"?T(n,D):T,k=M===!0||typeof M=="number"&&n<M||typeof M=="function"&&M(n,D);if(e||!k){y(D);return}n++,(A=t.onFail)==null||A.call(t,n,D),tN(E).then(()=>f()?void 0:v()).then(()=>{e?y(D):C()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:p,canStart:m,start:()=>(m()?C():v().then(C),s)}}var Jc,IA,y_=(IA=class{constructor(){Dt(this,Jc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),L1(this.gcTime)&&st(this,Jc,Wc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(hu?1/0:300*1e3))}clearGcTimeout(){X(this,Jc)&&(Wc.clearTimeout(X(this,Jc)),st(this,Jc,void 0))}},Jc=new WeakMap,IA),Yc,Ud,Ui,Xc,rs,lm,eu,go,Oa,PA,uN=(PA=class extends y_{constructor(e){super();Dt(this,go);Dt(this,Yc);Dt(this,Ud);Dt(this,Ui);Dt(this,Xc);Dt(this,rs);Dt(this,lm);Dt(this,eu);st(this,eu,!1),st(this,lm,e.defaultOptions),this.setOptions(e.options),this.observers=[],st(this,Xc,e.client),st(this,Ui,X(this,Xc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,st(this,Yc,TR(this.options)),this.state=e.state??X(this,Yc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=X(this,rs))==null?void 0:e.promise}setOptions(e){if(this.options={...X(this,lm),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=TR(this.options);n.data!==void 0&&(this.setState(jR(n.data,n.dataUpdatedAt)),st(this,Yc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,Ui).remove(this)}setData(e,n){const r=$1(this.state.data,e,this.options);return Xt(this,go,Oa).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Xt(this,go,Oa).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=X(this,rs))==null?void 0:r.promise;return(s=X(this,rs))==null||s.cancel(e),n?n.then(ks).catch(ks):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(X(this,Yc))}isActive(){return this.observers.some(e=>Hi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cw||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Gl(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!p_(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=X(this,rs))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=X(this,rs))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),X(this,Ui).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(X(this,rs)&&(X(this,eu)?X(this,rs).cancel({revert:!0}):X(this,rs).cancelRetry()),this.scheduleGc()),X(this,Ui).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Xt(this,go,Oa).call(this,{type:"invalidate"})}async fetch(e,n){var p,f,m,g,y,v,C,S,j,D,M,T;if(this.state.fetchStatus!=="idle"&&((p=X(this,rs))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,rs))return X(this,rs).continueRetry(),X(this,rs).promise}if(e&&this.setOptions(e),!this.options.queryFn){const E=this.observers.find(k=>k.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(st(this,eu,!0),r.signal)})},i=()=>{const E=h_(this.options,n),A=(()=>{const O={client:X(this,Xc),queryKey:this.queryKey,meta:this.meta};return s(O),O})();return st(this,eu,!1),this.options.persister?this.options.persister(E,A,this):E(A)},u=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,Xc),state:this.state,fetchFn:i};return s(E),E})();(f=this.options.behavior)==null||f.onFetch(u,this),st(this,Ud,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=u.fetchOptions)==null?void 0:m.meta))&&Xt(this,go,Oa).call(this,{type:"fetch",meta:(g=u.fetchOptions)==null?void 0:g.meta}),st(this,rs,g_({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:E=>{E instanceof F1&&E.revert&&this.setState({...X(this,Ud),fetchStatus:"idle"}),r.abort()},onFail:(E,k)=>{Xt(this,go,Oa).call(this,{type:"failed",failureCount:E,error:k})},onPause:()=>{Xt(this,go,Oa).call(this,{type:"pause"})},onContinue:()=>{Xt(this,go,Oa).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const E=await X(this,rs).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(v=(y=X(this,Ui).config).onSuccess)==null||v.call(y,E,this),(S=(C=X(this,Ui).config).onSettled)==null||S.call(C,E,this.state.error,this),E}catch(E){if(E instanceof F1){if(E.silent)return X(this,rs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Xt(this,go,Oa).call(this,{type:"error",error:E}),(D=(j=X(this,Ui).config).onError)==null||D.call(j,E,this),(T=(M=X(this,Ui).config).onSettled)==null||T.call(M,this.state.data,E,this),E}finally{this.scheduleGc()}}},Yc=new WeakMap,Ud=new WeakMap,Ui=new WeakMap,Xc=new WeakMap,rs=new WeakMap,lm=new WeakMap,eu=new WeakMap,go=new WeakSet,Oa=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...v_(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...jR(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return st(this,Ud,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Xr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),X(this,Ui).notify({query:this,type:"updated",action:e})})},PA);function v_(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:m_(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function jR(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function TR(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ks,gn,cm,Es,tu,Vd,_a,Il,um,Hd,Wd,nu,ru,Pl,qd,Ln,Uf,B1,U1,V1,H1,W1,q1,G1,x_,LA,dN=(LA=class extends gp{constructor(e,n){super();Dt(this,Ln);Dt(this,Ks);Dt(this,gn);Dt(this,cm);Dt(this,Es);Dt(this,tu);Dt(this,Vd);Dt(this,_a);Dt(this,Il);Dt(this,um);Dt(this,Hd);Dt(this,Wd);Dt(this,nu);Dt(this,ru);Dt(this,Pl);Dt(this,qd,new Set);this.options=n,st(this,Ks,e),st(this,Il,null),st(this,_a,N1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,gn).addObserver(this),DR(X(this,gn),this.options)?Xt(this,Ln,Uf).call(this):this.updateResult(),Xt(this,Ln,H1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Z1(X(this,gn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Z1(X(this,gn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Xt(this,Ln,W1).call(this),Xt(this,Ln,q1).call(this),X(this,gn).removeObserver(this)}setOptions(e){const n=this.options,r=X(this,gn);if(this.options=X(this,Ks).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Hi(this.options.enabled,X(this,gn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Xt(this,Ln,G1).call(this),X(this,gn).setOptions(this.options),n._defaulted&&!lv(this.options,n)&&X(this,Ks).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,gn),observer:this});const s=this.hasListeners();s&&ER(X(this,gn),r,this.options,n)&&Xt(this,Ln,Uf).call(this),this.updateResult(),s&&(X(this,gn)!==r||Hi(this.options.enabled,X(this,gn))!==Hi(n.enabled,X(this,gn))||Gl(this.options.staleTime,X(this,gn))!==Gl(n.staleTime,X(this,gn)))&&Xt(this,Ln,B1).call(this);const i=Xt(this,Ln,U1).call(this);s&&(X(this,gn)!==r||Hi(this.options.enabled,X(this,gn))!==Hi(n.enabled,X(this,gn))||i!==X(this,Pl))&&Xt(this,Ln,V1).call(this,i)}getOptimisticResult(e){const n=X(this,Ks).getQueryCache().build(X(this,Ks),e),r=this.createResult(n,e);return fN(this,r)&&(st(this,Es,r),st(this,Vd,this.options),st(this,tu,X(this,gn).state)),r}getCurrentResult(){return X(this,Es)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&X(this,_a).status==="pending"&&X(this,_a).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){X(this,qd).add(e)}getCurrentQuery(){return X(this,gn)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=X(this,Ks).defaultQueryOptions(e),r=X(this,Ks).getQueryCache().build(X(this,Ks),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Xt(this,Ln,Uf).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,Es)))}createResult(e,n){var $;const r=X(this,gn),s=this.options,i=X(this,Es),l=X(this,tu),u=X(this,Vd),f=e!==r?e.state:X(this,cm),{state:m}=e;let g={...m},y=!1,v;if(n._optimisticResults){const R=this.hasListeners(),P=!R&&DR(e,n),z=R&&ER(e,r,n,s);(P||z)&&(g={...g,...v_(m.data,e.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:C,errorUpdatedAt:S,status:j}=g;v=g.data;let D=!1;if(n.placeholderData!==void 0&&v===void 0&&j==="pending"){let R;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(R=i.data,D=!0):R=typeof n.placeholderData=="function"?n.placeholderData(($=X(this,Wd))==null?void 0:$.state.data,X(this,Wd)):n.placeholderData,R!==void 0&&(j="success",v=$1(i==null?void 0:i.data,R,n),y=!0)}if(n.select&&v!==void 0&&!D)if(i&&v===(l==null?void 0:l.data)&&n.select===X(this,um))v=X(this,Hd);else try{st(this,um,n.select),v=n.select(v),v=$1(i==null?void 0:i.data,v,n),st(this,Hd,v),st(this,Il,null)}catch(R){st(this,Il,R)}X(this,Il)&&(C=X(this,Il),v=X(this,Hd),S=Date.now(),j="error");const M=g.fetchStatus==="fetching",T=j==="pending",E=j==="error",k=T&&M,A=v!==void 0,I={status:j,fetchStatus:g.fetchStatus,isPending:T,isSuccess:j==="success",isError:E,isInitialLoading:k,isLoading:k,data:v,dataUpdatedAt:g.dataUpdatedAt,error:C,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:M,isRefetching:M&&!T,isLoadingError:E&&!A,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:E&&A,isStale:Tw(e,n),refetch:this.refetch,promise:X(this,_a),isEnabled:Hi(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,P=I.status==="error"&&!R,z=U=>{P?U.reject(I.error):R&&U.resolve(I.data)},N=()=>{const U=st(this,_a,I.promise=N1());z(U)},H=X(this,_a);switch(H.status){case"pending":e.queryHash===r.queryHash&&z(H);break;case"fulfilled":(P||I.data!==H.value)&&N();break;case"rejected":(!P||I.error!==H.reason)&&N();break}}return I}updateResult(){const e=X(this,Es),n=this.createResult(X(this,gn),this.options);if(st(this,tu,X(this,gn).state),st(this,Vd,this.options),X(this,tu).data!==void 0&&st(this,Wd,X(this,gn)),lv(n,e))return;st(this,Es,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!X(this,qd).size)return!0;const l=new Set(i??X(this,qd));return this.options.throwOnError&&l.add("error"),Object.keys(X(this,Es)).some(u=>{const p=u;return X(this,Es)[p]!==e[p]&&l.has(p)})};Xt(this,Ln,x_).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Xt(this,Ln,H1).call(this)}},Ks=new WeakMap,gn=new WeakMap,cm=new WeakMap,Es=new WeakMap,tu=new WeakMap,Vd=new WeakMap,_a=new WeakMap,Il=new WeakMap,um=new WeakMap,Hd=new WeakMap,Wd=new WeakMap,nu=new WeakMap,ru=new WeakMap,Pl=new WeakMap,qd=new WeakMap,Ln=new WeakSet,Uf=function(e){Xt(this,Ln,G1).call(this);let n=X(this,gn).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ks)),n},B1=function(){Xt(this,Ln,W1).call(this);const e=Gl(this.options.staleTime,X(this,gn));if(hu||X(this,Es).isStale||!L1(e))return;const r=p_(X(this,Es).dataUpdatedAt,e)+1;st(this,nu,Wc.setTimeout(()=>{X(this,Es).isStale||this.updateResult()},r))},U1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,gn)):this.options.refetchInterval)??!1},V1=function(e){Xt(this,Ln,q1).call(this),st(this,Pl,e),!(hu||Hi(this.options.enabled,X(this,gn))===!1||!L1(X(this,Pl))||X(this,Pl)===0)&&st(this,ru,Wc.setInterval(()=>{(this.options.refetchIntervalInBackground||jw.isFocused())&&Xt(this,Ln,Uf).call(this)},X(this,Pl)))},H1=function(){Xt(this,Ln,B1).call(this),Xt(this,Ln,V1).call(this,Xt(this,Ln,U1).call(this))},W1=function(){X(this,nu)&&(Wc.clearTimeout(X(this,nu)),st(this,nu,void 0))},q1=function(){X(this,ru)&&(Wc.clearInterval(X(this,ru)),st(this,ru,void 0))},G1=function(){const e=X(this,Ks).getQueryCache().build(X(this,Ks),this.options);if(e===X(this,gn))return;const n=X(this,gn);st(this,gn,e),st(this,cm,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},x_=function(e){Xr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(X(this,Es))}),X(this,Ks).getQueryCache().notify({query:X(this,gn),type:"observerResultsUpdated"})})},LA);function pN(t,e){return Hi(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function DR(t,e){return pN(t,e)||t.state.data!==void 0&&Z1(t,e,e.refetchOnMount)}function Z1(t,e,n){if(Hi(e.enabled,t)!==!1&&Gl(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Tw(t,e)}return!1}function ER(t,e,n,r){return(t!==e||Hi(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Tw(t,n)}function Tw(t,e){return Hi(e.enabled,t)!==!1&&t.isStaleByTime(Gl(e.staleTime,t))}function fN(t,e){return!lv(t.getCurrentResult(),e)}function RR(t){return{onFetch:(e,n)=>{var m,g,y,v,C;const r=e.options,s=(y=(g=(m=e.fetchOptions)==null?void 0:m.meta)==null?void 0:g.fetchMore)==null?void 0:y.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],l=((C=e.state.data)==null?void 0:C.pageParams)||[];let u={pages:[],pageParams:[]},p=0;const f=async()=>{let S=!1;const j=T=>{sN(T,()=>e.signal,()=>S=!0)},D=h_(e.options,e.fetchOptions),M=async(T,E,k)=>{if(S)return Promise.reject();if(E==null&&T.pages.length)return Promise.resolve(T);const O=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:E,direction:k?"backward":"forward",meta:e.options.meta};return j(P),P})(),I=await D(O),{maxPages:$}=e.options,R=k?rN:nN;return{pages:R(T.pages,I,$),pageParams:R(T.pageParams,E,$)}};if(s&&i.length){const T=s==="backward",E=T?hN:kR,k={pages:i,pageParams:l},A=E(r,k);u=await M(k,A,T)}else{const T=t??i.length;do{const E=p===0?l[0]??r.initialPageParam:kR(r,u);if(p>0&&E==null)break;u=await M(u,E),p++}while(p<T)}return u};e.options.persister?e.fetchFn=()=>{var S,j;return(j=(S=e.options).persister)==null?void 0:j.call(S,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function kR(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function hN(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var dm,Fo,bs,su,Bo,wl,zA,mN=(zA=class extends y_{constructor(e){super();Dt(this,Bo);Dt(this,dm);Dt(this,Fo);Dt(this,bs);Dt(this,su);st(this,dm,e.client),this.mutationId=e.mutationId,st(this,bs,e.mutationCache),st(this,Fo,[]),this.state=e.state||b_(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){X(this,Fo).includes(e)||(X(this,Fo).push(e),this.clearGcTimeout(),X(this,bs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){st(this,Fo,X(this,Fo).filter(n=>n!==e)),this.scheduleGc(),X(this,bs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){X(this,Fo).length||(this.state.status==="pending"?this.scheduleGc():X(this,bs).remove(this))}continue(){var e;return((e=X(this,su))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var l,u,p,f,m,g,y,v,C,S,j,D,M,T,E,k,A,O;const n=()=>{Xt(this,Bo,wl).call(this,{type:"continue"})},r={client:X(this,dm),meta:this.options.meta,mutationKey:this.options.mutationKey};st(this,su,g_({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,$)=>{Xt(this,Bo,wl).call(this,{type:"failed",failureCount:I,error:$})},onPause:()=>{Xt(this,Bo,wl).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>X(this,bs).canRun(this)}));const s=this.state.status==="pending",i=!X(this,su).canStart();try{if(s)n();else{Xt(this,Bo,wl).call(this,{type:"pending",variables:e,isPaused:i}),X(this,bs).config.onMutate&&await X(this,bs).config.onMutate(e,this,r);const $=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));$!==this.state.context&&Xt(this,Bo,wl).call(this,{type:"pending",context:$,variables:e,isPaused:i})}const I=await X(this,su).start();return await((f=(p=X(this,bs).config).onSuccess)==null?void 0:f.call(p,I,e,this.state.context,this,r)),await((g=(m=this.options).onSuccess)==null?void 0:g.call(m,I,e,this.state.context,r)),await((v=(y=X(this,bs).config).onSettled)==null?void 0:v.call(y,I,null,this.state.variables,this.state.context,this,r)),await((S=(C=this.options).onSettled)==null?void 0:S.call(C,I,null,e,this.state.context,r)),Xt(this,Bo,wl).call(this,{type:"success",data:I}),I}catch(I){try{await((D=(j=X(this,bs).config).onError)==null?void 0:D.call(j,I,e,this.state.context,this,r))}catch($){Promise.reject($)}try{await((T=(M=this.options).onError)==null?void 0:T.call(M,I,e,this.state.context,r))}catch($){Promise.reject($)}try{await((k=(E=X(this,bs).config).onSettled)==null?void 0:k.call(E,void 0,I,this.state.variables,this.state.context,this,r))}catch($){Promise.reject($)}try{await((O=(A=this.options).onSettled)==null?void 0:O.call(A,void 0,I,e,this.state.context,r))}catch($){Promise.reject($)}throw Xt(this,Bo,wl).call(this,{type:"error",error:I}),I}finally{X(this,bs).runNext(this)}}},dm=new WeakMap,Fo=new WeakMap,bs=new WeakMap,su=new WeakMap,Bo=new WeakSet,wl=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Xr.batch(()=>{X(this,Fo).forEach(r=>{r.onMutationUpdate(e)}),X(this,bs).notify({mutation:this,type:"updated",action:e})})},zA);function b_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ia,yo,pm,$A,gN=($A=class extends gp{constructor(e={}){super();Dt(this,Ia);Dt(this,yo);Dt(this,pm);this.config=e,st(this,Ia,new Set),st(this,yo,new Map),st(this,pm,0)}build(e,n,r){const s=new mN({client:e,mutationCache:this,mutationId:++ry(this,pm)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){X(this,Ia).add(e);const n=ly(e);if(typeof n=="string"){const r=X(this,yo).get(n);r?r.push(e):X(this,yo).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(X(this,Ia).delete(e)){const n=ly(e);if(typeof n=="string"){const r=X(this,yo).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&X(this,yo).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=ly(e);if(typeof n=="string"){const r=X(this,yo).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=ly(e);if(typeof n=="string"){const s=(r=X(this,yo).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Xr.batch(()=>{X(this,Ia).forEach(e=>{this.notify({type:"removed",mutation:e})}),X(this,Ia).clear(),X(this,yo).clear()})}getAll(){return Array.from(X(this,Ia))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>SR(n,r))}findAll(e={}){return this.getAll().filter(n=>SR(e,n))}notify(e){Xr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Xr.batch(()=>Promise.all(e.map(n=>n.continue().catch(ks))))}},Ia=new WeakMap,yo=new WeakMap,pm=new WeakMap,$A);function ly(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Pa,Ll,Qs,La,Va,Hy,K1,NA,yN=(NA=class extends gp{constructor(n,r){super();Dt(this,Va);Dt(this,Pa);Dt(this,Ll);Dt(this,Qs);Dt(this,La);st(this,Pa,n),this.setOptions(r),this.bindMethods(),Xt(this,Va,Hy).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=X(this,Pa).defaultMutationOptions(n),lv(this.options,r)||X(this,Pa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:X(this,Qs),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&mu(r.mutationKey)!==mu(this.options.mutationKey)?this.reset():((s=X(this,Qs))==null?void 0:s.state.status)==="pending"&&X(this,Qs).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=X(this,Qs))==null||n.removeObserver(this)}onMutationUpdate(n){Xt(this,Va,Hy).call(this),Xt(this,Va,K1).call(this,n)}getCurrentResult(){return X(this,Ll)}reset(){var n;(n=X(this,Qs))==null||n.removeObserver(this),st(this,Qs,void 0),Xt(this,Va,Hy).call(this),Xt(this,Va,K1).call(this)}mutate(n,r){var s;return st(this,La,r),(s=X(this,Qs))==null||s.removeObserver(this),st(this,Qs,X(this,Pa).getMutationCache().build(X(this,Pa),this.options)),X(this,Qs).addObserver(this),X(this,Qs).execute(n)}},Pa=new WeakMap,Ll=new WeakMap,Qs=new WeakMap,La=new WeakMap,Va=new WeakSet,Hy=function(){var r;const n=((r=X(this,Qs))==null?void 0:r.state)??b_();st(this,Ll,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},K1=function(n){Xr.batch(()=>{var r,s,i,l,u,p,f,m;if(X(this,La)&&this.hasListeners()){const g=X(this,Ll).variables,y=X(this,Ll).context,v={client:X(this,Pa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=X(this,La)).onSuccess)==null||s.call(r,n.data,g,y,v)}catch(C){Promise.reject(C)}try{(l=(i=X(this,La)).onSettled)==null||l.call(i,n.data,null,g,y,v)}catch(C){Promise.reject(C)}}else if((n==null?void 0:n.type)==="error"){try{(p=(u=X(this,La)).onError)==null||p.call(u,n.error,g,y,v)}catch(C){Promise.reject(C)}try{(m=(f=X(this,La)).onSettled)==null||m.call(f,void 0,n.error,g,y,v)}catch(C){Promise.reject(C)}}}this.listeners.forEach(g=>{g(X(this,Ll))})})},NA),Uo,FA,vN=(FA=class extends gp{constructor(e={}){super();Dt(this,Uo);this.config=e,st(this,Uo,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Sw(s,n);let l=this.get(i);return l||(l=new uN({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(l)),l}add(e){X(this,Uo).has(e.queryHash)||(X(this,Uo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=X(this,Uo).get(e.queryHash);n&&(e.destroy(),n===e&&X(this,Uo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Xr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return X(this,Uo).get(e)}getAll(){return[...X(this,Uo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>bR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>bR(e,r)):n}notify(e){Xr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Xr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Xr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Uo=new WeakMap,FA),wr,zl,$l,Gd,Zd,Nl,Kd,Qd,BA,xN=(BA=class{constructor(t={}){Dt(this,wr);Dt(this,zl);Dt(this,$l);Dt(this,Gd);Dt(this,Zd);Dt(this,Nl);Dt(this,Kd);Dt(this,Qd);st(this,wr,t.queryCache||new vN),st(this,zl,t.mutationCache||new gN),st(this,$l,t.defaultOptions||{}),st(this,Gd,new Map),st(this,Zd,new Map),st(this,Nl,0)}mount(){ry(this,Nl)._++,X(this,Nl)===1&&(st(this,Kd,jw.subscribe(async t=>{t&&(await this.resumePausedMutations(),X(this,wr).onFocus())})),st(this,Qd,cv.subscribe(async t=>{t&&(await this.resumePausedMutations(),X(this,wr).onOnline())})))}unmount(){var t,e;ry(this,Nl)._--,X(this,Nl)===0&&((t=X(this,Kd))==null||t.call(this),st(this,Kd,void 0),(e=X(this,Qd))==null||e.call(this),st(this,Qd,void 0))}isFetching(t){return X(this,wr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return X(this,zl).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=X(this,wr).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=X(this,wr).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Gl(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return X(this,wr).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=X(this,wr).get(r.queryHash),i=s==null?void 0:s.state.data,l=X$(e,i);if(l!==void 0)return X(this,wr).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(t,e,n){return Xr.batch(()=>X(this,wr).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=X(this,wr).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=X(this,wr);Xr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=X(this,wr);return Xr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Xr.batch(()=>X(this,wr).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(ks).catch(ks)}invalidateQueries(t,e={}){return Xr.batch(()=>(X(this,wr).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Xr.batch(()=>X(this,wr).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(ks)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(ks)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=X(this,wr).build(this,e);return n.isStaleByTime(Gl(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ks).catch(ks)}fetchInfiniteQuery(t){return t.behavior=RR(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ks).catch(ks)}ensureInfiniteQueryData(t){return t.behavior=RR(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return cv.isOnline()?X(this,zl).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,wr)}getMutationCache(){return X(this,zl)}getDefaultOptions(){return X(this,$l)}setDefaultOptions(t){st(this,$l,t)}setQueryDefaults(t,e){X(this,Gd).set(mu(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...X(this,Gd).values()],n={};return e.forEach(r=>{vh(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){X(this,Zd).set(mu(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...X(this,Zd).values()],n={};return e.forEach(r=>{vh(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...X(this,$l).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Sw(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Cw&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...X(this,$l).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){X(this,wr).clear(),X(this,zl).clear()}},wr=new WeakMap,zl=new WeakMap,$l=new WeakMap,Gd=new WeakMap,Zd=new WeakMap,Nl=new WeakMap,Kd=new WeakMap,Qd=new WeakMap,BA),S_=b.createContext(void 0),ys=t=>{const e=b.useContext(S_);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},bN=({client:t,children:e})=>(b.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),a.jsx(S_.Provider,{value:t,children:e})),C_=b.createContext(!1),SN=()=>b.useContext(C_);C_.Provider;function CN(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var wN=b.createContext(CN()),jN=()=>b.useContext(wN),TN=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?ww(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},DN=t=>{b.useEffect(()=>{t.clearReset()},[t])},EN=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||ww(n,[t.error,r])),RN=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},kN=(t,e)=>t.isLoading&&t.isFetching&&!e,MN=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,MR=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function ON(t,e,n){var y,v,C,S;const r=SN(),s=jN(),i=ys(),l=i.defaultQueryOptions(t);(v=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||v.call(y,l);const u=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",RN(l),TN(l,s,u),DN(s);const p=!i.getQueryCache().get(l.queryHash),[f]=b.useState(()=>new e(i,l)),m=f.getOptimisticResult(l),g=!r&&t.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(j=>{const D=g?f.subscribe(Xr.batchCalls(j)):ks;return f.updateResult(),D},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(l)},[l,f]),MN(l,m))throw MR(l,f,s);if(EN({result:m,errorResetBoundary:s,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw m.error;if((S=(C=i.getDefaultOptions().queries)==null?void 0:C._experimental_afterQuery)==null||S.call(C,l,m),l.experimental_prefetchInRender&&!hu&&kN(m,r)){const j=p?MR(l,f,s):u==null?void 0:u.promise;j==null||j.catch(ks).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?m:f.trackResult(m)}function jn(t,e){return ON(t,dN)}function Pn(t,e){const n=ys(),[r]=b.useState(()=>new yN(n,t));b.useEffect(()=>{r.setOptions(t)},[r,t]);const s=b.useSyncExternalStore(b.useCallback(l=>r.subscribe(Xr.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=b.useCallback((l,u)=>{r.mutate(l,u).catch(ks)},[r]);if(s.error&&ww(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const xh={black:"#000",white:"#fff"},ld={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},cd={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},ud={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},dd={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},pd={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},Df={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},AN={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function Wa(t,...e){const n=new URL(`https://mui.com/production-error/?code=${t}`);return e.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${t}; visit ${n} for the full message.`}const So="$$material";function uv(){return uv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},uv.apply(null,arguments)}function _N(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function IN(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var PN=(function(){function t(n){var r=this;this._insertTag=function(s){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,i),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(IN(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var i=_N(s);try{i.insertRule(r,i.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},t})(),xs="-ms-",dv="-moz-",On="-webkit-",w_="comm",Dw="rule",Ew="decl",LN="@import",j_="@keyframes",zN="@layer",$N=Math.abs,ax=String.fromCharCode,NN=Object.assign;function FN(t,e){return ms(t,0)^45?(((e<<2^ms(t,0))<<2^ms(t,1))<<2^ms(t,2))<<2^ms(t,3):0}function T_(t){return t.trim()}function BN(t,e){return(t=e.exec(t))?t[0]:t}function An(t,e,n){return t.replace(e,n)}function Q1(t,e){return t.indexOf(e)}function ms(t,e){return t.charCodeAt(e)|0}function bh(t,e,n){return t.slice(e,n)}function Vo(t){return t.length}function Rw(t){return t.length}function cy(t,e){return e.push(t),t}function UN(t,e){return t.map(e).join("")}var lx=1,Xd=1,D_=0,ei=0,Hr=0,yp="";function cx(t,e,n,r,s,i,l){return{value:t,root:e,parent:n,type:r,props:s,children:i,line:lx,column:Xd,length:l,return:""}}function Ef(t,e){return NN(cx("",null,null,"",null,null,0),t,{length:-t.length},e)}function VN(){return Hr}function HN(){return Hr=ei>0?ms(yp,--ei):0,Xd--,Hr===10&&(Xd=1,lx--),Hr}function Si(){return Hr=ei<D_?ms(yp,ei++):0,Xd++,Hr===10&&(Xd=1,lx++),Hr}function qo(){return ms(yp,ei)}function Wy(){return ei}function hm(t,e){return bh(yp,t,e)}function Sh(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function E_(t){return lx=Xd=1,D_=Vo(yp=t),ei=0,[]}function R_(t){return yp="",t}function qy(t){return T_(hm(ei-1,J1(t===91?t+2:t===40?t+1:t)))}function WN(t){for(;(Hr=qo())&&Hr<33;)Si();return Sh(t)>2||Sh(Hr)>3?"":" "}function qN(t,e){for(;--e&&Si()&&!(Hr<48||Hr>102||Hr>57&&Hr<65||Hr>70&&Hr<97););return hm(t,Wy()+(e<6&&qo()==32&&Si()==32))}function J1(t){for(;Si();)switch(Hr){case t:return ei;case 34:case 39:t!==34&&t!==39&&J1(Hr);break;case 40:t===41&&J1(t);break;case 92:Si();break}return ei}function GN(t,e){for(;Si()&&t+Hr!==57;)if(t+Hr===84&&qo()===47)break;return"/*"+hm(e,ei-1)+"*"+ax(t===47?t:Si())}function ZN(t){for(;!Sh(qo());)Si();return hm(t,ei)}function KN(t){return R_(Gy("",null,null,null,[""],t=E_(t),0,[0],t))}function Gy(t,e,n,r,s,i,l,u,p){for(var f=0,m=0,g=l,y=0,v=0,C=0,S=1,j=1,D=1,M=0,T="",E=s,k=i,A=r,O=T;j;)switch(C=M,M=Si()){case 40:if(C!=108&&ms(O,g-1)==58){Q1(O+=An(qy(M),"&","&\f"),"&\f")!=-1&&(D=-1);break}case 34:case 39:case 91:O+=qy(M);break;case 9:case 10:case 13:case 32:O+=WN(C);break;case 92:O+=qN(Wy()-1,7);continue;case 47:switch(qo()){case 42:case 47:cy(QN(GN(Si(),Wy()),e,n),p);break;default:O+="/"}break;case 123*S:u[f++]=Vo(O)*D;case 125*S:case 59:case 0:switch(M){case 0:case 125:j=0;case 59+m:D==-1&&(O=An(O,/\f/g,"")),v>0&&Vo(O)-g&&cy(v>32?AR(O+";",r,n,g-1):AR(An(O," ","")+";",r,n,g-2),p);break;case 59:O+=";";default:if(cy(A=OR(O,e,n,f,m,s,u,T,E=[],k=[],g),i),M===123)if(m===0)Gy(O,e,A,A,E,i,g,u,k);else switch(y===99&&ms(O,3)===110?100:y){case 100:case 108:case 109:case 115:Gy(t,A,A,r&&cy(OR(t,A,A,0,0,s,u,T,s,E=[],g),k),s,k,g,u,r?E:k);break;default:Gy(O,A,A,A,[""],k,0,u,k)}}f=m=v=0,S=D=1,T=O="",g=l;break;case 58:g=1+Vo(O),v=C;default:if(S<1){if(M==123)--S;else if(M==125&&S++==0&&HN()==125)continue}switch(O+=ax(M),M*S){case 38:D=m>0?1:(O+="\f",-1);break;case 44:u[f++]=(Vo(O)-1)*D,D=1;break;case 64:qo()===45&&(O+=qy(Si())),y=qo(),m=g=Vo(T=O+=ZN(Wy())),M++;break;case 45:C===45&&Vo(O)==2&&(S=0)}}return i}function OR(t,e,n,r,s,i,l,u,p,f,m){for(var g=s-1,y=s===0?i:[""],v=Rw(y),C=0,S=0,j=0;C<r;++C)for(var D=0,M=bh(t,g+1,g=$N(S=l[C])),T=t;D<v;++D)(T=T_(S>0?y[D]+" "+M:An(M,/&\f/g,y[D])))&&(p[j++]=T);return cx(t,e,n,s===0?Dw:u,p,f,m)}function QN(t,e,n){return cx(t,e,n,w_,ax(VN()),bh(t,2,-2),0)}function AR(t,e,n,r){return cx(t,e,n,Ew,bh(t,0,r),bh(t,r+1,-1),r)}function Ad(t,e){for(var n="",r=Rw(t),s=0;s<r;s++)n+=e(t[s],s,t,e)||"";return n}function JN(t,e,n,r){switch(t.type){case zN:if(t.children.length)break;case LN:case Ew:return t.return=t.return||t.value;case w_:return"";case j_:return t.return=t.value+"{"+Ad(t.children,r)+"}";case Dw:t.value=t.props.join(",")}return Vo(n=Ad(t.children,r))?t.return=t.value+"{"+n+"}":""}function YN(t){var e=Rw(t);return function(n,r,s,i){for(var l="",u=0;u<e;u++)l+=t[u](n,r,s,i)||"";return l}}function XN(t){return function(e){e.root||(e=e.return)&&t(e)}}function k_(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var eF=function(e,n,r){for(var s=0,i=0;s=i,i=qo(),s===38&&i===12&&(n[r]=1),!Sh(i);)Si();return hm(e,ei)},tF=function(e,n){var r=-1,s=44;do switch(Sh(s)){case 0:s===38&&qo()===12&&(n[r]=1),e[r]+=eF(ei-1,n,r);break;case 2:e[r]+=qy(s);break;case 4:if(s===44){e[++r]=qo()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=ax(s)}while(s=Si());return e},nF=function(e,n){return R_(tF(E_(e),n))},_R=new WeakMap,rF=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,s=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!_R.get(r))&&!s){_R.set(e,!0);for(var i=[],l=nF(n,i),u=r.props,p=0,f=0;p<l.length;p++)for(var m=0;m<u.length;m++,f++)e.props[f]=i[p]?l[p].replace(/&\f/g,u[m]):u[m]+" "+l[p]}}},sF=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function M_(t,e){switch(FN(t,e)){case 5103:return On+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return On+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return On+t+dv+t+xs+t+t;case 6828:case 4268:return On+t+xs+t+t;case 6165:return On+t+xs+"flex-"+t+t;case 5187:return On+t+An(t,/(\w+).+(:[^]+)/,On+"box-$1$2"+xs+"flex-$1$2")+t;case 5443:return On+t+xs+"flex-item-"+An(t,/flex-|-self/,"")+t;case 4675:return On+t+xs+"flex-line-pack"+An(t,/align-content|flex-|-self/,"")+t;case 5548:return On+t+xs+An(t,"shrink","negative")+t;case 5292:return On+t+xs+An(t,"basis","preferred-size")+t;case 6060:return On+"box-"+An(t,"-grow","")+On+t+xs+An(t,"grow","positive")+t;case 4554:return On+An(t,/([^-])(transform)/g,"$1"+On+"$2")+t;case 6187:return An(An(An(t,/(zoom-|grab)/,On+"$1"),/(image-set)/,On+"$1"),t,"")+t;case 5495:case 3959:return An(t,/(image-set\([^]*)/,On+"$1$`$1");case 4968:return An(An(t,/(.+:)(flex-)?(.*)/,On+"box-pack:$3"+xs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+On+t+t;case 4095:case 3583:case 4068:case 2532:return An(t,/(.+)-inline(.+)/,On+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Vo(t)-1-e>6)switch(ms(t,e+1)){case 109:if(ms(t,e+4)!==45)break;case 102:return An(t,/(.+:)(.+)-([^]+)/,"$1"+On+"$2-$3$1"+dv+(ms(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Q1(t,"stretch")?M_(An(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(ms(t,e+1)!==115)break;case 6444:switch(ms(t,Vo(t)-3-(~Q1(t,"!important")&&10))){case 107:return An(t,":",":"+On)+t;case 101:return An(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+On+(ms(t,14)===45?"inline-":"")+"box$3$1"+On+"$2$3$1"+xs+"$2box$3")+t}break;case 5936:switch(ms(t,e+11)){case 114:return On+t+xs+An(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return On+t+xs+An(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return On+t+xs+An(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return On+t+xs+t+t}return t}var iF=function(e,n,r,s){if(e.length>-1&&!e.return)switch(e.type){case Ew:e.return=M_(e.value,e.length);break;case j_:return Ad([Ef(e,{value:An(e.value,"@","@"+On)})],s);case Dw:if(e.length)return UN(e.props,function(i){switch(BN(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ad([Ef(e,{props:[An(i,/:(read-\w+)/,":"+dv+"$1")]})],s);case"::placeholder":return Ad([Ef(e,{props:[An(i,/:(plac\w+)/,":"+On+"input-$1")]}),Ef(e,{props:[An(i,/:(plac\w+)/,":"+dv+"$1")]}),Ef(e,{props:[An(i,/:(plac\w+)/,xs+"input-$1")]})],s)}return""})}},oF=[iF],aF=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(S){var j=S.getAttribute("data-emotion");j.indexOf(" ")!==-1&&(document.head.appendChild(S),S.setAttribute("data-s",""))})}var s=e.stylisPlugins||oF,i={},l,u=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(S){for(var j=S.getAttribute("data-emotion").split(" "),D=1;D<j.length;D++)i[j[D]]=!0;u.push(S)});var p,f=[rF,sF];{var m,g=[JN,XN(function(S){m.insert(S)})],y=YN(f.concat(s,g)),v=function(j){return Ad(KN(j),y)};p=function(j,D,M,T){m=M,v(j?j+"{"+D.styles+"}":D.styles),T&&(C.inserted[D.name]=!0)}}var C={key:n,sheet:new PN({key:n,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:p};return C.sheet.hydrate(u),C},PS={exports:{}},In={};/** @license React v16.13.1
|
|
66
|
+
* react-is.production.min.js
|
|
67
|
+
*
|
|
68
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the MIT license found in the
|
|
71
|
+
* LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/var IR;function lF(){if(IR)return In;IR=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,s=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,l=t?Symbol.for("react.provider"):60109,u=t?Symbol.for("react.context"):60110,p=t?Symbol.for("react.async_mode"):60111,f=t?Symbol.for("react.concurrent_mode"):60111,m=t?Symbol.for("react.forward_ref"):60112,g=t?Symbol.for("react.suspense"):60113,y=t?Symbol.for("react.suspense_list"):60120,v=t?Symbol.for("react.memo"):60115,C=t?Symbol.for("react.lazy"):60116,S=t?Symbol.for("react.block"):60121,j=t?Symbol.for("react.fundamental"):60117,D=t?Symbol.for("react.responder"):60118,M=t?Symbol.for("react.scope"):60119;function T(k){if(typeof k=="object"&&k!==null){var A=k.$$typeof;switch(A){case e:switch(k=k.type,k){case p:case f:case r:case i:case s:case g:return k;default:switch(k=k&&k.$$typeof,k){case u:case m:case C:case v:case l:return k;default:return A}}case n:return A}}}function E(k){return T(k)===f}return In.AsyncMode=p,In.ConcurrentMode=f,In.ContextConsumer=u,In.ContextProvider=l,In.Element=e,In.ForwardRef=m,In.Fragment=r,In.Lazy=C,In.Memo=v,In.Portal=n,In.Profiler=i,In.StrictMode=s,In.Suspense=g,In.isAsyncMode=function(k){return E(k)||T(k)===p},In.isConcurrentMode=E,In.isContextConsumer=function(k){return T(k)===u},In.isContextProvider=function(k){return T(k)===l},In.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===e},In.isForwardRef=function(k){return T(k)===m},In.isFragment=function(k){return T(k)===r},In.isLazy=function(k){return T(k)===C},In.isMemo=function(k){return T(k)===v},In.isPortal=function(k){return T(k)===n},In.isProfiler=function(k){return T(k)===i},In.isStrictMode=function(k){return T(k)===s},In.isSuspense=function(k){return T(k)===g},In.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===f||k===i||k===s||k===g||k===y||typeof k=="object"&&k!==null&&(k.$$typeof===C||k.$$typeof===v||k.$$typeof===l||k.$$typeof===u||k.$$typeof===m||k.$$typeof===j||k.$$typeof===D||k.$$typeof===M||k.$$typeof===S)},In.typeOf=T,In}var PR;function cF(){return PR||(PR=1,PS.exports=lF()),PS.exports}var LS,LR;function uF(){if(LR)return LS;LR=1;var t=cF(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};i[t.ForwardRef]=r,i[t.Memo]=s;function l(C){return t.isMemo(C)?s:i[C.$$typeof]||e}var u=Object.defineProperty,p=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,m=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,y=Object.prototype;function v(C,S,j){if(typeof S!="string"){if(y){var D=g(S);D&&D!==y&&v(C,D,j)}var M=p(S);f&&(M=M.concat(f(S)));for(var T=l(C),E=l(S),k=0;k<M.length;++k){var A=M[k];if(!n[A]&&!(j&&j[A])&&!(E&&E[A])&&!(T&&T[A])){var O=m(S,A);try{u(C,A,O)}catch{}}}}return C}return LS=v,LS}uF();var dF=!0;function O_(t,e,n){var r="";return n.split(" ").forEach(function(s){t[s]!==void 0?e.push(t[s]+";"):s&&(r+=s+" ")}),r}var kw=function(e,n,r){var s=e.key+"-"+n.name;(r===!1||dF===!1)&&e.registered[s]===void 0&&(e.registered[s]=n.styles)},Mw=function(e,n,r){kw(e,n,r);var s=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var i=n;do e.insert(n===i?"."+s:"",i,e.sheet,!0),i=i.next;while(i!==void 0)}};function pF(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var fF={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hF=/[A-Z]|^ms/g,mF=/_EMO_([^_]+?)_([^]*?)_EMO_/g,A_=function(e){return e.charCodeAt(1)===45},zR=function(e){return e!=null&&typeof e!="boolean"},zS=k_(function(t){return A_(t)?t:t.replace(hF,"-$&").toLowerCase()}),$R=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(mF,function(r,s,i){return Ho={name:s,styles:i,next:Ho},s})}return fF[e]!==1&&!A_(e)&&typeof n=="number"&&n!==0?n+"px":n};function Ch(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return Ho={name:s.name,styles:s.styles,next:Ho},s.name;var i=n;if(i.styles!==void 0){var l=i.next;if(l!==void 0)for(;l!==void 0;)Ho={name:l.name,styles:l.styles,next:Ho},l=l.next;var u=i.styles+";";return u}return gF(t,e,n)}case"function":{if(t!==void 0){var p=Ho,f=n(t);return Ho=p,Ch(t,e,f)}break}}var m=n;if(e==null)return m;var g=e[m];return g!==void 0?g:m}function gF(t,e,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=Ch(t,e,n[s])+";";else for(var i in n){var l=n[i];if(typeof l!="object"){var u=l;e!=null&&e[u]!==void 0?r+=i+"{"+e[u]+"}":zR(u)&&(r+=zS(i)+":"+$R(i,u)+";")}else if(Array.isArray(l)&&typeof l[0]=="string"&&(e==null||e[l[0]]===void 0))for(var p=0;p<l.length;p++)zR(l[p])&&(r+=zS(i)+":"+$R(i,l[p])+";");else{var f=Ch(t,e,l);switch(i){case"animation":case"animationName":{r+=zS(i)+":"+f+";";break}default:r+=i+"{"+f+"}"}}}return r}var NR=/label:\s*([^\s;{]+)\s*(;|$)/g,Ho;function mm(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,s="";Ho=void 0;var i=t[0];if(i==null||i.raw===void 0)r=!1,s+=Ch(n,e,i);else{var l=i;s+=l[0]}for(var u=1;u<t.length;u++)if(s+=Ch(n,e,t[u]),r){var p=i;s+=p[u]}NR.lastIndex=0;for(var f="",m;(m=NR.exec(s))!==null;)f+="-"+m[1];var g=pF(s)+f;return{name:g,styles:s,next:Ho}}var yF=function(e){return e()},__=Xy.useInsertionEffect?Xy.useInsertionEffect:!1,I_=__||yF,FR=__||b.useLayoutEffect,P_=b.createContext(typeof HTMLElement<"u"?aF({key:"css"}):null);P_.Provider;var Ow=function(e){return b.forwardRef(function(n,r){var s=b.useContext(P_);return e(n,s,r)})},gm=b.createContext({}),Aw={}.hasOwnProperty,Y1="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",vF=function(e,n){var r={};for(var s in n)Aw.call(n,s)&&(r[s]=n[s]);return r[Y1]=e,r},xF=function(e){var n=e.cache,r=e.serialized,s=e.isStringTag;return kw(n,r,s),I_(function(){return Mw(n,r,s)}),null},bF=Ow(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var s=t[Y1],i=[r],l="";typeof t.className=="string"?l=O_(e.registered,i,t.className):t.className!=null&&(l=t.className+" ");var u=mm(i,void 0,b.useContext(gm));l+=e.key+"-"+u.name;var p={};for(var f in t)Aw.call(t,f)&&f!=="css"&&f!==Y1&&(p[f]=t[f]);return p.className=l,n&&(p.ref=n),b.createElement(b.Fragment,null,b.createElement(xF,{cache:e,serialized:u,isStringTag:typeof s=="string"}),b.createElement(s,p))}),SF=bF,BR=function(e,n){var r=arguments;if(n==null||!Aw.call(n,"css"))return b.createElement.apply(void 0,r);var s=r.length,i=new Array(s);i[0]=SF,i[1]=vF(e,n);for(var l=2;l<s;l++)i[l]=r[l];return b.createElement.apply(null,i)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(BR||(BR={}));var CF=Ow(function(t,e){var n=t.styles,r=mm([n],void 0,b.useContext(gm)),s=b.useRef();return FR(function(){var i=e.key+"-global",l=new e.sheet.constructor({key:i,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),u=!1,p=document.querySelector('style[data-emotion="'+i+" "+r.name+'"]');return e.sheet.tags.length&&(l.before=e.sheet.tags[0]),p!==null&&(u=!0,p.setAttribute("data-emotion",i),l.hydrate([p])),s.current=[l,u],function(){l.flush()}},[e]),FR(function(){var i=s.current,l=i[0],u=i[1];if(u){i[1]=!1;return}if(r.next!==void 0&&Mw(e,r.next,!0),l.tags.length){var p=l.tags[l.tags.length-1].nextElementSibling;l.before=p,l.flush()}e.insert("",r,l,!1)},[e,r.name]),null});function vp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return mm(e)}function dc(){var t=vp.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var wF=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,jF=k_(function(t){return wF.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),TF=jF,DF=function(e){return e!=="theme"},UR=function(e){return typeof e=="string"&&e.charCodeAt(0)>96?TF:DF},VR=function(e,n,r){var s;if(n){var i=n.shouldForwardProp;s=e.__emotion_forwardProp&&i?function(l){return e.__emotion_forwardProp(l)&&i(l)}:i}return typeof s!="function"&&r&&(s=e.__emotion_forwardProp),s},EF=function(e){var n=e.cache,r=e.serialized,s=e.isStringTag;return kw(n,r,s),I_(function(){return Mw(n,r,s)}),null},RF=function t(e,n){var r=e.__emotion_real===e,s=r&&e.__emotion_base||e,i,l;n!==void 0&&(i=n.label,l=n.target);var u=VR(e,n,r),p=u||UR(s),f=!p("as");return function(){var m=arguments,g=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(i!==void 0&&g.push("label:"+i+";"),m[0]==null||m[0].raw===void 0)g.push.apply(g,m);else{var y=m[0];g.push(y[0]);for(var v=m.length,C=1;C<v;C++)g.push(m[C],y[C])}var S=Ow(function(j,D,M){var T=f&&j.as||s,E="",k=[],A=j;if(j.theme==null){A={};for(var O in j)A[O]=j[O];A.theme=b.useContext(gm)}typeof j.className=="string"?E=O_(D.registered,k,j.className):j.className!=null&&(E=j.className+" ");var I=mm(g.concat(k),D.registered,A);E+=D.key+"-"+I.name,l!==void 0&&(E+=" "+l);var $=f&&u===void 0?UR(T):p,R={};for(var P in j)f&&P==="as"||$(P)&&(R[P]=j[P]);return R.className=E,M&&(R.ref=M),b.createElement(b.Fragment,null,b.createElement(EF,{cache:D,serialized:I,isStringTag:typeof T=="string"}),b.createElement(T,R))});return S.displayName=i!==void 0?i:"Styled("+(typeof s=="string"?s:s.displayName||s.name||"Component")+")",S.defaultProps=e.defaultProps,S.__emotion_real=S,S.__emotion_base=s,S.__emotion_styles=g,S.__emotion_forwardProp=u,Object.defineProperty(S,"toString",{value:function(){return"."+l}}),S.withComponent=function(j,D){var M=t(j,uv({},n,D,{shouldForwardProp:VR(S,D,!0)}));return M.apply(void 0,g)},S}},kF=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],X1=RF.bind(null);kF.forEach(function(t){X1[t]=X1(t)});function MF(t){return t==null||Object.keys(t).length===0}function L_(t){const{styles:e,defaultTheme:n={}}=t,r=typeof e=="function"?s=>e(MF(s)?n:s):e;return a.jsx(CF,{styles:r})}/**
|
|
73
|
+
* @mui/styled-engine v6.5.0
|
|
74
|
+
*
|
|
75
|
+
* @license MIT
|
|
76
|
+
* This source code is licensed under the MIT license found in the
|
|
77
|
+
* LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/function z_(t,e){return X1(t,e)}function OF(t,e){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}const HR=[];function Zl(t){return HR[0]=t,mm(HR)}var $S={exports:{}},Gn={};/**
|
|
79
|
+
* @license React
|
|
80
|
+
* react-is.production.js
|
|
81
|
+
*
|
|
82
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the MIT license found in the
|
|
85
|
+
* LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/var WR;function AF(){if(WR)return Gn;WR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function C(S){if(typeof S=="object"&&S!==null){var j=S.$$typeof;switch(j){case t:switch(S=S.type,S){case n:case s:case r:case p:case f:case y:return S;default:switch(S=S&&S.$$typeof,S){case l:case u:case g:case m:return S;case i:return S;default:return j}}case e:return j}}}return Gn.ContextConsumer=i,Gn.ContextProvider=l,Gn.Element=t,Gn.ForwardRef=u,Gn.Fragment=n,Gn.Lazy=g,Gn.Memo=m,Gn.Portal=e,Gn.Profiler=s,Gn.StrictMode=r,Gn.Suspense=p,Gn.SuspenseList=f,Gn.isContextConsumer=function(S){return C(S)===i},Gn.isContextProvider=function(S){return C(S)===l},Gn.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},Gn.isForwardRef=function(S){return C(S)===u},Gn.isFragment=function(S){return C(S)===n},Gn.isLazy=function(S){return C(S)===g},Gn.isMemo=function(S){return C(S)===m},Gn.isPortal=function(S){return C(S)===e},Gn.isProfiler=function(S){return C(S)===s},Gn.isStrictMode=function(S){return C(S)===r},Gn.isSuspense=function(S){return C(S)===p},Gn.isSuspenseList=function(S){return C(S)===f},Gn.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===n||S===s||S===r||S===p||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===g||S.$$typeof===m||S.$$typeof===l||S.$$typeof===i||S.$$typeof===u||S.$$typeof===v||S.getModuleId!==void 0)},Gn.typeOf=C,Gn}var qR;function _F(){return qR||(qR=1,$S.exports=AF()),$S.exports}var $_=_F();function Wo(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function N_(t){if(b.isValidElement(t)||$_.isValidElementType(t)||!Wo(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=N_(t[n])}),e}function ls(t,e,n={clone:!0}){const r=n.clone?{...t}:t;return Wo(t)&&Wo(e)&&Object.keys(e).forEach(s=>{b.isValidElement(e[s])||$_.isValidElementType(e[s])?r[s]=e[s]:Wo(e[s])&&Object.prototype.hasOwnProperty.call(t,s)&&Wo(t[s])?r[s]=ls(t[s],e[s],n):n.clone?r[s]=Wo(e[s])?N_(e[s]):e[s]:r[s]=e[s]}),r}const IF=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function PF(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...s}=t,i=IF(e),l=Object.keys(i);function u(y){return`@media (min-width:${typeof e[y]=="number"?e[y]:y}${n})`}function p(y){return`@media (max-width:${(typeof e[y]=="number"?e[y]:y)-r/100}${n})`}function f(y,v){const C=l.indexOf(v);return`@media (min-width:${typeof e[y]=="number"?e[y]:y}${n}) and (max-width:${(C!==-1&&typeof e[l[C]]=="number"?e[l[C]]:v)-r/100}${n})`}function m(y){return l.indexOf(y)+1<l.length?f(y,l[l.indexOf(y)+1]):u(y)}function g(y){const v=l.indexOf(y);return v===0?u(l[1]):v===l.length-1?p(l[v]):f(y,l[l.indexOf(y)+1]).replace("@media","@media not all and")}return{keys:l,values:i,up:u,down:p,between:f,only:m,not:g,unit:n,...s}}function GR(t,e){if(!t.containerQueries)return e;const n=Object.keys(e).filter(r=>r.startsWith("@container")).sort((r,s)=>{var l,u;const i=/min-width:\s*([0-9.]+)/;return+(((l=r.match(i))==null?void 0:l[1])||0)-+(((u=s.match(i))==null?void 0:u[1])||0)});return n.length?n.reduce((r,s)=>{const i=e[s];return delete r[s],r[s]=i,r},{...e}):e}function LF(t,e){return e==="@"||e.startsWith("@")&&(t.some(n=>e.startsWith(`@${n}`))||!!e.match(/^@\d/))}function zF(t,e){const n=e.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,s]=n,i=Number.isNaN(+r)?r||0:+r;return t.containerQueries(s).up(i)}function $F(t){const e=(i,l)=>i.replace("@media",l?`@container ${l}`:"@container");function n(i,l){i.up=(...u)=>e(t.breakpoints.up(...u),l),i.down=(...u)=>e(t.breakpoints.down(...u),l),i.between=(...u)=>e(t.breakpoints.between(...u),l),i.only=(...u)=>e(t.breakpoints.only(...u),l),i.not=(...u)=>{const p=e(t.breakpoints.not(...u),l);return p.includes("not all and")?p.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):p}}const r={},s=i=>(n(r,i),r);return n(s),{...t,containerQueries:s}}const NF={borderRadius:4};function nh(t,e){return e?ls(t,e,{clone:!1}):t}const ux={xs:0,sm:600,md:900,lg:1200,xl:1536},ZR={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${ux[t]}px)`},FF={containerQueries:t=>({up:e=>{let n=typeof e=="number"?e:ux[e]||e;return typeof n=="number"&&(n=`${n}px`),t?`@container ${t} (min-width:${n})`:`@container (min-width:${n})`}})};function ti(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const i=r.breakpoints||ZR;return e.reduce((l,u,p)=>(l[i.up(i.keys[p])]=n(e[p]),l),{})}if(typeof e=="object"){const i=r.breakpoints||ZR;return Object.keys(e).reduce((l,u)=>{if(LF(i.keys,u)){const p=zF(r.containerQueries?r:FF,u);p&&(l[p]=n(e[u],u))}else if(Object.keys(i.values||ux).includes(u)){const p=i.up(u);l[p]=n(e[u],u)}else{const p=u;l[p]=e[p]}return l},{})}return n(e)}function F_(t={}){var n;return((n=t.keys)==null?void 0:n.reduce((r,s)=>{const i=t.up(s);return r[i]={},r},{}))||{}}function eC(t,e){return t.reduce((n,r)=>{const s=n[r];return(!s||Object.keys(s).length===0)&&delete n[r],n},e)}function BF(t,...e){const n=F_(t),r=[n,...e].reduce((s,i)=>ls(s,i),{});return eC(Object.keys(n),r)}function UF(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((s,i)=>{i<t.length&&(n[s]=!0)}):r.forEach(s=>{t[s]!=null&&(n[s]=!0)}),n}function au({values:t,breakpoints:e,base:n}){const r=n||UF(t,e),s=Object.keys(r);if(s.length===0)return t;let i;return s.reduce((l,u,p)=>(Array.isArray(t)?(l[u]=t[p]!=null?t[p]:t[i],i=p):typeof t=="object"?(l[u]=t[u]!=null?t[u]:t[i],i=u):l[u]=t,l),{})}function ue(t){if(typeof t!="string")throw new Error(Wa(7));return t.charAt(0).toUpperCase()+t.slice(1)}function Vl(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((s,i)=>s&&s[i]?s[i]:null,t);if(r!=null)return r}return e.split(".").reduce((r,s)=>r&&r[s]!=null?r[s]:null,t)}function pv(t,e,n,r=n){let s;return typeof t=="function"?s=t(n):Array.isArray(t)?s=t[n]||r:s=Vl(t,n)||r,e&&(s=e(s,r,t)),s}function Pr(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:s}=t,i=l=>{if(l[e]==null)return null;const u=l[e],p=l.theme,f=Vl(p,r)||{};return ti(l,u,g=>{let y=pv(f,s,g);return g===y&&typeof g=="string"&&(y=pv(f,s,`${e}${g==="default"?"":ue(g)}`,g)),n===!1?y:{[n]:y}})};return i.propTypes={},i.filterProps=[e],i}function VF(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const HF={m:"margin",p:"padding"},WF={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},KR={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},qF=VF(t=>{if(t.length>2)if(KR[t])t=KR[t];else return[t];const[e,n]=t.split(""),r=HF[e],s=WF[n]||"";return Array.isArray(s)?s.map(i=>r+i):[r+s]}),_w=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Iw=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[..._w,...Iw];function ym(t,e,n,r){const s=Vl(t,e,!0)??n;return typeof s=="number"||typeof s=="string"?i=>typeof i=="string"?i:typeof s=="string"?`calc(${i} * ${s})`:s*i:Array.isArray(s)?i=>{if(typeof i=="string")return i;const l=Math.abs(i),u=s[l];return i>=0?u:typeof u=="number"?-u:`-${u}`}:typeof s=="function"?s:()=>{}}function dx(t){return ym(t,"spacing",8)}function gu(t,e){return typeof e=="string"||e==null?e:t(e)}function GF(t,e){return n=>t.reduce((r,s)=>(r[s]=gu(e,n),r),{})}function ZF(t,e,n,r){if(!e.includes(n))return null;const s=qF(n),i=GF(s,r),l=t[n];return ti(t,l,i)}function B_(t,e){const n=dx(t.theme);return Object.keys(t).map(r=>ZF(t,e,r,n)).reduce(nh,{})}function Sr(t){return B_(t,_w)}Sr.propTypes={};Sr.filterProps=_w;function Cr(t){return B_(t,Iw)}Cr.propTypes={};Cr.filterProps=Iw;function U_(t=8,e=dx({spacing:t})){if(t.mui)return t;const n=(...r)=>(r.length===0?[1]:r).map(i=>{const l=e(i);return typeof l=="number"?`${l}px`:l}).join(" ");return n.mui=!0,n}function px(...t){const e=t.reduce((r,s)=>(s.filterProps.forEach(i=>{r[i]=s}),r),{}),n=r=>Object.keys(r).reduce((s,i)=>e[i]?nh(s,e[i](r)):s,{});return n.propTypes={},n.filterProps=t.reduce((r,s)=>r.concat(s.filterProps),[]),n}function Gi(t){return typeof t!="number"?t:`${t}px solid`}function ro(t,e){return Pr({prop:t,themeKey:"borders",transform:e})}const KF=ro("border",Gi),QF=ro("borderTop",Gi),JF=ro("borderRight",Gi),YF=ro("borderBottom",Gi),XF=ro("borderLeft",Gi),eB=ro("borderColor"),tB=ro("borderTopColor"),nB=ro("borderRightColor"),rB=ro("borderBottomColor"),sB=ro("borderLeftColor"),iB=ro("outline",Gi),oB=ro("outlineColor"),fx=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=ym(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:gu(e,r)});return ti(t,t.borderRadius,n)}return null};fx.propTypes={};fx.filterProps=["borderRadius"];px(KF,QF,JF,YF,XF,eB,tB,nB,rB,sB,fx,iB,oB);const hx=t=>{if(t.gap!==void 0&&t.gap!==null){const e=ym(t.theme,"spacing",8),n=r=>({gap:gu(e,r)});return ti(t,t.gap,n)}return null};hx.propTypes={};hx.filterProps=["gap"];const mx=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=ym(t.theme,"spacing",8),n=r=>({columnGap:gu(e,r)});return ti(t,t.columnGap,n)}return null};mx.propTypes={};mx.filterProps=["columnGap"];const gx=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=ym(t.theme,"spacing",8),n=r=>({rowGap:gu(e,r)});return ti(t,t.rowGap,n)}return null};gx.propTypes={};gx.filterProps=["rowGap"];const aB=Pr({prop:"gridColumn"}),lB=Pr({prop:"gridRow"}),cB=Pr({prop:"gridAutoFlow"}),uB=Pr({prop:"gridAutoColumns"}),dB=Pr({prop:"gridAutoRows"}),pB=Pr({prop:"gridTemplateColumns"}),fB=Pr({prop:"gridTemplateRows"}),hB=Pr({prop:"gridTemplateAreas"}),mB=Pr({prop:"gridArea"});px(hx,mx,gx,aB,lB,cB,uB,dB,pB,fB,hB,mB);function _d(t,e){return e==="grey"?e:t}const gB=Pr({prop:"color",themeKey:"palette",transform:_d}),yB=Pr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:_d}),vB=Pr({prop:"backgroundColor",themeKey:"palette",transform:_d});px(gB,yB,vB);function yi(t){return t<=1&&t!==0?`${t*100}%`:t}const xB=Pr({prop:"width",transform:yi}),Pw=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var s,i,l,u,p;const r=((l=(i=(s=t.theme)==null?void 0:s.breakpoints)==null?void 0:i.values)==null?void 0:l[n])||ux[n];return r?((p=(u=t.theme)==null?void 0:u.breakpoints)==null?void 0:p.unit)!=="px"?{maxWidth:`${r}${t.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:yi(n)}};return ti(t,t.maxWidth,e)}return null};Pw.filterProps=["maxWidth"];const bB=Pr({prop:"minWidth",transform:yi}),SB=Pr({prop:"height",transform:yi}),CB=Pr({prop:"maxHeight",transform:yi}),wB=Pr({prop:"minHeight",transform:yi});Pr({prop:"size",cssProperty:"width",transform:yi});Pr({prop:"size",cssProperty:"height",transform:yi});const jB=Pr({prop:"boxSizing"});px(xB,Pw,bB,SB,CB,wB,jB);const vm={border:{themeKey:"borders",transform:Gi},borderTop:{themeKey:"borders",transform:Gi},borderRight:{themeKey:"borders",transform:Gi},borderBottom:{themeKey:"borders",transform:Gi},borderLeft:{themeKey:"borders",transform:Gi},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Gi},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:fx},color:{themeKey:"palette",transform:_d},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:_d},backgroundColor:{themeKey:"palette",transform:_d},p:{style:Cr},pt:{style:Cr},pr:{style:Cr},pb:{style:Cr},pl:{style:Cr},px:{style:Cr},py:{style:Cr},padding:{style:Cr},paddingTop:{style:Cr},paddingRight:{style:Cr},paddingBottom:{style:Cr},paddingLeft:{style:Cr},paddingX:{style:Cr},paddingY:{style:Cr},paddingInline:{style:Cr},paddingInlineStart:{style:Cr},paddingInlineEnd:{style:Cr},paddingBlock:{style:Cr},paddingBlockStart:{style:Cr},paddingBlockEnd:{style:Cr},m:{style:Sr},mt:{style:Sr},mr:{style:Sr},mb:{style:Sr},ml:{style:Sr},mx:{style:Sr},my:{style:Sr},margin:{style:Sr},marginTop:{style:Sr},marginRight:{style:Sr},marginBottom:{style:Sr},marginLeft:{style:Sr},marginX:{style:Sr},marginY:{style:Sr},marginInline:{style:Sr},marginInlineStart:{style:Sr},marginInlineEnd:{style:Sr},marginBlock:{style:Sr},marginBlockStart:{style:Sr},marginBlockEnd:{style:Sr},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:hx},rowGap:{style:gx},columnGap:{style:mx},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:yi},maxWidth:{style:Pw},minWidth:{transform:yi},height:{transform:yi},maxHeight:{transform:yi},minHeight:{transform:yi},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function TB(...t){const e=t.reduce((r,s)=>r.concat(Object.keys(s)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function DB(t,e){return typeof t=="function"?t(e):t}function EB(){function t(n,r,s,i){const l={[n]:r,theme:s},u=i[n];if(!u)return{[n]:r};const{cssProperty:p=n,themeKey:f,transform:m,style:g}=u;if(r==null)return null;if(f==="typography"&&r==="inherit")return{[n]:r};const y=Vl(s,f)||{};return g?g(l):ti(l,r,C=>{let S=pv(y,m,C);return C===S&&typeof C=="string"&&(S=pv(y,m,`${n}${C==="default"?"":ue(C)}`,C)),p===!1?S:{[p]:S}})}function e(n){const{sx:r,theme:s={},nested:i}=n||{};if(!r)return null;const l=s.unstable_sxConfig??vm;function u(p){let f=p;if(typeof p=="function")f=p(s);else if(typeof p!="object")return p;if(!f)return null;const m=F_(s.breakpoints),g=Object.keys(m);let y=m;return Object.keys(f).forEach(v=>{const C=DB(f[v],s);if(C!=null)if(typeof C=="object")if(l[v])y=nh(y,t(v,C,s,l));else{const S=ti({theme:s},C,j=>({[v]:j}));TB(S,C)?y[v]=e({sx:C,theme:s,nested:!0}):y=nh(y,S)}else y=nh(y,t(v,C,s,l))}),!i&&s.modularCssLayers?{"@layer sx":GR(s,eC(g,y))}:GR(s,eC(g,y))}return Array.isArray(r)?r.map(u):u(r)}return e}const ec=EB();ec.filterProps=["sx"];function RB(t,e){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[t])||typeof n.getColorSchemeSelector!="function")return{};let s=n.getColorSchemeSelector(t);return s==="&"?e:((s.includes("data-")||s.includes("."))&&(s=`*:where(${s.replace(/\s*&$/,"")}) &`),{[s]:e})}return n.palette.mode===t?e:{}}function xp(t={},...e){const{breakpoints:n={},palette:r={},spacing:s,shape:i={},...l}=t,u=PF(n),p=U_(s);let f=ls({breakpoints:u,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:p,shape:{...NF,...i}},l);return f=$F(f),f.applyStyles=RB,f=e.reduce((m,g)=>ls(m,g),f),f.unstable_sxConfig={...vm,...l==null?void 0:l.unstable_sxConfig},f.unstable_sx=function(g){return ec({sx:g,theme:this})},f}function kB(t){return Object.keys(t).length===0}function yx(t=null){const e=b.useContext(gm);return!e||kB(e)?t:e}const MB=xp();function xm(t=MB){return yx(t)}function NS(t){const e=Zl(t);return t!==e&&e.styles?(e.styles.match(/^@layer\s+[^{]*$/)||(e.styles=`@layer global{${e.styles}}`),e):t}function V_({styles:t,themeId:e,defaultTheme:n={}}){const r=xm(n),s=e&&r[e]||r;let i=typeof t=="function"?t(s):t;return s.modularCssLayers&&(Array.isArray(i)?i=i.map(l=>NS(typeof l=="function"?l(s):l)):i=NS(i)),a.jsx(L_,{styles:i})}const OB=t=>{var r;const e={systemProps:{},otherProps:{}},n=((r=t==null?void 0:t.theme)==null?void 0:r.unstable_sxConfig)??vm;return Object.keys(t).forEach(s=>{n[s]?e.systemProps[s]=t[s]:e.otherProps[s]=t[s]}),e};function bm(t){const{sx:e,...n}=t,{systemProps:r,otherProps:s}=OB(n);let i;return Array.isArray(e)?i=[r,...e]:typeof e=="function"?i=(...l)=>{const u=e(...l);return Wo(u)?{...r,...u}:r}:i={...r,...e},{...s,sx:i}}const QR=t=>t,AB=()=>{let t=QR;return{configure(e){t=e},generate(e){return t(e)},reset(){t=QR}}},H_=AB();function W_(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=W_(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Ce(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=W_(t))&&(r&&(r+=" "),r+=e);return r}function _B(t={}){const{themeId:e,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:s}=t,i=z_("div",{shouldForwardProp:u=>u!=="theme"&&u!=="sx"&&u!=="as"})(ec);return b.forwardRef(function(p,f){const m=xm(n),{className:g,component:y="div",...v}=bm(p);return a.jsx(i,{as:y,ref:f,className:Ce(g,s?s(r):r),theme:e&&m[e]||m,...v})})}const IB={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ze(t,e,n="Mui"){const r=IB[e];return r?`${n}-${r}`:`${H_.generate(t)}-${e}`}function et(t,e,n="Mui"){const r={};return e.forEach(s=>{r[s]=Ze(t,s,n)}),r}function q_(t){const{variants:e,...n}=t,r={variants:e,style:Zl(n),isProcessed:!0};return r.style===n||e&&e.forEach(s=>{typeof s.style!="function"&&(s.style=Zl(s.style))}),r}const PB=xp();function FS(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}function qc(t,e){return e&&t&&typeof t=="object"&&t.styles&&!t.styles.startsWith("@layer")&&(t.styles=`@layer ${e}{${String(t.styles)}}`),t}function LB(t){return t?(e,n)=>n[t]:null}function zB(t,e,n){t.theme=NB(t.theme)?n:t.theme[e]||t.theme}function Zy(t,e,n){const r=typeof e=="function"?e(t):e;if(Array.isArray(r))return r.flatMap(s=>Zy(t,s,n));if(Array.isArray(r==null?void 0:r.variants)){let s;if(r.isProcessed)s=n?qc(r.style,n):r.style;else{const{variants:i,...l}=r;s=n?qc(Zl(l),n):l}return G_(t,r.variants,[s],n)}return r!=null&&r.isProcessed?n?qc(Zl(r.style),n):r.style:n?qc(Zl(r),n):r}function G_(t,e,n=[],r=void 0){var i;let s;e:for(let l=0;l<e.length;l+=1){const u=e[l];if(typeof u.props=="function"){if(s??(s={...t,...t.ownerState,ownerState:t.ownerState}),!u.props(s))continue}else for(const p in u.props)if(t[p]!==u.props[p]&&((i=t.ownerState)==null?void 0:i[p])!==u.props[p])continue e;typeof u.style=="function"?(s??(s={...t,...t.ownerState,ownerState:t.ownerState}),n.push(r?qc(Zl(u.style(s)),r):u.style(s))):n.push(r?qc(Zl(u.style),r):u.style)}return n}function Z_(t={}){const{themeId:e,defaultTheme:n=PB,rootShouldForwardProp:r=FS,slotShouldForwardProp:s=FS}=t;function i(u){zB(u,e,n)}return(u,p={})=>{OF(u,A=>A.filter(O=>O!==ec));const{name:f,slot:m,skipVariantsResolver:g,skipSx:y,overridesResolver:v=LB(BB(m)),...C}=p,S=f&&f.startsWith("Mui")||m?"components":"custom",j=g!==void 0?g:m&&m!=="Root"&&m!=="root"||!1,D=y||!1;let M=FS;m==="Root"||m==="root"?M=r:m?M=s:FB(u)&&(M=void 0);const T=z_(u,{shouldForwardProp:M,label:$B(),...C}),E=A=>{if(A.__emotion_real===A)return A;if(typeof A=="function")return function(I){return Zy(I,A,I.theme.modularCssLayers?S:void 0)};if(Wo(A)){const O=q_(A);return function($){return O.variants?Zy($,O,$.theme.modularCssLayers?S:void 0):$.theme.modularCssLayers?qc(O.style,S):O.style}}return A},k=(...A)=>{const O=[],I=A.map(E),$=[];if(O.push(i),f&&v&&$.push(function(N){var W,K;const U=(K=(W=N.theme.components)==null?void 0:W[f])==null?void 0:K.styleOverrides;if(!U)return null;const L={};for(const Q in U)L[Q]=Zy(N,U[Q],N.theme.modularCssLayers?"theme":void 0);return v(N,L)}),f&&!j&&$.push(function(N){var L,W;const H=N.theme,U=(W=(L=H==null?void 0:H.components)==null?void 0:L[f])==null?void 0:W.variants;return U?G_(N,U,[],N.theme.modularCssLayers?"theme":void 0):null}),D||$.push(ec),Array.isArray(I[0])){const z=I.shift(),N=new Array(O.length).fill(""),H=new Array($.length).fill("");let U;U=[...N,...z,...H],U.raw=[...N,...z.raw,...H],O.unshift(U)}const R=[...O,...I,...$],P=T(...R);return u.muiName&&(P.muiName=u.muiName),P};return T.withConfig&&(k.withConfig=T.withConfig),k}}function $B(t,e){return void 0}function NB(t){for(const e in t)return!1;return!0}function FB(t){return typeof t=="string"&&t.charCodeAt(0)>96}function BB(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}const Lw=Z_();function ep(t,e){const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const s=r;if(s==="components"||s==="slots")n[s]={...t[s],...n[s]};else if(s==="componentsProps"||s==="slotProps"){const i=t[s],l=e[s];if(!l)n[s]=i||{};else if(!i)n[s]=l;else{n[s]={...l};for(const u in i)if(Object.prototype.hasOwnProperty.call(i,u)){const p=u;n[s][p]=ep(i[p],l[p])}}}else n[s]===void 0&&(n[s]=t[s])}return n}function K_(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:ep(e.components[n].defaultProps,r)}function zw({props:t,name:e,defaultTheme:n,themeId:r}){let s=xm(n);return r&&(s=s[r]||s),K_({theme:s,name:e,props:t})}const Cs=typeof window<"u"?b.useLayoutEffect:b.useEffect;function UB(t,e,n,r,s){const[i,l]=b.useState(()=>s&&n?n(t).matches:r?r(t).matches:e);return Cs(()=>{if(!n)return;const u=n(t),p=()=>{l(u.matches)};return p(),u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[t,n]),i}const VB={...Xy},Q_=VB.useSyncExternalStore;function HB(t,e,n,r,s){const i=b.useCallback(()=>e,[e]),l=b.useMemo(()=>{if(s&&n)return()=>n(t).matches;if(r!==null){const{matches:m}=r(t);return()=>m}return i},[i,t,r,s,n]),[u,p]=b.useMemo(()=>{if(n===null)return[i,()=>()=>{}];const m=n(t);return[()=>m.matches,g=>(m.addEventListener("change",g),()=>{m.removeEventListener("change",g)})]},[i,n,t]);return Q_(p,u,l)}function J_(t={}){const{themeId:e}=t;return function(r,s={}){let i=yx();i&&e&&(i=i[e]||i);const l=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:u=!1,matchMedia:p=l?window.matchMedia:null,ssrMatchMedia:f=null,noSsr:m=!1}=K_({name:"MuiUseMediaQuery",props:s,theme:i});let g=typeof r=="function"?r(i):r;return g=g.replace(/^@media( ?)/m,""),g.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
|
|
87
|
+
`)),(Q_!==void 0?HB:UB)(g,u,p,f,m)}}J_();function yd(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}function $w(t,e=0,n=1){return yd(t,e,n)}function WB(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,s)=>s<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function tc(t){if(t.type)return t;if(t.charAt(0)==="#")return tc(WB(t));const e=t.indexOf("("),n=t.substring(0,e);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(Wa(9,t));let r=t.substring(e+1,t.length-1),s;if(n==="color"){if(r=r.split(" "),s=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(s))throw new Error(Wa(10,s))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:s}}const qB=t=>{const e=tc(t);return e.values.slice(0,3).map((n,r)=>e.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},Vf=(t,e)=>{try{return qB(t)}catch{return t}};function vx(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.includes("rgb")?r=r.map((s,i)=>i<3?parseInt(s,10):s):e.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Y_(t){t=tc(t);const{values:e}=t,n=e[0],r=e[1]/100,s=e[2]/100,i=r*Math.min(s,1-s),l=(f,m=(f+n/30)%12)=>s-i*Math.max(Math.min(m-3,9-m,1),-1);let u="rgb";const p=[Math.round(l(0)*255),Math.round(l(8)*255),Math.round(l(4)*255)];return t.type==="hsla"&&(u+="a",p.push(e[3])),vx({type:u,values:p})}function tC(t){t=tc(t);let e=t.type==="hsl"||t.type==="hsla"?tc(Y_(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function GB(t,e){const n=tC(t),r=tC(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function wt(t,e){return t=tc(t),e=$w(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,vx(t)}function uy(t,e,n){try{return wt(t,e)}catch{return t}}function Jo(t,e){if(t=tc(t),e=$w(e),t.type.includes("hsl"))t.values[2]*=1-e;else if(t.type.includes("rgb")||t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]*=1-e;return vx(t)}function Xn(t,e,n){try{return Jo(t,e)}catch{return t}}function Yo(t,e){if(t=tc(t),e=$w(e),t.type.includes("hsl"))t.values[2]+=(100-t.values[2])*e;else if(t.type.includes("rgb"))for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return vx(t)}function er(t,e,n){try{return Yo(t,e)}catch{return t}}function fv(t,e=.15){return tC(t)>.5?Jo(t,e):Yo(t,e)}function dy(t,e,n){try{return fv(t,e)}catch{return t}}function nC(...t){return t.reduce((e,n)=>n==null?e:function(...s){e.apply(this,s),n.apply(this,s)},()=>{})}function Sm(t,e=166){let n;function r(...s){const i=()=>{t.apply(this,s)};clearTimeout(n),n=setTimeout(i,e)}return r.clear=()=>{clearTimeout(n)},r}function rh(t,e){var n,r,s;return b.isValidElement(t)&&e.indexOf(t.type.muiName??((s=(r=(n=t.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:s.muiName))!==-1}function Ir(t){return t&&t.ownerDocument||document}function Ci(t){return Ir(t).defaultView||window}function rC(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let JR=0;function ZB(t){const[e,n]=b.useState(t),r=t||e;return b.useEffect(()=>{e==null&&(JR+=1,n(`mui-${JR}`))},[e]),r}const KB={...Xy},YR=KB.useId;function pc(t){if(YR!==void 0){const e=YR();return t??e}return ZB(t)}function Ba({controlled:t,default:e,name:n,state:r="value"}){const{current:s}=b.useRef(t!==void 0),[i,l]=b.useState(e),u=s?t:i,p=b.useCallback(f=>{s||l(f)},[]);return[u,p]}function Dr(t){const e=b.useRef(t);return Cs(()=>{e.current=t}),b.useRef((...n)=>(0,e.current)(...n)).current}function cr(...t){const e=b.useRef(void 0),n=b.useCallback(r=>{const s=t.map(i=>{if(i==null)return null;if(typeof i=="function"){const l=i,u=l(r);return typeof u=="function"?u:()=>{l(null)}}return i.current=r,()=>{i.current=null}});return()=>{s.forEach(i=>i==null?void 0:i())}},t);return b.useMemo(()=>t.every(r=>r==null)?null:r=>{e.current&&(e.current(),e.current=void 0),r!=null&&(e.current=n(r))},t)}const XR={};function X_(t,e){const n=b.useRef(XR);return n.current===XR&&(n.current=t(e)),n}const QB=[];function JB(t){b.useEffect(t,QB)}class xx{constructor(){St(this,"currentId",null);St(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});St(this,"disposeEffect",()=>this.clear)}static create(){return new xx}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function Hl(){const t=X_(xx.create).current;return JB(t.disposeEffect),t}function nc(t){try{return t.matches(":focus-visible")}catch{}return!1}function eI(t=window){const e=t.document.documentElement.clientWidth;return t.innerWidth-e}const Nw=t=>{const e=b.useRef({});return b.useEffect(()=>{e.current=t}),e.current};function YB(t){return b.Children.toArray(t).filter(e=>b.isValidElement(e))}const XB={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function Ke(t,e,n=void 0){const r={};for(const s in t){const i=t[s];let l="",u=!0;for(let p=0;p<i.length;p+=1){const f=i[p];f&&(l+=(u===!0?"":" ")+e(f),u=!1,n&&n[f]&&(l+=" "+n[f]))}r[s]=l}return r}function eU(t){return typeof t=="string"}function tI(t,e,n){return t===void 0||eU(t)?e:{...e,ownerState:{...e.ownerState,...n}}}function lu(t,e=[]){if(t===void 0)return{};const n={};return Object.keys(t).filter(r=>r.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function ek(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function nI(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:s,className:i}=t;if(!e){const v=Ce(n==null?void 0:n.className,i,s==null?void 0:s.className,r==null?void 0:r.className),C={...n==null?void 0:n.style,...s==null?void 0:s.style,...r==null?void 0:r.style},S={...n,...s,...r};return v.length>0&&(S.className=v),Object.keys(C).length>0&&(S.style=C),{props:S,internalRef:void 0}}const l=lu({...s,...r}),u=ek(r),p=ek(s),f=e(l),m=Ce(f==null?void 0:f.className,n==null?void 0:n.className,i,s==null?void 0:s.className,r==null?void 0:r.className),g={...f==null?void 0:f.style,...n==null?void 0:n.style,...s==null?void 0:s.style,...r==null?void 0:r.style},y={...f,...n,...p,...u};return m.length>0&&(y.className=m),Object.keys(g).length>0&&(y.style=g),{props:y,internalRef:f.ref}}function rI(t,e,n){return typeof t=="function"?t(e,n):t}function Ms(t){var g;const{elementType:e,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:s=!1,...i}=t,l=s?{}:rI(n,r),{props:u,internalRef:p}=nI({...i,externalSlotProps:l}),f=cr(p,l==null?void 0:l.ref,(g=t.additionalProps)==null?void 0:g.ref);return tI(e,{...u,ref:f},r)}function fc(t){var e;return parseInt(b.version,10)>=19?((e=t==null?void 0:t.props)==null?void 0:e.ref)||null:(t==null?void 0:t.ref)||null}const sI=b.createContext(null);function Fw(){return b.useContext(sI)}const tU=typeof Symbol=="function"&&Symbol.for,nU=tU?Symbol.for("mui.nested"):"__THEME_NESTED__";function rU(t,e){return typeof e=="function"?e(t):{...t,...e}}function sU(t){const{children:e,theme:n}=t,r=Fw(),s=b.useMemo(()=>{const i=r===null?{...n}:rU(r,n);return i!=null&&(i[nU]=r!==null),i},[n,r]);return a.jsx(sI.Provider,{value:s,children:e})}const iI=b.createContext();function iU({value:t,...e}){return a.jsx(iI.Provider,{value:t??!0,...e})}const hc=()=>b.useContext(iI)??!1,oI=b.createContext(void 0);function oU({value:t,children:e}){return a.jsx(oI.Provider,{value:t,children:e})}function aU(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n])return r;const s=e.components[n];return s.defaultProps?ep(s.defaultProps,r):!s.styleOverrides&&!s.variants?ep(s,r):r}function lU({props:t,name:e}){const n=b.useContext(oI);return aU({props:t,name:e,theme:{components:n}})}function cU(t){const e=yx(),n=pc()||"",{modularCssLayers:r}=t;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!r||e!==null?s="":typeof r=="string"?s=r.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Cs(()=>{var u,p;const i=document.querySelector("head");if(!i)return;const l=i.firstChild;if(s){if(l&&((u=l.hasAttribute)!=null&&u.call(l,"data-mui-layer-order"))&&l.getAttribute("data-mui-layer-order")===n)return;const f=document.createElement("style");f.setAttribute("data-mui-layer-order",n),f.textContent=s,i.prepend(f)}else(p=i.querySelector(`style[data-mui-layer-order="${n}"]`))==null||p.remove()},[s,n]),s?a.jsx(V_,{styles:s}):null}const tk={};function nk(t,e,n,r=!1){return b.useMemo(()=>{const s=t&&e[t]||e;if(typeof n=="function"){const i=n(s),l=t?{...e,[t]:i}:i;return r?()=>l:l}return t?{...e,[t]:n}:{...e,...n}},[t,e,n,r])}function aI(t){const{children:e,theme:n,themeId:r}=t,s=yx(tk),i=Fw()||tk,l=nk(r,s,n),u=nk(r,i,n,!0),p=(r?l[r]:l).direction==="rtl",f=cU(l);return a.jsx(sU,{theme:u,children:a.jsx(gm.Provider,{value:l,children:a.jsx(iU,{value:p,children:a.jsxs(oU,{value:r?l[r].components:l.components,children:[f,e]})})})})}const rk={theme:void 0};function uU(t){let e,n;return function(s){let i=e;return(i===void 0||s.theme!==n)&&(rk.theme=s.theme,i=q_(t(rk)),e=i,n=s.theme),i}}const Bw="mode",Uw="color-scheme",dU="data-color-scheme";function pU(t){const{defaultMode:e="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:s=Bw,colorSchemeStorageKey:i=Uw,attribute:l=dU,colorSchemeNode:u="document.documentElement",nonce:p}=t||{};let f="",m=l;if(l==="class"&&(m=".%s"),l==="data"&&(m="[data-%s]"),m.startsWith(".")){const y=m.substring(1);f+=`${u}.classList.remove('${y}'.replace('%s', light), '${y}'.replace('%s', dark));
|
|
88
|
+
${u}.classList.add('${y}'.replace('%s', colorScheme));`}const g=m.match(/\[([^\]]+)\]/);if(g){const[y,v]=g[1].split("=");v||(f+=`${u}.removeAttribute('${y}'.replace('%s', light));
|
|
89
|
+
${u}.removeAttribute('${y}'.replace('%s', dark));`),f+=`
|
|
90
|
+
${u}.setAttribute('${y}'.replace('%s', colorScheme), ${v?`${v}.replace('%s', colorScheme)`:'""'});`}else f+=`${u}.setAttribute('${m}', colorScheme);`;return a.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(function() {
|
|
91
|
+
try {
|
|
92
|
+
let colorScheme = '';
|
|
93
|
+
const mode = localStorage.getItem('${s}') || '${e}';
|
|
94
|
+
const dark = localStorage.getItem('${i}-dark') || '${r}';
|
|
95
|
+
const light = localStorage.getItem('${i}-light') || '${n}';
|
|
96
|
+
if (mode === 'system') {
|
|
97
|
+
// handle system mode
|
|
98
|
+
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
99
|
+
if (mql.matches) {
|
|
100
|
+
colorScheme = dark
|
|
101
|
+
} else {
|
|
102
|
+
colorScheme = light
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (mode === 'light') {
|
|
106
|
+
colorScheme = light;
|
|
107
|
+
}
|
|
108
|
+
if (mode === 'dark') {
|
|
109
|
+
colorScheme = dark;
|
|
110
|
+
}
|
|
111
|
+
if (colorScheme) {
|
|
112
|
+
${f}
|
|
113
|
+
}
|
|
114
|
+
} catch(e){}})();`}},"mui-color-scheme-init")}function fU(){}const hU=({key:t,storageWindow:e})=>(!e&&typeof window<"u"&&(e=window),{get(n){if(typeof window>"u")return;if(!e)return n;let r;try{r=e.localStorage.getItem(t)}catch{}return r||n},set:n=>{if(e)try{e.localStorage.setItem(t,n)}catch{}},subscribe:n=>{if(!e)return fU;const r=s=>{const i=s.newValue;s.key===t&&n(i)};return e.addEventListener("storage",r),()=>{e.removeEventListener("storage",r)}}});function BS(){}function sk(t){if(typeof window<"u"&&typeof window.matchMedia=="function"&&t==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function lI(t,e){if(t.mode==="light"||t.mode==="system"&&t.systemMode==="light")return e("light");if(t.mode==="dark"||t.mode==="system"&&t.systemMode==="dark")return e("dark")}function mU(t){return lI(t,e=>{if(e==="light")return t.lightColorScheme;if(e==="dark")return t.darkColorScheme})}function gU(t){const{defaultMode:e="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:s=[],modeStorageKey:i=Bw,colorSchemeStorageKey:l=Uw,storageWindow:u=typeof window>"u"?void 0:window,storageManager:p=hU,noSsr:f=!1}=t,m=s.join(","),g=s.length>1,y=b.useMemo(()=>p==null?void 0:p({key:i,storageWindow:u}),[p,i,u]),v=b.useMemo(()=>p==null?void 0:p({key:`${l}-light`,storageWindow:u}),[p,l,u]),C=b.useMemo(()=>p==null?void 0:p({key:`${l}-dark`,storageWindow:u}),[p,l,u]),[S,j]=b.useState(()=>{const I=(y==null?void 0:y.get(e))||e,$=(v==null?void 0:v.get(n))||n,R=(C==null?void 0:C.get(r))||r;return{mode:I,systemMode:sk(I),lightColorScheme:$,darkColorScheme:R}}),[D,M]=b.useState(f||!g);b.useEffect(()=>{M(!0)},[]);const T=mU(S),E=b.useCallback(I=>{j($=>{if(I===$.mode)return $;const R=I??e;return y==null||y.set(R),{...$,mode:R,systemMode:sk(R)}})},[y,e]),k=b.useCallback(I=>{I?typeof I=="string"?I&&!m.includes(I)?console.error(`\`${I}\` does not exist in \`theme.colorSchemes\`.`):j($=>{const R={...$};return lI($,P=>{P==="light"&&(v==null||v.set(I),R.lightColorScheme=I),P==="dark"&&(C==null||C.set(I),R.darkColorScheme=I)}),R}):j($=>{const R={...$},P=I.light===null?n:I.light,z=I.dark===null?r:I.dark;return P&&(m.includes(P)?(R.lightColorScheme=P,v==null||v.set(P)):console.error(`\`${P}\` does not exist in \`theme.colorSchemes\`.`)),z&&(m.includes(z)?(R.darkColorScheme=z,C==null||C.set(z)):console.error(`\`${z}\` does not exist in \`theme.colorSchemes\`.`)),R}):j($=>(v==null||v.set(n),C==null||C.set(r),{...$,lightColorScheme:n,darkColorScheme:r}))},[m,v,C,n,r]),A=b.useCallback(I=>{S.mode==="system"&&j($=>{const R=I!=null&&I.matches?"dark":"light";return $.systemMode===R?$:{...$,systemMode:R}})},[S.mode]),O=b.useRef(A);return O.current=A,b.useEffect(()=>{if(typeof window.matchMedia!="function"||!g)return;const I=(...R)=>O.current(...R),$=window.matchMedia("(prefers-color-scheme: dark)");return $.addListener(I),I($),()=>{$.removeListener(I)}},[g]),b.useEffect(()=>{if(g){const I=(y==null?void 0:y.subscribe(P=>{(!P||["light","dark","system"].includes(P))&&E(P||e)}))||BS,$=(v==null?void 0:v.subscribe(P=>{(!P||m.match(P))&&k({light:P})}))||BS,R=(C==null?void 0:C.subscribe(P=>{(!P||m.match(P))&&k({dark:P})}))||BS;return()=>{I(),$(),R()}}},[k,E,m,e,u,g,y,v,C]),{...S,mode:D?S.mode:void 0,systemMode:D?S.systemMode:void 0,colorScheme:D?T:void 0,setMode:E,setColorScheme:k}}const yU="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function vU(t){const{themeId:e,theme:n={},modeStorageKey:r=Bw,colorSchemeStorageKey:s=Uw,disableTransitionOnChange:i=!1,defaultColorScheme:l,resolveTheme:u}=t,p={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},f=b.createContext(void 0),m=()=>b.useContext(f)||p,g={},y={};function v(D){var xe,ee,ne,he;const{children:M,theme:T,modeStorageKey:E=r,colorSchemeStorageKey:k=s,disableTransitionOnChange:A=i,storageManager:O,storageWindow:I=typeof window>"u"?void 0:window,documentNode:$=typeof document>"u"?void 0:document,colorSchemeNode:R=typeof document>"u"?void 0:document.documentElement,disableNestedContext:P=!1,disableStyleSheetGeneration:z=!1,defaultMode:N="system",noSsr:H}=D,U=b.useRef(!1),L=Fw(),W=b.useContext(f),K=!!W&&!P,Q=b.useMemo(()=>T||(typeof n=="function"?n():n),[T]),le=Q[e],F=le||Q,{colorSchemes:J=g,components:ie=y,cssVarPrefix:te}=F,de=Object.keys(J).filter(je=>!!J[je]).join(","),fe=b.useMemo(()=>de.split(","),[de]),Re=typeof l=="string"?l:l.light,Pe=typeof l=="string"?l:l.dark,$e=J[Re]&&J[Pe]?N:((ee=(xe=J[F.defaultColorScheme])==null?void 0:xe.palette)==null?void 0:ee.mode)||((ne=F.palette)==null?void 0:ne.mode),{mode:we,setMode:be,systemMode:Ae,lightColorScheme:Ne,darkColorScheme:Ie,colorScheme:Fe,setColorScheme:ct}=gU({supportedColorSchemes:fe,defaultLightColorScheme:Re,defaultDarkColorScheme:Pe,modeStorageKey:E,colorSchemeStorageKey:k,defaultMode:$e,storageManager:O,storageWindow:I,noSsr:H});let Me=we,tt=Fe;K&&(Me=W.mode,tt=W.colorScheme);const Ve=b.useMemo(()=>{var Be;const je=tt||F.defaultColorScheme,ze=((Be=F.generateThemeVars)==null?void 0:Be.call(F))||F.vars,ke={...F,components:ie,colorSchemes:J,cssVarPrefix:te,vars:ze};if(typeof ke.generateSpacing=="function"&&(ke.spacing=ke.generateSpacing()),je){const xt=J[je];xt&&typeof xt=="object"&&Object.keys(xt).forEach(vt=>{xt[vt]&&typeof xt[vt]=="object"?ke[vt]={...ke[vt],...xt[vt]}:ke[vt]=xt[vt]})}return u?u(ke):ke},[F,tt,ie,J,te]),it=F.colorSchemeSelector;Cs(()=>{if(tt&&R&&it&&it!=="media"){const je=it;let ze=it;if(je==="class"&&(ze=".%s"),je==="data"&&(ze="[data-%s]"),je!=null&&je.startsWith("data-")&&!je.includes("%s")&&(ze=`[${je}="%s"]`),ze.startsWith("."))R.classList.remove(...fe.map(ke=>ze.substring(1).replace("%s",ke))),R.classList.add(ze.substring(1).replace("%s",tt));else{const ke=ze.replace("%s",tt).match(/\[([^\]]+)\]/);if(ke){const[Be,xt]=ke[1].split("=");xt||fe.forEach(vt=>{R.removeAttribute(Be.replace(tt,vt))}),R.setAttribute(Be,xt?xt.replace(/"|'/g,""):"")}else R.setAttribute(ze,tt)}}},[tt,it,R,fe]),b.useEffect(()=>{let je;if(A&&U.current&&$){const ze=$.createElement("style");ze.appendChild($.createTextNode(yU)),$.head.appendChild(ze),window.getComputedStyle($.body),je=setTimeout(()=>{$.head.removeChild(ze)},1)}return()=>{clearTimeout(je)}},[tt,A,$]),b.useEffect(()=>(U.current=!0,()=>{U.current=!1}),[]);const Z=b.useMemo(()=>({allColorSchemes:fe,colorScheme:tt,darkColorScheme:Ie,lightColorScheme:Ne,mode:Me,setColorScheme:ct,setMode:be,systemMode:Ae}),[fe,tt,Ie,Ne,Me,ct,be,Ae,Ve.colorSchemeSelector]);let q=!0;(z||F.cssVariables===!1||K&&(L==null?void 0:L.cssVarPrefix)===te)&&(q=!1);const se=a.jsxs(b.Fragment,{children:[a.jsx(aI,{themeId:le?e:void 0,theme:Ve,children:M}),q&&a.jsx(L_,{styles:((he=Ve.generateStyleSheets)==null?void 0:he.call(Ve))||[]})]});return K?se:a.jsx(f.Provider,{value:Z,children:se})}const C=typeof l=="string"?l:l.light,S=typeof l=="string"?l:l.dark;return{CssVarsProvider:v,useColorScheme:m,getInitColorSchemeScript:D=>pU({colorSchemeStorageKey:s,defaultLightColorScheme:C,defaultDarkColorScheme:S,modeStorageKey:r,...D})}}function xU(t=""){function e(...r){if(!r.length)return"";const s=r[0];return typeof s=="string"&&!s.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${t?`${t}-`:""}${s}${e(...r.slice(1))})`:`, ${s}`}return(r,...s)=>`var(--${t?`${t}-`:""}${r}${e(...s)})`}const ik=(t,e,n,r=[])=>{let s=t;e.forEach((i,l)=>{l===e.length-1?Array.isArray(s)?s[Number(i)]=n:s&&typeof s=="object"&&(s[i]=n):s&&typeof s=="object"&&(s[i]||(s[i]=r.includes(i)?[]:{}),s=s[i])})},bU=(t,e,n)=>{function r(s,i=[],l=[]){Object.entries(s).forEach(([u,p])=>{(!n||n&&!n([...i,u]))&&p!=null&&(typeof p=="object"&&Object.keys(p).length>0?r(p,[...i,u],Array.isArray(p)?[...l,u]:l):e([...i,u],p,l))})}r(t)},SU=(t,e)=>typeof e=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>t.includes(r))||t[t.length-1].toLowerCase().includes("opacity")?e:`${e}px`:e;function US(t,e){const{prefix:n,shouldSkipGeneratingVar:r}=e||{},s={},i={},l={};return bU(t,(u,p,f)=>{if((typeof p=="string"||typeof p=="number")&&(!r||!r(u,p))){const m=`--${n?`${n}-`:""}${u.join("-")}`,g=SU(u,p);Object.assign(s,{[m]:g}),ik(i,u,`var(${m})`,f),ik(l,u,`var(${m}, ${g})`,f)}},u=>u[0]==="vars"),{css:s,vars:i,varsWithDefaults:l}}function CU(t,e={}){const{getSelector:n=j,disableCssColorScheme:r,colorSchemeSelector:s}=e,{colorSchemes:i={},components:l,defaultColorScheme:u="light",...p}=t,{vars:f,css:m,varsWithDefaults:g}=US(p,e);let y=g;const v={},{[u]:C,...S}=i;if(Object.entries(S||{}).forEach(([T,E])=>{const{vars:k,css:A,varsWithDefaults:O}=US(E,e);y=ls(y,O),v[T]={css:A,vars:k}}),C){const{css:T,vars:E,varsWithDefaults:k}=US(C,e);y=ls(y,k),v[u]={css:T,vars:E}}function j(T,E){var A,O;let k=s;if(s==="class"&&(k=".%s"),s==="data"&&(k="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(k=`[${s}="%s"]`),T){if(k==="media")return t.defaultColorScheme===T?":root":{[`@media (prefers-color-scheme: ${((O=(A=i[T])==null?void 0:A.palette)==null?void 0:O.mode)||T})`]:{":root":E}};if(k)return t.defaultColorScheme===T?`:root, ${k.replace("%s",String(T))}`:k.replace("%s",String(T))}return":root"}return{vars:y,generateThemeVars:()=>{let T={...f};return Object.entries(v).forEach(([,{vars:E}])=>{T=ls(T,E)}),T},generateStyleSheets:()=>{var I,$;const T=[],E=t.defaultColorScheme||"light";function k(R,P){Object.keys(P).length&&T.push(typeof R=="string"?{[R]:{...P}}:R)}k(n(void 0,{...m}),m);const{[E]:A,...O}=v;if(A){const{css:R}=A,P=($=(I=i[E])==null?void 0:I.palette)==null?void 0:$.mode,z=!r&&P?{colorScheme:P,...R}:{...R};k(n(E,{...z}),z)}return Object.entries(O).forEach(([R,{css:P}])=>{var H,U;const z=(U=(H=i[R])==null?void 0:H.palette)==null?void 0:U.mode,N=!r&&z?{colorScheme:z,...P}:{...P};k(n(R,{...N}),N)}),T}}}function wU(t){return function(n){return t==="media"?`@media (prefers-color-scheme: ${n})`:t?t.startsWith("data-")&&!t.includes("%s")?`[${t}="${n}"] &`:t==="class"?`.${n} &`:t==="data"?`[data-${n}] &`:`${t.replace("%s",n)} &`:"&"}}const jU=xp(),TU=Lw("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`maxWidth${ue(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),DU=t=>zw({props:t,name:"MuiContainer",defaultTheme:jU}),EU=(t,e)=>{const n=p=>Ze(e,p),{classes:r,fixed:s,disableGutters:i,maxWidth:l}=t,u={root:["root",l&&`maxWidth${ue(String(l))}`,s&&"fixed",i&&"disableGutters"]};return Ke(u,n,r)};function RU(t={}){const{createStyledComponent:e=TU,useThemeProps:n=DU,componentName:r="MuiContainer"}=t,s=e(({theme:l,ownerState:u})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!u.disableGutters&&{paddingLeft:l.spacing(2),paddingRight:l.spacing(2),[l.breakpoints.up("sm")]:{paddingLeft:l.spacing(3),paddingRight:l.spacing(3)}}}),({theme:l,ownerState:u})=>u.fixed&&Object.keys(l.breakpoints.values).reduce((p,f)=>{const m=f,g=l.breakpoints.values[m];return g!==0&&(p[l.breakpoints.up(m)]={maxWidth:`${g}${l.breakpoints.unit}`}),p},{}),({theme:l,ownerState:u})=>({...u.maxWidth==="xs"&&{[l.breakpoints.up("xs")]:{maxWidth:Math.max(l.breakpoints.values.xs,444)}},...u.maxWidth&&u.maxWidth!=="xs"&&{[l.breakpoints.up(u.maxWidth)]:{maxWidth:`${l.breakpoints.values[u.maxWidth]}${l.breakpoints.unit}`}}}));return b.forwardRef(function(u,p){const f=n(u),{className:m,component:g="div",disableGutters:y=!1,fixed:v=!1,maxWidth:C="lg",classes:S,...j}=f,D={...f,component:g,disableGutters:y,fixed:v,maxWidth:C},M=EU(D,r);return a.jsx(s,{as:g,ownerState:D,className:Ce(M.root,m),ref:p,...j})})}const kU=(t,e)=>t.filter(n=>e.includes(n)),bp=(t,e,n)=>{const r=t.keys[0];Array.isArray(e)?e.forEach((s,i)=>{n((l,u)=>{i<=t.keys.length-1&&(i===0?Object.assign(l,u):l[t.up(t.keys[i])]=u)},s)}):e&&typeof e=="object"?(Object.keys(e).length>t.keys.length?t.keys:kU(t.keys,Object.keys(e))).forEach(i=>{if(t.keys.includes(i)){const l=e[i];l!==void 0&&n((u,p)=>{r===i?Object.assign(u,p):u[t.up(i)]=p},l)}}):(typeof e=="number"||typeof e=="string")&&n((s,i)=>{Object.assign(s,i)},e)};function hv(t){return`--Grid-${t}Spacing`}function bx(t){return`--Grid-parent-${t}Spacing`}const ok="--Grid-columns",Id="--Grid-parent-columns",MU=({theme:t,ownerState:e})=>{const n={};return bp(t.breakpoints,e.size,(r,s)=>{let i={};s==="grow"&&(i={flexBasis:0,flexGrow:1,maxWidth:"100%"}),s==="auto"&&(i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),typeof s=="number"&&(i={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${s} / var(${Id}) - (var(${Id}) - ${s}) * (var(${bx("column")}) / var(${Id})))`}),r(n,i)}),n},OU=({theme:t,ownerState:e})=>{const n={};return bp(t.breakpoints,e.offset,(r,s)=>{let i={};s==="auto"&&(i={marginLeft:"auto"}),typeof s=="number"&&(i={marginLeft:s===0?"0px":`calc(100% * ${s} / var(${Id}) + var(${bx("column")}) * ${s} / var(${Id}))`}),r(n,i)}),n},AU=({theme:t,ownerState:e})=>{if(!e.container)return{};const n={[ok]:12};return bp(t.breakpoints,e.columns,(r,s)=>{const i=s??12;r(n,{[ok]:i,"> *":{[Id]:i}})}),n},_U=({theme:t,ownerState:e})=>{if(!e.container)return{};const n={};return bp(t.breakpoints,e.rowSpacing,(r,s)=>{var l;const i=typeof s=="string"?s:(l=t.spacing)==null?void 0:l.call(t,s);r(n,{[hv("row")]:i,"> *":{[bx("row")]:i}})}),n},IU=({theme:t,ownerState:e})=>{if(!e.container)return{};const n={};return bp(t.breakpoints,e.columnSpacing,(r,s)=>{var l;const i=typeof s=="string"?s:(l=t.spacing)==null?void 0:l.call(t,s);r(n,{[hv("column")]:i,"> *":{[bx("column")]:i}})}),n},PU=({theme:t,ownerState:e})=>{if(!e.container)return{};const n={};return bp(t.breakpoints,e.direction,(r,s)=>{r(n,{flexDirection:s})}),n},LU=({ownerState:t})=>({minWidth:0,boxSizing:"border-box",...t.container&&{display:"flex",flexWrap:"wrap",...t.wrap&&t.wrap!=="wrap"&&{flexWrap:t.wrap},gap:`var(${hv("row")}) var(${hv("column")})`}}),zU=t=>{const e=[];return Object.entries(t).forEach(([n,r])=>{r!==!1&&r!==void 0&&e.push(`grid-${n}-${String(r)}`)}),e},$U=(t,e="xs")=>{function n(r){return r===void 0?!1:typeof r=="string"&&!Number.isNaN(Number(r))||typeof r=="number"&&r>0}if(n(t))return[`spacing-${e}-${String(t)}`];if(typeof t=="object"&&!Array.isArray(t)){const r=[];return Object.entries(t).forEach(([s,i])=>{n(i)&&r.push(`spacing-${s}-${String(i)}`)}),r}return[]},NU=t=>t===void 0?[]:typeof t=="object"?Object.entries(t).map(([e,n])=>`direction-${e}-${n}`):[`direction-xs-${String(t)}`];function FU(t,e){t.item!==void 0&&delete t.item,t.zeroMinWidth!==void 0&&delete t.zeroMinWidth,e.keys.forEach(n=>{t[n]!==void 0&&delete t[n]})}const BU=xp(),UU=Lw("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>e.root});function VU(t){return zw({props:t,name:"MuiGrid",defaultTheme:BU})}function HU(t={}){const{createStyledComponent:e=UU,useThemeProps:n=VU,useTheme:r=xm,componentName:s="MuiGrid"}=t,i=(f,m)=>{const{container:g,direction:y,spacing:v,wrap:C,size:S}=f,j={root:["root",g&&"container",C!=="wrap"&&`wrap-xs-${String(C)}`,...NU(y),...zU(S),...g?$U(v,m.breakpoints.keys[0]):[]]};return Ke(j,D=>Ze(s,D),{})};function l(f,m,g=()=>!0){const y={};return f===null||(Array.isArray(f)?f.forEach((v,C)=>{v!==null&&g(v)&&m.keys[C]&&(y[m.keys[C]]=v)}):typeof f=="object"?Object.keys(f).forEach(v=>{const C=f[v];C!=null&&g(C)&&(y[v]=C)}):y[m.keys[0]]=f),y}const u=e(AU,IU,_U,MU,PU,LU,OU),p=b.forwardRef(function(m,g){const y=r(),v=n(m),C=bm(v);FU(C,y.breakpoints);const{className:S,children:j,columns:D=12,container:M=!1,component:T="div",direction:E="row",wrap:k="wrap",size:A={},offset:O={},spacing:I=0,rowSpacing:$=I,columnSpacing:R=I,unstable_level:P=0,...z}=C,N=l(A,y.breakpoints,F=>F!==!1),H=l(O,y.breakpoints),U=m.columns??(P?void 0:D),L=m.spacing??(P?void 0:I),W=m.rowSpacing??m.spacing??(P?void 0:$),K=m.columnSpacing??m.spacing??(P?void 0:R),Q={...C,level:P,columns:U,container:M,direction:E,wrap:k,spacing:L,rowSpacing:W,columnSpacing:K,size:N,offset:H},le=i(Q,y);return a.jsx(u,{ref:g,as:T,ownerState:Q,className:Ce(le.root,S),...z,children:b.Children.map(j,F=>{var J;return b.isValidElement(F)&&rh(F,["Grid"])&&M&&F.props.container?b.cloneElement(F,{unstable_level:((J=F.props)==null?void 0:J.unstable_level)??P+1}):F})})});return p.muiName="Grid",p}const WU=xp(),qU=Lw("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function GU(t){return zw({props:t,name:"MuiStack",defaultTheme:WU})}function ZU(t,e){const n=b.Children.toArray(t).filter(Boolean);return n.reduce((r,s,i)=>(r.push(s),i<n.length-1&&r.push(b.cloneElement(e,{key:`separator-${i}`})),r),[])}const KU=t=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],QU=({ownerState:t,theme:e})=>{let n={display:"flex",flexDirection:"column",...ti({theme:e},au({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r}))};if(t.spacing){const r=dx(e),s=Object.keys(e.breakpoints.values).reduce((p,f)=>((typeof t.spacing=="object"&&t.spacing[f]!=null||typeof t.direction=="object"&&t.direction[f]!=null)&&(p[f]=!0),p),{}),i=au({values:t.direction,base:s}),l=au({values:t.spacing,base:s});typeof i=="object"&&Object.keys(i).forEach((p,f,m)=>{if(!i[p]){const y=f>0?i[m[f-1]]:"column";i[p]=y}}),n=ls(n,ti({theme:e},l,(p,f)=>t.useFlexGap?{gap:gu(r,p)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${KU(f?i[f]:t.direction)}`]:gu(r,p)}}))}return n=BF(e.breakpoints,n),n};function JU(t={}){const{createStyledComponent:e=qU,useThemeProps:n=GU,componentName:r="MuiStack"}=t,s=()=>Ke({root:["root"]},p=>Ze(r,p),{}),i=e(QU);return b.forwardRef(function(p,f){const m=n(p),g=bm(m),{component:y="div",direction:v="column",spacing:C=0,divider:S,children:j,className:D,useFlexGap:M=!1,...T}=g,E={direction:v,spacing:C,useFlexGap:M},k=s();return a.jsx(i,{as:y,ownerState:E,ref:f,className:Ce(k.root,D),...T,children:S?ZU(j,S):j})})}function cI(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:xh.white,default:xh.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const YU=cI();function uI(){return{text:{primary:xh.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:xh.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const ak=uI();function lk(t,e,n,r){const s=r.light||r,i=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=Yo(t.main,s):e==="dark"&&(t.dark=Jo(t.main,i)))}function XU(t="light"){return t==="dark"?{main:ud[200],light:ud[50],dark:ud[400]}:{main:ud[700],light:ud[400],dark:ud[800]}}function e6(t="light"){return t==="dark"?{main:cd[200],light:cd[50],dark:cd[400]}:{main:cd[500],light:cd[300],dark:cd[700]}}function t6(t="light"){return t==="dark"?{main:ld[500],light:ld[300],dark:ld[700]}:{main:ld[700],light:ld[400],dark:ld[800]}}function n6(t="light"){return t==="dark"?{main:dd[400],light:dd[300],dark:dd[700]}:{main:dd[700],light:dd[500],dark:dd[900]}}function r6(t="light"){return t==="dark"?{main:pd[400],light:pd[300],dark:pd[700]}:{main:pd[800],light:pd[500],dark:pd[900]}}function s6(t="light"){return t==="dark"?{main:Df[400],light:Df[300],dark:Df[700]}:{main:"#ed6c02",light:Df[500],dark:Df[900]}}function Vw(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2,...s}=t,i=t.primary||XU(e),l=t.secondary||e6(e),u=t.error||t6(e),p=t.info||n6(e),f=t.success||r6(e),m=t.warning||s6(e);function g(S){return GB(S,ak.text.primary)>=n?ak.text.primary:YU.text.primary}const y=({color:S,name:j,mainShade:D=500,lightShade:M=300,darkShade:T=700})=>{if(S={...S},!S.main&&S[D]&&(S.main=S[D]),!S.hasOwnProperty("main"))throw new Error(Wa(11,j?` (${j})`:"",D));if(typeof S.main!="string")throw new Error(Wa(12,j?` (${j})`:"",JSON.stringify(S.main)));return lk(S,"light",M,r),lk(S,"dark",T,r),S.contrastText||(S.contrastText=g(S.main)),S};let v;return e==="light"?v=cI():e==="dark"&&(v=uI()),ls({common:{...xh},mode:e,primary:y({color:i,name:"primary"}),secondary:y({color:l,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:y({color:u,name:"error"}),warning:y({color:m,name:"warning"}),info:y({color:p,name:"info"}),success:y({color:f,name:"success"}),grey:AN,contrastThreshold:n,getContrastText:g,augmentColor:y,tonalOffset:r,...v},s)}function i6(t){const e={};return Object.entries(t).forEach(r=>{const[s,i]=r;typeof i=="object"&&(e[s]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),e}function o6(t,e){return{toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}},...e}}function a6(t){return Math.round(t*1e5)/1e5}const ck={textTransform:"uppercase"},uk='"Roboto", "Helvetica", "Arial", sans-serif';function dI(t,e){const{fontFamily:n=uk,fontSize:r=14,fontWeightLight:s=300,fontWeightRegular:i=400,fontWeightMedium:l=500,fontWeightBold:u=700,htmlFontSize:p=16,allVariants:f,pxToRem:m,...g}=typeof e=="function"?e(t):e,y=r/14,v=m||(j=>`${j/p*y}rem`),C=(j,D,M,T,E)=>({fontFamily:n,fontWeight:j,fontSize:v(D),lineHeight:M,...n===uk?{letterSpacing:`${a6(T/D)}em`}:{},...E,...f}),S={h1:C(s,96,1.167,-1.5),h2:C(s,60,1.2,-.5),h3:C(i,48,1.167,0),h4:C(i,34,1.235,.25),h5:C(i,24,1.334,0),h6:C(l,20,1.6,.15),subtitle1:C(i,16,1.75,.15),subtitle2:C(l,14,1.57,.1),body1:C(i,16,1.5,.15),body2:C(i,14,1.43,.15),button:C(l,14,1.75,.4,ck),caption:C(i,12,1.66,.4),overline:C(i,12,2.66,1,ck),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ls({htmlFontSize:p,pxToRem:v,fontFamily:n,fontSize:r,fontWeightLight:s,fontWeightRegular:i,fontWeightMedium:l,fontWeightBold:u,...S},g,{clone:!1})}const l6=.2,c6=.14,u6=.12;function hr(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${l6})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${c6})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${u6})`].join(",")}const d6=["none",hr(0,2,1,-1,0,1,1,0,0,1,3,0),hr(0,3,1,-2,0,2,2,0,0,1,5,0),hr(0,3,3,-2,0,3,4,0,0,1,8,0),hr(0,2,4,-1,0,4,5,0,0,1,10,0),hr(0,3,5,-1,0,5,8,0,0,1,14,0),hr(0,3,5,-1,0,6,10,0,0,1,18,0),hr(0,4,5,-2,0,7,10,1,0,2,16,1),hr(0,5,5,-3,0,8,10,1,0,3,14,2),hr(0,5,6,-3,0,9,12,1,0,3,16,2),hr(0,6,6,-3,0,10,14,1,0,4,18,3),hr(0,6,7,-4,0,11,15,1,0,4,20,3),hr(0,7,8,-4,0,12,17,2,0,5,22,4),hr(0,7,8,-4,0,13,19,2,0,5,24,4),hr(0,7,9,-4,0,14,21,2,0,5,26,4),hr(0,8,9,-5,0,15,22,2,0,6,28,5),hr(0,8,10,-5,0,16,24,2,0,6,30,5),hr(0,8,11,-5,0,17,26,2,0,6,32,5),hr(0,9,11,-5,0,18,28,2,0,7,34,6),hr(0,9,12,-6,0,19,29,2,0,7,36,6),hr(0,10,13,-6,0,20,31,3,0,8,38,7),hr(0,10,13,-6,0,21,33,3,0,8,40,7),hr(0,10,14,-6,0,22,35,3,0,8,42,7),hr(0,11,14,-7,0,23,36,3,0,9,44,8),hr(0,11,15,-7,0,24,38,3,0,9,46,8)],p6={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},pI={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function dk(t){return`${Math.round(t)}ms`}function f6(t){if(!t)return 0;const e=t/36;return Math.min(Math.round((4+15*e**.25+e/5)*10),3e3)}function h6(t){const e={...p6,...t.easing},n={...pI,...t.duration};return{getAutoHeightDuration:f6,create:(s=["all"],i={})=>{const{duration:l=n.standard,easing:u=e.easeInOut,delay:p=0,...f}=i;return(Array.isArray(s)?s:[s]).map(m=>`${m} ${typeof l=="string"?l:dk(l)} ${u} ${typeof p=="string"?p:dk(p)}`).join(",")},...t,easing:e,duration:n}}const m6={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function g6(t){return Wo(t)||typeof t>"u"||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||Array.isArray(t)}function fI(t={}){const e={...t};function n(r){const s=Object.entries(r);for(let i=0;i<s.length;i++){const[l,u]=s[i];!g6(u)||l.startsWith("unstable_")?delete r[l]:Wo(u)&&(r[l]={...u},n(r[l]))}}return n(e),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
115
|
+
|
|
116
|
+
const theme = ${JSON.stringify(e,null,2)};
|
|
117
|
+
|
|
118
|
+
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
119
|
+
theme.transitions = createTransitions(theme.transitions || {});
|
|
120
|
+
|
|
121
|
+
export default theme;`}function sC(t={},...e){const{breakpoints:n,mixins:r={},spacing:s,palette:i={},transitions:l={},typography:u={},shape:p,...f}=t;if(t.vars&&t.generateThemeVars===void 0)throw new Error(Wa(20));const m=Vw(i),g=xp(t);let y=ls(g,{mixins:o6(g.breakpoints,r),palette:m,shadows:d6.slice(),typography:dI(m,u),transitions:h6(l),zIndex:{...m6}});return y=ls(y,f),y=e.reduce((v,C)=>ls(v,C),y),y.unstable_sxConfig={...vm,...f==null?void 0:f.unstable_sxConfig},y.unstable_sx=function(C){return ec({sx:C,theme:this})},y.toRuntimeSource=fI,y}function iC(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const y6=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=iC(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function hI(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function mI(t){return t==="dark"?y6:[]}function v6(t){const{palette:e={mode:"light"},opacity:n,overlays:r,...s}=t,i=Vw(e);return{palette:i,opacity:{...hI(i.mode),...n},overlays:r||mI(i.mode),...s}}function x6(t){var e;return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!((e=t[1])!=null&&e.match(/(mode|contrastThreshold|tonalOffset)/))}const b6=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],S6=t=>(e,n)=>{const r=t.rootSelector||":root",s=t.colorSchemeSelector;let i=s;if(s==="class"&&(i=".%s"),s==="data"&&(i="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(i=`[${s}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const l={};return b6(t.cssVarPrefix).forEach(u=>{l[u]=n[u],delete n[u]}),i==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:l}}:i?{[i.replace("%s",e)]:l,[`${r}, ${i.replace("%s",e)}`]:n}:{[r]:{...n,...l}}}if(i&&i!=="media")return`${r}, ${i.replace("%s",String(e))}`}else if(e){if(i==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[r]:n}};if(i)return i.replace("%s",String(e))}return r};function C6(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function De(t,e,n){!t[e]&&n&&(t[e]=n)}function Hf(t){return typeof t!="string"||!t.startsWith("hsl")?t:Y_(t)}function Ra(t,e){`${e}Channel`in t||(t[`${e}Channel`]=Vf(Hf(t[e])))}function w6(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const $o=t=>{try{return t()}catch{}},j6=(t="mui")=>xU(t);function VS(t,e,n,r){if(!e)return;e=e===!0?{}:e;const s=r==="dark"?"dark":"light";if(!n){t[r]=v6({...e,palette:{mode:s,...e==null?void 0:e.palette}});return}const{palette:i,...l}=sC({...n,palette:{mode:s,...e==null?void 0:e.palette}});return t[r]={...e,palette:i,opacity:{...hI(s),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||mI(s)},l}function T6(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:s=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:l=x6,colorSchemeSelector:u=n.light&&n.dark?"media":void 0,rootSelector:p=":root",...f}=t,m=Object.keys(n)[0],g=r||(n.light&&m!=="light"?"light":m),y=j6(i),{[g]:v,light:C,dark:S,...j}=n,D={...j};let M=v;if((g==="dark"&&!("dark"in n)||g==="light"&&!("light"in n))&&(M=!0),!M)throw new Error(Wa(21,g));const T=VS(D,M,f,g);C&&!D.light&&VS(D,C,void 0,"light"),S&&!D.dark&&VS(D,S,void 0,"dark");let E={defaultColorScheme:g,...T,cssVarPrefix:i,colorSchemeSelector:u,rootSelector:p,getCssVar:y,colorSchemes:D,font:{...i6(T.typography),...T.font},spacing:w6(f.spacing)};Object.keys(E.colorSchemes).forEach($=>{const R=E.colorSchemes[$].palette,P=z=>{const N=z.split("-"),H=N[1],U=N[2];return y(z,R[H][U])};if(R.mode==="light"&&(De(R.common,"background","#fff"),De(R.common,"onBackground","#000")),R.mode==="dark"&&(De(R.common,"background","#000"),De(R.common,"onBackground","#fff")),C6(R,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),R.mode==="light"){De(R.Alert,"errorColor",Xn(R.error.light,.6)),De(R.Alert,"infoColor",Xn(R.info.light,.6)),De(R.Alert,"successColor",Xn(R.success.light,.6)),De(R.Alert,"warningColor",Xn(R.warning.light,.6)),De(R.Alert,"errorFilledBg",P("palette-error-main")),De(R.Alert,"infoFilledBg",P("palette-info-main")),De(R.Alert,"successFilledBg",P("palette-success-main")),De(R.Alert,"warningFilledBg",P("palette-warning-main")),De(R.Alert,"errorFilledColor",$o(()=>R.getContrastText(R.error.main))),De(R.Alert,"infoFilledColor",$o(()=>R.getContrastText(R.info.main))),De(R.Alert,"successFilledColor",$o(()=>R.getContrastText(R.success.main))),De(R.Alert,"warningFilledColor",$o(()=>R.getContrastText(R.warning.main))),De(R.Alert,"errorStandardBg",er(R.error.light,.9)),De(R.Alert,"infoStandardBg",er(R.info.light,.9)),De(R.Alert,"successStandardBg",er(R.success.light,.9)),De(R.Alert,"warningStandardBg",er(R.warning.light,.9)),De(R.Alert,"errorIconColor",P("palette-error-main")),De(R.Alert,"infoIconColor",P("palette-info-main")),De(R.Alert,"successIconColor",P("palette-success-main")),De(R.Alert,"warningIconColor",P("palette-warning-main")),De(R.AppBar,"defaultBg",P("palette-grey-100")),De(R.Avatar,"defaultBg",P("palette-grey-400")),De(R.Button,"inheritContainedBg",P("palette-grey-300")),De(R.Button,"inheritContainedHoverBg",P("palette-grey-A100")),De(R.Chip,"defaultBorder",P("palette-grey-400")),De(R.Chip,"defaultAvatarColor",P("palette-grey-700")),De(R.Chip,"defaultIconColor",P("palette-grey-700")),De(R.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),De(R.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),De(R.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),De(R.LinearProgress,"primaryBg",er(R.primary.main,.62)),De(R.LinearProgress,"secondaryBg",er(R.secondary.main,.62)),De(R.LinearProgress,"errorBg",er(R.error.main,.62)),De(R.LinearProgress,"infoBg",er(R.info.main,.62)),De(R.LinearProgress,"successBg",er(R.success.main,.62)),De(R.LinearProgress,"warningBg",er(R.warning.main,.62)),De(R.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.11)`),De(R.Slider,"primaryTrack",er(R.primary.main,.62)),De(R.Slider,"secondaryTrack",er(R.secondary.main,.62)),De(R.Slider,"errorTrack",er(R.error.main,.62)),De(R.Slider,"infoTrack",er(R.info.main,.62)),De(R.Slider,"successTrack",er(R.success.main,.62)),De(R.Slider,"warningTrack",er(R.warning.main,.62));const z=dy(R.background.default,.8);De(R.SnackbarContent,"bg",z),De(R.SnackbarContent,"color",$o(()=>R.getContrastText(z))),De(R.SpeedDialAction,"fabHoverBg",dy(R.background.paper,.15)),De(R.StepConnector,"border",P("palette-grey-400")),De(R.StepContent,"border",P("palette-grey-400")),De(R.Switch,"defaultColor",P("palette-common-white")),De(R.Switch,"defaultDisabledColor",P("palette-grey-100")),De(R.Switch,"primaryDisabledColor",er(R.primary.main,.62)),De(R.Switch,"secondaryDisabledColor",er(R.secondary.main,.62)),De(R.Switch,"errorDisabledColor",er(R.error.main,.62)),De(R.Switch,"infoDisabledColor",er(R.info.main,.62)),De(R.Switch,"successDisabledColor",er(R.success.main,.62)),De(R.Switch,"warningDisabledColor",er(R.warning.main,.62)),De(R.TableCell,"border",er(uy(R.divider,1),.88)),De(R.Tooltip,"bg",uy(R.grey[700],.92))}if(R.mode==="dark"){De(R.Alert,"errorColor",er(R.error.light,.6)),De(R.Alert,"infoColor",er(R.info.light,.6)),De(R.Alert,"successColor",er(R.success.light,.6)),De(R.Alert,"warningColor",er(R.warning.light,.6)),De(R.Alert,"errorFilledBg",P("palette-error-dark")),De(R.Alert,"infoFilledBg",P("palette-info-dark")),De(R.Alert,"successFilledBg",P("palette-success-dark")),De(R.Alert,"warningFilledBg",P("palette-warning-dark")),De(R.Alert,"errorFilledColor",$o(()=>R.getContrastText(R.error.dark))),De(R.Alert,"infoFilledColor",$o(()=>R.getContrastText(R.info.dark))),De(R.Alert,"successFilledColor",$o(()=>R.getContrastText(R.success.dark))),De(R.Alert,"warningFilledColor",$o(()=>R.getContrastText(R.warning.dark))),De(R.Alert,"errorStandardBg",Xn(R.error.light,.9)),De(R.Alert,"infoStandardBg",Xn(R.info.light,.9)),De(R.Alert,"successStandardBg",Xn(R.success.light,.9)),De(R.Alert,"warningStandardBg",Xn(R.warning.light,.9)),De(R.Alert,"errorIconColor",P("palette-error-main")),De(R.Alert,"infoIconColor",P("palette-info-main")),De(R.Alert,"successIconColor",P("palette-success-main")),De(R.Alert,"warningIconColor",P("palette-warning-main")),De(R.AppBar,"defaultBg",P("palette-grey-900")),De(R.AppBar,"darkBg",P("palette-background-paper")),De(R.AppBar,"darkColor",P("palette-text-primary")),De(R.Avatar,"defaultBg",P("palette-grey-600")),De(R.Button,"inheritContainedBg",P("palette-grey-800")),De(R.Button,"inheritContainedHoverBg",P("palette-grey-700")),De(R.Chip,"defaultBorder",P("palette-grey-700")),De(R.Chip,"defaultAvatarColor",P("palette-grey-300")),De(R.Chip,"defaultIconColor",P("palette-grey-300")),De(R.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),De(R.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),De(R.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),De(R.LinearProgress,"primaryBg",Xn(R.primary.main,.5)),De(R.LinearProgress,"secondaryBg",Xn(R.secondary.main,.5)),De(R.LinearProgress,"errorBg",Xn(R.error.main,.5)),De(R.LinearProgress,"infoBg",Xn(R.info.main,.5)),De(R.LinearProgress,"successBg",Xn(R.success.main,.5)),De(R.LinearProgress,"warningBg",Xn(R.warning.main,.5)),De(R.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.13)`),De(R.Slider,"primaryTrack",Xn(R.primary.main,.5)),De(R.Slider,"secondaryTrack",Xn(R.secondary.main,.5)),De(R.Slider,"errorTrack",Xn(R.error.main,.5)),De(R.Slider,"infoTrack",Xn(R.info.main,.5)),De(R.Slider,"successTrack",Xn(R.success.main,.5)),De(R.Slider,"warningTrack",Xn(R.warning.main,.5));const z=dy(R.background.default,.98);De(R.SnackbarContent,"bg",z),De(R.SnackbarContent,"color",$o(()=>R.getContrastText(z))),De(R.SpeedDialAction,"fabHoverBg",dy(R.background.paper,.15)),De(R.StepConnector,"border",P("palette-grey-600")),De(R.StepContent,"border",P("palette-grey-600")),De(R.Switch,"defaultColor",P("palette-grey-300")),De(R.Switch,"defaultDisabledColor",P("palette-grey-600")),De(R.Switch,"primaryDisabledColor",Xn(R.primary.main,.55)),De(R.Switch,"secondaryDisabledColor",Xn(R.secondary.main,.55)),De(R.Switch,"errorDisabledColor",Xn(R.error.main,.55)),De(R.Switch,"infoDisabledColor",Xn(R.info.main,.55)),De(R.Switch,"successDisabledColor",Xn(R.success.main,.55)),De(R.Switch,"warningDisabledColor",Xn(R.warning.main,.55)),De(R.TableCell,"border",Xn(uy(R.divider,1),.68)),De(R.Tooltip,"bg",uy(R.grey[700],.92))}Ra(R.background,"default"),Ra(R.background,"paper"),Ra(R.common,"background"),Ra(R.common,"onBackground"),Ra(R,"divider"),Object.keys(R).forEach(z=>{const N=R[z];z!=="tonalOffset"&&N&&typeof N=="object"&&(N.main&&De(R[z],"mainChannel",Vf(Hf(N.main))),N.light&&De(R[z],"lightChannel",Vf(Hf(N.light))),N.dark&&De(R[z],"darkChannel",Vf(Hf(N.dark))),N.contrastText&&De(R[z],"contrastTextChannel",Vf(Hf(N.contrastText))),z==="text"&&(Ra(R[z],"primary"),Ra(R[z],"secondary")),z==="action"&&(N.active&&Ra(R[z],"active"),N.selected&&Ra(R[z],"selected")))})}),E=e.reduce(($,R)=>ls($,R),E);const k={prefix:i,disableCssColorScheme:s,shouldSkipGeneratingVar:l,getSelector:S6(E)},{vars:A,generateThemeVars:O,generateStyleSheets:I}=CU(E,k);return E.vars=A,Object.entries(E.colorSchemes[E.defaultColorScheme]).forEach(([$,R])=>{E[$]=R}),E.generateThemeVars=O,E.generateStyleSheets=I,E.generateSpacing=function(){return U_(f.spacing,dx(this))},E.getColorSchemeSelector=wU(u),E.spacing=E.generateSpacing(),E.shouldSkipGeneratingVar=l,E.unstable_sxConfig={...vm,...f==null?void 0:f.unstable_sxConfig},E.unstable_sx=function(R){return ec({sx:R,theme:this})},E.toRuntimeSource=fI,E}function pk(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:Vw({...n===!0?{}:n.palette,mode:e})})}function Sx(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:s=n?void 0:{light:!0},defaultColorScheme:i=n==null?void 0:n.mode,...l}=t,u=i||"light",p=s==null?void 0:s[u],f={...s,...n?{[u]:{...typeof p!="boolean"&&p,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return sC(t,...e);let m=n;"palette"in t||f[u]&&(f[u]!==!0?m=f[u].palette:u==="dark"&&(m={mode:"dark"}));const g=sC({...t,palette:m},...e);return g.defaultColorScheme=u,g.colorSchemes=f,g.palette.mode==="light"&&(g.colorSchemes.light={...f.light!==!0&&f.light,palette:g.palette},pk(g,"dark",f.dark)),g.palette.mode==="dark"&&(g.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:g.palette},pk(g,"light",f.light)),g}return!n&&!("light"in f)&&u==="light"&&(f.light=!0),T6({...l,colorSchemes:f,defaultColorScheme:u,...typeof r!="boolean"&&r},...e)}const Hw=Sx();function vr(){const t=xm(Hw);return t[So]||t}function Cx(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Gr=t=>Cx(t)&&t!=="classes",ce=Z_({themeId:So,defaultTheme:Hw,rootShouldForwardProp:Gr});function D6({theme:t,...e}){const n=So in t?t[So]:void 0;return a.jsx(aI,{...e,themeId:n?So:void 0,theme:n||t})}const py={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:E6}=vU({themeId:So,theme:()=>Sx({cssVariables:!0}),colorSchemeStorageKey:py.colorSchemeStorageKey,modeStorageKey:py.modeStorageKey,defaultColorScheme:{light:py.defaultLightColorScheme,dark:py.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:dI(t.palette,t.typography)};return e.unstable_sx=function(r){return ec({sx:r,theme:this})},e}}),R6=E6;function k6({theme:t,...e}){const n=b.useMemo(()=>{if(typeof t=="function")return t;const r=So in t?t[So]:t;return"colorSchemes"in r?null:"vars"in r?t:{...t,vars:null}},[t]);return n?a.jsx(D6,{theme:n,...e}):a.jsx(R6,{theme:t,...e})}function M6(t){return a.jsx(V_,{...t,defaultTheme:Hw,themeId:So})}function Ww(t){return function(n){return a.jsx(M6,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function O6(){return bm}const Ue=uU;function Qe(t){return lU(t)}function A6(t){return Ze("MuiSvgIcon",t)}et("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const _6=t=>{const{color:e,fontSize:n,classes:r}=t,s={root:["root",e!=="inherit"&&`color${ue(e)}`,`fontSize${ue(n)}`]};return Ke(s,A6,r)},I6=ce("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${ue(n.color)}`],e[`fontSize${ue(n.fontSize)}`]]}})(Ue(({theme:t})=>{var e,n,r,s,i,l,u,p,f,m,g,y,v,C;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(s=(e=t.transitions)==null?void 0:e.create)==null?void 0:s.call(e,"fill",{duration:(r=(n=(t.vars??t).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:S=>!S.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((l=(i=t.typography)==null?void 0:i.pxToRem)==null?void 0:l.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((p=(u=t.typography)==null?void 0:u.pxToRem)==null?void 0:p.call(u,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((m=(f=t.typography)==null?void 0:f.pxToRem)==null?void 0:m.call(f,35))||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter(([,S])=>S&&S.main).map(([S])=>{var j,D;return{props:{color:S},style:{color:(D=(j=(t.vars??t).palette)==null?void 0:j[S])==null?void 0:D.main}}}),{props:{color:"action"},style:{color:(y=(g=(t.vars??t).palette)==null?void 0:g.action)==null?void 0:y.active}},{props:{color:"disabled"},style:{color:(C=(v=(t.vars??t).palette)==null?void 0:v.action)==null?void 0:C.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),oC=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiSvgIcon"}),{children:s,className:i,color:l="inherit",component:u="svg",fontSize:p="medium",htmlColor:f,inheritViewBox:m=!1,titleAccess:g,viewBox:y="0 0 24 24",...v}=r,C=b.isValidElement(s)&&s.type==="svg",S={...r,color:l,component:u,fontSize:p,instanceFontSize:e.fontSize,inheritViewBox:m,viewBox:y,hasSvgAsChild:C},j={};m||(j.viewBox=y);const D=_6(S);return a.jsxs(I6,{as:u,className:Ce(D.root,i),focusable:"false",color:f,"aria-hidden":g?void 0:!0,role:g?"img":void 0,ref:n,...j,...v,...C&&s.props,ownerState:S,children:[C?s.props.children:s,g?a.jsx("title",{children:g}):null]})});oC.muiName="SvgIcon";function ye(t,e){function n(r,s){return a.jsx(oC,{"data-testid":`${e}Icon`,ref:s,...r,children:t})}return n.muiName=oC.muiName,b.memo(b.forwardRef(n))}function qw(t,e){if(!t)return e;if(typeof t=="function"||typeof e=="function")return s=>{const i=typeof e=="function"?e(s):e,l=typeof t=="function"?t({...s,...i}):t,u=Ce(s==null?void 0:s.className,i==null?void 0:i.className,l==null?void 0:l.className);return{...i,...l,...!!u&&{className:u},...(i==null?void 0:i.style)&&(l==null?void 0:l.style)&&{style:{...i.style,...l.style}},...(i==null?void 0:i.sx)&&(l==null?void 0:l.sx)&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(l.sx)?l.sx:[l.sx]]}}};const n=e,r=Ce(n==null?void 0:n.className,t==null?void 0:t.className);return{...e,...t,...!!r&&{className:r},...(n==null?void 0:n.style)&&(t==null?void 0:t.style)&&{style:{...n.style,...t.style}},...(n==null?void 0:n.sx)&&(t==null?void 0:t.sx)&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(t.sx)?t.sx:[t.sx]]}}}function gI(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function aC(t,e){return aC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},aC(t,e)}function yI(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,aC(t,e)}const fk={disabled:!1},mv=We.createContext(null);var P6=function(e){return e.scrollTop},Wf="unmounted",Nc="exited",Fc="entering",vd="entered",lC="exiting",so=(function(t){yI(e,t);function e(r,s){var i;i=t.call(this,r,s)||this;var l=s,u=l&&!l.isMounting?r.enter:r.appear,p;return i.appearStatus=null,r.in?u?(p=Nc,i.appearStatus=Fc):p=vd:r.unmountOnExit||r.mountOnEnter?p=Wf:p=Nc,i.state={status:p},i.nextCallback=null,i}e.getDerivedStateFromProps=function(s,i){var l=s.in;return l&&i.status===Wf?{status:Nc}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(s){var i=null;if(s!==this.props){var l=this.state.status;this.props.in?l!==Fc&&l!==vd&&(i=Fc):(l===Fc||l===vd)&&(i=lC)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var s=this.props.timeout,i,l,u;return i=l=u=s,s!=null&&typeof s!="number"&&(i=s.exit,l=s.enter,u=s.appear!==void 0?s.appear:l),{exit:i,enter:l,appear:u}},n.updateStatus=function(s,i){if(s===void 0&&(s=!1),i!==null)if(this.cancelNextCallback(),i===Fc){if(this.props.unmountOnExit||this.props.mountOnEnter){var l=this.props.nodeRef?this.props.nodeRef.current:ay.findDOMNode(this);l&&P6(l)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Nc&&this.setState({status:Wf})},n.performEnter=function(s){var i=this,l=this.props.enter,u=this.context?this.context.isMounting:s,p=this.props.nodeRef?[u]:[ay.findDOMNode(this),u],f=p[0],m=p[1],g=this.getTimeouts(),y=u?g.appear:g.enter;if(!s&&!l||fk.disabled){this.safeSetState({status:vd},function(){i.props.onEntered(f)});return}this.props.onEnter(f,m),this.safeSetState({status:Fc},function(){i.props.onEntering(f,m),i.onTransitionEnd(y,function(){i.safeSetState({status:vd},function(){i.props.onEntered(f,m)})})})},n.performExit=function(){var s=this,i=this.props.exit,l=this.getTimeouts(),u=this.props.nodeRef?void 0:ay.findDOMNode(this);if(!i||fk.disabled){this.safeSetState({status:Nc},function(){s.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:lC},function(){s.props.onExiting(u),s.onTransitionEnd(l.exit,function(){s.safeSetState({status:Nc},function(){s.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(s,i){i=this.setNextCallback(i),this.setState(s,i)},n.setNextCallback=function(s){var i=this,l=!0;return this.nextCallback=function(u){l&&(l=!1,i.nextCallback=null,s(u))},this.nextCallback.cancel=function(){l=!1},this.nextCallback},n.onTransitionEnd=function(s,i){this.setNextCallback(i);var l=this.props.nodeRef?this.props.nodeRef.current:ay.findDOMNode(this),u=s==null&&!this.props.addEndListener;if(!l||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var p=this.props.nodeRef?[this.nextCallback]:[l,this.nextCallback],f=p[0],m=p[1];this.props.addEndListener(f,m)}s!=null&&setTimeout(this.nextCallback,s)},n.render=function(){var s=this.state.status;if(s===Wf)return null;var i=this.props,l=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var u=gI(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return We.createElement(mv.Provider,{value:null},typeof l=="function"?l(s,u):We.cloneElement(We.Children.only(l),u))},e})(We.Component);so.contextType=mv;so.propTypes={};function fd(){}so.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fd,onEntering:fd,onEntered:fd,onExit:fd,onExiting:fd,onExited:fd};so.UNMOUNTED=Wf;so.EXITED=Nc;so.ENTERING=Fc;so.ENTERED=vd;so.EXITING=lC;function L6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gw(t,e){var n=function(i){return e&&b.isValidElement(i)?e(i):i},r=Object.create(null);return t&&b.Children.map(t,function(s){return s}).forEach(function(s){r[s.key]=n(s)}),r}function z6(t,e){t=t||{},e=e||{};function n(m){return m in e?e[m]:t[m]}var r=Object.create(null),s=[];for(var i in t)i in e?s.length&&(r[i]=s,s=[]):s.push(i);var l,u={};for(var p in e){if(r[p])for(l=0;l<r[p].length;l++){var f=r[p][l];u[r[p][l]]=n(f)}u[p]=n(p)}for(l=0;l<s.length;l++)u[s[l]]=n(s[l]);return u}function Gc(t,e,n){return n[e]!=null?n[e]:t.props[e]}function $6(t,e){return Gw(t.children,function(n){return b.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:Gc(n,"appear",t),enter:Gc(n,"enter",t),exit:Gc(n,"exit",t)})})}function N6(t,e,n){var r=Gw(t.children),s=z6(e,r);return Object.keys(s).forEach(function(i){var l=s[i];if(b.isValidElement(l)){var u=i in e,p=i in r,f=e[i],m=b.isValidElement(f)&&!f.props.in;p&&(!u||m)?s[i]=b.cloneElement(l,{onExited:n.bind(null,l),in:!0,exit:Gc(l,"exit",t),enter:Gc(l,"enter",t)}):!p&&u&&!m?s[i]=b.cloneElement(l,{in:!1}):p&&u&&b.isValidElement(f)&&(s[i]=b.cloneElement(l,{onExited:n.bind(null,l),in:f.props.in,exit:Gc(l,"exit",t),enter:Gc(l,"enter",t)}))}}),s}var F6=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},B6={component:"div",childFactory:function(e){return e}},Zw=(function(t){yI(e,t);function e(r,s){var i;i=t.call(this,r,s)||this;var l=i.handleExited.bind(L6(i));return i.state={contextValue:{isMounting:!0},handleExited:l,firstRender:!0},i}var n=e.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(s,i){var l=i.children,u=i.handleExited,p=i.firstRender;return{children:p?$6(s,u):N6(s,l,u),firstRender:!1}},n.handleExited=function(s,i){var l=Gw(this.props.children);s.key in l||(s.props.onExited&&s.props.onExited(i),this.mounted&&this.setState(function(u){var p=uv({},u.children);return delete p[s.key],{children:p}}))},n.render=function(){var s=this.props,i=s.component,l=s.childFactory,u=gI(s,["component","childFactory"]),p=this.state.contextValue,f=F6(this.state.children).map(l);return delete u.appear,delete u.enter,delete u.exit,i===null?We.createElement(mv.Provider,{value:p},f):We.createElement(mv.Provider,{value:p},We.createElement(i,u,f))},e})(We.Component);Zw.propTypes={};Zw.defaultProps=B6;const Kw=t=>t.scrollTop;function rc(t,e){const{timeout:n,easing:r,style:s={}}=t;return{duration:s.transitionDuration??(typeof n=="number"?n:n[e.mode]||0),easing:s.transitionTimingFunction??(typeof r=="object"?r[e.mode]:r),delay:s.transitionDelay}}function U6(t){return Ze("MuiCollapse",t)}et("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const V6=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Ke(r,U6,n)},H6=ce("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(Ue(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:e})=>e.state==="exited"&&!e.in&&e.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),W6=ce("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),q6=ce("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Co=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiCollapse"}),{addEndListener:s,children:i,className:l,collapsedSize:u="0px",component:p,easing:f,in:m,onEnter:g,onEntered:y,onEntering:v,onExit:C,onExited:S,onExiting:j,orientation:D="vertical",style:M,timeout:T=pI.standard,TransitionComponent:E=so,...k}=r,A={...r,orientation:D,collapsedSize:u},O=V6(A),I=vr(),$=Hl(),R=b.useRef(null),P=b.useRef(),z=typeof u=="number"?`${u}px`:u,N=D==="horizontal",H=N?"width":"height",U=b.useRef(null),L=cr(n,U),W=fe=>Re=>{if(fe){const Pe=U.current;Re===void 0?fe(Pe):fe(Pe,Re)}},K=()=>R.current?R.current[N?"clientWidth":"clientHeight"]:0,Q=W((fe,Re)=>{R.current&&N&&(R.current.style.position="absolute"),fe.style[H]=z,g&&g(fe,Re)}),le=W((fe,Re)=>{const Pe=K();R.current&&N&&(R.current.style.position="");const{duration:$e,easing:we}=rc({style:M,timeout:T,easing:f},{mode:"enter"});if(T==="auto"){const be=I.transitions.getAutoHeightDuration(Pe);fe.style.transitionDuration=`${be}ms`,P.current=be}else fe.style.transitionDuration=typeof $e=="string"?$e:`${$e}ms`;fe.style[H]=`${Pe}px`,fe.style.transitionTimingFunction=we,v&&v(fe,Re)}),F=W((fe,Re)=>{fe.style[H]="auto",y&&y(fe,Re)}),J=W(fe=>{fe.style[H]=`${K()}px`,C&&C(fe)}),ie=W(S),te=W(fe=>{const Re=K(),{duration:Pe,easing:$e}=rc({style:M,timeout:T,easing:f},{mode:"exit"});if(T==="auto"){const we=I.transitions.getAutoHeightDuration(Re);fe.style.transitionDuration=`${we}ms`,P.current=we}else fe.style.transitionDuration=typeof Pe=="string"?Pe:`${Pe}ms`;fe.style[H]=z,fe.style.transitionTimingFunction=$e,j&&j(fe)}),de=fe=>{T==="auto"&&$.start(P.current||0,fe),s&&s(U.current,fe)};return a.jsx(E,{in:m,onEnter:Q,onEntered:F,onEntering:le,onExit:J,onExited:ie,onExiting:te,addEndListener:de,nodeRef:U,timeout:T==="auto"?null:T,...k,children:(fe,{ownerState:Re,...Pe})=>a.jsx(H6,{as:p,className:Ce(O.root,l,{entered:O.entered,exited:!m&&z==="0px"&&O.hidden}[fe]),style:{[N?"minWidth":"minHeight"]:z,...M},ref:L,ownerState:{...A,state:fe},...Pe,children:a.jsx(W6,{ownerState:{...A,state:fe},className:O.wrapper,ref:R,children:a.jsx(q6,{ownerState:{...A,state:fe},className:O.wrapperInner,children:i})})})})});Co&&(Co.muiSupportAuto=!0);function G6(t){return Ze("MuiPaper",t)}et("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Z6=t=>{const{square:e,elevation:n,variant:r,classes:s}=t,i={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Ke(i,G6,s)},K6=ce("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(Ue(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),$t=b.forwardRef(function(e,n){var v;const r=Qe({props:e,name:"MuiPaper"}),s=vr(),{className:i,component:l="div",elevation:u=1,square:p=!1,variant:f="elevation",...m}=r,g={...r,component:l,elevation:u,square:p,variant:f},y=Z6(g);return a.jsx(K6,{as:l,ownerState:g,className:Ce(y.root,i),ref:n,...m,style:{...f==="elevation"&&{"--Paper-shadow":(s.vars||s).shadows[u],...s.vars&&{"--Paper-overlay":(v=s.vars.overlays)==null?void 0:v[u]},...!s.vars&&s.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${wt("#fff",iC(u))}, ${wt("#fff",iC(u))})`}},...m.style}})}),vI=b.createContext({});function at(t,e){const{className:n,elementType:r,ownerState:s,externalForwardedProps:i,internalForwardedProps:l,shouldForwardComponentProp:u=!1,...p}=e,{component:f,slots:m={[t]:void 0},slotProps:g={[t]:void 0},...y}=i,v=m[t]||r,C=rI(g[t],s),{props:{component:S,...j},internalRef:D}=nI({className:n,...p,externalForwardedProps:t==="root"?y:void 0,externalSlotProps:C}),M=cr(D,C==null?void 0:C.ref,e.ref),T=t==="root"?S||f:S,E=tI(v,{...t==="root"&&!f&&!m[t]&&l,...t!=="root"&&!m[t]&&l,...j,...T&&!u&&{as:T},...T&&u&&{component:T},ref:M},s);return[v,E]}function Q6(t){return Ze("MuiAccordion",t)}const fy=et("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),J6=t=>{const{classes:e,square:n,expanded:r,disabled:s,disableGutters:i}=t;return Ke({root:["root",!n&&"rounded",r&&"expanded",s&&"disabled",!i&&"gutters"],heading:["heading"],region:["region"]},Q6,e)},Y6=ce($t,{name:"MuiAccordion",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${fy.region}`]:e.region},e.root,!n.square&&e.rounded,!n.disableGutters&&e.gutters]}})(Ue(({theme:t})=>{const e={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],e),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],e)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${fy.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${fy.disabled}`]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}}),Ue(({theme:t})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${fy.expanded}`]:{margin:"16px 0"}}}]}))),X6=ce("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(t,e)=>e.heading})({all:"unset"}),_s=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiAccordion"}),{children:s,className:i,defaultExpanded:l=!1,disabled:u=!1,disableGutters:p=!1,expanded:f,onChange:m,square:g=!1,slots:y={},slotProps:v={},TransitionComponent:C,TransitionProps:S,...j}=r,[D,M]=Ba({controlled:f,default:l,name:"Accordion",state:"expanded"}),T=b.useCallback(K=>{M(!D),m&&m(K,!D)},[D,m,M]),[E,...k]=b.Children.toArray(s),A=b.useMemo(()=>({expanded:D,disabled:u,disableGutters:p,toggle:T}),[D,u,p,T]),O={...r,square:g,disabled:u,disableGutters:p,expanded:D},I=J6(O),$={transition:C,...y},R={transition:S,...v},P={slots:$,slotProps:R},[z,N]=at("root",{elementType:Y6,externalForwardedProps:{...P,...j},className:Ce(I.root,i),shouldForwardComponentProp:!0,ownerState:O,ref:n,additionalProps:{square:g}}),[H,U]=at("heading",{elementType:X6,externalForwardedProps:P,className:I.heading,ownerState:O}),[L,W]=at("transition",{elementType:Co,externalForwardedProps:P,ownerState:O});return a.jsxs(z,{...N,children:[a.jsx(H,{...U,children:a.jsx(vI.Provider,{value:A,children:E})}),a.jsx(L,{in:D,timeout:"auto",...W,children:a.jsx("div",{"aria-labelledby":E.props.id,id:E.props["aria-controls"],role:"region",className:I.region,children:k})})]})});function e9(t){return Ze("MuiAccordionDetails",t)}et("MuiAccordionDetails",["root"]);const t9=t=>{const{classes:e}=t;return Ke({root:["root"]},e9,e)},n9=ce("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(t,e)=>e.root})(Ue(({theme:t})=>({padding:t.spacing(1,2,2)}))),Is=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiAccordionDetails"}),{className:s,...i}=r,l=r,u=t9(l);return a.jsx(n9,{className:Ce(u.root,s),ref:n,ownerState:l,...i})});class gv{constructor(){St(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new gv}static use(){const e=X_(gv.create).current,[n,r]=b.useState(!1);return e.shouldMount=n,e.setShouldMount=r,b.useEffect(e.mountEffect,[n]),e}mount(){return this.mounted||(this.mounted=s9(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...e)})}stop(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...e)})}pulsate(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...e)})}}function r9(){return gv.use()}function s9(){let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n}function i9(t){const{className:e,classes:n,pulsate:r=!1,rippleX:s,rippleY:i,rippleSize:l,in:u,onExited:p,timeout:f}=t,[m,g]=b.useState(!1),y=Ce(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),v={width:l,height:l,top:-(l/2)+i,left:-(l/2)+s},C=Ce(n.child,m&&n.childLeaving,r&&n.childPulsate);return!u&&!m&&g(!0),b.useEffect(()=>{if(!u&&p!=null){const S=setTimeout(p,f);return()=>{clearTimeout(S)}}},[p,u,f]),a.jsx("span",{className:y,style:v,children:a.jsx("span",{className:C})})}const Wi=et("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),cC=550,o9=80,a9=dc`
|
|
122
|
+
0% {
|
|
123
|
+
transform: scale(0);
|
|
124
|
+
opacity: 0.1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
100% {
|
|
128
|
+
transform: scale(1);
|
|
129
|
+
opacity: 0.3;
|
|
130
|
+
}
|
|
131
|
+
`,l9=dc`
|
|
132
|
+
0% {
|
|
133
|
+
opacity: 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
100% {
|
|
137
|
+
opacity: 0;
|
|
138
|
+
}
|
|
139
|
+
`,c9=dc`
|
|
140
|
+
0% {
|
|
141
|
+
transform: scale(1);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
50% {
|
|
145
|
+
transform: scale(0.92);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
100% {
|
|
149
|
+
transform: scale(1);
|
|
150
|
+
}
|
|
151
|
+
`,u9=ce("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),d9=ce(i9,{name:"MuiTouchRipple",slot:"Ripple"})`
|
|
152
|
+
opacity: 0;
|
|
153
|
+
position: absolute;
|
|
154
|
+
|
|
155
|
+
&.${Wi.rippleVisible} {
|
|
156
|
+
opacity: 0.3;
|
|
157
|
+
transform: scale(1);
|
|
158
|
+
animation-name: ${a9};
|
|
159
|
+
animation-duration: ${cC}ms;
|
|
160
|
+
animation-timing-function: ${({theme:t})=>t.transitions.easing.easeInOut};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&.${Wi.ripplePulsate} {
|
|
164
|
+
animation-duration: ${({theme:t})=>t.transitions.duration.shorter}ms;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
& .${Wi.child} {
|
|
168
|
+
opacity: 1;
|
|
169
|
+
display: block;
|
|
170
|
+
width: 100%;
|
|
171
|
+
height: 100%;
|
|
172
|
+
border-radius: 50%;
|
|
173
|
+
background-color: currentColor;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
& .${Wi.childLeaving} {
|
|
177
|
+
opacity: 0;
|
|
178
|
+
animation-name: ${l9};
|
|
179
|
+
animation-duration: ${cC}ms;
|
|
180
|
+
animation-timing-function: ${({theme:t})=>t.transitions.easing.easeInOut};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
& .${Wi.childPulsate} {
|
|
184
|
+
position: absolute;
|
|
185
|
+
/* @noflip */
|
|
186
|
+
left: 0px;
|
|
187
|
+
top: 0;
|
|
188
|
+
animation-name: ${c9};
|
|
189
|
+
animation-duration: 2500ms;
|
|
190
|
+
animation-timing-function: ${({theme:t})=>t.transitions.easing.easeInOut};
|
|
191
|
+
animation-iteration-count: infinite;
|
|
192
|
+
animation-delay: 200ms;
|
|
193
|
+
}
|
|
194
|
+
`,p9=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTouchRipple"}),{center:s=!1,classes:i={},className:l,...u}=r,[p,f]=b.useState([]),m=b.useRef(0),g=b.useRef(null);b.useEffect(()=>{g.current&&(g.current(),g.current=null)},[p]);const y=b.useRef(!1),v=Hl(),C=b.useRef(null),S=b.useRef(null),j=b.useCallback(E=>{const{pulsate:k,rippleX:A,rippleY:O,rippleSize:I,cb:$}=E;f(R=>[...R,a.jsx(d9,{classes:{ripple:Ce(i.ripple,Wi.ripple),rippleVisible:Ce(i.rippleVisible,Wi.rippleVisible),ripplePulsate:Ce(i.ripplePulsate,Wi.ripplePulsate),child:Ce(i.child,Wi.child),childLeaving:Ce(i.childLeaving,Wi.childLeaving),childPulsate:Ce(i.childPulsate,Wi.childPulsate)},timeout:cC,pulsate:k,rippleX:A,rippleY:O,rippleSize:I},m.current)]),m.current+=1,g.current=$},[i]),D=b.useCallback((E={},k={},A=()=>{})=>{const{pulsate:O=!1,center:I=s||k.pulsate,fakeElement:$=!1}=k;if((E==null?void 0:E.type)==="mousedown"&&y.current){y.current=!1;return}(E==null?void 0:E.type)==="touchstart"&&(y.current=!0);const R=$?null:S.current,P=R?R.getBoundingClientRect():{width:0,height:0,left:0,top:0};let z,N,H;if(I||E===void 0||E.clientX===0&&E.clientY===0||!E.clientX&&!E.touches)z=Math.round(P.width/2),N=Math.round(P.height/2);else{const{clientX:U,clientY:L}=E.touches&&E.touches.length>0?E.touches[0]:E;z=Math.round(U-P.left),N=Math.round(L-P.top)}if(I)H=Math.sqrt((2*P.width**2+P.height**2)/3),H%2===0&&(H+=1);else{const U=Math.max(Math.abs((R?R.clientWidth:0)-z),z)*2+2,L=Math.max(Math.abs((R?R.clientHeight:0)-N),N)*2+2;H=Math.sqrt(U**2+L**2)}E!=null&&E.touches?C.current===null&&(C.current=()=>{j({pulsate:O,rippleX:z,rippleY:N,rippleSize:H,cb:A})},v.start(o9,()=>{C.current&&(C.current(),C.current=null)})):j({pulsate:O,rippleX:z,rippleY:N,rippleSize:H,cb:A})},[s,j,v]),M=b.useCallback(()=>{D({},{pulsate:!0})},[D]),T=b.useCallback((E,k)=>{if(v.clear(),(E==null?void 0:E.type)==="touchend"&&C.current){C.current(),C.current=null,v.start(0,()=>{T(E,k)});return}C.current=null,f(A=>A.length>0?A.slice(1):A),g.current=k},[v]);return b.useImperativeHandle(n,()=>({pulsate:M,start:D,stop:T}),[M,D,T]),a.jsx(u9,{className:Ce(Wi.root,i.root,l),ref:S,...u,children:a.jsx(Zw,{component:null,exit:!0,children:p})})});function f9(t){return Ze("MuiButtonBase",t)}const h9=et("MuiButtonBase",["root","disabled","focusVisible"]),m9=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:s}=t,l=Ke({root:["root",e&&"disabled",n&&"focusVisible"]},f9,s);return n&&r&&(l.root+=` ${r}`),l},g9=ce("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${h9.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Ls=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiButtonBase"}),{action:s,centerRipple:i=!1,children:l,className:u,component:p="button",disabled:f=!1,disableRipple:m=!1,disableTouchRipple:g=!1,focusRipple:y=!1,focusVisibleClassName:v,LinkComponent:C="a",onBlur:S,onClick:j,onContextMenu:D,onDragLeave:M,onFocus:T,onFocusVisible:E,onKeyDown:k,onKeyUp:A,onMouseDown:O,onMouseLeave:I,onMouseUp:$,onTouchEnd:R,onTouchMove:P,onTouchStart:z,tabIndex:N=0,TouchRippleProps:H,touchRippleRef:U,type:L,...W}=r,K=b.useRef(null),Q=r9(),le=cr(Q.ref,U),[F,J]=b.useState(!1);f&&F&&J(!1),b.useImperativeHandle(s,()=>({focusVisible:()=>{J(!0),K.current.focus()}}),[]);const ie=Q.shouldMount&&!m&&!f;b.useEffect(()=>{F&&y&&!m&&Q.pulsate()},[m,y,F,Q]);const te=ka(Q,"start",O,g),de=ka(Q,"stop",D,g),fe=ka(Q,"stop",M,g),Re=ka(Q,"stop",$,g),Pe=ka(Q,"stop",q=>{F&&q.preventDefault(),I&&I(q)},g),$e=ka(Q,"start",z,g),we=ka(Q,"stop",R,g),be=ka(Q,"stop",P,g),Ae=ka(Q,"stop",q=>{nc(q.target)||J(!1),S&&S(q)},!1),Ne=Dr(q=>{K.current||(K.current=q.currentTarget),nc(q.target)&&(J(!0),E&&E(q)),T&&T(q)}),Ie=()=>{const q=K.current;return p&&p!=="button"&&!(q.tagName==="A"&&q.href)},Fe=Dr(q=>{y&&!q.repeat&&F&&q.key===" "&&Q.stop(q,()=>{Q.start(q)}),q.target===q.currentTarget&&Ie()&&q.key===" "&&q.preventDefault(),k&&k(q),q.target===q.currentTarget&&Ie()&&q.key==="Enter"&&!f&&(q.preventDefault(),j&&j(q))}),ct=Dr(q=>{y&&q.key===" "&&F&&!q.defaultPrevented&&Q.stop(q,()=>{Q.pulsate(q)}),A&&A(q),j&&q.target===q.currentTarget&&Ie()&&q.key===" "&&!q.defaultPrevented&&j(q)});let Me=p;Me==="button"&&(W.href||W.to)&&(Me=C);const tt={};Me==="button"?(tt.type=L===void 0?"button":L,tt.disabled=f):(!W.href&&!W.to&&(tt.role="button"),f&&(tt["aria-disabled"]=f));const Ve=cr(n,K),it={...r,centerRipple:i,component:p,disabled:f,disableRipple:m,disableTouchRipple:g,focusRipple:y,tabIndex:N,focusVisible:F},Z=m9(it);return a.jsxs(g9,{as:Me,className:Ce(Z.root,u),ownerState:it,onBlur:Ae,onClick:j,onContextMenu:de,onFocus:Ne,onKeyDown:Fe,onKeyUp:ct,onMouseDown:te,onMouseLeave:Pe,onMouseUp:Re,onDragLeave:fe,onTouchEnd:we,onTouchMove:be,onTouchStart:$e,ref:Ve,tabIndex:f?-1:N,type:L,...tt,...W,children:[l,ie?a.jsx(p9,{ref:le,center:i,...H}):null]})});function ka(t,e,n,r=!1){return Dr(s=>(n&&n(s),r||t[e](s),!0))}function y9(t){return Ze("MuiAccordionSummary",t)}const jd=et("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),v9=t=>{const{classes:e,expanded:n,disabled:r,disableGutters:s}=t;return Ke({root:["root",n&&"expanded",r&&"disabled",!s&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!s&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},y9,e)},x9=ce(Ls,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(t,e)=>e.root})(Ue(({theme:t})=>{const e={duration:t.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],e),[`&.${jd.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${jd.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`&:hover:not(.${jd.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${jd.expanded}`]:{minHeight:64}}}]}})),b9=ce("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(t,e)=>e.content})(Ue(({theme:t})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),[`&.${jd.expanded}`]:{margin:"20px 0"}}}]}))),S9=ce("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(t,e)=>e.expandIconWrapper})(Ue(({theme:t})=>({display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),[`&.${jd.expanded}`]:{transform:"rotate(180deg)"}}))),Ps=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiAccordionSummary"}),{children:s,className:i,expandIcon:l,focusVisibleClassName:u,onClick:p,slots:f,slotProps:m,...g}=r,{disabled:y=!1,disableGutters:v,expanded:C,toggle:S}=b.useContext(vI),j=R=>{S&&S(R),p&&p(R)},D={...r,expanded:C,disabled:y,disableGutters:v},M=v9(D),T={slots:f,slotProps:m},[E,k]=at("root",{ref:n,shouldForwardComponentProp:!0,className:Ce(M.root,i),elementType:x9,externalForwardedProps:{...T,...g},ownerState:D,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:y,"aria-expanded":C,focusVisibleClassName:Ce(M.focusVisible,u)},getSlotProps:R=>({...R,onClick:P=>{var z;(z=R.onClick)==null||z.call(R,P),j(P)}})}),[A,O]=at("content",{className:M.content,elementType:b9,externalForwardedProps:T,ownerState:D}),[I,$]=at("expandIconWrapper",{className:M.expandIconWrapper,elementType:S9,externalForwardedProps:T,ownerState:D});return a.jsxs(E,{...k,children:[a.jsx(A,{...O,children:s}),l&&a.jsx(I,{...$,children:l})]})});function C9(t){return typeof t.main=="string"}function w9(t,e=[]){if(!C9(t))return!1;for(const n of e)if(!t.hasOwnProperty(n)||typeof t[n]!="string")return!1;return!0}function bn(t=[]){return([,e])=>e&&w9(e,t)}function j9(t){return Ze("MuiAlert",t)}const hk=et("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function T9(t){return Ze("MuiCircularProgress",t)}et("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const bl=44,uC=dc`
|
|
195
|
+
0% {
|
|
196
|
+
transform: rotate(0deg);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
100% {
|
|
200
|
+
transform: rotate(360deg);
|
|
201
|
+
}
|
|
202
|
+
`,dC=dc`
|
|
203
|
+
0% {
|
|
204
|
+
stroke-dasharray: 1px, 200px;
|
|
205
|
+
stroke-dashoffset: 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
50% {
|
|
209
|
+
stroke-dasharray: 100px, 200px;
|
|
210
|
+
stroke-dashoffset: -15px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
100% {
|
|
214
|
+
stroke-dasharray: 1px, 200px;
|
|
215
|
+
stroke-dashoffset: -126px;
|
|
216
|
+
}
|
|
217
|
+
`,D9=typeof uC!="string"?vp`
|
|
218
|
+
animation: ${uC} 1.4s linear infinite;
|
|
219
|
+
`:null,E9=typeof dC!="string"?vp`
|
|
220
|
+
animation: ${dC} 1.4s ease-in-out infinite;
|
|
221
|
+
`:null,R9=t=>{const{classes:e,variant:n,color:r,disableShrink:s}=t,i={root:["root",n,`color${ue(r)}`],svg:["svg"],circle:["circle",`circle${ue(n)}`,s&&"circleDisableShrink"]};return Ke(i,T9,e)},k9=ce("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${ue(n.color)}`]]}})(Ue(({theme:t})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:D9||{animation:`${uC} 1.4s linear infinite`}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}}))]}))),M9=ce("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),O9=ce("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${ue(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(Ue(({theme:t})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink,style:E9||{animation:`${dC} 1.4s ease-in-out infinite`}}]}))),ut=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiCircularProgress"}),{className:s,color:i="primary",disableShrink:l=!1,size:u=40,style:p,thickness:f=3.6,value:m=0,variant:g="indeterminate",...y}=r,v={...r,color:i,disableShrink:l,size:u,thickness:f,value:m,variant:g},C=R9(v),S={},j={},D={};if(g==="determinate"){const M=2*Math.PI*((bl-f)/2);S.strokeDasharray=M.toFixed(3),D["aria-valuenow"]=Math.round(m),S.strokeDashoffset=`${((100-m)/100*M).toFixed(3)}px`,j.transform="rotate(-90deg)"}return a.jsx(k9,{className:Ce(C.root,s),style:{width:u,height:u,...j,...p},ownerState:v,ref:n,role:"progressbar",...D,...y,children:a.jsx(M9,{className:C.svg,ownerState:v,viewBox:`${bl/2} ${bl/2} ${bl} ${bl}`,children:a.jsx(O9,{className:C.circle,style:S,ownerState:v,cx:bl,cy:bl,r:(bl-f)/2,fill:"none",strokeWidth:f})})})});function A9(t){return Ze("MuiIconButton",t)}const mk=et("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),_9=t=>{const{classes:e,disabled:n,color:r,edge:s,size:i,loading:l}=t,u={root:["root",l&&"loading",n&&"disabled",r!=="default"&&`color${ue(r)}`,s&&`edge${ue(s)}`,`size${ue(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Ke(u,A9,e)},I9=ce(Ls,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.loading&&e.loading,n.color!=="default"&&e[`color${ue(n.color)}`],n.edge&&e[`edge${ue(n.edge)}`],e[`size${ue(n.size)}`]]}})(Ue(({theme:t})=>({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),Ue(({theme:t})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:wt((t.vars||t).palette[e].main,t.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${mk.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled},[`&.${mk.loading}`]:{color:"transparent"}}))),P9=ce("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(t,e)=>e.loadingIndicator})(({theme:t})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(t.vars||t).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),ft=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiIconButton"}),{edge:s=!1,children:i,className:l,color:u="default",disabled:p=!1,disableFocusRipple:f=!1,size:m="medium",id:g,loading:y=null,loadingIndicator:v,...C}=r,S=pc(g),j=v??a.jsx(ut,{"aria-labelledby":S,color:"inherit",size:16}),D={...r,edge:s,color:u,disabled:p,disableFocusRipple:f,loading:y,loadingIndicator:j,size:m},M=_9(D);return a.jsxs(I9,{id:y?S:g,className:Ce(M.root,l),centerRipple:!0,focusRipple:!f,disabled:p||y,ref:n,...C,ownerState:D,children:[typeof y=="boolean"&&a.jsx("span",{className:M.loadingWrapper,style:{display:"contents"},children:a.jsx(P9,{className:M.loadingIndicator,ownerState:D,children:y&&j})}),i]})}),L9=ye(a.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),z9=ye(a.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),$9=ye(a.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),N9=ye(a.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),xI=ye(a.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),F9=t=>{const{variant:e,color:n,severity:r,classes:s}=t,i={root:["root",`color${ue(n||r)}`,`${e}${ue(n||r)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return Ke(i,j9,s)},B9=ce($t,{name:"MuiAlert",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${ue(n.color||n.severity)}`]]}})(Ue(({theme:t})=>{const e=t.palette.mode==="light"?Jo:Yo,n=t.palette.mode==="light"?Yo:Jo;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(bn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${r}StandardBg`]:n(t.palette[r].light,.9),[`& .${hk.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(bn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),border:`1px solid ${(t.vars||t).palette[r].light}`,[`& .${hk.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(bn(["dark"])).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:{fontWeight:t.typography.fontWeightMedium,...t.vars?{color:t.vars.palette.Alert[`${r}FilledColor`],backgroundColor:t.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:t.palette.mode==="dark"?t.palette[r].dark:t.palette[r].main,color:t.palette.getContrastText(t.palette[r].main)}}}))]}})),U9=ce("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(t,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),V9=ce("div",{name:"MuiAlert",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),H9=ce("div",{name:"MuiAlert",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),gk={success:a.jsx(L9,{fontSize:"inherit"}),warning:a.jsx(z9,{fontSize:"inherit"}),error:a.jsx($9,{fontSize:"inherit"}),info:a.jsx(N9,{fontSize:"inherit"})},zt=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiAlert"}),{action:s,children:i,className:l,closeText:u="Close",color:p,components:f={},componentsProps:m={},icon:g,iconMapping:y=gk,onClose:v,role:C="alert",severity:S="success",slotProps:j={},slots:D={},variant:M="standard",...T}=r,E={...r,color:p,severity:S,variant:M,colorSeverity:p||S},k=F9(E),A={slots:{closeButton:f.CloseButton,closeIcon:f.CloseIcon,...D},slotProps:{...m,...j}},[O,I]=at("root",{ref:n,shouldForwardComponentProp:!0,className:Ce(k.root,l),elementType:B9,externalForwardedProps:{...A,...T},ownerState:E,additionalProps:{role:C,elevation:0}}),[$,R]=at("icon",{className:k.icon,elementType:U9,externalForwardedProps:A,ownerState:E}),[P,z]=at("message",{className:k.message,elementType:V9,externalForwardedProps:A,ownerState:E}),[N,H]=at("action",{className:k.action,elementType:H9,externalForwardedProps:A,ownerState:E}),[U,L]=at("closeButton",{elementType:ft,externalForwardedProps:A,ownerState:E}),[W,K]=at("closeIcon",{elementType:xI,externalForwardedProps:A,ownerState:E});return a.jsxs(O,{...I,children:[g!==!1?a.jsx($,{...R,children:g||y[S]||gk[S]}):null,a.jsx(P,{...z,children:i}),s!=null?a.jsx(N,{...H,children:s}):null,s==null&&v?a.jsx(N,{...H,children:a.jsx(U,{size:"small","aria-label":u,title:u,color:"inherit",onClick:v,...L,children:a.jsx(W,{fontSize:"small",...K})})}):null]})});function W9(t){return Ze("MuiTypography",t)}const yk=et("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),q9={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},G9=O6(),Z9=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:s,variant:i,classes:l}=t,u={root:["root",i,t.align!=="inherit"&&`align${ue(e)}`,n&&"gutterBottom",r&&"noWrap",s&&"paragraph"]};return Ke(u,W9,l)},K9=ce("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${ue(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(Ue(({theme:t})=>{var e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([n,r])=>n!=="inherit"&&r&&typeof r=="object").map(([n,r])=>({props:{variant:n},style:r})),...Object.entries(t.palette).filter(bn()).map(([n])=>({props:{color:n},style:{color:(t.vars||t).palette[n].main}})),...Object.entries(((e=t.palette)==null?void 0:e.text)||{}).filter(([,n])=>typeof n=="string").map(([n])=>({props:{color:`text${ue(n)}`},style:{color:(t.vars||t).palette.text[n]}})),{props:({ownerState:n})=>n.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:n})=>n.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:n})=>n.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:n})=>n.paragraph,style:{marginBottom:16}}]}})),vk={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},G=b.forwardRef(function(e,n){const{color:r,...s}=Qe({props:e,name:"MuiTypography"}),i=!q9[r],l=G9({...s,...i&&{color:r}}),{align:u="inherit",className:p,component:f,gutterBottom:m=!1,noWrap:g=!1,paragraph:y=!1,variant:v="body1",variantMapping:C=vk,...S}=l,j={...l,align:u,color:r,className:p,component:f,gutterBottom:m,noWrap:g,paragraph:y,variant:v,variantMapping:C},D=f||(y?"p":C[v]||vk[v])||"span",M=Z9(j);return a.jsx(K9,{as:D,ref:n,className:Ce(M.root,p),...S,ownerState:j,style:{...u!=="inherit"&&{"--Typography-textAlign":u},...S.style}})});function Q9(t){return Ze("MuiAlertTitle",t)}et("MuiAlertTitle",["root"]);const J9=t=>{const{classes:e}=t;return Ke({root:["root"]},Q9,e)},Y9=ce(G,{name:"MuiAlertTitle",slot:"Root",overridesResolver:(t,e)=>e.root})(Ue(({theme:t})=>({fontWeight:t.typography.fontWeightMedium,marginTop:-2}))),bI=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiAlertTitle"}),{className:s,...i}=r,l=r,u=J9(l);return a.jsx(Y9,{gutterBottom:!0,component:"div",ownerState:l,ref:n,className:Ce(u.root,s),...i})});function X9(t){return Ze("MuiAppBar",t)}et("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const eV=t=>{const{color:e,position:n,classes:r}=t,s={root:["root",`color${ue(e)}`,`position${ue(n)}`]};return Ke(s,X9,r)},xk=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,tV=ce($t,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${ue(n.position)}`],e[`color${ue(n.color)}`]]}})(Ue(({theme:t})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[100],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[100]),...t.applyStyles("dark",{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[900],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[900])})}},...Object.entries(t.palette).filter(bn(["contrastText"])).map(([e])=>({props:{color:e},style:{"--AppBar-background":(t.vars??t).palette[e].main,"--AppBar-color":(t.vars??t).palette[e].contrastText}})),{props:e=>e.enableColorOnDark===!0&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>e.enableColorOnDark===!1&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundColor:t.vars?xk(t.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:t.vars?xk(t.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundImage:"none"})}}]}))),nV=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiAppBar"}),{className:s,color:i="primary",enableColorOnDark:l=!1,position:u="fixed",...p}=r,f={...r,color:i,position:u,enableColorOnDark:l},m=eV(f);return a.jsx(tV,{square:!0,component:"header",ownerState:f,elevation:4,className:Ce(m.root,s,u==="fixed"&&"mui-fixed"),ref:n,...p})});function bk(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function rV(t={}){const{ignoreAccents:e=!0,ignoreCase:n=!0,limit:r,matchFrom:s="any",stringify:i,trim:l=!1}=t;return(u,{inputValue:p,getOptionLabel:f})=>{let m=l?p.trim():p;n&&(m=m.toLowerCase()),e&&(m=bk(m));const g=m?u.filter(y=>{let v=(i||f)(y);return n&&(v=v.toLowerCase()),e&&(v=bk(v)),s==="start"?v.startsWith(m):v.includes(m)}):u;return typeof r=="number"?g.slice(0,r):g}}const sV=rV(),Sk=5,iV=t=>{var e;return t.current!==null&&((e=t.current.parentElement)==null?void 0:e.contains(document.activeElement))},oV=[];function Ck(t,e,n){if(e||t==null)return"";const r=n(t);return typeof r=="string"?r:""}function aV(t){const{unstable_isActiveElementInListbox:e=iV,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:s=!1,autoSelect:i=!1,blurOnSelect:l=!1,clearOnBlur:u=!t.freeSolo,clearOnEscape:p=!1,componentName:f="useAutocomplete",defaultValue:m=t.multiple?oV:null,disableClearable:g=!1,disableCloseOnSelect:y=!1,disabled:v,disabledItemsFocusable:C=!1,disableListWrap:S=!1,filterOptions:j=sV,filterSelectedOptions:D=!1,freeSolo:M=!1,getOptionDisabled:T,getOptionKey:E,getOptionLabel:k=Oe=>Oe.label??Oe,groupBy:A,handleHomeEndKeys:O=!t.freeSolo,id:I,includeInputInList:$=!1,inputValue:R,isOptionEqualToValue:P=(Oe,Ee)=>Oe===Ee,multiple:z=!1,onChange:N,onClose:H,onHighlightChange:U,onInputChange:L,onOpen:W,open:K,openOnFocus:Q=!1,options:le,readOnly:F=!1,selectOnFocus:J=!t.freeSolo,value:ie}=t,te=pc(I);let de=k;de=Oe=>{const Ee=k(Oe);return typeof Ee!="string"?String(Ee):Ee};const fe=b.useRef(!1),Re=b.useRef(!0),Pe=b.useRef(null),$e=b.useRef(null),[we,be]=b.useState(null),[Ae,Ne]=b.useState(-1),Ie=s?0:-1,Fe=b.useRef(Ie),ct=b.useRef(Ck(m??ie,z,de)).current,[Me,tt]=Ba({controlled:ie,default:m,name:f}),[Ve,it]=Ba({controlled:R,default:ct,name:f,state:"inputValue"}),[Z,q]=b.useState(!1),se=b.useCallback((Oe,Ee,dt)=>{if(!(z?Me.length<Ee.length:Ee!==null)&&!u)return;const Wt=Ck(Ee,z,de);Ve!==Wt&&(it(Wt),L&&L(Oe,Wt,dt))},[de,Ve,z,L,it,u,Me]),[xe,ee]=Ba({controlled:K,default:!1,name:f,state:"open"}),[ne,he]=b.useState(!0),je=!z&&Me!=null&&Ve===de(Me),ze=xe&&!F,ke=ze?j(le.filter(Oe=>!(D&&(z?Me:[Me]).some(Ee=>Ee!==null&&P(Oe,Ee)))),{inputValue:je&&ne?"":Ve,getOptionLabel:de}):[],Be=Nw({filteredOptions:ke,value:Me,inputValue:Ve});b.useEffect(()=>{const Oe=Me!==Be.value;Z&&!Oe||M&&!Oe||se(null,Me,"reset")},[Me,se,Z,Be.value,M]);const xt=xe&&ke.length>0&&!F,vt=Dr(Oe=>{Oe===-1?Pe.current.focus():we.querySelector(`[data-tag-index="${Oe}"]`).focus()});b.useEffect(()=>{z&&Ae>Me.length-1&&(Ne(-1),vt(-1))},[Me,z,Ae,vt]);function kt(Oe,Ee){if(!$e.current||Oe<0||Oe>=ke.length)return-1;let dt=Oe;for(;;){const Ut=$e.current.querySelector(`[data-option-index="${dt}"]`),Wt=C?!1:!Ut||Ut.disabled||Ut.getAttribute("aria-disabled")==="true";if(Ut&&Ut.hasAttribute("tabindex")&&!Wt)return dt;if(Ee==="next"?dt=(dt+1)%ke.length:dt=(dt-1+ke.length)%ke.length,dt===Oe)return-1}}const Ge=Dr(({event:Oe,index:Ee,reason:dt})=>{if(Fe.current=Ee,Ee===-1?Pe.current.removeAttribute("aria-activedescendant"):Pe.current.setAttribute("aria-activedescendant",`${te}-option-${Ee}`),U&&["mouse","keyboard","touch"].includes(dt)&&U(Oe,Ee===-1?null:ke[Ee],dt),!$e.current)return;const Ut=$e.current.querySelector(`[role="option"].${n}-focused`);Ut&&(Ut.classList.remove(`${n}-focused`),Ut.classList.remove(`${n}-focusVisible`));let Wt=$e.current;if($e.current.getAttribute("role")!=="listbox"&&(Wt=$e.current.parentElement.querySelector('[role="listbox"]')),!Wt)return;if(Ee===-1){Wt.scrollTop=0;return}const kn=$e.current.querySelector(`[data-option-index="${Ee}"]`);if(kn&&(kn.classList.add(`${n}-focused`),dt==="keyboard"&&kn.classList.add(`${n}-focusVisible`),Wt.scrollHeight>Wt.clientHeight&&dt!=="mouse"&&dt!=="touch")){const Jn=kn,Zr=Wt.clientHeight+Wt.scrollTop,ca=Jn.offsetTop+Jn.offsetHeight;ca>Zr?Wt.scrollTop=ca-Wt.clientHeight:Jn.offsetTop-Jn.offsetHeight*(A?1.3:0)<Wt.scrollTop&&(Wt.scrollTop=Jn.offsetTop-Jn.offsetHeight*(A?1.3:0))}}),gt=Dr(({event:Oe,diff:Ee,direction:dt="next",reason:Ut})=>{if(!ze)return;const kn=kt((()=>{const Jn=ke.length-1;if(Ee==="reset")return Ie;if(Ee==="start")return 0;if(Ee==="end")return Jn;const Zr=Fe.current+Ee;return Zr<0?Zr===-1&&$?-1:S&&Fe.current!==-1||Math.abs(Ee)>1?0:Jn:Zr>Jn?Zr===Jn+1&&$?-1:S||Math.abs(Ee)>1?Jn:0:Zr})(),dt);if(Ge({index:kn,reason:Ut,event:Oe}),r&&Ee!=="reset")if(kn===-1)Pe.current.value=Ve;else{const Jn=de(ke[kn]);Pe.current.value=Jn,Jn.toLowerCase().indexOf(Ve.toLowerCase())===0&&Ve.length>0&&Pe.current.setSelectionRange(Ve.length,Jn.length)}}),dn=()=>{const Oe=(Ee,dt)=>{const Ut=Ee?de(Ee):"",Wt=dt?de(dt):"";return Ut===Wt};if(Fe.current!==-1&&Be.filteredOptions&&Be.filteredOptions.length!==ke.length&&Be.inputValue===Ve&&(z?Me.length===Be.value.length&&Be.value.every((Ee,dt)=>de(Me[dt])===de(Ee)):Oe(Be.value,Me))){const Ee=Be.filteredOptions[Fe.current];if(Ee)return ke.findIndex(dt=>de(dt)===de(Ee))}return-1},$n=b.useCallback(()=>{if(!ze)return;const Oe=dn();if(Oe!==-1){Fe.current=Oe;return}const Ee=z?Me[0]:Me;if(ke.length===0||Ee==null){gt({diff:"reset"});return}if($e.current){if(Ee!=null){const dt=ke[Fe.current];if(z&&dt&&Me.findIndex(Wt=>P(dt,Wt))!==-1)return;const Ut=ke.findIndex(Wt=>P(Wt,Ee));Ut===-1?gt({diff:"reset"}):Ge({index:Ut});return}if(Fe.current>=ke.length-1){Ge({index:ke.length-1});return}Ge({index:Fe.current})}},[ke.length,z?!1:Me,D,gt,Ge,ze,Ve,z]),dr=Dr(Oe=>{rC($e,Oe),Oe&&$n()});b.useEffect(()=>{$n()},[$n]);const tr=Oe=>{xe||(ee(!0),he(!0),W&&W(Oe))},Lr=(Oe,Ee)=>{xe&&(ee(!1),H&&H(Oe,Ee))},jt=(Oe,Ee,dt,Ut)=>{if(z){if(Me.length===Ee.length&&Me.every((Wt,kn)=>Wt===Ee[kn]))return}else if(Me===Ee)return;N&&N(Oe,Ee,dt,Ut),tt(Ee)},_t=b.useRef(!1),an=(Oe,Ee,dt="selectOption",Ut="options")=>{let Wt=dt,kn=Ee;if(z){kn=Array.isArray(Me)?Me.slice():[];const Jn=kn.findIndex(Zr=>P(Ee,Zr));Jn===-1?kn.push(Ee):Ut!=="freeSolo"&&(kn.splice(Jn,1),Wt="removeOption")}se(Oe,kn,Wt),jt(Oe,kn,Wt,{option:Ee}),!y&&(!Oe||!Oe.ctrlKey&&!Oe.metaKey)&&Lr(Oe,Wt),(l===!0||l==="touch"&&_t.current||l==="mouse"&&!_t.current)&&Pe.current.blur()};function Vn(Oe,Ee){if(Oe===-1)return-1;let dt=Oe;for(;;){if(Ee==="next"&&dt===Me.length||Ee==="previous"&&dt===-1)return-1;const Ut=we.querySelector(`[data-tag-index="${dt}"]`);if(!Ut||!Ut.hasAttribute("tabindex")||Ut.disabled||Ut.getAttribute("aria-disabled")==="true")dt+=Ee==="next"?1:-1;else return dt}}const Sn=(Oe,Ee)=>{if(!z)return;Ve===""&&Lr(Oe,"toggleInput");let dt=Ae;Ae===-1?Ve===""&&Ee==="previous"&&(dt=Me.length-1):(dt+=Ee==="next"?1:-1,dt<0&&(dt=0),dt===Me.length&&(dt=-1)),dt=Vn(dt,Ee),Ne(dt),vt(dt)},ht=Oe=>{fe.current=!0,it(""),L&&L(Oe,"","clear"),jt(Oe,z?[]:null,"clear")},Tn=Oe=>Ee=>{if(Oe.onKeyDown&&Oe.onKeyDown(Ee),!Ee.defaultMuiPrevented&&(Ae!==-1&&!["ArrowLeft","ArrowRight"].includes(Ee.key)&&(Ne(-1),vt(-1)),Ee.which!==229))switch(Ee.key){case"Home":ze&&O&&(Ee.preventDefault(),gt({diff:"start",direction:"next",reason:"keyboard",event:Ee}));break;case"End":ze&&O&&(Ee.preventDefault(),gt({diff:"end",direction:"previous",reason:"keyboard",event:Ee}));break;case"PageUp":Ee.preventDefault(),gt({diff:-Sk,direction:"previous",reason:"keyboard",event:Ee}),tr(Ee);break;case"PageDown":Ee.preventDefault(),gt({diff:Sk,direction:"next",reason:"keyboard",event:Ee}),tr(Ee);break;case"ArrowDown":Ee.preventDefault(),gt({diff:1,direction:"next",reason:"keyboard",event:Ee}),tr(Ee);break;case"ArrowUp":Ee.preventDefault(),gt({diff:-1,direction:"previous",reason:"keyboard",event:Ee}),tr(Ee);break;case"ArrowLeft":Sn(Ee,"previous");break;case"ArrowRight":Sn(Ee,"next");break;case"Enter":if(Fe.current!==-1&&ze){const dt=ke[Fe.current],Ut=T?T(dt):!1;if(Ee.preventDefault(),Ut)return;an(Ee,dt,"selectOption"),r&&Pe.current.setSelectionRange(Pe.current.value.length,Pe.current.value.length)}else M&&Ve!==""&&je===!1&&(z&&Ee.preventDefault(),an(Ee,Ve,"createOption","freeSolo"));break;case"Escape":ze?(Ee.preventDefault(),Ee.stopPropagation(),Lr(Ee,"escape")):p&&(Ve!==""||z&&Me.length>0)&&(Ee.preventDefault(),Ee.stopPropagation(),ht(Ee));break;case"Backspace":if(z&&!F&&Ve===""&&Me.length>0){const dt=Ae===-1?Me.length-1:Ae,Ut=Me.slice();Ut.splice(dt,1),jt(Ee,Ut,"removeOption",{option:Me[dt]})}break;case"Delete":if(z&&!F&&Ve===""&&Me.length>0&&Ae!==-1){const dt=Ae,Ut=Me.slice();Ut.splice(dt,1),jt(Ee,Ut,"removeOption",{option:Me[dt]})}break}},Je=Oe=>{q(!0),Q&&!fe.current&&tr(Oe)},Ye=Oe=>{if(e($e)){Pe.current.focus();return}q(!1),Re.current=!0,fe.current=!1,i&&Fe.current!==-1&&ze?an(Oe,ke[Fe.current],"blur"):i&&M&&Ve!==""?an(Oe,Ve,"blur","freeSolo"):u&&se(Oe,Me,"blur"),Lr(Oe,"blur")},It=Oe=>{const Ee=Oe.target.value;Ve!==Ee&&(it(Ee),he(!1),L&&L(Oe,Ee,"input")),Ee===""?!g&&!z&&jt(Oe,null,"clear"):tr(Oe)},Mt=Oe=>{const Ee=Number(Oe.currentTarget.getAttribute("data-option-index"));Fe.current!==Ee&&Ge({event:Oe,index:Ee,reason:"mouse"})},sn=Oe=>{Ge({event:Oe,index:Number(Oe.currentTarget.getAttribute("data-option-index")),reason:"touch"}),_t.current=!0},pr=Oe=>{const Ee=Number(Oe.currentTarget.getAttribute("data-option-index"));an(Oe,ke[Ee],"selectOption"),_t.current=!1},Rr=Oe=>Ee=>{const dt=Me.slice();dt.splice(Oe,1),jt(Ee,dt,"removeOption",{option:Me[Oe]})},kr=Oe=>{xe?Lr(Oe,"toggleInput"):tr(Oe)},cs=Oe=>{Oe.currentTarget.contains(Oe.target)&&Oe.target.getAttribute("id")!==te&&Oe.preventDefault()},Cn=Oe=>{Oe.currentTarget.contains(Oe.target)&&(Pe.current.focus(),J&&Re.current&&Pe.current.selectionEnd-Pe.current.selectionStart===0&&Pe.current.select(),Re.current=!1)},pn=Oe=>{!v&&(Ve===""||!xe)&&kr(Oe)};let sr=M&&Ve.length>0;sr=sr||(z?Me.length>0:Me!==null);let oo=ke;return A&&(oo=ke.reduce((Oe,Ee,dt)=>{const Ut=A(Ee);return Oe.length>0&&Oe[Oe.length-1].group===Ut?Oe[Oe.length-1].options.push(Ee):Oe.push({key:dt,index:dt,group:Ut,options:[Ee]}),Oe},[])),v&&Z&&Ye(),{getRootProps:(Oe={})=>({...Oe,onKeyDown:Tn(Oe),onMouseDown:cs,onClick:Cn}),getInputLabelProps:()=>({id:`${te}-label`,htmlFor:te}),getInputProps:()=>({id:te,value:Ve,onBlur:Ye,onFocus:Je,onChange:It,onMouseDown:pn,"aria-activedescendant":ze?"":null,"aria-autocomplete":r?"both":"list","aria-controls":xt?`${te}-listbox`:void 0,"aria-expanded":xt,autoComplete:"off",ref:Pe,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:v}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:ht}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:kr}),getTagProps:({index:Oe})=>({key:Oe,"data-tag-index":Oe,tabIndex:-1,...!F&&{onDelete:Rr(Oe)}}),getListboxProps:()=>({role:"listbox",id:`${te}-listbox`,"aria-labelledby":`${te}-label`,ref:dr,onMouseDown:Oe=>{Oe.preventDefault()}}),getOptionProps:({index:Oe,option:Ee})=>{const dt=(z?Me:[Me]).some(Wt=>Wt!=null&&P(Ee,Wt)),Ut=T?T(Ee):!1;return{key:(E==null?void 0:E(Ee))??de(Ee),tabIndex:-1,role:"option",id:`${te}-option-${Oe}`,onMouseMove:Mt,onClick:pr,onTouchStart:sn,"data-option-index":Oe,"aria-disabled":Ut,"aria-selected":dt}},id:te,inputValue:Ve,value:Me,dirty:sr,expanded:ze&&we,popupOpen:ze,focused:Z||Ae!==-1,anchorEl:we,setAnchorEl:be,focusedTag:Ae,groupedOptions:oo}}var Ys="top",Yi="bottom",Xi="right",Xs="left",Qw="auto",Cm=[Ys,Yi,Xi,Xs],tp="start",wh="end",lV="clippingParents",SI="viewport",Rf="popper",cV="reference",wk=Cm.reduce(function(t,e){return t.concat([e+"-"+tp,e+"-"+wh])},[]),CI=[].concat(Cm,[Qw]).reduce(function(t,e){return t.concat([e,e+"-"+tp,e+"-"+wh])},[]),uV="beforeRead",dV="read",pV="afterRead",fV="beforeMain",hV="main",mV="afterMain",gV="beforeWrite",yV="write",vV="afterWrite",xV=[uV,dV,pV,fV,hV,mV,gV,yV,vV];function Xo(t){return t?(t.nodeName||"").toLowerCase():null}function wi(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function yu(t){var e=wi(t).Element;return t instanceof e||t instanceof Element}function Ji(t){var e=wi(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Jw(t){if(typeof ShadowRoot>"u")return!1;var e=wi(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function bV(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},s=e.attributes[n]||{},i=e.elements[n];!Ji(i)||!Xo(i)||(Object.assign(i.style,r),Object.keys(s).forEach(function(l){var u=s[l];u===!1?i.removeAttribute(l):i.setAttribute(l,u===!0?"":u)}))})}function SV(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var s=e.elements[r],i=e.attributes[r]||{},l=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),u=l.reduce(function(p,f){return p[f]="",p},{});!Ji(s)||!Xo(s)||(Object.assign(s.style,u),Object.keys(i).forEach(function(p){s.removeAttribute(p)}))})}}const CV={name:"applyStyles",enabled:!0,phase:"write",fn:bV,effect:SV,requires:["computeStyles"]};function Go(t){return t.split("-")[0]}var cu=Math.max,yv=Math.min,np=Math.round;function pC(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function wI(){return!/^((?!chrome|android).)*safari/i.test(pC())}function rp(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),s=1,i=1;e&&Ji(t)&&(s=t.offsetWidth>0&&np(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&np(r.height)/t.offsetHeight||1);var l=yu(t)?wi(t):window,u=l.visualViewport,p=!wI()&&n,f=(r.left+(p&&u?u.offsetLeft:0))/s,m=(r.top+(p&&u?u.offsetTop:0))/i,g=r.width/s,y=r.height/i;return{width:g,height:y,top:m,right:f+g,bottom:m+y,left:f,x:f,y:m}}function Yw(t){var e=rp(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function jI(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Jw(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function qa(t){return wi(t).getComputedStyle(t)}function wV(t){return["table","td","th"].indexOf(Xo(t))>=0}function mc(t){return((yu(t)?t.ownerDocument:t.document)||window.document).documentElement}function wx(t){return Xo(t)==="html"?t:t.assignedSlot||t.parentNode||(Jw(t)?t.host:null)||mc(t)}function jk(t){return!Ji(t)||qa(t).position==="fixed"?null:t.offsetParent}function jV(t){var e=/firefox/i.test(pC()),n=/Trident/i.test(pC());if(n&&Ji(t)){var r=qa(t);if(r.position==="fixed")return null}var s=wx(t);for(Jw(s)&&(s=s.host);Ji(s)&&["html","body"].indexOf(Xo(s))<0;){var i=qa(s);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return s;s=s.parentNode}return null}function wm(t){for(var e=wi(t),n=jk(t);n&&wV(n)&&qa(n).position==="static";)n=jk(n);return n&&(Xo(n)==="html"||Xo(n)==="body"&&qa(n).position==="static")?e:n||jV(t)||e}function Xw(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function sh(t,e,n){return cu(t,yv(e,n))}function TV(t,e,n){var r=sh(t,e,n);return r>n?n:r}function TI(){return{top:0,right:0,bottom:0,left:0}}function DI(t){return Object.assign({},TI(),t)}function EI(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var DV=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,DI(typeof e!="number"?e:EI(e,Cm))};function EV(t){var e,n=t.state,r=t.name,s=t.options,i=n.elements.arrow,l=n.modifiersData.popperOffsets,u=Go(n.placement),p=Xw(u),f=[Xs,Xi].indexOf(u)>=0,m=f?"height":"width";if(!(!i||!l)){var g=DV(s.padding,n),y=Yw(i),v=p==="y"?Ys:Xs,C=p==="y"?Yi:Xi,S=n.rects.reference[m]+n.rects.reference[p]-l[p]-n.rects.popper[m],j=l[p]-n.rects.reference[p],D=wm(i),M=D?p==="y"?D.clientHeight||0:D.clientWidth||0:0,T=S/2-j/2,E=g[v],k=M-y[m]-g[C],A=M/2-y[m]/2+T,O=sh(E,A,k),I=p;n.modifiersData[r]=(e={},e[I]=O,e.centerOffset=O-A,e)}}function RV(t){var e=t.state,n=t.options,r=n.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||jI(e.elements.popper,s)&&(e.elements.arrow=s))}const kV={name:"arrow",enabled:!0,phase:"main",fn:EV,effect:RV,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function sp(t){return t.split("-")[1]}var MV={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OV(t,e){var n=t.x,r=t.y,s=e.devicePixelRatio||1;return{x:np(n*s)/s||0,y:np(r*s)/s||0}}function Tk(t){var e,n=t.popper,r=t.popperRect,s=t.placement,i=t.variation,l=t.offsets,u=t.position,p=t.gpuAcceleration,f=t.adaptive,m=t.roundOffsets,g=t.isFixed,y=l.x,v=y===void 0?0:y,C=l.y,S=C===void 0?0:C,j=typeof m=="function"?m({x:v,y:S}):{x:v,y:S};v=j.x,S=j.y;var D=l.hasOwnProperty("x"),M=l.hasOwnProperty("y"),T=Xs,E=Ys,k=window;if(f){var A=wm(n),O="clientHeight",I="clientWidth";if(A===wi(n)&&(A=mc(n),qa(A).position!=="static"&&u==="absolute"&&(O="scrollHeight",I="scrollWidth")),A=A,s===Ys||(s===Xs||s===Xi)&&i===wh){E=Yi;var $=g&&A===k&&k.visualViewport?k.visualViewport.height:A[O];S-=$-r.height,S*=p?1:-1}if(s===Xs||(s===Ys||s===Yi)&&i===wh){T=Xi;var R=g&&A===k&&k.visualViewport?k.visualViewport.width:A[I];v-=R-r.width,v*=p?1:-1}}var P=Object.assign({position:u},f&&MV),z=m===!0?OV({x:v,y:S},wi(n)):{x:v,y:S};if(v=z.x,S=z.y,p){var N;return Object.assign({},P,(N={},N[E]=M?"0":"",N[T]=D?"0":"",N.transform=(k.devicePixelRatio||1)<=1?"translate("+v+"px, "+S+"px)":"translate3d("+v+"px, "+S+"px, 0)",N))}return Object.assign({},P,(e={},e[E]=M?S+"px":"",e[T]=D?v+"px":"",e.transform="",e))}function AV(t){var e=t.state,n=t.options,r=n.gpuAcceleration,s=r===void 0?!0:r,i=n.adaptive,l=i===void 0?!0:i,u=n.roundOffsets,p=u===void 0?!0:u,f={placement:Go(e.placement),variation:sp(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Tk(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:l,roundOffsets:p})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Tk(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:p})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const _V={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:AV,data:{}};var hy={passive:!0};function IV(t){var e=t.state,n=t.instance,r=t.options,s=r.scroll,i=s===void 0?!0:s,l=r.resize,u=l===void 0?!0:l,p=wi(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&f.forEach(function(m){m.addEventListener("scroll",n.update,hy)}),u&&p.addEventListener("resize",n.update,hy),function(){i&&f.forEach(function(m){m.removeEventListener("scroll",n.update,hy)}),u&&p.removeEventListener("resize",n.update,hy)}}const PV={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:IV,data:{}};var LV={left:"right",right:"left",bottom:"top",top:"bottom"};function Ky(t){return t.replace(/left|right|bottom|top/g,function(e){return LV[e]})}var zV={start:"end",end:"start"};function Dk(t){return t.replace(/start|end/g,function(e){return zV[e]})}function e2(t){var e=wi(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function t2(t){return rp(mc(t)).left+e2(t).scrollLeft}function $V(t,e){var n=wi(t),r=mc(t),s=n.visualViewport,i=r.clientWidth,l=r.clientHeight,u=0,p=0;if(s){i=s.width,l=s.height;var f=wI();(f||!f&&e==="fixed")&&(u=s.offsetLeft,p=s.offsetTop)}return{width:i,height:l,x:u+t2(t),y:p}}function NV(t){var e,n=mc(t),r=e2(t),s=(e=t.ownerDocument)==null?void 0:e.body,i=cu(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),l=cu(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),u=-r.scrollLeft+t2(t),p=-r.scrollTop;return qa(s||n).direction==="rtl"&&(u+=cu(n.clientWidth,s?s.clientWidth:0)-i),{width:i,height:l,x:u,y:p}}function n2(t){var e=qa(t),n=e.overflow,r=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+r)}function RI(t){return["html","body","#document"].indexOf(Xo(t))>=0?t.ownerDocument.body:Ji(t)&&n2(t)?t:RI(wx(t))}function ih(t,e){var n;e===void 0&&(e=[]);var r=RI(t),s=r===((n=t.ownerDocument)==null?void 0:n.body),i=wi(r),l=s?[i].concat(i.visualViewport||[],n2(r)?r:[]):r,u=e.concat(l);return s?u:u.concat(ih(wx(l)))}function fC(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function FV(t,e){var n=rp(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Ek(t,e,n){return e===SI?fC($V(t,n)):yu(e)?FV(e,n):fC(NV(mc(t)))}function BV(t){var e=ih(wx(t)),n=["absolute","fixed"].indexOf(qa(t).position)>=0,r=n&&Ji(t)?wm(t):t;return yu(r)?e.filter(function(s){return yu(s)&&jI(s,r)&&Xo(s)!=="body"}):[]}function UV(t,e,n,r){var s=e==="clippingParents"?BV(t):[].concat(e),i=[].concat(s,[n]),l=i[0],u=i.reduce(function(p,f){var m=Ek(t,f,r);return p.top=cu(m.top,p.top),p.right=yv(m.right,p.right),p.bottom=yv(m.bottom,p.bottom),p.left=cu(m.left,p.left),p},Ek(t,l,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function kI(t){var e=t.reference,n=t.element,r=t.placement,s=r?Go(r):null,i=r?sp(r):null,l=e.x+e.width/2-n.width/2,u=e.y+e.height/2-n.height/2,p;switch(s){case Ys:p={x:l,y:e.y-n.height};break;case Yi:p={x:l,y:e.y+e.height};break;case Xi:p={x:e.x+e.width,y:u};break;case Xs:p={x:e.x-n.width,y:u};break;default:p={x:e.x,y:e.y}}var f=s?Xw(s):null;if(f!=null){var m=f==="y"?"height":"width";switch(i){case tp:p[f]=p[f]-(e[m]/2-n[m]/2);break;case wh:p[f]=p[f]+(e[m]/2-n[m]/2);break}}return p}function jh(t,e){e===void 0&&(e={});var n=e,r=n.placement,s=r===void 0?t.placement:r,i=n.strategy,l=i===void 0?t.strategy:i,u=n.boundary,p=u===void 0?lV:u,f=n.rootBoundary,m=f===void 0?SI:f,g=n.elementContext,y=g===void 0?Rf:g,v=n.altBoundary,C=v===void 0?!1:v,S=n.padding,j=S===void 0?0:S,D=DI(typeof j!="number"?j:EI(j,Cm)),M=y===Rf?cV:Rf,T=t.rects.popper,E=t.elements[C?M:y],k=UV(yu(E)?E:E.contextElement||mc(t.elements.popper),p,m,l),A=rp(t.elements.reference),O=kI({reference:A,element:T,placement:s}),I=fC(Object.assign({},T,O)),$=y===Rf?I:A,R={top:k.top-$.top+D.top,bottom:$.bottom-k.bottom+D.bottom,left:k.left-$.left+D.left,right:$.right-k.right+D.right},P=t.modifiersData.offset;if(y===Rf&&P){var z=P[s];Object.keys(R).forEach(function(N){var H=[Xi,Yi].indexOf(N)>=0?1:-1,U=[Ys,Yi].indexOf(N)>=0?"y":"x";R[N]+=z[U]*H})}return R}function VV(t,e){e===void 0&&(e={});var n=e,r=n.placement,s=n.boundary,i=n.rootBoundary,l=n.padding,u=n.flipVariations,p=n.allowedAutoPlacements,f=p===void 0?CI:p,m=sp(r),g=m?u?wk:wk.filter(function(C){return sp(C)===m}):Cm,y=g.filter(function(C){return f.indexOf(C)>=0});y.length===0&&(y=g);var v=y.reduce(function(C,S){return C[S]=jh(t,{placement:S,boundary:s,rootBoundary:i,padding:l})[Go(S)],C},{});return Object.keys(v).sort(function(C,S){return v[C]-v[S]})}function HV(t){if(Go(t)===Qw)return[];var e=Ky(t);return[Dk(t),e,Dk(e)]}function WV(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var s=n.mainAxis,i=s===void 0?!0:s,l=n.altAxis,u=l===void 0?!0:l,p=n.fallbackPlacements,f=n.padding,m=n.boundary,g=n.rootBoundary,y=n.altBoundary,v=n.flipVariations,C=v===void 0?!0:v,S=n.allowedAutoPlacements,j=e.options.placement,D=Go(j),M=D===j,T=p||(M||!C?[Ky(j)]:HV(j)),E=[j].concat(T).reduce(function(te,de){return te.concat(Go(de)===Qw?VV(e,{placement:de,boundary:m,rootBoundary:g,padding:f,flipVariations:C,allowedAutoPlacements:S}):de)},[]),k=e.rects.reference,A=e.rects.popper,O=new Map,I=!0,$=E[0],R=0;R<E.length;R++){var P=E[R],z=Go(P),N=sp(P)===tp,H=[Ys,Yi].indexOf(z)>=0,U=H?"width":"height",L=jh(e,{placement:P,boundary:m,rootBoundary:g,altBoundary:y,padding:f}),W=H?N?Xi:Xs:N?Yi:Ys;k[U]>A[U]&&(W=Ky(W));var K=Ky(W),Q=[];if(i&&Q.push(L[z]<=0),u&&Q.push(L[W]<=0,L[K]<=0),Q.every(function(te){return te})){$=P,I=!1;break}O.set(P,Q)}if(I)for(var le=C?3:1,F=function(de){var fe=E.find(function(Re){var Pe=O.get(Re);if(Pe)return Pe.slice(0,de).every(function($e){return $e})});if(fe)return $=fe,"break"},J=le;J>0;J--){var ie=F(J);if(ie==="break")break}e.placement!==$&&(e.modifiersData[r]._skip=!0,e.placement=$,e.reset=!0)}}const qV={name:"flip",enabled:!0,phase:"main",fn:WV,requiresIfExists:["offset"],data:{_skip:!1}};function Rk(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function kk(t){return[Ys,Xi,Yi,Xs].some(function(e){return t[e]>=0})}function GV(t){var e=t.state,n=t.name,r=e.rects.reference,s=e.rects.popper,i=e.modifiersData.preventOverflow,l=jh(e,{elementContext:"reference"}),u=jh(e,{altBoundary:!0}),p=Rk(l,r),f=Rk(u,s,i),m=kk(p),g=kk(f);e.modifiersData[n]={referenceClippingOffsets:p,popperEscapeOffsets:f,isReferenceHidden:m,hasPopperEscaped:g},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":m,"data-popper-escaped":g})}const ZV={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:GV};function KV(t,e,n){var r=Go(t),s=[Xs,Ys].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,l=i[0],u=i[1];return l=l||0,u=(u||0)*s,[Xs,Xi].indexOf(r)>=0?{x:u,y:l}:{x:l,y:u}}function QV(t){var e=t.state,n=t.options,r=t.name,s=n.offset,i=s===void 0?[0,0]:s,l=CI.reduce(function(m,g){return m[g]=KV(g,e.rects,i),m},{}),u=l[e.placement],p=u.x,f=u.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=p,e.modifiersData.popperOffsets.y+=f),e.modifiersData[r]=l}const JV={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:QV};function YV(t){var e=t.state,n=t.name;e.modifiersData[n]=kI({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const XV={name:"popperOffsets",enabled:!0,phase:"read",fn:YV,data:{}};function e8(t){return t==="x"?"y":"x"}function t8(t){var e=t.state,n=t.options,r=t.name,s=n.mainAxis,i=s===void 0?!0:s,l=n.altAxis,u=l===void 0?!1:l,p=n.boundary,f=n.rootBoundary,m=n.altBoundary,g=n.padding,y=n.tether,v=y===void 0?!0:y,C=n.tetherOffset,S=C===void 0?0:C,j=jh(e,{boundary:p,rootBoundary:f,padding:g,altBoundary:m}),D=Go(e.placement),M=sp(e.placement),T=!M,E=Xw(D),k=e8(E),A=e.modifiersData.popperOffsets,O=e.rects.reference,I=e.rects.popper,$=typeof S=="function"?S(Object.assign({},e.rects,{placement:e.placement})):S,R=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,z={x:0,y:0};if(A){if(i){var N,H=E==="y"?Ys:Xs,U=E==="y"?Yi:Xi,L=E==="y"?"height":"width",W=A[E],K=W+j[H],Q=W-j[U],le=v?-I[L]/2:0,F=M===tp?O[L]:I[L],J=M===tp?-I[L]:-O[L],ie=e.elements.arrow,te=v&&ie?Yw(ie):{width:0,height:0},de=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:TI(),fe=de[H],Re=de[U],Pe=sh(0,O[L],te[L]),$e=T?O[L]/2-le-Pe-fe-R.mainAxis:F-Pe-fe-R.mainAxis,we=T?-O[L]/2+le+Pe+Re+R.mainAxis:J+Pe+Re+R.mainAxis,be=e.elements.arrow&&wm(e.elements.arrow),Ae=be?E==="y"?be.clientTop||0:be.clientLeft||0:0,Ne=(N=P==null?void 0:P[E])!=null?N:0,Ie=W+$e-Ne-Ae,Fe=W+we-Ne,ct=sh(v?yv(K,Ie):K,W,v?cu(Q,Fe):Q);A[E]=ct,z[E]=ct-W}if(u){var Me,tt=E==="x"?Ys:Xs,Ve=E==="x"?Yi:Xi,it=A[k],Z=k==="y"?"height":"width",q=it+j[tt],se=it-j[Ve],xe=[Ys,Xs].indexOf(D)!==-1,ee=(Me=P==null?void 0:P[k])!=null?Me:0,ne=xe?q:it-O[Z]-I[Z]-ee+R.altAxis,he=xe?it+O[Z]+I[Z]-ee-R.altAxis:se,je=v&&xe?TV(ne,it,he):sh(v?ne:q,it,v?he:se);A[k]=je,z[k]=je-it}e.modifiersData[r]=z}}const n8={name:"preventOverflow",enabled:!0,phase:"main",fn:t8,requiresIfExists:["offset"]};function r8(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function s8(t){return t===wi(t)||!Ji(t)?e2(t):r8(t)}function i8(t){var e=t.getBoundingClientRect(),n=np(e.width)/t.offsetWidth||1,r=np(e.height)/t.offsetHeight||1;return n!==1||r!==1}function o8(t,e,n){n===void 0&&(n=!1);var r=Ji(e),s=Ji(e)&&i8(e),i=mc(e),l=rp(t,s,n),u={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(r||!r&&!n)&&((Xo(e)!=="body"||n2(i))&&(u=s8(e)),Ji(e)?(p=rp(e,!0),p.x+=e.clientLeft,p.y+=e.clientTop):i&&(p.x=t2(i))),{x:l.left+u.scrollLeft-p.x,y:l.top+u.scrollTop-p.y,width:l.width,height:l.height}}function a8(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function s(i){n.add(i.name);var l=[].concat(i.requires||[],i.requiresIfExists||[]);l.forEach(function(u){if(!n.has(u)){var p=e.get(u);p&&s(p)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||s(i)}),r}function l8(t){var e=a8(t);return xV.reduce(function(n,r){return n.concat(e.filter(function(s){return s.phase===r}))},[])}function c8(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function u8(t){var e=t.reduce(function(n,r){var s=n[r.name];return n[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Mk={placement:"bottom",modifiers:[],strategy:"absolute"};function Ok(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function d8(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,s=e.defaultOptions,i=s===void 0?Mk:s;return function(u,p,f){f===void 0&&(f=i);var m={placement:"bottom",orderedModifiers:[],options:Object.assign({},Mk,i),modifiersData:{},elements:{reference:u,popper:p},attributes:{},styles:{}},g=[],y=!1,v={state:m,setOptions:function(D){var M=typeof D=="function"?D(m.options):D;S(),m.options=Object.assign({},i,m.options,M),m.scrollParents={reference:yu(u)?ih(u):u.contextElement?ih(u.contextElement):[],popper:ih(p)};var T=l8(u8([].concat(r,m.options.modifiers)));return m.orderedModifiers=T.filter(function(E){return E.enabled}),C(),v.update()},forceUpdate:function(){if(!y){var D=m.elements,M=D.reference,T=D.popper;if(Ok(M,T)){m.rects={reference:o8(M,wm(T),m.options.strategy==="fixed"),popper:Yw(T)},m.reset=!1,m.placement=m.options.placement,m.orderedModifiers.forEach(function(R){return m.modifiersData[R.name]=Object.assign({},R.data)});for(var E=0;E<m.orderedModifiers.length;E++){if(m.reset===!0){m.reset=!1,E=-1;continue}var k=m.orderedModifiers[E],A=k.fn,O=k.options,I=O===void 0?{}:O,$=k.name;typeof A=="function"&&(m=A({state:m,options:I,name:$,instance:v})||m)}}}},update:c8(function(){return new Promise(function(j){v.forceUpdate(),j(m)})}),destroy:function(){S(),y=!0}};if(!Ok(u,p))return v;v.setOptions(f).then(function(j){!y&&f.onFirstUpdate&&f.onFirstUpdate(j)});function C(){m.orderedModifiers.forEach(function(j){var D=j.name,M=j.options,T=M===void 0?{}:M,E=j.effect;if(typeof E=="function"){var k=E({state:m,name:D,instance:v,options:T}),A=function(){};g.push(k||A)}})}function S(){g.forEach(function(j){return j()}),g=[]}return v}}var p8=[PV,XV,_V,CV,JV,qV,n8,kV,ZV],f8=d8({defaultModifiers:p8});function h8(t){return typeof t=="function"?t():t}const MI=b.forwardRef(function(e,n){const{children:r,container:s,disablePortal:i=!1}=e,[l,u]=b.useState(null),p=cr(b.isValidElement(r)?fc(r):null,n);if(Cs(()=>{i||u(h8(s)||document.body)},[s,i]),Cs(()=>{if(l&&!i)return rC(n,l),()=>{rC(n,null)}},[n,l,i]),i){if(b.isValidElement(r)){const f={ref:p};return b.cloneElement(r,f)}return r}return l&&Ul.createPortal(r,l)});function m8(t){return Ze("MuiPopper",t)}et("MuiPopper",["root"]);function g8(t,e){if(e==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function hC(t){return typeof t=="function"?t():t}function y8(t){return t.nodeType!==void 0}const v8=t=>{const{classes:e}=t;return Ke({root:["root"]},m8,e)},x8={},b8=b.forwardRef(function(e,n){const{anchorEl:r,children:s,direction:i,disablePortal:l,modifiers:u,open:p,placement:f,popperOptions:m,popperRef:g,slotProps:y={},slots:v={},TransitionProps:C,ownerState:S,...j}=e,D=b.useRef(null),M=cr(D,n),T=b.useRef(null),E=cr(T,g),k=b.useRef(E);Cs(()=>{k.current=E},[E]),b.useImperativeHandle(g,()=>T.current,[]);const A=g8(f,i),[O,I]=b.useState(A),[$,R]=b.useState(hC(r));b.useEffect(()=>{T.current&&T.current.forceUpdate()}),b.useEffect(()=>{r&&R(hC(r))},[r]),Cs(()=>{if(!$||!p)return;const U=K=>{I(K.placement)};let L=[{name:"preventOverflow",options:{altBoundary:l}},{name:"flip",options:{altBoundary:l}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:K})=>{U(K)}}];u!=null&&(L=L.concat(u)),m&&m.modifiers!=null&&(L=L.concat(m.modifiers));const W=f8($,D.current,{placement:A,...m,modifiers:L});return k.current(W),()=>{W.destroy(),k.current(null)}},[$,l,u,p,m,A]);const P={placement:O};C!==null&&(P.TransitionProps=C);const z=v8(e),N=v.root??"div",H=Ms({elementType:N,externalSlotProps:y.root,externalForwardedProps:j,additionalProps:{role:"tooltip",ref:M},ownerState:e,className:z.root});return a.jsx(N,{...H,children:typeof s=="function"?s(P):s})}),S8=b.forwardRef(function(e,n){const{anchorEl:r,children:s,container:i,direction:l="ltr",disablePortal:u=!1,keepMounted:p=!1,modifiers:f,open:m,placement:g="bottom",popperOptions:y=x8,popperRef:v,style:C,transition:S=!1,slotProps:j={},slots:D={},...M}=e,[T,E]=b.useState(!0),k=()=>{E(!1)},A=()=>{E(!0)};if(!p&&!m&&(!S||T))return null;let O;if(i)O=i;else if(r){const R=hC(r);O=R&&y8(R)?Ir(R).body:Ir(null).body}const I=!m&&p&&(!S||T)?"none":void 0,$=S?{in:m,onEnter:k,onExited:A}:void 0;return a.jsx(MI,{disablePortal:u,container:O,children:a.jsx(b8,{anchorEl:r,direction:l,disablePortal:u,modifiers:f,ref:n,open:S?!T:m,placement:g,popperOptions:y,popperRef:v,slotProps:j,slots:D,...M,style:{position:"fixed",top:0,left:0,display:I,...C},TransitionProps:$,children:s})})}),C8=ce(S8,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),jx=b.forwardRef(function(e,n){const r=hc(),s=Qe({props:e,name:"MuiPopper"}),{anchorEl:i,component:l,components:u,componentsProps:p,container:f,disablePortal:m,keepMounted:g,modifiers:y,open:v,placement:C,popperOptions:S,popperRef:j,transition:D,slots:M,slotProps:T,...E}=s,k=(M==null?void 0:M.root)??(u==null?void 0:u.Root),A={anchorEl:i,container:f,disablePortal:m,keepMounted:g,modifiers:y,open:v,placement:C,popperOptions:S,popperRef:j,transition:D,...E};return a.jsx(C8,{as:l,direction:r?"rtl":"ltr",slots:{root:k},slotProps:T??p,...A,ref:n})});function w8(t){return Ze("MuiListSubheader",t)}et("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const j8=t=>{const{classes:e,color:n,disableGutters:r,inset:s,disableSticky:i}=t,l={root:["root",n!=="default"&&`color${ue(n)}`,!r&&"gutters",s&&"inset",!i&&"sticky"]};return Ke(l,w8,e)},T8=ce("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${ue(n.color)}`],!n.disableGutters&&e.gutters,n.inset&&e.inset,!n.disableSticky&&e.sticky]}})(Ue(({theme:t})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(t.vars||t).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:72}},{props:({ownerState:e})=>!e.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper}}]}))),mC=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiListSubheader"}),{className:s,color:i="default",component:l="li",disableGutters:u=!1,disableSticky:p=!1,inset:f=!1,...m}=r,g={...r,color:i,component:l,disableGutters:u,disableSticky:p,inset:f},y=j8(g);return a.jsx(T8,{as:l,className:Ce(y.root,s),ref:n,ownerState:g,...m})});mC&&(mC.muiSkipListHighlight=!0);const D8=ye(a.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function E8(t){return Ze("MuiChip",t)}const un=et("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),R8=t=>{const{classes:e,disabled:n,size:r,color:s,iconColor:i,onDelete:l,clickable:u,variant:p}=t,f={root:["root",p,n&&"disabled",`size${ue(r)}`,`color${ue(s)}`,u&&"clickable",u&&`clickableColor${ue(s)}`,l&&"deletable",l&&`deletableColor${ue(s)}`,`${p}${ue(s)}`],label:["label",`label${ue(r)}`],avatar:["avatar",`avatar${ue(r)}`,`avatarColor${ue(s)}`],icon:["icon",`icon${ue(r)}`,`iconColor${ue(i)}`],deleteIcon:["deleteIcon",`deleteIcon${ue(r)}`,`deleteIconColor${ue(s)}`,`deleteIcon${ue(p)}Color${ue(s)}`]};return Ke(f,E8,e)},k8=ce("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:s,clickable:i,onDelete:l,size:u,variant:p}=n;return[{[`& .${un.avatar}`]:e.avatar},{[`& .${un.avatar}`]:e[`avatar${ue(u)}`]},{[`& .${un.avatar}`]:e[`avatarColor${ue(r)}`]},{[`& .${un.icon}`]:e.icon},{[`& .${un.icon}`]:e[`icon${ue(u)}`]},{[`& .${un.icon}`]:e[`iconColor${ue(s)}`]},{[`& .${un.deleteIcon}`]:e.deleteIcon},{[`& .${un.deleteIcon}`]:e[`deleteIcon${ue(u)}`]},{[`& .${un.deleteIcon}`]:e[`deleteIconColor${ue(r)}`]},{[`& .${un.deleteIcon}`]:e[`deleteIcon${ue(p)}Color${ue(r)}`]},e.root,e[`size${ue(u)}`],e[`color${ue(r)}`],i&&e.clickable,i&&r!=="default"&&e[`clickableColor${ue(r)})`],l&&e.deletable,l&&r!=="default"&&e[`deletableColor${ue(r)}`],e[p],e[`${p}${ue(r)}`]]}})(Ue(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return{maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${un.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${un.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:e,fontSize:t.typography.pxToRem(12)},[`& .${un.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${un.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${un.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${un.icon}`]:{marginLeft:5,marginRight:-6},[`& .${un.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:wt(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:wt(t.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${un.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${un.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(t.palette).filter(bn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(t.vars||t).palette[n].main,color:(t.vars||t).palette[n].contrastText,[`& .${un.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].contrastTextChannel} / 0.7)`:wt(t.palette[n].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${un.icon}`]:{color:t.vars?t.vars.palette.Chip.defaultIconColor:e}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${un.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${un.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:wt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}},...Object.entries(t.palette).filter(bn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${un.focusVisible}`]:{background:(t.vars||t).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:wt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${un.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:wt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}}},...Object.entries(t.palette).filter(bn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${un.focusVisible}`]:{backgroundColor:(t.vars||t).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${un.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${un.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${un.avatar}`]:{marginLeft:4},[`& .${un.avatarSmall}`]:{marginLeft:2},[`& .${un.icon}`]:{marginLeft:4},[`& .${un.iconSmall}`]:{marginLeft:2},[`& .${un.deleteIcon}`]:{marginRight:5},[`& .${un.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(t.palette).filter(bn()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(t.vars||t).palette[n].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:wt(t.palette[n].main,.7)}`,[`&.${un.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette[n].main,t.palette.action.hoverOpacity)},[`&.${un.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.focusOpacity})`:wt(t.palette[n].main,t.palette.action.focusOpacity)},[`& .${un.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:wt(t.palette[n].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].main}}}}))]}})),M8=ce("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${ue(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function Ak(t){return t.key==="Backspace"||t.key==="Delete"}const Ht=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiChip"}),{avatar:s,className:i,clickable:l,color:u="default",component:p,deleteIcon:f,disabled:m=!1,icon:g,label:y,onClick:v,onDelete:C,onKeyDown:S,onKeyUp:j,size:D="medium",variant:M="filled",tabIndex:T,skipFocusWhenDisabled:E=!1,...k}=r,A=b.useRef(null),O=cr(A,n),I=Q=>{Q.stopPropagation(),C&&C(Q)},$=Q=>{Q.currentTarget===Q.target&&Ak(Q)&&Q.preventDefault(),S&&S(Q)},R=Q=>{Q.currentTarget===Q.target&&C&&Ak(Q)&&C(Q),j&&j(Q)},P=l!==!1&&v?!0:l,z=P||C?Ls:p||"div",N={...r,component:z,disabled:m,size:D,color:u,iconColor:b.isValidElement(g)&&g.props.color||u,onDelete:!!C,clickable:P,variant:M},H=R8(N),U=z===Ls?{component:p||"div",focusVisibleClassName:H.focusVisible,...C&&{disableRipple:!0}}:{};let L=null;C&&(L=f&&b.isValidElement(f)?b.cloneElement(f,{className:Ce(f.props.className,H.deleteIcon),onClick:I}):a.jsx(D8,{className:Ce(H.deleteIcon),onClick:I}));let W=null;s&&b.isValidElement(s)&&(W=b.cloneElement(s,{className:Ce(H.avatar,s.props.className)}));let K=null;return g&&b.isValidElement(g)&&(K=b.cloneElement(g,{className:Ce(H.icon,g.props.className)})),a.jsxs(k8,{as:z,className:Ce(H.root,i),disabled:P&&m?!0:void 0,onClick:v,onKeyDown:$,onKeyUp:R,ref:O,tabIndex:E&&m?-1:T,ownerState:N,...U,...k,children:[W||K,a.jsx(M8,{className:Ce(H.label),ownerState:N,children:y}),L]})});function my(t){return parseInt(t,10)||0}const O8={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function A8(t){for(const e in t)return!1;return!0}function _k(t){return A8(t)||t.outerHeightStyle===0&&!t.overflowing}const _8=b.forwardRef(function(e,n){const{onChange:r,maxRows:s,minRows:i=1,style:l,value:u,...p}=e,{current:f}=b.useRef(u!=null),m=b.useRef(null),g=cr(n,m),y=b.useRef(null),v=b.useRef(null),C=b.useCallback(()=>{const T=m.current,E=v.current;if(!T||!E)return;const A=Ci(T).getComputedStyle(T);if(A.width==="0px")return{outerHeightStyle:0,overflowing:!1};E.style.width=A.width,E.value=T.value||e.placeholder||"x",E.value.slice(-1)===`
|
|
222
|
+
`&&(E.value+=" ");const O=A.boxSizing,I=my(A.paddingBottom)+my(A.paddingTop),$=my(A.borderBottomWidth)+my(A.borderTopWidth),R=E.scrollHeight;E.value="x";const P=E.scrollHeight;let z=R;i&&(z=Math.max(Number(i)*P,z)),s&&(z=Math.min(Number(s)*P,z)),z=Math.max(z,P);const N=z+(O==="border-box"?I+$:0),H=Math.abs(z-R)<=1;return{outerHeightStyle:N,overflowing:H}},[s,i,e.placeholder]),S=Dr(()=>{const T=m.current,E=C();if(!T||!E||_k(E))return!1;const k=E.outerHeightStyle;return y.current!=null&&y.current!==k}),j=b.useCallback(()=>{const T=m.current,E=C();if(!T||!E||_k(E))return;const k=E.outerHeightStyle;y.current!==k&&(y.current=k,T.style.height=`${k}px`),T.style.overflow=E.overflowing?"hidden":""},[C]),D=b.useRef(-1);Cs(()=>{const T=Sm(j),E=m==null?void 0:m.current;if(!E)return;const k=Ci(E);k.addEventListener("resize",T);let A;return typeof ResizeObserver<"u"&&(A=new ResizeObserver(()=>{S()&&(A.unobserve(E),cancelAnimationFrame(D.current),j(),D.current=requestAnimationFrame(()=>{A.observe(E)}))}),A.observe(E)),()=>{T.clear(),cancelAnimationFrame(D.current),k.removeEventListener("resize",T),A&&A.disconnect()}},[C,j,S]),Cs(()=>{j()});const M=T=>{f||j(),r&&r(T)};return a.jsxs(b.Fragment,{children:[a.jsx("textarea",{value:u,onChange:M,ref:g,rows:i,style:l,...p}),a.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:v,tabIndex:-1,style:{...O8.shadow,...l,paddingTop:0,paddingBottom:0}})]})});function Ua(t){return typeof t=="string"}function gc({props:t,states:e,muiFormControl:n}){return e.reduce((r,s)=>(r[s]=t[s],n&&typeof t[s]>"u"&&(r[s]=n[s]),r),{})}const Tx=b.createContext(void 0);function Ao(){return b.useContext(Tx)}function Ik(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function vv(t,e=!1){return t&&(Ik(t.value)&&t.value!==""||e&&Ik(t.defaultValue)&&t.defaultValue!=="")}function I8(t){return t.startAdornment}function P8(t){return Ze("MuiInputBase",t)}const fi=et("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Pk;const Dx=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${ue(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},Ex=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},L8=t=>{const{classes:e,color:n,disabled:r,error:s,endAdornment:i,focused:l,formControl:u,fullWidth:p,hiddenLabel:f,multiline:m,readOnly:g,size:y,startAdornment:v,type:C}=t,S={root:["root",`color${ue(n)}`,r&&"disabled",s&&"error",p&&"fullWidth",l&&"focused",u&&"formControl",y&&y!=="medium"&&`size${ue(y)}`,m&&"multiline",v&&"adornedStart",i&&"adornedEnd",f&&"hiddenLabel",g&&"readOnly"],input:["input",r&&"disabled",C==="search"&&"inputTypeSearch",m&&"inputMultiline",y==="small"&&"inputSizeSmall",f&&"inputHiddenLabel",v&&"inputAdornedStart",i&&"inputAdornedEnd",g&&"readOnly"]};return Ke(S,P8,e)},Rx=ce("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Dx})(Ue(({theme:t})=>({...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${fi.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:n})=>e.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),kx=ce("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Ex})(Ue(({theme:t})=>{const e=t.palette.mode==="light",n={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},r={opacity:"0 !important"},s=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${fi.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":s,"&:focus::-moz-placeholder":s,"&:focus::-ms-input-placeholder":s},[`&.${fi.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:({ownerState:i})=>!i.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:i})=>i.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Lk=Ww({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),r2=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiInputBase"}),{"aria-describedby":s,autoComplete:i,autoFocus:l,className:u,color:p,components:f={},componentsProps:m={},defaultValue:g,disabled:y,disableInjectingGlobalStyles:v,endAdornment:C,error:S,fullWidth:j=!1,id:D,inputComponent:M="input",inputProps:T={},inputRef:E,margin:k,maxRows:A,minRows:O,multiline:I=!1,name:$,onBlur:R,onChange:P,onClick:z,onFocus:N,onKeyDown:H,onKeyUp:U,placeholder:L,readOnly:W,renderSuffix:K,rows:Q,size:le,slotProps:F={},slots:J={},startAdornment:ie,type:te="text",value:de,...fe}=r,Re=T.value!=null?T.value:de,{current:Pe}=b.useRef(Re!=null),$e=b.useRef(),we=b.useCallback(Be=>{},[]),be=cr($e,E,T.ref,we),[Ae,Ne]=b.useState(!1),Ie=Ao(),Fe=gc({props:r,muiFormControl:Ie,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Fe.focused=Ie?Ie.focused:Ae,b.useEffect(()=>{!Ie&&y&&Ae&&(Ne(!1),R&&R())},[Ie,y,Ae,R]);const ct=Ie&&Ie.onFilled,Me=Ie&&Ie.onEmpty,tt=b.useCallback(Be=>{vv(Be)?ct&&ct():Me&&Me()},[ct,Me]);Cs(()=>{Pe&&tt({value:Re})},[Re,tt,Pe]);const Ve=Be=>{N&&N(Be),T.onFocus&&T.onFocus(Be),Ie&&Ie.onFocus?Ie.onFocus(Be):Ne(!0)},it=Be=>{R&&R(Be),T.onBlur&&T.onBlur(Be),Ie&&Ie.onBlur?Ie.onBlur(Be):Ne(!1)},Z=(Be,...xt)=>{if(!Pe){const vt=Be.target||$e.current;if(vt==null)throw new Error(Wa(1));tt({value:vt.value})}T.onChange&&T.onChange(Be,...xt),P&&P(Be,...xt)};b.useEffect(()=>{tt($e.current)},[]);const q=Be=>{$e.current&&Be.currentTarget===Be.target&&$e.current.focus(),z&&z(Be)};let se=M,xe=T;I&&se==="input"&&(Q?xe={type:void 0,minRows:Q,maxRows:Q,...xe}:xe={type:void 0,maxRows:A,minRows:O,...xe},se=_8);const ee=Be=>{tt(Be.animationName==="mui-auto-fill-cancel"?$e.current:{value:"x"})};b.useEffect(()=>{Ie&&Ie.setAdornedStart(!!ie)},[Ie,ie]);const ne={...r,color:Fe.color||"primary",disabled:Fe.disabled,endAdornment:C,error:Fe.error,focused:Fe.focused,formControl:Ie,fullWidth:j,hiddenLabel:Fe.hiddenLabel,multiline:I,size:Fe.size,startAdornment:ie,type:te},he=L8(ne),je=J.root||f.Root||Rx,ze=F.root||m.root||{},ke=J.input||f.Input||kx;return xe={...xe,...F.input??m.input},a.jsxs(b.Fragment,{children:[!v&&typeof Lk=="function"&&(Pk||(Pk=a.jsx(Lk,{}))),a.jsxs(je,{...ze,ref:n,onClick:q,...fe,...!Ua(je)&&{ownerState:{...ne,...ze.ownerState}},className:Ce(he.root,ze.className,u,W&&"MuiInputBase-readOnly"),children:[ie,a.jsx(Tx.Provider,{value:null,children:a.jsx(ke,{"aria-invalid":Fe.error,"aria-describedby":s,autoComplete:i,autoFocus:l,defaultValue:g,disabled:Fe.disabled,id:D,onAnimationStart:ee,name:$,placeholder:L,readOnly:W,required:Fe.required,rows:Q,value:Re,onKeyDown:H,onKeyUp:U,type:te,...xe,...!Ua(ke)&&{as:se,ownerState:{...ne,...xe.ownerState}},ref:be,className:Ce(he.input,xe.className,W&&"MuiInputBase-readOnly"),onBlur:it,onChange:Z,onFocus:Ve})}),C,K?K({...Fe,startAdornment:ie}):null]})]})});function z8(t){return Ze("MuiInput",t)}const kl={...fi,...et("MuiInput",["root","underline","input"])};function $8(t){return Ze("MuiOutlinedInput",t)}const Bi={...fi,...et("MuiOutlinedInput",["root","notchedOutline","input"])};function N8(t){return Ze("MuiFilledInput",t)}const hi={...fi,...et("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},OI=ye(a.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function F8(t){return Ze("MuiAutocomplete",t)}const en=et("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var zk,$k;const B8=t=>{const{classes:e,disablePortal:n,expanded:r,focused:s,fullWidth:i,hasClearIcon:l,hasPopupIcon:u,inputFocused:p,popupOpen:f,size:m}=t,g={root:["root",r&&"expanded",s&&"focused",i&&"fullWidth",l&&"hasClearIcon",u&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",p&&"inputFocused"],tag:["tag",`tagSize${ue(m)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",f&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ke(g,F8,e)},U8=ce("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{fullWidth:r,hasClearIcon:s,hasPopupIcon:i,inputFocused:l,size:u}=n;return[{[`& .${en.tag}`]:e.tag},{[`& .${en.tag}`]:e[`tagSize${ue(u)}`]},{[`& .${en.inputRoot}`]:e.inputRoot},{[`& .${en.input}`]:e.input},{[`& .${en.input}`]:l&&e.inputFocused},e.root,r&&e.fullWidth,i&&e.hasPopupIcon,s&&e.hasClearIcon]}})({[`&.${en.focused} .${en.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${en.clearIndicator}`]:{visibility:"visible"}},[`& .${en.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${en.inputRoot}`]:{[`.${en.hasPopupIcon}&, .${en.hasClearIcon}&`]:{paddingRight:30},[`.${en.hasPopupIcon}.${en.hasClearIcon}&`]:{paddingRight:56},[`& .${en.input}`]:{width:0,minWidth:30}},[`& .${kl.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${kl.root}.${fi.sizeSmall}`]:{[`& .${kl.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Bi.root}`]:{padding:9,[`.${en.hasPopupIcon}&, .${en.hasClearIcon}&`]:{paddingRight:39},[`.${en.hasPopupIcon}.${en.hasClearIcon}&`]:{paddingRight:65},[`& .${en.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${en.endAdornment}`]:{right:9}},[`& .${Bi.root}.${fi.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${en.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${hi.root}`]:{paddingTop:19,paddingLeft:8,[`.${en.hasPopupIcon}&, .${en.hasClearIcon}&`]:{paddingRight:39},[`.${en.hasPopupIcon}.${en.hasClearIcon}&`]:{paddingRight:65},[`& .${hi.input}`]:{padding:"7px 4px"},[`& .${en.endAdornment}`]:{right:9}},[`& .${hi.root}.${fi.sizeSmall}`]:{paddingBottom:1,[`& .${hi.input}`]:{padding:"2.5px 4px"}},[`& .${fi.hiddenLabel}`]:{paddingTop:8},[`& .${hi.root}.${fi.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${en.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${hi.root}.${fi.hiddenLabel}.${fi.sizeSmall}`]:{[`& .${en.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${en.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${en.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${en.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${en.inputRoot}`]:{flexWrap:"wrap"}}}]}),V8=ce("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,e)=>e.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),H8=ce(ft,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,e)=>e.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),W8=ce(ft,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.popupIndicator,n.popupOpen&&e.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),q8=ce(jx,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${en.option}`]:e.option},e.popper,n.disablePortal&&e.popperDisablePortal]}})(Ue(({theme:t})=>({zIndex:(t.vars||t).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),G8=ce($t,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,e)=>e.paper})(Ue(({theme:t})=>({...t.typography.body1,overflow:"auto"}))),Z8=ce("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,e)=>e.loading})(Ue(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}))),K8=ce("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})(Ue(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}))),Q8=ce("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(Ue(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${en.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${en.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${en.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${en.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:wt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${en.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:wt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}}))),J8=ce(mC,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,e)=>e.groupLabel})(Ue(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8}))),Y8=ce("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,e)=>e.groupUl})({padding:0,[`& .${en.option}`]:{paddingLeft:24}}),bu=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiAutocomplete"}),{autoComplete:s=!1,autoHighlight:i=!1,autoSelect:l=!1,blurOnSelect:u=!1,ChipProps:p,className:f,clearIcon:m=zk||(zk=a.jsx(xI,{fontSize:"small"})),clearOnBlur:g=!r.freeSolo,clearOnEscape:y=!1,clearText:v="Clear",closeText:C="Close",componentsProps:S,defaultValue:j=r.multiple?[]:null,disableClearable:D=!1,disableCloseOnSelect:M=!1,disabled:T=!1,disabledItemsFocusable:E=!1,disableListWrap:k=!1,disablePortal:A=!1,filterOptions:O,filterSelectedOptions:I=!1,forcePopupIcon:$="auto",freeSolo:R=!1,fullWidth:P=!1,getLimitTagsText:z=on=>`+${on}`,getOptionDisabled:N,getOptionKey:H,getOptionLabel:U,isOptionEqualToValue:L,groupBy:W,handleHomeEndKeys:K=!r.freeSolo,id:Q,includeInputInList:le=!1,inputValue:F,limitTags:J=-1,ListboxComponent:ie,ListboxProps:te,loading:de=!1,loadingText:fe="Loading…",multiple:Re=!1,noOptionsText:Pe="No options",onChange:$e,onClose:we,onHighlightChange:be,onInputChange:Ae,onOpen:Ne,open:Ie,openOnFocus:Fe=!1,openText:ct="Open",options:Me,PaperComponent:tt,PopperComponent:Ve,popupIcon:it=$k||($k=a.jsx(OI,{})),readOnly:Z=!1,renderGroup:q,renderInput:se,renderOption:xe,renderTags:ee,selectOnFocus:ne=!r.freeSolo,size:he="medium",slots:je={},slotProps:ze={},value:ke,...Be}=r,{getRootProps:xt,getInputProps:vt,getInputLabelProps:kt,getPopupIndicatorProps:Ge,getClearProps:gt,getTagProps:dn,getListboxProps:$n,getOptionProps:dr,value:tr,dirty:Lr,expanded:jt,id:_t,popupOpen:an,focused:Vn,focusedTag:Sn,anchorEl:ht,setAnchorEl:Tn,inputValue:Je,groupedOptions:Ye}=aV({...r,componentName:"Autocomplete"}),It=!D&&!T&&Lr&&!Z,Mt=(!R||$===!0)&&$!==!1,{onMouseDown:sn}=vt(),{ref:pr,...Rr}=$n(),cs=U||(on=>on.label??on),Cn={...r,disablePortal:A,expanded:jt,focused:Vn,fullWidth:P,getOptionLabel:cs,hasClearIcon:It,hasPopupIcon:Mt,inputFocused:Sn===-1,popupOpen:an,size:he},pn=B8(Cn),sr={slots:{paper:tt,popper:Ve,...je},slotProps:{chip:p,listbox:te,...S,...ze}},[oo,Oe]=at("listbox",{elementType:Q8,externalForwardedProps:sr,ownerState:Cn,className:pn.listbox,additionalProps:Rr,ref:pr}),[Ee,dt]=at("paper",{elementType:$t,externalForwardedProps:sr,ownerState:Cn,className:pn.paper}),[Ut,Wt]=at("popper",{elementType:jx,externalForwardedProps:sr,ownerState:Cn,className:pn.popper,additionalProps:{disablePortal:A,style:{width:ht?ht.clientWidth:null},role:"presentation",anchorEl:ht,open:an}});let kn;if(Re&&tr.length>0){const on=us=>({className:pn.tag,disabled:T,...dn(us)});ee?kn=ee(tr,on,Cn):kn=tr.map((us,_o)=>{const{key:Qa,...Hm}=on({index:_o});return a.jsx(Ht,{label:cs(us),size:he,...Hm,...sr.slotProps.chip},Qa)})}if(J>-1&&Array.isArray(kn)){const on=kn.length-J;!Vn&&on>0&&(kn=kn.splice(0,J),kn.push(a.jsx("span",{className:pn.tag,children:z(on)},kn.length)))}const Zr=q||(on=>a.jsxs("li",{children:[a.jsx(J8,{className:pn.groupLabel,ownerState:Cn,component:"div",children:on.group}),a.jsx(Y8,{className:pn.groupUl,ownerState:Cn,children:on.children})]},on.key)),Ka=xe||((on,us)=>{const{key:_o,...Qa}=on;return a.jsx("li",{...Qa,children:cs(us)},_o)}),Mr=(on,us)=>{const _o=dr({option:on,index:us});return Ka({..._o,className:pn.option},on,{selected:_o["aria-selected"],index:us,inputValue:Je},Cn)},xc=sr.slotProps.clearIndicator,bc=sr.slotProps.popupIndicator;return a.jsxs(b.Fragment,{children:[a.jsx(U8,{ref:n,className:Ce(pn.root,f),ownerState:Cn,...xt(Be),children:se({id:_t,disabled:T,fullWidth:!0,size:he==="small"?"small":void 0,InputLabelProps:kt(),InputProps:{ref:Tn,className:pn.inputRoot,startAdornment:kn,onMouseDown:on=>{on.target===on.currentTarget&&sn(on)},...(It||Mt)&&{endAdornment:a.jsxs(V8,{className:pn.endAdornment,ownerState:Cn,children:[It?a.jsx(H8,{...gt(),"aria-label":v,title:v,ownerState:Cn,...xc,className:Ce(pn.clearIndicator,xc==null?void 0:xc.className),children:m}):null,Mt?a.jsx(W8,{...Ge(),disabled:T,"aria-label":an?C:ct,title:an?C:ct,ownerState:Cn,...bc,className:Ce(pn.popupIndicator,bc==null?void 0:bc.className),children:it}):null]})}},inputProps:{className:pn.input,disabled:T,readOnly:Z,...vt()}})}),ht?a.jsx(q8,{as:Ut,...Wt,children:a.jsxs(G8,{as:Ee,...dt,children:[de&&Ye.length===0?a.jsx(Z8,{className:pn.loading,ownerState:Cn,children:fe}):null,Ye.length===0&&!R&&!de?a.jsx(K8,{className:pn.noOptions,ownerState:Cn,role:"presentation",onMouseDown:on=>{on.preventDefault()},children:Pe}):null,Ye.length>0?a.jsx(oo,{as:ie,...Oe,children:Ye.map((on,us)=>W?Zr({key:on.key,group:on.group,children:on.options.map((_o,Qa)=>Mr(_o,on.index+Qa))}):Mr(on,us))}):null]})}):null]})}),X8=ye(a.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function e7(t){return Ze("MuiAvatar",t)}et("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const t7=t=>{const{classes:e,variant:n,colorDefault:r}=t;return Ke({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},e7,e)},n7=ce("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],n.colorDefault&&e.colorDefault]}})(Ue(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(t.vars||t).palette.background.default,...t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:{backgroundColor:t.palette.grey[400],...t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})}}}]}))),r7=ce("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),s7=ce(X8,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function i7({crossOrigin:t,referrerPolicy:e,src:n,srcSet:r}){const[s,i]=b.useState(!1);return b.useEffect(()=>{if(!n&&!r)return;i(!1);let l=!0;const u=new Image;return u.onload=()=>{l&&i("loaded")},u.onerror=()=>{l&&i("error")},u.crossOrigin=t,u.referrerPolicy=e,u.src=n,r&&(u.srcset=r),()=>{l=!1}},[t,e,n,r]),s}const o7=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiAvatar"}),{alt:s,children:i,className:l,component:u="div",slots:p={},slotProps:f={},imgProps:m,sizes:g,src:y,srcSet:v,variant:C="circular",...S}=r;let j=null;const D={...r,component:u,variant:C},M=i7({...m,...typeof f.img=="function"?f.img(D):f.img,src:y,srcSet:v}),T=y||v,E=T&&M!=="error";D.colorDefault=!E,delete D.ownerState;const k=t7(D),[A,O]=at("img",{className:k.img,elementType:r7,externalForwardedProps:{slots:p,slotProps:{img:{...m,...f.img}}},additionalProps:{alt:s,src:y,srcSet:v,sizes:g},ownerState:D});return E?j=a.jsx(A,{...O}):i||i===0?j=i:T&&s?j=s[0]:j=a.jsx(s7,{ownerState:D,className:k.fallback}),a.jsx(n7,{as:u,className:Ce(k.root,l),ref:n,...S,ownerState:D,children:j})}),a7={entering:{opacity:1},entered:{opacity:1}},gC=b.forwardRef(function(e,n){const r=vr(),s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:l=!0,children:u,easing:p,in:f,onEnter:m,onEntered:g,onEntering:y,onExit:v,onExited:C,onExiting:S,style:j,timeout:D=s,TransitionComponent:M=so,...T}=e,E=b.useRef(null),k=cr(E,fc(u),n),A=H=>U=>{if(H){const L=E.current;U===void 0?H(L):H(L,U)}},O=A(y),I=A((H,U)=>{Kw(H);const L=rc({style:j,timeout:D,easing:p},{mode:"enter"});H.style.webkitTransition=r.transitions.create("opacity",L),H.style.transition=r.transitions.create("opacity",L),m&&m(H,U)}),$=A(g),R=A(S),P=A(H=>{const U=rc({style:j,timeout:D,easing:p},{mode:"exit"});H.style.webkitTransition=r.transitions.create("opacity",U),H.style.transition=r.transitions.create("opacity",U),v&&v(H)}),z=A(C),N=H=>{i&&i(E.current,H)};return a.jsx(M,{appear:l,in:f,nodeRef:E,onEnter:I,onEntered:$,onEntering:O,onExit:P,onExited:z,onExiting:R,addEndListener:N,timeout:D,...T,children:(H,{ownerState:U,...L})=>b.cloneElement(u,{style:{opacity:0,visibility:H==="exited"&&!f?"hidden":void 0,...a7[H],...j,...u.props.style},ref:k,...L})})});function l7(t){return Ze("MuiBackdrop",t)}et("MuiBackdrop",["root","invisible"]);const c7=t=>{const{classes:e,invisible:n}=t;return Ke({root:["root",n&&"invisible"]},l7,e)},u7=ce("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),Mx=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiBackdrop"}),{children:s,className:i,component:l="div",invisible:u=!1,open:p,components:f={},componentsProps:m={},slotProps:g={},slots:y={},TransitionComponent:v,transitionDuration:C,...S}=r,j={...r,component:l,invisible:u},D=c7(j),M={transition:v,root:f.Root,...y},T={...m,...g},E={slots:M,slotProps:T},[k,A]=at("root",{elementType:u7,externalForwardedProps:E,className:Ce(D.root,i),ownerState:j}),[O,I]=at("transition",{elementType:gC,externalForwardedProps:E,ownerState:j});return a.jsx(O,{in:p,timeout:C,...S,...I,children:a.jsx(k,{"aria-hidden":!0,...A,classes:D,ref:n,children:s})})});function d7(t){const{badgeContent:e,invisible:n=!1,max:r=99,showZero:s=!1}=t,i=Nw({badgeContent:e,max:r});let l=n;n===!1&&e===0&&!s&&(l=!0);const{badgeContent:u,max:p=r}=l?i:t,f=u&&Number(u)>p?`${p}+`:u;return{badgeContent:u,invisible:l,max:p,displayValue:f}}function p7(t){return Ze("MuiBadge",t)}const Sl=et("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),HS=10,WS=4,f7=t=>{const{color:e,anchorOrigin:n,invisible:r,overlap:s,variant:i,classes:l={}}=t,u={root:["root"],badge:["badge",i,r&&"invisible",`anchorOrigin${ue(n.vertical)}${ue(n.horizontal)}`,`anchorOrigin${ue(n.vertical)}${ue(n.horizontal)}${ue(s)}`,`overlap${ue(s)}`,e!=="default"&&`color${ue(e)}`]};return Ke(u,p7,l)},h7=ce("span",{name:"MuiBadge",slot:"Root",overridesResolver:(t,e)=>e.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),m7=ce("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.badge,e[n.variant],e[`anchorOrigin${ue(n.anchorOrigin.vertical)}${ue(n.anchorOrigin.horizontal)}${ue(n.overlap)}`],n.color!=="default"&&e[`color${ue(n.color)}`],n.invisible&&e.invisible]}})(Ue(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(12),minWidth:HS*2,lineHeight:1,padding:"0 6px",height:HS*2,borderRadius:HS,zIndex:1,transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.enteringScreen}),variants:[...Object.entries(t.palette).filter(bn(["contrastText"])).map(([e])=>({props:{color:e},style:{backgroundColor:(t.vars||t).palette[e].main,color:(t.vars||t).palette[e].contrastText}})),{props:{variant:"dot"},style:{borderRadius:WS,height:WS*2,minWidth:WS*2,padding:0}},{props:({ownerState:e})=>e.anchorOrigin.vertical==="top"&&e.anchorOrigin.horizontal==="right"&&e.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${Sl.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:e})=>e.anchorOrigin.vertical==="bottom"&&e.anchorOrigin.horizontal==="right"&&e.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${Sl.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:e})=>e.anchorOrigin.vertical==="top"&&e.anchorOrigin.horizontal==="left"&&e.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${Sl.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:e})=>e.anchorOrigin.vertical==="bottom"&&e.anchorOrigin.horizontal==="left"&&e.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${Sl.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:e})=>e.anchorOrigin.vertical==="top"&&e.anchorOrigin.horizontal==="right"&&e.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${Sl.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:e})=>e.anchorOrigin.vertical==="bottom"&&e.anchorOrigin.horizontal==="right"&&e.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${Sl.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:e})=>e.anchorOrigin.vertical==="top"&&e.anchorOrigin.horizontal==="left"&&e.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${Sl.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:e})=>e.anchorOrigin.vertical==="bottom"&&e.anchorOrigin.horizontal==="left"&&e.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${Sl.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.leavingScreen})}}]})));function Nk(t){return{vertical:(t==null?void 0:t.vertical)??"top",horizontal:(t==null?void 0:t.horizontal)??"right"}}const xv=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiBadge"}),{anchorOrigin:s,className:i,classes:l,component:u,components:p={},componentsProps:f={},children:m,overlap:g="rectangular",color:y="default",invisible:v=!1,max:C=99,badgeContent:S,slots:j,slotProps:D,showZero:M=!1,variant:T="standard",...E}=r,{badgeContent:k,invisible:A,max:O,displayValue:I}=d7({max:C,invisible:v,badgeContent:S,showZero:M}),$=Nw({anchorOrigin:Nk(s),color:y,overlap:g,variant:T,badgeContent:S}),R=A||k==null&&T!=="dot",{color:P=y,overlap:z=g,anchorOrigin:N,variant:H=T}=R?$:r,U=Nk(N),L=H!=="dot"?I:void 0,W={...r,badgeContent:k,invisible:R,max:O,displayValue:L,showZero:M,anchorOrigin:U,color:P,overlap:z,variant:H},K=f7(W),Q={slots:{root:(j==null?void 0:j.root)??p.Root,badge:(j==null?void 0:j.badge)??p.Badge},slotProps:{root:(D==null?void 0:D.root)??f.root,badge:(D==null?void 0:D.badge)??f.badge}},[le,F]=at("root",{elementType:h7,externalForwardedProps:{...Q,...E},ownerState:W,className:Ce(K.root,i),ref:n,additionalProps:{as:u}}),[J,ie]=at("badge",{elementType:m7,externalForwardedProps:Q,ownerState:W,className:K.badge});return a.jsxs(le,{...F,children:[m,a.jsx(J,{...ie,children:L})]})}),g7=et("MuiBox",["root"]),y7=Sx(),B=_B({themeId:So,defaultTheme:y7,defaultClassName:g7.root,generateClassName:H_.generate}),v7=ye(a.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),x7=ce(Ls,{name:"MuiBreadcrumbCollapsed"})(Ue(({theme:t})=>({display:"flex",marginLeft:`calc(${t.spacing(1)} * 0.5)`,marginRight:`calc(${t.spacing(1)} * 0.5)`,...t.palette.mode==="light"?{backgroundColor:t.palette.grey[100],color:t.palette.grey[700]}:{backgroundColor:t.palette.grey[700],color:t.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...t.palette.mode==="light"?{backgroundColor:t.palette.grey[200]}:{backgroundColor:t.palette.grey[600]}},"&:active":{boxShadow:t.shadows[0],...t.palette.mode==="light"?{backgroundColor:fv(t.palette.grey[200],.12)}:{backgroundColor:fv(t.palette.grey[600],.12)}}}))),b7=ce(v7)({width:24,height:16});function S7(t){const{slots:e={},slotProps:n={},...r}=t,s=t;return a.jsx("li",{children:a.jsx(x7,{focusRipple:!0,...r,ownerState:s,children:a.jsx(b7,{as:e.CollapsedIcon,ownerState:s,...n.collapsedIcon})})})}function C7(t){return Ze("MuiBreadcrumbs",t)}const w7=et("MuiBreadcrumbs",["root","ol","li","separator"]),j7=t=>{const{classes:e}=t;return Ke({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},C7,e)},T7=ce(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(t,e)=>[{[`& .${w7.li}`]:e.li},e.root]})({}),D7=ce("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(t,e)=>e.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),E7=ce("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(t,e)=>e.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function R7(t,e,n,r){return t.reduce((s,i,l)=>(l<t.length-1?s=s.concat(i,a.jsx(E7,{"aria-hidden":!0,className:e,ownerState:r,children:n},`separator-${l}`)):s.push(i),s),[])}const k7=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiBreadcrumbs"}),{children:s,className:i,component:l="nav",slots:u={},slotProps:p={},expandText:f="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:v="/",...C}=r,[S,j]=b.useState(!1),D={...r,component:l,expanded:S,expandText:f,itemsAfterCollapse:m,itemsBeforeCollapse:g,maxItems:y,separator:v},M=j7(D),T=Ms({elementType:u.CollapsedIcon,externalSlotProps:p.collapsedIcon,ownerState:D}),E=b.useRef(null),k=O=>{const I=()=>{j(!0);const $=E.current.querySelector("a[href],button,[tabindex]");$&&$.focus()};return g+m>=O.length?O:[...O.slice(0,g),a.jsx(S7,{"aria-label":f,slots:{CollapsedIcon:u.CollapsedIcon},slotProps:{collapsedIcon:T},onClick:I},"ellipsis"),...O.slice(O.length-m,O.length)]},A=b.Children.toArray(s).filter(O=>b.isValidElement(O)).map((O,I)=>a.jsx("li",{className:M.li,children:O},`child-${I}`));return a.jsx(T7,{ref:n,component:l,color:"textSecondary",className:Ce(M.root,i),ownerState:D,...C,children:a.jsx(D7,{className:M.ol,ref:E,ownerState:D,children:R7(S||y&&A.length<=y?A:k(A),M.separator,v,D)})})});function M7(t){return Ze("MuiButton",t)}const $c=et("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),O7=b.createContext({}),A7=b.createContext(void 0),_7=t=>{const{color:e,disableElevation:n,fullWidth:r,size:s,variant:i,loading:l,loadingPosition:u,classes:p}=t,f={root:["root",l&&"loading",i,`${i}${ue(e)}`,`size${ue(s)}`,`${i}Size${ue(s)}`,`color${ue(e)}`,n&&"disableElevation",r&&"fullWidth",l&&`loadingPosition${ue(u)}`],startIcon:["icon","startIcon",`iconSize${ue(s)}`],endIcon:["icon","endIcon",`iconSize${ue(s)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},m=Ke(f,M7,p);return{...p,...m}},AI=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],I7=ce(Ls,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${ue(n.color)}`],e[`size${ue(n.size)}`],e[`${n.variant}Size${ue(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth,n.loading&&e.loading]}})(Ue(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],n=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${$c.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${$c.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${$c.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${$c.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(bn()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(t.vars||t).palette[r].main,"--variant-outlinedColor":(t.vars||t).palette[r].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.5)`:wt(t.palette[r].main,.5),"--variant-containedColor":(t.vars||t).palette[r].contrastText,"--variant-containedBg":(t.vars||t).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[r].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette[r].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[r].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette[r].main,t.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:e,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${$c.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${$c.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${$c.loading}`]:{color:"transparent"}}}]}})),P7=ce("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,n.loading&&e.startIconLoadingStart,e[`iconSize${ue(n.size)}`]]}})(({theme:t})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...AI]})),L7=ce("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,n.loading&&e.endIconLoadingEnd,e[`iconSize${ue(n.size)}`]]}})(({theme:t})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...AI]})),z7=ce("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(t,e)=>e.loadingIndicator})(({theme:t})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(t.vars||t).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),Fk=ce("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(t,e)=>e.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),pe=b.forwardRef(function(e,n){const r=b.useContext(O7),s=b.useContext(A7),i=ep(r,e),l=Qe({props:i,name:"MuiButton"}),{children:u,color:p="primary",component:f="button",className:m,disabled:g=!1,disableElevation:y=!1,disableFocusRipple:v=!1,endIcon:C,focusVisibleClassName:S,fullWidth:j=!1,id:D,loading:M=null,loadingIndicator:T,loadingPosition:E="center",size:k="medium",startIcon:A,type:O,variant:I="text",...$}=l,R=pc(D),P=T??a.jsx(ut,{"aria-labelledby":R,color:"inherit",size:16}),z={...l,color:p,component:f,disabled:g,disableElevation:y,disableFocusRipple:v,fullWidth:j,loading:M,loadingIndicator:P,loadingPosition:E,size:k,type:O,variant:I},N=_7(z),H=(A||M&&E==="start")&&a.jsx(P7,{className:N.startIcon,ownerState:z,children:A||a.jsx(Fk,{className:N.loadingIconPlaceholder,ownerState:z})}),U=(C||M&&E==="end")&&a.jsx(L7,{className:N.endIcon,ownerState:z,children:C||a.jsx(Fk,{className:N.loadingIconPlaceholder,ownerState:z})}),L=s||"",W=typeof M=="boolean"?a.jsx("span",{className:N.loadingWrapper,style:{display:"contents"},children:M&&a.jsx(z7,{className:N.loadingIndicator,ownerState:z,children:P})}):null;return a.jsxs(I7,{ownerState:z,className:Ce(r.className,N.root,m,L),component:f,disabled:g||M,focusRipple:!v,focusVisibleClassName:Ce(N.focusVisible,S),ref:n,type:O,id:M?R:D,...$,classes:N,children:[H,E!=="end"&&W,u,E==="end"&&W,U]})});function $7(t){return Ze("MuiCard",t)}et("MuiCard",["root"]);const N7=t=>{const{classes:e}=t;return Ke({root:["root"]},$7,e)},F7=ce($t,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})({overflow:"hidden"}),Su=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiCard"}),{className:s,raised:i=!1,...l}=r,u={...r,raised:i},p=N7(u);return a.jsx(F7,{className:Ce(p.root,s),elevation:i?8:void 0,ref:n,ownerState:u,...l})});function B7(t){return Ze("MuiCardActionArea",t)}const qS=et("MuiCardActionArea",["root","focusVisible","focusHighlight"]),U7=t=>{const{classes:e}=t;return Ke({root:["root"],focusHighlight:["focusHighlight"]},B7,e)},V7=ce(Ls,{name:"MuiCardActionArea",slot:"Root",overridesResolver:(t,e)=>e.root})(Ue(({theme:t})=>({display:"block",textAlign:"inherit",borderRadius:"inherit",width:"100%",[`&:hover .${qS.focusHighlight}`]:{opacity:(t.vars||t).palette.action.hoverOpacity,"@media (hover: none)":{opacity:0}},[`&.${qS.focusVisible} .${qS.focusHighlight}`]:{opacity:(t.vars||t).palette.action.focusOpacity}}))),H7=ce("span",{name:"MuiCardActionArea",slot:"FocusHighlight",overridesResolver:(t,e)=>e.focusHighlight})(Ue(({theme:t})=>({overflow:"hidden",pointerEvents:"none",position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:"inherit",opacity:0,backgroundColor:"currentcolor",transition:t.transitions.create("opacity",{duration:t.transitions.duration.short})}))),_I=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiCardActionArea"}),{children:s,className:i,focusVisibleClassName:l,slots:u={},slotProps:p={},...f}=r,m=r,g=U7(m),y={slots:u,slotProps:p},[v,C]=at("root",{elementType:V7,externalForwardedProps:{...y,...f},shouldForwardComponentProp:!0,ownerState:m,ref:n,className:Ce(g.root,i),additionalProps:{focusVisibleClassName:Ce(l,g.focusVisible)}}),[S,j]=at("focusHighlight",{elementType:H7,externalForwardedProps:y,ownerState:m,ref:n,className:g.focusHighlight});return a.jsxs(v,{...C,children:[s,a.jsx(S,{...j})]})});function W7(t){return Ze("MuiCardActions",t)}et("MuiCardActions",["root","spacing"]);const q7=t=>{const{classes:e,disableSpacing:n}=t;return Ke({root:["root",!n&&"spacing"]},W7,e)},G7=ce("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),s2=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiCardActions"}),{disableSpacing:s=!1,className:i,...l}=r,u={...r,disableSpacing:s},p=q7(u);return a.jsx(G7,{className:Ce(p.root,i),ownerState:u,ref:n,...l})});function Z7(t){return Ze("MuiCardContent",t)}et("MuiCardContent",["root"]);const K7=t=>{const{classes:e}=t;return Ke({root:["root"]},Z7,e)},Q7=ce("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:16,"&:last-child":{paddingBottom:24}}),Sp=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiCardContent"}),{className:s,component:i="div",...l}=r,u={...r,component:i},p=K7(u);return a.jsx(Q7,{as:i,className:Ce(p.root,s),ownerState:u,ref:n,...l})});function J7(t){return Ze("MuiCardMedia",t)}et("MuiCardMedia",["root","media","img"]);const Y7=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return Ke({root:["root",n&&"media",r&&"img"]},J7,e)},X7=ce("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{isMediaComponent:r,isImageComponent:s}=n;return[e.root,r&&e.media,s&&e.img]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),eH=["video","audio","picture","iframe","img"],tH=["picture","img"],II=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiCardMedia"}),{children:s,className:i,component:l="div",image:u,src:p,style:f,...m}=r,g=eH.includes(l),y=!g&&u?{backgroundImage:`url("${u}")`,...f}:f,v={...r,component:l,isMediaComponent:g,isImageComponent:tH.includes(l)},C=Y7(v);return a.jsx(X7,{className:Ce(C.root,i),as:l,role:!g&&u?"img":void 0,ref:n,style:y,ownerState:v,src:g?u||p:void 0,...m,children:s})});function nH(t){return Ze("PrivateSwitchBase",t)}et("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const rH=t=>{const{classes:e,checked:n,disabled:r,edge:s}=t,i={root:["root",n&&"checked",r&&"disabled",s&&`edge${ue(s)}`],input:["input"]};return Ke(i,nH,e)},sH=ce(Ls,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:t,ownerState:e})=>t==="start"&&e.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:t,ownerState:e})=>t==="end"&&e.size!=="small",style:{marginRight:-12}}]}),iH=ce("input",{name:"MuiSwitchBase",shouldForwardProp:Gr})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),i2=b.forwardRef(function(e,n){const{autoFocus:r,checked:s,checkedIcon:i,defaultChecked:l,disabled:u,disableFocusRipple:p=!1,edge:f=!1,icon:m,id:g,inputProps:y,inputRef:v,name:C,onBlur:S,onChange:j,onFocus:D,readOnly:M,required:T=!1,tabIndex:E,type:k,value:A,slots:O={},slotProps:I={},...$}=e,[R,P]=Ba({controlled:s,default:!!l,name:"SwitchBase",state:"checked"}),z=Ao(),N=de=>{D&&D(de),z&&z.onFocus&&z.onFocus(de)},H=de=>{S&&S(de),z&&z.onBlur&&z.onBlur(de)},U=de=>{if(de.nativeEvent.defaultPrevented)return;const fe=de.target.checked;P(fe),j&&j(de,fe)};let L=u;z&&typeof L>"u"&&(L=z.disabled);const W=k==="checkbox"||k==="radio",K={...e,checked:R,disabled:L,disableFocusRipple:p,edge:f},Q=rH(K),le={slots:O,slotProps:{input:y,...I}},[F,J]=at("root",{ref:n,elementType:sH,className:Q.root,shouldForwardComponentProp:!0,externalForwardedProps:{...le,component:"span",...$},getSlotProps:de=>({...de,onFocus:fe=>{var Re;(Re=de.onFocus)==null||Re.call(de,fe),N(fe)},onBlur:fe=>{var Re;(Re=de.onBlur)==null||Re.call(de,fe),H(fe)}}),ownerState:K,additionalProps:{centerRipple:!0,focusRipple:!p,disabled:L,role:void 0,tabIndex:null}}),[ie,te]=at("input",{ref:v,elementType:iH,className:Q.input,externalForwardedProps:le,getSlotProps:de=>({onChange:fe=>{var Re;(Re=de.onChange)==null||Re.call(de,fe),U(fe)}}),ownerState:K,additionalProps:{autoFocus:r,checked:s,defaultChecked:l,disabled:L,id:W?g:void 0,name:C,readOnly:M,required:T,tabIndex:E,type:k,...k==="checkbox"&&A===void 0?{}:{value:A}}});return a.jsxs(F,{...J,children:[a.jsx(ie,{...te}),R?i:m]})}),oH=ye(a.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),aH=ye(a.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),lH=ye(a.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function cH(t){return Ze("MuiCheckbox",t)}const GS=et("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),uH=t=>{const{classes:e,indeterminate:n,color:r,size:s}=t,i={root:["root",n&&"indeterminate",`color${ue(r)}`,`size${ue(s)}`]},l=Ke(i,cH,e);return{...e,...l}},dH=ce(i2,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${ue(n.size)}`],n.color!=="default"&&e[`color${ue(n.color)}`]]}})(Ue(({theme:t})=>({color:(t.vars||t).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{[`&.${GS.checked}, &.${GS.indeterminate}`]:{color:(t.vars||t).palette[e].main},[`&.${GS.disabled}`]:{color:(t.vars||t).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),pH=a.jsx(aH,{}),fH=a.jsx(oH,{}),hH=a.jsx(lH,{}),es=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiCheckbox"}),{checkedIcon:s=pH,color:i="primary",icon:l=fH,indeterminate:u=!1,indeterminateIcon:p=hH,inputProps:f,size:m="medium",disableRipple:g=!1,className:y,slots:v={},slotProps:C={},...S}=r,j=u?p:l,D=u?p:s,M={...r,disableRipple:g,color:i,indeterminate:u,size:m},T=uH(M),E=C.input??f,[k,A]=at("root",{ref:n,elementType:dH,className:Ce(T.root,y),shouldForwardComponentProp:!0,externalForwardedProps:{slots:v,slotProps:C,...S},ownerState:M,additionalProps:{type:"checkbox",icon:b.cloneElement(j,{fontSize:j.props.fontSize??m}),checkedIcon:b.cloneElement(D,{fontSize:D.props.fontSize??m}),disableRipple:g,slots:v,slotProps:{input:qw(typeof E=="function"?E(M):E,{"data-indeterminate":u})}}});return a.jsx(k,{...A,classes:T})});function Bk(t){return t.substring(2).toLowerCase()}function mH(t,e){return e.documentElement.clientWidth<t.clientX||e.documentElement.clientHeight<t.clientY}function PI(t){const{children:e,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:s,touchEvent:i="onTouchEnd"}=t,l=b.useRef(!1),u=b.useRef(null),p=b.useRef(!1),f=b.useRef(!1);b.useEffect(()=>(setTimeout(()=>{p.current=!0},0),()=>{p.current=!1}),[]);const m=cr(fc(e),u),g=Dr(C=>{const S=f.current;f.current=!1;const j=Ir(u.current);if(!p.current||!u.current||"clientX"in C&&mH(C,j))return;if(l.current){l.current=!1;return}let D;C.composedPath?D=C.composedPath().includes(u.current):D=!j.documentElement.contains(C.target)||u.current.contains(C.target),!D&&(n||!S)&&s(C)}),y=C=>S=>{f.current=!0;const j=e.props[C];j&&j(S)},v={ref:m};return i!==!1&&(v[i]=y(i)),b.useEffect(()=>{if(i!==!1){const C=Bk(i),S=Ir(u.current),j=()=>{l.current=!0};return S.addEventListener(C,g),S.addEventListener("touchmove",j),()=>{S.removeEventListener(C,g),S.removeEventListener("touchmove",j)}}},[g,i]),r!==!1&&(v[r]=y(r)),b.useEffect(()=>{if(r!==!1){const C=Bk(r),S=Ir(u.current);return S.addEventListener(C,g),()=>{S.removeEventListener(C,g)}}},[g,r]),b.cloneElement(e,v)}const ji=RU({createStyledComponent:ce("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`maxWidth${ue(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),useThemeProps:t=>Qe({props:t,name:"MuiContainer"})}),yC=typeof Ww({})=="function",gH=(t,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!t.vars&&{colorScheme:t.palette.mode}}),yH=t=>({color:(t.vars||t).palette.text.primary,...t.typography.body1,backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),LI=(t,e=!1)=>{var i,l;const n={};e&&t.colorSchemes&&typeof t.getColorSchemeSelector=="function"&&Object.entries(t.colorSchemes).forEach(([u,p])=>{var m,g;const f=t.getColorSchemeSelector(u);f.startsWith("@")?n[f]={":root":{colorScheme:(m=p.palette)==null?void 0:m.mode}}:n[f.replace(/\s*&/,"")]={colorScheme:(g=p.palette)==null?void 0:g.mode}});let r={html:gH(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:{margin:0,...yH(t),"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}},...n};const s=(l=(i=t.components)==null?void 0:i.MuiCssBaseline)==null?void 0:l.styleOverrides;return s&&(r=[r,s]),r},Qy="mui-ecs",vH=t=>{const e=LI(t,!1),n=Array.isArray(e)?e[0]:e;return!t.vars&&n&&(n.html[`:root:has(${Qy})`]={colorScheme:t.palette.mode}),t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([r,s])=>{var l,u;const i=t.getColorSchemeSelector(r);i.startsWith("@")?n[i]={[`:root:not(:has(.${Qy}))`]:{colorScheme:(l=s.palette)==null?void 0:l.mode}}:n[i.replace(/\s*&/,"")]={[`&:not(:has(.${Qy}))`]:{colorScheme:(u=s.palette)==null?void 0:u.mode}}}),e},xH=Ww(yC?({theme:t,enableColorScheme:e})=>LI(t,e):({theme:t})=>vH(t));function bH(t){const e=Qe({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return a.jsxs(b.Fragment,{children:[yC&&a.jsx(xH,{enableColorScheme:r}),!yC&&!r&&a.jsx("span",{className:Qy,style:{display:"none"}}),n]})}function SH(t){const e=Ir(t);return e.body===t?Ci(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function oh(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function Uk(t){return parseInt(Ci(t).getComputedStyle(t).paddingRight,10)||0}function CH(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(t.tagName),r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function Vk(t,e,n,r,s){const i=[e,n,...r];[].forEach.call(t.children,l=>{const u=!i.includes(l),p=!CH(l);u&&p&&oh(l,s)})}function ZS(t,e){let n=-1;return t.some((r,s)=>e(r)?(n=s,!0):!1),n}function wH(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(SH(r)){const l=eI(Ci(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${Uk(r)+l}px`;const u=Ir(r).querySelectorAll(".mui-fixed");[].forEach.call(u,p=>{n.push({value:p.style.paddingRight,property:"padding-right",el:p}),p.style.paddingRight=`${Uk(p)+l}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=Ir(r).body;else{const l=r.parentElement,u=Ci(r);i=(l==null?void 0:l.nodeName)==="HTML"&&u.getComputedStyle(l).overflowY==="scroll"?l:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:l,property:u})=>{i?l.style.setProperty(u,i):l.style.removeProperty(u)})}}function jH(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class TH{constructor(){this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&oh(e.modalRef,!1);const s=jH(n);Vk(n,e.mount,e.modalRef,s,!0);const i=ZS(this.containers,l=>l.container===n);return i!==-1?(this.containers[i].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:s}),r)}mount(e,n){const r=ZS(this.containers,i=>i.modals.includes(e)),s=this.containers[r];s.restore||(s.restore=wH(s,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const s=ZS(this.containers,l=>l.modals.includes(e)),i=this.containers[s];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),e.modalRef&&oh(e.modalRef,n),Vk(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(s,1);else{const l=i.modals[i.modals.length-1];l.modalRef&&oh(l.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}const DH=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function EH(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function RH(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function kH(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||RH(t))}function MH(t){const e=[],n=[];return Array.from(t.querySelectorAll(DH)).forEach((r,s)=>{const i=EH(r);i===-1||!kH(r)||(i===0?e.push(r):n.push({documentOrder:s,tabIndex:i,node:r}))}),n.sort((r,s)=>r.tabIndex===s.tabIndex?r.documentOrder-s.documentOrder:r.tabIndex-s.tabIndex).map(r=>r.node).concat(e)}function OH(){return!0}function AH(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:s=!1,getTabbable:i=MH,isEnabled:l=OH,open:u}=t,p=b.useRef(!1),f=b.useRef(null),m=b.useRef(null),g=b.useRef(null),y=b.useRef(null),v=b.useRef(!1),C=b.useRef(null),S=cr(fc(e),C),j=b.useRef(null);b.useEffect(()=>{!u||!C.current||(v.current=!n)},[n,u]),b.useEffect(()=>{if(!u||!C.current)return;const T=Ir(C.current);return C.current.contains(T.activeElement)||(C.current.hasAttribute("tabIndex")||C.current.setAttribute("tabIndex","-1"),v.current&&C.current.focus()),()=>{s||(g.current&&g.current.focus&&(p.current=!0,g.current.focus()),g.current=null)}},[u]),b.useEffect(()=>{if(!u||!C.current)return;const T=Ir(C.current),E=O=>{j.current=O,!(r||!l()||O.key!=="Tab")&&T.activeElement===C.current&&O.shiftKey&&(p.current=!0,m.current&&m.current.focus())},k=()=>{var $,R;const O=C.current;if(O===null)return;if(!T.hasFocus()||!l()||p.current){p.current=!1;return}if(O.contains(T.activeElement)||r&&T.activeElement!==f.current&&T.activeElement!==m.current)return;if(T.activeElement!==y.current)y.current=null;else if(y.current!==null)return;if(!v.current)return;let I=[];if((T.activeElement===f.current||T.activeElement===m.current)&&(I=i(C.current)),I.length>0){const P=!!(($=j.current)!=null&&$.shiftKey&&((R=j.current)==null?void 0:R.key)==="Tab"),z=I[0],N=I[I.length-1];typeof z!="string"&&typeof N!="string"&&(P?N.focus():z.focus())}else O.focus()};T.addEventListener("focusin",k),T.addEventListener("keydown",E,!0);const A=setInterval(()=>{T.activeElement&&T.activeElement.tagName==="BODY"&&k()},50);return()=>{clearInterval(A),T.removeEventListener("focusin",k),T.removeEventListener("keydown",E,!0)}},[n,r,s,l,u,i]);const D=T=>{g.current===null&&(g.current=T.relatedTarget),v.current=!0,y.current=T.target;const E=e.props.onFocus;E&&E(T)},M=T=>{g.current===null&&(g.current=T.relatedTarget),v.current=!0};return a.jsxs(b.Fragment,{children:[a.jsx("div",{tabIndex:u?0:-1,onFocus:M,ref:f,"data-testid":"sentinelStart"}),b.cloneElement(e,{ref:S,onFocus:D}),a.jsx("div",{tabIndex:u?0:-1,onFocus:M,ref:m,"data-testid":"sentinelEnd"})]})}function _H(t){return typeof t=="function"?t():t}function IH(t){return t?t.props.hasOwnProperty("in"):!1}const Hk=()=>{},gy=new TH;function PH(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:s=!1,onTransitionEnter:i,onTransitionExited:l,children:u,onClose:p,open:f,rootRef:m}=t,g=b.useRef({}),y=b.useRef(null),v=b.useRef(null),C=cr(v,m),[S,j]=b.useState(!f),D=IH(u);let M=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(M=!1);const T=()=>Ir(y.current),E=()=>(g.current.modalRef=v.current,g.current.mount=y.current,g.current),k=()=>{gy.mount(E(),{disableScrollLock:r}),v.current&&(v.current.scrollTop=0)},A=Dr(()=>{const U=_H(e)||T().body;gy.add(E(),U),v.current&&k()}),O=()=>gy.isTopModal(E()),I=Dr(U=>{y.current=U,U&&(f&&O()?k():v.current&&oh(v.current,M))}),$=b.useCallback(()=>{gy.remove(E(),M)},[M]);b.useEffect(()=>()=>{$()},[$]),b.useEffect(()=>{f?A():(!D||!s)&&$()},[f,$,D,s,A]);const R=U=>L=>{var W;(W=U.onKeyDown)==null||W.call(U,L),!(L.key!=="Escape"||L.which===229||!O())&&(n||(L.stopPropagation(),p&&p(L,"escapeKeyDown")))},P=U=>L=>{var W;(W=U.onClick)==null||W.call(U,L),L.target===L.currentTarget&&p&&p(L,"backdropClick")};return{getRootProps:(U={})=>{const L=lu(t);delete L.onTransitionEnter,delete L.onTransitionExited;const W={...L,...U};return{role:"presentation",...W,onKeyDown:R(W),ref:C}},getBackdropProps:(U={})=>{const L=U;return{"aria-hidden":!0,...L,onClick:P(L),open:f}},getTransitionProps:()=>{const U=()=>{j(!1),i&&i()},L=()=>{j(!0),l&&l(),s&&$()};return{onEnter:nC(U,(u==null?void 0:u.props.onEnter)??Hk),onExited:nC(L,(u==null?void 0:u.props.onExited)??Hk)}},rootRef:C,portalRef:I,isTopModal:O,exited:S,hasTransition:D}}function LH(t){return Ze("MuiModal",t)}et("MuiModal",["root","hidden","backdrop"]);const zH=t=>{const{open:e,exited:n,classes:r}=t;return Ke({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},LH,r)},$H=ce("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(Ue(({theme:t})=>({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]}))),NH=ce(Mx,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),o2=b.forwardRef(function(e,n){const r=Qe({name:"MuiModal",props:e}),{BackdropComponent:s=NH,BackdropProps:i,classes:l,className:u,closeAfterTransition:p=!1,children:f,container:m,component:g,components:y={},componentsProps:v={},disableAutoFocus:C=!1,disableEnforceFocus:S=!1,disableEscapeKeyDown:j=!1,disablePortal:D=!1,disableRestoreFocus:M=!1,disableScrollLock:T=!1,hideBackdrop:E=!1,keepMounted:k=!1,onBackdropClick:A,onClose:O,onTransitionEnter:I,onTransitionExited:$,open:R,slotProps:P={},slots:z={},theme:N,...H}=r,U={...r,closeAfterTransition:p,disableAutoFocus:C,disableEnforceFocus:S,disableEscapeKeyDown:j,disablePortal:D,disableRestoreFocus:M,disableScrollLock:T,hideBackdrop:E,keepMounted:k},{getRootProps:L,getBackdropProps:W,getTransitionProps:K,portalRef:Q,isTopModal:le,exited:F,hasTransition:J}=PH({...U,rootRef:n}),ie={...U,exited:F},te=zH(ie),de={};if(f.props.tabIndex===void 0&&(de.tabIndex="-1"),J){const{onEnter:be,onExited:Ae}=K();de.onEnter=be,de.onExited=Ae}const fe={slots:{root:y.Root,backdrop:y.Backdrop,...z},slotProps:{...v,...P}},[Re,Pe]=at("root",{ref:n,elementType:$H,externalForwardedProps:{...fe,...H,component:g},getSlotProps:L,ownerState:ie,className:Ce(u,te==null?void 0:te.root,!ie.open&&ie.exited&&(te==null?void 0:te.hidden))}),[$e,we]=at("backdrop",{ref:i==null?void 0:i.ref,elementType:s,externalForwardedProps:fe,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:be=>W({...be,onClick:Ae=>{A&&A(Ae),be!=null&&be.onClick&&be.onClick(Ae)}}),className:Ce(i==null?void 0:i.className,te==null?void 0:te.backdrop),ownerState:ie});return!k&&!R&&(!J||F)?null:a.jsx(MI,{ref:Q,container:m,disablePortal:D,children:a.jsxs(Re,{...Pe,children:[!E&&s?a.jsx($e,{...we}):null,a.jsx(AH,{disableEnforceFocus:S,disableAutoFocus:C,disableRestoreFocus:M,isEnabled:le,open:R,children:b.cloneElement(f,de)})]})})});function FH(t){return Ze("MuiDialog",t)}const KS=et("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),zI=b.createContext({}),BH=ce(Mx,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),UH=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:s,fullScreen:i}=t,l={root:["root"],container:["container",`scroll${ue(n)}`],paper:["paper",`paperScroll${ue(n)}`,`paperWidth${ue(String(r))}`,s&&"paperFullWidth",i&&"paperFullScreen"]};return Ke(l,FH,e)},VH=ce(o2,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),HH=ce("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${ue(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),WH=ce($t,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${ue(n.scroll)}`],e[`paperWidth${ue(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(Ue(({theme:t})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${KS.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter(e=>e!=="xs").map(e=>({props:{maxWidth:e},style:{maxWidth:`${t.breakpoints.values[e]}${t.breakpoints.unit}`,[`&.${KS.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${KS.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Qt=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiDialog"}),s=vr(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{"aria-describedby":l,"aria-labelledby":u,"aria-modal":p=!0,BackdropComponent:f,BackdropProps:m,children:g,className:y,disableEscapeKeyDown:v=!1,fullScreen:C=!1,fullWidth:S=!1,maxWidth:j="sm",onBackdropClick:D,onClick:M,onClose:T,open:E,PaperComponent:k=$t,PaperProps:A={},scroll:O="paper",slots:I={},slotProps:$={},TransitionComponent:R=gC,transitionDuration:P=i,TransitionProps:z,...N}=r,H={...r,disableEscapeKeyDown:v,fullScreen:C,fullWidth:S,maxWidth:j,scroll:O},U=UH(H),L=b.useRef(),W=Ie=>{L.current=Ie.target===Ie.currentTarget},K=Ie=>{M&&M(Ie),L.current&&(L.current=null,D&&D(Ie),T&&T(Ie,"backdropClick"))},Q=pc(u),le=b.useMemo(()=>({titleId:Q}),[Q]),F={transition:R,...I},J={transition:z,paper:A,backdrop:m,...$},ie={slots:F,slotProps:J},[te,de]=at("root",{elementType:VH,shouldForwardComponentProp:!0,externalForwardedProps:ie,ownerState:H,className:Ce(U.root,y),ref:n}),[fe,Re]=at("backdrop",{elementType:BH,shouldForwardComponentProp:!0,externalForwardedProps:ie,ownerState:H}),[Pe,$e]=at("paper",{elementType:WH,shouldForwardComponentProp:!0,externalForwardedProps:ie,ownerState:H,className:Ce(U.paper,A.className)}),[we,be]=at("container",{elementType:HH,externalForwardedProps:ie,ownerState:H,className:Ce(U.container)}),[Ae,Ne]=at("transition",{elementType:gC,externalForwardedProps:ie,ownerState:H,additionalProps:{appear:!0,in:E,timeout:P,role:"presentation"}});return a.jsx(te,{closeAfterTransition:!0,slots:{backdrop:fe},slotProps:{backdrop:{transitionDuration:P,as:f,...Re}},disableEscapeKeyDown:v,onClose:T,open:E,onClick:K,...de,...N,children:a.jsx(Ae,{...Ne,children:a.jsx(we,{onMouseDown:W,...be,children:a.jsx(Pe,{as:k,elevation:24,role:"dialog","aria-describedby":l,"aria-labelledby":Q,"aria-modal":p,...$e,children:a.jsx(zI.Provider,{value:le,children:g})})})})})});function qH(t){return Ze("MuiDialogActions",t)}et("MuiDialogActions",["root","spacing"]);const GH=t=>{const{classes:e,disableSpacing:n}=t;return Ke({root:["root",!n&&"spacing"]},qH,e)},ZH=ce("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:t})=>!t.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),rn=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiDialogActions"}),{className:s,disableSpacing:i=!1,...l}=r,u={...r,disableSpacing:i},p=GH(u);return a.jsx(ZH,{className:Ce(p.root,s),ownerState:u,ref:n,...l})});function KH(t){return Ze("MuiDialogContent",t)}et("MuiDialogContent",["root","dividers"]);function QH(t){return Ze("MuiDialogTitle",t)}const JH=et("MuiDialogTitle",["root"]),YH=t=>{const{classes:e,dividers:n}=t;return Ke({root:["root",n&&"dividers"]},KH,e)},XH=ce("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(Ue(({theme:t})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:e})=>e.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${JH.root} + &`]:{paddingTop:0}}}]}))),Jt=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiDialogContent"}),{className:s,dividers:i=!1,...l}=r,u={...r,dividers:i},p=YH(u);return a.jsx(XH,{className:Ce(p.root,s),ownerState:u,ref:n,...l})});function eW(t){return Ze("MuiDialogContentText",t)}et("MuiDialogContentText",["root"]);const tW=t=>{const{classes:e}=t,r=Ke({root:["root"]},eW,e);return{...e,...r}},nW=ce(G,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Eo=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiDialogContentText"}),{children:s,className:i,...l}=r,u=tW(l);return a.jsx(nW,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:l,className:Ce(u.root,i),...r,classes:u})}),rW=t=>{const{classes:e}=t;return Ke({root:["root"]},QH,e)},sW=ce(G,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Yt=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiDialogTitle"}),{className:s,id:i,...l}=r,u=r,p=rW(u),{titleId:f=i}=b.useContext(zI);return a.jsx(sW,{component:"h2",className:Ce(p.root,s),ownerState:u,ref:n,variant:"h6",id:i??f,...l})});function iW(t){return Ze("MuiDivider",t)}const Wk=et("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),oW=t=>{const{absolute:e,children:n,classes:r,flexItem:s,light:i,orientation:l,textAlign:u,variant:p}=t;return Ke({root:["root",e&&"absolute",p,i&&"light",l==="vertical"&&"vertical",s&&"flexItem",n&&"withChildren",n&&l==="vertical"&&"withChildrenVertical",u==="right"&&l!=="vertical"&&"textAlignRight",u==="left"&&l!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",l==="vertical"&&"wrapperVertical"]},iW,r)},aW=ce("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(Ue(({theme:t})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:wt(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&e.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>e.orientation==="vertical"&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>e.textAlign==="right"&&e.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>e.textAlign==="left"&&e.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),lW=ce("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(Ue(({theme:t})=>({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}))),wo=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiDivider"}),{absolute:s=!1,children:i,className:l,orientation:u="horizontal",component:p=i||u==="vertical"?"div":"hr",flexItem:f=!1,light:m=!1,role:g=p!=="hr"?"separator":void 0,textAlign:y="center",variant:v="fullWidth",...C}=r,S={...r,absolute:s,component:p,flexItem:f,light:m,orientation:u,role:g,textAlign:y,variant:v},j=oW(S);return a.jsx(aW,{as:p,className:Ce(j.root,l),role:g,ref:n,ownerState:S,"aria-orientation":g==="separator"&&(p!=="hr"||u==="vertical")?u:void 0,...C,children:i?a.jsx(lW,{className:j.wrapper,ownerState:S,children:i}):null})});wo&&(wo.muiSkipListHighlight=!0);function cW(t,e,n){const r=e.getBoundingClientRect(),s=n&&n.getBoundingClientRect(),i=Ci(e);let l;if(e.fakeTransform)l=e.fakeTransform;else{const f=i.getComputedStyle(e);l=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let u=0,p=0;if(l&&l!=="none"&&typeof l=="string"){const f=l.split("(")[1].split(")")[0].split(",");u=parseInt(f[4],10),p=parseInt(f[5],10)}return t==="left"?s?`translateX(${s.right+u-r.left}px)`:`translateX(${i.innerWidth+u-r.left}px)`:t==="right"?s?`translateX(-${r.right-s.left-u}px)`:`translateX(-${r.left+r.width-u}px)`:t==="up"?s?`translateY(${s.bottom+p-r.top}px)`:`translateY(${i.innerHeight+p-r.top}px)`:s?`translateY(-${r.top-s.top+r.height-p}px)`:`translateY(-${r.top+r.height-p}px)`}function uW(t){return typeof t=="function"?t():t}function yy(t,e,n){const r=uW(n),s=cW(t,e,r);s&&(e.style.webkitTransform=s,e.style.transform=s)}const dW=b.forwardRef(function(e,n){const r=vr(),s={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:p,container:f,direction:m="down",easing:g=s,in:y,onEnter:v,onEntered:C,onEntering:S,onExit:j,onExited:D,onExiting:M,style:T,timeout:E=i,TransitionComponent:k=so,...A}=e,O=b.useRef(null),I=cr(fc(p),O,n),$=K=>Q=>{K&&(Q===void 0?K(O.current):K(O.current,Q))},R=$((K,Q)=>{yy(m,K,f),Kw(K),v&&v(K,Q)}),P=$((K,Q)=>{const le=rc({timeout:E,style:T,easing:g},{mode:"enter"});K.style.webkitTransition=r.transitions.create("-webkit-transform",{...le}),K.style.transition=r.transitions.create("transform",{...le}),K.style.webkitTransform="none",K.style.transform="none",S&&S(K,Q)}),z=$(C),N=$(M),H=$(K=>{const Q=rc({timeout:E,style:T,easing:g},{mode:"exit"});K.style.webkitTransition=r.transitions.create("-webkit-transform",Q),K.style.transition=r.transitions.create("transform",Q),yy(m,K,f),j&&j(K)}),U=$(K=>{K.style.webkitTransition="",K.style.transition="",D&&D(K)}),L=K=>{l&&l(O.current,K)},W=b.useCallback(()=>{O.current&&yy(m,O.current,f)},[m,f]);return b.useEffect(()=>{if(y||m==="down"||m==="right")return;const K=Sm(()=>{O.current&&yy(m,O.current,f)}),Q=Ci(O.current);return Q.addEventListener("resize",K),()=>{K.clear(),Q.removeEventListener("resize",K)}},[m,y,f]),b.useEffect(()=>{y||W()},[y,W]),a.jsx(k,{nodeRef:O,onEnter:R,onEntered:z,onEntering:P,onExit:H,onExited:U,onExiting:N,addEndListener:L,appear:u,in:y,timeout:E,...A,children:(K,{ownerState:Q,...le})=>b.cloneElement(p,{ref:I,style:{visibility:K==="exited"&&!y?"hidden":void 0,...T,...p.props.style},...le})})});function pW(t){return Ze("MuiDrawer",t)}et("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const $I=(t,e)=>{const{ownerState:n}=t;return[e.root,(n.variant==="permanent"||n.variant==="persistent")&&e.docked,e.modal]},fW=t=>{const{classes:e,anchor:n,variant:r}=t,s={root:["root",`anchor${ue(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${ue(n)}`,r!=="temporary"&&`paperAnchorDocked${ue(n)}`]};return Ke(s,pW,e)},hW=ce(o2,{name:"MuiDrawer",slot:"Root",overridesResolver:$I})(Ue(({theme:t})=>({zIndex:(t.vars||t).zIndex.drawer}))),mW=ce("div",{shouldForwardProp:Gr,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:$I})({flex:"0 0 auto"}),gW=ce($t,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`paperAnchor${ue(n.anchor)}`],n.variant!=="temporary"&&e[`paperAnchorDocked${ue(n.anchor)}`]]}})(Ue(({theme:t})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:e})=>e.anchor==="left"&&e.variant!=="temporary",style:{borderRight:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:e})=>e.anchor==="top"&&e.variant!=="temporary",style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:e})=>e.anchor==="right"&&e.variant!=="temporary",style:{borderLeft:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:e})=>e.anchor==="bottom"&&e.variant!=="temporary",style:{borderTop:`1px solid ${(t.vars||t).palette.divider}`}}]}))),NI={left:"right",right:"left",top:"down",bottom:"up"};function yW(t){return["left","right"].includes(t)}function vW({direction:t},e){return t==="rtl"&&yW(e)?NI[e]:e}const Cu=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiDrawer"}),s=vr(),i=hc(),l={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:u="left",BackdropProps:p,children:f,className:m,elevation:g=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:v,...C}={},onClose:S,open:j=!1,PaperProps:D={},SlideProps:M,TransitionComponent:T,transitionDuration:E=l,variant:k="temporary",slots:A={},slotProps:O={},...I}=r,$=b.useRef(!1);b.useEffect(()=>{$.current=!0},[]);const R=vW({direction:i?"rtl":"ltr"},u),z={...r,anchor:u,elevation:g,open:j,variant:k,...I},N=fW(z),H={slots:{transition:T,...A},slotProps:{paper:D,transition:M,...O,backdrop:qw(O.backdrop||{...p,...v},{transitionDuration:E})}},[U,L]=at("root",{ref:n,elementType:hW,className:Ce(N.root,N.modal,m),shouldForwardComponentProp:!0,ownerState:z,externalForwardedProps:{...H,...I,...C},additionalProps:{open:j,onClose:S,hideBackdrop:y,slots:{backdrop:H.slots.backdrop},slotProps:{backdrop:H.slotProps.backdrop}}}),[W,K]=at("paper",{elementType:gW,shouldForwardComponentProp:!0,className:Ce(N.paper,D.className),ownerState:z,externalForwardedProps:H,additionalProps:{elevation:k==="temporary"?g:0,square:!0}}),[Q,le]=at("docked",{elementType:mW,ref:n,className:Ce(N.root,N.docked,m),ownerState:z,externalForwardedProps:H,additionalProps:I}),[F,J]=at("transition",{elementType:dW,ownerState:z,externalForwardedProps:H,additionalProps:{in:j,direction:NI[R],timeout:E,appear:$.current}}),ie=a.jsx(W,{...K,children:f});if(k==="permanent")return a.jsx(Q,{...le,children:ie});const te=a.jsx(F,{...J,children:ie});return k==="persistent"?a.jsx(Q,{...le,children:te}):a.jsx(U,{...L,children:te})});function xW(t){return Ze("MuiFab",t)}const qk=et("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]),bW=t=>{const{color:e,variant:n,classes:r,size:s}=t,i={root:["root",n,`size${ue(s)}`,e==="inherit"?"colorInherit":e]},l=Ke(i,xW,r);return{...r,...l}},SW=ce(Ls,{name:"MuiFab",slot:"Root",shouldForwardProp:t=>Gr(t)||t==="classes",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${ue(n.size)}`],n.color==="inherit"&&e.colorInherit,e[ue(n.size)],e[n.color]]}})(Ue(({theme:t})=>{var e,n;return{...t.typography.button,minHeight:36,transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(t.vars||t).zIndex.fab,boxShadow:(t.vars||t).shadows[6],"&:active":{boxShadow:(t.vars||t).shadows[12]},color:t.vars?t.vars.palette.text.primary:(n=(e=t.palette).getContrastText)==null?void 0:n.call(e,t.palette.grey[300]),backgroundColor:(t.vars||t).palette.grey[300],"&:hover":{backgroundColor:(t.vars||t).palette.grey.A100,"@media (hover: none)":{backgroundColor:(t.vars||t).palette.grey[300]},textDecoration:"none"},[`&.${qk.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},variants:[{props:{size:"small"},style:{width:40,height:40}},{props:{size:"medium"},style:{width:48,height:48}},{props:{variant:"extended"},style:{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48}},{props:{variant:"extended",size:"small"},style:{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34}},{props:{variant:"extended",size:"medium"},style:{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40}},{props:{color:"inherit"},style:{color:"inherit"}}]}}),Ue(({theme:t})=>({variants:[...Object.entries(t.palette).filter(bn(["dark","contrastText"])).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].contrastText,backgroundColor:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:(t.vars||t).palette[e].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e].main}}}}))]})),Ue(({theme:t})=>({[`&.${qk.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}))),CW=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiFab"}),{children:s,className:i,color:l="default",component:u="button",disabled:p=!1,disableFocusRipple:f=!1,focusVisibleClassName:m,size:g="large",variant:y="circular",...v}=r,C={...r,color:l,component:u,disabled:p,disableFocusRipple:f,size:g,variant:y},S=bW(C);return a.jsx(SW,{className:Ce(S.root,i),component:u,disabled:p,focusRipple:!f,focusVisibleClassName:Ce(S.focusVisible,m),ownerState:C,ref:n,...v,classes:S,children:s})}),wW=t=>{const{classes:e,disableUnderline:n,startAdornment:r,endAdornment:s,size:i,hiddenLabel:l,multiline:u}=t,p={root:["root",!n&&"underline",r&&"adornedStart",s&&"adornedEnd",i==="small"&&`size${ue(i)}`,l&&"hiddenLabel",u&&"multiline"],input:["input"]},f=Ke(p,N8,e);return{...e,...f}},jW=ce(Rx,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...Dx(t,e),!n.disableUnderline&&e.underline]}})(Ue(({theme:t})=>{const e=t.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r}},[`&.${hi.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r},[`&.${hi.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:i},variants:[{props:({ownerState:l})=>!l.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${hi.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${hi.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${hi.disabled}, .${hi.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${hi.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(bn()).map(([l])=>{var u;return{props:{disableUnderline:!1,color:l},style:{"&::after":{borderBottom:`2px solid ${(u=(t.vars||t).palette[l])==null?void 0:u.main}`}}}}),{props:({ownerState:l})=>l.startAdornment,style:{paddingLeft:12}},{props:({ownerState:l})=>l.endAdornment,style:{paddingRight:12}},{props:({ownerState:l})=>l.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:l,size:u})=>l.multiline&&u==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:l})=>l.multiline&&l.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:l})=>l.multiline&&l.hiddenLabel&&l.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),TW=ce(kx,{name:"MuiFilledInput",slot:"Input",overridesResolver:Ex})(Ue(({theme:t})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),a2=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiFilledInput"}),{disableUnderline:s=!1,components:i={},componentsProps:l,fullWidth:u=!1,hiddenLabel:p,inputComponent:f="input",multiline:m=!1,slotProps:g,slots:y={},type:v="text",...C}=r,S={...r,disableUnderline:s,fullWidth:u,inputComponent:f,multiline:m,type:v},j=wW(r),D={root:{ownerState:S},input:{ownerState:S}},M=g??l?ls(D,g??l):D,T=y.root??i.Root??jW,E=y.input??i.Input??TW;return a.jsx(r2,{slots:{root:T,input:E},slotProps:M,fullWidth:u,inputComponent:f,multiline:m,ref:n,type:v,...C,classes:j})});a2.muiName="Input";function DW(t){return Ze("MuiFormControl",t)}et("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const EW=t=>{const{classes:e,margin:n,fullWidth:r}=t,s={root:["root",n!=="none"&&`margin${ue(n)}`,r&&"fullWidth"]};return Ke(s,DW,e)},RW=ce("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`margin${ue(n.margin)}`],n.fullWidth&&e.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),_n=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiFormControl"}),{children:s,className:i,color:l="primary",component:u="div",disabled:p=!1,error:f=!1,focused:m,fullWidth:g=!1,hiddenLabel:y=!1,margin:v="none",required:C=!1,size:S="medium",variant:j="outlined",...D}=r,M={...r,color:l,component:u,disabled:p,error:f,fullWidth:g,hiddenLabel:y,margin:v,required:C,size:S,variant:j},T=EW(M),[E,k]=b.useState(()=>{let U=!1;return s&&b.Children.forEach(s,L=>{if(!rh(L,["Input","Select"]))return;const W=rh(L,["Select"])?L.props.input:L;W&&I8(W.props)&&(U=!0)}),U}),[A,O]=b.useState(()=>{let U=!1;return s&&b.Children.forEach(s,L=>{rh(L,["Input","Select"])&&(vv(L.props,!0)||vv(L.props.inputProps,!0))&&(U=!0)}),U}),[I,$]=b.useState(!1);p&&I&&$(!1);const R=m!==void 0&&!p?m:I;let P;b.useRef(!1);const z=b.useCallback(()=>{O(!0)},[]),N=b.useCallback(()=>{O(!1)},[]),H=b.useMemo(()=>({adornedStart:E,setAdornedStart:k,color:l,disabled:p,error:f,filled:A,focused:R,fullWidth:g,hiddenLabel:y,size:S,onBlur:()=>{$(!1)},onFocus:()=>{$(!0)},onEmpty:N,onFilled:z,registerEffect:P,required:C,variant:j}),[E,l,p,f,A,R,g,y,P,N,z,C,S,j]);return a.jsx(Tx.Provider,{value:H,children:a.jsx(RW,{as:u,ownerState:M,className:Ce(T.root,i),ref:n,...D,children:s})})});function kW(t){return Ze("MuiFormControlLabel",t)}const qf=et("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),MW=t=>{const{classes:e,disabled:n,labelPlacement:r,error:s,required:i}=t,l={root:["root",n&&"disabled",`labelPlacement${ue(r)}`,s&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",s&&"error"]};return Ke(l,kW,e)},OW=ce("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${qf.label}`]:e.label},e.root,e[`labelPlacement${ue(n.labelPlacement)}`]]}})(Ue(({theme:t})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${qf.disabled}`]:{cursor:"default"},[`& .${qf.label}`]:{[`&.${qf.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>e==="start"||e==="top"||e==="bottom",style:{marginLeft:16}}]}))),AW=ce("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(Ue(({theme:t})=>({[`&.${qf.error}`]:{color:(t.vars||t).palette.error.main}}))),_r=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiFormControlLabel"}),{checked:s,className:i,componentsProps:l={},control:u,disabled:p,disableTypography:f,inputRef:m,label:g,labelPlacement:y="end",name:v,onChange:C,required:S,slots:j={},slotProps:D={},value:M,...T}=r,E=Ao(),k=p??u.props.disabled??(E==null?void 0:E.disabled),A=S??u.props.required,O={disabled:k,required:A};["checked","name","onChange","value","inputRef"].forEach(U=>{typeof u.props[U]>"u"&&typeof r[U]<"u"&&(O[U]=r[U])});const I=gc({props:r,muiFormControl:E,states:["error"]}),$={...r,disabled:k,labelPlacement:y,required:A,error:I.error},R=MW($),P={slots:j,slotProps:{...l,...D}},[z,N]=at("typography",{elementType:G,externalForwardedProps:P,ownerState:$});let H=g;return H!=null&&H.type!==G&&!f&&(H=a.jsx(z,{component:"span",...N,className:Ce(R.label,N==null?void 0:N.className),children:H})),a.jsxs(OW,{className:Ce(R.root,i),ownerState:$,ref:n,...T,children:[b.cloneElement(u,O),A?a.jsxs("div",{children:[H,a.jsxs(AW,{ownerState:$,"aria-hidden":!0,className:R.asterisk,children:[" ","*"]})]}):H]})});function _W(t){return Ze("MuiFormGroup",t)}et("MuiFormGroup",["root","row","error"]);const IW=t=>{const{classes:e,row:n,error:r}=t;return Ke({root:["root",n&&"row",r&&"error"]},_W,e)},PW=ce("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),Th=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiFormGroup"}),{className:s,row:i=!1,...l}=r,u=Ao(),p=gc({props:r,muiFormControl:u,states:["error"]}),f={...r,row:i,error:p.error},m=IW(f);return a.jsx(PW,{className:Ce(m.root,s),ownerState:f,ref:n,...l})});function LW(t){return Ze("MuiFormHelperText",t)}const Gk=et("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Zk;const zW=t=>{const{classes:e,contained:n,size:r,disabled:s,error:i,filled:l,focused:u,required:p}=t,f={root:["root",s&&"disabled",i&&"error",r&&`size${ue(r)}`,n&&"contained",u&&"focused",l&&"filled",p&&"required"]};return Ke(f,LW,e)},$W=ce("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${ue(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(Ue(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Gk.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Gk.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),Dh=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiFormHelperText"}),{children:s,className:i,component:l="p",disabled:u,error:p,filled:f,focused:m,margin:g,required:y,variant:v,...C}=r,S=Ao(),j=gc({props:r,muiFormControl:S,states:["variant","size","disabled","error","filled","focused","required"]}),D={...r,component:l,contained:j.variant==="filled"||j.variant==="outlined",variant:j.variant,size:j.size,disabled:j.disabled,error:j.error,filled:j.filled,focused:j.focused,required:j.required};delete D.ownerState;const M=zW(D);return a.jsx($W,{as:l,className:Ce(M.root,i),ref:n,...C,ownerState:D,children:s===" "?Zk||(Zk=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):s})});function NW(t){return Ze("MuiFormLabel",t)}const ah=et("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),FW=t=>{const{classes:e,color:n,focused:r,disabled:s,error:i,filled:l,required:u}=t,p={root:["root",`color${ue(n)}`,s&&"disabled",i&&"error",l&&"filled",r&&"focused",u&&"required"],asterisk:["asterisk",i&&"error"]};return Ke(p,NW,e)},BW=ce("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color==="secondary"&&e.colorSecondary,n.filled&&e.filled]}})(Ue(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{[`&.${ah.focused}`]:{color:(t.vars||t).palette[e].main}}})),{props:{},style:{[`&.${ah.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${ah.error}`]:{color:(t.vars||t).palette.error.main}}}]}))),UW=ce("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(Ue(({theme:t})=>({[`&.${ah.error}`]:{color:(t.vars||t).palette.error.main}}))),FI=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiFormLabel"}),{children:s,className:i,color:l,component:u="label",disabled:p,error:f,filled:m,focused:g,required:y,...v}=r,C=Ao(),S=gc({props:r,muiFormControl:C,states:["color","required","focused","disabled","error","filled"]}),j={...r,color:S.color||"primary",component:u,disabled:S.disabled,error:S.error,filled:S.filled,focused:S.focused,required:S.required},D=FW(j);return a.jsxs(BW,{as:u,ownerState:j,className:Ce(D.root,i),ref:n,...v,children:[s,S.required&&a.jsxs(UW,{ownerState:j,"aria-hidden":!0,className:D.asterisk,children:[" ","*"]})]})}),Kk=b.createContext();function VW(t){return Ze("MuiGrid",t)}const HW=[0,1,2,3,4,5,6,7,8,9,10],WW=["column-reverse","column","row-reverse","row"],qW=["nowrap","wrap-reverse","wrap"],kf=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Eh=et("MuiGrid",["root","container","item","zeroMinWidth",...HW.map(t=>`spacing-xs-${t}`),...WW.map(t=>`direction-xs-${t}`),...qW.map(t=>`wrap-xs-${t}`),...kf.map(t=>`grid-xs-${t}`),...kf.map(t=>`grid-sm-${t}`),...kf.map(t=>`grid-md-${t}`),...kf.map(t=>`grid-lg-${t}`),...kf.map(t=>`grid-xl-${t}`)]);function GW({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,s)=>{let i={};if(e[s]&&(n=e[s]),!n)return r;if(n===!0)i={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const l=au({values:e.columns,breakpoints:t.breakpoints.values}),u=typeof l=="object"?l[s]:l;if(u==null)return r;const p=`${Math.round(n/u*1e8)/1e6}%`;let f={};if(e.container&&e.item&&e.columnSpacing!==0){const m=t.spacing(e.columnSpacing);if(m!=="0px"){const g=`calc(${p} + ${m})`;f={flexBasis:g,maxWidth:g}}}i={flexBasis:p,flexGrow:0,maxWidth:p,...f}}return t.breakpoints.values[s]===0?Object.assign(r,i):r[t.breakpoints.up(s)]=i,r},{})}function ZW({theme:t,ownerState:e}){const n=au({values:e.direction,breakpoints:t.breakpoints.values});return ti({theme:t},n,r=>{const s={flexDirection:r};return r.startsWith("column")&&(s[`& > .${Eh.item}`]={maxWidth:"none"}),s})}function BI({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(s=>{n===""&&e[s]!==0&&(n=s)});const r=Object.keys(t).sort((s,i)=>t[s]-t[i]);return r.slice(0,r.indexOf(n))}function KW({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let s={};if(n&&r!==0){const i=au({values:r,breakpoints:t.breakpoints.values});let l;typeof i=="object"&&(l=BI({breakpoints:t.breakpoints.values,values:i})),s=ti({theme:t},i,(u,p)=>{const f=t.spacing(u);return f!=="0px"?{marginTop:`calc(-1 * ${f})`,[`& > .${Eh.item}`]:{paddingTop:f}}:l!=null&&l.includes(p)?{}:{marginTop:0,[`& > .${Eh.item}`]:{paddingTop:0}}})}return s}function QW({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let s={};if(n&&r!==0){const i=au({values:r,breakpoints:t.breakpoints.values});let l;typeof i=="object"&&(l=BI({breakpoints:t.breakpoints.values,values:i})),s=ti({theme:t},i,(u,p)=>{const f=t.spacing(u);if(f!=="0px"){const m=`calc(-1 * ${f})`;return{width:`calc(100% + ${f})`,marginLeft:m,[`& > .${Eh.item}`]:{paddingLeft:f}}}return l!=null&&l.includes(p)?{}:{width:"100%",marginLeft:0,[`& > .${Eh.item}`]:{paddingLeft:0}}})}return s}function JW(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(s=>{const i=t[s];Number(i)>0&&r.push(n[`spacing-${s}-${String(i)}`])}),r}const YW=ce("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:s,item:i,spacing:l,wrap:u,zeroMinWidth:p,breakpoints:f}=n;let m=[];r&&(m=JW(l,f,e));const g=[];return f.forEach(y=>{const v=n[y];v&&g.push(e[`grid-${y}-${String(v)}`])}),[e.root,r&&e.container,i&&e.item,p&&e.zeroMinWidth,...m,s!=="row"&&e[`direction-xs-${String(s)}`],u!=="wrap"&&e[`wrap-xs-${String(u)}`],...g]}})(({ownerState:t})=>({boxSizing:"border-box",...t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...t.item&&{margin:0},...t.zeroMinWidth&&{minWidth:0},...t.wrap!=="wrap"&&{flexWrap:t.wrap}}),ZW,KW,QW,GW);function XW(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const s=t[r];if(Number(s)>0){const i=`spacing-${r}-${String(s)}`;n.push(i)}}),n}const eq=t=>{const{classes:e,container:n,direction:r,item:s,spacing:i,wrap:l,zeroMinWidth:u,breakpoints:p}=t;let f=[];n&&(f=XW(i,p));const m=[];p.forEach(y=>{const v=t[y];v&&m.push(`grid-${y}-${String(v)}`)});const g={root:["root",n&&"container",s&&"item",u&&"zeroMinWidth",...f,r!=="row"&&`direction-xs-${String(r)}`,l!=="wrap"&&`wrap-xs-${String(l)}`,...m]};return Ke(g,VW,e)},Et=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiGrid"}),{breakpoints:s}=vr(),i=bm(r),{className:l,columns:u,columnSpacing:p,component:f="div",container:m=!1,direction:g="row",item:y=!1,rowSpacing:v,spacing:C=0,wrap:S="wrap",zeroMinWidth:j=!1,...D}=i,M=v||C,T=p||C,E=b.useContext(Kk),k=m?u||12:E,A={},O={...D};s.keys.forEach(R=>{D[R]!=null&&(A[R]=D[R],delete O[R])});const I={...i,columns:k,container:m,direction:g,item:y,rowSpacing:M,columnSpacing:T,wrap:S,zeroMinWidth:j,spacing:C,...A,breakpoints:s.keys},$=eq(I);return a.jsx(Kk.Provider,{value:k,children:a.jsx(YW,{ownerState:I,className:Ce($.root,l),as:f,ref:n,...O})})}),Qk=HU({createStyledComponent:ce("div",{name:"MuiGrid2",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.container&&e.container]}}),componentName:"MuiGrid2",useThemeProps:t=>Qe({props:t,name:"MuiGrid2"}),useTheme:vr});function vC(t){return`scale(${t}, ${t**2})`}const tq={entering:{opacity:1,transform:vC(1)},entered:{opacity:1,transform:"none"}},QS=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Rh=b.forwardRef(function(e,n){const{addEndListener:r,appear:s=!0,children:i,easing:l,in:u,onEnter:p,onEntered:f,onEntering:m,onExit:g,onExited:y,onExiting:v,style:C,timeout:S="auto",TransitionComponent:j=so,...D}=e,M=Hl(),T=b.useRef(),E=vr(),k=b.useRef(null),A=cr(k,fc(i),n),O=U=>L=>{if(U){const W=k.current;L===void 0?U(W):U(W,L)}},I=O(m),$=O((U,L)=>{Kw(U);const{duration:W,delay:K,easing:Q}=rc({style:C,timeout:S,easing:l},{mode:"enter"});let le;S==="auto"?(le=E.transitions.getAutoHeightDuration(U.clientHeight),T.current=le):le=W,U.style.transition=[E.transitions.create("opacity",{duration:le,delay:K}),E.transitions.create("transform",{duration:QS?le:le*.666,delay:K,easing:Q})].join(","),p&&p(U,L)}),R=O(f),P=O(v),z=O(U=>{const{duration:L,delay:W,easing:K}=rc({style:C,timeout:S,easing:l},{mode:"exit"});let Q;S==="auto"?(Q=E.transitions.getAutoHeightDuration(U.clientHeight),T.current=Q):Q=L,U.style.transition=[E.transitions.create("opacity",{duration:Q,delay:W}),E.transitions.create("transform",{duration:QS?Q:Q*.666,delay:QS?W:W||Q*.333,easing:K})].join(","),U.style.opacity=0,U.style.transform=vC(.75),g&&g(U)}),N=O(y),H=U=>{S==="auto"&&M.start(T.current||0,U),r&&r(k.current,U)};return a.jsx(j,{appear:s,in:u,nodeRef:k,onEnter:$,onEntered:R,onEntering:I,onExit:z,onExited:N,onExiting:P,addEndListener:H,timeout:S==="auto"?null:S,...D,children:(U,{ownerState:L,...W})=>b.cloneElement(i,{style:{opacity:0,transform:vC(.75),visibility:U==="exited"&&!u?"hidden":void 0,...tq[U],...C,...i.props.style},ref:A,...W})})});Rh&&(Rh.muiSupportAuto=!0);const aa=J_({themeId:So}),nq=t=>{const{classes:e,disableUnderline:n}=t,s=Ke({root:["root",!n&&"underline"],input:["input"]},z8,e);return{...e,...s}},rq=ce(Rx,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...Dx(t,e),!n.disableUnderline&&e.underline]}})(Ue(({theme:t})=>{let n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${kl.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${kl.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${kl.disabled}, .${kl.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${kl.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(bn()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}}))]}})),sq=ce(kx,{name:"MuiInput",slot:"Input",overridesResolver:Ex})({}),l2=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiInput"}),{disableUnderline:s=!1,components:i={},componentsProps:l,fullWidth:u=!1,inputComponent:p="input",multiline:f=!1,slotProps:m,slots:g={},type:y="text",...v}=r,C=nq(r),j={root:{ownerState:{disableUnderline:s}}},D=m??l?ls(m??l,j):j,M=g.root??i.Root??rq,T=g.input??i.Input??sq;return a.jsx(r2,{slots:{root:M,input:T},slotProps:D,fullWidth:u,inputComponent:p,multiline:f,ref:n,type:y,...v,classes:C})});l2.muiName="Input";function iq(t){return Ze("MuiInputAdornment",t)}const Jk=et("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var Yk;const oq=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${ue(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},aq=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:s,size:i,variant:l}=t,u={root:["root",n&&"disablePointerEvents",s&&`position${ue(s)}`,l,r&&"hiddenLabel",i&&`size${ue(i)}`]};return Ke(u,iq,e)},lq=ce("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:oq})(Ue(({theme:t})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${Jk.positionStart}&:not(.${Jk.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),c2=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiInputAdornment"}),{children:s,className:i,component:l="div",disablePointerEvents:u=!1,disableTypography:p=!1,position:f,variant:m,...g}=r,y=Ao()||{};let v=m;m&&y.variant,y&&!v&&(v=y.variant);const C={...r,hiddenLabel:y.hiddenLabel,size:y.size,disablePointerEvents:u,position:f,variant:v},S=aq(C);return a.jsx(Tx.Provider,{value:null,children:a.jsx(lq,{as:l,ownerState:C,className:Ce(S.root,i),ref:n,...g,children:typeof s=="string"&&!p?a.jsx(G,{color:"textSecondary",children:s}):a.jsxs(b.Fragment,{children:[f==="start"?Yk||(Yk=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):null,s]})})})});function cq(t){return Ze("MuiInputLabel",t)}et("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const uq=t=>{const{classes:e,formControl:n,size:r,shrink:s,disableAnimation:i,variant:l,required:u}=t,p={root:["root",n&&"formControl",!i&&"animated",s&&"shrink",r&&r!=="normal"&&`size${ue(r)}`,l],asterisk:[u&&"asterisk"]},f=Ke(p,cq,e);return{...e,...f}},dq=ce(FI,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ah.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(Ue(({theme:t})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:e})=>e.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:e})=>e.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:e,ownerState:n,size:r})=>e==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),nr=b.forwardRef(function(e,n){const r=Qe({name:"MuiInputLabel",props:e}),{disableAnimation:s=!1,margin:i,shrink:l,variant:u,className:p,...f}=r,m=Ao();let g=l;typeof g>"u"&&m&&(g=m.filled||m.focused||m.adornedStart);const y=gc({props:r,muiFormControl:m,states:["size","variant","required","focused"]}),v={...r,disableAnimation:s,formControl:m,shrink:g,size:y.size,variant:y.variant,required:y.required,focused:y.focused},C=uq(v);return a.jsx(dq,{"data-shrink":g,ref:n,className:Ce(C.root,p),...f,ownerState:v,classes:C})});function pq(t){return Ze("MuiLinearProgress",t)}et("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const xC=4,bC=dc`
|
|
223
|
+
0% {
|
|
224
|
+
left: -35%;
|
|
225
|
+
right: 100%;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
60% {
|
|
229
|
+
left: 100%;
|
|
230
|
+
right: -90%;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
100% {
|
|
234
|
+
left: 100%;
|
|
235
|
+
right: -90%;
|
|
236
|
+
}
|
|
237
|
+
`,fq=typeof bC!="string"?vp`
|
|
238
|
+
animation: ${bC} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
239
|
+
`:null,SC=dc`
|
|
240
|
+
0% {
|
|
241
|
+
left: -200%;
|
|
242
|
+
right: 100%;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
60% {
|
|
246
|
+
left: 107%;
|
|
247
|
+
right: -8%;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
100% {
|
|
251
|
+
left: 107%;
|
|
252
|
+
right: -8%;
|
|
253
|
+
}
|
|
254
|
+
`,hq=typeof SC!="string"?vp`
|
|
255
|
+
animation: ${SC} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
|
|
256
|
+
`:null,CC=dc`
|
|
257
|
+
0% {
|
|
258
|
+
opacity: 1;
|
|
259
|
+
background-position: 0 -23px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
60% {
|
|
263
|
+
opacity: 0;
|
|
264
|
+
background-position: 0 -23px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
100% {
|
|
268
|
+
opacity: 1;
|
|
269
|
+
background-position: -200px -23px;
|
|
270
|
+
}
|
|
271
|
+
`,mq=typeof CC!="string"?vp`
|
|
272
|
+
animation: ${CC} 3s infinite linear;
|
|
273
|
+
`:null,gq=t=>{const{classes:e,variant:n,color:r}=t,s={root:["root",`color${ue(r)}`,n],dashed:["dashed",`dashedColor${ue(r)}`],bar1:["bar","bar1",`barColor${ue(r)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",n!=="buffer"&&`barColor${ue(r)}`,n==="buffer"&&`color${ue(r)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return Ke(s,pq,e)},u2=(t,e)=>t.vars?t.vars.palette.LinearProgress[`${e}Bg`]:t.palette.mode==="light"?Yo(t.palette[e].main,.62):Jo(t.palette[e].main,.5),yq=ce("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${ue(n.color)}`],e[n.variant]]}})(Ue(({theme:t})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{backgroundColor:u2(t,e)}})),{props:({ownerState:e})=>e.color==="inherit"&&e.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),vq=ce("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.dashed,e[`dashedColor${ue(n.color)}`]]}})(Ue(({theme:t})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(t.palette).filter(bn()).map(([e])=>{const n=u2(t,e);return{props:{color:e},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),mq||{animation:`${CC} 3s infinite linear`}),xq=ce("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.bar,e.bar1,e[`barColor${ue(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&e.bar1Indeterminate,n.variant==="determinate"&&e.bar1Determinate,n.variant==="buffer"&&e.bar1Buffer]}})(Ue(({theme:t})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{backgroundColor:(t.vars||t).palette[e].main}})),{props:{variant:"determinate"},style:{transition:`transform .${xC}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${xC}s linear`}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:{width:"auto"}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:fq||{animation:`${bC} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),bq=ce("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.bar,e.bar2,e[`barColor${ue(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&e.bar2Indeterminate,n.variant==="buffer"&&e.bar2Buffer]}})(Ue(({theme:t})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{"--LinearProgressBar2-barColor":(t.vars||t).palette[e].main}})),{props:({ownerState:e})=>e.variant!=="buffer"&&e.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:e})=>e.variant!=="buffer"&&e.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e,variant:"buffer"},style:{backgroundColor:u2(t,e),transition:`transform .${xC}s linear`}})),{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:{width:"auto"}},{props:({ownerState:e})=>e.variant==="indeterminate"||e.variant==="query",style:hq||{animation:`${SC} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),Sq=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiLinearProgress"}),{className:s,color:i="primary",value:l,valueBuffer:u,variant:p="indeterminate",...f}=r,m={...r,color:i,variant:p},g=gq(m),y=hc(),v={},C={bar1:{},bar2:{}};if((p==="determinate"||p==="buffer")&&l!==void 0){v["aria-valuenow"]=Math.round(l),v["aria-valuemin"]=0,v["aria-valuemax"]=100;let S=l-100;y&&(S=-S),C.bar1.transform=`translateX(${S}%)`}if(p==="buffer"&&u!==void 0){let S=(u||0)-100;y&&(S=-S),C.bar2.transform=`translateX(${S}%)`}return a.jsxs(yq,{className:Ce(g.root,s),ownerState:m,role:"progressbar",...v,ref:n,...f,children:[p==="buffer"?a.jsx(vq,{className:g.dashed,ownerState:m}):null,a.jsx(xq,{className:g.bar1,ownerState:m,style:C.bar1}),p==="determinate"?null:a.jsx(bq,{className:g.bar2,ownerState:m,style:C.bar2})]})});function Cq(t){return Ze("MuiLink",t)}const wq=et("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),jq=({theme:t,ownerState:e})=>{const n=e.color,r=Vl(t,`palette.${n}.main`,!1)||Vl(t,`palette.${n}`,!1)||e.color,s=Vl(t,`palette.${n}.mainChannel`)||Vl(t,`palette.${n}Channel`);return"vars"in t&&s?`rgba(${s} / 0.4)`:wt(r,.4)},Xk={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Tq=t=>{const{classes:e,component:n,focusVisible:r,underline:s}=t,i={root:["root",`underline${ue(s)}`,n==="button"&&"button",r&&"focusVisible"]};return Ke(i,Cq,e)},Dq=ce(G,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${ue(n.underline)}`],n.component==="button"&&e.button]}})(Ue(({theme:t})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:n})=>e==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{underline:"always",color:e},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette[e].mainChannel} / 0.4)`:wt(t.palette[e].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:wt(t.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.secondaryChannel} / 0.4)`:wt(t.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(t.vars||t).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${wq.focusVisible}`]:{outline:"auto"}}}]}))),Ox=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiLink"}),s=vr(),{className:i,color:l="primary",component:u="a",onBlur:p,onFocus:f,TypographyClasses:m,underline:g="always",variant:y="inherit",sx:v,...C}=r,[S,j]=b.useState(!1),D=k=>{nc(k.target)||j(!1),p&&p(k)},M=k=>{nc(k.target)&&j(!0),f&&f(k)},T={...r,color:l,component:u,focusVisible:S,underline:g,variant:y},E=Tq(T);return a.jsx(Dq,{color:l,className:Ce(E.root,i),classes:m,component:u,onBlur:D,onFocus:M,ref:n,ownerState:T,variant:y,...C,sx:[...Xk[l]===void 0?[{color:l}]:[],...Array.isArray(v)?v:[v]],style:{...C.style,...g==="always"&&l!=="inherit"&&!Xk[l]&&{"--Link-underlineColor":jq({theme:s,ownerState:T})}}})}),jo=b.createContext({});function Eq(t){return Ze("MuiList",t)}et("MuiList",["root","padding","dense","subheader"]);const Rq=t=>{const{classes:e,disablePadding:n,dense:r,subheader:s}=t;return Ke({root:["root",!n&&"padding",r&&"dense",s&&"subheader"]},Eq,e)},kq=ce("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>t.subheader,style:{paddingTop:0}}]}),as=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiList"}),{children:s,className:i,component:l="ul",dense:u=!1,disablePadding:p=!1,subheader:f,...m}=r,g=b.useMemo(()=>({dense:u}),[u]),y={...r,component:l,dense:u,disablePadding:p},v=Rq(y);return a.jsx(jo.Provider,{value:g,children:a.jsxs(kq,{as:l,className:Ce(v.root,i),ref:n,ownerState:y,...m,children:[f,s]})})});function Mq(t){return Ze("MuiListItem",t)}et("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function Oq(t){return Ze("MuiListItemButton",t)}const xd=et("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),Aq=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},_q=t=>{const{alignItems:e,classes:n,dense:r,disabled:s,disableGutters:i,divider:l,selected:u}=t,f=Ke({root:["root",r&&"dense",!i&&"gutters",l&&"divider",s&&"disabled",e==="flex-start"&&"alignItemsFlexStart",u&&"selected"]},Oq,n);return{...n,...f}},Iq=ce(Ls,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:Aq})(Ue(({theme:t})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${xd.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${xd.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:wt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${xd.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:wt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${xd.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${xd.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),os=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiListItemButton"}),{alignItems:s="center",autoFocus:i=!1,component:l="div",children:u,dense:p=!1,disableGutters:f=!1,divider:m=!1,focusVisibleClassName:g,selected:y=!1,className:v,...C}=r,S=b.useContext(jo),j=b.useMemo(()=>({dense:p||S.dense||!1,alignItems:s,disableGutters:f}),[s,S.dense,p,f]),D=b.useRef(null);Cs(()=>{i&&D.current&&D.current.focus()},[i]);const M={...r,alignItems:s,dense:j.dense,disableGutters:f,divider:m,selected:y},T=_q(M),E=cr(D,n);return a.jsx(jo.Provider,{value:j,children:a.jsx(Iq,{ref:E,href:C.href||C.to,component:(C.href||C.to)&&l==="div"?"button":l,focusVisibleClassName:Ce(T.focusVisible,g),ownerState:M,className:Ce(T.root,v),...C,classes:T,children:u})})});function Pq(t){return Ze("MuiListItemSecondaryAction",t)}et("MuiListItemSecondaryAction",["root","disableGutters"]);const Lq=t=>{const{disableGutters:e,classes:n}=t;return Ke({root:["root",e&&"disableGutters"]},Pq,n)},zq=ce("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:t})=>t.disableGutters,style:{right:0}}]}),UI=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiListItemSecondaryAction"}),{className:s,...i}=r,l=b.useContext(jo),u={...r,disableGutters:l.disableGutters},p=Lq(u);return a.jsx(zq,{className:Ce(p.root,s),ownerState:u,ref:n,...i})});UI.muiName="ListItemSecondaryAction";const $q=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.hasSecondaryAction&&e.secondaryAction]},Nq=t=>{const{alignItems:e,classes:n,dense:r,disableGutters:s,disablePadding:i,divider:l,hasSecondaryAction:u}=t;return Ke({root:["root",r&&"dense",!s&&"gutters",!i&&"padding",l&&"divider",e==="flex-start"&&"alignItemsFlexStart",u&&"secondaryAction"],container:["container"]},Mq,n)},Fq=ce("div",{name:"MuiListItem",slot:"Root",overridesResolver:$q})(Ue(({theme:t})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${xd.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),Bq=ce("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),Os=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiListItem"}),{alignItems:s="center",children:i,className:l,component:u,components:p={},componentsProps:f={},ContainerComponent:m="li",ContainerProps:{className:g,...y}={},dense:v=!1,disableGutters:C=!1,disablePadding:S=!1,divider:j=!1,secondaryAction:D,slotProps:M={},slots:T={},...E}=r,k=b.useContext(jo),A=b.useMemo(()=>({dense:v||k.dense||!1,alignItems:s,disableGutters:C}),[s,k.dense,v,C]),O=b.useRef(null),I=b.Children.toArray(i),$=I.length&&rh(I[I.length-1],["ListItemSecondaryAction"]),R={...r,alignItems:s,dense:A.dense,disableGutters:C,disablePadding:S,divider:j,hasSecondaryAction:$},P=Nq(R),z=cr(O,n),N=T.root||p.Root||Fq,H=M.root||f.root||{},U={className:Ce(P.root,H.className,l),...E};let L=u||"li";return $?(L=!U.component&&!u?"div":L,m==="li"&&(L==="li"?L="div":U.component==="li"&&(U.component="div")),a.jsx(jo.Provider,{value:A,children:a.jsxs(Bq,{as:m,className:Ce(P.container,g),ref:z,ownerState:R,...y,children:[a.jsx(N,{...H,...!Ua(N)&&{as:L,ownerState:{...R,...H.ownerState}},...U,children:I}),I.pop()]})})):a.jsx(jo.Provider,{value:A,children:a.jsxs(N,{...H,as:L,ref:z,...!Ua(N)&&{ownerState:{...R,...H.ownerState}},...U,children:[I,D&&a.jsx(UI,{children:D})]})})});function Uq(t){return Ze("MuiListItemIcon",t)}const eM=et("MuiListItemIcon",["root","alignItemsFlexStart"]),Vq=t=>{const{alignItems:e,classes:n}=t;return Ke({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},Uq,n)},Hq=ce("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(Ue(({theme:t})=>({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),Un=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiListItemIcon"}),{className:s,...i}=r,l=b.useContext(jo),u={...r,alignItems:l.alignItems},p=Vq(u);return a.jsx(Hq,{className:Ce(p.root,s),ownerState:u,ref:n,...i})});function Wq(t){return Ze("MuiListItemText",t)}const Td=et("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),qq=t=>{const{classes:e,inset:n,primary:r,secondary:s,dense:i}=t;return Ke({root:["root",n&&"inset",i&&"dense",r&&s&&"multiline"],primary:["primary"],secondary:["secondary"]},Wq,e)},Gq=ce("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Td.primary}`]:e.primary},{[`& .${Td.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${yk.root}:where(& .${Td.primary})`]:{display:"block"},[`.${yk.root}:where(& .${Td.secondary})`]:{display:"block"},variants:[{props:({ownerState:t})=>t.primary&&t.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:56}}]}),Zn=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiListItemText"}),{children:s,className:i,disableTypography:l=!1,inset:u=!1,primary:p,primaryTypographyProps:f,secondary:m,secondaryTypographyProps:g,slots:y={},slotProps:v={},...C}=r,{dense:S}=b.useContext(jo);let j=p??s,D=m;const M={...r,disableTypography:l,inset:u,primary:!!j,secondary:!!D,dense:S},T=qq(M),E={slots:y,slotProps:{primary:f,secondary:g,...v}},[k,A]=at("root",{className:Ce(T.root,i),elementType:Gq,externalForwardedProps:{...E,...C},ownerState:M,ref:n}),[O,I]=at("primary",{className:T.primary,elementType:G,externalForwardedProps:E,ownerState:M}),[$,R]=at("secondary",{className:T.secondary,elementType:G,externalForwardedProps:E,ownerState:M});return j!=null&&j.type!==G&&!l&&(j=a.jsx(O,{variant:S?"body2":"body1",component:I!=null&&I.variant?void 0:"span",...I,children:j})),D!=null&&D.type!==G&&!l&&(D=a.jsx($,{variant:"body2",color:"textSecondary",...R,children:D})),a.jsxs(k,{...A,children:[j,D]})});function JS(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function tM(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function VI(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.startsWith(e.keys.join(""))}function Mf(t,e,n,r,s,i){let l=!1,u=s(t,e,e?n:!1);for(;u;){if(u===t.firstChild){if(l)return!1;l=!0}const p=r?!1:u.disabled||u.getAttribute("aria-disabled")==="true";if(!u.hasAttribute("tabindex")||!VI(u,i)||p)u=s(t,u,n);else return u.focus(),!0}return!1}const Zq=b.forwardRef(function(e,n){const{actions:r,autoFocus:s=!1,autoFocusItem:i=!1,children:l,className:u,disabledItemsFocusable:p=!1,disableListWrap:f=!1,onKeyDown:m,variant:g="selectedMenu",...y}=e,v=b.useRef(null),C=b.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Cs(()=>{s&&v.current.focus()},[s]),b.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(T,{direction:E})=>{const k=!v.current.style.width;if(T.clientHeight<v.current.clientHeight&&k){const A=`${eI(Ci(T))}px`;v.current.style[E==="rtl"?"paddingLeft":"paddingRight"]=A,v.current.style.width=`calc(100% + ${A})`}return v.current}}),[]);const S=T=>{const E=v.current,k=T.key;if(T.ctrlKey||T.metaKey||T.altKey){m&&m(T);return}const O=Ir(E).activeElement;if(k==="ArrowDown")T.preventDefault(),Mf(E,O,f,p,JS);else if(k==="ArrowUp")T.preventDefault(),Mf(E,O,f,p,tM);else if(k==="Home")T.preventDefault(),Mf(E,null,f,p,JS);else if(k==="End")T.preventDefault(),Mf(E,null,f,p,tM);else if(k.length===1){const I=C.current,$=k.toLowerCase(),R=performance.now();I.keys.length>0&&(R-I.lastTime>500?(I.keys=[],I.repeating=!0,I.previousKeyMatched=!0):I.repeating&&$!==I.keys[0]&&(I.repeating=!1)),I.lastTime=R,I.keys.push($);const P=O&&!I.repeating&&VI(O,I);I.previousKeyMatched&&(P||Mf(E,O,!1,p,JS,I))?T.preventDefault():I.previousKeyMatched=!1}m&&m(T)},j=cr(v,n);let D=-1;b.Children.forEach(l,(T,E)=>{if(!b.isValidElement(T)){D===E&&(D+=1,D>=l.length&&(D=-1));return}T.props.disabled||(g==="selectedMenu"&&T.props.selected||D===-1)&&(D=E),D===E&&(T.props.disabled||T.props.muiSkipListHighlight||T.type.muiSkipListHighlight)&&(D+=1,D>=l.length&&(D=-1))});const M=b.Children.map(l,(T,E)=>{if(E===D){const k={};return i&&(k.autoFocus=!0),T.props.tabIndex===void 0&&g==="selectedMenu"&&(k.tabIndex=0),b.cloneElement(T,k)}return T});return a.jsx(as,{role:"menu",ref:j,className:u,onKeyDown:S,tabIndex:s?0:-1,...y,children:M})});function Kq(t){return Ze("MuiPopover",t)}et("MuiPopover",["root","paper"]);function nM(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function rM(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function sM(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function vy(t){return typeof t=="function"?t():t}const Qq=t=>{const{classes:e}=t;return Ke({root:["root"],paper:["paper"]},Kq,e)},Jq=ce(o2,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),HI=ce($t,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Yq=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiPopover"}),{action:s,anchorEl:i,anchorOrigin:l={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:p="anchorEl",children:f,className:m,container:g,elevation:y=8,marginThreshold:v=16,open:C,PaperProps:S={},slots:j={},slotProps:D={},transformOrigin:M={vertical:"top",horizontal:"left"},TransitionComponent:T,transitionDuration:E="auto",TransitionProps:k={},disableScrollLock:A=!1,...O}=r,I=b.useRef(),$={...r,anchorOrigin:l,anchorReference:p,elevation:y,marginThreshold:v,transformOrigin:M,TransitionComponent:T,transitionDuration:E,TransitionProps:k},R=Qq($),P=b.useCallback(()=>{if(p==="anchorPosition")return u;const we=vy(i),Ae=(we&&we.nodeType===1?we:Ir(I.current).body).getBoundingClientRect();return{top:Ae.top+nM(Ae,l.vertical),left:Ae.left+rM(Ae,l.horizontal)}},[i,l.horizontal,l.vertical,u,p]),z=b.useCallback(we=>({vertical:nM(we,M.vertical),horizontal:rM(we,M.horizontal)}),[M.horizontal,M.vertical]),N=b.useCallback(we=>{const be={width:we.offsetWidth,height:we.offsetHeight},Ae=z(be);if(p==="none")return{top:null,left:null,transformOrigin:sM(Ae)};const Ne=P();let Ie=Ne.top-Ae.vertical,Fe=Ne.left-Ae.horizontal;const ct=Ie+be.height,Me=Fe+be.width,tt=Ci(vy(i)),Ve=tt.innerHeight-v,it=tt.innerWidth-v;if(v!==null&&Ie<v){const Z=Ie-v;Ie-=Z,Ae.vertical+=Z}else if(v!==null&&ct>Ve){const Z=ct-Ve;Ie-=Z,Ae.vertical+=Z}if(v!==null&&Fe<v){const Z=Fe-v;Fe-=Z,Ae.horizontal+=Z}else if(Me>it){const Z=Me-it;Fe-=Z,Ae.horizontal+=Z}return{top:`${Math.round(Ie)}px`,left:`${Math.round(Fe)}px`,transformOrigin:sM(Ae)}},[i,p,P,z,v]),[H,U]=b.useState(C),L=b.useCallback(()=>{const we=I.current;if(!we)return;const be=N(we);be.top!==null&&we.style.setProperty("top",be.top),be.left!==null&&(we.style.left=be.left),we.style.transformOrigin=be.transformOrigin,U(!0)},[N]);b.useEffect(()=>(A&&window.addEventListener("scroll",L),()=>window.removeEventListener("scroll",L)),[i,A,L]);const W=()=>{L()},K=()=>{U(!1)};b.useEffect(()=>{C&&L()}),b.useImperativeHandle(s,()=>C?{updatePosition:()=>{L()}}:null,[C,L]),b.useEffect(()=>{if(!C)return;const we=Sm(()=>{L()}),be=Ci(vy(i));return be.addEventListener("resize",we),()=>{we.clear(),be.removeEventListener("resize",we)}},[i,C,L]);let Q=E;const le={slots:{transition:T,...j},slotProps:{transition:k,paper:S,...D}},[F,J]=at("transition",{elementType:Rh,externalForwardedProps:le,ownerState:$,getSlotProps:we=>({...we,onEntering:(be,Ae)=>{var Ne;(Ne=we.onEntering)==null||Ne.call(we,be,Ae),W()},onExited:be=>{var Ae;(Ae=we.onExited)==null||Ae.call(we,be),K()}}),additionalProps:{appear:!0,in:C}});E==="auto"&&!F.muiSupportAuto&&(Q=void 0);const ie=g||(i?Ir(vy(i)).body:void 0),[te,{slots:de,slotProps:fe,...Re}]=at("root",{ref:n,elementType:Jq,externalForwardedProps:{...le,...O},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:j.backdrop},slotProps:{backdrop:qw(typeof D.backdrop=="function"?D.backdrop($):D.backdrop,{invisible:!0})},container:ie,open:C},ownerState:$,className:Ce(R.root,m)}),[Pe,$e]=at("paper",{ref:I,className:R.paper,elementType:HI,externalForwardedProps:le,shouldForwardComponentProp:!0,additionalProps:{elevation:y,style:H?void 0:{opacity:0}},ownerState:$});return a.jsx(te,{...Re,...!Ua(te)&&{slots:de,slotProps:fe,disableScrollLock:A},children:a.jsx(F,{...J,timeout:Q,children:a.jsx(Pe,{...$e,children:f})})})});function Xq(t){return Ze("MuiMenu",t)}et("MuiMenu",["root","paper","list"]);const eG={vertical:"top",horizontal:"right"},tG={vertical:"top",horizontal:"left"},nG=t=>{const{classes:e}=t;return Ke({root:["root"],paper:["paper"],list:["list"]},Xq,e)},rG=ce(Yq,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),sG=ce(HI,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),iG=ce(Zq,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),Cp=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiMenu"}),{autoFocus:s=!0,children:i,className:l,disableAutoFocusItem:u=!1,MenuListProps:p={},onClose:f,open:m,PaperProps:g={},PopoverClasses:y,transitionDuration:v="auto",TransitionProps:{onEntering:C,...S}={},variant:j="selectedMenu",slots:D={},slotProps:M={},...T}=r,E=hc(),k={...r,autoFocus:s,disableAutoFocusItem:u,MenuListProps:p,onEntering:C,PaperProps:g,transitionDuration:v,TransitionProps:S,variant:j},A=nG(k),O=s&&!u&&m,I=b.useRef(null),$=(Q,le)=>{I.current&&I.current.adjustStyleForScrollbar(Q,{direction:E?"rtl":"ltr"}),C&&C(Q,le)},R=Q=>{Q.key==="Tab"&&(Q.preventDefault(),f&&f(Q,"tabKeyDown"))};let P=-1;b.Children.map(i,(Q,le)=>{b.isValidElement(Q)&&(Q.props.disabled||(j==="selectedMenu"&&Q.props.selected||P===-1)&&(P=le))});const z={slots:D,slotProps:{list:p,transition:S,paper:g,...M}},N=Ms({elementType:D.root,externalSlotProps:M.root,ownerState:k,className:[A.root,l]}),[H,U]=at("paper",{className:A.paper,elementType:sG,externalForwardedProps:z,shouldForwardComponentProp:!0,ownerState:k}),[L,W]=at("list",{className:Ce(A.list,p.className),elementType:iG,shouldForwardComponentProp:!0,externalForwardedProps:z,getSlotProps:Q=>({...Q,onKeyDown:le=>{var F;R(le),(F=Q.onKeyDown)==null||F.call(Q,le)}}),ownerState:k}),K=typeof z.slotProps.transition=="function"?z.slotProps.transition(k):z.slotProps.transition;return a.jsx(rG,{onClose:f,anchorOrigin:{vertical:"bottom",horizontal:E?"right":"left"},transformOrigin:E?eG:tG,slots:{root:D.root,paper:H,backdrop:D.backdrop,...D.transition&&{transition:D.transition}},slotProps:{root:N,paper:U,backdrop:typeof M.backdrop=="function"?M.backdrop(k):M.backdrop,transition:{...K,onEntering:(...Q)=>{var le;$(...Q),(le=K==null?void 0:K.onEntering)==null||le.call(K,...Q)}}},open:m,ref:n,transitionDuration:v,ownerState:k,...T,classes:y,children:a.jsx(L,{actions:I,autoFocus:s&&(P===-1||u),autoFocusItem:O,variant:j,...W,children:i})})});function oG(t){return Ze("MuiMenuItem",t)}const Of=et("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),aG=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},lG=t=>{const{disabled:e,dense:n,divider:r,disableGutters:s,selected:i,classes:l}=t,p=Ke({root:["root",n&&"dense",e&&"disabled",!s&&"gutters",r&&"divider",i&&"selected"]},oG,l);return{...l,...p}},cG=ce(Ls,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:aG})(Ue(({theme:t})=>({...t.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Of.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Of.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:wt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Of.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:wt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Of.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Of.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${Wk.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${Wk.inset}`]:{marginLeft:52},[`& .${Td.root}`]:{marginTop:0,marginBottom:0},[`& .${Td.inset}`]:{paddingLeft:36},[`& .${eM.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[t.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...t.typography.body2,[`& .${eM.root} svg`]:{fontSize:"1.25rem"}}}]}))),nt=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiMenuItem"}),{autoFocus:s=!1,component:i="li",dense:l=!1,divider:u=!1,disableGutters:p=!1,focusVisibleClassName:f,role:m="menuitem",tabIndex:g,className:y,...v}=r,C=b.useContext(jo),S=b.useMemo(()=>({dense:l||C.dense||!1,disableGutters:p}),[C.dense,l,p]),j=b.useRef(null);Cs(()=>{s&&j.current&&j.current.focus()},[s]);const D={...r,dense:S.dense,divider:u,disableGutters:p},M=lG(r),T=cr(j,n);let E;return r.disabled||(E=g!==void 0?g:-1),a.jsx(jo.Provider,{value:S,children:a.jsx(cG,{ref:T,role:m,tabIndex:E,component:i,focusVisibleClassName:Ce(M.focusVisible,f),className:Ce(M.root,y),...v,ownerState:D,classes:M})})});function uG(t){return Ze("MuiNativeSelect",t)}const d2=et("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),dG=t=>{const{classes:e,variant:n,disabled:r,multiple:s,open:i,error:l}=t,u={select:["select",n,r&&"disabled",s&&"multiple",l&&"error"],icon:["icon",`icon${ue(n)}`,i&&"iconOpen",r&&"disabled"]};return Ke(u,uG,e)},WI=ce("select",{name:"MuiNativeSelect"})(({theme:t})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${d2.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!=="filled"&&e.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]})),pG=ce(WI,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Gr,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${d2.multiple}`]:e.multiple}]}})({}),qI=ce("svg",{name:"MuiNativeSelect"})(({theme:t})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${d2.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),fG=ce(qI,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${ue(n.variant)}`],n.open&&e.iconOpen]}})({}),hG=b.forwardRef(function(e,n){const{className:r,disabled:s,error:i,IconComponent:l,inputRef:u,variant:p="standard",...f}=e,m={...e,disabled:s,variant:p,error:i},g=dG(m);return a.jsxs(b.Fragment,{children:[a.jsx(pG,{ownerState:m,className:Ce(g.select,r),disabled:s,ref:u||n,...f}),e.multiple?null:a.jsx(fG,{as:l,ownerState:m,className:g.icon})]})});var iM;const mG=ce("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:Gr})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),gG=ce("legend",{name:"MuiNotchedOutlined",shouldForwardProp:Gr})(Ue(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]})));function yG(t){const{children:e,classes:n,className:r,label:s,notched:i,...l}=t,u=s!=null&&s!=="",p={...t,notched:i,withLabel:u};return a.jsx(mG,{"aria-hidden":!0,className:r,ownerState:p,...l,children:a.jsx(gG,{ownerState:p,children:u?a.jsx("span",{children:s}):iM||(iM=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:""}))})})}const vG=t=>{const{classes:e}=t,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},$8,e);return{...e,...r}},xG=ce(Rx,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Dx})(Ue(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Bi.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Bi.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Bi.focused} .${Bi.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(bn()).map(([n])=>({props:{color:n},style:{[`&.${Bi.focused} .${Bi.notchedOutline}`]:{borderColor:(t.vars||t).palette[n].main}}})),{props:{},style:{[`&.${Bi.error} .${Bi.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Bi.disabled} .${Bi.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),bG=ce(yG,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(Ue(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}})),SG=ce(kx,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Ex})(Ue(({theme:t})=>({padding:"16.5px 14px",...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),p2=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiOutlinedInput"}),{components:s={},fullWidth:i=!1,inputComponent:l="input",label:u,multiline:p=!1,notched:f,slots:m={},slotProps:g={},type:y="text",...v}=r,C=vG(r),S=Ao(),j=gc({props:r,muiFormControl:S,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),D={...r,color:j.color||"primary",disabled:j.disabled,error:j.error,focused:j.focused,formControl:S,fullWidth:i,hiddenLabel:j.hiddenLabel,multiline:p,size:j.size,type:y},M=m.root??s.Root??xG,T=m.input??s.Input??SG,[E,k]=at("notchedOutline",{elementType:bG,className:C.notchedOutline,shouldForwardComponentProp:!0,ownerState:D,externalForwardedProps:{slots:m,slotProps:g},additionalProps:{label:u!=null&&u!==""&&j.required?a.jsxs(b.Fragment,{children:[u," ","*"]}):u}});return a.jsx(r2,{slots:{root:M,input:T},slotProps:g,renderSuffix:A=>a.jsx(E,{...k,notched:typeof f<"u"?f:!!(A.startAdornment||A.filled||A.focused)}),fullWidth:i,inputComponent:l,multiline:p,ref:n,type:y,...v,classes:{...C,notchedOutline:null}})});p2.muiName="Input";const CG=ye(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),wG=ye(a.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),jG=ce("span",{name:"MuiRadioButtonIcon",shouldForwardProp:Gr})({position:"relative",display:"flex"}),TG=ce(CG,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),DG=ce(wG,{name:"MuiRadioButtonIcon"})(Ue(({theme:t})=>({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}}]})));function GI(t){const{checked:e=!1,classes:n={},fontSize:r}=t,s={...t,checked:e};return a.jsxs(jG,{className:n.root,ownerState:s,children:[a.jsx(TG,{fontSize:r,className:n.background,ownerState:s}),a.jsx(DG,{fontSize:r,className:n.dot,ownerState:s})]})}const EG=b.createContext(void 0);function RG(){return b.useContext(EG)}function kG(t){return Ze("MuiRadio",t)}const oM=et("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),MG=t=>{const{classes:e,color:n,size:r}=t,s={root:["root",`color${ue(n)}`,r!=="medium"&&`size${ue(r)}`]};return{...e,...Ke(s,kG,e)}},OG=ce(i2,{shouldForwardProp:t=>Gr(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${ue(n.size)}`],e[`color${ue(n.color)}`]]}})(Ue(({theme:t})=>({color:(t.vars||t).palette.text.secondary,[`&.${oM.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e,disabled:!1},style:{[`&.${oM.checked}`]:{color:(t.vars||t).palette[e].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function AG(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const _G=a.jsx(GI,{checked:!0}),IG=a.jsx(GI,{}),PG=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiRadio"}),{checked:s,checkedIcon:i=_G,color:l="primary",icon:u=IG,name:p,onChange:f,size:m="medium",className:g,disabled:y,disableRipple:v=!1,slots:C={},slotProps:S={},inputProps:j,...D}=r,M=Ao();let T=y;M&&typeof T>"u"&&(T=M.disabled),T??(T=!1);const E={...r,disabled:T,disableRipple:v,color:l,size:m},k=MG(E),A=RG();let O=s;const I=nC(f,A&&A.onChange);let $=p;A&&(typeof O>"u"&&(O=AG(A.value,r.value)),typeof $>"u"&&($=A.name));const R=S.input??j,[P,z]=at("root",{ref:n,elementType:OG,className:Ce(k.root,g),shouldForwardComponentProp:!0,externalForwardedProps:{slots:C,slotProps:S,...D},getSlotProps:N=>({...N,onChange:(H,...U)=>{var L;(L=N.onChange)==null||L.call(N,H,...U),I(H,...U)}}),ownerState:E,additionalProps:{type:"radio",icon:b.cloneElement(u,{fontSize:u.props.fontSize??m}),checkedIcon:b.cloneElement(i,{fontSize:i.props.fontSize??m}),disabled:T,name:$,checked:O,slots:C,slotProps:{input:typeof R=="function"?R(E):R}}});return a.jsx(P,{...z,classes:k})});function ZI(t){return Ze("MuiSelect",t)}const Af=et("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var aM;const LG=ce(WI,{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${Af.select}`]:e.select},{[`&.${Af.select}`]:e[n.variant]},{[`&.${Af.error}`]:e.error},{[`&.${Af.multiple}`]:e.multiple}]}})({[`&.${Af.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),zG=ce(qI,{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${ue(n.variant)}`],n.open&&e.iconOpen]}})({}),$G=ce("input",{shouldForwardProp:t=>Cx(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function lM(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function NG(t){return t==null||typeof t=="string"&&!t.trim()}const FG=t=>{const{classes:e,variant:n,disabled:r,multiple:s,open:i,error:l}=t,u={select:["select",n,r&&"disabled",s&&"multiple",l&&"error"],icon:["icon",`icon${ue(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ke(u,ZI,e)},BG=b.forwardRef(function(e,n){var kt;const{"aria-describedby":r,"aria-label":s,autoFocus:i,autoWidth:l,children:u,className:p,defaultOpen:f,defaultValue:m,disabled:g,displayEmpty:y,error:v=!1,IconComponent:C,inputRef:S,labelId:j,MenuProps:D={},multiple:M,name:T,onBlur:E,onChange:k,onClose:A,onFocus:O,onOpen:I,open:$,readOnly:R,renderValue:P,required:z,SelectDisplayProps:N={},tabIndex:H,type:U,value:L,variant:W="standard",...K}=e,[Q,le]=Ba({controlled:L,default:m,name:"Select"}),[F,J]=Ba({controlled:$,default:f,name:"Select"}),ie=b.useRef(null),te=b.useRef(null),[de,fe]=b.useState(null),{current:Re}=b.useRef($!=null),[Pe,$e]=b.useState(),we=cr(n,S),be=b.useCallback(Ge=>{te.current=Ge,Ge&&fe(Ge)},[]),Ae=de==null?void 0:de.parentNode;b.useImperativeHandle(we,()=>({focus:()=>{te.current.focus()},node:ie.current,value:Q}),[Q]),b.useEffect(()=>{f&&F&&de&&!Re&&($e(l?null:Ae.clientWidth),te.current.focus())},[de,l]),b.useEffect(()=>{i&&te.current.focus()},[i]),b.useEffect(()=>{if(!j)return;const Ge=Ir(te.current).getElementById(j);if(Ge){const gt=()=>{getSelection().isCollapsed&&te.current.focus()};return Ge.addEventListener("click",gt),()=>{Ge.removeEventListener("click",gt)}}},[j]);const Ne=(Ge,gt)=>{Ge?I&&I(gt):A&&A(gt),Re||($e(l?null:Ae.clientWidth),J(Ge))},Ie=Ge=>{Ge.button===0&&(Ge.preventDefault(),te.current.focus(),Ne(!0,Ge))},Fe=Ge=>{Ne(!1,Ge)},ct=b.Children.toArray(u),Me=Ge=>{const gt=ct.find(dn=>dn.props.value===Ge.target.value);gt!==void 0&&(le(gt.props.value),k&&k(Ge,gt))},tt=Ge=>gt=>{let dn;if(gt.currentTarget.hasAttribute("tabindex")){if(M){dn=Array.isArray(Q)?Q.slice():[];const $n=Q.indexOf(Ge.props.value);$n===-1?dn.push(Ge.props.value):dn.splice($n,1)}else dn=Ge.props.value;if(Ge.props.onClick&&Ge.props.onClick(gt),Q!==dn&&(le(dn),k)){const $n=gt.nativeEvent||gt,dr=new $n.constructor($n.type,$n);Object.defineProperty(dr,"target",{writable:!0,value:{value:dn,name:T}}),k(dr,Ge)}M||Ne(!1,gt)}},Ve=Ge=>{R||[" ","ArrowUp","ArrowDown","Enter"].includes(Ge.key)&&(Ge.preventDefault(),Ne(!0,Ge))},it=de!==null&&F,Z=Ge=>{!it&&E&&(Object.defineProperty(Ge,"target",{writable:!0,value:{value:Q,name:T}}),E(Ge))};delete K["aria-invalid"];let q,se;const xe=[];let ee=!1;(vv({value:Q})||y)&&(P?q=P(Q):ee=!0);const ne=ct.map(Ge=>{if(!b.isValidElement(Ge))return null;let gt;if(M){if(!Array.isArray(Q))throw new Error(Wa(2));gt=Q.some(dn=>lM(dn,Ge.props.value)),gt&&ee&&xe.push(Ge.props.children)}else gt=lM(Q,Ge.props.value),gt&&ee&&(se=Ge.props.children);return b.cloneElement(Ge,{"aria-selected":gt?"true":"false",onClick:tt(Ge),onKeyUp:dn=>{dn.key===" "&&dn.preventDefault(),Ge.props.onKeyUp&&Ge.props.onKeyUp(dn)},role:"option",selected:gt,value:void 0,"data-value":Ge.props.value})});ee&&(M?xe.length===0?q=null:q=xe.reduce((Ge,gt,dn)=>(Ge.push(gt),dn<xe.length-1&&Ge.push(", "),Ge),[]):q=se);let he=Pe;!l&&Re&&de&&(he=Ae.clientWidth);let je;typeof H<"u"?je=H:je=g?null:0;const ze=N.id||(T?`mui-component-select-${T}`:void 0),ke={...e,variant:W,value:Q,open:it,error:v},Be=FG(ke),xt={...D.PaperProps,...(kt=D.slotProps)==null?void 0:kt.paper},vt=pc();return a.jsxs(b.Fragment,{children:[a.jsx(LG,{as:"div",ref:be,tabIndex:je,role:"combobox","aria-controls":it?vt:void 0,"aria-disabled":g?"true":void 0,"aria-expanded":it?"true":"false","aria-haspopup":"listbox","aria-label":s,"aria-labelledby":[j,ze].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":z?"true":void 0,"aria-invalid":v?"true":void 0,onKeyDown:Ve,onMouseDown:g||R?null:Ie,onBlur:Z,onFocus:O,...N,ownerState:ke,className:Ce(N.className,Be.select,p),id:ze,children:NG(q)?aM||(aM=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):q}),a.jsx($G,{"aria-invalid":v,value:Array.isArray(Q)?Q.join(","):Q,name:T,ref:ie,"aria-hidden":!0,onChange:Me,tabIndex:-1,disabled:g,className:Be.nativeInput,autoFocus:i,required:z,...K,ownerState:ke}),a.jsx(zG,{as:C,className:Be.icon,ownerState:ke}),a.jsx(Cp,{id:`menu-${T||""}`,anchorEl:Ae,open:it,onClose:Fe,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...D,slotProps:{...D.slotProps,list:{"aria-labelledby":j,role:"listbox","aria-multiselectable":M?"true":void 0,disableListWrap:!0,id:vt,...D.MenuListProps},paper:{...xt,style:{minWidth:he,...xt!=null?xt.style:null}}},children:ne})]})}),UG=t=>{const{classes:e}=t,r=Ke({root:["root"]},ZI,e);return{...e,...r}},f2={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>Gr(t)&&t!=="variant",slot:"Root"},VG=ce(l2,f2)(""),HG=ce(p2,f2)(""),WG=ce(a2,f2)(""),wn=b.forwardRef(function(e,n){const r=Qe({name:"MuiSelect",props:e}),{autoWidth:s=!1,children:i,classes:l={},className:u,defaultOpen:p=!1,displayEmpty:f=!1,IconComponent:m=OI,id:g,input:y,inputProps:v,label:C,labelId:S,MenuProps:j,multiple:D=!1,native:M=!1,onClose:T,onOpen:E,open:k,renderValue:A,SelectDisplayProps:O,variant:I="outlined",...$}=r,R=M?hG:BG,P=Ao(),z=gc({props:r,muiFormControl:P,states:["variant","error"]}),N=z.variant||I,H={...r,variant:N,classes:l},U=UG(H),{root:L,...W}=U,K=y||{standard:a.jsx(VG,{ownerState:H}),outlined:a.jsx(HG,{label:C,ownerState:H}),filled:a.jsx(WG,{ownerState:H})}[N],Q=cr(n,fc(K));return a.jsx(b.Fragment,{children:b.cloneElement(K,{inputComponent:R,inputProps:{children:i,error:z.error,IconComponent:m,variant:N,type:void 0,multiple:D,...M?{id:g}:{autoWidth:s,defaultOpen:p,displayEmpty:f,labelId:S,MenuProps:j,onClose:T,onOpen:E,open:k,renderValue:A,SelectDisplayProps:{id:g,...O}},...v,classes:v?ls(W,v.classes):W,...y?y.props.inputProps:{}},...(D&&M||f)&&N==="outlined"?{notched:!0}:{},ref:Q,className:Ce(K.props.className,u,U.root),...!y&&{variant:N},...$})})});wn.muiName="Select";function qG(t,e,n=(r,s)=>r===s){return t.length===e.length&&t.every((r,s)=>n(r,e[s]))}const GG=2;function hd(t,e,n,r,s){return n===1?Math.min(t+e,s):Math.max(t-e,r)}function KI(t,e){return t-e}function cM(t,e){const{index:n}=t.reduce((r,s,i)=>{const l=Math.abs(e-s);return r===null||l<r.distance||l===r.distance?{distance:l,index:i}:r},null)??{};return n}function xy(t,e){if(e.current!==void 0&&t.changedTouches){const n=t;for(let r=0;r<n.changedTouches.length;r+=1){const s=n.changedTouches[r];if(s.identifier===e.current)return{x:s.clientX,y:s.clientY}}return!1}return{x:t.clientX,y:t.clientY}}function bv(t,e,n){return(t-e)*100/(n-e)}function ZG(t,e,n){return(n-e)*t+e}function KG(t){if(Math.abs(t)<1){const n=t.toExponential().split("e-"),r=n[0].split(".")[1];return(r?r.length:0)+parseInt(n[1],10)}const e=t.toString().split(".")[1];return e?e.length:0}function QG(t,e,n){const r=Math.round((t-n)/e)*e+n;return Number(r.toFixed(KG(e)))}function uM({values:t,newValue:e,index:n}){const r=t.slice();return r[n]=e,r.sort(KI)}function by({sliderRef:t,activeIndex:e,setActive:n}){var s,i,l;const r=Ir(t.current);(!((s=t.current)!=null&&s.contains(r.activeElement))||Number((i=r==null?void 0:r.activeElement)==null?void 0:i.getAttribute("data-index"))!==e)&&((l=t.current)==null||l.querySelector(`[type="range"][data-index="${e}"]`).focus()),n&&n(e)}function Sy(t,e){return typeof t=="number"&&typeof e=="number"?t===e:typeof t=="object"&&typeof e=="object"?qG(t,e):!1}const JG={horizontal:{offset:t=>({left:`${t}%`}),leap:t=>({width:`${t}%`})},"horizontal-reverse":{offset:t=>({right:`${t}%`}),leap:t=>({width:`${t}%`})},vertical:{offset:t=>({bottom:`${t}%`}),leap:t=>({height:`${t}%`})}},YG=t=>t;let Cy;function dM(){return Cy===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Cy=CSS.supports("touch-action","none"):Cy=!0),Cy}function XG(t){const{"aria-labelledby":e,defaultValue:n,disabled:r=!1,disableSwap:s=!1,isRtl:i=!1,marks:l=!1,max:u=100,min:p=0,name:f,onChange:m,onChangeCommitted:g,orientation:y="horizontal",rootRef:v,scale:C=YG,step:S=1,shiftStep:j=10,tabIndex:D,value:M}=t,T=b.useRef(void 0),[E,k]=b.useState(-1),[A,O]=b.useState(-1),[I,$]=b.useState(!1),R=b.useRef(0),P=b.useRef(null),[z,N]=Ba({controlled:M,default:n??p,name:"Slider"}),H=m&&((ee,ne,he)=>{const je=ee.nativeEvent||ee,ze=new je.constructor(je.type,je);Object.defineProperty(ze,"target",{writable:!0,value:{value:ne,name:f}}),P.current=ne,m(ze,ne,he)}),U=Array.isArray(z);let L=U?z.slice().sort(KI):[z];L=L.map(ee=>ee==null?p:yd(ee,p,u));const W=l===!0&&S!==null?[...Array(Math.floor((u-p)/S)+1)].map((ee,ne)=>({value:p+S*ne})):l||[],K=W.map(ee=>ee.value),[Q,le]=b.useState(-1),F=b.useRef(null),J=cr(v,F),ie=ee=>ne=>{var je;const he=Number(ne.currentTarget.getAttribute("data-index"));nc(ne.target)&&le(he),O(he),(je=ee==null?void 0:ee.onFocus)==null||je.call(ee,ne)},te=ee=>ne=>{var he;nc(ne.target)||le(-1),O(-1),(he=ee==null?void 0:ee.onBlur)==null||he.call(ee,ne)},de=(ee,ne)=>{const he=Number(ee.currentTarget.getAttribute("data-index")),je=L[he],ze=K.indexOf(je);let ke=ne;if(W&&S==null){const Be=K[K.length-1];ke>=Be?ke=Be:ke<=K[0]?ke=K[0]:ke=ke<je?K[ze-1]:K[ze+1]}if(ke=yd(ke,p,u),U){s&&(ke=yd(ke,L[he-1]||-1/0,L[he+1]||1/0));const Be=ke;ke=uM({values:L,newValue:ke,index:he});let xt=he;s||(xt=ke.indexOf(Be)),by({sliderRef:F,activeIndex:xt})}N(ke),le(he),H&&!Sy(ke,z)&&H(ee,ke,he),g&&g(ee,P.current??ke)},fe=ee=>ne=>{var he;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(ne.key)){ne.preventDefault();const je=Number(ne.currentTarget.getAttribute("data-index")),ze=L[je];let ke=null;if(S!=null){const Be=ne.shiftKey?j:S;switch(ne.key){case"ArrowUp":ke=hd(ze,Be,1,p,u);break;case"ArrowRight":ke=hd(ze,Be,i?-1:1,p,u);break;case"ArrowDown":ke=hd(ze,Be,-1,p,u);break;case"ArrowLeft":ke=hd(ze,Be,i?1:-1,p,u);break;case"PageUp":ke=hd(ze,j,1,p,u);break;case"PageDown":ke=hd(ze,j,-1,p,u);break;case"Home":ke=p;break;case"End":ke=u;break}}else if(W){const Be=K[K.length-1],xt=K.indexOf(ze),vt=[i?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],kt=[i?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];vt.includes(ne.key)?xt===0?ke=K[0]:ke=K[xt-1]:kt.includes(ne.key)&&(xt===K.length-1?ke=Be:ke=K[xt+1])}ke!=null&&de(ne,ke)}(he=ee==null?void 0:ee.onKeyDown)==null||he.call(ee,ne)};Cs(()=>{var ee;r&&F.current.contains(document.activeElement)&&((ee=document.activeElement)==null||ee.blur())},[r]),r&&E!==-1&&k(-1),r&&Q!==-1&&le(-1);const Re=ee=>ne=>{var he;(he=ee.onChange)==null||he.call(ee,ne),de(ne,ne.target.valueAsNumber)},Pe=b.useRef(void 0);let $e=y;i&&y==="horizontal"&&($e+="-reverse");const we=({finger:ee,move:ne=!1})=>{const{current:he}=F,{width:je,height:ze,bottom:ke,left:Be}=he.getBoundingClientRect();let xt;$e.startsWith("vertical")?xt=(ke-ee.y)/ze:xt=(ee.x-Be)/je,$e.includes("-reverse")&&(xt=1-xt);let vt;if(vt=ZG(xt,p,u),S)vt=QG(vt,S,p);else{const Ge=cM(K,vt);vt=K[Ge]}vt=yd(vt,p,u);let kt=0;if(U){ne?kt=Pe.current:kt=cM(L,vt),s&&(vt=yd(vt,L[kt-1]||-1/0,L[kt+1]||1/0));const Ge=vt;vt=uM({values:L,newValue:vt,index:kt}),s&&ne||(kt=vt.indexOf(Ge),Pe.current=kt)}return{newValue:vt,activeIndex:kt}},be=Dr(ee=>{const ne=xy(ee,T);if(!ne)return;if(R.current+=1,ee.type==="mousemove"&&ee.buttons===0){Ae(ee);return}const{newValue:he,activeIndex:je}=we({finger:ne,move:!0});by({sliderRef:F,activeIndex:je,setActive:k}),N(he),!I&&R.current>GG&&$(!0),H&&!Sy(he,z)&&H(ee,he,je)}),Ae=Dr(ee=>{const ne=xy(ee,T);if($(!1),!ne)return;const{newValue:he}=we({finger:ne,move:!0});k(-1),ee.type==="touchend"&&O(-1),g&&g(ee,P.current??he),T.current=void 0,Ie()}),Ne=Dr(ee=>{if(r)return;dM()||ee.preventDefault();const ne=ee.changedTouches[0];ne!=null&&(T.current=ne.identifier);const he=xy(ee,T);if(he!==!1){const{newValue:ze,activeIndex:ke}=we({finger:he});by({sliderRef:F,activeIndex:ke,setActive:k}),N(ze),H&&!Sy(ze,z)&&H(ee,ze,ke)}R.current=0;const je=Ir(F.current);je.addEventListener("touchmove",be,{passive:!0}),je.addEventListener("touchend",Ae,{passive:!0})}),Ie=b.useCallback(()=>{const ee=Ir(F.current);ee.removeEventListener("mousemove",be),ee.removeEventListener("mouseup",Ae),ee.removeEventListener("touchmove",be),ee.removeEventListener("touchend",Ae)},[Ae,be]);b.useEffect(()=>{const{current:ee}=F;return ee.addEventListener("touchstart",Ne,{passive:dM()}),()=>{ee.removeEventListener("touchstart",Ne),Ie()}},[Ie,Ne]),b.useEffect(()=>{r&&Ie()},[r,Ie]);const Fe=ee=>ne=>{var ze;if((ze=ee.onMouseDown)==null||ze.call(ee,ne),r||ne.defaultPrevented||ne.button!==0)return;ne.preventDefault();const he=xy(ne,T);if(he!==!1){const{newValue:ke,activeIndex:Be}=we({finger:he});by({sliderRef:F,activeIndex:Be,setActive:k}),N(ke),H&&!Sy(ke,z)&&H(ne,ke,Be)}R.current=0;const je=Ir(F.current);je.addEventListener("mousemove",be,{passive:!0}),je.addEventListener("mouseup",Ae)},ct=bv(U?L[0]:p,p,u),Me=bv(L[L.length-1],p,u)-ct,tt=(ee={})=>{const ne=lu(ee),he={onMouseDown:Fe(ne||{})},je={...ne,...he};return{...ee,ref:J,...je}},Ve=ee=>ne=>{var je;(je=ee.onMouseOver)==null||je.call(ee,ne);const he=Number(ne.currentTarget.getAttribute("data-index"));O(he)},it=ee=>ne=>{var he;(he=ee.onMouseLeave)==null||he.call(ee,ne),O(-1)},Z=(ee={})=>{const ne=lu(ee),he={onMouseOver:Ve(ne||{}),onMouseLeave:it(ne||{})};return{...ee,...ne,...he}},q=ee=>({pointerEvents:E!==-1&&E!==ee?"none":void 0});let se;return y==="vertical"&&(se=i?"vertical-rl":"vertical-lr"),{active:E,axis:$e,axisProps:JG,dragging:I,focusedThumbIndex:Q,getHiddenInputProps:(ee={})=>{const ne=lu(ee),he={onChange:Re(ne||{}),onFocus:ie(ne||{}),onBlur:te(ne||{}),onKeyDown:fe(ne||{})},je={...ne,...he};return{tabIndex:D,"aria-labelledby":e,"aria-orientation":y,"aria-valuemax":C(u),"aria-valuemin":C(p),name:f,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":t.step??void 0,disabled:r,...ee,...je,style:{...XB,direction:i?"rtl":"ltr",width:"100%",height:"100%",writingMode:se}}},getRootProps:tt,getThumbProps:Z,marks:W,open:A,range:U,rootRef:J,trackLeap:Me,trackOffset:ct,values:L,getThumbStyle:q}}const eZ=t=>!t||!Ua(t);function tZ(t){return Ze("MuiSlider",t)}const Ki=et("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),nZ=t=>{const{open:e}=t;return{offset:Ce(e&&Ki.valueLabelOpen),circle:Ki.valueLabelCircle,label:Ki.valueLabelLabel}};function rZ(t){const{children:e,className:n,value:r}=t,s=nZ(t);return e?b.cloneElement(e,{className:Ce(e.props.className)},a.jsxs(b.Fragment,{children:[e.props.children,a.jsx("span",{className:Ce(s.offset,n),"aria-hidden":!0,children:a.jsx("span",{className:s.circle,children:a.jsx("span",{className:s.label,children:r})})})]})):null}function pM(t){return t}const sZ=ce("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${ue(n.color)}`],n.size!=="medium"&&e[`size${ue(n.size)}`],n.marked&&e.marked,n.orientation==="vertical"&&e.vertical,n.track==="inverted"&&e.trackInverted,n.track===!1&&e.trackFalse]}})(Ue(({theme:t})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Ki.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${Ki.dragging}`]:{[`& .${Ki.thumb}, & .${Ki.track}`]:{transition:"none"}},variants:[...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),iZ=ce("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(t,e)=>e.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),oZ=ce("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(Ue(({theme:t})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e,track:"inverted"},style:{...t.vars?{backgroundColor:t.vars.palette.Slider[`${e}Track`],borderColor:t.vars.palette.Slider[`${e}Track`]}:{backgroundColor:Yo(t.palette[e].main,.62),borderColor:Yo(t.palette[e].main,.62),...t.applyStyles("dark",{backgroundColor:Jo(t.palette[e].main,.5)}),...t.applyStyles("dark",{borderColor:Jo(t.palette[e].main,.5)})}}}))]}))),aZ=ce("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.thumb,e[`thumbColor${ue(n.color)}`],n.size!=="medium"&&e[`thumbSize${ue(n.size)}`]]}})(Ue(({theme:t})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${Ki.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{[`&:hover, &.${Ki.focusVisible}`]:{...t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${wt(t.palette[e].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${Ki.active}`]:{...t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${wt(t.palette[e].main,.16)}`}}}}))]}))),lZ=ce(rZ,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(Ue(({theme:t})=>({zIndex:1,whiteSpace:"nowrap",...t.typography.body2,fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${Ki.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${Ki.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}))),cZ=ce("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>Cx(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:n}=t;return[e.mark,n&&e.markActive]}})(Ue(({theme:t})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]}))),uZ=ce("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>Cx(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(Ue(({theme:t})=>({...t.typography.body2,color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]}))),dZ=t=>{const{disabled:e,dragging:n,marked:r,orientation:s,track:i,classes:l,color:u,size:p}=t,f={root:["root",e&&"disabled",n&&"dragging",r&&"marked",s==="vertical"&&"vertical",i==="inverted"&&"trackInverted",i===!1&&"trackFalse",u&&`color${ue(u)}`,p&&`size${ue(p)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",p&&`thumbSize${ue(p)}`,u&&`thumbColor${ue(u)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Ke(f,tZ,l)},pZ=({children:t})=>t,QI=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiSlider"}),s=hc(),{"aria-label":i,"aria-valuetext":l,"aria-labelledby":u,component:p="span",components:f={},componentsProps:m={},color:g="primary",classes:y,className:v,disableSwap:C=!1,disabled:S=!1,getAriaLabel:j,getAriaValueText:D,marks:M=!1,max:T=100,min:E=0,name:k,onChange:A,onChangeCommitted:O,orientation:I="horizontal",shiftStep:$=10,size:R="medium",step:P=1,scale:z=pM,slotProps:N,slots:H,tabIndex:U,track:L="normal",value:W,valueLabelDisplay:K="off",valueLabelFormat:Q=pM,...le}=r,F={...r,isRtl:s,max:T,min:E,classes:y,disabled:S,disableSwap:C,orientation:I,marks:M,color:g,size:R,step:P,shiftStep:$,scale:z,track:L,valueLabelDisplay:K,valueLabelFormat:Q},{axisProps:J,getRootProps:ie,getHiddenInputProps:te,getThumbProps:de,open:fe,active:Re,axis:Pe,focusedThumbIndex:$e,range:we,dragging:be,marks:Ae,values:Ne,trackOffset:Ie,trackLeap:Fe,getThumbStyle:ct}=XG({...F,rootRef:n});F.marked=Ae.length>0&&Ae.some(jt=>jt.label),F.dragging=be,F.focusedThumbIndex=$e;const Me=dZ(F),tt=(H==null?void 0:H.root)??f.Root??sZ,Ve=(H==null?void 0:H.rail)??f.Rail??iZ,it=(H==null?void 0:H.track)??f.Track??oZ,Z=(H==null?void 0:H.thumb)??f.Thumb??aZ,q=(H==null?void 0:H.valueLabel)??f.ValueLabel??lZ,se=(H==null?void 0:H.mark)??f.Mark??cZ,xe=(H==null?void 0:H.markLabel)??f.MarkLabel??uZ,ee=(H==null?void 0:H.input)??f.Input??"input",ne=(N==null?void 0:N.root)??m.root,he=(N==null?void 0:N.rail)??m.rail,je=(N==null?void 0:N.track)??m.track,ze=(N==null?void 0:N.thumb)??m.thumb,ke=(N==null?void 0:N.valueLabel)??m.valueLabel,Be=(N==null?void 0:N.mark)??m.mark,xt=(N==null?void 0:N.markLabel)??m.markLabel,vt=(N==null?void 0:N.input)??m.input,kt=Ms({elementType:tt,getSlotProps:ie,externalSlotProps:ne,externalForwardedProps:le,additionalProps:{...eZ(tt)&&{as:p}},ownerState:{...F,...ne==null?void 0:ne.ownerState},className:[Me.root,v]}),Ge=Ms({elementType:Ve,externalSlotProps:he,ownerState:F,className:Me.rail}),gt=Ms({elementType:it,externalSlotProps:je,additionalProps:{style:{...J[Pe].offset(Ie),...J[Pe].leap(Fe)}},ownerState:{...F,...je==null?void 0:je.ownerState},className:Me.track}),dn=Ms({elementType:Z,getSlotProps:de,externalSlotProps:ze,ownerState:{...F,...ze==null?void 0:ze.ownerState},className:Me.thumb}),$n=Ms({elementType:q,externalSlotProps:ke,ownerState:{...F,...ke==null?void 0:ke.ownerState},className:Me.valueLabel}),dr=Ms({elementType:se,externalSlotProps:Be,ownerState:F,className:Me.mark}),tr=Ms({elementType:xe,externalSlotProps:xt,ownerState:F,className:Me.markLabel}),Lr=Ms({elementType:ee,getSlotProps:te,externalSlotProps:vt,ownerState:F});return a.jsxs(tt,{...kt,children:[a.jsx(Ve,{...Ge}),a.jsx(it,{...gt}),Ae.filter(jt=>jt.value>=E&&jt.value<=T).map((jt,_t)=>{const an=bv(jt.value,E,T),Vn=J[Pe].offset(an);let Sn;return L===!1?Sn=Ne.includes(jt.value):Sn=L==="normal"&&(we?jt.value>=Ne[0]&&jt.value<=Ne[Ne.length-1]:jt.value<=Ne[0])||L==="inverted"&&(we?jt.value<=Ne[0]||jt.value>=Ne[Ne.length-1]:jt.value>=Ne[0]),a.jsxs(b.Fragment,{children:[a.jsx(se,{"data-index":_t,...dr,...!Ua(se)&&{markActive:Sn},style:{...Vn,...dr.style},className:Ce(dr.className,Sn&&Me.markActive)}),jt.label!=null?a.jsx(xe,{"aria-hidden":!0,"data-index":_t,...tr,...!Ua(xe)&&{markLabelActive:Sn},style:{...Vn,...tr.style},className:Ce(Me.markLabel,tr.className,Sn&&Me.markLabelActive),children:jt.label}):null]},_t)}),Ne.map((jt,_t)=>{const an=bv(jt,E,T),Vn=J[Pe].offset(an),Sn=K==="off"?pZ:q;return a.jsx(Sn,{...!Ua(Sn)&&{valueLabelFormat:Q,valueLabelDisplay:K,value:typeof Q=="function"?Q(z(jt),_t):Q,index:_t,open:fe===_t||Re===_t||K==="on",disabled:S},...$n,children:a.jsx(Z,{"data-index":_t,...dn,className:Ce(Me.thumb,dn.className,Re===_t&&Me.active,$e===_t&&Me.focusVisible),style:{...Vn,...ct(_t),...dn.style},children:a.jsx(ee,{"data-index":_t,"aria-label":j?j(_t):i,"aria-valuenow":z(jt),"aria-labelledby":u,"aria-valuetext":D?D(z(jt),_t):l,value:Ne[_t],...Lr})})},_t)})]})});function fZ(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:s,resumeHideDuration:i}=t,l=Hl();b.useEffect(()=>{if(!s)return;function D(M){M.defaultPrevented||M.key==="Escape"&&(r==null||r(M,"escapeKeyDown"))}return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[s,r]);const u=Dr((D,M)=>{r==null||r(D,M)}),p=Dr(D=>{!r||D==null||l.start(D,()=>{u(null,"timeout")})});b.useEffect(()=>(s&&p(e),l.clear),[s,e,p,l]);const f=D=>{r==null||r(D,"clickaway")},m=l.clear,g=b.useCallback(()=>{e!=null&&p(i??e*.5)},[e,i,p]),y=D=>M=>{const T=D.onBlur;T==null||T(M),g()},v=D=>M=>{const T=D.onFocus;T==null||T(M),m()},C=D=>M=>{const T=D.onMouseEnter;T==null||T(M),m()},S=D=>M=>{const T=D.onMouseLeave;T==null||T(M),g()};return b.useEffect(()=>{if(!n&&s)return window.addEventListener("focus",g),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",g),window.removeEventListener("blur",m)}},[n,s,g,m]),{getRootProps:(D={})=>{const M={...lu(t),...lu(D)};return{role:"presentation",...D,...M,onBlur:y(M),onFocus:v(M),onMouseEnter:C(M),onMouseLeave:S(M)}},onClickAway:f}}function hZ(t){return Ze("MuiSnackbarContent",t)}et("MuiSnackbarContent",["root","message","action"]);const mZ=t=>{const{classes:e}=t;return Ke({root:["root"],action:["action"],message:["message"]},hZ,e)},gZ=ce($t,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(Ue(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=fv(t.palette.background.default,e);return{...t.typography.body2,color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),yZ=ce("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),vZ=ce("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),xZ=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiSnackbarContent"}),{action:s,className:i,message:l,role:u="alert",...p}=r,f=r,m=mZ(f);return a.jsxs(gZ,{role:u,square:!0,elevation:6,className:Ce(m.root,i),ownerState:f,ref:n,...p,children:[a.jsx(yZ,{className:m.message,ownerState:f,children:l}),s?a.jsx(vZ,{className:m.action,ownerState:f,children:s}):null]})});function bZ(t){return Ze("MuiSnackbar",t)}et("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const SZ=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${ue(n.vertical)}${ue(n.horizontal)}`]};return Ke(r,bZ,e)},CZ=ce("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${ue(n.anchorOrigin.vertical)}${ue(n.anchorOrigin.horizontal)}`]]}})(Ue(({theme:t})=>({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:e})=>e.anchorOrigin.vertical==="top",style:{top:8,[t.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:e})=>e.anchorOrigin.vertical!=="top",style:{bottom:8,[t.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[t.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[t.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="center",style:{[t.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),ea=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiSnackbar"}),s=vr(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{action:l,anchorOrigin:{vertical:u,horizontal:p}={vertical:"bottom",horizontal:"left"},autoHideDuration:f=null,children:m,className:g,ClickAwayListenerProps:y,ContentProps:v,disableWindowBlurListener:C=!1,message:S,onBlur:j,onClose:D,onFocus:M,onMouseEnter:T,onMouseLeave:E,open:k,resumeHideDuration:A,slots:O={},slotProps:I={},TransitionComponent:$,transitionDuration:R=i,TransitionProps:{onEnter:P,onExited:z,...N}={},...H}=r,U={...r,anchorOrigin:{vertical:u,horizontal:p},autoHideDuration:f,disableWindowBlurListener:C,TransitionComponent:$,transitionDuration:R},L=SZ(U),{getRootProps:W,onClickAway:K}=fZ({...U}),[Q,le]=b.useState(!0),F=Ne=>{le(!0),z&&z(Ne)},J=(Ne,Ie)=>{le(!1),P&&P(Ne,Ie)},ie={slots:{transition:$,...O},slotProps:{content:v,clickAwayListener:y,transition:N,...I}},[te,de]=at("root",{ref:n,className:[L.root,g],elementType:CZ,getSlotProps:W,externalForwardedProps:{...ie,...H},ownerState:U}),[fe,{ownerState:Re,...Pe}]=at("clickAwayListener",{elementType:PI,externalForwardedProps:ie,getSlotProps:Ne=>({onClickAway:(...Ie)=>{var Fe;(Fe=Ne.onClickAway)==null||Fe.call(Ne,...Ie),K(...Ie)}}),ownerState:U}),[$e,we]=at("content",{elementType:xZ,shouldForwardComponentProp:!0,externalForwardedProps:ie,additionalProps:{message:S,action:l},ownerState:U}),[be,Ae]=at("transition",{elementType:Rh,externalForwardedProps:ie,getSlotProps:Ne=>({onEnter:(...Ie)=>{var Fe;(Fe=Ne.onEnter)==null||Fe.call(Ne,...Ie),J(...Ie)},onExited:(...Ie)=>{var Fe;(Fe=Ne.onExited)==null||Fe.call(Ne,...Ie),F(...Ie)}}),additionalProps:{appear:!0,in:k,timeout:R,direction:u==="top"?"down":"up"},ownerState:U});return!k&&Q?null:a.jsx(fe,{...Pe,...O.clickAwayListener&&{ownerState:Re},children:a.jsx(te,{...de,children:a.jsx(be,{...Ae,children:m||a.jsx($e,{...we})})})})});function wZ(t){return Ze("MuiTooltip",t)}const jr=et("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function jZ(t){return Math.round(t*1e5)/1e5}const TZ=t=>{const{classes:e,disableInteractive:n,arrow:r,touch:s,placement:i}=t,l={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",s&&"touch",`tooltipPlacement${ue(i.split("-")[0])}`],arrow:["arrow"]};return Ke(l,wZ,e)},DZ=ce(jx,{name:"MuiTooltip",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.popper,!n.disableInteractive&&e.popperInteractive,n.arrow&&e.popperArrow,!n.open&&e.popperClose]}})(Ue(({theme:t})=>({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${jr.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${jr.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${jr.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${jr.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${jr.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${jr.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${jr.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${jr.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),EZ=ce("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.tooltip,n.touch&&e.touch,n.arrow&&e.tooltipArrow,e[`tooltipPlacement${ue(n.placement.split("-")[0])}`]]}})(Ue(({theme:t})=>({backgroundColor:t.vars?t.vars.palette.Tooltip.bg:wt(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium,[`.${jr.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${jr.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${jr.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${jr.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${jZ(16/14)}em`,fontWeight:t.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${jr.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${jr.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${jr.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${jr.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${jr.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${jr.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${jr.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${jr.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${jr.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${jr.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),RZ=ce("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(Ue(({theme:t})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:wt(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let wy=!1;const fM=new xx;let _f={x:0,y:0};function jy(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const Er=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTooltip"}),{arrow:s=!1,children:i,classes:l,components:u={},componentsProps:p={},describeChild:f=!1,disableFocusListener:m=!1,disableHoverListener:g=!1,disableInteractive:y=!1,disableTouchListener:v=!1,enterDelay:C=100,enterNextDelay:S=0,enterTouchDelay:j=700,followCursor:D=!1,id:M,leaveDelay:T=0,leaveTouchDelay:E=1500,onClose:k,onOpen:A,open:O,placement:I="bottom",PopperComponent:$,PopperProps:R={},slotProps:P={},slots:z={},title:N,TransitionComponent:H,TransitionProps:U,...L}=r,W=b.isValidElement(i)?i:a.jsx("span",{children:i}),K=vr(),Q=hc(),[le,F]=b.useState(),[J,ie]=b.useState(null),te=b.useRef(!1),de=y||D,fe=Hl(),Re=Hl(),Pe=Hl(),$e=Hl(),[we,be]=Ba({controlled:O,default:!1,name:"Tooltip",state:"open"});let Ae=we;const Ne=pc(M),Ie=b.useRef(),Fe=Dr(()=>{Ie.current!==void 0&&(document.body.style.WebkitUserSelect=Ie.current,Ie.current=void 0),$e.clear()});b.useEffect(()=>Fe,[Fe]);const ct=ht=>{fM.clear(),wy=!0,be(!0),A&&!Ae&&A(ht)},Me=Dr(ht=>{fM.start(800+T,()=>{wy=!1}),be(!1),k&&Ae&&k(ht),fe.start(K.transitions.duration.shortest,()=>{te.current=!1})}),tt=ht=>{te.current&&ht.type!=="touchstart"||(le&&le.removeAttribute("title"),Re.clear(),Pe.clear(),C||wy&&S?Re.start(wy?S:C,()=>{ct(ht)}):ct(ht))},Ve=ht=>{Re.clear(),Pe.start(T,()=>{Me(ht)})},[,it]=b.useState(!1),Z=ht=>{nc(ht.target)||(it(!1),Ve(ht))},q=ht=>{le||F(ht.currentTarget),nc(ht.target)&&(it(!0),tt(ht))},se=ht=>{te.current=!0;const Tn=W.props;Tn.onTouchStart&&Tn.onTouchStart(ht)},xe=ht=>{se(ht),Pe.clear(),fe.clear(),Fe(),Ie.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",$e.start(j,()=>{document.body.style.WebkitUserSelect=Ie.current,tt(ht)})},ee=ht=>{W.props.onTouchEnd&&W.props.onTouchEnd(ht),Fe(),Pe.start(E,()=>{Me(ht)})};b.useEffect(()=>{if(!Ae)return;function ht(Tn){Tn.key==="Escape"&&Me(Tn)}return document.addEventListener("keydown",ht),()=>{document.removeEventListener("keydown",ht)}},[Me,Ae]);const ne=cr(fc(W),F,n);!N&&N!==0&&(Ae=!1);const he=b.useRef(),je=ht=>{const Tn=W.props;Tn.onMouseMove&&Tn.onMouseMove(ht),_f={x:ht.clientX,y:ht.clientY},he.current&&he.current.update()},ze={},ke=typeof N=="string";f?(ze.title=!Ae&&ke&&!g?N:null,ze["aria-describedby"]=Ae?Ne:null):(ze["aria-label"]=ke?N:null,ze["aria-labelledby"]=Ae&&!ke?Ne:null);const Be={...ze,...L,...W.props,className:Ce(L.className,W.props.className),onTouchStart:se,ref:ne,...D?{onMouseMove:je}:{}},xt={};v||(Be.onTouchStart=xe,Be.onTouchEnd=ee),g||(Be.onMouseOver=jy(tt,Be.onMouseOver),Be.onMouseLeave=jy(Ve,Be.onMouseLeave),de||(xt.onMouseOver=tt,xt.onMouseLeave=Ve)),m||(Be.onFocus=jy(q,Be.onFocus),Be.onBlur=jy(Z,Be.onBlur),de||(xt.onFocus=q,xt.onBlur=Z));const vt={...r,isRtl:Q,arrow:s,disableInteractive:de,placement:I,PopperComponentProp:$,touch:te.current},kt=typeof P.popper=="function"?P.popper(vt):P.popper,Ge=b.useMemo(()=>{var Tn,Je;let ht=[{name:"arrow",enabled:!!J,options:{element:J,padding:4}}];return(Tn=R.popperOptions)!=null&&Tn.modifiers&&(ht=ht.concat(R.popperOptions.modifiers)),(Je=kt==null?void 0:kt.popperOptions)!=null&&Je.modifiers&&(ht=ht.concat(kt.popperOptions.modifiers)),{...R.popperOptions,...kt==null?void 0:kt.popperOptions,modifiers:ht}},[J,R.popperOptions,kt==null?void 0:kt.popperOptions]),gt=TZ(vt),dn=typeof P.transition=="function"?P.transition(vt):P.transition,$n={slots:{popper:u.Popper,transition:u.Transition??H,tooltip:u.Tooltip,arrow:u.Arrow,...z},slotProps:{arrow:P.arrow??p.arrow,popper:{...R,...kt??p.popper},tooltip:P.tooltip??p.tooltip,transition:{...U,...dn??p.transition}}},[dr,tr]=at("popper",{elementType:DZ,externalForwardedProps:$n,ownerState:vt,className:Ce(gt.popper,R==null?void 0:R.className)}),[Lr,jt]=at("transition",{elementType:Rh,externalForwardedProps:$n,ownerState:vt}),[_t,an]=at("tooltip",{elementType:EZ,className:gt.tooltip,externalForwardedProps:$n,ownerState:vt}),[Vn,Sn]=at("arrow",{elementType:RZ,className:gt.arrow,externalForwardedProps:$n,ownerState:vt,ref:ie});return a.jsxs(b.Fragment,{children:[b.cloneElement(W,Be),a.jsx(dr,{as:$??jx,placement:I,anchorEl:D?{getBoundingClientRect:()=>({top:_f.y,left:_f.x,right:_f.x,bottom:_f.y,width:0,height:0})}:le,popperRef:he,open:le?Ae:!1,id:Ne,transition:!0,...xt,...tr,popperOptions:Ge,children:({TransitionProps:ht})=>a.jsx(Lr,{timeout:K.transitions.duration.shorter,...ht,...jt,children:a.jsxs(_t,{...an,children:[N,s?a.jsx(Vn,{...Sn}):null]})})})]})}),Ro=JU({createStyledComponent:ce("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>Qe({props:t,name:"MuiStack"})});function kZ(t){return Ze("MuiSwitch",t)}const Ds=et("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),MZ=t=>{const{classes:e,edge:n,size:r,color:s,checked:i,disabled:l}=t,u={root:["root",n&&`edge${ue(n)}`,`size${ue(r)}`],switchBase:["switchBase",`color${ue(s)}`,i&&"checked",l&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},p=Ke(u,kZ,e);return{...e,...p}},OZ=ce("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${ue(n.edge)}`],e[`size${ue(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Ds.thumb}`]:{width:16,height:16},[`& .${Ds.switchBase}`]:{padding:4,[`&.${Ds.checked}`]:{transform:"translateX(16px)"}}}}]}),AZ=ce(i2,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${Ds.input}`]:e.input},n.color!=="default"&&e[`color${ue(n.color)}`]]}})(Ue(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${Ds.checked}`]:{transform:"translateX(20px)"},[`&.${Ds.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${Ds.checked} + .${Ds.track}`]:{opacity:.5},[`&.${Ds.disabled} + .${Ds.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${Ds.input}`]:{left:"-100%",width:"300%"}})),Ue(({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(bn(["light"])).map(([e])=>({props:{color:e},style:{[`&.${Ds.checked}`]:{color:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette[e].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ds.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Yo(t.palette[e].main,.62):Jo(t.palette[e].main,.55)}`}},[`&.${Ds.checked} + .${Ds.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]}))),_Z=ce("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(Ue(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`}))),IZ=ce("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(Ue(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Ax=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiSwitch"}),{className:s,color:i="primary",edge:l=!1,size:u="medium",sx:p,slots:f={},slotProps:m={},...g}=r,y={...r,color:i,edge:l,size:u},v=MZ(y),C={slots:f,slotProps:m},[S,j]=at("root",{className:Ce(v.root,s),elementType:OZ,externalForwardedProps:C,ownerState:y,additionalProps:{sx:p}}),[D,M]=at("thumb",{className:v.thumb,elementType:IZ,externalForwardedProps:C,ownerState:y}),T=a.jsx(D,{...M}),[E,k]=at("track",{className:v.track,elementType:_Z,externalForwardedProps:C,ownerState:y});return a.jsxs(S,{...j,children:[a.jsx(AZ,{type:"checkbox",icon:T,checkedIcon:T,ref:n,ownerState:y,...g,classes:{...v,root:v.switchBase},slots:{...f.switchBase&&{root:f.switchBase},...f.input&&{input:f.input}},slotProps:{...m.switchBase&&{root:typeof m.switchBase=="function"?m.switchBase(y):m.switchBase},...m.input&&{input:typeof m.input=="function"?m.input(y):m.input}}}),a.jsx(E,{...k})]})});function PZ(t){return Ze("MuiTab",t)}const Ni=et("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),LZ=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:s,icon:i,label:l,selected:u,disabled:p}=t,f={root:["root",i&&l&&"labelIcon",`textColor${ue(n)}`,r&&"fullWidth",s&&"wrapped",u&&"selected",p&&"disabled"],icon:["iconWrapper","icon"]};return Ke(f,PZ,e)},zZ=ce(Ls,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${ue(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped,{[`& .${Ni.iconWrapper}`]:e.iconWrapper},{[`& .${Ni.icon}`]:e.icon}]}})(Ue(({theme:t})=>({...t.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition==="top"||e.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&e.iconPosition!=="top"&&e.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="top",style:{[`& > .${Ni.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="bottom",style:{[`& > .${Ni.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="start",style:{[`& > .${Ni.icon}`]:{marginRight:t.spacing(1)}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="end",style:{[`& > .${Ni.icon}`]:{marginLeft:t.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Ni.selected}`]:{opacity:1},[`&.${Ni.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Ni.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Ni.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Ni.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Ni.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:t.typography.pxToRem(12)}}]}))),hM=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTab"}),{className:s,disabled:i=!1,disableFocusRipple:l=!1,fullWidth:u,icon:p,iconPosition:f="top",indicator:m,label:g,onChange:y,onClick:v,onFocus:C,selected:S,selectionFollowsFocus:j,textColor:D="inherit",value:M,wrapped:T=!1,...E}=r,k={...r,disabled:i,disableFocusRipple:l,selected:S,icon:!!p,iconPosition:f,label:!!g,fullWidth:u,textColor:D,wrapped:T},A=LZ(k),O=p&&g&&b.isValidElement(p)?b.cloneElement(p,{className:Ce(A.icon,p.props.className)}):p,I=R=>{!S&&y&&y(R,M),v&&v(R)},$=R=>{j&&!S&&y&&y(R,M),C&&C(R)};return a.jsxs(zZ,{focusRipple:!l,className:Ce(A.root,s),ref:n,role:"tab","aria-selected":S,disabled:i,onClick:I,onFocus:$,ownerState:k,tabIndex:S?0:-1,...E,children:[f==="top"||f==="start"?a.jsxs(b.Fragment,{children:[O,g]}):a.jsxs(b.Fragment,{children:[g,O]}),m]})}),JI=b.createContext();function $Z(t){return Ze("MuiTable",t)}et("MuiTable",["root","stickyHeader"]);const NZ=t=>{const{classes:e,stickyHeader:n}=t;return Ke({root:["root",n&&"stickyHeader"]},$Z,e)},FZ=ce("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(Ue(({theme:t})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...t.typography.body2,padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),mM="table",wp=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTable"}),{className:s,component:i=mM,padding:l="normal",size:u="medium",stickyHeader:p=!1,...f}=r,m={...r,component:i,padding:l,size:u,stickyHeader:p},g=NZ(m),y=b.useMemo(()=>({padding:l,size:u,stickyHeader:p}),[l,u,p]);return a.jsx(JI.Provider,{value:y,children:a.jsx(FZ,{as:i,role:i===mM?null:"table",ref:n,className:Ce(g.root,s),ownerState:m,...f})})}),_x=b.createContext();function BZ(t){return Ze("MuiTableBody",t)}et("MuiTableBody",["root"]);const UZ=t=>{const{classes:e}=t;return Ke({root:["root"]},BZ,e)},VZ=ce("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),HZ={variant:"body"},gM="tbody",jp=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTableBody"}),{className:s,component:i=gM,...l}=r,u={...r,component:i},p=UZ(u);return a.jsx(_x.Provider,{value:HZ,children:a.jsx(VZ,{className:Ce(p.root,s),as:i,ref:n,role:i===gM?null:"rowgroup",ownerState:u,...l})})});function WZ(t){return Ze("MuiTableCell",t)}const qZ=et("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),GZ=t=>{const{classes:e,variant:n,align:r,padding:s,size:i,stickyHeader:l}=t,u={root:["root",n,l&&"stickyHeader",r!=="inherit"&&`align${ue(r)}`,s!=="normal"&&`padding${ue(s)}`,`size${ue(i)}`]};return Ke(u,WZ,e)},ZZ=ce("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${ue(n.size)}`],n.padding!=="normal"&&e[`padding${ue(n.padding)}`],n.align!=="inherit"&&e[`align${ue(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(Ue(({theme:t})=>({...t.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid
|
|
274
|
+
${t.palette.mode==="light"?Yo(wt(t.palette.divider,1),.88):Jo(wt(t.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(t.vars||t).palette.text.primary}},{props:{variant:"footer"},style:{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${qZ.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default}}]}))),Kt=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTableCell"}),{align:s="inherit",className:i,component:l,padding:u,scope:p,size:f,sortDirection:m,variant:g,...y}=r,v=b.useContext(JI),C=b.useContext(_x),S=C&&C.variant==="head";let j;l?j=l:j=S?"th":"td";let D=p;j==="td"?D=void 0:!D&&S&&(D="col");const M=g||C&&C.variant,T={...r,align:s,component:j,padding:u||(v&&v.padding?v.padding:"normal"),size:f||(v&&v.size?v.size:"medium"),sortDirection:m,stickyHeader:M==="head"&&v&&v.stickyHeader,variant:M},E=GZ(T);let k=null;return m&&(k=m==="asc"?"ascending":"descending"),a.jsx(ZZ,{as:j,ref:n,className:Ce(E.root,i),"aria-sort":k,scope:D,ownerState:T,...y})});function KZ(t){return Ze("MuiTableContainer",t)}et("MuiTableContainer",["root"]);const QZ=t=>{const{classes:e}=t;return Ke({root:["root"]},KZ,e)},JZ=ce("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),YI=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTableContainer"}),{className:s,component:i="div",...l}=r,u={...r,component:i},p=QZ(u);return a.jsx(JZ,{ref:n,as:i,className:Ce(p.root,s),ownerState:u,...l})});function YZ(t){return Ze("MuiTableHead",t)}et("MuiTableHead",["root"]);const XZ=t=>{const{classes:e}=t;return Ke({root:["root"]},YZ,e)},eK=ce("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),tK={variant:"head"},yM="thead",jm=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTableHead"}),{className:s,component:i=yM,...l}=r,u={...r,component:i},p=XZ(u);return a.jsx(_x.Provider,{value:tK,children:a.jsx(eK,{as:i,className:Ce(p.root,s),ref:n,role:i===yM?null:"rowgroup",ownerState:u,...l})})});function nK(t){return Ze("MuiToolbar",t)}et("MuiToolbar",["root","gutters","regular","dense"]);const rK=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Ke({root:["root",!n&&"gutters",r]},nK,e)},sK=ce("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(Ue(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}))),iK=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiToolbar"}),{className:s,component:i="div",disableGutters:l=!1,variant:u="regular",...p}=r,f={...r,component:i,disableGutters:l,variant:u},m=rK(f);return a.jsx(sK,{as:i,className:Ce(m.root,s),ref:n,ownerState:f,...p})}),oK=ye(a.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),aK=ye(a.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function lK(t){return Ze("MuiTableRow",t)}const vM=et("MuiTableRow",["root","selected","hover","head","footer"]),cK=t=>{const{classes:e,selected:n,hover:r,head:s,footer:i}=t;return Ke({root:["root",n&&"selected",r&&"hover",s&&"head",i&&"footer"]},lK,e)},uK=ce("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(Ue(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${vM.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${vM.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:wt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}}))),xM="tr",eo=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTableRow"}),{className:s,component:i=xM,hover:l=!1,selected:u=!1,...p}=r,f=b.useContext(_x),m={...r,component:i,hover:l,selected:u,head:f&&f.variant==="head",footer:f&&f.variant==="footer"},g=cK(m);return a.jsx(uK,{as:i,ref:n,className:Ce(g.root,s),role:i===xM?null:"row",ownerState:m,...p})}),dK=ye(a.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function pK(t){return Ze("MuiTableSortLabel",t)}const YS=et("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]),fK=t=>{const{classes:e,direction:n,active:r}=t,s={root:["root",r&&"active",`direction${ue(n)}`],icon:["icon",`iconDirection${ue(n)}`]};return Ke(s,pK,e)},hK=ce(Ls,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.active&&e.active]}})(Ue(({theme:t})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(t.vars||t).palette.text.secondary},"&:hover":{color:(t.vars||t).palette.text.secondary,[`& .${YS.icon}`]:{opacity:.5}},[`&.${YS.active}`]:{color:(t.vars||t).palette.text.primary,[`& .${YS.icon}`]:{opacity:1,color:(t.vars||t).palette.text.secondary}}}))),mK=ce("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,e[`iconDirection${ue(n.direction)}`]]}})(Ue(({theme:t})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:t.transitions.create(["opacity","transform"],{duration:t.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]}))),gK=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTableSortLabel"}),{active:s=!1,children:i,className:l,direction:u="asc",hideSortIcon:p=!1,IconComponent:f=dK,slots:m={},slotProps:g={},...y}=r,v={...r,active:s,direction:u,hideSortIcon:p,IconComponent:f},C=fK(v),S={slots:m,slotProps:g},[j,D]=at("root",{elementType:hK,externalForwardedProps:S,ownerState:v,className:Ce(C.root,l),ref:n}),[M,T]=at("icon",{elementType:mK,externalForwardedProps:S,ownerState:v,className:C.icon});return a.jsxs(j,{disableRipple:!0,component:"span",...D,...y,children:[i,p&&!s?null:a.jsx(M,{as:f,...T})]})});function yK(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function vK(t,e,n,r={},s=()=>{}){const{ease:i=yK,duration:l=300}=r;let u=null;const p=e[t];let f=!1;const m=()=>{f=!0},g=y=>{if(f){s(new Error("Animation cancelled"));return}u===null&&(u=y);const v=Math.min(1,(y-u)/l);if(e[t]=i(v)*(n-p)+p,v>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(g)};return p===n?(s(new Error("Element already at target position")),m):(requestAnimationFrame(g),m)}const xK={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function bK(t){const{onChange:e,...n}=t,r=b.useRef(),s=b.useRef(null),i=()=>{r.current=s.current.offsetHeight-s.current.clientHeight};return Cs(()=>{const l=Sm(()=>{const p=r.current;i(),p!==r.current&&e(r.current)}),u=Ci(s.current);return u.addEventListener("resize",l),()=>{l.clear(),u.removeEventListener("resize",l)}},[e]),b.useEffect(()=>{i(),e(r.current)},[e]),a.jsx("div",{style:xK,...n,ref:s})}function SK(t){return Ze("MuiTabScrollButton",t)}const CK=et("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),wK=t=>{const{classes:e,orientation:n,disabled:r}=t;return Ke({root:["root",n,r&&"disabled"]},SK,e)},jK=ce(Ls,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${CK.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),TK=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTabScrollButton"}),{className:s,slots:i={},slotProps:l={},direction:u,orientation:p,disabled:f,...m}=r,g=hc(),y={isRtl:g,...r},v=wK(y),C=i.StartScrollButtonIcon??oK,S=i.EndScrollButtonIcon??aK,j=Ms({elementType:C,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:y}),D=Ms({elementType:S,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:y});return a.jsx(jK,{component:"div",className:Ce(v.root,s),ref:n,role:null,ownerState:y,tabIndex:null,...m,style:{...m.style,...p==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${g?-90:90}deg)`}},children:u==="left"?a.jsx(C,{...j}):a.jsx(S,{...D})})});function DK(t){return Ze("MuiTabs",t)}const XS=et("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),bM=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,SM=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,Ty=(t,e,n)=>{let r=!1,s=n(t,e);for(;s;){if(s===t.firstChild){if(r)return;r=!0}const i=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||i)s=n(t,s);else{s.focus();return}}},EK=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:s,scrollableY:i,centered:l,scrollButtonsHideMobile:u,classes:p}=t;return Ke({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",s&&"scrollableX",i&&"scrollableY"],list:["list","flexContainer",e&&"flexContainerVertical",e&&"vertical",l&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",u&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},DK,p)},RK=ce("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${XS.scrollButtons}`]:e.scrollButtons},{[`& .${XS.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(Ue(({theme:t})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${XS.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}}}]}))),kK=ce("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.scroller,n.fixed&&e.fixed,n.hideScrollbar&&e.hideScrollbar,n.scrollableX&&e.scrollableX,n.scrollableY&&e.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:t})=>t.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:t})=>t.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:t})=>t.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:t})=>t.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),MK=ce("div",{name:"MuiTabs",slot:"List",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.list,e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})({display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.centered,style:{justifyContent:"center"}}]}),OK=ce("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(Ue(({theme:t})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(t.vars||t).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(t.vars||t).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),AK=ce(bK)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),CM={},_K=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTabs"}),s=vr(),i=hc(),{"aria-label":l,"aria-labelledby":u,action:p,centered:f=!1,children:m,className:g,component:y="div",allowScrollButtonsMobile:v=!1,indicatorColor:C="primary",onChange:S,orientation:j="horizontal",ScrollButtonComponent:D,scrollButtons:M="auto",selectionFollowsFocus:T,slots:E={},slotProps:k={},TabIndicatorProps:A={},TabScrollButtonProps:O={},textColor:I="primary",value:$,variant:R="standard",visibleScrollbar:P=!1,...z}=r,N=R==="scrollable",H=j==="vertical",U=H?"scrollTop":"scrollLeft",L=H?"top":"left",W=H?"bottom":"right",K=H?"clientHeight":"clientWidth",Q=H?"height":"width",le={...r,component:y,allowScrollButtonsMobile:v,indicatorColor:C,orientation:j,vertical:H,scrollButtons:M,textColor:I,variant:R,visibleScrollbar:P,fixed:!N,hideScrollbar:N&&!P,scrollableX:N&&!H,scrollableY:N&&H,centered:f&&!N,scrollButtonsHideMobile:!v},F=EK(le),J=Ms({elementType:E.StartScrollButtonIcon,externalSlotProps:k.startScrollButtonIcon,ownerState:le}),ie=Ms({elementType:E.EndScrollButtonIcon,externalSlotProps:k.endScrollButtonIcon,ownerState:le}),[te,de]=b.useState(!1),[fe,Re]=b.useState(CM),[Pe,$e]=b.useState(!1),[we,be]=b.useState(!1),[Ae,Ne]=b.useState(!1),[Ie,Fe]=b.useState({overflow:"hidden",scrollbarWidth:0}),ct=new Map,Me=b.useRef(null),tt=b.useRef(null),Ve={slots:E,slotProps:{indicator:A,scrollButton:O,...k}},it=()=>{const Je=Me.current;let Ye;if(Je){const Mt=Je.getBoundingClientRect();Ye={clientWidth:Je.clientWidth,scrollLeft:Je.scrollLeft,scrollTop:Je.scrollTop,scrollWidth:Je.scrollWidth,top:Mt.top,bottom:Mt.bottom,left:Mt.left,right:Mt.right}}let It;if(Je&&$!==!1){const Mt=tt.current.children;if(Mt.length>0){const sn=Mt[ct.get($)];It=sn?sn.getBoundingClientRect():null}}return{tabsMeta:Ye,tabMeta:It}},Z=Dr(()=>{const{tabsMeta:Je,tabMeta:Ye}=it();let It=0,Mt;H?(Mt="top",Ye&&Je&&(It=Ye.top-Je.top+Je.scrollTop)):(Mt=i?"right":"left",Ye&&Je&&(It=(i?-1:1)*(Ye[Mt]-Je[Mt]+Je.scrollLeft)));const sn={[Mt]:It,[Q]:Ye?Ye[Q]:0};if(typeof fe[Mt]!="number"||typeof fe[Q]!="number")Re(sn);else{const pr=Math.abs(fe[Mt]-sn[Mt]),Rr=Math.abs(fe[Q]-sn[Q]);(pr>=1||Rr>=1)&&Re(sn)}}),q=(Je,{animation:Ye=!0}={})=>{Ye?vK(U,Me.current,Je,{duration:s.transitions.duration.standard}):Me.current[U]=Je},se=Je=>{let Ye=Me.current[U];H?Ye+=Je:Ye+=Je*(i?-1:1),q(Ye)},xe=()=>{const Je=Me.current[K];let Ye=0;const It=Array.from(tt.current.children);for(let Mt=0;Mt<It.length;Mt+=1){const sn=It[Mt];if(Ye+sn[K]>Je){Mt===0&&(Ye=Je);break}Ye+=sn[K]}return Ye},ee=()=>{se(-1*xe())},ne=()=>{se(xe())},[he,{onChange:je,...ze}]=at("scrollbar",{className:Ce(F.scrollableX,F.hideScrollbar),elementType:AK,shouldForwardComponentProp:!0,externalForwardedProps:Ve,ownerState:le}),ke=b.useCallback(Je=>{je==null||je(Je),Fe({overflow:null,scrollbarWidth:Je})},[je]),[Be,xt]=at("scrollButtons",{className:Ce(F.scrollButtons,O.className),elementType:TK,externalForwardedProps:Ve,ownerState:le,additionalProps:{orientation:j,slots:{StartScrollButtonIcon:E.startScrollButtonIcon||E.StartScrollButtonIcon,EndScrollButtonIcon:E.endScrollButtonIcon||E.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:J,endScrollButtonIcon:ie}}}),vt=()=>{const Je={};Je.scrollbarSizeListener=N?a.jsx(he,{...ze,onChange:ke}):null;const It=N&&(M==="auto"&&(Pe||we)||M===!0);return Je.scrollButtonStart=It?a.jsx(Be,{direction:i?"right":"left",onClick:ee,disabled:!Pe,...xt}):null,Je.scrollButtonEnd=It?a.jsx(Be,{direction:i?"left":"right",onClick:ne,disabled:!we,...xt}):null,Je},kt=Dr(Je=>{const{tabsMeta:Ye,tabMeta:It}=it();if(!(!It||!Ye)){if(It[L]<Ye[L]){const Mt=Ye[U]+(It[L]-Ye[L]);q(Mt,{animation:Je})}else if(It[W]>Ye[W]){const Mt=Ye[U]+(It[W]-Ye[W]);q(Mt,{animation:Je})}}}),Ge=Dr(()=>{N&&M!==!1&&Ne(!Ae)});b.useEffect(()=>{const Je=Sm(()=>{Me.current&&Z()});let Ye;const It=pr=>{pr.forEach(Rr=>{Rr.removedNodes.forEach(kr=>{Ye==null||Ye.unobserve(kr)}),Rr.addedNodes.forEach(kr=>{Ye==null||Ye.observe(kr)})}),Je(),Ge()},Mt=Ci(Me.current);Mt.addEventListener("resize",Je);let sn;return typeof ResizeObserver<"u"&&(Ye=new ResizeObserver(Je),Array.from(tt.current.children).forEach(pr=>{Ye.observe(pr)})),typeof MutationObserver<"u"&&(sn=new MutationObserver(It),sn.observe(tt.current,{childList:!0})),()=>{Je.clear(),Mt.removeEventListener("resize",Je),sn==null||sn.disconnect(),Ye==null||Ye.disconnect()}},[Z,Ge]),b.useEffect(()=>{const Je=Array.from(tt.current.children),Ye=Je.length;if(typeof IntersectionObserver<"u"&&Ye>0&&N&&M!==!1){const It=Je[0],Mt=Je[Ye-1],sn={root:Me.current,threshold:.99},pr=Cn=>{$e(!Cn[0].isIntersecting)},Rr=new IntersectionObserver(pr,sn);Rr.observe(It);const kr=Cn=>{be(!Cn[0].isIntersecting)},cs=new IntersectionObserver(kr,sn);return cs.observe(Mt),()=>{Rr.disconnect(),cs.disconnect()}}},[N,M,Ae,m==null?void 0:m.length]),b.useEffect(()=>{de(!0)},[]),b.useEffect(()=>{Z()}),b.useEffect(()=>{kt(CM!==fe)},[kt,fe]),b.useImperativeHandle(p,()=>({updateIndicator:Z,updateScrollButtons:Ge}),[Z,Ge]);const[gt,dn]=at("indicator",{className:Ce(F.indicator,A.className),elementType:OK,externalForwardedProps:Ve,ownerState:le,additionalProps:{style:fe}}),$n=a.jsx(gt,{...dn});let dr=0;const tr=b.Children.map(m,Je=>{if(!b.isValidElement(Je))return null;const Ye=Je.props.value===void 0?dr:Je.props.value;ct.set(Ye,dr);const It=Ye===$;return dr+=1,b.cloneElement(Je,{fullWidth:R==="fullWidth",indicator:It&&!te&&$n,selected:It,selectionFollowsFocus:T,onChange:S,textColor:I,value:Ye,...dr===1&&$===!1&&!Je.props.tabIndex?{tabIndex:0}:{}})}),Lr=Je=>{if(Je.altKey||Je.shiftKey||Je.ctrlKey||Je.metaKey)return;const Ye=tt.current,It=Ir(Ye).activeElement;if(It.getAttribute("role")!=="tab")return;let sn=j==="horizontal"?"ArrowLeft":"ArrowUp",pr=j==="horizontal"?"ArrowRight":"ArrowDown";switch(j==="horizontal"&&i&&(sn="ArrowRight",pr="ArrowLeft"),Je.key){case sn:Je.preventDefault(),Ty(Ye,It,SM);break;case pr:Je.preventDefault(),Ty(Ye,It,bM);break;case"Home":Je.preventDefault(),Ty(Ye,null,bM);break;case"End":Je.preventDefault(),Ty(Ye,null,SM);break}},jt=vt(),[_t,an]=at("root",{ref:n,className:Ce(F.root,g),elementType:RK,externalForwardedProps:{...Ve,...z,component:y},ownerState:le}),[Vn,Sn]=at("scroller",{ref:Me,className:F.scroller,elementType:kK,externalForwardedProps:Ve,ownerState:le,additionalProps:{style:{overflow:Ie.overflow,[H?`margin${i?"Left":"Right"}`:"marginBottom"]:P?void 0:-Ie.scrollbarWidth}}}),[ht,Tn]=at("list",{ref:tt,className:Ce(F.list,F.flexContainer),elementType:MK,externalForwardedProps:Ve,ownerState:le,getSlotProps:Je=>({...Je,onKeyDown:Ye=>{var It;Lr(Ye),(It=Je.onKeyDown)==null||It.call(Je,Ye)}})});return a.jsxs(_t,{...an,children:[jt.scrollButtonStart,jt.scrollbarSizeListener,a.jsxs(Vn,{...Sn,children:[a.jsx(ht,{"aria-label":l,"aria-labelledby":u,"aria-orientation":j==="vertical"?"vertical":null,role:"tablist",...Tn,children:tr}),te&&$n]}),jt.scrollButtonEnd]})});function IK(t){return Ze("MuiTextField",t)}et("MuiTextField",["root"]);const PK={standard:l2,filled:a2,outlined:p2},LK=t=>{const{classes:e}=t;return Ke({root:["root"]},IK,e)},zK=ce(_n,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Xe=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiTextField"}),{autoComplete:s,autoFocus:i=!1,children:l,className:u,color:p="primary",defaultValue:f,disabled:m=!1,error:g=!1,FormHelperTextProps:y,fullWidth:v=!1,helperText:C,id:S,InputLabelProps:j,inputProps:D,InputProps:M,inputRef:T,label:E,maxRows:k,minRows:A,multiline:O=!1,name:I,onBlur:$,onChange:R,onFocus:P,placeholder:z,required:N=!1,rows:H,select:U=!1,SelectProps:L,slots:W={},slotProps:K={},type:Q,value:le,variant:F="outlined",...J}=r,ie={...r,autoFocus:i,color:p,disabled:m,error:g,fullWidth:v,multiline:O,required:N,select:U,variant:F},te=LK(ie),de=pc(S),fe=C&&de?`${de}-helper-text`:void 0,Re=E&&de?`${de}-label`:void 0,Pe=PK[F],$e={slots:W,slotProps:{input:M,inputLabel:j,htmlInput:D,formHelperText:y,select:L,...K}},we={},be=$e.slotProps.inputLabel;F==="outlined"&&(be&&typeof be.shrink<"u"&&(we.notched=be.shrink),we.label=E),U&&((!L||!L.native)&&(we.id=void 0),we["aria-describedby"]=void 0);const[Ae,Ne]=at("root",{elementType:zK,shouldForwardComponentProp:!0,externalForwardedProps:{...$e,...J},ownerState:ie,className:Ce(te.root,u),ref:n,additionalProps:{disabled:m,error:g,fullWidth:v,required:N,color:p,variant:F}}),[Ie,Fe]=at("input",{elementType:Pe,externalForwardedProps:$e,additionalProps:we,ownerState:ie}),[ct,Me]=at("inputLabel",{elementType:nr,externalForwardedProps:$e,ownerState:ie}),[tt,Ve]=at("htmlInput",{elementType:"input",externalForwardedProps:$e,ownerState:ie}),[it,Z]=at("formHelperText",{elementType:Dh,externalForwardedProps:$e,ownerState:ie}),[q,se]=at("select",{elementType:wn,externalForwardedProps:$e,ownerState:ie}),xe=a.jsx(Ie,{"aria-describedby":fe,autoComplete:s,autoFocus:i,defaultValue:f,fullWidth:v,multiline:O,name:I,rows:H,maxRows:k,minRows:A,type:Q,value:le,id:de,inputRef:T,onBlur:$,onChange:R,onFocus:P,placeholder:z,inputProps:Ve,slots:{input:W.htmlInput?tt:void 0},...Fe});return a.jsxs(Ae,{...Ne,children:[E!=null&&E!==""&&a.jsx(ct,{htmlFor:de,id:Re,...Me,children:E}),U?a.jsx(q,{"aria-describedby":fe,id:de,labelId:Re,value:le,input:xe,...se,children:l}):xe,C&&a.jsx(it,{id:fe,...Z,children:C})]})});function $K(t){return Ze("MuiToggleButton",t)}const Zc=et("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),XI=b.createContext({}),eP=b.createContext(void 0);function NK(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.includes(t):t===e}const FK=t=>{const{classes:e,fullWidth:n,selected:r,disabled:s,size:i,color:l}=t,u={root:["root",r&&"selected",s&&"disabled",n&&"fullWidth",`size${ue(i)}`,l]};return Ke(u,$K,e)},BK=ce(Ls,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`size${ue(n.size)}`]]}})(Ue(({theme:t})=>({...t.typography.button,borderRadius:(t.vars||t).shape.borderRadius,padding:11,border:`1px solid ${(t.vars||t).palette.divider}`,color:(t.vars||t).palette.action.active,[`&.${Zc.disabled}`]:{color:(t.vars||t).palette.action.disabled,border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:wt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${Zc.selected}`]:{color:(t.vars||t).palette.text.primary,backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette.text.primary,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:wt(t.palette.text.primary,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette.text.primary,t.palette.action.selectedOpacity)}}}}},...Object.entries(t.palette).filter(bn()).map(([e])=>({props:{color:e},style:{[`&.${Zc.selected}`]:{color:(t.vars||t).palette[e].main,backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette[e].main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:wt(t.palette[e].main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:wt(t.palette[e].main,t.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:t.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:t.typography.pxToRem(15)}}]}))),ts=b.forwardRef(function(e,n){const{value:r,...s}=b.useContext(XI),i=b.useContext(eP),l=ep({...s,selected:NK(e.value,r)},e),u=Qe({props:l,name:"MuiToggleButton"}),{children:p,className:f,color:m="standard",disabled:g=!1,disableFocusRipple:y=!1,fullWidth:v=!1,onChange:C,onClick:S,selected:j,size:D="medium",value:M,...T}=u,E={...u,color:m,disabled:g,disableFocusRipple:y,fullWidth:v,size:D},k=FK(E),A=I=>{S&&(S(I,M),I.defaultPrevented)||C&&C(I,M)},O=i||"";return a.jsx(BK,{className:Ce(s.className,k.root,f,O),disabled:g,focusRipple:!y,ref:n,onClick:A,onChange:C,value:M,ownerState:E,"aria-pressed":j,...T,children:p})});function UK(t){return Ze("MuiToggleButtonGroup",t)}const ar=et("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),VK=t=>{const{classes:e,orientation:n,fullWidth:r,disabled:s}=t,i={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${ue(n)}`,s&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Ke(i,UK,e)},HK=ce("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ar.grouped}`]:e.grouped},{[`& .${ar.grouped}`]:e[`grouped${ue(n.orientation)}`]},{[`& .${ar.firstButton}`]:e.firstButton},{[`& .${ar.lastButton}`]:e.lastButton},{[`& .${ar.middleButton}`]:e.middleButton},e.root,n.orientation==="vertical"&&e.vertical,n.fullWidth&&e.fullWidth]}})(Ue(({theme:t})=>({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${ar.grouped}`]:{[`&.${ar.selected} + .${ar.grouped}.${ar.selected}`]:{borderTop:0,marginTop:0}},[`& .${ar.firstButton},& .${ar.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${ar.lastButton},& .${ar.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${ar.lastButton}.${Zc.disabled},& .${ar.middleButton}.${Zc.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${ar.grouped}`]:{[`&.${ar.selected} + .${ar.grouped}.${ar.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${ar.firstButton},& .${ar.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${ar.lastButton},& .${ar.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${ar.lastButton}.${Zc.disabled},& .${ar.middleButton}.${Zc.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),yc=b.forwardRef(function(e,n){const r=Qe({props:e,name:"MuiToggleButtonGroup"}),{children:s,className:i,color:l="standard",disabled:u=!1,exclusive:p=!1,fullWidth:f=!1,onChange:m,orientation:g="horizontal",size:y="medium",value:v,...C}=r,S={...r,disabled:u,fullWidth:f,orientation:g,size:y},j=VK(S),D=b.useCallback((O,I)=>{if(!m)return;const $=v&&v.indexOf(I);let R;v&&$>=0?(R=v.slice(),R.splice($,1)):R=v?v.concat(I):[I],m(O,R)},[m,v]),M=b.useCallback((O,I)=>{m&&m(O,v===I?null:I)},[m,v]),T=b.useMemo(()=>({className:j.grouped,onChange:p?M:D,value:v,size:y,fullWidth:f,color:l,disabled:u}),[j.grouped,p,M,D,v,y,f,l,u]),E=YB(s),k=E.length,A=O=>{const I=O===0,$=O===k-1;return I&&$?"":I?j.firstButton:$?j.lastButton:j.middleButton};return a.jsx(HK,{role:"group",className:Ce(j.root,i),ref:n,ownerState:S,...C,children:a.jsx(XI.Provider,{value:T,children:E.map((O,I)=>a.jsx(eP.Provider,{value:A(I),children:O},I))})})}),WK=Sx({palette:{primary:{main:"#1976d2"}}}),wM={debug:0,info:1,warn:2,error:3},qK={debug:"#888888",info:"#2196F3",warn:"#FF9800",error:"#F44336"},El=class El{constructor(){St(this,"minLevel","info");St(this,"handlers",[]);St(this,"logs",[]);St(this,"maxLogSize",1e3)}static getInstance(){return El.instance||(El.instance=new El),El.instance}static resetInstance(){El.instance=null}setLevel(e){this.minLevel=e}getLevel(){return this.minLevel}addHandler(e){return this.handlers.push(e),()=>{const n=this.handlers.indexOf(e);n>-1&&this.handlers.splice(n,1)}}getLogs(){return[...this.logs]}clearLogs(){this.logs=[]}exportLogs(){return this.logs.map(e=>{const n=e.data?` ${JSON.stringify(e.data)}`:"";return`[${e.timestamp}] [${e.level.toUpperCase()}] [${e.context}] ${e.message||""}${n}`}).join(`
|
|
275
|
+
`)}debug(e,n,r){this.log("debug",e,n,r)}info(e,n,r){this.log("info",e,n,r)}warn(e,n,r){this.log("warn",e,n,r)}error(e,n,r){this.log("error",e,n,r)}log(e,n,r,s){if(!this.shouldLog(e))return;const i={level:e,timestamp:new Date().toISOString(),context:n,message:typeof r=="string"?r:void 0,data:typeof r=="string"?s:r};this.logs.push(i),this.logs.length>this.maxLogSize&&this.logs.shift(),this.handlers.forEach(l=>{try{l(i)}catch{}})}shouldLog(e){return wM[e]>=wM[this.minLevel]}logToDevConsole(e){const n=qK[e.level],r=`%c[${e.level.toUpperCase()}]%c [${e.context}]`,s=[`color: ${n}; font-weight: bold`,"color: inherit"],i=[r,...s];switch(e.message&&i.push(e.message),e.data!==void 0&&i.push(e.data),e.level){case"debug":console.debug(...i);break;case"info":console.info(...i);break;case"warn":console.warn(...i);break;case"error":console.error(...i);break}}};St(El,"instance",null);let wC=El;const oe=wC.getInstance();class lh extends Error{constructor(e,n,r){super(n),this.statusCode=e,this.context=r,this.name="GitHubApiError"}get isPermissionError(){return this.statusCode===401||this.statusCode===403}}const jM=t=>{let e;const n=new Set,r=(f,m)=>{const g=typeof f=="function"?f(e):f;if(!Object.is(g,e)){const y=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(v=>v(e,y))}},s=()=>e,u={setState:r,getState:s,getInitialState:()=>p,subscribe:f=>(n.add(f),()=>n.delete(f))},p=e=t(r,s,u);return u},Fs=(t=>t?jM(t):jM),GK=()=>Fs(()=>({open:!1,message:"",severity:"info"})),Rl=class Rl{constructor(){St(this,"store",GK());St(this,"getSnapshot",()=>this.store.getState());St(this,"subscribe",e=>this.store.subscribe(e))}static getInstance(){return Rl.instance||(Rl.instance=new Rl),Rl.instance}static resetInstance(){Rl.instance=null}notify(e,n){this.store.setState({open:!0,message:e,severity:n})}notifyPermissionError(e,n){const r=n?`${n}: `:"";e===401?this.store.setState({open:!0,message:`${r}GitHub の認証が無効です。再ログインしてください。`,severity:"error"}):e===403?this.store.setState({open:!0,message:`${r}GitHub へのアクセスが拒否されました(403)。
|
|
276
|
+
OAuth App に組織へのアクセス権を付与してください:
|
|
277
|
+
1. https://github.com/settings/applications を開く
|
|
278
|
+
2. この OAuth App をクリック
|
|
279
|
+
3.「Organization access」で対象の組織の「Grant」をクリック`,severity:"error"}):this.store.setState({open:!0,message:`${r}GitHub API エラー(${e})`,severity:"error"})}dismiss(){this.store.setState({open:!1})}};St(Rl,"instance",null);let jC=Rl;const Pd=jC.getInstance();var Ix="frelio-data/site",Tm="frelio-data/admin",tP=`${Ix}/content_types`,Qi=`${Ix}/contents`,h2=`${Ix}/templates`,m2=`${Tm}/content_types`,nP=`${Tm}/metadata`,rP=`${Tm}/users`,Bc=`${nP}/content_types.json`,kh=`${nP}/_dashboard.json`,Mh=`${rP}/_index.json`,ZK=`${Tm}/recipes`,KK=`${Ix}/data`,TC=[{id:"templates",label:"テンプレート",path:h2}];function Kl(t){return`${tP}/${t}.json`}function Ld(t){return`${m2}/${t}.ui.json`}function sc(t){return`${m2}/${t}.views.json`}function QK(t,e){return`${Qi}/${t}/${e}`}function Oh(t,e,n){return`${Qi}/${t}/${e}/${n}.json`}function Ah(t,e){return`${Qi}/${t}/${e}/_index.json`}function Ql(t,e,n,r=null){return n===null||n===r?`${Qi}/${t}/${e}/_index.json`:`${Qi}/${t}/${e}/_index.${n}.json`}function TM(){return`${ZK}/build-data-recipe.json`}function JK(){return`${KK}/_dependency-map.json`}var Ts={DATA_ROOT:"frelio-data",CONTENT_TYPES:tP,CONTENTS_PRIVATE:`${Qi}/private`,TEMPLATES:h2,ADMIN_ROOT:Tm,ADMIN_CONTENT_TYPES:m2,ADMIN_USERS:rP};function YK(t){return{contentId:t.contentId,title:t.title,status:t.status,createdAt:t.createdAt,updatedAt:t.updatedAt,publishedAt:t.publishedAt,createdBy:t.createdBy,updatedBy:t.updatedBy}}function DC(t,e){const n={contentId:t.contentId,status:t.status,createdAt:t.createdAt,updatedAt:t.updatedAt};for(const r of e){const s=rQ(t,r.field);s!==void 0&&(n[r.field]=s)}return n}function XK(t,e){const n=t.findIndex(r=>r.contentId===e.contentId);if(n>=0){const r=[...t];return r[n]=e,r}return[...t,e]}function eQ(t,e){return t.filter(n=>n.contentId!==e)}function tQ(t,e){const n=t.findIndex(r=>r.contentId===e.contentId);if(n>=0){const r=[...t];return r[n]=e,r}return[...t,e]}function nQ(t,e){return t.filter(n=>n.contentId!==e)}function rQ(t,e){if(e in t)return t[e];if(e.startsWith("data.")){const n=e.substring(5);return t.data[n]}return t.data[e]}async function sP(t,e){const{basePath:n,contentTypeId:r,content:s}=e,i=sc(r),l=await t.readJson(i),u=(l==null?void 0:l.views)??[],p=(l==null?void 0:l.defaultViewId)??null,f=[];for(const m of u){const g=Ql(n,r,m.id,p),y=await t.readJson(g)??[],v=DC(s,m.columns),C=XK(y,v);f.push({path:g,content:JSON.stringify(C,null,2)})}if(u.length===0){const m=Ql(n,r,null,null),g=await t.readJson(m)??[],y=YK(s),v=tQ(g,y);f.push({path:m,content:JSON.stringify(v,null,2)})}return f}async function iP(t,e){const{basePath:n,contentTypeId:r,contentId:s}=e,i=sc(r),l=await t.readJson(i),u=(l==null?void 0:l.views)??[],p=(l==null?void 0:l.defaultViewId)??null,f=[];for(const m of u){const g=Ql(n,r,m.id,p),y=await t.readJson(g)??[],v=eQ(y,s);f.push({path:g,content:JSON.stringify(v,null,2)})}if(u.length===0){const m=Ql(n,r,null,null),g=await t.readJson(m)??[],y=nQ(g,s);f.push({path:m,content:JSON.stringify(y,null,2)})}return f}var oP={lastUpdatedAt:"",lastUpdatedBy:"",totalCount:0,draftCount:0,publishedCount:0};function sQ(t,e,n,r,s,i=new Date().toISOString()){const l={...t,contentTypes:{...t.contentTypes}},u={...l.contentTypes[e]??{...oP}};return u.lastUpdatedAt=i,u.lastUpdatedBy=n,r===null?(u.totalCount+=1,s==="draft"?u.draftCount+=1:s==="published"&&(u.publishedCount+=1)):r!==s&&(r==="draft"&&(u.draftCount-=1),r==="published"&&(u.publishedCount-=1),s==="draft"&&(u.draftCount+=1),s==="published"&&(u.publishedCount+=1)),l.contentTypes[e]=u,l}function iQ(t,e,n,r,s=new Date().toISOString()){const i={...t,contentTypes:{...t.contentTypes}},l={...i.contentTypes[e]??{...oP}};return l.lastUpdatedAt=s,l.lastUpdatedBy=n,l.totalCount=Math.max(0,l.totalCount-1),r==="draft"?l.draftCount=Math.max(0,l.draftCount-1):r==="published"&&(l.publishedCount=Math.max(0,l.publishedCount-1)),i.contentTypes[e]=l,i}var aP={contentTypes:{}};async function lP(t,e){const n=await t.readJson(kh)??{...aP},r=sQ(n,e.contentTypeId,e.updatedBy,e.oldStatus,e.newStatus,e.now);return{path:kh,content:JSON.stringify(r,null,2)}}async function oQ(t,e){const n=await t.readJson(kh)??{...aP},r=iQ(n,e.contentTypeId,e.deletedBy,e.deletedStatus,e.now);return{path:kh,content:JSON.stringify(r,null,2)}}function DM(t,e,n){var s,i;const r=[];if((s=t.branchName)!=null&&s.trim()?(/^[a-zA-Z0-9_\-/]+$/.test(t.branchName)||r.push({field:"branchName",message:"ブランチ名には英数字、ハイフン、アンダースコア、スラッシュのみ使用できます"}),e.some(p=>p.branchName===t.branchName&&p.branchName!==n)&&r.push({field:"branchName",message:"このブランチ名は既に登録されています"})):r.push({field:"branchName",message:"ブランチ名は必須です"}),(i=t.previewUrl)!=null&&i.trim())try{new URL(t.previewUrl)}catch{r.push({field:"previewUrl",message:"有効な URL を入力してください"})}return r}function EM(t){return!t.isDefault}function cP(t,e){const n=e.filter(l=>!l.isDefault),r=n.filter(l=>l.allowedUsers.includes(t)),s=n.filter(l=>l.allowedUsers.length===0),i=[...r];for(const l of s)i.some(u=>u.branchName===l.branchName)||i.push(l);return i}function Dm(){return{branchName:"staging",previewUrl:"",allowedUsers:[],isDefault:!0}}function RM(t){return t.split(",").map(e=>e.trim()).filter(e=>e.length>0)}function aQ(t){return t.join(", ")}const Sv=[{edit:"canEditContent",view:"canViewContent"},{edit:"canEditStorage",view:"canViewStorage"},{edit:"canEditTemplates",view:"canViewTemplates"},{edit:"canEditUsers",view:"canViewUsers"},{edit:"canEditStaging",view:"canViewStaging"},{edit:"canEditContentType",view:"canViewContentType"},{edit:"canEditBuildRecipes",view:"canViewBuildRecipes"},{edit:"canEditDeploy",view:"canViewDeploy"}],Cv={canViewContent:!0,canEditContent:!0,canViewStorage:!0,canEditStorage:!0,canViewTemplates:!0,canEditTemplates:!0,canViewUsers:!0,canEditUsers:!0,canViewStaging:!0,canEditStaging:!0,canViewContentType:!0,canEditContentType:!0,canViewBuildRecipes:!0,canEditBuildRecipes:!0,canViewDeploy:!0,canEditDeploy:!0},lQ={canViewContent:!0,canEditContent:!0,canViewStorage:!0,canEditStorage:!0,canViewTemplates:!0,canEditTemplates:!0,canViewUsers:!1,canEditUsers:!1,canViewStaging:!1,canEditStaging:!1,canViewContentType:!0,canEditContentType:!0,canViewBuildRecipes:!0,canEditBuildRecipes:!0,canViewDeploy:!1,canEditDeploy:!1},cQ={canViewContent:!0,canEditContent:!0,canViewStorage:!0,canEditStorage:!0,canViewTemplates:!0,canEditTemplates:!0,canViewUsers:!1,canEditUsers:!1,canViewStaging:!1,canEditStaging:!1,canViewContentType:!0,canEditContentType:!1,canViewBuildRecipes:!0,canEditBuildRecipes:!1,canViewDeploy:!1,canEditDeploy:!1},uQ={canViewContent:!0,canEditContent:!1,canViewStorage:!0,canEditStorage:!1,canViewTemplates:!0,canEditTemplates:!1,canViewUsers:!1,canEditUsers:!1,canViewStaging:!1,canEditStaging:!1,canViewContentType:!0,canEditContentType:!1,canViewBuildRecipes:!0,canEditBuildRecipes:!1,canViewDeploy:!1,canEditDeploy:!1},wv={owner:Cv,admin:Cv,developer:lQ,editor:cQ,viewer:uQ},dQ={owner:"所有者",admin:"管理者",developer:"開発者",editor:"編集者",viewer:"閲覧者",custom:"カスタム"},uP={content:{label:"コンテンツ",pairs:[{view:"canViewContent",edit:"canEditContent"},{view:"canViewStorage",edit:"canEditStorage"},{view:"canViewTemplates",edit:"canEditTemplates"}]},admin:{label:"管理",pairs:[{view:"canViewUsers",edit:"canEditUsers"},{view:"canViewStaging",edit:"canEditStaging"},{view:"canViewDeploy",edit:"canEditDeploy"}]},development:{label:"開発",pairs:[{view:"canViewContentType",edit:"canEditContentType"},{view:"canViewBuildRecipes",edit:"canEditBuildRecipes"}]}},dP={canViewContent:"コンテンツ",canViewStorage:"ストレージ",canViewTemplates:"テンプレート",canViewUsers:"ユーザー管理",canViewStaging:"ステージング",canViewContentType:"コンテンツタイプ",canViewBuildRecipes:"ビルドレシピ",canViewDeploy:"デプロイ"};function pQ(t,e){return Object.keys(t).every(r=>t[r]===e[r])}function _h(t,e=!1){if(e)return"owner";const n=["admin","developer","editor","viewer"];for(const r of n)if(pQ(t,wv[r]))return r;return"custom"}function Ih(t){return t==="custom"?{...wv.viewer}:{...wv[t]}}function fQ(){return{canViewContent:!1,canEditContent:!1,canViewStorage:!1,canEditStorage:!1,canViewTemplates:!1,canEditTemplates:!1,canViewUsers:!1,canEditUsers:!1,canViewStaging:!1,canEditStaging:!1,canViewContentType:!1,canEditContentType:!1,canViewBuildRecipes:!1,canEditBuildRecipes:!1,canViewDeploy:!1,canEditDeploy:!1}}const Gf=Fs(t=>({isActive:!1,virtualPermissions:null,virtualRoleTemplate:null,simulatedUserDisplayName:null,simulatedGithubUsername:null,startSimulation:(e,n,r,s)=>{t({isActive:!0,virtualPermissions:e,virtualRoleTemplate:n,simulatedUserDisplayName:r,simulatedGithubUsername:s})},stopSimulation:()=>{t({isActive:!1,virtualPermissions:null,virtualRoleTemplate:null,simulatedUserDisplayName:null,simulatedGithubUsername:null})},updatePermissions:(e,n)=>{t({virtualPermissions:e,virtualRoleTemplate:n})}}));let Dy=null,kM=null;function hQ(){const t=Gf.getState();return kM===t&&Dy!==null||(kM=t,Dy={isActive:t.isActive,virtualPermissions:t.virtualPermissions,virtualRoleTemplate:t.virtualRoleTemplate,simulatedUserDisplayName:t.simulatedUserDisplayName,simulatedGithubUsername:t.simulatedGithubUsername}),Dy}class mQ{startSimulation(e,n,r,s){Gf.getState().startSimulation(e,n,r,s)}stopSimulation(){Gf.getState().stopSimulation()}updatePermissions(e,n){Gf.getState().updatePermissions(e,n)}getState(){return hQ()}subscribe(e){return Gf.subscribe(e)}}const Px=new mQ;function ws(t,e){const n=Px.getState();return n.isActive&&n.virtualPermissions?n.virtualPermissions[e]===!0:t?t.isOwner?!0:t.permissions[e]===!0:!1}function gQ(t){return t==="/login"||t.startsWith("/auth/")||t==="/"?null:t==="/users"||t.startsWith("/users/")?"canViewUsers":t==="/staging"||t.startsWith("/staging/")?"canViewStaging":t==="/storage"||t.startsWith("/storage/")?"canViewStorage":t==="/templates"||t.startsWith("/templates/")?"canViewTemplates":t==="/build-recipes"||t.startsWith("/build-recipes/")?"canViewBuildRecipes":t==="/deploy-history"||t.startsWith("/deploy-history/")?"canViewDeploy":t.match(/^\/content-types\/[^/]+\/edit/)||t.match(/^\/content-types\/[^/]+\/views/)||t==="/content-types"||t.startsWith("/content-types/")?"canViewContentType":t.match(/^\/contents\/[^/]+\/new$/)?"canEditContent":t.match(/^\/contents\/[^/]+/)?"canViewContent":null}function yQ(t){return{...wv[t]}}function vQ(t){return{githubUsername:t.githubUsername,displayName:t.displayName,allowPersonalBranch:t.allowPersonalBranch,permissions:yQ(t.role),isOwner:!1}}function xQ(t){let e=!1;return t.map(n=>{const r=vQ(n);return!e&&n.role==="admin"&&(r.isOwner=!0,e=!0),r})}function bQ(t){return{...fQ(),...t}}function SQ(t){return typeof t=="object"&&t!==null&&"role"in t&&!("permissions"in t)}function CQ(t){return t.some(SQ)}function pP(t){return CQ(t)?xQ(t):t.map(e=>({...e,permissions:bQ(e.permissions)}))}let jv=null;async function wQ(){if(jv)return;const e=await fetch("/admin/config.json");if(!e.ok)throw new Error(`Failed to load config.json (${e.status}). Ensure config.json exists at the app root, or set VITE_CONTENT_REPO at build time.`);const n=await e.json();jv={contentRepo:n.contentRepo,githubClientId:n.githubClientId,fileUploadUrl:n.fileUploadUrl??"/api/storage",siteTitle:n.siteTitle??"",productionUrl:n.productionUrl??"",previewUrl:n.previewUrl??""}}function ta(){if(!jv)throw new Error("Config not loaded. Call loadConfig() before accessing config.");return jv}const MM="https://api.github.com",e1="frelio_github_token";class jQ{get contentRepo(){return ta().contentRepo}async fetchGitHubUser(e){oe.debug("GitHubAuthRepositoryImpl.fetchGitHubUser");const n=await fetch(`${MM}/user`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github.v3+json"}});if(!n.ok)throw oe.error("GitHubAuthRepositoryImpl.fetchGitHubUser","API error",{status:n.status}),(n.status===401||n.status===403)&&Pd.notifyPermissionError(n.status,"ユーザー情報取得"),new lh(n.status,`GitHub API error: ${n.status}`,"ユーザー情報取得");const r=await n.json();return{login:r.login,avatar_url:r.avatar_url,name:r.name}}async fetchAdminData(e){var g;oe.debug("GitHubAuthRepositoryImpl.fetchAdminData");const[n,r]=this.contentRepo.split("/"),s=await fetch(`${MM}/repos/${n}/${r}/contents/${Mh}?ref=develop`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github.v3+json"}});if(!s.ok)throw oe.error("GitHubAuthRepositoryImpl.fetchAdminData","API error",{status:s.status}),(s.status===401||s.status===403)&&Pd.notifyPermissionError(s.status,"管理データ取得"),new lh(s.status,`Failed to fetch admin data: ${s.status}`,"管理データ取得");const i=await s.json(),l=decodeURIComponent(escape(atob(i.content))),u=JSON.parse(l),p=pP(u.users??[]),m=((g=u.stagingBranches)==null?void 0:g.some(y=>y.isDefault))??!1?u.stagingBranches:[Dm(),...u.stagingBranches??[]];return{users:p,stagingBranches:m}}saveToken(e){oe.debug("GitHubAuthRepositoryImpl.saveToken"),localStorage.setItem(e1,e)}getToken(){return localStorage.getItem(e1)}clearToken(){oe.debug("GitHubAuthRepositoryImpl.clearToken"),localStorage.removeItem(e1)}getAuthUrl(){const e=ta().githubClientId;return`https://github.com/login/oauth/authorize?${new URLSearchParams({client_id:e,scope:"repo",redirect_uri:`${window.location.origin}/api/auth/callback`}).toString()}`}}function TQ(t){return t?t.allowPersonalBranch!==!1:!1}function OM(t,e,n){var s,i;const r=[];return(s=t.githubUsername)!=null&&s.trim()?e.some(u=>u.githubUsername===t.githubUsername&&u.githubUsername!==n)&&r.push({field:"githubUsername",message:"このユーザー名は既に登録されています"}):r.push({field:"githubUsername",message:"GitHub ユーザー名は必須です"}),(i=t.displayName)!=null&&i.trim()||r.push({field:"displayName",message:"表示名は必須です"}),t.permissions||r.push({field:"permissions",message:"権限は必須です"}),r}function AM(t,e){return t!==e}function Tv(t){return dQ[t]}function g2(t){return _h(t.permissions,t.isOwner??!1)}const Zf=Fs(t=>({githubUser:null,currentUser:null,token:null,isInitialized:!1,users:[],stagingBranches:[],setAuth:(e,n,r,s,i)=>{t({githubUser:e,currentUser:n,token:r,users:s,stagingBranches:i})},clearAuth:()=>{t({githubUser:null,currentUser:null,token:null,users:[],stagingBranches:[]})},setInitialized:()=>{t({isInitialized:!0})}}));let Ey=null,_M=null;function DQ(){const t=Zf.getState();if(_M===t&&Ey!==null)return Ey;_M=t;const e=t.currentUser,n=(e==null?void 0:e.permissions)??null,r=e?_h(e.permissions,e.isOwner??!1):null,s=(e==null?void 0:e.isOwner)??!1,i=TQ(e??void 0);return Ey={githubUser:t.githubUser,currentUser:t.currentUser,token:t.token,isInitialized:t.isInitialized,users:t.users,stagingBranches:t.stagingBranches,permissions:n,roleTemplate:r,isOwner:s,allowPersonalBranch:i},Ey}class EQ{setAuth(e,n,r,s,i){Zf.getState().setAuth(e,n,r,s,i)}clearAuth(){Zf.getState().clearAuth()}setInitialized(){Zf.getState().setInitialized()}getState(){return DQ()}subscribe(e){return Zf.subscribe(e)}}const Em=new EQ;class fP{constructor(e){this.repository=e}async execute(e){oe.info("LoginUseCase.execute");const n=await this.repository.fetchGitHubUser(e);oe.debug("LoginUseCase.execute","GitHub user fetched",{login:n.login});const r=await this.repository.fetchAdminData(e),{users:s,stagingBranches:i}=r;oe.debug("LoginUseCase.execute","Admin data fetched",{usersCount:s.length,stagingBranchesCount:i.length});const l=s.find(u=>u.githubUsername===n.login);if(!l)throw oe.warn("LoginUseCase.execute","User not authorized",{login:n.login}),new Error(`User ${n.login} is not authorized`);return this.repository.saveToken(e),oe.info("LoginUseCase.execute","Login successful",{login:n.login}),{user:l,githubUser:n,users:s,stagingBranches:i}}async restoreSession(){oe.debug("LoginUseCase.restoreSession");const e=this.repository.getToken();if(!e)return oe.debug("LoginUseCase.restoreSession","No token found"),null;try{return await this.execute(e)}catch(n){return oe.warn("LoginUseCase.restoreSession","Failed to restore session",{error:n}),this.repository.clearToken(),null}}}class RQ{constructor(e){this.repository=e}execute(){oe.info("LogoutUseCase.execute"),this.repository.clearToken()}}class kQ{constructor(e){this.repository=e}execute(){return oe.debug("GetAuthUrlUseCase.execute"),this.repository.getAuthUrl()}}class MQ{constructor(e,n){this.repository=e,this.presenter=n}async execute(){oe.debug("InitAuthUseCase.execute");const e=this.repository.getToken();if(!e){oe.debug("InitAuthUseCase.execute","No token found"),this.presenter.setInitialized();return}try{oe.debug("InitAuthUseCase.execute","Restoring session...");const r=await new fP(this.repository).execute(e);this.presenter.setAuth(r.githubUser,r.user,e,r.users,r.stagingBranches),oe.info("InitAuthUseCase.execute","Session restored",{login:r.githubUser.login})}catch(n){oe.warn("InitAuthUseCase.execute","Failed to restore session",{error:n}),this.repository.clearToken(),this.presenter.clearAuth()}finally{this.presenter.setInitialized()}}}class OQ{constructor(e){this.deps=e}getState(){return this.deps.presenter.getState()}async login(e){const{presenter:n,loginUseCase:r}=this.deps,s=await r.execute(e);return n.setAuth(s.githubUser,s.user,e,s.users,s.stagingBranches),s}logout(){const{presenter:e,logoutUseCase:n}=this.deps;n.execute(),e.clearAuth()}getAuthUrl(){return this.deps.getAuthUrlUseCase.execute()}}let t1=!1;const Lx=new jQ,AQ=new fP(Lx),_Q=new RQ(Lx),IQ=new kQ(Lx),PQ=new MQ(Lx,Em),IM=new OQ({presenter:Em,loginUseCase:AQ,logoutUseCase:_Q,getAuthUrlUseCase:IQ}),LQ=t=>Em.subscribe(t),PM=()=>Em.getState();function rr(){b.useSyncExternalStore(LQ,PM,PM);const t=IM.getState(),e=b.useRef(!1);return b.useEffect(()=>{t.isInitialized||e.current||t1||(e.current=!0,t1=!0,PQ.execute().finally(()=>{t1=!1}))},[t.isInitialized]),{authUseCase:IM}}function Qr(){return ta().contentRepo}const zQ="https://api.github.com/graphql";class At{constructor(e){this.token=e}async fetchFile(e,n="main"){const[r,s]=Qr().split("/"),i=`${n}:${e}`,u=await this.graphql(`
|
|
280
|
+
query GetFile($owner: String!, $repo: String!, $expression: String!) {
|
|
281
|
+
repository(owner: $owner, name: $repo) {
|
|
282
|
+
object(expression: $expression) {
|
|
283
|
+
... on Blob {
|
|
284
|
+
text
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
`,{owner:r,repo:s,expression:i});if(!u.repository.object)throw new Error(`File not found: ${e}`);return u.repository.object.text}async fetchFileOrNull(e,n="main"){try{return await this.fetchFile(e,n)}catch{return null}}async fetchFileBase64(e,n="main"){const[r,s]=Qr().split("/"),i=await fetch(`https://api.github.com/repos/${r}/${s}/contents/${e}?ref=${n}`,{headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json"}});if(!i.ok)throw new Error(`File not found: ${e}`);return(await i.json()).content.replace(/\n/g,"")}async fetchFileBase64OrNull(e,n="main"){try{return await this.fetchFileBase64(e,n)}catch{return null}}async fetchJson(e,n="main"){const r=await this.fetchFile(e,n);return JSON.parse(r)}async fetchJsonOrDefault(e,n,r="main"){const s=await this.fetchFileOrNull(e,r);return s===null?n:JSON.parse(s)}async listDirectory(e,n="main"){const[r,s]=Qr().split("/"),i=`${n}:${e}`,u=await this.graphql(`
|
|
290
|
+
query ListDirectory($owner: String!, $repo: String!, $expression: String!) {
|
|
291
|
+
repository(owner: $owner, name: $repo) {
|
|
292
|
+
object(expression: $expression) {
|
|
293
|
+
... on Tree {
|
|
294
|
+
entries {
|
|
295
|
+
name
|
|
296
|
+
type
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
`,{owner:r,repo:s,expression:i});return u.repository.object?u.repository.object.entries.filter(p=>p.type==="blob"&&p.name.endsWith(".json")&&!p.name.startsWith("_")).map(p=>p.name):[]}async listDirectoryEntries(e,n="main"){const[r,s]=Qr().split("/"),i=`${n}:${e}`,u=await this.graphql(`
|
|
303
|
+
query ListDirectoryEntries($owner: String!, $repo: String!, $expression: String!) {
|
|
304
|
+
repository(owner: $owner, name: $repo) {
|
|
305
|
+
object(expression: $expression) {
|
|
306
|
+
... on Tree {
|
|
307
|
+
entries {
|
|
308
|
+
name
|
|
309
|
+
type
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
`,{owner:r,repo:s,expression:i});return u.repository.object?u.repository.object.entries.map(p=>({name:p.name,type:p.type})):[]}async getLatestCommitOid(e="main"){const[n,r]=Qr().split("/"),i=await this.graphql(`
|
|
316
|
+
query GetLatestCommit($owner: String!, $repo: String!, $branch: String!) {
|
|
317
|
+
repository(owner: $owner, name: $repo) {
|
|
318
|
+
ref(qualifiedName: $branch) {
|
|
319
|
+
target {
|
|
320
|
+
oid
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
`,{owner:n,repo:r,branch:`refs/heads/${e}`});if(!i.repository.ref)throw new Error(`Branch not found: ${e}`);return i.repository.ref.target.oid}async getBranchInfo(e){const[n,r]=Qr().split("/"),s=await fetch(`https://api.github.com/repos/${n}/${r}/branches/${e}`,{headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json"}});return s.ok?s.json():null}async getLatestCommitForPath(e,n){const[r,s]=Qr().split("/"),i=await fetch(`https://api.github.com/repos/${r}/${s}/commits?sha=${e}&path=${n}&per_page=1`,{headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json"}});if(!i.ok)return null;const l=await i.json();return l.length?{sha:l[0].sha,date:new Date(l[0].commit.author.date)}:null}async branchExists(e){try{return await this.getLatestCommitOid(e),!0}catch{return!1}}async getRepositoryId(){const[e,n]=Qr().split("/");return(await this.graphql(`
|
|
326
|
+
query GetRepoId($owner: String!, $repo: String!) {
|
|
327
|
+
repository(owner: $owner, name: $repo) {
|
|
328
|
+
id
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
`,{owner:e,repo:n})).repository.id}async createBranch(e,n){const r=await this.getRepositoryId(),s=await this.getLatestCommitOid(n),i=`
|
|
332
|
+
mutation CreateRef($input: CreateRefInput!) {
|
|
333
|
+
createRef(input: $input) {
|
|
334
|
+
ref {
|
|
335
|
+
name
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
`,l={repositoryId:r,name:`refs/heads/${e}`,oid:s};await this.graphql(i,{input:l})}async ensureBranch(e,n){await this.branchExists(e)||await this.createBranch(e,n)}async resetBranch(e,n){const r=await this.getLatestCommitOid(n);await this.resetBranchToCommit(e,r)}async resetBranchToCommit(e,n){const[r,s]=Qr().split("/"),i=await fetch(`https://api.github.com/repos/${r}/${s}/git/refs/heads/${e}`,{method:"PATCH",headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json","Content-Type":"application/json"},body:JSON.stringify({sha:n,force:!0})});i.ok||this.handleApiError(i.status,"ブランチリセット")}async compareBranches(e,n){const[r,s]=Qr().split("/"),i=await fetch(`https://api.github.com/repos/${r}/${s}/compare/${e}...${n}`,{headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json"}});if(!i.ok){if(i.status===404)return{ahead:0,behind:0,files:[]};this.handleApiError(i.status,"ブランチ比較")}const l=await i.json(),u=(l.files??[]).map(p=>({filename:p.filename,status:p.status}));return{ahead:l.ahead_by,behind:l.behind_by,files:u}}async findConflictingFiles(e,n){const[r,s]=await Promise.all([this.compareBranches(n,e),this.compareBranches(e,n)]),i=new Set(r.files.map(p=>p.filename)),l=new Set(s.files.map(p=>p.filename)),u=[];for(const p of i)l.has(p)&&u.push(p);return u}async mergeBranches(e,n,r){const[s,i]=Qr().split("/"),l=await fetch(`https://api.github.com/repos/${s}/${i}/merges`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json","Content-Type":"application/json"},body:JSON.stringify({base:e,head:n,commit_message:r})});return l.status===409?{sha:null,hasConflict:!0}:l.status===204?{sha:null,hasConflict:!1}:(l.ok||this.handleApiError(l.status,"マージ"),{sha:(await l.json()).sha,hasConflict:!1})}async getCommits(e,n="main",r=20,s=1){const[i,l]=Qr().split("/"),u=await fetch(`https://api.github.com/repos/${i}/${l}/commits?sha=${n}&path=${encodeURIComponent(e)}&per_page=${r}&page=${s}`,{headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json"}});if(!u.ok){if(u.status===404)return{commits:[],hasMore:!1};this.handleApiError(u.status,"コミット履歴取得")}const p=await u.json(),f=u.headers.get("Link"),m=(f==null?void 0:f.includes('rel="next"'))??!1;return{commits:p.map(g=>{var y;return{sha:g.sha,message:g.commit.message,author:{login:((y=g.author)==null?void 0:y.login)??null,date:g.commit.author.date}}}),hasMore:m}}async searchCode(e,n){const[r,s]=Qr().split("/"),i=`${e} repo:${r}/${s} path:${n}`,l=encodeURIComponent(i),u=[];let p=0,f=1;const m=10;for(;f<=m;){const g=await fetch(`https://api.github.com/search/code?q=${l}&per_page=100&page=${f}`,{headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json"}});if(!g.ok){if(g.status===403)throw new lh(403,"レート制限に達しました。しばらく待ってからお試しください。","コード検索");if(g.status===422)throw new lh(422,"検索クエリが無効です。","コード検索");this.handleApiError(g.status,"コード検索")}const y=await g.json();if(p=y.total_count,u.push(...y.items),u.length>=p||y.items.length===0)break;f++}return{items:u,total_count:p}}async listDeployTags(e=20,n){const[r,s]=Qr().split("/"),l=await this.graphql(`
|
|
340
|
+
query ListDeployTags($owner: String!, $repo: String!, $first: Int!, $after: String) {
|
|
341
|
+
repository(owner: $owner, name: $repo) {
|
|
342
|
+
refs(refPrefix: "refs/tags/", first: $first, after: $after, orderBy: {field: TAG_COMMIT_DATE, direction: DESC}) {
|
|
343
|
+
edges {
|
|
344
|
+
node {
|
|
345
|
+
name
|
|
346
|
+
target {
|
|
347
|
+
... on Commit {
|
|
348
|
+
oid
|
|
349
|
+
message
|
|
350
|
+
author {
|
|
351
|
+
date
|
|
352
|
+
user { login }
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
... on Tag {
|
|
356
|
+
target {
|
|
357
|
+
... on Commit {
|
|
358
|
+
oid
|
|
359
|
+
message
|
|
360
|
+
author {
|
|
361
|
+
date
|
|
362
|
+
user { login }
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
pageInfo {
|
|
371
|
+
hasNextPage
|
|
372
|
+
endCursor
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
`,{owner:r,repo:s,first:e,after:n??null}),{edges:u,pageInfo:p}=l.repository.refs;return{tags:u.map(({node:m})=>{var y,v,C;const g=m.target.oid?m.target:m.target.target;return g!=null&&g.oid?{name:m.name,commitSha:g.oid,commitMessage:g.message??"",authorLogin:((v=(y=g.author)==null?void 0:y.user)==null?void 0:v.login)??null,authorDate:((C=g.author)==null?void 0:C.date)??""}:null}).filter(m=>m!==null).filter(m=>/^d\d/.test(m.name)),hasMore:p.hasNextPage,endCursor:p.endCursor}}async commitFiles(e,n,r="main"){const[s,i]=Qr().split("/"),l=await this.getLatestCommitOid(r),u=n.filter(y=>!y.delete).map(y=>({path:y.path,contents:btoa(unescape(encodeURIComponent(y.content)))})),p=n.filter(y=>y.delete).map(y=>({path:y.path})),f=`
|
|
378
|
+
mutation CreateCommit($input: CreateCommitOnBranchInput!) {
|
|
379
|
+
createCommitOnBranch(input: $input) {
|
|
380
|
+
commit {
|
|
381
|
+
oid
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
`,m={branch:{repositoryNameWithOwner:`${s}/${i}`,branchName:r},message:{headline:e},expectedHeadOid:l,fileChanges:{}};return u.length>0&&(m.fileChanges.additions=u),p.length>0&&(m.fileChanges.deletions=p),(await this.graphql(f,{input:m})).createCommitOnBranch.commit.oid}handleApiError(e,n){throw(e===401||e===403)&&Pd.notifyPermissionError(e,n),new lh(e,`GitHub API error: ${e}`,n)}async graphql(e,n){const r=await fetch(zQ,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify({query:e,variables:n})});r.ok||this.handleApiError(r.status,"GraphQL");const s=await r.json();if(s.errors)throw new Error(`GitHub GraphQL errors: ${JSON.stringify(s.errors)}`);return s.data}async triggerWorkflow(e,n="main"){const[r,s]=Qr().split("/"),i=await fetch(`https://api.github.com/repos/${r}/${s}/actions/workflows/${e}/dispatches`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json","Content-Type":"application/json"},body:JSON.stringify({ref:n})});if(!i.ok){const l=await i.text();this.handleApiError(i.status,`ワークフロー実行 ${l}`)}}async getLatestWorkflowRun(e){const[n,r]=Qr().split("/"),s=await fetch(`https://api.github.com/repos/${n}/${r}/actions/workflows/${e}/runs?per_page=1`,{headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json"}});return s.ok||this.handleApiError(s.status,"ワークフロー実行状態取得"),(await s.json()).workflow_runs[0]??null}}const LM="frelio-branch-type",y2="frelio-branch-diff-cache";function n1(t){try{localStorage.setItem(y2,JSON.stringify(t))}catch{}}function $Q(){try{const t=localStorage.getItem(y2);return t?JSON.parse(t):null}catch{return null}}function If(){try{localStorage.removeItem(y2)}catch{}}const NQ={currentBranch:"develop",branchType:"develop",hasDiff:!1,diffCount:0,behindCount:0,conflicts:[],changedContents:[],isLoading:!1,isSyncing:!1,error:null};class FQ{constructor(){St(this,"state",{...NQ});St(this,"listeners",new Set);this.getSavedBranchType()==="personal"&&(this.state.branchType="personal")}getState(){return this.state}getSavedBranchType(){try{if(localStorage.getItem(LM)==="personal")return"personal"}catch{}return"develop"}setBranch(e,n){this.state={...this.state,currentBranch:e,branchType:n};try{localStorage.setItem(LM,n)}catch{}this.notify()}setDiffStatus(e,n,r){this.state={...this.state,hasDiff:e,diffCount:n,behindCount:r},this.notify()}setConflicts(e){this.state={...this.state,conflicts:e},this.notify()}setChangedContents(e){this.state={...this.state,changedContents:e},this.notify()}setLoading(e){this.state={...this.state,isLoading:e},this.notify()}setSyncing(e){this.state={...this.state,isSyncing:e},this.notify()}setError(e){this.state={...this.state,error:e},this.notify()}clearConflicts(){this.state={...this.state,conflicts:[]},this.notify()}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){this.listeners.forEach(e=>e())}}const Rm=new FQ,BQ="frelio-cms",mr="develop",zM="main",r1=[3e3,5e3,1e4],UQ=3,s1=[5e3,1e4,15e3,2e4,3e4],VQ=5;function HQ(t){return t.toLowerCase().replace(/[._]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function $M(t){return`${BQ}/${HQ(t)}`}class WQ{constructor(e,n,r){St(this,"syncTimeoutId",null);this.presenter=e,this.gitHubClient=n,this.username=r}getState(){return{...this.presenter.getState(),developBranchName:mr,personalBranchName:$M(this.username)}}getCurrentBranch(){return this.presenter.getState().currentBranch}async switchToDevelop(){oe.info("BranchUseCase.switchToDevelop"),this.presenter.setLoading(!0),this.presenter.setError(null);try{await this.gitHubClient.ensureBranch(mr,zM),this.presenter.setBranch(mr,"develop"),this.presenter.setDiffStatus(!1,0,0),this.presenter.clearConflicts(),oe.info("BranchUseCase.switchToDevelop completed")}catch(e){throw oe.error("BranchUseCase.switchToDevelop failed",{error:e}),this.presenter.setError(e instanceof Error?e:new Error(String(e))),e}finally{this.presenter.setLoading(!1)}}async switchToPersonal(){const e=$M(this.username);oe.info("BranchUseCase.switchToPersonal",{personalBranch:e}),this.presenter.setLoading(!0),this.presenter.setError(null);try{await this.gitHubClient.ensureBranch(mr,zM),await this.gitHubClient.ensureBranch(e,mr),this.presenter.setBranch(e,"personal"),await this.checkDiff(),oe.info("BranchUseCase.switchToPersonal completed",{personalBranch:e})}catch(n){throw oe.error("BranchUseCase.switchToPersonal failed",{error:n}),this.presenter.setError(n instanceof Error?n:new Error(String(n))),n}finally{this.presenter.setLoading(!1)}}async checkDiff(){const e=this.presenter.getState();if(e.branchType==="develop"){this.presenter.setDiffStatus(!1,0,0),If();return}oe.info("BranchUseCase.checkDiff",{branch:e.currentBranch});const n=$Q();if(n){this.presenter.setDiffStatus(n.hasDiff,n.diffCount,n.behindCount),this.presenter.setSyncing(!0),oe.info("BranchUseCase.checkDiff: using cache, syncing",{hasDiff:n.hasDiff,diffCount:n.diffCount,age:Date.now()-n.timestamp}),this.startBackgroundSyncSilent();return}try{const[r,s]=await Promise.all([this.gitHubClient.compareBranches(mr,e.currentBranch),this.gitHubClient.compareBranches(e.currentBranch,mr)]),i=r.files.length>0,l=s.files.length>0?r.behind:0;this.presenter.setDiffStatus(i,r.ahead,l),oe.info("BranchUseCase.checkDiff completed",{ahead:r.ahead,behind:r.behind,aheadFilesCount:r.files.length,behindFilesCount:s.files.length})}catch(r){oe.error("BranchUseCase.checkDiff failed",{error:r}),this.presenter.setDiffStatus(!1,0,0)}}startBackgroundSyncSilent(){this.syncTimeoutId!==null&&(clearTimeout(this.syncTimeoutId),this.syncTimeoutId=null),this.backgroundSyncSilentWithRetry(0)}backgroundSyncSilentWithRetry(e){const n=s1[e]??s1[s1.length-1];this.syncTimeoutId=setTimeout(async()=>{const r=this.presenter.getState();if(r.branchType==="develop"){this.presenter.setSyncing(!1);return}oe.info("BranchUseCase.backgroundSyncSilent: checking",{retry:e});try{const[s,i]=await Promise.all([this.gitHubClient.compareBranches(mr,r.currentBranch),this.gitHubClient.compareBranches(r.currentBranch,mr)]),l=s.files.length>0,u=i.files.length>0?s.behind:0,p=this.presenter.getState();p.hasDiff===l?(this.presenter.setDiffStatus(l,s.ahead,u),this.presenter.setSyncing(!1),If(),oe.info("BranchUseCase.backgroundSyncSilent: synced, cache cleared",{ahead:s.ahead,behind:u})):e<VQ-1?(oe.info("BranchUseCase.backgroundSyncSilent: inconsistent, retrying",{cached:{hasDiff:p.hasDiff,diffCount:p.diffCount},api:{hasDiff:l,ahead:s.ahead},retry:e+1}),this.backgroundSyncSilentWithRetry(e+1)):(this.presenter.setDiffStatus(l,s.ahead,u),this.presenter.setSyncing(!1),If(),oe.warn("BranchUseCase.backgroundSyncSilent: max retries reached, using API value",{ahead:s.ahead,behind:u}))}catch(s){oe.error("BranchUseCase.backgroundSyncSilent: failed",{error:s}),this.presenter.setSyncing(!1)}},n)}async refreshDiff(){await this.checkDiff()}async refreshDiffAfterSave(){const e=this.presenter.getState();if(e.branchType==="develop")return;const n=e.diffCount+1;this.presenter.setDiffStatus(!0,n,e.behindCount),n1({hasDiff:!0,diffCount:n,behindCount:e.behindCount,timestamp:Date.now()}),oe.info("BranchUseCase.refreshDiffAfterSave: optimistic update + cache",{diffCount:n}),this.startBackgroundSync()}async refreshDiffAfterMerge(){this.presenter.getState().branchType!=="develop"&&(this.presenter.setDiffStatus(!1,0,0),n1({hasDiff:!1,diffCount:0,behindCount:0,timestamp:Date.now()}),oe.info("BranchUseCase.refreshDiffAfterMerge: optimistic update + cache (no diff)"),this.startBackgroundSync())}async refreshDiffAfterRebase(){const e=this.presenter.getState();e.branchType!=="develop"&&(this.presenter.setDiffStatus(e.hasDiff,e.diffCount,0),n1({hasDiff:e.hasDiff,diffCount:e.diffCount,behindCount:0,timestamp:Date.now()}),oe.info("BranchUseCase.refreshDiffAfterRebase: optimistic update + cache",{hasDiff:e.hasDiff,diffCount:e.diffCount,behindCount:0}),this.startBackgroundSync())}startBackgroundSync(){this.syncTimeoutId!==null&&(clearTimeout(this.syncTimeoutId),this.syncTimeoutId=null),this.presenter.setSyncing(!0),this.backgroundSyncWithRetry(0)}backgroundSyncWithRetry(e){const n=r1[e]??r1[r1.length-1];this.syncTimeoutId=setTimeout(async()=>{const r=this.presenter.getState();if(r.branchType==="develop"){this.presenter.setSyncing(!1);return}oe.info("BranchUseCase.backgroundSync: checking",{retry:e});try{const[s,i]=await Promise.all([this.gitHubClient.compareBranches(mr,r.currentBranch),this.gitHubClient.compareBranches(r.currentBranch,mr)]),l=s.files.length>0,u=i.files.length>0?s.behind:0,p=this.presenter.getState();p.hasDiff===l?(this.presenter.setDiffStatus(l,s.ahead,u),this.presenter.setSyncing(!1),If(),oe.info("BranchUseCase.backgroundSync: synced, cache cleared",{ahead:s.ahead,behind:u})):e<UQ-1?(oe.info("BranchUseCase.backgroundSync: inconsistent, retrying",{localHasDiff:p.hasDiff,apiHasDiff:l,retry:e+1}),this.backgroundSyncWithRetry(e+1)):(this.presenter.setDiffStatus(l,s.ahead,u),this.presenter.setSyncing(!1),If(),oe.warn("BranchUseCase.backgroundSync: max retries reached, using API value",{ahead:s.ahead,behind:u}))}catch(s){oe.error("BranchUseCase.backgroundSync: failed",{error:s}),this.presenter.setSyncing(!1)}},n)}cancelBackgroundSync(){this.syncTimeoutId!==null&&(clearTimeout(this.syncTimeoutId),this.syncTimeoutId=null,this.presenter.setSyncing(!1))}async rebaseFromDevelop(){const e=this.presenter.getState();if(e.branchType==="develop")return oe.info("BranchUseCase.rebaseFromDevelop: skipped (on develop)"),!1;oe.info("BranchUseCase.rebaseFromDevelop",{branch:e.currentBranch}),this.presenter.setLoading(!0),this.presenter.setError(null);try{const n=await this.gitHubClient.mergeBranches(e.currentBranch,mr,`Merge develop into ${e.currentBranch}`);if(oe.info("BranchUseCase.rebaseFromDevelop: merge result",{sha:n.sha,hasConflict:n.hasConflict}),n.hasConflict){if(oe.warn("BranchUseCase.rebaseFromDevelop: conflict detected"),await this.fetchConflictingContents(),this.presenter.getState().conflicts.length===0){oe.info("BranchUseCase.rebaseFromDevelop: no real conflicts, auto-resolving");const s=await this.gitHubClient.findConflictingFiles(e.currentBranch,mr),i=await Promise.all(s.map(async u=>{const p=await this.gitHubClient.fetchFileOrNull(u,mr);return{path:u,content:p??"",delete:p===null}}));i.length>0&&(await this.gitHubClient.commitFiles("Auto-resolve conflicts: accept develop version",i,e.currentBranch),oe.info("BranchUseCase.rebaseFromDevelop: auto-resolve committed",{count:i.length}));const l=await this.gitHubClient.mergeBranches(e.currentBranch,mr,`Merge develop into ${e.currentBranch}`);return oe.info("BranchUseCase.rebaseFromDevelop: retry merge result",{sha:l.sha,hasConflict:l.hasConflict}),l.hasConflict?(oe.warn("BranchUseCase.rebaseFromDevelop: still has conflict after auto-resolve"),await this.fetchConflictingContents(),!0):(await this.refreshDiffAfterRebase(),oe.info("BranchUseCase.rebaseFromDevelop: auto-resolved and merged"),!1)}return!0}return await this.refreshDiffAfterRebase(),oe.info("BranchUseCase.rebaseFromDevelop completed",{sha:n.sha}),!1}catch(n){throw oe.error("BranchUseCase.rebaseFromDevelop failed",{error:n}),this.presenter.setError(n instanceof Error?n:new Error(String(n))),n}finally{this.presenter.setLoading(!1)}}async fetchConflictingContents(){const e=this.presenter.getState();if(e.branchType==="develop"){this.presenter.setConflicts([]);return}oe.info("BranchUseCase.fetchConflictingContents",{branch:e.currentBranch});try{const r=(await this.gitHubClient.findConflictingFiles(e.currentBranch,mr)).map(l=>{const u=this.parseContentPath(l);return u?{...u,path:l}:null}).filter(l=>l!==null),i=(await Promise.all(r.map(async l=>{try{const[u,p]=await Promise.all([this.gitHubClient.fetchFileOrNull(l.path,e.currentBranch),this.gitHubClient.fetchFileOrNull(l.path,mr)]);return u===p?null:{contentTypeId:l.contentTypeId,contentId:l.contentId,title:l.contentId,path:l.path}}catch{return{contentTypeId:l.contentTypeId,contentId:l.contentId,title:l.contentId,path:l.path}}}))).filter(l=>l!==null);this.presenter.setConflicts(i),oe.info("BranchUseCase.fetchConflictingContents completed",{candidateCount:r.length,realConflictCount:i.length})}catch(n){oe.error("BranchUseCase.fetchConflictingContents failed",{error:n}),this.presenter.setConflicts([])}}async discardConflictingFiles(){const e=this.presenter.getState();if(e.branchType==="develop"){oe.info("BranchUseCase.discardConflictingFiles: skipped (on develop)");return}const n=e.conflicts;if(n.length===0){oe.info("BranchUseCase.discardConflictingFiles: no conflicts");return}oe.info("BranchUseCase.discardConflictingFiles",{branch:e.currentBranch,count:n.length}),this.presenter.setLoading(!0),this.presenter.setError(null);try{const r=await Promise.all(n.map(async s=>{const i=await this.gitHubClient.fetchFileOrNull(s.path,mr);return{path:s.path,content:i??"",delete:i===null}}));await this.gitHubClient.commitFiles("Resolve conflicts by accepting develop version",r,e.currentBranch),this.presenter.clearConflicts(),await this.checkDiff(),oe.info("BranchUseCase.discardConflictingFiles completed")}catch(r){throw oe.error("BranchUseCase.discardConflictingFiles failed",{error:r}),this.presenter.setError(r instanceof Error?r:new Error(String(r))),r}finally{this.presenter.setLoading(!1)}}async discardPersonalChanges(){const e=this.presenter.getState();if(e.branchType==="develop"){oe.info("BranchUseCase.discardPersonalChanges: skipped (on develop)");return}oe.info("BranchUseCase.discardPersonalChanges",{branch:e.currentBranch}),this.presenter.setLoading(!0),this.presenter.setError(null);try{await this.gitHubClient.resetBranch(e.currentBranch,mr),this.presenter.setDiffStatus(!1,0,0),this.presenter.clearConflicts(),oe.info("BranchUseCase.discardPersonalChanges completed")}catch(n){throw oe.error("BranchUseCase.discardPersonalChanges failed",{error:n}),this.presenter.setError(n instanceof Error?n:new Error(String(n))),n}finally{this.presenter.setLoading(!1)}}async fetchChangedContents(){const e=this.presenter.getState();if(e.branchType==="develop"){oe.info("BranchUseCase.fetchChangedContents: skipped (on develop)"),this.presenter.setChangedContents([]);return}oe.info("BranchUseCase.fetchChangedContents",{branch:e.currentBranch}),this.presenter.setLoading(!0);try{const n=await this.gitHubClient.compareBranches(mr,e.currentBranch),r=[];for(const s of n.files){const i=this.parseContentPath(s.filename);i&&r.push({...i,status:s.status==="renamed"?"modified":s.status})}this.presenter.setChangedContents(r),oe.info("BranchUseCase.fetchChangedContents completed",{count:r.length})}catch(n){oe.error("BranchUseCase.fetchChangedContents failed",{error:n}),this.presenter.setChangedContents([])}finally{this.presenter.setLoading(!1)}}parseContentPath(e){if(e.endsWith("_index.json"))return null;const n=e.match(/^frelio-data\/site\/contents\/published\/([^/]+)\/([^/]+)\.json$/);if(n)return{basePath:"published",contentTypeId:n[1],contentId:n[2]};const r=e.match(/^frelio-data\/site\/contents\/private\/([^/]+)\/([^/]+)\.json$/);return r?{basePath:"private",contentTypeId:r[1],contentId:r[2]}:null}async pullContentFromDevelop(e){const n=this.presenter.getState();if(n.branchType==="develop"){oe.info("BranchUseCase.pullContentFromDevelop: skipped (on develop)");return}const r=`${Qi}/${e.basePath}/${e.contentTypeId}/${e.contentId}.json`;oe.info("BranchUseCase.pullContentFromDevelop",{filePath:r}),this.presenter.setLoading(!0),this.presenter.setError(null);try{const s=await this.gitHubClient.fetchFileOrNull(r,mr);s===null?await this.gitHubClient.commitFiles(`Pull from develop: delete ${e.contentId}`,[{path:r,content:"",delete:!0}],n.currentBranch):await this.gitHubClient.commitFiles(`Pull from develop: ${e.contentId}`,[{path:r,content:s,delete:!1}],n.currentBranch),await this.checkDiff(),oe.info("BranchUseCase.pullContentFromDevelop completed")}catch(s){throw oe.error("BranchUseCase.pullContentFromDevelop failed",{error:s}),this.presenter.setError(s instanceof Error?s:new Error(String(s))),s}finally{this.presenter.setLoading(!1)}}async isSameAsDevelop(e){if(this.presenter.getState().branchType==="develop")return!0;const r=`${Qi}/${e.basePath}/${e.contentTypeId}/${e.contentId}.json`;try{const s=await this.gitHubClient.fetchFileOrNull(r,mr);if(s===null)return!1;const i=JSON.parse(s);return JSON.stringify(i)===JSON.stringify(e.content)}catch{return!1}}async mergeToDevelop(){const e=this.presenter.getState();if(e.branchType==="develop")return oe.info("BranchUseCase.mergeToDevelop: skipped (on develop)"),{success:!0,hasConflict:!1};if(!e.hasDiff)return oe.info("BranchUseCase.mergeToDevelop: skipped (no diff)"),{success:!0,hasConflict:!1};oe.info("BranchUseCase.mergeToDevelop",{branch:e.currentBranch}),this.presenter.setLoading(!0),this.presenter.setError(null);try{const n=await this.gitHubClient.mergeBranches(mr,e.currentBranch,`Merge ${e.currentBranch} into develop`);return oe.info("BranchUseCase.mergeToDevelop: merge result",{sha:n.sha,hasConflict:n.hasConflict}),n.hasConflict?(oe.warn("BranchUseCase.mergeToDevelop: conflict detected"),await this.fetchConflictingContents(),{success:!1,hasConflict:!0}):(n.sha?(await this.gitHubClient.resetBranchToCommit(e.currentBranch,n.sha),oe.info("BranchUseCase.mergeToDevelop: fast-forwarded personal branch to merge commit",{sha:n.sha})):(await this.gitHubClient.resetBranch(e.currentBranch,mr),oe.info("BranchUseCase.mergeToDevelop: fast-forwarded personal branch to develop (already merged)")),await this.refreshDiffAfterMerge(),oe.info("BranchUseCase.mergeToDevelop completed",{sha:n.sha}),{success:!0,hasConflict:!1})}catch(n){throw oe.error("BranchUseCase.mergeToDevelop failed",{error:n}),this.presenter.setError(n instanceof Error?n:new Error(String(n))),n}finally{this.presenter.setLoading(!1)}}async initialize(){const e=this.presenter.getSavedBranchType();oe.info("BranchUseCase.initialize",{savedBranchType:e}),e==="personal"?await this.switchToPersonal():await this.switchToDevelop(),oe.info("BranchUseCase.initialize completed",{savedBranchType:e})}}const qQ=t=>Rm.subscribe(t),NM=()=>Rm.getState();function Ei(){const{authUseCase:t}=rr(),{token:e,githubUser:n,allowPersonalBranch:r}=t.getState(),s=b.useRef(!1);b.useSyncExternalStore(qQ,NM,NM);const i=b.useMemo(()=>{if(!e||!n)return null;const l=new At(e);return new WQ(Rm,l,n.login)},[e,n]);return b.useEffect(()=>{if(!(!i||s.current)){if(s.current=!0,!r){i.switchToDevelop();return}i.initialize()}},[i,r]),{branchUseCase:i}}function GQ(){return{users:[],stagingBranches:[Dm()]}}class uu{constructor(e,n){this.queries=e,this.saveMutation=n}static AdminDataQueryParams(e,n){return{queryKey:["adminData",n],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).fetchJsonOrDefault(Mh,GQ(),n)},enabled:!!e}}static SaveAdminDataMutationParams(e,n,r){return{mutationFn:async s=>{if(!n)throw new Error("Not authenticated");await new At(n).commitFiles("chore: ユーザー一覧を更新",[{path:Mh,content:JSON.stringify(s,null,2)}],r)},onSuccess:()=>{e.invalidateQueries({queryKey:["adminData",r]})}}}getUsers(){var n;const e=((n=this.queries.adminData.data)==null?void 0:n.users)??[];return pP(e)}isLoading(){return this.queries.adminData.isLoading}getError(){return this.queries.adminData.error}async saveUsers(e){const n=this.queries.adminData.data,r={users:e,stagingBranches:(n==null?void 0:n.stagingBranches)??[Dm()]};await this.saveMutation.mutateAsync(r)}isSaving(){return this.saveMutation.isPending}}const Ry=20;function ZQ(t,e){if(!t)return"不明";const n=e.find(r=>r.githubUsername===t);return(n==null?void 0:n.displayName)??t}function FM(t,e){return{sha:t.sha,shortSha:t.sha.slice(0,7),message:t.message,authorGithubUsername:t.author.login,authorDisplayName:ZQ(t.author.login,e),date:new Date(t.author.date)}}class i1{constructor(e,n,r,s,i,l,u,p){this.queries=e,this.users=n,this.token=r,this.paginationState=s,this.updatePaginationState=i,this.folderPath=l,this.filePath=u,this.branch=p}static FolderCommitsQueryParams(e,n,r){return{queryKey:["activityLog","folder",n,r],queryFn:async()=>!e||!n?{commits:[],hasMore:!1}:new At(e).getCommits(n,r,Ry,1),enabled:!!e&&!!n}}static FileCommitsQueryParams(e,n,r){return{queryKey:["activityLog","file",n,r],queryFn:async()=>!e||!n?{commits:[],hasMore:!1}:new At(e).getCommits(n,r,Ry,1),enabled:!!e&&!!n}}getFolderCommits(){var r;return[...((r=this.queries.folderCommits.data)==null?void 0:r.commits)??[],...this.paginationState.additionalFolderCommits].map(s=>FM(s,this.users))}getFileCommits(){var r;return[...((r=this.queries.fileCommits.data)==null?void 0:r.commits)??[],...this.paginationState.additionalFileCommits].map(s=>FM(s,this.users))}isFolderLoading(){return this.queries.folderCommits.isLoading}isFileLoading(){return this.queries.fileCommits.isLoading}isFolderFetchingMore(){return this.paginationState.isFolderFetchingMore}isFileFetchingMore(){return this.paginationState.isFileFetchingMore}hasFolderMore(){var e;return this.paginationState.folderPage===1?((e=this.queries.folderCommits.data)==null?void 0:e.hasMore)??!1:this.paginationState.folderHasMore}hasFileMore(){var e;return this.paginationState.filePage===1?((e=this.queries.fileCommits.data)==null?void 0:e.hasMore)??!1:this.paginationState.fileHasMore}getFolderError(){return this.queries.folderCommits.error}getFileError(){return this.queries.fileCommits.error}async fetchMoreFolderCommits(){if(!(!this.token||!this.folderPath)&&!this.paginationState.isFolderFetchingMore){this.updatePaginationState({isFolderFetchingMore:!0});try{const e=new At(this.token),n=this.paginationState.folderPage+1,r=await e.getCommits(this.folderPath,this.branch,Ry,n);this.updatePaginationState({folderPage:n,additionalFolderCommits:[...this.paginationState.additionalFolderCommits,...r.commits],folderHasMore:r.hasMore,isFolderFetchingMore:!1})}catch{this.updatePaginationState({isFolderFetchingMore:!1})}}}async fetchMoreFileCommits(){if(!(!this.token||!this.filePath)&&!this.paginationState.isFileFetchingMore){this.updatePaginationState({isFileFetchingMore:!0});try{const e=new At(this.token),n=this.paginationState.filePage+1,r=await e.getCommits(this.filePath,this.branch,Ry,n);this.updatePaginationState({filePage:n,additionalFileCommits:[...this.paginationState.additionalFileCommits,...r.commits],fileHasMore:r.hasMore,isFileFetchingMore:!1})}catch{this.updatePaginationState({isFileFetchingMore:!1})}}}async getFileContentAtCommit(e,n){if(!this.token)throw new Error("Not authenticated");return new At(this.token).fetchFile(n,e)}}const hP="frelio_activity_log_open";function KQ(){try{return localStorage.getItem(hP)==="true"}catch{return!1}}function QQ(t){try{localStorage.setItem(hP,t?"true":"false")}catch{}}function JQ(){return Fs(t=>({isOpen:KQ(),activeTab:"folder",fileContentDialogSha:null,fileContentDialogPath:null,setOpen:e=>{QQ(e),t({isOpen:e})},setActiveTab:e=>t({activeTab:e}),setFileContentDialog:(e,n)=>t({fileContentDialogSha:e,fileContentDialogPath:n})}))}let o1=null;function YQ(){return o1||(o1=JQ()),o1}let ky=null,BM=null;class XQ{constructor(){St(this,"store",YQ())}getState(){const e=this.store.getState();return BM===e&&ky!==null||(BM=e,ky={isOpen:e.isOpen,activeTab:e.activeTab,fileContentDialogSha:e.fileContentDialogSha,fileContentDialogPath:e.fileContentDialogPath}),ky}subscribe(e){return this.store.subscribe(e)}open(){this.store.getState().setOpen(!0)}close(){this.store.getState().setOpen(!1)}toggle(){const e=this.store.getState().isOpen;this.store.getState().setOpen(!e)}setActiveTab(e){this.store.getState().setActiveTab(e)}openFileContentDialog(e,n){this.store.getState().setFileContentDialog(e,n)}closeFileContentDialog(){this.store.getState().setFileContentDialog(null,null)}}class eJ{constructor(e,n,r){this.repository=e,this.presenter=n,this.paths=r}getState(){var n,r;const e=this.presenter.getState();return{isAvailable:this.paths!==null,isOpen:e.isOpen,activeTab:e.activeTab,folderCommits:this.repository.getFolderCommits(),fileCommits:this.repository.getFileCommits(),isFolderLoading:this.repository.isFolderLoading(),isFileLoading:this.repository.isFileLoading(),isFolderFetchingMore:this.repository.isFolderFetchingMore(),isFileFetchingMore:this.repository.isFileFetchingMore(),hasFolderMore:this.repository.hasFolderMore(),hasFileMore:this.repository.hasFileMore(),folderError:this.repository.getFolderError(),fileError:this.repository.getFileError(),fileTabEnabled:((n=this.paths)==null?void 0:n.filePath)!==null&&((r=this.paths)==null?void 0:r.filePath)!==void 0,paths:this.paths,fileContentDialogSha:e.fileContentDialogSha,fileContentDialogPath:e.fileContentDialogPath}}subscribe(e){return this.presenter.subscribe(e)}open(){this.presenter.open()}close(){this.presenter.close()}toggle(){this.presenter.toggle()}setActiveTab(e){this.presenter.setActiveTab(e)}async loadMoreFolderCommits(){await this.repository.fetchMoreFolderCommits()}async loadMoreFileCommits(){await this.repository.fetchMoreFileCommits()}async getFileContentAtCommit(e){var r;const n=(r=this.paths)==null?void 0:r.filePath;if(!n)throw new Error("File path is not available");return this.repository.getFileContentAtCommit(e,n)}openFileContentDialog(e){var r;const n=(r=this.paths)==null?void 0:r.filePath;n&&this.presenter.openFileContentDialog(e,n)}closeFileContentDialog(){this.presenter.closeFileContentDialog()}}function tJ(t,e,n){if(t.startsWith("/storage")||t.startsWith("/login")||t.startsWith("/auth"))return null;if(t==="/")return{folderPath:Ts.DATA_ROOT,filePath:null};if(/^\/contents\/[^/]+\/?$/.test(t)){const r=e.contentTypeId;return r?{folderPath:`${Ts.CONTENTS_PRIVATE}/${r}`,filePath:null}:null}if(/^\/contents\/[^/]+\/[^/]+$/.test(t)){const{contentTypeId:r,contentId:s}=e;return!r||!s?null:{folderPath:`${Ts.CONTENTS_PRIVATE}/${r}`,filePath:`${Ts.CONTENTS_PRIVATE}/${r}/${s}.json`}}if(t==="/content-types"||t==="/content-types/")return{folderPath:Ts.CONTENT_TYPES,filePath:null};if(/^\/content-types\/[^/]+\/edit$/.test(t)){const r=e.contentTypeId;return r?{folderPath:Ts.CONTENT_TYPES,filePath:`${Ts.CONTENT_TYPES}/${r}.json`}:null}if(/^\/content-types\/[^/]+\/views$/.test(t)){const r=e.contentTypeId;return r?{folderPath:Ts.ADMIN_CONTENT_TYPES,filePath:`${Ts.ADMIN_CONTENT_TYPES}/${r}.views.json`}:null}return t==="/templates"||t==="/templates/"?{folderPath:Ts.TEMPLATES,filePath:n??null}:t==="/build-recipes"||t==="/build-recipes/"?{folderPath:`${Ts.ADMIN_ROOT}/recipes`,filePath:`${Ts.ADMIN_ROOT}/recipes/build-data-recipe.json`}:t==="/users"||t==="/users/"?{folderPath:Ts.ADMIN_USERS,filePath:null}:t==="/staging"||t==="/staging/"?{folderPath:Ts.ADMIN_USERS,filePath:null}:{folderPath:Ts.DATA_ROOT,filePath:null}}const v2=new XQ,nJ=t=>v2.subscribe(t),UM=()=>v2.getState(),rJ="develop",EC=new Map;function sJ(t,e){return`${t??""}|${e??""}`}function VM(t){let e=EC.get(t);return e||(e={folderPage:1,filePage:1,additionalFolderCommits:[],additionalFileCommits:[],folderHasMore:!0,fileHasMore:!0,isFolderFetchingMore:!1,isFileFetchingMore:!1},EC.set(t,e)),e}function iJ(t){const e=ox(),n=uc({strict:!1});return b.useMemo(()=>tJ(e.pathname,n,t),[e.pathname,n,t])}function oJ(t){var j;const{authUseCase:e}=rr(),{branchUseCase:n}=Ei(),{token:r}=e.getState(),s=(n==null?void 0:n.getCurrentBranch())??"develop";b.useSyncExternalStore(nJ,UM,UM);const i=iJ(t),u=((j=jn(uu.AdminDataQueryParams(r,rJ)).data)==null?void 0:j.users)??[],p=sJ((i==null?void 0:i.folderPath)??null,(i==null?void 0:i.filePath)??null),f=b.useRef({key:p,state:VM(p)});f.current.key!==p&&(f.current={key:p,state:VM(p)});const m=b.useRef(0),g=b.useMemo(()=>D=>{const T={...f.current.state,...D};f.current.state=T,EC.set(f.current.key,T),m.current+=1},[]),y=jn(i1.FolderCommitsQueryParams(r,(i==null?void 0:i.folderPath)??null,s)),v=jn(i1.FileCommitsQueryParams(r,(i==null?void 0:i.filePath)??null,s)),C=new i1({folderCommits:y,fileCommits:v},u,r,f.current.state,g,(i==null?void 0:i.folderPath)??null,(i==null?void 0:i.filePath)??null,s);return{activityLogUseCase:new eJ(C,v2,i)}}const aJ=ye([a.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),a.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),lJ=ye(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6m0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20"}),"AccountCircle"),mP=ye(a.jsx("path",{d:"M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3z"}),"AccountTree"),Qn=ye(a.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),cJ=ye(a.jsx("path",{d:"m22 5.72-4.6-3.86-1.29 1.53 4.6 3.86zM7.88 3.39 6.6 1.86 2 5.71l1.29 1.53zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9m0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"}),"Alarm"),uJ=ye(a.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-5h2zm4 0h-2v-3h2zm0-5h-2v-2h2zm4 5h-2V7h2z"}),"Analytics"),dJ=ye(a.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 9h-2V5h2zm0 4h-2v-2h2z"}),"Announcement"),zx=ye(a.jsx("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"}),"ArrowDownward"),pJ=ye(a.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown"),fJ=ye(a.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),x2=ye(a.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward"),km=ye(a.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5 14H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"}),"Article"),gP=ye(a.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),hJ=ye(a.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 11h-3v3.75c0 1.24-1.01 2.25-2.25 2.25S8.5 17.99 8.5 16.75s1.01-2.25 2.25-2.25c.46 0 .89.14 1.25.38V11h4zm-3-4V3.5L18.5 9z"}),"AudioFile"),mJ=ye(a.jsx("path",{d:"m19 1-5 5v11l5-4.5zM1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5V6c-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6m22 13.5V6c-.6-.45-1.25-.75-2-1v13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5v2c1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5z"}),"AutoStories"),gJ=ye(a.jsx("path",{d:"M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 4h5v8l-2.5-1.5L6 12z"}),"Book"),yJ=ye(a.jsx("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2"}),"Bookmark"),b2=ye(a.jsx("path",{d:"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4"}),"Build"),vJ=ye(a.jsx("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"}),"Business"),yP=ye(a.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),xJ=ye([a.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),a.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),a.jsx("path",{d:"M3 13.5h8v8H3z"},"2")],"Category"),bJ=ye(a.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z"}),"Chat"),Ph=ye(a.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),vP=ye(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),xP=ye(a.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),Jl=ye(a.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),SJ=ye(a.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),$x=ye(a.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),CJ=ye(a.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload"),Ti=ye(a.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload"),S2=ye(a.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),wJ=ye(a.jsx("path",{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2m-11-4 2.03 2.71L16 11l4 5H8zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6z"}),"Collections"),jJ=ye(a.jsx("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM18 14H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Comment"),TJ=ye(a.jsx("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8zm-2 8c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m4 8H8v-.57c0-.81.48-1.53 1.22-1.85.85-.37 1.79-.58 2.78-.58s1.93.21 2.78.58c.74.32 1.22 1.04 1.22 1.85z"}),"ContactPage"),bP=ye(a.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),C2=ye(a.jsx("path",{d:"M20 6h-8l-2-2H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-1 8h-3v3h-2v-3h-3v-2h3V9h2v3h3z"}),"CreateNewFolder"),DJ=ye(a.jsx("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"}),"CreditCard"),EJ=ye(a.jsx("path",{d:"M19 7H5c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m0 8H5V9h14z"}),"Crop169"),RJ=ye(a.jsx("path",{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 10H5V8h14z"}),"Crop32"),kJ=ye(a.jsx("path",{d:"M17 3H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H7V5h10z"}),"CropPortrait"),MJ=ye(a.jsx("path",{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 14H6V6h12z"}),"CropSquare"),SP=ye(a.jsx("path",{d:"M3 13h8V3H3zm0 8h8v-6H3zm10 0h8V11h-8zm0-18v6h8V3z"}),"Dashboard"),OJ=ye(a.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"}),"DataArray"),zn=ye(a.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),Tp=ye(a.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description"),AJ=ye(a.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download"),wu=ye(a.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Ri=ye(a.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),_J=ye(a.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"Email"),IJ=ye(a.jsx("path",{d:"M17 12h-5v5h5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1zm3 18H5V8h14z"}),"Event"),Wr=ye(a.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),CP=ye(a.jsx("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11"}),"Extension"),PJ=ye(a.jsx("path",{d:"M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25m6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8"}),"Face"),LJ=ye(a.jsx("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"}),"Favorite"),zJ=ye(a.jsx("path",{d:"M16 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8zM7 7h5v2H7zm10 10H7v-2h10zm0-4H7v-2h10zm-2-4V5l4 4z"}),"Feed"),$J=ye(a.jsx("path",{d:"M15 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V7zM6 20V4h8v4h4v12zm10-10v5c0 2.21-1.79 4-4 4s-4-1.79-4-4V8.5c0-1.47 1.26-2.64 2.76-2.49 1.3.13 2.24 1.32 2.24 2.63V15h-2V8.5c0-.28-.22-.5-.5-.5s-.5.22-.5.5V15c0 1.1.9 2 2 2s2-.9 2-2v-5z"}),"FilePresent"),NJ=ye(a.jsx("path",{d:"M14.4 6 14 4H5v17h2v-7h5.6l.4 2h7V6z"}),"Flag"),ic=ye(a.jsx("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"Folder"),FJ=ye(a.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen"),BJ=ye(a.jsx("path",{d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1m-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1"}),"Forum"),UJ=ye(a.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),Nx=ye(a.jsx("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group"),VJ=ye(a.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9v7c0 1.1.9 2 2 2h4v-8H5v-1c0-3.87 3.13-7 7-7s7 3.13 7 7v1h-4v8h4c1.1 0 2-.9 2-2v-7c0-4.97-4.03-9-9-9"}),"Headphones"),HJ=ye(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help"),WJ=ye(a.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),wP=ye(a.jsx("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"}),"History"),qJ=ye(a.jsx("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home"),GJ=ye(a.jsx("path",{d:"M7 13c1.66 0 3-1.34 3-3S8.66 7 7 7s-3 1.34-3 3 1.34 3 3 3m12-6h-8v7H3V5H1v15h2v-3h18v3h2v-9c0-2.21-1.79-4-4-4"}),"Hotel"),jP=ye(a.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image"),ZJ=ye(a.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4.86 8.86-3 3.87L9 13.14 6 17h12z"}),"ImageOutlined"),KJ=ye(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),vc=ye(a.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),QJ=ye(a.jsx("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-5 12H9v-2h6zm5-7H4V4l16-.02z"}),"Inventory"),w2=ye(a.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),TP=ye(a.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp"),JJ=ye(a.jsx("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"}),"KeyboardReturn"),ch=ye(a.jsx("path",{d:"M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12z"}),"Label"),RC=ye(a.jsx("path",{d:"M20 18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Laptop"),YJ=ye(a.jsx("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-1 9H9V9h10zm-4 4H9v-2h6zm4-8H9V5h10z"}),"LibraryBooks"),j2=ye(a.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),DP=ye(a.jsx("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"}),"List"),XJ=ye(a.jsx("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),eY=ye(a.jsx("path",{d:"M19 3H5c-1.1 0-1.99.9-1.99 2L3 19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-1 11h-4v4h-4v-4H6v-4h4V6h4v4h4z"}),"LocalHospital"),tY=ye(a.jsx("path",{d:"m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42M5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7"}),"LocalOffer"),nY=ye(a.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"LocationOn"),rY=ye(a.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"}),"Lock"),sY=ye(a.jsx("path",{d:"m20.5 3-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5M15 19l-6-2.11V5l6 2.11z"}),"Map"),iY=ye(a.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z"}),"Mic"),EP=ye(a.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),oY=ye(a.jsx("path",{d:"m18 4 2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4z"}),"Movie"),aY=ye(a.jsx("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3z"}),"MusicNote"),lY=ye(a.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),cY=ye(a.jsx("path",{d:"m22 3-1.67 1.67L18.67 3 17 4.67 15.33 3l-1.66 1.67L12 3l-1.67 1.67L8.67 3 7 4.67 5.33 3 3.67 4.67 2 3v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2zM11 19H4v-6h7zm9 0h-7v-2h7zm0-4h-7v-2h7zm0-4H4V8h16z"}),"Newspaper"),uY=ye(a.jsx("path",{d:"M3 18h12v-2H3zM3 6v2h18V6zm0 7h18v-2H3z"}),"Notes"),dY=ye(a.jsx("path",{d:"m20.5 10 .5-2h-4l1-4h-2l-1 4h-4l1-4h-2L9 8H5l-.5 2h4l-1 4h-4L3 16h4l-1 4h2l1-4h4l-1 4h2l1-4h4l.5-2h-4l1-4zm-7 4h-4l1-4h4z"}),"Numbers"),ip=ye(a.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"OpenInNew"),pY=ye(a.jsx("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"}),"Payment"),RP=ye(a.jsx("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"People"),Mm=ye(a.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),fY=ye(a.jsx("path",{d:"M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02z"}),"Phone"),hY=ye([a.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),a.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"PhotoCamera"),Fx=ye(a.jsx("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5zm4-3H19v1h1.5V11H19v2h-1.5V7h3zM9 9.5h1v-1H9zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm10 5.5h1v-3h-1z"}),"PictureAsPdf"),mY=ye(a.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Place"),gY=ye(a.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),yY=ye(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M9.5 16.5v-9l7 4.5z"}),"PlayCircle"),kC=ye(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public"),vY=ye(a.jsx("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt"),kP=ye(a.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),xY=ye(a.jsx("path",{d:"M11 9H9V2H7v7H5V2H3v7c0 2.12 1.66 3.84 3.75 3.97V22h2.5v-9.03C11.34 12.84 13 11.12 13 9V2h-2zm5-3v8h2.5v8H21V2c-2.76 0-5 2.24-5 4"}),"Restaurant"),bY=ye(a.jsx("path",{d:"M12 2.5s4.5 2.04 4.5 10.5c0 2.49-1.04 5.57-1.6 7H9.1c-.56-1.43-1.6-4.51-1.6-7C7.5 4.54 12 2.5 12 2.5m2 8.5c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2m-6.31 9.52c-.48-1.23-1.52-4.17-1.67-6.87l-1.13.75c-.56.38-.89 1-.89 1.67V22zM20 22v-5.93c0-.67-.33-1.29-.89-1.66l-1.13-.75c-.15 2.69-1.2 5.64-1.67 6.87z"}),"Rocket"),na=ye(a.jsx("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save"),SY=ye([a.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),a.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"Schedule"),CY=ye(a.jsx("path",{d:"M14 9v2h-3V9H8.5V7H11V1H4v6h2.5v2H4v6h2.5v2H4v6h7v-6H8.5v-2H11v-2h3v2h7V9z"}),"Schema"),wY=ye(a.jsx("path",{d:"M5 13.18v4L12 21l7-3.82v-4L12 17zM12 3 1 9l11 6 9-4.91V17h2V9z"}),"School"),Om=ye(a.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),Bx=ye(a.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),jY=ye(a.jsx("path",{d:"M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2M1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2"}),"ShoppingCart"),MP=ye(a.jsx("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star"),TY=ye(a.jsx("path",{d:"m22 9.24-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28z"}),"StarBorder"),DY=ye(a.jsx("path",{d:"M20 4H4v2h16zm1 10v-2l-1-5H4l-1 5v2h1v6h10v-6h4v6h2v-6zm-9 4H6v-4h6z"}),"Store"),EY=ye(a.jsx("path",{d:"m21.9 8.89-1.05-4.37c-.22-.9-1-1.52-1.91-1.52H5.05c-.9 0-1.69.63-1.9 1.52L2.1 8.89c-.24 1.02-.02 2.06.62 2.88.08.11.19.19.28.29V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6.94c.09-.09.2-.18.28-.28.64-.82.87-1.87.62-2.89m-2.99-3.9 1.05 4.37c.1.42.01.84-.25 1.17-.14.18-.44.47-.94.47-.61 0-1.14-.49-1.21-1.14L16.98 5zM13 5h1.96l.54 4.52c.05.39-.07.78-.33 1.07-.22.26-.54.41-.95.41-.67 0-1.22-.59-1.22-1.31zM8.49 9.52 9.04 5H11v4.69c0 .72-.55 1.31-1.29 1.31-.34 0-.65-.15-.89-.41-.25-.29-.37-.68-.33-1.07m-4.45-.16L5.05 5h1.97l-.58 4.86c-.08.65-.6 1.14-1.21 1.14-.49 0-.8-.29-.93-.47-.27-.32-.36-.75-.26-1.17M5 19v-6.03c.08.01.15.03.23.03.87 0 1.66-.36 2.24-.95.6.6 1.4.95 2.31.95.87 0 1.65-.36 2.23-.93.59.57 1.39.93 2.29.93.84 0 1.64-.35 2.24-.95.58.59 1.37.95 2.24.95.08 0 .15-.02.23-.03V19z"}),"Storefront"),RY=ye(a.jsx("path",{d:"M16.5 12c1.38 0 2.49-1.12 2.49-2.5S17.88 7 16.5 7 14 8.12 14 9.5s1.12 2.5 2.5 2.5M9 11c1.66 0 2.99-1.34 2.99-3S10.66 5 9 5 6 6.34 6 8s1.34 3 3 3m7.5 3c-1.83 0-5.5.92-5.5 2.75V19h11v-2.25c0-1.83-3.67-2.75-5.5-2.75M9 13c-2.33 0-7 1.17-7 3.5V19h7v-2.25c0-.85.33-2.34 2.37-3.47C10.5 13.1 9.66 13 9 13"}),"SupervisorAccount"),OP=ye(a.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Sync"),T2=ye(a.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),kY=ye(a.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M9 11H7V9h2zm4 0h-2V9h2zm4 0h-2V9h2z"}),"Textsms"),MY=ye(a.jsx("path",{d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V8h14zM7 10h5v5H7z"}),"Today"),OY=ye(a.jsx("path",{d:"M17 7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h10c2.76 0 5-2.24 5-5s-2.24-5-5-5m0 8c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3"}),"ToggleOn"),AY=ye(a.jsx("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"}),"TrendingUp"),_Y=ye(a.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"Tune"),IY=ye(a.jsx("path",{d:"M14 2H6.01c-1.1 0-2 .89-2 2L4 20c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8zm-1 7V3.5L18.5 9zm1 5 2-1.06v4.12L14 16v1c0 .55-.45 1-1 1H9c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h4c.55 0 1 .45 1 1z"}),"VideoFile"),PY=ye(a.jsx("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam"),AP=ye(a.jsx("path",{d:"M3 14h4v-4H3zm0 5h4v-4H3zM3 9h4V5H3zm5 5h13v-4H8zm0 5h13v-4H8zM8 5v4h13V5z"}),"ViewList"),_P=ye(a.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),LY=ye(a.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff"),zY=ye(a.jsx("path",{d:"M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77"}),"VolumeUp"),IP=ye(a.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),$Y=ye(a.jsx("path",{d:"M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-6 0h-4V4h4z"}),"Work");class NY{constructor(e){this.deps=e}getState(){return this.deps.presenter.getState()}isAvailable(){var n,r;return((r=(n=this.deps.authPresenter.getState().currentUser)==null?void 0:n.permissions)==null?void 0:r.canViewUsers)===!0}startSimulation(e,n,r,s){return this.isAvailable()?(this.deps.presenter.startSimulation(e,n,r,s),oe.info("SimulationUseCase.startSimulation",{displayName:r,roleTemplate:n}),!0):(oe.warn("SimulationUseCase.startSimulation: not available"),!1)}stopSimulation(){this.deps.presenter.stopSimulation(),oe.info("SimulationUseCase.stopSimulation")}setTemplate(e){const n=Ih(e);this.deps.presenter.updatePermissions(n,e)}setPermission(e,n){const r=this.deps.presenter.getState();if(!r.virtualPermissions)return;const s={...r.virtualPermissions,[e]:n},i=_h(s);this.deps.presenter.updatePermissions(s,i)}updatePermissions(e){const n=_h(e);this.deps.presenter.updatePermissions(e,n)}getEffectivePermissions(){const e=this.deps.presenter.getState();return e.isActive&&e.virtualPermissions?e.virtualPermissions:this.deps.authPresenter.getState().permissions}getEffectiveRoleTemplate(){const e=this.deps.presenter.getState();return e.isActive&&e.virtualRoleTemplate?e.virtualRoleTemplate:this.deps.authPresenter.getState().roleTemplate}}const FY=t=>Px.subscribe(t),HM=()=>Px.getState();function D2(){return b.useSyncExternalStore(FY,HM,HM),{simulationUseCase:new NY({presenter:Px,authPresenter:Em})}}function PP({open:t,onClose:e,onDiscard:n,onContinue:r,conflicts:s=[],isLoading:i=!1}){const l=ur(),u=async()=>{await n(),e()},p=()=>{r(),e()},f=(m,g)=>{e(),l({to:"/contents/$contentTypeId/$contentId",params:{contentTypeId:m,contentId:g}})};return a.jsxs(Qt,{open:t,onClose:e,maxWidth:"sm",fullWidth:!0,children:[a.jsxs(Yt,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(IP,{color:"warning"}),"コンフリクトが発生しました"]}),a.jsxs(Jt,{children:[a.jsx(zt,{severity:"warning",sx:{mb:2},children:"共有ブランチと個人ブランチで同じファイルが変更されています。"}),s.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs(G,{variant:"subtitle2",gutterBottom:!0,children:["コンフリクトしているコンテンツ (",s.length,"件):"]}),a.jsx(as,{dense:!0,sx:{mb:2,bgcolor:"grey.50",borderRadius:1},children:s.map(m=>a.jsxs(os,{onClick:()=>f(m.contentTypeId,m.contentId),children:[a.jsx(Un,{children:a.jsx(Tp,{fontSize:"small"})}),a.jsx(Zn,{primary:m.contentId,secondary:`${m.contentTypeId}`})]},m.path))}),a.jsx(wo,{sx:{my:2}})]}),a.jsx(G,{variant:"body1",gutterBottom:!0,children:"以下のいずれかを選択してください:"}),a.jsxs(B,{sx:{mt:2},children:[a.jsx(G,{variant:"subtitle2",color:"error.main",gutterBottom:!0,children:"コンフリクトを破棄"}),a.jsx(G,{variant:"body2",color:"text.secondary",sx:{ml:2,mb:2},children:s.length>0?`上記 ${s.length} 件のコンテンツのみ共有ブランチの内容で上書きします。他の変更は保持されます。`:"個人ブランチの変更を破棄し、共有ブランチの内容で上書きします。"}),a.jsx(G,{variant:"subtitle2",color:"info.main",gutterBottom:!0,children:"このまま作業を続ける"}),a.jsx(G,{variant:"body2",color:"text.secondary",sx:{ml:2},children:"コンフリクトを無視して編集を続けます。 後で「共有ブランチに送る」際に再度コンフリクトを解消する必要があります。"})]})]}),a.jsxs(rn,{sx:{px:3,pb:2},children:[a.jsx(pe,{onClick:p,disabled:i,children:"このまま作業を続ける"}),a.jsx(pe,{onClick:u,color:"error",variant:"contained",disabled:i,startIcon:i?a.jsx(ut,{size:16}):void 0,children:s.length>0?"コンフリクトを破棄":"破棄して共有ブランチに戻す"})]})]})}const Ux=t=>Rm.subscribe(t),oc=()=>Rm.getState();function BY({branchUseCase:t}){const[e,n]=b.useState(null);b.useSyncExternalStore(Ux,oc,oc);const r=t.getState(),s=f=>{n(f.currentTarget)},i=()=>{n(null)},l=async()=>{i(),await t.switchToDevelop(),window.location.reload()},u=async()=>{i(),await t.switchToPersonal(),window.location.reload()},p=r.branchType==="develop";return a.jsxs(B,{children:[a.jsx(pe,{variant:"outlined",size:"small",color:p?"info":"success",onClick:s,startIcon:r.isLoading?a.jsx(ut,{size:16}):a.jsx(mP,{}),endIcon:a.jsx(w2,{}),disabled:r.isLoading,sx:{textTransform:"none"},children:p?"共有ブランチ":"個人ブランチ"}),a.jsxs(Cp,{anchorEl:e,open:!!e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:[a.jsxs(nt,{onClick:l,children:[a.jsx(Un,{children:p?a.jsx(Ph,{fontSize:"small"}):a.jsx(Nx,{fontSize:"small"})}),a.jsx(Zn,{primary:"共有ブランチ",secondary:r.developBranchName})]}),a.jsxs(nt,{onClick:u,children:[a.jsx(Un,{children:p?a.jsx(Mm,{fontSize:"small"}):a.jsx(Ph,{fontSize:"small"})}),a.jsx(Zn,{primary:"個人ブランチ",secondary:r.personalBranchName})]})]})]})}function UY({branchUseCase:t,onClick:e}){b.useSyncExternalStore(Ux,oc,oc);const n=t.getState(),r=n.branchType==="develop",s=n.isSyncing?a.jsx(ut,{size:16,color:"inherit"}):r?a.jsx(Nx,{}):a.jsx(Mm,{}),i=a.jsx(Ht,{icon:s,label:r?"共有":"個人",size:"small",color:r?"info":"success",variant:"outlined",onClick:e,sx:{mr:1,cursor:e?"pointer":"default"}});if(n.isSyncing)return a.jsx(Er,{title:"GitHub と同期中...",arrow:!0,children:a.jsx(xv,{badgeContent:n.diffCount,color:"warning",max:99,invisible:!n.hasDiff,children:i})});if(!r&&n.hasDiff)return a.jsx(Er,{title:`共有ブランチより ${n.diffCount} コミット進んでいます`,arrow:!0,children:a.jsx(xv,{badgeContent:n.diffCount,color:"warning",max:99,children:i})});const l=r?"共有ブランチで作業中":"個人ブランチで作業中";return a.jsx(Er,{title:l,arrow:!0,children:i})}function VY({branchUseCase:t}){const[e,n]=b.useState(!1),r=b.useSyncExternalStore(Ux,oc,oc);if(r.branchType==="develop"||!r.hasDiff&&r.behindCount===0)return null;const s=async()=>{await t.rebaseFromDevelop()&&n(!0)},i=async()=>{r.conflicts.length>0?await t.discardConflictingFiles():await t.discardPersonalChanges()},l=()=>{t.getState()};return r.behindCount>0?a.jsxs(a.Fragment,{children:[a.jsxs(zt,{severity:"warning",icon:a.jsx(OP,{}),action:a.jsx(pe,{color:"inherit",size:"small",onClick:s,disabled:r.isLoading,children:"最新を取り込む"}),sx:{mb:2},children:[a.jsxs(bI,{children:["共有ブランチが ",r.behindCount," コミット先に進んでいます"]}),r.hasDiff?`個人ブランチは ${r.diffCount} コミット進んでいます。「最新を取り込む」で共有ブランチの変更を反映できます。反映には数分かかることがあります。`:"「最新を取り込む」で共有ブランチの変更を反映できます。反映には数分かかることがあります。"]}),a.jsx(PP,{open:e,onClose:()=>n(!1),onDiscard:i,onContinue:l,conflicts:r.conflicts,isLoading:r.isLoading})]}):a.jsx(HY,{branchUseCase:t})}function HY({branchUseCase:t}){const e=ur(),[n,r]=b.useState(!1),[s,i]=b.useState(!1),[l,u]=b.useState(!1),p=b.useSyncExternalStore(Ux,oc,oc),f=async()=>{await t.fetchChangedContents(),r(!0)},m=()=>{r(!1)},g=(D,M)=>{r(!1),e({to:"/contents/$contentTypeId/$contentId",params:{contentTypeId:D,contentId:M}})},y=async()=>{i(!1),(await t.mergeToDevelop()).hasConflict&&u(!0)},v=async()=>{await t.discardConflictingFiles(),u(!1)},C=()=>{u(!1)},S=D=>{switch(D){case"added":return a.jsx(Qn,{color:"success",fontSize:"small"});case"modified":return a.jsx(Ri,{color:"info",fontSize:"small"});case"removed":return a.jsx(zn,{color:"error",fontSize:"small"})}},j=D=>{switch(D){case"added":return"追加";case"modified":return"変更";case"removed":return"削除"}};return a.jsxs(a.Fragment,{children:[a.jsxs(zt,{severity:"info",icon:a.jsx(OP,{}),sx:{mb:2},children:[a.jsx(bI,{children:"共有ブランチに反映されていない変更があります"}),a.jsx(B,{sx:{mb:1},children:"個人ブランチで作業中です。完了したら「共有ブランチに反映」で変更を反映してください。反映には数分かかることがあります。"}),a.jsxs(B,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:[a.jsx(pe,{color:"inherit",size:"small",onClick:f,disabled:p.isLoading,startIcon:a.jsx(Om,{}),variant:"outlined",children:"変更を確認"}),a.jsx(pe,{color:"primary",size:"small",onClick:()=>i(!0),disabled:p.isLoading,variant:"contained",children:"共有ブランチに反映"})]})]}),a.jsx(WY,{open:n,onClose:m,contents:p.changedContents,isLoading:p.isLoading,onNavigate:g,getStatusIcon:S,getStatusLabel:j}),a.jsxs(Qt,{open:s,onClose:()=>i(!1),children:[a.jsx(Yt,{children:"共有ブランチに反映"}),a.jsx(Jt,{children:a.jsxs(B,{sx:{py:1},children:["個人ブランチの変更を共有ブランチに反映しますか?",a.jsx("br",{}),"チームメンバー全員がこの変更を確認できるようになります。"]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>i(!1),disabled:p.isLoading,children:"キャンセル"}),a.jsx(pe,{onClick:y,color:"primary",variant:"contained",disabled:p.isLoading,startIcon:p.isLoading?a.jsx(ut,{size:16}):void 0,children:"反映する"})]})]}),a.jsx(PP,{open:l,onClose:()=>u(!1),onDiscard:v,onContinue:C,conflicts:p.conflicts,isLoading:p.isLoading})]})}function WY({open:t,onClose:e,contents:n,isLoading:r,onNavigate:s,getStatusIcon:i,getStatusLabel:l}){return a.jsxs(Qt,{open:t,onClose:e,maxWidth:"sm",fullWidth:!0,children:[a.jsx(Yt,{children:"変更されたコンテンツ"}),a.jsx(Jt,{children:r?a.jsx(B,{sx:{display:"flex",justifyContent:"center",py:4},children:a.jsx(ut,{})}):n.length===0?a.jsx(B,{sx:{py:2,textAlign:"center",color:"text.secondary"},children:"変更されたコンテンツはありません"}):a.jsxs(a.Fragment,{children:[a.jsxs(B,{sx:{mb:1,color:"text.secondary",fontSize:"0.875rem"},children:[n.length,"件の変更があります"]}),a.jsx(as,{children:n.map(u=>a.jsxs(os,{onClick:()=>s(u.contentTypeId,u.contentId),children:[a.jsx(Un,{children:i(u.status)}),a.jsx(Zn,{primary:u.contentId,secondary:`${u.contentTypeId} / ${u.basePath==="private"?"下書き":"公開済み"} (${l(u.status)})`})]},`${u.basePath}/${u.contentTypeId}/${u.contentId}`))})]})})]})}const qY="/admin/assets/logo-DRV9kVVU.png",WM="develop";function qM(t){switch(t){case"owner":case"admin":return"error";case"developer":return"warning";case"editor":return"primary";case"viewer":return"default";case"custom":default:return"success"}}function GY(){const t=ta().siteTitle,e=ta().productionUrl,{authUseCase:n}=rr(),{branchUseCase:r}=Ei(),{simulationUseCase:s}=D2(),{githubUser:i,currentUser:l,token:u,roleTemplate:p,allowPersonalBranch:f}=n.getState(),m=s.getState(),g=r==null?void 0:r.getState(),y=ur(),v=ys(),[C,S]=b.useState(null),[j,D]=b.useState(!1),[M,T]=b.useState(!1),[E,k]=b.useState(!1),[A,O]=b.useState(""),[I,$]=b.useState("success"),R=jn(uu.AdminDataQueryParams(u,WM)),P=Pn(uu.SaveAdminDataMutationParams(v,u,WM)),z=te=>{S(te.currentTarget)},N=()=>{S(null)},H=()=>{N(),n.logout(),y({to:"/login"})},U=async()=>{N(),await(r==null?void 0:r.switchToDevelop())},L=async()=>{N(),await(r==null?void 0:r.switchToPersonal())},W=()=>{N(),s.stopSimulation()},K=()=>{N(),D(!0)},Q=()=>{D(!1)},le=()=>{N(),T(!0)},F=()=>{T(!1)},J=async()=>{const te=m;if(!te.isActive||!te.virtualPermissions||!te.simulatedGithubUsername){O("シミュレーションがアクティブではありません"),$("error"),k(!0),T(!1);return}const de=R.data;if(!de){O("ユーザーデータを取得できませんでした"),$("error"),k(!0),T(!1);return}const fe=de.users.find(we=>we.githubUsername===te.simulatedGithubUsername);if(!fe){O("対象ユーザーが見つかりません"),$("error"),k(!0),T(!1);return}const Re={...fe,permissions:te.virtualPermissions},Pe=de.users.map(we=>we.githubUsername===te.simulatedGithubUsername?Re:we),$e={...de,users:Pe};try{await P.mutateAsync($e),O("ユーザー設定に反映しました"),$("success")}catch{O("反映に失敗しました"),$("error")}k(!0),T(!1)};if(!i||!l)return null;const ie=(g==null?void 0:g.branchType)==="develop";return a.jsxs(nV,{"data-component-name":"cmp:AppBar",position:"static",color:"default",elevation:1,sx:{bgcolor:"white"},children:[a.jsxs(iK,{children:[a.jsx(ft,{component:gs,to:"/",sx:{mr:1,p:.5},children:a.jsx("img",{src:qY,alt:"ダッシュボード",style:{width:32,height:32}})}),t?a.jsxs(B,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"baseline"},gap:{xs:0,sm:1}},children:[a.jsx(G,{variant:"h6",sx:{lineHeight:1.2},children:t}),e&&a.jsxs(G,{variant:"body2",component:"a",href:e,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.secondary",textDecoration:"none","&:hover":{textDecoration:"underline"},lineHeight:1.2},children:[a.jsx(B,{component:"span",sx:{display:{xs:"none",sm:"inline"}},children:"- "}),e]})]}):a.jsx(G,{variant:"h6",children:"Frelio CMS"}),a.jsx(B,{sx:{flexGrow:1}}),r&&f&&a.jsx(UY,{branchUseCase:r,onClick:z}),a.jsx(ft,{"data-testid":"avatar-menu-button",onClick:z,sx:{p:0},children:a.jsx(o7,{src:i.avatar_url,alt:i.login,sx:{width:32,height:32}})}),a.jsxs(Cp,{anchorEl:C,open:!!C,onClose:N,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[a.jsxs(B,{sx:{px:3,py:1.5},children:[a.jsx(G,{variant:"body1",fontWeight:"bold",children:l.displayName||i.name||i.login}),a.jsxs(G,{variant:"body2",color:"text.secondary",children:["@",i.login]}),p&&a.jsx(Ht,{label:Tv(p),color:qM(p),size:"small",sx:{mt:1}})]}),a.jsx(wo,{}),f&&[a.jsxs(nt,{onClick:U,children:[a.jsx(Un,{children:ie?a.jsx(Ph,{fontSize:"small"}):a.jsx(Nx,{fontSize:"small"})}),a.jsx(Zn,{primary:"共有ブランチ",secondary:g==null?void 0:g.developBranchName})]},"develop"),a.jsxs(nt,{onClick:L,children:[a.jsx(Un,{children:ie?a.jsx(Mm,{fontSize:"small"}):a.jsx(Ph,{fontSize:"small"})}),a.jsx(Zn,{primary:"個人ブランチ",secondary:g==null?void 0:g.personalBranchName})]},"personal"),a.jsx(wo,{},"divider")],a.jsx(nt,{onClick:H,children:"ログアウト"}),m.isActive&&[a.jsx(wo,{},"sim-divider"),a.jsxs(B,{sx:{px:3,py:1.5,bgcolor:"warning.light"},children:[a.jsx(G,{variant:"caption",color:"warning.dark",fontWeight:"bold",children:"UI再現モード"}),a.jsx(G,{variant:"body2",fontWeight:"bold",children:m.simulatedUserDisplayName}),a.jsx(Ht,{label:m.virtualRoleTemplate?Tv(m.virtualRoleTemplate):"",color:m.virtualRoleTemplate?qM(m.virtualRoleTemplate):"default",size:"small",sx:{mt:.5}})]},"sim-info"),a.jsxs(nt,{onClick:K,sx:{color:"warning.main"},children:[a.jsx(Un,{sx:{color:"warning.main"},children:a.jsx(Ri,{fontSize:"small"})}),a.jsx(Zn,{primary:"権限を編集"})]},"sim-edit"),a.jsxs(nt,{onClick:le,sx:{color:"warning.main"},children:[a.jsx(Un,{sx:{color:"warning.main"},children:a.jsx(na,{fontSize:"small"})}),a.jsx(Zn,{primary:"ユーザーに反映"})]},"sim-apply"),a.jsxs(nt,{onClick:W,sx:{color:"warning.main"},children:[a.jsx(Un,{sx:{color:"warning.main"},children:a.jsx($x,{fontSize:"small"})}),a.jsx(Zn,{primary:"UI再現を終了"})]},"sim-stop")]]})]}),a.jsx(ZY,{open:j,onClose:Q,simulationUseCase:s}),a.jsxs(Qt,{"data-component-name":"cmp:ApplyToUserDialog",open:M,onClose:F,children:[a.jsx(Yt,{children:"ユーザーに反映"}),a.jsxs(Jt,{children:[a.jsxs(G,{children:["シミュレーション中の権限を「",m.simulatedUserDisplayName,"」に反映しますか?"]}),a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"この操作は実際のユーザー設定を更新します。"})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:F,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:J,children:"反映"})]})]}),a.jsx(ea,{open:E,autoHideDuration:4e3,onClose:()=>k(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{onClose:()=>k(!1),severity:I,sx:{width:"100%"},children:A})})]})}function ZY({open:t,onClose:e,simulationUseCase:n}){const r=n.getState(),s=r.virtualPermissions,i=r.virtualRoleTemplate;if(!s||!i)return null;const l=p=>{n.setTemplate(p)},u=(p,f)=>{if(n.setPermission(p,f),f){const m=Sv.find(g=>g.edit===p);m&&n.setPermission(m.view,!0)}if(!f){const m=Sv.find(g=>g.view===p);m&&n.setPermission(m.edit,!1)}};return a.jsxs(Qt,{"data-component-name":"cmp:SimulationEditDialog",open:t,onClose:e,maxWidth:"sm",fullWidth:!0,children:[a.jsx(Yt,{children:"権限を編集"}),a.jsx(Jt,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[a.jsxs(_n,{fullWidth:!0,children:[a.jsx(nr,{children:"ロール"}),a.jsxs(wn,{value:i,label:"ロール",onChange:p=>l(p.target.value),children:[a.jsx(nt,{value:"admin",children:"管理者"}),a.jsx(nt,{value:"developer",children:"開発者"}),a.jsx(nt,{value:"editor",children:"編集者"}),a.jsx(nt,{value:"viewer",children:"閲覧者"}),a.jsx(nt,{value:"custom",children:"カスタム"})]})]}),a.jsxs(_s,{defaultExpanded:i==="custom",sx:{boxShadow:"none",border:1,borderColor:"divider","&:before":{display:"none"}},children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsx(G,{children:"権限の詳細"})}),a.jsx(Is,{sx:{pt:0},children:a.jsx(Ro,{spacing:2,children:Object.entries(uP).map(([p,f])=>a.jsxs(B,{children:[a.jsx(G,{variant:"subtitle2",color:"text.secondary",sx:{mb:.5},children:f.label}),a.jsx(B,{sx:{display:"flex",flexDirection:"column",ml:1,gap:.5},children:f.pairs.map(m=>a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(G,{variant:"body2",sx:{minWidth:100},children:dP[m.view]}),a.jsx(_r,{control:a.jsx(es,{checked:s[m.view],onChange:g=>u(m.view,g.target.checked),size:"small"}),label:"閲覧",sx:{mr:0}}),a.jsx(_r,{control:a.jsx(es,{checked:s[m.edit],onChange:g=>u(m.edit,g.target.checked),size:"small"}),label:"編集",sx:{mr:0}})]},m.view))})]},p))})})]})]})}),a.jsx(rn,{children:a.jsx(pe,{onClick:e,children:"閉じる"})})]})}function GM(){const{open:t,message:e,severity:n}=b.useSyncExternalStore(Pd.subscribe,Pd.getSnapshot),r=(s,i)=>{i!=="clickaway"&&Pd.dismiss()};return a.jsx(ea,{"data-component-name":"cmp:GlobalSnackbar",open:t,onClose:r,autoHideDuration:n==="error"?null:6e3,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{onClose:r,severity:n,variant:"filled",sx:{whiteSpace:"pre-line",maxWidth:600},children:e})})}function KY({useCase:t}){const{activeTab:e,fileTabEnabled:n}=t.getState(),r=(i,l)=>{t.setActiveTab(l)},s=()=>{t.close()};return a.jsxs(B,{"data-component-name":"cmp:ActivityLogHeader",sx:{borderBottom:1,borderColor:"divider"},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1},children:[a.jsx(G,{variant:"subtitle2",fontWeight:"bold",children:"アクティビティログ"}),a.jsx(Er,{title:"閉じる",children:a.jsx(ft,{size:"small",onClick:s,children:a.jsx(Jl,{fontSize:"small"})})})]}),a.jsxs(_K,{value:e,onChange:r,variant:"fullWidth",sx:{minHeight:36,"& .MuiTab-root":{minHeight:36,py:.5,fontSize:"0.75rem"}},children:[a.jsx(hM,{value:"folder",label:"フォルダ",icon:a.jsx(ic,{sx:{fontSize:16}}),iconPosition:"start",sx:{minHeight:36}}),a.jsx(hM,{value:"file",label:"ファイル",icon:a.jsx(vc,{sx:{fontSize:16}}),iconPosition:"start",disabled:!n,sx:{minHeight:36}})]})]})}function QY(t){const n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),s=Math.floor(r/60),i=Math.floor(s/60),l=Math.floor(i/24);return l>0?`${l}日前`:i>0?`${i}時間前`:s>0?`${s}分前`:"今"}function JY({commit:t,showViewButton:e,onViewContent:n}){const r=()=>{n==null||n(t.sha)},s=t.message.split(`
|
|
386
|
+
`)[0];return a.jsxs(B,{"data-component-name":"cmp:ActivityLogItem",sx:{px:2,py:1.5,borderBottom:1,borderColor:"divider","&:hover":{bgcolor:"action.hover"}},children:[a.jsx(G,{variant:"body2",sx:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",mb:.5},title:s,children:s}),a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(Ht,{label:t.authorDisplayName,size:"small",sx:{height:20,fontSize:"0.7rem","& .MuiChip-label":{px:1}}}),a.jsx(G,{variant:"caption",color:"text.secondary",children:QY(t.date)}),a.jsx(G,{variant:"caption",color:"text.disabled",sx:{ml:"auto"},children:t.shortSha}),e&&a.jsx(Er,{title:"この時点のファイルを表示",children:a.jsx(ft,{size:"small",onClick:r,sx:{ml:.5},children:a.jsx(_P,{sx:{fontSize:16}})})})]})]})}function ZM({commits:t,isLoading:e,isFetchingMore:n,hasMore:r,error:s,showViewButton:i,onLoadMore:l,onViewContent:u}){return e?a.jsx(B,{"data-component-name":"cmp:ActivityLogList",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",p:3},children:a.jsx(ut,{size:24})}):s?a.jsx(B,{"data-component-name":"cmp:ActivityLogList",sx:{flex:1,p:2},children:a.jsx(zt,{severity:"error",sx:{fontSize:"0.75rem"},children:s.message})}):t.length===0?a.jsx(B,{"data-component-name":"cmp:ActivityLogList",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",p:3},children:a.jsx(G,{variant:"body2",color:"text.secondary",children:"履歴がありません"})}):a.jsxs(B,{"data-component-name":"cmp:ActivityLogList",sx:{flex:1,overflow:"auto"},children:[t.map(p=>a.jsx(JY,{commit:p,showViewButton:i,onViewContent:u},p.sha)),r&&a.jsx(B,{sx:{p:2,textAlign:"center"},children:a.jsx(pe,{variant:"text",size:"small",onClick:l,disabled:n,startIcon:n?a.jsx(ut,{size:14}):null,children:n?"読み込み中...":"もっと読み込む"})})]})}function KM({useCase:t}){const{fileContentDialogSha:e,fileContentDialogPath:n}=t.getState(),r=e!==null&&n!==null,[s,i]=b.useState(null),[l,u]=b.useState(!1),[p,f]=b.useState(null),[m,g]=b.useState(!1);b.useEffect(()=>{if(!r||!e){i(null),f(null);return}u(!0),f(null),i(null),t.getFileContentAtCommit(e).then(i).catch(f).finally(()=>u(!1))},[r,e,t]);const y=()=>{t.closeFileContentDialog()},v=async()=>{if(s)try{await navigator.clipboard.writeText(s),g(!0),setTimeout(()=>g(!1),2e3)}catch{}},C=(n==null?void 0:n.split("/").pop())??"ファイル",S=(e==null?void 0:e.slice(0,7))??"";return a.jsxs(Qt,{"data-component-name":"cmp:FileContentDialog",open:r,onClose:y,maxWidth:"md",fullWidth:!0,children:[a.jsxs(Yt,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsxs(G,{variant:"h6",component:"span",sx:{flex:1},children:[C,a.jsxs(G,{variant:"caption",color:"text.secondary",sx:{ml:1},children:["@ ",S]})]}),a.jsx(ft,{size:"small",onClick:y,children:a.jsx($x,{})})]}),a.jsxs(Jt,{dividers:!0,children:[l&&a.jsx(B,{sx:{display:"flex",justifyContent:"center",p:4},children:a.jsx(ut,{})}),p&&a.jsxs(zt,{severity:"error",children:["ファイルの読み込みに失敗しました: ",p.message]}),s!==null&&!l&&!p&&a.jsx(B,{component:"pre",sx:{m:0,p:2,bgcolor:"grey.100",borderRadius:1,overflow:"auto",fontSize:"0.8rem",fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:"60vh"},children:s})]}),a.jsxs(rn,{children:[a.jsx(pe,{startIcon:a.jsx(bP,{}),onClick:v,disabled:!s||l,children:m?"コピーしました":"コピー"}),a.jsx(pe,{onClick:y,children:"閉じる"})]})]})}const a1=320;function QM({useCase:t}){const e=t.getState(),{activeTab:n,folderCommits:r,fileCommits:s,isFolderLoading:i,isFileLoading:l,isFolderFetchingMore:u,isFileFetchingMore:p,hasFolderMore:f,hasFileMore:m,folderError:g,fileError:y,fileTabEnabled:v}=e,C=()=>{t.loadMoreFolderCommits()},S=()=>{t.loadMoreFileCommits()},j=D=>{t.openFileContentDialog(D)};return a.jsxs(a.Fragment,{children:[a.jsx(KY,{useCase:t}),n==="folder"&&a.jsx(ZM,{commits:r,isLoading:i,isFetchingMore:u,hasMore:f,error:g,showViewButton:!1,onLoadMore:C}),n==="file"&&v&&a.jsx(ZM,{commits:s,isLoading:l,isFetchingMore:p,hasMore:m,error:y,showViewButton:!0,onLoadMore:S,onViewContent:j})]})}function YY(){const t=new URL(window.location.href);return t.searchParams.delete("activity_log"),t.pathname+t.search+t.hash}function XY({useCase:t}){const e=vr(),n=aa(e.breakpoints.down("md")),r=ox(),s=Ns(),{isOpen:i}=t.getState(),u=new URLSearchParams(r.searchStr).get("activity_log")==="1",p=n?u:i,f=b.useRef(u);b.useEffect(()=>{n&&f.current!==u&&(u&&!i?t.open():!u&&i&&t.close(),f.current=u)},[n,u,i,t]);const m=()=>{if(n){const g=YY();s.history.push(g)}t.close()};return n?a.jsxs(a.Fragment,{children:[a.jsx(Cu,{"data-component-name":"cmp:ActivityLogPanel",anchor:"right",open:p,onClose:m,PaperProps:{sx:{width:a1,maxWidth:"100vw"}},children:a.jsx(B,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:a.jsx(QM,{useCase:t})})}),a.jsx(KM,{useCase:t})]}):a.jsxs(a.Fragment,{children:[a.jsx(B,{"data-component-name":"cmp:ActivityLogPanel",sx:{width:p?a1:0,minWidth:p?a1:0,height:"100%",overflow:"hidden",transition:"width 0.2s ease-in-out, min-width 0.2s ease-in-out",borderLeft:p?1:0,borderColor:"divider",bgcolor:"background.paper",display:"flex",flexDirection:"column"},children:p&&a.jsx(QM,{useCase:t})}),a.jsx(KM,{useCase:t})]})}function eX(){const t=new URL(window.location.href);return t.searchParams.set("activity_log","1"),t.pathname+t.search+t.hash}function tX(){const t=new URL(window.location.href);return t.searchParams.delete("activity_log"),t.pathname+t.search+t.hash}function nX({useCase:t}){const e=vr(),n=aa(e.breakpoints.down("md")),r=ox(),s=Ns(),{isOpen:i}=t.getState(),u=new URLSearchParams(r.searchStr).get("activity_log")==="1",p=n?u:i,f=()=>{n?p?(s.history.push(tX()),t.close()):(s.history.push(eX()),t.open()):t.toggle()};return a.jsx(Er,{title:p?"アクティビティログを閉じる":"アクティビティログを開く",placement:"left",children:a.jsx(CW,{"data-component-name":"cmp:ActivityLogToggleButton",size:"small",color:"default",onClick:f,sx:{position:"fixed",bottom:24,right:24,zIndex:m=>m.zIndex.speedDial,bgcolor:"background.paper",boxShadow:2,"&:hover":{bgcolor:"action.hover"}},children:p?a.jsx(Jl,{}):a.jsx(wP,{})})})}const Bs=z$({component:rX});function rX(){const{authUseCase:t}=rr(),{githubUser:e,currentUser:n,isInitialized:r}=t.getState(),s=ur(),i=ox();return b.useEffect(()=>{if(!r)return;const u=i.pathname==="/login",p=i.pathname.startsWith("/auth/callback");if(!e&&!u&&!p){s({to:"/login"});return}if(e&&n&&u){s({to:"/"});return}if(n){const f=gQ(i.pathname);f&&!ws(n,f)&&s({to:"/"})}},[r,e,n,s,i.pathname]),r?i.pathname==="/login"||i.pathname.startsWith("/auth/")?a.jsxs(a.Fragment,{children:[a.jsx(bw,{}),a.jsx(GM,{})]}):a.jsxs(a.Fragment,{children:[a.jsx(sX,{}),a.jsx(GM,{})]}):a.jsx(B,{"data-component-name":"cmp:RootLayoutLoading",display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",children:a.jsx(ut,{})})}function sX(){const{activityLogUseCase:t}=oJ(),{isAvailable:e}=t.getState();return a.jsxs(B,{"data-component-name":"cmp:RootLayout",sx:{display:"flex",flexDirection:"column",height:"100vh"},children:[a.jsx(B,{"data-component-name":"cmp:RootLayoutHeader",component:"header",sx:{position:"sticky",top:0,zIndex:n=>n.zIndex.appBar,flexShrink:0},children:a.jsx(GY,{})}),a.jsxs(B,{"data-component-name":"cmp:RootLayoutBody",sx:{flex:1,overflow:"hidden",display:"flex",flexDirection:"row"},children:[a.jsx(B,{"data-component-name":"cmp:RootLayoutMain",component:"main",sx:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:a.jsx(bw,{})}),e&&a.jsx(XY,{useCase:t})]}),e&&a.jsx(nX,{useCase:t})]})}const iX=Ss("/login")({component:oX});function oX(){const{authUseCase:t}=rr(),{githubUser:e}=t.getState();if(e)return null;const n=()=>{oe.debug("LoginPage","Login button clicked");try{const r=t.getAuthUrl();oe.debug("LoginPage","Redirecting to auth URL"),window.location.href=r}catch(r){oe.error("LoginPage","Error getting auth URL",{error:r})}};return a.jsx(ji,{"data-component-name":"cmp:LoginPage",maxWidth:"sm",children:a.jsx(B,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",children:a.jsxs($t,{"data-component-name":"cmp:LoginForm",elevation:3,sx:{p:4,textAlign:"center",width:"100%"},children:[a.jsx(G,{variant:"h4",component:"h1",gutterBottom:!0,children:"Frelio CMS"}),a.jsx(G,{variant:"body1",color:"text.secondary",sx:{mb:4},children:"GitHub アカウントでログインしてください"}),a.jsx(pe,{variant:"contained",size:"large",startIcon:a.jsx(UJ,{}),onClick:n,sx:{textTransform:"none"},children:"Login with GitHub"})]})})})}const aX={contentTypes:{}};class Pf{constructor(e,n,r,s){this.queryResult=e,this.mergeStagingMutation=n,this.mergeProductionMutation=r,this.directDeployMutation=s}static QueryParams(e,n,r,s){return{queryKey:["dashboard",n,r,s],queryFn:async()=>{if(!e)return{contentTypes:[],metadata:null,branchLastCommit:{develop:null,staging:null,production:null},branchComparisons:{}};const i=new At(e),u=(await i.fetchJsonOrDefault(Bc,{contentTypes:[]},n)).contentTypes,p=await i.fetchJsonOrDefault(kh,aX,n),f={develop:null,staging:null,production:null};try{const g=await i.getLatestCommitForPath("develop",Qi);g&&(f.develop=g.date)}catch{oe.debug("GitHubDashboardRepositoryImpl.QueryParams: failed to get develop branch info")}try{const g=await i.getLatestCommitForPath("staging",Qi);g&&(f.staging=g.date)}catch{oe.debug("GitHubDashboardRepositoryImpl.QueryParams: failed to get staging branch info")}try{const g=await i.getLatestCommitForPath("main",Qi);g&&(f.production=g.date)}catch{oe.debug("GitHubDashboardRepositoryImpl.QueryParams: failed to get main branch info")}const m={};if(r&&s&&s.length>0)for(const g of s)try{const y=await i.compareBranches(g,r),v=y.files.filter(C=>C.filename.startsWith(Qi));m[g]={ahead:v.length>0?y.ahead:0,behind:y.behind}}catch{oe.debug("GitHubDashboardRepositoryImpl.QueryParams: failed to compare branches",{stagingBranch:g,personalBranchName:r})}return{contentTypes:u,metadata:p,branchLastCommit:f,branchComparisons:m}},enabled:!!e,staleTime:0}}static MergeStagingMutationParams(e,n){return{mutationFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).mergeBranches("staging","develop","Merge develop into staging")},onSuccess:()=>{n.invalidateQueries({queryKey:["dashboard"]})}}}static MergeProductionMutationParams(e,n){return{mutationFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).mergeBranches("main","staging","Merge staging into main")},onSuccess:()=>{n.invalidateQueries({queryKey:["dashboard"]})}}}static DirectDeployMutationParams(e,n){return{mutationFn:async()=>{if(!e)throw new Error("Not authenticated");await new At(e).triggerWorkflow("direct-deploy.yml","main")},onSuccess:()=>{n.invalidateQueries({queryKey:["dashboard"]})}}}getContentTypes(){var e;return((e=this.queryResult.data)==null?void 0:e.contentTypes)??[]}isLoading(){return this.queryResult.isLoading}getLastUpdated(){var r;const e=(r=this.queryResult.data)==null?void 0:r.metadata;if(!(e!=null&&e.contentTypes))return null;const n=Object.values(e.contentTypes).map(s=>s.lastUpdatedAt).filter(s=>!!s).map(s=>new Date(s));return n.length===0?null:new Date(Math.max(...n.map(s=>s.getTime())))}getContentTypeMetadata(e){var n,r;return((r=(n=this.queryResult.data)==null?void 0:n.metadata)==null?void 0:r.contentTypes[e])??null}getMetadata(){var e;return((e=this.queryResult.data)==null?void 0:e.metadata)??null}getStagingLastCommit(){var e,n;return((n=(e=this.queryResult.data)==null?void 0:e.branchLastCommit)==null?void 0:n.staging)??null}getProductionLastCommit(){var e,n;return((n=(e=this.queryResult.data)==null?void 0:e.branchLastCommit)==null?void 0:n.production)??null}getDevelopLastCommit(){var e,n;return((n=(e=this.queryResult.data)==null?void 0:e.branchLastCommit)==null?void 0:n.develop)??null}getBranchComparison(e){var n;return((n=this.queryResult.data)==null?void 0:n.branchComparisons[e])??null}async mergeToStaging(){return this.mergeStagingMutation.mutateAsync()}async mergeToProduction(){return this.mergeProductionMutation.mutateAsync()}async triggerDirectDeploy(){await this.directDeployMutation.mutateAsync()}async refetch(){await this.queryResult.refetch()}}function lX(){return Fs(t=>({deployStatus:"idle",deployTarget:null,deployError:null,setDeployStatus:e=>t({deployStatus:e}),setDeployTarget:e=>t({deployTarget:e}),setDeployError:e=>t({deployError:e})}))}class cX{constructor(){St(this,"store");this.store=lX()}getState(){const{deployStatus:e,deployTarget:n,deployError:r}=this.store.getState();return{deployStatus:e,deployTarget:n,deployError:r}}setDeployStatus(e){this.store.getState().setDeployStatus(e)}setDeployTarget(e){this.store.getState().setDeployTarget(e)}setDeployError(e){this.store.getState().setDeployError(e)}startDeploy(e){this.store.setState({deployStatus:"loading",deployTarget:e,deployError:null})}completeDeploy(){this.store.setState({deployStatus:"success"})}failDeploy(e){this.store.setState({deployStatus:"error",deployError:e})}resetDeployState(){this.store.setState({deployStatus:"idle",deployTarget:null,deployError:null})}subscribe(e){return this.store.subscribe(e)}}class uX{constructor(e,n){this.repository=e,this.presenter=n}getState(){return{contentTypes:this.repository.getContentTypes(),isLoading:this.repository.isLoading(),metadata:this.repository.getMetadata(),developLastCommit:this.repository.getDevelopLastCommit(),stagingLastCommit:this.repository.getStagingLastCommit(),productionLastCommit:this.repository.getProductionLastCommit()}}getButtonStates(){var s,i,l;const e=((s=this.repository.getDevelopLastCommit())==null?void 0:s.getTime())??0,n=((i=this.repository.getStagingLastCommit())==null?void 0:i.getTime())??0,r=((l=this.repository.getProductionLastCommit())==null?void 0:l.getTime())??0;return{previewEnabled:e>n,productionEnabled:n>r,directDeployEnabled:e>r}}getContentTypeMetadata(e){return this.repository.getContentTypeMetadata(e)}formatRelativeTime(e){if(!e)return"";const n=typeof e=="string"?new Date(e):e,s=new Date().getTime()-n.getTime(),i=Math.floor(s/(1e3*60)),l=Math.floor(s/(1e3*60*60)),u=Math.floor(s/(1e3*60*60*24));return i<1?"たった今":i<60?`${i}分前`:l<24?`${l}時間前`:u<7?`${u}日前`:n.toLocaleDateString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"})}getBranchComparison(e){return this.repository.getBranchComparison(e)}isPreviewEnabled(e){const n=this.repository.getBranchComparison(e);return((n==null?void 0:n.ahead)??0)>0}getDeployState(){return this.presenter.getState()}resetDeployState(){this.presenter.resetDeployState()}async mergeToStaging(){this.presenter.startDeploy("preview");try{const e=await this.repository.mergeToStaging();return e.hasConflict?(this.presenter.failDeploy("コンフリクトが発生しました。手動で解決してください。"),{success:!1,hasConflict:!0}):(this.presenter.completeDeploy(),await this.repository.refetch(),oe.info("DashboardUseCase.mergeToStaging: completed",{sha:e.sha}),{success:!0,hasConflict:!1})}catch(e){const n=e instanceof Error?e.message:String(e);return this.presenter.failDeploy(n),oe.error("DashboardUseCase.mergeToStaging: failed",{error:n}),{success:!1,hasConflict:!1}}}async mergeToProduction(){this.presenter.startDeploy("production");try{const e=await this.repository.mergeToProduction();return e.hasConflict?(this.presenter.failDeploy("コンフリクトが発生しました。手動で解決してください。"),{success:!1,hasConflict:!0}):(this.presenter.completeDeploy(),await this.repository.refetch(),oe.info("DashboardUseCase.mergeToProduction: completed",{sha:e.sha}),{success:!0,hasConflict:!1})}catch(e){const n=e instanceof Error?e.message:String(e);return this.presenter.failDeploy(n),oe.error("DashboardUseCase.mergeToProduction: failed",{error:n}),{success:!1,hasConflict:!1}}}async directDeploy(){this.presenter.startDeploy("direct");try{return await this.repository.triggerDirectDeploy(),this.presenter.completeDeploy(),oe.info("DashboardUseCase.directDeploy: workflow dispatched"),{success:!0}}catch(e){const n=e instanceof Error?e.message:String(e);return this.presenter.failDeploy(n),oe.error("DashboardUseCase.directDeploy: failed",{error:n}),{success:!1}}}}function LP(){const{authUseCase:t}=rr(),{branchUseCase:e}=Ei(),n=ys(),{token:r,githubUser:s,stagingBranches:i}=t.getState(),l=(e==null?void 0:e.getCurrentBranch())??"develop",u=e==null?void 0:e.getState(),p=(u==null?void 0:u.branchType)==="personal",f=(u==null?void 0:u.currentBranch)??"",m=s?cP(s.login,i):[],g=p?m.map(S=>S.branchName):[],y=new Pf(jn(Pf.QueryParams(r,l,p?f:void 0,g)),Pn(Pf.MergeStagingMutationParams(r,n)),Pn(Pf.MergeProductionMutationParams(r,n)),Pn(Pf.DirectDeployMutationParams(r,n))),v=new cX;return{dashboardUseCase:new uX(y,v)}}const dX="modulepreload",pX=function(t){return"/admin/"+t},JM={},fX=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),p=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=l(n.map(f=>{if(f=pX(f),f in JM)return;JM[f]=!0;const m=f.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":dX,m||(y.as="script"),y.crossOrigin="",y.href=f,p&&y.setAttribute("nonce",p),document.head.appendChild(y),m)return new Promise((v,C)=>{y.addEventListener("load",v),y.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return e().catch(i)})},YM={Article:km,Description:Tp,Folder:ic,Image:jP,Movie:oY,MusicNote:aY,Book:gJ,Feed:zJ,Newspaper:cY,LibraryBooks:YJ,AutoStories:mJ,Notes:uY,TextFields:T2,Email:_J,Chat:bJ,Forum:BJ,Comment:jJ,ContactPage:TJ,Textsms:kY,Phone:fY,Announcement:dJ,Work:$Y,Store:DY,ShoppingCart:jY,Payment:pY,Receipt:vY,CreditCard:DJ,Inventory:QJ,Analytics:uJ,TrendingUp:AY,Business:vJ,Person:Mm,People:RP,Group:Nx,AccountCircle:lJ,Face:PJ,SupervisorAccount:RY,Event:IJ,CalendarToday:yP,Schedule:SY,AccessTime:aJ,Alarm:cJ,Today:MY,Place:mY,Map:sY,Home:qJ,LocationOn:nY,School:wY,LocalHospital:eY,Restaurant:xY,Hotel:GJ,Storefront:EY,PhotoCamera:hY,Videocam:PY,Mic:iY,Headphones:VJ,PlayCircle:yY,VolumeUp:zY,Settings:Bx,Build:b2,Dashboard:SP,Tune:_Y,Code:S2,Extension:CP,AttachFile:gP,CloudUpload:Ti,FilePresent:$J,PictureAsPdf:Fx,CloudDownload:CJ,Star:MP,Favorite:LJ,Flag:NJ,LocalOffer:tY,Label:ch,Category:xJ,Help:HJ,Info:KJ,CheckCircle:vP,Search:Om,Bookmark:yJ,Link:j2,Public:kC,Lock:rY},Lf={};function MC({iconName:t,sx:e}){const[n,r]=b.useState(null),[s,i]=b.useState(!1);if(YM[t]){const l=YM[t];return a.jsx(l,{sx:e})}return b.useEffect(()=>{if(Lf[t]!==void 0){r(Lf[t]);return}i(!0),fX(()=>import("./index-Qi4Cp3k2.js"),[]).then(l=>{const u=l[t];u?(Lf[t]=u,r(u)):(Lf[t]=null,r(null))}).catch(()=>{Lf[t]=null,r(null)}).finally(()=>{i(!1)})},[t]),s?a.jsx(ut,{size:16,sx:e}):n?a.jsx(n,{sx:e}):a.jsx(km,{sx:e})}function Vx({iconName:t,sx:e}){return a.jsx(MC,{iconName:t,sx:e})}const hX=Ss("/")({component:mX});function mX(){const t=ta().productionUrl,e=ta().previewUrl,{authUseCase:n}=rr(),{branchUseCase:r}=Ei(),{simulationUseCase:s}=D2(),{githubUser:i,currentUser:l,permissions:u,stagingBranches:p,allowPersonalBranch:f}=n.getState(),{dashboardUseCase:m}=LP(),g=s.getEffectivePermissions(),y=l!=null&&l.isOwner&&!s.getState().isActive?Cv:g,{contentTypes:v,isLoading:C,stagingLastCommit:S,productionLastCommit:j}=m.getState(),{previewEnabled:D,productionEnabled:M,directDeployEnabled:T}=m.getButtonStates(),[E,k]=b.useState(!1),A=r==null?void 0:r.getState(),O=(A==null?void 0:A.branchType)==="personal",I=i?cP(i.login,p):[],$=(A==null?void 0:A.currentBranch)??"";if(!i||!l)return null;const R=(y==null?void 0:y.canViewDeploy)??!1,P=(y==null?void 0:y.canEditDeploy)??!1,z=(y==null?void 0:y.canViewUsers)||(y==null?void 0:y.canViewStaging),N=(y==null?void 0:y.canViewContentType)||(y==null?void 0:y.canViewBuildRecipes),H=y==null?void 0:y.canViewTemplates,U=y==null?void 0:y.canViewStorage;return a.jsx(B,{"data-component-name":"cmp:DashboardPage",sx:{flex:1,overflow:"auto"},children:a.jsxs(ji,{maxWidth:"lg",sx:{py:3},children:[a.jsxs(B,{sx:{mb:2},children:[a.jsx(G,{variant:"h5",children:"ダッシュボード"}),a.jsx(G,{variant:"caption",color:"text.secondary",children:"repository: @ctime-projects/frelio-demo"})]}),r&&f&&a.jsx(VY,{branchUseCase:r}),a.jsxs(Et,{container:!0,spacing:3,children:[a.jsxs(Et,{item:!0,xs:12,md:6,children:[a.jsxs($t,{"data-component-name":"cmp:ContentSection",sx:{p:2},children:[a.jsxs(B,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[a.jsx(G,{variant:"h6",children:"コンテンツ"}),r&&f&&a.jsx(BY,{branchUseCase:r})]}),a.jsx(xX,{contentTypes:v,dashboardUseCase:m,stagingLastCommit:S,isLoading:C,canEditContentType:(y==null?void 0:y.canEditContentType)??!1}),H&&a.jsxs(B,{"data-component-name":"cmp:FileManagementSection",sx:{mt:2,pt:2,borderTop:1,borderColor:"divider"},children:[a.jsx(G,{variant:"h6",gutterBottom:!0,children:"ファイル管理"}),a.jsx(as,{children:a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{component:gs,to:"/templates",children:[a.jsx(Un,{sx:{mr:2},children:a.jsx(ic,{sx:{fontSize:52}})}),a.jsx(Zn,{primary:"テンプレート",secondary:"github内ファイルの管理"})]})})})]})]}),U&&a.jsx(B,{"data-component-name":"cmp:StorageSection",sx:{p:2,mt:3},children:a.jsx(as,{children:a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{component:gs,to:"/storage",children:[a.jsx(Un,{sx:{mr:2},children:a.jsx(ic,{sx:{fontSize:52}})}),a.jsx(Zn,{primary:"ストレージ",secondary:"R2の画像やファイルの管理"})]})})})})]}),R&&a.jsx(Et,{item:!0,xs:12,md:6,children:O&&f?a.jsx(gX,{userStagingBranches:I,personalBranchName:$,dashboardUseCase:m,canEditDeploy:P}):a.jsx(vX,{previewEnabled:D,productionEnabled:M,directDeployEnabled:T,stagingLastCommit:S,productionLastCommit:j,previewUrl:e,productionUrl:t,badgeTooltipOpen:E,setBadgeTooltipOpen:k,dashboardUseCase:m,canEditDeploy:P})}),z&&a.jsx(Et,{item:!0,xs:12,children:a.jsxs($t,{"data-component-name":"cmp:AdminSection",sx:{p:2},children:[a.jsx(G,{variant:"h6",gutterBottom:!0,children:"管理"}),a.jsxs(as,{children:[(y==null?void 0:y.canViewUsers)&&a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{component:gs,to:"/users",children:[a.jsx(Un,{children:a.jsx(RP,{})}),a.jsx(Zn,{primary:"ユーザー管理",secondary:"ユーザーの追加・編集・削除"})]})}),(y==null?void 0:y.canViewStaging)&&a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{component:gs,to:"/staging",children:[a.jsx(Un,{children:a.jsx(mP,{})}),a.jsx(Zn,{primary:"ステージングブランチ管理",secondary:"プレビュー用ブランチの設定"})]})})]})]})}),N&&a.jsx(Et,{item:!0,xs:12,children:a.jsxs($t,{"data-component-name":"cmp:DevelopSection",sx:{p:2},children:[a.jsx(G,{variant:"h6",gutterBottom:!0,children:"開発"}),a.jsxs(as,{children:[(y==null?void 0:y.canViewContentType)&&a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{component:gs,to:"/content-types",children:[a.jsx(Un,{children:a.jsx(CY,{})}),a.jsx(Zn,{primary:"コンテンツタイプ編集",secondary:"フィールド定義・UI設定・ビュー定義"})]})}),(y==null?void 0:y.canViewBuildRecipes)&&a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{component:gs,to:"/build-recipes",children:[a.jsx(Un,{children:a.jsx(b2,{})}),a.jsx(Zn,{primary:"ビルドデータレシピ編集",secondary:"コンテンツからJSONへの変換定義"})]})})]})]})})]})]})})}function gX({userStagingBranches:t,personalBranchName:e,dashboardUseCase:n,canEditDeploy:r}){return a.jsxs($t,{"data-component-name":"cmp:PersonalBranchPreviewSection",sx:{p:3},children:[a.jsx(G,{variant:"h6",gutterBottom:!0,children:"プレビュー"}),t.length>0?a.jsx(B,{sx:{display:"flex",flexDirection:"column",gap:3,py:2},children:t.map(s=>a.jsx(yX,{stagingBranch:s,personalBranchName:e,previewEnabled:n.isPreviewEnabled(s.branchName),canEditDeploy:r},s.branchName))}):a.jsx(zt,{severity:"info",sx:{mt:2},children:"個人ブランチ用ステージングブランチは設定されていません"})]})}function yX({stagingBranch:t,personalBranchName:e,previewEnabled:n,canEditDeploy:r}){const s=t.isDefault?ta().previewUrl:t.previewUrl;return a.jsxs(B,{sx:{display:"flex",flexDirection:"column",alignItems:"center",p:2,border:"1px dashed",borderColor:"divider",borderRadius:1},children:[a.jsx(G,{variant:"subtitle1",fontWeight:"bold",gutterBottom:!0,children:t.branchName}),a.jsx(RC,{sx:{fontSize:48,color:"success.main",mb:1}}),a.jsxs(G,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:["frelio-cms/",e,"ブランチを",t.branchName,"ブランチにマージ"]}),a.jsx(pe,{variant:"contained",color:"success",fullWidth:!0,disabled:!r||!n,size:"small",children:"プレビューに反映"}),s&&a.jsx(pe,{variant:"outlined",color:"success",size:"small",startIcon:a.jsx(ip,{}),fullWidth:!0,sx:{mt:1},href:s,target:"_blank",rel:"noopener noreferrer",children:"プレビューを見る"})]})}function vX({previewEnabled:t,productionEnabled:e,directDeployEnabled:n,stagingLastCommit:r,productionLastCommit:s,previewUrl:i,productionUrl:l,badgeTooltipOpen:u,setBadgeTooltipOpen:p,dashboardUseCase:f,canEditDeploy:m}){const{deployStatus:g,deployTarget:y,deployError:v}=f.getDeployState(),C=g==="loading",S=async()=>{await f.mergeToStaging()},j=async()=>{await f.mergeToProduction()},D=async()=>{await f.directDeploy()},M=()=>{f.resetDeployState()},T=()=>{switch(y){case"preview":return"プレビューに反映しました";case"production":return"本番に反映しました";case"direct":return"直接デプロイを開始しました。GitHub Actions で実行中です。";default:return"デプロイが完了しました"}};return a.jsxs($t,{"data-component-name":"cmp:DevelopBranchPreviewSection",sx:{p:3},children:[a.jsx(G,{variant:"h6",gutterBottom:!0,children:"プレビューと本番化"}),a.jsxs(B,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2,py:3},children:[a.jsxs(B,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[a.jsx(RC,{sx:{fontSize:64,color:"info.main",mb:1}}),a.jsx(G,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"developブランチをstagingブランチにマージ"}),a.jsxs(B,{sx:{position:"relative",width:"100%"},children:[a.jsx(pe,{variant:"contained",color:"info",fullWidth:!0,disabled:!m||!t||C,onClick:S,startIcon:C&&y==="preview"?a.jsx(ut,{size:16,color:"inherit"}):void 0,children:C&&y==="preview"?"反映中...":"プレビューに反映"}),t&&e&&a.jsx(PI,{onClickAway:()=>p(!1),children:a.jsx(Er,{title:a.jsxs(a.Fragment,{children:["プレビューは最新ではありません。",a.jsx("br",{}),"本番を最新にするには、「本番に反映」をする前に「プレビューに反映」を行う必要があります。"]}),arrow:!0,open:u,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,children:a.jsx(B,{onClick:()=>p(!u),sx:{position:"absolute",top:-8,right:-8,width:20,height:20,borderRadius:"50%",bgcolor:"warning.main",color:"warning.contrastText",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:"bold",cursor:"pointer"},children:"!"})})})]}),a.jsx(pe,{variant:"outlined",color:"info",size:"small",startIcon:a.jsx(ip,{}),fullWidth:!0,sx:{mt:1},href:i,target:"_blank",rel:"noopener noreferrer",disabled:!i,children:"今のプレビューを見る"}),r&&a.jsxs(G,{variant:"caption",color:"text.secondary",sx:{mt:.5},children:["最終反映: ",f.formatRelativeTime(r)]})]}),a.jsx(zx,{sx:{fontSize:48,color:"grey.400"}}),a.jsxs(B,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[a.jsx(kC,{sx:{fontSize:64,color:"success.main",mb:1}}),a.jsx(G,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"stagingブランチをmainブランチにマージ"}),a.jsx(pe,{variant:"contained",color:"success",fullWidth:!0,disabled:!m||!e||C,onClick:j,startIcon:C&&y==="production"?a.jsx(ut,{size:16,color:"inherit"}):void 0,children:C&&y==="production"?"反映中...":"本番に反映"}),a.jsx(pe,{variant:"text",color:"success",size:"small",startIcon:a.jsx(ip,{}),fullWidth:!0,sx:{mt:1},href:l,target:"_blank",rel:"noopener noreferrer",disabled:!l,children:"今の本番を見る"}),s&&a.jsxs(G,{variant:"caption",color:"text.secondary",sx:{mt:.5},children:["最終反映: ",f.formatRelativeTime(s)]})]}),a.jsxs(B,{sx:{mt:3,pt:3,borderTop:1,borderColor:"divider",width:"100%",textAlign:"center"},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1,mb:2},children:[a.jsx(RC,{sx:{fontSize:64,color:"warning.main"}}),a.jsx(fJ,{sx:{fontSize:48,color:"grey.400"}}),a.jsx(kC,{sx:{fontSize:64,color:"warning.main"}})]}),a.jsx(pe,{variant:"outlined",color:"warning",startIcon:C&&y==="direct"?a.jsx(ut,{size:16,color:"inherit"}):a.jsx(gY,{}),disabled:!m||!n||C,onClick:D,children:C&&y==="direct"?"デプロイ中...":"プレビューに反映してそのまま本番化"})]}),a.jsx(B,{sx:{mt:2,textAlign:"center"},children:a.jsx(pe,{component:gs,to:"/deploy-history",variant:"text",size:"small",startIcon:a.jsx(wP,{}),color:"inherit",children:"本番化履歴"})})]}),a.jsx(ea,{open:g==="success",autoHideDuration:5e3,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{onClose:M,severity:"success",variant:"filled",children:T()})}),a.jsx(ea,{open:g==="error",autoHideDuration:8e3,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{onClose:M,severity:"error",variant:"filled",children:v??"エラーが発生しました"})})]})}function xX({contentTypes:t,dashboardUseCase:e,stagingLastCommit:n,isLoading:r,canEditContentType:s}){const i=t.filter(y=>(y.displayLocation??"normal")==="normal"),l=t.filter(y=>y.displayLocation==="collapsed"),u=s?t.filter(y=>y.displayLocation==="hidden"):[],p=i.length>0||l.length>0||u.length>0,f=y=>y.some(v=>{const C=e.getContentTypeMetadata(v.id);return C!=null&&C.lastUpdatedAt&&n?new Date(C.lastUpdatedAt).getTime()>n.getTime():!1}),m=f(l),g=f(u);return r?a.jsx(B,{display:"flex",justifyContent:"center",p:2,children:a.jsx(ut,{size:24})}):p?a.jsxs(a.Fragment,{children:[i.length>0&&a.jsx(as,{"data-component-name":"cmp:NormalContentTypeList",children:i.map(y=>a.jsx(OC,{ct:y,dashboardUseCase:e,stagingLastCommit:n},y.id))}),l.length>0&&a.jsx(bX,{contentTypes:l,dashboardUseCase:e,stagingLastCommit:n,hasUnreflected:m}),u.length>0&&a.jsxs(_s,{"data-component-name":"cmp:HiddenContentTypesSection",defaultExpanded:!1,sx:{mt:2,"&:before":{display:"none"},boxShadow:"none",border:"1px dashed",borderColor:"warning.main",borderRadius:1,bgcolor:"warning.lighter"},children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsx(xv,{variant:"dot",color:"warning",invisible:!g,children:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(LY,{fontSize:"small",color:"warning"}),a.jsx(G,{variant:"body2",color:"warning.dark",children:"非表示コンテンツ"})]})})}),a.jsx(Is,{sx:{p:0},children:a.jsx(as,{disablePadding:!0,children:u.map(y=>a.jsx(OC,{ct:y,dashboardUseCase:e,stagingLastCommit:n},y.id))})})]})]}):a.jsxs(B,{p:2,textAlign:"center",children:[a.jsx(Tp,{sx:{fontSize:48,color:"grey.400",mb:1}}),a.jsx(G,{color:"text.secondary",children:"コンテンツタイプがまだありません"}),a.jsx(G,{variant:"body2",color:"text.secondary",children:"content-repo に定義を追加してください"})]})}function OC({ct:t,dashboardUseCase:e,stagingLastCommit:n}){const r=e.getContentTypeMetadata(t.id),s=r!=null&&r.lastUpdatedAt?e.formatRelativeTime(r.lastUpdatedAt):null,i=s?`最終更新: ${s}`:"",l=r!=null&&r.lastUpdatedAt&&n?new Date(r.lastUpdatedAt).getTime()>n.getTime():!1;return a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{component:gs,to:`/contents/${t.id}`,children:[a.jsx(Un,{sx:{mr:2},children:a.jsx(xv,{variant:"dot",color:"warning",invisible:!l,children:a.jsx(Vx,{iconName:t.icon,sx:{fontSize:48}})})}),a.jsx(Zn,{primary:t.label,secondary:i})]})})}function bX({contentTypes:t,dashboardUseCase:e,stagingLastCommit:n,hasUnreflected:r}){const[s,i]=b.useState(!1);return a.jsxs(_s,{"data-component-name":"cmp:CollapsedContentTypesSection",expanded:s,onChange:(l,u)=>i(u),disableGutters:!0,sx:{mt:1,"&:before":{display:"none"},boxShadow:"none",bgcolor:"transparent"},children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{fontSize:"small"}),sx:{minHeight:"auto",p:0,justifyContent:"flex-start","& .MuiAccordionSummary-content":{m:0,flexGrow:0},"& .MuiAccordionSummary-expandIconWrapper":{ml:.5}},children:a.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[a.jsx(G,{variant:"body2",color:"text.secondary",children:"その他"}),r&&!s&&a.jsx(B,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"warning.main",ml:.5}})]})}),a.jsx(Is,{sx:{p:0},children:a.jsx(as,{disablePadding:!0,children:t.map(l=>a.jsx(OC,{ct:l,dashboardUseCase:e,stagingLastCommit:n},l.id))})})]})}var xn;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const l of s)i[l]=l;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),l={};for(const u of i)l[u]=s[u];return t.objectValues(l)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&i.push(l);return i},t.find=(s,i)=>{for(const l of s)if(i(l))return l},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(xn||(xn={}));var AC;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(AC||(AC={}));const pt=xn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ml=t=>{switch(typeof t){case"undefined":return pt.undefined;case"string":return pt.string;case"number":return isNaN(t)?pt.nan:pt.number;case"boolean":return pt.boolean;case"function":return pt.function;case"bigint":return pt.bigint;case"symbol":return pt.symbol;case"object":return Array.isArray(t)?pt.array:t===null?pt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?pt.promise:typeof Map<"u"&&t instanceof Map?pt.map:typeof Set<"u"&&t instanceof Set?pt.set:typeof Date<"u"&&t instanceof Date?pt.date:pt.object;default:return pt.unknown}},He=xn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),SX=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");let To=class zP extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(s);else if(l.code==="invalid_return_type")s(l.returnTypeError);else if(l.code==="invalid_arguments")s(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let u=r,p=0;for(;p<l.path.length;){const f=l.path[p];p===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(l))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),r}static assert(e){if(!(e instanceof zP))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,xn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};To.create=t=>new To(t);const op=(t,e)=>{let n;switch(t.code){case He.invalid_type:t.received===pt.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case He.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,xn.jsonStringifyReplacer)}`;break;case He.unrecognized_keys:n=`Unrecognized key(s) in object: ${xn.joinValues(t.keys,", ")}`;break;case He.invalid_union:n="Invalid input";break;case He.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${xn.joinValues(t.options)}`;break;case He.invalid_enum_value:n=`Invalid enum value. Expected ${xn.joinValues(t.options)}, received '${t.received}'`;break;case He.invalid_arguments:n="Invalid function arguments";break;case He.invalid_return_type:n="Invalid function return type";break;case He.invalid_date:n="Invalid date";break;case He.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:xn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case He.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case He.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case He.custom:n="Invalid input";break;case He.invalid_intersection_types:n="Intersection results could not be merged";break;case He.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case He.not_finite:n="Number must be finite";break;default:n=e.defaultError,xn.assertNever(t)}return{message:n}};let $P=op;function CX(t){$P=t}function Dv(){return $P}const Ev=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],l={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let u="";const p=r.filter(f=>!!f).slice().reverse();for(const f of p)u=f(l,{data:e,defaultError:u}).message;return{...s,path:i,message:u}},wX=[];function ot(t,e){const n=Dv(),r=Ev({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===op?void 0:op].filter(s=>!!s)});t.common.issues.push(r)}let ni=class NP{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Lt;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,l=await s.value;r.push({key:i,value:l})}return NP.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:l}=s;if(i.status==="aborted"||l.status==="aborted")return Lt;i.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||s.alwaysSet)&&(r[i.value]=l.value)}return{status:e.value,value:r}}};const Lt=Object.freeze({status:"aborted"}),Dd=t=>({status:"dirty",value:t}),zs=t=>({status:"valid",value:t}),_C=t=>t.status==="aborted",IC=t=>t.status==="dirty",Lh=t=>t.status==="valid",zh=t=>typeof Promise<"u"&&t instanceof Promise;function Rv(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function FP(t,e,n,r,s){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var Tt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Tt||(Tt={}));var Kf,Qf;let ra=class{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const XM=(t,e)=>{if(Lh(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new To(t.common.issues);return this._error=n,this._error}}};function Gt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(l,u)=>{var p,f;const{message:m}=t;return l.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??r)!==null&&p!==void 0?p:u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}let nn=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Ml(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ml(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ni,ctx:{common:e.parent.common,data:e.data,parsedType:Ml(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(zh(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ml(e)},i=this._parseSync({data:e,path:s.path,parent:s});return XM(s,i)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ml(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(zh(s)?s:Promise.resolve(s));return XM(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const l=e(s),u=()=>i.addIssue({code:He.custom,...r(s)});return typeof Promise<"u"&&l instanceof Promise?l.then(p=>p?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new ko({schema:this,typeName:Pt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Zo.create(this,this._def)}nullable(){return lc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vu.create(this,this._def)}promise(){return cp.create(this,this._def)}or(e){return Hh.create([this,e],this._def)}and(e){return Wh.create(this,e,this._def)}transform(e){return new ko({...Gt(this._def),schema:this,typeName:Pt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Kh({...Gt(this._def),innerType:this,defaultValue:n,typeName:Pt.ZodDefault})}brand(){return new E2({typeName:Pt.ZodBranded,type:this,...Gt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Qh({...Gt(this._def),innerType:this,catchValue:n,typeName:Pt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return R2.create(this,e)}readonly(){return Jh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const jX=/^c[^\s-]{8,}$/i,TX=/^[0-9a-z]+$/,DX=/^[0-9A-HJKMNP-TV-Z]{26}$/,EX=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,RX=/^[a-z0-9_-]{21}$/i,kX=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,MX=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,OX="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let l1;const AX=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_X=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,IX=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,BP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",PX=new RegExp(`^${BP}$`);function UP(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function LX(t){return new RegExp(`^${UP(t)}$`)}function VP(t){let e=`${BP}T${UP(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function zX(t,e){return!!((e==="v4"||!e)&&AX.test(t)||(e==="v6"||!e)&&_X.test(t))}let ap=class Jf extends nn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==pt.string){const i=this._getOrReturnCtx(e);return ot(i,{code:He.invalid_type,expected:pt.string,received:i.parsedType}),Lt}const r=new ni;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),ot(s,{code:He.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),ot(s,{code:He.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,u=e.data.length<i.value;(l||u)&&(s=this._getOrReturnCtx(e,s),l?ot(s,{code:He.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&ot(s,{code:He.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")MX.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"email",code:He.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")l1||(l1=new RegExp(OX,"u")),l1.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"emoji",code:He.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")EX.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"uuid",code:He.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")RX.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"nanoid",code:He.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")jX.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"cuid",code:He.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")TX.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"cuid2",code:He.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")DX.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"ulid",code:He.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ot(s,{validation:"url",code:He.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"regex",code:He.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),ot(s,{code:He.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),ot(s,{code:He.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),ot(s,{code:He.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?VP(i).test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{code:He.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?PX.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{code:He.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?LX(i).test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{code:He.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?kX.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"duration",code:He.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?zX(e.data,i.version)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"ip",code:He.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?IX.test(e.data)||(s=this._getOrReturnCtx(e,s),ot(s,{validation:"base64",code:He.invalid_string,message:i.message}),r.dirty()):xn.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:He.invalid_string,...Tt.errToObj(r)})}_addCheck(e){return new Jf({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Tt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Tt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Tt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Tt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Tt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Tt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Tt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Tt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Tt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Tt.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...Tt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Tt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Tt.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Tt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Tt.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Tt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Tt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Tt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Tt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Tt.errToObj(n)})}nonempty(e){return this.min(1,Tt.errToObj(e))}trim(){return new Jf({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jf({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jf({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ap.create=t=>{var e;return new ap({checks:[],typeName:Pt.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Gt(t)})};function $X(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=parseInt(t.toFixed(s).replace(".","")),l=parseInt(e.toFixed(s).replace(".",""));return i%l/Math.pow(10,s)}let $h=class PC extends nn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==pt.number){const i=this._getOrReturnCtx(e);return ot(i,{code:He.invalid_type,expected:pt.number,received:i.parsedType}),Lt}let r;const s=new ni;for(const i of this._def.checks)i.kind==="int"?xn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ot(r,{code:He.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ot(r,{code:He.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ot(r,{code:He.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?$X(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),ot(r,{code:He.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ot(r,{code:He.not_finite,message:i.message}),s.dirty()):xn.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Tt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Tt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Tt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Tt.toString(n))}setLimit(e,n,r,s){return new PC({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Tt.toString(s)}]})}_addCheck(e){return new PC({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Tt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Tt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Tt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Tt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Tt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Tt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Tt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Tt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Tt.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&xn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};$h.create=t=>new $h({checks:[],typeName:Pt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Gt(t)});let Nh=class LC extends nn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==pt.bigint){const i=this._getOrReturnCtx(e);return ot(i,{code:He.invalid_type,expected:pt.bigint,received:i.parsedType}),Lt}let r;const s=new ni;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ot(r,{code:He.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ot(r,{code:He.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ot(r,{code:He.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):xn.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Tt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Tt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Tt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Tt.toString(n))}setLimit(e,n,r,s){return new LC({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Tt.toString(s)}]})}_addCheck(e){return new LC({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Tt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Tt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Tt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Tt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Tt.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Nh.create=t=>{var e;return new Nh({checks:[],typeName:Pt.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Gt(t)})};let Fh=class extends nn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==pt.boolean){const r=this._getOrReturnCtx(e);return ot(r,{code:He.invalid_type,expected:pt.boolean,received:r.parsedType}),Lt}return zs(e.data)}};Fh.create=t=>new Fh({typeName:Pt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Gt(t)});let Bh=class HP extends nn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==pt.date){const i=this._getOrReturnCtx(e);return ot(i,{code:He.invalid_type,expected:pt.date,received:i.parsedType}),Lt}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return ot(i,{code:He.invalid_date}),Lt}const r=new ni;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),ot(s,{code:He.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),ot(s,{code:He.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):xn.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new HP({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Tt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Tt.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Bh.create=t=>new Bh({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Pt.ZodDate,...Gt(t)});let kv=class extends nn{_parse(e){if(this._getType(e)!==pt.symbol){const r=this._getOrReturnCtx(e);return ot(r,{code:He.invalid_type,expected:pt.symbol,received:r.parsedType}),Lt}return zs(e.data)}};kv.create=t=>new kv({typeName:Pt.ZodSymbol,...Gt(t)});let Uh=class extends nn{_parse(e){if(this._getType(e)!==pt.undefined){const r=this._getOrReturnCtx(e);return ot(r,{code:He.invalid_type,expected:pt.undefined,received:r.parsedType}),Lt}return zs(e.data)}};Uh.create=t=>new Uh({typeName:Pt.ZodUndefined,...Gt(t)});let Vh=class extends nn{_parse(e){if(this._getType(e)!==pt.null){const r=this._getOrReturnCtx(e);return ot(r,{code:He.invalid_type,expected:pt.null,received:r.parsedType}),Lt}return zs(e.data)}};Vh.create=t=>new Vh({typeName:Pt.ZodNull,...Gt(t)});let lp=class extends nn{constructor(){super(...arguments),this._any=!0}_parse(e){return zs(e.data)}};lp.create=t=>new lp({typeName:Pt.ZodAny,...Gt(t)});let du=class extends nn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zs(e.data)}};du.create=t=>new du({typeName:Pt.ZodUnknown,...Gt(t)});let Ga=class extends nn{_parse(e){const n=this._getOrReturnCtx(e);return ot(n,{code:He.invalid_type,expected:pt.never,received:n.parsedType}),Lt}};Ga.create=t=>new Ga({typeName:Pt.ZodNever,...Gt(t)});let Mv=class extends nn{_parse(e){if(this._getType(e)!==pt.undefined){const r=this._getOrReturnCtx(e);return ot(r,{code:He.invalid_type,expected:pt.void,received:r.parsedType}),Lt}return zs(e.data)}};Mv.create=t=>new Mv({typeName:Pt.ZodVoid,...Gt(t)});let vu=class Jy extends nn{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==pt.array)return ot(n,{code:He.invalid_type,expected:pt.array,received:n.parsedType}),Lt;if(s.exactLength!==null){const l=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(l||u)&&(ot(n,{code:l?He.too_big:He.too_small,minimum:u?s.exactLength.value:void 0,maximum:l?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ot(n,{code:He.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ot(n,{code:He.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>s.type._parseAsync(new ra(n,l,n.path,u)))).then(l=>ni.mergeArray(r,l));const i=[...n.data].map((l,u)=>s.type._parseSync(new ra(n,l,n.path,u)));return ni.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Jy({...this._def,minLength:{value:e,message:Tt.toString(n)}})}max(e,n){return new Jy({...this._def,maxLength:{value:e,message:Tt.toString(n)}})}length(e,n){return new Jy({...this._def,exactLength:{value:e,message:Tt.toString(n)}})}nonempty(e){return this.min(1,e)}};vu.create=(t,e)=>new vu({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Pt.ZodArray,...Gt(e)});function bd(t){if(t instanceof to){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Zo.create(bd(r))}return new to({...t._def,shape:()=>e})}else return t instanceof vu?new vu({...t._def,type:bd(t.element)}):t instanceof Zo?Zo.create(bd(t.unwrap())):t instanceof lc?lc.create(bd(t.unwrap())):t instanceof ac?ac.create(t.items.map(e=>bd(e))):t}let to=class ho extends nn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=xn.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==pt.object){const f=this._getOrReturnCtx(e);return ot(f,{code:He.invalid_type,expected:pt.object,received:f.parsedType}),Lt}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ga&&this._def.unknownKeys==="strip"))for(const f in s.data)l.includes(f)||u.push(f);const p=[];for(const f of l){const m=i[f],g=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new ra(s,g,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Ga){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ot(s,{code:He.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const g=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new ra(s,g,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const g=await m.key,y=await m.value;f.push({key:g,value:y,alwaysSet:m.alwaysSet})}return f}).then(f=>ni.mergeObjectSync(r,f)):ni.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(e){return Tt.errToObj,new ho({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,i,l,u;const p=(l=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,n,r).message)!==null&&l!==void 0?l:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=Tt.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new ho({...this._def,unknownKeys:"strip"})}passthrough(){return new ho({...this._def,unknownKeys:"passthrough"})}extend(e){return new ho({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ho({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Pt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ho({...this._def,catchall:e})}pick(e){const n={};return xn.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ho({...this._def,shape:()=>n})}omit(e){const n={};return xn.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new ho({...this._def,shape:()=>n})}deepPartial(){return bd(this)}partial(e){const n={};return xn.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}),new ho({...this._def,shape:()=>n})}required(e){const n={};return xn.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Zo;)i=i._def.innerType;n[r]=i}}),new ho({...this._def,shape:()=>n})}keyof(){return GP(xn.objectKeys(this.shape))}};to.create=(t,e)=>new to({shape:()=>t,unknownKeys:"strip",catchall:Ga.create(),typeName:Pt.ZodObject,...Gt(e)});to.strictCreate=(t,e)=>new to({shape:()=>t,unknownKeys:"strict",catchall:Ga.create(),typeName:Pt.ZodObject,...Gt(e)});to.lazycreate=(t,e)=>new to({shape:t,unknownKeys:"strip",catchall:Ga.create(),typeName:Pt.ZodObject,...Gt(e)});let Hh=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const l=i.map(u=>new To(u.ctx.common.issues));return ot(n,{code:He.invalid_union,unionErrors:l}),Lt}if(n.common.async)return Promise.all(r.map(async i=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(s);{let i;const l=[];for(const p of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=l.map(p=>new To(p));return ot(n,{code:He.invalid_union,unionErrors:u}),Lt}}get options(){return this._def.options}};Hh.create=(t,e)=>new Hh({options:t,typeName:Pt.ZodUnion,...Gt(e)});const Aa=t=>t instanceof qh?Aa(t.schema):t instanceof ko?Aa(t.innerType()):t instanceof Gh?[t.value]:t instanceof Am?t.options:t instanceof Zh?xn.objectValues(t.enum):t instanceof Kh?Aa(t._def.innerType):t instanceof Uh?[void 0]:t instanceof Vh?[null]:t instanceof Zo?[void 0,...Aa(t.unwrap())]:t instanceof lc?[null,...Aa(t.unwrap())]:t instanceof E2||t instanceof Jh?Aa(t.unwrap()):t instanceof Qh?Aa(t._def.innerType):[];class Hx extends nn{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==pt.object)return ot(n,{code:He.invalid_type,expected:pt.object,received:n.parsedType}),Lt;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(ot(n,{code:He.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Lt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const i of n){const l=Aa(i.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of l){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,i)}}return new Hx({typeName:Pt.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Gt(r)})}}function zC(t,e){const n=Ml(t),r=Ml(e);if(t===e)return{valid:!0,data:t};if(n===pt.object&&r===pt.object){const s=xn.objectKeys(e),i=xn.objectKeys(t).filter(u=>s.indexOf(u)!==-1),l={...t,...e};for(const u of i){const p=zC(t[u],e[u]);if(!p.valid)return{valid:!1};l[u]=p.data}return{valid:!0,data:l}}else if(n===pt.array&&r===pt.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const l=t[i],u=e[i],p=zC(l,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===pt.date&&r===pt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}let Wh=class extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,l)=>{if(_C(i)||_C(l))return Lt;const u=zC(i.value,l.value);return u.valid?((IC(i)||IC(l))&&n.dirty(),{status:n.value,value:u.data}):(ot(r,{code:He.invalid_intersection_types}),Lt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,l])=>s(i,l)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Wh.create=(t,e,n)=>new Wh({left:t,right:e,typeName:Pt.ZodIntersection,...Gt(n)});let ac=class WP extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==pt.array)return ot(r,{code:He.invalid_type,expected:pt.array,received:r.parsedType}),Lt;if(r.data.length<this._def.items.length)return ot(r,{code:He.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Lt;!this._def.rest&&r.data.length>this._def.items.length&&(ot(r,{code:He.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((l,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new ra(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(i).then(l=>ni.mergeArray(n,l)):ni.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new WP({...this._def,rest:e})}};ac.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ac({items:t,typeName:Pt.ZodTuple,rest:null,...Gt(e)})};let qP=class $C extends nn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==pt.object)return ot(r,{code:He.invalid_type,expected:pt.object,received:r.parsedType}),Lt;const s=[],i=this._def.keyType,l=this._def.valueType;for(const u in r.data)s.push({key:i._parse(new ra(r,u,r.path,u)),value:l._parse(new ra(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?ni.mergeObjectAsync(n,s):ni.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof nn?new $C({keyType:e,valueType:n,typeName:Pt.ZodRecord,...Gt(r)}):new $C({keyType:ap.create(),valueType:e,typeName:Pt.ZodRecord,...Gt(n)})}},Ov=class extends nn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==pt.map)return ot(r,{code:He.invalid_type,expected:pt.map,received:r.parsedType}),Lt;const s=this._def.keyType,i=this._def.valueType,l=[...r.data.entries()].map(([u,p],f)=>({key:s._parse(new ra(r,u,r.path,[f,"key"])),value:i._parse(new ra(r,p,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of l){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return Lt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of l){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return Lt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}};Ov.create=(t,e,n)=>new Ov({valueType:e,keyType:t,typeName:Pt.ZodMap,...Gt(n)});let Av=class NC extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==pt.set)return ot(r,{code:He.invalid_type,expected:pt.set,received:r.parsedType}),Lt;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ot(r,{code:He.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ot(r,{code:He.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function l(p){const f=new Set;for(const m of p){if(m.status==="aborted")return Lt;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((p,f)=>i._parse(new ra(r,p,r.path,f)));return r.common.async?Promise.all(u).then(p=>l(p)):l(u)}min(e,n){return new NC({...this._def,minSize:{value:e,message:Tt.toString(n)}})}max(e,n){return new NC({...this._def,maxSize:{value:e,message:Tt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Av.create=(t,e)=>new Av({valueType:t,minSize:null,maxSize:null,typeName:Pt.ZodSet,...Gt(e)});class zd extends nn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==pt.function)return ot(n,{code:He.invalid_type,expected:pt.function,received:n.parsedType}),Lt;function r(u,p){return Ev({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Dv(),op].filter(f=>!!f),issueData:{code:He.invalid_arguments,argumentsError:p}})}function s(u,p){return Ev({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Dv(),op].filter(f=>!!f),issueData:{code:He.invalid_return_type,returnTypeError:p}})}const i={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof cp){const u=this;return zs(async function(...p){const f=new To([]),m=await u._def.args.parseAsync(p,i).catch(v=>{throw f.addIssue(r(p,v)),f}),g=await Reflect.apply(l,this,m);return await u._def.returns._def.type.parseAsync(g,i).catch(v=>{throw f.addIssue(s(g,v)),f})})}else{const u=this;return zs(function(...p){const f=u._def.args.safeParse(p,i);if(!f.success)throw new To([r(p,f.error)]);const m=Reflect.apply(l,this,f.data),g=u._def.returns.safeParse(m,i);if(!g.success)throw new To([s(m,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new zd({...this._def,args:ac.create(e).rest(du.create())})}returns(e){return new zd({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new zd({args:e||ac.create([]).rest(du.create()),returns:n||du.create(),typeName:Pt.ZodFunction,...Gt(r)})}}let qh=class extends nn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};qh.create=(t,e)=>new qh({getter:t,typeName:Pt.ZodLazy,...Gt(e)});let Gh=class extends nn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ot(n,{received:n.data,code:He.invalid_literal,expected:this._def.value}),Lt}return{status:"valid",value:e.data}}get value(){return this._def.value}};Gh.create=(t,e)=>new Gh({value:t,typeName:Pt.ZodLiteral,...Gt(e)});function GP(t,e){return new Am({values:t,typeName:Pt.ZodEnum,...Gt(e)})}let Am=class FC extends nn{constructor(){super(...arguments),Kf.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ot(n,{expected:xn.joinValues(r),received:n.parsedType,code:He.invalid_type}),Lt}if(Rv(this,Kf)||FP(this,Kf,new Set(this._def.values)),!Rv(this,Kf).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return ot(n,{received:n.data,code:He.invalid_enum_value,options:r}),Lt}return zs(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return FC.create(e,{...this._def,...n})}exclude(e,n=this._def){return FC.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Kf=new WeakMap;Am.create=GP;let Zh=class extends nn{constructor(){super(...arguments),Qf.set(this,void 0)}_parse(e){const n=xn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==pt.string&&r.parsedType!==pt.number){const s=xn.objectValues(n);return ot(r,{expected:xn.joinValues(s),received:r.parsedType,code:He.invalid_type}),Lt}if(Rv(this,Qf)||FP(this,Qf,new Set(xn.getValidEnumValues(this._def.values))),!Rv(this,Qf).has(e.data)){const s=xn.objectValues(n);return ot(r,{received:r.data,code:He.invalid_enum_value,options:s}),Lt}return zs(e.data)}get enum(){return this._def.values}};Qf=new WeakMap;Zh.create=(t,e)=>new Zh({values:t,typeName:Pt.ZodNativeEnum,...Gt(e)});let cp=class extends nn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==pt.promise&&n.common.async===!1)return ot(n,{code:He.invalid_type,expected:pt.promise,received:n.parsedType}),Lt;const r=n.parsedType===pt.promise?n.data:Promise.resolve(n.data);return zs(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}};cp.create=(t,e)=>new cp({type:t,typeName:Pt.ZodPromise,...Gt(e)});let ko=class extends nn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:l=>{ot(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const l=s.transform(r.data,i);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return Lt;const p=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return p.status==="aborted"?Lt:p.status==="dirty"||n.value==="dirty"?Dd(p.value):p});{if(n.value==="aborted")return Lt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?Lt:u.status==="dirty"||n.value==="dirty"?Dd(u.value):u}}if(s.type==="refinement"){const l=u=>{const p=s.refinement(u,i);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Lt:(u.status==="dirty"&&n.dirty(),l(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Lt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Lh(l))return l;const u=s.transform(l.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>Lh(l)?Promise.resolve(s.transform(l.value,i)).then(u=>({status:n.value,value:u})):l);xn.assertNever(s)}};ko.create=(t,e,n)=>new ko({schema:t,typeName:Pt.ZodEffects,effect:e,...Gt(n)});ko.createWithPreprocess=(t,e,n)=>new ko({schema:e,effect:{type:"preprocess",transform:t},typeName:Pt.ZodEffects,...Gt(n)});let Zo=class extends nn{_parse(e){return this._getType(e)===pt.undefined?zs(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Zo.create=(t,e)=>new Zo({innerType:t,typeName:Pt.ZodOptional,...Gt(e)});let lc=class extends nn{_parse(e){return this._getType(e)===pt.null?zs(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lc.create=(t,e)=>new lc({innerType:t,typeName:Pt.ZodNullable,...Gt(e)});let Kh=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===pt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Kh.create=(t,e)=>new Kh({innerType:t,typeName:Pt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Gt(e)});let Qh=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return zh(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new To(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new To(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Qh.create=(t,e)=>new Qh({innerType:t,typeName:Pt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Gt(e)});let _v=class extends nn{_parse(e){if(this._getType(e)!==pt.nan){const r=this._getOrReturnCtx(e);return ot(r,{code:He.invalid_type,expected:pt.nan,received:r.parsedType}),Lt}return{status:"valid",value:e.data}}};_v.create=t=>new _v({typeName:Pt.ZodNaN,...Gt(t)});const NX=Symbol("zod_brand");let E2=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},R2=class ZP extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Lt:i.status==="dirty"?(n.dirty(),Dd(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Lt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new ZP({in:e,out:n,typeName:Pt.ZodPipeline})}},Jh=class extends nn{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Lh(s)&&(s.value=Object.freeze(s.value)),s);return zh(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}};Jh.create=(t,e)=>new Jh({innerType:t,typeName:Pt.ZodReadonly,...Gt(e)});function KP(t,e={},n){return t?lp.create().superRefine((r,s)=>{var i,l;if(!t(r)){const u=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,p=(l=(i=u.fatal)!==null&&i!==void 0?i:n)!==null&&l!==void 0?l:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):lp.create()}const FX={object:to.lazycreate};var Pt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Pt||(Pt={}));const BX=(t,e={message:`Input not instance of ${t.name}`})=>KP(n=>n instanceof t,e),QP=ap.create,JP=$h.create,UX=_v.create,VX=Nh.create,YP=Fh.create,HX=Bh.create,WX=kv.create,qX=Uh.create,GX=Vh.create,ZX=lp.create,KX=du.create,QX=Ga.create,JX=Mv.create,YX=vu.create,XX=to.create,eee=to.strictCreate,tee=Hh.create,nee=Hx.create,ree=Wh.create,see=ac.create,iee=qP.create,oee=Ov.create,aee=Av.create,lee=zd.create,cee=qh.create,uee=Gh.create,dee=Am.create,pee=Zh.create,fee=cp.create,eO=ko.create,hee=Zo.create,mee=lc.create,gee=ko.createWithPreprocess,yee=R2.create,vee=()=>QP().optional(),xee=()=>JP().optional(),bee=()=>YP().optional(),See={string:(t=>ap.create({...t,coerce:!0})),number:(t=>$h.create({...t,coerce:!0})),boolean:(t=>Fh.create({...t,coerce:!0})),bigint:(t=>Nh.create({...t,coerce:!0})),date:(t=>Bh.create({...t,coerce:!0}))},Cee=Lt;var Tr=Object.freeze({__proto__:null,defaultErrorMap:op,setErrorMap:CX,getErrorMap:Dv,makeIssue:Ev,EMPTY_PATH:wX,addIssueToContext:ot,ParseStatus:ni,INVALID:Lt,DIRTY:Dd,OK:zs,isAborted:_C,isDirty:IC,isValid:Lh,isAsync:zh,get util(){return xn},get objectUtil(){return AC},ZodParsedType:pt,getParsedType:Ml,ZodType:nn,datetimeRegex:VP,ZodString:ap,ZodNumber:$h,ZodBigInt:Nh,ZodBoolean:Fh,ZodDate:Bh,ZodSymbol:kv,ZodUndefined:Uh,ZodNull:Vh,ZodAny:lp,ZodUnknown:du,ZodNever:Ga,ZodVoid:Mv,ZodArray:vu,ZodObject:to,ZodUnion:Hh,ZodDiscriminatedUnion:Hx,ZodIntersection:Wh,ZodTuple:ac,ZodRecord:qP,ZodMap:Ov,ZodSet:Av,ZodFunction:zd,ZodLazy:qh,ZodLiteral:Gh,ZodEnum:Am,ZodNativeEnum:Zh,ZodPromise:cp,ZodEffects:ko,ZodTransformer:ko,ZodOptional:Zo,ZodNullable:lc,ZodDefault:Kh,ZodCatch:Qh,ZodNaN:_v,BRAND:NX,ZodBranded:E2,ZodPipeline:R2,ZodReadonly:Jh,custom:KP,Schema:nn,ZodSchema:nn,late:FX,get ZodFirstPartyTypeKind(){return Pt},coerce:See,any:ZX,array:YX,bigint:VX,boolean:YP,date:HX,discriminatedUnion:nee,effect:eO,enum:dee,function:lee,instanceof:BX,intersection:ree,lazy:cee,literal:uee,map:oee,nan:UX,nativeEnum:pee,never:QX,null:GX,nullable:mee,number:JP,object:XX,oboolean:bee,onumber:xee,optional:hee,ostring:vee,pipeline:yee,preprocess:gee,promise:fee,record:iee,set:aee,strictObject:eee,string:QP,symbol:WX,transformer:eO,tuple:see,undefined:qX,union:tee,unknown:KX,void:JX,NEVER:Cee,ZodIssueCode:He,quotelessJson:SX,ZodError:To});function no({items:t,dropdown:e}){var f;const[n,r]=b.useState(null),s=!!n,i=m=>{r(m.currentTarget)},l=()=>{r(null)},u=m=>{e==null||e.onChange(m),l()},p=(f=e==null?void 0:e.options.find(m=>m.value===e.value))==null?void 0:f.label;return a.jsxs(a.Fragment,{children:[a.jsxs(k7,{"data-component-name":"cmp:Breadcrumb",separator:a.jsx(lY,{fontSize:"small"}),sx:{mb:2},children:[a.jsx(B,{component:gs,to:"/",sx:{display:"flex",alignItems:"center",textDecoration:"none",color:"text.secondary","&:hover":{color:"primary.main"}},children:a.jsx(SP,{fontSize:"small"})}),t.map(m=>m.to?a.jsx(B,{component:gs,to:m.to,sx:{textDecoration:"none",color:"text.secondary","&:hover":{color:"primary.main",textDecoration:"underline"}},children:m.label},m.label):a.jsx(G,{color:"text.secondary",children:m.label},m.label)),e&&a.jsx(pe,{"data-component-name":"cmp:BreadcrumbDropdown",onClick:i,endIcon:a.jsx(pJ,{}),sx:{textTransform:"none",color:"text.secondary",minWidth:"auto",p:0,"&:hover":{bgcolor:"transparent",color:"primary.main"}},children:p})]}),e&&a.jsx(Cp,{anchorEl:n,open:s,onClose:l,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:e.options.map(m=>a.jsx(nt,{selected:m.value===e.value,onClick:()=>u(m.value),children:m.label},m.value))})]})}function la({title:t,titleNode:e,titleSx:n,actions:r,mb:s=3}){return a.jsxs(B,{"data-component-name":"cmp:PageHeader",sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",sm:"center"},gap:2,mb:s},children:[e??a.jsx(G,{variant:"h5",component:"h1",sx:n,children:t}),r&&a.jsx(B,{sx:{display:"flex",gap:2,flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center"},children:r})]})}function Dp({title:t,icon:e,onClose:n,actions:r,componentName:s}){return a.jsxs(B,{"data-component-name":s,sx:{display:"flex",alignItems:"center",gap:1,p:2,borderBottom:1,borderColor:"divider",flexShrink:0},children:[a.jsx(ft,{onClick:n,edge:"start",size:"small",children:a.jsx(xP,{})}),e,a.jsx(G,{variant:"h6",sx:{flex:1},children:t}),r]})}function wee(){return Fs(t=>({dialogMode:null,editingUser:null,deleteDialogOpen:!1,deleteTargetUser:null,formData:{githubUsername:"",displayName:"",selectedTemplate:"viewer",permissions:Ih("viewer"),allowPersonalBranch:!0},validationErrors:[],isSaving:!1,isDeleting:!1,snackbar:{open:!1,message:"",severity:"success"},isFormDirty:!1,closeConfirmDialogOpen:!1,setDialogMode:e=>t({dialogMode:e}),setEditingUser:e=>t({editingUser:e}),setDeleteDialogOpen:e=>t({deleteDialogOpen:e}),setDeleteTargetUser:e=>t({deleteTargetUser:e}),setFormData:e=>t(n=>({formData:{...n.formData,...e}})),setValidationErrors:e=>t({validationErrors:e}),setSaving:e=>t({isSaving:e}),setDeleting:e=>t({isDeleting:e}),setSnackbar:e=>t({snackbar:e}),setFormDirty:e=>t({isFormDirty:e}),setCloseConfirmDialogOpen:e=>t({closeConfirmDialogOpen:e})}))}class jee{constructor(){St(this,"store",wee());St(this,"cachedState",null);St(this,"cachedStoreState",null)}getState(){const e=this.store.getState();return this.cachedStoreState===e&&this.cachedState!==null?this.cachedState:(this.cachedStoreState=e,this.cachedState={dialogMode:e.dialogMode,editingUser:e.editingUser,deleteDialogOpen:e.deleteDialogOpen,deleteTargetUser:e.deleteTargetUser,formData:e.formData,validationErrors:e.validationErrors,isSaving:e.isSaving,isDeleting:e.isDeleting,snackbar:e.snackbar,isFormDirty:e.isFormDirty,closeConfirmDialogOpen:e.closeConfirmDialogOpen},this.cachedState)}openAddDialog(){this.store.getState().setFormData({githubUsername:"",displayName:"",selectedTemplate:"viewer",permissions:Ih("viewer"),allowPersonalBranch:!0}),this.store.getState().setValidationErrors([]),this.store.getState().setFormDirty(!1),this.store.getState().setDialogMode("add")}openEditDialog(e){this.store.getState().setEditingUser(e);const n=g2(e),r=e.permissions??Ih("viewer");this.store.getState().setFormData({githubUsername:e.githubUsername,displayName:e.displayName,selectedTemplate:n,permissions:r,allowPersonalBranch:e.allowPersonalBranch!==!1}),this.store.getState().setValidationErrors([]),this.store.getState().setFormDirty(!1),this.store.getState().setDialogMode("edit")}closeDialog(){this.store.getState().setDialogMode(null),this.store.getState().setEditingUser(null),this.store.getState().setValidationErrors([]),this.store.getState().setFormDirty(!1),this.store.getState().setCloseConfirmDialogOpen(!1)}openDeleteDialog(e){this.store.getState().setDeleteTargetUser(e),this.store.getState().setDeleteDialogOpen(!0)}closeDeleteDialog(){this.store.getState().setDeleteDialogOpen(!1),this.store.getState().setDeleteTargetUser(null)}setFormField(e,n){this.store.getState().setFormData({[e]:n}),this.store.getState().setFormDirty(!0)}setPermission(e,n){const r=this.store.getState().formData.permissions;this.store.getState().setFormData({permissions:{...r,[e]:n}}),this.store.getState().setFormDirty(!0)}setValidationErrors(e){this.store.getState().setValidationErrors(e)}clearValidationErrors(){this.store.getState().setValidationErrors([])}setSaving(e){this.store.getState().setSaving(e)}setDeleting(e){this.store.getState().setDeleting(e)}showSnackbar(e,n){this.store.getState().setSnackbar({open:!0,message:e,severity:n})}hideSnackbar(){this.store.getState().setSnackbar({open:!1,message:"",severity:"success"})}setFormDirty(e){this.store.getState().setFormDirty(e)}openCloseConfirmDialog(){this.store.getState().setCloseConfirmDialogOpen(!0)}closeCloseConfirmDialog(){this.store.getState().setCloseConfirmDialogOpen(!1)}subscribe(e){return this.store.subscribe(e)}}const k2=new jee;class Tee{constructor(e){this.deps=e}getState(){const{repo:e,presenter:n,currentUsername:r}=this.deps,s=n.getState();return{users:e.getUsers(),isLoading:e.isLoading(),error:e.getError(),currentUsername:r,...s}}openAddDialog(){this.deps.presenter.openAddDialog()}openEditDialog(e){this.deps.presenter.openEditDialog(e)}closeDialog(){this.deps.presenter.closeDialog()}openDeleteDialog(e){this.deps.presenter.openDeleteDialog(e)}closeDeleteDialog(){this.deps.presenter.closeDeleteDialog()}setFormField(e,n){this.deps.presenter.setFormField(e,n)}setTemplate(e){const n=Ih(e);this.deps.presenter.setFormField("selectedTemplate",e),this.deps.presenter.setFormField("permissions",n)}setPermission(e,n){this.deps.presenter.setPermission(e,n);const s={...this.deps.presenter.getState().formData.permissions,[e]:n},i=_h(s);this.deps.presenter.setFormField("selectedTemplate",i)}async addUser(){const{repo:e,presenter:n}=this.deps,r=n.getState(),s=e.getUsers(),i={githubUsername:r.formData.githubUsername.trim(),displayName:r.formData.displayName.trim(),permissions:r.formData.permissions,allowPersonalBranch:r.formData.allowPersonalBranch},l=OM(i,s);if(l.length>0)return n.setValidationErrors(l),!1;n.setSaving(!0);try{const u=[...s,i];return await e.saveUsers(u),n.closeDialog(),n.showSnackbar("ユーザーを追加しました","success"),oe.info("UserListUseCase.addUser",{githubUsername:i.githubUsername}),!0}catch(u){return oe.error("UserListUseCase.addUser failed",{error:u}),n.showSnackbar("ユーザーの追加に失敗しました","error"),!1}finally{n.setSaving(!1)}}async updateUser(){const{repo:e,presenter:n}=this.deps,r=n.getState(),s=e.getUsers(),i=r.editingUser;if(!i)return!1;const l={githubUsername:r.formData.githubUsername.trim(),displayName:r.formData.displayName.trim(),permissions:r.formData.permissions,allowPersonalBranch:r.formData.allowPersonalBranch,isOwner:i.isOwner},u=OM(l,s,i.githubUsername);if(u.length>0)return n.setValidationErrors(u),!1;n.setSaving(!0);try{const p=s.map(f=>f.githubUsername===i.githubUsername?l:f);return await e.saveUsers(p),n.closeDialog(),n.showSnackbar("ユーザーを更新しました","success"),oe.info("UserListUseCase.updateUser",{githubUsername:l.githubUsername}),!0}catch(p){return oe.error("UserListUseCase.updateUser failed",{error:p}),n.showSnackbar("ユーザーの更新に失敗しました","error"),!1}finally{n.setSaving(!1)}}async deleteUser(){const{repo:e,presenter:n,currentUsername:r}=this.deps,s=n.getState(),i=e.getUsers(),l=s.deleteTargetUser;if(!l)return!1;if(!AM(l.githubUsername,r))return n.showSnackbar("自分自身は削除できません","error"),n.closeDeleteDialog(),!1;n.setDeleting(!0);try{const u=i.filter(p=>p.githubUsername!==l.githubUsername);return await e.saveUsers(u),n.closeDeleteDialog(),n.showSnackbar("ユーザーを削除しました","success"),oe.info("UserListUseCase.deleteUser",{githubUsername:l.githubUsername}),!0}catch(u){return oe.error("UserListUseCase.deleteUser failed",{error:u}),n.showSnackbar("ユーザーの削除に失敗しました","error"),!1}finally{n.setDeleting(!1)}}hideSnackbar(){this.deps.presenter.hideSnackbar()}getRoleTemplateLabel(e){const n=g2(e);return Tv(n)}canDelete(e){return AM(e.githubUsername,this.deps.currentUsername)}requestCloseDialog(){const{presenter:e}=this.deps;e.getState().isFormDirty?e.openCloseConfirmDialog():e.closeDialog()}cancelCloseDialog(){this.deps.presenter.closeCloseConfirmDialog()}discardAndCloseDialog(){this.deps.presenter.closeDialog()}}const Dee=t=>k2.subscribe(t),tO=()=>k2.getState(),nO="develop";function Eee(){const{authUseCase:t}=rr(),{token:e,githubUser:n,currentUser:r}=t.getState(),s=ys();b.useSyncExternalStore(Dee,tO,tO);const i=new uu({adminData:jn(uu.AdminDataQueryParams(e,nO))},Pn(uu.SaveAdminDataMutationParams(s,e,nO)));return{userListUseCase:new Tee({repo:i,presenter:k2,currentUsername:(n==null?void 0:n.login)??"",currentUser:r})}}const Ree=Tr.object({action:Tr.enum(["add","edit"]).optional(),user:Tr.string().optional()}),kee=Ss("/users/")({component:Mee,validateSearch:Ree});function Mee(){const{authUseCase:t}=rr(),{currentUser:e}=t.getState(),n=ur(),r=ws(e,"canViewUsers"),s=ws(e,"canEditUsers");return b.useEffect(()=>{e&&!r&&n({to:"/"})},[e,r,n]),r?a.jsx(Oee,{canEdit:s}):null}function Oee({canEdit:t}){const{userListUseCase:e}=Eee(),{simulationUseCase:n}=D2(),r=e.getState(),s=vr(),i=aa(s.breakpoints.down("sm")),l=ur(),u=Di({from:"/users/"}),{users:p,isLoading:f,error:m,dialogMode:g,formData:y,validationErrors:v,isSaving:C,deleteDialogOpen:S,deleteTargetUser:j,isDeleting:D,snackbar:M,currentUsername:T,editingUser:E,isFormDirty:k,closeConfirmDialogOpen:A}=r,O=[...p].sort((z,N)=>z.isOwner&&!N.isOwner?-1:!z.isOwner&&N.isOwner?1:z.githubUsername.localeCompare(N.githubUsername));b.useEffect(()=>{if(!f){if(!t){u.action&&l({to:"/users",search:{}});return}if(u.action==="add"&&g!=="add")e.openAddDialog();else if(u.action==="edit"&&u.user&&g!=="edit"){const z=O.find(N=>N.githubUsername===u.user);z&&e.openEditDialog(z)}else!u.action&&g!==null&&e.closeDialog()}},[u.action,u.user,f,O,g,e,t,l]);const I=()=>{l({to:"/users",search:{action:"add"}})},$=z=>{l({to:"/users",search:{action:"edit",user:z.githubUsername}})},R=()=>{k?e.requestCloseDialog():l({to:"/users",search:{}})},P=()=>{e.discardAndCloseDialog(),l({to:"/users",search:{}})};return f?a.jsx(B,{"data-component-name":"cmp:UserListPageLoading",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})}):m?a.jsx(B,{"data-component-name":"cmp:UserListPageError",sx:{flex:1,overflow:"auto"},children:a.jsx(ji,{maxWidth:"lg",sx:{py:3},children:a.jsxs(zt,{severity:"error",children:["エラー: ",m.message]})})}):a.jsxs(B,{"data-component-name":"cmp:UserListPage",sx:{flex:1,overflow:"auto"},children:[a.jsxs(ji,{maxWidth:"lg",sx:{py:3},children:[a.jsx(no,{items:[{label:"ユーザー管理"}]}),a.jsx(la,{title:"ユーザー管理",actions:t&&a.jsx(pe,{variant:"contained",startIcon:a.jsx(Qn,{}),onClick:I,children:"ユーザー追加"})}),a.jsxs(zt,{severity:"info",sx:{mb:3},children:["ここに追加するユーザーは",a.jsxs(Ox,{href:`https://github.com/${Qr()}`,target:"_blank",rel:"noopener noreferrer",children:["@",Qr()]}),"で、別途招待をする必要があります。"]}),O.length===0?a.jsx(zt,{severity:"info",children:"ユーザーが登録されていません"}):i?a.jsx(_ee,{users:O,currentUsername:T,userListUseCase:e,onEdit:$,canEdit:t}):a.jsx(Aee,{users:O,currentUsername:T,userListUseCase:e,onEdit:$,canEdit:t})]}),a.jsx(Iee,{open:g!==null,mode:g,formData:y,validationErrors:v,isSaving:C,isOwner:(E==null?void 0:E.isOwner)===!0,isSelf:(E==null?void 0:E.githubUsername)===T,simulationUseCase:n,onClose:R,onSave:async()=>{(g==="add"?await e.addUser():await e.updateUser())&&l({to:"/users",search:{}})},onFieldChange:(z,N)=>e.setFormField(z,N),onTemplateChange:z=>e.setTemplate(z),onPermissionChange:(z,N)=>e.setPermission(z,N)}),a.jsxs(Qt,{"data-component-name":"cmp:CloseConfirmDialog",open:A,onClose:()=>e.cancelCloseDialog(),children:[a.jsx(Yt,{children:"変更を破棄しますか?"}),a.jsx(Jt,{children:a.jsx(G,{children:"保存されていない変更があります。変更を破棄してもよろしいですか?"})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>e.cancelCloseDialog(),children:"キャンセル"}),a.jsx(pe,{variant:"contained",color:"error",onClick:P,children:"破棄"})]})]}),a.jsxs(Qt,{"data-component-name":"cmp:DeleteUserDialog",open:S,onClose:()=>e.closeDeleteDialog(),children:[a.jsx(Yt,{children:"ユーザーの削除"}),a.jsxs(Jt,{children:[a.jsxs(G,{children:[j==null?void 0:j.displayName,"(",j==null?void 0:j.githubUsername,")を削除しますか?"]}),a.jsx(G,{variant:"body2",color:"text.secondary",mt:1,children:"この操作は取り消せません。"})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>e.closeDeleteDialog(),children:"キャンセル"}),a.jsx(pe,{variant:"contained",color:"error",onClick:()=>e.deleteUser(),disabled:D,children:D?a.jsx(ut,{size:24}):"削除"})]})]}),a.jsx(ea,{open:M.open,autoHideDuration:4e3,onClose:()=>e.hideSnackbar(),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{onClose:()=>e.hideSnackbar(),severity:M.severity,sx:{width:"100%"},children:M.message})})]})}function Aee({users:t,currentUsername:e,userListUseCase:n,onEdit:r,canEdit:s}){return a.jsx($t,{"data-component-name":"cmp:UserTable",children:a.jsxs(wp,{children:[a.jsx(jm,{children:a.jsxs(eo,{children:[a.jsx(Kt,{children:"GitHub ユーザー名"}),a.jsx(Kt,{children:"表示名"}),a.jsx(Kt,{children:"ロール"}),a.jsx(Kt,{children:"個人ブランチ"}),s&&a.jsx(Kt,{width:"120px",children:"操作"})]})}),a.jsx(jp,{children:t.map(i=>a.jsxs(eo,{children:[a.jsxs(Kt,{children:[i.githubUsername,i.githubUsername===e&&a.jsx(Ht,{label:"自分",size:"small",sx:{ml:1}})]}),a.jsx(Kt,{children:i.displayName}),a.jsx(Kt,{children:a.jsx(XP,{user:i})}),a.jsx(Kt,{children:i.allowPersonalBranch!==!1?a.jsx(Ht,{label:"許可",color:"success",size:"small"}):a.jsx(Ht,{label:"不許可",size:"small"})}),s&&a.jsxs(Kt,{children:[a.jsx(ft,{size:"small",onClick:()=>r(i),title:"編集",children:a.jsx(Ri,{})}),a.jsx(ft,{size:"small",onClick:()=>n.openDeleteDialog(i),disabled:!n.canDelete(i),title:n.canDelete(i)?"削除":"自分自身は削除できません",children:a.jsx(zn,{})})]})]},i.githubUsername))})]})})}function _ee({users:t,currentUsername:e,userListUseCase:n,onEdit:r,canEdit:s}){return a.jsx(Ro,{"data-component-name":"cmp:UserCardList",spacing:2,children:t.map(i=>a.jsxs(Su,{"data-component-name":"cmp:UserCard",children:[a.jsxs(Sp,{sx:{pb:1},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[a.jsx(G,{variant:"subtitle1",fontWeight:"bold",children:i.displayName}),i.githubUsername===e&&a.jsx(Ht,{label:"自分",size:"small"})]}),a.jsxs(G,{variant:"body2",color:"text.secondary",sx:{mb:1},children:["@",i.githubUsername]}),a.jsxs(B,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:[a.jsx(XP,{user:i}),i.allowPersonalBranch!==!1?a.jsx(Ht,{label:"個人ブランチ許可",color:"success",size:"small"}):a.jsx(Ht,{label:"個人ブランチ不許可",size:"small"})]})]}),s&&a.jsxs(s2,{children:[a.jsx(pe,{size:"small",startIcon:a.jsx(Ri,{}),onClick:()=>r(i),children:"編集"}),a.jsx(pe,{size:"small",color:"error",startIcon:a.jsx(zn,{}),onClick:()=>n.openDeleteDialog(i),disabled:!n.canDelete(i),children:"削除"})]})]},i.githubUsername))})}function XP({user:t}){const e=g2(t),n=()=>{switch(e){case"owner":return"error";case"admin":return"error";case"developer":return"warning";case"editor":return"primary";case"viewer":return"default";case"custom":default:return"success"}},r=Tv(e);return a.jsx(Ht,{label:r,color:n(),size:"small"})}function Iee({open:t,mode:e,formData:n,validationErrors:r,isSaving:s,isOwner:i,isSelf:l,simulationUseCase:u,onClose:p,onSave:f,onFieldChange:m,onTemplateChange:g,onPermissionChange:y}){const v=j=>{var D;return(D=r.find(M=>M.field===j))==null?void 0:D.message},C=()=>{u.startSimulation(n.permissions,n.selectedTemplate,n.displayName,n.githubUsername),p(),setTimeout(()=>{const j=document.querySelector('[data-testid="avatar-menu-button"]');j==null||j.click()},100)},S=e==="edit"&&!l;return a.jsxs(Cu,{anchor:"right",open:t,onClose:p,"data-component-name":"cmp:UserEditDrawer",PaperProps:{sx:{width:{xs:"100vw",sm:480},maxWidth:"100vw",display:"flex",flexDirection:"column"}},children:[a.jsx(Dp,{title:e==="add"?"ユーザー追加":"ユーザー編集",icon:a.jsx(Mm,{color:"action"}),onClose:p,actions:a.jsxs(B,{sx:{display:"flex",gap:1},children:[S&&a.jsx(pe,{variant:"outlined",color:"info",onClick:C,size:"small",startIcon:a.jsx(_P,{}),children:"UI再現"}),a.jsx(pe,{variant:"contained",onClick:f,disabled:s,size:"small",children:s?a.jsx(ut,{size:20}):"保存"})]}),componentName:"cmp:UserEditDrawerHeader"}),a.jsxs(B,{"data-component-name":"cmp:UserEditDrawerContent",sx:{flex:1,overflow:"auto",p:2,display:"flex",flexDirection:"column",gap:2},children:[a.jsx(Xe,{label:"GitHub ユーザー名",value:n.githubUsername,onChange:j=>m("githubUsername",j.target.value),error:!!v("githubUsername"),helperText:v("githubUsername"),disabled:e==="edit",fullWidth:!0,required:!0}),a.jsx(Xe,{label:"表示名",value:n.displayName,onChange:j=>m("displayName",j.target.value),error:!!v("displayName"),helperText:v("displayName"),fullWidth:!0,required:!0}),a.jsxs(_n,{fullWidth:!0,error:!!v("selectedTemplate"),disabled:i,children:[a.jsx(nr,{required:!0,children:"ロール"}),a.jsxs(wn,{value:n.selectedTemplate,label:"ロール",onChange:j=>g(j.target.value),children:[i&&a.jsx(nt,{value:"owner",children:"所有者"}),a.jsx(nt,{value:"admin",children:"管理者"}),a.jsx(nt,{value:"developer",children:"開発者"}),a.jsx(nt,{value:"editor",children:"編集者"}),a.jsx(nt,{value:"viewer",children:"閲覧者"}),a.jsx(nt,{value:"custom",children:"カスタム"})]}),i&&a.jsx(Dh,{children:"所有者のロールは変更できません"}),v("selectedTemplate")&&a.jsx(Dh,{children:v("selectedTemplate")})]}),a.jsx(Pee,{permissions:i?Cv:n.permissions,onPermissionChange:y,disabled:i}),a.jsx(_r,{control:a.jsx(Ax,{checked:n.allowPersonalBranch,onChange:j=>m("allowPersonalBranch",j.target.checked)}),label:"個人ブランチの使用を許可"})]})]})}function Pee({permissions:t,onPermissionChange:e,disabled:n}){const r=(s,i)=>{if(e(s,i),i){const l=Sv.find(u=>u.edit===s);l&&e(l.view,!0)}if(!i){const l=Sv.find(u=>u.view===s);l&&e(l.edit,!1)}};return a.jsx(B,{"data-component-name":"cmp:PermissionEditor",sx:{px:2},children:a.jsx(Ro,{spacing:2,children:Object.entries(uP).map(([s,i])=>a.jsxs(B,{children:[a.jsx(G,{variant:"subtitle2",color:"text.secondary",sx:{mb:.5},children:i.label}),a.jsx(B,{sx:{display:"flex",flexDirection:"column",ml:2,gap:.5},children:i.pairs.map(l=>a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(G,{variant:"body2",sx:{minWidth:100},children:dP[l.view]}),a.jsx(_r,{control:a.jsx(es,{checked:t[l.view],onChange:u=>r(l.view,u.target.checked),size:"small",disabled:n}),label:"閲覧",sx:{mr:0}}),a.jsx(_r,{control:a.jsx(es,{checked:t[l.edit],onChange:u=>r(l.edit,u.target.checked),size:"small",disabled:n}),label:"編集",sx:{mr:0}})]},l.view))})]},s))})})}function M2(t){return[".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico"].some(n=>t.toLowerCase().endsWith(n))}function Lee(t){const e=zee(t).toLowerCase();return{".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".bmp":"image/bmp",".ico":"image/x-icon"}[e]??"application/octet-stream"}function O2(t){const e=[".html",".htm",".css",".js",".ts",".jsx",".tsx",".json",".xml",".svg",".md",".txt",".yaml",".yml",".toml",".ini",".conf",".sh",".bat",".ps1",".gitignore",".gitkeep",".env"],n=t.toLowerCase();return e.some(r=>n.endsWith(r))}function zee(t){const e=t.lastIndexOf(".");return e>0?t.slice(e):""}class Cl{constructor(e,n,r,s,i,l,u,p,f,m,g){this.token=e,this.basePath=n,this.branch=r,this.rootQuery=s,this.fileQuery=i,this.saveMutation=l,this.deleteMutation=u,this.deleteDirectoryMutation=p,this.uploadMutation=f,this.createFolderMutation=m,this.queryClient=g}static RootEntriesQueryParams(e,n,r){return{queryKey:["fileManager","root",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return(await new At(e).listDirectoryEntries(n,r)).map(l=>({name:l.name,path:`${n}/${l.name}`,type:l.type==="tree"?"directory":"file"}))},enabled:!!e}}static FileContentQueryParams(e,n,r){return{queryKey:["fileManager","file",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");if(!n)return null;const s=new At(e),i=n.split("/").pop()??"";return M2(i)?s.fetchFileBase64OrNull(n,r):s.fetchFileOrNull(n,r)},enabled:!!e&&!!n}}static SaveFileMutationParams(e,n,r){return{mutationFn:async({path:s,content:i})=>{if(!n)throw new Error("Not authenticated");const l=new At(n),u=s.split("/").pop()??"file";await l.commitFiles(`テンプレート更新: ${u}`,[{path:s,content:i}],r)},onSuccess:(s,i)=>{e.invalidateQueries({queryKey:["fileManager","file",i.path,r]})}}}static DeleteFileMutationParams(e,n,r,s){return{mutationFn:async i=>{if(!n)throw new Error("Not authenticated");const l=new At(n),u=i.split("/").pop()??"file";await l.commitFiles(`テンプレート削除: ${u}`,[{path:i,content:"",delete:!0}],s)},onSuccess:()=>{e.invalidateQueries({queryKey:["fileManager","root",r,s]}),e.invalidateQueries({queryKey:["fileManager","directory"]})}}}static DeleteDirectoryMutationParams(e,n,r,s){return{mutationFn:async i=>{if(!n)throw new Error("Not authenticated");const l=new At(n),u=await e5(l,i,s);if(u.length===0)return;const p=i.split("/").pop()??"folder";await l.commitFiles(`テンプレートフォルダ削除: ${p}`,u.map(f=>({path:f,content:"",delete:!0})),s)},onSuccess:()=>{e.invalidateQueries({queryKey:["fileManager","root",r,s]}),e.invalidateQueries({queryKey:["fileManager","directory"]})}}}static UploadFileMutationParams(e,n,r,s){return{mutationFn:async({targetDir:i,fileName:l,content:u})=>{if(!n)throw new Error("Not authenticated");const p=new At(n),f=`${i}/${l}`;await p.commitFiles(`テンプレートアップロード: ${l}`,[{path:f,content:u}],s)},onSuccess:()=>{e.invalidateQueries({queryKey:["fileManager","root",r,s]}),e.invalidateQueries({queryKey:["fileManager","directory"]})}}}static CreateFolderMutationParams(e,n,r,s){return{mutationFn:async({targetDir:i,folderName:l})=>{if(!n)throw new Error("Not authenticated");const u=new At(n),p=`${i}/${l}/.gitkeep`;await u.commitFiles(`テンプレートフォルダ作成: ${l}`,[{path:p,content:""}],s)},onSuccess:()=>{e.invalidateQueries({queryKey:["fileManager","root",r,s]}),e.invalidateQueries({queryKey:["fileManager","directory"]})}}}getRootEntries(){return this.rootQuery.data??[]}isRootLoading(){return this.rootQuery.isLoading}getRootError(){return this.rootQuery.error??null}getFileContent(){return this.fileQuery.data??null}isFileLoading(){return this.fileQuery.isLoading}getFileError(){return this.fileQuery.error??null}async fetchDirectoryEntries(e){if(!this.token)throw new Error("Not authenticated");return(await new At(this.token).listDirectoryEntries(e,this.branch)).map(s=>({name:s.name,path:`${e}/${s.name}`,type:s.type==="tree"?"directory":"file"}))}async saveFile(e,n){await this.saveMutation.mutateAsync({path:e,content:n})}async deleteFile(e){await this.deleteMutation.mutateAsync(e)}async deleteDirectory(e){await this.deleteDirectoryMutation.mutateAsync(e)}async uploadFile(e,n,r){await this.uploadMutation.mutateAsync({targetDir:e,fileName:n,content:r})}async createFolder(e,n){await this.createFolderMutation.mutateAsync({targetDir:e,folderName:n})}isSaving(){return this.saveMutation.isPending}isDeleting(){return this.deleteMutation.isPending||this.deleteDirectoryMutation.isPending}invalidateRoot(){this.queryClient.invalidateQueries({queryKey:["fileManager","root",this.basePath,this.branch]})}invalidateFile(){this.queryClient.invalidateQueries({queryKey:["fileManager","file"]})}invalidateDirectory(e){this.queryClient.invalidateQueries({queryKey:["fileManager","directory",e,this.branch]})}}async function e5(t,e,n){const r=await t.listDirectoryEntries(e,n),s=[];for(const i of r){const l=`${e}/${i.name}`;if(i.type==="blob")s.push(l);else{const u=await e5(t,l,n);s.push(...u)}}return s}function $ee(){return Fs((t,e)=>({targetId:"templates",expandedPaths:[],directoryContentsEntries:[],selectedPath:null,editContent:"",originalContent:"",deleteDialogOpen:!1,deleteTarget:null,uploadDialogOpen:!1,uploadTargetDir:"",createFolderDialogOpen:!1,createFolderTargetDir:"",isUploading:!1,uploadError:null,isSaving:!1,saveError:null,setTargetId:n=>t({targetId:n,expandedPaths:[],directoryContentsEntries:[],selectedPath:null,editContent:"",originalContent:""}),toggleExpand:n=>{const r=e().expandedPaths,s=r.includes(n);t({expandedPaths:s?r.filter(i=>i!==n):[...r,n]})},setExpandedPaths:n=>t({expandedPaths:n}),setDirectoryContents:(n,r)=>{const s=e().directoryContentsEntries,i=s.findIndex(([l])=>l===n);if(i>=0){const l=[...s];l[i]=[n,r],t({directoryContentsEntries:l})}else t({directoryContentsEntries:[...s,[n,r]]})},clearDirectoryContents:()=>t({directoryContentsEntries:[]}),removeDirectoryContents:n=>{const r=e().directoryContentsEntries;t({directoryContentsEntries:r.filter(([s])=>s!==n)})},setSelectedPath:n=>t({selectedPath:n}),setEditContent:n=>t({editContent:n}),setOriginalContent:n=>t({originalContent:n}),setDeleteDialogOpen:n=>t({deleteDialogOpen:n}),setDeleteTarget:n=>t({deleteTarget:n}),setUploadDialogOpen:n=>t({uploadDialogOpen:n}),setUploadTargetDir:n=>t({uploadTargetDir:n}),setCreateFolderDialogOpen:n=>t({createFolderDialogOpen:n}),setCreateFolderTargetDir:n=>t({createFolderTargetDir:n}),setUploading:n=>t({isUploading:n}),setUploadError:n=>t({uploadError:n}),setSaving:n=>t({isSaving:n}),setSaveError:n=>t({saveError:n})}))}class Nee{constructor(){St(this,"store",$ee());St(this,"cachedStoreState",null);St(this,"cachedState",null)}getState(){const e=this.store.getState();return this.cachedStoreState===e&&this.cachedState!==null?this.cachedState:(this.cachedStoreState=e,this.cachedState={targetId:e.targetId,expandedPaths:new Set(e.expandedPaths),directoryContents:new Map(e.directoryContentsEntries),selectedPath:e.selectedPath,editContent:e.editContent,originalContent:e.originalContent,deleteDialogOpen:e.deleteDialogOpen,deleteTarget:e.deleteTarget,uploadDialogOpen:e.uploadDialogOpen,uploadTargetDir:e.uploadTargetDir,createFolderDialogOpen:e.createFolderDialogOpen,createFolderTargetDir:e.createFolderTargetDir,isUploading:e.isUploading,uploadError:e.uploadError,isSaving:e.isSaving,saveError:e.saveError},this.cachedState)}setTargetId(e){this.store.getState().setTargetId(e)}toggleExpand(e){this.store.getState().toggleExpand(e)}setExpandedPaths(e){this.store.getState().setExpandedPaths([...e])}setDirectoryContents(e,n){this.store.getState().setDirectoryContents(e,n)}clearDirectoryContents(){this.store.getState().clearDirectoryContents()}removeDirectoryContents(e){this.store.getState().removeDirectoryContents(e)}setSelectedPath(e){this.store.getState().setSelectedPath(e)}setEditContent(e){this.store.getState().setEditContent(e)}setOriginalContent(e){this.store.getState().setOriginalContent(e)}openDeleteDialog(e,n){this.store.getState().setDeleteTarget({path:e,type:n}),this.store.getState().setDeleteDialogOpen(!0)}closeDeleteDialog(){this.store.getState().setDeleteDialogOpen(!1),this.store.getState().setDeleteTarget(null)}openUploadDialog(e){this.store.getState().setUploadTargetDir(e),this.store.getState().setUploadDialogOpen(!0)}closeUploadDialog(){this.store.getState().setUploadDialogOpen(!1),this.store.getState().setUploadTargetDir(""),this.store.getState().setUploadError(null)}openCreateFolderDialog(e){this.store.getState().setCreateFolderTargetDir(e),this.store.getState().setCreateFolderDialogOpen(!0)}closeCreateFolderDialog(){this.store.getState().setCreateFolderDialogOpen(!1),this.store.getState().setCreateFolderTargetDir("")}setUploading(e){this.store.getState().setUploading(e)}setUploadError(e){this.store.getState().setUploadError(e)}setSaving(e){this.store.getState().setSaving(e)}setSaveError(e){this.store.getState().setSaveError(e)}subscribe(e){return this.store.subscribe(e)}}const Iv=new Nee;class Fee{constructor(e){this.deps=e}getState(){const e=this.deps.presenter.getState(),n=this.deps.repo.getRootEntries(),r=this.findEntry(e.selectedPath,n,e.directoryContents),s=this.deps.repo.getFileContent(),i=(r==null?void 0:r.type)==="file"&&O2(r.name),l=!this.deps.isAuthInitialized||this.deps.repo.isRootLoading();return{targetId:e.targetId,targets:TC,branch:this.deps.branch,rootEntries:n,isRootLoading:l,rootError:this.deps.repo.getRootError(),expandedPaths:e.expandedPaths,directoryContents:e.directoryContents,selectedPath:e.selectedPath,selectedEntry:r,fileContent:s,isFileLoading:this.deps.repo.isFileLoading(),fileError:this.deps.repo.getFileError(),editContent:e.editContent,originalContent:e.originalContent,isDirty:e.editContent!==e.originalContent,canEdit:i,deleteDialogOpen:e.deleteDialogOpen,deleteTarget:e.deleteTarget,uploadDialogOpen:e.uploadDialogOpen,uploadTargetDir:e.uploadTargetDir,createFolderDialogOpen:e.createFolderDialogOpen,createFolderTargetDir:e.createFolderTargetDir,isUploading:e.isUploading,uploadError:e.uploadError,isSaving:this.deps.repo.isSaving()||e.isSaving,saveError:e.saveError,isDeleting:this.deps.repo.isDeleting(),hasEditPermission:this.deps.hasEditPermission}}changeTarget(e){this.deps.presenter.setTargetId(e),this.deps.presenter.clearDirectoryContents()}async toggleExpand(e){if(this.deps.presenter.getState().expandedPaths.has(e)){this.deps.presenter.toggleExpand(e);return}this.deps.presenter.setDirectoryContents(e,{entries:[],isLoading:!0,error:null}),this.deps.presenter.toggleExpand(e);try{const s=await this.deps.repo.fetchDirectoryEntries(e);this.deps.presenter.setDirectoryContents(e,{entries:s,isLoading:!1,error:null})}catch(s){oe.error("Failed to fetch directory entries",{path:e,error:s}),this.deps.presenter.setDirectoryContents(e,{entries:[],isLoading:!1,error:s})}}selectFile(e){this.getState().isDirty,this.deps.presenter.setSelectedPath(e),this.deps.presenter.setEditContent(""),this.deps.presenter.setOriginalContent(""),this.deps.navigateToFile(e)}clearSelection(){this.deps.presenter.setSelectedPath(null),this.deps.presenter.setEditContent(""),this.deps.presenter.setOriginalContent(""),this.deps.navigateToFile(void 0)}onFileContentLoaded(e){this.deps.presenter.setOriginalContent(e),this.deps.presenter.setEditContent(e)}updateContent(e){this.deps.presenter.setEditContent(e)}async save(){const e=this.getState();if(!(!e.selectedPath||!e.isDirty)){this.deps.presenter.setSaving(!0),this.deps.presenter.setSaveError(null);try{await this.deps.repo.saveFile(e.selectedPath,e.editContent),this.deps.presenter.setOriginalContent(e.editContent),oe.info("File saved",{path:e.selectedPath})}catch(n){oe.error("Failed to save file",{path:e.selectedPath,error:n}),this.deps.presenter.setSaveError(n instanceof Error?n.message:"保存に失敗しました")}finally{this.deps.presenter.setSaving(!1)}}}openDeleteDialog(e,n){this.deps.presenter.openDeleteDialog(e,n)}closeDeleteDialog(){this.deps.presenter.closeDeleteDialog()}async confirmDelete(){const e=this.getState();if(e.deleteTarget)try{if(e.deleteTarget.type==="directory"){await this.deps.repo.deleteDirectory(e.deleteTarget.path);const n=new Set(e.expandedPaths);for(const r of n)r.startsWith(e.deleteTarget.path)&&n.delete(r);this.deps.presenter.setExpandedPaths(n),this.deps.presenter.removeDirectoryContents(e.deleteTarget.path)}else await this.deps.repo.deleteFile(e.deleteTarget.path);e.selectedPath===e.deleteTarget.path&&this.clearSelection(),oe.info("Deleted",{path:e.deleteTarget.path,type:e.deleteTarget.type})}catch(n){throw oe.error("Failed to delete",{...e.deleteTarget,error:n}),n}finally{this.closeDeleteDialog()}}openUploadDialog(e){this.deps.presenter.openUploadDialog(e)}closeUploadDialog(){this.deps.presenter.closeUploadDialog()}async uploadFile(e){const n=this.getState();if(n.uploadTargetDir){this.deps.presenter.setUploading(!0),this.deps.presenter.setUploadError(null);try{const r=await Bee(e);if(await this.deps.repo.uploadFile(n.uploadTargetDir,e.name,r),oe.info("File uploaded",{targetDir:n.uploadTargetDir,fileName:e.name}),n.directoryContents.has(n.uploadTargetDir)){const s=await this.deps.repo.fetchDirectoryEntries(n.uploadTargetDir);this.deps.presenter.setDirectoryContents(n.uploadTargetDir,{entries:s,isLoading:!1,error:null})}this.closeUploadDialog()}catch(r){oe.error("Failed to upload file",{error:r}),this.deps.presenter.setUploadError(r instanceof Error?r.message:"アップロードに失敗しました")}finally{this.deps.presenter.setUploading(!1)}}}openCreateFolderDialog(e){this.deps.presenter.openCreateFolderDialog(e)}closeCreateFolderDialog(){this.deps.presenter.closeCreateFolderDialog()}async createFolder(e){const n=this.getState();if(!(!n.createFolderTargetDir||!e))try{if(await this.deps.repo.createFolder(n.createFolderTargetDir,e),oe.info("Folder created",{targetDir:n.createFolderTargetDir,folderName:e}),n.directoryContents.has(n.createFolderTargetDir)){const r=await this.deps.repo.fetchDirectoryEntries(n.createFolderTargetDir);this.deps.presenter.setDirectoryContents(n.createFolderTargetDir,{entries:r,isLoading:!1,error:null})}this.closeCreateFolderDialog()}catch(r){throw oe.error("Failed to create folder",{error:r}),r}}findEntry(e,n,r){if(!e)return null;for(const s of n)if(s.path===e)return s;for(const s of r.values())for(const i of s.entries)if(i.path===e)return i;return null}}function Bee(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>n(r.error),r.readAsText(t)})}const Uee=t=>Iv.subscribe(t),rO=()=>Iv.getState();function Vee(){const{authUseCase:t}=rr(),{branchUseCase:e}=Ei(),n=t.getState(),{token:r,isInitialized:s,currentUser:i}=n,l=(e==null?void 0:e.getCurrentBranch())??"develop",u=ys(),p=ws(i,"canEditTemplates"),f=Di({from:"/templates/"}),m=ur(),g=P=>{m({to:"/templates",search:P?{file:P}:{},replace:!0})},y=b.useSyncExternalStore(Uee,rO,rO),v=b.useMemo(()=>{const P=TC.find(z=>z.id===y.targetId);return(P==null?void 0:P.path)??TC[0].path},[y.targetId]),C=jn(Cl.RootEntriesQueryParams(r,v,l)),S=jn(Cl.FileContentQueryParams(r,y.selectedPath,l)),j=Pn(Cl.SaveFileMutationParams(u,r,l)),D=Pn(Cl.DeleteFileMutationParams(u,r,v,l)),M=Pn(Cl.DeleteDirectoryMutationParams(u,r,v,l)),T=Pn(Cl.UploadFileMutationParams(u,r,v,l)),E=Pn(Cl.CreateFolderMutationParams(u,r,v,l)),k=new Cl(r,v,l,C,S,j,D,M,T,E,u),A=new Fee({repo:k,presenter:Iv,basePath:v,branch:l,isAuthInitialized:s,navigateToFile:g,hasEditPermission:p}),O=k.getFileContent(),I=b.useRef(null),$=b.useRef(null);b.useEffect(()=>{(y.selectedPath!==$.current||O!==null&&I.current===null)&&O!==null&&A.onFileContentLoaded(O),I.current=O,$.current=y.selectedPath},[O,y.selectedPath,A]);const R=b.useRef(!1);return b.useEffect(()=>{!R.current&&f.file&&!y.selectedPath&&(Iv.setSelectedPath(f.file),R.current=!0)},[f.file,y.selectedPath]),{templateUseCase:A}}function sO({useCase:t,state:e}){return a.jsxs($t,{"data-component-name":"cmp:TemplateTreePanel",sx:{height:"100%",display:"flex",flexDirection:"column"},children:[a.jsxs(B,{"data-component-name":"cmp:TemplateTreeHeader",sx:{p:2,borderBottom:1,borderColor:"divider"},children:[a.jsxs(_n,{fullWidth:!0,size:"small",sx:{mb:1},children:[a.jsx(nr,{children:"対象フォルダ"}),a.jsx(wn,{value:e.targetId,label:"対象フォルダ",onChange:n=>t.changeTarget(n.target.value),children:e.targets.map(n=>a.jsx(nt,{value:n.id,children:a.jsxs(B,{children:[a.jsx(G,{variant:"body1",children:n.label}),a.jsx(G,{variant:"caption",color:"text.secondary",children:n.path})]})},n.id))})]}),e.hasEditPermission&&a.jsxs(B,{sx:{display:"flex",gap:1},children:[a.jsx(Er,{title:"フォルダを作成",children:a.jsx(ft,{size:"small",onClick:()=>{var n;return t.openCreateFolderDialog(((n=e.targets.find(r=>r.id===e.targetId))==null?void 0:n.path)??"")},children:a.jsx(C2,{})})}),a.jsx(Er,{title:"ファイルをアップロード",children:a.jsx(ft,{size:"small",onClick:()=>{var n;return t.openUploadDialog(((n=e.targets.find(r=>r.id===e.targetId))==null?void 0:n.path)??"")},children:a.jsx(Ti,{})})})]})]}),a.jsx(B,{"data-component-name":"cmp:TemplateTreeBody",sx:{flex:1,overflow:"auto",p:1},children:e.isRootLoading?a.jsx(B,{sx:{display:"flex",justifyContent:"center",p:3},children:a.jsx(ut,{size:24})}):e.rootError?a.jsxs(G,{color:"error",sx:{p:2},children:["読み込みエラー: ",e.rootError.message]}):e.rootEntries.length===0?a.jsx(G,{color:"text.secondary",sx:{p:2},children:"ファイルがありません"}):a.jsx(as,{dense:!0,disablePadding:!0,children:e.rootEntries.map(n=>a.jsx(t5,{entry:n,level:0,useCase:t,state:e},n.path))})}),a.jsx(Hee,{useCase:t,state:e}),a.jsx(Wee,{useCase:t,state:e})]})}function t5({entry:t,level:e,useCase:n,state:r}){const s=r.expandedPaths.has(t.path),i=r.selectedPath===t.path,l=t.type==="directory",u=r.directoryContents.get(t.path),[p,f]=b.useState(!1),m=()=>{l?n.toggleExpand(t.path):n.selectFile(t.path)};return a.jsxs(a.Fragment,{children:[a.jsx(Os,{disablePadding:!0,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),secondaryAction:p&&l&&r.hasEditPermission?a.jsxs(B,{sx:{display:"flex",gap:.5},children:[a.jsx(Er,{title:"サブフォルダを作成",children:a.jsx(ft,{size:"small",onClick:g=>{g.stopPropagation(),n.openCreateFolderDialog(t.path)},children:a.jsx(C2,{fontSize:"small"})})}),a.jsx(Er,{title:"ファイルをアップロード",children:a.jsx(ft,{size:"small",onClick:g=>{g.stopPropagation(),n.openUploadDialog(t.path)},children:a.jsx(Ti,{fontSize:"small"})})})]}):void 0,children:a.jsxs(os,{selected:i,onClick:m,sx:{pl:e*2+1},children:[l&&a.jsx(Un,{sx:{minWidth:24},children:s?a.jsx(Wr,{fontSize:"small"}):a.jsx(Jl,{fontSize:"small"})}),a.jsx(Un,{sx:{minWidth:32},children:l?s?a.jsx(FJ,{color:"primary"}):a.jsx(ic,{color:"primary"}):a.jsx(vc,{color:"action"})}),a.jsx(Zn,{primary:t.name,primaryTypographyProps:{noWrap:!0,sx:{fontSize:"0.875rem"}}})]})}),l&&a.jsx(Co,{in:s,timeout:"auto",unmountOnExit:!0,children:u!=null&&u.isLoading?a.jsx(B,{sx:{display:"flex",justifyContent:"center",py:1},children:a.jsx(ut,{size:16})}):u!=null&&u.error?a.jsx(G,{color:"error",sx:{pl:(e+1)*2+1,py:1,fontSize:"0.75rem"},children:"エラー"}):(u==null?void 0:u.entries.length)===0?a.jsx(G,{color:"text.secondary",sx:{pl:(e+1)*2+1,py:1,fontSize:"0.75rem"},children:"(空)"}):a.jsx(as,{dense:!0,disablePadding:!0,children:u==null?void 0:u.entries.map(g=>a.jsx(t5,{entry:g,level:e+1,useCase:n,state:r},g.path))})})]})}function Hee({useCase:t,state:e}){const[n,r]=b.useState(""),[s,i]=b.useState(!1),l=async()=>{if(n.trim()){i(!0);try{await t.createFolder(n.trim()),r("")}finally{i(!1)}}},u=()=>{t.closeCreateFolderDialog(),r("")};return a.jsxs(Qt,{"data-component-name":"cmp:CreateFolderDialog",open:e.createFolderDialogOpen,onClose:u,children:[a.jsx(Yt,{children:"フォルダを作成"}),a.jsxs(Jt,{children:[a.jsxs(G,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["作成先: ",e.createFolderTargetDir]}),a.jsx(Xe,{autoFocus:!0,fullWidth:!0,label:"フォルダ名",value:n,onChange:p=>r(p.target.value),onKeyDown:p=>{p.key==="Enter"&&n.trim()&&l()}})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:u,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:l,disabled:!n.trim()||s,children:s?a.jsx(ut,{size:20}):"作成"})]})]})}function Wee({useCase:t,state:e}){const[n,r]=b.useState(null),s=async()=>{n&&(await t.uploadFile(n),r(null))},i=()=>{t.closeUploadDialog(),r(null)};return a.jsxs(Qt,{"data-component-name":"cmp:UploadDialog",open:e.uploadDialogOpen,onClose:i,children:[a.jsx(Yt,{children:"ファイルをアップロード"}),a.jsxs(Jt,{children:[a.jsxs(G,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["アップロード先: ",e.uploadTargetDir]}),a.jsxs(pe,{variant:"outlined",component:"label",fullWidth:!0,children:["ファイルを選択",a.jsx("input",{type:"file",hidden:!0,onChange:l=>{var u;return r(((u=l.target.files)==null?void 0:u[0])??null)}})]}),n&&a.jsx(G,{sx:{mt:1},children:n.name}),e.uploadError&&a.jsx(G,{color:"error",sx:{mt:1},children:e.uploadError})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:i,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:s,disabled:!n||e.isUploading,children:e.isUploading?a.jsx(ut,{size:20}):"アップロード"})]})]})}function iO({useCase:t,state:e,showHeader:n=!0}){if(!e.selectedPath)return a.jsxs($t,{"data-component-name":"cmp:TemplateEditorEmptyState",sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",p:4},children:[a.jsx(vc,{sx:{fontSize:64,color:"text.disabled",mb:2}}),a.jsx(G,{color:"text.secondary",children:"ファイルを選択してください"})]});const r=e.selectedPath.split("/").pop()??"",s=O2(r),i=M2(r);return e.isFileLoading?a.jsx($t,{"data-component-name":"cmp:TemplateEditorLoading",sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsx(ut,{})}):e.fileError?a.jsx($t,{"data-component-name":"cmp:TemplateEditorError",sx:{height:"100%",p:3},children:a.jsxs(zt,{severity:"error",children:["ファイルの読み込みに失敗しました: ",e.fileError.message]})}):a.jsxs($t,{"data-component-name":"cmp:TemplateEditorPanel",sx:{height:"100%",display:"flex",flexDirection:"column"},children:[n&&a.jsxs(B,{"data-component-name":"cmp:TemplateEditorHeader",sx:{p:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(G,{variant:"h6",noWrap:!0,children:r}),e.isDirty&&a.jsx(Ht,{label:"未保存",color:"warning",size:"small"})]}),e.hasEditPermission&&a.jsxs(B,{sx:{display:"flex",gap:1},children:[i?a.jsx(pe,{variant:"contained",startIcon:e.isSaving?a.jsx(ut,{size:16}):a.jsx(Ti,{}),onClick:()=>t.openUploadDialog(e.selectedPath.split("/").slice(0,-1).join("/")),disabled:e.isSaving,children:"アップロードして上書き"}):a.jsx(pe,{variant:"contained",startIcon:e.isSaving?a.jsx(ut,{size:16}):a.jsx(na,{}),onClick:()=>t.save(),disabled:!e.isDirty||e.isSaving||!s,children:"保存"}),a.jsx(ft,{color:"error",onClick:()=>{var l;return t.openDeleteDialog(e.selectedPath,((l=e.selectedEntry)==null?void 0:l.type)??"file")},children:a.jsx(zn,{})})]})]}),a.jsxs(B,{"data-component-name":"cmp:TemplateEditorBody",sx:{flex:1,overflow:"auto",p:2},children:[e.saveError&&a.jsx(zt,{severity:"error",sx:{mb:2},children:e.saveError}),s?a.jsx(Xe,{multiline:!0,fullWidth:!0,value:e.editContent,onChange:e.hasEditPermission?l=>t.updateContent(l.target.value):void 0,sx:{"& .MuiInputBase-root":{fontFamily:"monospace",fontSize:"0.875rem"},"& .MuiInputBase-input":{fontFamily:"monospace"}},minRows:20,placeholder:"ファイルの内容がここに表示されます",slotProps:{input:{readOnly:!e.hasEditPermission}}}):i&&e.fileContent?a.jsx(B,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",minHeight:400,bgcolor:"grey.100",borderRadius:1},children:a.jsx(B,{component:"img",src:`data:${Lee(r)};base64,${e.fileContent}`,alt:r,sx:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})}):a.jsx(zt,{severity:"info",children:"このファイル形式はテキストとして編集できません。削除のみ可能です。"})]}),a.jsx(qee,{useCase:t,state:e})]})}function qee({useCase:t,state:e}){var i,l;const n=async()=>{await t.confirmDelete()},r=((i=e.deleteTarget)==null?void 0:i.path.split("/").pop())??"",s=((l=e.deleteTarget)==null?void 0:l.type)==="directory";return a.jsxs(Qt,{"data-component-name":"cmp:DeleteConfirmDialog",open:e.deleteDialogOpen,onClose:()=>t.closeDeleteDialog(),children:[a.jsx(Yt,{children:s?"フォルダを削除":"ファイルを削除"}),a.jsx(Jt,{children:a.jsx(Eo,{children:s?`フォルダ「${r}」とその中のすべてのファイルを削除しますか?この操作は取り消せません。`:`ファイル「${r}」を削除しますか?この操作は取り消せません。`})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>t.closeDeleteDialog(),children:"キャンセル"}),a.jsx(pe,{variant:"contained",color:"error",onClick:n,disabled:e.isDeleting,children:e.isDeleting?a.jsx(ut,{size:20}):"削除"})]})]})}const Gee=Ss("/templates/")({component:Zee,validateSearch:t=>({file:typeof t.file=="string"?t.file:void 0})});function Zee(){var u;const t=vr(),e=aa(t.breakpoints.down("md")),{templateUseCase:n}=Vee(),r=n.getState(),s=((u=r.selectedPath)==null?void 0:u.split("/").pop())??"ファイル編集",i=r.selectedPath?O2(s):!1,l=r.selectedPath?M2(s):!1;return a.jsx(B,{"data-component-name":"cmp:TemplatePage",sx:{flex:1,overflow:"auto",bgcolor:"background.default"},children:a.jsxs(ji,{maxWidth:"xl",sx:{py:3},children:[a.jsx(no,{items:[{label:"ファイル管理"}]}),e?a.jsxs(a.Fragment,{children:[a.jsx(B,{sx:{height:"calc(100vh - 180px)"},children:a.jsx(sO,{useCase:n,state:r})}),a.jsxs(Cu,{"data-component-name":"cmp:TemplateEditorDrawer",anchor:"right",open:!!r.selectedPath,onClose:()=>n.clearSelection(),PaperProps:{sx:{width:"100%",maxWidth:600,display:"flex",flexDirection:"column"}},children:[a.jsx(Dp,{title:s,icon:a.jsx(vc,{color:"action"}),onClose:()=>n.clearSelection(),componentName:"cmp:TemplateEditorDrawerHeader",actions:r.hasEditPermission?a.jsxs(a.Fragment,{children:[l?a.jsx(pe,{variant:"contained",size:"small",startIcon:r.isSaving?a.jsx(ut,{size:16,color:"inherit"}):a.jsx(Ti,{}),onClick:()=>n.openUploadDialog(r.selectedPath.split("/").slice(0,-1).join("/")),disabled:r.isSaving,children:"上書き"}):a.jsx(pe,{variant:"contained",size:"small",startIcon:r.isSaving?a.jsx(ut,{size:16,color:"inherit"}):a.jsx(na,{}),onClick:()=>n.save(),disabled:!r.isDirty||r.isSaving||!i,children:"保存"}),a.jsx(ft,{color:"error",size:"small",onClick:()=>{var p;return n.openDeleteDialog(r.selectedPath,((p=r.selectedEntry)==null?void 0:p.type)??"file")},children:a.jsx(zn,{})})]}):void 0}),a.jsx(B,{sx:{flex:1,overflow:"auto"},children:a.jsx(iO,{useCase:n,state:r,showHeader:!1})})]})]}):a.jsxs(Et,{"data-component-name":"cmp:TemplateLayout",container:!0,spacing:2,sx:{height:"calc(100vh - 180px)"},children:[a.jsx(Et,{item:!0,xs:12,md:4,lg:3,sx:{height:"100%"},children:a.jsx(sO,{useCase:n,state:r})}),a.jsx(Et,{item:!0,xs:12,md:8,lg:9,sx:{height:"100%"},children:a.jsx(iO,{useCase:n,state:r,showHeader:!0})})]})]})})}let BC=null;function Kee(t){BC=t}function n5(t){return!t||t.startsWith("http://")||t.startsWith("https://")?t:BC?`${BC}/${t}`:t}class Sd{constructor(e){St(this,"baseUrl");this.baseUrl=e??ta().fileUploadUrl}getAuthHeaders(){const e=localStorage.getItem("frelio_github_token");if(!e)throw new Error("Not authenticated");return{Authorization:`Bearer ${e}`}}async fetchFiles(e){oe.debug("WorkerStorageRepositoryImpl.fetchFiles",{year:e});const n=e?`${this.baseUrl}/list?year=${e}`:`${this.baseUrl}/list`,r=await fetch(n,{headers:this.getAuthHeaders()});if(!r.ok)throw new Error("Failed to fetch files");const s=await r.json();return s.baseUrl&&Kee(s.baseUrl),s.baseUrl&&(s.files=s.files.map(i=>({...i,url:`${s.baseUrl}/${i.url}`,...i.variants&&{variants:Object.fromEntries(Object.entries(i.variants).map(([l,u])=>[l,`${s.baseUrl}/${u}`]))}}))),s}async fetchYears(){oe.debug("WorkerStorageRepositoryImpl.fetchYears");const e=await fetch(`${this.baseUrl}/years`,{headers:this.getAuthHeaders()});if(!e.ok)throw new Error("Failed to fetch years");return e.json()}async uploadFile(e,n){oe.info("WorkerStorageRepositoryImpl.uploadFile",{fileName:e.name,uploadedBy:n});const r=new FormData;r.append("file",e),r.append("uploadedBy",n);const s=await fetch(`${this.baseUrl}/upload`,{method:"POST",headers:this.getAuthHeaders(),body:r});if(!s.ok){const i=await s.json();throw new Error(i.error||"Upload failed")}return s.json()}async uploadImageSet(e,n,r,s){oe.info("WorkerStorageRepositoryImpl.uploadImageSet",{originalName:n,uploadedBy:r,presetCount:e.size});const i=new FormData;i.append("uploadedBy",r),i.append("originalName",n),s&&(i.append("width",String(s.width)),i.append("height",String(s.height)));for(const[u,p]of e)i.append(u,p,`${u}.webp`);const l=await fetch(`${this.baseUrl}/upload-set`,{method:"POST",headers:this.getAuthHeaders(),body:i});if(!l.ok){const u=await l.json();throw new Error(u.error||"Upload failed")}return l.json()}async deleteFile(e,n){oe.info("WorkerStorageRepositoryImpl.deleteFile",{uuid:e,year:n});const r=n?`${this.baseUrl}/files/${e}?year=${n}`:`${this.baseUrl}/files/${e}`;if(!(await fetch(r,{method:"DELETE",headers:this.getAuthHeaders()})).ok)throw new Error("Failed to delete file")}async updateFileMetadata(e,n,r){oe.info("WorkerStorageRepositoryImpl.updateFileMetadata",{uuid:e,year:n,metadata:r});const s=await fetch(`${this.baseUrl}/files/${e}`,{method:"PATCH",headers:{...this.getAuthHeaders(),"Content-Type":"application/json"},body:JSON.stringify({year:n,...r})});if(!s.ok){const i=await s.json();throw new Error(i.error||"Update failed")}return s.json()}async rebuildIndex(e){if(oe.info("WorkerStorageRepositoryImpl.rebuildIndex",{year:e}),!(await fetch(`${this.baseUrl}/rebuild/${e}`,{method:"POST",headers:this.getAuthHeaders()})).ok)throw new Error("Failed to rebuild index")}}class zf{constructor(e,n,r,s){St(this,"baseRepo",new Sd);St(this,"queryClient",null);this.filesQuery=e,this.deleteMutation=n,this.rebuildMutation=r,this.updateAltMutation=s}setQueryClient(e){this.queryClient=e}static FilesQueryParams(e){const n=new Sd;return{queryKey:["files",e],queryFn:()=>n.fetchFiles(e??void 0)}}static DeleteMutationParams(e,n,r){const s=new Sd;return{mutationFn:i=>s.deleteFile(i,n??void 0),onSuccess:()=>{e.invalidateQueries({queryKey:["files",n]}),r==null||r()}}}static RebuildMutationParams(e,n){const r=new Sd;return{mutationFn:s=>r.rebuildIndex(s),onSuccess:()=>{e.invalidateQueries({queryKey:["files",n]})}}}static UpdateAltMutationParams(e,n,r){const s=new Sd;return{mutationFn:({uuid:i,alt:l})=>s.updateFileMetadata(i,n??new Date().getFullYear(),{alt:l}),onSuccess:i=>{e.invalidateQueries({queryKey:["files",n]}),r==null||r(i)}}}getData(){return this.filesQuery.data}isLoading(){return this.filesQuery.isLoading}getError(){return this.filesQuery.error}async deleteFile(e){await this.deleteMutation.mutateAsync(e)}isDeleting(){return this.deleteMutation.isPending}async rebuildIndex(e){await this.rebuildMutation.mutateAsync(e)}isRebuilding(){return this.rebuildMutation.isPending}async updateAlt(e,n){return this.updateAltMutation.mutateAsync({uuid:e,alt:n})}isUpdatingAlt(){return this.updateAltMutation.isPending}async uploadFile(e,n){return this.baseRepo.uploadFile(e,n)}async uploadImageSet(e,n,r,s){return this.baseRepo.uploadImageSet(e,n,r,s)}invalidateFiles(e){var n;(n=this.queryClient)==null||n.invalidateQueries({queryKey:["files",e]})}}const oO=30;function Qee(){return Fs(t=>({deleteTarget:null,uploading:!1,uploadError:null,cropDialogOpen:!1,cropImageUrl:null,pendingFile:null,detailTarget:null,editingAlt:"",sortBy:"uploadedAt",sortOrder:"desc",selectedYear:null,displayCount:oO,isDragOver:!1,setDeleteTarget:e=>t({deleteTarget:e}),setUploading:e=>t({uploading:e}),setUploadError:e=>t({uploadError:e}),setCropDialogOpen:e=>t({cropDialogOpen:e}),setCropImageUrl:e=>t({cropImageUrl:e}),setPendingFile:e=>t({pendingFile:e}),setDetailTarget:e=>t({detailTarget:e}),setEditingAlt:e=>t({editingAlt:e}),setSortBy:e=>t({sortBy:e}),setSortOrder:e=>t({sortOrder:e}),setSelectedYear:e=>t({selectedYear:e,displayCount:oO}),setDisplayCount:e=>t({displayCount:e}),setIsDragOver:e=>t({isDragOver:e})}))}class Jee{constructor(){St(this,"store",Qee());St(this,"cachedState",null);St(this,"cachedStoreState",null)}getState(){const e=this.store.getState();return this.cachedStoreState===e&&this.cachedState!==null?this.cachedState:(this.cachedStoreState=e,this.cachedState={deleteTarget:e.deleteTarget,uploading:e.uploading,uploadError:e.uploadError,cropDialogOpen:e.cropDialogOpen,cropImageUrl:e.cropImageUrl,pendingFile:e.pendingFile,detailTarget:e.detailTarget,editingAlt:e.editingAlt,sortBy:e.sortBy,sortOrder:e.sortOrder,selectedYear:e.selectedYear,displayCount:e.displayCount,isDragOver:e.isDragOver},this.cachedState)}setDeleteTarget(e){this.store.getState().setDeleteTarget(e)}setUploading(e){this.store.getState().setUploading(e)}setUploadError(e){this.store.getState().setUploadError(e)}setCropDialogOpen(e){this.store.getState().setCropDialogOpen(e)}setCropImageUrl(e){this.store.getState().setCropImageUrl(e)}setPendingFile(e){this.store.getState().setPendingFile(e)}setDetailTarget(e){this.store.getState().setDetailTarget(e)}setEditingAlt(e){this.store.getState().setEditingAlt(e)}setSortBy(e){this.store.getState().setSortBy(e)}setSortOrder(e){this.store.getState().setSortOrder(e)}setSelectedYear(e){this.store.getState().setSelectedYear(e)}setDisplayCount(e){this.store.getState().setDisplayCount(e)}setIsDragOver(e){this.store.getState().setIsDragOver(e)}openCropDialog(e,n){this.setCropImageUrl(e),this.setPendingFile(n),this.setCropDialogOpen(!0)}closeCropDialog(){const e=this.getState().cropImageUrl;e&&URL.revokeObjectURL(e),this.setCropDialogOpen(!1),this.setCropImageUrl(null),this.setPendingFile(null)}openDetail(e){this.setDetailTarget(e),this.setEditingAlt(e.alt??"")}openDetailByUuid(e,n){const r=n.find(s=>s.uuid===e);r&&this.openDetail(r)}closeDetail(){this.setDetailTarget(null)}loadMore(e){const n=this.getState().displayCount;this.setDisplayCount(n+e)}toggleSortOrder(){const e=this.getState().sortOrder;this.setSortOrder(e==="asc"?"desc":"asc")}subscribe(e){return this.store.subscribe(e)}}class Yee{execute(e,n,r){const s=[...e];return s.sort((i,l)=>{let u=0;switch(n){case"originalName":u=i.originalName.localeCompare(l.originalName,"ja");break;case"size":u=i.size-l.size;break;case"uploadedAt":default:u=new Date(i.uploadedAt).getTime()-new Date(l.uploadedAt).getTime();break}return r==="asc"?u:-u}),s}}const aO=new Set(["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/bmp","image/tiff"]),Xee=new Set(["image/jpeg","image/png","image/webp","image/bmp"]),ete=new Set(["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/plain","text/csv","application/json"]),tte=new Set(["video/mp4","video/webm","video/ogg","video/quicktime","video/x-msvideo"]),nte=new Set(["audio/mpeg","audio/wav","audio/ogg","audio/webm","audio/aac","audio/flac"]);class rte{getProcessType(e){return aO.has(e)?"image":ete.has(e)?"document":tte.has(e)?"video":nte.has(e)?"audio":"other"}getStrategy(e,n){return e==="image"&&this.isCroppable(n)?"crop-first":"direct-upload"}isCroppable(e){return Xee.has(e)}isImage(e){return aO.has(e)}decide(e){const n=this.getProcessType(e),r=this.getStrategy(n,e),s=r==="crop-first",i=n==="image"&&this.isCroppable(e);return{processType:n,strategy:r,requiresCrop:s,generateImageSet:i}}canUpload(e,n){return this.getProcessType(e)!==void 0}}const ste=30;class ite{constructor(e){St(this,"sortStorageFilesUseCase",new Yee);St(this,"fileTypeDecider",new rte);this.deps=e}getState(){const{repo:e,presenter:n}=this.deps,r=n.getState(),s=e.getData(),i=s?this.sortStorageFilesUseCase.execute(s.files,r.sortBy,r.sortOrder):[],l=i.slice(0,r.displayCount),u=r.displayCount<i.length;return{...r,data:s,isLoading:e.isLoading(),error:e.getError(),sortedFiles:i,displayedFiles:l,hasMore:u,isDeleting:e.isDeleting(),isRebuilding:e.isRebuilding(),isUpdatingAlt:e.isUpdatingAlt(),canEdit:this.deps.canEdit}}initializeYear(){const{repo:e,presenter:n}=this.deps,r=e.getData(),s=n.getState();r&&s.selectedYear===null&&r.availableYears.length>0&&n.setSelectedYear(r.year)}handleFileSelect(e){const{presenter:n}=this.deps;if(this.fileTypeDecider.decide(e.type).requiresCrop){const s=URL.createObjectURL(e);n.openCropDialog(s,e)}else this.uploadFile(e)}async uploadFile(e,n){const{repo:r,presenter:s,githubUser:i}=this.deps;s.setUploading(!0),s.setUploadError(null);try{const l=e instanceof Blob&&!(e instanceof File)?new File([e],n??"cropped-image.jpg",{type:e.type}):e;await r.uploadFile(l,(i==null?void 0:i.login)??"unknown");const u=new Date().getFullYear();r.invalidateFiles(u),s.getState().selectedYear!==u&&s.setSelectedYear(u)}catch(l){s.setUploadError(l.message)}finally{s.setUploading(!1)}}async handleCropComplete(e){var u;const{repo:n,presenter:r,githubUser:s}=this.deps,i=r.getState(),l=((u=i.pendingFile)==null?void 0:u.name)??"image.jpg";r.closeCropDialog(),r.setUploading(!0),r.setUploadError(null);try{const p={width:e.width,height:e.height};await n.uploadImageSet(e.imageSet,l,(s==null?void 0:s.login)??"unknown",p);const f=new Date().getFullYear();n.invalidateFiles(f),i.selectedYear!==f&&r.setSelectedYear(f)}catch(p){r.setUploadError(p.message)}finally{r.setUploading(!1)}}closeCropDialog(){this.deps.presenter.closeCropDialog()}async deleteFile(e){await this.deps.repo.deleteFile(e)}async rebuildIndex(e){await this.deps.repo.rebuildIndex(e)}async updateAlt(e,n){await this.deps.repo.updateAlt(e,n)}setSelectedYear(e){this.deps.presenter.setSelectedYear(e)}setSortBy(e){this.deps.presenter.setSortBy(e)}toggleSortOrder(){this.deps.presenter.toggleSortOrder()}setDragOver(e){this.deps.presenter.setIsDragOver(e)}handleDrop(e){const{presenter:n}=this.deps;if(this.fileTypeDecider.decide(e.type).requiresCrop){const s=URL.createObjectURL(e);n.openCropDialog(s,e)}else this.uploadFile(e)}loadMore(){this.deps.presenter.loadMore(ste)}openDetail(e){this.deps.presenter.openDetail(e),this.deps.navigateToDetail(e.uuid)}closeDetail(){this.deps.presenter.closeDetail(),this.deps.navigateToDetail(void 0)}openDetailByUuid(e,n){this.deps.presenter.openDetailByUuid(e,n)}openDeleteDialog(e){this.deps.presenter.setDeleteTarget(e)}closeDeleteDialog(){this.deps.presenter.setDeleteTarget(null)}clearUploadError(){this.deps.presenter.setUploadError(null)}setEditingAlt(e){this.deps.presenter.setEditingAlt(e)}}const Ed=new Jee,ote=t=>Ed.subscribe(t),lO=()=>Ed.getState();function ate(){const{authUseCase:t}=rr(),{githubUser:e,currentUser:n}=t.getState(),r=ys(),s=ws(n,"canEditStorage"),i=Di({from:"/storage/"}),l=ur(),u=C=>{l({to:"/storage",search:C?{detail:C}:{},replace:!0})};b.useSyncExternalStore(ote,lO,lO);const p=Ed.getState(),f=new zf(jn(zf.FilesQueryParams(p.selectedYear)),Pn(zf.DeleteMutationParams(r,p.selectedYear,()=>Ed.setDeleteTarget(null))),Pn(zf.RebuildMutationParams(r,p.selectedYear)),Pn(zf.UpdateAltMutationParams(r,p.selectedYear,C=>Ed.setDetailTarget(C))));f.setQueryClient(r);const m=new ite({repo:f,presenter:Ed,githubUser:e,navigateToDetail:u,canEdit:s}),g=b.useRef(!1);b.useEffect(()=>{g.current||(g.current=!0,m.initializeYear())},[m]);const y=b.useRef(!1),v=f.getData();return b.useEffect(()=>{!y.current&&i.detail&&(v!=null&&v.files)&&!p.detailTarget&&(m.openDetailByUuid(i.detail,v.files),y.current=!0)},[i.detail,v==null?void 0:v.files,p.detailTarget,m]),{storageUseCase:m}}function UC(t){if(t===0)return"0 B";const e=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,r)).toFixed(1))+" "+n[r]}function lte(t){return new Date(t).toLocaleDateString("ja-JP",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function cte(t){return new Date(t).toLocaleDateString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"})}function Uc(t){return t.startsWith("image/")}function r5(t){return t==="application/pdf"}var VC=function(t,e){return VC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},VC(t,e)};function ute(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");VC(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var ss=function(){return ss=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ss.apply(this,arguments)};var c1,cO;function dte(){if(cO)return c1;cO=1;var t=!1,e,n,r,s,i,l,u,p,f,m,g,y,v,C,S;function j(){if(!t){t=!0;var M=navigator.userAgent,T=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(M),E=/(Mac OS X)|(Windows)|(Linux)/.exec(M);if(y=/\b(iPhone|iP[ao]d)/.exec(M),v=/\b(iP[ao]d)/.exec(M),m=/Android/i.exec(M),C=/FBAN\/\w+;/i.exec(M),S=/Mobile/i.exec(M),g=!!/Win64/.exec(M),T){e=T[1]?parseFloat(T[1]):T[5]?parseFloat(T[5]):NaN,e&&document&&document.documentMode&&(e=document.documentMode);var k=/(?:Trident\/(\d+.\d+))/.exec(M);l=k?parseFloat(k[1])+4:e,n=T[2]?parseFloat(T[2]):NaN,r=T[3]?parseFloat(T[3]):NaN,s=T[4]?parseFloat(T[4]):NaN,s?(T=/(?:Chrome\/(\d+\.\d+))/.exec(M),i=T&&T[1]?parseFloat(T[1]):NaN):i=NaN}else e=n=r=i=s=NaN;if(E){if(E[1]){var A=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(M);u=A?parseFloat(A[1].replace("_",".")):!0}else u=!1;p=!!E[2],f=!!E[3]}else u=p=f=!1}}var D={ie:function(){return j()||e},ieCompatibilityMode:function(){return j()||l>e},ie64:function(){return D.ie()&&g},firefox:function(){return j()||n},opera:function(){return j()||r},webkit:function(){return j()||s},safari:function(){return D.webkit()},chrome:function(){return j()||i},windows:function(){return j()||p},osx:function(){return j()||u},linux:function(){return j()||f},iphone:function(){return j()||y},mobile:function(){return j()||y||v||m||S},nativeApp:function(){return j()||C},android:function(){return j()||m},ipad:function(){return j()||v}};return c1=D,c1}var u1,uO;function pte(){if(uO)return u1;uO=1;var t=!!(typeof window<"u"&&window.document&&window.document.createElement),e={canUseDOM:t,canUseWorkers:typeof Worker<"u",canUseEventListeners:t&&!!(window.addEventListener||window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};return u1=e,u1}var d1,dO;function fte(){if(dO)return d1;dO=1;var t=pte(),e;t.canUseDOM&&(e=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
|
|
387
|
+
* Checks if an event is supported in the current execution environment.
|
|
388
|
+
*
|
|
389
|
+
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
390
|
+
* `reset`, `load`, `error`, and `select`.
|
|
391
|
+
*
|
|
392
|
+
* Borrows from Modernizr.
|
|
393
|
+
*
|
|
394
|
+
* @param {string} eventNameSuffix Event name, e.g. "click".
|
|
395
|
+
* @param {?boolean} capture Check if the capture phase is supported.
|
|
396
|
+
* @return {boolean} True if the event is supported.
|
|
397
|
+
* @internal
|
|
398
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
399
|
+
*/function n(r,s){if(!t.canUseDOM||s&&!("addEventListener"in document))return!1;var i="on"+r,l=i in document;if(!l){var u=document.createElement("div");u.setAttribute(i,"return;"),l=typeof u[i]=="function"}return!l&&e&&r==="wheel"&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}return d1=n,d1}var p1,pO;function hte(){if(pO)return p1;pO=1;var t=dte(),e=fte(),n=10,r=40,s=800;function i(l){var u=0,p=0,f=0,m=0;return"detail"in l&&(p=l.detail),"wheelDelta"in l&&(p=-l.wheelDelta/120),"wheelDeltaY"in l&&(p=-l.wheelDeltaY/120),"wheelDeltaX"in l&&(u=-l.wheelDeltaX/120),"axis"in l&&l.axis===l.HORIZONTAL_AXIS&&(u=p,p=0),f=u*n,m=p*n,"deltaY"in l&&(m=l.deltaY),"deltaX"in l&&(f=l.deltaX),(f||m)&&l.deltaMode&&(l.deltaMode==1?(f*=r,m*=r):(f*=s,m*=s)),f&&!u&&(u=f<1?-1:1),m&&!p&&(p=m<1?-1:1),{spinX:u,spinY:p,pixelX:f,pixelY:m}}return i.getEventType=function(){return t.firefox()?"DOMMouseScroll":e("wheel")?"wheel":"mousewheel"},p1=i,p1}var f1,fO;function mte(){return fO||(fO=1,f1=hte()),f1}var gte=mte();const yte=tx(gte);function vte(t,e,n,r,s,i){i===void 0&&(i=0);var l=up(t,e,i),u=l.width,p=l.height,f=Math.min(u,n),m=Math.min(p,r);return f>m*s?{width:m*s,height:m}:{width:f,height:f/s}}function xte(t){return t.width>t.height?t.width/t.naturalWidth:t.height/t.naturalHeight}function $f(t,e,n,r,s){s===void 0&&(s=0);var i=up(e.width,e.height,s),l=i.width,u=i.height;return{x:hO(t.x,l,n.width,r),y:hO(t.y,u,n.height,r)}}function hO(t,e,n,r){var s=e*r/2-n/2;return Wx(t,-s,s)}function mO(t,e){return Math.sqrt(Math.pow(t.y-e.y,2)+Math.pow(t.x-e.x,2))}function gO(t,e){return Math.atan2(e.y-t.y,e.x-t.x)*180/Math.PI}function bte(t,e,n,r,s,i,l){i===void 0&&(i=0),l===void 0&&(l=!0);var u=l?Ste:Cte,p=up(e.width,e.height,i),f=up(e.naturalWidth,e.naturalHeight,i),m={x:u(100,((p.width-n.width/s)/2-t.x/s)/p.width*100),y:u(100,((p.height-n.height/s)/2-t.y/s)/p.height*100),width:u(100,n.width/p.width*100/s),height:u(100,n.height/p.height*100/s)},g=Math.round(u(f.width,m.width*f.width/100)),y=Math.round(u(f.height,m.height*f.height/100)),v=f.width>=f.height*r,C=v?{width:Math.round(y*r),height:y}:{width:g,height:Math.round(g/r)},S=ss(ss({},C),{x:Math.round(u(f.width-C.width,m.x*f.width/100)),y:Math.round(u(f.height-C.height,m.y*f.height/100))});return{croppedAreaPercentages:m,croppedAreaPixels:S}}function Ste(t,e){return Math.min(t,Math.max(0,e))}function Cte(t,e){return e}function wte(t,e,n,r,s,i){var l=up(e.width,e.height,n),u=Wx(r.width/l.width*(100/t.width),s,i),p={x:u*l.width/2-r.width/2-l.width*u*(t.x/100),y:u*l.height/2-r.height/2-l.height*u*(t.y/100)};return{crop:p,zoom:u}}function jte(t,e,n){var r=xte(e);return n.height>n.width?n.height/(t.height*r):n.width/(t.width*r)}function Tte(t,e,n,r,s,i){n===void 0&&(n=0);var l=up(e.naturalWidth,e.naturalHeight,n),u=Wx(jte(t,e,r),s,i),p=r.height>r.width?r.height/t.height:r.width/t.width,f={x:((l.width-t.width)/2-t.x)*p,y:((l.height-t.height)/2-t.y)*p};return{crop:f,zoom:u}}function yO(t,e){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Dte(t){return t*Math.PI/180}function up(t,e,n){var r=Dte(n);return{width:Math.abs(Math.cos(r)*t)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*t)+Math.abs(Math.cos(r)*e)}}function Wx(t,e,n){return Math.min(Math.max(t,e),n)}function My(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.filter(function(n){return typeof n=="string"&&n.length>0}).join(" ").trim()}var Ete=`.reactEasyCrop_Container {
|
|
400
|
+
position: absolute;
|
|
401
|
+
top: 0;
|
|
402
|
+
left: 0;
|
|
403
|
+
right: 0;
|
|
404
|
+
bottom: 0;
|
|
405
|
+
overflow: hidden;
|
|
406
|
+
user-select: none;
|
|
407
|
+
touch-action: none;
|
|
408
|
+
cursor: move;
|
|
409
|
+
display: flex;
|
|
410
|
+
justify-content: center;
|
|
411
|
+
align-items: center;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.reactEasyCrop_Image,
|
|
415
|
+
.reactEasyCrop_Video {
|
|
416
|
+
will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.reactEasyCrop_Contain {
|
|
420
|
+
max-width: 100%;
|
|
421
|
+
max-height: 100%;
|
|
422
|
+
margin: auto;
|
|
423
|
+
position: absolute;
|
|
424
|
+
top: 0;
|
|
425
|
+
bottom: 0;
|
|
426
|
+
left: 0;
|
|
427
|
+
right: 0;
|
|
428
|
+
}
|
|
429
|
+
.reactEasyCrop_Cover_Horizontal {
|
|
430
|
+
width: 100%;
|
|
431
|
+
height: auto;
|
|
432
|
+
}
|
|
433
|
+
.reactEasyCrop_Cover_Vertical {
|
|
434
|
+
width: auto;
|
|
435
|
+
height: 100%;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.reactEasyCrop_CropArea {
|
|
439
|
+
position: absolute;
|
|
440
|
+
left: 50%;
|
|
441
|
+
top: 50%;
|
|
442
|
+
transform: translate(-50%, -50%);
|
|
443
|
+
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
444
|
+
box-sizing: border-box;
|
|
445
|
+
box-shadow: 0 0 0 9999em;
|
|
446
|
+
color: rgba(0, 0, 0, 0.5);
|
|
447
|
+
overflow: hidden;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.reactEasyCrop_CropAreaRound {
|
|
451
|
+
border-radius: 50%;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.reactEasyCrop_CropAreaGrid::before {
|
|
455
|
+
content: ' ';
|
|
456
|
+
box-sizing: border-box;
|
|
457
|
+
position: absolute;
|
|
458
|
+
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
459
|
+
top: 0;
|
|
460
|
+
bottom: 0;
|
|
461
|
+
left: 33.33%;
|
|
462
|
+
right: 33.33%;
|
|
463
|
+
border-top: 0;
|
|
464
|
+
border-bottom: 0;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.reactEasyCrop_CropAreaGrid::after {
|
|
468
|
+
content: ' ';
|
|
469
|
+
box-sizing: border-box;
|
|
470
|
+
position: absolute;
|
|
471
|
+
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
472
|
+
top: 33.33%;
|
|
473
|
+
bottom: 33.33%;
|
|
474
|
+
left: 0;
|
|
475
|
+
right: 0;
|
|
476
|
+
border-left: 0;
|
|
477
|
+
border-right: 0;
|
|
478
|
+
}
|
|
479
|
+
`,Rte=1,kte=3,Mte=1,Ote=(function(t){ute(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.cropperRef=b.createRef(),n.imageRef=b.createRef(),n.videoRef=b.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document<"u"?document:null,n.currentWindow=typeof window<"u"?window:null,n.resizeObserver=null,n.previousCropSize=null,n.isInitialized=!1,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(s){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturechange",n.onGestureChange),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.previousCropSize=r,n.emitCropData(),n.setInitialCrop(r),n.isInitialized=!0),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var s=wte(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),i=s.crop,l=s.zoom;n.props.onCropChange(i),n.props.onZoomChange&&n.props.onZoomChange(l)}else if(n.props.initialCroppedAreaPixels){var u=Tte(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),i=u.crop,l=u.zoom;n.props.onCropChange(i),n.props.onZoomChange&&n.props.onZoomChange(l)}},n.computeSizes=function(){var r,s,i,l,u,p,f=n.imageRef.current||n.videoRef.current;if(f&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var m=n.containerRect.width/n.containerRect.height,g=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((s=n.videoRef.current)===null||s===void 0?void 0:s.videoWidth)||0,y=((i=n.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((l=n.videoRef.current)===null||l===void 0?void 0:l.videoHeight)||0,v=f.offsetWidth<g||f.offsetHeight<y,C=g/y,S=void 0;if(v)switch(n.state.mediaObjectFit){default:case"contain":S=m>C?{width:n.containerRect.height*C,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/C};break;case"horizontal-cover":S={width:n.containerRect.width,height:n.containerRect.width/C};break;case"vertical-cover":S={width:n.containerRect.height*C,height:n.containerRect.height};break}else S={width:f.offsetWidth,height:f.offsetHeight};n.mediaSize=ss(ss({},S),{naturalWidth:g,naturalHeight:y}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var j=n.props.cropSize?n.props.cropSize:vte(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((u=n.state.cropSize)===null||u===void 0?void 0:u.height)!==j.height||((p=n.state.cropSize)===null||p===void 0?void 0:p.width)!==j.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(j),n.setState({cropSize:j},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(j),j}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(e.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(e.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(e.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(e.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureChange),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureChange=function(r){if(r.preventDefault(),!n.isTouching){var s=e.getMousePoint(r),i=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(i,s,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+r.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var s,i,l=r.x,u=r.y;n.dragStartPosition={x:l,y:u},n.dragStartCrop=ss({},n.props.crop),(i=(s=n.props).onInteractionStart)===null||i===void 0||i.call(s)},n.onDrag=function(r){var s=r.x,i=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(s===void 0||i===void 0)){var l=s-n.dragStartPosition.x,u=i-n.dragStartPosition.y,p={x:n.dragStartCrop.x+l,y:n.dragStartCrop.y+u},f=n.props.restrictPosition?$f(p,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):p;n.props.onCropChange(f)}}))},n.onDragStopped=function(){var r,s;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(s=(r=n.props).onInteractionEnd)===null||s===void 0||s.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var s=e.getMousePoint(r),i=yte(r).pixelY,l=n.props.zoom-i*n.props.zoomSpeed/200;n.setNewZoom(l,s,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var u,p;return(p=(u=n.props).onInteractionStart)===null||p===void 0?void 0:p.call(u)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var u,p;return(p=(u=n.props).onInteractionEnd)===null||p===void 0?void 0:p.call(u)})},250)}},n.getPointOnContainer=function(r,s){var i=r.x,l=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(i-s.x),y:n.containerRect.height/2-(l-s.y)}},n.getPointOnMedia=function(r){var s=r.x,i=r.y,l=n.props,u=l.crop,p=l.zoom;return{x:(s+u.x)/p,y:(i+u.y)/p}},n.setNewZoom=function(r,s,i){var l=i===void 0?{}:i,u=l.shouldUpdatePosition,p=u===void 0?!0:u;if(!(!n.state.cropSize||!n.props.onZoomChange)){var f=Wx(r,n.props.minZoom,n.props.maxZoom);if(p){var m=n.getPointOnContainer(s,n.containerPosition),g=n.getPointOnMedia(m),y={x:g.x*f-m.x,y:g.y*f-m.y},v=n.props.restrictPosition?$f(y,n.mediaSize,n.state.cropSize,f,n.props.rotation):y;n.props.onCropChange(v)}n.props.onZoomChange(f)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?$f(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return bte(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var s=r.croppedAreaPercentages,i=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(s,i),n.props.onCropAreaChange&&n.props.onCropAreaChange(s,i)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var s=r.croppedAreaPercentages,i=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(s,i)}},n.recomputeCropPosition=function(){var r,s;if(n.state.cropSize){var i=n.props.crop;if(n.isInitialized&&(!((r=n.previousCropSize)===null||r===void 0)&&r.width)&&(!((s=n.previousCropSize)===null||s===void 0)&&s.height)){var l=Math.abs(n.previousCropSize.width-n.state.cropSize.width)>1e-6||Math.abs(n.previousCropSize.height-n.state.cropSize.height)>1e-6;if(l){var u=n.state.cropSize.width/n.previousCropSize.width,p=n.state.cropSize.height/n.previousCropSize.height;i={x:n.props.crop.x*u,y:n.props.crop.y*p}}}var f=n.props.restrictPosition?$f(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.previousCropSize=n.state.cropSize,n.props.onCropChange(f),n.emitCropData()}},n.onKeyDown=function(r){var s,i,l=n.props,u=l.crop,p=l.onCropChange,f=l.keyboardStep,m=l.zoom,g=l.rotation,y=f;if(n.state.cropSize){r.shiftKey&&(y*=.2);var v=ss({},u);switch(r.key){case"ArrowUp":v.y-=y,r.preventDefault();break;case"ArrowDown":v.y+=y,r.preventDefault();break;case"ArrowLeft":v.x-=y,r.preventDefault();break;case"ArrowRight":v.x+=y,r.preventDefault();break;default:return}n.props.restrictPosition&&(v=$f(v,n.mediaSize,n.state.cropSize,m,g)),r.repeat||(i=(s=n.props).onInteractionStart)===null||i===void 0||i.call(s),p(v)}},n.onKeyUp=function(r){var s,i;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}n.emitCropData(),(i=(s=n.props).onInteractionEnd)===null||i===void 0||i.call(s)},n}return e.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=Ete,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},e.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},e.prototype.componentDidUpdate=function(n){var r,s,i,l,u,p,f,m,g;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((s=this.props.cropSize)===null||s===void 0?void 0:s.height)||((i=n.cropSize)===null||i===void 0?void 0:i.width)!==((l=this.props.cropSize)===null||l===void 0?void 0:l.width)?this.computeSizes():(((u=n.crop)===null||u===void 0?void 0:u.x)!==((p=this.props.crop)===null||p===void 0?void 0:p.x)||((f=n.crop)===null||f===void 0?void 0:f.y)!==((m=this.props.crop)===null||m===void 0?void 0:m.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((g=this.videoRef.current)===null||g===void 0||g.load());var y=this.getObjectFit();y!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:y},this.computeSizes)},e.prototype.getAspect=function(){var n=this.props,r=n.cropSize,s=n.aspect;return r?r.width/r.height:s},e.prototype.getObjectFit=function(){var n,r,s,i;if(this.props.objectFit==="cover"){var l=this.imageRef.current||this.videoRef.current;if(l&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var u=this.containerRect.width/this.containerRect.height,p=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,f=((s=this.imageRef.current)===null||s===void 0?void 0:s.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,m=p/f;return m<u?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},e.prototype.onPinchStart=function(n){var r=e.getTouchPoint(n.touches[0]),s=e.getTouchPoint(n.touches[1]);this.lastPinchDistance=mO(r,s),this.lastPinchRotation=gO(r,s),this.onDragStart(yO(r,s))},e.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var s=e.getTouchPoint(n.touches[0]),i=e.getTouchPoint(n.touches[1]),l=yO(s,i);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var u=mO(s,i),p=r.props.zoom*(u/r.lastPinchDistance);r.setNewZoom(p,l,{shouldUpdatePosition:!1}),r.lastPinchDistance=u;var f=gO(s,i),m=r.props.rotation+(f-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(m),r.lastPinchRotation=f})}},e.prototype.render=function(){var n=this,r,s=this.props,i=s.image,l=s.video,u=s.mediaProps,p=s.cropperProps,f=s.transform,m=s.crop,g=m.x,y=m.y,v=s.rotation,C=s.zoom,S=s.cropShape,j=s.showGrid,D=s.roundCropAreaPixels,M=s.style,T=M.containerStyle,E=M.cropAreaStyle,k=M.mediaStyle,A=s.classes,O=A.containerClassName,I=A.cropAreaClassName,$=A.mediaClassName,R=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return b.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(z){return n.containerRef=z},"data-testid":"container",style:T,className:My("reactEasyCrop_Container",O)},i?b.createElement("img",ss({alt:"",className:My("reactEasyCrop_Image",R==="contain"&&"reactEasyCrop_Contain",R==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",R==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",$)},u,{src:i,ref:this.imageRef,style:ss(ss({},k),{transform:f||"translate(".concat(g,"px, ").concat(y,"px) rotate(").concat(v,"deg) scale(").concat(C,")")}),onLoad:this.onMediaLoad})):l&&b.createElement("video",ss({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:My("reactEasyCrop_Video",R==="contain"&&"reactEasyCrop_Contain",R==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",R==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",$)},u,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:ss(ss({},k),{transform:f||"translate(".concat(g,"px, ").concat(y,"px) rotate(").concat(v,"deg) scale(").concat(C,")")}),controls:!1}),(Array.isArray(l)?l:[{src:l}]).map(function(P){return b.createElement("source",ss({key:P.src},P))})),this.state.cropSize&&b.createElement("div",ss({ref:this.cropperRef,style:ss(ss({},E),{width:D?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:D?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:My("reactEasyCrop_CropArea",S==="round"&&"reactEasyCrop_CropAreaRound",j&&"reactEasyCrop_CropAreaGrid",I)},p)))},e.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:kte,minZoom:Rte,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:Mte},e.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e})(b.Component);const HC=[{name:"original",maxWidth:3840},{name:"retina",maxWidth:2560},{name:"large",maxWidth:1920},{name:"medium",maxWidth:1280},{name:"small",maxWidth:640},{name:"thumbnail",maxWidth:320}];async function vO(t,e,n){const r=await createImageBitmap(t),s=await createImageBitmap(e),i=new Map,l=HC.length,u=s.width,p=s.height;for(let f=0;f<l;f++){const m=HC[f];n==null||n(f+1,l,m.name);const g=m.name==="original"?s:r;if(m.name!=="original"&&Math.max(g.width,g.height)<m.maxWidth)continue;const{width:y,height:v}=m.name==="original"?{width:u,height:p}:Ate(g.width,g.height,m.maxWidth),C=await _te(g,y,v);i.set(m.name,C)}return r.close(),s.close(),{imageSet:i,width:u,height:p}}function Ate(t,e,n){if(t<=n&&e<=n)return{width:t,height:e};const r=Math.min(n/t,n/e);return{width:Math.floor(t*r),height:Math.floor(e*r)}}async function _te(t,e,n){const r=new OffscreenCanvas(e,n),s=r.getContext("2d");if(!s)throw new Error("Failed to get canvas context");return s.drawImage(t,0,0,e,n),r.convertToBlob({type:"image/webp",quality:.85})}const xO=[{value:"16:9",aspect:16/9,label:"16:9",icon:a.jsx(EJ,{})},{value:"4:3",aspect:4/3,label:"4:3",icon:a.jsx(kJ,{})},{value:"3:2",aspect:3/2,label:"3:2",icon:a.jsx(RJ,{})},{value:"1:1",aspect:1,label:"1:1",icon:a.jsx(MJ,{})},{value:"custom",aspect:16/9,label:"カスタム"}];async function Ite(t,e){const n=new Image;n.src=t,await new Promise(i=>{n.onload=i});const r=document.createElement("canvas");r.width=e.width,r.height=e.height;const s=r.getContext("2d");if(!s)throw new Error("Failed to get canvas context");return s.drawImage(n,e.x,e.y,e.width,e.height,0,0,e.width,e.height),new Promise((i,l)=>{r.toBlob(u=>{u?i(u):l(new Error("Failed to create blob"))},"image/jpeg",.9)})}function A2({open:t,imageUrl:e,onClose:n,onComplete:r,fixedAspectRatio:s}){const i=vr(),l=aa(i.breakpoints.down("sm")),[u,p]=b.useState({x:0,y:0}),[f,m]=b.useState(1),[g,y]=b.useState(null),[v,C]=b.useState(s??"4:3"),[S,j]=b.useState("16"),[D,M]=b.useState("9"),[T,E]=b.useState(!1),[k,A]=b.useState(null),O=()=>{if(v==="custom"){const N=parseFloat(S)||16,H=parseFloat(D)||9;return N/H}const z=xO.find(N=>N.value===v);return(z==null?void 0:z.aspect)??16/9},I=b.useCallback((z,N)=>{y(N)},[]),$=(z,N)=>{N&&C(N)},R=async()=>{if(g){E(!0);try{const N=await(await fetch(e)).blob(),H=await Ite(e,g),U=await vO(H,N,(L,W,K)=>{A({step:L,total:W,presetName:K})});r(U)}catch(z){oe.error("ImageCropDialog.handleCropConfirm","Crop failed",{error:z})}finally{E(!1),A(null)}}},P=async()=>{E(!0);try{const N=await(await fetch(e)).blob(),H=await vO(N,N,(U,L,W)=>{A({step:U,total:L,presetName:W})});r(H)}catch(z){oe.error("ImageCropDialog.handleSkip","Failed to generate image set",{error:z})}finally{E(!1),A(null)}};return a.jsxs(Qt,{open:t,onClose:n,maxWidth:"md",fullWidth:!0,fullScreen:l,children:[a.jsxs(Yt,{sx:{py:l?1.5:2,pr:6},children:["画像の切り取り",a.jsx(ft,{onClick:n,sx:{position:"absolute",right:8,top:8},children:a.jsx($x,{})})]}),a.jsxs(Jt,{sx:{p:l?1:2},children:[a.jsx(B,{sx:{position:"relative",width:"100%",height:l?250:400,bgcolor:"grey.900"},children:a.jsx(Ote,{image:e,crop:u,zoom:f,aspect:O(),onCropChange:p,onZoomChange:m,onCropComplete:I})}),a.jsxs(B,{sx:{px:2,mt:2},children:[a.jsxs(B,{children:[a.jsx(G,{variant:"body2",gutterBottom:!0,children:"ズーム"}),a.jsx(QI,{value:f,min:1,max:3,step:.001,onChange:(z,N)=>m(N)})]}),!s&&a.jsxs(B,{sx:{mt:2},children:[a.jsx(G,{variant:"body2",gutterBottom:!0,children:"アスペクト比"}),a.jsx(yc,{value:v,exclusive:!0,onChange:$,size:"small",sx:{flexWrap:"wrap","& .MuiToggleButton-root":{px:l?1:1.5}},children:xO.map(z=>a.jsxs(ts,{value:z.value,children:[z.icon&&!l&&a.jsx(B,{component:"span",sx:{mr:.5,display:"flex"},children:z.icon}),z.label]},z.value))}),v==="custom"&&a.jsxs(Ro,{direction:"row",spacing:1,alignItems:"center",sx:{mt:2},children:[a.jsx(Xe,{size:"small",type:"number",value:S,onChange:z=>j(z.target.value),inputProps:{min:1,max:100,step:1},sx:{width:70}}),a.jsx(G,{children:":"}),a.jsx(Xe,{size:"small",type:"number",value:D,onChange:z=>M(z.target.value),inputProps:{min:1,max:100,step:1},sx:{width:70}})]})]}),s&&a.jsx(B,{sx:{mt:2},children:a.jsxs(G,{variant:"body2",color:"text.secondary",children:["アスペクト比: ",s," (固定)"]})})]})]}),a.jsxs(rn,{sx:{px:2,pb:2,gap:1,flexDirection:"column"},children:[T&&k&&a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%",justifyContent:"center",mb:1},children:[a.jsx(ut,{size:20}),a.jsxs(G,{variant:"body2",children:["画像生成中 (",k.step,"/",k.total,")"]})]}),a.jsxs(B,{sx:{display:"flex",gap:1,width:"100%"},children:[a.jsx(pe,{onClick:P,sx:{flex:1},disabled:T,children:"そのまま保存"}),a.jsx(pe,{onClick:R,variant:"contained",sx:{flex:1},disabled:T,children:"保存"})]})]})]})}const h1={original:"original (3840px)",retina:"retina (2560px)",large:"large (1920px)",medium:"medium (1280px)",small:"small (640px)",thumbnail:"thumbnail (320px)"};function Pte({variants:t}){const e=HC.map(s=>s.name),r=e.filter(s=>s!=="original"&&t[s])[0];return r?a.jsxs(a.Fragment,{children:[a.jsxs(Et,{container:!0,spacing:2,sx:{mb:3},children:[a.jsxs(Et,{item:!0,xs:12,md:6,children:[a.jsx(G,{variant:"subtitle2",gutterBottom:!0,children:h1.original}),a.jsx(B,{component:"img",src:t.original,alt:"original",sx:{width:"100%",height:"auto",borderRadius:1}})]}),a.jsxs(Et,{item:!0,xs:12,md:6,children:[a.jsx(G,{variant:"subtitle2",gutterBottom:!0,children:h1[r]??r}),a.jsx(B,{component:"img",src:t[r],alt:r,sx:{width:"100%",height:"auto",borderRadius:1}})]})]}),a.jsx(G,{variant:"subtitle2",gutterBottom:!0,children:"全サイズ"}),a.jsx(B,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:e.filter(s=>t[s]).map(s=>a.jsx(pe,{component:"a",variant:"outlined",size:"small",href:t[s]??"",target:"_blank",startIcon:a.jsx(ip,{}),children:s},s))})]}):a.jsxs(a.Fragment,{children:[a.jsxs(B,{sx:{mb:3},children:[a.jsx(G,{variant:"subtitle2",gutterBottom:!0,children:h1.original}),a.jsx(B,{component:"img",src:t.original,alt:"original",sx:{maxWidth:"100%",height:"auto",borderRadius:1}})]}),a.jsx(G,{variant:"subtitle2",gutterBottom:!0,children:"全サイズ"}),a.jsx(B,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:t.original&&a.jsx(pe,{component:"a",variant:"outlined",size:"small",href:t.original,target:"_blank",startIcon:a.jsx(ip,{}),children:"original"})})]})}const Lte=Ss("/storage/")({component:$te,validateSearch:t=>({detail:typeof t.detail=="string"?t.detail:void 0})});function zte({isRebuilding:t,onRebuild:e}){const[n,r]=b.useState(!1),s=()=>{r(!1),e()};return a.jsxs(a.Fragment,{children:[a.jsx(ft,{size:"small",onClick:()=>r(!0),disabled:t,title:"インデックスを再構築",children:t?a.jsx(ut,{size:20}):a.jsx(kP,{})}),a.jsxs(Qt,{"data-component-name":"cmp:RebuildStorageIndexDialog",open:n,onClose:()=>r(!1),children:[a.jsx(Yt,{children:"インデックスの再構築"}),a.jsx(Jt,{children:a.jsx(Eo,{children:"ストレージのインデックスを再構築しますか?"})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>r(!1),children:"キャンセル"}),a.jsx(pe,{onClick:s,variant:"contained",autoFocus:!0,children:"再構築"})]})]})]})}function $te(){const t=b.useRef(null),{storageUseCase:e}=ate(),{deleteTarget:n,uploading:r,uploadError:s,cropDialogOpen:i,cropImageUrl:l,detailTarget:u,editingAlt:p,sortBy:f,sortOrder:m,selectedYear:g,isDragOver:y,data:v,isLoading:C,error:S,displayedFiles:j,hasMore:D,sortedFiles:M,isDeleting:T,isRebuilding:E,isUpdatingAlt:k,canEdit:A}=e.getState();return C||!v?a.jsx(B,{"data-component-name":"cmp:FilesPageLoading",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})}):S?a.jsx(B,{"data-component-name":"cmp:FilesPageError",sx:{flex:1,overflow:"auto",p:3},children:a.jsxs(zt,{severity:"error",children:["ファイル一覧の取得に失敗しました: ",S.message]})}):a.jsx(B,{"data-component-name":"cmp:FilesPage",sx:{flex:1,overflow:"auto"},children:a.jsxs(ji,{maxWidth:"xl",sx:{py:3,position:"relative"},onDragOver:A?O=>{O.preventDefault(),O.stopPropagation(),e.setDragOver(!0)}:void 0,onDragLeave:A?O=>{O.preventDefault(),O.stopPropagation(),e.setDragOver(!1)}:void 0,onDrop:A?O=>{O.preventDefault(),O.stopPropagation(),e.setDragOver(!1);const I=O.dataTransfer.files[0];I&&e.handleDrop(I)}:void 0,children:[y&&a.jsx(B,{sx:{position:"fixed",inset:0,bgcolor:"rgba(25, 118, 210, 0.1)",border:"4px dashed",borderColor:"primary.main",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsxs(B,{sx:{textAlign:"center",bgcolor:"background.paper",p:4,borderRadius:2},children:[a.jsx(Ti,{sx:{fontSize:80,color:"primary.main"}}),a.jsx(G,{variant:"h5",color:"primary",children:"ここにドロップしてアップロード"})]})}),a.jsx(no,{items:[{label:"ファイル一覧"}]}),a.jsx(la,{title:"ファイル管理",actions:a.jsxs(a.Fragment,{children:[v.availableYears.length>0&&a.jsx(_n,{size:"small",children:a.jsx(wn,{value:g??v.year,onChange:O=>e.setSelectedYear(O.target.value),children:v.availableYears.map(O=>a.jsxs(nt,{value:O,children:[O,"年"]},O))})}),a.jsx(zte,{isRebuilding:E||!g,onRebuild:()=>g&&e.rebuildIndex(g)}),A&&a.jsxs(pe,{variant:"contained",startIcon:r?a.jsx(ut,{size:20,color:"inherit"}):a.jsx(Ti,{}),component:"label",disabled:r,children:[r?"アップロード中...":"アップロード",a.jsx("input",{ref:t,type:"file",hidden:!0,onChange:O=>{var $;const I=($=O.target.files)==null?void 0:$[0];I&&(O.target.value="",e.handleFileSelect(I))}})]})]})}),a.jsxs($t,{"data-component-name":"cmp:StorageInfoPanel",sx:{p:2,mb:3},children:[a.jsxs(B,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[a.jsx(G,{variant:"body2",color:"text.secondary",children:"ストレージ使用量"}),a.jsxs(G,{variant:"body2",children:[UC(v.totalSize)," / 10 GB (",v.totalCount," ファイル)"]})]}),a.jsx(Sq,{variant:"determinate",value:Math.min(v.totalSize/(10*1024*1024*1024)*100,100),sx:{height:8,borderRadius:1,bgcolor:"grey.200","& .MuiLinearProgress-bar":{borderRadius:1,bgcolor:v.totalSize>8*1024*1024*1024?"error.main":"primary.main"}}})]}),a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[a.jsx(G,{variant:"body2",color:"text.secondary",children:"並び替え:"}),a.jsxs(yc,{value:f,exclusive:!0,onChange:(O,I)=>I&&e.setSortBy(I),size:"small",children:[a.jsx(ts,{value:"uploadedAt",children:"日時"}),a.jsx(ts,{value:"originalName",children:"名前"}),a.jsx(ts,{value:"size",children:"サイズ"})]}),a.jsx(ts,{value:"order",selected:!1,onChange:()=>e.toggleSortOrder(),size:"small",title:m==="asc"?"昇順":"降順",children:m==="asc"?a.jsx(x2,{fontSize:"small"}):a.jsx(zx,{fontSize:"small"})})]}),s&&a.jsxs(zt,{severity:"error",sx:{mb:3},onClose:()=>e.clearUploadError(),children:["アップロードに失敗しました: ",s]}),v.files.length===0?a.jsx(zt,{severity:"info",children:"ファイルがありません"}):a.jsx(Et,{container:!0,spacing:2,children:j.map(O=>a.jsx(Et,{item:!0,xs:6,sm:4,md:3,lg:2,children:a.jsxs(Su,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[a.jsxs(B,{sx:{position:"relative",height:140,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.100",cursor:"pointer"},onClick:()=>{O.variants?e.openDetail(O):window.open(O.url,"_blank")},children:[Uc(O.contentType)?a.jsx(II,{component:"img",image:O.url,alt:O.originalName,loading:"lazy",sx:{height:"100%",objectFit:"contain"}}):r5(O.contentType)?a.jsx(Fx,{sx:{fontSize:64,color:"error.main"}}):a.jsx(vc,{sx:{fontSize:64,color:"grey.500"}}),A&&a.jsx(ft,{size:"small",onClick:I=>{I.stopPropagation(),e.openDeleteDialog(O)},title:"削除",sx:{position:"absolute",right:4,bottom:4,bgcolor:"rgba(255, 255, 255, 0.9)","&:hover":{bgcolor:"error.light",color:"white"}},children:a.jsx(zn,{fontSize:"small"})})]}),a.jsxs(Sp,{sx:{py:1,px:1.5},children:[a.jsx(G,{variant:"body2",noWrap:!0,title:O.originalName,sx:{fontWeight:500},children:O.originalName}),a.jsx(G,{variant:"caption",color:"text.secondary",display:"block",children:UC(O.size)}),a.jsx(G,{variant:"caption",color:"text.secondary",display:"block",children:lte(O.uploadedAt)})]})]})},O.uuid))}),D&&a.jsx(B,{sx:{display:"flex",justifyContent:"center",mt:3},children:a.jsxs(pe,{variant:"outlined",onClick:()=>e.loadMore(),children:["もっと読み込む (",M.length-j.length," 件)"]})}),a.jsxs(Qt,{"data-component-name":"cmp:DeleteFileDialog",open:!!n,onClose:()=>e.closeDeleteDialog(),children:[a.jsx(Yt,{children:"ファイルを削除しますか?"}),a.jsx(Jt,{children:a.jsxs(G,{children:["「",n==null?void 0:n.originalName,"」を削除します。この操作は取り消せません。"]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>e.closeDeleteDialog(),children:"キャンセル"}),a.jsx(pe,{color:"error",onClick:()=>n&&e.deleteFile(n.uuid),disabled:T,children:T?"削除中...":"削除"})]})]}),l&&a.jsx(A2,{open:i,imageUrl:l,onClose:()=>e.closeCropDialog(),onComplete:O=>e.handleCropComplete(O)}),a.jsxs(Cu,{"data-component-name":"cmp:ImageDetailDrawer",anchor:"right",open:!!u,onClose:()=>e.closeDetail(),PaperProps:{sx:{width:"100%",maxWidth:800,display:"flex",flexDirection:"column"}},children:[a.jsx(Dp,{title:(u==null?void 0:u.originalName)??"",icon:a.jsx(ZJ,{color:"action"}),onClose:()=>e.closeDetail(),componentName:"cmp:ImageDetailDrawerHeader",actions:A?a.jsx(pe,{variant:"contained",size:"small",startIcon:k?a.jsx(ut,{size:16,color:"inherit"}):a.jsx(na,{}),onClick:()=>{u&&e.updateAlt(u.uuid,p)},disabled:k||p===((u==null?void 0:u.alt)??""),children:"保存"}):void 0}),a.jsxs(B,{sx:{flex:1,overflow:"auto",p:2},children:[(u==null?void 0:u.variants)&&a.jsx(Pte,{variants:u.variants}),a.jsx(B,{sx:{mt:3},children:a.jsx(Xe,{label:"代替テキスト (alt)",fullWidth:!0,value:p,onChange:A?O=>e.setEditingAlt(O.target.value):void 0,placeholder:"画像の説明を入力",helperText:"スクリーンリーダーや画像が表示できない場合に使用されます",size:"small",slotProps:{input:{readOnly:!A}}})})]})]})]})})}function Nte(){return{users:[],stagingBranches:[]}}function Fte(t){return t.stagingBranches.some(n=>n.isDefault)?t:{...t,stagingBranches:[Dm(),...t.stagingBranches]}}function Bte(t){return{...t,stagingBranches:t.stagingBranches.filter(e=>!e.isDefault)}}class m1{constructor(e,n){this.queries=e,this.saveMutation=n}static AdminDataQueryParams(e,n){return{queryKey:["adminData",n],queryFn:async()=>{if(!e)throw new Error("Not authenticated");const s=await new At(e).fetchJsonOrDefault(Mh,Nte(),n);return Fte(s)},enabled:!!e}}static SaveAdminDataMutationParams(e,n,r){return{mutationFn:async s=>{if(!n)throw new Error("Not authenticated");const i=new At(n),l=Bte(s);await i.commitFiles("chore: 管理データを更新",[{path:Mh,content:JSON.stringify(l,null,2)}],r)},onSuccess:()=>{e.invalidateQueries({queryKey:["adminData",r]})}}}getStagingBranches(){var e;return((e=this.queries.adminData.data)==null?void 0:e.stagingBranches)??[Dm()]}getUsers(){var e;return((e=this.queries.adminData.data)==null?void 0:e.users)??[]}isLoading(){return this.queries.adminData.isLoading}getError(){return this.queries.adminData.error}async saveAdminData(e){await this.saveMutation.mutateAsync(e)}isSaving(){return this.saveMutation.isPending}}function Ute(){return Fs(t=>({dialogMode:null,editingBranch:null,deleteDialogOpen:!1,deleteTargetBranch:null,formData:{branchName:"",previewUrl:"",allowedUsersText:""},validationErrors:[],isSaving:!1,isDeleting:!1,snackbar:{open:!1,message:"",severity:"success"},setDialogMode:e=>t({dialogMode:e}),setEditingBranch:e=>t({editingBranch:e}),setDeleteDialogOpen:e=>t({deleteDialogOpen:e}),setDeleteTargetBranch:e=>t({deleteTargetBranch:e}),setFormData:e=>t(n=>({formData:{...n.formData,...e}})),setValidationErrors:e=>t({validationErrors:e}),setSaving:e=>t({isSaving:e}),setDeleting:e=>t({isDeleting:e}),setSnackbar:e=>t({snackbar:e})}))}class Vte{constructor(){St(this,"store",Ute());St(this,"cachedState",null);St(this,"cachedStoreState",null)}getState(){const e=this.store.getState();return this.cachedStoreState===e&&this.cachedState!==null?this.cachedState:(this.cachedStoreState=e,this.cachedState={dialogMode:e.dialogMode,editingBranch:e.editingBranch,deleteDialogOpen:e.deleteDialogOpen,deleteTargetBranch:e.deleteTargetBranch,formData:e.formData,validationErrors:e.validationErrors,isSaving:e.isSaving,isDeleting:e.isDeleting,snackbar:e.snackbar},this.cachedState)}openAddDialog(){this.store.getState().setFormData({branchName:"",previewUrl:"",allowedUsersText:""}),this.store.getState().setValidationErrors([]),this.store.getState().setDialogMode("add")}openEditDialog(e){this.store.getState().setEditingBranch(e),this.store.getState().setFormData({branchName:e.branchName,previewUrl:e.previewUrl,allowedUsersText:aQ(e.allowedUsers)}),this.store.getState().setValidationErrors([]),this.store.getState().setDialogMode("edit")}closeDialog(){this.store.getState().setDialogMode(null),this.store.getState().setEditingBranch(null),this.store.getState().setValidationErrors([])}openDeleteDialog(e){this.store.getState().setDeleteTargetBranch(e),this.store.getState().setDeleteDialogOpen(!0)}closeDeleteDialog(){this.store.getState().setDeleteDialogOpen(!1),this.store.getState().setDeleteTargetBranch(null)}setFormField(e,n){this.store.getState().setFormData({[e]:n})}setValidationErrors(e){this.store.getState().setValidationErrors(e)}clearValidationErrors(){this.store.getState().setValidationErrors([])}setSaving(e){this.store.getState().setSaving(e)}setDeleting(e){this.store.getState().setDeleting(e)}showSnackbar(e,n){this.store.getState().setSnackbar({open:!0,message:e,severity:n})}hideSnackbar(){this.store.getState().setSnackbar({open:!1,message:"",severity:"success"})}subscribe(e){return this.store.subscribe(e)}}const _2=new Vte;class Hte{constructor(e){this.deps=e}getState(){const{repo:e,presenter:n}=this.deps;return{stagingBranches:e.getStagingBranches(),isLoading:e.isLoading(),error:e.getError(),...n.getState()}}openAddDialog(){this.deps.presenter.openAddDialog()}openEditDialog(e){this.deps.presenter.openEditDialog(e)}closeDialog(){this.deps.presenter.closeDialog()}openDeleteDialog(e){this.deps.presenter.openDeleteDialog(e)}closeDeleteDialog(){this.deps.presenter.closeDeleteDialog()}setFormField(e,n){this.deps.presenter.setFormField(e,n)}async addBranch(){const{repo:e,presenter:n}=this.deps,r=n.getState(),s=e.getStagingBranches(),i=e.getUsers(),l={branchName:r.formData.branchName.trim(),previewUrl:r.formData.previewUrl.trim(),allowedUsers:RM(r.formData.allowedUsersText),isDefault:!1},u=DM(l,s);if(u.length>0)return n.setValidationErrors(u),!1;n.setSaving(!0);try{const p=[...s,l],f={users:i,stagingBranches:p};return await e.saveAdminData(f),n.closeDialog(),n.showSnackbar("ステージングブランチを追加しました","success"),oe.info("StagingListUseCase.addBranch",{branchName:l.branchName}),!0}catch(p){return oe.error("StagingListUseCase.addBranch failed",{error:p}),n.showSnackbar("ステージングブランチの追加に失敗しました","error"),!1}finally{n.setSaving(!1)}}async updateBranch(){const{repo:e,presenter:n}=this.deps,r=n.getState(),s=e.getStagingBranches(),i=e.getUsers(),l=r.editingBranch;if(!l)return!1;const u={branchName:l.isDefault?l.branchName:r.formData.branchName.trim(),previewUrl:r.formData.previewUrl.trim(),allowedUsers:RM(r.formData.allowedUsersText),isDefault:l.isDefault},p=DM(u,s,l.branchName);if(p.length>0)return n.setValidationErrors(p),!1;n.setSaving(!0);try{const f=s.map(g=>g.branchName===l.branchName?u:g),m={users:i,stagingBranches:f};return await e.saveAdminData(m),n.closeDialog(),n.showSnackbar("ステージングブランチを更新しました","success"),oe.info("StagingListUseCase.updateBranch",{branchName:u.branchName}),!0}catch(f){return oe.error("StagingListUseCase.updateBranch failed",{error:f}),n.showSnackbar("ステージングブランチの更新に失敗しました","error"),!1}finally{n.setSaving(!1)}}async deleteBranch(){const{repo:e,presenter:n}=this.deps,r=n.getState(),s=e.getStagingBranches(),i=e.getUsers(),l=r.deleteTargetBranch;if(!l)return!1;if(!EM(l))return n.showSnackbar("デフォルトのステージングブランチは削除できません","error"),n.closeDeleteDialog(),!1;n.setDeleting(!0);try{const u=s.filter(f=>f.branchName!==l.branchName),p={users:i,stagingBranches:u};return await e.saveAdminData(p),n.closeDeleteDialog(),n.showSnackbar("ステージングブランチを削除しました","success"),oe.info("StagingListUseCase.deleteBranch",{branchName:l.branchName}),!0}catch(u){return oe.error("StagingListUseCase.deleteBranch failed",{error:u}),n.showSnackbar("ステージングブランチの削除に失敗しました","error"),!1}finally{n.setDeleting(!1)}}hideSnackbar(){this.deps.presenter.hideSnackbar()}canDelete(e){return EM(e)}}const Wte=t=>_2.subscribe(t),bO=()=>_2.getState(),SO="develop";function qte(){const{authUseCase:t}=rr(),{token:e}=t.getState(),n=ys();b.useSyncExternalStore(Wte,bO,bO);const r=new m1({adminData:jn(m1.AdminDataQueryParams(e,SO))},Pn(m1.SaveAdminDataMutationParams(n,e,SO)));return{stagingListUseCase:new Hte({repo:r,presenter:_2})}}const Gte=Ss("/staging/")({component:Zte});function Zte(){const{authUseCase:t}=rr(),{currentUser:e}=t.getState(),n=ur(),r=ws(e,"canViewStaging"),s=ws(e,"canEditStaging");return b.useEffect(()=>{e&&!r&&n({to:"/"})},[e,r,n]),r?a.jsx(Kte,{canEdit:s}):null}function Kte({canEdit:t}){const{stagingListUseCase:e}=qte(),n=e.getState(),{stagingBranches:r,isLoading:s,error:i,dialogMode:l,editingBranch:u,formData:p,validationErrors:f,isSaving:m,deleteDialogOpen:g,deleteTargetBranch:y,isDeleting:v,snackbar:C}=n,S=j=>{var D;return(D=f.find(M=>M.field===j))==null?void 0:D.message};return s?a.jsx(B,{"data-component-name":"cmp:StagingListPageLoading",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})}):i?a.jsx(B,{"data-component-name":"cmp:StagingListPageError",sx:{flex:1,overflow:"auto"},children:a.jsx(ji,{maxWidth:"lg",sx:{py:3},children:a.jsxs(zt,{severity:"error",children:["エラー: ",i.message]})})}):a.jsxs(B,{"data-component-name":"cmp:StagingListPage",sx:{flex:1,overflow:"auto"},children:[a.jsxs(ji,{maxWidth:"lg",sx:{py:3},children:[a.jsx(no,{items:[{label:"ステージングブランチ管理"}]}),a.jsx(la,{title:"ステージングブランチ管理",actions:t&&a.jsx(pe,{variant:"contained",startIcon:a.jsx(Qn,{}),onClick:()=>e.openAddDialog(),children:"ブランチ追加"})}),a.jsx(zt,{severity:"info",sx:{mb:3},children:"個人ブランチから「プレビューに反映」する際のマージ先ブランチを管理します。 「取り扱えるユーザー」を設定すると、そのユーザーはダッシュボードから該当ブランチにマージできます。"}),a.jsx(Et,{"data-component-name":"cmp:StagingBranchGrid",container:!0,spacing:3,children:r.map(j=>a.jsx(Et,{item:!0,xs:12,md:6,children:a.jsx(Qte,{branch:j,onEdit:()=>e.openEditDialog(j),onDelete:()=>e.openDeleteDialog(j),canDelete:e.canDelete(j),canEdit:t})},j.branchName))})]}),a.jsxs(Qt,{"data-component-name":"cmp:StagingBranchFormDialog",open:l!==null,onClose:()=>e.closeDialog(),maxWidth:"sm",fullWidth:!0,children:[a.jsx(Yt,{children:l==="add"?"ステージングブランチ追加":"ステージングブランチ編集"}),a.jsx(Jt,{children:a.jsxs(B,{display:"flex",flexDirection:"column",gap:2,mt:1,children:[a.jsx(Xe,{label:"ブランチ名",value:p.branchName,onChange:j=>e.setFormField("branchName",j.target.value),error:!!S("branchName"),helperText:S("branchName")||"英数字、ハイフン、アンダースコア、スラッシュが使用可能",disabled:l==="edit"&&(u==null?void 0:u.isDefault),fullWidth:!0,required:!0}),a.jsx(Xe,{label:"確認用URL",value:p.previewUrl,onChange:j=>e.setFormField("previewUrl",j.target.value),error:!!S("previewUrl"),helperText:S("previewUrl")||"プレビュー環境のURLを入力",fullWidth:!0,placeholder:"https://preview.example.com"}),a.jsx(Xe,{label:"取り扱えるユーザー",value:p.allowedUsersText,onChange:j=>e.setFormField("allowedUsersText",j.target.value),error:!!S("allowedUsers"),helperText:S("allowedUsers")||"GitHubユーザー名をカンマ区切りで入力(空欄 = 全員許可)",fullWidth:!0,placeholder:"user1, user2, user3"})]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>e.closeDialog(),children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:()=>l==="add"?e.addBranch():e.updateBranch(),disabled:m,children:m?a.jsx(ut,{size:24}):"保存"})]})]}),a.jsxs(Qt,{"data-component-name":"cmp:DeleteStagingBranchDialog",open:g,onClose:()=>e.closeDeleteDialog(),children:[a.jsx(Yt,{children:"ステージングブランチの削除"}),a.jsxs(Jt,{children:[a.jsxs(G,{children:["「",y==null?void 0:y.branchName,"」を削除しますか?"]}),a.jsx(G,{variant:"body2",color:"text.secondary",mt:1,children:"この操作は取り消せません。"})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>e.closeDeleteDialog(),children:"キャンセル"}),a.jsx(pe,{variant:"contained",color:"error",onClick:()=>e.deleteBranch(),disabled:v,children:v?a.jsx(ut,{size:24}):"削除"})]})]}),a.jsx(ea,{open:C.open,autoHideDuration:4e3,onClose:()=>e.hideSnackbar(),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{onClose:()=>e.hideSnackbar(),severity:C.severity,sx:{width:"100%"},children:C.message})})]})}function Qte({branch:t,onEdit:e,onDelete:n,canDelete:r,canEdit:s}){const i=t.isDefault?ta().previewUrl:t.previewUrl;return a.jsxs(Su,{"data-component-name":"cmp:StagingBranchCard",variant:"outlined",sx:{height:"100%",display:"flex",flexDirection:"column"},children:[a.jsxs(Sp,{sx:{flexGrow:1},children:[a.jsxs(B,{display:"flex",alignItems:"center",gap:1,mb:2,children:[a.jsx(G,{variant:"h6",component:"div",children:t.branchName}),t.isDefault&&a.jsx(Ht,{label:"デフォルト",size:"small",color:"primary"})]}),a.jsxs(B,{mb:2,children:[a.jsx(G,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"確認用URL"}),i?a.jsx(Ox,{href:i,target:"_blank",rel:"noopener noreferrer",children:i}):a.jsx(G,{variant:"body2",color:"text.disabled",children:"未設定"}),t.isDefault&&a.jsx(G,{variant:"caption",color:"text.secondary",display:"block",mt:.5,children:"※ 環境変数 VITE_PREVIEW_URL から取得"})]}),a.jsxs(B,{children:[a.jsx(G,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"取り扱えるユーザー"}),t.allowedUsers.length>0?a.jsx(B,{display:"flex",flexWrap:"wrap",gap:.5,children:t.allowedUsers.map(l=>a.jsx(Ht,{label:l,size:"small",variant:"outlined"},l))}):a.jsx(G,{variant:"body2",color:"text.disabled",children:"全員"})]})]}),s&&!t.isDefault&&a.jsxs(s2,{sx:{justifyContent:"flex-end",px:2,pb:2},children:[a.jsx(pe,{size:"small",startIcon:a.jsx(Ri,{}),onClick:e,children:"編集"}),r&&a.jsx(pe,{size:"small",color:"error",startIcon:a.jsx(zn,{}),onClick:n,children:"削除"})]})]})}const CO=20;function Jte(t,e){if(!t)return"不明";const n=e.find(r=>r.githubUsername===t);return(n==null?void 0:n.displayName)??t}function Yte(t,e){return{tagName:t.name,commitSha:t.commitSha,shortSha:t.commitSha.slice(0,7),commitMessage:t.commitMessage,deployerGithubUsername:t.authorLogin,deployerDisplayName:Jte(t.authorLogin,e),deployedAt:new Date(t.authorDate)}}class wO{constructor(e,n,r,s,i){this.query=e,this.users=n,this.token=r,this.paginationState=s,this.updatePaginationState=i}static QueryParams(e){return{queryKey:["deployHistory","tags"],queryFn:async()=>e?new At(e).listDeployTags(CO):{tags:[],hasMore:!1,endCursor:null},enabled:!!e}}getDeployments(){var r;return[...((r=this.query.data)==null?void 0:r.tags)??[],...this.paginationState.additionalTags].map(s=>Yte(s,this.users))}isLoading(){return this.query.isLoading}isFetchingMore(){return this.paginationState.isFetchingMore}hasMore(){var e;return this.paginationState.endCursor!==null?this.paginationState.hasMore:((e=this.query.data)==null?void 0:e.hasMore)??!1}getError(){return this.query.error}async fetchMore(){var e;if(this.token&&!this.paginationState.isFetchingMore){this.updatePaginationState({isFetchingMore:!0});try{const n=new At(this.token),r=this.paginationState.endCursor??((e=this.query.data)==null?void 0:e.endCursor)??void 0,s=await n.listDeployTags(CO,r);this.updatePaginationState({additionalTags:[...this.paginationState.additionalTags,...s.tags],hasMore:s.hasMore,endCursor:s.endCursor,isFetchingMore:!1})}catch{this.updatePaginationState({isFetchingMore:!1})}}}}class Xte{constructor(e){this.repo=e}getState(){return{deployments:this.repo.getDeployments(),isLoading:this.repo.isLoading(),isFetchingMore:this.repo.isFetchingMore(),hasMore:this.repo.hasMore(),error:this.repo.getError()}}async loadMore(){await this.repo.fetchMore()}formatRelativeTime(e){const r=new Date().getTime()-e.getTime(),s=Math.floor(r/(1e3*60)),i=Math.floor(r/(1e3*60*60)),l=Math.floor(r/(1e3*60*60*24));return s<1?"たった今":s<60?`${s}分前`:i<24?`${i}時間前`:l<7?`${l}日前`:e.toLocaleDateString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"})}formatDateTime(e){return e.toLocaleString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}}const ene="develop";let jO={additionalTags:[],hasMore:!0,isFetchingMore:!1,endCursor:null};function tne(){var f;const{authUseCase:t}=rr(),{token:e}=t.getState(),r=((f=jn(uu.AdminDataQueryParams(e,ene)).data)==null?void 0:f.users)??[],s=jn(wO.QueryParams(e)),i=b.useRef(jO),l=b.useMemo(()=>m=>{const g={...i.current,...m};i.current=g,jO=g},[]),u=new wO(s,r,e,i.current,l);return{deployHistoryUseCase:new Xte(u)}}const nne=Ss("/deploy-history/")({component:rne});function rne(){const{deployHistoryUseCase:t}=tne(),{deployments:e,isLoading:n,isFetchingMore:r,hasMore:s,error:i}=t.getState(),l=vr(),u=aa(l.breakpoints.down("sm"));return n?a.jsx(B,{sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})}):i?a.jsx(B,{sx:{flex:1,overflow:"auto",p:3},children:a.jsxs(zt,{severity:"error",children:["エラーが発生しました: ",i.message]})}):a.jsx(B,{"data-component-name":"cmp:DeployHistoryPage",sx:{flex:1,overflow:"auto"},children:a.jsxs(ji,{maxWidth:"lg",sx:{py:3},children:[a.jsx(no,{items:[{label:"本番化履歴"}]}),a.jsx(la,{title:"本番化履歴"}),e.length===0?a.jsxs(B,{"data-component-name":"cmp:DeployHistoryEmpty",sx:{textAlign:"center",py:6},children:[a.jsx(bY,{sx:{fontSize:64,color:"grey.400",mb:2}}),a.jsx(G,{color:"text.secondary",children:"デプロイ履歴がありません"})]}):u?a.jsx(ine,{deployHistoryUseCase:t}):a.jsx(sne,{deployHistoryUseCase:t}),s&&a.jsx(B,{"data-component-name":"cmp:DeployHistoryLoadMore",sx:{textAlign:"center",mt:3},children:a.jsx(pe,{variant:"outlined",onClick:()=>t.loadMore(),disabled:r,startIcon:r?a.jsx(ut,{size:16}):void 0,children:r?"読み込み中...":"さらに読み込む"})})]})})}function sne({deployHistoryUseCase:t}){const{deployments:e}=t.getState();return a.jsx(YI,{component:$t,"data-component-name":"cmp:DeployHistoryTable",children:a.jsxs(wp,{children:[a.jsx(jm,{children:a.jsxs(eo,{children:[a.jsx(Kt,{children:"タグ"}),a.jsx(Kt,{children:"デプロイ日時"}),a.jsx(Kt,{children:"コミットメッセージ"}),a.jsx(Kt,{children:"実行者"})]})}),a.jsx(jp,{children:e.map(n=>a.jsxs(eo,{children:[a.jsx(Kt,{children:a.jsx(Ht,{label:n.tagName,size:"small",variant:"outlined",color:"primary"})}),a.jsxs(Kt,{sx:{whiteSpace:"nowrap"},children:[a.jsx(G,{variant:"body2",children:t.formatDateTime(n.deployedAt)}),a.jsx(G,{variant:"caption",color:"text.secondary",children:t.formatRelativeTime(n.deployedAt)})]}),a.jsxs(Kt,{children:[a.jsx(G,{variant:"body2",sx:{maxWidth:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.commitMessage.split(`
|
|
480
|
+
`)[0]}),a.jsx(G,{variant:"caption",color:"text.secondary",children:n.shortSha})]}),a.jsx(Kt,{children:a.jsx(Ht,{label:n.deployerDisplayName,size:"small",variant:"outlined"})})]},n.tagName))})]})})}function ine({deployHistoryUseCase:t}){const{deployments:e}=t.getState();return a.jsx(B,{"data-component-name":"cmp:DeployHistoryCards",sx:{display:"flex",flexDirection:"column",gap:2},children:e.map(n=>a.jsxs($t,{sx:{p:2},children:[a.jsxs(B,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[a.jsx(Ht,{label:n.tagName,size:"small",variant:"outlined",color:"primary"}),a.jsx(Ht,{label:n.deployerDisplayName,size:"small",variant:"outlined"})]}),a.jsx(G,{variant:"body2",sx:{mb:.5},children:n.commitMessage.split(`
|
|
481
|
+
`)[0]}),a.jsxs(B,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsx(G,{variant:"caption",color:"text.secondary",children:t.formatDateTime(n.deployedAt)}),a.jsx(G,{variant:"caption",color:"text.secondary",children:n.shortSha})]})]},n.tagName))})}function one(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return b.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const qx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ep(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function I2(t){return"nodeType"in t}function Us(t){var e,n;return t?Ep(t)?t:I2(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function P2(t){const{Document:e}=Us(t);return t instanceof e}function _m(t){return Ep(t)?!1:t instanceof Us(t).HTMLElement}function s5(t){return t instanceof Us(t).SVGElement}function Rp(t){return t?Ep(t)?t.document:I2(t)?P2(t)?t:_m(t)||s5(t)?t.ownerDocument:document:document:document}const Mo=qx?b.useLayoutEffect:b.useEffect;function Gx(t){const e=b.useRef(t);return Mo(()=>{e.current=t}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function ane(){const t=b.useRef(null),e=b.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=b.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Yh(t,e){e===void 0&&(e=[t]);const n=b.useRef(t);return Mo(()=>{n.current!==t&&(n.current=t)},e),n}function Im(t,e){const n=b.useRef();return b.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Pv(t){const e=Gx(t),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function Lv(t){const e=b.useRef();return b.useEffect(()=>{e.current=t},[t]),e.current}let g1={};function Pm(t,e){return b.useMemo(()=>{if(e)return e;const n=g1[t]==null?0:g1[t]+1;return g1[t]=n,t+"-"+n},[t,e])}function i5(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,l)=>{const u=Object.entries(l);for(const[p,f]of u){const m=i[p];m!=null&&(i[p]=m+t*f)}return i},{...e})}}const $d=i5(1),Xh=i5(-1);function lne(t){return"clientX"in t&&"clientY"in t}function Zx(t){if(!t)return!1;const{KeyboardEvent:e}=Us(t.target);return e&&t instanceof e}function cne(t){if(!t)return!1;const{TouchEvent:e}=Us(t.target);return e&&t instanceof e}function zv(t){if(cne(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return lne(t)?{x:t.clientX,y:t.clientY}:null}const sa=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[sa.Translate.toString(t),sa.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),TO="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function une(t){return t.matches(TO)?t:t.querySelector(TO)}const dne={display:"none"};function pne(t){let{id:e,value:n}=t;return We.createElement("div",{id:e,style:dne},n)}function fne(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return We.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function hne(){const[t,e]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const o5=b.createContext(null);function mne(t){const e=b.useContext(o5);b.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function gne(){const[t]=b.useState(()=>new Set),e=b.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[b.useCallback(r=>{let{type:s,event:i}=r;t.forEach(l=>{var u;return(u=l[s])==null?void 0:u.call(l,i)})},[t]),e]}const yne={draggable:`
|
|
482
|
+
To pick up a draggable item, press the space bar.
|
|
483
|
+
While dragging, use the arrow keys to move the item.
|
|
484
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
485
|
+
`},vne={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function xne(t){let{announcements:e=vne,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=yne}=t;const{announce:i,announcement:l}=hne(),u=Pm("DndLiveRegion"),[p,f]=b.useState(!1);if(b.useEffect(()=>{f(!0)},[]),mne(b.useMemo(()=>({onDragStart(g){let{active:y}=g;i(e.onDragStart({active:y}))},onDragMove(g){let{active:y,over:v}=g;e.onDragMove&&i(e.onDragMove({active:y,over:v}))},onDragOver(g){let{active:y,over:v}=g;i(e.onDragOver({active:y,over:v}))},onDragEnd(g){let{active:y,over:v}=g;i(e.onDragEnd({active:y,over:v}))},onDragCancel(g){let{active:y,over:v}=g;i(e.onDragCancel({active:y,over:v}))}}),[i,e])),!p)return null;const m=We.createElement(We.Fragment,null,We.createElement(pne,{id:r,value:s.draggable}),We.createElement(fne,{id:u,announcement:l}));return n?Ul.createPortal(m,n):m}var Yr;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Yr||(Yr={}));function $v(){}function Do(t,e){return b.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Lm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return b.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Oo=Object.freeze({x:0,y:0});function L2(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function bne(t,e){const n=zv(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function z2(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function Sne(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function WC(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function a5(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function DO(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const Kx=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=DO(e,e.left,e.top),i=[];for(const l of r){const{id:u}=l,p=n.get(u);if(p){const f=L2(DO(p),s);i.push({id:u,data:{droppableContainer:l,value:f}})}}return i.sort(z2)},Cne=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=WC(e),i=[];for(const l of r){const{id:u}=l,p=n.get(u);if(p){const f=WC(p),m=s.reduce((y,v,C)=>y+L2(f[C],v),0),g=Number((m/4).toFixed(4));i.push({id:u,data:{droppableContainer:l,value:g}})}}return i.sort(z2)};function wne(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),l=s-r,u=i-n;if(r<s&&n<i){const p=e.width*e.height,f=t.width*t.height,m=l*u,g=m/(p+f-m);return Number(g.toFixed(4))}return 0}const jne=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:l}=i,u=n.get(l);if(u){const p=wne(u,e);p>0&&s.push({id:l,data:{droppableContainer:i,value:p}})}}return s.sort(Sne)};function Tne(t,e){const{top:n,left:r,bottom:s,right:i}=e;return n<=t.y&&t.y<=s&&r<=t.x&&t.x<=i}const Dne=t=>{let{droppableContainers:e,droppableRects:n,pointerCoordinates:r}=t;if(!r)return[];const s=[];for(const i of e){const{id:l}=i,u=n.get(l);if(u&&Tne(r,u)){const f=WC(u).reduce((g,y)=>g+L2(r,y),0),m=Number((f/4).toFixed(4));s.push({id:l,data:{droppableContainer:i,value:m}})}}return s.sort(z2)};function Ene(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function l5(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Oo}function Rne(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((l,u)=>({...l,top:l.top+t*u.y,bottom:l.bottom+t*u.y,left:l.left+t*u.x,right:l.right+t*u.x}),{...n})}}const kne=Rne(1);function c5(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function Mne(t,e,n){const r=c5(e);if(!r)return t;const{scaleX:s,scaleY:i,x:l,y:u}=r,p=t.left-l-(1-s)*parseFloat(n),f=t.top-u-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),m=s?t.width/s:t.width,g=i?t.height/i:t.height;return{width:m,height:g,top:f,right:p+m,bottom:f+g,left:p}}const One={ignoreTransform:!1};function kp(t,e){e===void 0&&(e=One);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:f,transformOrigin:m}=Us(t).getComputedStyle(t);f&&(n=Mne(n,f,m))}const{top:r,left:s,width:i,height:l,bottom:u,right:p}=n;return{top:r,left:s,width:i,height:l,bottom:u,right:p}}function EO(t){return kp(t,{ignoreTransform:!0})}function Ane(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function _ne(t,e){return e===void 0&&(e=Us(t).getComputedStyle(t)),e.position==="fixed"}function Ine(t,e){e===void 0&&(e=Us(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function Qx(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(P2(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!_m(s)||s5(s)||n.includes(s))return n;const i=Us(t).getComputedStyle(s);return s!==t&&Ine(s,i)&&n.push(s),_ne(s,i)?n:r(s.parentNode)}return t?r(t):n}function u5(t){const[e]=Qx(t,1);return e??null}function y1(t){return!qx||!t?null:Ep(t)?t:I2(t)?P2(t)||t===Rp(t).scrollingElement?window:_m(t)?t:null:null}function d5(t){return Ep(t)?t.scrollX:t.scrollLeft}function p5(t){return Ep(t)?t.scrollY:t.scrollTop}function qC(t){return{x:d5(t),y:p5(t)}}var is;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(is||(is={}));function f5(t){return!qx||!t?!1:t===document.scrollingElement}function h5(t){const e={x:0,y:0},n=f5(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,l=t.scrollTop>=r.y,u=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:l,isRight:u,maxScroll:r,minScroll:e}}const Pne={x:.2,y:.2};function Lne(t,e,n,r,s){let{top:i,left:l,right:u,bottom:p}=n;r===void 0&&(r=10),s===void 0&&(s=Pne);const{isTop:f,isBottom:m,isLeft:g,isRight:y}=h5(t),v={x:0,y:0},C={x:0,y:0},S={height:e.height*s.y,width:e.width*s.x};return!f&&i<=e.top+S.height?(v.y=is.Backward,C.y=r*Math.abs((e.top+S.height-i)/S.height)):!m&&p>=e.bottom-S.height&&(v.y=is.Forward,C.y=r*Math.abs((e.bottom-S.height-p)/S.height)),!y&&u>=e.right-S.width?(v.x=is.Forward,C.x=r*Math.abs((e.right-S.width-u)/S.width)):!g&&l<=e.left+S.width&&(v.x=is.Backward,C.x=r*Math.abs((e.left+S.width-l)/S.width)),{direction:v,speed:C}}function zne(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:l}=window;return{top:0,left:0,right:i,bottom:l,width:i,height:l}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function m5(t){return t.reduce((e,n)=>$d(e,qC(n)),Oo)}function $ne(t){return t.reduce((e,n)=>e+d5(n),0)}function Nne(t){return t.reduce((e,n)=>e+p5(n),0)}function g5(t,e){if(e===void 0&&(e=kp),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);u5(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Fne=[["x",["left","right"],$ne],["y",["top","bottom"],Nne]];class $2{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Qx(n),s=m5(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,l,u]of Fne)for(const p of l)Object.defineProperty(this,p,{get:()=>{const f=u(r),m=s[i]-f;return this.rect[p]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class uh{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function Bne(t){const{EventTarget:e}=Us(t);return t instanceof e?t:Rp(t)}function v1(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var qi;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(qi||(qi={}));function RO(t){t.preventDefault()}function Une(t){t.stopPropagation()}var yn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(yn||(yn={}));const y5={start:[yn.Space,yn.Enter],cancel:[yn.Esc],end:[yn.Space,yn.Enter,yn.Tab]},Vne=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case yn.Right:return{...n,x:n.x+25};case yn.Left:return{...n,x:n.x-25};case yn.Down:return{...n,y:n.y+25};case yn.Up:return{...n,y:n.y-25}}};class ju{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new uh(Rp(n)),this.windowListeners=new uh(Us(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qi.Resize,this.handleCancel),this.windowListeners.add(qi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&g5(r),n(Oo)}handleKeyDown(e){if(Zx(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=y5,coordinateGetter:l=Vne,scrollBehavior:u="smooth"}=s,{code:p}=e;if(i.end.includes(p)){this.handleEnd(e);return}if(i.cancel.includes(p)){this.handleCancel(e);return}const{collisionRect:f}=r.current,m=f?{x:f.left,y:f.top}:Oo;this.referenceCoordinates||(this.referenceCoordinates=m);const g=l(e,{active:n,context:r.current,currentCoordinates:m});if(g){const y=Xh(g,m),v={x:0,y:0},{scrollableAncestors:C}=r.current;for(const S of C){const j=e.code,{isTop:D,isRight:M,isLeft:T,isBottom:E,maxScroll:k,minScroll:A}=h5(S),O=zne(S),I={x:Math.min(j===yn.Right?O.right-O.width/2:O.right,Math.max(j===yn.Right?O.left:O.left+O.width/2,g.x)),y:Math.min(j===yn.Down?O.bottom-O.height/2:O.bottom,Math.max(j===yn.Down?O.top:O.top+O.height/2,g.y))},$=j===yn.Right&&!M||j===yn.Left&&!T,R=j===yn.Down&&!E||j===yn.Up&&!D;if($&&I.x!==g.x){const P=S.scrollLeft+y.x,z=j===yn.Right&&P<=k.x||j===yn.Left&&P>=A.x;if(z&&!y.y){S.scrollTo({left:P,behavior:u});return}z?v.x=S.scrollLeft-P:v.x=j===yn.Right?S.scrollLeft-k.x:S.scrollLeft-A.x,v.x&&S.scrollBy({left:-v.x,behavior:u});break}else if(R&&I.y!==g.y){const P=S.scrollTop+y.y,z=j===yn.Down&&P<=k.y||j===yn.Up&&P>=A.y;if(z&&!y.x){S.scrollTo({top:P,behavior:u});return}z?v.y=S.scrollTop-P:v.y=j===yn.Down?S.scrollTop-k.y:S.scrollTop-A.y,v.y&&S.scrollBy({top:-v.y,behavior:u});break}}this.handleMove(e,$d(Xh(g,this.referenceCoordinates),v))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}ju.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=y5,onActivation:s}=e,{active:i}=n;const{code:l}=t.nativeEvent;if(r.start.includes(l)){const u=i.activatorNode.current;return u&&t.target!==u?!1:(t.preventDefault(),s==null||s({event:t.nativeEvent}),!0)}return!1}}];function kO(t){return!!(t&&"distance"in t)}function MO(t){return!!(t&&"delay"in t)}class N2{constructor(e,n,r){var s;r===void 0&&(r=Bne(e.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=e,this.events=n;const{event:i}=e,{target:l}=i;this.props=e,this.events=n,this.document=Rp(l),this.documentListeners=new uh(this.document),this.listeners=new uh(r),this.windowListeners=new uh(Us(l)),this.initialCoordinates=(s=zv(i))!=null?s:Oo,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:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(qi.Resize,this.handleCancel),this.windowListeners.add(qi.DragStart,RO),this.windowListeners.add(qi.VisibilityChange,this.handleCancel),this.windowListeners.add(qi.ContextMenu,RO),this.documentListeners.add(qi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(MO(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(kO(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(qi.Click,Une,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qi.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:l,options:{activationConstraint:u}}=i;if(!s)return;const p=(n=zv(e))!=null?n:Oo,f=Xh(s,p);if(!r&&u){if(kO(u)){if(u.tolerance!=null&&v1(f,u.tolerance))return this.handleCancel();if(v1(f,u.distance))return this.handleStart()}if(MO(u)&&v1(f,u.tolerance))return this.handleCancel();this.handlePending(u,f);return}e.cancelable&&e.preventDefault(),l(p)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===yn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const Hne={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Tu extends N2{constructor(e){const{event:n}=e,r=Rp(n.target);super(e,Hne,r)}}Tu.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Wne={move:{name:"mousemove"},end:{name:"mouseup"}};var GC;(function(t){t[t.RightClick=2]="RightClick"})(GC||(GC={}));class qne extends N2{constructor(e){super(e,Wne,Rp(e.event.target))}}qne.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===GC.RightClick?!1:(r==null||r({event:n}),!0)}}];const x1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class v5 extends N2{constructor(e){super(e,x1)}static setup(){return window.addEventListener(x1.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(x1.move.name,e)};function e(){}}}v5.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var dh;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(dh||(dh={}));var Nv;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Nv||(Nv={}));function Gne(t){let{acceleration:e,activator:n=dh.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:l=5,order:u=Nv.TreeOrder,pointerCoordinates:p,scrollableAncestors:f,scrollableAncestorRects:m,delta:g,threshold:y}=t;const v=Kne({delta:g,disabled:!i}),[C,S]=ane(),j=b.useRef({x:0,y:0}),D=b.useRef({x:0,y:0}),M=b.useMemo(()=>{switch(n){case dh.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case dh.DraggableRect:return s}},[n,s,p]),T=b.useRef(null),E=b.useCallback(()=>{const A=T.current;if(!A)return;const O=j.current.x*D.current.x,I=j.current.y*D.current.y;A.scrollBy(O,I)},[]),k=b.useMemo(()=>u===Nv.TreeOrder?[...f].reverse():f,[u,f]);b.useEffect(()=>{if(!i||!f.length||!M){S();return}for(const A of k){if((r==null?void 0:r(A))===!1)continue;const O=f.indexOf(A),I=m[O];if(!I)continue;const{direction:$,speed:R}=Lne(A,I,M,e,y);for(const P of["x","y"])v[P][$[P]]||(R[P]=0,$[P]=0);if(R.x>0||R.y>0){S(),T.current=A,C(E,l),j.current=R,D.current=$;return}}j.current={x:0,y:0},D.current={x:0,y:0},S()},[e,E,r,S,i,l,JSON.stringify(M),JSON.stringify(v),C,f,k,m,JSON.stringify(y)])}const Zne={x:{[is.Backward]:!1,[is.Forward]:!1},y:{[is.Backward]:!1,[is.Forward]:!1}};function Kne(t){let{delta:e,disabled:n}=t;const r=Lv(e);return Im(s=>{if(n||!r||!s)return Zne;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[is.Backward]:s.x[is.Backward]||i.x===-1,[is.Forward]:s.x[is.Forward]||i.x===1},y:{[is.Backward]:s.y[is.Backward]||i.y===-1,[is.Forward]:s.y[is.Forward]||i.y===1}}},[n,e,r])}function Qne(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Im(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function Jne(t,e){return b.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(l=>({eventName:l.eventName,handler:e(l.handler,r)}));return[...n,...i]},[]),[t,e])}var em;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(em||(em={}));var ZC;(function(t){t.Optimized="optimized"})(ZC||(ZC={}));const OO=new Map;function Yne(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,l]=b.useState(null),{frequency:u,measure:p,strategy:f}=s,m=b.useRef(t),g=j(),y=Yh(g),v=b.useCallback(function(D){D===void 0&&(D=[]),!y.current&&l(M=>M===null?D:M.concat(D.filter(T=>!M.includes(T))))},[y]),C=b.useRef(null),S=Im(D=>{if(g&&!n)return OO;if(!D||D===OO||m.current!==t||i!=null){const M=new Map;for(let T of t){if(!T)continue;if(i&&i.length>0&&!i.includes(T.id)&&T.rect.current){M.set(T.id,T.rect.current);continue}const E=T.node.current,k=E?new $2(p(E),E):null;T.rect.current=k,k&&M.set(T.id,k)}return M}return D},[t,i,n,g,p]);return b.useEffect(()=>{m.current=t},[t]),b.useEffect(()=>{g||v()},[n,g]),b.useEffect(()=>{i&&i.length>0&&l(null)},[JSON.stringify(i)]),b.useEffect(()=>{g||typeof u!="number"||C.current!==null||(C.current=setTimeout(()=>{v(),C.current=null},u))},[u,g,v,...r]),{droppableRects:S,measureDroppableContainers:v,measuringScheduled:i!=null};function j(){switch(f){case em.Always:return!1;case em.BeforeDragging:return n;default:return!n}}}function F2(t,e){return Im(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Xne(t,e){return F2(t,e)}function ere(t){let{callback:e,disabled:n}=t;const r=Gx(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Jx(t){let{callback:e,disabled:n}=t;const r=Gx(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function tre(t){return new $2(kp(t),t)}function AO(t,e,n){e===void 0&&(e=tre);const[r,s]=b.useState(null);function i(){s(p=>{if(!t)return null;if(t.isConnected===!1){var f;return(f=p??n)!=null?f:null}const m=e(t);return JSON.stringify(p)===JSON.stringify(m)?p:m})}const l=ere({callback(p){if(t)for(const f of p){const{type:m,target:g}=f;if(m==="childList"&&g instanceof HTMLElement&&g.contains(t)){i();break}}}}),u=Jx({callback:i});return Mo(()=>{i(),t?(u==null||u.observe(t),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),l==null||l.disconnect())},[t]),r}function nre(t){const e=F2(t);return l5(t,e)}const _O=[];function rre(t){const e=b.useRef(t),n=Im(r=>t?r&&r!==_O&&t&&e.current&&t.parentNode===e.current.parentNode?r:Qx(t):_O,[t]);return b.useEffect(()=>{e.current=t},[t]),n}function sre(t){const[e,n]=b.useState(null),r=b.useRef(t),s=b.useCallback(i=>{const l=y1(i.target);l&&n(u=>u?(u.set(l,qC(l)),new Map(u)):null)},[]);return b.useEffect(()=>{const i=r.current;if(t!==i){l(i);const u=t.map(p=>{const f=y1(p);return f?(f.addEventListener("scroll",s,{passive:!0}),[f,qC(f)]):null}).filter(p=>p!=null);n(u.length?new Map(u):null),r.current=t}return()=>{l(t),l(i)};function l(u){u.forEach(p=>{const f=y1(p);f==null||f.removeEventListener("scroll",s)})}},[s,t]),b.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,l)=>$d(i,l),Oo):m5(t):Oo,[t,e])}function IO(t,e){e===void 0&&(e=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},e),b.useEffect(()=>{const r=t!==Oo;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Xh(t,n.current):Oo}function ire(t){b.useEffect(()=>{if(!qx)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function ore(t,e){return b.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=l=>{i(l,e)},n},{}),[t,e])}function x5(t){return b.useMemo(()=>t?Ane(t):null,[t])}const PO=[];function are(t,e){e===void 0&&(e=kp);const[n]=t,r=x5(n?Us(n):null),[s,i]=b.useState(PO);function l(){i(()=>t.length?t.map(p=>f5(p)?r:new $2(e(p),p)):PO)}const u=Jx({callback:l});return Mo(()=>{u==null||u.disconnect(),l(),t.forEach(p=>u==null?void 0:u.observe(p))},[t]),s}function b5(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return _m(e)?e:t}function lre(t){let{measure:e}=t;const[n,r]=b.useState(null),s=b.useCallback(f=>{for(const{target:m}of f)if(_m(m)){r(g=>{const y=e(m);return g?{...g,width:y.width,height:y.height}:y});break}},[e]),i=Jx({callback:s}),l=b.useCallback(f=>{const m=b5(f);i==null||i.disconnect(),m&&(i==null||i.observe(m)),r(m?e(m):null)},[e,i]),[u,p]=Pv(l);return b.useMemo(()=>({nodeRef:u,rect:n,setRef:p}),[n,u,p])}const cre=[{sensor:Tu,options:{}},{sensor:ju,options:{}}],ure={current:{}},Yy={draggable:{measure:EO},droppable:{measure:EO,strategy:em.WhileDragging,frequency:ZC.Optimized},dragOverlay:{measure:kp}};class ph extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const dre={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ph,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:$v},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Yy,measureDroppableContainers:$v,windowRect:null,measuringScheduled:!1},S5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:$v,draggableNodes:new Map,over:null,measureDroppableContainers:$v},zm=b.createContext(S5),C5=b.createContext(dre);function pre(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ph}}}function fre(t,e){switch(e.type){case Yr.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Yr.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Yr.DragEnd:case Yr.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yr.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new ph(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Yr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const l=new ph(t.droppable.containers);return l.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:l}}}case Yr.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new ph(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function hre(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(zm),i=Lv(r),l=Lv(n==null?void 0:n.id);return b.useEffect(()=>{if(!e&&!r&&i&&l!=null){if(!Zx(i)||document.activeElement===i.target)return;const u=s.get(l);if(!u)return;const{activatorNode:p,node:f}=u;if(!p.current&&!f.current)return;requestAnimationFrame(()=>{for(const m of[p.current,f.current]){if(!m)continue;const g=une(m);if(g){g.focus();break}}})}},[r,e,s,l,i]),null}function w5(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function mre(t){return b.useMemo(()=>({draggable:{...Yy.draggable,...t==null?void 0:t.draggable},droppable:{...Yy.droppable,...t==null?void 0:t.droppable},dragOverlay:{...Yy.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function gre(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=b.useRef(!1),{x:l,y:u}=typeof s=="boolean"?{x:s,y:s}:s;Mo(()=>{if(!l&&!u||!e){i.current=!1;return}if(i.current||!r)return;const f=e==null?void 0:e.node.current;if(!f||f.isConnected===!1)return;const m=n(f),g=l5(m,r);if(l||(g.x=0),u||(g.y=0),i.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const y=u5(f);y&&y.scrollBy({top:g.y,left:g.x})}},[e,l,u,r,n])}const Yx=b.createContext({...Oo,scaleX:1,scaleY:1});var Tl;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Tl||(Tl={}));const $m=b.memo(function(e){var n,r,s,i;let{id:l,accessibility:u,autoScroll:p=!0,children:f,sensors:m=cre,collisionDetection:g=jne,measuring:y,modifiers:v,...C}=e;const S=b.useReducer(fre,void 0,pre),[j,D]=S,[M,T]=gne(),[E,k]=b.useState(Tl.Uninitialized),A=E===Tl.Initialized,{draggable:{active:O,nodes:I,translate:$},droppable:{containers:R}}=j,P=O!=null?I.get(O):null,z=b.useRef({initial:null,translated:null}),N=b.useMemo(()=>{var jt;return O!=null?{id:O,data:(jt=P==null?void 0:P.data)!=null?jt:ure,rect:z}:null},[O,P]),H=b.useRef(null),[U,L]=b.useState(null),[W,K]=b.useState(null),Q=Yh(C,Object.values(C)),le=Pm("DndDescribedBy",l),F=b.useMemo(()=>R.getEnabled(),[R]),J=mre(y),{droppableRects:ie,measureDroppableContainers:te,measuringScheduled:de}=Yne(F,{dragging:A,dependencies:[$.x,$.y],config:J.droppable}),fe=Qne(I,O),Re=b.useMemo(()=>W?zv(W):null,[W]),Pe=Lr(),$e=Xne(fe,J.draggable.measure);gre({activeNode:O!=null?I.get(O):null,config:Pe.layoutShiftCompensation,initialRect:$e,measure:J.draggable.measure});const we=AO(fe,J.draggable.measure,$e),be=AO(fe?fe.parentElement:null),Ae=b.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ne=R.getNodeFor((n=Ae.current.over)==null?void 0:n.id),Ie=lre({measure:J.dragOverlay.measure}),Fe=(r=Ie.nodeRef.current)!=null?r:fe,ct=A?(s=Ie.rect)!=null?s:we:null,Me=!!(Ie.nodeRef.current&&Ie.rect),tt=nre(Me?null:we),Ve=x5(Fe?Us(Fe):null),it=rre(A?Ne??fe:null),Z=are(it),q=w5(v,{transform:{x:$.x-tt.x,y:$.y-tt.y,scaleX:1,scaleY:1},activatorEvent:W,active:N,activeNodeRect:we,containerNodeRect:be,draggingNodeRect:ct,over:Ae.current.over,overlayNodeRect:Ie.rect,scrollableAncestors:it,scrollableAncestorRects:Z,windowRect:Ve}),se=Re?$d(Re,$):null,xe=sre(it),ee=IO(xe),ne=IO(xe,[we]),he=$d(q,ee),je=ct?kne(ct,q):null,ze=N&&je?g({active:N,collisionRect:je,droppableRects:ie,droppableContainers:F,pointerCoordinates:se}):null,ke=a5(ze,"id"),[Be,xt]=b.useState(null),vt=Me?q:$d(q,ne),kt=Ene(vt,(i=Be==null?void 0:Be.rect)!=null?i:null,we),Ge=b.useRef(null),gt=b.useCallback((jt,_t)=>{let{sensor:an,options:Vn}=_t;if(H.current==null)return;const Sn=I.get(H.current);if(!Sn)return;const ht=jt.nativeEvent,Tn=new an({active:H.current,activeNode:Sn,event:ht,options:Vn,context:Ae,onAbort(Ye){if(!I.get(Ye))return;const{onDragAbort:Mt}=Q.current,sn={id:Ye};Mt==null||Mt(sn),M({type:"onDragAbort",event:sn})},onPending(Ye,It,Mt,sn){if(!I.get(Ye))return;const{onDragPending:Rr}=Q.current,kr={id:Ye,constraint:It,initialCoordinates:Mt,offset:sn};Rr==null||Rr(kr),M({type:"onDragPending",event:kr})},onStart(Ye){const It=H.current;if(It==null)return;const Mt=I.get(It);if(!Mt)return;const{onDragStart:sn}=Q.current,pr={activatorEvent:ht,active:{id:It,data:Mt.data,rect:z}};Ul.unstable_batchedUpdates(()=>{sn==null||sn(pr),k(Tl.Initializing),D({type:Yr.DragStart,initialCoordinates:Ye,active:It}),M({type:"onDragStart",event:pr}),L(Ge.current),K(ht)})},onMove(Ye){D({type:Yr.DragMove,coordinates:Ye})},onEnd:Je(Yr.DragEnd),onCancel:Je(Yr.DragCancel)});Ge.current=Tn;function Je(Ye){return async function(){const{active:Mt,collisions:sn,over:pr,scrollAdjustedTranslate:Rr}=Ae.current;let kr=null;if(Mt&&Rr){const{cancelDrop:cs}=Q.current;kr={activatorEvent:ht,active:Mt,collisions:sn,delta:Rr,over:pr},Ye===Yr.DragEnd&&typeof cs=="function"&&await Promise.resolve(cs(kr))&&(Ye=Yr.DragCancel)}H.current=null,Ul.unstable_batchedUpdates(()=>{D({type:Ye}),k(Tl.Uninitialized),xt(null),L(null),K(null),Ge.current=null;const cs=Ye===Yr.DragEnd?"onDragEnd":"onDragCancel";if(kr){const Cn=Q.current[cs];Cn==null||Cn(kr),M({type:cs,event:kr})}})}}},[I]),dn=b.useCallback((jt,_t)=>(an,Vn)=>{const Sn=an.nativeEvent,ht=I.get(Vn);if(H.current!==null||!ht||Sn.dndKit||Sn.defaultPrevented)return;const Tn={active:ht};jt(an,_t.options,Tn)===!0&&(Sn.dndKit={capturedBy:_t.sensor},H.current=Vn,gt(an,_t))},[I,gt]),$n=Jne(m,dn);ire(m),Mo(()=>{we&&E===Tl.Initializing&&k(Tl.Initialized)},[we,E]),b.useEffect(()=>{const{onDragMove:jt}=Q.current,{active:_t,activatorEvent:an,collisions:Vn,over:Sn}=Ae.current;if(!_t||!an)return;const ht={active:_t,activatorEvent:an,collisions:Vn,delta:{x:he.x,y:he.y},over:Sn};Ul.unstable_batchedUpdates(()=>{jt==null||jt(ht),M({type:"onDragMove",event:ht})})},[he.x,he.y]),b.useEffect(()=>{const{active:jt,activatorEvent:_t,collisions:an,droppableContainers:Vn,scrollAdjustedTranslate:Sn}=Ae.current;if(!jt||H.current==null||!_t||!Sn)return;const{onDragOver:ht}=Q.current,Tn=Vn.get(ke),Je=Tn&&Tn.rect.current?{id:Tn.id,rect:Tn.rect.current,data:Tn.data,disabled:Tn.disabled}:null,Ye={active:jt,activatorEvent:_t,collisions:an,delta:{x:Sn.x,y:Sn.y},over:Je};Ul.unstable_batchedUpdates(()=>{xt(Je),ht==null||ht(Ye),M({type:"onDragOver",event:Ye})})},[ke]),Mo(()=>{Ae.current={activatorEvent:W,active:N,activeNode:fe,collisionRect:je,collisions:ze,droppableRects:ie,draggableNodes:I,draggingNode:Fe,draggingNodeRect:ct,droppableContainers:R,over:Be,scrollableAncestors:it,scrollAdjustedTranslate:he},z.current={initial:ct,translated:je}},[N,fe,ze,je,I,Fe,ct,ie,R,Be,it,he]),Gne({...Pe,delta:$,draggingRect:je,pointerCoordinates:se,scrollableAncestors:it,scrollableAncestorRects:Z});const dr=b.useMemo(()=>({active:N,activeNode:fe,activeNodeRect:we,activatorEvent:W,collisions:ze,containerNodeRect:be,dragOverlay:Ie,draggableNodes:I,droppableContainers:R,droppableRects:ie,over:Be,measureDroppableContainers:te,scrollableAncestors:it,scrollableAncestorRects:Z,measuringConfiguration:J,measuringScheduled:de,windowRect:Ve}),[N,fe,we,W,ze,be,Ie,I,R,ie,Be,te,it,Z,J,de,Ve]),tr=b.useMemo(()=>({activatorEvent:W,activators:$n,active:N,activeNodeRect:we,ariaDescribedById:{draggable:le},dispatch:D,draggableNodes:I,over:Be,measureDroppableContainers:te}),[W,$n,N,we,D,le,I,Be,te]);return We.createElement(o5.Provider,{value:T},We.createElement(zm.Provider,{value:tr},We.createElement(C5.Provider,{value:dr},We.createElement(Yx.Provider,{value:kt},f)),We.createElement(hre,{disabled:(u==null?void 0:u.restoreFocus)===!1})),We.createElement(xne,{...u,hiddenTextDescribedById:le}));function Lr(){const jt=(U==null?void 0:U.autoScrollEnabled)===!1,_t=typeof p=="object"?p.enabled===!1:p===!1,an=A&&!jt&&!_t;return typeof p=="object"?{...p,enabled:an}:{enabled:an}}}),yre=b.createContext(null),LO="button",vre="Draggable";function xre(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=Pm(vre),{activators:l,activatorEvent:u,active:p,activeNodeRect:f,ariaDescribedById:m,draggableNodes:g,over:y}=b.useContext(zm),{role:v=LO,roleDescription:C="draggable",tabIndex:S=0}=s??{},j=(p==null?void 0:p.id)===e,D=b.useContext(j?Yx:yre),[M,T]=Pv(),[E,k]=Pv(),A=ore(l,e),O=Yh(n);Mo(()=>(g.set(e,{id:e,key:i,node:M,activatorNode:E,data:O}),()=>{const $=g.get(e);$&&$.key===i&&g.delete(e)}),[g,e]);const I=b.useMemo(()=>({role:v,tabIndex:S,"aria-disabled":r,"aria-pressed":j&&v===LO?!0:void 0,"aria-roledescription":C,"aria-describedby":m.draggable}),[r,v,S,j,C,m.draggable]);return{active:p,activatorEvent:u,activeNodeRect:f,attributes:I,isDragging:j,listeners:r?void 0:A,node:M,over:y,setNodeRef:T,setActivatorNodeRef:k,transform:D}}function j5(){return b.useContext(C5)}const bre="Droppable",Sre={timeout:25};function T5(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=Pm(bre),{active:l,dispatch:u,over:p,measureDroppableContainers:f}=b.useContext(zm),m=b.useRef({disabled:n}),g=b.useRef(!1),y=b.useRef(null),v=b.useRef(null),{disabled:C,updateMeasurementsFor:S,timeout:j}={...Sre,...s},D=Yh(S??r),M=b.useCallback(()=>{if(!g.current){g.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{f(Array.isArray(D.current)?D.current:[D.current]),v.current=null},j)},[j]),T=Jx({callback:M,disabled:C||!l}),E=b.useCallback((I,$)=>{T&&($&&(T.unobserve($),g.current=!1),I&&T.observe(I))},[T]),[k,A]=Pv(E),O=Yh(e);return b.useEffect(()=>{!T||!k.current||(T.disconnect(),g.current=!1,T.observe(k.current))},[k,T]),b.useEffect(()=>(u({type:Yr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:k,rect:y,data:O}}),()=>u({type:Yr.UnregisterDroppable,key:i,id:r})),[r]),b.useEffect(()=>{n!==m.current.disabled&&(u({type:Yr.SetDroppableDisabled,id:r,key:i,disabled:n}),m.current.disabled=n)},[r,i,n,u]),{active:l,rect:y,isOver:(p==null?void 0:p.id)===r,node:k,over:p,setNodeRef:A}}function Cre(t){let{animation:e,children:n}=t;const[r,s]=b.useState(null),[i,l]=b.useState(null),u=Lv(n);return!n&&!r&&u&&s(u),Mo(()=>{if(!i)return;const p=r==null?void 0:r.key,f=r==null?void 0:r.props.id;if(p==null||f==null){s(null);return}Promise.resolve(e(f,i)).then(()=>{s(null)})},[e,r,i]),We.createElement(We.Fragment,null,n,r?b.cloneElement(r,{ref:l}):null)}const wre={x:0,y:0,scaleX:1,scaleY:1};function jre(t){let{children:e}=t;return We.createElement(zm.Provider,{value:S5},We.createElement(Yx.Provider,{value:wre},e))}const Tre={position:"fixed",touchAction:"none"},Dre=t=>Zx(t)?"transform 250ms ease":void 0,Ere=b.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:l,rect:u,style:p,transform:f,transition:m=Dre}=t;if(!u)return null;const g=s?f:{...f,scaleX:1,scaleY:1},y={...Tre,width:u.width,height:u.height,top:u.top,left:u.left,transform:sa.Transform.toString(g),transformOrigin:s&&r?bne(r,u):void 0,transition:typeof m=="function"?m(r):m,...p};return We.createElement(n,{className:l,style:y,ref:e},i)}),Rre=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:l}=t;if(i!=null&&i.active)for(const[u,p]of Object.entries(i.active))p!==void 0&&(s[u]=n.node.style.getPropertyValue(u),n.node.style.setProperty(u,p));if(i!=null&&i.dragOverlay)for(const[u,p]of Object.entries(i.dragOverlay))p!==void 0&&r.node.style.setProperty(u,p);return l!=null&&l.active&&n.node.classList.add(l.active),l!=null&&l.dragOverlay&&r.node.classList.add(l.dragOverlay),function(){for(const[p,f]of Object.entries(s))n.node.style.setProperty(p,f);l!=null&&l.active&&n.node.classList.remove(l.active)}},kre=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:sa.Transform.toString(e)},{transform:sa.Transform.toString(n)}]},Mre={duration:250,easing:"ease",keyframes:kre,sideEffects:Rre({styles:{active:{opacity:"0"}}})};function Ore(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return Gx((i,l)=>{if(e===null)return;const u=n.get(i);if(!u)return;const p=u.node.current;if(!p)return;const f=b5(l);if(!f)return;const{transform:m}=Us(l).getComputedStyle(l),g=c5(m);if(!g)return;const y=typeof e=="function"?e:Are(e);return g5(p,s.draggable.measure),y({active:{id:i,data:u.data,node:p,rect:s.draggable.measure(p)},draggableNodes:n,dragOverlay:{node:l,rect:s.dragOverlay.measure(f)},droppableContainers:r,measuringConfiguration:s,transform:g})})}function Are(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...Mre,...t};return i=>{let{active:l,dragOverlay:u,transform:p,...f}=i;if(!e)return;const m={x:u.rect.left-l.rect.left,y:u.rect.top-l.rect.top},g={scaleX:p.scaleX!==1?l.rect.width*p.scaleX/u.rect.width:1,scaleY:p.scaleY!==1?l.rect.height*p.scaleY/u.rect.height:1},y={x:p.x-m.x,y:p.y-m.y,...g},v=s({...f,active:l,dragOverlay:u,transform:{initial:p,final:y}}),[C]=v,S=v[v.length-1];if(JSON.stringify(C)===JSON.stringify(S))return;const j=r==null?void 0:r({active:l,dragOverlay:u,...f}),D=u.node.animate(v,{duration:e,easing:n,fill:"forwards"});return new Promise(M=>{D.onfinish=()=>{j==null||j(),M()}})}}let zO=0;function _re(t){return b.useMemo(()=>{if(t!=null)return zO++,zO},[t])}const B2=We.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:l,wrapperElement:u="div",className:p,zIndex:f=999}=t;const{activatorEvent:m,active:g,activeNodeRect:y,containerNodeRect:v,draggableNodes:C,droppableContainers:S,dragOverlay:j,over:D,measuringConfiguration:M,scrollableAncestors:T,scrollableAncestorRects:E,windowRect:k}=j5(),A=b.useContext(Yx),O=_re(g==null?void 0:g.id),I=w5(l,{activatorEvent:m,active:g,activeNodeRect:y,containerNodeRect:v,draggingNodeRect:j.rect,over:D,overlayNodeRect:j.rect,scrollableAncestors:T,scrollableAncestorRects:E,transform:A,windowRect:k}),$=F2(y),R=Ore({config:r,draggableNodes:C,droppableContainers:S,measuringConfiguration:M}),P=$?j.setRef:void 0;return We.createElement(jre,null,We.createElement(Cre,{animation:R},g&&O?We.createElement(Ere,{key:O,id:g.id,ref:P,as:u,activatorEvent:m,adjustScale:e,className:p,transition:i,rect:$,style:{zIndex:f,...s},transform:I},n):null))});function U2(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function Ire(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function Oy(t){return t!==null&&t>=0}function Pre(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Lre(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Xx=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=U2(e,r,n),l=e[s],u=i[s];return!u||!l?null:{x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height}},Ay={scaleX:1,scaleY:1},V2=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:l}=t;const u=(e=i[n])!=null?e:r;if(!u)return null;if(s===n){const f=i[l];return f?{x:0,y:n<l?f.top+f.height-(u.top+u.height):f.top-u.top,...Ay}:null}const p=zre(i,s,n);return s>n&&s<=l?{x:0,y:-u.height-p,...Ay}:s<n&&s>=l?{x:0,y:u.height+p,...Ay}:{x:0,y:0,...Ay}};function zre(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?n<e?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const D5="Sortable",E5=We.createContext({activeIndex:-1,containerId:D5,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Xx,disabled:{draggable:!1,droppable:!1}});function Nm(t){let{children:e,id:n,items:r,strategy:s=Xx,disabled:i=!1}=t;const{active:l,dragOverlay:u,droppableRects:p,over:f,measureDroppableContainers:m}=j5(),g=Pm(D5,n),y=u.rect!==null,v=b.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),C=l!=null,S=l?v.indexOf(l.id):-1,j=f?v.indexOf(f.id):-1,D=b.useRef(v),M=!Pre(v,D.current),T=j!==-1&&S===-1||M,E=Lre(i);Mo(()=>{M&&C&&m(v)},[M,v,C,m]),b.useEffect(()=>{D.current=v},[v]);const k=b.useMemo(()=>({activeIndex:S,containerId:g,disabled:E,disableTransforms:T,items:v,overIndex:j,useDragOverlay:y,sortedRects:Ire(v,p),strategy:s}),[S,g,E.draggable,E.droppable,T,v,j,p,y,s]);return We.createElement(E5.Provider,{value:k},e)}const $re=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return U2(n,r,s).indexOf(e)},Nre=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:l,previousItems:u,previousContainerId:p,transition:f}=t;return!f||!r||u!==i&&s===l?!1:n?!0:l!==s&&e===p},Fre={duration:200,easing:"ease"},R5="transform",Bre=sa.Transition.toString({property:R5,duration:0,easing:"linear"}),Ure={roleDescription:"sortable"};function Vre(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,l]=b.useState(null),u=b.useRef(n);return Mo(()=>{if(!e&&n!==u.current&&r.current){const p=s.current;if(p){const f=kp(r.current,{ignoreTransform:!0}),m={x:p.left-f.left,y:p.top-f.top,scaleX:p.width/f.width,scaleY:p.height/f.height};(m.x||m.y)&&l(m)}}n!==u.current&&(u.current=n)},[e,n,r,s]),b.useEffect(()=>{i&&l(null)},[i]),i}function eb(t){let{animateLayoutChanges:e=Nre,attributes:n,disabled:r,data:s,getNewIndex:i=$re,id:l,strategy:u,resizeObserverConfig:p,transition:f=Fre}=t;const{items:m,containerId:g,activeIndex:y,disabled:v,disableTransforms:C,sortedRects:S,overIndex:j,useDragOverlay:D,strategy:M}=b.useContext(E5),T=Hre(r,v),E=m.indexOf(l),k=b.useMemo(()=>({sortable:{containerId:g,index:E,items:m},...s}),[g,s,E,m]),A=b.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:O,node:I,isOver:$,setNodeRef:R}=T5({id:l,data:k,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...p}}),{active:P,activatorEvent:z,activeNodeRect:N,attributes:H,setNodeRef:U,listeners:L,isDragging:W,over:K,setActivatorNodeRef:Q,transform:le}=xre({id:l,data:k,attributes:{...Ure,...n},disabled:T.draggable}),F=one(R,U),J=!!P,ie=J&&!C&&Oy(y)&&Oy(j),te=!D&&W,de=te&&ie?le:null,Re=ie?de??(u??M)({rects:S,activeNodeRect:N,activeIndex:y,overIndex:j,index:E}):null,Pe=Oy(y)&&Oy(j)?i({id:l,items:m,activeIndex:y,overIndex:j}):E,$e=P==null?void 0:P.id,we=b.useRef({activeId:$e,items:m,newIndex:Pe,containerId:g}),be=m!==we.current.items,Ae=e({active:P,containerId:g,isDragging:W,isSorting:J,id:l,index:E,items:m,newIndex:we.current.newIndex,previousItems:we.current.items,previousContainerId:we.current.containerId,transition:f,wasDragging:we.current.activeId!=null}),Ne=Vre({disabled:!Ae,index:E,node:I,rect:O});return b.useEffect(()=>{J&&we.current.newIndex!==Pe&&(we.current.newIndex=Pe),g!==we.current.containerId&&(we.current.containerId=g),m!==we.current.items&&(we.current.items=m)},[J,Pe,g,m]),b.useEffect(()=>{if($e===we.current.activeId)return;if($e!=null&&we.current.activeId==null){we.current.activeId=$e;return}const Fe=setTimeout(()=>{we.current.activeId=$e},50);return()=>clearTimeout(Fe)},[$e]),{active:P,activeIndex:y,attributes:H,data:k,rect:O,index:E,newIndex:Pe,items:m,isOver:$,isSorting:J,isDragging:W,listeners:L,node:I,overIndex:j,over:K,setNodeRef:F,setActivatorNodeRef:Q,setDroppableNodeRef:R,setDraggableNodeRef:U,transform:Ne??Re,transition:Ie()};function Ie(){if(Ne||be&&we.current.newIndex===E)return Bre;if(!(te&&!Zx(z)||!f)&&(J||Ae))return sa.Transition.toString({...f,property:R5})}}function Hre(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}function Fv(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const Wre=[yn.Down,yn.Right,yn.Up,yn.Left],Fm=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:l,scrollableAncestors:u}}=e;if(Wre.includes(t.code)){if(t.preventDefault(),!n||!r)return;const p=[];i.getEnabled().forEach(g=>{if(!g||g!=null&&g.disabled)return;const y=s.get(g.id);if(y)switch(t.code){case yn.Down:r.top<y.top&&p.push(g);break;case yn.Up:r.top>y.top&&p.push(g);break;case yn.Left:r.left>y.left&&p.push(g);break;case yn.Right:r.left<y.left&&p.push(g);break}});const f=Cne({collisionRect:r,droppableRects:s,droppableContainers:p});let m=a5(f,"id");if(m===(l==null?void 0:l.id)&&f.length>1&&(m=f[1].id),m!=null){const g=i.get(n.id),y=i.get(m),v=y?s.get(y.id):null,C=y==null?void 0:y.node.current;if(C&&v&&g&&y){const j=Qx(C).some((A,O)=>u[O]!==A),D=k5(g,y),M=qre(g,y),T=j||!D?{x:0,y:0}:{x:M?r.width-v.width:0,y:M?r.height-v.height:0},E={x:v.left,y:v.top};return T.x&&T.y?E:Xh(E,T)}}}};function k5(t,e){return!Fv(t)||!Fv(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function qre(t,e){return!Fv(t)||!Fv(e)||!k5(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}class pi{constructor(e,n,r,s,i,l,u,p,f,m){this.contentTypeQuery=e,this.contentTypeUiQuery=n,this.contentTypeListQuery=r,this.saveMutation=s,this.createMutation=i,this.updateContentTypeListItemMutation=l,this.reorderMutation=u,this.queryClient=p,this.branch=f,this.contentTypeId=m}static ContentTypeQueryParams(e,n,r){return{queryKey:["contentType",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");const i=await new At(e).fetchFileOrNull(Kl(n),r);return i?JSON.parse(i):null},enabled:!!e&&!!n}}static ContentTypeUiQueryParams(e,n,r){return{queryKey:["contentTypeUi",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");const i=await new At(e).fetchFileOrNull(Ld(n),r);return i?JSON.parse(i):null},enabled:!!e&&!!n}}static ContentTypeListQueryParams(e,n){return{queryKey:["contentTypeList",n],queryFn:async()=>{if(!e)throw new Error("Not authenticated");const s=await new At(e).fetchFileOrNull(Bc,n);return s?JSON.parse(s):null},enabled:!!e}}static SaveMutationParams(e,n,r,s){return{mutationFn:async i=>{if(!n)throw new Error("Not authenticated");await new At(n).commitFiles(`コンテンツタイプ更新: ${s}`,[{path:Kl(s),content:JSON.stringify(i.contentType,null,2)},{path:Ld(s),content:JSON.stringify(i.contentTypeUi,null,2)}],r)},onSuccess:()=>{e.invalidateQueries({queryKey:["contentType",s,r]}),e.invalidateQueries({queryKey:["contentTypeUi",s,r]})}}}static CreateMutationParams(e,n,r){return{mutationFn:async s=>{if(!n)throw new Error("Not authenticated");const i=new At(n),l=s.contentType.id,u=await i.fetchFileOrNull(Bc,r),p=u?JSON.parse(u):{contentTypes:[]};if(p.contentTypes.some(m=>m.id===l))throw new Error(`Content type "${l}" already exists`);const f={contentTypes:[...p.contentTypes,s.contentTypeListItem]};await i.commitFiles(`コンテンツタイプ作成: ${l}`,[{path:Kl(l),content:JSON.stringify(s.contentType,null,2)},{path:Ld(l),content:JSON.stringify(s.contentTypeUi,null,2)},{path:sc(l),content:JSON.stringify(s.contentTypeViews,null,2)},{path:Bc,content:JSON.stringify(f,null,2)}],r)},onSuccess:()=>{e.invalidateQueries({queryKey:["contentTypeList",r]}),e.invalidateQueries({queryKey:["contentTypes",r]})}}}static ReorderContentTypesMutationParams(e,n,r){return{mutationFn:async s=>{if(!n)throw new Error("Not authenticated");const i=new At(n),l={contentTypes:s};await i.commitFiles("コンテンツタイプ順序変更",[{path:Bc,content:JSON.stringify(l,null,2)}],r)},onSuccess:()=>{e.invalidateQueries({queryKey:["contentTypeList",r]})}}}static UpdateContentTypeListItemMutationParams(e,n,r){return{mutationFn:async s=>{if(!n)throw new Error("Not authenticated");const i=new At(n),l=await i.fetchFileOrNull(Bc,r),p={contentTypes:(l?JSON.parse(l):{contentTypes:[]}).contentTypes.map(f=>f.id===s.id?{...f,label:s.label,icon:s.icon,displayLocation:s.displayLocation}:f)};await i.commitFiles(`コンテンツタイプメタ更新: ${s.id}`,[{path:Bc,content:JSON.stringify(p,null,2)}],r)},onSuccess:()=>{e.invalidateQueries({queryKey:["contentTypeList",r]})}}}getContentType(){return this.contentTypeQuery.data??void 0}getContentTypeUi(){return this.contentTypeUiQuery.data??void 0}getContentTypeList(){var e;return((e=this.contentTypeListQuery.data)==null?void 0:e.contentTypes)??[]}isLoading(){return this.contentTypeQuery.isLoading||this.contentTypeUiQuery.isLoading||this.contentTypeListQuery.isLoading}getError(){return this.contentTypeQuery.error??this.contentTypeUiQuery.error??this.contentTypeListQuery.error??null}async saveContentType(e){await this.saveMutation.mutateAsync(e)}async createContentType(e){await this.createMutation.mutateAsync(e)}async updateContentTypeListItem(e){await this.updateContentTypeListItemMutation.mutateAsync(e)}async reorderContentTypes(e){await this.reorderMutation.mutateAsync(e)}isSaving(){return this.saveMutation.isPending||this.createMutation.isPending||this.updateContentTypeListItemMutation.isPending||this.reorderMutation.isPending}invalidateQueries(){this.queryClient.invalidateQueries({queryKey:["contentType",this.contentTypeId,this.branch]}),this.queryClient.invalidateQueries({queryKey:["contentTypeUi",this.contentTypeId,this.branch]}),this.queryClient.invalidateQueries({queryKey:["contentTypeList",this.branch]})}}const Gre=t=>t;function M5(t,e=Gre){const n=We.useSyncExternalStore(t.subscribe,We.useCallback(()=>e(t.getState()),[t,e]),We.useCallback(()=>e(t.getInitialState()),[t,e]));return We.useDebugValue(n),n}const $O=t=>{const e=Fs(t),n=r=>M5(e,r);return Object.assign(n,e),n},Zre=(t=>t?$O(t):$O),NO={editingId:"",editingLabel:"",editingFields:[],editingGroups:[],selectedFieldKey:null,currentFieldPath:[],addFieldDialogOpen:!1,deleteFieldDialogOpen:!1,createContentTypeDialogOpen:!1,editContentTypeDialogOpen:!1,editingContentTypeListItem:null,message:null,isDirty:!1,editorMode:"ui",jsonSchemaText:"",jsonUiText:"",jsonSchemaIsDirty:!1,jsonUiIsDirty:!1,tabSwitchDialogOpen:!1,pendingTabSwitch:null,localContentTypeList:null,isListOrderDirty:!1};function Kre(){return Fs((t,e)=>({...NO,setEditingId:n=>t({editingId:n,isDirty:!0}),setEditingLabel:n=>t({editingLabel:n,isDirty:!0}),setEditingFields:n=>t({editingFields:n}),updateField:(n,r)=>{const i=e().editingFields.map(l=>l.key===n?{...l,...r}:l);t({editingFields:i,isDirty:!0})},addField:n=>{const r=e().editingFields;t({editingFields:[...r,n],selectedFieldKey:n.key,isDirty:!0})},removeField:n=>{const r=e().editingFields,s=e().editingGroups,i=r.filter(p=>p.key!==n),l=s.map(p=>({...p,fieldKeys:p.fieldKeys.filter(f=>f!==n)})),u=e().selectedFieldKey;t({editingFields:i,editingGroups:l,selectedFieldKey:u===n?null:u,isDirty:!0})},reorderFields:(n,r)=>{const s=e().editingFields;if(n<0||n>=s.length||r<0||r>=s.length)return;const i=[...s],[l]=i.splice(n,1);i.splice(r,0,l),t({editingFields:i,isDirty:!0})},setEditingGroups:n=>t({editingGroups:n}),addGroup:n=>{const r=e().editingGroups;t({editingGroups:[...r,n],isDirty:!0})},updateGroup:(n,r)=>{const i=e().editingGroups.map(l=>l.id===n?{...l,...r}:l);t({editingGroups:i,isDirty:!0})},removeGroup:n=>{const s=e().editingGroups.filter(i=>i.id!==n);t({editingGroups:s,isDirty:!0})},moveGroupUp:n=>{const r=e().editingGroups,s=r.findIndex(l=>l.id===n);if(s<=0)return;const i=[...r];[i[s-1],i[s]]=[i[s],i[s-1]],t({editingGroups:i,isDirty:!0})},moveGroupDown:n=>{const r=e().editingGroups,s=r.findIndex(l=>l.id===n);if(s<0||s>=r.length-1)return;const i=[...r];[i[s],i[s+1]]=[i[s+1],i[s]],t({editingGroups:i,isDirty:!0})},addFieldToGroup:(n,r)=>{const i=e().editingGroups.map(l=>l.id===n&&!l.fieldKeys.includes(r)?{...l,fieldKeys:[...l.fieldKeys,r]}:l);t({editingGroups:i,isDirty:!0})},removeFieldFromGroup:(n,r)=>{const i=e().editingGroups.map(l=>l.id===n?{...l,fieldKeys:l.fieldKeys.filter(u=>u!==r)}:l);t({editingGroups:i,isDirty:!0})},reorderFieldInGroup:(n,r,s)=>{const l=e().editingGroups.map(u=>{if(u.id===n){const p=[...u.fieldKeys],[f]=p.splice(r,1);return p.splice(s,0,f),{...u,fieldKeys:p}}return u});t({editingGroups:l,isDirty:!0})},moveFieldToGroup:(n,r,s,i)=>{let u=e().editingGroups.map(p=>({...p,fieldKeys:p.fieldKeys.filter(f=>f!==n)}));s!==null&&(u=u.map(p=>{if(p.id===s){const f=[...p.fieldKeys];return i!==void 0?f.splice(i,0,n):f.push(n),{...p,fieldKeys:f}}return p})),t({editingGroups:u,isDirty:!0})},setSelectedFieldKey:n=>t({selectedFieldKey:n}),setCurrentFieldPath:n=>t({currentFieldPath:n,selectedFieldKey:null}),setAddFieldDialogOpen:n=>t({addFieldDialogOpen:n}),setDeleteFieldDialogOpen:n=>t({deleteFieldDialogOpen:n}),setCreateContentTypeDialogOpen:n=>t({createContentTypeDialogOpen:n}),setEditContentTypeDialogOpen:n=>t({editContentTypeDialogOpen:n}),setEditingContentTypeListItem:n=>t({editingContentTypeListItem:n}),setMessage:n=>t({message:n}),setDirty:n=>t({isDirty:n}),setEditorMode:n=>t({editorMode:n}),setJsonSchemaText:n=>t({jsonSchemaText:n}),setJsonUiText:n=>t({jsonUiText:n}),setJsonSchemaIsDirty:n=>t({jsonSchemaIsDirty:n}),setJsonUiIsDirty:n=>t({jsonUiIsDirty:n}),setTabSwitchDialogOpen:n=>t({tabSwitchDialogOpen:n}),setPendingTabSwitch:n=>t({pendingTabSwitch:n}),setLocalContentTypeList:n=>t({localContentTypeList:n}),setIsListOrderDirty:n=>t({isListOrderDirty:n}),reset:()=>t(NO)}))}class Qre{constructor(e){this.store=e}getState(){const e=this.store.getState();return{editingId:e.editingId,editingLabel:e.editingLabel,editingFields:e.editingFields,editingGroups:e.editingGroups,selectedFieldKey:e.selectedFieldKey,currentFieldPath:e.currentFieldPath,addFieldDialogOpen:e.addFieldDialogOpen,deleteFieldDialogOpen:e.deleteFieldDialogOpen,createContentTypeDialogOpen:e.createContentTypeDialogOpen,editContentTypeDialogOpen:e.editContentTypeDialogOpen,editingContentTypeListItem:e.editingContentTypeListItem,message:e.message,isDirty:e.isDirty,editorMode:e.editorMode,jsonSchemaText:e.jsonSchemaText,jsonUiText:e.jsonUiText,jsonSchemaIsDirty:e.jsonSchemaIsDirty,jsonUiIsDirty:e.jsonUiIsDirty,tabSwitchDialogOpen:e.tabSwitchDialogOpen,pendingTabSwitch:e.pendingTabSwitch,localContentTypeList:e.localContentTypeList,isListOrderDirty:e.isListOrderDirty}}setEditingId(e){this.store.getState().setEditingId(e)}setEditingLabel(e){this.store.getState().setEditingLabel(e)}setEditingFields(e){this.store.getState().setEditingFields(e)}updateField(e,n){this.store.getState().updateField(e,n)}addField(e){this.store.getState().addField(e)}removeField(e){this.store.getState().removeField(e)}setEditingGroups(e){this.store.getState().setEditingGroups(e)}addGroup(e){this.store.getState().addGroup(e)}updateGroup(e,n){this.store.getState().updateGroup(e,n)}removeGroup(e){this.store.getState().removeGroup(e)}moveGroupUp(e){this.store.getState().moveGroupUp(e)}moveGroupDown(e){this.store.getState().moveGroupDown(e)}addFieldToGroup(e,n){this.store.getState().addFieldToGroup(e,n)}removeFieldFromGroup(e,n){this.store.getState().removeFieldFromGroup(e,n)}reorderFieldInGroup(e,n,r){this.store.getState().reorderFieldInGroup(e,n,r)}reorderFields(e,n){this.store.getState().reorderFields(e,n)}moveFieldToGroup(e,n,r,s){this.store.getState().moveFieldToGroup(e,n,r,s)}setSelectedFieldKey(e){this.store.getState().setSelectedFieldKey(e)}setCurrentFieldPath(e){this.store.getState().setCurrentFieldPath(e)}openAddFieldDialog(){this.store.getState().setAddFieldDialogOpen(!0)}closeAddFieldDialog(){this.store.getState().setAddFieldDialogOpen(!1)}openDeleteFieldDialog(){this.store.getState().setDeleteFieldDialogOpen(!0)}closeDeleteFieldDialog(){this.store.getState().setDeleteFieldDialogOpen(!1)}openCreateContentTypeDialog(){this.store.getState().setCreateContentTypeDialogOpen(!0)}closeCreateContentTypeDialog(){this.store.getState().setCreateContentTypeDialogOpen(!1)}openEditContentTypeDialog(e){this.store.getState().setEditingContentTypeListItem(e),this.store.getState().setEditContentTypeDialogOpen(!0)}closeEditContentTypeDialog(){this.store.getState().setEditContentTypeDialogOpen(!1),this.store.getState().setEditingContentTypeListItem(null)}setMessage(e){this.store.getState().setMessage(e)}clearMessage(){this.store.getState().setMessage(null)}setDirty(e){this.store.getState().setDirty(e)}setEditorMode(e){this.store.getState().setEditorMode(e)}setJsonSchemaText(e){this.store.getState().setJsonSchemaText(e)}setJsonUiText(e){this.store.getState().setJsonUiText(e)}setJsonSchemaIsDirty(e){this.store.getState().setJsonSchemaIsDirty(e)}setJsonUiIsDirty(e){this.store.getState().setJsonUiIsDirty(e)}openTabSwitchDialog(e){this.store.getState().setPendingTabSwitch(e),this.store.getState().setTabSwitchDialogOpen(!0)}closeTabSwitchDialog(){this.store.getState().setTabSwitchDialogOpen(!1),this.store.getState().setPendingTabSwitch(null)}setLocalContentTypeList(e){this.store.getState().setLocalContentTypeList(e),this.store.getState().setIsListOrderDirty(!0)}clearLocalContentTypeList(){this.store.getState().setLocalContentTypeList(null),this.store.getState().setIsListOrderDirty(!1)}reset(){this.store.getState().reset()}subscribe(e){return this.store.subscribe(e)}}const Jre=Kre(),Jr=new Qre(Jre);function FO(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Yre(t){if(Array.isArray(t))return t}function Xre(t,e,n){return(e=ose(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ese(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,i,l,u=[],p=!0,f=!1;try{if(i=(n=n.call(t)).next,e!==0)for(;!(p=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);p=!0);}catch(m){f=!0,s=m}finally{try{if(!p&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw s}}return u}}function tse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
486
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function UO(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?BO(Object(n),!0).forEach(function(r){Xre(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):BO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nse(t,e){if(t==null)return{};var n,r,s=rse(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}function rse(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function sse(t,e){return Yre(t)||ese(t,e)||ase(t,e)||tse()}function ise(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ose(t){var e=ise(t,"string");return typeof e=="symbol"?e:e+""}function ase(t,e){if(t){if(typeof t=="string")return FO(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FO(t,e):void 0}}function lse(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function HO(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?VO(Object(n),!0).forEach(function(r){lse(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):VO(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function cse(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){return e.reduceRight(function(s,i){return i(s)},r)}}function Yf(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=t.length?t.apply(this,s):function(){for(var l=arguments.length,u=new Array(l),p=0;p<l;p++)u[p]=arguments[p];return e.apply(n,[].concat(s,u))}}}function Bv(t){return{}.toString.call(t).includes("Object")}function use(t){return!Object.keys(t).length}function tm(t){return typeof t=="function"}function dse(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function pse(t,e){return Bv(e)||Yl("changeType"),Object.keys(e).some(function(n){return!dse(t,n)})&&Yl("changeField"),e}function fse(t){tm(t)||Yl("selectorType")}function hse(t){tm(t)||Bv(t)||Yl("handlerType"),Bv(t)&&Object.values(t).some(function(e){return!tm(e)})&&Yl("handlersType")}function mse(t){t||Yl("initialIsRequired"),Bv(t)||Yl("initialType"),use(t)&&Yl("initialContent")}function gse(t,e){throw new Error(t[e]||t.default)}var yse={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Yl=Yf(gse)(yse),_y={changes:pse,selector:fse,handler:hse,initial:mse};function vse(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_y.initial(t),_y.handler(e);var n={current:t},r=Yf(Sse)(n,e),s=Yf(bse)(n),i=Yf(_y.changes)(t),l=Yf(xse)(n);function u(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(m){return m};return _y.selector(f),f(n.current)}function p(f){cse(r,s,i,l)(f)}return[u,p]}function xse(t,e){return tm(e)?e(t.current):e}function bse(t,e){return t.current=HO(HO({},t.current),e),e}function Sse(t,e,n){return tm(e)?e(t.current):Object.keys(n).forEach(function(r){var s;return(s=e[r])===null||s===void 0?void 0:s.call(e,t.current[r])}),n}var Cse={create:vse},wse={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function jse(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=t.length?t.apply(this,s):function(){for(var l=arguments.length,u=new Array(l),p=0;p<l;p++)u[p]=arguments[p];return e.apply(n,[].concat(s,u))}}}function Tse(t){return{}.toString.call(t).includes("Object")}function Dse(t){return t||WO("configIsRequired"),Tse(t)||WO("configType"),t.urls?(Ese(),{paths:{vs:t.urls.monacoBase}}):t}function Ese(){console.warn(O5.deprecation)}function Rse(t,e){throw new Error(t[e]||t.default)}var O5={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
487
|
+
You are using deprecated way of configuration.
|
|
488
|
+
|
|
489
|
+
Instead of using
|
|
490
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
491
|
+
use
|
|
492
|
+
monaco.config({ paths: { vs: '...' } })
|
|
493
|
+
|
|
494
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
495
|
+
`},WO=jse(Rse)(O5),kse={config:Dse},Mse=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(i,l){return l(i)},s)}};function A5(t,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&t[n]&&Object.assign(e[n],A5(t[n],e[n]))}),UO(UO({},t),e)}var Ose={type:"cancelation",msg:"operation is manually canceled"};function b1(t){var e=!1,n=new Promise(function(r,s){t.then(function(i){return e?s(Ose):r(i)}),t.catch(s)});return n.cancel=function(){return e=!0},n}var Ase=["monaco"],_se=Cse.create({config:wse,isInitialized:!1,resolve:null,reject:null,monaco:null}),_5=sse(_se,2),Bm=_5[0],tb=_5[1];function Ise(t){var e=kse.config(t),n=e.monaco,r=nse(e,Ase);tb(function(s){return{config:A5(s.config,r),monaco:n}})}function Pse(){var t=Bm(function(e){var n=e.monaco,r=e.isInitialized,s=e.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!t.isInitialized){if(tb({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),b1(S1);if(window.monaco&&window.monaco.editor)return I5(window.monaco),t.resolve(window.monaco),b1(S1);Mse(Lse,$se)(Nse)}return b1(S1)}function Lse(t){return document.body.appendChild(t)}function zse(t){var e=document.createElement("script");return t&&(e.src=t),e}function $se(t){var e=Bm(function(r){var s=r.config,i=r.reject;return{config:s,reject:i}}),n=zse("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return t()},n.onerror=e.reject,n}function Nse(){var t=Bm(function(n){var r=n.config,s=n.resolve,i=n.reject;return{config:r,resolve:s,reject:i}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(n){var r=n.m||n;I5(r),t.resolve(r)},function(n){t.reject(n)})}function I5(t){Bm().monaco||tb({monaco:t})}function Fse(){return Bm(function(t){var e=t.monaco;return e})}var S1=new Promise(function(t,e){return tb({resolve:t,reject:e})}),P5={config:Ise,init:Pse,__getMonacoInstance:Fse},Bse={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},C1=Bse,Use={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Vse=Use;function Hse({children:t}){return We.createElement("div",{style:Vse.container},t)}var Wse=Hse,qse=Wse;function Gse({width:t,height:e,isEditorReady:n,loading:r,_ref:s,className:i,wrapperProps:l}){return We.createElement("section",{style:{...C1.wrapper,width:t,height:e},...l},!n&&We.createElement(qse,null,r),We.createElement("div",{ref:s,style:{...C1.fullWidth,...!n&&C1.hide},className:i}))}var Zse=Gse,L5=b.memo(Zse);function Kse(t){b.useEffect(t,[])}var z5=Kse;function Qse(t,e,n=!0){let r=b.useRef(!0);b.useEffect(r.current||!n?()=>{r.current=!1}:t,e)}var mi=Qse;function fh(){}function Rd(t,e,n,r){return Jse(t,r)||Yse(t,e,n,r)}function Jse(t,e){return t.editor.getModel($5(t,e))}function Yse(t,e,n,r){return t.editor.createModel(e,n,r?$5(t,r):void 0)}function $5(t,e){return t.Uri.parse(e)}function Xse({original:t,modified:e,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:l,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:p=!1,theme:f="light",loading:m="Loading...",options:g={},height:y="100%",width:v="100%",className:C,wrapperProps:S={},beforeMount:j=fh,onMount:D=fh}){let[M,T]=b.useState(!1),[E,k]=b.useState(!0),A=b.useRef(null),O=b.useRef(null),I=b.useRef(null),$=b.useRef(D),R=b.useRef(j),P=b.useRef(!1);z5(()=>{let U=P5.init();return U.then(L=>(O.current=L)&&k(!1)).catch(L=>(L==null?void 0:L.type)!=="cancelation"&&console.error("Monaco initialization: error:",L)),()=>A.current?H():U.cancel()}),mi(()=>{if(A.current&&O.current){let U=A.current.getOriginalEditor(),L=Rd(O.current,t||"",r||n||"text",i||"");L!==U.getModel()&&U.setModel(L)}},[i],M),mi(()=>{if(A.current&&O.current){let U=A.current.getModifiedEditor(),L=Rd(O.current,e||"",s||n||"text",l||"");L!==U.getModel()&&U.setModel(L)}},[l],M),mi(()=>{let U=A.current.getModifiedEditor();U.getOption(O.current.editor.EditorOption.readOnly)?U.setValue(e||""):e!==U.getValue()&&(U.executeEdits("",[{range:U.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),U.pushUndoStop())},[e],M),mi(()=>{var U,L;(L=(U=A.current)==null?void 0:U.getModel())==null||L.original.setValue(t||"")},[t],M),mi(()=>{let{original:U,modified:L}=A.current.getModel();O.current.editor.setModelLanguage(U,r||n||"text"),O.current.editor.setModelLanguage(L,s||n||"text")},[n,r,s],M),mi(()=>{var U;(U=O.current)==null||U.editor.setTheme(f)},[f],M),mi(()=>{var U;(U=A.current)==null||U.updateOptions(g)},[g],M);let z=b.useCallback(()=>{var W;if(!O.current)return;R.current(O.current);let U=Rd(O.current,t||"",r||n||"text",i||""),L=Rd(O.current,e||"",s||n||"text",l||"");(W=A.current)==null||W.setModel({original:U,modified:L})},[n,e,s,t,r,i,l]),N=b.useCallback(()=>{var U;!P.current&&I.current&&(A.current=O.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...g}),z(),(U=O.current)==null||U.editor.setTheme(f),T(!0),P.current=!0)},[g,f,z]);b.useEffect(()=>{M&&$.current(A.current,O.current)},[M]),b.useEffect(()=>{!E&&!M&&N()},[E,M,N]);function H(){var L,W,K,Q;let U=(L=A.current)==null?void 0:L.getModel();u||((W=U==null?void 0:U.original)==null||W.dispose()),p||((K=U==null?void 0:U.modified)==null||K.dispose()),(Q=A.current)==null||Q.dispose()}return We.createElement(L5,{width:v,height:y,isEditorReady:M,loading:m,_ref:I,className:C,wrapperProps:S})}var eie=Xse;b.memo(eie);function tie(t){let e=b.useRef();return b.useEffect(()=>{e.current=t},[t]),e.current}var nie=tie,Iy=new Map;function rie({defaultValue:t,defaultLanguage:e,defaultPath:n,value:r,language:s,path:i,theme:l="light",line:u,loading:p="Loading...",options:f={},overrideServices:m={},saveViewState:g=!0,keepCurrentModel:y=!1,width:v="100%",height:C="100%",className:S,wrapperProps:j={},beforeMount:D=fh,onMount:M=fh,onChange:T,onValidate:E=fh}){let[k,A]=b.useState(!1),[O,I]=b.useState(!0),$=b.useRef(null),R=b.useRef(null),P=b.useRef(null),z=b.useRef(M),N=b.useRef(D),H=b.useRef(),U=b.useRef(r),L=nie(i),W=b.useRef(!1),K=b.useRef(!1);z5(()=>{let F=P5.init();return F.then(J=>($.current=J)&&I(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>R.current?le():F.cancel()}),mi(()=>{var J,ie,te,de;let F=Rd($.current,t||r||"",e||s||"",i||n||"");F!==((J=R.current)==null?void 0:J.getModel())&&(g&&Iy.set(L,(ie=R.current)==null?void 0:ie.saveViewState()),(te=R.current)==null||te.setModel(F),g&&((de=R.current)==null||de.restoreViewState(Iy.get(i))))},[i],k),mi(()=>{var F;(F=R.current)==null||F.updateOptions(f)},[f],k),mi(()=>{!R.current||r===void 0||(R.current.getOption($.current.editor.EditorOption.readOnly)?R.current.setValue(r):r!==R.current.getValue()&&(K.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),R.current.pushUndoStop(),K.current=!1))},[r],k),mi(()=>{var J,ie;let F=(J=R.current)==null?void 0:J.getModel();F&&s&&((ie=$.current)==null||ie.editor.setModelLanguage(F,s))},[s],k),mi(()=>{var F;u!==void 0&&((F=R.current)==null||F.revealLine(u))},[u],k),mi(()=>{var F;(F=$.current)==null||F.editor.setTheme(l)},[l],k);let Q=b.useCallback(()=>{var F;if(!(!P.current||!$.current)&&!W.current){N.current($.current);let J=i||n,ie=Rd($.current,r||t||"",e||s||"",J||"");R.current=(F=$.current)==null?void 0:F.editor.create(P.current,{model:ie,automaticLayout:!0,...f},m),g&&R.current.restoreViewState(Iy.get(J)),$.current.editor.setTheme(l),u!==void 0&&R.current.revealLine(u),A(!0),W.current=!0}},[t,e,n,r,s,i,f,m,g,l,u]);b.useEffect(()=>{k&&z.current(R.current,$.current)},[k]),b.useEffect(()=>{!O&&!k&&Q()},[O,k,Q]),U.current=r,b.useEffect(()=>{var F,J;k&&T&&((F=H.current)==null||F.dispose(),H.current=(J=R.current)==null?void 0:J.onDidChangeModelContent(ie=>{K.current||T(R.current.getValue(),ie)}))},[k,T]),b.useEffect(()=>{if(k){let F=$.current.editor.onDidChangeMarkers(J=>{var te;let ie=(te=R.current.getModel())==null?void 0:te.uri;if(ie&&J.find(de=>de.path===ie.path)){let de=$.current.editor.getModelMarkers({resource:ie});E==null||E(de)}});return()=>{F==null||F.dispose()}}return()=>{}},[k,E]);function le(){var F,J;(F=H.current)==null||F.dispose(),y?g&&Iy.set(i,R.current.saveViewState()):(J=R.current.getModel())==null||J.dispose(),R.current.dispose()}return We.createElement(L5,{width:v,height:C,isEditorReady:k,loading:p,_ref:P,className:S,wrapperProps:j})}var sie=rie,iie=b.memo(sie),oie=iie;function nm({value:t,onChange:e,height:n=500,readOnly:r=!1}){const s=b.useRef(null),i=b.useCallback(u=>{s.current=u,u.addAction({id:"format-json",label:"Format JSON",keybindings:[],run:()=>{var p;(p=u.getAction("editor.action.formatDocument"))==null||p.run()}})},[]),l=b.useCallback(u=>{u!==void 0&&e&&e(u)},[e]);return a.jsx(B,{"data-component-name":"cmp:JsonEditor",sx:{height:n,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:a.jsx(oie,{height:n,defaultLanguage:"json",value:t,onChange:l,onMount:i,loading:a.jsxs(B,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",gap:1},children:[a.jsx(ut,{size:20}),a.jsx(G,{variant:"body2",color:"text.secondary",children:"エディタを読み込み中..."})]}),options:{readOnly:r,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,tabSize:2,wordWrap:"on",automaticLayout:!0,formatOnPaste:!0,formatOnType:!1,lineNumbers:"on",folding:!0,renderWhitespace:"selection",bracketPairColorization:{enabled:!0}},theme:"vs-dark"})})}function Na(t){try{return{success:!0,data:JSON.parse(t)}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Invalid JSON"}}}function nb({open:t,onStay:e,onDiscard:n,onSaveAndSwitch:r}){return a.jsxs(Qt,{"data-component-name":"cmp:UnsavedTabSwitchDialog",open:t,onClose:e,maxWidth:"xs",fullWidth:!0,children:[a.jsx(Yt,{children:"未保存の変更があります"}),a.jsx(Jt,{children:a.jsx(Eo,{children:"編集中の内容が保存されていません。タブを切り替える前に保存しますか?"})}),a.jsxs(rn,{sx:{px:3,pb:2},children:[a.jsx(pe,{onClick:e,color:"inherit",children:"キャンセル"}),a.jsx(pe,{onClick:n,color:"error",children:"破棄して切り替え"}),a.jsx(pe,{onClick:r,variant:"contained",children:"保存して切り替え"})]})]})}function rm({filePath:t,isSaving:e,isDirty:n,onFormat:r,onReset:s,onSave:i,readOnly:l=!1}){return a.jsxs(B,{"data-component-name":"cmp:JsonEditorHeader",sx:{flexShrink:0,display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",sm:"center"},gap:2,px:3,pb:1.5,borderBottom:1,borderColor:"divider"},children:[a.jsx(G,{variant:"body2",color:"text.secondary",sx:{fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:t}),!l&&a.jsxs(B,{sx:{display:"flex",gap:1,flexShrink:0},children:[a.jsx(pe,{variant:"outlined",size:"small",onClick:r,disabled:!r,children:"フォーマット"}),a.jsx(pe,{variant:"outlined",size:"small",onClick:s,disabled:!s,children:"元に戻す"}),a.jsx(pe,{variant:"contained",startIcon:e?a.jsx(ut,{size:20,color:"inherit"}):a.jsx(na,{}),onClick:i,disabled:!n||e||!i,children:e?"保存中...":"保存"})]})]})}class N5{constructor(e,n,r,s,i,l,u){St(this,"pendingGroupId",null);this.repo=e,this.presenter=n,this.contentTypeId=r,this.username=s,this.navigate=i,this.navigateToField=l,this.unsavedGuard=u}getState(){const e=this.presenter.getState(),n=e.selectedFieldKey!==null?e.editingFields.find(r=>r.key===e.selectedFieldKey)??null:null;return{contentTypeId:this.contentTypeId,editingId:e.editingId,editingLabel:e.editingLabel,editingFields:e.editingFields,editingGroups:e.editingGroups,originalContentType:this.repo.getContentType(),originalContentTypeUi:this.repo.getContentTypeUi(),contentTypeList:e.localContentTypeList??this.repo.getContentTypeList(),selectedFieldKey:e.selectedFieldKey,selectedField:n,currentFieldPath:e.currentFieldPath,isLoading:this.repo.isLoading(),isSaving:this.repo.isSaving(),isDirty:e.isDirty,error:this.repo.getError(),message:e.message,addFieldDialogOpen:e.addFieldDialogOpen,deleteFieldDialogOpen:e.deleteFieldDialogOpen,createContentTypeDialogOpen:e.createContentTypeDialogOpen,editContentTypeDialogOpen:e.editContentTypeDialogOpen,editingContentTypeListItem:e.editingContentTypeListItem,unsavedGuard:this.unsavedGuard??null,editorMode:e.editorMode,jsonSchemaText:e.jsonSchemaText,jsonUiText:e.jsonUiText,jsonSchemaIsDirty:e.jsonSchemaIsDirty,jsonUiIsDirty:e.jsonUiIsDirty,tabSwitchDialogOpen:e.tabSwitchDialogOpen,pendingTabSwitch:e.pendingTabSwitch,isListOrderDirty:e.isListOrderDirty}}initializeFromData(e,n){var s;const r=this.mergeFields(e.fields,n.fields);this.presenter.setEditingId(e.id),this.presenter.setEditingLabel(n.label),this.presenter.setEditingFields(r),this.presenter.setEditingGroups(n.groups??[]),this.presenter.setDirty(!1),oe.info("ContentTypeEditorUseCase.initializeFromData",{contentTypeId:e.id,fieldCount:r.length,groupCount:((s=n.groups)==null?void 0:s.length)??0})}initializeForNewContentType(){this.presenter.setEditingId(""),this.presenter.setEditingLabel(""),this.presenter.setEditingFields([]),this.presenter.setEditingGroups([]),this.presenter.setDirty(!1),oe.info("ContentTypeEditorUseCase.initializeForNewContentType")}selectField(e){var n;this.presenter.setSelectedFieldKey(e),(n=this.navigateToField)==null||n.call(this,e)}clearSelection(){var e;this.presenter.setSelectedFieldKey(null),(e=this.navigateToField)==null||e.call(this,null)}updateCurrentField(e){const{selectedFieldKey:n}=this.presenter.getState();n!==null&&this.presenter.updateField(n,e)}addField(e){const n=this.createDefaultField(e);this.presenter.addField(n),this.presenter.closeAddFieldDialog(),oe.info("ContentTypeEditorUseCase.addField",{key:e.key,type:e.type})}addLabel(){var s;const n=`label-${Math.random().toString(36).substring(2,8)}`,r=this.createDefaultField({key:n,type:"label",label:"新しいラベル"});this.presenter.addField(r),this.presenter.setSelectedFieldKey(n),(s=this.navigateToField)==null||s.call(this,n),oe.info("ContentTypeEditorUseCase.addLabel",{key:n})}openAddFieldDialogForGroup(e){this.presenter.openAddFieldDialog(),this.pendingGroupId=e}addFieldToGroup(e,n){const r=this.createDefaultField(e);this.presenter.addField(r),this.presenter.addFieldToGroup(n,e.key),this.presenter.closeAddFieldDialog(),oe.info("ContentTypeEditorUseCase.addFieldToGroup",{key:e.key,groupId:n})}addLabelToGroup(e){var i;const r=`label-${Math.random().toString(36).substring(2,8)}`,s=this.createDefaultField({key:r,type:"label",label:"新しいラベル"});this.presenter.addField(s),this.presenter.addFieldToGroup(e,r),this.presenter.setSelectedFieldKey(r),(i=this.navigateToField)==null||i.call(this,r),oe.info("ContentTypeEditorUseCase.addLabelToGroup",{key:r,groupId:e})}getPendingGroupId(){return this.pendingGroupId}clearPendingGroupId(){this.pendingGroupId=null}deleteCurrentField(){const{selectedFieldKey:e}=this.presenter.getState();e!==null&&(this.presenter.removeField(e),this.presenter.closeDeleteFieldDialog(),oe.info("ContentTypeEditorUseCase.deleteCurrentField",{key:e}))}toggleFieldBreak(e){const{editingFields:n}=this.presenter.getState(),r=n.find(s=>s.key===e);r&&this.presenter.updateField(e,{break:!r.break})}changeFieldColumns(e,n){this.presenter.updateField(e,{columns:n})}addGroup(e){const n=`group_${Date.now()}`;this.presenter.addGroup({id:n,label:e,fieldKeys:[]}),oe.info("ContentTypeEditorUseCase.addGroup",{id:n,label:e})}moveGroupUp(e){this.presenter.moveGroupUp(e)}moveGroupDown(e){this.presenter.moveGroupDown(e)}renameGroup(e,n){this.presenter.updateGroup(e,{label:n}),oe.info("ContentTypeEditorUseCase.renameGroup",{groupId:e,newLabel:n})}removeGroup(e,n=!1){if(n){const{editingGroups:r}=this.presenter.getState(),s=r.find(i=>i.id===e);if(s)for(const i of s.fieldKeys)this.presenter.removeField(i)}this.presenter.removeGroup(e),oe.info("ContentTypeEditorUseCase.removeGroup",{groupId:e,deleteFields:n})}moveFieldToGroup(e,n,r,s){this.presenter.moveFieldToGroup(e,n,r,s),oe.info("ContentTypeEditorUseCase.moveFieldToGroup",{fieldKey:e,fromGroupId:n,toGroupId:r,toIndex:s})}reorderFieldInGroup(e,n,r){this.presenter.reorderFieldInGroup(e,n,r)}reorderUngroupedFields(e,n){const{editingFields:r}=this.presenter.getState(),s=r.findIndex(l=>l.key===e),i=r.findIndex(l=>l.key===n);s!==-1&&i!==-1&&this.presenter.reorderFields(s,i)}enterItemFieldsEdit(e){var f;const{currentFieldPath:n,editingFields:r}=this.presenter.getState(),s=r.findIndex(m=>m.key===e),i=r[s];if(!i||i.type!=="array")return;const l=[...n,s];this.presenter.setCurrentFieldPath(l);const p=(((f=i.options)==null?void 0:f.itemFields)??[]).map(m=>this.createEditableFieldFromDefinition(m));this.presenter.setEditingFields(p),this.presenter.setEditingGroups([]),this.presenter.setSelectedFieldKey(null),oe.info("ContentTypeEditorUseCase.enterItemFieldsEdit",{fieldKey:e,newPath:l,itemFieldsCount:p.length})}exitItemFieldsEdit(){const{currentFieldPath:e}=this.presenter.getState();if(e.length===0)return;const n=e.slice(0,-1);this.presenter.setCurrentFieldPath(n),this.presenter.setSelectedFieldKey(null),oe.info("ContentTypeEditorUseCase.exitItemFieldsEdit",{newPath:n})}openAddFieldDialog(){this.presenter.openAddFieldDialog()}closeAddFieldDialog(){this.presenter.closeAddFieldDialog()}openDeleteFieldDialog(){this.presenter.openDeleteFieldDialog()}closeDeleteFieldDialog(){this.presenter.closeDeleteFieldDialog()}openCreateContentTypeDialog(){this.presenter.openCreateContentTypeDialog()}closeCreateContentTypeDialog(){this.presenter.closeCreateContentTypeDialog()}openEditContentTypeDialog(e){this.presenter.openEditContentTypeDialog(e)}closeEditContentTypeDialog(){this.presenter.closeEditContentTypeDialog()}reorderContentTypes(e,n){const s=this.presenter.getState().localContentTypeList??this.repo.getContentTypeList(),i=s.findIndex(p=>p.id===e),l=s.findIndex(p=>p.id===n);if(i===-1||l===-1)return;const u=U2(s,i,l);this.presenter.setLocalContentTypeList(u),oe.info("ContentTypeEditorUseCase.reorderContentTypes",{activeId:e,overId:n})}async saveListOrder(){const e=this.presenter.getState();if(!e.localContentTypeList||!e.isListOrderDirty)return!0;try{return await this.repo.reorderContentTypes(e.localContentTypeList),this.presenter.clearLocalContentTypeList(),this.presenter.setMessage({type:"success",text:"表示順序を保存しました"}),oe.info("ContentTypeEditorUseCase.saveListOrder"),!0}catch(n){const r=n instanceof Error?n.message:String(n);return this.presenter.setMessage({type:"error",text:`順序保存に失敗しました: ${r}`}),oe.error("ContentTypeEditorUseCase.saveListOrder failed",{error:n}),!1}}cancelListReorder(){this.presenter.clearLocalContentTypeList()}async updateContentTypeMetadata(e){try{await this.repo.updateContentTypeListItem(e),this.presenter.closeEditContentTypeDialog(),this.presenter.setMessage({type:"success",text:`コンテンツタイプ "${e.label}" を更新しました`}),oe.info("ContentTypeEditorUseCase.updateContentTypeMetadata",{id:e.id})}catch(n){const r=n instanceof Error?n.message:String(n);this.presenter.setMessage({type:"error",text:`更新に失敗しました: ${r}`}),oe.error("ContentTypeEditorUseCase.updateContentTypeMetadata failed",{error:n})}}clearMessage(){this.presenter.clearMessage()}requestTabSwitch(e){const{editorMode:n,jsonSchemaIsDirty:r,jsonUiIsDirty:s,isDirty:i}=this.presenter.getState();if(n===e)return;let l=!1;n==="ui"?l=i:n==="json-schema"?l=r:n==="json-ui"&&(l=s),l?this.presenter.openTabSwitchDialog(e):this.switchTab(e)}switchTab(e){const{editorMode:n,editingId:r,editingLabel:s,editingFields:i,editingGroups:l}=this.presenter.getState();if(e==="json-schema"&&n==="ui"){const u=this.extractContentType(r,s,i,l),p=JSON.stringify(u,null,2);this.presenter.setJsonSchemaText(p),this.presenter.setJsonSchemaIsDirty(!1)}if(e==="json-ui"&&n==="ui"){const u=this.extractContentTypeUi(r,s,i,l),p=JSON.stringify(u,null,2);this.presenter.setJsonUiText(p),this.presenter.setJsonUiIsDirty(!1)}if(e==="ui"&&n==="json-schema"){const{jsonSchemaText:u}=this.presenter.getState(),p=Na(u);if(!p.success){this.presenter.setMessage({type:"error",text:`JSONの構文エラー: ${p.error}`});return}const f=this.extractContentTypeUi(r,s,i,l);this.applyJsonToUiState({contentType:p.data,contentTypeUi:f})}if(e==="ui"&&n==="json-ui"){const{jsonUiText:u}=this.presenter.getState(),p=Na(u);if(!p.success){this.presenter.setMessage({type:"error",text:`JSONの構文エラー: ${p.error}`});return}const f=this.extractContentType(r,s,i,l);this.applyJsonToUiState({contentType:f,contentTypeUi:p.data})}if(e==="json-ui"&&n==="json-schema"){const u=this.extractContentTypeUi(r,s,i,l),p=JSON.stringify(u,null,2);this.presenter.setJsonUiText(p),this.presenter.setJsonUiIsDirty(!1)}if(e==="json-schema"&&n==="json-ui"){const u=this.extractContentType(r,s,i,l),p=JSON.stringify(u,null,2);this.presenter.setJsonSchemaText(p),this.presenter.setJsonSchemaIsDirty(!1)}this.presenter.setEditorMode(e),this.presenter.closeTabSwitchDialog()}discardAndSwitchTab(){const{pendingTabSwitch:e,editorMode:n}=this.presenter.getState();e&&(n==="json-schema"?this.presenter.setJsonSchemaIsDirty(!1):n==="json-ui"&&this.presenter.setJsonUiIsDirty(!1),this.switchTab(e))}async saveAndSwitchTab(){const{pendingTabSwitch:e,editorMode:n}=this.presenter.getState();if(e){if(n==="json-schema"||n==="json-ui"){if(!await this.saveFromJson())return}else await this.save();this.switchTab(e)}}cancelTabSwitch(){this.presenter.closeTabSwitchDialog()}updateJsonSchemaText(e){this.presenter.setJsonSchemaText(e),this.presenter.setJsonSchemaIsDirty(!0)}updateJsonUiText(e){this.presenter.setJsonUiText(e),this.presenter.setJsonUiIsDirty(!0)}applyJsonToUiState(e){const{contentType:n,contentTypeUi:r}=e,s=this.mergeFields(n.fields,r.fields);this.presenter.setEditingId(n.id),this.presenter.setEditingLabel(r.label),this.presenter.setEditingFields(s),this.presenter.setEditingGroups(r.groups??[]),this.presenter.setDirty(!0),this.presenter.setJsonSchemaIsDirty(!1),this.presenter.setJsonUiIsDirty(!1),oe.info("ContentTypeEditorUseCase.applyJsonToUiState",{contentTypeId:n.id,fieldCount:s.length})}async saveFromJson(){var m;const{editorMode:e,jsonSchemaText:n,jsonUiText:r,editingId:s,editingLabel:i,editingFields:l,editingGroups:u}=this.presenter.getState();let p,f;if(e==="json-schema"){const g=Na(n);if(!g.success)return this.presenter.setMessage({type:"error",text:`JSONの構文エラー: ${g.error}`}),!1;p=g.data,f=this.extractContentTypeUi(s,i,l,u)}else if(e==="json-ui"){const g=Na(r);if(!g.success)return this.presenter.setMessage({type:"error",text:`JSONの構文エラー: ${g.error}`}),!1;f=g.data,p=this.extractContentType(s,i,l,u)}else p=this.extractContentType(s,i,l,u),f=this.extractContentTypeUi(s,i,l,u);try{return await this.repo.saveContentType({contentType:p,contentTypeUi:f}),this.presenter.setJsonSchemaIsDirty(!1),this.presenter.setJsonUiIsDirty(!1),this.presenter.setDirty(!1),(m=this.unsavedGuard)==null||m.setJustSaved(),this.presenter.setMessage({type:"success",text:"コンテンツタイプを保存しました"}),oe.info("ContentTypeEditorUseCase.saveFromJson",{contentTypeId:p.id}),!0}catch(g){const y=g instanceof Error?g.message:String(g);return this.presenter.setMessage({type:"error",text:`保存に失敗しました: ${y}`}),oe.error("ContentTypeEditorUseCase.saveFromJson failed",{error:g}),!1}}formatJson(){const{editorMode:e,jsonSchemaText:n,jsonUiText:r}=this.presenter.getState();try{if(e==="json-schema"){const s=JSON.parse(n),i=JSON.stringify(s,null,2);this.presenter.setJsonSchemaText(i)}else if(e==="json-ui"){const s=JSON.parse(r),i=JSON.stringify(s,null,2);this.presenter.setJsonUiText(i)}}catch{this.presenter.setMessage({type:"error",text:"JSONのフォーマットに失敗しました(構文エラー)"})}}resetJson(){const{editorMode:e,editingId:n,editingLabel:r,editingFields:s,editingGroups:i}=this.presenter.getState();if(e==="json-schema"){const l=this.extractContentType(n,r,s,i),u=JSON.stringify(l,null,2);this.presenter.setJsonSchemaText(u),this.presenter.setJsonSchemaIsDirty(!1)}else if(e==="json-ui"){const l=this.extractContentTypeUi(n,r,s,i),u=JSON.stringify(l,null,2);this.presenter.setJsonUiText(u),this.presenter.setJsonUiIsDirty(!1)}this.presenter.setMessage({type:"info",text:"JSONをUI状態から再生成しました"})}prepareJsonForMode(e){const{editingId:n,editingFields:r,editingGroups:s,jsonSchemaText:i,jsonUiText:l}=this.presenter.getState(),u=n!=="";if(e==="json-schema"&&!i&&u){const{editingLabel:p}=this.presenter.getState(),f=this.extractContentType(n,p,r,s),m=JSON.stringify(f,null,2);this.presenter.setJsonSchemaText(m),this.presenter.setJsonSchemaIsDirty(!1)}if(e==="json-ui"&&!l&&u){const{editingLabel:p}=this.presenter.getState(),f=this.extractContentTypeUi(n,p,r,s),m=JSON.stringify(f,null,2);this.presenter.setJsonUiText(m),this.presenter.setJsonUiIsDirty(!1)}this.presenter.setEditorMode(e)}async save(){var u;const{editingId:e,editingLabel:n,editingFields:r,editingGroups:s}=this.presenter.getState(),i=this.extractContentType(e,n,r,s),l=this.extractContentTypeUi(e,n,r,s);try{await this.repo.saveContentType({contentType:i,contentTypeUi:l}),this.presenter.setDirty(!1),(u=this.unsavedGuard)==null||u.setJustSaved(),this.presenter.setMessage({type:"success",text:"コンテンツタイプを保存しました"}),oe.info("ContentTypeEditorUseCase.save",{contentTypeId:e})}catch(p){const f=p instanceof Error?p.message:String(p);this.presenter.setMessage({type:"error",text:`保存に失敗しました: ${f}`}),oe.error("ContentTypeEditorUseCase.save failed",{error:p})}}async createContentType(e){const n={id:e.id,fields:[]},r={id:e.id,label:e.label,fields:[],groups:[]},s={defaultViewId:"default",views:[{id:"default",label:"デフォルト",columns:[{field:"title",label:"タイトル",width:"50%",sortable:!0},{field:"status",label:"ステータス",sortable:!0},{field:"updatedAt",label:"更新日時",sortable:!0}]}]},i={id:e.id,label:e.label,icon:e.icon};try{await this.repo.createContentType({contentType:n,contentTypeUi:r,contentTypeViews:s,contentTypeListItem:i}),this.presenter.closeCreateContentTypeDialog(),this.presenter.setMessage({type:"success",text:`コンテンツタイプ "${e.label}" を作成しました`}),oe.info("ContentTypeEditorUseCase.createContentType",{id:e.id}),this.navigate&&this.navigate(`/content-types/${e.id}/edit`)}catch(l){const u=l instanceof Error?l.message:String(l);this.presenter.setMessage({type:"error",text:`作成に失敗しました: ${u}`}),oe.error("ContentTypeEditorUseCase.createContentType failed",{error:l})}}mergeFields(e,n){const r=new Map(e.map(l=>[l.key,l])),s=n.map(l=>{const u=r.get(l.key);return u?{key:u.key,type:u.type,multiple:u.multiple,useAsUrl:u.useAsUrl??!1,options:u.options,label:l.label??u.key,required:l.required??!1,defaultValue:l.defaultValue??this.getDefaultValueForType(u.type),placeholder:l.placeholder??null,description:l.description??null,warnLength:l.warnLength??null,columns:l.columns??12,break:l.break??!1,hidden:l.hidden??!1,readOnly:l.readOnly??!1,aspectRatio:l.aspectRatio,pattern:l.pattern??null,patternMessage:l.patternMessage??null,autoFormat:l.autoFormat??null,labelColor:l.labelColor??null}:{key:l.key,type:l.type??"label",multiple:!1,options:void 0,label:l.label,required:!1,defaultValue:void 0,placeholder:l.placeholder??null,description:l.description??null,warnLength:null,columns:l.columns??12,break:l.break??!1,hidden:l.hidden??!1,readOnly:!0,pattern:null,patternMessage:null,autoFormat:null,labelColor:l.labelColor??null}}),i=new Set(n.map(l=>l.key));for(const l of e)i.has(l.key)||s.push({key:l.key,type:l.type,multiple:l.multiple,options:l.options,label:l.key,required:!1,defaultValue:this.getDefaultValueForType(l.type),placeholder:null,description:null,warnLength:null,columns:12,break:!1,hidden:!1,readOnly:!1,aspectRatio:void 0,pattern:null,patternMessage:null,autoFormat:null,labelColor:null});return s}createEditableFieldFromDefinition(e){return{key:e.key,type:e.type,multiple:e.multiple,useAsUrl:e.useAsUrl??!1,options:e.options,label:e.key,required:!1,defaultValue:this.getDefaultValueForType(e.type),placeholder:null,description:null,warnLength:null,columns:12,break:!1,hidden:!1,readOnly:!1,pattern:null,patternMessage:null,autoFormat:null}}createDefaultField(e){return{key:e.key,type:e.type,multiple:e.multiple??!1,useAsUrl:!1,options:this.getDefaultOptionsForType(e.type),label:e.label,required:!1,defaultValue:this.getDefaultValueForType(e.type),placeholder:null,description:null,warnLength:null,columns:12,break:!1,hidden:!1,readOnly:!1,pattern:null,patternMessage:null,autoFormat:null}}getDefaultValueForType(e){switch(e){case"text":case"html":case"markdown":case"date":case"select":return"";case"number":return"";case"boolean":return!1;case"image":case"file":return null;case"relation":return null;case"array":return[];default:return""}}getDefaultOptionsForType(e){switch(e){case"select":return{choices:[]};case"relation":return{targetContentType:""};case"array":return{itemType:"text",itemFields:[],minItems:0,maxItems:void 0};default:return}}extractContentType(e,n,r,s){const l=this.getOrderedFields(r,s).filter(u=>u.type!=="label");return{id:e,fields:l.map(u=>({key:u.key,type:u.type,multiple:u.multiple,...u.useAsUrl&&{useAsUrl:!0},...u.options&&{options:u.options}}))}}extractContentTypeUi(e,n,r,s){return{id:e,label:n,fields:r.map(i=>({key:i.key,...i.type==="label"&&{type:i.type},label:i.label,required:i.required,defaultValue:i.defaultValue,placeholder:i.placeholder,description:i.description,warnLength:i.warnLength,columns:i.columns,break:i.break,hidden:i.hidden,readOnly:i.readOnly,...i.aspectRatio!==void 0&&{aspectRatio:i.aspectRatio},...i.pattern!==void 0&&{pattern:i.pattern},...i.patternMessage!==void 0&&{patternMessage:i.patternMessage},...i.autoFormat!==void 0&&{autoFormat:i.autoFormat},...i.labelColor!==void 0&&{labelColor:i.labelColor}})),groups:s.map(i=>({id:i.id,label:i.label,fieldKeys:i.fieldKeys}))}}getOrderedFields(e,n){const r=new Map(e.map(u=>[u.key,u])),s=new Set,i=[],l=new Set(n.flatMap(u=>u.fieldKeys));for(const u of e)l.has(u.key)||(i.push(u),s.add(u.key));for(const u of n)for(const p of u.fieldKeys){const f=r.get(p);f&&!s.has(p)&&(i.push(f),s.add(p))}return i}reset(){this.presenter.reset()}}function Um(t){const{isDirty:e}=t,[n,r]=b.useState(!1),s=e&&!n,i=b.useRef(s);i.current=s;const l=d_({shouldBlockFn:()=>i.current,withResolver:!0});b.useEffect(()=>{if(!s)return;const g=y=>(y.preventDefault(),y.returnValue="","");return window.addEventListener("beforeunload",g),()=>window.removeEventListener("beforeunload",g)},[s]);const u=b.useRef(e);b.useEffect(()=>{e&&!u.current&&r(!1),u.current=e},[e]);const p=b.useCallback(()=>{l.status==="blocked"&&l.proceed()},[l]),f=b.useCallback(()=>{l.status==="blocked"&&l.reset()},[l]),m=b.useCallback(()=>{r(!0),i.current=!1},[]);return{isBlocked:l.status==="blocked",proceed:p,reset:f,setJustSaved:m}}function aie(t,e){const n=new Map(t.map(i=>[i.key,i])),r=e.map(i=>{const l=n.get(i.key);return l?{key:l.key,type:l.type,multiple:l.multiple,options:l.options,label:i.label??l.key,required:i.required??!1,defaultValue:i.defaultValue??qO(l.type),placeholder:i.placeholder??null,description:i.description??null,warnLength:i.warnLength??null,columns:i.columns??12,break:i.break??!1,hidden:i.hidden??!1,readOnly:i.readOnly??!1,aspectRatio:i.aspectRatio,pattern:i.pattern??null,patternMessage:i.patternMessage??null,autoFormat:i.autoFormat??null,labelColor:i.labelColor??null}:{key:i.key,type:i.type??"label",multiple:!1,options:void 0,label:i.label,required:!1,defaultValue:void 0,placeholder:i.placeholder??null,description:i.description??null,warnLength:null,columns:i.columns??12,break:i.break??!1,hidden:i.hidden??!1,readOnly:!0,pattern:null,patternMessage:null,autoFormat:null,labelColor:i.labelColor??null}}),s=new Set(e.map(i=>i.key));for(const i of t)s.has(i.key)||r.push({key:i.key,type:i.type,multiple:i.multiple,options:i.options,label:i.key,required:!1,defaultValue:qO(i.type),placeholder:null,description:null,warnLength:null,columns:12,break:!1,hidden:!1,readOnly:!1,aspectRatio:void 0,pattern:null,patternMessage:null,autoFormat:null,labelColor:null});return r}function qO(t){switch(t){case"text":case"html":case"markdown":case"date":case"select":return"";case"number":return"";case"boolean":return!1;case"image":case"file":return null;case"relation":return null;case"array":return[];default:return""}}function lie(){const{authUseCase:t}=rr(),{branchUseCase:e}=Ei(),{token:n,githubUser:r}=t.getState(),s=(e==null?void 0:e.getCurrentBranch())??"develop",i=(r==null?void 0:r.login)??"unknown",l=ys(),p=uc({strict:!1}).contentTypeId??"",f=ur({from:"/content-types/$contentTypeId/edit"}),m=Di({from:"/content-types/$contentTypeId/edit"});b.useSyncExternalStore(Jr.subscribe.bind(Jr),()=>JSON.stringify(Jr.getState()));const g=jn(pi.ContentTypeQueryParams(n,p,s)),y=jn(pi.ContentTypeUiQueryParams(n,p,s)),v=jn(pi.ContentTypeListQueryParams(n,s)),C=Pn(pi.SaveMutationParams(l,n,s,p)),S=Pn(pi.CreateMutationParams(l,n,s)),j=Pn(pi.UpdateContentTypeListItemMutationParams(l,n,s)),D=Pn(pi.ReorderContentTypesMutationParams(l,n,s)),M=new pi(g,y,v,C,S,j,D,l,s,p),T=N=>{f({to:N})},E=N=>{f({search:N?{field:N}:{},replace:!1})},k=Jr.getState().isDirty,A=Um({isDirty:k}),O=new N5(M,Jr,p,i,T,E,A),I=b.useRef(null),$=g.data,R=y.data;b.useEffect(()=>{if(I.current===p||!$||!R)return;I.current!==null&&I.current!==p&&Jr.reset();const N=aie($.fields,R.fields);Jr.setEditingId($.id),Jr.setEditingLabel(R.label),Jr.setEditingFields(N),Jr.setEditingGroups(R.groups??[]),Jr.setDirty(!1),I.current=p},[$,R,p]);const P=b.useRef(s);b.useEffect(()=>{P.current!==s&&(I.current=null,Jr.reset(),P.current=s)},[s]),b.useEffect(()=>()=>{Jr.reset(),I.current=null},[]);const z=b.useRef(void 0);return b.useEffect(()=>{const N=m.field,H=Jr.getState().selectedFieldKey;z.current!==N&&(z.current=N,N!==H&&Jr.setSelectedFieldKey(N??null))},[m.field]),{contentTypeEditorUseCase:O}}function cie(){const{authUseCase:t}=rr(),{branchUseCase:e}=Ei(),{token:n,githubUser:r}=t.getState(),s=(e==null?void 0:e.getCurrentBranch())??"develop",i=(r==null?void 0:r.login)??"unknown",l=ys(),u=ur();b.useSyncExternalStore(Jr.subscribe.bind(Jr),()=>JSON.stringify(Jr.getState()));const p=jn(pi.ContentTypeListQueryParams(n,s)),f={data:null,isLoading:!1,error:null},m={data:null,isLoading:!1,error:null},g={mutateAsync:async()=>{},isPending:!1},y=Pn(pi.UpdateContentTypeListItemMutationParams(l,n,s)),v=Pn(pi.ReorderContentTypesMutationParams(l,n,s)),C=new pi(f,m,p,g,Pn(pi.CreateMutationParams(l,n,s)),y,v,l,s,""),S=D=>{u({to:D})};return{contentTypeEditorUseCase:new N5(C,Jr,"",i,S)}}const w1=[{value:"Article",label:"記事",keywords:["article","news","post","blog","記事","ニュース"]},{value:"Description",label:"ドキュメント",keywords:["document","text","file","content","ドキュメント"]},{value:"Folder",label:"フォルダ",keywords:["folder","directory","category","フォルダ"]},{value:"Image",label:"画像",keywords:["image","picture","photo","visual","画像","写真"]},{value:"Movie",label:"動画",keywords:["movie","video","film","動画","ビデオ"]},{value:"MusicNote",label:"音楽",keywords:["music","audio","sound","song","音楽","オーディオ"]},{value:"Book",label:"本",keywords:["book","library","reading","manual","本","書籍"]},{value:"Feed",label:"フィード",keywords:["feed","rss","news","updates","フィード"]},{value:"Newspaper",label:"ニュース",keywords:["newspaper","news","publication","ニュース","新聞"]},{value:"LibraryBooks",label:"ライブラリ",keywords:["library","books","collection","ライブラリ"]},{value:"AutoStories",label:"ストーリー",keywords:["story","narrative","tale","ストーリー","物語"]},{value:"Notes",label:"ノート",keywords:["notes","memo","notepad","ノート","メモ"]},{value:"TextFields",label:"テキスト",keywords:["text","field","input","テキスト"]},{value:"Email",label:"メール",keywords:["email","mail","message","inbox","メール"]},{value:"Chat",label:"チャット",keywords:["chat","messaging","conversation","チャット","会話"]},{value:"Forum",label:"フォーラム",keywords:["forum","discussion","community","フォーラム","掲示板"]},{value:"Comment",label:"コメント",keywords:["comment","reply","feedback","コメント","返信"]},{value:"ContactPage",label:"連絡先",keywords:["contact","phone","address","連絡先","コンタクト"]},{value:"Textsms",label:"SMS",keywords:["sms","text","message","SMS","メッセージ"]},{value:"Phone",label:"電話",keywords:["phone","call","contact","電話","コール"]},{value:"Announcement",label:"お知らせ",keywords:["announcement","notice","alert","お知らせ","通知"]},{value:"Work",label:"仕事",keywords:["work","job","task","project","仕事","プロジェクト"]},{value:"Store",label:"ストア",keywords:["store","shop","retail","selling","ストア","店舗"]},{value:"ShoppingCart",label:"ショッピング",keywords:["shopping","cart","ecommerce","buy","カート","買い物"]},{value:"Payment",label:"支払い",keywords:["payment","money","transaction","billing","支払い","決済"]},{value:"Receipt",label:"レシート",keywords:["receipt","invoice","bill","document","レシート","請求書"]},{value:"CreditCard",label:"カード",keywords:["card","credit","payment","transaction","カード","クレジット"]},{value:"Inventory",label:"在庫",keywords:["inventory","stock","warehouse","storage","在庫","倉庫"]},{value:"Analytics",label:"分析",keywords:["analytics","data","chart","report","分析","レポート"]},{value:"TrendingUp",label:"トレンド",keywords:["trending","growth","increase","analytics","トレンド","成長"]},{value:"Business",label:"ビジネス",keywords:["business","company","corporate","ビジネス","会社"]},{value:"Person",label:"人物",keywords:["person","user","profile","individual","人物","ユーザー"]},{value:"People",label:"グループ",keywords:["people","team","group","users","グループ","チーム"]},{value:"Group",label:"団体",keywords:["group","community","organization","team","団体","組織"]},{value:"AccountCircle",label:"アカウント",keywords:["account","profile","user","person","アカウント","プロフィール"]},{value:"Face",label:"顔",keywords:["face","user","person","profile","顔","ユーザー"]},{value:"SupervisorAccount",label:"管理者",keywords:["supervisor","admin","manager","leader","管理者","マネージャー"]},{value:"Event",label:"イベント",keywords:["event","occasion","happening","イベント","催し"]},{value:"CalendarToday",label:"カレンダー",keywords:["calendar","date","schedule","plan","カレンダー","日程"]},{value:"Schedule",label:"スケジュール",keywords:["schedule","plan","timetable","calendar","スケジュール","予定"]},{value:"AccessTime",label:"時間",keywords:["time","clock","hour","schedule","時間","時計"]},{value:"Alarm",label:"アラーム",keywords:["alarm","alert","notification","reminder","アラーム","リマインダー"]},{value:"Today",label:"今日",keywords:["today","date","calendar","今日","日付"]},{value:"Place",label:"場所",keywords:["place","location","venue","site","場所","ロケーション"]},{value:"Map",label:"マップ",keywords:["map","location","geography","navigation","マップ","地図"]},{value:"Home",label:"ホーム",keywords:["home","house","residence","apartment","ホーム","家"]},{value:"LocationOn",label:"位置情報",keywords:["location","gps","map","address","位置","GPS"]},{value:"School",label:"学校",keywords:["school","education","university","campus","学校","教育"]},{value:"LocalHospital",label:"病院",keywords:["hospital","medical","health","clinic","病院","医療"]},{value:"Restaurant",label:"レストラン",keywords:["restaurant","food","dining","cafe","レストラン","飲食"]},{value:"Hotel",label:"ホテル",keywords:["hotel","accommodation","lodging","inn","ホテル","宿泊"]},{value:"Storefront",label:"店舗",keywords:["storefront","shop","retail","store","店舗","ショップ"]},{value:"PhotoCamera",label:"カメラ",keywords:["camera","photo","photography","picture","カメラ","撮影"]},{value:"Videocam",label:"ビデオカメラ",keywords:["videocam","video","recording","capture","ビデオカメラ","録画"]},{value:"Mic",label:"マイク",keywords:["microphone","audio","voice","recording","マイク","音声"]},{value:"Headphones",label:"ヘッドフォン",keywords:["headphones","audio","music","listening","ヘッドフォン"]},{value:"PlayCircle",label:"再生",keywords:["play","video","media","playback","再生","プレイ"]},{value:"VolumeUp",label:"ボリューム",keywords:["volume","sound","audio","speaker","ボリューム","音量"]},{value:"Settings",label:"設定",keywords:["settings","config","options","preferences","設定","オプション"]},{value:"Build",label:"ビルド",keywords:["build","construction","development","tool","ビルド","構築"]},{value:"Dashboard",label:"ダッシュボード",keywords:["dashboard","overview","admin","panel","ダッシュボード"]},{value:"Tune",label:"チューン",keywords:["tune","settings","adjust","customize","チューン","調整"]},{value:"Code",label:"コード",keywords:["code","programming","development","technical","コード","プログラム"]},{value:"Extension",label:"拡張",keywords:["extension","plugin","addon","module","拡張","プラグイン"]},{value:"AttachFile",label:"ファイル添付",keywords:["attachment","file","document","upload","添付","ファイル"]},{value:"CloudUpload",label:"アップロード",keywords:["upload","cloud","sync","transfer","アップロード"]},{value:"FilePresent",label:"ファイル",keywords:["file","document","archive","folder","ファイル"]},{value:"PictureAsPdf",label:"PDF",keywords:["pdf","document","file","export","PDF","ドキュメント"]},{value:"CloudDownload",label:"ダウンロード",keywords:["download","cloud","sync","transfer","ダウンロード"]},{value:"Star",label:"スター",keywords:["star","favorite","rating","important","スター","お気に入り"]},{value:"Favorite",label:"お気に入り",keywords:["favorite","like","preference","heart","お気に入り","ハート"]},{value:"Flag",label:"フラグ",keywords:["flag","marker","highlight","bookmark","フラグ","マーカー"]},{value:"LocalOffer",label:"タグ",keywords:["offer","tag","label","promotion","タグ","ラベル"]},{value:"Label",label:"ラベル",keywords:["label","tag","category","classification","ラベル"]},{value:"Category",label:"カテゴリ",keywords:["category","classification","type","group","カテゴリ","分類"]},{value:"Help",label:"ヘルプ",keywords:["help","support","assistance","faq","ヘルプ","サポート"]},{value:"Info",label:"インフォ",keywords:["info","information","details","about","インフォ","情報"]},{value:"CheckCircle",label:"完了",keywords:["done","complete","success","approved","完了","チェック"]},{value:"Search",label:"検索",keywords:["search","find","query","filter","検索","探す"]},{value:"Bookmark",label:"ブックマーク",keywords:["bookmark","save","favorite","ブックマーク","保存"]},{value:"Link",label:"リンク",keywords:["link","url","chain","connect","リンク","URL"]},{value:"Public",label:"パブリック",keywords:["public","global","world","internet","パブリック","公開"]},{value:"Lock",label:"ロック",keywords:["lock","secure","private","protected","ロック","セキュリティ"]}],uie="https://mui.com/material-ui/material-icons/";function F5({value:t,onChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState(!1),[l,u]=b.useState(""),p=!w1.some(v=>v.value===t),f=b.useMemo(()=>{if(!n.trim())return w1;const v=n.toLowerCase();return w1.filter(C=>C.label.toLowerCase().includes(v)||C.value.toLowerCase().includes(v)?!0:C.keywords.some(S=>S.toLowerCase().includes(v)))},[n]),m=v=>{const C=v.trim(),S=C.match(/from\s+['"]@mui\/icons-material\/(\w+)['"]/);if(S)return S[1];const j=C.match(/<(\w+)Icon\s*\/?>/);if(j)return j[1];const D=C.match(/^(\w+)Icon$/);return D?D[1]:C},g=v=>{const C=m(v);u(C)},y=()=>{const v=m(l);v&&(e(v),u(""),i(!1))};return a.jsxs(B,{"data-component-name":"cmp:IconPicker",children:[a.jsx(Xe,{fullWidth:!0,size:"small",placeholder:"アイコンを検索...",value:n,onChange:v=>r(v.target.value),slotProps:{input:{startAdornment:a.jsx(c2,{position:"start",children:a.jsx(Om,{fontSize:"small",color:"action"})})}},sx:{mb:2}}),p&&a.jsxs(B,{sx:{mb:2,p:1.5,bgcolor:"action.hover",borderRadius:1,display:"flex",alignItems:"center",gap:1.5},children:[a.jsx(MC,{iconName:t,sx:{fontSize:28}}),a.jsxs(B,{sx:{flex:1},children:[a.jsx(G,{variant:"body2",children:"現在のアイコン"}),a.jsx(G,{variant:"caption",color:"text.secondary",fontFamily:"monospace",children:t})]})]}),a.jsx(B,{sx:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:1,maxHeight:300,overflowY:"auto",p:1,border:1,borderColor:"divider",borderRadius:1},children:f.length===0?a.jsx(B,{sx:{gridColumn:"1 / -1",py:4,textAlign:"center"},children:a.jsx(G,{variant:"body2",color:"text.secondary",children:"該当するアイコンがありません"})}):f.map(v=>a.jsxs(B,{onClick:()=>e(v.value),sx:{display:"flex",flexDirection:"column",alignItems:"center",p:1,borderRadius:1,cursor:"pointer",border:2,borderColor:t===v.value?"primary.main":"transparent",bgcolor:t===v.value?"primary.light":"transparent","&:hover":{bgcolor:t===v.value?"primary.light":"action.hover"},transition:"all 0.15s ease-in-out"},title:v.label,children:[a.jsx(MC,{iconName:v.value,sx:{fontSize:28,color:t===v.value?"primary.contrastText":"text.primary"}}),a.jsx(G,{variant:"caption",sx:{mt:.5,fontSize:"0.65rem",textAlign:"center",lineHeight:1.2,color:t===v.value?"primary.contrastText":"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%"},children:v.label})]},v.value))}),a.jsxs(B,{sx:{mt:1.5,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsx(pe,{size:"small",startIcon:a.jsx(Ri,{}),onClick:()=>i(!s),sx:{fontSize:"0.75rem"},children:"アイコン名を直接入力"}),a.jsxs(Ox,{href:uie,target:"_blank",rel:"noopener noreferrer",sx:{display:"inline-flex",alignItems:"center",gap:.5,fontSize:"0.75rem"},children:["MUI Icons",a.jsx(ip,{sx:{fontSize:14}})]})]}),a.jsx(Co,{in:s,children:a.jsxs(B,{sx:{mt:1.5,display:"flex",gap:1},children:[a.jsx(Xe,{size:"small",fullWidth:!0,placeholder:"import文をそのまま貼り付け、またはアイコン名を入力",value:l,onChange:v=>g(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),y())},helperText:"MUI Icons のコピーボタンで取得した import 文をそのまま貼り付けできます",slotProps:{input:{sx:{fontFamily:"monospace"}}}}),a.jsx(pe,{variant:"contained",size:"small",onClick:y,disabled:!l.trim(),sx:{alignSelf:"flex-start"},children:"設定"})]})})]})}function die(t){return t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/^-+|-+$/g,"")}function pie({open:t,existingIds:e,onClose:n,onSubmit:r}){const[s,i]=b.useState(""),[l,u]=b.useState(!1),[p,f]=b.useState(""),[m,g]=b.useState("Article");b.useEffect(()=>{t&&(i(""),u(!1),f(""),g("Article"))},[t]);const y=M=>{f(M),l||i(die(M))},v=M=>{i(M),u(!0)},C=()=>{D&&r({id:s.trim(),label:p.trim(),icon:m})},S=!e.includes(s.trim()),j=/^[a-z][a-z0-9-]*$/.test(s.trim()),D=s.trim()&&p.trim()&&S&&j;return a.jsxs(Qt,{open:t,onClose:n,maxWidth:"sm",fullWidth:!0,"data-component-name":"cmp:CreateContentTypeDialog",children:[a.jsx(Yt,{children:"コンテンツタイプを作成"}),a.jsx(Jt,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[a.jsx(Xe,{label:"ラベル",value:p,onChange:M=>y(M.target.value),required:!0,fullWidth:!0,size:"small",autoFocus:!0,helperText:"管理画面で表示される名前"}),a.jsx(Xe,{label:"ID",value:s,onChange:M=>v(M.target.value),required:!0,fullWidth:!0,size:"small",error:!!s&&(!S||!j),helperText:s&&!S?"既に存在するIDです":s&&!j?"小文字で始まり、小文字、数字、ハイフンのみ使用可能":"APIやファイル名で使用される識別子(後から変更不可)",slotProps:{input:{sx:{fontFamily:"monospace"}}}}),a.jsxs(B,{children:[a.jsx(G,{variant:"body2",sx:{mb:1},children:"アイコン"}),a.jsx(F5,{value:m,onChange:g})]}),a.jsx(G,{variant:"caption",color:"text.secondary",children:"作成後、フィールドを追加してコンテンツタイプを定義できます。"})]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:n,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:C,disabled:!D,children:"作成"})]})]})}function fie({open:t,contentType:e,onClose:n,onSubmit:r,isLoading:s=!1}){const[i,l]=b.useState(""),[u,p]=b.useState("Article"),[f,m]=b.useState("normal");b.useEffect(()=>{t&&e&&(l(e.label),p(e.icon),m(e.displayLocation??"normal"))},[t,e]);const g=()=>{!e||!y||r({id:e.id,label:i.trim(),icon:u,displayLocation:f})},y=i.trim().length>0;return a.jsxs(Qt,{open:t,onClose:n,maxWidth:"sm",fullWidth:!0,"data-component-name":"cmp:EditContentTypeDialog",children:[a.jsx(Yt,{children:"コンテンツタイプを編集"}),a.jsx(Jt,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[a.jsxs(B,{children:[a.jsx(G,{variant:"caption",color:"text.secondary",children:"ID"}),a.jsx(G,{variant:"body2",fontFamily:"monospace",children:e==null?void 0:e.id})]}),a.jsx(Xe,{label:"ラベル",value:i,onChange:v=>l(v.target.value),required:!0,fullWidth:!0,size:"small",autoFocus:!0,helperText:"管理画面で表示される名前",error:i.trim().length===0}),a.jsxs(B,{children:[a.jsx(G,{variant:"body2",sx:{mb:1},children:"アイコン"}),a.jsx(F5,{value:u,onChange:p})]}),a.jsxs(_n,{fullWidth:!0,size:"small",children:[a.jsx(nr,{id:"display-location-label",children:"ダッシュボードでの表示"}),a.jsxs(wn,{labelId:"display-location-label",value:f,onChange:v=>m(v.target.value),label:"ダッシュボードでの表示",children:[a.jsx(nt,{value:"normal",children:"通常表示"}),a.jsx(nt,{value:"collapsed",children:"折りたたみ(その他)"}),a.jsx(nt,{value:"hidden",children:"非表示(開発者のみ)"})]}),a.jsxs(Dh,{children:[f==="normal"&&"ダッシュボードに常時表示されます",f==="collapsed"&&"「その他のコンテンツ」セクションに折りたたまれます",f==="hidden"&&"コンテンツタイプ編集権限を持つユーザーのみに表示されます"]})]})]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:n,disabled:s,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:g,disabled:!y||s,startIcon:s?a.jsx(ut,{size:16}):void 0,children:s?"保存中...":"保存"})]})]})}const hie=Ss("/content-types/")({component:mie});function mie(){const{authUseCase:t}=rr(),{currentUser:e}=t.getState(),n=ur(),r=ws(e,"canViewContentType"),s=ws(e,"canEditContentType");return b.useEffect(()=>{e&&!r&&n({to:"/"})},[e,r,n]),r?a.jsx(vie,{canEdit:s}):null}function gie({ct:t,useCase:e,canEdit:n}){const{attributes:r,listeners:s,setNodeRef:i,transform:l,transition:u,isDragging:p}=eb({id:t.id,disabled:!n}),f={transform:sa.Transform.toString(l),transition:u,opacity:p?.5:1};return a.jsxs(eo,{ref:i,style:f,hover:!0,"data-component-name":"cmp:SortableTableRow",children:[n&&a.jsx(Kt,{sx:{cursor:"grab",width:40,touchAction:"none","&:active":{cursor:"grabbing"}},...r,...s,children:a.jsx(wu,{sx:{color:"text.secondary",verticalAlign:"middle"}})}),a.jsx(Kt,{sx:n?{cursor:"pointer"}:void 0,onClick:n?()=>e.openEditContentTypeDialog(t):void 0,title:n?"クリックしてアイコン・ラベルを編集":void 0,children:a.jsx(Vx,{iconName:t.icon})}),a.jsx(Kt,{sx:n?{cursor:"pointer"}:void 0,onClick:n?()=>e.openEditContentTypeDialog(t):void 0,title:n?"クリックしてアイコン・ラベルを編集":void 0,children:a.jsxs(B,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:{xs:.5,sm:2},alignItems:{xs:"flex-start",sm:"center"}},children:[a.jsx(G,{variant:"body2",fontFamily:"monospace",color:"text.secondary",children:t.id}),a.jsx(G,{children:t.label})]})}),a.jsxs(Kt,{align:"center",children:[a.jsx(ft,{component:gs,to:`/content-types/${t.id}/edit`,size:"small",title:n?"スキーマ編集":"スキーマ閲覧",children:a.jsx(Ri,{fontSize:"small"})}),a.jsx(ft,{component:gs,to:`/content-types/${t.id}/views`,size:"small",title:n?"ビュー編集":"ビュー閲覧",children:a.jsx(AP,{fontSize:"small"})})]})]})}function yie({ct:t}){return a.jsx(wp,{sx:{width:"100%",bgcolor:"background.paper",boxShadow:3,"& td":{borderBottom:"none"}},children:a.jsx(jp,{children:a.jsxs(eo,{children:[a.jsx(Kt,{sx:{width:40},children:a.jsx(wu,{sx:{color:"text.secondary",verticalAlign:"middle"}})}),a.jsx(Kt,{sx:{width:60},children:a.jsx(Vx,{iconName:t.icon})}),a.jsx(Kt,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:{xs:.5,sm:2},alignItems:{xs:"flex-start",sm:"center"}},children:[a.jsx(G,{variant:"body2",fontFamily:"monospace",color:"text.secondary",children:t.id}),a.jsx(G,{children:t.label})]})}),a.jsxs(Kt,{sx:{width:120},align:"center",children:[a.jsx(ft,{size:"small",disabled:!0,children:a.jsx(Ri,{fontSize:"small"})}),a.jsx(ft,{size:"small",disabled:!0,children:a.jsx(AP,{fontSize:"small"})})]})]})})})}function vie({canEdit:t}){const{contentTypeEditorUseCase:e}=cie(),{contentTypeList:n,isLoading:r,isSaving:s,error:i,message:l,createContentTypeDialogOpen:u,editContentTypeDialogOpen:p,editingContentTypeListItem:f,isListOrderDirty:m}=e.getState(),[g,y]=b.useState(null),{isBlocked:v,proceed:C,reset:S}=Um({isDirty:m}),j=Lm(Do(Tu,{activationConstraint:{distance:3}}),Do(ju,{coordinateGetter:Fm})),D=E=>{y(E.active.id)},M=E=>{const{active:k,over:A}=E;y(null),A&&k.id!==A.id&&e.reorderContentTypes(k.id,A.id)},T=g?n.find(E=>E.id===g):null;return r?a.jsx(B,{"data-component-name":"cmp:ContentTypesPage",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})}):i?a.jsx(B,{"data-component-name":"cmp:ContentTypesPage",sx:{flex:1,overflow:"auto",p:3},children:a.jsxs(zt,{severity:"error",children:["エラー: ",i.message]})}):a.jsxs(B,{"data-component-name":"cmp:ContentTypesPage",sx:{flex:1,overflow:"auto"},children:[a.jsxs(ji,{maxWidth:"lg",sx:{py:3},children:[a.jsx(no,{items:[{label:"コンテンツタイプ編集"}]}),a.jsx(la,{title:"コンテンツタイプ編集",actions:t&&a.jsxs(B,{sx:{display:"flex",gap:1},children:[a.jsx(pe,{variant:"contained",onClick:()=>e.saveListOrder(),disabled:s||!m,children:s?a.jsx(ut,{size:20}):"保存"}),a.jsx(pe,{variant:"contained",startIcon:a.jsx(Qn,{}),onClick:()=>e.openCreateContentTypeDialog(),children:"新規作成"})]})}),a.jsxs($m,{sensors:j,collisionDetection:Kx,onDragStart:D,onDragEnd:M,children:[a.jsx(YI,{component:$t,"data-component-name":"cmp:ContentTypesTable",children:a.jsxs(wp,{children:[a.jsx(jm,{children:a.jsxs(eo,{children:[t&&a.jsx(Kt,{width:40}),a.jsx(Kt,{width:60}),a.jsx(Kt,{children:"名前"}),a.jsx(Kt,{width:120,align:"center",children:"操作"})]})}),a.jsx(jp,{children:n.length===0?a.jsx(eo,{children:a.jsx(Kt,{colSpan:t?4:3,align:"center",sx:{py:4},children:a.jsx(G,{color:"text.secondary",children:"コンテンツタイプがありません"})})}):a.jsx(Nm,{items:n.map(E=>E.id),strategy:V2,children:n.map(E=>a.jsx(gie,{ct:E,useCase:e,canEdit:t},E.id))})})]})}),a.jsx(B2,{children:T?a.jsx(yie,{ct:T}):null})]})]}),a.jsx(pie,{open:u,onClose:()=>e.closeCreateContentTypeDialog(),onSubmit:E=>e.createContentType(E),existingIds:n.map(E=>E.id)}),a.jsx(fie,{open:p,contentType:f,onClose:()=>e.closeEditContentTypeDialog(),onSubmit:E=>e.updateContentTypeMetadata(E),isLoading:s}),a.jsx(ea,{open:l!==null,autoHideDuration:6e3,onClose:()=>e.clearMessage(),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{onClose:()=>e.clearMessage(),severity:(l==null?void 0:l.type)??"info",variant:"filled",children:l==null?void 0:l.text})}),a.jsxs(Qt,{open:v,onClose:S,children:[a.jsx(Yt,{children:"変更が保存されていません"}),a.jsx(Jt,{children:a.jsx(G,{children:"並び替えの変更が保存されていません。このまま離れると変更が失われます。"})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:S,children:"このページに留まる"}),a.jsx(pe,{onClick:C,color:"error",children:"変更を破棄して離れる"})]})]})]})}function xie(){return Fs((t,e)=>({editingRecipe:null,selection:null,contentTypeCacheEntries:[],expandedContentTypeIds:[],addRecipeDialogOpen:!1,addRecipeTargetContentTypeId:null,deleteRecipeDialogOpen:!1,previewDialogOpen:!1,generateDependencyMapDialogOpen:!1,message:null,editorMode:"ui",jsonEditText:"",jsonIsDirty:!1,tabSwitchDialogOpen:!1,pendingTabSwitch:null,setEditingRecipe:n=>t({editingRecipe:n}),updateEditingRecipe:n=>{const r=e().editingRecipe;r&&t({editingRecipe:n(r)})},setSelection:n=>t({selection:n}),setContentTypeCache:(n,r)=>{const s=e().contentTypeCacheEntries,i=s.findIndex(([l])=>l===n);if(i>=0){const l=[...s];l[i]=[n,r],t({contentTypeCacheEntries:l})}else t({contentTypeCacheEntries:[...s,[n,r]]})},setAddRecipeDialogOpen:n=>t({addRecipeDialogOpen:n}),setAddRecipeTargetContentTypeId:n=>t({addRecipeTargetContentTypeId:n}),setDeleteRecipeDialogOpen:n=>t({deleteRecipeDialogOpen:n}),setPreviewDialogOpen:n=>t({previewDialogOpen:n}),setGenerateDependencyMapDialogOpen:n=>t({generateDependencyMapDialogOpen:n}),setMessage:n=>t({message:n}),toggleContentTypeExpand:n=>{const r=e().expandedContentTypeIds,s=r.includes(n);t({expandedContentTypeIds:s?r.filter(i=>i!==n):[...r,n]})},setExpandedContentTypeIds:n=>t({expandedContentTypeIds:n}),setEditorMode:n=>t({editorMode:n}),setJsonEditText:n=>t({jsonEditText:n}),setJsonIsDirty:n=>t({jsonIsDirty:n}),setTabSwitchDialogOpen:n=>t({tabSwitchDialogOpen:n}),setPendingTabSwitch:n=>t({pendingTabSwitch:n})}))}class bie{constructor(e){St(this,"cachedExpandedContentTypeIds",null);St(this,"cachedContentTypeCacheEntries",null);St(this,"cachedExpandedContentTypes",null);St(this,"cachedContentTypeCache",null);this.store=e}getState(){const e=this.store.getState();let n;this.cachedExpandedContentTypeIds===e.expandedContentTypeIds&&this.cachedExpandedContentTypes!==null?n=this.cachedExpandedContentTypes:(n=new Set(e.expandedContentTypeIds),this.cachedExpandedContentTypeIds=e.expandedContentTypeIds,this.cachedExpandedContentTypes=n);let r;return this.cachedContentTypeCacheEntries===e.contentTypeCacheEntries&&this.cachedContentTypeCache!==null?r=this.cachedContentTypeCache:(r=new Map(e.contentTypeCacheEntries),this.cachedContentTypeCacheEntries=e.contentTypeCacheEntries,this.cachedContentTypeCache=r),{editingRecipe:e.editingRecipe,selection:e.selection,contentTypeCache:r,expandedContentTypes:n,addRecipeDialogOpen:e.addRecipeDialogOpen,addRecipeTargetContentTypeId:e.addRecipeTargetContentTypeId,deleteRecipeDialogOpen:e.deleteRecipeDialogOpen,previewDialogOpen:e.previewDialogOpen,generateDependencyMapDialogOpen:e.generateDependencyMapDialogOpen,message:e.message,editorMode:e.editorMode,jsonEditText:e.jsonEditText,jsonIsDirty:e.jsonIsDirty,tabSwitchDialogOpen:e.tabSwitchDialogOpen,pendingTabSwitch:e.pendingTabSwitch}}setEditingRecipe(e){this.store.getState().setEditingRecipe(e)}updateEditingRecipe(e){this.store.getState().updateEditingRecipe(e)}setSelection(e){this.store.getState().setSelection(e)}setContentTypeCache(e,n){this.store.getState().setContentTypeCache(e,n)}getContentTypeFromCache(e){const r=this.store.getState().contentTypeCacheEntries.find(([s])=>s===e);return r==null?void 0:r[1]}openAddRecipeDialog(e){this.store.getState().setAddRecipeTargetContentTypeId(e),this.store.getState().setAddRecipeDialogOpen(!0)}closeAddRecipeDialog(){this.store.getState().setAddRecipeDialogOpen(!1),this.store.getState().setAddRecipeTargetContentTypeId(null)}openDeleteRecipeDialog(){this.store.getState().setDeleteRecipeDialogOpen(!0)}closeDeleteRecipeDialog(){this.store.getState().setDeleteRecipeDialogOpen(!1)}openPreviewDialog(){this.store.getState().setPreviewDialogOpen(!0)}closePreviewDialog(){this.store.getState().setPreviewDialogOpen(!1)}openGenerateDependencyMapDialog(){this.store.getState().setGenerateDependencyMapDialogOpen(!0)}closeGenerateDependencyMapDialog(){this.store.getState().setGenerateDependencyMapDialogOpen(!1)}setMessage(e){this.store.getState().setMessage(e)}clearMessage(){this.store.getState().setMessage(null)}toggleContentTypeExpand(e){this.store.getState().toggleContentTypeExpand(e)}setExpandedContentTypes(e){this.store.getState().setExpandedContentTypeIds([...e])}setEditorMode(e){this.store.getState().setEditorMode(e)}setJsonEditText(e){this.store.getState().setJsonEditText(e)}setJsonIsDirty(e){this.store.getState().setJsonIsDirty(e)}openTabSwitchDialog(e){this.store.getState().setPendingTabSwitch(e),this.store.getState().setTabSwitchDialogOpen(!0)}closeTabSwitchDialog(){this.store.getState().setTabSwitchDialogOpen(!1),this.store.getState().setPendingTabSwitch(null)}subscribe(e){return this.store.subscribe(e)}}const B5=xie(),Fi=new bie(B5);function Sie(){const t=M5(B5,e=>e.expandedContentTypeIds);return new Set(t)}const GO="__content_types__",ZO="__static_pages__";function KO({useCase:t,canEdit:e=!0}){var m,g;const n=Sie(),r=t.getState(),{contentTypeList:s,editingRecipe:i,selection:l}=r;if(!i)return null;const u=((m=i.staticPages)==null?void 0:m.length)??0,p=n.has(GO),f=n.has(ZO);return s.some(y=>{var C,S;const v=i.contentTypes[y.id];return(((C=v==null?void 0:v.details)==null?void 0:C.length)??0)>0||(((S=v==null?void 0:v.lists)==null?void 0:S.length)??0)>0}),a.jsxs(B,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[a.jsx(B,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:a.jsx(G,{variant:"subtitle2",color:"text.secondary",children:"レシピツリー"})}),a.jsx(B,{sx:{flex:1,overflow:"auto"},children:a.jsxs(as,{dense:!0,disablePadding:!0,children:[a.jsxs(B,{children:[a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{onClick:()=>t.toggleContentTypeExpand(GO),children:[a.jsx(Un,{sx:{minWidth:28},children:p?a.jsx(Wr,{}):a.jsx(Jl,{})}),a.jsx(Un,{sx:{minWidth:32},children:a.jsx(ic,{sx:{fontSize:20},color:"primary"})}),a.jsx(Zn,{primary:"コンテンツタイプ",primaryTypographyProps:{fontWeight:"medium"}})]})}),a.jsx(Co,{in:p,timeout:"auto",unmountOnExit:!0,children:a.jsx(as,{dense:!0,disablePadding:!0,children:s.map(y=>{var M,T,E,k;const v=i.contentTypes[y.id],C=((M=v==null?void 0:v.details)==null?void 0:M.length)??0,S=((T=v==null?void 0:v.lists)==null?void 0:T.length)??0,j=n.has(y.id),D=C>0||S>0;return a.jsxs(B,{children:[a.jsx(Os,{disablePadding:!0,secondaryAction:e&&a.jsx(Er,{title:"レシピを追加",children:a.jsx(ft,{size:"small",onClick:A=>{A.stopPropagation(),t.openAddRecipeDialog(y.id)},children:a.jsx(Qn,{fontSize:"small"})})}),children:a.jsxs(os,{onClick:()=>t.toggleContentTypeExpand(y.id),disabled:!D,sx:{pl:4},children:[a.jsx(Un,{sx:{minWidth:28},children:D?j?a.jsx(Wr,{}):a.jsx(Jl,{}):a.jsx(B,{sx:{width:24}})}),a.jsx(Un,{sx:{minWidth:32},children:a.jsx(Vx,{iconName:y.icon,sx:{fontSize:20}})}),a.jsx(Zn,{primary:y.label,secondary:D?`詳細: ${C}, 一覧: ${S}`:void 0,primaryTypographyProps:{noWrap:!0},secondaryTypographyProps:{variant:"caption"}})]})}),a.jsx(Co,{in:j,timeout:"auto",unmountOnExit:!0,children:a.jsxs(as,{dense:!0,disablePadding:!0,children:[(E=v==null?void 0:v.details)==null?void 0:E.map((A,O)=>{const I=(l==null?void 0:l.type)==="contentType"&&l.contentTypeId===y.id&&l.recipeType==="detail"&&l.index===O;return a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{selected:I,onClick:()=>t.selectContentType(y.id,"detail",O),sx:{pl:11},children:[a.jsx(Un,{sx:{minWidth:32},children:a.jsx(Tp,{fontSize:"small",color:"action"})}),a.jsx(Zn,{primary:A.outputPath,primaryTypographyProps:{noWrap:!0,variant:"body2"}})]})},`detail-${O}`)}),(k=v==null?void 0:v.lists)==null?void 0:k.map((A,O)=>{const I=(l==null?void 0:l.type)==="contentType"&&l.contentTypeId===y.id&&l.recipeType==="list"&&l.index===O;return a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{selected:I,onClick:()=>t.selectContentType(y.id,"list",O),sx:{pl:11},children:[a.jsx(Un,{sx:{minWidth:32},children:a.jsx(XJ,{fontSize:"small",color:"action"})}),a.jsx(Zn,{primary:A.outputPath,primaryTypographyProps:{noWrap:!0,variant:"body2"}})]})},`list-${O}`)})]})})]},y.id)})})})]}),a.jsxs(B,{children:[a.jsx(Os,{disablePadding:!0,secondaryAction:e&&a.jsx(Er,{title:"固定ページを追加",children:a.jsx(ft,{size:"small",onClick:y=>{y.stopPropagation(),t.openAddRecipeDialog("__static__")},children:a.jsx(Qn,{fontSize:"small"})})}),children:a.jsxs(os,{onClick:()=>t.toggleContentTypeExpand(ZO),disabled:u===0,children:[a.jsx(Un,{sx:{minWidth:28},children:u>0?f?a.jsx(Wr,{}):a.jsx(Jl,{}):a.jsx(B,{sx:{width:24}})}),a.jsx(Un,{sx:{minWidth:32},children:a.jsx(ic,{sx:{fontSize:20},color:"primary"})}),a.jsx(Zn,{primary:"固定ページ",secondary:u>0?`${u}件`:void 0,primaryTypographyProps:{fontWeight:"medium"},secondaryTypographyProps:{variant:"caption"}})]})}),a.jsx(Co,{in:f,timeout:"auto",unmountOnExit:!0,children:a.jsx(as,{dense:!0,disablePadding:!0,children:(g=i.staticPages)==null?void 0:g.map((y,v)=>{const C=(l==null?void 0:l.type)==="staticPage"&&l.index===v;return a.jsx(Os,{disablePadding:!0,children:a.jsxs(os,{selected:C,onClick:()=>t.selectStaticPage(v),sx:{pl:7},children:[a.jsx(Un,{sx:{minWidth:32},children:a.jsx(km,{fontSize:"small",color:"action"})}),a.jsx(Zn,{primary:y.outputPath,primaryTypographyProps:{noWrap:!0,variant:"body2"}})]})},v)})})})]})]})}),a.jsx(wo,{}),a.jsx(B,{sx:{p:2},children:a.jsxs(os,{selected:(l==null?void 0:l.type)==="partsDefinition",onClick:()=>t.selectPartsDefinition(),sx:{borderRadius:1},children:[a.jsx(Un,{sx:{minWidth:32},children:a.jsx(Bx,{fontSize:"small",color:"action"})}),a.jsx(Zn,{primary:"パーツ定義",primaryTypographyProps:{variant:"body2"}})]})})]})}function j1(t){return t.pagination!==void 0}function Py(t){return t.pagination===void 0}function Cie(t){return t.type==="relationList"}const wie=[{key:"currentPageNumber",type:"number"},{key:"totalPagesCount",type:"number"},{key:"totalItemsCount",type:"number"},{key:"pagedItems",type:"T[]"}],QO=[{value:"string",label:"string",description:"文字列化"},{value:"date",label:"date",description:"日付フォーマット"},{value:"number",label:"number",description:"数値フォーマット"},{value:"escape",label:"escape",description:"HTMLエスケープ"},{value:"toc",label:"toc",description:"目次生成"},{value:"truncate",label:"truncate",description:"文字数制限"},{value:"stripHtml",label:"stripHtml",description:"HTMLタグ除去"},{value:"slug",label:"slug",description:"スラッグ化"},{value:"lowercase",label:"lowercase",description:"小文字化"},{value:"uppercase",label:"uppercase",description:"大文字化"},{value:"default",label:"default",description:"デフォルト値"},{value:"count",label:"count",description:"配列の長さ"},{value:"first",label:"first",description:"配列の先頭"},{value:"last",label:"last",description:"配列の末尾"},{value:"join",label:"join",description:"配列を結合"},{value:"url",label:"url",description:"URLエンコード"}];function rb({customFields:t,onChange:e,contentTypeList:n=[],getContentType:r,readOnly:s=!1}){const i=(p="transform")=>{if(p==="relationList"){const f={field:"",type:"relationList",contentTypeId:""};e([...t,f])}else{const f={field:"",source:""};e([...t,f])}},l=(p,f)=>{const m=[...t];m[p]=f,e(m)},u=p=>{e(t.filter((f,m)=>m!==p))};return a.jsxs(B,{children:[a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"ソースフィールドから新しいフィールドを生成します"}),t.length===0?a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"カスタムフィールドなし"}):a.jsx(B,{sx:{display:"flex",flexDirection:"column",gap:1,mb:2},children:t.map((p,f)=>a.jsx(jie,{field:p,onChange:m=>l(f,m),onDelete:()=>u(f),contentTypeList:n,getContentType:r,readOnly:s},f))}),!s&&a.jsxs(B,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:1},children:[a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:()=>i("transform"),children:"変換フィールドを追加"}),a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:()=>i("relationList"),color:"primary",variant:"outlined",children:"リレーションフィールドを追加"})]})]})}function jie({field:t,onChange:e,onDelete:n,contentTypeList:r,getContentType:s,readOnly:i=!1}){return Cie(t)?a.jsx(Die,{field:t,onChange:e,onDelete:n,contentTypeList:r,getContentType:s,readOnly:i}):a.jsx(Tie,{field:t,onChange:e,onDelete:n,readOnly:i})}function Tie({field:t,onChange:e,onDelete:n,readOnly:r=!1}){const s=QO.find(l=>l.value===t.type),i=t.type&&["date","number","truncate","default","join"].includes(t.type);return a.jsx($t,{variant:"outlined",sx:{p:2},children:a.jsxs(Et,{container:!0,spacing:2,children:[a.jsx(Et,{item:!0,xs:12,sm:3,children:a.jsx(Xe,{size:"small",label:"出力名 (field)",value:t.field,onChange:l=>e({...t,field:l.target.value}),placeholder:"formattedDate",fullWidth:!0,disabled:r})}),a.jsx(Et,{item:!0,xs:12,sm:4,children:a.jsx(Xe,{size:"small",label:"ソース式",value:t.source,onChange:l=>e({...t,source:l.target.value}),placeholder:"publishedAt",helperText:"フィールド名または式",fullWidth:!0,disabled:r})}),a.jsx(Et,{item:!0,xs:12,sm:3,children:a.jsxs(_n,{size:"small",fullWidth:!0,disabled:r,children:[a.jsx(nr,{children:"フォーマット"}),a.jsxs(wn,{value:t.type??"",label:"フォーマット",onChange:l=>{const u=l.target.value;e({...t,type:u||void 0})},children:[a.jsx(nt,{value:"",children:a.jsx("em",{children:"なし"})}),QO.map(l=>a.jsx(nt,{value:l.value,children:l.label},l.value))]})]})}),!r&&a.jsx(Et,{item:!0,xs:12,sm:2,sx:{display:"flex",alignItems:"flex-start",justifyContent:"flex-end"},children:a.jsx(ft,{color:"error",onClick:n,children:a.jsx(zn,{})})}),s&&a.jsx(Et,{item:!0,xs:12,children:a.jsx(G,{variant:"caption",color:"text.secondary",children:s.description})}),i&&a.jsx(Et,{item:!0,xs:12,children:a.jsx(Xe,{size:"small",label:Mie(t.type),value:t.format??t.defaultValue??t.separator??t.length??"",onChange:l=>{const u=l.target.value;t.type==="date"||t.type==="number"?e({...t,format:u}):t.type==="default"?e({...t,defaultValue:u}):t.type==="join"?e({...t,separator:u}):t.type==="truncate"&&e({...t,length:parseInt(u)||void 0})},placeholder:Oie(t.type),helperText:Aie(t.type),fullWidth:!0,disabled:r})})]})})}function Die({field:t,onChange:e,onDelete:n,contentTypeList:r,getContentType:s,readOnly:i=!1}){const[l,u]=b.useState(!1),[p,f]=b.useState(null),[m,g]=b.useState(!1),y=!!t.contentTypeId&&!!p&&!m;b.useEffect(()=>{if(!t.contentTypeId||!s){f(null),u(!1);return}g(!0),s(t.contentTypeId).then(T=>{f(T),T||u(!1)}).finally(()=>g(!1))},[t.contentTypeId,s]);const v=(p==null?void 0:p.fields.map(T=>T.key))??[],C=t.listFields===void 0||t.listFields===null,S=t.listFields??[],j=()=>{e(C?{...t,listFields:[]}:{...t,listFields:void 0})},D=T=>{if(C)e({...t,listFields:v.filter(E=>E!==T)});else{const E=S.includes(T)?S.filter(k=>k!==T):[...S,T];E.length===v.length?e({...t,listFields:void 0}):e({...t,listFields:E})}},M=T=>C||S.includes(T);return a.jsxs($t,{variant:"outlined",sx:{p:2,borderColor:"primary.light",borderWidth:2},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[a.jsx(Ht,{label:"リレーション",size:"small",color:"primary"}),a.jsx(B,{sx:{flex:1}}),!i&&a.jsx(ft,{color:"error",onClick:n,children:a.jsx(zn,{})})]}),a.jsxs(Et,{container:!0,spacing:2,children:[a.jsx(Et,{item:!0,xs:12,sm:4,children:a.jsx(Xe,{size:"small",label:"出力名 (field)",value:t.field,onChange:T=>e({...t,field:T.target.value}),placeholder:"relatedArticles",fullWidth:!0,disabled:i})}),a.jsx(Et,{item:!0,xs:12,sm:4,children:a.jsxs(_n,{size:"small",fullWidth:!0,disabled:i,children:[a.jsx(nr,{children:"コンテンツタイプ"}),a.jsx(wn,{value:t.contentTypeId,label:"コンテンツタイプ",onChange:T=>e({...t,contentTypeId:T.target.value,listFields:void 0}),children:r.map(T=>a.jsxs(nt,{value:T.id,children:[T.label," (",T.id,")"]},T.id))})]})}),a.jsx(Et,{item:!0,xs:6,sm:2,children:a.jsx(Xe,{size:"small",label:"limit",type:"number",value:t.limit??"",onChange:T=>e({...t,limit:T.target.value?parseInt(T.target.value):void 0}),fullWidth:!0,disabled:i})}),a.jsx(Et,{item:!0,xs:6,sm:2,children:a.jsx(Xe,{size:"small",label:"offset",type:"number",value:t.offset??"",onChange:T=>e({...t,offset:T.target.value?parseInt(T.target.value):void 0}),fullWidth:!0,disabled:i})}),a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(pe,{size:"small",onClick:()=>u(!l),startIcon:l?a.jsx(Wr,{}):a.jsx(Jl,{}),disabled:!y,sx:{opacity:y?1:.5},children:"詳細設定"}),!y&&!m&&a.jsx(G,{variant:"caption",color:"text.secondary",sx:{ml:1},children:t.contentTypeId?"コンテンツタイプが見つかりません":"コンテンツタイプを選択してください"}),m&&a.jsx(ut,{size:14,sx:{ml:1}})]})]}),a.jsx(Co,{in:l&&y,children:a.jsx(B,{sx:{pl:2,pt:2},children:a.jsxs(Et,{container:!0,spacing:2,children:[a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"ソート"}),a.jsx(Eie,{sort:t.sort,onChange:T=>e({...t,sort:T})})]}),a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"フィルター"}),a.jsx(kie,{filters:t.filters??[],onChange:T=>e({...t,filters:T.length>0?T:void 0})})]}),a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(_r,{control:a.jsx(Ax,{checked:!!t.pagination,onChange:T=>{T.target.checked?e({...t,pagination:{perPage:10}}):e({...t,pagination:void 0})}}),label:"ページネーション"}),t.pagination&&a.jsx(Xe,{size:"small",label:"perPage",type:"number",value:t.pagination.perPage,onChange:T=>e({...t,pagination:{...t.pagination,perPage:parseInt(T.target.value)||10}}),sx:{ml:2,width:100}})]}),a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"取得フィールド"}),t.pagination?a.jsxs(B,{children:[a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"出力構造(固定)"}),a.jsx(Th,{children:wie.map(T=>a.jsx(_r,{disabled:!0,control:a.jsx(es,{size:"small",checked:!0,disabled:!0}),label:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(G,{variant:"body2",children:T.key}),a.jsxs(G,{variant:"caption",color:"text.secondary",children:["(",T.type,")"]})]})},T.key))}),a.jsx(G,{variant:"caption",color:"text.secondary",sx:{mt:1,display:"block"},children:"※ pagedItems 内のフィールドは「リレーション展開」で設定してください"})]}):m?a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(ut,{size:16}),a.jsx(G,{variant:"body2",color:"text.secondary",children:"読み込み中..."})]}):t.contentTypeId?p?a.jsxs(B,{children:[a.jsxs(B,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},gap:1,mb:1},children:[a.jsx(G,{variant:"body2",color:"text.secondary",children:"出力するフィールドを選択(null = すべて)"}),a.jsx(pe,{size:"small",onClick:j,disabled:C,sx:{opacity:C?.5:1,flexShrink:0},children:"すべて選択"})]}),a.jsx(Th,{sx:{maxHeight:200,overflow:"auto"},children:p.fields.map(T=>a.jsx(_r,{control:a.jsx(es,{size:"small",checked:M(T.key),onChange:()=>D(T.key)}),label:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(G,{variant:"body2",children:T.key}),a.jsxs(G,{variant:"caption",color:"text.secondary",children:["(",T.type,")"]})]})},T.key))}),!C&&a.jsxs(G,{variant:"caption",color:"text.secondary",sx:{mt:1,display:"block"},children:["選択中: ",S.length," / ",v.length," フィールド"]})]}):a.jsx(G,{variant:"body2",color:"text.secondary",children:"コンテンツタイプが見つかりません"}):a.jsx(G,{variant:"body2",color:"text.secondary",children:"コンテンツタイプを選択してください"})]}),a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"リレーション展開"}),a.jsx(Uv,{targetContentTypeId:t.contentTypeId,expansions:t.expand??[],onChange:T=>e({...t,expand:T.length>0?T:void 0}),extraFields:t.pagination?[{key:"pagedItems",label:"pagedItems (ページ内アイテム)",contentTypeId:t.contentTypeId}]:[],getContentType:s})]})]})})})]})}function Eie({sort:t,onChange:e}){const n=t?Array.isArray(t)?t:[t]:[],r=()=>{const l={field:"updatedAt",direction:"desc"},u=[...n,l];e(u.length===1?u[0]:u)},s=(l,u)=>{const p=[...n];p[l]=u,e(p.length===1?p[0]:p)},i=l=>{const u=n.filter((p,f)=>f!==l);e(u.length===0?void 0:u.length===1?u[0]:u)};return a.jsxs(B,{children:[n.map((l,u)=>a.jsxs($t,{variant:"outlined",sx:{p:1,mb:1,display:"flex",alignItems:"center",gap:1},children:[a.jsx(Xe,{size:"small",label:"フィールド",value:l.field,onChange:p=>s(u,{...l,field:p.target.value}),placeholder:"updatedAt",sx:{flex:1}}),a.jsxs(yc,{value:l.direction,exclusive:!0,size:"small",onChange:(p,f)=>f&&s(u,{...l,direction:f}),children:[a.jsx(ts,{value:"asc",children:"昇順"}),a.jsx(ts,{value:"desc",children:"降順"})]}),a.jsx(ft,{size:"small",color:"error",onClick:()=>i(u),children:a.jsx(zn,{fontSize:"small"})})]},u)),a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:r,children:"ソートを追加"})]})}const Rie=[{value:"eq",label:"="},{value:"neq",label:"!="},{value:"gt",label:">"},{value:"gte",label:">="},{value:"lt",label:"<"},{value:"lte",label:"<="},{value:"in",label:"IN"},{value:"nin",label:"NOT IN"},{value:"regex",label:"正規表現"},{value:"isNull",label:"NULL"},{value:"isNotNull",label:"NOT NULL"}];function kie({filters:t,onChange:e}){const n=()=>{e([...t,{field:"",operator:"eq",value:""}])},r=(i,l)=>{const u=[...t];u[i]=l,e(u)},s=i=>{e(t.filter((l,u)=>u!==i))};return a.jsxs(B,{children:[a.jsxs(G,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1},children:["値に ",a.jsx("code",{children:"$parent.フィールド名"})," を指定すると親コンテンツのフィールドを参照できます(逆参照)"]}),t.map((i,l)=>{const u=i.operator==="isNull"||i.operator==="isNotNull";return a.jsxs($t,{variant:"outlined",sx:{p:1,mb:1,display:"flex",alignItems:"center",gap:1},children:[a.jsx(Xe,{size:"small",label:"フィールド",value:i.field,onChange:p=>r(l,{...i,field:p.target.value}),placeholder:"status",sx:{flex:1}}),a.jsx(_n,{size:"small",sx:{minWidth:100},children:a.jsx(wn,{value:i.operator,onChange:p=>r(l,{...i,operator:p.target.value}),children:Rie.map(p=>a.jsx(nt,{value:p.value,children:p.label},p.value))})}),a.jsx(Xe,{size:"small",label:"値",value:u?"":String(i.value??""),onChange:p=>r(l,{...i,value:p.target.value}),disabled:u,placeholder:"$parent.id",sx:{flex:1}}),a.jsx(ft,{size:"small",color:"error",onClick:()=>s(l),children:a.jsx(zn,{fontSize:"small"})})]},l)}),a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:n,children:"フィルターを追加"})]})}function Mie(t){switch(t){case"date":return"フォーマット";case"number":return"フォーマット";case"truncate":return"最大文字数";case"default":return"デフォルト値";case"join":return"区切り文字";default:return"オプション"}}function Oie(t){switch(t){case"date":return"YYYY-MM-DD";case"number":return"#,###";case"truncate":return"100";case"default":return"(未設定)";case"join":return", ";default:return""}}function Aie(t){switch(t){case"date":return"dayjs形式(YYYY, MM, DD, HH, mm, ss など)";case"number":return"toLocaleString形式";case"truncate":return"指定した文字数で切り詰め";case"default":return"値がnull/undefinedの場合に使用";case"join":return"配列要素を結合する文字";default:return""}}const _ie=[{value:"eq",label:"="},{value:"neq",label:"!="},{value:"gt",label:">"},{value:"gte",label:">="},{value:"lt",label:"<"},{value:"lte",label:"<="},{value:"in",label:"IN"},{value:"nin",label:"NOT IN"},{value:"regex",label:"正規表現"},{value:"isNull",label:"NULL"},{value:"isNotNull",label:"NOT NULL"}];function Uv({contentType:t,targetContentTypeId:e,expansions:n,onChange:r,extraFields:s=[],getContentType:i,contentTypeList:l=[],readOnly:u=!1}){const[p,f]=b.useState(null),[m,g]=b.useState(!1);b.useEffect(()=>{e&&i?(g(!0),i(e).then(M=>f(M)).finally(()=>g(!1))):f(null)},[e,i]);const y=t??p,v=(y==null?void 0:y.fields.filter(M=>M.type==="relation"))??[],C=[...s.map(M=>({key:M.key,label:M.label??M.key,contentTypeId:M.contentTypeId})),...v.map(M=>{var T;return{key:M.key,label:M.key,contentTypeId:(T=M.options)==null?void 0:T.targetContentType}})],S=()=>{C.length!==0&&r([...n,{field:C[0].key}])},j=(M,T)=>{const E=[...n];E[M]=T,r(E)},D=M=>{r(n.filter((T,E)=>E!==M))};return m?a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(ut,{size:16}),a.jsx(G,{variant:"body2",color:"text.secondary",children:"読み込み中..."})]}):e&&!y?a.jsx(G,{variant:"body2",color:"error",children:"参照先のコンテンツタイプが取得できません"}):C.length===0?a.jsx(G,{variant:"body2",color:"text.secondary",children:"展開可能なフィールドがありません"}):a.jsxs(B,{children:[a.jsxs(B,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[a.jsx(G,{variant:"body2",color:"text.secondary",children:"リレーションフィールドを展開して参照先データを含めます"}),!u&&a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:S,children:"追加"})]}),n.length===0?a.jsx(G,{variant:"body2",color:"text.secondary",children:"展開設定がありません"}):a.jsx(B,{sx:{display:"flex",flexDirection:"column",gap:1},children:n.map((M,T)=>a.jsx(Iie,{expansion:M,expandableFields:C,onChange:E=>j(T,E),onDelete:()=>D(T),getContentType:i,contentTypeList:l,readOnly:u},T))})]})}function Iie({expansion:t,expandableFields:e,onChange:n,onDelete:r,getContentType:s,contentTypeList:i=[],readOnly:l=!1}){var j,D,M,T;const[u,p]=b.useState(!1),[f,m]=b.useState(null),[g,y]=b.useState(!1),v=e.find(E=>E.key===t.field),C=v==null?void 0:v.contentTypeId;b.useEffect(()=>{if(!C||!s){m(null);return}y(!0),s(C).then(E=>m(E)).finally(()=>y(!1))},[C,s]);const S=!!(t.sort||t.limit||t.offset||(j=t.filters)!=null&&j.length||(D=t.customFields)!=null&&D.length||(M=t.expand)!=null&&M.length||(T=t.fields)!=null&&T.length);return a.jsxs($t,{variant:"outlined",sx:{p:1.5},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[a.jsx(bu,{size:"small",options:e.map(E=>E.key),value:t.field,onChange:(E,k)=>n({...t,field:k??"",fields:void 0}),renderInput:E=>a.jsx(Xe,{...E,label:"フィールド",placeholder:"選択"}),getOptionLabel:E=>{const k=e.find(A=>A.key===E);return(k==null?void 0:k.label)??E},sx:{minWidth:180},disabled:l}),a.jsx(pe,{size:"small",variant:u?"contained":"outlined",startIcon:a.jsx(Bx,{}),onClick:()=>p(!u),color:S?"primary":"inherit",children:"詳細設定"}),!l&&a.jsx(ft,{size:"small",color:"error",onClick:r,children:a.jsx(zn,{fontSize:"small"})})]}),a.jsx(Co,{in:u,children:a.jsx(B,{sx:{mt:2,pl:1},children:a.jsx(U5,{expansion:t,onChange:n,targetContentType:f,isLoadingContentType:g,getContentType:s,contentTypeList:i,readOnly:l})})})]})}function U5({expansion:t,onChange:e,targetContentType:n,isLoadingContentType:r,getContentType:s,contentTypeList:i=[],readOnly:l=!1}){const u=t.sort?Array.isArray(t.sort)?t.sort:[t.sort]:[],p=t.filters??[],f=t.expand??[],m=(n==null?void 0:n.fields.map(P=>P.key))??[],g=t.fields??[],y=t.fields===void 0,v=()=>{e({...t,fields:void 0})},C=P=>{if(y)e({...t,fields:m.filter(z=>z!==P)});else{const z=g.includes(P)?g.filter(N=>N!==P):[...g,P];z.length===m.length?e({...t,fields:void 0}):e({...t,fields:z})}},S=P=>y||g.includes(P),j=P=>{P.length===0?e({...t,sort:void 0}):P.length===1?e({...t,sort:P[0]}):e({...t,sort:P})},D=()=>{j([...u,{field:"updatedAt",direction:"desc"}])},M=(P,z)=>{const N=[...u];N[P]=z,j(N)},T=P=>{j(u.filter((z,N)=>N!==P))},E=()=>{e({...t,filters:[...p,{field:"",operator:"eq",value:""}]})},k=(P,z)=>{const N=[...p];N[P]=z,e({...t,filters:N})},A=P=>{const z=p.filter((N,H)=>H!==P);e({...t,filters:z.length>0?z:void 0})},O=()=>{e({...t,expand:[...f,{field:""}]})},I=(P,z)=>{const N=[...f];N[P]=z,e({...t,expand:N})},$=P=>{const z=f.filter((N,H)=>H!==P);e({...t,expand:z.length>0?z:void 0})},R=(n==null?void 0:n.fields.filter(P=>P.type==="relation").map(P=>{var z;return{key:P.key,label:P.key,contentTypeId:(z=P.options)==null?void 0:z.targetContentType}}))??[];return a.jsxs(Et,{container:!0,spacing:2,children:[a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"取得フィールド"}),r?a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(ut,{size:16}),a.jsx(G,{variant:"body2",color:"text.secondary",children:"読み込み中..."})]}):n?a.jsxs(B,{children:[a.jsxs(B,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[a.jsx(G,{variant:"caption",color:"text.secondary",children:"出力するフィールドを選択(未選択 = すべて)"}),a.jsx(pe,{size:"small",onClick:v,disabled:y,sx:{opacity:y?.5:1},children:"すべて選択"})]}),a.jsx(Th,{sx:{maxHeight:200,overflow:"auto"},children:n.fields.map(P=>a.jsx(_r,{control:a.jsx(es,{size:"small",checked:S(P.key),onChange:()=>C(P.key)}),label:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(G,{variant:"body2",children:P.key}),a.jsxs(G,{variant:"caption",color:"text.secondary",children:["(",P.type,")"]})]})},P.key))}),!y&&a.jsxs(G,{variant:"caption",color:"text.secondary",sx:{mt:1,display:"block"},children:["選択中: ",g.length," / ",m.length," フィールド"]})]}):a.jsx(G,{variant:"body2",color:"error",children:"参照先のコンテンツタイプが取得できません"})]}),a.jsx(Et,{item:!0,xs:6,sm:3,children:a.jsx(Xe,{size:"small",label:"limit",type:"number",value:t.limit??"",onChange:P=>e({...t,limit:P.target.value?parseInt(P.target.value):void 0}),fullWidth:!0})}),a.jsx(Et,{item:!0,xs:6,sm:3,children:a.jsx(Xe,{size:"small",label:"offset",type:"number",value:t.offset??"",onChange:P=>e({...t,offset:P.target.value?parseInt(P.target.value):void 0}),fullWidth:!0})}),a.jsx(Et,{item:!0,xs:12,sm:6}),a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"ソート"}),u.map((P,z)=>a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[a.jsx(Xe,{size:"small",label:"フィールド",value:P.field,onChange:N=>M(z,{...P,field:N.target.value}),placeholder:"updatedAt",sx:{flex:1}}),a.jsxs(yc,{value:P.direction,exclusive:!0,size:"small",onChange:(N,H)=>H&&M(z,{...P,direction:H}),children:[a.jsx(ts,{value:"asc",children:"昇順"}),a.jsx(ts,{value:"desc",children:"降順"})]}),a.jsx(ft,{size:"small",color:"error",onClick:()=>T(z),children:a.jsx(zn,{fontSize:"small"})})]},z)),a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:D,children:"ソートを追加"})]}),a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"フィルター"}),a.jsxs(G,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1},children:["値に ",a.jsx("code",{children:"$parent.フィールド名"})," を指定すると親コンテンツのフィールドを参照できます"]}),p.map((P,z)=>{const N=P.operator==="isNull"||P.operator==="isNotNull";return a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,mb:1,flexWrap:"wrap"},children:[a.jsx(Xe,{size:"small",label:"フィールド",value:P.field,onChange:H=>k(z,{...P,field:H.target.value}),placeholder:"status",sx:{flex:1,minWidth:100}}),a.jsx(_n,{size:"small",sx:{minWidth:100},children:a.jsx(wn,{value:P.operator,onChange:H=>k(z,{...P,operator:H.target.value}),children:_ie.map(H=>a.jsx(nt,{value:H.value,children:H.label},H.value))})}),a.jsx(Xe,{size:"small",label:"値",value:N?"":String(P.value??""),onChange:H=>k(z,{...P,value:H.target.value}),disabled:N,placeholder:"$parent.id",sx:{flex:1,minWidth:100}}),a.jsx(ft,{size:"small",color:"error",onClick:()=>A(z),children:a.jsx(zn,{fontSize:"small"})})]},z)}),a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:E,children:"フィルターを追加"})]}),a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"リレーション展開"}),R.length===0?a.jsx(G,{variant:"body2",color:"text.secondary",children:"展開可能なリレーションフィールドがありません"}):a.jsxs(a.Fragment,{children:[f.map((P,z)=>a.jsx(B,{sx:{mb:1},children:a.jsx(Pie,{expansion:P,expandableFields:R,onChange:N=>I(z,N),onDelete:()=>$(z),getContentType:s,contentTypeList:i})},z)),a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:O,children:"リレーション展開を追加"})]})]}),a.jsxs(Et,{item:!0,xs:12,children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"カスタムフィールド"}),a.jsx(rb,{customFields:t.customFields??[],onChange:P=>e({...t,customFields:P.length>0?P:void 0}),contentTypeList:i,getContentType:s})]})]})}function Pie({expansion:t,expandableFields:e,onChange:n,onDelete:r,getContentType:s,contentTypeList:i=[]}){var S,j,D,M;const[l,u]=b.useState(!1),[p,f]=b.useState(null),[m,g]=b.useState(!1),y=e.find(T=>T.key===t.field),v=y==null?void 0:y.contentTypeId;b.useEffect(()=>{if(!v||!s){f(null);return}g(!0),s(v).then(T=>f(T)).finally(()=>g(!1))},[v,s]);const C=!!(t.sort||t.limit||t.offset||(S=t.filters)!=null&&S.length||(j=t.customFields)!=null&&j.length||(D=t.expand)!=null&&D.length||(M=t.fields)!=null&&M.length);return a.jsxs($t,{variant:"outlined",sx:{p:1.5},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[a.jsx(bu,{size:"small",options:e.map(T=>T.key),value:t.field,onChange:(T,E)=>n({...t,field:E??"",fields:void 0}),renderInput:T=>a.jsx(Xe,{...T,label:"フィールド",placeholder:"選択"}),getOptionLabel:T=>{const E=e.find(k=>k.key===T);return(E==null?void 0:E.label)??T},sx:{minWidth:150}}),a.jsx(pe,{size:"small",variant:l?"contained":"outlined",startIcon:a.jsx(Bx,{}),onClick:()=>u(!l),color:C?"primary":"inherit",children:"詳細設定"}),a.jsx(ft,{size:"small",color:"error",onClick:r,children:a.jsx(zn,{fontSize:"small"})})]}),a.jsx(Co,{in:l,children:a.jsx(B,{sx:{mt:2,pl:1},children:a.jsx(U5,{expansion:t,onChange:n,targetContentType:p,isLoadingContentType:m,getContentType:s,contentTypeList:i})})})]})}function Lie(t){const e=t.match(/\{\$this\.([^}]+)\}/g);return e?e.map(n=>n.slice(7,-1)):[]}function zie({useCase:t,recipe:e,contentType:n,templateFiles:r,contentTypeList:s,canEdit:i=!0}){var C,S;const[l,u]=b.useState("output"),p=b.useRef(null),f=j=>(D,M)=>{u(M?j:!1)},m=j=>{t.updateCurrentRecipe(D=>({...D,...j}))},g=b.useMemo(()=>n.fields.filter(j=>j.useAsUrl),[n.fields]),y=b.useMemo(()=>Lie(e.outputPath).filter(D=>!g.some(M=>M.key===D)),[e.outputPath,g]),v=j=>{const D=`{$this.${j}}`,M=p.current;if(M){const T=M.selectionStart??e.outputPath.length,E=M.selectionEnd??T,k=e.outputPath.slice(0,T)+D+e.outputPath.slice(E);m({outputPath:k})}else m({outputPath:e.outputPath+D})};return a.jsxs(B,{children:[a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,mb:3},children:[a.jsx(Xe,{label:"出力パス",value:e.outputPath,onChange:j=>m({outputPath:j.target.value}),placeholder:"articles/{$this.slug}.json",helperText:"出力ファイルパス。{$this.xxx} には useAsUrl フィールドのみ使用可",fullWidth:!0,disabled:!i,inputRef:p,error:y.length>0}),g.length>0&&a.jsxs(B,{"data-component-name":"cmp:UseAsUrlFieldChips",sx:{display:"flex",flexWrap:"wrap",gap:.5},children:[a.jsx(G,{variant:"caption",color:"text.secondary",sx:{mr:1,alignSelf:"center"},children:"URL フィールド:"}),g.map(j=>a.jsx(Ht,{label:`{$this.${j.key}}`,size:"small",variant:"outlined",onClick:()=>i&&v(j.key),sx:{fontFamily:"monospace",cursor:i?"pointer":"default"}},j.key))]}),g.length===0&&a.jsx(G,{variant:"caption",color:"text.secondary",children:"useAsUrl が設定されたフィールドがありません。コンテンツタイプ設定で「URL として使用」を有効にしてください。"}),y.length>0&&a.jsxs(zt,{severity:"warning","data-component-name":"cmp:OutputPathValidationAlert",children:["以下のプレースホルダーは「URL として使用」が設定されていないフィールドです:"," ",y.map(j=>`{$this.${j}}`).join(", ")]}),a.jsx(bu,{options:r,value:e.templatePath,onChange:(j,D)=>m({templatePath:D??""}),renderInput:j=>a.jsx(Xe,{...j,label:"テンプレートファイル",placeholder:"article/detail.html"}),freeSolo:!0,disabled:!i})]}),a.jsxs(_s,{expanded:l==="expand",onChange:f("expand"),children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsxs(G,{children:["リレーション展開 (",((C=e.expand)==null?void 0:C.length)??0,")"]})}),a.jsx(Is,{children:a.jsx(Uv,{contentType:n,expansions:e.expand??[],onChange:j=>m({expand:j}),getContentType:j=>t.getContentType(j),readOnly:!i})})]}),a.jsxs(_s,{expanded:l==="customFields",onChange:f("customFields"),children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsxs(G,{children:["カスタムフィールド (",((S=e.customFields)==null?void 0:S.length)??0,")"]})}),a.jsx(Is,{children:a.jsx(rb,{customFields:e.customFields??[],onChange:j=>m({customFields:j}),contentTypeList:s,getContentType:j=>t.getContentType(j),readOnly:!i})})]})]})}function $ie({contentType:t,selectedFields:e,onChange:n,readOnly:r=!1}){const s=t.fields.map(f=>f.key),i=e===null,l=()=>{n(i?[...s]:null)},u=f=>{if(i)n(s.filter(m=>m!==f));else{const m=e.includes(f)?e.filter(g=>g!==f):[...e,f];m.length===s.length?n(null):n(m)}},p=f=>i||e.includes(f);return a.jsxs(B,{children:[a.jsxs(B,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},gap:1,mb:2},children:[a.jsx(G,{variant:"body2",color:"text.secondary",children:"出力するフィールドを選択します(null = すべて)"}),!r&&a.jsx(pe,{size:"small",onClick:l,disabled:i,sx:{opacity:i?.5:1,flexShrink:0},children:"すべて選択"})]}),a.jsx(Th,{children:t.fields.map(f=>a.jsx(_r,{control:a.jsx(es,{checked:p(f.key),onChange:()=>u(f.key),disabled:r}),label:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(G,{variant:"body2",children:f.key}),a.jsxs(G,{variant:"caption",color:"text.secondary",children:["(",f.type,")"]})]})},f.key))}),e&&a.jsxs(G,{variant:"caption",color:"text.secondary",sx:{mt:1,display:"block"},children:["選択中: ",e.length," / ",s.length," フィールド"]})]})}const Nie=[{value:"eq",label:"= (等しい)"},{value:"neq",label:"!= (等しくない)"},{value:"gt",label:"> (より大きい)"},{value:"gte",label:">= (以上)"},{value:"lt",label:"< (より小さい)"},{value:"lte",label:"<= (以下)"},{value:"in",label:"IN (いずれか)"},{value:"nin",label:"NOT IN (いずれでもない)"},{value:"regex",label:"正規表現"},{value:"isNull",label:"NULL"},{value:"isNotNull",label:"NOT NULL"}];function Fie({contentType:t,filters:e,onChange:n,readOnly:r=!1}){const s=()=>{var p;const u=((p=t.fields[0])==null?void 0:p.key)??"status";n([...e,{field:u,operator:"eq",value:""}])},i=(u,p)=>{const f=[...e];f[u]=p,n(f)},l=u=>{n(e.filter((p,f)=>f!==u))};return a.jsxs(B,{children:[e.length===0?a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"フィルターなし(すべてのデータを取得)"}):a.jsx(B,{sx:{display:"flex",flexDirection:"column",gap:1,mb:2},children:e.map((u,p)=>a.jsx(Bie,{filter:u,contentType:t,onChange:f=>i(p,f),onDelete:()=>l(p),readOnly:r},p))}),!r&&a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:s,children:"フィルターを追加"})]})}function Bie({filter:t,contentType:e,onChange:n,onDelete:r,readOnly:s=!1}){const i=t.operator==="isNull"||t.operator==="isNotNull",l=()=>i?"":Array.isArray(t.value)?t.value.join(", "):String(t.value??""),u=p=>{if(t.operator==="in"||t.operator==="nin"){const f=p.split(",").map(m=>m.trim()).filter(Boolean);n({...t,value:f})}else n({...t,value:p})};return a.jsx($t,{variant:"outlined",sx:{p:1.5},children:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsxs(_n,{size:"small",sx:{minWidth:150},disabled:s,children:[a.jsx(nr,{children:"フィールド"}),a.jsxs(wn,{value:t.field,label:"フィールド",onChange:p=>n({...t,field:p.target.value}),children:[a.jsx(nt,{value:"status",children:"status"}),a.jsx(nt,{value:"slug",children:"slug"}),a.jsx(nt,{value:"publishedAt",children:"publishedAt"}),a.jsx(nt,{value:"createdAt",children:"createdAt"}),a.jsx(nt,{value:"updatedAt",children:"updatedAt"}),e.fields.map(p=>a.jsxs(nt,{value:p.key,children:[p.key," (",p.type,")"]},p.key))]})]}),a.jsxs(_n,{size:"small",sx:{minWidth:150},disabled:s,children:[a.jsx(nr,{children:"演算子"}),a.jsx(wn,{value:t.operator,label:"演算子",onChange:p=>n({...t,operator:p.target.value}),children:Nie.map(p=>a.jsx(nt,{value:p.value,children:p.label},p.value))})]}),a.jsx(Xe,{size:"small",label:"値",value:l(),onChange:p=>u(p.target.value),placeholder:t.operator==="in"||t.operator==="nin"?"カンマ区切り":i?"(不要)":"値",disabled:i||s,sx:{flex:1}}),!s&&a.jsx(ft,{size:"small",color:"error",onClick:r,children:a.jsx(zn,{fontSize:"small"})})]})})}function Uie({contentType:t,sort:e,onChange:n,readOnly:r=!1}){const s=e?Array.isArray(e)?e:[e]:[],i=()=>{const p={field:"updatedAt",direction:"desc"},f=[...s,p];n(f.length===1?f[0]:f)},l=(p,f)=>{const m=[...s];m[p]=f,n(m.length===1?m[0]:m)},u=p=>{const f=s.filter((m,g)=>g!==p);f.length===0?n(void 0):n(f.length===1?f[0]:f)};return a.jsxs(B,{children:[s.length===0?a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"ソートなし(デフォルト順)"}):a.jsx(B,{sx:{display:"flex",flexDirection:"column",gap:1,mb:2},children:s.map((p,f)=>a.jsx(Vie,{sort:p,contentType:t,onChange:m=>l(f,m),onDelete:()=>u(f),readOnly:r},f))}),!r&&a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:i,children:"ソートを追加"})]})}function Vie({sort:t,contentType:e,onChange:n,onDelete:r,readOnly:s=!1}){return a.jsx($t,{variant:"outlined",sx:{p:1.5},children:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsxs(_n,{size:"small",sx:{minWidth:200},disabled:s,children:[a.jsx(nr,{children:"フィールド"}),a.jsxs(wn,{value:t.field,label:"フィールド",onChange:i=>n({...t,field:i.target.value}),children:[a.jsx(nt,{value:"publishedAt",children:"publishedAt (公開日)"}),a.jsx(nt,{value:"createdAt",children:"createdAt (作成日)"}),a.jsx(nt,{value:"updatedAt",children:"updatedAt (更新日)"}),a.jsx(nt,{value:"title",children:"title (タイトル)"}),e.fields.map(i=>a.jsxs(nt,{value:i.key,children:[i.key," (",i.type,")"]},i.key))]})]}),a.jsxs(yc,{value:t.direction,exclusive:!0,onChange:(i,l)=>l&&n({...t,direction:l}),size:"small",disabled:s,children:[a.jsx(ts,{value:"asc",title:"昇順",children:a.jsx(x2,{fontSize:"small"})}),a.jsx(ts,{value:"desc",title:"降順",children:a.jsx(zx,{fontSize:"small"})})]}),a.jsx(G,{variant:"body2",color:"text.secondary",sx:{flex:1},children:t.direction==="asc"?"昇順(小→大)":"降順(大→小)"}),!s&&a.jsx(ft,{size:"small",color:"error",onClick:r,children:a.jsx(zn,{fontSize:"small"})})]})})}const Hie=[{key:"currentPageNumber",type:"number"},{key:"totalPagesCount",type:"number"},{key:"totalItemsCount",type:"number"},{key:"pagedItems",type:"T[]"}];function Wie({useCase:t,recipe:e,contentType:n,templateFiles:r,contentTypeList:s,canEdit:i=!0}){var y,v,C,S,j;const[l,u]=b.useState("output"),p=D=>(M,T)=>{u(T?D:!1)},f=D=>{t.updateCurrentRecipe(M=>({...M,...D}))},m=!!e.pagination,g=D=>{e.pagination&&f({pagination:{...e.pagination,...D}})};return a.jsxs(B,{children:[a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,mb:3},children:[a.jsx(Xe,{label:"出力パス",value:e.outputPath,onChange:D=>f({outputPath:D.target.value}),placeholder:m?"articles/page/{$page}.json":"/articles/index.json",helperText:m?"ページネーション有効時は {$page} がページ番号に置換されます":"出力ファイルパス",fullWidth:!0,disabled:!i}),a.jsx(bu,{options:r,value:e.templatePath,onChange:(D,M)=>f({templatePath:M??""}),renderInput:D=>a.jsx(Xe,{...D,label:"テンプレートファイル",placeholder:"article/list.html"}),freeSolo:!0,disabled:!i}),a.jsx(_r,{control:a.jsx(Ax,{checked:m,onChange:D=>{D.target.checked?f({pagination:{perPage:10,numberFormatCount:1}}):f({pagination:void 0})},disabled:!i}),label:"ページネーションを有効にする"}),m&&e.pagination&&a.jsx(B,{sx:{pl:2,display:"flex",flexDirection:"column",gap:2},children:a.jsxs(Et,{container:!0,spacing:2,children:[a.jsx(Et,{item:!0,xs:12,sm:4,children:a.jsx(Xe,{label:"1ページあたりの件数",type:"number",value:e.pagination.perPage,onChange:D=>g({perPage:parseInt(D.target.value)||10}),fullWidth:!0,disabled:!i})}),a.jsx(Et,{item:!0,xs:12,sm:4,children:a.jsx(Xe,{label:"ページ番号桁数",type:"number",value:e.pagination.numberFormatCount,onChange:D=>g({numberFormatCount:parseInt(D.target.value)||1}),placeholder:"1",helperText:"例: 3 -> 001, 002, ...",fullWidth:!0,disabled:!i})}),a.jsx(Et,{item:!0,xs:12,sm:4,children:a.jsx(Xe,{label:"1ページ目の固定パス",value:e.pagination.startPath??"",onChange:D=>g({startPath:D.target.value||void 0}),placeholder:"articles/index.json",helperText:"任意",fullWidth:!0,disabled:!i})})]})})]}),a.jsxs(_s,{expanded:l==="query",onChange:p("query"),children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsx(G,{children:"クエリ設定"})}),a.jsx(Is,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:3},children:[a.jsxs(Et,{container:!0,spacing:2,children:[!m&&a.jsx(Et,{item:!0,xs:6,children:a.jsx(Xe,{label:"取得件数 (limit)",type:"number",value:Py(e)?e.limit??"":"",onChange:D=>{const M=D.target.value?parseInt(D.target.value):void 0;f({limit:M})},fullWidth:!0,disabled:!i})}),a.jsx(Et,{item:!0,xs:m?12:6,children:a.jsx(Xe,{label:"スキップ件数 (offset)",type:"number",value:e.offset??"",onChange:D=>{const M=D.target.value?parseInt(D.target.value):void 0;f({offset:M})},fullWidth:!0,disabled:!i})})]}),a.jsxs(B,{children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"フィルター"}),a.jsx(Fie,{contentType:n,filters:e.filters??[],onChange:D=>f({filters:D}),readOnly:!i})]}),a.jsxs(B,{children:[a.jsx(G,{variant:"subtitle2",sx:{mb:1},children:"ソート"}),a.jsx(Uie,{contentType:n,sort:e.sort,onChange:D=>f({sort:D}),readOnly:!i})]})]})})]}),a.jsxs(_s,{expanded:l==="fields",onChange:p("fields"),children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsxs(G,{children:["フィールド選定",m?" (出力構造固定)":""]})}),a.jsx(Is,{children:m?a.jsxs(B,{children:[a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"出力構造(固定)"}),a.jsx(Th,{children:Hie.map(D=>a.jsx(_r,{disabled:!0,control:a.jsx(es,{size:"small",checked:!0,disabled:!0}),label:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(G,{variant:"body2",children:D.key}),a.jsxs(G,{variant:"caption",color:"text.secondary",children:["(",D.type,")"]})]})},D.key))}),a.jsx(G,{variant:"caption",color:"text.secondary",sx:{mt:1,display:"block"},children:"※ pagedItems 内のフィールドは「リレーション展開」で設定してください"})]}):a.jsx($ie,{contentType:n,selectedFields:Py(e)?e.listFields??null:null,onChange:D=>f({listFields:D}),readOnly:!i})})]}),a.jsxs(_s,{expanded:l==="expand",onChange:p("expand"),children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsxs(G,{children:["リレーション展開 (",m?j1(e)?((v=(y=e.items)==null?void 0:y.expand)==null?void 0:v.length)??0:0:Py(e)?((C=e.expand)==null?void 0:C.length)??0:0,")",m?" (items.expand)":""]})}),a.jsx(Is,{children:m?a.jsx(Uv,{contentType:n,expansions:j1(e)?((S=e.items)==null?void 0:S.expand)??[]:[],extraFields:[{key:"pagedItems",label:"pagedItems (ページ内アイテム)",contentTypeId:n.id}],onChange:D=>{j1(e)&&f({items:{...e.items,expand:D}})},getContentType:D=>t.getContentType(D),readOnly:!i}):a.jsx(Uv,{contentType:n,expansions:Py(e)?e.expand??[]:[],onChange:D=>f({expand:D}),getContentType:D=>t.getContentType(D),readOnly:!i})})]}),a.jsxs(_s,{expanded:l==="customFields",onChange:p("customFields"),children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsxs(G,{children:["カスタムフィールド (",((j=e.customFields)==null?void 0:j.length)??0,")"]})}),a.jsx(Is,{children:a.jsx(rb,{customFields:e.customFields??[],onChange:D=>f({customFields:D}),contentTypeList:s,getContentType:D=>t.getContentType(D),readOnly:!i})})]})]})}function qie({useCase:t,recipe:e,templateFiles:n,contentTypeList:r,canEdit:s=!0}){var f;const[i,l]=b.useState("output"),u=m=>(g,y)=>{l(y?m:!1)},p=m=>{t.updateCurrentRecipe(g=>({...g,...m}))};return a.jsxs(B,{children:[a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,mb:3},children:[a.jsx(Xe,{label:"出力パス",value:e.outputPath,onChange:m=>p({outputPath:m.target.value}),placeholder:"/index.json",helperText:"出力ファイルパス",fullWidth:!0,disabled:!s}),a.jsx(bu,{options:n,value:e.templatePath,onChange:(m,g)=>p({templatePath:g??""}),renderInput:m=>a.jsx(Xe,{...m,label:"テンプレートファイル",placeholder:"top.html"}),freeSolo:!0,disabled:!s})]}),a.jsxs(_s,{expanded:i==="customFields",onChange:u("customFields"),children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsxs(G,{children:["カスタムフィールド (",((f=e.customFields)==null?void 0:f.length)??0,")"]})}),a.jsx(Is,{children:a.jsx(rb,{customFields:e.customFields??[],onChange:m=>p({customFields:m}),contentTypeList:r,getContentType:m=>t.getContentType(m),readOnly:!s})})]})]})}function Gie({useCase:t,canEdit:e=!0}){const n=t.getState(),{editingRecipe:r,templateFiles:s}=n,i=(r==null?void 0:r.templateIncludes)??{},[l,u]=b.useState(!1),[p,f]=b.useState(null),[m,g]=b.useState(""),[y,v]=b.useState([]),C=()=>{f(null),g(""),v([]),u(!0)},S=T=>{f(T),g(T),v(i[T]??[]),u(!0)},j=T=>{const E={...i};delete E[T],t.updateTemplateIncludes(E)},D=()=>{if(!m.trim())return;const T={...i};p&&p!==m&&delete T[p],T[m]=y,t.updateTemplateIncludes(T),u(!1)},M=Object.entries(i);return a.jsxs(B,{children:[a.jsxs(B,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[a.jsx(G,{variant:"h6",children:"テンプレートパーツ定義"}),e&&a.jsx(pe,{variant:"outlined",startIcon:a.jsx(Qn,{}),onClick:C,children:"追加"})]}),a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"パーツファイル(_parts/*.html など)が変更されたときに再ビルドが必要なテンプレートを定義します。"}),M.length===0?a.jsx(G,{variant:"body2",color:"text.secondary",children:"パーツ定義がありません"}):a.jsx($t,{variant:"outlined",children:a.jsxs(wp,{size:"small",children:[a.jsx(jm,{children:a.jsxs(eo,{children:[a.jsx(Kt,{children:"パーツパターン"}),a.jsx(Kt,{children:"影響を受けるテンプレート"}),e&&a.jsx(Kt,{width:100,children:"操作"})]})}),a.jsx(jp,{children:M.map(([T,E])=>a.jsxs(eo,{children:[a.jsx(Kt,{children:a.jsx(G,{variant:"body2",fontFamily:"monospace",children:T})}),a.jsx(Kt,{children:a.jsx(B,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:E.length===0?a.jsx(G,{variant:"body2",color:"text.secondary",children:"(なし)"}):E[0]==="*"?a.jsx(Ht,{label:"すべてのテンプレート",size:"small"}):E.map(k=>a.jsx(Ht,{label:k,size:"small",variant:"outlined"},k))})}),e&&a.jsxs(Kt,{children:[a.jsx(ft,{size:"small",onClick:()=>S(T),title:"編集",children:a.jsx(Ri,{fontSize:"small"})}),a.jsx(ft,{size:"small",color:"error",onClick:()=>j(T),title:"削除",children:a.jsx(zn,{fontSize:"small"})})]})]},T))})]})}),a.jsxs(Qt,{open:l,onClose:()=>u(!1),maxWidth:"sm",fullWidth:!0,children:[a.jsx(Yt,{children:p?"パーツ定義を編集":"パーツ定義を追加"}),a.jsx(Jt,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[a.jsx(Xe,{label:"パーツパターン(glob形式)",value:m,onChange:T=>g(T.target.value),placeholder:"_parts/*.html",helperText:"例: _parts/*.html, includes/header.html",fullWidth:!0}),a.jsx(bu,{multiple:!0,freeSolo:!0,options:["*",...s],value:y,onChange:(T,E)=>v(E),renderInput:T=>a.jsx(Xe,{...T,label:"影響を受けるテンプレート",placeholder:"テンプレートを選択または入力",helperText:"* を選択するとすべてのテンプレートが対象"}),renderTags:(T,E)=>T.map((k,A)=>{const{key:O,...I}=E({index:A});return a.jsx(Ht,{label:k==="*"?"すべてのテンプレート":k,size:"small",...I},O)})})]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>u(!1),children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:D,disabled:!m.trim(),children:"保存"})]})]})]})}function Zie({open:t,contentTypeId:e,templateFiles:n,onClose:r,onAddDetail:s,onAddList:i,onAddStatic:l}){const u=e==="__static__",p=u?"static":"detail",[f,m]=b.useState(p),[g,y]=b.useState(""),[v,C]=b.useState(""),S=()=>{m(p),y(""),C(""),r()},j=()=>{if(!(!g.trim()||!v.trim())){if(f==="detail"){const D={type:"detail",outputPath:g.trim(),templatePath:v.trim()};s(D)}else if(f==="list"){const D={type:"list",outputPath:g.trim(),templatePath:v.trim()};i(D)}else{const D={type:"static",outputPath:g.trim(),templatePath:v.trim()};l(D)}S()}};return a.jsxs(Qt,{open:t,onClose:S,maxWidth:"sm",fullWidth:!0,children:[a.jsx(Yt,{children:u?"固定ページレシピを追加":"レシピを追加"}),a.jsx(Jt,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[!u&&a.jsxs(_n,{fullWidth:!0,children:[a.jsx(nr,{children:"レシピタイプ"}),a.jsxs(wn,{value:f,label:"レシピタイプ",onChange:D=>m(D.target.value),children:[a.jsx(nt,{value:"detail",children:a.jsxs(B,{children:[a.jsx(G,{variant:"body1",children:"詳細 (detail)"}),a.jsx(G,{variant:"caption",color:"text.secondary",children:"1コンテンツ = 1ファイル"})]})}),a.jsx(nt,{value:"list",children:a.jsxs(B,{children:[a.jsx(G,{variant:"body1",children:"一覧 (list)"}),a.jsx(G,{variant:"caption",color:"text.secondary",children:"複数コンテンツ = 1ファイル"})]})})]})]}),a.jsx(bu,{options:n,value:v,onChange:(D,M)=>{const T=M??"";if(C(T),!g.trim()&&T){const E=T.replace(/\.[^/.]+$/,".json");y(E)}},renderInput:D=>a.jsx(Xe,{...D,label:"テンプレートファイル",placeholder:"article/detail.html"}),freeSolo:!0}),a.jsx(Xe,{label:"出力パス",value:g,onChange:D=>y(D.target.value),placeholder:f==="detail"?"/articles/{slug}.json":f==="list"?"/articles/index.json":"/index.json",helperText:f==="detail"?"{slug}, {id} などのプレースホルダーが使用可能":"出力ファイルのパス",fullWidth:!0})]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:S,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:j,disabled:!g.trim()||!v.trim(),children:"追加"})]})]})}function Kie({open:t,onClose:e,onDelete:n}){return a.jsxs(Qt,{open:t,onClose:e,children:[a.jsx(Yt,{children:"レシピを削除"}),a.jsx(Jt,{children:a.jsx(G,{children:"このレシピを削除しますか?この操作は取り消せません。"})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:e,children:"キャンセル"}),a.jsx(pe,{color:"error",variant:"contained",onClick:n,children:"削除"})]})]})}function Qie({open:t,onClose:e,onGenerate:n,dependencyMap:r}){const s=Object.entries(r);return a.jsxs(Qt,{open:t,onClose:e,maxWidth:"md",fullWidth:!0,children:[a.jsx(Yt,{children:"依存マップを生成"}),a.jsxs(Jt,{children:[a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"現在のレシピ設定から依存マップを生成します。 このファイルはビルダーが差分ビルドに使用します。"}),a.jsxs(G,{variant:"subtitle2",sx:{mb:1},children:["生成されるマップ (",s.length," エントリ)"]}),a.jsx($t,{variant:"outlined",sx:{maxHeight:400,overflow:"auto",p:2,bgcolor:"grey.50"},children:a.jsx(B,{component:"pre",sx:{m:0,fontSize:"0.75rem",fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:JSON.stringify(r,null,2)})})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:e,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:n,children:"保存"})]})]})}function sb({open:t,onStay:e,onLeave:n}){return a.jsxs(Qt,{open:t,onClose:e,children:[a.jsx(Yt,{children:"変更が保存されていません"}),a.jsx(Jt,{children:a.jsx(Eo,{children:"編集内容は次回アクセス時に復元できますが、ブラウザの設定やストレージ容量によっては失われる可能性があります。"})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:e,children:"このページに留まる"}),a.jsx(pe,{onClick:n,children:"離れる"})]})]})}function Jie({useCase:t,editorMode:e,canEdit:n=!0}){const r=vr(),s=aa(r.breakpoints.down("md"));b.useSyncExternalStore(t.subscribe.bind(t),t.getSnapshot.bind(t));const i=t.getState();b.useEffect(()=>{t.prepareJsonForMode(e)},[t,e,i.editingRecipe]);const{isLoading:l,isSaving:u,isDirty:p,error:f,message:m,selection:g,selectedRecipe:y,selectedContentType:v,editingRecipe:C,templateFiles:S,contentTypeList:j,addRecipeDialogOpen:D,addRecipeTargetContentTypeId:M,deleteRecipeDialogOpen:T,generateDependencyMapDialogOpen:E,unsavedGuard:k,jsonEditText:A,jsonIsDirty:O,tabSwitchDialogOpen:I}=i;if(l)return a.jsx(B,{"data-component-name":"cmp:RecipeEditorLoading",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})});if(f)return a.jsx(B,{"data-component-name":"cmp:RecipeEditorError",sx:{flex:1,overflow:"auto",p:3},children:a.jsxs(zt,{severity:"error",children:["レシピの読み込みに失敗しました: ",f.message]})});if(!C)return a.jsx(B,{"data-component-name":"cmp:RecipeEditorInitializing",sx:{flex:1,overflow:"auto",p:3},children:a.jsx(zt,{severity:"info",children:"レシピを読み込み中..."})});const R=(()=>{if(!g)return{title:"",icon:null};if(g.type==="contentType"){const H=j.find(L=>L.id===g.contentTypeId),U=(H==null?void 0:H.label)??g.contentTypeId;return g.recipeType==="detail"?{title:`${U} 詳細レシピ`,icon:a.jsx(km,{})}:{title:`${U} 一覧レシピ`,icon:a.jsx(DP,{})}}return g.type==="staticPage"?{title:"固定ページレシピ",icon:a.jsx(Tp,{})}:g.type==="partsDefinition"?{title:"パーツ定義",icon:a.jsx(CP,{})}:{title:"",icon:null}})(),P=()=>a.jsxs(B,{"data-component-name":"cmp:RecipeJsonEditorContainer",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",maxWidth:"xl",mx:"auto",width:"100%"},children:[a.jsx(rm,{filePath:"frelio-data/site/recipe.json",isSaving:u,isDirty:O,onFormat:n?()=>t.formatJson():void 0,onReset:n?()=>t.resetJson():void 0,onSave:n?()=>t.saveFromJson():void 0,readOnly:!n}),a.jsx(B,{"data-component-name":"cmp:RecipeJsonEditorWrapper",sx:{flex:1,overflow:"hidden",pb:1},children:a.jsx(nm,{value:A,onChange:n?H=>t.updateJsonText(H):void 0,height:"100%",readOnly:!n})})]}),z=()=>g?g.type==="contentType"&&g.recipeType==="detail"&&y&&v?a.jsx(zie,{useCase:t,recipe:y,contentType:v,templateFiles:S,contentTypeList:j,canEdit:n}):g.type==="contentType"&&g.recipeType==="list"&&y&&v?a.jsx(Wie,{useCase:t,recipe:y,contentType:v,templateFiles:S,contentTypeList:j,canEdit:n}):g.type==="staticPage"&&y?a.jsx(qie,{useCase:t,recipe:y,templateFiles:S,contentTypeList:j,canEdit:n}):g.type==="partsDefinition"?a.jsx(Gie,{useCase:t,canEdit:n}):a.jsx(B,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(G,{color:"text.secondary",children:"選択されたレシピの読み込み中..."})}):a.jsx(B,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(G,{color:"text.secondary",children:"左のツリーからレシピを選択してください"})}),N=a.jsxs(B,{"data-component-name":"cmp:RecipeUiEditorContainer",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",px:3},children:[a.jsx(la,{title:"ビルドデータレシピ編集",actions:n&&a.jsxs(a.Fragment,{children:[a.jsx(pe,{variant:"outlined",startIcon:a.jsx(b2,{}),onClick:()=>t.openGenerateDependencyMapDialog(),children:"依存マップ生成"}),a.jsx(pe,{variant:"contained",startIcon:u?a.jsx(ut,{size:20,color:"inherit"}):a.jsx(na,{}),onClick:()=>t.save(),disabled:!p||u,children:u?"保存中...":"保存"})]})}),s?a.jsxs(a.Fragment,{children:[a.jsx($t,{sx:{flex:1,overflow:"auto"},children:a.jsx(KO,{useCase:t,canEdit:n})}),a.jsxs(Cu,{"data-component-name":"cmp:RecipeEditorDrawer",anchor:"right",open:!!g,onClose:()=>t.clearSelection(),PaperProps:{sx:{width:"100%",maxWidth:500}},children:[a.jsx(Dp,{title:R.title,icon:R.icon&&a.jsx(B,{sx:{display:"flex",color:"text.secondary"},children:R.icon}),onClose:()=>t.clearSelection(),componentName:"cmp:RecipeEditorDrawerHeader",actions:n&&a.jsxs(a.Fragment,{children:[(g==null?void 0:g.type)!=="partsDefinition"&&a.jsx(ft,{color:"error",onClick:()=>t.openDeleteRecipeDialog(),title:"このレシピを削除",children:a.jsx(zn,{})}),a.jsx(pe,{variant:"contained",size:"small",startIcon:u?a.jsx(ut,{size:16,color:"inherit"}):a.jsx(na,{}),disabled:!p||u,onClick:async()=>{await t.save(),t.clearSelection()},children:"保存"})]})}),a.jsx(B,{sx:{p:2,overflow:"auto",flex:1},children:z()})]})]}):a.jsxs(B,{"data-component-name":"cmp:RecipeEditorLayout",sx:{display:"flex",gap:3,flex:1,overflow:"hidden"},children:[a.jsx($t,{"data-component-name":"cmp:RecipeSidebarPanel",sx:{width:320,flexShrink:0,overflow:"auto"},children:a.jsx(KO,{useCase:t,canEdit:n})}),a.jsxs($t,{"data-component-name":"cmp:RecipeEditorPanel",sx:{flex:1,overflow:"auto",display:"flex",flexDirection:"column"},children:[g&&a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,p:2,borderBottom:1,borderColor:"divider"},children:[R.icon&&a.jsx(B,{sx:{display:"flex",color:"text.secondary"},children:R.icon}),a.jsx(G,{variant:"h6",sx:{flex:1},children:R.title}),n&&g.type!=="partsDefinition"&&a.jsx(ft,{color:"error",onClick:()=>t.openDeleteRecipeDialog(),title:"このレシピを削除",children:a.jsx(zn,{})})]}),a.jsx(B,{sx:{flex:1,overflow:"auto",p:3},children:z()})]})]}),a.jsx(Zie,{open:D,contentTypeId:M,templateFiles:S,onClose:()=>t.closeAddRecipeDialog(),onAddDetail:H=>{M&&(t.addDetailRecipe(M,H),t.closeAddRecipeDialog())},onAddList:H=>{M&&(t.addListRecipe(M,H),t.closeAddRecipeDialog())},onAddStatic:H=>{t.addStaticRecipe(H),t.closeAddRecipeDialog()}}),a.jsx(Kie,{open:T,onClose:()=>t.closeDeleteRecipeDialog(),onDelete:()=>t.deleteCurrentRecipe()}),a.jsx(Qie,{open:E,onClose:()=>t.closeGenerateDependencyMapDialog(),onGenerate:()=>t.saveDependencyMap(),dependencyMap:t.generateDependencyMap()}),a.jsx(sb,{open:(k==null?void 0:k.isBlocked)??!1,onStay:()=>k==null?void 0:k.reset(),onLeave:()=>k==null?void 0:k.proceed()}),a.jsx(ea,{open:!!m,autoHideDuration:4e3,onClose:()=>t.clearMessage(),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{severity:(m==null?void 0:m.type)??"info",onClose:()=>t.clearMessage(),children:m==null?void 0:m.text})})]});return a.jsxs(B,{"data-component-name":"cmp:RecipeEditor",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e==="ui"&&N,e==="json"&&P(),a.jsx(nb,{open:I,onStay:()=>t.cancelTabSwitch(),onDiscard:()=>t.discardAndSwitchTab(),onSaveAndSwitch:()=>t.saveAndSwitchTab()})]})}function sm(t,e){const n=new Set;if(t)for(const r of t)sm(r.expand,r.customFields).forEach(i=>n.add(i));if(e)for(const r of e)r.type==="relationList"&&(n.add(r.contentTypeId),sm(r.expand,r.customFields).forEach(i=>n.add(i)));return n}function im(t){return[`content_types/${t}`,`contents/*/${t}/*`]}function Yie(t,e,n,r){const s=[...im(e),`templates/${n.templatePath}`],i=sm(n.expand,n.customFields);for(const l of i)s.push(...im(l));t[n.outputPath]=[...new Set(s)]}function Xie(t,e,n,r){var u;const s=[...im(e),`templates/${n.templatePath}`],i=n.pagination?(u=n.items)==null?void 0:u.expand:n.expand,l=sm(i,n.customFields);for(const p of l)s.push(...im(p));t[n.outputPath]=[...new Set(s)]}function eoe(t,e,n,r){if(n.details)for(const s of n.details)Yie(t,e,s);if(n.lists)for(const s of n.lists)Xie(t,e,s)}function toe(t,e){for(const n of e){const r=[`templates/${n.templatePath}`],s=sm(void 0,n.customFields);for(const i of s)r.push(...im(i));t[n.outputPath]=[...new Set(r)]}}function noe(t,e){for(const[n,r]of Object.entries(e)){const s=`templates/${n}`;if(r.includes("*"))for(const i of Object.keys(t))t[i].includes(s)||t[i].push(s);else for(const i of Object.keys(t)){const l=t[i];r.some(p=>l.includes(`templates/${p}`))&&!l.includes(s)&&l.push(s)}}}function roe(t,e){const n={};for(const[r,s]of Object.entries(t.contentTypes))eoe(n,r,s);return t.staticPages&&toe(n,t.staticPages),t.templateIncludes&&noe(n,t.templateIncludes),n}function soe(t){return{version:"1.0",contentTypes:{},staticPages:[],templateIncludes:{},lastUpdatedAt:new Date().toISOString(),lastUpdatedBy:t}}class Nf{constructor(e,n,r,s,i,l,u,p){this.token=e,this.branch=n,this.recipeQuery=r,this.templateFilesQuery=s,this.contentTypeList=i,this.saveRecipeMutation=l,this.saveDependencyMapMutation=u,this.queryClient=p}static RecipeQueryParams(e,n,r){return{queryKey:["recipe",n],queryFn:async()=>{if(!e)throw new Error("Not authenticated");const i=await new At(e).fetchFileOrNull(TM(),n);return i?JSON.parse(i):soe(r)},enabled:!!e}}static TemplateFilesQueryParams(e,n){return{queryKey:["templateFiles",n],queryFn:async()=>{if(!e)throw new Error("Not authenticated");const r=new At(e);return await V5(r,h2,n)},enabled:!!e}}static SaveRecipeMutationParams(e,n,r){return{mutationFn:async s=>{if(!n)throw new Error("Not authenticated");await new At(n).commitFiles("ビルドレシピ更新",[{path:TM(),content:JSON.stringify(s,null,2)}],r)},onSuccess:()=>{e.invalidateQueries({queryKey:["recipe",r]})}}}static SaveDependencyMapMutationParams(e,n,r){return{mutationFn:async s=>{if(!n)throw new Error("Not authenticated");await new At(n).commitFiles("依存マップ更新",[{path:JK(),content:JSON.stringify(s,null,2)}],r)},onSuccess:()=>{e.invalidateQueries({queryKey:["dependencyMap",r]})}}}getRecipe(){return this.recipeQuery.data??void 0}isRecipeLoading(){return this.recipeQuery.isLoading}getRecipeError(){return this.recipeQuery.error??null}getContentTypeList(){return this.contentTypeList}async fetchContentType(e){if(!this.token)throw new Error("Not authenticated");const r=await new At(this.token).fetchFileOrNull(Kl(e),this.branch);return r?JSON.parse(r):null}getTemplateFiles(){return this.templateFilesQuery.data??[]}isTemplateFilesLoading(){return this.templateFilesQuery.isLoading}async saveRecipe(e){await this.saveRecipeMutation.mutateAsync(e)}async saveDependencyMap(e){await this.saveDependencyMapMutation.mutateAsync(e)}isSaving(){return this.saveRecipeMutation.isPending||this.saveDependencyMapMutation.isPending}invalidateRecipe(){this.queryClient.invalidateQueries({queryKey:["recipe",this.branch]})}generateDependencyMap(e){return roe(e)}}async function V5(t,e,n,r=e){try{const s=await t.listDirectoryEntries(e,n),i=[];for(const l of s){const u=`${e}/${l.name}`;if(l.type==="blob"){const p=u.replace(`${r}/`,"");i.push(p)}else if(l.type==="tree"){const p=await V5(t,u,n,r);i.push(...p)}}return i}catch{return[]}}function JO(t){return t.ct&&t.type&&t.idx!==void 0?{type:"contentType",contentTypeId:t.ct,recipeType:t.type,index:t.idx}:t.static!==void 0?{type:"staticPage",index:t.static}:t.parts===1?{type:"partsDefinition"}:null}function T1(t){if(!t)return{};switch(t.type){case"contentType":return{ct:t.contentTypeId,type:t.recipeType,idx:t.index};case"staticPage":return{static:t.index};case"partsDefinition":return{parts:1}}}function ioe(t,e){if(t===null&&e===null)return!0;if(t===null||e===null||t.type!==e.type)return!1;switch(t.type){case"contentType":return e.type==="contentType"&&t.contentTypeId===e.contentTypeId&&t.recipeType===e.recipeType&&t.index===e.index;case"staticPage":return e.type==="staticPage"&&t.index===e.index;case"partsDefinition":return e.type==="partsDefinition"}}var Rn;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const l of s)i[l]=l;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),l={};for(const u of i)l[u]=s[u];return t.objectValues(l)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&i.push(l);return i},t.find=(s,i)=>{for(const l of s)if(i(l))return l},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Rn||(Rn={}));var YO;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(YO||(YO={}));const yt=Rn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Dl=t=>{switch(typeof t){case"undefined":return yt.undefined;case"string":return yt.string;case"number":return Number.isNaN(t)?yt.nan:yt.number;case"boolean":return yt.boolean;case"function":return yt.function;case"bigint":return yt.bigint;case"symbol":return yt.symbol;case"object":return Array.isArray(t)?yt.array:t===null?yt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?yt.promise:typeof Map<"u"&&t instanceof Map?yt.map:typeof Set<"u"&&t instanceof Set?yt.set:typeof Date<"u"&&t instanceof Date?yt.date:yt.object;default:return yt.unknown}},qe=Rn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Za extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(s);else if(l.code==="invalid_return_type")s(l.returnTypeError);else if(l.code==="invalid_arguments")s(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let u=r,p=0;for(;p<l.path.length;){const f=l.path[p];p===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(l))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),r}static assert(e){if(!(e instanceof Za))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Rn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Za.create=t=>new Za(t);const KC=(t,e)=>{let n;switch(t.code){case qe.invalid_type:t.received===yt.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case qe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Rn.jsonStringifyReplacer)}`;break;case qe.unrecognized_keys:n=`Unrecognized key(s) in object: ${Rn.joinValues(t.keys,", ")}`;break;case qe.invalid_union:n="Invalid input";break;case qe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Rn.joinValues(t.options)}`;break;case qe.invalid_enum_value:n=`Invalid enum value. Expected ${Rn.joinValues(t.options)}, received '${t.received}'`;break;case qe.invalid_arguments:n="Invalid function arguments";break;case qe.invalid_return_type:n="Invalid function return type";break;case qe.invalid_date:n="Invalid date";break;case qe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Rn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case qe.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case qe.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case qe.custom:n="Invalid input";break;case qe.invalid_intersection_types:n="Intersection results could not be merged";break;case qe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case qe.not_finite:n="Number must be finite";break;default:n=e.defaultError,Rn.assertNever(t)}return{message:n}};let ooe=KC;function aoe(){return ooe}const loe=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],l={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let u="";const p=r.filter(f=>!!f).slice().reverse();for(const f of p)u=f(l,{data:e,defaultError:u}).message;return{...s,path:i,message:u}};function lt(t,e){const n=aoe(),r=loe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===KC?void 0:KC].filter(s=>!!s)});t.common.issues.push(r)}class $s{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Bt;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,l=await s.value;r.push({key:i,value:l})}return $s.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:l}=s;if(i.status==="aborted"||l.status==="aborted")return Bt;i.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||s.alwaysSet)&&(r[i.value]=l.value)}return{status:e.value,value:r}}}const Bt=Object.freeze({status:"aborted"}),Xf=t=>({status:"dirty",value:t}),io=t=>({status:"valid",value:t}),XO=t=>t.status==="aborted",eA=t=>t.status==="dirty",dp=t=>t.status==="valid",Vv=t=>typeof Promise<"u"&&t instanceof Promise;var Ct;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ct||(Ct={}));class ia{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const tA=(t,e)=>{if(dp(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Za(t.common.issues);return this._error=n,this._error}}};function tn(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(l,u)=>{const{message:p}=t;return l.code==="invalid_enum_value"?{message:p??u.defaultError}:typeof u.data>"u"?{message:p??r??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:p??n??u.defaultError}},description:s}}class vn{get description(){return this._def.description}_getType(e){return Dl(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Dl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $s,ctx:{common:e.parent.common,data:e.data,parsedType:Dl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Vv(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Dl(e)},s=this._parseSync({data:e,path:r.path,parent:r});return tA(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Dl(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return dp(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>dp(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Dl(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Vv(s)?s:Promise.resolve(s));return tA(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const l=e(s),u=()=>i.addIssue({code:qe.custom,...r(s)});return typeof Promise<"u"&&l instanceof Promise?l.then(p=>p?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new hp({schema:this,typeName:Ft.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Xl.create(this,this._def)}nullable(){return mp.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ko.create(this)}promise(){return Zv.create(this,this._def)}or(e){return Wv.create([this,e],this._def)}and(e){return qv.create(this,e,this._def)}transform(e){return new hp({...tn(this._def),schema:this,typeName:Ft.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new tw({...tn(this._def),innerType:this,defaultValue:n,typeName:Ft.ZodDefault})}brand(){return new Ooe({typeName:Ft.ZodBranded,type:this,...tn(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new nw({...tn(this._def),innerType:this,catchValue:n,typeName:Ft.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return H2.create(this,e)}readonly(){return rw.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const coe=/^c[^\s-]{8,}$/i,uoe=/^[0-9a-z]+$/,doe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,poe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,foe=/^[a-z0-9_-]{21}$/i,hoe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,moe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,goe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yoe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let D1;const voe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xoe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,boe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Soe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Coe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,woe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,H5="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",joe=new RegExp(`^${H5}$`);function W5(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Toe(t){return new RegExp(`^${W5(t)}$`)}function Doe(t){let e=`${H5}T${W5(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Eoe(t,e){return!!((e==="v4"||!e)&&voe.test(t)||(e==="v6"||!e)&&boe.test(t))}function Roe(t,e){if(!hoe.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function koe(t,e){return!!((e==="v4"||!e)&&xoe.test(t)||(e==="v6"||!e)&&Soe.test(t))}class Fa extends vn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==yt.string){const i=this._getOrReturnCtx(e);return lt(i,{code:qe.invalid_type,expected:yt.string,received:i.parsedType}),Bt}const r=new $s;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,u=e.data.length<i.value;(l||u)&&(s=this._getOrReturnCtx(e,s),l?lt(s,{code:qe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&<(s,{code:qe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")goe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"email",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")D1||(D1=new RegExp(yoe,"u")),D1.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"emoji",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")poe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"uuid",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")foe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"nanoid",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")coe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"cuid",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")uoe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"cuid2",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")doe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"ulid",code:qe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),lt(s,{validation:"url",code:qe.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"regex",code:qe.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Doe(i).test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?joe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Toe(i).test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?moe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"duration",code:qe.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Eoe(e.data,i.version)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"ip",code:qe.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Roe(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"jwt",code:qe.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?koe(e.data,i.version)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"cidr",code:qe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Coe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"base64",code:qe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?woe.test(e.data)||(s=this._getOrReturnCtx(e,s),lt(s,{validation:"base64url",code:qe.invalid_string,message:i.message}),r.dirty()):Rn.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:qe.invalid_string,...Ct.errToObj(r)})}_addCheck(e){return new Fa({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ct.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ct.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ct.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ct.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ct.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ct.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ct.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ct.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ct.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ct.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ct.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ct.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ct.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ct.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ct.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ct.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ct.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ct.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ct.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ct.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ct.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ct.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ct.errToObj(n)})}nonempty(e){return this.min(1,Ct.errToObj(e))}trim(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Fa.create=t=>new Fa({checks:[],typeName:Ft.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...tn(t)});function Moe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),l=Number.parseInt(e.toFixed(s).replace(".",""));return i%l/10**s}class pp extends vn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==yt.number){const i=this._getOrReturnCtx(e);return lt(i,{code:qe.invalid_type,expected:yt.number,received:i.parsedType}),Bt}let r;const s=new $s;for(const i of this._def.checks)i.kind==="int"?Rn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),lt(r,{code:qe.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),lt(r,{code:qe.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),lt(r,{code:qe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Moe(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),lt(r,{code:qe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),lt(r,{code:qe.not_finite,message:i.message}),s.dirty()):Rn.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ct.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ct.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ct.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ct.toString(n))}setLimit(e,n,r,s){return new pp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ct.toString(s)}]})}_addCheck(e){return new pp({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ct.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ct.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ct.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ct.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ct.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ct.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ct.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ct.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ct.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Rn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}pp.create=t=>new pp({checks:[],typeName:Ft.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...tn(t)});class om extends vn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==yt.bigint)return this._getInvalidInput(e);let r;const s=new $s;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),lt(r,{code:qe.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),lt(r,{code:qe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),lt(r,{code:qe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Rn.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return lt(n,{code:qe.invalid_type,expected:yt.bigint,received:n.parsedType}),Bt}gte(e,n){return this.setLimit("min",e,!0,Ct.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ct.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ct.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ct.toString(n))}setLimit(e,n,r,s){return new om({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ct.toString(s)}]})}_addCheck(e){return new om({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ct.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ct.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ct.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ct.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ct.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}om.create=t=>new om({checks:[],typeName:Ft.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...tn(t)});class QC extends vn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==yt.boolean){const r=this._getOrReturnCtx(e);return lt(r,{code:qe.invalid_type,expected:yt.boolean,received:r.parsedType}),Bt}return io(e.data)}}QC.create=t=>new QC({typeName:Ft.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...tn(t)});class Hv extends vn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==yt.date){const i=this._getOrReturnCtx(e);return lt(i,{code:qe.invalid_type,expected:yt.date,received:i.parsedType}),Bt}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return lt(i,{code:qe.invalid_date}),Bt}const r=new $s;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),lt(s,{code:qe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Rn.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Hv({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ct.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ct.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Hv.create=t=>new Hv({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Ft.ZodDate,...tn(t)});class nA extends vn{_parse(e){if(this._getType(e)!==yt.symbol){const r=this._getOrReturnCtx(e);return lt(r,{code:qe.invalid_type,expected:yt.symbol,received:r.parsedType}),Bt}return io(e.data)}}nA.create=t=>new nA({typeName:Ft.ZodSymbol,...tn(t)});class rA extends vn{_parse(e){if(this._getType(e)!==yt.undefined){const r=this._getOrReturnCtx(e);return lt(r,{code:qe.invalid_type,expected:yt.undefined,received:r.parsedType}),Bt}return io(e.data)}}rA.create=t=>new rA({typeName:Ft.ZodUndefined,...tn(t)});class sA extends vn{_parse(e){if(this._getType(e)!==yt.null){const r=this._getOrReturnCtx(e);return lt(r,{code:qe.invalid_type,expected:yt.null,received:r.parsedType}),Bt}return io(e.data)}}sA.create=t=>new sA({typeName:Ft.ZodNull,...tn(t)});class iA extends vn{constructor(){super(...arguments),this._any=!0}_parse(e){return io(e.data)}}iA.create=t=>new iA({typeName:Ft.ZodAny,...tn(t)});class JC extends vn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return io(e.data)}}JC.create=t=>new JC({typeName:Ft.ZodUnknown,...tn(t)});class cc extends vn{_parse(e){const n=this._getOrReturnCtx(e);return lt(n,{code:qe.invalid_type,expected:yt.never,received:n.parsedType}),Bt}}cc.create=t=>new cc({typeName:Ft.ZodNever,...tn(t)});class oA extends vn{_parse(e){if(this._getType(e)!==yt.undefined){const r=this._getOrReturnCtx(e);return lt(r,{code:qe.invalid_type,expected:yt.void,received:r.parsedType}),Bt}return io(e.data)}}oA.create=t=>new oA({typeName:Ft.ZodVoid,...tn(t)});class Ko extends vn{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==yt.array)return lt(n,{code:qe.invalid_type,expected:yt.array,received:n.parsedType}),Bt;if(s.exactLength!==null){const l=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(l||u)&&(lt(n,{code:l?qe.too_big:qe.too_small,minimum:u?s.exactLength.value:void 0,maximum:l?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(lt(n,{code:qe.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(lt(n,{code:qe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>s.type._parseAsync(new ia(n,l,n.path,u)))).then(l=>$s.mergeArray(r,l));const i=[...n.data].map((l,u)=>s.type._parseSync(new ia(n,l,n.path,u)));return $s.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Ko({...this._def,minLength:{value:e,message:Ct.toString(n)}})}max(e,n){return new Ko({...this._def,maxLength:{value:e,message:Ct.toString(n)}})}length(e,n){return new Ko({...this._def,exactLength:{value:e,message:Ct.toString(n)}})}nonempty(e){return this.min(1,e)}}Ko.create=(t,e)=>new Ko({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ft.ZodArray,...tn(e)});function Cd(t){if(t instanceof Vr){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Xl.create(Cd(r))}return new Vr({...t._def,shape:()=>e})}else return t instanceof Ko?new Ko({...t._def,type:Cd(t.element)}):t instanceof Xl?Xl.create(Cd(t.unwrap())):t instanceof mp?mp.create(Cd(t.unwrap())):t instanceof xu?xu.create(t.items.map(e=>Cd(e))):t}class Vr extends vn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Rn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==yt.object){const f=this._getOrReturnCtx(e);return lt(f,{code:qe.invalid_type,expected:yt.object,received:f.parsedType}),Bt}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof cc&&this._def.unknownKeys==="strip"))for(const f in s.data)l.includes(f)||u.push(f);const p=[];for(const f of l){const m=i[f],g=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new ia(s,g,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof cc){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(lt(s,{code:qe.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const g=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new ia(s,g,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const g=await m.key,y=await m.value;f.push({key:g,value:y,alwaysSet:m.alwaysSet})}return f}).then(f=>$s.mergeObjectSync(r,f)):$s.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(e){return Ct.errToObj,new Vr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,l;const s=((l=(i=this._def).errorMap)==null?void 0:l.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ct.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Vr({...this._def,unknownKeys:"strip"})}passthrough(){return new Vr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Vr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Vr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ft.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Vr({...this._def,catchall:e})}pick(e){const n={};for(const r of Rn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Vr({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Rn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Vr({...this._def,shape:()=>n})}deepPartial(){return Cd(this)}partial(e){const n={};for(const r of Rn.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new Vr({...this._def,shape:()=>n})}required(e){const n={};for(const r of Rn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Xl;)i=i._def.innerType;n[r]=i}return new Vr({...this._def,shape:()=>n})}keyof(){return q5(Rn.objectKeys(this.shape))}}Vr.create=(t,e)=>new Vr({shape:()=>t,unknownKeys:"strip",catchall:cc.create(),typeName:Ft.ZodObject,...tn(e)});Vr.strictCreate=(t,e)=>new Vr({shape:()=>t,unknownKeys:"strict",catchall:cc.create(),typeName:Ft.ZodObject,...tn(e)});Vr.lazycreate=(t,e)=>new Vr({shape:t,unknownKeys:"strip",catchall:cc.create(),typeName:Ft.ZodObject,...tn(e)});class Wv extends vn{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const l=i.map(u=>new Za(u.ctx.common.issues));return lt(n,{code:qe.invalid_union,unionErrors:l}),Bt}if(n.common.async)return Promise.all(r.map(async i=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(s);{let i;const l=[];for(const p of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=l.map(p=>new Za(p));return lt(n,{code:qe.invalid_union,unionErrors:u}),Bt}}get options(){return this._def.options}}Wv.create=(t,e)=>new Wv({options:t,typeName:Ft.ZodUnion,...tn(e)});function YC(t,e){const n=Dl(t),r=Dl(e);if(t===e)return{valid:!0,data:t};if(n===yt.object&&r===yt.object){const s=Rn.objectKeys(e),i=Rn.objectKeys(t).filter(u=>s.indexOf(u)!==-1),l={...t,...e};for(const u of i){const p=YC(t[u],e[u]);if(!p.valid)return{valid:!1};l[u]=p.data}return{valid:!0,data:l}}else if(n===yt.array&&r===yt.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const l=t[i],u=e[i],p=YC(l,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===yt.date&&r===yt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class qv extends vn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,l)=>{if(XO(i)||XO(l))return Bt;const u=YC(i.value,l.value);return u.valid?((eA(i)||eA(l))&&n.dirty(),{status:n.value,value:u.data}):(lt(r,{code:qe.invalid_intersection_types}),Bt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,l])=>s(i,l)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}qv.create=(t,e,n)=>new qv({left:t,right:e,typeName:Ft.ZodIntersection,...tn(n)});class xu extends vn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==yt.array)return lt(r,{code:qe.invalid_type,expected:yt.array,received:r.parsedType}),Bt;if(r.data.length<this._def.items.length)return lt(r,{code:qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Bt;!this._def.rest&&r.data.length>this._def.items.length&&(lt(r,{code:qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((l,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new ia(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(i).then(l=>$s.mergeArray(n,l)):$s.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new xu({...this._def,rest:e})}}xu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xu({items:t,typeName:Ft.ZodTuple,rest:null,...tn(e)})};class Gv extends vn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==yt.object)return lt(r,{code:qe.invalid_type,expected:yt.object,received:r.parsedType}),Bt;const s=[],i=this._def.keyType,l=this._def.valueType;for(const u in r.data)s.push({key:i._parse(new ia(r,u,r.path,u)),value:l._parse(new ia(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?$s.mergeObjectAsync(n,s):$s.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof vn?new Gv({keyType:e,valueType:n,typeName:Ft.ZodRecord,...tn(r)}):new Gv({keyType:Fa.create(),valueType:e,typeName:Ft.ZodRecord,...tn(n)})}}class aA extends vn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==yt.map)return lt(r,{code:qe.invalid_type,expected:yt.map,received:r.parsedType}),Bt;const s=this._def.keyType,i=this._def.valueType,l=[...r.data.entries()].map(([u,p],f)=>({key:s._parse(new ia(r,u,r.path,[f,"key"])),value:i._parse(new ia(r,p,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of l){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return Bt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of l){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return Bt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}aA.create=(t,e,n)=>new aA({valueType:e,keyType:t,typeName:Ft.ZodMap,...tn(n)});class am extends vn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==yt.set)return lt(r,{code:qe.invalid_type,expected:yt.set,received:r.parsedType}),Bt;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(lt(r,{code:qe.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(lt(r,{code:qe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function l(p){const f=new Set;for(const m of p){if(m.status==="aborted")return Bt;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((p,f)=>i._parse(new ia(r,p,r.path,f)));return r.common.async?Promise.all(u).then(p=>l(p)):l(u)}min(e,n){return new am({...this._def,minSize:{value:e,message:Ct.toString(n)}})}max(e,n){return new am({...this._def,maxSize:{value:e,message:Ct.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}am.create=(t,e)=>new am({valueType:t,minSize:null,maxSize:null,typeName:Ft.ZodSet,...tn(e)});class XC extends vn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}XC.create=(t,e)=>new XC({getter:t,typeName:Ft.ZodLazy,...tn(e)});class ew extends vn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return lt(n,{received:n.data,code:qe.invalid_literal,expected:this._def.value}),Bt}return{status:"valid",value:e.data}}get value(){return this._def.value}}ew.create=(t,e)=>new ew({value:t,typeName:Ft.ZodLiteral,...tn(e)});function q5(t,e){return new fp({values:t,typeName:Ft.ZodEnum,...tn(e)})}class fp extends vn{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return lt(n,{expected:Rn.joinValues(r),received:n.parsedType,code:qe.invalid_type}),Bt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return lt(n,{received:n.data,code:qe.invalid_enum_value,options:r}),Bt}return io(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return fp.create(e,{...this._def,...n})}exclude(e,n=this._def){return fp.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}fp.create=q5;class lA extends vn{_parse(e){const n=Rn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==yt.string&&r.parsedType!==yt.number){const s=Rn.objectValues(n);return lt(r,{expected:Rn.joinValues(s),received:r.parsedType,code:qe.invalid_type}),Bt}if(this._cache||(this._cache=new Set(Rn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Rn.objectValues(n);return lt(r,{received:r.data,code:qe.invalid_enum_value,options:s}),Bt}return io(e.data)}get enum(){return this._def.values}}lA.create=(t,e)=>new lA({values:t,typeName:Ft.ZodNativeEnum,...tn(e)});class Zv extends vn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==yt.promise&&n.common.async===!1)return lt(n,{code:qe.invalid_type,expected:yt.promise,received:n.parsedType}),Bt;const r=n.parsedType===yt.promise?n.data:Promise.resolve(n.data);return io(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Zv.create=(t,e)=>new Zv({type:t,typeName:Ft.ZodPromise,...tn(e)});class hp extends vn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ft.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:l=>{lt(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const l=s.transform(r.data,i);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return Bt;const p=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return p.status==="aborted"?Bt:p.status==="dirty"||n.value==="dirty"?Xf(p.value):p});{if(n.value==="aborted")return Bt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?Bt:u.status==="dirty"||n.value==="dirty"?Xf(u.value):u}}if(s.type==="refinement"){const l=u=>{const p=s.refinement(u,i);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Bt:(u.status==="dirty"&&n.dirty(),l(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Bt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!dp(l))return Bt;const u=s.transform(l.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>dp(l)?Promise.resolve(s.transform(l.value,i)).then(u=>({status:n.value,value:u})):Bt);Rn.assertNever(s)}}hp.create=(t,e,n)=>new hp({schema:t,typeName:Ft.ZodEffects,effect:e,...tn(n)});hp.createWithPreprocess=(t,e,n)=>new hp({schema:e,effect:{type:"preprocess",transform:t},typeName:Ft.ZodEffects,...tn(n)});class Xl extends vn{_parse(e){return this._getType(e)===yt.undefined?io(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xl.create=(t,e)=>new Xl({innerType:t,typeName:Ft.ZodOptional,...tn(e)});class mp extends vn{_parse(e){return this._getType(e)===yt.null?io(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mp.create=(t,e)=>new mp({innerType:t,typeName:Ft.ZodNullable,...tn(e)});class tw extends vn{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===yt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}tw.create=(t,e)=>new tw({innerType:t,typeName:Ft.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...tn(e)});class nw extends vn{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Vv(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Za(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Za(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}nw.create=(t,e)=>new nw({innerType:t,typeName:Ft.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...tn(e)});class cA extends vn{_parse(e){if(this._getType(e)!==yt.nan){const r=this._getOrReturnCtx(e);return lt(r,{code:qe.invalid_type,expected:yt.nan,received:r.parsedType}),Bt}return{status:"valid",value:e.data}}}cA.create=t=>new cA({typeName:Ft.ZodNaN,...tn(t)});class Ooe extends vn{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class H2 extends vn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Bt:i.status==="dirty"?(n.dirty(),Xf(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Bt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new H2({in:e,out:n,typeName:Ft.ZodPipeline})}}class rw extends vn{_parse(e){const n=this._def.innerType._parse(e),r=s=>(dp(s)&&(s.value=Object.freeze(s.value)),s);return Vv(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}rw.create=(t,e)=>new rw({innerType:t,typeName:Ft.ZodReadonly,...tn(e)});var Ft;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ft||(Ft={}));const Nt=Fa.create,oa=pp.create,Wl=QC.create,Du=JC.create;cc.create;const Kn=Ko.create,lr=Vr.create,G5=Wv.create;qv.create;xu.create;const uA=Gv.create,Z5=XC.create,ib=ew.create,Eu=fp.create;Zv.create;Xl.create;mp.create;var sw=Eu(["text","html","markdown","number","boolean","date","image","file","select","relation","array","label"]),Aoe=lr({label:Nt(),value:Nt()}),K5=lr({key:Nt().min(1,"キーは必須です"),type:sw,multiple:Wl(),useAsUrl:Wl().optional(),options:lr({choices:Kn(Aoe).optional(),targetContentType:Nt().optional(),itemType:sw.optional(),itemFields:Kn(Z5(()=>K5)).optional(),minItems:oa().optional(),maxItems:oa().optional()}).optional()}),_oe=lr({id:Nt().min(1,"IDは必須です"),fields:Kn(K5)}),Ioe=Eu(["16:9","4:3","3:2","1:1","free"]).nullable().optional(),Poe=Eu(["trim","lowercase","uppercase","slug","phone","postalCode"]).nullable().optional(),Loe=lr({key:Nt().min(1),type:sw.optional(),label:Nt(),required:Wl(),defaultValue:Du(),placeholder:Nt().nullable(),description:Nt().nullable(),warnLength:oa().nullable(),columns:oa().min(1).max(12),break:Wl(),hidden:Wl(),readOnly:Wl(),aspectRatio:Ioe,pattern:Nt().nullable().optional(),patternMessage:Nt().nullable().optional(),autoFormat:Poe,labelColor:Nt().nullable().optional()}),zoe=lr({id:Nt().min(1),label:Nt().min(1),fieldKeys:Kn(Nt())}),$oe=lr({id:Nt().min(1,"IDは必須です"),label:Nt().min(1,"ラベルは必須です"),fields:Kn(Loe),groups:Kn(zoe)}),Noe=Eu(["eq","neq","in","nin","contains","startsWith","endsWith"]),Foe=lr({field:Nt().min(1),operator:Noe,value:Du()}),Boe=lr({field:Nt().min(1),label:Nt().min(1),width:Nt().optional(),sortable:Wl().optional()}),Uoe=lr({field:Nt().min(1),direction:Eu(["asc","desc"])}),Voe=lr({id:Nt().min(1,"ビューIDは必須です"),label:Nt().min(1,"ビューラベルは必須です"),columns:Kn(Boe),defaultSort:Uoe.optional(),filters:Kn(Foe).optional()}),Hoe=lr({defaultViewId:Nt().min(1,"デフォルトビューIDは必須です"),views:Kn(Voe).min(1,"少なくとも1つのビューが必要です")}),Kv=lr({field:Nt(),direction:Eu(["asc","desc"])}),Woe=Eu(["eq","neq","gt","gte","lt","lte","in","nin","regex","isNull","isNotNull"]),Q5=lr({field:Nt(),operator:Woe,value:Du().optional()}),Qv=lr({field:Nt(),fields:Kn(Nt()).optional(),customFields:Kn(Du()).optional(),sort:G5([Kv,Kn(Kv)]).optional(),limit:oa().optional(),offset:oa().optional(),filters:Kn(Q5).optional(),expand:Kn(Z5(()=>Qv)).optional()}),qoe=lr({perPage:oa(),numberFormatCount:oa().optional(),startPath:Nt().optional()}),Goe=lr({type:ib("detail"),outputPath:Nt(),templatePath:Nt(),expand:Kn(Qv).optional(),repeat:lr({as:Nt(),field:Nt(),outputPath:Nt()}).optional(),customFields:Kn(Du()).optional(),include:lr({site:Wl().optional()}).optional()}),Zoe=lr({type:ib("list"),outputPath:Nt(),templatePath:Nt(),offset:oa().optional(),limit:oa().optional(),sort:G5([Kv,Kn(Kv)]).optional(),filters:Kn(Q5).optional(),customFields:Kn(Du()).optional(),listFields:Kn(Nt()).nullable().optional(),expand:Kn(Qv).optional(),pagination:qoe.optional(),items:lr({fields:Kn(Nt()).nullable().optional(),expand:Kn(Qv).optional()}).optional()}),Koe=lr({details:Kn(Goe).optional(),lists:Kn(Zoe).optional()}),Qoe=lr({type:ib("static"),outputPath:Nt(),templatePath:Nt(),customFields:Kn(Du()).optional()}),Joe=lr({version:ib("1.0"),contentTypes:uA(Nt(),Koe),staticPages:Kn(Qoe).optional(),templateIncludes:uA(Nt(),Kn(Nt())).optional(),lastUpdatedAt:Nt(),lastUpdatedBy:Nt()});lr({contentType:_oe,contentTypeUi:$oe});function dA(t){const e=Joe.safeParse(t);return e.success?{success:!0,data:e.data}:{success:!1,errors:e.error}}function Yoe(t){const e=Hoe.safeParse(t);return e.success?{success:!0,data:e.data}:{success:!1,errors:e.error}}function iw(t){return t.errors.map(e=>{const n=e.path.join(".");return n?`${n}: ${e.message}`:e.message}).join(`
|
|
496
|
+
`)}class Xoe{constructor(e,n,r,s,i){this.repo=e,this.presenter=n,this.username=r,this.navigate=s,this.unsavedGuard=i}getState(){var p,f,m;const e=this.presenter.getState(),n=this.repo.getRecipe(),r=e.editingRecipe,s=e.selection;let i=null,l=null;if(r&&s)if(s.type==="contentType"){const g=r.contentTypes[s.contentTypeId];g&&(s.recipeType==="detail"?i=((p=g.details)==null?void 0:p[s.index])??null:i=((f=g.lists)==null?void 0:f[s.index])??null),l=e.contentTypeCache.get(s.contentTypeId)??null}else s.type==="staticPage"&&(i=((m=r.staticPages)==null?void 0:m[s.index])??null);const u=r!==null&&n!==null?JSON.stringify(r)!==JSON.stringify(n):!1;return{recipe:n??null,editingRecipe:r,contentTypeList:this.repo.getContentTypeList(),templateFiles:this.repo.getTemplateFiles(),selection:s,selectedRecipe:i,selectedContentType:l,isLoading:this.repo.isRecipeLoading()||this.repo.isTemplateFilesLoading(),isSaving:this.repo.isSaving(),isDirty:u,error:this.repo.getRecipeError(),message:e.message,addRecipeDialogOpen:e.addRecipeDialogOpen,addRecipeTargetContentTypeId:e.addRecipeTargetContentTypeId,deleteRecipeDialogOpen:e.deleteRecipeDialogOpen,previewDialogOpen:e.previewDialogOpen,generateDependencyMapDialogOpen:e.generateDependencyMapDialogOpen,expandedContentTypes:e.expandedContentTypes,unsavedGuard:this.unsavedGuard??null,editorMode:e.editorMode,jsonEditText:e.jsonEditText,jsonIsDirty:e.jsonIsDirty,tabSwitchDialogOpen:e.tabSwitchDialogOpen,pendingTabSwitch:e.pendingTabSwitch}}initializeRecipe(){const e=this.repo.getRecipe();e&&this.presenter.setEditingRecipe(JSON.parse(JSON.stringify(e)))}async selectContentType(e,n,r){var i;const s={type:"contentType",contentTypeId:e,recipeType:n,index:r};if(this.presenter.setSelection(s),(i=this.navigate)==null||i.call(this,T1(s)),!this.presenter.getContentTypeFromCache(e)){const l=await this.repo.fetchContentType(e);l&&this.presenter.setContentTypeCache(e,l)}}selectStaticPage(e){var r;const n={type:"staticPage",index:e};this.presenter.setSelection(n),(r=this.navigate)==null||r.call(this,T1(n))}selectPartsDefinition(){var n;const e={type:"partsDefinition"};this.presenter.setSelection(e),(n=this.navigate)==null||n.call(this,T1(e))}clearSelection(){var e;this.presenter.setSelection(null),(e=this.navigate)==null||e.call(this,{})}async getContentType(e){const n=this.presenter.getContentTypeFromCache(e);if(n)return n;const r=await this.repo.fetchContentType(e);return r&&this.presenter.setContentTypeCache(e,r),r}getContentTypeFromCache(e){return this.presenter.getContentTypeFromCache(e)??null}addDetailRecipe(e,n){this.presenter.updateEditingRecipe(r=>{const s=r.contentTypes[e]??{details:[],lists:[]};return{...r,contentTypes:{...r.contentTypes,[e]:{...s,details:[...s.details??[],n]}}}})}addListRecipe(e,n){this.presenter.updateEditingRecipe(r=>{const s=r.contentTypes[e]??{details:[],lists:[]};return{...r,contentTypes:{...r.contentTypes,[e]:{...s,lists:[...s.lists??[],n]}}}})}addStaticRecipe(e){this.presenter.updateEditingRecipe(n=>({...n,staticPages:[...n.staticPages??[],e]}))}updateCurrentRecipe(e){const{selection:n}=this.presenter.getState();n&&this.presenter.updateEditingRecipe(r=>{if(n.type==="contentType"){const s=r.contentTypes[n.contentTypeId];if(!s)return r;if(n.recipeType==="detail"){const i=[...s.details??[]];return i[n.index]&&(i[n.index]=e(i[n.index])),{...r,contentTypes:{...r.contentTypes,[n.contentTypeId]:{...s,details:i}}}}else{const i=[...s.lists??[]];return i[n.index]&&(i[n.index]=e(i[n.index])),{...r,contentTypes:{...r.contentTypes,[n.contentTypeId]:{...s,lists:i}}}}}else if(n.type==="staticPage"){const s=[...r.staticPages??[]];return s[n.index]&&(s[n.index]=e(s[n.index])),{...r,staticPages:s}}return r})}deleteCurrentRecipe(){const{selection:e}=this.presenter.getState();e&&(this.presenter.updateEditingRecipe(n=>{var r,s,i;if(e.type==="contentType"){const l=n.contentTypes[e.contentTypeId];if(!l)return n;if(e.recipeType==="detail"){const u=(r=l.details)==null?void 0:r.filter((p,f)=>f!==e.index);return{...n,contentTypes:{...n.contentTypes,[e.contentTypeId]:{...l,details:u}}}}else{const u=(s=l.lists)==null?void 0:s.filter((p,f)=>f!==e.index);return{...n,contentTypes:{...n.contentTypes,[e.contentTypeId]:{...l,lists:u}}}}}else if(e.type==="staticPage"){const l=(i=n.staticPages)==null?void 0:i.filter((u,p)=>p!==e.index);return{...n,staticPages:l}}return n}),this.presenter.setSelection(null),this.presenter.closeDeleteRecipeDialog())}updateTemplateIncludes(e){this.presenter.updateEditingRecipe(n=>({...n,templateIncludes:e}))}async save(){var n;const{editingRecipe:e}=this.presenter.getState();if(e)try{const r={...e,lastUpdatedAt:new Date().toISOString(),lastUpdatedBy:this.username};await this.repo.saveRecipe(r),this.presenter.setEditingRecipe(r),(n=this.unsavedGuard)==null||n.setJustSaved(),this.presenter.setMessage({type:"success",text:"レシピを保存しました"})}catch(r){this.presenter.setMessage({type:"error",text:`保存に失敗しました: ${r instanceof Error?r.message:String(r)}`})}}generateDependencyMap(){const{editingRecipe:e}=this.presenter.getState();return e?this.repo.generateDependencyMap(e):{}}async saveDependencyMap(){const e=this.generateDependencyMap();try{await this.repo.saveDependencyMap(e),this.presenter.setMessage({type:"success",text:"依存マップを生成しました"}),this.presenter.closeGenerateDependencyMapDialog()}catch(n){this.presenter.setMessage({type:"error",text:`依存マップの生成に失敗しました: ${n instanceof Error?n.message:String(n)}`})}}openAddRecipeDialog(e){this.presenter.openAddRecipeDialog(e)}closeAddRecipeDialog(){this.presenter.closeAddRecipeDialog()}openDeleteRecipeDialog(){this.presenter.openDeleteRecipeDialog()}closeDeleteRecipeDialog(){this.presenter.closeDeleteRecipeDialog()}openPreviewDialog(){this.presenter.openPreviewDialog()}closePreviewDialog(){this.presenter.closePreviewDialog()}openGenerateDependencyMapDialog(){this.presenter.openGenerateDependencyMapDialog()}closeGenerateDependencyMapDialog(){this.presenter.closeGenerateDependencyMapDialog()}clearMessage(){this.presenter.clearMessage()}toggleContentTypeExpand(e){this.presenter.toggleContentTypeExpand(e)}requestTabSwitch(e){const n=this.presenter.getState(),{editorMode:r,jsonIsDirty:s,editingRecipe:i}=n;if(r===e)return;const l=this.repo.getRecipe(),u=i!==null&&l!==null?JSON.stringify(i)!==JSON.stringify(l):!1;(r==="json"?s:u)?this.presenter.openTabSwitchDialog(e):this.switchTab(e)}switchTab(e){const n=this.presenter.getState(),{editorMode:r,editingRecipe:s}=n;if(e==="json"&&r==="ui"){if(s){const i=JSON.stringify(s,null,2);this.presenter.setJsonEditText(i),this.presenter.setJsonIsDirty(!1)}}else if(e==="ui"&&r==="json"){const{jsonEditText:i}=n,l=Na(i);if(!l.success){this.presenter.setMessage({type:"error",text:`JSONの構文エラー: ${l.error}`});return}const u=dA(l.data);if(!u.success){this.presenter.setMessage({type:"error",text:`バリデーションエラー:
|
|
497
|
+
${iw(u.errors)}`});return}this.presenter.setEditingRecipe(u.data),this.presenter.setJsonIsDirty(!1)}this.presenter.setEditorMode(e),this.presenter.closeTabSwitchDialog()}discardAndSwitchTab(){const{pendingTabSwitch:e,editorMode:n}=this.presenter.getState();e&&(n==="json"&&this.presenter.setJsonIsDirty(!1),this.switchTab(e))}async saveAndSwitchTab(){const{pendingTabSwitch:e,editorMode:n}=this.presenter.getState();if(e){if(n==="json"){if(!await this.saveFromJson())return}else await this.save();this.switchTab(e)}}cancelTabSwitch(){this.presenter.closeTabSwitchDialog()}updateJsonText(e){this.presenter.setJsonEditText(e),this.presenter.setJsonIsDirty(!0)}async saveFromJson(){var i;const{jsonEditText:e}=this.presenter.getState(),n=Na(e);if(!n.success)return this.presenter.setMessage({type:"error",text:`JSONの構文エラー: ${n.error}`}),!1;const r=dA(n.data);if(!r.success)return this.presenter.setMessage({type:"error",text:`バリデーションエラー:
|
|
498
|
+
${iw(r.errors)}`}),!1;const s={...r.data,lastUpdatedAt:new Date().toISOString(),lastUpdatedBy:this.username};try{return await this.repo.saveRecipe(s),this.presenter.setEditingRecipe(s),this.presenter.setJsonIsDirty(!1),(i=this.unsavedGuard)==null||i.setJustSaved(),this.presenter.setMessage({type:"success",text:"レシピを保存しました"}),!0}catch(l){return this.presenter.setMessage({type:"error",text:`保存に失敗しました: ${l instanceof Error?l.message:String(l)}`}),!1}}formatJson(){const{jsonEditText:e}=this.presenter.getState();try{const n=JSON.parse(e),r=JSON.stringify(n,null,2);this.presenter.setJsonEditText(r)}catch{this.presenter.setMessage({type:"error",text:"JSONのフォーマットに失敗しました(構文エラー)"})}}resetJson(){const{editingRecipe:e}=this.presenter.getState();if(e){const n=JSON.stringify(e,null,2);this.presenter.setJsonEditText(n),this.presenter.setJsonIsDirty(!1),this.presenter.setMessage({type:"info",text:"JSONを編集中のレシピから再生成しました"})}}prepareJsonForMode(e){const{editingRecipe:n,jsonEditText:r}=this.presenter.getState();if(e==="json"&&!r&&n){const s=JSON.stringify(n,null,2);this.presenter.setJsonEditText(s),this.presenter.setJsonIsDirty(!1)}this.presenter.setEditorMode(e)}subscribe(e){return this.presenter.subscribe(e)}getSnapshot(){const e=this.presenter.getState(),n=Array.from(e.contentTypeCache.entries());return JSON.stringify({editingRecipe:e.editingRecipe,selection:e.selection,contentTypeCacheEntries:n,expandedContentTypeIds:Array.from(e.expandedContentTypes),addRecipeDialogOpen:e.addRecipeDialogOpen,addRecipeTargetContentTypeId:e.addRecipeTargetContentTypeId,deleteRecipeDialogOpen:e.deleteRecipeDialogOpen,previewDialogOpen:e.previewDialogOpen,generateDependencyMapDialogOpen:e.generateDependencyMapDialogOpen,message:e.message})}}function eae(){const{authUseCase:t}=rr(),{branchUseCase:e}=Ei(),{dashboardUseCase:n}=LP(),{token:r,githubUser:s}=t.getState(),i=(e==null?void 0:e.getCurrentBranch())??"develop",l=(s==null?void 0:s.login)??"unknown",u=ys(),p=Di({from:"/build-recipes/"}),f=ur({from:"/build-recipes/"}),m=n.getState().contentTypes;b.useSyncExternalStore(Fi.subscribe.bind(Fi),()=>JSON.stringify(Fi.getState()));const g=jn(Nf.RecipeQueryParams(r,i,l)),y=jn(Nf.TemplateFilesQueryParams(r,i)),v=Pn(Nf.SaveRecipeMutationParams(u,r,i)),C=Pn(Nf.SaveDependencyMapMutationParams(u,r,i)),S=new Nf(r,i,g,y,m,v,C,u),j=P=>{f({search:P,replace:!1})},D=Fi.getState(),M=g.data,T=D.editingRecipe,E=T!==null&&M!==null?JSON.stringify(T)!==JSON.stringify(M):!1,k=Um({isDirty:E}),A=new Xoe(S,Fi,l,j,k),O=b.useRef(!1);b.useEffect(()=>{S.getRecipe()&&(O.current||(A.initializeRecipe(),O.current=!0))},[g.data]);const I=b.useRef(i);b.useEffect(()=>{I.current!==i&&(O.current=!1,Fi.setEditingRecipe(null),Fi.setSelection(null),Fi.setJsonEditText(""),Fi.setJsonIsDirty(!1),I.current=i)},[i]);const $=b.useRef(p);b.useEffect(()=>{const P=JO(p),z=Fi.getState().selection;JSON.stringify($.current)!==JSON.stringify(p)&&(ioe(P,z)||Fi.setSelection(P),$.current=p)},[p]);const R=b.useRef(!1);return b.useEffect(()=>{if(R.current)return;const P=JO(p);P&&Fi.setSelection(P),R.current=!0},[]),{buildRecipeEditUseCase:A}}const tae=["ui","json"],nae=Ss("/build-recipes/")({component:sae,validateSearch:t=>({ct:typeof t.ct=="string"?t.ct:void 0,type:t.type==="detail"||t.type==="list"?t.type:void 0,idx:typeof t.idx=="number"?t.idx:typeof t.idx=="string"?parseInt(t.idx):void 0,static:typeof t.static=="number"?t.static:typeof t.static=="string"?parseInt(t.static):void 0,parts:typeof t.parts=="number"?t.parts:typeof t.parts=="string"?parseInt(t.parts):void 0,mode:tae.includes(t.mode)?t.mode:void 0})}),rae=[{label:"UI編集",value:"ui"},{label:"JSON編集",value:"json"}];function sae(){const t=ur(),e=Di({from:"/build-recipes/"}),n=e.mode??"ui",{authUseCase:r}=rr(),{currentUser:s}=r.getState(),i=ws(s,"canViewBuildRecipes"),l=ws(s,"canEditBuildRecipes"),{buildRecipeEditUseCase:u}=eae();if(b.useEffect(()=>{s&&!i&&t({to:"/"})},[s,i,t]),!i)return null;const f={value:n,options:rae,onChange:m=>{t({to:".",search:{...e,mode:m==="ui"?void 0:m},replace:!0})}};return a.jsxs(B,{"data-component-name":"cmp:RecipesPage",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[a.jsx(B,{sx:{px:3,pt:2,flexShrink:0},children:a.jsx(no,{items:[{label:"ビルドデータレシピ編集"}],dropdown:f})}),a.jsx(Jie,{useCase:u,editorMode:n,canEdit:l})]})}function iae(){return Fs(t=>({error:null,isProcessing:!0,setError:e=>t({error:e,isProcessing:!1}),setProcessing:e=>t({isProcessing:e}),reset:()=>t({error:null,isProcessing:!0})}))}class oae{constructor(){St(this,"store",iae());St(this,"cachedState",null);St(this,"cachedStoreState",null)}getState(){const e=this.store.getState();return this.cachedStoreState===e&&this.cachedState!==null?this.cachedState:(this.cachedStoreState=e,this.cachedState={error:e.error,isProcessing:e.isProcessing},this.cachedState)}setError(e){this.store.getState().setError(e)}setProcessing(e){this.store.getState().setProcessing(e)}subscribe(e){return this.store.subscribe(e)}}class aae{constructor(e){this.deps=e}getState(){return this.deps.presenter.getState()}navigateToLogin(){this.deps.navigate("/login")}async handleCallback(e){const{presenter:n,login:r,navigate:s}=this.deps,i=e.get("token");let l;if(i)l=i;else{const u=e.get("code");if(!u){n.setError("認証コードが見つかりません。");return}try{const p=await fetch(`/api/auth/callback?code=${u}`),f=await p.json();if(!p.ok||!f.access_token){n.setError(f.error_description||"トークンの取得に失敗しました。");return}l=f.access_token}catch{n.setError("トークンの取得に失敗しました。");return}}try{oe.debug("AuthCallbackUseCase","Logging in..."),await r(l),oe.info("AuthCallbackUseCase","Login success"),s("/")}catch(u){oe.error("AuthCallbackUseCase","Error during login",{error:u});const p=u.message;p.includes("not authorized")?n.setError("このユーザーは管理画面へのアクセス権がありません。管理者に連絡してください。"):p.includes("admin data: 403")||p.includes("Failed to fetch users index")?n.setError(`コンテンツリポジトリへのアクセスが拒否されました(403)。
|
|
499
|
+
|
|
500
|
+
GitHub OAuth App に組織へのアクセス権を付与してください:
|
|
501
|
+
1. https://github.com/settings/applications を開く
|
|
502
|
+
2. この OAuth App をクリック
|
|
503
|
+
3. 「Organization access」で対象の組織の「Grant」をクリック`):n.setError(`ログイン処理中にエラーが発生しました: ${p}`)}}}const lae=new oae;function cae(){const t=ur(),{authUseCase:e}=rr(),n=new aae({presenter:lae,login:s=>e.login(s),navigate:s=>t({to:s})}),r=b.useRef(!1);return b.useEffect(()=>{if(r.current)return;r.current=!0;const s=new URLSearchParams(window.location.search);n.handleCallback(s)},[n]),{authCallbackUseCase:n}}const uae=Ss("/auth/callback")({component:dae});function dae(){const{authCallbackUseCase:t}=cae(),{error:e}=t.getState();return e?a.jsx(ji,{"data-component-name":"cmp:AuthCallbackPage",maxWidth:"sm",children:a.jsx(B,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",children:a.jsxs(zt,{"data-component-name":"cmp:AuthCallbackError",severity:"error",sx:{width:"100%"},action:a.jsx(pe,{color:"inherit",size:"small",onClick:()=>t.navigateToLogin(),children:"ログインに戻る"}),children:[a.jsx(G,{variant:"subtitle1",gutterBottom:!0,children:"ログインエラー"}),a.jsx(G,{variant:"body2",sx:{whiteSpace:"pre-line"},children:e})]})})}):a.jsxs(B,{"data-component-name":"cmp:AuthCallbackLoading",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",children:[a.jsx(ut,{}),a.jsx(G,{sx:{mt:2},children:"ログイン中..."})]})}class mo{constructor(e,n,r){this.queries=e,this.rebuildMutation=n,this.searchMutation=r}static ContentTypeQueryParams(e,n,r){return{queryKey:["content-type",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).fetchJson(Kl(n),r)},enabled:!!e}}static UiQueryParams(e,n,r){return{queryKey:["content-type-ui",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).fetchJson(Ld(n),r)},enabled:!!e}}static ViewsQueryParams(e,n,r){return{queryKey:["content-type-views",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).fetchJsonOrDefault(sc(n),null,r)},enabled:!!e}}static ViewIndexQueryParams(e,n,r,s,i,l){const u=Ql(r,n,s,i);return{queryKey:["view-index",r,n,u,l],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).fetchJsonOrDefault(u,[],l)},enabled:!!e}}static RebuildIndexMutationParams(e,n,r,s){return{mutationFn:async()=>{if(!n)throw new Error("Not authenticated");const i=new At(n);oe.info("RebuildIndex: start",{contentTypeId:r,branch:s});const l=await i.fetchJsonOrDefault(sc(r),null,s),[u,p]=await Promise.all([mo.loadAllContents(i,"published",r,s),mo.loadAllContents(i,"private",r,s)]),f=[],m=(l==null?void 0:l.views)??[];for(const g of m){const y=Ql("published",r,g.id,(l==null?void 0:l.defaultViewId)??null),v=u.map(C=>DC(C,g.columns));f.push({path:y,content:JSON.stringify(v,null,2)})}for(const g of m){const y=Ql("private",r,g.id,(l==null?void 0:l.defaultViewId)??null),v=p.map(C=>DC(C,g.columns));f.push({path:y,content:JSON.stringify(v,null,2)})}if(m.length===0){const g=u.map(S=>({contentId:S.contentId,status:S.status,createdAt:S.createdAt,updatedAt:S.updatedAt,title:S.title,publishedAt:S.publishedAt,createdBy:S.createdBy,updatedBy:S.updatedBy})),y=p.map(S=>({contentId:S.contentId,status:S.status,createdAt:S.createdAt,updatedAt:S.updatedAt,title:S.title,publishedAt:S.publishedAt,createdBy:S.createdBy,updatedBy:S.updatedBy})),v=Ah("published",r),C=Ah("private",r);(g.length>0||await i.fetchFileOrNull(v,s))&&f.push({path:v,content:JSON.stringify(g,null,2)}),(y.length>0||await i.fetchFileOrNull(C,s))&&f.push({path:C,content:JSON.stringify(y,null,2)})}return f.length>0&&await i.commitFiles(`chore: インデックスを再生成 (${r})`,f,s),oe.info("RebuildIndex: done",{contentTypeId:r,contentsCount:u.length,privateCount:p.length,viewCount:m.length}),{contentsCount:u.length,privateCount:p.length}},onSuccess:()=>{e.invalidateQueries({queryKey:["view-index","published",r]}),e.invalidateQueries({queryKey:["view-index","private",r]})}}}static async loadAllContents(e,n,r,s){var p;const i=QK(n,r),l=await e.listDirectory(i,s),u=[];for(const f of l){const m=`${i}/${f}`,g=f.replace(".json","");try{const y=await e.fetchJson(m,s),v=new Date().toISOString(),C=y.createdBy??"unknown";u.push({contentId:y.contentId??g,title:y.title??((p=y.data)==null?void 0:p.title)??g,status:y.status??(n==="published"?"published":"draft"),createdAt:y.createdAt??v,updatedAt:y.updatedAt??v,publishedAt:y.publishedAt??null,createdBy:C,updatedBy:y.updatedBy??C,data:y.data??{}})}catch(y){oe.warn("RebuildIndex: failed to read file",{filePath:m,error:y})}}return u}static SearchCodeMutationParams(e,n){return{mutationFn:async r=>{if(!e)throw new Error("Not authenticated");return(await new At(e).searchCode(r,"data/contents")).items.filter(u=>{const p=u.path.split("/");return p.length>=4&&p[3]===n}).map(u=>u.name.replace(".json","")).filter(u=>!u.startsWith("_"))}}}getContentType(){return this.queries.contentType.data}getContentTypeLabel(){var e;return(e=this.queries.ui.data)==null?void 0:e.label}getUi(){return this.queries.ui.data}getViews(){return this.queries.views.data}getPublishedIndex(){return this.queries.publishedIndex.data??[]}getPrivateIndex(){return this.queries.privateIndex.data??[]}isLoading(){return this.queries.contentType.isLoading||this.queries.ui.isLoading||this.queries.views.isLoading||this.queries.publishedIndex.isLoading||this.queries.privateIndex.isLoading}getError(){return this.queries.contentType.error||this.queries.ui.error||this.queries.views.error||this.queries.publishedIndex.error||this.queries.privateIndex.error}isRebuilding(){var e;return((e=this.rebuildMutation)==null?void 0:e.isPending)??!1}async rebuildIndex(){if(!this.rebuildMutation)throw new Error("Rebuild mutation not initialized");return this.rebuildMutation.mutateAsync()}async searchGitHub(e){if(!this.searchMutation)throw new Error("Search mutation not initialized");return this.searchMutation.mutateAsync(e)}}function pae(){return Fs(t=>({sortOverride:null,visibilityFilter:"all",searchQuery:"",searchResultIds:null,isSearching:!1,searchError:null,searchMode:fae(),setSortOverride:e=>t({sortOverride:e}),setVisibilityFilter:e=>t({visibilityFilter:e}),setSearchQuery:e=>t({searchQuery:e}),setSearchResultIds:e=>t({searchResultIds:e,isSearching:!1}),setSearchLoading:e=>t({isSearching:e}),setSearchError:e=>t({searchError:e,isSearching:!1}),setSearchMode:e=>t({searchMode:e,searchResultIds:null,searchQuery:"",searchError:null}),clearSearch:()=>t({searchQuery:"",searchResultIds:null,isSearching:!1,searchError:null})}))}function J5(t,e){return`frelio_sort_${t}_${e}`}const Y5="frelio_search_mode";function fae(){try{const t=localStorage.getItem(Y5);if(t==="local"||t==="github")return t}catch{}return"local"}function hae(t){try{localStorage.setItem(Y5,t)}catch{}}function mae(t,e){try{const n=J5(t,e),r=localStorage.getItem(n);if(r){const s=JSON.parse(r);if(s.field&&(s.direction==="asc"||s.direction==="desc"))return s}}catch{}return null}function gae(t,e,n){try{const r=J5(t,e);n?localStorage.setItem(r,JSON.stringify(n)):localStorage.removeItem(r)}catch{}}class yae{constructor(){St(this,"store",pae());St(this,"cachedState",null);St(this,"cachedStoreState",null);St(this,"currentContentTypeId",null);St(this,"currentViewId",null);St(this,"searchCache",new Map);St(this,"lastSearchTime",0)}getState(){const e=this.store.getState();return this.cachedStoreState===e&&this.cachedState!==null?this.cachedState:(this.cachedStoreState=e,this.cachedState={sortOverride:e.sortOverride,visibilityFilter:e.visibilityFilter,searchQuery:e.searchQuery,searchResultIds:e.searchResultIds,isSearching:e.isSearching,searchError:e.searchError,searchMode:e.searchMode},this.cachedState)}initializeSort(e,n,r){if(this.currentContentTypeId=e,this.currentViewId=n,r)this.store.getState().setSortOverride(r);else{const s=mae(e,n);this.store.getState().setSortOverride(s)}}setSortOverride(e){this.store.getState().setSortOverride(e),this.currentContentTypeId&&this.currentViewId&&gae(this.currentContentTypeId,this.currentViewId,e)}handleSortClick(e){const n=this.getState().sortOverride;(n==null?void 0:n.field)===e?this.setSortOverride({field:e,direction:n.direction==="asc"?"desc":"asc"}):this.setSortOverride({field:e,direction:"desc"})}resetSort(){this.setSortOverride(null)}setVisibilityFilter(e){this.store.getState().setVisibilityFilter(e)}setSearchQuery(e){this.store.getState().setSearchQuery(e)}setSearchResultIds(e){this.store.getState().setSearchResultIds(e)}setSearchLoading(e){this.store.getState().setSearchLoading(e)}setSearchError(e){this.store.getState().setSearchError(e)}setSearchMode(e){this.store.getState().setSearchMode(e),hae(e)}clearSearch(){this.store.getState().clearSearch()}subscribe(e){return this.store.subscribe(e)}getSearchCache(e,n){var r;return((r=this.searchCache.get(e))==null?void 0:r.get(n))??null}setSearchCache(e,n,r){this.searchCache.has(e)||this.searchCache.set(e,new Map),this.searchCache.get(e).set(n,r)}clearSearchCache(e){this.searchCache.delete(e)}getLastSearchTime(){return this.lastSearchTime}setLastSearchTime(e){this.lastSearchTime=e}}function vae(t,e){return!e||e.length===0?t:t.filter(n=>e.every(r=>{const s=n[r.field];switch(r.operator){case"eq":return s===r.value;case"neq":return s!==r.value;case"in":return r.value.includes(s);case"nin":return!r.value.includes(s);case"contains":return Array.isArray(s)?s.includes(r.value):String(s).includes(String(r.value));case"startsWith":return String(s).startsWith(String(r.value));case"endsWith":return String(s).endsWith(String(r.value));default:return!0}}))}function xae(t,e,n){const r=n??e;return r?[...t].sort((s,i)=>{const l=s[r.field],u=i[r.field];if(l==null&&u==null)return 0;if(l==null)return 1;if(u==null)return-1;if(typeof l=="string"&&typeof u=="string"){const p=l.localeCompare(u);return r.direction==="asc"?p:-p}return typeof l=="number"&&typeof u=="number"?r.direction==="asc"?l-u:u-l:0}):t}function bae(t,e,n,r){const s=vae(t,e);return xae(s,n,r)}const Sae=bae,pA=6e3;class Cae{constructor(e){this.deps=e}getState(){const{repo:e,presenter:n,searchView:r}=this.deps,s=n.getState(),i=e.getViews(),l=r??(i==null?void 0:i.defaultViewId)??"all",u=(i==null?void 0:i.views.find(T=>T.id===l))??(i==null?void 0:i.views[0]),p=[{field:"title",label:"タイトル"},{field:"updatedAt",label:"更新日",width:"150px"},{field:"publishedAt",label:"公開日",width:"150px"}],f=[{field:"createdAt",label:"作成日",width:"150px"},{field:"status",label:"状態",width:"100px"}],m=(u==null?void 0:u.columns)??p,g=new Set(m.map(T=>T.field)),y=f.filter(T=>!g.has(T.field)),v=[...m,...y],C=(u==null?void 0:u.defaultSort)??{field:"createdAt",direction:"desc"},S=e.getPublishedIndex(),j=e.getPrivateIndex();let D;switch(s.visibilityFilter){case"public":D=S;break;case"private":const T=new Set(S.map(A=>A.contentId));D=j.filter(A=>!T.has(A.contentId));break;case"all":default:const E=new Set(S.map(A=>A.contentId)),k=j.filter(A=>!E.has(A.contentId));D=[...S,...k];break}let M=Sae(D,(u==null?void 0:u.filters)??[],(u==null?void 0:u.defaultSort)??C,s.sortOverride);if(s.searchResultIds!==null){const T=new Set(s.searchResultIds);M=M.filter(E=>T.has(E.contentId))}return{contentType:e.getContentType(),contentTypeLabel:e.getContentTypeLabel(),viewsDef:i,selectedViewId:l,activeView:u,columns:v,defaultSort:C,filteredEntries:M,allEntries:D,sortOverride:s.sortOverride,visibilityFilter:s.visibilityFilter,isLoading:e.isLoading(),error:e.getError(),isRebuilding:e.isRebuilding(),searchQuery:s.searchQuery,isSearching:s.isSearching,searchError:s.searchError,searchMode:s.searchMode}}changeView(e){const{presenter:n,contentTypeId:r,navigate:s}=this.deps;n.resetSort(),s("/contents/$contentTypeId",{contentTypeId:r},{view:e})}setVisibilityFilter(e){this.deps.presenter.setVisibilityFilter(e)}handleSortClick(e){const{presenter:n,contentTypeId:r,navigate:s,searchView:i}=this.deps,l=n.getState().sortOverride,u=(l==null?void 0:l.field)===e?{field:e,direction:l.direction==="asc"?"desc":"asc"}:{field:e,direction:"desc"};n.handleSortClick(e);const p={};i&&(p.view=i),p.sort=u.field,p.order=u.direction,s("/contents/$contentTypeId",{contentTypeId:r},p)}async rebuildIndex(){await this.deps.repo.rebuildIndex()}setSearchQuery(e){this.deps.presenter.setSearchQuery(e)}setSearchLoading(e){this.deps.presenter.setSearchLoading(e)}setSearchResultIds(e){this.deps.presenter.setSearchResultIds(e)}setSearchError(e){this.deps.presenter.setSearchError(e)}setSearchMode(e){this.deps.presenter.setSearchMode(e)}clearSearch(){this.deps.presenter.clearSearch()}async search(e){const{presenter:n}=this.deps;if(!e.trim()){this.clearSearch();return}this.setSearchQuery(e),n.getState().searchMode==="local"?this.searchLocal(e):await this.searchGitHub(e)}searchLocal(e){const n=e.toLowerCase(),s=this.getState().allEntries.filter(i=>i.title&&String(i.title).toLowerCase().includes(n)||i.contentId.toLowerCase().includes(n)?!0:Object.values(i).some(l=>l==null?!1:typeof l=="string"?l.toLowerCase().includes(n):Array.isArray(l)?l.some(u=>String(u).toLowerCase().includes(n)):String(l).toLowerCase().includes(n))).map(i=>i.contentId);this.setSearchResultIds(s)}async searchGitHub(e){const{repo:n,presenter:r,contentTypeId:s}=this.deps,i=r.getSearchCache(s,e);if(i){this.setSearchResultIds(i);return}const l=Date.now(),u=r.getLastSearchTime(),p=l-u;if(p<pA){const f=Math.ceil((pA-p)/1e3);this.setSearchError(`レート制限中です。${f}秒後にお試しください。`);return}this.setSearchLoading(!0);try{r.setLastSearchTime(Date.now());const f=await n.searchGitHub(e);r.setSearchCache(s,e,f),this.setSearchResultIds(f)}catch(f){this.setSearchError(f instanceof Error?f.message:"検索に失敗しました")}}onContentTypeChange(){const{presenter:e,contentTypeId:n}=this.deps;e.clearSearchCache(n),this.clearSearch()}}const Jv=new yae;function wae(){return b.useSyncExternalStore(t=>Jv.subscribe(t),()=>Jv.getState())}function jae(){var A;const{authUseCase:t}=rr(),{branchUseCase:e}=Ei(),{token:n}=t.getState(),r=(e==null?void 0:e.getCurrentBranch())??"develop",s=ur(),i=ys(),{contentTypeId:l}=uc({from:"/contents/$contentTypeId/"}),u=Di({from:"/contents/$contentTypeId/"}),p=u.view,f=u.sort,m=u.order;wae();const g=jn(mo.ViewsQueryParams(n,l,r)),y=g.isSuccess||g.data!==void 0,v=((A=g.data)==null?void 0:A.defaultViewId)??null,C=p??v??"default",S=b.useRef(null);b.useEffect(()=>{const O=`${l}_${C}`;if(S.current!==O){S.current=O;const I=f&&m?{field:f,direction:m}:null;Jv.initializeSort(l,C,I)}},[l,C,f,m]);const j=Pn(mo.RebuildIndexMutationParams(i,n,l,r)),D=Pn(mo.SearchCodeMutationParams(n,l)),M=mo.ViewIndexQueryParams(n,l,"published",C,v,r),T=mo.ViewIndexQueryParams(n,l,"private",C,v,r),E=new mo({contentType:jn(mo.ContentTypeQueryParams(n,l,r)),ui:jn(mo.UiQueryParams(n,l,r)),views:g,publishedIndex:jn({...M,enabled:M.enabled&&y}),privateIndex:jn({...T,enabled:T.enabled&&y})},j,D),k=new Cae({repo:E,presenter:Jv,contentTypeId:l,searchView:p,navigate:(O,I,$)=>s({to:O,params:I,search:$})});return b.useEffect(()=>{k.onContentTypeChange()},[l]),{contentListUseCase:k}}const X5=Ss("/contents/$contentTypeId/")({component:Tae,validateSearch:t=>({view:typeof t.view=="string"?t.view:void 0,sort:typeof t.sort=="string"?t.sort:void 0,order:t.order==="asc"||t.order==="desc"?t.order:void 0})});function e4({field:t,value:e}){if(t==="status")return a.jsx(n4,{status:e});if(t==="publishedAt"||t==="updatedAt"||t==="createdAt")return a.jsx(a.Fragment,{children:e?cte(e):"—"});if(t==="tags"&&Array.isArray(e))return a.jsxs(Ro,{direction:"row",spacing:.5,flexWrap:"wrap",useFlexGap:!0,children:[e.slice(0,3).map(n=>a.jsx(Ht,{label:n,size:"small",variant:"outlined"},String(n))),e.length>3&&a.jsx(Ht,{label:`+${e.length-3}`,size:"small",variant:"outlined"})]});if(e&&typeof e=="object"&&"url"in e){const n=e;return n.url?a.jsx(B,{component:"img",src:n5(n.url),alt:n.originalName??"",sx:{maxWidth:150,maxHeight:80,objectFit:"cover",borderRadius:1}}):a.jsx(a.Fragment,{children:"—"})}return e&&typeof e=="object"?a.jsx(a.Fragment,{children:"—"}):a.jsx(a.Fragment,{children:e??"—"})}function Tae(){const t=vr(),e=aa(t.breakpoints.down("md")),{contentListUseCase:n}=jae(),r=n.getState(),{contentType:s,contentTypeLabel:i,viewsDef:l,selectedViewId:u,activeView:p,columns:f,defaultSort:m,filteredEntries:g,sortOverride:y,visibilityFilter:v,isLoading:C,error:S,isRebuilding:j,searchQuery:D,isSearching:M,searchError:T,searchMode:E}=r,{contentTypeId:k}=X5.useParams();return C?a.jsx(B,{"data-component-name":"cmp:ContentListPageLoading",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})}):S?a.jsx(B,{"data-component-name":"cmp:ContentListPageError",sx:{flex:1,overflow:"auto",p:3},children:a.jsxs(zt,{severity:"error",children:["Error: ",S.message]})}):a.jsxs(B,{"data-component-name":"cmp:ContentListPage",sx:{flex:1,overflow:"auto"},children:[a.jsx(Mx,{"data-component-name":"cmp:RebuildingBackdrop",open:j,sx:{color:"#fff",zIndex:A=>A.zIndex.drawer+1},children:a.jsxs(B,{display:"flex",flexDirection:"column",alignItems:"center",gap:2,children:[a.jsx(ut,{color:"inherit"}),a.jsx(G,{children:"インデックスを再生成中..."})]})}),a.jsxs(B,{sx:{p:3},children:[a.jsx(no,{items:[{label:`${i??k}一覧`}]}),a.jsx(la,{title:`${i??k} 一覧`,actions:a.jsx(pe,{variant:"contained",startIcon:a.jsx(Qn,{}),component:gs,to:`/contents/${k}/new`,children:"新規作成"})}),a.jsxs(B,{"data-component-name":"cmp:ContentListToolbar",display:"flex",alignItems:"center",gap:2,mb:2,flexWrap:"wrap",children:[a.jsx(Dae,{searchQuery:D,isSearching:M,searchError:T,searchMode:E,onSearch:A=>n.search(A),onClear:()=>n.clearSearch(),onModeChange:A=>n.setSearchMode(A)}),a.jsx(Eae,{value:v,onChange:A=>n.setVisibilityFilter(A)}),l&&l.views.length>1&&a.jsx(yc,{value:u,exclusive:!0,onChange:(A,O)=>O&&n.changeView(O),size:"small",children:l.views.map(A=>a.jsx(ts,{value:A.id,children:A.label},A.id))}),a.jsx(Rae,{isRebuilding:j,onRebuild:()=>n.rebuildIndex()})]}),g.length===0?a.jsx(zt,{severity:"info",children:"表示できるコンテンツがありません"}):e?a.jsx(kae,{entries:g,contentTypeId:k,columns:f}):a.jsx(Mae,{entries:g,contentTypeId:k,columns:f,sortOverride:y,defaultSort:(p==null?void 0:p.defaultSort)??m,onSortClick:A=>n.handleSortClick(A)})]})]})}function Dae({searchQuery:t,isSearching:e,searchError:n,searchMode:r,onSearch:s,onClear:i,onModeChange:l}){const[u,p]=b.useState(t),[f,m]=b.useState(null),g=S=>{S.key==="Enter"&&(S.preventDefault(),s(u))},y=()=>{p(""),i()},v=()=>{s(u)},C=S=>{l(S),m(null)};return a.jsxs(B,{display:"flex",alignItems:"flex-start",gap:.5,children:[a.jsx(Xe,{size:"small",placeholder:r==="local"?"インデックス内を検索...":"GitHub全文検索...",value:u,onChange:S=>p(S.target.value),onKeyDown:g,sx:{minWidth:220},InputProps:{endAdornment:a.jsxs(c2,{position:"end",children:[u&&a.jsx(ft,{size:"small",onClick:y,edge:"end",children:a.jsx(SJ,{fontSize:"small"})}),a.jsx(ft,{size:"small",onClick:v,disabled:e,edge:"end",title:"検索",children:e?a.jsx(ut,{size:20}):a.jsx(Om,{})})]})},error:!!n,helperText:n}),a.jsx(ft,{size:"small",onClick:S=>m(S.currentTarget),title:"検索オプション",children:a.jsx(EP,{})}),a.jsxs(Cp,{anchorEl:f,open:!!f,onClose:()=>m(null),children:[a.jsx(nt,{disabled:!0,sx:{opacity:1,fontWeight:"bold",fontSize:"0.75rem",py:.5},children:"検索対象"}),a.jsx(wo,{}),a.jsx(nt,{selected:r==="local",onClick:()=>C("local"),children:a.jsx(Zn,{primary:"ローカル",secondary:"現在のブランチのインデックス"})}),a.jsx(nt,{selected:r==="github",onClick:()=>C("github"),children:a.jsx(Zn,{primary:"GitHub",secondary:"デフォルトブランチの全文検索"})})]})]})}function Eae({value:t,onChange:e}){return a.jsxs(yc,{value:t,exclusive:!0,onChange:(n,r)=>r&&e(r),size:"small",children:[a.jsx(ts,{value:"all",children:"すべて"}),a.jsx(ts,{value:"public",children:"公開"}),a.jsx(ts,{value:"private",children:"非公開"})]})}function Rae({isRebuilding:t,onRebuild:e}){const[n,r]=b.useState(!1),s=()=>{r(!1),e()};return a.jsxs(a.Fragment,{children:[a.jsx(ft,{size:"small",onClick:()=>r(!0),disabled:t,title:"インデックスを再生成",children:t?a.jsx(ut,{size:20}):a.jsx(kP,{})}),a.jsxs(Qt,{"data-component-name":"cmp:RebuildIndexDialog",open:n,onClose:()=>r(!1),children:[a.jsx(Yt,{children:"インデックスの再生成"}),a.jsx(Jt,{children:a.jsx(Eo,{children:"ビューのインデックスを再生成しますか?"})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>r(!1),children:"キャンセル"}),a.jsx(pe,{onClick:s,variant:"contained",autoFocus:!0,children:"再生成"})]})]})]})}function t4({contentTypeId:t,contentId:e}){const n=ur(),[r,s]=b.useState(null),i=()=>{s(null),n({to:`/contents/${t}/new`,search:{duplicateFrom:e}})};return a.jsxs(a.Fragment,{children:[a.jsx(ft,{"data-component-name":"cmp:RowActionMenuButton",size:"small",onClick:l=>{l.stopPropagation(),s(l.currentTarget)},children:a.jsx(EP,{fontSize:"small"})}),a.jsx(Cp,{"data-component-name":"cmp:RowActionMenu",anchorEl:r,open:!!r,onClose:()=>s(null),children:a.jsxs(nt,{onClick:i,children:[a.jsx(bP,{fontSize:"small",sx:{mr:1}}),a.jsx(Zn,{children:"複製"})]})})]})}function kae({entries:t,contentTypeId:e,columns:n}){return a.jsx(Ro,{"data-component-name":"cmp:MobileList",spacing:2,children:t.map(r=>a.jsx(Su,{"data-component-name":"cmp:ContentCard",children:a.jsxs(B,{display:"flex",alignItems:"stretch",children:[a.jsx(_I,{component:gs,to:`/contents/${e}/${r.contentId}`,sx:{flex:1},children:a.jsxs(Sp,{children:[a.jsxs(B,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1,children:[a.jsx(G,{variant:"subtitle1",fontWeight:"bold",noWrap:!0,sx:{flex:1,mr:1},children:r.title??r.contentId}),a.jsx(n4,{status:r.status})]}),n.filter(s=>s.field!=="title"&&s.field!=="status").slice(0,2).map(s=>a.jsxs(G,{variant:"body2",color:"text.secondary",children:[s.label,": ",a.jsx(e4,{field:s.field,value:r[s.field]})]},`${r.contentId}-${s.field}`))]})}),a.jsx(B,{display:"flex",alignItems:"center",px:.5,children:a.jsx(t4,{contentTypeId:e,contentId:r.contentId})})]})},r.contentId))})}function Mae({entries:t,contentTypeId:e,columns:n,sortOverride:r,defaultSort:s,onSortClick:i}){const l=ur(),u=r??s;return a.jsx($t,{"data-component-name":"cmp:DesktopTable",children:a.jsxs(wp,{children:[a.jsx(jm,{children:a.jsxs(eo,{children:[n.map(p=>a.jsx(Kt,{width:p.width,children:p.sortable!==!1?a.jsx(gK,{active:u.field===p.field,direction:u.field===p.field?u.direction:"desc",onClick:()=>i(p.field),children:p.label}):p.label},p.field)),a.jsx(Kt,{width:48},"__actions")]})}),a.jsx(jp,{children:t.map(p=>a.jsxs(eo,{hover:!0,sx:{cursor:"pointer"},onClick:()=>l({to:`/contents/${e}/${p.contentId}`}),children:[n.map(f=>a.jsx(Kt,{children:a.jsx(e4,{field:f.field,value:p[f.field]})},f.field)),a.jsx(Kt,{onClick:f=>f.stopPropagation(),children:a.jsx(t4,{contentTypeId:e,contentId:p.contentId})},"__actions")]},p.contentId))})]})})}function n4({status:t}){const e=()=>{switch(t){case"published":return"公開";case"unpublished":return"非公開";case"draft":default:return"下書き"}},n=()=>{switch(t){case"published":return"success";case"unpublished":return"warning";case"draft":default:return"default"}};return a.jsx(Ht,{label:e(),color:n(),size:"small"})}var Vm=t=>t.type==="checkbox",Kc=t=>t instanceof Date,Js=t=>t==null;const r4=t=>typeof t=="object";var qr=t=>!Js(t)&&!Array.isArray(t)&&r4(t)&&!Kc(t),s4=t=>qr(t)&&t.target?Vm(t.target)?t.target.checked:t.target.value:t,Oae=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,i4=(t,e)=>t.has(Oae(e)),Aae=t=>{const e=t.constructor&&t.constructor.prototype;return qr(e)&&e.hasOwnProperty("isPrototypeOf")},W2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Br(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(W2&&(t instanceof Blob||e))return t;const n=Array.isArray(t);if(!n&&!(qr(t)&&Aae(t)))return t;const r=n?[]:Object.create(Object.getPrototypeOf(t));for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=Br(t[s]));return r}var ob=t=>/^\w*$/.test(t),yr=t=>t===void 0,q2=t=>Array.isArray(t)?t.filter(Boolean):[],G2=t=>q2(t.replace(/["|']|\]/g,"").split(/\.|\[/)),rt=(t,e,n)=>{if(!e||!qr(t))return n;const r=(ob(e)?[e]:G2(e)).reduce((s,i)=>Js(s)?s:s[i],t);return yr(r)||r===t?yr(t[e])?n:t[e]:r},gi=t=>typeof t=="boolean",As=t=>typeof t=="function",Bn=(t,e,n)=>{let r=-1;const s=ob(e)?[e]:G2(e),i=s.length,l=i-1;for(;++r<i;){const u=s[r];let p=n;if(r!==l){const f=t[u];p=qr(f)||Array.isArray(f)?f:isNaN(+s[r+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;t[u]=p,t=t[u]}};const Yv={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ma={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},o4=We.createContext(null);o4.displayName="HookFormControlContext";const Z2=()=>We.useContext(o4);var a4=(t,e,n,r=!0)=>{const s={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(s,i,{get:()=>{const l=i;return e._proxyFormState[l]!==xo.all&&(e._proxyFormState[l]=!r||xo.all),n&&(n[l]=!0),t[l]}});return s};const K2=typeof window<"u"?We.useLayoutEffect:We.useEffect;function _ae(t){const e=Z2(),{control:n=e,disabled:r,name:s,exact:i}=t||{},[l,u]=We.useState(n._formState),p=We.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return K2(()=>n._subscribe({name:s,formState:p.current,exact:i,callback:f=>{!r&&u({...n._formState,...f})}}),[s,r,i]),We.useEffect(()=>{p.current.isValid&&n._setValid(!0)},[n]),We.useMemo(()=>a4(l,n,p.current,!1),[l,n])}var vi=t=>typeof t=="string",ow=(t,e,n,r,s)=>vi(t)?(r&&e.watch.add(t),rt(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),rt(n,i))):(r&&(e.watchAll=!0),n),aw=t=>Js(t)||!r4(t);function bo(t,e,n=new WeakSet){if(aw(t)||aw(e))return Object.is(t,e);if(Kc(t)&&Kc(e))return Object.is(t.getTime(),e.getTime());const r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;if(n.has(t)||n.has(e))return!0;n.add(t),n.add(e);for(const i of r){const l=t[i];if(!s.includes(i))return!1;if(i!=="ref"){const u=e[i];if(Kc(l)&&Kc(u)||qr(l)&&qr(u)||Array.isArray(l)&&Array.isArray(u)?!bo(l,u,n):!Object.is(l,u))return!1}}return!0}function Iae(t){const e=Z2(),{control:n=e,name:r,defaultValue:s,disabled:i,exact:l,compute:u}=t||{},p=We.useRef(s),f=We.useRef(u),m=We.useRef(void 0),g=We.useRef(n),y=We.useRef(r);f.current=u;const[v,C]=We.useState(()=>{const E=n._getWatch(r,p.current);return f.current?f.current(E):E}),S=We.useCallback(E=>{const k=ow(r,n._names,E||n._formValues,!1,p.current);return f.current?f.current(k):k},[n._formValues,n._names,r]),j=We.useCallback(E=>{if(!i){const k=ow(r,n._names,E||n._formValues,!1,p.current);if(f.current){const A=f.current(k);bo(A,m.current)||(C(A),m.current=A)}else C(k)}},[n._formValues,n._names,i,r]);K2(()=>((g.current!==n||!bo(y.current,r))&&(g.current=n,y.current=r,j()),n._subscribe({name:r,formState:{values:!0},exact:l,callback:E=>{j(E.values)}})),[n,l,r,j]),We.useEffect(()=>n._removeUnmounted());const D=g.current!==n,M=y.current,T=We.useMemo(()=>{if(i)return null;const E=!D&&!bo(M,r);return D||E?S():null},[i,D,r,M,S]);return T!==null?T:v}function Pae(t){const e=Z2(),{name:n,disabled:r,control:s=e,shouldUnregister:i,defaultValue:l,exact:u=!0}=t,p=i4(s._names.array,n),f=We.useMemo(()=>rt(s._formValues,n,rt(s._defaultValues,n,l)),[s,n,l]),m=Iae({control:s,name:n,defaultValue:f,exact:u}),g=_ae({control:s,name:n,exact:u}),y=We.useRef(t),v=We.useRef(void 0),C=We.useRef(s.register(n,{...t.rules,value:m,...gi(t.disabled)?{disabled:t.disabled}:{}}));y.current=t;const S=We.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!rt(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!rt(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!rt(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!rt(g.validatingFields,n)},error:{enumerable:!0,get:()=>rt(g.errors,n)}}),[g,n]),j=We.useCallback(E=>C.current.onChange({target:{value:s4(E),name:n},type:Yv.CHANGE}),[n]),D=We.useCallback(()=>C.current.onBlur({target:{value:rt(s._formValues,n),name:n},type:Yv.BLUR}),[n,s._formValues]),M=We.useCallback(E=>{const k=rt(s._fields,n);k&&k._f&&E&&(k._f.ref={focus:()=>As(E.focus)&&E.focus(),select:()=>As(E.select)&&E.select(),setCustomValidity:A=>As(E.setCustomValidity)&&E.setCustomValidity(A),reportValidity:()=>As(E.reportValidity)&&E.reportValidity()})},[s._fields,n]),T=We.useMemo(()=>({name:n,value:m,...gi(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:j,onBlur:D,ref:M}),[n,r,g.disabled,j,D,M,m]);return We.useEffect(()=>{const E=s._options.shouldUnregister||i,k=v.current;k&&k!==n&&!p&&s.unregister(k),s.register(n,{...y.current.rules,...gi(y.current.disabled)?{disabled:y.current.disabled}:{}});const A=(O,I)=>{const $=rt(s._fields,O);$&&$._f&&($._f.mount=I)};if(A(n,!0),E){const O=Br(rt(s._options.defaultValues,n,y.current.defaultValue));Bn(s._defaultValues,n,O),yr(rt(s._formValues,n))&&Bn(s._formValues,n,O)}return!p&&s.register(n),v.current=n,()=>{(p?E&&!s._state.action:E)?s.unregister(n):A(n,!1)}},[n,s,p,i]),We.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),We.useMemo(()=>({field:T,formState:g,fieldState:S}),[T,g,S])}const uo=t=>t.render(Pae(t)),Lae=We.createContext(null);Lae.displayName="HookFormContext";var Q2=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},hh=t=>Array.isArray(t)?t:[t],fA=()=>{let t=[];return{get observers(){return t},next:s=>{for(const i of t)i.next&&i.next(s)},subscribe:s=>(t.push(s),{unsubscribe:()=>{t=t.filter(i=>i!==s)}}),unsubscribe:()=>{t=[]}}};function l4(t,e){const n={};for(const r in t)if(t.hasOwnProperty(r)){const s=t[r],i=e[r];if(s&&qr(s)&&i){const l=l4(s,i);qr(l)&&(n[r]=l)}else t[r]&&(n[r]=i)}return n}var Rs=t=>qr(t)&&!Object.keys(t).length,J2=t=>t.type==="file",Xv=t=>{if(!W2)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},c4=t=>t.type==="select-multiple",Y2=t=>t.type==="radio",zae=t=>Y2(t)||Vm(t),E1=t=>Xv(t)&&t.isConnected;function $ae(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=yr(t)?r++:t[e[r++]];return t}function Nae(t){for(const e in t)if(t.hasOwnProperty(e)&&!yr(t[e]))return!1;return!0}function Ur(t,e){const n=Array.isArray(e)?e:ob(e)?[e]:G2(e),r=n.length===1?t:$ae(t,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(qr(r)&&Rs(r)||Array.isArray(r)&&Nae(r))&&Ur(t,n.slice(0,-1)),t}var Fae=t=>{for(const e in t)if(As(t[e]))return!0;return!1};function u4(t){return Array.isArray(t)||qr(t)&&!Fae(t)}function lw(t,e={}){for(const n in t){const r=t[n];u4(r)?(e[n]=Array.isArray(r)?[]:{},lw(r,e[n])):yr(r)||(e[n]=!0)}return e}function wd(t,e,n){n||(n=lw(e));for(const r in t){const s=t[r];if(u4(s))yr(e)||aw(n[r])?n[r]=lw(s,Array.isArray(s)?[]:{}):wd(s,Js(e)?{}:e[r],n[r]);else{const i=e[r];n[r]=!bo(s,i)}}return n}const hA={value:!1,isValid:!1},mA={value:!0,isValid:!0};var d4=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!yr(t[0].attributes.value)?yr(t[0].value)||t[0].value===""?mA:{value:t[0].value,isValid:!0}:mA:hA}return hA},p4=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>yr(t)?t:e?t===""?NaN:t&&+t:n&&vi(t)?new Date(t):r?r(t):t;const gA={isValid:!1,value:null};var f4=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,gA):gA;function yA(t){const e=t.ref;return J2(e)?e.files:Y2(e)?f4(t.refs).value:c4(e)?[...e.selectedOptions].map(({value:n})=>n):Vm(e)?d4(t.refs).value:p4(yr(e.value)?t.ref.value:e.value,t)}var Bae=(t,e,n,r)=>{const s={};for(const i of t){const l=rt(e,i);l&&Bn(s,i,l._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},ex=t=>t instanceof RegExp,Ff=t=>yr(t)?t:ex(t)?t.source:qr(t)?ex(t.value)?t.value.source:t.value:t,vA=t=>({isOnSubmit:!t||t===xo.onSubmit,isOnBlur:t===xo.onBlur,isOnChange:t===xo.onChange,isOnAll:t===xo.all,isOnTouch:t===xo.onTouched});const xA="AsyncFunction";var Uae=t=>!!t&&!!t.validate&&!!(As(t.validate)&&t.validate.constructor.name===xA||qr(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===xA)),Vae=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),bA=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const mh=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=rt(t,s);if(i){const{_f:l,...u}=i;if(l){if(l.refs&&l.refs[0]&&e(l.refs[0],s)&&!r)return!0;if(l.ref&&e(l.ref,l.name)&&!r)return!0;if(mh(u,e))break}else if(qr(u)&&mh(u,e))break}}};function SA(t,e,n){const r=rt(t,n);if(r||ob(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),l=rt(e,i),u=rt(t,i);if(l&&!Array.isArray(l)&&n!==i)return{name:n};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};s.pop()}return{name:n}}var Hae=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return Rs(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(l=>e[l]===(!r||xo.all))},Wae=(t,e,n)=>!t||!e||t===e||hh(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),qae=(t,e,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(e||t):(n?r.isOnBlur:s.isOnBlur)?!t:(n?r.isOnChange:s.isOnChange)?t:!0,Gae=(t,e)=>!q2(rt(t,e)).length&&Ur(t,e),Zae=(t,e,n)=>{const r=hh(rt(t,n));return Bn(r,"root",e[n]),Bn(t,n,r),t};function CA(t,e,n="validate"){if(vi(t)||Array.isArray(t)&&t.every(vi)||gi(t)&&!t)return{type:n,message:vi(t)?t:"",ref:e}}var md=t=>qr(t)&&!ex(t)?t:{value:t,message:""},wA=async(t,e,n,r,s,i)=>{const{ref:l,refs:u,required:p,maxLength:f,minLength:m,min:g,max:y,pattern:v,validate:C,name:S,valueAsNumber:j,mount:D}=t._f,M=rt(n,S);if(!D||e.has(S))return{};const T=u?u[0]:l,E=z=>{s&&T.reportValidity&&(T.setCustomValidity(gi(z)?"":z||""),T.reportValidity())},k={},A=Y2(l),O=Vm(l),I=A||O,$=(j||J2(l))&&yr(l.value)&&yr(M)||Xv(l)&&l.value===""||M===""||Array.isArray(M)&&!M.length,R=Q2.bind(null,S,r,k),P=(z,N,H,U=Ma.maxLength,L=Ma.minLength)=>{const W=z?N:H;k[S]={type:z?U:L,message:W,ref:l,...R(z?U:L,W)}};if(i?!Array.isArray(M)||!M.length:p&&(!I&&($||Js(M))||gi(M)&&!M||O&&!d4(u).isValid||A&&!f4(u).isValid)){const{value:z,message:N}=vi(p)?{value:!!p,message:p}:md(p);if(z&&(k[S]={type:Ma.required,message:N,ref:T,...R(Ma.required,N)},!r))return E(N),k}if(!$&&(!Js(g)||!Js(y))){let z,N;const H=md(y),U=md(g);if(!Js(M)&&!isNaN(M)){const L=l.valueAsNumber||M&&+M;Js(H.value)||(z=L>H.value),Js(U.value)||(N=L<U.value)}else{const L=l.valueAsDate||new Date(M),W=le=>new Date(new Date().toDateString()+" "+le),K=l.type=="time",Q=l.type=="week";vi(H.value)&&M&&(z=K?W(M)>W(H.value):Q?M>H.value:L>new Date(H.value)),vi(U.value)&&M&&(N=K?W(M)<W(U.value):Q?M<U.value:L<new Date(U.value))}if((z||N)&&(P(!!z,H.message,U.message,Ma.max,Ma.min),!r))return E(k[S].message),k}if((f||m)&&!$&&(vi(M)||i&&Array.isArray(M))){const z=md(f),N=md(m),H=!Js(z.value)&&M.length>+z.value,U=!Js(N.value)&&M.length<+N.value;if((H||U)&&(P(H,z.message,N.message),!r))return E(k[S].message),k}if(v&&!$&&vi(M)){const{value:z,message:N}=md(v);if(ex(z)&&!M.match(z)&&(k[S]={type:Ma.pattern,message:N,ref:l,...R(Ma.pattern,N)},!r))return E(N),k}if(C){if(As(C)){const z=await C(M,n),N=CA(z,T);if(N&&(k[S]={...N,...R(Ma.validate,N.message)},!r))return E(N.message),k}else if(qr(C)){let z={};for(const N in C){if(!Rs(z)&&!r)break;const H=CA(await C[N](M,n),T,N);H&&(z={...H,...R(N,H.message)},E(H.message),r&&(k[S]=z))}if(!Rs(z)&&(k[S]={ref:T,...z},!r))return k}}return E(!0),k};const Kae={mode:xo.onSubmit,reValidateMode:xo.onChange,shouldFocusError:!0};function Qae(t={}){let e={...Kae,...t},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:As(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},s=qr(e.defaultValues)||qr(e.values)?Br(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:Br(s),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},p,f=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...m};let y={...g};const v={array:fA(),state:fA()},C=e.criteriaMode===xo.all,S=Z=>q=>{clearTimeout(f),f=setTimeout(Z,q)},j=async Z=>{if(!l.keepIsValid&&!e.disabled&&(g.isValid||y.isValid||Z)){let q;e.resolver?(q=Rs((await I()).errors),D()):q=await R(r,!0),q!==n.isValid&&v.state.next({isValid:q})}},D=(Z,q)=>{!e.disabled&&(g.isValidating||g.validatingFields||y.isValidating||y.validatingFields)&&((Z||Array.from(u.mount)).forEach(se=>{se&&(q?Bn(n.validatingFields,se,q):Ur(n.validatingFields,se))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Rs(n.validatingFields)}))},M=(Z,q=[],se,xe,ee=!0,ne=!0)=>{if(xe&&se&&!e.disabled){if(l.action=!0,ne&&Array.isArray(rt(r,Z))){const he=se(rt(r,Z),xe.argA,xe.argB);ee&&Bn(r,Z,he)}if(ne&&Array.isArray(rt(n.errors,Z))){const he=se(rt(n.errors,Z),xe.argA,xe.argB);ee&&Bn(n.errors,Z,he),Gae(n.errors,Z)}if((g.touchedFields||y.touchedFields)&&ne&&Array.isArray(rt(n.touchedFields,Z))){const he=se(rt(n.touchedFields,Z),xe.argA,xe.argB);ee&&Bn(n.touchedFields,Z,he)}(g.dirtyFields||y.dirtyFields)&&(n.dirtyFields=wd(s,i)),v.state.next({name:Z,isDirty:z(Z,q),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Bn(i,Z,q)},T=(Z,q)=>{Bn(n.errors,Z,q),v.state.next({errors:n.errors})},E=Z=>{n.errors=Z,v.state.next({errors:n.errors,isValid:!1})},k=(Z,q,se,xe)=>{const ee=rt(r,Z);if(ee){const ne=rt(i,Z,yr(se)?rt(s,Z):se);yr(ne)||xe&&xe.defaultChecked||q?Bn(i,Z,q?ne:yA(ee._f)):U(Z,ne),l.mount&&!l.action&&j()}},A=(Z,q,se,xe,ee)=>{let ne=!1,he=!1;const je={name:Z};if(!e.disabled){if(!se||xe){(g.isDirty||y.isDirty)&&(he=n.isDirty,n.isDirty=je.isDirty=z(),ne=he!==je.isDirty);const ze=bo(rt(s,Z),q);he=!!rt(n.dirtyFields,Z),ze?Ur(n.dirtyFields,Z):Bn(n.dirtyFields,Z,!0),je.dirtyFields=n.dirtyFields,ne=ne||(g.dirtyFields||y.dirtyFields)&&he!==!ze}if(se){const ze=rt(n.touchedFields,Z);ze||(Bn(n.touchedFields,Z,se),je.touchedFields=n.touchedFields,ne=ne||(g.touchedFields||y.touchedFields)&&ze!==se)}ne&&ee&&v.state.next(je)}return ne?je:{}},O=(Z,q,se,xe)=>{const ee=rt(n.errors,Z),ne=(g.isValid||y.isValid)&&gi(q)&&n.isValid!==q;if(e.delayError&&se?(p=S(()=>T(Z,se)),p(e.delayError)):(clearTimeout(f),p=null,se?Bn(n.errors,Z,se):Ur(n.errors,Z)),(se?!bo(ee,se):ee)||!Rs(xe)||ne){const he={...xe,...ne&&gi(q)?{isValid:q}:{},errors:n.errors,name:Z};n={...n,...he},v.state.next(he)}},I=async Z=>(D(Z,!0),await e.resolver(i,e.context,Bae(Z||u.mount,r,e.criteriaMode,e.shouldUseNativeValidation))),$=async Z=>{const{errors:q}=await I(Z);if(D(Z),Z)for(const se of Z){const xe=rt(q,se);xe?Bn(n.errors,se,xe):Ur(n.errors,se)}else n.errors=q;return q},R=async(Z,q,se={valid:!0})=>{for(const xe in Z){const ee=Z[xe];if(ee){const{_f:ne,...he}=ee;if(ne){const je=u.array.has(ne.name),ze=ee._f&&Uae(ee._f);ze&&g.validatingFields&&D([ne.name],!0);const ke=await wA(ee,u.disabled,i,C,e.shouldUseNativeValidation&&!q,je);if(ze&&g.validatingFields&&D([ne.name]),ke[ne.name]&&(se.valid=!1,q||t.shouldUseNativeValidation))break;!q&&(rt(ke,ne.name)?je?Zae(n.errors,ke,ne.name):Bn(n.errors,ne.name,ke[ne.name]):Ur(n.errors,ne.name))}!Rs(he)&&await R(he,q,se)}}return se.valid},P=()=>{for(const Z of u.unMount){const q=rt(r,Z);q&&(q._f.refs?q._f.refs.every(se=>!E1(se)):!E1(q._f.ref))&&Pe(Z)}u.unMount=new Set},z=(Z,q)=>!e.disabled&&(Z&&q&&Bn(i,Z,q),!bo(F(),s)),N=(Z,q,se)=>ow(Z,u,{...l.mount?i:yr(q)?s:vi(Z)?{[Z]:q}:q},se,q),H=Z=>q2(rt(l.mount?i:s,Z,e.shouldUnregister?rt(s,Z,[]):[])),U=(Z,q,se={})=>{const xe=rt(r,Z);let ee=q;if(xe){const ne=xe._f;ne&&(!ne.disabled&&Bn(i,Z,p4(q,ne)),ee=Xv(ne.ref)&&Js(q)?"":q,c4(ne.ref)?[...ne.ref.options].forEach(he=>he.selected=ee.includes(he.value)):ne.refs?Vm(ne.ref)?ne.refs.forEach(he=>{(!he.defaultChecked||!he.disabled)&&(Array.isArray(ee)?he.checked=!!ee.find(je=>je===he.value):he.checked=ee===he.value||!!ee)}):ne.refs.forEach(he=>he.checked=he.value===ee):J2(ne.ref)?ne.ref.value="":(ne.ref.value=ee,ne.ref.type||v.state.next({name:Z,values:Br(i)})))}(se.shouldDirty||se.shouldTouch)&&A(Z,ee,se.shouldTouch,se.shouldDirty,!0),se.shouldValidate&&le(Z)},L=(Z,q,se)=>{for(const xe in q){if(!q.hasOwnProperty(xe))return;const ee=q[xe],ne=Z+"."+xe,he=rt(r,ne);(u.array.has(Z)||qr(ee)||he&&!he._f)&&!Kc(ee)?L(ne,ee,se):U(ne,ee,se)}},W=(Z,q,se={})=>{const xe=rt(r,Z),ee=u.array.has(Z),ne=Br(q);Bn(i,Z,ne),ee?(v.array.next({name:Z,values:Br(i)}),(g.isDirty||g.dirtyFields||y.isDirty||y.dirtyFields)&&se.shouldDirty&&v.state.next({name:Z,dirtyFields:wd(s,i),isDirty:z(Z,ne)})):xe&&!xe._f&&!Js(ne)?L(Z,ne,se):U(Z,ne,se),bA(Z,u)?v.state.next({...n,name:Z,values:Br(i)}):v.state.next({name:l.mount?Z:void 0,values:Br(i)})},K=async Z=>{l.mount=!0;const q=Z.target;let se=q.name,xe=!0;const ee=rt(r,se),ne=ze=>{xe=Number.isNaN(ze)||Kc(ze)&&isNaN(ze.getTime())||bo(ze,rt(i,se,ze))},he=vA(e.mode),je=vA(e.reValidateMode);if(ee){let ze,ke;const Be=q.type?yA(ee._f):s4(Z),xt=Z.type===Yv.BLUR||Z.type===Yv.FOCUS_OUT,vt=!Vae(ee._f)&&!e.resolver&&!rt(n.errors,se)&&!ee._f.deps||qae(xt,rt(n.touchedFields,se),n.isSubmitted,je,he),kt=bA(se,u,xt);Bn(i,se,Be),xt?(!q||!q.readOnly)&&(ee._f.onBlur&&ee._f.onBlur(Z),p&&p(0)):ee._f.onChange&&ee._f.onChange(Z);const Ge=A(se,Be,xt),gt=!Rs(Ge)||kt;if(!xt&&v.state.next({name:se,type:Z.type,values:Br(i)}),vt)return(g.isValid||y.isValid)&&(e.mode==="onBlur"?xt&&j():xt||j()),gt&&v.state.next({name:se,...kt?{}:Ge});if(!xt&&kt&&v.state.next({...n}),e.resolver){const{errors:dn}=await I([se]);if(D([se]),ne(Be),xe){const $n=SA(n.errors,r,se),dr=SA(dn,r,$n.name||se);ze=dr.error,se=dr.name,ke=Rs(dn)}}else D([se],!0),ze=(await wA(ee,u.disabled,i,C,e.shouldUseNativeValidation))[se],D([se]),ne(Be),xe&&(ze?ke=!1:(g.isValid||y.isValid)&&(ke=await R(r,!0)));xe&&(ee._f.deps&&(!Array.isArray(ee._f.deps)||ee._f.deps.length>0)&&le(ee._f.deps),O(se,ke,ze,Ge))}},Q=(Z,q)=>{if(rt(n.errors,q)&&Z.focus)return Z.focus(),1},le=async(Z,q={})=>{let se,xe;const ee=hh(Z);if(e.resolver){const ne=await $(yr(Z)?Z:ee);se=Rs(ne),xe=Z?!ee.some(he=>rt(ne,he)):se}else Z?(xe=(await Promise.all(ee.map(async ne=>{const he=rt(r,ne);return await R(he&&he._f?{[ne]:he}:he)}))).every(Boolean),!(!xe&&!n.isValid)&&j()):xe=se=await R(r);return v.state.next({...!vi(Z)||(g.isValid||y.isValid)&&se!==n.isValid?{}:{name:Z},...e.resolver||!Z?{isValid:se}:{},errors:n.errors}),q.shouldFocus&&!xe&&mh(r,Q,Z?ee:u.mount),xe},F=(Z,q)=>{let se={...l.mount?i:s};return q&&(se=l4(q.dirtyFields?n.dirtyFields:n.touchedFields,se)),yr(Z)?se:vi(Z)?rt(se,Z):Z.map(xe=>rt(se,xe))},J=(Z,q)=>({invalid:!!rt((q||n).errors,Z),isDirty:!!rt((q||n).dirtyFields,Z),error:rt((q||n).errors,Z),isValidating:!!rt(n.validatingFields,Z),isTouched:!!rt((q||n).touchedFields,Z)}),ie=Z=>{const q=Z?hh(Z):void 0;q==null||q.forEach(se=>Ur(n.errors,se)),q?q.forEach(se=>{v.state.next({name:se,errors:n.errors})}):v.state.next({errors:{}})},te=(Z,q,se)=>{const xe=(rt(r,Z,{_f:{}})._f||{}).ref,ee=rt(n.errors,Z)||{},{ref:ne,message:he,type:je,...ze}=ee;Bn(n.errors,Z,{...ze,...q,ref:xe}),v.state.next({name:Z,errors:n.errors,isValid:!1}),se&&se.shouldFocus&&xe&&xe.focus&&xe.focus()},de=(Z,q)=>As(Z)?v.state.subscribe({next:se=>"values"in se&&Z(N(void 0,q),se)}):N(Z,q,!0),fe=Z=>v.state.subscribe({next:q=>{Wae(Z.name,q.name,Z.exact)&&Hae(q,Z.formState||g,tt,Z.reRenderRoot)&&Z.callback({values:{...i},...n,...q,defaultValues:s})}}).unsubscribe,Re=Z=>(l.mount=!0,y={...y,...Z.formState},fe({...Z,formState:{...m,...Z.formState}})),Pe=(Z,q={})=>{for(const se of Z?hh(Z):u.mount)u.mount.delete(se),u.array.delete(se),q.keepValue||(Ur(r,se),Ur(i,se)),!q.keepError&&Ur(n.errors,se),!q.keepDirty&&Ur(n.dirtyFields,se),!q.keepTouched&&Ur(n.touchedFields,se),!q.keepIsValidating&&Ur(n.validatingFields,se),!e.shouldUnregister&&!q.keepDefaultValue&&Ur(s,se);v.state.next({values:Br(i)}),v.state.next({...n,...q.keepDirty?{isDirty:z()}:{}}),!q.keepIsValid&&j()},$e=({disabled:Z,name:q})=>{if(gi(Z)&&l.mount||Z||u.disabled.has(q)){const ee=u.disabled.has(q)!==!!Z;Z?u.disabled.add(q):u.disabled.delete(q),ee&&l.mount&&!l.action&&j()}},we=(Z,q={})=>{let se=rt(r,Z);const xe=gi(q.disabled)||gi(e.disabled);return Bn(r,Z,{...se||{},_f:{...se&&se._f?se._f:{ref:{name:Z}},name:Z,mount:!0,...q}}),u.mount.add(Z),se?$e({disabled:gi(q.disabled)?q.disabled:e.disabled,name:Z}):k(Z,!0,q.value),{...xe?{disabled:q.disabled||e.disabled}:{},...e.progressive?{required:!!q.required,min:Ff(q.min),max:Ff(q.max),minLength:Ff(q.minLength),maxLength:Ff(q.maxLength),pattern:Ff(q.pattern)}:{},name:Z,onChange:K,onBlur:K,ref:ee=>{if(ee){we(Z,q),se=rt(r,Z);const ne=yr(ee.value)&&ee.querySelectorAll&&ee.querySelectorAll("input,select,textarea")[0]||ee,he=zae(ne),je=se._f.refs||[];if(he?je.find(ze=>ze===ne):ne===se._f.ref)return;Bn(r,Z,{_f:{...se._f,...he?{refs:[...je.filter(E1),ne,...Array.isArray(rt(s,Z))?[{}]:[]],ref:{type:ne.type,name:Z}}:{ref:ne}}}),k(Z,!1,void 0,ne)}else se=rt(r,Z,{}),se._f&&(se._f.mount=!1),(e.shouldUnregister||q.shouldUnregister)&&!(i4(u.array,Z)&&l.action)&&u.unMount.add(Z)}}},be=()=>e.shouldFocusError&&mh(r,Q,u.mount),Ae=Z=>{gi(Z)&&(v.state.next({disabled:Z}),mh(r,(q,se)=>{const xe=rt(r,se);xe&&(q.disabled=xe._f.disabled||Z,Array.isArray(xe._f.refs)&&xe._f.refs.forEach(ee=>{ee.disabled=xe._f.disabled||Z}))},0,!1))},Ne=(Z,q)=>async se=>{let xe;se&&(se.preventDefault&&se.preventDefault(),se.persist&&se.persist());let ee=Br(i);if(v.state.next({isSubmitting:!0}),e.resolver){const{errors:ne,values:he}=await I();D(),n.errors=ne,ee=Br(he)}else await R(r);if(u.disabled.size)for(const ne of u.disabled)Ur(ee,ne);if(Ur(n.errors,"root"),Rs(n.errors)){v.state.next({errors:{}});try{await Z(ee,se)}catch(ne){xe=ne}}else q&&await q({...n.errors},se),be(),setTimeout(be);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Rs(n.errors)&&!xe,submitCount:n.submitCount+1,errors:n.errors}),xe)throw xe},Ie=(Z,q={})=>{rt(r,Z)&&(yr(q.defaultValue)?W(Z,Br(rt(s,Z))):(W(Z,q.defaultValue),Bn(s,Z,Br(q.defaultValue))),q.keepTouched||Ur(n.touchedFields,Z),q.keepDirty||(Ur(n.dirtyFields,Z),n.isDirty=q.defaultValue?z(Z,Br(rt(s,Z))):z()),q.keepError||(Ur(n.errors,Z),g.isValid&&j()),v.state.next({...n}))},Fe=(Z,q={})=>{const se=Z?Br(Z):s,xe=Br(se),ee=Rs(Z),ne=ee?s:xe;if(q.keepDefaultValues||(s=se),!q.keepValues){if(q.keepDirtyValues){const he=new Set([...u.mount,...Object.keys(wd(s,i))]);for(const je of Array.from(he)){const ze=rt(n.dirtyFields,je),ke=rt(i,je),Be=rt(ne,je);ze&&!yr(ke)?Bn(ne,je,ke):!ze&&!yr(Be)&&W(je,Be)}}else{if(W2&&yr(Z))for(const he of u.mount){const je=rt(r,he);if(je&&je._f){const ze=Array.isArray(je._f.refs)?je._f.refs[0]:je._f.ref;if(Xv(ze)){const ke=ze.closest("form");if(ke){ke.reset();break}}}}if(q.keepFieldsRef)for(const he of u.mount)W(he,rt(ne,he));else r={}}i=e.shouldUnregister?q.keepDefaultValues?Br(s):{}:Br(ne),v.array.next({values:{...ne}}),v.state.next({values:{...ne}})}u={mount:q.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!g.isValid||!!q.keepIsValid||!!q.keepDirtyValues||!e.shouldUnregister&&!Rs(ne),l.watch=!!e.shouldUnregister,l.keepIsValid=!!q.keepIsValid,l.action=!1,q.keepErrors||(n.errors={}),v.state.next({submitCount:q.keepSubmitCount?n.submitCount:0,isDirty:ee?!1:q.keepDirty?n.isDirty:!!(q.keepDefaultValues&&!bo(Z,s)),isSubmitted:q.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ee?{}:q.keepDirtyValues?q.keepDefaultValues&&i?wd(s,i):n.dirtyFields:q.keepDefaultValues&&Z?wd(s,Z):q.keepDirty?n.dirtyFields:{},touchedFields:q.keepTouched?n.touchedFields:{},errors:q.keepErrors?n.errors:{},isSubmitSuccessful:q.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},ct=(Z,q)=>Fe(As(Z)?Z(i):Z,{...e.resetOptions,...q}),Me=(Z,q={})=>{const se=rt(r,Z),xe=se&&se._f;if(xe){const ee=xe.refs?xe.refs[0]:xe.ref;ee.focus&&setTimeout(()=>{ee.focus(),q.shouldSelect&&As(ee.select)&&ee.select()})}},tt=Z=>{n={...n,...Z}},it={control:{register:we,unregister:Pe,getFieldState:J,handleSubmit:Ne,setError:te,_subscribe:fe,_runSchema:I,_updateIsValidating:D,_focusError:be,_getWatch:N,_getDirty:z,_setValid:j,_setFieldArray:M,_setDisabledField:$e,_setErrors:E,_getFieldArray:H,_reset:Fe,_resetDefaultValues:()=>As(e.defaultValues)&&e.defaultValues().then(Z=>{ct(Z,e.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:Ae,_subjects:v,_proxyFormState:g,get _fields(){return r},get _formValues(){return i},get _state(){return l},set _state(Z){l=Z},get _defaultValues(){return s},get _names(){return u},set _names(Z){u=Z},get _formState(){return n},get _options(){return e},set _options(Z){e={...e,...Z}}},subscribe:Re,trigger:le,register:we,handleSubmit:Ne,watch:de,setValue:W,getValues:F,reset:ct,resetField:Ie,clearErrors:ie,unregister:Pe,setError:te,setFocus:Me,getFieldState:J};return{...it,formControl:it}}function Jae(t={}){const e=We.useRef(void 0),n=We.useRef(void 0),[r,s]=We.useState({isDirty:!1,isValidating:!1,isLoading:As(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:As(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:r},t.defaultValues&&!As(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:l,...u}=Qae(t);e.current={...u,formState:r}}const i=e.current.control;return i._options=t,K2(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(u=>({...u,isReady:!0})),i._formState.isReady=!0,l},[i]),We.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),We.useEffect(()=>{t.mode&&(i._options.mode=t.mode),t.reValidateMode&&(i._options.reValidateMode=t.reValidateMode)},[i,t.mode,t.reValidateMode]),We.useEffect(()=>{t.errors&&(i._setErrors(t.errors),i._focusError())},[i,t.errors]),We.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,t.shouldUnregister]),We.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==r.isDirty&&i._subjects.state.next({isDirty:l})}},[i,r.isDirty]),We.useEffect(()=>{var l;t.values&&!bo(t.values,n.current)?(i._reset(t.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((l=i._options.resetOptions)===null||l===void 0)&&l.keepIsValid||i._setValid(),n.current=t.values,s(u=>({...u}))):i._resetDefaultValues()},[i,t.values]),We.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),e.current.formState=We.useMemo(()=>a4(r,i),[i,r]),e.current}function Yae({open:t,message:e="処理中..."}){return a.jsx(Mx,{open:t,sx:{color:"#fff",zIndex:n=>n.zIndex.modal+1,backgroundColor:"rgba(0, 0, 0, 0.7)"},children:a.jsxs(Ro,{alignItems:"center",spacing:2,children:[a.jsx(ut,{color:"inherit"}),a.jsx(G,{variant:"body1",children:e})]})})}class Xae{constructor(e){this.repository=e}async execute(e){const{file:n,uploadedBy:r}=e;return oe.info("UploadStorageFileUseCase.execute",{fileName:n.name,uploadedBy:r}),this.repository.uploadFile(n,r)}async executeImageSet(e){const{imageSet:n,originalName:r,uploadedBy:s,dimensions:i}=e;return oe.info("UploadStorageFileUseCase.executeImageSet",{originalName:r,uploadedBy:s}),this.repository.uploadImageSet(n,r,s,i)}}class ele{constructor(e){this.repository=e}async execute(e){const{uuid:n,year:r}=e;oe.info("DeleteStorageFileUseCase.execute",{uuid:n,year:r}),await this.repository.deleteFile(n,r)}}class tle{constructor(e){this.repository=e}async execute(e){const{year:n}=e;return oe.debug("FetchStorageFilesUseCase.execute",{year:n}),this.repository.fetchFiles(n)}async fetchYears(){return oe.debug("FetchStorageFilesUseCase.fetchYears"),this.repository.fetchYears()}}class nle{constructor(e){this.repository=e}async execute(e){const{uuid:n,year:r,alt:s}=e;return oe.info("UpdateStorageFileMetadataUseCase.execute",{uuid:n,year:r,alt:s}),this.repository.updateFileMetadata(n,r,{alt:s})}}class rle{constructor(){St(this,"repository");St(this,"uploadUseCase");St(this,"deleteUseCase");St(this,"fetchUseCase");St(this,"updateMetadataUseCase");this.repository=new Sd,this.uploadUseCase=new Xae(this.repository),this.deleteUseCase=new ele(this.repository),this.fetchUseCase=new tle(this.repository),this.updateMetadataUseCase=new nle(this.repository)}async uploadFile(e,n){return this.uploadUseCase.execute({file:e,uploadedBy:n})}async uploadImageSet(e,n,r,s){return this.uploadUseCase.executeImageSet({imageSet:e,originalName:n,uploadedBy:r,dimensions:s})}async deleteFile(e,n){return this.deleteUseCase.execute({uuid:e,year:n})}async fetchFiles(e){return this.fetchUseCase.execute({year:e})}async fetchYears(){return this.fetchUseCase.fetchYears()}async updateFileMetadata(e,n,r){return this.updateMetadataUseCase.execute({uuid:e,year:n,alt:r})}async rebuildIndex(e){return this.repository.rebuildIndex(e)}}let R1=null;function X2(){return R1||(R1=new rle),R1}const Ly=30;function h4({open:t,onClose:e,onSelect:n,accept:r="all",uploadedBy:s,aspectRatio:i,currentSelectedUuid:l}){const u=vr(),p=aa(u.breakpoints.down("sm")),f=ys(),m=b.useRef(null),g=X2(),[y,v]=b.useState(null),[C,S]=b.useState(null),[j,D]=b.useState("uploadedAt"),[M,T]=b.useState("desc"),[E,k]=b.useState(Ly),[A,O]=b.useState(!1),[I,$]=b.useState(null),[R,P]=b.useState(!1),[z,N]=b.useState(null),[H,U]=b.useState(null),[L,W]=b.useState(!1),[K,Q]=b.useState(null),[le,F]=b.useState(""),J=jn({queryKey:["files",C],queryFn:()=>g.fetchFiles(C??void 0),enabled:t}),ie=Pn({mutationFn:({uuid:q,alt:se})=>g.updateFileMetadata(q,C??new Date().getFullYear(),se),onSuccess:()=>{f.invalidateQueries({queryKey:["files",C]}),Q(null)}}),te=J.data;b.useEffect(()=>{te&&C===null&&te.availableYears.length>0&&S(te.year)},[te,C]),b.useEffect(()=>{t||(v(null),k(Ly),$(null))},[t]),b.useEffect(()=>{if(t&&l&&(te!=null&&te.files)){const q=te.files.find(se=>se.uuid===l);q&&v(q)}},[t,l,te==null?void 0:te.files]);const de=b.useMemo(()=>te!=null&&te.files?te.files.filter(q=>r==="image"?Uc(q.contentType):!0):[],[te==null?void 0:te.files,r]),fe=b.useMemo(()=>{const q=[...de];return q.sort((se,xe)=>{if(l){if(se.uuid===l)return-1;if(xe.uuid===l)return 1}let ee=0;switch(j){case"originalName":ee=se.originalName.localeCompare(xe.originalName,"ja");break;case"size":ee=se.size-xe.size;break;case"uploadedAt":default:ee=new Date(se.uploadedAt).getTime()-new Date(xe.uploadedAt).getTime();break}return M==="asc"?ee:-ee}),q},[de,j,M,l]),Re=fe.slice(0,E),Pe=E<fe.length,$e=q=>te!=null&&te.baseUrl&&q.startsWith(te.baseUrl+"/")?q.slice(te.baseUrl.length+1):q,we=()=>{if(y){const q=y.variants?Object.fromEntries(Object.entries(y.variants).map(([se,xe])=>[se,$e(xe)])):void 0;n({uuid:y.uuid,url:$e(y.url),originalName:y.originalName,alt:y.alt,size:y.size,width:y.width,height:y.height,...q&&{variants:q}}),v(null),e()}},be=()=>{v(null),e()},Ae=q=>{S(q),k(Ly)},Ne=(q,se)=>{se!==null&&D(se)},Ie=()=>{T(q=>q==="asc"?"desc":"asc")},Fe=q=>{var xe;const se=(xe=q.target.files)==null?void 0:xe[0];if(se){if(m.current&&(m.current.value=""),Uc(se.type)){const ee=URL.createObjectURL(se);N(ee),U(se),P(!0)}else if(r==="image"){$("画像ファイルを選択してください");return}}},ct=async q=>{P(!1),z&&URL.revokeObjectURL(z);const se=(H==null?void 0:H.name)??"image.jpg";N(null),U(null),O(!0),$(null);try{const xe={width:q.width,height:q.height},ee=await g.uploadImageSet(q.imageSet,se,s,xe),ne=new Date().getFullYear();f.invalidateQueries({queryKey:["files",ne]}),C!==ne&&S(ne),n({uuid:ee.uuid,url:ee.url,originalName:ee.originalName,size:ee.size,width:ee.width,height:ee.height,variants:ee.variants}),e()}catch(xe){$(xe.message)}finally{O(!1)}},Me=()=>{P(!1),z&&URL.revokeObjectURL(z),N(null),U(null)},tt=i&&i!=="free"?i:null,Ve=q=>{q.preventDefault(),q.stopPropagation(),W(!0)},it=q=>{q.preventDefault(),q.stopPropagation(),W(!1)},Z=q=>{q.preventDefault(),q.stopPropagation(),W(!1);const se=q.dataTransfer.files[0];if(se)if(Uc(se.type)){const xe=URL.createObjectURL(se);N(xe),U(se),P(!0)}else r==="image"&&$("画像ファイルをドロップしてください")};return a.jsxs(a.Fragment,{children:[a.jsxs(Qt,{open:t,onClose:be,maxWidth:"md",fullWidth:!0,fullScreen:p,children:[a.jsxs(Yt,{sx:{py:p?1.5:2,pr:6},children:[r==="image"?"画像を選択":"ファイルを選択",a.jsx(ft,{onClick:be,sx:{position:"absolute",right:8,top:8},children:a.jsx($x,{})})]}),a.jsxs(Jt,{sx:{p:p?1:2,position:"relative"},onDragOver:Ve,onDragLeave:it,onDrop:Z,children:[L&&a.jsx(B,{sx:{position:"absolute",inset:0,bgcolor:"rgba(25, 118, 210, 0.1)",border:"2px dashed",borderColor:"primary.main",borderRadius:1,zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsxs(B,{sx:{textAlign:"center"},children:[a.jsx(Ti,{sx:{fontSize:64,color:"primary.main"}}),a.jsx(G,{variant:"h6",color:"primary",children:"ここにドロップ"})]})}),a.jsxs(B,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},gap:1,mb:2},children:[te&&te.availableYears.length>0&&a.jsx(_n,{size:"small",sx:{minWidth:100},children:a.jsx(wn,{value:C??te.year,onChange:q=>Ae(q.target.value),children:te.availableYears.map(q=>a.jsxs(nt,{value:q,children:[q,"年"]},q))})}),a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:.5},children:[a.jsxs(yc,{value:j,exclusive:!0,onChange:Ne,size:"small",children:[a.jsx(ts,{value:"uploadedAt",children:"日時"}),a.jsx(ts,{value:"originalName",children:"名前"}),a.jsx(ts,{value:"size",children:"サイズ"})]}),a.jsx(ts,{value:"order",selected:!1,onChange:Ie,size:"small",title:M==="asc"?"昇順":"降順",children:M==="asc"?a.jsx(x2,{fontSize:"small"}):a.jsx(zx,{fontSize:"small"})})]}),a.jsxs(pe,{variant:"outlined",startIcon:A?a.jsx(ut,{size:20}):a.jsx(Ti,{}),component:"label",disabled:A,sx:{ml:{sm:"auto"}},children:[A?"アップロード中...":"アップロード",a.jsx("input",{ref:m,type:"file",accept:r==="image"?"image/*":"*/*",hidden:!0,onChange:Fe})]})]}),I&&a.jsx(zt,{severity:"error",sx:{mb:2},onClose:()=>$(null),children:I}),J.isLoading?a.jsx(B,{sx:{display:"flex",justifyContent:"center",py:4},children:a.jsx(ut,{})}):J.error?a.jsx(zt,{severity:"error",children:"ファイル一覧の取得に失敗しました"}):fe.length===0?a.jsx(zt,{severity:"info",children:r==="image"?"画像ファイルがありません":"ファイルがありません"}):a.jsxs(a.Fragment,{children:[a.jsx(Et,{container:!0,spacing:1,children:Re.map(q=>a.jsx(Et,{item:!0,xs:4,sm:3,md:2,children:a.jsxs(Su,{sx:{border:(y==null?void 0:y.uuid)===q.uuid?"2px solid":"2px solid transparent",borderColor:(y==null?void 0:y.uuid)===q.uuid?"primary.main":"transparent",position:"relative"},children:[a.jsxs(_I,{onClick:()=>v(q),children:[a.jsx(B,{sx:{height:100,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.100"},children:Uc(q.contentType)?a.jsx(II,{component:"img",image:q.url,alt:q.originalName,sx:{height:"100%",objectFit:"contain"}}):r5(q.contentType)?a.jsx(Fx,{sx:{fontSize:48,color:"error.main"}}):a.jsx(vc,{sx:{fontSize:48,color:"grey.500"}})}),a.jsxs(B,{sx:{p:.5},children:[a.jsx(G,{variant:"caption",noWrap:!0,display:"block",title:q.originalName,children:q.originalName}),a.jsx(G,{variant:"caption",color:"text.secondary",children:UC(q.size)})]})]}),(y==null?void 0:y.uuid)===q.uuid&&a.jsx(vP,{sx:{position:"absolute",top:4,right:4,color:"primary.main",bgcolor:"white",borderRadius:"50%"}}),Uc(q.contentType)&&a.jsx(ft,{size:"small",onClick:se=>{se.stopPropagation(),Q(q),F(q.alt??"")},title:"代替テキストを編集",sx:{position:"absolute",bottom:4,right:4,bgcolor:"rgba(255, 255, 255, 0.9)","&:hover":{bgcolor:"primary.light",color:"white"},width:24,height:24},children:a.jsx(Ri,{sx:{fontSize:14}})})]})},q.uuid))}),Pe&&a.jsx(B,{sx:{display:"flex",justifyContent:"center",mt:2},children:a.jsxs(pe,{variant:"text",onClick:()=>k(q=>q+Ly),children:["もっと読み込む (",fe.length-E," 件)"]})})]})]}),a.jsxs(rn,{sx:{px:2,pb:2},children:[a.jsx(pe,{onClick:be,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:we,disabled:!y,children:"選択"})]})]}),z&&a.jsx(A2,{open:R,imageUrl:z,onClose:Me,onComplete:ct,fixedAspectRatio:tt}),a.jsxs(Qt,{open:!!K,onClose:()=>Q(null),maxWidth:"sm",fullWidth:!0,children:[a.jsx(Yt,{children:"代替テキストを編集"}),a.jsx(Jt,{children:a.jsx(B,{sx:{pt:1},children:a.jsx(Xe,{label:"代替テキスト (alt)",fullWidth:!0,value:le,onChange:q=>F(q.target.value),placeholder:"画像の説明を入力",helperText:"スクリーンリーダーや画像が表示できない場合に使用されます",autoFocus:!0})})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>Q(null),children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:()=>{K&&ie.mutate({uuid:K.uuid,alt:le})},disabled:ie.isPending,children:ie.isPending?"保存中...":"保存"})]})]})]})}function sle({value:t,warnLength:e}){const n=(t==null?void 0:t.length)??0,r=n>e;return a.jsxs(G,{variant:"caption",sx:{color:r?"warning.main":"text.secondary",fontWeight:r?600:400},children:[r&&"⚠ ",n," / ",e," 文字",r&&` (${n-e} 文字超過)`]})}const ile=/\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g,k1=/(https?:\/\/[^\s<>"{}|\\^`[\]]+)/g;function ole(t){const e=[];let n=0;const r=[...t.matchAll(ile)];for(const i of r){const l=i.index,u=l+i[0].length;l>n&&e.push({type:"text",content:t.slice(n,l)}),e.push({type:"link",text:i[1],url:i[2]}),n=u}n<t.length&&e.push({type:"text",content:t.slice(n)});const s=[];for(const i of e)if(i.type==="link")s.push(i);else{const l=i.content.split(k1);for(const u of l)k1.test(u)?(k1.lastIndex=0,s.push({type:"link",text:u,url:u})):u&&s.push({type:"text",content:u})}return s}function m4({text:t}){if(!t)return null;const e=ole(t);return a.jsx(a.Fragment,{children:e.map((n,r)=>n.type==="link"?a.jsx(Ox,{href:n.url,target:"_blank",rel:"noopener noreferrer",sx:{wordBreak:"break-all"},children:n.text},r):a.jsx(b.Fragment,{children:n.content},r))})}function vo({label:t,children:e,required:n=!1,description:r,error:s,warnLength:i,labelSuffix:l,disabled:u=!1}){const p=!!s;return a.jsxs(_n,{fullWidth:!0,error:p,disabled:u,children:[a.jsxs(B,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",mb:.5},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"baseline",gap:1},children:[a.jsx(FI,{required:n,children:t}),l]}),i&&a.jsx(sle,{value:i.value,warnLength:i.limit})]}),e,(s||r)&&a.jsx(Dh,{error:p,sx:{mx:0},children:s||a.jsx(m4,{text:r})})]})}function g4({label:t,value:e,onChange:n,required:r,description:s,uploadedBy:i,aspectRatio:l,disabled:u=!1}){const p=ys(),f=X2(),[m,g]=b.useState(!1),[y,v]=b.useState(!1),C=b.useRef(0),[S,j]=b.useState(!1),[D,M]=b.useState(null),[T,E]=b.useState(null),[k,A]=b.useState(!1),[O,I]=b.useState(null),$=()=>{n(null)},R=W=>{W.preventDefault(),W.stopPropagation(),C.current++,C.current===1&&v(!0)},P=W=>{W.preventDefault(),W.stopPropagation()},z=W=>{W.preventDefault(),W.stopPropagation(),C.current--,C.current===0&&v(!1)},N=W=>{W.preventDefault(),W.stopPropagation(),C.current=0,v(!1);const K=W.dataTransfer.files[0];if(!K)return;if(!Uc(K.type)){I("画像ファイルをドロップしてください");return}const Q=URL.createObjectURL(K);M(Q),E(K),j(!0),I(null)},H=async W=>{j(!1),D&&URL.revokeObjectURL(D);const K=(T==null?void 0:T.name)??"image.jpg";M(null),E(null),A(!0),I(null);try{const Q={width:W.width,height:W.height},le=await f.uploadImageSet(W.imageSet,K,i,Q),F=new Date().getFullYear();p.invalidateQueries({queryKey:["files",F]}),n({uuid:le.uuid,url:le.url,originalName:le.originalName,size:le.size,width:le.width,height:le.height,variants:le.variants})}catch(Q){I(Q.message)}finally{A(!1)}},U=()=>{j(!1),D&&URL.revokeObjectURL(D),M(null),E(null)},L=l&&l!=="free"?l:null;return a.jsxs(vo,{label:t,required:r,description:s,disabled:u,children:[a.jsx(B,{sx:{position:"relative",width:"100%",height:200,borderRadius:1,overflow:"hidden",border:y?"2px dashed":"1px solid",borderColor:y?"primary.main":"divider",bgcolor:y?"action.hover":"grey.100",transition:"border-color 0.2s, background-color 0.2s"},onDragEnter:R,onDragOver:P,onDragLeave:z,onDrop:N,children:k?a.jsxs(B,{sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:1},children:[a.jsx(ut,{size:32}),a.jsx(G,{variant:"body2",color:"text.secondary",children:"アップロード中..."})]}):e&&typeof e=="object"&&e.url?a.jsxs(a.Fragment,{children:[a.jsx(B,{sx:{width:"100%",height:"100%",cursor:"pointer","&:hover":{opacity:.9}},onClick:()=>g(!0),children:a.jsx("img",{src:n5(e.url),alt:e.originalName,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),a.jsx(ft,{size:"small",onClick:W=>{W.stopPropagation(),$()},sx:{position:"absolute",top:4,right:4,bgcolor:"rgba(0,0,0,0.5)",color:"white","&:hover":{bgcolor:"rgba(0,0,0,0.7)"}},children:a.jsx(zn,{fontSize:"small"})}),a.jsx(G,{variant:"caption",sx:{position:"absolute",bottom:0,left:0,right:0,bgcolor:"rgba(0,0,0,0.5)",color:"white",px:1,py:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none"},children:e.originalName}),y&&a.jsx(B,{sx:{position:"absolute",inset:0,bgcolor:"rgba(25, 118, 210, 0.3)",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsx(Ti,{sx:{fontSize:48,color:"primary.main"}})})]}):a.jsx(B,{sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer","&:hover":{bgcolor:"grey.200"}},onClick:()=>g(!0),children:a.jsx(B,{sx:{textAlign:"center"},children:y?a.jsxs(a.Fragment,{children:[a.jsx(Ti,{sx:{fontSize:48,color:"primary.main"}}),a.jsx(G,{variant:"body2",color:"primary",children:"ここにドロップ"})]}):a.jsxs(a.Fragment,{children:[a.jsx(wJ,{sx:{fontSize:48,color:"primary.main"}}),a.jsx(G,{variant:"body2",color:"primary",children:"画像を選択"}),a.jsx(G,{variant:"caption",color:"text.secondary",children:"またはドラッグ&ドロップ"})]})})})}),O&&a.jsx(zt,{severity:"error",sx:{mt:1},onClose:()=>I(null),children:O}),a.jsx(h4,{open:m,onClose:()=>g(!1),onSelect:n,accept:"image",uploadedBy:i,aspectRatio:l,currentSelectedUuid:e==null?void 0:e.uuid}),D&&a.jsx(A2,{open:S,imageUrl:D,onClose:U,onComplete:H,fixedAspectRatio:L})]})}function ale(t,e){return t.startsWith("application/pdf")||e.endsWith(".pdf")?a.jsx(Fx,{sx:{fontSize:48,color:"error.main"}}):t.startsWith("video/")?a.jsx(IY,{sx:{fontSize:48,color:"secondary.main"}}):t.startsWith("audio/")?a.jsx(hJ,{sx:{fontSize:48,color:"warning.main"}}):t.includes("javascript")||t.includes("json")||t.includes("xml")||t.includes("html")||t.includes("css")||e.match(/\.(js|ts|jsx|tsx|json|xml|html|css|py|rb|go|rs)$/)?a.jsx(S2,{sx:{fontSize:48,color:"info.main"}}):t.includes("document")||t.includes("word")||t.includes("text")||e.match(/\.(doc|docx|txt|md|rtf)$/)?a.jsx(Tp,{sx:{fontSize:48,color:"primary.main"}}):a.jsx(vc,{sx:{fontSize:48,color:"grey.500"}})}function y4({label:t,value:e,onChange:n,required:r,description:s,uploadedBy:i,disabled:l=!1}){const u=ys(),p=X2(),[f,m]=b.useState(!1),[g,y]=b.useState(!1),v=b.useRef(0),[C,S]=b.useState(!1),[j,D]=b.useState(null),M=()=>{n(null)},T=I=>{I.preventDefault(),I.stopPropagation(),v.current++,v.current===1&&y(!0)},E=I=>{I.preventDefault(),I.stopPropagation()},k=I=>{I.preventDefault(),I.stopPropagation(),v.current--,v.current===0&&y(!1)},A=async I=>{I.preventDefault(),I.stopPropagation(),v.current=0,y(!1);const $=I.dataTransfer.files[0];if($){S(!0),D(null);try{const R=await p.uploadFile($,i),P=new Date().getFullYear();u.invalidateQueries({queryKey:["files",P]}),n({uuid:R.uuid,url:R.url,originalName:R.originalName})}catch(R){D(R.message)}finally{S(!1)}}},O=I=>{var P;const $=((P=I.split(".").pop())==null?void 0:P.toLowerCase())??"";return{pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain",md:"text/markdown",json:"application/json",xml:"application/xml",html:"text/html",css:"text/css",js:"application/javascript",ts:"application/typescript",mp4:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav"}[$]??"application/octet-stream"};return a.jsxs(vo,{label:t,required:r,description:s,disabled:l,children:[a.jsx(B,{sx:{position:"relative",width:"100%",height:200,borderRadius:1,overflow:"hidden",border:g?"2px dashed":"1px solid",borderColor:g?"primary.main":"divider",bgcolor:g?"action.hover":"grey.100",transition:"border-color 0.2s, background-color 0.2s"},onDragEnter:T,onDragOver:E,onDragLeave:k,onDrop:A,children:C?a.jsxs(B,{sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:1},children:[a.jsx(ut,{size:32}),a.jsx(G,{variant:"body2",color:"text.secondary",children:"アップロード中..."})]}):e&&typeof e=="object"&&e.url?a.jsxs(a.Fragment,{children:[a.jsx(B,{sx:{width:"100%",height:"100%",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1,"&:hover":{bgcolor:"grey.200"}},onClick:()=>m(!0),children:ale(O(e.originalName),e.originalName)}),a.jsx(ft,{size:"small",onClick:I=>{I.stopPropagation(),M()},sx:{position:"absolute",top:4,right:4,bgcolor:"rgba(0,0,0,0.5)",color:"white","&:hover":{bgcolor:"rgba(0,0,0,0.7)"}},children:a.jsx(zn,{fontSize:"small"})}),a.jsx(G,{variant:"caption",sx:{position:"absolute",bottom:0,left:0,right:0,bgcolor:"rgba(0,0,0,0.5)",color:"white",px:1,py:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",textAlign:"center"},children:e.originalName}),g&&a.jsx(B,{sx:{position:"absolute",inset:0,bgcolor:"rgba(25, 118, 210, 0.3)",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsx(Ti,{sx:{fontSize:48,color:"primary.main"}})})]}):a.jsx(B,{sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer","&:hover":{bgcolor:"grey.200"}},onClick:()=>m(!0),children:a.jsx(B,{sx:{textAlign:"center"},children:g?a.jsxs(a.Fragment,{children:[a.jsx(Ti,{sx:{fontSize:48,color:"primary.main"}}),a.jsx(G,{variant:"body2",color:"primary",children:"ここにドロップ"})]}):a.jsxs(a.Fragment,{children:[a.jsx(vc,{sx:{fontSize:48,color:"primary.main"}}),a.jsx(G,{variant:"body2",color:"primary",children:"ファイルを選択"}),a.jsx(G,{variant:"caption",color:"text.secondary",children:"またはドラッグ&ドロップ"})]})})})}),j&&a.jsx(zt,{severity:"error",sx:{mt:1},onClose:()=>D(null),children:j}),a.jsx(h4,{open:f,onClose:()=>m(!1),onSelect:n,accept:"all",uploadedBy:i,currentSelectedUuid:e==null?void 0:e.uuid})]})}class M1{constructor(e){this.queries=e}static ContentsQueryParams(e,n,r){return{queryKey:["contents",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).fetchJsonOrDefault(Ah("published",n),[],r)},enabled:!!e&&!!n}}static PrivateQueryParams(e,n,r){return{queryKey:["private",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).fetchJsonOrDefault(Ah("private",n),[],r)},enabled:!!e&&!!n}}getContents(){return this.queries.contents.data??[]}getPrivate(){return this.queries.private.data??[]}isLoading(){return this.queries.contents.isLoading||this.queries.private.isLoading}isError(){return this.queries.contents.isError||this.queries.private.isError}}function lle(){const[t,e]=b.useState(!1),[n,r]=b.useState(""),[s,i]=b.useState([]),l=b.useCallback(()=>({dialogOpen:t,searchQuery:n,tempSelection:s}),[t,n,s]),u=b.useCallback(m=>{i(m),r(""),e(!0)},[]),p=b.useCallback(()=>{e(!1)},[]),f=b.useCallback((m,g)=>{i(g?y=>y.includes(m)?y.filter(v=>v!==m):[...y,m]:[m])},[]);return{getState:l,openDialog:u,closeDialog:p,setSearchQuery:r,setTempSelection:i,toggleSelection:f}}class cle{toArray(e){return e?Array.isArray(e)?e:[e]:[]}fromArray(e,n){return n?e:e[0]??null}confirmSelection(e,n){return n?e.length>0?e:[]:e[0]??null}removeItem(e,n,r){const i=this.toArray(e).filter(l=>l!==n);return r?i:i[0]??null}clearAll(e){return e?[]:null}toggleSelection(e,n,r){const s=e.includes(n);return r?s?e.filter(i=>i!==n):[...e,n]:s?[]:[n]}isValidSelection(e,n){return n?Array.isArray(e):e===null||typeof e=="string"}isEmpty(e){return e?Array.isArray(e)?e.length===0:!1:!0}}class ule{constructor(e){St(this,"selectionDecider",new cle);this.deps=e}getState(){const{repo:e,presenter:n,value:r,multiple:s,targetContentType:i}=this.deps,l=n.getState(),u=e.getContents(),p=e.getPrivate(),f=new Set(u.map(j=>j.contentId)),m=p.filter(j=>!f.has(j.contentId)),g=[...u,...m].sort((j,D)=>j.title.localeCompare(D.title,"ja")),y=l.searchQuery,v=y.trim()?g.filter(j=>j.title.toLowerCase().includes(y.toLowerCase())||j.contentId.toLowerCase().includes(y.toLowerCase())):g,C=new Map;g.forEach(j=>C.set(j.contentId,j.title));const S=this.selectionDecider.toArray(r);return{allContents:g,filteredContents:v,contentIdToTitle:C,selectedContentIds:S,isLoading:e.isLoading(),isError:e.isError(),dialogOpen:l.dialogOpen,searchQuery:l.searchQuery,tempSelection:l.tempSelection,targetContentType:i,multiple:s}}openDialog(){const e=this.getState();this.deps.presenter.openDialog(e.selectedContentIds)}closeDialog(){this.deps.presenter.closeDialog()}setSearchQuery(e){this.deps.presenter.setSearchQuery(e)}toggleSelection(e){this.deps.presenter.toggleSelection(e,this.deps.multiple)}confirm(){const{onChange:e,multiple:n}=this.deps,r=this.deps.presenter.getState().tempSelection,s=this.selectionDecider.confirmSelection(r,n);e(s),this.deps.presenter.closeDialog()}removeItem(e){const{onChange:n,multiple:r,value:s}=this.deps,i=this.selectionDecider.removeItem(s,e,r);n(i)}clearAll(){const{onChange:e,multiple:n}=this.deps,r=this.selectionDecider.clearAll(n);e(r)}}function dle(t){const{targetContentType:e,value:n,onChange:r,multiple:s}=t,{authUseCase:i}=rr(),{branchUseCase:l}=Ei(),{token:u}=i.getState(),p=(l==null?void 0:l.getCurrentBranch())??"develop",f=new M1({contents:jn(M1.ContentsQueryParams(u,e,p)),private:jn(M1.PrivateQueryParams(u,e,p))}),m=lle();return{relationFieldUseCase:new ule({repo:f,presenter:m,value:n,onChange:r,multiple:s,targetContentType:e})}}function ple({label:t,value:e,onChange:n,required:r,description:s,targetContentType:i,multiple:l,disabled:u=!1}){const{relationFieldUseCase:p}=dle({targetContentType:i,value:e,onChange:n,multiple:l}),{filteredContents:f,contentIdToTitle:m,selectedContentIds:g,isLoading:y,isError:v,dialogOpen:C,searchQuery:S,tempSelection:j}=p.getState();return a.jsxs(vo,{label:t,required:r,description:s,disabled:u,children:[a.jsxs(B,{children:[g.length>0?a.jsx(B,{sx:{display:"flex",flexWrap:"wrap",gap:1,mb:1},children:g.map(D=>a.jsx(Ht,{label:m.get(D)??D,onDelete:()=>p.removeItem(D),icon:a.jsx(j2,{}),variant:"outlined"},D))}):a.jsx(G,{variant:"body2",color:"primary",sx:{mb:1},children:"未選択"}),a.jsxs(B,{sx:{display:"flex",gap:1},children:[a.jsx(pe,{variant:"outlined",size:"small",onClick:()=>p.openDialog(),disabled:!i,children:"選択"}),g.length>0&&a.jsx(pe,{variant:"text",size:"small",color:"error",onClick:()=>p.clearAll(),children:"クリア"})]}),!i&&a.jsx(zt,{severity:"warning",sx:{mt:1},children:"targetContentType が設定されていません"})]}),a.jsxs(Qt,{open:C,onClose:()=>p.closeDialog(),maxWidth:"sm",fullWidth:!0,children:[a.jsxs(Yt,{children:[t,"を選択",l&&"(複数可)"]}),a.jsxs(Jt,{dividers:!0,children:[a.jsx(Xe,{fullWidth:!0,size:"small",placeholder:"タイトルまたはIDで検索...",value:S,onChange:D=>p.setSearchQuery(D.target.value),InputProps:{startAdornment:a.jsx(c2,{position:"start",children:a.jsx(Om,{})})},sx:{mb:2}}),y&&a.jsx(B,{sx:{display:"flex",justifyContent:"center",py:4},children:a.jsx(ut,{})}),v&&a.jsx(zt,{severity:"error",children:"コンテンツの取得に失敗しました"}),!y&&!v&&a.jsx(a.Fragment,{children:f.length===0?a.jsx(G,{color:"text.secondary",sx:{py:2,textAlign:"center"},children:S?"該当するコンテンツがありません":"コンテンツがありません"}):a.jsx(as,{sx:{maxHeight:400,overflow:"auto"},children:f.map(D=>{const M=j.includes(D.contentId);return a.jsxs(os,{onClick:()=>p.toggleSelection(D.contentId),selected:M,children:[a.jsx(Un,{children:l?a.jsx(es,{edge:"start",checked:M,tabIndex:-1,disableRipple:!0}):a.jsx(PG,{edge:"start",checked:M,tabIndex:-1,disableRipple:!0})}),a.jsx(Zn,{primary:D.title,secondary:a.jsxs(B,{component:"span",sx:{display:"flex",gap:1,alignItems:"center"},children:[a.jsx(G,{variant:"caption",color:"text.secondary",children:D.contentId}),a.jsx(Ht,{label:D.status==="published"?"公開":"下書き",size:"small",color:D.status==="published"?"success":"default",sx:{height:20,fontSize:"0.7rem"}})]})})]},D.contentId)})})})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>p.closeDialog(),children:"キャンセル"}),a.jsx(pe,{onClick:()=>p.confirm(),variant:"contained",children:"決定"})]})]})]})}function fle({label:t,value:e,onChange:n,required:r,description:s,itemType:i,minItems:l,maxItems:u,uploadedBy:p,disabled:f=!1}){const m=e??[],g=()=>{if(u&&m.length>=u)return;const T=i==="text"?"":null;n([...m,T])},y=T=>{l&&m.length<=l||n(m.filter((E,k)=>k!==T))},v=T=>{if(T===0)return;const E=[...m];[E[T-1],E[T]]=[E[T],E[T-1]],n(E)},C=T=>{if(T===m.length-1)return;const E=[...m];[E[T],E[T+1]]=[E[T+1],E[T]],n(E)},S=(T,E)=>{const k=[...m];k[T]=E,n(k)},j=(T,E)=>{switch(i){case"text":return a.jsx(Xe,{value:T??"",onChange:k=>S(E,k.target.value),size:"small",fullWidth:!0,placeholder:`アイテム ${E+1}`});case"image":return a.jsx(g4,{label:"",value:T,onChange:k=>S(E,k),uploadedBy:p});case"file":return a.jsx(y4,{label:"",value:T,onChange:k=>S(E,k),uploadedBy:p});default:return a.jsx(Xe,{value:String(T??""),onChange:k=>S(E,k.target.value),size:"small",fullWidth:!0})}},D=!u||m.length<u,M=!l||m.length>l;return a.jsx(vo,{label:t,required:r,description:s,disabled:f,labelSuffix:u?a.jsxs(G,{component:"span",variant:"caption",color:"text.secondary",children:["(",m.length,"/",u,")"]}):void 0,children:a.jsxs(B,{children:[m.length===0?a.jsx(G,{variant:"body2",color:"primary",sx:{mb:1},children:"アイテムがありません"}):a.jsx(Ro,{spacing:1,sx:{mb:1},children:m.map((T,E)=>a.jsxs($t,{variant:"outlined",sx:{p:1,display:"flex",alignItems:"flex-start",gap:1},children:[a.jsx(B,{sx:{flex:1},children:j(T,E)}),a.jsxs(Ro,{direction:"row",spacing:.5,sx:{flexShrink:0},children:[a.jsx(ft,{size:"small",onClick:()=>v(E),disabled:E===0,title:"上へ移動",children:a.jsx(TP,{fontSize:"small"})}),a.jsx(ft,{size:"small",onClick:()=>C(E),disabled:E===m.length-1,title:"下へ移動",children:a.jsx(w2,{fontSize:"small"})}),a.jsx(ft,{size:"small",onClick:()=>y(E),disabled:!M,color:"error",title:"削除",children:a.jsx(zn,{fontSize:"small"})})]})]},E))}),a.jsx(pe,{variant:"outlined",size:"small",startIcon:a.jsx(Qn,{}),onClick:g,disabled:!D,children:"追加"}),u&&m.length>=u&&a.jsx(G,{variant:"caption",color:"text.secondary",sx:{ml:1},children:"最大数に達しました"})]})})}function hle({open:t,draftAge:e,onRecover:n,onDiscard:r}){return a.jsxs(Qt,{open:t,onClose:r,children:[a.jsx(Yt,{children:"前回の変更を復元しますか?"}),a.jsx(Jt,{children:a.jsxs(Eo,{children:["保存されていない編集内容が見つかりました(",e,")。 この変更を復元しますか?"]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:r,children:"破棄する"}),a.jsx(pe,{onClick:n,variant:"contained",children:"復元する"})]})]})}function mle({contentTypeId:t,contentId:e,content:n,basePath:r,onPulled:s,disabled:i=!1}){const{branchUseCase:l}=Ei(),u=l==null?void 0:l.getState(),[p,f]=b.useState(!1),[m,g]=b.useState(!1),[y,v]=b.useState(null),[C,S]=b.useState(null),[j,D]=b.useState(!1),M=b.useRef(null);if(b.useEffect(()=>{if(!l||!u||u.branchType==="develop")return;const I=JSON.stringify(n);if(M.current===I)return;M.current=I,(async()=>{D(!0);try{const R=await l.isSameAsDevelop({contentTypeId:t,contentId:e,content:n,basePath:r});S(R)}catch{S(!1)}finally{D(!1)}})()},[l,u,t,e,n,r]),!u||u.branchType==="develop")return null;const T=()=>{v(null),f(!0)},E=async()=>{if(l){g(!0),v(null);try{await l.pullContentFromDevelop({contentTypeId:t,contentId:e,basePath:r}),f(!1),s==null||s()}catch(I){v(I instanceof Error?I.message:"エラーが発生しました")}finally{g(!1)}}},k=i||m||j||C===!0,A=j?a.jsx(ut,{size:16}):C?a.jsx(Ph,{}):m?a.jsx(ut,{size:16}):a.jsx(AJ,{}),O=C?"最新":"共有ブランチから取り込む";return a.jsxs(a.Fragment,{children:[a.jsx(Er,{title:C?"共有ブランチと同じ内容です":"",children:a.jsx("span",{children:a.jsx(pe,{variant:"outlined",color:C?"inherit":"secondary",startIcon:A,onClick:T,disabled:k,children:O})})}),a.jsxs(Qt,{open:p,onClose:()=>f(!1),children:[a.jsx(Yt,{children:"共有ブランチから取り込む"}),a.jsxs(Jt,{children:[a.jsxs(Eo,{children:["このコンテンツを共有ブランチの内容で上書きしますか?",a.jsx("br",{}),a.jsx("strong",{children:"個人ブランチでの変更は失われます。"})]}),y&&a.jsx(zt,{severity:"error",sx:{mt:2},children:y})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>f(!1),disabled:m,children:"キャンセル"}),a.jsx(pe,{onClick:E,color:"warning",variant:"contained",disabled:m,startIcon:m?a.jsx(ut,{size:16}):void 0,children:"上書きして取り込む"})]})]})]})}const v4="fieldGroup:";function gle(t){try{const e=localStorage.getItem(`${v4}${t}`);return e===null?!1:e==="true"}catch{return!1}}function yle(t,e){try{localStorage.setItem(`${v4}${t}`,String(e))}catch{}}function vle({name:t,children:e}){const[n,r]=b.useState(()=>gle(t));return b.useEffect(()=>{yle(t,n)},[t,n]),a.jsxs(_s,{expanded:n,onChange:(s,i)=>r(i),sx:{mt:3,mb:2,"&:before":{display:"none"},boxShadow:"none",border:"1px solid",borderColor:"divider",borderRadius:1,"&.Mui-expanded":{margin:0,mt:3,mb:2}},children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),sx:{backgroundColor:"grey.50",borderRadius:n?"4px 4px 0 0":1,minHeight:48,"&.Mui-expanded":{minHeight:48}},children:a.jsx(G,{variant:"subtitle1",fontWeight:600,children:t})}),a.jsx(Is,{sx:{pt:2},children:a.jsx(B,{sx:{display:"flex",flexDirection:"column",gap:2},children:e})})]})}const jA=(t,e,n)=>{if(t&&"reportValidity"in t){const r=rt(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},cw=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?jA(r.ref,n,t):r&&r.refs&&r.refs.forEach(s=>jA(s,n,t))}},TA=(t,e)=>{e.shouldUseNativeValidation&&cw(t,e);const n={};for(const r in t){const s=rt(e.fields,r),i=Object.assign(t[r]||{},{ref:s&&s.ref});if(xle(e.names||Object.keys(t),r)){const l=Object.assign({},rt(n,r));Bn(l,"root",i),Bn(n,r,l)}else Bn(n,r,i)}return n},xle=(t,e)=>{const n=DA(e);return t.some(r=>DA(r).match(`^${n}\\.\\d+`))};function DA(t){return t.replace(/\]|\[/g,"")}function x4(t,e,n){function r(u,p){var f;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(f=u._zod).traits??(f.traits=new Set),u._zod.traits.add(t),e(u,p);for(const m in l.prototype)m in u||Object.defineProperty(u,m,{value:l.prototype[m].bind(u)});u._zod.constr=l,u._zod.def=p}const s=(n==null?void 0:n.Parent)??Object;class i extends s{}Object.defineProperty(i,"name",{value:t});function l(u){var p;const f=n!=null&&n.Parent?new i:this;r(f,u),(p=f._zod).deferred??(p.deferred=[]);for(const m of f._zod.deferred)m();return f}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:u=>{var p,f;return n!=null&&n.Parent&&u instanceof n.Parent?!0:(f=(p=u==null?void 0:u._zod)==null?void 0:p.traits)==null?void 0:f.has(t)}}),Object.defineProperty(l,"name",{value:t}),l}class ble extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Sle={};function b4(t){return Sle}function Cle(t,e){return typeof e=="bigint"?e.toString():e}const S4=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};function zy(t){return typeof t=="string"?t:t==null?void 0:t.message}function C4(t,e,n){var s,i,l,u,p,f;const r={...t,path:t.path??[]};if(!t.message){const m=zy((l=(i=(s=t.inst)==null?void 0:s._zod.def)==null?void 0:i.error)==null?void 0:l.call(i,t))??zy((u=e==null?void 0:e.error)==null?void 0:u.call(e,t))??zy((p=n.customError)==null?void 0:p.call(n,t))??zy((f=n.localeError)==null?void 0:f.call(n,t))??"Invalid input";r.message=m}return delete r.inst,delete r.continue,e!=null&&e.reportInput||delete r.input,r}const w4=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,Cle,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},wle=x4("$ZodError",w4),j4=x4("$ZodError",w4,{Parent:Error}),jle=t=>(e,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},l=e._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw new ble;if(l.issues.length){const u=new((s==null?void 0:s.Err)??t)(l.issues.map(p=>C4(p,i,b4())));throw S4(u,s==null?void 0:s.callee),u}return l.value},Tle=jle(j4),Dle=t=>async(e,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let l=e._zod.run({value:n,issues:[]},i);if(l instanceof Promise&&(l=await l),l.issues.length){const u=new((s==null?void 0:s.Err)??t)(l.issues.map(p=>C4(p,i,b4())));throw S4(u,s==null?void 0:s.callee),u}return l.value},Ele=Dle(j4);function EA(t,e){try{var n=t()}catch(r){return e(r)}return n&&n.then?n.then(void 0,e):n}function Rle(t,e){for(var n={};t.length;){var r=t[0],s=r.code,i=r.message,l=r.path.join(".");if(!n[l])if("unionErrors"in r){var u=r.unionErrors[0].errors[0];n[l]={message:u.message,type:u.code}}else n[l]={message:i,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(m){return m.errors.forEach(function(g){return t.push(g)})}),e){var p=n[l].types,f=p&&p[r.code];n[l]=Q2(l,e,n,s,f?[].concat(f,r.message):r.message)}t.shift()}return n}function kle(t,e){for(var n={};t.length;){var r=t[0],s=r.code,i=r.message,l=r.path.join(".");if(!n[l])if(r.code==="invalid_union"&&r.errors.length>0){var u=r.errors[0][0];n[l]={message:u.message,type:u.code}}else n[l]={message:i,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(m){return m.forEach(function(g){return t.push(g)})}),e){var p=n[l].types,f=p&&p[r.code];n[l]=Q2(l,e,n,s,f?[].concat(f,r.message):r.message)}t.shift()}return n}function Mle(t,e,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(t))return function(r,s,i){try{return Promise.resolve(EA(function(){return Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(l){return i.shouldUseNativeValidation&&cw({},i),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(u){return Array.isArray(u==null?void 0:u.issues)})(l))return{values:{},errors:TA(Rle(l.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(t))return function(r,s,i){try{return Promise.resolve(EA(function(){return Promise.resolve((n.mode==="sync"?Tle:Ele)(t,r,e)).then(function(l){return i.shouldUseNativeValidation&&cw({},i),{errors:{},values:n.raw?Object.assign({},r):l}})},function(l){if((function(u){return u instanceof wle})(l))return{values:{},errors:TA(kle(l.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}function Ole(t,e){const n={};for(const r of t){const s=e.find(l=>l.key===r.key);let i=Ale(r,s);s!=null&&s.required||(i=i.optional()),n[r.key]=i}return Tr.object(n)}function Ale(t,e){switch(t.type){case"text":case"html":case"markdown":return RA(e);case"number":return _le(e);case"boolean":return Tr.boolean();case"date":return RA(e);case"image":case"file":return Tr.object({uuid:Tr.string(),url:Tr.string(),originalName:Tr.string()}).nullable();case"select":return Ile(t,e);case"relation":return t.multiple?Tr.array(Tr.string()):Tr.string().nullable();case"array":return Tr.array(Tr.unknown());case"label":return Tr.unknown().optional();default:return Tr.unknown()}}function RA(t){let e=Tr.string();if(t!=null&&t.required&&(e=e.min(1,"この項目は必須です")),t!=null&&t.pattern){const n=new RegExp(t.pattern),r=t.patternMessage??`パターン「${t.pattern}」に一致しません`;e=e.regex(n,r)}return e}function _le(t){return Tr.preprocess(e=>{if(e===""||e===null||e===void 0)return;const n=Number(e);return isNaN(n)?e:n},t!=null&&t.required?Tr.number({invalid_type_error:"数値を入力してください"}):Tr.number().optional())}function Ile(t,e){var r,s;const n=((s=(r=t.options)==null?void 0:r.choices)==null?void 0:s.map(i=>i.value))??[];if(n.length>0){const i=e!=null&&e.required?n:["",...n];return Tr.enum(i)}return Tr.string()}function Ple(t,e,n){const r={};for(const s of t){const i=e.find(l=>l.key===s.key);if(n&&s.key in n){r[s.key]=n[s.key];continue}if((i==null?void 0:i.defaultValue)!==void 0&&i.defaultValue!==null){r[s.key]=i.defaultValue;continue}r[s.key]=Lle(s)}return r}function Lle(t){switch(t.type){case"text":case"html":case"markdown":case"date":case"select":return"";case"number":return"";case"boolean":return!1;case"image":case"file":return null;case"relation":return t.multiple?[]:null;case"array":return[];case"label":return;default:return null}}class zle{constructor(e){this.deps=e}async saveContent(e){var r;const n=await this.deps.saveUseCase.execute(e,this.deps.branch);return await((r=this.deps.branchUseCase)==null?void 0:r.refreshDiffAfterSave()),n}async setStatusContent(e){var n;await this.deps.setStatusUseCase.execute(e,this.deps.branch),await((n=this.deps.branchUseCase)==null?void 0:n.refreshDiffAfterSave())}async deleteContent(e){var n;await this.deps.deleteUseCase.execute(e,this.deps.branch),await((n=this.deps.branchUseCase)==null?void 0:n.refreshDiffAfterSave())}async fetchContent(e,n,r){return this.deps.fetchUseCase.execute(e,n,r??this.deps.branch)}}class $le{constructor(e){this.client=e}async fetchIndex(e,n,r){oe.debug("GitHubContentRepositoryImpl.fetchIndex",{basePath:e,contentTypeId:n,branch:r});const s=Ah(e,n);return this.client.fetchJsonOrDefault(s,[],r)}async fetchViewIndex(e,n,r,s){oe.debug("GitHubContentRepositoryImpl.fetchViewIndex",{basePath:e,contentTypeId:n,viewId:r,branch:s});const i=Ql(e,n,r,null);return this.client.fetchJsonOrDefault(i,[],s)}async fetchContent(e,n,r,s){oe.debug("GitHubContentRepositoryImpl.fetchContent",{basePath:e,contentTypeId:n,contentId:r,branch:s});const i=Oh(e,n,r),l=await this.client.fetchFileOrNull(i,s);return l?JSON.parse(l):null}async commitFiles(e,n,r){return oe.info("GitHubContentRepositoryImpl.commitFiles",{message:e,fileCount:n.length,branch:r}),this.client.commitFiles(e,n,r)}async fetchContentType(e,n){oe.debug("GitHubContentRepositoryImpl.fetchContentType",{contentTypeId:e,branch:n});const r=Kl(e),s=await this.client.fetchFileOrNull(r,n);return s?JSON.parse(s):null}async fetchViews(e,n){oe.debug("GitHubContentRepositoryImpl.fetchViews",{contentTypeId:e,branch:n});const r=sc(e),s=await this.client.fetchFileOrNull(r,n);return s?JSON.parse(s):null}async fetchJson(e,n){return oe.debug("GitHubContentRepositoryImpl.fetchJson",{path:e,branch:n}),this.client.fetchJson(e,n)}}function ej(t,e){return{readJson:async n=>{try{return await t.fetchJson(n,e)}catch{return null}}}}function T4(t){const{contentId:e,title:n,status:r,formData:s,existingContent:i,createdBy:l,updatedBy:u,now:p,publishedAt:f}=t;return{contentId:e,title:n,status:r,data:s,createdAt:(i==null?void 0:i.createdAt)??p,updatedAt:p,publishedAt:f??(i==null?void 0:i.publishedAt)??null,createdBy:(i==null?void 0:i.createdBy)??l,updatedBy:u}}function Nle(){return crypto.randomUUID()}class tj{decide(e,n,r,s){const i=e??"draft";switch(n){case"save":return this.decideSave(i);case"publish":return this.decidePublish(i,r);case"unpublish":return this.decideUnpublish(i);case"delete":return this.decideDelete(i);case"setStatus":if(!s)throw new Error("setStatus action requires params with targetStatus");return this.decideSetStatus(i,s.targetStatus,r)}}decideSave(e){return{newStatus:e,basePath:this.getBasePath(e),publishedAt:void 0,deleteSourcePath:!1,sourceBasePath:null}}decidePublish(e,n){const r=e!=="published";return{newStatus:"published",basePath:"published",publishedAt:n,deleteSourcePath:r,sourceBasePath:r?"private":null}}decideUnpublish(e){const n=e==="published";return{newStatus:"draft",basePath:"private",publishedAt:null,deleteSourcePath:n,sourceBasePath:n?"published":null}}decideDelete(e){return{newStatus:e,basePath:this.getBasePath(e),publishedAt:void 0,deleteSourcePath:!1,sourceBasePath:null}}decideSetStatus(e,n,r){if(e===n)return{newStatus:n,basePath:this.getBasePath(n),publishedAt:void 0,deleteSourcePath:!1,sourceBasePath:null};const s=this.getBasePath(e),i=this.getBasePath(n),l=s!==i;let u;return n==="published"?u=r:e==="published"?u=null:u=void 0,{newStatus:n,basePath:i,publishedAt:u,deleteSourcePath:l,sourceBasePath:l?s:null}}getBasePath(e){return e==="published"?"published":"private"}canExecute(e,n){switch(n){case"save":return!0;case"publish":return!0;case"unpublish":return e==="published";case"delete":return!0;case"setStatus":return!0}}}class Fle{constructor(e){St(this,"statusDecider",new tj);this.contentRepository=e}async execute(e,n){const{contentTypeId:r,contentId:s,formData:i,existingContent:l,createdBy:u,targetStatus:p}=e;oe.info("SaveContentUseCase.execute",{contentTypeId:r,contentId:s,branch:n,targetStatus:p});const f=new Date().toISOString(),m=s??Nle(),y=s===null&&p?this.statusDecider.decide(null,"setStatus",f,{targetStatus:p}):this.statusDecider.decide((l==null?void 0:l.status)??null,"save",f),v=T4({contentId:m,title:i.title||"Untitled",status:y.newStatus,formData:i,existingContent:l,createdBy:u,updatedBy:u,now:f}),C=ej(this.contentRepository,n),S=[{path:Oh(y.basePath,r,m),content:JSON.stringify(v,null,2)}],j=await sP(C,{basePath:y.basePath,contentTypeId:r,content:v});S.push(...j);const D=await lP(C,{contentTypeId:r,updatedBy:u,oldStatus:(l==null?void 0:l.status)??null,newStatus:y.newStatus});return S.push(D),await this.contentRepository.commitFiles(`保存: ${r}/${m}`,S,n),oe.info("SaveContentUseCase.execute completed",{contentId:m,branch:n}),{contentId:m}}}class Ble{constructor(e){St(this,"statusDecider",new tj);this.contentRepository=e}async execute(e,n){const{contentTypeId:r,contentId:s,status:i}=e;oe.info("DeleteContentUseCase.execute",{contentTypeId:r,contentId:s,status:i,branch:n});const l=this.statusDecider.getBasePath(i),u=ej(this.contentRepository,n),p=[{path:Oh(l,r,s),content:"",delete:!0}],f=await iP(u,{basePath:l,contentTypeId:r,contentId:s});p.push(...f);const m=await oQ(u,{contentTypeId:r,deletedBy:"system",deletedStatus:i});p.push(m),await this.contentRepository.commitFiles(`削除: ${r}/${s}`,p,n),oe.info("DeleteContentUseCase.execute completed",{contentId:s,branch:n})}}class Ule{constructor(e){this.contentRepository=e}async execute(e,n,r){oe.debug("FetchContentUseCase.execute",{contentTypeId:e,contentId:n,branch:r});const s=await this.contentRepository.fetchIndex("published",e,r),i=await this.contentRepository.fetchIndex("private",e,r),l=s.some(p=>p.contentId===n),u=i.some(p=>p.contentId===n);if(l){const p=await this.contentRepository.fetchContent("published",e,n,r);if(p)return p}if(u){const p=await this.contentRepository.fetchContent("private",e,n,r);if(p)return p}throw oe.warn("FetchContentUseCase.execute","Content not found",{contentTypeId:e,contentId:n,branch:r}),new Error("Content not found")}}class Vle{constructor(e){St(this,"statusDecider",new tj);this.contentRepository=e}async execute(e,n){const{contentTypeId:r,contentId:s,formData:i,existingContent:l,createdBy:u,targetStatus:p}=e;oe.info("SetContentVisibilityUseCase.execute",{contentTypeId:r,contentId:s,targetStatus:p,branch:n});const f=new Date().toISOString(),m=this.statusDecider.decide((l==null?void 0:l.status)??null,"setStatus",f,{targetStatus:p}),g=m.publishedAt===void 0?(l==null?void 0:l.publishedAt)??null:m.publishedAt,y=T4({contentId:s,title:i.title||"Untitled",status:m.newStatus,formData:i,existingContent:l,createdBy:u,updatedBy:u,now:f,publishedAt:g}),v=ej(this.contentRepository,n),C=[{path:Oh(m.basePath,r,s),content:JSON.stringify(y,null,2)}],S=await sP(v,{basePath:m.basePath,contentTypeId:r,content:y});if(C.push(...S),m.deleteSourcePath&&m.sourceBasePath){const M=await iP(v,{basePath:m.sourceBasePath,contentTypeId:r,contentId:s});C.push(...M),C.push({path:Oh(m.sourceBasePath,r,s),content:"",delete:!0})}const j=await lP(v,{contentTypeId:r,updatedBy:u,oldStatus:(l==null?void 0:l.status)??null,newStatus:m.newStatus});C.push(j);const D=this.getCommitMessage(p,r,s);await this.contentRepository.commitFiles(D,C,n),oe.info("SetContentVisibilityUseCase.execute completed",{contentId:s,targetStatus:p,branch:n})}getCommitMessage(e,n,r){switch(e){case"published":return`公開: ${n}/${r}`;case"unpublished":return`非公開化: ${n}/${r}`;case"draft":return`下書き化: ${n}/${r}`}}}function Hle(t){const{isProcessing:e}=t;return d_({shouldBlockFn:()=>e,withResolver:!1,disabled:!e}),b.useEffect(()=>{if(!e)return;const n=r=>(r.preventDefault(),r.returnValue="","");return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[e]),{isLocked:e}}const Wle="frelio_draft_";function qle(t,e){return`${Wle}${t}_${e}`}function Gle(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),s=Math.floor(r/6e4);if(s<1)return"たった今";if(s<60)return`${s}分前`;const i=Math.floor(s/60);return i<24?`${i}時間前`:`${Math.floor(i/24)}日前`}function Zle(t){const{contentTypeId:e,contentId:n,debounceMs:r=2e3}=t,s=qle(e,n),i=b.useRef(null),[l,u]=b.useState(!1),[p,f]=b.useState(null);b.useEffect(()=>{try{const C=localStorage.getItem(s);if(C){const S=JSON.parse(C);f(S),u(!0)}}catch{localStorage.removeItem(s)}},[s]);const m=b.useCallback(C=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{const S={data:C,savedAt:new Date().toISOString()};try{localStorage.setItem(s,JSON.stringify(S)),f(S)}catch(j){oe.error("useLocalDraft.saveDraft","Failed to save draft to localStorage",{error:j})}},r)},[s,r]),g=b.useCallback(()=>{i.current&&clearTimeout(i.current),localStorage.removeItem(s),f(null),u(!1)},[s]),y=b.useCallback(()=>(u(!1),(p==null?void 0:p.data)??null),[p]),v=b.useCallback(()=>{g(),u(!1)},[g]);return b.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),{savedDraft:p,saveDraft:m,clearDraft:g,hasDraft:p!==null,draftAge:p?Gle(p.savedAt):null,showRecoveryDialog:l,acceptDraft:y,rejectDraft:v}}class $y{constructor(e){this.queries=e}static ContentTypeQueryParams(e,n,r){return{queryKey:["content-type",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).fetchJson(Kl(n),r)},enabled:!!e}}static UiQueryParams(e,n,r){return{queryKey:["content-type-ui",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");return new At(e).fetchJson(Ld(n),r)},enabled:!!e}}static ContentQueryParams(e,n,r,s,i,l){return{queryKey:["content",n,r,i],queryFn:()=>l(n,r,i),enabled:!!e&&!s}}getContentType(){return this.queries.contentType.data}getUiMeta(){return this.queries.ui.data}getContentData(){return this.queries.content.data}isLoading(){return this.queries.contentType.isLoading||this.queries.ui.isLoading||this.queries.content.isLoading}getError(){return this.queries.contentType.error||this.queries.ui.error||this.queries.content.error}async refetchContent(){await this.queries.content.refetch()}}class kd{constructor(e){this.mutations=e}static SaveMutationParams(e,n){return{mutationFn:n,onMutate:()=>{e.presenter.setMessage(null)},onSuccess:async r=>{e.localDraft.clearDraft(),e.unsavedGuard.setJustSaved(),e.queryClient.invalidateQueries({queryKey:["view-index","published",e.contentTypeId]}),e.queryClient.invalidateQueries({queryKey:["view-index","private",e.contentTypeId]}),e.isNew?e.navigate({to:`/contents/${e.contentTypeId}`,ignoreBlocker:!0}):(await e.refetchContent(),e.presenter.setMessage({type:"success",text:"保存しました"}))},onError:r=>{e.presenter.setMessage({type:"error",text:`保存に失敗しました: ${r.message}`})}}}static DeleteMutationParams(e,n){return{mutationFn:n,onMutate:()=>{e.presenter.setMessage(null)},onSuccess:()=>{e.localDraft.clearDraft(),e.unsavedGuard.setJustSaved(),e.queryClient.invalidateQueries({queryKey:["view-index","published",e.contentTypeId]}),e.queryClient.invalidateQueries({queryKey:["view-index","private",e.contentTypeId]}),e.navigate({to:`/contents/${e.contentTypeId}`,ignoreBlocker:!0})},onError:r=>{e.presenter.setMessage({type:"error",text:`削除に失敗しました: ${r.message}`})}}}static SetStatusMutationParams(e,n){return{mutationFn:n,onMutate:()=>{e.presenter.setMessage(null)},onSuccess:async(r,s)=>{e.localDraft.clearDraft(),e.unsavedGuard.setJustSaved(),e.queryClient.invalidateQueries({queryKey:["view-index","published",e.contentTypeId]}),e.queryClient.invalidateQueries({queryKey:["view-index","private",e.contentTypeId]}),await e.refetchContent();const i=kd.getStatusChangeMessage(s.targetStatus);e.presenter.setMessage({type:"success",text:i})},onError:r=>{e.presenter.setMessage({type:"error",text:`ステータス変更に失敗しました: ${r.message}`})}}}static getStatusChangeMessage(e){switch(e){case"published":return"公開しました";case"unpublished":return"非公開にしました";case"draft":return"下書きにしました"}}async save(e){await this.mutations.save.mutateAsync(e)}isSaving(){return this.mutations.save.isPending}async delete(){await this.mutations.delete.mutateAsync()}isDeleting(){return this.mutations.delete.isPending}async setStatus(e){await this.mutations.setStatus.mutateAsync(e)}isSettingStatus(){return this.mutations.setStatus.isPending}isProcessing(){return this.isSaving()||this.isDeleting()||this.isSettingStatus()}}const ui=Zre(t=>({deleteDialogOpen:!1,message:null,pendingStatus:null,editorMode:"ui",jsonEditText:"",jsonIsDirty:!1,tabSwitchDialogOpen:!1,pendingTabSwitch:null,openDeleteDialog:()=>t({deleteDialogOpen:!0}),closeDeleteDialog:()=>t({deleteDialogOpen:!1}),setMessage:e=>t({message:e}),clearMessage:()=>t({message:null}),setPendingStatus:e=>t({pendingStatus:e}),clearPendingStatus:()=>t({pendingStatus:null}),setEditorMode:e=>t({editorMode:e}),setJsonEditText:e=>t({jsonEditText:e}),setJsonIsDirty:e=>t({jsonIsDirty:e}),openTabSwitchDialog:e=>t({tabSwitchDialogOpen:!0,pendingTabSwitch:e}),closeTabSwitchDialog:()=>t({tabSwitchDialogOpen:!1,pendingTabSwitch:null})}));class Kle{getState(){const e=ui.getState();return{deleteDialogOpen:e.deleteDialogOpen,message:e.message,pendingStatus:e.pendingStatus,editorMode:e.editorMode,jsonEditText:e.jsonEditText,jsonIsDirty:e.jsonIsDirty,tabSwitchDialogOpen:e.tabSwitchDialogOpen,pendingTabSwitch:e.pendingTabSwitch}}subscribe(e){return ui.subscribe(e)}openDeleteDialog(){ui.getState().openDeleteDialog()}closeDeleteDialog(){ui.getState().closeDeleteDialog()}setMessage(e){ui.getState().setMessage(e)}clearMessage(){ui.getState().clearMessage()}setPendingStatus(e){ui.getState().setPendingStatus(e)}clearPendingStatus(){ui.getState().clearPendingStatus()}setEditorMode(e){ui.getState().setEditorMode(e)}setJsonEditText(e){ui.getState().setJsonEditText(e)}setJsonIsDirty(e){ui.getState().setJsonIsDirty(e)}openTabSwitchDialog(e){ui.getState().openTabSwitchDialog(e)}closeTabSwitchDialog(){ui.getState().closeTabSwitchDialog()}}class Qle{constructor(e){this.deps=e}getState(){const{repo:e,mutationRepo:n,presenter:r,form:s,localDraft:i,unsavedGuard:l,contentTypeId:u,contentId:p,isNew:f,githubUser:m,canEdit:g}=this.deps,y=r.getState(),v=e.getContentData(),C=f?y.pendingStatus??"draft":(v==null?void 0:v.status)??"draft",S=f?e.isLoading()&&!e.getContentType():e.isLoading(),j=n.isSaving(),D=n.isDeleting(),M=n.isSettingStatus(),T=j||D||M,E=D?"削除中...":M?"ステータス変更中...":"保存中...";return{contentTypeId:u,contentId:p,isNew:f,contentType:e.getContentType(),uiMeta:e.getUiMeta(),contentData:v,isLoading:S,error:e.getError(),deleteDialogOpen:y.deleteDialogOpen,message:y.message,currentStatus:C,isDirty:s.formState.isDirty,isValid:s.formState.isValid,isSaving:j,isDeleting:D,isSettingStatus:M,isProcessing:T,processingMessage:E,form:s,unsavedGuard:l,localDraft:i,uploadedBy:(m==null?void 0:m.login)??"unknown",editorMode:y.editorMode,jsonEditText:y.jsonEditText,jsonIsDirty:y.jsonIsDirty,tabSwitchDialogOpen:y.tabSwitchDialogOpen,pendingTabSwitch:y.pendingTabSwitch,canEdit:g}}save(){const{form:e,mutationRepo:n}=this.deps;e.handleSubmit(r=>{n.save({formData:r})})()}setStatus(e){const{form:n,mutationRepo:r,presenter:s,isNew:i}=this.deps;i?s.setPendingStatus(e):n.handleSubmit(l=>{r.setStatus({formData:l,targetStatus:e})})()}delete(){const{mutationRepo:e,presenter:n}=this.deps;e.delete(),n.closeDeleteDialog()}recoverDraft(){const{localDraft:e,form:n}=this.deps,r=e.acceptDraft();r&&n.reset(r)}openDeleteDialog(){this.deps.presenter.openDeleteDialog()}closeDeleteDialog(){this.deps.presenter.closeDeleteDialog()}clearMessage(){this.deps.presenter.clearMessage()}getUserDisplayName(e){const n=this.deps.users.find(r=>r.githubUsername===e);return(n==null?void 0:n.displayName)??e}prepareJsonForMode(e){const{presenter:n,repo:r,form:s,isNew:i,githubUser:l,contentTypeId:u,contentId:p}=this.deps,{jsonEditText:f}=n.getState(),m=r.getContentData();if(e==="json"&&!f){if(i){const g=s.getValues(),y=new Date().toISOString(),v={contentId:p==="new"?"(自動生成)":p,title:g.title||"",status:"draft",data:this.extractDataFields(g),createdAt:y,updatedAt:y,publishedAt:null,createdBy:(l==null?void 0:l.login)??"unknown",updatedBy:(l==null?void 0:l.login)??"unknown"};n.setJsonEditText(JSON.stringify(v,null,2))}else m&&n.setJsonEditText(JSON.stringify(m,null,2));n.setJsonIsDirty(!1)}n.setEditorMode(e)}extractDataFields(e){const{title:n,...r}=e;return r}updateJsonText(e){this.deps.presenter.setJsonEditText(e),this.deps.presenter.setJsonIsDirty(!0)}formatJson(){const{presenter:e}=this.deps,{jsonEditText:n}=e.getState();try{const r=JSON.parse(n),s=JSON.stringify(r,null,2);e.setJsonEditText(s)}catch{e.setMessage({type:"error",text:"JSONのフォーマットに失敗しました(構文エラー)"})}}resetJson(){const{presenter:e,repo:n,form:r,isNew:s,githubUser:i,contentId:l}=this.deps,u=n.getContentData();if(s){const p=r.getValues(),f=new Date().toISOString(),m={contentId:l==="new"?"(自動生成)":l,title:p.title||"",status:"draft",data:this.extractDataFields(p),createdAt:f,updatedAt:f,publishedAt:null,createdBy:(i==null?void 0:i.login)??"unknown",updatedBy:(i==null?void 0:i.login)??"unknown"};e.setJsonEditText(JSON.stringify(m,null,2))}else u&&e.setJsonEditText(JSON.stringify(u,null,2));e.setJsonIsDirty(!1),e.setMessage({type:"info",text:"JSONを元に戻しました"})}async saveFromJson(){const{presenter:e,mutationRepo:n,form:r,isNew:s,contentId:i}=this.deps,{jsonEditText:l}=e.getState(),u=Na(l);if(!u.success)return e.setMessage({type:"error",text:`JSONの構文エラー: ${u.error}`}),!1;const p=u.data,f={title:p.title,...p.data};try{return r.reset(f,{keepDirty:!1}),await n.save({formData:f}),e.setJsonIsDirty(!1),e.setMessage({type:"success",text:"コンテンツを保存しました"}),oe.info("ContentEditUseCase.saveFromJson",{contentId:i}),!0}catch(m){const g=m instanceof Error?m.message:String(m);return e.setMessage({type:"error",text:`保存に失敗しました: ${g}`}),oe.error("ContentEditUseCase.saveFromJson failed",{error:m}),!1}}cancelTabSwitch(){this.deps.presenter.closeTabSwitchDialog()}discardAndSwitchTab(){const{presenter:e}=this.deps,{pendingTabSwitch:n}=e.getState();n&&(e.setJsonIsDirty(!1),e.closeTabSwitchDialog(),this.prepareJsonForMode(n))}async saveAndSwitchTab(){const{presenter:e}=this.deps,{pendingTabSwitch:n,editorMode:r}=e.getState();if(n){if(r==="json"){if(!await this.saveFromJson())return}else this.save();e.closeTabSwitchDialog(),this.prepareJsonForMode(n)}}}const po=new Kle;function Jle(t){const{authUseCase:e}=rr(),{branchUseCase:n}=Ei(),{token:r,githubUser:s,users:i,currentUser:l}=e.getState(),u=ws(l,"canEditContent"),p=(n==null?void 0:n.getCurrentBranch())??"develop",f=ys(),m=ur(),{contentTypeId:g,contentId:y}=uc({from:"/contents/$contentTypeId/$contentId"}),v=y==="new",C=t==null?void 0:t.duplicateFrom;b.useSyncExternalStore(po.subscribe.bind(po),()=>JSON.stringify(po.getState()));const S=b.useMemo(()=>{if(!r)return null;const J=new At(r),ie=new $le(J);return new zle({saveUseCase:new Fle(ie),setStatusUseCase:new Vle(ie),deleteUseCase:new Ble(ie),fetchUseCase:new Ule(ie),branchUseCase:n,branch:p})},[r,n,p]),j=jn($y.ContentTypeQueryParams(r,g,p)),D=jn($y.UiQueryParams(r,g,p)),M=b.useCallback(async(J,ie,te)=>{if(!S)throw new Error("Not authenticated");return S.fetchContent(J,ie,te)},[S]),T=jn($y.ContentQueryParams(r,g,y,v,p,M)),E=jn({queryKey:["content",g,C,p,"duplicate-source"],queryFn:()=>M(g,C,p),enabled:!!r&&v&&!!C}),k=new $y({contentType:j,ui:D,content:T}),A=k.getContentType(),O=k.getUiMeta(),I=k.getContentData(),$=b.useMemo(()=>!A||!O?null:Ole(A.fields,O.fields),[A,O]),R=Jae({defaultValues:{},resolver:$?Mle($):void 0,mode:"onBlur"}),{formState:{isDirty:P}}=R,z=Zle({contentTypeId:g,contentId:y}),N=Um({isDirty:P}),H=b.useCallback(async()=>{await k.refetchContent()},[k]),U=b.useMemo(()=>({queryClient:f,contentTypeId:g,isNew:v,presenter:po,localDraft:z,unsavedGuard:N,navigate:J=>m({to:J.to,ignoreBlocker:J.ignoreBlocker}),refetchContent:H}),[f,g,v,z,N,m,H]),L=b.useCallback(async J=>{if(!s||!S)throw new Error("Not authenticated");const ie=po.getState().pendingStatus,te=await S.saveContent({contentTypeId:g,contentId:v?null:y,formData:J.formData,existingContent:I??null,createdBy:s.login,targetStatus:v?ie??void 0:void 0});return v&&ie&&po.clearPendingStatus(),{contentId:te.contentId}},[s,S,g,y,v,I]),W=b.useCallback(async()=>{if(!S)throw new Error("Not authenticated");await S.deleteContent({contentTypeId:g,contentId:y,status:(I==null?void 0:I.status)??"draft"})},[S,g,y,I==null?void 0:I.status]),K=b.useCallback(async J=>{if(!s||!S)throw new Error("Not authenticated");await S.setStatusContent({contentTypeId:g,contentId:y,formData:J.formData,existingContent:I??null,createdBy:s.login,targetStatus:J.targetStatus})},[s,S,g,y,I]),Q=new kd({save:Pn(kd.SaveMutationParams(U,L)),delete:Pn(kd.DeleteMutationParams({...U,contentTypeId:g},W)),setStatus:Pn(kd.SetStatusMutationParams({...U,contentTypeId:g},K))});Hle({isProcessing:Q.isProcessing()});const le=new Qle({repo:k,mutationRepo:Q,presenter:po,form:R,localDraft:z,unsavedGuard:N,contentTypeId:g,contentId:y,isNew:v,githubUser:s,users:i,canEdit:u}),F=b.useRef(!1);return b.useEffect(()=>{if(!A||!O||F.current||!v&&!I||v&&C&&!E.data)return;let J;if(!v&&I)J={...I.data,title:I.title};else if(v&&C&&E.data){const te=E.data;J={...te.data,title:te.title};for(const de of A.fields)de.useAsUrl&&J[de.key]!==void 0&&(J[de.key]="")}const ie=Ple(A.fields,O.fields,J);R.reset(ie),F.current=!0,setTimeout(()=>{R.trigger()},0)},[A,O,I,v,R,C,E.data]),b.useEffect(()=>{if(!P)return;const J=R.watch(ie=>{z.saveDraft(ie)});return()=>J.unsubscribe()},[P,R,z]),b.useEffect(()=>{po.clearMessage(),po.clearPendingStatus(),po.setJsonEditText(""),po.setJsonIsDirty(!1)},[y]),{contentEditUseCase:le}}function Yle(t,e,n=[]){const r=new Map(e.map(f=>[f.key,f])),s=new Map(t.map(f=>[f.key,f])),i=new Set(t.filter(f=>{const m=r.get(f.key);return!(m!=null&&m.hidden)}).map(f=>f.key)),l=new Set(n.flatMap(f=>f.fieldKeys)),u=[],p=[];for(const f of t)!l.has(f.key)&&i.has(f.key)&&p.push({field:f,uiField:r.get(f.key)});p.length>0&&u.push({id:null,label:null,fields:p});for(const f of n){const m=[];for(const g of f.fieldKeys){const y=s.get(g);y&&i.has(g)&&m.push({field:y,uiField:r.get(g)})}m.length>0&&u.push({id:f.id,label:f.label,fields:m})}return u}function Xle(t,e){switch(e){case"trim":return t.trim();case"lowercase":return t.toLowerCase();case"uppercase":return t.toUpperCase();case"slug":return ece(t);case"phone":return tce(t);case"postalCode":return nce(t);default:return t}}function ece(t){return t.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function tce(t){const e=t.replace(/\D/g,"");return e.length===11&&/^0[5789]0/.test(e)?`${e.slice(0,3)}-${e.slice(3,7)}-${e.slice(7)}`:e.length===10&&/^0[1-9]/.test(e)?/^0[36]/.test(e)?`${e.slice(0,2)}-${e.slice(2,6)}-${e.slice(6)}`:`${e.slice(0,3)}-${e.slice(3,6)}-${e.slice(6)}`:e.length===10&&/^0(120|800)/.test(e)?`${e.slice(0,4)}-${e.slice(4,7)}-${e.slice(7)}`:t}function nce(t){const e=t.replace(/\D/g,"");return e.length===7?`${e.slice(0,3)}-${e.slice(3)}`:t}const rce=["ui","json"],sce=Ss("/contents/$contentTypeId/$contentId")({component:oce,validateSearch:t=>({mode:rce.includes(t.mode)?t.mode:void 0,duplicateFrom:typeof t.duplicateFrom=="string"?t.duplicateFrom:void 0})}),ice=[{label:"UI編集",value:"ui"},{label:"JSON編集",value:"json"}];function oce(){const t=ur(),e=Di({from:"/contents/$contentTypeId/$contentId"}),n=e.mode??"ui",{contentEditUseCase:r}=Jle({duplicateFrom:e.duplicateFrom}),{contentTypeId:s,contentId:i,isNew:l,contentType:u,uiMeta:p,contentData:f,isLoading:m,error:g,deleteDialogOpen:y,message:v,currentStatus:C,isDirty:S,isValid:j,isSaving:D,isDeleting:M,isSettingStatus:T,isProcessing:E,processingMessage:k,form:A,unsavedGuard:O,localDraft:I,uploadedBy:$,jsonEditText:R,jsonIsDirty:P,tabSwitchDialogOpen:z,canEdit:N}=r.getState();b.useEffect(()=>{r.prepareJsonForMode(n)},[r,n,f]);const H=le=>{r.setStatus(le)},U=(p==null?void 0:p.label)??s,W={value:n,options:ice,onChange:le=>{t({to:".",search:{...e,mode:le==="ui"?void 0:le},replace:!0})}},Q=`frelio-data/site/contents/${C==="published"?"published":"private"}/${s}/${i}.json`;return m?a.jsx(B,{"data-component-name":"cmp:ContentEditPageLoading",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})}):g?a.jsx(B,{"data-component-name":"cmp:ContentEditPageError",sx:{flex:1,overflow:"auto",p:3},children:a.jsxs(zt,{severity:"error",children:["Error: ",g.message]})}):n==="json"?a.jsxs(B,{"data-component-name":"cmp:ContentEditPage",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[a.jsx(B,{sx:{px:3,pt:2,flexShrink:0},children:a.jsx(no,{items:[{label:`${U}一覧`,to:`/contents/${s}`},{label:l?"新規作成":`${U}詳細`}],dropdown:W})}),a.jsxs(B,{"data-component-name":"cmp:JsonEditorContainer",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",maxWidth:"xl",mx:"auto",width:"100%"},children:[a.jsx(rm,{filePath:l?"(新規作成)":Q,isSaving:D,isDirty:P,onFormat:N?()=>r.formatJson():void 0,onReset:N?()=>r.resetJson():void 0,onSave:N?()=>r.saveFromJson():void 0,readOnly:!N}),a.jsx(B,{"data-component-name":"cmp:JsonEditorWrapper",sx:{flex:1,overflow:"hidden",pb:1},children:a.jsx(nm,{value:R,onChange:N?le=>r.updateJsonText(le):void 0,height:"100%",readOnly:!N})})]}),a.jsx(nb,{open:z,onStay:()=>r.cancelTabSwitch(),onDiscard:()=>r.discardAndSwitchTab(),onSaveAndSwitch:()=>r.saveAndSwitchTab()}),v&&a.jsx(zt,{severity:v.type==="info"?"info":v.type,sx:{position:"fixed",bottom:16,left:"50%",transform:"translateX(-50%)",zIndex:1400},onClose:()=>r.clearMessage(),children:v.text})]}):a.jsxs(B,{"data-component-name":"cmp:ContentEditPage",sx:{flex:1,overflow:"auto",p:3},children:[a.jsx(no,{items:[{label:`${U}一覧`,to:`/contents/${s}`},{label:l?"新規作成":`${U}詳細`}],dropdown:W}),a.jsx(la,{titleNode:a.jsx(G,{variant:"h5",component:"h1",sx:{wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",minWidth:0,flex:1},children:l?"新規作成":String(A.watch("title")||"Untitled")}),actions:N?a.jsxs(a.Fragment,{children:[!l&&a.jsx(pe,{variant:"outlined",color:"error",startIcon:a.jsx(zn,{}),onClick:()=>r.openDeleteDialog(),disabled:M,children:"削除"}),a.jsx(pe,{variant:"outlined",startIcon:a.jsx(na,{}),onClick:()=>r.save(),disabled:D||!S||!j,children:D?"保存中...":"保存"}),a.jsxs(_n,{size:"small",sx:{minWidth:120},children:[a.jsx(nr,{id:"status-select-label",children:"ステータス"}),a.jsxs(wn,{labelId:"status-select-label",value:C,label:"ステータス",onChange:le=>H(le.target.value),disabled:T,children:[a.jsx(nt,{value:"draft",children:"下書き"}),a.jsx(nt,{value:"unpublished",children:"非公開"}),a.jsx(nt,{value:"published",children:"公開"})]})]}),!l&&r.getState().contentData&&a.jsx(mle,{contentTypeId:s,contentId:r.getState().contentId,content:r.getState().contentData,basePath:C==="published"?"published":"private",onPulled:()=>{O.setJustSaved(),window.location.reload()},disabled:D||T})]}):a.jsx(G,{variant:"body2",color:"text.secondary",children:"閲覧のみ"})}),v&&a.jsx(zt,{severity:v.type,sx:{mb:2},onClose:()=>r.clearMessage(),children:v.text}),a.jsxs(Qt,{"data-component-name":"cmp:DeleteContentDialog",open:y,onClose:()=>r.closeDeleteDialog(),children:[a.jsx(Yt,{children:"コンテンツを削除"}),a.jsx(Jt,{children:a.jsxs(Eo,{children:["「",String(A.watch("title")||"Untitled"),"」を削除しますか?この操作は取り消せません。"]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>r.closeDeleteDialog(),children:"キャンセル"}),a.jsx(pe,{color:"error",onClick:()=>r.delete(),disabled:M,children:M?"削除中...":"削除"})]})]}),!l&&r.getState().contentData&&a.jsx(cce,{contentData:r.getState().contentData,getUserDisplayName:le=>r.getUserDisplayName(le)}),a.jsx("form",{"data-component-name":"cmp:ContentEditForm",children:a.jsx(Ro,{"data-component-name":"cmp:FieldList",spacing:3,children:u&&p&&a.jsx(ace,{fields:u.fields,uiFields:p.fields,uiGroups:p.groups??[],form:A,uploadedBy:$,readOnly:!N,isNew:l})})}),a.jsx(sb,{open:O.isBlocked,onStay:O.reset,onLeave:O.proceed}),a.jsx(hle,{open:I.showRecoveryDialog,draftAge:I.draftAge,onRecover:()=>r.recoverDraft(),onDiscard:I.rejectDraft}),a.jsx(Yae,{open:E,message:k})]})}function ace({fields:t,uiFields:e,uiGroups:n,form:r,uploadedBy:s,readOnly:i=!1,isNew:l}){const u=vr(),p=aa(u.breakpoints.down("sm")),f=Yle(t,e,n),m=g=>{const y=[];return g.forEach(({field:v,uiField:C})=>{const S=(C==null?void 0:C.columns)??12,j=(C==null?void 0:C.break)??!1;y.push(a.jsx(Et,{item:!0,xs:12,md:S,children:a.jsx(lce,{field:v,uiField:C,form:r,uploadedBy:s,forceReadOnly:i,isNew:l})},v.key)),j&&!p&&y.push(a.jsx(Et,{item:!0,xs:12,sx:{p:"0 !important",height:0}},`${v.key}-break`))}),y};return a.jsx(Ro,{spacing:3,children:f.map((g,y)=>g.id===null?a.jsx(B,{sx:{overflow:"hidden"},children:a.jsx(Et,{container:!0,spacing:3,children:m(g.fields)})},"ungrouped"):a.jsx(vle,{name:g.label??g.id,children:a.jsx(B,{sx:{overflow:"hidden"},children:a.jsx(Et,{container:!0,spacing:3,children:m(g.fields)})})},g.id??`group-${y}`))})}function lce({field:t,uiField:e,form:n,uploadedBy:r,forceReadOnly:s=!1,isNew:i}){const l=(e==null?void 0:e.label)??t.key,u=(e==null?void 0:e.required)??!1,p=(e==null?void 0:e.description)??void 0,f=(e==null?void 0:e.placeholder)??void 0,m=!i&&(t.useAsUrl??!1),g=s||((e==null?void 0:e.readOnly)??!1)||m,y=e==null?void 0:e.warnLength,v=m?a.jsx(Er,{title:"URL に使用されるフィールドのため、新規作成以降は変更できません。変更したい場合はコンテンツを複製してください。",arrow:!0,children:a.jsx(ft,{size:"small",sx:{p:0,ml:.5},children:a.jsx(WJ,{sx:{fontSize:16,color:"text.secondary"}})})}):void 0,C=e==null?void 0:e.autoFormat,S=n.formState.errors[t.key],j=!!S,D=j?S.message:void 0,M=async(T,E)=>{if(C&&typeof T=="string"){const k=Xle(T,C);k!==T&&E(k)}await n.trigger(t.key)};switch(t.type){case"text":return a.jsx(uo,{name:t.key,control:n.control,defaultValue:"",render:({field:T})=>a.jsx(vo,{label:l,labelSuffix:v,required:u,description:p,error:D,warnLength:y?{value:String(T.value??""),limit:y}:void 0,disabled:g,children:a.jsx(Xe,{...T,placeholder:f,fullWidth:!0,size:"small",disabled:g,error:j,value:T.value??"",onBlur:E=>{T.onBlur(),M(E.target.value,T.onChange)}})})});case"html":case"markdown":return a.jsx(uo,{name:t.key,control:n.control,defaultValue:"",render:({field:T})=>a.jsx(vo,{label:l,labelSuffix:v,required:u,description:p??(t.type==="markdown"?"Markdown形式で入力":"HTML形式で入力"),error:D,warnLength:y?{value:String(T.value??""),limit:y}:void 0,disabled:g,children:a.jsx(Xe,{...T,placeholder:f,fullWidth:!0,multiline:!0,minRows:6,size:"small",disabled:g,error:j,value:T.value??""})})});case"number":return a.jsx(uo,{name:t.key,control:n.control,defaultValue:"",render:({field:T})=>a.jsx(vo,{label:l,labelSuffix:v,required:u,description:p,error:D,disabled:g,children:a.jsx(Xe,{...T,type:"number",placeholder:f,fullWidth:!0,size:"small",disabled:g,error:j,value:T.value??"",onChange:E=>T.onChange(E.target.value?Number(E.target.value):"")})})});case"boolean":return a.jsx(vo,{label:l,labelSuffix:v,description:p,error:D,disabled:g,children:a.jsx(uo,{name:t.key,control:n.control,defaultValue:!1,render:({field:T})=>a.jsx(Ax,{checked:!!T.value,onChange:E=>T.onChange(E.target.checked),disabled:g})})});case"date":return a.jsx(uo,{name:t.key,control:n.control,defaultValue:"",render:({field:T})=>a.jsx(vo,{label:l,labelSuffix:v,required:u,description:p,error:D,disabled:g,children:a.jsx(Xe,{...T,type:"date",fullWidth:!0,size:"small",disabled:g,error:j,value:T.value??""})})});case"select":return a.jsx(uo,{name:t.key,control:n.control,defaultValue:"",render:({field:T})=>{var E,k;return a.jsx(vo,{label:l,labelSuffix:v,required:u,description:p,error:D,disabled:g,children:a.jsxs(wn,{...T,value:T.value??"",disabled:g,size:"small",fullWidth:!0,error:j,children:[a.jsx(nt,{value:"",children:a.jsx("em",{children:"選択してください"})}),(k=(E=t.options)==null?void 0:E.choices)==null?void 0:k.map(A=>a.jsx(nt,{value:A.value,children:A.label},A.value))]})})}});case"image":return a.jsx(uo,{name:t.key,control:n.control,defaultValue:null,render:({field:T})=>a.jsx(g4,{label:l,value:T.value,onChange:T.onChange,required:u,description:p??void 0,uploadedBy:r,aspectRatio:e==null?void 0:e.aspectRatio,disabled:g})});case"file":return a.jsx(uo,{name:t.key,control:n.control,defaultValue:null,render:({field:T})=>a.jsx(y4,{label:l,value:T.value,onChange:T.onChange,required:u,description:p??void 0,uploadedBy:r,disabled:g})});case"relation":return a.jsx(uo,{name:t.key,control:n.control,defaultValue:t.multiple?[]:null,render:({field:T})=>{var E;return a.jsx(ple,{label:l,value:T.value,onChange:T.onChange,required:u,description:p??void 0,targetContentType:((E=t.options)==null?void 0:E.targetContentType)??"",multiple:t.multiple,disabled:g})}});case"array":return a.jsx(uo,{name:t.key,control:n.control,defaultValue:[],render:({field:T})=>{var E,k,A;return a.jsx(fle,{label:l,value:T.value??[],onChange:T.onChange,required:u,description:p??void 0,itemType:((E=t.options)==null?void 0:E.itemType)??"text",minItems:(k=t.options)==null?void 0:k.minItems,maxItems:(A=t.options)==null?void 0:A.maxItems,uploadedBy:r,disabled:g})}});case"label":return a.jsxs($t,{variant:"outlined",sx:{p:2,bgcolor:"grey.50",borderStyle:"dashed"},children:[a.jsx(G,{variant:"subtitle1",fontWeight:600,sx:{color:(e==null?void 0:e.labelColor)??"text.primary",mb:p?.5:0},children:l}),p&&a.jsx(G,{variant:"body1",sx:{color:e!=null&&e.labelColor?e.labelColor:"text.secondary","& a":{color:"primary.main"}},children:a.jsx(m4,{text:p})})]});default:return a.jsx(uo,{name:t.key,control:n.control,defaultValue:"",render:({field:T})=>a.jsx(vo,{label:`${l} (${t.type})`,description:`Field type "${t.type}" is not fully implemented yet`,error:D,children:a.jsx(Xe,{...T,fullWidth:!0,size:"small",error:j,value:T.value??""})})})}}function cce({contentData:t,getUserDisplayName:e}){const n=r=>{if(!r)return"-";try{return new Date(r).toLocaleString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return r}};return a.jsx(B,{sx:{mb:3},children:a.jsxs(_s,{disableGutters:!0,elevation:0,sx:{"&:before":{display:"none"},bgcolor:"transparent",width:"fit-content"},children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{fontSize:"small"}),sx:{minHeight:"auto",p:0,justifyContent:"flex-start","& .MuiAccordionSummary-content":{m:0,flexGrow:0}},children:a.jsxs(G,{variant:"caption",color:"text.secondary",children:["作成日 ",n(t.createdAt)]})}),a.jsx(Is,{sx:{p:0,pt:1},children:a.jsxs(B,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr 1fr"},gap:2},children:[a.jsxs(B,{children:[a.jsx(G,{variant:"caption",color:"text.secondary",children:"更新日"}),a.jsx(G,{variant:"body2",children:n(t.updatedAt)})]}),a.jsxs(B,{children:[a.jsx(G,{variant:"caption",color:"text.secondary",children:"作成者"}),a.jsx(G,{variant:"body2",children:t.createdBy?e(t.createdBy):"-"})]}),a.jsxs(B,{children:[a.jsx(G,{variant:"caption",color:"text.secondary",children:"更新者"}),a.jsx(G,{variant:"body2",children:t.updatedBy?e(t.updatedBy):"-"})]})]})})]})})}const kA=[{value:"eq",label:"="},{value:"neq",label:"!="},{value:"in",label:"in"},{value:"nin",label:"not in"},{value:"contains",label:"含む"},{value:"startsWith",label:"前方一致"},{value:"endsWith",label:"後方一致"}],uce=[{key:"contentId",type:"text"},{key:"status",type:"select"},{key:"createdAt",type:"date"},{key:"updatedAt",type:"date"},{key:"publishedAt",type:"date"},{key:"createdBy",type:"text"},{key:"updatedBy",type:"text"}];function dce({column:t,index:e,columnsLength:n,onUpdateColumn:r,onRemoveColumn:s}){const{attributes:i,listeners:l,setNodeRef:u,transform:p,transition:f,isDragging:m}=eb({id:t.field}),g={transform:sa.Transform.toString(p),transition:f,opacity:m?.5:1};return a.jsxs(B,{ref:u,style:g,sx:{display:"flex",alignItems:"center",gap:1,p:1,borderBottom:1,borderColor:"divider",bgcolor:"background.paper","&:last-child":{borderBottom:0}},children:[a.jsx(B,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},...i,...l,children:a.jsx(wu,{fontSize:"small",color:"action"})}),a.jsx(Ht,{label:t.field,size:"small",variant:"outlined",sx:{minWidth:80}}),a.jsx(Xe,{size:"small",variant:"standard",value:t.label,onChange:y=>r(e,{label:y.target.value}),placeholder:"ラベル",sx:{flex:1,minWidth:80}}),a.jsx(Xe,{size:"small",variant:"standard",value:t.width??"",onChange:y=>r(e,{width:y.target.value||void 0}),placeholder:"幅",sx:{width:60}}),a.jsx(ft,{size:"small",onClick:()=>s(e),disabled:n<=1,children:a.jsx(zn,{fontSize:"small"})})]})}function pce({column:t}){return a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,p:1,bgcolor:"background.paper",boxShadow:3,borderRadius:1},children:[a.jsx(wu,{fontSize:"small",color:"action"}),a.jsx(Ht,{label:t.field,size:"small",variant:"outlined"}),a.jsx(G,{variant:"body2",children:t.label})]})}function fce({view:t,availableFields:e,open:n,onClose:r,onUpdate:s,onAddColumn:i,onUpdateColumn:l,onRemoveColumn:u,onReorderColumns:p,onAddFilter:f,onUpdateFilter:m,onRemoveFilter:g,onSetDefaultSort:y}){var H;const[v,C]=b.useState(""),[S,j]=b.useState(""),[D,M]=b.useState("eq"),[T,E]=b.useState(""),[k,A]=b.useState(null),O=Lm(Do(Tu,{activationConstraint:{distance:8}}),Do(v5,{activationConstraint:{delay:100,tolerance:8}}),Do(ju,{coordinateGetter:Fm}));if(!t)return null;const I=[...e.map(U=>({key:U.key,type:U.type})),...uce],$=I.filter(U=>!t.columns.some(L=>L.field===U.key)),R=()=>{v&&(i({field:v,label:v,sortable:!0}),C(""))},P=()=>{S&&(f({field:S,operator:D,value:T}),j(""),M("eq"),E(""))},z=U=>{const L=t.columns.find(W=>W.field===U.active.id);A(L??null)},N=U=>{const{active:L,over:W}=U;if(A(null),!W||L.id===W.id)return;const K=t.columns.findIndex(le=>le.field===L.id),Q=t.columns.findIndex(le=>le.field===W.id);K!==-1&&Q!==-1&&p(K,Q)};return a.jsx(Cu,{anchor:"right",open:n,onClose:r,PaperProps:{sx:{width:{xs:"100%",sm:500}}},children:a.jsxs(B,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[a.jsx(Dp,{title:"ビュー編集",onClose:r,componentName:"cmp:ViewEditorDrawerHeader"}),a.jsxs(B,{sx:{flex:1,overflow:"auto",p:2},children:[a.jsxs(B,{"data-component-name":"cmp:ViewBasicSettings",sx:{mb:3},children:[a.jsx(G,{variant:"subtitle2",gutterBottom:!0,children:"基本設定"}),a.jsx(Xe,{fullWidth:!0,size:"small",label:"ビューID",value:t.id,disabled:!0,sx:{mb:2}}),a.jsx(Xe,{fullWidth:!0,size:"small",label:"ラベル",value:t.label,onChange:U=>s({label:U.target.value})})]}),a.jsx(wo,{sx:{my:2}}),a.jsxs(B,{"data-component-name":"cmp:ViewColumnSettings",sx:{mb:3},children:[a.jsx(G,{variant:"subtitle2",gutterBottom:!0,children:"列設定(ドラッグで並び替え)"}),a.jsx($t,{variant:"outlined",sx:{mb:2},children:a.jsxs($m,{sensors:O,collisionDetection:Kx,onDragStart:z,onDragEnd:N,children:[a.jsx(Nm,{items:t.columns.map(U=>U.field),strategy:V2,children:t.columns.map((U,L)=>a.jsx(dce,{column:U,index:L,columnsLength:t.columns.length,onUpdateColumn:l,onRemoveColumn:u},U.field))}),a.jsx(B2,{children:k?a.jsx(pce,{column:k}):null})]})}),a.jsxs(B,{sx:{display:"flex",gap:1},children:[a.jsxs(_n,{size:"small",sx:{flex:1},children:[a.jsx(nr,{children:"フィールド追加"}),a.jsx(wn,{value:v,label:"フィールド追加",onChange:U=>C(U.target.value),children:$.map(U=>a.jsx(nt,{value:U.key,children:U.key},U.key))})]}),a.jsx(pe,{variant:"outlined",startIcon:a.jsx(Qn,{}),onClick:R,disabled:!v,children:"追加"})]})]}),a.jsx(wo,{sx:{my:2}}),a.jsxs(B,{"data-component-name":"cmp:ViewSortSettings",sx:{mb:3},children:[a.jsx(G,{variant:"subtitle2",gutterBottom:!0,children:"デフォルトソート"}),a.jsxs(B,{sx:{display:"flex",gap:1},children:[a.jsxs(_n,{size:"small",sx:{flex:1},children:[a.jsx(nr,{children:"フィールド"}),a.jsxs(wn,{value:((H=t.defaultSort)==null?void 0:H.field)??"",label:"フィールド",onChange:U=>{var L;U.target.value?y({field:U.target.value,direction:((L=t.defaultSort)==null?void 0:L.direction)??"desc"}):y(void 0)},children:[a.jsx(nt,{value:"",children:"なし"}),t.columns.map(U=>a.jsx(nt,{value:U.field,children:U.label},U.field))]})]}),t.defaultSort&&a.jsxs(_n,{size:"small",sx:{width:120},children:[a.jsx(nr,{children:"方向"}),a.jsxs(wn,{value:t.defaultSort.direction,label:"方向",onChange:U=>y({...t.defaultSort,direction:U.target.value}),children:[a.jsx(nt,{value:"asc",children:"昇順"}),a.jsx(nt,{value:"desc",children:"降順"})]})]})]})]}),a.jsx(wo,{sx:{my:2}}),a.jsxs(B,{"data-component-name":"cmp:ViewFilterSettings",children:[a.jsx(G,{variant:"subtitle2",gutterBottom:!0,children:"フィルター"}),t.filters&&t.filters.length>0&&a.jsx($t,{variant:"outlined",sx:{mb:2},children:t.filters.map((U,L)=>a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,p:1,borderBottom:1,borderColor:"divider","&:last-child":{borderBottom:0}},children:[a.jsx(Ht,{label:U.field,size:"small",variant:"outlined"}),a.jsx(wn,{size:"small",variant:"standard",value:U.operator,onChange:W=>m(L,{operator:W.target.value}),sx:{minWidth:80},children:kA.map(W=>a.jsx(nt,{value:W.value,children:W.label},W.value))}),a.jsx(Xe,{size:"small",variant:"standard",value:String(U.value??""),onChange:W=>m(L,{value:W.target.value}),sx:{flex:1}}),a.jsx(ft,{size:"small",onClick:()=>g(L),children:a.jsx(zn,{fontSize:"small"})})]},L))}),a.jsxs(B,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:[a.jsxs(_n,{size:"small",sx:{minWidth:120},children:[a.jsx(nr,{children:"フィールド"}),a.jsx(wn,{value:S,label:"フィールド",onChange:U=>j(U.target.value),children:I.map(U=>a.jsx(nt,{value:U.key,children:U.key},U.key))})]}),a.jsxs(_n,{size:"small",sx:{minWidth:100},children:[a.jsx(nr,{children:"演算子"}),a.jsx(wn,{value:D,label:"演算子",onChange:U=>M(U.target.value),children:kA.map(U=>a.jsx(nt,{value:U.value,children:U.label},U.value))})]}),a.jsx(Xe,{size:"small",label:"値",value:T,onChange:U=>E(U.target.value),sx:{width:100}}),a.jsx(pe,{variant:"outlined",startIcon:a.jsx(Qn,{}),onClick:P,disabled:!S,children:"追加"})]})]})]})]})})}function hce({open:t,existingIds:e,onClose:n,onSubmit:r}){const[s,i]=b.useState(""),[l,u]=b.useState(""),p=()=>{i(""),u(""),n()},f=()=>{!s.trim()||!l.trim()||(r({id:s.trim(),label:l.trim()}),p())},m=s.trim()!==""&&!e.includes(s.trim()),g=l.trim()!=="",y=m&&g;return a.jsxs(Qt,{open:t,onClose:p,maxWidth:"xs",fullWidth:!0,children:[a.jsx(Yt,{children:"ビューを追加"}),a.jsx(Jt,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[a.jsx(Xe,{autoFocus:!0,label:"ビューID",value:s,onChange:v=>i(v.target.value.replace(/[^a-zA-Z0-9_-]/g,"")),placeholder:"例: published, drafts",helperText:e.includes(s.trim())?"このIDは既に使用されています":"英数字、ハイフン、アンダースコアのみ",error:s.trim()!==""&&e.includes(s.trim()),fullWidth:!0}),a.jsx(Xe,{label:"ラベル",value:l,onChange:v=>u(v.target.value),placeholder:"例: 公開済み、下書き一覧",fullWidth:!0})]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:p,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:f,disabled:!y,children:"追加"})]})]})}function mce({open:t,viewLabel:e,onClose:n,onDelete:r}){return a.jsxs(Qt,{open:t,onClose:n,maxWidth:"xs",fullWidth:!0,children:[a.jsx(Yt,{children:"ビューを削除"}),a.jsx(Jt,{children:a.jsxs(Eo,{children:["ビュー「",e,"」を削除しますか?この操作は元に戻せません。"]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:n,children:"キャンセル"}),a.jsx(pe,{variant:"contained",color:"error",onClick:r,children:"削除"})]})]})}function gce({useCase:t,editorMode:e,canEdit:n=!0}){const r=t.getState();b.useEffect(()=>{t.prepareJsonForMode(e)},[t,e,r.editingViews.length]);const{contentTypeId:s,editingViews:i,defaultViewId:l,selectedViewId:u,selectedView:p,availableFields:f,isSaving:m,isDirty:g,message:y,addViewDialogOpen:v,deleteViewDialogOpen:C,unsavedGuard:S,jsonViewsText:j,jsonViewsIsDirty:D,tabSwitchDialogOpen:M}=r,T=()=>a.jsxs(B,{"data-component-name":"cmp:JsonViewsEditorContainer",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",maxWidth:"xl",mx:"auto",width:"100%"},children:[a.jsx(rm,{filePath:`frelio-data/admin/content_types/${s}.views.json`,isSaving:m,isDirty:D,onFormat:n?()=>t.formatJson():void 0,onReset:n?()=>t.resetJson():void 0,onSave:n?()=>t.saveFromJson():void 0,readOnly:!n}),a.jsx(B,{"data-component-name":"cmp:JsonViewsEditorWrapper",sx:{flex:1,overflow:"hidden",pb:1},children:a.jsx(nm,{value:j,onChange:n?k=>t.updateJsonViewsText(k):void 0,height:"100%",readOnly:!n})})]}),E=()=>a.jsx(B,{"data-component-name":"cmp:UiEditorContainer",sx:{flex:1,overflow:"auto"},children:a.jsxs(ji,{maxWidth:"md",sx:{py:3},children:[a.jsx(la,{title:"ビュー設定",actions:n&&a.jsx(pe,{variant:"contained",startIcon:m?a.jsx(ut,{size:20,color:"inherit"}):a.jsx(na,{}),onClick:()=>t.save(),disabled:!g||m,children:m?"保存中...":"保存"})}),a.jsx($t,{sx:{p:2,mb:3},children:a.jsxs(_n,{fullWidth:!0,size:"small",disabled:!n,children:[a.jsx(nr,{children:"デフォルトビュー"}),a.jsx(wn,{value:l,label:"デフォルトビュー",onChange:k=>t.setDefaultView(k.target.value),children:i.map(k=>a.jsx(nt,{value:k.id,children:k.label},k.id))})]})}),a.jsx(B,{"data-component-name":"cmp:ViewsList",sx:{display:"flex",flexDirection:"column",gap:2},children:i.map(k=>{const A=k.id===l;return a.jsxs($t,{"data-component-name":"cmp:ViewCard",sx:{p:2,display:"flex",alignItems:"center",gap:2,...A&&{borderLeft:4,borderColor:"primary.main"}},children:[a.jsx(ft,{size:"small",onClick:n?()=>t.setDefaultView(k.id):void 0,color:A?"primary":"default",title:A?"デフォルトビュー":"デフォルトに設定",disabled:!n,children:A?a.jsx(MP,{}):a.jsx(TY,{})}),a.jsxs(B,{sx:{flex:1},children:[a.jsx(G,{variant:"subtitle1",fontWeight:"medium",children:k.label}),a.jsxs(B,{sx:{display:"flex",gap:1,mt:.5,flexWrap:"wrap"},children:[a.jsx(Ht,{label:`ID: ${k.id}`,size:"small",variant:"outlined"}),a.jsx(Ht,{label:`${k.columns.length} 列`,size:"small"}),k.filters&&k.filters.length>0&&a.jsx(Ht,{label:`${k.filters.length} フィルター`,size:"small",color:"info"}),k.defaultSort&&a.jsx(Ht,{label:`ソート: ${k.defaultSort.field} (${k.defaultSort.direction})`,size:"small",color:"secondary"})]})]}),n&&a.jsxs(B,{sx:{display:"flex",gap:1},children:[a.jsx(ft,{size:"small",onClick:()=>t.selectView(k.id),title:"編集",children:a.jsx(Ri,{})}),a.jsx(ft,{size:"small",onClick:()=>{t.selectView(k.id),t.openDeleteViewDialog()},title:"削除",disabled:i.length<=1,children:a.jsx(zn,{})})]})]},k.id)})}),n&&a.jsx(B,{sx:{display:"flex",justifyContent:"center",mt:3},children:a.jsx(pe,{variant:"outlined",startIcon:a.jsx(Qn,{}),onClick:()=>t.openAddViewDialog(),children:"ビューを追加"})})]})});return a.jsxs(B,{"data-component-name":"cmp:ViewsEditor",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e==="ui"&&E(),e==="json"&&T(),a.jsx(fce,{view:p,availableFields:f,open:u!==null&&!C,onClose:()=>t.clearSelection(),onUpdate:k=>t.updateCurrentView(k),onAddColumn:k=>t.addColumn(k),onUpdateColumn:(k,A)=>t.updateColumn(k,A),onRemoveColumn:k=>t.removeColumn(k),onReorderColumns:(k,A)=>t.reorderColumns(k,A),onAddFilter:k=>t.addFilter(k),onUpdateFilter:(k,A)=>t.updateFilter(k,A),onRemoveFilter:k=>t.removeFilter(k),onSetDefaultSort:k=>t.setDefaultSort(k)}),a.jsx(hce,{open:v,existingIds:i.map(k=>k.id),onClose:()=>t.closeAddViewDialog(),onSubmit:k=>t.addView(k)}),a.jsx(mce,{open:C,viewLabel:(p==null?void 0:p.label)??"",onClose:()=>t.closeDeleteViewDialog(),onDelete:()=>t.deleteCurrentView()}),a.jsx(sb,{open:(S==null?void 0:S.isBlocked)??!1,onStay:()=>S==null?void 0:S.reset(),onLeave:()=>S==null?void 0:S.proceed()}),a.jsx(nb,{open:M,onStay:()=>t.cancelTabSwitch(),onDiscard:()=>t.discardAndSwitchTab(),onSaveAndSwitch:()=>t.saveAndSwitchTab()}),a.jsx(ea,{open:y!==null,autoHideDuration:4e3,onClose:()=>t.clearMessage(),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{severity:(y==null?void 0:y.type)??"info",onClose:()=>t.clearMessage(),children:y==null?void 0:y.text})})]})}class Bf{constructor(e,n,r,s,i,l,u){this.viewsQuery=e,this.contentTypeQuery=n,this.contentTypeUiQuery=r,this.saveMutation=s,this.queryClient=i,this.branch=l,this.contentTypeId=u}static ViewsQueryParams(e,n,r){return{queryKey:["contentTypeViews",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");const i=await new At(e).fetchFileOrNull(sc(n),r);return i?JSON.parse(i):null},enabled:!!e&&!!n}}static ContentTypeQueryParams(e,n,r){return{queryKey:["contentType",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");const i=await new At(e).fetchFileOrNull(Kl(n),r);return i?JSON.parse(i):null},enabled:!!e&&!!n}}static ContentTypeUiQueryParams(e,n,r){return{queryKey:["contentTypeUi",n,r],queryFn:async()=>{if(!e)throw new Error("Not authenticated");const i=await new At(e).fetchFileOrNull(Ld(n),r);return i?JSON.parse(i):null},enabled:!!e&&!!n}}static SaveViewsMutationParams(e,n,r,s){return{mutationFn:async i=>{if(!n)throw new Error("Not authenticated");await new At(n).commitFiles(`ビュー更新: ${s}`,[{path:sc(s),content:JSON.stringify(i.contentTypeViews,null,2)}],r)},onSuccess:()=>{e.invalidateQueries({queryKey:["contentTypeViews",s,r]})}}}getContentTypeViews(){return this.viewsQuery.data??void 0}getContentType(){return this.contentTypeQuery.data??void 0}getContentTypeUi(){return this.contentTypeUiQuery.data??void 0}isLoading(){return this.viewsQuery.isLoading||this.contentTypeQuery.isLoading||this.contentTypeUiQuery.isLoading}getError(){return this.viewsQuery.error??this.contentTypeQuery.error??this.contentTypeUiQuery.error??null}async saveViews(e){await this.saveMutation.mutateAsync(e)}isSaving(){return this.saveMutation.isPending}invalidateQueries(){this.queryClient.invalidateQueries({queryKey:["contentTypeViews",this.contentTypeId,this.branch]})}}const MA={editingViews:[],defaultViewId:"",selectedViewId:null,addViewDialogOpen:!1,deleteViewDialogOpen:!1,message:null,isDirty:!1,editorMode:"ui",jsonViewsText:"",jsonViewsIsDirty:!1,tabSwitchDialogOpen:!1,pendingTabSwitch:null};function yce(){return Fs((t,e)=>({...MA,setEditingViews:n=>t({editingViews:n}),setDefaultViewId:n=>t({defaultViewId:n,isDirty:!0}),addView:n=>{const r=e().editingViews;t({editingViews:[...r,n],selectedViewId:n.id,isDirty:!0})},updateView:(n,r)=>{const i=e().editingViews.map(l=>l.id===n?{...l,...r}:l);t({editingViews:i,isDirty:!0})},removeView:n=>{const r=e().editingViews,s=e().defaultViewId,i=r.filter(p=>p.id!==n),l=e().selectedViewId;let u=s;s===n&&i.length>0&&(u=i[0].id),t({editingViews:i,defaultViewId:u,selectedViewId:l===n?null:l,isDirty:!0})},reorderViews:(n,r)=>{const s=e().editingViews;if(n<0||n>=s.length||r<0||r>=s.length)return;const i=[...s],[l]=i.splice(n,1);i.splice(r,0,l),t({editingViews:i,isDirty:!0})},setSelectedViewId:n=>t({selectedViewId:n}),setAddViewDialogOpen:n=>t({addViewDialogOpen:n}),setDeleteViewDialogOpen:n=>t({deleteViewDialogOpen:n}),setMessage:n=>t({message:n}),setDirty:n=>t({isDirty:n}),setEditorMode:n=>t({editorMode:n}),setJsonViewsText:n=>t({jsonViewsText:n}),setJsonViewsIsDirty:n=>t({jsonViewsIsDirty:n}),setTabSwitchDialogOpen:n=>t({tabSwitchDialogOpen:n}),setPendingTabSwitch:n=>t({pendingTabSwitch:n}),reset:()=>t(MA)}))}class vce{constructor(e){this.store=e}getState(){const e=this.store.getState();return{editingViews:e.editingViews,defaultViewId:e.defaultViewId,selectedViewId:e.selectedViewId,addViewDialogOpen:e.addViewDialogOpen,deleteViewDialogOpen:e.deleteViewDialogOpen,message:e.message,isDirty:e.isDirty,editorMode:e.editorMode,jsonViewsText:e.jsonViewsText,jsonViewsIsDirty:e.jsonViewsIsDirty,tabSwitchDialogOpen:e.tabSwitchDialogOpen,pendingTabSwitch:e.pendingTabSwitch}}setEditingViews(e){this.store.getState().setEditingViews(e)}setDefaultViewId(e){this.store.getState().setDefaultViewId(e)}addView(e){this.store.getState().addView(e)}updateView(e,n){this.store.getState().updateView(e,n)}removeView(e){this.store.getState().removeView(e)}reorderViews(e,n){this.store.getState().reorderViews(e,n)}setSelectedViewId(e){this.store.getState().setSelectedViewId(e)}openAddViewDialog(){this.store.getState().setAddViewDialogOpen(!0)}closeAddViewDialog(){this.store.getState().setAddViewDialogOpen(!1)}openDeleteViewDialog(){this.store.getState().setDeleteViewDialogOpen(!0)}closeDeleteViewDialog(){this.store.getState().setDeleteViewDialogOpen(!1)}setMessage(e){this.store.getState().setMessage(e)}clearMessage(){this.store.getState().setMessage(null)}setDirty(e){this.store.getState().setDirty(e)}setEditorMode(e){this.store.getState().setEditorMode(e)}setJsonViewsText(e){this.store.getState().setJsonViewsText(e)}setJsonViewsIsDirty(e){this.store.getState().setJsonViewsIsDirty(e)}openTabSwitchDialog(e){this.store.getState().setPendingTabSwitch(e),this.store.getState().setTabSwitchDialogOpen(!0)}closeTabSwitchDialog(){this.store.getState().setTabSwitchDialogOpen(!1),this.store.getState().setPendingTabSwitch(null)}reset(){this.store.getState().reset()}subscribe(e){return this.store.subscribe(e)}}const xce=yce(),fo=new vce(xce);class bce{constructor(e,n,r,s){this.repo=e,this.presenter=n,this.contentTypeId=r,this.unsavedGuard=s}getState(){const e=this.presenter.getState(),n=e.selectedViewId!==null?e.editingViews.find(l=>l.id===e.selectedViewId)??null:null,r=this.repo.getContentType(),s=this.repo.getContentTypeUi(),i=(r==null?void 0:r.fields)??[];return{contentTypeId:this.contentTypeId,editingLabel:(s==null?void 0:s.label)??this.contentTypeId,editingViews:e.editingViews,defaultViewId:e.defaultViewId,originalViews:this.repo.getContentTypeViews(),availableFields:i,selectedViewId:e.selectedViewId,selectedView:n,isLoading:this.repo.isLoading(),isSaving:this.repo.isSaving(),isDirty:e.isDirty,error:this.repo.getError(),message:e.message,addViewDialogOpen:e.addViewDialogOpen,deleteViewDialogOpen:e.deleteViewDialogOpen,unsavedGuard:this.unsavedGuard??null,editorMode:e.editorMode,jsonViewsText:e.jsonViewsText,jsonViewsIsDirty:e.jsonViewsIsDirty,tabSwitchDialogOpen:e.tabSwitchDialogOpen,pendingTabSwitch:e.pendingTabSwitch}}initializeFromData(e){this.presenter.setEditingViews(e.views),this.presenter.setDefaultViewId(e.defaultViewId),this.presenter.setDirty(!1),oe.info("ViewDefinitionEditorUseCase.initializeFromData",{contentTypeId:this.contentTypeId,viewCount:e.views.length})}selectView(e){this.presenter.setSelectedViewId(e)}clearSelection(){this.presenter.setSelectedViewId(null)}addView(e){const n={id:e.id,label:e.label,columns:[{field:"title",label:"タイトル",width:"50%",sortable:!0},{field:"status",label:"ステータス",sortable:!0},{field:"updatedAt",label:"更新日時",sortable:!0}]};this.presenter.addView(n),this.presenter.closeAddViewDialog(),oe.info("ViewDefinitionEditorUseCase.addView",{id:e.id,label:e.label})}updateCurrentView(e){const{selectedViewId:n}=this.presenter.getState();n!==null&&this.presenter.updateView(n,e)}updateViewLabel(e,n){this.presenter.updateView(e,{label:n})}deleteCurrentView(){const{selectedViewId:e,editingViews:n}=this.presenter.getState();if(e!==null){if(n.length<=1){this.presenter.setMessage({type:"error",text:"少なくとも1つのビューが必要です"});return}this.presenter.removeView(e),this.presenter.closeDeleteViewDialog(),oe.info("ViewDefinitionEditorUseCase.deleteCurrentView",{viewId:e})}}setDefaultView(e){this.presenter.setDefaultViewId(e),oe.info("ViewDefinitionEditorUseCase.setDefaultView",{viewId:e})}addColumn(e){const{selectedViewId:n,editingViews:r}=this.presenter.getState();if(n===null)return;const s=r.find(l=>l.id===n);if(!s)return;const i=[...s.columns,e];this.presenter.updateView(n,{columns:i})}updateColumn(e,n){const{selectedViewId:r,editingViews:s}=this.presenter.getState();if(r===null)return;const i=s.find(u=>u.id===r);if(!i)return;const l=i.columns.map((u,p)=>p===e?{...u,...n}:u);this.presenter.updateView(r,{columns:l})}removeColumn(e){const{selectedViewId:n,editingViews:r}=this.presenter.getState();if(n===null)return;const s=r.find(l=>l.id===n);if(!s)return;const i=s.columns.filter((l,u)=>u!==e);this.presenter.updateView(n,{columns:i})}reorderColumns(e,n){const{selectedViewId:r,editingViews:s}=this.presenter.getState();if(r===null)return;const i=s.find(p=>p.id===r);if(!i)return;const l=[...i.columns],[u]=l.splice(e,1);l.splice(n,0,u),this.presenter.updateView(r,{columns:l})}addFilter(e){const{selectedViewId:n,editingViews:r}=this.presenter.getState();if(n===null)return;const s=r.find(l=>l.id===n);if(!s)return;const i=[...s.filters??[],e];this.presenter.updateView(n,{filters:i})}updateFilter(e,n){const{selectedViewId:r,editingViews:s}=this.presenter.getState();if(r===null)return;const i=s.find(u=>u.id===r);if(!i||!i.filters)return;const l=i.filters.map((u,p)=>p===e?{...u,...n}:u);this.presenter.updateView(r,{filters:l})}removeFilter(e){const{selectedViewId:n,editingViews:r}=this.presenter.getState();if(n===null)return;const s=r.find(l=>l.id===n);if(!s||!s.filters)return;const i=s.filters.filter((l,u)=>u!==e);this.presenter.updateView(n,{filters:i.length>0?i:void 0})}setDefaultSort(e){const{selectedViewId:n}=this.presenter.getState();n!==null&&this.presenter.updateView(n,{defaultSort:e})}openAddViewDialog(){this.presenter.openAddViewDialog()}closeAddViewDialog(){this.presenter.closeAddViewDialog()}openDeleteViewDialog(){this.presenter.openDeleteViewDialog()}closeDeleteViewDialog(){this.presenter.closeDeleteViewDialog()}clearMessage(){this.presenter.clearMessage()}requestTabSwitch(e){const{editorMode:n,jsonViewsIsDirty:r,isDirty:s}=this.presenter.getState();if(n===e)return;let i=!1;n==="ui"?i=s:i=r,i?this.presenter.openTabSwitchDialog(e):this.switchTab(e)}switchTab(e){const{editorMode:n,editingViews:r,defaultViewId:s}=this.presenter.getState();if(e==="json"&&n==="ui"){const i=this.extractViews(r,s),l=JSON.stringify(i,null,2);this.presenter.setJsonViewsText(l),this.presenter.setJsonViewsIsDirty(!1)}if(e==="ui"&&n==="json"){const{jsonViewsText:i}=this.presenter.getState(),l=Na(i);if(!l.success){this.presenter.setMessage({type:"error",text:`JSONの構文エラー: ${l.error}`});return}this.applyJsonToUiState(l.data)}this.presenter.setEditorMode(e),this.presenter.closeTabSwitchDialog()}discardAndSwitchTab(){const{pendingTabSwitch:e,editorMode:n}=this.presenter.getState();e&&(n==="json"&&this.presenter.setJsonViewsIsDirty(!1),this.switchTab(e))}async saveAndSwitchTab(){const{pendingTabSwitch:e,editorMode:n}=this.presenter.getState();if(e){if(n==="json"){if(!await this.saveFromJson())return}else await this.save();this.switchTab(e)}}cancelTabSwitch(){this.presenter.closeTabSwitchDialog()}updateJsonViewsText(e){this.presenter.setJsonViewsText(e),this.presenter.setJsonViewsIsDirty(!0)}applyJsonToUiState(e){this.presenter.setEditingViews(e.views),this.presenter.setDefaultViewId(e.defaultViewId),this.presenter.setDirty(!0),this.presenter.setJsonViewsIsDirty(!1),oe.info("ViewDefinitionEditorUseCase.applyJsonToUiState",{viewCount:e.views.length})}async saveFromJson(){var s;const{jsonViewsText:e}=this.presenter.getState(),n=Na(e);if(!n.success)return this.presenter.setMessage({type:"error",text:`JSONの構文エラー: ${n.error}`}),!1;const r=Yoe(n.data);if(!r.success)return this.presenter.setMessage({type:"error",text:`バリデーションエラー:
|
|
504
|
+
${iw(r.errors)}`}),!1;try{return await this.repo.saveViews({contentTypeViews:r.data}),this.presenter.setJsonViewsIsDirty(!1),this.presenter.setDirty(!1),(s=this.unsavedGuard)==null||s.setJustSaved(),this.presenter.setMessage({type:"success",text:"ビュー設定を保存しました"}),oe.info("ViewDefinitionEditorUseCase.saveFromJson",{contentTypeId:this.contentTypeId}),!0}catch(i){const l=i instanceof Error?i.message:String(i);return this.presenter.setMessage({type:"error",text:`保存に失敗しました: ${l}`}),oe.error("ViewDefinitionEditorUseCase.saveFromJson failed",{error:i}),!1}}formatJson(){const{jsonViewsText:e}=this.presenter.getState();try{const n=JSON.parse(e),r=JSON.stringify(n,null,2);this.presenter.setJsonViewsText(r)}catch{this.presenter.setMessage({type:"error",text:"JSONのフォーマットに失敗しました(構文エラー)"})}}resetJson(){const{editingViews:e,defaultViewId:n}=this.presenter.getState(),r=this.extractViews(e,n),s=JSON.stringify(r,null,2);this.presenter.setJsonViewsText(s),this.presenter.setJsonViewsIsDirty(!1),this.presenter.setMessage({type:"info",text:"JSONをUI状態から再生成しました"})}prepareJsonForMode(e){const{editingViews:n,defaultViewId:r,jsonViewsText:s}=this.presenter.getState(),i=n.length>0;if(e==="json"&&!s&&i){const l=this.extractViews(n,r),u=JSON.stringify(l,null,2);this.presenter.setJsonViewsText(u),this.presenter.setJsonViewsIsDirty(!1)}this.presenter.setEditorMode(e)}async save(){var s;const{editingViews:e,defaultViewId:n}=this.presenter.getState(),r=this.extractViews(e,n);try{await this.repo.saveViews({contentTypeViews:r}),this.presenter.setDirty(!1),(s=this.unsavedGuard)==null||s.setJustSaved(),this.presenter.setMessage({type:"success",text:"ビュー設定を保存しました"}),oe.info("ViewDefinitionEditorUseCase.save",{contentTypeId:this.contentTypeId})}catch(i){const l=i instanceof Error?i.message:String(i);this.presenter.setMessage({type:"error",text:`保存に失敗しました: ${l}`}),oe.error("ViewDefinitionEditorUseCase.save failed",{error:i})}}extractViews(e,n){return{defaultViewId:n,views:e.map(r=>({id:r.id,label:r.label,columns:r.columns,...r.defaultSort&&{defaultSort:r.defaultSort},...r.filters&&r.filters.length>0&&{filters:r.filters}}))}}reset(){this.presenter.reset()}}function Sce(){const{authUseCase:t}=rr(),{branchUseCase:e}=Ei(),{token:n}=t.getState(),r=(e==null?void 0:e.getCurrentBranch())??"develop",s=ys(),l=uc({strict:!1}).contentTypeId??"";b.useSyncExternalStore(fo.subscribe.bind(fo),()=>JSON.stringify(fo.getState()));const u=jn(Bf.ViewsQueryParams(n,l,r)),p=jn(Bf.ContentTypeQueryParams(n,l,r)),f=jn(Bf.ContentTypeUiQueryParams(n,l,r)),m=Pn(Bf.SaveViewsMutationParams(s,n,r,l)),g=new Bf(u,p,f,m,s,r,l),y=fo.getState().isDirty,v=Um({isDirty:y}),C=new bce(g,fo,l,v),S=b.useRef(null),j=u.data;b.useEffect(()=>{S.current!==l&&j&&(S.current!==null&&S.current!==l&&fo.reset(),fo.setEditingViews(j.views),fo.setDefaultViewId(j.defaultViewId),fo.setDirty(!1),S.current=l)},[j,l]);const D=b.useRef(r);return b.useEffect(()=>{D.current!==r&&(S.current=null,fo.reset(),D.current=r)},[r]),b.useEffect(()=>()=>{fo.reset(),S.current=null},[]),{viewDefinitionEditorUseCase:C}}const Cce=["ui","json"],wce=Ss("/content-types/$contentTypeId/views")({component:Tce,validateSearch:t=>({mode:Cce.includes(t.mode)?t.mode:void 0})}),jce=[{label:"UI編集",value:"ui"},{label:"JSON",value:"json"}];function Tce(){const t=ur(),e=Di({from:"/content-types/$contentTypeId/views"}),n=e.mode??"ui",{authUseCase:r}=rr(),{currentUser:s}=r.getState(),i=ws(s,"canViewContentType"),l=ws(s,"canEditContentType"),{viewDefinitionEditorUseCase:u}=Sce(),{isLoading:p,error:f,contentTypeId:m,editingLabel:g}=u.getState();if(b.useEffect(()=>{s&&!i&&t({to:"/"})},[s,i,t]),!i)return null;if(p)return a.jsx(B,{"data-component-name":"cmp:ViewsEditPage",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})});if(f)return a.jsx(B,{"data-component-name":"cmp:ViewsEditPage",sx:{flex:1,overflow:"auto",p:3},children:a.jsxs(zt,{severity:"error",children:["エラー: ",f.message]})});const v={value:n,options:jce,onChange:C=>{t({to:".",search:{...e,mode:C==="ui"?void 0:C},replace:!0})}};return a.jsxs(B,{"data-component-name":"cmp:ViewsEditPage",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[a.jsx(B,{sx:{px:3,pt:2,flexShrink:0},children:a.jsx(no,{items:[{label:"コンテンツタイプ編集",to:"/content-types"},{label:g||m,to:`/content-types/${m}/edit`},{label:"ビュー編集"}],dropdown:v})}),a.jsx(gce,{useCase:u,editorMode:n,canEdit:l})]})}const Dce={bg:"#F5F5F5",border:"#9E9E9E"};function Ece(t){return Dce}function Rce(t,e){const n=new Map(t.map(u=>[u.key,u])),r=new Set,s=[],i=new Set(e.flatMap(u=>u.fieldKeys)),l=t.filter(u=>!i.has(u.key));if(l.length>0){s.push({id:null,label:null,fields:l,color:null});for(const u of l)r.add(u.key)}for(const u of e){const p=[];for(const f of u.fieldKeys){const m=n.get(f);m&&!r.has(f)&&(p.push(m),r.add(f))}s.push({id:u.id,label:u.label,fields:p,color:Ece(u.id)})}return s}function O1(t,e){for(const n of e)if(n.fieldKeys.includes(t))return n.id;return null}const kce={text:T2,html:S2,markdown:km,number:dY,boolean:OY,date:yP,image:jP,file:gP,select:DP,relation:j2,array:OJ,label:ch};function Ru(t){return kce[t]??T2}const Mp={text:"テキスト",html:"HTML",markdown:"Markdown",number:"数値",boolean:"真偽値",date:"日付",image:"画像",file:"ファイル",select:"セレクト",relation:"リレーション",array:"配列",label:"ラベル"},ab=["text","html","markdown","number","boolean","date","image","file","select","relation","array","label"],Ny=[3,4,6,8,12];function D4({field:t,onEdit:e,onDelete:n,onToggleBreak:r,onChangeColumns:s}){const{attributes:i,listeners:l,setNodeRef:u,isDragging:p}=eb({id:t.key}),f={},m=Ru(t.type),g=Ny.indexOf(t.columns),y=g>0,v=g<Ny.length-1,C=j=>{j.stopPropagation(),y&&(s==null||s(Ny[g-1]))},S=j=>{j.stopPropagation(),v&&(s==null||s(Ny[g+1]))};return a.jsxs(Su,{ref:u,style:f,"data-component-name":"cmp:FieldCard",sx:{height:160,display:"flex",flexDirection:"column",opacity:p?.3:1,boxShadow:p?0:1,cursor:"default","&:hover":{boxShadow:p?0:3}},children:[a.jsxs(Sp,{sx:{flex:1,pb:1},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[a.jsx(B,{...i,...l,sx:{display:"flex",alignItems:"center",cursor:"grab",color:"text.disabled","&:active":{cursor:"grabbing"},"&:hover":{color:"text.secondary"}},children:a.jsx(wu,{fontSize:"small"})}),a.jsx(m,{fontSize:"small",color:"action"}),a.jsx(G,{variant:"caption",fontFamily:"monospace",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.key})]}),a.jsx(G,{variant:"subtitle1",fontWeight:600,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",mb:t.description?0:1,...t.type==="label"&&t.labelColor&&{color:t.labelColor}},children:t.label}),t.description&&a.jsx(G,{variant:"caption",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",mb:1},children:t.description}),a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:.5,flexWrap:"wrap"},children:[a.jsx(Ht,{label:Mp[t.type],size:"small",variant:"outlined",sx:{height:22,fontSize:"0.7rem"}}),t.required&&a.jsx(Ht,{label:"必須",size:"small",color:"error",sx:{height:22,fontSize:"0.7rem"}}),t.multiple&&a.jsx(Ht,{label:"複数",size:"small",color:"info",sx:{height:22,fontSize:"0.7rem"}})]})]}),a.jsxs(s2,{sx:{justifyContent:"space-between",pt:0},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[a.jsx(ft,{size:"small",onClick:C,disabled:!y,sx:{p:.25},children:a.jsx(xP,{fontSize:"small"})}),a.jsx(G,{variant:"caption",sx:{minWidth:24,textAlign:"center",fontWeight:600,color:"text.secondary"},children:t.columns}),a.jsx(ft,{size:"small",onClick:S,disabled:!v,sx:{p:.25},children:a.jsx(Jl,{fontSize:"small"})})]}),a.jsxs(B,{sx:{display:"flex"},children:[a.jsx(Er,{title:t.break?"改行あり":"改行なし",children:a.jsx(ft,{size:"small",onClick:r,sx:{color:t.break?"primary.main":"text.disabled"},children:a.jsx(JJ,{fontSize:"small"})})}),a.jsx(Er,{title:"編集",children:a.jsx(ft,{size:"small",onClick:e,children:a.jsx(Ri,{fontSize:"small"})})}),a.jsx(Er,{title:"削除",children:a.jsx(ft,{size:"small",onClick:n,color:"error",children:a.jsx(zn,{fontSize:"small"})})})]})]})]})}function Mce({field:t}){const e=Ru(t.type);return a.jsx(Su,{"data-component-name":"cmp:FieldCardOverlay",sx:{width:280,boxShadow:8,cursor:"grabbing"},children:a.jsxs(Sp,{sx:{pb:1},children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[a.jsx(B,{sx:{display:"flex",alignItems:"center",color:"text.disabled"},children:a.jsx(wu,{fontSize:"small"})}),a.jsx(e,{fontSize:"small",color:"action"}),a.jsx(G,{variant:"caption",fontFamily:"monospace",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.key})]}),a.jsx(G,{variant:"subtitle1",fontWeight:600,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",mb:t.description?0:1,...t.type==="label"&&t.labelColor&&{color:t.labelColor}},children:t.label}),t.description&&a.jsx(G,{variant:"caption",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",mb:1},children:t.description}),a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:.5,flexWrap:"wrap"},children:[a.jsx(Ht,{label:Mp[t.type],size:"small",variant:"outlined",sx:{height:22,fontSize:"0.7rem"}}),t.required&&a.jsx(Ht,{label:"必須",size:"small",color:"error",sx:{height:22,fontSize:"0.7rem"}}),t.multiple&&a.jsx(Ht,{label:"複数",size:"small",color:"info",sx:{height:22,fontSize:"0.7rem"}})]})]})})}function Oce({field:t,isNewField:e,onUpdate:n}){return a.jsxs(_s,{defaultExpanded:!0,"data-component-name":"cmp:FieldBasicSettings",children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsx(G,{fontWeight:500,children:"基本設定"})}),a.jsx(Is,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2},children:[a.jsx(Xe,{label:"キー",value:t.key,onChange:r=>n({key:r.target.value}),disabled:!e,required:!0,fullWidth:!0,size:"small",helperText:e?"英数字とアンダースコアのみ使用可能":"キーは変更できません",inputProps:{pattern:"^[a-zA-Z][a-zA-Z0-9_]*$",style:{fontFamily:"monospace"}}}),a.jsxs(_n,{fullWidth:!0,size:"small",children:[a.jsx(nr,{children:"タイプ"}),a.jsx(wn,{value:t.type,label:"タイプ",onChange:r=>{const s=r.target.value,i=Ace(s);n({type:s,options:i,...s!=="text"&&{useAsUrl:!1}})},children:ab.map(r=>{const s=Ru(r);return a.jsx(nt,{value:r,children:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(s,{fontSize:"small"}),a.jsx("span",{children:Mp[r]})]})},r)})})]}),t.type==="relation"&&a.jsx(_r,{control:a.jsx(es,{checked:t.multiple,onChange:r=>n({multiple:r.target.checked})}),label:"複数値を許可"}),a.jsxs(B,{children:[a.jsx(_r,{control:a.jsx(es,{checked:t.useAsUrl??!1,onChange:r=>n({useAsUrl:r.target.checked}),disabled:t.type!=="text"}),label:"URL として使用(変更不可)"}),t.useAsUrl&&a.jsx(G,{variant:"caption",color:"text.secondary",sx:{ml:4,display:"block"},children:"コンテンツ作成後、このフィールドの値は変更できなくなります。 詳細レシピの出力パスにはこのフィールドのみ指定可能です。"})]})]})})]})}function Ace(t){switch(t){case"select":return{choices:[]};case"relation":return{targetContentType:""};case"array":return{itemType:"text",itemFields:[],minItems:0,maxItems:void 0};default:return}}const _ce=[{value:"",label:"なし"},{value:"trim",label:"トリム(前後の空白削除)"},{value:"lowercase",label:"小文字に変換"},{value:"uppercase",label:"大文字に変換"},{value:"slug",label:"スラッグ形式"},{value:"phone",label:"電話番号形式"},{value:"postalCode",label:"郵便番号形式"}];function Ice({field:t,onUpdate:e}){return a.jsxs(_s,{defaultExpanded:!0,"data-component-name":"cmp:FieldUiSettings",children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsx(G,{fontWeight:500,children:"UI設定"})}),a.jsx(Is,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2},children:[a.jsx(Xe,{label:"ラベル",value:t.label,onChange:n=>e({label:n.target.value}),required:!0,fullWidth:!0,size:"small"}),a.jsxs(B,{sx:{display:"flex",gap:3},children:[a.jsx(_r,{control:a.jsx(es,{checked:t.required,onChange:n=>e({required:n.target.checked}),size:"small"}),label:"必須"}),a.jsx(_r,{control:a.jsx(es,{checked:t.readOnly,onChange:n=>e({readOnly:n.target.checked}),size:"small"}),label:"読み取り専用"}),a.jsx(_r,{control:a.jsx(es,{checked:t.hidden,onChange:n=>e({hidden:n.target.checked}),size:"small"}),label:"非表示"})]}),a.jsx(Xe,{label:"プレースホルダー",value:t.placeholder??"",onChange:n=>e({placeholder:n.target.value||null}),fullWidth:!0,size:"small"}),a.jsx(Xe,{label:"説明",value:t.description??"",onChange:n=>e({description:n.target.value||null}),fullWidth:!0,size:"small",multiline:!0,rows:2,helperText:"URLは自動リンク化されます"}),a.jsxs(B,{children:[a.jsxs(G,{variant:"body2",gutterBottom:!0,children:["カラム数: ",t.columns,"/12"]}),a.jsx(QI,{value:t.columns,onChange:(n,r)=>e({columns:r}),min:1,max:12,step:1,marks:[{value:1,label:"1"},{value:6,label:"6"},{value:12,label:"12"}],valueLabelDisplay:"auto"})]}),a.jsx(_r,{control:a.jsx(es,{checked:t.break,onChange:n=>e({break:n.target.checked}),size:"small"}),label:"このフィールドの後で改行"}),a.jsx(Xe,{label:"文字数警告の閾値",type:"number",value:t.warnLength??"",onChange:n=>e({warnLength:n.target.value?parseInt(n.target.value):null}),fullWidth:!0,size:"small",helperText:"この文字数を超えると警告が表示されます",slotProps:{htmlInput:{min:0}}}),a.jsx(Xe,{label:"正規表現パターン",value:t.pattern??"",onChange:n=>e({pattern:n.target.value||null}),fullWidth:!0,size:"small",helperText:"バリデーション用の正規表現(例: ^[a-z]+$)",slotProps:{input:{sx:{fontFamily:"monospace"}}}}),a.jsx(Xe,{label:"パターン不一致時のメッセージ",value:t.patternMessage??"",onChange:n=>e({patternMessage:n.target.value||null}),fullWidth:!0,size:"small",disabled:!t.pattern}),t.type!=="label"&&a.jsxs(_n,{fullWidth:!0,size:"small",children:[a.jsx(nr,{children:"自動フォーマット"}),a.jsx(wn,{value:t.autoFormat??"",label:"自動フォーマット",onChange:n=>e({autoFormat:n.target.value||null}),children:_ce.map(n=>a.jsx(nt,{value:n.value,children:n.label},n.value))})]}),t.type==="label"&&a.jsxs(_n,{fullWidth:!0,size:"small",children:[a.jsx(nr,{children:"文字色"}),a.jsxs(wn,{value:t.labelColor??"",label:"文字色",onChange:n=>e({labelColor:n.target.value||null}),children:[a.jsx(nt,{value:"",children:"デフォルト"}),a.jsx(nt,{value:"#1976D2",children:"青"}),a.jsx(nt,{value:"#388E3C",children:"緑"}),a.jsx(nt,{value:"#F57C00",children:"オレンジ"}),a.jsx(nt,{value:"#D32F2F",children:"赤"}),a.jsx(nt,{value:"#7B1FA2",children:"紫"}),a.jsx(nt,{value:"#616161",children:"グレー"})]})]})]})})]})}function Pce({choices:t,onChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState(""),l=Lm(Do(Tu,{activationConstraint:{distance:8}}),Do(ju,{coordinateGetter:Fm})),u=g=>{const{active:y,over:v}=g;if(!v||y.id===v.id)return;const C=t.findIndex(j=>j.value===y.id),S=t.findIndex(j=>j.value===v.id);if(C!==-1&&S!==-1){const j=[...t],[D]=j.splice(C,1);j.splice(S,0,D),e(j)}},p=()=>{!n.trim()||!s.trim()||t.some(g=>g.value===s.trim())||(e([...t,{label:n.trim(),value:s.trim()}]),r(""),i(""))},f=g=>{const y=t.filter((v,C)=>C!==g);e(y)},m=(g,y)=>{const v=[...t];v[g]={...v[g],...y},e(v)};return a.jsxs(B,{"data-component-name":"cmp:ChoicesEditor",children:[a.jsx(G,{variant:"body2",gutterBottom:!0,children:"選択肢"}),t.length===0?a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"選択肢がありません"}):a.jsx($m,{sensors:l,collisionDetection:Kx,onDragEnd:u,children:a.jsx(Nm,{items:t.map(g=>g.value),strategy:V2,children:a.jsx(as,{disablePadding:!0,sx:{mb:2},children:t.map((g,y)=>a.jsx(Lce,{choice:g,index:y,onUpdate:v=>m(y,v),onDelete:()=>f(y)},g.value))})})}),a.jsxs(B,{sx:{display:"flex",gap:1,alignItems:"flex-start"},children:[a.jsx(Xe,{label:"ラベル",value:n,onChange:g=>r(g.target.value),size:"small",sx:{flex:1}}),a.jsx(Xe,{label:"値",value:s,onChange:g=>i(g.target.value),size:"small",sx:{flex:1},slotProps:{input:{sx:{fontFamily:"monospace"}}}}),a.jsx(pe,{variant:"outlined",startIcon:a.jsx(Qn,{}),onClick:p,disabled:!n.trim()||!s.trim(),sx:{flexShrink:0},children:"追加"})]})]})}function Lce({choice:t,onUpdate:e,onDelete:n}){const{attributes:r,listeners:s,setNodeRef:i,transform:l,transition:u,isDragging:p}=eb({id:t.value}),f={transform:sa.Transform.toString(l),transition:u,opacity:p?.5:1};return a.jsxs(Os,{ref:i,style:f,sx:{px:0,gap:1},secondaryAction:a.jsx(ft,{size:"small",onClick:n,color:"error",children:a.jsx(zn,{fontSize:"small"})}),children:[a.jsx(B,{...r,...s,sx:{display:"flex",alignItems:"center",cursor:"grab",color:"text.secondary","&:active":{cursor:"grabbing"}},children:a.jsx(wu,{fontSize:"small"})}),a.jsx(Xe,{value:t.label,onChange:m=>e({label:m.target.value}),size:"small",sx:{flex:1},placeholder:"ラベル"}),a.jsx(Xe,{value:t.value,onChange:m=>e({value:m.target.value}),size:"small",sx:{flex:1},placeholder:"値",slotProps:{input:{sx:{fontFamily:"monospace"}}}})]})}function zce(t){return{key:t.key,type:t.type,multiple:t.multiple,options:t.options,label:t.key,required:!1,defaultValue:E4(t.type),placeholder:null,description:null,warnLength:null,columns:12,break:!1,hidden:!1,readOnly:!1,pattern:null,patternMessage:null,autoFormat:null}}function $ce(t){return{key:t.key,type:t.type,multiple:t.multiple,...t.options&&{options:t.options}}}function E4(t){switch(t){case"boolean":return!1;case"array":return[];case"image":case"file":case"relation":return null;default:return""}}function Nce({itemFields:t,contentTypeList:e,onChange:n}){var E;const[r,s]=b.useState(()=>t.map(k=>zce(k))),[i,l]=b.useState(null),[u,p]=b.useState(!1),[f,m]=b.useState(null),g=Lm(Do(Tu,{activationConstraint:{distance:8}}),Do(ju,{coordinateGetter:Fm})),y=b.useCallback(k=>{n(k.map($ce))},[n]),v=b.useCallback(k=>{i!==null&&s(A=>{const O=[...A];return O[i]={...O[i],...k},y(O),O})},[i,y]),C=b.useCallback(k=>{s(A=>{const O=[...A];return O[k]={...O[k],break:!O[k].break},y(O),O})},[y]),S=b.useCallback((k,A)=>{s(O=>{const I=[...O];return I[k]={...I[k],columns:A},y(I),I})},[y]),j=b.useCallback((k,A,O,I)=>{const $={key:k,type:A,multiple:I,options:Bce(A),label:O,required:!1,defaultValue:E4(A),placeholder:null,description:null,warnLength:null,columns:12,break:!1,hidden:!1,readOnly:!1,pattern:null,patternMessage:null,autoFormat:null};s(R=>{const P=[...R,$];return y(P),P}),l(r.length),p(!1)},[r.length,y]),D=b.useCallback(k=>{s(A=>{const O=A.filter((I,$)=>$!==k);return y(O),O}),i===k?l(null):i!==null&&i>k&&l(i-1),m(null)},[i,y]),M=b.useCallback(k=>{const{active:A,over:O}=k;if(!O||A.id===O.id)return;const I=r.findIndex(R=>R.key===A.id),$=r.findIndex(R=>R.key===O.id);I!==-1&&$!==-1&&s(R=>{const P=[...R],[z]=P.splice(I,1);return P.splice($,0,z),y(P),i!==null&&(i===I?l($):I<i&&$>=i?l(i-1):I>i&&$<=i&&l(i+1)),P})},[r,i,y]),T=i!==null?r[i]:null;return a.jsxs(B,{"data-component-name":"cmp:ItemFieldsEditor",sx:{display:"flex",flexDirection:"column",gap:2},children:[a.jsxs(B,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(G,{variant:"subtitle2",color:"text.secondary",children:["アイテムフィールド (",r.length,")"]}),a.jsx(pe,{size:"small",startIcon:a.jsx(Qn,{}),onClick:()=>p(!0),children:"追加"})]}),r.length===0?a.jsx(B,{sx:{py:4,border:"1px dashed",borderColor:"divider",borderRadius:1,textAlign:"center"},children:a.jsx(G,{color:"text.secondary",variant:"body2",children:"フィールドがありません"})}):a.jsx($m,{sensors:g,collisionDetection:Kx,onDragEnd:M,children:a.jsx(Nm,{items:r.map(k=>k.key),strategy:Xx,children:a.jsx(Qk,{container:!0,spacing:1.5,children:r.map((k,A)=>a.jsx(Qk,{size:{xs:12,sm:6},children:a.jsx(D4,{field:k,onEdit:()=>l(A),onDelete:()=>m(A),onToggleBreak:()=>C(A),onChangeColumns:O=>S(A,O)})},k.key))})})}),a.jsx(R4,{field:T,isNewField:!1,contentTypeList:e,open:i!==null,onClose:()=>l(null),onUpdate:v}),a.jsx(Fce,{open:u,existingKeys:r.map(k=>k.key),onClose:()=>p(!1),onSubmit:j}),a.jsxs(Qt,{open:f!==null,onClose:()=>m(null),children:[a.jsx(Yt,{children:"フィールドを削除"}),a.jsx(Jt,{children:a.jsxs(G,{children:["フィールド「",f!==null?(E=r[f])==null?void 0:E.key:"","」を削除しますか?"]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>m(null),children:"キャンセル"}),a.jsx(pe,{color:"error",variant:"contained",onClick:()=>f!==null&&D(f),children:"削除"})]})]})]})}function Fce({open:t,existingKeys:e,onClose:n,onSubmit:r}){const[s,i]=b.useState(""),[l,u]=b.useState("text"),[p,f]=b.useState(""),[m,g]=b.useState(!1),y=()=>{!s.trim()||!p.trim()||e.includes(s.trim())||(r(s.trim(),l,p.trim(),m),i(""),u("text"),f(""),g(!1))},v=s.trim()&&!e.includes(s.trim()),C=p.trim();return a.jsxs(Qt,{open:t,onClose:n,maxWidth:"sm",fullWidth:!0,children:[a.jsx(Yt,{children:"フィールドを追加"}),a.jsx(Jt,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[a.jsx(Xe,{label:"キー",value:s,onChange:S=>i(S.target.value),required:!0,fullWidth:!0,size:"small",error:!!s&&!v,helperText:s&&!v?"既に存在するキーです":"英数字とアンダースコアのみ",slotProps:{input:{sx:{fontFamily:"monospace"}}}}),a.jsxs(_n,{fullWidth:!0,size:"small",children:[a.jsx(nr,{children:"タイプ"}),a.jsx(wn,{value:l,label:"タイプ",onChange:S=>u(S.target.value),children:ab.map(S=>{const j=Ru(S);return a.jsx(nt,{value:S,children:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(j,{fontSize:"small"}),a.jsx("span",{children:Mp[S]})]})},S)})})]}),a.jsx(Xe,{label:"ラベル",value:p,onChange:S=>f(S.target.value),required:!0,fullWidth:!0,size:"small"}),a.jsx(_r,{control:a.jsx(es,{checked:m,onChange:S=>g(S.target.checked)}),label:"複数値を許可"})]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:n,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:y,disabled:!v||!C,children:"追加"})]})]})}function Bce(t){switch(t){case"select":return{choices:[]};case"relation":return{targetContentType:""};case"array":return{itemType:"text",itemFields:[],minItems:0,maxItems:void 0};default:return}}function Uce({field:t,contentTypeList:e,onUpdate:n}){var p;const[r,s]=b.useState(!1),i=t.options??{itemType:"text",itemFields:[],minItems:0,maxItems:void 0},l=f=>{n({options:{...i,...f}})},u=f=>{l({itemFields:f})};return a.jsxs(B,{"data-component-name":"cmp:ArrayFieldOptions",sx:{display:"flex",flexDirection:"column",gap:2},children:[a.jsxs(_n,{fullWidth:!0,size:"small",children:[a.jsx(nr,{children:"アイテムタイプ"}),a.jsx(wn,{value:i.itemType??"text",label:"アイテムタイプ",onChange:f=>l({itemType:f.target.value}),children:ab.map(f=>{const m=Ru(f);return a.jsx(nt,{value:f,children:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(m,{fontSize:"small"}),a.jsx("span",{children:Mp[f]})]})},f)})})]}),a.jsxs(B,{sx:{display:"flex",gap:2},children:[a.jsx(Xe,{label:"最小件数",type:"number",value:i.minItems??0,onChange:f=>l({minItems:f.target.value?parseInt(f.target.value):0}),size:"small",fullWidth:!0,slotProps:{htmlInput:{min:0}}}),a.jsx(Xe,{label:"最大件数",type:"number",value:i.maxItems??"",onChange:f=>l({maxItems:f.target.value?parseInt(f.target.value):void 0}),size:"small",fullWidth:!0,placeholder:"無制限",slotProps:{htmlInput:{min:0}}})]}),a.jsxs(B,{children:[a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[a.jsx(G,{variant:"body2",children:"アイテムフィールド"}),a.jsx(Ht,{label:`${((p=i.itemFields)==null?void 0:p.length)??0} 件`,size:"small",variant:"outlined"})]}),a.jsx(G,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1},children:"配列内の各アイテムが持つフィールドを定義します(オブジェクト配列の場合)"}),a.jsx(pe,{variant:"outlined",startIcon:a.jsx(Ri,{}),onClick:()=>s(!0),children:"アイテムフィールドを編集"})]}),a.jsxs(Qt,{open:r,onClose:()=>s(!1),maxWidth:"lg",fullWidth:!0,"data-component-name":"cmp:ItemFieldsDialog",children:[a.jsxs(Yt,{children:["アイテムフィールドの編集: ",t.label]}),a.jsx(Jt,{sx:{height:"70vh",display:"flex",flexDirection:"column"},children:a.jsx(Nce,{itemFields:i.itemFields??[],contentTypeList:e,onChange:u})}),a.jsx(rn,{children:a.jsx(pe,{onClick:()=>s(!1),children:"閉じる"})})]})]})}const Vce=[{value:null,label:"指定なし"},{value:"free",label:"自由"},{value:"16:9",label:"16:9"},{value:"4:3",label:"4:3"},{value:"3:2",label:"3:2"},{value:"1:1",label:"1:1"}];function Hce({field:t,contentTypeList:e,onUpdate:n}){if(["text","html","markdown","number","boolean","date","file"].includes(t.type))return null;const s=()=>{var i,l;switch(t.type){case"image":return a.jsxs(_n,{fullWidth:!0,size:"small",children:[a.jsx(nr,{children:"アスペクト比"}),a.jsx(wn,{value:t.aspectRatio??null,label:"アスペクト比",onChange:u=>{const p=u.target.value;n({aspectRatio:p})},children:Vce.map(u=>a.jsx(nt,{value:u.value??"",children:u.label},u.value??"null"))})]});case"select":return a.jsx(Pce,{choices:((i=t.options)==null?void 0:i.choices)??[],onChange:u=>n({options:{...t.options,choices:u}})});case"relation":return a.jsxs(_n,{fullWidth:!0,size:"small",children:[a.jsx(nr,{children:"参照先コンテンツタイプ"}),a.jsxs(wn,{value:((l=t.options)==null?void 0:l.targetContentType)??"",label:"参照先コンテンツタイプ",onChange:u=>n({options:{...t.options,targetContentType:u.target.value}}),children:[a.jsx(nt,{value:"",children:a.jsx("em",{children:"選択してください"})}),e.map(u=>a.jsxs(nt,{value:u.id,children:[u.label," (",u.id,")"]},u.id))]})]});case"array":return a.jsx(Uce,{field:t,contentTypeList:e,onUpdate:n});default:return null}};return a.jsxs(_s,{defaultExpanded:!0,"data-component-name":"cmp:FieldTypeOptions",children:[a.jsx(Ps,{expandIcon:a.jsx(Wr,{}),children:a.jsx(G,{fontWeight:500,children:"タイプ固有オプション"})}),a.jsx(Is,{children:a.jsx(B,{sx:{display:"flex",flexDirection:"column",gap:2},children:s()})})]})}function Wce({field:t,isNewField:e,contentTypeList:n,onUpdate:r}){return a.jsxs(B,{"data-component-name":"cmp:FieldEditorPanelContent",sx:{display:"flex",flexDirection:"column",gap:2},children:[a.jsx(Oce,{field:t,isNewField:e,onUpdate:r}),a.jsx(Ice,{field:t,onUpdate:r}),a.jsx(Hce,{field:t,contentTypeList:n,onUpdate:r})]})}function R4({field:t,isNewField:e,contentTypeList:n,open:r,onClose:s,onUpdate:i}){const l=t?Ru(t.type):null;return a.jsxs(Cu,{anchor:"right",open:r,onClose:s,"data-component-name":"cmp:FieldEditorDrawer",PaperProps:{sx:{width:{xs:"100vw",sm:"70vw"},maxWidth:1e3,display:"flex",flexDirection:"column"}},children:[a.jsx(Dp,{title:(t==null?void 0:t.label)||"フィールド編集",icon:l&&a.jsx(l,{color:"action"}),onClose:s,componentName:"cmp:FieldEditorDrawerHeader"}),a.jsx(B,{"data-component-name":"cmp:FieldEditorDrawerContent",sx:{flex:1,overflow:"auto",p:2},children:t&&a.jsx(Wce,{field:t,isNewField:e,contentTypeList:n,onUpdate:i})})]})}function qce(t){return t.toLowerCase().replace(/[^\w\s]/g,"").replace(/\s+/g,"_").replace(/^_+|_+$/g,"")}function Gce(){return`label-${Math.random().toString(36).substring(2,8)}`}function Zce({open:t,existingKeys:e,onClose:n,onSubmit:r}){const[s,i]=b.useState(""),[l,u]=b.useState(!1),[p,f]=b.useState("text"),[m,g]=b.useState(""),[y,v]=b.useState(!1);b.useEffect(()=>{t&&(i(""),u(!1),f("text"),g(""),v(!1))},[t]);const C=E=>{g(E),!l&&p!=="label"&&i(qce(E))},S=E=>{i(E),u(!0)},j=()=>{T&&r({key:s.trim(),type:p,label:m.trim(),multiple:y})},D=!e.includes(s.trim()),M=p==="label"?/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(s.trim()):/^[a-zA-Z][a-zA-Z0-9_]*$/.test(s.trim()),T=s.trim()&&m.trim()&&D&&M;return a.jsxs(Qt,{open:t,onClose:n,maxWidth:"sm",fullWidth:!0,"data-component-name":"cmp:AddFieldDialog",children:[a.jsx(Yt,{children:"フィールドを追加"}),a.jsx(Jt,{children:a.jsxs(B,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[a.jsx(Xe,{label:"ラベル",value:m,onChange:E=>C(E.target.value),required:!0,fullWidth:!0,size:"small",autoFocus:!0}),a.jsx(Xe,{label:"キー",value:s,onChange:E=>S(E.target.value),required:!0,fullWidth:!0,size:"small",error:!!s&&(!D||!M),helperText:s&&!D?"既に存在するキーです":s&&!M?"英字で始まり、英数字とアンダースコアのみ使用可能":"ラベルから自動生成されます",slotProps:{input:{sx:{fontFamily:"monospace"}}}}),a.jsxs(_n,{fullWidth:!0,size:"small",children:[a.jsx(nr,{children:"タイプ"}),a.jsx(wn,{value:p,label:"タイプ",onChange:E=>{const k=E.target.value;f(k),k==="label"&&!l&&i(Gce()),k!=="relation"&&v(!1)},children:ab.map(E=>{const k=Ru(E);return a.jsx(nt,{value:E,children:a.jsxs(B,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(k,{fontSize:"small"}),a.jsx("span",{children:Mp[E]})]})},E)})})]}),p==="relation"&&a.jsx(_r,{control:a.jsx(es,{checked:y,onChange:E=>v(E.target.checked)}),label:"複数値を許可"})]})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:n,children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:j,disabled:!T,children:"追加"})]})]})}function Kce({open:t,fieldKey:e,fieldType:n,onClose:r,onDelete:s}){const i=n==="label";return a.jsxs(Qt,{open:t,onClose:r,maxWidth:"xs",fullWidth:!0,"data-component-name":"cmp:DeleteFieldDialog",children:[a.jsx(Yt,{children:i?"ラベルの削除":"フィールドの削除"}),a.jsxs(Jt,{children:[a.jsxs(Eo,{children:[i?"ラベル":"フィールド"," ",a.jsx(G,{component:"span",fontWeight:"bold",fontFamily:"monospace",children:e})," ","を削除しますか?"]}),!i&&a.jsx(Eo,{sx:{mt:1,color:"error.main"},children:"この操作は元に戻せません。既存のコンテンツからもこのフィールドのデータが失われます。"})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:r,children:"キャンセル"}),a.jsx(pe,{variant:"contained",color:"error",onClick:s,children:"削除"})]})]})}function Qce({open:t,groupName:e,fieldCount:n,onClose:r,onConfirm:s}){const[i,l]=b.useState(!1);b.useEffect(()=>{t&&l(!1)},[t]);const u=()=>{s(i)};return a.jsxs(Qt,{open:t,onClose:r,maxWidth:"sm",fullWidth:!0,"data-component-name":"cmp:DeleteGroupDialog",children:[a.jsxs(Yt,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(IP,{color:"warning"}),"グループを削除"]}),a.jsxs(Jt,{children:[a.jsxs(G,{gutterBottom:!0,children:["グループ「",a.jsx("strong",{children:e}),"」を削除しますか?"]}),n>0&&a.jsxs(B,{sx:{mt:2,p:2,bgcolor:"grey.100",borderRadius:1},children:[a.jsxs(G,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:["このグループには ",n," 件のフィールドが含まれています。"]}),a.jsx(_r,{control:a.jsx(es,{checked:i,onChange:p=>l(p.target.checked),color:"error"}),label:a.jsx(G,{variant:"body2",color:"error.main",children:"フィールドも一緒に削除する"})}),a.jsx(G,{variant:"caption",color:"text.secondary",display:"block",sx:{mt:1},children:"チェックしない場合、フィールドはグループから外れて未分類になります。"})]}),n===0&&a.jsx(G,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"このグループは空です。"})]}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:r,children:"キャンセル"}),a.jsx(pe,{onClick:u,color:"error",variant:"contained",children:"削除"})]})]})}function Jce({name:t,color:e,canMoveUp:n,canMoveDown:r,onMoveUp:s,onMoveDown:i,onRename:l,onDelete:u}){const[p,f]=b.useState(!1),[m,g]=b.useState(t),y=b.useRef(null);b.useEffect(()=>{p&&y.current&&(y.current.focus(),y.current.select())},[p]),b.useEffect(()=>{g(t)},[t]);const v=()=>{g(t),f(!0)},C=()=>{const j=m.trim();j&&j!==t&&(l==null||l(j)),f(!1)},S=j=>{j.key==="Enter"?C():j.key==="Escape"&&(g(t),f(!1))};return a.jsxs(B,{"data-component-name":"cmp:GroupHeader",sx:{display:"flex",alignItems:"center",gap:1,mb:1,mt:2,px:1.5,py:.75,bgcolor:e.bg,borderLeft:4,borderColor:e.border,borderRadius:"0 4px 4px 0"},children:[a.jsx(ic,{fontSize:"small",sx:{color:e.border}}),p?a.jsx(Xe,{inputRef:y,value:m,onChange:j=>g(j.target.value),onBlur:C,onKeyDown:S,size:"small",variant:"standard",sx:{flex:1,maxWidth:200,"& .MuiInputBase-input":{fontSize:"0.875rem",fontWeight:600,py:0}}}):a.jsx(Er,{title:"クリックして編集",children:a.jsx(G,{variant:"subtitle2",fontWeight:600,onClick:v,sx:{cursor:"pointer","&:hover":{textDecoration:"underline"}},children:t})}),a.jsxs(B,{sx:{ml:"auto",display:"flex",gap:.5},children:[a.jsx(Er,{title:"上に移動",children:a.jsx("span",{children:a.jsx(ft,{size:"small",disabled:!n,onClick:s,sx:{p:.25},children:a.jsx(TP,{fontSize:"small"})})})}),a.jsx(Er,{title:"下に移動",children:a.jsx("span",{children:a.jsx(ft,{size:"small",disabled:!r,onClick:i,sx:{p:.25},children:a.jsx(w2,{fontSize:"small"})})})}),a.jsx(Er,{title:"グループを削除",children:a.jsx(ft,{size:"small",onClick:u,sx:{p:.25,color:"error.main"},children:a.jsx(zn,{fontSize:"small"})})})]})]})}function Yce({groupId:t,color:e,isOver:n}){const{setNodeRef:r}=T5({id:`empty-group:${t}`});return a.jsx(B,{ref:r,"data-group":t,"data-droppable-group":t,sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:80,bgcolor:n?wt((e==null?void 0:e.bg)??"#e3f2fd",.8):wt((e==null?void 0:e.bg)??"#f5f5f5",.4),border:"2px dashed",borderColor:n?"primary.main":(e==null?void 0:e.border)??"divider",borderRadius:1,p:2,transition:"all 0.2s ease"},children:a.jsx(G,{color:n?"primary.main":"text.secondary",variant:"body2",children:n?"ここにドロップしてグループに追加":"フィールドをここにドラッグしてグループに追加"})})}function Xce({useCase:t,editorMode:e,canEdit:n=!0}){const r=t.getState();b.useEffect(()=>{t.prepareJsonForMode(e)},[t,e,r.editingId]);const{contentTypeId:s,editingLabel:i,editingFields:l,editingGroups:u,selectedFieldKey:p,selectedField:f,isSaving:m,isDirty:g,message:y,addFieldDialogOpen:v,deleteFieldDialogOpen:C,contentTypeList:S,unsavedGuard:j,jsonSchemaText:D,jsonUiText:M,jsonSchemaIsDirty:T,jsonUiIsDirty:E,tabSwitchDialogOpen:k}=r,A=Rce(l,u),[O,I]=b.useState(null),[$,R]=b.useState(null),P=O?l.find(be=>be.key===O):null,[z,N]=b.useState(!1),[H,U]=b.useState(""),[L,W]=b.useState(!1),[K,Q]=b.useState(null),le=(be,Ae,Ne)=>{Q({id:be,label:Ae,fieldCount:Ne}),W(!0)},F=()=>{W(!1),Q(null)},J=be=>{K&&t.removeGroup(K.id,be),F()},ie=Lm(Do(Tu,{activationConstraint:{distance:3}}),Do(ju,{coordinateGetter:Fm})),te=be=>{I(be.active.id)},de=be=>{var Ae;R((Ae=be.over)==null?void 0:Ae.id)},fe=be=>{const{active:Ae,over:Ne}=be;if(I(null),R(null),!Ne)return;const Ie=Ae.id,Fe=Ne.id;if(Ie===Fe)return;if(Fe.startsWith("empty-group:")){const tt=Fe.replace("empty-group:",""),Ve=O1(Ie,u);t.moveFieldToGroup(Ie,Ve,tt,0);return}const ct=O1(Fe,u),Me=O1(Ie,u);if(Me!==ct){const tt=A.find(Ve=>Ve.id===ct);if(tt){const Ve=tt.fields.findIndex(it=>it.key===Fe);t.moveFieldToGroup(Ie,Me,ct,Ve)}else t.moveFieldToGroup(Ie,Me,ct)}else if(ct!==null){const tt=A.find(Ve=>Ve.id===ct);if(tt){const Ve=tt.fields.findIndex(Z=>Z.key===Ie),it=tt.fields.findIndex(Z=>Z.key===Fe);Ve!==-1&&it!==-1&&t.reorderFieldInGroup(ct,Ve,it)}}else t.reorderUngroupedFields(Ie,Fe)},Re=be=>{const Ae=be.fields.map(Ne=>Ne.key);if(be.fields.length===0&&be.id!==null){const Ne=$===`empty-group:${be.id}`;return a.jsx(Yce,{groupId:be.id,color:be.color,isOver:Ne})}return a.jsx(Nm,{items:Ae,strategy:Xx,children:a.jsx(B,{"data-group":be.id??"__ungrouped__",sx:{display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,...be.id&&be.color&&{bgcolor:wt(be.color.bg,.4),p:1.5,borderRadius:1}},children:be.fields.map((Ne,Ie)=>{const Fe=$===Ne.key&&O!==Ne.key,ct=Ie>0?be.fields[Ie-1]:null,Me=(ct==null?void 0:ct.break)===!0;return a.jsxs(B,{"data-field-key":Ne.key,sx:{gridColumnStart:{xs:1,sm:Me?1:"auto"},gridColumnEnd:{xs:"span 12",sm:`span ${Ne.columns}`},position:"relative"},children:[Fe&&a.jsx(B,{sx:{position:"absolute",left:-8,top:0,bottom:0,width:4,bgcolor:"primary.main",borderRadius:1,zIndex:10}}),a.jsx(D4,{field:Ne,onEdit:n?()=>t.selectField(Ne.key):void 0,onDelete:n?()=>{t.selectField(Ne.key),t.openDeleteFieldDialog()}:void 0,onToggleBreak:n?()=>t.toggleFieldBreak(Ne.key):void 0,onChangeColumns:n?tt=>t.changeFieldColumns(Ne.key,tt):void 0})]},Ne.key)})})})},Pe=()=>a.jsxs(B,{"data-component-name":"cmp:JsonSchemaEditorContainer",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",maxWidth:"xl",mx:"auto",width:"100%"},children:[a.jsx(rm,{filePath:`frelio-data/site/content_types/${s}.json`,isSaving:m,isDirty:T,onFormat:n?()=>t.formatJson():void 0,onReset:n?()=>t.resetJson():void 0,onSave:n?()=>t.saveFromJson():void 0,readOnly:!n}),a.jsx(B,{"data-component-name":"cmp:JsonSchemaEditorWrapper",sx:{flex:1,overflow:"hidden",pb:1},children:a.jsx(nm,{value:D,onChange:n?be=>t.updateJsonSchemaText(be):void 0,height:"100%",readOnly:!n})})]}),$e=()=>a.jsxs(B,{"data-component-name":"cmp:JsonUiEditorContainer",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",maxWidth:"xl",mx:"auto",width:"100%"},children:[a.jsx(rm,{filePath:`frelio-data/admin/content_types/${s}.ui.json`,isSaving:m,isDirty:E,onFormat:n?()=>t.formatJson():void 0,onReset:n?()=>t.resetJson():void 0,onSave:n?()=>t.saveFromJson():void 0,readOnly:!n}),a.jsx(B,{"data-component-name":"cmp:JsonUiEditorWrapper",sx:{flex:1,overflow:"hidden",pb:1},children:a.jsx(nm,{value:M,onChange:n?be=>t.updateJsonUiText(be):void 0,height:"100%",readOnly:!n})})]}),we=()=>a.jsx(B,{"data-component-name":"cmp:UiEditorContainer",sx:{flex:1,overflow:"auto"},children:a.jsxs(ji,{maxWidth:"xl",sx:{py:3},children:[a.jsx(la,{title:i||"コンテンツタイプ編集",actions:n&&a.jsx(pe,{variant:"contained",startIcon:m?a.jsx(ut,{size:20,color:"inherit"}):a.jsx(na,{}),onClick:()=>t.save(),disabled:!g||m,children:m?"保存中...":"保存"})}),l.length===0?a.jsxs(B,{"data-component-name":"cmp:EmptyFieldsPlaceholder",sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",py:8,border:"2px dashed",borderColor:"divider",borderRadius:2},children:[a.jsx(G,{color:"text.secondary",gutterBottom:!0,children:"フィールドがありません"}),n&&a.jsx(pe,{variant:"outlined",startIcon:a.jsx(Qn,{}),onClick:()=>t.openAddFieldDialog(),children:"最初のフィールドを追加"})]}):a.jsxs($m,{sensors:ie,collisionDetection:Dne,onDragStart:te,onDragOver:de,onDragEnd:fe,children:[a.jsx(B,{"data-component-name":"cmp:FieldGroups",children:A.map((be,Ae)=>{const Ne=A.filter(ct=>ct.id!==null).length,Ie=be.id===null,Fe=Ne>0;return a.jsxs(B,{"data-component-name":"cmp:FieldGroupSection",sx:{mb:2},children:[be.id&&be.label&&be.color&&a.jsx(Jce,{name:be.label,color:be.color,canMoveUp:n&&Ae>1,canMoveDown:n&&Ae<Ne,onMoveUp:n?()=>t.moveGroupUp(be.id):void 0,onMoveDown:n?()=>t.moveGroupDown(be.id):void 0,onRename:n?ct=>t.renameGroup(be.id,ct):void 0,onDelete:n?()=>le(be.id,be.label,be.fields.length):void 0}),Re(be),n&&Ie&&Fe&&a.jsxs(B,{"data-component-name":"cmp:AddFieldButtons",sx:{display:"flex",justifyContent:"center",gap:1,mt:2,mb:2},children:[a.jsx(pe,{variant:"outlined",size:"small",startIcon:a.jsx(Qn,{}),onClick:()=>t.openAddFieldDialog(),children:"フィールド追加"}),a.jsx(pe,{variant:"outlined",size:"small",startIcon:a.jsx(ch,{}),onClick:()=>t.addLabel(),children:"ラベル追加"})]}),n&&be.id&&a.jsxs(B,{"data-component-name":"cmp:AddFieldToGroupButtons",sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1,mt:2,py:1},children:[a.jsx(G,{variant:"caption",color:"text.secondary",children:"このグループに"}),a.jsxs(B,{sx:{display:"flex",gap:1},children:[a.jsx(pe,{variant:"outlined",size:"small",startIcon:a.jsx(Qn,{}),onClick:()=>t.openAddFieldDialogForGroup(be.id),children:"フィールド追加"}),a.jsx(pe,{variant:"outlined",size:"small",startIcon:a.jsx(ch,{}),onClick:()=>t.addLabelToGroup(be.id),children:"ラベル追加"})]})]})]},be.id??"__ungrouped__")})}),a.jsx(B2,{children:P?a.jsx(Mce,{field:P}):null})]}),n&&u.length===0&&l.length>0&&a.jsxs(B,{"data-component-name":"cmp:AddFieldButtons",sx:{display:"flex",justifyContent:"center",gap:1,mt:2,mb:4},children:[a.jsx(pe,{variant:"outlined",size:"small",startIcon:a.jsx(Qn,{}),onClick:()=>t.openAddFieldDialog(),children:"フィールド追加"}),a.jsx(pe,{variant:"outlined",size:"small",startIcon:a.jsx(ch,{}),onClick:()=>t.addLabel(),children:"ラベル追加"})]}),n&&a.jsx(B,{"data-component-name":"cmp:AddGroupButton",sx:{display:"flex",justifyContent:"center",py:2},children:a.jsx(pe,{variant:"outlined",startIcon:a.jsx(C2,{}),onClick:()=>N(!0),children:"グループ追加"})})]})});return a.jsxs(B,{"data-component-name":"cmp:ContentTypeEditor",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e==="ui"&&we(),e==="json-schema"&&Pe(),e==="json-ui"&&$e(),a.jsx(R4,{field:f,isNewField:!1,contentTypeList:S,open:p!==null,onClose:()=>t.clearSelection(),onUpdate:be=>t.updateCurrentField(be)}),a.jsx(Zce,{open:v,existingKeys:l.map(be=>be.key),onClose:()=>{t.closeAddFieldDialog(),t.clearPendingGroupId()},onSubmit:be=>{const Ae=t.getPendingGroupId();Ae?(t.addFieldToGroup(be,Ae),t.clearPendingGroupId()):t.addField(be)}}),a.jsx(Kce,{open:C,fieldKey:(f==null?void 0:f.key)??"",fieldType:f==null?void 0:f.type,onClose:()=>t.closeDeleteFieldDialog(),onDelete:()=>t.deleteCurrentField()}),a.jsxs(Qt,{open:z,onClose:()=>{N(!1),U("")},maxWidth:"xs",fullWidth:!0,children:[a.jsx(Yt,{children:"グループを追加"}),a.jsx(Jt,{children:a.jsx(Xe,{autoFocus:!0,margin:"dense",label:"グループ名",fullWidth:!0,value:H,onChange:be=>U(be.target.value),onKeyDown:be=>{be.key==="Enter"&&H.trim()&&(t.addGroup(H.trim()),N(!1),U(""))}})}),a.jsxs(rn,{children:[a.jsx(pe,{onClick:()=>{N(!1),U("")},children:"キャンセル"}),a.jsx(pe,{variant:"contained",onClick:()=>{H.trim()&&(t.addGroup(H.trim()),N(!1),U(""))},disabled:!H.trim(),children:"追加"})]})]}),a.jsx(Qce,{open:L,groupName:(K==null?void 0:K.label)??"",fieldCount:(K==null?void 0:K.fieldCount)??0,onClose:F,onConfirm:J}),a.jsx(sb,{open:(j==null?void 0:j.isBlocked)??!1,onStay:()=>j==null?void 0:j.reset(),onLeave:()=>j==null?void 0:j.proceed()}),a.jsx(nb,{open:k,onStay:()=>t.cancelTabSwitch(),onDiscard:()=>t.discardAndSwitchTab(),onSaveAndSwitch:()=>t.saveAndSwitchTab()}),a.jsx(ea,{open:y!==null,autoHideDuration:4e3,onClose:()=>t.clearMessage(),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(zt,{severity:(y==null?void 0:y.type)??"info",onClose:()=>t.clearMessage(),children:y==null?void 0:y.text})})]})}const eue=["ui","json-schema","json-ui"],tue=Ss("/content-types/$contentTypeId/edit")({component:rue,validateSearch:t=>({field:typeof t.field=="string"?t.field:void 0,mode:eue.includes(t.mode)?t.mode:void 0})}),nue=[{label:"UI編集",value:"ui"},{label:"JSON(スキーマ)",value:"json-schema"},{label:"JSON(UI)",value:"json-ui"}];function rue(){const t=ur(),e=Di({from:"/content-types/$contentTypeId/edit"}),n=e.mode??"ui",{authUseCase:r}=rr(),{currentUser:s}=r.getState(),i=ws(s,"canViewContentType"),l=ws(s,"canEditContentType"),{contentTypeEditorUseCase:u}=lie(),{isLoading:p,error:f,editingLabel:m,contentTypeId:g}=u.getState();if(b.useEffect(()=>{s&&!i&&t({to:"/"})},[s,i,t]),!i)return null;if(p)return a.jsx(B,{"data-component-name":"cmp:ContentTypeEditPage",sx:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(ut,{})});if(f)return a.jsx(B,{"data-component-name":"cmp:ContentTypeEditPage",sx:{flex:1,overflow:"auto",p:3},children:a.jsxs(zt,{severity:"error",children:["エラー: ",f.message]})});const v={value:n,options:nue,onChange:C=>{t({to:".",search:{...e,mode:C==="ui"?void 0:C},replace:!0})}};return a.jsxs(B,{"data-component-name":"cmp:ContentTypeEditPage",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[a.jsx(B,{sx:{px:3,pt:2,flexShrink:0},children:a.jsx(no,{items:[{label:"コンテンツタイプ編集",to:"/content-types"},{label:m||g}],dropdown:v})}),a.jsx(Xce,{useCase:u,editorMode:n,canEdit:l})]})}const sue=iX.update({id:"/login",path:"/login",getParentRoute:()=>Bs}),iue=hX.update({id:"/",path:"/",getParentRoute:()=>Bs}),oue=kee.update({id:"/users/",path:"/users/",getParentRoute:()=>Bs}),aue=Gee.update({id:"/templates/",path:"/templates/",getParentRoute:()=>Bs}),lue=Lte.update({id:"/storage/",path:"/storage/",getParentRoute:()=>Bs}),cue=Gte.update({id:"/staging/",path:"/staging/",getParentRoute:()=>Bs}),uue=nne.update({id:"/deploy-history/",path:"/deploy-history/",getParentRoute:()=>Bs}),due=hie.update({id:"/content-types/",path:"/content-types/",getParentRoute:()=>Bs}),pue=nae.update({id:"/build-recipes/",path:"/build-recipes/",getParentRoute:()=>Bs}),fue=uae.update({id:"/auth/callback",path:"/auth/callback",getParentRoute:()=>Bs}),hue=X5.update({id:"/contents/$contentTypeId/",path:"/contents/$contentTypeId/",getParentRoute:()=>Bs}),mue=sce.update({id:"/contents/$contentTypeId/$contentId",path:"/contents/$contentTypeId/$contentId",getParentRoute:()=>Bs}),gue=wce.update({id:"/content-types/$contentTypeId/views",path:"/content-types/$contentTypeId/views",getParentRoute:()=>Bs}),yue=tue.update({id:"/content-types/$contentTypeId/edit",path:"/content-types/$contentTypeId/edit",getParentRoute:()=>Bs}),vue={IndexRoute:iue,LoginRoute:sue,AuthCallbackRoute:fue,BuildRecipesIndexRoute:pue,ContentTypesIndexRoute:due,DeployHistoryIndexRoute:uue,StagingIndexRoute:cue,StorageIndexRoute:lue,TemplatesIndexRoute:aue,UsersIndexRoute:oue,ContentTypesContentTypeIdEditRoute:yue,ContentTypesContentTypeIdViewsRoute:gue,ContentsContentTypeIdContentIdRoute:mue,ContentsContentTypeIdIndexRoute:hue},xue=Bs._addFileChildren(vue)._addFileTypes(),bue=new xN({defaultOptions:{queries:{staleTime:1e3*60*5,retry:1}}}),Sue=W$({routeTree:xue,basepath:"/admin/".replace(/\/$/,"")||"/"});wQ().then(()=>{Kz.createRoot(document.getElementById("root")).render(a.jsx(We.StrictMode,{children:a.jsx(bN,{client:bue,children:a.jsxs(k6,{theme:WK,children:[a.jsx(bH,{}),a.jsx(Z$,{router:Sue})]})})}))});export{Wr as $,aJ as A,gJ as B,xJ as C,yP as D,Ti as E,gP as F,wJ as G,S2 as H,jJ as I,TJ as J,bP as K,C2 as L,km as M,DJ as N,EJ as O,RJ as P,kJ as Q,MJ as R,SP as S,OJ as T,zn as U,Tp as V,AJ as W,wu as X,Ri as Y,_J as Z,IJ as _,lJ as a,Om as a$,CP as a0,PJ as a1,LJ as a2,zJ as a3,$J as a4,NJ as a5,ic as a6,FJ as a7,BJ as a8,UJ as a9,iY as aA,EP as aB,oY as aC,aY as aD,lY as aE,cY as aF,uY as aG,dY as aH,ip as aI,pY as aJ,RP as aK,Mm as aL,fY as aM,hY as aN,Fx as aO,mY as aP,gY as aQ,yY as aR,kC as aS,vY as aT,kP as aU,xY as aV,bY as aW,na as aX,SY as aY,CY as aZ,wY as a_,Nx as aa,VJ as ab,HJ as ac,WJ as ad,wP as ae,qJ as af,GJ as ag,jP as ah,ZJ as ai,KJ as aj,vc as ak,QJ as al,w2 as am,TP as an,JJ as ao,ch as ap,RC as aq,YJ as ar,j2 as as,DP as at,XJ as au,eY as av,tY as aw,nY as ax,rY as ay,sY as az,mP as b,Bx as b0,jY as b1,MP as b2,TY as b3,DY as b4,EY as b5,RY as b6,OP as b7,T2 as b8,kY as b9,MY as ba,OY as bb,AY as bc,_Y as bd,IY as be,PY as bf,AP as bg,_P as bh,LY as bi,zY as bj,IP as bk,$Y as bl,ye as c,Qn as d,cJ as e,uJ as f,dJ as g,zx as h,pJ as i,a as j,fJ as k,x2 as l,hJ as m,mJ as n,yJ as o,b2 as p,vJ as q,b as r,bJ as s,Ph as t,vP as u,xP as v,Jl as w,SJ as x,$x as y,CJ as z};
|