Files
Gnuboard7/public/build/core/template-engine.min.js
T
HeuJung 0bcd42ac04 fix(admin_basic,core,ecommerce,plugins,basic): stale dist 전수 재빌드 + 소스맵 게이트 audit 룰 신설
공개 — admin_basic 1.0.4 가 이전 소스로 빌드된 stale dist 를 릴리즈에
실어 주문 상세 합계행에 표현식 원문이 노출되던 회귀를 1.0.5 재빌드로 재수록.

- admin_basic 1.0.5: --production 재빌드 + 서빙 번들 회귀 E2E(red→green) + 시나리오 매니페스트
- 전수 점검: sourcemap 잔존 9확장+코어 3번들 --production 재빌드, untracked .map 3개 삭제
 (+1 bump: gdpr 1.0.3 / tosspayments 1.0.2 / verification_kginicis 1.0.3 /
 verification_nhnkcp 1.0.1 / basic 1.1.1 — 미공개 워킹 5건은 CHANGELOG 누적)
- 리터럴 대조 전수: 기능 drift 는 admin_basic 단독 확정(타 대상 차집합 0), 릴리즈 패리티 7/7 일치
- board/page 사문 build 스크립트 제거 (vite.config 부재 — module:build --all 실패 요인)
- audit 룰 신설: extension-dist-sourcemap-reference(error),
 extension-dist-source-literal-sync(warn) + coverage/룰 테스트/규정 문서 정정
2026-08-12 14:31:26 +09:00

287 lines
742 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var qx=Object.defineProperty;var Gx=(Wt,Jr,Qr)=>Jr in Wt?qx(Wt,Jr,{enumerable:!0,configurable:!0,writable:!0,value:Qr}):Wt[Jr]=Qr;var $=(Wt,Jr,Qr)=>Gx(Wt,typeof Jr!="symbol"?Jr+"":Jr,Qr);(function(Wt){"use strict";function Jr(o,e){for(var r=0;r<e.length;r++){const a=e[r];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in o)){const l=Object.getOwnPropertyDescriptor(a,i);l&&Object.defineProperty(o,i,l.get?l:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}function Qr(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Ju={exports:{}},Ke={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Lg;function IS(){if(Lg)return Ke;Lg=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.iterator;function S(H){return H===null||typeof H!="object"?null:(H=w&&H[w]||H["@@iterator"],typeof H=="function"?H:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,x={};function R(H,T,ge){this.props=H,this.context=T,this.refs=x,this.updater=ge||v}R.prototype.isReactComponent={},R.prototype.setState=function(H,T){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,T,"setState")},R.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function M(){}M.prototype=R.prototype;function O(H,T,ge){this.props=H,this.context=T,this.refs=x,this.updater=ge||v}var L=O.prototype=new M;L.constructor=O,A(L,R.prototype),L.isPureReactComponent=!0;var q=Array.isArray;function G(){}var B={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function fe(H,T,ge){var de=ge.ref;return{$$typeof:o,type:H,key:T,ref:de!==void 0?de:null,props:ge}}function Ce(H,T){return fe(H.type,T,H.props)}function ke(H){return typeof H=="object"&&H!==null&&H.$$typeof===o}function Ue(H){var T={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(ge){return T[ge]})}var Pe=/\/+/g;function qe(H,T){return typeof H=="object"&&H!==null&&H.key!=null?Ue(""+H.key):T.toString(36)}function wt(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(G,G):(H.status="pending",H.then(function(T){H.status==="pending"&&(H.status="fulfilled",H.value=T)},function(T){H.status==="pending"&&(H.status="rejected",H.reason=T)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function J(H,T,ge,de,me){var ae=typeof H;(ae==="undefined"||ae==="boolean")&&(H=null);var Re=!1;if(H===null)Re=!0;else switch(ae){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(H.$$typeof){case o:case e:Re=!0;break;case m:return Re=H._init,J(Re(H._payload),T,ge,de,me)}}if(Re)return me=me(H),Re=de===""?"."+qe(H,0):de,q(me)?(ge="",Re!=null&&(ge=Re.replace(Pe,"$&/")+"/"),J(me,T,ge,"",function(Ge){return Ge})):me!=null&&(ke(me)&&(me=Ce(me,ge+(me.key==null||H&&H.key===me.key?"":(""+me.key).replace(Pe,"$&/")+"/")+Re)),T.push(me)),1;Re=0;var ze=de===""?".":de+":";if(q(H))for(var $e=0;$e<H.length;$e++)de=H[$e],ae=ze+qe(de,$e),Re+=J(de,T,ge,ae,me);else if($e=S(H),typeof $e=="function")for(H=$e.call(H),$e=0;!(de=H.next()).done;)de=de.value,ae=ze+qe(de,$e++),Re+=J(de,T,ge,ae,me);else if(ae==="object"){if(typeof H.then=="function")return J(wt(H),T,ge,de,me);throw T=String(H),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return Re}function he(H,T,ge){if(H==null)return H;var de=[],me=0;return J(H,de,"","",function(ae){return T.call(ge,ae,me++)}),de}function Ee(H){if(H._status===-1){var T=H._result;T=T(),T.then(function(ge){(H._status===0||H._status===-1)&&(H._status=1,H._result=ge)},function(ge){(H._status===0||H._status===-1)&&(H._status=2,H._result=ge)}),H._status===-1&&(H._status=0,H._result=T)}if(H._status===1)return H._result.default;throw H._result}var Z=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},pe={map:he,forEach:function(H,T,ge){he(H,function(){T.apply(this,arguments)},ge)},count:function(H){var T=0;return he(H,function(){T++}),T},toArray:function(H){return he(H,function(T){return T})||[]},only:function(H){if(!ke(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return Ke.Activity=y,Ke.Children=pe,Ke.Component=R,Ke.Fragment=r,Ke.Profiler=i,Ke.PureComponent=O,Ke.StrictMode=a,Ke.Suspense=f,Ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Ke.__COMPILER_RUNTIME={__proto__:null,c:function(H){return B.H.useMemoCache(H)}},Ke.cache=function(H){return function(){return H.apply(null,arguments)}},Ke.cacheSignal=function(){return null},Ke.cloneElement=function(H,T,ge){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var de=A({},H.props),me=H.key;if(T!=null)for(ae in T.key!==void 0&&(me=""+T.key),T)!K.call(T,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&T.ref===void 0||(de[ae]=T[ae]);var ae=arguments.length-2;if(ae===1)de.children=ge;else if(1<ae){for(var Re=Array(ae),ze=0;ze<ae;ze++)Re[ze]=arguments[ze+2];de.children=Re}return fe(H.type,me,de)},Ke.createContext=function(H){return H={$$typeof:c,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:l,_context:H},H},Ke.createElement=function(H,T,ge){var de,me={},ae=null;if(T!=null)for(de in T.key!==void 0&&(ae=""+T.key),T)K.call(T,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(me[de]=T[de]);var Re=arguments.length-2;if(Re===1)me.children=ge;else if(1<Re){for(var ze=Array(Re),$e=0;$e<Re;$e++)ze[$e]=arguments[$e+2];me.children=ze}if(H&&H.defaultProps)for(de in Re=H.defaultProps,Re)me[de]===void 0&&(me[de]=Re[de]);return fe(H,ae,me)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(H){return{$$typeof:d,render:H}},Ke.isValidElement=ke,Ke.lazy=function(H){return{$$typeof:m,_payload:{_status:-1,_result:H},_init:Ee}},Ke.memo=function(H,T){return{$$typeof:g,type:H,compare:T===void 0?null:T}},Ke.startTransition=function(H){var T=B.T,ge={};B.T=ge;try{var de=H(),me=B.S;me!==null&&me(ge,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(G,Z)}catch(ae){Z(ae)}finally{T!==null&&ge.types!==null&&(T.types=ge.types),B.T=T}},Ke.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Ke.use=function(H){return B.H.use(H)},Ke.useActionState=function(H,T,ge){return B.H.useActionState(H,T,ge)},Ke.useCallback=function(H,T){return B.H.useCallback(H,T)},Ke.useContext=function(H){return B.H.useContext(H)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(H,T){return B.H.useDeferredValue(H,T)},Ke.useEffect=function(H,T){return B.H.useEffect(H,T)},Ke.useEffectEvent=function(H){return B.H.useEffectEvent(H)},Ke.useId=function(){return B.H.useId()},Ke.useImperativeHandle=function(H,T,ge){return B.H.useImperativeHandle(H,T,ge)},Ke.useInsertionEffect=function(H,T){return B.H.useInsertionEffect(H,T)},Ke.useLayoutEffect=function(H,T){return B.H.useLayoutEffect(H,T)},Ke.useMemo=function(H,T){return B.H.useMemo(H,T)},Ke.useOptimistic=function(H,T){return B.H.useOptimistic(H,T)},Ke.useReducer=function(H,T,ge){return B.H.useReducer(H,T,ge)},Ke.useRef=function(H){return B.H.useRef(H)},Ke.useState=function(H){return B.H.useState(H)},Ke.useSyncExternalStore=function(H,T,ge){return B.H.useSyncExternalStore(H,T,ge)},Ke.useTransition=function(){return B.H.useTransition()},Ke.version="19.2.0",Ke}var Mg;function Qu(){return Mg||(Mg=1,Ju.exports=IS()),Ju.exports}var N=Qu();const We=Qr(N);var Zu={exports:{}},Qs={},ed={exports:{}},td={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var $g;function HS(){return $g||($g=1,(function(o){function e(J,he){var Ee=J.length;J.push(he);e:for(;0<Ee;){var Z=Ee-1>>>1,pe=J[Z];if(0<i(pe,he))J[Z]=he,J[Ee]=pe,Ee=Z;else break e}}function r(J){return J.length===0?null:J[0]}function a(J){if(J.length===0)return null;var he=J[0],Ee=J.pop();if(Ee!==he){J[0]=Ee;e:for(var Z=0,pe=J.length,H=pe>>>1;Z<H;){var T=2*(Z+1)-1,ge=J[T],de=T+1,me=J[de];if(0>i(ge,Ee))de<pe&&0>i(me,ge)?(J[Z]=me,J[de]=Ee,Z=de):(J[Z]=ge,J[T]=Ee,Z=T);else if(de<pe&&0>i(me,Ee))J[Z]=me,J[de]=Ee,Z=de;else break e}}return he}function i(J,he){var Ee=J.sortIndex-he.sortIndex;return Ee!==0?Ee:J.id-he.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;o.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();o.unstable_now=function(){return c.now()-d}}var f=[],g=[],m=1,y=null,w=3,S=!1,v=!1,A=!1,x=!1,R=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function L(J){for(var he=r(g);he!==null;){if(he.callback===null)a(g);else if(he.startTime<=J)a(g),he.sortIndex=he.expirationTime,e(f,he);else break;he=r(g)}}function q(J){if(A=!1,L(J),!v)if(r(f)!==null)v=!0,G||(G=!0,Ue());else{var he=r(g);he!==null&&wt(q,he.startTime-J)}}var G=!1,B=-1,K=5,fe=-1;function Ce(){return x?!0:!(o.unstable_now()-fe<K)}function ke(){if(x=!1,G){var J=o.unstable_now();fe=J;var he=!0;try{e:{v=!1,A&&(A=!1,M(B),B=-1),S=!0;var Ee=w;try{t:{for(L(J),y=r(f);y!==null&&!(y.expirationTime>J&&Ce());){var Z=y.callback;if(typeof Z=="function"){y.callback=null,w=y.priorityLevel;var pe=Z(y.expirationTime<=J);if(J=o.unstable_now(),typeof pe=="function"){y.callback=pe,L(J),he=!0;break t}y===r(f)&&a(f),L(J)}else a(f);y=r(f)}if(y!==null)he=!0;else{var H=r(g);H!==null&&wt(q,H.startTime-J),he=!1}}break e}finally{y=null,w=Ee,S=!1}he=void 0}}finally{he?Ue():G=!1}}}var Ue;if(typeof O=="function")Ue=function(){O(ke)};else if(typeof MessageChannel<"u"){var Pe=new MessageChannel,qe=Pe.port2;Pe.port1.onmessage=ke,Ue=function(){qe.postMessage(null)}}else Ue=function(){R(ke,0)};function wt(J,he){B=R(function(){J(o.unstable_now())},he)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(J){J.callback=null},o.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<J?Math.floor(1e3/J):5},o.unstable_getCurrentPriorityLevel=function(){return w},o.unstable_next=function(J){switch(w){case 1:case 2:case 3:var he=3;break;default:he=w}var Ee=w;w=he;try{return J()}finally{w=Ee}},o.unstable_requestPaint=function(){x=!0},o.unstable_runWithPriority=function(J,he){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var Ee=w;w=J;try{return he()}finally{w=Ee}},o.unstable_scheduleCallback=function(J,he,Ee){var Z=o.unstable_now();switch(typeof Ee=="object"&&Ee!==null?(Ee=Ee.delay,Ee=typeof Ee=="number"&&0<Ee?Z+Ee:Z):Ee=Z,J){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=Ee+pe,J={id:m++,callback:he,priorityLevel:J,startTime:Ee,expirationTime:pe,sortIndex:-1},Ee>Z?(J.sortIndex=Ee,e(g,J),r(f)===null&&J===r(g)&&(A?(M(B),B=-1):A=!0,wt(q,Ee-Z))):(J.sortIndex=pe,e(f,J),v||S||(v=!0,G||(G=!0,Ue()))),J},o.unstable_shouldYield=Ce,o.unstable_wrapCallback=function(J){var he=w;return function(){var Ee=w;w=he;try{return J.apply(this,arguments)}finally{w=Ee}}}})(td)),td}var Ng;function jS(){return Ng||(Ng=1,ed.exports=HS()),ed.exports}var nd={exports:{}},vn={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ig;function zS(){if(Ig)return vn;Ig=1;var o=Qu();function e(f){var g="https://react.dev/errors/"+f;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)g+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(e(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(f,g,m){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:y==null?null:""+y,children:f,containerInfo:g,implementation:m}}var c=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,g){if(f==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return vn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,vn.createPortal=function(f,g){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(e(299));return l(f,g,null,m)},vn.flushSync=function(f){var g=c.T,m=a.p;try{if(c.T=null,a.p=2,f)return f()}finally{c.T=g,a.p=m,a.d.f()}},vn.preconnect=function(f,g){typeof f=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,a.d.C(f,g))},vn.prefetchDNS=function(f){typeof f=="string"&&a.d.D(f)},vn.preinit=function(f,g){if(typeof f=="string"&&g&&typeof g.as=="string"){var m=g.as,y=d(m,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;m==="style"?a.d.S(f,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:y,integrity:w,fetchPriority:S}):m==="script"&&a.d.X(f,{crossOrigin:y,integrity:w,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},vn.preinitModule=function(f,g){if(typeof f=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var m=d(g.as,g.crossOrigin);a.d.M(f,{crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&a.d.M(f)},vn.preload=function(f,g){if(typeof f=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var m=g.as,y=d(m,g.crossOrigin);a.d.L(f,m,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},vn.preloadModule=function(f,g){if(typeof f=="string")if(g){var m=d(g.as,g.crossOrigin);a.d.m(f,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else a.d.m(f)},vn.requestFormReset=function(f){a.d.r(f)},vn.unstable_batchedUpdates=function(f,g){return f(g)},vn.useFormState=function(f,g,m){return c.H.useFormState(f,g,m)},vn.useFormStatus=function(){return c.H.useHostTransitionStatus()},vn.version="19.2.0",vn}var Hg;function jg(){if(Hg)return nd.exports;Hg=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(e){console.error(e)}}return o(),nd.exports=zS(),nd.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var zg;function US(){if(zg)return Qs;zg=1;var o=jS(),e=Qu(),r=jg();function a(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function l(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function c(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function d(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(l(t)!==t)throw Error(a(188))}function g(t){var n=t.alternate;if(!n){if(n=l(t),n===null)throw Error(a(188));return n!==t?null:t}for(var s=t,u=n;;){var h=s.return;if(h===null)break;var p=h.alternate;if(p===null){if(u=h.return,u!==null){s=u;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===s)return f(h),t;if(p===u)return f(h),n;p=p.sibling}throw Error(a(188))}if(s.return!==u.return)s=h,u=p;else{for(var C=!1,k=h.child;k;){if(k===s){C=!0,s=h,u=p;break}if(k===u){C=!0,u=h,s=p;break}k=k.sibling}if(!C){for(k=p.child;k;){if(k===s){C=!0,s=p,u=h;break}if(k===u){C=!0,u=p,s=h;break}k=k.sibling}if(!C)throw Error(a(189))}}if(s.alternate!==u)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:n}function m(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=m(t),n!==null)return n;t=t.sibling}return null}var y=Object.assign,w=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),O=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),Ce=Symbol.for("react.memo_cache_sentinel"),ke=Symbol.iterator;function Ue(t){return t===null||typeof t!="object"?null:(t=ke&&t[ke]||t["@@iterator"],typeof t=="function"?t:null)}var Pe=Symbol.for("react.client.reference");function qe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Pe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case R:return"Profiler";case x:return"StrictMode";case q:return"Suspense";case G:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case v:return"Portal";case O:return t.displayName||"Context";case M:return(t._context.displayName||"Context")+".Consumer";case L:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B:return n=t.displayName||null,n!==null?n:qe(t.type)||"Memo";case K:n=t._payload,t=t._init;try{return qe(t(n))}catch{}}return null}var wt=Array.isArray,J=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ee={pending:!1,data:null,method:null,action:null},Z=[],pe=-1;function H(t){return{current:t}}function T(t){0>pe||(t.current=Z[pe],Z[pe]=null,pe--)}function ge(t,n){pe++,Z[pe]=t.current,t.current=n}var de=H(null),me=H(null),ae=H(null),Re=H(null);function ze(t,n){switch(ge(ae,n),ge(me,t),ge(de,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?rS(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=rS(n),t=aS(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}T(de),ge(de,t)}function $e(){T(de),T(me),T(ae)}function Ge(t){t.memoizedState!==null&&ge(Re,t);var n=de.current,s=aS(n,t.type);n!==s&&(ge(me,t),ge(de,s))}function At(t){me.current===t&&(T(de),T(me)),Re.current===t&&(T(Re),Il._currentValue=Ee)}var yt,dn;function Tt(t){if(yt===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);yt=n&&n[1]||"",dn=-1<s.stack.indexOf(`
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+yt+t+dn}var Yt=!1;function ln(t,n){if(!t||Yt)return"";Yt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(n){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(te){var Q=te}Reflect.construct(t,[],le)}else{try{le.call()}catch(te){Q=te}t.call(le.prototype)}}else{try{throw Error()}catch(te){Q=te}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(te){if(te&&Q&&typeof te.stack=="string")return[te.stack,Q.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=u.DetermineComponentFrameRoot(),C=p[0],k=p[1];if(C&&k){var z=C.split(`
`),Y=k.split(`
`);for(h=u=0;u<z.length&&!z[u].includes("DetermineComponentFrameRoot");)u++;for(;h<Y.length&&!Y[h].includes("DetermineComponentFrameRoot");)h++;if(u===z.length||h===Y.length)for(u=z.length-1,h=Y.length-1;1<=u&&0<=h&&z[u]!==Y[h];)h--;for(;1<=u&&0<=h;u--,h--)if(z[u]!==Y[h]){if(u!==1||h!==1)do if(u--,h--,0>h||z[u]!==Y[h]){var ne=`
`+z[u].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=u&&0<=h);break}}}finally{Yt=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Tt(s):""}function zt(t,n){switch(t.tag){case 26:case 27:case 5:return Tt(t.type);case 16:return Tt("Lazy");case 13:return t.child!==n&&n!==null?Tt("Suspense Fallback"):Tt("Suspense");case 19:return Tt("SuspenseList");case 0:case 15:return ln(t.type,!1);case 11:return ln(t.type.render,!1);case 1:return ln(t.type,!0);case 31:return Tt("Activity");default:return""}}function Tr(t){try{var n="",s=null;do n+=zt(t,s),s=t,t=t.return;while(t);return n}catch(u){return`
Error generating stack: `+u.message+`
`+u.stack}}var wn=Object.prototype.hasOwnProperty,cn=o.unstable_scheduleCallback,fn=o.unstable_cancelCallback,sr=o.unstable_shouldYield,Wn=o.unstable_requestPaint,Ut=o.unstable_now,bt=o.unstable_getCurrentPriorityLevel,ra=o.unstable_ImmediatePriority,Ln=o.unstable_UserBlockingPriority,An=o.unstable_NormalPriority,xn=o.unstable_LowPriority,Mn=o.unstable_IdlePriority,hn=o.log,aa=o.unstable_setDisableYieldValue,$n=null,Vt=null;function Cn(t){if(typeof hn=="function"&&aa(t),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode($n,t)}catch{}}var nn=Math.clz32?Math.clz32:ce,V=Math.log,oe=Math.LN2;function ce(t){return t>>>=0,t===0?32:31-(V(t)/oe|0)|0}var X=256,ve=262144,ue=4194304;function we(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function _e(t,n,s){var u=t.pendingLanes;if(u===0)return 0;var h=0,p=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var k=u&134217727;return k!==0?(u=k&~p,u!==0?h=we(u):(C&=k,C!==0?h=we(C):s||(s=k&~t,s!==0&&(h=we(s))))):(k=u&~p,k!==0?h=we(k):C!==0?h=we(C):s||(s=u&~t,s!==0&&(h=we(s)))),h===0?0:n!==0&&n!==h&&(n&p)===0&&(p=h&-h,s=n&-n,p>=s||p===32&&(s&4194048)!==0)?n:h}function Be(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function xe(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 De(){var t=ue;return ue<<=1,(ue&62914560)===0&&(ue=4194304),t}function Ae(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function et(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ne(t,n,s,u,h,p){var C=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var k=t.entanglements,z=t.expirationTimes,Y=t.hiddenUpdates;for(s=C&~s;0<s;){var ne=31-nn(s),le=1<<ne;k[ne]=0,z[ne]=-1;var Q=Y[ne];if(Q!==null)for(Y[ne]=null,ne=0;ne<Q.length;ne++){var te=Q[ne];te!==null&&(te.lane&=-536870913)}s&=~le}u!==0&&je(t,u,0),p!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=p&~(C&~n))}function je(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var u=31-nn(n);t.entangledLanes|=n,t.entanglements[u]=t.entanglements[u]|1073741824|s&261930}function Se(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var u=31-nn(s),h=1<<u;h&n|t[u]&n&&(t[u]|=n),s&=~h}}function Me(t,n){var s=n&-n;return s=(s&42)!==0?1:Ze(s),(s&(t.suspendedLanes|n))!==0?0:s}function Ze(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function kt(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ot(){var t=he.p;return t!==0?t:(t=window.event,t===void 0?32:TS(t.type))}function Nn(t,n){var s=he.p;try{return he.p=t,n()}finally{he.p=s}}var $t=Math.random().toString(36).slice(2),Nt="__reactFiber$"+$t,gn="__reactProps$"+$t,In="__reactContainer$"+$t,No="__reactEvents$"+$t,Sf="__reactListeners$"+$t,wf="__reactHandles$"+$t,hs="__reactResources$"+$t,ia="__reactMarker$"+$t;function Io(t){delete t[Nt],delete t[gn],delete t[No],delete t[Sf],delete t[wf]}function Ia(t){var n=t[Nt];if(n)return n;for(var s=t.parentNode;s;){if(n=s[In]||s[Nt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=dS(t);t!==null;){if(s=t[Nt])return s;t=dS(t)}return n}t=s,s=t.parentNode}return null}function Ha(t){if(t=t[Nt]||t[In]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function _i(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(a(33))}function qr(t){var n=t[hs];return n||(n=t[hs]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Xt(t){t[ia]=!0}var Mc=new Set,$c={};function sa(t,n){ja(t,n),ja(t+"Capture",n)}function ja(t,n){for($c[t]=n,t=0;t<n.length;t++)Mc.add(n[t])}var kr=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]*$"),Ho={},Gr={};function jo(t){return wn.call(Gr,t)?!0:wn.call(Ho,t)?!1:kr.test(t)?Gr[t]=!0:(Ho[t]=!0,!1)}function gs(t,n,s){if(jo(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var u=n.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function ps(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function Rr(t,n,s,u){if(u===null)t.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+u)}}function Hn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ms(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Cf(t,n,s){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,p=u.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return h.call(this)},set:function(C){s=""+C,p.call(this,C)}}),Object.defineProperty(t,n,{enumerable:u.enumerable}),{getValue:function(){return s},setValue:function(C){s=""+C},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function zo(t){if(!t._valueTracker){var n=ms(t)?"checked":"value";t._valueTracker=Cf(t,n,""+t[n])}}function Uo(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),u="";return t&&(u=ms(t)?t.checked?"true":"false":t.value),t=u,t!==s?(n.setValue(t),!0):!1}function oa(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ai=/[\n"\\]/g;function jn(t){return t.replace(Ai,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function la(t,n,s,u,h,p,C,k){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),n!=null?C==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Hn(n)):t.value!==""+Hn(n)&&(t.value=""+Hn(n)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),n!=null?Bo(t,C,Hn(n)):s!=null?Bo(t,C,Hn(s)):u!=null&&t.removeAttribute("value"),h==null&&p!=null&&(t.defaultChecked=!!p),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.name=""+Hn(k):t.removeAttribute("name")}function Nc(t,n,s,u,h,p,C,k){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),n!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||n!=null)){zo(t);return}s=s!=null?""+Hn(s):"",n=n!=null?""+Hn(n):s,k||n===t.value||(t.value=n),t.defaultValue=n}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=k?t.checked:!!u,t.defaultChecked=!!u,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),zo(t)}function Bo(t,n,s){n==="number"&&oa(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function za(t,n,s,u){if(t=t.options,n){n={};for(var h=0;h<s.length;h++)n["$"+s[h]]=!0;for(s=0;s<t.length;s++)h=n.hasOwnProperty("$"+t[s].value),t[s].selected!==h&&(t[s].selected=h),h&&u&&(t[s].defaultSelected=!0)}else{for(s=""+Hn(s),n=null,h=0;h<t.length;h++){if(t[h].value===s){t[h].selected=!0,u&&(t[h].defaultSelected=!0);return}n!==null||t[h].disabled||(n=t[h])}n!==null&&(n.selected=!0)}}function Ic(t,n,s){if(n!=null&&(n=""+Hn(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Hn(s):""}function Hc(t,n,s,u){if(n==null){if(u!=null){if(s!=null)throw Error(a(92));if(wt(u)){if(1<u.length)throw Error(a(93));u=u[0]}s=u}s==null&&(s=""),n=s}s=Hn(n),t.defaultValue=s,u=t.textContent,u===s&&u!==""&&u!==null&&(t.value=u),zo(t)}function Ua(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var Ef=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 ys(t,n,s){var u=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?u?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":u?t.setProperty(n,s):typeof s!="number"||s===0||Ef.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function Vr(t,n,s){if(n!=null&&typeof n!="object")throw Error(a(62));if(t=t.style,s!=null){for(var u in s)!s.hasOwnProperty(u)||n!=null&&n.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var h in n)u=n[h],n.hasOwnProperty(h)&&s[h]!==u&&ys(t,h,u)}else for(var p in n)n.hasOwnProperty(p)&&ys(t,p,n[p])}function Po(t){if(t.indexOf("-")===-1)return!1;switch(t){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 _f=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"]]),Af=/^[\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 bs(t){return Af.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function or(){}var qo=null;function vs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ba=null,Pa=null;function jc(t){var n=Ha(t);if(n&&(t=n.stateNode)){var s=t[gn]||null;e:switch(t=n.stateNode,n.type){case"input":if(la(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+jn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var u=s[n];if(u!==t&&u.form===t.form){var h=u[gn]||null;if(!h)throw Error(a(90));la(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<s.length;n++)u=s[n],u.form===t.form&&Uo(u)}break e;case"textarea":Ic(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&za(t,!!s.multiple,n,!1)}}}var Go=!1;function zc(t,n,s){if(Go)return t(n,s);Go=!0;try{var u=t(n);return u}finally{if(Go=!1,(Ba!==null||Pa!==null)&&(Ru(),Ba&&(n=Ba,t=Pa,Pa=Ba=null,jc(n),t)))for(n=0;n<t.length;n++)jc(t[n])}}function xi(t,n){var s=t.stateNode;if(s===null)return null;var u=s[gn]||null;if(u===null)return null;s=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,n,typeof s));return s}var Dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vo=!1;if(Dr)try{var Ti={};Object.defineProperty(Ti,"passive",{get:function(){Vo=!0}}),window.addEventListener("test",Ti,Ti),window.removeEventListener("test",Ti,Ti)}catch{Vo=!1}var Or=null,Fo=null,Ss=null;function Ve(){if(Ss)return Ss;var t,n=Fo,s=n.length,u,h="value"in Or?Or.value:Or.textContent,p=h.length;for(t=0;t<s&&n[t]===h[t];t++);var C=s-t;for(u=1;u<=C&&n[s-u]===h[p-u];u++);return Ss=h.slice(t,1<u?1-u:void 0)}function qa(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function ca(){return!0}function Uc(){return!1}function En(t){function n(s,u,h,p,C){this._reactName=s,this._targetInst=h,this.type=u,this.nativeEvent=p,this.target=C,this.currentTarget=null;for(var k in t)t.hasOwnProperty(k)&&(s=t[k],this[k]=s?s(p):p[k]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?ca:Uc,this.isPropagationStopped=Uc,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ca)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ca)},persist:function(){},isPersistent:ca}),n}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ws=En(Fr),ki=y({},Fr,{view:0,detail:0}),xf=En(ki),Ko,Wo,Cs,Es=y({},ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xo,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Cs&&(Cs&&t.type==="mousemove"?(Ko=t.screenX-Cs.screenX,Wo=t.screenY-Cs.screenY):Wo=Ko=0,Cs=t),Ko)},movementY:function(t){return"movementY"in t?t.movementY:Wo}}),Bc=En(Es),by=y({},Es,{dataTransfer:0}),Tf=En(by),kf=y({},ki,{relatedTarget:0}),Yo=En(kf),Rf=y({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0}),Df=En(Rf),Of=y({},Fr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Lf=En(Of),Mf=y({},Fr,{data:0}),Pc=En(Mf),$f={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nf={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"},If={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hf(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=If[t])?!!n[t]:!1}function Xo(){return Hf}var jf=y({},ki,{key:function(t){if(t.key){var n=$f[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=qa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Nf[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xo,charCode:function(t){return t.type==="keypress"?qa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?qa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),rn=En(jf),Jo=y({},Es,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qc=En(Jo),_=y({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xo}),b=En(_),E=y({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),D=En(E),I=y({},Es,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),ie=En(I),ye=y({},Fr,{newState:0,oldState:0}),Oe=En(ye),Fe=[9,13,27,32],at=Dr&&"CompositionEvent"in window,lt=null;Dr&&"documentMode"in document&&(lt=document.documentMode);var Bt=Dr&&"TextEvent"in window&&!lt,Ri=Dr&&(!at||lt&&8<lt&&11>=lt),Gc=" ",Qo=!1;function Vc(t,n){switch(t){case"keyup":return Fe.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ga=!1;function Fc(t,n){switch(t){case"compositionend":return Zo(n);case"keypress":return n.which!==32?null:(Qo=!0,Gc);case"textInput":return t=n.data,t===Gc&&Qo?null:t;default:return null}}function zf(t,n){if(Ga)return t==="compositionend"||!at&&Vc(t,n)?(t=Ve(),Ss=Fo=Or=null,Ga=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Ri&&n.locale!=="ko"?null:n.data;default:return null}}var Uf={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 el(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Uf[t.type]:n==="textarea"}function tl(t,n,s,u){Ba?Pa?Pa.push(u):Pa=[u]:Ba=u,n=Iu(n,"onChange"),0<n.length&&(s=new ws("onChange","change",null,s,u),t.push({event:s,listeners:n}))}var Va=null,ua=null;function nl(t){Jv(t,0)}function Di(t){var n=_i(t);if(Uo(n))return t}function Kc(t,n){if(t==="change")return n}var Wc=!1;if(Dr){var rl;if(Dr){var al="oninput"in document;if(!al){var il=document.createElement("div");il.setAttribute("oninput","return;"),al=typeof il.oninput=="function"}rl=al}else rl=!1;Wc=rl&&(!document.documentMode||9<document.documentMode)}function vy(){Va&&(Va.detachEvent("onpropertychange",Sy),ua=Va=null)}function Sy(t){if(t.propertyName==="value"&&Di(ua)){var n=[];tl(n,ua,t,vs(t)),zc(nl,n)}}function yA(t,n,s){t==="focusin"?(vy(),Va=n,ua=s,Va.attachEvent("onpropertychange",Sy)):t==="focusout"&&vy()}function bA(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Di(ua)}function vA(t,n){if(t==="click")return Di(n)}function SA(t,n){if(t==="input"||t==="change")return Di(n)}function wA(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Yn=typeof Object.is=="function"?Object.is:wA;function sl(t,n){if(Yn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),u=Object.keys(n);if(s.length!==u.length)return!1;for(u=0;u<s.length;u++){var h=s[u];if(!wn.call(n,h)||!Yn(t[h],n[h]))return!1}return!0}function wy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Cy(t,n){var s=wy(t);t=0;for(var u;s;){if(s.nodeType===3){if(u=t+s.textContent.length,t<=n&&u>=n)return{node:s,offset:n-t};t=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=wy(s)}}function Ey(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Ey(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function _y(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=oa(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=oa(t.document)}return n}function Bf(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var CA=Dr&&"documentMode"in document&&11>=document.documentMode,_s=null,Pf=null,ol=null,qf=!1;function Ay(t,n,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;qf||_s==null||_s!==oa(u)||(u=_s,"selectionStart"in u&&Bf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ol&&sl(ol,u)||(ol=u,u=Iu(Pf,"onSelect"),0<u.length&&(n=new ws("onSelect","select",null,n,s),t.push({event:n,listeners:u}),n.target=_s)))}function Oi(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var As={animationend:Oi("Animation","AnimationEnd"),animationiteration:Oi("Animation","AnimationIteration"),animationstart:Oi("Animation","AnimationStart"),transitionrun:Oi("Transition","TransitionRun"),transitionstart:Oi("Transition","TransitionStart"),transitioncancel:Oi("Transition","TransitionCancel"),transitionend:Oi("Transition","TransitionEnd")},Gf={},xy={};Dr&&(xy=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function Li(t){if(Gf[t])return Gf[t];if(!As[t])return t;var n=As[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in xy)return Gf[t]=n[s];return t}var Ty=Li("animationend"),ky=Li("animationiteration"),Ry=Li("animationstart"),EA=Li("transitionrun"),_A=Li("transitionstart"),AA=Li("transitioncancel"),Dy=Li("transitionend"),Oy=new Map,Vf="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(" ");Vf.push("scrollEnd");function Lr(t,n){Oy.set(t,n),sa(n,[t])}var Yc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},lr=[],xs=0,Ff=0;function Xc(){for(var t=xs,n=Ff=xs=0;n<t;){var s=lr[n];lr[n++]=null;var u=lr[n];lr[n++]=null;var h=lr[n];lr[n++]=null;var p=lr[n];if(lr[n++]=null,u!==null&&h!==null){var C=u.pending;C===null?h.next=h:(h.next=C.next,C.next=h),u.pending=h}p!==0&&Ly(s,h,p)}}function Jc(t,n,s,u){lr[xs++]=t,lr[xs++]=n,lr[xs++]=s,lr[xs++]=u,Ff|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function Kf(t,n,s,u){return Jc(t,n,s,u),Qc(t)}function Mi(t,n){return Jc(t,null,null,n),Qc(t)}function Ly(t,n,s){t.lanes|=s;var u=t.alternate;u!==null&&(u.lanes|=s);for(var h=!1,p=t.return;p!==null;)p.childLanes|=s,u=p.alternate,u!==null&&(u.childLanes|=s),p.tag===22&&(t=p.stateNode,t===null||t._visibility&1||(h=!0)),t=p,p=p.return;return t.tag===3?(p=t.stateNode,h&&n!==null&&(h=31-nn(s),t=p.hiddenUpdates,u=t[h],u===null?t[h]=[n]:u.push(n),n.lane=s|536870912),p):null}function Qc(t){if(50<Rl)throw Rl=0,ng=null,Error(a(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Ts={};function xA(t,n,s,u){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(t,n,s,u){return new xA(t,n,s,u)}function Wf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function da(t,n){var s=t.alternate;return s===null?(s=Xn(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function My(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Zc(t,n,s,u,h,p){var C=0;if(u=t,typeof t=="function")Wf(t)&&(C=1);else if(typeof t=="string")C=Ox(t,s,de.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case fe:return t=Xn(31,s,n,h),t.elementType=fe,t.lanes=p,t;case A:return $i(s.children,h,p,n);case x:C=8,h|=24;break;case R:return t=Xn(12,s,n,h|2),t.elementType=R,t.lanes=p,t;case q:return t=Xn(13,s,n,h),t.elementType=q,t.lanes=p,t;case G:return t=Xn(19,s,n,h),t.elementType=G,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case O:C=10;break e;case M:C=9;break e;case L:C=11;break e;case B:C=14;break e;case K:C=16,u=null;break e}C=29,s=Error(a(130,t===null?"null":typeof t,"")),u=null}return n=Xn(C,s,n,h),n.elementType=t,n.type=u,n.lanes=p,n}function $i(t,n,s,u){return t=Xn(7,t,u,n),t.lanes=s,t}function Yf(t,n,s){return t=Xn(6,t,null,n),t.lanes=s,t}function $y(t){var n=Xn(18,null,null,0);return n.stateNode=t,n}function Xf(t,n,s){return n=Xn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Ny=new WeakMap;function cr(t,n){if(typeof t=="object"&&t!==null){var s=Ny.get(t);return s!==void 0?s:(n={value:t,source:n,stack:Tr(n)},Ny.set(t,n),n)}return{value:t,source:n,stack:Tr(n)}}var ks=[],Rs=0,eu=null,ll=0,ur=[],dr=0,Fa=null,Kr=1,Wr="";function fa(t,n){ks[Rs++]=ll,ks[Rs++]=eu,eu=t,ll=n}function Iy(t,n,s){ur[dr++]=Kr,ur[dr++]=Wr,ur[dr++]=Fa,Fa=t;var u=Kr;t=Wr;var h=32-nn(u)-1;u&=~(1<<h),s+=1;var p=32-nn(n)+h;if(30<p){var C=h-h%5;p=(u&(1<<C)-1).toString(32),u>>=C,h-=C,Kr=1<<32-nn(n)+h|s<<h|u,Wr=p+t}else Kr=1<<p|s<<h|u,Wr=t}function Jf(t){t.return!==null&&(fa(t,1),Iy(t,1,0))}function Qf(t){for(;t===eu;)eu=ks[--Rs],ks[Rs]=null,ll=ks[--Rs],ks[Rs]=null;for(;t===Fa;)Fa=ur[--dr],ur[dr]=null,Wr=ur[--dr],ur[dr]=null,Kr=ur[--dr],ur[dr]=null}function Hy(t,n){ur[dr++]=Kr,ur[dr++]=Wr,ur[dr++]=Fa,Kr=n.id,Wr=n.overflow,Fa=t}var pn=null,Rt=null,ct=!1,Ka=null,fr=!1,Zf=Error(a(519));function Wa(t){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw cl(cr(n,t)),Zf}function jy(t){var n=t.stateNode,s=t.type,u=t.memoizedProps;switch(n[Nt]=t,n[gn]=u,s){case"dialog":nt("cancel",n),nt("close",n);break;case"iframe":case"object":case"embed":nt("load",n);break;case"video":case"audio":for(s=0;s<Ol.length;s++)nt(Ol[s],n);break;case"source":nt("error",n);break;case"img":case"image":case"link":nt("error",n),nt("load",n);break;case"details":nt("toggle",n);break;case"input":nt("invalid",n),Nc(n,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":nt("invalid",n);break;case"textarea":nt("invalid",n),Hc(n,u.value,u.defaultValue,u.children)}s=u.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||u.suppressHydrationWarning===!0||tS(n.textContent,s)?(u.popover!=null&&(nt("beforetoggle",n),nt("toggle",n)),u.onScroll!=null&&nt("scroll",n),u.onScrollEnd!=null&&nt("scrollend",n),u.onClick!=null&&(n.onclick=or),n=!0):n=!1,n||Wa(t,!0)}function zy(t){for(pn=t.return;pn;)switch(pn.tag){case 5:case 31:case 13:fr=!1;return;case 27:case 3:fr=!0;return;default:pn=pn.return}}function Ds(t){if(t!==pn)return!1;if(!ct)return zy(t),ct=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||yg(t.type,t.memoizedProps)),s=!s),s&&Rt&&Wa(t),zy(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=uS(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=uS(t)}else n===27?(n=Rt,li(t.type)?(t=Cg,Cg=null,Rt=t):Rt=n):Rt=pn?gr(t.stateNode.nextSibling):null;return!0}function Ni(){Rt=pn=null,ct=!1}function eh(){var t=Ka;return t!==null&&(Pn===null?Pn=t:Pn.push.apply(Pn,t),Ka=null),t}function cl(t){Ka===null?Ka=[t]:Ka.push(t)}var th=H(null),Ii=null,ha=null;function Ya(t,n,s){ge(th,n._currentValue),n._currentValue=s}function ga(t){t._currentValue=th.current,T(th)}function nh(t,n,s){for(;t!==null;){var u=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),t===s)break;t=t.return}}function rh(t,n,s,u){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var p=h.dependencies;if(p!==null){var C=h.child;p=p.firstContext;e:for(;p!==null;){var k=p;p=h;for(var z=0;z<n.length;z++)if(k.context===n[z]){p.lanes|=s,k=p.alternate,k!==null&&(k.lanes|=s),nh(p.return,s,t),u||(C=null);break e}p=k.next}}else if(h.tag===18){if(C=h.return,C===null)throw Error(a(341));C.lanes|=s,p=C.alternate,p!==null&&(p.lanes|=s),nh(C,s,t),C=null}else C=h.child;if(C!==null)C.return=h;else for(C=h;C!==null;){if(C===t){C=null;break}if(h=C.sibling,h!==null){h.return=C.return,C=h;break}C=C.return}h=C}}function Os(t,n,s,u){t=null;for(var h=n,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var C=h.alternate;if(C===null)throw Error(a(387));if(C=C.memoizedProps,C!==null){var k=h.type;Yn(h.pendingProps.value,C.value)||(t!==null?t.push(k):t=[k])}}else if(h===Re.current){if(C=h.alternate,C===null)throw Error(a(387));C.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(Il):t=[Il])}h=h.return}t!==null&&rh(n,t,s,u),n.flags|=262144}function tu(t){for(t=t.firstContext;t!==null;){if(!Yn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Hi(t){Ii=t,ha=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function mn(t){return Uy(Ii,t)}function nu(t,n){return Ii===null&&Hi(t),Uy(t,n)}function Uy(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},ha===null){if(t===null)throw Error(a(308));ha=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else ha=ha.next=n;return s}var TA=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,u){t.push(u)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},kA=o.unstable_scheduleCallback,RA=o.unstable_NormalPriority,Jt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ah(){return{controller:new TA,data:new Map,refCount:0}}function ul(t){t.refCount--,t.refCount===0&&kA(RA,function(){t.controller.abort()})}var dl=null,ih=0,Ls=0,Ms=null;function DA(t,n){if(dl===null){var s=dl=[];ih=0,Ls=lg(),Ms={status:"pending",value:void 0,then:function(u){s.push(u)}}}return ih++,n.then(By,By),n}function By(){if(--ih===0&&dl!==null){Ms!==null&&(Ms.status="fulfilled");var t=dl;dl=null,Ls=0,Ms=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function OA(t,n){var s=[],u={status:"pending",value:null,reason:null,then:function(h){s.push(h)}};return t.then(function(){u.status="fulfilled",u.value=n;for(var h=0;h<s.length;h++)(0,s[h])(n)},function(h){for(u.status="rejected",u.reason=h,h=0;h<s.length;h++)(0,s[h])(void 0)}),u}var Py=J.S;J.S=function(t,n){Av=Ut(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&DA(t,n),Py!==null&&Py(t,n)};var ji=H(null);function sh(){var t=ji.current;return t!==null?t:xt.pooledCache}function ru(t,n){n===null?ge(ji,ji.current):ge(ji,n.pool)}function qy(){var t=sh();return t===null?null:{parent:Jt._currentValue,pool:t}}var $s=Error(a(460)),oh=Error(a(474)),au=Error(a(542)),iu={then:function(){}};function Gy(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Vy(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(or,or),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Ky(t),t;default:if(typeof n.status=="string")n.then(or,or);else{if(t=xt,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=n,t.status="pending",t.then(function(u){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=u}},function(u){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=u}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Ky(t),t}throw Ui=n,$s}}function zi(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ui=s,$s):s}}var Ui=null;function Fy(){if(Ui===null)throw Error(a(459));var t=Ui;return Ui=null,t}function Ky(t){if(t===$s||t===au)throw Error(a(483))}var Ns=null,fl=0;function su(t){var n=fl;return fl+=1,Ns===null&&(Ns=[]),Vy(Ns,t,n)}function hl(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function ou(t,n){throw n.$$typeof===w?Error(a(525)):(t=Object.prototype.toString.call(n),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Wy(t){function n(F,P){if(t){var W=F.deletions;W===null?(F.deletions=[P],F.flags|=16):W.push(P)}}function s(F,P){if(!t)return null;for(;P!==null;)n(F,P),P=P.sibling;return null}function u(F){for(var P=new Map;F!==null;)F.key!==null?P.set(F.key,F):P.set(F.index,F),F=F.sibling;return P}function h(F,P){return F=da(F,P),F.index=0,F.sibling=null,F}function p(F,P,W){return F.index=W,t?(W=F.alternate,W!==null?(W=W.index,W<P?(F.flags|=67108866,P):W):(F.flags|=67108866,P)):(F.flags|=1048576,P)}function C(F){return t&&F.alternate===null&&(F.flags|=67108866),F}function k(F,P,W,se){return P===null||P.tag!==6?(P=Yf(W,F.mode,se),P.return=F,P):(P=h(P,W),P.return=F,P)}function z(F,P,W,se){var Ie=W.type;return Ie===A?ne(F,P,W.props.children,se,W.key):P!==null&&(P.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===K&&zi(Ie)===P.type)?(P=h(P,W.props),hl(P,W),P.return=F,P):(P=Zc(W.type,W.key,W.props,null,F.mode,se),hl(P,W),P.return=F,P)}function Y(F,P,W,se){return P===null||P.tag!==4||P.stateNode.containerInfo!==W.containerInfo||P.stateNode.implementation!==W.implementation?(P=Xf(W,F.mode,se),P.return=F,P):(P=h(P,W.children||[]),P.return=F,P)}function ne(F,P,W,se,Ie){return P===null||P.tag!==7?(P=$i(W,F.mode,se,Ie),P.return=F,P):(P=h(P,W),P.return=F,P)}function le(F,P,W){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=Yf(""+P,F.mode,W),P.return=F,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case S:return W=Zc(P.type,P.key,P.props,null,F.mode,W),hl(W,P),W.return=F,W;case v:return P=Xf(P,F.mode,W),P.return=F,P;case K:return P=zi(P),le(F,P,W)}if(wt(P)||Ue(P))return P=$i(P,F.mode,W,null),P.return=F,P;if(typeof P.then=="function")return le(F,su(P),W);if(P.$$typeof===O)return le(F,nu(F,P),W);ou(F,P)}return null}function Q(F,P,W,se){var Ie=P!==null?P.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Ie!==null?null:k(F,P,""+W,se);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case S:return W.key===Ie?z(F,P,W,se):null;case v:return W.key===Ie?Y(F,P,W,se):null;case K:return W=zi(W),Q(F,P,W,se)}if(wt(W)||Ue(W))return Ie!==null?null:ne(F,P,W,se,null);if(typeof W.then=="function")return Q(F,P,su(W),se);if(W.$$typeof===O)return Q(F,P,nu(F,W),se);ou(F,W)}return null}function te(F,P,W,se,Ie){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return F=F.get(W)||null,k(P,F,""+se,Ie);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case S:return F=F.get(se.key===null?W:se.key)||null,z(P,F,se,Ie);case v:return F=F.get(se.key===null?W:se.key)||null,Y(P,F,se,Ie);case K:return se=zi(se),te(F,P,W,se,Ie)}if(wt(se)||Ue(se))return F=F.get(W)||null,ne(P,F,se,Ie,null);if(typeof se.then=="function")return te(F,P,W,su(se),Ie);if(se.$$typeof===O)return te(F,P,W,nu(P,se),Ie);ou(P,se)}return null}function Te(F,P,W,se){for(var Ie=null,ft=null,Le=P,Je=P=0,st=null;Le!==null&&Je<W.length;Je++){Le.index>Je?(st=Le,Le=null):st=Le.sibling;var ht=Q(F,Le,W[Je],se);if(ht===null){Le===null&&(Le=st);break}t&&Le&&ht.alternate===null&&n(F,Le),P=p(ht,P,Je),ft===null?Ie=ht:ft.sibling=ht,ft=ht,Le=st}if(Je===W.length)return s(F,Le),ct&&fa(F,Je),Ie;if(Le===null){for(;Je<W.length;Je++)Le=le(F,W[Je],se),Le!==null&&(P=p(Le,P,Je),ft===null?Ie=Le:ft.sibling=Le,ft=Le);return ct&&fa(F,Je),Ie}for(Le=u(Le);Je<W.length;Je++)st=te(Le,F,Je,W[Je],se),st!==null&&(t&&st.alternate!==null&&Le.delete(st.key===null?Je:st.key),P=p(st,P,Je),ft===null?Ie=st:ft.sibling=st,ft=st);return t&&Le.forEach(function(hi){return n(F,hi)}),ct&&fa(F,Je),Ie}function He(F,P,W,se){if(W==null)throw Error(a(151));for(var Ie=null,ft=null,Le=P,Je=P=0,st=null,ht=W.next();Le!==null&&!ht.done;Je++,ht=W.next()){Le.index>Je?(st=Le,Le=null):st=Le.sibling;var hi=Q(F,Le,ht.value,se);if(hi===null){Le===null&&(Le=st);break}t&&Le&&hi.alternate===null&&n(F,Le),P=p(hi,P,Je),ft===null?Ie=hi:ft.sibling=hi,ft=hi,Le=st}if(ht.done)return s(F,Le),ct&&fa(F,Je),Ie;if(Le===null){for(;!ht.done;Je++,ht=W.next())ht=le(F,ht.value,se),ht!==null&&(P=p(ht,P,Je),ft===null?Ie=ht:ft.sibling=ht,ft=ht);return ct&&fa(F,Je),Ie}for(Le=u(Le);!ht.done;Je++,ht=W.next())ht=te(Le,F,Je,ht.value,se),ht!==null&&(t&&ht.alternate!==null&&Le.delete(ht.key===null?Je:ht.key),P=p(ht,P,Je),ft===null?Ie=ht:ft.sibling=ht,ft=ht);return t&&Le.forEach(function(Px){return n(F,Px)}),ct&&fa(F,Je),Ie}function _t(F,P,W,se){if(typeof W=="object"&&W!==null&&W.type===A&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case S:e:{for(var Ie=W.key;P!==null;){if(P.key===Ie){if(Ie=W.type,Ie===A){if(P.tag===7){s(F,P.sibling),se=h(P,W.props.children),se.return=F,F=se;break e}}else if(P.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===K&&zi(Ie)===P.type){s(F,P.sibling),se=h(P,W.props),hl(se,W),se.return=F,F=se;break e}s(F,P);break}else n(F,P);P=P.sibling}W.type===A?(se=$i(W.props.children,F.mode,se,W.key),se.return=F,F=se):(se=Zc(W.type,W.key,W.props,null,F.mode,se),hl(se,W),se.return=F,F=se)}return C(F);case v:e:{for(Ie=W.key;P!==null;){if(P.key===Ie)if(P.tag===4&&P.stateNode.containerInfo===W.containerInfo&&P.stateNode.implementation===W.implementation){s(F,P.sibling),se=h(P,W.children||[]),se.return=F,F=se;break e}else{s(F,P);break}else n(F,P);P=P.sibling}se=Xf(W,F.mode,se),se.return=F,F=se}return C(F);case K:return W=zi(W),_t(F,P,W,se)}if(wt(W))return Te(F,P,W,se);if(Ue(W)){if(Ie=Ue(W),typeof Ie!="function")throw Error(a(150));return W=Ie.call(W),He(F,P,W,se)}if(typeof W.then=="function")return _t(F,P,su(W),se);if(W.$$typeof===O)return _t(F,P,nu(F,W),se);ou(F,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,P!==null&&P.tag===6?(s(F,P.sibling),se=h(P,W),se.return=F,F=se):(s(F,P),se=Yf(W,F.mode,se),se.return=F,F=se),C(F)):s(F,P)}return function(F,P,W,se){try{fl=0;var Ie=_t(F,P,W,se);return Ns=null,Ie}catch(Le){if(Le===$s||Le===au)throw Le;var ft=Xn(29,Le,null,F.mode);return ft.lanes=se,ft.return=F,ft}finally{}}}var Bi=Wy(!0),Yy=Wy(!1),Xa=!1;function lh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ch(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ja(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(t,n,s){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(pt&2)!==0){var h=u.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),u.pending=n,n=Qc(t),Ly(t,null,s),n}return Jc(t,u,n,s),Qc(t)}function gl(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var u=n.lanes;u&=t.pendingLanes,s|=u,n.lanes=s,Se(t,s)}}function uh(t,n){var s=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var h=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};p===null?h=p=C:p=p.next=C,s=s.next}while(s!==null);p===null?h=p=n:p=p.next=n}else h=p=n;s={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:u.shared,callbacks:u.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var dh=!1;function pl(){if(dh){var t=Ms;if(t!==null)throw t}}function ml(t,n,s,u){dh=!1;var h=t.updateQueue;Xa=!1;var p=h.firstBaseUpdate,C=h.lastBaseUpdate,k=h.shared.pending;if(k!==null){h.shared.pending=null;var z=k,Y=z.next;z.next=null,C===null?p=Y:C.next=Y,C=z;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,k=ne.lastBaseUpdate,k!==C&&(k===null?ne.firstBaseUpdate=Y:k.next=Y,ne.lastBaseUpdate=z))}if(p!==null){var le=h.baseState;C=0,ne=Y=z=null,k=p;do{var Q=k.lane&-536870913,te=Q!==k.lane;if(te?(it&Q)===Q:(u&Q)===Q){Q!==0&&Q===Ls&&(dh=!0),ne!==null&&(ne=ne.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Te=t,He=k;Q=n;var _t=s;switch(He.tag){case 1:if(Te=He.payload,typeof Te=="function"){le=Te.call(_t,le,Q);break e}le=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=He.payload,Q=typeof Te=="function"?Te.call(_t,le,Q):Te,Q==null)break e;le=y({},le,Q);break e;case 2:Xa=!0}}Q=k.callback,Q!==null&&(t.flags|=64,te&&(t.flags|=8192),te=h.callbacks,te===null?h.callbacks=[Q]:te.push(Q))}else te={lane:Q,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ne===null?(Y=ne=te,z=le):ne=ne.next=te,C|=Q;if(k=k.next,k===null){if(k=h.shared.pending,k===null)break;te=k,k=te.next,te.next=null,h.lastBaseUpdate=te,h.shared.pending=null}}while(!0);ne===null&&(z=le),h.baseState=z,h.firstBaseUpdate=Y,h.lastBaseUpdate=ne,p===null&&(h.shared.lanes=0),ri|=C,t.lanes=C,t.memoizedState=le}}function Xy(t,n){if(typeof t!="function")throw Error(a(191,t));t.call(n)}function Jy(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Xy(s[t],n)}var Is=H(null),lu=H(0);function Qy(t,n){t=Ea,ge(lu,t),ge(Is,n),Ea=t|n.baseLanes}function fh(){ge(lu,Ea),ge(Is,Is.current)}function hh(){Ea=lu.current,T(Is),T(lu)}var Jn=H(null),hr=null;function Za(t){var n=t.alternate;ge(Ft,Ft.current&1),ge(Jn,t),hr===null&&(n===null||Is.current!==null||n.memoizedState!==null)&&(hr=t)}function gh(t){ge(Ft,Ft.current),ge(Jn,t),hr===null&&(hr=t)}function Zy(t){t.tag===22?(ge(Ft,Ft.current),ge(Jn,t),hr===null&&(hr=t)):ei()}function ei(){ge(Ft,Ft.current),ge(Jn,Jn.current)}function Qn(t){T(Jn),hr===t&&(hr=null),T(Ft)}var Ft=H(0);function cu(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Sg(s)||wg(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var pa=0,Xe=null,Ct=null,Qt=null,uu=!1,Hs=!1,Pi=!1,du=0,yl=0,js=null,LA=0;function Pt(){throw Error(a(321))}function ph(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Yn(t[s],n[s]))return!1;return!0}function mh(t,n,s,u,h,p){return pa=p,Xe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,J.H=t===null||t.memoizedState===null?Ib:Oh,Pi=!1,p=s(u,h),Pi=!1,Hs&&(p=tb(n,s,u,h)),eb(t),p}function eb(t){J.H=Sl;var n=Ct!==null&&Ct.next!==null;if(pa=0,Qt=Ct=Xe=null,uu=!1,yl=0,js=null,n)throw Error(a(300));t===null||Zt||(t=t.dependencies,t!==null&&tu(t)&&(Zt=!0))}function tb(t,n,s,u){Xe=t;var h=0;do{if(Hs&&(js=null),yl=0,Hs=!1,25<=h)throw Error(a(301));if(h+=1,Qt=Ct=null,t.updateQueue!=null){var p=t.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}J.H=Hb,p=n(s,u)}while(Hs);return p}function MA(){var t=J.H,n=t.useState()[0];return n=typeof n.then=="function"?bl(n):n,t=t.useState()[0],(Ct!==null?Ct.memoizedState:null)!==t&&(Xe.flags|=1024),n}function yh(){var t=du!==0;return du=0,t}function bh(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function vh(t){if(uu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}uu=!1}pa=0,Qt=Ct=Xe=null,Hs=!1,yl=du=0,js=null}function Tn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Xe.memoizedState=Qt=t:Qt=Qt.next=t,Qt}function Kt(){if(Ct===null){var t=Xe.alternate;t=t!==null?t.memoizedState:null}else t=Ct.next;var n=Qt===null?Xe.memoizedState:Qt.next;if(n!==null)Qt=n,Ct=t;else{if(t===null)throw Xe.alternate===null?Error(a(467)):Error(a(310));Ct=t,t={memoizedState:Ct.memoizedState,baseState:Ct.baseState,baseQueue:Ct.baseQueue,queue:Ct.queue,next:null},Qt===null?Xe.memoizedState=Qt=t:Qt=Qt.next=t}return Qt}function fu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bl(t){var n=yl;return yl+=1,js===null&&(js=[]),t=Vy(js,t,n),n=Xe,(Qt===null?n.memoizedState:Qt.next)===null&&(n=n.alternate,J.H=n===null||n.memoizedState===null?Ib:Oh),t}function hu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return bl(t);if(t.$$typeof===O)return mn(t)}throw Error(a(438,String(t)))}function Sh(t){var n=null,s=Xe.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var u=Xe.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=fu(),Xe.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),u=0;u<t;u++)s[u]=Ce;return n.index++,s}function ma(t,n){return typeof n=="function"?n(t):n}function gu(t){var n=Kt();return wh(n,Ct,t)}function wh(t,n,s){var u=t.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=s;var h=t.baseQueue,p=u.pending;if(p!==null){if(h!==null){var C=h.next;h.next=p.next,p.next=C}n.baseQueue=h=p,u.pending=null}if(p=t.baseState,h===null)t.memoizedState=p;else{n=h.next;var k=C=null,z=null,Y=n,ne=!1;do{var le=Y.lane&-536870913;if(le!==Y.lane?(it&le)===le:(pa&le)===le){var Q=Y.revertLane;if(Q===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),le===Ls&&(ne=!0);else if((pa&Q)===Q){Y=Y.next,Q===Ls&&(ne=!0);continue}else le={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(k=z=le,C=p):z=z.next=le,Xe.lanes|=Q,ri|=Q;le=Y.action,Pi&&s(p,le),p=Y.hasEagerState?Y.eagerState:s(p,le)}else Q={lane:le,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(k=z=Q,C=p):z=z.next=Q,Xe.lanes|=le,ri|=le;Y=Y.next}while(Y!==null&&Y!==n);if(z===null?C=p:z.next=k,!Yn(p,t.memoizedState)&&(Zt=!0,ne&&(s=Ms,s!==null)))throw s;t.memoizedState=p,t.baseState=C,t.baseQueue=z,u.lastRenderedState=p}return h===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Ch(t){var n=Kt(),s=n.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var u=s.dispatch,h=s.pending,p=n.memoizedState;if(h!==null){s.pending=null;var C=h=h.next;do p=t(p,C.action),C=C.next;while(C!==h);Yn(p,n.memoizedState)||(Zt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),s.lastRenderedState=p}return[p,u]}function nb(t,n,s){var u=Xe,h=Kt(),p=ct;if(p){if(s===void 0)throw Error(a(407));s=s()}else s=n();var C=!Yn((Ct||h).memoizedState,s);if(C&&(h.memoizedState=s,Zt=!0),h=h.queue,Ah(ib.bind(null,u,h,t),[t]),h.getSnapshot!==n||C||Qt!==null&&Qt.memoizedState.tag&1){if(u.flags|=2048,zs(9,{destroy:void 0},ab.bind(null,u,h,s,n),null),xt===null)throw Error(a(349));p||(pa&127)!==0||rb(u,n,s)}return s}function rb(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Xe.updateQueue,n===null?(n=fu(),Xe.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function ab(t,n,s,u){n.value=s,n.getSnapshot=u,sb(n)&&ob(t)}function ib(t,n,s){return s(function(){sb(n)&&ob(t)})}function sb(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Yn(t,s)}catch{return!0}}function ob(t){var n=Mi(t,2);n!==null&&qn(n,t,2)}function Eh(t){var n=Tn();if(typeof t=="function"){var s=t;if(t=s(),Pi){Cn(!0);try{s()}finally{Cn(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:t},n}function lb(t,n,s,u){return t.baseState=s,wh(t,Ct,typeof u=="function"?u:ma)}function $A(t,n,s,u,h){if(yu(t))throw Error(a(485));if(t=n.action,t!==null){var p={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){p.listeners.push(C)}};J.T!==null?s(!0):p.isTransition=!1,u(p),s=n.pending,s===null?(p.next=n.pending=p,cb(n,p)):(p.next=s.next,n.pending=s.next=p)}}function cb(t,n){var s=n.action,u=n.payload,h=t.state;if(n.isTransition){var p=J.T,C={};J.T=C;try{var k=s(h,u),z=J.S;z!==null&&z(C,k),ub(t,n,k)}catch(Y){_h(t,n,Y)}finally{p!==null&&C.types!==null&&(p.types=C.types),J.T=p}}else try{p=s(h,u),ub(t,n,p)}catch(Y){_h(t,n,Y)}}function ub(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(u){db(t,n,u)},function(u){return _h(t,n,u)}):db(t,n,s)}function db(t,n,s){n.status="fulfilled",n.value=s,fb(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,cb(t,s)))}function _h(t,n,s){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do n.status="rejected",n.reason=s,fb(n),n=n.next;while(n!==u)}t.action=null}function fb(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function hb(t,n){return n}function gb(t,n){if(ct){var s=xt.formState;if(s!==null){e:{var u=Xe;if(ct){if(Rt){t:{for(var h=Rt,p=fr;h.nodeType!==8;){if(!p){h=null;break t}if(h=gr(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){Rt=gr(h.nextSibling),u=h.data==="F!";break e}}Wa(u)}u=!1}u&&(n=s[0])}}return s=Tn(),s.memoizedState=s.baseState=n,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hb,lastRenderedState:n},s.queue=u,s=Mb.bind(null,Xe,u),u.dispatch=s,u=Eh(!1),p=Dh.bind(null,Xe,!1,u.queue),u=Tn(),h={state:n,dispatch:null,action:t,pending:null},u.queue=h,s=$A.bind(null,Xe,h,p,s),h.dispatch=s,u.memoizedState=t,[n,s,!1]}function pb(t){var n=Kt();return mb(n,Ct,t)}function mb(t,n,s){if(n=wh(t,n,hb)[0],t=gu(ma)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var u=bl(n)}catch(C){throw C===$s?au:C}else u=n;n=Kt();var h=n.queue,p=h.dispatch;return s!==n.memoizedState&&(Xe.flags|=2048,zs(9,{destroy:void 0},NA.bind(null,h,s),null)),[u,p,t]}function NA(t,n){t.action=n}function yb(t){var n=Kt(),s=Ct;if(s!==null)return mb(n,s,t);Kt(),n=n.memoizedState,s=Kt();var u=s.queue.dispatch;return s.memoizedState=t,[n,u,!1]}function zs(t,n,s,u){return t={tag:t,create:s,deps:u,inst:n,next:null},n=Xe.updateQueue,n===null&&(n=fu(),Xe.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(u=s.next,s.next=t,t.next=u,n.lastEffect=t),t}function bb(){return Kt().memoizedState}function pu(t,n,s,u){var h=Tn();Xe.flags|=t,h.memoizedState=zs(1|n,{destroy:void 0},s,u===void 0?null:u)}function mu(t,n,s,u){var h=Kt();u=u===void 0?null:u;var p=h.memoizedState.inst;Ct!==null&&u!==null&&ph(u,Ct.memoizedState.deps)?h.memoizedState=zs(n,p,s,u):(Xe.flags|=t,h.memoizedState=zs(1|n,p,s,u))}function vb(t,n){pu(8390656,8,t,n)}function Ah(t,n){mu(2048,8,t,n)}function IA(t){Xe.flags|=4;var n=Xe.updateQueue;if(n===null)n=fu(),Xe.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function Sb(t){var n=Kt().memoizedState;return IA({ref:n,nextImpl:t}),function(){if((pt&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function wb(t,n){return mu(4,2,t,n)}function Cb(t,n){return mu(4,4,t,n)}function Eb(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function _b(t,n,s){s=s!=null?s.concat([t]):null,mu(4,4,Eb.bind(null,n,t),s)}function xh(){}function Ab(t,n){var s=Kt();n=n===void 0?null:n;var u=s.memoizedState;return n!==null&&ph(n,u[1])?u[0]:(s.memoizedState=[t,n],t)}function xb(t,n){var s=Kt();n=n===void 0?null:n;var u=s.memoizedState;if(n!==null&&ph(n,u[1]))return u[0];if(u=t(),Pi){Cn(!0);try{t()}finally{Cn(!1)}}return s.memoizedState=[u,n],u}function Th(t,n,s){return s===void 0||(pa&1073741824)!==0&&(it&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=Tv(),Xe.lanes|=t,ri|=t,s)}function Tb(t,n,s,u){return Yn(s,n)?s:Is.current!==null?(t=Th(t,s,u),Yn(t,n)||(Zt=!0),t):(pa&42)===0||(pa&1073741824)!==0&&(it&261930)===0?(Zt=!0,t.memoizedState=s):(t=Tv(),Xe.lanes|=t,ri|=t,n)}function kb(t,n,s,u,h){var p=he.p;he.p=p!==0&&8>p?p:8;var C=J.T,k={};J.T=k,Dh(t,!1,n,s);try{var z=h(),Y=J.S;if(Y!==null&&Y(k,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ne=OA(z,u);vl(t,n,ne,tr(t))}else vl(t,n,u,tr(t))}catch(le){vl(t,n,{then:function(){},status:"rejected",reason:le},tr())}finally{he.p=p,C!==null&&k.types!==null&&(C.types=k.types),J.T=C}}function HA(){}function kh(t,n,s,u){if(t.tag!==5)throw Error(a(476));var h=Rb(t).queue;kb(t,h,n,Ee,s===null?HA:function(){return Db(t),s(u)})}function Rb(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:Ee,baseState:Ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:Ee},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Db(t){var n=Rb(t);n.next===null&&(n=t.alternate.memoizedState),vl(t,n.next.queue,{},tr())}function Rh(){return mn(Il)}function Ob(){return Kt().memoizedState}function Lb(){return Kt().memoizedState}function jA(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=tr();t=Ja(s);var u=Qa(n,t,s);u!==null&&(qn(u,n,s),gl(u,n,s)),n={cache:ah()},t.payload=n;return}n=n.return}}function zA(t,n,s){var u=tr();s={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},yu(t)?$b(n,s):(s=Kf(t,n,s,u),s!==null&&(qn(s,t,u),Nb(s,n,u)))}function Mb(t,n,s){var u=tr();vl(t,n,s,u)}function vl(t,n,s,u){var h={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(yu(t))$b(n,h);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var C=n.lastRenderedState,k=p(C,s);if(h.hasEagerState=!0,h.eagerState=k,Yn(k,C))return Jc(t,n,h,0),xt===null&&Xc(),!1}catch{}finally{}if(s=Kf(t,n,h,u),s!==null)return qn(s,t,u),Nb(s,n,u),!0}return!1}function Dh(t,n,s,u){if(u={lane:2,revertLane:lg(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},yu(t)){if(n)throw Error(a(479))}else n=Kf(t,s,u,2),n!==null&&qn(n,t,2)}function yu(t){var n=t.alternate;return t===Xe||n!==null&&n===Xe}function $b(t,n){Hs=uu=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function Nb(t,n,s){if((s&4194048)!==0){var u=n.lanes;u&=t.pendingLanes,s|=u,n.lanes=s,Se(t,s)}}var Sl={readContext:mn,use:hu,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};Sl.useEffectEvent=Pt;var Ib={readContext:mn,use:hu,useCallback:function(t,n){return Tn().memoizedState=[t,n===void 0?null:n],t},useContext:mn,useEffect:vb,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,pu(4194308,4,Eb.bind(null,n,t),s)},useLayoutEffect:function(t,n){return pu(4194308,4,t,n)},useInsertionEffect:function(t,n){pu(4,2,t,n)},useMemo:function(t,n){var s=Tn();n=n===void 0?null:n;var u=t();if(Pi){Cn(!0);try{t()}finally{Cn(!1)}}return s.memoizedState=[u,n],u},useReducer:function(t,n,s){var u=Tn();if(s!==void 0){var h=s(n);if(Pi){Cn(!0);try{s(n)}finally{Cn(!1)}}}else h=n;return u.memoizedState=u.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},u.queue=t,t=t.dispatch=zA.bind(null,Xe,t),[u.memoizedState,t]},useRef:function(t){var n=Tn();return t={current:t},n.memoizedState=t},useState:function(t){t=Eh(t);var n=t.queue,s=Mb.bind(null,Xe,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:xh,useDeferredValue:function(t,n){var s=Tn();return Th(s,t,n)},useTransition:function(){var t=Eh(!1);return t=kb.bind(null,Xe,t.queue,!0,!1),Tn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var u=Xe,h=Tn();if(ct){if(s===void 0)throw Error(a(407));s=s()}else{if(s=n(),xt===null)throw Error(a(349));(it&127)!==0||rb(u,n,s)}h.memoizedState=s;var p={value:s,getSnapshot:n};return h.queue=p,vb(ib.bind(null,u,p,t),[t]),u.flags|=2048,zs(9,{destroy:void 0},ab.bind(null,u,p,s,n),null),s},useId:function(){var t=Tn(),n=xt.identifierPrefix;if(ct){var s=Wr,u=Kr;s=(u&~(1<<32-nn(u)-1)).toString(32)+s,n="_"+n+"R_"+s,s=du++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=LA++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Rh,useFormState:gb,useActionState:gb,useOptimistic:function(t){var n=Tn();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=Dh.bind(null,Xe,!0,s),s.dispatch=n,[t,n]},useMemoCache:Sh,useCacheRefresh:function(){return Tn().memoizedState=jA.bind(null,Xe)},useEffectEvent:function(t){var n=Tn(),s={impl:t};return n.memoizedState=s,function(){if((pt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Oh={readContext:mn,use:hu,useCallback:Ab,useContext:mn,useEffect:Ah,useImperativeHandle:_b,useInsertionEffect:wb,useLayoutEffect:Cb,useMemo:xb,useReducer:gu,useRef:bb,useState:function(){return gu(ma)},useDebugValue:xh,useDeferredValue:function(t,n){var s=Kt();return Tb(s,Ct.memoizedState,t,n)},useTransition:function(){var t=gu(ma)[0],n=Kt().memoizedState;return[typeof t=="boolean"?t:bl(t),n]},useSyncExternalStore:nb,useId:Ob,useHostTransitionStatus:Rh,useFormState:pb,useActionState:pb,useOptimistic:function(t,n){var s=Kt();return lb(s,Ct,t,n)},useMemoCache:Sh,useCacheRefresh:Lb};Oh.useEffectEvent=Sb;var Hb={readContext:mn,use:hu,useCallback:Ab,useContext:mn,useEffect:Ah,useImperativeHandle:_b,useInsertionEffect:wb,useLayoutEffect:Cb,useMemo:xb,useReducer:Ch,useRef:bb,useState:function(){return Ch(ma)},useDebugValue:xh,useDeferredValue:function(t,n){var s=Kt();return Ct===null?Th(s,t,n):Tb(s,Ct.memoizedState,t,n)},useTransition:function(){var t=Ch(ma)[0],n=Kt().memoizedState;return[typeof t=="boolean"?t:bl(t),n]},useSyncExternalStore:nb,useId:Ob,useHostTransitionStatus:Rh,useFormState:yb,useActionState:yb,useOptimistic:function(t,n){var s=Kt();return Ct!==null?lb(s,Ct,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Sh,useCacheRefresh:Lb};Hb.useEffectEvent=Sb;function Lh(t,n,s,u){n=t.memoizedState,s=s(u,n),s=s==null?n:y({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Mh={enqueueSetState:function(t,n,s){t=t._reactInternals;var u=tr(),h=Ja(u);h.payload=n,s!=null&&(h.callback=s),n=Qa(t,h,u),n!==null&&(qn(n,t,u),gl(n,t,u))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var u=tr(),h=Ja(u);h.tag=1,h.payload=n,s!=null&&(h.callback=s),n=Qa(t,h,u),n!==null&&(qn(n,t,u),gl(n,t,u))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=tr(),u=Ja(s);u.tag=2,n!=null&&(u.callback=n),n=Qa(t,u,s),n!==null&&(qn(n,t,s),gl(n,t,s))}};function jb(t,n,s,u,h,p,C){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,p,C):n.prototype&&n.prototype.isPureReactComponent?!sl(s,u)||!sl(h,p):!0}function zb(t,n,s,u){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,u),n.state!==t&&Mh.enqueueReplaceState(n,n.state,null)}function qi(t,n){var s=n;if("ref"in n){s={};for(var u in n)u!=="ref"&&(s[u]=n[u])}if(t=t.defaultProps){s===n&&(s=y({},s));for(var h in t)s[h]===void 0&&(s[h]=t[h])}return s}function Ub(t){Yc(t)}function Bb(t){console.error(t)}function Pb(t){Yc(t)}function bu(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(u){setTimeout(function(){throw u})}}function qb(t,n,s){try{var u=t.onCaughtError;u(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function $h(t,n,s){return s=Ja(s),s.tag=3,s.payload={element:null},s.callback=function(){bu(t,n)},s}function Gb(t){return t=Ja(t),t.tag=3,t}function Vb(t,n,s,u){var h=s.type.getDerivedStateFromError;if(typeof h=="function"){var p=u.value;t.payload=function(){return h(p)},t.callback=function(){qb(n,s,u)}}var C=s.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(t.callback=function(){qb(n,s,u),typeof h!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function UA(t,n,s,u,h){if(s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(n=s.alternate,n!==null&&Os(n,s,h,!0),s=Jn.current,s!==null){switch(s.tag){case 31:case 13:return hr===null?Du():s.alternate===null&&qt===0&&(qt=3),s.flags&=-257,s.flags|=65536,s.lanes=h,u===iu?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([u]):n.add(u),ig(t,u,h)),!1;case 22:return s.flags|=65536,u===iu?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([u])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([u]):s.add(u)),ig(t,u,h)),!1}throw Error(a(435,s.tag))}return ig(t,u,h),Du(),!1}if(ct)return n=Jn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,u!==Zf&&(t=Error(a(422),{cause:u}),cl(cr(t,s)))):(u!==Zf&&(n=Error(a(423),{cause:u}),cl(cr(n,s))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,u=cr(u,s),h=$h(t.stateNode,u,h),uh(t,h),qt!==4&&(qt=2)),!1;var p=Error(a(520),{cause:u});if(p=cr(p,s),kl===null?kl=[p]:kl.push(p),qt!==4&&(qt=2),n===null)return!0;u=cr(u,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=h&-h,s.lanes|=t,t=$h(s.stateNode,u,t),uh(s,t),!1;case 1:if(n=s.type,p=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(ai===null||!ai.has(p))))return s.flags|=65536,h&=-h,s.lanes|=h,h=Gb(h),Vb(h,t,s,u),uh(s,h),!1}s=s.return}while(s!==null);return!1}var Nh=Error(a(461)),Zt=!1;function yn(t,n,s,u){n.child=t===null?Yy(n,null,s,u):Bi(n,t.child,s,u)}function Fb(t,n,s,u,h){s=s.render;var p=n.ref;if("ref"in u){var C={};for(var k in u)k!=="ref"&&(C[k]=u[k])}else C=u;return Hi(n),u=mh(t,n,s,C,p,h),k=yh(),t!==null&&!Zt?(bh(t,n,h),ya(t,n,h)):(ct&&k&&Jf(n),n.flags|=1,yn(t,n,u,h),n.child)}function Kb(t,n,s,u,h){if(t===null){var p=s.type;return typeof p=="function"&&!Wf(p)&&p.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=p,Wb(t,n,p,u,h)):(t=Zc(s.type,null,u,n,n.mode,h),t.ref=n.ref,t.return=n,n.child=t)}if(p=t.child,!qh(t,h)){var C=p.memoizedProps;if(s=s.compare,s=s!==null?s:sl,s(C,u)&&t.ref===n.ref)return ya(t,n,h)}return n.flags|=1,t=da(p,u),t.ref=n.ref,t.return=n,n.child=t}function Wb(t,n,s,u,h){if(t!==null){var p=t.memoizedProps;if(sl(p,u)&&t.ref===n.ref)if(Zt=!1,n.pendingProps=u=p,qh(t,h))(t.flags&131072)!==0&&(Zt=!0);else return n.lanes=t.lanes,ya(t,n,h)}return Ih(t,n,s,u,h)}function Yb(t,n,s,u){var h=u.children,p=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((n.flags&128)!==0){if(p=p!==null?p.baseLanes|s:s,t!==null){for(u=n.child=t.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~p}else u=0,n.child=null;return Xb(t,n,p,s,u)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&ru(n,p!==null?p.cachePool:null),p!==null?Qy(n,p):fh(),Zy(n);else return u=n.lanes=536870912,Xb(t,n,p!==null?p.baseLanes|s:s,s,u)}else p!==null?(ru(n,p.cachePool),Qy(n,p),ei(),n.memoizedState=null):(t!==null&&ru(n,null),fh(),ei());return yn(t,n,h,s),n.child}function wl(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Xb(t,n,s,u,h){var p=sh();return p=p===null?null:{parent:Jt._currentValue,pool:p},n.memoizedState={baseLanes:s,cachePool:p},t!==null&&ru(n,null),fh(),Zy(n),t!==null&&Os(t,n,u,!0),n.childLanes=h,null}function vu(t,n){return n=wu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Jb(t,n,s){return Bi(n,t.child,null,s),t=vu(n,n.pendingProps),t.flags|=2,Qn(n),n.memoizedState=null,t}function BA(t,n,s){var u=n.pendingProps,h=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(ct){if(u.mode==="hidden")return t=vu(n,u),n.lanes=536870912,wl(null,t);if(gh(n),(t=Rt)?(t=cS(t,fr),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Fa!==null?{id:Kr,overflow:Wr}:null,retryLane:536870912,hydrationErrors:null},s=$y(t),s.return=n,n.child=s,pn=n,Rt=null)):t=null,t===null)throw Wa(n);return n.lanes=536870912,null}return vu(n,u)}var p=t.memoizedState;if(p!==null){var C=p.dehydrated;if(gh(n),h)if(n.flags&256)n.flags&=-257,n=Jb(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(a(558));else if(Zt||Os(t,n,s,!1),h=(s&t.childLanes)!==0,Zt||h){if(u=xt,u!==null&&(C=Me(u,s),C!==0&&C!==p.retryLane))throw p.retryLane=C,Mi(t,C),qn(u,t,C),Nh;Du(),n=Jb(t,n,s)}else t=p.treeContext,Rt=gr(C.nextSibling),pn=n,ct=!0,Ka=null,fr=!1,t!==null&&Hy(n,t),n=vu(n,u),n.flags|=4096;return n}return t=da(t.child,{mode:u.mode,children:u.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Su(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function Ih(t,n,s,u,h){return Hi(n),s=mh(t,n,s,u,void 0,h),u=yh(),t!==null&&!Zt?(bh(t,n,h),ya(t,n,h)):(ct&&u&&Jf(n),n.flags|=1,yn(t,n,s,h),n.child)}function Qb(t,n,s,u,h,p){return Hi(n),n.updateQueue=null,s=tb(n,u,s,h),eb(t),u=yh(),t!==null&&!Zt?(bh(t,n,p),ya(t,n,p)):(ct&&u&&Jf(n),n.flags|=1,yn(t,n,s,p),n.child)}function Zb(t,n,s,u,h){if(Hi(n),n.stateNode===null){var p=Ts,C=s.contextType;typeof C=="object"&&C!==null&&(p=mn(C)),p=new s(u,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Mh,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=u,p.state=n.memoizedState,p.refs={},lh(n),C=s.contextType,p.context=typeof C=="object"&&C!==null?mn(C):Ts,p.state=n.memoizedState,C=s.getDerivedStateFromProps,typeof C=="function"&&(Lh(n,s,C,u),p.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(C=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),C!==p.state&&Mh.enqueueReplaceState(p,p.state,null),ml(n,u,p,h),pl(),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308),u=!0}else if(t===null){p=n.stateNode;var k=n.memoizedProps,z=qi(s,k);p.props=z;var Y=p.context,ne=s.contextType;C=Ts,typeof ne=="object"&&ne!==null&&(C=mn(ne));var le=s.getDerivedStateFromProps;ne=typeof le=="function"||typeof p.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,ne||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(k||Y!==C)&&zb(n,p,u,C),Xa=!1;var Q=n.memoizedState;p.state=Q,ml(n,u,p,h),pl(),Y=n.memoizedState,k||Q!==Y||Xa?(typeof le=="function"&&(Lh(n,s,le,u),Y=n.memoizedState),(z=Xa||jb(n,s,z,u,Q,Y,C))?(ne||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(n.flags|=4194308)):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=Y),p.props=u,p.state=Y,p.context=C,u=z):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{p=n.stateNode,ch(t,n),C=n.memoizedProps,ne=qi(s,C),p.props=ne,le=n.pendingProps,Q=p.context,Y=s.contextType,z=Ts,typeof Y=="object"&&Y!==null&&(z=mn(Y)),k=s.getDerivedStateFromProps,(Y=typeof k=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(C!==le||Q!==z)&&zb(n,p,u,z),Xa=!1,Q=n.memoizedState,p.state=Q,ml(n,u,p,h),pl();var te=n.memoizedState;C!==le||Q!==te||Xa||t!==null&&t.dependencies!==null&&tu(t.dependencies)?(typeof k=="function"&&(Lh(n,s,k,u),te=n.memoizedState),(ne=Xa||jb(n,s,ne,u,Q,te,z)||t!==null&&t.dependencies!==null&&tu(t.dependencies))?(Y||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(u,te,z),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(u,te,z)),typeof p.componentDidUpdate=="function"&&(n.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof p.componentDidUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=te),p.props=u,p.state=te,p.context=z,u=ne):(typeof p.componentDidUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(n.flags|=1024),u=!1)}return p=u,Su(t,n),u=(n.flags&128)!==0,p||u?(p=n.stateNode,s=u&&typeof s.getDerivedStateFromError!="function"?null:p.render(),n.flags|=1,t!==null&&u?(n.child=Bi(n,t.child,null,h),n.child=Bi(n,null,s,h)):yn(t,n,s,h),n.memoizedState=p.state,t=n.child):t=ya(t,n,h),t}function ev(t,n,s,u){return Ni(),n.flags|=256,yn(t,n,s,u),n.child}var Hh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jh(t){return{baseLanes:t,cachePool:qy()}}function zh(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=er),t}function tv(t,n,s){var u=n.pendingProps,h=!1,p=(n.flags&128)!==0,C;if((C=p)||(C=t!==null&&t.memoizedState===null?!1:(Ft.current&2)!==0),C&&(h=!0,n.flags&=-129),C=(n.flags&32)!==0,n.flags&=-33,t===null){if(ct){if(h?Za(n):ei(),(t=Rt)?(t=cS(t,fr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Fa!==null?{id:Kr,overflow:Wr}:null,retryLane:536870912,hydrationErrors:null},s=$y(t),s.return=n,n.child=s,pn=n,Rt=null)):t=null,t===null)throw Wa(n);return wg(t)?n.lanes=32:n.lanes=536870912,null}var k=u.children;return u=u.fallback,h?(ei(),h=n.mode,k=wu({mode:"hidden",children:k},h),u=$i(u,h,s,null),k.return=n,u.return=n,k.sibling=u,n.child=k,u=n.child,u.memoizedState=jh(s),u.childLanes=zh(t,C,s),n.memoizedState=Hh,wl(null,u)):(Za(n),Uh(n,k))}var z=t.memoizedState;if(z!==null&&(k=z.dehydrated,k!==null)){if(p)n.flags&256?(Za(n),n.flags&=-257,n=Bh(t,n,s)):n.memoizedState!==null?(ei(),n.child=t.child,n.flags|=128,n=null):(ei(),k=u.fallback,h=n.mode,u=wu({mode:"visible",children:u.children},h),k=$i(k,h,s,null),k.flags|=2,u.return=n,k.return=n,u.sibling=k,n.child=u,Bi(n,t.child,null,s),u=n.child,u.memoizedState=jh(s),u.childLanes=zh(t,C,s),n.memoizedState=Hh,n=wl(null,u));else if(Za(n),wg(k)){if(C=k.nextSibling&&k.nextSibling.dataset,C)var Y=C.dgst;C=Y,u=Error(a(419)),u.stack="",u.digest=C,cl({value:u,source:null,stack:null}),n=Bh(t,n,s)}else if(Zt||Os(t,n,s,!1),C=(s&t.childLanes)!==0,Zt||C){if(C=xt,C!==null&&(u=Me(C,s),u!==0&&u!==z.retryLane))throw z.retryLane=u,Mi(t,u),qn(C,t,u),Nh;Sg(k)||Du(),n=Bh(t,n,s)}else Sg(k)?(n.flags|=192,n.child=t.child,n=null):(t=z.treeContext,Rt=gr(k.nextSibling),pn=n,ct=!0,Ka=null,fr=!1,t!==null&&Hy(n,t),n=Uh(n,u.children),n.flags|=4096);return n}return h?(ei(),k=u.fallback,h=n.mode,z=t.child,Y=z.sibling,u=da(z,{mode:"hidden",children:u.children}),u.subtreeFlags=z.subtreeFlags&65011712,Y!==null?k=da(Y,k):(k=$i(k,h,s,null),k.flags|=2),k.return=n,u.return=n,u.sibling=k,n.child=u,wl(null,u),u=n.child,k=t.child.memoizedState,k===null?k=jh(s):(h=k.cachePool,h!==null?(z=Jt._currentValue,h=h.parent!==z?{parent:z,pool:z}:h):h=qy(),k={baseLanes:k.baseLanes|s,cachePool:h}),u.memoizedState=k,u.childLanes=zh(t,C,s),n.memoizedState=Hh,wl(t.child,u)):(Za(n),s=t.child,t=s.sibling,s=da(s,{mode:"visible",children:u.children}),s.return=n,s.sibling=null,t!==null&&(C=n.deletions,C===null?(n.deletions=[t],n.flags|=16):C.push(t)),n.child=s,n.memoizedState=null,s)}function Uh(t,n){return n=wu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function wu(t,n){return t=Xn(22,t,null,n),t.lanes=0,t}function Bh(t,n,s){return Bi(n,t.child,null,s),t=Uh(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function nv(t,n,s){t.lanes|=n;var u=t.alternate;u!==null&&(u.lanes|=n),nh(t.return,n,s)}function Ph(t,n,s,u,h,p){var C=t.memoizedState;C===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:s,tailMode:h,treeForkCount:p}:(C.isBackwards=n,C.rendering=null,C.renderingStartTime=0,C.last=u,C.tail=s,C.tailMode=h,C.treeForkCount=p)}function rv(t,n,s){var u=n.pendingProps,h=u.revealOrder,p=u.tail;u=u.children;var C=Ft.current,k=(C&2)!==0;if(k?(C=C&1|2,n.flags|=128):C&=1,ge(Ft,C),yn(t,n,u,s),u=ct?ll:0,!k&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&nv(t,s,n);else if(t.tag===19)nv(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(s=n.child,h=null;s!==null;)t=s.alternate,t!==null&&cu(t)===null&&(h=s),s=s.sibling;s=h,s===null?(h=n.child,n.child=null):(h=s.sibling,s.sibling=null),Ph(n,!1,h,s,p,u);break;case"backwards":case"unstable_legacy-backwards":for(s=null,h=n.child,n.child=null;h!==null;){if(t=h.alternate,t!==null&&cu(t)===null){n.child=h;break}t=h.sibling,h.sibling=s,s=h,h=t}Ph(n,!0,s,null,p,u);break;case"together":Ph(n,!1,null,null,void 0,u);break;default:n.memoizedState=null}return n.child}function ya(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),ri|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(Os(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(a(153));if(n.child!==null){for(t=n.child,s=da(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=da(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function qh(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&tu(t)))}function PA(t,n,s){switch(n.tag){case 3:ze(n,n.stateNode.containerInfo),Ya(n,Jt,t.memoizedState.cache),Ni();break;case 27:case 5:Ge(n);break;case 4:ze(n,n.stateNode.containerInfo);break;case 10:Ya(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,gh(n),null;break;case 13:var u=n.memoizedState;if(u!==null)return u.dehydrated!==null?(Za(n),n.flags|=128,null):(s&n.child.childLanes)!==0?tv(t,n,s):(Za(n),t=ya(t,n,s),t!==null?t.sibling:null);Za(n);break;case 19:var h=(t.flags&128)!==0;if(u=(s&n.childLanes)!==0,u||(Os(t,n,s,!1),u=(s&n.childLanes)!==0),h){if(u)return rv(t,n,s);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ge(Ft,Ft.current),u)break;return null;case 22:return n.lanes=0,Yb(t,n,s,n.pendingProps);case 24:Ya(n,Jt,t.memoizedState.cache)}return ya(t,n,s)}function av(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)Zt=!0;else{if(!qh(t,s)&&(n.flags&128)===0)return Zt=!1,PA(t,n,s);Zt=(t.flags&131072)!==0}else Zt=!1,ct&&(n.flags&1048576)!==0&&Iy(n,ll,n.index);switch(n.lanes=0,n.tag){case 16:e:{var u=n.pendingProps;if(t=zi(n.elementType),n.type=t,typeof t=="function")Wf(t)?(u=qi(t,u),n.tag=1,n=Zb(null,n,t,u,s)):(n.tag=0,n=Ih(null,n,t,u,s));else{if(t!=null){var h=t.$$typeof;if(h===L){n.tag=11,n=Fb(null,n,t,u,s);break e}else if(h===B){n.tag=14,n=Kb(null,n,t,u,s);break e}}throw n=qe(t)||t,Error(a(306,n,""))}}return n;case 0:return Ih(t,n,n.type,n.pendingProps,s);case 1:return u=n.type,h=qi(u,n.pendingProps),Zb(t,n,u,h,s);case 3:e:{if(ze(n,n.stateNode.containerInfo),t===null)throw Error(a(387));u=n.pendingProps;var p=n.memoizedState;h=p.element,ch(t,n),ml(n,u,null,s);var C=n.memoizedState;if(u=C.cache,Ya(n,Jt,u),u!==p.cache&&rh(n,[Jt],s,!0),pl(),u=C.element,p.isDehydrated)if(p={element:u,isDehydrated:!1,cache:C.cache},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){n=ev(t,n,u,s);break e}else if(u!==h){h=cr(Error(a(424)),n),cl(h),n=ev(t,n,u,s);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Rt=gr(t.firstChild),pn=n,ct=!0,Ka=null,fr=!0,s=Yy(n,null,u,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ni(),u===h){n=ya(t,n,s);break e}yn(t,n,u,s)}n=n.child}return n;case 26:return Su(t,n),t===null?(s=pS(n.type,null,n.pendingProps,null))?n.memoizedState=s:ct||(s=n.type,t=n.pendingProps,u=Hu(ae.current).createElement(s),u[Nt]=n,u[gn]=t,bn(u,s,t),Xt(u),n.stateNode=u):n.memoizedState=pS(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ge(n),t===null&&ct&&(u=n.stateNode=fS(n.type,n.pendingProps,ae.current),pn=n,fr=!0,h=Rt,li(n.type)?(Cg=h,Rt=gr(u.firstChild)):Rt=h),yn(t,n,n.pendingProps.children,s),Su(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&ct&&((h=u=Rt)&&(u=bx(u,n.type,n.pendingProps,fr),u!==null?(n.stateNode=u,pn=n,Rt=gr(u.firstChild),fr=!1,h=!0):h=!1),h||Wa(n)),Ge(n),h=n.type,p=n.pendingProps,C=t!==null?t.memoizedProps:null,u=p.children,yg(h,p)?u=null:C!==null&&yg(h,C)&&(n.flags|=32),n.memoizedState!==null&&(h=mh(t,n,MA,null,null,s),Il._currentValue=h),Su(t,n),yn(t,n,u,s),n.child;case 6:return t===null&&ct&&((t=s=Rt)&&(s=vx(s,n.pendingProps,fr),s!==null?(n.stateNode=s,pn=n,Rt=null,t=!0):t=!1),t||Wa(n)),null;case 13:return tv(t,n,s);case 4:return ze(n,n.stateNode.containerInfo),u=n.pendingProps,t===null?n.child=Bi(n,null,u,s):yn(t,n,u,s),n.child;case 11:return Fb(t,n,n.type,n.pendingProps,s);case 7:return yn(t,n,n.pendingProps,s),n.child;case 8:return yn(t,n,n.pendingProps.children,s),n.child;case 12:return yn(t,n,n.pendingProps.children,s),n.child;case 10:return u=n.pendingProps,Ya(n,n.type,u.value),yn(t,n,u.children,s),n.child;case 9:return h=n.type._context,u=n.pendingProps.children,Hi(n),h=mn(h),u=u(h),n.flags|=1,yn(t,n,u,s),n.child;case 14:return Kb(t,n,n.type,n.pendingProps,s);case 15:return Wb(t,n,n.type,n.pendingProps,s);case 19:return rv(t,n,s);case 31:return BA(t,n,s);case 22:return Yb(t,n,s,n.pendingProps);case 24:return Hi(n),u=mn(Jt),t===null?(h=sh(),h===null&&(h=xt,p=ah(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=s),h=p),n.memoizedState={parent:u,cache:h},lh(n),Ya(n,Jt,h)):((t.lanes&s)!==0&&(ch(t,n),ml(n,null,null,s),pl()),h=t.memoizedState,p=n.memoizedState,h.parent!==u?(h={parent:u,cache:u},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),Ya(n,Jt,u)):(u=p.cache,Ya(n,Jt,u),u!==h.cache&&rh(n,[Jt],s,!0))),yn(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function ba(t){t.flags|=4}function Gh(t,n,s,u,h){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Ov())t.flags|=8192;else throw Ui=iu,oh}else t.flags&=-16777217}function iv(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!SS(n))if(Ov())t.flags|=8192;else throw Ui=iu,oh}function Cu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?De():536870912,t.lanes|=n,qs|=n)}function Cl(t,n){if(!ct)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function Dt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,u=0;if(n)for(var h=t.child;h!==null;)s|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)s|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=u,t.childLanes=s,n}function qA(t,n,s){var u=n.pendingProps;switch(Qf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(n),null;case 1:return Dt(n),null;case 3:return s=n.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),n.memoizedState.cache!==u&&(n.flags|=2048),ga(Jt),$e(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Ds(n)?ba(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,eh())),Dt(n),null;case 26:var h=n.type,p=n.memoizedState;return t===null?(ba(n),p!==null?(Dt(n),iv(n,p)):(Dt(n),Gh(n,h,null,u,s))):p?p!==t.memoizedState?(ba(n),Dt(n),iv(n,p)):(Dt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==u&&ba(n),Dt(n),Gh(n,h,t,u,s)),null;case 27:if(At(n),s=ae.current,h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&ba(n);else{if(!u){if(n.stateNode===null)throw Error(a(166));return Dt(n),null}t=de.current,Ds(n)?jy(n):(t=fS(h,u,s),n.stateNode=t,ba(n))}return Dt(n),null;case 5:if(At(n),h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&ba(n);else{if(!u){if(n.stateNode===null)throw Error(a(166));return Dt(n),null}if(p=de.current,Ds(n))jy(n);else{var C=Hu(ae.current);switch(p){case 1:p=C.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=C.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=C.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=C.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=C.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof u.is=="string"?C.createElement("select",{is:u.is}):C.createElement("select"),u.multiple?p.multiple=!0:u.size&&(p.size=u.size);break;default:p=typeof u.is=="string"?C.createElement(h,{is:u.is}):C.createElement(h)}}p[Nt]=n,p[gn]=u;e:for(C=n.child;C!==null;){if(C.tag===5||C.tag===6)p.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===n)break e;for(;C.sibling===null;){if(C.return===null||C.return===n)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}n.stateNode=p;e:switch(bn(p,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ba(n)}}return Dt(n),Gh(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==u&&ba(n);else{if(typeof u!="string"&&n.stateNode===null)throw Error(a(166));if(t=ae.current,Ds(n)){if(t=n.stateNode,s=n.memoizedProps,u=null,h=pn,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}t[Nt]=n,t=!!(t.nodeValue===s||u!==null&&u.suppressHydrationWarning===!0||tS(t.nodeValue,s)),t||Wa(n,!0)}else t=Hu(t).createTextNode(u),t[Nt]=n,n.stateNode=t}return Dt(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(u=Ds(n),s!==null){if(t===null){if(!u)throw Error(a(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Nt]=n}else Ni(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Dt(n),t=!1}else s=eh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(Qn(n),n):(Qn(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Dt(n),null;case 13:if(u=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Ds(n),u!==null&&u.dehydrated!==null){if(t===null){if(!h)throw Error(a(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Nt]=n}else Ni(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Dt(n),h=!1}else h=eh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(Qn(n),n):(Qn(n),null)}return Qn(n),(n.flags&128)!==0?(n.lanes=s,n):(s=u!==null,t=t!==null&&t.memoizedState!==null,s&&(u=n.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),p=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),p!==h&&(u.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),Cu(n,n.updateQueue),Dt(n),null);case 4:return $e(),t===null&&fg(n.stateNode.containerInfo),Dt(n),null;case 10:return ga(n.type),Dt(n),null;case 19:if(T(Ft),u=n.memoizedState,u===null)return Dt(n),null;if(h=(n.flags&128)!==0,p=u.rendering,p===null)if(h)Cl(u,!1);else{if(qt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(p=cu(t),p!==null){for(n.flags|=128,Cl(u,!1),t=p.updateQueue,n.updateQueue=t,Cu(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)My(s,t),s=s.sibling;return ge(Ft,Ft.current&1|2),ct&&fa(n,u.treeForkCount),n.child}t=t.sibling}u.tail!==null&&Ut()>Tu&&(n.flags|=128,h=!0,Cl(u,!1),n.lanes=4194304)}else{if(!h)if(t=cu(p),t!==null){if(n.flags|=128,h=!0,t=t.updateQueue,n.updateQueue=t,Cu(n,t),Cl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!p.alternate&&!ct)return Dt(n),null}else 2*Ut()-u.renderingStartTime>Tu&&s!==536870912&&(n.flags|=128,h=!0,Cl(u,!1),n.lanes=4194304);u.isBackwards?(p.sibling=n.child,n.child=p):(t=u.last,t!==null?t.sibling=p:n.child=p,u.last=p)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Ut(),t.sibling=null,s=Ft.current,ge(Ft,h?s&1|2:s&1),ct&&fa(n,u.treeForkCount),t):(Dt(n),null);case 22:case 23:return Qn(n),hh(),u=n.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(n.flags|=8192):u&&(n.flags|=8192),u?(s&536870912)!==0&&(n.flags&128)===0&&(Dt(n),n.subtreeFlags&6&&(n.flags|=8192)):Dt(n),s=n.updateQueue,s!==null&&Cu(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==s&&(n.flags|=2048),t!==null&&T(ji),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),ga(Jt),Dt(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function GA(t,n){switch(Qf(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ga(Jt),$e(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return At(n),null;case 31:if(n.memoizedState!==null){if(Qn(n),n.alternate===null)throw Error(a(340));Ni()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Qn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Ni()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return T(Ft),null;case 4:return $e(),null;case 10:return ga(n.type),null;case 22:case 23:return Qn(n),hh(),t!==null&&T(ji),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ga(Jt),null;case 25:return null;default:return null}}function sv(t,n){switch(Qf(n),n.tag){case 3:ga(Jt),$e();break;case 26:case 27:case 5:At(n);break;case 4:$e();break;case 31:n.memoizedState!==null&&Qn(n);break;case 13:Qn(n);break;case 19:T(Ft);break;case 10:ga(n.type);break;case 22:case 23:Qn(n),hh(),t!==null&&T(ji);break;case 24:ga(Jt)}}function El(t,n){try{var s=n.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var h=u.next;s=h;do{if((s.tag&t)===t){u=void 0;var p=s.create,C=s.inst;u=p(),C.destroy=u}s=s.next}while(s!==h)}}catch(k){St(n,n.return,k)}}function ti(t,n,s){try{var u=n.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var p=h.next;u=p;do{if((u.tag&t)===t){var C=u.inst,k=C.destroy;if(k!==void 0){C.destroy=void 0,h=n;var z=s,Y=k;try{Y()}catch(ne){St(h,z,ne)}}}u=u.next}while(u!==p)}}catch(ne){St(n,n.return,ne)}}function ov(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{Jy(n,s)}catch(u){St(t,t.return,u)}}}function lv(t,n,s){s.props=qi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(u){St(t,n,u)}}function _l(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof s=="function"?t.refCleanup=s(u):s.current=u}}catch(h){St(t,n,h)}}function Yr(t,n){var s=t.ref,u=t.refCleanup;if(s!==null)if(typeof u=="function")try{u()}catch(h){St(t,n,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){St(t,n,h)}else s.current=null}function cv(t){var n=t.type,s=t.memoizedProps,u=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&u.focus();break e;case"img":s.src?u.src=s.src:s.srcSet&&(u.srcset=s.srcSet)}}catch(h){St(t,t.return,h)}}function Vh(t,n,s){try{var u=t.stateNode;fx(u,t.type,s,n),u[gn]=n}catch(h){St(t,t.return,h)}}function uv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&li(t.type)||t.tag===4}function Fh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||uv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&li(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Kh(t,n,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=or));else if(u!==4&&(u===27&&li(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(Kh(t,n,s),t=t.sibling;t!==null;)Kh(t,n,s),t=t.sibling}function Eu(t,n,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(u!==4&&(u===27&&li(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Eu(t,n,s),t=t.sibling;t!==null;)Eu(t,n,s),t=t.sibling}function dv(t){var n=t.stateNode,s=t.memoizedProps;try{for(var u=t.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);bn(n,u,s),n[Nt]=t,n[gn]=s}catch(p){St(t,t.return,p)}}var va=!1,en=!1,Wh=!1,fv=typeof WeakSet=="function"?WeakSet:Set,un=null;function VA(t,n){if(t=t.containerInfo,pg=Gu,t=_y(t),Bf(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var h=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var C=0,k=-1,z=-1,Y=0,ne=0,le=t,Q=null;t:for(;;){for(var te;le!==s||h!==0&&le.nodeType!==3||(k=C+h),le!==p||u!==0&&le.nodeType!==3||(z=C+u),le.nodeType===3&&(C+=le.nodeValue.length),(te=le.firstChild)!==null;)Q=le,le=te;for(;;){if(le===t)break t;if(Q===s&&++Y===h&&(k=C),Q===p&&++ne===u&&(z=C),(te=le.nextSibling)!==null)break;le=Q,Q=le.parentNode}le=te}s=k===-1||z===-1?null:{start:k,end:z}}else s=null}s=s||{start:0,end:0}}else s=null;for(mg={focusedElem:t,selectionRange:s},Gu=!1,un=n;un!==null;)if(n=un,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,un=t;else for(;un!==null;){switch(n=un,p=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)h=t[s],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&p!==null){t=void 0,s=n,h=p.memoizedProps,p=p.memoizedState,u=s.stateNode;try{var Te=qi(s.type,h);t=u.getSnapshotBeforeUpdate(Te,p),u.__reactInternalSnapshotBeforeUpdate=t}catch(He){St(s,s.return,He)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)vg(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":vg(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=n.sibling,t!==null){t.return=n.return,un=t;break}un=n.return}}function hv(t,n,s){var u=s.flags;switch(s.tag){case 0:case 11:case 15:wa(t,s),u&4&&El(5,s);break;case 1:if(wa(t,s),u&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(C){St(s,s.return,C)}else{var h=qi(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(h,n,t.__reactInternalSnapshotBeforeUpdate)}catch(C){St(s,s.return,C)}}u&64&&ov(s),u&512&&_l(s,s.return);break;case 3:if(wa(t,s),u&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{Jy(t,n)}catch(C){St(s,s.return,C)}}break;case 27:n===null&&u&4&&dv(s);case 26:case 5:wa(t,s),n===null&&u&4&&cv(s),u&512&&_l(s,s.return);break;case 12:wa(t,s);break;case 31:wa(t,s),u&4&&mv(t,s);break;case 13:wa(t,s),u&4&&yv(t,s),u&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=ex.bind(null,s),Sx(t,s))));break;case 22:if(u=s.memoizedState!==null||va,!u){n=n!==null&&n.memoizedState!==null||en,h=va;var p=en;va=u,(en=n)&&!p?Ca(t,s,(s.subtreeFlags&8772)!==0):wa(t,s),va=h,en=p}break;case 30:break;default:wa(t,s)}}function gv(t){var n=t.alternate;n!==null&&(t.alternate=null,gv(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Io(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Lt=null,zn=!1;function Sa(t,n,s){for(s=s.child;s!==null;)pv(t,n,s),s=s.sibling}function pv(t,n,s){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount($n,s)}catch{}switch(s.tag){case 26:en||Yr(s,n),Sa(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:en||Yr(s,n);var u=Lt,h=zn;li(s.type)&&(Lt=s.stateNode,zn=!1),Sa(t,n,s),Ml(s.stateNode),Lt=u,zn=h;break;case 5:en||Yr(s,n);case 6:if(u=Lt,h=zn,Lt=null,Sa(t,n,s),Lt=u,zn=h,Lt!==null)if(zn)try{(Lt.nodeType===9?Lt.body:Lt.nodeName==="HTML"?Lt.ownerDocument.body:Lt).removeChild(s.stateNode)}catch(p){St(s,n,p)}else try{Lt.removeChild(s.stateNode)}catch(p){St(s,n,p)}break;case 18:Lt!==null&&(zn?(t=Lt,oS(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Js(t)):oS(Lt,s.stateNode));break;case 4:u=Lt,h=zn,Lt=s.stateNode.containerInfo,zn=!0,Sa(t,n,s),Lt=u,zn=h;break;case 0:case 11:case 14:case 15:ti(2,s,n),en||ti(4,s,n),Sa(t,n,s);break;case 1:en||(Yr(s,n),u=s.stateNode,typeof u.componentWillUnmount=="function"&&lv(s,n,u)),Sa(t,n,s);break;case 21:Sa(t,n,s);break;case 22:en=(u=en)||s.memoizedState!==null,Sa(t,n,s),en=u;break;default:Sa(t,n,s)}}function mv(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Js(t)}catch(s){St(n,n.return,s)}}}function yv(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Js(t)}catch(s){St(n,n.return,s)}}function FA(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new fv),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new fv),n;default:throw Error(a(435,t.tag))}}function _u(t,n){var s=FA(t);n.forEach(function(u){if(!s.has(u)){s.add(u);var h=tx.bind(null,t,u);u.then(h,h)}})}function Un(t,n){var s=n.deletions;if(s!==null)for(var u=0;u<s.length;u++){var h=s[u],p=t,C=n,k=C;e:for(;k!==null;){switch(k.tag){case 27:if(li(k.type)){Lt=k.stateNode,zn=!1;break e}break;case 5:Lt=k.stateNode,zn=!1;break e;case 3:case 4:Lt=k.stateNode.containerInfo,zn=!0;break e}k=k.return}if(Lt===null)throw Error(a(160));pv(p,C,h),Lt=null,zn=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)bv(n,t),n=n.sibling}var Mr=null;function bv(t,n){var s=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Un(n,t),Bn(t),u&4&&(ti(3,t,t.return),El(3,t),ti(5,t,t.return));break;case 1:Un(n,t),Bn(t),u&512&&(en||s===null||Yr(s,s.return)),u&64&&va&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?u:s.concat(u))));break;case 26:var h=Mr;if(Un(n,t),Bn(t),u&512&&(en||s===null||Yr(s,s.return)),u&4){var p=s!==null?s.memoizedState:null;if(u=t.memoizedState,s===null)if(u===null)if(t.stateNode===null){e:{u=t.type,s=t.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":p=h.getElementsByTagName("title")[0],(!p||p[ia]||p[Nt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(u),h.head.insertBefore(p,h.querySelector("head > title"))),bn(p,u,s),p[Nt]=t,Xt(p),u=p;break e;case"link":var C=bS("link","href",h).get(u+(s.href||""));if(C){for(var k=0;k<C.length;k++)if(p=C[k],p.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&p.getAttribute("rel")===(s.rel==null?null:s.rel)&&p.getAttribute("title")===(s.title==null?null:s.title)&&p.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){C.splice(k,1);break t}}p=h.createElement(u),bn(p,u,s),h.head.appendChild(p);break;case"meta":if(C=bS("meta","content",h).get(u+(s.content||""))){for(k=0;k<C.length;k++)if(p=C[k],p.getAttribute("content")===(s.content==null?null:""+s.content)&&p.getAttribute("name")===(s.name==null?null:s.name)&&p.getAttribute("property")===(s.property==null?null:s.property)&&p.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&p.getAttribute("charset")===(s.charSet==null?null:s.charSet)){C.splice(k,1);break t}}p=h.createElement(u),bn(p,u,s),h.head.appendChild(p);break;default:throw Error(a(468,u))}p[Nt]=t,Xt(p),u=p}t.stateNode=u}else vS(h,t.type,t.stateNode);else t.stateNode=yS(h,u,t.memoizedProps);else p!==u?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,u===null?vS(h,t.type,t.stateNode):yS(h,u,t.memoizedProps)):u===null&&t.stateNode!==null&&Vh(t,t.memoizedProps,s.memoizedProps)}break;case 27:Un(n,t),Bn(t),u&512&&(en||s===null||Yr(s,s.return)),s!==null&&u&4&&Vh(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Un(n,t),Bn(t),u&512&&(en||s===null||Yr(s,s.return)),t.flags&32){h=t.stateNode;try{Ua(h,"")}catch(Te){St(t,t.return,Te)}}u&4&&t.stateNode!=null&&(h=t.memoizedProps,Vh(t,h,s!==null?s.memoizedProps:h)),u&1024&&(Wh=!0);break;case 6:if(Un(n,t),Bn(t),u&4){if(t.stateNode===null)throw Error(a(162));u=t.memoizedProps,s=t.stateNode;try{s.nodeValue=u}catch(Te){St(t,t.return,Te)}}break;case 3:if(Uu=null,h=Mr,Mr=ju(n.containerInfo),Un(n,t),Mr=h,Bn(t),u&4&&s!==null&&s.memoizedState.isDehydrated)try{Js(n.containerInfo)}catch(Te){St(t,t.return,Te)}Wh&&(Wh=!1,vv(t));break;case 4:u=Mr,Mr=ju(t.stateNode.containerInfo),Un(n,t),Bn(t),Mr=u;break;case 12:Un(n,t),Bn(t);break;case 31:Un(n,t),Bn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,_u(t,u)));break;case 13:Un(n,t),Bn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(xu=Ut()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,_u(t,u)));break;case 22:h=t.memoizedState!==null;var z=s!==null&&s.memoizedState!==null,Y=va,ne=en;if(va=Y||h,en=ne||z,Un(n,t),en=ne,va=Y,Bn(t),u&8192)e:for(n=t.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(s===null||z||va||en||Gi(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){z=s=n;try{if(p=z.stateNode,h)C=p.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{k=z.stateNode;var le=z.memoizedProps.style,Q=le!=null&&le.hasOwnProperty("display")?le.display:null;k.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Te){St(z,z.return,Te)}}}else if(n.tag===6){if(s===null){z=n;try{z.stateNode.nodeValue=h?"":z.memoizedProps}catch(Te){St(z,z.return,Te)}}}else if(n.tag===18){if(s===null){z=n;try{var te=z.stateNode;h?lS(te,!0):lS(z.stateNode,!1)}catch(Te){St(z,z.return,Te)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}u&4&&(u=t.updateQueue,u!==null&&(s=u.retryQueue,s!==null&&(u.retryQueue=null,_u(t,s))));break;case 19:Un(n,t),Bn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,_u(t,u)));break;case 30:break;case 21:break;default:Un(n,t),Bn(t)}}function Bn(t){var n=t.flags;if(n&2){try{for(var s,u=t.return;u!==null;){if(uv(u)){s=u;break}u=u.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var h=s.stateNode,p=Fh(t);Eu(t,p,h);break;case 5:var C=s.stateNode;s.flags&32&&(Ua(C,""),s.flags&=-33);var k=Fh(t);Eu(t,k,C);break;case 3:case 4:var z=s.stateNode.containerInfo,Y=Fh(t);Kh(t,Y,z);break;default:throw Error(a(161))}}catch(ne){St(t,t.return,ne)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function vv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;vv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function wa(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)hv(t,n.alternate,n),n=n.sibling}function Gi(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:ti(4,n,n.return),Gi(n);break;case 1:Yr(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&lv(n,n.return,s),Gi(n);break;case 27:Ml(n.stateNode);case 26:case 5:Yr(n,n.return),Gi(n);break;case 22:n.memoizedState===null&&Gi(n);break;case 30:Gi(n);break;default:Gi(n)}t=t.sibling}}function Ca(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var u=n.alternate,h=t,p=n,C=p.flags;switch(p.tag){case 0:case 11:case 15:Ca(h,p,s),El(4,p);break;case 1:if(Ca(h,p,s),u=p,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(Y){St(u,u.return,Y)}if(u=p,h=u.updateQueue,h!==null){var k=u.stateNode;try{var z=h.shared.hiddenCallbacks;if(z!==null)for(h.shared.hiddenCallbacks=null,h=0;h<z.length;h++)Xy(z[h],k)}catch(Y){St(u,u.return,Y)}}s&&C&64&&ov(p),_l(p,p.return);break;case 27:dv(p);case 26:case 5:Ca(h,p,s),s&&u===null&&C&4&&cv(p),_l(p,p.return);break;case 12:Ca(h,p,s);break;case 31:Ca(h,p,s),s&&C&4&&mv(h,p);break;case 13:Ca(h,p,s),s&&C&4&&yv(h,p);break;case 22:p.memoizedState===null&&Ca(h,p,s),_l(p,p.return);break;case 30:break;default:Ca(h,p,s)}n=n.sibling}}function Yh(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&ul(s))}function Xh(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ul(t))}function $r(t,n,s,u){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Sv(t,n,s,u),n=n.sibling}function Sv(t,n,s,u){var h=n.flags;switch(n.tag){case 0:case 11:case 15:$r(t,n,s,u),h&2048&&El(9,n);break;case 1:$r(t,n,s,u);break;case 3:$r(t,n,s,u),h&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ul(t)));break;case 12:if(h&2048){$r(t,n,s,u),t=n.stateNode;try{var p=n.memoizedProps,C=p.id,k=p.onPostCommit;typeof k=="function"&&k(C,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(z){St(n,n.return,z)}}else $r(t,n,s,u);break;case 31:$r(t,n,s,u);break;case 13:$r(t,n,s,u);break;case 23:break;case 22:p=n.stateNode,C=n.alternate,n.memoizedState!==null?p._visibility&2?$r(t,n,s,u):Al(t,n):p._visibility&2?$r(t,n,s,u):(p._visibility|=2,Us(t,n,s,u,(n.subtreeFlags&10256)!==0||!1)),h&2048&&Yh(C,n);break;case 24:$r(t,n,s,u),h&2048&&Xh(n.alternate,n);break;default:$r(t,n,s,u)}}function Us(t,n,s,u,h){for(h=h&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=t,C=n,k=s,z=u,Y=C.flags;switch(C.tag){case 0:case 11:case 15:Us(p,C,k,z,h),El(8,C);break;case 23:break;case 22:var ne=C.stateNode;C.memoizedState!==null?ne._visibility&2?Us(p,C,k,z,h):Al(p,C):(ne._visibility|=2,Us(p,C,k,z,h)),h&&Y&2048&&Yh(C.alternate,C);break;case 24:Us(p,C,k,z,h),h&&Y&2048&&Xh(C.alternate,C);break;default:Us(p,C,k,z,h)}n=n.sibling}}function Al(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,u=n,h=u.flags;switch(u.tag){case 22:Al(s,u),h&2048&&Yh(u.alternate,u);break;case 24:Al(s,u),h&2048&&Xh(u.alternate,u);break;default:Al(s,u)}n=n.sibling}}var xl=8192;function Bs(t,n,s){if(t.subtreeFlags&xl)for(t=t.child;t!==null;)wv(t,n,s),t=t.sibling}function wv(t,n,s){switch(t.tag){case 26:Bs(t,n,s),t.flags&xl&&t.memoizedState!==null&&Lx(s,Mr,t.memoizedState,t.memoizedProps);break;case 5:Bs(t,n,s);break;case 3:case 4:var u=Mr;Mr=ju(t.stateNode.containerInfo),Bs(t,n,s),Mr=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=xl,xl=16777216,Bs(t,n,s),xl=u):Bs(t,n,s));break;default:Bs(t,n,s)}}function Cv(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Tl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var u=n[s];un=u,_v(u,t)}Cv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ev(t),t=t.sibling}function Ev(t){switch(t.tag){case 0:case 11:case 15:Tl(t),t.flags&2048&&ti(9,t,t.return);break;case 3:Tl(t);break;case 12:Tl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Au(t)):Tl(t);break;default:Tl(t)}}function Au(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var u=n[s];un=u,_v(u,t)}Cv(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:ti(8,n,n.return),Au(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Au(n));break;default:Au(n)}t=t.sibling}}function _v(t,n){for(;un!==null;){var s=un;switch(s.tag){case 0:case 11:case 15:ti(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var u=s.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:ul(s.memoizedState.cache)}if(u=s.child,u!==null)u.return=s,un=u;else e:for(s=t;un!==null;){u=un;var h=u.sibling,p=u.return;if(gv(u),u===s){un=null;break e}if(h!==null){h.return=p,un=h;break e}un=p}}}var KA={getCacheForType:function(t){var n=mn(Jt),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return mn(Jt).controller.signal}},WA=typeof WeakMap=="function"?WeakMap:Map,pt=0,xt=null,tt=null,it=0,vt=0,Zn=null,ni=!1,Ps=!1,Jh=!1,Ea=0,qt=0,ri=0,Vi=0,Qh=0,er=0,qs=0,kl=null,Pn=null,Zh=!1,xu=0,Av=0,Tu=1/0,ku=null,ai=null,an=0,ii=null,Gs=null,_a=0,eg=0,tg=null,xv=null,Rl=0,ng=null;function tr(){return(pt&2)!==0&&it!==0?it&-it:J.T!==null?lg():Ot()}function Tv(){if(er===0)if((it&536870912)===0||ct){var t=ve;ve<<=1,(ve&3932160)===0&&(ve=262144),er=t}else er=536870912;return t=Jn.current,t!==null&&(t.flags|=32),er}function qn(t,n,s){(t===xt&&(vt===2||vt===9)||t.cancelPendingCommit!==null)&&(Vs(t,0),si(t,it,er,!1)),et(t,s),((pt&2)===0||t!==xt)&&(t===xt&&((pt&2)===0&&(Vi|=s),qt===4&&si(t,it,er,!1)),Xr(t))}function kv(t,n,s){if((pt&6)!==0)throw Error(a(327));var u=!s&&(n&127)===0&&(n&t.expiredLanes)===0||Be(t,n),h=u?JA(t,n):ag(t,n,!0),p=u;do{if(h===0){Ps&&!u&&si(t,n,0,!1);break}else{if(s=t.current.alternate,p&&!YA(s)){h=ag(t,n,!1),p=!1;continue}if(h===2){if(p=n,t.errorRecoveryDisabledLanes&p)var C=0;else C=t.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){n=C;e:{var k=t;h=kl;var z=k.current.memoizedState.isDehydrated;if(z&&(Vs(k,C).flags|=256),C=ag(k,C,!1),C!==2){if(Jh&&!z){k.errorRecoveryDisabledLanes|=p,Vi|=p,h=4;break e}p=Pn,Pn=h,p!==null&&(Pn===null?Pn=p:Pn.push.apply(Pn,p))}h=C}if(p=!1,h!==2)continue}}if(h===1){Vs(t,0),si(t,n,0,!0);break}e:{switch(u=t,p=h,p){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:si(u,n,er,!ni);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(h=xu+300-Ut(),10<h)){if(si(u,n,er,!ni),_e(u,0,!0)!==0)break e;_a=n,u.timeoutHandle=iS(Rv.bind(null,u,s,Pn,ku,Zh,n,er,Vi,qs,ni,p,"Throttled",-0,0),h);break e}Rv(u,s,Pn,ku,Zh,n,er,Vi,qs,ni,p,null,-0,0)}}break}while(!0);Xr(t)}function Rv(t,n,s,u,h,p,C,k,z,Y,ne,le,Q,te){if(t.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:or},wv(n,p,le);var Te=(p&62914560)===p?xu-Ut():(p&4194048)===p?Av-Ut():0;if(Te=Mx(le,Te),Te!==null){_a=p,t.cancelPendingCommit=Te(Hv.bind(null,t,n,p,s,u,h,C,k,z,ne,le,null,Q,te)),si(t,p,C,!Y);return}}Hv(t,n,p,s,u,h,C,k,z)}function YA(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var u=0;u<s.length;u++){var h=s[u],p=h.getSnapshot;h=h.value;try{if(!Yn(p(),h))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function si(t,n,s,u){n&=~Qh,n&=~Vi,t.suspendedLanes|=n,t.pingedLanes&=~n,u&&(t.warmLanes|=n),u=t.expirationTimes;for(var h=n;0<h;){var p=31-nn(h),C=1<<p;u[p]=-1,h&=~C}s!==0&&je(t,s,n)}function Ru(){return(pt&6)===0?(Dl(0),!1):!0}function rg(){if(tt!==null){if(vt===0)var t=tt.return;else t=tt,ha=Ii=null,vh(t),Ns=null,fl=0,t=tt;for(;t!==null;)sv(t.alternate,t),t=t.return;tt=null}}function Vs(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,px(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),_a=0,rg(),xt=t,tt=s=da(t.current,null),it=n,vt=0,Zn=null,ni=!1,Ps=Be(t,n),Jh=!1,qs=er=Qh=Vi=ri=qt=0,Pn=kl=null,Zh=!1,(n&8)!==0&&(n|=n&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=n;0<u;){var h=31-nn(u),p=1<<h;n|=t[h],u&=~p}return Ea=n,Xc(),s}function Dv(t,n){Xe=null,J.H=Sl,n===$s||n===au?(n=Fy(),vt=3):n===oh?(n=Fy(),vt=4):vt=n===Nh?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Zn=n,tt===null&&(qt=1,bu(t,cr(n,t.current)))}function Ov(){var t=Jn.current;return t===null?!0:(it&4194048)===it?hr===null:(it&62914560)===it||(it&536870912)!==0?t===hr:!1}function Lv(){var t=J.H;return J.H=Sl,t===null?Sl:t}function Mv(){var t=J.A;return J.A=KA,t}function Du(){qt=4,ni||(it&4194048)!==it&&Jn.current!==null||(Ps=!0),(ri&134217727)===0&&(Vi&134217727)===0||xt===null||si(xt,it,er,!1)}function ag(t,n,s){var u=pt;pt|=2;var h=Lv(),p=Mv();(xt!==t||it!==n)&&(ku=null,Vs(t,n)),n=!1;var C=qt;e:do try{if(vt!==0&&tt!==null){var k=tt,z=Zn;switch(vt){case 8:rg(),C=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(n=!0);var Y=vt;if(vt=0,Zn=null,Fs(t,k,z,Y),s&&Ps){C=0;break e}break;default:Y=vt,vt=0,Zn=null,Fs(t,k,z,Y)}}XA(),C=qt;break}catch(ne){Dv(t,ne)}while(!0);return n&&t.shellSuspendCounter++,ha=Ii=null,pt=u,J.H=h,J.A=p,tt===null&&(xt=null,it=0,Xc()),C}function XA(){for(;tt!==null;)$v(tt)}function JA(t,n){var s=pt;pt|=2;var u=Lv(),h=Mv();xt!==t||it!==n?(ku=null,Tu=Ut()+500,Vs(t,n)):Ps=Be(t,n);e:do try{if(vt!==0&&tt!==null){n=tt;var p=Zn;t:switch(vt){case 1:vt=0,Zn=null,Fs(t,n,p,1);break;case 2:case 9:if(Gy(p)){vt=0,Zn=null,Nv(n);break}n=function(){vt!==2&&vt!==9||xt!==t||(vt=7),Xr(t)},p.then(n,n);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:Gy(p)?(vt=0,Zn=null,Nv(n)):(vt=0,Zn=null,Fs(t,n,p,7));break;case 5:var C=null;switch(tt.tag){case 26:C=tt.memoizedState;case 5:case 27:var k=tt;if(C?SS(C):k.stateNode.complete){vt=0,Zn=null;var z=k.sibling;if(z!==null)tt=z;else{var Y=k.return;Y!==null?(tt=Y,Ou(Y)):tt=null}break t}}vt=0,Zn=null,Fs(t,n,p,5);break;case 6:vt=0,Zn=null,Fs(t,n,p,6);break;case 8:rg(),qt=6;break e;default:throw Error(a(462))}}QA();break}catch(ne){Dv(t,ne)}while(!0);return ha=Ii=null,J.H=u,J.A=h,pt=s,tt!==null?0:(xt=null,it=0,Xc(),qt)}function QA(){for(;tt!==null&&!sr();)$v(tt)}function $v(t){var n=av(t.alternate,t,Ea);t.memoizedProps=t.pendingProps,n===null?Ou(t):tt=n}function Nv(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=Qb(s,n,n.pendingProps,n.type,void 0,it);break;case 11:n=Qb(s,n,n.pendingProps,n.type.render,n.ref,it);break;case 5:vh(n);default:sv(s,n),n=tt=My(n,Ea),n=av(s,n,Ea)}t.memoizedProps=t.pendingProps,n===null?Ou(t):tt=n}function Fs(t,n,s,u){ha=Ii=null,vh(n),Ns=null,fl=0;var h=n.return;try{if(UA(t,h,n,s,it)){qt=1,bu(t,cr(s,t.current)),tt=null;return}}catch(p){if(h!==null)throw tt=h,p;qt=1,bu(t,cr(s,t.current)),tt=null;return}n.flags&32768?(ct||u===1?t=!0:Ps||(it&536870912)!==0?t=!1:(ni=t=!0,(u===2||u===9||u===3||u===6)&&(u=Jn.current,u!==null&&u.tag===13&&(u.flags|=16384))),Iv(n,t)):Ou(n)}function Ou(t){var n=t;do{if((n.flags&32768)!==0){Iv(n,ni);return}t=n.return;var s=qA(n.alternate,n,Ea);if(s!==null){tt=s;return}if(n=n.sibling,n!==null){tt=n;return}tt=n=t}while(n!==null);qt===0&&(qt=5)}function Iv(t,n){do{var s=GA(t.alternate,t);if(s!==null){s.flags&=32767,tt=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){tt=t;return}tt=t=s}while(t!==null);qt=6,tt=null}function Hv(t,n,s,u,h,p,C,k,z){t.cancelPendingCommit=null;do Lu();while(an!==0);if((pt&6)!==0)throw Error(a(327));if(n!==null){if(n===t.current)throw Error(a(177));if(p=n.lanes|n.childLanes,p|=Ff,Ne(t,s,p,C,k,z),t===xt&&(tt=xt=null,it=0),Gs=n,ii=t,_a=s,eg=p,tg=h,xv=u,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,nx(An,function(){return Pv(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||u){u=J.T,J.T=null,h=he.p,he.p=2,C=pt,pt|=4;try{VA(t,n,s)}finally{pt=C,he.p=h,J.T=u}}an=1,jv(),zv(),Uv()}}function jv(){if(an===1){an=0;var t=ii,n=Gs,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=J.T,J.T=null;var u=he.p;he.p=2;var h=pt;pt|=4;try{bv(n,t);var p=mg,C=_y(t.containerInfo),k=p.focusedElem,z=p.selectionRange;if(C!==k&&k&&k.ownerDocument&&Ey(k.ownerDocument.documentElement,k)){if(z!==null&&Bf(k)){var Y=z.start,ne=z.end;if(ne===void 0&&(ne=Y),"selectionStart"in k)k.selectionStart=Y,k.selectionEnd=Math.min(ne,k.value.length);else{var le=k.ownerDocument||document,Q=le&&le.defaultView||window;if(Q.getSelection){var te=Q.getSelection(),Te=k.textContent.length,He=Math.min(z.start,Te),_t=z.end===void 0?He:Math.min(z.end,Te);!te.extend&&He>_t&&(C=_t,_t=He,He=C);var F=Cy(k,He),P=Cy(k,_t);if(F&&P&&(te.rangeCount!==1||te.anchorNode!==F.node||te.anchorOffset!==F.offset||te.focusNode!==P.node||te.focusOffset!==P.offset)){var W=le.createRange();W.setStart(F.node,F.offset),te.removeAllRanges(),He>_t?(te.addRange(W),te.extend(P.node,P.offset)):(W.setEnd(P.node,P.offset),te.addRange(W))}}}}for(le=[],te=k;te=te.parentNode;)te.nodeType===1&&le.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<le.length;k++){var se=le[k];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Gu=!!pg,mg=pg=null}finally{pt=h,he.p=u,J.T=s}}t.current=n,an=2}}function zv(){if(an===2){an=0;var t=ii,n=Gs,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=J.T,J.T=null;var u=he.p;he.p=2;var h=pt;pt|=4;try{hv(t,n.alternate,n)}finally{pt=h,he.p=u,J.T=s}}an=3}}function Uv(){if(an===4||an===3){an=0,Wn();var t=ii,n=Gs,s=_a,u=xv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?an=5:(an=0,Gs=ii=null,Bv(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(ai=null),kt(s),n=n.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot($n,n,void 0,(n.current.flags&128)===128)}catch{}if(u!==null){n=J.T,h=he.p,he.p=2,J.T=null;try{for(var p=t.onRecoverableError,C=0;C<u.length;C++){var k=u[C];p(k.value,{componentStack:k.stack})}}finally{J.T=n,he.p=h}}(_a&3)!==0&&Lu(),Xr(t),h=t.pendingLanes,(s&261930)!==0&&(h&42)!==0?t===ng?Rl++:(Rl=0,ng=t):Rl=0,Dl(0)}}function Bv(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,ul(n)))}function Lu(){return jv(),zv(),Uv(),Pv()}function Pv(){if(an!==5)return!1;var t=ii,n=eg;eg=0;var s=kt(_a),u=J.T,h=he.p;try{he.p=32>s?32:s,J.T=null,s=tg,tg=null;var p=ii,C=_a;if(an=0,Gs=ii=null,_a=0,(pt&6)!==0)throw Error(a(331));var k=pt;if(pt|=4,Ev(p.current),Sv(p,p.current,C,s),pt=k,Dl(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot($n,p)}catch{}return!0}finally{he.p=h,J.T=u,Bv(t,n)}}function qv(t,n,s){n=cr(s,n),n=$h(t.stateNode,n,2),t=Qa(t,n,2),t!==null&&(et(t,2),Xr(t))}function St(t,n,s){if(t.tag===3)qv(t,t,s);else for(;n!==null;){if(n.tag===3){qv(n,t,s);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ai===null||!ai.has(u))){t=cr(s,t),s=Gb(2),u=Qa(n,s,2),u!==null&&(Vb(s,u,n,t),et(u,2),Xr(u));break}}n=n.return}}function ig(t,n,s){var u=t.pingCache;if(u===null){u=t.pingCache=new WA;var h=new Set;u.set(n,h)}else h=u.get(n),h===void 0&&(h=new Set,u.set(n,h));h.has(s)||(Jh=!0,h.add(s),t=ZA.bind(null,t,n,s),n.then(t,t))}function ZA(t,n,s){var u=t.pingCache;u!==null&&u.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,xt===t&&(it&s)===s&&(qt===4||qt===3&&(it&62914560)===it&&300>Ut()-xu?(pt&2)===0&&Vs(t,0):Qh|=s,qs===it&&(qs=0)),Xr(t)}function Gv(t,n){n===0&&(n=De()),t=Mi(t,n),t!==null&&(et(t,n),Xr(t))}function ex(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),Gv(t,s)}function tx(t,n){var s=0;switch(t.tag){case 31:case 13:var u=t.stateNode,h=t.memoizedState;h!==null&&(s=h.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(n),Gv(t,s)}function nx(t,n){return cn(t,n)}var Mu=null,Ks=null,sg=!1,$u=!1,og=!1,oi=0;function Xr(t){t!==Ks&&t.next===null&&(Ks===null?Mu=Ks=t:Ks=Ks.next=t),$u=!0,sg||(sg=!0,ax())}function Dl(t,n){if(!og&&$u){og=!0;do for(var s=!1,u=Mu;u!==null;){if(t!==0){var h=u.pendingLanes;if(h===0)var p=0;else{var C=u.suspendedLanes,k=u.pingedLanes;p=(1<<31-nn(42|t)+1)-1,p&=h&~(C&~k),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,Wv(u,p))}else p=it,p=_e(u,u===xt?p:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(p&3)===0||Be(u,p)||(s=!0,Wv(u,p));u=u.next}while(s);og=!1}}function rx(){Vv()}function Vv(){$u=sg=!1;var t=0;oi!==0&&gx()&&(t=oi);for(var n=Ut(),s=null,u=Mu;u!==null;){var h=u.next,p=Fv(u,n);p===0?(u.next=null,s===null?Mu=h:s.next=h,h===null&&(Ks=s)):(s=u,(t!==0||(p&3)!==0)&&($u=!0)),u=h}an!==0&&an!==5||Dl(t),oi!==0&&(oi=0)}function Fv(t,n){for(var s=t.suspendedLanes,u=t.pingedLanes,h=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var C=31-nn(p),k=1<<C,z=h[C];z===-1?((k&s)===0||(k&u)!==0)&&(h[C]=xe(k,n)):z<=n&&(t.expiredLanes|=k),p&=~k}if(n=xt,s=it,s=_e(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,s===0||t===n&&(vt===2||vt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&fn(u),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Be(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(u!==null&&fn(u),kt(s)){case 2:case 8:s=Ln;break;case 32:s=An;break;case 268435456:s=Mn;break;default:s=An}return u=Kv.bind(null,t),s=cn(s,u),t.callbackPriority=n,t.callbackNode=s,n}return u!==null&&u!==null&&fn(u),t.callbackPriority=2,t.callbackNode=null,2}function Kv(t,n){if(an!==0&&an!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Lu()&&t.callbackNode!==s)return null;var u=it;return u=_e(t,t===xt?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(kv(t,u,n),Fv(t,Ut()),t.callbackNode!=null&&t.callbackNode===s?Kv.bind(null,t):null)}function Wv(t,n){if(Lu())return null;kv(t,n,!0)}function ax(){mx(function(){(pt&6)!==0?cn(ra,rx):Vv()})}function lg(){if(oi===0){var t=Ls;t===0&&(t=X,X<<=1,(X&261888)===0&&(X=256)),oi=t}return oi}function Yv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:bs(""+t)}function Xv(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function ix(t,n,s,u,h){if(n==="submit"&&s&&s.stateNode===h){var p=Yv((h[gn]||null).action),C=u.submitter;C&&(n=(n=C[gn]||null)?Yv(n.formAction):C.getAttribute("formAction"),n!==null&&(p=n,C=null));var k=new ws("action","action",null,u,h);t.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(oi!==0){var z=C?Xv(h,C):new FormData(h);kh(s,{pending:!0,data:z,method:h.method,action:p},null,z)}}else typeof p=="function"&&(k.preventDefault(),z=C?Xv(h,C):new FormData(h),kh(s,{pending:!0,data:z,method:h.method,action:p},p,z))},currentTarget:h}]})}}for(var cg=0;cg<Vf.length;cg++){var ug=Vf[cg],sx=ug.toLowerCase(),ox=ug[0].toUpperCase()+ug.slice(1);Lr(sx,"on"+ox)}Lr(Ty,"onAnimationEnd"),Lr(ky,"onAnimationIteration"),Lr(Ry,"onAnimationStart"),Lr("dblclick","onDoubleClick"),Lr("focusin","onFocus"),Lr("focusout","onBlur"),Lr(EA,"onTransitionRun"),Lr(_A,"onTransitionStart"),Lr(AA,"onTransitionCancel"),Lr(Dy,"onTransitionEnd"),ja("onMouseEnter",["mouseout","mouseover"]),ja("onMouseLeave",["mouseout","mouseover"]),ja("onPointerEnter",["pointerout","pointerover"]),ja("onPointerLeave",["pointerout","pointerover"]),sa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),sa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),sa("onBeforeInput",["compositionend","keypress","textInput","paste"]),sa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ol="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(" "),lx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ol));function Jv(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var u=t[s],h=u.event;u=u.listeners;e:{var p=void 0;if(n)for(var C=u.length-1;0<=C;C--){var k=u[C],z=k.instance,Y=k.currentTarget;if(k=k.listener,z!==p&&h.isPropagationStopped())break e;p=k,h.currentTarget=Y;try{p(h)}catch(ne){Yc(ne)}h.currentTarget=null,p=z}else for(C=0;C<u.length;C++){if(k=u[C],z=k.instance,Y=k.currentTarget,k=k.listener,z!==p&&h.isPropagationStopped())break e;p=k,h.currentTarget=Y;try{p(h)}catch(ne){Yc(ne)}h.currentTarget=null,p=z}}}}function nt(t,n){var s=n[No];s===void 0&&(s=n[No]=new Set);var u=t+"__bubble";s.has(u)||(Qv(n,t,2,!1),s.add(u))}function dg(t,n,s){var u=0;n&&(u|=4),Qv(s,t,u,n)}var Nu="_reactListening"+Math.random().toString(36).slice(2);function fg(t){if(!t[Nu]){t[Nu]=!0,Mc.forEach(function(s){s!=="selectionchange"&&(lx.has(s)||dg(s,!1,t),dg(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Nu]||(n[Nu]=!0,dg("selectionchange",!1,n))}}function Qv(t,n,s,u){switch(TS(n)){case 2:var h=Ix;break;case 8:h=Hx;break;default:h=Tg}s=h.bind(null,n,s,t),h=void 0,!Vo||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),u?h!==void 0?t.addEventListener(n,s,{capture:!0,passive:h}):t.addEventListener(n,s,!0):h!==void 0?t.addEventListener(n,s,{passive:h}):t.addEventListener(n,s,!1)}function hg(t,n,s,u,h){var p=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var C=u.tag;if(C===3||C===4){var k=u.stateNode.containerInfo;if(k===h)break;if(C===4)for(C=u.return;C!==null;){var z=C.tag;if((z===3||z===4)&&C.stateNode.containerInfo===h)return;C=C.return}for(;k!==null;){if(C=Ia(k),C===null)return;if(z=C.tag,z===5||z===6||z===26||z===27){u=p=C;continue e}k=k.parentNode}}u=u.return}zc(function(){var Y=p,ne=vs(s),le=[];e:{var Q=Oy.get(t);if(Q!==void 0){var te=ws,Te=t;switch(t){case"keypress":if(qa(s)===0)break e;case"keydown":case"keyup":te=rn;break;case"focusin":Te="focus",te=Yo;break;case"focusout":Te="blur",te=Yo;break;case"beforeblur":case"afterblur":te=Yo;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=Bc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Tf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=b;break;case Ty:case ky:case Ry:te=Df;break;case Dy:te=D;break;case"scroll":case"scrollend":te=xf;break;case"wheel":te=ie;break;case"copy":case"cut":case"paste":te=Lf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=qc;break;case"toggle":case"beforetoggle":te=Oe}var He=(n&4)!==0,_t=!He&&(t==="scroll"||t==="scrollend"),F=He?Q!==null?Q+"Capture":null:Q;He=[];for(var P=Y,W;P!==null;){var se=P;if(W=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||W===null||F===null||(se=xi(P,F),se!=null&&He.push(Ll(P,se,W))),_t)break;P=P.return}0<He.length&&(Q=new te(Q,Te,null,s,ne),le.push({event:Q,listeners:He}))}}if((n&7)===0){e:{if(Q=t==="mouseover"||t==="pointerover",te=t==="mouseout"||t==="pointerout",Q&&s!==qo&&(Te=s.relatedTarget||s.fromElement)&&(Ia(Te)||Te[In]))break e;if((te||Q)&&(Q=ne.window===ne?ne:(Q=ne.ownerDocument)?Q.defaultView||Q.parentWindow:window,te?(Te=s.relatedTarget||s.toElement,te=Y,Te=Te?Ia(Te):null,Te!==null&&(_t=l(Te),He=Te.tag,Te!==_t||He!==5&&He!==27&&He!==6)&&(Te=null)):(te=null,Te=Y),te!==Te)){if(He=Bc,se="onMouseLeave",F="onMouseEnter",P="mouse",(t==="pointerout"||t==="pointerover")&&(He=qc,se="onPointerLeave",F="onPointerEnter",P="pointer"),_t=te==null?Q:_i(te),W=Te==null?Q:_i(Te),Q=new He(se,P+"leave",te,s,ne),Q.target=_t,Q.relatedTarget=W,se=null,Ia(ne)===Y&&(He=new He(F,P+"enter",Te,s,ne),He.target=W,He.relatedTarget=_t,se=He),_t=se,te&&Te)t:{for(He=cx,F=te,P=Te,W=0,se=F;se;se=He(se))W++;se=0;for(var Ie=P;Ie;Ie=He(Ie))se++;for(;0<W-se;)F=He(F),W--;for(;0<se-W;)P=He(P),se--;for(;W--;){if(F===P||P!==null&&F===P.alternate){He=F;break t}F=He(F),P=He(P)}He=null}else He=null;te!==null&&Zv(le,Q,te,He,!1),Te!==null&&_t!==null&&Zv(le,_t,Te,He,!0)}}e:{if(Q=Y?_i(Y):window,te=Q.nodeName&&Q.nodeName.toLowerCase(),te==="select"||te==="input"&&Q.type==="file")var ft=Kc;else if(el(Q))if(Wc)ft=SA;else{ft=bA;var Le=yA}else te=Q.nodeName,!te||te.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?Y&&Po(Y.elementType)&&(ft=Kc):ft=vA;if(ft&&(ft=ft(t,Y))){tl(le,ft,s,ne);break e}Le&&Le(t,Q,Y),t==="focusout"&&Y&&Q.type==="number"&&Y.memoizedProps.value!=null&&Bo(Q,"number",Q.value)}switch(Le=Y?_i(Y):window,t){case"focusin":(el(Le)||Le.contentEditable==="true")&&(_s=Le,Pf=Y,ol=null);break;case"focusout":ol=Pf=_s=null;break;case"mousedown":qf=!0;break;case"contextmenu":case"mouseup":case"dragend":qf=!1,Ay(le,s,ne);break;case"selectionchange":if(CA)break;case"keydown":case"keyup":Ay(le,s,ne)}var Je;if(at)e:{switch(t){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Ga?Vc(t,s)&&(st="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(st="onCompositionStart");st&&(Ri&&s.locale!=="ko"&&(Ga||st!=="onCompositionStart"?st==="onCompositionEnd"&&Ga&&(Je=Ve()):(Or=ne,Fo="value"in Or?Or.value:Or.textContent,Ga=!0)),Le=Iu(Y,st),0<Le.length&&(st=new Pc(st,t,null,s,ne),le.push({event:st,listeners:Le}),Je?st.data=Je:(Je=Zo(s),Je!==null&&(st.data=Je)))),(Je=Bt?Fc(t,s):zf(t,s))&&(st=Iu(Y,"onBeforeInput"),0<st.length&&(Le=new Pc("onBeforeInput","beforeinput",null,s,ne),le.push({event:Le,listeners:st}),Le.data=Je)),ix(le,t,Y,s,ne)}Jv(le,n)})}function Ll(t,n,s){return{instance:t,listener:n,currentTarget:s}}function Iu(t,n){for(var s=n+"Capture",u=[];t!==null;){var h=t,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=xi(t,s),h!=null&&u.unshift(Ll(t,h,p)),h=xi(t,n),h!=null&&u.push(Ll(t,h,p))),t.tag===3)return u;t=t.return}return[]}function cx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Zv(t,n,s,u,h){for(var p=n._reactName,C=[];s!==null&&s!==u;){var k=s,z=k.alternate,Y=k.stateNode;if(k=k.tag,z!==null&&z===u)break;k!==5&&k!==26&&k!==27||Y===null||(z=Y,h?(Y=xi(s,p),Y!=null&&C.unshift(Ll(s,Y,z))):h||(Y=xi(s,p),Y!=null&&C.push(Ll(s,Y,z)))),s=s.return}C.length!==0&&t.push({event:n,listeners:C})}var ux=/\r\n?/g,dx=/\u0000|\uFFFD/g;function eS(t){return(typeof t=="string"?t:""+t).replace(ux,`
`).replace(dx,"")}function tS(t,n){return n=eS(n),eS(t)===n}function Et(t,n,s,u,h,p){switch(s){case"children":typeof u=="string"?n==="body"||n==="textarea"&&u===""||Ua(t,u):(typeof u=="number"||typeof u=="bigint")&&n!=="body"&&Ua(t,""+u);break;case"className":ps(t,"class",u);break;case"tabIndex":ps(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ps(t,s,u);break;case"style":Vr(t,u,p);break;case"data":if(n!=="object"){ps(t,"data",u);break}case"src":case"href":if(u===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=bs(""+u),t.setAttribute(s,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(s,"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 p=="function"&&(s==="formAction"?(n!=="input"&&Et(t,n,"name",h.name,h,null),Et(t,n,"formEncType",h.formEncType,h,null),Et(t,n,"formMethod",h.formMethod,h,null),Et(t,n,"formTarget",h.formTarget,h,null)):(Et(t,n,"encType",h.encType,h,null),Et(t,n,"method",h.method,h,null),Et(t,n,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=bs(""+u),t.setAttribute(s,u);break;case"onClick":u!=null&&(t.onclick=or);break;case"onScroll":u!=null&&nt("scroll",t);break;case"onScrollEnd":u!=null&&nt("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(s=u.__html,s!=null){if(h.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}s=bs(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""+u):t.removeAttribute(s);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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":u===!0?t.setAttribute(s,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,u):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(s,u):t.removeAttribute(s);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(s):t.setAttribute(s,u);break;case"popover":nt("beforetoggle",t),nt("toggle",t),gs(t,"popover",u);break;case"xlinkActuate":Rr(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Rr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Rr(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Rr(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Rr(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Rr(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Rr(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Rr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Rr(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":gs(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=_f.get(s)||s,gs(t,s,u))}}function gg(t,n,s,u,h,p){switch(s){case"style":Vr(t,u,p);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(s=u.__html,s!=null){if(h.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof u=="string"?Ua(t,u):(typeof u=="number"||typeof u=="bigint")&&Ua(t,""+u);break;case"onScroll":u!=null&&nt("scroll",t);break;case"onScrollEnd":u!=null&&nt("scrollend",t);break;case"onClick":u!=null&&(t.onclick=or);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$c.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(h=s.endsWith("Capture"),n=s.slice(2,h?s.length-7:void 0),p=t[gn]||null,p=p!=null?p[s]:null,typeof p=="function"&&t.removeEventListener(n,p,h),typeof u=="function")){typeof p!="function"&&p!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,u,h);break e}s in t?t[s]=u:u===!0?t.setAttribute(s,""):gs(t,s,u)}}}function bn(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",t),nt("load",t);var u=!1,h=!1,p;for(p in s)if(s.hasOwnProperty(p)){var C=s[p];if(C!=null)switch(p){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Et(t,n,p,C,s,null)}}h&&Et(t,n,"srcSet",s.srcSet,s,null),u&&Et(t,n,"src",s.src,s,null);return;case"input":nt("invalid",t);var k=p=C=h=null,z=null,Y=null;for(u in s)if(s.hasOwnProperty(u)){var ne=s[u];if(ne!=null)switch(u){case"name":h=ne;break;case"type":C=ne;break;case"checked":z=ne;break;case"defaultChecked":Y=ne;break;case"value":p=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,n));break;default:Et(t,n,u,ne,s,null)}}Nc(t,p,k,z,Y,C,h,!1);return;case"select":nt("invalid",t),u=C=p=null;for(h in s)if(s.hasOwnProperty(h)&&(k=s[h],k!=null))switch(h){case"value":p=k;break;case"defaultValue":C=k;break;case"multiple":u=k;default:Et(t,n,h,k,s,null)}n=p,s=C,t.multiple=!!u,n!=null?za(t,!!u,n,!1):s!=null&&za(t,!!u,s,!0);return;case"textarea":nt("invalid",t),p=h=u=null;for(C in s)if(s.hasOwnProperty(C)&&(k=s[C],k!=null))switch(C){case"value":u=k;break;case"defaultValue":h=k;break;case"children":p=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:Et(t,n,C,k,s,null)}Hc(t,u,h,p);return;case"option":for(z in s)if(s.hasOwnProperty(z)&&(u=s[z],u!=null))switch(z){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Et(t,n,z,u,s,null)}return;case"dialog":nt("beforetoggle",t),nt("toggle",t),nt("cancel",t),nt("close",t);break;case"iframe":case"object":nt("load",t);break;case"video":case"audio":for(u=0;u<Ol.length;u++)nt(Ol[u],t);break;case"image":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"embed":case"source":case"link":nt("error",t),nt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in s)if(s.hasOwnProperty(Y)&&(u=s[Y],u!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Et(t,n,Y,u,s,null)}return;default:if(Po(n)){for(ne in s)s.hasOwnProperty(ne)&&(u=s[ne],u!==void 0&&gg(t,n,ne,u,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(u=s[k],u!=null&&Et(t,n,k,u,s,null))}function fx(t,n,s,u){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,C=null,k=null,z=null,Y=null,ne=null;for(te in s){var le=s[te];if(s.hasOwnProperty(te)&&le!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":z=le;default:u.hasOwnProperty(te)||Et(t,n,te,null,u,le)}}for(var Q in u){var te=u[Q];if(le=s[Q],u.hasOwnProperty(Q)&&(te!=null||le!=null))switch(Q){case"type":p=te;break;case"name":h=te;break;case"checked":Y=te;break;case"defaultChecked":ne=te;break;case"value":C=te;break;case"defaultValue":k=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,n));break;default:te!==le&&Et(t,n,Q,te,u,le)}}la(t,C,k,z,Y,ne,p,h);return;case"select":te=C=k=Q=null;for(p in s)if(z=s[p],s.hasOwnProperty(p)&&z!=null)switch(p){case"value":break;case"multiple":te=z;default:u.hasOwnProperty(p)||Et(t,n,p,null,u,z)}for(h in u)if(p=u[h],z=s[h],u.hasOwnProperty(h)&&(p!=null||z!=null))switch(h){case"value":Q=p;break;case"defaultValue":k=p;break;case"multiple":C=p;default:p!==z&&Et(t,n,h,p,u,z)}n=k,s=C,u=te,Q!=null?za(t,!!s,Q,!1):!!u!=!!s&&(n!=null?za(t,!!s,n,!0):za(t,!!s,s?[]:"",!1));return;case"textarea":te=Q=null;for(k in s)if(h=s[k],s.hasOwnProperty(k)&&h!=null&&!u.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Et(t,n,k,null,u,h)}for(C in u)if(h=u[C],p=s[C],u.hasOwnProperty(C)&&(h!=null||p!=null))switch(C){case"value":Q=h;break;case"defaultValue":te=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==p&&Et(t,n,C,h,u,p)}Ic(t,Q,te);return;case"option":for(var Te in s)if(Q=s[Te],s.hasOwnProperty(Te)&&Q!=null&&!u.hasOwnProperty(Te))switch(Te){case"selected":t.selected=!1;break;default:Et(t,n,Te,null,u,Q)}for(z in u)if(Q=u[z],te=s[z],u.hasOwnProperty(z)&&Q!==te&&(Q!=null||te!=null))switch(z){case"selected":t.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:Et(t,n,z,Q,u,te)}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 He in s)Q=s[He],s.hasOwnProperty(He)&&Q!=null&&!u.hasOwnProperty(He)&&Et(t,n,He,null,u,Q);for(Y in u)if(Q=u[Y],te=s[Y],u.hasOwnProperty(Y)&&Q!==te&&(Q!=null||te!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,n));break;default:Et(t,n,Y,Q,u,te)}return;default:if(Po(n)){for(var _t in s)Q=s[_t],s.hasOwnProperty(_t)&&Q!==void 0&&!u.hasOwnProperty(_t)&&gg(t,n,_t,void 0,u,Q);for(ne in u)Q=u[ne],te=s[ne],!u.hasOwnProperty(ne)||Q===te||Q===void 0&&te===void 0||gg(t,n,ne,Q,u,te);return}}for(var F in s)Q=s[F],s.hasOwnProperty(F)&&Q!=null&&!u.hasOwnProperty(F)&&Et(t,n,F,null,u,Q);for(le in u)Q=u[le],te=s[le],!u.hasOwnProperty(le)||Q===te||Q==null&&te==null||Et(t,n,le,Q,u,te)}function nS(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),u=0;u<s.length;u++){var h=s[u],p=h.transferSize,C=h.initiatorType,k=h.duration;if(p&&k&&nS(C)){for(C=0,k=h.responseEnd,u+=1;u<s.length;u++){var z=s[u],Y=z.startTime;if(Y>k)break;var ne=z.transferSize,le=z.initiatorType;ne&&nS(le)&&(z=z.responseEnd,C+=ne*(z<k?1:(k-Y)/(z-Y)))}if(--u,n+=8*(p+C)/(h.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var pg=null,mg=null;function Hu(t){return t.nodeType===9?t:t.ownerDocument}function rS(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function aS(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function yg(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var bg=null;function gx(){var t=window.event;return t&&t.type==="popstate"?t===bg?!1:(bg=t,!0):(bg=null,!1)}var iS=typeof setTimeout=="function"?setTimeout:void 0,px=typeof clearTimeout=="function"?clearTimeout:void 0,sS=typeof Promise=="function"?Promise:void 0,mx=typeof queueMicrotask=="function"?queueMicrotask:typeof sS<"u"?function(t){return sS.resolve(null).then(t).catch(yx)}:iS;function yx(t){setTimeout(function(){throw t})}function li(t){return t==="head"}function oS(t,n){var s=n,u=0;do{var h=s.nextSibling;if(t.removeChild(s),h&&h.nodeType===8)if(s=h.data,s==="/$"||s==="/&"){if(u===0){t.removeChild(h),Js(n);return}u--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")u++;else if(s==="html")Ml(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Ml(s);for(var p=s.firstChild;p;){var C=p.nextSibling,k=p.nodeName;p[ia]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&p.rel.toLowerCase()==="stylesheet"||s.removeChild(p),p=C}}else s==="body"&&Ml(t.ownerDocument.body);s=h}while(s);Js(n)}function lS(t,n){var s=t;t=0;do{var u=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),u&&u.nodeType===8)if(s=u.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=u}while(s)}function vg(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":vg(s),Io(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function bx(t,n,s,u){for(;t.nodeType===1;){var h=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[ia])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(p=t.getAttribute("rel"),p==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(p!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(p=t.getAttribute("src"),(p!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===p)return t}else return t;if(t=gr(t.nextSibling),t===null)break}return null}function vx(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=gr(t.nextSibling),t===null))return null;return t}function cS(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=gr(t.nextSibling),t===null))return null;return t}function Sg(t){return t.data==="$?"||t.data==="$~"}function wg(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Sx(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var u=function(){n(),s.removeEventListener("DOMContentLoaded",u)};s.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function gr(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Cg=null;function uS(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return gr(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function dS(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function fS(t,n,s){switch(n=Hu(s),t){case"html":if(t=n.documentElement,!t)throw Error(a(452));return t;case"head":if(t=n.head,!t)throw Error(a(453));return t;case"body":if(t=n.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function Ml(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Io(t)}var pr=new Map,hS=new Set;function ju(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Aa=he.d;he.d={f:wx,r:Cx,D:Ex,C:_x,L:Ax,m:xx,X:kx,S:Tx,M:Rx};function wx(){var t=Aa.f(),n=Ru();return t||n}function Cx(t){var n=Ha(t);n!==null&&n.tag===5&&n.type==="form"?Db(n):Aa.r(t)}var Ws=typeof document>"u"?null:document;function gS(t,n,s){var u=Ws;if(u&&typeof n=="string"&&n){var h=jn(n);h='link[rel="'+t+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),hS.has(h)||(hS.add(h),t={rel:t,crossOrigin:s,href:n},u.querySelector(h)===null&&(n=u.createElement("link"),bn(n,"link",t),Xt(n),u.head.appendChild(n)))}}function Ex(t){Aa.D(t),gS("dns-prefetch",t,null)}function _x(t,n){Aa.C(t,n),gS("preconnect",t,n)}function Ax(t,n,s){Aa.L(t,n,s);var u=Ws;if(u&&t&&n){var h='link[rel="preload"][as="'+jn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+jn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+jn(s.imageSizes)+'"]')):h+='[href="'+jn(t)+'"]';var p=h;switch(n){case"style":p=Ys(t);break;case"script":p=Xs(t)}pr.has(p)||(t=y({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),pr.set(p,t),u.querySelector(h)!==null||n==="style"&&u.querySelector($l(p))||n==="script"&&u.querySelector(Nl(p))||(n=u.createElement("link"),bn(n,"link",t),Xt(n),u.head.appendChild(n)))}}function xx(t,n){Aa.m(t,n);var s=Ws;if(s&&t){var u=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+jn(u)+'"][href="'+jn(t)+'"]',p=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Xs(t)}if(!pr.has(p)&&(t=y({rel:"modulepreload",href:t},n),pr.set(p,t),s.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Nl(p)))return}u=s.createElement("link"),bn(u,"link",t),Xt(u),s.head.appendChild(u)}}}function Tx(t,n,s){Aa.S(t,n,s);var u=Ws;if(u&&t){var h=qr(u).hoistableStyles,p=Ys(t);n=n||"default";var C=h.get(p);if(!C){var k={loading:0,preload:null};if(C=u.querySelector($l(p)))k.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":n},s),(s=pr.get(p))&&Eg(t,s);var z=C=u.createElement("link");Xt(z),bn(z,"link",t),z._p=new Promise(function(Y,ne){z.onload=Y,z.onerror=ne}),z.addEventListener("load",function(){k.loading|=1}),z.addEventListener("error",function(){k.loading|=2}),k.loading|=4,zu(C,n,u)}C={type:"stylesheet",instance:C,count:1,state:k},h.set(p,C)}}}function kx(t,n){Aa.X(t,n);var s=Ws;if(s&&t){var u=qr(s).hoistableScripts,h=Xs(t),p=u.get(h);p||(p=s.querySelector(Nl(h)),p||(t=y({src:t,async:!0},n),(n=pr.get(h))&&_g(t,n),p=s.createElement("script"),Xt(p),bn(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(h,p))}}function Rx(t,n){Aa.M(t,n);var s=Ws;if(s&&t){var u=qr(s).hoistableScripts,h=Xs(t),p=u.get(h);p||(p=s.querySelector(Nl(h)),p||(t=y({src:t,async:!0,type:"module"},n),(n=pr.get(h))&&_g(t,n),p=s.createElement("script"),Xt(p),bn(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(h,p))}}function pS(t,n,s,u){var h=(h=ae.current)?ju(h):null;if(!h)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=Ys(s.href),s=qr(h).hoistableStyles,u=s.get(n),u||(u={type:"style",instance:null,count:0,state:null},s.set(n,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Ys(s.href);var p=qr(h).hoistableStyles,C=p.get(t);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,C),(p=h.querySelector($l(t)))&&!p._p&&(C.instance=p,C.state.loading=5),pr.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},pr.set(t,s),p||Dx(h,t,s,C.state))),n&&u===null)throw Error(a(528,""));return C}if(n&&u!==null)throw Error(a(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Xs(s),s=qr(h).hoistableScripts,u=s.get(n),u||(u={type:"script",instance:null,count:0,state:null},s.set(n,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Ys(t){return'href="'+jn(t)+'"'}function $l(t){return'link[rel="stylesheet"]['+t+"]"}function mS(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function Dx(t,n,s,u){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?u.loading=1:(n=t.createElement("link"),u.preload=n,n.addEventListener("load",function(){return u.loading|=1}),n.addEventListener("error",function(){return u.loading|=2}),bn(n,"link",s),Xt(n),t.head.appendChild(n))}function Xs(t){return'[src="'+jn(t)+'"]'}function Nl(t){return"script[async]"+t}function yS(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var u=t.querySelector('style[data-href~="'+jn(s.href)+'"]');if(u)return n.instance=u,Xt(u),u;var h=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),Xt(u),bn(u,"style",h),zu(u,s.precedence,t),n.instance=u;case"stylesheet":h=Ys(s.href);var p=t.querySelector($l(h));if(p)return n.state.loading|=4,n.instance=p,Xt(p),p;u=mS(s),(h=pr.get(h))&&Eg(u,h),p=(t.ownerDocument||t).createElement("link"),Xt(p);var C=p;return C._p=new Promise(function(k,z){C.onload=k,C.onerror=z}),bn(p,"link",u),n.state.loading|=4,zu(p,s.precedence,t),n.instance=p;case"script":return p=Xs(s.src),(h=t.querySelector(Nl(p)))?(n.instance=h,Xt(h),h):(u=s,(h=pr.get(p))&&(u=y({},s),_g(u,h)),t=t.ownerDocument||t,h=t.createElement("script"),Xt(h),bn(h,"link",u),t.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(u=n.instance,n.state.loading|=4,zu(u,s.precedence,t));return n.instance}function zu(t,n,s){for(var u=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,p=h,C=0;C<u.length;C++){var k=u[C];if(k.dataset.precedence===n)p=k;else if(p!==h)break}p?p.parentNode.insertBefore(t,p.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function Eg(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function _g(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Uu=null;function bS(t,n,s){if(Uu===null){var u=new Map,h=Uu=new Map;h.set(s,u)}else h=Uu,u=h.get(s),u||(u=new Map,h.set(s,u));if(u.has(t))return u;for(u.set(t,null),s=s.getElementsByTagName(t),h=0;h<s.length;h++){var p=s[h];if(!(p[ia]||p[Nt]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var C=p.getAttribute(n)||"";C=t+C;var k=u.get(C);k?k.push(p):u.set(C,[p])}}return u}function vS(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function Ox(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function SS(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Lx(t,n,s,u){if(s.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=Ys(u.href),p=n.querySelector($l(h));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Bu.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=p,Xt(p);return}p=n.ownerDocument||n,u=mS(u),(h=pr.get(h))&&Eg(u,h),p=p.createElement("link"),Xt(p);var C=p;C._p=new Promise(function(k,z){C.onload=k,C.onerror=z}),bn(p,"link",u),s.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Bu.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var Ag=0;function Mx(t,n){return t.stylesheets&&t.count===0&&qu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var u=setTimeout(function(){if(t.stylesheets&&qu(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+n);0<t.imgBytes&&Ag===0&&(Ag=62500*hx());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&qu(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>Ag?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function Bu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Pu=null;function qu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Pu=new Map,n.forEach($x,t),Pu=null,Bu.call(t))}function $x(t,n){if(!(n.state.loading&4)){var s=Pu.get(t);if(s)var u=s.get(null);else{s=new Map,Pu.set(t,s);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var C=h[p];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(s.set(C.dataset.precedence,C),u=C)}u&&s.set(null,u)}h=n.instance,C=h.getAttribute("data-precedence"),p=s.get(C)||u,p===u&&s.set(null,h),s.set(C,h),this.count++,u=Bu.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),p?p.parentNode.insertBefore(h,p.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),n.state.loading|=4}}var Il={$$typeof:O,Provider:null,Consumer:null,_currentValue:Ee,_currentValue2:Ee,_threadCount:0};function Nx(t,n,s,u,h,p,C,k,z){this.tag=1,this.containerInfo=t,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=Ae(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ae(0),this.hiddenUpdates=Ae(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function wS(t,n,s,u,h,p,C,k,z,Y,ne,le){return t=new Nx(t,n,s,C,z,Y,ne,le,k),n=1,p===!0&&(n|=24),p=Xn(3,null,null,n),t.current=p,p.stateNode=t,n=ah(),n.refCount++,t.pooledCache=n,n.refCount++,p.memoizedState={element:u,isDehydrated:s,cache:n},lh(p),t}function CS(t){return t?(t=Ts,t):Ts}function ES(t,n,s,u,h,p){h=CS(h),u.context===null?u.context=h:u.pendingContext=h,u=Ja(n),u.payload={element:s},p=p===void 0?null:p,p!==null&&(u.callback=p),s=Qa(t,u,n),s!==null&&(qn(s,t,n),gl(s,t,n))}function _S(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function xg(t,n){_S(t,n),(t=t.alternate)&&_S(t,n)}function AS(t){if(t.tag===13||t.tag===31){var n=Mi(t,67108864);n!==null&&qn(n,t,67108864),xg(t,67108864)}}function xS(t){if(t.tag===13||t.tag===31){var n=tr();n=Ze(n);var s=Mi(t,n);s!==null&&qn(s,t,n),xg(t,n)}}var Gu=!0;function Ix(t,n,s,u){var h=J.T;J.T=null;var p=he.p;try{he.p=2,Tg(t,n,s,u)}finally{he.p=p,J.T=h}}function Hx(t,n,s,u){var h=J.T;J.T=null;var p=he.p;try{he.p=8,Tg(t,n,s,u)}finally{he.p=p,J.T=h}}function Tg(t,n,s,u){if(Gu){var h=kg(u);if(h===null)hg(t,n,u,Vu,s),kS(t,u);else if(zx(h,t,n,s,u))u.stopPropagation();else if(kS(t,u),n&4&&-1<jx.indexOf(t)){for(;h!==null;){var p=Ha(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var C=we(p.pendingLanes);if(C!==0){var k=p;for(k.pendingLanes|=2,k.entangledLanes|=2;C;){var z=1<<31-nn(C);k.entanglements[1]|=z,C&=~z}Xr(p),(pt&6)===0&&(Tu=Ut()+500,Dl(0))}}break;case 31:case 13:k=Mi(p,2),k!==null&&qn(k,p,2),Ru(),xg(p,2)}if(p=kg(u),p===null&&hg(t,n,u,Vu,s),p===h)break;h=p}h!==null&&u.stopPropagation()}else hg(t,n,u,null,s)}}function kg(t){return t=vs(t),Rg(t)}var Vu=null;function Rg(t){if(Vu=null,t=Ia(t),t!==null){var n=l(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=c(n),t!==null)return t;t=null}else if(s===31){if(t=d(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Vu=t,null}function TS(t){switch(t){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(bt()){case ra:return 2;case Ln:return 8;case An:case xn:return 32;case Mn:return 268435456;default:return 32}default:return 32}}var Dg=!1,ci=null,ui=null,di=null,Hl=new Map,jl=new Map,fi=[],jx="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 kS(t,n){switch(t){case"focusin":case"focusout":ci=null;break;case"dragenter":case"dragleave":ui=null;break;case"mouseover":case"mouseout":di=null;break;case"pointerover":case"pointerout":Hl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":jl.delete(n.pointerId)}}function zl(t,n,s,u,h,p){return t===null||t.nativeEvent!==p?(t={blockedOn:n,domEventName:s,eventSystemFlags:u,nativeEvent:p,targetContainers:[h]},n!==null&&(n=Ha(n),n!==null&&AS(n)),t):(t.eventSystemFlags|=u,n=t.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),t)}function zx(t,n,s,u,h){switch(n){case"focusin":return ci=zl(ci,t,n,s,u,h),!0;case"dragenter":return ui=zl(ui,t,n,s,u,h),!0;case"mouseover":return di=zl(di,t,n,s,u,h),!0;case"pointerover":var p=h.pointerId;return Hl.set(p,zl(Hl.get(p)||null,t,n,s,u,h)),!0;case"gotpointercapture":return p=h.pointerId,jl.set(p,zl(jl.get(p)||null,t,n,s,u,h)),!0}return!1}function RS(t){var n=Ia(t.target);if(n!==null){var s=l(n);if(s!==null){if(n=s.tag,n===13){if(n=c(s),n!==null){t.blockedOn=n,Nn(t.priority,function(){xS(s)});return}}else if(n===31){if(n=d(s),n!==null){t.blockedOn=n,Nn(t.priority,function(){xS(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Fu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=kg(t.nativeEvent);if(s===null){s=t.nativeEvent;var u=new s.constructor(s.type,s);qo=u,s.target.dispatchEvent(u),qo=null}else return n=Ha(s),n!==null&&AS(n),t.blockedOn=s,!1;n.shift()}return!0}function DS(t,n,s){Fu(t)&&s.delete(n)}function Ux(){Dg=!1,ci!==null&&Fu(ci)&&(ci=null),ui!==null&&Fu(ui)&&(ui=null),di!==null&&Fu(di)&&(di=null),Hl.forEach(DS),jl.forEach(DS)}function Ku(t,n){t.blockedOn===n&&(t.blockedOn=null,Dg||(Dg=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Ux)))}var Wu=null;function OS(t){Wu!==t&&(Wu=t,o.unstable_scheduleCallback(o.unstable_NormalPriority,function(){Wu===t&&(Wu=null);for(var n=0;n<t.length;n+=3){var s=t[n],u=t[n+1],h=t[n+2];if(typeof u!="function"){if(Rg(u||s)===null)continue;break}var p=Ha(s);p!==null&&(t.splice(n,3),n-=3,kh(p,{pending:!0,data:h,method:s.method,action:u},u,h))}}))}function Js(t){function n(z){return Ku(z,t)}ci!==null&&Ku(ci,t),ui!==null&&Ku(ui,t),di!==null&&Ku(di,t),Hl.forEach(n),jl.forEach(n);for(var s=0;s<fi.length;s++){var u=fi[s];u.blockedOn===t&&(u.blockedOn=null)}for(;0<fi.length&&(s=fi[0],s.blockedOn===null);)RS(s),s.blockedOn===null&&fi.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(u=0;u<s.length;u+=3){var h=s[u],p=s[u+1],C=h[gn]||null;if(typeof p=="function")C||OS(s);else if(C){var k=null;if(p&&p.hasAttribute("formAction")){if(h=p,C=p[gn]||null)k=C.formAction;else if(Rg(h)!==null)continue}else k=C.action;typeof k=="function"?s[u+1]=k:(s.splice(u,3),u-=3),OS(s)}}}function LS(){function t(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(C){return h=C})},focusReset:"manual",scroll:"manual"})}function n(){h!==null&&(h(),h=null),u||setTimeout(s,20)}function s(){if(!u&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),h!==null&&(h(),h=null)}}}function Og(t){this._internalRoot=t}Yu.prototype.render=Og.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(a(409));var s=n.current,u=tr();ES(s,u,t,n,null,null)},Yu.prototype.unmount=Og.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;ES(t.current,2,null,t,null,null),Ru(),n[In]=null}};function Yu(t){this._internalRoot=t}Yu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Ot();t={blockedOn:null,target:t,priority:n};for(var s=0;s<fi.length&&n!==0&&n<fi[s].priority;s++);fi.splice(s,0,t),s===0&&RS(t)}};var MS=e.version;if(MS!=="19.2.0")throw Error(a(527,MS,"19.2.0"));he.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=g(n),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var Bx={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xu.isDisabled&&Xu.supportsFiber)try{$n=Xu.inject(Bx),Vt=Xu}catch{}}return Qs.createRoot=function(t,n){if(!i(t))throw Error(a(299));var s=!1,u="",h=Ub,p=Bb,C=Pb;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(C=n.onRecoverableError)),n=wS(t,1,!1,null,null,s,u,null,h,p,C,LS),t[In]=n.current,fg(t),new Og(n)},Qs.hydrateRoot=function(t,n,s){if(!i(t))throw Error(a(299));var u=!1,h="",p=Ub,C=Bb,k=Pb,z=null;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(C=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(z=s.formState)),n=wS(t,1,!0,n,s??null,u,h,z,p,C,k,LS),n.context=CS(null),s=n.current,u=tr(),u=Ze(u),h=Ja(u),h.callback=null,Qa(s,h,u),s=u,n.current.lanes=s,et(n,s),Xr(n),t[In]=n.current,fg(t),new Yu(n)},Qs.version="19.2.0",Qs}var Ug;function BS(){if(Ug)return Zu.exports;Ug=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(e){console.error(e)}}return o(),Zu.exports=US(),Zu.exports}var rd=BS();const ad=Qr(rd),Zs=[],PS=50;let id=!1;function Bg(){try{return window.G7Core?.devTools}catch{return}}function Fi(o,e,r){const a=Bg();if(id&&a?.isEnabled?.()){a.trackLog?.(o,e,r);return}id||(o==="error"||o==="warn")&&Zs.length<PS&&Zs.push({level:o,prefix:e,args:r,timestamp:Date.now()})}function sd(){id=!0;const o=Bg();if(!o?.isEnabled?.()){Zs.length=0;return}for(const e of Zs)o.trackLog?.(e.level,e.prefix,e.args);Zs.length=0}const wi=class wi{constructor(){$(this,"debug");$(this,"prefix","[TemplateEngine]");this.debug=!1}static getInstance(){return wi.instance||(wi.instance=new wi),wi.instance}setDebug(e){this.debug=e}isDebugEnabled(){return this.debug}log(...e){this.debug&&console.log(this.prefix,...e),Fi("log","TemplateEngine",e)}error(...e){this.debug&&console.error(this.prefix,...e),Fi("error","TemplateEngine",e)}warn(...e){this.debug&&console.warn(this.prefix,...e),Fi("warn","TemplateEngine",e)}};$(wi,"instance");let eo=wi;function ut(o){const e=`[${o}]`,r=eo.getInstance();return{log:(...a)=>{r.isDebugEnabled()&&console.log(e,...a),Fi("log",o,a)},warn:(...a)=>{r.isDebugEnabled()&&console.warn(e,...a),Fi("warn",o,a)},error:(...a)=>{r.isDebugEnabled()&&console.error(e,...a),Fi("error",o,a)}}}eo.getInstance();const Ki=ut("networkResilience"),Pg=2,qg=300,Gg=2e3,qS=15e3;function od(o){return o?.name==="AbortError"}function Vg(o){return od(o)?!1:o instanceof TypeError}let Ul=!1,Fg=!1;function ld(){return Ul}function GS(){typeof window>"u"||Fg||(Fg=!0,window.addEventListener("pagehide",()=>{Ul=!0}),window.addEventListener("pageshow",o=>{o.persisted&&(Ul=!1)}),window.addEventListener("beforeunload",()=>{Ul=!0}))}function Kg(o,e,r){const a=Math.min(e*Math.pow(2,o),r),i=a*.25*(Math.random()*2-1);return Math.max(0,Math.round(a+i))}function Wg(o){return new Promise(e=>setTimeout(e,o))}async function Bl(o,e={}){const{retries:r=Pg,baseDelayMs:a=qg,maxDelayMs:i=Gg,timeoutMs:l=qS,label:c=o,init:d}=e,f=r+1;let g;for(let m=0;m<f;m++){let y=!1,w;const S=l>0?new AbortController:null;try{const v={...d};if(S){const x=d?.signal;x&&(x.aborted?S.abort():x.addEventListener("abort",()=>S.abort(),{once:!0})),v.signal=S.signal,w=setTimeout(()=>{y=!0,S.abort()},l)}return await fetch(o,v)}catch(v){if(g=v,od(v)&&!y||!(y||Vg(v)))throw v;if(ld())throw Ki.warn(`Document unloading, aborting retries: ${c}`),v;if(m===f-1)throw Ki.warn(`All ${f} attempts failed: ${c}`,v),v;const R=Kg(m,a,i);Ki.warn(`Network failure (attempt ${m+1}/${f}), retrying in ${R}ms: ${c}`),await Wg(R)}finally{w!==void 0&&clearTimeout(w)}}throw g}async function Yg(o,e={},r={}){const{retries:a=Pg,baseDelayMs:i=qg,maxDelayMs:l=Gg,label:c=o}=r,d=a+1;for(let f=0;f<d;f++)try{await VS(o,e);return}catch(g){if(e.id&&document.getElementById(e.id)?.remove(),ld())throw Ki.warn(`Document unloading, aborting script retries: ${c}`),g;if(f===d-1)throw Ki.warn(`All ${d} script attempts failed: ${c}`),g;const y=Kg(f,i,l);Ki.warn(`Script load failed (attempt ${f+1}/${d}), retrying in ${y}ms: ${c}`),await Wg(y)}}function VS(o,e){return new Promise((r,a)=>{const i=document.createElement("script");i.src=o,i.async=!1;for(const[l,c]of Object.entries(e))l==="id"?i.id=c:i.setAttribute(l,c);i.onload=()=>r(),i.onerror=()=>a(new Error(`Failed to load script: ${o}`)),document.head.appendChild(i)})}const Xg="extension",Wi="extensionless",FS="file";function KS(){const o=globalThis?.G7Config;if(globalThis?.__g7AssetUrlMode===Wi)return Wi;const r=o?.assetUrlMode;return r===Wi||r===Xg?r:o?.settings?.general?.asset_url_mode===Wi?Wi:Xg}function Jg(){return KS()===Wi}function Nr(o,e,r,a){const i=o.replace(/\/+$/,""),l=e.replace(/^\.+/,""),c=Jg()?i:`${i}.${l}`,d=[];return a&&d.push(a.replace(/^[?&]+/,"")),r!=null&&r!==""&&d.push(`v=${r}`),d.length>0?`${c}?${d.join("&")}`:c}function xa(o){if(!o||!Jg())return o;const e=globalThis?.location?.origin,r=e&&o.startsWith(e)?o.slice(e.length):o;if(!r.startsWith("/api/"))return o;const[a,i]=WS(r),l=a.match(/^\/api\/(modules|plugins)\/bundle\.(js|css)$/);if(l)return Qg(`/api/${l[1]}/bundle/${l[2]}`,i);const c=a.match(/^\/api\/(templates|modules|plugins)\/assets\/([^/]+)\/(.+)$/);if(c){const[,f,g,m]=c,y=`${FS}=${encodeURIComponent(decodeURIComponent(m))}`;return`/api/${f}/assets/${g}?${y}${i?`&${i}`:""}`}const d=a.match(/^(\/api\/.+)\.(json|js|css)$/);return d?Qg(d[1],i):o}function WS(o){const e=o.indexOf("?");return e===-1?[o,""]:[o.slice(0,e),o.slice(e+1)]}function Qg(o,e){return e?`${o}?${e}`:o}const Ir=ut("ComponentRegistry");class sn extends Error{constructor(e,r,a){super(e),this.code=r,this.details=a,this.name="ComponentRegistryError"}}const Kn=class Kn{constructor(){$(this,"registry",{});$(this,"manifest",null);$(this,"loadingState","idle");$(this,"error",null);$(this,"templateId",null);$(this,"templateType",null)}static getInstance(){return Kn.instance||(Kn.instance=new Kn),Kn.instance}static createIsolatedInstance(){return new Kn}static resetInstance(){Kn.instance=null}async loadComponents(e,r){if(this.loadingState==="loading")throw new sn("Components are already being loaded","LOADING_IN_PROGRESS");if(this.loadingState==="loaded"&&this.templateId===e&&this.templateType===r){Ir.log("Components already loaded for template:",e,r);return}this.loadingState="loading",this.templateId=e,this.templateType=r,this.error=null;try{await this.loadManifest(),await this.loadComponentBundle(),this.loadingState="loaded",Ir.log("Successfully loaded components:",Object.keys(this.registry).length)}catch(a){throw this.loadingState="error",this.error=a instanceof Error?a:new Error(String(a)),new sn(`Failed to load components: ${this.error.message}`,"LOAD_FAILED",{originalError:this.error})}}async loadManifest(){try{if(!this.templateId)throw new sn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=`${this.templateId}:${this.templateType}`;if(Kn.manifestCache.has(e)){this.manifest=Kn.manifestCache.get(e),Ir.log("Manifest loaded from cache:",this.manifest.templateId);return}const r=Nr(`/api/templates/${this.templateId}/components`,"json"),a=await Bl(r,{label:"components.json"});if(!a.ok)throw new sn(`Failed to fetch manifest: ${a.status} ${a.statusText}`,"MANIFEST_FETCH_FAILED",{status:a.status,statusText:a.statusText});const i=await a.json();this.validateManifest(i),this.manifest=i,Kn.manifestCache.set(e,i),Ir.log("Manifest loaded and cached:",i.templateId)}catch(e){throw e instanceof sn?e:new sn("Failed to load component manifest","MANIFEST_LOAD_FAILED",{originalError:e})}}validateManifest(e){if(!e.version)throw new sn("Manifest missing required field: version","MANIFEST_INVALID",{field:"version"});if(!e.templateId)throw new sn("Manifest missing required field: templateId","MANIFEST_INVALID",{field:"templateId"});if(!e.components||typeof e.components!="object")throw new sn("Manifest missing required field: components","MANIFEST_INVALID",{field:"components"});const r=["basic","composite","layout"];for(const a of r){if(!Array.isArray(e.components[a]))throw new sn(`Manifest field 'components.${a}' must be an array`,"MANIFEST_INVALID",{field:`components.${a}`,value:e.components[a]});e.components[a].forEach((i,l)=>{if(!i.name||typeof i.name!="string")throw new sn(`Invalid component metadata at ${a}[${l}]: missing or invalid 'name'`,"MANIFEST_INVALID",{type:a,index:l,metadata:i});if(!i.type||typeof i.type!="string")throw new sn(`Invalid component metadata at ${a}[${l}]: missing or invalid 'type'`,"MANIFEST_INVALID",{type:a,index:l,metadata:i})})}Ir.log("Manifest validation passed")}async loadComponentBundle(){try{if(!this.templateId)throw new sn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=this.getGlobalVariableName(),r=window[e];if(!r||typeof r!="object")throw new sn(`Component bundle not loaded. Expected global variable: ${e}. Ensure admin.blade.php includes the IIFE bundle script.`,"BUNDLE_NOT_LOADED",{expectedVariable:e});await this.registerComponentsFromManifest(r),Ir.log("Component bundle loaded from global variable:",e)}catch(e){throw e instanceof sn?e:new sn("Failed to load component bundle","BUNDLE_LOAD_FAILED",{originalError:e})}}getGlobalVariableName(){if(!this.templateId)throw new sn("Template ID not set","TEMPLATE_ID_NOT_SET");return this.templateId.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")}async registerComponentsFromManifest(e){if(!this.manifest)throw new sn("Manifest not loaded","MANIFEST_NOT_LOADED");const r=["basic","composite","layout"];for(const a of r){const i=this.manifest.components[a]||[];for(const l of i){const c=l.name,d=e[c];if(!d){Ir.warn(`Component '${c}' not found in bundle`);continue}this.registerComponent(c,d,l)}}}registerComponent(e,r,a){this.registry[e]&&Ir.warn(`Component '${e}' already registered, overwriting`);const i=We.memo(r);this.registry[e]={component:i,metadata:a},Ir.log(`[ComponentRegistry] Registered component: ${e} (${a.type})`)}getComponent(e){const r=this.registry[e];return r?r.component:null}getMetadata(e){const r=this.registry[e];return r?r.metadata:null}hasComponent(e){return e in this.registry}getComponentsByType(e){return Object.entries(this.registry).filter(([r,a])=>a.metadata.type===e).map(([r,a])=>r)}getAllComponents(){return Object.keys(this.registry)}getComponentMap(){const e={};for(const[r,a]of Object.entries(this.registry))e[r]=a.component;return e}getLoadingState(){return this.loadingState}getError(){return this.error}getTemplateId(){return this.templateId}getManifest(){return this.manifest}clear(){this.registry={},this.manifest=null,this.loadingState="idle",this.error=null,this.templateId=null,this.templateType=null,Ir.log("Registry cleared")}};$(Kn,"instance",null),$(Kn,"manifestCache",new Map);let mr=Kn;const Zg=ut("TranslationEngine");class cd extends Error{constructor(e,r,a){super(e),this.key=r,this.locale=a,this.name="TranslationError"}}const On=class On{constructor(e={}){$(this,"cache",new Map);$(this,"translations",new Map);$(this,"options");$(this,"cacheVersion",0);this.options={defaultLocale:e.defaultLocale||"ko",fallbackLocale:e.fallbackLocale||"en",cacheTTL:e.cacheTTL||3e5}}static getInstance(e={}){return On.instance||(On.instance=new On(e)),On.instance}static resetInstance(){On.instance=null}setCacheVersion(e){this.cacheVersion!==e&&(Zg.log("Cache version updated:",this.cacheVersion,"->",e),this.cacheVersion=e,this.cache.clear())}getCacheVersion(){return this.cacheVersion}async loadTranslations(e,r,a="/api",i=!1){const l=`${e}:${r}`;if(!i){const c=this.getFromCache(l);if(c)return this.translations.set(l,c),c}try{const c=[];i&&c.push(`_=${Date.now()}`);const d=Nr(`${a}/templates/${e}/lang/${r}`,"json",this.cacheVersion>0?this.cacheVersion:null,c.length>0?c.join("&"):void 0),f=await fetch(d);if(!f.ok)throw new cd(`Failed to load translations: ${f.statusText}`,void 0,r);const m=await f.json();return this.saveToCache(l,m),this.translations.set(l,m),m}catch(c){throw new cd(`Failed to fetch translations for ${r}: ${c instanceof Error?c.message:String(c)}`,void 0,r)}}resolveTranslations(e,r,a){let i=e;const l=5;let c=0;for(;c<l&&i.includes("=$t:");){const d=i;if(i=i.replace(On.NESTED_TRANSLATION_PARAM_PATTERN,(f,g,m)=>"="+this.translate(m,r,void 0,a)),i===d)break;c++}return i.replace(On.TRANSLATION_PATTERN,(d,f,g)=>{const{cleanedParams:m,trailing:y}=this.separateTrailingText(g);return this.translate(f,r,m,a)+y})}translate(e,r,a,i){const l=this.getTranslation(e,r),c=a&&this.cleanParamsStr(a);if(c){const d=this.parseParams(c,i);return this.replaceParams(l,d)}return l}getTranslation(e,r){const{templateId:a,locale:i}=r,l=`${a}:${i}`,c=this.translations.get(l);if(c){const d=this.getNestedValue(c,e);if(d!==null)return d}if(i!==this.options.fallbackLocale){const d=`${a}:${this.options.fallbackLocale}`,f=this.translations.get(d);if(f){const g=this.getNestedValue(f,e);if(g!==null)return g}}return e}getNestedValue(e,r){const a=r.split(".");let i=e;for(const l of a){if(i==null||typeof i!="object")return null;i=i[l]}return typeof i=="string"?i:null}setTranslationValue(e,r,a,i){const l=`${e}:${r}`,c=this.translations.get(l)??{},d=a.split(".");let f=c;for(let g=0;g<d.length-1;g+=1){const m=d[g],y=f[m];(y==null||typeof y!="object"||Array.isArray(y))&&(f[m]={}),f=f[m]}f[d[d.length-1]]=i,this.translations.set(l,c)}parseParams(e,r){const a={},i=e.startsWith("|")?e.slice(1):e,l=[],d=i.replace(/\{\{(?:[^}]|\}(?!\}))*\}\}/g,f=>(l.push(f),`__PLACEHOLDER_${l.length-1}__`)).matchAll(On.PARAM_PATTERN);for(const f of d){const[,g,m]=f,y=m.replace(/__PLACEHOLDER_(\d+)__/g,(w,S)=>l[parseInt(S,10)]);a[g.trim()]=this.resolveParamValue(y.trim(),r)}return a}resolveParamValue(e,r){if(e.startsWith("{{")&&e.endsWith("}}")){const a=e.slice(2,-2).trim();if(/[|&()[\]!?:+\-*/%<>=\s]/.test(a)&&r)try{const l=pd.evaluateExpression(a,r);return String(l??"")}catch(l){return Zg.error("Expression evaluation failed:",a,l),""}else{const l=this.getNestedDataValue(r,a);return String(l??"")}}return e}separateTrailingText(e){if(!e)return{cleanedParams:void 0,trailing:""};if(e.trimEnd().endsWith("}}"))return{cleanedParams:e,trailing:""};if(!(e.startsWith("|")?e.slice(1):e).includes("="))return{cleanedParams:void 0,trailing:e};const a=e.match(/(\s+[^\p{L}\w=|&\s][^\p{L}\w=]*\s*)$/u);return a?{cleanedParams:e.slice(0,-a[1].length),trailing:a[1]}:{cleanedParams:e,trailing:""}}cleanParamsStr(e){return this.separateTrailingText(e).cleanedParams||""}getNestedDataValue(e,r){if(!e)return;const a=r.split(".");let i=e;for(const l of a){if(i==null)return;i=i[l]}return i}replaceParams(e,r){let a=e;for(const[i,l]of Object.entries(r)){const c=new RegExp(`\\{\\{${i}\\}\\}`,"g");a=a.replace(c,String(l));const d=new RegExp(`\\{${i}\\}`,"g");a=a.replace(d,String(l))}return a}getFromCache(e){const r=this.cache.get(e);return r?Date.now()-r.timestamp>this.options.cacheTTL?(this.cache.delete(e),null):r.data:null}saveToCache(e,r){this.cache.set(e,{data:r,timestamp:Date.now()})}clearCache(){this.cache.clear(),this.translations.clear()}pruneCache(){const e=Date.now(),r=[];for(const[a,i]of this.cache.entries())e-i.timestamp>this.options.cacheTTL&&r.push(a);for(const a of r)this.cache.delete(a)}getCacheStats(){const e=Date.now();let r=0;for(const a of this.cache.values())e-a.timestamp>this.options.cacheTTL&&r++;return{size:this.cache.size,expired:r}}};$(On,"instance",null),$(On,"TRANSLATION_PATTERN",/\$t:(?:defer:)?([a-zA-Z0-9._-]+)(\|(?:(?!\$t:).)+)?/g),$(On,"NESTED_TRANSLATION_PARAM_PATTERN",/=(\$t:([a-zA-Z0-9._-]+))(?=[|&\s]|$)/g),$(On,"PARAM_PATTERN",/([^=|&]+)=([^|&]+)/g);let gi=On;const ep=Object.freeze(Object.defineProperty({__proto__:null,TranslationEngine:gi,TranslationError:cd},Symbol.toStringTag,{value:"Module"})),Yi=ut("PipeRegistry");function tp(o,e){const r=o.getFullYear(),a=String(o.getMonth()+1).padStart(2,"0"),i=String(o.getDate()).padStart(2,"0"),l=String(o.getHours()).padStart(2,"0"),c=String(o.getMinutes()).padStart(2,"0"),d=String(o.getSeconds()).padStart(2,"0");return e.replace("YYYY",String(r)).replace("YY",String(r).slice(-2)).replace("MM",a).replace("M",String(o.getMonth()+1)).replace("DD",i).replace("D",String(o.getDate())).replace("HH",l).replace("H",String(o.getHours())).replace("mm",c).replace("m",String(o.getMinutes())).replace("ss",d).replace("s",String(o.getSeconds()))}function YS(o,e="ko"){const a=new Date().getTime()-o.getTime(),i=Math.floor(a/1e3),l=Math.floor(i/60),c=Math.floor(l/60),d=Math.floor(c/24),f=Math.floor(d/7),g=Math.floor(d/30),m=Math.floor(d/365);return e==="ko"?i<60?"방금 전":l<60?`${l}분 전`:c<24?`${c}시간 전`:d<7?`${d}일 전`:f<4?`${f}주 전`:g<12?`${g}개월 전`:`${m}년 전`:i<60?"just now":l<60?`${l} minute${l===1?"":"s"} ago`:c<24?`${c} hour${c===1?"":"s"} ago`:d<7?`${d} day${d===1?"":"s"} ago`:f<4?`${f} week${f===1?"":"s"} ago`:g<12?`${g} month${g===1?"":"s"} ago`:`${m} year${m===1?"":"s"} ago`}function ud(o){if(o==null)return null;if(o instanceof Date)return o;if(typeof o=="number")return new Date(o);if(typeof o=="string"){const e=new Date(o);return isNaN(e.getTime())?null:e}return null}const to={date:{fn:(o,e="YYYY-MM-DD")=>{const r=ud(o);return r?tp(r,e):""},description:"날짜 포맷 (기본: YYYY-MM-DD)"},datetime:{fn:(o,e="YYYY-MM-DD HH:mm")=>{const r=ud(o);return r?tp(r,e):""},description:"날짜+시간 포맷 (기본: YYYY-MM-DD HH:mm)"},relativeTime:{fn:(o,e="ko")=>{const r=ud(o);return r?YS(r,e):""},description:'상대 시간 표시 (예: "3분 전")'},number:{fn:(o,e)=>{const r=Number(o);if(isNaN(r))return String(o??"");const a={};return e!==void 0&&(a.minimumFractionDigits=e,a.maximumFractionDigits=e),r.toLocaleString(void 0,a)},description:"숫자 포맷 (천단위 구분, 선택적 소수점)"},truncate:{fn:(o,e=100,r="...")=>typeof o!="string"?String(o??""):o.length<=e?o:o.slice(0,e)+r,description:'문자열 자르기 (기본: 100자, 접미사: "...")'},uppercase:{fn:o=>typeof o!="string"?String(o??""):o.toUpperCase(),description:"대문자 변환"},lowercase:{fn:o=>typeof o!="string"?String(o??""):o.toLowerCase(),description:"소문자 변환"},stripHtml:{fn:o=>typeof o!="string"?String(o??""):o.replace(/<[^>]*>/g,""),description:"HTML 태그 제거"},default:{fn:(o,e="")=>o==null||o===""?e:o,description:"기본값 설정 (null, undefined, 빈문자열 시)"},fallback:{fn:(o,e)=>o??e,description:"폴백 값 설정 (null, undefined 시만)"},first:{fn:o=>{if(Array.isArray(o))return o[0]},description:"배열의 첫 번째 요소"},last:{fn:o=>{if(Array.isArray(o))return o[o.length-1]},description:"배열의 마지막 요소"},join:{fn:(o,e=", ")=>Array.isArray(o)?o.join(e):"",description:'배열을 문자열로 결합 (기본 구분자: ", ")'},length:{fn:o=>Array.isArray(o)||typeof o=="string"?o.length:0,description:"배열/문자열 길이"},filterBy:{fn:(o,e,r)=>Array.isArray(o)?Array.isArray(e)?o.filter(a=>{const i=r?a?.[r]:a;return e.includes(i)}):o:[],description:"배열 필터링 (allowList에 포함된 항목만 반환)"},keys:{fn:o=>o==null||typeof o!="object"?[]:Object.keys(o),description:"객체의 키 배열"},values:{fn:o=>o==null||typeof o!="object"?[]:Object.values(o),description:"객체의 값 배열"},json:{fn:(o,e)=>{try{return JSON.stringify(o,null,e)}catch{return""}},description:"JSON 문자열로 변환"},localized:{fn:(o,e)=>o==null?"":typeof o=="string"?o:typeof o!="object"?String(o):o[e||"ko"]||o.ko||o.en||Object.values(o)[0]||"",description:"다국어 객체에서 로케일에 맞는 값 추출"}},Xi=new Map,Ci=class Ci{static getInstance(){return Ci.instance||(Ci.instance=new Ci),Ci.instance}register(e,r,a){if(to[e]){Yi.warn(`[PipeRegistry] 내장 파이프를 덮어쓸 수 없습니다: ${e}`);return}Xi.set(e,{fn:r,description:a}),Yi.log(`[PipeRegistry] 커스텀 파이프 등록됨: ${e}`)}unregister(e){if(to[e])return Yi.warn(`[PipeRegistry] 내장 파이프는 해제할 수 없습니다: ${e}`),!1;const r=Xi.delete(e);return r&&Yi.log(`[PipeRegistry] 커스텀 파이프 해제됨: ${e}`),r}get(e){const r=to[e];return r?r.fn:Xi.get(e)?.fn}has(e){return!!to[e]||Xi.has(e)}execute(e,r,a=[]){const i=this.get(e);if(!i)return Yi.warn(`[PipeRegistry] 알 수 없는 파이프: ${e}`),r;try{return i(r,...a)}catch(l){return Yi.error(`[PipeRegistry] 파이프 실행 오류 (${e}):`,l),r}}list(){const e=[];for(const[r,a]of Object.entries(to))e.push({name:r,description:a.description,type:"built-in"});for(const[r,a]of Xi.entries())e.push({name:r,description:a.description,type:"custom"});return e.sort((r,a)=>r.name.localeCompare(a.name))}clearCustomPipes(){Xi.clear()}};$(Ci,"instance",null);let Pl=Ci;Pl.getInstance();function XS(o){const e=o.trim(),r=e.indexOf("(");if(r===-1)return{name:e,args:[]};const a=e.slice(0,r).trim(),i=e.slice(r+1,-1);if(!i.trim())return{name:a,args:[]};const l=[];let c="",d=null,f=0;for(let g=0;g<i.length;g++){const m=i[g];if((g>0?i[g-1]:"")==="\\"){c+=m;continue}if((m==='"'||m==="'")&&!d){d=m;continue}if(m===d){d=null;continue}if(d){c+=m;continue}if(m==="("||m==="["||m==="{"){f++,c+=m;continue}if(m===")"||m==="]"||m==="}"){f--,c+=m;continue}if(m===","&&f===0){l.push(np(c.trim())),c="";continue}c+=m}return c.trim()&&l.push(np(c.trim())),{name:a,args:l}}function np(o){if(o==="null")return null;if(o==="undefined")return;if(o==="true")return!0;if(o==="false")return!1;const e=Number(o);return!isNaN(e)&&o!==""?e:o}function JS(o){const e=[];let r="",a=null,i=0;for(let l=0;l<o.length;l++){const c=o[l],d=l>0?o[l-1]:"",f=l<o.length-1?o[l+1]:"";if(d==="\\"){r+=c;continue}if((c==='"'||c==="'")&&!a){a=c,r+=c;continue}if(c===a){a=null,r+=c;continue}if(a){r+=c;continue}if(c==="("||c==="["||c==="{"){i++,r+=c;continue}if(c===")"||c==="]"||c==="}"){i--,r+=c;continue}if(c==="|"&&f!=="|"&&d!=="|"&&i===0){e.push(r.trim()),r="";continue}r+=c}return r.trim()&&e.push(r.trim()),e.length===0?[o,[]]:[e[0],e.slice(1)]}function Gn(o){let e=null,r=0;for(let a=0;a<o.length;a++){const i=o[a],l=a>0?o[a-1]:"",c=a<o.length-1?o[a+1]:"";if(l!=="\\"){if((i==='"'||i==="'")&&!e){e=i;continue}if(i===e){e=null;continue}if(!e){if(i==="("||i==="["||i==="{"){r++;continue}if(i===")"||i==="]"||i==="}"){r--;continue}if(i==="|"&&c!=="|"&&l!=="|"&&r===0)return!0}}}return!1}function QS(o,e){const r=Pl.getInstance();let a=o;for(const i of e){const l=XS(i);a=r.execute(l.name,a,l.args)}return a}const dd=new Map([["true",!0],["false",!1],["null",null],["undefined",void 0]]);function Ta(o){if(typeof o!="string"||!o.startsWith("{{")||!o.endsWith("}}")||o.length<4)return null;const e=o.slice(2,-2);let r=null,a=0;for(let i=0;i<e.length;i++){const l=e[i];if(r!==null){if(l==="\\"){i++;continue}l===r&&(r=null);continue}if(l==='"'||l==="'"||l==="`"){r=l;continue}if(l==="{"){a++;continue}if(l==="}"){if(a>0){a--;continue}return null}}return a===0?e.trim():null}function ZS(o){const e=[];if(typeof o!="string")return e;for(let r=0;r<o.length-1;r++){if(o[r]!=="{"||o[r+1]!=="{")continue;let a=null,i=0,l=-1;for(let c=r+2;c<o.length;c++){const d=o[c];if(a!==null){if(d==="\\"){c++;continue}d===a&&(a=null);continue}if(d==='"'||d==="'"||d==="`"){a=d;continue}if(d==="{"){i++;continue}if(d==="}"){if(i>0){i--;continue}if(o[c+1]==="}"){l=c;break}break}}l!==-1&&(e.push({start:r,end:l+2,expr:o.slice(r+2,l)}),r=l+1)}return e}function no(o){return/[?:|&!+\-*/<>=()[\]{}]/.test(o)}function rp(o){const e=typeof o=="string"?o.trim():"";return e===""?"empty":dd.has(e)?"literal":Gn(e)?"pipe":no(e)?"expression":"path"}function fd(o,e,r,a){const i=typeof o=="string"?o.trim():"",l=rp(i),c=a?.skipCache?{skipCache:!0}:void 0;if(l==="empty"){a?.onEmpty?.(o);return}if(l==="literal")return dd.get(i);try{return l==="pipe"?r.evaluatePipeExpression(i,e,c,a?.trackingInfo):l==="expression"?r.evaluateExpression(i,e,a?.trackingInfo):r.resolve(i,e,c,a?.trackingInfo)}catch(d){if(a?.onError)return a.onError(d,i);throw d}}const nr="raw:";function ap(o){return o.startsWith(nr)?o.slice(nr.length):o}const ro="﷐",pi="﷑",ka="﷒";function ao(o){return ro+o+pi}function ql(o){return o.length>=2&&o.charCodeAt(0)===64976&&o.charCodeAt(o.length-1)===64977}function Gl(o){return o.includes(ro)}function hd(o){return o.slice(1,-1)}function Ji(o){if(typeof o=="string")return ao(o);if(Array.isArray(o))return o.map(Ji);if(o&&typeof o=="object"){const e={};for(const[r,a]of Object.entries(o))e[r]=Ji(a);return e}return o}function Ra(o){if(typeof o=="string")return ql(o)?hd(o):Gl(o)||o.includes(pi)?o.split(ro).join("").split(pi).join(""):o;if(Array.isArray(o)){let e=!1;const r=o.map(a=>{const i=Ra(a);return i!==a&&(e=!0),i});return e?r:o}if(o&&typeof o=="object"){if(o.$$typeof!==void 0)return o;let e=!1;const r={};for(const[a,i]of Object.entries(o)){const l=Ra(i);l!==i&&(e=!0),r[a]=l}return e?r:o}return o}const Da=ut("DataBindingEngine"),ew=/^[$A-Za-z_][$A-Za-z0-9_]*$/,tw=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","arguments","eval"]);function io(){try{return window.G7Core?.devTools}catch{return}}class gd extends Error{constructor(e,r,a){super(e),this.path=r,this.context=a,this.name="DataBindingError"}}const na=class na{constructor(e){$(this,"cache",new Map);$(this,"expressionFnCache",new Map);$(this,"renderCycleCache",new Map);$(this,"currentRenderCycleId",0);$(this,"defaultOptions",{defaultValue:void 0,nullSafe:!0,detectCircular:!0,maxDepth:10});e&&(this.defaultOptions={...this.defaultOptions,...e})}startRenderCycle(){this.currentRenderCycleId++,this.renderCycleCache.clear()}isRenderCycleCacheActive(){return this.currentRenderCycleId>0}getFromRenderCycleCache(e){if(this.isRenderCycleCacheActive())return this.renderCycleCache.get(e)}saveToRenderCycleCache(e,r){this.isRenderCycleCacheActive()&&this.renderCycleCache.set(e,r)}resolveBindings(e,r,a,i){const l={...this.defaultOptions,...a},c=io(),d=r._computed&&!r.$computed?{...r,$computed:r._computed}:r,f=(w,S)=>{const v=S.trim();let A=!1,x=v;if(v.startsWith(nr)&&(A=!0,x=v.slice(nr.length)),Gn(x))try{const B=this.evaluatePipeExpression(x,d,l,{...i,method:"resolveBindings",displayExpression:`{{${v}}}`}),K=this.formatValue(B);return A?ao(K):K}catch(B){return Da.error("Pipe expression evaluation failed:",x,B),w}if(no(x)){const B=c?.isEnabled()?performance.now():0;try{let K,fe=!1;if(l.skipCache)K=this.evaluateExpression(x,d);else{const ke=`expr:${x}`,Ue=this.getFromRenderCycleCache(ke);Ue!==void 0?(K=Ue,fe=!0):(K=this.evaluateExpression(x,d),this.saveToRenderCycleCache(ke,K))}if(c?.isEnabled()){const ke=performance.now()-B;c.trackExpressionEval({expression:`{{${v}}}`,result:this.sanitizeResultForTracking(K),resultType:this.getResultType(K),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:fe,duration:ke,method:"resolveBindings",skipCache:l.skipCache})}const Ce=this.formatValue(K);return A?ao(Ce):Ce}catch(K){return Da.error("Expression evaluation failed:",x,K),w}}if(l.skipCache){const B=c?.isEnabled()?performance.now():0,K=this.resolvePath(x,d,l);if(c?.isEnabled()){const Ce=performance.now()-B;c.trackExpressionEval({expression:`{{${v}}}`,result:this.sanitizeResultForTracking(K),resultType:this.getResultType(K),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:Ce,method:"resolveBindings",skipCache:!0})}const fe=this.formatValue(K);return A?ao(fe):fe}const M=x.startsWith("_global")||x.startsWith("_local")||x.startsWith("_isolated")||x.startsWith("$parent"),O=c?.isEnabled()?performance.now():0;let L,q=!1;if(M){const B=this.getFromRenderCycleCache(x);B!==void 0?(L=B,q=!0):(L=this.resolvePath(x,d,l),this.saveToRenderCycleCache(x,L))}else{const B=this.getFromCache(x);B!==void 0?(L=B,q=!0):(L=this.resolvePath(x,d,l),this.saveToCache(x,L))}if(c?.isEnabled()){const B=performance.now()-O;c.trackExpressionEval({expression:`{{${v}}}`,result:this.sanitizeResultForTracking(L),resultType:this.getResultType(L),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:q,duration:B,method:"resolveBindings",skipCache:l.skipCache})}const G=this.formatValue(L);return A?ao(G):G},g=ZS(e);if(g.length===0)return e;let m="",y=0;for(const w of g)m+=e.slice(y,w.start),m+=f(e.slice(w.start,w.end),w.expr),y=w.end;return m+e.slice(y)}evaluatePipeExpression(e,r,a,i){const l={...this.defaultOptions,...a},c=io(),d=c?.isEnabled()?performance.now():0,f=r._computed&&!r.$computed?{...r,$computed:r._computed}:r,[g,m]=JS(e);let y,w=!1;const S=no(g),v=g.startsWith("_global")||g.startsWith("_local")||g.startsWith("_isolated")||g.startsWith("$parent");if(l.skipCache)S?y=this.evaluateExpression(g,f):y=this.resolvePath(g,f,l);else if(S){const x=this.getFromRenderCycleCache(`expr:${g}`);x!==void 0?(y=x,w=!0):(y=this.evaluateExpression(g,f),this.saveToRenderCycleCache(`expr:${g}`,y))}else if(v){const x=this.getFromRenderCycleCache(g);x!==void 0?(y=x,w=!0):(y=this.resolvePath(g,f,l),this.saveToRenderCycleCache(g,y))}else{const x=this.getFromCache(g);x!==void 0?(y=x,w=!0):(y=this.resolvePath(g,f,l),this.saveToCache(g,y))}const A=QS(y,m);if(c?.isEnabled()){const x=performance.now()-d;c.trackExpressionEval({expression:i?.displayExpression??`{{${e}}}`,result:this.sanitizeResultForTracking(A),resultType:this.getResultType(A),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:w,duration:x,method:i?.method??"evaluatePipeExpression",skipCache:l.skipCache})}return A}resolve(e,r,a,i){const l={...this.defaultOptions,...a},c=io(),d=c?.isEnabled()?performance.now():0;if(l.skipCache){const y=this.resolvePath(e,r,l);return c?.isEnabled()&&c.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(y),resultType:this.getResultType(y),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:performance.now()-d,method:"resolve",skipCache:!0}),y}const f=e.startsWith("_global")||e.startsWith("_local")||e.startsWith("_isolated")||e.startsWith("$parent");let g=!1;if(f){const y=this.getFromRenderCycleCache(e);if(y!==void 0)return g=!0,c?.isEnabled()&&c.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(y),resultType:this.getResultType(y),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),y}else{const y=this.getFromCache(e);if(y!==void 0)return g=!0,c?.isEnabled()&&c.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(y),resultType:this.getResultType(y),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),y}const m=this.resolvePath(e,r,l);return f?this.saveToRenderCycleCache(e,m):this.saveToCache(e,m),c?.isEnabled()&&c.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(m),resultType:this.getResultType(m),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:g,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),m}resolvePath(e,r,a,i=0,l=new WeakSet){if(typeof e!="string"||e.trim()===""){Da.warn("resolvePath: 빈 경로가 전달되었습니다 — undefined 로 해석합니다.");return}if(a.maxDepth&&i>a.maxDepth){if(a.detectCircular)throw new gd(`Maximum depth exceeded (${a.maxDepth}). Possible circular reference.`,e,r);return a.defaultValue}const c=this.parsePath(e);let d=r;for(let f=0;f<c.length;f++){const g=c[f];if(d==null){if(a.nullSafe)return a.defaultValue;throw new gd(`Cannot read property '${g}' of ${d}`,e,r)}if(a.detectCircular&&typeof d=="object"){if(l.has(d))throw new gd(`Circular reference detected at path: ${c.slice(0,f+1).join(".")}`,e,r);l.add(d)}d=d[g],e==="_global.toasts"&&Da.log(`[DataBindingEngine] segment: ${g}, current:`,d)}return d!==void 0?d:a.defaultValue}parsePath(e){const r=[];let a;for(na.PATH_SEGMENT_PATTERN.lastIndex=0;(a=na.PATH_SEGMENT_PATTERN.exec(e))!==null;){const i=a[1]||a[2];i&&r.push(i)}return r}formatValue(e){if(e==null)return"";if(typeof e=="object")try{return JSON.stringify(e)}catch{return"[Object]"}return String(e)}getFromCache(e){const r=this.cache.get(e),a=io();if(!r){a?.isEnabled()&&a.recordCacheMiss();return}if(Date.now()-r.timestamp>na.CACHE_EXPIRY){this.cache.delete(e),a?.isEnabled()&&a.recordCacheMiss();return}return a?.isEnabled()&&a.recordCacheHit(),r.value}saveToCache(e,r){this.cache.set(e,{value:r,timestamp:Date.now()})}isActionDefinition(e){return typeof e.handler!="string"?!1:e.params!==void 0||Array.isArray(e.actions)||typeof e.target=="string"||e.onSuccess!==void 0||e.onError!==void 0}resolveObject(e,r,a){if(this.isSwitchExpression(e)){const d=e;return this.resolveSwitch(d,r,a)}if(this.isActionDefinition(e))return{...e};if("iteration"in e)return{...e};const i={},c=[...["cellChildren","expandChildren","expandContext","render"],...a?.skipBindingKeys||[]];for(const[d,f]of Object.entries(e)){if(c.includes(d)){i[d]=f;continue}try{this.resolveObjectEntry(i,d,f,r,a)}catch(g){Da.warn(`resolveObject: 값 해석 실패 (key: ${d}):`,g),i[d]=void 0}}return i}resolveObjectEntry(e,r,a,i,l){if(typeof a=="string"){const c=Ta(a);if(c!==null){const d=c.trim();let f=!1,g=d;d.startsWith(nr)&&(f=!0,g=d.slice(nr.length));let m;switch(rp(g)){case"empty":Da.warn(`resolveObject: 빈 바인딩 \`{{}}\` (key: ${r}) — undefined 로 해석합니다.`),m=void 0;break;case"literal":m=dd.get(g);break;case"pipe":m=this.evaluatePipeExpression(g,i,l);break;case"expression":m=this.evaluateExpression(g,i,l);break;default:m=this.resolve(g,i,l)}e[r]=f&&m!=null?Ji(m):m}else e[r]=this.resolveBindings(a,i,l)}else Array.isArray(a)?e[r]=a.map(c=>typeof c=="string"?this.resolveBindings(c,i,l):typeof c=="object"&&c!==null?this.resolveObject(c,i,l):c):a&&typeof a=="object"?e[r]=this.resolveObject(a,i,l):e[r]=a}clearCache(){this.cache.clear(),this.expressionFnCache.clear()}invalidateCacheByKeys(e){for(const r of this.cache.keys())for(const a of e)if(r===a||r.startsWith(`${a}.`)||r.startsWith(`${a}[`)){this.cache.delete(r);break}}pruneCache(){const e=Date.now();for(const[r,a]of this.cache.entries())e-a.timestamp>na.CACHE_EXPIRY&&this.cache.delete(r)}getCacheStats(){const e=Date.now();let r=0;for(const a of this.cache.values())e-a.timestamp>na.CACHE_EXPIRY&&r++;return{size:this.cache.size,expired:r}}evaluateExpression(e,r,a){const i=io(),l=i?.isEnabled()?performance.now():0;i?.isEnabled()&&i.trackBindingEval();try{let c=this.preprocessOptionalChaining(e);c=this.preprocessTranslationTokens(c);const d=this.extractVariablesFromExpression(c),f={...r};for(const L of d)L in f||(f[L]=void 0);r._computed&&!f.$computed&&(f.$computed=r._computed);let g=r.$templateId,m=r.$locale;if(typeof window<"u"&&(!g||!m)){const L=window.__templateApp?.getConfig?.();g??(g=L?.templateId),m??(m=L?.locale)}const y=m||"ko";f.$localized=(L,q)=>{if(L==null&&!q)return"";if(typeof L=="string")return L;if(L&&typeof L=="object"&&L[y])return L[y];if(q&&typeof q=="string"){const G=f.$t?f.$t(q):q;if(G&&G!==q)return G}return L&&typeof L=="object"?L.ko||L.en||Object.values(L)[0]||"":L==null?"":String(L)};const w=typeof window<"u"?window.G7Core:void 0;f.$uuid=()=>w?.uuid?w.uuid():typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,L=>{const q=Math.random()*16|0;return(L==="x"?q:q&3|8).toString(16)});const S={templateId:g||"",locale:y};f.$t=L=>{if(!L||typeof L!="string")return"";try{return gi.getInstance().translate(L,S)}catch(q){return Da.warn("$t() translation failed for key:",L,q),L}},f.$get=(L,q,G=void 0)=>{if(L==null)return G;const B=Array.isArray(q)?q:[q];if(B.length===0)return L;let K=L;for(const fe of B){if(K==null||fe==null)return G;K=K[fe]}return K??G};const v=[],A=[];for(const[L,q]of Object.entries(f))!ew.test(L)||tw.has(L)||(v.push(L),A.push(q));const x=`${c}|${v.join(",")}`;let R=this.expressionFnCache.get(x);const M=!!R;R||(R=new Function(...v,`return (${c});`),this.expressionFnCache.set(x,R));const O=R(...A);if(i?.isEnabled()){const L=performance.now()-l;i.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(O),resultType:this.getResultType(O),componentId:a?.componentId,componentName:a?.componentName,propName:a?.propName,fromCache:M,duration:L,method:"evaluateExpression",skipCache:a?.skipCache})}return O}catch(c){throw new Error(`Failed to evaluate expression "${e}": ${c instanceof Error?c.message:String(c)}`)}}getResultType(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}sanitizeResultForTracking(e){if(e==null||typeof e!="object")return e;try{if(Array.isArray(e))return e.length>10?`[Array(${e.length})]`:e.slice(0,10);const r=Object.keys(e);return r.length>20?`{Object(${r.length} keys)}`:(JSON.stringify(e),e)}catch{return"[Complex Object]"}}preprocessTranslationTokens(e){return e=e.replace(/(['"])(\$t:([a-zA-Z_][a-zA-Z0-9_.\-]*))\1/g,(r,a,i,l)=>`$t('${l}')`),e.replace(/(?<!['"]\s*)(\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*)(?!\s*['"])/g,'"$1"')}preprocessOptionalChaining(e){const r=[];let a=e.replace(/(['"])(?:(?!\1|\\).|\\.)*\1/g,l=>(r.push(l),`__STRING_LITERAL_${r.length-1}__`));const i=[];return a=a.replace(/\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*(?:\|[^'"\s,)]+)?/g,l=>(i.push(l),`__TRANSLATION_TOKEN_${i.length-1}__`)),a=a.replace(/([a-zA-Z_$][a-zA-Z0-9_$]*)\.(?!\?)/g,"$1?."),a=a.replace(/__TRANSLATION_TOKEN_(\d+)__/g,(l,c)=>i[parseInt(c,10)]),a=a.replace(/__STRING_LITERAL_(\d+)__/g,(l,c)=>r[parseInt(c,10)]),a}extractVariablesFromExpression(e){const r=new Set(["true","false","null","undefined","NaN","Infinity","if","else","for","while","do","switch","case","break","continue","return","function","class","const","let","var","new","delete","typeof","instanceof","this","super","import","export","default","try","catch","finally","throw","Math","Date","JSON","Array","Object","String","Number","Boolean","RegExp","Set","Map","WeakSet","WeakMap","Symbol","Promise","BigInt","Error","parseInt","parseFloat","isNaN","isFinite","encodeURI","decodeURI","encodeURIComponent","decodeURIComponent"]),a=/(?<![.\w$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,i=new Set;let l;for(;(l=a.exec(e))!==null;){const c=l[1];r.has(c)||i.add(c)}return Array.from(i)}isSwitchExpression(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$switch"in e&&"$cases"in e}resolveSwitch(e,r,a){const i={...a,skipCache:!0};let l;try{l=this.resolveBindings(e.$switch,r,i)?.toString()?.trim()??""}catch(d){Da.warn("resolveSwitch: $switch 키 평가 실패:",e.$switch,d),l=""}let c;if(l&&e.$cases&&l in e.$cases)c=e.$cases[l];else if("$default"in e)c=e.$default;else return;return typeof c=="string"?c.includes("{{")?this.resolveBindings(c,r,i):c:c!==null&&typeof c=="object"?this.resolveObject(c,r,i):c}};$(na,"PATH_SEGMENT_PATTERN",/([^.[\]]+)|\[(\d+)\]/g),$(na,"CACHE_EXPIRY",3e4);let _n=na;const pd=new _n,Vl={mobile:{min:0,max:767},tablet:{min:768,max:1023},desktop:{min:1024,max:1/0},portable:{min:0,max:1023}},Fl=new Map;function nw(o,e){let r=null;return((...a)=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{o(...a)},e)})}class rw{constructor(){$(this,"subscribers",new Set);$(this,"currentWidth",1024);$(this,"debouncedHandler",null);$(this,"isInitialized",!1);this.initialize()}initialize(){typeof window>"u"||(this.currentWidth=window.innerWidth,this.isInitialized=!0,this.debouncedHandler=nw(()=>{this.currentWidth=window.innerWidth,this.notifySubscribers()},150),window.addEventListener("resize",this.debouncedHandler))}notifySubscribers(){this.subscribers.forEach(e=>{e(this.currentWidth)})}subscribe(e){return this.subscribers.add(e),e(this.currentWidth),()=>{this.subscribers.delete(e)}}getWidth(){return this.currentWidth}parseRange(e){if(Fl.has(e))return Fl.get(e)??null;let r=null;if(Vl[e])r={...Vl[e]};else{const a=e.match(/^(-?\d*)-(-?\d*)$/);if(a){const[,i,l]=a,c=i===""?0:parseInt(i,10),d=l===""?1/0:parseInt(l,10);!isNaN(c)&&!isNaN(d)&&c<=d&&(r={min:c,max:d})}}return Fl.set(e,r),r}getMatchingKey(e,r){const a=[];for(const i of Object.keys(e)){const l=this.parseRange(i);l&&r>=l.min&&r<=l.max&&a.push({key:i,range:l,isPreset:!!Vl[i]})}return a.length===0?null:(a.sort((i,l)=>{if(i.isPreset!==l.isPreset)return i.isPreset?1:-1;const c=i.range.max-i.range.min,d=l.range.max-l.range.min;return c-d}),a[0].key)}matches(e){const r=this.parseRange(e);return r?this.currentWidth>=r.min&&this.currentWidth<=r.max:!1}clearSubscribers(){this.subscribers.clear()}destroy(){this.debouncedHandler&&typeof window<"u"&&window.removeEventListener("resize",this.debouncedHandler),this.clearSubscribers(),Fl.clear()}_setWidthForTesting(e){this.currentWidth=e,this.notifySubscribers()}}const mi=new rw,so=ut("ConditionEvaluator");function aw(o,e,r,a){return fd(ap(o),e,r,{skipCache:!0,onEmpty:()=>{so.warn(`${a}: 빈 바인딩 \`{{}}\` — undefined 로 해석합니다.`)}})}function ip(o,e,r){if(!o)return!0;try{const a=Ta(o);let i;if(a!==null?i=aw(a,e,r,"evaluateStringCondition"):i=r.resolveBindings(o,e,{skipCache:!0}),typeof i=="string"){const l=i.toLowerCase().trim();if(l==="false"||l==="0"||l===""||l==="null"||l==="undefined")return!1}return!!i}catch(a){return so.warn(`evaluateStringCondition: 조건 평가 실패: ${o}`,a),!1}}function Kl(o,e,r){if(typeof o=="string")return ip(o,e,r);if("and"in o){if(!Array.isArray(o.and)||o.and.length===0)return so.warn("evaluateConditionExpression: AND 그룹이 비어있습니다"),!0;for(const a of o.and)if(!Kl(a,e,r))return!1;return!0}if("or"in o){if(!Array.isArray(o.or)||o.or.length===0)return so.warn("evaluateConditionExpression: OR 그룹이 비어있습니다"),!1;for(const a of o.or)if(Kl(a,e,r))return!0;return!1}return so.warn("evaluateConditionExpression: 알 수 없는 조건 형식",o),!1}function sp(o,e,r){if(!Array.isArray(o)||o.length===0)return{matched:!1,branchIndex:-1};for(let a=0;a<o.length;a++){const i=o[a];if(i.if===void 0)return{matched:!0,branchIndex:a};if(Kl(i.if,e,r))return{matched:!0,branchIndex:a}}return{matched:!1,branchIndex:-1}}function iw(o){return typeof o=="string"?!0:o&&typeof o=="object"?"and"in o||"or"in o:!1}function sw(o){if(!Array.isArray(o)||o.length===0)return!1;const e=o[0];return!e||typeof e!="object"?!1:"if"in e||"then"in e}const rr=ut("RenderHelpers");function op(){try{return window.G7Core?.devTools}catch{return}}const lp=new _n,ow=no,cp=Ta;function md(o,e,r){let a=o;if(o.startsWith("{{")&&o.endsWith("}}")&&(a=o.slice(2,-2).trim()),Gn(a))try{return r.evaluatePipeExpression(a,e,{skipCache:!0})}catch(i){rr.warn(`resolveIterationSource: 파이프 표현식 평가 실패: ${o}`,i);return}if(ow(a))try{return r.evaluateExpression(a,e)}catch(i){rr.warn(`resolveIterationSource: 표현식 평가 실패: ${o}`,i);return}return r.resolve(a,e,{skipCache:!0})}function lw(o,e){const r={...o};if(e?.parentDataContext)for(const[a,i]of Object.entries(e.parentDataContext))a in r||(r[a]=i);if(e?.state){const a=r._local||{};r._local={...a,...e.state}}return e?.isolatedContext?.state&&(r._isolated=e.isolatedContext.state),r}function yd(o,e,r,a){if(!e||!Array.isArray(e)||e.length===0)return o;const i=a?.actionDispatcher??am(),l={...o,actions:e},c=i.bindActionsToProps(l,r,a?.componentContext);return delete c.actions,c}function up(o,e,r,a){if(typeof o=="boolean")return o;if(!o)return!0;try{const i=cp(o);let l;if(i!==null?l=fd(ap(i),e,r,{skipCache:!0,onEmpty:()=>{rr.warn(`evaluateIfCondition: 빈 바인딩 \`{{}}\` (컴포넌트: ${a||"unknown"}) — undefined 로 해석합니다.`)}}):l=r.resolveBindings(o,e,{skipCache:!0}),typeof l=="string"){const c=l.toLowerCase().trim();if(c==="false"||c==="0"||c===""||c==="null"||c==="undefined")return!1}return!!l}catch(i){return rr.warn(`evaluateIfCondition: 조건 평가 실패 (컴포넌트: ${a||"unknown"}):`,i),!1}}function Qi(o,e,r,a){if(o.if!==void 0)return up(o.if,e,r,a);if(o.condition!==void 0)return up(o.condition,e,r,a);if(o.conditions===void 0)return!0;const i=o.conditions;try{return iw(i)?Kl(i,e,r):sw(i)?sp(i,e,r).matched:(rr.warn(`evaluateRenderCondition: 알 수 없는 conditions 형식 (컴포넌트: ${a||"unknown"})`),!0)}catch(l){return rr.warn(`evaluateRenderCondition: conditions 평가 실패 (컴포넌트: ${a||"unknown"}):`,l),!1}}function dp(o){if(!o.responsive)return o;const e=mi.getWidth(),r=mi.getMatchingKey(o.responsive,e);if(!r)return o;const a=o.responsive[r];return{...o,props:{...o.props,...a.props},children:a.children??o.children,text:a.text??o.text,if:a.if??o.if,iteration:a.iteration??o.iteration}}function oo(o,e,r,a,i){if(!o||o.length===0)return[];const l=i?.bindingEngine??new _n,c=i?.translationEngine??gi.getInstance(),d=i?.translationContext??{templateId:"",locale:"ko"},f=lw(e,i?.componentContext),g=(S,v)=>{if(typeof S=="string")return ql(S)||Gl(S)||!/\$t:[a-zA-Z0-9._-]+/.test(S)?S:c.resolveTranslations(S,d,v);if(Array.isArray(S))return S.map(A=>g(A,v));if(S&&typeof S=="object"){const A={};for(const[x,R]of Object.entries(S))A[x]=g(R,v);return A}return S},m=(S,v)=>{if(typeof S=="string"){if(ql(S))return hd(S);if(Gl(S)){const x=[],R=S.replace(new RegExp(`${ro}([^${pi}]*)${pi}`,"g"),(O,L)=>(x.push(L),`${ka}${x.length-1}${ka}`));let M=R;return/\$t:[a-zA-Z0-9._-]+/.test(R)&&(M=c.resolveTranslations(R,d,v)),M.replace(new RegExp(`${ka}(\\d+)${ka}`,"g"),(O,L)=>x[parseInt(L)])}if(S.startsWith("$t:defer:")){const x="$t:"+S.slice(9);return c.resolveTranslations(x,d,v)}if(S.startsWith("$t:"))return c.resolveTranslations(S,d,v);if(/\$t:[a-zA-Z0-9._-]+/.test(S)){const x=S.trim();if(!(x.startsWith("{")&&x.endsWith("}")||x.startsWith("[")&&x.endsWith("]"))&&!S.includes("{{"))return c.resolveTranslations(S,d,v)}const A=cp(S);if(A!==null){let x=!1,R=A;A.startsWith(nr)&&(x=!0,R=A.slice(nr.length));let M=!1,O=fd(R,v,l,{skipCache:!0,onError:L=>{rr.warn("renderItemChildren: 표현식 평가 실패:",L),M=!0},onEmpty:()=>{rr.warn("renderItemChildren: 빈 바인딩 `{{}}` 은 해석하지 않습니다.")}});return M?void 0:(x||(O=g(O,v)),x&&O!=null?Ji(O):O)}if(S.includes("{{")){const x=l.resolveBindings(S,v,{skipCache:!0});return typeof x=="string"&&/\$t:[a-zA-Z0-9._-]+/.test(x)?c.resolveTranslations(x,d,v):x}return S}if(Array.isArray(S))return S.map(A=>m(A,v));if(S&&typeof S=="object"){if(l.isSwitchExpression(S))return l.resolveSwitch(S,v,{skipCache:!0});if(l.isActionDefinition(S))return{...S};const A={};for(const[x,R]of Object.entries(S))A[x]=m(R,v);return A}return S},y=(S,v)=>{if(!S)return{};const A={};for(const[x,R]of Object.entries(S))A[x]=m(R,v);return A},w=(S,v,A)=>{const x=dp(S),R=x.iteration;if(!R)return[];const M=md(R.source,A,l);if(!Array.isArray(M))return rr.warn(`renderItemChildren: iteration.source가 배열이 아닙니다: ${R.source}`),[];const O=op();if(O?.isEnabled()){const q=`${v}-iteration`;O.trackIteration(q,R.source,R.item_var,R.index_var,M.length)}const L=r[x.name];return L?M.flatMap((q,G)=>{const B={...A,[R.item_var]:q,[`${R.item_var}_index`]:G,...R.index_var?{[R.index_var]:G}:{}},K=Qi({if:x.if,condition:x.condition,conditions:x.conditions},B,l,x.id);if(x.if&&O?.isEnabled()){const wt=`${v}-iter-${G}-if`;O.trackIfCondition(wt,x.if,K,x.name)}if(!K)return[];const fe=x.id?String(Ra(m(x.id,B))):void 0,Ce=`${v}-iter-${G}`,ke=i?.getRemountKey?i.getRemountKey(fe,Ce):Ce,Ue=y(x.props,B),Pe=yd(Ue,x.actions,B,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let qe=null;return x.text!==void 0?qe=m(x.text,B):x.children&&x.children.length>0&&(qe=oo(x.children,B,r,ke,i)),O?.isEnabled()&&O.trackRender(x.name),[We.createElement(L,{key:ke,...Ra(Pe)},Ra(qe))]}):(rr.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${x.name}`),[])};return o.flatMap((S,v)=>{const A=dp(S),x=A.id?String(Ra(m(A.id,f))):void 0,R=a?`${a}-${x||v}`:x||`child-${v}`,M=i?.getRemountKey?i.getRemountKey(x,R):R;if(A.iteration)return w(A,M,f);const O=Qi({if:A.if,condition:A.condition,conditions:A.conditions},f,l,A.id),L=op();if(A.if&&L?.isEnabled()){const fe=`${M}-if`;L.trackIfCondition(fe,A.if,O,A.name)}if(!O)return[];const q=r[A.name];if(!q)return rr.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${A.name}`),[];const G=y(A.props,f),B=yd(G,A.actions,f,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let K=null;return A.text!==void 0?K=m(A.text,f):A.children&&A.children.length>0&&(K=oo(A.children,f,r,M,i)),L?.isEnabled()&&L.trackRender(A.name),[We.createElement(q,{key:M,...Ra(B)},Ra(K))]})}function Zi(o,e,r,a){let i,l;return r instanceof _n?(i=r,l=a):(i=lp,l=r),i.resolveBindings(o,e,l)}function cw(o,e,r,a){const i=r??lp,l={skipCache:!0,...a};let c;try{c=i.resolveBindings(o.key,e,{skipCache:l.skipCache})?.toString()?.trim()??""}catch(g){rr.warn("resolveClassMap: key 평가 실패:",o.key,g),c=""}let d="";c&&o.variants&&c in o.variants?d=o.variants[c]:o.default&&(d=o.default);const f=[];return o.base?.trim()&&f.push(o.base.trim()),d?.trim()&&f.push(d.trim()),f.join(" ")}function fp(o,e){return function(){return o.apply(e,arguments)}}const{toString:uw}=Object.prototype,{getPrototypeOf:bd}=Object,{iterator:Wl,toStringTag:hp}=Symbol,Yl=(o=>e=>{const r=uw.call(e);return o[r]||(o[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),yr=o=>(o=o.toLowerCase(),e=>Yl(e)===o),Xl=o=>e=>typeof e===o,{isArray:es}=Array,ts=Xl("undefined");function lo(o){return o!==null&&!ts(o)&&o.constructor!==null&&!ts(o.constructor)&&kn(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const gp=yr("ArrayBuffer");function dw(o){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&gp(o.buffer),e}const fw=Xl("string"),kn=Xl("function"),pp=Xl("number"),co=o=>o!==null&&typeof o=="object",hw=o=>o===!0||o===!1,Jl=o=>{if(Yl(o)!=="object")return!1;const e=bd(o);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(hp in o)&&!(Wl in o)},gw=o=>{if(!co(o)||lo(o))return!1;try{return Object.keys(o).length===0&&Object.getPrototypeOf(o)===Object.prototype}catch{return!1}},pw=yr("Date"),mw=yr("File"),yw=yr("Blob"),bw=yr("FileList"),vw=o=>co(o)&&kn(o.pipe),Sw=o=>{let e;return o&&(typeof FormData=="function"&&o instanceof FormData||kn(o.append)&&((e=Yl(o))==="formdata"||e==="object"&&kn(o.toString)&&o.toString()==="[object FormData]"))},ww=yr("URLSearchParams"),[Cw,Ew,_w,Aw]=["ReadableStream","Request","Response","Headers"].map(yr),xw=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function uo(o,e,{allOwnKeys:r=!1}={}){if(o===null||typeof o>"u")return;let a,i;if(typeof o!="object"&&(o=[o]),es(o))for(a=0,i=o.length;a<i;a++)e.call(null,o[a],a,o);else{if(lo(o))return;const l=r?Object.getOwnPropertyNames(o):Object.keys(o),c=l.length;let d;for(a=0;a<c;a++)d=l[a],e.call(null,o[d],d,o)}}function mp(o,e){if(lo(o))return null;e=e.toLowerCase();const r=Object.keys(o);let a=r.length,i;for(;a-- >0;)if(i=r[a],e===i.toLowerCase())return i;return null}const yi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,yp=o=>!ts(o)&&o!==yi;function vd(){const{caseless:o,skipUndefined:e}=yp(this)&&this||{},r={},a=(i,l)=>{const c=o&&mp(r,l)||l;Jl(r[c])&&Jl(i)?r[c]=vd(r[c],i):Jl(i)?r[c]=vd({},i):es(i)?r[c]=i.slice():(!e||!ts(i))&&(r[c]=i)};for(let i=0,l=arguments.length;i<l;i++)arguments[i]&&uo(arguments[i],a);return r}const Tw=(o,e,r,{allOwnKeys:a}={})=>(uo(e,(i,l)=>{r&&kn(i)?o[l]=fp(i,r):o[l]=i},{allOwnKeys:a}),o),kw=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),Rw=(o,e,r,a)=>{o.prototype=Object.create(e.prototype,a),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:e.prototype}),r&&Object.assign(o.prototype,r)},Dw=(o,e,r,a)=>{let i,l,c;const d={};if(e=e||{},o==null)return e;do{for(i=Object.getOwnPropertyNames(o),l=i.length;l-- >0;)c=i[l],(!a||a(c,o,e))&&!d[c]&&(e[c]=o[c],d[c]=!0);o=r!==!1&&bd(o)}while(o&&(!r||r(o,e))&&o!==Object.prototype);return e},Ow=(o,e,r)=>{o=String(o),(r===void 0||r>o.length)&&(r=o.length),r-=e.length;const a=o.indexOf(e,r);return a!==-1&&a===r},Lw=o=>{if(!o)return null;if(es(o))return o;let e=o.length;if(!pp(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=o[e];return r},Mw=(o=>e=>o&&e instanceof o)(typeof Uint8Array<"u"&&bd(Uint8Array)),$w=(o,e)=>{const a=(o&&o[Wl]).call(o);let i;for(;(i=a.next())&&!i.done;){const l=i.value;e.call(o,l[0],l[1])}},Nw=(o,e)=>{let r;const a=[];for(;(r=o.exec(e))!==null;)a.push(r);return a},Iw=yr("HTMLFormElement"),Hw=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,a,i){return a.toUpperCase()+i}),bp=(({hasOwnProperty:o})=>(e,r)=>o.call(e,r))(Object.prototype),jw=yr("RegExp"),vp=(o,e)=>{const r=Object.getOwnPropertyDescriptors(o),a={};uo(r,(i,l)=>{let c;(c=e(i,l,o))!==!1&&(a[l]=c||i)}),Object.defineProperties(o,a)},zw=o=>{vp(o,(e,r)=>{if(kn(o)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const a=o[r];if(kn(a)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Uw=(o,e)=>{const r={},a=i=>{i.forEach(l=>{r[l]=!0})};return es(o)?a(o):a(String(o).split(e)),r},Bw=()=>{},Pw=(o,e)=>o!=null&&Number.isFinite(o=+o)?o:e;function qw(o){return!!(o&&kn(o.append)&&o[hp]==="FormData"&&o[Wl])}const Gw=o=>{const e=new Array(10),r=(a,i)=>{if(co(a)){if(e.indexOf(a)>=0)return;if(lo(a))return a;if(!("toJSON"in a)){e[i]=a;const l=es(a)?[]:{};return uo(a,(c,d)=>{const f=r(c,i+1);!ts(f)&&(l[d]=f)}),e[i]=void 0,l}}return a};return r(o,0)},Vw=yr("AsyncFunction"),Fw=o=>o&&(co(o)||kn(o))&&kn(o.then)&&kn(o.catch),Sp=((o,e)=>o?setImmediate:e?((r,a)=>(yi.addEventListener("message",({source:i,data:l})=>{i===yi&&l===r&&a.length&&a.shift()()},!1),i=>{a.push(i),yi.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",kn(yi.postMessage)),Kw=typeof queueMicrotask<"u"?queueMicrotask.bind(yi):typeof process<"u"&&process.nextTick||Sp,ee={isArray:es,isArrayBuffer:gp,isBuffer:lo,isFormData:Sw,isArrayBufferView:dw,isString:fw,isNumber:pp,isBoolean:hw,isObject:co,isPlainObject:Jl,isEmptyObject:gw,isReadableStream:Cw,isRequest:Ew,isResponse:_w,isHeaders:Aw,isUndefined:ts,isDate:pw,isFile:mw,isBlob:yw,isRegExp:jw,isFunction:kn,isStream:vw,isURLSearchParams:ww,isTypedArray:Mw,isFileList:bw,forEach:uo,merge:vd,extend:Tw,trim:xw,stripBOM:kw,inherits:Rw,toFlatObject:Dw,kindOf:Yl,kindOfTest:yr,endsWith:Ow,toArray:Lw,forEachEntry:$w,matchAll:Nw,isHTMLForm:Iw,hasOwnProperty:bp,hasOwnProp:bp,reduceDescriptors:vp,freezeMethods:zw,toObjectSet:Uw,toCamelCase:Hw,noop:Bw,toFiniteNumber:Pw,findKey:mp,global:yi,isContextDefined:yp,isSpecCompliantForm:qw,toJSONObject:Gw,isAsyncFn:Vw,isThenable:Fw,setImmediate:Sp,asap:Kw,isIterable:o=>o!=null&&kn(o[Wl])};function Ye(o,e,r,a,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),a&&(this.request=a),i&&(this.response=i,this.status=i.status?i.status:null)}ee.inherits(Ye,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ee.toJSONObject(this.config),code:this.code,status:this.status}}});const wp=Ye.prototype,Cp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(o=>{Cp[o]={value:o}}),Object.defineProperties(Ye,Cp),Object.defineProperty(wp,"isAxiosError",{value:!0}),Ye.from=(o,e,r,a,i,l)=>{const c=Object.create(wp);ee.toFlatObject(o,c,function(m){return m!==Error.prototype},g=>g!=="isAxiosError");const d=o&&o.message?o.message:"Error",f=e==null&&o?o.code:e;return Ye.call(c,d,f,r,a,i),o&&c.cause==null&&Object.defineProperty(c,"cause",{value:o,configurable:!0}),c.name=o&&o.name||"Error",l&&Object.assign(c,l),c};const Ww=null;function Sd(o){return ee.isPlainObject(o)||ee.isArray(o)}function Ep(o){return ee.endsWith(o,"[]")?o.slice(0,-2):o}function _p(o,e,r){return o?o.concat(e).map(function(i,l){return i=Ep(i),!r&&l?"["+i+"]":i}).join(r?".":""):e}function Yw(o){return ee.isArray(o)&&!o.some(Sd)}const Xw=ee.toFlatObject(ee,{},null,function(e){return/^is[A-Z]/.test(e)});function Ql(o,e,r){if(!ee.isObject(o))throw new TypeError("target must be an object");e=e||new FormData,r=ee.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(A,x){return!ee.isUndefined(x[A])});const a=r.metaTokens,i=r.visitor||m,l=r.dots,c=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&ee.isSpecCompliantForm(e);if(!ee.isFunction(i))throw new TypeError("visitor must be a function");function g(v){if(v===null)return"";if(ee.isDate(v))return v.toISOString();if(ee.isBoolean(v))return v.toString();if(!f&&ee.isBlob(v))throw new Ye("Blob is not supported. Use a Buffer instead.");return ee.isArrayBuffer(v)||ee.isTypedArray(v)?f&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function m(v,A,x){let R=v;if(v&&!x&&typeof v=="object"){if(ee.endsWith(A,"{}"))A=a?A:A.slice(0,-2),v=JSON.stringify(v);else if(ee.isArray(v)&&Yw(v)||(ee.isFileList(v)||ee.endsWith(A,"[]"))&&(R=ee.toArray(v)))return A=Ep(A),R.forEach(function(O,L){!(ee.isUndefined(O)||O===null)&&e.append(c===!0?_p([A],L,l):c===null?A:A+"[]",g(O))}),!1}return Sd(v)?!0:(e.append(_p(x,A,l),g(v)),!1)}const y=[],w=Object.assign(Xw,{defaultVisitor:m,convertValue:g,isVisitable:Sd});function S(v,A){if(!ee.isUndefined(v)){if(y.indexOf(v)!==-1)throw Error("Circular reference detected in "+A.join("."));y.push(v),ee.forEach(v,function(R,M){(!(ee.isUndefined(R)||R===null)&&i.call(e,R,ee.isString(M)?M.trim():M,A,w))===!0&&S(R,A?A.concat(M):[M])}),y.pop()}}if(!ee.isObject(o))throw new TypeError("data must be an object");return S(o),e}function Ap(o){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(a){return e[a]})}function wd(o,e){this._pairs=[],o&&Ql(o,this,e)}const xp=wd.prototype;xp.append=function(e,r){this._pairs.push([e,r])},xp.toString=function(e){const r=e?function(a){return e.call(this,a,Ap)}:Ap;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Jw(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Tp(o,e,r){if(!e)return o;const a=r&&r.encode||Jw;ee.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let l;if(i?l=i(e,r):l=ee.isURLSearchParams(e)?e.toString():new wd(e,r).toString(a),l){const c=o.indexOf("#");c!==-1&&(o=o.slice(0,c)),o+=(o.indexOf("?")===-1?"?":"&")+l}return o}class kp{constructor(){this.handlers=[]}use(e,r,a){return this.handlers.push({fulfilled:e,rejected:r,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ee.forEach(this.handlers,function(a){a!==null&&e(a)})}}const Rp={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Qw={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:wd,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Cd=typeof window<"u"&&typeof document<"u",Ed=typeof navigator=="object"&&navigator||void 0,Zw=Cd&&(!Ed||["ReactNative","NativeScript","NS"].indexOf(Ed.product)<0),e0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",t0=Cd&&window.location.href||"http://localhost",Sn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Cd,hasStandardBrowserEnv:Zw,hasStandardBrowserWebWorkerEnv:e0,navigator:Ed,origin:t0},Symbol.toStringTag,{value:"Module"})),...Qw};function n0(o,e){return Ql(o,new Sn.classes.URLSearchParams,{visitor:function(r,a,i,l){return Sn.isNode&&ee.isBuffer(r)?(this.append(a,r.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...e})}function r0(o){return ee.matchAll(/\w+|\[(\w*)]/g,o).map(e=>e[0]==="[]"?"":e[1]||e[0])}function a0(o){const e={},r=Object.keys(o);let a;const i=r.length;let l;for(a=0;a<i;a++)l=r[a],e[l]=o[l];return e}function Dp(o){function e(r,a,i,l){let c=r[l++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),f=l>=r.length;return c=!c&&ee.isArray(i)?i.length:c,f?(ee.hasOwnProp(i,c)?i[c]=[i[c],a]:i[c]=a,!d):((!i[c]||!ee.isObject(i[c]))&&(i[c]=[]),e(r,a,i[c],l)&&ee.isArray(i[c])&&(i[c]=a0(i[c])),!d)}if(ee.isFormData(o)&&ee.isFunction(o.entries)){const r={};return ee.forEachEntry(o,(a,i)=>{e(r0(a),i,r,0)}),r}return null}function i0(o,e,r){if(ee.isString(o))try{return(e||JSON.parse)(o),ee.trim(o)}catch(a){if(a.name!=="SyntaxError")throw a}return(r||JSON.stringify)(o)}const fo={transitional:Rp,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const a=r.getContentType()||"",i=a.indexOf("application/json")>-1,l=ee.isObject(e);if(l&&ee.isHTMLForm(e)&&(e=new FormData(e)),ee.isFormData(e))return i?JSON.stringify(Dp(e)):e;if(ee.isArrayBuffer(e)||ee.isBuffer(e)||ee.isStream(e)||ee.isFile(e)||ee.isBlob(e)||ee.isReadableStream(e))return e;if(ee.isArrayBufferView(e))return e.buffer;if(ee.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(l){if(a.indexOf("application/x-www-form-urlencoded")>-1)return n0(e,this.formSerializer).toString();if((d=ee.isFileList(e))||a.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Ql(d?{"files[]":e}:e,f&&new f,this.formSerializer)}}return l||i?(r.setContentType("application/json",!1),i0(e)):e}],transformResponse:[function(e){const r=this.transitional||fo.transitional,a=r&&r.forcedJSONParsing,i=this.responseType==="json";if(ee.isResponse(e)||ee.isReadableStream(e))return e;if(e&&ee.isString(e)&&(a&&!this.responseType||i)){const c=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?Ye.from(d,Ye.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Sn.classes.FormData,Blob:Sn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ee.forEach(["delete","get","head","post","put","patch"],o=>{fo.headers[o]={}});const s0=ee.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),o0=o=>{const e={};let r,a,i;return o&&o.split(`
`).forEach(function(c){i=c.indexOf(":"),r=c.substring(0,i).trim().toLowerCase(),a=c.substring(i+1).trim(),!(!r||e[r]&&s0[r])&&(r==="set-cookie"?e[r]?e[r].push(a):e[r]=[a]:e[r]=e[r]?e[r]+", "+a:a)}),e},Op=Symbol("internals");function ho(o){return o&&String(o).trim().toLowerCase()}function Zl(o){return o===!1||o==null?o:ee.isArray(o)?o.map(Zl):String(o)}function l0(o){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=r.exec(o);)e[a[1]]=a[2];return e}const c0=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function _d(o,e,r,a,i){if(ee.isFunction(a))return a.call(this,e,r);if(i&&(e=r),!!ee.isString(e)){if(ee.isString(a))return e.indexOf(a)!==-1;if(ee.isRegExp(a))return a.test(e)}}function u0(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,a)=>r.toUpperCase()+a)}function d0(o,e){const r=ee.toCamelCase(" "+e);["get","set","has"].forEach(a=>{Object.defineProperty(o,a+r,{value:function(i,l,c){return this[a].call(this,e,i,l,c)},configurable:!0})})}let Rn=class{constructor(e){e&&this.set(e)}set(e,r,a){const i=this;function l(d,f,g){const m=ho(f);if(!m)throw new Error("header name must be a non-empty string");const y=ee.findKey(i,m);(!y||i[y]===void 0||g===!0||g===void 0&&i[y]!==!1)&&(i[y||f]=Zl(d))}const c=(d,f)=>ee.forEach(d,(g,m)=>l(g,m,f));if(ee.isPlainObject(e)||e instanceof this.constructor)c(e,r);else if(ee.isString(e)&&(e=e.trim())&&!c0(e))c(o0(e),r);else if(ee.isObject(e)&&ee.isIterable(e)){let d={},f,g;for(const m of e){if(!ee.isArray(m))throw TypeError("Object iterator must return a key-value pair");d[g=m[0]]=(f=d[g])?ee.isArray(f)?[...f,m[1]]:[f,m[1]]:m[1]}c(d,r)}else e!=null&&l(r,e,a);return this}get(e,r){if(e=ho(e),e){const a=ee.findKey(this,e);if(a){const i=this[a];if(!r)return i;if(r===!0)return l0(i);if(ee.isFunction(r))return r.call(this,i,a);if(ee.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=ho(e),e){const a=ee.findKey(this,e);return!!(a&&this[a]!==void 0&&(!r||_d(this,this[a],a,r)))}return!1}delete(e,r){const a=this;let i=!1;function l(c){if(c=ho(c),c){const d=ee.findKey(a,c);d&&(!r||_d(a,a[d],d,r))&&(delete a[d],i=!0)}}return ee.isArray(e)?e.forEach(l):l(e),i}clear(e){const r=Object.keys(this);let a=r.length,i=!1;for(;a--;){const l=r[a];(!e||_d(this,this[l],l,e,!0))&&(delete this[l],i=!0)}return i}normalize(e){const r=this,a={};return ee.forEach(this,(i,l)=>{const c=ee.findKey(a,l);if(c){r[c]=Zl(i),delete r[l];return}const d=e?u0(l):String(l).trim();d!==l&&delete r[l],r[d]=Zl(i),a[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return ee.forEach(this,(a,i)=>{a!=null&&a!==!1&&(r[i]=e&&ee.isArray(a)?a.join(", "):a)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const a=new this(e);return r.forEach(i=>a.set(i)),a}static accessor(e){const a=(this[Op]=this[Op]={accessors:{}}).accessors,i=this.prototype;function l(c){const d=ho(c);a[d]||(d0(i,c),a[d]=!0)}return ee.isArray(e)?e.forEach(l):l(e),this}};Rn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ee.reduceDescriptors(Rn.prototype,({value:o},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>o,set(a){this[r]=a}}}),ee.freezeMethods(Rn);function Ad(o,e){const r=this||fo,a=e||r,i=Rn.from(a.headers);let l=a.data;return ee.forEach(o,function(d){l=d.call(r,l,i.normalize(),e?e.status:void 0)}),i.normalize(),l}function Lp(o){return!!(o&&o.__CANCEL__)}function ns(o,e,r){Ye.call(this,o??"canceled",Ye.ERR_CANCELED,e,r),this.name="CanceledError"}ee.inherits(ns,Ye,{__CANCEL__:!0});function Mp(o,e,r){const a=r.config.validateStatus;!r.status||!a||a(r.status)?o(r):e(new Ye("Request failed with status code "+r.status,[Ye.ERR_BAD_REQUEST,Ye.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function f0(o){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return e&&e[1]||""}function h0(o,e){o=o||10;const r=new Array(o),a=new Array(o);let i=0,l=0,c;return e=e!==void 0?e:1e3,function(f){const g=Date.now(),m=a[l];c||(c=g),r[i]=f,a[i]=g;let y=l,w=0;for(;y!==i;)w+=r[y++],y=y%o;if(i=(i+1)%o,i===l&&(l=(l+1)%o),g-c<e)return;const S=m&&g-m;return S?Math.round(w*1e3/S):void 0}}function g0(o,e){let r=0,a=1e3/e,i,l;const c=(g,m=Date.now())=>{r=m,i=null,l&&(clearTimeout(l),l=null),o(...g)};return[(...g)=>{const m=Date.now(),y=m-r;y>=a?c(g,m):(i=g,l||(l=setTimeout(()=>{l=null,c(i)},a-y)))},()=>i&&c(i)]}const ec=(o,e,r=3)=>{let a=0;const i=h0(50,250);return g0(l=>{const c=l.loaded,d=l.lengthComputable?l.total:void 0,f=c-a,g=i(f),m=c<=d;a=c;const y={loaded:c,total:d,progress:d?c/d:void 0,bytes:f,rate:g||void 0,estimated:g&&d&&m?(d-c)/g:void 0,event:l,lengthComputable:d!=null,[e?"download":"upload"]:!0};o(y)},r)},$p=(o,e)=>{const r=o!=null;return[a=>e[0]({lengthComputable:r,total:o,loaded:a}),e[1]]},Np=o=>(...e)=>ee.asap(()=>o(...e)),p0=Sn.hasStandardBrowserEnv?((o,e)=>r=>(r=new URL(r,Sn.origin),o.protocol===r.protocol&&o.host===r.host&&(e||o.port===r.port)))(new URL(Sn.origin),Sn.navigator&&/(msie|trident)/i.test(Sn.navigator.userAgent)):()=>!0,m0=Sn.hasStandardBrowserEnv?{write(o,e,r,a,i,l){const c=[o+"="+encodeURIComponent(e)];ee.isNumber(r)&&c.push("expires="+new Date(r).toGMTString()),ee.isString(a)&&c.push("path="+a),ee.isString(i)&&c.push("domain="+i),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read(o){const e=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(o){this.write(o,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function y0(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function b0(o,e){return e?o.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):o}function Ip(o,e,r){let a=!y0(e);return o&&(a||r==!1)?b0(o,e):e}const Hp=o=>o instanceof Rn?{...o}:o;function bi(o,e){e=e||{};const r={};function a(g,m,y,w){return ee.isPlainObject(g)&&ee.isPlainObject(m)?ee.merge.call({caseless:w},g,m):ee.isPlainObject(m)?ee.merge({},m):ee.isArray(m)?m.slice():m}function i(g,m,y,w){if(ee.isUndefined(m)){if(!ee.isUndefined(g))return a(void 0,g,y,w)}else return a(g,m,y,w)}function l(g,m){if(!ee.isUndefined(m))return a(void 0,m)}function c(g,m){if(ee.isUndefined(m)){if(!ee.isUndefined(g))return a(void 0,g)}else return a(void 0,m)}function d(g,m,y){if(y in e)return a(g,m);if(y in o)return a(void 0,g)}const f={url:l,method:l,data:l,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(g,m,y)=>i(Hp(g),Hp(m),y,!0)};return ee.forEach(Object.keys({...o,...e}),function(m){const y=f[m]||i,w=y(o[m],e[m],m);ee.isUndefined(w)&&y!==d||(r[m]=w)}),r}const jp=o=>{const e=bi({},o);let{data:r,withXSRFToken:a,xsrfHeaderName:i,xsrfCookieName:l,headers:c,auth:d}=e;if(e.headers=c=Rn.from(c),e.url=Tp(Ip(e.baseURL,e.url,e.allowAbsoluteUrls),o.params,o.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),ee.isFormData(r)){if(Sn.hasStandardBrowserEnv||Sn.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(ee.isFunction(r.getHeaders)){const f=r.getHeaders(),g=["content-type","content-length"];Object.entries(f).forEach(([m,y])=>{g.includes(m.toLowerCase())&&c.set(m,y)})}}if(Sn.hasStandardBrowserEnv&&(a&&ee.isFunction(a)&&(a=a(e)),a||a!==!1&&p0(e.url))){const f=i&&l&&m0.read(l);f&&c.set(i,f)}return e},v0=typeof XMLHttpRequest<"u"&&function(o){return new Promise(function(r,a){const i=jp(o);let l=i.data;const c=Rn.from(i.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:g}=i,m,y,w,S,v;function A(){S&&S(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let x=new XMLHttpRequest;x.open(i.method.toUpperCase(),i.url,!0),x.timeout=i.timeout;function R(){if(!x)return;const O=Rn.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),q={data:!d||d==="text"||d==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:O,config:o,request:x};Mp(function(B){r(B),A()},function(B){a(B),A()},q),x=null}"onloadend"in x?x.onloadend=R:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(R)},x.onabort=function(){x&&(a(new Ye("Request aborted",Ye.ECONNABORTED,o,x)),x=null)},x.onerror=function(L){const q=L&&L.message?L.message:"Network Error",G=new Ye(q,Ye.ERR_NETWORK,o,x);G.event=L||null,a(G),x=null},x.ontimeout=function(){let L=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const q=i.transitional||Rp;i.timeoutErrorMessage&&(L=i.timeoutErrorMessage),a(new Ye(L,q.clarifyTimeoutError?Ye.ETIMEDOUT:Ye.ECONNABORTED,o,x)),x=null},l===void 0&&c.setContentType(null),"setRequestHeader"in x&&ee.forEach(c.toJSON(),function(L,q){x.setRequestHeader(q,L)}),ee.isUndefined(i.withCredentials)||(x.withCredentials=!!i.withCredentials),d&&d!=="json"&&(x.responseType=i.responseType),g&&([w,v]=ec(g,!0),x.addEventListener("progress",w)),f&&x.upload&&([y,S]=ec(f),x.upload.addEventListener("progress",y),x.upload.addEventListener("loadend",S)),(i.cancelToken||i.signal)&&(m=O=>{x&&(a(!O||O.type?new ns(null,o,x):O),x.abort(),x=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const M=f0(i.url);if(M&&Sn.protocols.indexOf(M)===-1){a(new Ye("Unsupported protocol "+M+":",Ye.ERR_BAD_REQUEST,o));return}x.send(l||null)})},S0=(o,e)=>{const{length:r}=o=o?o.filter(Boolean):[];if(e||r){let a=new AbortController,i;const l=function(g){if(!i){i=!0,d();const m=g instanceof Error?g:this.reason;a.abort(m instanceof Ye?m:new ns(m instanceof Error?m.message:m))}};let c=e&&setTimeout(()=>{c=null,l(new Ye(`timeout ${e} of ms exceeded`,Ye.ETIMEDOUT))},e);const d=()=>{o&&(c&&clearTimeout(c),c=null,o.forEach(g=>{g.unsubscribe?g.unsubscribe(l):g.removeEventListener("abort",l)}),o=null)};o.forEach(g=>g.addEventListener("abort",l));const{signal:f}=a;return f.unsubscribe=()=>ee.asap(d),f}},w0=function*(o,e){let r=o.byteLength;if(r<e){yield o;return}let a=0,i;for(;a<r;)i=a+e,yield o.slice(a,i),a=i},C0=async function*(o,e){for await(const r of E0(o))yield*w0(r,e)},E0=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const e=o.getReader();try{for(;;){const{done:r,value:a}=await e.read();if(r)break;yield a}}finally{await e.cancel()}},zp=(o,e,r,a)=>{const i=C0(o,e);let l=0,c,d=f=>{c||(c=!0,a&&a(f))};return new ReadableStream({async pull(f){try{const{done:g,value:m}=await i.next();if(g){d(),f.close();return}let y=m.byteLength;if(r){let w=l+=y;r(w)}f.enqueue(new Uint8Array(m))}catch(g){throw d(g),g}},cancel(f){return d(f),i.return()}},{highWaterMark:2})},Up=64*1024,{isFunction:tc}=ee,_0=(({Request:o,Response:e})=>({Request:o,Response:e}))(ee.global),{ReadableStream:Bp,TextEncoder:Pp}=ee.global,qp=(o,...e)=>{try{return!!o(...e)}catch{return!1}},A0=o=>{o=ee.merge.call({skipUndefined:!0},_0,o);const{fetch:e,Request:r,Response:a}=o,i=e?tc(e):typeof fetch=="function",l=tc(r),c=tc(a);if(!i)return!1;const d=i&&tc(Bp),f=i&&(typeof Pp=="function"?(v=>A=>v.encode(A))(new Pp):async v=>new Uint8Array(await new r(v).arrayBuffer())),g=l&&d&&qp(()=>{let v=!1;const A=new r(Sn.origin,{body:new Bp,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!A}),m=c&&d&&qp(()=>ee.isReadableStream(new a("").body)),y={stream:m&&(v=>v.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!y[v]&&(y[v]=(A,x)=>{let R=A&&A[v];if(R)return R.call(A);throw new Ye(`Response type '${v}' is not supported`,Ye.ERR_NOT_SUPPORT,x)})});const w=async v=>{if(v==null)return 0;if(ee.isBlob(v))return v.size;if(ee.isSpecCompliantForm(v))return(await new r(Sn.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(ee.isArrayBufferView(v)||ee.isArrayBuffer(v))return v.byteLength;if(ee.isURLSearchParams(v)&&(v=v+""),ee.isString(v))return(await f(v)).byteLength},S=async(v,A)=>{const x=ee.toFiniteNumber(v.getContentLength());return x??w(A)};return async v=>{let{url:A,method:x,data:R,signal:M,cancelToken:O,timeout:L,onDownloadProgress:q,onUploadProgress:G,responseType:B,headers:K,withCredentials:fe="same-origin",fetchOptions:Ce}=jp(v),ke=e||fetch;B=B?(B+"").toLowerCase():"text";let Ue=S0([M,O&&O.toAbortSignal()],L),Pe=null;const qe=Ue&&Ue.unsubscribe&&(()=>{Ue.unsubscribe()});let wt;try{if(G&&g&&x!=="get"&&x!=="head"&&(wt=await S(K,R))!==0){let H=new r(A,{method:"POST",body:R,duplex:"half"}),T;if(ee.isFormData(R)&&(T=H.headers.get("content-type"))&&K.setContentType(T),H.body){const[ge,de]=$p(wt,ec(Np(G)));R=zp(H.body,Up,ge,de)}}ee.isString(fe)||(fe=fe?"include":"omit");const J=l&&"credentials"in r.prototype,he={...Ce,signal:Ue,method:x.toUpperCase(),headers:K.normalize().toJSON(),body:R,duplex:"half",credentials:J?fe:void 0};Pe=l&&new r(A,he);let Ee=await(l?ke(Pe,Ce):ke(A,he));const Z=m&&(B==="stream"||B==="response");if(m&&(q||Z&&qe)){const H={};["status","statusText","headers"].forEach(me=>{H[me]=Ee[me]});const T=ee.toFiniteNumber(Ee.headers.get("content-length")),[ge,de]=q&&$p(T,ec(Np(q),!0))||[];Ee=new a(zp(Ee.body,Up,ge,()=>{de&&de(),qe&&qe()}),H)}B=B||"text";let pe=await y[ee.findKey(y,B)||"text"](Ee,v);return!Z&&qe&&qe(),await new Promise((H,T)=>{Mp(H,T,{data:pe,headers:Rn.from(Ee.headers),status:Ee.status,statusText:Ee.statusText,config:v,request:Pe})})}catch(J){throw qe&&qe(),J&&J.name==="TypeError"&&/Load failed|fetch/i.test(J.message)?Object.assign(new Ye("Network Error",Ye.ERR_NETWORK,v,Pe),{cause:J.cause||J}):Ye.from(J,J&&J.code,v,Pe)}}},x0=new Map,Gp=o=>{let e=o?o.env:{};const{fetch:r,Request:a,Response:i}=e,l=[a,i,r];let c=l.length,d=c,f,g,m=x0;for(;d--;)f=l[d],g=m.get(f),g===void 0&&m.set(f,g=d?new Map:A0(e)),m=g;return g};Gp();const xd={http:Ww,xhr:v0,fetch:{get:Gp}};ee.forEach(xd,(o,e)=>{if(o){try{Object.defineProperty(o,"name",{value:e})}catch{}Object.defineProperty(o,"adapterName",{value:e})}});const Vp=o=>`- ${o}`,T0=o=>ee.isFunction(o)||o===null||o===!1,Fp={getAdapter:(o,e)=>{o=ee.isArray(o)?o:[o];const{length:r}=o;let a,i;const l={};for(let c=0;c<r;c++){a=o[c];let d;if(i=a,!T0(a)&&(i=xd[(d=String(a)).toLowerCase()],i===void 0))throw new Ye(`Unknown adapter '${d}'`);if(i&&(ee.isFunction(i)||(i=i.get(e))))break;l[d||"#"+c]=i}if(!i){const c=Object.entries(l).map(([f,g])=>`adapter ${f} `+(g===!1?"is not supported by the environment":"is not available in the build"));let d=r?c.length>1?`since :
`+c.map(Vp).join(`
`):" "+Vp(c[0]):"as no adapter specified";throw new Ye("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return i},adapters:xd};function Td(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new ns(null,o)}function Kp(o){return Td(o),o.headers=Rn.from(o.headers),o.data=Ad.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",!1),Fp.getAdapter(o.adapter||fo.adapter,o)(o).then(function(a){return Td(o),a.data=Ad.call(o,o.transformResponse,a),a.headers=Rn.from(a.headers),a},function(a){return Lp(a)||(Td(o),a&&a.response&&(a.response.data=Ad.call(o,o.transformResponse,a.response),a.response.headers=Rn.from(a.response.headers))),Promise.reject(a)})}const Wp="1.12.2",nc={};["object","boolean","number","function","string","symbol"].forEach((o,e)=>{nc[o]=function(a){return typeof a===o||"a"+(e<1?"n ":" ")+o}});const Yp={};nc.transitional=function(e,r,a){function i(l,c){return"[Axios v"+Wp+"] Transitional option '"+l+"'"+c+(a?". "+a:"")}return(l,c,d)=>{if(e===!1)throw new Ye(i(c," has been removed"+(r?" in "+r:"")),Ye.ERR_DEPRECATED);return r&&!Yp[c]&&(Yp[c]=!0,console.warn(i(c," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(l,c,d):!0}},nc.spelling=function(e){return(r,a)=>(console.warn(`${a} is likely a misspelling of ${e}`),!0)};function k0(o,e,r){if(typeof o!="object")throw new Ye("options must be an object",Ye.ERR_BAD_OPTION_VALUE);const a=Object.keys(o);let i=a.length;for(;i-- >0;){const l=a[i],c=e[l];if(c){const d=o[l],f=d===void 0||c(d,l,o);if(f!==!0)throw new Ye("option "+l+" must be "+f,Ye.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Ye("Unknown option "+l,Ye.ERR_BAD_OPTION)}}const rc={assertOptions:k0,validators:nc},Hr=rc.validators;let vi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new kp,response:new kp}}async request(e,r){try{return await this._request(e,r)}catch(a){if(a instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const l=i.stack?i.stack.replace(/^.+\n/,""):"";try{a.stack?l&&!String(a.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(a.stack+=`
`+l):a.stack=l}catch{}}throw a}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=bi(this.defaults,r);const{transitional:a,paramsSerializer:i,headers:l}=r;a!==void 0&&rc.assertOptions(a,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),i!=null&&(ee.isFunction(i)?r.paramsSerializer={serialize:i}:rc.assertOptions(i,{encode:Hr.function,serialize:Hr.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),rc.assertOptions(r,{baseUrl:Hr.spelling("baseURL"),withXsrfToken:Hr.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let c=l&&ee.merge(l.common,l[r.method]);l&&ee.forEach(["delete","get","head","post","put","patch","common"],v=>{delete l[v]}),r.headers=Rn.concat(c,l);const d=[];let f=!0;this.interceptors.request.forEach(function(A){typeof A.runWhen=="function"&&A.runWhen(r)===!1||(f=f&&A.synchronous,d.unshift(A.fulfilled,A.rejected))});const g=[];this.interceptors.response.forEach(function(A){g.push(A.fulfilled,A.rejected)});let m,y=0,w;if(!f){const v=[Kp.bind(this),void 0];for(v.unshift(...d),v.push(...g),w=v.length,m=Promise.resolve(r);y<w;)m=m.then(v[y++],v[y++]);return m}w=d.length;let S=r;for(;y<w;){const v=d[y++],A=d[y++];try{S=v(S)}catch(x){A.call(this,x);break}}try{m=Kp.call(this,S)}catch(v){return Promise.reject(v)}for(y=0,w=g.length;y<w;)m=m.then(g[y++],g[y++]);return m}getUri(e){e=bi(this.defaults,e);const r=Ip(e.baseURL,e.url,e.allowAbsoluteUrls);return Tp(r,e.params,e.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(e){vi.prototype[e]=function(r,a){return this.request(bi(a||{},{method:e,url:r,data:(a||{}).data}))}}),ee.forEach(["post","put","patch"],function(e){function r(a){return function(l,c,d){return this.request(bi(d||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}vi.prototype[e]=r(),vi.prototype[e+"Form"]=r(!0)});let R0=class $S{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(l){r=l});const a=this;this.promise.then(i=>{if(!a._listeners)return;let l=a._listeners.length;for(;l-- >0;)a._listeners[l](i);a._listeners=null}),this.promise.then=i=>{let l;const c=new Promise(d=>{a.subscribe(d),l=d}).then(i);return c.cancel=function(){a.unsubscribe(l)},c},e(function(l,c,d){a.reason||(a.reason=new ns(l,c,d),r(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=a=>{e.abort(a)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new $S(function(i){e=i}),cancel:e}}};function D0(o){return function(r){return o.apply(null,r)}}function O0(o){return ee.isObject(o)&&o.isAxiosError===!0}const kd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(kd).forEach(([o,e])=>{kd[e]=o});function Xp(o){const e=new vi(o),r=fp(vi.prototype.request,e);return ee.extend(r,vi.prototype,e,{allOwnKeys:!0}),ee.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return Xp(bi(o,i))},r}const Gt=Xp(fo);Gt.Axios=vi,Gt.CanceledError=ns,Gt.CancelToken=R0,Gt.isCancel=Lp,Gt.VERSION=Wp,Gt.toFormData=Ql,Gt.AxiosError=Ye,Gt.Cancel=Gt.CanceledError,Gt.all=function(e){return Promise.all(e)},Gt.spread=D0,Gt.isAxiosError=O0,Gt.mergeConfig=bi,Gt.AxiosHeaders=Rn,Gt.formToJSON=o=>Dp(ee.isHTMLForm(o)?new FormData(o):o),Gt.getAdapter=Fp.getAdapter,Gt.HttpStatusCode=kd,Gt.default=Gt;const{Axios:Jx,AxiosError:Qx,CanceledError:Zx,isCancel:eT,CancelToken:tT,VERSION:nT,all:rT,Cancel:aT,isAxiosError:iT,spread:sT,toFormData:oT,AxiosHeaders:lT,HttpStatusCode:cT,formToJSON:uT,getAdapter:dT,mergeConfig:fT}=Gt,Rd="g7.identity.redirectStash",ac=ut("IdentityGuardInterceptor");class mt{static setLauncher(e){this.launcher=e}static hasLauncher(){return this.launcher!==null}static markDomainNoticeShown(){this.domainNoticeShown=!0}static consumeDomainNoticeShown(){const e=this.domainNoticeShown;return this.domainNoticeShown=!1,e}static resolveDeferred(e){const r=this.deferredResolver;if(!r){ac.warn("IdentityGuardInterceptor.resolveDeferred 호출됐지만 대기 중인 launcher 가 없습니다. 모달이 launcher 외부에서 열렸는지 확인하세요.");return}this.deferredResolver=null,r(e)}static createDeferred(){if(this.deferredResolver){const e=this.deferredResolver;this.deferredResolver=null,e({status:"cancelled"})}return new Promise(e=>{this.deferredResolver=e})}static isIdentityRequired(e,r){return e===428&&typeof r=="object"&&r!==null&&r.error_code==="identity_verification_required"}static async handle(e,r,a){this.domainNoticeShown=!1;const i=this.launcher??M0,c=!!(a&&(a.email||a.phone))?{...e.verification,target:a}:e.verification,d=await i(c);if(d.status!=="verified")return null;const f=c.return_request;if(!f)return null;const g=L0(f.url,d.token);return fetch(g,{method:f.method,headers:r?.headers??{Accept:"application/json","Content-Type":"application/json"},body:r?.body,credentials:r?.credentials??"same-origin"})}static redirectExternally(e){const r=e.redirect_url;if(!r)return ac.error("redirectExternally 호출 시 verification.redirect_url 이 없습니다. payload:",e),Promise.resolve({status:"failed",failureCode:"MISSING_REDIRECT_URL",reason:"verification.redirect_url is required for external_redirect flow"});if(typeof window<"u"){const a={return_url:window.location.href,payload:e,stashed_at:Date.now()};try{window.sessionStorage?.setItem(Rd,JSON.stringify(a))}catch(i){ac.warn("sessionStorage 접근 실패 — stash 없이 redirect 합니다.",i)}window.location.href=r}return new Promise(()=>{})}static reset(){if(this.deferredResolver){const e=this.deferredResolver;this.deferredResolver=null;try{e({status:"cancelled"})}catch{}}this.launcher=null,this.domainNoticeShown=!1}}$(mt,"launcher",null),$(mt,"deferredResolver",null),$(mt,"domainNoticeShown",!1);function L0(o,e){if(!e)return o;try{const r=typeof window<"u"?window.location.origin:"http://localhost",a=new URL(o,r);return a.searchParams.set("verification_token",e),/^https?:\/\//i.test(o)?a.toString():`${a.pathname}${a.search}${a.hash}`}catch{const r=o.includes("?")?"&":"?";return`${o}${r}verification_token=${encodeURIComponent(e)}`}}const M0=async o=>{if(typeof window>"u")return{status:"cancelled"};if(o.render_hint==="external_redirect"||o.redirect_url)return mt.redirectExternally(o);const e=window.G7Core;if(!e?.dispatch)return console.error("[IdentityGuardInterceptor] defaultLauncher: G7Core 가 초기화되지 않아 본인인증 흐름을 시작할 수 없습니다."),{status:"failed",failureCode:"G7_NOT_READY"};try{await e.dispatch({handler:"toast",params:{message:"본인 확인이 필요합니다.",variant:"warning"}})}catch{}const r=window.location.href,a={return_url:r,payload:o,stashed_at:Date.now()};try{window.sessionStorage?.setItem(Rd,JSON.stringify(a))}catch{}const i=`/identity/challenge?return=${encodeURIComponent(r)}`;try{await e.dispatch({handler:"navigate",params:{path:i}})}catch(l){ac.warn("navigate 실패 — window.location 으로 폴백",l),window.location.href=i}return new Promise(()=>{})},$0=ut("ApiClient");function Dd(){return typeof window<"u"&&window.__G7_DEVTOOLS__?window.__G7_DEVTOOLS__:null}class N0{constructor(e={}){$(this,"client");$(this,"config");$(this,"TOKEN_KEY","auth_token");this.config={baseURL:e.baseURL||"/api",timeout:e.timeout||3e4,onTokenExpired:e.onTokenExpired,onUnauthorized:e.onUnauthorized,onError:e.onError},this.client=Gt.create({baseURL:this.config.baseURL,timeout:this.config.timeout,headers:{"Content-Type":"application/json",Accept:"application/json"},paramsSerializer:{serialize:r=>{const a=[];for(const[i,l]of Object.entries(r))if(l!=null)if(Array.isArray(l)){const c=i.endsWith("[]")?i:`${i}[]`;for(const d of l)a.push(`${encodeURIComponent(c)}=${encodeURIComponent(String(d))}`)}else a.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(l))}`);return a.join("&")}}}),this.setupInterceptors()}setToken(e){typeof window<"u"&&localStorage.setItem(this.TOKEN_KEY,e)}getToken(){return typeof window<"u"?localStorage.getItem(this.TOKEN_KEY):null}removeToken(){typeof window<"u"&&localStorage.removeItem(this.TOKEN_KEY)}setupInterceptors(){this.client.interceptors.request.use(e=>{e.url?.startsWith("/api")&&e.baseURL==="/api"&&(e.baseURL="");const r=this.getToken();if(r&&e.headers&&(e.headers.Authorization=`Bearer ${r}`),typeof window<"u"&&e.headers){const i=localStorage.getItem("g7_locale");i&&(e.headers["Accept-Language"]=i)}const a=Dd();if(a?.isEnabled()){const i=this.buildFullUrl(e),l=(e.method||"GET").toUpperCase(),c=a.trackRequest(i,l,{requestBody:e.data});e._devToolsRequestId=c}return e},e=>Promise.reject(e)),this.client.interceptors.response.use(e=>{const r=e.config,a=r._devToolsRequestId;if(a){const i=Dd();i?.isEnabled()&&i.completeRequest(a,e.status,e.data),r._devToolsRequestId=null}return e},async e=>{const r=e.config,a=r?.url||"",l=["/auth/","/layouts/"].some(c=>a.includes(c));if(e.response?.status===401&&!r?._retry&&!l){if(r._retry=!0,await br.getInstance().refreshToken()){const f=this.getToken();return f&&(r.headers.Authorization=`Bearer ${f}`),r._devToolsRequestId=null,this.client(r)}return this.completeDevToolsRequest(r,e),this.removeToken(),this.config.onUnauthorized&&this.config.onUnauthorized(),Promise.reject(e)}if(e.response?.status===401&&l)return this.completeDevToolsRequest(r,e),Promise.reject(e);if(mt.isIdentityRequired(e.response?.status,e.response?.data)){this.completeDevToolsRequest(r,e);const c={},d=r?.headers??{};for(const[w,S]of Object.entries(d))typeof S=="string"&&(c[w]=S);let f;r?.data!==void 0&&r?.data!==null&&(f=typeof r.data=="string"?r.data:JSON.stringify(r.data),c["Content-Type"]=c["Content-Type"]??"application/json");const g=r?.identity_target,m=await mt.handle(e.response.data,{headers:c,body:f,credentials:"same-origin"},g);if(!m)return Promise.reject(e);let y=null;try{y=await m.json()}catch{y=null}return m.ok?{...e.response,status:m.status,data:y}:Promise.reject(Object.assign(new Error("replay failed"),{response:{status:m.status,data:y}}))}return e.response?.status===403?(this.completeDevToolsRequest(r,e),this.callOnError(e),Promise.reject(e)):(this.completeDevToolsRequest(r,e),e.response&&this.callOnError(e),Promise.reject(e))})}async get(e,r){return(await this.client.get(e,r)).data}async post(e,r,a){return(await this.client.post(e,r,a)).data}async put(e,r,a){return(await this.client.put(e,r,a)).data}async patch(e,r,a){return(await this.client.patch(e,r,a)).data}async delete(e,r){return(await this.client.delete(e,r)).data}getInstance(){return this.client}setOnUnauthorized(e){this.config.onUnauthorized=e}setOnError(e){this.config.onError=e}completeDevToolsRequest(e,r){if(!e?._devToolsRequestId)return;const a=Dd();if(!a?.isEnabled())return;const i=e._devToolsRequestId;e._devToolsRequestId=null,r.response?a.completeRequest(i,r.response.status,r.response.data):r.request?a.failRequest(i,r.message||"Network error"):a.failRequest(i,r.message||"Request error")}buildFullUrl(e){let r=e.url||"";if(e.baseURL&&!r.startsWith("http")&&(r=`${e.baseURL}${r.startsWith("/")?"":"/"}${r}`),e.params&&typeof e.params=="object"){const a=e.params,i=[];for(const[l,c]of Object.entries(a))if(c!=null)if(Array.isArray(c)){const d=l.endsWith("[]")?l:`${l}[]`;for(const f of c)i.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(f))}`)}else i.push(`${encodeURIComponent(l)}=${encodeURIComponent(String(c))}`);i.length>0&&(r+=(r.includes("?")?"&":"?")+i.join("&"))}return r}callOnError(e){if(!this.config.onError)return;const r={status:e.response?.status||0,message:e.response?.data?.message||e.message||"Unknown error",data:e.response?.data,statusText:e.response?.statusText};try{this.config.onError(r)}catch(a){$0.error("Error in onError handler:",a)}}}let Od=null;function jr(){return Od||(Od=new N0),Od}const go=ut("AuthManager");function rs(o,e,r,a){try{window.G7Core?.devTools?.trackAuthEvent?.(o,e,r,a)}catch{}}const ic={admin:{type:"admin",loginPath:"/admin/login",defaultPath:"/admin",userEndpoint:"/admin/auth/user",loginEndpoint:"/auth/admin/login",logoutEndpoint:"/admin/auth/logout",refreshEndpoint:"/admin/auth/refresh"},user:{type:"user",loginPath:"/login",defaultPath:"/",userEndpoint:"/auth/user",loginEndpoint:"/auth/login",logoutEndpoint:"/auth/logout",refreshEndpoint:"/auth/refresh"}},Ar=class Ar{constructor(){$(this,"state");$(this,"config");$(this,"isRefreshing",!1);$(this,"refreshPromise",null);$(this,"eventHandlers",new Map);this.state={isAuthenticated:!1,user:null,type:null},this.config=new Map,this.config.set("admin",ic.admin),this.config.set("user",ic.user)}static getInstance(){return Ar.instance||(Ar.instance=new Ar),Ar.instance}on(e,r){this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e).push(r)}emit(e,...r){const a=this.eventHandlers.get(e);a&&a.forEach(i=>i(...r))}isAuthenticated(){return this.state.isAuthenticated}getUser(){return this.state.user}getAuthType(){return this.state.type}async checkAuth(e){const r=jr();if(!r.getToken())return this.clearState(),!1;const i=this.config.get(e);if(!i)return go.error(`Unknown auth type: ${e}`),!1;try{const l=await r.get(i.userEndpoint);return l.success&&l.data?(this.state={isAuthenticated:!0,user:l.data,type:e},this.emit("authStateChange",this.state),!0):(this.clearState(),!1)}catch(l){return l.response?.status===401&&await this.refreshToken()?this.checkAuth(e):(this.clearState(),!1)}}async preloadAuth(e){try{return await this.checkAuth(e)}catch(r){return go.warn(`Preload auth failed for type ${e}:`,r),!1}}async login(e,r,a){const i=jr();if(!this.config.get(e))throw new Error(`Unknown auth type: ${e}`);const c=e==="admin"?ic.admin.loginEndpoint:ic.user.loginEndpoint;try{const d=a?.headers?{headers:a.headers}:void 0,f=await i.post(c,r,d);if(f.success&&f.data){i.setToken(f.data.token);const g=f.data.user.language,m=localStorage.getItem(Ar.LOCALE_STORAGE_KEY),y=g&&g!==m;if(g)try{localStorage.setItem(Ar.LOCALE_STORAGE_KEY,g)}catch(w){go.warn("Failed to save user language to localStorage:",w)}return this.state={isAuthenticated:!0,user:f.data.user,type:e},this.emit("login",this.state),this.emit("authStateChange",this.state),rs("login",!0,void 0,{userId:f.data.user.uuid,email:f.data.user.email,type:e}),y&&window.__templateApp&&window.__templateApp.changeLocale(g),f.data.user}throw new Error("Login failed")}catch(d){this.clearState();const f=d.response?.data?.message,g=new Error(f||d.message||"Login failed");throw g.response=d.response,g.status=d.response?.status,rs("login",!1,g.message,{type:e,status:d.response?.status}),g}}async logout(){const e=jr(),r=this.state.type?this.config.get(this.state.type):null;try{r&&await e.post(r.logoutEndpoint)}catch(a){go.warn("Logout API call failed:",a)}finally{e.removeToken();const a={...this.state};if(this.clearState(),this.emit("logout",a),this.emit("authStateChange",this.state),rs("logout",!0,void 0,{previousType:a.type}),r&&a.type){const i=window.location.pathname+window.location.search;window.location.href=this.getLoginRedirectUrl(a.type,i)}}}async refreshToken(){if(this.isRefreshing&&this.refreshPromise)return this.refreshPromise;this.isRefreshing=!0,this.refreshPromise=this.doRefreshToken();try{return await this.refreshPromise}finally{this.isRefreshing=!1,this.refreshPromise=null}}async doRefreshToken(){const e=this.state.type;if(!e)return!1;const r=this.config.get(e);if(!r)return!1;const a=jr();try{const i=await a.post(r.refreshEndpoint);return i.success&&i.data?.token?(a.setToken(i.data.token),this.emit("tokenRefreshed"),rs("token-refresh",!0,void 0,{type:e}),!0):(rs("token-refresh",!1,"No token in response",{type:e}),!1)}catch(i){return go.error("Token refresh failed:",i),rs("token-refresh",!1,i instanceof Error?i.message:"Unknown error",{type:e}),!1}}getLoginRedirectUrl(e,r,a){const i=this.config.get(e);if(!i)return"/login";const l=encodeURIComponent(r);let c=`${i.loginPath}?redirect=${l}`;return a&&(c+=`&reason=${encodeURIComponent(a)}`),c}updateConfig(e,r){if(r.loginPath!==void 0){const i=r.loginPath;if(!i.startsWith("/")||i.startsWith("//"))throw new Error(`AuthManager.updateConfig: loginPath must be a same-origin path starting with '/' (got: ${i})`)}const a=this.config.get(e);a&&this.config.set(e,{...a,...r})}getRedirectUrl(e){const a=this.config.get(e)?.defaultPath||"/",l=new URLSearchParams(window.location.search).get("redirect");if(l)try{const c=decodeURIComponent(l);if(c.startsWith("/"))return c}catch{}return a}getConfig(e){return this.config.get(e)}clearState(){this.state={isAuthenticated:!1,user:null,type:null}}static resetInstance(){Ar.instance=null}};$(Ar,"instance"),$(Ar,"LOCALE_STORAGE_KEY","g7_locale");let br=Ar;const Jp={401:{handler:"navigate",params:{path:"{{auth.loginPath}}"}},403:{handler:"toast",params:{type:"error",message:"{{error.message}}"}},404:{handler:"toast",params:{type:"error",message:"{{error.message}}"}},422:{handler:"toast",params:{type:"error",message:"{{error.message}}"}},default:{handler:"toast",params:{type:"error",message:"{{error.message}}"}}},Zr={findHandler(o,e){if(o){if(o[e])return o[e];if(o[String(e)])return o[String(e)];if(o.default)return o.default}},normalizeOnError(o){return o?Array.isArray(o)?o:[o]:[]},injectErrorCode(o,e,r){if(o.handler!=="showErrorPage"||o.params?.errorCode!==void 0)return o;const a=typeof e=="string"?parseInt(e,10):e,i=isNaN(a)?r:a;return i===void 0?o:{...o,params:{...o.params,errorCode:i}}}},vr=ut("ErrorHandlingResolver"),Na=class Na{constructor(){$(this,"templateErrorHandling",null);$(this,"layoutErrorHandling",null);$(this,"executeAction",null)}static getInstance(){return Na.instance||(Na.instance=new Na),Na.instance}static resetInstance(){Na.instance=null}setTemplateConfig(e){this.templateErrorHandling=e,vr.log("Template config set:",e)}setLayoutConfig(e){this.layoutErrorHandling=e,vr.log("Layout config set:",e)}setActionExecutor(e){this.executeAction=e}resolve(e,r={}){const{errorHandling:a,onError:i}=r;vr.log("Resolving error:",e,{hasActionErrorHandling:!!a,hasActionOnError:!!i,hasLayoutConfig:!!this.layoutErrorHandling,hasTemplateConfig:!!this.templateErrorHandling});let l=Zr.findHandler(a,e);if(l){const c=this.getMatchedKey(a,e);return{handler:Zr.injectErrorCode(l,c,e),level:"action",matchedKey:c}}if(i){const c=Zr.normalizeOnError(i);if(c.length>0)return{handler:c.length===1?c[0]:{handler:"sequence",actions:c},level:"action",matchedKey:"onError"}}if(l=Zr.findHandler(this.layoutErrorHandling||void 0,e),l){const c=this.getMatchedKey(this.layoutErrorHandling,e);return{handler:Zr.injectErrorCode(l,c,e),level:"layout",matchedKey:c}}if(l=Zr.findHandler(this.templateErrorHandling||void 0,e),l){const c=this.getMatchedKey(this.templateErrorHandling,e);return{handler:Zr.injectErrorCode(l,c,e),level:"template",matchedKey:c}}if(l=Zr.findHandler(Jp,e),l){const c=this.getMatchedKey(Jp,e);return{handler:Zr.injectErrorCode(l,c,e),level:"system",matchedKey:c}}return{handler:null,level:null,matchedKey:null}}async execute(e,r){if(!this.executeAction){vr.error("Action executor is not set");return}vr.log("Executing handler:",e.handler,{errorContext:r});try{return await this.executeAction(e,{error:r})}catch(a){throw vr.error("Failed to execute handler:",a),a}}async resolveAndExecute(e,r,a={}){const i=this.resolve(e,a);if(vr.log("Resolve result:",{errorCode:e,handler:i.handler?.handler,level:i.level,matchedKey:i.matchedKey}),!i.handler)return vr.warn("No handler found for error:",e),{handled:!1};try{return{handled:!0,result:await this.execute(i.handler,r)}}catch(l){return vr.error("Handler execution failed:",l),{handled:!1}}}getMatchedKey(e,r){return e[r]?r:e[String(r)]?String(r):"default"}clearLayoutConfig(){this.layoutErrorHandling=null,vr.log("Layout config cleared")}clearAllConfig(){this.templateErrorHandling=null,this.layoutErrorHandling=null,vr.log("All config cleared")}getConfigStatus(){return{hasTemplate:this.templateErrorHandling!==null,hasLayout:this.layoutErrorHandling!==null,hasExecutor:this.executeAction!==null}}};$(Na,"instance",null);let Ld=Na;function Sr(){return Ld.getInstance()}var Md={exports:{}},po={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Qp;function I0(){if(Qp)return po;Qp=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(a,i,l){var c=null;if(l!==void 0&&(c=""+l),i.key!==void 0&&(c=""+i.key),"key"in i){l={};for(var d in i)d!=="key"&&(l[d]=i[d])}else l=i;return i=l.ref,{$$typeof:o,type:a,key:c,ref:i!==void 0?i:null,props:l}}return po.Fragment=e,po.jsx=r,po.jsxs=r,po}var Zp;function H0(){return Zp||(Zp=1,Md.exports=I0()),Md.exports}var dt=H0();const j0=Jr({__proto__:null,default:Qr(dt)},[dt]),$d=ut("ParentContextProvider"),em=N.createContext(null);let sc=null;function Nd(){sc?($d.log("[triggerModalParentUpdate] 모달 부모 컨텍스트 업데이트 트리거"),sc()):$d.warn("[triggerModalParentUpdate] Provider가 아직 마운트되지 않음")}const tm=({children:o})=>{const[e,r]=N.useState(0),a=N.useRef(!0),i=N.useCallback(()=>{const c=window.__g7LayoutContextStack||[];return c[c.length-1]?.dataContext},[]);N.useEffect(()=>(a.current=!0,sc=()=>{a.current&&(r(c=>c+1),$d.log("[ParentContextProvider] 버전 업데이트됨"))},()=>{a.current=!1,sc=null}),[]);const l={version:e,getParentDataContext:i};return dt.jsx(em.Provider,{value:l,children:o})};function z0(){return N.useContext(em)}const j=ut("ActionDispatcher");function U0(o,e,r,a){return r||(Vg(o)||od(o)?"$t:core.errors.network_request_failed":a||`Failed to execute action: ${e}`)}const nm=new Set(["navigate","navigateBack","navigateForward","replaceUrl","refresh","logout"]),B0=new Set(["redirect"]);function Vn(){try{return window.G7Core?.devTools}catch{return}}class It extends Error{constructor(r,a,i){super(r);$(this,"unknownHandler",!1);this.action=a,this.originalError=i,this.name="ActionError"}}const rm={click:"onClick",change:"onChange",input:"onInput",submit:"onSubmit",focus:"onFocus",blur:"onBlur",keydown:"onKeyDown",keyup:"onKeyUp",keypress:"onKeyPress",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",scroll:"onScroll",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",dragenter:"onDragEnter",dragover:"onDragOver",dragleave:"onDragLeave",drop:"onDrop"},fs=class fs{constructor(e={},r,a){$(this,"bindingEngine");$(this,"translationEngine");$(this,"translationContext");$(this,"customHandlers",new Map);$(this,"defaultContext");$(this,"globalStateUpdater");$(this,"errorHandlingSetup",!1);$(this,"debounceTimers",new Map);$(this,"pendingDebounceFlushers",new Map);$(this,"debounceAccumulatedValues",new Map);$(this,"globalHeaders",[]);$(this,"namedActions",{});$(this,"previewMode",!1);$(this,"intervals",new Map);this.bindingEngine=new _n,this.translationEngine=r,this.translationContext=a,this.defaultContext=e,this.registerDefaultHandlers(),this.setupErrorHandling()}setGlobalHeaders(e){this.globalHeaders=e||[]}setNamedActions(e){this.namedActions=e||{};const r=Vn();r?.isEnabled?.()&&r.setNamedActionDefinitions?.(this.namedActions),j.log("[setNamedActions] registered:",Object.keys(this.namedActions))}getNamedActions(){return this.namedActions}setPreviewMode(e){this.previewMode=e,j.log("Preview mode:",e?"enabled":"disabled")}isPreviewMode(){return this.previewMode}static getPreviewSuppressedHandlers(){return nm}static getPreviewSuppressedLayoutFeatures(){return B0}resolveActionRef(e){if(!e.actionRef)return e;const r=this.namedActions[e.actionRef];if(!r)return j.warn(`[resolveActionRef] named action not found: "${e.actionRef}"`),e;const a=Vn();a?.isEnabled?.()&&a.trackNamedActionRef?.({actionRefName:e.actionRef,resolvedHandler:r.handler,timestamp:Date.now()});const{actionRef:i,type:l,key:c,event:d,...f}=e,g={...r,...Object.fromEntries(Object.entries(f).filter(([,m])=>m!==void 0)),type:l??r.type};return c!==void 0&&(g.key=c),d!==void 0&&(g.event=d),g}matchesPattern(e,r){if(r==="*")return!0;const a=r.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${a}$`).test(e)}getMatchingGlobalHeaders(e,r){const a={};for(const i of this.globalHeaders)this.matchesPattern(e,i.pattern)&&Object.entries(i.headers).forEach(([l,c])=>{const d=Zi(c,r,{skipCache:!0});d!=null&&d!==""&&(a[l]=String(d))});return a}setupErrorHandling(){if(this.errorHandlingSetup)return;Sr().setActionExecutor(async(r,a)=>{const i={type:"click",handler:r.handler,target:r.target,params:r.params,actions:r.actions},l={data:{...this.defaultContext.data,error:a.error}};return await this.dispatchAction(i,l)}),this.errorHandlingSetup=!0}registerDefaultHandlers(){this.registerHandler("refetchDataSource",async(r,a)=>{const i=r.params?.dataSourceId,l=r.params?.sync;if(!i){j.warn("refetchDataSource: dataSourceId is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.refetch){const c=window.G7Core?.state?.get?.()||{},d={...a.state?._global,...c},f=window.G7Core?.state?.getLocal?.()||{},g=a.data?._local||a.state||{},m={...f,...g},y=a.isolatedContext?.state;j.log("[refetchDataSource] localStateOverride:",m),await window.G7Core.dataSource.refetch(i,{...l?{sync:!0}:{},...d?{globalStateOverride:d}:{},...m?{localStateOverride:m}:{},...y?{isolatedStateOverride:y}:{}})}else j.warn("refetchDataSource: G7Core.dataSource.refetch is not available")}),this.registerHandler("appendDataSource",async(r,a)=>{const{dataSourceId:i,dataPath:l,newData:c}=r.params||{};if(!i){j.warn("appendDataSource: dataSourceId is required");return}if(c===void 0){j.warn("appendDataSource: newData is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.updateData){if(!Array.isArray(c)){j.warn("appendDataSource: newData must be an array, got:",typeof c,c);return}await window.G7Core.dataSource.updateData(i,l||null,c,"append")}else j.warn("appendDataSource: G7Core.dataSource.updateData is not available")}),this.registerHandler("updateDataSource",async(r,a)=>{const{dataSourceId:i,data:l,merge:c=!1}=r.params||{};if(!i){j.warn("updateDataSource: dataSourceId is required");return}if(l===void 0){j.warn("updateDataSource: data is required");return}typeof window<"u"&&window.G7Core?.dataSource?.set?(j.log(`[updateDataSource] Updating dataSource '${i}' with:`,l),window.G7Core.dataSource.set(i,l,{merge:c})):j.warn("updateDataSource: G7Core.dataSource.set is not available")}),this.registerHandler("scrollIntoView",async(r,a)=>{const{selector:i,behavior:l="smooth",block:c="nearest",inline:d="nearest",waitForElement:f=!1,timeout:g=2e3,delay:m=0,retryCount:y=0,retryInterval:w=50,scrollContainer:S}=r.params||{};if(!i){j.warn("scrollIntoView: selector is required");return}if(typeof window>"u"||typeof document>"u"){j.warn("scrollIntoView: window/document is not available");return}let v=null;if(f){if(v=await new Promise(A=>{const x=document.querySelector(i);if(x){A(x);return}const R=setTimeout(()=>{M.disconnect(),A(null)},g),M=new MutationObserver(()=>{const O=document.querySelector(i);O&&(clearTimeout(R),M.disconnect(),A(O))});M.observe(document.body,{childList:!0,subtree:!0})}),!v){j.warn(`scrollIntoView: element not found for selector "${i}" after ${g}ms timeout`);return}}else{m>0&&await new Promise(x=>setTimeout(x,m)),v=document.querySelector(i);let A=0;for(;!v&&A<y;)await new Promise(x=>setTimeout(x,w)),v=document.querySelector(i),A++;if(!v){j.warn(`scrollIntoView: element not found for selector "${i}" after ${A+1} attempts`);return}}if(S){const A=document.querySelector(S);if(!A){j.warn(`scrollIntoView: container not found for selector "${S}"`);return}const x=v.getBoundingClientRect(),R=A.getBoundingClientRect(),M=x.top-R.top+A.scrollTop,O=M+x.height;let L;switch(c){case"start":L=M;break;case"center":L=M-A.clientHeight/2+x.height/2;break;case"end":L=O-A.clientHeight;break;case"nearest":default:const q=x.top<R.top,G=x.bottom>R.bottom;if(q)L=M;else if(G)L=O-A.clientHeight;else return;break}A.scrollTo({top:Math.max(0,L),behavior:l});return}v.scrollIntoView({behavior:l,block:c,inline:d})}),this.registerHandler("reloadExtensions",async(r,a)=>{if(typeof window>"u"){j.warn("reloadExtensions: window is not available");return}const i=window.__templateApp;if(!i){j.warn("reloadExtensions: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState()}catch(d){throw j.error("reloadExtensions: reloadExtensionState failed",d),d}else j.warn("reloadExtensions: TemplateApp.reloadExtensionState unavailable");const{moduleInfo:l,pluginInfo:c}=r.params||{};if(l)try{await this.executeAction({handler:"reloadModuleHandlers",params:r.params},a)}catch(d){j.error("reloadExtensions: reloadModuleHandlers failed",d)}if(c)try{await this.executeAction({handler:"reloadPluginHandlers",params:r.params},a)}catch(d){j.error("reloadExtensions: reloadPluginHandlers failed",d)}j.log("reloadExtensions: done")}),this.registerHandler("reloadRoutes",async(r,a)=>{if(typeof window>"u"){j.warn("reloadRoutes: window is not available");return}const i=window.__templateApp;if(!i){j.warn("reloadRoutes: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),j.log("reloadRoutes: delegated to reloadExtensionState")}catch(l){throw j.error("reloadRoutes: Failed to reload routes",l),l}else{const l=i.getRouter?.();l&&(await l.loadRoutes(),j.log("reloadRoutes: Routes reloaded (legacy fallback)"))}}),this.registerHandler("refresh",async(r,a)=>{if(typeof window>"u"){j.warn("refresh: window is not available");return}const i=Number(r.params?.delayMs??0);i>0&&await new Promise(l=>setTimeout(l,i)),window.location.reload()}),this.registerHandler("remount",async(r,a)=>{const{componentId:i}=r.params||{};if(!i){j.warn("remount: componentId parameter is required");return}if(!this.globalStateUpdater){j.warn("remount: globalStateUpdater is not set");return}const d=(window.G7Core?.state?.get()||{})._global?._remountKeys||{},f=d[i]||0;this.globalStateUpdater({_remountKeys:{...d,[i]:f+1}}),j.log(`remount: ${i} key incremented to ${f+1}`)}),this.registerHandler("reloadTranslations",async(r,a)=>{if(typeof window>"u"){j.warn("reloadTranslations: window is not available");return}const i=window.__templateApp;if(!i){j.warn("reloadTranslations: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),j.log("reloadTranslations: delegated to reloadExtensionState")}catch(l){throw j.error("reloadTranslations: Failed to reload translations",l),l}}),this.registerHandler("reloadModuleHandlers",async(r,a)=>{if(typeof window>"u"){j.warn("reloadModuleHandlers: window is not available");return}const{moduleInfo:i,action:l}=r.params||{};if(!i){j.warn("reloadModuleHandlers: moduleInfo is required");return}const c=i.data||i;if(!c.identifier){j.warn("reloadModuleHandlers: moduleInfo with identifier is required");return}if(!l||l!=="add"&&l!=="remove"){j.warn('reloadModuleHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){j.warn("reloadModuleHandlers: G7Config not available");return}const f=c.identifier;try{if(l==="add"){if(c.assets&&(d.moduleAssets=d.moduleAssets||{},d.moduleAssets[f]=c.assets,j.log(`reloadModuleHandlers: Added assets for ${f}`),c.assets.js)){const g=c.assets.js,m=`module-${f}`;if(document.getElementById(m)){j.warn(`reloadModuleHandlers: Script ${m} already loaded`);return}const y=document.createElement("script");if(y.id=m,y.src=g,y.async=!0,await new Promise((w,S)=>{y.onload=()=>{j.log(`reloadModuleHandlers: Script loaded successfully for ${f}`),w()},y.onerror=()=>{j.error(`reloadModuleHandlers: Failed to load script for ${f}`),S(new Error(`Failed to load module script: ${g}`))},document.head.appendChild(y)}),c.assets.css){const w=c.assets.css,S=`module-css-${f}`;if(!document.getElementById(S)){const v=document.createElement("link");v.id=S,v.rel="stylesheet",v.href=w,document.head.appendChild(v),j.log(`reloadModuleHandlers: CSS loaded for ${f}`)}}}}else if(l==="remove"){d.moduleAssets&&d.moduleAssets[f]&&(delete d.moduleAssets[f],j.log(`reloadModuleHandlers: Removed assets for ${f}`));const g=`module-${f}`,m=document.getElementById(g);m&&(m.remove(),j.log(`reloadModuleHandlers: Removed script for ${f}`));const y=`module-css-${f}`,w=document.getElementById(y);w&&(w.remove(),j.log(`reloadModuleHandlers: Removed CSS for ${f}`))}}catch(g){throw j.error(`reloadModuleHandlers: Failed to ${l} module assets`,g),g}}),this.registerHandler("reloadPluginHandlers",async(r,a)=>{if(typeof window>"u"){j.warn("reloadPluginHandlers: window is not available");return}const{pluginInfo:i,action:l}=r.params||{};if(!i){j.warn("reloadPluginHandlers: pluginInfo is required");return}const c=i.data||i;if(!c.identifier){j.warn("reloadPluginHandlers: pluginInfo with identifier is required");return}if(!l||l!=="add"&&l!=="remove"){j.warn('reloadPluginHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){j.warn("reloadPluginHandlers: G7Config not available");return}const f=c.identifier;try{if(l==="add"){if(c.assets&&(d.pluginAssets=d.pluginAssets||{},d.pluginAssets[f]=c.assets,j.log(`reloadPluginHandlers: Added assets for ${f}`),c.assets.js)){const g=c.assets.js,m=`plugin-${f}`;if(document.getElementById(m)){j.warn(`reloadPluginHandlers: Script ${m} already loaded`);return}const y=document.createElement("script");if(y.id=m,y.src=g,y.async=!0,await new Promise((w,S)=>{y.onload=()=>{j.log(`reloadPluginHandlers: Script loaded successfully for ${f}`),w()},y.onerror=()=>{j.error(`reloadPluginHandlers: Failed to load script for ${f}`),S(new Error(`Failed to load plugin script: ${g}`))},document.head.appendChild(y)}),c.assets.css){const w=c.assets.css,S=`plugin-css-${f}`;if(!document.getElementById(S)){const v=document.createElement("link");v.id=S,v.rel="stylesheet",v.href=w,document.head.appendChild(v),j.log(`reloadPluginHandlers: CSS loaded for ${f}`)}}}}else if(l==="remove"){d.pluginAssets&&d.pluginAssets[f]&&(delete d.pluginAssets[f],j.log(`reloadPluginHandlers: Removed assets for ${f}`));const g=`plugin-${f}`,m=document.getElementById(g);m&&(m.remove(),j.log(`reloadPluginHandlers: Removed script for ${f}`));const y=`plugin-css-${f}`,w=document.getElementById(y);w&&(w.remove(),j.log(`reloadPluginHandlers: Removed CSS for ${f}`))}}catch(g){throw j.error(`reloadPluginHandlers: Failed to ${l} plugin assets`,g),g}});let e=!1;this.registerHandler("showErrorPage",async(r,a)=>{if(e){j.log("showErrorPage: Already active, skipping duplicate call");return}if(e=!0,typeof window>"u"){e=!1,j.warn("showErrorPage: window is not available");return}const i=window.__templateApp;if(!i){e=!1,j.warn("showErrorPage: TemplateApp not initialized");return}const l=i.getErrorPageHandler?.();if(!l){e=!1,j.warn("showErrorPage: ErrorPageHandler not available");return}const c=r.params?.errorCode||500,d=r.params?.target||"content";let f=r.params?.containerId;f||(f=d==="full"?"app":"main_content"),j.log("showErrorPage:",{errorCode:c,target:d,containerId:f});const g=(m,y=6e4)=>new Promise((w,S)=>{const v=document.getElementById(m);if(v){w(v);return}j.log(`showErrorPage: Waiting for container #${m}...`);let A;const x=new MutationObserver((R,M)=>{const O=document.getElementById(m);O&&(j.log(`showErrorPage: Container #${m} found`),M.disconnect(),clearTimeout(A),w(O))});x.observe(document.body,{childList:!0,subtree:!0}),A=setTimeout(()=>{x.disconnect(),S(new Error(`Container #${m} not found within ${y}ms`))},y)});try{await g(f);const m=Sr(),y=m.layoutErrorHandling;m.clearLayoutConfig();try{await l.renderError(c,f)||j.warn(`showErrorPage: Failed to render error page for code ${c}`)}finally{m.setLayoutConfig(y)}}catch(m){throw j.error("showErrorPage: Error rendering error page:",m),m}finally{e=!1}}),this.registerHandler("emitEvent",async(r,a)=>{const i=r.params?.event,l=r.params?.data;if(!i){j.warn("emitEvent: event parameter is required");return}if(typeof window>"u"){j.warn("emitEvent: window is not available");return}const c=window.G7Core;if(!c?.componentEvent?.emit){j.warn("emitEvent: G7Core.componentEvent is not available");return}try{j.log(`emitEvent: Emitting "${i}"`,l);const d={...l,_context:{data:a.data,state:a.state}},f=await c.componentEvent.emit(i,d);if(!f||f.length===0?j.warn(`emitEvent: No listeners found for "${i}"`):j.log(`emitEvent: Event "${i}" completed with ${f.length} listener(s)`,f),this.globalStateUpdater){const g=(c?.state?.get()||{})._local||{},m={event:i,success:!0,data:f.length===1?f[0]:f,listeners:f.length};this.globalStateUpdater({_local:{...g,_eventResult:m}});const y=a.state&&typeof a.state=="object"&&!Array.isArray(a.state)?a.state:g;window.__g7SequenceLocalSync={...y,_eventResult:m}}}catch(d){if(j.error(`emitEvent: Event "${i}" failed`,d),this.globalStateUpdater){const f=c?.state?.get()||{};this.globalStateUpdater({_local:{...f._local,_eventResult:{event:i,success:!1,error:d instanceof Error?d.message:String(d)}}})}throw d}}),this.registerHandler("updateProductField",async(r,a)=>{const{productId:i,field:l,value:c}=r.params||{};if(!i||!l){j.warn("updateProductField: productId and field are required");return}if(typeof window>"u"){j.warn("updateProductField: window is not available");return}const d=window.G7Core;if(!d?.state?.get||!this.globalStateUpdater){j.warn("updateProductField: G7Core.state or globalStateUpdater is not available");return}try{const f=d.state.get()||{},m=(f.products?.data?.data||[]).map(w=>w.id===i?{...w,[l]:c,_modified:!0}:w),y=new Set(f._local?.modifiedProductIds||[]);y.add(i),this.globalStateUpdater({products:{...f.products,data:{...f.products?.data,data:m}},_local:{...f._local,modifiedProductIds:Array.from(y)}}),j.log(`updateProductField: Updated product ${i}, field: ${l}, value:`,c)}catch(f){throw j.error("updateProductField: Error updating product field",f),f}}),this.registerHandler("updateOptionField",async(r,a)=>{const{productId:i,optionId:l,field:c,value:d}=r.params||{};if(!i||!l||!c){j.warn("updateOptionField: productId, optionId and field are required");return}if(typeof window>"u"){j.warn("updateOptionField: window is not available");return}const f=window.G7Core;if(!f?.state?.get||!this.globalStateUpdater){j.warn("updateOptionField: G7Core.state or globalStateUpdater is not available");return}try{const g=f.state.get()||{},y=(g.products?.data?.data||[]).map(S=>{if(S.id===i&&S.options){const v=S.options.map(A=>A.id===l?{...A,[c]:d,_modified:!0}:A);return{...S,options:v,_modified:!0}}return S}),w=new Set(g._local?.modifiedProductIds||[]);w.add(i),this.globalStateUpdater({products:{...g.products,data:{...g.products?.data,data:y}},_local:{...g._local,modifiedProductIds:Array.from(w)}}),j.log(`updateOptionField: Updated product ${i} option ${l}, field: ${c}, value:`,d)}catch(g){throw j.error("updateOptionField: Error updating option field",g),g}}),this.registerHandler("setLocale",async(r,a)=>{const i=r.target;if(!i||typeof i!="string"){j.warn("setLocale: Invalid locale:",i);return}const l=window.__templateApp;if(l&&typeof l.changeLocale=="function")try{await l.changeLocale(i),j.log("setLocale: Locale changed to",i)}catch(c){j.error("setLocale: Failed to change locale:",c),window.location.reload()}else{j.warn("setLocale: TemplateApp not found, falling back to page reload");try{localStorage.setItem("g7_locale",i)}catch{}window.location.reload()}}),this.registerHandler("suppress",async()=>{j.log("suppress: Error intentionally suppressed")}),this.registerBuiltInHandlerMetadata()}registerBuiltInHandlerMetadata(){const e=Vn();if(!e?.isEnabled())return;const r=[{name:"refetchDataSource",description:"데이터 소스를 다시 fetch합니다"},{name:"appendDataSource",description:"데이터 소스에 새 데이터를 병합합니다 (무한 스크롤용)"},{name:"updateDataSource",description:"API 응답으로 데이터 소스를 직접 업데이트합니다 (refetch 대체)"},{name:"reloadRoutes",description:"라우트를 다시 로드합니다"},{name:"refresh",description:"현재 페이지를 새로고침합니다"},{name:"remount",description:"컴포넌트를 리마운트합니다"},{name:"reloadTranslations",description:"다국어 파일을 다시 로드합니다"},{name:"showErrorPage",description:"에러 페이지를 표시합니다"},{name:"emitEvent",description:"이벤트를 발생시킵니다"},{name:"updateProductField",description:"상품 필드를 인라인 수정합니다"},{name:"updateOptionField",description:"상품 옵션 필드를 인라인 수정합니다"},{name:"setLocale",description:"언어를 변경합니다 (DB 저장 + UI 리렌더링)"}];for(const a of r)e.trackHandlerRegistration(a.name,"built-in",a.description)}createHandler(e,r,a){j.log("createHandler called for:",e.handler,e.type);const i=window.__g7DevTools,l=Date.now(),c=a?.state?{...a.state}:null,d=`handler_${e.handler}_${l}`;return async f=>{if(j.log("Handler invoked for:",e.handler,"event:",f.type),i?.isEnabled?.()&&c){const m=window.G7Core?.state?.getLocal?.()??a?.state??{},y=Date.now()-l;for(const w of Object.keys(c)){const S=c[w],v=m[w];S!==v&&y>100&&(i.trackStaleClosureWarning?.({type:"event-handler-stale",location:`createHandler(${e.handler})`,capturedPath:`_local.${w}`,capturedValue:S,capturedAt:l,currentValue:v,actionId:d,stackTrace:new Error().stack}),j.warn(`[Stale Closure] _local.${w} changed after handler creation:`,`captured="${S}" → current="${v}" (${y}ms ago)`))}}try{f.type!=="change"&&f.preventDefault();let g={};if(f.type==="submit"&&f.target instanceof HTMLFormElement){const w=f.target;new FormData(w).forEach((v,A)=>{g[A]=v})}const m={...this.defaultContext,data:{...r,form:g,_local:a?.state||{},$event:f},event:f,...a&&{state:a.state,setState:a.setState},isolatedContext:a?.isolatedContext};if(e.confirm){let w=this.resolveValue(e.confirm,m.data);if(this.translationEngine&&this.translationContext&&w.startsWith("$t:")&&(w=this.translationEngine.resolveTranslations(w,this.translationContext,m.data)),!confirm(w))return}const y=window.__g7ActionContext;window.__g7ActionContext={...a,data:m.data};try{await this.executeAction(e,m)}finally{window.__g7ActionContext=y}}catch(g){if(j.error("Action execution failed:",g),e.onError){const m=g instanceof It&&g.originalError?g.originalError:g,y={...this.defaultContext,data:{...r,error:m,_local:a?.state||{},$event:f},event:f,...a&&{state:a.state,setState:a.setState}},w=Array.isArray(e.onError)?e.onError:[e.onError];for(const S of w)await this.executeAction(S,y)}}}}generateActionId(e,r){const a=e.handler,i=r||"no-target",l=Date.now(),c=Math.random().toString(36).substring(2,9);return`${a}_${i.replace(/[^a-zA-Z0-9]/g,"_")}_${l}_${c}`}async executeAction(e,r){if(e=this.resolveActionRef(e),typeof e.handler=="string"&&e.handler.includes("{{")){const f=this.evaluateExpression(e.handler,r.data);e={...e,handler:f==null?"":String(f)}}const a=Vn(),i=a?.isEnabled()?`action_${Date.now()}_${Math.random().toString(36).substring(2,11)}`:void 0,l=performance.now();let c;if(i&&a&&a.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),context:this.sanitizeForDevTools({hasState:!!r.state,hasSetState:!!r.setState,dataKeys:r.data?Object.keys(r.data):[]}),startTime:l,status:"started"}),e.if!==void 0)try{const f=this.resolveValue(e.if,r.data),g=f===!0||f==="true"||f&&f!=="false"&&f!=="0"&&f!==!1;if(j.log("[executeAction] if condition result:",e.handler,g),!g)return i&&a&&a.logAction({id:i,type:e.handler,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"success",result:{skipped:!0,reason:"if condition false"}}),{success:!0,data:void 0}}catch(f){return j.error("[executeAction] if condition error:",e.handler,f),i&&a&&a.logAction({id:i,type:e.handler,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"error",error:{name:"ConditionEvaluationError",message:f instanceof Error?f.message:String(f),stack:f instanceof Error?f.stack:void 0}}),{success:!0,data:void 0}}let d;try{const f=this.resolveParams(e.params,r.data);i&&(c=this.sanitizeForDevTools(f));const g=e.target?this.resolveValue(e.target,r.data):void 0;if(e.handler==="apiCall"&&r.setState){d=this.generateActionId(e,g);const y=r.state?.loadingActions||{};r.setState({loadingActions:{...y,[d]:!0}})}if(this.previewMode&&nm.has(e.handler))return j.warn(`Preview mode: "${e.handler}" suppressed`,g||f),i&&a&&a.logAction({id:i,type:e.handler,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"skipped",metadata:{reason:"preview_mode_suppressed"}}),{success:!0,data:void 0};let m;switch(e.handler){case"ensureIdentityVerified":m=await this.handleEnsureIdentityVerified(f);break;case"resolveIdentityChallenge":m=this.handleResolveIdentityChallenge(f);break;case"navigate":const y=f.path||g;m=await this.handleNavigate(y,f,r);break;case"navigateBack":m=await this.handleNavigateBack();break;case"navigateForward":m=await this.handleNavigateForward();break;case"openWindow":{const v=f.path||g;m=await this.handleOpenWindow(v,f);break}case"replaceUrl":{const v=f.path||g||window.location.pathname;m=await this.handleReplaceUrl(v,f);break}case"apiCall":if(e.onSuccess&&a?.isEnabled()&&i){const v=window.G7Core,A={};if(v?.state?.get){const x=v.state.get();A._global=x}r.state&&(A._local=r.state),a.registerStateCaptureForHandler?.(i,["_global","_local"],A)}const w=e.auth_mode??(e.auth_required?"required":"none"),S=e.identity_target?this.resolveParams(e.identity_target,r.data):void 0;m=await this.handleApiCall(g,f,r,w,S);break;case"login":m=await this.handleLogin(g,f,r);break;case"logout":m=await this.handleLogout(g,r);break;case"setState":j.log("[executeAction] setState resolvedParams:",f),m=await this.handleSetState(e.render!==void 0?{...f,__render:e.render}:f,r);break;case"setError":m=await this.handleSetError(g,f,r);break;case"openModal":m=await this.handleOpenModal(g,r);break;case"closeModal":m=await this.handleCloseModal(r);break;case"showAlert":m=await this.handleShowAlert(g,r);break;case"toast":m=await this.handleToast(f,r);break;case"switch":m=await this.handleSwitch(e,r);break;case"conditions":m=await this.handleConditions(e,r);break;case"sequence":m=await this.handleSequence(e,r);break;case"parallel":m=await this.handleParallel(e,r);break;case"startInterval":m=this.handleStartInterval(f,r);break;case"stopInterval":m=this.handleStopInterval(f);break;case"loadScript":m=await this.handleLoadScript(f,e,r);break;case"callExternal":m=await this.handleCallExternal(f,e,r);break;case"callExternalEmbed":m=await this.handleCallExternalEmbed(f,e,r);break;case"saveToLocalStorage":m=await this.handleSaveToLocalStorage(f,r);break;case"loadFromLocalStorage":m=await this.handleLoadFromLocalStorage(f,r);break;default:m=await this.handleCustomAction({...e,target:g,params:f},r);break}if(e.resultTo&&m!==void 0){const{target:y,key:w,merge:S}=e.resultTo,v=this.resolveValue(w,r.data),A=S==="replace"?"replace":S==="shallow"?"shallow":"deep";if(y==="_local"&&r.setState){const x=this.buildNestedUpdate(v,m),R=A!=="deep"?{...x,__mergeMode:A}:x;r.setState(R),j.log(`[resultTo] Saved to _local.${v} (merge=${A}):`,m)}else if(y==="_local"&&this.globalStateUpdater){const M=(window.G7Core?.state?.get()||{})._local||{},O=this.buildNestedUpdate(v,m);let L;A==="replace"?L=O:A==="shallow"?L={...M,...O}:L=this.deepMergeWithState(O,M),this.globalStateUpdater({_local:L}),j.log(`[resultTo] Saved to _local.${v} via globalStateUpdater (merge=${A}):`,m)}else if(y==="_global"&&this.globalStateUpdater){const x=this.buildNestedUpdate(v,m);this.globalStateUpdater(x),j.log(`[resultTo] Saved to _global.${v}:`,m)}else if(y==="_isolated"&&r.isolatedContext){const x=this.buildNestedUpdate(v,m);r.isolatedContext.mergeState(x,A),j.log(`[resultTo] Saved to _isolated.${v} (merge=${A}):`,m)}else j.warn(`[resultTo] Cannot save result: target=${y}, setState=${!!r.setState}, globalStateUpdater=${!!this.globalStateUpdater}, isolatedContext=${!!r.isolatedContext}`)}if(e.onSuccess){if(a?.isEnabled()&&i&&e.handler==="apiCall"){const S=window.G7Core,v={};S?.state?.get&&(v._global=S.state.get()),r.state&&(v._local=r.state),a.detectStaleClosure?.(i,`${e.handler} → onSuccess`,v,"callback-state-capture",i)}const y={...r,data:{...r.data,result:m,response:m}},w=Array.isArray(e.onSuccess)?e.onSuccess:[e.onSuccess];w.length>1?await this.handleSequence({handler:"sequence",type:"click",actions:w},y):w.length===1&&await this.executeAction(w[0],y)}return i&&a&&a.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:c,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"success",result:this.sanitizeForDevTools(m)}),{success:!0,data:m}}catch(f){const g=f instanceof It?f:new It(`Failed to execute action: ${e.handler}`,e,f instanceof Error?f:void 0),m=g.originalError?.response||{},y=m.data||{},w=g.originalError?.status||m.status||500;let S=U0(g.originalError??f,e.handler,y.message,g.message);this.translationEngine&&this.translationContext&&S.startsWith("$t:")&&(S=this.translationEngine.resolveTranslations(S,this.translationContext));const v={status:w,message:S,errors:y.errors||m.errors,data:y,statusText:g.originalError?.statusText,error_code:y.error_code??m.error_code};if(g.unknownHandler)throw j.warn(`Unknown action handler "${e.handler}" — skipped (extension not loaded?). Not surfaced to the user.`),g;const x=Sr().resolve(w,{errorHandling:e.errorHandling,onError:e.onError});if(x.handler){if(a?.isEnabled()&&i&&e.handler==="apiCall"){const M=window.G7Core,O={};M?.state?.get&&(O._global=M.state.get()),r.state&&(O._local=r.state),a.detectStaleClosure?.(i,`${e.handler} → onError`,O,"callback-state-capture",i)}const R={...r,data:{...r.data,error:v}};try{const M={type:"click",handler:x.handler.handler,target:x.handler.target,params:x.handler.params,actions:x.handler.actions};return await this.executeAction(M,R),{success:!1,error:g}}catch(M){return j.error("Error executing error handler:",M),{success:!1,error:g}}}throw i&&a&&a.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:c,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"error",error:{name:g.name,message:g.message,stack:g.stack}}),g}finally{if(e.handler==="apiCall"&&r.setState&&d){const f=r.state?.loadingActions||{},{[d]:g,...m}=f;r.setState({loadingActions:m})}}}async handleNavigate(e,r,a){let i=e;if(r.query||r.mergeQuery===!0)if(r.mergeQuery===!0)i=this.buildMergedQueryPath(e,r.query??{});else{const c=new URLSearchParams;for(const[f,g]of Object.entries(r.query))if(g!=null&&g!=="")if(Array.isArray(g)){const m=f.endsWith("[]")?f:`${f}[]`;for(const y of g)y!=null&&y!==""&&c.append(m,String(y))}else c.set(f,String(g));const d=c.toString();d&&(i=`${e}?${d}`)}if(j.log("handleNavigate:",{target:e,params:r,finalPath:i,replace:r.replace,windowLocationSearch:window.location.search}),r.replace===!0){const c=window.G7Core;if(c?.updateQueryParams){const d=typeof r.transition_overlay_target=="string"?r.transition_overlay_target:void 0;await c.updateQueryParams(i,d?{transitionOverlayTarget:d}:void 0),j.log("handleNavigate: Used updateQueryParams for replace mode",d?{transitionOverlayTarget:d}:void 0),this.applyScrollOption(r.scroll,r.scrollBehavior,"top");return}j.warn("handleNavigate: G7Core.updateQueryParams not available, falling back to React Router")}const l=this.resolveNavigateFallbackAction(i,r);if(l){j.warn(`handleNavigate: No route matched, falling back to "${l.handler}"`),await this.dispatchAction({type:"click",handler:l.handler,params:l.params},a),this.applyScrollOption(r.scroll,r.scrollBehavior,"top");return}if(!a.navigate)throw new It("Navigate function is not provided in context");a.navigate(i,{replace:r.replace===!0}),this.applyScrollOption(r.scroll,r.scrollBehavior,"top")}resolveNavigateFallbackAction(e,r){const a=r.fallback;if(a===!1||r.replace===!0)return null;const l=window.__templateApp?.getRouter?.();if(!l||typeof l.match!="function"||typeof l.getRoutes=="function"&&l.getRoutes().length===0)return null;const c=e.split("?")[0];return l.match(c)?null:this.resolveNavigateFallback(a,e,r)}resolveNavigateFallback(e,r,a){return e==null?{handler:"openWindow",params:{path:r,target:"_self"}}:typeof e=="string"?{handler:e,params:{path:r}}:typeof e=="object"&&typeof e.handler=="string"?{handler:e.handler,params:{path:r,...e.params||{}}}:(j.warn("resolveNavigateFallback: unrecognized fallback option, using openWindow",e),{handler:"openWindow",params:{path:r,target:"_blank"}})}applyScrollOption(e,r,a){const i=e===void 0?a:e;if(i==="preserve")return;const l=r==="smooth"?"smooth":"instant",c=y=>{if(typeof y!="object"||y===null)return!1;const w=y;return"container"in w||"to"in w||"block"in w||"offset"in w},d=(y,w,S=0)=>{y===window?window.scrollTo({top:w,left:S,behavior:l}):y.scrollTo({top:w,left:S,behavior:l})},f=(y,w,S,v)=>{if(w===window){y.scrollIntoView({behavior:l,block:S}),v&&window.scrollBy({top:-v,left:0,behavior:l});return}const A=w,x=y.getBoundingClientRect(),R=A.getBoundingClientRect(),M=A.scrollTop+(x.top-R.top);let O;S==="center"?O=M-(A.clientHeight-y.clientHeight)/2:S==="end"?O=M-(A.clientHeight-y.clientHeight):O=M,O-=v,A.scrollTo({top:Math.max(0,O),left:0,behavior:l})},g=()=>{window.scrollTo({top:0,left:0,behavior:l});const y=document.getElementById("app")??document.body;if(!y)return;y.querySelectorAll("*").forEach(S=>{if(S.scrollTop===0&&S.scrollLeft===0)return;const v=window.getComputedStyle(S),A=v.overflowY,x=v.overflowX;(A==="auto"||A==="scroll"||x==="auto"||x==="scroll")&&S.scrollTo({top:0,left:0,behavior:l})})},m=()=>{try{if(c(i)){const y=i,w=y.block??"start",S=typeof y.offset=="number"?y.offset:0;let v=window;if(typeof y.container=="string"&&y.container.length>0){const x=document.querySelector(y.container);if(!x){j.warn(`applyScrollOption: container not found: ${y.container}`);return}v=x}const A=y.to??"top";if(A==="top"){v===window?g():d(v,0);return}if(typeof A=="number"){d(v,A-S);return}if(typeof A=="object"&&A!==null&&("x"in A||"y"in A)){const{x=0,y:R=0}=A;d(v,R-S,x);return}if(typeof A=="string"&&(A.startsWith("#")||A.startsWith("."))){const x=document.querySelector(A);x?f(x,v,w,S):j.warn(`applyScrollOption: target element not found: ${A}`);return}j.warn('applyScrollOption: invalid "to" value in extended form',A);return}if(i==="top"){g();return}if(typeof i=="number"){window.scrollTo({top:i,left:0,behavior:l});return}if(typeof i=="object"&&i!==null&&("x"in i||"y"in i)){const{x:y=0,y:w=0}=i;window.scrollTo({top:w,left:y,behavior:l});return}if(typeof i=="string"&&(i.startsWith("#")||i.startsWith("."))){const y=document.querySelector(i);y&&y.scrollIntoView({behavior:l,block:"start"});return}}catch(y){j.warn("applyScrollOption: failed to apply scroll",y)}};typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(m):m()}async handleOpenWindow(e,r){let a=e;if(r.query){const l=new URLSearchParams;for(const[d,f]of Object.entries(r.query))f!=null&&f!==""&&l.set(d,String(f));const c=l.toString();c&&(a=`${e}?${c}`)}const i=r.target==="_self"?"_self":"_blank";j.log("handleOpenWindow:",{target:e,params:r,finalPath:a,windowTarget:i}),i==="_self"?window.location.assign(a):window.open(a,"_blank")}async handleNavigateBack(){j.log("handleNavigateBack"),window.history.back()}async handleNavigateForward(){j.log("handleNavigateForward"),window.history.forward()}async handleReplaceUrl(e,r){let a=e;if(r.query||r.mergeQuery===!0)if(r.mergeQuery===!0)a=this.buildMergedQueryPath(e,r.query??{});else{const i=new URLSearchParams;for(const[c,d]of Object.entries(r.query))if(d!=null&&d!=="")if(Array.isArray(d)){const f=c.endsWith("[]")?c:`${c}[]`;for(const g of d)g!=null&&g!==""&&i.append(f,String(g))}else i.set(c,String(d));const l=i.toString();l&&(a=`${e}?${l}`)}j.log("handleReplaceUrl:",{target:e,params:r,finalPath:a}),window.history.replaceState(null,"",a),this.applyScrollOption(r.scroll,r.scrollBehavior,"preserve")}buildMergedQueryPath(e,r){const a=new URLSearchParams(window.location.search);for(const[c,d]of Object.entries(r))if(d==null||d==="")a.delete(c);else if(Array.isArray(d)){const f=c.endsWith("[]")?c:`${c}[]`;a.delete(c),a.delete(f);for(const g of d)g!=null&&g!==""&&a.append(f,String(g))}else a.set(c,String(d));const i=a.toString(),l=e.split("?")[0];return i?`${l}?${i}`:l}async ensureCsrfToken(){try{await fetch("/sanctum/csrf-cookie",{credentials:"include"})}catch(e){throw new It("Failed to fetch CSRF token",void 0,e instanceof Error?e:void 0)}}getCsrfTokenFromCookie(){const a=`; ${document.cookie}`.split("; XSRF-TOKEN=");if(a.length===2){const i=a.pop()?.split(";").shift();return i?decodeURIComponent(i):null}return null}buildQueryString(e){const r=new URLSearchParams;for(const[a,i]of Object.entries(e))if(!(i==null||i===""))if(Array.isArray(i))for(const l of i)l!=null&&l!==""&&r.append(`${a}[]`,String(l));else typeof i=="object"?r.append(a,JSON.stringify(i)):r.append(a,String(i));return r.toString()}async handleEnsureIdentityVerified(e){const r=typeof e.purpose=="string"?e.purpose:"sensitive_action",a=e.target&&typeof e.target=="object"?e.target:void 0;return await mt.handle({success:!1,error_code:"identity_verification_required",message:"",verification:{policy_key:e.policy_key??"",purpose:r,provider_id:e.provider_id??null,render_hint:e.render_hint??null,return_request:null}},void 0,a)!==null}handleResolveIdentityChallenge(e){const r=typeof e.result=="string"?e.result:"cancelled";let a;switch(r){case"verified":{const i=typeof e.token=="string"?e.token:"";if(!i){j.warn("resolveIdentityChallenge: result=verified 인데 token 이 비어있습니다. failed 로 강등합니다."),a={status:"failed",failureCode:"MISSING_TOKEN"};break}a={status:"verified",token:i,providerData:e.providerData&&typeof e.providerData=="object"?e.providerData:void 0};break}case"pending":{const i=typeof e.pollUrl=="string"?e.pollUrl:"",l=typeof e.expiresAt=="string"?e.expiresAt:"";if(!i||!l){j.warn("resolveIdentityChallenge: result=pending 인데 pollUrl/expiresAt 누락 — failed 로 강등합니다."),a={status:"failed",failureCode:"MALFORMED_PENDING"};break}a={status:"pending",pollUrl:i,pollIntervalMs:typeof e.pollIntervalMs=="number"?e.pollIntervalMs:void 0,expiresAt:l};break}case"failed":a={status:"failed",failureCode:typeof e.failureCode=="string"?e.failureCode:"UNKNOWN",reason:typeof e.reason=="string"?e.reason:void 0};break;case"cancelled":default:a={status:"cancelled"};break}return mt.resolveDeferred(a),!0}async handleApiCall(e,r,a,i="none",l){const{method:c="GET",body:d,headers:f,contentType:g}=r;c!=="GET"&&c!=="HEAD"&&await this.ensureCsrfToken();const m=this.getCsrfTokenFromCookie();let y={};if(i==="required"||i==="optional"){const K=jr().getToken();K&&(y={Authorization:`Bearer ${K}`})}let w=e;const S=r.query||(c==="GET"?d:null);if(S&&typeof S=="object"){const B=this.buildQueryString(S);if(B){const K=e.includes("?")?"&":"?";w=`${e}${K}${B}`}}const v=window.G7Core?.state?.getGlobal?.()||a.state?._global||{},A=window.G7Core?.state?.getLocal?.()||a.state?._local||{},x={_global:v,_local:A},R=this.getMatchingGlobalHeaders(e,x),M={};if(typeof window<"u"){const B=localStorage.getItem("g7_locale");B&&(M["Accept-Language"]=B)}const O=g==="multipart/form-data",L={method:c,headers:{...O?{}:{"Content-Type":"application/json"},Accept:"application/json",...M,...m&&{"X-XSRF-TOKEN":m},...y,...R,...f},credentials:"include"};if(d&&c!=="GET")if(O){const B=new FormData;for(const[K,fe]of Object.entries(d))fe instanceof File||fe instanceof Blob?B.append(K,fe):fe!=null&&B.append(K,typeof fe=="object"?JSON.stringify(fe):String(fe));L.body=B}else L.body=JSON.stringify(d);const q=Vn();let G=null;q?.isEnabled()&&(G=q.trackRequest(w,c));try{let B=await fetch(w,L),K;try{K=await B.json()}catch{K=null}if(mt.isIdentityRequired(B.status,K)){const fe=await mt.handle(K,{body:L.body,headers:L.headers,credentials:L.credentials},l);if(fe){B=fe;try{K=await B.json()}catch{K=null}}}if(G&&q?.isEnabled()&&(q.completeRequest(G,B.status,K),G=null),!B.ok){const fe=K||{},Ce=new Error(fe.message||`API call failed: ${B.statusText}`);throw Ce.response=fe,Ce.status=B.status,Ce.statusText=B.statusText,new It(fe.message||`API call failed: ${B.statusText}`,void 0,Ce)}return K}catch(B){throw G&&q?.isEnabled()&&q.failRequest(G,B instanceof Error?B.message:String(B)),B}}async handleLogin(e,r,a){const{body:i}=r;if(!i||!i.email||!i.password)throw new It("Login requires email and password in body params");const l=e==="user"?"user":"admin",c=l==="admin"?"/api/auth/admin/login":"/api/auth/login",d=window.G7Core?.state?.getGlobal?.()||a.state?._global||{},f=window.G7Core?.state?.getLocal?.()||a.state?._local||{},g={_global:d,_local:f},m=this.getMatchingGlobalHeaders(c,g),y=br.getInstance();try{const w=Object.keys(m).length>0?{headers:m}:void 0;return{user:await y.login(l,{email:i.email,password:i.password},w)}}catch(w){const S=w.message||"Login failed",v=new Error(S);throw v.response=w.response?.data||{},v.status=w.status||w.response?.status||500,new It(S,void 0,v)}}async handleLogout(e,r){await br.getInstance().logout()}async handleSetState(e,r){j.log("[handleSetState] START, params:",e);const{target:a="component",scope:i,merge:l,__render:c,...d}=e,f=Vn(),g=window.G7Core;if(typeof a=="string"&&(a.startsWith("$parent.")||a.startsWith("$root.")))return this.handleParentScopeSetState(a,d,l,r);const m=r.state&&Object.keys(r.state).length>0?r.state:g?.state?.get()||{},y=a==="global"?"_global":a.startsWith("_local.")?a:"_local",w=y==="_global"?m._global:y.startsWith("_local.")?this.getNestedProperty(m._local||{},y.slice(7)):m._local,S=f?.isEnabled()?f.startStateChange(y,w,d,{actionId:r.actionId,handlerType:"setState",source:`target=${a}`}):void 0,v=l==="replace"?"replace":l==="shallow"?"shallow":"deep",A=v!=="deep"?{...d,__mergeMode:v,...S?{__setStateId:S}:{}}:{...d,...S?{__setStateId:S}:{}};if(a==="global"){if(!this.globalStateUpdater){j.warn("Global state updater is not set"),S&&f&&f.completeStateChange(S);return}const x=g?.state?.get()||{},{__setStateId:R,__mergeMode:M,...O}=A,L=v==="deep"?this.deepMergeWithState(O,x):O,q={...L,...S?{__setStateId:S}:{},...v!=="deep"?{__mergeMode:v}:{}};return j.log("setState global:",q),this.globalStateUpdater(q,{render:c}),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"global",...v!=="deep"?{__mergeMode:v}:{},...L}}else if(a==="isolated"){const x=r.isolatedContext;if(x){const{__mergeMode:R,__setStateId:M,...O}=A;return x.mergeState(O,v),j.log("[handleSetState] isolated state updated:",O,"mergeMode:",v),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"isolated",...O}}else if(j.warn('[handleSetState] isolated target used but no IsolatedStateContext found. Make sure the component has "isolatedState" attribute. Falling back to local state.'),r.setState){const M=window.__g7PendingLocalState||r.state||{},O=v==="deep"?this.deepMergeWithState(A,M):A;return r.setState(O),S&&f&&setTimeout(()=>f.completeStateChange(S),0),O}else throw S&&f&&f.completeStateChange(S),new It("isolated target used but no IsolatedStateContext found and no setState function in context")}else if(a==="local"||a==="component"||a==="_local"){if(i==="parent"||i==="root"){const R=window.__g7LayoutContextStack||[];if(R.length>0){const M=i==="parent"?R[R.length-1]:R[0];if(M?.setState){const{__mergeMode:O,__setStateId:L,...q}=A,G=v==="deep"?this.deepMergeWithState(q,M.state||{}):q;return j.log(`[handleSetState] scope=${i}: 타겟 컨텍스트에 상태 업데이트`,G),M.setState(G),S&&f&&setTimeout(()=>f.completeStateChange(S),0),G}}j.warn(`[handleSetState] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const x=r.setState&&!r._isDispatchFallbackContext;if(j.log("[handleSetState] isRealComponentContext:",x,"context.setState:",!!r.setState,"_isDispatchFallbackContext:",r._isDispatchFallbackContext),x){j.log("[handleSetState] Using COMPONENT setState path"),j.log("[handleSetState] resolvedPayload:",A),j.log("[handleSetState] context.state:",r.state),j.log("[handleSetState] mergeMode:",v);const M=window.__g7PendingLocalState||r.state||{},O=v==="deep"?this.deepMergeWithState(A,{}):A;j.log("[handleSetState] convertedPayload (변경 필드만, dot notation 변환):",O),r.setState(O);const L=v==="deep"?this.deepMergeWithState(A,M):v==="shallow"?{...r.state||{},...A}:A,{__mergeMode:q,__setStateId:G,...B}=L;window.__g7PendingLocalState=B,j.log("[handleSetState] __g7PendingLocalState updated:",B),this.globalStateUpdater&&(this.globalStateUpdater({_local:B},{render:!1}),j.log("[handleSetState] _global._local synced (render:false):",B));const{__mergeMode:K,__setStateId:fe,...Ce}=A;if(v==="replace")window.__g7ForcedLocalFields=Ce;else{const ke=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=this.deepMergeWithState(Ce,ke)}return j.log("[handleSetState] __g7ForcedLocalFields updated:",Ce),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"local",...L}}else if(this.globalStateUpdater){j.log("[handleSetState] Using GLOBAL STATE UPDATER path for _local");const M=window.__g7PendingLocalState||m._local||{};j.log("[handleSetState] currentLocal (with pending):",M);const O=v==="deep"?this.deepMergeWithState(A,M):A;return j.log("[handleSetState] finalLocal (merged):",O),this.globalStateUpdater({_local:O},{render:c}),window.__g7PendingLocalState=O,j.log("[handleSetState] __g7PendingLocalState updated for globalStateUpdater path"),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"local",...O}}else throw S&&f&&f.completeStateChange(S),new It("setState function is not provided in context and globalStateUpdater is not set")}else if(a.startsWith("_local.")){const x=a.slice(7),{__mergeMode:R,__setStateId:M,...O}=A,L=O.value!==void 0?O.value:Object.values(O)[0];if(r.setState){const G=window.__g7PendingLocalState||r.state||{},B=this.createNestedUpdate(x,L,G),K={...G,...B};if(r.setState(B),this.globalStateUpdater&&i!=="parent"&&i!=="root"){const fe=window.__templateApp?.getGlobalState?.()?._local,Ce=fe&&typeof fe=="object"?{...fe,...B}:K;this.globalStateUpdater({_local:Ce},{render:!1}),j.log("[handleSetState] _global._local synced for dot notation (render:false):",Ce)}return S&&f&&setTimeout(()=>f.completeStateChange(S),0),K}else throw S&&f&&f.completeStateChange(S),new It("setState function is not provided in context")}else{if(!r.setState)throw S&&f&&f.completeStateChange(S),new It("setState function is not provided in context");const R=window.__g7PendingLocalState||r.state||{},M=v==="deep"?this.deepMergeWithState(A,R):A;return r.setState(M),S&&f&&setTimeout(()=>f.completeStateChange(S),0),M}}async handleParentScopeSetState(e,r,a,i){const l=Vn(),c=window.G7Core,d=a==="replace"?"replace":a==="shallow"?"shallow":"deep",f=e.startsWith("$parent."),g=f?"$parent.":"$root.",m=e.slice(g.length);let y,w;if(m==="_local"||m==="_global")y=m,w=void 0;else if(m.startsWith("_local."))y="_local",w=m.slice(7);else if(m.startsWith("_global."))y="_global",w=m.slice(8);else{j.warn(`[handleParentScopeSetState] 지원하지 않는 타겟 형식: ${e}. _local 또는 _global으로 시작해야 합니다.`);return}const S=window.__g7LayoutContextStack||[];if(S.length===0){j.warn(`[handleParentScopeSetState] 레이아웃 컨텍스트 스택이 비어있습니다. target=${e}`);return}const v=f?S[S.length-1]:S[0];if(!v){j.warn(`[handleParentScopeSetState] 타겟 컨텍스트를 찾을 수 없습니다. target=${e}`);return}const A=y==="_global"?v.state?._global:v.state?._local,x=l?.isEnabled()?l.startStateChange(e,A,r,{actionId:i.actionId,handlerType:"setState",source:`target=${e}`}):void 0,{__mergeMode:R,__setStateId:M,...O}=r;if(y==="_global"){if(!this.globalStateUpdater){j.warn("[handleParentScopeSetState] globalStateUpdater가 설정되지 않았습니다."),x&&l&&l.completeStateChange(x);return}const L=c?.state?.get()||{};if(w){const q=O.value!==void 0?O.value:Object.values(O)[0],G=this.createNestedUpdate(w,q,L),B={...L,...G};j.log(`[handleParentScopeSetState] ${e}: 전역 상태 중첩 경로 업데이트`,B),this.globalStateUpdater(B)}else{const q=d==="deep"?this.deepMergeWithState(O,L):O;j.log(`[handleParentScopeSetState] ${e}: 전역 상태 업데이트 (mergeMode=${d})`,q),this.globalStateUpdater(d!=="deep"?{...q,__mergeMode:d}:q)}return x&&l&&setTimeout(()=>l.completeStateChange(x),0),{__target:e,...O}}else{if(!v.setState){j.warn(`[handleParentScopeSetState] 타겟 컨텍스트에 setState가 없습니다. target=${e}`),x&&l&&l.completeStateChange(x);return}const L=v.state||{};if(w){const q=O.value!==void 0?O.value:Object.values(O)[0],G=this.createNestedUpdate(w,q,L),B={...L,...G};return j.log(`[handleParentScopeSetState] ${e}: 로컬 상태 중첩 경로 업데이트`,G),v.setState(G),v.state=B,v.dataContext&&(v.dataContext._local=B),Nd(),x&&l&&setTimeout(()=>l.completeStateChange(x),0),B}else{const q=d!=="deep"?{...O,__mergeMode:d}:O,G=d==="replace"?O:d==="shallow"?{...L,...O}:this.deepMergeWithState(O,L);return j.log(`[handleParentScopeSetState] ${e}: 로컬 상태 업데이트 (mergeMode=${d})`,G),v.setState(q),v.state=G,v.dataContext&&(v.dataContext._local=G),Nd(),x&&l&&setTimeout(()=>l.completeStateChange(x),0),G}}}deepMergeWithState(e,r){const a=["errors"];let i=e;if("..."in e){const c=e["..."];if(c&&typeof c=="object"&&!Array.isArray(c)){const{"...":d,...f}=e;i={...c,...f}}else{const{"...":d,...f}=e;i=f}}const l={...r};for(const[c,d]of Object.entries(i)){if(a.includes(c)){l[c]=d;continue}if(c.includes(".")&&c!=="..."){const f=this.createNestedUpdate(c,d,l);this.deepMergeInto(l,f,l);continue}if(d!==null&&typeof d=="object"&&!Array.isArray(d)&&Object.getPrototypeOf(d)!==Object.prototype&&Object.getPrototypeOf(d)!==null){l[c]=d;continue}d!==null&&typeof d=="object"&&!Array.isArray(d)&&r[c]!==null&&typeof r[c]=="object"&&!Array.isArray(r[c])?l[c]=this.deepMergeWithState(d,r[c]):l[c]=d}return l}deepMergeInto(e,r,a){for(const[i,l]of Object.entries(r)){if(l===null){e[i]=l;continue}if(e[i]===null){e[i]=l;continue}typeof l=="object"&&!Array.isArray(l)&&e[i]!==void 0&&e[i]!==null&&typeof e[i]=="object"&&!Array.isArray(e[i])?(e[i]===a[i]&&(e[i]={...e[i]}),this.deepMergeInto(e[i],l,a[i]||{})):typeof l=="object"&&!Array.isArray(l)&&e[i]===void 0&&a[i]!==null&&typeof a[i]=="object"&&!Array.isArray(a[i])?e[i]={...a[i],...l}:e[i]=l}}createNestedUpdate(e,r,a){const i=e.split(".");if(i.length===1)return{[i[0]]:r};const l={};let c=l,d=a;for(let f=0;f<i.length-1;f++){const g=i[f],m=d?.[g],y=m!=null&&typeof m=="object"&&!Array.isArray(m);y?c[g]={...m}:c[g]={},c=c[g],d=y?m:{}}return c[i[i.length-1]]=r,l}buildNestedUpdate(e,r){const a=e.split(".");if(a.length===1)return{[a[0]]:r};const i={};let l=i;for(let c=0;c<a.length-1;c++)l[a[c]]={},l=l[a[c]];return l[a[a.length-1]]=r,i}async handleSetError(e,r,a){let i=e;i=this.resolveValue(i,a.data),this.translationEngine&&this.translationContext&&i.startsWith("$t:")&&(i=this.translationEngine.resolveTranslations(i,this.translationContext,a.data));const l=r?.stateTarget||"local";l==="isolated"&&a.isolatedContext?(a.isolatedContext.mergeState({apiError:i}),j.log("[handleSetError] Error set to isolated state:",i)):l==="global"&&this.globalStateUpdater?(this.globalStateUpdater({apiError:i}),j.log("[handleSetError] Error set to global state:",i)):a.setState?(a.setState({apiError:i}),j.log("[handleSetError] Error set to local state:",i)):j.warn("[handleSetError] Cannot set error: no state updater available")}async handleOpenModal(e,r){if(!this.globalStateUpdater){j.warn("Global state updater is not set for openModal");return}const a=r.data?._global?.modalStack||[];if(a.includes(e)){j.warn(`Modal "${e}" is already open`);return}const i=window.G7Core,l=r.setState&&r.state!==void 0,c=l?void 0:i?.state?.getLocal?.()||{},d=!l&&c!==void 0&&this.globalStateUpdater;if(l||d){const m=window.__g7LayoutContextStack||[],y=l?r.state:c,w=l?r.setState:S=>{this.globalStateUpdater({_local:S})};m.push({state:y,setState:w,dataContext:{_local:y||r.data?._local,_global:l?r.data?._global:r.data?._global||i?.state?.get?.(),_computed:r.data?._computed}}),window.__g7LayoutContextStack=m,j.log(`[handleOpenModal] 레이아웃 컨텍스트 스택에 push, 스택 크기: ${m.length}, state:`,y,l?"(direct)":"(fallback via G7Core)")}else j.warn(`[handleOpenModal] 컨텍스트 스택에 push 실패 - setState: ${!!r.setState}, state: ${r.state!==void 0}, G7Core: ${!!i?.state?.getLocal}`);const f=[...a,e];this.globalStateUpdater({modalStack:f,activeModal:e});const g=Vn();if(g?.isEnabled()){const m=a.length>0?a[a.length-1]:void 0;g.trackModalOpen?.({modalId:e,modalName:e,scopeType:"isolated",parentModalId:m,initialState:r.state?{...r.state}:{}})}}async handleCloseModal(e){if(!this.globalStateUpdater){j.warn("Global state updater is not set for closeModal");return}const r=e?.data?._global?.modalStack||[],a=r.length>0?r[r.length-1]:null,i=r.slice(0,-1),l=i.length>0?i[i.length-1]:null,c=window.__g7LayoutContextStack||[];if(c.length>0){const d=c[c.length-1];d&&(d.dataContext=void 0),c.pop(),window.__g7LayoutContextStack=c,j.log(`[handleCloseModal] 레이아웃 컨텍스트 스택에서 pop, 스택 크기: ${c.length}`)}if(a){const d=Vn();d?.isEnabled()&&d.trackModalClose?.(a,e?.state)}this.globalStateUpdater({modalStack:i,activeModal:l})}async handleShowAlert(e,r){let a=e;this.translationEngine&&this.translationContext&&e.startsWith("$t:")&&(a=this.translationEngine.resolveTranslations(e,this.translationContext,r.data)),alert(a)}async handleToast(e,r){const{type:a="info",message:i,icon:l,duration:c}=e;if(a==="error"){const f=r.data?.error;if((f?.error_code==="identity_verification_required"||f?.data?.error_code==="identity_verification_required")&&mt.consumeDomainNoticeShown()){j.log("[Toast] IDV 도메인 안내 표출됨 — 중복 가드 토스트 1건 skip");return}}let d=i;if(this.translationEngine&&this.translationContext&&i?.startsWith("$t:")&&(d=this.translationEngine.resolveTranslations(i,this.translationContext,r.data)),this.globalStateUpdater){const g={id:`toast_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,type:a,message:d,...l&&{icon:l},...c&&{duration:c}},S=[...window.G7Core?.state?.get()?.toasts||[],g];this.globalStateUpdater({toasts:S})}else j.log(`[Toast ${a}] ${d}`)}async handleSwitch(e,r){const{cases:a}=e;if(!a){j.warn("switch handler requires cases property");return}const i=this.resolveParams(e.params,r.data);let l;if(i?.value!==void 0?(l=i.value,j.log("switch handler: using params.value as case key:",l)):(l=r.data?.$args?.[0],j.log("switch handler: using $args[0] as case key:",l)),l==null){if(a.default)return j.log("switch handler: case key is undefined, using default case"),await this.executeAction(a.default,r);j.warn("switch handler: case key is not defined and no default case");return}const c=String(l);let d=a[c];if(!d&&a.default&&(j.log(`switch handler: no case found for key "${c}", using default case`),d=a.default),!d){j.warn(`switch handler: no case found for key "${c}" and no default case`);return}return await this.executeAction(d,r)}async handleConditions(e,r){const{conditions:a}=e;if(!a||!Array.isArray(a)){j.warn("conditions handler requires conditions array");return}const i=r.data||{},l=sp(a,i,this.bindingEngine);if(!l.matched){j.log("conditions handler: no matching branch found");return}const c=a[l.branchIndex];if(j.log(`conditions handler: matched branch ${l.branchIndex}`),!c.then){j.warn('conditions handler: matched branch has no "then" action');return}return Array.isArray(c.then)?await this.handleSequence({...e,actions:c.then},r):await this.executeAction(c.then,r)}handleStartInterval(e,r){const a=typeof e.id=="string"?e.id:"",i=Number(e.intervalMs??1e3),l=Array.isArray(e.actions)?e.actions:[];if(a===""||!l.length||i<=0)return j.warn("startInterval requires non-empty id, positive intervalMs, and actions array"),{success:!1};const c=this.intervals.get(a);c&&(clearInterval(c),this.intervals.delete(a));const d=setInterval(()=>{for(const f of l)this.executeAction(f,r).catch(g=>{j.error(`[startInterval:${a}] tick action failed`,g)})},i);return this.intervals.set(a,d),{success:!0,id:a}}handleStopInterval(e){const r=typeof e.id=="string"?e.id:"";if(r==="")return j.warn("stopInterval requires id parameter"),{success:!1};const a=this.intervals.get(r);return a&&(clearInterval(a),this.intervals.delete(r)),{success:!0,id:r}}stopAllIntervals(){for(const e of this.intervals.values())clearInterval(e);this.intervals.clear()}async handleSequence(e,r){const a=e.actions||e.params?.actions;if(!a||!Array.isArray(a)||a.length===0)return j.warn("sequence handler requires non-empty actions array"),[];const i=Vn(),l=i?.isEnabled()&&i.startSequenceExecution?.({eventType:e.type})||"";window.__g7SequenceLocalSync=void 0;const c=[];let d,f=r.state?{...r.state}:{},g=r.isolatedContext?.state?{...r.isolatedContext.state}:{},m=r.data?._computed||{};const y=window.G7Core,w=()=>({_global:y?.state?.get()||{},_local:{...f},_isolated:Object.keys(g).length>0?{...g}:void 0});for(let S=0;S<a.length;S++){const v=a[S],A=Date.now();l&&i?.isEnabled()&&i.captureSequenceActionBefore?.(l,S,v.handler||"unknown",v.params||{},w());const x={...r,state:f,data:{...r.data,_local:f,_computed:m,$computed:m,$prev:d,$results:[...c],_isolated:g},isolatedContext:r.isolatedContext?{...r.isolatedContext,state:g}:null};try{const R=await this.executeAction(v,x);if(d=R.data,c.push(R.data),v.handler==="setState"&&R.data!==void 0){if(R.data.__target==="global"){const{__target:O,__mergeMode:L,...q}=R.data;L==="replace"?f={...f,_global:q}:f={...f,_global:{...f._global||{},...q}},j.log("[handleSequence] global state synchronized (mergeMode=%s):",L||"deep",f._global)}else if(R.data.__target==="isolated"){const{__target:O,__mergeMode:L,...q}=R.data;L==="replace"?g=q:g={...g,...q},j.log("[handleSequence] isolated state synchronized (mergeMode=%s):",L||"deep",g)}else if(R.data.__target==="local"){const{__target:O,__mergeMode:L,__setStateId:q,...G}=R.data;L==="replace"?f=G:f={...f,...G},j.log("[handleSequence] local state synchronized (mergeMode=%s):",L||"deep",f)}else f=R.data,j.log("[handleSequence] state synchronized (legacy):",f);const M=r.data?._computedDefinitions;if(M&&Object.keys(M).length>0){const O={},L={...r.data,_local:f,_computed:O,$computed:O,_isolated:g};for(const[q,G]of Object.entries(M))if(typeof G=="string"){const B=G.trim();if(B.startsWith("{{")&&B.endsWith("}}"))try{const K=B.slice(2,-2).trim();O[q]=Gn(K)?this.bindingEngine.evaluatePipeExpression(K,L,{skipCache:!0}):this.bindingEngine.evaluateExpression(K,L,{skipCache:!0})}catch{O[q]=m[q]}}m=O,j.log("[handleSequence] _computed recalculated after setState:",m)}}if(v.handler!=="setState"){const M=window.__g7SequenceLocalSync;if(M&&M!==f){f=M,window.__g7SequenceLocalSync=void 0,j.log("[handleSequence] currentState synchronized from __g7SequenceLocalSync after custom handler:",v.handler);const O=r.data?._computedDefinitions;if(O&&Object.keys(O).length>0){const L={},q={...r.data,_local:f,_computed:L,$computed:L,_isolated:g};for(const[G,B]of Object.entries(O))if(typeof B=="string"){const K=B.trim();if(K.startsWith("{{")&&K.endsWith("}}"))try{const fe=K.slice(2,-2).trim();L[G]=Gn(fe)?this.bindingEngine.evaluatePipeExpression(fe,q,{skipCache:!0}):this.bindingEngine.evaluateExpression(fe,q,{skipCache:!0})}catch{L[G]=m[G]}}m=L,j.log("[handleSequence] _computed recalculated after custom handler:",m)}}}l&&i?.isEnabled()&&i.captureSequenceActionAfter?.(l,S,w(),Date.now()-A,R.data)}catch(R){throw l&&i?.isEnabled()&&(i.captureSequenceActionAfter?.(l,S,w(),Date.now()-A,void 0,R),i.endSequenceExecution?.(l,R)),j.error(`sequence handler: action[${S}] failed:`,R),R}}return window.__g7SequenceLocalSync=void 0,l&&i?.isEnabled()&&i.endSequenceExecution?.(l),c}async handleParallel(e,r){const a=e.actions||e.params?.actions;if(!a||!Array.isArray(a)||a.length===0)return j.warn("parallel handler requires non-empty actions array"),[];j.log(`parallel handler: executing ${a.length} actions in parallel`);const i=r.isolatedContext?{...r.isolatedContext,state:{...r.isolatedContext.state}}:null,l=a.map((f,g)=>{const m={...r,isolatedContext:i};return this.executeAction(f,m).catch(y=>{throw j.error(`parallel handler: action[${g}] failed:`,y),y})}),c=await Promise.allSettled(l),d=c.filter(f=>f.status==="rejected").length;return d>0&&j.warn(`parallel handler: ${d}/${a.length} actions failed`),c}async handleLoadScript(e,r,a){const{src:i,id:l,async:c=!0,defer:d=!1}=e;if(!i)throw new It('loadScript handler requires "src" parameter',r);const f=l||`script_${i.replace(/[^a-zA-Z0-9]/g,"_")}`;return fs.loadedScripts.has(f)?(j.log(`loadScript: script already loaded, skipping: ${f}`),r.onLoad&&await this.executeAction(r.onLoad,a),!0):document.getElementById(f)?(j.log(`loadScript: script element already exists: ${f}`),fs.loadedScripts.add(f),r.onLoad&&await this.executeAction(r.onLoad,a),!0):(j.log(`loadScript: loading script: ${i}`),new Promise((m,y)=>{const w=document.createElement("script");w.id=f,w.src=i,w.async=c,w.defer=d,w.onload=async()=>{if(j.log(`loadScript: script loaded successfully: ${f}`),fs.loadedScripts.add(f),r.onLoad)try{await this.executeAction(r.onLoad,a)}catch(S){j.error("loadScript: onLoad action failed:",S)}m(!0)},w.onerror=S=>{j.error(`loadScript: failed to load script: ${i}`,S),y(new It(`Failed to load script: ${i}`,r))},document.head.appendChild(w)}))}async handleCallExternal(e,r,a){const i=e.constructor,l=e.args||{},c=e.method,d=e.methodArgs||[],f=e.callbackEvent,g=e.embedTarget,m=e.callbackSetState,y=e.callbackAction;if(!i)throw new It('callExternal handler requires "constructor" parameter',r);const w=this.getNestedProperty(window,i);if(!w||typeof w!="function")throw new It(`Constructor not found or not a function: ${i}. Make sure the script is loaded first using loadScript handler.`,r);j.log(`callExternal: calling constructor ${i}`);const S={...l};for(const[A,x]of Object.entries(l))x===!0&&(S[A]=R=>{if(j.log(`callExternal: callback triggered for ${A}`,R),f&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(f,R),m&&a.setState){const M=q=>{const G={};for(const[B,K]of Object.entries(q))typeof K=="string"?G[B]=this.getNestedProperty(R,K):typeof K=="object"&&K!==null&&(G[B]=M(K));return G},O=M(m);j.log("callExternal: callbackSetState mapping result",O);const L=this.deepMergeWithState(O,a.state||{});j.log("callExternal: merged with existing state",L),a.setState(L)}else f&&a.setState&&a.setState({[`${f.replace(/:/g,"_")}_result`]:R});if(y){const M={...a,data:{...a.data,$event:R}},O=Array.isArray(y)?y:[y];for(const L of O)try{this.executeAction(L,M)}catch(q){j.error("callExternal: callbackAction failed:",q)}}});const v=new w(S);if(c&&typeof v[c]=="function"){if(j.log(`callExternal: calling method ${c}`),c==="embed"&&g){const A=document.querySelector(g);if(A)return v[c](A,...d);throw new It(`Embed target element not found: ${g}`,r)}return v[c](...d)}return v}async handleCallExternalEmbed(e,r,a){const i=e.constructor,l=e.args||{},c=e.callbackSetState,d=e.callbackEvent,f=e.layerClassName,g=e.callbackAction;if(!i)throw new It('callExternalEmbed handler requires "constructor" parameter',r);const m=this.getNestedProperty(window,i);if(!m||typeof m!="function")throw new It(`Constructor not found or not a function: ${i}. Make sure the script is loaded first.`,r);j.log(`callExternalEmbed: creating layer for ${i}`);const{layer:y,closeLayer:w}=this.createEmbedLayer(f),S={...l};for(const[A,x]of Object.entries(l))x===!0&&(S[A]=R=>{if(j.log(`callExternalEmbed: callback triggered for ${A}`,R),w(),d&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(d,R),c&&a.setState){const M=q=>{const G={};for(const[B,K]of Object.entries(q))typeof K=="string"?G[B]=this.getNestedProperty(R,K):typeof K=="object"&&K!==null&&(G[B]=M(K));return G},O=M(c);j.log("callExternalEmbed: callbackSetState mapping result",O);const L=this.deepMergeWithState(O,a.state||{});j.log("callExternalEmbed: merged with existing state",L),a.setState(L)}if(g){const M={...a,data:{...a.data,$event:R}},O=Array.isArray(g)?g:[g];for(const L of O)try{this.executeAction(L,M)}catch(q){j.error("callExternalEmbed: callbackAction failed:",q)}}});const v=new m(S);if(typeof v.embed=="function")v.embed(y),j.log("callExternalEmbed: embedded in layer");else throw w(),new It(`Constructor ${i} does not have embed method`,r);return v}isImeComposing(e){return e?.isComposing===!0||e?.keyCode===229}createEmbedLayer(e){const r=document.createElement("div");r.id="g7-embed-overlay",r.style.cssText=`
position: fixed;
inset: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
`;const a=document.createElement("div");a.id="g7-embed-layer",a.style.cssText=`
position: relative;
background: white;
border-radius: 8px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
max-width: 90vw;
max-height: 90vh;
overflow: hidden;
`,e&&(a.className=e);const i=document.createElement("button");i.type="button",i.innerHTML="×",i.style.cssText=`
position: absolute;
top: 8px;
right: 8px;
width: 32px;
height: 32px;
border: none;
background: rgba(0, 0, 0, 0.1);
border-radius: 50%;
font-size: 20px;
cursor: pointer;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
color: #666;
transition: background-color 0.2s;
`,i.onmouseenter=()=>{i.style.backgroundColor="rgba(0, 0, 0, 0.2)"},i.onmouseleave=()=>{i.style.backgroundColor="rgba(0, 0, 0, 0.1)"};const l=()=>{r.parentNode&&r.parentNode.removeChild(r)};i.onclick=l;const c=d=>{this.isImeComposing(d)||d.key==="Escape"&&(l(),document.removeEventListener("keydown",c))};return document.addEventListener("keydown",c),r.onclick=d=>{d.target===r&&l()},a.appendChild(i),r.appendChild(a),document.body.appendChild(r),{overlay:r,layer:a,closeLayer:l}}getNestedProperty(e,r){return r.split(".").reduce((a,i)=>a&&a[i]!==void 0?a[i]:void 0,e)}async handleSaveToLocalStorage(e,r){const{key:a,value:i}=e;if(!a)return j.error("saveToLocalStorage: key parameter is required"),!1;try{const l=typeof i=="string"?i:JSON.stringify(i);return localStorage.setItem(a,l),j.log(`saveToLocalStorage: saved ${a}`,i),!0}catch(l){return j.error("saveToLocalStorage: failed to save",{key:a,error:l}),!1}}async handleLoadFromLocalStorage(e,r){const{key:a,target:i,stateKey:l,defaultValue:c}=e;if(!a)return j.error("loadFromLocalStorage: key parameter is required"),c;try{const d=localStorage.getItem(a);if(d===null)return j.log(`loadFromLocalStorage: no value found for ${a}, using default`),l&&r.setState&&r.setState({[l]:c}),c;let f;try{f=JSON.parse(d)}catch{f=d}return j.log(`loadFromLocalStorage: loaded ${a}`,f),l&&r.setState&&r.setState({[l]:f}),f}catch(d){return j.error("loadFromLocalStorage: failed to load",{key:a,error:d}),c}}async handleCustomAction(e,r){const a=this.customHandlers.get(e.handler);if(!a){if(this.previewMode){j.warn(`[Preview] Unknown action handler "${e.handler}" — skipped (preview mode)`);return}const i=new It(`Unknown action handler: ${e.handler}`,e);throw i.unknownHandler=!0,i}return await a(e,r)}resolveParams(e,r){if(!e)return{};const a={};for(const[i,l]of Object.entries(e))i.includes("{{")&&j.warn(`[resolveParams] setState params의 키에 표현식이 포함되어 있습니다: "${i}". 키는 해석되지 않습니다. 배열 항목 수정은 .map()/.filter() 패턴을 사용하세요.`),typeof l=="string"&&l.includes("{{")?a[i]=this.evaluateExpression(l,r):typeof l=="string"?a[i]=l:Array.isArray(l)?a[i]=l.map(c=>typeof c=="string"&&c.includes("{{")?this.evaluateExpression(c,r):c):typeof l=="object"&&l!==null&&!Array.isArray(l)&&Object.getPrototypeOf(l)!==Object.prototype&&Object.getPrototypeOf(l)!==null?a[i]=l:typeof l=="object"&&l!==null?a[i]=this.resolveParams(l,r):a[i]=l;return a}resolveValue(e,r){return r?this.bindingEngine.resolveBindings(e,r,{skipCache:!0}):e}evaluateExpressions(e,r){let a={};for(const[i,l]of Object.entries(e))if(i==="..."){let c=l;typeof l=="string"&&l.includes("{{")&&(c=this.evaluateExpression(l,r)),c&&typeof c=="object"&&!Array.isArray(c)&&(a={...a,...c})}else typeof l=="string"&&l.includes("{{")?a[i]=this.evaluateExpression(l,r):typeof l=="object"&&l!==null&&!Array.isArray(l)?a[i]=this.evaluateExpressions(l,r):a[i]=l;return a}evaluateExpressionsIfNeeded(e,r){const a={};for(const[i,l]of Object.entries(e))typeof l=="string"&&l.includes("{{")?a[i]=this.evaluateExpression(l,r):a[i]=l;return a}evaluateExpression(e,r){if(!r)return e;const a=Ta(e);if(a===null){let c=r;if(e.includes("_global")){const f=window.G7Core?.state?.get()?._global;f&&(c={...r,_global:f})}if(e.includes("_computed")||e.includes("$computed")){const f=window.__g7ActionContext?.computedRef?.current;f&&Object.keys(f).length>0&&(c={...c,_computed:f,$computed:f})}return this.bindingEngine.resolveBindings(e,c,{skipCache:!0})}let i=a;i=i.replace(/\$args\.(\d+)/g,"$args[$1]");let l=r;if(i.includes("_global")){const d=window.G7Core?.state?.get()?._global;d&&(l={...r,_global:d})}if(i.includes("_computed")||i.includes("$computed")){const d=window.__g7ActionContext?.computedRef?.current;d&&Object.keys(d).length>0&&(l={...l,_computed:d,$computed:d})}i.includes("_global.modules")&&(j.log("[evaluateExpression] expression:",i),j.log("[evaluateExpression] dataContext._global:",l._global),j.log("[evaluateExpression] dataContext._global?.modules:",l._global?.modules));try{const c=Gn(i)?this.bindingEngine.evaluatePipeExpression(i,l,{skipCache:!0}):this.bindingEngine.evaluateExpression(i,l);return i.includes("_global.modules")&&j.log("[evaluateExpression] result:",c),typeof c=="string"&&c.startsWith("$t:")&&this.translationEngine&&this.translationContext?this.translationEngine.resolveTranslations(c,this.translationContext,r):c}catch(c){return j.error("Expression evaluation failed:",e,c),e}}setDefaultContext(e){this.defaultContext={...this.defaultContext,...e}}setGlobalStateUpdater(e){this.globalStateUpdater=e}getGlobalStateUpdater(){return this.globalStateUpdater}async dispatchAction(e,r){const a={...this.defaultContext,...r,data:{...this.defaultContext.data,...r?.data}};if(e.confirm){let i=this.resolveValue(e.confirm,a.data);if(this.translationEngine&&this.translationContext&&i.startsWith("$t:")&&(i=this.translationEngine.resolveTranslations(i,this.translationContext,a.data)),!confirm(i))return{success:!1}}try{return await this.executeAction(e,a)}catch(i){if(j.error("dispatchAction failed:",i),e.onError){const l=i instanceof It&&i.originalError?{message:i.originalError.message,response:i.originalError.response}:{message:i instanceof Error?i.message:String(i)},c={...a,data:{...a.data,error:l}},d=Array.isArray(e.onError)?e.onError:[e.onError];for(const f of d)await this.executeAction(f,c)}return{success:!1,error:i instanceof Error?i:new Error(String(i))}}}registerHandler(e,r,a){this.customHandlers.set(e,r);const i=Vn();i?.isEnabled()&&i.trackHandlerRegistration(e,a?.category??"custom",a?.description,a?.source)}unregisterHandler(e){this.customHandlers.delete(e);const r=Vn();r?.isEnabled()&&r.trackHandlerUnregistration(e)}getRegisteredHandlers(){return Array.from(this.customHandlers.keys())}getHandler(e){return this.customHandlers.get(e)}normalizeDebounceConfig(e){return typeof e=="number"?{delay:e,leading:!1,trailing:!0}:{delay:e.delay,leading:e.leading??!1,trailing:e.trailing??!0}}extractEventData(e){const r=e.target;if(r&&!("tagName"in r)){const l={type:e.type??"custom",target:{value:r.value,name:r.name??""}};return e._changedKeys&&(l._changedKeys=e._changedKeys),l}const i=r?{value:r.value,name:r.name??"",checked:r.checked??!1,type:r.type??"",tagName:r.tagName}:{};if(e.type==="scroll"&&r){const l=r;i.scrollHeight=l.scrollHeight??0,i.scrollTop=l.scrollTop??0,i.clientHeight=l.clientHeight??0,i.scrollLeft=l.scrollLeft??0,i.clientWidth=l.clientWidth??0,i.scrollWidth=l.scrollWidth??0}return{type:e.type,target:r?i:null}}executeDebouncedAction(e,r,a,i,l){const c={...a,$event:r,$args:l},d={type:r.type,target:r.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(e,c,i)(d)}handleDebouncedAction(e,r,a,i,l,c){const d=this.normalizeDebounceConfig(e.debounce),f=l||`default-${e.handler}-${Date.now()}`,g=this.extractEventData(r),m=g._changedKeys;if(m&&Array.isArray(m)&&g?.target?.value&&typeof g.target.value=="object"&&!Array.isArray(g.target.value)){const v=this.debounceAccumulatedValues.get(f);if(v){const A={...v};for(const x of m)A[x]=g.target.value[x];g.target.value=A}this.debounceAccumulatedValues.set(f,g.target.value)}const y=this.debounceTimers.get(f);y&&(clearTimeout(y),this.debounceTimers.delete(f));const w=Vn();w?.isEnabled()&&w.trackAction({handler:typeof e.handler=="string"?e.handler:String(e.handler),type:e.type,status:"pending",params:e.params,debounce:{delay:d.delay,status:"pending",scheduledAt:Date.now()}});const S=!this.debounceTimers.has(f+"_leading");if(d.leading&&S&&(this.debounceTimers.set(f+"_leading",setTimeout(()=>{},0)),this.executeDebouncedAction(e,g,a,i,c),w?.isEnabled()&&w.trackAction({handler:typeof e.handler=="string"?e.handler:String(e.handler),type:e.type,status:"success",params:e.params,debounce:{delay:d.delay,status:"executed",executedAt:Date.now(),mode:"leading"}})),d.trailing){const v=()=>{this.executeDebouncedAction(e,g,a,i,c),w?.isEnabled()&&w.trackAction({handler:typeof e.handler=="string"?e.handler:String(e.handler),type:e.type,status:"success",params:e.params,debounce:{delay:d.delay,status:"executed",executedAt:Date.now(),mode:"trailing"}})},A=setTimeout(()=>{this.debounceTimers.delete(f),this.debounceTimers.delete(f+"_leading"),this.pendingDebounceFlushers.delete(f),this.debounceAccumulatedValues.delete(f),v()},d.delay);this.debounceTimers.set(f,A),this.pendingDebounceFlushers.set(f,v)}}clearDebounceTimers(e){if(e)for(const[r,a]of this.debounceTimers)r.startsWith(e+"-")&&(clearTimeout(a),this.debounceTimers.delete(r),this.pendingDebounceFlushers.delete(r),this.debounceAccumulatedValues.delete(r));else{for(const r of this.debounceTimers.values())clearTimeout(r);this.debounceTimers.clear(),this.pendingDebounceFlushers.clear(),this.debounceAccumulatedValues.clear()}}debouncedCall(e,r,a){const i=this.debounceTimers.get(e);i&&(clearTimeout(i),this.debounceTimers.delete(e));const l=setTimeout(()=>{this.debounceTimers.delete(e),this.pendingDebounceFlushers.delete(e),a()},r);this.debounceTimers.set(e,l),this.pendingDebounceFlushers.set(e,a)}flushPendingDebounceTimers(){if(this.pendingDebounceFlushers.size===0)return;const e=new Map(this.pendingDebounceFlushers);for(const[r,a]of e){const i=this.debounceTimers.get(r);i&&(clearTimeout(i),this.debounceTimers.delete(r)),this.debounceTimers.delete(r+"_leading"),this.pendingDebounceFlushers.delete(r),a()}this.globalStateUpdater&&this.globalStateUpdater({})}bindActionsToProps(e,r,a){const i={...e};if(e.actions&&Array.isArray(e.actions)){const l=new Map;for(const m of e.actions){const y=this.resolveActionRef(m),w=y.event?this.normalizeEventPropName(y.event):this.getEventHandlerName(y.type);l.has(w)||l.set(w,[]),l.get(w).push(y)}const c=e.name||e.id||"unknown",d=l.has("onDrop"),f=l.has("onDragOver"),g=l.has("onDragEnter");d&&!f&&(i.onDragOver=m=>{m.preventDefault()}),d&&!g&&(i.onDragEnter=m=>{m.preventDefault()});for(const[m,y]of l)i[m]=(...w)=>{for(const S of y){const v=w[0],A=v&&typeof v=="object"&&"preventDefault"in v;if(A&&(m==="onDragOver"||m==="onDrop")&&v.preventDefault(),A&&S.key&&"key"in v){if(this.isImeComposing(v)){j.log("Key filter skipped (IME composing):",S.key);continue}if(v.key!==S.key){j.log("Key filter not matched:",S.key,"actual:",v.key);continue}j.log("Key filter matched:",S.key)}if(S.debounce){const x=`${c}-${S.handler}-${m}`,R=v&&typeof v=="object"&&!("preventDefault"in v)&&"target"in v&&v.target!==null;let M;if(A)M=v;else if(R){const L={type:"custom",target:v.target,preventDefault:()=>{},stopPropagation:()=>{}};v._changedKeys&&(L._changedKeys=v._changedKeys),M=L}else M=new Event("custom");const O=S.event?{...r,$args:w}:r;this.handleDebouncedAction(S,M,O,a,x,w)}else if(this.flushPendingDebounceTimers(),S.event){const x={...r,$args:w},R=this.resolveEventForHandler(v,A);this.createHandler(S,x,a)(R)}else if(A)this.createHandler(S,r,a)(v);else if(v&&typeof v=="object"&&!("preventDefault"in v)&&"target"in v&&v.target!==null){const R={type:"custom",target:v.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(S,r,a)(R)}}}}return i}getEventHandlerName(e){return rm[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}normalizeEventPropName(e){return rm[e]??e}resolveEventForHandler(e,r){if(r)return e;if(!(e&&typeof e=="object"&&!("preventDefault"in e)&&"target"in e&&e.target!==null))return new Event("custom");const i={type:"custom",target:e.target,preventDefault:()=>{},stopPropagation:()=>{}};return e._changedKeys&&(i._changedKeys=e._changedKeys),i}sanitizeForDevTools(e,r=5){const a=new WeakSet,i=(l,c)=>{if(l==null||typeof l=="string"||typeof l=="number"||typeof l=="boolean")return l;if(c>r)return"[Max Depth Exceeded]";if(typeof l=="function")return`[Function: ${l.name||"anonymous"}]`;if(l instanceof Element)return`[Element: ${l.tagName}${l.className?"."+l.className.split(" ").join("."):""}]`;if(l instanceof Event)return`[Event: ${l.type}]`;if(Array.isArray(l)){if(a.has(l))return"[Circular Array]";a.add(l);const d=l.slice(0,10).map(f=>i(f,c+1));return l.length>10&&d.push(`... ${l.length-10} more items`),d}if(typeof l=="object"){if(a.has(l))return"[Circular Reference]";a.add(l);const d={},f=Object.keys(l),g=f.slice(0,20);for(const m of g)try{d[m]=i(l[m],c+1)}catch{d[m]="[Error accessing property]"}return f.length>20&&(d["..."]=`${f.length-20} more properties`),d}return String(l)};return i(e,0)}};$(fs,"loadedScripts",new Set);let mo=fs,oc=null;function am(o){return oc||(oc=new mo(o)),oc}function P0(o){oc=o}const im=ut("TransitionManager");class q0{constructor(){$(this,"isPending",!1);$(this,"subscribers",new Set)}setPending(e){this.isPending!==e&&(im.log("setPending:",{from:this.isPending,to:e,stack:new Error().stack}),this.isPending=e,this.notifySubscribers())}getIsPending(){return this.isPending}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}notifySubscribers(){im.log("notifySubscribers:",{isPending:this.isPending,subscriberCount:this.subscribers.size}),this.subscribers.forEach(e=>{e(this.isPending)})}clearSubscribers(){this.subscribers.clear()}}const zr=new q0,lc=ut("TransitionContext"),sm=N.createContext({isTransitioning:!1}),Id=({children:o})=>{const[e,r]=N.useState(()=>{const i=zr.getIsPending();return lc.log("Initial state:",i),i});N.useEffect(()=>{lc.log("Subscribing to TransitionManager");const i=zr.subscribe(l=>{lc.log("Received isPending update:",l),r(l)});return()=>{lc.log("Unsubscribing from TransitionManager"),i()}},[]);const a=N.useMemo(()=>({isTransitioning:e}),[e]);return dt.jsx(sm.Provider,{value:a,children:o})},om=()=>N.useContext(sm),cc="__g7LocalInitTracking";function Hd(){const o=globalThis;return o[cc]||(o[cc]={hash:"",timestamp:void 0,consumed:void 0}),o[cc]}function G0(){const o=globalThis;o[cc]={hash:"",timestamp:void 0,consumed:void 0}}function V0(o){Hd().consumed=o}function F0(o){return Hd().consumed===o}function K0(o){return o.globalTrackedKey!==o.trackingKey?"apply":o.instanceHandledKey===o.trackingKey?"skip":"prune"}function W0(o,e){return typeof o=="number"&&typeof e=="number"?Math.max(o,e):e??o}function Y0(o,e){if(e===void 0)return o;if(!(o!==null&&typeof o=="object"&&e!==null&&typeof e=="object"&&!F0(o)))return e;const{_forceLocalInit:a,...i}=o,{_forceLocalInit:l,...c}=e,d={...i,...c},f=W0(a,l);return f!==void 0&&(d._forceLocalInit=f),d}function X0(o){return o<768?"mobile":o<1024?"tablet":"desktop"}function lm(o){const e=X0(o);return{width:o,isMobile:e==="mobile",isTablet:e==="tablet",isDesktop:e==="desktop",matchedPreset:e}}const jd=N.createContext(lm(1024)),uc=({children:o,overrideWidth:e})=>{const[r,a]=N.useState(()=>mi.getWidth());N.useEffect(()=>{const c=mi.subscribe(d=>{a(d)});return()=>{c()}},[]);const i=e??r,l=N.useMemo(()=>lm(i),[i]);return dt.jsx(jd.Provider,{value:l,children:o})},zd=()=>N.useContext(jd);window.G7Core?.createLogger?.("Core:State");function J0(o,e,r,a){const{syncOnControlledChange:i=!0,isEqual:l}=a??{},c=o!==void 0;N.useRef(c);const[d,f]=N.useState(o!==void 0?o:e),g=d,m=N.useRef(o),y=N.useRef(!1);N.useEffect(()=>{if(y.current){m.current=o;return}i&&c&&o!==m.current&&(l?!l(d,o):d!==o)&&f(o),m.current=o},[o,c,i,l,d]);const w=N.useCallback(S=>{const v=typeof S=="function"?S(g):S;(l?l(g,v):g===v)||(y.current=!0,f(v),r?.(v),requestAnimationFrame(()=>{y.current=!1}))},[g,c,r,l]);return[g,w]}function Q0(o,e){return o===e?!0:o.length!==e.length?!1:o.every((r,a)=>r===e[a])}function cm(o,e){if(o===e)return!0;const r=Object.keys(o),a=Object.keys(e);return r.length!==a.length?!1:r.every(i=>o[i]===e[i])}const um=N.createContext({}),Z0=({children:o,value:e})=>dt.jsx(um.Provider,{value:e,children:o}),eC=()=>N.useContext(um),tC=(o,e)=>{if(!o)return;const r=e.split(".");let a=o;for(const i of r){if(a==null)return;a=a[i]}return a},nC=(o,e,r)=>{const a=e.split(".");if(a.length===1)return{...o,[a[0]]:r};const i={...o};let l=i;for(let c=0;c<a.length-1;c++){const d=a[c],f=a[c+1],g=/^\d+$/.test(f);Array.isArray(l[d])&&!g?l[d]={...l[d]}:Array.isArray(l[d])?l[d]=[...l[d]]:g?l[d]=Array.isArray(l[d])?[...l[d]]:[]:l[d]={...l[d]||{}},l=l[d]}return l[a[a.length-1]]=r,i},as=ut("IsolatedStateContext"),rC={state:{},setState:()=>{as.warn("IsolatedStateContext not available: setState called outside IsolatedStateProvider")},getState:()=>{},mergeState:()=>{as.warn("IsolatedStateContext not available: mergeState called outside IsolatedStateProvider")},stateRef:{current:{}},scopeId:""},dm=N.createContext(rC);let aC=0;function iC(){return`isolated-${++aC}-${Date.now().toString(36)}`}function fm(o,e){if(e==null)return o;if(typeof e!="object"||Array.isArray(e))return e;const r={...o};for(const a of Object.keys(e)){const i=e[a],l=o?.[a];i!==null&&typeof i=="object"&&!Array.isArray(i)&&l!==null&&typeof l=="object"&&!Array.isArray(l)?r[a]=fm(l,i):r[a]=i}return r}function sC(o,e){return e?e.split(".").reduce((r,a)=>r?.[a],o):o}function oC(o,e,r){const a=e.split("."),i={...o};let l=i;for(let c=0;c<a.length-1;c++){const d=a[c];l[d]={...l[d]},l=l[d]}return l[a[a.length-1]]=r,i}const lC=({initialState:o={},scopeId:e,children:r})=>{const i=N.useRef(e||iC()).current,[l,c]=N.useState(o),d=N.useRef(l);d.current=l;const f=N.useCallback(S=>sC(d.current,S),[]),g=N.useCallback((S,v)=>{c(A=>{const x=oC(A,S,v);return as.log(`[${i}] setState: ${S} =`,v),x})},[i]),m=N.useCallback((S,v="deep")=>{c(A=>{let x;return v==="replace"?x=S:v==="shallow"?x={...A,...S}:x=fm(A,S),as.log(`[${i}] mergeState (${v}):`,S),x})},[i]),y=N.useMemo(()=>({state:l,setState:g,getState:f,mergeState:m,stateRef:d,scopeId:i}),[l,g,f,m,i]),w=N.useMemo(()=>({state:d.current,setState:g,getState:f,mergeState:m}),[g,f,m]);return N.useEffect(()=>{const S=window.G7Core,v=window.__g7IsolatedStates||{};return window.__g7IsolatedStates||(window.__g7IsolatedStates=v),v[i]=w,S&&(S._isolatedStates||(S._isolatedStates={}),S._isolatedStates[i]=l),S?.devTools?.isEnabled?.()&&S.devTools.emit?.("isolated:created",{id:i,state:l}),as.log(`[${i}] IsolatedStateProvider mounted with initial state:`,l),()=>{delete v[i],S?._isolatedStates&&delete S._isolatedStates[i],S?.devTools?.isEnabled?.()&&S.devTools.emit?.("isolated:destroyed",{id:i}),as.log(`[${i}] IsolatedStateProvider unmounted`)}},[i,w]),N.useEffect(()=>{const S=window.G7Core,v=window.__g7IsolatedStates;v?.[i]&&(v[i].state=l),S?._isolatedStates&&(S._isolatedStates[i]=l),S?.devTools?.isEnabled?.()&&S.devTools.emit?.("isolated:updated",{id:i,state:l})},[l,i]),dt.jsx(dm.Provider,{value:y,children:r})},cC=()=>{const o=N.useContext(dm);return o.scopeId?o:null};var Oa=jg();function uC(){for(var o=arguments.length,e=new Array(o),r=0;r<o;r++)e[r]=arguments[r];return N.useMemo(()=>a=>{e.forEach(i=>i(a))},e)}const dc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function is(o){const e=Object.prototype.toString.call(o);return e==="[object Window]"||e==="[object global]"}function Ud(o){return"nodeType"in o}function Dn(o){var e,r;return o?is(o)?o:Ud(o)&&(e=(r=o.ownerDocument)==null?void 0:r.defaultView)!=null?e:window:window}function Bd(o){const{Document:e}=Dn(o);return o instanceof e}function yo(o){return is(o)?!1:o instanceof Dn(o).HTMLElement}function hm(o){return o instanceof Dn(o).SVGElement}function ss(o){return o?is(o)?o.document:Ud(o)?Bd(o)?o:yo(o)||hm(o)?o.ownerDocument:document:document:document}const Ur=dc?N.useLayoutEffect:N.useEffect;function Pd(o){const e=N.useRef(o);return Ur(()=>{e.current=o}),N.useCallback(function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return e.current==null?void 0:e.current(...a)},[])}function dC(){const o=N.useRef(null),e=N.useCallback((a,i)=>{o.current=setInterval(a,i)},[]),r=N.useCallback(()=>{o.current!==null&&(clearInterval(o.current),o.current=null)},[]);return[e,r]}function bo(o,e){e===void 0&&(e=[o]);const r=N.useRef(o);return Ur(()=>{r.current!==o&&(r.current=o)},e),r}function vo(o,e){const r=N.useRef();return N.useMemo(()=>{const a=o(r.current);return r.current=a,a},[...e])}function fc(o){const e=Pd(o),r=N.useRef(null),a=N.useCallback(i=>{i!==r.current&&e?.(i,r.current),r.current=i},[]);return[r,a]}function qd(o){const e=N.useRef();return N.useEffect(()=>{e.current=o},[o]),e.current}let Gd={};function So(o,e){return N.useMemo(()=>{if(e)return e;const r=Gd[o]==null?0:Gd[o]+1;return Gd[o]=r,o+"-"+r},[o,e])}function gm(o){return function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];return a.reduce((l,c)=>{const d=Object.entries(c);for(const[f,g]of d){const m=l[f];m!=null&&(l[f]=m+o*g)}return l},{...e})}}const os=gm(1),wo=gm(-1);function fC(o){return"clientX"in o&&"clientY"in o}function Vd(o){if(!o)return!1;const{KeyboardEvent:e}=Dn(o.target);return e&&o instanceof e}function hC(o){if(!o)return!1;const{TouchEvent:e}=Dn(o.target);return e&&o instanceof e}function Fd(o){if(hC(o)){if(o.touches&&o.touches.length){const{clientX:e,clientY:r}=o.touches[0];return{x:e,y:r}}else if(o.changedTouches&&o.changedTouches.length){const{clientX:e,clientY:r}=o.changedTouches[0];return{x:e,y:r}}}return fC(o)?{x:o.clientX,y:o.clientY}:null}const Co=Object.freeze({Translate:{toString(o){if(!o)return;const{x:e,y:r}=o;return"translate3d("+(e?Math.round(e):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(o){if(!o)return;const{scaleX:e,scaleY:r}=o;return"scaleX("+e+") scaleY("+r+")"}},Transform:{toString(o){if(o)return[Co.Translate.toString(o),Co.Scale.toString(o)].join(" ")}},Transition:{toString(o){let{property:e,duration:r,easing:a}=o;return e+" "+r+"ms "+a}}}),pm="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function gC(o){return o.matches(pm)?o:o.querySelector(pm)}const pC={display:"none"};function mC(o){let{id:e,value:r}=o;return We.createElement("div",{id:e,style:pC},r)}function yC(o){let{id:e,announcement:r,ariaLiveType:a="assertive"}=o;const i={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:i,role:"status","aria-live":a,"aria-atomic":!0},r)}function bC(){const[o,e]=N.useState("");return{announce:N.useCallback(a=>{a!=null&&e(a)},[]),announcement:o}}const mm=N.createContext(null);function vC(o){const e=N.useContext(mm);N.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(o)},[o,e])}function SC(){const[o]=N.useState(()=>new Set),e=N.useCallback(a=>(o.add(a),()=>o.delete(a)),[o]);return[N.useCallback(a=>{let{type:i,event:l}=a;o.forEach(c=>{var d;return(d=c[i])==null?void 0:d.call(c,l)})},[o]),e]}const wC={draggable:`
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
`},CC={onDragStart(o){let{active:e}=o;return"Picked up draggable item "+e.id+"."},onDragOver(o){let{active:e,over:r}=o;return r?"Draggable item "+e.id+" was moved over droppable area "+r.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(o){let{active:e,over:r}=o;return r?"Draggable item "+e.id+" was dropped over droppable area "+r.id:"Draggable item "+e.id+" was dropped."},onDragCancel(o){let{active:e}=o;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function EC(o){let{announcements:e=CC,container:r,hiddenTextDescribedById:a,screenReaderInstructions:i=wC}=o;const{announce:l,announcement:c}=bC(),d=So("DndLiveRegion"),[f,g]=N.useState(!1);if(N.useEffect(()=>{g(!0)},[]),vC(N.useMemo(()=>({onDragStart(y){let{active:w}=y;l(e.onDragStart({active:w}))},onDragMove(y){let{active:w,over:S}=y;e.onDragMove&&l(e.onDragMove({active:w,over:S}))},onDragOver(y){let{active:w,over:S}=y;l(e.onDragOver({active:w,over:S}))},onDragEnd(y){let{active:w,over:S}=y;l(e.onDragEnd({active:w,over:S}))},onDragCancel(y){let{active:w,over:S}=y;l(e.onDragCancel({active:w,over:S}))}}),[l,e])),!f)return null;const m=We.createElement(We.Fragment,null,We.createElement(mC,{id:a,value:i.draggable}),We.createElement(yC,{id:d,announcement:c}));return r?Oa.createPortal(m,r):m}var tn;(function(o){o.DragStart="dragStart",o.DragMove="dragMove",o.DragEnd="dragEnd",o.DragCancel="dragCancel",o.DragOver="dragOver",o.RegisterDroppable="registerDroppable",o.SetDroppableDisabled="setDroppableDisabled",o.UnregisterDroppable="unregisterDroppable"})(tn||(tn={}));function hc(){}function ym(o,e){return N.useMemo(()=>({sensor:o,options:e??{}}),[o,e])}function _C(){for(var o=arguments.length,e=new Array(o),r=0;r<o;r++)e[r]=arguments[r];return N.useMemo(()=>[...e].filter(a=>a!=null),[...e])}const wr=Object.freeze({x:0,y:0});function bm(o,e){return Math.sqrt(Math.pow(o.x-e.x,2)+Math.pow(o.y-e.y,2))}function vm(o,e){let{data:{value:r}}=o,{data:{value:a}}=e;return r-a}function AC(o,e){let{data:{value:r}}=o,{data:{value:a}}=e;return a-r}function Sm(o){let{left:e,top:r,height:a,width:i}=o;return[{x:e,y:r},{x:e+i,y:r},{x:e,y:r+a},{x:e+i,y:r+a}]}function wm(o,e){if(!o||o.length===0)return null;const[r]=o;return r[e]}function Cm(o,e,r){return e===void 0&&(e=o.left),r===void 0&&(r=o.top),{x:e+o.width*.5,y:r+o.height*.5}}const xC=o=>{let{collisionRect:e,droppableRects:r,droppableContainers:a}=o;const i=Cm(e,e.left,e.top),l=[];for(const c of a){const{id:d}=c,f=r.get(d);if(f){const g=bm(Cm(f),i);l.push({id:d,data:{droppableContainer:c,value:g}})}}return l.sort(vm)},TC=o=>{let{collisionRect:e,droppableRects:r,droppableContainers:a}=o;const i=Sm(e),l=[];for(const c of a){const{id:d}=c,f=r.get(d);if(f){const g=Sm(f),m=i.reduce((w,S,v)=>w+bm(g[v],S),0),y=Number((m/4).toFixed(4));l.push({id:d,data:{droppableContainer:c,value:y}})}}return l.sort(vm)};function kC(o,e){const r=Math.max(e.top,o.top),a=Math.max(e.left,o.left),i=Math.min(e.left+e.width,o.left+o.width),l=Math.min(e.top+e.height,o.top+o.height),c=i-a,d=l-r;if(a<i&&r<l){const f=e.width*e.height,g=o.width*o.height,m=c*d,y=m/(f+g-m);return Number(y.toFixed(4))}return 0}const RC=o=>{let{collisionRect:e,droppableRects:r,droppableContainers:a}=o;const i=[];for(const l of a){const{id:c}=l,d=r.get(c);if(d){const f=kC(d,e);f>0&&i.push({id:c,data:{droppableContainer:l,value:f}})}}return i.sort(AC)};function DC(o,e,r){return{...o,scaleX:e&&r?e.width/r.width:1,scaleY:e&&r?e.height/r.height:1}}function Em(o,e){return o&&e?{x:o.left-e.left,y:o.top-e.top}:wr}function OC(o){return function(r){for(var a=arguments.length,i=new Array(a>1?a-1:0),l=1;l<a;l++)i[l-1]=arguments[l];return i.reduce((c,d)=>({...c,top:c.top+o*d.y,bottom:c.bottom+o*d.y,left:c.left+o*d.x,right:c.right+o*d.x}),{...r})}}const LC=OC(1);function MC(o){if(o.startsWith("matrix3d(")){const e=o.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(o.startsWith("matrix(")){const e=o.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function $C(o,e,r){const a=MC(e);if(!a)return o;const{scaleX:i,scaleY:l,x:c,y:d}=a,f=o.left-c-(1-i)*parseFloat(r),g=o.top-d-(1-l)*parseFloat(r.slice(r.indexOf(" ")+1)),m=i?o.width/i:o.width,y=l?o.height/l:o.height;return{width:m,height:y,top:g,right:f+m,bottom:g+y,left:f}}const NC={ignoreTransform:!1};function ls(o,e){e===void 0&&(e=NC);let r=o.getBoundingClientRect();if(e.ignoreTransform){const{transform:g,transformOrigin:m}=Dn(o).getComputedStyle(o);g&&(r=$C(r,g,m))}const{top:a,left:i,width:l,height:c,bottom:d,right:f}=r;return{top:a,left:i,width:l,height:c,bottom:d,right:f}}function _m(o){return ls(o,{ignoreTransform:!0})}function IC(o){const e=o.innerWidth,r=o.innerHeight;return{top:0,left:0,right:e,bottom:r,width:e,height:r}}function HC(o,e){return e===void 0&&(e=Dn(o).getComputedStyle(o)),e.position==="fixed"}function jC(o,e){e===void 0&&(e=Dn(o).getComputedStyle(o));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const l=e[i];return typeof l=="string"?r.test(l):!1})}function gc(o,e){const r=[];function a(i){if(e!=null&&r.length>=e||!i)return r;if(Bd(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!yo(i)||hm(i)||r.includes(i))return r;const l=Dn(o).getComputedStyle(i);return i!==o&&jC(i,l)&&r.push(i),HC(i,l)?r:a(i.parentNode)}return o?a(o):r}function Am(o){const[e]=gc(o,1);return e??null}function Kd(o){return!dc||!o?null:is(o)?o:Ud(o)?Bd(o)||o===ss(o).scrollingElement?window:yo(o)?o:null:null}function xm(o){return is(o)?o.scrollX:o.scrollLeft}function Tm(o){return is(o)?o.scrollY:o.scrollTop}function Wd(o){return{x:xm(o),y:Tm(o)}}var on;(function(o){o[o.Forward=1]="Forward",o[o.Backward=-1]="Backward"})(on||(on={}));function km(o){return!dc||!o?!1:o===document.scrollingElement}function Rm(o){const e={x:0,y:0},r=km(o)?{height:window.innerHeight,width:window.innerWidth}:{height:o.clientHeight,width:o.clientWidth},a={x:o.scrollWidth-r.width,y:o.scrollHeight-r.height},i=o.scrollTop<=e.y,l=o.scrollLeft<=e.x,c=o.scrollTop>=a.y,d=o.scrollLeft>=a.x;return{isTop:i,isLeft:l,isBottom:c,isRight:d,maxScroll:a,minScroll:e}}const zC={x:.2,y:.2};function UC(o,e,r,a,i){let{top:l,left:c,right:d,bottom:f}=r;a===void 0&&(a=10),i===void 0&&(i=zC);const{isTop:g,isBottom:m,isLeft:y,isRight:w}=Rm(o),S={x:0,y:0},v={x:0,y:0},A={height:e.height*i.y,width:e.width*i.x};return!g&&l<=e.top+A.height?(S.y=on.Backward,v.y=a*Math.abs((e.top+A.height-l)/A.height)):!m&&f>=e.bottom-A.height&&(S.y=on.Forward,v.y=a*Math.abs((e.bottom-A.height-f)/A.height)),!w&&d>=e.right-A.width?(S.x=on.Forward,v.x=a*Math.abs((e.right-A.width-d)/A.width)):!y&&c<=e.left+A.width&&(S.x=on.Backward,v.x=a*Math.abs((e.left+A.width-c)/A.width)),{direction:S,speed:v}}function BC(o){if(o===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:e,left:r,right:a,bottom:i}=o.getBoundingClientRect();return{top:e,left:r,right:a,bottom:i,width:o.clientWidth,height:o.clientHeight}}function Dm(o){return o.reduce((e,r)=>os(e,Wd(r)),wr)}function PC(o){return o.reduce((e,r)=>e+xm(r),0)}function qC(o){return o.reduce((e,r)=>e+Tm(r),0)}function GC(o,e){if(e===void 0&&(e=ls),!o)return;const{top:r,left:a,bottom:i,right:l}=e(o);Am(o)&&(i<=0||l<=0||r>=window.innerHeight||a>=window.innerWidth)&&o.scrollIntoView({block:"center",inline:"center"})}const VC=[["x",["left","right"],PC],["y",["top","bottom"],qC]];class Yd{constructor(e,r){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 a=gc(r),i=Dm(a);this.rect={...e},this.width=e.width,this.height=e.height;for(const[l,c,d]of VC)for(const f of c)Object.defineProperty(this,f,{get:()=>{const g=d(a),m=i[l]-g;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Eo{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...r)})},this.target=e}add(e,r,a){var i;(i=this.target)==null||i.addEventListener(e,r,a),this.listeners.push([e,r,a])}}function FC(o){const{EventTarget:e}=Dn(o);return o instanceof e?o:ss(o)}function Xd(o,e){const r=Math.abs(o.x),a=Math.abs(o.y);return typeof e=="number"?Math.sqrt(r**2+a**2)>e:"x"in e&&"y"in e?r>e.x&&a>e.y:"x"in e?r>e.x:"y"in e?a>e.y:!1}var ar;(function(o){o.Click="click",o.DragStart="dragstart",o.Keydown="keydown",o.ContextMenu="contextmenu",o.Resize="resize",o.SelectionChange="selectionchange",o.VisibilityChange="visibilitychange"})(ar||(ar={}));function Om(o){o.preventDefault()}function KC(o){o.stopPropagation()}var ot;(function(o){o.Space="Space",o.Down="ArrowDown",o.Right="ArrowRight",o.Left="ArrowLeft",o.Up="ArrowUp",o.Esc="Escape",o.Enter="Enter",o.Tab="Tab"})(ot||(ot={}));const Lm={start:[ot.Space,ot.Enter],cancel:[ot.Esc],end:[ot.Space,ot.Enter,ot.Tab]},WC=(o,e)=>{let{currentCoordinates:r}=e;switch(o.code){case ot.Right:return{...r,x:r.x+25};case ot.Left:return{...r,x:r.x-25};case ot.Down:return{...r,y:r.y+25};case ot.Up:return{...r,y:r.y-25}}};class Jd{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:r}}=e;this.props=e,this.listeners=new Eo(ss(r)),this.windowListeners=new Eo(Dn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ar.Resize,this.handleCancel),this.windowListeners.add(ar.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ar.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:r}=this.props,a=e.node.current;a&&GC(a),r(wr)}handleKeyDown(e){if(Vd(e)){const{active:r,context:a,options:i}=this.props,{keyboardCodes:l=Lm,coordinateGetter:c=WC,scrollBehavior:d="smooth"}=i,{code:f}=e;if(l.end.includes(f)){this.handleEnd(e);return}if(l.cancel.includes(f)){this.handleCancel(e);return}const{collisionRect:g}=a.current,m=g?{x:g.left,y:g.top}:wr;this.referenceCoordinates||(this.referenceCoordinates=m);const y=c(e,{active:r,context:a.current,currentCoordinates:m});if(y){const w=wo(y,m),S={x:0,y:0},{scrollableAncestors:v}=a.current;for(const A of v){const x=e.code,{isTop:R,isRight:M,isLeft:O,isBottom:L,maxScroll:q,minScroll:G}=Rm(A),B=BC(A),K={x:Math.min(x===ot.Right?B.right-B.width/2:B.right,Math.max(x===ot.Right?B.left:B.left+B.width/2,y.x)),y:Math.min(x===ot.Down?B.bottom-B.height/2:B.bottom,Math.max(x===ot.Down?B.top:B.top+B.height/2,y.y))},fe=x===ot.Right&&!M||x===ot.Left&&!O,Ce=x===ot.Down&&!L||x===ot.Up&&!R;if(fe&&K.x!==y.x){const ke=A.scrollLeft+w.x,Ue=x===ot.Right&&ke<=q.x||x===ot.Left&&ke>=G.x;if(Ue&&!w.y){A.scrollTo({left:ke,behavior:d});return}Ue?S.x=A.scrollLeft-ke:S.x=x===ot.Right?A.scrollLeft-q.x:A.scrollLeft-G.x,S.x&&A.scrollBy({left:-S.x,behavior:d});break}else if(Ce&&K.y!==y.y){const ke=A.scrollTop+w.y,Ue=x===ot.Down&&ke<=q.y||x===ot.Up&&ke>=G.y;if(Ue&&!w.x){A.scrollTo({top:ke,behavior:d});return}Ue?S.y=A.scrollTop-ke:S.y=x===ot.Down?A.scrollTop-q.y:A.scrollTop-G.y,S.y&&A.scrollBy({top:-S.y,behavior:d});break}}this.handleMove(e,os(wo(y,this.referenceCoordinates),S))}}}handleMove(e,r){const{onMove:a}=this.props;e.preventDefault(),a(r)}handleEnd(e){const{onEnd:r}=this.props;e.preventDefault(),this.detach(),r()}handleCancel(e){const{onCancel:r}=this.props;e.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Jd.activators=[{eventName:"onKeyDown",handler:(o,e,r)=>{let{keyboardCodes:a=Lm,onActivation:i}=e,{active:l}=r;const{code:c}=o.nativeEvent;if(a.start.includes(c)){const d=l.activatorNode.current;return d&&o.target!==d?!1:(o.preventDefault(),i?.({event:o.nativeEvent}),!0)}return!1}}];function Mm(o){return!!(o&&"distance"in o)}function $m(o){return!!(o&&"delay"in o)}class Qd{constructor(e,r,a){var i;a===void 0&&(a=FC(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=r;const{event:l}=e,{target:c}=l;this.props=e,this.events=r,this.document=ss(c),this.documentListeners=new Eo(this.document),this.listeners=new Eo(a),this.windowListeners=new Eo(Dn(c)),this.initialCoordinates=(i=Fd(l))!=null?i:wr,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:r,bypassActivationConstraint:a}}}=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(ar.Resize,this.handleCancel),this.windowListeners.add(ar.DragStart,Om),this.windowListeners.add(ar.VisibilityChange,this.handleCancel),this.windowListeners.add(ar.ContextMenu,Om),this.documentListeners.add(ar.Keydown,this.handleKeydown),r){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($m(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Mm(r)){this.handlePending(r);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,r){const{active:a,onPending:i}=this.props;i(a,e,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:e}=this,{onStart:r}=this.props;e&&(this.activated=!0,this.documentListeners.add(ar.Click,KC,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ar.SelectionChange,this.removeTextSelection),r(e))}handleMove(e){var r;const{activated:a,initialCoordinates:i,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!i)return;const f=(r=Fd(e))!=null?r:wr,g=wo(i,f);if(!a&&d){if(Mm(d)){if(d.tolerance!=null&&Xd(g,d.tolerance))return this.handleCancel();if(Xd(g,d.distance))return this.handleStart()}if($m(d)&&Xd(g,d.tolerance))return this.handleCancel();this.handlePending(d,g);return}e.cancelable&&e.preventDefault(),c(f)}handleEnd(){const{onAbort:e,onEnd:r}=this.props;this.detach(),this.activated||e(this.props.active),r()}handleCancel(){const{onAbort:e,onCancel:r}=this.props;this.detach(),this.activated||e(this.props.active),r()}handleKeydown(e){e.code===ot.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const YC={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Zd extends Qd{constructor(e){const{event:r}=e,a=ss(r.target);super(e,YC,a)}}Zd.activators=[{eventName:"onPointerDown",handler:(o,e)=>{let{nativeEvent:r}=o,{onActivation:a}=e;return!r.isPrimary||r.button!==0?!1:(a?.({event:r}),!0)}}];const XC={move:{name:"mousemove"},end:{name:"mouseup"}};var ef;(function(o){o[o.RightClick=2]="RightClick"})(ef||(ef={}));class JC extends Qd{constructor(e){super(e,XC,ss(e.event.target))}}JC.activators=[{eventName:"onMouseDown",handler:(o,e)=>{let{nativeEvent:r}=o,{onActivation:a}=e;return r.button===ef.RightClick?!1:(a?.({event:r}),!0)}}];const tf={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class QC extends Qd{constructor(e){super(e,tf)}static setup(){return window.addEventListener(tf.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(tf.move.name,e)};function e(){}}}QC.activators=[{eventName:"onTouchStart",handler:(o,e)=>{let{nativeEvent:r}=o,{onActivation:a}=e;const{touches:i}=r;return i.length>1?!1:(a?.({event:r}),!0)}}];var _o;(function(o){o[o.Pointer=0]="Pointer",o[o.DraggableRect=1]="DraggableRect"})(_o||(_o={}));var pc;(function(o){o[o.TreeOrder=0]="TreeOrder",o[o.ReversedTreeOrder=1]="ReversedTreeOrder"})(pc||(pc={}));function ZC(o){let{acceleration:e,activator:r=_o.Pointer,canScroll:a,draggingRect:i,enabled:l,interval:c=5,order:d=pc.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:m,delta:y,threshold:w}=o;const S=tE({delta:y,disabled:!l}),[v,A]=dC(),x=N.useRef({x:0,y:0}),R=N.useRef({x:0,y:0}),M=N.useMemo(()=>{switch(r){case _o.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case _o.DraggableRect:return i}},[r,i,f]),O=N.useRef(null),L=N.useCallback(()=>{const G=O.current;if(!G)return;const B=x.current.x*R.current.x,K=x.current.y*R.current.y;G.scrollBy(B,K)},[]),q=N.useMemo(()=>d===pc.TreeOrder?[...g].reverse():g,[d,g]);N.useEffect(()=>{if(!l||!g.length||!M){A();return}for(const G of q){if(a?.(G)===!1)continue;const B=g.indexOf(G),K=m[B];if(!K)continue;const{direction:fe,speed:Ce}=UC(G,K,M,e,w);for(const ke of["x","y"])S[ke][fe[ke]]||(Ce[ke]=0,fe[ke]=0);if(Ce.x>0||Ce.y>0){A(),O.current=G,v(L,c),x.current=Ce,R.current=fe;return}}x.current={x:0,y:0},R.current={x:0,y:0},A()},[e,L,a,A,l,c,JSON.stringify(M),JSON.stringify(S),v,g,q,m,JSON.stringify(w)])}const eE={x:{[on.Backward]:!1,[on.Forward]:!1},y:{[on.Backward]:!1,[on.Forward]:!1}};function tE(o){let{delta:e,disabled:r}=o;const a=qd(e);return vo(i=>{if(r||!a||!i)return eE;const l={x:Math.sign(e.x-a.x),y:Math.sign(e.y-a.y)};return{x:{[on.Backward]:i.x[on.Backward]||l.x===-1,[on.Forward]:i.x[on.Forward]||l.x===1},y:{[on.Backward]:i.y[on.Backward]||l.y===-1,[on.Forward]:i.y[on.Forward]||l.y===1}}},[r,e,a])}function nE(o,e){const r=e!=null?o.get(e):void 0,a=r?r.node.current:null;return vo(i=>{var l;return e==null?null:(l=a??i)!=null?l:null},[a,e])}function rE(o,e){return N.useMemo(()=>o.reduce((r,a)=>{const{sensor:i}=a,l=i.activators.map(c=>({eventName:c.eventName,handler:e(c.handler,a)}));return[...r,...l]},[]),[o,e])}var Ao;(function(o){o[o.Always=0]="Always",o[o.BeforeDragging=1]="BeforeDragging",o[o.WhileDragging=2]="WhileDragging"})(Ao||(Ao={}));var nf;(function(o){o.Optimized="optimized"})(nf||(nf={}));const Nm=new Map;function aE(o,e){let{dragging:r,dependencies:a,config:i}=e;const[l,c]=N.useState(null),{frequency:d,measure:f,strategy:g}=i,m=N.useRef(o),y=x(),w=bo(y),S=N.useCallback(function(R){R===void 0&&(R=[]),!w.current&&c(M=>M===null?R:M.concat(R.filter(O=>!M.includes(O))))},[w]),v=N.useRef(null),A=vo(R=>{if(y&&!r)return Nm;if(!R||R===Nm||m.current!==o||l!=null){const M=new Map;for(let O of o){if(!O)continue;if(l&&l.length>0&&!l.includes(O.id)&&O.rect.current){M.set(O.id,O.rect.current);continue}const L=O.node.current,q=L?new Yd(f(L),L):null;O.rect.current=q,q&&M.set(O.id,q)}return M}return R},[o,l,r,y,f]);return N.useEffect(()=>{m.current=o},[o]),N.useEffect(()=>{y||S()},[r,y]),N.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),N.useEffect(()=>{y||typeof d!="number"||v.current!==null||(v.current=setTimeout(()=>{S(),v.current=null},d))},[d,y,S,...a]),{droppableRects:A,measureDroppableContainers:S,measuringScheduled:l!=null};function x(){switch(g){case Ao.Always:return!1;case Ao.BeforeDragging:return r;default:return!r}}}function Im(o,e){return vo(r=>o?r||(typeof e=="function"?e(o):o):null,[e,o])}function iE(o,e){return Im(o,e)}function sE(o){let{callback:e,disabled:r}=o;const a=Pd(e),i=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(a)},[a,r]);return N.useEffect(()=>()=>i?.disconnect(),[i]),i}function mc(o){let{callback:e,disabled:r}=o;const a=Pd(e),i=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(a)},[r]);return N.useEffect(()=>()=>i?.disconnect(),[i]),i}function oE(o){return new Yd(ls(o),o)}function Hm(o,e,r){e===void 0&&(e=oE);const[a,i]=N.useState(null);function l(){i(f=>{if(!o)return null;if(o.isConnected===!1){var g;return(g=f??r)!=null?g:null}const m=e(o);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const c=sE({callback(f){if(o)for(const g of f){const{type:m,target:y}=g;if(m==="childList"&&y instanceof HTMLElement&&y.contains(o)){l();break}}}}),d=mc({callback:l});return Ur(()=>{l(),o?(d?.observe(o),c?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),c?.disconnect())},[o]),a}function lE(o){const e=Im(o);return Em(o,e)}const jm=[];function cE(o){const e=N.useRef(o),r=vo(a=>o?a&&a!==jm&&o&&e.current&&o.parentNode===e.current.parentNode?a:gc(o):jm,[o]);return N.useEffect(()=>{e.current=o},[o]),r}function uE(o){const[e,r]=N.useState(null),a=N.useRef(o),i=N.useCallback(l=>{const c=Kd(l.target);c&&r(d=>d?(d.set(c,Wd(c)),new Map(d)):null)},[]);return N.useEffect(()=>{const l=a.current;if(o!==l){c(l);const d=o.map(f=>{const g=Kd(f);return g?(g.addEventListener("scroll",i,{passive:!0}),[g,Wd(g)]):null}).filter(f=>f!=null);r(d.length?new Map(d):null),a.current=o}return()=>{c(o),c(l)};function c(d){d.forEach(f=>{const g=Kd(f);g?.removeEventListener("scroll",i)})}},[i,o]),N.useMemo(()=>o.length?e?Array.from(e.values()).reduce((l,c)=>os(l,c),wr):Dm(o):wr,[o,e])}function zm(o,e){e===void 0&&(e=[]);const r=N.useRef(null);return N.useEffect(()=>{r.current=null},e),N.useEffect(()=>{const a=o!==wr;a&&!r.current&&(r.current=o),!a&&r.current&&(r.current=null)},[o]),r.current?wo(o,r.current):wr}function dE(o){N.useEffect(()=>{if(!dc)return;const e=o.map(r=>{let{sensor:a}=r;return a.setup==null?void 0:a.setup()});return()=>{for(const r of e)r?.()}},o.map(e=>{let{sensor:r}=e;return r}))}function fE(o,e){return N.useMemo(()=>o.reduce((r,a)=>{let{eventName:i,handler:l}=a;return r[i]=c=>{l(c,e)},r},{}),[o,e])}function Um(o){return N.useMemo(()=>o?IC(o):null,[o])}const Bm=[];function hE(o,e){e===void 0&&(e=ls);const[r]=o,a=Um(r?Dn(r):null),[i,l]=N.useState(Bm);function c(){l(()=>o.length?o.map(f=>km(f)?a:new Yd(e(f),f)):Bm)}const d=mc({callback:c});return Ur(()=>{d?.disconnect(),c(),o.forEach(f=>d?.observe(f))},[o]),i}function gE(o){if(!o)return null;if(o.children.length>1)return o;const e=o.children[0];return yo(e)?e:o}function pE(o){let{measure:e}=o;const[r,a]=N.useState(null),i=N.useCallback(g=>{for(const{target:m}of g)if(yo(m)){a(y=>{const w=e(m);return y?{...y,width:w.width,height:w.height}:w});break}},[e]),l=mc({callback:i}),c=N.useCallback(g=>{const m=gE(g);l?.disconnect(),m&&l?.observe(m),a(m?e(m):null)},[e,l]),[d,f]=fc(c);return N.useMemo(()=>({nodeRef:d,rect:r,setRef:f}),[r,d,f])}const mE=[{sensor:Zd,options:{}},{sensor:Jd,options:{}}],yE={current:{}},yc={draggable:{measure:_m},droppable:{measure:_m,strategy:Ao.WhileDragging,frequency:nf.Optimized},dragOverlay:{measure:ls}};class xo extends Map{get(e){var r;return e!=null&&(r=super.get(e))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:r}=e;return!r})}getNodeFor(e){var r,a;return(r=(a=this.get(e))==null?void 0:a.node.current)!=null?r:void 0}}const bE={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:hc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:yc,measureDroppableContainers:hc,windowRect:null,measuringScheduled:!1},vE={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:hc,draggableNodes:new Map,over:null,measureDroppableContainers:hc},bc=N.createContext(vE),Pm=N.createContext(bE);function SE(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xo}}}function wE(o,e){switch(e.type){case tn.DragStart:return{...o,draggable:{...o.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case tn.DragMove:return o.draggable.active==null?o:{...o,draggable:{...o.draggable,translate:{x:e.coordinates.x-o.draggable.initialCoordinates.x,y:e.coordinates.y-o.draggable.initialCoordinates.y}}};case tn.DragEnd:case tn.DragCancel:return{...o,draggable:{...o.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case tn.RegisterDroppable:{const{element:r}=e,{id:a}=r,i=new xo(o.droppable.containers);return i.set(a,r),{...o,droppable:{...o.droppable,containers:i}}}case tn.SetDroppableDisabled:{const{id:r,key:a,disabled:i}=e,l=o.droppable.containers.get(r);if(!l||a!==l.key)return o;const c=new xo(o.droppable.containers);return c.set(r,{...l,disabled:i}),{...o,droppable:{...o.droppable,containers:c}}}case tn.UnregisterDroppable:{const{id:r,key:a}=e,i=o.droppable.containers.get(r);if(!i||a!==i.key)return o;const l=new xo(o.droppable.containers);return l.delete(r),{...o,droppable:{...o.droppable,containers:l}}}default:return o}}function CE(o){let{disabled:e}=o;const{active:r,activatorEvent:a,draggableNodes:i}=N.useContext(bc),l=qd(a),c=qd(r?.id);return N.useEffect(()=>{if(!e&&!a&&l&&c!=null){if(!Vd(l)||document.activeElement===l.target)return;const d=i.get(c);if(!d)return;const{activatorNode:f,node:g}=d;if(!f.current&&!g.current)return;requestAnimationFrame(()=>{for(const m of[f.current,g.current]){if(!m)continue;const y=gC(m);if(y){y.focus();break}}})}},[a,e,i,c,l]),null}function EE(o,e){let{transform:r,...a}=e;return o!=null&&o.length?o.reduce((i,l)=>l({transform:i,...a}),r):r}function _E(o){return N.useMemo(()=>({draggable:{...yc.draggable,...o?.draggable},droppable:{...yc.droppable,...o?.droppable},dragOverlay:{...yc.dragOverlay,...o?.dragOverlay}}),[o?.draggable,o?.droppable,o?.dragOverlay])}function AE(o){let{activeNode:e,measure:r,initialRect:a,config:i=!0}=o;const l=N.useRef(!1),{x:c,y:d}=typeof i=="boolean"?{x:i,y:i}:i;Ur(()=>{if(!c&&!d||!e){l.current=!1;return}if(l.current||!a)return;const g=e?.node.current;if(!g||g.isConnected===!1)return;const m=r(g),y=Em(m,a);if(c||(y.x=0),d||(y.y=0),l.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const w=Am(g);w&&w.scrollBy({top:y.y,left:y.x})}},[e,c,d,a,r])}const qm=N.createContext({...wr,scaleX:1,scaleY:1});var La;(function(o){o[o.Uninitialized=0]="Uninitialized",o[o.Initializing=1]="Initializing",o[o.Initialized=2]="Initialized"})(La||(La={}));const xE=N.memo(function(e){var r,a,i,l;let{id:c,accessibility:d,autoScroll:f=!0,children:g,sensors:m=mE,collisionDetection:y=RC,measuring:w,modifiers:S,...v}=e;const A=N.useReducer(wE,void 0,SE),[x,R]=A,[M,O]=SC(),[L,q]=N.useState(La.Uninitialized),G=L===La.Initialized,{draggable:{active:B,nodes:K,translate:fe},droppable:{containers:Ce}}=x,ke=B!=null?K.get(B):null,Ue=N.useRef({initial:null,translated:null}),Pe=N.useMemo(()=>{var ue;return B!=null?{id:B,data:(ue=ke?.data)!=null?ue:yE,rect:Ue}:null},[B,ke]),qe=N.useRef(null),[wt,J]=N.useState(null),[he,Ee]=N.useState(null),Z=bo(v,Object.values(v)),pe=So("DndDescribedBy",c),H=N.useMemo(()=>Ce.getEnabled(),[Ce]),T=_E(w),{droppableRects:ge,measureDroppableContainers:de,measuringScheduled:me}=aE(H,{dragging:G,dependencies:[fe.x,fe.y],config:T.droppable}),ae=nE(K,B),Re=N.useMemo(()=>he?Fd(he):null,[he]),ze=ve(),$e=iE(ae,T.draggable.measure);AE({activeNode:B!=null?K.get(B):null,config:ze.layoutShiftCompensation,initialRect:$e,measure:T.draggable.measure});const Ge=Hm(ae,T.draggable.measure,$e),At=Hm(ae?ae.parentElement:null),yt=N.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:ge,draggableNodes:K,draggingNode:null,draggingNodeRect:null,droppableContainers:Ce,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),dn=Ce.getNodeFor((r=yt.current.over)==null?void 0:r.id),Tt=pE({measure:T.dragOverlay.measure}),Yt=(a=Tt.nodeRef.current)!=null?a:ae,ln=G?(i=Tt.rect)!=null?i:Ge:null,zt=!!(Tt.nodeRef.current&&Tt.rect),Tr=lE(zt?null:Ge),wn=Um(Yt?Dn(Yt):null),cn=cE(G?dn??ae:null),fn=hE(cn),sr=EE(S,{transform:{x:fe.x-Tr.x,y:fe.y-Tr.y,scaleX:1,scaleY:1},activatorEvent:he,active:Pe,activeNodeRect:Ge,containerNodeRect:At,draggingNodeRect:ln,over:yt.current.over,overlayNodeRect:Tt.rect,scrollableAncestors:cn,scrollableAncestorRects:fn,windowRect:wn}),Wn=Re?os(Re,fe):null,Ut=uE(cn),bt=zm(Ut),ra=zm(Ut,[Ge]),Ln=os(sr,bt),An=ln?LC(ln,sr):null,xn=Pe&&An?y({active:Pe,collisionRect:An,droppableRects:ge,droppableContainers:H,pointerCoordinates:Wn}):null,Mn=wm(xn,"id"),[hn,aa]=N.useState(null),$n=zt?sr:os(sr,ra),Vt=DC($n,(l=hn?.rect)!=null?l:null,Ge),Cn=N.useRef(null),nn=N.useCallback((ue,we)=>{let{sensor:_e,options:Be}=we;if(qe.current==null)return;const xe=K.get(qe.current);if(!xe)return;const De=ue.nativeEvent,Ae=new _e({active:qe.current,activeNode:xe,event:De,options:Be,context:yt,onAbort(Ne){if(!K.get(Ne))return;const{onDragAbort:Se}=Z.current,Me={id:Ne};Se?.(Me),M({type:"onDragAbort",event:Me})},onPending(Ne,je,Se,Me){if(!K.get(Ne))return;const{onDragPending:kt}=Z.current,Ot={id:Ne,constraint:je,initialCoordinates:Se,offset:Me};kt?.(Ot),M({type:"onDragPending",event:Ot})},onStart(Ne){const je=qe.current;if(je==null)return;const Se=K.get(je);if(!Se)return;const{onDragStart:Me}=Z.current,Ze={activatorEvent:De,active:{id:je,data:Se.data,rect:Ue}};Oa.unstable_batchedUpdates(()=>{Me?.(Ze),q(La.Initializing),R({type:tn.DragStart,initialCoordinates:Ne,active:je}),M({type:"onDragStart",event:Ze}),J(Cn.current),Ee(De)})},onMove(Ne){R({type:tn.DragMove,coordinates:Ne})},onEnd:et(tn.DragEnd),onCancel:et(tn.DragCancel)});Cn.current=Ae;function et(Ne){return async function(){const{active:Se,collisions:Me,over:Ze,scrollAdjustedTranslate:kt}=yt.current;let Ot=null;if(Se&&kt){const{cancelDrop:Nn}=Z.current;Ot={activatorEvent:De,active:Se,collisions:Me,delta:kt,over:Ze},Ne===tn.DragEnd&&typeof Nn=="function"&&await Promise.resolve(Nn(Ot))&&(Ne=tn.DragCancel)}qe.current=null,Oa.unstable_batchedUpdates(()=>{R({type:Ne}),q(La.Uninitialized),aa(null),J(null),Ee(null),Cn.current=null;const Nn=Ne===tn.DragEnd?"onDragEnd":"onDragCancel";if(Ot){const $t=Z.current[Nn];$t?.(Ot),M({type:Nn,event:Ot})}})}}},[K]),V=N.useCallback((ue,we)=>(_e,Be)=>{const xe=_e.nativeEvent,De=K.get(Be);if(qe.current!==null||!De||xe.dndKit||xe.defaultPrevented)return;const Ae={active:De};ue(_e,we.options,Ae)===!0&&(xe.dndKit={capturedBy:we.sensor},qe.current=Be,nn(_e,we))},[K,nn]),oe=rE(m,V);dE(m),Ur(()=>{Ge&&L===La.Initializing&&q(La.Initialized)},[Ge,L]),N.useEffect(()=>{const{onDragMove:ue}=Z.current,{active:we,activatorEvent:_e,collisions:Be,over:xe}=yt.current;if(!we||!_e)return;const De={active:we,activatorEvent:_e,collisions:Be,delta:{x:Ln.x,y:Ln.y},over:xe};Oa.unstable_batchedUpdates(()=>{ue?.(De),M({type:"onDragMove",event:De})})},[Ln.x,Ln.y]),N.useEffect(()=>{const{active:ue,activatorEvent:we,collisions:_e,droppableContainers:Be,scrollAdjustedTranslate:xe}=yt.current;if(!ue||qe.current==null||!we||!xe)return;const{onDragOver:De}=Z.current,Ae=Be.get(Mn),et=Ae&&Ae.rect.current?{id:Ae.id,rect:Ae.rect.current,data:Ae.data,disabled:Ae.disabled}:null,Ne={active:ue,activatorEvent:we,collisions:_e,delta:{x:xe.x,y:xe.y},over:et};Oa.unstable_batchedUpdates(()=>{aa(et),De?.(Ne),M({type:"onDragOver",event:Ne})})},[Mn]),Ur(()=>{yt.current={activatorEvent:he,active:Pe,activeNode:ae,collisionRect:An,collisions:xn,droppableRects:ge,draggableNodes:K,draggingNode:Yt,draggingNodeRect:ln,droppableContainers:Ce,over:hn,scrollableAncestors:cn,scrollAdjustedTranslate:Ln},Ue.current={initial:ln,translated:An}},[Pe,ae,xn,An,K,Yt,ln,ge,Ce,hn,cn,Ln]),ZC({...ze,delta:fe,draggingRect:An,pointerCoordinates:Wn,scrollableAncestors:cn,scrollableAncestorRects:fn});const ce=N.useMemo(()=>({active:Pe,activeNode:ae,activeNodeRect:Ge,activatorEvent:he,collisions:xn,containerNodeRect:At,dragOverlay:Tt,draggableNodes:K,droppableContainers:Ce,droppableRects:ge,over:hn,measureDroppableContainers:de,scrollableAncestors:cn,scrollableAncestorRects:fn,measuringConfiguration:T,measuringScheduled:me,windowRect:wn}),[Pe,ae,Ge,he,xn,At,Tt,K,Ce,ge,hn,de,cn,fn,T,me,wn]),X=N.useMemo(()=>({activatorEvent:he,activators:oe,active:Pe,activeNodeRect:Ge,ariaDescribedById:{draggable:pe},dispatch:R,draggableNodes:K,over:hn,measureDroppableContainers:de}),[he,oe,Pe,Ge,R,pe,K,hn,de]);return We.createElement(mm.Provider,{value:O},We.createElement(bc.Provider,{value:X},We.createElement(Pm.Provider,{value:ce},We.createElement(qm.Provider,{value:Vt},g)),We.createElement(CE,{disabled:d?.restoreFocus===!1})),We.createElement(EC,{...d,hiddenTextDescribedById:pe}));function ve(){const ue=wt?.autoScrollEnabled===!1,we=typeof f=="object"?f.enabled===!1:f===!1,_e=G&&!ue&&!we;return typeof f=="object"?{...f,enabled:_e}:{enabled:_e}}}),TE=N.createContext(null),Gm="button",kE="Draggable";function RE(o){let{id:e,data:r,disabled:a=!1,attributes:i}=o;const l=So(kE),{activators:c,activatorEvent:d,active:f,activeNodeRect:g,ariaDescribedById:m,draggableNodes:y,over:w}=N.useContext(bc),{role:S=Gm,roleDescription:v="draggable",tabIndex:A=0}=i??{},x=f?.id===e,R=N.useContext(x?qm:TE),[M,O]=fc(),[L,q]=fc(),G=fE(c,e),B=bo(r);Ur(()=>(y.set(e,{id:e,key:l,node:M,activatorNode:L,data:B}),()=>{const fe=y.get(e);fe&&fe.key===l&&y.delete(e)}),[y,e]);const K=N.useMemo(()=>({role:S,tabIndex:A,"aria-disabled":a,"aria-pressed":x&&S===Gm?!0:void 0,"aria-roledescription":v,"aria-describedby":m.draggable}),[a,S,A,x,v,m.draggable]);return{active:f,activatorEvent:d,activeNodeRect:g,attributes:K,isDragging:x,listeners:a?void 0:G,node:M,over:w,setNodeRef:O,setActivatorNodeRef:q,transform:R}}function DE(){return N.useContext(Pm)}const OE="Droppable",LE={timeout:25};function ME(o){let{data:e,disabled:r=!1,id:a,resizeObserverConfig:i}=o;const l=So(OE),{active:c,dispatch:d,over:f,measureDroppableContainers:g}=N.useContext(bc),m=N.useRef({disabled:r}),y=N.useRef(!1),w=N.useRef(null),S=N.useRef(null),{disabled:v,updateMeasurementsFor:A,timeout:x}={...LE,...i},R=bo(A??a),M=N.useCallback(()=>{if(!y.current){y.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(R.current)?R.current:[R.current]),S.current=null},x)},[x]),O=mc({callback:M,disabled:v||!c}),L=N.useCallback((K,fe)=>{O&&(fe&&(O.unobserve(fe),y.current=!1),K&&O.observe(K))},[O]),[q,G]=fc(L),B=bo(e);return N.useEffect(()=>{!O||!q.current||(O.disconnect(),y.current=!1,O.observe(q.current))},[q,O]),N.useEffect(()=>(d({type:tn.RegisterDroppable,element:{id:a,key:l,disabled:r,node:q,rect:w,data:B}}),()=>d({type:tn.UnregisterDroppable,key:l,id:a})),[a]),N.useEffect(()=>{r!==m.current.disabled&&(d({type:tn.SetDroppableDisabled,id:a,key:l,disabled:r}),m.current.disabled=r)},[a,l,r,d]),{active:c,rect:w,isOver:f?.id===a,node:q,over:f,setNodeRef:G}}function rf(o,e,r){const a=o.slice();return a.splice(r<0?a.length+r:r,0,a.splice(e,1)[0]),a}function $E(o,e){return o.reduce((r,a,i)=>{const l=e.get(a);return l&&(r[i]=l),r},Array(o.length))}function vc(o){return o!==null&&o>=0}function NE(o,e){if(o===e)return!0;if(o.length!==e.length)return!1;for(let r=0;r<o.length;r++)if(o[r]!==e[r])return!1;return!0}function IE(o){return typeof o=="boolean"?{draggable:o,droppable:o}:o}const Sc={scaleX:1,scaleY:1},HE=o=>{var e;let{rects:r,activeNodeRect:a,activeIndex:i,overIndex:l,index:c}=o;const d=(e=r[i])!=null?e:a;if(!d)return null;const f=jE(r,c,i);if(c===i){const g=r[l];return g?{x:i<l?g.left+g.width-(d.left+d.width):g.left-d.left,y:0,...Sc}:null}return c>i&&c<=l?{x:-d.width-f,y:0,...Sc}:c<i&&c>=l?{x:d.width+f,y:0,...Sc}:{x:0,y:0,...Sc}};function jE(o,e,r){const a=o[e],i=o[e-1],l=o[e+1];return!a||!i&&!l?0:r<e?i?a.left-(i.left+i.width):l.left-(a.left+a.width):l?l.left-(a.left+a.width):a.left-(i.left+i.width)}const af=o=>{let{rects:e,activeIndex:r,overIndex:a,index:i}=o;const l=rf(e,a,r),c=e[i],d=l[i];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},wc={scaleX:1,scaleY:1},zE=o=>{var e;let{activeIndex:r,activeNodeRect:a,index:i,rects:l,overIndex:c}=o;const d=(e=l[r])!=null?e:a;if(!d)return null;if(i===r){const g=l[c];return g?{x:0,y:r<c?g.top+g.height-(d.top+d.height):g.top-d.top,...wc}:null}const f=UE(l,i,r);return i>r&&i<=c?{x:0,y:-d.height-f,...wc}:i<r&&i>=c?{x:0,y:d.height+f,...wc}:{x:0,y:0,...wc}};function UE(o,e,r){const a=o[e],i=o[e-1],l=o[e+1];return a?r<e?i?a.top-(i.top+i.height):l?l.top-(a.top+a.height):0:l?l.top-(a.top+a.height):i?a.top-(i.top+i.height):0:0}const Vm="Sortable",Fm=We.createContext({activeIndex:-1,containerId:Vm,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:af,disabled:{draggable:!1,droppable:!1}});function BE(o){let{children:e,id:r,items:a,strategy:i=af,disabled:l=!1}=o;const{active:c,dragOverlay:d,droppableRects:f,over:g,measureDroppableContainers:m}=DE(),y=So(Vm,r),w=d.rect!==null,S=N.useMemo(()=>a.map(G=>typeof G=="object"&&"id"in G?G.id:G),[a]),v=c!=null,A=c?S.indexOf(c.id):-1,x=g?S.indexOf(g.id):-1,R=N.useRef(S),M=!NE(S,R.current),O=x!==-1&&A===-1||M,L=IE(l);Ur(()=>{M&&v&&m(S)},[M,S,v,m]),N.useEffect(()=>{R.current=S},[S]);const q=N.useMemo(()=>({activeIndex:A,containerId:y,disabled:L,disableTransforms:O,items:S,overIndex:x,useDragOverlay:w,sortedRects:$E(S,f),strategy:i}),[A,y,L.draggable,L.droppable,O,S,x,f,w,i]);return We.createElement(Fm.Provider,{value:q},e)}const PE=o=>{let{id:e,items:r,activeIndex:a,overIndex:i}=o;return rf(r,a,i).indexOf(e)},qE=o=>{let{containerId:e,isSorting:r,wasDragging:a,index:i,items:l,newIndex:c,previousItems:d,previousContainerId:f,transition:g}=o;return!g||!a||d!==l&&i===c?!1:r?!0:c!==i&&e===f},GE={duration:200,easing:"ease"},Km="transform",VE=Co.Transition.toString({property:Km,duration:0,easing:"linear"}),FE={roleDescription:"sortable"};function KE(o){let{disabled:e,index:r,node:a,rect:i}=o;const[l,c]=N.useState(null),d=N.useRef(r);return Ur(()=>{if(!e&&r!==d.current&&a.current){const f=i.current;if(f){const g=ls(a.current,{ignoreTransform:!0}),m={x:f.left-g.left,y:f.top-g.top,scaleX:f.width/g.width,scaleY:f.height/g.height};(m.x||m.y)&&c(m)}}r!==d.current&&(d.current=r)},[e,r,a,i]),N.useEffect(()=>{l&&c(null)},[l]),l}function WE(o){let{animateLayoutChanges:e=qE,attributes:r,disabled:a,data:i,getNewIndex:l=PE,id:c,strategy:d,resizeObserverConfig:f,transition:g=GE}=o;const{items:m,containerId:y,activeIndex:w,disabled:S,disableTransforms:v,sortedRects:A,overIndex:x,useDragOverlay:R,strategy:M}=N.useContext(Fm),O=YE(a,S),L=m.indexOf(c),q=N.useMemo(()=>({sortable:{containerId:y,index:L,items:m},...i}),[y,i,L,m]),G=N.useMemo(()=>m.slice(m.indexOf(c)),[m,c]),{rect:B,node:K,isOver:fe,setNodeRef:Ce}=ME({id:c,data:q,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:G,...f}}),{active:ke,activatorEvent:Ue,activeNodeRect:Pe,attributes:qe,setNodeRef:wt,listeners:J,isDragging:he,over:Ee,setActivatorNodeRef:Z,transform:pe}=RE({id:c,data:q,attributes:{...FE,...r},disabled:O.draggable}),H=uC(Ce,wt),T=!!ke,ge=T&&!v&&vc(w)&&vc(x),de=!R&&he,me=de&&ge?pe:null,Re=ge?me??(d??M)({rects:A,activeNodeRect:Pe,activeIndex:w,overIndex:x,index:L}):null,ze=vc(w)&&vc(x)?l({id:c,items:m,activeIndex:w,overIndex:x}):L,$e=ke?.id,Ge=N.useRef({activeId:$e,items:m,newIndex:ze,containerId:y}),At=m!==Ge.current.items,yt=e({active:ke,containerId:y,isDragging:he,isSorting:T,id:c,index:L,items:m,newIndex:Ge.current.newIndex,previousItems:Ge.current.items,previousContainerId:Ge.current.containerId,transition:g,wasDragging:Ge.current.activeId!=null}),dn=KE({disabled:!yt,index:L,node:K,rect:B});return N.useEffect(()=>{T&&Ge.current.newIndex!==ze&&(Ge.current.newIndex=ze),y!==Ge.current.containerId&&(Ge.current.containerId=y),m!==Ge.current.items&&(Ge.current.items=m)},[T,ze,y,m]),N.useEffect(()=>{if($e===Ge.current.activeId)return;if($e!=null&&Ge.current.activeId==null){Ge.current.activeId=$e;return}const Yt=setTimeout(()=>{Ge.current.activeId=$e},50);return()=>clearTimeout(Yt)},[$e]),{active:ke,activeIndex:w,attributes:qe,data:q,rect:B,index:L,newIndex:ze,items:m,isOver:fe,isSorting:T,isDragging:he,listeners:J,node:K,overIndex:x,over:Ee,setNodeRef:H,setActivatorNodeRef:Z,setDroppableNodeRef:Ce,setDraggableNodeRef:wt,transform:dn??Re,transition:Tt()};function Tt(){if(dn||At&&Ge.current.newIndex===L)return VE;if(!(de&&!Vd(Ue)||!g)&&(T||yt))return Co.Transition.toString({...g,property:Km})}}function YE(o,e){var r,a;return typeof o=="boolean"?{draggable:o,droppable:!1}:{draggable:(r=o?.draggable)!=null?r:e.draggable,droppable:(a=o?.droppable)!=null?a:e.droppable}}function Cc(o){if(!o)return!1;const e=o.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const XE=[ot.Down,ot.Right,ot.Up,ot.Left],JE=(o,e)=>{let{context:{active:r,collisionRect:a,droppableRects:i,droppableContainers:l,over:c,scrollableAncestors:d}}=e;if(XE.includes(o.code)){if(o.preventDefault(),!r||!a)return;const f=[];l.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const w=i.get(y.id);if(w)switch(o.code){case ot.Down:a.top<w.top&&f.push(y);break;case ot.Up:a.top>w.top&&f.push(y);break;case ot.Left:a.left>w.left&&f.push(y);break;case ot.Right:a.left<w.left&&f.push(y);break}});const g=TC({collisionRect:a,droppableRects:i,droppableContainers:f});let m=wm(g,"id");if(m===c?.id&&g.length>1&&(m=g[1].id),m!=null){const y=l.get(r.id),w=l.get(m),S=w?i.get(w.id):null,v=w?.node.current;if(v&&S&&y&&w){const x=gc(v).some((G,B)=>d[B]!==G),R=Wm(y,w),M=QE(y,w),O=x||!R?{x:0,y:0}:{x:M?a.width-S.width:0,y:M?a.height-S.height:0},L={x:S.left,y:S.top};return O.x&&O.y?L:wo(L,O)}}}};function Wm(o,e){return!Cc(o)||!Cc(e)?!1:o.data.current.sortable.containerId===e.data.current.sortable.containerId}function QE(o,e){return!Cc(o)||!Cc(e)||!Wm(o,e)?!1:o.data.current.sortable.index<e.data.current.sortable.index}const ZE={verticalList:zE,horizontalList:HE,rectSorting:af},e_=({items:o,itemKey:e,strategy:r,children:a,onSortEnd:i,onSortStart:l,sortVersion:c})=>{const d=N.useId(),f=N.useRef({inProgress:!1,lastSortTime:0,lastActiveId:null}),g=_C(ym(Zd,{activationConstraint:{distance:5}}),ym(Jd,{coordinateGetter:JE})),m=N.useCallback(S=>{f.current={inProgress:!0,lastSortTime:Date.now(),lastActiveId:S.active.id},l?.({activeId:S.active.id})},[l]),y=N.useCallback(S=>{const{active:v,over:A}=S,x=Date.now();if(!A||v.id===A.id){f.current.inProgress=!1;return}const{lastSortTime:R,lastActiveId:M,inProgress:O}=f.current;if(M===v.id&&x-R<500&&!O)return;f.current={inProgress:!1,lastSortTime:x,lastActiveId:v.id};const L=o.findIndex(G=>String(G[e])===String(v.id)),q=o.findIndex(G=>String(G[e])===String(A.id));if(L!==-1&&q!==-1&&L!==q){const G=rf(o,L,q);i?.(G,{oldIndex:L,newIndex:q})}},[o,e,i]),w=o.map(S=>String(S[e]));return dt.jsx(xE,{id:d,sensors:g,collisionDetection:xC,onDragStart:m,onDragEnd:y,children:dt.jsx(BE,{items:w,strategy:ZE[r],children:a})},c!==void 0?`${d}-v${c}`:d)},Ym=N.createContext(null),t_=({value:o,children:e})=>dt.jsx(Ym.Provider,{value:o,children:e}),n_=()=>N.useContext(Ym),r_=({id:o,handle:e,as:r="div",children:a})=>{const{attributes:i,listeners:l,setNodeRef:c,transform:d,transition:f,isDragging:g}=WE({id:o}),m={transform:Co.Transform.toString(d),transition:f,opacity:g?.5:1,position:"relative"};return dt.jsx(r,{ref:c,style:m,...i,...e?{}:l,"data-sortable-item":!0,"data-sortable-id":String(o),"data-dragging":g,children:dt.jsx(t_,{value:{listeners:l,handle:e,isDragging:g},children:a})})},rt=ut("DynamicRenderer");function ea(){try{return window.G7Core?.devTools}catch{return}}function sf(o,e,r,a){if(typeof o=="string"){if(/\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*/.test(o))try{return e.resolveTranslations(o,r,a)}catch{return o}return o}if(Array.isArray(o))return o.map(i=>sf(i,e,r,a));if(o&&typeof o=="object"){const i={};for(const[l,c]of Object.entries(o))i[l]=sf(c,e,r,a);return i}return o}function a_(o){const e=Object.keys(o);return e.length>0&&e.every(r=>/^\d+$/.test(r))}const Cr=(o,e)=>{const r=["errors"],a={...o};for(const i of Object.keys(e)){const l=e[i],c=o[i];if(l===null){a[i]=null;continue}if(r.includes(i)){a[i]=l;continue}if(Array.isArray(l)){a[i]=l;continue}if(Array.isArray(c)&&l!==null&&typeof l=="object"&&!Array.isArray(l)&&a_(l)){const d=Object.keys(l).map(g=>parseInt(g,10));if((d.length>0?Math.max(...d):0)>=c.length+d.length+10)a[i]={...l};else{const g=[...c];for(const[m,y]of Object.entries(l)){const w=parseInt(m,10);w>=0&&w<g.length?y!==null&&typeof y=="object"&&!Array.isArray(y)&&g[w]!==null&&typeof g[w]=="object"?g[w]=Cr(g[w],y):g[w]=y:w>=g.length&&(g[w]=y)}a[i]=g}}else l!==null&&typeof l=="object"&&c!==null&&typeof c=="object"&&!Array.isArray(c)?a[i]=Cr(c,l):a[i]=l}return a},Ec=(o,e)=>{let r=null;const a=()=>(r===null&&(r={...o}),r);for(const i of Object.keys(e)){if(!(i in o))continue;const l=e[i],c=o[i];if(l!==null&&typeof l=="object"&&!Array.isArray(l)&&c!==null&&typeof c=="object"&&!Array.isArray(c)){const d=Ec(c,l);if(d===c)continue;Object.keys(d).length===0?delete a()[i]:a()[i]=d}else delete a()[i]}return r??o},i_=o=>{const e={},r=o.split(";").filter(a=>a.trim());for(const a of r){const i=a.indexOf(":");if(i===-1)continue;const l=a.substring(0,i).trim(),c=a.substring(i+1).trim();if(l&&c){const d=l.replace(/-([a-z])/g,(f,g)=>g.toUpperCase());e[d]=c}}return e};class s_ extends N.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){rt.error(`컴포넌트 렌더링 에러 (ID: ${this.props.componentId}, Name: ${this.props.componentName}):`,e,r)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:dt.jsxs("div",{className:"p-4 my-2 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg text-red-800 dark:text-red-400",children:[dt.jsx("div",{className:"font-semibold mb-1",children:"컴포넌트 로드 실패"}),dt.jsxs("div",{className:"text-xs opacity-80",children:[this.props.componentName&&`[${this.props.componentName}] `,"데이터를 표시할 수 없습니다."]}),this.state.error&&dt.jsxs("details",{className:"mt-2",children:[dt.jsx("summary",{className:"cursor-pointer text-xs opacity-70 hover:opacity-100",children:"상세 정보"}),dt.jsx("div",{className:"mt-1 p-2 bg-red-100 dark:bg-red-900/30 rounded text-xs font-mono whitespace-pre-wrap break-all",children:this.state.error.message})]})]}):this.props.children}}const Br=N.memo(({componentDef:o,dataContext:e,translationContext:r,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:c,parentComponentContext:d,parentFormContextProp:f,parentDataContext:g,isRootRenderer:m=!1,isInsideIteration:y=!1,isEditMode:w=!1,onComponentSelect:S,onComponentHover:v,onDragStart:A,onDragEnd:x,componentPath:R,layoutKey:M})=>{const[O,L]=N.useState({loadingActions:{}});N.useLayoutEffect(()=>{d||(i.startRenderCycle(),window.__g7SetLocalOverrideKeys||(window.__g7ForcedLocalFields=void 0),window.__g7PendingLocalState=null)});const q=N.useRef(null);N.useLayoutEffect(()=>{if(!d&&e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:V,_merge:oe,...ce}=e._localInit,X=`${JSON.stringify(ce)}:${V||"no-force"}`;if(q.current!==X){q.current=X;const ve=oe||"shallow",we=window.G7Core?.state?.get?.()?._local||{},_e=window.__g7PendingLocalState||{},Be={...we,..._e};ve==="replace"?window.__g7PendingLocalState={loadingActions:Be.loadingActions||{},...ce,hasChanges:!1}:ve==="deep"?window.__g7PendingLocalState=Cr(Be,{...ce,hasChanges:!1}):window.__g7PendingLocalState={...Be,...ce,hasChanges:!1};const xe=window.__g7SetLocalOverrideKeys;xe&&typeof xe=="object"&&(ve==="replace"?window.__g7SetLocalOverrideKeys={...ce,hasChanges:!1}:window.__g7SetLocalOverrideKeys=Cr(xe,{...ce,hasChanges:!1}))}}}),N.useLayoutEffect(()=>{if(!d){const V=window.__g7SetLocalOverrideKeys;if(V){L(ve=>Ec(ve,V));const oe=V,ce=window.__g7ForcedLocalFields,X=window.__g7LastSetLocalSnapshot;queueMicrotask(()=>{window.__g7SetLocalOverrideKeys===oe&&(window.__g7SetLocalOverrideKeys=void 0),window.__g7ForcedLocalFields===ce&&(window.__g7ForcedLocalFields=void 0),window.__g7LastSetLocalSnapshot===X&&(window.__g7LastSetLocalSnapshot=void 0)})}}},[e._local]);const G=N.useRef(M);N.useEffect(()=>{o._fromBase&&M&&G.current!==M&&(G.current=M,L({loadingActions:{}}))},[M,o._fromBase]);const B=N.useRef(""),K=N.useRef(!1),fe=N.useRef(null),Ce=N.useRef(null),ke=N.useRef({}),Ue=N.useRef({}),Pe=N.useRef(g),qe=cC(),wt=z0(),J=wt?.getParentDataContext()??g;N.useEffect(()=>{if(e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:V,...oe}=e._localInit,ce=JSON.stringify(oe),X=V!==void 0,ve=Hd(),ue=`${ce}:${V||"no-force"}`,we=K0({globalTrackedKey:ve.hash,instanceHandledKey:Ce.current,trackingKey:ue});if(we==="apply"){Ce.current=ue,ve.hash=ue,ve.timestamp=V,B.current=ce,X&&(K.current=!0);const{_merge:Be,...xe}=oe,De=Be||"shallow";L(Ae=>De==="replace"?{loadingActions:Ae.loadingActions||{},...xe,hasChanges:!1}:De==="deep"?Cr(Ae,{...xe,hasChanges:!1}):{...Ae,...xe,hasChanges:!1}),e._globalSetState&&e._globalSetState(Ae=>{const et=Ae?._local||{};let Ne;return De==="replace"?Ne={...xe,hasChanges:!1}:De==="deep"?Ne=Cr(et,{...xe,hasChanges:!1}):Ne={...et,...xe,hasChanges:!1},{...Ae,_local:Ne}}),i.invalidateCacheByKeys(["_local"]),rt.log("_localInit applied (data changed):",Object.keys(oe))}else if(we==="prune"){Ce.current=ue;const{_merge:Be,...xe}=oe;L(Ae=>Ec(Ae,xe)),Ec(O,xe)!==O&&(i.invalidateCacheByKeys(["_local"]),rt.log("_localInit pruned (applied by another renderer):",Object.keys(xe)))}fe.current=e._localInit,V0(e._localInit)}},[e._localInit,g,i]);const{isTransitioning:he}=om(),Ee=eC(),Z=f??Ee,{width:pe}=zd(),H=n_(),T=N.useMemo(()=>{let V=o;if(o.type==="iterator"&&o.data){const{data:X,itemName:ve,indexName:ue,...we}=o;V={...we,iteration:{source:X,item_var:ve||"item",index_var:ue}}}if(!V.responsive)return V;const oe=mi.getMatchingKey(V.responsive,pe);if(!oe)return V;const ce=V.responsive[oe];return{...V,props:{...V.props,...ce.props},children:ce.children??V.children,text:ce.text??V.text,if:ce.if??V.if,iteration:ce.iteration??V.iteration,__responsiveChildrenKey:ce.children!==void 0?oe:void 0}},[o,pe]),ge=N.useCallback(V=>{const oe=V?.__setStateId;if(L(ce=>{const X=window.__g7PendingLocalState,ue=window.__g7SetLocalOverrideKeys||X,we=ue?Cr(ce,ue):ce;if(typeof V=="function"){const Ae=V(we);return Cr(we,Ae)}const{__mergeMode:_e,__setStateId:Be,...xe}=V;let De;if(_e==="replace"?De=xe:_e==="shallow"?De={...we,...xe}:De=Cr(we,xe),_e!==void 0){const Ae=window.__g7ForcedLocalFields;Ae&&(window.__g7ForcedLocalFields={...Ae,...xe})}return De}),oe){const ce=ea();if(ce?.isEnabled()){const X=T.id||"unknown",ve=T.name||"Unknown";setTimeout(()=>{ce.trackComponentRender?.(X,ve,0,["_local"],[]),ce.completeStateChange?.(oe)},0)}}},[T.id,T.name]),de=d?.state??O,me=d?.setState??ge,ae=N.useMemo(()=>{const V=e._localInit&&e._localInit!==fe.current;let oe;V&&e._local?oe=e._local:oe=e._local?Cr(e._local,de):de;const ce=window.__g7ForcedLocalFields;ce&&(oe=Cr(oe,ce));const X={...e,_local:oe},ve=e._computedDefinitions;if(ve&&Object.keys(ve).length>0){const ue=new _n,we={...X,...qe?{_isolated:qe.state}:{}},_e={},Be=ea(),xe=Be?.isEnabled()??!1;for(const[De,Ae]of Object.entries(ve)){const et=xe?Date.now():0,Ne=xe?e._computed?.[De]:void 0;let je;try{if(typeof Ae=="string")if(Ae.startsWith("{{")&&Ae.endsWith("}}")){const Se=Ae.slice(2,-2).trim(),Me=Gn(Se)?ue.evaluatePipeExpression(Se,we,{skipCache:!0}):ue.evaluateExpression(Se,we,{skipCache:!0});_e[De]=Me}else _e[De]=Ae;else if(Ae&&typeof Ae=="object"&&"$switch"in Ae){const Se=ue.resolveSwitch(Ae,we,{skipCache:!0});_e[De]=Se}}catch(Se){rt.warn(`Failed to recalculate computed value: ${De}`,Se),_e[De]=e._computed?.[De],je=Se instanceof Error?Se.message:String(Se)}if(xe&&(je||Ne!==_e[De])){const Me=Date.now()-et;Be.trackComputedProperty?.(De,typeof Ae=="string"?Ae:JSON.stringify(Ae),[{type:"_local",path:"_local",value:X._local}],_e[De],Me,T.id,je),Ne!==_e[De]&&Be.trackComputedRecalc?.(De,"dependency-change",Ne,_e[De],Me,{type:"_local",path:"_local"},T.id)}}X._computed=_e}if(qe&&(X._isolated=qe.state),J&&(X.$parent=J),o.extensionPointProps){const ue=i.resolveObject(o.extensionPointProps,X,y?{skipCache:!0}:void 0);X.extensionPointProps=w&&l?sf(ue,l,r,X):ue}return o.extensionPointCallbacks&&(X.extensionPointCallbacks=o.extensionPointCallbacks),w&&(X.$templateId===void 0&&r?.templateId&&(X.$templateId=r.templateId),X.$locale===void 0&&r?.locale&&(X.$locale=r.locale)),X},[e,de,qe?.state,J,wt?.version,o.extensionPointProps,o.extensionPointCallbacks]);ke.current=ae._local,Ue.current=ae._computed||{},Pe.current=J,N.useEffect(()=>{const V=ea();if(!V?.isEnabled())return;const oe=ae._local;oe&&V.updateLocalState(oe);const ce=ae._computed;ce&&V.updateComputedState(ce),J&&V.updateParentContext?.(J);const X=T.id||`comp-${Date.now()}`,ve=T.name||"Unknown",ue={global:Object.keys(e._global||{}),local:Object.keys(oe||{}),context:d?Object.keys(d.state||{}):[]},we={type:d?"componentContext":"dynamicState",hasComponentContext:!!d,parentId:d?"parent":void 0};V.trackComponentStateSource?.(X,ve,ue,we),de&&Object.keys(de).length>0&&V.trackDynamicState?.(X,de);const _e=!!(T.expandChildren||T.props?.expandChildren);V.trackContextFlow?.(X,ve,!!d,_e,!0)},[ae._local,e,T.id,T.name,d,de,T.expandChildren,T.props?.expandChildren,J]);const Re=N.useMemo(()=>({state:{...ae._local},setState:me,stateRef:ke,computedRef:Ue,isolatedContext:qe,parentDataContext:ae}),[ae._local,me,O,qe,ae]),ze=N.useMemo(()=>{const V=Qi({if:T.if,condition:T.condition,conditions:T.conditions},ae,i,T.id);if(T.if||T.condition!==void 0||T.conditions){const ce=ea();ce?.isEnabled()&&T.if&&ce.trackIfCondition(T.id||`if-${Date.now()}`,T.if,V)}return V},[T.if,T.conditions,ae,i,T.id]),$e=N.useMemo(()=>{if(!T.slot)return null;const V=T.slot;if(V.startsWith("{{")&&V.endsWith("}}")){const oe=V.slice(2,-2).trim();try{const ce={componentId:T.id,componentName:T.name,propName:"slot"},X=Gn(oe)?i.evaluatePipeExpression(oe,ae,void 0,ce):i.evaluateExpression(oe,ae,ce);return rt.log(`[Slot] 표현식 평가: "${oe}" => "${X}" (컴포넌트: ${T.id})`),typeof X=="string"?X:null}catch(ce){return rt.warn(`slot 표현식 평가 실패 (컴포넌트: ${T.id}):`,ce),null}}return rt.log(`[Slot] 정적 슬롯 ID: "${V}" (컴포넌트: ${T.id})`),V},[T.slot,T.id,ae,i]),Ge=N.useMemo(()=>!$e||!T.id?"":`${T.id}-${$e}-${JSON.stringify(T.slotOrder??0)}`,[$e,T.id,T.slotOrder]),At=N.useRef(null);N.useEffect(()=>{const V=window.__slotContextValue,oe=V?.isEnabled??!1;if(T.slot&&rt.log(`[Slot Registration] 컴포넌트: ${T.id}, isSlotEnabled: ${oe}, shouldRender: ${ze}, resolvedSlotId: ${$e}`),!oe||!ze){T.slot&&rt.log(`[Slot Registration] 등록 스킵 - isSlotEnabled: ${oe}, shouldRender: ${ze}`),At.current&&T.id&&V&&(V.unregisterFromSlot(At.current,T.id),At.current=null);return}if(!$e||!T.id){T.slot&&rt.log(`[Slot Registration] 등록 스킵 - resolvedSlotId: ${$e}, id: ${T.id}`),At.current&&T.id&&V&&(V.unregisterFromSlot(At.current,T.id),At.current=null);return}At.current&&At.current!==$e&&V.unregisterFromSlot(At.current,T.id);const ce={...T,slot:void 0,slotOrder:void 0};return V.registerToSlot($e,T.id,{componentDef:ce,dataContext:e,order:T.slotOrder??0,parentFormContext:f??null,getParentComponentContext:()=>Re,translationContext:r,registrationKey:Ge}),At.current=$e,()=>{const X=window.__slotContextValue;$e&&T.id&&X&&X.unregisterFromSlot($e,T.id)}},[ze,$e,T,e,f,Re,r,Ge]);const yt=N.useCallback(V=>{if(typeof V=="string"){if(ql(V))return hd(V);if(Gl(V)){const oe=[],ce=V.replace(new RegExp(`${ro}([^${pi}]*)${pi}`,"g"),(ve,ue)=>(oe.push(ue),`${ka}${oe.length-1}${ka}`));let X=ce;return/\$t:[a-zA-Z0-9._-]+/.test(ce)&&(X=l.resolveTranslations(ce,r,ae)),X.replace(new RegExp(`${ka}(\\d+)${ka}`,"g"),(ve,ue)=>oe[parseInt(ue)])}if(V.startsWith("$t:defer:"))return V;if(/\$t:[a-zA-Z0-9._-]+/.test(V)){const oe=V.trim();return oe.startsWith("{")&&oe.endsWith("}")||oe.startsWith("[")&&oe.endsWith("]")?V:l.resolveTranslations(V,r,ae)}return V}if(Array.isArray(V))return V.map(oe=>yt(oe));if(V&&typeof V=="object"){const oe={};for(const[ce,X]of Object.entries(V))oe[ce]=yt(X);return oe}return V},[l,r,ae]),dn=N.useCallback(V=>no(V),[]),Tt=N.useCallback(V=>Ta(V),[]),Yt=N.useMemo(()=>{let V={...T.props||{}};const oe=["cellChildren","expandChildren","expandContext","render"],X=a.getMetadata(T.name)?.skipBindingKeys||[],ve=[...new Set([...oe,...X])],ue=y?{skipCache:!0}:void 0,we={...ue??{},skipBindingKeys:ve},_e=Se=>{if(ue)return ue;if(Se.startsWith("_computed")||Se.startsWith("$computed"))return{skipCache:!0}};for(const[Se,Me]of Object.entries(V))if(!ve.includes(Se))if(typeof Me=="string"){const Ze=Tt(Me);if(Ze!==null){let kt=!1,Ot=Ze;Ze.startsWith(nr)&&(kt=!0,Ot=Ze.slice(nr.length));const Nn={componentId:T.id,componentName:T.name,propName:Se};let $t;if(Gn(Ot))try{$t=i.evaluatePipeExpression(Ot,ae,_e(Ot),Nn)}catch(Nt){rt.warn(`파이프 표현식 평가 실패 (컴포넌트: ${T.id}, prop: ${Se}):`,Nt),$t=void 0}else if(dn(Ot))try{$t=i.evaluateExpression(Ot,ae,Nn)}catch(Nt){rt.warn(`표현식 평가 실패 (컴포넌트: ${T.id}, prop: ${Se}):`,Nt),$t=void 0}else $t=i.resolve(Ot,ae,_e(Ot),Nn);V[Se]=kt&&$t!=null?Ji($t):$t}else{const kt={componentId:T.id,componentName:T.name,propName:Se};V[Se]=i.resolveBindings(Me,ae,ue,kt)}}else Array.isArray(Me)?V[Se]=Me.map(Ze=>typeof Ze=="string"?i.resolveBindings(Ze,ae,ue):typeof Ze=="object"&&Ze!==null?i.resolveObject(Ze,ae,we):Ze):Me&&typeof Me=="object"&&(V[Se]=i.resolveObject(Me,ae,we));for(const[Se,Me]of Object.entries(V))V[Se]=yt(Me);if(typeof V.style=="string"&&(V.style=i_(V.style)),V=yd(V,w?void 0:T.actions,ae,{componentContext:Re,actionDispatcher:c}),T.classMap){const Se=cw(T.classMap,ae,i,{skipCache:!0});if(Se){const Me=V.className||"";V.className=Me?`${Me} ${Se}`:Se}}T.style&&(V.style=T.style),T.actions&&T.actions.length>0&&T.type==="composite"&&Object.assign(V,de),T.component_layout&&(V.__componentLayoutDefs=T.component_layout);const Be=T.expandChildren||T.props?.expandChildren,xe=T.props?.cellChildren,De=T.children&&T.children.length>0,Ae=T.component_layout,et=T.slot,Ne=T.props?.modalId,je=T.type==="composite";return(Be||xe||De||Ae||et||Ne||je)&&(V.__componentContext=Re),V},[T.props,T.actions,T.style,T.classMap,T.id,ae,r,i,l,Re,de,yt,dn,Tt,y]),ln=N.useRef(null),zt=N.useMemo(()=>ln.current&&cm(ln.current,Yt)?ln.current:(ln.current=Yt,Yt),[Yt]),Tr=N.useMemo(()=>{const V=T.id;if(typeof V!="string"||!V.includes("{{"))return V;const oe=i.resolveBindings(V,ae,{skipCache:!0});return typeof oe=="string"?oe:V},[T.id,ae,i]),wn=N.useMemo(()=>{const V=T.dataKey,oe=T.trackChanges,ce=T.debounce;if(V){const X=V.startsWith("_global."),ve=X?V.slice(8):V,ue=X?e._global:ae._local;return{dataKey:ve,trackChanges:oe??!1,debounce:ce,setState:X?_e=>{e._globalSetState?e._globalSetState(_e):rt.warn("_global.formData 사용 시 _globalSetState가 필요합니다.")}:me,state:ue??{},_isGlobal:X}}if(Z.dataKey)return Z},[T.dataKey,T.trackChanges,T.debounce,T.id,me,ae._local,e._global,e._globalSetState,Z]),cn=N.useRef(new Set);N.useEffect(()=>{cn.current.clear()},[e._global?._remountKeys]);const fn=N.useCallback((V,oe)=>{const ce=e._global?._remountKeys;return V&&ce?.[V]&&!cn.current.has(V)?(cn.current.add(V),`${V}-remount-${ce[V]}`):V||oe},[e._global?._remountKeys]),sr=N.useMemo(()=>{if(T.text!==void 0){if(typeof T.text=="string"){const V=T.text;let oe=V;const ce={componentId:T.id,componentName:T.name,propName:"text",skipCache:!0},X=Tt(V);if(X!==null){let ve=!1,ue=X;if(X.startsWith(nr)&&(ve=!0,ue=X.slice(nr.length)),Gn(ue))try{oe=i.evaluatePipeExpression(ue,ae,{skipCache:!0},ce)}catch(we){rt.warn(`text 파이프 표현식 평가 실패 (컴포넌트: ${T.id}):`,we),oe=""}else if(dn(ue))try{oe=i.evaluateExpression(ue,ae,ce)}catch(we){rt.warn(`text 표현식 평가 실패 (컴포넌트: ${T.id}):`,we),oe=""}else oe=i.resolve(ue,ae,{skipCache:!0},ce);ve&&oe!=null&&(oe=Ji(oe))}else V.includes("{{")&&(oe=i.resolveBindings(V,ae,{skipCache:!0},ce));return oe=yt(oe),oe??""}return T.text}return!T.children||T.children.length===0?null:T.children.map((V,oe)=>{if(typeof V=="string")return V;const ce=T.__responsiveChildrenKey,X=ce?`responsive.${ce}.children`:"children",ve=R?`${R}.${X}.${oe}`:`${oe}`,ue=V._fromBase?V.id||`child-${oe}`:fn(V.id,`child-${oe}`),we=!V._fromBase&&M?`${ue}_${M}`:ue;return dt.jsx(Br,{componentDef:V,dataContext:ae,translationContext:r,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:c,parentComponentContext:Re,parentFormContextProp:wn,isInsideIteration:y,isEditMode:w,onComponentSelect:S,onComponentHover:v,componentPath:ve,onDragStart:A,onDragEnd:x,layoutKey:M},we)})},[T.text,T.children,T.id,e,ae,r,a,i,l,c,Re,wn,Tt,dn,yt,fn,y,w,S,v,R,A,x,M]),Wn=N.useMemo(()=>{if(!T.iteration)return null;try{const V=md(T.iteration.source,ae,i);if(!Array.isArray(V))return rt.warn(`iteration source가 배열이 아닙니다 (컴포넌트: ${T.id}):`,V),null;const oe=ea();return oe?.isEnabled()&&oe.trackIteration(T.id||`iteration-${Date.now()}`,T.iteration.source,T.iteration.item_var,T.iteration.index_var,V.length),V.map((ce,X)=>{const ve={...ae,[T.iteration.item_var]:ce,[`${T.iteration.item_var}_index`]:X};T.iteration.index_var&&(ve[T.iteration.index_var]=X);const ue=X===0||X===V.length-1;oe?.isEnabled()&&ue&&oe.trackNestedContext?.({componentId:`${T.id||"unknown"}-iter-${X}`,componentType:"iteration",parentContext:{available:Object.keys(ae),values:{}},ownContext:{added:[T.iteration.item_var,...T.iteration.index_var?[T.iteration.index_var]:[]],values:{[T.iteration.item_var]:ce,...T.iteration.index_var?{[T.iteration.index_var]:X}:{}}},depth:1});const we={...T,iteration:void 0,responsive:void 0},_e=R?`${R}.iteration.${X}`:`iteration.${X}`,Be=`${fn(T.id,"item")}-${X}`;return dt.jsx(Br,{componentDef:we,dataContext:ve,translationContext:r,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:c,parentComponentContext:Re,parentFormContextProp:wn,isInsideIteration:!0,isEditMode:w,onComponentSelect:S,onComponentHover:v,componentPath:_e,onDragStart:A,onDragEnd:x,layoutKey:M},Be)})}catch(V){return rt.error(`iteration 렌더링 실패 (컴포넌트: ${T.id}):`,V),null}},[T.iteration,T.children,T.id,e,ae,r,a,i,l,c,Re,wn,fn,w,S,v,R,A,x,M]),[Ut,bt]=N.useState(0),ra=N.useMemo(()=>{if(!T.sortable||!T.itemTemplate)return null;const{sortable:V,itemTemplate:oe}=T;try{const ce=md(V.source,ae,i);if(!Array.isArray(ce))return rt.warn(`sortable source가 배열이 아닙니다 (컴포넌트: ${T.id}):`,ce),null;if(ce.length===0)return null;const X=V.itemKey||"id",ve=V.strategy||"verticalList",ue=V.itemVar||"$item",we=V.indexVar||"$index",_e=V.handle,Be=V.wrapperElement,xe=(et,Ne)=>{const je=T.actions?.filter(Se=>Se.event==="onSortEnd"||Se.type==="onSortEnd");if(bt(Se=>Se+1),je&&je.length>0&&c){const Se={...ae,$sortedItems:et,$sortEvent:Ne};je.forEach(Me=>{try{const Ze=c.createHandler(Me,Se,Re),kt=new Event("sortend");Ze(kt)}catch(Ze){rt.error(`onSortEnd action failed: ${Me.handler}`,Ze)}})}},De=et=>{const Ne=T.actions?.filter(je=>je.event==="onSortStart"||je.type==="onSortStart");if(Ne&&Ne.length>0&&c){const je={...ae,$activeId:et.activeId};Ne.forEach(Se=>{try{const Me=c.createHandler(Se,je,Re),Ze=new Event("sortstart");Me(Ze)}catch(Me){rt.error(`onSortStart action failed: ${Se.handler}`,Me)}})}},Ae=ce.map((et,Ne)=>{const je=String(et[X]),Se={...ae,[ue]:et,[we]:Ne},Me=R?`${R}.sortable.${Ne}`:`sortable.${Ne}`,Ze=`${fn(T.id,"sortable-item")}-v${Ut}-${je}`;return dt.jsx(r_,{id:je,handle:_e,...Be?{as:Be}:{},children:(Be&&oe.children?oe.children:[oe]).map((kt,Ot)=>dt.jsx(Br,{componentDef:kt,dataContext:Se,translationContext:r,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:c,parentComponentContext:Re,parentFormContextProp:void 0,isInsideIteration:!0,isEditMode:w,onComponentSelect:S,onComponentHover:v,componentPath:Me,onDragStart:A,onDragEnd:x,layoutKey:M},`${Ze}-child-${Ot}`))},Ze)});return dt.jsx(e_,{items:ce,itemKey:X,strategy:ve,onSortEnd:xe,onSortStart:De,sortVersion:Ut,children:Ae})}catch(ce){return rt.error(`sortable 렌더링 실패 (컴포넌트: ${T.id}):`,ce),null}},[T.sortable,T.itemTemplate,T.actions,T.id,e,ae,r,a,i,l,c,Re,fn,w,S,v,R,A,x,Ut,M]),Ln=N.useRef(!1);N.useEffect(()=>{if(Ln.current)return;Ln.current=!0;const V=ea();if(V?.isEnabled()&&V.trackMount(o.id,{name:o.name,type:o.type||"component",props:zt}),o.lifecycle?.onMount&&o.lifecycle.onMount.length>0)for(const ce of o.lifecycle.onMount)try{const X=c.createHandler(ce,ae,Re),ve=new Event("mount");X(ve),rt.log(`Lifecycle onMount executed: ${ce.handler} (Component: ${o.id})`)}catch(X){rt.error(`Lifecycle onMount failed: ${ce.handler} (Component: ${o.id})`,X)}const oe=[];if(o.onComponentEvent&&o.onComponentEvent.length>0){const ce=window.G7Core;if(ce?.componentEvent?.on)for(const X of o.onComponentEvent){if(!X.event){rt.warn(`onComponentEvent: event name is required (Component: ${o.id})`);continue}const ve=async we=>{try{const _e={...ae,_eventData:we},xe=await c.createHandler({handler:X.handler,params:X.params,onSuccess:X.onSuccess,onError:X.onError},_e,Re)(new CustomEvent(X.event,{detail:we}));return rt.log(`onComponentEvent "${X.event}" handled: ${X.handler} (Component: ${o.id})`,{eventData:we,result:xe}),xe}catch(_e){throw rt.error(`onComponentEvent "${X.event}" failed: ${X.handler} (Component: ${o.id})`,_e),_e}},ue=ce.componentEvent.on(X.event,ve);oe.push(ue),rt.log(`onComponentEvent: Subscribed to "${X.event}" (Component: ${o.id})`)}else rt.warn(`onComponentEvent: G7Core.componentEvent is not available (Component: ${o.id})`)}return()=>{const ce=ea();ce?.isEnabled()&&ce.trackUnmount(o.id);for(const X of oe)try{X()}catch(ve){rt.error(`onComponentEvent: Failed to unsubscribe (Component: ${o.id})`,ve)}if(oe.length>0&&rt.log(`onComponentEvent: Unsubscribed ${oe.length} event(s) (Component: ${o.id})`),o.lifecycle?.onUnmount&&o.lifecycle.onUnmount.length>0)for(const X of o.lifecycle.onUnmount)try{const ve=c.createHandler(X,ae,Re),ue=new Event("unmount");ve(ue),rt.log(`Lifecycle onUnmount executed: ${X.handler} (Component: ${o.id})`)}catch(ve){rt.error(`Lifecycle onUnmount failed: ${X.handler} (Component: ${o.id})`,ve)}}},[]);const An=N.useMemo(()=>{const V=zt.dataKey,oe=zt.trackChanges,ce=zt.debounce;return V?{dataKey:V,trackChanges:oe??!1,debounce:ce,setState:me,state:de}:null},[zt.dataKey,zt.trackChanges,zt.debounce,me,de]);N.useEffect(()=>{const V=T.dataKey||zt.dataKey;if(!V)return;const oe=ea();if(!oe?.isEnabled())return;const ce=[],X=ue=>{if(ue)for(const we of ue){const _e=we?.props?.name;if(_e&&ce.push({name:_e,type:we.name||we.type||"unknown"}),we?.children&&X(we.children),we?.slots)for(const Be of Object.values(we.slots))Array.isArray(Be)&&X(Be)}};if(o.children&&X(o.children),o.slots)for(const ue of Object.values(o.slots))Array.isArray(ue)&&X(ue);const ve=o.id||`form-${V}`;return oe.trackForm(ve,V,ce),()=>{oe.untrackForm(ve)}},[T,zt.dataKey,o.id,o.children]);const xn=N.useRef(null),Mn=N.useRef(void 0);N.useEffect(()=>{const V=zt?.name;if(!V||!Z.dataKey||!Z.setState||zt?.autoBinding===!1)return;const oe=`${Z.dataKey}.${V}`,ce=window.__g7AutoBindingPaths??new Map;return window.__g7AutoBindingPaths=ce,ce.set(oe,(ce.get(oe)??0)+1),()=>{const X=ce.get(oe)??0;X<=1?ce.delete(oe):ce.set(oe,X-1)}},[zt?.name,zt?.autoBinding,Z.dataKey,Z.setState]);const hn=N.useMemo(()=>{const{dataKey:V,trackChanges:oe,debounce:ce,...X}=zt,ve=X.name;if(!ve||!Z.dataKey||!Z.setState)return X;if(X.autoBinding===!1){const{autoBinding:je,...Se}=X;return Se}const ue=`${Z.dataKey}.${ve}`,we=tC(Z.state,ue),_e=we!==void 0?we:X.value,xe=a.getMetadata(o.name)?.bindingType,De=typeof _e=="boolean"&&(xe==="checked"||xe==="checkable"&&["checkbox","radio"].includes(X?.type)),Ae=Z.debounce,et=je=>{const Se=Z.state||{},Me=nC(Se,ue,je);if(Z.trackChanges&&(Me.hasChanges=!0),window.__g7PendingLocalState=Me,Z.setState(Me),Z._isGlobal)return;const Ze=window.G7Core,kt={[ue]:je};Z.trackChanges&&(kt.hasChanges=!0),Ze?.state?.setLocal?.(kt,{render:!1})},Ne=(je,Se)=>{Ae&&Ae>0?(xn.current&&clearTimeout(xn.current),xn.current=setTimeout(()=>{et(je),xn.current=null,Se&&(Se(),window.__g7PendingLocalState=null)},Ae)):(et(je),Se&&(Se(),window.__g7PendingLocalState=null))};if(De)return{...X,checked:_e,onChange:Se=>{const Me=Se.target.checked;et(Me),X.onChange&&X.onChange(Se)}};{const je=Me=>{const Ze=Me?.target?.value!==void 0?Me.target.value:Me;Ae&&Ae>0&&(Mn.current=Ze);const kt=Me?.target?{target:{value:Ze,name:Me.target.name,type:Me.target.type,checked:Me.target.checked},currentTarget:Me.currentTarget?{value:Ze,name:Me.currentTarget.name}:void 0}:Me;Ne(Ze,()=>{X.onChange&&X.onChange(kt)})};let Se;return Mn.current!==void 0?xn.current!==null?Se=Mn.current:String(_e??"")===String(Mn.current)?(Mn.current=void 0,Se=_e??""):Se=Mn.current:Se=_e??"",{...X,value:Se,onChange:je}}},[zt,Z,Z.state,Z.debounce]),aa=N.useMemo(()=>{const V=ea();if(V?.isEnabled()&&V.trackRender(o.name),!ze)return T.iteration?Wn:null;if(T.sortable&&T.itemTemplate)return ra;if(T.iteration)return Wn;if(T.type==="extension_point"){const{layout:xe,columns:De,gap:Ae,className:et,...Ne}=T.props||{};let je=et||"";return xe==="grid"&&De?je=`${je} grid grid-cols-${De} gap-${Ae||4}`.trim():xe==="flex"&&(je=`${je} flex flex-col gap-${Ae||4}`.trim()),dt.jsx("div",{id:Tr,className:je||void 0,...Ne,children:sr})}const oe=a.getComponent(T.name);if(!oe)return rt.error(`컴포넌트를 찾을 수 없습니다: ${T.name} (ID: ${T.id})`,"componentDef:",JSON.stringify(T,null,2)),null;const ce=e._global?._remountKeys,X={...hn,id:hn.id??Tr,...ce&&Object.keys(ce).length>0&&{__remountTrigger:JSON.stringify(ce)}};if(H?.listeners&&H.handle&&hn["data-drag-handle"]!==void 0&&(Object.assign(X,H.listeners),X.style={...X.style,cursor:H.isDragging?"grabbing":"grab"}),w){const xe=T.id||`auto_${T.name||T.type||"unknown"}_${Math.random().toString(36).substring(2,8)}`,De=Ne=>{typeof Ne.preventDefault=="function"&&Ne.preventDefault(),S&&(Ne.stopPropagation(),S(xe,Ne))},Ae={"data-editor-id":xe,"data-editor-name":T.name,"data-editor-type":T.type,onClick:De};R&&(Ae["data-editor-path"]=R);const et=T.__editorSlotName??T.slot;typeof et=="string"&&(Ae["data-editor-slot"]=et),v&&(Ae.onMouseMove=Ne=>{Ne.stopPropagation(),v(xe,Ne)},Ae.onMouseLeave=Ne=>{v(null,Ne)}),Object.assign(X,Ae),X.editorAttrs=Ae}const ve=T.type==="basic",ue=T.type==="layout",_e=ve||ue?(()=>{const xe={};for(const[De,Ae]of Object.entries(X))De.startsWith("__")||De==="editorAttrs"&&ve||(xe[De]=Ae);return xe})():X;let Be=dt.jsx(oe,{..._e,children:sr});if(wn&&(Be=dt.jsx(Z0,{value:wn,children:Be})),T.isolatedState){const xe=typeof T.isolatedState=="object"?T.isolatedState:{},De=e?._isolatedInit,Ae=De?{...xe,...De}:xe;Be=dt.jsx(lC,{initialState:Ae,scopeId:T.isolatedScopeId,children:Be})}return Be},[ze,T.iteration,T.sortable,T.itemTemplate,T.type,T.name,T.id,T.props,T.isolatedState,T.isolatedScopeId,a,hn,sr,Wn,ra,H,An,w,S,v,A,x,R,e._global?._remountKeys]),$n=N.useMemo(()=>{const V=T.blur_until_loaded;if(!V||e?._global?.__isPreview)return!1;if(typeof V=="string"){const X=Tt(V);if(X!==null)try{const ve={componentId:T.id,componentName:T.name,propName:"blur_until_loaded"};return!!i.evaluateExpression(X,ae,ve)}catch(ve){return rt.warn(`blur_until_loaded 표현식 평가 실패 (컴포넌트: ${T.id}):`,ve),!1}return!1}if(typeof V=="object"&&V!==null){if(!V.enabled)return!1;if(V.data_sources)return(Array.isArray(V.data_sources)?V.data_sources:[V.data_sources]).some(we=>e[we]===void 0);if(he)return!0;const X=["route","query","_global","_local","_dataSourceErrors"];return Object.keys(e).filter(ue=>!X.includes(ue)&&!ue.startsWith("_")).some(ue=>e[ue]===void 0)}if(he)return!0;const oe=["route","query","_global","_local","_dataSourceErrors"];return Object.keys(e).filter(X=>!oe.includes(X)&&!X.startsWith("_")).some(X=>e[X]===void 0)},[T.blur_until_loaded,T.id,he,e,ae,i,Tt]);if($n){const V=T.blur_until_loaded;if(typeof V=="object"&&V?.data_sources){const ce=(Array.isArray(V.data_sources)?V.data_sources:[V.data_sources]).reduce((ve,ue)=>(ve[ue]=e[ue]===void 0?"UNDEFINED":"LOADED",ve),{}),X=Object.keys(e).filter(ve=>!ve.startsWith("_"));rt.log(`[BLUR APPLIED] Component: ${T.id}, data_sources status:`,ce,"Available keys:",X)}else rt.log(`[BLUR APPLIED] Component: ${T.id}, blur_until_loaded:`,V)}const Vt=N.useMemo(()=>{if(!T.blur_until_loaded)return{wrapperClasses:"",innerClasses:""};const V=Yt?.className||"";if(!V)return{wrapperClasses:"",innerClasses:""};const oe=[/^(sm:|md:|lg:|xl:|2xl:)?(col-span-|row-span-|col-start-|col-end-|row-start-|row-end-)/,/^(sm:|md:|lg:|xl:|2xl:)?(self-|place-self-|order-)/,/^(sm:|md:|lg:|xl:|2xl:)?(flex-shrink|flex-grow|flex-\d|basis-)/],ce=V.split(/\s+/).filter(Boolean),X=[],ve=[];for(const ue of ce)oe.some(_e=>_e.test(ue))?X.push(ue):ve.push(ue);return{wrapperClasses:X.join(" "),innerClasses:ve.join(" ")}},[T.blur_until_loaded,Yt?.className]),Cn=window.__slotContextValue;return $e&&Cn?.isEnabled?null:dt.jsx(s_,{componentId:o.id,componentName:o.name,children:T.blur_until_loaded?dt.jsx("div",{className:[Vt.wrapperClasses,$n?"opacity-50 blur-sm transition-all duration-300 pointer-events-none":void 0].filter(Boolean).join(" ")||void 0,children:aa}):aa})});Br.displayName="DynamicRenderer",typeof window<"u"&&(window.__DynamicRenderer=Br);function o_(o){const e={};try{const a=new URL(o,typeof window<"u"?window.location.origin:"http://localhost").searchParams,i=new Set;for(const l of a.keys()){if(i.has(l))continue;i.add(l);const c=a.getAll(l);c.length>1||l.endsWith("[]")?e[l]=c:e[l]=c[0]}}catch{}return e}function l_(o){try{return new URL(o,typeof window<"u"?window.location.origin:"http://localhost").pathname}catch{return o.split("?")[0]}}const Ei=class Ei{constructor(){$(this,"config",{enabled:!1,maxHistorySize:100,logLevel:"info",serverEndpoint:"/_boost/g7-debug/dump-state",autoCapture:!0});$(this,"stateHistory",[]);$(this,"snapshotIdCounter",0);$(this,"stateWatchers",new Map);$(this,"currentLocalState",{});$(this,"currentComputedState",{});$(this,"currentParentContext");$(this,"actionHistory",[]);$(this,"actionWatchers",new Set);$(this,"cacheStats",{hits:0,misses:0,entries:0});$(this,"cacheDecisions",[]);$(this,"cacheDecisionIdCounter",0);$(this,"maxCacheDecisions",200);$(this,"currentRenderCycleId",null);$(this,"isInActionExecution",!1);$(this,"isInIteration",!1);$(this,"mountedComponents",new Map);$(this,"eventListeners",new Map);$(this,"mountWatchers",new Set);$(this,"unmountWatchers",new Set);$(this,"renderCounts",new Map);$(this,"bindingEvalCount",0);$(this,"profilingData",[]);$(this,"isProfiling",!1);$(this,"profilingStartTime",0);$(this,"activeRequests",new Map);$(this,"requestHistory",[]);$(this,"pendingDataSources",new Set);$(this,"requestWatchers",new Set);$(this,"wsConnections",new Map);$(this,"wsMessageHistory",[]);$(this,"wsMessageWatchers",new Set);$(this,"ifConditions",new Map);$(this,"iterations",new Map);$(this,"conditionWatchers",new Set);$(this,"forms",new Map);$(this,"formWatchers",new Set);$(this,"expressionHistory",[]);$(this,"expressionWatchers",new Set);$(this,"expressionIdCounter",0);$(this,"dataSources",new Map);$(this,"dataPathTransforms",[]);$(this,"maxDataPathTransforms",100);$(this,"nestedContexts",[]);$(this,"nestedContextIdCounter",0);$(this,"maxNestedContexts",100);$(this,"formBindingIssues",[]);$(this,"formBindingValidations",[]);$(this,"formBindingIssueIdCounter",0);$(this,"maxFormBindingIssues",100);$(this,"computedProperties",new Map);$(this,"computedRecalcLogs",[]);$(this,"computedRecalcIdCounter",0);$(this,"maxComputedRecalcLogs",100);$(this,"handlers",new Map);$(this,"componentEventSubscriptions",new Map);$(this,"componentEventEmitHistory",[]);$(this,"componentEventIdCounter",0);$(this,"maxComponentEventHistory",100);$(this,"stateRenderingLogs",[]);$(this,"currentStateChangeContext",null);$(this,"stateRenderingIdCounter",0);$(this,"componentRenderCounts",new Map);$(this,"stateToComponentMap",new Map);$(this,"maxStateRenderingLogs",100);$(this,"componentStateSources",new Map);$(this,"contextFlowNodes",new Map);$(this,"dynamicStates",new Map);$(this,"styleIssues",[]);$(this,"componentStyles",new Map);$(this,"authEvents",[]);$(this,"authHeaderHistory",[]);$(this,"authEventIdCounter",0);$(this,"maxAuthEventHistory",50);$(this,"logHistory",[]);$(this,"logIdCounter",0);$(this,"maxLogHistory",500);$(this,"currentLayout",null);$(this,"layoutHistory",[]);$(this,"layoutIdCounter",0);$(this,"layoutStats",{totalLoads:0,cacheHits:0,apiLoads:0});$(this,"maxLayoutHistory",50);$(this,"executionDetails",new Map);$(this,"stateChangeHistory",[]);$(this,"dataSourceChangeHistory",[]);$(this,"changeAlerts",[]);$(this,"changeExpectations",new Map);$(this,"executionIdCounter",0);$(this,"stateChangeIdCounter",0);$(this,"alertIdCounter",0);$(this,"maxExecutionDetails",100);$(this,"maxStateChangeHistory",200);$(this,"maxChangeAlerts",100);$(this,"sequenceExecutions",[]);$(this,"sequenceExecutionStack",[]);$(this,"sequenceIdCounter",0);$(this,"maxSequenceExecutions",50);$(this,"staleClosureWarnings",[]);$(this,"staleClosureIdCounter",0);$(this,"maxStaleClosureWarnings",100);$(this,"stateCaptureRegistry",new Map);$(this,"modalStates",new Map);$(this,"modalStateIssues",[]);$(this,"modalStateRelations",[]);$(this,"modalStateChangeLogs",[]);$(this,"modalStateIssueIdCounter",0);$(this,"modalStateChangeLogIdCounter",0);$(this,"maxModalStateIssues",100);$(this,"maxModalStateChangeLogs",200);$(this,"namedActionDefinitions",{});$(this,"namedActionRefLogs",[]);$(this,"namedActionRefIdCounter",0);$(this,"maxNamedActionRefLogs",200);$(this,"debounceActionHistory",[]);$(this,"dataSourceUpdateHistory",[]);$(this,"debounceActionIdCounter",0);$(this,"dataSourceUpdateIdCounter",0)}static getInstance(){return Ei.instance||(Ei.instance=new Ei),Ei.instance}initialize(){if(this.config.enabled=this.checkDebugMode(),!this.config.enabled){console.log("[G7DevTools] 비활성화됨 (환경설정 > 고급 설정 > 디버그 모드를 켜세요)");return}console.log("[G7DevTools] 활성화됨"),this.setupGlobalErrorHandler()}checkDebugMode(){try{if(window.G7Config?.debug===!0)return!0;const a=window.G7Core?.state?.get?.();return a?.settings?.advanced?.debug_mode===!0||a?._global?.settings?.advanced?.debug_mode===!0}catch{return!1}}isEnabled(){return this.config.enabled}setupGlobalErrorHandler(){window.addEventListener("error",e=>{this.config.enabled&&this.logAction({id:this.generateId(),type:"globalError",startTime:Date.now(),status:"error",error:{name:"Error",message:e.message,stack:e.error?.stack}})}),window.addEventListener("unhandledrejection",e=>{this.config.enabled&&this.logAction({id:this.generateId(),type:"unhandledRejection",startTime:Date.now(),status:"error",error:{name:"UnhandledRejection",message:String(e.reason)}})})}captureStateSnapshot(e){if(!this.config.enabled)return;const r={id:++this.snapshotIdCounter,timestamp:Date.now(),source:e.source,prev:this.sanitizeObject(e.prev),next:this.sanitizeObject(e.next),diff:e.diff};this.stateHistory.push(r),this.stateHistory.length>this.config.maxHistorySize&&this.stateHistory.shift(),this.notifyStateWatchers(r)}getState(){try{const e=window.G7Core,r=e?.state?.get?.()||{},a={};if(e?._isolatedStates&&typeof e._isolatedStates=="object")for(const[i,l]of Object.entries(e._isolatedStates))a[i]=this.sanitizeObject(l);return{_global:r._global||r,_local:this.currentLocalState,_computed:this.currentComputedState,_isolated:Object.keys(a).length>0?a:void 0,$parent:this.currentParentContext}}catch{return{_global:{},_local:this.currentLocalState,_computed:this.currentComputedState}}}updateLocalState(e){this.config.enabled&&(this.currentLocalState=this.sanitizeObject(e))}updateComputedState(e){this.config.enabled&&(this.currentComputedState=this.sanitizeObject(e))}updateParentContext(e){this.config.enabled&&(this.currentParentContext=e?this.sanitizeObject(e):void 0)}getStateHistory(){return[...this.stateHistory]}getDualStorageMismatch(){const e=this.currentLocalState||{};let r={};try{r=(window.G7Core?.state?.get?.()||{})._local||{}}catch{r={}}const a=this.findMismatchedLeafPaths(e,r);return{hasMismatch:a.length>0,mismatchedPaths:a,storageA:e,storageB:r}}findMismatchedLeafPaths(e,r,a=""){const i=[],l=new Set([...Object.keys(e||{}),...Object.keys(r||{})]);for(const c of l){const d=a?`${a}.${c}`:c,f=e?.[c],g=r?.[c],m=f&&typeof f=="object"&&!Array.isArray(f),y=g&&typeof g=="object"&&!Array.isArray(g);if(m&&y)i.push(...this.findMismatchedLeafPaths(f,g,d));else{const w=f===void 0?"__undefined__":JSON.stringify(f),S=g===void 0?"__undefined__":JSON.stringify(g);w!==S&&i.push(d)}}return i}watchState(e,r){return this.stateWatchers.has(e)||this.stateWatchers.set(e,new Set),this.stateWatchers.get(e).add(r),()=>{this.stateWatchers.get(e)?.delete(r)}}notifyStateWatchers(e){if(this.stateWatchers.get("*")?.forEach(r=>{try{r(e.next,e.prev,"*")}catch(a){console.error("[G7DevTools] State watcher error:",a)}}),e.diff)for(const r of e.diff.changed)this.stateWatchers.get(r.path)?.forEach(a=>{try{a(r.newValue,r.oldValue,r.path)}catch(i){console.error("[G7DevTools] State watcher error:",i)}})}diffSnapshots(e,r){const a=this.stateHistory.find(l=>l.id===e),i=this.stateHistory.find(l=>l.id===r);return!a||!i?null:this.calculateDiff(a.next,i.next)}calculateDiff(e,r,a=""){const i={added:[],removed:[],changed:[]},l=new Set(Object.keys(e)),c=new Set(Object.keys(r));for(const d of c){const f=a?`${a}.${d}`:d;l.has(d)?JSON.stringify(e[d])!==JSON.stringify(r[d])&&i.changed.push({path:f,oldValue:e[d],newValue:r[d]}):i.added.push(f)}for(const d of l){const f=a?`${a}.${d}`:d;c.has(d)||i.removed.push(f)}return i}logAction(e){if(!this.config.enabled)return;const r=this.actionHistory.findIndex(a=>a.id===e.id);r>=0?this.actionHistory[r]={...this.actionHistory[r],...e}:(this.actionHistory.push(e),this.actionHistory.length>this.config.maxHistorySize&&this.actionHistory.shift()),this.isProfiling&&this.profilingData.push({type:"action",action:e.type,timestamp:performance.now(),duration:e.duration}),this.notifyActionWatchers(e)}getActionHistory(){return[...this.actionHistory]}watchActions(e){return this.actionWatchers.add(e),()=>{this.actionWatchers.delete(e)}}notifyActionWatchers(e){this.actionWatchers.forEach(r=>{try{r(e)}catch(a){console.error("[G7DevTools] Action watcher error:",a)}})}getActionMetrics(){const e=this.actionHistory.filter(l=>l.status==="success"),r=this.actionHistory.filter(l=>l.status==="error"),a={};for(const l of this.actionHistory)a[l.type]=(a[l.type]||0)+1;const i=e.reduce((l,c)=>l+(c.duration||0),0);return{totalActions:this.actionHistory.length,successCount:e.length,errorCount:r.length,averageDuration:e.length>0?i/e.length:0,actionsByType:a}}recordCacheHit(){this.config.enabled&&this.cacheStats.hits++}recordCacheMiss(){this.config.enabled&&this.cacheStats.misses++}updateCacheEntries(e){this.config.enabled&&(this.cacheStats.entries=e)}getCacheStats(){const e=this.cacheStats.hits+this.cacheStats.misses;return{...this.cacheStats,hitRate:e>0?this.cacheStats.hits/e:0}}resetCacheStats(){this.cacheStats={hits:0,misses:0,entries:0}}trackCacheDecision(e){if(!this.config.enabled)return;const r={id:`cache-${++this.cacheDecisionIdCounter}`,timestamp:Date.now(),expression:e.expression,decision:e.decision,reason:e.reason,context:{isInIteration:this.isInIteration,isInAction:this.isInActionExecution,renderCycleId:this.currentRenderCycleId||void 0,componentId:e.componentId,skipCacheOption:e.skipCacheOption},cachedValue:e.cachedValue!==void 0?this.safeClone(e.cachedValue):void 0,freshValue:e.freshValue!==void 0?this.safeClone(e.freshValue):void 0,valueMatch:e.cachedValue!==void 0&&e.freshValue!==void 0?JSON.stringify(e.cachedValue)===JSON.stringify(e.freshValue):void 0,duration:e.duration};this.cacheDecisions.push(r),this.cacheDecisions.length>this.maxCacheDecisions&&this.cacheDecisions.shift(),e.decision==="cache_hit"?this.cacheStats.hits++:(e.decision==="cache_miss"||e.decision==="skip_cache")&&this.cacheStats.misses++}startRenderCycle(e){return this.currentRenderCycleId=`render-${Date.now()}-${e||"root"}`,this.currentRenderCycleId}endRenderCycle(){this.currentRenderCycleId=null}startActionContext(){this.isInActionExecution=!0}endActionContext(){this.isInActionExecution=!1}startIterationContext(){this.isInIteration=!0}endIterationContext(){this.isInIteration=!1}getCacheDecisionTrackingInfo(){const e=this.getCacheDecisionStats();return{decisions:[...this.cacheDecisions],stats:e,timestamp:Date.now()}}getCacheDecisionStats(){const e=this.cacheDecisions;let r=0,a=0,i=0,l=0;const c={},d={};for(const g of e)g.decision==="cache_hit"?r++:g.decision==="cache_miss"?a++:g.decision==="skip_cache"?i++:g.decision==="invalidate"&&l++,c[g.reason]=(c[g.reason]||0)+1,g.context.componentId&&(d[g.context.componentId]=(d[g.context.componentId]||0)+1);const f=r+a+i;return{totalDecisions:e.length,cacheHits:r,cacheMisses:a,skipCacheCount:i,invalidateCount:l,byReason:c,byComponent:d,avgHitRate:f>0?r/f:0}}getRecentCacheDecisions(e=20,r){let a=[...this.cacheDecisions];return r&&(a=a.filter(i=>i.decision===r)),a.slice(-e)}clearCacheDecisionData(){this.cacheDecisions=[],this.cacheDecisionIdCounter=0}summarizePropsForLifecycle(e){if(!e||typeof e!="object")return e;const r={},a=["children","ref","key"];for(const[i,l]of Object.entries(e))if(!a.includes(i))if(l==null)r[i]=l;else if(Array.isArray(l))r[i]=`[Array(${l.length})]`;else if(typeof l=="object"){const c=Object.keys(l);c.length<=3?r[i]=`{${c.join(", ")}}`:r[i]=`{${c.slice(0,3).join(", ")}, ... +${c.length-3}}`}else typeof l=="string"&&l.length>50?r[i]=l.substring(0,50)+"...":typeof l=="function"?r[i]="[Function]":r[i]=l;return r}trackMount(e,r){if(!this.config.enabled)return;const a=this.summarizePropsForLifecycle(r.props),i={...r,props:a,id:e,mountTime:Date.now()};this.mountedComponents.set(e,i),this.mountWatchers.forEach(l=>{try{l({componentId:e,componentName:r.name,timestamp:i.mountTime})}catch(c){console.error("[G7DevTools] Mount watcher error:",c)}})}trackUnmount(e){if(!this.config.enabled)return;const r=this.mountedComponents.get(e),a=this.eventListeners.get(e)||[];a.length>0&&console.warn(`[G7DevTools] 컴포넌트 ${e} 언마운트 시 ${a.length}개 리스너 미정리`),r&&this.unmountWatchers.forEach(i=>{try{i({componentId:e,componentName:r.name,timestamp:Date.now(),orphanedListeners:a.length})}catch(l){console.error("[G7DevTools] Unmount watcher error:",l)}}),this.mountedComponents.delete(e)}trackListener(e,r,a){if(!this.config.enabled)return;const i=this.eventListeners.get(e)||[];i.push({type:r,target:a,addedAt:Date.now()}),this.eventListeners.set(e,i)}removeListener(e,r){if(!this.config.enabled)return;const a=this.eventListeners.get(e)||[],i=a.findIndex(l=>l.type===r);i>=0&&a.splice(i,1)}getMountedComponents(){return Array.from(this.mountedComponents.values())}getOrphanedListeners(){const e=[];for(const[r,a]of this.eventListeners)this.mountedComponents.has(r)||e.push(...a.map(i=>({...i,componentId:r})));return e}watchMount(e){return this.mountWatchers.add(e),()=>{this.mountWatchers.delete(e)}}watchUnmount(e){return this.unmountWatchers.add(e),()=>{this.unmountWatchers.delete(e)}}trackRender(e){if(!this.config.enabled)return;const r=this.renderCounts.get(e)||0;this.renderCounts.set(e,r+1),this.isProfiling&&this.profilingData.push({type:"render",component:e,timestamp:performance.now()})}trackBindingEval(e){this.config.enabled&&(this.bindingEvalCount++,this.isProfiling&&e&&this.profilingData.push({type:"binding",expression:e,timestamp:performance.now()}))}getRenderCount(){return new Map(this.renderCounts)}getBindingEvalCount(){return this.bindingEvalCount}getMemoryWarnings(){const e=[];try{const i=this.getState(),l=JSON.stringify(i).length;l>1e6&&e.push({type:"large-state",message:`상태 크기가 ${(l/1024/1024).toFixed(2)}MB입니다`,suggestion:"불필요한 데이터 정리 필요",severity:l>5e6?"error":"warning"})}catch{}this.stateHistory.length>this.config.maxHistorySize*.8&&e.push({type:"large-history",message:`상태 이력이 ${this.stateHistory.length}개입니다`,suggestion:"maxHistory 설정 조정 필요",severity:"warning"});const r=this.getOrphanedListeners().length;r>0&&e.push({type:"orphaned-listeners",message:`${r}개의 정리되지 않은 이벤트 리스너`,suggestion:"useEffect cleanup 또는 removeEventListener 확인",severity:r>10?"error":"warning"});const a=Array.from(this.renderCounts.entries()).filter(([,i])=>i>50);return a.length>0&&e.push({type:"excessive-renders",message:`${a.length}개 컴포넌트가 50회 이상 렌더링`,suggestion:"React.memo, useMemo, useCallback 사용 고려",severity:"warning"}),e}startProfiling(){this.config.enabled&&(this.isProfiling=!0,this.profilingData=[],this.profilingStartTime=performance.now(),console.log("[G7DevTools] 프로파일링 시작"))}stopProfiling(){this.isProfiling=!1;const e=performance.now()-this.profilingStartTime,r=this.analyzeProfile(e);return console.log("[G7DevTools] 프로파일링 완료",r),r}analyzeProfile(e){const r=this.profilingData.filter(g=>g.type==="render"),a=this.profilingData.filter(g=>g.type==="binding"),i=this.profilingData.filter(g=>g.type==="action"),l={};for(const g of r)g.component&&(l[g.component]||(l[g.component]={count:0,durations:[]}),l[g.component].count++,g.duration&&l[g.component].durations.push(g.duration));const c=Object.entries(l).map(([g,m])=>({name:g,renderCount:m.count,avgDuration:m.durations.length>0?m.durations.reduce((y,w)=>y+w,0)/m.durations.length:0})).sort((g,m)=>m.renderCount-g.renderCount).slice(0,10),d={};for(const g of a)g.expression&&(d[g.expression]=(d[g.expression]||0)+1);const f=Object.entries(d).sort(([,g],[,m])=>m-g).slice(0,10).map(([g])=>g);return{duration:e,entries:this.profilingData,summary:{totalRenders:r.length,totalBindings:a.length,totalActions:i.length,slowestComponents:c,hotPaths:f}}}resetPerformanceStats(){this.renderCounts.clear(),this.bindingEvalCount=0,this.profilingData=[]}trackRequest(e,r,a){if(!this.config.enabled)return"";const i=this.generateId(),l=l_(e),c=o_(e);return this.activeRequests.set(i,{id:i,url:l,fullUrl:e,queryParams:c,method:r,startTime:Date.now(),status:"pending",requestBody:a?.requestBody?this.sanitizeObject(a.requestBody):void 0,dataSourceId:a?.dataSourceId}),this.isProfiling&&this.profilingData.push({type:"network",timestamp:performance.now()}),i}completeRequest(e,r,a){if(!this.config.enabled)return;const i=this.activeRequests.get(e);if(!i)return;const l={...i,status:r>=200&&r<300?"success":"error",statusCode:r,duration:Date.now()-i.startTime,endTime:Date.now(),response:this.sanitizeObject(a)};this.requestHistory.push(l),this.activeRequests.delete(e),this.requestHistory.length>this.config.maxHistorySize&&this.requestHistory.shift(),this.notifyRequestWatchers(l)}failRequest(e,r){if(!this.config.enabled)return;const a=this.activeRequests.get(e);if(!a)return;const i={...a,status:"error",error:r,duration:Date.now()-a.startTime,endTime:Date.now()};this.requestHistory.push(i),this.activeRequests.delete(e),this.notifyRequestWatchers(i)}trackDataSource(e){this.config.enabled&&this.pendingDataSources.add(e)}completeDataSource(e){this.config.enabled&&this.pendingDataSources.delete(e)}getActiveRequests(){return Array.from(this.activeRequests.values())}getRequestHistory(){return[...this.requestHistory]}getPendingDataSources(){return Array.from(this.pendingDataSources)}watchRequest(e){return this.requestWatchers.add(e),()=>{this.requestWatchers.delete(e)}}notifyRequestWatchers(e){this.requestWatchers.forEach(r=>{try{r(e)}catch(a){console.error("[G7DevTools] Request watcher error:",a)}})}trackWebSocketConnection(e,r,a){this.config.enabled&&this.wsConnections.set(e,{id:e,url:r,state:a,connectedAt:a==="open"?Date.now():void 0})}trackWebSocketMessage(e,r,a,i){if(!this.config.enabled)return;const l={id:this.generateId(),connectionId:e,direction:r,type:a,payload:this.sanitizeObject(i),timestamp:Date.now(),sequence:this.wsMessageHistory.length};this.wsMessageHistory.push(l),this.wsMessageHistory.length>this.config.maxHistorySize&&this.wsMessageHistory.shift(),this.notifyWebSocketWatchers(l)}getWebSocketConnections(){return Array.from(this.wsConnections.values())}getWebSocketMessageHistory(){return[...this.wsMessageHistory]}getWebSocketConnectionState(){const e=Array.from(this.wsConnections.values());return e.some(r=>r.state==="open")?"connected":e.some(r=>r.state==="connecting")?"reconnecting":"disconnected"}watchWebSocketMessage(e){return this.wsMessageWatchers.add(e),()=>{this.wsMessageWatchers.delete(e)}}notifyWebSocketWatchers(e){this.wsMessageWatchers.forEach(r=>{try{r(e)}catch(a){console.error("[G7DevTools] WebSocket watcher error:",a)}})}trackIfCondition(e,r,a){if(!this.config.enabled)return;const i=this.ifConditions.get(e),l=i?.evaluatedValue;this.ifConditions.set(e,{id:e,expression:r,evaluatedValue:a,evaluationCount:(i?.evaluationCount||0)+1,lastEvaluated:Date.now()}),i&&l!==a&&this.notifyConditionWatchers({id:e,expression:r,oldValue:l,newValue:a,timestamp:Date.now()})}trackIteration(e,r){this.config.enabled&&this.iterations.set(e,{id:e,...r,lastRendered:Date.now()})}getIfConditions(){return Array.from(this.ifConditions.values())}getIterations(){return Array.from(this.iterations.values())}getScopeChain(e){const r=[],a=this.getState();return r.push({name:"_global",value:a._global,source:"global"}),r.push({name:"_local",value:a._local,source:"local"}),r.push({name:"_computed",value:a._computed,source:"computed"}),r}watchConditionChange(e){return this.conditionWatchers.add(e),()=>{this.conditionWatchers.delete(e)}}notifyConditionWatchers(e){this.conditionWatchers.forEach(r=>{try{r(e)}catch(a){console.error("[G7DevTools] Condition watcher error:",a)}})}trackForm(e,r,a){this.config.enabled&&this.forms.set(e,{id:e,dataKey:r,inputs:a,trackedAt:Date.now()})}trackFormChange(e,r,a){if(!this.config.enabled)return;const i={formId:e,inputName:r,value:a,timestamp:Date.now()};this.notifyFormWatchers(i)}untrackForm(e){this.forms.delete(e)}getForms(){return Array.from(this.forms.values())}getFormState(e){const r=this.getState();return this.getNestedValue(r,e)||{}}getBindingPath(e,r){return`${e}.${r}`}watchFormChange(e){return this.formWatchers.add(e),()=>{this.formWatchers.delete(e)}}notifyFormWatchers(e){this.formWatchers.forEach(r=>{try{r(e)}catch(a){console.error("[G7DevTools] Form watcher error:",a)}})}trackFormBindingIssue(e,r,a){if(!this.config.enabled)return;const i={id:`form-issue-${++this.formBindingIssueIdCounter}`,timestamp:Date.now(),type:e,severity:r,formId:a.formId,formDataKey:a.formDataKey,inputInfo:a.inputInfo,contextInfo:a.contextInfo,description:a.description,suggestion:a.suggestion,docLink:a.docLink};this.formBindingIssues.push(i),this.formBindingIssues.length>this.maxFormBindingIssues&&this.formBindingIssues.shift()}validateFormBinding(e,r,a,i){const l=a.map(f=>{const g=[];let m=!0;return f.name||(g.push("Input에 name 속성이 없습니다"),m=!1,this.trackFormBindingIssue("missing-input-name","error",{formId:e,formDataKey:r,inputInfo:{name:f.name,type:f.type},description:"Input에 name 속성이 없어 자동 바인딩이 동작하지 않습니다",suggestion:"Input에 name 속성을 추가하세요",docLink:"troubleshooting-components-form.md"})),r||(g.push("Form에 dataKey가 없습니다"),m=!1),{inputName:f.name||"(unnamed)",inputType:f.type,bindingPath:r&&f.name?`${r}.${f.name}`:"-",isValid:m,currentValue:f.value,issues:g}});if(r||this.trackFormBindingIssue("missing-datakey","error",{formId:e,description:"Form에 dataKey가 설정되지 않아 자동 바인딩이 동작하지 않습니다",suggestion:"Form 컴포넌트에 dataKey props를 설정하세요",docLink:"troubleshooting-components-form.md"}),i.isContextBroken){const f=i.breakReason?.includes("sortable")?"sortable-context-break":i.breakReason?.includes("modal")?"modal-context-isolation":"context-not-propagated";this.trackFormBindingIssue(f,"warning",{formId:e,formDataKey:r,contextInfo:{hasParentFormContext:i.hasParentContext,parentFormContextProp:i.parentContextProp,isInsideSortable:i.breakReason?.includes("sortable")||!1,isInsideModal:i.breakReason?.includes("modal")||!1,depth:0},description:i.breakReason||"Form 컨텍스트가 제대로 전파되지 않았습니다",suggestion:"parentFormContextProp={undefined}를 확인하거나 중첩 구조를 검토하세요",docLink:"troubleshooting-components-form.md"})}const c={formId:e,dataKey:r,timestamp:Date.now(),contextPropagation:i,inputBindings:l,isValid:l.every(f=>f.isValid)&&!!r&&!i.isContextBroken,issueCount:l.filter(f=>!f.isValid).length+(r?0:1)+(i.isContextBroken?1:0)},d=this.formBindingValidations.findIndex(f=>f.formId===e);return d>=0?this.formBindingValidations[d]=c:this.formBindingValidations.push(c),c}getFormBindingValidationTrackingInfo(){const e=this.getFormBindingValidationStats();return{issues:[...this.formBindingIssues],validations:[...this.formBindingValidations],stats:e,timestamp:Date.now()}}getFormBindingValidationStats(){const e={"missing-datakey":0,"missing-input-name":0,"context-not-propagated":0,"sortable-context-break":0,"modal-context-isolation":0,"duplicate-input-name":0,"value-type-mismatch":0,"binding-path-invalid":0},r={info:0,warning:0,error:0};for(const i of this.formBindingIssues)e[i.type]++,r[i.severity]++;const a=Object.entries(e).filter(([,i])=>i>0).sort((i,l)=>l[1]-i[1]).slice(0,5).map(([i,l])=>({type:i,count:l,description:this.getIssueTypeDescription(i)}));return{totalFormsValidated:this.formBindingValidations.length,validForms:this.formBindingValidations.filter(i=>i.isValid).length,formsWithIssues:this.formBindingValidations.filter(i=>!i.isValid).length,totalIssues:this.formBindingIssues.length,byIssueType:e,bySeverity:r,topIssues:a}}getIssueTypeDescription(e){return{"missing-datakey":"Form에 dataKey 누락","missing-input-name":"Input에 name 속성 누락","context-not-propagated":"Form 컨텍스트 전파 실패","sortable-context-break":"Sortable 컨테이너에서 컨텍스트 단절","modal-context-isolation":"모달에서 부모 Form 컨텍스트 격리","duplicate-input-name":"동일 Form 내 중복 Input name","value-type-mismatch":"값 타입과 Input 타입 불일치","binding-path-invalid":"바인딩 경로 유효하지 않음"}[e]||e}clearFormBindingIssues(){this.formBindingIssues=[],this.formBindingValidations=[],this.formBindingIssueIdCounter=0}trackComputedProperty(e,r,a,i,l,c,d){if(!this.config.enabled)return;const f=`computed-${e}-${c||"global"}`,g={id:f,name:e,expression:r,componentId:c,dependencies:a,currentValue:this.safeClone(i),lastComputedAt:Date.now(),computationTime:l,error:d};this.computedProperties.set(f,g)}trackComputedRecalc(e,r,a,i,l,c,d){if(!this.config.enabled)return;const f=`computed-${e}-${d||"global"}`,g=JSON.stringify(a)!==JSON.stringify(i),m={id:`recalc-${++this.computedRecalcIdCounter}`,computedId:f,computedName:e,timestamp:Date.now(),trigger:r,triggeredBy:c,previousValue:this.safeClone(a),newValue:this.safeClone(i),valueChanged:g,computationTime:l,cascadeCount:0};this.computedRecalcLogs.push(m),this.computedRecalcLogs.length>this.maxComputedRecalcLogs&&this.computedRecalcLogs.shift();const y=this.computedProperties.get(f);y&&(y.currentValue=this.safeClone(i),y.lastComputedAt=Date.now(),y.computationTime=l)}analyzeComputedDependencyChain(e,r){const a=new Set,i=[];let l=!1,c,d=0;const f=(m,y)=>{if(d=Math.max(d,y),a.has(m))return l=!0,c=[...i,m],{name:m,type:"computed",children:[],depth:y};a.add(m),i.push(m);const w=this.computedProperties.get(`computed-${m}-${r||"global"}`),S=[];if(w)for(const v of w.dependencies)v.type==="computed"?S.push(f(v.path,y+1)):S.push({name:v.path,type:v.type,children:[],depth:y+1});return i.pop(),a.delete(m),{name:m,type:"computed",children:S,depth:y}},g=f(e,0);return{root:e,tree:g,hasCycle:l,cyclePath:c,maxDepth:d}}getComputedDependencyTrackingInfo(){const e=Array.from(this.computedProperties.values()),r=this.getComputedDependencyStats(),a=[];for(const i of e){const l=this.analyzeComputedDependencyChain(i.name,i.componentId);a.push(l)}return{properties:e,recalcLogs:[...this.computedRecalcLogs],dependencyChains:a,stats:r,timestamp:Date.now()}}getComputedDependencyStats(){const e={"state-change":0,"datasource-update":0,"dependency-change":0,manual:0,initial:0},r={},a={};let i=0,l=0;for(const g of this.computedRecalcLogs)e[g.trigger]++,g.valueChanged||l++,r[g.computedName]=(r[g.computedName]||0)+1,a[g.computedName]||(a[g.computedName]=[]),a[g.computedName].push(g.computationTime),i+=g.computationTime;const c=Object.entries(r).sort((g,m)=>m[1]-g[1]).slice(0,5).map(([g,m])=>({name:g,count:m})),d=Object.entries(a).map(([g,m])=>({name:g,avgTime:m.reduce((y,w)=>y+w,0)/m.length})).sort((g,m)=>m.avgTime-g.avgTime).slice(0,5);let f=0;for(const g of this.computedProperties.values())this.analyzeComputedDependencyChain(g.name,g.componentId).hasCycle&&f++;return{totalComputed:this.computedProperties.size,totalRecalculations:this.computedRecalcLogs.length,unnecessaryRecalculations:l,avgComputationTime:this.computedRecalcLogs.length>0?i/this.computedRecalcLogs.length:0,topRecalculated:c,slowestComputed:d,cycleDetectionCount:f,byTrigger:e}}clearComputedTracking(){this.computedProperties.clear(),this.computedRecalcLogs=[],this.computedRecalcIdCounter=0}trackModalOpen(e){if(!this.config.enabled)return;const r={modalId:e.modalId,modalName:e.modalName,openedAt:Date.now(),closedAt:null,scopeType:e.scopeType||"isolated",parentModalId:e.parentModalId,componentId:e.componentId,initialState:e.initialState?{...e.initialState}:{},currentState:e.initialState?{...e.initialState}:{},stateChangeCount:0,isolatedStateKeys:e.isolatedStateKeys||[],sharedStateKeys:e.sharedStateKeys||[]};this.modalStates.set(e.modalId,r),this.validateModalDefinitionExists(e.modalId,e.modalName),e.parentModalId&&(this.modalStateRelations.find(i=>i.parentModalId===e.parentModalId&&i.childModalId===e.modalId)||this.modalStateRelations.push({parentModalId:e.parentModalId,childModalId:e.modalId,sharedKeys:e.sharedStateKeys||[],isolatedKeys:e.isolatedStateKeys||[],relationType:"parent-child"}))}trackModalClose(e,r){if(!this.config.enabled)return;const a=this.modalStates.get(e);a&&(a.closedAt=Date.now(),r&&(a.currentState={...r}),this.detectStateLeakage(a))}validateModalDefinitionExists(e,r){const a=this.currentLayout;if(!a?.layoutJson)return;const i=a.layoutJson.modals;if(!i){this.recordModalStateIssue({type:"missing-definition",modalId:e,modalName:r,severity:"error",description:`모달 "${e}"이(가) modalStack에 추가되었으나, 현재 레이아웃에 modals 섹션이 없습니다. 레이아웃 경로: ${a.layoutPath}`,affectedStateKeys:[],expectedValue:`modals 섹션에 id="${e}" 정의 존재`,actualValue:"modals 섹션 없음"});return}const l=Array.isArray(i)?i:Object.values(i);l.some(d=>d?.id===e||d?.props?.id===e)||this.recordModalStateIssue({type:"missing-definition",modalId:e,modalName:r,severity:"error",description:`모달 "${e}"이(가) modalStack에 추가되었으나, 렌더링된 레이아웃의 modals 섹션에 해당 ID의 정의가 없습니다. partial 로딩 실패, 레이아웃 병합 문제, extends 상속 누락 등을 확인하세요. 레이아웃 경로: ${a.layoutPath}`,affectedStateKeys:[],expectedValue:`modals 배열에 id="${e}" 항목 존재`,actualValue:`modals 배열에 ${l.length}개 모달 정의 (${l.map(d=>d?.id||"unknown").join(", ")})`})}trackModalStateChange(e){if(!this.config.enabled)return;const r=this.modalStates.get(e.modalId);if(!r)return;r.stateChangeCount++,r.currentState[e.stateKey]=e.newValue;const a=this.checkIsolationViolation(r,e.stateKey),i={id:`modal-change-${++this.modalStateChangeLogIdCounter}`,modalId:e.modalId,modalName:r.modalName,timestamp:Date.now(),stateKey:e.stateKey,previousValue:e.previousValue,newValue:e.newValue,changeSource:e.changeSource||"user-action",violatesIsolation:a};this.modalStateChangeLogs.push(i),this.modalStateChangeLogs.length>this.maxModalStateChangeLogs&&this.modalStateChangeLogs.shift(),a&&this.recordModalStateIssue({type:"isolation-violation",modalId:e.modalId,modalName:r.modalName,severity:"warning",description:`모달 '${r.modalName}'에서 격리된 상태 키 '${e.stateKey}'가 변경됨`,affectedStateKeys:[e.stateKey]})}detectStateLeakage(e){if(e.scopeType==="isolated")for(const r of e.isolatedStateKeys){const a=e.initialState[r],i=e.currentState[r];if(a!==i&&e.parentModalId){const l=this.modalStates.get(e.parentModalId);l&&l.currentState.hasOwnProperty(r)&&this.recordModalStateIssue({type:"state-leakage",modalId:e.modalId,modalName:e.modalName,severity:"error",description:`모달 닫힘 후 상태 '${r}'가 부모 모달로 유출될 수 있음`,affectedStateKeys:[r],leakedValue:i,expectedValue:a})}}}checkIsolationViolation(e,r){return e.scopeType==="isolated",!1}recordModalStateIssue(e){const r={id:`modal-issue-${++this.modalStateIssueIdCounter}`,type:e.type,modalId:e.modalId,modalName:e.modalName,timestamp:Date.now(),severity:e.severity,description:e.description,affectedStateKeys:e.affectedStateKeys,leakedValue:e.leakedValue,expectedValue:e.expectedValue,actualValue:e.actualValue,stackInfo:e.stackInfo};this.modalStateIssues.push(r),this.modalStateIssues.length>this.maxModalStateIssues&&this.modalStateIssues.shift()}getModalStateScopeTrackingInfo(){const e=Array.from(this.modalStates.values()),r=this.getModalStateScopeStats();return{modals:e,issues:[...this.modalStateIssues],relations:[...this.modalStateRelations],changeLogs:[...this.modalStateChangeLogs],stats:r,timestamp:Date.now()}}getModalStateScopeStats(){const e=Array.from(this.modalStates.values()),r={warning:0,error:0},a={"state-leakage":0,"isolation-violation":0,"parent-mutation":0,"orphaned-state":0,"scope-mismatch":0,"cleanup-failure":0,"missing-definition":0};for(const l of this.modalStateIssues)r[l.severity]++,a[l.type]++;const i={isolated:0,shared:0,inherited:0};for(const l of e)i[l.scopeType]++;return{totalModals:e.length,openModals:e.filter(l=>l.closedAt===null).length,nestedModals:e.filter(l=>l.parentModalId!==void 0).length,totalIssues:this.modalStateIssues.length,issuesBySeverity:r,issuesByType:a,byScope:i,leakageDetectionCount:a["state-leakage"],cleanupFailureCount:a["cleanup-failure"]}}clearModalStateScopeTracking(){this.modalStates.clear(),this.modalStateIssues=[],this.modalStateRelations=[],this.modalStateChangeLogs=[],this.modalStateIssueIdCounter=0,this.modalStateChangeLogIdCounter=0}setNamedActionDefinitions(e){this.config.enabled&&(this.namedActionDefinitions=e||{})}trackNamedActionRef(e){if(!this.config.enabled)return;const r={...e,id:`named_action_ref_${++this.namedActionRefIdCounter}`};this.namedActionRefLogs.push(r),this.namedActionRefLogs.length>this.maxNamedActionRefLogs&&(this.namedActionRefLogs=this.namedActionRefLogs.slice(-this.maxNamedActionRefLogs))}getNamedActionTrackingInfo(){const e={};for(const a of this.namedActionRefLogs)e[a.actionRefName]=(e[a.actionRefName]||0)+1;const r=Object.keys(this.namedActionDefinitions).filter(a=>!e[a]);return{definitions:this.namedActionDefinitions,refLogs:[...this.namedActionRefLogs],stats:{totalDefinitions:Object.keys(this.namedActionDefinitions).length,totalRefs:this.namedActionRefLogs.length,refCountByName:e,unusedDefinitions:r},timestamp:Date.now()}}clearNamedActionTracking(){this.namedActionDefinitions={},this.namedActionRefLogs=[],this.namedActionRefIdCounter=0}trackExpressionEval(e){if(!this.config.enabled)return;const r={...e,id:`expr-${++this.expressionIdCounter}`,timestamp:Date.now(),warning:this.detectExpressionWarning(e)};this.expressionHistory.push(r),this.expressionHistory.length>500&&this.expressionHistory.shift(),this.isProfiling&&this.profilingData.push({type:"binding",expression:e.expression,timestamp:performance.now(),duration:e.duration}),this.notifyExpressionWatchers(r)}detectExpressionWarning(e){const{expression:r,result:a,resultType:i,method:l,duration:c}=e;if(i==="undefined"&&!r.includes("??")&&!r.includes("||")&&/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(r.replace(/{{|}}/g,"").trim()))return{type:"undefined-result",message:"표현식 결과가 undefined입니다",suggestion:`데이터가 로드되었는지 확인하거나 fallback 값을 추가하세요: ${r} ?? ''`};if(i==="null")return{type:"null-result",message:"표현식 결과가 null입니다",suggestion:`nullish coalescing 연산자를 사용하세요: ${r} ?? ''`};if(l==="resolveBindings"&&i==="string"){const d=String(a);if(d.includes("[object Object]")||/^\[.*\]$/.test(d))return{type:"array-to-string",message:"배열/객체가 문자열로 변환되었습니다",suggestion:"evaluateExpression()을 사용하여 원본 타입을 유지하세요"}}if(l==="resolveBindings"&&i==="string"&&String(a).includes("[object Object]"))return{type:"object-to-string",message:"객체가 [object Object]로 변환되었습니다",suggestion:"evaluateExpression()을 사용하거나 특정 속성에 접근하세요"};if(i==="undefined"&&r.includes(".")&&!r.includes("?.")){const d=r.replace(/{{|}}/g,"").trim().split(".");if(d.length>=2)return{type:"missing-optional-chain",message:"Optional chaining(?.) 누락 가능성",suggestion:`안전한 접근을 위해 ?. 사용을 고려하세요: ${d.join("?.")}`}}if((r.includes("{{item.")||r.includes("{{index}}"))&&Array.from(this.iterations.values()).some(g=>g.itemVar!=="item"))return{type:"wrong-iteration-var",message:"'item'/'index' 대신 iteration에서 정의한 변수명을 사용해야 합니다",suggestion:"iteration의 item_var/index_var에 정의된 변수명을 확인하세요"};if(c&&c>10)return{type:"slow-evaluation",message:`표현식 평가에 ${c.toFixed(2)}ms 소요됨`,suggestion:"복잡한 표현식을 단순화하거나 computed 값으로 분리하세요"}}getExpressions(){return[...this.expressionHistory]}getExpressionWarnings(){return this.expressionHistory.filter(e=>e.warning!=null)}searchExpressions(e){const r=e.toLowerCase();return this.expressionHistory.filter(a=>a.expression.toLowerCase().includes(r)||a.componentName?.toLowerCase().includes(r)||a.propName?.toLowerCase().includes(r))}getExpressionStats(){const e=this.expressionHistory,r=new Set(e.map(f=>f.expression)),a=e.filter(f=>f.warning!=null),i=e.filter(f=>f.fromCache),l=e.filter(f=>f.duration!=null).map(f=>f.duration),c={};for(const f of e)c[f.resultType]=(c[f.resultType]||0)+1;const d={};for(const f of a)f.warning&&(d[f.warning.type]=(d[f.warning.type]||0)+1);return{totalEvaluations:e.length,uniqueExpressions:r.size,warningCount:a.length,cacheHitRate:e.length>0?i.length/e.length:0,averageDuration:l.length>0?l.reduce((f,g)=>f+g,0)/l.length:0,byType:c,byWarning:d}}clearExpressions(){this.expressionHistory=[],this.expressionIdCounter=0}watchExpressions(e){return this.expressionWatchers.add(e),()=>{this.expressionWatchers.delete(e)}}notifyExpressionWatchers(e){this.expressionWatchers.forEach(r=>{try{r(e)}catch(a){console.error("[G7DevTools] Expression watcher error:",a)}})}setLogLevel(e){this.config.logLevel=e}setMaxHistory(e){this.config.maxHistorySize=Math.max(10,Math.min(1e3,e))}setServerEndpoint(e){this.config.serverEndpoint=e}getConfig(){return{...this.config}}generateId(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}sanitizeObject(e,r=new WeakSet){if(e===null||typeof e!="object")return e;if(r.has(e))return"[Circular]";if(r.add(e),Array.isArray(e))return e.map(i=>this.sanitizeObject(i,r));const a={};for(const i of Object.keys(e))try{a[i]=this.sanitizeObject(e[i],r)}catch{a[i]="[Unable to serialize]"}return a}getNestedValue(e,r){if(!r)return e;const a=r.split(".");let i=e;for(const l of a){if(i==null)return;i=i[l]}return i}getLifecycleInfo(){return{mountedComponents:Array.from(this.mountedComponents.values()),orphanedListeners:this.getOrphanedListeners()}}getPerformanceInfo(){return{renderCounts:this.renderCounts,bindingEvalCount:this.bindingEvalCount,memoryWarnings:this.getMemoryWarnings()}}getNetworkInfo(){return{activeRequests:Array.from(this.activeRequests.values()),requestHistory:[...this.requestHistory],pendingDataSources:Array.from(this.pendingDataSources)}}getConditionalInfo(){return{ifConditions:Array.from(this.ifConditions.values()),iterations:Array.from(this.iterations.values())}}getFormInfo(){return Array.from(this.forms.values())}getWebSocketInfo(){return{connections:Array.from(this.wsConnections.values()),messageHistory:[...this.wsMessageHistory],connectionState:this.getWebSocketConnectionState()}}getStateAtTime(e){const r=[...this.stateHistory].reverse().find(a=>a.timestamp<=e);if(r)return{_global:r.next,_local:{}}}reset(){this.stateHistory=[],this.actionHistory=[],this.cacheStats={hits:0,misses:0,entries:0},this.cacheDecisions=[],this.cacheDecisionIdCounter=0,this.currentRenderCycleId=null,this.isInActionExecution=!1,this.isInIteration=!1,this.mountedComponents.clear(),this.eventListeners.clear(),this.renderCounts.clear(),this.bindingEvalCount=0,this.profilingData=[],this.activeRequests.clear(),this.requestHistory=[],this.pendingDataSources.clear(),this.wsConnections.clear(),this.wsMessageHistory=[],this.ifConditions.clear(),this.iterations.clear(),this.forms.clear(),this.expressionHistory=[],this.expressionIdCounter=0,this.dataSources.clear(),this.dataPathTransforms=[],this.nestedContexts=[],this.nestedContextIdCounter=0,this.formBindingIssues=[],this.formBindingValidations=[],this.formBindingIssueIdCounter=0,this.computedProperties.clear(),this.computedRecalcLogs=[],this.computedRecalcIdCounter=0,this.modalStates.clear(),this.modalStateIssues=[],this.modalStateRelations=[],this.modalStateChangeLogs=[],this.modalStateIssueIdCounter=0,this.modalStateChangeLogIdCounter=0,this.logHistory=[],this.logIdCounter=0}getExpressionInfo(){return{expressions:this.getExpressions(),stats:this.getExpressionStats()}}trackLog(e,r,a){if(!this.config.enabled)return;const i=a.map(c=>{if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c)}}).join(" "),l={id:`log-${++this.logIdCounter}`,level:e,prefix:r,message:i,args:this.sanitizeObject(a),timestamp:Date.now(),stack:e==="error"?new Error().stack:void 0};this.logHistory.push(l),this.logHistory.length>this.maxLogHistory&&this.logHistory.shift()}trackAction(e){if(!this.config.enabled)return;const r={id:`debounce-action-${++this.debounceActionIdCounter}`,...e,timestamp:Date.now()};this.debounceActionHistory.push(r),this.debounceActionHistory.length>100&&this.debounceActionHistory.shift()}trackDataSourceUpdate(e){if(!this.config.enabled)return;const r={id:`ds-update-${++this.dataSourceUpdateIdCounter}`,...e};this.dataSourceUpdateHistory.push(r),this.dataSourceUpdateHistory.length>100&&this.dataSourceUpdateHistory.shift()}getDebounceActionHistory(e){let r=[...this.debounceActionHistory];return e?.handler&&(r=r.filter(a=>a.handler.includes(e.handler))),e?.status&&(r=r.filter(a=>a.status===e.status)),e?.limit&&(r=r.slice(-e.limit)),r}getDataSourceUpdateHistory(e){let r=[...this.dataSourceUpdateHistory];return e?.dataSourceId&&(r=r.filter(a=>a.dataSourceId===e.dataSourceId)),e?.updateType&&(r=r.filter(a=>a.updateType===e.updateType)),e?.limit&&(r=r.slice(-e.limit)),r}getLogs(e){let r=[...this.logHistory];if(e?.level){const a=Array.isArray(e.level)?e.level:[e.level];r=r.filter(i=>a.includes(i.level))}if(e?.prefix){const a=e.prefix.toLowerCase();r=r.filter(i=>i.prefix.toLowerCase().includes(a))}if(e?.search){const a=e.search.toLowerCase();r=r.filter(i=>i.message.toLowerCase().includes(a))}return e?.since&&(r=r.filter(a=>a.timestamp>=e.since)),e?.limit&&(r=r.slice(-e.limit)),r}getLogStats(){const r=Date.now()-6e4,a={log:0,warn:0,error:0,debug:0,info:0},i={};let l=0,c=0;for(const d of this.logHistory)a[d.level]++,i[d.prefix]=(i[d.prefix]||0)+1,d.timestamp>=r&&(d.level==="error"&&l++,d.level==="warn"&&c++);return{totalLogs:this.logHistory.length,byLevel:a,byPrefix:i,recentErrors:l,recentWarnings:c}}clearLogs(){this.logHistory=[],this.logIdCounter=0}getLogInfo(){return{entries:this.getLogs(),stats:this.getLogStats()}}trackDataSourceDefinition(e){this.config.enabled&&this.dataSources.set(e.id,{...e,status:"idle"})}trackDataSourceLoading(e){if(!this.config.enabled)return;const r=this.dataSources.get(e);r&&this.dataSources.set(e,{...r,status:"loading"})}trackDataSourceLoaded(e,r,a){if(!this.config.enabled)return;const i=this.dataSources.get(e);if(!i)return;let l,c,d=a;r&&(Array.isArray(r)?(l=r.length,c=r.length>0&&typeof r[0]=="object"?Object.keys(r[0]):void 0):typeof r=="object"&&(Array.isArray(r.data)?(d=d||"data",l=r.data.length,c=r.data.length>0&&typeof r.data[0]=="object"?Object.keys(r.data[0]):void 0):Array.isArray(r.items)?(d=d||"items",l=r.items.length,c=r.items.length>0&&typeof r.items[0]=="object"?Object.keys(r.items[0]):void 0):c=Object.keys(r))),this.dataSources.set(e,{...i,status:"loaded",dataPath:d,itemCount:l,keys:c,lastLoadedAt:Date.now(),error:void 0})}trackDataSourceError(e,r){if(!this.config.enabled)return;const a=this.dataSources.get(e);a&&this.dataSources.set(e,{...a,status:"error",error:r,lastLoadedAt:Date.now()})}untrackDataSource(e){this.dataSources.delete(e)}getDataSources(){return Array.from(this.dataSources.values())}getDataSource(e){return this.dataSources.get(e)}clearDataSources(){this.dataSources.clear()}trackDataPathTransform(e){if(!this.config.enabled)return;let r=this.dataPathTransforms.find(a=>a.dataSourceId===e.dataSourceId);r||(r={dataSourceId:e.dataSourceId,timestamp:Date.now(),transformSteps:[],warnings:[]},this.dataPathTransforms.push(r),this.dataPathTransforms.length>this.maxDataPathTransforms&&this.dataPathTransforms.shift()),r.transformSteps.push({step:e.step,inputPath:e.inputPath,inputValue:this.safeClone(e.inputValue),outputPath:e.outputPath,outputValue:this.safeClone(e.outputValue),config:e.config}),e.warning&&r.warnings.push(e.warning)}setDataPathFinalBinding(e,r){if(!this.config.enabled)return;const a=this.dataPathTransforms.find(i=>i.dataSourceId===e);a&&(a.finalBinding={expression:r.expression,resolvedPath:r.resolvedPath,value:this.safeClone(r.value)})}getDataPathTransformTrackingInfo(){const e=this.getDataPathTransformStats();return{transforms:[...this.dataPathTransforms],stats:e,timestamp:Date.now()}}getDataPathTransformStats(){const e=this.dataPathTransforms,r={};let a=0;const i={};for(const c of e){r[c.dataSourceId]=(r[c.dataSourceId]||0)+1,a+=c.warnings.length;for(const d of c.warnings)i[d]=(i[d]||0)+1}const l=Object.entries(i).map(([c,d])=>({warning:c,count:d})).sort((c,d)=>d.count-c.count).slice(0,10);return{totalTransforms:e.length,byDataSource:r,warningsCount:a,commonWarnings:l}}getDataPathTransformForDataSource(e){return this.dataPathTransforms.find(r=>r.dataSourceId===e)}clearDataPathTransforms(){this.dataPathTransforms=[]}trackNestedContext(e){if(!this.config.enabled)return"";const r=`nested-${++this.nestedContextIdCounter}`,a=[...new Set([...e.parentContext.available,...e.ownContext.added])],i={...e.parentContext.values,...e.ownContext.values},l={id:r,timestamp:Date.now(),componentId:e.componentId,componentType:e.componentType,parentContext:{available:e.parentContext.available,values:this.safeClone(e.parentContext.values)},ownContext:{added:e.ownContext.added,values:this.safeClone(e.ownContext.values)},mergedContext:{all:a,values:this.safeClone(i)},accessAttempts:[],depth:e.depth,parentId:e.parentId};return this.nestedContexts.push(l),this.nestedContexts.length>this.maxNestedContexts&&this.nestedContexts.shift(),r}trackNestedContextAccess(e,r){if(!this.config.enabled)return;const a=this.nestedContexts.find(i=>i.id===e);a&&a.accessAttempts.push({path:r.path,found:r.found,value:r.found?this.safeClone(r.value):void 0,error:r.error})}getNestedContextTrackingInfo(){const e=this.getNestedContextStats();return{contexts:[...this.nestedContexts],stats:e,timestamp:Date.now()}}getNestedContextStats(){const e=this.nestedContexts,r={expandChildren:0,cellChildren:0,iteration:0,modal:0,slot:0};let a=0,i=0;const l={};for(const d of e){r[d.componentType]++,d.depth>a&&(a=d.depth);for(const f of d.accessAttempts)f.found||(i++,l[f.path]=(l[f.path]||0)+1)}const c=Object.entries(l).map(([d,f])=>({path:d,count:f})).sort((d,f)=>f.count-d.count).slice(0,10);return{totalContexts:e.length,byType:r,maxDepth:a,failedAccessCount:i,commonFailedPaths:c}}getNestedContextForComponent(e){return this.nestedContexts.find(r=>r.componentId===e)}clearNestedContexts(){this.nestedContexts=[],this.nestedContextIdCounter=0}trackHandlerRegistration(e,r="custom",a,i){this.isEnabled&&this.handlers.set(e,{name:e,category:r,description:a,registeredAt:Date.now(),source:i})}trackHandlerUnregistration(e){this.isEnabled&&this.handlers.delete(e)}getHandlers(){return Array.from(this.handlers.values())}getHandler(e){return this.handlers.get(e)}getHandlersByCategory(e){return Array.from(this.handlers.values()).filter(r=>r.category===e)}clearHandlers(){this.handlers.clear()}trackEventSubscribe(e){if(!this.isEnabled)return;const r=this.componentEventSubscriptions.get(e),a=Date.now();r?(r.subscriberCount++,r.lastSubscribedAt=a):this.componentEventSubscriptions.set(e,{eventName:e,subscriberCount:1,firstSubscribedAt:a,lastSubscribedAt:a})}trackEventUnsubscribe(e){if(!this.isEnabled)return;const r=this.componentEventSubscriptions.get(e);r&&(r.subscriberCount--,r.subscriberCount<=0&&this.componentEventSubscriptions.delete(e))}trackEventEmit(e,r,a,i,l){if(!this.isEnabled)return;const c={id:`evt_${++this.componentEventIdCounter}`,eventName:e,data:this.sanitizeForLogging(r),timestamp:Date.now(),listenerCount:a,results:i?this.sanitizeForLogging(i):void 0,hasError:!!l,errorMessage:l?.message};this.componentEventEmitHistory.push(c),this.componentEventEmitHistory.length>this.maxComponentEventHistory&&(this.componentEventEmitHistory=this.componentEventEmitHistory.slice(-this.maxComponentEventHistory))}trackEventOff(e){this.isEnabled&&this.componentEventSubscriptions.delete(e)}trackEventClear(){this.isEnabled&&this.componentEventSubscriptions.clear()}getComponentEventInfo(){const e=Array.from(this.componentEventSubscriptions.values());return{subscriptions:e,emitHistory:[...this.componentEventEmitHistory],totalSubscribers:e.reduce((r,a)=>r+a.subscriberCount,0),totalEmits:this.componentEventEmitHistory.length}}getEventEmitHistory(){return[...this.componentEventEmitHistory]}getEventSubscriptions(){return Array.from(this.componentEventSubscriptions.values())}clearComponentEvents(){this.componentEventSubscriptions.clear(),this.componentEventEmitHistory=[],this.componentEventIdCounter=0}sanitizeForLogging(e){if(e==null||typeof e!="object")return e;try{return JSON.parse(JSON.stringify(e))}catch{return"[Circular or Non-serializable]"}}startStateChange(e,r,a,i){if(!this.config.enabled)return"";const l=`setState_${++this.stateRenderingIdCounter}`;this.currentStateChangeContext={setStateId:l,startTime:performance.now(),changedPath:e,trigger:i||{},renderedComponents:[]};const c={id:`sr_${this.stateRenderingIdCounter}`,setStateId:l,statePath:e,oldValue:this.sanitizeForLogging(r),newValue:this.sanitizeForLogging(a),timestamp:Date.now(),triggeredBy:i||{},renderedComponents:[],totalRenderDuration:0,affectedBindingsCount:0};return this.stateRenderingLogs.push(c),this.stateRenderingLogs.length>this.maxStateRenderingLogs&&this.stateRenderingLogs.shift(),l}trackComponentRender(e,r,a,i=[],l=[],c){if(!this.config.enabled)return;const d=this.componentRenderCounts.get(r)||0;this.componentRenderCounts.set(r,d+1);for(const f of i)this.stateToComponentMap.has(f)||this.stateToComponentMap.set(f,new Set),this.stateToComponentMap.get(f).add(r);if(this.currentStateChangeContext){const f={componentId:e,componentName:r,renderDuration:a,accessedStatePaths:i,evaluatedBindings:l,renderOrder:this.currentStateChangeContext.renderedComponents.length,parentId:c};this.currentStateChangeContext.renderedComponents.push(f)}this.trackRender(r)}completeStateChange(e){if(!this.config.enabled||!this.currentStateChangeContext||this.currentStateChangeContext.setStateId!==e)return;const r=this.currentStateChangeContext,i=performance.now()-r.startTime,l=this.stateRenderingLogs.findIndex(c=>c.setStateId===e);if(l>=0){const c=this.stateRenderingLogs[l];c.renderedComponents=r.renderedComponents,c.totalRenderDuration=i,c.affectedBindingsCount=r.renderedComponents.reduce((d,f)=>d+f.evaluatedBindings.length,0)}this.currentStateChangeContext=null}getCurrentStateChangeContext(){return this.currentStateChangeContext}getStateRenderingLogs(){return[...this.stateRenderingLogs]}getStateRenderingInfo(){const e=this.stateRenderingLogs,r=Object.fromEntries(this.componentRenderCounts),a={};for(const[i,l]of this.stateToComponentMap)a[i]=Array.from(l);return{logs:e,componentRenderCounts:r,stateToComponentMap:a,stats:this.calculateStateRenderingStats()}}calculateStateRenderingStats(){const e=this.stateRenderingLogs;if(e.length===0)return{totalStateChanges:0,totalRenders:0,avgRenderDuration:0,avgComponentsPerChange:0,topRenderedComponents:[],topInfluentialPaths:[]};const r=e.reduce((d,f)=>d+f.renderedComponents.length,0),a=e.reduce((d,f)=>d+f.totalRenderDuration,0)/e.length,i=r/e.length,l=Array.from(this.componentRenderCounts.entries()).sort((d,f)=>f[1]-d[1]).slice(0,5).map(([d,f])=>({name:d,count:f})),c=Array.from(this.stateToComponentMap.entries()).sort((d,f)=>f[1].size-d[1].size).slice(0,5).map(([d,f])=>({path:d,affectedComponents:f.size}));return{totalStateChanges:e.length,totalRenders:r,avgRenderDuration:a,avgComponentsPerChange:i,topRenderedComponents:l,topInfluentialPaths:c}}getComponentsAffectedByState(e){const r=this.stateToComponentMap.get(e);return r?Array.from(r):[]}getComponentRenderHistory(e){return this.stateRenderingLogs.filter(r=>r.renderedComponents.some(a=>a.componentName===e))}clearStateRenderingLogs(){this.stateRenderingLogs=[],this.componentRenderCounts.clear(),this.stateToComponentMap.clear(),this.currentStateChangeContext=null,this.stateRenderingIdCounter=0}trackComponentStateSource(e,r,a,i){this.config.enabled&&this.componentStateSources.set(e,{componentId:e,componentName:r,stateSource:a,stateProvider:i})}trackDynamicState(e,r){this.config.enabled&&this.dynamicStates.set(e,r)}trackContextFlow(e,r,a,i,l,c){if(!this.config.enabled)return;const d={component:r,componentId:e,contextReceived:a,passedToChildren:i,usedInRender:l};if(this.contextFlowNodes.set(e,d),c){const f=this.contextFlowNodes.get(c);f&&(f.children||(f.children=[]),f.children.push(d))}}getStateHierarchyInfo(e=!0){const r=this.buildStateHierarchyLayers(),a=this.detectStateConflicts(r),i=Array.from(this.componentStateSources.values());return{layers:e?r.map(c=>({...c,values:this.summarizeValues(c.values,2)})):r,conflicts:a,componentStateSources:i,timestamp:Date.now()}}summarizeValues(e,r,a=0){if(e==null)return e;if(typeof e!="object")return typeof e=="string"&&e.length>100?e.substring(0,100)+`... (${e.length}자)`:e;if(a>=r){if(Array.isArray(e))return`[Array(${e.length})]`;const c=Object.keys(e);return`{${c.slice(0,5).join(", ")}${c.length>5?`, ... +${c.length-5}`:""}}`}if(Array.isArray(e))return e.length<=3?e.map(c=>this.summarizeValues(c,r,a+1)):{__type:"array",__length:e.length,__preview:e.slice(0,3).map(c=>this.summarizeValues(c,r,a+1))};const i={},l=Object.keys(e);for(const c of l)i[c]=this.summarizeValues(e[c],r,a+1);return i}buildStateHierarchyLayers(){const e=[];try{const a=window.G7Core?.state?.get?.();if(!a)return e;a._local&&e.push({name:"Global _local",type:"global",path:"_local",values:a._local,priority:1}),a._global&&e.push({name:"Global _global",type:"global",path:"_global",values:a._global,priority:1});for(const[l,c]of this.dynamicStates)c&&Object.keys(c).length>0&&e.push({name:`DynamicState (${l})`,type:"dynamicState",componentId:l,values:c,priority:2});const i=this.computeEffectiveState(a._local||{});e.push({name:"Effective _local (merged)",type:"effective",values:i,priority:3})}catch(r){console.warn("[G7DevTools] 상태 계층 빌드 실패:",r)}return e}computeEffectiveState(e){const r={...e};for(const[,a]of this.dynamicStates)a._local&&Object.assign(r,a._local);return r}detectStateConflicts(e){const r=[],a=e.find(l=>l.type==="global"&&l.path==="_local");if(!a)return r;const i=e.filter(l=>l.type==="dynamicState");for(const l of i){const c=l.values._local||l.values;for(const[d,f]of Object.entries(c)){const g=a.values[d];if(JSON.stringify(g)!==JSON.stringify(f)){const m=[],y=[];for(const w of this.componentStateSources.values())w.stateSource.local.some(v=>v===`_local.${d}`||v===d)&&(w.stateProvider.type==="dynamicState"?m.push(w.componentName):w.stateProvider.type==="globalState"&&y.push(w.componentName));r.push({path:`_local.${d}`,globalValue:g,dynamicStateValue:f,effectiveValue:f,usedBy:m,notUsedBy:y,severity:y.length>0?"warning":"info",description:y.length>0?`${y.join(", ")}은(는) globalState._local을 읽어 dynamicState 값을 사용하지 못함`:"dynamicState 값이 globalState와 다르지만 모든 컴포넌트가 dynamicState를 사용"})}}}return r}getContextFlowInfo(){const e=[],r=new Set(this.contextFlowNodes.keys());for(const a of this.contextFlowNodes.values())if(a.children)for(const i of a.children)r.delete(i.componentId);for(const a of r){const i=this.contextFlowNodes.get(a);i&&e.push(i)}return{rootComponent:e.length>0?e[0].component:"Unknown",contextFlow:e,timestamp:Date.now()}}clearStateHierarchyData(){this.componentStateSources.clear(),this.contextFlowNodes.clear(),this.dynamicStates.clear()}trackComponentStyle(e,r,a,i){if(!this.config.enabled)return;const l=this.analyzeTailwindClasses(a),c={componentId:e,componentName:r,classes:a,computedStyles:i,tailwindAnalysis:l};this.componentStyles.set(e,c),this.detectStyleIssues(c)}analyzeTailwindClasses(e){const r=[],a=[],i=[],l=[],c=["sm:","md:","lg:","xl:","2xl:"],d=[/bg-\w+-\d+/,/text-\w+-\d+/,/border-\w+-\d+/];for(const f of e){l.push(f),f.startsWith("dark:")&&r.push(f);for(const g of c)if(f.startsWith(g)){a.push(f);break}for(const g of d)if(g.test(f)){i.push(f);break}}return{usedClasses:l,darkClasses:r,responsiveClasses:a,dynamicClasses:i}}detectStyleIssues(e){const{componentId:r,componentName:a,computedStyles:i,tailwindAnalysis:l}=e;(i.opacity==="0"||i.visibility==="hidden"||i.display==="none"||i.width==="0px"&&i.height==="0px")&&this.addStyleIssue({id:this.generateId(),type:"invisible-element",componentId:r,componentName:a,property:i.opacity==="0"?"opacity":i.visibility==="hidden"?"visibility":i.display==="none"?"display":"width/height",currentValue:i.opacity==="0"?"0":i.visibility==="hidden"?"hidden":i.display==="none"?"none":"0px",severity:"warning",description:"요소가 화면에 보이지 않습니다.",suggestion:"opacity, visibility, display, width/height 값을 확인하세요."});const c=l.usedClasses.filter(f=>f.startsWith("bg-")&&!f.startsWith("dark:")),d=l.darkClasses.filter(f=>f.includes("bg-"));c.length>0&&d.length===0&&this.addStyleIssue({id:this.generateId(),type:"dark-mode-missing",componentId:r,componentName:a,property:"background-color",currentValue:c.join(", "),expectedValue:"dark:bg-* 클래스 필요",severity:"info",description:"다크 모드 배경색 클래스가 누락되었습니다.",suggestion:`${c[0]}에 대응하는 dark: 클래스를 추가하세요.`}),l.dynamicClasses.length>0&&this.addStyleIssue({id:this.generateId(),type:"tailwind-purging",componentId:r,componentName:a,property:"class",currentValue:l.dynamicClasses.join(", "),severity:"info",description:"동적으로 생성된 Tailwind 클래스가 있습니다.",suggestion:"tailwind.config.js의 safelist에 추가하거나 전체 클래스명을 상수로 정의하세요."})}addStyleIssue(e){this.styleIssues.some(a=>a.componentId===e.componentId&&a.type===e.type&&a.property===e.property)||this.styleIssues.push(e)}getStyleValidationInfo(){const e=Array.from(this.componentStyles.values());return{issues:[...this.styleIssues],componentStyles:e,stats:{totalComponents:e.length,invisibleCount:this.styleIssues.filter(r=>r.type==="invisible-element").length,tailwindIssueCount:this.styleIssues.filter(r=>r.type==="tailwind-purging").length,darkModeIssueCount:this.styleIssues.filter(r=>r.type==="dark-mode-missing").length},timestamp:Date.now()}}clearStyleValidationData(){this.styleIssues=[],this.componentStyles.clear()}trackAuthEvent(e,r,a,i){if(!this.config.enabled)return;const l={id:`auth_${++this.authEventIdCounter}`,type:e,timestamp:Date.now(),success:r,error:a,details:i};this.authEvents.push(l),this.authEvents.length>this.maxAuthEventHistory&&(this.authEvents=this.authEvents.slice(-this.maxAuthEventHistory))}trackAuthHeader(e,r,a,i,l){if(!this.config.enabled)return;const c={url:e,hasAuthHeader:r,headerType:a,tokenValid:i??!1,responseStatus:l,timestamp:Date.now()};this.authHeaderHistory.push(c),this.authHeaderHistory.length>this.maxAuthEventHistory&&(this.authHeaderHistory=this.authHeaderHistory.slice(-this.maxAuthEventHistory)),l===401&&this.trackAuthEvent("api-unauthorized",!1,`401 Unauthorized: ${e}`,{url:e})}getAuthState(){try{const e=window.G7Core,r=e?.api;let a=e?.auth;!a&&e?.AuthManager?.getInstance&&(a=e.AuthManager.getInstance());const i=r?.getToken?.()||a?.getAccessToken?.()||localStorage.getItem("auth_token")||localStorage.getItem("access_token"),l=a?.getRefreshToken?.()||localStorage.getItem("refresh_token");let c="unknown",d=a?.getUser?.();if(d&&(c="AuthManager"),!d){const S=e?.state?.get?.();d=S?._global?.user||S?._global?.currentUser||S?.user||S?.currentUser,d&&(c="G7Core.state")}const f=a?.isAuthenticated?.()??!1;let g="memory";localStorage.getItem("auth_token")||localStorage.getItem("access_token")?g="localStorage":(sessionStorage.getItem("auth_token")||sessionStorage.getItem("access_token"))&&(g="sessionStorage");const m=!!i&&(!!d||f);let y;i&&typeof i=="string"&&i.length>20?y=`${i.substring(0,10)}...${i.substring(i.length-6)}`:i&&(y="***");const w=d?{id:d.id,email:d.email,name:d.name,roles:d.roles?.map(S=>typeof S=="string"?{name:S}:{id:S.id,name:S.name,guard_name:S.guard_name}),permissions:d.permissions?.map(S=>typeof S=="string"?{name:S}:{id:S.id,name:S.name,guard_name:S.guard_name}),avatar:d.avatar||d.profile_photo_url||d.profile_image,created_at:d.created_at,updated_at:d.updated_at,last_login_at:d.last_login_at,email_verified_at:d.email_verified_at,...d.phone&&{phone:d.phone},...d.nickname&&{nickname:d.nickname},...d.status&&{status:d.status},...d.locale&&{locale:d.locale}}:void 0;return{isAuthenticated:m,user:w,tokens:{hasAccessToken:!!i,hasRefreshToken:!!l,storage:g,accessTokenPreview:y},lastActivity:Date.now(),source:c}}catch{return{isAuthenticated:!1,tokens:{hasAccessToken:!1,hasRefreshToken:!1,storage:"memory"},source:"unknown"}}}getAuthDebugInfo(){const e=[...this.authEvents];return{state:this.getAuthState(),events:e,headerAnalysis:[...this.authHeaderHistory],stats:{loginAttempts:e.filter(r=>r.type==="login").length,successfulLogins:e.filter(r=>r.type==="login"&&r.success).length,failedLogins:e.filter(r=>r.type==="login"&&!r.success).length,tokenRefreshes:e.filter(r=>r.type==="token-refresh").length,unauthorizedResponses:e.filter(r=>r.type==="api-unauthorized").length},timestamp:Date.now()}}clearAuthData(){this.authEvents=[],this.authHeaderHistory=[],this.authEventIdCounter=0}trackLayoutLoad(e,r,a,i="api"){if(!this.config.enabled)return;const l=Date.now();this.currentLayout={layoutPath:e,templateId:r,layoutJson:this.sanitizeObject(a),loadedAt:l,version:a.version,layoutName:a.layout_name,source:i};const c={id:`layout-${++this.layoutIdCounter}`,layoutPath:e,templateId:r,loadedAt:l,source:i,version:a.version};this.layoutHistory.push(c),this.layoutHistory.length>this.maxLayoutHistory&&this.layoutHistory.shift(),this.layoutStats.totalLoads++,i==="cache"?this.layoutStats.cacheHits++:this.layoutStats.apiLoads++}getCurrentLayout(){return this.currentLayout}getLayoutHistory(){return[...this.layoutHistory]}getLayoutDebugInfo(){return{current:this.currentLayout,history:[...this.layoutHistory],stats:{...this.layoutStats}}}clearLayoutData(){this.currentLayout=null,this.layoutHistory=[],this.layoutIdCounter=0,this.layoutStats={totalLoads:0,cacheHits:0,apiLoads:0}}startHandlerExecution(e){if(!this.config.enabled)return"";const r=`exec_${++this.executionIdCounter}_${Date.now()}`,a={handlerName:e,executionId:r,startTime:Date.now(),stateChanges:[],dataSourceChanges:[],alerts:[]};if(this.executionDetails.set(r,a),this.executionDetails.size>this.maxExecutionDetails){const i=Array.from(this.executionDetails.keys());i.slice(0,i.length-this.maxExecutionDetails).forEach(c=>this.executionDetails.delete(c))}return r}endHandlerExecution(e,r,a,i){if(!this.config.enabled||!e)return;const l=this.executionDetails.get(e);if(!l)return;l.endTime=Date.now(),l.duration=l.endTime-l.startTime,l.exitReason=r,l.exitLocation=a,l.exitDescription=i;const c=this.changeExpectations.get(e);c&&(l.expectedChanges=c,this.checkExpectations(e,l,c),this.changeExpectations.delete(e)),r==="normal"&&l.stateChanges.length===0&&l.dataSourceChanges.length===0&&this.addChangeAlert(e,{type:"no-state-change",severity:"warning",message:`핸들러 "${l.handlerName}"이(가) 상태 변경 없이 완료됨`,description:"핸들러가 성공적으로 완료되었지만 상태나 데이터소스 변경이 없습니다. 의도한 동작인지 확인하세요.",handlerName:l.handlerName,suggestion:'핸들러 내부 조건문을 확인하거나 DevTools의 "변경감지" 탭에서 exitLocation을 확인하세요.',docLink:"troubleshooting-state.md"}),(r==="early-return-condition"||r==="early-return-validation")&&this.addChangeAlert(e,{type:"early-return-detected",severity:"info",message:`핸들러 "${l.handlerName}"이(가) early return으로 종료됨`,description:i||`종료 위치: ${a||"알 수 없음"}`,handlerName:l.handlerName,suggestion:r==="early-return-validation"?"검증 실패로 인한 early return입니다. 입력 데이터를 확인하세요.":"조건부 early return입니다. 조건문의 평가 결과를 확인하세요."})}recordExitReason(e,r,a,i){if(!this.config.enabled||!e)return;const l=this.executionDetails.get(e);l&&(l.exitReason=r,l.exitLocation=a,l.exitDescription=i)}recordStateChange(e,r,a,i,l){if(!this.config.enabled)return;const c={id:`sc_${++this.stateChangeIdCounter}`,path:r,changeType:a,oldValue:this.safeClone(i),newValue:this.safeClone(l),timestamp:Date.now(),comparison:this.compareValues(i,l),executionId:e};if(this.stateChangeHistory.push(c),e){const d=this.executionDetails.get(e);d&&d.stateChanges.push(c)}this.stateChangeHistory.length>this.maxStateChangeHistory&&this.stateChangeHistory.splice(0,this.stateChangeHistory.length-this.maxStateChangeHistory),c.comparison.isDeepEqual&&typeof i=="object"&&i!==null&&this.addChangeAlert(e||"",{type:"object-reference-same",severity:"warning",message:`상태 "${r}"가 변경되었으나 값이 동일함`,description:"객체 참조가 동일하거나 깊은 비교 결과 변경이 없습니다. 변경 감지가 실패할 수 있습니다.",handlerName:e&&this.executionDetails.get(e)?.handlerName||"unknown",statePath:r,suggestion:"불변성을 유지하여 새 객체를 생성하세요. 예: { ...oldObject, newField: value }",docLink:"troubleshooting-state.md#object-mutation"})}recordDataSourceChange(e,r,a,i,l){if(!this.config.enabled)return;const c={dataSourceId:r,changeType:a,timestamp:Date.now(),previousStatus:i,newStatus:l,executionId:e};if(this.dataSourceChangeHistory.push(c),e){const d=this.executionDetails.get(e);d&&d.dataSourceChanges.push(c)}this.dataSourceChangeHistory.length>this.maxStateChangeHistory&&this.dataSourceChangeHistory.splice(0,this.dataSourceChangeHistory.length-this.maxStateChangeHistory)}expectChange(e,r,a){if(!this.config.enabled||!e)return;const i=this.executionDetails.get(e);if(!i)return;const l={expectedStatePaths:r,expectedDataSources:a,setAt:Date.now(),source:i.handlerName};this.changeExpectations.set(e,l)}checkExpectations(e,r,a){const i=new Set(r.stateChanges.map(c=>c.path)),l=new Set(r.dataSourceChanges.map(c=>c.dataSourceId));for(const c of a.expectedStatePaths)i.has(c)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 상태 변경 "${c}"가 발생하지 않음`,description:`핸들러 "${r.handlerName}"이(가) "${c}" 변경을 예고했지만 실제로 변경되지 않았습니다.`,handlerName:r.handlerName,statePath:c,suggestion:"핸들러 내부 로직을 확인하세요. early return이나 조건부 분기로 인해 변경이 생략되었을 수 있습니다.",docLink:"troubleshooting-state.md"});for(const c of a.expectedDataSources)l.has(c)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 데이터소스 갱신 "${c}"가 발생하지 않음`,description:`핸들러 "${r.handlerName}"이(가) "${c}" 갱신을 예고했지만 실제로 갱신되지 않았습니다.`,handlerName:r.handlerName,dataSourceId:c,suggestion:"refetchDataSource 호출이 실행되었는지 확인하세요.",docLink:"data-sources.md"})}addChangeAlert(e,r){const a={...r,id:`alert_${++this.alertIdCounter}`,timestamp:Date.now()};if(this.changeAlerts.push(a),e){const i=this.executionDetails.get(e);i&&i.alerts.push(a)}this.changeAlerts.length>this.maxChangeAlerts&&this.changeAlerts.splice(0,this.changeAlerts.length-this.maxChangeAlerts)}compareValues(e,r){const a=this.getValueType(e),i=this.getValueType(r),l=a!==i;let c=!1,d;return!l&&(a==="object"||a==="array")?(c=this.deepEqual(e,r),!c&&a==="object"&&(d=this.getChangedKeys(e,r))):c=e===r,{typeChanged:l,oldType:a,newType:i,isDeepEqual:c,changedKeys:d}}getValueType(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}deepEqual(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(e===null||r===null||typeof e!="object")return e===r;if(Array.isArray(e)!==Array.isArray(r))return!1;const a=Object.keys(e),i=Object.keys(r);if(a.length!==i.length)return!1;for(const l of a)if(!i.includes(l)||!this.deepEqual(e[l],r[l]))return!1;return!0}getChangedKeys(e,r){const a=[],i=new Set([...Object.keys(e),...Object.keys(r)]);for(const l of i)this.deepEqual(e[l],r[l])||a.push(l);return a}getChangeDetectionInfo(){const e=Array.from(this.executionDetails.values()),r={totalExecutions:e.length,executionsWithStateChange:e.filter(a=>a.stateChanges.length>0).length,executionsWithoutStateChange:e.filter(a=>a.stateChanges.length===0&&a.exitReason==="normal").length,earlyReturnCount:e.filter(a=>a.exitReason==="early-return-condition"||a.exitReason==="early-return-validation").length,alertCount:this.changeAlerts.length,alertsByType:this.getAlertsByType()};return{executionDetails:e,stateChangeHistory:[...this.stateChangeHistory],dataSourceChangeHistory:[...this.dataSourceChangeHistory],alerts:[...this.changeAlerts],stats:r,timestamp:Date.now()}}getAlertsByType(){const e={"no-state-change":0,"no-datasource-change":0,"expected-not-fulfilled":0,"object-reference-same":0,"early-return-detected":0,"async-timing-issue":0};for(const r of this.changeAlerts)e[r.type]++;return e}clearChangeDetectionData(){this.executionDetails.clear(),this.stateChangeHistory=[],this.dataSourceChangeHistory=[],this.changeAlerts=[],this.changeExpectations.clear(),this.executionIdCounter=0,this.stateChangeIdCounter=0,this.alertIdCounter=0}getRecentAlerts(e=10,r){let a=[...this.changeAlerts];return r&&(a=a.filter(i=>i.severity===r)),a.slice(-e)}getHandlerExecutions(e,r=10){return Array.from(this.executionDetails.values()).filter(i=>i.handlerName===e).slice(-r)}findExecutionInStack(e){return this.sequenceExecutionStack.find(r=>r.sequenceId===e)}startSequenceExecution(e){if(!this.config.enabled)return"";const r=`seq_${++this.sequenceIdCounter}_${Date.now()}`,a={sequenceId:r,startTime:Date.now(),totalDuration:0,trigger:e,actions:[],status:"running"};return this.sequenceExecutionStack.push(a),r}captureSequenceActionBefore(e,r,a,i,l){if(!this.config.enabled)return;const c=this.findExecutionInStack(e);if(!c)return;const d={index:r,handler:a,params:this.safeClone(i),stateBeforeAction:{_global:this.safeClone(l._global),_local:this.safeClone(l._local),_isolated:l._isolated?this.safeClone(l._isolated):void 0},stateAfterAction:{_global:{},_local:{}},duration:0,status:"success"};c.actions.push(d)}captureSequenceActionAfter(e,r,a,i,l,c){if(!this.config.enabled)return;const d=this.findExecutionInStack(e);if(!d)return;const f=d.actions.find(m=>m.index===r);if(!f)return;f.stateAfterAction={_global:this.safeClone(a._global),_local:this.safeClone(a._local),_isolated:a._isolated?this.safeClone(a._isolated):void 0},f.duration=i,f.result=this.safeClone(l),f.stateDiff={global:this.computeStateDiff(f.stateBeforeAction._global,f.stateAfterAction._global),local:this.computeStateDiff(f.stateBeforeAction._local,f.stateAfterAction._local)},f.stateBeforeAction._isolated&&f.stateAfterAction._isolated&&(f.stateDiff.isolated=this.computeStateDiff(f.stateBeforeAction._isolated,f.stateAfterAction._isolated));const g=window.__g7PendingLocalState;g&&(f.pendingState=this.safeClone(g)),c&&(f.status="error",f.error={name:c.name,message:c.message,stack:c.stack})}endSequenceExecution(e,r){if(!this.config.enabled)return;const a=this.sequenceExecutionStack.findIndex(l=>l.sequenceId===e);if(a===-1)return;const i=this.sequenceExecutionStack[a];if(i.endTime=Date.now(),i.totalDuration=i.endTime-i.startTime,r){i.status="error",i.error={name:r.name,message:r.message,stack:r.stack};const l=i.actions.find(c=>c.status==="error");l&&(i.failedAtIndex=l.index)}else i.status="success";this.sequenceExecutions.push(i),this.sequenceExecutions.length>this.maxSequenceExecutions&&this.sequenceExecutions.shift(),this.sequenceExecutionStack.splice(a,1)}computeStateDiff(e,r){const a=[],i=[],l=[],c=new Set(Object.keys(e)),d=new Set(Object.keys(r));for(const f of d)c.has(f)||a.push(f);for(const f of c)d.has(f)||i.push(f);for(const f of c)if(d.has(f)){const g=e[f],m=r[f];JSON.stringify(g)!==JSON.stringify(m)&&l.push({path:f,oldValue:g,newValue:m})}return{added:a,removed:i,changed:l}}getSequenceTrackingInfo(){const e=this.getSequenceStats(),r=this.sequenceExecutionStack.length>0?this.sequenceExecutionStack[this.sequenceExecutionStack.length-1]:void 0;return{executions:[...this.sequenceExecutions],currentExecution:r,stats:e}}getSequenceStats(){const e=this.sequenceExecutions,r=e.length,a=e.filter(g=>g.status==="success").length,i=e.filter(g=>g.status==="error").length,l=e.reduce((g,m)=>g+m.actions.length,0),c=r>0?e.reduce((g,m)=>g+m.totalDuration,0)/r:0,d={};for(const g of e)for(const m of g.actions)d[m.handler]=(d[m.handler]||0)+1;const f=Object.entries(d).sort(([,g],[,m])=>m-g).slice(0,5).map(([g,m])=>({handler:g,count:m}));return{totalExecutions:r,successCount:a,errorCount:i,totalActions:l,avgDuration:c,topHandlers:f}}clearSequenceData(){this.sequenceExecutions=[],this.sequenceExecutionStack=[],this.sequenceIdCounter=0}getSequenceExecution(e){const r=this.findExecutionInStack(e);return r||this.sequenceExecutions.find(a=>a.sequenceId===e)}getRecentSequences(e=10){return this.sequenceExecutions.slice(-e)}registerStateCaptureForHandler(e,r,a){if(!this.config.enabled)return;const i=new Map,l=Date.now();for(const c of r)i.set(c,{value:this.safeClone(a[c]),capturedAt:l});this.stateCaptureRegistry.set(e,i)}detectStaleClosure(e,r,a,i,l){if(!this.config.enabled)return[];const c=this.stateCaptureRegistry.get(e);if(!c)return[];const d=Date.now(),f=[];for(const[g,m]of c){const y=this.getValueByPath(a,g),w=d-m.capturedAt;if(!this.isDeepEqual(m.value,y)&&w>0){const S=this.createStaleClosureWarning(i,r,g,m.value,m.capturedAt,y,d,w,l);f.push(S),this.addStaleClosureWarning(S)}}return this.stateCaptureRegistry.delete(e),f}trackStaleClosureWarning(e){if(!this.config.enabled)return;const r=Date.now(),a=this.createStaleClosureWarning(e.type,e.location,e.capturedPath,e.capturedValue,e.capturedAt,e.currentValue,r,r-e.capturedAt,e.actionId,e.stackTrace);this.addStaleClosureWarning(a)}createStaleClosureWarning(e,r,a,i,l,c,d,f,g,m){const y=this.getStaleClosureSeverity(e,f),{description:w,suggestion:S,docLink:v}=this.getStaleClosureMessages(e,a,f);return{id:`stale_${++this.staleClosureIdCounter}_${Date.now()}`,timestamp:Date.now(),type:e,location:r,capturedState:{path:a,capturedValue:this.safeClone(i),capturedAt:l},currentState:{path:a,currentValue:this.safeClone(c),retrievedAt:d},timeDiff:f,severity:y,description:w,suggestion:S,docLink:v,actionId:g,stackTrace:m}}getStaleClosureSeverity(e,r){if(r>5e3)return"error";if(r>1e3)return"warning";switch(e){case"async-state-capture":case"sequence-state-mismatch":return"warning";case"callback-state-capture":case"timeout-state-capture":return"info";case"event-handler-stale":return"warning";default:return"info"}}getStaleClosureMessages(e,r,a){const i=a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`;switch(e){case"async-state-capture":return{description:`await 후 ${i} 경과 시점에 '${r}' 상태가 변경됨. 캡처된 상태 대신 최신 상태를 사용해야 함`,suggestion:"await 이후에는 G7Core.state.get()으로 최신 상태를 다시 조회하거나, useRef + getter 패턴을 사용하세요",docLink:"troubleshooting-state-closure.md"};case"callback-state-capture":return{description:`콜백에서 ${i} 전에 캡처된 '${r}' 상태를 사용 중. 최신 상태와 다름`,suggestion:"콜백에서 상태를 참조할 때는 stateRef.current 패턴 또는 G7Core.state.get()를 사용하세요",docLink:"troubleshooting-state-closure.md"};case"timeout-state-capture":return{description:`setTimeout/setInterval 콜백에서 '${r}' 상태가 ${i} 전 값 사용 중`,suggestion:"타이머 콜백 내에서는 G7Core.state.get()으로 최신 상태를 조회하세요",docLink:"troubleshooting-state-closure.md"};case"sequence-state-mismatch":return{description:`sequence 내 '${r}' 상태가 이전 액션 결과와 불일치. context.state 대신 캡처된 값 사용 의심`,suggestion:"sequence 내에서는 context.state 또는 $prev를 사용하여 최신 상태를 참조하세요",docLink:"troubleshooting-state-setstate.md"};case"event-handler-stale":return{description:`이벤트 핸들러에서 ${i} 전에 바인딩된 '${r}' 상태 사용 중`,suggestion:"이벤트 핸들러에서 상태를 참조할 때는 useRef 패턴 또는 G7Core.state.get()를 사용하세요",docLink:"troubleshooting-state-closure.md"};default:return{description:`'${r}' 상태에서 stale closure 감지됨 (${i} 경과)`,suggestion:"상태 참조 시 최신 값을 사용하는지 확인하세요"}}}addStaleClosureWarning(e){this.staleClosureWarnings.push(e),this.staleClosureWarnings.length>this.maxStaleClosureWarnings&&this.staleClosureWarnings.shift()}getValueByPath(e,r){const a=r.split(".");let i=e;for(const l of a){if(i==null)return;i=i[l]}return i}isDeepEqual(e,r){if(e===r)return!0;if(e===null||r===null)return e===r;if(typeof e!=typeof r)return!1;if(typeof e!="object")return e===r;try{return JSON.stringify(e)===JSON.stringify(r)}catch{return!1}}getStaleClosureTrackingInfo(){const e=this.getStaleClosureStats();return{warnings:[...this.staleClosureWarnings],stats:e,timestamp:Date.now()}}getStaleClosureStats(){const e=this.staleClosureWarnings,r={"async-state-capture":0,"callback-state-capture":0,"timeout-state-capture":0,"sequence-state-mismatch":0,"event-handler-stale":0};for(const f of e)r[f.type]++;const a={info:0,warning:0,error:0};for(const f of e)a[f.severity]++;const i={};for(const f of e)i[f.location]=(i[f.location]||0)+1;const l=Object.entries(i).sort(([,f],[,g])=>g-f).slice(0,5).map(([f,g])=>({location:f,count:g})),c={};for(const f of e)c[f.capturedState.path]=(c[f.capturedState.path]||0)+1;const d=Object.entries(c).sort(([,f],[,g])=>g-f).slice(0,5).map(([f,g])=>({path:f,count:g}));return{totalWarnings:e.length,warningsByType:r,warningsBySeverity:a,topLocations:l,topAffectedPaths:d}}clearStaleClosureData(){this.staleClosureWarnings=[],this.staleClosureIdCounter=0,this.stateCaptureRegistry.clear()}getRecentStaleClosureWarnings(e=10,r){let a=[...this.staleClosureWarnings];return r&&(a=a.filter(i=>i.severity===r)),a.slice(-e)}safeClone(e){if(e==null||typeof e!="object")return e;try{return JSON.parse(JSON.stringify(e))}catch{if(Array.isArray(e))return e.map(a=>{try{return JSON.parse(JSON.stringify(a))}catch{return"[Unserializable]"}});const r={};for(const a of Object.keys(e))try{r[a]=JSON.parse(JSON.stringify(e[a]))}catch{r[a]="[Unserializable]"}return r}}};$(Ei,"instance");let Ma=Ei;const Fn=ut("LayoutLoader");class Er extends Error{constructor(e,r,a){super(e),this.code=r,this.details=a,this.name="LayoutLoaderError"}}class of{constructor(e){$(this,"componentRegistry");$(this,"currentLayout",null);$(this,"layoutCache",new Map);$(this,"cacheVersion",0);this.componentRegistry=e}setCacheVersion(e){this.cacheVersion!==e&&(Fn.log("Cache version updated:",this.cacheVersion,"->",e),this.cacheVersion=e,this.layoutCache.clear())}getCacheVersion(){return this.cacheVersion}async loadLayout(e,r){const a=`${e}:${r}`;if(this.layoutCache.has(a)){Fn.log("Loading layout from cache:",r);const l=await this.layoutCache.get(a),c=JSON.parse(JSON.stringify(l));return this.currentLayout=c,Ma.getInstance().trackLayoutLoad(r,e,c,"cache"),c}const i=this.fetchLayout(e,r);return this.layoutCache.set(a,i),i.catch(()=>{this.layoutCache.get(a)===i&&this.layoutCache.delete(a)}),i}async fetchLayout(e,r,a=!1){try{const i=this.cacheVersion>0?this.cacheVersion:null;let l;if(r.startsWith("__preview__/")){const w=r.replace("__preview__/","");l=Nr(`/api/layouts/preview/${w}`,"json",i)}else l=Nr(`/api/layouts/${e}/${r}`,"json",i);Fn.log("Fetching layout from API:",l);const c=jr(),d=a?null:c.getToken(),f={Accept:"application/json"};d&&(f.Authorization=`Bearer ${d}`);const g=await Bl(l,{init:{headers:f},label:`layout: ${r}`});let m;try{m=await g.json()}catch{m=null}if(!g.ok){if(g.status===401&&!a&&d){Fn.log("Token invalid, removing and retrying without token"),c.removeToken();try{return await this.fetchLayout(e,r,!0)}catch(S){throw S instanceof Er&&S.details?.status===401?new Er(S.message,S.code,{...S.details,hadToken:!0}):S}}const w=m?.message||m?.error;throw new Er(`Failed to fetch layout: ${g.status} ${g.statusText}`,"FETCH_FAILED",{status:g.status,statusText:g.statusText,url:l,apiMessage:w})}const y=m.data||m;return this.validateLayoutData(y),this.currentLayout=y,Ma.getInstance().trackLayoutLoad(r,e,y,"api"),Fn.log("Layout fetched and cached successfully:",y.layout_name),y}catch(i){const l=`${e}:${r}`;throw this.layoutCache.delete(l),i instanceof Er?i:new Er("Failed to load layout","LOAD_FAILED",{originalError:i})}}prefetchLayout(e,r){return this.loadLayout(e,r)}validateLayoutData(e){if(!e.version)throw new Er("Layout data missing required field: version","VALIDATION_FAILED",{field:"version"});if(!e.layout_name)throw new Er("Layout data missing required field: layout_name","VALIDATION_FAILED",{field:"layout_name"});if(!Array.isArray(e.components))throw new Er('Layout data field "components" must be an array',"VALIDATION_FAILED",{field:"components",value:e.components});Fn.log("Layout data validation passed")}renderLayout(e,r){try{const a=r||this.currentLayout;if(!a)throw new Er("No layout data to render","NO_LAYOUT_DATA");Fn.log("Rendering layout:",a.layout_name),e.innerHTML="",this.renderComponents(e,a.components),Fn.log("Layout rendered successfully")}catch(a){Fn.error("Render error:",a),this.renderErrorState(e,a)}}renderComponents(e,r){for(const a of r){const i=this.renderComponent(a);i&&e.appendChild(i)}}renderComponent(e){try{if(!this.componentRegistry.getComponent(e.type))return Fn.warn(`Component not found: ${e.type}`),this.createPlaceholderElement(e.type);const a=document.createElement("div");return a.setAttribute("data-component",e.type),e.props&&Object.entries(e.props).forEach(([i,l])=>{a.setAttribute(`data-prop-${i}`,JSON.stringify(l))}),e.children&&e.children.length>0?this.renderComponents(a,e.children):e.text&&(a.textContent=e.text),a}catch(r){return Fn.error(`Error rendering component ${e.type}:`,r),this.createErrorElement(e.type,r)}}createPlaceholderElement(e){const r=document.createElement("div");return r.className="component-placeholder",r.setAttribute("data-component-type",e),r.innerHTML=`
<div style="padding: 1rem; border: 2px dashed #ccc; background: #f9f9f9; text-align: center;">
<p style="margin: 0; color: #666;">Component not found: <strong>${e}</strong></p>
</div>
`,r}createErrorElement(e,r){const a=document.createElement("div");return a.className="component-error",a.setAttribute("data-component-type",e),a.innerHTML=`
<div style="padding: 1rem; border: 2px solid #f44336; background: #ffebee; border-radius: 4px;">
<p style="margin: 0 0 0.5rem 0; color: #c62828; font-weight: bold;">Component Error: ${e}</p>
<p style="margin: 0; color: #666; font-size: 0.875rem;">${r?.message||"Unknown error"}</p>
</div>
`,a}renderErrorState(e,r){const a=r instanceof Error?r.message:String(r),i=r instanceof Er?r.code:"UNKNOWN_ERROR";e.innerHTML=`
<div class="layout-error" data-error-code="${i}" style="
padding: 2rem;
text-align: center;
background: #ffebee;
border: 2px solid #f44336;
border-radius: 8px;
margin: 2rem auto;
max-width: 600px;
">
<h2 style="
margin: 0 0 1rem 0;
color: #c62828;
font-size: 1.5rem;
">레이아웃 로드 실패</h2>
<p style="
margin: 0 0 1rem 0;
color: #666;
font-size: 1rem;
">${a}</p>
<p style="
margin: 0;
color: #999;
font-size: 0.875rem;
">오류 코드: ${i}</p>
<button
onclick="window.location.reload()"
style="
margin-top: 1.5rem;
padding: 0.75rem 1.5rem;
background: #f44336;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
"
>페이지 새로고침</button>
</div>
`,Fn.error("Error state rendered:",i,a)}getCurrentLayout(){return this.currentLayout}clear(){this.currentLayout=null,this.layoutCache.clear(),Fn.log("Layout data and cache cleared")}}const c_=ut("TranslationContext"),lf=N.createContext(null),_c=({children:o,translationEngine:e,translationContext:r})=>{const a=N.useMemo(()=>(l,c)=>{if(c){const d="|"+Object.entries(c).map(([f,g])=>`${f}=${g}`).join("|");return e.translate(l,r,d)}return e.translate(l,r)},[e,r]),i=N.useMemo(()=>({translationEngine:e,translationContext:r,t:a}),[e,r,a]);return dt.jsx(lf.Provider,{value:i,children:o})},Xm=()=>{const o=N.useContext(lf);return o||(c_.warn("TranslationProvider 외부에서 호출되었습니다. 키를 그대로 반환합니다."),{t:e=>e,translationEngine:null,translationContext:null})},$a=ut("SlotContext"),u_={registerToSlot:()=>{$a.warn("SlotContext not available: registerToSlot called outside SlotProvider")},unregisterFromSlot:()=>{$a.warn("SlotContext not available: unregisterFromSlot called outside SlotProvider")},getSlotComponents:()=>[],subscribeToSlot:()=>()=>{},clearAllSlots:()=>{},isEnabled:!1},d_=N.createContext(u_),cf=({children:o})=>{const e=N.useRef(new Map),r=N.useRef(new Map),a=N.useCallback(m=>{const y=r.current.get(m);y&&y.forEach(w=>{try{w()}catch(S){$a.error(`Slot subscriber error (slotId: ${m}):`,S)}})},[]),i=N.useCallback((m,y,w)=>{if(!m||!y){$a.warn("registerToSlot: slotId and componentId are required");return}e.current.has(m)||e.current.set(m,new Map);const S=e.current.get(m),v=S.get(y);v&&v.registrationKey===w.registrationKey||(S.set(y,w),$a.log(`Component registered to slot: ${y} -> ${m} (order: ${w.order})`),a(m))},[a]),l=N.useCallback((m,y)=>{const w=e.current.get(m);w&&w.has(y)&&(w.delete(y),$a.log(`Component unregistered from slot: ${y} <- ${m}`),w.size===0&&e.current.delete(m),a(m))},[a]),c=N.useCallback(m=>{const y=e.current.get(m);return y?Array.from(y.values()).sort((w,S)=>w.order-S.order):[]},[]),d=N.useCallback((m,y)=>{r.current.has(m)||r.current.set(m,new Set);const w=r.current.get(m);return w.add(y),()=>{w.delete(y),w.size===0&&r.current.delete(m)}},[]),f=N.useCallback(()=>{e.current.forEach((m,y)=>{a(y)}),e.current.clear(),r.current.clear(),$a.log("All slots cleared")},[a]),g=N.useMemo(()=>({registerToSlot:i,unregisterFromSlot:l,getSlotComponents:c,subscribeToSlot:d,clearAllSlots:f,isEnabled:!0}),[i,l,c,d,f]);return N.useLayoutEffect(()=>{typeof window<"u"&&(window.__slotContextValue=g,$a.log("SlotContext exposed to window.__slotContextValue"))},[g]),dt.jsx(d_.Provider,{value:g,children:o})};class uf{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(e,r){return this.listen(".client-"+e,r)}notification(e){return this.listen(this.notificationCreatedEvent,e)}stopListeningForNotification(e){return this.stopListening(this.notificationCreatedEvent,e)}stopListeningForWhisper(e,r){return this.stopListening(".client-"+e,r)}}class Jm{constructor(e){this.namespace=e}format(e){return[".","\\"].includes(e.charAt(0))?e.substring(1):(this.namespace&&(e=this.namespace+"."+e),e.replace(/\./g,"\\"))}setNamespace(e){this.namespace=e}}function f_(o){try{new o}catch(e){if(e instanceof Error&&e.message.includes("is not a constructor"))return!1}return!0}class df extends uf{constructor(e,r,a){super(),this.name=r,this.pusher=e,this.options=a,this.eventFormatter=new Jm(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(e,r){return this.on(this.eventFormatter.format(e),r),this}listenToAll(e){return this.subscription.bind_global((r,a)=>{if(r.startsWith("pusher:"))return;let i=String(this.options.namespace??"").replace(/\./g,"\\"),l=r.startsWith(i)?r.substring(i.length+1):"."+r;e(l,a)}),this}stopListening(e,r){return r?this.subscription.unbind(this.eventFormatter.format(e),r):this.subscription.unbind(this.eventFormatter.format(e)),this}stopListeningToAll(e){return e?this.subscription.unbind_global(e):this.subscription.unbind_global(),this}subscribed(e){return this.on("pusher:subscription_succeeded",()=>{e()}),this}error(e){return this.on("pusher:subscription_error",r=>{e(r)}),this}on(e,r){return this.subscription.bind(e,r),this}}class Qm extends df{whisper(e,r){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,r),this}}class h_ extends df{whisper(e,r){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,r),this}}class g_ extends Qm{here(e){return this.on("pusher:subscription_succeeded",r=>{e(Object.keys(r.members).map(a=>r.members[a]))}),this}joining(e){return this.on("pusher:member_added",r=>{e(r.info)}),this}whisper(e,r){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,r),this}leaving(e){return this.on("pusher:member_removed",r=>{e(r.info)}),this}}class Zm extends uf{constructor(e,r,a){super(),this.events={},this.listeners={},this.name=r,this.socket=e,this.options=a,this.eventFormatter=new Jm(this.options.namespace),this.subscribe()}subscribe(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}unsubscribe(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}listen(e,r){return this.on(this.eventFormatter.format(e),r),this}stopListening(e,r){return this.unbindEvent(this.eventFormatter.format(e),r),this}subscribed(e){return this.on("connect",r=>{e(r)}),this}error(e){return this}on(e,r){return this.listeners[e]=this.listeners[e]||[],this.events[e]||(this.events[e]=(a,i)=>{this.name===a&&this.listeners[e]&&this.listeners[e].forEach(l=>l(i))},this.socket.on(e,this.events[e])),this.listeners[e].push(r),this}unbind(){Object.keys(this.events).forEach(e=>{this.unbindEvent(e)})}unbindEvent(e,r){this.listeners[e]=this.listeners[e]||[],r&&(this.listeners[e]=this.listeners[e].filter(a=>a!==r)),(!r||this.listeners[e].length===0)&&(this.events[e]&&(this.socket.removeListener(e,this.events[e]),delete this.events[e]),delete this.listeners[e])}}class ey extends Zm{whisper(e,r){return this.socket.emit("client event",{channel:this.name,event:`client-${e}`,data:r}),this}}class p_ extends ey{here(e){return this.on("presence:subscribed",r=>{e(r.map(a=>a.user_info))}),this}joining(e){return this.on("presence:joining",r=>e(r.user_info)),this}whisper(e,r){return this.socket.emit("client event",{channel:this.name,event:`client-${e}`,data:r}),this}leaving(e){return this.on("presence:leaving",r=>e(r.user_info)),this}}class Ac extends uf{subscribe(){}unsubscribe(){}listen(e,r){return this}listenToAll(e){return this}stopListening(e,r){return this}subscribed(e){return this}error(e){return this}on(e,r){return this}}class ty extends Ac{whisper(e,r){return this}}class m_ extends Ac{whisper(e,r){return this}}class y_ extends ty{here(e){return this}joining(e){return this}whisper(e,r){return this}leaving(e){return this}}const ny=class NS{constructor(e){this.setOptions(e),this.connect()}setOptions(e){this.options={...NS._defaultOptions,...e,broadcaster:e.broadcaster};let r=this.csrfToken();r&&(this.options.auth.headers["X-CSRF-TOKEN"]=r,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=r),r=this.options.bearerToken,r&&(this.options.auth.headers.Authorization="Bearer "+r,this.options.userAuthentication.headers.Authorization="Bearer "+r)}csrfToken(){var e,r;return typeof window<"u"&&(e=window.Laravel)!=null&&e.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?((r=document.querySelector('meta[name="csrf-token"]'))==null?void 0:r.getAttribute("content"))??null:null}};ny._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let ff=ny;class xc extends ff{constructor(){super(...arguments),this.channels={}}connect(){if(typeof this.options.client<"u")this.pusher=this.options.client;else if(this.options.Pusher)this.pusher=new this.options.Pusher(this.options.key,this.options);else if(typeof window<"u"&&typeof window.Pusher<"u")this.pusher=new window.Pusher(this.options.key,this.options);else throw new Error("Pusher client not found. Should be globally available or passed via options.client")}signin(){this.pusher.signin()}listen(e,r,a){return this.channel(e).listen(r,a)}channel(e){return this.channels[e]||(this.channels[e]=new df(this.pusher,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new Qm(this.pusher,"private-"+e,this.options)),this.channels["private-"+e]}encryptedPrivateChannel(e){return this.channels["private-encrypted-"+e]||(this.channels["private-encrypted-"+e]=new h_(this.pusher,"private-encrypted-"+e,this.options)),this.channels["private-encrypted-"+e]}presenceChannel(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new g_(this.pusher,"presence-"+e,this.options)),this.channels["presence-"+e]}leave(e){[e,"private-"+e,"private-encrypted-"+e,"presence-"+e].forEach(r=>{this.leaveChannel(r)})}leaveChannel(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}socketId(){return this.pusher.connection.socket_id}disconnect(){this.pusher.disconnect()}}class b_ extends ff{constructor(){super(...arguments),this.channels={}}connect(){let e=this.getSocketIO();this.socket=e(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>{Object.values(this.channels).forEach(r=>{r.subscribe()})})}getSocketIO(){if(typeof this.options.client<"u")return this.options.client;if(typeof window<"u"&&typeof window.io<"u")return window.io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}listen(e,r,a){return this.channel(e).listen(r,a)}channel(e){return this.channels[e]||(this.channels[e]=new Zm(this.socket,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new ey(this.socket,"private-"+e,this.options)),this.channels["private-"+e]}presenceChannel(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new p_(this.socket,"presence-"+e,this.options)),this.channels["presence-"+e]}leave(e){[e,"private-"+e,"presence-"+e].forEach(r=>{this.leaveChannel(r)})}leaveChannel(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}socketId(){return this.socket.id}disconnect(){this.socket.disconnect()}}class ry extends ff{constructor(){super(...arguments),this.channels={}}connect(){}listen(e,r,a){return new Ac}channel(e){return new Ac}privateChannel(e){return new ty}encryptedPrivateChannel(e){return new m_}presenceChannel(e){return new y_}leave(e){}leaveChannel(e){}socketId(){return"fake-socket-id"}disconnect(){}}class v_{constructor(e){this.options=e,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}channel(e){return this.connector.channel(e)}connect(){if(this.options.broadcaster==="reverb")this.connector=new xc({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new xc(this.options);else if(this.options.broadcaster==="ably")this.connector=new xc({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new b_(this.options);else if(this.options.broadcaster==="null")this.connector=new ry(this.options);else if(typeof this.options.broadcaster=="function"&&f_(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} is not supported.`)}disconnect(){this.connector.disconnect()}join(e){return this.connector.presenceChannel(e)}leave(e){this.connector.leave(e)}leaveChannel(e){this.connector.leaveChannel(e)}leaveAllChannels(){for(const e in this.connector.channels)this.leaveChannel(e)}listen(e,r,a){return this.connector.listen(e,r,a)}private(e){return this.connector.privateChannel(e)}encryptedPrivate(e){if(this.connectorSupportsEncryptedPrivateChannels(this.connector))return this.connector.encryptedPrivateChannel(e);throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} does not support encrypted private channels.`)}connectorSupportsEncryptedPrivateChannels(e){return e instanceof xc||e instanceof ry}socketId(){return this.connector.socketId()}registerInterceptors(){typeof Vue<"u"&&Vue!=null&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),typeof Turbo=="object"&&this.registerTurboRequestInterceptor()}registerVueRequestInterceptor(){Vue.http.interceptors.push((e,r)=>{this.socketId()&&e.headers.set("X-Socket-ID",this.socketId()),r()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(e=>(this.socketId()&&(e.headers["X-Socket-Id"]=this.socketId()),e))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((e,r,a)=>{this.socketId()&&a.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",e=>{e.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}var hf={exports:{}};/*!
* Pusher JavaScript Library v8.4.0
* https://pusher.com/
*
* Copyright 2020, Pusher
* Released under the MIT licence.
*/var ay;function S_(){return ay||(ay=1,(function(o,e){(function(a,i){o.exports=i()})(window,function(){return(function(r){var a={};function i(l){if(a[l])return a[l].exports;var c=a[l]={i:l,l:!1,exports:{}};return r[l].call(c.exports,c,c.exports,i),c.l=!0,c.exports}return i.m=r,i.c=a,i.d=function(l,c,d){i.o(l,c)||Object.defineProperty(l,c,{enumerable:!0,get:d})},i.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},i.t=function(l,c){if(c&1&&(l=i(l)),c&8||c&4&&typeof l=="object"&&l&&l.__esModule)return l;var d=Object.create(null);if(i.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:l}),c&2&&typeof l!="string")for(var f in l)i.d(d,f,function(g){return l[g]}.bind(null,f));return d},i.n=function(l){var c=l&&l.__esModule?function(){return l.default}:function(){return l};return i.d(c,"a",c),c},i.o=function(l,c){return Object.prototype.hasOwnProperty.call(l,c)},i.p="",i(i.s=2)})([(function(r,a,i){var l=this&&this.__extends||(function(){var A=function(x,R){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,O){M.__proto__=O}||function(M,O){for(var L in O)O.hasOwnProperty(L)&&(M[L]=O[L])},A(x,R)};return function(x,R){A(x,R);function M(){this.constructor=x}x.prototype=R===null?Object.create(R):(M.prototype=R.prototype,new M)}})();Object.defineProperty(a,"__esModule",{value:!0});var c=256,d=(function(){function A(x){x===void 0&&(x="="),this._paddingCharacter=x}return A.prototype.encodedLength=function(x){return this._paddingCharacter?(x+2)/3*4|0:(x*8+5)/6|0},A.prototype.encode=function(x){for(var R="",M=0;M<x.length-2;M+=3){var O=x[M]<<16|x[M+1]<<8|x[M+2];R+=this._encodeByte(O>>>18&63),R+=this._encodeByte(O>>>12&63),R+=this._encodeByte(O>>>6&63),R+=this._encodeByte(O>>>0&63)}var L=x.length-M;if(L>0){var O=x[M]<<16|(L===2?x[M+1]<<8:0);R+=this._encodeByte(O>>>18&63),R+=this._encodeByte(O>>>12&63),L===2?R+=this._encodeByte(O>>>6&63):R+=this._paddingCharacter||"",R+=this._paddingCharacter||""}return R},A.prototype.maxDecodedLength=function(x){return this._paddingCharacter?x/4*3|0:(x*6+7)/8|0},A.prototype.decodedLength=function(x){return this.maxDecodedLength(x.length-this._getPaddingLength(x))},A.prototype.decode=function(x){if(x.length===0)return new Uint8Array(0);for(var R=this._getPaddingLength(x),M=x.length-R,O=new Uint8Array(this.maxDecodedLength(M)),L=0,q=0,G=0,B=0,K=0,fe=0,Ce=0;q<M-4;q+=4)B=this._decodeChar(x.charCodeAt(q+0)),K=this._decodeChar(x.charCodeAt(q+1)),fe=this._decodeChar(x.charCodeAt(q+2)),Ce=this._decodeChar(x.charCodeAt(q+3)),O[L++]=B<<2|K>>>4,O[L++]=K<<4|fe>>>2,O[L++]=fe<<6|Ce,G|=B&c,G|=K&c,G|=fe&c,G|=Ce&c;if(q<M-1&&(B=this._decodeChar(x.charCodeAt(q)),K=this._decodeChar(x.charCodeAt(q+1)),O[L++]=B<<2|K>>>4,G|=B&c,G|=K&c),q<M-2&&(fe=this._decodeChar(x.charCodeAt(q+2)),O[L++]=K<<4|fe>>>2,G|=fe&c),q<M-3&&(Ce=this._decodeChar(x.charCodeAt(q+3)),O[L++]=fe<<6|Ce,G|=Ce&c),G!==0)throw new Error("Base64Coder: incorrect characters for decoding");return O},A.prototype._encodeByte=function(x){var R=x;return R+=65,R+=25-x>>>8&6,R+=51-x>>>8&-75,R+=61-x>>>8&-15,R+=62-x>>>8&3,String.fromCharCode(R)},A.prototype._decodeChar=function(x){var R=c;return R+=(42-x&x-44)>>>8&-c+x-43+62,R+=(46-x&x-48)>>>8&-c+x-47+63,R+=(47-x&x-58)>>>8&-c+x-48+52,R+=(64-x&x-91)>>>8&-c+x-65+0,R+=(96-x&x-123)>>>8&-c+x-97+26,R},A.prototype._getPaddingLength=function(x){var R=0;if(this._paddingCharacter){for(var M=x.length-1;M>=0&&x[M]===this._paddingCharacter;M--)R++;if(x.length<4||R>2)throw new Error("Base64Coder: incorrect padding")}return R},A})();a.Coder=d;var f=new d;function g(A){return f.encode(A)}a.encode=g;function m(A){return f.decode(A)}a.decode=m;var y=(function(A){l(x,A);function x(){return A!==null&&A.apply(this,arguments)||this}return x.prototype._encodeByte=function(R){var M=R;return M+=65,M+=25-R>>>8&6,M+=51-R>>>8&-75,M+=61-R>>>8&-13,M+=62-R>>>8&49,String.fromCharCode(M)},x.prototype._decodeChar=function(R){var M=c;return M+=(44-R&R-46)>>>8&-c+R-45+62,M+=(94-R&R-96)>>>8&-c+R-95+63,M+=(47-R&R-58)>>>8&-c+R-48+52,M+=(64-R&R-91)>>>8&-c+R-65+0,M+=(96-R&R-123)>>>8&-c+R-97+26,M},x})(d);a.URLSafeCoder=y;var w=new y;function S(A){return w.encode(A)}a.encodeURLSafe=S;function v(A){return w.decode(A)}a.decodeURLSafe=v,a.encodedLength=function(A){return f.encodedLength(A)},a.maxDecodedLength=function(A){return f.maxDecodedLength(A)},a.decodedLength=function(A){return f.decodedLength(A)}}),(function(r,a,i){Object.defineProperty(a,"__esModule",{value:!0});var l="utf8: invalid string",c="utf8: invalid source encoding";function d(m){for(var y=new Uint8Array(f(m)),w=0,S=0;S<m.length;S++){var v=m.charCodeAt(S);v<128?y[w++]=v:v<2048?(y[w++]=192|v>>6,y[w++]=128|v&63):v<55296?(y[w++]=224|v>>12,y[w++]=128|v>>6&63,y[w++]=128|v&63):(S++,v=(v&1023)<<10,v|=m.charCodeAt(S)&1023,v+=65536,y[w++]=240|v>>18,y[w++]=128|v>>12&63,y[w++]=128|v>>6&63,y[w++]=128|v&63)}return y}a.encode=d;function f(m){for(var y=0,w=0;w<m.length;w++){var S=m.charCodeAt(w);if(S<128)y+=1;else if(S<2048)y+=2;else if(S<55296)y+=3;else if(S<=57343){if(w>=m.length-1)throw new Error(l);w++,y+=4}else throw new Error(l)}return y}a.encodedLength=f;function g(m){for(var y=[],w=0;w<m.length;w++){var S=m[w];if(S&128){var v=void 0;if(S<224){if(w>=m.length)throw new Error(c);var A=m[++w];if((A&192)!==128)throw new Error(c);S=(S&31)<<6|A&63,v=128}else if(S<240){if(w>=m.length-1)throw new Error(c);var A=m[++w],x=m[++w];if((A&192)!==128||(x&192)!==128)throw new Error(c);S=(S&15)<<12|(A&63)<<6|x&63,v=2048}else if(S<248){if(w>=m.length-2)throw new Error(c);var A=m[++w],x=m[++w],R=m[++w];if((A&192)!==128||(x&192)!==128||(R&192)!==128)throw new Error(c);S=(S&15)<<18|(A&63)<<12|(x&63)<<6|R&63,v=65536}else throw new Error(c);if(S<v||S>=55296&&S<=57343)throw new Error(c);if(S>=65536){if(S>1114111)throw new Error(c);S-=65536,y.push(String.fromCharCode(55296|S>>10)),S=56320|S&1023}}y.push(String.fromCharCode(S))}return y.join("")}a.decode=g}),(function(r,a,i){r.exports=i(3).default}),(function(r,a,i){i.r(a);class l{constructor(b,E){this.lastId=0,this.prefix=b,this.name=E}create(b){this.lastId++;var E=this.lastId,D=this.prefix+E,I=this.name+"["+E+"]",ie=!1,ye=function(){ie||(b.apply(null,arguments),ie=!0)};return this[E]=ye,{number:E,id:D,name:I,callback:ye}}remove(b){delete this[b.number]}}var c=new l("_pusher_script_","Pusher.ScriptReceivers"),d={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},f=d;class g{constructor(b){this.options=b,this.receivers=b.receivers||c,this.loading={}}load(b,E,D){var I=this;if(I.loading[b]&&I.loading[b].length>0)I.loading[b].push(D);else{I.loading[b]=[D];var ie=Ve.createScriptRequest(I.getPath(b,E)),ye=I.receivers.create(function(Oe){if(I.receivers.remove(ye),I.loading[b]){var Fe=I.loading[b];delete I.loading[b];for(var at=function(Bt){Bt||ie.cleanup()},lt=0;lt<Fe.length;lt++)Fe[lt](Oe,at)}});ie.send(ye)}}getRoot(b){var E,D=Ve.getDocument().location.protocol;return b&&b.useTLS||D==="https:"?E=this.options.cdn_https:E=this.options.cdn_http,E.replace(/\/*$/,"")+"/"+this.options.version}getPath(b,E){return this.getRoot(E)+"/"+b+this.options.suffix+".js"}}var m=new l("_pusher_dependencies","Pusher.DependenciesReceivers"),y=new g({cdn_http:f.cdn_http,cdn_https:f.cdn_https,version:f.VERSION,suffix:f.dependency_suffix,receivers:m});const w={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var v={buildLogSuffix:function(_){const b="See:",E=w.urls[_];if(!E)return"";let D;return E.fullUrl?D=E.fullUrl:E.path&&(D=w.baseUrl+E.path),D?`${b} ${D}`:""}},A;(function(_){_.UserAuthentication="user-authentication",_.ChannelAuthorization="channel-authorization"})(A||(A={}));class x extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class R extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class M extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class O extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class q extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class G extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class B extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class K extends Error{constructor(b,E){super(E),this.status=b,Object.setPrototypeOf(this,new.target.prototype)}}var Ce=function(_,b,E,D,I){const ie=Ve.createXHR();ie.open("POST",E.endpoint,!0),ie.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var ye in E.headers)ie.setRequestHeader(ye,E.headers[ye]);if(E.headersProvider!=null){let Oe=E.headersProvider();for(var ye in Oe)ie.setRequestHeader(ye,Oe[ye])}return ie.onreadystatechange=function(){if(ie.readyState===4)if(ie.status===200){let Oe,Fe=!1;try{Oe=JSON.parse(ie.responseText),Fe=!0}catch{I(new K(200,`JSON returned from ${D.toString()} endpoint was invalid, yet status code was 200. Data was: ${ie.responseText}`),null)}Fe&&I(null,Oe)}else{let Oe="";switch(D){case A.UserAuthentication:Oe=v.buildLogSuffix("authenticationEndpoint");break;case A.ChannelAuthorization:Oe=`Clients must be authorized to join private or presence channels. ${v.buildLogSuffix("authorizationEndpoint")}`;break}I(new K(ie.status,`Unable to retrieve auth string from ${D.toString()} endpoint - received status: ${ie.status} from ${E.endpoint}. ${Oe}`),null)}},ie.send(b),ie};function ke(_){return he(wt(_))}var Ue=String.fromCharCode,Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qe=function(_){var b=_.charCodeAt(0);return b<128?_:b<2048?Ue(192|b>>>6)+Ue(128|b&63):Ue(224|b>>>12&15)+Ue(128|b>>>6&63)+Ue(128|b&63)},wt=function(_){return _.replace(/[^\x00-\x7F]/g,qe)},J=function(_){var b=[0,2,1][_.length%3],E=_.charCodeAt(0)<<16|(_.length>1?_.charCodeAt(1):0)<<8|(_.length>2?_.charCodeAt(2):0),D=[Pe.charAt(E>>>18),Pe.charAt(E>>>12&63),b>=2?"=":Pe.charAt(E>>>6&63),b>=1?"=":Pe.charAt(E&63)];return D.join("")},he=window.btoa||function(_){return _.replace(/[\s\S]{1,3}/g,J)};class Ee{constructor(b,E,D,I){this.clear=E,this.timer=b(()=>{this.timer&&(this.timer=I(this.timer))},D)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var Z=Ee;function pe(_){window.clearTimeout(_)}function H(_){window.clearInterval(_)}class T extends Z{constructor(b,E){super(setTimeout,pe,b,function(D){return E(),null})}}class ge extends Z{constructor(b,E){super(setInterval,H,b,function(D){return E(),D})}}var de={now(){return Date.now?Date.now():new Date().valueOf()},defer(_){return new T(0,_)},method(_,...b){var E=Array.prototype.slice.call(arguments,1);return function(D){return D[_].apply(D,E.concat(arguments))}}},me=de;function ae(_,...b){for(var E=0;E<b.length;E++){var D=b[E];for(var I in D)D[I]&&D[I].constructor&&D[I].constructor===Object?_[I]=ae(_[I]||{},D[I]):_[I]=D[I]}return _}function Re(){for(var _=["Pusher"],b=0;b<arguments.length;b++)typeof arguments[b]=="string"?_.push(arguments[b]):_.push(Wn(arguments[b]));return _.join(" : ")}function ze(_,b){var E=Array.prototype.indexOf;if(_===null)return-1;if(E&&_.indexOf===E)return _.indexOf(b);for(var D=0,I=_.length;D<I;D++)if(_[D]===b)return D;return-1}function $e(_,b){for(var E in _)Object.prototype.hasOwnProperty.call(_,E)&&b(_[E],E,_)}function Ge(_){var b=[];return $e(_,function(E,D){b.push(D)}),b}function At(_){var b=[];return $e(_,function(E){b.push(E)}),b}function yt(_,b,E){for(var D=0;D<_.length;D++)b.call(E||window,_[D],D,_)}function dn(_,b){for(var E=[],D=0;D<_.length;D++)E.push(b(_[D],D,_,E));return E}function Tt(_,b){var E={};return $e(_,function(D,I){E[I]=b(D)}),E}function Yt(_,b){b=b||function(I){return!!I};for(var E=[],D=0;D<_.length;D++)b(_[D],D,_,E)&&E.push(_[D]);return E}function ln(_,b){var E={};return $e(_,function(D,I){(b&&b(D,I,_,E)||D)&&(E[I]=D)}),E}function zt(_){var b=[];return $e(_,function(E,D){b.push([D,E])}),b}function Tr(_,b){for(var E=0;E<_.length;E++)if(b(_[E],E,_))return!0;return!1}function wn(_,b){for(var E=0;E<_.length;E++)if(!b(_[E],E,_))return!1;return!0}function cn(_){return Tt(_,function(b){return typeof b=="object"&&(b=Wn(b)),encodeURIComponent(ke(b.toString()))})}function fn(_){var b=ln(_,function(D){return D!==void 0}),E=dn(zt(cn(b)),me.method("join","=")).join("&");return E}function sr(_){var b=[],E=[];return(function D(I,ie){var ye,Oe,Fe;switch(typeof I){case"object":if(!I)return null;for(ye=0;ye<b.length;ye+=1)if(b[ye]===I)return{$ref:E[ye]};if(b.push(I),E.push(ie),Object.prototype.toString.apply(I)==="[object Array]")for(Fe=[],ye=0;ye<I.length;ye+=1)Fe[ye]=D(I[ye],ie+"["+ye+"]");else{Fe={};for(Oe in I)Object.prototype.hasOwnProperty.call(I,Oe)&&(Fe[Oe]=D(I[Oe],ie+"["+JSON.stringify(Oe)+"]"))}return Fe;case"number":case"string":case"boolean":return I}})(_,"$")}function Wn(_){try{return JSON.stringify(_)}catch{return JSON.stringify(sr(_))}}class Ut{constructor(){this.globalLog=b=>{window.console&&window.console.log&&window.console.log(b)}}debug(...b){this.log(this.globalLog,b)}warn(...b){this.log(this.globalLogWarn,b)}error(...b){this.log(this.globalLogError,b)}globalLogWarn(b){window.console&&window.console.warn?window.console.warn(b):this.globalLog(b)}globalLogError(b){window.console&&window.console.error?window.console.error(b):this.globalLogWarn(b)}log(b,...E){var D=Re.apply(this,arguments);Jo.log?Jo.log(D):Jo.logToConsole&&b.bind(this)(D)}}var bt=new Ut,ra=function(_,b,E,D,I){(E.headers!==void 0||E.headersProvider!=null)&&bt.warn(`To send headers with the ${D.toString()} request, you must use AJAX, rather than JSONP.`);var ie=_.nextAuthCallbackID.toString();_.nextAuthCallbackID++;var ye=_.getDocument(),Oe=ye.createElement("script");_.auth_callbacks[ie]=function(lt){I(null,lt)};var Fe="Pusher.auth_callbacks['"+ie+"']";Oe.src=E.endpoint+"?callback="+encodeURIComponent(Fe)+"&"+b;var at=ye.getElementsByTagName("head")[0]||ye.documentElement;at.insertBefore(Oe,at.firstChild)},Ln=ra;class An{constructor(b){this.src=b}send(b){var E=this,D="Error loading "+E.src;E.script=document.createElement("script"),E.script.id=b.id,E.script.src=E.src,E.script.type="text/javascript",E.script.charset="UTF-8",E.script.addEventListener?(E.script.onerror=function(){b.callback(D)},E.script.onload=function(){b.callback(null)}):E.script.onreadystatechange=function(){(E.script.readyState==="loaded"||E.script.readyState==="complete")&&b.callback(null)},E.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(E.errorScript=document.createElement("script"),E.errorScript.id=b.id+"_error",E.errorScript.text=b.name+"('"+D+"');",E.script.async=E.errorScript.async=!1):E.script.async=!0;var I=document.getElementsByTagName("head")[0];I.insertBefore(E.script,I.firstChild),E.errorScript&&I.insertBefore(E.errorScript,E.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class xn{constructor(b,E){this.url=b,this.data=E}send(b){if(!this.request){var E=fn(this.data),D=this.url+"/"+b.number+"?"+E;this.request=Ve.createScriptRequest(D),this.request.send(b)}}cleanup(){this.request&&this.request.cleanup()}}var Mn=function(_,b){return function(E,D){var I="http"+(b?"s":"")+"://",ie=I+(_.host||_.options.host)+_.options.path,ye=Ve.createJSONPRequest(ie,E),Oe=Ve.ScriptReceivers.create(function(Fe,at){c.remove(Oe),ye.cleanup(),at&&at.host&&(_.host=at.host),D&&D(Fe,at)});ye.send(Oe)}},hn={name:"jsonp",getAgent:Mn},aa=hn;function $n(_,b,E){var D=_+(b.useTLS?"s":""),I=b.useTLS?b.hostTLS:b.hostNonTLS;return D+"://"+I+E}function Vt(_,b){var E="/app/"+_,D="?protocol="+f.PROTOCOL+"&client=js&version="+f.VERSION+(b?"&"+b:"");return E+D}var Cn={getInitial:function(_,b){var E=(b.httpPath||"")+Vt(_,"flash=false");return $n("ws",b,E)}},nn={getInitial:function(_,b){var E=(b.httpPath||"/pusher")+Vt(_);return $n("http",b,E)}},V={getInitial:function(_,b){return $n("http",b,b.httpPath||"/pusher")},getPath:function(_,b){return Vt(_)}};class oe{constructor(){this._callbacks={}}get(b){return this._callbacks[ce(b)]}add(b,E,D){var I=ce(b);this._callbacks[I]=this._callbacks[I]||[],this._callbacks[I].push({fn:E,context:D})}remove(b,E,D){if(!b&&!E&&!D){this._callbacks={};return}var I=b?[ce(b)]:Ge(this._callbacks);E||D?this.removeCallback(I,E,D):this.removeAllCallbacks(I)}removeCallback(b,E,D){yt(b,function(I){this._callbacks[I]=Yt(this._callbacks[I]||[],function(ie){return E&&E!==ie.fn||D&&D!==ie.context}),this._callbacks[I].length===0&&delete this._callbacks[I]},this)}removeAllCallbacks(b){yt(b,function(E){delete this._callbacks[E]},this)}}function ce(_){return"_"+_}class X{constructor(b){this.callbacks=new oe,this.global_callbacks=[],this.failThrough=b}bind(b,E,D){return this.callbacks.add(b,E,D),this}bind_global(b){return this.global_callbacks.push(b),this}unbind(b,E,D){return this.callbacks.remove(b,E,D),this}unbind_global(b){return b?(this.global_callbacks=Yt(this.global_callbacks||[],E=>E!==b),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(b,E,D){for(var I=0;I<this.global_callbacks.length;I++)this.global_callbacks[I](b,E);var ie=this.callbacks.get(b),ye=[];if(D?ye.push(E,D):E&&ye.push(E),ie&&ie.length>0)for(var I=0;I<ie.length;I++)ie[I].fn.apply(ie[I].context||window,ye);else this.failThrough&&this.failThrough(b,E);return this}}class ve extends X{constructor(b,E,D,I,ie){super(),this.initialize=Ve.transportConnectionInitializer,this.hooks=b,this.name=E,this.priority=D,this.key=I,this.options=ie,this.state="new",this.timeline=ie.timeline,this.activityTimeout=ie.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var b=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(b,this.options)}catch(E){return me.defer(()=>{this.onError(E),this.changeState("closed")}),!1}return this.bindListeners(),bt.debug("Connecting",{transport:this.name,url:b}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(b){return this.state==="open"?(me.defer(()=>{this.socket&&this.socket.send(b)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(b){this.emit("error",{type:"WebSocketError",error:b}),this.timeline.error(this.buildTimelineMessage({error:b.toString()}))}onClose(b){b?this.changeState("closed",{code:b.code,reason:b.reason,wasClean:b.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(b){this.emit("message",b)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=b=>{this.onError(b)},this.socket.onclose=b=>{this.onClose(b)},this.socket.onmessage=b=>{this.onMessage(b)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(b,E){this.state=b,this.timeline.info(this.buildTimelineMessage({state:b,params:E})),this.emit(b,E)}buildTimelineMessage(b){return ae({cid:this.id},b)}}class ue{constructor(b){this.hooks=b}isSupported(b){return this.hooks.isSupported(b)}createConnection(b,E,D,I){return new ve(this.hooks,b,E,D,I)}}var we=new ue({urls:Cn,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Ve.getWebSocketAPI()},isSupported:function(){return!!Ve.getWebSocketAPI()},getSocket:function(_){return Ve.createWebSocket(_)}}),_e={urls:nn,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Be=ae({getSocket:function(_){return Ve.HTTPFactory.createStreamingSocket(_)}},_e),xe=ae({getSocket:function(_){return Ve.HTTPFactory.createPollingSocket(_)}},_e),De={isSupported:function(){return Ve.isXHRSupported()}},Ae=new ue(ae({},Be,De)),et=new ue(ae({},xe,De)),Ne={ws:we,xhr_streaming:Ae,xhr_polling:et},je=Ne,Se=new ue({file:"sockjs",urls:V,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(_,b){return new window.SockJS(_,null,{js_path:y.getPath("sockjs",{useTLS:b.useTLS}),ignore_null_origin:b.ignoreNullOrigin})},beforeOpen:function(_,b){_.send(JSON.stringify({path:b}))}}),Me={isSupported:function(_){var b=Ve.isXDRSupported(_.useTLS);return b}},Ze=new ue(ae({},Be,Me)),kt=new ue(ae({},xe,Me));je.xdr_streaming=Ze,je.xdr_polling=kt,je.sockjs=Se;var Ot=je;class Nn extends X{constructor(){super();var b=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){b.emit("online")},!1),window.addEventListener("offline",function(){b.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var $t=new Nn;class Nt{constructor(b,E,D){this.manager=b,this.transport=E,this.minPingDelay=D.minPingDelay,this.maxPingDelay=D.maxPingDelay,this.pingDelay=void 0}createConnection(b,E,D,I){I=ae({},I,{activityTimeout:this.pingDelay});var ie=this.transport.createConnection(b,E,D,I),ye=null,Oe=function(){ie.unbind("open",Oe),ie.bind("closed",Fe),ye=me.now()},Fe=at=>{if(ie.unbind("closed",Fe),at.code===1002||at.code===1003)this.manager.reportDeath();else if(!at.wasClean&&ye){var lt=me.now()-ye;lt<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(lt/2,this.minPingDelay))}};return ie.bind("open",Oe),ie}isSupported(b){return this.manager.isAlive()&&this.transport.isSupported(b)}}const gn={decodeMessage:function(_){try{var b=JSON.parse(_.data),E=b.data;if(typeof E=="string")try{E=JSON.parse(b.data)}catch{}var D={event:b.event,channel:b.channel,data:E};return b.user_id&&(D.user_id=b.user_id),D}catch(I){throw{type:"MessageParseError",error:I,data:_.data}}},encodeMessage:function(_){return JSON.stringify(_)},processHandshake:function(_){var b=gn.decodeMessage(_);if(b.event==="pusher:connection_established"){if(!b.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:b.data.socket_id,activityTimeout:b.data.activity_timeout*1e3}}else{if(b.event==="pusher:error")return{action:this.getCloseAction(b.data),error:this.getCloseError(b.data)};throw"Invalid handshake"}},getCloseAction:function(_){return _.code<4e3?_.code>=1002&&_.code<=1004?"backoff":null:_.code===4e3?"tls_only":_.code<4100?"refused":_.code<4200?"backoff":_.code<4300?"retry":"refused"},getCloseError:function(_){return _.code!==1e3&&_.code!==1001?{type:"PusherError",data:{code:_.code,message:_.reason||_.message}}:null}};var In=gn;class No extends X{constructor(b,E){super(),this.id=b,this.transport=E,this.activityTimeout=E.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(b){return this.transport.send(b)}send_event(b,E,D){var I={event:b,data:E};return D&&(I.channel=D),bt.debug("Event sent",I),this.send(In.encodeMessage(I))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var b={message:D=>{var I;try{I=In.decodeMessage(D)}catch(ie){this.emit("error",{type:"MessageParseError",error:ie,data:D.data})}if(I!==void 0){switch(bt.debug("Event recd",I),I.event){case"pusher:error":this.emit("error",{type:"PusherError",data:I.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",I)}},activity:()=>{this.emit("activity")},error:D=>{this.emit("error",D)},closed:D=>{E(),D&&D.code&&this.handleCloseEvent(D),this.transport=null,this.emit("closed")}},E=()=>{$e(b,(D,I)=>{this.transport.unbind(I,D)})};$e(b,(D,I)=>{this.transport.bind(I,D)})}handleCloseEvent(b){var E=In.getCloseAction(b),D=In.getCloseError(b);D&&this.emit("error",D),E&&this.emit(E,{action:E,error:D})}}class Sf{constructor(b,E){this.transport=b,this.callback=E,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=b=>{this.unbindListeners();var E;try{E=In.processHandshake(b)}catch(D){this.finish("error",{error:D}),this.transport.close();return}E.action==="connected"?this.finish("connected",{connection:new No(E.id,this.transport),activityTimeout:E.activityTimeout}):(this.finish(E.action,{error:E.error}),this.transport.close())},this.onClosed=b=>{this.unbindListeners();var E=In.getCloseAction(b)||"backoff",D=In.getCloseError(b);this.finish(E,{error:D})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(b,E){this.callback(ae({transport:this.transport,action:b},E))}}class wf{constructor(b,E){this.timeline=b,this.options=E||{}}send(b,E){this.timeline.isEmpty()||this.timeline.send(Ve.TimelineTransport.getAgent(this,b),E)}}class hs extends X{constructor(b,E){super(function(D,I){bt.debug("No callbacks on "+b+" for "+D)}),this.name=b,this.pusher=E,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(b,E){return E(null,{auth:""})}trigger(b,E){if(b.indexOf("client-")!==0)throw new x("Event '"+b+"' does not start with 'client-'");if(!this.subscribed){var D=v.buildLogSuffix("triggeringClientEvents");bt.warn(`Client event triggered before channel 'subscription_succeeded' event . ${D}`)}return this.pusher.send_event(b,E,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(b){var E=b.event,D=b.data;if(E==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(b);else if(E==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(b);else if(E.indexOf("pusher_internal:")!==0){var I={};this.emit(E,D,I)}}handleSubscriptionSucceededEvent(b){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",b.data)}handleSubscriptionCountEvent(b){b.data.subscription_count&&(this.subscriptionCount=b.data.subscription_count),this.emit("pusher:subscription_count",b.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(b,E)=>{b?(this.subscriptionPending=!1,bt.error(b.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:b.message},b instanceof K?{status:b.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:E.auth,channel_data:E.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class ia extends hs{authorize(b,E){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:b},E)}}class Io{constructor(){this.reset()}get(b){return Object.prototype.hasOwnProperty.call(this.members,b)?{id:b,info:this.members[b]}:null}each(b){$e(this.members,(E,D)=>{b(this.get(D))})}setMyID(b){this.myID=b}onSubscription(b){this.members=b.presence.hash,this.count=b.presence.count,this.me=this.get(this.myID)}addMember(b){return this.get(b.user_id)===null&&this.count++,this.members[b.user_id]=b.user_info,this.get(b.user_id)}removeMember(b){var E=this.get(b.user_id);return E&&(delete this.members[b.user_id],this.count--),E}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Ia=function(_,b,E,D){function I(ie){return ie instanceof E?ie:new E(function(ye){ye(ie)})}return new(E||(E=Promise))(function(ie,ye){function Oe(lt){try{at(D.next(lt))}catch(Bt){ye(Bt)}}function Fe(lt){try{at(D.throw(lt))}catch(Bt){ye(Bt)}}function at(lt){lt.done?ie(lt.value):I(lt.value).then(Oe,Fe)}at((D=D.apply(_,b||[])).next())})};class Ha extends ia{constructor(b,E){super(b,E),this.members=new Io}authorize(b,E){super.authorize(b,(D,I)=>Ia(this,void 0,void 0,function*(){if(!D)if(I=I,I.channel_data!=null){var ie=JSON.parse(I.channel_data);this.members.setMyID(ie.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let ye=v.buildLogSuffix("authorizationEndpoint");bt.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${ye}, or the user should be signed in.`),E("Invalid auth response");return}E(D,I)}))}handleEvent(b){var E=b.event;if(E.indexOf("pusher_internal:")===0)this.handleInternalEvent(b);else{var D=b.data,I={};b.user_id&&(I.user_id=b.user_id),this.emit(E,D,I)}}handleInternalEvent(b){var E=b.event,D=b.data;switch(E){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(b);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(b);break;case"pusher_internal:member_added":var I=this.members.addMember(D);this.emit("pusher:member_added",I);break;case"pusher_internal:member_removed":var ie=this.members.removeMember(D);ie&&this.emit("pusher:member_removed",ie);break}}handleSubscriptionSucceededEvent(b){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(b.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var _i=i(1),qr=i(0);class Xt extends ia{constructor(b,E,D){super(b,E),this.key=null,this.nacl=D}authorize(b,E){super.authorize(b,(D,I)=>{if(D){E(D,I);return}let ie=I.shared_secret;if(!ie){E(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(qr.decode)(ie),delete I.shared_secret,E(null,I)})}trigger(b,E){throw new q("Client events are not currently supported for encrypted channels")}handleEvent(b){var E=b.event,D=b.data;if(E.indexOf("pusher_internal:")===0||E.indexOf("pusher:")===0){super.handleEvent(b);return}this.handleEncryptedEvent(E,D)}handleEncryptedEvent(b,E){if(!this.key){bt.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!E.ciphertext||!E.nonce){bt.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+E);return}let D=Object(qr.decode)(E.ciphertext);if(D.length<this.nacl.secretbox.overheadLength){bt.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${D.length}`);return}let I=Object(qr.decode)(E.nonce);if(I.length<this.nacl.secretbox.nonceLength){bt.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${I.length}`);return}let ie=this.nacl.secretbox.open(D,I,this.key);if(ie===null){bt.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(ye,Oe)=>{if(ye){bt.error(`Failed to make a request to the authEndpoint: ${Oe}. Unable to fetch new key, so dropping encrypted event`);return}if(ie=this.nacl.secretbox.open(D,I,this.key),ie===null){bt.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(b,this.getDataToEmit(ie))});return}this.emit(b,this.getDataToEmit(ie))}getDataToEmit(b){let E=Object(_i.decode)(b);try{return JSON.parse(E)}catch{return E}}}class Mc extends X{constructor(b,E){super(),this.state="initialized",this.connection=null,this.key=b,this.options=E,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var D=Ve.getNetwork();D.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),D.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(b){return this.connection?this.connection.send(b):!1}send_event(b,E,D){return this.connection?this.connection.send_event(b,E,D):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var b=(E,D)=>{E?this.runner=this.strategy.connect(0,b):D.action==="error"?(this.emit("error",{type:"HandshakeError",error:D.error}),this.timeline.error({handshakeError:D.error})):(this.abortConnecting(),this.handshakeCallbacks[D.action](D))};this.runner=this.strategy.connect(0,b)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var b=this.abandonConnection();b.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(b){this.timeline.info({action:"retry",delay:b}),b>0&&this.emit("connecting_in",Math.round(b/1e3)),this.retryTimer=new T(b||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new T(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new T(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new T(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(b){return ae({},b,{message:E=>{this.resetActivityCheck(),this.emit("message",E)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:E=>{this.emit("error",E)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(b){return ae({},b,{connected:E=>{this.activityTimeout=Math.min(this.options.activityTimeout,E.activityTimeout,E.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(E.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let b=E=>D=>{D.error&&this.emit("error",{type:"WebSocketError",error:D.error}),E(D)};return{tls_only:b(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:b(()=>{this.disconnect()}),backoff:b(()=>{this.retryIn(1e3)}),retry:b(()=>{this.retryIn(0)})}}setConnection(b){this.connection=b;for(var E in this.connectionCallbacks)this.connection.bind(E,this.connectionCallbacks[E]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var b in this.connectionCallbacks)this.connection.unbind(b,this.connectionCallbacks[b]);var E=this.connection;return this.connection=null,E}}updateState(b,E){var D=this.state;if(this.state=b,D!==b){var I=b;I==="connected"&&(I+=" with new socket ID "+E.socket_id),bt.debug("State changed",D+" -> "+I),this.timeline.info({state:b,params:E}),this.emit("state_change",{previous:D,current:b}),this.emit(b,E)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class $c{constructor(){this.channels={}}add(b,E){return this.channels[b]||(this.channels[b]=sa(b,E)),this.channels[b]}all(){return At(this.channels)}find(b){return this.channels[b]}remove(b){var E=this.channels[b];return delete this.channels[b],E}disconnect(){$e(this.channels,function(b){b.disconnect()})}}function sa(_,b){if(_.indexOf("private-encrypted-")===0){if(b.config.nacl)return kr.createEncryptedChannel(_,b,b.config.nacl);let E="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",D=v.buildLogSuffix("encryptedChannelSupport");throw new q(`${E}. ${D}`)}else{if(_.indexOf("private-")===0)return kr.createPrivateChannel(_,b);if(_.indexOf("presence-")===0)return kr.createPresenceChannel(_,b);if(_.indexOf("#")===0)throw new R('Cannot create a channel with name "'+_+'".');return kr.createChannel(_,b)}}var ja={createChannels(){return new $c},createConnectionManager(_,b){return new Mc(_,b)},createChannel(_,b){return new hs(_,b)},createPrivateChannel(_,b){return new ia(_,b)},createPresenceChannel(_,b){return new Ha(_,b)},createEncryptedChannel(_,b,E){return new Xt(_,b,E)},createTimelineSender(_,b){return new wf(_,b)},createHandshake(_,b){return new Sf(_,b)},createAssistantToTheTransportManager(_,b,E){return new Nt(_,b,E)}},kr=ja;class Ho{constructor(b){this.options=b||{},this.livesLeft=this.options.lives||1/0}getAssistant(b){return kr.createAssistantToTheTransportManager(this,b,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Gr{constructor(b,E){this.strategies=b,this.loop=!!E.loop,this.failFast=!!E.failFast,this.timeout=E.timeout,this.timeoutLimit=E.timeoutLimit}isSupported(){return Tr(this.strategies,me.method("isSupported"))}connect(b,E){var D=this.strategies,I=0,ie=this.timeout,ye=null,Oe=(Fe,at)=>{at?E(null,at):(I=I+1,this.loop&&(I=I%D.length),I<D.length?(ie&&(ie=ie*2,this.timeoutLimit&&(ie=Math.min(ie,this.timeoutLimit))),ye=this.tryStrategy(D[I],b,{timeout:ie,failFast:this.failFast},Oe)):E(!0))};return ye=this.tryStrategy(D[I],b,{timeout:ie,failFast:this.failFast},Oe),{abort:function(){ye.abort()},forceMinPriority:function(Fe){b=Fe,ye&&ye.forceMinPriority(Fe)}}}tryStrategy(b,E,D,I){var ie=null,ye=null;return D.timeout>0&&(ie=new T(D.timeout,function(){ye.abort(),I(!0)})),ye=b.connect(E,function(Oe,Fe){Oe&&ie&&ie.isRunning()&&!D.failFast||(ie&&ie.ensureAborted(),I(Oe,Fe))}),{abort:function(){ie&&ie.ensureAborted(),ye.abort()},forceMinPriority:function(Oe){ye.forceMinPriority(Oe)}}}}class jo{constructor(b){this.strategies=b}isSupported(){return Tr(this.strategies,me.method("isSupported"))}connect(b,E){return gs(this.strategies,b,function(D,I){return function(ie,ye){if(I[D].error=ie,ie){ps(I)&&E(!0);return}yt(I,function(Oe){Oe.forceMinPriority(ye.transport.priority)}),E(null,ye)}})}}function gs(_,b,E){var D=dn(_,function(I,ie,ye,Oe){return I.connect(b,E(ie,Oe))});return{abort:function(){yt(D,Rr)},forceMinPriority:function(I){yt(D,function(ie){ie.forceMinPriority(I)})}}}function ps(_){return wn(_,function(b){return!!b.error})}function Rr(_){!_.error&&!_.aborted&&(_.abort(),_.aborted=!0)}class Hn{constructor(b,E,D){this.strategy=b,this.transports=E,this.ttl=D.ttl||1800*1e3,this.usingTLS=D.useTLS,this.timeline=D.timeline}isSupported(){return this.strategy.isSupported()}connect(b,E){var D=this.usingTLS,I=Cf(D),ie=I&&I.cacheSkipCount?I.cacheSkipCount:0,ye=[this.strategy];if(I&&I.timestamp+this.ttl>=me.now()){var Oe=this.transports[I.transport];Oe&&(["ws","wss"].includes(I.transport)||ie>3?(this.timeline.info({cached:!0,transport:I.transport,latency:I.latency}),ye.push(new Gr([Oe],{timeout:I.latency*2+1e3,failFast:!0}))):ie++)}var Fe=me.now(),at=ye.pop().connect(b,function lt(Bt,Ri){Bt?(Uo(D),ye.length>0?(Fe=me.now(),at=ye.pop().connect(b,lt)):E(Bt)):(zo(D,Ri.transport.name,me.now()-Fe,ie),E(null,Ri))});return{abort:function(){at.abort()},forceMinPriority:function(lt){b=lt,at&&at.forceMinPriority(lt)}}}}function ms(_){return"pusherTransport"+(_?"TLS":"NonTLS")}function Cf(_){var b=Ve.getLocalStorage();if(b)try{var E=b[ms(_)];if(E)return JSON.parse(E)}catch{Uo(_)}return null}function zo(_,b,E,D){var I=Ve.getLocalStorage();if(I)try{I[ms(_)]=Wn({timestamp:me.now(),transport:b,latency:E,cacheSkipCount:D})}catch{}}function Uo(_){var b=Ve.getLocalStorage();if(b)try{delete b[ms(_)]}catch{}}class oa{constructor(b,{delay:E}){this.strategy=b,this.options={delay:E}}isSupported(){return this.strategy.isSupported()}connect(b,E){var D=this.strategy,I,ie=new T(this.options.delay,function(){I=D.connect(b,E)});return{abort:function(){ie.ensureAborted(),I&&I.abort()},forceMinPriority:function(ye){b=ye,I&&I.forceMinPriority(ye)}}}}class Ai{constructor(b,E,D){this.test=b,this.trueBranch=E,this.falseBranch=D}isSupported(){var b=this.test()?this.trueBranch:this.falseBranch;return b.isSupported()}connect(b,E){var D=this.test()?this.trueBranch:this.falseBranch;return D.connect(b,E)}}class jn{constructor(b){this.strategy=b}isSupported(){return this.strategy.isSupported()}connect(b,E){var D=this.strategy.connect(b,function(I,ie){ie&&D.abort(),E(I,ie)});return D}}function la(_){return function(){return _.isSupported()}}var Nc=function(_,b,E){var D={};function I(Di,Kc,Wc,rl,al){var il=E(_,Di,Kc,Wc,rl,al);return D[Di]=il,il}var ie=Object.assign({},b,{hostNonTLS:_.wsHost+":"+_.wsPort,hostTLS:_.wsHost+":"+_.wssPort,httpPath:_.wsPath}),ye=Object.assign({},ie,{useTLS:!0}),Oe=Object.assign({},b,{hostNonTLS:_.httpHost+":"+_.httpPort,hostTLS:_.httpHost+":"+_.httpsPort,httpPath:_.httpPath}),Fe={loop:!0,timeout:15e3,timeoutLimit:6e4},at=new Ho({minPingDelay:1e4,maxPingDelay:_.activityTimeout}),lt=new Ho({lives:2,minPingDelay:1e4,maxPingDelay:_.activityTimeout}),Bt=I("ws","ws",3,ie,at),Ri=I("wss","ws",3,ye,at),Gc=I("sockjs","sockjs",1,Oe),Qo=I("xhr_streaming","xhr_streaming",1,Oe,lt),Vc=I("xdr_streaming","xdr_streaming",1,Oe,lt),Zo=I("xhr_polling","xhr_polling",1,Oe),Ga=I("xdr_polling","xdr_polling",1,Oe),Fc=new Gr([Bt],Fe),zf=new Gr([Ri],Fe),Uf=new Gr([Gc],Fe),el=new Gr([new Ai(la(Qo),Qo,Vc)],Fe),tl=new Gr([new Ai(la(Zo),Zo,Ga)],Fe),Va=new Gr([new Ai(la(el),new jo([el,new oa(tl,{delay:4e3})]),tl)],Fe),ua=new Ai(la(Va),Va,Uf),nl;return b.useTLS?nl=new jo([Fc,new oa(ua,{delay:2e3})]):nl=new jo([Fc,new oa(zf,{delay:2e3}),new oa(ua,{delay:5e3})]),new Hn(new jn(new Ai(la(Bt),nl,ua)),D,{ttl:18e5,timeline:b.timeline,useTLS:b.useTLS})},Bo=Nc,za=(function(){var _=this;_.timeline.info(_.buildTimelineMessage({transport:_.name+(_.options.useTLS?"s":"")})),_.hooks.isInitialized()?_.changeState("initialized"):_.hooks.file?(_.changeState("initializing"),y.load(_.hooks.file,{useTLS:_.options.useTLS},function(b,E){_.hooks.isInitialized()?(_.changeState("initialized"),E(!0)):(b&&_.onError(b),_.onClose(),E(!1))})):_.onClose()}),Ic={getRequest:function(_){var b=new window.XDomainRequest;return b.ontimeout=function(){_.emit("error",new M),_.close()},b.onerror=function(E){_.emit("error",E),_.close()},b.onprogress=function(){b.responseText&&b.responseText.length>0&&_.onChunk(200,b.responseText)},b.onload=function(){b.responseText&&b.responseText.length>0&&_.onChunk(200,b.responseText),_.emit("finished",200),_.close()},b},abortRequest:function(_){_.ontimeout=_.onerror=_.onprogress=_.onload=null,_.abort()}},Hc=Ic;const Ua=256*1024;class Ef extends X{constructor(b,E,D){super(),this.hooks=b,this.method=E,this.url=D}start(b){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},Ve.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(b)}close(){this.unloader&&(Ve.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(b,E){for(;;){var D=this.advanceBuffer(E);if(D)this.emit("chunk",{status:b,data:D});else break}this.isBufferTooLong(E)&&this.emit("buffer_too_long")}advanceBuffer(b){var E=b.slice(this.position),D=E.indexOf(`
`);return D!==-1?(this.position+=D+1,E.slice(0,D)):null}isBufferTooLong(b){return this.position===b.length&&b.length>Ua}}var ys;(function(_){_[_.CONNECTING=0]="CONNECTING",_[_.OPEN=1]="OPEN",_[_.CLOSED=3]="CLOSED"})(ys||(ys={}));var Vr=ys,Po=1;class _f{constructor(b,E){this.hooks=b,this.session=vs(1e3)+"/"+Ba(8),this.location=Af(E),this.readyState=Vr.CONNECTING,this.openStream()}send(b){return this.sendRaw(JSON.stringify([b]))}ping(){this.hooks.sendHeartbeat(this)}close(b,E){this.onClose(b,E,!0)}sendRaw(b){if(this.readyState===Vr.OPEN)try{return Ve.createSocketRequest("POST",or(bs(this.location,this.session))).start(b),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(b,E,D){this.closeStream(),this.readyState=Vr.CLOSED,this.onclose&&this.onclose({code:b,reason:E,wasClean:D})}onChunk(b){if(b.status===200){this.readyState===Vr.OPEN&&this.onActivity();var E,D=b.data.slice(0,1);switch(D){case"o":E=JSON.parse(b.data.slice(1)||"{}"),this.onOpen(E);break;case"a":E=JSON.parse(b.data.slice(1)||"[]");for(var I=0;I<E.length;I++)this.onEvent(E[I]);break;case"m":E=JSON.parse(b.data.slice(1)||"null"),this.onEvent(E);break;case"h":this.hooks.onHeartbeat(this);break;case"c":E=JSON.parse(b.data.slice(1)||"[]"),this.onClose(E[0],E[1],!0);break}}}onOpen(b){this.readyState===Vr.CONNECTING?(b&&b.hostname&&(this.location.base=qo(this.location.base,b.hostname)),this.readyState=Vr.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(b){this.readyState===Vr.OPEN&&this.onmessage&&this.onmessage({data:b})}onActivity(){this.onactivity&&this.onactivity()}onError(b){this.onerror&&this.onerror(b)}openStream(){this.stream=Ve.createSocketRequest("POST",or(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",b=>{this.onChunk(b)}),this.stream.bind("finished",b=>{this.hooks.onFinished(this,b)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(b){me.defer(()=>{this.onError(b),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function Af(_){var b=/([^\?]*)\/*(\??.*)/.exec(_);return{base:b[1],queryString:b[2]}}function bs(_,b){return _.base+"/"+b+"/xhr_send"}function or(_){var b=_.indexOf("?")===-1?"?":"&";return _+b+"t="+ +new Date+"&n="+Po++}function qo(_,b){var E=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(_);return E[1]+b+E[3]}function vs(_){return Ve.randomInt(_)}function Ba(_){for(var b=[],E=0;E<_;E++)b.push(vs(32).toString(32));return b.join("")}var Pa=_f,jc={getReceiveURL:function(_,b){return _.base+"/"+b+"/xhr_streaming"+_.queryString},onHeartbeat:function(_){_.sendRaw("[]")},sendHeartbeat:function(_){_.sendRaw("[]")},onFinished:function(_,b){_.onClose(1006,"Connection interrupted ("+b+")",!1)}},Go=jc,zc={getReceiveURL:function(_,b){return _.base+"/"+b+"/xhr"+_.queryString},onHeartbeat:function(){},sendHeartbeat:function(_){_.sendRaw("[]")},onFinished:function(_,b){b===200?_.reconnect():_.onClose(1006,"Connection interrupted ("+b+")",!1)}},xi=zc,Dr={getRequest:function(_){var b=Ve.getXHRAPI(),E=new b;return E.onreadystatechange=E.onprogress=function(){switch(E.readyState){case 3:E.responseText&&E.responseText.length>0&&_.onChunk(E.status,E.responseText);break;case 4:E.responseText&&E.responseText.length>0&&_.onChunk(E.status,E.responseText),_.emit("finished",E.status),_.close();break}},E},abortRequest:function(_){_.onreadystatechange=null,_.abort()}},Vo=Dr,Ti={createStreamingSocket(_){return this.createSocket(Go,_)},createPollingSocket(_){return this.createSocket(xi,_)},createSocket(_,b){return new Pa(_,b)},createXHR(_,b){return this.createRequest(Vo,_,b)},createRequest(_,b,E){return new Ef(_,b,E)}},Or=Ti;Or.createXDR=function(_,b){return this.createRequest(Hc,_,b)};var Fo=Or,Ss={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:c,DependenciesReceivers:m,getDefaultStrategy:Bo,Transports:Ot,transportConnectionInitializer:za,HTTPFactory:Fo,TimelineTransport:aa,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(_){window.Pusher=_;var b=()=>{this.onDocumentBody(_.ready)};window.JSON?b():y.load("json2",{},b)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:Ce,jsonp:Ln}},onDocumentBody(_){document.body?_():setTimeout(()=>{this.onDocumentBody(_)},0)},createJSONPRequest(_,b){return new xn(_,b)},createScriptRequest(_){return new An(_)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var _=this.getXHRAPI();return new _},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return $t},createWebSocket(_){var b=this.getWebSocketAPI();return new b(_)},createSocketRequest(_,b){if(this.isXHRSupported())return this.HTTPFactory.createXHR(_,b);if(this.isXDRSupported(b.indexOf("https:")===0))return this.HTTPFactory.createXDR(_,b);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var _=this.getXHRAPI();return!!_&&new _().withCredentials!==void 0},isXDRSupported(_){var b=_?"https:":"http:",E=this.getProtocol();return!!window.XDomainRequest&&E===b},addUnloadListener(_){window.addEventListener!==void 0?window.addEventListener("unload",_,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",_)},removeUnloadListener(_){window.addEventListener!==void 0?window.removeEventListener("unload",_,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",_)},randomInt(_){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*_)}},Ve=Ss,qa;(function(_){_[_.ERROR=3]="ERROR",_[_.INFO=6]="INFO",_[_.DEBUG=7]="DEBUG"})(qa||(qa={}));var ca=qa;class Uc{constructor(b,E,D){this.key=b,this.session=E,this.events=[],this.options=D||{},this.sent=0,this.uniqueID=0}log(b,E){b<=this.options.level&&(this.events.push(ae({},E,{timestamp:me.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(b){this.log(ca.ERROR,b)}info(b){this.log(ca.INFO,b)}debug(b){this.log(ca.DEBUG,b)}isEmpty(){return this.events.length===0}send(b,E){var D=ae({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],b(D,(I,ie)=>{I||this.sent++,E&&E(I,ie)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class En{constructor(b,E,D,I){this.name=b,this.priority=E,this.transport=D,this.options=I||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(b,E){if(this.isSupported()){if(this.priority<b)return Fr(new O,E)}else return Fr(new B,E);var D=!1,I=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),ie=null,ye=function(){I.unbind("initialized",ye),I.connect()},Oe=function(){ie=kr.createHandshake(I,function(Bt){D=!0,lt(),E(null,Bt)})},Fe=function(Bt){lt(),E(Bt)},at=function(){lt();var Bt;Bt=Wn(I),E(new L(Bt))},lt=function(){I.unbind("initialized",ye),I.unbind("open",Oe),I.unbind("error",Fe),I.unbind("closed",at)};return I.bind("initialized",ye),I.bind("open",Oe),I.bind("error",Fe),I.bind("closed",at),I.initialize(),{abort:()=>{D||(lt(),ie?ie.close():I.close())},forceMinPriority:Bt=>{D||this.priority<Bt&&(ie?ie.close():I.close())}}}}function Fr(_,b){return me.defer(function(){b(_)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:ws}=Ve;var ki=function(_,b,E,D,I,ie){var ye=ws[E];if(!ye)throw new G(E);var Oe=(!_.enabledTransports||ze(_.enabledTransports,b)!==-1)&&(!_.disabledTransports||ze(_.disabledTransports,b)===-1),Fe;return Oe?(I=Object.assign({ignoreNullOrigin:_.ignoreNullOrigin},I),Fe=new En(b,D,ie?ie.getAssistant(ye):ye,I)):Fe=xf,Fe},xf={isSupported:function(){return!1},connect:function(_,b){var E=me.defer(function(){b(new B)});return{abort:function(){E.ensureAborted()},forceMinPriority:function(){}}}};function Ko(_){if(_==null)throw"You must pass an options object";if(_.cluster==null)throw"Options object must provide a cluster";"disableStats"in _&&bt.warn("The disableStats option is deprecated in favor of enableStats")}const Wo=(_,b)=>{var E="socket_id="+encodeURIComponent(_.socketId);for(var D in b.params)E+="&"+encodeURIComponent(D)+"="+encodeURIComponent(b.params[D]);if(b.paramsProvider!=null){let I=b.paramsProvider();for(var D in I)E+="&"+encodeURIComponent(D)+"="+encodeURIComponent(I[D])}return E};var Es=_=>{if(typeof Ve.getAuthorizers()[_.transport]>"u")throw`'${_.transport}' is not a recognized auth transport`;return(b,E)=>{const D=Wo(b,_);Ve.getAuthorizers()[_.transport](Ve,D,_,A.UserAuthentication,E)}};const Bc=(_,b)=>{var E="socket_id="+encodeURIComponent(_.socketId);E+="&channel_name="+encodeURIComponent(_.channelName);for(var D in b.params)E+="&"+encodeURIComponent(D)+"="+encodeURIComponent(b.params[D]);if(b.paramsProvider!=null){let I=b.paramsProvider();for(var D in I)E+="&"+encodeURIComponent(D)+"="+encodeURIComponent(I[D])}return E};var Tf=_=>{if(typeof Ve.getAuthorizers()[_.transport]>"u")throw`'${_.transport}' is not a recognized auth transport`;return(b,E)=>{const D=Bc(b,_);Ve.getAuthorizers()[_.transport](Ve,D,_,A.ChannelAuthorization,E)}};const kf=(_,b,E)=>{const D={authTransport:b.transport,authEndpoint:b.endpoint,auth:{params:b.params,headers:b.headers}};return(I,ie)=>{const ye=_.channel(I.channelName);E(ye,D).authorize(I.socketId,ie)}};function Yo(_,b){let E={activityTimeout:_.activityTimeout||f.activityTimeout,cluster:_.cluster,httpPath:_.httpPath||f.httpPath,httpPort:_.httpPort||f.httpPort,httpsPort:_.httpsPort||f.httpsPort,pongTimeout:_.pongTimeout||f.pongTimeout,statsHost:_.statsHost||f.stats_host,unavailableTimeout:_.unavailableTimeout||f.unavailableTimeout,wsPath:_.wsPath||f.wsPath,wsPort:_.wsPort||f.wsPort,wssPort:_.wssPort||f.wssPort,enableStats:Mf(_),httpHost:Rf(_),useTLS:Lf(_),wsHost:Df(_),userAuthenticator:Pc(_),channelAuthorizer:Nf(_,b)};return"disabledTransports"in _&&(E.disabledTransports=_.disabledTransports),"enabledTransports"in _&&(E.enabledTransports=_.enabledTransports),"ignoreNullOrigin"in _&&(E.ignoreNullOrigin=_.ignoreNullOrigin),"timelineParams"in _&&(E.timelineParams=_.timelineParams),"nacl"in _&&(E.nacl=_.nacl),E}function Rf(_){return _.httpHost?_.httpHost:_.cluster?`sockjs-${_.cluster}.pusher.com`:f.httpHost}function Df(_){return _.wsHost?_.wsHost:Of(_.cluster)}function Of(_){return`ws-${_}.pusher.com`}function Lf(_){return Ve.getProtocol()==="https:"?!0:_.forceTLS!==!1}function Mf(_){return"enableStats"in _?_.enableStats:"disableStats"in _?!_.disableStats:!1}function Pc(_){const b=Object.assign(Object.assign({},f.userAuthentication),_.userAuthentication);return"customHandler"in b&&b.customHandler!=null?b.customHandler:Es(b)}function $f(_,b){let E;return"channelAuthorization"in _?E=Object.assign(Object.assign({},f.channelAuthorization),_.channelAuthorization):(E={transport:_.authTransport||f.authTransport,endpoint:_.authEndpoint||f.authEndpoint},"auth"in _&&("params"in _.auth&&(E.params=_.auth.params),"headers"in _.auth&&(E.headers=_.auth.headers)),"authorizer"in _&&(E.customHandler=kf(b,E,_.authorizer))),E}function Nf(_,b){const E=$f(_,b);return"customHandler"in E&&E.customHandler!=null?E.customHandler:Tf(E)}class If extends X{constructor(b){super(function(E,D){bt.debug(`No callbacks on watchlist events for ${E}`)}),this.pusher=b,this.bindWatchlistInternalEvent()}handleEvent(b){b.data.events.forEach(E=>{this.emit(E.name,E)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",b=>{var E=b.event;E==="pusher_internal:watchlist_events"&&this.handleEvent(b)})}}function Hf(){let _,b;return{promise:new Promise((D,I)=>{_=D,b=I}),resolve:_,reject:b}}var Xo=Hf;class jf extends X{constructor(b){super(function(E,D){bt.debug("No callbacks on user for "+E)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(E,D)=>{if(E){bt.warn(`Error during signin: ${E}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:D.auth,user_data:D.user_data})},this.pusher=b,this.pusher.connection.bind("state_change",({previous:E,current:D})=>{E!=="connected"&&D==="connected"&&this._signin(),E==="connected"&&D!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new If(b),this.pusher.connection.bind("message",E=>{var D=E.event;D==="pusher:signin_success"&&this._onSigninSuccess(E.data),this.serverToUserChannel&&this.serverToUserChannel.name===E.channel&&this.serverToUserChannel.handleEvent(E)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(b){try{this.user_data=JSON.parse(b.user_data)}catch{bt.error(`Failed parsing user data after signin: ${b.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){bt.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const b=E=>{E.subscriptionPending&&E.subscriptionCancelled?E.reinstateSubscription():!E.subscriptionPending&&this.pusher.connection.state==="connected"&&E.subscribe()};this.serverToUserChannel=new hs(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((E,D)=>{E.indexOf("pusher_internal:")===0||E.indexOf("pusher:")===0||this.emit(E,D)}),b(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:b,resolve:E}=Xo();b.done=!1;const D=()=>{b.done=!0};b.then(D).catch(D),this.signinDonePromise=b,this._signinDoneResolve=E}}class rn{static ready(){rn.isReady=!0;for(var b=0,E=rn.instances.length;b<E;b++)rn.instances[b].connect()}static getClientFeatures(){return Ge(ln({ws:Ve.Transports.ws},function(b){return b.isSupported({})}))}constructor(b,E){qc(b),Ko(E),this.key=b,this.config=Yo(E,this),this.channels=kr.createChannels(),this.global_emitter=new X,this.sessionID=Ve.randomInt(1e9),this.timeline=new Uc(this.key,this.sessionID,{cluster:this.config.cluster,features:rn.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:ca.INFO,version:f.VERSION}),this.config.enableStats&&(this.timelineSender=kr.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Ve.TimelineTransport.name}));var D=I=>Ve.getDefaultStrategy(this.config,I,ki);this.connection=kr.createConnectionManager(this.key,{getStrategy:D,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",I=>{var ie=I.event,ye=ie.indexOf("pusher_internal:")===0;if(I.channel){var Oe=this.channel(I.channel);Oe&&Oe.handleEvent(I)}ye||this.global_emitter.emit(I.event,I.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",I=>{bt.warn(I)}),rn.instances.push(this),this.timeline.info({instances:rn.instances.length}),this.user=new jf(this),rn.isReady&&this.connect()}channel(b){return this.channels.find(b)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var b=this.connection.isUsingTLS(),E=this.timelineSender;this.timelineSenderTimer=new ge(6e4,function(){E.send(b)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(b,E,D){return this.global_emitter.bind(b,E,D),this}unbind(b,E,D){return this.global_emitter.unbind(b,E,D),this}bind_global(b){return this.global_emitter.bind_global(b),this}unbind_global(b){return this.global_emitter.unbind_global(b),this}unbind_all(b){return this.global_emitter.unbind_all(),this}subscribeAll(){var b;for(b in this.channels.channels)this.channels.channels.hasOwnProperty(b)&&this.subscribe(b)}subscribe(b){var E=this.channels.add(b,this);return E.subscriptionPending&&E.subscriptionCancelled?E.reinstateSubscription():!E.subscriptionPending&&this.connection.state==="connected"&&E.subscribe(),E}unsubscribe(b){var E=this.channels.find(b);E&&E.subscriptionPending?E.cancelSubscription():(E=this.channels.remove(b),E&&E.subscribed&&E.unsubscribe())}send_event(b,E,D){return this.connection.send_event(b,E,D)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}rn.instances=[],rn.isReady=!1,rn.logToConsole=!1,rn.Runtime=Ve,rn.ScriptReceivers=Ve.ScriptReceivers,rn.DependenciesReceivers=Ve.DependenciesReceivers,rn.auth_callbacks=Ve.auth_callbacks;var Jo=a.default=rn;function qc(_){if(_==null)throw"You must pass your app key when you instantiate Pusher."}Ve.setup(rn)})])})})(hf)),hf.exports}var w_=S_();const iy=Qr(w_),Ht=ut("WebSocketManager");class C_{constructor(){$(this,"echo",null);$(this,"subscriptions",new Map);$(this,"initialized",!1);$(this,"config",null)}configure(e){if(this.initialized){Ht.warn("[WebSocketManager] 이미 초기화되어 설정을 변경할 수 없습니다.");return}this.config=e,Ht.log("[WebSocketManager] 설정 완료:",{appKey:e.appKey?"***":"(없음)",host:e.host,port:e.port,scheme:e.scheme})}initialize(){if(this.initialized)return;if(!this.config||!this.config.appKey){Ht.warn("[WebSocketManager] WebSocket 설정이 없습니다. initTemplateApp에서 websocket 옵션을 전달해주세요.");return}const{appKey:e,host:r="localhost",port:a=80,scheme:i="https",authEndpoint:l="/api/broadcasting/auth"}=this.config,c=Number(a)||80,d=i==="https";Ht.log("[WebSocketManager] 연결 설정:",{host:r,port:c,scheme:i,useTLS:d,authEndpoint:l}),window.Pusher=iy;const f=localStorage.getItem("auth_token"),g={wsHost:r,wsPort:c,wssPort:c,forceTLS:d,disableStats:!0,enabledTransports:["ws","wss"],cluster:"mt1",authEndpoint:l,auth:{headers:{Authorization:f?`Bearer ${f}`:"",Accept:"application/json"}}};Ht.log("[WebSocketManager] Pusher 옵션:",g);const m=new iy(e,g);m.connection.bind("connecting",()=>{Ht.log("[WebSocketManager] 연결 시도 중...")}),m.connection.bind("connected",()=>{Ht.log("[WebSocketManager] 연결 성공! Socket ID:",m.connection.socket_id)}),m.connection.bind("failed",()=>{Ht.error("[WebSocketManager] 연결 실패 - WebSocket을 사용할 수 없습니다.")}),m.connection.bind("error",y=>{Ht.error("[WebSocketManager] 연결 오류:",y)}),m.connection.bind("state_change",y=>{Ht.log(`[WebSocketManager] 상태 변경: ${y.previous} → ${y.current}`)}),m.connection.bind("unavailable",()=>{Ht.error("[WebSocketManager] WebSocket 사용 불가 - 연결할 수 없습니다.")}),m.connection.bind("disconnected",()=>{Ht.warn("[WebSocketManager] 연결이 끊어졌습니다.")}),Ht.log("[WebSocketManager] 초기 연결 상태:",m.connection.state),this.echo=new v_({broadcaster:"reverb",client:m}),Ht.log("[WebSocketManager] 연결 시작 시도..."),m.connect(),window.Echo=this.echo,this.initialized=!0,Ht.log("[WebSocketManager] Echo 초기화 완료")}subscribe(e,r,a,i={}){if(this.initialize(),!this.echo)return Ht.warn("[WebSocketManager] Echo가 초기화되지 않았습니다."),"";const{channelType:l="private"}=i,c=`${e}:${r}`;if(this.subscriptions.has(c))return Ht.log(`[WebSocketManager] 이미 구독 중: ${c}`),c;let d;switch(l){case"public":d=this.echo.channel(e);break;case"presence":d=this.echo.join(e);break;default:d=this.echo.private(e)}return d.listen(`.${r}`,a),this.subscriptions.set(c,d),Ht.log(`[WebSocketManager] 구독 완료: ${c} (${l})`),c}unsubscribe(e){const r=this.subscriptions.get(e);if(!r)return;const a=e.lastIndexOf(":"),i=a>=0?e.substring(a+1):"";if(i)try{r.stopListening(`.${i}`)}catch(l){Ht.warn(`[WebSocketManager] stopListening 실패: ${e}`,l)}this.subscriptions.delete(e),Ht.log(`[WebSocketManager] 구독 해제: ${e}`)}leaveChannel(e){if(!this.echo)return;this.echo.leave(e);const r=[];this.subscriptions.forEach((a,i)=>{i.startsWith(`${e}:`)&&r.push(i)}),r.forEach(a=>this.subscriptions.delete(a)),Ht.log(`[WebSocketManager] 채널 구독 해제: ${e}`)}disconnect(){this.echo&&(this.echo.disconnect(),this.subscriptions.clear(),this.initialized=!1,Ht.log("[WebSocketManager] 연결 종료"))}getEcho(){return this.echo}isInitialized(){return this.initialized}isConfigured(){return this.config!==null&&!!this.config.appKey}getSubscriptionCount(){return this.subscriptions.size}}const Tc=new C_,gt=ut("DataSourceManager"),sy=new _n;function kc(o,e){const r=Ta(o);if(r!==null)try{return Gn(r)?sy.evaluatePipeExpression(r,e,{skipCache:!0}):sy.evaluateExpression(r,e)}catch(a){return gt.error("Failed to evaluate param expression:",r,a),o}return Zi(o,e,{skipCache:!0})}function oy(o){const e={};for(const r of o.keys()){if(r in e)continue;const a=o.getAll(r);a.length>1?e[r]=a:a.length===1&&(r.endsWith("[]")?e[r]=a:e[r]=a[0])}return e}function E_(){try{return window.G7Core?.devTools}catch{return}}const Lc=class Lc{constructor(e={}){$(this,"options");$(this,"dataCache",new Map);$(this,"bindingEngine");$(this,"globalHeaders",[]);this.options=e,this.bindingEngine=new _n}setGlobalHeaders(e){this.globalHeaders=e||[]}matchesPattern(e,r){if(r==="*")return!0;const a=r.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${a}$`).test(e)}toFormData(e){const r=new FormData;for(const[a,i]of Object.entries(e))i instanceof File||i instanceof Blob?r.append(a,i):i!=null&&r.append(a,typeof i=="object"?JSON.stringify(i):String(i));return r}getMatchingGlobalHeaders(e,r){const a={};for(const i of this.globalHeaders)this.matchesPattern(e,i.pattern)&&Object.entries(i.headers).forEach(([l,c])=>{const d=kc(c,r);d!=null&&d!==""&&(a[l]=String(d))});return a}filterByCondition(e,r={}){const a=new Set,i=[];for(const l of e){if(a.has(l.id))continue;if(!l.if&&!l.conditions){a.add(l.id),i.push(l);continue}Qi({if:l.if,conditions:l.conditions},r,this.bindingEngine,`data_source:${l.id}`)&&(a.add(l.id),i.push(l))}return i}checkErrorCondition(e,r){if(!e.errorCondition?.if||e.errorCondition?.errorCode===void 0)return null;try{const a={response:r};if(Qi({if:e.errorCondition.if},a,this.bindingEngine,`errorCondition:${e.id}`))return gt.log(`errorCondition matched for ${e.id}, triggering error ${e.errorCondition.errorCode}`),e.errorCondition.errorCode}catch(a){gt.error(`Failed to evaluate errorCondition for ${e.id}:`,a)}return null}async fetchDataSources(e,r={},a=new URLSearchParams,i,l){const c={},d=!!this.options.sampleProvider,f=e.filter(g=>(d||g.auto_fetch!==!1)&&g.type!=="websocket");return await Promise.all(f.map(async g=>{try{const m=await this.fetchDataSource(g,r,a,i,l);c[g.id]=m,this.dataCache.set(g.id,{data:m,timestamp:Date.now()});const y=this.checkErrorCondition(g,m);if(y!==null){const w={status:y,message:`Error condition matched for ${g.id}`,data:m},S=Sr(),v=S.resolve(y,{errorHandling:g.errorHandling,onError:g.onError});if(v.handler)try{await S.execute(v.handler,w)}catch(A){gt.error(`Error executing errorCondition handler for ${g.id}:`,A)}g.fallback!==void 0&&(c[g.id]=g.fallback,this.dataCache.set(g.id,{data:g.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${g.id} (errorCondition)`));return}if(g.onSuccess)try{const w={data:m,sourceId:g.id};await this.executeOnSuccessHandler(g.onSuccess,w)}catch(w){gt.error(`Error executing onSuccess handler for ${g.id}:`,w)}}catch(m){gt.error(`Failed to fetch data source: ${g.id}`,m);const y=m?.response?.status||m?.status||500,w=m?.response?.data,S=w?.message||m.message||"Unknown error",v={status:y,message:S,errors:w?.errors,data:w,statusText:m?.response?.statusText},A=Sr(),x=A.resolve(y,{errorHandling:g.errorHandling,onError:g.onError});if(x.handler)try{await A.execute(x.handler,v)}catch(R){gt.error(`Error executing error handler for ${g.id}:`,R)}g.fallback!==void 0&&(c[g.id]=g.fallback,this.dataCache.set(g.id,{data:g.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${g.id}`)),this.options.onError&&this.options.onError(m,g)}})),c}async fetchDataSourcesWithResults(e,r={},a=new URLSearchParams,i,l,c){if(e.some(m=>m.type==="websocket")){const m=e.filter(y=>y.type==="websocket").map(y=>y.id).join(", ");gt.warn(`fetchDataSourcesWithResults received WebSocket sources (caller should filter them out before calling): ${m}. WebSocket sources are event listeners, not data providers — they should not be passed to fetch.`)}const f=c?.ignoreAutoFetch?e.filter(m=>m.type!=="websocket"):e.filter(m=>m.auto_fetch!==!1&&m.type!=="websocket");return await Promise.all(f.map(async m=>{try{const y=await this.fetchDataSource(m,r,a,i,l);this.dataCache.set(m.id,{data:y,timestamp:Date.now()});const w=this.checkErrorCondition(m,y);if(w!==null){const S={status:w,message:`Error condition matched for ${m.id}`,data:y},v=Sr(),A=v.resolve(w,{errorHandling:m.errorHandling,onError:m.onError});let x=!1;if(A.handler)if(m.loading_strategy==="blocking")v.execute(A.handler,S).catch(R=>{gt.error(`Error executing errorCondition handler for ${m.id}:`,R)}),x=!0;else try{await v.execute(A.handler,S),x=!0}catch(R){gt.error(`Error executing errorCondition handler for ${m.id}:`,R)}return m.fallback!==void 0?(this.dataCache.set(m.id,{data:m.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${m.id} (errorCondition)`),{id:m.id,state:"success",data:m.fallback}):{id:m.id,state:"error",error:new Error(`Error condition matched: ${w}`),errorCode:w,errorHandled:x}}if(m.onSuccess)try{const S={data:y,sourceId:m.id};await this.executeOnSuccessHandler(m.onSuccess,S)}catch(S){gt.error(`Error executing onSuccess handler for ${m.id}:`,S)}return{id:m.id,state:"success",data:y}}catch(y){gt.error(`Failed to fetch data source: ${m.id}`,y);const w=y?.response?.status||y?.status||500,S=y?.response?.data,v=S?.message||y.message||"Unknown error",A={status:w,message:v,errors:S?.errors,data:S,statusText:y?.response?.statusText},x=Sr(),R=x.resolve(w,{errorHandling:m.errorHandling,onError:m.onError});let M=!1;if(R.handler)if(m.loading_strategy==="blocking")x.execute(R.handler,A).catch(O=>{gt.error(`Error executing error handler for ${m.id}:`,O)}),M=!0;else try{await x.execute(R.handler,A),M=!0}catch(O){gt.error(`Error executing error handler for ${m.id}:`,O)}return m.fallback!==void 0?(this.dataCache.set(m.id,{data:m.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${m.id}`),{id:m.id,state:"success",data:m.fallback}):(this.options.onError&&this.options.onError(y,m),{id:m.id,state:"error",error:y,errorCode:w,errorHandled:M})}}))}fetchDataSourcesInBackground(e,r={},a=new URLSearchParams,i){e.filter(c=>c.auto_fetch!==!1&&c.loading_strategy==="background"&&c.type!=="websocket").forEach(c=>{this.fetchDataSource(c,r,a).then(async d=>{this.dataCache.set(c.id,{data:d,timestamp:Date.now()});const f=this.checkErrorCondition(c,d);if(f!==null){const g={status:f,message:`Error condition matched for ${c.id}`,data:d},m=Sr(),y=m.resolve(f,{errorHandling:c.errorHandling,onError:c.onError});if(y.handler)try{await m.execute(y.handler,g)}catch(w){gt.error(`Error executing errorCondition handler for ${c.id}:`,w)}c.fallback!==void 0&&(this.dataCache.set(c.id,{data:c.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${c.id} (errorCondition)`),i&&i(c.id,c.fallback));return}if(c.onSuccess)try{const g={data:d,sourceId:c.id};await this.executeOnSuccessHandler(c.onSuccess,g)}catch(g){gt.error(`Error executing onSuccess handler for ${c.id}:`,g)}i&&i(c.id,d)}).catch(async d=>{gt.error(`Background fetch failed: ${c.id}`,d);const f=d?.response?.status||d?.status||500,g=d?.response?.data,m=g?.message||d.message||"Unknown error",y={status:f,message:m,errors:g?.errors,data:g,statusText:d?.response?.statusText},w=Sr(),S=w.resolve(f,{errorHandling:c.errorHandling,onError:c.onError});if(S.handler)try{await w.execute(S.handler,y)}catch(v){gt.error(`Error executing error handler for ${c.id}:`,v)}if(c.fallback!==void 0){this.dataCache.set(c.id,{data:c.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${c.id}`),i&&i(c.id,c.fallback);return}this.options.onError&&this.options.onError(d,c)})})}async fetchDataSource(e,r,a,i,l){switch(e.type){case"api":return this.fetchApiDataSource(e,r,a,i,l);case"static":return e.data;case"route_params":return r;case"query_params":return oy(a);default:throw new Error(`Unknown data source type: ${e.type}`)}}async fetchApiDataSource(e,r,a,i,l){if(this.options.sampleProvider?.has(e.id))return await Promise.resolve(this.options.sampleProvider.resolve(e));if(!e.endpoint)throw new Error(`API data source ${e.id} has no endpoint`);const c={route:r,query:oy(a)};i&&(c._global=i),l&&(c._local=l);let d=Zi(e.endpoint,c,{skipCache:!0});const f=e.method||"GET",m=(e.contentType?typeof e.contentType=="string"&&e.contentType.includes("{{")?Zi(e.contentType,c,{skipCache:!0}):e.contentType:"application/json")==="multipart/form-data";let y=m?{...e.params||{}}:JSON.parse(JSON.stringify(e.params||{}));Object.entries(y).forEach(([v,A])=>{typeof A=="string"&&(y[v]=kc(A,c))}),Object.keys(y).forEach(v=>{y[v]===""&&delete y[v]});const w=E_();let S=null;if(w?.isEnabled()){w.trackDataSourceDefinition({id:e.id,type:e.type,endpoint:d,method:f,autoFetch:e.auto_fetch,initLocal:e.initLocal,initGlobal:e.initGlobal});let v=d;if(f==="GET"&&Object.keys(y).length>0){const A=new URLSearchParams;Object.entries(y).forEach(([R,M])=>{Array.isArray(M)?M.forEach(O=>A.append(R,String(O))):M!=null&&A.append(R,String(M))});const x=A.toString();v=x?`${d}?${x}`:d}S=w.trackRequest(v,f,{requestBody:f!=="GET"?y:void 0,dataSourceId:e.id}),w.trackDataSourceLoading(e.id)}try{let v;const A=e.auth_mode??(e.auth_required===!0?"required":"none"),x=br.getInstance().isAuthenticated();if(A==="required"&&!x){gt.log(`[DataSourceManager] Skipping ${e.id}: auth_mode is 'required' but no token available`),w?.isEnabled()&&(w.trackDataSourceError(e.id,"Skipped: auth_mode required but not authenticated"),S&&w.failRequest(S,"Skipped: not authenticated"));const M=new Error("Auth required but not authenticated");throw M.response={status:401,statusText:"Unauthorized",data:null},M.status=401,M._authSkipped=!0,M}const R=A==="required"||A==="optional"&&x;if(R){const M=jr(),O=d.startsWith("/api/")?d.substring(4):d.startsWith("/api")?d.substring(4)||"/":d;this.options.onError&&gt.log(`[DataSourceManager] Normalized endpoint: ${d} -> ${O}`);const L=this.getMatchingGlobalHeaders(d,c),q={};e.headers&&Object.entries(e.headers).forEach(([fe,Ce])=>{const ke=kc(Ce,c);ke!=null&&ke!==""&&(q[fe]=String(ke))});const G={...L,...q},B=Object.keys(G).length>0,K=m?this.toFormData(y):y;switch(f){case"GET":v=await M.get(O,{params:y,...B&&{headers:G}});break;case"POST":B?v=await M.post(O,K,{headers:G}):v=await M.post(O,K);break;case"PUT":B?v=await M.put(O,K,{headers:G}):v=await M.put(O,K);break;case"PATCH":B?v=await M.patch(O,K,{headers:G}):v=await M.patch(O,K);break;case"DELETE":v=await M.delete(O,{params:y,...B&&{headers:G}});break;default:throw new Error(`Unsupported HTTP method: ${f}`)}}else{let M=d;if(f==="GET"){const K=new URLSearchParams(y).toString();M=K?`${d}?${K}`:d}const O={...m?{}:{"Content-Type":"application/json"},Accept:"application/json"};if(typeof window<"u"){const K=localStorage.getItem("g7_locale");K&&(O["Accept-Language"]=K)}const L=this.getMatchingGlobalHeaders(d,c);Object.assign(O,L),e.headers&&Object.entries(e.headers).forEach(([K,fe])=>{const Ce=kc(fe,c);Ce!=null&&Ce!==""&&(O[K]=String(Ce))});let q;f!=="GET"&&(m?(q=this.toFormData(y),delete O["Content-Type"]):q=JSON.stringify(y));const G=await fetch(M,{method:f,headers:O,body:q});let B;try{B=await G.json()}catch{B=null}if(S&&w?.isEnabled()&&(w.completeRequest(S,G.status,B),S=null),!G.ok){w?.isEnabled()&&w.trackDataSourceError(e.id,`HTTP ${G.status}: ${G.statusText}`);const K=new Error(`HTTP error! status: ${G.status}`);throw K.response={status:G.status,statusText:G.statusText,data:B},K.status=G.status,K}v=B,w?.isEnabled()&&w.trackDataSourceLoaded(e.id,v)}return R&&S&&w?.isEnabled()&&(w.completeRequest(S,200,v),w.trackDataSourceLoaded(e.id,v)),v}catch(v){if(S&&w?.isEnabled()){const A=v;A?.response?w.completeRequest(S,A.response.status,A.response.data):w.failRequest(S,v instanceof Error?v.message:String(v)),w.trackDataSourceError(e.id,v instanceof Error?v.message:String(v))}throw v}}getCachedData(e){const r=this.dataCache.get(e);if(!r)return;if(Date.now()-r.timestamp>Lc.DATA_CACHE_TTL){this.dataCache.delete(e);return}return r.data}clearCache(){this.dataCache.clear()}subscribeWebSockets(e,r,a={}){const i=[],l=e.filter(c=>c.type==="websocket");return l.length===0||l.forEach(c=>{if(!c.channel||!c.event){gt.warn(`WebSocket source ${c.id} missing channel or event`);return}let d,f;try{d=Zi(c.channel,a,{skipCache:!0}),f=Zi(c.event,a,{skipCache:!0})}catch(y){gt.error(`Failed to resolve WebSocket channel/event for source ${c.id}:`,y);return}const g=y=>!!(!y||y.trim()===""||y.includes("{{")||y.endsWith(".")||y.endsWith(":")||y.startsWith(".")||y.startsWith(":")||y.includes("..")||y.includes("::"));if(g(d)||g(f)){gt.warn(`WebSocket source ${c.id} has invalid channel/event after expression resolution, skipping. Original channel="${c.channel}", resolved="${d}". Original event="${c.event}", resolved="${f}". Available context keys: [${Object.keys(a).join(", ")}]`);return}const m=Tc.subscribe(d,f,y=>{const w=c.target_source||c.id;this.dataCache.set(w,{data:y,timestamp:Date.now()}),r(w,y)},{channelType:c.channel_type||"private"});m&&i.push(m)}),i}unsubscribeWebSockets(e){e.length!==0&&e.forEach(r=>{Tc.unsubscribe(r)})}async executeOnSuccessHandler(e,r){const a=this.options.actionDispatcher??am();if(!a){gt.warn("ActionDispatcher not available, skipping onSuccess handler");return}const i=Array.isArray(e)?e:[e];for(const l of i)try{await a.dispatchAction({type:"click",...l},{data:{response:r}})}catch(c){throw gt.error("Failed to execute onSuccess handler:",c),c}}};$(Lc,"DATA_CACHE_TTL",3e5);let _r=Lc;const __=new _r,Si=ut("ModalDataSourceWrapper");function A_(o,e){if(!o||!e)return o;const a=e.replace(/\?\./g,".").split(/\.(?![^\[]*\])/).flatMap(l=>{const c=l.match(/^([^\[]*)((?:\[\d+\])*)$/);if(c){const[,d,f]=c,g=[];d&&g.push(d);const m=f.match(/\[\d+\]/g);return m&&g.push(...m),g}return[l]}).filter(l=>l!=="");let i=o;for(const l of a){if(i==null)return;if(l.startsWith("[")&&l.endsWith("]")){const c=parseInt(l.slice(1,-1),10);i=i[c]}else i=i[l]}return i}const ly=({isOpen:o,modalId:e,dataSources:r,dataContext:a,globalStateUpdater:i,bindingEngine:l,debug:c=!1,children:d})=>{const[f,g]=N.useState(!1),[m,y]=N.useState(!1),w=N.useRef(!1),S=N.useRef(null);S.current||(S.current=new _r);const v=N.useCallback(async()=>{if(!(!r||r.length===0)&&S.current){g(!0);try{const A=a.route||{},x=new URLSearchParams(window.location.search),R=r.map(O=>{let L={...O};if(O.endpoint&&l){const q=l.resolveBindings(O.endpoint,a,{skipCache:!0});L.endpoint=q}if(O.params&&l){const q={};Object.entries(O.params).forEach(([G,B])=>{typeof B=="string"?q[G]=l.resolveBindings(B,a,{skipCache:!0}):q[G]=B}),L.params=q}return L});c&&Si.log(`[ModalDataSourceWrapper] Modal "${e}" fetching data sources:`,R.map(O=>({id:O.id,endpoint:O.endpoint})));const M=await S.current.fetchDataSourcesWithResults(R,A,x);i&&M.forEach(O=>{if(O.state==="success"&&O.data!==void 0){const L=R.find(q=>q.id===O.id);if(L?.initGlobal){const q=O.data?.data??O.data,G=Array.isArray(L.initGlobal)?L.initGlobal:[L.initGlobal];for(const B of G)if(typeof B=="string")i({[B]:q}),c&&Si.log(`[ModalDataSourceWrapper] Modal "${e}" initGlobal: ${O.id}.data -> _global.${B}`);else if(typeof B=="object"&&B.key){const{key:K,path:fe}=B,Ce=fe?A_(q,fe):q;i({[K]:Ce}),c&&Si.log(`Modal "${e}" initGlobal: ${O.id}.data${fe?"."+fe:""} -> _global.${K}`)}}}else O.state==="error"&&Si.error(`Modal "${e}" data source error:`,O.id,O.error)}),c&&Si.log(`Modal "${e}" data sources fetched successfully`)}catch(A){Si.error(`Modal "${e}" data source fetch error:`,A)}finally{g(!1),y(!0)}}},[r,a,i,l,e,c]);return N.useEffect(()=>{if(!r||r.length===0)return;const A=window.__templateApp;return A?.registerModalDataSources&&A.registerModalDataSources(e,r),()=>{A?.unregisterModalDataSources&&A.unregisterModalDataSources(e)}},[e,r]),N.useEffect(()=>{!o&&w.current&&(y(!1),c&&Si.log(`[ModalDataSourceWrapper] Modal "${e}" closed, reset fetch state`)),o&&!w.current&&r&&r.length>0&&!m&&v(),w.current=o},[o,r,m,v,e,c]),dt.jsx(dt.Fragment,{children:d})};class Rc extends Error{constructor(r,a,i={}){super(a);$(this,"code");$(this,"userMessageKey");$(this,"showStack");$(this,"icon");$(this,"recoverable");this.name="TemplateEngineError",this.code=r,this.userMessageKey=a,this.showStack=i.showStack??!0,this.icon=i.icon??"fa-circle-exclamation",this.recoverable=i.recoverable??!0,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}getUserMessage(r,a){if(!a||!r)return this.userMessageKey;try{return a.translate(this.userMessageKey,r)}catch{return this.userMessageKey}}}class x_ extends Rc{constructor(){super("TEMPLATE_NOT_FOUND","$t:core.errors.template_not_found",{showStack:!1,icon:"fa-paint-brush",recoverable:!1}),this.name="TemplateNotFoundError"}}function cy(o){if(o instanceof Rc)return o;if(o instanceof Error){const e=new Rc("TEMPLATE_INIT_ERROR",o.message||"$t:core.errors.template_init_error",{showStack:!0,icon:"fa-circle-exclamation",recoverable:!0});return e.stack=o.stack,e}return new Rc("TEMPLATE_INIT_ERROR","$t:core.errors.template_init_error",{showStack:!1,icon:"fa-circle-exclamation",recoverable:!0})}const T_=ut("ErrorDisplay");class gf{static render(e,r){const a=document.getElementById(e);if(!a){T_.error(`Container #${e} not found`);return}const i=r.debug&&r.showStack&&r.stackTrace,l=window.matchMedia("(prefers-color-scheme: dark)").matches,c={container:`
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background-color: ${l?"#111827":"#f9fafb"};
padding: 1rem;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
`,card:`
max-width: 28rem;
width: 100%;
background-color: ${l?"#1f2937":"#ffffff"};
border-radius: 0.5rem;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
padding: 2rem;
text-align: center;
`,iconContainer:`
margin-bottom: 1.5rem;
`,icon:`
font-size: 4rem;
color: #ef4444;
`,title:`
font-size: 1.5rem;
font-weight: 700;
color: ${l?"#ffffff":"#111827"};
margin-bottom: 1rem;
`,message:`
color: ${l?"#d1d5db":"#4b5563"};
margin-bottom: 0.5rem;
line-height: 1.625;
`,detailMessage:`
font-size: 0.875rem;
color: ${l?"#9ca3af":"#6b7280"};
margin-bottom: 1.5rem;
background-color: ${l?"#374151":"#f3f4f6"};
padding: 0.5rem 0.75rem;
border-radius: 0.25rem;
`,spacer:`
margin-bottom: 1.5rem;
`,stackContainer:`
margin-top: 1.5rem;
padding: 1rem;
background-color: ${l?"#374151":"#f3f4f6"};
border-radius: 0.375rem;
text-align: left;
`,stackTitle:`
font-size: 0.875rem;
font-weight: 600;
color: ${l?"#e5e7eb":"#374151"};
margin-bottom: 0.5rem;
`,stackTrace:`
font-size: 0.75rem;
color: ${l?"#d1d5db":"#4b5563"};
overflow-x: auto;
white-space: pre-wrap;
word-break: break-word;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
`,buttonContainer:`
margin-top: 1.5rem;
`,button:`
display: inline-flex;
align-items: center;
padding: 0.75rem 1.5rem;
background-color: #2563eb;
color: #ffffff;
font-weight: 500;
border-radius: 0.375rem;
border: none;
cursor: pointer;
transition: background-color 0.2s;
`};a.innerHTML=`
<div style="${c.container}">
<div style="${c.card}">
<!-- 아이콘 -->
<div style="${c.iconContainer}">
<i class="fa-solid ${r.icon}" style="${c.icon}"></i>
</div>
<!-- 제목 -->
<h1 style="${c.title}">
${this.escapeHtml(r.title)}
</h1>
<!-- 사용자 메시지 -->
<p style="${c.message}">
${this.escapeHtml(r.message)}
</p>
<!-- 상세 메시지 (API 응답 등) -->
${r.detailMessage?`
<p style="${c.detailMessage}">
${this.escapeHtml(r.detailMessage)}
</p>
`:`<div style="${c.spacer}"></div>`}
<!-- Stack Trace (디버그 모드일 때만) -->
${i?`
<div style="${c.stackContainer}">
<p style="${c.stackTitle}">
Stack Trace:
</p>
<pre style="${c.stackTrace}">${this.escapeHtml(r.stackTrace)}</pre>
</div>
`:""}
<!-- 새로고침 버튼 (복구 가능할 때만) -->
${r.showReloadButton?`
<div style="${c.buttonContainer}">
<button
onclick="window.location.reload()"
style="${c.button}"
onmouseover="this.style.backgroundColor='#1d4ed8'"
onmouseout="this.style.backgroundColor='#2563eb'"
>
<i class="fa-solid fa-rotate-right" style="margin-right: 0.5rem;"></i>
새로고침
</button>
</div>
`:""}
</div>
</div>
`}static renderFromError(e,r,a,i=!1,l,c,d){let f,g;if(r.userMessageKey.startsWith("$t:"))if(c&&l)try{f=c.translate(r.userMessageKey,l)}catch{f=r.userMessageKey.replace("$t:","")}else f=r.userMessageKey.replace("$t:","");else f=r.userMessageKey;if(d){const m=d;m.details?.apiMessage?g=m.details.apiMessage:m.response?.data?.message&&(g=m.response.data.message)}this.render(e,{title:a,message:f,detailMessage:g,icon:r.icon,showStack:r.showStack,stackTrace:r.stack,showReloadButton:r.recoverable,debug:i})}static escapeHtml(e){if(!e)return"";const r=document.createElement("div");return r.textContent=e,r.innerHTML}}const cs=ut("Router");class k_{constructor(e){$(this,"routes",[]);$(this,"templateIdentifier");$(this,"eventHandlers",new Map);$(this,"pendingNavigation",null);$(this,"isNavigating",!1);$(this,"handlePopState",()=>{this.navigateToCurrentPath()});this.templateIdentifier=e,this.initPopstateListener()}initPopstateListener(){window.addEventListener("popstate",this.handlePopState)}on(e,r){this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e).push(r)}async emit(e,...r){const a=this.eventHandlers.get(e);a&&await Promise.all(a.map(i=>i(...r)))}async loadRoutes(e){try{const r=e!==void 0&&e>0?e:null,a=await fetch(Nr(`/api/templates/${this.templateIdentifier}/routes`,"json",r));if(!a.ok)throw new Error(`Failed to load routes: ${a.statusText}`);const i=await a.json();if(!i.success)throw new Error("Failed to load routes from API");if(i.data&&Array.isArray(i.data.routes))this.routes=i.data.routes,cs.log(`Loaded ${this.routes.length} routes${e?` (v=${e})`:""}`);else throw new Error("Invalid routes data format")}catch(r){throw cs.error("Error loading routes:",r),r}}setRoutes(e){this.routes=e,cs.log(`Set ${this.routes.length} routes`)}match(e){const r=this.normalizePathname(e);for(const a of this.routes){const i=this.matchPattern(a.path,r);if(i!==null)return{route:a,params:i}}return null}normalizePathname(e){return e.length>1&&e.endsWith("/")?e.replace(/\/+$/,"")||"/":e}matchPattern(e,r){const a=[];let i=e.replace(/:([^/]+)/g,(f,g)=>(a.push(g),"([^/]+)"));i.startsWith("*/")&&(i="(?:/[^/]+)?"+i.slice(1)),i=i.replace(/\//g,"\\/");const l=new RegExp(`^${i}$`),c=r.match(l);if(!c)return null;const d={};return a.forEach((f,g)=>{d[f]=c[g+1]}),d}getRoutes(){return[...this.routes]}getAuthType(e,r){return e.auth_type?e.auth_type:r.startsWith("/admin")?"admin":"user"}async navigateToCurrentPath(){const e=window.location.pathname,r=window.location.search,a=this.match(e);if(!a){cs.warn(`No route matched for path: ${e}`),this.emit("routeNotFound",e);return}if(a.route.redirect){cs.log(`Redirecting from ${e} to ${a.route.redirect}`),this.navigate(a.route.redirect);return}if(a.route.auth_required){const c=this.getAuthType(a.route,e),d=br.getInstance();let f=d.isAuthenticated()&&d.getAuthType()===c;if(f||(f=await d.checkAuth(c)),!f){const g=d.getLoginRedirectUrl(c,e+r);cs.log(`Not authenticated, redirecting to: ${g}`),window.location.href=g;return}}const i=new URLSearchParams(r),l={};for(const c of i.keys()){if(c in l)continue;const d=i.getAll(c);d.length>1?l[c]=d:d.length===1&&(c.endsWith("[]")?l[c]=d:l[c]=d[0])}await this.emit("routeChange",{path:e,layout:a.route.layout,endpoint:a.route.endpoint,params:{...a.route.params||{},...a.params},query:l,auth_required:a.route.auth_required,auth_type:a.route.auth_type,meta:a.route.meta})}navigate(e){if(this.isNavigating){this.pendingNavigation=e;return}this.executeNavigation(e)}async executeNavigation(e){this.isNavigating=!0,this.pendingNavigation=null;try{window.history.pushState({},"",e),await this.navigateToCurrentPath()}finally{if(this.isNavigating=!1,this.pendingNavigation){const r=this.pendingNavigation;this.executeNavigation(r)}}}}const R_=/^\/admin\/layout-editor\/([^/?#]+)\/?$/;function uy(o){const e=R_.exec(o);return e?{templateIdentifier:e[1]}:null}const jt=ut("ErrorPageHandler");class D_{constructor(e){$(this,"templateId");$(this,"layoutLoader");$(this,"locale");$(this,"debug");$(this,"renderFunction");$(this,"dataSourceManager");$(this,"globalState");$(this,"errorConfig",null);$(this,"configLoaded",!1);this.templateId=e.templateId,this.layoutLoader=e.layoutLoader,this.locale=e.locale,this.debug=e.debug,this.renderFunction=e.renderFunction,this.dataSourceManager=e.dataSourceManager,this.globalState=e.globalState||{}}async loadConfig(){if(this.configLoaded)return this.errorConfig;try{const e=await fetch(Nr(`/api/templates/${this.templateId}/config`,"json"));if(!e.ok)return this.debug&&jt.warn("Failed to load template config:",e.statusText),this.configLoaded=!0,null;const r=await e.json();if(!r.success||!r.data)return this.debug&&jt.warn("Invalid template config response"),this.configLoaded=!0,null;const a=r.data;return!a.error_config||!a.error_config.layouts?(this.debug&&jt.warn("No error_config found in template.json"),this.configLoaded=!0,null):(this.errorConfig=a.error_config,this.configLoaded=!0,this.debug&&jt.log("Error config loaded:",this.errorConfig),this.errorConfig)}catch(e){return jt.error("Failed to load error config:",e),this.configLoaded=!0,null}}async renderError(e,r="app"){try{const a=await this.loadConfig();if(!a)return this.debug&&jt.warn("No error config available, cannot render error page"),!1;const i=a.layouts[e]||a.layouts[String(e)];if(!i)return this.debug&&jt.warn(`No layout defined for error code: ${e}`),!1;this.debug&&jt.log(`Loading error layout: ${i} for code: ${e}`);const l=await this.layoutLoader.loadLayout(this.templateId,i);if(!l)return this.debug&&jt.error(`Failed to load error layout: ${i}`),!1;this.debug&&jt.log("Error layout loaded:",l);let c={};const d=l.data_sources||[];if(d.length>0){this.debug&&jt.log("Fetching data sources:",d.map(S=>S.id));const m=d.filter(S=>S.loading_strategy==="blocking"),y=d.filter(S=>!S.loading_strategy||S.loading_strategy==="progressive"),w=[...m,...y];if(w.length>0)try{c=await this.dataSourceManager.fetchDataSources(w,{},new URLSearchParams),this.debug&&jt.log("Data sources fetched:",Object.keys(c))}catch(S){jt.error("Failed to fetch data sources:",S)}}const f={};d.length>0&&(this.processInitOptions(d,c,f),this.debug&&jt.log("initOptions processed:",{globalKeys:Object.keys(this.globalState),localKeys:Object.keys(f)}));const g={...c,errorCode:e,_global:{...this.globalState},_local:{...f}};return await this.renderFunction({containerId:r,layoutJson:l,dataContext:g,translationContext:{templateId:this.templateId,locale:this.locale}}),this.debug&&jt.log(`Error page ${e} rendered successfully`),!0}catch(a){return jt.error(`Failed to render error page ${e}:`,a),!1}}processInitOptions(e,r,a){for(const i of e){const l=r[i.id];if(!l)continue;const c=l?.data??l;if(i.initLocal){if(typeof i.initLocal=="string")a[i.initLocal]=c,jt.log(`initLocal: ${i.id}.data -> _local.${i.initLocal}`);else if(typeof i.initLocal=="object"&&"key"in i.initLocal){const{key:d,path:f}=i.initLocal;a[d]=f?this.getValueByPath(c,f):c,jt.log(`initLocal: ${i.id}.data${f?"."+f:""} -> _local.${d}`)}}if(i.initGlobal){const d=Array.isArray(i.initGlobal)?i.initGlobal:[i.initGlobal];for(const f of d)if(typeof f=="string")this.globalState[f]=c,jt.log(`initGlobal: ${i.id}.data -> _global.${f}`);else if(typeof f=="object"&&f!==null&&"key"in f){const{key:g,path:m}=f;this.globalState[g]=m?this.getValueByPath(c,m):c,jt.log(`initGlobal: ${i.id}.data${m?"."+m:""} -> _global.${g}`)}}}}getValueByPath(e,r){return r.split(".").reduce((a,i)=>a?.[i],e)}updateGlobalState(e){this.globalState={...this.globalState,...e}}updateLocale(e){this.locale=e,this.debug&&jt.log("Locale updated:",e)}isConfigLoaded(){return this.configLoaded}async hasErrorLayout(e){const r=await this.loadConfig();return r?!!(r.layouts[e]||r.layouts[String(e)]):!1}clearConfigCache(){this.errorConfig=null,this.configLoaded=!1,this.debug&&jt.log("Config cache cleared")}}const Mt=ut("ModuleAssetLoader");class O_{constructor(){$(this,"loadedAssets",new Map);$(this,"loadingPromises",new Map);$(this,"failedJsAssets",new Set)}hasFailedJsAssets(){return this.failedJsAssets.size>0}getFailedJsAssets(){return[...this.failedJsAssets]}async loadActiveExtensionAssets(e){if(!e||e.length===0){Mt.log("No module assets to load");return}const r=[...e].sort((d,f)=>d.priority-f.priority);Mt.log("Loading module assets:",r.map(d=>d.identifier));const a=r.filter(d=>d.css).map(d=>this.loadCSS(d.identifier,d.css)),i=r.filter(d=>d.js).map(d=>this.loadJS(d.identifier,d.js)),l=await Promise.allSettled([...a,...i]),c=l.filter(d=>d.status==="rejected");if(c.length>0){Mt.warn(`Some module assets failed to load (${c.length}/${l.length}); continuing with the rest`,this.getFailedJsAssets());return}Mt.log("All module assets loaded successfully")}async loadBundle(e,r,a){const i=[];if(a&&i.push(this.loadBundleCss(e,a)),r&&i.push(this.loadBundleJs(e,r)),i.length===0){Mt.log(`No bundle assets to load for: ${e}`);return}await Promise.all(i)}async loadBundleCss(e,r){const a=`ext-bundle-css-${e}`;if(document.getElementById(a)){Mt.log(`Bundle CSS already loaded: ${e}`);return}return new Promise(i=>{const l=document.createElement("link");l.rel="stylesheet",l.href=r,l.id=a,l.onload=()=>{Mt.log(`Bundle CSS loaded: ${e}`),this.registerLoadedAsset(`bundle-${e}`,{type:"css",element:l}),i()},l.onerror=()=>{Mt.warn(`Failed to load bundle CSS: ${e} (${r})`),i()},document.head.appendChild(l)})}async loadBundleJs(e,r){const a=`ext-bundle-js-${e}`;if(document.getElementById(a)){Mt.log(`Bundle JS already loaded: ${e}`);return}const i=this.loadingPromises.get(a);if(i)return Mt.log(`Bundle JS already loading: ${e}`),i;const l=Yg(r,{id:a},{label:`bundle JS: ${e}`}).then(()=>{Mt.log(`Bundle JS loaded: ${e}`);const c=document.getElementById(a);c&&this.registerLoadedAsset(`bundle-${e}`,{type:"js",element:c}),this.loadingPromises.delete(a)}).catch(c=>{throw Mt.warn(`Failed to load bundle JS: ${e} (${r})`,c),this.failedJsAssets.add(e),this.loadingPromises.delete(a),c});return this.loadingPromises.set(a,l),l}async loadCSS(e,r){const a=`module-css-${e}`;if(document.getElementById(a)){Mt.log(`CSS already loaded: ${e}`);return}return new Promise((i,l)=>{const c=document.createElement("link");c.rel="stylesheet",c.href=r,c.id=a,c.onload=()=>{Mt.log(`CSS loaded: ${e}`),this.registerLoadedAsset(e,{type:"css",element:c}),i()},c.onerror=()=>{Mt.warn(`Failed to load CSS: ${e} (${r})`),i()},document.head.appendChild(c)})}async loadJS(e,r){const a=`module-js-${e}`;if(document.getElementById(a)){Mt.log(`JS already loaded: ${e}`);return}const i=this.loadingPromises.get(e);if(i)return Mt.log(`JS already loading: ${e}`),i;const l=Yg(r,{id:a},{label:`JS: ${e}`}).then(()=>{Mt.log(`JS loaded: ${e}`);const c=document.getElementById(a);c&&this.registerLoadedAsset(e,{type:"js",element:c}),this.loadingPromises.delete(e)}).catch(c=>{throw Mt.warn(`Failed to load JS: ${e} (${r})`,c),this.failedJsAssets.add(e),this.loadingPromises.delete(e),c});return this.loadingPromises.set(e,l),l}registerLoadedAsset(e,r){const a=this.loadedAssets.get(e)||[];a.push(r),this.loadedAssets.set(e,a)}unloadExtensionAsset(e){const r=this.loadedAssets.get(e);if(!r||r.length===0){Mt.log(`No assets to unload for: ${e}`);return}r.forEach(a=>{a.element.parentNode&&(a.element.parentNode.removeChild(a.element),Mt.log(`${a.type.toUpperCase()} unloaded: ${e}`))}),this.loadedAssets.delete(e),Mt.log(`All assets unloaded for: ${e}`)}unloadAllAssets(){Array.from(this.loadedAssets.keys()).forEach(r=>{this.unloadExtensionAsset(r)}),Mt.log("All module assets unloaded")}isLoaded(e){return this.loadedAssets.has(e)}getLoadedModules(){return Array.from(this.loadedAssets.keys())}}let pf=null;function mf(){return pf||(pf=new O_),pf}function L_(){if(typeof window>"u")return[];const o=window.G7Config;if(!o?.moduleAssets)return[];const e=[];for(const[r,a]of Object.entries(o.moduleAssets)){const i=a;e.push({identifier:r,js:i.js?xa(i.js):i.js,css:i.css?xa(i.css):i.css,priority:i.priority,external:i.external})}return e}function M_(){if(typeof window>"u")return null;const o=window.G7Config;if(!o?.bundleUrls)return null;const e=o.bundleUrls;return{moduleJs:e.moduleJs?xa(e.moduleJs):e.moduleJs,moduleCss:e.moduleCss?xa(e.moduleCss):e.moduleCss,pluginJs:e.pluginJs?xa(e.pluginJs):e.pluginJs,pluginCss:e.pluginCss?xa(e.pluginCss):e.pluginCss}}function $_(){if(typeof window>"u")return[];const o=window.G7Config;if(!o?.pluginAssets)return[];const e=[];for(const[r,a]of Object.entries(o.pluginAssets)){const i=a;e.push({identifier:r,js:i.js?xa(i.js):i.js,css:i.css?xa(i.css):i.css,priority:i.priority,external:i.external})}return e}const yf=ut("SystemBannerManager");class Dc{static show(e){this.banners.set(e.id,e),this.render(),yf.log(`Banner shown: ${e.id}`)}static hide(e){this.banners.delete(e)&&(this.render(),yf.log(`Banner hidden: ${e}`))}static hideAll(){this.banners.clear(),this.render(),yf.log("All banners hidden")}static detectLocale(){try{const r=window.G7Core;if(r?.locale?.current)return r.locale.current()}catch{}return(navigator.language||"ko").split("-")[0]}static resolveMessage(e,r){return typeof e=="string"?e:e[r]||e.en||e.ko||Object.values(e)[0]||""}static render(){if(typeof document>"u")return;let e=document.getElementById(this.containerId);if(this.banners.size===0){e&&(e.remove(),this.adjustAppPadding(0));return}e||(e=document.createElement("div"),e.id=this.containerId,e.style.cssText="position:fixed;top:0;left:0;right:0;z-index:99999;",document.body.prepend(e));const r=Array.from(this.banners.values()).sort((i,l)=>(i.order??0)-(l.order??0)),a=this.detectLocale();e.innerHTML=r.map(i=>{const l=this.resolveMessage(i.message,a),c=i.background||"#f59e0b",d=i.color||"white";return`<div data-banner-id="${i.id}" style="background:${c};color:${d};text-align:center;padding:8px 16px;font-size:14px;font-weight:500;">${l}</div>`}).join(""),requestAnimationFrame(()=>{e&&this.adjustAppPadding(e.offsetHeight)})}static adjustAppPadding(e){const r=document.getElementById("app");r&&(r.style.paddingTop=e>0?`${e}px`:"")}}$(Dc,"banners",new Map),$(Dc,"containerId","g7-system-banners");const U=ut("TemplateApp");function dy(o){const e={};for(const r of o.keys()){if(r in e)continue;const a=o.getAll(r);a.length>1?e[r]=a:a.length===1&&(r.endsWith("[]")?e[r]=a:e[r]=a[0])}return e}const xr=class xr{constructor(e){$(this,"router",null);$(this,"layoutLoader",null);$(this,"errorPageHandler",null);$(this,"config");$(this,"globalState");$(this,"globalStateListeners",new Set);$(this,"currentRouteChangeId",0);$(this,"currentDataSources",[]);$(this,"currentRawDataSources",[]);$(this,"currentRouteParams",{});$(this,"currentQueryParams",new URLSearchParams);$(this,"currentFetchedData",{});$(this,"currentLayoutName","");$(this,"templateErrorHandling",null);$(this,"currentWebSocketSubscriptions",[]);$(this,"extensionCacheVersion",0);$(this,"currentGlobalHeaders",[]);$(this,"transitionOverlayEl",null);$(this,"skeletonOverlayRoot",null);$(this,"skeletonOverlayContainer",null);$(this,"_spinnerState",null);$(this,"modalDataSources",new Map);this.globalState={sidebarOpen:!1},this.loadG7Config(),this.migrateLocaleStorage();const r=this.loadLocaleFromStorage(),a=r||e.locale||"ko";this.config={...e,locale:a},!r&&e.locale&&this.saveLocaleToStorage(e.locale)}loadG7Config(){if(typeof window<"u"&&window.G7Config){const e=window.G7Config;e.settings&&(this.globalState.settings=e.settings,U.log("Loaded settings from G7Config:",Object.keys(e.settings)),e.settings.upload&&(this.globalState.uploadSettings=e.settings.upload)),e.plugins&&(this.globalState.plugins=e.plugins,U.log("Loaded plugin settings from G7Config:",Object.keys(e.plugins))),e.modules&&(this.globalState.modules=e.modules,U.log("Loaded module settings from G7Config:",Object.keys(e.modules))),e.appConfig&&(this.globalState.appConfig=e.appConfig,U.log("Loaded appConfig from G7Config:",Object.keys(e.appConfig)))}}resolveRouteExpressions(e){const r=new _n,a={_global:this.globalState};return e.map(i=>{const l={...i};if(l.path&&l.path.includes("{{")){const c=l.path;l.path=r.resolveBindings(l.path,a),l.path=l.path.replace(/\/\/+/g,"/")||"/",l.path.includes("{{")&&(U.warn("Route expression resolution failed, using fallback:",c),l.path=c.replace(/\{\{[^}]+\}\}/g,"").replace(/\/\/+/g,"/")||"/")}if(l.redirect&&l.redirect.includes("{{")){const c=l.redirect;l.redirect=r.resolveBindings(l.redirect,a),l.redirect=l.redirect.replace(/\/\/+/g,"/")||"/",l.redirect.includes("{{")&&(U.warn("Route redirect expression resolution failed:",c),l.redirect=c.replace(/\{\{[^}]+\}\}/g,"").replace(/\/\/+/g,"/")||"/")}return l})}migrateLocaleStorage(){const e=["locale","g7_template_locale"];for(const r of e)try{const a=localStorage.getItem(r);a&&a!==localStorage.getItem(xr.LOCALE_STORAGE_KEY)&&(localStorage.setItem(xr.LOCALE_STORAGE_KEY,a),U.log(`Migrated locale from '${r}' to '${xr.LOCALE_STORAGE_KEY}'`)),localStorage.removeItem(r)}catch(a){U.warn(`Failed to migrate locale key '${r}':`,a)}}async init(){try{eo.getInstance().setDebug(this.config.debug),U.log("Initializing with config:",this.config),GS();const e=mr.getInstance(),r=br.getInstance(),a=this.loadCacheVersionFromStorage()||0,[i,l,c,d,f]=await Promise.all([Lo({templateId:this.config.templateId,templateType:this.config.templateType,locale:this.config.locale,debug:this.config.debug,cacheVersion:a}),e.loadComponents(this.config.templateId,this.config.templateType),Bl(Nr(`/api/templates/${this.config.templateId}/routes`,"json",a>0?a:null),{label:"routes.json"}).then(A=>{if(!A.ok)throw new Error(`Failed to load routes: ${A.statusText}`);return A.json()}).then(A=>{if(!A.success)throw new Error("Failed to load routes from API");return A.data}).catch(A=>{throw U.error("Error loading routes:",A),A}),r.preloadAuth(this.config.templateType==="admin"?"admin":"user"),fetch(Nr(`/api/templates/${this.config.templateId}/config`,"json")).then(A=>A.ok?A.json():null).then(A=>!A?.success||!A?.data?null:A.data).catch(A=>(U.warn("Error loading template config:",A),null))]);if(U.log("Template Engine initialized"),U.log("ComponentRegistry loaded"),U.log("Routes data loaded"),U.log("User info preloaded"),U.log("Template config loaded:",f),f?.cache_version!==void 0){const A=this.loadCacheVersionFromStorage();if(this.extensionCacheVersion=f.cache_version,this.saveCacheVersionToStorage(this.extensionCacheVersion),U.log("Extension cache version:",this.extensionCacheVersion),A!==null&&A!==this.extensionCacheVersion){U.log("Cache version changed, reloading routes...");const x=await Bl(Nr(`/api/templates/${this.config.templateId}/routes`,"json",this.extensionCacheVersion),{label:"routes.json (reload)"}).then(R=>{if(!R.ok)throw new Error(`Failed to reload routes: ${R.statusText}`);return R.json()}).then(R=>{if(!R.success)throw new Error("Failed to reload routes from API");return R.data});Array.isArray(x.routes)&&(x.routes=this.resolveRouteExpressions(x.routes),Object.assign(c,x),U.log("Routes reloaded with new cache version"));try{const{TranslationEngine:R}=await Promise.resolve().then(()=>ep),M=R.getInstance();M.setCacheVersion(this.extensionCacheVersion);const O=this.config.locale||"ko",L="en";await M.loadTranslations(this.config.templateId,O,"/api",!0),O!==L&&await M.loadTranslations(this.config.templateId,L,"/api",!0),U.log("Translations reloaded with new cache version")}catch(R){U.error("Failed to reload translations:",R)}}}f?.errorHandling&&(this.templateErrorHandling=f.errorHandling,Sr().setTemplateConfig(this.templateErrorHandling),U.log("Template errorHandling registered:",this.templateErrorHandling)),r.on("logout",()=>{U.log("User logged out")}),r.on("authStateChange",A=>{U.log("Auth state changed:",A)}),U.log("AuthManager event handlers registered");const g=jr(),m=this.config.templateType==="admin"?"admin":"user",y=r.getConfig(m);g.setOnUnauthorized(()=>{U.log("Unauthorized - redirecting to login page"),g.removeToken();const A=window.location.pathname+window.location.search,x=r.getLoginRedirectUrl(m,A,"session_expired");window.location.href=x}),U.log("ApiClient onUnauthorized callback registered"),this.layoutLoader=new of(e),this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),U.log("LayoutLoader initialized:",this.layoutLoader);const w=new _r({onUnauthorized:()=>{U.warn("Unauthorized request in error page")}});if(this.errorPageHandler=new D_({templateId:this.config.templateId,layoutLoader:this.layoutLoader,locale:this.config.locale,debug:this.config.debug,renderFunction:us,dataSourceManager:w,globalState:this.globalState}),U.log("ErrorPageHandler initialized with DataSourceManager"),await this.handleServerError()){U.log("Server error handled, skipping normal initialization");return}if(this.router=new k_(this.config.templateId),Array.isArray(c.routes)){const A=this.resolveRouteExpressions(c.routes);this.router.setRoutes(A)}else throw new Error("Invalid routes data format");U.log("Router initialized:",this.router),U.log("Routes set:",this.router.getRoutes());const{getActionDispatcher:S}=await Promise.resolve().then(()=>Pr),v=S();if(v&&(v.setDefaultContext({navigate:A=>this.router?.navigate(A)}),v.setGlobalStateUpdater((A,x)=>this.setGlobalState(A,x)),U.log("Navigate function and setGlobalState injected to ActionDispatcher")),await this.loadExtensionAssets(),this.reinitializeTemplateHandlers(),this.router.on("routeChange",A=>this.handleRouteChange(A)),this.router.on("routeNotFound",A=>this.handleRouteNotFound(A)),typeof window<"u"&&uy(window.location.pathname)){U.log("Layout editor mode detected — skipping router match"),await us({containerId:"app",layoutJson:{components:[]},dataContext:{},translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),U.log("Template App initialized in layout editor mode");return}this.router.navigateToCurrentPath(),U.log("Template App initialized successfully")}catch(e){U.error("Initialization failed:",e),this.showInitError(e)}}async loadExtensionAssets(){try{const e=mf(),r=M_();if(!r){await this.loadExtensionAssetsIndividually();return}await e.loadBundle("module",r.moduleJs,r.moduleCss),await e.loadBundle("plugin",r.pluginJs,r.pluginCss),U.log("Extension bundle assets loaded successfully")}catch(e){U.warn("Failed to load extension assets:",e)}}async loadExtensionAssetsIndividually(){const e=mf(),r=L_();r.length>0&&(U.log("Loading module assets (individual fallback):",r.map(i=>i.identifier)),await e.loadActiveExtensionAssets(r));const a=$_();a.length>0&&(U.log("Loading plugin assets (individual fallback):",a.map(i=>i.identifier)),await e.loadActiveExtensionAssets(a))}async handleRouteChange(e){const r=++this.currentRouteChangeId;window.__g7ForcedLocalFields=void 0,window.__g7ActionContext=void 0,window.__g7PendingLocalState=void 0,window.__g7LastSetLocalSnapshot=void 0,window.__g7SetLocalOverrideKeys=void 0,window.__g7SequenceLocalSync=void 0,window.__g7AutoBindingPaths=new Map;try{if(U.log("Route changed:",e,"requestId:",r),!this.layoutLoader)throw new Error("LayoutLoader is not initialized");if(!e.layout)throw new Error("Route layout is not defined");let a=e.layout;const i=a==="__preview__";i&&e.params?.token&&(a=`__preview__/${e.params.token}`);const l=await this.layoutLoader.loadLayout(this.config.templateId,a);if(r!==this.currentRouteChangeId){U.log("Route change cancelled (newer request exists):",r);return}U.log("Layout loaded:",l);const c=Sr();l.errorHandling?(c.setLayoutConfig(l.errorHandling),U.log("Layout errorHandling registered:",l.errorHandling)):c.clearLayoutConfig();const d=l.data_sources||[],f=e.query||{},g=new URLSearchParams;for(const[Z,pe]of Object.entries(f))if(Array.isArray(pe))for(const H of pe)g.append(Z,H);else g.set(Z,pe);const m={route:e.params||{},query:f,_global:this.globalState};l.scripts&&Array.isArray(l.scripts)&&await this.loadLayoutScripts(l.scripts,m);const{DataSourceManager:y,getActionDispatcher:w}=await Promise.resolve().then(()=>Pr),S=new y;if(i){const Z=w();Z&&Z.setPreviewMode(!0),this.setGlobalState({__isPreview:!0}),Dc.show({id:"preview-mode",message:{ko:"⚠ 미리보기 모드 — 페이지 이동이 비활성화됩니다",en:"⚠ Preview Mode — Navigation is disabled"},background:"linear-gradient(90deg, #f59e0b, #d97706)",color:"white"}),U.log("Preview mode activated")}else{const Z=w();Z?.isPreviewMode()&&(Z.setPreviewMode(!1),Dc.hide("preview-mode"))}if(this.currentGlobalHeaders=l.globalHeaders||[],this.currentGlobalHeaders.length>0){S.setGlobalHeaders(this.currentGlobalHeaders);const Z=w();Z&&Z.setGlobalHeaders(this.currentGlobalHeaders),U.log("globalHeaders set:",this.currentGlobalHeaders.map(pe=>pe.pattern))}if(l.named_actions&&Object.keys(l.named_actions).length>0){const Z=w();Z&&Z.setNamedActions(l.named_actions)}const v=S.filterByCondition(d,m);d.length!==v.length&&U.log("Data sources filtered by condition:",{before:d.map(Z=>Z.id),after:v.map(Z=>Z.id)});const A=v.filter(Z=>Z.loading_strategy==="blocking"),x=v.filter(Z=>(Z.loading_strategy||"progressive")!=="blocking"&&Z.type!=="websocket"),R=Array.isArray(l.transition_overlay?.wait_for)?l.transition_overlay.wait_for:[],M=R.length>0&&v.some(Z=>R.includes(Z.id)&&Z.type!=="websocket"&&(Z.loading_strategy||"progressive")!=="background");if((A.length>0||M)&&l.transition_overlay){const Z=typeof l.transition_overlay=="boolean"?{enabled:l.transition_overlay,style:"opaque"}:l.transition_overlay;Z.enabled&&Z.style==="skeleton"&&Z.skeleton?.component&&Z.target?this.renderSkeletonOverlay(Z.target,Z.skeleton,l,Z.fallback_target):Z.enabled&&Z.style==="spinner"&&Z.target&&this.renderSpinnerOverlay(Z.target,Z.spinner,Z.fallback_target)}let O={},L={},q={},G={};this.currentWebSocketSubscriptions.length>0&&(U.log("Unsubscribing previous WebSocket subscriptions:",this.currentWebSocketSubscriptions),S.unsubscribeWebSockets(this.currentWebSocketSubscriptions),this.currentWebSocketSubscriptions=[]),this.currentDataSources=v,this.currentRawDataSources=d,this.currentRouteParams=e.params||{},this.currentQueryParams=g,U.log(`handleRouteChange #${r} - queryObject:`,f),U.log(`handleRouteChange #${r} - queryParams:`,g.toString()),A.length>0&&(U.log("Fetching blocking data sources:",A.map(pe=>pe.id)),(await S.fetchDataSourcesWithResults(A,e.params||{},g)).forEach(pe=>{if(pe.state==="success"&&pe.data!==void 0)O[pe.id]=pe.data;else if(pe.state==="error"&&pe.error){const H=pe.error,T=H.response?.data?.message;L[pe.id]={message:T||pe.error.message,status:H.response?.status||H.status}}}),this.processInitOptions(A,O,q,G),this.currentFetchedData={...O},U.log("Blocking data loaded:",Object.keys(O)),Object.keys(L).length>0&&U.log("Data source errors:",L),Object.keys(q).length>0&&U.log("Local state init (blocking):",Object.keys(q)),Object.keys(G).length>0&&U.log("Isolated state init (blocking):",Object.keys(G)));const B=x.length>0;if(B&&(zr.setPending(!0),U.log("Transition started before rendering")),r!==this.currentRouteChangeId){U.log("Route change cancelled after blocking data (newer request exists):",r);return}const{getState:K}=await Promise.resolve().then(()=>Pr),fe=K().currentDataContext||{},Ce=x.map(Z=>Z.id),ke={};if(B){Ce.forEach(pe=>{fe[pe]!==void 0?ke[pe]=fe[pe]:ke[pe]=void 0});const Z=Object.keys(ke).filter(pe=>ke[pe]!==void 0);Z.length>0&&U.log("Preserving previous progressive data:",Z),U.log("Progressive data sources initialized:",Ce)}const Ue=l.defines||{},Pe={...ke,...e.params,...O,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState},_globalSetState:Z=>this.setGlobalState(Z),_dataSourceErrors:Object.keys(L).length>0?L:void 0,_localInit:Object.keys(q).length>0?q:void 0,_isolatedInit:Object.keys(G).length>0?G:void 0,_defines:Object.keys(Ue).length>0?Ue:void 0};if(l.computed&&Object.keys(l.computed).length>0){const Z=this.calculateComputed(l.computed,Pe);Object.keys(Z).length>0&&(Pe._computed=Z,this.globalState._computed=Z,U.log("Computed values calculated:",Object.keys(Z))),Pe._computedDefinitions=l.computed}const qe=l.layout_name||e.layout;this.currentLayoutName!==""&&this.currentLayoutName!==qe&&(U.log("_local reset due to layout change:",{from:this.currentLayoutName,to:qe}),this.globalState._local={},G0()),this.currentLayoutName=qe;const J=l.initLocal||l.state;if(J&&Object.keys(J).length>0){this.globalState._local||(this.globalState._local={});for(const[Z,pe]of Object.entries(J))this.globalState._local[Z]===void 0&&(this.globalState._local[Z]=JSON.parse(JSON.stringify(pe)));Pe._local={...this.globalState._local},U.log("initLocal applied to _local:",Object.keys(J))}if(l.initGlobal&&Object.keys(l.initGlobal).length>0){for(const[Z,pe]of Object.entries(l.initGlobal))this.globalState[Z]===void 0&&(this.globalState[Z]=JSON.parse(JSON.stringify(pe)));U.log("initGlobal applied to _global:",Object.keys(l.initGlobal))}if(l.initIsolated&&Object.keys(l.initIsolated).length>0){for(const[Z,pe]of Object.entries(l.initIsolated))G[Z]===void 0&&(G[Z]=JSON.parse(JSON.stringify(pe)));U.log("initIsolated applied:",Object.keys(l.initIsolated))}Pe._global={...this.globalState,layoutWarnings:l.warnings||[]};const he=l.initActions||l.init_actions;if(he&&he.length>0){await this.executeInitActions(he,Pe),U.log("initActions executed before render");const Z=this.globalState;if(Z._local){if(Object.keys(q).length>0){for(const[pe,H]of Object.entries(q))Z._local[pe]!==void 0?Z._local[pe]=this.deepMerge(Z._local[pe],H):Z._local[pe]=H;U.log("localInit merged into _local after initActions:",Object.keys(q))}Pe._local=Z._local,U.log("_local merged into dataContext:",Z._local)}if(Pe._global={...this.globalState,layoutWarnings:l.warnings||[]},U.log("_global merged into dataContext after initActions"),l.computed&&Object.keys(l.computed).length>0){const pe=this.calculateComputed(l.computed,Pe);Object.keys(pe).length>0&&(Pe._computed=pe,this.globalState._computed=pe,U.log("Computed values recalculated after init_actions:",Object.keys(pe)))}if(Object.keys(this.currentFetchedData).length>0){for(const[pe,H]of Object.entries(this.currentFetchedData))Pe[pe]=H;U.log("Fetched data sources merged into dataContext after initActions:",Object.keys(this.currentFetchedData))}}if(l.transition_overlay&&!this.skeletonOverlayContainer&&this.showTransitionOverlay(l.transition_overlay,l),await us({containerId:"app",layoutJson:l,dataContext:Pe,translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),U.log("Initial render complete with blocking data"),this.reattachSpinnerOverlay(),x.length>0){if(r!==this.currentRouteChangeId){U.log("Route change cancelled before progressive fetch (newer request exists):",r),zr.setPending(!1),this.hideTransitionOverlay();return}U.log("Fetching progressive/background data sources:",x.map(H=>H.id));const{updateTemplateData:Z,getState:pe}=await Promise.resolve().then(()=>Pr);try{const H=x.map(async T=>{try{const de=(await S.fetchDataSourcesWithResults([T],e.params||{},g,this.globalState))[0];if(!de){U.log(`Data source ${T.id} skipped (no fetch result)`);return}if(r!==this.currentRouteChangeId){U.log(`Data source ${T.id} fetch cancelled (newer request exists)`);return}if(de.state==="success"&&de.data!==void 0){U.log(`Progressive data source loaded: ${T.id}`),this.currentFetchedData[T.id]=de.data;const me={};this.processInitOptions([T],{[T.id]:de.data},me);const ae=pe();if(ae.bindingEngine){const ze=[T.id];T.initGlobal&&ze.push("_global"),T.initLocal&&ze.push("_local"),ae.bindingEngine.invalidateCacheByKeys(ze)}const Re={[T.id]:de.data};Object.keys(me).length>0&&(Re._localInit=me,Object.assign(q,me)),T.initGlobal&&(Re._global={...this.globalState}),Z(Re)}else if(de.state==="error"&&de.error){const me=de.error,ae=me.response?.data?.message;L[T.id]={message:ae||de.error.message,status:me.response?.status||me.status},U.log(`Progressive data source error: ${T.id}`,L[T.id]),Z({[T.id]:null,_dataSourceErrors:{...L}})}}catch(ge){U.error(`Failed to fetch data source: ${T.id}`,ge)}});if(await Promise.all(H),r!==this.currentRouteChangeId){U.log("Route change cancelled after progressive fetch (newer request exists):",r);return}U.log("All progressive data sources loaded")}finally{zr.setPending(!1),this.hideTransitionOverlay()}}else this.hideTransitionOverlay();const Ee=v.filter(Z=>Z.type==="websocket");if(Ee.length>0){U.log("Subscribing WebSocket data sources:",Ee.map(T=>T.id));const{updateTemplateData:Z,getState:pe}=await Promise.resolve().then(()=>Pr),H={...this.currentFetchedData,...e.params,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState}};U.log("WebSocket binding context keys:",Object.keys(H)),this.currentWebSocketSubscriptions=S.subscribeWebSockets(v,(T,ge)=>{U.log(`WebSocket data received for: ${T}`,ge),this.currentFetchedData[T]=ge;const de=v.find(ze=>ze.id===T),me=pe();if(me.bindingEngine){const ze=[T];de?.initGlobal&&ze.push("_global"),de?.initLocal&&ze.push("_local"),me.bindingEngine.invalidateCacheByKeys(ze)}Z({[T]:ge});const Re=v.find(ze=>ze.type==="websocket"&&(ze.target_source||ze.id)===T)?.onReceive;Array.isArray(Re)&&Re.length>0&&window.G7Core?.dispatch&&(async()=>{for(const $e of Re)try{const Ge=this.getActionDispatcher?.();Ge&&await Ge.dispatchAction($e,{navigate:this.getRouter?.()?(At,yt)=>this.getRouter().navigate(At,yt):void 0,setState:At=>this.setGlobalState(At),state:this.globalState,data:{...this.globalState,$args:[ge],$event:ge},_isDispatchFallbackContext:!0})}catch(Ge){U.error(`WebSocket onReceive action failed for ${T}:`,Ge)}})()},H),U.log("WebSocket subscriptions established:",this.currentWebSocketSubscriptions)}U.log("Layout rendered successfully")}catch(a){U.error("Route change handling failed:",a),this.hideTransitionOverlay(),this.showRouteError(a)}}processInitOptions(e,r,a,i){e.some(c=>c.refetchOnMount===!0&&c.initLocal)&&(a._forceLocalInit=Date.now(),U.log("refetchOnMount detected, forcing local state init")),e.forEach(c=>{const d=r[c.id];if(!d)return;const f=d.data??d;if(c.initLocal){if(typeof c.initLocal=="string"){let g=f;if(c.initLocalDefaults&&typeof c.initLocalDefaults=="object"){const y=this.evaluateDefaults(c.initLocalDefaults,r);g={...y,...f},U.log(`initLocalDefaults applied for ${c.initLocal}:`,Object.keys(y))}const m=this.globalState._local?.[c.initLocal];m!==void 0&&typeof m=="object"&&typeof g=="object"?(a[c.initLocal]=this.deepMerge(m,g),U.log(`initLocal (merged): ${c.id}.data -> _local.${c.initLocal}`)):(a[c.initLocal]=g,U.log(`initLocal: ${c.id}.data -> _local.${c.initLocal}`))}else if(typeof c.initLocal=="object"&&c.initLocal.key){const{key:g,path:m}=c.initLocal;let y=m?this.extractValueByPathOrExpression(f,m,c.id):f;if(c.initLocalDefaults&&typeof c.initLocalDefaults=="object"){const S=this.evaluateDefaults(c.initLocalDefaults,r);y={...S,...y},U.log(`initLocalDefaults applied for ${g}:`,Object.keys(S))}const w=this.globalState._local?.[g];w!==void 0&&typeof w=="object"&&typeof y=="object"?(a[g]=this.deepMerge(w,y),U.log(`initLocal (merged): ${c.id}.data${m?"."+m:""} -> _local.${g}`)):(a[g]=y,U.log(`initLocal: ${c.id}.data${m?"."+m:""} -> _local.${g}`))}else if(typeof c.initLocal=="object"){const g=c.initLocal._merge||"deep",m=this.flattenNestedObjectToMappings(c.initLocal);for(const{targetPath:y,sourcePath:w}of m){const S=this.extractValueByPathOrExpression(f,w,c.id);if(y.includes(".")){const v=y.split(".")[0];a[v]===void 0&&this.globalState._local?.[v]!==void 0&&(a[v]=JSON.parse(JSON.stringify(this.globalState._local[v]))),this.setValueAtPath(a,y,S,g),U.log(`initLocal map (${g}): ${c.id} ${w} -> _local.${y}`)}else{const v=this.globalState._local?.[y];g==="replace"?(a[y]=S,U.log(`initLocal map (replace): ${c.id} ${w} -> _local.${y}`)):g==="shallow"?v!==void 0&&typeof v=="object"&&typeof S=="object"?(a[y]={...v,...S},U.log(`initLocal map (shallow): ${c.id} ${w} -> _local.${y}`)):(a[y]=S,U.log(`initLocal map: ${c.id} ${w} -> _local.${y}`)):v!==void 0&&typeof v=="object"&&typeof S=="object"?(a[y]=this.deepMerge(v,S),U.log(`initLocal map (deep): ${c.id} ${w} -> _local.${y}`)):(a[y]=S,U.log(`initLocal map: ${c.id} ${w} -> _local.${y}`))}}}}if(c.initGlobal)if(typeof c.initGlobal=="object"&&!Array.isArray(c.initGlobal)&&!("key"in c.initGlobal))for(const[m,y]of Object.entries(c.initGlobal)){if(typeof y!="string"){U.warn(`initGlobal map value must be string, got ${typeof y} for key ${m}`);continue}const w=this.extractValueByPathOrExpression(f,y,c.id),S=this.globalState[m];S!==void 0&&typeof S=="object"&&typeof w=="object"?(this.globalState[m]=this.deepMerge(S,w),U.log(`initGlobal map (merged): ${c.id} ${y} -> _global.${m}`)):(this.globalState[m]=w,U.log(`initGlobal map: ${c.id} ${y} -> _global.${m}`))}else{const m=Array.isArray(c.initGlobal)?c.initGlobal:[c.initGlobal];for(const y of m)if(typeof y=="string"){const w=this.globalState[y];w!==void 0&&typeof w=="object"&&typeof f=="object"?(this.globalState[y]=this.deepMerge(w,f),U.log(`initGlobal (merged): ${c.id}.data -> _global.${y}`)):(this.globalState[y]=f,U.log(`initGlobal: ${c.id}.data -> _global.${y}`))}else if(typeof y=="object"&&y.key){const{key:w,path:S}=y,v=S?this.extractValueByPathOrExpression(f,S,c.id):f,A=this.globalState[w];A!==void 0&&typeof A=="object"&&typeof v=="object"?(this.globalState[w]=this.deepMerge(A,v),U.log(`initGlobal (merged): ${c.id}.data${S?"."+S:""} -> _global.${w}`)):(this.globalState[w]=v,U.log(`initGlobal: ${c.id}.data${S?"."+S:""} -> _global.${w}`))}}if(i&&c.initIsolated){if(typeof c.initIsolated=="string"){const g=i[c.initIsolated];g!==void 0&&typeof g=="object"&&typeof f=="object"?(i[c.initIsolated]=this.deepMerge(g,f),U.log(`initIsolated (merged): ${c.id}.data -> _isolated.${c.initIsolated}`)):(i[c.initIsolated]=f,U.log(`initIsolated: ${c.id}.data -> _isolated.${c.initIsolated}`))}else if(typeof c.initIsolated=="object"&&c.initIsolated.key){const{key:g,path:m}=c.initIsolated,y=m?this.extractValueByPathOrExpression(f,m,c.id):f,w=i[g];w!==void 0&&typeof w=="object"&&typeof y=="object"?(i[g]=this.deepMerge(w,y),U.log(`initIsolated (merged): ${c.id}.data${m?"."+m:""} -> _isolated.${g}`)):(i[g]=y,U.log(`initIsolated: ${c.id}.data${m?"."+m:""} -> _isolated.${g}`))}else if(typeof c.initIsolated=="object")for(const[g,m]of Object.entries(c.initIsolated)){if(typeof m!="string"){U.warn(`initIsolated map value must be string, got ${typeof m} for key ${g}`);continue}const y=this.extractValueByPathOrExpression(f,m,c.id),w=i[g];w!==void 0&&typeof w=="object"&&typeof y=="object"?(i[g]=this.deepMerge(w,y),U.log(`initIsolated map (merged): ${c.id} ${m} -> _isolated.${g}`)):(i[g]=y,U.log(`initIsolated map: ${c.id} ${m} -> _isolated.${g}`))}}})}evaluateDefaults(e,r){const a={};for(const[i,l]of Object.entries(e))if(typeof l=="string"&&l.startsWith("{{")&&l.endsWith("}}")){const c=l.slice(2,-2).trim();a[i]=this.evaluateExpression(c,r)}else a[i]=l;return a}evaluateExpression(e,r){try{const a=e.split("??").map(i=>i.trim());for(const i of a){if(/^['"].*['"]$/.test(i))return i.slice(1,-1);if(i==="true")return!0;if(i==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(i))return Number(i);const l=this.getNestedValue(r,i);if(l!=null)return l}return}catch(a){U.warn(`Expression evaluation failed: ${e}`,a);return}}getNestedValue(e,r){const a=r.replace(/\?\./g,".");let i=e;const l=a.split(/\.(?![^\[]*\])/).flatMap(c=>{const d=c.match(/^([^\[]*)((?:\[\d+\])*)$/);if(d){const[,f,g]=d,m=[];f&&m.push(f);const y=g.match(/\[\d+\]/g);return y&&m.push(...y),m}return[c]}).filter(c=>c!=="");for(const c of l){if(i==null)return;if(c.startsWith("[")&&c.endsWith("]")){const d=parseInt(c.slice(1,-1),10);i=i[d]}else i=i[c]}return i}extractValueByPathOrExpression(e,r,a){const i=Ta(r);if(i!==null){const l=new _n,c={data:e,_global:this.globalState,_local:this.globalState._local||{}};try{const d=Gn(i)?l.evaluatePipeExpression(i,c,{skipCache:!0}):l.evaluateExpression(i,c);return U.log(`initLocal/initGlobal expression evaluated: ${r} -> `,d),d}catch(d){U.warn(`initLocal/initGlobal expression evaluation failed for ${a}:`,r,d);return}}return this.getNestedValue(e,r)}async loadLayoutScripts(e,r){const a=[];for(const i of e){if((i.if!==void 0||i.conditions!==void 0)&&!Qi({if:i.if,conditions:i.conditions},r,this.bindingEngine,`script:${i.id}`)){U.log(`Script skipped (condition not met): ${i.id}`);continue}if(document.getElementById(i.id)){U.log(`Script already loaded: ${i.id}`);continue}const c=new Promise((d,f)=>{const g=document.createElement("script");g.src=i.src,g.id=i.id,g.async=i.async??!0,g.onload=()=>{U.log(`Script loaded successfully: ${i.id}`),d()},g.onerror=()=>{U.warn(`Failed to load script: ${i.id} (${i.src})`),d()},document.head.appendChild(g)});a.push(c)}a.length>0&&(await Promise.all(a),U.log(`All scripts loaded: ${e.filter(i=>!document.getElementById(i.id)||a.length>0).map(i=>i.id).join(", ")}`))}evaluateScriptCondition(e,r){try{if(e.startsWith("{{")&&e.endsWith("}}")){const a=e.slice(2,-2).trim();return new Function("ctx",`
with(ctx) {
try {
return Boolean(${a});
} catch (e) {
return false;
}
}
`)(r)}return!!e}catch(a){return U.warn(`Failed to evaluate script condition: ${e}`,a),!1}}showInitError(e){if(ld()){U.warn("Init failed while document is unloading — skipping error screen",e);return}const r=cy(e);gf.renderFromError("app",r,"초기화 실패",this.config.debug,{templateId:this.config.templateId,locale:this.config.locale},void 0,e)}showTransitionOverlay(e,r){const a=typeof e=="boolean"?{enabled:e,style:"opaque",target:void 0,skeleton:void 0,spinner:void 0}:{enabled:e.enabled,style:e.style||"opaque",target:e.target,skeleton:e.skeleton,spinner:e.spinner,fallback_target:e.fallback_target};if(!a.enabled)return;if(this.hideTransitionOverlay(),a.style==="skeleton"&&a.skeleton?.component&&a.target&&r){this.renderSkeletonOverlay(a.target,a.skeleton,r,a.fallback_target);return}if(a.style==="spinner"&&a.target){this.renderSpinnerOverlay(a.target,a.spinner,a.fallback_target);return}const i=document.documentElement.classList.contains("dark");let l,c="";switch(a.style){case"blur":l=i?"rgba(17,24,39,0.3)":"rgba(255,255,255,0.3)",c="backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);";break;case"fade":l=i?"rgba(17,24,39,0.8)":"rgba(255,255,255,0.8)";break;case"skeleton":l=i?"rgb(17,24,39)":"rgb(249,250,251)";break;case"opaque":default:l=i?"rgb(17,24,39)":"rgb(249,250,251)";break}if(a.target){const d=`#${CSS.escape(a.target)}`,f=document.createElement("style");f.id="g7-transition-overlay",f.textContent=`${d}{position:relative;z-index:0;}${d}::after{content:'';position:absolute;inset:0;background:${l};${c}z-index:2147483647;pointer-events:none;}`,document.head.appendChild(f),this.transitionOverlayEl=f}else{const d=document.createElement("div");d.id="g7-transition-overlay",d.setAttribute("aria-hidden","true"),d.style.position="fixed",d.style.inset="0",d.style.zIndex="9999",d.style.pointerEvents="none",d.style.background=l;for(const f of c.split(";")){const g=f.indexOf(":");g!==-1&&d.style.setProperty(f.slice(0,g).trim(),f.slice(g+1).trim())}document.body.appendChild(d),this.transitionOverlayEl=d}}hideTransitionOverlay(){this.transitionOverlayEl&&(this.transitionOverlayEl.remove(),this.transitionOverlayEl=null),this.hideSkeletonOverlay()}renderSkeletonOverlay(e,r,a,i){const c=mr.getInstance().getComponent(r.component);if(!c){U.log(`Skeleton component "${r.component}" not found in registry, falling back to opaque overlay`),this.showTransitionOverlay({enabled:!0,style:"opaque",target:e});return}let d=document.getElementById(e),f="target";if(!d&&i&&(d=document.getElementById(i),f="fallback"),d||(d=document.getElementById("app"),f="fullpage"),!d){U.log(`Skeleton overlay: no target found (target="#${e}", fallback="${i||"none"}"), falling back to opaque overlay`),this.showTransitionOverlay({enabled:!0,style:"opaque",target:e});return}this.hideSkeletonOverlay();const m=document.documentElement.classList.contains("dark")?"rgb(17,24,39)":"rgb(249,250,251)",y=f==="fullpage"?"app":f==="fallback"?i:e,w=`#${CSS.escape(y)}`,S=document.createElement("style");S.id="g7-skeleton-overlay-style",S.textContent=`${w}{position:relative;z-index:0;}${w}::after{content:'';position:absolute;inset:0;background:${m};z-index:2147483646;pointer-events:none;}`,document.head.appendChild(S),this.transitionOverlayEl=S;const v=document.createElement("div");if(v.id="g7-skeleton-overlay",v.setAttribute("role","status"),v.setAttribute("aria-busy","true"),v.setAttribute("aria-label","Loading..."),f==="fullpage")v.style.cssText=["position:fixed","inset:0","z-index:20","overflow:hidden","pointer-events:none",`background:${m}`].join(";")+";";else{const O=d.getBoundingClientRect(),L=window.scrollX||document.documentElement.scrollLeft,q=window.scrollY||document.documentElement.scrollTop;v.style.cssText=["position:absolute",`top:${O.top+q}px`,`left:${O.left+L}px`,`width:${O.width}px`,`height:${O.height}px`,"z-index:20","overflow:hidden","pointer-events:none",`background:${m}`].join(";")+";"}document.body.appendChild(v),this.skeletonOverlayContainer=v;const A=a.components||[];let x;if(f==="fullpage")x=A;else{const O=f==="fallback"?i:e;x=this.findComponentChildrenById(A,O)}const R=rd.createRoot(v);this.skeletonOverlayRoot=R,Oa.flushSync(()=>{R.render(We.createElement(c,{components:x,options:{animation:r.animation||"pulse",iteration_count:r.iteration_count||5}}))});const M=f==="fullpage"?"fullpage (#app)":f==="fallback"?`fallback (#${i})`:`target (#${e})`;U.log(`Skeleton overlay rendered [${M}] with "${r.component}" (${x.length} components)`)}findComponentChildrenById(e,r){const a=i=>{for(const l of i){if(l.id===r)return l.children||[];if(l.children&&Array.isArray(l.children)){const c=a(l.children);if(c!==null)return c}}return null};return a(e)||e}renderSpinnerOverlay(e,r,a){let i=document.getElementById(e),l="target";if(!i&&a&&(i=document.getElementById(a),l="fallback"),i||(i=document.getElementById("app"),l="fullpage"),!i){U.log(`Spinner overlay: no target found (target="#${e}", fallback="${a||"none"}"), falling back to opaque overlay`),this.showTransitionOverlay({enabled:!0,style:"opaque",target:e});return}this.hideSkeletonOverlay();const c=l==="fullpage"?"app":l==="fallback"?a:e,d=`#${CSS.escape(c)}`,f=document.createElement("style");f.id="g7-skeleton-overlay-style",f.textContent=[`${d}{position:relative;}`,"@keyframes g7-spin{to{transform:rotate(360deg)}}"].join(""),document.head.appendChild(f),this.transitionOverlayEl=f;const g=r?.text||window.G7Core?.t?.("nav.loading")||"";this._spinnerState={target:e,fallbackTarget:a,spinnerConfig:r,resolvedText:g},this._mountSpinnerInTarget(i);const m=l==="fullpage"?"fullpage (#app)":l==="fallback"?`fallback (#${a})`:`target (#${e})`,y=r?.component||"default spinner";U.log(`Spinner overlay rendered [${m}] with "${y}"`)}_mountSpinnerInTarget(e){if(!this._spinnerState)return;const{spinnerConfig:r,resolvedText:a}=this._spinnerState;if(this.skeletonOverlayRoot){try{this.skeletonOverlayRoot.unmount()}catch{}this.skeletonOverlayRoot=null}if(this.skeletonOverlayContainer){try{this.skeletonOverlayContainer.remove()}catch{}this.skeletonOverlayContainer=null}const i=document.createElement("div");if(i.id="g7-skeleton-overlay",i.setAttribute("role","status"),i.setAttribute("aria-busy","true"),e.appendChild(i),this.skeletonOverlayContainer=i,r?.component){const c=mr.getInstance().getComponent(r.component);if(c){const d=rd.createRoot(i);this.skeletonOverlayRoot=d,Oa.flushSync(()=>{d.render(We.createElement(c,{options:{text:a}}))});return}U.log(`Spinner component "${r.component}" not found in registry, using default spinner`)}i.innerHTML='<div style="position:absolute;inset:0;z-index:2147483647;overflow:hidden;background:var(--g7-overlay-bg, rgb(249,250,251));display:flex;align-items:center;justify-content:center;"><div style="width:32px;height:32px;border:3px solid var(--g7-spinner-color, #9ca3af);border-top-color:transparent;border-radius:50%;animation:g7-spin 0.8s linear infinite;"></div></div>'}reattachSpinnerOverlay(){if(!this._spinnerState)return;const{target:e,fallbackTarget:r}=this._spinnerState;let a=document.getElementById(e);!a&&r&&(a=document.getElementById(r)),a||(a=document.getElementById("app")),a&&(this._mountSpinnerInTarget(a),U.log("Spinner overlay reattached to new DOM target"))}hideSkeletonOverlay(){if(this.skeletonOverlayRoot){try{this.skeletonOverlayRoot.unmount()}catch{}this.skeletonOverlayRoot=null}if(this.skeletonOverlayContainer){try{this.skeletonOverlayContainer.parentNode&&this.skeletonOverlayContainer.remove()}catch{}this.skeletonOverlayContainer=null}const e=document.getElementById("g7-skeleton-overlay-style");e&&e.remove(),this._spinnerState=null}showRouteError(e){if(e instanceof Er&&e.details?.status===401){const a=this.config.templateId||"",i=window.location.pathname,l=a.includes("admin")||i.startsWith("/admin")?"admin":"user",c=i+window.location.search,d=!!jr().getToken()||e.details?.hadToken===!0,f=br.getInstance().getLoginRedirectUrl(l,c,d?"session_expired":void 0);window.location.href=f;return}const r=cy(e);gf.renderFromError("app",r,"페이지 로딩 실패",this.config.debug,{templateId:this.config.templateId,locale:this.config.locale},void 0,e)}async handleServerError(){const e=window.G7Error;if(!e)return!1;U.warn("Server error detected:",e);try{return this.errorPageHandler&&(e.data&&(this.globalState.errorData=e.data),this.errorPageHandler.updateGlobalState(this.globalState),this.errorPageHandler.updateLocale(this.config.locale),await this.errorPageHandler.renderError(e.code,"app"))?(U.log(`${e.code} error page rendered successfully`),!0):(U.log(`Falling back to ErrorDisplay for ${e.code}`),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0)}catch(r){return U.error(`Failed to render ${e.code} page:`,r),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0}}async handleRouteNotFound(e){U.warn("Route not found:",e);try{if(this.errorPageHandler&&(this.errorPageHandler.updateGlobalState(this.globalState),this.errorPageHandler.updateLocale(this.config.locale),await this.errorPageHandler.renderError(404,"app"))){U.log("404 error page rendered successfully");return}U.log("Falling back to ErrorDisplay for 404"),this.showRouteError(new Error(`Page not found: ${e}`))}catch(r){U.error("Failed to render 404 page:",r),this.showRouteError(new Error(`Page not found: ${e}`))}}getRouter(){return this.router}getConfig(){return this.config}getLayoutLoader(){return this.layoutLoader}async reloadExtensionState(){U.log("reloadExtensionState: start");let e;try{const r=await fetch(Nr(`/api/templates/${this.config.templateId}/config`,"json",null,`_=${Date.now()}`));if(r.ok){const a=await r.json();a?.success&&a?.data?.cache_version!==void 0&&(e=a.data.cache_version)}}catch(r){U.warn("reloadExtensionState: failed to fetch config.json",r)}e!==void 0&&e!==this.extensionCacheVersion&&(U.log(`reloadExtensionState: cache version ${this.extensionCacheVersion} -> ${e}`),this.extensionCacheVersion=e,this.saveCacheVersionToStorage(e));try{this.router&&(await this.router.loadRoutes(this.extensionCacheVersion),U.log("reloadExtensionState: routes reloaded"))}catch(r){U.error("reloadExtensionState: routes reload failed",r)}try{this.layoutLoader&&(this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),this.layoutLoader.clear(),U.log("reloadExtensionState: layout cache cleared"))}catch(r){U.error("reloadExtensionState: layout cache clear failed",r)}try{const{TranslationEngine:r}=await Promise.resolve().then(()=>ep),a=r.getInstance();this.extensionCacheVersion>0&&a.setCacheVersion(this.extensionCacheVersion);const i=this.config.locale||"ko",l="en";await a.loadTranslations(this.config.templateId,i,"/api",!0),i!==l&&await a.loadTranslations(this.config.templateId,l,"/api",!0),U.log("reloadExtensionState: translations reloaded")}catch(r){U.error("reloadExtensionState: translations reload failed",r)}try{const r=await fetch(`/api/locales/active?_=${Date.now()}`);if(r.ok){const i=(await r.json())?.data?.locales;if(Array.isArray(i)&&i.length>0){const l=this.globalState.appConfig??{};this.setGlobalState({appConfig:{...l,supportedLocales:i}}),U.log("reloadExtensionState: supportedLocales refreshed",i)}}}catch(r){U.warn("reloadExtensionState: supportedLocales refresh failed",r)}U.log("reloadExtensionState: done")}getActionDispatcher(){return ta().actionDispatcher}async changeLocale(e){try{if(U.log("Changing locale to:",e),this.config.locale===e){U.log("Locale is already",e);return}this.config.locale=e,this.saveLocaleToStorage(e),await this.saveLocaleToDatabase(e),this.layoutLoader&&(this.layoutLoader.clear(),U.log("Layout cache cleared")),this.errorPageHandler&&(this.errorPageHandler.updateLocale(e),U.log("ErrorPageHandler locale updated")),Oc(),await Lo({templateId:this.config.templateId,templateType:this.config.templateType,locale:e,debug:this.config.debug,cacheVersion:this.extensionCacheVersion}),U.log("Template Engine re-initialized with new locale");const{getActionDispatcher:r}=await Promise.resolve().then(()=>Pr),a=r();a&&(a.setDefaultContext({navigate:i=>this.router?.navigate(i)}),a.setGlobalStateUpdater((i,l)=>this.setGlobalState(i,l)),U.log("Navigate function and setGlobalState re-injected to ActionDispatcher")),this.reinitializeModuleHandlers(),U.log("Module handlers re-initialized"),this.reinitializeTemplateHandlers(),U.log("Template handlers re-initialized"),this.reinitializePluginHandlers(),U.log("Plugin handlers re-initialized"),this.router&&this.router.navigateToCurrentPath(),U.log("Locale changed successfully to",e)}catch(r){throw U.error("Failed to change locale:",r),r}}loadLocaleFromStorage(){try{return localStorage.getItem(xr.LOCALE_STORAGE_KEY)}catch(e){return U.warn("Failed to load locale from storage:",e),null}}saveLocaleToStorage(e){try{localStorage.setItem(xr.LOCALE_STORAGE_KEY,e)}catch(r){U.warn("Failed to save locale to storage:",r)}}async saveLocaleToDatabase(e){const r=localStorage.getItem("auth_token");if(!r){U.log("No auth token, skipping DB locale save");return}let a,i;if(this.config.localeApi)a=this.config.localeApi.endpoint,i=this.config.localeApi.method;else{const l=this.config.templateType==="admin";a=l?"/api/admin/users/me/language":"/api/user/profile/update-language",i=l?"PATCH":"POST"}try{const l=this.getXsrfToken(),c=await fetch(a,{method:i,headers:{"Content-Type":"application/json",Accept:"application/json",...l&&{"X-XSRF-TOKEN":l},Authorization:`Bearer ${r}`},credentials:"include",body:JSON.stringify({language:e})});c.ok?U.log("Locale saved to DB:",e):U.warn("Failed to save locale to DB (UI will still change):",c.statusText)}catch(l){U.warn("Failed to call locale API (UI will still change):",l)}}getXsrfToken(){if(typeof document>"u")return null;const r=`; ${document.cookie}`.split("; XSRF-TOKEN=");return r.length===2?decodeURIComponent(r.pop()?.split(";").shift()||""):null}loadCacheVersionFromStorage(){try{const e=localStorage.getItem(xr.CACHE_VERSION_STORAGE_KEY);return e?parseInt(e,10):null}catch(e){return U.warn("Failed to load cache version from storage:",e),null}}saveCacheVersionToStorage(e){try{localStorage.setItem(xr.CACHE_VERSION_STORAGE_KEY,String(e))}catch(r){U.warn("Failed to save cache version to storage:",r)}}reinitializeModuleHandlers(){if(typeof window>"u")return;const e="__",r=window;Object.keys(r).forEach(a=>{if(a.startsWith(e)&&typeof r[a]?.initModule=="function")try{r[a].initModule(),U.log(`Module handler re-initialized: ${a}`)}catch(i){U.warn(`Failed to re-initialize module handlers for ${a}:`,i)}})}reinitializeTemplateHandlers(){if(typeof window>"u")return;const e=window.G7TemplateHandlers;if(!e){U.warn("Template handlers not found on window.G7TemplateHandlers");return}const r=this.getActionDispatcher();if(!r){U.warn("ActionDispatcher not available for template handler registration");return}Object.entries(e).forEach(([a,i])=>{r.registerHandler(a,i)}),U.log(`${Object.keys(e).length} template handler(s) re-registered:`,Object.keys(e))}reinitializePluginHandlers(){if(typeof window>"u")return;const e="__",r=window;Object.keys(r).forEach(a=>{if(a.startsWith(e)&&typeof r[a]?.initPlugin=="function")try{r[a].initPlugin(),U.log(`Plugin handler re-initialized: ${a}`)}catch(i){U.warn(`Failed to re-initialize plugin handlers for ${a}:`,i)}})}getLocale(){return this.config.locale}getErrorPageHandler(){return this.errorPageHandler}getGlobalState(){return{...this.globalState}}setGlobalState(e,r){const a={...this.globalState};typeof e=="function"?this.globalState=e(this.globalState):this.globalState={...this.globalState,...e},U.log("Global state updated:",this.globalState),window.G7Core?.devTools?.captureStateSnapshot?.({source:"setGlobalState",prev:a,next:this.globalState}),this.globalStateListeners.forEach(l=>{l(this.globalState)}),r?.render!==!1&&Promise.resolve().then(()=>Pr).then(({updateTemplateData:l,getState:c})=>{const d=c();d.reactRoot&&d.currentLayoutJson&&l({_global:{...this.globalState},_local:this.globalState._local||{}})})}onGlobalStateChange(e){this.globalStateListeners.add(e)}offGlobalStateChange(e){this.globalStateListeners.delete(e)}async refetchDataSource(e,r){let a=this.currentDataSources.find(i=>i.id===e);if(!a)for(const[,i]of this.modalDataSources){const l=i.find(c=>c.id===e);if(l){a=l;break}}if(!a){U.warn(`Data source not found: ${e}`);return}U.log(`Refetching data source: ${e}`,r?.sync?"(sync mode)":"",r?.globalStateOverride?"(with global override)":"",r?.localStateOverride?"(with local override)":""),zr.setPending(!0);try{const i=new _r;this.currentGlobalHeaders.length>0&&i.setGlobalHeaders(this.currentGlobalHeaders);const l=ta(),c=l.currentDataContext?._global||{},d=r?.globalStateOverride?{...c,...r.globalStateOverride}:c,f=l.currentDataContext?._local||{},g=r?.localStateOverride?{...f,...r.localStateOverride}:f,y=(await i.fetchDataSourcesWithResults([a],this.currentRouteParams,this.currentQueryParams,d,g,{ignoreAutoFetch:!0}))[0];if(y.state==="success"&&y.data!==void 0){this.currentFetchedData[e]=y.data;const w={};this.processInitOptions([a],{[e]:y.data},w);const S=ta();if(S.bindingEngine){const A=[e];a.initGlobal&&A.push("_global"),a.initLocal&&A.push("_local"),S.bindingEngine.invalidateCacheByKeys(A)}const v={[e]:y.data};return Object.keys(w).length>0&&(v._localInit=w),a.initGlobal&&(v._global={...this.globalState}),ds(v,r?.sync?{sync:!0}:void 0),U.log(`Data source refetched successfully: ${e}`),y.data}else if(y.state==="error"){U.error(`Failed to refetch data source: ${e}`,y.error);return}}catch(i){U.error(`Error refetching data source: ${e}`,i);return}finally{zr.setPending(!1)}}registerModalDataSources(e,r){this.modalDataSources.set(e,r),U.log(`Modal data sources registered: ${e} (${r.length} sources)`)}unregisterModalDataSources(e){this.modalDataSources.delete(e),U.log(`Modal data sources unregistered: ${e}`)}getDataSource(e){return this.currentFetchedData[e]}setDataSource(e,r,a){if(!e){U.warn("setDataSource: dataSourceId is required");return}const{merge:i=!1,sync:l=!1}=a||{};i&&this.currentFetchedData[e]?this.currentFetchedData[e]={...this.currentFetchedData[e],...r}:this.currentFetchedData[e]=r,Promise.resolve().then(()=>Pr).then(({updateTemplateData:c})=>{c({[e]:this.currentFetchedData[e]},l?{sync:!0}:void 0)}),U.log(`setDataSource: Updated ${e}`,i?"(merged)":"(replaced)")}updateDataSourceItem(e,r,a,i,l){const{idField:c="id",merge:d=!0,skipRender:f=!1}=l||{},g=this.currentFetchedData[e];if(!g)return U.warn(`updateDataSourceItem: DataSource '${e}' not found`),!1;const m=this.parseItemPath(r);let y=g;for(const v of m)if(y=y?.[v],y===void 0)return U.warn(`updateDataSourceItem: Path '${r}' not found in dataSource`),!1;if(!Array.isArray(y))return U.warn(`updateDataSourceItem: Target at '${r}' is not an array`),!1;const w=y.findIndex(v=>String(v[c])===String(a));if(w===-1)return U.warn(`updateDataSourceItem: Item with ${c}='${a}' not found`),!1;d?y[w]=this.deepMerge(y[w],i):y[w]={...y[w],...i};const S=window.G7Core?.devTools;return S?.isEnabled?.()&&S.trackDataSourceUpdate?.({dataSourceId:e,updateType:"partial",itemPath:r,itemId:a,updates:i,timestamp:Date.now()}),f||Promise.resolve().then(()=>Pr).then(({updateTemplateData:v})=>{v({[e]:this.currentFetchedData[e]},{sync:!1})}),U.log(`updateDataSourceItem: Updated ${e}.${r}[${c}=${a}]`),!0}parseItemPath(e){const r=[],a=/([^\.\[\]]+)|\[(\d+)\]/g;let i;for(;(i=a.exec(e))!==null;)i[1]!==void 0?r.push(i[1]):i[2]!==void 0&&r.push(parseInt(i[2],10));return r}deepMerge(e,r){if(r==null)return e;if(typeof r!="object"||Array.isArray(r))return r;const a={...e};for(const i of Object.keys(r))typeof r[i]=="object"&&r[i]!==null&&!Array.isArray(r[i])?a[i]=this.deepMerge(a[i]||{},r[i]):a[i]=r[i];return a}setValueAtPath(e,r,a,i="deep"){const l=r.split(".");let c=e;for(let g=0;g<l.length-1;g++){const m=l[g];(c[m]===void 0||c[m]===null||typeof c[m]!="object")&&(c[m]={}),c=c[m]}const d=l[l.length-1],f=c[d];i==="replace"||f===void 0?c[d]=a:i==="shallow"?typeof f=="object"&&typeof a=="object"&&!Array.isArray(a)?c[d]={...f,...a}:c[d]=a:typeof f=="object"&&typeof a=="object"&&!Array.isArray(a)?c[d]=this.deepMerge(f,a):c[d]=a}flattenNestedObjectToMappings(e,r=""){const a=[];for(const[i,l]of Object.entries(e)){if(i==="_merge")continue;const c=r?`${r}.${i}`:i;typeof l=="string"?a.push({targetPath:c,sourcePath:l}):typeof l=="object"&&l!==null&&!Array.isArray(l)&&a.push(...this.flattenNestedObjectToMappings(l,c))}return a}async updateQueryParams(e,r){U.log("updateQueryParams:",e);const a=new URL(e,window.location.origin),i=new URLSearchParams(a.search);window.history.replaceState(null,"",e),U.log("URL updated via replaceState"),this.currentQueryParams=i,U.log("currentQueryParams updated:",Object.fromEntries(i.entries()));const l=new _r,c=ta().currentDataContext?._global||this.globalState||{},d={route:this.currentRouteParams||{},query:dy(this.currentQueryParams),_global:c},f=Array.isArray(this.currentRawDataSources)&&this.currentRawDataSources.length>0?l.filterByCondition(this.currentRawDataSources,d):this.currentDataSources;this.currentDataSources=f;const g=f.filter(A=>A.auto_fetch!==!1&&A.type!=="websocket");if(g.length===0){U.log("No auto_fetch data sources to refetch");return}U.log(`Refetching ${g.length} auto_fetch data sources`),zr.setPending(!0);const m=ta().currentLayoutJson,y=m?.transition_overlay,w=Array.isArray(y?.wait_for)?y.wait_for:[],S=g.some(A=>(A.loading_strategy||"progressive")==="blocking"),v=w.length>0&&g.some(A=>w.includes(A.id)&&A.type!=="websocket"&&(A.loading_strategy||"progressive")!=="background");if((S||v)&&y&&typeof y=="object"){const A=r?.transitionOverlayTarget||y.target;y.enabled&&y.style==="skeleton"&&y.skeleton?.component&&A?this.renderSkeletonOverlay(A,y.skeleton,m,y.fallback_target):y.enabled&&y.style==="spinner"&&A&&this.renderSpinnerOverlay(A,y.spinner,y.fallback_target)}try{const A=new _r;this.currentGlobalHeaders.length>0&&A.setGlobalHeaders(this.currentGlobalHeaders);const x=ta(),R=x.currentDataContext?._global||{},M=await A.fetchDataSourcesWithResults(g,this.currentRouteParams,this.currentQueryParams,R,void 0,{ignoreAutoFetch:!1}),O={},L={},q=new Map(g.map(G=>[G.id,G]));for(const G of M){const B=q.get(G.id);if(!B){U.warn(`Refetch result id not found in autoFetchDataSources: ${G.id}`);continue}const K=G.id;G.state==="success"&&G.data!==void 0?(this.currentFetchedData[K]=G.data,O[K]=G.data,this.processInitOptions([B],{[K]:G.data},L),U.log(`Data source refetched: ${K}`)):G.state==="error"&&U.error(`Failed to refetch data source: ${K}`,G.error)}if(x.bindingEngine){const G=Object.keys(O);G.push("query"),x.bindingEngine.invalidateCacheByKeys(G)}if(Object.keys(L).length>0&&(O._localInit=L),Object.keys(O).length>0){if(O.query=dy(this.currentQueryParams),x.currentLayoutJson?.computed&&Object.keys(x.currentLayoutJson.computed).length>0){const G={...x.currentDataContext,...O,query:O.query},B=this.calculateComputed(x.currentLayoutJson.computed,G);Object.keys(B).length>0&&(O._computed=B,this.globalState._computed=B,U.log("Computed values recalculated in updateQueryParams:",Object.keys(B)))}ds(O,{sync:!0}),U.log("Template data updated with new query params")}}catch(A){U.error("Error in updateQueryParams:",A)}finally{zr.setPending(!1),this.hideTransitionOverlay()}}calculateComputed(e,r){const a={},i=new _n;for(const[l,c]of Object.entries(e))try{let d;if(this.isComputedSwitchDefinition(c))d=i.resolveSwitch(c,r,{skipCache:!0});else if(typeof c=="string")if(c.startsWith("{{")&&c.endsWith("}}")){const f=c.slice(2,-2).trim();d=this.evaluateComputedExpression(f,r)}else d=c;a[l]=d,U.log(`Computed ${l}:`,d)}catch(d){U.warn(`Failed to calculate computed value: ${l}`,d),a[l]=void 0}return a}isComputedSwitchDefinition(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$switch"in e&&"$cases"in e}evaluateComputedExpression(e,r){try{return new Function("ctx",`
with(ctx) {
try {
return ${e};
} catch (e) {
return undefined;
}
}
`)(r)}catch(a){U.warn(`Expression evaluation failed: ${e}`,a);return}}async executeInitActions(e,r={}){const{getActionDispatcher:a}=await Promise.resolve().then(()=>Pr),i=a();if(!i){U.warn("ActionDispatcher not available for init_actions");return}U.log("Executing init_actions:",e.map(d=>d.handler)),U.log("Init actions dataContext:",r),U.log("Init actions dataContext._global:",r._global);const l=e.map(d=>d.handler).filter(d=>d.includes("."));l.length>0&&await this.waitForHandlers(i,l);let c={...r};for(const d of e)try{const f={type:"click",handler:d.handler,target:d.target,params:d.params,resultTo:d.resultTo,onSuccess:d.onSuccess,onError:d.onError,if:d.if,conditions:d.conditions,auth_mode:d.auth_mode,auth_required:d.auth_required},g=i.createHandler(f,c),m=new Event("init");await g(m),U.log(`Init action executed: ${d.handler}`);const y=this.globalState;c={...c,_global:{...y},_local:y._local||c._local||{}},U.log(`Data context refreshed after ${d.handler}:`,{cartKey:c._global?.cartKey})}catch(f){U.error(`Failed to execute init action: ${d.handler}`,f)}}async waitForHandlers(e,r,a=5e3){const i=Date.now(),l=50,c=()=>r.every(f=>e.customHandlers?.has(f));if(c()){U.log("All module handlers already registered");return}const d=mf().getFailedJsAssets();if(d.length>0){const f=d.some(y=>y==="module"||y==="plugin"),g=r.filter(y=>!e.customHandlers?.has(y)),m=g.length>0&&g.every(y=>d.some(w=>y.startsWith(`${w}.`)));if(f||m){U.warn("Extension asset load failed — not waiting for handlers that will never register:",{pending:g,failedAssets:d});return}}return U.log("Waiting for module handlers:",r),new Promise(f=>{const g=()=>{if(c()){U.log("All module handlers now registered"),f();return}if(Date.now()-i>=a){const m=r.filter(y=>!e.customHandlers?.has(y));U.warn("Timeout waiting for handlers:",m),f();return}setTimeout(g,l)};g()})}};$(xr,"LOCALE_STORAGE_KEY","g7_locale"),$(xr,"CACHE_VERSION_STORAGE_KEY","g7_cache_version");let To=xr;function bf(o){const e=new To(o);return o.websocket&&(Tc.configure(o.websocket),U.log("WebSocket 설정 완료")),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{e.init(),window.__templateApp=e}):(e.init(),window.__templateApp=e),e}typeof window<"u"&&(window.G7Core=window.G7Core||{},window.G7Core.initTemplateApp=bf,window.G7Core.dataSource={refetch:async(o,e)=>{const r=window.__templateApp;if(!r){U.warn("TemplateApp not initialized (G7Core.dataSource.refetch)");return}return r.refetchDataSource(o,e)},get:o=>{const e=window.__templateApp;if(!e){U.warn("TemplateApp not initialized (G7Core.dataSource.get)");return}return e.getDataSource(o)}});function N_(o={}){const{checked:e,value:r,name:a,type:i="checkbox"}=o,c=r!==void 0?r:i==="checkbox"||i==="radio"?e??!1:String(e??""),d={checked:e??!1,value:c,name:a??"",type:i};return{target:d,currentTarget:d,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new Event("change"),bubbles:!0,cancelable:!0,defaultPrevented:!1,eventPhase:Event.AT_TARGET,isTrusted:!1,timeStamp:Date.now(),type:"change",isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,persist:()=>{}}}function I_(o={}){const{button:e=0,clientX:r=0,clientY:a=0}=o;return{button:e,clientX:r,clientY:a,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new MouseEvent("click"),bubbles:!0,cancelable:!0,defaultPrevented:!1,eventPhase:Event.AT_TARGET,isTrusted:!1,timeStamp:Date.now(),type:"click",isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,persist:()=>{},target:document.createElement("div"),currentTarget:document.createElement("div")}}function H_(){return{preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new Event("submit"),bubbles:!0,cancelable:!0,defaultPrevented:!1,eventPhase:Event.AT_TARGET,isTrusted:!1,timeStamp:Date.now(),type:"submit",isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,persist:()=>{},target:document.createElement("form"),currentTarget:document.createElement("form")}}function j_(o,e="keydown"){return{key:o,code:o.length===1?`Key${o.toUpperCase()}`:o,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new KeyboardEvent(e,{key:o}),bubbles:!0,cancelable:!0,defaultPrevented:!1,eventPhase:Event.AT_TARGET,isTrusted:!1,timeStamp:Date.now(),type:e,isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,persist:()=>{},target:document.createElement("div"),currentTarget:document.createElement("div"),altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,repeat:!1}}const z_={justify:/^justify-(start|end|center|between|around|evenly)$/,items:/^items-(start|end|center|baseline|stretch)$/,content:/^content-(start|end|center|between|around|evenly|stretch)$/,self:/^self-(auto|start|end|center|stretch|baseline)$/,flex:/^flex-(row|row-reverse|col|col-reverse|wrap|wrap-reverse|nowrap|1|auto|initial|none)$/,grow:/^(grow|grow-0)$/,shrink:/^(shrink|shrink-0)$/,basis:/^basis-/,order:/^(order-|-)order-/,gap:/^gap(-x|-y)?-/,gridCols:/^grid-cols-/,gridRows:/^grid-rows-/,colSpan:/^col-(span-|start-|end-)/,rowSpan:/^row-(span-|start-|end-)/,display:/^(block|inline-block|inline|flex|inline-flex|table|inline-table|table-caption|table-cell|table-column|table-column-group|table-footer-group|table-header-group|table-row-group|table-row|flow-root|grid|inline-grid|contents|list-item|hidden)$/,position:/^(static|fixed|absolute|relative|sticky)$/,inset:/^(inset|top|right|bottom|left)-/,zIndex:/^z-/,width:/^w-/,minWidth:/^min-w-/,maxWidth:/^max-w-/,height:/^h-/,minHeight:/^min-h-/,maxHeight:/^max-h-/,padding:/^p[xytblr]?-/,margin:/^-?m[xytblr]?-/,space:/^space-(x|y)-/,fontSize:/^text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/,fontWeight:/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/,fontStyle:/^(italic|not-italic)$/,fontFamily:/^font-(sans|serif|mono)/,textAlign:/^text-(left|center|right|justify|start|end)$/,textColor:/^text-(inherit|current|transparent|black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-/,textDecoration:/^(underline|overline|line-through|no-underline)$/,textTransform:/^(uppercase|lowercase|capitalize|normal-case)$/,lineHeight:/^leading-/,letterSpacing:/^tracking-/,textOverflow:/^(truncate|text-ellipsis|text-clip)$/,whitespace:/^whitespace-/,wordBreak:/^break-/,bgColor:/^bg-(inherit|current|transparent|black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-/,bgGradient:/^bg-gradient-/,bgSize:/^bg-(auto|cover|contain)$/,bgPosition:/^bg-(bottom|center|left|left-bottom|left-top|right|right-bottom|right-top|top)$/,bgRepeat:/^bg-(repeat|no-repeat|repeat-x|repeat-y|repeat-round|repeat-space)$/,bgAttachment:/^bg-(fixed|local|scroll)$/,bgClip:/^bg-clip-/,bgOrigin:/^bg-origin-/,borderWidth:/^border(-[xytblr])?(-0|-2|-4|-8)?$/,borderColor:/^border-(inherit|current|transparent|black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-/,borderStyle:/^border-(solid|dashed|dotted|double|hidden|none)$/,borderRadius:/^rounded(-[tblrse]{1,2})?(-none|-sm|-md|-lg|-xl|-2xl|-3xl|-full)?$/,ringWidth:/^ring(-0|-1|-2|-4|-8|-inset)?$/,ringColor:/^ring-(inherit|current|transparent|black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-/,ringOffset:/^ring-offset-/,shadow:/^shadow(-sm|-md|-lg|-xl|-2xl|-inner|-none)?$/,opacity:/^opacity-/,mixBlend:/^mix-blend-/,bgBlend:/^bg-blend-/,blur:/^blur(-none|-sm|-md|-lg|-xl|-2xl|-3xl)?$/,brightness:/^brightness-/,contrast:/^contrast-/,grayscale:/^grayscale(-0)?$/,hueRotate:/^-?hue-rotate-/,invert:/^invert(-0)?$/,saturate:/^saturate-/,sepia:/^sepia(-0)?$/,backdropBlur:/^backdrop-blur-/,backdropBrightness:/^backdrop-brightness-/,backdropContrast:/^backdrop-contrast-/,backdropGrayscale:/^backdrop-grayscale-/,backdropHueRotate:/^backdrop-hue-rotate-/,backdropInvert:/^backdrop-invert-/,backdropOpacity:/^backdrop-opacity-/,backdropSaturate:/^backdrop-saturate-/,backdropSepia:/^backdrop-sepia-/,scale:/^scale(-x|-y)?-/,rotate:/^-?rotate-/,translate:/^-?translate-[xy]-/,skew:/^-?skew-[xy]-/,transformOrigin:/^origin-/,transition:/^transition(-none|-all|-colors|-opacity|-shadow|-transform)?$/,duration:/^duration-/,ease:/^ease-(linear|in|out|in-out)$/,delay:/^delay-/,animate:/^animate-/,cursor:/^cursor-/,userSelect:/^select-/,pointerEvents:/^pointer-events-/,resize:/^resize(-none|-x|-y)?$/,scrollBehavior:/^scroll-(auto|smooth)$/,touchAction:/^touch-/,overflow:/^overflow(-x|-y)?-(auto|hidden|clip|visible|scroll)$/,overscroll:/^overscroll(-x|-y)?-(auto|contain|none)$/,visibility:/^(visible|invisible|collapse)$/,aspectRatio:/^aspect-/,columns:/^columns-/,breakAfter:/^break-after-/,breakBefore:/^break-before-/,breakInside:/^break-inside-/,boxDecorationBreak:/^box-decoration-/,boxSizing:/^box-(border|content)$/,float:/^float-(right|left|none)$/,clear:/^clear-(left|right|both|none)$/,isolation:/^(isolate|isolation-auto)$/,objectFit:/^object-(contain|cover|fill|none|scale-down)$/,objectPosition:/^object-/};function fy(o){const e=o.replace(/^(dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+/,"");for(const[r,a]of Object.entries(z_))if(a.test(e))return r;return null}function hy(o){const e=o.match(/^((dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+)/);return e?e[1]:""}function U_(o,e){if(!e||e.trim()==="")return o;if(!o||o.trim()==="")return e;const r=o.split(/\s+/).filter(Boolean),a=e.split(/\s+/).filter(Boolean),i=new Map;for(const c of a){const d=fy(c);if(d){const f=hy(c),g=`${d}:${f}`;i.set(g,c)}}return[...r.filter(c=>{const d=fy(c);if(!d)return!0;const f=hy(c),g=`${d}:${f}`;return!i.has(g)}),...a].join(" ")}function B_(o){return Object.entries(o).filter(([,e])=>e).map(([e])=>e).join(" ")}function P_(...o){return o.filter(e=>typeof e=="string"&&e.length>0).join(" ")}const be=ut("G7CoreGlobals");function q_(){window.React=We,window.ReactDOM={...ad,createPortal:Oa.createPortal,unstable_batchedUpdates:o=>o()},window.ReactJSXRuntime=j0,be.log("전역 객체 window.React, window.ReactDOM, window.ReactJSXRuntime에 노출됨")}function G_(o){const e=new Map,r=Ma.getInstance();o.componentEvent={on:(a,i)=>(e.has(a)||e.set(a,new Set),e.get(a).add(i),r.trackEventSubscribe(a),()=>{e.get(a)?.delete(i),r.trackEventUnsubscribe(a)}),emit:async(a,i)=>{const l=e.get(a),c=l?.size??0;if(!l||l.size===0)return r.trackEventEmit(a,i,0),[];let d,f=[];try{f=await Promise.all(Array.from(l).map(async g=>{try{return await g(i)}catch(m){throw be.error(`componentEvent: Error in listener for "${a}":`,m),m}}))}catch(g){d=g instanceof Error?g:new Error(String(g))}if(r.trackEventEmit(a,i,c,f,d),d)throw d;return f},off:a=>{e.delete(a),r.trackEventOff(a)},clear:()=>{e.clear(),r.trackEventClear()}},be.log("전역 객체 window.G7Core.componentEvent에 노출됨")}function V_(o){o.__runtime||(o.__runtime={DynamicRenderer:Br,ComponentRegistry:mr,TranslationEngine:gi,DataSourceManager:_r,dataSourceManager:__,DataBindingEngine:_n,dataBindingEngine:pd,ActionDispatcher:mo,TranslationReactContext:lf,TranslationProvider:_c,useTranslation:Xm,ResponsiveContext:jd,ResponsiveProvider:uc,useResponsive:zd,responsiveManager:mi,BREAKPOINT_PRESETS:Vl,AuthManager:br,createLogger:ut,G7DevToolsCore:Ma},be.log("전역 객체 window.G7Core.__runtime(코어 런타임 표면)에 노출됨"))}function F_(o){if(o.layoutEditor&&o.layoutEditor.__isStub!==!0||o.layoutEditor&&o.layoutEditor.__isStub===!0)return;const e=[],r=[];o.layoutEditor={__isStub:!0,__queue:e,__readyCallbacks:r,registerWidget:(a,i)=>e.push(["widget",a,i]),registerNodeEditor:(a,i)=>e.push(["nodeEditor",a,i]),registerCanvasOverlay:(a,i)=>e.push(["canvasOverlay",a,i]),onReady:a=>{typeof a=="function"&&r.push(a)}},be.log("전역 객체 window.G7Core.layoutEditor 예약 접수함(stub) 노출됨")}function K_(o,e){o.useTranslation=Xm,o.t=(r,a)=>{const i=e.getState();if(!i.translationEngine||!i.translationContext)return r;if(a){const l="|"+Object.entries(a).map(([c,d])=>`${c}=${d}`).join("|");return i.translationEngine.translate(r,i.translationContext,l)}return i.translationEngine.translate(r,i.translationContext)},be.log("전역 객체 window.G7Core.useTranslation에 노출됨")}function W_(o,e){o.createChangeEvent=N_,o.createClickEvent=I_,o.createSubmitEvent=H_,o.createKeyboardEvent=j_,o.uuid=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const a=Math.random()*16|0;return(r==="x"?a:a&3|8).toString(16)}),o.createLogger=ut,be.log("전역 객체 window.G7Core.createLogger에 노출됨"),o.renderItemChildren=(r,a,i,l,c)=>{const d=e.getState(),m={_global:window.__templateApp?.getGlobalState?.()||{},_local:a._local||{},_computed:a._computed||{},...a},y=new Set,w=(v,A)=>{const x=m._global?._remountKeys;return v&&x?.[v]&&!y.has(v)?(y.add(v),`${v}-remount-${x[v]}`):v||A},S={translationContext:d.translationContext,translationEngine:d.translationEngine,bindingEngine:d.bindingEngine,actionDispatcher:d.actionDispatcher,getRemountKey:w,...c};return oo(r,m,i,l,S)},o.evaluateCondition=(r,a)=>{if(!r)return!0;const i=e.getState(),c=window.__templateApp?.getGlobalState?.()||{},d={_global:c,_local:c._local||{},_computed:c._computed||{},...a||{}},f=i.bindingEngine??pd;return ip(r,d,f)},o.getComponentMap=()=>mr.getInstance().getComponentMap(),o.renderComponentLayout=(r,a,i)=>{if(!r||!Array.isArray(r)||r.length===0)return null;const l=mr.getInstance().getComponentMap(),c=e.getState(),f=window.__templateApp?.getGlobalState?.()||{},g={_global:f._global||{},_local:f._local||{},_computed:f._computed||{},...a},m=new Set,y=(w,S)=>{const v=g._global?._remountKeys;return w&&v?.[w]&&!m.has(w)?(m.add(w),`${w}-remount-${v[w]}`):w||S};return oo(r,g,l,i,{translationContext:c.translationContext,translationEngine:c.translationEngine,bindingEngine:c.bindingEngine,actionDispatcher:c.actionDispatcher,getRemountKey:y})},o.renderExpandContent=r=>{const{children:a,row:i,expandContext:l,componentContext:c,keyPrefix:d}=r;if(!a||!Array.isArray(a)||a.length===0)return null;const f=r.componentMap||mr.getInstance().getComponentMap(),g=e.getState(),m=o.state?.get?.()||{},y=c?.stateRef?.current??c?.state??{},w={...m._local||{},...y},S=c?.computedRef?.current??m._computed??{},v=g.bindingEngine??o.getDataBindingEngine?.(),A={...m,_local:w,_computed:S,row:i,item:i,$item:i};let x={};if(l&&typeof l=="object"&&v)try{for(const[L,q]of Object.entries(l))if(typeof q=="string"){const G=Ta(q);if(G!==null)try{x[L]=Gn(G)?v.evaluatePipeExpression(G,A,{skipCache:!0}):v.evaluateExpression(G,A,{skipCache:!0})}catch{x[L]=void 0}else x[L]=v.resolveBindings(q,A,{skipCache:!0})}else x[L]=q}catch(L){be.warn("renderExpandContent: expandContext 평가 오류:",L)}const R={row:i,item:i,$item:i,_local:w,_global:m._global||{},_computed:m._computed||{},...x},M=new Set,O=(L,q)=>{const G=R._global?._remountKeys;return L&&G?.[L]&&!M.has(L)?(M.add(L),`${L}-remount-${G[L]}`):L||q};return oo(a,R,f,d,{translationContext:g.translationContext,translationEngine:g.translationEngine??void 0,bindingEngine:g.bindingEngine??void 0,actionDispatcher:g.actionDispatcher,componentContext:c,getRemountKey:O})},o.$get=function(a,i,l=void 0){if(a==null)return l;const c=Array.isArray(i)?i:[i];if(c.length===0)return a;let d=a;for(const f of c){if(d==null||f==null)return l;d=d[f]}return d??l},be.log("전역 객체 window.G7Core.renderItemChildren에 노출됨"),be.log("전역 객체 window.G7Core.renderComponentLayout에 노출됨"),be.log("전역 객체 window.G7Core.renderExpandContent에 노출됨"),be.log("전역 객체 window.G7Core.$get에 노출됨")}function Y_(o){o.dispatch=async(e,r)=>{const a=window.__templateApp;if(!a)return be.warn("G7Core.dispatch: TemplateApp이 초기화되지 않았습니다."),{success:!1,error:new Error("TemplateApp이 초기화되지 않았습니다.")};const i=a.getActionDispatcher?.();if(!i)return be.warn("G7Core.dispatch: ActionDispatcher를 찾을 수 없습니다."),{success:!1,error:new Error("ActionDispatcher를 찾을 수 없습니다.")};const l=a.getRouter?.(),c=a.getGlobalState?.(),d=a.setGlobalState?.bind(a),g=r?.componentContext||window.__g7ActionContext,m=window.__g7PendingLocalState;let y=g?.state??c;m&&g&&(y=m,be.log("[dispatch] Using __g7PendingLocalState for context.state:",m));let w=g?.data??c;m&&g?.data?._local&&(w={...g.data,_local:m},be.log("[dispatch] Updated context.data._local with pendingLocalState"));const S={navigate:l?(v,A)=>l.navigate(v,A):void 0,setState:g?.setState??d,state:y,data:w,_isDispatchFallbackContext:!g?.setState};if(e.debounce){const v=e.debounceKey||`dispatch-${e.handler}`,A=typeof e.debounce=="number"?e.debounce:e.debounce.delay;return i.debouncedCall(v,A,()=>{const{debounce:x,debounceKey:R,...M}=e;i.dispatchAction(M,S)}),{success:!0,debounced:!0}}try{return await i.dispatchAction(e,S)}catch(v){return be.error("G7Core.dispatch: 액션 실행 오류:",v),{success:!1,error:v instanceof Error?v:new Error(String(v))}}},be.log("전역 객체 window.G7Core.dispatch에 노출됨")}function ko(o){const e={};for(const[r,a]of Object.entries(o))if(r.includes(".")){const i=r.split(".");let l=e;for(let c=0;c<i.length-1;c++){const d=i[c];d in l?(typeof l[d]!="object"||l[d]===null)&&(l[d]={}):l[d]={},l=l[d]}l[i[i.length-1]]=a}else e[r]=a;return e}function gy(o,e=""){const r=[];if(!o||typeof o!="object")return r;for(const a of Object.keys(o)){const i=e?`${e}.${a}`:a,l=o[a];l&&typeof l=="object"&&!Array.isArray(l)?r.push(...gy(l,i)):r.push(i)}return r}function X_(o){const e=Object.keys(o);return e.length>0&&e.every(r=>/^\d+$/.test(r))}function py(o,e){const r={...o};for(const a of Object.keys(e))a in r?r[a]!==null&&typeof r[a]=="object"&&!Array.isArray(r[a])&&e[a]!==null&&typeof e[a]=="object"&&!Array.isArray(e[a])&&(r[a]=py(r[a],e[a])):r[a]=e[a];return r}function ir(o,e){if(Array.isArray(o)&&!Array.isArray(e)&&X_(e)){const a=Object.keys(e).map(l=>parseInt(l,10));if(!((a.length>0?Math.max(...a):0)>=o.length+a.length+10)){const l=[...o];for(const[c,d]of Object.entries(e)){const f=parseInt(c,10);f>=0&&f<l.length?d!==null&&typeof d=="object"&&!Array.isArray(d)&&l[f]!==null&&typeof l[f]=="object"?l[f]=ir(l[f],d):l[f]=d:f>=l.length&&(l[f]=d)}return l}}const r={...o};for(const[a,i]of Object.entries(e))i!==null&&typeof i=="object"&&!Array.isArray(i)?r[a]!==null&&typeof r[a]=="object"?r[a]=ir(r[a],i):r[a]={...i}:r[a]=i;return r}function J_(o){o.state={get:()=>window.__templateApp?.getGlobalState?.()||{},set:(e,r)=>{const a=window.__templateApp;if(a?.setGlobalState&&a?.getGlobalState){const i=r?.merge||"deep",l=ko(e);let c;if(i==="replace")c=l;else if(i==="shallow")c={...a.getGlobalState(),...l};else{const d=a.getGlobalState();c=ir(d,l)}a.setGlobalState(c,{render:r?.render})}else be.warn("G7Core.state.set: TemplateApp이 초기화되지 않았습니다.")},setLocal:(e,r)=>{const a=window.__templateApp;if(r?.render===!1&&!r?.selfManaged){const x=window.__g7AutoBindingPaths;x&&x.size>0&&gy(ko(e)).some(M=>x.has(M))&&(be.log("[setLocal] render:false + 자동바인딩 경로 겹침 감지 → render:true 자동 승격 (engine-v1.43.0)"),r={...r,render:!0})}if(r?.debounce){const x=a?.getActionDispatcher?.();if(x){const R=r.debounceKey||`setLocal-${Object.keys(e).join(",")}`,{debounce:M,debounceKey:O,...L}=r;x.debouncedCall(R,r.debounce,()=>{o.state.setLocal(e,L)});return}}const i=r?.scope??"current",l=r?.merge||"deep",c=window.__g7ActionContext,d=ko(e);if(i==="parent"||i==="root"){const x=window.__g7LayoutContextStack||[];if(x.length>0){const R=i==="parent"?x[x.length-1]:x[0];if(R?.setState){R.setState(M=>l==="replace"?d:l==="shallow"?{...M||{},...d}:ir(M||{},d)),be.log(`[setLocal] scope=${i}: 타겟 컨텍스트에 상태 업데이트 (mergeMode=${l})`,d);return}}be.warn(`[setLocal] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const f=window.__g7PendingLocalState,g=a?.getGlobalState?.()?._local||{},w=!((window.__g7LayoutContextStack||[]).length>0)&&c?.state?c.state:void 0,S=w?py(g,w):g,v=f||S;let A;if(l==="replace"?A=d:l==="shallow"?A={...v,...d}:A=ir(v,d),a?.setGlobalState&&(a.setGlobalState({_local:A},{render:r?.render}),be.log(`[setLocal] globalLocal updated via setGlobalState (mergeMode=${l}, render=${r?.render??!0}):`,d)),window.__g7PendingLocalState=A,be.log("[setLocal] __g7PendingLocalState updated:",A),window.__g7SequenceLocalSync=A,window.__g7LastSetLocalSnapshot=A,l==="replace")window.__g7ForcedLocalFields=d;else{const x=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=ir(x,d)}if(be.log("[setLocal] __g7ForcedLocalFields updated:",d),l==="replace")window.__g7SetLocalOverrideKeys=d;else{const x=window.__g7SetLocalOverrideKeys||{};window.__g7SetLocalOverrideKeys=ir(x,d)}be.log("[setLocal] __g7SetLocalOverrideKeys updated:",d),c?.setState&&c.setState(x=>l==="replace"?d:l==="shallow"?{...x||{},...d}:ir(x||{},d)),a?.setGlobalState||be.warn("G7Core.state.setLocal: TemplateApp이 없습니다.")},getLocal:()=>{const a=(window.__templateApp?.getGlobalState?.()||{})._local||{},i=window.__g7PendingLocalState;if(i)return ir(a,i);const l=window.__g7LastSetLocalSnapshot;return l&&l!==a?ir(a,l):a},update:e=>{const r=window.__templateApp;if(r?.getGlobalState&&r?.setGlobalState){const a=r.getGlobalState(),i=e(a);r.setGlobalState(i)}else be.warn("G7Core.state.update: TemplateApp이 초기화되지 않았습니다.")},subscribe:e=>{const r=window.__templateApp;return r?.onGlobalStateChange?r.onGlobalStateChange(e):(be.warn("G7Core.state.subscribe: TemplateApp이 초기화되지 않았습니다."),()=>{})},getDataSource:e=>window.__templateApp?.getDataSource?.(e),getIsolated:e=>e?window.__g7IsolatedStates?.[e]?.state??null:window.__g7ActionContext?.isolatedContext?.state??null,setIsolated:(e,r,a)=>{let i,l,c;typeof e=="string"?(i=e,l=r||{},c=a):(l=e,c=r&&typeof r=="object"&&"merge"in r?r:a);const d=c?.merge||"deep",f=ko(l);if(i){const y=window.__g7IsolatedStates?.[i];y?.mergeState?y.mergeState(f,d):be.warn(`G7Core.state.setIsolated: scopeId '${i}'를 찾을 수 없습니다.`);return}const g=window.__g7ActionContext;g?.isolatedContext?.mergeState?g.isolatedContext.mergeState(f,d):be.warn("G7Core.state.setIsolated: 액션 컨텍스트에 isolatedContext가 없습니다.")},getParent:()=>{const e=window.__g7LayoutContextStack||[];if(e.length===0)return be.log("[getParent] 레이아웃 컨텍스트 스택이 비어있습니다."),null;const r=e[e.length-1];if(!r)return null;const a=r.dataContext||{};return{_local:r.state||a._local||{},_global:a._global||o.state.get()||{},setState:r.setState}},setParentLocal:(e,r,a)=>{const i=window.__g7LayoutContextStack||[];if(i.length===0){be.warn("[setParentLocal] 레이아웃 컨텍스트 스택이 비어있습니다.");return}const l=i[i.length-1];if(!l?.setState){be.warn("[setParentLocal] 부모 컨텍스트에 setState가 없습니다.");return}let c,d;typeof e=="string"?(c={[e]:r},d=a):(c=e,d=r&&typeof r=="object"&&"merge"in r?r:a);const f=d?.merge||"deep",g=ko(c),m=l.state?._local!==void 0,y=m?l.state._local:l.state||{};let w;f==="replace"?w=g:f==="shallow"?w={...y,...g}:w=ir(y,g),window.__g7PendingLocalState=w;const S=window.__templateApp;if(S?.setGlobalState&&S.setGlobalState({_local:w}),l.setState(w),m?l.state._local=w:l.state=w,l.dataContext&&(l.dataContext._local=w),f==="replace")window.__g7ForcedLocalFields=g;else{const v=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=ir(v,g)}Nd()},setParentGlobal:(e,r)=>{let a;typeof e=="string"?a={[e]:r}:a=e,o.state.set(a),be.log("[setParentGlobal] 전역 상태 업데이트:",a)}},window.__g7IsolatedStates||(window.__g7IsolatedStates={}),o.state.getGlobal=o.state.get,o.state.setGlobal=o.state.set,be.log("전역 객체 window.G7Core.state에 노출됨")}function Q_(o){o.dataSource={get:e=>window.__templateApp?.getDataSource?.(e),set:(e,r,a)=>{const i=window.__templateApp;i?.setDataSource?i.setDataSource(e,r,a):be.warn("G7Core.dataSource.set: TemplateApp이 초기화되지 않았습니다.")},refetch:async(e,r)=>{const a=window.__templateApp;if(a?.refetchDataSource)return a.refetchDataSource(e,r);be.warn("G7Core.dataSource.refetch: TemplateApp이 초기화되지 않았습니다.")},updateItem:(e,r,a,i,l)=>{const c=window.__templateApp;return c?.updateDataSourceItem?c.updateDataSourceItem(e,r,a,i,l):(be.warn("G7Core.dataSource.updateItem: TemplateApp이 초기화되지 않았습니다."),!1)},updateData:(e,r,a,i="append")=>{const l=window.__templateApp;if(!l?.getDataSource||!l?.setDataSource)return be.warn("G7Core.dataSource.updateData: TemplateApp이 초기화되지 않았습니다."),!1;const c=l.getDataSource(e);if(!c)return be.warn(`G7Core.dataSource.updateData: 데이터 소스 '${e}'를 찾을 수 없습니다.`),!1;let d,f=c,g=null;if(r){const y=r.split(".");g=y.pop();for(const w of y)if(f&&typeof f=="object"&&w in f)f=f[w];else return be.warn(`G7Core.dataSource.updateData: 경로 '${r}'를 찾을 수 없습니다.`),!1;d=f[g]}else d=c;if(!Array.isArray(d))return be.warn("G7Core.dataSource.updateData: 대상 경로의 데이터가 배열이 아닙니다."),!1;if(!Array.isArray(a))return be.warn("G7Core.dataSource.updateData: newData가 배열이 아닙니다."),!1;const m=i==="prepend"?[...a,...d]:[...d,...a];return r&&g?(f[g]=m,l.setDataSource(e,c,{merge:!1})):l.setDataSource(e,m,{merge:!1}),be.log(`G7Core.dataSource.updateData: '${e}'에 ${a.length}개 항목 ${i==="prepend"?"앞에":"뒤에"} 추가됨`),!0}},be.log("전역 객체 window.G7Core.dataSource에 노출됨")}function Z_(o,e){o.locale={current:()=>window.__templateApp?.getLocale?.()||"ko",supported:()=>{const a=window.__templateApp?.globalState?.appConfig?.supportedLocales;return Array.isArray(a)&&a.length>0?a:e.getState().templateMetadata?.locales||["ko","en"]},change:async r=>{const a=window.__templateApp;a?.changeLocale?await a.changeLocale(r):be.warn("G7Core.locale.change: TemplateApp이 초기화되지 않았습니다.")}},be.log("전역 객체 window.G7Core.locale에 노출됨")}function eA(o){o.toast={show:(e,r)=>{o.dispatch({handler:"toast",params:{message:e,type:r?.type||"info",...r?.duration&&{duration:r.duration}}})},success:(e,r)=>{o.toast.show(e,{type:"success",duration:r})},error:(e,r)=>{o.toast.show(e,{type:"error",duration:r})},warning:(e,r)=>{o.toast.show(e,{type:"warning",duration:r})},info:(e,r)=>{o.toast.show(e,{type:"info",duration:r})}},be.log("전역 객체 window.G7Core.toast에 노출됨")}function tA(o){o.modal={open:e=>{o.dispatch({handler:"openModal",target:e})},close:e=>{o.dispatch({handler:"closeModal",...e&&{target:e}})},closeAll:()=>{o.dispatch({handler:"closeAllModals"})},isOpen:e=>{const r=o.state.get();return r._global?.activeModal===e||r._global?.modalStack?.includes(e)||!1},getStack:()=>o.state.get()._global?.modalStack||[]},be.log("전역 객체 window.G7Core.modal에 노출됨")}function nA(o){o.style={mergeClasses:U_,conditionalClass:B_,joinClasses:P_},be.log("전역 객체 window.G7Core.style에 노출됨")}function rA(o,e){const{webSocketManager:r}=e;o.websocket={manager:r,subscribe:(a,i,l,c)=>r.subscribe(a,i,l,c),unsubscribe:a=>r.unsubscribe(a),leaveChannel:a=>r.leaveChannel(a),disconnect:()=>r.disconnect(),isInitialized:()=>r.isInitialized(),getSubscriptionCount:()=>r.getSubscriptionCount()},be.log("전역 객체 window.G7Core.websocket에 노출됨")}function aA(o,e){const{transitionManager:r}=e;o.navigation={isPending:()=>r?.getIsPending?.()||!1,onComplete:a=>{if(!r)return a(),()=>{};let i=r.getIsPending();const l=r.subscribe(c=>{c?i=!0:i&&(a(),l())});return l}},be.log("전역 객체 window.G7Core.navigation에 노출됨")}function iA(o){o.plugin={getSettings:e=>window.G7Config?.plugins?.[e],get:(e,r,a)=>window.G7Config?.plugins?.[e]?.[r]??a,getAll:()=>window.G7Config?.plugins??{}},be.log("전역 객체 window.G7Core.plugin에 노출됨")}function sA(o){o.module={getSettings:e=>window.G7Config?.modules?.[e],get:(e,r,a)=>window.G7Config?.modules?.[e]?.[r]??a,getAll:()=>window.G7Config?.modules??{}},be.log("전역 객체 window.G7Core.module에 노출됨")}function oA(o,e){const{transitionManager:r,responsiveManager:a}=e;o.AuthManager=br,o.api=jr(),o.TransitionManager=r,o.useTransitionState=om,o.ResponsiveManager=a,o.useResponsive=zd,o.useControllableState=J0,o.shallowArrayEqual=Q0,o.shallowObjectEqual=cm,o.updateQueryParams=async(i,l)=>{const c=window.__templateApp;if(c?.updateQueryParams)return c.updateQueryParams(i,l);be.warn("G7Core.updateQueryParams: TemplateApp이 초기화되지 않았습니다.")},be.log("전역 객체 window.G7Core.AuthManager에 노출됨"),be.log("전역 객체 window.G7Core.api에 노출됨"),be.log("전역 객체 window.G7Core.ResponsiveManager에 노출됨"),be.log("전역 객체 window.G7Core.useResponsive에 노출됨"),be.log("전역 객체 window.G7Core.useControllableState에 노출됨"),be.log("전역 객체 window.G7Core.updateQueryParams에 노출됨")}function lA(o,e){o.getSlotContext=()=>window.__slotContextValue??null,o.getDynamicRenderer=()=>window.__DynamicRenderer??null,o.getComponentRegistry=()=>e.getComponentRegistry?.()??mr.getInstance(),o.getDataBindingEngine=()=>e.getDataBindingEngine?.()??e.getState().bindingEngine,o.getTranslationEngine=()=>e.getTranslationEngine?.()??e.getState().translationEngine,o.getActionDispatcher=()=>e.getActionDispatcher?.()??e.getState().actionDispatcher,be.log("전역 객체 window.G7Core 슬롯 API에 노출됨 (getSlotContext, getDynamicRenderer 등)")}function cA(o){o.identity={setLauncher:mt.setLauncher.bind(mt),handle:mt.handle.bind(mt),isIdentityRequired:mt.isIdentityRequired.bind(mt),hasLauncher:mt.hasLauncher.bind(mt),markDomainNoticeShown:mt.markDomainNoticeShown.bind(mt),redirectExternally:mt.redirectExternally.bind(mt),createDeferred:mt.createDeferred.bind(mt),resolveDeferred:mt.resolveDeferred.bind(mt),reset:mt.reset.bind(mt),redirectStashKey:Rd},be.log("전역 객체 window.G7Core 본인인증(IDV) API에 노출됨 (identity)")}function uA(o){if(typeof window>"u")return;q_(),window.G7Core||(window.G7Core={});const e=window.G7Core;V_(e),G_(e),F_(e),oA(e,o),K_(e,o),W_(e,o),Y_(e),J_(e),Q_(e),Z_(e,o),eA(e),tA(e),nA(e),rA(e,o),aA(e,o),iA(e),sA(e),lA(e,o),cA(e),be.log("G7Core 전역 객체 초기화 완료")}function dA(){const o=window.G7Core;if(!o){be.warn("G7Core가 초기화되지 않았습니다.");return}const e=()=>Ma.getInstance(),r={isEnabled:()=>{try{return e().isEnabled()}catch{return!1}},trackRender:a=>{try{e().isEnabled()&&e().trackRender(a)}catch{}},trackIteration:(a,i,l,c,d)=>{try{e().isEnabled()&&e().trackIteration(a,{source:i,itemVar:l,indexVar:c,sourceLength:d})}catch{}},trackIfCondition:(a,i,l,c)=>{try{e().isEnabled()&&e().trackIfCondition(a,i,l)}catch{}},trackMount:(a,i)=>{try{e().isEnabled()&&e().trackMount(a,{...i,id:a})}catch{}},trackUnmount:a=>{try{e().isEnabled()&&e().trackUnmount(a)}catch{}},trackExpressionEval:a=>{try{e().isEnabled()&&e().trackExpressionEval(a)}catch{}},trackBindingEval:a=>{try{e().isEnabled()&&e().trackBindingEval(a)}catch{}},recordCacheHit:()=>{try{e().isEnabled()&&e().recordCacheHit()}catch{}},recordCacheMiss:()=>{try{e().isEnabled()&&e().recordCacheMiss()}catch{}},trackHandlerRegistration:(a,i,l,c)=>{try{e().isEnabled()&&e().trackHandlerRegistration(a,i,l,c)}catch{}},trackHandlerUnregistration:a=>{try{e().isEnabled()&&e().trackHandlerUnregistration(a)}catch{}},logAction:a=>{try{e().isEnabled()&&e().logAction(a)}catch{}},trackRequest:(a,i)=>{try{return e().isEnabled()?e().trackRequest(a,i):""}catch{return""}},completeRequest:(a,i,l)=>{try{e().isEnabled()&&e().completeRequest(a,i,l)}catch{}},failRequest:(a,i)=>{try{e().isEnabled()&&e().failRequest(a,i)}catch{}},trackDataSourceDefinition:a=>{try{e().isEnabled()&&e().trackDataSourceDefinition(a)}catch{}},trackDataSourceLoading:a=>{try{e().isEnabled()&&e().trackDataSourceLoading(a)}catch{}},trackDataSourceLoaded:(a,i,l)=>{try{e().isEnabled()&&e().trackDataSourceLoaded(a,i,l)}catch{}},trackDataSourceError:(a,i)=>{try{e().isEnabled()&&e().trackDataSourceError(a,i)}catch{}},trackForm:(a,i,l)=>{try{e().isEnabled()&&e().trackForm(a,i,l)}catch{}},untrackForm:a=>{try{e().isEnabled()&&e().untrackForm(a)}catch{}},startStateChange:(a,i,l,c)=>{try{return e().isEnabled()?e().startStateChange(a,i,l,c):""}catch{return""}},completeStateChange:a=>{try{e().isEnabled()&&e().completeStateChange(a)}catch{}},trackComponentRender:(a,i,l,c,d,f)=>{try{e().isEnabled()&&e().trackComponentRender(a,i,l,c,d,f)}catch{}},updateLocalState:a=>{try{e().isEnabled()&&e().updateLocalState(a)}catch{}},updateComputedState:a=>{try{e().isEnabled()&&e().updateComputedState(a)}catch{}},updateParentContext:a=>{try{e().isEnabled()&&e().updateParentContext(a)}catch{}},trackComponentStateSource:(a,i,l,c)=>{try{e().isEnabled()&&e().trackComponentStateSource(a,i,l,c)}catch{}},trackDynamicState:(a,i)=>{try{e().isEnabled()&&e().trackDynamicState(a,i)}catch{}},trackContextFlow:(a,i,l,c,d,f)=>{try{e().isEnabled()&&e().trackContextFlow(a,i,l,c,d,f)}catch{}},trackComponentStyle:(a,i,l,c)=>{try{e().isEnabled()&&e().trackComponentStyle(a,i,l,c)}catch{}},trackAuthEvent:(a,i,l,c)=>{try{e().isEnabled()&&e().trackAuthEvent(a,i,l,c)}catch{}},trackAuthHeader:(a,i,l,c,d)=>{try{e().isEnabled()&&e().trackAuthHeader(a,i,l,c,d)}catch{}},trackLog:(a,i,l)=>{try{e().isEnabled()&&e().trackLog(a,i,l)}catch{}},trackAction:a=>{try{e().isEnabled()&&e().trackAction?.(a)}catch{}},trackDataSourceUpdate:a=>{try{e().isEnabled()&&e().trackDataSourceUpdate?.(a)}catch{}},startSequenceExecution:a=>{try{return e().isEnabled()?e().startSequenceExecution(a):""}catch{return""}},captureSequenceActionBefore:(a,i,l,c,d)=>{try{e().isEnabled()&&e().captureSequenceActionBefore(a,i,l,c,d)}catch{}},captureSequenceActionAfter:(a,i,l,c,d,f)=>{try{e().isEnabled()&&e().captureSequenceActionAfter(a,i,l,c,d,f)}catch{}},endSequenceExecution:(a,i)=>{try{e().isEnabled()&&e().endSequenceExecution(a,i)}catch{}},registerStateCaptureForHandler:(a,i,l)=>{try{e().isEnabled()&&e().registerStateCaptureForHandler(a,i,l)}catch{}},detectStaleClosure:(a,i,l,c,d)=>{try{return e().isEnabled()?e().detectStaleClosure(a,i,l,c,d):[]}catch{return[]}},trackStaleClosureWarning:a=>{try{e().isEnabled()&&e().trackStaleClosureWarning(a)}catch{}},trackModalOpen:a=>{try{e().isEnabled()&&e().trackModalOpen(a)}catch{}},trackModalClose:(a,i)=>{try{e().isEnabled()&&e().trackModalClose(a,i)}catch{}},trackModalStateChange:a=>{try{e().isEnabled()&&e().trackModalStateChange(a)}catch{}},trackNestedContext:a=>{try{return e().isEnabled()?e().trackNestedContext(a):""}catch{return""}},trackNestedContextAccess:(a,i)=>{try{e().isEnabled()&&e().trackNestedContextAccess(a,i)}catch{}},trackComputedProperty:(a,i,l,c,d,f,g)=>{try{e().isEnabled()&&e().trackComputedProperty(a,i,l,c,d,f,g)}catch{}},trackComputedRecalc:(a,i,l,c,d,f,g)=>{try{e().isEnabled()&&e().trackComputedRecalc(a,i,l,c,d,f,g)}catch{}},setNamedActionDefinitions:a=>{try{e().isEnabled()&&e().setNamedActionDefinitions(a)}catch{}},trackNamedActionRef:a=>{try{e().isEnabled()&&e().trackNamedActionRef(a)}catch{}}};o.devTools=r,be.log("G7Core.devTools 인터페이스 초기화 완료")}let Ro=null;function fA(){const o=window.G7Core;return o?.__devtools?Promise.resolve(o.__devtools):Ro||(Ro=new Promise((e,r)=>{const a=window.G7Config?.coreDevToolsAsset||"/build/core/devtools.min.js",i="g7-devtools-bundle",l=()=>{const f=window.G7Core?.__devtools;f?e(f):r(new Error("DevTools 번들 로드됨 — 그러나 __devtools 미노출"))};window.G7Core=window.G7Core||{},window.G7Core.__onDevToolsReady=l;const c=document.getElementById(i);if(c){c.addEventListener("load",l,{once:!0}),c.addEventListener("error",()=>r(new Error(`DevTools 번들 로드 실패: ${a}`)),{once:!0});return}const d=document.createElement("script");d.id=i,d.src=a,d.async=!1,d.addEventListener("load",l,{once:!0}),d.addEventListener("error",()=>{Ro=null,r(new Error(`DevTools 번들 로드 실패: ${a}`))},{once:!0}),document.head.appendChild(d)}),Ro)}function hA(){const o=window.G7Core;if(!o){be.warn("G7Core가 초기화되지 않았습니다.");return}const e=Ma.getInstance();if(e.initialize(),!e.isEnabled()){window.G7DevTools={isEnabled:()=>!1,enable:()=>{be.log("환경설정 > 고급 설정 > 디버그 모드를 켜세요")}},sd(),be.log("G7DevTools 비활성화됨 (디버그 모드 꺼짐)");return}gA(o,e)}async function gA(o,e){let r;try{r=await fA()}catch(g){be.warn("DevTools 번들 로드 실패 — 최소 API 로 폴백:",g),window.G7DevTools={isEnabled:()=>!1,enable:()=>{}},sd();return}const{DiagnosticEngine:a,getServerConnector:i,getStyleTracker:l}=r;dA(),sd();try{l().enable(),be.log("StyleTracker 활성화됨")}catch(g){be.warn("StyleTracker 활성화 실패:",g)}const c=new a,d=i(),f={isEnabled:()=>e.isEnabled(),state:{get:()=>e.getState(),getHistory:()=>e.getStateHistory(),watch:(g,m)=>e.watchState(g,m)},actions:{getHistory:()=>e.getActionHistory(),watch:g=>e.watchActions(g),getMetrics:()=>e.getActionMetrics()},binding:{evaluate:g=>{const m=o.getDataBindingEngine?.();if(!m){be.warn("DataBindingEngine이 없습니다.");return}return m.evaluateExpression(g,e.getState())},getCacheStats:()=>e.getCacheStats(),clearStats:()=>{e.resetCacheStats(),be.log("캐시 통계 초기화됨")}},diagnose:{analyze:g=>c.analyze(g),suggestFix:g=>c.suggestFix(g),getCommonIssues:()=>c.getCommonIssues(),getRulesByCategory:g=>c.getRulesByCategory(g)},server:{dumpState:g=>d.dumpState(g),sendLog:g=>d.sendLog(g),sendError:(g,m)=>d.sendError(g,m),isConnected:()=>d.isConnected(),testConnection:()=>d.testConnection()},config:{isDebugMode:()=>e.isEnabled(),setLogLevel:g=>e.setLogLevel(g),setMaxHistory:g=>e.setMaxHistory(g)},lifecycle:{getMountedComponents:()=>e.getLifecycleInfo().mountedComponents,getOrphanedListeners:()=>e.getLifecycleInfo().orphanedListeners},performance:{getRenderCount:()=>e.getPerformanceInfo().renderCounts,getBindingEvalCount:()=>e.getPerformanceInfo().bindingEvalCount,getMemoryWarnings:()=>e.getPerformanceInfo().memoryWarnings,startProfiling:()=>e.startProfiling(),stopProfiling:()=>e.stopProfiling()},network:{getActiveRequests:()=>e.getNetworkInfo().activeRequests,getRequestHistory:()=>e.getNetworkInfo().requestHistory,getPendingDataSources:()=>e.getNetworkInfo().pendingDataSources},conditional:{getIfConditions:()=>e.getConditionalInfo().ifConditions,getIterations:()=>e.getConditionalInfo().iterations},form:{getForms:()=>e.getFormInfo()},websocket:{getInfo:()=>e.getWebSocketInfo()}};window.G7DevTools=f,o.devtools=f,be.log("G7DevTools 전역 객체 초기화 완료 (window.G7DevTools)"),pA(r.DevToolsPanel)}function pA(o){if(document.getElementById("g7-devtools-root")){be.log("DevToolsPanel 이미 렌더링됨");return}const e=document.createElement("div");e.id="g7-devtools-root",document.body.appendChild(e);try{ad.createRoot(e).render(We.createElement(o)),be.log("DevToolsPanel UI 렌더링 완료")}catch(r){be.error("DevToolsPanel UI 렌더링 실패:",r)}}const Qe=ut("TemplateEngine"),re={templateId:null,locale:"ko",isInitialized:!1,reactRoot:null,containerId:null,currentLayoutJson:null,currentDataContext:{},translationContext:{templateId:"",locale:"ko"},registry:null,bindingEngine:null,translationEngine:null,actionDispatcher:null,templateMetadata:null};let Do=!1;const Oo=[];async function mA(o){try{Qe.log("템플릿 메타데이터 로드 중...",o);const e=o.split("-").map(a=>a.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")).join(""),r=window[e];return r?.templateMetadata?(Qe.log("템플릿 메타데이터 로드 완료 (전역 변수)",r.templateMetadata),r.templateMetadata):(Qe.warn(`템플릿 번들에 메타데이터가 없습니다. 전역 변수: ${e}`),{identifier:o,locales:["ko","en"],name:{ko:o,en:o},description:{ko:"",en:""},version:"1.0.0",type:"admin"})}catch(e){return Qe.error("템플릿 메타데이터 로드 실패",e),{identifier:o,locales:["ko","en"],name:{ko:o,en:o},description:{ko:"",en:""},version:"1.0.0",type:"admin"}}}function my(){const e=(typeof window<"u"?window.__templateApp:void 0)?.globalState?.appConfig?.supportedLocales,r=re.templateMetadata?.locales;return{$locale:re.locale,$locales:Array.isArray(e)&&e.length>0?e:r||["ko","en"],$templateLocales:r||["ko","en"],$templateId:re.templateId}}async function Lo(o){try{if(Qe.log("템플릿 엔진 초기화 시작",o),re.isInitialized)throw new Error("템플릿 엔진이 이미 초기화되었습니다. destroyTemplate()을 먼저 호출하세요.");if(!o.templateId)throw new x_;Do=o.debug??!1,typeof window<"u"&&(window.G7Config||(window.G7Config={}),window.G7Config.debug=Do),hA(),re.templateId=o.templateId,re.locale=o.locale||"ko",Qe.log("엔진 인스턴스 생성 중..."),re.registry=mr.getInstance(),re.bindingEngine=new _n,re.translationEngine=gi.getInstance(),o.cacheVersion!==void 0&&o.cacheVersion>0&&re.translationEngine.setCacheVersion(o.cacheVersion),re.translationContext={templateId:o.templateId,locale:re.locale},re.actionDispatcher=new mo({},re.translationEngine,re.translationContext),P0(re.actionDispatcher),Qe.log("다국어 파일 로드 중...",o.templateId,re.locale);const e="en",r=[re.translationEngine.loadTranslations(o.templateId,re.locale).then(()=>{Qe.log(`다국어 파일 로드 완료: ${re.locale}`)}).catch(a=>{Qe.warn(`다국어 파일 로드 실패 (${re.locale}):`,a instanceof Error?a.message:a)})];re.locale!==e&&r.push(re.translationEngine.loadTranslations(o.templateId,e).then(()=>{Qe.log(`폴백 다국어 파일 로드 완료: ${e}`)}).catch(a=>{Qe.warn(`폴백 다국어 파일 로드 실패 (${e}):`,a instanceof Error?a.message:a)})),await Promise.allSettled(r),Qe.log("템플릿 메타데이터 로드 중...",o.templateId),re.templateMetadata=await mA(o.templateId),re.isInitialized=!0,Qe.log("템플릿 엔진 초기화 완료 (ComponentRegistry는 별도 로드)")}catch(e){throw Qe.error("템플릿 엔진 초기화 실패",e),re.isInitialized=!1,re.registry=null,re.bindingEngine=null,re.translationEngine=null,re.actionDispatcher=null,e}}let Mo=null;function vf(){const o=window.G7Core;return o?.__LayoutEditorChrome?Promise.resolve(o.__LayoutEditorChrome):Mo||(Mo=new Promise((e,r)=>{const a=window.G7Config?.coreEditorAsset||"/build/core/layout-editor.min.js",i="g7-layout-editor-bundle",l=document.getElementById(i),c=()=>{const f=window.G7Core?.__LayoutEditorChrome;f?e(f):r(new Error("편집기 번들 로드됨 — 그러나 __LayoutEditorChrome 미노출"))};if(window.G7Core=window.G7Core||{},window.G7Core.__onChromeReady=c,l){l.addEventListener("load",c,{once:!0}),l.addEventListener("error",()=>r(new Error(`편집기 번들 로드 실패: ${a}`)),{once:!0});return}const d=document.createElement("script");d.id=i,d.src=a,d.async=!1,d.addEventListener("load",c,{once:!0}),d.addEventListener("error",()=>{Mo=null,r(new Error(`편집기 번들 로드 실패: ${a}`))},{once:!0}),document.head.appendChild(d)}),Mo)}async function us(o){try{if(Qe.log("템플릿 렌더링 시작",o),!re.isInitialized)throw new Error("템플릿 엔진이 초기화되지 않았습니다. initTemplateEngine()을 먼저 호출하세요.");if(!o.containerId)throw new Error("containerId는 필수입니다.");if(!o.layoutJson)throw new Error("layoutJson은 필수입니다.");const e=document.getElementById(o.containerId);if(!e)throw new Error(`컨테이너를 찾을 수 없습니다: #${o.containerId}`);const r=my();if(re.containerId=o.containerId,re.currentLayoutJson=o.layoutJson,re.currentDataContext={...r,...o.dataContext||{}},re.translationContext=o.translationContext||{templateId:re.templateId||"",locale:re.locale},re.reactRoot||(Qe.log("React Root 생성"),re.reactRoot=ad.createRoot(e)),typeof window<"u"){const l=uy(window.location.pathname);if(l){Qe.log("레이아웃 편집기 모드 진입",l);let c;try{c=await vf()}catch(f){Qe.error("레이아웃 편집기 번들 로드 실패",f),gf.render(o.containerId,{title:"레이아웃 편집기 로드 실패",message:f instanceof Error?f.message:"편집기 번들을 불러오지 못했습니다.",icon:"fas fa-triangle-exclamation",showStack:!1,showReloadButton:!0,debug:Do});return}const d=We.createElement(c,{templateIdentifier:l.templateIdentifier,initialLocale:re.locale});re.reactRoot.render(We.createElement(_c,{translationEngine:re.translationEngine,translationContext:re.translationContext,children:We.createElement(Id,{children:We.createElement(uc,{children:We.createElement(cf,{children:d})})})}));return}}const a=o.layoutJson.components||[];if(a.length===0){Qe.warn("렌더링할 컴포넌트가 없습니다.");return}const i=o.layoutJson.modals||[];if(Qe.log("modals 배열:",i),Qe.log("modals 개수:",i.length),Qe.log("DynamicRenderer로 렌더링 시작"),re.reactRoot.render(We.createElement(_c,{translationEngine:re.translationEngine,translationContext:re.translationContext},We.createElement(Id,null,We.createElement(uc,null,We.createElement(cf,null,[...a.map((l,c)=>{const d=re.currentLayoutJson?.layout_name||"";return We.createElement(Br,{key:d&&!l._fromBase?`${l.id}_${d}`:l.id,componentDef:l,dataContext:re.currentDataContext,translationContext:re.translationContext,registry:re.registry,bindingEngine:re.bindingEngine,translationEngine:re.translationEngine,actionDispatcher:re.actionDispatcher,isRootRenderer:c===0,layoutKey:d})}),We.createElement(tm,{key:"__modal_parent_context_provider"},i.map(l=>{const c=re.currentDataContext._global?.modalStack||[],f=c.includes(l.id)||re.currentDataContext._global?.activeModal===l.id,g=c.indexOf(l.id),m=g>=0?50+g:50,y=window.__g7LayoutContextStack||[],S=y[y.length-1]?.dataContext,v=We.createElement(Br,{key:`modal_${l.id}_renderer`,componentDef:{...l,props:{...l.props,isOpen:f,style:{...l.props?.style,zIndex:m},onClose:re.actionDispatcher?.createHandler({type:"click",handler:"closeModal"},re.currentDataContext)}},dataContext:re.currentDataContext,translationContext:re.translationContext,registry:re.registry,bindingEngine:re.bindingEngine,translationEngine:re.translationEngine,actionDispatcher:re.actionDispatcher,parentDataContext:S});return l.data_sources&&l.data_sources.length>0?We.createElement(ly,{key:`modal_${l.id}`,isOpen:f,modalId:l.id,dataSources:l.data_sources,dataContext:re.currentDataContext,globalStateUpdater:re.actionDispatcher?.getGlobalStateUpdater(),bindingEngine:re.bindingEngine,debug:Do,children:v}):v}))]))))),Qe.log("템플릿 렌더링 완료"),Oo.length>0){Qe.log(`대기 중인 데이터 업데이트 ${Oo.length}건 적용`);const l=[...Oo];Oo.length=0;for(const{data:c,options:d}of l)ds(c,d)}}catch(e){throw Qe.error("템플릿 렌더링 실패",e),e}}function ds(o,e){try{if(Qe.log("템플릿 데이터 업데이트 시작",Object.keys(o)),!re.isInitialized)throw new Error("템플릿 엔진이 초기화되지 않았습니다.");if(!re.reactRoot||!re.currentLayoutJson){Qe.log("React 미준비 - 데이터 업데이트 큐잉:",Object.keys(o)),Oo.push({data:o,options:e});return}const r=my(),a={...re.currentDataContext._global||{},...o._global||{}},i=Y0(re.currentDataContext._localInit,o._localInit);re.currentDataContext={...r,...re.currentDataContext,...o,_global:a,_localInit:i},a._local!==void 0&&(re.currentDataContext._local=a._local),a._computed!==void 0&&(re.currentDataContext._computed=a._computed);const l=re.currentLayoutJson.components||[],c=re.currentLayoutJson.modals||[];Qe.log("updateTemplateData - modals 배열:",c),Qe.log("updateTemplateData - modals 개수:",c.length),Qe.log("updateTemplateData - activeModal:",re.currentDataContext._global?.activeModal);const d=()=>{re.reactRoot.render(We.createElement(_c,{translationEngine:re.translationEngine,translationContext:re.translationContext},We.createElement(Id,null,We.createElement(uc,null,We.createElement(cf,null,[...l.map((f,g)=>{const m=re.currentLayoutJson?.layout_name||"";return We.createElement(Br,{key:m&&!f._fromBase?`${f.id}_${m}`:f.id,componentDef:f,dataContext:re.currentDataContext,translationContext:re.translationContext,registry:re.registry,bindingEngine:re.bindingEngine,translationEngine:re.translationEngine,actionDispatcher:re.actionDispatcher,isRootRenderer:g===0,layoutKey:m})}),We.createElement(tm,{key:"__modal_parent_context_provider_update"},c.map(f=>{const g=re.currentDataContext._global?.modalStack||[],y=g.includes(f.id)||re.currentDataContext._global?.activeModal===f.id,w=g.indexOf(f.id),S=w>=0?50+w:50,v=window.__g7LayoutContextStack||[],x=v[v.length-1]?.dataContext,R=We.createElement(Br,{key:`modal_${f.id}_renderer`,componentDef:{...f,props:{...f.props,isOpen:y,style:{...f.props?.style,zIndex:S},onClose:re.actionDispatcher?.createHandler({type:"click",handler:"closeModal"},re.currentDataContext)}},dataContext:re.currentDataContext,translationContext:re.translationContext,registry:re.registry,bindingEngine:re.bindingEngine,translationEngine:re.translationEngine,actionDispatcher:re.actionDispatcher,parentDataContext:x});return f.data_sources&&f.data_sources.length>0?We.createElement(ly,{key:`modal_${f.id}`,isOpen:y,modalId:f.id,dataSources:f.data_sources,dataContext:re.currentDataContext,globalStateUpdater:re.actionDispatcher?.getGlobalStateUpdater(),bindingEngine:re.bindingEngine,debug:Do,children:R}):R}))])))))};e?.sync?(Qe.log("재렌더링 시작 (sync mode - 즉시 렌더링)"),d()):(Qe.log("재렌더링 시작 (with startTransition)"),N.startTransition(()=>{d()})),Qe.log("템플릿 데이터 업데이트 완료")}catch(r){throw Qe.error("템플릿 데이터 업데이트 실패",r),r}}function Oc(){try{Qe.log("템플릿 정리 시작"),re.reactRoot&&(Qe.log("React Root 언마운트"),re.reactRoot.unmount(),re.reactRoot=null),re.templateId=null,re.locale="ko",re.isInitialized=!1,re.containerId=null,re.currentLayoutJson=null,re.currentDataContext={},re.translationContext={templateId:"",locale:"ko"},re.registry=null,re.bindingEngine=null,re.translationEngine=null,re.actionDispatcher=null,re.templateMetadata=null,Qe.log("템플릿 정리 완료")}catch(o){throw Qe.error("템플릿 정리 실패",o),o}}function ta(){return Object.freeze({...re})}function yy(){return re.actionDispatcher}const $o={initTemplateEngine:Lo,renderTemplate:us,updateTemplateData:ds,destroyTemplate:Oc,getState:ta};typeof window<"u"&&(window.G7Core||(window.G7Core={}),window.G7Core.TemplateEngine=$o,uA({getState:()=>({translationEngine:re.translationEngine,translationContext:re.translationContext,bindingEngine:re.bindingEngine,actionDispatcher:re.actionDispatcher,templateMetadata:re.templateMetadata}),transitionManager:zr,responsiveManager:mi,webSocketManager:Tc}),Qe.log("전역 객체 window.G7Core.TemplateEngine에 노출됨"));const Pr=Object.freeze(Object.defineProperty({__proto__:null,DataSourceManager:_r,LayoutLoader:of,TemplateApp:To,TemplateEngine:$o,default:$o,destroyTemplate:Oc,getActionDispatcher:yy,getState:ta,initTemplateApp:bf,initTemplateEngine:Lo,loadLayoutEditorBundle:vf,renderTemplate:us,updateTemplateData:ds},Symbol.toStringTag,{value:"Module"}));Wt.DataSourceManager=_r,Wt.LayoutLoader=of,Wt.TemplateApp=To,Wt.TemplateEngine=$o,Wt.default=$o,Wt.destroyTemplate=Oc,Wt.getActionDispatcher=yy,Wt.getState=ta,Wt.initTemplateApp=bf,Wt.initTemplateEngine=Lo,Wt.loadLayoutEditorBundle=vf,Wt.renderTemplate=us,Wt.updateTemplateData=ds,Object.defineProperties(Wt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})(this.G7Core=this.G7Core||{});