Laravel chunk/each 는 OFFSET 기반이라, 콜백이 행의 필터 소속을 바꾸면 (필터 컬럼을 채우거나 매칭 행을 삭제하면) 다음 조회가 그만큼 앞으로 밀려 미처리 행을 조용히 건너뛴다. 250건/청크 100 이면 정확히 100건이 남는다. 코어·번들 확장 전수 조사로 확정한 6곳을 chunkById(키셋 순회)로 통일했다. 브라우저 검수(28축)에서 계획에 없던 결함 12건이 드러나 같은 사슬에서 수정했다. 이 중 layout_strategy=keep 무효화와 수정 감지 실패 시 "수정 없음" 오보는 사용자 작업 소실에 직결된다. 재발 방지로 audit 룰을 추가했고, 수정 6곳을 원복해 red 6건 / 복원 후 green 0건으로 판별력을 검증했다.
245 lines
747 KiB
JavaScript
245 lines
747 KiB
JavaScript
var gT=Object.defineProperty;var pT=(Xt,Ya,Xa)=>Ya in Xt?gT(Xt,Ya,{enumerable:!0,configurable:!0,writable:!0,value:Xa}):Xt[Ya]=Xa;var $=(Xt,Ya,Xa)=>pT(Xt,typeof Ya!="symbol"?Ya+"":Ya,Xa);(function(Xt){"use strict";function Ya(o,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in o)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(o,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}function Xa(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Yu={exports:{}},We={};var Ig;function zS(){if(Ig)return We;Ig=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=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"),b=Symbol.for("react.activity"),v=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=v&&A[v]||A["@@iterator"],typeof A=="function"?A:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,k={};function O(A,K,ue){this.props=A,this.context=K,this.refs=k,this.updater=ue||_}O.prototype.isReactComponent={},O.prototype.setState=function(A,K){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,K,"setState")},O.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function M(){}M.prototype=O.prototype;function T(A,K,ue){this.props=A,this.context=K,this.refs=k,this.updater=ue||_}var D=T.prototype=new M;D.constructor=T,x(D,O.prototype),D.isPureReactComponent=!0;var j=Array.isArray;function H(){}var P={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function pe(A,K,ue){var he=ue.ref;return{$$typeof:o,type:A,key:K,ref:he!==void 0?he:null,props:ue}}function _e(A,K){return pe(A.type,K,A.props)}function we(A){return typeof A=="object"&&A!==null&&A.$$typeof===o}function Me(A){var K={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(ue){return K[ue]})}var qe=/\/+/g;function Je(A,K){return typeof A=="object"&&A!==null&&A.key!=null?Me(""+A.key):K.toString(36)}function gt(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(H,H):(A.status="pending",A.then(function(K){A.status==="pending"&&(A.status="fulfilled",A.value=K)},function(K){A.status==="pending"&&(A.status="rejected",A.reason=K)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function Q(A,K,ue,he,le){var de=typeof A;(de==="undefined"||de==="boolean")&&(A=null);var Oe=!1;if(A===null)Oe=!0;else switch(de){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(A.$$typeof){case o:case e:Oe=!0;break;case m:return Oe=A._init,Q(Oe(A._payload),K,ue,he,le)}}if(Oe)return le=le(A),Oe=he===""?"."+Je(A,0):he,j(le)?(ue="",Oe!=null&&(ue=Oe.replace(qe,"$&/")+"/"),Q(le,K,ue,"",function(ke){return ke})):le!=null&&(we(le)&&(le=_e(le,ue+(le.key==null||A&&A.key===le.key?"":(""+le.key).replace(qe,"$&/")+"/")+Oe)),K.push(le)),1;Oe=0;var He=he===""?".":he+":";if(j(A))for(var Pe=0;Pe<A.length;Pe++)he=A[Pe],de=He+Je(he,Pe),Oe+=Q(he,K,ue,de,le);else if(Pe=S(A),typeof Pe=="function")for(A=Pe.call(A),Pe=0;!(he=A.next()).done;)he=he.value,de=He+Je(he,Pe++),Oe+=Q(he,K,ue,de,le);else if(de==="object"){if(typeof A.then=="function")return Q(gt(A),K,ue,he,le);throw K=String(A),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function fe(A,K,ue){if(A==null)return A;var he=[],le=0;return Q(A,he,"","",function(de){return K.call(ue,de,le++)}),he}function ve(A){if(A._status===-1){var K=A._result;K=K(),K.then(function(ue){(A._status===0||A._status===-1)&&(A._status=1,A._result=ue)},function(ue){(A._status===0||A._status===-1)&&(A._status=2,A._result=ue)}),A._status===-1&&(A._status=0,A._result=K)}if(A._status===1)return A._result.default;throw A._result}var ae=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},ge={map:fe,forEach:function(A,K,ue){fe(A,function(){K.apply(this,arguments)},ue)},count:function(A){var K=0;return fe(A,function(){K++}),K},toArray:function(A){return fe(A,function(K){return K})||[]},only:function(A){if(!we(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return We.Activity=b,We.Children=ge,We.Component=O,We.Fragment=n,We.Profiler=i,We.PureComponent=T,We.StrictMode=r,We.Suspense=f,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,We.__COMPILER_RUNTIME={__proto__:null,c:function(A){return P.H.useMemoCache(A)}},We.cache=function(A){return function(){return A.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(A,K,ue){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var he=x({},A.props),le=A.key;if(K!=null)for(de in K.key!==void 0&&(le=""+K.key),K)!X.call(K,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&K.ref===void 0||(he[de]=K[de]);var de=arguments.length-2;if(de===1)he.children=ue;else if(1<de){for(var Oe=Array(de),He=0;He<de;He++)Oe[He]=arguments[He+2];he.children=Oe}return pe(A.type,le,he)},We.createContext=function(A){return A={$$typeof:u,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:l,_context:A},A},We.createElement=function(A,K,ue){var he,le={},de=null;if(K!=null)for(he in K.key!==void 0&&(de=""+K.key),K)X.call(K,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(le[he]=K[he]);var Oe=arguments.length-2;if(Oe===1)le.children=ue;else if(1<Oe){for(var He=Array(Oe),Pe=0;Pe<Oe;Pe++)He[Pe]=arguments[Pe+2];le.children=He}if(A&&A.defaultProps)for(he in Oe=A.defaultProps,Oe)le[he]===void 0&&(le[he]=Oe[he]);return pe(A,de,le)},We.createRef=function(){return{current:null}},We.forwardRef=function(A){return{$$typeof:d,render:A}},We.isValidElement=we,We.lazy=function(A){return{$$typeof:m,_payload:{_status:-1,_result:A},_init:ve}},We.memo=function(A,K){return{$$typeof:g,type:A,compare:K===void 0?null:K}},We.startTransition=function(A){var K=P.T,ue={};P.T=ue;try{var he=A(),le=P.S;le!==null&&le(ue,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(H,ae)}catch(de){ae(de)}finally{K!==null&&ue.types!==null&&(K.types=ue.types),P.T=K}},We.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},We.use=function(A){return P.H.use(A)},We.useActionState=function(A,K,ue){return P.H.useActionState(A,K,ue)},We.useCallback=function(A,K){return P.H.useCallback(A,K)},We.useContext=function(A){return P.H.useContext(A)},We.useDebugValue=function(){},We.useDeferredValue=function(A,K){return P.H.useDeferredValue(A,K)},We.useEffect=function(A,K){return P.H.useEffect(A,K)},We.useEffectEvent=function(A){return P.H.useEffectEvent(A)},We.useId=function(){return P.H.useId()},We.useImperativeHandle=function(A,K,ue){return P.H.useImperativeHandle(A,K,ue)},We.useInsertionEffect=function(A,K){return P.H.useInsertionEffect(A,K)},We.useLayoutEffect=function(A,K){return P.H.useLayoutEffect(A,K)},We.useMemo=function(A,K){return P.H.useMemo(A,K)},We.useOptimistic=function(A,K){return P.H.useOptimistic(A,K)},We.useReducer=function(A,K,ue){return P.H.useReducer(A,K,ue)},We.useRef=function(A){return P.H.useRef(A)},We.useState=function(A){return P.H.useState(A)},We.useSyncExternalStore=function(A,K,ue){return P.H.useSyncExternalStore(A,K,ue)},We.useTransition=function(){return P.H.useTransition()},We.version="19.2.8",We}var Hg;function Xu(){return Hg||(Hg=1,Yu.exports=zS()),Yu.exports}var I=Xu();const Xe=Xa(I);var Ju={exports:{}},Ys={},Qu={exports:{}},Zu={};var zg;function jS(){return zg||(zg=1,(function(o){function e(Q,fe){var ve=Q.length;Q.push(fe);e:for(;0<ve;){var ae=ve-1>>>1,ge=Q[ae];if(0<i(ge,fe))Q[ae]=fe,Q[ve]=ge,ve=ae;else break e}}function n(Q){return Q.length===0?null:Q[0]}function r(Q){if(Q.length===0)return null;var fe=Q[0],ve=Q.pop();if(ve!==fe){Q[0]=ve;e:for(var ae=0,ge=Q.length,A=ge>>>1;ae<A;){var K=2*(ae+1)-1,ue=Q[K],he=K+1,le=Q[he];if(0>i(ue,ve))he<ge&&0>i(le,ue)?(Q[ae]=le,Q[he]=ve,ae=he):(Q[ae]=ue,Q[K]=ve,ae=K);else if(he<ge&&0>i(le,ve))Q[ae]=le,Q[he]=ve,ae=he;else break e}}return fe}function i(Q,fe){var ve=Q.sortIndex-fe.sortIndex;return ve!==0?ve:Q.id-fe.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 u=Date,d=u.now();o.unstable_now=function(){return u.now()-d}}var f=[],g=[],m=1,b=null,v=3,S=!1,_=!1,x=!1,k=!1,O=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function D(Q){for(var fe=n(g);fe!==null;){if(fe.callback===null)r(g);else if(fe.startTime<=Q)r(g),fe.sortIndex=fe.expirationTime,e(f,fe);else break;fe=n(g)}}function j(Q){if(x=!1,D(Q),!_)if(n(f)!==null)_=!0,H||(H=!0,Me());else{var fe=n(g);fe!==null&>(j,fe.startTime-Q)}}var H=!1,P=-1,X=5,pe=-1;function _e(){return k?!0:!(o.unstable_now()-pe<X)}function we(){if(k=!1,H){var Q=o.unstable_now();pe=Q;var fe=!0;try{e:{_=!1,x&&(x=!1,M(P),P=-1),S=!0;var ve=v;try{t:{for(D(Q),b=n(f);b!==null&&!(b.expirationTime>Q&&_e());){var ae=b.callback;if(typeof ae=="function"){b.callback=null,v=b.priorityLevel;var ge=ae(b.expirationTime<=Q);if(Q=o.unstable_now(),typeof ge=="function"){b.callback=ge,D(Q),fe=!0;break t}b===n(f)&&r(f),D(Q)}else r(f);b=n(f)}if(b!==null)fe=!0;else{var A=n(g);A!==null&>(j,A.startTime-Q),fe=!1}}break e}finally{b=null,v=ve,S=!1}fe=void 0}}finally{fe?Me():H=!1}}}var Me;if(typeof T=="function")Me=function(){T(we)};else if(typeof MessageChannel<"u"){var qe=new MessageChannel,Je=qe.port2;qe.port1.onmessage=we,Me=function(){Je.postMessage(null)}}else Me=function(){O(we,0)};function gt(Q,fe){P=O(function(){Q(o.unstable_now())},fe)}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(Q){Q.callback=null},o.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<Q?Math.floor(1e3/Q):5},o.unstable_getCurrentPriorityLevel=function(){return v},o.unstable_next=function(Q){switch(v){case 1:case 2:case 3:var fe=3;break;default:fe=v}var ve=v;v=fe;try{return Q()}finally{v=ve}},o.unstable_requestPaint=function(){k=!0},o.unstable_runWithPriority=function(Q,fe){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var ve=v;v=Q;try{return fe()}finally{v=ve}},o.unstable_scheduleCallback=function(Q,fe,ve){var ae=o.unstable_now();switch(typeof ve=="object"&&ve!==null?(ve=ve.delay,ve=typeof ve=="number"&&0<ve?ae+ve:ae):ve=ae,Q){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=ve+ge,Q={id:m++,callback:fe,priorityLevel:Q,startTime:ve,expirationTime:ge,sortIndex:-1},ve>ae?(Q.sortIndex=ve,e(g,Q),n(f)===null&&Q===n(g)&&(x?(M(P),P=-1):x=!0,gt(j,ve-ae))):(Q.sortIndex=ge,e(f,Q),_||S||(_=!0,H||(H=!0,Me()))),Q},o.unstable_shouldYield=_e,o.unstable_wrapCallback=function(Q){var fe=v;return function(){var ve=v;v=fe;try{return Q.apply(this,arguments)}finally{v=ve}}}})(Zu)),Zu}var jg;function US(){return jg||(jg=1,Qu.exports=jS()),Qu.exports}var ed={exports:{}},wn={};var Ug;function BS(){if(Ug)return wn;Ug=1;var o=Xu();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 n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(f,g,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:b==null?null:""+b,children:f,containerInfo:g,implementation:m}}var u=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 wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,wn.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)},wn.flushSync=function(f){var g=u.T,m=r.p;try{if(u.T=null,r.p=2,f)return f()}finally{u.T=g,r.p=m,r.d.f()}},wn.preconnect=function(f,g){typeof f=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(f,g))},wn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},wn.preinit=function(f,g){if(typeof f=="string"&&g&&typeof g.as=="string"){var m=g.as,b=d(m,g.crossOrigin),v=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;m==="style"?r.d.S(f,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:S}):m==="script"&&r.d.X(f,{crossOrigin:b,integrity:v,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},wn.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);r.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&&r.d.M(f)},wn.preload=function(f,g){if(typeof f=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var m=g.as,b=d(m,g.crossOrigin);r.d.L(f,m,{crossOrigin:b,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})}},wn.preloadModule=function(f,g){if(typeof f=="string")if(g){var m=d(g.as,g.crossOrigin);r.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 r.d.m(f)},wn.requestFormReset=function(f){r.d.r(f)},wn.unstable_batchedUpdates=function(f,g){return f(g)},wn.useFormState=function(f,g,m){return u.H.useFormState(f,g,m)},wn.useFormStatus=function(){return u.H.useHostTransitionStatus()},wn.version="19.2.8",wn}var Bg;function Pg(){if(Bg)return ed.exports;Bg=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(),ed.exports=BS(),ed.exports}var qg;function PS(){if(qg)return Ys;qg=1;var o=US(),e=Xu(),n=Pg();function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+a+" 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 a=t,s=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(s=a.return),t=a.return;while(t)}return a.tag===3?s:null}function u(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function d(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function f(t){if(l(t)!==t)throw Error(r(188))}function g(t){var a=t.alternate;if(!a){if(a=l(t),a===null)throw Error(r(188));return a!==t?null:t}for(var s=t,c=a;;){var h=s.return;if(h===null)break;var p=h.alternate;if(p===null){if(c=h.return,c!==null){s=c;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===s)return f(h),t;if(p===c)return f(h),a;p=p.sibling}throw Error(r(188))}if(s.return!==c.return)s=h,c=p;else{for(var C=!1,R=h.child;R;){if(R===s){C=!0,s=h,c=p;break}if(R===c){C=!0,c=h,s=p;break}R=R.sibling}if(!C){for(R=p.child;R;){if(R===s){C=!0,s=p,c=h;break}if(R===c){C=!0,c=p,s=h;break}R=R.sibling}if(!C)throw Error(r(189))}}if(s.alternate!==c)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:a}function m(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=m(t),a!==null)return a;t=t.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),T=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),_e=Symbol.for("react.memo_cache_sentinel"),we=Symbol.iterator;function Me(t){return t===null||typeof t!="object"?null:(t=we&&t[we]||t["@@iterator"],typeof t=="function"?t:null)}var qe=Symbol.for("react.client.reference");function Je(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===qe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case x:return"Fragment";case O:return"Profiler";case k:return"StrictMode";case j:return"Suspense";case H:return"SuspenseList";case pe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _:return"Portal";case T:return t.displayName||"Context";case M:return(t._context.displayName||"Context")+".Consumer";case D:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case P:return a=t.displayName||null,a!==null?a:Je(t.type)||"Memo";case X:a=t._payload,t=t._init;try{return Je(t(a))}catch{}}return null}var gt=Array.isArray,Q=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ae=[],ge=-1;function A(t){return{current:t}}function K(t){0>ge||(t.current=ae[ge],ae[ge]=null,ge--)}function ue(t,a){ge++,ae[ge]=t.current,t.current=a}var he=A(null),le=A(null),de=A(null),Oe=A(null);function He(t,a){switch(ue(de,a),ue(le,t),ue(he,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?iS(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=iS(a),t=sS(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(he),ue(he,t)}function Pe(){K(he),K(le),K(de)}function ke(t){t.memoizedState!==null&&ue(Oe,t);var a=he.current,s=sS(a,t.type);a!==s&&(ue(le,t),ue(he,s))}function Ot(t){le.current===t&&(K(he),K(le)),Oe.current===t&&(K(Oe),Al._currentValue=ve)}var ut,Ct;function vt(t){if(ut===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);ut=a&&a[1]||"",Ct=-1<s.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+ut+t+Ct}var kt=!1;function Ee(t,a){if(!t||kt)return"";kt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ee){var J=ee}Reflect.construct(t,[],ce)}else{try{ce.call()}catch(ee){J=ee}t.call(ce.prototype)}}else{try{throw Error()}catch(ee){J=ee}(ce=t())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ee){if(ee&&J&&typeof ee.stack=="string")return[ee.stack,J.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=c.DetermineComponentFrameRoot(),C=p[0],R=p[1];if(C&&R){var U=C.split(`
|
||
`),Y=R.split(`
|
||
`);for(h=c=0;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;for(;h<Y.length&&!Y[h].includes("DetermineComponentFrameRoot");)h++;if(c===U.length||h===Y.length)for(c=U.length-1,h=Y.length-1;1<=c&&0<=h&&U[c]!==Y[h];)h--;for(;1<=c&&0<=h;c--,h--)if(U[c]!==Y[h]){if(c!==1||h!==1)do if(c--,h--,0>h||U[c]!==Y[h]){var ne=`
|
||
`+U[c].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=c&&0<=h);break}}}finally{kt=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?vt(s):""}function Nt(t,a){switch(t.tag){case 26:case 27:case 5:return vt(t.type);case 16:return vt("Lazy");case 13:return t.child!==a&&a!==null?vt("Suspense Fallback"):vt("Suspense");case 19:return vt("SuspenseList");case 0:case 15:return Ee(t.type,!1);case 11:return Ee(t.type.render,!1);case 1:return Ee(t.type,!0);case 31:return vt("Activity");default:return""}}function zt(t){try{var a="",s=null;do a+=Nt(t,s),s=t,t=t.return;while(t);return a}catch(c){return`
|
||
Error generating stack: `+c.message+`
|
||
`+c.stack}}var qt=Object.prototype.hasOwnProperty,Lt=o.unstable_scheduleCallback,_n=o.unstable_cancelCallback,hn=o.unstable_shouldYield,Ba=o.unstable_requestPaint,Jt=o.unstable_now,Dr=o.unstable_getCurrentPriorityLevel,tr=o.unstable_ImmediatePriority,An=o.unstable_UserBlockingPriority,sn=o.unstable_NormalPriority,tt=o.unstable_LowPriority,na=o.unstable_IdlePriority,kn=o.log,nr=o.unstable_setDisableYieldValue,_a=null,on=null;function Dn(t){if(typeof kn=="function"&&nr(t),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(_a,t)}catch{}}var q=Math.clz32?Math.clz32:Z,ie=Math.log,oe=Math.LN2;function Z(t){return t>>>=0,t===0?32:31-(ie(t)/oe|0)|0}var be=256,me=262144,Te=4194304;function xe(t){var a=t&42;if(a!==0)return a;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 je(t,a,s){var c=t.pendingLanes;if(c===0)return 0;var h=0,p=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var R=c&134217727;return R!==0?(c=R&~p,c!==0?h=xe(c):(C&=R,C!==0?h=xe(C):s||(s=R&~t,s!==0&&(h=xe(s))))):(R=c&~p,R!==0?h=xe(R):C!==0?h=xe(C):s||(s=c&~t,s!==0&&(h=xe(s)))),h===0?0:a!==0&&a!==h&&(a&p)===0&&(p=h&-h,s=a&-a,p>=s||p===32&&(s&4194048)!==0)?a:h}function ze(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function $e(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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=Te;return Te<<=1,(Te&62914560)===0&&(Te=4194304),t}function Ye(t){for(var a=[],s=0;31>s;s++)a.push(t);return a}function Ke(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ae(t,a,s,c,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 R=t.entanglements,U=t.expirationTimes,Y=t.hiddenUpdates;for(s=C&~s;0<s;){var ne=31-q(s),ce=1<<ne;R[ne]=0,U[ne]=-1;var J=Y[ne];if(J!==null)for(Y[ne]=null,ne=0;ne<J.length;ne++){var ee=J[ne];ee!==null&&(ee.lane&=-536870913)}s&=~ce}c!==0&&Re(t,c,0),p!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=p&~(C&~a))}function Re(t,a,s){t.pendingLanes|=a,t.suspendedLanes&=~a;var c=31-q(a);t.entangledLanes|=a,t.entanglements[c]=t.entanglements[c]|1073741824|s&261930}function Ue(t,a){var s=t.entangledLanes|=a;for(t=t.entanglements;s;){var c=31-q(s),h=1<<c;h&a|t[c]&a&&(t[c]|=a),s&=~h}}function ot(t,a){var s=a&-a;return s=(s&42)!==0?1:At(s),(s&(t.suspendedLanes|a))!==0?0:s}function At(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 Qt(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Kt(){var t=fe.p;return t!==0?t:(t=window.event,t===void 0?32:kS(t.type))}function Fn(t,a){var s=fe.p;try{return fe.p=t,a()}finally{fe.p=s}}var Nn=Math.random().toString(36).slice(2),ln="__reactFiber$"+Nn,xn="__reactProps$"+Nn,Or="__reactContainer$"+Nn,Lo="__reactEvents$"+Nn,bf="__reactListeners$"+Nn,Ec="__reactHandles$"+Nn,Pa="__reactResources$"+Nn,vi="__reactMarker$"+Nn;function Mo(t){delete t[ln],delete t[xn],delete t[Lo],delete t[bf],delete t[Ec]}function Lr(t){var a=t[ln];if(a)return a;for(var s=t.parentNode;s;){if(a=s[Or]||s[ln]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(t=hS(t);t!==null;){if(s=t[ln])return s;t=hS(t)}return a}t=s,s=t.parentNode}return null}function qa(t){if(t=t[ln]||t[Or]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function ar(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function Mr(t){var a=t[Pa];return a||(a=t[Pa]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Zt(t){t[vi]=!0}var _c=new Set,Ac={};function Aa(t,a){$r(t,a),$r(t+"Capture",a)}function $r(t,a){for(Ac[t]=a,t=0;t<a.length;t++)_c.add(a[t])}var vf=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]*$"),xc={},Tc={};function Sf(t){return qt.call(Tc,t)?!0:qt.call(xc,t)?!1:vf.test(t)?Tc[t]=!0:(xc[t]=!0,!1)}function In(t,a,s){if(Sf(a))if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+s)}}function Si(t,a,s){if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+s)}}function mn(t,a,s,c){if(c===null)t.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(a,s,""+c)}}function Tn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Rc(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function wf(t,a,s){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var h=c.get,p=c.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return h.call(this)},set:function(C){s=""+C,p.call(this,C)}}),Object.defineProperty(t,a,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(C){s=""+C},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function $o(t){if(!t._valueTracker){var a=Rc(t)?"checked":"value";t._valueTracker=wf(t,a,""+t[a])}}function kc(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),c="";return t&&(c=Rc(t)?t.checked?"true":"false":t.value),t=c,t!==s?(a.setValue(t),!0):!1}function Nr(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 Cf=/[\n"\\]/g;function Hn(t){return t.replace(Cf,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ps(t,a,s,c,h,p,C,R){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),a!=null?C==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+Tn(a)):t.value!==""+Tn(a)&&(t.value=""+Tn(a)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),a!=null?rr(t,C,Tn(a)):s!=null?rr(t,C,Tn(s)):c!=null&&t.removeAttribute("value"),h==null&&p!=null&&(t.defaultChecked=!!p),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+Tn(R):t.removeAttribute("name")}function wi(t,a,s,c,h,p,C,R){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),a!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||a!=null)){$o(t);return}s=s!=null?""+Tn(s):"",a=a!=null?""+Tn(a):s,R||a===t.value||(t.value=a),t.defaultValue=a}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=R?t.checked:!!c,t.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),$o(t)}function rr(t,a,s){a==="number"&&Nr(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Ir(t,a,s,c){if(t=t.options,a){a={};for(var h=0;h<s.length;h++)a["$"+s[h]]=!0;for(s=0;s<t.length;s++)h=a.hasOwnProperty("$"+t[s].value),t[s].selected!==h&&(t[s].selected=h),h&&c&&(t[s].defaultSelected=!0)}else{for(s=""+Tn(s),a=null,h=0;h<t.length;h++){if(t[h].value===s){t[h].selected=!0,c&&(t[h].defaultSelected=!0);return}a!==null||t[h].disabled||(a=t[h])}a!==null&&(a.selected=!0)}}function Hr(t,a,s){if(a!=null&&(a=""+Tn(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+Tn(s):""}function Dc(t,a,s,c){if(a==null){if(c!=null){if(s!=null)throw Error(r(92));if(gt(c)){if(1<c.length)throw Error(r(93));c=c[0]}s=c}s==null&&(s=""),a=s}s=Tn(a),t.defaultValue=s,c=t.textContent,c===s&&c!==""&&c!==null&&(t.value=c),$o(t)}function zr(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}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 Oc(t,a,s){var c=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":c?t.setProperty(a,s):typeof s!="number"||s===0||Ef.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function Lc(t,a,s){if(a!=null&&typeof a!="object")throw Error(r(62));if(t=t.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var h in a)c=a[h],a.hasOwnProperty(h)&&s[h]!==c&&Oc(t,h,c)}else for(var p in a)a.hasOwnProperty(p)&&Oc(t,p,a[p])}function No(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"]]),Io=/^[\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 aa(t){return Io.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xa(){}var Ho=null;function zo(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var jr=null,ir=null;function Mc(t){var a=qa(t);if(a&&(t=a.stateNode)){var s=t[xn]||null;e:switch(t=a.stateNode,a.type){case"input":if(ps(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Hn(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var c=s[a];if(c!==t&&c.form===t.form){var h=c[xn]||null;if(!h)throw Error(r(90));ps(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(a=0;a<s.length;a++)c=s[a],c.form===t.form&&kc(c)}break e;case"textarea":Hr(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Ir(t,!!s.multiple,a,!1)}}}var ms=!1;function $c(t,a,s){if(ms)return t(a,s);ms=!0;try{var c=t(a);return c}finally{if(ms=!1,(jr!==null||ir!==null)&&(Tu(),jr&&(a=jr,t=ir,ir=jr=null,Mc(a),t)))for(a=0;a<t.length;a++)Mc(t[a])}}function Ci(t,a){var s=t.stateNode;if(s===null)return null;var c=s[xn]||null;if(c===null)return null;s=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(r(231,a,typeof s));return s}var Ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jo=!1;if(Ta)try{var Ei={};Object.defineProperty(Ei,"passive",{get:function(){jo=!0}}),window.addEventListener("test",Ei,Ei),window.removeEventListener("test",Ei,Ei)}catch{jo=!1}var Ga=null,Uo=null,ys=null;function Nc(){if(ys)return ys;var t,a=Uo,s=a.length,c,h="value"in Ga?Ga.value:Ga.textContent,p=h.length;for(t=0;t<s&&a[t]===h[t];t++);var C=s-t;for(c=1;c<=C&&a[s-c]===h[p-c];c++);return ys=h.slice(t,1<c?1-c:void 0)}function _i(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function Bo(){return!0}function Ic(){return!1}function Be(t){function a(s,c,h,p,C){this._reactName=s,this._targetInst=h,this.type=c,this.nativeEvent=p,this.target=C,this.currentTarget=null;for(var R in t)t.hasOwnProperty(R)&&(s=t[R],this[R]=s?s(p):p[R]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Bo:Ic,this.isPropagationStopped=Ic,this}return b(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Bo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Bo)},persist:function(){},isPersistent:Bo}),a}var Ra={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sr=Be(Ra),Ai=b({},Ra,{view:0,detail:0}),Af=Be(Ai),bs,Po,xi,vs=b({},Ai,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Go,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!==xi&&(xi&&t.type==="mousemove"?(bs=t.screenX-xi.screenX,Po=t.screenY-xi.screenY):Po=bs=0,xi=t),bs)},movementY:function(t){return"movementY"in t?t.movementY:Po}}),Hc=Be(vs),xf=b({},vs,{dataTransfer:0}),wy=Be(xf),Tf=b({},Ai,{relatedTarget:0}),qo=Be(Tf),Cy=b({},Ra,{animationName:0,elapsedTime:0,pseudoElement:0}),Rf=Be(Cy),kf=b({},Ra,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),zc=Be(kf),Df=b({},Ra,{data:0}),jc=Be(Df),Of={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lf={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"},Mf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uc(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=Mf[t])?!!a[t]:!1}function Go(){return Uc}var $f=b({},Ai,{key:function(t){if(t.key){var a=Of[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=_i(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Lf[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Go,charCode:function(t){return t.type==="keypress"?_i(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?_i(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Nf=Be($f),If=b({},vs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bc=Be(If),Hf=b({},Ai,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Go}),zf=Be(Hf),cn=b({},Ra,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ss=Be(cn),jf=b({},vs,{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}),E=Be(jf),y=b({},Ra,{newState:0,oldState:0}),w=Be(y),L=[9,13,27,32],N=Ta&&"CompositionEvent"in window,te=null;Ta&&"documentMode"in document&&(te=document.documentMode);var ye=Ta&&"TextEvent"in window&&!te,Ne=Ta&&(!N||te&&8<te&&11>=te),Fe=" ",lt=!1;function pt(t,a){switch(t){case"keyup":return L.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jt(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ka=!1;function Uf(t,a){switch(t){case"compositionend":return jt(a);case"keypress":return a.which!==32?null:(lt=!0,Fe);case"textInput":return t=a.data,t===Fe&<?null:t;default:return null}}function Pc(t,a){if(ka)return t==="compositionend"||!N&&pt(t,a)?(t=Nc(),ys=Uo=Ga=null,ka=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Ne&&a.locale!=="ko"?null:a.data;default:return null}}var Bf={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 Vo(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!Bf[t.type]:a==="textarea"}function qc(t,a,s,c){jr?ir?ir.push(c):ir=[c]:jr=c,a=$u(a,"onChange"),0<a.length&&(s=new sr("onChange","change",null,s,c),t.push({event:s,listeners:a}))}var Ur=null,Ti=null;function Pf(t){Zv(t,0)}function Ri(t){var a=ar(t);if(kc(a))return t}function Fo(t,a){if(t==="change")return a}var Ko=!1;if(Ta){var ki;if(Ta){var Di="oninput"in document;if(!Di){var Wo=document.createElement("div");Wo.setAttribute("oninput","return;"),Di=typeof Wo.oninput=="function"}ki=Di}else ki=!1;Ko=ki&&(!document.documentMode||9<document.documentMode)}function Gc(){Ur&&(Ur.detachEvent("onpropertychange",Vc),Ti=Ur=null)}function Vc(t){if(t.propertyName==="value"&&Ri(Ti)){var a=[];qc(a,Ti,t,zo(t)),$c(Pf,a)}}function qf(t,a,s){t==="focusin"?(Gc(),Ur=a,Ti=s,Ur.attachEvent("onpropertychange",Vc)):t==="focusout"&&Gc()}function Gf(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ri(Ti)}function Fc(t,a){if(t==="click")return Ri(a)}function VA(t,a){if(t==="input"||t==="change")return Ri(a)}function FA(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var Kn=typeof Object.is=="function"?Object.is:FA;function Yo(t,a){if(Kn(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var s=Object.keys(t),c=Object.keys(a);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var h=s[c];if(!qt.call(a,h)||!Kn(t[h],a[h]))return!1}return!0}function Ey(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function _y(t,a){var s=Ey(t);t=0;for(var c;s;){if(s.nodeType===3){if(c=t+s.textContent.length,t<=a&&c>=a)return{node:s,offset:a-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ey(s)}}function Ay(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Ay(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function xy(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=Nr(t.document);a instanceof t.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)t=a.contentWindow;else break;a=Nr(t.document)}return a}function Vf(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var KA=Ta&&"documentMode"in document&&11>=document.documentMode,ws=null,Ff=null,Xo=null,Kf=!1;function Ty(t,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Kf||ws==null||ws!==Nr(c)||(c=ws,"selectionStart"in c&&Vf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Xo&&Yo(Xo,c)||(Xo=c,c=$u(Ff,"onSelect"),0<c.length&&(a=new sr("onSelect","select",null,a,s),t.push({event:a,listeners:c}),a.target=ws)))}function Oi(t,a){var s={};return s[t.toLowerCase()]=a.toLowerCase(),s["Webkit"+t]="webkit"+a,s["Moz"+t]="moz"+a,s}var Cs={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")},Wf={},Ry={};Ta&&(Ry=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Li(t){if(Wf[t])return Wf[t];if(!Cs[t])return t;var a=Cs[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in Ry)return Wf[t]=a[s];return t}var ky=Li("animationend"),Dy=Li("animationiteration"),Oy=Li("animationstart"),WA=Li("transitionrun"),YA=Li("transitionstart"),XA=Li("transitioncancel"),Ly=Li("transitionend"),My=new Map,Yf="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(" ");Yf.push("scrollEnd");function Da(t,a){My.set(t,a),Aa(a,[t])}var Kc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=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(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ra=[],Es=0,Xf=0;function Wc(){for(var t=Es,a=Xf=Es=0;a<t;){var s=ra[a];ra[a++]=null;var c=ra[a];ra[a++]=null;var h=ra[a];ra[a++]=null;var p=ra[a];if(ra[a++]=null,c!==null&&h!==null){var C=c.pending;C===null?h.next=h:(h.next=C.next,C.next=h),c.pending=h}p!==0&&$y(s,h,p)}}function Yc(t,a,s,c){ra[Es++]=t,ra[Es++]=a,ra[Es++]=s,ra[Es++]=c,Xf|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Jf(t,a,s,c){return Yc(t,a,s,c),Xc(t)}function Mi(t,a){return Yc(t,null,null,a),Xc(t)}function $y(t,a,s){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s);for(var h=!1,p=t.return;p!==null;)p.childLanes|=s,c=p.alternate,c!==null&&(c.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&&a!==null&&(h=31-q(s),t=p.hiddenUpdates,c=t[h],c===null?t[h]=[a]:c.push(a),a.lane=s|536870912),p):null}function Xc(t){if(50<bl)throw bl=0,sg=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var _s={};function JA(t,a,s,c){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=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wn(t,a,s,c){return new JA(t,a,s,c)}function Qf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function or(t,a){var s=t.alternate;return s===null?(s=Wn(t.tag,a,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=a,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,a=t.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function Ny(t,a){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=a,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,a=s.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function Jc(t,a,s,c,h,p){var C=0;if(c=t,typeof t=="function")Qf(t)&&(C=1);else if(typeof t=="string")C=nT(t,s,he.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case pe:return t=Wn(31,s,a,h),t.elementType=pe,t.lanes=p,t;case x:return $i(s.children,h,p,a);case k:C=8,h|=24;break;case O:return t=Wn(12,s,a,h|2),t.elementType=O,t.lanes=p,t;case j:return t=Wn(13,s,a,h),t.elementType=j,t.lanes=p,t;case H:return t=Wn(19,s,a,h),t.elementType=H,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case T:C=10;break e;case M:C=9;break e;case D:C=11;break e;case P:C=14;break e;case X:C=16,c=null;break e}C=29,s=Error(r(130,t===null?"null":typeof t,"")),c=null}return a=Wn(C,s,a,h),a.elementType=t,a.type=c,a.lanes=p,a}function $i(t,a,s,c){return t=Wn(7,t,c,a),t.lanes=s,t}function Zf(t,a,s){return t=Wn(6,t,null,a),t.lanes=s,t}function Iy(t){var a=Wn(18,null,null,0);return a.stateNode=t,a}function eh(t,a,s){return a=Wn(4,t.children!==null?t.children:[],t.key,a),a.lanes=s,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var Hy=new WeakMap;function ia(t,a){if(typeof t=="object"&&t!==null){var s=Hy.get(t);return s!==void 0?s:(a={value:t,source:a,stack:zt(a)},Hy.set(t,a),a)}return{value:t,source:a,stack:zt(a)}}var As=[],xs=0,Qc=null,Jo=0,sa=[],oa=0,Br=null,Va=1,Fa="";function lr(t,a){As[xs++]=Jo,As[xs++]=Qc,Qc=t,Jo=a}function zy(t,a,s){sa[oa++]=Va,sa[oa++]=Fa,sa[oa++]=Br,Br=t;var c=Va;t=Fa;var h=32-q(c)-1;c&=~(1<<h),s+=1;var p=32-q(a)+h;if(30<p){var C=h-h%5;p=(c&(1<<C)-1).toString(32),c>>=C,h-=C,Va=1<<32-q(a)+h|s<<h|c,Fa=p+t}else Va=1<<p|s<<h|c,Fa=t}function th(t){t.return!==null&&(lr(t,1),zy(t,1,0))}function nh(t){for(;t===Qc;)Qc=As[--xs],As[xs]=null,Jo=As[--xs],As[xs]=null;for(;t===Br;)Br=sa[--oa],sa[oa]=null,Fa=sa[--oa],sa[oa]=null,Va=sa[--oa],sa[oa]=null}function jy(t,a){sa[oa++]=Va,sa[oa++]=Fa,sa[oa++]=Br,Va=a.id,Fa=a.overflow,Br=t}var yn=null,Mt=null,ct=!1,Pr=null,la=!1,ah=Error(r(519));function qr(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qo(ia(a,t)),ah}function Uy(t){var a=t.stateNode,s=t.type,c=t.memoizedProps;switch(a[ln]=t,a[xn]=c,s){case"dialog":at("cancel",a),at("close",a);break;case"iframe":case"object":case"embed":at("load",a);break;case"video":case"audio":for(s=0;s<Sl.length;s++)at(Sl[s],a);break;case"source":at("error",a);break;case"img":case"image":case"link":at("error",a),at("load",a);break;case"details":at("toggle",a);break;case"input":at("invalid",a),wi(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":at("invalid",a);break;case"textarea":at("invalid",a),Dc(a,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||c.suppressHydrationWarning===!0||aS(a.textContent,s)?(c.popover!=null&&(at("beforetoggle",a),at("toggle",a)),c.onScroll!=null&&at("scroll",a),c.onScrollEnd!=null&&at("scrollend",a),c.onClick!=null&&(a.onclick=xa),a=!0):a=!1,a||qr(t,!0)}function By(t){for(yn=t.return;yn;)switch(yn.tag){case 5:case 31:case 13:la=!1;return;case 27:case 3:la=!0;return;default:yn=yn.return}}function Ts(t){if(t!==yn)return!1;if(!ct)return By(t),ct=!0,!1;var a=t.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||wg(t.type,t.memoizedProps)),s=!s),s&&Mt&&qr(t),By(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Mt=fS(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Mt=fS(t)}else a===27?(a=Mt,ai(t.type)?(t=xg,xg=null,Mt=t):Mt=a):Mt=yn?ua(t.stateNode.nextSibling):null;return!0}function Ni(){Mt=yn=null,ct=!1}function rh(){var t=Pr;return t!==null&&(Bn===null?Bn=t:Bn.push.apply(Bn,t),Pr=null),t}function Qo(t){Pr===null?Pr=[t]:Pr.push(t)}var ih=A(null),Ii=null,cr=null;function Gr(t,a,s){ue(ih,a._currentValue),a._currentValue=s}function ur(t){t._currentValue=ih.current,K(ih)}function sh(t,a,s){for(;t!==null;){var c=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),t===s)break;t=t.return}}function oh(t,a,s,c){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 R=p;p=h;for(var U=0;U<a.length;U++)if(R.context===a[U]){p.lanes|=s,R=p.alternate,R!==null&&(R.lanes|=s),sh(p.return,s,t),c||(C=null);break e}p=R.next}}else if(h.tag===18){if(C=h.return,C===null)throw Error(r(341));C.lanes|=s,p=C.alternate,p!==null&&(p.lanes|=s),sh(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 Rs(t,a,s,c){t=null;for(var h=a,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(r(387));if(C=C.memoizedProps,C!==null){var R=h.type;Kn(h.pendingProps.value,C.value)||(t!==null?t.push(R):t=[R])}}else if(h===Oe.current){if(C=h.alternate,C===null)throw Error(r(387));C.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(Al):t=[Al])}h=h.return}t!==null&&oh(a,t,s,c),a.flags|=262144}function Zc(t){for(t=t.firstContext;t!==null;){if(!Kn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Hi(t){Ii=t,cr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function bn(t){return Py(Ii,t)}function eu(t,a){return Ii===null&&Hi(t),Py(t,a)}function Py(t,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},cr===null){if(t===null)throw Error(r(308));cr=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else cr=cr.next=a;return s}var QA=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(s,c){t.push(c)}};this.abort=function(){a.aborted=!0,t.forEach(function(s){return s()})}},ZA=o.unstable_scheduleCallback,ex=o.unstable_NormalPriority,en={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lh(){return{controller:new QA,data:new Map,refCount:0}}function Zo(t){t.refCount--,t.refCount===0&&ZA(ex,function(){t.controller.abort()})}var el=null,ch=0,ks=0,Ds=null;function tx(t,a){if(el===null){var s=el=[];ch=0,ks=fg(),Ds={status:"pending",value:void 0,then:function(c){s.push(c)}}}return ch++,a.then(qy,qy),a}function qy(){if(--ch===0&&el!==null){Ds!==null&&(Ds.status="fulfilled");var t=el;el=null,ks=0,Ds=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function nx(t,a){var s=[],c={status:"pending",value:null,reason:null,then:function(h){s.push(h)}};return t.then(function(){c.status="fulfilled",c.value=a;for(var h=0;h<s.length;h++)(0,s[h])(a)},function(h){for(c.status="rejected",c.reason=h,h=0;h<s.length;h++)(0,s[h])(void 0)}),c}var Gy=Q.S;Q.S=function(t,a){Tv=Jt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&tx(t,a),Gy!==null&&Gy(t,a)};var zi=A(null);function uh(){var t=zi.current;return t!==null?t:Dt.pooledCache}function tu(t,a){a===null?ue(zi,zi.current):ue(zi,a.pool)}function Vy(){var t=uh();return t===null?null:{parent:en._currentValue,pool:t}}var Os=Error(r(460)),dh=Error(r(474)),nu=Error(r(542)),au={then:function(){}};function Fy(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Ky(t,a,s){switch(s=t[s],s===void 0?t.push(a):s!==a&&(a.then(xa,xa),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Yy(t),t;default:if(typeof a.status=="string")a.then(xa,xa);else{if(t=Dt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(c){if(a.status==="pending"){var h=a;h.status="fulfilled",h.value=c}},function(c){if(a.status==="pending"){var h=a;h.status="rejected",h.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Yy(t),t}throw Ui=a,Os}}function ji(t){try{var a=t._init;return a(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ui=s,Os):s}}var Ui=null;function Wy(){if(Ui===null)throw Error(r(459));var t=Ui;return Ui=null,t}function Yy(t){if(t===Os||t===nu)throw Error(r(483))}var Ls=null,tl=0;function ru(t){var a=tl;return tl+=1,Ls===null&&(Ls=[]),Ky(Ls,t,a)}function nl(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function iu(t,a){throw a.$$typeof===v?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Xy(t){function a(F,G){if(t){var W=F.deletions;W===null?(F.deletions=[G],F.flags|=16):W.push(G)}}function s(F,G){if(!t)return null;for(;G!==null;)a(F,G),G=G.sibling;return null}function c(F){for(var G=new Map;F!==null;)F.key!==null?G.set(F.key,F):G.set(F.index,F),F=F.sibling;return G}function h(F,G){return F=or(F,G),F.index=0,F.sibling=null,F}function p(F,G,W){return F.index=W,t?(W=F.alternate,W!==null?(W=W.index,W<G?(F.flags|=67108866,G):W):(F.flags|=67108866,G)):(F.flags|=1048576,G)}function C(F){return t&&F.alternate===null&&(F.flags|=67108866),F}function R(F,G,W,se){return G===null||G.tag!==6?(G=Zf(W,F.mode,se),G.return=F,G):(G=h(G,W),G.return=F,G)}function U(F,G,W,se){var Ge=W.type;return Ge===x?ne(F,G,W.props.children,se,W.key):G!==null&&(G.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===X&&ji(Ge)===G.type)?(G=h(G,W.props),nl(G,W),G.return=F,G):(G=Jc(W.type,W.key,W.props,null,F.mode,se),nl(G,W),G.return=F,G)}function Y(F,G,W,se){return G===null||G.tag!==4||G.stateNode.containerInfo!==W.containerInfo||G.stateNode.implementation!==W.implementation?(G=eh(W,F.mode,se),G.return=F,G):(G=h(G,W.children||[]),G.return=F,G)}function ne(F,G,W,se,Ge){return G===null||G.tag!==7?(G=$i(W,F.mode,se,Ge),G.return=F,G):(G=h(G,W),G.return=F,G)}function ce(F,G,W){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Zf(""+G,F.mode,W),G.return=F,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case S:return W=Jc(G.type,G.key,G.props,null,F.mode,W),nl(W,G),W.return=F,W;case _:return G=eh(G,F.mode,W),G.return=F,G;case X:return G=ji(G),ce(F,G,W)}if(gt(G)||Me(G))return G=$i(G,F.mode,W,null),G.return=F,G;if(typeof G.then=="function")return ce(F,ru(G),W);if(G.$$typeof===T)return ce(F,eu(F,G),W);iu(F,G)}return null}function J(F,G,W,se){var Ge=G!==null?G.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Ge!==null?null:R(F,G,""+W,se);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case S:return W.key===Ge?U(F,G,W,se):null;case _:return W.key===Ge?Y(F,G,W,se):null;case X:return W=ji(W),J(F,G,W,se)}if(gt(W)||Me(W))return Ge!==null?null:ne(F,G,W,se,null);if(typeof W.then=="function")return J(F,G,ru(W),se);if(W.$$typeof===T)return J(F,G,eu(F,W),se);iu(F,W)}return null}function ee(F,G,W,se,Ge){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return F=F.get(W)||null,R(G,F,""+se,Ge);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case S:return F=F.get(se.key===null?W:se.key)||null,U(G,F,se,Ge);case _:return F=F.get(se.key===null?W:se.key)||null,Y(G,F,se,Ge);case X:return se=ji(se),ee(F,G,W,se,Ge)}if(gt(se)||Me(se))return F=F.get(W)||null,ne(G,F,se,Ge,null);if(typeof se.then=="function")return ee(F,G,W,ru(se),Ge);if(se.$$typeof===T)return ee(F,G,W,eu(G,se),Ge);iu(G,se)}return null}function Le(F,G,W,se){for(var Ge=null,mt=null,Ie=G,Ze=G=0,it=null;Ie!==null&&Ze<W.length;Ze++){Ie.index>Ze?(it=Ie,Ie=null):it=Ie.sibling;var yt=J(F,Ie,W[Ze],se);if(yt===null){Ie===null&&(Ie=it);break}t&&Ie&&yt.alternate===null&&a(F,Ie),G=p(yt,G,Ze),mt===null?Ge=yt:mt.sibling=yt,mt=yt,Ie=it}if(Ze===W.length)return s(F,Ie),ct&&lr(F,Ze),Ge;if(Ie===null){for(;Ze<W.length;Ze++)Ie=ce(F,W[Ze],se),Ie!==null&&(G=p(Ie,G,Ze),mt===null?Ge=Ie:mt.sibling=Ie,mt=Ie);return ct&&lr(F,Ze),Ge}for(Ie=c(Ie);Ze<W.length;Ze++)it=ee(Ie,F,Ze,W[Ze],se),it!==null&&(t&&it.alternate!==null&&Ie.delete(it.key===null?Ze:it.key),G=p(it,G,Ze),mt===null?Ge=it:mt.sibling=it,mt=it);return t&&Ie.forEach(function(li){return a(F,li)}),ct&&lr(F,Ze),Ge}function Ve(F,G,W,se){if(W==null)throw Error(r(151));for(var Ge=null,mt=null,Ie=G,Ze=G=0,it=null,yt=W.next();Ie!==null&&!yt.done;Ze++,yt=W.next()){Ie.index>Ze?(it=Ie,Ie=null):it=Ie.sibling;var li=J(F,Ie,yt.value,se);if(li===null){Ie===null&&(Ie=it);break}t&&Ie&&li.alternate===null&&a(F,Ie),G=p(li,G,Ze),mt===null?Ge=li:mt.sibling=li,mt=li,Ie=it}if(yt.done)return s(F,Ie),ct&&lr(F,Ze),Ge;if(Ie===null){for(;!yt.done;Ze++,yt=W.next())yt=ce(F,yt.value,se),yt!==null&&(G=p(yt,G,Ze),mt===null?Ge=yt:mt.sibling=yt,mt=yt);return ct&&lr(F,Ze),Ge}for(Ie=c(Ie);!yt.done;Ze++,yt=W.next())yt=ee(Ie,F,Ze,yt.value,se),yt!==null&&(t&&yt.alternate!==null&&Ie.delete(yt.key===null?Ze:yt.key),G=p(yt,G,Ze),mt===null?Ge=yt:mt.sibling=yt,mt=yt);return t&&Ie.forEach(function(hT){return a(F,hT)}),ct&&lr(F,Ze),Ge}function Rt(F,G,W,se){if(typeof W=="object"&&W!==null&&W.type===x&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case S:e:{for(var Ge=W.key;G!==null;){if(G.key===Ge){if(Ge=W.type,Ge===x){if(G.tag===7){s(F,G.sibling),se=h(G,W.props.children),se.return=F,F=se;break e}}else if(G.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===X&&ji(Ge)===G.type){s(F,G.sibling),se=h(G,W.props),nl(se,W),se.return=F,F=se;break e}s(F,G);break}else a(F,G);G=G.sibling}W.type===x?(se=$i(W.props.children,F.mode,se,W.key),se.return=F,F=se):(se=Jc(W.type,W.key,W.props,null,F.mode,se),nl(se,W),se.return=F,F=se)}return C(F);case _:e:{for(Ge=W.key;G!==null;){if(G.key===Ge)if(G.tag===4&&G.stateNode.containerInfo===W.containerInfo&&G.stateNode.implementation===W.implementation){s(F,G.sibling),se=h(G,W.children||[]),se.return=F,F=se;break e}else{s(F,G);break}else a(F,G);G=G.sibling}se=eh(W,F.mode,se),se.return=F,F=se}return C(F);case X:return W=ji(W),Rt(F,G,W,se)}if(gt(W))return Le(F,G,W,se);if(Me(W)){if(Ge=Me(W),typeof Ge!="function")throw Error(r(150));return W=Ge.call(W),Ve(F,G,W,se)}if(typeof W.then=="function")return Rt(F,G,ru(W),se);if(W.$$typeof===T)return Rt(F,G,eu(F,W),se);iu(F,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,G!==null&&G.tag===6?(s(F,G.sibling),se=h(G,W),se.return=F,F=se):(s(F,G),se=Zf(W,F.mode,se),se.return=F,F=se),C(F)):s(F,G)}return function(F,G,W,se){try{tl=0;var Ge=Rt(F,G,W,se);return Ls=null,Ge}catch(Ie){if(Ie===Os||Ie===nu)throw Ie;var mt=Wn(29,Ie,null,F.mode);return mt.lanes=se,mt.return=F,mt}}}var Bi=Xy(!0),Jy=Xy(!1),Vr=!1;function fh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hh(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Fr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Kr(t,a,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(St&2)!==0){var h=c.pending;return h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a,a=Xc(t),$y(t,null,s),a}return Yc(t,c,a,s),Xc(t)}function al(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=t.pendingLanes,s|=c,a.lanes=s,Ue(t,s)}}function gh(t,a){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){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=a:p=p.next=a}else h=p=a;s={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}var ph=!1;function rl(){if(ph){var t=Ds;if(t!==null)throw t}}function il(t,a,s,c){ph=!1;var h=t.updateQueue;Vr=!1;var p=h.firstBaseUpdate,C=h.lastBaseUpdate,R=h.shared.pending;if(R!==null){h.shared.pending=null;var U=R,Y=U.next;U.next=null,C===null?p=Y:C.next=Y,C=U;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,R=ne.lastBaseUpdate,R!==C&&(R===null?ne.firstBaseUpdate=Y:R.next=Y,ne.lastBaseUpdate=U))}if(p!==null){var ce=h.baseState;C=0,ne=Y=U=null,R=p;do{var J=R.lane&-536870913,ee=J!==R.lane;if(ee?(rt&J)===J:(c&J)===J){J!==0&&J===ks&&(ph=!0),ne!==null&&(ne=ne.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Le=t,Ve=R;J=a;var Rt=s;switch(Ve.tag){case 1:if(Le=Ve.payload,typeof Le=="function"){ce=Le.call(Rt,ce,J);break e}ce=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Ve.payload,J=typeof Le=="function"?Le.call(Rt,ce,J):Le,J==null)break e;ce=b({},ce,J);break e;case 2:Vr=!0}}J=R.callback,J!==null&&(t.flags|=64,ee&&(t.flags|=8192),ee=h.callbacks,ee===null?h.callbacks=[J]:ee.push(J))}else ee={lane:J,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ne===null?(Y=ne=ee,U=ce):ne=ne.next=ee,C|=J;if(R=R.next,R===null){if(R=h.shared.pending,R===null)break;ee=R,R=ee.next,ee.next=null,h.lastBaseUpdate=ee,h.shared.pending=null}}while(!0);ne===null&&(U=ce),h.baseState=U,h.firstBaseUpdate=Y,h.lastBaseUpdate=ne,p===null&&(h.shared.lanes=0),Qr|=C,t.lanes=C,t.memoizedState=ce}}function Qy(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function Zy(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Qy(s[t],a)}var Ms=A(null),su=A(0);function eb(t,a){t=vr,ue(su,t),ue(Ms,a),vr=t|a.baseLanes}function mh(){ue(su,vr),ue(Ms,Ms.current)}function yh(){vr=su.current,K(Ms),K(su)}var Yn=A(null),ca=null;function Wr(t){var a=t.alternate;ue(Wt,Wt.current&1),ue(Yn,t),ca===null&&(a===null||Ms.current!==null||a.memoizedState!==null)&&(ca=t)}function bh(t){ue(Wt,Wt.current),ue(Yn,t),ca===null&&(ca=t)}function tb(t){t.tag===22?(ue(Wt,Wt.current),ue(Yn,t),ca===null&&(ca=t)):Yr()}function Yr(){ue(Wt,Wt.current),ue(Yn,Yn.current)}function Xn(t){K(Yn),ca===t&&(ca=null),K(Wt)}var Wt=A(0);function ou(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||_g(s)||Ag(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var dr=0,Qe=null,xt=null,tn=null,lu=!1,$s=!1,Pi=!1,cu=0,sl=0,Ns=null,ax=0;function Gt(){throw Error(r(321))}function vh(t,a){if(a===null)return!1;for(var s=0;s<a.length&&s<t.length;s++)if(!Kn(t[s],a[s]))return!1;return!0}function Sh(t,a,s,c,h,p){return dr=p,Qe=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Q.H=t===null||t.memoizedState===null?zb:Nh,Pi=!1,p=s(c,h),Pi=!1,$s&&(p=ab(a,s,c,h)),nb(t),p}function nb(t){Q.H=cl;var a=xt!==null&&xt.next!==null;if(dr=0,tn=xt=Qe=null,lu=!1,sl=0,Ns=null,a)throw Error(r(300));t===null||nn||(t=t.dependencies,t!==null&&Zc(t)&&(nn=!0))}function ab(t,a,s,c){Qe=t;var h=0;do{if($s&&(Ns=null),sl=0,$s=!1,25<=h)throw Error(r(301));if(h+=1,tn=xt=null,t.updateQueue!=null){var p=t.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}Q.H=jb,p=a(s,c)}while($s);return p}function rx(){var t=Q.H,a=t.useState()[0];return a=typeof a.then=="function"?ol(a):a,t=t.useState()[0],(xt!==null?xt.memoizedState:null)!==t&&(Qe.flags|=1024),a}function wh(){var t=cu!==0;return cu=0,t}function Ch(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function Eh(t){if(lu){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}lu=!1}dr=0,tn=xt=Qe=null,$s=!1,sl=cu=0,Ns=null}function On(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Qe.memoizedState=tn=t:tn=tn.next=t,tn}function Yt(){if(xt===null){var t=Qe.alternate;t=t!==null?t.memoizedState:null}else t=xt.next;var a=tn===null?Qe.memoizedState:tn.next;if(a!==null)tn=a,xt=t;else{if(t===null)throw Qe.alternate===null?Error(r(467)):Error(r(310));xt=t,t={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},tn===null?Qe.memoizedState=tn=t:tn=tn.next=t}return tn}function uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ol(t){var a=sl;return sl+=1,Ns===null&&(Ns=[]),t=Ky(Ns,t,a),a=Qe,(tn===null?a.memoizedState:tn.next)===null&&(a=a.alternate,Q.H=a===null||a.memoizedState===null?zb:Nh),t}function du(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ol(t);if(t.$$typeof===T)return bn(t)}throw Error(r(438,String(t)))}function _h(t){var a=null,s=Qe.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var c=Qe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(h){return h.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=uu(),Qe.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(t),c=0;c<t;c++)s[c]=_e;return a.index++,s}function fr(t,a){return typeof a=="function"?a(t):a}function fu(t){var a=Yt();return Ah(a,xt,t)}function Ah(t,a,s){var c=t.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=s;var h=t.baseQueue,p=c.pending;if(p!==null){if(h!==null){var C=h.next;h.next=p.next,p.next=C}a.baseQueue=h=p,c.pending=null}if(p=t.baseState,h===null)t.memoizedState=p;else{a=h.next;var R=C=null,U=null,Y=a,ne=!1;do{var ce=Y.lane&-536870913;if(ce!==Y.lane?(rt&ce)===ce:(dr&ce)===ce){var J=Y.revertLane;if(J===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),ce===ks&&(ne=!0);else if((dr&J)===J){Y=Y.next,J===ks&&(ne=!0);continue}else ce={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},U===null?(R=U=ce,C=p):U=U.next=ce,Qe.lanes|=J,Qr|=J;ce=Y.action,Pi&&s(p,ce),p=Y.hasEagerState?Y.eagerState:s(p,ce)}else J={lane:ce,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},U===null?(R=U=J,C=p):U=U.next=J,Qe.lanes|=ce,Qr|=ce;Y=Y.next}while(Y!==null&&Y!==a);if(U===null?C=p:U.next=R,!Kn(p,t.memoizedState)&&(nn=!0,ne&&(s=Ds,s!==null)))throw s;t.memoizedState=p,t.baseState=C,t.baseQueue=U,c.lastRenderedState=p}return h===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function xh(t){var a=Yt(),s=a.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var c=s.dispatch,h=s.pending,p=a.memoizedState;if(h!==null){s.pending=null;var C=h=h.next;do p=t(p,C.action),C=C.next;while(C!==h);Kn(p,a.memoizedState)||(nn=!0),a.memoizedState=p,a.baseQueue===null&&(a.baseState=p),s.lastRenderedState=p}return[p,c]}function rb(t,a,s){var c=Qe,h=Yt(),p=ct;if(p){if(s===void 0)throw Error(r(407));s=s()}else s=a();var C=!Kn((xt||h).memoizedState,s);if(C&&(h.memoizedState=s,nn=!0),h=h.queue,kh(ob.bind(null,c,h,t),[t]),h.getSnapshot!==a||C||tn!==null&&tn.memoizedState.tag&1){if(c.flags|=2048,Is(9,{destroy:void 0},sb.bind(null,c,h,s,a),null),Dt===null)throw Error(r(349));p||(dr&127)!==0||ib(c,a,s)}return s}function ib(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=Qe.updateQueue,a===null?(a=uu(),Qe.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function sb(t,a,s,c){a.value=s,a.getSnapshot=c,lb(a)&&cb(t)}function ob(t,a,s){return s(function(){lb(a)&&cb(t)})}function lb(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!Kn(t,s)}catch{return!0}}function cb(t){var a=Mi(t,2);a!==null&&Pn(a,t,2)}function Th(t){var a=On();if(typeof t=="function"){var s=t;if(t=s(),Pi){Dn(!0);try{s()}finally{Dn(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fr,lastRenderedState:t},a}function ub(t,a,s,c){return t.baseState=s,Ah(t,xt,typeof c=="function"?c:fr)}function ix(t,a,s,c,h){if(pu(t))throw Error(r(485));if(t=a.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)}};Q.T!==null?s(!0):p.isTransition=!1,c(p),s=a.pending,s===null?(p.next=a.pending=p,db(a,p)):(p.next=s.next,a.pending=s.next=p)}}function db(t,a){var s=a.action,c=a.payload,h=t.state;if(a.isTransition){var p=Q.T,C={};Q.T=C;try{var R=s(h,c),U=Q.S;U!==null&&U(C,R),fb(t,a,R)}catch(Y){Rh(t,a,Y)}finally{p!==null&&C.types!==null&&(p.types=C.types),Q.T=p}}else try{p=s(h,c),fb(t,a,p)}catch(Y){Rh(t,a,Y)}}function fb(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){hb(t,a,c)},function(c){return Rh(t,a,c)}):hb(t,a,s)}function hb(t,a,s){a.status="fulfilled",a.value=s,gb(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,db(t,s)))}function Rh(t,a,s){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=s,gb(a),a=a.next;while(a!==c)}t.action=null}function gb(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function pb(t,a){return a}function mb(t,a){if(ct){var s=Dt.formState;if(s!==null){e:{var c=Qe;if(ct){if(Mt){t:{for(var h=Mt,p=la;h.nodeType!==8;){if(!p){h=null;break t}if(h=ua(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){Mt=ua(h.nextSibling),c=h.data==="F!";break e}}qr(c)}c=!1}c&&(a=s[0])}}return s=On(),s.memoizedState=s.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pb,lastRenderedState:a},s.queue=c,s=Nb.bind(null,Qe,c),c.dispatch=s,c=Th(!1),p=$h.bind(null,Qe,!1,c.queue),c=On(),h={state:a,dispatch:null,action:t,pending:null},c.queue=h,s=ix.bind(null,Qe,h,p,s),h.dispatch=s,c.memoizedState=t,[a,s,!1]}function yb(t){var a=Yt();return bb(a,xt,t)}function bb(t,a,s){if(a=Ah(t,a,pb)[0],t=fu(fr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=ol(a)}catch(C){throw C===Os?nu:C}else c=a;a=Yt();var h=a.queue,p=h.dispatch;return s!==a.memoizedState&&(Qe.flags|=2048,Is(9,{destroy:void 0},sx.bind(null,h,s),null)),[c,p,t]}function sx(t,a){t.action=a}function vb(t){var a=Yt(),s=xt;if(s!==null)return bb(a,s,t);Yt(),a=a.memoizedState,s=Yt();var c=s.queue.dispatch;return s.memoizedState=t,[a,c,!1]}function Is(t,a,s,c){return t={tag:t,create:s,deps:c,inst:a,next:null},a=Qe.updateQueue,a===null&&(a=uu(),Qe.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=t.next=t:(c=s.next,s.next=t,t.next=c,a.lastEffect=t),t}function Sb(){return Yt().memoizedState}function hu(t,a,s,c){var h=On();Qe.flags|=t,h.memoizedState=Is(1|a,{destroy:void 0},s,c===void 0?null:c)}function gu(t,a,s,c){var h=Yt();c=c===void 0?null:c;var p=h.memoizedState.inst;xt!==null&&c!==null&&vh(c,xt.memoizedState.deps)?h.memoizedState=Is(a,p,s,c):(Qe.flags|=t,h.memoizedState=Is(1|a,p,s,c))}function wb(t,a){hu(8390656,8,t,a)}function kh(t,a){gu(2048,8,t,a)}function ox(t){Qe.flags|=4;var a=Qe.updateQueue;if(a===null)a=uu(),Qe.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function Cb(t){var a=Yt().memoizedState;return ox({ref:a,nextImpl:t}),function(){if((St&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Eb(t,a){return gu(4,2,t,a)}function _b(t,a){return gu(4,4,t,a)}function Ab(t,a){if(typeof a=="function"){t=t();var s=a(t);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function xb(t,a,s){s=s!=null?s.concat([t]):null,gu(4,4,Ab.bind(null,a,t),s)}function Dh(){}function Tb(t,a){var s=Yt();a=a===void 0?null:a;var c=s.memoizedState;return a!==null&&vh(a,c[1])?c[0]:(s.memoizedState=[t,a],t)}function Rb(t,a){var s=Yt();a=a===void 0?null:a;var c=s.memoizedState;if(a!==null&&vh(a,c[1]))return c[0];if(c=t(),Pi){Dn(!0);try{t()}finally{Dn(!1)}}return s.memoizedState=[c,a],c}function Oh(t,a,s){return s===void 0||(dr&1073741824)!==0&&(rt&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=kv(),Qe.lanes|=t,Qr|=t,s)}function kb(t,a,s,c){return Kn(s,a)?s:Ms.current!==null?(t=Oh(t,s,c),Kn(t,a)||(nn=!0),t):(dr&42)===0||(dr&1073741824)!==0&&(rt&261930)===0?(nn=!0,t.memoizedState=s):(t=kv(),Qe.lanes|=t,Qr|=t,a)}function Db(t,a,s,c,h){var p=fe.p;fe.p=p!==0&&8>p?p:8;var C=Q.T,R={};Q.T=R,$h(t,!1,a,s);try{var U=h(),Y=Q.S;if(Y!==null&&Y(R,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ne=nx(U,c);ll(t,a,ne,Zn(t))}else ll(t,a,c,Zn(t))}catch(ce){ll(t,a,{then:function(){},status:"rejected",reason:ce},Zn())}finally{fe.p=p,C!==null&&R.types!==null&&(C.types=R.types),Q.T=C}}function lx(){}function Lh(t,a,s,c){if(t.tag!==5)throw Error(r(476));var h=Ob(t).queue;Db(t,h,a,ve,s===null?lx:function(){return Lb(t),s(c)})}function Ob(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fr,lastRenderedState:ve},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fr,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Lb(t){var a=Ob(t);a.next===null&&(a=t.alternate.memoizedState),ll(t,a.next.queue,{},Zn())}function Mh(){return bn(Al)}function Mb(){return Yt().memoizedState}function $b(){return Yt().memoizedState}function cx(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=Zn();t=Fr(s);var c=Kr(a,t,s);c!==null&&(Pn(c,a,s),al(c,a,s)),a={cache:lh()},t.payload=a;return}a=a.return}}function ux(t,a,s){var c=Zn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},pu(t)?Ib(a,s):(s=Jf(t,a,s,c),s!==null&&(Pn(s,t,c),Hb(s,a,c)))}function Nb(t,a,s){var c=Zn();ll(t,a,s,c)}function ll(t,a,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(pu(t))Ib(a,h);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=a.lastRenderedReducer,p!==null))try{var C=a.lastRenderedState,R=p(C,s);if(h.hasEagerState=!0,h.eagerState=R,Kn(R,C))return Yc(t,a,h,0),Dt===null&&Wc(),!1}catch{}if(s=Jf(t,a,h,c),s!==null)return Pn(s,t,c),Hb(s,a,c),!0}return!1}function $h(t,a,s,c){if(c={lane:2,revertLane:fg(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},pu(t)){if(a)throw Error(r(479))}else a=Jf(t,s,c,2),a!==null&&Pn(a,t,2)}function pu(t){var a=t.alternate;return t===Qe||a!==null&&a===Qe}function Ib(t,a){$s=lu=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function Hb(t,a,s){if((s&4194048)!==0){var c=a.lanes;c&=t.pendingLanes,s|=c,a.lanes=s,Ue(t,s)}}var cl={readContext:bn,use:du,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};cl.useEffectEvent=Gt;var zb={readContext:bn,use:du,useCallback:function(t,a){return On().memoizedState=[t,a===void 0?null:a],t},useContext:bn,useEffect:wb,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,hu(4194308,4,Ab.bind(null,a,t),s)},useLayoutEffect:function(t,a){return hu(4194308,4,t,a)},useInsertionEffect:function(t,a){hu(4,2,t,a)},useMemo:function(t,a){var s=On();a=a===void 0?null:a;var c=t();if(Pi){Dn(!0);try{t()}finally{Dn(!1)}}return s.memoizedState=[c,a],c},useReducer:function(t,a,s){var c=On();if(s!==void 0){var h=s(a);if(Pi){Dn(!0);try{s(a)}finally{Dn(!1)}}}else h=a;return c.memoizedState=c.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},c.queue=t,t=t.dispatch=ux.bind(null,Qe,t),[c.memoizedState,t]},useRef:function(t){var a=On();return t={current:t},a.memoizedState=t},useState:function(t){t=Th(t);var a=t.queue,s=Nb.bind(null,Qe,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:Dh,useDeferredValue:function(t,a){var s=On();return Oh(s,t,a)},useTransition:function(){var t=Th(!1);return t=Db.bind(null,Qe,t.queue,!0,!1),On().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var c=Qe,h=On();if(ct){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),Dt===null)throw Error(r(349));(rt&127)!==0||ib(c,a,s)}h.memoizedState=s;var p={value:s,getSnapshot:a};return h.queue=p,wb(ob.bind(null,c,p,t),[t]),c.flags|=2048,Is(9,{destroy:void 0},sb.bind(null,c,p,s,a),null),s},useId:function(){var t=On(),a=Dt.identifierPrefix;if(ct){var s=Fa,c=Va;s=(c&~(1<<32-q(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=cu++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=ax++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Mh,useFormState:mb,useActionState:mb,useOptimistic:function(t){var a=On();a.memoizedState=a.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=$h.bind(null,Qe,!0,s),s.dispatch=a,[t,a]},useMemoCache:_h,useCacheRefresh:function(){return On().memoizedState=cx.bind(null,Qe)},useEffectEvent:function(t){var a=On(),s={impl:t};return a.memoizedState=s,function(){if((St&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Nh={readContext:bn,use:du,useCallback:Tb,useContext:bn,useEffect:kh,useImperativeHandle:xb,useInsertionEffect:Eb,useLayoutEffect:_b,useMemo:Rb,useReducer:fu,useRef:Sb,useState:function(){return fu(fr)},useDebugValue:Dh,useDeferredValue:function(t,a){var s=Yt();return kb(s,xt.memoizedState,t,a)},useTransition:function(){var t=fu(fr)[0],a=Yt().memoizedState;return[typeof t=="boolean"?t:ol(t),a]},useSyncExternalStore:rb,useId:Mb,useHostTransitionStatus:Mh,useFormState:yb,useActionState:yb,useOptimistic:function(t,a){var s=Yt();return ub(s,xt,t,a)},useMemoCache:_h,useCacheRefresh:$b};Nh.useEffectEvent=Cb;var jb={readContext:bn,use:du,useCallback:Tb,useContext:bn,useEffect:kh,useImperativeHandle:xb,useInsertionEffect:Eb,useLayoutEffect:_b,useMemo:Rb,useReducer:xh,useRef:Sb,useState:function(){return xh(fr)},useDebugValue:Dh,useDeferredValue:function(t,a){var s=Yt();return xt===null?Oh(s,t,a):kb(s,xt.memoizedState,t,a)},useTransition:function(){var t=xh(fr)[0],a=Yt().memoizedState;return[typeof t=="boolean"?t:ol(t),a]},useSyncExternalStore:rb,useId:Mb,useHostTransitionStatus:Mh,useFormState:vb,useActionState:vb,useOptimistic:function(t,a){var s=Yt();return xt!==null?ub(s,xt,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:_h,useCacheRefresh:$b};jb.useEffectEvent=Cb;function Ih(t,a,s,c){a=t.memoizedState,s=s(c,a),s=s==null?a:b({},a,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Hh={enqueueSetState:function(t,a,s){t=t._reactInternals;var c=Zn(),h=Fr(c);h.payload=a,s!=null&&(h.callback=s),a=Kr(t,h,c),a!==null&&(Pn(a,t,c),al(a,t,c))},enqueueReplaceState:function(t,a,s){t=t._reactInternals;var c=Zn(),h=Fr(c);h.tag=1,h.payload=a,s!=null&&(h.callback=s),a=Kr(t,h,c),a!==null&&(Pn(a,t,c),al(a,t,c))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var s=Zn(),c=Fr(s);c.tag=2,a!=null&&(c.callback=a),a=Kr(t,c,s),a!==null&&(Pn(a,t,s),al(a,t,s))}};function Ub(t,a,s,c,h,p,C){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,p,C):a.prototype&&a.prototype.isPureReactComponent?!Yo(s,c)||!Yo(h,p):!0}function Bb(t,a,s,c){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,c),a.state!==t&&Hh.enqueueReplaceState(a,a.state,null)}function qi(t,a){var s=a;if("ref"in a){s={};for(var c in a)c!=="ref"&&(s[c]=a[c])}if(t=t.defaultProps){s===a&&(s=b({},s));for(var h in t)s[h]===void 0&&(s[h]=t[h])}return s}function Pb(t){Kc(t)}function qb(t){console.error(t)}function Gb(t){Kc(t)}function mu(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function Vb(t,a,s){try{var c=t.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function zh(t,a,s){return s=Fr(s),s.tag=3,s.payload={element:null},s.callback=function(){mu(t,a)},s}function Fb(t){return t=Fr(t),t.tag=3,t}function Kb(t,a,s,c){var h=s.type.getDerivedStateFromError;if(typeof h=="function"){var p=c.value;t.payload=function(){return h(p)},t.callback=function(){Vb(a,s,c)}}var C=s.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(t.callback=function(){Vb(a,s,c),typeof h!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var R=c.stack;this.componentDidCatch(c.value,{componentStack:R!==null?R:""})})}function dx(t,a,s,c,h){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=s.alternate,a!==null&&Rs(a,s,h,!0),s=Yn.current,s!==null){switch(s.tag){case 31:case 13:return ca===null?Ru():s.alternate===null&&Vt===0&&(Vt=3),s.flags&=-257,s.flags|=65536,s.lanes=h,c===au?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([c]):a.add(c),cg(t,c,h)),!1;case 22:return s.flags|=65536,c===au?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([c]):s.add(c)),cg(t,c,h)),!1}throw Error(r(435,s.tag))}return cg(t,c,h),Ru(),!1}if(ct)return a=Yn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=h,c!==ah&&(t=Error(r(422),{cause:c}),Qo(ia(t,s)))):(c!==ah&&(a=Error(r(423),{cause:c}),Qo(ia(a,s))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,c=ia(c,s),h=zh(t.stateNode,c,h),gh(t,h),Vt!==4&&(Vt=2)),!1;var p=Error(r(520),{cause:c});if(p=ia(p,s),yl===null?yl=[p]:yl.push(p),Vt!==4&&(Vt=2),a===null)return!0;c=ia(c,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=h&-h,s.lanes|=t,t=zh(s.stateNode,c,t),gh(s,t),!1;case 1:if(a=s.type,p=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Zr===null||!Zr.has(p))))return s.flags|=65536,h&=-h,s.lanes|=h,h=Fb(h),Kb(h,t,s,c),gh(s,h),!1}s=s.return}while(s!==null);return!1}var jh=Error(r(461)),nn=!1;function vn(t,a,s,c){a.child=t===null?Jy(a,null,s,c):Bi(a,t.child,s,c)}function Wb(t,a,s,c,h){s=s.render;var p=a.ref;if("ref"in c){var C={};for(var R in c)R!=="ref"&&(C[R]=c[R])}else C=c;return Hi(a),c=Sh(t,a,s,C,p,h),R=wh(),t!==null&&!nn?(Ch(t,a,h),hr(t,a,h)):(ct&&R&&th(a),a.flags|=1,vn(t,a,c,h),a.child)}function Yb(t,a,s,c,h){if(t===null){var p=s.type;return typeof p=="function"&&!Qf(p)&&p.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=p,Xb(t,a,p,c,h)):(t=Jc(s.type,null,c,a,a.mode,h),t.ref=a.ref,t.return=a,a.child=t)}if(p=t.child,!Kh(t,h)){var C=p.memoizedProps;if(s=s.compare,s=s!==null?s:Yo,s(C,c)&&t.ref===a.ref)return hr(t,a,h)}return a.flags|=1,t=or(p,c),t.ref=a.ref,t.return=a,a.child=t}function Xb(t,a,s,c,h){if(t!==null){var p=t.memoizedProps;if(Yo(p,c)&&t.ref===a.ref)if(nn=!1,a.pendingProps=c=p,Kh(t,h))(t.flags&131072)!==0&&(nn=!0);else return a.lanes=t.lanes,hr(t,a,h)}return Uh(t,a,s,c,h)}function Jb(t,a,s,c){var h=c.children,p=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((a.flags&128)!==0){if(p=p!==null?p.baseLanes|s:s,t!==null){for(c=a.child=t.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;c=h&~p}else c=0,a.child=null;return Qb(t,a,p,s,c)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&tu(a,p!==null?p.cachePool:null),p!==null?eb(a,p):mh(),tb(a);else return c=a.lanes=536870912,Qb(t,a,p!==null?p.baseLanes|s:s,s,c)}else p!==null?(tu(a,p.cachePool),eb(a,p),Yr(),a.memoizedState=null):(t!==null&&tu(a,null),mh(),Yr());return vn(t,a,h,s),a.child}function ul(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Qb(t,a,s,c,h){var p=uh();return p=p===null?null:{parent:en._currentValue,pool:p},a.memoizedState={baseLanes:s,cachePool:p},t!==null&&tu(a,null),mh(),tb(a),t!==null&&Rs(t,a,c,!0),a.childLanes=h,null}function yu(t,a){return a=vu({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function Zb(t,a,s){return Bi(a,t.child,null,s),t=yu(a,a.pendingProps),t.flags|=2,Xn(a),a.memoizedState=null,t}function fx(t,a,s){var c=a.pendingProps,h=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(ct){if(c.mode==="hidden")return t=yu(a,c),a.lanes=536870912,ul(null,t);if(bh(a),(t=Mt)?(t=dS(t,la),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Br!==null?{id:Va,overflow:Fa}:null,retryLane:536870912,hydrationErrors:null},s=Iy(t),s.return=a,a.child=s,yn=a,Mt=null)):t=null,t===null)throw qr(a);return a.lanes=536870912,null}return yu(a,c)}var p=t.memoizedState;if(p!==null){var C=p.dehydrated;if(bh(a),h)if(a.flags&256)a.flags&=-257,a=Zb(t,a,s);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(nn||Rs(t,a,s,!1),h=(s&t.childLanes)!==0,nn||h){if(c=Dt,c!==null&&(C=ot(c,s),C!==0&&C!==p.retryLane))throw p.retryLane=C,Mi(t,C),Pn(c,t,C),jh;Ru(),a=Zb(t,a,s)}else t=p.treeContext,Mt=ua(C.nextSibling),yn=a,ct=!0,Pr=null,la=!1,t!==null&&jy(a,t),a=yu(a,c),a.flags|=4096;return a}return t=or(t.child,{mode:c.mode,children:c.children}),t.ref=a.ref,a.child=t,t.return=a,t}function bu(t,a){var s=a.ref;if(s===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(t===null||t.ref!==s)&&(a.flags|=4194816)}}function Uh(t,a,s,c,h){return Hi(a),s=Sh(t,a,s,c,void 0,h),c=wh(),t!==null&&!nn?(Ch(t,a,h),hr(t,a,h)):(ct&&c&&th(a),a.flags|=1,vn(t,a,s,h),a.child)}function ev(t,a,s,c,h,p){return Hi(a),a.updateQueue=null,s=ab(a,c,s,h),nb(t),c=wh(),t!==null&&!nn?(Ch(t,a,p),hr(t,a,p)):(ct&&c&&th(a),a.flags|=1,vn(t,a,s,p),a.child)}function tv(t,a,s,c,h){if(Hi(a),a.stateNode===null){var p=_s,C=s.contextType;typeof C=="object"&&C!==null&&(p=bn(C)),p=new s(c,p),a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Hh,a.stateNode=p,p._reactInternals=a,p=a.stateNode,p.props=c,p.state=a.memoizedState,p.refs={},fh(a),C=s.contextType,p.context=typeof C=="object"&&C!==null?bn(C):_s,p.state=a.memoizedState,C=s.getDerivedStateFromProps,typeof C=="function"&&(Ih(a,s,C,c),p.state=a.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&&Hh.enqueueReplaceState(p,p.state,null),il(a,c,p,h),rl(),p.state=a.memoizedState),typeof p.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(t===null){p=a.stateNode;var R=a.memoizedProps,U=qi(s,R);p.props=U;var Y=p.context,ne=s.contextType;C=_s,typeof ne=="object"&&ne!==null&&(C=bn(ne));var ce=s.getDerivedStateFromProps;ne=typeof ce=="function"||typeof p.getSnapshotBeforeUpdate=="function",R=a.pendingProps!==R,ne||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(R||Y!==C)&&Bb(a,p,c,C),Vr=!1;var J=a.memoizedState;p.state=J,il(a,c,p,h),rl(),Y=a.memoizedState,R||J!==Y||Vr?(typeof ce=="function"&&(Ih(a,s,ce,c),Y=a.memoizedState),(U=Vr||Ub(a,s,U,c,J,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"&&(a.flags|=4194308)):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=Y),p.props=c,p.state=Y,p.context=C,c=U):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{p=a.stateNode,hh(t,a),C=a.memoizedProps,ne=qi(s,C),p.props=ne,ce=a.pendingProps,J=p.context,Y=s.contextType,U=_s,typeof Y=="object"&&Y!==null&&(U=bn(Y)),R=s.getDerivedStateFromProps,(Y=typeof R=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(C!==ce||J!==U)&&Bb(a,p,c,U),Vr=!1,J=a.memoizedState,p.state=J,il(a,c,p,h),rl();var ee=a.memoizedState;C!==ce||J!==ee||Vr||t!==null&&t.dependencies!==null&&Zc(t.dependencies)?(typeof R=="function"&&(Ih(a,s,R,c),ee=a.memoizedState),(ne=Vr||Ub(a,s,ne,c,J,ee,U)||t!==null&&t.dependencies!==null&&Zc(t.dependencies))?(Y||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(c,ee,U),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(c,ee,U)),typeof p.componentDidUpdate=="function"&&(a.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof p.componentDidUpdate!="function"||C===t.memoizedProps&&J===t.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&J===t.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=ee),p.props=c,p.state=ee,p.context=U,c=ne):(typeof p.componentDidUpdate!="function"||C===t.memoizedProps&&J===t.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&J===t.memoizedState||(a.flags|=1024),c=!1)}return p=c,bu(t,a),c=(a.flags&128)!==0,p||c?(p=a.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:p.render(),a.flags|=1,t!==null&&c?(a.child=Bi(a,t.child,null,h),a.child=Bi(a,null,s,h)):vn(t,a,s,h),a.memoizedState=p.state,t=a.child):t=hr(t,a,h),t}function nv(t,a,s,c){return Ni(),a.flags|=256,vn(t,a,s,c),a.child}var Bh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ph(t){return{baseLanes:t,cachePool:Vy()}}function qh(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=Qn),t}function av(t,a,s){var c=a.pendingProps,h=!1,p=(a.flags&128)!==0,C;if((C=p)||(C=t!==null&&t.memoizedState===null?!1:(Wt.current&2)!==0),C&&(h=!0,a.flags&=-129),C=(a.flags&32)!==0,a.flags&=-33,t===null){if(ct){if(h?Wr(a):Yr(),(t=Mt)?(t=dS(t,la),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Br!==null?{id:Va,overflow:Fa}:null,retryLane:536870912,hydrationErrors:null},s=Iy(t),s.return=a,a.child=s,yn=a,Mt=null)):t=null,t===null)throw qr(a);return Ag(t)?a.lanes=32:a.lanes=536870912,null}var R=c.children;return c=c.fallback,h?(Yr(),h=a.mode,R=vu({mode:"hidden",children:R},h),c=$i(c,h,s,null),R.return=a,c.return=a,R.sibling=c,a.child=R,c=a.child,c.memoizedState=Ph(s),c.childLanes=qh(t,C,s),a.memoizedState=Bh,ul(null,c)):(Wr(a),Gh(a,R))}var U=t.memoizedState;if(U!==null&&(R=U.dehydrated,R!==null)){if(p)a.flags&256?(Wr(a),a.flags&=-257,a=Vh(t,a,s)):a.memoizedState!==null?(Yr(),a.child=t.child,a.flags|=128,a=null):(Yr(),R=c.fallback,h=a.mode,c=vu({mode:"visible",children:c.children},h),R=$i(R,h,s,null),R.flags|=2,c.return=a,R.return=a,c.sibling=R,a.child=c,Bi(a,t.child,null,s),c=a.child,c.memoizedState=Ph(s),c.childLanes=qh(t,C,s),a.memoizedState=Bh,a=ul(null,c));else if(Wr(a),Ag(R)){if(C=R.nextSibling&&R.nextSibling.dataset,C)var Y=C.dgst;C=Y,c=Error(r(419)),c.stack="",c.digest=C,Qo({value:c,source:null,stack:null}),a=Vh(t,a,s)}else if(nn||Rs(t,a,s,!1),C=(s&t.childLanes)!==0,nn||C){if(C=Dt,C!==null&&(c=ot(C,s),c!==0&&c!==U.retryLane))throw U.retryLane=c,Mi(t,c),Pn(C,t,c),jh;_g(R)||Ru(),a=Vh(t,a,s)}else _g(R)?(a.flags|=192,a.child=t.child,a=null):(t=U.treeContext,Mt=ua(R.nextSibling),yn=a,ct=!0,Pr=null,la=!1,t!==null&&jy(a,t),a=Gh(a,c.children),a.flags|=4096);return a}return h?(Yr(),R=c.fallback,h=a.mode,U=t.child,Y=U.sibling,c=or(U,{mode:"hidden",children:c.children}),c.subtreeFlags=U.subtreeFlags&65011712,Y!==null?R=or(Y,R):(R=$i(R,h,s,null),R.flags|=2),R.return=a,c.return=a,c.sibling=R,a.child=c,ul(null,c),c=a.child,R=t.child.memoizedState,R===null?R=Ph(s):(h=R.cachePool,h!==null?(U=en._currentValue,h=h.parent!==U?{parent:U,pool:U}:h):h=Vy(),R={baseLanes:R.baseLanes|s,cachePool:h}),c.memoizedState=R,c.childLanes=qh(t,C,s),a.memoizedState=Bh,ul(t.child,c)):(Wr(a),s=t.child,t=s.sibling,s=or(s,{mode:"visible",children:c.children}),s.return=a,s.sibling=null,t!==null&&(C=a.deletions,C===null?(a.deletions=[t],a.flags|=16):C.push(t)),a.child=s,a.memoizedState=null,s)}function Gh(t,a){return a=vu({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function vu(t,a){return t=Wn(22,t,null,a),t.lanes=0,t}function Vh(t,a,s){return Bi(a,t.child,null,s),t=Gh(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function rv(t,a,s){t.lanes|=a;var c=t.alternate;c!==null&&(c.lanes|=a),sh(t.return,a,s)}function Fh(t,a,s,c,h,p){var C=t.memoizedState;C===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:h,treeForkCount:p}:(C.isBackwards=a,C.rendering=null,C.renderingStartTime=0,C.last=c,C.tail=s,C.tailMode=h,C.treeForkCount=p)}function iv(t,a,s){var c=a.pendingProps,h=c.revealOrder,p=c.tail;c=c.children;var C=Wt.current,R=(C&2)!==0;if(R?(C=C&1|2,a.flags|=128):C&=1,ue(Wt,C),vn(t,a,c,s),c=ct?Jo:0,!R&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&rv(t,s,a);else if(t.tag===19)rv(t,s,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(s=a.child,h=null;s!==null;)t=s.alternate,t!==null&&ou(t)===null&&(h=s),s=s.sibling;s=h,s===null?(h=a.child,a.child=null):(h=s.sibling,s.sibling=null),Fh(a,!1,h,s,p,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,h=a.child,a.child=null;h!==null;){if(t=h.alternate,t!==null&&ou(t)===null){a.child=h;break}t=h.sibling,h.sibling=s,s=h,h=t}Fh(a,!0,s,null,p,c);break;case"together":Fh(a,!1,null,null,void 0,c);break;default:a.memoizedState=null}return a.child}function hr(t,a,s){if(t!==null&&(a.dependencies=t.dependencies),Qr|=a.lanes,(s&a.childLanes)===0)if(t!==null){if(Rs(t,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(r(153));if(a.child!==null){for(t=a.child,s=or(t,t.pendingProps),a.child=s,s.return=a;t.sibling!==null;)t=t.sibling,s=s.sibling=or(t,t.pendingProps),s.return=a;s.sibling=null}return a.child}function Kh(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Zc(t)))}function hx(t,a,s){switch(a.tag){case 3:He(a,a.stateNode.containerInfo),Gr(a,en,t.memoizedState.cache),Ni();break;case 27:case 5:ke(a);break;case 4:He(a,a.stateNode.containerInfo);break;case 10:Gr(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,bh(a),null;break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?(Wr(a),a.flags|=128,null):(s&a.child.childLanes)!==0?av(t,a,s):(Wr(a),t=hr(t,a,s),t!==null?t.sibling:null);Wr(a);break;case 19:var h=(t.flags&128)!==0;if(c=(s&a.childLanes)!==0,c||(Rs(t,a,s,!1),c=(s&a.childLanes)!==0),h){if(c)return iv(t,a,s);a.flags|=128}if(h=a.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ue(Wt,Wt.current),c)break;return null;case 22:return a.lanes=0,Jb(t,a,s,a.pendingProps);case 24:Gr(a,en,t.memoizedState.cache)}return hr(t,a,s)}function sv(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)nn=!0;else{if(!Kh(t,s)&&(a.flags&128)===0)return nn=!1,hx(t,a,s);nn=(t.flags&131072)!==0}else nn=!1,ct&&(a.flags&1048576)!==0&&zy(a,Jo,a.index);switch(a.lanes=0,a.tag){case 16:e:{var c=a.pendingProps;if(t=ji(a.elementType),a.type=t,typeof t=="function")Qf(t)?(c=qi(t,c),a.tag=1,a=tv(null,a,t,c,s)):(a.tag=0,a=Uh(null,a,t,c,s));else{if(t!=null){var h=t.$$typeof;if(h===D){a.tag=11,a=Wb(null,a,t,c,s);break e}else if(h===P){a.tag=14,a=Yb(null,a,t,c,s);break e}}throw a=Je(t)||t,Error(r(306,a,""))}}return a;case 0:return Uh(t,a,a.type,a.pendingProps,s);case 1:return c=a.type,h=qi(c,a.pendingProps),tv(t,a,c,h,s);case 3:e:{if(He(a,a.stateNode.containerInfo),t===null)throw Error(r(387));c=a.pendingProps;var p=a.memoizedState;h=p.element,hh(t,a),il(a,c,null,s);var C=a.memoizedState;if(c=C.cache,Gr(a,en,c),c!==p.cache&&oh(a,[en],s,!0),rl(),c=C.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:C.cache},a.updateQueue.baseState=p,a.memoizedState=p,a.flags&256){a=nv(t,a,c,s);break e}else if(c!==h){h=ia(Error(r(424)),a),Qo(h),a=nv(t,a,c,s);break e}else for(t=a.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Mt=ua(t.firstChild),yn=a,ct=!0,Pr=null,la=!0,s=Jy(a,null,c,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ni(),c===h){a=hr(t,a,s);break e}vn(t,a,c,s)}a=a.child}return a;case 26:return bu(t,a),t===null?(s=yS(a.type,null,a.pendingProps,null))?a.memoizedState=s:ct||(s=a.type,t=a.pendingProps,c=Nu(de.current).createElement(s),c[ln]=a,c[xn]=t,Sn(c,s,t),Zt(c),a.stateNode=c):a.memoizedState=yS(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return ke(a),t===null&&ct&&(c=a.stateNode=gS(a.type,a.pendingProps,de.current),yn=a,la=!0,h=Mt,ai(a.type)?(xg=h,Mt=ua(c.firstChild)):Mt=h),vn(t,a,a.pendingProps.children,s),bu(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&ct&&((h=c=Mt)&&(c=qx(c,a.type,a.pendingProps,la),c!==null?(a.stateNode=c,yn=a,Mt=ua(c.firstChild),la=!1,h=!0):h=!1),h||qr(a)),ke(a),h=a.type,p=a.pendingProps,C=t!==null?t.memoizedProps:null,c=p.children,wg(h,p)?c=null:C!==null&&wg(h,C)&&(a.flags|=32),a.memoizedState!==null&&(h=Sh(t,a,rx,null,null,s),Al._currentValue=h),bu(t,a),vn(t,a,c,s),a.child;case 6:return t===null&&ct&&((t=s=Mt)&&(s=Gx(s,a.pendingProps,la),s!==null?(a.stateNode=s,yn=a,Mt=null,t=!0):t=!1),t||qr(a)),null;case 13:return av(t,a,s);case 4:return He(a,a.stateNode.containerInfo),c=a.pendingProps,t===null?a.child=Bi(a,null,c,s):vn(t,a,c,s),a.child;case 11:return Wb(t,a,a.type,a.pendingProps,s);case 7:return vn(t,a,a.pendingProps,s),a.child;case 8:return vn(t,a,a.pendingProps.children,s),a.child;case 12:return vn(t,a,a.pendingProps.children,s),a.child;case 10:return c=a.pendingProps,Gr(a,a.type,c.value),vn(t,a,c.children,s),a.child;case 9:return h=a.type._context,c=a.pendingProps.children,Hi(a),h=bn(h),c=c(h),a.flags|=1,vn(t,a,c,s),a.child;case 14:return Yb(t,a,a.type,a.pendingProps,s);case 15:return Xb(t,a,a.type,a.pendingProps,s);case 19:return iv(t,a,s);case 31:return fx(t,a,s);case 22:return Jb(t,a,s,a.pendingProps);case 24:return Hi(a),c=bn(en),t===null?(h=uh(),h===null&&(h=Dt,p=lh(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=s),h=p),a.memoizedState={parent:c,cache:h},fh(a),Gr(a,en,h)):((t.lanes&s)!==0&&(hh(t,a),il(a,null,null,s),rl()),h=t.memoizedState,p=a.memoizedState,h.parent!==c?(h={parent:c,cache:c},a.memoizedState=h,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=h),Gr(a,en,c)):(c=p.cache,Gr(a,en,c),c!==h.cache&&oh(a,[en],s,!0))),vn(t,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function gr(t){t.flags|=4}function Wh(t,a,s,c,h){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Mv())t.flags|=8192;else throw Ui=au,dh}else t.flags&=-16777217}function ov(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!CS(a))if(Mv())t.flags|=8192;else throw Ui=au,dh}function Su(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?De():536870912,t.lanes|=a,Us|=a)}function dl(t,a){if(!ct)switch(t.tailMode){case"hidden":a=t.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function $t(t){var a=t.alternate!==null&&t.alternate.child===t.child,s=0,c=0;if(a)for(var h=t.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=c,t.childLanes=s,a}function gx(t,a,s){var c=a.pendingProps;switch(nh(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $t(a),null;case 1:return $t(a),null;case 3:return s=a.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),ur(en),Pe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Ts(a)?gr(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,rh())),$t(a),null;case 26:var h=a.type,p=a.memoizedState;return t===null?(gr(a),p!==null?($t(a),ov(a,p)):($t(a),Wh(a,h,null,c,s))):p?p!==t.memoizedState?(gr(a),$t(a),ov(a,p)):($t(a),a.flags&=-16777217):(t=t.memoizedProps,t!==c&&gr(a),$t(a),Wh(a,h,t,c,s)),null;case 27:if(Ot(a),s=de.current,h=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==c&&gr(a);else{if(!c){if(a.stateNode===null)throw Error(r(166));return $t(a),null}t=he.current,Ts(a)?Uy(a):(t=gS(h,c,s),a.stateNode=t,gr(a))}return $t(a),null;case 5:if(Ot(a),h=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==c&&gr(a);else{if(!c){if(a.stateNode===null)throw Error(r(166));return $t(a),null}if(p=he.current,Ts(a))Uy(a);else{var C=Nu(de.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 c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?p.multiple=!0:c.size&&(p.size=c.size);break;default:p=typeof c.is=="string"?C.createElement(h,{is:c.is}):C.createElement(h)}}p[ln]=a,p[xn]=c;e:for(C=a.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===a)break e;for(;C.sibling===null;){if(C.return===null||C.return===a)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}a.stateNode=p;e:switch(Sn(p,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&gr(a)}}return $t(a),Wh(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==c&&gr(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(r(166));if(t=de.current,Ts(a)){if(t=a.stateNode,s=a.memoizedProps,c=null,h=yn,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}t[ln]=a,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||aS(t.nodeValue,s)),t||qr(a,!0)}else t=Nu(t).createTextNode(c),t[ln]=a,a.stateNode=t}return $t(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(c=Ts(a),s!==null){if(t===null){if(!c)throw Error(r(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[ln]=a}else Ni(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;$t(a),t=!1}else s=rh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(Xn(a),a):(Xn(a),null);if((a.flags&128)!==0)throw Error(r(558))}return $t(a),null;case 13:if(c=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Ts(a),c!==null&&c.dehydrated!==null){if(t===null){if(!h)throw Error(r(318));if(h=a.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[ln]=a}else Ni(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;$t(a),h=!1}else h=rh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return a.flags&256?(Xn(a),a):(Xn(a),null)}return Xn(a),(a.flags&128)!==0?(a.lanes=s,a):(s=c!==null,t=t!==null&&t.memoizedState!==null,s&&(c=a.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),p=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),p!==h&&(c.flags|=2048)),s!==t&&s&&(a.child.flags|=8192),Su(a,a.updateQueue),$t(a),null);case 4:return Pe(),t===null&&mg(a.stateNode.containerInfo),$t(a),null;case 10:return ur(a.type),$t(a),null;case 19:if(K(Wt),c=a.memoizedState,c===null)return $t(a),null;if(h=(a.flags&128)!==0,p=c.rendering,p===null)if(h)dl(c,!1);else{if(Vt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(p=ou(t),p!==null){for(a.flags|=128,dl(c,!1),t=p.updateQueue,a.updateQueue=t,Su(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)Ny(s,t),s=s.sibling;return ue(Wt,Wt.current&1|2),ct&&lr(a,c.treeForkCount),a.child}t=t.sibling}c.tail!==null&&Jt()>Au&&(a.flags|=128,h=!0,dl(c,!1),a.lanes=4194304)}else{if(!h)if(t=ou(p),t!==null){if(a.flags|=128,h=!0,t=t.updateQueue,a.updateQueue=t,Su(a,t),dl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!ct)return $t(a),null}else 2*Jt()-c.renderingStartTime>Au&&s!==536870912&&(a.flags|=128,h=!0,dl(c,!1),a.lanes=4194304);c.isBackwards?(p.sibling=a.child,a.child=p):(t=c.last,t!==null?t.sibling=p:a.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Jt(),t.sibling=null,s=Wt.current,ue(Wt,h?s&1|2:s&1),ct&&lr(a,c.treeForkCount),t):($t(a),null);case 22:case 23:return Xn(a),yh(),c=a.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&($t(a),a.subtreeFlags&6&&(a.flags|=8192)):$t(a),s=a.updateQueue,s!==null&&Su(a,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),t!==null&&K(zi),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),ur(en),$t(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function px(t,a){switch(nh(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return ur(en),Pe(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Ot(a),null;case 31:if(a.memoizedState!==null){if(Xn(a),a.alternate===null)throw Error(r(340));Ni()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(Xn(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Ni()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return K(Wt),null;case 4:return Pe(),null;case 10:return ur(a.type),null;case 22:case 23:return Xn(a),yh(),t!==null&&K(zi),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return ur(en),null;case 25:return null;default:return null}}function lv(t,a){switch(nh(a),a.tag){case 3:ur(en),Pe();break;case 26:case 27:case 5:Ot(a);break;case 4:Pe();break;case 31:a.memoizedState!==null&&Xn(a);break;case 13:Xn(a);break;case 19:K(Wt);break;case 10:ur(a.type);break;case 22:case 23:Xn(a),yh(),t!==null&&K(zi);break;case 24:ur(en)}}function fl(t,a){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next;s=h;do{if((s.tag&t)===t){c=void 0;var p=s.create,C=s.inst;c=p(),C.destroy=c}s=s.next}while(s!==h)}}catch(R){_t(a,a.return,R)}}function Xr(t,a,s){try{var c=a.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var p=h.next;c=p;do{if((c.tag&t)===t){var C=c.inst,R=C.destroy;if(R!==void 0){C.destroy=void 0,h=a;var U=s,Y=R;try{Y()}catch(ne){_t(h,U,ne)}}}c=c.next}while(c!==p)}}catch(ne){_t(a,a.return,ne)}}function cv(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{Zy(a,s)}catch(c){_t(t,t.return,c)}}}function uv(t,a,s){s.props=qi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){_t(t,a,c)}}function hl(t,a){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(h){_t(t,a,h)}}function Ka(t,a){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){_t(t,a,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){_t(t,a,h)}else s.current=null}function dv(t){var a=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(h){_t(t,t.return,h)}}function Yh(t,a,s){try{var c=t.stateNode;Hx(c,t.type,s,a),c[xn]=a}catch(h){_t(t,t.return,h)}}function fv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ai(t.type)||t.tag===4}function Xh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||fv(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&&ai(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 Jh(t,a,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(t),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=xa));else if(c!==4&&(c===27&&ai(t.type)&&(s=t.stateNode,a=null),t=t.child,t!==null))for(Jh(t,a,s),t=t.sibling;t!==null;)Jh(t,a,s),t=t.sibling}function wu(t,a,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?s.insertBefore(t,a):s.appendChild(t);else if(c!==4&&(c===27&&ai(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(wu(t,a,s),t=t.sibling;t!==null;)wu(t,a,s),t=t.sibling}function hv(t){var a=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,h=a.attributes;h.length;)a.removeAttributeNode(h[0]);Sn(a,c,s),a[ln]=t,a[xn]=s}catch(p){_t(t,t.return,p)}}var pr=!1,an=!1,Qh=!1,gv=typeof WeakSet=="function"?WeakSet:Set,gn=null;function mx(t,a){if(t=t.containerInfo,vg=Pu,t=xy(t),Vf(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var C=0,R=-1,U=-1,Y=0,ne=0,ce=t,J=null;t:for(;;){for(var ee;ce!==s||h!==0&&ce.nodeType!==3||(R=C+h),ce!==p||c!==0&&ce.nodeType!==3||(U=C+c),ce.nodeType===3&&(C+=ce.nodeValue.length),(ee=ce.firstChild)!==null;)J=ce,ce=ee;for(;;){if(ce===t)break t;if(J===s&&++Y===h&&(R=C),J===p&&++ne===c&&(U=C),(ee=ce.nextSibling)!==null)break;ce=J,J=ce.parentNode}ce=ee}s=R===-1||U===-1?null:{start:R,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(Sg={focusedElem:t,selectionRange:s},Pu=!1,gn=a;gn!==null;)if(a=gn,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,gn=t;else for(;gn!==null;){switch(a=gn,p=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.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=a,h=p.memoizedProps,p=p.memoizedState,c=s.stateNode;try{var Le=qi(s.type,h);t=c.getSnapshotBeforeUpdate(Le,p),c.__reactInternalSnapshotBeforeUpdate=t}catch(Ve){_t(s,s.return,Ve)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,s=t.nodeType,s===9)Eg(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Eg(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(r(163))}if(t=a.sibling,t!==null){t.return=a.return,gn=t;break}gn=a.return}}function pv(t,a,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:yr(t,s),c&4&&fl(5,s);break;case 1:if(yr(t,s),c&4)if(t=s.stateNode,a===null)try{t.componentDidMount()}catch(C){_t(s,s.return,C)}else{var h=qi(s.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(h,a,t.__reactInternalSnapshotBeforeUpdate)}catch(C){_t(s,s.return,C)}}c&64&&cv(s),c&512&&hl(s,s.return);break;case 3:if(yr(t,s),c&64&&(t=s.updateQueue,t!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{Zy(t,a)}catch(C){_t(s,s.return,C)}}break;case 27:a===null&&c&4&&hv(s);case 26:case 5:yr(t,s),a===null&&c&4&&dv(s),c&512&&hl(s,s.return);break;case 12:yr(t,s);break;case 31:yr(t,s),c&4&&bv(t,s);break;case 13:yr(t,s),c&4&&vv(t,s),c&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Ax.bind(null,s),Vx(t,s))));break;case 22:if(c=s.memoizedState!==null||pr,!c){a=a!==null&&a.memoizedState!==null||an,h=pr;var p=an;pr=c,(an=a)&&!p?br(t,s,(s.subtreeFlags&8772)!==0):yr(t,s),pr=h,an=p}break;case 30:break;default:yr(t,s)}}function mv(t){var a=t.alternate;a!==null&&(t.alternate=null,mv(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Mo(a)),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 It=null,zn=!1;function mr(t,a,s){for(s=s.child;s!==null;)yv(t,a,s),s=s.sibling}function yv(t,a,s){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(_a,s)}catch{}switch(s.tag){case 26:an||Ka(s,a),mr(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:an||Ka(s,a);var c=It,h=zn;ai(s.type)&&(It=s.stateNode,zn=!1),mr(t,a,s),Cl(s.stateNode),It=c,zn=h;break;case 5:an||Ka(s,a);case 6:if(c=It,h=zn,It=null,mr(t,a,s),It=c,zn=h,It!==null)if(zn)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(s.stateNode)}catch(p){_t(s,a,p)}else try{It.removeChild(s.stateNode)}catch(p){_t(s,a,p)}break;case 18:It!==null&&(zn?(t=It,cS(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ws(t)):cS(It,s.stateNode));break;case 4:c=It,h=zn,It=s.stateNode.containerInfo,zn=!0,mr(t,a,s),It=c,zn=h;break;case 0:case 11:case 14:case 15:Xr(2,s,a),an||Xr(4,s,a),mr(t,a,s);break;case 1:an||(Ka(s,a),c=s.stateNode,typeof c.componentWillUnmount=="function"&&uv(s,a,c)),mr(t,a,s);break;case 21:mr(t,a,s);break;case 22:an=(c=an)||s.memoizedState!==null,mr(t,a,s),an=c;break;default:mr(t,a,s)}}function bv(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ws(t)}catch(s){_t(a,a.return,s)}}}function vv(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ws(t)}catch(s){_t(a,a.return,s)}}function yx(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new gv),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new gv),a;default:throw Error(r(435,t.tag))}}function Cu(t,a){var s=yx(t);a.forEach(function(c){if(!s.has(c)){s.add(c);var h=xx.bind(null,t,c);c.then(h,h)}})}function jn(t,a){var s=a.deletions;if(s!==null)for(var c=0;c<s.length;c++){var h=s[c],p=t,C=a,R=C;e:for(;R!==null;){switch(R.tag){case 27:if(ai(R.type)){It=R.stateNode,zn=!1;break e}break;case 5:It=R.stateNode,zn=!1;break e;case 3:case 4:It=R.stateNode.containerInfo,zn=!0;break e}R=R.return}if(It===null)throw Error(r(160));yv(p,C,h),It=null,zn=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Sv(a,t),a=a.sibling}var Oa=null;function Sv(t,a){var s=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:jn(a,t),Un(t),c&4&&(Xr(3,t,t.return),fl(3,t),Xr(5,t,t.return));break;case 1:jn(a,t),Un(t),c&512&&(an||s===null||Ka(s,s.return)),c&64&&pr&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var h=Oa;if(jn(a,t),Un(t),c&512&&(an||s===null||Ka(s,s.return)),c&4){var p=s!==null?s.memoizedState:null;if(c=t.memoizedState,s===null)if(c===null)if(t.stateNode===null){e:{c=t.type,s=t.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":p=h.getElementsByTagName("title")[0],(!p||p[vi]||p[ln]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(c),h.head.insertBefore(p,h.querySelector("head > title"))),Sn(p,c,s),p[ln]=t,Zt(p),c=p;break e;case"link":var C=SS("link","href",h).get(c+(s.href||""));if(C){for(var R=0;R<C.length;R++)if(p=C[R],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(R,1);break t}}p=h.createElement(c),Sn(p,c,s),h.head.appendChild(p);break;case"meta":if(C=SS("meta","content",h).get(c+(s.content||""))){for(R=0;R<C.length;R++)if(p=C[R],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(R,1);break t}}p=h.createElement(c),Sn(p,c,s),h.head.appendChild(p);break;default:throw Error(r(468,c))}p[ln]=t,Zt(p),c=p}t.stateNode=c}else wS(h,t.type,t.stateNode);else t.stateNode=vS(h,c,t.memoizedProps);else p!==c?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,c===null?wS(h,t.type,t.stateNode):vS(h,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Yh(t,t.memoizedProps,s.memoizedProps)}break;case 27:jn(a,t),Un(t),c&512&&(an||s===null||Ka(s,s.return)),s!==null&&c&4&&Yh(t,t.memoizedProps,s.memoizedProps);break;case 5:if(jn(a,t),Un(t),c&512&&(an||s===null||Ka(s,s.return)),t.flags&32){h=t.stateNode;try{zr(h,"")}catch(Le){_t(t,t.return,Le)}}c&4&&t.stateNode!=null&&(h=t.memoizedProps,Yh(t,h,s!==null?s.memoizedProps:h)),c&1024&&(Qh=!0);break;case 6:if(jn(a,t),Un(t),c&4){if(t.stateNode===null)throw Error(r(162));c=t.memoizedProps,s=t.stateNode;try{s.nodeValue=c}catch(Le){_t(t,t.return,Le)}}break;case 3:if(zu=null,h=Oa,Oa=Iu(a.containerInfo),jn(a,t),Oa=h,Un(t),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Ws(a.containerInfo)}catch(Le){_t(t,t.return,Le)}Qh&&(Qh=!1,wv(t));break;case 4:c=Oa,Oa=Iu(t.stateNode.containerInfo),jn(a,t),Un(t),Oa=c;break;case 12:jn(a,t),Un(t);break;case 31:jn(a,t),Un(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Cu(t,c)));break;case 13:jn(a,t),Un(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(_u=Jt()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Cu(t,c)));break;case 22:h=t.memoizedState!==null;var U=s!==null&&s.memoizedState!==null,Y=pr,ne=an;if(pr=Y||h,an=ne||U,jn(a,t),an=ne,pr=Y,Un(t),c&8192)e:for(a=t.stateNode,a._visibility=h?a._visibility&-2:a._visibility|1,h&&(s===null||U||pr||an||Gi(t)),s=null,a=t;;){if(a.tag===5||a.tag===26){if(s===null){U=s=a;try{if(p=U.stateNode,h)C=p.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{R=U.stateNode;var ce=U.memoizedProps.style,J=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;R.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(Le){_t(U,U.return,Le)}}}else if(a.tag===6){if(s===null){U=a;try{U.stateNode.nodeValue=h?"":U.memoizedProps}catch(Le){_t(U,U.return,Le)}}}else if(a.tag===18){if(s===null){U=a;try{var ee=U.stateNode;h?uS(ee,!0):uS(U.stateNode,!1)}catch(Le){_t(U,U.return,Le)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=t.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Cu(t,s))));break;case 19:jn(a,t),Un(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Cu(t,c)));break;case 30:break;case 21:break;default:jn(a,t),Un(t)}}function Un(t){var a=t.flags;if(a&2){try{for(var s,c=t.return;c!==null;){if(fv(c)){s=c;break}c=c.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var h=s.stateNode,p=Xh(t);wu(t,p,h);break;case 5:var C=s.stateNode;s.flags&32&&(zr(C,""),s.flags&=-33);var R=Xh(t);wu(t,R,C);break;case 3:case 4:var U=s.stateNode.containerInfo,Y=Xh(t);Jh(t,Y,U);break;default:throw Error(r(161))}}catch(ne){_t(t,t.return,ne)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function wv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;wv(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function yr(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)pv(t,a.alternate,a),a=a.sibling}function Gi(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Xr(4,a,a.return),Gi(a);break;case 1:Ka(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&uv(a,a.return,s),Gi(a);break;case 27:Cl(a.stateNode);case 26:case 5:Ka(a,a.return),Gi(a);break;case 22:a.memoizedState===null&&Gi(a);break;case 30:Gi(a);break;default:Gi(a)}t=t.sibling}}function br(t,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,h=t,p=a,C=p.flags;switch(p.tag){case 0:case 11:case 15:br(h,p,s),fl(4,p);break;case 1:if(br(h,p,s),c=p,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(Y){_t(c,c.return,Y)}if(c=p,h=c.updateQueue,h!==null){var R=c.stateNode;try{var U=h.shared.hiddenCallbacks;if(U!==null)for(h.shared.hiddenCallbacks=null,h=0;h<U.length;h++)Qy(U[h],R)}catch(Y){_t(c,c.return,Y)}}s&&C&64&&cv(p),hl(p,p.return);break;case 27:hv(p);case 26:case 5:br(h,p,s),s&&c===null&&C&4&&dv(p),hl(p,p.return);break;case 12:br(h,p,s);break;case 31:br(h,p,s),s&&C&4&&bv(h,p);break;case 13:br(h,p,s),s&&C&4&&vv(h,p);break;case 22:p.memoizedState===null&&br(h,p,s),hl(p,p.return);break;case 30:break;default:br(h,p,s)}a=a.sibling}}function Zh(t,a){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Zo(s))}function eg(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Zo(t))}function La(t,a,s,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Cv(t,a,s,c),a=a.sibling}function Cv(t,a,s,c){var h=a.flags;switch(a.tag){case 0:case 11:case 15:La(t,a,s,c),h&2048&&fl(9,a);break;case 1:La(t,a,s,c);break;case 3:La(t,a,s,c),h&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Zo(t)));break;case 12:if(h&2048){La(t,a,s,c),t=a.stateNode;try{var p=a.memoizedProps,C=p.id,R=p.onPostCommit;typeof R=="function"&&R(C,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){_t(a,a.return,U)}}else La(t,a,s,c);break;case 31:La(t,a,s,c);break;case 13:La(t,a,s,c);break;case 23:break;case 22:p=a.stateNode,C=a.alternate,a.memoizedState!==null?p._visibility&2?La(t,a,s,c):gl(t,a):p._visibility&2?La(t,a,s,c):(p._visibility|=2,Hs(t,a,s,c,(a.subtreeFlags&10256)!==0||!1)),h&2048&&Zh(C,a);break;case 24:La(t,a,s,c),h&2048&&eg(a.alternate,a);break;default:La(t,a,s,c)}}function Hs(t,a,s,c,h){for(h=h&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var p=t,C=a,R=s,U=c,Y=C.flags;switch(C.tag){case 0:case 11:case 15:Hs(p,C,R,U,h),fl(8,C);break;case 23:break;case 22:var ne=C.stateNode;C.memoizedState!==null?ne._visibility&2?Hs(p,C,R,U,h):gl(p,C):(ne._visibility|=2,Hs(p,C,R,U,h)),h&&Y&2048&&Zh(C.alternate,C);break;case 24:Hs(p,C,R,U,h),h&&Y&2048&&eg(C.alternate,C);break;default:Hs(p,C,R,U,h)}a=a.sibling}}function gl(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=t,c=a,h=c.flags;switch(c.tag){case 22:gl(s,c),h&2048&&Zh(c.alternate,c);break;case 24:gl(s,c),h&2048&&eg(c.alternate,c);break;default:gl(s,c)}a=a.sibling}}var pl=8192;function zs(t,a,s){if(t.subtreeFlags&pl)for(t=t.child;t!==null;)Ev(t,a,s),t=t.sibling}function Ev(t,a,s){switch(t.tag){case 26:zs(t,a,s),t.flags&pl&&t.memoizedState!==null&&aT(s,Oa,t.memoizedState,t.memoizedProps);break;case 5:zs(t,a,s);break;case 3:case 4:var c=Oa;Oa=Iu(t.stateNode.containerInfo),zs(t,a,s),Oa=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=pl,pl=16777216,zs(t,a,s),pl=c):zs(t,a,s));break;default:zs(t,a,s)}}function _v(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function ml(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];gn=c,xv(c,t)}_v(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Av(t),t=t.sibling}function Av(t){switch(t.tag){case 0:case 11:case 15:ml(t),t.flags&2048&&Xr(9,t,t.return);break;case 3:ml(t);break;case 12:ml(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,Eu(t)):ml(t);break;default:ml(t)}}function Eu(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];gn=c,xv(c,t)}_v(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Xr(8,a,a.return),Eu(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,Eu(a));break;default:Eu(a)}t=t.sibling}}function xv(t,a){for(;gn!==null;){var s=gn;switch(s.tag){case 0:case 11:case 15:Xr(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Zo(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,gn=c;else e:for(s=t;gn!==null;){c=gn;var h=c.sibling,p=c.return;if(mv(c),c===s){gn=null;break e}if(h!==null){h.return=p,gn=h;break e}gn=p}}}var bx={getCacheForType:function(t){var a=bn(en),s=a.data.get(t);return s===void 0&&(s=t(),a.data.set(t,s)),s},cacheSignal:function(){return bn(en).controller.signal}},vx=typeof WeakMap=="function"?WeakMap:Map,St=0,Dt=null,nt=null,rt=0,Et=0,Jn=null,Jr=!1,js=!1,tg=!1,vr=0,Vt=0,Qr=0,Vi=0,ng=0,Qn=0,Us=0,yl=null,Bn=null,ag=!1,_u=0,Tv=0,Au=1/0,xu=null,Zr=null,un=0,ei=null,Bs=null,Sr=0,rg=0,ig=null,Rv=null,bl=0,sg=null;function Zn(){return(St&2)!==0&&rt!==0?rt&-rt:Q.T!==null?fg():Kt()}function kv(){if(Qn===0)if((rt&536870912)===0||ct){var t=me;me<<=1,(me&3932160)===0&&(me=262144),Qn=t}else Qn=536870912;return t=Yn.current,t!==null&&(t.flags|=32),Qn}function Pn(t,a,s){(t===Dt&&(Et===2||Et===9)||t.cancelPendingCommit!==null)&&(Ps(t,0),ti(t,rt,Qn,!1)),Ke(t,s),((St&2)===0||t!==Dt)&&(t===Dt&&((St&2)===0&&(Vi|=s),Vt===4&&ti(t,rt,Qn,!1)),Wa(t))}function Dv(t,a,s){if((St&6)!==0)throw Error(r(327));var c=!s&&(a&127)===0&&(a&t.expiredLanes)===0||ze(t,a),h=c?Cx(t,a):lg(t,a,!0),p=c;do{if(h===0){js&&!c&&ti(t,a,0,!1);break}else{if(s=t.current.alternate,p&&!Sx(s)){h=lg(t,a,!1),p=!1;continue}if(h===2){if(p=a,t.errorRecoveryDisabledLanes&p)var C=0;else C=t.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){a=C;e:{var R=t;h=yl;var U=R.current.memoizedState.isDehydrated;if(U&&(Ps(R,C).flags|=256),C=lg(R,C,!1),C!==2){if(tg&&!U){R.errorRecoveryDisabledLanes|=p,Vi|=p,h=4;break e}p=Bn,Bn=h,p!==null&&(Bn===null?Bn=p:Bn.push.apply(Bn,p))}h=C}if(p=!1,h!==2)continue}}if(h===1){Ps(t,0),ti(t,a,0,!0);break}e:{switch(c=t,p=h,p){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:ti(c,a,Qn,!Jr);break e;case 2:Bn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(h=_u+300-Jt(),10<h)){if(ti(c,a,Qn,!Jr),je(c,0,!0)!==0)break e;Sr=a,c.timeoutHandle=oS(Ov.bind(null,c,s,Bn,xu,ag,a,Qn,Vi,Us,Jr,p,"Throttled",-0,0),h);break e}Ov(c,s,Bn,xu,ag,a,Qn,Vi,Us,Jr,p,null,-0,0)}}break}while(!0);Wa(t)}function Ov(t,a,s,c,h,p,C,R,U,Y,ne,ce,J,ee){if(t.timeoutHandle=-1,ce=a.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xa},Ev(a,p,ce);var Le=(p&62914560)===p?_u-Jt():(p&4194048)===p?Tv-Jt():0;if(Le=rT(ce,Le),Le!==null){Sr=p,t.cancelPendingCommit=Le(jv.bind(null,t,a,p,s,c,h,C,R,U,ne,ce,null,J,ee)),ti(t,p,C,!Y);return}}jv(t,a,p,s,c,h,C,R,U)}function Sx(t){for(var a=t;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var h=s[c],p=h.getSnapshot;h=h.value;try{if(!Kn(p(),h))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function ti(t,a,s,c){a&=~ng,a&=~Vi,t.suspendedLanes|=a,t.pingedLanes&=~a,c&&(t.warmLanes|=a),c=t.expirationTimes;for(var h=a;0<h;){var p=31-q(h),C=1<<p;c[p]=-1,h&=~C}s!==0&&Re(t,s,a)}function Tu(){return(St&6)===0?(vl(0),!1):!0}function og(){if(nt!==null){if(Et===0)var t=nt.return;else t=nt,cr=Ii=null,Eh(t),Ls=null,tl=0,t=nt;for(;t!==null;)lv(t.alternate,t),t=t.return;nt=null}}function Ps(t,a){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,Ux(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Sr=0,og(),Dt=t,nt=s=or(t.current,null),rt=a,Et=0,Jn=null,Jr=!1,js=ze(t,a),tg=!1,Us=Qn=ng=Vi=Qr=Vt=0,Bn=yl=null,ag=!1,(a&8)!==0&&(a|=a&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=a;0<c;){var h=31-q(c),p=1<<h;a|=t[h],c&=~p}return vr=a,Wc(),s}function Lv(t,a){Qe=null,Q.H=cl,a===Os||a===nu?(a=Wy(),Et=3):a===dh?(a=Wy(),Et=4):Et=a===jh?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Jn=a,nt===null&&(Vt=1,mu(t,ia(a,t.current)))}function Mv(){var t=Yn.current;return t===null?!0:(rt&4194048)===rt?ca===null:(rt&62914560)===rt||(rt&536870912)!==0?t===ca:!1}function $v(){var t=Q.H;return Q.H=cl,t===null?cl:t}function Nv(){var t=Q.A;return Q.A=bx,t}function Ru(){Vt=4,Jr||(rt&4194048)!==rt&&Yn.current!==null||(js=!0),(Qr&134217727)===0&&(Vi&134217727)===0||Dt===null||ti(Dt,rt,Qn,!1)}function lg(t,a,s){var c=St;St|=2;var h=$v(),p=Nv();(Dt!==t||rt!==a)&&(xu=null,Ps(t,a)),a=!1;var C=Vt;e:do try{if(Et!==0&&nt!==null){var R=nt,U=Jn;switch(Et){case 8:og(),C=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(a=!0);var Y=Et;if(Et=0,Jn=null,qs(t,R,U,Y),s&&js){C=0;break e}break;default:Y=Et,Et=0,Jn=null,qs(t,R,U,Y)}}wx(),C=Vt;break}catch(ne){Lv(t,ne)}while(!0);return a&&t.shellSuspendCounter++,cr=Ii=null,St=c,Q.H=h,Q.A=p,nt===null&&(Dt=null,rt=0,Wc()),C}function wx(){for(;nt!==null;)Iv(nt)}function Cx(t,a){var s=St;St|=2;var c=$v(),h=Nv();Dt!==t||rt!==a?(xu=null,Au=Jt()+500,Ps(t,a)):js=ze(t,a);e:do try{if(Et!==0&&nt!==null){a=nt;var p=Jn;t:switch(Et){case 1:Et=0,Jn=null,qs(t,a,p,1);break;case 2:case 9:if(Fy(p)){Et=0,Jn=null,Hv(a);break}a=function(){Et!==2&&Et!==9||Dt!==t||(Et=7),Wa(t)},p.then(a,a);break e;case 3:Et=7;break e;case 4:Et=5;break e;case 7:Fy(p)?(Et=0,Jn=null,Hv(a)):(Et=0,Jn=null,qs(t,a,p,7));break;case 5:var C=null;switch(nt.tag){case 26:C=nt.memoizedState;case 5:case 27:var R=nt;if(C?CS(C):R.stateNode.complete){Et=0,Jn=null;var U=R.sibling;if(U!==null)nt=U;else{var Y=R.return;Y!==null?(nt=Y,ku(Y)):nt=null}break t}}Et=0,Jn=null,qs(t,a,p,5);break;case 6:Et=0,Jn=null,qs(t,a,p,6);break;case 8:og(),Vt=6;break e;default:throw Error(r(462))}}Ex();break}catch(ne){Lv(t,ne)}while(!0);return cr=Ii=null,Q.H=c,Q.A=h,St=s,nt!==null?0:(Dt=null,rt=0,Wc(),Vt)}function Ex(){for(;nt!==null&&!hn();)Iv(nt)}function Iv(t){var a=sv(t.alternate,t,vr);t.memoizedProps=t.pendingProps,a===null?ku(t):nt=a}function Hv(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=ev(s,a,a.pendingProps,a.type,void 0,rt);break;case 11:a=ev(s,a,a.pendingProps,a.type.render,a.ref,rt);break;case 5:Eh(a);default:lv(s,a),a=nt=Ny(a,vr),a=sv(s,a,vr)}t.memoizedProps=t.pendingProps,a===null?ku(t):nt=a}function qs(t,a,s,c){cr=Ii=null,Eh(a),Ls=null,tl=0;var h=a.return;try{if(dx(t,h,a,s,rt)){Vt=1,mu(t,ia(s,t.current)),nt=null;return}}catch(p){if(h!==null)throw nt=h,p;Vt=1,mu(t,ia(s,t.current)),nt=null;return}a.flags&32768?(ct||c===1?t=!0:js||(rt&536870912)!==0?t=!1:(Jr=t=!0,(c===2||c===9||c===3||c===6)&&(c=Yn.current,c!==null&&c.tag===13&&(c.flags|=16384))),zv(a,t)):ku(a)}function ku(t){var a=t;do{if((a.flags&32768)!==0){zv(a,Jr);return}t=a.return;var s=gx(a.alternate,a,vr);if(s!==null){nt=s;return}if(a=a.sibling,a!==null){nt=a;return}nt=a=t}while(a!==null);Vt===0&&(Vt=5)}function zv(t,a){do{var s=px(t.alternate,t);if(s!==null){s.flags&=32767,nt=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){nt=t;return}nt=t=s}while(t!==null);Vt=6,nt=null}function jv(t,a,s,c,h,p,C,R,U){t.cancelPendingCommit=null;do Du();while(un!==0);if((St&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(p=a.lanes|a.childLanes,p|=Xf,Ae(t,s,p,C,R,U),t===Dt&&(nt=Dt=null,rt=0),Bs=a,ei=t,Sr=s,rg=p,ig=h,Rv=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Tx(sn,function(){return Gv(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=Q.T,Q.T=null,h=fe.p,fe.p=2,C=St,St|=4;try{mx(t,a,s)}finally{St=C,fe.p=h,Q.T=c}}un=1,Uv(),Bv(),Pv()}}function Uv(){if(un===1){un=0;var t=ei,a=Bs,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=Q.T,Q.T=null;var c=fe.p;fe.p=2;var h=St;St|=4;try{Sv(a,t);var p=Sg,C=xy(t.containerInfo),R=p.focusedElem,U=p.selectionRange;if(C!==R&&R&&R.ownerDocument&&Ay(R.ownerDocument.documentElement,R)){if(U!==null&&Vf(R)){var Y=U.start,ne=U.end;if(ne===void 0&&(ne=Y),"selectionStart"in R)R.selectionStart=Y,R.selectionEnd=Math.min(ne,R.value.length);else{var ce=R.ownerDocument||document,J=ce&&ce.defaultView||window;if(J.getSelection){var ee=J.getSelection(),Le=R.textContent.length,Ve=Math.min(U.start,Le),Rt=U.end===void 0?Ve:Math.min(U.end,Le);!ee.extend&&Ve>Rt&&(C=Rt,Rt=Ve,Ve=C);var F=_y(R,Ve),G=_y(R,Rt);if(F&&G&&(ee.rangeCount!==1||ee.anchorNode!==F.node||ee.anchorOffset!==F.offset||ee.focusNode!==G.node||ee.focusOffset!==G.offset)){var W=ce.createRange();W.setStart(F.node,F.offset),ee.removeAllRanges(),Ve>Rt?(ee.addRange(W),ee.extend(G.node,G.offset)):(W.setEnd(G.node,G.offset),ee.addRange(W))}}}}for(ce=[],ee=R;ee=ee.parentNode;)ee.nodeType===1&&ce.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ce.length;R++){var se=ce[R];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Pu=!!vg,Sg=vg=null}finally{St=h,fe.p=c,Q.T=s}}t.current=a,un=2}}function Bv(){if(un===2){un=0;var t=ei,a=Bs,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=Q.T,Q.T=null;var c=fe.p;fe.p=2;var h=St;St|=4;try{pv(t,a.alternate,a)}finally{St=h,fe.p=c,Q.T=s}}un=3}}function Pv(){if(un===4||un===3){un=0,Ba();var t=ei,a=Bs,s=Sr,c=Rv;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?un=5:(un=0,Bs=ei=null,qv(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(Zr=null),Qt(s),a=a.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(_a,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=Q.T,h=fe.p,fe.p=2,Q.T=null;try{for(var p=t.onRecoverableError,C=0;C<c.length;C++){var R=c[C];p(R.value,{componentStack:R.stack})}}finally{Q.T=a,fe.p=h}}(Sr&3)!==0&&Du(),Wa(t),h=t.pendingLanes,(s&261930)!==0&&(h&42)!==0?t===sg?bl++:(bl=0,sg=t):bl=0,vl(0)}}function qv(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Zo(a)))}function Du(){return Uv(),Bv(),Pv(),Gv()}function Gv(){if(un!==5)return!1;var t=ei,a=rg;rg=0;var s=Qt(Sr),c=Q.T,h=fe.p;try{fe.p=32>s?32:s,Q.T=null,s=ig,ig=null;var p=ei,C=Sr;if(un=0,Bs=ei=null,Sr=0,(St&6)!==0)throw Error(r(331));var R=St;if(St|=4,Av(p.current),Cv(p,p.current,C,s),St=R,vl(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(_a,p)}catch{}return!0}finally{fe.p=h,Q.T=c,qv(t,a)}}function Vv(t,a,s){a=ia(s,a),a=zh(t.stateNode,a,2),t=Kr(t,a,2),t!==null&&(Ke(t,2),Wa(t))}function _t(t,a,s){if(t.tag===3)Vv(t,t,s);else for(;a!==null;){if(a.tag===3){Vv(a,t,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Zr===null||!Zr.has(c))){t=ia(s,t),s=Fb(2),c=Kr(a,s,2),c!==null&&(Kb(s,c,a,t),Ke(c,2),Wa(c));break}}a=a.return}}function cg(t,a,s){var c=t.pingCache;if(c===null){c=t.pingCache=new vx;var h=new Set;c.set(a,h)}else h=c.get(a),h===void 0&&(h=new Set,c.set(a,h));h.has(s)||(tg=!0,h.add(s),t=_x.bind(null,t,a,s),a.then(t,t))}function _x(t,a,s){var c=t.pingCache;c!==null&&c.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Dt===t&&(rt&s)===s&&(Vt===4||Vt===3&&(rt&62914560)===rt&&300>Jt()-_u?(St&2)===0&&Ps(t,0):ng|=s,Us===rt&&(Us=0)),Wa(t)}function Fv(t,a){a===0&&(a=De()),t=Mi(t,a),t!==null&&(Ke(t,a),Wa(t))}function Ax(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),Fv(t,s)}function xx(t,a){var s=0;switch(t.tag){case 31:case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(a),Fv(t,s)}function Tx(t,a){return Lt(t,a)}var Ou=null,Gs=null,ug=!1,Lu=!1,dg=!1,ni=0;function Wa(t){t!==Gs&&t.next===null&&(Gs===null?Ou=Gs=t:Gs=Gs.next=t),Lu=!0,ug||(ug=!0,kx())}function vl(t,a){if(!dg&&Lu){dg=!0;do for(var s=!1,c=Ou;c!==null;){if(t!==0){var h=c.pendingLanes;if(h===0)var p=0;else{var C=c.suspendedLanes,R=c.pingedLanes;p=(1<<31-q(42|t)+1)-1,p&=h&~(C&~R),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,Xv(c,p))}else p=rt,p=je(c,c===Dt?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(p&3)===0||ze(c,p)||(s=!0,Xv(c,p));c=c.next}while(s);dg=!1}}function Rx(){Kv()}function Kv(){Lu=ug=!1;var t=0;ni!==0&&jx()&&(t=ni);for(var a=Jt(),s=null,c=Ou;c!==null;){var h=c.next,p=Wv(c,a);p===0?(c.next=null,s===null?Ou=h:s.next=h,h===null&&(Gs=s)):(s=c,(t!==0||(p&3)!==0)&&(Lu=!0)),c=h}un!==0&&un!==5||vl(t),ni!==0&&(ni=0)}function Wv(t,a){for(var s=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var C=31-q(p),R=1<<C,U=h[C];U===-1?((R&s)===0||(R&c)!==0)&&(h[C]=$e(R,a)):U<=a&&(t.expiredLanes|=R),p&=~R}if(a=Dt,s=rt,s=je(t,t===a?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,s===0||t===a&&(Et===2||Et===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&_n(c),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||ze(t,s)){if(a=s&-s,a===t.callbackPriority)return a;switch(c!==null&&_n(c),Qt(s)){case 2:case 8:s=An;break;case 32:s=sn;break;case 268435456:s=na;break;default:s=sn}return c=Yv.bind(null,t),s=Lt(s,c),t.callbackPriority=a,t.callbackNode=s,a}return c!==null&&c!==null&&_n(c),t.callbackPriority=2,t.callbackNode=null,2}function Yv(t,a){if(un!==0&&un!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Du()&&t.callbackNode!==s)return null;var c=rt;return c=je(t,t===Dt?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Dv(t,c,a),Wv(t,Jt()),t.callbackNode!=null&&t.callbackNode===s?Yv.bind(null,t):null)}function Xv(t,a){if(Du())return null;Dv(t,a,!0)}function kx(){Bx(function(){(St&6)!==0?Lt(tr,Rx):Kv()})}function fg(){if(ni===0){var t=ks;t===0&&(t=be,be<<=1,(be&261888)===0&&(be=256)),ni=t}return ni}function Jv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:aa(""+t)}function Qv(t,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,t.id&&s.setAttribute("form",t.id),a.parentNode.insertBefore(s,a),t=new FormData(t),s.parentNode.removeChild(s),t}function Dx(t,a,s,c,h){if(a==="submit"&&s&&s.stateNode===h){var p=Jv((h[xn]||null).action),C=c.submitter;C&&(a=(a=C[xn]||null)?Jv(a.formAction):C.getAttribute("formAction"),a!==null&&(p=a,C=null));var R=new sr("action","action",null,c,h);t.push({event:R,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ni!==0){var U=C?Qv(h,C):new FormData(h);Lh(s,{pending:!0,data:U,method:h.method,action:p},null,U)}}else typeof p=="function"&&(R.preventDefault(),U=C?Qv(h,C):new FormData(h),Lh(s,{pending:!0,data:U,method:h.method,action:p},p,U))},currentTarget:h}]})}}for(var hg=0;hg<Yf.length;hg++){var gg=Yf[hg],Ox=gg.toLowerCase(),Lx=gg[0].toUpperCase()+gg.slice(1);Da(Ox,"on"+Lx)}Da(ky,"onAnimationEnd"),Da(Dy,"onAnimationIteration"),Da(Oy,"onAnimationStart"),Da("dblclick","onDoubleClick"),Da("focusin","onFocus"),Da("focusout","onBlur"),Da(WA,"onTransitionRun"),Da(YA,"onTransitionStart"),Da(XA,"onTransitionCancel"),Da(Ly,"onTransitionEnd"),$r("onMouseEnter",["mouseout","mouseover"]),$r("onMouseLeave",["mouseout","mouseover"]),$r("onPointerEnter",["pointerout","pointerover"]),$r("onPointerLeave",["pointerout","pointerover"]),Aa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Aa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Aa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Aa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Aa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Aa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sl="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(" "),Mx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sl));function Zv(t,a){a=(a&4)!==0;for(var s=0;s<t.length;s++){var c=t[s],h=c.event;c=c.listeners;e:{var p=void 0;if(a)for(var C=c.length-1;0<=C;C--){var R=c[C],U=R.instance,Y=R.currentTarget;if(R=R.listener,U!==p&&h.isPropagationStopped())break e;p=R,h.currentTarget=Y;try{p(h)}catch(ne){Kc(ne)}h.currentTarget=null,p=U}else for(C=0;C<c.length;C++){if(R=c[C],U=R.instance,Y=R.currentTarget,R=R.listener,U!==p&&h.isPropagationStopped())break e;p=R,h.currentTarget=Y;try{p(h)}catch(ne){Kc(ne)}h.currentTarget=null,p=U}}}}function at(t,a){var s=a[Lo];s===void 0&&(s=a[Lo]=new Set);var c=t+"__bubble";s.has(c)||(eS(a,t,2,!1),s.add(c))}function pg(t,a,s){var c=0;a&&(c|=4),eS(s,t,c,a)}var Mu="_reactListening"+Math.random().toString(36).slice(2);function mg(t){if(!t[Mu]){t[Mu]=!0,_c.forEach(function(s){s!=="selectionchange"&&(Mx.has(s)||pg(s,!1,t),pg(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[Mu]||(a[Mu]=!0,pg("selectionchange",!1,a))}}function eS(t,a,s,c){switch(kS(a)){case 2:var h=oT;break;case 8:h=lT;break;default:h=Og}s=h.bind(null,a,s,t),h=void 0,!jo||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(h=!0),c?h!==void 0?t.addEventListener(a,s,{capture:!0,passive:h}):t.addEventListener(a,s,!0):h!==void 0?t.addEventListener(a,s,{passive:h}):t.addEventListener(a,s,!1)}function yg(t,a,s,c,h){var p=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var C=c.tag;if(C===3||C===4){var R=c.stateNode.containerInfo;if(R===h)break;if(C===4)for(C=c.return;C!==null;){var U=C.tag;if((U===3||U===4)&&C.stateNode.containerInfo===h)return;C=C.return}for(;R!==null;){if(C=Lr(R),C===null)return;if(U=C.tag,U===5||U===6||U===26||U===27){c=p=C;continue e}R=R.parentNode}}c=c.return}$c(function(){var Y=p,ne=zo(s),ce=[];e:{var J=My.get(t);if(J!==void 0){var ee=sr,Le=t;switch(t){case"keypress":if(_i(s)===0)break e;case"keydown":case"keyup":ee=Nf;break;case"focusin":Le="focus",ee=qo;break;case"focusout":Le="blur",ee=qo;break;case"beforeblur":case"afterblur":ee=qo;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":ee=Hc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=wy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=zf;break;case ky:case Dy:case Oy:ee=Rf;break;case Ly:ee=Ss;break;case"scroll":case"scrollend":ee=Af;break;case"wheel":ee=E;break;case"copy":case"cut":case"paste":ee=zc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Bc;break;case"toggle":case"beforetoggle":ee=w}var Ve=(a&4)!==0,Rt=!Ve&&(t==="scroll"||t==="scrollend"),F=Ve?J!==null?J+"Capture":null:J;Ve=[];for(var G=Y,W;G!==null;){var se=G;if(W=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||W===null||F===null||(se=Ci(G,F),se!=null&&Ve.push(wl(G,se,W))),Rt)break;G=G.return}0<Ve.length&&(J=new ee(J,Le,null,s,ne),ce.push({event:J,listeners:Ve}))}}if((a&7)===0){e:{if(J=t==="mouseover"||t==="pointerover",ee=t==="mouseout"||t==="pointerout",J&&s!==Ho&&(Le=s.relatedTarget||s.fromElement)&&(Lr(Le)||Le[Or]))break e;if((ee||J)&&(J=ne.window===ne?ne:(J=ne.ownerDocument)?J.defaultView||J.parentWindow:window,ee?(Le=s.relatedTarget||s.toElement,ee=Y,Le=Le?Lr(Le):null,Le!==null&&(Rt=l(Le),Ve=Le.tag,Le!==Rt||Ve!==5&&Ve!==27&&Ve!==6)&&(Le=null)):(ee=null,Le=Y),ee!==Le)){if(Ve=Hc,se="onMouseLeave",F="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(Ve=Bc,se="onPointerLeave",F="onPointerEnter",G="pointer"),Rt=ee==null?J:ar(ee),W=Le==null?J:ar(Le),J=new Ve(se,G+"leave",ee,s,ne),J.target=Rt,J.relatedTarget=W,se=null,Lr(ne)===Y&&(Ve=new Ve(F,G+"enter",Le,s,ne),Ve.target=W,Ve.relatedTarget=Rt,se=Ve),Rt=se,ee&&Le)t:{for(Ve=$x,F=ee,G=Le,W=0,se=F;se;se=Ve(se))W++;se=0;for(var Ge=G;Ge;Ge=Ve(Ge))se++;for(;0<W-se;)F=Ve(F),W--;for(;0<se-W;)G=Ve(G),se--;for(;W--;){if(F===G||G!==null&&F===G.alternate){Ve=F;break t}F=Ve(F),G=Ve(G)}Ve=null}else Ve=null;ee!==null&&tS(ce,J,ee,Ve,!1),Le!==null&&Rt!==null&&tS(ce,Rt,Le,Ve,!0)}}e:{if(J=Y?ar(Y):window,ee=J.nodeName&&J.nodeName.toLowerCase(),ee==="select"||ee==="input"&&J.type==="file")var mt=Fo;else if(Vo(J))if(Ko)mt=VA;else{mt=Gf;var Ie=qf}else ee=J.nodeName,!ee||ee.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?Y&&No(Y.elementType)&&(mt=Fo):mt=Fc;if(mt&&(mt=mt(t,Y))){qc(ce,mt,s,ne);break e}Ie&&Ie(t,J,Y),t==="focusout"&&Y&&J.type==="number"&&Y.memoizedProps.value!=null&&rr(J,"number",J.value)}switch(Ie=Y?ar(Y):window,t){case"focusin":(Vo(Ie)||Ie.contentEditable==="true")&&(ws=Ie,Ff=Y,Xo=null);break;case"focusout":Xo=Ff=ws=null;break;case"mousedown":Kf=!0;break;case"contextmenu":case"mouseup":case"dragend":Kf=!1,Ty(ce,s,ne);break;case"selectionchange":if(KA)break;case"keydown":case"keyup":Ty(ce,s,ne)}var Ze;if(N)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else ka?pt(t,s)&&(it="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(it="onCompositionStart");it&&(Ne&&s.locale!=="ko"&&(ka||it!=="onCompositionStart"?it==="onCompositionEnd"&&ka&&(Ze=Nc()):(Ga=ne,Uo="value"in Ga?Ga.value:Ga.textContent,ka=!0)),Ie=$u(Y,it),0<Ie.length&&(it=new jc(it,t,null,s,ne),ce.push({event:it,listeners:Ie}),Ze?it.data=Ze:(Ze=jt(s),Ze!==null&&(it.data=Ze)))),(Ze=ye?Uf(t,s):Pc(t,s))&&(it=$u(Y,"onBeforeInput"),0<it.length&&(Ie=new jc("onBeforeInput","beforeinput",null,s,ne),ce.push({event:Ie,listeners:it}),Ie.data=Ze)),Dx(ce,t,Y,s,ne)}Zv(ce,a)})}function wl(t,a,s){return{instance:t,listener:a,currentTarget:s}}function $u(t,a){for(var s=a+"Capture",c=[];t!==null;){var h=t,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=Ci(t,s),h!=null&&c.unshift(wl(t,h,p)),h=Ci(t,a),h!=null&&c.push(wl(t,h,p))),t.tag===3)return c;t=t.return}return[]}function $x(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function tS(t,a,s,c,h){for(var p=a._reactName,C=[];s!==null&&s!==c;){var R=s,U=R.alternate,Y=R.stateNode;if(R=R.tag,U!==null&&U===c)break;R!==5&&R!==26&&R!==27||Y===null||(U=Y,h?(Y=Ci(s,p),Y!=null&&C.unshift(wl(s,Y,U))):h||(Y=Ci(s,p),Y!=null&&C.push(wl(s,Y,U)))),s=s.return}C.length!==0&&t.push({event:a,listeners:C})}var Nx=/\r\n?/g,Ix=/\u0000|\uFFFD/g;function nS(t){return(typeof t=="string"?t:""+t).replace(Nx,`
|
||
`).replace(Ix,"")}function aS(t,a){return a=nS(a),nS(t)===a}function Tt(t,a,s,c,h,p){switch(s){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||zr(t,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&zr(t,""+c);break;case"className":Si(t,"class",c);break;case"tabIndex":Si(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Si(t,s,c);break;case"style":Lc(t,c,p);break;case"data":if(a!=="object"){Si(t,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||s!=="href")){t.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=aa(""+c),t.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="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"?(a!=="input"&&Tt(t,a,"name",h.name,h,null),Tt(t,a,"formEncType",h.formEncType,h,null),Tt(t,a,"formMethod",h.formMethod,h,null),Tt(t,a,"formTarget",h.formTarget,h,null)):(Tt(t,a,"encType",h.encType,h,null),Tt(t,a,"method",h.method,h,null),Tt(t,a,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=aa(""+c),t.setAttribute(s,c);break;case"onClick":c!=null&&(t.onclick=xa);break;case"onScroll":c!=null&&at("scroll",t);break;case"onScrollEnd":c!=null&&at("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(s=c.__html,s!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}s=aa(""+c),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":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""+c):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":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":c===!0?t.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,c):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(s,c):t.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(s):t.setAttribute(s,c);break;case"popover":at("beforetoggle",t),at("toggle",t),In(t,"popover",c);break;case"xlinkActuate":mn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":mn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":mn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":mn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":mn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":mn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":mn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":mn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":mn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":In(t,"is",c);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,In(t,s,c))}}function bg(t,a,s,c,h,p){switch(s){case"style":Lc(t,c,p);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(s=c.__html,s!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"children":typeof c=="string"?zr(t,c):(typeof c=="number"||typeof c=="bigint")&&zr(t,""+c);break;case"onScroll":c!=null&&at("scroll",t);break;case"onScrollEnd":c!=null&&at("scrollend",t);break;case"onClick":c!=null&&(t.onclick=xa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ac.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(h=s.endsWith("Capture"),a=s.slice(2,h?s.length-7:void 0),p=t[xn]||null,p=p!=null?p[s]:null,typeof p=="function"&&t.removeEventListener(a,p,h),typeof c=="function")){typeof p!="function"&&p!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(a,c,h);break e}s in t?t[s]=c:c===!0?t.setAttribute(s,""):In(t,s,c)}}}function Sn(t,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",t),at("load",t);var c=!1,h=!1,p;for(p in s)if(s.hasOwnProperty(p)){var C=s[p];if(C!=null)switch(p){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Tt(t,a,p,C,s,null)}}h&&Tt(t,a,"srcSet",s.srcSet,s,null),c&&Tt(t,a,"src",s.src,s,null);return;case"input":at("invalid",t);var R=p=C=h=null,U=null,Y=null;for(c in s)if(s.hasOwnProperty(c)){var ne=s[c];if(ne!=null)switch(c){case"name":h=ne;break;case"type":C=ne;break;case"checked":U=ne;break;case"defaultChecked":Y=ne;break;case"value":p=ne;break;case"defaultValue":R=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,a));break;default:Tt(t,a,c,ne,s,null)}}wi(t,p,R,U,Y,C,h,!1);return;case"select":at("invalid",t),c=C=p=null;for(h in s)if(s.hasOwnProperty(h)&&(R=s[h],R!=null))switch(h){case"value":p=R;break;case"defaultValue":C=R;break;case"multiple":c=R;default:Tt(t,a,h,R,s,null)}a=p,s=C,t.multiple=!!c,a!=null?Ir(t,!!c,a,!1):s!=null&&Ir(t,!!c,s,!0);return;case"textarea":at("invalid",t),p=h=c=null;for(C in s)if(s.hasOwnProperty(C)&&(R=s[C],R!=null))switch(C){case"value":c=R;break;case"defaultValue":h=R;break;case"children":p=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(91));break;default:Tt(t,a,C,R,s,null)}Dc(t,c,h,p);return;case"option":for(U in s)s.hasOwnProperty(U)&&(c=s[U],c!=null)&&(U==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":Tt(t,a,U,c,s,null));return;case"dialog":at("beforetoggle",t),at("toggle",t),at("cancel",t),at("close",t);break;case"iframe":case"object":at("load",t);break;case"video":case"audio":for(c=0;c<Sl.length;c++)at(Sl[c],t);break;case"image":at("error",t),at("load",t);break;case"details":at("toggle",t);break;case"embed":case"source":case"link":at("error",t),at("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)&&(c=s[Y],c!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Tt(t,a,Y,c,s,null)}return;default:if(No(a)){for(ne in s)s.hasOwnProperty(ne)&&(c=s[ne],c!==void 0&&bg(t,a,ne,c,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(c=s[R],c!=null&&Tt(t,a,R,c,s,null))}function Hx(t,a,s,c){switch(a){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,R=null,U=null,Y=null,ne=null;for(ee in s){var ce=s[ee];if(s.hasOwnProperty(ee)&&ce!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":U=ce;default:c.hasOwnProperty(ee)||Tt(t,a,ee,null,c,ce)}}for(var J in c){var ee=c[J];if(ce=s[J],c.hasOwnProperty(J)&&(ee!=null||ce!=null))switch(J){case"type":p=ee;break;case"name":h=ee;break;case"checked":Y=ee;break;case"defaultChecked":ne=ee;break;case"value":C=ee;break;case"defaultValue":R=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,a));break;default:ee!==ce&&Tt(t,a,J,ee,c,ce)}}ps(t,C,R,U,Y,ne,p,h);return;case"select":ee=C=R=J=null;for(p in s)if(U=s[p],s.hasOwnProperty(p)&&U!=null)switch(p){case"value":break;case"multiple":ee=U;default:c.hasOwnProperty(p)||Tt(t,a,p,null,c,U)}for(h in c)if(p=c[h],U=s[h],c.hasOwnProperty(h)&&(p!=null||U!=null))switch(h){case"value":J=p;break;case"defaultValue":R=p;break;case"multiple":C=p;default:p!==U&&Tt(t,a,h,p,c,U)}a=R,s=C,c=ee,J!=null?Ir(t,!!s,J,!1):!!c!=!!s&&(a!=null?Ir(t,!!s,a,!0):Ir(t,!!s,s?[]:"",!1));return;case"textarea":ee=J=null;for(R in s)if(h=s[R],s.hasOwnProperty(R)&&h!=null&&!c.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Tt(t,a,R,null,c,h)}for(C in c)if(h=c[C],p=s[C],c.hasOwnProperty(C)&&(h!=null||p!=null))switch(C){case"value":J=h;break;case"defaultValue":ee=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(r(91));break;default:h!==p&&Tt(t,a,C,h,c,p)}Hr(t,J,ee);return;case"option":for(var Le in s)J=s[Le],s.hasOwnProperty(Le)&&J!=null&&!c.hasOwnProperty(Le)&&(Le==="selected"?t.selected=!1:Tt(t,a,Le,null,c,J));for(U in c)J=c[U],ee=s[U],c.hasOwnProperty(U)&&J!==ee&&(J!=null||ee!=null)&&(U==="selected"?t.selected=J&&typeof J!="function"&&typeof J!="symbol":Tt(t,a,U,J,c,ee));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 Ve in s)J=s[Ve],s.hasOwnProperty(Ve)&&J!=null&&!c.hasOwnProperty(Ve)&&Tt(t,a,Ve,null,c,J);for(Y in c)if(J=c[Y],ee=s[Y],c.hasOwnProperty(Y)&&J!==ee&&(J!=null||ee!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,a));break;default:Tt(t,a,Y,J,c,ee)}return;default:if(No(a)){for(var Rt in s)J=s[Rt],s.hasOwnProperty(Rt)&&J!==void 0&&!c.hasOwnProperty(Rt)&&bg(t,a,Rt,void 0,c,J);for(ne in c)J=c[ne],ee=s[ne],!c.hasOwnProperty(ne)||J===ee||J===void 0&&ee===void 0||bg(t,a,ne,J,c,ee);return}}for(var F in s)J=s[F],s.hasOwnProperty(F)&&J!=null&&!c.hasOwnProperty(F)&&Tt(t,a,F,null,c,J);for(ce in c)J=c[ce],ee=s[ce],!c.hasOwnProperty(ce)||J===ee||J==null&&ee==null||Tt(t,a,ce,J,c,ee)}function rS(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var h=s[c],p=h.transferSize,C=h.initiatorType,R=h.duration;if(p&&R&&rS(C)){for(C=0,R=h.responseEnd,c+=1;c<s.length;c++){var U=s[c],Y=U.startTime;if(Y>R)break;var ne=U.transferSize,ce=U.initiatorType;ne&&rS(ce)&&(U=U.responseEnd,C+=ne*(U<R?1:(R-Y)/(U-Y)))}if(--c,a+=8*(p+C)/(h.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var vg=null,Sg=null;function Nu(t){return t.nodeType===9?t:t.ownerDocument}function iS(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 sS(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function wg(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Cg=null;function jx(){var t=window.event;return t&&t.type==="popstate"?t===Cg?!1:(Cg=t,!0):(Cg=null,!1)}var oS=typeof setTimeout=="function"?setTimeout:void 0,Ux=typeof clearTimeout=="function"?clearTimeout:void 0,lS=typeof Promise=="function"?Promise:void 0,Bx=typeof queueMicrotask=="function"?queueMicrotask:typeof lS<"u"?function(t){return lS.resolve(null).then(t).catch(Px)}:oS;function Px(t){setTimeout(function(){throw t})}function ai(t){return t==="head"}function cS(t,a){var s=a,c=0;do{var h=s.nextSibling;if(t.removeChild(s),h&&h.nodeType===8)if(s=h.data,s==="/$"||s==="/&"){if(c===0){t.removeChild(h),Ws(a);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Cl(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Cl(s);for(var p=s.firstChild;p;){var C=p.nextSibling,R=p.nodeName;p[vi]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&p.rel.toLowerCase()==="stylesheet"||s.removeChild(p),p=C}}else s==="body"&&Cl(t.ownerDocument.body);s=h}while(s);Ws(a)}function uS(t,a){var s=t;t=0;do{var c=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=c}while(s)}function Eg(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Eg(s),Mo(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function qx(t,a,s,c){for(;t.nodeType===1;){var h=s;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[vi])switch(a){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(a==="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=ua(t.nextSibling),t===null)break}return null}function Gx(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=ua(t.nextSibling),t===null))return null;return t}function dS(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ua(t.nextSibling),t===null))return null;return t}function _g(t){return t.data==="$?"||t.data==="$~"}function Ag(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Vx(t,a){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||s.readyState!=="loading")a();else{var c=function(){a(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function ua(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var xg=null;function fS(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return ua(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function hS(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return t;a--}else s!=="/$"&&s!=="/&"||a++}t=t.previousSibling}return null}function gS(t,a,s){switch(a=Nu(s),t){case"html":if(t=a.documentElement,!t)throw Error(r(452));return t;case"head":if(t=a.head,!t)throw Error(r(453));return t;case"body":if(t=a.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Cl(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Mo(t)}var da=new Map,pS=new Set;function Iu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var wr=fe.d;fe.d={f:Fx,r:Kx,D:Wx,C:Yx,L:Xx,m:Jx,X:Zx,S:Qx,M:eT};function Fx(){var t=wr.f(),a=Tu();return t||a}function Kx(t){var a=qa(t);a!==null&&a.tag===5&&a.type==="form"?Lb(a):wr.r(t)}var Vs=typeof document>"u"?null:document;function mS(t,a,s){var c=Vs;if(c&&typeof a=="string"&&a){var h=Hn(a);h='link[rel="'+t+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),pS.has(h)||(pS.add(h),t={rel:t,crossOrigin:s,href:a},c.querySelector(h)===null&&(a=c.createElement("link"),Sn(a,"link",t),Zt(a),c.head.appendChild(a)))}}function Wx(t){wr.D(t),mS("dns-prefetch",t,null)}function Yx(t,a){wr.C(t,a),mS("preconnect",t,a)}function Xx(t,a,s){wr.L(t,a,s);var c=Vs;if(c&&t&&a){var h='link[rel="preload"][as="'+Hn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+Hn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+Hn(s.imageSizes)+'"]')):h+='[href="'+Hn(t)+'"]';var p=h;switch(a){case"style":p=Fs(t);break;case"script":p=Ks(t)}da.has(p)||(t=b({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),da.set(p,t),c.querySelector(h)!==null||a==="style"&&c.querySelector(El(p))||a==="script"&&c.querySelector(_l(p))||(a=c.createElement("link"),Sn(a,"link",t),Zt(a),c.head.appendChild(a)))}}function Jx(t,a){wr.m(t,a);var s=Vs;if(s&&t){var c=a&&typeof a.as=="string"?a.as:"script",h='link[rel="modulepreload"][as="'+Hn(c)+'"][href="'+Hn(t)+'"]',p=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Ks(t)}if(!da.has(p)&&(t=b({rel:"modulepreload",href:t},a),da.set(p,t),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(_l(p)))return}c=s.createElement("link"),Sn(c,"link",t),Zt(c),s.head.appendChild(c)}}}function Qx(t,a,s){wr.S(t,a,s);var c=Vs;if(c&&t){var h=Mr(c).hoistableStyles,p=Fs(t);a=a||"default";var C=h.get(p);if(!C){var R={loading:0,preload:null};if(C=c.querySelector(El(p)))R.loading=5;else{t=b({rel:"stylesheet",href:t,"data-precedence":a},s),(s=da.get(p))&&Tg(t,s);var U=C=c.createElement("link");Zt(U),Sn(U,"link",t),U._p=new Promise(function(Y,ne){U.onload=Y,U.onerror=ne}),U.addEventListener("load",function(){R.loading|=1}),U.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Hu(C,a,c)}C={type:"stylesheet",instance:C,count:1,state:R},h.set(p,C)}}}function Zx(t,a){wr.X(t,a);var s=Vs;if(s&&t){var c=Mr(s).hoistableScripts,h=Ks(t),p=c.get(h);p||(p=s.querySelector(_l(h)),p||(t=b({src:t,async:!0},a),(a=da.get(h))&&Rg(t,a),p=s.createElement("script"),Zt(p),Sn(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function eT(t,a){wr.M(t,a);var s=Vs;if(s&&t){var c=Mr(s).hoistableScripts,h=Ks(t),p=c.get(h);p||(p=s.querySelector(_l(h)),p||(t=b({src:t,async:!0,type:"module"},a),(a=da.get(h))&&Rg(t,a),p=s.createElement("script"),Zt(p),Sn(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function yS(t,a,s,c){var h=(h=de.current)?Iu(h):null;if(!h)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Fs(s.href),s=Mr(h).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Fs(s.href);var p=Mr(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(El(t)))&&!p._p&&(C.instance=p,C.state.loading=5),da.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},da.set(t,s),p||tT(h,t,s,C.state))),a&&c===null)throw Error(r(528,""));return C}if(a&&c!==null)throw Error(r(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ks(s),s=Mr(h).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Fs(t){return'href="'+Hn(t)+'"'}function El(t){return'link[rel="stylesheet"]['+t+"]"}function bS(t){return b({},t,{"data-precedence":t.precedence,precedence:null})}function tT(t,a,s,c){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=t.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),Sn(a,"link",s),Zt(a),t.head.appendChild(a))}function Ks(t){return'[src="'+Hn(t)+'"]'}function _l(t){return"script[async]"+t}function vS(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=t.querySelector('style[data-href~="'+Hn(s.href)+'"]');if(c)return a.instance=c,Zt(c),c;var h=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Zt(c),Sn(c,"style",h),Hu(c,s.precedence,t),a.instance=c;case"stylesheet":h=Fs(s.href);var p=t.querySelector(El(h));if(p)return a.state.loading|=4,a.instance=p,Zt(p),p;c=bS(s),(h=da.get(h))&&Tg(c,h),p=(t.ownerDocument||t).createElement("link"),Zt(p);var C=p;return C._p=new Promise(function(R,U){C.onload=R,C.onerror=U}),Sn(p,"link",c),a.state.loading|=4,Hu(p,s.precedence,t),a.instance=p;case"script":return p=Ks(s.src),(h=t.querySelector(_l(p)))?(a.instance=h,Zt(h),h):(c=s,(h=da.get(p))&&(c=b({},s),Rg(c,h)),t=t.ownerDocument||t,h=t.createElement("script"),Zt(h),Sn(h,"link",c),t.head.appendChild(h),a.instance=h);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Hu(c,s.precedence,t));return a.instance}function Hu(t,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,p=h,C=0;C<c.length;C++){var R=c[C];if(R.dataset.precedence===a)p=R;else if(p!==h)break}p?p.parentNode.insertBefore(t,p.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(t,a.firstChild))}function Tg(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function Rg(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var zu=null;function SS(t,a,s){if(zu===null){var c=new Map,h=zu=new Map;h.set(s,c)}else h=zu,c=h.get(s),c||(c=new Map,h.set(s,c));if(c.has(t))return c;for(c.set(t,null),s=s.getElementsByTagName(t),h=0;h<s.length;h++){var p=s[h];if(!(p[vi]||p[ln]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var C=p.getAttribute(a)||"";C=t+C;var R=c.get(C);R?R.push(p):c.set(C,[p])}}return c}function wS(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function nT(t,a,s){if(s===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function CS(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function aT(t,a,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=Fs(c.href),p=a.querySelector(El(h));if(p){a=p._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=ju.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=p,Zt(p);return}p=a.ownerDocument||a,c=bS(c),(h=da.get(h))&&Tg(c,h),p=p.createElement("link"),Zt(p);var C=p;C._p=new Promise(function(R,U){C.onload=R,C.onerror=U}),Sn(p,"link",c),s.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=ju.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var kg=0;function rT(t,a){return t.stylesheets&&t.count===0&&Bu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var c=setTimeout(function(){if(t.stylesheets&&Bu(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+a);0<t.imgBytes&&kg===0&&(kg=62500*zx());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Bu(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>kg?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function ju(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Uu=null;function Bu(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Uu=new Map,a.forEach(iT,t),Uu=null,ju.call(t))}function iT(t,a){if(!(a.state.loading&4)){var s=Uu.get(t);if(s)var c=s.get(null);else{s=new Map,Uu.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),c=C)}c&&s.set(null,c)}h=a.instance,C=h.getAttribute("data-precedence"),p=s.get(C)||c,p===c&&s.set(null,h),s.set(C,h),this.count++,c=ju.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),p?p.parentNode.insertBefore(h,p.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),a.state.loading|=4}}var Al={$$typeof:T,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function sT(t,a,s,c,h,p,C,R,U){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=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=c,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function ES(t,a,s,c,h,p,C,R,U,Y,ne,ce){return t=new sT(t,a,s,C,U,Y,ne,ce,R),a=1,p===!0&&(a|=24),p=Wn(3,null,null,a),t.current=p,p.stateNode=t,a=lh(),a.refCount++,t.pooledCache=a,a.refCount++,p.memoizedState={element:c,isDehydrated:s,cache:a},fh(p),t}function _S(t){return t?(t=_s,t):_s}function AS(t,a,s,c,h,p){h=_S(h),c.context===null?c.context=h:c.pendingContext=h,c=Fr(a),c.payload={element:s},p=p===void 0?null:p,p!==null&&(c.callback=p),s=Kr(t,c,a),s!==null&&(Pn(s,t,a),al(s,t,a))}function xS(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function Dg(t,a){xS(t,a),(t=t.alternate)&&xS(t,a)}function TS(t){if(t.tag===13||t.tag===31){var a=Mi(t,67108864);a!==null&&Pn(a,t,67108864),Dg(t,67108864)}}function RS(t){if(t.tag===13||t.tag===31){var a=Zn();a=At(a);var s=Mi(t,a);s!==null&&Pn(s,t,a),Dg(t,a)}}var Pu=!0;function oT(t,a,s,c){var h=Q.T;Q.T=null;var p=fe.p;try{fe.p=2,Og(t,a,s,c)}finally{fe.p=p,Q.T=h}}function lT(t,a,s,c){var h=Q.T;Q.T=null;var p=fe.p;try{fe.p=8,Og(t,a,s,c)}finally{fe.p=p,Q.T=h}}function Og(t,a,s,c){if(Pu){var h=Lg(c);if(h===null)yg(t,a,c,qu,s),DS(t,c);else if(uT(h,t,a,s,c))c.stopPropagation();else if(DS(t,c),a&4&&-1<cT.indexOf(t)){for(;h!==null;){var p=qa(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var C=xe(p.pendingLanes);if(C!==0){var R=p;for(R.pendingLanes|=2,R.entangledLanes|=2;C;){var U=1<<31-q(C);R.entanglements[1]|=U,C&=~U}Wa(p),(St&6)===0&&(Au=Jt()+500,vl(0))}}break;case 31:case 13:R=Mi(p,2),R!==null&&Pn(R,p,2),Tu(),Dg(p,2)}if(p=Lg(c),p===null&&yg(t,a,c,qu,s),p===h)break;h=p}h!==null&&c.stopPropagation()}else yg(t,a,c,null,s)}}function Lg(t){return t=zo(t),Mg(t)}var qu=null;function Mg(t){if(qu=null,t=Lr(t),t!==null){var a=l(t);if(a===null)t=null;else{var s=a.tag;if(s===13){if(t=u(a),t!==null)return t;t=null}else if(s===31){if(t=d(a),t!==null)return t;t=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return qu=t,null}function kS(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(Dr()){case tr:return 2;case An:return 8;case sn:case tt:return 32;case na:return 268435456;default:return 32}default:return 32}}var $g=!1,ri=null,ii=null,si=null,xl=new Map,Tl=new Map,oi=[],cT="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 DS(t,a){switch(t){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ii=null;break;case"mouseover":case"mouseout":si=null;break;case"pointerover":case"pointerout":xl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(a.pointerId)}}function Rl(t,a,s,c,h,p){return t===null||t.nativeEvent!==p?(t={blockedOn:a,domEventName:s,eventSystemFlags:c,nativeEvent:p,targetContainers:[h]},a!==null&&(a=qa(a),a!==null&&TS(a)),t):(t.eventSystemFlags|=c,a=t.targetContainers,h!==null&&a.indexOf(h)===-1&&a.push(h),t)}function uT(t,a,s,c,h){switch(a){case"focusin":return ri=Rl(ri,t,a,s,c,h),!0;case"dragenter":return ii=Rl(ii,t,a,s,c,h),!0;case"mouseover":return si=Rl(si,t,a,s,c,h),!0;case"pointerover":var p=h.pointerId;return xl.set(p,Rl(xl.get(p)||null,t,a,s,c,h)),!0;case"gotpointercapture":return p=h.pointerId,Tl.set(p,Rl(Tl.get(p)||null,t,a,s,c,h)),!0}return!1}function OS(t){var a=Lr(t.target);if(a!==null){var s=l(a);if(s!==null){if(a=s.tag,a===13){if(a=u(s),a!==null){t.blockedOn=a,Fn(t.priority,function(){RS(s)});return}}else if(a===31){if(a=d(s),a!==null){t.blockedOn=a,Fn(t.priority,function(){RS(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gu(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=Lg(t.nativeEvent);if(s===null){s=t.nativeEvent;var c=new s.constructor(s.type,s);Ho=c,s.target.dispatchEvent(c),Ho=null}else return a=qa(s),a!==null&&TS(a),t.blockedOn=s,!1;a.shift()}return!0}function LS(t,a,s){Gu(t)&&s.delete(a)}function dT(){$g=!1,ri!==null&&Gu(ri)&&(ri=null),ii!==null&&Gu(ii)&&(ii=null),si!==null&&Gu(si)&&(si=null),xl.forEach(LS),Tl.forEach(LS)}function Vu(t,a){t.blockedOn===a&&(t.blockedOn=null,$g||($g=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,dT)))}var Fu=null;function MS(t){Fu!==t&&(Fu=t,o.unstable_scheduleCallback(o.unstable_NormalPriority,function(){Fu===t&&(Fu=null);for(var a=0;a<t.length;a+=3){var s=t[a],c=t[a+1],h=t[a+2];if(typeof c!="function"){if(Mg(c||s)===null)continue;break}var p=qa(s);p!==null&&(t.splice(a,3),a-=3,Lh(p,{pending:!0,data:h,method:s.method,action:c},c,h))}}))}function Ws(t){function a(U){return Vu(U,t)}ri!==null&&Vu(ri,t),ii!==null&&Vu(ii,t),si!==null&&Vu(si,t),xl.forEach(a),Tl.forEach(a);for(var s=0;s<oi.length;s++){var c=oi[s];c.blockedOn===t&&(c.blockedOn=null)}for(;0<oi.length&&(s=oi[0],s.blockedOn===null);)OS(s),s.blockedOn===null&&oi.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var h=s[c],p=s[c+1],C=h[xn]||null;if(typeof p=="function")C||MS(s);else if(C){var R=null;if(p&&p.hasAttribute("formAction")){if(h=p,C=p[xn]||null)R=C.formAction;else if(Mg(h)!==null)continue}else R=C.action;typeof R=="function"?s[c+1]=R:(s.splice(c,3),c-=3),MS(s)}}}function $S(){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 a(){h!==null&&(h(),h=null),c||setTimeout(s,20)}function s(){if(!c&&!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 c=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),h!==null&&(h(),h=null)}}}function Ng(t){this._internalRoot=t}Ku.prototype.render=Ng.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var s=a.current,c=Zn();AS(s,c,t,a,null,null)},Ku.prototype.unmount=Ng.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;AS(t.current,2,null,t,null,null),Tu(),a[Or]=null}};function Ku(t){this._internalRoot=t}Ku.prototype.unstable_scheduleHydration=function(t){if(t){var a=Kt();t={blockedOn:null,target:t,priority:a};for(var s=0;s<oi.length&&a!==0&&a<oi[s].priority;s++);oi.splice(s,0,t),s===0&&OS(t)}};var NS=e.version;if(NS!=="19.2.8")throw Error(r(527,NS,"19.2.8"));fe.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=g(a),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var fT={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wu.isDisabled&&Wu.supportsFiber)try{_a=Wu.inject(fT),on=Wu}catch{}}return Ys.createRoot=function(t,a){if(!i(t))throw Error(r(299));var s=!1,c="",h=Pb,p=qb,C=Gb;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(p=a.onCaughtError),a.onRecoverableError!==void 0&&(C=a.onRecoverableError)),a=ES(t,1,!1,null,null,s,c,null,h,p,C,$S),t[Or]=a.current,mg(t),new Ng(a)},Ys.hydrateRoot=function(t,a,s){if(!i(t))throw Error(r(299));var c=!1,h="",p=Pb,C=qb,R=Gb,U=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!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&&(R=s.onRecoverableError),s.formState!==void 0&&(U=s.formState)),a=ES(t,1,!0,a,s??null,c,h,U,p,C,R,$S),a.context=_S(null),s=a.current,c=Zn(),c=At(c),h=Fr(c),h.callback=null,Kr(s,h,c),s=c,a.current.lanes=s,Ke(a,s),Wa(a),t[Or]=a.current,mg(t),new Ku(a)},Ys.version="19.2.8",Ys}var Gg;function qS(){if(Gg)return Ju.exports;Gg=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(),Ju.exports=PS(),Ju.exports}var td=qS();const nd=Xa(td),Xs=[],GS=50;let ad=!1;function Vg(){try{return window.G7Core?.devTools}catch{return}}function Fi(o,e,n){const r=Vg();if(ad&&r?.isEnabled?.()){r.trackLog?.(o,e,n);return}ad||(o==="error"||o==="warn")&&Xs.length<GS&&Xs.push({level:o,prefix:e,args:n,timestamp:Date.now()})}function rd(){ad=!0;const o=Vg();if(!o?.isEnabled?.()){Xs.length=0;return}for(const e of Xs)o.trackLog?.(e.level,e.prefix,e.args);Xs.length=0}const mi=class mi{constructor(){$(this,"debug");$(this,"prefix","[TemplateEngine]");this.debug=!1}static getInstance(){return mi.instance||(mi.instance=new mi),mi.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)}};$(mi,"instance");let Js=mi;function dt(o){const e=`[${o}]`,n=Js.getInstance();return{log:(...r)=>{n.isDebugEnabled()&&console.log(e,...r),Fi("log",o,r)},warn:(...r)=>{n.isDebugEnabled()&&console.warn(e,...r),Fi("warn",o,r)},error:(...r)=>{n.isDebugEnabled()&&console.error(e,...r),Fi("error",o,r)}}}Js.getInstance();const Ki=dt("networkResilience"),Fg=2,Kg=300,Wg=2e3,VS=15e3;function Yg(o){return o?.name==="AbortError"}function FS(o){return Yg(o)?!1:o instanceof TypeError}let kl=!1,Xg=!1;function id(){return kl}function KS(){typeof window>"u"||Xg||(Xg=!0,window.addEventListener("pagehide",()=>{kl=!0}),window.addEventListener("pageshow",o=>{o.persisted&&(kl=!1)}),window.addEventListener("beforeunload",()=>{kl=!0}))}function Jg(o,e,n){const r=Math.min(e*Math.pow(2,o),n),i=r*.25*(Math.random()*2-1);return Math.max(0,Math.round(r+i))}function Qg(o){return new Promise(e=>setTimeout(e,o))}async function Dl(o,e={}){const{retries:n=Fg,baseDelayMs:r=Kg,maxDelayMs:i=Wg,timeoutMs:l=VS,label:u=o,init:d}=e,f=n+1;let g;for(let m=0;m<f;m++){let b=!1,v;const S=l>0?new AbortController:null;try{const _={...d};if(S){const k=d?.signal;k&&(k.aborted?S.abort():k.addEventListener("abort",()=>S.abort(),{once:!0})),_.signal=S.signal,v=setTimeout(()=>{b=!0,S.abort()},l)}return await fetch(o,_)}catch(_){if(g=_,Yg(_)&&!b||!(b||FS(_)))throw _;if(id())throw Ki.warn(`Document unloading, aborting retries: ${u}`),_;if(m===f-1)throw Ki.warn(`All ${f} attempts failed: ${u}`,_),_;const O=Jg(m,r,i);Ki.warn(`Network failure (attempt ${m+1}/${f}), retrying in ${O}ms: ${u}`),await Qg(O)}finally{v!==void 0&&clearTimeout(v)}}throw g}async function Zg(o,e={},n={}){const{retries:r=Fg,baseDelayMs:i=Kg,maxDelayMs:l=Wg,label:u=o}=n,d=r+1;for(let f=0;f<d;f++)try{await WS(o,e);return}catch(g){if(e.id&&document.getElementById(e.id)?.remove(),id())throw Ki.warn(`Document unloading, aborting script retries: ${u}`),g;if(f===d-1)throw Ki.warn(`All ${d} script attempts failed: ${u}`),g;const b=Jg(f,i,l);Ki.warn(`Script load failed (attempt ${f+1}/${d}), retrying in ${b}ms: ${u}`),await Qg(b)}}function WS(o,e){return new Promise((n,r)=>{const i=document.createElement("script");i.src=o,i.async=!1;for(const[l,u]of Object.entries(e))l==="id"?i.id=u:i.setAttribute(l,u);i.onload=()=>n(),i.onerror=()=>r(new Error(`Failed to load script: ${o}`)),document.head.appendChild(i)})}const ep="extension",Wi="extensionless",YS="file";function XS(){const o=globalThis?.G7Config;if(globalThis?.__g7AssetUrlMode===Wi)return Wi;const n=o?.assetUrlMode;return n===Wi||n===ep?n:o?.settings?.general?.asset_url_mode===Wi?Wi:ep}function tp(){return XS()===Wi}function Ma(o,e,n,r){const i=o.replace(/\/+$/,""),l=e.replace(/^\.+/,""),u=tp()?i:`${i}.${l}`,d=[];return r&&d.push(r.replace(/^[?&]+/,"")),n!=null&&n!==""&&d.push(`v=${n}`),d.length>0?`${u}?${d.join("&")}`:u}function Cr(o){if(!o||!tp())return o;const e=globalThis?.location?.origin,n=e&&o.startsWith(e)?o.slice(e.length):o;if(!n.startsWith("/api/"))return o;const[r,i]=JS(n),l=r.match(/^\/api\/(modules|plugins)\/bundle\.(js|css)$/);if(l)return np(`/api/${l[1]}/bundle/${l[2]}`,i);const u=r.match(/^\/api\/(templates|modules|plugins)\/assets\/([^/]+)\/(.+)$/);if(u){const[,f,g,m]=u,b=`${YS}=${encodeURIComponent(decodeURIComponent(m))}`;return`/api/${f}/assets/${g}?${b}${i?`&${i}`:""}`}const d=r.match(/^(\/api\/.+)\.(json|js|css)$/);return d?np(d[1],i):o}function JS(o){const e=o.indexOf("?");return e===-1?[o,""]:[o.slice(0,e),o.slice(e+1)]}function np(o,e){return e?`${o}?${e}`:o}const $a=dt("ComponentRegistry");class dn extends Error{constructor(n,r,i){super(n);$(this,"code");$(this,"details");this.code=r,this.details=i,this.name="ComponentRegistryError"}}const Vn=class Vn{constructor(){$(this,"registry",{});$(this,"manifest",null);$(this,"loadingState","idle");$(this,"error",null);$(this,"templateId",null);$(this,"templateType",null)}static getInstance(){return Vn.instance||(Vn.instance=new Vn),Vn.instance}static createIsolatedInstance(){return new Vn}static resetInstance(){Vn.instance=null}async loadComponents(e,n){if(this.loadingState==="loading")throw new dn("Components are already being loaded","LOADING_IN_PROGRESS");if(this.loadingState==="loaded"&&this.templateId===e&&this.templateType===n){$a.log("Components already loaded for template:",e,n);return}this.loadingState="loading",this.templateId=e,this.templateType=n,this.error=null;try{await this.loadManifest(),await this.loadComponentBundle(),this.loadingState="loaded",$a.log("Successfully loaded components:",Object.keys(this.registry).length)}catch(r){throw this.loadingState="error",this.error=r instanceof Error?r:new Error(String(r)),new dn(`Failed to load components: ${this.error.message}`,"LOAD_FAILED",{originalError:this.error})}}async loadManifest(){try{if(!this.templateId)throw new dn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=`${this.templateId}:${this.templateType}`;if(Vn.manifestCache.has(e)){this.manifest=Vn.manifestCache.get(e),$a.log("Manifest loaded from cache:",this.manifest.templateId);return}const n=Ma(`/api/templates/${this.templateId}/components`,"json"),r=await Dl(n,{label:"components.json"});if(!r.ok)throw new dn(`Failed to fetch manifest: ${r.status} ${r.statusText}`,"MANIFEST_FETCH_FAILED",{status:r.status,statusText:r.statusText});const i=await r.json();this.validateManifest(i),this.manifest=i,Vn.manifestCache.set(e,i),$a.log("Manifest loaded and cached:",i.templateId)}catch(e){throw e instanceof dn?e:new dn("Failed to load component manifest","MANIFEST_LOAD_FAILED",{originalError:e})}}validateManifest(e){if(!e.version)throw new dn("Manifest missing required field: version","MANIFEST_INVALID",{field:"version"});if(!e.templateId)throw new dn("Manifest missing required field: templateId","MANIFEST_INVALID",{field:"templateId"});if(!e.components||typeof e.components!="object")throw new dn("Manifest missing required field: components","MANIFEST_INVALID",{field:"components"});const n=["basic","composite","layout"];for(const r of n){if(!Array.isArray(e.components[r]))throw new dn(`Manifest field 'components.${r}' must be an array`,"MANIFEST_INVALID",{field:`components.${r}`,value:e.components[r]});e.components[r].forEach((i,l)=>{if(!i.name||typeof i.name!="string")throw new dn(`Invalid component metadata at ${r}[${l}]: missing or invalid 'name'`,"MANIFEST_INVALID",{type:r,index:l,metadata:i});if(!i.type||typeof i.type!="string")throw new dn(`Invalid component metadata at ${r}[${l}]: missing or invalid 'type'`,"MANIFEST_INVALID",{type:r,index:l,metadata:i})})}$a.log("Manifest validation passed")}async loadComponentBundle(){try{if(!this.templateId)throw new dn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=this.getGlobalVariableName(),n=window[e];if(!n||typeof n!="object")throw new dn(`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(n),$a.log("Component bundle loaded from global variable:",e)}catch(e){throw e instanceof dn?e:new dn("Failed to load component bundle","BUNDLE_LOAD_FAILED",{originalError:e})}}getGlobalVariableName(){if(!this.templateId)throw new dn("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 dn("Manifest not loaded","MANIFEST_NOT_LOADED");const n=["basic","composite","layout"];for(const r of n){const i=this.manifest.components[r]||[];for(const l of i){const u=l.name,d=e[u];if(!d){$a.warn(`Component '${u}' not found in bundle`);continue}this.registerComponent(u,d,l)}}}registerComponent(e,n,r){this.registry[e]&&$a.warn(`Component '${e}' already registered, overwriting`);const i=Xe.memo(n);this.registry[e]={component:i,metadata:r},$a.log(`[ComponentRegistry] Registered component: ${e} (${r.type})`)}getComponent(e){const n=this.registry[e];return n?n.component:null}getMetadata(e){const n=this.registry[e];return n?n.metadata:null}hasComponent(e){return e in this.registry}getComponentsByType(e){return Object.entries(this.registry).filter(([n,r])=>r.metadata.type===e).map(([n,r])=>n)}getAllComponents(){return Object.keys(this.registry)}getComponentMap(){const e={};for(const[n,r]of Object.entries(this.registry))e[n]=r.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,$a.log("Registry cleared")}};$(Vn,"instance",null),$(Vn,"manifestCache",new Map);let fa=Vn;const ap=dt("TranslationEngine");class sd extends Error{constructor(n,r,i){super(n);$(this,"key");$(this,"locale");this.key=r,this.locale=i,this.name="TranslationError"}}const $n=class $n{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 $n.instance||($n.instance=new $n(e)),$n.instance}static resetInstance(){$n.instance=null}setCacheVersion(e){this.cacheVersion!==e&&(ap.log("Cache version updated:",this.cacheVersion,"->",e),this.cacheVersion=e,this.cache.clear())}getCacheVersion(){return this.cacheVersion}async loadTranslations(e,n,r="/api",i=!1){const l=`${e}:${n}`;if(!i){const u=this.getFromCache(l);if(u)return this.translations.set(l,u),u}try{const u=[];i&&u.push(`_=${Date.now()}`);const d=Ma(`${r}/templates/${e}/lang/${n}`,"json",this.cacheVersion>0?this.cacheVersion:null,u.length>0?u.join("&"):void 0),f=await fetch(d);if(!f.ok)throw new sd(`Failed to load translations: ${f.statusText}`,void 0,n);const m=await f.json();return this.saveToCache(l,m),this.translations.set(l,m),m}catch(u){throw new sd(`Failed to fetch translations for ${n}: ${u instanceof Error?u.message:String(u)}`,void 0,n)}}resolveTranslations(e,n,r){let i=e;const l=5;let u=0;for(;u<l&&i.includes("=$t:");){const d=i;if(i=i.replace($n.NESTED_TRANSLATION_PARAM_PATTERN,(f,g,m)=>"="+this.translate(m,n,void 0,r)),i===d)break;u++}return i.replace($n.TRANSLATION_PATTERN,(d,f,g)=>{const{cleanedParams:m,trailing:b}=this.separateTrailingText(g);return this.translate(f,n,m,r)+b})}translate(e,n,r,i){const l=this.getTranslation(e,n),u=r&&this.cleanParamsStr(r);if(u){const d=this.parseParams(u,i);return this.replaceParams(l,d)}return l}getTranslation(e,n){const{templateId:r,locale:i}=n,l=`${r}:${i}`,u=this.translations.get(l);if(u){const d=this.getNestedValue(u,e);if(d!==null)return d}if(i!==this.options.fallbackLocale){const d=`${r}:${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,n){const r=n.split(".");let i=e;for(const l of r){if(i==null||typeof i!="object")return null;i=i[l]}return typeof i=="string"?i:null}setTranslationValue(e,n,r,i){const l=`${e}:${n}`,u=this.translations.get(l)??{},d=r.split(".");let f=u;for(let g=0;g<d.length-1;g+=1){const m=d[g],b=f[m];(b==null||typeof b!="object"||Array.isArray(b))&&(f[m]={}),f=f[m]}f[d[d.length-1]]=i,this.translations.set(l,u)}parseParams(e,n){const r={},i=e.startsWith("|")?e.slice(1):e,l=[],d=i.replace(/\{\{(?:[^}]|\}(?!\}))*\}\}/g,f=>(l.push(f),`__PLACEHOLDER_${l.length-1}__`)).matchAll($n.PARAM_PATTERN);for(const f of d){const[,g,m]=f,b=m.replace(/__PLACEHOLDER_(\d+)__/g,(v,S)=>l[parseInt(S,10)]);r[g.trim()]=this.resolveParamValue(b.trim(),n)}return r}resolveParamValue(e,n){if(e.startsWith("{{")&&e.endsWith("}}")){const r=e.slice(2,-2).trim();if(/[|&()[\]!?:+\-*/%<>=\s]/.test(r)&&n)try{const u=new Function(...Object.keys(n),`return ${r}`)(...Object.values(n));return String(u??"")}catch(l){return ap.error("Expression evaluation failed:",r,l),""}else{const l=this.getNestedDataValue(n,r);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 r=e.match(/(\s+[^\p{L}\w=|&\s][^\p{L}\w=]*\s*)$/u);return r?{cleanedParams:e.slice(0,-r[1].length),trailing:r[1]}:{cleanedParams:e,trailing:""}}cleanParamsStr(e){return this.separateTrailingText(e).cleanedParams||""}getNestedDataValue(e,n){if(!e)return;const r=n.split(".");let i=e;for(const l of r){if(i==null)return;i=i[l]}return i}replaceParams(e,n){let r=e;for(const[i,l]of Object.entries(n)){const u=new RegExp(`\\{\\{${i}\\}\\}`,"g");r=r.replace(u,String(l));const d=new RegExp(`\\{${i}\\}`,"g");r=r.replace(d,String(l))}return r}getFromCache(e){const n=this.cache.get(e);return n?Date.now()-n.timestamp>this.options.cacheTTL?(this.cache.delete(e),null):n.data:null}saveToCache(e,n){this.cache.set(e,{data:n,timestamp:Date.now()})}clearCache(){this.cache.clear(),this.translations.clear()}pruneCache(){const e=Date.now(),n=[];for(const[r,i]of this.cache.entries())e-i.timestamp>this.options.cacheTTL&&n.push(r);for(const r of n)this.cache.delete(r)}getCacheStats(){const e=Date.now();let n=0;for(const r of this.cache.values())e-r.timestamp>this.options.cacheTTL&&n++;return{size:this.cache.size,expired:n}}};$($n,"instance",null),$($n,"TRANSLATION_PATTERN",/\$t:(?:defer:)?([a-zA-Z0-9._-]+)(\|(?:(?!\$t:).)+)?/g),$($n,"NESTED_TRANSLATION_PARAM_PATTERN",/=(\$t:([a-zA-Z0-9._-]+))(?=[|&\s]|$)/g),$($n,"PARAM_PATTERN",/([^=|&]+)=([^|&]+)/g);let Er=$n,od=null;function QS(o){return od||(od=new Er(o)),od}const rp=Object.freeze(Object.defineProperty({__proto__:null,TranslationEngine:Er,TranslationError:sd,getTranslationEngine:QS},Symbol.toStringTag,{value:"Module"})),Yi=dt("PipeRegistry");function ip(o,e){const n=o.getFullYear(),r=String(o.getMonth()+1).padStart(2,"0"),i=String(o.getDate()).padStart(2,"0"),l=String(o.getHours()).padStart(2,"0"),u=String(o.getMinutes()).padStart(2,"0"),d=String(o.getSeconds()).padStart(2,"0");return e.replace("YYYY",String(n)).replace("YY",String(n).slice(-2)).replace("MM",r).replace("M",String(o.getMonth()+1)).replace("DD",i).replace("D",String(o.getDate())).replace("HH",l).replace("H",String(o.getHours())).replace("mm",u).replace("m",String(o.getMinutes())).replace("ss",d).replace("s",String(o.getSeconds()))}function ZS(o,e="ko"){const r=new Date().getTime()-o.getTime(),i=Math.floor(r/1e3),l=Math.floor(i/60),u=Math.floor(l/60),d=Math.floor(u/24),f=Math.floor(d/7),g=Math.floor(d/30),m=Math.floor(d/365);return e==="ko"?i<60?"방금 전":l<60?`${l}분 전`:u<24?`${u}시간 전`:d<7?`${d}일 전`:f<4?`${f}주 전`:g<12?`${g}개월 전`:`${m}년 전`:i<60?"just now":l<60?`${l} minute${l===1?"":"s"} ago`:u<24?`${u} hour${u===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 ld(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 Qs={date:{fn:(o,e="YYYY-MM-DD")=>{const n=ld(o);return n?ip(n,e):""},description:"날짜 포맷 (기본: YYYY-MM-DD)"},datetime:{fn:(o,e="YYYY-MM-DD HH:mm")=>{const n=ld(o);return n?ip(n,e):""},description:"날짜+시간 포맷 (기본: YYYY-MM-DD HH:mm)"},relativeTime:{fn:(o,e="ko")=>{const n=ld(o);return n?ZS(n,e):""},description:'상대 시간 표시 (예: "3분 전")'},number:{fn:(o,e)=>{const n=Number(o);if(isNaN(n))return String(o??"");const r={};return e!==void 0&&(r.minimumFractionDigits=e,r.maximumFractionDigits=e),n.toLocaleString(void 0,r)},description:"숫자 포맷 (천단위 구분, 선택적 소수점)"},truncate:{fn:(o,e=100,n="...")=>typeof o!="string"?String(o??""):o.length<=e?o:o.slice(0,e)+n,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,n)=>Array.isArray(o)?Array.isArray(e)?o.filter(r=>{const i=n?r?.[n]:r;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,yi=class yi{static getInstance(){return yi.instance||(yi.instance=new yi),yi.instance}register(e,n,r){if(Qs[e]){Yi.warn(`[PipeRegistry] 내장 파이프를 덮어쓸 수 없습니다: ${e}`);return}Xi.set(e,{fn:n,description:r}),Yi.log(`[PipeRegistry] 커스텀 파이프 등록됨: ${e}`)}unregister(e){if(Qs[e])return Yi.warn(`[PipeRegistry] 내장 파이프는 해제할 수 없습니다: ${e}`),!1;const n=Xi.delete(e);return n&&Yi.log(`[PipeRegistry] 커스텀 파이프 해제됨: ${e}`),n}get(e){const n=Qs[e];return n?n.fn:Xi.get(e)?.fn}has(e){return!!Qs[e]||Xi.has(e)}execute(e,n,r=[]){const i=this.get(e);if(!i)return Yi.warn(`[PipeRegistry] 알 수 없는 파이프: ${e}`),n;try{return i(n,...r)}catch(l){return Yi.error(`[PipeRegistry] 파이프 실행 오류 (${e}):`,l),n}}list(){const e=[];for(const[n,r]of Object.entries(Qs))e.push({name:n,description:r.description,type:"built-in"});for(const[n,r]of Xi.entries())e.push({name:n,description:r.description,type:"custom"});return e.sort((n,r)=>n.name.localeCompare(r.name))}clearCustomPipes(){Xi.clear()}};$(yi,"instance",null);let Ol=yi;Ol.getInstance();function ew(o){const e=o.trim(),n=e.indexOf("(");if(n===-1)return{name:e,args:[]};const r=e.slice(0,n).trim(),i=e.slice(n+1,-1);if(!i.trim())return{name:r,args:[]};const l=[];let u="",d=null,f=0;for(let g=0;g<i.length;g++){const m=i[g];if((g>0?i[g-1]:"")==="\\"){u+=m;continue}if((m==='"'||m==="'")&&!d){d=m;continue}if(m===d){d=null;continue}if(d){u+=m;continue}if(m==="("||m==="["||m==="{"){f++,u+=m;continue}if(m===")"||m==="]"||m==="}"){f--,u+=m;continue}if(m===","&&f===0){l.push(sp(u.trim())),u="";continue}u+=m}return u.trim()&&l.push(sp(u.trim())),{name:r,args:l}}function sp(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 tw(o){const e=[];let n="",r=null,i=0;for(let l=0;l<o.length;l++){const u=o[l],d=l>0?o[l-1]:"",f=l<o.length-1?o[l+1]:"";if(d==="\\"){n+=u;continue}if((u==='"'||u==="'")&&!r){r=u,n+=u;continue}if(u===r){r=null,n+=u;continue}if(r){n+=u;continue}if(u==="("||u==="["||u==="{"){i++,n+=u;continue}if(u===")"||u==="]"||u==="}"){i--,n+=u;continue}if(u==="|"&&f!=="|"&&d!=="|"&&i===0){e.push(n.trim()),n="";continue}n+=u}return n.trim()&&e.push(n.trim()),e.length===0?[o,[]]:[e[0],e.slice(1)]}function ci(o){let e=null,n=0;for(let r=0;r<o.length;r++){const i=o[r],l=r>0?o[r-1]:"",u=r<o.length-1?o[r+1]:"";if(l!=="\\"){if((i==='"'||i==="'")&&!e){e=i;continue}if(i===e){e=null;continue}if(!e){if(i==="("||i==="["||i==="{"){n++;continue}if(i===")"||i==="]"||i==="}"){n--;continue}if(i==="|"&&u!=="|"&&l!=="|"&&n===0)return!0}}}return!1}function nw(o,e){const n=Ol.getInstance();let r=o;for(const i of e){const l=ew(i);r=n.execute(l.name,r,l.args)}return r}const Na="raw:",Ll="",Zs="",_r="";function eo(o){return Ll+o+Zs}function op(o){return o.length>=2&&o.charCodeAt(0)===64976&&o.charCodeAt(o.length-1)===64977}function lp(o){return o.includes(Ll)}function cp(o){return o.slice(1,-1)}function Ji(o){if(typeof o=="string")return eo(o);if(Array.isArray(o))return o.map(Ji);if(o&&typeof o=="object"){const e={};for(const[n,r]of Object.entries(o))e[n]=Ji(r);return e}return o}const to=dt("DataBindingEngine");function Ml(){try{return window.G7Core?.devTools}catch{return}}class cd extends Error{constructor(n,r,i){super(n);$(this,"path");$(this,"context");this.path=r,this.context=i,this.name="DataBindingError"}}const wa=class wa{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,n){this.isRenderCycleCacheActive()&&this.renderCycleCache.set(e,n)}resolveBindings(e,n,r,i){const l={...this.defaultOptions,...r},u=Ml(),d=n._computed&&!n.$computed?{...n,$computed:n._computed}:n;return e.replace(wa.BINDING_PATTERN,(f,g)=>{const m=g.trim();let b=!1,v=m;if(m.startsWith(Na)&&(b=!0,v=m.slice(Na.length)),ci(v)){const T=u?.isEnabled()?performance.now():0;try{const[D,j]=tw(v);let H,P=!1;const X=/[?:|&!+\-*/<>=()]/.test(D)||/\[['"]/.test(D),pe=D.startsWith("_global")||D.startsWith("_local")||D.startsWith("_isolated")||D.startsWith("$parent");if(l.skipCache)X?H=this.evaluateExpression(D,d):H=this.resolvePath(D,d,l);else if(X){const Me=this.getFromRenderCycleCache(`expr:${D}`);Me!==void 0?(H=Me,P=!0):(H=this.evaluateExpression(D,d),this.saveToRenderCycleCache(`expr:${D}`,H))}else if(pe){const Me=this.getFromRenderCycleCache(D);Me!==void 0?(H=Me,P=!0):(H=this.resolvePath(D,d,l),this.saveToRenderCycleCache(D,H))}else{const Me=this.getFromCache(D);Me!==void 0?(H=Me,P=!0):(H=this.resolvePath(D,d,l),this.saveToCache(D,H))}const _e=nw(H,j);if(u?.isEnabled()){const Me=performance.now()-T;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(_e),resultType:this.getResultType(_e),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:P,duration:Me,method:"resolveBindings",skipCache:l.skipCache})}const we=this.formatValue(_e);return b?eo(we):we}catch(D){return to.error("Pipe expression evaluation failed:",v,D),f}}if(/[?:&!+\-*/<>=()]/.test(v)||/\|\|/.test(v)||/\[['"]/.test(v)){const T=u?.isEnabled()?performance.now():0;try{let D,j=!1;if(l.skipCache)D=this.evaluateExpression(v,d);else{const P=`expr:${v}`,X=this.getFromRenderCycleCache(P);X!==void 0?(D=X,j=!0):(D=this.evaluateExpression(v,d),this.saveToRenderCycleCache(P,D))}if(u?.isEnabled()){const P=performance.now()-T;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(D),resultType:this.getResultType(D),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:j,duration:P,method:"resolveBindings",skipCache:l.skipCache})}const H=this.formatValue(D);return b?eo(H):H}catch(D){return to.error("Expression evaluation failed:",v,D),f}}if(l.skipCache){const T=u?.isEnabled()?performance.now():0,D=this.resolvePath(v,d,l);if(u?.isEnabled()){const H=performance.now()-T;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(D),resultType:this.getResultType(D),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:H,method:"resolveBindings",skipCache:!0})}const j=this.formatValue(D);return b?eo(j):j}const _=v.startsWith("_global")||v.startsWith("_local")||v.startsWith("_isolated")||v.startsWith("$parent"),x=u?.isEnabled()?performance.now():0;let k,O=!1;if(_){const T=this.getFromRenderCycleCache(v);T!==void 0?(k=T,O=!0):(k=this.resolvePath(v,d,l),this.saveToRenderCycleCache(v,k))}else{const T=this.getFromCache(v);T!==void 0?(k=T,O=!0):(k=this.resolvePath(v,d,l),this.saveToCache(v,k))}if(u?.isEnabled()){const T=performance.now()-x;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(k),resultType:this.getResultType(k),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:O,duration:T,method:"resolveBindings",skipCache:l.skipCache})}const M=this.formatValue(k);return b?eo(M):M})}resolve(e,n,r,i){const l={...this.defaultOptions,...r},u=Ml(),d=u?.isEnabled()?performance.now():0;if(l.skipCache){const b=this.resolvePath(e,n,l);return u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(b),resultType:this.getResultType(b),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:performance.now()-d,method:"resolve",skipCache:!0}),b}const f=e.startsWith("_global")||e.startsWith("_local")||e.startsWith("_isolated")||e.startsWith("$parent");let g=!1;if(f){const b=this.getFromRenderCycleCache(e);if(b!==void 0)return g=!0,u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(b),resultType:this.getResultType(b),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),b}else{const b=this.getFromCache(e);if(b!==void 0)return g=!0,u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(b),resultType:this.getResultType(b),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),b}const m=this.resolvePath(e,n,l);return f?this.saveToRenderCycleCache(e,m):this.saveToCache(e,m),u?.isEnabled()&&u.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,n,r,i=0,l=new WeakSet){if(r.maxDepth&&i>r.maxDepth){if(r.detectCircular)throw new cd(`Maximum depth exceeded (${r.maxDepth}). Possible circular reference.`,e,n);return r.defaultValue}const u=this.parsePath(e);let d=n;for(let f=0;f<u.length;f++){const g=u[f];if(d==null){if(r.nullSafe)return r.defaultValue;throw new cd(`Cannot read property '${g}' of ${d}`,e,n)}if(r.detectCircular&&typeof d=="object"){if(l.has(d))throw new cd(`Circular reference detected at path: ${u.slice(0,f+1).join(".")}`,e,n);l.add(d)}d=d[g],e==="_global.toasts"&&to.log(`[DataBindingEngine] segment: ${g}, current:`,d)}return d!==void 0?d:r.defaultValue}parsePath(e){const n=[];let r;for(wa.PATH_SEGMENT_PATTERN.lastIndex=0;(r=wa.PATH_SEGMENT_PATTERN.exec(e))!==null;){const i=r[1]||r[2];i&&n.push(i)}return n}formatValue(e){if(e==null)return"";if(typeof e=="object")try{return JSON.stringify(e)}catch{return"[Object]"}return String(e)}getFromCache(e){const n=this.cache.get(e),r=Ml();if(!n){r?.isEnabled()&&r.recordCacheMiss();return}if(Date.now()-n.timestamp>wa.CACHE_EXPIRY){this.cache.delete(e),r?.isEnabled()&&r.recordCacheMiss();return}return r?.isEnabled()&&r.recordCacheHit(),n.value}saveToCache(e,n){this.cache.set(e,{value:n,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}extractSingleBinding(e){if(!e.startsWith("{{")||!e.endsWith("}}")||e.length<5)return null;const n=e.slice(2,-2);let r=0;for(let i=0;i<n.length-1;i++){const l=n[i];if(l==="{")r++;else if(l==="}"){if(r>0)r--;else if(n[i+1]==="}")return null}}return n}resolveObject(e,n,r){if(this.isSwitchExpression(e)){const d=e;return this.resolveSwitch(d,n,r)}if(this.isActionDefinition(e))return{...e};if("iteration"in e)return{...e};const i={},u=[...["cellChildren","expandChildren","expandContext","render"],...r?.skipBindingKeys||[]];for(const[d,f]of Object.entries(e)){if(u.includes(d)){i[d]=f;continue}if(typeof f=="string"){const g=this.extractSingleBinding(f);if(g!==null){const m=g.trim();let b=!1,v=m;m.startsWith(Na)&&(b=!0,v=m.slice(Na.length));const S=/[?:|&!+\-*/<>=()]/.test(v)||/\[['"]/.test(v),_=ci(v)?this.resolveBindings(`{{${v}}}`,n,r):S?this.evaluateExpression(v,n,r):this.resolve(v,n,r);i[d]=b&&_!=null?Ji(_):_}else i[d]=this.resolveBindings(f,n,r)}else Array.isArray(f)?i[d]=f.map(g=>typeof g=="string"?this.resolveBindings(g,n,r):typeof g=="object"&&g!==null?this.resolveObject(g,n,r):g):f&&typeof f=="object"?i[d]=this.resolveObject(f,n,r):i[d]=f}return i}clearCache(){this.cache.clear(),this.expressionFnCache.clear()}invalidateCacheByKeys(e){for(const n of this.cache.keys())for(const r of e)if(n===r||n.startsWith(`${r}.`)||n.startsWith(`${r}[`)){this.cache.delete(n);break}}pruneCache(){const e=Date.now();for(const[n,r]of this.cache.entries())e-r.timestamp>wa.CACHE_EXPIRY&&this.cache.delete(n)}getCacheStats(){const e=Date.now();let n=0;for(const r of this.cache.values())e-r.timestamp>wa.CACHE_EXPIRY&&n++;return{size:this.cache.size,expired:n}}evaluateExpression(e,n,r){const i=Ml(),l=i?.isEnabled()?performance.now():0;i?.isEnabled()&&i.trackBindingEval();try{let u=this.preprocessOptionalChaining(e);u=this.preprocessTranslationTokens(u);const d=this.extractVariablesFromExpression(u),f={...n};for(const D of d)D in f||(f[D]=void 0);n._computed&&!f.$computed&&(f.$computed=n._computed);let g=n.$templateId,m=n.$locale;if(typeof window<"u"&&(!g||!m)){const D=window.__templateApp?.getConfig?.();g??(g=D?.templateId),m??(m=D?.locale)}const b=m||"ko";f.$localized=(D,j)=>{if(D==null&&!j)return"";if(typeof D=="string")return D;if(D&&typeof D=="object"&&D[b])return D[b];if(j&&typeof j=="string"){const H=f.$t?f.$t(j):j;if(H&&H!==j)return H}return D&&typeof D=="object"?D.ko||D.en||Object.values(D)[0]||"":D==null?"":String(D)};const v=typeof window<"u"?window.G7Core:void 0;f.$uuid=()=>v?.uuid?v.uuid():typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,D=>{const j=Math.random()*16|0;return(D==="x"?j:j&3|8).toString(16)});const S={templateId:g||"",locale:b};f.$t=D=>{if(!D||typeof D!="string")return"";try{return Er.getInstance().translate(D,S)}catch(j){return to.warn("$t() translation failed for key:",D,j),D}},f.$get=(D,j,H=void 0)=>{if(D==null)return H;const P=Array.isArray(j)?j:[j];if(P.length===0)return D;let X=D;for(const pe of P){if(X==null||pe==null)return H;X=X[pe]}return X??H};const _=Object.keys(f),x=Object.values(f),k=`${u}|${_.join(",")}`;let O=this.expressionFnCache.get(k);const M=!!O;O||(O=new Function(..._,`return (${u});`),this.expressionFnCache.set(k,O));const T=O(...x);if(i?.isEnabled()){const D=performance.now()-l;i.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(T),resultType:this.getResultType(T),componentId:r?.componentId,componentName:r?.componentName,propName:r?.propName,fromCache:M,duration:D,method:"evaluateExpression",skipCache:r?.skipCache})}return T}catch(u){throw new Error(`Failed to evaluate expression "${e}": ${u instanceof Error?u.message:String(u)}`)}}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 n=Object.keys(e);return n.length>20?`{Object(${n.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,(n,r,i,l)=>`$t('${l}')`),e.replace(/(?<!['"]\s*)(\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*)(?!\s*['"])/g,'"$1"')}preprocessOptionalChaining(e){const n=[];let r=e.replace(/(['"])(?:(?!\1|\\).|\\.)*\1/g,l=>(n.push(l),`__STRING_LITERAL_${n.length-1}__`));const i=[];return r=r.replace(/\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*(?:\|[^'"\s,)]+)?/g,l=>(i.push(l),`__TRANSLATION_TOKEN_${i.length-1}__`)),r=r.replace(/([a-zA-Z_$][a-zA-Z0-9_$]*)\.(?!\?)/g,"$1?."),r=r.replace(/__TRANSLATION_TOKEN_(\d+)__/g,(l,u)=>i[parseInt(u,10)]),r=r.replace(/__STRING_LITERAL_(\d+)__/g,(l,u)=>n[parseInt(u,10)]),r}extractVariablesFromExpression(e){const n=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"]),r=/(?<![.\w$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,i=new Set;let l;for(;(l=r.exec(e))!==null;){const u=l[1];n.has(u)||i.add(u)}return Array.from(i)}isSwitchExpression(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$switch"in e&&"$cases"in e}resolveSwitch(e,n,r){const i={...r,skipCache:!0};let l;try{l=this.resolveBindings(e.$switch,n,i)?.toString()?.trim()??""}catch(d){to.warn("resolveSwitch: $switch 키 평가 실패:",e.$switch,d),l=""}let u;if(l&&e.$cases&&l in e.$cases)u=e.$cases[l];else if("$default"in e)u=e.$default;else return;return typeof u=="string"?u.includes("{{")?this.resolveBindings(u,n,i):u:u!==null&&typeof u=="object"?this.resolveObject(u,n,i):u}};$(wa,"BINDING_PATTERN",/\{\{([^}]+)\}\}/g),$(wa,"PATH_SEGMENT_PATTERN",/([^.[\]]+)|\[(\d+)\]/g),$(wa,"CACHE_EXPIRY",3e4);let Rn=wa;const aw=new Rn,$l={mobile:{min:0,max:767},tablet:{min:768,max:1023},desktop:{min:1024,max:1/0},portable:{min:0,max:1023}},Nl=new Map;function rw(o,e){let n=null;return((...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{o(...r)},e)})}class iw{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=rw(()=>{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(Nl.has(e))return Nl.get(e)??null;let n=null;if($l[e])n={...$l[e]};else{const r=e.match(/^(-?\d*)-(-?\d*)$/);if(r){const[,i,l]=r,u=i===""?0:parseInt(i,10),d=l===""?1/0:parseInt(l,10);!isNaN(u)&&!isNaN(d)&&u<=d&&(n={min:u,max:d})}}return Nl.set(e,n),n}getMatchingKey(e,n){const r=[];for(const i of Object.keys(e)){const l=this.parseRange(i);l&&n>=l.min&&n<=l.max&&r.push({key:i,range:l,isPreset:!!$l[i]})}return r.length===0?null:(r.sort((i,l)=>{if(i.isPreset!==l.isPreset)return i.isPreset?1:-1;const u=i.range.max-i.range.min,d=l.range.max-l.range.min;return u-d}),r[0].key)}matches(e){const n=this.parseRange(e);return n?this.currentWidth>=n.min&&this.currentWidth<=n.max:!1}clearSubscribers(){this.subscribers.clear()}destroy(){this.debouncedHandler&&typeof window<"u"&&window.removeEventListener("resize",this.debouncedHandler),this.clearSubscribers(),Nl.clear()}_setWidthForTesting(e){this.currentWidth=e,this.notifySubscribers()}}const ui=new iw,Il=dt("ConditionEvaluator");function sw(o){switch(o){case"true":return{value:!0};case"false":return{value:!1};case"null":return{value:null};case"undefined":return{value:void 0};default:return}}function ow(o){return/[?:|&!+\-*/<>=()]/.test(o)}function lw(o){if(!o.startsWith("{{")||!o.endsWith("}}"))return null;const e=o.slice(2,-2);let n=null,r=0;for(let i=0;i<e.length;i++){const l=e[i];if((i>0?e[i-1]:"")!=="\\"&&((l==='"'||l==="'")&&!n?n=l:l===n&&(n=null),!n&&(l==="{"&&r++,l==="}"&&r--,r<0)))return null}return r===0?e.trim():null}function cw(o,e,n){if(!o)return!0;try{const r=lw(o);let i;if(r!==null){const l=sw(r);l!==void 0?i=l.value:ci(r)?i=n.resolveBindings(`{{${r}}}`,e,{skipCache:!0}):ow(r)?i=n.evaluateExpression(r,e):i=n.resolve(r,e,{skipCache:!0})}else i=n.resolveBindings(o,e,{skipCache:!0});if(typeof i=="string"){const l=i.toLowerCase().trim();if(l==="false"||l==="0"||l===""||l==="null"||l==="undefined")return!1}return!!i}catch(r){return Il.warn(`evaluateStringCondition: 조건 평가 실패: ${o}`,r),!1}}function Hl(o,e,n){if(typeof o=="string")return cw(o,e,n);if("and"in o){if(!Array.isArray(o.and)||o.and.length===0)return Il.warn("evaluateConditionExpression: AND 그룹이 비어있습니다"),!0;for(const r of o.and)if(!Hl(r,e,n))return!1;return!0}if("or"in o){if(!Array.isArray(o.or)||o.or.length===0)return Il.warn("evaluateConditionExpression: OR 그룹이 비어있습니다"),!1;for(const r of o.or)if(Hl(r,e,n))return!0;return!1}return Il.warn("evaluateConditionExpression: 알 수 없는 조건 형식",o),!1}function up(o,e,n){if(!Array.isArray(o)||o.length===0)return{matched:!1,branchIndex:-1};for(let r=0;r<o.length;r++){const i=o[r];if(i.if===void 0)return{matched:!0,branchIndex:r};if(Hl(i.if,e,n))return{matched:!0,branchIndex:r}}return{matched:!1,branchIndex:-1}}function uw(o){return typeof o=="string"?!0:o&&typeof o=="object"?"and"in o||"or"in o:!1}function dw(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 Ja=dt("RenderHelpers"),fw=new Map([["true",!0],["false",!1],["null",null]]);function dp(){try{return window.G7Core?.devTools}catch{return}}const fp=new Rn;function ud(o){return/[?:|&!+\-*/<>=()[\]{}]/.test(o)}function hp(o){if(!o.startsWith("{{")||!o.endsWith("}}"))return null;const e=o.slice(2,-2);let n=null,r=0;for(let i=0;i<e.length;i++){const l=e[i];if((i>0?e[i-1]:"")!=="\\"&&((l==='"'||l==="'")&&!n?n=l:l===n&&(n=null),!n&&(l==="{"&&r++,l==="}"&&r--,r<0)))return null}return r===0?e.trim():null}function dd(o,e,n){let r=o;if(o.startsWith("{{")&&o.endsWith("}}")&&(r=o.slice(2,-2).trim()),ud(r))try{return n.evaluateExpression(r,e)}catch(i){Ja.warn(`resolveIterationSource: 표현식 평가 실패: ${o}`,i);return}return n.resolve(r,e,{skipCache:!0})}function hw(o,e){const n={...o};if(e?.parentDataContext)for(const[r,i]of Object.entries(e.parentDataContext))r in n||(n[r]=i);if(e?.state){const r=n._local||{};n._local={...r,...e.state}}return e?.isolatedContext?.state&&(n._isolated=e.isolatedContext.state),n}function fd(o,e,n,r){if(!e||!Array.isArray(e)||e.length===0)return o;const i=r?.actionDispatcher??lm(),l={...o,actions:e},u=i.bindActionsToProps(l,n,r?.componentContext);return delete u.actions,u}function gp(o,e,n,r){if(typeof o=="boolean")return o;if(!o)return!0;try{const i=hp(o);let l;if(i!==null){const u=fw.get(i);u!==void 0?l=u:ci(i)?l=n.resolveBindings(`{{${i}}}`,e,{skipCache:!0}):ud(i)?l=n.evaluateExpression(i,e):l=n.resolve(i,e,{skipCache:!0})}else l=n.resolveBindings(o,e,{skipCache:!0});if(typeof l=="string"){const u=l.toLowerCase().trim();if(u==="false"||u==="0"||u===""||u==="null"||u==="undefined")return!1}return!!l}catch(i){return Ja.warn(`evaluateIfCondition: 조건 평가 실패 (컴포넌트: ${r||"unknown"}):`,i),!1}}function Qi(o,e,n,r){if(o.if!==void 0)return gp(o.if,e,n,r);if(o.condition!==void 0)return gp(o.condition,e,n,r);if(o.conditions===void 0)return!0;const i=o.conditions;try{return uw(i)?Hl(i,e,n):dw(i)?up(i,e,n).matched:(Ja.warn(`evaluateRenderCondition: 알 수 없는 conditions 형식 (컴포넌트: ${r||"unknown"})`),!0)}catch(l){return Ja.warn(`evaluateRenderCondition: conditions 평가 실패 (컴포넌트: ${r||"unknown"}):`,l),!1}}function pp(o){if(!o.responsive)return o;const e=ui.getWidth(),n=ui.getMatchingKey(o.responsive,e);if(!n)return o;const r=o.responsive[n];return{...o,props:{...o.props,...r.props},children:r.children??o.children,text:r.text??o.text,if:r.if??o.if,iteration:r.iteration??o.iteration}}function no(o,e,n,r,i){if(!o||o.length===0)return[];const l=i?.bindingEngine??new Rn,u=i?.translationEngine??Er.getInstance(),d=i?.translationContext??{templateId:"",locale:"ko"},f=hw(e,i?.componentContext),g=(v,S)=>{if(typeof v=="string"){if(op(v))return cp(v);if(lp(v)){const x=[],k=v.replace(new RegExp(`${Ll}([^${Zs}]*)${Zs}`,"g"),(M,T)=>(x.push(T),`${_r}${x.length-1}${_r}`));let O=k;return/\$t:[a-zA-Z0-9._-]+/.test(k)&&(O=u.resolveTranslations(k,d,S)),O.replace(new RegExp(`${_r}(\\d+)${_r}`,"g"),(M,T)=>x[parseInt(T)])}if(v.startsWith("$t:defer:")){const x="$t:"+v.slice(9);return u.resolveTranslations(x,d,S)}if(v.startsWith("$t:"))return u.resolveTranslations(v,d,S);const _=hp(v);if(_!==null){let x=!1,k=_;_.startsWith(Na)&&(x=!0,k=_.slice(Na.length));let O;if(ci(k))O=l.resolveBindings(`{{${k}}}`,S,{skipCache:!0});else if(ud(k))try{O=l.evaluateExpression(k,S)}catch(M){Ja.warn("renderItemChildren: 표현식 평가 실패:",M);return}else O=l.resolve(k,S,{skipCache:!0});return!x&&typeof O=="string"&&/\$t:[a-zA-Z0-9._-]+/.test(O)&&(O=u.resolveTranslations(O,d,S)),x&&O!=null?Ji(O):O}if(v.includes("{{")){const x=l.resolveBindings(v,S,{skipCache:!0});return typeof x=="string"&&/\$t:[a-zA-Z0-9._-]+/.test(x)?u.resolveTranslations(x,d,S):x}return v}if(Array.isArray(v))return v.map(_=>g(_,S));if(v&&typeof v=="object"){const _={};for(const[x,k]of Object.entries(v))_[x]=g(k,S);return _}return v},m=(v,S)=>{if(!v)return{};const _={};for(const[x,k]of Object.entries(v))_[x]=g(k,S);return _},b=(v,S,_)=>{const x=pp(v),k=x.iteration;if(!k)return[];const O=dd(k.source,_,l);if(!Array.isArray(O))return Ja.warn(`renderItemChildren: iteration.source가 배열이 아닙니다: ${k.source}`),[];const M=dp();if(M?.isEnabled()){const D=`${S}-iteration`;M.trackIteration(D,k.source,k.item_var,k.index_var,O.length)}const T=n[x.name];return T?O.flatMap((D,j)=>{const H={..._,[k.item_var]:D,[`${k.item_var}_index`]:j,...k.index_var?{[k.index_var]:j}:{}},P=Qi({if:x.if,condition:x.condition,conditions:x.conditions},H,l,x.id);if(x.if&&M?.isEnabled()){const Je=`${S}-iter-${j}-if`;M.trackIfCondition(Je,x.if,P,x.name)}if(!P)return[];const X=x.id?String(g(x.id,H)):void 0,pe=`${S}-iter-${j}`,_e=i?.getRemountKey?i.getRemountKey(X,pe):pe,we=m(x.props,H),Me=fd(we,x.actions,H,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let qe=null;return x.text!==void 0?qe=g(x.text,H):x.children&&x.children.length>0&&(qe=no(x.children,H,n,_e,i)),M?.isEnabled()&&M.trackRender(x.name),[Xe.createElement(T,{key:_e,...Me},qe)]}):(Ja.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${x.name}`),[])};return o.flatMap((v,S)=>{const _=pp(v),x=_.id?String(g(_.id,f)):void 0,k=r?`${r}-${x||S}`:x||`child-${S}`,O=i?.getRemountKey?i.getRemountKey(x,k):k;if(_.iteration)return b(_,O,f);const M=Qi({if:_.if,condition:_.condition,conditions:_.conditions},f,l,_.id),T=dp();if(_.if&&T?.isEnabled()){const X=`${O}-if`;T.trackIfCondition(X,_.if,M,_.name)}if(!M)return[];const D=n[_.name];if(!D)return Ja.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${_.name}`),[];const j=m(_.props,f),H=fd(j,_.actions,f,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let P=null;return _.text!==void 0?P=g(_.text,f):_.children&&_.children.length>0&&(P=no(_.children,f,n,O,i)),T?.isEnabled()&&T.trackRender(_.name),[Xe.createElement(D,{key:O,...H},P)]})}function Zi(o,e,n,r){let i,l;return n instanceof Rn?(i=n,l=r):(i=fp,l=n),i.resolveBindings(o,e,l)}function gw(o,e,n,r){const i=n??fp,l={skipCache:!0,...r};let u;try{u=i.resolveBindings(o.key,e,{skipCache:l.skipCache})?.toString()?.trim()??""}catch(g){Ja.warn("resolveClassMap: key 평가 실패:",o.key,g),u=""}let d="";u&&o.variants&&u in o.variants?d=o.variants[u]: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 mp(o,e){return function(){return o.apply(e,arguments)}}const{toString:pw}=Object.prototype,{getPrototypeOf:es}=Object,{iterator:ao,toStringTag:yp}=Symbol,zl=(({hasOwnProperty:o})=>(e,n)=>o.call(e,n))(Object.prototype),ro=(o,e)=>{let n=o;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),zl(n,e))return!0;n=es(n)}return!1},mw=(o,e)=>o!=null&&ro(o,e)?o[e]:void 0,hd=(o=>e=>{const n=pw.call(e);return o[n]||(o[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ha=o=>(o=o.toLowerCase(),e=>hd(e)===o),jl=o=>e=>typeof e===o,{isArray:di}=Array,ts=jl("undefined");function ns(o){return o!==null&&!ts(o)&&o.constructor!==null&&!ts(o.constructor)&&Ln(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const bp=ha("ArrayBuffer");function yw(o){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&bp(o.buffer),e}const bw=jl("string"),Ln=jl("function"),vp=jl("number"),as=o=>o!==null&&typeof o=="object",vw=o=>o===!0||o===!1,Ul=o=>{if(!as(o))return!1;const e=es(o);return(e===null||e===Object.prototype||es(e)===null)&&!ro(o,yp)&&!ro(o,ao)},Sw=o=>{if(!as(o)||ns(o))return!1;try{return Object.keys(o).length===0&&Object.getPrototypeOf(o)===Object.prototype}catch{return!1}},ww=ha("Date"),Cw=ha("File"),Ew=o=>!!(o&&typeof o.uri<"u"),_w=o=>o&&typeof o.getParts<"u",Aw=ha("Blob"),xw=ha("FileList"),Tw=o=>as(o)&&Ln(o.pipe);function Rw(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Sp=Rw(),wp=typeof Sp.FormData<"u"?Sp.FormData:void 0,kw=o=>{if(!o)return!1;if(wp&&o instanceof wp)return!0;const e=es(o);if(!e||e===Object.prototype||!Ln(o.append))return!1;const n=hd(o);return n==="formdata"||n==="object"&&Ln(o.toString)&&o.toString()==="[object FormData]"},Dw=ha("URLSearchParams"),[Ow,Lw,Mw,$w]=["ReadableStream","Request","Response","Headers"].map(ha),Nw=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function io(o,e,{allOwnKeys:n=!1}={}){if(o===null||typeof o>"u")return;let r,i;if(typeof o!="object"&&(o=[o]),di(o))for(r=0,i=o.length;r<i;r++)e.call(null,o[r],r,o);else{if(ns(o))return;const l=n?Object.getOwnPropertyNames(o):Object.keys(o),u=l.length;let d;for(r=0;r<u;r++)d=l[r],e.call(null,o[d],d,o)}}function Cp(o,e){if(ns(o))return null;e=e.toLowerCase();const n=Object.keys(o);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const fi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ep=o=>!ts(o)&&o!==fi;function gd(...o){const{caseless:e,skipUndefined:n}=Ep(this)&&this||{},r={},i=(l,u)=>{if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=e&&typeof u=="string"&&Cp(r,u)||u,f=zl(r,d)?r[d]:void 0;Ul(f)&&Ul(l)?r[d]=gd(f,l):Ul(l)?r[d]=gd({},l):di(l)?r[d]=l.slice():(!n||!ts(l))&&(r[d]=l)};for(let l=0,u=o.length;l<u;l++){const d=o[l];if(!d||ns(d)||(io(d,i),typeof d!="object"||di(d)))continue;const f=Object.getOwnPropertySymbols(d);for(let g=0;g<f.length;g++){const m=f[g];Kw.call(d,m)&&i(d[m],m)}}return r}const Iw=(o,e,n,{allOwnKeys:r}={})=>(io(e,(i,l)=>{n&&Ln(i)?Object.defineProperty(o,l,{__proto__:null,value:mp(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(o,l,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),o),Hw=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),zw=(o,e,n,r)=>{o.prototype=Object.create(e.prototype,r),Object.defineProperty(o.prototype,"constructor",{__proto__:null,value:o,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(o,"super",{__proto__:null,value:e.prototype}),n&&Object.assign(o.prototype,n)},jw=(o,e,n,r)=>{let i,l,u;const d={};if(e=e||{},o==null)return e;do{for(i=Object.getOwnPropertyNames(o),l=i.length;l-- >0;)u=i[l],(!r||r(u,o,e))&&!d[u]&&(e[u]=o[u],d[u]=!0);o=n!==!1&&es(o)}while(o&&(!n||n(o,e))&&o!==Object.prototype);return e},Uw=(o,e,n)=>{o=String(o),(n===void 0||n>o.length)&&(n=o.length),n-=e.length;const r=o.indexOf(e,n);return r!==-1&&r===n},Bw=o=>{if(!o)return null;if(di(o))return o;let e=o.length;if(!vp(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=o[e];return n},Pw=(o=>e=>o&&e instanceof o)(typeof Uint8Array<"u"&&es(Uint8Array)),qw=(o,e)=>{const r=(o&&o[ao]).call(o);let i;for(;(i=r.next())&&!i.done;){const l=i.value;e.call(o,l[0],l[1])}},Gw=(o,e)=>{let n;const r=[];for(;(n=o.exec(e))!==null;)r.push(n);return r},Vw=ha("HTMLFormElement"),Fw=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),{propertyIsEnumerable:Kw}=Object.prototype,Ww=ha("RegExp"),_p=(o,e)=>{const n=Object.getOwnPropertyDescriptors(o),r={};io(n,(i,l)=>{let u;(u=e(i,l,o))!==!1&&(r[l]=u||i)}),Object.defineProperties(o,r)},Yw=o=>{_p(o,(e,n)=>{if(Ln(o)&&["arguments","caller","callee"].includes(n))return!1;const r=o[n];if(Ln(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Xw=(o,e)=>{const n={},r=i=>{i.forEach(l=>{n[l]=!0})};return di(o)?r(o):r(String(o).split(e)),n},Jw=()=>{},Qw=(o,e)=>o!=null&&Number.isFinite(o=+o)?o:e;function Zw(o){return!!(o&&Ln(o.append)&&o[yp]==="FormData"&&o[ao])}const e0=o=>{const e=new WeakSet,n=r=>{if(as(r)){if(e.has(r))return;if(ns(r))return r;if(!("toJSON"in r)){e.add(r);const i=di(r)?[]:{};return io(r,(l,u)=>{const d=n(l);!ts(d)&&(i[u]=d)}),e.delete(r),i}}return r};return n(o)},t0=ha("AsyncFunction"),n0=o=>o&&(as(o)||Ln(o))&&Ln(o.then)&&Ln(o.catch),Ap=((o,e)=>o?setImmediate:e?((n,r)=>(fi.addEventListener("message",({source:i,data:l})=>{i===fi&&l===n&&r.length&&r.shift()()},!1),i=>{r.push(i),fi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ln(fi.postMessage)),a0=typeof queueMicrotask<"u"?queueMicrotask.bind(fi):typeof process<"u"&&process.nextTick||Ap,xp=o=>o!=null&&Ln(o[ao]),V={isArray:di,isArrayBuffer:bp,isBuffer:ns,isFormData:kw,isArrayBufferView:yw,isString:bw,isNumber:vp,isBoolean:vw,isObject:as,isPlainObject:Ul,isEmptyObject:Sw,isReadableStream:Ow,isRequest:Lw,isResponse:Mw,isHeaders:$w,isUndefined:ts,isDate:ww,isFile:Cw,isReactNativeBlob:Ew,isReactNative:_w,isBlob:Aw,isRegExp:Ww,isFunction:Ln,isStream:Tw,isURLSearchParams:Dw,isTypedArray:Pw,isFileList:xw,forEach:io,merge:gd,extend:Iw,trim:Nw,stripBOM:Hw,inherits:zw,toFlatObject:jw,kindOf:hd,kindOfTest:ha,endsWith:Uw,toArray:Bw,forEachEntry:qw,matchAll:Gw,isHTMLForm:Vw,hasOwnProperty:zl,hasOwnProp:zl,hasOwnInPrototypeChain:ro,getSafeProp:mw,reduceDescriptors:_p,freezeMethods:Yw,toObjectSet:Xw,toCamelCase:Fw,noop:Jw,toFiniteNumber:Qw,findKey:Cp,global:fi,isContextDefined:Ep,isSpecCompliantForm:Zw,toJSONObject:e0,isAsyncFn:t0,isThenable:n0,setImmediate:Ap,asap:a0,isIterable:xp,isSafeIterable:o=>o!=null&&ro(o,ao)&&xp(o)},r0=V.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"]),i0=o=>{const e={};let n,r,i;return o&&o.split(`
|
||
`).forEach(function(u){i=u.indexOf(":"),n=u.substring(0,i).trim().toLowerCase(),r=u.substring(i+1).trim(),!(!n||e[n]&&r0[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e};function s0(o){let e=0,n=o.length;for(;e<n;){const r=o.charCodeAt(e);if(r!==9&&r!==32)break;e+=1}for(;n>e;){const r=o.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return e===0&&n===o.length?o:o.slice(e,n)}const o0=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),l0=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function pd(o,e){return V.isArray(o)?o.map(n=>pd(n,e)):s0(String(o).replace(e,""))}const c0=o=>pd(o,o0),u0=o=>pd(o,l0);function Tp(o){const e=Object.create(null);return V.forEach(o.toJSON(),(n,r)=>{e[r]=u0(n)}),e}const Rp=Symbol("internals");function so(o){return o&&String(o).trim().toLowerCase()}function Bl(o){return o===!1||o==null?o:V.isArray(o)?o.map(Bl):c0(String(o))}function d0(o){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(o);)e[r[1]]=r[2];return e}const f0=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function md(o,e,n,r,i){if(V.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!V.isString(e)){if(V.isString(r))return e.indexOf(r)!==-1;if(V.isRegExp(r))return r.test(e)}}function h0(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function g0(o,e){const n=V.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(o,r+n,{__proto__:null,value:function(i,l,u){return this[r].call(this,e,i,l,u)},configurable:!0})})}let Cn=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function l(d,f,g){const m=so(f);if(!m)return;const b=V.findKey(i,m);(!b||i[b]===void 0||g===!0||g===void 0&&i[b]!==!1)&&(i[b||f]=Bl(d))}const u=(d,f)=>V.forEach(d,(g,m)=>l(g,m,f));if(V.isPlainObject(e)||e instanceof this.constructor)u(e,n);else if(V.isString(e)&&(e=e.trim())&&!f0(e))u(i0(e),n);else if(V.isObject(e)&&V.isSafeIterable(e)){let d=Object.create(null),f,g;for(const m of e){if(!V.isArray(m))throw new TypeError("Object iterator must return a key-value pair");g=m[0],V.hasOwnProp(d,g)?(f=d[g],d[g]=V.isArray(f)?[...f,m[1]]:[f,m[1]]):d[g]=m[1]}u(d,n)}else e!=null&&l(n,e,r);return this}get(e,n){if(e=so(e),e){const r=V.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return d0(i);if(V.isFunction(n))return n.call(this,i,r);if(V.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=so(e),e){const r=V.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||md(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function l(u){if(u=so(u),u){const d=V.findKey(r,u);d&&(!n||md(r,r[d],d,n))&&(delete r[d],i=!0)}}return V.isArray(e)?e.forEach(l):l(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const l=n[r];(!e||md(this,this[l],l,e,!0))&&(delete this[l],i=!0)}return i}normalize(e){const n=this,r={};return V.forEach(this,(i,l)=>{const u=V.findKey(r,l);if(u){n[u]=Bl(i),delete n[l];return}const d=e?h0(l):String(l).trim();d!==l&&delete n[l],n[d]=Bl(i),r[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return V.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&V.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).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,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Rp]=this[Rp]={accessors:{}}).accessors,i=this.prototype;function l(u){const d=so(u);r[d]||(g0(i,u),r[d]=!0)}return V.isArray(e)?e.forEach(l):l(e),this}};Cn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Cn.prototype,({value:o},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>o,set(r){this[n]=r}}}),V.freezeMethods(Cn);const p0="[REDACTED ****]";function m0(o){if(V.hasOwnProp(o,"toJSON"))return!0;let e=Object.getPrototypeOf(o);for(;e&&e!==Object.prototype;){if(V.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function y0(o,e){const n=new Set(e.map(l=>String(l).toLowerCase())),r=[],i=l=>{if(l===null||typeof l!="object"||V.isBuffer(l))return l;if(r.indexOf(l)!==-1)return;l instanceof Cn&&(l=l.toJSON()),r.push(l);let u;if(V.isArray(l))u=[],l.forEach((d,f)=>{const g=i(d);V.isUndefined(g)||(u[f]=g)});else{if(!V.isPlainObject(l)&&m0(l))return r.pop(),l;u=Object.create(null);for(const[d,f]of Object.entries(l)){const g=n.has(d.toLowerCase())?p0:i(f);V.isUndefined(g)||(u[d]=g)}}return r.pop(),u};return i(o)}let Ce=class IS extends Error{static from(e,n,r,i,l,u){const d=new IS(e.message,n||e.code,r,i,l);return Object.defineProperty(d,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),d.name=e.name,e.status!=null&&d.status==null&&(d.status=e.status),u&&Object.assign(d,u),d}constructor(e,n,r,i,l){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),i&&(this.request=i),l&&(this.response=l,this.status=l.status)}toJSON(){const e=this.config,n=e&&V.hasOwnProp(e,"redact")?e.redact:void 0,r=V.isArray(n)&&n.length>0?y0(e,n):V.toJSONObject(e);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:r,code:this.code,status:this.status}}};Ce.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Ce.ERR_BAD_OPTION="ERR_BAD_OPTION",Ce.ECONNABORTED="ECONNABORTED",Ce.ETIMEDOUT="ETIMEDOUT",Ce.ECONNREFUSED="ECONNREFUSED",Ce.ERR_NETWORK="ERR_NETWORK",Ce.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Ce.ERR_DEPRECATED="ERR_DEPRECATED",Ce.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Ce.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Ce.ERR_CANCELED="ERR_CANCELED",Ce.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Ce.ERR_INVALID_URL="ERR_INVALID_URL",Ce.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const b0=null,kp=100;function yd(o){return V.isPlainObject(o)||V.isArray(o)}function Dp(o){return V.endsWith(o,"[]")?o.slice(0,-2):o}function bd(o,e,n){return o?o.concat(e).map(function(i,l){return i=Dp(i),!n&&l?"["+i+"]":i}).join(n?".":""):e}function v0(o){return V.isArray(o)&&!o.some(yd)}const S0=V.toFlatObject(V,{},null,function(e){return/^is[A-Z]/.test(e)});function Pl(o,e,n){if(!V.isObject(o))throw new TypeError("target must be an object");e=e||new FormData,n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(M,T){return!V.isUndefined(T[M])});const r=n.metaTokens,i=n.visitor||_,l=n.dots,u=n.indexes,d=n.Blob||typeof Blob<"u"&&Blob,f=n.maxDepth===void 0?kp:n.maxDepth,g=d&&V.isSpecCompliantForm(e),m=[];if(!V.isFunction(i))throw new TypeError("visitor must be a function");function b(O){if(O===null)return"";if(V.isDate(O))return O.toISOString();if(V.isBoolean(O))return O.toString();if(!g&&V.isBlob(O))throw new Ce("Blob is not supported. Use a Buffer instead.");if(V.isArrayBuffer(O)||V.isTypedArray(O)){if(g&&typeof d=="function")return new d([O]);if(typeof Buffer<"u")return Buffer.from(O);throw new Ce("Blob is not supported. Use a Buffer instead.",Ce.ERR_NOT_SUPPORT)}return O}function v(O){if(O>f)throw new Ce("Object is too deeply nested ("+O+" levels). Max depth: "+f,Ce.ERR_FORM_DATA_DEPTH_EXCEEDED)}function S(O,M){if(f===1/0)return JSON.stringify(O);const T=[];return JSON.stringify(O,function(j,H){if(!V.isObject(H))return H;for(;T.length&&T[T.length-1]!==this;)T.pop();return T.push(H),v(M+T.length-1),H})}function _(O,M,T){let D=O;if(V.isReactNative(e)&&V.isReactNativeBlob(O))return e.append(bd(T,M,l),b(O)),!1;if(O&&!T&&typeof O=="object"){if(V.endsWith(M,"{}"))M=r?M:M.slice(0,-2),O=S(O,1);else if(V.isArray(O)&&v0(O)||(V.isFileList(O)||V.endsWith(M,"[]"))&&(D=V.toArray(O)))return M=Dp(M),D.forEach(function(H,P){!(V.isUndefined(H)||H===null)&&e.append(u===!0?bd([M],P,l):u===null?M:M+"[]",b(H))}),!1}return yd(O)?!0:(e.append(bd(T,M,l),b(O)),!1)}const x=Object.assign(S0,{defaultVisitor:_,convertValue:b,isVisitable:yd});function k(O,M,T=0){if(!V.isUndefined(O)){if(v(T),m.indexOf(O)!==-1)throw new Error("Circular reference detected in "+M.join("."));m.push(O),V.forEach(O,function(j,H){(!(V.isUndefined(j)||j===null)&&i.call(e,j,V.isString(H)?H.trim():H,M,x))===!0&&k(j,M?M.concat(H):[H],T+1)}),m.pop()}}if(!V.isObject(o))throw new TypeError("data must be an object");return k(o),e}function Op(o){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(o).replace(/[!'()~]|%20/g,function(r){return e[r]})}function vd(o,e){this._pairs=[],o&&Pl(o,this,e)}const Lp=vd.prototype;Lp.append=function(e,n){this._pairs.push([e,n])},Lp.toString=function(e){const n=e?r=>e.call(this,r,Op):Op;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function w0(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Mp(o,e,n){if(!e)return o;o=o||"";const r=V.isFunction(n)?{serialize:n}:n,i=V.getSafeProp(r,"encode")||w0,l=V.getSafeProp(r,"serialize");let u;if(l?u=l(e,r):u=V.isURLSearchParams(e)?e.toString():new vd(e,r).toString(i),u){const d=o.indexOf("#");d!==-1&&(o=o.slice(0,d)),o+=(o.indexOf("?")===-1?"?":"&")+u}return o}class $p{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Sd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},C0={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:vd,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},wd=typeof window<"u"&&typeof document<"u",Cd=typeof navigator=="object"&&navigator||void 0,E0=wd&&(!Cd||["ReactNative","NativeScript","NS"].indexOf(Cd.product)<0),_0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",A0=wd&&window.location.href||"http://localhost",pn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:wd,hasStandardBrowserEnv:E0,hasStandardBrowserWebWorkerEnv:_0,navigator:Cd,origin:A0},Symbol.toStringTag,{value:"Module"})),...C0};function x0(o,e){return Pl(o,new pn.classes.URLSearchParams,{visitor:function(n,r,i,l){return pn.isNode&&V.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...e})}const Np=kp;function Ip(o){if(o>Np)throw new Ce("FormData field is too deeply nested ("+o+" levels). Max depth: "+Np,Ce.ERR_FORM_DATA_DEPTH_EXCEEDED)}function T0(o){const e=[],n=/\w+|\[(\w*)]/g;let r;for(;(r=n.exec(o))!==null;)Ip(e.length),e.push(r[0]==="[]"?"":r[1]||r[0]);return e}function R0(o){const e={},n=Object.keys(o);let r;const i=n.length;let l;for(r=0;r<i;r++)l=n[r],e[l]=o[l];return e}function Hp(o){function e(n,r,i,l){Ip(l);let u=n[l++];if(u==="__proto__")return!0;const d=Number.isFinite(+u),f=l>=n.length;return u=!u&&V.isArray(i)?i.length:u,f?(V.hasOwnProp(i,u)?i[u]=V.isArray(i[u])?i[u].concat(r):[i[u],r]:i[u]=r,!d):((!V.hasOwnProp(i,u)||!V.isObject(i[u]))&&(i[u]=[]),e(n,r,i[u],l)&&V.isArray(i[u])&&(i[u]=R0(i[u])),!d)}if(V.isFormData(o)&&V.isFunction(o.entries)){const n={};return V.forEachEntry(o,(r,i)=>{e(T0(r),i,n,0)}),n}return null}const rs=(o,e)=>o!=null&&V.hasOwnProp(o,e)?o[e]:void 0;function k0(o,e,n){if(V.isString(o))try{return(e||JSON.parse)(o),V.trim(o)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(o)}const oo={transitional:Sd,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,l=V.isObject(e);if(l&&V.isHTMLForm(e)&&(e=new FormData(e)),V.isFormData(e))return i?JSON.stringify(Hp(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(l){const f=rs(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return x0(e,f).toString();if((d=V.isFileList(e))||r.indexOf("multipart/form-data")>-1){const g=rs(this,"env"),m=g&&g.FormData;return Pl(d?{"files[]":e}:e,m&&new m,f)}}return l||i?(n.setContentType("application/json",!1),k0(e)):e}],transformResponse:[function(e){const n=rs(this,"transitional")||oo.transitional,r=n&&n.forcedJSONParsing,i=rs(this,"responseType"),l=i==="json";if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(r&&!i||l)){const d=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(e,rs(this,"parseReviver"))}catch(f){if(d)throw f.name==="SyntaxError"?Ce.from(f,Ce.ERR_BAD_RESPONSE,this,null,rs(this,"response")):f}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pn.classes.FormData,Blob:pn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch","query"],o=>{oo.headers[o]={}});function Ed(o,e){const n=this||oo,r=e||n,i=Cn.from(r.headers);let l=r.data;return V.forEach(o,function(d){l=d.call(n,l,i.normalize(),e?e.status:void 0)}),i.normalize(),l}function zp(o){return!!(o&&o.__CANCEL__)}let lo=class extends Ce{constructor(e,n,r){super(e??"canceled",Ce.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function jp(o,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?o(n):e(new Ce("Request failed with status code "+n.status,n.status>=400&&n.status<500?Ce.ERR_BAD_REQUEST:Ce.ERR_BAD_RESPONSE,n.config,n.request,n))}function D0(o){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(o);return e&&e[1]||""}function O0(o,e){o=o||10;const n=new Array(o),r=new Array(o);let i=0,l=0,u;return e=e!==void 0?e:1e3,function(f){const g=Date.now(),m=r[l];u||(u=g),n[i]=f,r[i]=g;let b=l,v=0;for(;b!==i;)v+=n[b++],b=b%o;if(i=(i+1)%o,i===l&&(l=(l+1)%o),g-u<e)return;const S=m&&g-m;return S?Math.round(v*1e3/S):void 0}}function L0(o,e){let n=0,r=1e3/e,i,l;const u=(g,m=Date.now())=>{n=m,i=null,l&&(clearTimeout(l),l=null),o(...g)};return[(...g)=>{const m=Date.now(),b=m-n;b>=r?u(g,m):(i=g,l||(l=setTimeout(()=>{l=null,u(i)},r-b)))},()=>i&&u(i)]}const ql=(o,e,n=3)=>{let r=0;const i=O0(50,250);return L0(l=>{if(!l||typeof l.loaded!="number")return;const u=l.loaded,d=l.lengthComputable?l.total:void 0,f=d!=null?Math.min(u,d):u,g=Math.max(0,f-r),m=i(g);r=Math.max(r,f);const b={loaded:f,total:d,progress:d?f/d:void 0,bytes:g,rate:m||void 0,estimated:m&&d?(d-f)/m:void 0,event:l,lengthComputable:d!=null,[e?"download":"upload"]:!0};o(b)},n)},Up=(o,e)=>{const n=o!=null;return[r=>e[0]({lengthComputable:n,total:o,loaded:r}),e[1]]},Bp=o=>(...e)=>V.asap(()=>o(...e)),M0=pn.hasStandardBrowserEnv?((o,e)=>n=>(n=new URL(n,pn.origin),o.protocol===n.protocol&&o.host===n.host&&(e||o.port===n.port)))(new URL(pn.origin),pn.navigator&&/(msie|trident)/i.test(pn.navigator.userAgent)):()=>!0,$0=pn.hasStandardBrowserEnv?{write(o,e,n,r,i,l,u){if(typeof document>"u")return;const d=[`${o}=${encodeURIComponent(e)}`];V.isNumber(n)&&d.push(`expires=${new Date(n).toUTCString()}`),V.isString(r)&&d.push(`path=${r}`),V.isString(i)&&d.push(`domain=${i}`),l===!0&&d.push("secure"),V.isString(u)&&d.push(`SameSite=${u}`),document.cookie=d.join("; ")},read(o){if(typeof document>"u")return null;const e=document.cookie.split(";");for(let n=0;n<e.length;n++){const r=e[n].replace(/^\s+/,""),i=r.indexOf("=");if(i!==-1&&r.slice(0,i)===o)try{return decodeURIComponent(r.slice(i+1))}catch{return r.slice(i+1)}}return null},remove(o){this.write(o,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function N0(o){return typeof o!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function I0(o,e){return e?o.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):o}const H0=/^https?:(?!\/\/)/i,z0=/[\t\n\r]/g;function j0(o){let e=0;for(;e<o.length&&o.charCodeAt(e)<=32;)e++;return o.slice(e)}function U0(o){return j0(o).replace(z0,"")}function Pp(o,e){if(typeof o=="string"&&H0.test(U0(o)))throw new Ce('Invalid URL: missing "//" after protocol',Ce.ERR_INVALID_URL,e)}function qp(o,e,n,r){Pp(e,r);let i=!N0(e);return o&&(i||n===!1)?(Pp(o,r),I0(o,e)):e}const Gp=o=>o instanceof Cn?{...o}:o;function hi(o,e){o=o||{},e=e||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(m,b,v,S){return V.isPlainObject(m)&&V.isPlainObject(b)?V.merge.call({caseless:S},m,b):V.isPlainObject(b)?V.merge({},b):V.isArray(b)?b.slice():b}function i(m,b,v,S){if(V.isUndefined(b)){if(!V.isUndefined(m))return r(void 0,m,v,S)}else return r(m,b,v,S)}function l(m,b){if(!V.isUndefined(b))return r(void 0,b)}function u(m,b){if(V.isUndefined(b)){if(!V.isUndefined(m))return r(void 0,m)}else return r(void 0,b)}function d(m){const b=V.hasOwnProp(e,"transitional")?e.transitional:void 0;if(!V.isUndefined(b))if(V.isPlainObject(b)){if(V.hasOwnProp(b,m))return b[m]}else return;const v=V.hasOwnProp(o,"transitional")?o.transitional:void 0;if(V.isPlainObject(v)&&V.hasOwnProp(v,m))return v[m]}function f(m,b,v){if(V.hasOwnProp(e,v))return r(m,b);if(V.hasOwnProp(o,v))return r(void 0,m)}const g={url:l,method:l,data:l,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,allowedSocketPaths:u,responseEncoding:u,validateStatus:f,headers:(m,b,v)=>i(Gp(m),Gp(b),v,!0)};return V.forEach(Object.keys({...o,...e}),function(b){if(b==="__proto__"||b==="constructor"||b==="prototype")return;const v=V.hasOwnProp(g,b)?g[b]:i,S=V.hasOwnProp(o,b)?o[b]:void 0,_=V.hasOwnProp(e,b)?e[b]:void 0,x=v(S,_,b);V.isUndefined(x)&&v!==f||(n[b]=x)}),V.hasOwnProp(e,"validateStatus")&&V.isUndefined(e.validateStatus)&&d("validateStatusUndefinedResolves")===!1&&(V.hasOwnProp(o,"validateStatus")?n.validateStatus=r(void 0,o.validateStatus):delete n.validateStatus),n}const B0=["content-type","content-length"];function P0(o,e,n){if(n!=="content-only"){o.set(e);return}Object.entries(e||{}).forEach(([r,i])=>{B0.includes(r.toLowerCase())&&o.set(r,i)})}const q0=o=>encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(e,n)=>String.fromCharCode(parseInt(n,16)));function Vp(o){const e=hi({},o),n=v=>V.hasOwnProp(e,v)?e[v]:void 0,r=n("data");let i=n("withXSRFToken");const l=n("xsrfHeaderName"),u=n("xsrfCookieName");let d=n("headers");const f=n("auth"),g=n("baseURL"),m=n("allowAbsoluteUrls"),b=n("url");if(e.headers=d=Cn.from(d),e.url=Mp(qp(g,b,m,e),n("params"),n("paramsSerializer")),f){const v=V.getSafeProp(f,"username")||"",S=V.getSafeProp(f,"password")||"";try{d.set("Authorization","Basic "+btoa(v+":"+(S?q0(S):"")))}catch(_){throw Ce.from(_,Ce.ERR_BAD_OPTION_VALUE,o)}}if(V.isFormData(r)&&(pn.hasStandardBrowserEnv||pn.hasStandardBrowserWebWorkerEnv||V.isReactNative(r)?d.setContentType(void 0):V.isFunction(r.getHeaders)&&P0(d,r.getHeaders(),n("formDataHeaderPolicy"))),pn.hasStandardBrowserEnv&&(V.isFunction(i)&&(i=i(e)),i===!0||i==null&&M0(e.url))){const S=l&&u&&$0.read(u);S&&d.set(l,S)}return e}const G0=typeof XMLHttpRequest<"u"&&function(o){return new Promise(function(n,r){const i=Vp(o);let l=i.data;const u=Cn.from(i.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:g}=i,m,b,v,S,_;function x(){S&&S(),_&&_(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let k=new XMLHttpRequest;k.open(i.method.toUpperCase(),i.url,!0),k.timeout=i.timeout;function O(){if(!k)return;const T=Cn.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),j={data:!d||d==="text"||d==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:T,config:o,request:k};jp(function(P){n(P),x()},function(P){r(P),x()},j),k=null}"onloadend"in k?k.onloadend=O:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.startsWith("file:"))||setTimeout(O)},k.onabort=function(){k&&(r(new Ce("Request aborted",Ce.ECONNABORTED,o,k)),x(),k=null)},k.onerror=function(D){const j=D&&D.message?D.message:"Network Error",H=new Ce(j,Ce.ERR_NETWORK,o,k);H.event=D||null,r(H),x(),k=null},k.ontimeout=function(){let D=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const j=i.transitional||Sd;i.timeoutErrorMessage&&(D=i.timeoutErrorMessage),r(new Ce(D,j.clarifyTimeoutError?Ce.ETIMEDOUT:Ce.ECONNABORTED,o,k)),x(),k=null},l===void 0&&u.setContentType(null),"setRequestHeader"in k&&V.forEach(Tp(u),function(D,j){k.setRequestHeader(j,D)}),V.isUndefined(i.withCredentials)||(k.withCredentials=!!i.withCredentials),d&&d!=="json"&&(k.responseType=i.responseType),g&&([v,_]=ql(g,!0),k.addEventListener("progress",v)),f&&k.upload&&([b,S]=ql(f),k.upload.addEventListener("progress",b),k.upload.addEventListener("loadend",S)),(i.cancelToken||i.signal)&&(m=T=>{k&&(r(!T||T.type?new lo(null,o,k):T),k.abort(),x(),k=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const M=D0(i.url);if(M&&!pn.protocols.includes(M)){r(new Ce("Unsupported protocol "+M+":",Ce.ERR_BAD_REQUEST,o)),x();return}k.send(l||null)})},V0=(o,e)=>{if(o=o?o.filter(Boolean):[],!e&&!o.length)return;const n=new AbortController;let r=!1;const i=function(f){if(!r){r=!0,u();const g=f instanceof Error?f:this.reason;n.abort(g instanceof Ce?g:new lo(g instanceof Error?g.message:g))}};let l=e&&setTimeout(()=>{l=null,i(new Ce(`timeout of ${e}ms exceeded`,Ce.ETIMEDOUT))},e);const u=()=>{o&&(l&&clearTimeout(l),l=null,o.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),o=null)};o.forEach(f=>f.addEventListener("abort",i,{once:!0}));const{signal:d}=n;return d.unsubscribe=()=>V.asap(u),d},F0=function*(o,e){let n=o.byteLength;if(n<e){yield o;return}let r=0,i;for(;r<n;)i=r+e,yield o.slice(r,i),r=i},K0=async function*(o,e){for await(const n of W0(o))yield*F0(n,e)},W0=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const e=o.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Fp=(o,e,n,r)=>{const i=K0(o,e);let l=0,u,d=f=>{u||(u=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:g,value:m}=await i.next();if(g){d(),f.close();return}let b=m.byteLength;if(n){let v=l+=b;n(v)}f.enqueue(new Uint8Array(m))}catch(g){throw d(g),g}},cancel(f){return d(f),i.return()}},{highWaterMark:2})},Gl=o=>o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102,Y0=(o,e,n)=>e+2<n&&Gl(o.charCodeAt(e+1))&&Gl(o.charCodeAt(e+2));function X0(o){if(!o||typeof o!="string"||!o.startsWith("data:"))return 0;const e=o.indexOf(",");if(e<0)return 0;const n=o.slice(5,e),r=o.slice(e+1);if(/;base64/i.test(n)){let u=r.length;const d=r.length;for(let S=0;S<d;S++)if(r.charCodeAt(S)===37&&S+2<d){const _=r.charCodeAt(S+1),x=r.charCodeAt(S+2);Gl(_)&&Gl(x)&&(u-=2,S+=2)}let f=0,g=d-1;const m=S=>S>=2&&r.charCodeAt(S-2)===37&&r.charCodeAt(S-1)===51&&(r.charCodeAt(S)===68||r.charCodeAt(S)===100);g>=0&&(r.charCodeAt(g)===61?(f++,g--):m(g)&&(f++,g-=3)),f===1&&g>=0&&(r.charCodeAt(g)===61||m(g))&&f++;const v=Math.floor(u/4)*3-(f||0);return v>0?v:0}let l=0;for(let u=0,d=r.length;u<d;u++){const f=r.charCodeAt(u);if(f===37&&Y0(r,u,d))l+=1,u+=2;else if(f<128)l+=1;else if(f<2048)l+=2;else if(f>=55296&&f<=56319&&u+1<d){const g=r.charCodeAt(u+1);g>=56320&&g<=57343?(l+=4,u++):l+=3}else l+=3}return l}const _d="1.18.1",Kp=64*1024,{isFunction:Vl}=V,J0=o=>encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(e,n)=>String.fromCharCode(parseInt(n,16))),Wp=o=>{if(!V.isString(o))return o;try{return decodeURIComponent(o)}catch{return o}},Yp=(o,...e)=>{try{return!!o(...e)}catch{return!1}},Q0=o=>{const e=o.indexOf("://");let n=o;return e!==-1&&(n=n.slice(e+3)),n.includes("@")||n.includes(":")},Z0=o=>{const e=V.global!==void 0&&V.global!==null?V.global:globalThis,{ReadableStream:n,TextEncoder:r}=e;o=V.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},o);const{fetch:i,Request:l,Response:u}=o,d=i?Vl(i):typeof fetch=="function",f=Vl(l),g=Vl(u);if(!d)return!1;const m=d&&Vl(n),b=d&&(typeof r=="function"?(O=>M=>O.encode(M))(new r):async O=>new Uint8Array(await new l(O).arrayBuffer())),v=f&&m&&Yp(()=>{let O=!1;const M=new l(pn.origin,{body:new n,method:"POST",get duplex(){return O=!0,"half"}}),T=M.headers.has("Content-Type");return M.body!=null&&M.body.cancel(),O&&!T}),S=g&&m&&Yp(()=>V.isReadableStream(new u("").body)),_={stream:S&&(O=>O.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(O=>{!_[O]&&(_[O]=(M,T)=>{let D=M&&M[O];if(D)return D.call(M);throw new Ce(`Response type '${O}' is not supported`,Ce.ERR_NOT_SUPPORT,T)})});const x=async O=>{if(O==null)return 0;if(V.isBlob(O))return O.size;if(V.isSpecCompliantForm(O))return(await new l(pn.origin,{method:"POST",body:O}).arrayBuffer()).byteLength;if(V.isArrayBufferView(O)||V.isArrayBuffer(O))return O.byteLength;if(V.isURLSearchParams(O)&&(O=O+""),V.isString(O))return(await b(O)).byteLength},k=async(O,M)=>{const T=V.toFiniteNumber(O.getContentLength());return T??x(M)};return async O=>{let{url:M,method:T,data:D,signal:j,cancelToken:H,timeout:P,onDownloadProgress:X,onUploadProgress:pe,responseType:_e,headers:we,withCredentials:Me="same-origin",fetchOptions:qe,maxContentLength:Je,maxBodyLength:gt}=Vp(O);const Q=V.isNumber(Je)&&Je>-1,fe=V.isNumber(gt)&>>-1,ve=de=>V.hasOwnProp(O,de)?O[de]:void 0;let ae=i||fetch;_e=_e?(_e+"").toLowerCase():"text";let ge=V0([j,H&&H.toAbortSignal()],P),A=null;const K=ge&&ge.unsubscribe&&(()=>{ge.unsubscribe()});let ue,he=null;const le=()=>new Ce("Request body larger than maxBodyLength limit",Ce.ERR_BAD_REQUEST,O,A);try{let de;const Oe=ve("auth");if(Oe){const Ee=V.getSafeProp(Oe,"username")||"",Nt=V.getSafeProp(Oe,"password")||"";de={username:Ee,password:Nt}}if(Q0(M)){const Ee=new URL(M,pn.origin);if(!de&&(Ee.username||Ee.password)){const Nt=Wp(Ee.username),zt=Wp(Ee.password);de={username:Nt,password:zt}}(Ee.username||Ee.password)&&(Ee.username="",Ee.password="",M=Ee.href)}if(de&&(we.delete("authorization"),we.set("Authorization","Basic "+btoa(J0((de.username||"")+":"+(de.password||""))))),Q&&typeof M=="string"&&M.startsWith("data:")&&X0(M)>Je)throw new Ce("maxContentLength size of "+Je+" exceeded",Ce.ERR_BAD_RESPONSE,O,A);if(fe&&T!=="get"&&T!=="head"){const Ee=await x(D);if(typeof Ee=="number"&&isFinite(Ee)&&(ue=Ee,Ee>gt))throw le()}const He=fe&&(V.isReadableStream(D)||V.isStream(D)),Pe=(Ee,Nt,zt)=>Fp(Ee,Kp,qt=>{if(fe&&qt>gt)throw he=le();Nt&&Nt(qt)},zt);if(v&&T!=="get"&&T!=="head"&&(pe||He)){if(ue=ue??await k(we,D),ue!==0||He){let Ee=new l(M,{method:"POST",body:D,duplex:"half"}),Nt;if(V.isFormData(D)&&(Nt=Ee.headers.get("content-type"))&&we.setContentType(Nt),Ee.body){const[zt,qt]=pe&&Up(ue,ql(Bp(pe)))||[];D=Pe(Ee.body,zt,qt)}}}else if(He&&!f&&m&&T!=="get"&&T!=="head")D=Pe(D);else if(He&&f&&!v&&T!=="get"&&T!=="head")throw new Ce("Stream request bodies are not supported by the current fetch implementation",Ce.ERR_NOT_SUPPORT,O,A);V.isString(Me)||(Me=Me?"include":"omit");const ke=f&&"credentials"in l.prototype;if(V.isFormData(D)){const Ee=we.getContentType();Ee&&/^multipart\/form-data/i.test(Ee)&&!/boundary=/i.test(Ee)&&we.delete("content-type")}we.set("User-Agent","axios/"+_d,!1);const Ot={...qe,signal:ge,method:T.toUpperCase(),headers:Tp(we.normalize()),body:D,duplex:"half",credentials:ke?Me:void 0};A=f&&new l(M,Ot);let ut=await(f?ae(A,qe):ae(M,Ot));const Ct=Cn.from(ut.headers);if(Q){const Ee=V.toFiniteNumber(Ct.getContentLength());if(Ee!=null&&Ee>Je)throw new Ce("maxContentLength size of "+Je+" exceeded",Ce.ERR_BAD_RESPONSE,O,A)}const vt=S&&(_e==="stream"||_e==="response");if(S&&ut.body&&(X||Q||vt&&K)){const Ee={};["status","statusText","headers"].forEach(hn=>{Ee[hn]=ut[hn]});const Nt=V.toFiniteNumber(Ct.getContentLength()),[zt,qt]=X&&Up(Nt,ql(Bp(X),!0))||[];let Lt=0;const _n=hn=>{if(Q&&(Lt=hn,Lt>Je))throw new Ce("maxContentLength size of "+Je+" exceeded",Ce.ERR_BAD_RESPONSE,O,A);zt&&zt(hn)};ut=new u(Fp(ut.body,Kp,_n,()=>{qt&&qt(),K&&K()}),Ee)}_e=_e||"text";let kt=await _[V.findKey(_,_e)||"text"](ut,O);if(Q&&!S&&!vt){let Ee;if(kt!=null&&(typeof kt.byteLength=="number"?Ee=kt.byteLength:typeof kt.size=="number"?Ee=kt.size:typeof kt=="string"&&(Ee=typeof r=="function"?new r().encode(kt).byteLength:kt.length)),typeof Ee=="number"&&Ee>Je)throw new Ce("maxContentLength size of "+Je+" exceeded",Ce.ERR_BAD_RESPONSE,O,A)}return!vt&&K&&K(),await new Promise((Ee,Nt)=>{jp(Ee,Nt,{data:kt,headers:Cn.from(ut.headers),status:ut.status,statusText:ut.statusText,config:O,request:A})})}catch(de){if(K&&K(),ge&&ge.aborted&&ge.reason instanceof Ce){const Oe=ge.reason;throw Oe.config=O,A&&(Oe.request=A),de!==Oe&&Object.defineProperty(Oe,"cause",{__proto__:null,value:de,writable:!0,enumerable:!1,configurable:!0}),Oe}if(he)throw A&&!he.request&&(he.request=A),he;if(de instanceof Ce)throw A&&!de.request&&(de.request=A),de;if(de&&de.name==="TypeError"&&/Load failed|fetch/i.test(de.message)){const Oe=new Ce("Network Error",Ce.ERR_NETWORK,O,A,de&&de.response);throw Object.defineProperty(Oe,"cause",{__proto__:null,value:de.cause||de,writable:!0,enumerable:!1,configurable:!0}),Oe}throw Ce.from(de,de&&de.code,O,A,de&&de.response)}}},eC=new Map,Xp=o=>{let e=o&&o.env||{};const{fetch:n,Request:r,Response:i}=e,l=[r,i,n];let u=l.length,d=u,f,g,m=eC;for(;d--;)f=l[d],g=m.get(f),g===void 0&&m.set(f,g=d?new Map:Z0(e)),m=g;return g};Xp();const Ad={http:b0,xhr:G0,fetch:{get:Xp}};V.forEach(Ad,(o,e)=>{if(o){try{Object.defineProperty(o,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(o,"adapterName",{__proto__:null,value:e})}});const Jp=o=>`- ${o}`,tC=o=>V.isFunction(o)||o===null||o===!1;function nC(o,e){o=V.isArray(o)?o:[o];const{length:n}=o;let r,i;const l={};for(let u=0;u<n;u++){r=o[u];let d;if(i=r,!tC(r)&&(i=Ad[(d=String(r)).toLowerCase()],i===void 0))throw new Ce(`Unknown adapter '${d}'`);if(i&&(V.isFunction(i)||(i=i.get(e))))break;l[d||"#"+u]=i}if(!i){const u=Object.entries(l).map(([f,g])=>`adapter ${f} `+(g===!1?"is not supported by the environment":"is not available in the build"));let d=n?u.length>1?`since :
|
||
`+u.map(Jp).join(`
|
||
`):" "+Jp(u[0]):"as no adapter specified";throw new Ce("There is no suitable adapter to dispatch the request "+d,Ce.ERR_NOT_SUPPORT)}return i}const Qp={getAdapter:nC,adapters:Ad};function xd(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new lo(null,o)}function Zp(o){return xd(o),o.headers=Cn.from(o.headers),o.data=Ed.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",!1),Qp.getAdapter(o.adapter||oo.adapter,o)(o).then(function(r){xd(o),o.response=r;try{r.data=Ed.call(o,o.transformResponse,r)}finally{delete o.response}return r.headers=Cn.from(r.headers),r},function(r){if(!zp(r)&&(xd(o),r&&r.response)){o.response=r.response;try{r.response.data=Ed.call(o,o.transformResponse,r.response)}finally{delete o.response}r.response.headers=Cn.from(r.response.headers)}return Promise.reject(r)})}const Fl={};["object","boolean","number","function","string","symbol"].forEach((o,e)=>{Fl[o]=function(r){return typeof r===o||"a"+(e<1?"n ":" ")+o}});const em={};Fl.transitional=function(e,n,r){function i(l,u){return"[Axios v"+_d+"] Transitional option '"+l+"'"+u+(r?". "+r:"")}return(l,u,d)=>{if(e===!1)throw new Ce(i(u," has been removed"+(n?" in "+n:"")),Ce.ERR_DEPRECATED);return n&&!em[u]&&(em[u]=!0,console.warn(i(u," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(l,u,d):!0}},Fl.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function aC(o,e,n){if(typeof o!="object"||o===null)throw new Ce("options must be an object",Ce.ERR_BAD_OPTION_VALUE);const r=Object.keys(o);let i=r.length;for(;i-- >0;){const l=r[i],u=Object.prototype.hasOwnProperty.call(e,l)?e[l]:void 0;if(u){const d=o[l],f=d===void 0||u(d,l,o);if(f!==!0)throw new Ce("option "+l+" must be "+f,Ce.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ce("Unknown option "+l,Ce.ERR_BAD_OPTION)}}const Kl={assertOptions:aC,validators:Fl},En=Kl.validators;let gi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new $p,response:new $p}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const l=(()=>{if(!i.stack)return"";const u=i.stack.indexOf(`
|
||
`);return u===-1?"":i.stack.slice(u+1)})();try{if(!r.stack)r.stack=l;else if(l){const u=l.indexOf(`
|
||
`),d=u===-1?-1:l.indexOf(`
|
||
`,u+1),f=d===-1?"":l.slice(d+1);String(r.stack).endsWith(f)||(r.stack+=`
|
||
`+l)}}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=hi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:l}=n;r!==void 0&&Kl.assertOptions(r,{silentJSONParsing:En.transitional(En.boolean),forcedJSONParsing:En.transitional(En.boolean),clarifyTimeoutError:En.transitional(En.boolean),legacyInterceptorReqResOrdering:En.transitional(En.boolean),advertiseZstdAcceptEncoding:En.transitional(En.boolean),validateStatusUndefinedResolves:En.transitional(En.boolean)},!1),i!=null&&(V.isFunction(i)?n.paramsSerializer={serialize:i}:Kl.assertOptions(i,{encode:En.function,serialize:En.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Kl.assertOptions(n,{baseUrl:En.spelling("baseURL"),withXsrfToken:En.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=l&&V.merge(l.common,l[n.method]);l&&V.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete l[_]}),n.headers=Cn.concat(u,l);const d=[];let f=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(n)===!1)return;f=f&&x.synchronous;const k=n.transitional||Sd;k&&k.legacyInterceptorReqResOrdering?d.unshift(x.fulfilled,x.rejected):d.push(x.fulfilled,x.rejected)});const g=[];this.interceptors.response.forEach(function(x){g.push(x.fulfilled,x.rejected)});let m,b=0,v;if(!f){const _=[Zp.bind(this),void 0];for(_.unshift(...d),_.push(...g),v=_.length,m=Promise.resolve(n);b<v;)m=m.then(_[b++],_[b++]);return m}v=d.length;let S=n;for(;b<v;){const _=d[b++],x=d[b++];try{S=_(S)}catch(k){x.call(this,k);break}}try{m=Zp.call(this,S)}catch(_){return Promise.reject(_)}for(b=0,v=g.length;b<v;)m=m.then(g[b++],g[b++]);return m}getUri(e){e=hi(this.defaults,e);const n=qp(e.baseURL,e.url,e.allowAbsoluteUrls,e);return Mp(n,e.params,e.paramsSerializer)}};V.forEach(["delete","get","head","options"],function(e){gi.prototype[e]=function(n,r){return this.request(hi(r||{},{method:e,url:n,data:r&&V.hasOwnProp(r,"data")?r.data:void 0}))}}),V.forEach(["post","put","patch","query"],function(e){function n(r){return function(l,u,d){return this.request(hi(d||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:u}))}}gi.prototype[e]=n(),e!=="query"&&(gi.prototype[e+"Form"]=n(!0))});let rC=class HS{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const r=this;this.promise.then(i=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](i);r._listeners=null}),this.promise.then=i=>{let l;const u=new Promise(d=>{r.subscribe(d),l=d}).then(i);return u.cancel=function(){r.unsubscribe(l)},u},e(function(l,u,d){r.reason||(r.reason=new lo(l,u,d),n(r.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 n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new HS(function(i){e=i}),cancel:e}}};function iC(o){return function(n){return o.apply(null,n)}}function sC(o){return V.isObject(o)&&o.isAxiosError===!0}const Td={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Td).forEach(([o,e])=>{Td[e]=o});function tm(o){const e=new gi(o),n=mp(gi.prototype.request,e);return V.extend(n,gi.prototype,e,{allOwnKeys:!0}),V.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return tm(hi(o,i))},n}const Ft=tm(oo);Ft.Axios=gi,Ft.CanceledError=lo,Ft.CancelToken=rC,Ft.isCancel=zp,Ft.VERSION=_d,Ft.toFormData=Pl,Ft.AxiosError=Ce,Ft.Cancel=Ft.CanceledError,Ft.all=function(e){return Promise.all(e)},Ft.spread=iC,Ft.isAxiosError=sC,Ft.mergeConfig=hi,Ft.AxiosHeaders=Cn,Ft.formToJSON=o=>Hp(V.isHTMLForm(o)?new FormData(o):o),Ft.getAdapter=Qp.getAdapter,Ft.HttpStatusCode=Td,Ft.default=Ft;const{Axios:CT,AxiosError:ET,CanceledError:_T,isCancel:AT,CancelToken:xT,VERSION:TT,all:RT,Cancel:kT,isAxiosError:DT,spread:OT,toFormData:LT,AxiosHeaders:MT,HttpStatusCode:$T,formToJSON:NT,getAdapter:IT,mergeConfig:HT,create:zT}=Ft,Rd="g7.identity.redirectStash",Wl=dt("IdentityGuardInterceptor");class wt{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 n=this.deferredResolver;if(!n){Wl.warn("IdentityGuardInterceptor.resolveDeferred 호출됐지만 대기 중인 launcher 가 없습니다. 모달이 launcher 외부에서 열렸는지 확인하세요.");return}this.deferredResolver=null,n(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,n){return e===428&&typeof n=="object"&&n!==null&&n.error_code==="identity_verification_required"}static async handle(e,n,r){this.domainNoticeShown=!1;const i=this.launcher??lC,u=!!(r&&(r.email||r.phone))?{...e.verification,target:r}:e.verification,d=await i(u);if(d.status!=="verified")return null;const f=u.return_request;if(!f)return null;const g=oC(f.url,d.token);return fetch(g,{method:f.method,headers:n?.headers??{Accept:"application/json","Content-Type":"application/json"},body:n?.body,credentials:n?.credentials??"same-origin"})}static redirectExternally(e){const n=e.redirect_url;if(!n)return Wl.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 r={return_url:window.location.href,payload:e,stashed_at:Date.now()};try{window.sessionStorage?.setItem(Rd,JSON.stringify(r))}catch(i){Wl.warn("sessionStorage 접근 실패 — stash 없이 redirect 합니다.",i)}window.location.href=n}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}}$(wt,"launcher",null),$(wt,"deferredResolver",null),$(wt,"domainNoticeShown",!1);function oC(o,e){if(!e)return o;try{const n=typeof window<"u"?window.location.origin:"http://localhost",r=new URL(o,n);return r.searchParams.set("verification_token",e),/^https?:\/\//i.test(o)?r.toString():`${r.pathname}${r.search}${r.hash}`}catch{const n=o.includes("?")?"&":"?";return`${o}${n}verification_token=${encodeURIComponent(e)}`}}const lC=async o=>{if(typeof window>"u")return{status:"cancelled"};if(o.render_hint==="external_redirect"||o.redirect_url)return wt.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 n=window.location.href,r={return_url:n,payload:o,stashed_at:Date.now()};try{window.sessionStorage?.setItem(Rd,JSON.stringify(r))}catch{}const i=`/identity/challenge?return=${encodeURIComponent(n)}`;try{await e.dispatch({handler:"navigate",params:{path:i}})}catch(l){Wl.warn("navigate 실패 — window.location 으로 폴백",l),window.location.href=i}return new Promise(()=>{})},cC=dt("ApiClient");function kd(){return typeof window<"u"&&window.__G7_DEVTOOLS__?window.__G7_DEVTOOLS__:null}class uC{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=Ft.create({baseURL:this.config.baseURL,timeout:this.config.timeout,headers:{"Content-Type":"application/json",Accept:"application/json"},paramsSerializer:{serialize:n=>{const r=[];for(const[i,l]of Object.entries(n))if(l!=null)if(Array.isArray(l)){const u=i.endsWith("[]")?i:`${i}[]`;for(const d of l)r.push(`${encodeURIComponent(u)}=${encodeURIComponent(String(d))}`)}else r.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(l))}`);return r.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 n=this.getToken();if(n&&e.headers&&(e.headers.Authorization=`Bearer ${n}`),typeof window<"u"&&e.headers){const i=localStorage.getItem("g7_locale");i&&(e.headers["Accept-Language"]=i)}const r=kd();if(r?.isEnabled()){const i=this.buildFullUrl(e),l=(e.method||"GET").toUpperCase(),u=r.trackRequest(i,l,{requestBody:e.data});e._devToolsRequestId=u}return e},e=>Promise.reject(e)),this.client.interceptors.response.use(e=>{const n=e.config,r=n._devToolsRequestId;if(r){const i=kd();i?.isEnabled()&&i.completeRequest(r,e.status,e.data),n._devToolsRequestId=null}return e},async e=>{const n=e.config,r=n?.url||"",l=["/auth/","/layouts/"].some(u=>r.includes(u));if(e.response?.status===401&&!n?._retry&&!l){if(n._retry=!0,await ga.getInstance().refreshToken()){const f=this.getToken();return f&&(n.headers.Authorization=`Bearer ${f}`),n._devToolsRequestId=null,this.client(n)}return this.completeDevToolsRequest(n,e),this.removeToken(),this.config.onUnauthorized&&this.config.onUnauthorized(),Promise.reject(e)}if(e.response?.status===401&&l)return this.completeDevToolsRequest(n,e),Promise.reject(e);if(wt.isIdentityRequired(e.response?.status,e.response?.data)){this.completeDevToolsRequest(n,e);const u={},d=n?.headers??{};for(const[v,S]of Object.entries(d))typeof S=="string"&&(u[v]=S);let f;n?.data!==void 0&&n?.data!==null&&(f=typeof n.data=="string"?n.data:JSON.stringify(n.data),u["Content-Type"]=u["Content-Type"]??"application/json");const g=n?.identity_target,m=await wt.handle(e.response.data,{headers:u,body:f,credentials:"same-origin"},g);if(!m)return Promise.reject(e);let b=null;try{b=await m.json()}catch{b=null}return m.ok?{...e.response,status:m.status,data:b}:Promise.reject(Object.assign(new Error("replay failed"),{response:{status:m.status,data:b}}))}return e.response?.status===403?(this.completeDevToolsRequest(n,e),this.callOnError(e),Promise.reject(e)):(this.completeDevToolsRequest(n,e),e.response&&this.callOnError(e),Promise.reject(e))})}async get(e,n){return(await this.client.get(e,n)).data}async post(e,n,r){return(await this.client.post(e,n,r)).data}async put(e,n,r){return(await this.client.put(e,n,r)).data}async patch(e,n,r){return(await this.client.patch(e,n,r)).data}async delete(e,n){return(await this.client.delete(e,n)).data}getInstance(){return this.client}setOnUnauthorized(e){this.config.onUnauthorized=e}setOnError(e){this.config.onError=e}completeDevToolsRequest(e,n){if(!e?._devToolsRequestId)return;const r=kd();if(!r?.isEnabled())return;const i=e._devToolsRequestId;e._devToolsRequestId=null,n.response?r.completeRequest(i,n.response.status,n.response.data):n.request?r.failRequest(i,n.message||"Network error"):r.failRequest(i,n.message||"Request error")}buildFullUrl(e){let n=e.url||"";if(e.baseURL&&!n.startsWith("http")&&(n=`${e.baseURL}${n.startsWith("/")?"":"/"}${n}`),e.params&&typeof e.params=="object"){const r=e.params,i=[];for(const[l,u]of Object.entries(r))if(u!=null)if(Array.isArray(u)){const d=l.endsWith("[]")?l:`${l}[]`;for(const f of u)i.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(f))}`)}else i.push(`${encodeURIComponent(l)}=${encodeURIComponent(String(u))}`);i.length>0&&(n+=(n.includes("?")?"&":"?")+i.join("&"))}return n}callOnError(e){if(!this.config.onError)return;const n={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(n)}catch(r){cC.error("Error in onError handler:",r)}}}let Dd=null;function Ia(){return Dd||(Dd=new uC),Dd}const co=dt("AuthManager");function is(o,e,n,r){try{window.G7Core?.devTools?.trackAuthEvent?.(o,e,n,r)}catch{}}const Yl={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"}},Ca=class Ca{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",Yl.admin),this.config.set("user",Yl.user)}static getInstance(){return Ca.instance||(Ca.instance=new Ca),Ca.instance}on(e,n){this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e).push(n)}emit(e,...n){const r=this.eventHandlers.get(e);r&&r.forEach(i=>i(...n))}isAuthenticated(){return this.state.isAuthenticated}getUser(){return this.state.user}getAuthType(){return this.state.type}async checkAuth(e){const n=Ia();if(!n.getToken())return this.clearState(),!1;const i=this.config.get(e);if(!i)return co.error(`Unknown auth type: ${e}`),!1;try{const l=await n.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(n){return co.warn(`Preload auth failed for type ${e}:`,n),!1}}async login(e,n,r){const i=Ia();if(!this.config.get(e))throw new Error(`Unknown auth type: ${e}`);const u=e==="admin"?Yl.admin.loginEndpoint:Yl.user.loginEndpoint;try{const d=r?.headers?{headers:r.headers}:void 0,f=await i.post(u,n,d);if(f.success&&f.data){i.setToken(f.data.token);const g=f.data.user.language,m=localStorage.getItem(Ca.LOCALE_STORAGE_KEY),b=g&&g!==m;if(g)try{localStorage.setItem(Ca.LOCALE_STORAGE_KEY,g)}catch(v){co.warn("Failed to save user language to localStorage:",v)}return this.state={isAuthenticated:!0,user:f.data.user,type:e},this.emit("login",this.state),this.emit("authStateChange",this.state),is("login",!0,void 0,{userId:f.data.user.uuid,email:f.data.user.email,type:e}),b&&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,is("login",!1,g.message,{type:e,status:d.response?.status}),g}}async logout(){const e=Ia(),n=this.state.type?this.config.get(this.state.type):null;try{n&&await e.post(n.logoutEndpoint)}catch(r){co.warn("Logout API call failed:",r)}finally{e.removeToken();const r={...this.state};if(this.clearState(),this.emit("logout",r),this.emit("authStateChange",this.state),is("logout",!0,void 0,{previousType:r.type}),n&&r.type){const i=window.location.pathname+window.location.search;window.location.href=this.getLoginRedirectUrl(r.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 n=this.config.get(e);if(!n)return!1;const r=Ia();try{const i=await r.post(n.refreshEndpoint);return i.success&&i.data?.token?(r.setToken(i.data.token),this.emit("tokenRefreshed"),is("token-refresh",!0,void 0,{type:e}),!0):(is("token-refresh",!1,"No token in response",{type:e}),!1)}catch(i){return co.error("Token refresh failed:",i),is("token-refresh",!1,i instanceof Error?i.message:"Unknown error",{type:e}),!1}}getLoginRedirectUrl(e,n,r){const i=this.config.get(e);if(!i)return"/login";const l=encodeURIComponent(n);let u=`${i.loginPath}?redirect=${l}`;return r&&(u+=`&reason=${encodeURIComponent(r)}`),u}updateConfig(e,n){if(n.loginPath!==void 0){const i=n.loginPath;if(!i.startsWith("/")||i.startsWith("//"))throw new Error(`AuthManager.updateConfig: loginPath must be a same-origin path starting with '/' (got: ${i})`)}const r=this.config.get(e);r&&this.config.set(e,{...r,...n})}getRedirectUrl(e){const r=this.config.get(e)?.defaultPath||"/",l=new URLSearchParams(window.location.search).get("redirect");if(l)try{const u=decodeURIComponent(l);if(u.startsWith("/"))return u}catch{}return r}getConfig(e){return this.config.get(e)}clearState(){this.state={isAuthenticated:!1,user:null,type:null}}static resetInstance(){Ca.instance=null}};$(Ca,"instance"),$(Ca,"LOCALE_STORAGE_KEY","g7_locale");let ga=Ca;const nm={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}}"}}},Qa={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,n){if(o.handler!=="showErrorPage"||o.params?.errorCode!==void 0)return o;const r=typeof e=="string"?parseInt(e,10):e,i=isNaN(r)?n:r;return i===void 0?o:{...o,params:{...o.params,errorCode:i}}}},pa=dt("ErrorHandlingResolver"),kr=class kr{constructor(){$(this,"templateErrorHandling",null);$(this,"layoutErrorHandling",null);$(this,"executeAction",null)}static getInstance(){return kr.instance||(kr.instance=new kr),kr.instance}static resetInstance(){kr.instance=null}setTemplateConfig(e){this.templateErrorHandling=e,pa.log("Template config set:",e)}setLayoutConfig(e){this.layoutErrorHandling=e,pa.log("Layout config set:",e)}setActionExecutor(e){this.executeAction=e}resolve(e,n={}){const{errorHandling:r,onError:i}=n;pa.log("Resolving error:",e,{hasActionErrorHandling:!!r,hasActionOnError:!!i,hasLayoutConfig:!!this.layoutErrorHandling,hasTemplateConfig:!!this.templateErrorHandling});let l=Qa.findHandler(r,e);if(l){const u=this.getMatchedKey(r,e);return{handler:Qa.injectErrorCode(l,u,e),level:"action",matchedKey:u}}if(i){const u=Qa.normalizeOnError(i);if(u.length>0)return{handler:u.length===1?u[0]:{handler:"sequence",actions:u},level:"action",matchedKey:"onError"}}if(l=Qa.findHandler(this.layoutErrorHandling||void 0,e),l){const u=this.getMatchedKey(this.layoutErrorHandling,e);return{handler:Qa.injectErrorCode(l,u,e),level:"layout",matchedKey:u}}if(l=Qa.findHandler(this.templateErrorHandling||void 0,e),l){const u=this.getMatchedKey(this.templateErrorHandling,e);return{handler:Qa.injectErrorCode(l,u,e),level:"template",matchedKey:u}}if(l=Qa.findHandler(nm,e),l){const u=this.getMatchedKey(nm,e);return{handler:Qa.injectErrorCode(l,u,e),level:"system",matchedKey:u}}return{handler:null,level:null,matchedKey:null}}async execute(e,n){if(!this.executeAction){pa.error("Action executor is not set");return}pa.log("Executing handler:",e.handler,{errorContext:n});try{return await this.executeAction(e,{error:n})}catch(r){throw pa.error("Failed to execute handler:",r),r}}async resolveAndExecute(e,n,r={}){const i=this.resolve(e,r);if(pa.log("Resolve result:",{errorCode:e,handler:i.handler?.handler,level:i.level,matchedKey:i.matchedKey}),!i.handler)return pa.warn("No handler found for error:",e),{handled:!1};try{return{handled:!0,result:await this.execute(i.handler,n)}}catch(l){return pa.error("Handler execution failed:",l),{handled:!1}}}getMatchedKey(e,n){return e[n]?n:e[String(n)]?String(n):"default"}clearLayoutConfig(){this.layoutErrorHandling=null,pa.log("Layout config cleared")}clearAllConfig(){this.templateErrorHandling=null,this.layoutErrorHandling=null,pa.log("All config cleared")}getConfigStatus(){return{hasTemplate:this.templateErrorHandling!==null,hasLayout:this.layoutErrorHandling!==null,hasExecutor:this.executeAction!==null}}};$(kr,"instance",null);let Od=kr;function ma(){return Od.getInstance()}var Ld={exports:{}},uo={};var am;function dC(){if(am)return uo;am=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,l){var u=null;if(l!==void 0&&(u=""+l),i.key!==void 0&&(u=""+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:r,key:u,ref:i!==void 0?i:null,props:l}}return uo.Fragment=e,uo.jsx=n,uo.jsxs=n,uo}var rm;function fC(){return rm||(rm=1,Ld.exports=dC()),Ld.exports}var ft=fC();const hC=Ya({__proto__:null,default:Xa(ft)},[ft]),Md=dt("ParentContextProvider"),im=I.createContext(null);let Xl=null;function $d(){Xl?(Md.log("[triggerModalParentUpdate] 모달 부모 컨텍스트 업데이트 트리거"),Xl()):Md.warn("[triggerModalParentUpdate] Provider가 아직 마운트되지 않음")}const sm=({children:o})=>{const[e,n]=I.useState(0),r=I.useRef(!0),i=I.useCallback(()=>{const u=window.__g7LayoutContextStack||[];return u[u.length-1]?.dataContext},[]);I.useEffect(()=>(r.current=!0,Xl=()=>{r.current&&(n(u=>u+1),Md.log("[ParentContextProvider] 버전 업데이트됨"))},()=>{r.current=!1,Xl=null}),[]);const l={version:e,getParentDataContext:i};return ft.jsx(im.Provider,{value:l,children:o})};function gC(){return I.useContext(im)}const z=dt("ActionDispatcher"),om=new Set(["navigate","navigateBack","navigateForward","replaceUrl","refresh","logout"]),pC=new Set(["redirect"]);function qn(){try{return window.G7Core?.devTools}catch{return}}class Ut extends Error{constructor(n,r,i){super(n);$(this,"action");$(this,"originalError");$(this,"unknownHandler",!1);this.action=r,this.originalError=i,this.name="ActionError"}}const gs=class gs{constructor(e={},n,r){$(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 Rn,this.translationEngine=n,this.translationContext=r,this.defaultContext=e,this.registerDefaultHandlers(),this.setupErrorHandling()}setGlobalHeaders(e){this.globalHeaders=e||[]}setNamedActions(e){this.namedActions=e||{};const n=qn();n?.isEnabled?.()&&n.setNamedActionDefinitions?.(this.namedActions),z.log("[setNamedActions] registered:",Object.keys(this.namedActions))}getNamedActions(){return this.namedActions}setPreviewMode(e){this.previewMode=e,z.log("Preview mode:",e?"enabled":"disabled")}isPreviewMode(){return this.previewMode}static getPreviewSuppressedHandlers(){return om}static getPreviewSuppressedLayoutFeatures(){return pC}resolveActionRef(e){if(!e.actionRef)return e;const n=this.namedActions[e.actionRef];if(!n)return z.warn(`[resolveActionRef] named action not found: "${e.actionRef}"`),e;const r=qn();r?.isEnabled?.()&&r.trackNamedActionRef?.({actionRefName:e.actionRef,resolvedHandler:n.handler,timestamp:Date.now()});const{actionRef:i,type:l,key:u,event:d,...f}=e,g={...n,...Object.fromEntries(Object.entries(f).filter(([,m])=>m!==void 0)),type:l??n.type};return u!==void 0&&(g.key=u),d!==void 0&&(g.event=d),g}matchesPattern(e,n){if(n==="*")return!0;const r=n.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(e)}getMatchingGlobalHeaders(e,n){const r={};for(const i of this.globalHeaders)this.matchesPattern(e,i.pattern)&&Object.entries(i.headers).forEach(([l,u])=>{const d=Zi(u,n,{skipCache:!0});d!=null&&d!==""&&(r[l]=String(d))});return r}setupErrorHandling(){if(this.errorHandlingSetup)return;ma().setActionExecutor(async(n,r)=>{const i={type:"click",handler:n.handler,target:n.target,params:n.params,actions:n.actions},l={data:{...this.defaultContext.data,error:r.error}};return await this.dispatchAction(i,l)}),this.errorHandlingSetup=!0}registerDefaultHandlers(){this.registerHandler("refetchDataSource",async(n,r)=>{const i=n.params?.dataSourceId,l=n.params?.sync;if(!i){z.warn("refetchDataSource: dataSourceId is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.refetch){const u=window.G7Core?.state?.get?.()||{},d={...r.state?._global,...u},f=window.G7Core?.state?.getLocal?.()||{},g=r.data?._local||r.state||{},m={...f,...g},b=r.isolatedContext?.state;z.log("[refetchDataSource] localStateOverride:",m),await window.G7Core.dataSource.refetch(i,{...l?{sync:!0}:{},...d?{globalStateOverride:d}:{},...m?{localStateOverride:m}:{},...b?{isolatedStateOverride:b}:{}})}else z.warn("refetchDataSource: G7Core.dataSource.refetch is not available")}),this.registerHandler("appendDataSource",async(n,r)=>{const{dataSourceId:i,dataPath:l,newData:u}=n.params||{};if(!i){z.warn("appendDataSource: dataSourceId is required");return}if(u===void 0){z.warn("appendDataSource: newData is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.updateData){if(!Array.isArray(u)){z.warn("appendDataSource: newData must be an array, got:",typeof u,u);return}await window.G7Core.dataSource.updateData(i,l||null,u,"append")}else z.warn("appendDataSource: G7Core.dataSource.updateData is not available")}),this.registerHandler("updateDataSource",async(n,r)=>{const{dataSourceId:i,data:l,merge:u=!1}=n.params||{};if(!i){z.warn("updateDataSource: dataSourceId is required");return}if(l===void 0){z.warn("updateDataSource: data is required");return}typeof window<"u"&&window.G7Core?.dataSource?.set?(z.log(`[updateDataSource] Updating dataSource '${i}' with:`,l),window.G7Core.dataSource.set(i,l,{merge:u})):z.warn("updateDataSource: G7Core.dataSource.set is not available")}),this.registerHandler("scrollIntoView",async(n,r)=>{const{selector:i,behavior:l="smooth",block:u="nearest",inline:d="nearest",waitForElement:f=!1,timeout:g=2e3,delay:m=0,retryCount:b=0,retryInterval:v=50,scrollContainer:S}=n.params||{};if(!i){z.warn("scrollIntoView: selector is required");return}if(typeof window>"u"||typeof document>"u"){z.warn("scrollIntoView: window/document is not available");return}let _=null;if(f){if(_=await new Promise(x=>{const k=document.querySelector(i);if(k){x(k);return}const O=setTimeout(()=>{M.disconnect(),x(null)},g),M=new MutationObserver(()=>{const T=document.querySelector(i);T&&(clearTimeout(O),M.disconnect(),x(T))});M.observe(document.body,{childList:!0,subtree:!0})}),!_){z.warn(`scrollIntoView: element not found for selector "${i}" after ${g}ms timeout`);return}}else{m>0&&await new Promise(k=>setTimeout(k,m)),_=document.querySelector(i);let x=0;for(;!_&&x<b;)await new Promise(k=>setTimeout(k,v)),_=document.querySelector(i),x++;if(!_){z.warn(`scrollIntoView: element not found for selector "${i}" after ${x+1} attempts`);return}}if(S){const x=document.querySelector(S);if(!x){z.warn(`scrollIntoView: container not found for selector "${S}"`);return}const k=_.getBoundingClientRect(),O=x.getBoundingClientRect(),M=k.top-O.top+x.scrollTop,T=M+k.height;let D;switch(u){case"start":D=M;break;case"center":D=M-x.clientHeight/2+k.height/2;break;case"end":D=T-x.clientHeight;break;default:const j=k.top<O.top,H=k.bottom>O.bottom;if(j)D=M;else if(H)D=T-x.clientHeight;else return;break}x.scrollTo({top:Math.max(0,D),behavior:l});return}_.scrollIntoView({behavior:l,block:u,inline:d})}),this.registerHandler("reloadExtensions",async(n,r)=>{if(typeof window>"u"){z.warn("reloadExtensions: window is not available");return}const i=window.__templateApp;if(!i){z.warn("reloadExtensions: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState()}catch(d){throw z.error("reloadExtensions: reloadExtensionState failed",d),d}else z.warn("reloadExtensions: TemplateApp.reloadExtensionState unavailable");const{moduleInfo:l,pluginInfo:u}=n.params||{};if(l)try{await this.executeAction({handler:"reloadModuleHandlers",params:n.params},r)}catch(d){z.error("reloadExtensions: reloadModuleHandlers failed",d)}if(u)try{await this.executeAction({handler:"reloadPluginHandlers",params:n.params},r)}catch(d){z.error("reloadExtensions: reloadPluginHandlers failed",d)}z.log("reloadExtensions: done")}),this.registerHandler("reloadRoutes",async(n,r)=>{if(typeof window>"u"){z.warn("reloadRoutes: window is not available");return}const i=window.__templateApp;if(!i){z.warn("reloadRoutes: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),z.log("reloadRoutes: delegated to reloadExtensionState")}catch(l){throw z.error("reloadRoutes: Failed to reload routes",l),l}else{const l=i.getRouter?.();l&&(await l.loadRoutes(),z.log("reloadRoutes: Routes reloaded (legacy fallback)"))}}),this.registerHandler("refresh",async(n,r)=>{if(typeof window>"u"){z.warn("refresh: window is not available");return}const i=Number(n.params?.delayMs??0);i>0&&await new Promise(l=>setTimeout(l,i)),window.location.reload()}),this.registerHandler("remount",async(n,r)=>{const{componentId:i}=n.params||{};if(!i){z.warn("remount: componentId parameter is required");return}if(!this.globalStateUpdater){z.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}}),z.log(`remount: ${i} key incremented to ${f+1}`)}),this.registerHandler("reloadTranslations",async(n,r)=>{if(typeof window>"u"){z.warn("reloadTranslations: window is not available");return}const i=window.__templateApp;if(!i){z.warn("reloadTranslations: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),z.log("reloadTranslations: delegated to reloadExtensionState")}catch(l){throw z.error("reloadTranslations: Failed to reload translations",l),l}}),this.registerHandler("reloadModuleHandlers",async(n,r)=>{if(typeof window>"u"){z.warn("reloadModuleHandlers: window is not available");return}const{moduleInfo:i,action:l}=n.params||{};if(!i){z.warn("reloadModuleHandlers: moduleInfo is required");return}const u=i.data||i;if(!u.identifier){z.warn("reloadModuleHandlers: moduleInfo with identifier is required");return}if(!l||l!=="add"&&l!=="remove"){z.warn('reloadModuleHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){z.warn("reloadModuleHandlers: G7Config not available");return}const f=u.identifier;try{if(l==="add"){if(u.assets&&(d.moduleAssets=d.moduleAssets||{},d.moduleAssets[f]=u.assets,z.log(`reloadModuleHandlers: Added assets for ${f}`),u.assets.js)){const g=u.assets.js,m=`module-${f}`;if(document.getElementById(m)){z.warn(`reloadModuleHandlers: Script ${m} already loaded`);return}const b=document.createElement("script");if(b.id=m,b.src=g,b.async=!0,await new Promise((v,S)=>{b.onload=()=>{z.log(`reloadModuleHandlers: Script loaded successfully for ${f}`),v()},b.onerror=()=>{z.error(`reloadModuleHandlers: Failed to load script for ${f}`),S(new Error(`Failed to load module script: ${g}`))},document.head.appendChild(b)}),u.assets.css){const v=u.assets.css,S=`module-css-${f}`;if(!document.getElementById(S)){const _=document.createElement("link");_.id=S,_.rel="stylesheet",_.href=v,document.head.appendChild(_),z.log(`reloadModuleHandlers: CSS loaded for ${f}`)}}}}else if(l==="remove"){d.moduleAssets&&d.moduleAssets[f]&&(delete d.moduleAssets[f],z.log(`reloadModuleHandlers: Removed assets for ${f}`));const g=`module-${f}`,m=document.getElementById(g);m&&(m.remove(),z.log(`reloadModuleHandlers: Removed script for ${f}`));const b=`module-css-${f}`,v=document.getElementById(b);v&&(v.remove(),z.log(`reloadModuleHandlers: Removed CSS for ${f}`))}}catch(g){throw z.error(`reloadModuleHandlers: Failed to ${l} module assets`,g),g}}),this.registerHandler("reloadPluginHandlers",async(n,r)=>{if(typeof window>"u"){z.warn("reloadPluginHandlers: window is not available");return}const{pluginInfo:i,action:l}=n.params||{};if(!i){z.warn("reloadPluginHandlers: pluginInfo is required");return}const u=i.data||i;if(!u.identifier){z.warn("reloadPluginHandlers: pluginInfo with identifier is required");return}if(!l||l!=="add"&&l!=="remove"){z.warn('reloadPluginHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){z.warn("reloadPluginHandlers: G7Config not available");return}const f=u.identifier;try{if(l==="add"){if(u.assets&&(d.pluginAssets=d.pluginAssets||{},d.pluginAssets[f]=u.assets,z.log(`reloadPluginHandlers: Added assets for ${f}`),u.assets.js)){const g=u.assets.js,m=`plugin-${f}`;if(document.getElementById(m)){z.warn(`reloadPluginHandlers: Script ${m} already loaded`);return}const b=document.createElement("script");if(b.id=m,b.src=g,b.async=!0,await new Promise((v,S)=>{b.onload=()=>{z.log(`reloadPluginHandlers: Script loaded successfully for ${f}`),v()},b.onerror=()=>{z.error(`reloadPluginHandlers: Failed to load script for ${f}`),S(new Error(`Failed to load plugin script: ${g}`))},document.head.appendChild(b)}),u.assets.css){const v=u.assets.css,S=`plugin-css-${f}`;if(!document.getElementById(S)){const _=document.createElement("link");_.id=S,_.rel="stylesheet",_.href=v,document.head.appendChild(_),z.log(`reloadPluginHandlers: CSS loaded for ${f}`)}}}}else if(l==="remove"){d.pluginAssets&&d.pluginAssets[f]&&(delete d.pluginAssets[f],z.log(`reloadPluginHandlers: Removed assets for ${f}`));const g=`plugin-${f}`,m=document.getElementById(g);m&&(m.remove(),z.log(`reloadPluginHandlers: Removed script for ${f}`));const b=`plugin-css-${f}`,v=document.getElementById(b);v&&(v.remove(),z.log(`reloadPluginHandlers: Removed CSS for ${f}`))}}catch(g){throw z.error(`reloadPluginHandlers: Failed to ${l} plugin assets`,g),g}});let e=!1;this.registerHandler("showErrorPage",async(n,r)=>{if(e){z.log("showErrorPage: Already active, skipping duplicate call");return}if(e=!0,typeof window>"u"){e=!1,z.warn("showErrorPage: window is not available");return}const i=window.__templateApp;if(!i){e=!1,z.warn("showErrorPage: TemplateApp not initialized");return}const l=i.getErrorPageHandler?.();if(!l){e=!1,z.warn("showErrorPage: ErrorPageHandler not available");return}const u=n.params?.errorCode||500,d=n.params?.target||"content";let f=n.params?.containerId;f||(f=d==="full"?"app":"main_content"),z.log("showErrorPage:",{errorCode:u,target:d,containerId:f});const g=(m,b=6e4)=>new Promise((v,S)=>{const _=document.getElementById(m);if(_){v(_);return}z.log(`showErrorPage: Waiting for container #${m}...`);let x;const k=new MutationObserver((O,M)=>{const T=document.getElementById(m);T&&(z.log(`showErrorPage: Container #${m} found`),M.disconnect(),clearTimeout(x),v(T))});k.observe(document.body,{childList:!0,subtree:!0}),x=setTimeout(()=>{k.disconnect(),S(new Error(`Container #${m} not found within ${b}ms`))},b)});try{await g(f);const m=ma(),b=m.layoutErrorHandling;m.clearLayoutConfig();try{await l.renderError(u,f)||z.warn(`showErrorPage: Failed to render error page for code ${u}`)}finally{m.setLayoutConfig(b)}}catch(m){throw z.error("showErrorPage: Error rendering error page:",m),m}finally{e=!1}}),this.registerHandler("emitEvent",async(n,r)=>{const i=n.params?.event,l=n.params?.data;if(!i){z.warn("emitEvent: event parameter is required");return}if(typeof window>"u"){z.warn("emitEvent: window is not available");return}const u=window.G7Core;if(!u?.componentEvent?.emit){z.warn("emitEvent: G7Core.componentEvent is not available");return}try{z.log(`emitEvent: Emitting "${i}"`,l);const d={...l,_context:{data:r.data,state:r.state}},f=await u.componentEvent.emit(i,d);if(!f||f.length===0?z.warn(`emitEvent: No listeners found for "${i}"`):z.log(`emitEvent: Event "${i}" completed with ${f.length} listener(s)`,f),this.globalStateUpdater){const g=(u?.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 b=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)?r.state:g;window.__g7SequenceLocalSync={...b,_eventResult:m}}}catch(d){if(z.error(`emitEvent: Event "${i}" failed`,d),this.globalStateUpdater){const f=u?.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(n,r)=>{const{productId:i,field:l,value:u}=n.params||{};if(!i||!l){z.warn("updateProductField: productId and field are required");return}if(typeof window>"u"){z.warn("updateProductField: window is not available");return}const d=window.G7Core;if(!d?.state?.get||!this.globalStateUpdater){z.warn("updateProductField: G7Core.state or globalStateUpdater is not available");return}try{const f=d.state.get()||{},m=(f.products?.data?.data||[]).map(v=>v.id===i?{...v,[l]:u,_modified:!0}:v),b=new Set(f._local?.modifiedProductIds||[]);b.add(i),this.globalStateUpdater({products:{...f.products,data:{...f.products?.data,data:m}},_local:{...f._local,modifiedProductIds:Array.from(b)}}),z.log(`updateProductField: Updated product ${i}, field: ${l}, value:`,u)}catch(f){throw z.error("updateProductField: Error updating product field",f),f}}),this.registerHandler("updateOptionField",async(n,r)=>{const{productId:i,optionId:l,field:u,value:d}=n.params||{};if(!i||!l||!u){z.warn("updateOptionField: productId, optionId and field are required");return}if(typeof window>"u"){z.warn("updateOptionField: window is not available");return}const f=window.G7Core;if(!f?.state?.get||!this.globalStateUpdater){z.warn("updateOptionField: G7Core.state or globalStateUpdater is not available");return}try{const g=f.state.get()||{},b=(g.products?.data?.data||[]).map(S=>{if(S.id===i&&S.options){const _=S.options.map(x=>x.id===l?{...x,[u]:d,_modified:!0}:x);return{...S,options:_,_modified:!0}}return S}),v=new Set(g._local?.modifiedProductIds||[]);v.add(i),this.globalStateUpdater({products:{...g.products,data:{...g.products?.data,data:b}},_local:{...g._local,modifiedProductIds:Array.from(v)}}),z.log(`updateOptionField: Updated product ${i} option ${l}, field: ${u}, value:`,d)}catch(g){throw z.error("updateOptionField: Error updating option field",g),g}}),this.registerHandler("setLocale",async(n,r)=>{const i=n.target;if(!i||typeof i!="string"){z.warn("setLocale: Invalid locale:",i);return}const l=window.__templateApp;if(l&&typeof l.changeLocale=="function")try{await l.changeLocale(i),z.log("setLocale: Locale changed to",i)}catch(u){z.error("setLocale: Failed to change locale:",u),window.location.reload()}else{z.warn("setLocale: TemplateApp not found, falling back to page reload");try{localStorage.setItem("g7_locale",i)}catch{}window.location.reload()}}),this.registerHandler("suppress",async()=>{z.log("suppress: Error intentionally suppressed")}),this.registerBuiltInHandlerMetadata()}registerBuiltInHandlerMetadata(){const e=qn();if(!e?.isEnabled())return;const n=[{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 r of n)e.trackHandlerRegistration(r.name,"built-in",r.description)}createHandler(e,n,r){z.log("createHandler called for:",e.handler,e.type);const i=window.__g7DevTools,l=Date.now(),u=r?.state?{...r.state}:null,d=`handler_${e.handler}_${l}`;return async f=>{if(z.log("Handler invoked for:",e.handler,"event:",f.type),i?.isEnabled?.()&&u){const m=window.G7Core?.state?.getLocal?.()??r?.state??{},b=Date.now()-l;for(const v of Object.keys(u)){const S=u[v],_=m[v];S!==_&&b>100&&(i.trackStaleClosureWarning?.({type:"event-handler-stale",location:`createHandler(${e.handler})`,capturedPath:`_local.${v}`,capturedValue:S,capturedAt:l,currentValue:_,actionId:d,stackTrace:new Error().stack}),z.warn(`[Stale Closure] _local.${v} changed after handler creation:`,`captured="${S}" → current="${_}" (${b}ms ago)`))}}try{f.type!=="change"&&f.preventDefault();let g={};if(f.type==="submit"&&f.target instanceof HTMLFormElement){const v=f.target;new FormData(v).forEach((_,x)=>{g[x]=_})}const m={...this.defaultContext,data:{...n,form:g,_local:r?.state||{},$event:f},event:f,...r&&{state:r.state,setState:r.setState},isolatedContext:r?.isolatedContext};if(e.confirm){let v=this.resolveValue(e.confirm,m.data);if(this.translationEngine&&this.translationContext&&v.startsWith("$t:")&&(v=this.translationEngine.resolveTranslations(v,this.translationContext,m.data)),!confirm(v))return}const b=window.__g7ActionContext;window.__g7ActionContext={...r,data:m.data};try{await this.executeAction(e,m)}finally{window.__g7ActionContext=b}}catch(g){if(z.error("Action execution failed:",g),e.onError){const m=g instanceof Ut&&g.originalError?g.originalError:g,b={...this.defaultContext,data:{...n,error:m,_local:r?.state||{},$event:f},event:f,...r&&{state:r.state,setState:r.setState}},v=Array.isArray(e.onError)?e.onError:[e.onError];for(const S of v)await this.executeAction(S,b)}}}}generateActionId(e,n){const r=e.handler,i=n||"no-target",l=Date.now(),u=Math.random().toString(36).substring(2,9);return`${r}_${i.replace(/[^a-zA-Z0-9]/g,"_")}_${l}_${u}`}async executeAction(e,n){if(e=this.resolveActionRef(e),typeof e.handler=="string"&&e.handler.includes("{{")){const f=this.evaluateExpression(e.handler,n.data);e={...e,handler:f==null?"":String(f)}}const r=qn(),i=r?.isEnabled()?`action_${Date.now()}_${Math.random().toString(36).substring(2,11)}`:void 0,l=performance.now();let u;if(i&&r&&r.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),context:this.sanitizeForDevTools({hasState:!!n.state,hasSetState:!!n.setState,dataKeys:n.data?Object.keys(n.data):[]}),startTime:l,status:"started"}),e.if!==void 0)try{const f=this.resolveValue(e.if,n.data),g=f===!0||f==="true"||f&&f!=="false"&&f!=="0"&&f!==!1;if(z.log("[executeAction] if condition result:",e.handler,g),!g)return i&&r&&r.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 z.error("[executeAction] if condition error:",e.handler,f),i&&r&&r.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,n.data);i&&(u=this.sanitizeForDevTools(f));const g=e.target?this.resolveValue(e.target,n.data):void 0;if(e.handler==="apiCall"&&n.setState){d=this.generateActionId(e,g);const b=n.state?.loadingActions||{};n.setState({loadingActions:{...b,[d]:!0}})}if(this.previewMode&&om.has(e.handler))return z.warn(`Preview mode: "${e.handler}" suppressed`,g||f),i&&r&&r.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 b=f.path||g;m=await this.handleNavigate(b,f,n);break;case"navigateBack":m=await this.handleNavigateBack();break;case"navigateForward":m=await this.handleNavigateForward();break;case"openWindow":{const _=f.path||g;m=await this.handleOpenWindow(_,f);break}case"replaceUrl":{const _=f.path||g||window.location.pathname;m=await this.handleReplaceUrl(_,f);break}case"apiCall":if(e.onSuccess&&r?.isEnabled()&&i){const _=window.G7Core,x={};if(_?.state?.get){const k=_.state.get();x._global=k}n.state&&(x._local=n.state),r.registerStateCaptureForHandler?.(i,["_global","_local"],x)}const v=e.auth_mode??(e.auth_required?"required":"none"),S=e.identity_target?this.resolveParams(e.identity_target,n.data):void 0;m=await this.handleApiCall(g,f,n,v,S);break;case"login":m=await this.handleLogin(g,f,n);break;case"logout":m=await this.handleLogout(g,n);break;case"setState":z.log("[executeAction] setState resolvedParams:",f),m=await this.handleSetState(e.render!==void 0?{...f,__render:e.render}:f,n);break;case"setError":m=await this.handleSetError(g,f,n);break;case"openModal":m=await this.handleOpenModal(g,n);break;case"closeModal":m=await this.handleCloseModal(n);break;case"showAlert":m=await this.handleShowAlert(g,n);break;case"toast":m=await this.handleToast(f,n);break;case"switch":m=await this.handleSwitch(e,n);break;case"conditions":m=await this.handleConditions(e,n);break;case"sequence":m=await this.handleSequence(e,n);break;case"parallel":m=await this.handleParallel(e,n);break;case"startInterval":m=this.handleStartInterval(f,n);break;case"stopInterval":m=this.handleStopInterval(f);break;case"loadScript":m=await this.handleLoadScript(f,e,n);break;case"callExternal":m=await this.handleCallExternal(f,e,n);break;case"callExternalEmbed":m=await this.handleCallExternalEmbed(f,e,n);break;case"saveToLocalStorage":m=await this.handleSaveToLocalStorage(f,n);break;case"loadFromLocalStorage":m=await this.handleLoadFromLocalStorage(f,n);break;default:m=await this.handleCustomAction({...e,target:g,params:f},n);break}if(e.resultTo&&m!==void 0){const{target:b,key:v,merge:S}=e.resultTo,_=this.resolveValue(v,n.data),x=S==="replace"?"replace":S==="shallow"?"shallow":"deep";if(b==="_local"&&n.setState){const k=this.buildNestedUpdate(_,m),O=x!=="deep"?{...k,__mergeMode:x}:k;n.setState(O),z.log(`[resultTo] Saved to _local.${_} (merge=${x}):`,m)}else if(b==="_local"&&this.globalStateUpdater){const M=(window.G7Core?.state?.get()||{})._local||{},T=this.buildNestedUpdate(_,m);let D;x==="replace"?D=T:x==="shallow"?D={...M,...T}:D=this.deepMergeWithState(T,M),this.globalStateUpdater({_local:D}),z.log(`[resultTo] Saved to _local.${_} via globalStateUpdater (merge=${x}):`,m)}else if(b==="_global"&&this.globalStateUpdater){const k=this.buildNestedUpdate(_,m);this.globalStateUpdater(k),z.log(`[resultTo] Saved to _global.${_}:`,m)}else if(b==="_isolated"&&n.isolatedContext){const k=this.buildNestedUpdate(_,m);n.isolatedContext.mergeState(k,x),z.log(`[resultTo] Saved to _isolated.${_} (merge=${x}):`,m)}else z.warn(`[resultTo] Cannot save result: target=${b}, setState=${!!n.setState}, globalStateUpdater=${!!this.globalStateUpdater}, isolatedContext=${!!n.isolatedContext}`)}if(e.onSuccess){if(r?.isEnabled()&&i&&e.handler==="apiCall"){const S=window.G7Core,_={};S?.state?.get&&(_._global=S.state.get()),n.state&&(_._local=n.state),r.detectStaleClosure?.(i,`${e.handler} → onSuccess`,_,"callback-state-capture",i)}const b={...n,data:{...n.data,result:m,response:m}},v=Array.isArray(e.onSuccess)?e.onSuccess:[e.onSuccess];v.length>1?await this.handleSequence({handler:"sequence",type:"click",actions:v},b):v.length===1&&await this.executeAction(v[0],b)}return i&&r&&r.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:u,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 Ut?f:new Ut(`Failed to execute action: ${e.handler}`,e,f instanceof Error?f:void 0),m=g.originalError?.response||{},b=m.data||{},v=g.originalError?.status||m.status||500,S=b.message||g.message,_={status:v,message:S,errors:b.errors||m.errors,data:b,statusText:g.originalError?.statusText,error_code:b.error_code??m.error_code};if(g.unknownHandler)throw z.warn(`Unknown action handler "${e.handler}" — skipped (extension not loaded?). Not surfaced to the user.`),g;const k=ma().resolve(v,{errorHandling:e.errorHandling,onError:e.onError});if(k.handler){if(r?.isEnabled()&&i&&e.handler==="apiCall"){const M=window.G7Core,T={};M?.state?.get&&(T._global=M.state.get()),n.state&&(T._local=n.state),r.detectStaleClosure?.(i,`${e.handler} → onError`,T,"callback-state-capture",i)}const O={...n,data:{...n.data,error:_}};try{const M={type:"click",handler:k.handler.handler,target:k.handler.target,params:k.handler.params,actions:k.handler.actions};return await this.executeAction(M,O),{success:!1,error:g}}catch(M){return z.error("Error executing error handler:",M),{success:!1,error:g}}}throw i&&r&&r.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:u,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"&&n.setState&&d){const f=n.state?.loadingActions||{},{[d]:g,...m}=f;n.setState({loadingActions:m})}}}async handleNavigate(e,n,r){let i=e;if(n.query||n.mergeQuery===!0)if(n.mergeQuery===!0)i=this.buildMergedQueryPath(e,n.query??{});else{const u=new URLSearchParams;for(const[f,g]of Object.entries(n.query))if(g!=null&&g!=="")if(Array.isArray(g)){const m=f.endsWith("[]")?f:`${f}[]`;for(const b of g)b!=null&&b!==""&&u.append(m,String(b))}else u.set(f,String(g));const d=u.toString();d&&(i=`${e}?${d}`)}if(z.log("handleNavigate:",{target:e,params:n,finalPath:i,replace:n.replace,windowLocationSearch:window.location.search}),n.replace===!0){const u=window.G7Core;if(u?.updateQueryParams){const d=typeof n.transition_overlay_target=="string"?n.transition_overlay_target:void 0;await u.updateQueryParams(i,d?{transitionOverlayTarget:d}:void 0),z.log("handleNavigate: Used updateQueryParams for replace mode",d?{transitionOverlayTarget:d}:void 0),this.applyScrollOption(n.scroll,n.scrollBehavior,"top");return}z.warn("handleNavigate: G7Core.updateQueryParams not available, falling back to React Router")}const l=this.resolveNavigateFallbackAction(i,n);if(l){z.warn(`handleNavigate: No route matched, falling back to "${l.handler}"`),await this.dispatchAction({type:"click",handler:l.handler,params:l.params},r),this.applyScrollOption(n.scroll,n.scrollBehavior,"top");return}if(!r.navigate)throw new Ut("Navigate function is not provided in context");r.navigate(i,{replace:n.replace===!0}),this.applyScrollOption(n.scroll,n.scrollBehavior,"top")}resolveNavigateFallbackAction(e,n){const r=n.fallback;if(r===!1||n.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 u=e.split("?")[0];return l.match(u)?null:this.resolveNavigateFallback(r,e,n)}resolveNavigateFallback(e,n,r){return e==null?{handler:"openWindow",params:{path:n,target:"_self"}}:typeof e=="string"?{handler:e,params:{path:n}}:typeof e=="object"&&typeof e.handler=="string"?{handler:e.handler,params:{path:n,...e.params||{}}}:(z.warn("resolveNavigateFallback: unrecognized fallback option, using openWindow",e),{handler:"openWindow",params:{path:n,target:"_blank"}})}applyScrollOption(e,n,r){const i=e===void 0?r:e;if(i==="preserve")return;const l=n==="smooth"?"smooth":"instant",u=b=>{if(typeof b!="object"||b===null)return!1;const v=b;return"container"in v||"to"in v||"block"in v||"offset"in v},d=(b,v,S=0)=>{b===window?window.scrollTo({top:v,left:S,behavior:l}):b.scrollTo({top:v,left:S,behavior:l})},f=(b,v,S,_)=>{if(v===window){b.scrollIntoView({behavior:l,block:S}),_&&window.scrollBy({top:-_,left:0,behavior:l});return}const x=v,k=b.getBoundingClientRect(),O=x.getBoundingClientRect(),M=x.scrollTop+(k.top-O.top);let T;S==="center"?T=M-(x.clientHeight-b.clientHeight)/2:S==="end"?T=M-(x.clientHeight-b.clientHeight):T=M,T-=_,x.scrollTo({top:Math.max(0,T),left:0,behavior:l})},g=()=>{window.scrollTo({top:0,left:0,behavior:l});const b=document.getElementById("app")??document.body;if(!b)return;b.querySelectorAll("*").forEach(S=>{if(S.scrollTop===0&&S.scrollLeft===0)return;const _=window.getComputedStyle(S),x=_.overflowY,k=_.overflowX;(x==="auto"||x==="scroll"||k==="auto"||k==="scroll")&&S.scrollTo({top:0,left:0,behavior:l})})},m=()=>{try{if(u(i)){const b=i,v=b.block??"start",S=typeof b.offset=="number"?b.offset:0;let _=window;if(typeof b.container=="string"&&b.container.length>0){const k=document.querySelector(b.container);if(!k){z.warn(`applyScrollOption: container not found: ${b.container}`);return}_=k}const x=b.to??"top";if(x==="top"){_===window?g():d(_,0);return}if(typeof x=="number"){d(_,x-S);return}if(typeof x=="object"&&x!==null&&("x"in x||"y"in x)){const{x:k=0,y:O=0}=x;d(_,O-S,k);return}if(typeof x=="string"&&(x.startsWith("#")||x.startsWith("."))){const k=document.querySelector(x);k?f(k,_,v,S):z.warn(`applyScrollOption: target element not found: ${x}`);return}z.warn('applyScrollOption: invalid "to" value in extended form',x);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:b=0,y:v=0}=i;window.scrollTo({top:v,left:b,behavior:l});return}if(typeof i=="string"&&(i.startsWith("#")||i.startsWith("."))){const b=document.querySelector(i);b&&b.scrollIntoView({behavior:l,block:"start"});return}}catch(b){z.warn("applyScrollOption: failed to apply scroll",b)}};typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(m):m()}async handleOpenWindow(e,n){let r=e;if(n.query){const l=new URLSearchParams;for(const[d,f]of Object.entries(n.query))f!=null&&f!==""&&l.set(d,String(f));const u=l.toString();u&&(r=`${e}?${u}`)}const i=n.target==="_self"?"_self":"_blank";z.log("handleOpenWindow:",{target:e,params:n,finalPath:r,windowTarget:i}),i==="_self"?window.location.assign(r):window.open(r,"_blank")}async handleNavigateBack(){z.log("handleNavigateBack"),window.history.back()}async handleNavigateForward(){z.log("handleNavigateForward"),window.history.forward()}async handleReplaceUrl(e,n){let r=e;if(n.query||n.mergeQuery===!0)if(n.mergeQuery===!0)r=this.buildMergedQueryPath(e,n.query??{});else{const i=new URLSearchParams;for(const[u,d]of Object.entries(n.query))if(d!=null&&d!=="")if(Array.isArray(d)){const f=u.endsWith("[]")?u:`${u}[]`;for(const g of d)g!=null&&g!==""&&i.append(f,String(g))}else i.set(u,String(d));const l=i.toString();l&&(r=`${e}?${l}`)}z.log("handleReplaceUrl:",{target:e,params:n,finalPath:r}),window.history.replaceState(null,"",r),this.applyScrollOption(n.scroll,n.scrollBehavior,"preserve")}buildMergedQueryPath(e,n){const r=new URLSearchParams(window.location.search);for(const[u,d]of Object.entries(n))if(d==null||d==="")r.delete(u);else if(Array.isArray(d)){const f=u.endsWith("[]")?u:`${u}[]`;r.delete(u),r.delete(f);for(const g of d)g!=null&&g!==""&&r.append(f,String(g))}else r.set(u,String(d));const i=r.toString(),l=e.split("?")[0];return i?`${l}?${i}`:l}async ensureCsrfToken(){try{await fetch("/sanctum/csrf-cookie",{credentials:"include"})}catch(e){throw new Ut("Failed to fetch CSRF token",void 0,e instanceof Error?e:void 0)}}getCsrfTokenFromCookie(){const r=`; ${document.cookie}`.split("; XSRF-TOKEN=");if(r.length===2){const i=r.pop()?.split(";").shift();return i?decodeURIComponent(i):null}return null}buildQueryString(e){const n=new URLSearchParams;for(const[r,i]of Object.entries(e))if(!(i==null||i===""))if(Array.isArray(i))for(const l of i)l!=null&&l!==""&&n.append(`${r}[]`,String(l));else typeof i=="object"?n.append(r,JSON.stringify(i)):n.append(r,String(i));return n.toString()}async handleEnsureIdentityVerified(e){const n=typeof e.purpose=="string"?e.purpose:"sensitive_action",r=e.target&&typeof e.target=="object"?e.target:void 0;return await wt.handle({success:!1,error_code:"identity_verification_required",message:"",verification:{policy_key:e.policy_key??"",purpose:n,provider_id:e.provider_id??null,render_hint:e.render_hint??null,return_request:null}},void 0,r)!==null}handleResolveIdentityChallenge(e){const n=typeof e.result=="string"?e.result:"cancelled";let r;switch(n){case"verified":{const i=typeof e.token=="string"?e.token:"";if(!i){z.warn("resolveIdentityChallenge: result=verified 인데 token 이 비어있습니다. failed 로 강등합니다."),r={status:"failed",failureCode:"MISSING_TOKEN"};break}r={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){z.warn("resolveIdentityChallenge: result=pending 인데 pollUrl/expiresAt 누락 — failed 로 강등합니다."),r={status:"failed",failureCode:"MALFORMED_PENDING"};break}r={status:"pending",pollUrl:i,pollIntervalMs:typeof e.pollIntervalMs=="number"?e.pollIntervalMs:void 0,expiresAt:l};break}case"failed":r={status:"failed",failureCode:typeof e.failureCode=="string"?e.failureCode:"UNKNOWN",reason:typeof e.reason=="string"?e.reason:void 0};break;default:r={status:"cancelled"};break}return wt.resolveDeferred(r),!0}async handleApiCall(e,n,r,i="none",l){const{method:u="GET",body:d,headers:f,contentType:g}=n;u!=="GET"&&u!=="HEAD"&&await this.ensureCsrfToken();const m=this.getCsrfTokenFromCookie();let b={};if(i==="required"||i==="optional"){const X=Ia().getToken();X&&(b={Authorization:`Bearer ${X}`})}let v=e;const S=n.query||(u==="GET"?d:null);if(S&&typeof S=="object"){const P=this.buildQueryString(S);if(P){const X=e.includes("?")?"&":"?";v=`${e}${X}${P}`}}const _=window.G7Core?.state?.getGlobal?.()||r.state?._global||{},x=window.G7Core?.state?.getLocal?.()||r.state?._local||{},k={_global:_,_local:x},O=this.getMatchingGlobalHeaders(e,k),M={};if(typeof window<"u"){const P=localStorage.getItem("g7_locale");P&&(M["Accept-Language"]=P)}const T=g==="multipart/form-data",D={method:u,headers:{...T?{}:{"Content-Type":"application/json"},Accept:"application/json",...M,...m&&{"X-XSRF-TOKEN":m},...b,...O,...f},credentials:"include"};if(d&&u!=="GET")if(T){const P=new FormData;for(const[X,pe]of Object.entries(d))pe instanceof File||pe instanceof Blob?P.append(X,pe):pe!=null&&P.append(X,typeof pe=="object"?JSON.stringify(pe):String(pe));D.body=P}else D.body=JSON.stringify(d);const j=qn();let H=null;j?.isEnabled()&&(H=j.trackRequest(v,u));try{let P=await fetch(v,D),X;try{X=await P.json()}catch{X=null}if(wt.isIdentityRequired(P.status,X)){const pe=await wt.handle(X,{body:D.body,headers:D.headers,credentials:D.credentials},l);if(pe){P=pe;try{X=await P.json()}catch{X=null}}}if(H&&j?.isEnabled()&&(j.completeRequest(H,P.status,X),H=null),!P.ok){const pe=X||{},_e=new Error(pe.message||`API call failed: ${P.statusText}`);throw _e.response=pe,_e.status=P.status,_e.statusText=P.statusText,new Ut(pe.message||`API call failed: ${P.statusText}`,void 0,_e)}return X}catch(P){throw H&&j?.isEnabled()&&j.failRequest(H,P instanceof Error?P.message:String(P)),P}}async handleLogin(e,n,r){const{body:i}=n;if(!i||!i.email||!i.password)throw new Ut("Login requires email and password in body params");const l=e==="user"?"user":"admin",u=l==="admin"?"/api/auth/admin/login":"/api/auth/login",d=window.G7Core?.state?.getGlobal?.()||r.state?._global||{},f=window.G7Core?.state?.getLocal?.()||r.state?._local||{},g={_global:d,_local:f},m=this.getMatchingGlobalHeaders(u,g),b=ga.getInstance();try{const v=Object.keys(m).length>0?{headers:m}:void 0;return{user:await b.login(l,{email:i.email,password:i.password},v)}}catch(v){const S=v.message||"Login failed",_=new Error(S);throw _.response=v.response?.data||{},_.status=v.status||v.response?.status||500,new Ut(S,void 0,_)}}async handleLogout(e,n){await ga.getInstance().logout()}async handleSetState(e,n){z.log("[handleSetState] START, params:",e);const{target:r="component",scope:i,merge:l,__render:u,...d}=e,f=qn(),g=window.G7Core;if(typeof r=="string"&&(r.startsWith("$parent.")||r.startsWith("$root.")))return this.handleParentScopeSetState(r,d,l,n);const m=n.state&&Object.keys(n.state).length>0?n.state:g?.state?.get()||{},b=r==="global"?"_global":r.startsWith("_local.")?r:"_local",v=b==="_global"?m._global:b.startsWith("_local.")?this.getNestedProperty(m._local||{},b.slice(7)):m._local,S=f?.isEnabled()?f.startStateChange(b,v,d,{actionId:n.actionId,handlerType:"setState",source:`target=${r}`}):void 0,_=l==="replace"?"replace":l==="shallow"?"shallow":"deep",x=_!=="deep"?{...d,__mergeMode:_,...S?{__setStateId:S}:{}}:{...d,...S?{__setStateId:S}:{}};if(r==="global"){if(!this.globalStateUpdater){z.warn("Global state updater is not set"),S&&f&&f.completeStateChange(S);return}const k=g?.state?.get()||{},{__setStateId:O,__mergeMode:M,...T}=x,D=_==="deep"?this.deepMergeWithState(T,k):T,j={...D,...S?{__setStateId:S}:{},..._!=="deep"?{__mergeMode:_}:{}};return z.log("setState global:",j),this.globalStateUpdater(j,{render:u}),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"global",..._!=="deep"?{__mergeMode:_}:{},...D}}else if(r==="isolated"){const k=n.isolatedContext;if(k){const{__mergeMode:O,__setStateId:M,...T}=x;return k.mergeState(T,_),z.log("[handleSetState] isolated state updated:",T,"mergeMode:",_),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"isolated",...T}}else if(z.warn('[handleSetState] isolated target used but no IsolatedStateContext found. Make sure the component has "isolatedState" attribute. Falling back to local state.'),n.setState){const M=window.__g7PendingLocalState||n.state||{},T=_==="deep"?this.deepMergeWithState(x,M):x;return n.setState(T),S&&f&&setTimeout(()=>f.completeStateChange(S),0),T}else throw S&&f&&f.completeStateChange(S),new Ut("isolated target used but no IsolatedStateContext found and no setState function in context")}else if(r==="local"||r==="component"||r==="_local"){if(i==="parent"||i==="root"){const O=window.__g7LayoutContextStack||[];if(O.length>0){const M=i==="parent"?O[O.length-1]:O[0];if(M?.setState){const{__mergeMode:T,__setStateId:D,...j}=x,H=_==="deep"?this.deepMergeWithState(j,M.state||{}):j;return z.log(`[handleSetState] scope=${i}: 타겟 컨텍스트에 상태 업데이트`,H),M.setState(H),S&&f&&setTimeout(()=>f.completeStateChange(S),0),H}}z.warn(`[handleSetState] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const k=n.setState&&!n._isDispatchFallbackContext;if(z.log("[handleSetState] isRealComponentContext:",k,"context.setState:",!!n.setState,"_isDispatchFallbackContext:",n._isDispatchFallbackContext),k){z.log("[handleSetState] Using COMPONENT setState path"),z.log("[handleSetState] resolvedPayload:",x),z.log("[handleSetState] context.state:",n.state),z.log("[handleSetState] mergeMode:",_);const M=window.__g7PendingLocalState||n.state||{},T=_==="deep"?this.deepMergeWithState(x,{}):x;z.log("[handleSetState] convertedPayload (변경 필드만, dot notation 변환):",T),n.setState(T);const D=_==="deep"?this.deepMergeWithState(x,M):_==="shallow"?{...n.state||{},...x}:x,{__mergeMode:j,__setStateId:H,...P}=D;window.__g7PendingLocalState=P,z.log("[handleSetState] __g7PendingLocalState updated:",P),this.globalStateUpdater&&(this.globalStateUpdater({_local:P},{render:!1}),z.log("[handleSetState] _global._local synced (render:false):",P));const{__mergeMode:X,__setStateId:pe,..._e}=x;if(_==="replace")window.__g7ForcedLocalFields=_e;else{const we=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=this.deepMergeWithState(_e,we)}return z.log("[handleSetState] __g7ForcedLocalFields updated:",_e),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"local",...D}}else if(this.globalStateUpdater){z.log("[handleSetState] Using GLOBAL STATE UPDATER path for _local");const M=window.__g7PendingLocalState||m._local||{};z.log("[handleSetState] currentLocal (with pending):",M);const T=_==="deep"?this.deepMergeWithState(x,M):x;return z.log("[handleSetState] finalLocal (merged):",T),this.globalStateUpdater({_local:T},{render:u}),window.__g7PendingLocalState=T,z.log("[handleSetState] __g7PendingLocalState updated for globalStateUpdater path"),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"local",...T}}else throw S&&f&&f.completeStateChange(S),new Ut("setState function is not provided in context and globalStateUpdater is not set")}else if(r.startsWith("_local.")){const k=r.slice(7),{__mergeMode:O,__setStateId:M,...T}=x,D=T.value!==void 0?T.value:Object.values(T)[0];if(n.setState){const H=window.__g7PendingLocalState||n.state||{},P=this.createNestedUpdate(k,D,H),X={...H,...P};return n.setState(P),S&&f&&setTimeout(()=>f.completeStateChange(S),0),X}else throw S&&f&&f.completeStateChange(S),new Ut("setState function is not provided in context")}else{if(!n.setState)throw S&&f&&f.completeStateChange(S),new Ut("setState function is not provided in context");const O=window.__g7PendingLocalState||n.state||{},M=_==="deep"?this.deepMergeWithState(x,O):x;return n.setState(M),S&&f&&setTimeout(()=>f.completeStateChange(S),0),M}}async handleParentScopeSetState(e,n,r,i){const l=qn(),u=window.G7Core,d=r==="replace"?"replace":r==="shallow"?"shallow":"deep",f=e.startsWith("$parent."),g=f?"$parent.":"$root.",m=e.slice(g.length);let b,v;if(m==="_local"||m==="_global")b=m,v=void 0;else if(m.startsWith("_local."))b="_local",v=m.slice(7);else if(m.startsWith("_global."))b="_global",v=m.slice(8);else{z.warn(`[handleParentScopeSetState] 지원하지 않는 타겟 형식: ${e}. _local 또는 _global으로 시작해야 합니다.`);return}const S=window.__g7LayoutContextStack||[];if(S.length===0){z.warn(`[handleParentScopeSetState] 레이아웃 컨텍스트 스택이 비어있습니다. target=${e}`);return}const _=f?S[S.length-1]:S[0];if(!_){z.warn(`[handleParentScopeSetState] 타겟 컨텍스트를 찾을 수 없습니다. target=${e}`);return}const x=b==="_global"?_.state?._global:_.state?._local,k=l?.isEnabled()?l.startStateChange(e,x,n,{actionId:i.actionId,handlerType:"setState",source:`target=${e}`}):void 0,{__mergeMode:O,__setStateId:M,...T}=n;if(b==="_global"){if(!this.globalStateUpdater){z.warn("[handleParentScopeSetState] globalStateUpdater가 설정되지 않았습니다."),k&&l&&l.completeStateChange(k);return}const D=u?.state?.get()||{};if(v){const j=T.value!==void 0?T.value:Object.values(T)[0],H=this.createNestedUpdate(v,j,D),P={...D,...H};z.log(`[handleParentScopeSetState] ${e}: 전역 상태 중첩 경로 업데이트`,P),this.globalStateUpdater(P)}else{const j=d==="deep"?this.deepMergeWithState(T,D):T;z.log(`[handleParentScopeSetState] ${e}: 전역 상태 업데이트 (mergeMode=${d})`,j),this.globalStateUpdater(d!=="deep"?{...j,__mergeMode:d}:j)}return k&&l&&setTimeout(()=>l.completeStateChange(k),0),{__target:e,...T}}else{if(!_.setState){z.warn(`[handleParentScopeSetState] 타겟 컨텍스트에 setState가 없습니다. target=${e}`),k&&l&&l.completeStateChange(k);return}const D=_.state||{};if(v){const j=T.value!==void 0?T.value:Object.values(T)[0],H=this.createNestedUpdate(v,j,D),P={...D,...H};return z.log(`[handleParentScopeSetState] ${e}: 로컬 상태 중첩 경로 업데이트`,H),_.setState(H),_.state=P,_.dataContext&&(_.dataContext._local=P),$d(),k&&l&&setTimeout(()=>l.completeStateChange(k),0),P}else{const j=d!=="deep"?{...T,__mergeMode:d}:T,H=d==="replace"?T:d==="shallow"?{...D,...T}:this.deepMergeWithState(T,D);return z.log(`[handleParentScopeSetState] ${e}: 로컬 상태 업데이트 (mergeMode=${d})`,H),_.setState(j),_.state=H,_.dataContext&&(_.dataContext._local=H),$d(),k&&l&&setTimeout(()=>l.completeStateChange(k),0),H}}}deepMergeWithState(e,n){const r=["errors"];let i=e;if("..."in e){const u=e["..."];if(u&&typeof u=="object"&&!Array.isArray(u)){const{"...":d,...f}=e;i={...u,...f}}else{const{"...":d,...f}=e;i=f}}const l={...n};for(const[u,d]of Object.entries(i)){if(r.includes(u)){l[u]=d;continue}if(u.includes(".")&&u!=="..."){const f=this.createNestedUpdate(u,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[u]=d;continue}d!==null&&typeof d=="object"&&!Array.isArray(d)&&n[u]!==null&&typeof n[u]=="object"&&!Array.isArray(n[u])?l[u]=this.deepMergeWithState(d,n[u]):l[u]=d}return l}deepMergeInto(e,n,r){for(const[i,l]of Object.entries(n)){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]===r[i]&&(e[i]={...e[i]}),this.deepMergeInto(e[i],l,r[i]||{})):typeof l=="object"&&!Array.isArray(l)&&e[i]===void 0&&r[i]!==null&&typeof r[i]=="object"&&!Array.isArray(r[i])?e[i]={...r[i],...l}:e[i]=l}}createNestedUpdate(e,n,r){const i=e.split(".");if(i.length===1)return{[i[0]]:n};const l={};let u=l,d=r;for(let f=0;f<i.length-1;f++){const g=i[f],m=d?.[g],b=m!=null&&typeof m=="object"&&!Array.isArray(m);b?u[g]={...m}:u[g]={},u=u[g],d=b?m:{}}return u[i[i.length-1]]=n,l}buildNestedUpdate(e,n){const r=e.split(".");if(r.length===1)return{[r[0]]:n};const i={};let l=i;for(let u=0;u<r.length-1;u++)l[r[u]]={},l=l[r[u]];return l[r[r.length-1]]=n,i}async handleSetError(e,n,r){let i=e;i=this.resolveValue(i,r.data),this.translationEngine&&this.translationContext&&i.startsWith("$t:")&&(i=this.translationEngine.resolveTranslations(i,this.translationContext,r.data));const l=n?.stateTarget||"local";l==="isolated"&&r.isolatedContext?(r.isolatedContext.mergeState({apiError:i}),z.log("[handleSetError] Error set to isolated state:",i)):l==="global"&&this.globalStateUpdater?(this.globalStateUpdater({apiError:i}),z.log("[handleSetError] Error set to global state:",i)):r.setState?(r.setState({apiError:i}),z.log("[handleSetError] Error set to local state:",i)):z.warn("[handleSetError] Cannot set error: no state updater available")}async handleOpenModal(e,n){if(!this.globalStateUpdater){z.warn("Global state updater is not set for openModal");return}const r=n.data?._global?.modalStack||[];if(r.includes(e)){z.warn(`Modal "${e}" is already open`);return}const i=window.G7Core,l=n.setState&&n.state!==void 0,u=l?void 0:i?.state?.getLocal?.()||{},d=!l&&u!==void 0&&this.globalStateUpdater;if(l||d){const m=window.__g7LayoutContextStack||[],b=l?n.state:u,v=l?n.setState:S=>{this.globalStateUpdater({_local:S})};m.push({state:b,setState:v,dataContext:{_local:b||n.data?._local,_global:l?n.data?._global:n.data?._global||i?.state?.get?.(),_computed:n.data?._computed}}),window.__g7LayoutContextStack=m,z.log(`[handleOpenModal] 레이아웃 컨텍스트 스택에 push, 스택 크기: ${m.length}, state:`,b,l?"(direct)":"(fallback via G7Core)")}else z.warn(`[handleOpenModal] 컨텍스트 스택에 push 실패 - setState: ${!!n.setState}, state: ${n.state!==void 0}, G7Core: ${!!i?.state?.getLocal}`);const f=[...r,e];this.globalStateUpdater({modalStack:f,activeModal:e});const g=qn();if(g?.isEnabled()){const m=r.length>0?r[r.length-1]:void 0;g.trackModalOpen?.({modalId:e,modalName:e,scopeType:"isolated",parentModalId:m,initialState:n.state?{...n.state}:{}})}}async handleCloseModal(e){if(!this.globalStateUpdater){z.warn("Global state updater is not set for closeModal");return}const n=e?.data?._global?.modalStack||[],r=n.length>0?n[n.length-1]:null,i=n.slice(0,-1),l=i.length>0?i[i.length-1]:null,u=window.__g7LayoutContextStack||[];if(u.length>0){const d=u[u.length-1];d&&(d.dataContext=void 0),u.pop(),window.__g7LayoutContextStack=u,z.log(`[handleCloseModal] 레이아웃 컨텍스트 스택에서 pop, 스택 크기: ${u.length}`)}if(r){const d=qn();d?.isEnabled()&&d.trackModalClose?.(r,e?.state)}this.globalStateUpdater({modalStack:i,activeModal:l})}async handleShowAlert(e,n){let r=e;this.translationEngine&&this.translationContext&&e.startsWith("$t:")&&(r=this.translationEngine.resolveTranslations(e,this.translationContext,n.data)),alert(r)}async handleToast(e,n){const{type:r="info",message:i,icon:l,duration:u}=e;if(r==="error"){const f=n.data?.error;if((f?.error_code==="identity_verification_required"||f?.data?.error_code==="identity_verification_required")&&wt.consumeDomainNoticeShown()){z.log("[Toast] IDV 도메인 안내 표출됨 — 중복 가드 토스트 1건 skip");return}}let d=i;if(this.translationEngine&&this.translationContext&&i?.startsWith("$t:")&&(d=this.translationEngine.resolveTranslations(i,this.translationContext,n.data)),this.globalStateUpdater){const g={id:`toast_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,type:r,message:d,...l&&{icon:l},...u&&{duration:u}},S=[...window.G7Core?.state?.get()?.toasts||[],g];this.globalStateUpdater({toasts:S})}else z.log(`[Toast ${r}] ${d}`)}async handleSwitch(e,n){const{cases:r}=e;if(!r){z.warn("switch handler requires cases property");return}const i=this.resolveParams(e.params,n.data);let l;if(i?.value!==void 0?(l=i.value,z.log("switch handler: using params.value as case key:",l)):(l=n.data?.$args?.[0],z.log("switch handler: using $args[0] as case key:",l)),l==null){if(r.default)return z.log("switch handler: case key is undefined, using default case"),await this.executeAction(r.default,n);z.warn("switch handler: case key is not defined and no default case");return}const u=String(l);let d=r[u];if(!d&&r.default&&(z.log(`switch handler: no case found for key "${u}", using default case`),d=r.default),!d){z.warn(`switch handler: no case found for key "${u}" and no default case`);return}return await this.executeAction(d,n)}async handleConditions(e,n){const{conditions:r}=e;if(!r||!Array.isArray(r)){z.warn("conditions handler requires conditions array");return}const i=n.data||{},l=up(r,i,this.bindingEngine);if(!l.matched){z.log("conditions handler: no matching branch found");return}const u=r[l.branchIndex];if(z.log(`conditions handler: matched branch ${l.branchIndex}`),!u.then){z.warn('conditions handler: matched branch has no "then" action');return}return Array.isArray(u.then)?await this.handleSequence({...e,actions:u.then},n):await this.executeAction(u.then,n)}handleStartInterval(e,n){const r=typeof e.id=="string"?e.id:"",i=Number(e.intervalMs??1e3),l=Array.isArray(e.actions)?e.actions:[];if(r===""||!l.length||i<=0)return z.warn("startInterval requires non-empty id, positive intervalMs, and actions array"),{success:!1};const u=this.intervals.get(r);u&&(clearInterval(u),this.intervals.delete(r));const d=setInterval(()=>{for(const f of l)this.executeAction(f,n).catch(g=>{z.error(`[startInterval:${r}] tick action failed`,g)})},i);return this.intervals.set(r,d),{success:!0,id:r}}handleStopInterval(e){const n=typeof e.id=="string"?e.id:"";if(n==="")return z.warn("stopInterval requires id parameter"),{success:!1};const r=this.intervals.get(n);return r&&(clearInterval(r),this.intervals.delete(n)),{success:!0,id:n}}stopAllIntervals(){for(const e of this.intervals.values())clearInterval(e);this.intervals.clear()}async handleSequence(e,n){const r=e.actions||e.params?.actions;if(!r||!Array.isArray(r)||r.length===0)return z.warn("sequence handler requires non-empty actions array"),[];const i=qn(),l=i?.isEnabled()&&i.startSequenceExecution?.({eventType:e.type})||"";window.__g7SequenceLocalSync=void 0;const u=[];let d,f=n.state?{...n.state}:{},g=n.isolatedContext?.state?{...n.isolatedContext.state}:{},m=n.data?._computed||{};const b=window.G7Core,v=()=>({_global:b?.state?.get()||{},_local:{...f},_isolated:Object.keys(g).length>0?{...g}:void 0});for(let S=0;S<r.length;S++){const _=r[S],x=Date.now();l&&i?.isEnabled()&&i.captureSequenceActionBefore?.(l,S,_.handler||"unknown",_.params||{},v());const k={...n,state:f,data:{...n.data,_local:f,_computed:m,$computed:m,$prev:d,$results:[...u],_isolated:g},isolatedContext:n.isolatedContext?{...n.isolatedContext,state:g}:null};try{const O=await this.executeAction(_,k);if(d=O.data,u.push(O.data),_.handler==="setState"&&O.data!==void 0){if(O.data.__target==="global"){const{__target:T,__mergeMode:D,...j}=O.data;D==="replace"?f={...f,_global:j}:f={...f,_global:{...f._global||{},...j}},z.log("[handleSequence] global state synchronized (mergeMode=%s):",D||"deep",f._global)}else if(O.data.__target==="isolated"){const{__target:T,__mergeMode:D,...j}=O.data;D==="replace"?g=j:g={...g,...j},z.log("[handleSequence] isolated state synchronized (mergeMode=%s):",D||"deep",g)}else if(O.data.__target==="local"){const{__target:T,__mergeMode:D,__setStateId:j,...H}=O.data;D==="replace"?f=H:f={...f,...H},z.log("[handleSequence] local state synchronized (mergeMode=%s):",D||"deep",f)}else f=O.data,z.log("[handleSequence] state synchronized (legacy):",f);const M=n.data?._computedDefinitions;if(M&&Object.keys(M).length>0){const T={},D={...n.data,_local:f,_computed:T,$computed:T,_isolated:g};for(const[j,H]of Object.entries(M))if(typeof H=="string"){const P=H.trim();if(P.startsWith("{{")&&P.endsWith("}}"))try{const X=P.slice(2,-2).trim();T[j]=this.bindingEngine.evaluateExpression(X,D,{skipCache:!0})}catch{T[j]=m[j]}}m=T,z.log("[handleSequence] _computed recalculated after setState:",m)}}if(_.handler!=="setState"){const M=window.__g7SequenceLocalSync;if(M&&M!==f){f=M,window.__g7SequenceLocalSync=void 0,z.log("[handleSequence] currentState synchronized from __g7SequenceLocalSync after custom handler:",_.handler);const T=n.data?._computedDefinitions;if(T&&Object.keys(T).length>0){const D={},j={...n.data,_local:f,_computed:D,$computed:D,_isolated:g};for(const[H,P]of Object.entries(T))if(typeof P=="string"){const X=P.trim();if(X.startsWith("{{")&&X.endsWith("}}"))try{const pe=X.slice(2,-2).trim();D[H]=this.bindingEngine.evaluateExpression(pe,j,{skipCache:!0})}catch{D[H]=m[H]}}m=D,z.log("[handleSequence] _computed recalculated after custom handler:",m)}}}l&&i?.isEnabled()&&i.captureSequenceActionAfter?.(l,S,v(),Date.now()-x,O.data)}catch(O){throw l&&i?.isEnabled()&&(i.captureSequenceActionAfter?.(l,S,v(),Date.now()-x,void 0,O),i.endSequenceExecution?.(l,O)),z.error(`sequence handler: action[${S}] failed:`,O),O}}return window.__g7SequenceLocalSync=void 0,l&&i?.isEnabled()&&i.endSequenceExecution?.(l),u}async handleParallel(e,n){const r=e.actions||e.params?.actions;if(!r||!Array.isArray(r)||r.length===0)return z.warn("parallel handler requires non-empty actions array"),[];z.log(`parallel handler: executing ${r.length} actions in parallel`);const i=n.isolatedContext?{...n.isolatedContext,state:{...n.isolatedContext.state}}:null,l=r.map((f,g)=>{const m={...n,isolatedContext:i};return this.executeAction(f,m).catch(b=>{throw z.error(`parallel handler: action[${g}] failed:`,b),b})}),u=await Promise.allSettled(l),d=u.filter(f=>f.status==="rejected").length;return d>0&&z.warn(`parallel handler: ${d}/${r.length} actions failed`),u}async handleLoadScript(e,n,r){const{src:i,id:l,async:u=!0,defer:d=!1}=e;if(!i)throw new Ut('loadScript handler requires "src" parameter',n);const f=l||`script_${i.replace(/[^a-zA-Z0-9]/g,"_")}`;return gs.loadedScripts.has(f)?(z.log(`loadScript: script already loaded, skipping: ${f}`),n.onLoad&&await this.executeAction(n.onLoad,r),!0):document.getElementById(f)?(z.log(`loadScript: script element already exists: ${f}`),gs.loadedScripts.add(f),n.onLoad&&await this.executeAction(n.onLoad,r),!0):(z.log(`loadScript: loading script: ${i}`),new Promise((m,b)=>{const v=document.createElement("script");v.id=f,v.src=i,v.async=u,v.defer=d,v.onload=async()=>{if(z.log(`loadScript: script loaded successfully: ${f}`),gs.loadedScripts.add(f),n.onLoad)try{await this.executeAction(n.onLoad,r)}catch(S){z.error("loadScript: onLoad action failed:",S)}m(!0)},v.onerror=S=>{z.error(`loadScript: failed to load script: ${i}`,S),b(new Ut(`Failed to load script: ${i}`,n))},document.head.appendChild(v)}))}async handleCallExternal(e,n,r){const i=e.constructor,l=e.args||{},u=e.method,d=e.methodArgs||[],f=e.callbackEvent,g=e.embedTarget,m=e.callbackSetState,b=e.callbackAction;if(!i)throw new Ut('callExternal handler requires "constructor" parameter',n);const v=this.getNestedProperty(window,i);if(!v||typeof v!="function")throw new Ut(`Constructor not found or not a function: ${i}. Make sure the script is loaded first using loadScript handler.`,n);z.log(`callExternal: calling constructor ${i}`);const S={...l};for(const[x,k]of Object.entries(l))k===!0&&(S[x]=O=>{if(z.log(`callExternal: callback triggered for ${x}`,O),f&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(f,O),m&&r.setState){const M=j=>{const H={};for(const[P,X]of Object.entries(j))typeof X=="string"?H[P]=this.getNestedProperty(O,X):typeof X=="object"&&X!==null&&(H[P]=M(X));return H},T=M(m);z.log("callExternal: callbackSetState mapping result",T);const D=this.deepMergeWithState(T,r.state||{});z.log("callExternal: merged with existing state",D),r.setState(D)}else f&&r.setState&&r.setState({[`${f.replace(/:/g,"_")}_result`]:O});if(b){const M={...r,data:{...r.data,$event:O}},T=Array.isArray(b)?b:[b];for(const D of T)try{this.executeAction(D,M)}catch(j){z.error("callExternal: callbackAction failed:",j)}}});const _=new v(S);if(u&&typeof _[u]=="function"){if(z.log(`callExternal: calling method ${u}`),u==="embed"&&g){const x=document.querySelector(g);if(x)return _[u](x,...d);throw new Ut(`Embed target element not found: ${g}`,n)}return _[u](...d)}return _}async handleCallExternalEmbed(e,n,r){const i=e.constructor,l=e.args||{},u=e.callbackSetState,d=e.callbackEvent,f=e.layerClassName,g=e.callbackAction;if(!i)throw new Ut('callExternalEmbed handler requires "constructor" parameter',n);const m=this.getNestedProperty(window,i);if(!m||typeof m!="function")throw new Ut(`Constructor not found or not a function: ${i}. Make sure the script is loaded first.`,n);z.log(`callExternalEmbed: creating layer for ${i}`);const{layer:b,closeLayer:v}=this.createEmbedLayer(f),S={...l};for(const[x,k]of Object.entries(l))k===!0&&(S[x]=O=>{if(z.log(`callExternalEmbed: callback triggered for ${x}`,O),v(),d&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(d,O),u&&r.setState){const M=j=>{const H={};for(const[P,X]of Object.entries(j))typeof X=="string"?H[P]=this.getNestedProperty(O,X):typeof X=="object"&&X!==null&&(H[P]=M(X));return H},T=M(u);z.log("callExternalEmbed: callbackSetState mapping result",T);const D=this.deepMergeWithState(T,r.state||{});z.log("callExternalEmbed: merged with existing state",D),r.setState(D)}if(g){const M={...r,data:{...r.data,$event:O}},T=Array.isArray(g)?g:[g];for(const D of T)try{this.executeAction(D,M)}catch(j){z.error("callExternalEmbed: callbackAction failed:",j)}}});const _=new m(S);if(typeof _.embed=="function")_.embed(b),z.log("callExternalEmbed: embedded in layer");else throw v(),new Ut(`Constructor ${i} does not have embed method`,n);return _}isImeComposing(e){return e?.isComposing===!0||e?.keyCode===229}createEmbedLayer(e){const n=document.createElement("div");n.id="g7-embed-overlay",n.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 r=document.createElement("div");r.id="g7-embed-layer",r.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&&(r.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=()=>{n.parentNode&&n.parentNode.removeChild(n)};i.onclick=l;const u=d=>{this.isImeComposing(d)||d.key==="Escape"&&(l(),document.removeEventListener("keydown",u))};return document.addEventListener("keydown",u),n.onclick=d=>{d.target===n&&l()},r.appendChild(i),n.appendChild(r),document.body.appendChild(n),{overlay:n,layer:r,closeLayer:l}}getNestedProperty(e,n){return n.split(".").reduce((r,i)=>r&&r[i]!==void 0?r[i]:void 0,e)}async handleSaveToLocalStorage(e,n){const{key:r,value:i}=e;if(!r)return z.error("saveToLocalStorage: key parameter is required"),!1;try{const l=typeof i=="string"?i:JSON.stringify(i);return localStorage.setItem(r,l),z.log(`saveToLocalStorage: saved ${r}`,i),!0}catch(l){return z.error("saveToLocalStorage: failed to save",{key:r,error:l}),!1}}async handleLoadFromLocalStorage(e,n){const{key:r,target:i,stateKey:l,defaultValue:u}=e;if(!r)return z.error("loadFromLocalStorage: key parameter is required"),u;try{const d=localStorage.getItem(r);if(d===null)return z.log(`loadFromLocalStorage: no value found for ${r}, using default`),l&&n.setState&&n.setState({[l]:u}),u;let f;try{f=JSON.parse(d)}catch{f=d}return z.log(`loadFromLocalStorage: loaded ${r}`,f),l&&n.setState&&n.setState({[l]:f}),f}catch(d){return z.error("loadFromLocalStorage: failed to load",{key:r,error:d}),u}}async handleCustomAction(e,n){const r=this.customHandlers.get(e.handler);if(!r){if(this.previewMode){z.warn(`[Preview] Unknown action handler "${e.handler}" — skipped (preview mode)`);return}const i=new Ut(`Unknown action handler: ${e.handler}`,e);throw i.unknownHandler=!0,i}return await r(e,n)}resolveParams(e,n){if(!e)return{};const r={};for(const[i,l]of Object.entries(e))i.includes("{{")&&z.warn(`[resolveParams] setState params의 키에 표현식이 포함되어 있습니다: "${i}". 키는 해석되지 않습니다. 배열 항목 수정은 .map()/.filter() 패턴을 사용하세요.`),typeof l=="string"&&l.includes("{{")?r[i]=this.evaluateExpression(l,n):typeof l=="string"?r[i]=l:Array.isArray(l)?r[i]=l.map(u=>typeof u=="string"&&u.includes("{{")?this.evaluateExpression(u,n):u):typeof l=="object"&&l!==null&&!Array.isArray(l)&&Object.getPrototypeOf(l)!==Object.prototype&&Object.getPrototypeOf(l)!==null?r[i]=l:typeof l=="object"&&l!==null?r[i]=this.resolveParams(l,n):r[i]=l;return r}resolveValue(e,n){return n?this.bindingEngine.resolveBindings(e,n,{skipCache:!0}):e}evaluateExpressions(e,n){let r={};for(const[i,l]of Object.entries(e))if(i==="..."){let u=l;typeof l=="string"&&l.includes("{{")&&(u=this.evaluateExpression(l,n)),u&&typeof u=="object"&&!Array.isArray(u)&&(r={...r,...u})}else typeof l=="string"&&l.includes("{{")?r[i]=this.evaluateExpression(l,n):typeof l=="object"&&l!==null&&!Array.isArray(l)?r[i]=this.evaluateExpressions(l,n):r[i]=l;return r}evaluateExpressionsIfNeeded(e,n){const r={};for(const[i,l]of Object.entries(e))typeof l=="string"&&l.includes("{{")?r[i]=this.evaluateExpression(l,n):r[i]=l;return r}evaluateExpression(e,n){if(!n)return e;const r=e.match(/^\{\{(.+)\}\}$/);if(!(r&&!r[1].includes("}}")&&!r[1].includes("{{"))){let d=n;if(e.includes("_global")){const g=window.G7Core?.state?.get()?._global;g&&(d={...n,_global:g})}if(e.includes("_computed")||e.includes("$computed")){const g=window.__g7ActionContext?.computedRef?.current;g&&Object.keys(g).length>0&&(d={...d,_computed:g,$computed:g})}return this.bindingEngine.resolveBindings(e,d,{skipCache:!0})}let l=r[1].trim();l=l.replace(/\$args\.(\d+)/g,"$args[$1]");let u=n;if(l.includes("_global")){const f=window.G7Core?.state?.get()?._global;f&&(u={...n,_global:f})}if(l.includes("_computed")||l.includes("$computed")){const f=window.__g7ActionContext?.computedRef?.current;f&&Object.keys(f).length>0&&(u={...u,_computed:f,$computed:f})}l.includes("_global.modules")&&(z.log("[evaluateExpression] expression:",l),z.log("[evaluateExpression] dataContext._global:",u._global),z.log("[evaluateExpression] dataContext._global?.modules:",u._global?.modules));try{const d=this.bindingEngine.evaluateExpression(l,u);return l.includes("_global.modules")&&z.log("[evaluateExpression] result:",d),typeof d=="string"&&d.startsWith("$t:")&&this.translationEngine&&this.translationContext?this.translationEngine.resolveTranslations(d,this.translationContext,n):d}catch(d){return z.error("Expression evaluation failed:",e,d),e}}setDefaultContext(e){this.defaultContext={...this.defaultContext,...e}}setGlobalStateUpdater(e){this.globalStateUpdater=e}getGlobalStateUpdater(){return this.globalStateUpdater}async dispatchAction(e,n){const r={...this.defaultContext,...n,data:{...this.defaultContext.data,...n?.data}};if(e.confirm){let i=this.resolveValue(e.confirm,r.data);if(this.translationEngine&&this.translationContext&&i.startsWith("$t:")&&(i=this.translationEngine.resolveTranslations(i,this.translationContext,r.data)),!confirm(i))return{success:!1}}try{return await this.executeAction(e,r)}catch(i){if(z.error("dispatchAction failed:",i),e.onError){const l=i instanceof Ut&&i.originalError?{message:i.originalError.message,response:i.originalError.response}:{message:i instanceof Error?i.message:String(i)},u={...r,data:{...r.data,error:l}},d=Array.isArray(e.onError)?e.onError:[e.onError];for(const f of d)await this.executeAction(f,u)}return{success:!1,error:i instanceof Error?i:new Error(String(i))}}}registerHandler(e,n,r){this.customHandlers.set(e,n);const i=qn();i?.isEnabled()&&i.trackHandlerRegistration(e,r?.category??"custom",r?.description,r?.source)}unregisterHandler(e){this.customHandlers.delete(e);const n=qn();n?.isEnabled()&&n.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 n=e.target;if(n&&!("tagName"in n)){const l={type:e.type??"custom",target:{value:n.value,name:n.name??""}};return e._changedKeys&&(l._changedKeys=e._changedKeys),l}const i=n?{value:n.value,name:n.name??"",checked:n.checked??!1,type:n.type??"",tagName:n.tagName}:{};if(e.type==="scroll"&&n){const l=n;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:n?i:null}}executeDebouncedAction(e,n,r,i,l){const u={...r,$event:n,$args:l},d={type:n.type,target:n.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(e,u,i)(d)}handleDebouncedAction(e,n,r,i,l,u){const d=this.normalizeDebounceConfig(e.debounce),f=l||`default-${e.handler}-${Date.now()}`,g=this.extractEventData(n),m=g._changedKeys;if(m&&Array.isArray(m)&&g?.target?.value&&typeof g.target.value=="object"&&!Array.isArray(g.target.value)){const _=this.debounceAccumulatedValues.get(f);if(_){const x={..._};for(const k of m)x[k]=g.target.value[k];g.target.value=x}this.debounceAccumulatedValues.set(f,g.target.value)}const b=this.debounceTimers.get(f);b&&(clearTimeout(b),this.debounceTimers.delete(f));const v=qn();v?.isEnabled()&&v.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,r,i,u),v?.isEnabled()&&v.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 _=()=>{this.executeDebouncedAction(e,g,r,i,u),v?.isEnabled()&&v.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"}})},x=setTimeout(()=>{this.debounceTimers.delete(f),this.debounceTimers.delete(f+"_leading"),this.pendingDebounceFlushers.delete(f),this.debounceAccumulatedValues.delete(f),_()},d.delay);this.debounceTimers.set(f,x),this.pendingDebounceFlushers.set(f,_)}}clearDebounceTimers(e){if(e)for(const[n,r]of this.debounceTimers)n.startsWith(e+"-")&&(clearTimeout(r),this.debounceTimers.delete(n),this.pendingDebounceFlushers.delete(n),this.debounceAccumulatedValues.delete(n));else{for(const n of this.debounceTimers.values())clearTimeout(n);this.debounceTimers.clear(),this.pendingDebounceFlushers.clear(),this.debounceAccumulatedValues.clear()}}debouncedCall(e,n,r){const i=this.debounceTimers.get(e);i&&(clearTimeout(i),this.debounceTimers.delete(e));const l=setTimeout(()=>{this.debounceTimers.delete(e),this.pendingDebounceFlushers.delete(e),r()},n);this.debounceTimers.set(e,l),this.pendingDebounceFlushers.set(e,r)}flushPendingDebounceTimers(){if(this.pendingDebounceFlushers.size===0)return;const e=new Map(this.pendingDebounceFlushers);for(const[n,r]of e){const i=this.debounceTimers.get(n);i&&(clearTimeout(i),this.debounceTimers.delete(n)),this.debounceTimers.delete(n+"_leading"),this.pendingDebounceFlushers.delete(n),r()}this.globalStateUpdater&&this.globalStateUpdater({})}bindActionsToProps(e,n,r){const i={...e};if(e.actions&&Array.isArray(e.actions)){const l=new Map;for(const m of e.actions){const b=this.resolveActionRef(m),v=b.event||this.getEventHandlerName(b.type);l.has(v)||l.set(v,[]),l.get(v).push(b)}const u=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,b]of l)i[m]=(...v)=>{for(const S of b){const _=v[0],x=_&&typeof _=="object"&&"preventDefault"in _;if(x&&(m==="onDragOver"||m==="onDrop")&&_.preventDefault(),x&&S.key&&"key"in _){if(this.isImeComposing(_)){z.log("Key filter skipped (IME composing):",S.key);continue}if(_.key!==S.key){z.log("Key filter not matched:",S.key,"actual:",_.key);continue}z.log("Key filter matched:",S.key)}if(S.debounce){const k=`${u}-${S.handler}-${m}`,O=_&&typeof _=="object"&&!("preventDefault"in _)&&"target"in _&&_.target!==null;let M;if(x)M=_;else if(O){const D={type:"custom",target:_.target,preventDefault:()=>{},stopPropagation:()=>{}};_._changedKeys&&(D._changedKeys=_._changedKeys),M=D}else M=new Event("custom");const T=S.event?{...n,$args:v}:n;this.handleDebouncedAction(S,M,T,r,k,v)}else if(this.flushPendingDebounceTimers(),S.event){const k={...n,$args:v},O=x?_:new Event("custom");this.createHandler(S,k,r)(O)}else if(x)this.createHandler(S,n,r)(_);else if(_&&typeof _=="object"&&!("preventDefault"in _)&&"target"in _&&_.target!==null){const O={type:"custom",target:_.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(S,n,r)(O)}}}}return i}getEventHandlerName(e){return{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"}[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}sanitizeForDevTools(e,n=5){const r=new WeakSet,i=(l,u)=>{if(l==null||typeof l=="string"||typeof l=="number"||typeof l=="boolean")return l;if(u>n)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(r.has(l))return"[Circular Array]";r.add(l);const d=l.slice(0,10).map(f=>i(f,u+1));return l.length>10&&d.push(`... ${l.length-10} more items`),d}if(typeof l=="object"){if(r.has(l))return"[Circular Reference]";r.add(l);const d={},f=Object.keys(l),g=f.slice(0,20);for(const m of g)try{d[m]=i(l[m],u+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)}};$(gs,"loadedScripts",new Set);let fo=gs,Jl=null;function lm(o){return Jl||(Jl=new fo(o)),Jl}function mC(o){Jl=o}const cm=dt("TransitionManager");class yC{constructor(){$(this,"isPending",!1);$(this,"subscribers",new Set)}setPending(e){this.isPending!==e&&(cm.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(){cm.log("notifySubscribers:",{isPending:this.isPending,subscriberCount:this.subscribers.size}),this.subscribers.forEach(e=>{e(this.isPending)})}clearSubscribers(){this.subscribers.clear()}}const Ha=new yC,Ql=dt("TransitionContext"),um=I.createContext({isTransitioning:!1}),Nd=({children:o})=>{const[e,n]=I.useState(()=>{const i=Ha.getIsPending();return Ql.log("Initial state:",i),i});I.useEffect(()=>{Ql.log("Subscribing to TransitionManager");const i=Ha.subscribe(l=>{Ql.log("Received isPending update:",l),n(l)});return()=>{Ql.log("Unsubscribing from TransitionManager"),i()}},[]);const r=I.useMemo(()=>({isTransitioning:e}),[e]);return ft.jsx(um.Provider,{value:r,children:o})},dm=()=>I.useContext(um),Zl="__g7LocalInitTracking";function Id(){const o=globalThis;return o[Zl]||(o[Zl]={hash:"",timestamp:void 0,consumed:void 0}),o[Zl]}function bC(){const o=globalThis;o[Zl]={hash:"",timestamp:void 0,consumed:void 0}}function vC(o){Id().consumed=o}function SC(o){return Id().consumed===o}function wC(o,e){return typeof o=="number"&&typeof e=="number"?Math.max(o,e):e??o}function CC(o,e){if(e===void 0)return o;if(!(o!==null&&typeof o=="object"&&e!==null&&typeof e=="object"&&!SC(o)))return e;const{_forceLocalInit:r,...i}=o,{_forceLocalInit:l,...u}=e,d={...i,...u},f=wC(r,l);return f!==void 0&&(d._forceLocalInit=f),d}function EC(o){return o<768?"mobile":o<1024?"tablet":"desktop"}function fm(o){const e=EC(o);return{width:o,isMobile:e==="mobile",isTablet:e==="tablet",isDesktop:e==="desktop",matchedPreset:e}}const Hd=I.createContext(fm(1024)),ec=({children:o,overrideWidth:e})=>{const[n,r]=I.useState(()=>ui.getWidth());I.useEffect(()=>{const u=ui.subscribe(d=>{r(d)});return()=>{u()}},[]);const i=e??n,l=I.useMemo(()=>fm(i),[i]);return ft.jsx(Hd.Provider,{value:l,children:o})},zd=()=>I.useContext(Hd);window.G7Core?.createLogger?.("Core:State");function _C(o,e,n,r){const{syncOnControlledChange:i=!0,isEqual:l}=r??{},u=o!==void 0;I.useRef(u);const[d,f]=I.useState(o!==void 0?o:e),g=d,m=I.useRef(o),b=I.useRef(!1);I.useEffect(()=>{if(b.current){m.current=o;return}i&&u&&o!==m.current&&(l?!l(d,o):d!==o)&&f(o),m.current=o},[o,u,i,l,d]);const v=I.useCallback(S=>{const _=typeof S=="function"?S(g):S;(l?l(g,_):g===_)||(b.current=!0,f(_),n?.(_),requestAnimationFrame(()=>{b.current=!1}))},[g,u,n,l]);return[g,v]}function AC(o,e){return o===e?!0:o.length!==e.length?!1:o.every((n,r)=>n===e[r])}function hm(o,e){if(o===e)return!0;const n=Object.keys(o),r=Object.keys(e);return n.length!==r.length?!1:n.every(i=>o[i]===e[i])}const gm=I.createContext({}),xC=({children:o,value:e})=>ft.jsx(gm.Provider,{value:e,children:o}),TC=()=>I.useContext(gm),RC=(o,e)=>{if(!o)return;const n=e.split(".");let r=o;for(const i of n){if(r==null)return;r=r[i]}return r},kC=(o,e,n)=>{const r=e.split(".");if(r.length===1)return{...o,[r[0]]:n};const i={...o};let l=i;for(let u=0;u<r.length-1;u++){const d=r[u],f=r[u+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[r[r.length-1]]=n,i},ss=dt("IsolatedStateContext"),DC={state:{},setState:()=>{ss.warn("IsolatedStateContext not available: setState called outside IsolatedStateProvider")},getState:()=>{},mergeState:()=>{ss.warn("IsolatedStateContext not available: mergeState called outside IsolatedStateProvider")},stateRef:{current:{}},scopeId:""},pm=I.createContext(DC);let OC=0;function LC(){return`isolated-${++OC}-${Date.now().toString(36)}`}function mm(o,e){if(e==null)return o;if(typeof e!="object"||Array.isArray(e))return e;const n={...o};for(const r of Object.keys(e)){const i=e[r],l=o?.[r];i!==null&&typeof i=="object"&&!Array.isArray(i)&&l!==null&&typeof l=="object"&&!Array.isArray(l)?n[r]=mm(l,i):n[r]=i}return n}function MC(o,e){return e?e.split(".").reduce((n,r)=>n?.[r],o):o}function $C(o,e,n){const r=e.split("."),i={...o};let l=i;for(let u=0;u<r.length-1;u++){const d=r[u];l[d]={...l[d]},l=l[d]}return l[r[r.length-1]]=n,i}const NC=({initialState:o={},scopeId:e,children:n})=>{const i=I.useRef(e||LC()).current,[l,u]=I.useState(o),d=I.useRef(l);d.current=l;const f=I.useCallback(S=>MC(d.current,S),[]),g=I.useCallback((S,_)=>{u(x=>{const k=$C(x,S,_);return ss.log(`[${i}] setState: ${S} =`,_),k})},[i]),m=I.useCallback((S,_="deep")=>{u(x=>{let k;return _==="replace"?k=S:_==="shallow"?k={...x,...S}:k=mm(x,S),ss.log(`[${i}] mergeState (${_}):`,S),k})},[i]),b=I.useMemo(()=>({state:l,setState:g,getState:f,mergeState:m,stateRef:d,scopeId:i}),[l,g,f,m,i]),v=I.useMemo(()=>({state:d.current,setState:g,getState:f,mergeState:m}),[g,f,m]);return I.useEffect(()=>{const S=window.G7Core,_=window.__g7IsolatedStates||{};return window.__g7IsolatedStates||(window.__g7IsolatedStates=_),_[i]=v,S&&(S._isolatedStates||(S._isolatedStates={}),S._isolatedStates[i]=l),S?.devTools?.isEnabled?.()&&S.devTools.emit?.("isolated:created",{id:i,state:l}),ss.log(`[${i}] IsolatedStateProvider mounted with initial state:`,l),()=>{delete _[i],S?._isolatedStates&&delete S._isolatedStates[i],S?.devTools?.isEnabled?.()&&S.devTools.emit?.("isolated:destroyed",{id:i}),ss.log(`[${i}] IsolatedStateProvider unmounted`)}},[i,v]),I.useEffect(()=>{const S=window.G7Core,_=window.__g7IsolatedStates;_?.[i]&&(_[i].state=l),S?._isolatedStates&&(S._isolatedStates[i]=l),S?.devTools?.isEnabled?.()&&S.devTools.emit?.("isolated:updated",{id:i,state:l})},[l,i]),ft.jsx(pm.Provider,{value:b,children:n})},IC=()=>{const o=I.useContext(pm);return o.scopeId?o:null};var Ar=Pg();function HC(){for(var o=arguments.length,e=new Array(o),n=0;n<o;n++)e[n]=arguments[n];return I.useMemo(()=>r=>{e.forEach(i=>i(r))},e)}const tc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function os(o){const e=Object.prototype.toString.call(o);return e==="[object Window]"||e==="[object global]"}function jd(o){return"nodeType"in o}function Mn(o){var e,n;return o?os(o)?o:jd(o)&&(e=(n=o.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Ud(o){const{Document:e}=Mn(o);return o instanceof e}function ho(o){return os(o)?!1:o instanceof Mn(o).HTMLElement}function ym(o){return o instanceof Mn(o).SVGElement}function ls(o){return o?os(o)?o.document:jd(o)?Ud(o)?o:ho(o)||ym(o)?o.ownerDocument:document:document:document}const za=tc?I.useLayoutEffect:I.useEffect;function Bd(o){const e=I.useRef(o);return za(()=>{e.current=o}),I.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function zC(){const o=I.useRef(null),e=I.useCallback((r,i)=>{o.current=setInterval(r,i)},[]),n=I.useCallback(()=>{o.current!==null&&(clearInterval(o.current),o.current=null)},[]);return[e,n]}function go(o,e){e===void 0&&(e=[o]);const n=I.useRef(o);return za(()=>{n.current!==o&&(n.current=o)},e),n}function po(o,e){const n=I.useRef();return I.useMemo(()=>{const r=o(n.current);return n.current=r,r},[...e])}function nc(o){const e=Bd(o),n=I.useRef(null),r=I.useCallback(i=>{i!==n.current&&e?.(i,n.current),n.current=i},[]);return[n,r]}function Pd(o){const e=I.useRef();return I.useEffect(()=>{e.current=o},[o]),e.current}let qd={};function mo(o,e){return I.useMemo(()=>{if(e)return e;const n=qd[o]==null?0:qd[o]+1;return qd[o]=n,o+"-"+n},[o,e])}function bm(o){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((l,u)=>{const d=Object.entries(u);for(const[f,g]of d){const m=l[f];m!=null&&(l[f]=m+o*g)}return l},{...e})}}const cs=bm(1),yo=bm(-1);function jC(o){return"clientX"in o&&"clientY"in o}function Gd(o){if(!o)return!1;const{KeyboardEvent:e}=Mn(o.target);return e&&o instanceof e}function UC(o){if(!o)return!1;const{TouchEvent:e}=Mn(o.target);return e&&o instanceof e}function Vd(o){if(UC(o)){if(o.touches&&o.touches.length){const{clientX:e,clientY:n}=o.touches[0];return{x:e,y:n}}else if(o.changedTouches&&o.changedTouches.length){const{clientX:e,clientY:n}=o.changedTouches[0];return{x:e,y:n}}}return jC(o)?{x:o.clientX,y:o.clientY}:null}const bo=Object.freeze({Translate:{toString(o){if(!o)return;const{x:e,y:n}=o;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(o){if(!o)return;const{scaleX:e,scaleY:n}=o;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(o){if(o)return[bo.Translate.toString(o),bo.Scale.toString(o)].join(" ")}},Transition:{toString(o){let{property:e,duration:n,easing:r}=o;return e+" "+n+"ms "+r}}}),vm="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function BC(o){return o.matches(vm)?o:o.querySelector(vm)}const PC={display:"none"};function qC(o){let{id:e,value:n}=o;return Xe.createElement("div",{id:e,style:PC},n)}function GC(o){let{id:e,announcement:n,ariaLiveType:r="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 Xe.createElement("div",{id:e,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function VC(){const[o,e]=I.useState("");return{announce:I.useCallback(r=>{r!=null&&e(r)},[]),announcement:o}}const Sm=I.createContext(null);function FC(o){const e=I.useContext(Sm);I.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(o)},[o,e])}function KC(){const[o]=I.useState(()=>new Set),e=I.useCallback(r=>(o.add(r),()=>o.delete(r)),[o]);return[I.useCallback(r=>{let{type:i,event:l}=r;o.forEach(u=>{var d;return(d=u[i])==null?void 0:d.call(u,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.
|
||
`},YC={onDragStart(o){let{active:e}=o;return"Picked up draggable item "+e.id+"."},onDragOver(o){let{active:e,over:n}=o;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(o){let{active:e,over:n}=o;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(o){let{active:e}=o;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function XC(o){let{announcements:e=YC,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=WC}=o;const{announce:l,announcement:u}=VC(),d=mo("DndLiveRegion"),[f,g]=I.useState(!1);if(I.useEffect(()=>{g(!0)},[]),FC(I.useMemo(()=>({onDragStart(b){let{active:v}=b;l(e.onDragStart({active:v}))},onDragMove(b){let{active:v,over:S}=b;e.onDragMove&&l(e.onDragMove({active:v,over:S}))},onDragOver(b){let{active:v,over:S}=b;l(e.onDragOver({active:v,over:S}))},onDragEnd(b){let{active:v,over:S}=b;l(e.onDragEnd({active:v,over:S}))},onDragCancel(b){let{active:v,over:S}=b;l(e.onDragCancel({active:v,over:S}))}}),[l,e])),!f)return null;const m=Xe.createElement(Xe.Fragment,null,Xe.createElement(qC,{id:r,value:i.draggable}),Xe.createElement(GC,{id:d,announcement:u}));return n?Ar.createPortal(m,n):m}var rn;(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"})(rn||(rn={}));function ac(){}function wm(o,e){return I.useMemo(()=>({sensor:o,options:e??{}}),[o,e])}function JC(){for(var o=arguments.length,e=new Array(o),n=0;n<o;n++)e[n]=arguments[n];return I.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const ya=Object.freeze({x:0,y:0});function Cm(o,e){return Math.sqrt(Math.pow(o.x-e.x,2)+Math.pow(o.y-e.y,2))}function Em(o,e){let{data:{value:n}}=o,{data:{value:r}}=e;return n-r}function QC(o,e){let{data:{value:n}}=o,{data:{value:r}}=e;return r-n}function _m(o){let{left:e,top:n,height:r,width:i}=o;return[{x:e,y:n},{x:e+i,y:n},{x:e,y:n+r},{x:e+i,y:n+r}]}function Am(o,e){if(!o||o.length===0)return null;const[n]=o;return n[e]}function xm(o,e,n){return e===void 0&&(e=o.left),n===void 0&&(n=o.top),{x:e+o.width*.5,y:n+o.height*.5}}const ZC=o=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=o;const i=xm(e,e.left,e.top),l=[];for(const u of r){const{id:d}=u,f=n.get(d);if(f){const g=Cm(xm(f),i);l.push({id:d,data:{droppableContainer:u,value:g}})}}return l.sort(Em)},eE=o=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=o;const i=_m(e),l=[];for(const u of r){const{id:d}=u,f=n.get(d);if(f){const g=_m(f),m=i.reduce((v,S,_)=>v+Cm(g[_],S),0),b=Number((m/4).toFixed(4));l.push({id:d,data:{droppableContainer:u,value:b}})}}return l.sort(Em)};function tE(o,e){const n=Math.max(e.top,o.top),r=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),u=i-r,d=l-n;if(r<i&&n<l){const f=e.width*e.height,g=o.width*o.height,m=u*d,b=m/(f+g-m);return Number(b.toFixed(4))}return 0}const nE=o=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=o;const i=[];for(const l of r){const{id:u}=l,d=n.get(u);if(d){const f=tE(d,e);f>0&&i.push({id:u,data:{droppableContainer:l,value:f}})}}return i.sort(QC)};function aE(o,e,n){return{...o,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function Tm(o,e){return o&&e?{x:o.left-e.left,y:o.top-e.top}:ya}function rE(o){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),l=1;l<r;l++)i[l-1]=arguments[l];return i.reduce((u,d)=>({...u,top:u.top+o*d.y,bottom:u.bottom+o*d.y,left:u.left+o*d.x,right:u.right+o*d.x}),{...n})}}const iE=rE(1);function sE(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 oE(o,e,n){const r=sE(e);if(!r)return o;const{scaleX:i,scaleY:l,x:u,y:d}=r,f=o.left-u-(1-i)*parseFloat(n),g=o.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),m=i?o.width/i:o.width,b=l?o.height/l:o.height;return{width:m,height:b,top:g,right:f+m,bottom:g+b,left:f}}const lE={ignoreTransform:!1};function us(o,e){e===void 0&&(e=lE);let n=o.getBoundingClientRect();if(e.ignoreTransform){const{transform:g,transformOrigin:m}=Mn(o).getComputedStyle(o);g&&(n=oE(n,g,m))}const{top:r,left:i,width:l,height:u,bottom:d,right:f}=n;return{top:r,left:i,width:l,height:u,bottom:d,right:f}}function Rm(o){return us(o,{ignoreTransform:!0})}function cE(o){const e=o.innerWidth,n=o.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function uE(o,e){return e===void 0&&(e=Mn(o).getComputedStyle(o)),e.position==="fixed"}function dE(o,e){e===void 0&&(e=Mn(o).getComputedStyle(o));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const l=e[i];return typeof l=="string"?n.test(l):!1})}function rc(o,e){const n=[];function r(i){if(e!=null&&n.length>=e||!i)return n;if(Ud(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!ho(i)||ym(i)||n.includes(i))return n;const l=Mn(o).getComputedStyle(i);return i!==o&&dE(i,l)&&n.push(i),uE(i,l)?n:r(i.parentNode)}return o?r(o):n}function km(o){const[e]=rc(o,1);return e??null}function Fd(o){return!tc||!o?null:os(o)?o:jd(o)?Ud(o)||o===ls(o).scrollingElement?window:ho(o)?o:null:null}function Dm(o){return os(o)?o.scrollX:o.scrollLeft}function Om(o){return os(o)?o.scrollY:o.scrollTop}function Kd(o){return{x:Dm(o),y:Om(o)}}var fn;(function(o){o[o.Forward=1]="Forward",o[o.Backward=-1]="Backward"})(fn||(fn={}));function Lm(o){return!tc||!o?!1:o===document.scrollingElement}function Mm(o){const e={x:0,y:0},n=Lm(o)?{height:window.innerHeight,width:window.innerWidth}:{height:o.clientHeight,width:o.clientWidth},r={x:o.scrollWidth-n.width,y:o.scrollHeight-n.height},i=o.scrollTop<=e.y,l=o.scrollLeft<=e.x,u=o.scrollTop>=r.y,d=o.scrollLeft>=r.x;return{isTop:i,isLeft:l,isBottom:u,isRight:d,maxScroll:r,minScroll:e}}const fE={x:.2,y:.2};function hE(o,e,n,r,i){let{top:l,left:u,right:d,bottom:f}=n;r===void 0&&(r=10),i===void 0&&(i=fE);const{isTop:g,isBottom:m,isLeft:b,isRight:v}=Mm(o),S={x:0,y:0},_={x:0,y:0},x={height:e.height*i.y,width:e.width*i.x};return!g&&l<=e.top+x.height?(S.y=fn.Backward,_.y=r*Math.abs((e.top+x.height-l)/x.height)):!m&&f>=e.bottom-x.height&&(S.y=fn.Forward,_.y=r*Math.abs((e.bottom-x.height-f)/x.height)),!v&&d>=e.right-x.width?(S.x=fn.Forward,_.x=r*Math.abs((e.right-x.width-d)/x.width)):!b&&u<=e.left+x.width&&(S.x=fn.Backward,_.x=r*Math.abs((e.left+x.width-u)/x.width)),{direction:S,speed:_}}function gE(o){if(o===document.scrollingElement){const{innerWidth:l,innerHeight:u}=window;return{top:0,left:0,right:l,bottom:u,width:l,height:u}}const{top:e,left:n,right:r,bottom:i}=o.getBoundingClientRect();return{top:e,left:n,right:r,bottom:i,width:o.clientWidth,height:o.clientHeight}}function $m(o){return o.reduce((e,n)=>cs(e,Kd(n)),ya)}function pE(o){return o.reduce((e,n)=>e+Dm(n),0)}function mE(o){return o.reduce((e,n)=>e+Om(n),0)}function yE(o,e){if(e===void 0&&(e=us),!o)return;const{top:n,left:r,bottom:i,right:l}=e(o);km(o)&&(i<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&o.scrollIntoView({block:"center",inline:"center"})}const bE=[["x",["left","right"],pE],["y",["top","bottom"],mE]];class Wd{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=rc(n),i=$m(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[l,u,d]of bE)for(const f of u)Object.defineProperty(this,f,{get:()=>{const g=d(r),m=i[l]-g;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vo{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var i;(i=this.target)==null||i.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function vE(o){const{EventTarget:e}=Mn(o);return o instanceof e?o:ls(o)}function Yd(o,e){const n=Math.abs(o.x),r=Math.abs(o.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var ea;(function(o){o.Click="click",o.DragStart="dragstart",o.Keydown="keydown",o.ContextMenu="contextmenu",o.Resize="resize",o.SelectionChange="selectionchange",o.VisibilityChange="visibilitychange"})(ea||(ea={}));function Nm(o){o.preventDefault()}function SE(o){o.stopPropagation()}var st;(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"})(st||(st={}));const Im={start:[st.Space,st.Enter],cancel:[st.Esc],end:[st.Space,st.Enter,st.Tab]},wE=(o,e)=>{let{currentCoordinates:n}=e;switch(o.code){case st.Right:return{...n,x:n.x+25};case st.Left:return{...n,x:n.x-25};case st.Down:return{...n,y:n.y+25};case st.Up:return{...n,y:n.y-25}}};class Xd{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new vo(ls(n)),this.windowListeners=new vo(Mn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ea.Resize,this.handleCancel),this.windowListeners.add(ea.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ea.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&yE(r),n(ya)}handleKeyDown(e){if(Gd(e)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:l=Im,coordinateGetter:u=wE,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}=r.current,m=g?{x:g.left,y:g.top}:ya;this.referenceCoordinates||(this.referenceCoordinates=m);const b=u(e,{active:n,context:r.current,currentCoordinates:m});if(b){const v=yo(b,m),S={x:0,y:0},{scrollableAncestors:_}=r.current;for(const x of _){const k=e.code,{isTop:O,isRight:M,isLeft:T,isBottom:D,maxScroll:j,minScroll:H}=Mm(x),P=gE(x),X={x:Math.min(k===st.Right?P.right-P.width/2:P.right,Math.max(k===st.Right?P.left:P.left+P.width/2,b.x)),y:Math.min(k===st.Down?P.bottom-P.height/2:P.bottom,Math.max(k===st.Down?P.top:P.top+P.height/2,b.y))},pe=k===st.Right&&!M||k===st.Left&&!T,_e=k===st.Down&&!D||k===st.Up&&!O;if(pe&&X.x!==b.x){const we=x.scrollLeft+v.x,Me=k===st.Right&&we<=j.x||k===st.Left&&we>=H.x;if(Me&&!v.y){x.scrollTo({left:we,behavior:d});return}Me?S.x=x.scrollLeft-we:S.x=k===st.Right?x.scrollLeft-j.x:x.scrollLeft-H.x,S.x&&x.scrollBy({left:-S.x,behavior:d});break}else if(_e&&X.y!==b.y){const we=x.scrollTop+v.y,Me=k===st.Down&&we<=j.y||k===st.Up&&we>=H.y;if(Me&&!v.x){x.scrollTo({top:we,behavior:d});return}Me?S.y=x.scrollTop-we:S.y=k===st.Down?x.scrollTop-j.y:x.scrollTop-H.y,S.y&&x.scrollBy({top:-S.y,behavior:d});break}}this.handleMove(e,cs(yo(b,this.referenceCoordinates),S))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Xd.activators=[{eventName:"onKeyDown",handler:(o,e,n)=>{let{keyboardCodes:r=Im,onActivation:i}=e,{active:l}=n;const{code:u}=o.nativeEvent;if(r.start.includes(u)){const d=l.activatorNode.current;return d&&o.target!==d?!1:(o.preventDefault(),i?.({event:o.nativeEvent}),!0)}return!1}}];function Hm(o){return!!(o&&"distance"in o)}function zm(o){return!!(o&&"delay"in o)}class Jd{constructor(e,n,r){var i;r===void 0&&(r=vE(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:l}=e,{target:u}=l;this.props=e,this.events=n,this.document=ls(u),this.documentListeners=new vo(this.document),this.listeners=new vo(r),this.windowListeners=new vo(Mn(u)),this.initialCoordinates=(i=Vd(l))!=null?i:ya,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(ea.Resize,this.handleCancel),this.windowListeners.add(ea.DragStart,Nm),this.windowListeners.add(ea.VisibilityChange,this.handleCancel),this.windowListeners.add(ea.ContextMenu,Nm),this.documentListeners.add(ea.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zm(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Hm(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:i}=this.props;i(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(ea.Click,SE,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ea.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:i,props:l}=this,{onMove:u,options:{activationConstraint:d}}=l;if(!i)return;const f=(n=Vd(e))!=null?n:ya,g=yo(i,f);if(!r&&d){if(Hm(d)){if(d.tolerance!=null&&Yd(g,d.tolerance))return this.handleCancel();if(Yd(g,d.distance))return this.handleStart()}if(zm(d)&&Yd(g,d.tolerance))return this.handleCancel();this.handlePending(d,g);return}e.cancelable&&e.preventDefault(),u(f)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===st.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const CE={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Qd extends Jd{constructor(e){const{event:n}=e,r=ls(n.target);super(e,CE,r)}}Qd.activators=[{eventName:"onPointerDown",handler:(o,e)=>{let{nativeEvent:n}=o,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const EE={move:{name:"mousemove"},end:{name:"mouseup"}};var Zd;(function(o){o[o.RightClick=2]="RightClick"})(Zd||(Zd={}));class _E extends Jd{constructor(e){super(e,EE,ls(e.event.target))}}_E.activators=[{eventName:"onMouseDown",handler:(o,e)=>{let{nativeEvent:n}=o,{onActivation:r}=e;return n.button===Zd.RightClick?!1:(r?.({event:n}),!0)}}];const ef={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class AE extends Jd{constructor(e){super(e,ef)}static setup(){return window.addEventListener(ef.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ef.move.name,e)};function e(){}}}AE.activators=[{eventName:"onTouchStart",handler:(o,e)=>{let{nativeEvent:n}=o,{onActivation:r}=e;const{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var So;(function(o){o[o.Pointer=0]="Pointer",o[o.DraggableRect=1]="DraggableRect"})(So||(So={}));var ic;(function(o){o[o.TreeOrder=0]="TreeOrder",o[o.ReversedTreeOrder=1]="ReversedTreeOrder"})(ic||(ic={}));function xE(o){let{acceleration:e,activator:n=So.Pointer,canScroll:r,draggingRect:i,enabled:l,interval:u=5,order:d=ic.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:m,delta:b,threshold:v}=o;const S=RE({delta:b,disabled:!l}),[_,x]=zC(),k=I.useRef({x:0,y:0}),O=I.useRef({x:0,y:0}),M=I.useMemo(()=>{switch(n){case So.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case So.DraggableRect:return i}},[n,i,f]),T=I.useRef(null),D=I.useCallback(()=>{const H=T.current;if(!H)return;const P=k.current.x*O.current.x,X=k.current.y*O.current.y;H.scrollBy(P,X)},[]),j=I.useMemo(()=>d===ic.TreeOrder?[...g].reverse():g,[d,g]);I.useEffect(()=>{if(!l||!g.length||!M){x();return}for(const H of j){if(r?.(H)===!1)continue;const P=g.indexOf(H),X=m[P];if(!X)continue;const{direction:pe,speed:_e}=hE(H,X,M,e,v);for(const we of["x","y"])S[we][pe[we]]||(_e[we]=0,pe[we]=0);if(_e.x>0||_e.y>0){x(),T.current=H,_(D,u),k.current=_e,O.current=pe;return}}k.current={x:0,y:0},O.current={x:0,y:0},x()},[e,D,r,x,l,u,JSON.stringify(M),JSON.stringify(S),_,g,j,m,JSON.stringify(v)])}const TE={x:{[fn.Backward]:!1,[fn.Forward]:!1},y:{[fn.Backward]:!1,[fn.Forward]:!1}};function RE(o){let{delta:e,disabled:n}=o;const r=Pd(e);return po(i=>{if(n||!r||!i)return TE;const l={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[fn.Backward]:i.x[fn.Backward]||l.x===-1,[fn.Forward]:i.x[fn.Forward]||l.x===1},y:{[fn.Backward]:i.y[fn.Backward]||l.y===-1,[fn.Forward]:i.y[fn.Forward]||l.y===1}}},[n,e,r])}function kE(o,e){const n=e!=null?o.get(e):void 0,r=n?n.node.current:null;return po(i=>{var l;return e==null?null:(l=r??i)!=null?l:null},[r,e])}function DE(o,e){return I.useMemo(()=>o.reduce((n,r)=>{const{sensor:i}=r,l=i.activators.map(u=>({eventName:u.eventName,handler:e(u.handler,r)}));return[...n,...l]},[]),[o,e])}var wo;(function(o){o[o.Always=0]="Always",o[o.BeforeDragging=1]="BeforeDragging",o[o.WhileDragging=2]="WhileDragging"})(wo||(wo={}));var tf;(function(o){o.Optimized="optimized"})(tf||(tf={}));const jm=new Map;function OE(o,e){let{dragging:n,dependencies:r,config:i}=e;const[l,u]=I.useState(null),{frequency:d,measure:f,strategy:g}=i,m=I.useRef(o),b=k(),v=go(b),S=I.useCallback(function(O){O===void 0&&(O=[]),!v.current&&u(M=>M===null?O:M.concat(O.filter(T=>!M.includes(T))))},[v]),_=I.useRef(null),x=po(O=>{if(b&&!n)return jm;if(!O||O===jm||m.current!==o||l!=null){const M=new Map;for(let T of o){if(!T)continue;if(l&&l.length>0&&!l.includes(T.id)&&T.rect.current){M.set(T.id,T.rect.current);continue}const D=T.node.current,j=D?new Wd(f(D),D):null;T.rect.current=j,j&&M.set(T.id,j)}return M}return O},[o,l,n,b,f]);return I.useEffect(()=>{m.current=o},[o]),I.useEffect(()=>{b||S()},[n,b]),I.useEffect(()=>{l&&l.length>0&&u(null)},[JSON.stringify(l)]),I.useEffect(()=>{b||typeof d!="number"||_.current!==null||(_.current=setTimeout(()=>{S(),_.current=null},d))},[d,b,S,...r]),{droppableRects:x,measureDroppableContainers:S,measuringScheduled:l!=null};function k(){switch(g){case wo.Always:return!1;case wo.BeforeDragging:return n;default:return!n}}}function Um(o,e){return po(n=>o?n||(typeof e=="function"?e(o):o):null,[e,o])}function LE(o,e){return Um(o,e)}function ME(o){let{callback:e,disabled:n}=o;const r=Bd(e),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return I.useEffect(()=>()=>i?.disconnect(),[i]),i}function sc(o){let{callback:e,disabled:n}=o;const r=Bd(e),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return I.useEffect(()=>()=>i?.disconnect(),[i]),i}function $E(o){return new Wd(us(o),o)}function Bm(o,e,n){e===void 0&&(e=$E);const[r,i]=I.useState(null);function l(){i(f=>{if(!o)return null;if(o.isConnected===!1){var g;return(g=f??n)!=null?g:null}const m=e(o);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const u=ME({callback(f){if(o)for(const g of f){const{type:m,target:b}=g;if(m==="childList"&&b instanceof HTMLElement&&b.contains(o)){l();break}}}}),d=sc({callback:l});return za(()=>{l(),o?(d?.observe(o),u?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),u?.disconnect())},[o]),r}function NE(o){const e=Um(o);return Tm(o,e)}const Pm=[];function IE(o){const e=I.useRef(o),n=po(r=>o?r&&r!==Pm&&o&&e.current&&o.parentNode===e.current.parentNode?r:rc(o):Pm,[o]);return I.useEffect(()=>{e.current=o},[o]),n}function HE(o){const[e,n]=I.useState(null),r=I.useRef(o),i=I.useCallback(l=>{const u=Fd(l.target);u&&n(d=>d?(d.set(u,Kd(u)),new Map(d)):null)},[]);return I.useEffect(()=>{const l=r.current;if(o!==l){u(l);const d=o.map(f=>{const g=Fd(f);return g?(g.addEventListener("scroll",i,{passive:!0}),[g,Kd(g)]):null}).filter(f=>f!=null);n(d.length?new Map(d):null),r.current=o}return()=>{u(o),u(l)};function u(d){d.forEach(f=>{const g=Fd(f);g?.removeEventListener("scroll",i)})}},[i,o]),I.useMemo(()=>o.length?e?Array.from(e.values()).reduce((l,u)=>cs(l,u),ya):$m(o):ya,[o,e])}function qm(o,e){e===void 0&&(e=[]);const n=I.useRef(null);return I.useEffect(()=>{n.current=null},e),I.useEffect(()=>{const r=o!==ya;r&&!n.current&&(n.current=o),!r&&n.current&&(n.current=null)},[o]),n.current?yo(o,n.current):ya}function zE(o){I.useEffect(()=>{if(!tc)return;const e=o.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},o.map(e=>{let{sensor:n}=e;return n}))}function jE(o,e){return I.useMemo(()=>o.reduce((n,r)=>{let{eventName:i,handler:l}=r;return n[i]=u=>{l(u,e)},n},{}),[o,e])}function Gm(o){return I.useMemo(()=>o?cE(o):null,[o])}const Vm=[];function UE(o,e){e===void 0&&(e=us);const[n]=o,r=Gm(n?Mn(n):null),[i,l]=I.useState(Vm);function u(){l(()=>o.length?o.map(f=>Lm(f)?r:new Wd(e(f),f)):Vm)}const d=sc({callback:u});return za(()=>{d?.disconnect(),u(),o.forEach(f=>d?.observe(f))},[o]),i}function BE(o){if(!o)return null;if(o.children.length>1)return o;const e=o.children[0];return ho(e)?e:o}function PE(o){let{measure:e}=o;const[n,r]=I.useState(null),i=I.useCallback(g=>{for(const{target:m}of g)if(ho(m)){r(b=>{const v=e(m);return b?{...b,width:v.width,height:v.height}:v});break}},[e]),l=sc({callback:i}),u=I.useCallback(g=>{const m=BE(g);l?.disconnect(),m&&l?.observe(m),r(m?e(m):null)},[e,l]),[d,f]=nc(u);return I.useMemo(()=>({nodeRef:d,rect:n,setRef:f}),[n,d,f])}const qE=[{sensor:Qd,options:{}},{sensor:Xd,options:{}}],GE={current:{}},oc={draggable:{measure:Rm},droppable:{measure:Rm,strategy:wo.WhileDragging,frequency:tf.Optimized},dragOverlay:{measure:us}};class Co extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const VE={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Co,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ac},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:oc,measureDroppableContainers:ac,windowRect:null,measuringScheduled:!1},FE={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ac,draggableNodes:new Map,over:null,measureDroppableContainers:ac},lc=I.createContext(FE),Fm=I.createContext(VE);function KE(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Co}}}function WE(o,e){switch(e.type){case rn.DragStart:return{...o,draggable:{...o.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case rn.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 rn.DragEnd:case rn.DragCancel:return{...o,draggable:{...o.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case rn.RegisterDroppable:{const{element:n}=e,{id:r}=n,i=new Co(o.droppable.containers);return i.set(r,n),{...o,droppable:{...o.droppable,containers:i}}}case rn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=e,l=o.droppable.containers.get(n);if(!l||r!==l.key)return o;const u=new Co(o.droppable.containers);return u.set(n,{...l,disabled:i}),{...o,droppable:{...o.droppable,containers:u}}}case rn.UnregisterDroppable:{const{id:n,key:r}=e,i=o.droppable.containers.get(n);if(!i||r!==i.key)return o;const l=new Co(o.droppable.containers);return l.delete(n),{...o,droppable:{...o.droppable,containers:l}}}default:return o}}function YE(o){let{disabled:e}=o;const{active:n,activatorEvent:r,draggableNodes:i}=I.useContext(lc),l=Pd(r),u=Pd(n?.id);return I.useEffect(()=>{if(!e&&!r&&l&&u!=null){if(!Gd(l)||document.activeElement===l.target)return;const d=i.get(u);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 b=BC(m);if(b){b.focus();break}}})}},[r,e,i,u,l]),null}function XE(o,e){let{transform:n,...r}=e;return o!=null&&o.length?o.reduce((i,l)=>l({transform:i,...r}),n):n}function JE(o){return I.useMemo(()=>({draggable:{...oc.draggable,...o?.draggable},droppable:{...oc.droppable,...o?.droppable},dragOverlay:{...oc.dragOverlay,...o?.dragOverlay}}),[o?.draggable,o?.droppable,o?.dragOverlay])}function QE(o){let{activeNode:e,measure:n,initialRect:r,config:i=!0}=o;const l=I.useRef(!1),{x:u,y:d}=typeof i=="boolean"?{x:i,y:i}:i;za(()=>{if(!u&&!d||!e){l.current=!1;return}if(l.current||!r)return;const g=e?.node.current;if(!g||g.isConnected===!1)return;const m=n(g),b=Tm(m,r);if(u||(b.x=0),d||(b.y=0),l.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const v=km(g);v&&v.scrollBy({top:b.y,left:b.x})}},[e,u,d,r,n])}const Km=I.createContext({...ya,scaleX:1,scaleY:1});var xr;(function(o){o[o.Uninitialized=0]="Uninitialized",o[o.Initializing=1]="Initializing",o[o.Initialized=2]="Initialized"})(xr||(xr={}));const ZE=I.memo(function(e){var n,r,i,l;let{id:u,accessibility:d,autoScroll:f=!0,children:g,sensors:m=qE,collisionDetection:b=nE,measuring:v,modifiers:S,..._}=e;const x=I.useReducer(WE,void 0,KE),[k,O]=x,[M,T]=KC(),[D,j]=I.useState(xr.Uninitialized),H=D===xr.Initialized,{draggable:{active:P,nodes:X,translate:pe},droppable:{containers:_e}}=k,we=P!=null?X.get(P):null,Me=I.useRef({initial:null,translated:null}),qe=I.useMemo(()=>{var Te;return P!=null?{id:P,data:(Te=we?.data)!=null?Te:GE,rect:Me}:null},[P,we]),Je=I.useRef(null),[gt,Q]=I.useState(null),[fe,ve]=I.useState(null),ae=go(_,Object.values(_)),ge=mo("DndDescribedBy",u),A=I.useMemo(()=>_e.getEnabled(),[_e]),K=JE(v),{droppableRects:ue,measureDroppableContainers:he,measuringScheduled:le}=OE(A,{dragging:H,dependencies:[pe.x,pe.y],config:K.droppable}),de=kE(X,P),Oe=I.useMemo(()=>fe?Vd(fe):null,[fe]),He=me(),Pe=LE(de,K.draggable.measure);QE({activeNode:P!=null?X.get(P):null,config:He.layoutShiftCompensation,initialRect:Pe,measure:K.draggable.measure});const ke=Bm(de,K.draggable.measure,Pe),Ot=Bm(de?de.parentElement:null),ut=I.useRef({activatorEvent:null,active:null,activeNode:de,collisionRect:null,collisions:null,droppableRects:ue,draggableNodes:X,draggingNode:null,draggingNodeRect:null,droppableContainers:_e,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ct=_e.getNodeFor((n=ut.current.over)==null?void 0:n.id),vt=PE({measure:K.dragOverlay.measure}),kt=(r=vt.nodeRef.current)!=null?r:de,Ee=H?(i=vt.rect)!=null?i:ke:null,Nt=!!(vt.nodeRef.current&&vt.rect),zt=NE(Nt?null:ke),qt=Gm(kt?Mn(kt):null),Lt=IE(H?Ct??de:null),_n=UE(Lt),hn=XE(S,{transform:{x:pe.x-zt.x,y:pe.y-zt.y,scaleX:1,scaleY:1},activatorEvent:fe,active:qe,activeNodeRect:ke,containerNodeRect:Ot,draggingNodeRect:Ee,over:ut.current.over,overlayNodeRect:vt.rect,scrollableAncestors:Lt,scrollableAncestorRects:_n,windowRect:qt}),Ba=Oe?cs(Oe,pe):null,Jt=HE(Lt),Dr=qm(Jt),tr=qm(Jt,[ke]),An=cs(hn,Dr),sn=Ee?iE(Ee,hn):null,tt=qe&&sn?b({active:qe,collisionRect:sn,droppableRects:ue,droppableContainers:A,pointerCoordinates:Ba}):null,na=Am(tt,"id"),[kn,nr]=I.useState(null),_a=Nt?hn:cs(hn,tr),on=aE(_a,(l=kn?.rect)!=null?l:null,ke),Dn=I.useRef(null),q=I.useCallback((Te,xe)=>{let{sensor:je,options:ze}=xe;if(Je.current==null)return;const $e=X.get(Je.current);if(!$e)return;const De=Te.nativeEvent,Ye=new je({active:Je.current,activeNode:$e,event:De,options:ze,context:ut,onAbort(Ae){if(!X.get(Ae))return;const{onDragAbort:Ue}=ae.current,ot={id:Ae};Ue?.(ot),M({type:"onDragAbort",event:ot})},onPending(Ae,Re,Ue,ot){if(!X.get(Ae))return;const{onDragPending:Qt}=ae.current,Kt={id:Ae,constraint:Re,initialCoordinates:Ue,offset:ot};Qt?.(Kt),M({type:"onDragPending",event:Kt})},onStart(Ae){const Re=Je.current;if(Re==null)return;const Ue=X.get(Re);if(!Ue)return;const{onDragStart:ot}=ae.current,At={activatorEvent:De,active:{id:Re,data:Ue.data,rect:Me}};Ar.unstable_batchedUpdates(()=>{ot?.(At),j(xr.Initializing),O({type:rn.DragStart,initialCoordinates:Ae,active:Re}),M({type:"onDragStart",event:At}),Q(Dn.current),ve(De)})},onMove(Ae){O({type:rn.DragMove,coordinates:Ae})},onEnd:Ke(rn.DragEnd),onCancel:Ke(rn.DragCancel)});Dn.current=Ye;function Ke(Ae){return async function(){const{active:Ue,collisions:ot,over:At,scrollAdjustedTranslate:Qt}=ut.current;let Kt=null;if(Ue&&Qt){const{cancelDrop:Fn}=ae.current;Kt={activatorEvent:De,active:Ue,collisions:ot,delta:Qt,over:At},Ae===rn.DragEnd&&typeof Fn=="function"&&await Promise.resolve(Fn(Kt))&&(Ae=rn.DragCancel)}Je.current=null,Ar.unstable_batchedUpdates(()=>{O({type:Ae}),j(xr.Uninitialized),nr(null),Q(null),ve(null),Dn.current=null;const Fn=Ae===rn.DragEnd?"onDragEnd":"onDragCancel";if(Kt){const Nn=ae.current[Fn];Nn?.(Kt),M({type:Fn,event:Kt})}})}}},[X]),ie=I.useCallback((Te,xe)=>(je,ze)=>{const $e=je.nativeEvent,De=X.get(ze);if(Je.current!==null||!De||$e.dndKit||$e.defaultPrevented)return;const Ye={active:De};Te(je,xe.options,Ye)===!0&&($e.dndKit={capturedBy:xe.sensor},Je.current=ze,q(je,xe))},[X,q]),oe=DE(m,ie);zE(m),za(()=>{ke&&D===xr.Initializing&&j(xr.Initialized)},[ke,D]),I.useEffect(()=>{const{onDragMove:Te}=ae.current,{active:xe,activatorEvent:je,collisions:ze,over:$e}=ut.current;if(!xe||!je)return;const De={active:xe,activatorEvent:je,collisions:ze,delta:{x:An.x,y:An.y},over:$e};Ar.unstable_batchedUpdates(()=>{Te?.(De),M({type:"onDragMove",event:De})})},[An.x,An.y]),I.useEffect(()=>{const{active:Te,activatorEvent:xe,collisions:je,droppableContainers:ze,scrollAdjustedTranslate:$e}=ut.current;if(!Te||Je.current==null||!xe||!$e)return;const{onDragOver:De}=ae.current,Ye=ze.get(na),Ke=Ye&&Ye.rect.current?{id:Ye.id,rect:Ye.rect.current,data:Ye.data,disabled:Ye.disabled}:null,Ae={active:Te,activatorEvent:xe,collisions:je,delta:{x:$e.x,y:$e.y},over:Ke};Ar.unstable_batchedUpdates(()=>{nr(Ke),De?.(Ae),M({type:"onDragOver",event:Ae})})},[na]),za(()=>{ut.current={activatorEvent:fe,active:qe,activeNode:de,collisionRect:sn,collisions:tt,droppableRects:ue,draggableNodes:X,draggingNode:kt,draggingNodeRect:Ee,droppableContainers:_e,over:kn,scrollableAncestors:Lt,scrollAdjustedTranslate:An},Me.current={initial:Ee,translated:sn}},[qe,de,tt,sn,X,kt,Ee,ue,_e,kn,Lt,An]),xE({...He,delta:pe,draggingRect:sn,pointerCoordinates:Ba,scrollableAncestors:Lt,scrollableAncestorRects:_n});const Z=I.useMemo(()=>({active:qe,activeNode:de,activeNodeRect:ke,activatorEvent:fe,collisions:tt,containerNodeRect:Ot,dragOverlay:vt,draggableNodes:X,droppableContainers:_e,droppableRects:ue,over:kn,measureDroppableContainers:he,scrollableAncestors:Lt,scrollableAncestorRects:_n,measuringConfiguration:K,measuringScheduled:le,windowRect:qt}),[qe,de,ke,fe,tt,Ot,vt,X,_e,ue,kn,he,Lt,_n,K,le,qt]),be=I.useMemo(()=>({activatorEvent:fe,activators:oe,active:qe,activeNodeRect:ke,ariaDescribedById:{draggable:ge},dispatch:O,draggableNodes:X,over:kn,measureDroppableContainers:he}),[fe,oe,qe,ke,O,ge,X,kn,he]);return Xe.createElement(Sm.Provider,{value:T},Xe.createElement(lc.Provider,{value:be},Xe.createElement(Fm.Provider,{value:Z},Xe.createElement(Km.Provider,{value:on},g)),Xe.createElement(YE,{disabled:d?.restoreFocus===!1})),Xe.createElement(XC,{...d,hiddenTextDescribedById:ge}));function me(){const Te=gt?.autoScrollEnabled===!1,xe=typeof f=="object"?f.enabled===!1:f===!1,je=H&&!Te&&!xe;return typeof f=="object"?{...f,enabled:je}:{enabled:je}}}),e_=I.createContext(null),Wm="button",t_="Draggable";function n_(o){let{id:e,data:n,disabled:r=!1,attributes:i}=o;const l=mo(t_),{activators:u,activatorEvent:d,active:f,activeNodeRect:g,ariaDescribedById:m,draggableNodes:b,over:v}=I.useContext(lc),{role:S=Wm,roleDescription:_="draggable",tabIndex:x=0}=i??{},k=f?.id===e,O=I.useContext(k?Km:e_),[M,T]=nc(),[D,j]=nc(),H=jE(u,e),P=go(n);za(()=>(b.set(e,{id:e,key:l,node:M,activatorNode:D,data:P}),()=>{const pe=b.get(e);pe&&pe.key===l&&b.delete(e)}),[b,e]);const X=I.useMemo(()=>({role:S,tabIndex:x,"aria-disabled":r,"aria-pressed":k&&S===Wm?!0:void 0,"aria-roledescription":_,"aria-describedby":m.draggable}),[r,S,x,k,_,m.draggable]);return{active:f,activatorEvent:d,activeNodeRect:g,attributes:X,isDragging:k,listeners:r?void 0:H,node:M,over:v,setNodeRef:T,setActivatorNodeRef:j,transform:O}}function a_(){return I.useContext(Fm)}const r_="Droppable",i_={timeout:25};function s_(o){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:i}=o;const l=mo(r_),{active:u,dispatch:d,over:f,measureDroppableContainers:g}=I.useContext(lc),m=I.useRef({disabled:n}),b=I.useRef(!1),v=I.useRef(null),S=I.useRef(null),{disabled:_,updateMeasurementsFor:x,timeout:k}={...i_,...i},O=go(x??r),M=I.useCallback(()=>{if(!b.current){b.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(O.current)?O.current:[O.current]),S.current=null},k)},[k]),T=sc({callback:M,disabled:_||!u}),D=I.useCallback((X,pe)=>{T&&(pe&&(T.unobserve(pe),b.current=!1),X&&T.observe(X))},[T]),[j,H]=nc(D),P=go(e);return I.useEffect(()=>{!T||!j.current||(T.disconnect(),b.current=!1,T.observe(j.current))},[j,T]),I.useEffect(()=>(d({type:rn.RegisterDroppable,element:{id:r,key:l,disabled:n,node:j,rect:v,data:P}}),()=>d({type:rn.UnregisterDroppable,key:l,id:r})),[r]),I.useEffect(()=>{n!==m.current.disabled&&(d({type:rn.SetDroppableDisabled,id:r,key:l,disabled:n}),m.current.disabled=n)},[r,l,n,d]),{active:u,rect:v,isOver:f?.id===r,node:j,over:f,setNodeRef:H}}function nf(o,e,n){const r=o.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function o_(o,e){return o.reduce((n,r,i)=>{const l=e.get(r);return l&&(n[i]=l),n},Array(o.length))}function cc(o){return o!==null&&o>=0}function l_(o,e){if(o===e)return!0;if(o.length!==e.length)return!1;for(let n=0;n<o.length;n++)if(o[n]!==e[n])return!1;return!0}function c_(o){return typeof o=="boolean"?{draggable:o,droppable:o}:o}const uc={scaleX:1,scaleY:1},u_=o=>{var e;let{rects:n,activeNodeRect:r,activeIndex:i,overIndex:l,index:u}=o;const d=(e=n[i])!=null?e:r;if(!d)return null;const f=d_(n,u,i);if(u===i){const g=n[l];return g?{x:i<l?g.left+g.width-(d.left+d.width):g.left-d.left,y:0,...uc}:null}return u>i&&u<=l?{x:-d.width-f,y:0,...uc}:u<i&&u>=l?{x:d.width+f,y:0,...uc}:{x:0,y:0,...uc}};function d_(o,e,n){const r=o[e],i=o[e-1],l=o[e+1];return!r||!i&&!l?0:n<e?i?r.left-(i.left+i.width):l.left-(r.left+r.width):l?l.left-(r.left+r.width):r.left-(i.left+i.width)}const af=o=>{let{rects:e,activeIndex:n,overIndex:r,index:i}=o;const l=nf(e,r,n),u=e[i],d=l[i];return!d||!u?null:{x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height}},dc={scaleX:1,scaleY:1},f_=o=>{var e;let{activeIndex:n,activeNodeRect:r,index:i,rects:l,overIndex:u}=o;const d=(e=l[n])!=null?e:r;if(!d)return null;if(i===n){const g=l[u];return g?{x:0,y:n<u?g.top+g.height-(d.top+d.height):g.top-d.top,...dc}:null}const f=h_(l,i,n);return i>n&&i<=u?{x:0,y:-d.height-f,...dc}:i<n&&i>=u?{x:0,y:d.height+f,...dc}:{x:0,y:0,...dc}};function h_(o,e,n){const r=o[e],i=o[e-1],l=o[e+1];return r?n<e?i?r.top-(i.top+i.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const Ym="Sortable",Xm=Xe.createContext({activeIndex:-1,containerId:Ym,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:af,disabled:{draggable:!1,droppable:!1}});function g_(o){let{children:e,id:n,items:r,strategy:i=af,disabled:l=!1}=o;const{active:u,dragOverlay:d,droppableRects:f,over:g,measureDroppableContainers:m}=a_(),b=mo(Ym,n),v=d.rect!==null,S=I.useMemo(()=>r.map(H=>typeof H=="object"&&"id"in H?H.id:H),[r]),_=u!=null,x=u?S.indexOf(u.id):-1,k=g?S.indexOf(g.id):-1,O=I.useRef(S),M=!l_(S,O.current),T=k!==-1&&x===-1||M,D=c_(l);za(()=>{M&&_&&m(S)},[M,S,_,m]),I.useEffect(()=>{O.current=S},[S]);const j=I.useMemo(()=>({activeIndex:x,containerId:b,disabled:D,disableTransforms:T,items:S,overIndex:k,useDragOverlay:v,sortedRects:o_(S,f),strategy:i}),[x,b,D.draggable,D.droppable,T,S,k,f,v,i]);return Xe.createElement(Xm.Provider,{value:j},e)}const p_=o=>{let{id:e,items:n,activeIndex:r,overIndex:i}=o;return nf(n,r,i).indexOf(e)},m_=o=>{let{containerId:e,isSorting:n,wasDragging:r,index:i,items:l,newIndex:u,previousItems:d,previousContainerId:f,transition:g}=o;return!g||!r||d!==l&&i===u?!1:n?!0:u!==i&&e===f},y_={duration:200,easing:"ease"},Jm="transform",b_=bo.Transition.toString({property:Jm,duration:0,easing:"linear"}),v_={roleDescription:"sortable"};function S_(o){let{disabled:e,index:n,node:r,rect:i}=o;const[l,u]=I.useState(null),d=I.useRef(n);return za(()=>{if(!e&&n!==d.current&&r.current){const f=i.current;if(f){const g=us(r.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)&&u(m)}}n!==d.current&&(d.current=n)},[e,n,r,i]),I.useEffect(()=>{l&&u(null)},[l]),l}function w_(o){let{animateLayoutChanges:e=m_,attributes:n,disabled:r,data:i,getNewIndex:l=p_,id:u,strategy:d,resizeObserverConfig:f,transition:g=y_}=o;const{items:m,containerId:b,activeIndex:v,disabled:S,disableTransforms:_,sortedRects:x,overIndex:k,useDragOverlay:O,strategy:M}=I.useContext(Xm),T=C_(r,S),D=m.indexOf(u),j=I.useMemo(()=>({sortable:{containerId:b,index:D,items:m},...i}),[b,i,D,m]),H=I.useMemo(()=>m.slice(m.indexOf(u)),[m,u]),{rect:P,node:X,isOver:pe,setNodeRef:_e}=s_({id:u,data:j,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:H,...f}}),{active:we,activatorEvent:Me,activeNodeRect:qe,attributes:Je,setNodeRef:gt,listeners:Q,isDragging:fe,over:ve,setActivatorNodeRef:ae,transform:ge}=n_({id:u,data:j,attributes:{...v_,...n},disabled:T.draggable}),A=HC(_e,gt),K=!!we,ue=K&&!_&&cc(v)&&cc(k),he=!O&&fe,le=he&&ue?ge:null,Oe=ue?le??(d??M)({rects:x,activeNodeRect:qe,activeIndex:v,overIndex:k,index:D}):null,He=cc(v)&&cc(k)?l({id:u,items:m,activeIndex:v,overIndex:k}):D,Pe=we?.id,ke=I.useRef({activeId:Pe,items:m,newIndex:He,containerId:b}),Ot=m!==ke.current.items,ut=e({active:we,containerId:b,isDragging:fe,isSorting:K,id:u,index:D,items:m,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:g,wasDragging:ke.current.activeId!=null}),Ct=S_({disabled:!ut,index:D,node:X,rect:P});return I.useEffect(()=>{K&&ke.current.newIndex!==He&&(ke.current.newIndex=He),b!==ke.current.containerId&&(ke.current.containerId=b),m!==ke.current.items&&(ke.current.items=m)},[K,He,b,m]),I.useEffect(()=>{if(Pe===ke.current.activeId)return;if(Pe!=null&&ke.current.activeId==null){ke.current.activeId=Pe;return}const kt=setTimeout(()=>{ke.current.activeId=Pe},50);return()=>clearTimeout(kt)},[Pe]),{active:we,activeIndex:v,attributes:Je,data:j,rect:P,index:D,newIndex:He,items:m,isOver:pe,isSorting:K,isDragging:fe,listeners:Q,node:X,overIndex:k,over:ve,setNodeRef:A,setActivatorNodeRef:ae,setDroppableNodeRef:_e,setDraggableNodeRef:gt,transform:Ct??Oe,transition:vt()};function vt(){if(Ct||Ot&&ke.current.newIndex===D)return b_;if(!(he&&!Gd(Me)||!g)&&(K||ut))return bo.Transition.toString({...g,property:Jm})}}function C_(o,e){var n,r;return typeof o=="boolean"?{draggable:o,droppable:!1}:{draggable:(n=o?.draggable)!=null?n:e.draggable,droppable:(r=o?.droppable)!=null?r:e.droppable}}function fc(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 E_=[st.Down,st.Right,st.Up,st.Left],__=(o,e)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:l,over:u,scrollableAncestors:d}}=e;if(E_.includes(o.code)){if(o.preventDefault(),!n||!r)return;const f=[];l.getEnabled().forEach(b=>{if(!b||b!=null&&b.disabled)return;const v=i.get(b.id);if(v)switch(o.code){case st.Down:r.top<v.top&&f.push(b);break;case st.Up:r.top>v.top&&f.push(b);break;case st.Left:r.left>v.left&&f.push(b);break;case st.Right:r.left<v.left&&f.push(b);break}});const g=eE({collisionRect:r,droppableRects:i,droppableContainers:f});let m=Am(g,"id");if(m===u?.id&&g.length>1&&(m=g[1].id),m!=null){const b=l.get(n.id),v=l.get(m),S=v?i.get(v.id):null,_=v?.node.current;if(_&&S&&b&&v){const k=rc(_).some((H,P)=>d[P]!==H),O=Qm(b,v),M=A_(b,v),T=k||!O?{x:0,y:0}:{x:M?r.width-S.width:0,y:M?r.height-S.height:0},D={x:S.left,y:S.top};return T.x&&T.y?D:yo(D,T)}}}};function Qm(o,e){return!fc(o)||!fc(e)?!1:o.data.current.sortable.containerId===e.data.current.sortable.containerId}function A_(o,e){return!fc(o)||!fc(e)||!Qm(o,e)?!1:o.data.current.sortable.index<e.data.current.sortable.index}const x_={verticalList:f_,horizontalList:u_,rectSorting:af},T_=({items:o,itemKey:e,strategy:n,children:r,onSortEnd:i,onSortStart:l,sortVersion:u})=>{const d=I.useId(),f=I.useRef({inProgress:!1,lastSortTime:0,lastActiveId:null}),g=JC(wm(Qd,{activationConstraint:{distance:5}}),wm(Xd,{coordinateGetter:__})),m=I.useCallback(S=>{f.current={inProgress:!0,lastSortTime:Date.now(),lastActiveId:S.active.id},l?.({activeId:S.active.id})},[l]),b=I.useCallback(S=>{const{active:_,over:x}=S,k=Date.now();if(!x||_.id===x.id){f.current.inProgress=!1;return}const{lastSortTime:O,lastActiveId:M,inProgress:T}=f.current;if(M===_.id&&k-O<500&&!T)return;f.current={inProgress:!1,lastSortTime:k,lastActiveId:_.id};const D=o.findIndex(H=>String(H[e])===String(_.id)),j=o.findIndex(H=>String(H[e])===String(x.id));if(D!==-1&&j!==-1&&D!==j){const H=nf(o,D,j);i?.(H,{oldIndex:D,newIndex:j})}},[o,e,i]),v=o.map(S=>String(S[e]));return ft.jsx(ZE,{id:d,sensors:g,collisionDetection:ZC,onDragStart:m,onDragEnd:b,children:ft.jsx(g_,{items:v,strategy:x_[n],children:r})},u!==void 0?`${d}-v${u}`:d)},Zm=I.createContext(null),R_=({value:o,children:e})=>ft.jsx(Zm.Provider,{value:o,children:e}),k_=()=>I.useContext(Zm),D_=({id:o,handle:e,as:n="div",children:r})=>{const{attributes:i,listeners:l,setNodeRef:u,transform:d,transition:f,isDragging:g}=w_({id:o}),m={transform:bo.Transform.toString(d),transition:f,opacity:g?.5:1,position:"relative"};return ft.jsx(n,{ref:u,style:m,...i,...e?{}:l,"data-sortable-item":!0,"data-sortable-id":String(o),"data-dragging":g,children:ft.jsx(R_,{value:{listeners:l,handle:e,isDragging:g},children:r})})},ht=dt("DynamicRenderer");function Za(){try{return window.G7Core?.devTools}catch{return}}function rf(o,e,n,r){if(typeof o=="string"){if(/\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*/.test(o))try{return e.resolveTranslations(o,n,r)}catch{return o}return o}if(Array.isArray(o))return o.map(i=>rf(i,e,n,r));if(o&&typeof o=="object"){const i={};for(const[l,u]of Object.entries(o))i[l]=rf(u,e,n,r);return i}return o}function O_(o){const e=Object.keys(o);return e.length>0&&e.every(n=>/^\d+$/.test(n))}const ba=(o,e)=>{const n=["errors"],r={...o};for(const i of Object.keys(e)){const l=e[i],u=o[i];if(l===null){r[i]=null;continue}if(n.includes(i)){r[i]=l;continue}if(Array.isArray(l)){r[i]=l;continue}if(Array.isArray(u)&&l!==null&&typeof l=="object"&&!Array.isArray(l)&&O_(l)){const d=Object.keys(l).map(g=>parseInt(g,10));if((d.length>0?Math.max(...d):0)>=u.length+d.length+10)r[i]={...l};else{const g=[...u];for(const[m,b]of Object.entries(l)){const v=parseInt(m,10);v>=0&&v<g.length?b!==null&&typeof b=="object"&&!Array.isArray(b)&&g[v]!==null&&typeof g[v]=="object"?g[v]=ba(g[v],b):g[v]=b:v>=g.length&&(g[v]=b)}r[i]=g}}else l!==null&&typeof l=="object"&&u!==null&&typeof u=="object"&&!Array.isArray(u)?r[i]=ba(u,l):r[i]=l}return r},ey=(o,e)=>{const n={...o};for(const r of Object.keys(e)){if(!(r in n))continue;const i=e[r],l=n[r];if(i!==null&&typeof i=="object"&&!Array.isArray(i)&&l!==null&&typeof l=="object"&&!Array.isArray(l)){const u=ey(l,i);Object.keys(u).length===0?delete n[r]:n[r]=u}else delete n[r]}return n},L_=o=>{const e={},n=o.split(";").filter(r=>r.trim());for(const r of n){const i=r.indexOf(":");if(i===-1)continue;const l=r.substring(0,i).trim(),u=r.substring(i+1).trim();if(l&&u){const d=l.replace(/-([a-z])/g,(f,g)=>g.toUpperCase());e[d]=u}}return e};class M_ extends I.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){ht.error(`컴포넌트 렌더링 에러 (ID: ${this.props.componentId}, Name: ${this.props.componentName}):`,e,n)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:ft.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:[ft.jsx("div",{className:"font-semibold mb-1",children:"컴포넌트 로드 실패"}),ft.jsxs("div",{className:"text-xs opacity-80",children:[this.props.componentName&&`[${this.props.componentName}] `,"데이터를 표시할 수 없습니다."]}),this.state.error&&ft.jsxs("details",{className:"mt-2",children:[ft.jsx("summary",{className:"cursor-pointer text-xs opacity-70 hover:opacity-100",children:"상세 정보"}),ft.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 ja=I.memo(({componentDef:o,dataContext:e,translationContext:n,registry:r,bindingEngine:i,translationEngine:l,actionDispatcher:u,parentComponentContext:d,parentFormContextProp:f,parentDataContext:g,isRootRenderer:m=!1,isInsideIteration:b=!1,isEditMode:v=!1,onComponentSelect:S,onComponentHover:_,onDragStart:x,onDragEnd:k,componentPath:O,layoutKey:M})=>{const[T,D]=I.useState({loadingActions:{}});I.useLayoutEffect(()=>{d||(i.startRenderCycle(),window.__g7SetLocalOverrideKeys||(window.__g7ForcedLocalFields=void 0),window.__g7PendingLocalState=null)});const j=I.useRef(null);I.useLayoutEffect(()=>{if(!d&&e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:q,_merge:ie,...oe}=e._localInit,Z=`${JSON.stringify(oe)}:${q||"no-force"}`;if(j.current!==Z){j.current=Z;const be=ie||"shallow",Te=window.G7Core?.state?.get?.()?._local||{},xe=window.__g7PendingLocalState||{},je={...Te,...xe};be==="replace"?window.__g7PendingLocalState={loadingActions:je.loadingActions||{},...oe,hasChanges:!1}:be==="deep"?window.__g7PendingLocalState=ba(je,{...oe,hasChanges:!1}):window.__g7PendingLocalState={...je,...oe,hasChanges:!1};const ze=window.__g7SetLocalOverrideKeys;ze&&typeof ze=="object"&&(be==="replace"?window.__g7SetLocalOverrideKeys={...oe,hasChanges:!1}:window.__g7SetLocalOverrideKeys=ba(ze,{...oe,hasChanges:!1}))}}}),I.useLayoutEffect(()=>{if(!d){const q=window.__g7SetLocalOverrideKeys;if(q){D(be=>ey(be,q));const ie=q,oe=window.__g7ForcedLocalFields,Z=window.__g7LastSetLocalSnapshot;queueMicrotask(()=>{window.__g7SetLocalOverrideKeys===ie&&(window.__g7SetLocalOverrideKeys=void 0),window.__g7ForcedLocalFields===oe&&(window.__g7ForcedLocalFields=void 0),window.__g7LastSetLocalSnapshot===Z&&(window.__g7LastSetLocalSnapshot=void 0)})}}},[e._local]);const H=I.useRef(M);I.useEffect(()=>{o._fromBase&&M&&H.current!==M&&(H.current=M,D({loadingActions:{}}))},[M,o._fromBase]);const P=I.useRef(""),X=I.useRef(!1),pe=I.useRef(null),_e=I.useRef({}),we=I.useRef({}),Me=I.useRef(g),qe=IC(),Je=gC(),gt=Je?.getParentDataContext()??g;I.useEffect(()=>{if(e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:q,...ie}=e._localInit,oe=JSON.stringify(ie),Z=q!==void 0,be=Id(),me=`${oe}:${q||"no-force"}`;if(be.hash!==me){be.hash=me,be.timestamp=q,P.current=oe,Z&&(X.current=!0);const{_merge:je,...ze}=ie,$e=je||"shallow";if(D(De=>$e==="replace"?{loadingActions:De.loadingActions||{},...ze,hasChanges:!1}:$e==="deep"?ba(De,{...ze,hasChanges:!1}):{...De,...ze,hasChanges:!1}),e._globalSetState){const De=e._global?._local||{};let Ye;$e==="replace"?Ye={...ze,hasChanges:!1}:$e==="deep"?Ye=ba(De,{...ze,hasChanges:!1}):Ye={...De,...ze,hasChanges:!1},e._globalSetState({_local:Ye})}i.invalidateCacheByKeys(["_local"]),ht.log("_localInit applied (data changed):",Object.keys(ie))}pe.current=e._localInit,vC(e._localInit)}},[e._localInit,g,i]);const{isTransitioning:Q}=dm(),fe=TC(),ve=f??fe,{width:ae}=zd(),ge=k_(),A=I.useMemo(()=>{let q=o;if(o.type==="iterator"&&o.data){const{data:Z,itemName:be,indexName:me,...Te}=o;q={...Te,iteration:{source:Z,item_var:be||"item",index_var:me}}}if(!q.responsive)return q;const ie=ui.getMatchingKey(q.responsive,ae);if(!ie)return q;const oe=q.responsive[ie];return{...q,props:{...q.props,...oe.props},children:oe.children??q.children,text:oe.text??q.text,if:oe.if??q.if,iteration:oe.iteration??q.iteration,__responsiveChildrenKey:oe.children!==void 0?ie:void 0}},[o,ae]),K=I.useCallback(q=>{const ie=q?.__setStateId;if(D(oe=>{const Z=window.__g7PendingLocalState,me=window.__g7SetLocalOverrideKeys||Z,Te=me?ba(oe,me):oe;if(typeof q=="function"){const De=q(Te);return ba(Te,De)}const{__mergeMode:xe,__setStateId:je,...ze}=q;let $e;if(xe==="replace"?$e=ze:xe==="shallow"?$e={...Te,...ze}:$e=ba(Te,ze),xe!==void 0){const De=window.__g7ForcedLocalFields;De&&(window.__g7ForcedLocalFields={...De,...ze})}return $e}),ie){const oe=Za();if(oe?.isEnabled()){const Z=A.id||"unknown",be=A.name||"Unknown";setTimeout(()=>{oe.trackComponentRender?.(Z,be,0,["_local"],[]),oe.completeStateChange?.(ie)},0)}}},[A.id,A.name]),ue=d?.state??T,he=d?.setState??K,le=I.useMemo(()=>{const q=e._localInit&&e._localInit!==pe.current;let ie;q&&e._local?ie=e._local:ie=e._local?ba(e._local,ue):ue;const oe=window.__g7ForcedLocalFields;oe&&(ie=ba(ie,oe));const Z={...e,_local:ie},be=e._computedDefinitions;if(be&&Object.keys(be).length>0){const me=new Rn,Te={...Z,...qe?{_isolated:qe.state}:{}},xe={},je=Za(),ze=je?.isEnabled()??!1;for(const[$e,De]of Object.entries(be)){const Ye=ze?Date.now():0,Ke=ze?e._computed?.[$e]:void 0;let Ae;try{if(typeof De=="string")if(De.startsWith("{{")&&De.endsWith("}}")){const Re=De.slice(2,-2).trim(),Ue=me.evaluateExpression(Re,Te,{skipCache:!0});xe[$e]=Ue}else xe[$e]=De;else if(De&&typeof De=="object"&&"$switch"in De){const Re=me.resolveSwitch(De,Te,{skipCache:!0});xe[$e]=Re}}catch(Re){ht.warn(`Failed to recalculate computed value: ${$e}`,Re),xe[$e]=e._computed?.[$e],Ae=Re instanceof Error?Re.message:String(Re)}if(ze&&(Ae||Ke!==xe[$e])){const Ue=Date.now()-Ye;je.trackComputedProperty?.($e,typeof De=="string"?De:JSON.stringify(De),[{type:"_local",path:"_local",value:Z._local}],xe[$e],Ue,A.id,Ae),Ke!==xe[$e]&&je.trackComputedRecalc?.($e,"dependency-change",Ke,xe[$e],Ue,{type:"_local",path:"_local"},A.id)}}Z._computed=xe}if(qe&&(Z._isolated=qe.state),gt&&(Z.$parent=gt),o.extensionPointProps){const me=i.resolveObject(o.extensionPointProps,Z,b?{skipCache:!0}:void 0);Z.extensionPointProps=v&&l?rf(me,l,n,Z):me}return o.extensionPointCallbacks&&(Z.extensionPointCallbacks=o.extensionPointCallbacks),v&&(Z.$templateId===void 0&&n?.templateId&&(Z.$templateId=n.templateId),Z.$locale===void 0&&n?.locale&&(Z.$locale=n.locale)),Z},[e,ue,qe?.state,gt,Je?.version,o.extensionPointProps,o.extensionPointCallbacks]);_e.current=le._local,we.current=le._computed||{},Me.current=gt,I.useEffect(()=>{const q=Za();if(!q?.isEnabled())return;const ie=le._local;ie&&q.updateLocalState(ie);const oe=le._computed;oe&&q.updateComputedState(oe),gt&&q.updateParentContext?.(gt);const Z=A.id||`comp-${Date.now()}`,be=A.name||"Unknown",me={global:Object.keys(e._global||{}),local:Object.keys(ie||{}),context:d?Object.keys(d.state||{}):[]},Te={type:d?"componentContext":"dynamicState",hasComponentContext:!!d,parentId:d?"parent":void 0};q.trackComponentStateSource?.(Z,be,me,Te),ue&&Object.keys(ue).length>0&&q.trackDynamicState?.(Z,ue);const xe=!!(A.expandChildren||A.props?.expandChildren);q.trackContextFlow?.(Z,be,!!d,xe,!0)},[le._local,e,A.id,A.name,d,ue,A.expandChildren,A.props?.expandChildren,gt]);const de=I.useMemo(()=>({state:{...le._local},setState:he,stateRef:_e,computedRef:we,isolatedContext:qe,parentDataContext:le}),[le._local,he,T,qe,le]),Oe=I.useMemo(()=>{const q=Qi({if:A.if,condition:A.condition,conditions:A.conditions},le,i,A.id);if(A.if||A.condition!==void 0||A.conditions){const oe=Za();oe?.isEnabled()&&A.if&&oe.trackIfCondition(A.id||`if-${Date.now()}`,A.if,q)}return q},[A.if,A.conditions,le,i,A.id]),He=I.useMemo(()=>{if(!A.slot)return null;const q=A.slot;if(q.startsWith("{{")&&q.endsWith("}}")){const ie=q.slice(2,-2).trim();try{const oe={componentId:A.id,componentName:A.name,propName:"slot"},Z=i.evaluateExpression(ie,le,oe);return ht.log(`[Slot] 표현식 평가: "${ie}" => "${Z}" (컴포넌트: ${A.id})`),typeof Z=="string"?Z:null}catch(oe){return ht.warn(`slot 표현식 평가 실패 (컴포넌트: ${A.id}):`,oe),null}}return ht.log(`[Slot] 정적 슬롯 ID: "${q}" (컴포넌트: ${A.id})`),q},[A.slot,A.id,le,i]),Pe=I.useMemo(()=>!He||!A.id?"":`${A.id}-${He}-${JSON.stringify(A.slotOrder??0)}`,[He,A.id,A.slotOrder]),ke=I.useRef(null);I.useEffect(()=>{const q=window.__slotContextValue,ie=q?.isEnabled??!1;if(A.slot&&ht.log(`[Slot Registration] 컴포넌트: ${A.id}, isSlotEnabled: ${ie}, shouldRender: ${Oe}, resolvedSlotId: ${He}`),!ie||!Oe){A.slot&&ht.log(`[Slot Registration] 등록 스킵 - isSlotEnabled: ${ie}, shouldRender: ${Oe}`),ke.current&&A.id&&q&&(q.unregisterFromSlot(ke.current,A.id),ke.current=null);return}if(!He||!A.id){A.slot&&ht.log(`[Slot Registration] 등록 스킵 - resolvedSlotId: ${He}, id: ${A.id}`),ke.current&&A.id&&q&&(q.unregisterFromSlot(ke.current,A.id),ke.current=null);return}ke.current&&ke.current!==He&&q.unregisterFromSlot(ke.current,A.id);const oe={...A,slot:void 0,slotOrder:void 0};return q.registerToSlot(He,A.id,{componentDef:oe,dataContext:e,order:A.slotOrder??0,parentFormContext:f??null,getParentComponentContext:()=>de,translationContext:n,registrationKey:Pe}),ke.current=He,()=>{const Z=window.__slotContextValue;He&&A.id&&Z&&Z.unregisterFromSlot(He,A.id)}},[Oe,He,A,e,f,de,n,Pe]);const Ot=I.useCallback(q=>{if(typeof q=="string"){if(op(q))return cp(q);if(lp(q)){const ie=[],oe=q.replace(new RegExp(`${Ll}([^${Zs}]*)${Zs}`,"g"),(be,me)=>(ie.push(me),`${_r}${ie.length-1}${_r}`));let Z=oe;return/\$t:[a-zA-Z0-9._-]+/.test(oe)&&(Z=l.resolveTranslations(oe,n,le)),Z.replace(new RegExp(`${_r}(\\d+)${_r}`,"g"),(be,me)=>ie[parseInt(me)])}if(q.startsWith("$t:defer:"))return q;if(/\$t:[a-zA-Z0-9._-]+/.test(q)){const ie=q.trim();return ie.startsWith("{")&&ie.endsWith("}")||ie.startsWith("[")&&ie.endsWith("]")?q:l.resolveTranslations(q,n,le)}return q}if(Array.isArray(q))return q.map(ie=>Ot(ie));if(q&&typeof q=="object"){const ie={};for(const[oe,Z]of Object.entries(q))ie[oe]=Ot(Z);return ie}return q},[l,n,le]),ut=I.useCallback(q=>/[?:|&!+\-*/<>=()]/.test(q),[]),Ct=I.useCallback(q=>{if(!q.startsWith("{{")||!q.endsWith("}}"))return null;const ie=q.slice(2,-2);let oe=null,Z=0;for(let be=0;be<ie.length;be++){const me=ie[be];if((be>0?ie[be-1]:"")!=="\\"&&((me==='"'||me==="'")&&!oe?oe=me:me===oe&&(oe=null),!oe&&(me==="{"&&Z++,me==="}"&&Z--,Z<0)))return null}return Z===0?ie.trim():null},[]),vt=I.useMemo(()=>{let q={...A.props||{}};const ie=["cellChildren","expandChildren","expandContext","render"],Z=r.getMetadata(A.name)?.skipBindingKeys||[],be=[...new Set([...ie,...Z])],me=b?{skipCache:!0}:void 0,Te=Ae=>{if(me)return me;if(Ae.startsWith("_computed")||Ae.startsWith("$computed"))return{skipCache:!0}};for(const[Ae,Re]of Object.entries(q))if(!be.includes(Ae))if(typeof Re=="string"){const Ue=Ct(Re);if(Ue!==null){let ot=!1,At=Ue;Ue.startsWith(Na)&&(ot=!0,At=Ue.slice(Na.length));const Qt={componentId:A.id,componentName:A.name,propName:Ae};let Kt;if(ci(At))Kt=i.resolveBindings(`{{${At}}}`,le,me,Qt);else if(ut(At))try{Kt=i.evaluateExpression(At,le,Qt)}catch(Fn){ht.warn(`표현식 평가 실패 (컴포넌트: ${A.id}, prop: ${Ae}):`,Fn),Kt=void 0}else Kt=i.resolve(At,le,Te(At),Qt);q[Ae]=ot&&Kt!=null?Ji(Kt):Kt}else{const ot={componentId:A.id,componentName:A.name,propName:Ae};q[Ae]=i.resolveBindings(Re,le,me,ot)}}else Array.isArray(Re)?q[Ae]=Re.map(Ue=>typeof Ue=="string"?i.resolveBindings(Ue,le,me):typeof Ue=="object"&&Ue!==null?i.resolveObject(Ue,le,me):Ue):Re&&typeof Re=="object"&&(q[Ae]=i.resolveObject(Re,le,me));for(const[Ae,Re]of Object.entries(q))q[Ae]=Ot(Re);if(typeof q.style=="string"&&(q.style=L_(q.style)),q=fd(q,v?void 0:A.actions,le,{componentContext:de,actionDispatcher:u}),A.classMap){const Ae=gw(A.classMap,le,i,{skipCache:!0});if(Ae){const Re=q.className||"";q.className=Re?`${Re} ${Ae}`:Ae}}A.style&&(q.style=A.style),A.actions&&A.actions.length>0&&A.type==="composite"&&Object.assign(q,ue),A.component_layout&&(q.__componentLayoutDefs=A.component_layout);const xe=A.expandChildren||A.props?.expandChildren,je=A.props?.cellChildren,ze=A.children&&A.children.length>0,$e=A.component_layout,De=A.slot,Ye=A.props?.modalId,Ke=A.type==="composite";return(xe||je||ze||$e||De||Ye||Ke)&&(q.__componentContext=de),q},[A.props,A.actions,A.style,A.classMap,A.id,le,n,i,l,de,ue,Ot,ut,Ct,b]),kt=I.useRef(null),Ee=I.useMemo(()=>kt.current&&hm(kt.current,vt)?kt.current:(kt.current=vt,vt),[vt]),Nt=I.useMemo(()=>{const q=A.id;if(typeof q!="string"||!q.includes("{{"))return q;const ie=i.resolveBindings(q,le,{skipCache:!0});return typeof ie=="string"?ie:q},[A.id,le,i]),zt=I.useMemo(()=>{const q=A.dataKey,ie=A.trackChanges,oe=A.debounce;if(q){const Z=q.startsWith("_global."),be=Z?q.slice(8):q,me=Z?e._global:le._local;return{dataKey:be,trackChanges:ie??!1,debounce:oe,setState:Z?xe=>{e._globalSetState?e._globalSetState(xe):ht.warn("_global.formData 사용 시 _globalSetState가 필요합니다.")}:he,state:me??{},_isGlobal:Z}}if(ve.dataKey)return ve},[A.dataKey,A.trackChanges,A.debounce,A.id,he,le._local,e._global,e._globalSetState,ve]),qt=I.useRef(new Set);I.useEffect(()=>{qt.current.clear()},[e._global?._remountKeys]);const Lt=I.useCallback((q,ie)=>{const oe=e._global?._remountKeys;return q&&oe?.[q]&&!qt.current.has(q)?(qt.current.add(q),`${q}-remount-${oe[q]}`):q||ie},[e._global?._remountKeys]),_n=I.useMemo(()=>{if(A.text!==void 0){if(typeof A.text=="string"){const q=A.text;let ie=q;const oe={componentId:A.id,componentName:A.name,propName:"text",skipCache:!0},Z=Ct(q);if(Z!==null){let be=!1,me=Z;if(Z.startsWith(Na)&&(be=!0,me=Z.slice(Na.length)),ci(me))ie=i.resolveBindings(`{{${me}}}`,le,{skipCache:!0},oe);else if(ut(me))try{ie=i.evaluateExpression(me,le,oe)}catch(Te){ht.warn(`text 표현식 평가 실패 (컴포넌트: ${A.id}):`,Te),ie=""}else ie=i.resolve(me,le,{skipCache:!0},oe);be&&ie!=null&&(ie=Ji(ie))}else q.includes("{{")&&(ie=i.resolveBindings(q,le,{skipCache:!0},oe));return ie=Ot(ie),ie??""}return A.text}return!A.children||A.children.length===0?null:A.children.map((q,ie)=>{if(typeof q=="string")return q;const oe=A.__responsiveChildrenKey,Z=oe?`responsive.${oe}.children`:"children",be=O?`${O}.${Z}.${ie}`:`${ie}`,me=q._fromBase?q.id||`child-${ie}`:Lt(q.id,`child-${ie}`),Te=!q._fromBase&&M?`${me}_${M}`:me;return ft.jsx(ja,{componentDef:q,dataContext:le,translationContext:n,registry:r,bindingEngine:i,translationEngine:l,actionDispatcher:u,parentComponentContext:de,parentFormContextProp:zt,isInsideIteration:b,isEditMode:v,onComponentSelect:S,onComponentHover:_,componentPath:be,onDragStart:x,onDragEnd:k,layoutKey:M},Te)})},[A.text,A.children,A.id,e,le,n,r,i,l,u,de,zt,Ct,ut,Ot,Lt,b,v,S,_,O,x,k,M]),hn=I.useMemo(()=>{if(!A.iteration)return null;try{const q=dd(A.iteration.source,le,i);if(!Array.isArray(q))return ht.warn(`iteration source가 배열이 아닙니다 (컴포넌트: ${A.id}):`,q),null;const ie=Za();return ie?.isEnabled()&&ie.trackIteration(A.id||`iteration-${Date.now()}`,A.iteration.source,A.iteration.item_var,A.iteration.index_var,q.length),q.map((oe,Z)=>{const be={...le,[A.iteration.item_var]:oe};A.iteration.index_var&&(be[A.iteration.index_var]=Z);const me=Z===0||Z===q.length-1;ie?.isEnabled()&&me&&ie.trackNestedContext?.({componentId:`${A.id||"unknown"}-iter-${Z}`,componentType:"iteration",parentContext:{available:Object.keys(le),values:{}},ownContext:{added:[A.iteration.item_var,...A.iteration.index_var?[A.iteration.index_var]:[]],values:{[A.iteration.item_var]:oe,...A.iteration.index_var?{[A.iteration.index_var]:Z}:{}}},depth:1});const Te={...A,iteration:void 0,responsive:void 0},xe=O?`${O}.iteration.${Z}`:`iteration.${Z}`,je=`${Lt(A.id,"item")}-${Z}`;return ft.jsx(ja,{componentDef:Te,dataContext:be,translationContext:n,registry:r,bindingEngine:i,translationEngine:l,actionDispatcher:u,parentComponentContext:de,parentFormContextProp:zt,isInsideIteration:!0,isEditMode:v,onComponentSelect:S,onComponentHover:_,componentPath:xe,onDragStart:x,onDragEnd:k,layoutKey:M},je)})}catch(q){return ht.error(`iteration 렌더링 실패 (컴포넌트: ${A.id}):`,q),null}},[A.iteration,A.children,A.id,e,le,n,r,i,l,u,de,zt,Lt,v,S,_,O,x,k,M]),[Ba,Jt]=I.useState(0),Dr=I.useMemo(()=>{if(!A.sortable||!A.itemTemplate)return null;const{sortable:q,itemTemplate:ie}=A;try{const oe=dd(q.source,le,i);if(!Array.isArray(oe))return ht.warn(`sortable source가 배열이 아닙니다 (컴포넌트: ${A.id}):`,oe),null;if(oe.length===0)return null;const Z=q.itemKey||"id",be=q.strategy||"verticalList",me=q.itemVar||"$item",Te=q.indexVar||"$index",xe=q.handle,je=q.wrapperElement,ze=(Ye,Ke)=>{const Ae=A.actions?.filter(Re=>Re.event==="onSortEnd"||Re.type==="onSortEnd");if(Jt(Re=>Re+1),Ae&&Ae.length>0&&u){const Re={...le,$sortedItems:Ye,$sortEvent:Ke};Ae.forEach(Ue=>{try{const ot=u.createHandler(Ue,Re,de),At=new Event("sortend");ot(At)}catch(ot){ht.error(`onSortEnd action failed: ${Ue.handler}`,ot)}})}},$e=Ye=>{const Ke=A.actions?.filter(Ae=>Ae.event==="onSortStart"||Ae.type==="onSortStart");if(Ke&&Ke.length>0&&u){const Ae={...le,$activeId:Ye.activeId};Ke.forEach(Re=>{try{const Ue=u.createHandler(Re,Ae,de),ot=new Event("sortstart");Ue(ot)}catch(Ue){ht.error(`onSortStart action failed: ${Re.handler}`,Ue)}})}},De=oe.map((Ye,Ke)=>{const Ae=String(Ye[Z]),Re={...le,[me]:Ye,[Te]:Ke},Ue=O?`${O}.sortable.${Ke}`:`sortable.${Ke}`,ot=`${Lt(A.id,"sortable-item")}-v${Ba}-${Ae}`;return ft.jsx(D_,{id:Ae,handle:xe,...je?{as:je}:{},children:(je&&ie.children?ie.children:[ie]).map((At,Qt)=>ft.jsx(ja,{componentDef:At,dataContext:Re,translationContext:n,registry:r,bindingEngine:i,translationEngine:l,actionDispatcher:u,parentComponentContext:de,parentFormContextProp:void 0,isInsideIteration:!0,isEditMode:v,onComponentSelect:S,onComponentHover:_,componentPath:Ue,onDragStart:x,onDragEnd:k,layoutKey:M},`${ot}-child-${Qt}`))},ot)});return ft.jsx(T_,{items:oe,itemKey:Z,strategy:be,onSortEnd:ze,onSortStart:$e,sortVersion:Ba,children:De})}catch(oe){return ht.error(`sortable 렌더링 실패 (컴포넌트: ${A.id}):`,oe),null}},[A.sortable,A.itemTemplate,A.actions,A.id,e,le,n,r,i,l,u,de,Lt,v,S,_,O,x,k,Ba,M]),tr=I.useRef(!1);I.useEffect(()=>{if(tr.current)return;tr.current=!0;const q=Za();if(q?.isEnabled()&&q.trackMount(o.id,{name:o.name,type:o.type||"component",props:Ee}),o.lifecycle?.onMount&&o.lifecycle.onMount.length>0)for(const oe of o.lifecycle.onMount)try{const Z=u.createHandler(oe,le,de),be=new Event("mount");Z(be),ht.log(`Lifecycle onMount executed: ${oe.handler} (Component: ${o.id})`)}catch(Z){ht.error(`Lifecycle onMount failed: ${oe.handler} (Component: ${o.id})`,Z)}const ie=[];if(o.onComponentEvent&&o.onComponentEvent.length>0){const oe=window.G7Core;if(oe?.componentEvent?.on)for(const Z of o.onComponentEvent){if(!Z.event){ht.warn(`onComponentEvent: event name is required (Component: ${o.id})`);continue}const be=async Te=>{try{const xe={...le,_eventData:Te},ze=await u.createHandler({handler:Z.handler,params:Z.params,onSuccess:Z.onSuccess,onError:Z.onError},xe,de)(new CustomEvent(Z.event,{detail:Te}));return ht.log(`onComponentEvent "${Z.event}" handled: ${Z.handler} (Component: ${o.id})`,{eventData:Te,result:ze}),ze}catch(xe){throw ht.error(`onComponentEvent "${Z.event}" failed: ${Z.handler} (Component: ${o.id})`,xe),xe}},me=oe.componentEvent.on(Z.event,be);ie.push(me),ht.log(`onComponentEvent: Subscribed to "${Z.event}" (Component: ${o.id})`)}else ht.warn(`onComponentEvent: G7Core.componentEvent is not available (Component: ${o.id})`)}return()=>{const oe=Za();oe?.isEnabled()&&oe.trackUnmount(o.id);for(const Z of ie)try{Z()}catch(be){ht.error(`onComponentEvent: Failed to unsubscribe (Component: ${o.id})`,be)}if(ie.length>0&&ht.log(`onComponentEvent: Unsubscribed ${ie.length} event(s) (Component: ${o.id})`),o.lifecycle?.onUnmount&&o.lifecycle.onUnmount.length>0)for(const Z of o.lifecycle.onUnmount)try{const be=u.createHandler(Z,le,de),me=new Event("unmount");be(me),ht.log(`Lifecycle onUnmount executed: ${Z.handler} (Component: ${o.id})`)}catch(be){ht.error(`Lifecycle onUnmount failed: ${Z.handler} (Component: ${o.id})`,be)}}},[]);const An=I.useMemo(()=>{const q=Ee.dataKey,ie=Ee.trackChanges,oe=Ee.debounce;return q?{dataKey:q,trackChanges:ie??!1,debounce:oe,setState:he,state:ue}:null},[Ee.dataKey,Ee.trackChanges,Ee.debounce,he,ue]);I.useEffect(()=>{const q=A.dataKey||Ee.dataKey;if(!q)return;const ie=Za();if(!ie?.isEnabled())return;const oe=[],Z=me=>{if(me)for(const Te of me){const xe=Te?.props?.name;if(xe&&oe.push({name:xe,type:Te.name||Te.type||"unknown"}),Te?.children&&Z(Te.children),Te?.slots)for(const je of Object.values(Te.slots))Array.isArray(je)&&Z(je)}};if(o.children&&Z(o.children),o.slots)for(const me of Object.values(o.slots))Array.isArray(me)&&Z(me);const be=o.id||`form-${q}`;return ie.trackForm(be,q,oe),()=>{ie.untrackForm(be)}},[A,Ee.dataKey,o.id,o.children]);const sn=I.useRef(null),tt=I.useRef(void 0);I.useEffect(()=>{const q=Ee?.name;if(!q||!ve.dataKey||!ve.setState||Ee?.autoBinding===!1)return;const ie=`${ve.dataKey}.${q}`,oe=window.__g7AutoBindingPaths??new Map;return window.__g7AutoBindingPaths=oe,oe.set(ie,(oe.get(ie)??0)+1),()=>{const Z=oe.get(ie)??0;Z<=1?oe.delete(ie):oe.set(ie,Z-1)}},[Ee?.name,Ee?.autoBinding,ve.dataKey,ve.setState]);const na=I.useMemo(()=>{const{dataKey:q,trackChanges:ie,debounce:oe,...Z}=Ee,be=Z.name;if(!be||!ve.dataKey||!ve.setState)return Z;if(Z.autoBinding===!1){const{autoBinding:Ae,...Re}=Z;return Re}const me=`${ve.dataKey}.${be}`,Te=RC(ve.state,me),xe=Te!==void 0?Te:Z.value,ze=r.getMetadata(o.name)?.bindingType,$e=typeof xe=="boolean"&&(ze==="checked"||ze==="checkable"&&["checkbox","radio"].includes(Z?.type)),De=ve.debounce,Ye=Ae=>{const Re=ve.state||{},Ue=kC(Re,me,Ae);if(ve.trackChanges&&(Ue.hasChanges=!0),window.__g7PendingLocalState=Ue,ve.setState(Ue),ve._isGlobal)return;const ot=window.G7Core,At={[me]:Ae};ve.trackChanges&&(At.hasChanges=!0),ot?.state?.setLocal?.(At,{render:!1})},Ke=(Ae,Re)=>{De&&De>0?(sn.current&&clearTimeout(sn.current),sn.current=setTimeout(()=>{Ye(Ae),sn.current=null,Re&&(Re(),window.__g7PendingLocalState=null)},De)):(Ye(Ae),Re&&(Re(),window.__g7PendingLocalState=null))};if($e)return{...Z,checked:xe,onChange:Re=>{const Ue=Re.target.checked;Ye(Ue),Z.onChange&&Z.onChange(Re)}};{const Ae=Ue=>{const ot=Ue?.target?.value!==void 0?Ue.target.value:Ue;De&&De>0&&(tt.current=ot);const At=Ue?.target?{target:{value:ot,name:Ue.target.name,type:Ue.target.type,checked:Ue.target.checked},currentTarget:Ue.currentTarget?{value:ot,name:Ue.currentTarget.name}:void 0}:Ue;Ke(ot,()=>{Z.onChange&&Z.onChange(At)})};let Re;return tt.current!==void 0?sn.current!==null?Re=tt.current:String(xe??"")===String(tt.current)?(tt.current=void 0,Re=xe??""):Re=tt.current:Re=xe??"",{...Z,value:Re,onChange:Ae}}},[Ee,ve,ve.state,ve.debounce]),kn=I.useMemo(()=>{const q=Za();if(q?.isEnabled()&&q.trackRender(o.name),!Oe)return null;if(A.sortable&&A.itemTemplate)return Dr;if(A.iteration)return hn;if(A.type==="extension_point"){const{layout:ze,columns:$e,gap:De,className:Ye,...Ke}=A.props||{};let Ae=Ye||"";return ze==="grid"&&$e?Ae=`${Ae} grid grid-cols-${$e} gap-${De||4}`.trim():ze==="flex"&&(Ae=`${Ae} flex flex-col gap-${De||4}`.trim()),ft.jsx("div",{id:Nt,className:Ae||void 0,...Ke,children:_n})}const ie=r.getComponent(A.name);if(!ie)return ht.error(`컴포넌트를 찾을 수 없습니다: ${A.name} (ID: ${A.id})`,"componentDef:",JSON.stringify(A,null,2)),null;const oe=e._global?._remountKeys,Z={...na,id:na.id??Nt,...oe&&Object.keys(oe).length>0&&{__remountTrigger:JSON.stringify(oe)}};if(ge?.listeners&&ge.handle&&na["data-drag-handle"]!==void 0&&(Object.assign(Z,ge.listeners),Z.style={...Z.style,cursor:ge.isDragging?"grabbing":"grab"}),v){const ze=A.id||`auto_${A.name||A.type||"unknown"}_${Math.random().toString(36).substring(2,8)}`,$e=Ke=>{typeof Ke.preventDefault=="function"&&Ke.preventDefault(),S&&(Ke.stopPropagation(),S(ze,Ke))},De={"data-editor-id":ze,"data-editor-name":A.name,"data-editor-type":A.type,onClick:$e};O&&(De["data-editor-path"]=O);const Ye=A.__editorSlotName??A.slot;typeof Ye=="string"&&(De["data-editor-slot"]=Ye),_&&(De.onMouseMove=Ke=>{Ke.stopPropagation(),_(ze,Ke)},De.onMouseLeave=Ke=>{_(null,Ke)}),Object.assign(Z,De),Z.editorAttrs=De}const be=A.type==="basic",me=A.type==="layout",xe=be||me?(()=>{const ze={};for(const[$e,De]of Object.entries(Z))$e.startsWith("__")||$e==="editorAttrs"&&be||(ze[$e]=De);return ze})():Z;let je=ft.jsx(ie,{...xe,children:_n});if(zt&&(je=ft.jsx(xC,{value:zt,children:je})),A.isolatedState){const ze=typeof A.isolatedState=="object"?A.isolatedState:{},$e=e?._isolatedInit,De=$e?{...ze,...$e}:ze;je=ft.jsx(NC,{initialState:De,scopeId:A.isolatedScopeId,children:je})}return je},[Oe,A.iteration,A.sortable,A.itemTemplate,A.type,A.name,A.id,A.props,A.isolatedState,A.isolatedScopeId,r,na,_n,hn,Dr,ge,An,v,S,_,x,k,O,e._global?._remountKeys]),nr=I.useMemo(()=>{const q=A.blur_until_loaded;if(!q||e?._global?.__isPreview)return!1;if(typeof q=="string"){const Z=Ct(q);if(Z!==null)try{const be={componentId:A.id,componentName:A.name,propName:"blur_until_loaded"};return!!i.evaluateExpression(Z,le,be)}catch(be){return ht.warn(`blur_until_loaded 표현식 평가 실패 (컴포넌트: ${A.id}):`,be),!1}return!1}if(typeof q=="object"&&q!==null){if(!q.enabled)return!1;if(q.data_sources)return(Array.isArray(q.data_sources)?q.data_sources:[q.data_sources]).some(Te=>e[Te]===void 0);if(Q)return!0;const Z=["route","query","_global","_local","_dataSourceErrors"];return Object.keys(e).filter(me=>!Z.includes(me)&&!me.startsWith("_")).some(me=>e[me]===void 0)}if(Q)return!0;const ie=["route","query","_global","_local","_dataSourceErrors"];return Object.keys(e).filter(Z=>!ie.includes(Z)&&!Z.startsWith("_")).some(Z=>e[Z]===void 0)},[A.blur_until_loaded,A.id,Q,e,le,i,Ct]);if(nr){const q=A.blur_until_loaded;if(typeof q=="object"&&q?.data_sources){const oe=(Array.isArray(q.data_sources)?q.data_sources:[q.data_sources]).reduce((be,me)=>(be[me]=e[me]===void 0?"UNDEFINED":"LOADED",be),{}),Z=Object.keys(e).filter(be=>!be.startsWith("_"));ht.log(`[BLUR APPLIED] Component: ${A.id}, data_sources status:`,oe,"Available keys:",Z)}else ht.log(`[BLUR APPLIED] Component: ${A.id}, blur_until_loaded:`,q)}const _a=I.useMemo(()=>{if(!A.blur_until_loaded)return{wrapperClasses:"",innerClasses:""};const q=vt?.className||"";if(!q)return{wrapperClasses:"",innerClasses:""};const ie=[/^(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-)/],oe=q.split(/\s+/).filter(Boolean),Z=[],be=[];for(const me of oe)ie.some(xe=>xe.test(me))?Z.push(me):be.push(me);return{wrapperClasses:Z.join(" "),innerClasses:be.join(" ")}},[A.blur_until_loaded,vt?.className]),on=window.__slotContextValue;return He&&on?.isEnabled?null:ft.jsx(M_,{componentId:o.id,componentName:o.name,children:A.blur_until_loaded?ft.jsx("div",{className:[_a.wrapperClasses,nr?"opacity-50 blur-sm transition-all duration-300 pointer-events-none":void 0].filter(Boolean).join(" ")||void 0,children:kn}):kn})});ja.displayName="DynamicRenderer",typeof window<"u"&&(window.__DynamicRenderer=ja);function $_(o){const e={};try{const r=new URL(o,typeof window<"u"?window.location.origin:"http://localhost").searchParams,i=new Set;for(const l of r.keys()){if(i.has(l))continue;i.add(l);const u=r.getAll(l);u.length>1||l.endsWith("[]")?e[l]=u:e[l]=u[0]}}catch{}return e}function N_(o){try{return new URL(o,typeof window<"u"?window.location.origin:"http://localhost").pathname}catch{return o.split("?")[0]}}const bi=class bi{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 bi.instance||(bi.instance=new bi),bi.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 r=window.G7Core?.state?.get?.();return r?.settings?.advanced?.debug_mode===!0||r?._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 n={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(n),this.stateHistory.length>this.config.maxHistorySize&&this.stateHistory.shift(),this.notifyStateWatchers(n)}getState(){try{const e=window.G7Core,n=e?.state?.get?.()||{},r={};if(e?._isolatedStates&&typeof e._isolatedStates=="object")for(const[i,l]of Object.entries(e._isolatedStates))r[i]=this.sanitizeObject(l);return{_global:n._global||n,_local:this.currentLocalState,_computed:this.currentComputedState,_isolated:Object.keys(r).length>0?r: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 n={};try{n=(window.G7Core?.state?.get?.()||{})._local||{}}catch{n={}}const r=this.findMismatchedLeafPaths(e,n);return{hasMismatch:r.length>0,mismatchedPaths:r,storageA:e,storageB:n}}findMismatchedLeafPaths(e,n,r=""){const i=[],l=new Set([...Object.keys(e||{}),...Object.keys(n||{})]);for(const u of l){const d=r?`${r}.${u}`:u,f=e?.[u],g=n?.[u],m=f&&typeof f=="object"&&!Array.isArray(f),b=g&&typeof g=="object"&&!Array.isArray(g);if(m&&b)i.push(...this.findMismatchedLeafPaths(f,g,d));else{const v=f===void 0?"__undefined__":JSON.stringify(f),S=g===void 0?"__undefined__":JSON.stringify(g);v!==S&&i.push(d)}}return i}watchState(e,n){return this.stateWatchers.has(e)||this.stateWatchers.set(e,new Set),this.stateWatchers.get(e).add(n),()=>{this.stateWatchers.get(e)?.delete(n)}}notifyStateWatchers(e){if(this.stateWatchers.get("*")?.forEach(n=>{try{n(e.next,e.prev,"*")}catch(r){console.error("[G7DevTools] State watcher error:",r)}}),e.diff)for(const n of e.diff.changed)this.stateWatchers.get(n.path)?.forEach(r=>{try{r(n.newValue,n.oldValue,n.path)}catch(i){console.error("[G7DevTools] State watcher error:",i)}})}diffSnapshots(e,n){const r=this.stateHistory.find(l=>l.id===e),i=this.stateHistory.find(l=>l.id===n);return!r||!i?null:this.calculateDiff(r.next,i.next)}calculateDiff(e,n,r=""){const i={added:[],removed:[],changed:[]},l=new Set(Object.keys(e)),u=new Set(Object.keys(n));for(const d of u){const f=r?`${r}.${d}`:d;l.has(d)?JSON.stringify(e[d])!==JSON.stringify(n[d])&&i.changed.push({path:f,oldValue:e[d],newValue:n[d]}):i.added.push(f)}for(const d of l){const f=r?`${r}.${d}`:d;u.has(d)||i.removed.push(f)}return i}logAction(e){if(!this.config.enabled)return;const n=this.actionHistory.findIndex(r=>r.id===e.id);n>=0?this.actionHistory[n]={...this.actionHistory[n],...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(n=>{try{n(e)}catch(r){console.error("[G7DevTools] Action watcher error:",r)}})}getActionMetrics(){const e=this.actionHistory.filter(l=>l.status==="success"),n=this.actionHistory.filter(l=>l.status==="error"),r={};for(const l of this.actionHistory)r[l.type]=(r[l.type]||0)+1;const i=e.reduce((l,u)=>l+(u.duration||0),0);return{totalActions:this.actionHistory.length,successCount:e.length,errorCount:n.length,averageDuration:e.length>0?i/e.length:0,actionsByType:r}}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 n={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(n),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 n=0,r=0,i=0,l=0;const u={},d={};for(const g of e)g.decision==="cache_hit"?n++:g.decision==="cache_miss"?r++:g.decision==="skip_cache"?i++:g.decision==="invalidate"&&l++,u[g.reason]=(u[g.reason]||0)+1,g.context.componentId&&(d[g.context.componentId]=(d[g.context.componentId]||0)+1);const f=n+r+i;return{totalDecisions:e.length,cacheHits:n,cacheMisses:r,skipCacheCount:i,invalidateCount:l,byReason:u,byComponent:d,avgHitRate:f>0?n/f:0}}getRecentCacheDecisions(e=20,n){let r=[...this.cacheDecisions];return n&&(r=r.filter(i=>i.decision===n)),r.slice(-e)}clearCacheDecisionData(){this.cacheDecisions=[],this.cacheDecisionIdCounter=0}summarizePropsForLifecycle(e){if(!e||typeof e!="object")return e;const n={},r=["children","ref","key"];for(const[i,l]of Object.entries(e))if(!r.includes(i))if(l==null)n[i]=l;else if(Array.isArray(l))n[i]=`[Array(${l.length})]`;else if(typeof l=="object"){const u=Object.keys(l);u.length<=3?n[i]=`{${u.join(", ")}}`:n[i]=`{${u.slice(0,3).join(", ")}, ... +${u.length-3}}`}else typeof l=="string"&&l.length>50?n[i]=l.substring(0,50)+"...":typeof l=="function"?n[i]="[Function]":n[i]=l;return n}trackMount(e,n){if(!this.config.enabled)return;const r=this.summarizePropsForLifecycle(n.props),i={...n,props:r,id:e,mountTime:Date.now()};this.mountedComponents.set(e,i),this.mountWatchers.forEach(l=>{try{l({componentId:e,componentName:n.name,timestamp:i.mountTime})}catch(u){console.error("[G7DevTools] Mount watcher error:",u)}})}trackUnmount(e){if(!this.config.enabled)return;const n=this.mountedComponents.get(e),r=this.eventListeners.get(e)||[];r.length>0&&console.warn(`[G7DevTools] 컴포넌트 ${e} 언마운트 시 ${r.length}개 리스너 미정리`),n&&this.unmountWatchers.forEach(i=>{try{i({componentId:e,componentName:n.name,timestamp:Date.now(),orphanedListeners:r.length})}catch(l){console.error("[G7DevTools] Unmount watcher error:",l)}}),this.mountedComponents.delete(e)}trackListener(e,n,r){if(!this.config.enabled)return;const i=this.eventListeners.get(e)||[];i.push({type:n,target:r,addedAt:Date.now()}),this.eventListeners.set(e,i)}removeListener(e,n){if(!this.config.enabled)return;const r=this.eventListeners.get(e)||[],i=r.findIndex(l=>l.type===n);i>=0&&r.splice(i,1)}getMountedComponents(){return Array.from(this.mountedComponents.values())}getOrphanedListeners(){const e=[];for(const[n,r]of this.eventListeners)this.mountedComponents.has(n)||e.push(...r.map(i=>({...i,componentId:n})));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 n=this.renderCounts.get(e)||0;this.renderCounts.set(e,n+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 n=this.getOrphanedListeners().length;n>0&&e.push({type:"orphaned-listeners",message:`${n}개의 정리되지 않은 이벤트 리스너`,suggestion:"useEffect cleanup 또는 removeEventListener 확인",severity:n>10?"error":"warning"});const r=Array.from(this.renderCounts.entries()).filter(([,i])=>i>50);return r.length>0&&e.push({type:"excessive-renders",message:`${r.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,n=this.analyzeProfile(e);return console.log("[G7DevTools] 프로파일링 완료",n),n}analyzeProfile(e){const n=this.profilingData.filter(g=>g.type==="render"),r=this.profilingData.filter(g=>g.type==="binding"),i=this.profilingData.filter(g=>g.type==="action"),l={};for(const g of n)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 u=Object.entries(l).map(([g,m])=>({name:g,renderCount:m.count,avgDuration:m.durations.length>0?m.durations.reduce((b,v)=>b+v,0)/m.durations.length:0})).sort((g,m)=>m.renderCount-g.renderCount).slice(0,10),d={};for(const g of r)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:n.length,totalBindings:r.length,totalActions:i.length,slowestComponents:u,hotPaths:f}}}resetPerformanceStats(){this.renderCounts.clear(),this.bindingEvalCount=0,this.profilingData=[]}trackRequest(e,n,r){if(!this.config.enabled)return"";const i=this.generateId(),l=N_(e),u=$_(e);return this.activeRequests.set(i,{id:i,url:l,fullUrl:e,queryParams:u,method:n,startTime:Date.now(),status:"pending",requestBody:r?.requestBody?this.sanitizeObject(r.requestBody):void 0,dataSourceId:r?.dataSourceId}),this.isProfiling&&this.profilingData.push({type:"network",timestamp:performance.now()}),i}completeRequest(e,n,r){if(!this.config.enabled)return;const i=this.activeRequests.get(e);if(!i)return;const l={...i,status:n>=200&&n<300?"success":"error",statusCode:n,duration:Date.now()-i.startTime,endTime:Date.now(),response:this.sanitizeObject(r)};this.requestHistory.push(l),this.activeRequests.delete(e),this.requestHistory.length>this.config.maxHistorySize&&this.requestHistory.shift(),this.notifyRequestWatchers(l)}failRequest(e,n){if(!this.config.enabled)return;const r=this.activeRequests.get(e);if(!r)return;const i={...r,status:"error",error:n,duration:Date.now()-r.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(n=>{try{n(e)}catch(r){console.error("[G7DevTools] Request watcher error:",r)}})}trackWebSocketConnection(e,n,r){this.config.enabled&&this.wsConnections.set(e,{id:e,url:n,state:r,connectedAt:r==="open"?Date.now():void 0})}trackWebSocketMessage(e,n,r,i){if(!this.config.enabled)return;const l={id:this.generateId(),connectionId:e,direction:n,type:r,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(n=>n.state==="open")?"connected":e.some(n=>n.state==="connecting")?"reconnecting":"disconnected"}watchWebSocketMessage(e){return this.wsMessageWatchers.add(e),()=>{this.wsMessageWatchers.delete(e)}}notifyWebSocketWatchers(e){this.wsMessageWatchers.forEach(n=>{try{n(e)}catch(r){console.error("[G7DevTools] WebSocket watcher error:",r)}})}trackIfCondition(e,n,r){if(!this.config.enabled)return;const i=this.ifConditions.get(e),l=i?.evaluatedValue;this.ifConditions.set(e,{id:e,expression:n,evaluatedValue:r,evaluationCount:(i?.evaluationCount||0)+1,lastEvaluated:Date.now()}),i&&l!==r&&this.notifyConditionWatchers({id:e,expression:n,oldValue:l,newValue:r,timestamp:Date.now()})}trackIteration(e,n){this.config.enabled&&this.iterations.set(e,{id:e,...n,lastRendered:Date.now()})}getIfConditions(){return Array.from(this.ifConditions.values())}getIterations(){return Array.from(this.iterations.values())}getScopeChain(e){const n=[],r=this.getState();return n.push({name:"_global",value:r._global,source:"global"}),n.push({name:"_local",value:r._local,source:"local"}),n.push({name:"_computed",value:r._computed,source:"computed"}),n}watchConditionChange(e){return this.conditionWatchers.add(e),()=>{this.conditionWatchers.delete(e)}}notifyConditionWatchers(e){this.conditionWatchers.forEach(n=>{try{n(e)}catch(r){console.error("[G7DevTools] Condition watcher error:",r)}})}trackForm(e,n,r){this.config.enabled&&this.forms.set(e,{id:e,dataKey:n,inputs:r,trackedAt:Date.now()})}trackFormChange(e,n,r){if(!this.config.enabled)return;const i={formId:e,inputName:n,value:r,timestamp:Date.now()};this.notifyFormWatchers(i)}untrackForm(e){this.forms.delete(e)}getForms(){return Array.from(this.forms.values())}getFormState(e){const n=this.getState();return this.getNestedValue(n,e)||{}}getBindingPath(e,n){return`${e}.${n}`}watchFormChange(e){return this.formWatchers.add(e),()=>{this.formWatchers.delete(e)}}notifyFormWatchers(e){this.formWatchers.forEach(n=>{try{n(e)}catch(r){console.error("[G7DevTools] Form watcher error:",r)}})}trackFormBindingIssue(e,n,r){if(!this.config.enabled)return;const i={id:`form-issue-${++this.formBindingIssueIdCounter}`,timestamp:Date.now(),type:e,severity:n,formId:r.formId,formDataKey:r.formDataKey,inputInfo:r.inputInfo,contextInfo:r.contextInfo,description:r.description,suggestion:r.suggestion,docLink:r.docLink};this.formBindingIssues.push(i),this.formBindingIssues.length>this.maxFormBindingIssues&&this.formBindingIssues.shift()}validateFormBinding(e,n,r,i){const l=r.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:n,inputInfo:{name:f.name,type:f.type},description:"Input에 name 속성이 없어 자동 바인딩이 동작하지 않습니다",suggestion:"Input에 name 속성을 추가하세요",docLink:"troubleshooting-components-form.md"})),n||(g.push("Form에 dataKey가 없습니다"),m=!1),{inputName:f.name||"(unnamed)",inputType:f.type,bindingPath:n&&f.name?`${n}.${f.name}`:"-",isValid:m,currentValue:f.value,issues:g}});if(n||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:n,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 u={formId:e,dataKey:n,timestamp:Date.now(),contextPropagation:i,inputBindings:l,isValid:l.every(f=>f.isValid)&&!!n&&!i.isContextBroken,issueCount:l.filter(f=>!f.isValid).length+(n?0:1)+(i.isContextBroken?1:0)},d=this.formBindingValidations.findIndex(f=>f.formId===e);return d>=0?this.formBindingValidations[d]=u:this.formBindingValidations.push(u),u}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},n={info:0,warning:0,error:0};for(const i of this.formBindingIssues)e[i.type]++,n[i.severity]++;const r=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:n,topIssues:r}}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,n,r,i,l,u,d){if(!this.config.enabled)return;const f=`computed-${e}-${u||"global"}`,g={id:f,name:e,expression:n,componentId:u,dependencies:r,currentValue:this.safeClone(i),lastComputedAt:Date.now(),computationTime:l,error:d};this.computedProperties.set(f,g)}trackComputedRecalc(e,n,r,i,l,u,d){if(!this.config.enabled)return;const f=`computed-${e}-${d||"global"}`,g=JSON.stringify(r)!==JSON.stringify(i),m={id:`recalc-${++this.computedRecalcIdCounter}`,computedId:f,computedName:e,timestamp:Date.now(),trigger:n,triggeredBy:u,previousValue:this.safeClone(r),newValue:this.safeClone(i),valueChanged:g,computationTime:l,cascadeCount:0};this.computedRecalcLogs.push(m),this.computedRecalcLogs.length>this.maxComputedRecalcLogs&&this.computedRecalcLogs.shift();const b=this.computedProperties.get(f);b&&(b.currentValue=this.safeClone(i),b.lastComputedAt=Date.now(),b.computationTime=l)}analyzeComputedDependencyChain(e,n){const r=new Set,i=[];let l=!1,u,d=0;const f=(m,b)=>{if(d=Math.max(d,b),r.has(m))return l=!0,u=[...i,m],{name:m,type:"computed",children:[],depth:b};r.add(m),i.push(m);const v=this.computedProperties.get(`computed-${m}-${n||"global"}`),S=[];if(v)for(const _ of v.dependencies)_.type==="computed"?S.push(f(_.path,b+1)):S.push({name:_.path,type:_.type,children:[],depth:b+1});return i.pop(),r.delete(m),{name:m,type:"computed",children:S,depth:b}},g=f(e,0);return{root:e,tree:g,hasCycle:l,cyclePath:u,maxDepth:d}}getComputedDependencyTrackingInfo(){const e=Array.from(this.computedProperties.values()),n=this.getComputedDependencyStats(),r=[];for(const i of e){const l=this.analyzeComputedDependencyChain(i.name,i.componentId);r.push(l)}return{properties:e,recalcLogs:[...this.computedRecalcLogs],dependencyChains:r,stats:n,timestamp:Date.now()}}getComputedDependencyStats(){const e={"state-change":0,"datasource-update":0,"dependency-change":0,manual:0,initial:0},n={},r={};let i=0,l=0;for(const g of this.computedRecalcLogs)e[g.trigger]++,g.valueChanged||l++,n[g.computedName]=(n[g.computedName]||0)+1,r[g.computedName]||(r[g.computedName]=[]),r[g.computedName].push(g.computationTime),i+=g.computationTime;const u=Object.entries(n).sort((g,m)=>m[1]-g[1]).slice(0,5).map(([g,m])=>({name:g,count:m})),d=Object.entries(r).map(([g,m])=>({name:g,avgTime:m.reduce((b,v)=>b+v,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:u,slowestComputed:d,cycleDetectionCount:f,byTrigger:e}}clearComputedTracking(){this.computedProperties.clear(),this.computedRecalcLogs=[],this.computedRecalcIdCounter=0}trackModalOpen(e){if(!this.config.enabled)return;const n={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,n),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,n){if(!this.config.enabled)return;const r=this.modalStates.get(e);r&&(r.closedAt=Date.now(),n&&(r.currentState={...n}),this.detectStateLeakage(r))}validateModalDefinitionExists(e,n){const r=this.currentLayout;if(!r?.layoutJson)return;const i=r.layoutJson.modals;if(!i){this.recordModalStateIssue({type:"missing-definition",modalId:e,modalName:n,severity:"error",description:`모달 "${e}"이(가) modalStack에 추가되었으나, 현재 레이아웃에 modals 섹션이 없습니다. 레이아웃 경로: ${r.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:n,severity:"error",description:`모달 "${e}"이(가) modalStack에 추가되었으나, 렌더링된 레이아웃의 modals 섹션에 해당 ID의 정의가 없습니다. partial 로딩 실패, 레이아웃 병합 문제, extends 상속 누락 등을 확인하세요. 레이아웃 경로: ${r.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 n=this.modalStates.get(e.modalId);if(!n)return;n.stateChangeCount++,n.currentState[e.stateKey]=e.newValue;const r=this.checkIsolationViolation(n,e.stateKey),i={id:`modal-change-${++this.modalStateChangeLogIdCounter}`,modalId:e.modalId,modalName:n.modalName,timestamp:Date.now(),stateKey:e.stateKey,previousValue:e.previousValue,newValue:e.newValue,changeSource:e.changeSource||"user-action",violatesIsolation:r};this.modalStateChangeLogs.push(i),this.modalStateChangeLogs.length>this.maxModalStateChangeLogs&&this.modalStateChangeLogs.shift(),r&&this.recordModalStateIssue({type:"isolation-violation",modalId:e.modalId,modalName:n.modalName,severity:"warning",description:`모달 '${n.modalName}'에서 격리된 상태 키 '${e.stateKey}'가 변경됨`,affectedStateKeys:[e.stateKey]})}detectStateLeakage(e){if(e.scopeType==="isolated")for(const n of e.isolatedStateKeys){const r=e.initialState[n],i=e.currentState[n];if(r!==i&&e.parentModalId){const l=this.modalStates.get(e.parentModalId);l&&l.currentState.hasOwnProperty(n)&&this.recordModalStateIssue({type:"state-leakage",modalId:e.modalId,modalName:e.modalName,severity:"error",description:`모달 닫힘 후 상태 '${n}'가 부모 모달로 유출될 수 있음`,affectedStateKeys:[n],leakedValue:i,expectedValue:r})}}}checkIsolationViolation(e,n){return e.scopeType==="isolated",!1}recordModalStateIssue(e){const n={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(n),this.modalStateIssues.length>this.maxModalStateIssues&&this.modalStateIssues.shift()}getModalStateScopeTrackingInfo(){const e=Array.from(this.modalStates.values()),n=this.getModalStateScopeStats();return{modals:e,issues:[...this.modalStateIssues],relations:[...this.modalStateRelations],changeLogs:[...this.modalStateChangeLogs],stats:n,timestamp:Date.now()}}getModalStateScopeStats(){const e=Array.from(this.modalStates.values()),n={warning:0,error:0},r={"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)n[l.severity]++,r[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:n,issuesByType:r,byScope:i,leakageDetectionCount:r["state-leakage"],cleanupFailureCount:r["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 n={...e,id:`named_action_ref_${++this.namedActionRefIdCounter}`};this.namedActionRefLogs.push(n),this.namedActionRefLogs.length>this.maxNamedActionRefLogs&&(this.namedActionRefLogs=this.namedActionRefLogs.slice(-this.maxNamedActionRefLogs))}getNamedActionTrackingInfo(){const e={};for(const r of this.namedActionRefLogs)e[r.actionRefName]=(e[r.actionRefName]||0)+1;const n=Object.keys(this.namedActionDefinitions).filter(r=>!e[r]);return{definitions:this.namedActionDefinitions,refLogs:[...this.namedActionRefLogs],stats:{totalDefinitions:Object.keys(this.namedActionDefinitions).length,totalRefs:this.namedActionRefLogs.length,refCountByName:e,unusedDefinitions:n},timestamp:Date.now()}}clearNamedActionTracking(){this.namedActionDefinitions={},this.namedActionRefLogs=[],this.namedActionRefIdCounter=0}trackExpressionEval(e){if(!this.config.enabled)return;const n={...e,id:`expr-${++this.expressionIdCounter}`,timestamp:Date.now(),warning:this.detectExpressionWarning(e)};this.expressionHistory.push(n),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(n)}detectExpressionWarning(e){const{expression:n,result:r,resultType:i,method:l,duration:u}=e;if(i==="undefined"&&!n.includes("??")&&!n.includes("||")&&/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(n.replace(/{{|}}/g,"").trim()))return{type:"undefined-result",message:"표현식 결과가 undefined입니다",suggestion:`데이터가 로드되었는지 확인하거나 fallback 값을 추가하세요: ${n} ?? ''`};if(i==="null")return{type:"null-result",message:"표현식 결과가 null입니다",suggestion:`nullish coalescing 연산자를 사용하세요: ${n} ?? ''`};if(l==="resolveBindings"&&i==="string"){const d=String(r);if(d.includes("[object Object]")||/^\[.*\]$/.test(d))return{type:"array-to-string",message:"배열/객체가 문자열로 변환되었습니다",suggestion:"evaluateExpression()을 사용하여 원본 타입을 유지하세요"}}if(l==="resolveBindings"&&i==="string"&&String(r).includes("[object Object]"))return{type:"object-to-string",message:"객체가 [object Object]로 변환되었습니다",suggestion:"evaluateExpression()을 사용하거나 특정 속성에 접근하세요"};if(i==="undefined"&&n.includes(".")&&!n.includes("?.")){const d=n.replace(/{{|}}/g,"").trim().split(".");if(d.length>=2)return{type:"missing-optional-chain",message:"Optional chaining(?.) 누락 가능성",suggestion:`안전한 접근을 위해 ?. 사용을 고려하세요: ${d.join("?.")}`}}if((n.includes("{{item.")||n.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(u&&u>10)return{type:"slow-evaluation",message:`표현식 평가에 ${u.toFixed(2)}ms 소요됨`,suggestion:"복잡한 표현식을 단순화하거나 computed 값으로 분리하세요"}}getExpressions(){return[...this.expressionHistory]}getExpressionWarnings(){return this.expressionHistory.filter(e=>e.warning!=null)}searchExpressions(e){const n=e.toLowerCase();return this.expressionHistory.filter(r=>r.expression.toLowerCase().includes(n)||r.componentName?.toLowerCase().includes(n)||r.propName?.toLowerCase().includes(n))}getExpressionStats(){const e=this.expressionHistory,n=new Set(e.map(f=>f.expression)),r=e.filter(f=>f.warning!=null),i=e.filter(f=>f.fromCache),l=e.filter(f=>f.duration!=null).map(f=>f.duration),u={};for(const f of e)u[f.resultType]=(u[f.resultType]||0)+1;const d={};for(const f of r)f.warning&&(d[f.warning.type]=(d[f.warning.type]||0)+1);return{totalEvaluations:e.length,uniqueExpressions:n.size,warningCount:r.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:u,byWarning:d}}clearExpressions(){this.expressionHistory=[],this.expressionIdCounter=0}watchExpressions(e){return this.expressionWatchers.add(e),()=>{this.expressionWatchers.delete(e)}}notifyExpressionWatchers(e){this.expressionWatchers.forEach(n=>{try{n(e)}catch(r){console.error("[G7DevTools] Expression watcher error:",r)}})}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,n=new WeakSet){if(e===null||typeof e!="object")return e;if(n.has(e))return"[Circular]";if(n.add(e),Array.isArray(e))return e.map(i=>this.sanitizeObject(i,n));const r={};for(const i of Object.keys(e))try{r[i]=this.sanitizeObject(e[i],n)}catch{r[i]="[Unable to serialize]"}return r}getNestedValue(e,n){if(!n)return e;const r=n.split(".");let i=e;for(const l of r){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 n=[...this.stateHistory].reverse().find(r=>r.timestamp<=e);if(n)return{_global:n.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,n,r){if(!this.config.enabled)return;const i=r.map(u=>{if(typeof u=="string")return u;try{return JSON.stringify(u)}catch{return String(u)}}).join(" "),l={id:`log-${++this.logIdCounter}`,level:e,prefix:n,message:i,args:this.sanitizeObject(r),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 n={id:`debounce-action-${++this.debounceActionIdCounter}`,...e,timestamp:Date.now()};this.debounceActionHistory.push(n),this.debounceActionHistory.length>100&&this.debounceActionHistory.shift()}trackDataSourceUpdate(e){if(!this.config.enabled)return;const n={id:`ds-update-${++this.dataSourceUpdateIdCounter}`,...e};this.dataSourceUpdateHistory.push(n),this.dataSourceUpdateHistory.length>100&&this.dataSourceUpdateHistory.shift()}getDebounceActionHistory(e){let n=[...this.debounceActionHistory];return e?.handler&&(n=n.filter(r=>r.handler.includes(e.handler))),e?.status&&(n=n.filter(r=>r.status===e.status)),e?.limit&&(n=n.slice(-e.limit)),n}getDataSourceUpdateHistory(e){let n=[...this.dataSourceUpdateHistory];return e?.dataSourceId&&(n=n.filter(r=>r.dataSourceId===e.dataSourceId)),e?.updateType&&(n=n.filter(r=>r.updateType===e.updateType)),e?.limit&&(n=n.slice(-e.limit)),n}getLogs(e){let n=[...this.logHistory];if(e?.level){const r=Array.isArray(e.level)?e.level:[e.level];n=n.filter(i=>r.includes(i.level))}if(e?.prefix){const r=e.prefix.toLowerCase();n=n.filter(i=>i.prefix.toLowerCase().includes(r))}if(e?.search){const r=e.search.toLowerCase();n=n.filter(i=>i.message.toLowerCase().includes(r))}return e?.since&&(n=n.filter(r=>r.timestamp>=e.since)),e?.limit&&(n=n.slice(-e.limit)),n}getLogStats(){const n=Date.now()-6e4,r={log:0,warn:0,error:0,debug:0,info:0},i={};let l=0,u=0;for(const d of this.logHistory)r[d.level]++,i[d.prefix]=(i[d.prefix]||0)+1,d.timestamp>=n&&(d.level==="error"&&l++,d.level==="warn"&&u++);return{totalLogs:this.logHistory.length,byLevel:r,byPrefix:i,recentErrors:l,recentWarnings:u}}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 n=this.dataSources.get(e);n&&this.dataSources.set(e,{...n,status:"loading"})}trackDataSourceLoaded(e,n,r){if(!this.config.enabled)return;const i=this.dataSources.get(e);if(!i)return;let l,u,d=r;n&&(Array.isArray(n)?(l=n.length,u=n.length>0&&typeof n[0]=="object"?Object.keys(n[0]):void 0):typeof n=="object"&&(Array.isArray(n.data)?(d=d||"data",l=n.data.length,u=n.data.length>0&&typeof n.data[0]=="object"?Object.keys(n.data[0]):void 0):Array.isArray(n.items)?(d=d||"items",l=n.items.length,u=n.items.length>0&&typeof n.items[0]=="object"?Object.keys(n.items[0]):void 0):u=Object.keys(n))),this.dataSources.set(e,{...i,status:"loaded",dataPath:d,itemCount:l,keys:u,lastLoadedAt:Date.now(),error:void 0})}trackDataSourceError(e,n){if(!this.config.enabled)return;const r=this.dataSources.get(e);r&&this.dataSources.set(e,{...r,status:"error",error:n,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 n=this.dataPathTransforms.find(r=>r.dataSourceId===e.dataSourceId);n||(n={dataSourceId:e.dataSourceId,timestamp:Date.now(),transformSteps:[],warnings:[]},this.dataPathTransforms.push(n),this.dataPathTransforms.length>this.maxDataPathTransforms&&this.dataPathTransforms.shift()),n.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&&n.warnings.push(e.warning)}setDataPathFinalBinding(e,n){if(!this.config.enabled)return;const r=this.dataPathTransforms.find(i=>i.dataSourceId===e);r&&(r.finalBinding={expression:n.expression,resolvedPath:n.resolvedPath,value:this.safeClone(n.value)})}getDataPathTransformTrackingInfo(){const e=this.getDataPathTransformStats();return{transforms:[...this.dataPathTransforms],stats:e,timestamp:Date.now()}}getDataPathTransformStats(){const e=this.dataPathTransforms,n={};let r=0;const i={};for(const u of e){n[u.dataSourceId]=(n[u.dataSourceId]||0)+1,r+=u.warnings.length;for(const d of u.warnings)i[d]=(i[d]||0)+1}const l=Object.entries(i).map(([u,d])=>({warning:u,count:d})).sort((u,d)=>d.count-u.count).slice(0,10);return{totalTransforms:e.length,byDataSource:n,warningsCount:r,commonWarnings:l}}getDataPathTransformForDataSource(e){return this.dataPathTransforms.find(n=>n.dataSourceId===e)}clearDataPathTransforms(){this.dataPathTransforms=[]}trackNestedContext(e){if(!this.config.enabled)return"";const n=`nested-${++this.nestedContextIdCounter}`,r=[...new Set([...e.parentContext.available,...e.ownContext.added])],i={...e.parentContext.values,...e.ownContext.values},l={id:n,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:r,values:this.safeClone(i)},accessAttempts:[],depth:e.depth,parentId:e.parentId};return this.nestedContexts.push(l),this.nestedContexts.length>this.maxNestedContexts&&this.nestedContexts.shift(),n}trackNestedContextAccess(e,n){if(!this.config.enabled)return;const r=this.nestedContexts.find(i=>i.id===e);r&&r.accessAttempts.push({path:n.path,found:n.found,value:n.found?this.safeClone(n.value):void 0,error:n.error})}getNestedContextTrackingInfo(){const e=this.getNestedContextStats();return{contexts:[...this.nestedContexts],stats:e,timestamp:Date.now()}}getNestedContextStats(){const e=this.nestedContexts,n={expandChildren:0,cellChildren:0,iteration:0,modal:0,slot:0};let r=0,i=0;const l={};for(const d of e){n[d.componentType]++,d.depth>r&&(r=d.depth);for(const f of d.accessAttempts)f.found||(i++,l[f.path]=(l[f.path]||0)+1)}const u=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:n,maxDepth:r,failedAccessCount:i,commonFailedPaths:u}}getNestedContextForComponent(e){return this.nestedContexts.find(n=>n.componentId===e)}clearNestedContexts(){this.nestedContexts=[],this.nestedContextIdCounter=0}trackHandlerRegistration(e,n="custom",r,i){this.isEnabled&&this.handlers.set(e,{name:e,category:n,description:r,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(n=>n.category===e)}clearHandlers(){this.handlers.clear()}trackEventSubscribe(e){if(!this.isEnabled)return;const n=this.componentEventSubscriptions.get(e),r=Date.now();n?(n.subscriberCount++,n.lastSubscribedAt=r):this.componentEventSubscriptions.set(e,{eventName:e,subscriberCount:1,firstSubscribedAt:r,lastSubscribedAt:r})}trackEventUnsubscribe(e){if(!this.isEnabled)return;const n=this.componentEventSubscriptions.get(e);n&&(n.subscriberCount--,n.subscriberCount<=0&&this.componentEventSubscriptions.delete(e))}trackEventEmit(e,n,r,i,l){if(!this.isEnabled)return;const u={id:`evt_${++this.componentEventIdCounter}`,eventName:e,data:this.sanitizeForLogging(n),timestamp:Date.now(),listenerCount:r,results:i?this.sanitizeForLogging(i):void 0,hasError:!!l,errorMessage:l?.message};this.componentEventEmitHistory.push(u),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((n,r)=>n+r.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,n,r,i){if(!this.config.enabled)return"";const l=`setState_${++this.stateRenderingIdCounter}`;this.currentStateChangeContext={setStateId:l,startTime:performance.now(),changedPath:e,trigger:i||{},renderedComponents:[]};const u={id:`sr_${this.stateRenderingIdCounter}`,setStateId:l,statePath:e,oldValue:this.sanitizeForLogging(n),newValue:this.sanitizeForLogging(r),timestamp:Date.now(),triggeredBy:i||{},renderedComponents:[],totalRenderDuration:0,affectedBindingsCount:0};return this.stateRenderingLogs.push(u),this.stateRenderingLogs.length>this.maxStateRenderingLogs&&this.stateRenderingLogs.shift(),l}trackComponentRender(e,n,r,i=[],l=[],u){if(!this.config.enabled)return;const d=this.componentRenderCounts.get(n)||0;this.componentRenderCounts.set(n,d+1);for(const f of i)this.stateToComponentMap.has(f)||this.stateToComponentMap.set(f,new Set),this.stateToComponentMap.get(f).add(n);if(this.currentStateChangeContext){const f={componentId:e,componentName:n,renderDuration:r,accessedStatePaths:i,evaluatedBindings:l,renderOrder:this.currentStateChangeContext.renderedComponents.length,parentId:u};this.currentStateChangeContext.renderedComponents.push(f)}this.trackRender(n)}completeStateChange(e){if(!this.config.enabled||!this.currentStateChangeContext||this.currentStateChangeContext.setStateId!==e)return;const n=this.currentStateChangeContext,i=performance.now()-n.startTime,l=this.stateRenderingLogs.findIndex(u=>u.setStateId===e);if(l>=0){const u=this.stateRenderingLogs[l];u.renderedComponents=n.renderedComponents,u.totalRenderDuration=i,u.affectedBindingsCount=n.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,n=Object.fromEntries(this.componentRenderCounts),r={};for(const[i,l]of this.stateToComponentMap)r[i]=Array.from(l);return{logs:e,componentRenderCounts:n,stateToComponentMap:r,stats:this.calculateStateRenderingStats()}}calculateStateRenderingStats(){const e=this.stateRenderingLogs;if(e.length===0)return{totalStateChanges:0,totalRenders:0,avgRenderDuration:0,avgComponentsPerChange:0,topRenderedComponents:[],topInfluentialPaths:[]};const n=e.reduce((d,f)=>d+f.renderedComponents.length,0),r=e.reduce((d,f)=>d+f.totalRenderDuration,0)/e.length,i=n/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})),u=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:n,avgRenderDuration:r,avgComponentsPerChange:i,topRenderedComponents:l,topInfluentialPaths:u}}getComponentsAffectedByState(e){const n=this.stateToComponentMap.get(e);return n?Array.from(n):[]}getComponentRenderHistory(e){return this.stateRenderingLogs.filter(n=>n.renderedComponents.some(r=>r.componentName===e))}clearStateRenderingLogs(){this.stateRenderingLogs=[],this.componentRenderCounts.clear(),this.stateToComponentMap.clear(),this.currentStateChangeContext=null,this.stateRenderingIdCounter=0}trackComponentStateSource(e,n,r,i){this.config.enabled&&this.componentStateSources.set(e,{componentId:e,componentName:n,stateSource:r,stateProvider:i})}trackDynamicState(e,n){this.config.enabled&&this.dynamicStates.set(e,n)}trackContextFlow(e,n,r,i,l,u){if(!this.config.enabled)return;const d={component:n,componentId:e,contextReceived:r,passedToChildren:i,usedInRender:l};if(this.contextFlowNodes.set(e,d),u){const f=this.contextFlowNodes.get(u);f&&(f.children||(f.children=[]),f.children.push(d))}}getStateHierarchyInfo(e=!0){const n=this.buildStateHierarchyLayers(),r=this.detectStateConflicts(n),i=Array.from(this.componentStateSources.values());return{layers:e?n.map(u=>({...u,values:this.summarizeValues(u.values,2)})):n,conflicts:r,componentStateSources:i,timestamp:Date.now()}}summarizeValues(e,n,r=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(r>=n){if(Array.isArray(e))return`[Array(${e.length})]`;const u=Object.keys(e);return`{${u.slice(0,5).join(", ")}${u.length>5?`, ... +${u.length-5}`:""}}`}if(Array.isArray(e))return e.length<=3?e.map(u=>this.summarizeValues(u,n,r+1)):{__type:"array",__length:e.length,__preview:e.slice(0,3).map(u=>this.summarizeValues(u,n,r+1))};const i={},l=Object.keys(e);for(const u of l)i[u]=this.summarizeValues(e[u],n,r+1);return i}buildStateHierarchyLayers(){const e=[];try{const r=window.G7Core?.state?.get?.();if(!r)return e;r._local&&e.push({name:"Global _local",type:"global",path:"_local",values:r._local,priority:1}),r._global&&e.push({name:"Global _global",type:"global",path:"_global",values:r._global,priority:1});for(const[l,u]of this.dynamicStates)u&&Object.keys(u).length>0&&e.push({name:`DynamicState (${l})`,type:"dynamicState",componentId:l,values:u,priority:2});const i=this.computeEffectiveState(r._local||{});e.push({name:"Effective _local (merged)",type:"effective",values:i,priority:3})}catch(n){console.warn("[G7DevTools] 상태 계층 빌드 실패:",n)}return e}computeEffectiveState(e){const n={...e};for(const[,r]of this.dynamicStates)r._local&&Object.assign(n,r._local);return n}detectStateConflicts(e){const n=[],r=e.find(l=>l.type==="global"&&l.path==="_local");if(!r)return n;const i=e.filter(l=>l.type==="dynamicState");for(const l of i){const u=l.values._local||l.values;for(const[d,f]of Object.entries(u)){const g=r.values[d];if(JSON.stringify(g)!==JSON.stringify(f)){const m=[],b=[];for(const v of this.componentStateSources.values())v.stateSource.local.some(_=>_===`_local.${d}`||_===d)&&(v.stateProvider.type==="dynamicState"?m.push(v.componentName):v.stateProvider.type==="globalState"&&b.push(v.componentName));n.push({path:`_local.${d}`,globalValue:g,dynamicStateValue:f,effectiveValue:f,usedBy:m,notUsedBy:b,severity:b.length>0?"warning":"info",description:b.length>0?`${b.join(", ")}은(는) globalState._local을 읽어 dynamicState 값을 사용하지 못함`:"dynamicState 값이 globalState와 다르지만 모든 컴포넌트가 dynamicState를 사용"})}}}return n}getContextFlowInfo(){const e=[],n=new Set(this.contextFlowNodes.keys());for(const r of this.contextFlowNodes.values())if(r.children)for(const i of r.children)n.delete(i.componentId);for(const r of n){const i=this.contextFlowNodes.get(r);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,n,r,i){if(!this.config.enabled)return;const l=this.analyzeTailwindClasses(r),u={componentId:e,componentName:n,classes:r,computedStyles:i,tailwindAnalysis:l};this.componentStyles.set(e,u),this.detectStyleIssues(u)}analyzeTailwindClasses(e){const n=[],r=[],i=[],l=[],u=["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:")&&n.push(f);for(const g of u)if(f.startsWith(g)){r.push(f);break}for(const g of d)if(g.test(f)){i.push(f);break}}return{usedClasses:l,darkClasses:n,responsiveClasses:r,dynamicClasses:i}}detectStyleIssues(e){const{componentId:n,componentName:r,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:n,componentName:r,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 u=l.usedClasses.filter(f=>f.startsWith("bg-")&&!f.startsWith("dark:")),d=l.darkClasses.filter(f=>f.includes("bg-"));u.length>0&&d.length===0&&this.addStyleIssue({id:this.generateId(),type:"dark-mode-missing",componentId:n,componentName:r,property:"background-color",currentValue:u.join(", "),expectedValue:"dark:bg-* 클래스 필요",severity:"info",description:"다크 모드 배경색 클래스가 누락되었습니다.",suggestion:`${u[0]}에 대응하는 dark: 클래스를 추가하세요.`}),l.dynamicClasses.length>0&&this.addStyleIssue({id:this.generateId(),type:"tailwind-purging",componentId:n,componentName:r,property:"class",currentValue:l.dynamicClasses.join(", "),severity:"info",description:"동적으로 생성된 Tailwind 클래스가 있습니다.",suggestion:"tailwind.config.js의 safelist에 추가하거나 전체 클래스명을 상수로 정의하세요."})}addStyleIssue(e){this.styleIssues.some(r=>r.componentId===e.componentId&&r.type===e.type&&r.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(n=>n.type==="invisible-element").length,tailwindIssueCount:this.styleIssues.filter(n=>n.type==="tailwind-purging").length,darkModeIssueCount:this.styleIssues.filter(n=>n.type==="dark-mode-missing").length},timestamp:Date.now()}}clearStyleValidationData(){this.styleIssues=[],this.componentStyles.clear()}trackAuthEvent(e,n,r,i){if(!this.config.enabled)return;const l={id:`auth_${++this.authEventIdCounter}`,type:e,timestamp:Date.now(),success:n,error:r,details:i};this.authEvents.push(l),this.authEvents.length>this.maxAuthEventHistory&&(this.authEvents=this.authEvents.slice(-this.maxAuthEventHistory))}trackAuthHeader(e,n,r,i,l){if(!this.config.enabled)return;const u={url:e,hasAuthHeader:n,headerType:r,tokenValid:i??!1,responseStatus:l,timestamp:Date.now()};this.authHeaderHistory.push(u),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,n=e?.api;let r=e?.auth;!r&&e?.AuthManager?.getInstance&&(r=e.AuthManager.getInstance());const i=n?.getToken?.()||r?.getAccessToken?.()||localStorage.getItem("auth_token")||localStorage.getItem("access_token"),l=r?.getRefreshToken?.()||localStorage.getItem("refresh_token");let u="unknown",d=r?.getUser?.();if(d&&(u="AuthManager"),!d){const S=e?.state?.get?.();d=S?._global?.user||S?._global?.currentUser||S?.user||S?.currentUser,d&&(u="G7Core.state")}const f=r?.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 b;i&&typeof i=="string"&&i.length>20?b=`${i.substring(0,10)}...${i.substring(i.length-6)}`:i&&(b="***");const v=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:v,tokens:{hasAccessToken:!!i,hasRefreshToken:!!l,storage:g,accessTokenPreview:b},lastActivity:Date.now(),source:u}}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(n=>n.type==="login").length,successfulLogins:e.filter(n=>n.type==="login"&&n.success).length,failedLogins:e.filter(n=>n.type==="login"&&!n.success).length,tokenRefreshes:e.filter(n=>n.type==="token-refresh").length,unauthorizedResponses:e.filter(n=>n.type==="api-unauthorized").length},timestamp:Date.now()}}clearAuthData(){this.authEvents=[],this.authHeaderHistory=[],this.authEventIdCounter=0}trackLayoutLoad(e,n,r,i="api"){if(!this.config.enabled)return;const l=Date.now();this.currentLayout={layoutPath:e,templateId:n,layoutJson:this.sanitizeObject(r),loadedAt:l,version:r.version,layoutName:r.layout_name,source:i};const u={id:`layout-${++this.layoutIdCounter}`,layoutPath:e,templateId:n,loadedAt:l,source:i,version:r.version};this.layoutHistory.push(u),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 n=`exec_${++this.executionIdCounter}_${Date.now()}`,r={handlerName:e,executionId:n,startTime:Date.now(),stateChanges:[],dataSourceChanges:[],alerts:[]};if(this.executionDetails.set(n,r),this.executionDetails.size>this.maxExecutionDetails){const i=Array.from(this.executionDetails.keys());i.slice(0,i.length-this.maxExecutionDetails).forEach(u=>this.executionDetails.delete(u))}return n}endHandlerExecution(e,n,r,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=n,l.exitLocation=r,l.exitDescription=i;const u=this.changeExpectations.get(e);u&&(l.expectedChanges=u,this.checkExpectations(e,l,u),this.changeExpectations.delete(e)),n==="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"}),(n==="early-return-condition"||n==="early-return-validation")&&this.addChangeAlert(e,{type:"early-return-detected",severity:"info",message:`핸들러 "${l.handlerName}"이(가) early return으로 종료됨`,description:i||`종료 위치: ${r||"알 수 없음"}`,handlerName:l.handlerName,suggestion:n==="early-return-validation"?"검증 실패로 인한 early return입니다. 입력 데이터를 확인하세요.":"조건부 early return입니다. 조건문의 평가 결과를 확인하세요."})}recordExitReason(e,n,r,i){if(!this.config.enabled||!e)return;const l=this.executionDetails.get(e);l&&(l.exitReason=n,l.exitLocation=r,l.exitDescription=i)}recordStateChange(e,n,r,i,l){if(!this.config.enabled)return;const u={id:`sc_${++this.stateChangeIdCounter}`,path:n,changeType:r,oldValue:this.safeClone(i),newValue:this.safeClone(l),timestamp:Date.now(),comparison:this.compareValues(i,l),executionId:e};if(this.stateChangeHistory.push(u),e){const d=this.executionDetails.get(e);d&&d.stateChanges.push(u)}this.stateChangeHistory.length>this.maxStateChangeHistory&&this.stateChangeHistory.splice(0,this.stateChangeHistory.length-this.maxStateChangeHistory),u.comparison.isDeepEqual&&typeof i=="object"&&i!==null&&this.addChangeAlert(e||"",{type:"object-reference-same",severity:"warning",message:`상태 "${n}"가 변경되었으나 값이 동일함`,description:"객체 참조가 동일하거나 깊은 비교 결과 변경이 없습니다. 변경 감지가 실패할 수 있습니다.",handlerName:e&&this.executionDetails.get(e)?.handlerName||"unknown",statePath:n,suggestion:"불변성을 유지하여 새 객체를 생성하세요. 예: { ...oldObject, newField: value }",docLink:"troubleshooting-state.md#object-mutation"})}recordDataSourceChange(e,n,r,i,l){if(!this.config.enabled)return;const u={dataSourceId:n,changeType:r,timestamp:Date.now(),previousStatus:i,newStatus:l,executionId:e};if(this.dataSourceChangeHistory.push(u),e){const d=this.executionDetails.get(e);d&&d.dataSourceChanges.push(u)}this.dataSourceChangeHistory.length>this.maxStateChangeHistory&&this.dataSourceChangeHistory.splice(0,this.dataSourceChangeHistory.length-this.maxStateChangeHistory)}expectChange(e,n,r){if(!this.config.enabled||!e)return;const i=this.executionDetails.get(e);if(!i)return;const l={expectedStatePaths:n,expectedDataSources:r,setAt:Date.now(),source:i.handlerName};this.changeExpectations.set(e,l)}checkExpectations(e,n,r){const i=new Set(n.stateChanges.map(u=>u.path)),l=new Set(n.dataSourceChanges.map(u=>u.dataSourceId));for(const u of r.expectedStatePaths)i.has(u)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 상태 변경 "${u}"가 발생하지 않음`,description:`핸들러 "${n.handlerName}"이(가) "${u}" 변경을 예고했지만 실제로 변경되지 않았습니다.`,handlerName:n.handlerName,statePath:u,suggestion:"핸들러 내부 로직을 확인하세요. early return이나 조건부 분기로 인해 변경이 생략되었을 수 있습니다.",docLink:"troubleshooting-state.md"});for(const u of r.expectedDataSources)l.has(u)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 데이터소스 갱신 "${u}"가 발생하지 않음`,description:`핸들러 "${n.handlerName}"이(가) "${u}" 갱신을 예고했지만 실제로 갱신되지 않았습니다.`,handlerName:n.handlerName,dataSourceId:u,suggestion:"refetchDataSource 호출이 실행되었는지 확인하세요.",docLink:"data-sources.md"})}addChangeAlert(e,n){const r={...n,id:`alert_${++this.alertIdCounter}`,timestamp:Date.now()};if(this.changeAlerts.push(r),e){const i=this.executionDetails.get(e);i&&i.alerts.push(r)}this.changeAlerts.length>this.maxChangeAlerts&&this.changeAlerts.splice(0,this.changeAlerts.length-this.maxChangeAlerts)}compareValues(e,n){const r=this.getValueType(e),i=this.getValueType(n),l=r!==i;let u=!1,d;return!l&&(r==="object"||r==="array")?(u=this.deepEqual(e,n),!u&&r==="object"&&(d=this.getChangedKeys(e,n))):u=e===n,{typeChanged:l,oldType:r,newType:i,isDeepEqual:u,changedKeys:d}}getValueType(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}deepEqual(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e===null||n===null||typeof e!="object")return e===n;if(Array.isArray(e)!==Array.isArray(n))return!1;const r=Object.keys(e),i=Object.keys(n);if(r.length!==i.length)return!1;for(const l of r)if(!i.includes(l)||!this.deepEqual(e[l],n[l]))return!1;return!0}getChangedKeys(e,n){const r=[],i=new Set([...Object.keys(e),...Object.keys(n)]);for(const l of i)this.deepEqual(e[l],n[l])||r.push(l);return r}getChangeDetectionInfo(){const e=Array.from(this.executionDetails.values()),n={totalExecutions:e.length,executionsWithStateChange:e.filter(r=>r.stateChanges.length>0).length,executionsWithoutStateChange:e.filter(r=>r.stateChanges.length===0&&r.exitReason==="normal").length,earlyReturnCount:e.filter(r=>r.exitReason==="early-return-condition"||r.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:n,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 n of this.changeAlerts)e[n.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,n){let r=[...this.changeAlerts];return n&&(r=r.filter(i=>i.severity===n)),r.slice(-e)}getHandlerExecutions(e,n=10){return Array.from(this.executionDetails.values()).filter(i=>i.handlerName===e).slice(-n)}findExecutionInStack(e){return this.sequenceExecutionStack.find(n=>n.sequenceId===e)}startSequenceExecution(e){if(!this.config.enabled)return"";const n=`seq_${++this.sequenceIdCounter}_${Date.now()}`,r={sequenceId:n,startTime:Date.now(),totalDuration:0,trigger:e,actions:[],status:"running"};return this.sequenceExecutionStack.push(r),n}captureSequenceActionBefore(e,n,r,i,l){if(!this.config.enabled)return;const u=this.findExecutionInStack(e);if(!u)return;const d={index:n,handler:r,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"};u.actions.push(d)}captureSequenceActionAfter(e,n,r,i,l,u){if(!this.config.enabled)return;const d=this.findExecutionInStack(e);if(!d)return;const f=d.actions.find(m=>m.index===n);if(!f)return;f.stateAfterAction={_global:this.safeClone(r._global),_local:this.safeClone(r._local),_isolated:r._isolated?this.safeClone(r._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)),u&&(f.status="error",f.error={name:u.name,message:u.message,stack:u.stack})}endSequenceExecution(e,n){if(!this.config.enabled)return;const r=this.sequenceExecutionStack.findIndex(l=>l.sequenceId===e);if(r===-1)return;const i=this.sequenceExecutionStack[r];if(i.endTime=Date.now(),i.totalDuration=i.endTime-i.startTime,n){i.status="error",i.error={name:n.name,message:n.message,stack:n.stack};const l=i.actions.find(u=>u.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(r,1)}computeStateDiff(e,n){const r=[],i=[],l=[],u=new Set(Object.keys(e)),d=new Set(Object.keys(n));for(const f of d)u.has(f)||r.push(f);for(const f of u)d.has(f)||i.push(f);for(const f of u)if(d.has(f)){const g=e[f],m=n[f];JSON.stringify(g)!==JSON.stringify(m)&&l.push({path:f,oldValue:g,newValue:m})}return{added:r,removed:i,changed:l}}getSequenceTrackingInfo(){const e=this.getSequenceStats(),n=this.sequenceExecutionStack.length>0?this.sequenceExecutionStack[this.sequenceExecutionStack.length-1]:void 0;return{executions:[...this.sequenceExecutions],currentExecution:n,stats:e}}getSequenceStats(){const e=this.sequenceExecutions,n=e.length,r=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),u=n>0?e.reduce((g,m)=>g+m.totalDuration,0)/n: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:n,successCount:r,errorCount:i,totalActions:l,avgDuration:u,topHandlers:f}}clearSequenceData(){this.sequenceExecutions=[],this.sequenceExecutionStack=[],this.sequenceIdCounter=0}getSequenceExecution(e){const n=this.findExecutionInStack(e);return n||this.sequenceExecutions.find(r=>r.sequenceId===e)}getRecentSequences(e=10){return this.sequenceExecutions.slice(-e)}registerStateCaptureForHandler(e,n,r){if(!this.config.enabled)return;const i=new Map,l=Date.now();for(const u of n)i.set(u,{value:this.safeClone(r[u]),capturedAt:l});this.stateCaptureRegistry.set(e,i)}detectStaleClosure(e,n,r,i,l){if(!this.config.enabled)return[];const u=this.stateCaptureRegistry.get(e);if(!u)return[];const d=Date.now(),f=[];for(const[g,m]of u){const b=this.getValueByPath(r,g),v=d-m.capturedAt;if(!this.isDeepEqual(m.value,b)&&v>0){const S=this.createStaleClosureWarning(i,n,g,m.value,m.capturedAt,b,d,v,l);f.push(S),this.addStaleClosureWarning(S)}}return this.stateCaptureRegistry.delete(e),f}trackStaleClosureWarning(e){if(!this.config.enabled)return;const n=Date.now(),r=this.createStaleClosureWarning(e.type,e.location,e.capturedPath,e.capturedValue,e.capturedAt,e.currentValue,n,n-e.capturedAt,e.actionId,e.stackTrace);this.addStaleClosureWarning(r)}createStaleClosureWarning(e,n,r,i,l,u,d,f,g,m){const b=this.getStaleClosureSeverity(e,f),{description:v,suggestion:S,docLink:_}=this.getStaleClosureMessages(e,r,f);return{id:`stale_${++this.staleClosureIdCounter}_${Date.now()}`,timestamp:Date.now(),type:e,location:n,capturedState:{path:r,capturedValue:this.safeClone(i),capturedAt:l},currentState:{path:r,currentValue:this.safeClone(u),retrievedAt:d},timeDiff:f,severity:b,description:v,suggestion:S,docLink:_,actionId:g,stackTrace:m}}getStaleClosureSeverity(e,n){if(n>5e3)return"error";if(n>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,n,r){const i=r<1e3?`${r}ms`:`${(r/1e3).toFixed(1)}s`;switch(e){case"async-state-capture":return{description:`await 후 ${i} 경과 시점에 '${n}' 상태가 변경됨. 캡처된 상태 대신 최신 상태를 사용해야 함`,suggestion:"await 이후에는 G7Core.state.get()으로 최신 상태를 다시 조회하거나, useRef + getter 패턴을 사용하세요",docLink:"troubleshooting-state-closure.md"};case"callback-state-capture":return{description:`콜백에서 ${i} 전에 캡처된 '${n}' 상태를 사용 중. 최신 상태와 다름`,suggestion:"콜백에서 상태를 참조할 때는 stateRef.current 패턴 또는 G7Core.state.get()를 사용하세요",docLink:"troubleshooting-state-closure.md"};case"timeout-state-capture":return{description:`setTimeout/setInterval 콜백에서 '${n}' 상태가 ${i} 전 값 사용 중`,suggestion:"타이머 콜백 내에서는 G7Core.state.get()으로 최신 상태를 조회하세요",docLink:"troubleshooting-state-closure.md"};case"sequence-state-mismatch":return{description:`sequence 내 '${n}' 상태가 이전 액션 결과와 불일치. context.state 대신 캡처된 값 사용 의심`,suggestion:"sequence 내에서는 context.state 또는 $prev를 사용하여 최신 상태를 참조하세요",docLink:"troubleshooting-state-setstate.md"};case"event-handler-stale":return{description:`이벤트 핸들러에서 ${i} 전에 바인딩된 '${n}' 상태 사용 중`,suggestion:"이벤트 핸들러에서 상태를 참조할 때는 useRef 패턴 또는 G7Core.state.get()를 사용하세요",docLink:"troubleshooting-state-closure.md"};default:return{description:`'${n}' 상태에서 stale closure 감지됨 (${i} 경과)`,suggestion:"상태 참조 시 최신 값을 사용하는지 확인하세요"}}}addStaleClosureWarning(e){this.staleClosureWarnings.push(e),this.staleClosureWarnings.length>this.maxStaleClosureWarnings&&this.staleClosureWarnings.shift()}getValueByPath(e,n){const r=n.split(".");let i=e;for(const l of r){if(i==null)return;i=i[l]}return i}isDeepEqual(e,n){if(e===n)return!0;if(e===null||n===null)return e===n;if(typeof e!=typeof n)return!1;if(typeof e!="object")return e===n;try{return JSON.stringify(e)===JSON.stringify(n)}catch{return!1}}getStaleClosureTrackingInfo(){const e=this.getStaleClosureStats();return{warnings:[...this.staleClosureWarnings],stats:e,timestamp:Date.now()}}getStaleClosureStats(){const e=this.staleClosureWarnings,n={"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)n[f.type]++;const r={info:0,warning:0,error:0};for(const f of e)r[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})),u={};for(const f of e)u[f.capturedState.path]=(u[f.capturedState.path]||0)+1;const d=Object.entries(u).sort(([,f],[,g])=>g-f).slice(0,5).map(([f,g])=>({path:f,count:g}));return{totalWarnings:e.length,warningsByType:n,warningsBySeverity:r,topLocations:l,topAffectedPaths:d}}clearStaleClosureData(){this.staleClosureWarnings=[],this.staleClosureIdCounter=0,this.stateCaptureRegistry.clear()}getRecentStaleClosureWarnings(e=10,n){let r=[...this.staleClosureWarnings];return n&&(r=r.filter(i=>i.severity===n)),r.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(r=>{try{return JSON.parse(JSON.stringify(r))}catch{return"[Unserializable]"}});const n={};for(const r of Object.keys(e))try{n[r]=JSON.parse(JSON.stringify(e[r]))}catch{n[r]="[Unserializable]"}return n}}};$(bi,"instance");let Tr=bi;const Gn=dt("LayoutLoader");class va extends Error{constructor(n,r,i){super(n);$(this,"code");$(this,"details");this.code=r,this.details=i,this.name="LayoutLoaderError"}}class sf{constructor(e){$(this,"componentRegistry");$(this,"currentLayout",null);$(this,"layoutCache",new Map);$(this,"cacheVersion",0);this.componentRegistry=e}setCacheVersion(e){this.cacheVersion!==e&&(Gn.log("Cache version updated:",this.cacheVersion,"->",e),this.cacheVersion=e,this.layoutCache.clear())}getCacheVersion(){return this.cacheVersion}async loadLayout(e,n){const r=`${e}:${n}`;if(this.layoutCache.has(r)){Gn.log("Loading layout from cache:",n);const l=await this.layoutCache.get(r),u=JSON.parse(JSON.stringify(l));return this.currentLayout=u,Tr.getInstance().trackLayoutLoad(n,e,u,"cache"),u}const i=this.fetchLayout(e,n);return this.layoutCache.set(r,i),i.catch(()=>{this.layoutCache.get(r)===i&&this.layoutCache.delete(r)}),i}async fetchLayout(e,n,r=!1){try{const i=this.cacheVersion>0?this.cacheVersion:null;let l;if(n.startsWith("__preview__/")){const v=n.replace("__preview__/","");l=Ma(`/api/layouts/preview/${v}`,"json",i)}else l=Ma(`/api/layouts/${e}/${n}`,"json",i);Gn.log("Fetching layout from API:",l);const u=Ia(),d=r?null:u.getToken(),f={Accept:"application/json"};d&&(f.Authorization=`Bearer ${d}`);const g=await Dl(l,{init:{headers:f},label:`layout: ${n}`});let m;try{m=await g.json()}catch{m=null}if(!g.ok){if(g.status===401&&!r&&d){Gn.log("Token invalid, removing and retrying without token"),u.removeToken();try{return await this.fetchLayout(e,n,!0)}catch(S){throw S instanceof va&&S.details?.status===401?new va(S.message,S.code,{...S.details,hadToken:!0}):S}}const v=m?.message||m?.error;throw new va(`Failed to fetch layout: ${g.status} ${g.statusText}`,"FETCH_FAILED",{status:g.status,statusText:g.statusText,url:l,apiMessage:v})}const b=m.data||m;return this.validateLayoutData(b),this.currentLayout=b,Tr.getInstance().trackLayoutLoad(n,e,b,"api"),Gn.log("Layout fetched and cached successfully:",b.layout_name),b}catch(i){const l=`${e}:${n}`;throw this.layoutCache.delete(l),i instanceof va?i:new va("Failed to load layout","LOAD_FAILED",{originalError:i})}}prefetchLayout(e,n){return this.loadLayout(e,n)}validateLayoutData(e){if(!e.version)throw new va("Layout data missing required field: version","VALIDATION_FAILED",{field:"version"});if(!e.layout_name)throw new va("Layout data missing required field: layout_name","VALIDATION_FAILED",{field:"layout_name"});if(!Array.isArray(e.components))throw new va('Layout data field "components" must be an array',"VALIDATION_FAILED",{field:"components",value:e.components});Gn.log("Layout data validation passed")}renderLayout(e,n){try{const r=n||this.currentLayout;if(!r)throw new va("No layout data to render","NO_LAYOUT_DATA");Gn.log("Rendering layout:",r.layout_name),e.innerHTML="",this.renderComponents(e,r.components),Gn.log("Layout rendered successfully")}catch(r){Gn.error("Render error:",r),this.renderErrorState(e,r)}}renderComponents(e,n){for(const r of n){const i=this.renderComponent(r);i&&e.appendChild(i)}}renderComponent(e){try{if(!this.componentRegistry.getComponent(e.type))return Gn.warn(`Component not found: ${e.type}`),this.createPlaceholderElement(e.type);const r=document.createElement("div");return r.setAttribute("data-component",e.type),e.props&&Object.entries(e.props).forEach(([i,l])=>{r.setAttribute(`data-prop-${i}`,JSON.stringify(l))}),e.children&&e.children.length>0?this.renderComponents(r,e.children):e.text&&(r.textContent=e.text),r}catch(n){return Gn.error(`Error rendering component ${e.type}:`,n),this.createErrorElement(e.type,n)}}createPlaceholderElement(e){const n=document.createElement("div");return n.className="component-placeholder",n.setAttribute("data-component-type",e),n.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>
|
||
`,n}createErrorElement(e,n){const r=document.createElement("div");return r.className="component-error",r.setAttribute("data-component-type",e),r.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;">${n?.message||"Unknown error"}</p>
|
||
</div>
|
||
`,r}renderErrorState(e,n){const r=n instanceof Error?n.message:String(n),i=n instanceof va?n.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;
|
||
">${r}</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>
|
||
`,Gn.error("Error state rendered:",i,r)}getCurrentLayout(){return this.currentLayout}clear(){this.currentLayout=null,this.layoutCache.clear(),Gn.log("Layout data and cache cleared")}}const I_=dt("TranslationContext"),of=I.createContext(null),hc=({children:o,translationEngine:e,translationContext:n})=>{const r=I.useMemo(()=>(l,u)=>{if(u){const d="|"+Object.entries(u).map(([f,g])=>`${f}=${g}`).join("|");return e.translate(l,n,d)}return e.translate(l,n)},[e,n]),i=I.useMemo(()=>({translationEngine:e,translationContext:n,t:r}),[e,n,r]);return ft.jsx(of.Provider,{value:i,children:o})},ty=()=>{const o=I.useContext(of);return o||(I_.warn("TranslationProvider 외부에서 호출되었습니다. 키를 그대로 반환합니다."),{t:e=>e,translationEngine:null,translationContext:null})},Rr=dt("SlotContext"),H_={registerToSlot:()=>{Rr.warn("SlotContext not available: registerToSlot called outside SlotProvider")},unregisterFromSlot:()=>{Rr.warn("SlotContext not available: unregisterFromSlot called outside SlotProvider")},getSlotComponents:()=>[],subscribeToSlot:()=>()=>{},clearAllSlots:()=>{},isEnabled:!1},z_=I.createContext(H_),lf=({children:o})=>{const e=I.useRef(new Map),n=I.useRef(new Map),r=I.useCallback(m=>{const b=n.current.get(m);b&&b.forEach(v=>{try{v()}catch(S){Rr.error(`Slot subscriber error (slotId: ${m}):`,S)}})},[]),i=I.useCallback((m,b,v)=>{if(!m||!b){Rr.warn("registerToSlot: slotId and componentId are required");return}e.current.has(m)||e.current.set(m,new Map);const S=e.current.get(m),_=S.get(b);_&&_.registrationKey===v.registrationKey||(S.set(b,v),Rr.log(`Component registered to slot: ${b} -> ${m} (order: ${v.order})`),r(m))},[r]),l=I.useCallback((m,b)=>{const v=e.current.get(m);v&&v.has(b)&&(v.delete(b),Rr.log(`Component unregistered from slot: ${b} <- ${m}`),v.size===0&&e.current.delete(m),r(m))},[r]),u=I.useCallback(m=>{const b=e.current.get(m);return b?Array.from(b.values()).sort((v,S)=>v.order-S.order):[]},[]),d=I.useCallback((m,b)=>{n.current.has(m)||n.current.set(m,new Set);const v=n.current.get(m);return v.add(b),()=>{v.delete(b),v.size===0&&n.current.delete(m)}},[]),f=I.useCallback(()=>{e.current.forEach((m,b)=>{r(b)}),e.current.clear(),n.current.clear(),Rr.log("All slots cleared")},[r]),g=I.useMemo(()=>({registerToSlot:i,unregisterFromSlot:l,getSlotComponents:u,subscribeToSlot:d,clearAllSlots:f,isEnabled:!0}),[i,l,u,d,f]);return I.useLayoutEffect(()=>{typeof window<"u"&&(window.__slotContextValue=g,Rr.log("SlotContext exposed to window.__slotContextValue"))},[g]),ft.jsx(z_.Provider,{value:g,children:o})};class cf{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(e,n){return this.listen(".client-"+e,n)}notification(e){return this.listen(this.notificationCreatedEvent,e)}stopListeningForNotification(e){return this.stopListening(this.notificationCreatedEvent,e)}stopListeningForWhisper(e,n){return this.stopListening(".client-"+e,n)}}class ny{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 j_(o){try{return Reflect.construct(String,[],o),!0}catch{return!1}}class uf extends cf{constructor(e,n,r){super(),this.name=n,this.pusher=e,this.options=r,this.eventFormatter=new ny(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(e,n){return this.on(this.eventFormatter.format(e),n),this}listenToAll(e){return this.subscription.bind_global((n,r)=>{if(n.startsWith("pusher:"))return;let i=String(this.options.namespace??"").replace(/\./g,"\\"),l=n.startsWith(i)?n.substring(i.length+1):"."+n;e(l,r)}),this}stopListening(e,n){return n?this.subscription.unbind(this.eventFormatter.format(e),n):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",n=>{e(n)}),this}on(e,n){return this.subscription.bind(e,n),this}}class ay extends uf{whisper(e,n){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,n),this}}class U_ extends uf{whisper(e,n){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,n),this}}class B_ extends ay{here(e){return this.on("pusher:subscription_succeeded",n=>{e(Object.keys(n.members).map(r=>n.members[r]))}),this}joining(e){return this.on("pusher:member_added",n=>{e(n.info)}),this}whisper(e,n){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,n),this}leaving(e){return this.on("pusher:member_removed",n=>{e(n.info)}),this}}class ry extends cf{constructor(e,n,r){super(),this.events={},this.listeners={},this.name=n,this.socket=e,this.options=r,this.eventFormatter=new ny(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,n){return this.on(this.eventFormatter.format(e),n),this}stopListening(e,n){return this.unbindEvent(this.eventFormatter.format(e),n),this}subscribed(e){return this.on("connect",n=>{e(n)}),this}error(e){return this}on(e,n){return this.listeners[e]=this.listeners[e]||[],this.events[e]||(this.events[e]=(r,i)=>{this.name===r&&this.listeners[e]&&this.listeners[e].forEach(l=>l(i))},this.socket.on(e,this.events[e])),this.listeners[e].push(n),this}unbind(){Object.keys(this.events).forEach(e=>{this.unbindEvent(e)})}unbindEvent(e,n){this.listeners[e]=this.listeners[e]||[],n&&(this.listeners[e]=this.listeners[e].filter(r=>r!==n)),(!n||this.listeners[e].length===0)&&(this.events[e]&&(this.socket.removeListener(e,this.events[e]),delete this.events[e]),delete this.listeners[e])}}class iy extends ry{whisper(e,n){return this.socket.emit("client event",{channel:this.name,event:`client-${e}`,data:n}),this}}class P_ extends iy{here(e){return this.on("presence:subscribed",n=>{e(n.map(r=>r.user_info))}),this}joining(e){return this.on("presence:joining",n=>e(n.user_info)),this}whisper(e,n){return this.socket.emit("client event",{channel:this.name,event:`client-${e}`,data:n}),this}leaving(e){return this.on("presence:leaving",n=>e(n.user_info)),this}}class gc extends cf{subscribe(){}unsubscribe(){}listen(e,n){return this}listenToAll(e){return this}stopListening(e,n){return this}subscribed(e){return this}error(e){return this}on(e,n){return this}}class sy extends gc{whisper(e,n){return this}}class q_ extends gc{whisper(e,n){return this}}class G_ extends sy{here(e){return this}joining(e){return this}whisper(e,n){return this}leaving(e){return this}}const wc=class wc{constructor(e){this.setOptions(e),this.connect()}setOptions(e){this.options={...wc._defaultOptions,...e,broadcaster:e.broadcaster};let n=this.csrfToken();n&&(this.options.auth.headers["X-CSRF-TOKEN"]=n,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=n),n=this.options.bearerToken,n&&(this.options.auth.headers.Authorization="Bearer "+n,this.options.userAuthentication.headers.Authorization="Bearer "+n)}csrfToken(){return typeof window<"u"&&window.Laravel?.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")??null:null}};wc._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let Eo=wc;class pc extends Eo{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,n,r){return this.channel(e).listen(n,r)}channel(e){return this.channels[e]||(this.channels[e]=new uf(this.pusher,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new ay(this.pusher,"private-"+e,this.options)),this.channels["private-"+e]}encryptedPrivateChannel(e){return this.channels["private-encrypted-"+e]||(this.channels["private-encrypted-"+e]=new U_(this.pusher,"private-encrypted-"+e,this.options)),this.channels["private-encrypted-"+e]}presenceChannel(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new B_(this.pusher,"presence-"+e,this.options)),this.channels["presence-"+e]}leave(e){[e,"private-"+e,"private-encrypted-"+e,"presence-"+e].forEach(n=>{this.leaveChannel(n)})}leaveChannel(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}socketId(){return this.pusher.connection.socket_id}connectionStatus(){const e=this.pusher.connection.state;switch(e){case"connected":case"connecting":return e;case"failed":case"unavailable":return"failed";default:return"disconnected"}}onConnectionChange(e){const n=()=>{e(this.connectionStatus())},r=["state_change","connected","disconnected"];return r.forEach(i=>{this.pusher.connection.bind(i,n)}),()=>{r.forEach(i=>{this.pusher.connection.unbind(i,n)})}}disconnect(){this.pusher.disconnect()}}class V_ extends Eo{constructor(){super(...arguments),this.channels={}}connect(){const e=this.getSocketIO();this.socket=e(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>{Object.values(this.channels).forEach(n=>{n.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,n,r){return this.channel(e).listen(n,r)}channel(e){return this.channels[e]||(this.channels[e]=new ry(this.socket,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new iy(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(n=>{this.leaveChannel(n)})}leaveChannel(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}socketId(){return this.socket.id}connectionStatus(){return this.socket.connected?"connected":this.socket.io._reconnecting?"reconnecting":this.socket.id!==void 0?"disconnected":"connecting"}onConnectionChange(e){const n=()=>{e(this.connectionStatus())},r=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return r.forEach(i=>{this.socket.on(i,n)}),()=>{r.forEach(i=>{this.socket.off(i,n)})}}disconnect(){this.socket.disconnect()}}class oy extends Eo{constructor(){super(...arguments),this.channels={}}connect(){}listen(e,n,r){return new gc}channel(e){return new gc}privateChannel(e){return new sy}encryptedPrivateChannel(e){return new q_}presenceChannel(e){return new G_}leave(e){}leaveChannel(e){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(e){return()=>{}}disconnect(){}}class F_{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 pc({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new pc(this.options);else if(this.options.broadcaster==="ably")this.connector=new pc({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new V_(this.options);else if(this.options.broadcaster==="null")this.connector=new oy(this.options);else if(typeof this.options.broadcaster=="function"&&j_(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,n,r){return this.connector.listen(e,n,r)}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 pc||e instanceof oy}socketId(){return this.connector.socketId()}connectionStatus(){return this.connector.connectionStatus()}registerInterceptors(){typeof Vue<"u"&&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,n)=>{this.socketId()&&e.headers.set("X-Socket-ID",this.socketId()),n()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(e=>(this.socketId()&&(e.headers["X-Socket-Id"]=this.socketId()),e))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((e,n,r)=>{this.socketId()&&r.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",e=>{e.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}var df={exports:{}};var ly;function K_(){return ly||(ly=1,(function(o,e){(function(r,i){o.exports=i()})(self,()=>(()=>{var n={594(u,d){var f=this&&this.__extends||(function(){var M=function(T,D){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,H){j.__proto__=H}||function(j,H){for(var P in H)H.hasOwnProperty(P)&&(j[P]=H[P])},M(T,D)};return function(T,D){M(T,D);function j(){this.constructor=T}T.prototype=D===null?Object.create(D):(j.prototype=D.prototype,new j)}})();Object.defineProperty(d,"__esModule",{value:!0});var g=256,m=(function(){function M(T){T===void 0&&(T="="),this._paddingCharacter=T}return M.prototype.encodedLength=function(T){return this._paddingCharacter?(T+2)/3*4|0:(T*8+5)/6|0},M.prototype.encode=function(T){for(var D="",j=0;j<T.length-2;j+=3){var H=T[j]<<16|T[j+1]<<8|T[j+2];D+=this._encodeByte(H>>>18&63),D+=this._encodeByte(H>>>12&63),D+=this._encodeByte(H>>>6&63),D+=this._encodeByte(H>>>0&63)}var P=T.length-j;if(P>0){var H=T[j]<<16|(P===2?T[j+1]<<8:0);D+=this._encodeByte(H>>>18&63),D+=this._encodeByte(H>>>12&63),P===2?D+=this._encodeByte(H>>>6&63):D+=this._paddingCharacter||"",D+=this._paddingCharacter||""}return D},M.prototype.maxDecodedLength=function(T){return this._paddingCharacter?T/4*3|0:(T*6+7)/8|0},M.prototype.decodedLength=function(T){return this.maxDecodedLength(T.length-this._getPaddingLength(T))},M.prototype.decode=function(T){if(T.length===0)return new Uint8Array(0);for(var D=this._getPaddingLength(T),j=T.length-D,H=new Uint8Array(this.maxDecodedLength(j)),P=0,X=0,pe=0,_e=0,we=0,Me=0,qe=0;X<j-4;X+=4)_e=this._decodeChar(T.charCodeAt(X+0)),we=this._decodeChar(T.charCodeAt(X+1)),Me=this._decodeChar(T.charCodeAt(X+2)),qe=this._decodeChar(T.charCodeAt(X+3)),H[P++]=_e<<2|we>>>4,H[P++]=we<<4|Me>>>2,H[P++]=Me<<6|qe,pe|=_e&g,pe|=we&g,pe|=Me&g,pe|=qe&g;if(X<j-1&&(_e=this._decodeChar(T.charCodeAt(X)),we=this._decodeChar(T.charCodeAt(X+1)),H[P++]=_e<<2|we>>>4,pe|=_e&g,pe|=we&g),X<j-2&&(Me=this._decodeChar(T.charCodeAt(X+2)),H[P++]=we<<4|Me>>>2,pe|=Me&g),X<j-3&&(qe=this._decodeChar(T.charCodeAt(X+3)),H[P++]=Me<<6|qe,pe|=qe&g),pe!==0)throw new Error("Base64Coder: incorrect characters for decoding");return H},M.prototype._encodeByte=function(T){var D=T;return D+=65,D+=25-T>>>8&6,D+=51-T>>>8&-75,D+=61-T>>>8&-15,D+=62-T>>>8&3,String.fromCharCode(D)},M.prototype._decodeChar=function(T){var D=g;return D+=(42-T&T-44)>>>8&-g+T-43+62,D+=(46-T&T-48)>>>8&-g+T-47+63,D+=(47-T&T-58)>>>8&-g+T-48+52,D+=(64-T&T-91)>>>8&-g+T-65+0,D+=(96-T&T-123)>>>8&-g+T-97+26,D},M.prototype._getPaddingLength=function(T){var D=0;if(this._paddingCharacter){for(var j=T.length-1;j>=0&&T[j]===this._paddingCharacter;j--)D++;if(T.length<4||D>2)throw new Error("Base64Coder: incorrect padding")}return D},M})();d.Coder=m;var b=new m;function v(M){return b.encode(M)}d.encode=v;function S(M){return b.decode(M)}d.decode=S;var _=(function(M){f(T,M);function T(){return M!==null&&M.apply(this,arguments)||this}return T.prototype._encodeByte=function(D){var j=D;return j+=65,j+=25-D>>>8&6,j+=51-D>>>8&-75,j+=61-D>>>8&-13,j+=62-D>>>8&49,String.fromCharCode(j)},T.prototype._decodeChar=function(D){var j=g;return j+=(44-D&D-46)>>>8&-g+D-45+62,j+=(94-D&D-96)>>>8&-g+D-95+63,j+=(47-D&D-58)>>>8&-g+D-48+52,j+=(64-D&D-91)>>>8&-g+D-65+0,j+=(96-D&D-123)>>>8&-g+D-97+26,j},T})(m);d.URLSafeCoder=_;var x=new _;function k(M){return x.encode(M)}d.encodeURLSafe=k;function O(M){return x.decode(M)}d.decodeURLSafe=O,d.encodedLength=function(M){return b.encodedLength(M)},d.maxDecodedLength=function(M){return b.maxDecodedLength(M)},d.decodedLength=function(M){return b.decodedLength(M)}},978(u,d){var f="utf8: invalid source encoding";function g(m){for(var b=[],v=0;v<m.length;v++){var S=m[v];if(S&128){var _=void 0;if(S<224){if(v>=m.length)throw new Error(f);var x=m[++v];if((x&192)!==128)throw new Error(f);S=(S&31)<<6|x&63,_=128}else if(S<240){if(v>=m.length-1)throw new Error(f);var x=m[++v],k=m[++v];if((x&192)!==128||(k&192)!==128)throw new Error(f);S=(S&15)<<12|(x&63)<<6|k&63,_=2048}else if(S<248){if(v>=m.length-2)throw new Error(f);var x=m[++v],k=m[++v],O=m[++v];if((x&192)!==128||(k&192)!==128||(O&192)!==128)throw new Error(f);S=(S&15)<<18|(x&63)<<12|(k&63)<<6|O&63,_=65536}else throw new Error(f);if(S<_||S>=55296&&S<=57343)throw new Error(f);if(S>=65536){if(S>1114111)throw new Error(f);S-=65536,b.push(String.fromCharCode(55296|S>>10)),S=56320|S&1023}}b.push(String.fromCharCode(S))}return b.join("")}d.D4=g},721(u,d,f){u.exports=f(207).default},207(u,d,f){f.d(d,{default:()=>Ss});class g{constructor(y,w){this.lastId=0,this.prefix=y,this.name=w}create(y){this.lastId++;var w=this.lastId,L=this.prefix+w,N=this.name+"["+w+"]",te=!1,ye=function(){te||(y.apply(null,arguments),te=!0)};return this[w]=ye,{number:w,id:L,name:N,callback:ye}}remove(y){delete this[y.number]}}var m=new g("_pusher_script_","Pusher.ScriptReceivers"),b={VERSION:"8.6.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:""};const v=b;class S{constructor(y){this.options=y,this.receivers=y.receivers||m,this.loading={}}load(y,w,L){var N=this;if(N.loading[y]&&N.loading[y].length>0)N.loading[y].push(L);else{N.loading[y]=[L];var te=Be.createScriptRequest(N.getPath(y,w)),ye=N.receivers.create(function(Ne){if(N.receivers.remove(ye),N.loading[y]){var Fe=N.loading[y];delete N.loading[y];for(var lt=function(jt){jt||te.cleanup()},pt=0;pt<Fe.length;pt++)Fe[pt](Ne,lt)}});te.send(ye)}}getRoot(y){var w,L=Be.getDocument().location.protocol;return y&&y.useTLS||L==="https:"?w=this.options.cdn_https:w=this.options.cdn_http,w.replace(/\/*$/,"")+"/"+this.options.version}getPath(y,w){return this.getRoot(w)+"/"+y+this.options.suffix+".js"}}var _=new g("_pusher_dependencies","Pusher.DependenciesReceivers"),x=new S({cdn_http:v.cdn_http,cdn_https:v.cdn_https,version:v.VERSION,suffix:v.dependency_suffix,receivers:_});const k={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"}}},M={buildLogSuffix:function(E){const y="See:",w=k.urls[E];if(!w)return"";let L;return w.fullUrl?L=w.fullUrl:w.path&&(L=k.baseUrl+w.path),L?`${y} ${L}`:""}};var T;(function(E){E.UserAuthentication="user-authentication",E.ChannelAuthorization="channel-authorization"})(T||(T={}));class D extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class j extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class H extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class X extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class pe extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class _e extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class we extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class Me extends Error{constructor(y,w){super(w),this.status=y,Object.setPrototypeOf(this,new.target.prototype)}}const Je=function(E,y,w,L,N){const te=Be.createXHR();te.open("POST",w.endpoint,!0),te.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var ye in w.headers)te.setRequestHeader(ye,w.headers[ye]);if(w.headersProvider!=null){let Ne=w.headersProvider();for(var ye in Ne)te.setRequestHeader(ye,Ne[ye])}return te.onreadystatechange=function(){if(te.readyState===4)if(te.status===200){let Ne,Fe=!1;try{Ne=JSON.parse(te.responseText),Fe=!0}catch{N(new Me(200,`JSON returned from ${L.toString()} endpoint was invalid, yet status code was 200. Data was: ${te.responseText}`),null)}Fe&&N(null,Ne)}else{let Ne="";switch(L){case T.UserAuthentication:Ne=M.buildLogSuffix("authenticationEndpoint");break;case T.ChannelAuthorization:Ne=`Clients must be authorized to join private or presence channels. ${M.buildLogSuffix("authorizationEndpoint")}`;break}N(new Me(te.status,`Unable to retrieve auth string from ${L.toString()} endpoint - received status: ${te.status} from ${w.endpoint}. ${Ne}`),null)}},te.send(y),te};function gt(E){return A(ae(E))}var Q=String.fromCharCode,fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ve=function(E){var y=E.charCodeAt(0);return y<128?E:y<2048?Q(192|y>>>6)+Q(128|y&63):Q(224|y>>>12&15)+Q(128|y>>>6&63)+Q(128|y&63)},ae=function(E){return E.replace(/[^\x00-\x7F]/g,ve)},ge=function(E){var y=[0,2,1][E.length%3],w=E.charCodeAt(0)<<16|(E.length>1?E.charCodeAt(1):0)<<8|(E.length>2?E.charCodeAt(2):0),L=[fe.charAt(w>>>18),fe.charAt(w>>>12&63),y>=2?"=":fe.charAt(w>>>6&63),y>=1?"=":fe.charAt(w&63)];return L.join("")},A=typeof window<"u"&&window.btoa||function(E){return E.replace(/[\s\S]{1,3}/g,ge)};class K{constructor(y,w,L,N){this.clear=w,this.timer=y(()=>{this.timer&&(this.timer=N(this.timer))},L)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}const ue=K;function he(E){window.clearTimeout(E)}function le(E){window.clearInterval(E)}class de extends ue{constructor(y,w){super(setTimeout,he,y,function(L){return w(),null})}}class Oe extends ue{constructor(y,w){super(setInterval,le,y,function(L){return w(),L})}}var He={now(){return Date.now?Date.now():new Date().valueOf()},defer(E){return new de(0,E)},method(E,...y){var w=Array.prototype.slice.call(arguments,1);return function(L){return L[E].apply(L,w.concat(arguments))}}};const Pe=He;function ke(E,...y){for(var w=0;w<y.length;w++){var L=y[w];for(var N in L)N==="__proto__"||N==="constructor"||N==="prototype"||(L[N]&&L[N].constructor&&L[N].constructor===Object?E[N]=ke(E[N]||{},L[N]):E[N]=L[N])}return E}function Ot(){for(var E=["Pusher"],y=0;y<arguments.length;y++)typeof arguments[y]=="string"?E.push(arguments[y]):E.push(An(arguments[y]));return E.join(" : ")}function ut(E,y){var w=Array.prototype.indexOf;if(E===null)return-1;if(w&&E.indexOf===w)return E.indexOf(y);for(var L=0,N=E.length;L<N;L++)if(E[L]===y)return L;return-1}function Ct(E,y){for(var w in E)Object.prototype.hasOwnProperty.call(E,w)&&y(E[w],w,E)}function vt(E){var y=[];return Ct(E,function(w,L){y.push(L)}),y}function kt(E){var y=[];return Ct(E,function(w){y.push(w)}),y}function Ee(E,y,w){for(var L=0;L<E.length;L++)y.call(w||window,E[L],L,E)}function Nt(E,y){for(var w=[],L=0;L<E.length;L++)w.push(y(E[L],L,E,w));return w}function zt(E,y){var w={};return Ct(E,function(L,N){w[N]=y(L)}),w}function qt(E,y){y=y||function(N){return!!N};for(var w=[],L=0;L<E.length;L++)y(E[L],L,E,w)&&w.push(E[L]);return w}function Lt(E,y){var w={};return Ct(E,function(L,N){(y&&y(L,N,E,w)||L)&&(w[N]=L)}),w}function _n(E){var y=[];return Ct(E,function(w,L){y.push([L,w])}),y}function hn(E,y){for(var w=0;w<E.length;w++)if(y(E[w],w,E))return!0;return!1}function Ba(E,y){for(var w=0;w<E.length;w++)if(!y(E[w],w,E))return!1;return!0}function Jt(E){return zt(E,function(y){return y===null?"":(typeof y=="object"&&(y=An(y)),encodeURIComponent(gt(y.toString())))})}function Dr(E){var y=Lt(E,function(L){return L!==void 0}),w=Nt(_n(Jt(y)),Pe.method("join","=")).join("&");return w}function tr(E){var y=[],w=[];return(function L(N,te){var ye,Ne,Fe;switch(typeof N){case"object":if(!N)return null;for(ye=0;ye<y.length;ye+=1)if(y[ye]===N)return{$ref:w[ye]};if(y.push(N),w.push(te),Object.prototype.toString.apply(N)==="[object Array]")for(Fe=[],ye=0;ye<N.length;ye+=1)Fe[ye]=L(N[ye],te+"["+ye+"]");else{Fe={};for(Ne in N)Object.prototype.hasOwnProperty.call(N,Ne)&&(Fe[Ne]=L(N[Ne],te+"["+JSON.stringify(Ne)+"]"))}return Fe;case"number":case"string":case"boolean":return N}})(E,"$")}function An(E){try{return JSON.stringify(E)}catch{return JSON.stringify(tr(E))}}class sn{constructor(){this.globalLog=y=>{window.console&&window.console.log&&window.console.log(y)}}debug(...y){this.log(this.globalLog,y)}warn(...y){this.log(this.globalLogWarn,y)}error(...y){this.log(this.globalLogError,y)}globalLogWarn(y){window.console&&window.console.warn?window.console.warn(y):this.globalLog(y)}globalLogError(y){window.console&&window.console.error?window.console.error(y):this.globalLogWarn(y)}log(y,...w){var L=Ot.apply(this,arguments);Ss.log?Ss.log(L):Ss.logToConsole&&y.bind(this)(L)}}const tt=new sn;var na=function(E,y,w,L,N){(w.headers!==void 0||w.headersProvider!=null)&&tt.warn(`To send headers with the ${L.toString()} request, you must use AJAX, rather than JSONP.`);var te=E.nextAuthCallbackID.toString();E.nextAuthCallbackID++;var ye=E.getDocument(),Ne=ye.createElement("script");E.auth_callbacks[te]=function(pt){N(null,pt)};var Fe="Pusher.auth_callbacks['"+te+"']";Ne.src=w.endpoint+"?callback="+encodeURIComponent(Fe)+"&"+y;var lt=ye.getElementsByTagName("head")[0]||ye.documentElement;lt.insertBefore(Ne,lt.firstChild)};const kn=na;class nr{constructor(y){this.src=y}send(y){var w=this,L="Error loading "+w.src;w.script=document.createElement("script"),w.script.id=y.id,w.script.src=w.src,w.script.type="text/javascript",w.script.charset="UTF-8",w.script.addEventListener?(w.script.onerror=function(){y.callback(L)},w.script.onload=function(){y.callback(null)}):w.script.onreadystatechange=function(){(w.script.readyState==="loaded"||w.script.readyState==="complete")&&y.callback(null)},w.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(w.errorScript=document.createElement("script"),w.errorScript.id=y.id+"_error",w.errorScript.text=y.name+"('"+L+"');",w.script.async=w.errorScript.async=!1):w.script.async=!0;var N=document.getElementsByTagName("head")[0];N.insertBefore(w.script,N.firstChild),w.errorScript&&N.insertBefore(w.errorScript,w.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 _a{constructor(y,w){this.url=y,this.data=w}send(y){if(!this.request){var w=Dr(this.data),L=this.url+"/"+y.number+"?"+w;this.request=Be.createScriptRequest(L),this.request.send(y)}}cleanup(){this.request&&this.request.cleanup()}}var on=function(E,y){return function(w,L){var N="http"+(y?"s":"")+"://",te=N+(E.host||E.options.host)+E.options.path,ye=Be.createJSONPRequest(te,w),Ne=Be.ScriptReceivers.create(function(Fe,lt){m.remove(Ne),ye.cleanup(),lt&<.host&&(E.host=lt.host),L&&L(Fe,lt)});ye.send(Ne)}},Dn={name:"jsonp",getAgent:on};const q=Dn;function ie(E,y,w){var L=E+(y.useTLS?"s":""),N=y.useTLS?y.hostTLS:y.hostNonTLS;return L+"://"+N+w}function oe(E,y){var w="/app/"+E,L="?protocol="+v.PROTOCOL+"&client=js&version="+v.VERSION+(y?"&"+y:"");return w+L}var Z={getInitial:function(E,y){var w=(y.httpPath||"")+oe(E,"flash=false");return ie("ws",y,w)}},be={getInitial:function(E,y){var w=(y.httpPath||"/pusher")+oe(E);return ie("http",y,w)}},me={getInitial:function(E,y){return ie("http",y,y.httpPath||"/pusher")},getPath:function(E,y){return oe(E)}};class Te{constructor(){this._callbacks={}}get(y){return this._callbacks[xe(y)]}add(y,w,L){var N=xe(y);this._callbacks[N]=this._callbacks[N]||[],this._callbacks[N].push({fn:w,context:L})}remove(y,w,L){if(!y&&!w&&!L){this._callbacks={};return}var N=y?[xe(y)]:vt(this._callbacks);w||L?this.removeCallback(N,w,L):this.removeAllCallbacks(N)}removeCallback(y,w,L){Ee(y,function(N){this._callbacks[N]=qt(this._callbacks[N]||[],function(te){return w&&w!==te.fn||L&&L!==te.context}),this._callbacks[N].length===0&&delete this._callbacks[N]},this)}removeAllCallbacks(y){Ee(y,function(w){delete this._callbacks[w]},this)}}function xe(E){return"_"+E}class je{constructor(y){this.callbacks=new Te,this.global_callbacks=[],this.failThrough=y}bind(y,w,L){return this.callbacks.add(y,w,L),this}bind_global(y){return this.global_callbacks.push(y),this}unbind(y,w,L){return this.callbacks.remove(y,w,L),this}unbind_global(y){return y?(this.global_callbacks=qt(this.global_callbacks||[],w=>w!==y),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(y,w,L){for(var N=0;N<this.global_callbacks.length;N++)this.global_callbacks[N](y,w);var te=this.callbacks.get(y),ye=[];if(L?ye.push(w,L):w&&ye.push(w),te&&te.length>0)for(var N=0;N<te.length;N++)te[N].fn.apply(te[N].context||window,ye);else this.failThrough&&this.failThrough(y,w);return this}}class ze extends je{constructor(y,w,L,N,te){super(),this.initialize=Be.transportConnectionInitializer,this.hooks=y,this.name=w,this.priority=L,this.key=N,this.options=te,this.state="new",this.timeline=te.timeline,this.activityTimeout=te.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 y=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(y,this.options)}catch(w){return Pe.defer(()=>{this.onError(w),this.changeState("closed")}),!1}return this.bindListeners(),tt.debug("Connecting",{transport:this.name,url:y}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(y){return this.state==="open"?(Pe.defer(()=>{this.socket&&this.socket.send(y)}),!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(y){this.emit("error",{type:"WebSocketError",error:y}),this.timeline.error(this.buildTimelineMessage({error:y.toString()}))}onClose(y){y?this.changeState("closed",{code:y.code,reason:y.reason,wasClean:y.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(y){this.emit("message",y)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=y=>{this.onError(y)},this.socket.onclose=y=>{this.onClose(y)},this.socket.onmessage=y=>{this.onMessage(y)},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(y,w){this.state=y,this.timeline.info(this.buildTimelineMessage({state:y,params:w})),this.emit(y,w)}buildTimelineMessage(y){return ke({cid:this.id},y)}}class $e{constructor(y){this.hooks=y}isSupported(y){return this.hooks.isSupported(y)}createConnection(y,w,L,N){return new ze(this.hooks,y,w,L,N)}}var De=new $e({urls:Z,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Be.getWebSocketAPI()},isSupported:function(){return!!Be.getWebSocketAPI()},getSocket:function(E){return Be.createWebSocket(E)}}),Ye={urls:be,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Ke=ke({getSocket:function(E){return Be.HTTPFactory.createStreamingSocket(E)}},Ye),Ae=ke({getSocket:function(E){return Be.HTTPFactory.createPollingSocket(E)}},Ye),Re={isSupported:function(){return Be.isXHRSupported()}},Ue=new $e(ke({},Ke,Re)),ot=new $e(ke({},Ae,Re)),At={ws:De,xhr_streaming:Ue,xhr_polling:ot};const Qt=At;var Kt=new $e({file:"sockjs",urls:me,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(E,y){return new window.SockJS(E,null,{js_path:x.getPath("sockjs",{useTLS:y.useTLS}),ignore_null_origin:y.ignoreNullOrigin})},beforeOpen:function(E,y){E.send(JSON.stringify({path:y}))}}),Fn={isSupported:function(E){var y=Be.isXDRSupported(E.useTLS);return y}},Nn=new $e(ke({},Ke,Fn)),ln=new $e(ke({},Ae,Fn));Qt.xdr_streaming=Nn,Qt.xdr_polling=ln,Qt.sockjs=Kt;const xn=Qt;class Or extends je{constructor(){super();var y=this;typeof window<"u"&&window.addEventListener!==void 0&&(window.addEventListener("online",function(){y.emit("online")},!1),window.addEventListener("offline",function(){y.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Lo=new Or;class bf{constructor(y,w,L){this.manager=y,this.transport=w,this.minPingDelay=L.minPingDelay,this.maxPingDelay=L.maxPingDelay,this.pingDelay=void 0}createConnection(y,w,L,N){N=ke({},N,{activityTimeout:this.pingDelay});var te=this.transport.createConnection(y,w,L,N),ye=null,Ne=function(){te.unbind("open",Ne),te.bind("closed",Fe),ye=Pe.now()},Fe=lt=>{if(te.unbind("closed",Fe),lt.code===1002||lt.code===1003)this.manager.reportDeath();else if(!lt.wasClean&&ye){var pt=Pe.now()-ye;pt<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(pt/2,this.minPingDelay))}};return te.bind("open",Ne),te}isSupported(y){return this.manager.isAlive()&&this.transport.isSupported(y)}}const Ec={decodeMessage:function(E){try{var y=JSON.parse(E.data),w=y.data;if(typeof w=="string")try{w=JSON.parse(y.data)}catch{}var L={event:y.event,channel:y.channel,data:w};return y.user_id&&(L.user_id=y.user_id),L}catch(N){throw{type:"MessageParseError",error:N,data:E.data}}},encodeMessage:function(E){return JSON.stringify(E)},processHandshake:function(E){var y=Ec.decodeMessage(E);if(y.event==="pusher:connection_established"){if(!y.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:y.data.socket_id,activityTimeout:y.data.activity_timeout*1e3}}else{if(y.event==="pusher:error")return{action:this.getCloseAction(y.data),error:this.getCloseError(y.data)};throw"Invalid handshake"}},getCloseAction:function(E){return E.code<4e3?E.code>=1002&&E.code<=1004?"backoff":null:E.code===4e3?"tls_only":E.code<4100?"refused":E.code<4200?"backoff":E.code<4300?"retry":"refused"},getCloseError:function(E){return E.code!==1e3&&E.code!==1001?{type:"PusherError",data:{code:E.code,message:E.reason||E.message}}:null}},Pa=Ec;class vi extends je{constructor(y,w){super(),this.id=y,this.transport=w,this.activityTimeout=w.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(y){return this.transport.send(y)}send_event(y,w,L){var N={event:y,data:w};return L&&(N.channel=L),tt.debug("Event sent",N),this.send(Pa.encodeMessage(N))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var y={message:L=>{var N;try{N=Pa.decodeMessage(L)}catch(te){this.emit("error",{type:"MessageParseError",error:te,data:L.data})}if(N!==void 0){switch(tt.debug("Event recd",N),N.event){case"pusher:error":this.emit("error",{type:"PusherError",data:N.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",N)}},activity:()=>{this.emit("activity")},error:L=>{this.emit("error",L)},closed:L=>{w(),L&&L.code&&this.handleCloseEvent(L),this.transport=null,this.emit("closed")}},w=()=>{Ct(y,(L,N)=>{this.transport.unbind(N,L)})};Ct(y,(L,N)=>{this.transport.bind(N,L)})}handleCloseEvent(y){var w=Pa.getCloseAction(y),L=Pa.getCloseError(y);L&&this.emit("error",L),w&&this.emit(w,{action:w,error:L})}}class Mo{constructor(y,w){this.transport=y,this.callback=w,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=y=>{this.unbindListeners();var w;try{w=Pa.processHandshake(y)}catch(L){this.finish("error",{error:L}),this.transport.close();return}w.action==="connected"?this.finish("connected",{connection:new vi(w.id,this.transport),activityTimeout:w.activityTimeout}):(this.finish(w.action,{error:w.error}),this.transport.close())},this.onClosed=y=>{this.unbindListeners();var w=Pa.getCloseAction(y)||"backoff",L=Pa.getCloseError(y);this.finish(w,{error:L})},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(y,w){this.callback(ke({transport:this.transport,action:y},w))}}class Lr{constructor(y,w){this.timeline=y,this.options=w||{}}send(y,w){this.timeline.isEmpty()||this.timeline.send(Be.TimelineTransport.getAgent(this,y),w)}}class qa extends je{constructor(y,w){super(function(L,N){tt.debug("No callbacks on "+y+" for "+L)}),this.name=y,this.pusher=w,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(y,w){return w(null,{auth:""})}trigger(y,w){if(y.indexOf("client-")!==0)throw new D("Event '"+y+"' does not start with 'client-'");if(!this.subscribed){var L=M.buildLogSuffix("triggeringClientEvents");tt.warn(`Client event triggered before channel 'subscription_succeeded' event . ${L}`)}return this.pusher.send_event(y,w,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(y){var w=y.event,L=y.data;if(w==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(y);else if(w==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(y);else if(w.indexOf("pusher_internal:")!==0){var N={};this.emit(w,L,N)}}handleSubscriptionSucceededEvent(y){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",y.data)}handleSubscriptionCountEvent(y){y.data.subscription_count&&(this.subscriptionCount=y.data.subscription_count),this.emit("pusher:subscription_count",y.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(y,w)=>{y?(this.subscriptionPending=!1,tt.error(y.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:y.message},y instanceof Me?{status:y.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:w.auth,channel_data:w.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 ar extends qa{authorize(y,w){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:y},w)}}class Mr{constructor(){this.reset()}get(y){return Object.prototype.hasOwnProperty.call(this.members,y)?{id:y,info:this.members[y]}:null}each(y){Ct(this.members,(w,L)=>{y(this.get(L))})}setMyID(y){this.myID=y}onSubscription(y){this.members=y.presence.hash,this.count=y.presence.count,this.me=this.get(this.myID)}addMember(y){return this.get(y.user_id)===null&&this.count++,this.members[y.user_id]=y.user_info,this.get(y.user_id)}removeMember(y){var w=this.get(y.user_id);return w&&(delete this.members[y.user_id],this.count--),w}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Zt=function(E,y,w,L){function N(te){return te instanceof w?te:new w(function(ye){ye(te)})}return new(w||(w=Promise))(function(te,ye){function Ne(pt){try{lt(L.next(pt))}catch(jt){ye(jt)}}function Fe(pt){try{lt(L.throw(pt))}catch(jt){ye(jt)}}function lt(pt){pt.done?te(pt.value):N(pt.value).then(Ne,Fe)}lt((L=L.apply(E,y||[])).next())})};class _c extends ar{constructor(y,w){super(y,w),this.members=new Mr}authorize(y,w){super.authorize(y,(L,N)=>Zt(this,void 0,void 0,function*(){if(!L)if(N=N,N.channel_data!=null){var te=JSON.parse(N.channel_data);this.members.setMyID(te.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=M.buildLogSuffix("authorizationEndpoint");tt.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${ye}, or the user should be signed in.`),w("Invalid auth response");return}w(L,N)}))}handleEvent(y){var w=y.event;if(w.indexOf("pusher_internal:")===0)this.handleInternalEvent(y);else{var L=y.data,N={};y.user_id&&(N.user_id=y.user_id),this.emit(w,L,N)}}handleInternalEvent(y){var w=y.event,L=y.data;switch(w){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(y);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(y);break;case"pusher_internal:member_added":var N=this.members.addMember(L);this.emit("pusher:member_added",N);break;case"pusher_internal:member_removed":var te=this.members.removeMember(L);te&&this.emit("pusher:member_removed",te);break}}handleSubscriptionSucceededEvent(y){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(y.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Ac=f(978),Aa=f(594);class $r extends ar{constructor(y,w,L){super(y,w),this.key=null,this.nacl=L}authorize(y,w){super.authorize(y,(L,N)=>{if(L){w(L,N);return}let te=N.shared_secret;if(!te){w(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=(0,Aa.decode)(te),delete N.shared_secret,w(null,N)})}trigger(y,w){throw new pe("Client events are not currently supported for encrypted channels")}handleEvent(y){var w=y.event,L=y.data;if(w.indexOf("pusher_internal:")===0||w.indexOf("pusher:")===0){super.handleEvent(y);return}this.handleEncryptedEvent(w,L)}handleEncryptedEvent(y,w){if(!this.key){tt.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!w.ciphertext||!w.nonce){tt.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+w);return}let L=(0,Aa.decode)(w.ciphertext);if(L.length<this.nacl.secretbox.overheadLength){tt.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${L.length}`);return}let N=(0,Aa.decode)(w.nonce);if(N.length<this.nacl.secretbox.nonceLength){tt.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${N.length}`);return}let te=this.nacl.secretbox.open(L,N,this.key);if(te===null){tt.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,Ne)=>{if(ye){tt.error(`Failed to make a request to the authEndpoint: ${Ne}. Unable to fetch new key, so dropping encrypted event`);return}if(te=this.nacl.secretbox.open(L,N,this.key),te===null){tt.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(y,this.getDataToEmit(te))});return}this.emit(y,this.getDataToEmit(te))}getDataToEmit(y){let w=(0,Ac.D4)(y);try{return JSON.parse(w)}catch{return w}}}class vf extends je{constructor(y,w){super(),this.state="initialized",this.connection=null,this.key=y,this.options=w,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 L=Be.getNetwork();L.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),L.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(y){this.key=y,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(y){return this.connection?this.connection.send(y):!1}send_event(y,w,L){return this.connection?this.connection.send_event(y,w,L):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var y=(w,L)=>{w?this.runner=this.strategy.connect(0,y):L.action==="error"?(this.emit("error",{type:"HandshakeError",error:L.error}),this.timeline.error({handshakeError:L.error})):(this.abortConnecting(),this.handshakeCallbacks[L.action](L))};this.runner=this.strategy.connect(0,y)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var y=this.abandonConnection();y.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(y){this.timeline.info({action:"retry",delay:y}),y>0&&this.emit("connecting_in",Math.round(y/1e3)),this.retryTimer=new de(y||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new de(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new de(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 de(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(y){return ke({},y,{message:w=>{this.resetActivityCheck(),this.emit("message",w)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:w=>{this.emit("error",w)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(y){return ke({},y,{connected:w=>{this.activityTimeout=Math.min(this.options.activityTimeout,w.activityTimeout,w.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(w.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let y=w=>L=>{L.error&&this.emit("error",{type:"WebSocketError",error:L.error}),w(L)};return{tls_only:y(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:y(()=>{this.disconnect()}),backoff:y(()=>{this.retryIn(1e3)}),retry:y(()=>{this.retryIn(0)})}}setConnection(y){this.connection=y;for(var w in this.connectionCallbacks)this.connection.bind(w,this.connectionCallbacks[w]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var y in this.connectionCallbacks)this.connection.unbind(y,this.connectionCallbacks[y]);var w=this.connection;return this.connection=null,w}}updateState(y,w){var L=this.state;if(this.state=y,L!==y){var N=y;N==="connected"&&(N+=" with new socket ID "+w.socket_id),tt.debug("State changed",L+" -> "+N),this.timeline.info({state:y,params:w}),this.emit("state_change",{previous:L,current:y}),this.emit(y,w)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class xc{constructor(){this.channels={}}add(y,w){return this.channels[y]||(this.channels[y]=Tc(y,w)),this.channels[y]}all(){return kt(this.channels)}find(y){return this.channels[y]}remove(y){var w=this.channels[y];return delete this.channels[y],w}disconnect(){Ct(this.channels,function(y){y.disconnect()})}}function Tc(E,y){if(E.indexOf("private-encrypted-")===0){if(y.config.nacl)return In.createEncryptedChannel(E,y,y.config.nacl);let w="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",L=M.buildLogSuffix("encryptedChannelSupport");throw new pe(`${w}. ${L}`)}else{if(E.indexOf("private-")===0)return In.createPrivateChannel(E,y);if(E.indexOf("presence-")===0)return In.createPresenceChannel(E,y);if(E.indexOf("#")===0)throw new j('Cannot create a channel with name "'+E+'".');return In.createChannel(E,y)}}var Sf={createChannels(){return new xc},createConnectionManager(E,y){return new vf(E,y)},createChannel(E,y){return new qa(E,y)},createPrivateChannel(E,y){return new ar(E,y)},createPresenceChannel(E,y){return new _c(E,y)},createEncryptedChannel(E,y,w){return new $r(E,y,w)},createTimelineSender(E,y){return new Lr(E,y)},createHandshake(E,y){return new Mo(E,y)},createAssistantToTheTransportManager(E,y,w){return new bf(E,y,w)}};const In=Sf;class Si{constructor(y){this.options=y||{},this.livesLeft=this.options.lives||1/0}getAssistant(y){return In.createAssistantToTheTransportManager(this,y,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class mn{constructor(y,w){this.strategies=y,this.loop=!!w.loop,this.failFast=!!w.failFast,this.timeout=w.timeout,this.timeoutLimit=w.timeoutLimit}isSupported(){return hn(this.strategies,Pe.method("isSupported"))}connect(y,w){var L=this.strategies,N=0,te=this.timeout,ye=null,Ne=(Fe,lt)=>{lt?w(null,lt):(N=N+1,this.loop&&(N=N%L.length),N<L.length?(te&&(te=te*2,this.timeoutLimit&&(te=Math.min(te,this.timeoutLimit))),ye=this.tryStrategy(L[N],y,{timeout:te,failFast:this.failFast},Ne)):w(!0))};return ye=this.tryStrategy(L[N],y,{timeout:te,failFast:this.failFast},Ne),{abort:function(){ye.abort()},forceMinPriority:function(Fe){y=Fe,ye&&ye.forceMinPriority(Fe)}}}tryStrategy(y,w,L,N){var te=null,ye=null;return L.timeout>0&&(te=new de(L.timeout,function(){ye.abort(),N(!0)})),ye=y.connect(w,function(Ne,Fe){Ne&&te&&te.isRunning()&&!L.failFast||(te&&te.ensureAborted(),N(Ne,Fe))}),{abort:function(){te&&te.ensureAborted(),ye.abort()},forceMinPriority:function(Ne){ye.forceMinPriority(Ne)}}}}class Tn{constructor(y){this.strategies=y}isSupported(){return hn(this.strategies,Pe.method("isSupported"))}connect(y,w){return Rc(this.strategies,y,function(L,N){return function(te,ye){if(N[L].error=te,te){wf(N)&&w(!0);return}Ee(N,function(Ne){Ne.forceMinPriority(ye.transport.priority)}),w(null,ye)}})}}function Rc(E,y,w){var L=Nt(E,function(N,te,ye,Ne){return N.connect(y,w(te,Ne))});return{abort:function(){Ee(L,$o)},forceMinPriority:function(N){Ee(L,function(te){te.forceMinPriority(N)})}}}function wf(E){return Ba(E,function(y){return!!y.error})}function $o(E){!E.error&&!E.aborted&&(E.abort(),E.aborted=!0)}class kc{constructor(y,w,L){this.strategy=y,this.transports=w,this.ttl=L.ttl||18e5,this.usingTLS=L.useTLS,this.timeline=L.timeline}isSupported(){return this.strategy.isSupported()}connect(y,w){var L=this.usingTLS,N=Cf(L),te=N&&N.cacheSkipCount?N.cacheSkipCount:0,ye=[this.strategy];if(N&&N.timestamp+this.ttl>=Pe.now()){var Ne=this.transports[N.transport];Ne&&(["ws","wss"].includes(N.transport)||te>3?(this.timeline.info({cached:!0,transport:N.transport,latency:N.latency}),ye.push(new mn([Ne],{timeout:N.latency*2+1e3,failFast:!0}))):te++)}var Fe=Pe.now(),lt=ye.pop().connect(y,function pt(jt,ka){jt?(ps(L),ye.length>0?(Fe=Pe.now(),lt=ye.pop().connect(y,pt)):w(jt)):(Hn(L,ka.transport.name,Pe.now()-Fe,te),w(null,ka))});return{abort:function(){lt.abort()},forceMinPriority:function(pt){y=pt,lt&<.forceMinPriority(pt)}}}}function Nr(E){return"pusherTransport"+(E?"TLS":"NonTLS")}function Cf(E){var y=Be.getLocalStorage();if(y)try{var w=y[Nr(E)];if(w)return JSON.parse(w)}catch{ps(E)}return null}function Hn(E,y,w,L){var N=Be.getLocalStorage();if(N)try{N[Nr(E)]=An({timestamp:Pe.now(),transport:y,latency:w,cacheSkipCount:L})}catch{}}function ps(E){var y=Be.getLocalStorage();if(y)try{delete y[Nr(E)]}catch{}}class wi{constructor(y,{delay:w}){this.strategy=y,this.options={delay:w}}isSupported(){return this.strategy.isSupported()}connect(y,w){var L=this.strategy,N,te=new de(this.options.delay,function(){N=L.connect(y,w)});return{abort:function(){te.ensureAborted(),N&&N.abort()},forceMinPriority:function(ye){y=ye,N&&N.forceMinPriority(ye)}}}}class rr{constructor(y,w,L){this.test=y,this.trueBranch=w,this.falseBranch=L}isSupported(){var y=this.test()?this.trueBranch:this.falseBranch;return y.isSupported()}connect(y,w){var L=this.test()?this.trueBranch:this.falseBranch;return L.connect(y,w)}}class Ir{constructor(y){this.strategy=y}isSupported(){return this.strategy.isSupported()}connect(y,w){var L=this.strategy.connect(y,function(N,te){te&&L.abort(),w(N,te)});return L}}function Hr(E){return function(){return E.isSupported()}}var Dc=function(E,y,w){var L={};function N(Wo,Gc,Vc,qf,Gf){var Fc=w(E,Wo,Gc,Vc,qf,Gf);return L[Wo]=Fc,Fc}var te=Object.assign({},y,{hostNonTLS:E.wsHost+":"+E.wsPort,hostTLS:E.wsHost+":"+E.wssPort,httpPath:E.wsPath}),ye=Object.assign({},te,{useTLS:!0}),Ne=Object.assign({},y,{hostNonTLS:E.httpHost+":"+E.httpPort,hostTLS:E.httpHost+":"+E.httpsPort,httpPath:E.httpPath}),Fe={loop:!0,timeout:15e3,timeoutLimit:6e4},lt=new Si({minPingDelay:1e4,maxPingDelay:E.activityTimeout}),pt=new Si({lives:2,minPingDelay:1e4,maxPingDelay:E.activityTimeout}),jt=N("ws","ws",3,te,lt),ka=N("wss","ws",3,ye,lt),Uf=N("sockjs","sockjs",1,Ne),Pc=N("xhr_streaming","xhr_streaming",1,Ne,pt),Bf=N("xdr_streaming","xdr_streaming",1,Ne,pt),Vo=N("xhr_polling","xhr_polling",1,Ne),qc=N("xdr_polling","xdr_polling",1,Ne),Ur=new mn([jt],Fe),Ti=new mn([ka],Fe),Pf=new mn([Uf],Fe),Ri=new mn([new rr(Hr(Pc),Pc,Bf)],Fe),Fo=new mn([new rr(Hr(Vo),Vo,qc)],Fe),Ko=new mn([new rr(Hr(Ri),new Tn([Ri,new wi(Fo,{delay:4e3})]),Fo)],Fe),ki=new rr(Hr(Ko),Ko,Pf),Di;return y.useTLS?Di=new Tn([Ur,new wi(ki,{delay:2e3})]):Di=new Tn([Ur,new wi(Ti,{delay:2e3}),new wi(ki,{delay:5e3})]),new kc(new Ir(new rr(Hr(jt),Di,ki)),L,{ttl:18e5,timeline:y.timeline,useTLS:y.useTLS})};const zr=Dc;function Ef(){var E=this;E.timeline.info(E.buildTimelineMessage({transport:E.name+(E.options.useTLS?"s":"")})),E.hooks.isInitialized()?E.changeState("initialized"):E.hooks.file?(E.changeState("initializing"),x.load(E.hooks.file,{useTLS:E.options.useTLS},function(y,w){E.hooks.isInitialized()?(E.changeState("initialized"),w(!0)):(y&&E.onError(y),E.onClose(),w(!1))})):E.onClose()}var Oc={getRequest:function(E){var y=new window.XDomainRequest;return y.ontimeout=function(){E.emit("error",new H),E.close()},y.onerror=function(w){E.emit("error",w),E.close()},y.onprogress=function(){y.responseText&&y.responseText.length>0&&E.onChunk(200,y.responseText)},y.onload=function(){y.responseText&&y.responseText.length>0&&E.onChunk(200,y.responseText),E.emit("finished",200),E.close()},y},abortRequest:function(E){E.ontimeout=E.onerror=E.onprogress=E.onload=null,E.abort()}};const Lc=Oc,No=256*1024;class _f extends je{constructor(y,w,L){super(),this.hooks=y,this.method=w,this.url=L}start(y){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},Be.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(y)}close(){this.unloader&&(Be.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(y,w){for(;;){var L=this.advanceBuffer(w);if(L)this.emit("chunk",{status:y,data:L});else break}this.isBufferTooLong(w)&&this.emit("buffer_too_long")}advanceBuffer(y){var w=y.slice(this.position),L=w.indexOf(`
|
||
`);return L!==-1?(this.position+=L+1,w.slice(0,L)):null}isBufferTooLong(y){return this.position===y.length&&y.length>No}}var Io;(function(E){E[E.CONNECTING=0]="CONNECTING",E[E.OPEN=1]="OPEN",E[E.CLOSED=3]="CLOSED"})(Io||(Io={}));const aa=Io;var xa=1;class Ho{constructor(y,w){this.hooks=y,this.session=ms(1e3)+"/"+$c(8),this.location=zo(w),this.readyState=aa.CONNECTING,this.openStream()}send(y){return this.sendRaw(JSON.stringify([y]))}ping(){this.hooks.sendHeartbeat(this)}close(y,w){this.onClose(y,w,!0)}sendRaw(y){if(this.readyState===aa.OPEN)try{return Be.createSocketRequest("POST",ir(jr(this.location,this.session))).start(y),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(y,w,L){this.closeStream(),this.readyState=aa.CLOSED,this.onclose&&this.onclose({code:y,reason:w,wasClean:L})}onChunk(y){if(y.status===200){this.readyState===aa.OPEN&&this.onActivity();var w,L=y.data.slice(0,1);switch(L){case"o":w=JSON.parse(y.data.slice(1)||"{}"),this.onOpen(w);break;case"a":w=JSON.parse(y.data.slice(1)||"[]");for(var N=0;N<w.length;N++)this.onEvent(w[N]);break;case"m":w=JSON.parse(y.data.slice(1)||"null"),this.onEvent(w);break;case"h":this.hooks.onHeartbeat(this);break;case"c":w=JSON.parse(y.data.slice(1)||"[]"),this.onClose(w[0],w[1],!0);break}}}onOpen(y){this.readyState===aa.CONNECTING?(y&&y.hostname&&(this.location.base=Mc(this.location.base,y.hostname)),this.readyState=aa.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(y){this.readyState===aa.OPEN&&this.onmessage&&this.onmessage({data:y})}onActivity(){this.onactivity&&this.onactivity()}onError(y){this.onerror&&this.onerror(y)}openStream(){this.stream=Be.createSocketRequest("POST",ir(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",y=>{this.onChunk(y)}),this.stream.bind("finished",y=>{this.hooks.onFinished(this,y)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(y){Pe.defer(()=>{this.onError(y),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function zo(E){var y=/([^\?]*)\/*(\??.*)/.exec(E);return{base:y[1],queryString:y[2]}}function jr(E,y){return E.base+"/"+y+"/xhr_send"}function ir(E){var y=E.indexOf("?")===-1?"?":"&";return E+y+"t="+ +new Date+"&n="+xa++}function Mc(E,y){var w=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(E);return w[1]+y+w[3]}function ms(E){return Be.randomInt(E)}function $c(E){for(var y=[],w=0;w<E;w++)y.push(ms(32).toString(32));return y.join("")}const Ci=Ho;var Ta={getReceiveURL:function(E,y){return E.base+"/"+y+"/xhr_streaming"+E.queryString},onHeartbeat:function(E){E.sendRaw("[]")},sendHeartbeat:function(E){E.sendRaw("[]")},onFinished:function(E,y){E.onClose(1006,"Connection interrupted ("+y+")",!1)}};const jo=Ta;var Ei={getReceiveURL:function(E,y){return E.base+"/"+y+"/xhr"+E.queryString},onHeartbeat:function(){},sendHeartbeat:function(E){E.sendRaw("[]")},onFinished:function(E,y){y===200?E.reconnect():E.onClose(1006,"Connection interrupted ("+y+")",!1)}};const Ga=Ei;var Uo={getRequest:function(E){var y=Be.getXHRAPI(),w=new y;return w.onreadystatechange=w.onprogress=function(){switch(w.readyState){case 3:w.responseText&&w.responseText.length>0&&E.onChunk(w.status,w.responseText);break;case 4:w.responseText&&w.responseText.length>0&&E.onChunk(w.status,w.responseText),E.emit("finished",w.status),E.close();break}},w},abortRequest:function(E){E.onreadystatechange=null,E.abort()}};const ys=Uo;var Nc={createStreamingSocket(E){return this.createSocket(jo,E)},createPollingSocket(E){return this.createSocket(Ga,E)},createSocket(E,y){return new Ci(E,y)},createXHR(E,y){return this.createRequest(ys,E,y)},createRequest(E,y,w){return new _f(E,y,w)}};const _i=Nc;_i.createXDR=function(E,y){return this.createRequest(Lc,E,y)};var Ic={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:m,DependenciesReceivers:_,getDefaultStrategy:zr,Transports:xn,transportConnectionInitializer:Ef,HTTPFactory:_i,TimelineTransport:q,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(E){if(typeof window<"u"){window.Pusher=E;var y=()=>{this.onDocumentBody(E.ready)};window.JSON?y():x.load("json2",{},y)}},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:Je,jsonp:kn}},onDocumentBody(E){document.body?E():setTimeout(()=>{this.onDocumentBody(E)},0)},createJSONPRequest(E,y){return new _a(E,y)},createScriptRequest(E){return new nr(E)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var E=this.getXHRAPI();return new E},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Lo},createWebSocket(E){var y=this.getWebSocketAPI();return new y(E)},createSocketRequest(E,y){if(this.isXHRSupported())return this.HTTPFactory.createXHR(E,y);if(this.isXDRSupported(y.indexOf("https:")===0))return this.HTTPFactory.createXDR(E,y);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var E=this.getXHRAPI();return!!E&&new E().withCredentials!==void 0},isXDRSupported(E){var y=E?"https:":"http:",w=this.getProtocol();return!!window.XDomainRequest&&w===y},addUnloadListener(E){window.addEventListener!==void 0?window.addEventListener("pagehide",E,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",E)},removeUnloadListener(E){window.addEventListener!==void 0?window.removeEventListener("pagehide",E,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",E)},randomInt(E){const y=window.crypto||window.msCrypto,w=Math.floor(Math.pow(2,32)/E)*E;let L;do L=y.getRandomValues(new Uint32Array(1))[0];while(L>=w);return L%E}};const Be=Ic;var Ra;(function(E){E[E.ERROR=3]="ERROR",E[E.INFO=6]="INFO",E[E.DEBUG=7]="DEBUG"})(Ra||(Ra={}));const sr=Ra;class Ai{constructor(y,w,L){this.key=y,this.session=w,this.events=[],this.options=L||{},this.sent=0,this.uniqueID=0}log(y,w){y<=this.options.level&&(this.events.push(ke({},w,{timestamp:Pe.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(y){this.log(sr.ERROR,y)}info(y){this.log(sr.INFO,y)}debug(y){this.log(sr.DEBUG,y)}isEmpty(){return this.events.length===0}send(y,w){var L=ke({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=[],y(L,(N,te)=>{N||this.sent++,w&&w(N,te)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Af{constructor(y,w,L,N){this.name=y,this.priority=w,this.transport=L,this.options=N||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(y,w){if(this.isSupported()){if(this.priority<y)return bs(new P,w)}else return bs(new we,w);var L=!1,N=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),te=null,ye=function(){N.unbind("initialized",ye),N.connect()},Ne=function(){te=In.createHandshake(N,function(jt){L=!0,pt(),w(null,jt)})},Fe=function(jt){pt(),w(jt)},lt=function(){pt();var jt;jt=An(N),w(new X(jt))},pt=function(){N.unbind("initialized",ye),N.unbind("open",Ne),N.unbind("error",Fe),N.unbind("closed",lt)};return N.bind("initialized",ye),N.bind("open",Ne),N.bind("error",Fe),N.bind("closed",lt),N.initialize(),{abort:()=>{L||(pt(),te?te.close():N.close())},forceMinPriority:jt=>{L||this.priority<jt&&(te?te.close():N.close())}}}}function bs(E,y){return Pe.defer(function(){y(E)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Po}=Be;var xi=function(E,y,w,L,N,te){var ye=Po[w];if(!ye)throw new _e(w);var Ne=(!E.enabledTransports||ut(E.enabledTransports,y)!==-1)&&(!E.disabledTransports||ut(E.disabledTransports,y)===-1),Fe;return Ne?(N=Object.assign({ignoreNullOrigin:E.ignoreNullOrigin},N),Fe=new Af(y,L,te?te.getAssistant(ye):ye,N)):Fe=vs,Fe},vs={isSupported:function(){return!1},connect:function(E,y){var w=Pe.defer(function(){y(new we)});return{abort:function(){w.ensureAborted()},forceMinPriority:function(){}}}};function Hc(E){if(E==null)throw"You must pass an options object";if(E.cluster==null)throw"Options object must provide a cluster";"disableStats"in E&&tt.warn("The disableStats option is deprecated in favor of enableStats")}const xf=(E,y)=>{var w="socket_id="+encodeURIComponent(E.socketId);for(var L in y.params)w+="&"+encodeURIComponent(L)+"="+encodeURIComponent(y.params[L]);if(y.paramsProvider!=null){let N=y.paramsProvider();for(var L in N)w+="&"+encodeURIComponent(L)+"="+encodeURIComponent(N[L])}return w},Tf=E=>{if(typeof Be.getAuthorizers()[E.transport]>"u")throw`'${E.transport}' is not a recognized auth transport`;return(y,w)=>{const L=xf(y,E);Be.getAuthorizers()[E.transport](Be,L,E,T.UserAuthentication,w)}},qo=(E,y)=>{var w="socket_id="+encodeURIComponent(E.socketId);w+="&channel_name="+encodeURIComponent(E.channelName);for(var L in y.params)w+="&"+encodeURIComponent(L)+"="+encodeURIComponent(y.params[L]);if(y.paramsProvider!=null){let N=y.paramsProvider();for(var L in N)w+="&"+encodeURIComponent(L)+"="+encodeURIComponent(N[L])}return w},Rf=E=>{if(typeof Be.getAuthorizers()[E.transport]>"u")throw`'${E.transport}' is not a recognized auth transport`;return(y,w)=>{const L=qo(y,E);Be.getAuthorizers()[E.transport](Be,L,E,T.ChannelAuthorization,w)}},kf=(E,y,w)=>{const L={authTransport:y.transport,authEndpoint:y.endpoint,auth:{params:y.params,headers:y.headers}};return(N,te)=>{const ye=E.channel(N.channelName);w(ye,L).authorize(N.socketId,te)}};function zc(E,y){let w={activityTimeout:E.activityTimeout||v.activityTimeout,cluster:E.cluster,httpPath:E.httpPath||v.httpPath,httpPort:E.httpPort||v.httpPort,httpsPort:E.httpsPort||v.httpsPort,pongTimeout:E.pongTimeout||v.pongTimeout,statsHost:E.statsHost||v.stats_host,unavailableTimeout:E.unavailableTimeout||v.unavailableTimeout,wsPath:E.wsPath||v.wsPath,wsPort:E.wsPort||v.wsPort,wssPort:E.wssPort||v.wssPort,enableStats:Mf(E),httpHost:Df(E),useTLS:Lf(E),wsHost:jc(E),userAuthenticator:Go(E),channelAuthorizer:Nf(E,y)};return"disabledTransports"in E&&(w.disabledTransports=E.disabledTransports),"enabledTransports"in E&&(w.enabledTransports=E.enabledTransports),"ignoreNullOrigin"in E&&(w.ignoreNullOrigin=E.ignoreNullOrigin),"timelineParams"in E&&(w.timelineParams=E.timelineParams),"nacl"in E&&(w.nacl=E.nacl),w}function Df(E){return E.httpHost?E.httpHost:E.cluster?`sockjs-${E.cluster}.pusher.com`:v.httpHost}function jc(E){return E.wsHost?E.wsHost:Of(E.cluster)}function Of(E){return`ws-${E}.pusher.com`}function Lf(E){return Be.getProtocol()==="https:"?!0:E.forceTLS!==!1}function Mf(E){return"enableStats"in E?E.enableStats:"disableStats"in E?!E.disableStats:!1}const Uc=E=>"customHandler"in E&&E.customHandler!=null;function Go(E){const y=Object.assign(Object.assign({},v.userAuthentication),E.userAuthentication);return Uc(y)?y.customHandler:Tf(y)}function $f(E,y){let w;return"channelAuthorization"in E?w=Object.assign(Object.assign({},v.channelAuthorization),E.channelAuthorization):(w={transport:E.authTransport||v.authTransport,endpoint:E.authEndpoint||v.authEndpoint},"auth"in E&&("params"in E.auth&&(w.params=E.auth.params),"headers"in E.auth&&(w.headers=E.auth.headers)),"authorizer"in E&&(w.customHandler=kf(y,w,E.authorizer))),w}function Nf(E,y){const w=$f(E,y);return Uc(w)?w.customHandler:Rf(w)}class If extends je{constructor(y){super(function(w,L){tt.debug(`No callbacks on watchlist events for ${w}`)}),this.pusher=y,this.bindWatchlistInternalEvent()}handleEvent(y){y.data.events.forEach(w=>{this.emit(w.name,w)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",y=>{var w=y.event;w==="pusher_internal:watchlist_events"&&this.handleEvent(y)})}}function Bc(){let E,y;return{promise:new Promise((L,N)=>{E=L,y=N}),resolve:E,reject:y}}const Hf=Bc;class zf extends je{constructor(y){super(function(w,L){tt.debug("No callbacks on user for "+w)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(w,L)=>{if(w){tt.warn(`Error during signin: ${w}`),this.emit("pusher:signin_error",Object.assign({},{type:"AuthError",error:w.message},w instanceof Me?{status:w.status}:{})),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:L.auth,user_data:L.user_data})},this.pusher=y,this.pusher.connection.bind("state_change",({previous:w,current:L})=>{w!=="connected"&&L==="connected"&&this._signin(),w==="connected"&&L!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new If(y),this.pusher.connection.bind("message",w=>{var L=w.event;L==="pusher:signin_success"&&this._onSigninSuccess(w.data),this.serverToUserChannel&&this.serverToUserChannel.name===w.channel&&this.serverToUserChannel.handleEvent(w)})}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(y){try{this.user_data=JSON.parse(y.user_data)}catch{tt.error(`Failed parsing user data after signin: ${y.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){tt.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const y=w=>{w.subscriptionPending&&w.subscriptionCancelled?w.reinstateSubscription():!w.subscriptionPending&&this.pusher.connection.state==="connected"&&w.subscribe()};this.serverToUserChannel=new qa(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((w,L)=>{w.indexOf("pusher_internal:")===0||w.indexOf("pusher:")===0||this.emit(w,L)}),y(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:y,resolve:w}=Hf();y.done=!1;const L=()=>{y.done=!0};y.then(L).catch(L),this.signinDonePromise=y,this._signinDoneResolve=w}}class cn{static ready(){cn.isReady=!0;for(var y=0,w=cn.instances.length;y<w;y++)cn.instances[y].connect()}static getClientFeatures(){return vt(Lt({ws:Be.Transports.ws},function(y){return y.isSupported({})}))}constructor(y,w){jf(y),Hc(w),this.key=y,this.options=w,this.config=zc(this.options,this),this.channels=In.createChannels(),this.global_emitter=new je,this.sessionID=Be.randomInt(1e9),this.timeline=new Ai(this.key,this.sessionID,{cluster:this.config.cluster,features:cn.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:sr.INFO,version:v.VERSION}),this.config.enableStats&&(this.timelineSender=In.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Be.TimelineTransport.name}));var L=N=>Be.getDefaultStrategy(this.config,N,xi);this.connection=In.createConnectionManager(this.key,{getStrategy:L,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",N=>{var te=N.event,ye=te.indexOf("pusher_internal:")===0;if(N.channel){var Ne=this.channel(N.channel);Ne&&Ne.handleEvent(N)}ye||this.global_emitter.emit(N.event,N.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",N=>{tt.warn(N)}),cn.instances.push(this),this.timeline.info({instances:cn.instances.length}),this.user=new zf(this),cn.isReady&&this.connect()}switchCluster(y){const{appKey:w,cluster:L}=y;this.key=w,this.options=Object.assign(Object.assign({},this.options),{cluster:L}),this.config=zc(this.options,this),this.connection.switchCluster(this.key)}channel(y){return this.channels.find(y)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var y=this.connection.isUsingTLS(),w=this.timelineSender;this.timelineSenderTimer=new Oe(6e4,function(){w.send(y)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(y,w,L){return this.global_emitter.bind(y,w,L),this}unbind(y,w,L){return this.global_emitter.unbind(y,w,L),this}bind_global(y){return this.global_emitter.bind_global(y),this}unbind_global(y){return this.global_emitter.unbind_global(y),this}unbind_all(y){return this.global_emitter.unbind_all(),this}subscribeAll(){var y;for(y in this.channels.channels)this.channels.channels.hasOwnProperty(y)&&this.subscribe(y)}subscribe(y){var w=this.channels.add(y,this);return w.subscriptionPending&&w.subscriptionCancelled?w.reinstateSubscription():!w.subscriptionPending&&this.connection.state==="connected"&&w.subscribe(),w}unsubscribe(y){var w=this.channels.find(y);w&&w.subscriptionPending?w.cancelSubscription():(w=this.channels.remove(y),w&&w.subscribed&&w.unsubscribe())}send_event(y,w,L){return this.connection.send_event(y,w,L)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}cn.instances=[],cn.isReady=!1,cn.logToConsole=!1,cn.Runtime=Be,cn.ScriptReceivers=Be.ScriptReceivers,cn.DependenciesReceivers=Be.DependenciesReceivers,cn.auth_callbacks=Be.auth_callbacks;const Ss=cn;function jf(E){if(E==null)throw"You must pass your app key when you instantiate Pusher."}Be.setup(cn)}},r={};function i(u){var d=r[u];if(d!==void 0)return d.exports;var f=r[u]={exports:{}};return n[u].call(f.exports,f,f.exports,i),f.exports}i.d=(u,d)=>{for(var f in d)i.o(d,f)&&!i.o(u,f)&&Object.defineProperty(u,f,{enumerable:!0,get:d[f]})},i.o=(u,d)=>Object.prototype.hasOwnProperty.call(u,d);var l=i(721);return l})())})(df)),df.exports}var W_=K_();const cy=Xa(W_),Bt=dt("WebSocketManager");class Y_{constructor(){$(this,"echo",null);$(this,"subscriptions",new Map);$(this,"initialized",!1);$(this,"config",null)}configure(e){if(this.initialized){Bt.warn("[WebSocketManager] 이미 초기화되어 설정을 변경할 수 없습니다.");return}this.config=e,Bt.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){Bt.warn("[WebSocketManager] WebSocket 설정이 없습니다. initTemplateApp에서 websocket 옵션을 전달해주세요.");return}const{appKey:e,host:n="localhost",port:r=80,scheme:i="https",authEndpoint:l="/api/broadcasting/auth"}=this.config,u=Number(r)||80,d=i==="https";Bt.log("[WebSocketManager] 연결 설정:",{host:n,port:u,scheme:i,useTLS:d,authEndpoint:l}),window.Pusher=cy;const f=localStorage.getItem("auth_token"),g={wsHost:n,wsPort:u,wssPort:u,forceTLS:d,disableStats:!0,enabledTransports:["ws","wss"],cluster:"mt1",authEndpoint:l,auth:{headers:{Authorization:f?`Bearer ${f}`:"",Accept:"application/json"}}};Bt.log("[WebSocketManager] Pusher 옵션:",g);const m=new cy(e,g);m.connection.bind("connecting",()=>{Bt.log("[WebSocketManager] 연결 시도 중...")}),m.connection.bind("connected",()=>{Bt.log("[WebSocketManager] 연결 성공! Socket ID:",m.connection.socket_id)}),m.connection.bind("failed",()=>{Bt.error("[WebSocketManager] 연결 실패 - WebSocket을 사용할 수 없습니다.")}),m.connection.bind("error",b=>{Bt.error("[WebSocketManager] 연결 오류:",b)}),m.connection.bind("state_change",b=>{Bt.log(`[WebSocketManager] 상태 변경: ${b.previous} → ${b.current}`)}),m.connection.bind("unavailable",()=>{Bt.error("[WebSocketManager] WebSocket 사용 불가 - 연결할 수 없습니다.")}),m.connection.bind("disconnected",()=>{Bt.warn("[WebSocketManager] 연결이 끊어졌습니다.")}),Bt.log("[WebSocketManager] 초기 연결 상태:",m.connection.state),this.echo=new F_({broadcaster:"reverb",client:m}),Bt.log("[WebSocketManager] 연결 시작 시도..."),m.connect(),window.Echo=this.echo,this.initialized=!0,Bt.log("[WebSocketManager] Echo 초기화 완료")}subscribe(e,n,r,i={}){if(this.initialize(),!this.echo)return Bt.warn("[WebSocketManager] Echo가 초기화되지 않았습니다."),"";const{channelType:l="private"}=i,u=`${e}:${n}`;if(this.subscriptions.has(u))return Bt.log(`[WebSocketManager] 이미 구독 중: ${u}`),u;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(`.${n}`,r),this.subscriptions.set(u,d),Bt.log(`[WebSocketManager] 구독 완료: ${u} (${l})`),u}unsubscribe(e){const n=this.subscriptions.get(e);if(!n)return;const r=e.lastIndexOf(":"),i=r>=0?e.substring(r+1):"";if(i)try{n.stopListening(`.${i}`)}catch(l){Bt.warn(`[WebSocketManager] stopListening 실패: ${e}`,l)}this.subscriptions.delete(e),Bt.log(`[WebSocketManager] 구독 해제: ${e}`)}leaveChannel(e){if(!this.echo)return;this.echo.leave(e);const n=[];this.subscriptions.forEach((r,i)=>{i.startsWith(`${e}:`)&&n.push(i)}),n.forEach(r=>this.subscriptions.delete(r)),Bt.log(`[WebSocketManager] 채널 구독 해제: ${e}`)}disconnect(){this.echo&&(this.echo.disconnect(),this.subscriptions.clear(),this.initialized=!1,Bt.log("[WebSocketManager] 연결 종료"))}getEcho(){return this.echo}isInitialized(){return this.initialized}isConfigured(){return this.config!==null&&!!this.config.appKey}getSubscriptionCount(){return this.subscriptions.size}}const mc=new Y_,bt=dt("DataSourceManager"),X_=new Rn;function yc(o,e){const n=o.match(/^\{\{(.+)\}\}$/);if(n){const r=n[1].trim();try{return X_.evaluateExpression(r,e)}catch(i){return bt.error("Failed to evaluate param expression:",r,i),o}}return Zi(o,e,{skipCache:!0})}function uy(o){const e={};for(const n of o.keys()){if(n in e)continue;const r=o.getAll(n);r.length>1?e[n]=r:r.length===1&&(n.endsWith("[]")?e[n]=r:e[n]=r[0])}return e}function J_(){try{return window.G7Core?.devTools}catch{return}}const Cc=class Cc{constructor(e={}){$(this,"options");$(this,"dataCache",new Map);$(this,"bindingEngine");$(this,"globalHeaders",[]);this.options=e,this.bindingEngine=new Rn}setGlobalHeaders(e){this.globalHeaders=e||[]}matchesPattern(e,n){if(n==="*")return!0;const r=n.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(e)}toFormData(e){const n=new FormData;for(const[r,i]of Object.entries(e))i instanceof File||i instanceof Blob?n.append(r,i):i!=null&&n.append(r,typeof i=="object"?JSON.stringify(i):String(i));return n}getMatchingGlobalHeaders(e,n){const r={};for(const i of this.globalHeaders)this.matchesPattern(e,i.pattern)&&Object.entries(i.headers).forEach(([l,u])=>{const d=yc(u,n);d!=null&&d!==""&&(r[l]=String(d))});return r}filterByCondition(e,n={}){const r=new Set,i=[];for(const l of e){if(r.has(l.id))continue;if(!l.if&&!l.conditions){r.add(l.id),i.push(l);continue}Qi({if:l.if,conditions:l.conditions},n,this.bindingEngine,`data_source:${l.id}`)&&(r.add(l.id),i.push(l))}return i}checkErrorCondition(e,n){if(!e.errorCondition?.if||e.errorCondition?.errorCode===void 0)return null;try{const r={response:n};if(Qi({if:e.errorCondition.if},r,this.bindingEngine,`errorCondition:${e.id}`))return bt.log(`errorCondition matched for ${e.id}, triggering error ${e.errorCondition.errorCode}`),e.errorCondition.errorCode}catch(r){bt.error(`Failed to evaluate errorCondition for ${e.id}:`,r)}return null}async fetchDataSources(e,n={},r=new URLSearchParams,i,l){const u={},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,n,r,i,l);u[g.id]=m,this.dataCache.set(g.id,{data:m,timestamp:Date.now()});const b=this.checkErrorCondition(g,m);if(b!==null){const v={status:b,message:`Error condition matched for ${g.id}`,data:m},S=ma(),_=S.resolve(b,{errorHandling:g.errorHandling,onError:g.onError});if(_.handler)try{await S.execute(_.handler,v)}catch(x){bt.error(`Error executing errorCondition handler for ${g.id}:`,x)}g.fallback!==void 0&&(u[g.id]=g.fallback,this.dataCache.set(g.id,{data:g.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${g.id} (errorCondition)`));return}if(g.onSuccess)try{const v={data:m,sourceId:g.id};await this.executeOnSuccessHandler(g.onSuccess,v)}catch(v){bt.error(`Error executing onSuccess handler for ${g.id}:`,v)}}catch(m){bt.error(`Failed to fetch data source: ${g.id}`,m);const b=m?.response?.status||m?.status||500,v=m?.response?.data,S=v?.message||m.message||"Unknown error",_={status:b,message:S,errors:v?.errors,data:v,statusText:m?.response?.statusText},x=ma(),k=x.resolve(b,{errorHandling:g.errorHandling,onError:g.onError});if(k.handler)try{await x.execute(k.handler,_)}catch(O){bt.error(`Error executing error handler for ${g.id}:`,O)}g.fallback!==void 0&&(u[g.id]=g.fallback,this.dataCache.set(g.id,{data:g.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${g.id}`)),this.options.onError&&this.options.onError(m,g)}})),u}async fetchDataSourcesWithResults(e,n={},r=new URLSearchParams,i,l,u){if(e.some(m=>m.type==="websocket")){const m=e.filter(b=>b.type==="websocket").map(b=>b.id).join(", ");bt.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=u?.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 b=await this.fetchDataSource(m,n,r,i,l);this.dataCache.set(m.id,{data:b,timestamp:Date.now()});const v=this.checkErrorCondition(m,b);if(v!==null){const S={status:v,message:`Error condition matched for ${m.id}`,data:b},_=ma(),x=_.resolve(v,{errorHandling:m.errorHandling,onError:m.onError});let k=!1;if(x.handler)if(m.loading_strategy==="blocking")_.execute(x.handler,S).catch(O=>{bt.error(`Error executing errorCondition handler for ${m.id}:`,O)}),k=!0;else try{await _.execute(x.handler,S),k=!0}catch(O){bt.error(`Error executing errorCondition handler for ${m.id}:`,O)}return m.fallback!==void 0?(this.dataCache.set(m.id,{data:m.fallback,timestamp:Date.now()}),bt.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: ${v}`),errorCode:v,errorHandled:k}}if(m.onSuccess)try{const S={data:b,sourceId:m.id};await this.executeOnSuccessHandler(m.onSuccess,S)}catch(S){bt.error(`Error executing onSuccess handler for ${m.id}:`,S)}return{id:m.id,state:"success",data:b}}catch(b){bt.error(`Failed to fetch data source: ${m.id}`,b);const v=b?.response?.status||b?.status||500,S=b?.response?.data,_=S?.message||b.message||"Unknown error",x={status:v,message:_,errors:S?.errors,data:S,statusText:b?.response?.statusText},k=ma(),O=k.resolve(v,{errorHandling:m.errorHandling,onError:m.onError});let M=!1;if(O.handler)if(m.loading_strategy==="blocking")k.execute(O.handler,x).catch(T=>{bt.error(`Error executing error handler for ${m.id}:`,T)}),M=!0;else try{await k.execute(O.handler,x),M=!0}catch(T){bt.error(`Error executing error handler for ${m.id}:`,T)}return m.fallback!==void 0?(this.dataCache.set(m.id,{data:m.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${m.id}`),{id:m.id,state:"success",data:m.fallback}):(this.options.onError&&this.options.onError(b,m),{id:m.id,state:"error",error:b,errorCode:v,errorHandled:M})}}))}fetchDataSourcesInBackground(e,n={},r=new URLSearchParams,i){e.filter(u=>u.auto_fetch!==!1&&u.loading_strategy==="background"&&u.type!=="websocket").forEach(u=>{this.fetchDataSource(u,n,r).then(async d=>{this.dataCache.set(u.id,{data:d,timestamp:Date.now()});const f=this.checkErrorCondition(u,d);if(f!==null){const g={status:f,message:`Error condition matched for ${u.id}`,data:d},m=ma(),b=m.resolve(f,{errorHandling:u.errorHandling,onError:u.onError});if(b.handler)try{await m.execute(b.handler,g)}catch(v){bt.error(`Error executing errorCondition handler for ${u.id}:`,v)}u.fallback!==void 0&&(this.dataCache.set(u.id,{data:u.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${u.id} (errorCondition)`),i&&i(u.id,u.fallback));return}if(u.onSuccess)try{const g={data:d,sourceId:u.id};await this.executeOnSuccessHandler(u.onSuccess,g)}catch(g){bt.error(`Error executing onSuccess handler for ${u.id}:`,g)}i&&i(u.id,d)}).catch(async d=>{bt.error(`Background fetch failed: ${u.id}`,d);const f=d?.response?.status||d?.status||500,g=d?.response?.data,m=g?.message||d.message||"Unknown error",b={status:f,message:m,errors:g?.errors,data:g,statusText:d?.response?.statusText},v=ma(),S=v.resolve(f,{errorHandling:u.errorHandling,onError:u.onError});if(S.handler)try{await v.execute(S.handler,b)}catch(_){bt.error(`Error executing error handler for ${u.id}:`,_)}if(u.fallback!==void 0){this.dataCache.set(u.id,{data:u.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${u.id}`),i&&i(u.id,u.fallback);return}this.options.onError&&this.options.onError(d,u)})})}async fetchDataSource(e,n,r,i,l){switch(e.type){case"api":return this.fetchApiDataSource(e,n,r,i,l);case"static":return e.data;case"route_params":return n;case"query_params":return uy(r);default:throw new Error(`Unknown data source type: ${e.type}`)}}async fetchApiDataSource(e,n,r,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 u={route:n,query:uy(r)};i&&(u._global=i),l&&(u._local=l);let d=Zi(e.endpoint,u,{skipCache:!0});const f=e.method||"GET",m=(e.contentType?typeof e.contentType=="string"&&e.contentType.includes("{{")?Zi(e.contentType,u,{skipCache:!0}):e.contentType:"application/json")==="multipart/form-data";let b=m?{...e.params||{}}:JSON.parse(JSON.stringify(e.params||{}));Object.entries(b).forEach(([_,x])=>{typeof x=="string"&&(b[_]=yc(x,u))}),Object.keys(b).forEach(_=>{b[_]===""&&delete b[_]});const v=J_();let S=null;if(v?.isEnabled()){v.trackDataSourceDefinition({id:e.id,type:e.type,endpoint:d,method:f,autoFetch:e.auto_fetch,initLocal:e.initLocal,initGlobal:e.initGlobal});let _=d;if(f==="GET"&&Object.keys(b).length>0){const x=new URLSearchParams;Object.entries(b).forEach(([O,M])=>{Array.isArray(M)?M.forEach(T=>x.append(O,String(T))):M!=null&&x.append(O,String(M))});const k=x.toString();_=k?`${d}?${k}`:d}S=v.trackRequest(_,f,{requestBody:f!=="GET"?b:void 0,dataSourceId:e.id}),v.trackDataSourceLoading(e.id)}try{let _;const x=e.auth_mode??(e.auth_required===!0?"required":"none"),k=ga.getInstance().isAuthenticated();if(x==="required"&&!k){bt.log(`[DataSourceManager] Skipping ${e.id}: auth_mode is 'required' but no token available`),v?.isEnabled()&&(v.trackDataSourceError(e.id,"Skipped: auth_mode required but not authenticated"),S&&v.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 O=x==="required"||x==="optional"&&k;if(O){const M=Ia(),T=d.startsWith("/api/")?d.substring(4):d.startsWith("/api")?d.substring(4)||"/":d;this.options.onError&&bt.log(`[DataSourceManager] Normalized endpoint: ${d} -> ${T}`);const D=this.getMatchingGlobalHeaders(d,u),j={};e.headers&&Object.entries(e.headers).forEach(([pe,_e])=>{const we=yc(_e,u);we!=null&&we!==""&&(j[pe]=String(we))});const H={...D,...j},P=Object.keys(H).length>0,X=m?this.toFormData(b):b;switch(f){case"GET":_=await M.get(T,{params:b,...P&&{headers:H}});break;case"POST":P?_=await M.post(T,X,{headers:H}):_=await M.post(T,X);break;case"PUT":P?_=await M.put(T,X,{headers:H}):_=await M.put(T,X);break;case"PATCH":P?_=await M.patch(T,X,{headers:H}):_=await M.patch(T,X);break;case"DELETE":_=await M.delete(T,{params:b,...P&&{headers:H}});break;default:throw new Error(`Unsupported HTTP method: ${f}`)}}else{let M=d;if(f==="GET"){const X=new URLSearchParams(b).toString();M=X?`${d}?${X}`:d}const T={...m?{}:{"Content-Type":"application/json"},Accept:"application/json"};if(typeof window<"u"){const X=localStorage.getItem("g7_locale");X&&(T["Accept-Language"]=X)}const D=this.getMatchingGlobalHeaders(d,u);Object.assign(T,D),e.headers&&Object.entries(e.headers).forEach(([X,pe])=>{const _e=yc(pe,u);_e!=null&&_e!==""&&(T[X]=String(_e))});let j;f!=="GET"&&(m?(j=this.toFormData(b),delete T["Content-Type"]):j=JSON.stringify(b));const H=await fetch(M,{method:f,headers:T,body:j});let P;try{P=await H.json()}catch{P=null}if(S&&v?.isEnabled()&&(v.completeRequest(S,H.status,P),S=null),!H.ok){v?.isEnabled()&&v.trackDataSourceError(e.id,`HTTP ${H.status}: ${H.statusText}`);const X=new Error(`HTTP error! status: ${H.status}`);throw X.response={status:H.status,statusText:H.statusText,data:P},X.status=H.status,X}_=P,v?.isEnabled()&&v.trackDataSourceLoaded(e.id,_)}return O&&S&&v?.isEnabled()&&(v.completeRequest(S,200,_),v.trackDataSourceLoaded(e.id,_)),_}catch(_){if(S&&v?.isEnabled()){const x=_;x?.response?v.completeRequest(S,x.response.status,x.response.data):v.failRequest(S,_ instanceof Error?_.message:String(_)),v.trackDataSourceError(e.id,_ instanceof Error?_.message:String(_))}throw _}}getCachedData(e){const n=this.dataCache.get(e);if(!n)return;if(Date.now()-n.timestamp>Cc.DATA_CACHE_TTL){this.dataCache.delete(e);return}return n.data}clearCache(){this.dataCache.clear()}subscribeWebSockets(e,n,r={}){const i=[],l=e.filter(u=>u.type==="websocket");return l.length===0||l.forEach(u=>{if(!u.channel||!u.event){bt.warn(`WebSocket source ${u.id} missing channel or event`);return}let d,f;try{d=Zi(u.channel,r,{skipCache:!0}),f=Zi(u.event,r,{skipCache:!0})}catch(b){bt.error(`Failed to resolve WebSocket channel/event for source ${u.id}:`,b);return}const g=b=>!!(!b||b.trim()===""||b.includes("{{")||b.endsWith(".")||b.endsWith(":")||b.startsWith(".")||b.startsWith(":")||b.includes("..")||b.includes("::"));if(g(d)||g(f)){bt.warn(`WebSocket source ${u.id} has invalid channel/event after expression resolution, skipping. Original channel="${u.channel}", resolved="${d}". Original event="${u.event}", resolved="${f}". Available context keys: [${Object.keys(r).join(", ")}]`);return}const m=mc.subscribe(d,f,b=>{const v=u.target_source||u.id;this.dataCache.set(v,{data:b,timestamp:Date.now()}),n(v,b)},{channelType:u.channel_type||"private"});m&&i.push(m)}),i}unsubscribeWebSockets(e){e.length!==0&&e.forEach(n=>{mc.unsubscribe(n)})}async executeOnSuccessHandler(e,n){const r=this.options.actionDispatcher??lm();if(!r){bt.warn("ActionDispatcher not available, skipping onSuccess handler");return}const i=Array.isArray(e)?e:[e];for(const l of i)try{await r.dispatchAction({type:"click",...l},{data:{response:n}})}catch(u){throw bt.error("Failed to execute onSuccess handler:",u),u}}};$(Cc,"DATA_CACHE_TTL",3e5);let Sa=Cc;const Q_=new Sa,pi=dt("ModalDataSourceWrapper");function Z_(o,e){if(!o||!e)return o;const r=e.replace(/\?\./g,".").split(/\.(?![^\[]*\])/).flatMap(l=>{const u=l.match(/^([^\[]*)((?:\[\d+\])*)$/);if(u){const[,d,f]=u,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 r){if(i==null)return;if(l.startsWith("[")&&l.endsWith("]")){const u=parseInt(l.slice(1,-1),10);i=i[u]}else i=i[l]}return i}const dy=({isOpen:o,modalId:e,dataSources:n,dataContext:r,globalStateUpdater:i,bindingEngine:l,debug:u=!1,children:d})=>{const[f,g]=I.useState(!1),[m,b]=I.useState(!1),v=I.useRef(!1),S=I.useRef(null);S.current||(S.current=new Sa);const _=I.useCallback(async()=>{if(!(!n||n.length===0)&&S.current){g(!0);try{const x=r.route||{},k=new URLSearchParams(window.location.search),O=n.map(T=>{let D={...T};if(T.endpoint&&l){const j=l.resolveBindings(T.endpoint,r,{skipCache:!0});D.endpoint=j}if(T.params&&l){const j={};Object.entries(T.params).forEach(([H,P])=>{typeof P=="string"?j[H]=l.resolveBindings(P,r,{skipCache:!0}):j[H]=P}),D.params=j}return D});u&&pi.log(`[ModalDataSourceWrapper] Modal "${e}" fetching data sources:`,O.map(T=>({id:T.id,endpoint:T.endpoint})));const M=await S.current.fetchDataSourcesWithResults(O,x,k);i&&M.forEach(T=>{if(T.state==="success"&&T.data!==void 0){const D=O.find(j=>j.id===T.id);if(D?.initGlobal){const j=T.data?.data??T.data,H=Array.isArray(D.initGlobal)?D.initGlobal:[D.initGlobal];for(const P of H)if(typeof P=="string")i({[P]:j}),u&&pi.log(`[ModalDataSourceWrapper] Modal "${e}" initGlobal: ${T.id}.data -> _global.${P}`);else if(typeof P=="object"&&P.key){const{key:X,path:pe}=P,_e=pe?Z_(j,pe):j;i({[X]:_e}),u&&pi.log(`Modal "${e}" initGlobal: ${T.id}.data${pe?"."+pe:""} -> _global.${X}`)}}}else T.state==="error"&&pi.error(`Modal "${e}" data source error:`,T.id,T.error)}),u&&pi.log(`Modal "${e}" data sources fetched successfully`)}catch(x){pi.error(`Modal "${e}" data source fetch error:`,x)}finally{g(!1),b(!0)}}},[n,r,i,l,e,u]);return I.useEffect(()=>{if(!n||n.length===0)return;const x=window.__templateApp;return x?.registerModalDataSources&&x.registerModalDataSources(e,n),()=>{x?.unregisterModalDataSources&&x.unregisterModalDataSources(e)}},[e,n]),I.useEffect(()=>{!o&&v.current&&(b(!1),u&&pi.log(`[ModalDataSourceWrapper] Modal "${e}" closed, reset fetch state`)),o&&!v.current&&n&&n.length>0&&!m&&_(),v.current=o},[o,n,m,_,e,u]),ft.jsx(ft.Fragment,{children:d})};class bc extends Error{constructor(n,r,i={}){super(r);$(this,"code");$(this,"userMessageKey");$(this,"showStack");$(this,"icon");$(this,"recoverable");this.name="TemplateEngineError",this.code=n,this.userMessageKey=r,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(n,r){if(!r||!n)return this.userMessageKey;try{return r.translate(this.userMessageKey,n)}catch{return this.userMessageKey}}}class eA extends bc{constructor(){super("TEMPLATE_NOT_FOUND","$t:core.errors.template_not_found",{showStack:!1,icon:"fa-paint-brush",recoverable:!1}),this.name="TemplateNotFoundError"}}function fy(o){if(o instanceof bc)return o;if(o instanceof Error){const e=new bc("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 bc("TEMPLATE_INIT_ERROR","$t:core.errors.template_init_error",{showStack:!1,icon:"fa-circle-exclamation",recoverable:!0})}const tA=dt("ErrorDisplay");class ff{static render(e,n){const r=document.getElementById(e);if(!r){tA.error(`Container #${e} not found`);return}const i=n.debug&&n.showStack&&n.stackTrace,l=window.matchMedia("(prefers-color-scheme: dark)").matches,u={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;
|
||
`};r.innerHTML=`
|
||
<div style="${u.container}">
|
||
<div style="${u.card}">
|
||
<!-- 아이콘 -->
|
||
<div style="${u.iconContainer}">
|
||
<i class="fa-solid ${n.icon}" style="${u.icon}"></i>
|
||
</div>
|
||
|
||
<!-- 제목 -->
|
||
<h1 style="${u.title}">
|
||
${this.escapeHtml(n.title)}
|
||
</h1>
|
||
|
||
<!-- 사용자 메시지 -->
|
||
<p style="${u.message}">
|
||
${this.escapeHtml(n.message)}
|
||
</p>
|
||
|
||
<!-- 상세 메시지 (API 응답 등) -->
|
||
${n.detailMessage?`
|
||
<p style="${u.detailMessage}">
|
||
${this.escapeHtml(n.detailMessage)}
|
||
</p>
|
||
`:`<div style="${u.spacer}"></div>`}
|
||
|
||
<!-- Stack Trace (디버그 모드일 때만) -->
|
||
${i?`
|
||
<div style="${u.stackContainer}">
|
||
<p style="${u.stackTitle}">
|
||
Stack Trace:
|
||
</p>
|
||
<pre style="${u.stackTrace}">${this.escapeHtml(n.stackTrace)}</pre>
|
||
</div>
|
||
`:""}
|
||
|
||
<!-- 새로고침 버튼 (복구 가능할 때만) -->
|
||
${n.showReloadButton?`
|
||
<div style="${u.buttonContainer}">
|
||
<button
|
||
onclick="window.location.reload()"
|
||
style="${u.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,n,r,i=!1,l,u,d){let f,g;if(n.userMessageKey.startsWith("$t:"))if(u&&l)try{f=u.translate(n.userMessageKey,l)}catch{f=n.userMessageKey.replace("$t:","")}else f=n.userMessageKey.replace("$t:","");else f=n.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:r,message:f,detailMessage:g,icon:n.icon,showStack:n.showStack,stackTrace:n.stack,showReloadButton:n.recoverable,debug:i})}static escapeHtml(e){if(!e)return"";const n=document.createElement("div");return n.textContent=e,n.innerHTML}}const ds=dt("Router");class nA{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,n){this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e).push(n)}async emit(e,...n){const r=this.eventHandlers.get(e);r&&await Promise.all(r.map(i=>i(...n)))}async loadRoutes(e){try{const n=e!==void 0&&e>0?e:null,r=await fetch(Ma(`/api/templates/${this.templateIdentifier}/routes`,"json",n));if(!r.ok)throw new Error(`Failed to load routes: ${r.statusText}`);const i=await r.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,ds.log(`Loaded ${this.routes.length} routes${e?` (v=${e})`:""}`);else throw new Error("Invalid routes data format")}catch(n){throw ds.error("Error loading routes:",n),n}}setRoutes(e){this.routes=e,ds.log(`Set ${this.routes.length} routes`)}match(e){const n=this.normalizePathname(e);for(const r of this.routes){const i=this.matchPattern(r.path,n);if(i!==null)return{route:r,params:i}}return null}normalizePathname(e){return e.length>1&&e.endsWith("/")?e.replace(/\/+$/,"")||"/":e}matchPattern(e,n){const r=[];let i=e.replace(/:([^/]+)/g,(f,g)=>(r.push(g),"([^/]+)"));i.startsWith("*/")&&(i="(?:/[^/]+)?"+i.slice(1)),i=i.replace(/\//g,"\\/");const l=new RegExp(`^${i}$`),u=n.match(l);if(!u)return null;const d={};return r.forEach((f,g)=>{d[f]=u[g+1]}),d}getRoutes(){return[...this.routes]}getAuthType(e,n){return e.auth_type?e.auth_type:n.startsWith("/admin")?"admin":"user"}async navigateToCurrentPath(){const e=window.location.pathname,n=window.location.search,r=this.match(e);if(!r){ds.warn(`No route matched for path: ${e}`),this.emit("routeNotFound",e);return}if(r.route.redirect){ds.log(`Redirecting from ${e} to ${r.route.redirect}`),this.navigate(r.route.redirect);return}if(r.route.auth_required){const u=this.getAuthType(r.route,e),d=ga.getInstance();let f=d.isAuthenticated()&&d.getAuthType()===u;if(f||(f=await d.checkAuth(u)),!f){const g=d.getLoginRedirectUrl(u,e+n);ds.log(`Not authenticated, redirecting to: ${g}`),window.location.href=g;return}}const i=new URLSearchParams(n),l={};for(const u of i.keys()){if(u in l)continue;const d=i.getAll(u);d.length>1?l[u]=d:d.length===1&&(u.endsWith("[]")?l[u]=d:l[u]=d[0])}await this.emit("routeChange",{path:e,layout:r.route.layout,endpoint:r.route.endpoint,params:{...r.route.params||{},...r.params},query:l,auth_required:r.route.auth_required,auth_type:r.route.auth_type,meta:r.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 n=this.pendingNavigation;this.executeNavigation(n)}}}}const aA=/^\/admin\/layout-editor\/([^/?#]+)\/?$/;function hy(o){const e=aA.exec(o);return e?{templateIdentifier:e[1]}:null}const Pt=dt("ErrorPageHandler");class rA{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(Ma(`/api/templates/${this.templateId}/config`,"json"));if(!e.ok)return this.debug&&Pt.warn("Failed to load template config:",e.statusText),this.configLoaded=!0,null;const n=await e.json();if(!n.success||!n.data)return this.debug&&Pt.warn("Invalid template config response"),this.configLoaded=!0,null;const r=n.data;return!r.error_config||!r.error_config.layouts?(this.debug&&Pt.warn("No error_config found in template.json"),this.configLoaded=!0,null):(this.errorConfig=r.error_config,this.configLoaded=!0,this.debug&&Pt.log("Error config loaded:",this.errorConfig),this.errorConfig)}catch(e){return Pt.error("Failed to load error config:",e),this.configLoaded=!0,null}}async renderError(e,n="app"){try{const r=await this.loadConfig();if(!r)return this.debug&&Pt.warn("No error config available, cannot render error page"),!1;const i=r.layouts[e]||r.layouts[String(e)];if(!i)return this.debug&&Pt.warn(`No layout defined for error code: ${e}`),!1;this.debug&&Pt.log(`Loading error layout: ${i} for code: ${e}`);const l=await this.layoutLoader.loadLayout(this.templateId,i);if(!l)return this.debug&&Pt.error(`Failed to load error layout: ${i}`),!1;this.debug&&Pt.log("Error layout loaded:",l);let u={};const d=l.data_sources||[];if(d.length>0){this.debug&&Pt.log("Fetching data sources:",d.map(S=>S.id));const m=d.filter(S=>S.loading_strategy==="blocking"),b=d.filter(S=>!S.loading_strategy||S.loading_strategy==="progressive"),v=[...m,...b];if(v.length>0)try{u=await this.dataSourceManager.fetchDataSources(v,{},new URLSearchParams),this.debug&&Pt.log("Data sources fetched:",Object.keys(u))}catch(S){Pt.error("Failed to fetch data sources:",S)}}const f={};d.length>0&&(this.processInitOptions(d,u,f),this.debug&&Pt.log("initOptions processed:",{globalKeys:Object.keys(this.globalState),localKeys:Object.keys(f)}));const g={...u,errorCode:e,_global:{...this.globalState},_local:{...f}};return await this.renderFunction({containerId:n,layoutJson:l,dataContext:g,translationContext:{templateId:this.templateId,locale:this.locale}}),this.debug&&Pt.log(`Error page ${e} rendered successfully`),!0}catch(r){return Pt.error(`Failed to render error page ${e}:`,r),!1}}processInitOptions(e,n,r){for(const i of e){const l=n[i.id];if(!l)continue;const u=l?.data??l;if(i.initLocal){if(typeof i.initLocal=="string")r[i.initLocal]=u,Pt.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;r[d]=f?this.getValueByPath(u,f):u,Pt.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]=u,Pt.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(u,m):u,Pt.log(`initGlobal: ${i.id}.data${m?"."+m:""} -> _global.${g}`)}}}}getValueByPath(e,n){return n.split(".").reduce((r,i)=>r?.[i],e)}updateGlobalState(e){this.globalState={...this.globalState,...e}}updateLocale(e){this.locale=e,this.debug&&Pt.log("Locale updated:",e)}isConfigLoaded(){return this.configLoaded}async hasErrorLayout(e){const n=await this.loadConfig();return n?!!(n.layouts[e]||n.layouts[String(e)]):!1}clearConfigCache(){this.errorConfig=null,this.configLoaded=!1,this.debug&&Pt.log("Config cache cleared")}}const Ht=dt("ModuleAssetLoader");class iA{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){Ht.log("No module assets to load");return}const n=[...e].sort((d,f)=>d.priority-f.priority);Ht.log("Loading module assets:",n.map(d=>d.identifier));const r=n.filter(d=>d.css).map(d=>this.loadCSS(d.identifier,d.css)),i=n.filter(d=>d.js).map(d=>this.loadJS(d.identifier,d.js)),l=await Promise.allSettled([...r,...i]),u=l.filter(d=>d.status==="rejected");if(u.length>0){Ht.warn(`Some module assets failed to load (${u.length}/${l.length}); continuing with the rest`,this.getFailedJsAssets());return}Ht.log("All module assets loaded successfully")}async loadBundle(e,n,r){const i=[];if(r&&i.push(this.loadBundleCss(e,r)),n&&i.push(this.loadBundleJs(e,n)),i.length===0){Ht.log(`No bundle assets to load for: ${e}`);return}await Promise.all(i)}async loadBundleCss(e,n){const r=`ext-bundle-css-${e}`;if(document.getElementById(r)){Ht.log(`Bundle CSS already loaded: ${e}`);return}return new Promise(i=>{const l=document.createElement("link");l.rel="stylesheet",l.href=n,l.id=r,l.onload=()=>{Ht.log(`Bundle CSS loaded: ${e}`),this.registerLoadedAsset(`bundle-${e}`,{type:"css",element:l}),i()},l.onerror=()=>{Ht.warn(`Failed to load bundle CSS: ${e} (${n})`),i()},document.head.appendChild(l)})}async loadBundleJs(e,n){const r=`ext-bundle-js-${e}`;if(document.getElementById(r)){Ht.log(`Bundle JS already loaded: ${e}`);return}const i=this.loadingPromises.get(r);if(i)return Ht.log(`Bundle JS already loading: ${e}`),i;const l=Zg(n,{id:r},{label:`bundle JS: ${e}`}).then(()=>{Ht.log(`Bundle JS loaded: ${e}`);const u=document.getElementById(r);u&&this.registerLoadedAsset(`bundle-${e}`,{type:"js",element:u}),this.loadingPromises.delete(r)}).catch(u=>{throw Ht.warn(`Failed to load bundle JS: ${e} (${n})`,u),this.failedJsAssets.add(e),this.loadingPromises.delete(r),u});return this.loadingPromises.set(r,l),l}async loadCSS(e,n){const r=`module-css-${e}`;if(document.getElementById(r)){Ht.log(`CSS already loaded: ${e}`);return}return new Promise((i,l)=>{const u=document.createElement("link");u.rel="stylesheet",u.href=n,u.id=r,u.onload=()=>{Ht.log(`CSS loaded: ${e}`),this.registerLoadedAsset(e,{type:"css",element:u}),i()},u.onerror=()=>{Ht.warn(`Failed to load CSS: ${e} (${n})`),i()},document.head.appendChild(u)})}async loadJS(e,n){const r=`module-js-${e}`;if(document.getElementById(r)){Ht.log(`JS already loaded: ${e}`);return}const i=this.loadingPromises.get(e);if(i)return Ht.log(`JS already loading: ${e}`),i;const l=Zg(n,{id:r},{label:`JS: ${e}`}).then(()=>{Ht.log(`JS loaded: ${e}`);const u=document.getElementById(r);u&&this.registerLoadedAsset(e,{type:"js",element:u}),this.loadingPromises.delete(e)}).catch(u=>{throw Ht.warn(`Failed to load JS: ${e} (${n})`,u),this.failedJsAssets.add(e),this.loadingPromises.delete(e),u});return this.loadingPromises.set(e,l),l}registerLoadedAsset(e,n){const r=this.loadedAssets.get(e)||[];r.push(n),this.loadedAssets.set(e,r)}unloadExtensionAsset(e){const n=this.loadedAssets.get(e);if(!n||n.length===0){Ht.log(`No assets to unload for: ${e}`);return}n.forEach(r=>{r.element.parentNode&&(r.element.parentNode.removeChild(r.element),Ht.log(`${r.type.toUpperCase()} unloaded: ${e}`))}),this.loadedAssets.delete(e),Ht.log(`All assets unloaded for: ${e}`)}unloadAllAssets(){Array.from(this.loadedAssets.keys()).forEach(n=>{this.unloadExtensionAsset(n)}),Ht.log("All module assets unloaded")}isLoaded(e){return this.loadedAssets.has(e)}getLoadedModules(){return Array.from(this.loadedAssets.keys())}}let hf=null;function gf(){return hf||(hf=new iA),hf}function sA(){if(typeof window>"u")return[];const o=window.G7Config;if(!o?.moduleAssets)return[];const e=[];for(const[n,r]of Object.entries(o.moduleAssets)){const i=r;e.push({identifier:n,js:i.js?Cr(i.js):i.js,css:i.css?Cr(i.css):i.css,priority:i.priority,external:i.external})}return e}function oA(){if(typeof window>"u")return null;const o=window.G7Config;if(!o?.bundleUrls)return null;const e=o.bundleUrls;return{moduleJs:e.moduleJs?Cr(e.moduleJs):e.moduleJs,moduleCss:e.moduleCss?Cr(e.moduleCss):e.moduleCss,pluginJs:e.pluginJs?Cr(e.pluginJs):e.pluginJs,pluginCss:e.pluginCss?Cr(e.pluginCss):e.pluginCss}}function lA(){if(typeof window>"u")return[];const o=window.G7Config;if(!o?.pluginAssets)return[];const e=[];for(const[n,r]of Object.entries(o.pluginAssets)){const i=r;e.push({identifier:n,js:i.js?Cr(i.js):i.js,css:i.css?Cr(i.css):i.css,priority:i.priority,external:i.external})}return e}const pf=dt("SystemBannerManager");class vc{static show(e){this.banners.set(e.id,e),this.render(),pf.log(`Banner shown: ${e.id}`)}static hide(e){this.banners.delete(e)&&(this.render(),pf.log(`Banner hidden: ${e}`))}static hideAll(){this.banners.clear(),this.render(),pf.log("All banners hidden")}static detectLocale(){try{const n=window.G7Core;if(n?.locale?.current)return n.locale.current()}catch{}return(navigator.language||"ko").split("-")[0]}static resolveMessage(e,n){return typeof e=="string"?e:e[n]||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 n=Array.from(this.banners.values()).sort((i,l)=>(i.order??0)-(l.order??0)),r=this.detectLocale();e.innerHTML=n.map(i=>{const l=this.resolveMessage(i.message,r),u=i.background||"#f59e0b",d=i.color||"white";return`<div data-banner-id="${i.id}" style="background:${u};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 n=document.getElementById("app");n&&(n.style.paddingTop=e>0?`${e}px`:"")}}$(vc,"banners",new Map),$(vc,"containerId","g7-system-banners");const B=dt("TemplateApp");function gy(o){const e={};for(const n of o.keys()){if(n in e)continue;const r=o.getAll(n);r.length>1?e[n]=r:r.length===1&&(n.endsWith("[]")?e[n]=r:e[n]=r[0])}return e}const Ea=class Ea{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 n=this.loadLocaleFromStorage(),r=n||e.locale||"ko";this.config={...e,locale:r},!n&&e.locale&&this.saveLocaleToStorage(e.locale)}loadG7Config(){if(typeof window<"u"&&window.G7Config){const e=window.G7Config;e.settings&&(this.globalState.settings=e.settings,B.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,B.log("Loaded plugin settings from G7Config:",Object.keys(e.plugins))),e.modules&&(this.globalState.modules=e.modules,B.log("Loaded module settings from G7Config:",Object.keys(e.modules))),e.appConfig&&(this.globalState.appConfig=e.appConfig,B.log("Loaded appConfig from G7Config:",Object.keys(e.appConfig)))}}resolveRouteExpressions(e){const n=new Rn,r={_global:this.globalState};return e.map(i=>{const l={...i};if(l.path&&l.path.includes("{{")){const u=l.path;l.path=n.resolveBindings(l.path,r),l.path=l.path.replace(/\/\/+/g,"/")||"/",l.path.includes("{{")&&(B.warn("Route expression resolution failed, using fallback:",u),l.path=u.replace(/\{\{[^}]+\}\}/g,"").replace(/\/\/+/g,"/")||"/")}if(l.redirect&&l.redirect.includes("{{")){const u=l.redirect;l.redirect=n.resolveBindings(l.redirect,r),l.redirect=l.redirect.replace(/\/\/+/g,"/")||"/",l.redirect.includes("{{")&&(B.warn("Route redirect expression resolution failed:",u),l.redirect=u.replace(/\{\{[^}]+\}\}/g,"").replace(/\/\/+/g,"/")||"/")}return l})}migrateLocaleStorage(){const e=["locale","g7_template_locale"];for(const n of e)try{const r=localStorage.getItem(n);r&&r!==localStorage.getItem(Ea.LOCALE_STORAGE_KEY)&&(localStorage.setItem(Ea.LOCALE_STORAGE_KEY,r),B.log(`Migrated locale from '${n}' to '${Ea.LOCALE_STORAGE_KEY}'`)),localStorage.removeItem(n)}catch(r){B.warn(`Failed to migrate locale key '${n}':`,r)}}async init(){try{Js.getInstance().setDebug(this.config.debug),B.log("Initializing with config:",this.config),KS();const e=fa.getInstance(),n=ga.getInstance(),r=this.loadCacheVersionFromStorage()||0,[i,l,u,d,f]=await Promise.all([ko({templateId:this.config.templateId,templateType:this.config.templateType,locale:this.config.locale,debug:this.config.debug,cacheVersion:r}),e.loadComponents(this.config.templateId,this.config.templateType),Dl(Ma(`/api/templates/${this.config.templateId}/routes`,"json",r>0?r:null),{label:"routes.json"}).then(x=>{if(!x.ok)throw new Error(`Failed to load routes: ${x.statusText}`);return x.json()}).then(x=>{if(!x.success)throw new Error("Failed to load routes from API");return x.data}).catch(x=>{throw B.error("Error loading routes:",x),x}),n.preloadAuth(this.config.templateType==="admin"?"admin":"user"),fetch(Ma(`/api/templates/${this.config.templateId}/config`,"json")).then(x=>x.ok?x.json():null).then(x=>!x?.success||!x?.data?null:x.data).catch(x=>(B.warn("Error loading template config:",x),null))]);if(B.log("Template Engine initialized"),B.log("ComponentRegistry loaded"),B.log("Routes data loaded"),B.log("User info preloaded"),B.log("Template config loaded:",f),f?.cache_version!==void 0){const x=this.loadCacheVersionFromStorage();if(this.extensionCacheVersion=f.cache_version,this.saveCacheVersionToStorage(this.extensionCacheVersion),B.log("Extension cache version:",this.extensionCacheVersion),x!==null&&x!==this.extensionCacheVersion){B.log("Cache version changed, reloading routes...");const k=await Dl(Ma(`/api/templates/${this.config.templateId}/routes`,"json",this.extensionCacheVersion),{label:"routes.json (reload)"}).then(O=>{if(!O.ok)throw new Error(`Failed to reload routes: ${O.statusText}`);return O.json()}).then(O=>{if(!O.success)throw new Error("Failed to reload routes from API");return O.data});Array.isArray(k.routes)&&(k.routes=this.resolveRouteExpressions(k.routes),Object.assign(u,k),B.log("Routes reloaded with new cache version"));try{const{TranslationEngine:O}=await Promise.resolve().then(()=>rp),M=O.getInstance();M.setCacheVersion(this.extensionCacheVersion);const T=this.config.locale||"ko",D="en";await M.loadTranslations(this.config.templateId,T,"/api",!0),T!==D&&await M.loadTranslations(this.config.templateId,D,"/api",!0),B.log("Translations reloaded with new cache version")}catch(O){B.error("Failed to reload translations:",O)}}}f?.errorHandling&&(this.templateErrorHandling=f.errorHandling,ma().setTemplateConfig(this.templateErrorHandling),B.log("Template errorHandling registered:",this.templateErrorHandling)),n.on("logout",()=>{B.log("User logged out")}),n.on("authStateChange",x=>{B.log("Auth state changed:",x)}),B.log("AuthManager event handlers registered");const g=Ia(),m=this.config.templateType==="admin"?"admin":"user",b=n.getConfig(m);g.setOnUnauthorized(()=>{B.log("Unauthorized - redirecting to login page"),g.removeToken();const x=window.location.pathname+window.location.search,k=n.getLoginRedirectUrl(m,x,"session_expired");window.location.href=k}),B.log("ApiClient onUnauthorized callback registered"),this.layoutLoader=new sf(e),this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),B.log("LayoutLoader initialized:",this.layoutLoader);const v=new Sa({onUnauthorized:()=>{B.warn("Unauthorized request in error page")}});if(this.errorPageHandler=new rA({templateId:this.config.templateId,layoutLoader:this.layoutLoader,locale:this.config.locale,debug:this.config.debug,renderFunction:fs,dataSourceManager:v,globalState:this.globalState}),B.log("ErrorPageHandler initialized with DataSourceManager"),await this.handleServerError()){B.log("Server error handled, skipping normal initialization");return}if(this.router=new nA(this.config.templateId),Array.isArray(u.routes)){const x=this.resolveRouteExpressions(u.routes);this.router.setRoutes(x)}else throw new Error("Invalid routes data format");B.log("Router initialized:",this.router),B.log("Routes set:",this.router.getRoutes());const{getActionDispatcher:S}=await Promise.resolve().then(()=>Ua),_=S();if(_&&(_.setDefaultContext({navigate:x=>this.router?.navigate(x)}),_.setGlobalStateUpdater((x,k)=>this.setGlobalState(x,k)),B.log("Navigate function and setGlobalState injected to ActionDispatcher")),await this.loadExtensionAssets(),this.reinitializeTemplateHandlers(),this.router.on("routeChange",x=>this.handleRouteChange(x)),this.router.on("routeNotFound",x=>this.handleRouteNotFound(x)),typeof window<"u"&&hy(window.location.pathname)){B.log("Layout editor mode detected — skipping router match"),await fs({containerId:"app",layoutJson:{components:[]},dataContext:{},translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),B.log("Template App initialized in layout editor mode");return}this.router.navigateToCurrentPath(),B.log("Template App initialized successfully")}catch(e){B.error("Initialization failed:",e),this.showInitError(e)}}async loadExtensionAssets(){try{const e=gf(),n=oA();if(!n){await this.loadExtensionAssetsIndividually();return}await e.loadBundle("module",n.moduleJs,n.moduleCss),await e.loadBundle("plugin",n.pluginJs,n.pluginCss),B.log("Extension bundle assets loaded successfully")}catch(e){B.warn("Failed to load extension assets:",e)}}async loadExtensionAssetsIndividually(){const e=gf(),n=sA();n.length>0&&(B.log("Loading module assets (individual fallback):",n.map(i=>i.identifier)),await e.loadActiveExtensionAssets(n));const r=lA();r.length>0&&(B.log("Loading plugin assets (individual fallback):",r.map(i=>i.identifier)),await e.loadActiveExtensionAssets(r))}async handleRouteChange(e){const n=++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(B.log("Route changed:",e,"requestId:",n),!this.layoutLoader)throw new Error("LayoutLoader is not initialized");if(!e.layout)throw new Error("Route layout is not defined");let r=e.layout;const i=r==="__preview__";i&&e.params?.token&&(r=`__preview__/${e.params.token}`);const l=await this.layoutLoader.loadLayout(this.config.templateId,r);if(n!==this.currentRouteChangeId){B.log("Route change cancelled (newer request exists):",n);return}B.log("Layout loaded:",l);const u=ma();l.errorHandling?(u.setLayoutConfig(l.errorHandling),B.log("Layout errorHandling registered:",l.errorHandling)):u.clearLayoutConfig();const d=l.data_sources||[],f=e.query||{},g=new URLSearchParams;for(const[ae,ge]of Object.entries(f))if(Array.isArray(ge))for(const A of ge)g.append(ae,A);else g.set(ae,ge);const m={route:e.params||{},query:f,_global:this.globalState};l.scripts&&Array.isArray(l.scripts)&&await this.loadLayoutScripts(l.scripts,m);const{DataSourceManager:b,getActionDispatcher:v}=await Promise.resolve().then(()=>Ua),S=new b;if(i){const ae=v();ae&&ae.setPreviewMode(!0),this.setGlobalState({__isPreview:!0}),vc.show({id:"preview-mode",message:{ko:"⚠ 미리보기 모드 — 페이지 이동이 비활성화됩니다",en:"⚠ Preview Mode — Navigation is disabled"},background:"linear-gradient(90deg, #f59e0b, #d97706)",color:"white"}),B.log("Preview mode activated")}else{const ae=v();ae?.isPreviewMode()&&(ae.setPreviewMode(!1),vc.hide("preview-mode"))}if(this.currentGlobalHeaders=l.globalHeaders||[],this.currentGlobalHeaders.length>0){S.setGlobalHeaders(this.currentGlobalHeaders);const ae=v();ae&&ae.setGlobalHeaders(this.currentGlobalHeaders),B.log("globalHeaders set:",this.currentGlobalHeaders.map(ge=>ge.pattern))}if(l.named_actions&&Object.keys(l.named_actions).length>0){const ae=v();ae&&ae.setNamedActions(l.named_actions)}const _=S.filterByCondition(d,m);d.length!==_.length&&B.log("Data sources filtered by condition:",{before:d.map(ae=>ae.id),after:_.map(ae=>ae.id)});const x=_.filter(ae=>ae.loading_strategy==="blocking"),k=_.filter(ae=>(ae.loading_strategy||"progressive")!=="blocking"&&ae.type!=="websocket"),O=Array.isArray(l.transition_overlay?.wait_for)?l.transition_overlay.wait_for:[],M=O.length>0&&_.some(ae=>O.includes(ae.id)&&ae.type!=="websocket"&&(ae.loading_strategy||"progressive")!=="background");if((x.length>0||M)&&l.transition_overlay){const ae=typeof l.transition_overlay=="boolean"?{enabled:l.transition_overlay,style:"opaque"}:l.transition_overlay;ae.enabled&&ae.style==="skeleton"&&ae.skeleton?.component&&ae.target?this.renderSkeletonOverlay(ae.target,ae.skeleton,l,ae.fallback_target):ae.enabled&&ae.style==="spinner"&&ae.target&&this.renderSpinnerOverlay(ae.target,ae.spinner,ae.fallback_target)}let T={},D={},j={},H={};this.currentWebSocketSubscriptions.length>0&&(B.log("Unsubscribing previous WebSocket subscriptions:",this.currentWebSocketSubscriptions),S.unsubscribeWebSockets(this.currentWebSocketSubscriptions),this.currentWebSocketSubscriptions=[]),this.currentDataSources=_,this.currentRawDataSources=d,this.currentRouteParams=e.params||{},this.currentQueryParams=g,B.log(`handleRouteChange #${n} - queryObject:`,f),B.log(`handleRouteChange #${n} - queryParams:`,g.toString()),x.length>0&&(B.log("Fetching blocking data sources:",x.map(ge=>ge.id)),(await S.fetchDataSourcesWithResults(x,e.params||{},g)).forEach(ge=>{if(ge.state==="success"&&ge.data!==void 0)T[ge.id]=ge.data;else if(ge.state==="error"&&ge.error){const A=ge.error,K=A.response?.data?.message;D[ge.id]={message:K||ge.error.message,status:A.response?.status||A.status}}}),this.processInitOptions(x,T,j,H),this.currentFetchedData={...T},B.log("Blocking data loaded:",Object.keys(T)),Object.keys(D).length>0&&B.log("Data source errors:",D),Object.keys(j).length>0&&B.log("Local state init (blocking):",Object.keys(j)),Object.keys(H).length>0&&B.log("Isolated state init (blocking):",Object.keys(H)));const P=k.length>0;if(P&&(Ha.setPending(!0),B.log("Transition started before rendering")),n!==this.currentRouteChangeId){B.log("Route change cancelled after blocking data (newer request exists):",n);return}const{getState:X}=await Promise.resolve().then(()=>Ua),pe=X().currentDataContext||{},_e=k.map(ae=>ae.id),we={};if(P){_e.forEach(ge=>{pe[ge]!==void 0?we[ge]=pe[ge]:we[ge]=void 0});const ae=Object.keys(we).filter(ge=>we[ge]!==void 0);ae.length>0&&B.log("Preserving previous progressive data:",ae),B.log("Progressive data sources initialized:",_e)}const Me=l.defines||{},qe={...we,...e.params,...T,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState},_globalSetState:ae=>this.setGlobalState(ae),_dataSourceErrors:Object.keys(D).length>0?D:void 0,_localInit:Object.keys(j).length>0?j:void 0,_isolatedInit:Object.keys(H).length>0?H:void 0,_defines:Object.keys(Me).length>0?Me:void 0};if(l.computed&&Object.keys(l.computed).length>0){const ae=this.calculateComputed(l.computed,qe);Object.keys(ae).length>0&&(qe._computed=ae,this.globalState._computed=ae,B.log("Computed values calculated:",Object.keys(ae))),qe._computedDefinitions=l.computed}const Je=l.layout_name||e.layout;this.currentLayoutName!==""&&this.currentLayoutName!==Je&&(B.log("_local reset due to layout change:",{from:this.currentLayoutName,to:Je}),this.globalState._local={},bC()),this.currentLayoutName=Je;const Q=l.initLocal||l.state;if(Q&&Object.keys(Q).length>0){this.globalState._local||(this.globalState._local={});for(const[ae,ge]of Object.entries(Q))this.globalState._local[ae]===void 0&&(this.globalState._local[ae]=JSON.parse(JSON.stringify(ge)));qe._local={...this.globalState._local},B.log("initLocal applied to _local:",Object.keys(Q))}if(l.initGlobal&&Object.keys(l.initGlobal).length>0){for(const[ae,ge]of Object.entries(l.initGlobal))this.globalState[ae]===void 0&&(this.globalState[ae]=JSON.parse(JSON.stringify(ge)));B.log("initGlobal applied to _global:",Object.keys(l.initGlobal))}if(l.initIsolated&&Object.keys(l.initIsolated).length>0){for(const[ae,ge]of Object.entries(l.initIsolated))H[ae]===void 0&&(H[ae]=JSON.parse(JSON.stringify(ge)));B.log("initIsolated applied:",Object.keys(l.initIsolated))}qe._global={...this.globalState,layoutWarnings:l.warnings||[]};const fe=l.initActions||l.init_actions;if(fe&&fe.length>0){await this.executeInitActions(fe,qe),B.log("initActions executed before render");const ae=this.globalState;if(ae._local){if(Object.keys(j).length>0){for(const[ge,A]of Object.entries(j))ae._local[ge]!==void 0?ae._local[ge]=this.deepMerge(ae._local[ge],A):ae._local[ge]=A;B.log("localInit merged into _local after initActions:",Object.keys(j))}qe._local=ae._local,B.log("_local merged into dataContext:",ae._local)}if(qe._global={...this.globalState,layoutWarnings:l.warnings||[]},B.log("_global merged into dataContext after initActions"),l.computed&&Object.keys(l.computed).length>0){const ge=this.calculateComputed(l.computed,qe);Object.keys(ge).length>0&&(qe._computed=ge,this.globalState._computed=ge,B.log("Computed values recalculated after init_actions:",Object.keys(ge)))}if(Object.keys(this.currentFetchedData).length>0){for(const[ge,A]of Object.entries(this.currentFetchedData))qe[ge]=A;B.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 fs({containerId:"app",layoutJson:l,dataContext:qe,translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),B.log("Initial render complete with blocking data"),this.reattachSpinnerOverlay(),k.length>0){if(n!==this.currentRouteChangeId){B.log("Route change cancelled before progressive fetch (newer request exists):",n),Ha.setPending(!1),this.hideTransitionOverlay();return}B.log("Fetching progressive/background data sources:",k.map(A=>A.id));const{updateTemplateData:ae,getState:ge}=await Promise.resolve().then(()=>Ua);try{const A=k.map(async K=>{try{const he=(await S.fetchDataSourcesWithResults([K],e.params||{},g,this.globalState))[0];if(!he){B.log(`Data source ${K.id} skipped (no fetch result)`);return}if(n!==this.currentRouteChangeId){B.log(`Data source ${K.id} fetch cancelled (newer request exists)`);return}if(he.state==="success"&&he.data!==void 0){B.log(`Progressive data source loaded: ${K.id}`),this.currentFetchedData[K.id]=he.data;const le={};this.processInitOptions([K],{[K.id]:he.data},le);const de=ge();if(de.bindingEngine){const He=[K.id];K.initGlobal&&He.push("_global"),K.initLocal&&He.push("_local"),de.bindingEngine.invalidateCacheByKeys(He)}const Oe={[K.id]:he.data};Object.keys(le).length>0&&(Oe._localInit=le,Object.assign(j,le)),K.initGlobal&&(Oe._global={...this.globalState}),ae(Oe)}else if(he.state==="error"&&he.error){const le=he.error,de=le.response?.data?.message;D[K.id]={message:de||he.error.message,status:le.response?.status||le.status},B.log(`Progressive data source error: ${K.id}`,D[K.id]),ae({[K.id]:null,_dataSourceErrors:{...D}})}}catch(ue){B.error(`Failed to fetch data source: ${K.id}`,ue)}});if(await Promise.all(A),n!==this.currentRouteChangeId){B.log("Route change cancelled after progressive fetch (newer request exists):",n);return}B.log("All progressive data sources loaded")}finally{Ha.setPending(!1),this.hideTransitionOverlay()}}else this.hideTransitionOverlay();const ve=_.filter(ae=>ae.type==="websocket");if(ve.length>0){B.log("Subscribing WebSocket data sources:",ve.map(K=>K.id));const{updateTemplateData:ae,getState:ge}=await Promise.resolve().then(()=>Ua),A={...this.currentFetchedData,...e.params,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState}};B.log("WebSocket binding context keys:",Object.keys(A)),this.currentWebSocketSubscriptions=S.subscribeWebSockets(_,(K,ue)=>{B.log(`WebSocket data received for: ${K}`,ue),this.currentFetchedData[K]=ue;const he=_.find(He=>He.id===K),le=ge();if(le.bindingEngine){const He=[K];he?.initGlobal&&He.push("_global"),he?.initLocal&&He.push("_local"),le.bindingEngine.invalidateCacheByKeys(He)}ae({[K]:ue});const Oe=_.find(He=>He.type==="websocket"&&(He.target_source||He.id)===K)?.onReceive;Array.isArray(Oe)&&Oe.length>0&&window.G7Core?.dispatch&&(async()=>{for(const Pe of Oe)try{const ke=this.getActionDispatcher?.();ke&&await ke.dispatchAction(Pe,{navigate:this.getRouter?.()?(Ot,ut)=>this.getRouter().navigate(Ot,ut):void 0,setState:Ot=>this.setGlobalState(Ot),state:this.globalState,data:{...this.globalState,$args:[ue],$event:ue},_isDispatchFallbackContext:!0})}catch(ke){B.error(`WebSocket onReceive action failed for ${K}:`,ke)}})()},A),B.log("WebSocket subscriptions established:",this.currentWebSocketSubscriptions)}B.log("Layout rendered successfully")}catch(r){B.error("Route change handling failed:",r),this.hideTransitionOverlay(),this.showRouteError(r)}}processInitOptions(e,n,r,i){e.some(u=>u.refetchOnMount===!0&&u.initLocal)&&(r._forceLocalInit=Date.now(),B.log("refetchOnMount detected, forcing local state init")),e.forEach(u=>{const d=n[u.id];if(!d)return;const f=d.data??d;if(u.initLocal){if(typeof u.initLocal=="string"){let g=f;if(u.initLocalDefaults&&typeof u.initLocalDefaults=="object"){const b=this.evaluateDefaults(u.initLocalDefaults,n);g={...b,...f},B.log(`initLocalDefaults applied for ${u.initLocal}:`,Object.keys(b))}const m=this.globalState._local?.[u.initLocal];m!==void 0&&typeof m=="object"&&typeof g=="object"?(r[u.initLocal]=this.deepMerge(m,g),B.log(`initLocal (merged): ${u.id}.data -> _local.${u.initLocal}`)):(r[u.initLocal]=g,B.log(`initLocal: ${u.id}.data -> _local.${u.initLocal}`))}else if(typeof u.initLocal=="object"&&u.initLocal.key){const{key:g,path:m}=u.initLocal;let b=m?this.extractValueByPathOrExpression(f,m,u.id):f;if(u.initLocalDefaults&&typeof u.initLocalDefaults=="object"){const S=this.evaluateDefaults(u.initLocalDefaults,n);b={...S,...b},B.log(`initLocalDefaults applied for ${g}:`,Object.keys(S))}const v=this.globalState._local?.[g];v!==void 0&&typeof v=="object"&&typeof b=="object"?(r[g]=this.deepMerge(v,b),B.log(`initLocal (merged): ${u.id}.data${m?"."+m:""} -> _local.${g}`)):(r[g]=b,B.log(`initLocal: ${u.id}.data${m?"."+m:""} -> _local.${g}`))}else if(typeof u.initLocal=="object"){const g=u.initLocal._merge||"deep",m=this.flattenNestedObjectToMappings(u.initLocal);for(const{targetPath:b,sourcePath:v}of m){const S=this.extractValueByPathOrExpression(f,v,u.id);if(b.includes(".")){const _=b.split(".")[0];r[_]===void 0&&this.globalState._local?.[_]!==void 0&&(r[_]=JSON.parse(JSON.stringify(this.globalState._local[_]))),this.setValueAtPath(r,b,S,g),B.log(`initLocal map (${g}): ${u.id} ${v} -> _local.${b}`)}else{const _=this.globalState._local?.[b];g==="replace"?(r[b]=S,B.log(`initLocal map (replace): ${u.id} ${v} -> _local.${b}`)):g==="shallow"?_!==void 0&&typeof _=="object"&&typeof S=="object"?(r[b]={..._,...S},B.log(`initLocal map (shallow): ${u.id} ${v} -> _local.${b}`)):(r[b]=S,B.log(`initLocal map: ${u.id} ${v} -> _local.${b}`)):_!==void 0&&typeof _=="object"&&typeof S=="object"?(r[b]=this.deepMerge(_,S),B.log(`initLocal map (deep): ${u.id} ${v} -> _local.${b}`)):(r[b]=S,B.log(`initLocal map: ${u.id} ${v} -> _local.${b}`))}}}}if(u.initGlobal)if(typeof u.initGlobal=="object"&&!Array.isArray(u.initGlobal)&&!("key"in u.initGlobal))for(const[m,b]of Object.entries(u.initGlobal)){if(typeof b!="string"){B.warn(`initGlobal map value must be string, got ${typeof b} for key ${m}`);continue}const v=this.extractValueByPathOrExpression(f,b,u.id),S=this.globalState[m];S!==void 0&&typeof S=="object"&&typeof v=="object"?(this.globalState[m]=this.deepMerge(S,v),B.log(`initGlobal map (merged): ${u.id} ${b} -> _global.${m}`)):(this.globalState[m]=v,B.log(`initGlobal map: ${u.id} ${b} -> _global.${m}`))}else{const m=Array.isArray(u.initGlobal)?u.initGlobal:[u.initGlobal];for(const b of m)if(typeof b=="string"){const v=this.globalState[b];v!==void 0&&typeof v=="object"&&typeof f=="object"?(this.globalState[b]=this.deepMerge(v,f),B.log(`initGlobal (merged): ${u.id}.data -> _global.${b}`)):(this.globalState[b]=f,B.log(`initGlobal: ${u.id}.data -> _global.${b}`))}else if(typeof b=="object"&&b.key){const{key:v,path:S}=b,_=S?this.extractValueByPathOrExpression(f,S,u.id):f,x=this.globalState[v];x!==void 0&&typeof x=="object"&&typeof _=="object"?(this.globalState[v]=this.deepMerge(x,_),B.log(`initGlobal (merged): ${u.id}.data${S?"."+S:""} -> _global.${v}`)):(this.globalState[v]=_,B.log(`initGlobal: ${u.id}.data${S?"."+S:""} -> _global.${v}`))}}if(i&&u.initIsolated){if(typeof u.initIsolated=="string"){const g=i[u.initIsolated];g!==void 0&&typeof g=="object"&&typeof f=="object"?(i[u.initIsolated]=this.deepMerge(g,f),B.log(`initIsolated (merged): ${u.id}.data -> _isolated.${u.initIsolated}`)):(i[u.initIsolated]=f,B.log(`initIsolated: ${u.id}.data -> _isolated.${u.initIsolated}`))}else if(typeof u.initIsolated=="object"&&u.initIsolated.key){const{key:g,path:m}=u.initIsolated,b=m?this.extractValueByPathOrExpression(f,m,u.id):f,v=i[g];v!==void 0&&typeof v=="object"&&typeof b=="object"?(i[g]=this.deepMerge(v,b),B.log(`initIsolated (merged): ${u.id}.data${m?"."+m:""} -> _isolated.${g}`)):(i[g]=b,B.log(`initIsolated: ${u.id}.data${m?"."+m:""} -> _isolated.${g}`))}else if(typeof u.initIsolated=="object")for(const[g,m]of Object.entries(u.initIsolated)){if(typeof m!="string"){B.warn(`initIsolated map value must be string, got ${typeof m} for key ${g}`);continue}const b=this.extractValueByPathOrExpression(f,m,u.id),v=i[g];v!==void 0&&typeof v=="object"&&typeof b=="object"?(i[g]=this.deepMerge(v,b),B.log(`initIsolated map (merged): ${u.id} ${m} -> _isolated.${g}`)):(i[g]=b,B.log(`initIsolated map: ${u.id} ${m} -> _isolated.${g}`))}}})}evaluateDefaults(e,n){const r={};for(const[i,l]of Object.entries(e))if(typeof l=="string"&&l.startsWith("{{")&&l.endsWith("}}")){const u=l.slice(2,-2).trim();r[i]=this.evaluateExpression(u,n)}else r[i]=l;return r}evaluateExpression(e,n){try{const r=e.split("??").map(i=>i.trim());for(const i of r){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(n,i);if(l!=null)return l}return}catch(r){B.warn(`Expression evaluation failed: ${e}`,r);return}}getNestedValue(e,n){const r=n.replace(/\?\./g,".");let i=e;const l=r.split(/\.(?![^\[]*\])/).flatMap(u=>{const d=u.match(/^([^\[]*)((?:\[\d+\])*)$/);if(d){const[,f,g]=d,m=[];f&&m.push(f);const b=g.match(/\[\d+\]/g);return b&&m.push(...b),m}return[u]}).filter(u=>u!=="");for(const u of l){if(i==null)return;if(u.startsWith("[")&&u.endsWith("]")){const d=parseInt(u.slice(1,-1),10);i=i[d]}else i=i[u]}return i}extractValueByPathOrExpression(e,n,r){const i=n.match(/^\{\{(.+)\}\}$/);if(i){const l=i[1].trim(),u=new Rn,d={data:e,_global:this.globalState,_local:this.globalState._local||{}};try{const f=u.evaluateExpression(l,d);return B.log(`initLocal/initGlobal expression evaluated: ${n} -> `,f),f}catch(f){B.warn(`initLocal/initGlobal expression evaluation failed for ${r}:`,n,f);return}}return this.getNestedValue(e,n)}async loadLayoutScripts(e,n){const r=[];for(const i of e){if((i.if!==void 0||i.conditions!==void 0)&&!Qi({if:i.if,conditions:i.conditions},n,this.bindingEngine,`script:${i.id}`)){B.log(`Script skipped (condition not met): ${i.id}`);continue}if(document.getElementById(i.id)){B.log(`Script already loaded: ${i.id}`);continue}const u=new Promise((d,f)=>{const g=document.createElement("script");g.src=i.src,g.id=i.id,g.async=i.async??!0,g.onload=()=>{B.log(`Script loaded successfully: ${i.id}`),d()},g.onerror=()=>{B.warn(`Failed to load script: ${i.id} (${i.src})`),d()},document.head.appendChild(g)});r.push(u)}r.length>0&&(await Promise.all(r),B.log(`All scripts loaded: ${e.filter(i=>!document.getElementById(i.id)||r.length>0).map(i=>i.id).join(", ")}`))}evaluateScriptCondition(e,n){try{if(e.startsWith("{{")&&e.endsWith("}}")){const r=e.slice(2,-2).trim();return new Function("ctx",`
|
||
with(ctx) {
|
||
try {
|
||
return Boolean(${r});
|
||
} catch (e) {
|
||
return false;
|
||
}
|
||
}
|
||
`)(n)}return!!e}catch(r){return B.warn(`Failed to evaluate script condition: ${e}`,r),!1}}showInitError(e){if(id()){B.warn("Init failed while document is unloading — skipping error screen",e);return}const n=fy(e);ff.renderFromError("app",n,"초기화 실패",this.config.debug,{templateId:this.config.templateId,locale:this.config.locale},void 0,e)}showTransitionOverlay(e,n){const r=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(!r.enabled)return;if(this.hideTransitionOverlay(),r.style==="skeleton"&&r.skeleton?.component&&r.target&&n){this.renderSkeletonOverlay(r.target,r.skeleton,n,r.fallback_target);return}if(r.style==="spinner"&&r.target){this.renderSpinnerOverlay(r.target,r.spinner,r.fallback_target);return}const i=document.documentElement.classList.contains("dark");let l,u="";switch(r.style){case"blur":l=i?"rgba(17,24,39,0.3)":"rgba(255,255,255,0.3)",u="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;default:l=i?"rgb(17,24,39)":"rgb(249,250,251)";break}if(r.target){const d=`#${CSS.escape(r.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};${u}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 u.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,n,r,i){const u=fa.getInstance().getComponent(n.component);if(!u){B.log(`Skeleton component "${n.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){B.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)",b=f==="fullpage"?"app":f==="fallback"?i:e,v=`#${CSS.escape(b)}`,S=document.createElement("style");S.id="g7-skeleton-overlay-style",S.textContent=`${v}{position:relative;z-index:0;}${v}::after{content:'';position:absolute;inset:0;background:${m};z-index:2147483646;pointer-events:none;}`,document.head.appendChild(S),this.transitionOverlayEl=S;const _=document.createElement("div");if(_.id="g7-skeleton-overlay",_.setAttribute("role","status"),_.setAttribute("aria-busy","true"),_.setAttribute("aria-label","Loading..."),f==="fullpage")_.style.cssText=["position:fixed","inset:0","z-index:20","overflow:hidden","pointer-events:none",`background:${m}`].join(";")+";";else{const T=d.getBoundingClientRect(),D=window.scrollX||document.documentElement.scrollLeft,j=window.scrollY||document.documentElement.scrollTop;_.style.cssText=["position:absolute",`top:${T.top+j}px`,`left:${T.left+D}px`,`width:${T.width}px`,`height:${T.height}px`,"z-index:20","overflow:hidden","pointer-events:none",`background:${m}`].join(";")+";"}document.body.appendChild(_),this.skeletonOverlayContainer=_;const x=r.components||[];let k;if(f==="fullpage")k=x;else{const T=f==="fallback"?i:e;k=this.findComponentChildrenById(x,T)}const O=td.createRoot(_);this.skeletonOverlayRoot=O,Ar.flushSync(()=>{O.render(Xe.createElement(u,{components:k,options:{animation:n.animation||"pulse",iteration_count:n.iteration_count||5}}))});const M=f==="fullpage"?"fullpage (#app)":f==="fallback"?`fallback (#${i})`:`target (#${e})`;B.log(`Skeleton overlay rendered [${M}] with "${n.component}" (${k.length} components)`)}findComponentChildrenById(e,n){const r=i=>{for(const l of i){if(l.id===n)return l.children||[];if(l.children&&Array.isArray(l.children)){const u=r(l.children);if(u!==null)return u}}return null};return r(e)||e}renderSpinnerOverlay(e,n,r){let i=document.getElementById(e),l="target";if(!i&&r&&(i=document.getElementById(r),l="fallback"),i||(i=document.getElementById("app"),l="fullpage"),!i){B.log(`Spinner overlay: no target found (target="#${e}", fallback="${r||"none"}"), falling back to opaque overlay`),this.showTransitionOverlay({enabled:!0,style:"opaque",target:e});return}this.hideSkeletonOverlay();const u=l==="fullpage"?"app":l==="fallback"?r:e,d=`#${CSS.escape(u)}`,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=n?.text||window.G7Core?.t?.("nav.loading")||"";this._spinnerState={target:e,fallbackTarget:r,spinnerConfig:n,resolvedText:g},this._mountSpinnerInTarget(i);const m=l==="fullpage"?"fullpage (#app)":l==="fallback"?`fallback (#${r})`:`target (#${e})`,b=n?.component||"default spinner";B.log(`Spinner overlay rendered [${m}] with "${b}"`)}_mountSpinnerInTarget(e){if(!this._spinnerState)return;const{spinnerConfig:n,resolvedText:r}=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,n?.component){const u=fa.getInstance().getComponent(n.component);if(u){const d=td.createRoot(i);this.skeletonOverlayRoot=d,Ar.flushSync(()=>{d.render(Xe.createElement(u,{options:{text:r}}))});return}B.log(`Spinner component "${n.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:n}=this._spinnerState;let r=document.getElementById(e);!r&&n&&(r=document.getElementById(n)),r||(r=document.getElementById("app")),r&&(this._mountSpinnerInTarget(r),B.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 va&&e.details?.status===401){const r=this.config.templateId||"",i=window.location.pathname,l=r.includes("admin")||i.startsWith("/admin")?"admin":"user",u=i+window.location.search,d=!!Ia().getToken()||e.details?.hadToken===!0,f=ga.getInstance().getLoginRedirectUrl(l,u,d?"session_expired":void 0);window.location.href=f;return}const n=fy(e);ff.renderFromError("app",n,"페이지 로딩 실패",this.config.debug,{templateId:this.config.templateId,locale:this.config.locale},void 0,e)}async handleServerError(){const e=window.G7Error;if(!e)return!1;B.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"))?(B.log(`${e.code} error page rendered successfully`),!0):(B.log(`Falling back to ErrorDisplay for ${e.code}`),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0)}catch(n){return B.error(`Failed to render ${e.code} page:`,n),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0}}async handleRouteNotFound(e){B.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"))){B.log("404 error page rendered successfully");return}B.log("Falling back to ErrorDisplay for 404"),this.showRouteError(new Error(`Page not found: ${e}`))}catch(n){B.error("Failed to render 404 page:",n),this.showRouteError(new Error(`Page not found: ${e}`))}}getRouter(){return this.router}getConfig(){return this.config}getLayoutLoader(){return this.layoutLoader}async reloadExtensionState(){B.log("reloadExtensionState: start");let e;try{const n=await fetch(Ma(`/api/templates/${this.config.templateId}/config`,"json",null,`_=${Date.now()}`));if(n.ok){const r=await n.json();r?.success&&r?.data?.cache_version!==void 0&&(e=r.data.cache_version)}}catch(n){B.warn("reloadExtensionState: failed to fetch config.json",n)}e!==void 0&&e!==this.extensionCacheVersion&&(B.log(`reloadExtensionState: cache version ${this.extensionCacheVersion} -> ${e}`),this.extensionCacheVersion=e,this.saveCacheVersionToStorage(e));try{this.router&&(await this.router.loadRoutes(this.extensionCacheVersion),B.log("reloadExtensionState: routes reloaded"))}catch(n){B.error("reloadExtensionState: routes reload failed",n)}try{this.layoutLoader&&(this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),this.layoutLoader.clear(),B.log("reloadExtensionState: layout cache cleared"))}catch(n){B.error("reloadExtensionState: layout cache clear failed",n)}try{const{TranslationEngine:n}=await Promise.resolve().then(()=>rp),r=n.getInstance();this.extensionCacheVersion>0&&r.setCacheVersion(this.extensionCacheVersion);const i=this.config.locale||"ko",l="en";await r.loadTranslations(this.config.templateId,i,"/api",!0),i!==l&&await r.loadTranslations(this.config.templateId,l,"/api",!0),B.log("reloadExtensionState: translations reloaded")}catch(n){B.error("reloadExtensionState: translations reload failed",n)}try{const n=await fetch(`/api/locales/active?_=${Date.now()}`);if(n.ok){const i=(await n.json())?.data?.locales;if(Array.isArray(i)&&i.length>0){const l=this.globalState.appConfig??{};this.setGlobalState({appConfig:{...l,supportedLocales:i}}),B.log("reloadExtensionState: supportedLocales refreshed",i)}}}catch(n){B.warn("reloadExtensionState: supportedLocales refresh failed",n)}B.log("reloadExtensionState: done")}getActionDispatcher(){return er().actionDispatcher}async changeLocale(e){try{if(B.log("Changing locale to:",e),this.config.locale===e){B.log("Locale is already",e);return}this.config.locale=e,this.saveLocaleToStorage(e),await this.saveLocaleToDatabase(e),this.layoutLoader&&(this.layoutLoader.clear(),B.log("Layout cache cleared")),this.errorPageHandler&&(this.errorPageHandler.updateLocale(e),B.log("ErrorPageHandler locale updated")),Sc(),await ko({templateId:this.config.templateId,templateType:this.config.templateType,locale:e,debug:this.config.debug,cacheVersion:this.extensionCacheVersion}),B.log("Template Engine re-initialized with new locale");const{getActionDispatcher:n}=await Promise.resolve().then(()=>Ua),r=n();r&&(r.setDefaultContext({navigate:i=>this.router?.navigate(i)}),r.setGlobalStateUpdater((i,l)=>this.setGlobalState(i,l)),B.log("Navigate function and setGlobalState re-injected to ActionDispatcher")),this.reinitializeModuleHandlers(),B.log("Module handlers re-initialized"),this.reinitializeTemplateHandlers(),B.log("Template handlers re-initialized"),this.reinitializePluginHandlers(),B.log("Plugin handlers re-initialized"),this.router&&this.router.navigateToCurrentPath(),B.log("Locale changed successfully to",e)}catch(n){throw B.error("Failed to change locale:",n),n}}loadLocaleFromStorage(){try{return localStorage.getItem(Ea.LOCALE_STORAGE_KEY)}catch(e){return B.warn("Failed to load locale from storage:",e),null}}saveLocaleToStorage(e){try{localStorage.setItem(Ea.LOCALE_STORAGE_KEY,e)}catch(n){B.warn("Failed to save locale to storage:",n)}}async saveLocaleToDatabase(e){const n=localStorage.getItem("auth_token");if(!n){B.log("No auth token, skipping DB locale save");return}let r,i;if(this.config.localeApi)r=this.config.localeApi.endpoint,i=this.config.localeApi.method;else{const l=this.config.templateType==="admin";r=l?"/api/admin/users/me/language":"/api/user/profile/update-language",i=l?"PATCH":"POST"}try{const l=this.getXsrfToken(),u=await fetch(r,{method:i,headers:{"Content-Type":"application/json",Accept:"application/json",...l&&{"X-XSRF-TOKEN":l},Authorization:`Bearer ${n}`},credentials:"include",body:JSON.stringify({language:e})});u.ok?B.log("Locale saved to DB:",e):B.warn("Failed to save locale to DB (UI will still change):",u.statusText)}catch(l){B.warn("Failed to call locale API (UI will still change):",l)}}getXsrfToken(){if(typeof document>"u")return null;const n=`; ${document.cookie}`.split("; XSRF-TOKEN=");return n.length===2?decodeURIComponent(n.pop()?.split(";").shift()||""):null}loadCacheVersionFromStorage(){try{const e=localStorage.getItem(Ea.CACHE_VERSION_STORAGE_KEY);return e?parseInt(e,10):null}catch(e){return B.warn("Failed to load cache version from storage:",e),null}}saveCacheVersionToStorage(e){try{localStorage.setItem(Ea.CACHE_VERSION_STORAGE_KEY,String(e))}catch(n){B.warn("Failed to save cache version to storage:",n)}}reinitializeModuleHandlers(){if(typeof window>"u")return;const e="__",n=window;Object.keys(n).forEach(r=>{if(r.startsWith(e)&&typeof n[r]?.initModule=="function")try{n[r].initModule(),B.log(`Module handler re-initialized: ${r}`)}catch(i){B.warn(`Failed to re-initialize module handlers for ${r}:`,i)}})}reinitializeTemplateHandlers(){if(typeof window>"u")return;const e=window.G7TemplateHandlers;if(!e){B.warn("Template handlers not found on window.G7TemplateHandlers");return}const n=this.getActionDispatcher();if(!n){B.warn("ActionDispatcher not available for template handler registration");return}Object.entries(e).forEach(([r,i])=>{n.registerHandler(r,i)}),B.log(`${Object.keys(e).length} template handler(s) re-registered:`,Object.keys(e))}reinitializePluginHandlers(){if(typeof window>"u")return;const e="__",n=window;Object.keys(n).forEach(r=>{if(r.startsWith(e)&&typeof n[r]?.initPlugin=="function")try{n[r].initPlugin(),B.log(`Plugin handler re-initialized: ${r}`)}catch(i){B.warn(`Failed to re-initialize plugin handlers for ${r}:`,i)}})}getLocale(){return this.config.locale}getErrorPageHandler(){return this.errorPageHandler}getGlobalState(){return{...this.globalState}}setGlobalState(e,n){const r={...this.globalState};typeof e=="function"?this.globalState=e(this.globalState):this.globalState={...this.globalState,...e},B.log("Global state updated:",this.globalState),window.G7Core?.devTools?.captureStateSnapshot?.({source:"setGlobalState",prev:r,next:this.globalState}),this.globalStateListeners.forEach(l=>{l(this.globalState)}),n?.render!==!1&&Promise.resolve().then(()=>Ua).then(({updateTemplateData:l,getState:u})=>{const d=u();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,n){let r=this.currentDataSources.find(i=>i.id===e);if(!r)for(const[,i]of this.modalDataSources){const l=i.find(u=>u.id===e);if(l){r=l;break}}if(!r){B.warn(`Data source not found: ${e}`);return}B.log(`Refetching data source: ${e}`,n?.sync?"(sync mode)":"",n?.globalStateOverride?"(with global override)":"",n?.localStateOverride?"(with local override)":""),Ha.setPending(!0);try{const i=new Sa;this.currentGlobalHeaders.length>0&&i.setGlobalHeaders(this.currentGlobalHeaders);const l=er(),u=l.currentDataContext?._global||{},d=n?.globalStateOverride?{...u,...n.globalStateOverride}:u,f=l.currentDataContext?._local||{},g=n?.localStateOverride?{...f,...n.localStateOverride}:f,b=(await i.fetchDataSourcesWithResults([r],this.currentRouteParams,this.currentQueryParams,d,g,{ignoreAutoFetch:!0}))[0];if(b.state==="success"&&b.data!==void 0){this.currentFetchedData[e]=b.data;const v={};this.processInitOptions([r],{[e]:b.data},v);const S=er();if(S.bindingEngine){const x=[e];r.initGlobal&&x.push("_global"),r.initLocal&&x.push("_local"),S.bindingEngine.invalidateCacheByKeys(x)}const _={[e]:b.data};return Object.keys(v).length>0&&(_._localInit=v),r.initGlobal&&(_._global={...this.globalState}),hs(_,n?.sync?{sync:!0}:void 0),B.log(`Data source refetched successfully: ${e}`),b.data}else if(b.state==="error"){B.error(`Failed to refetch data source: ${e}`,b.error);return}}catch(i){B.error(`Error refetching data source: ${e}`,i);return}finally{Ha.setPending(!1)}}registerModalDataSources(e,n){this.modalDataSources.set(e,n),B.log(`Modal data sources registered: ${e} (${n.length} sources)`)}unregisterModalDataSources(e){this.modalDataSources.delete(e),B.log(`Modal data sources unregistered: ${e}`)}getDataSource(e){return this.currentFetchedData[e]}setDataSource(e,n,r){if(!e){B.warn("setDataSource: dataSourceId is required");return}const{merge:i=!1,sync:l=!1}=r||{};i&&this.currentFetchedData[e]?this.currentFetchedData[e]={...this.currentFetchedData[e],...n}:this.currentFetchedData[e]=n,Promise.resolve().then(()=>Ua).then(({updateTemplateData:u})=>{u({[e]:this.currentFetchedData[e]},l?{sync:!0}:void 0)}),B.log(`setDataSource: Updated ${e}`,i?"(merged)":"(replaced)")}updateDataSourceItem(e,n,r,i,l){const{idField:u="id",merge:d=!0,skipRender:f=!1}=l||{},g=this.currentFetchedData[e];if(!g)return B.warn(`updateDataSourceItem: DataSource '${e}' not found`),!1;const m=this.parseItemPath(n);let b=g;for(const _ of m)if(b=b?.[_],b===void 0)return B.warn(`updateDataSourceItem: Path '${n}' not found in dataSource`),!1;if(!Array.isArray(b))return B.warn(`updateDataSourceItem: Target at '${n}' is not an array`),!1;const v=b.findIndex(_=>String(_[u])===String(r));if(v===-1)return B.warn(`updateDataSourceItem: Item with ${u}='${r}' not found`),!1;d?b[v]=this.deepMerge(b[v],i):b[v]={...b[v],...i};const S=window.G7Core?.devTools;return S?.isEnabled?.()&&S.trackDataSourceUpdate?.({dataSourceId:e,updateType:"partial",itemPath:n,itemId:r,updates:i,timestamp:Date.now()}),f||Promise.resolve().then(()=>Ua).then(({updateTemplateData:_})=>{_({[e]:this.currentFetchedData[e]},{sync:!1})}),B.log(`updateDataSourceItem: Updated ${e}.${n}[${u}=${r}]`),!0}parseItemPath(e){const n=[],r=/([^\.\[\]]+)|\[(\d+)\]/g;let i;for(;(i=r.exec(e))!==null;)i[1]!==void 0?n.push(i[1]):i[2]!==void 0&&n.push(parseInt(i[2],10));return n}deepMerge(e,n){if(n==null)return e;if(typeof n!="object"||Array.isArray(n))return n;const r={...e};for(const i of Object.keys(n))typeof n[i]=="object"&&n[i]!==null&&!Array.isArray(n[i])?r[i]=this.deepMerge(r[i]||{},n[i]):r[i]=n[i];return r}setValueAtPath(e,n,r,i="deep"){const l=n.split(".");let u=e;for(let g=0;g<l.length-1;g++){const m=l[g];(u[m]===void 0||u[m]===null||typeof u[m]!="object")&&(u[m]={}),u=u[m]}const d=l[l.length-1],f=u[d];i==="replace"||f===void 0?u[d]=r:i==="shallow"?typeof f=="object"&&typeof r=="object"&&!Array.isArray(r)?u[d]={...f,...r}:u[d]=r:typeof f=="object"&&typeof r=="object"&&!Array.isArray(r)?u[d]=this.deepMerge(f,r):u[d]=r}flattenNestedObjectToMappings(e,n=""){const r=[];for(const[i,l]of Object.entries(e)){if(i==="_merge")continue;const u=n?`${n}.${i}`:i;typeof l=="string"?r.push({targetPath:u,sourcePath:l}):typeof l=="object"&&l!==null&&!Array.isArray(l)&&r.push(...this.flattenNestedObjectToMappings(l,u))}return r}async updateQueryParams(e,n){B.log("updateQueryParams:",e);const r=new URL(e,window.location.origin),i=new URLSearchParams(r.search);window.history.replaceState(null,"",e),B.log("URL updated via replaceState"),this.currentQueryParams=i,B.log("currentQueryParams updated:",Object.fromEntries(i.entries()));const l=new Sa,u=er().currentDataContext?._global||this.globalState||{},d={route:this.currentRouteParams||{},query:gy(this.currentQueryParams),_global:u},f=Array.isArray(this.currentRawDataSources)&&this.currentRawDataSources.length>0?l.filterByCondition(this.currentRawDataSources,d):this.currentDataSources;this.currentDataSources=f;const g=f.filter(x=>x.auto_fetch!==!1&&x.type!=="websocket");if(g.length===0){B.log("No auto_fetch data sources to refetch");return}B.log(`Refetching ${g.length} auto_fetch data sources`),Ha.setPending(!0);const m=er().currentLayoutJson,b=m?.transition_overlay,v=Array.isArray(b?.wait_for)?b.wait_for:[],S=g.some(x=>(x.loading_strategy||"progressive")==="blocking"),_=v.length>0&&g.some(x=>v.includes(x.id)&&x.type!=="websocket"&&(x.loading_strategy||"progressive")!=="background");if((S||_)&&b&&typeof b=="object"){const x=n?.transitionOverlayTarget||b.target;b.enabled&&b.style==="skeleton"&&b.skeleton?.component&&x?this.renderSkeletonOverlay(x,b.skeleton,m,b.fallback_target):b.enabled&&b.style==="spinner"&&x&&this.renderSpinnerOverlay(x,b.spinner,b.fallback_target)}try{const x=new Sa;this.currentGlobalHeaders.length>0&&x.setGlobalHeaders(this.currentGlobalHeaders);const k=er(),O=k.currentDataContext?._global||{},M=await x.fetchDataSourcesWithResults(g,this.currentRouteParams,this.currentQueryParams,O,void 0,{ignoreAutoFetch:!1}),T={},D={},j=new Map(g.map(H=>[H.id,H]));for(const H of M){const P=j.get(H.id);if(!P){B.warn(`Refetch result id not found in autoFetchDataSources: ${H.id}`);continue}const X=H.id;H.state==="success"&&H.data!==void 0?(this.currentFetchedData[X]=H.data,T[X]=H.data,this.processInitOptions([P],{[X]:H.data},D),B.log(`Data source refetched: ${X}`)):H.state==="error"&&B.error(`Failed to refetch data source: ${X}`,H.error)}if(k.bindingEngine){const H=Object.keys(T);H.push("query"),k.bindingEngine.invalidateCacheByKeys(H)}if(Object.keys(D).length>0&&(T._localInit=D),Object.keys(T).length>0){if(T.query=gy(this.currentQueryParams),k.currentLayoutJson?.computed&&Object.keys(k.currentLayoutJson.computed).length>0){const H={...k.currentDataContext,...T,query:T.query},P=this.calculateComputed(k.currentLayoutJson.computed,H);Object.keys(P).length>0&&(T._computed=P,this.globalState._computed=P,B.log("Computed values recalculated in updateQueryParams:",Object.keys(P)))}hs(T,{sync:!0}),B.log("Template data updated with new query params")}}catch(x){B.error("Error in updateQueryParams:",x)}finally{Ha.setPending(!1),this.hideTransitionOverlay()}}calculateComputed(e,n){const r={},i=new Rn;for(const[l,u]of Object.entries(e))try{let d;if(this.isComputedSwitchDefinition(u))d=i.resolveSwitch(u,n,{skipCache:!0});else if(typeof u=="string")if(u.startsWith("{{")&&u.endsWith("}}")){const f=u.slice(2,-2).trim();d=this.evaluateComputedExpression(f,n)}else d=u;r[l]=d,B.log(`Computed ${l}:`,d)}catch(d){B.warn(`Failed to calculate computed value: ${l}`,d),r[l]=void 0}return r}isComputedSwitchDefinition(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$switch"in e&&"$cases"in e}evaluateComputedExpression(e,n){try{return new Function("ctx",`
|
||
with(ctx) {
|
||
try {
|
||
return ${e};
|
||
} catch (e) {
|
||
return undefined;
|
||
}
|
||
}
|
||
`)(n)}catch(r){B.warn(`Expression evaluation failed: ${e}`,r);return}}async executeInitActions(e,n={}){const{getActionDispatcher:r}=await Promise.resolve().then(()=>Ua),i=r();if(!i){B.warn("ActionDispatcher not available for init_actions");return}B.log("Executing init_actions:",e.map(d=>d.handler)),B.log("Init actions dataContext:",n),B.log("Init actions dataContext._global:",n._global);const l=e.map(d=>d.handler).filter(d=>d.includes("."));l.length>0&&await this.waitForHandlers(i,l);let u={...n};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,u),m=new Event("init");await g(m),B.log(`Init action executed: ${d.handler}`);const b=this.globalState;u={...u,_global:{...b},_local:b._local||u._local||{}},B.log(`Data context refreshed after ${d.handler}:`,{cartKey:u._global?.cartKey})}catch(f){B.error(`Failed to execute init action: ${d.handler}`,f)}}async waitForHandlers(e,n,r=5e3){const i=Date.now(),l=50,u=()=>n.every(f=>e.customHandlers?.has(f));if(u()){B.log("All module handlers already registered");return}const d=gf().getFailedJsAssets();if(d.length>0){const f=d.some(b=>b==="module"||b==="plugin"),g=n.filter(b=>!e.customHandlers?.has(b)),m=g.length>0&&g.every(b=>d.some(v=>b.startsWith(`${v}.`)));if(f||m){B.warn("Extension asset load failed — not waiting for handlers that will never register:",{pending:g,failedAssets:d});return}}return B.log("Waiting for module handlers:",n),new Promise(f=>{const g=()=>{if(u()){B.log("All module handlers now registered"),f();return}if(Date.now()-i>=r){const m=n.filter(b=>!e.customHandlers?.has(b));B.warn("Timeout waiting for handlers:",m),f();return}setTimeout(g,l)};g()})}};$(Ea,"LOCALE_STORAGE_KEY","g7_locale"),$(Ea,"CACHE_VERSION_STORAGE_KEY","g7_cache_version");let _o=Ea;function mf(o){const e=new _o(o);return o.websocket&&(mc.configure(o.websocket),B.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=mf,window.G7Core.dataSource={refetch:async(o,e)=>{const n=window.__templateApp;if(!n){B.warn("TemplateApp not initialized (G7Core.dataSource.refetch)");return}return n.refetchDataSource(o,e)},get:o=>{const e=window.__templateApp;if(!e){B.warn("TemplateApp not initialized (G7Core.dataSource.get)");return}return e.getDataSource(o)}});function cA(o={}){const{checked:e,value:n,name:r,type:i="checkbox"}=o,u=n!==void 0?n:i==="checkbox"||i==="radio"?e??!1:String(e??""),d={checked:e??!1,value:u,name:r??"",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 uA(o={}){const{button:e=0,clientX:n=0,clientY:r=0}=o;return{button:e,clientX:n,clientY:r,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 dA(){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 fA(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 hA={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 py(o){const e=o.replace(/^(dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+/,"");for(const[n,r]of Object.entries(hA))if(r.test(e))return n;return null}function my(o){const e=o.match(/^((dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+)/);return e?e[1]:""}function gA(o,e){if(!e||e.trim()==="")return o;if(!o||o.trim()==="")return e;const n=o.split(/\s+/).filter(Boolean),r=e.split(/\s+/).filter(Boolean),i=new Map;for(const u of r){const d=py(u);if(d){const f=my(u),g=`${d}:${f}`;i.set(g,u)}}return[...n.filter(u=>{const d=py(u);if(!d)return!0;const f=my(u),g=`${d}:${f}`;return!i.has(g)}),...r].join(" ")}function pA(o){return Object.entries(o).filter(([,e])=>e).map(([e])=>e).join(" ")}function mA(...o){return o.filter(e=>typeof e=="string"&&e.length>0).join(" ")}const Se=dt("G7CoreGlobals");function yA(){window.React=Xe,window.ReactDOM={...nd,createPortal:Ar.createPortal,unstable_batchedUpdates:o=>o()},window.ReactJSXRuntime=hC,Se.log("전역 객체 window.React, window.ReactDOM, window.ReactJSXRuntime에 노출됨")}function bA(o){const e=new Map,n=Tr.getInstance();o.componentEvent={on:(r,i)=>(e.has(r)||e.set(r,new Set),e.get(r).add(i),n.trackEventSubscribe(r),()=>{e.get(r)?.delete(i),n.trackEventUnsubscribe(r)}),emit:async(r,i)=>{const l=e.get(r),u=l?.size??0;if(!l||l.size===0)return n.trackEventEmit(r,i,0),[];let d,f=[];try{f=await Promise.all(Array.from(l).map(async g=>{try{return await g(i)}catch(m){throw Se.error(`componentEvent: Error in listener for "${r}":`,m),m}}))}catch(g){d=g instanceof Error?g:new Error(String(g))}if(n.trackEventEmit(r,i,u,f,d),d)throw d;return f},off:r=>{e.delete(r),n.trackEventOff(r)},clear:()=>{e.clear(),n.trackEventClear()}},Se.log("전역 객체 window.G7Core.componentEvent에 노출됨")}function vA(o){o.__runtime||(o.__runtime={DynamicRenderer:ja,ComponentRegistry:fa,TranslationEngine:Er,DataSourceManager:Sa,dataSourceManager:Q_,DataBindingEngine:Rn,dataBindingEngine:aw,ActionDispatcher:fo,TranslationReactContext:of,TranslationProvider:hc,useTranslation:ty,ResponsiveContext:Hd,ResponsiveProvider:ec,useResponsive:zd,responsiveManager:ui,BREAKPOINT_PRESETS:$l,AuthManager:ga,createLogger:dt,G7DevToolsCore:Tr},Se.log("전역 객체 window.G7Core.__runtime(코어 런타임 표면)에 노출됨"))}function SA(o){if(o.layoutEditor&&o.layoutEditor.__isStub!==!0||o.layoutEditor&&o.layoutEditor.__isStub===!0)return;const e=[],n=[];o.layoutEditor={__isStub:!0,__queue:e,__readyCallbacks:n,registerWidget:(r,i)=>e.push(["widget",r,i]),registerNodeEditor:(r,i)=>e.push(["nodeEditor",r,i]),registerCanvasOverlay:(r,i)=>e.push(["canvasOverlay",r,i]),onReady:r=>{typeof r=="function"&&n.push(r)}},Se.log("전역 객체 window.G7Core.layoutEditor 예약 접수함(stub) 노출됨")}function wA(o,e){o.useTranslation=ty,o.t=(n,r)=>{const i=e.getState();if(!i.translationEngine||!i.translationContext)return n;if(r){const l="|"+Object.entries(r).map(([u,d])=>`${u}=${d}`).join("|");return i.translationEngine.translate(n,i.translationContext,l)}return i.translationEngine.translate(n,i.translationContext)},Se.log("전역 객체 window.G7Core.useTranslation에 노출됨")}function CA(o,e){o.createChangeEvent=cA,o.createClickEvent=uA,o.createSubmitEvent=dA,o.createKeyboardEvent=fA,o.uuid=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const r=Math.random()*16|0;return(n==="x"?r:r&3|8).toString(16)}),o.createLogger=dt,Se.log("전역 객체 window.G7Core.createLogger에 노출됨"),o.renderItemChildren=(n,r,i,l,u)=>{const d=e.getState(),m={_global:window.__templateApp?.getGlobalState?.()||{},_local:r._local||{},_computed:r._computed||{},...r},b=new Set,v=(_,x)=>{const k=m._global?._remountKeys;return _&&k?.[_]&&!b.has(_)?(b.add(_),`${_}-remount-${k[_]}`):_||x},S={translationContext:d.translationContext,translationEngine:d.translationEngine,bindingEngine:d.bindingEngine,actionDispatcher:d.actionDispatcher,getRemountKey:v,...u};return no(n,m,i,l,S)},o.getComponentMap=()=>fa.getInstance().getComponentMap(),o.renderComponentLayout=(n,r,i)=>{if(!n||!Array.isArray(n)||n.length===0)return null;const l=fa.getInstance().getComponentMap(),u=e.getState(),f=window.__templateApp?.getGlobalState?.()||{},g={_global:f._global||{},_local:f._local||{},_computed:f._computed||{},...r},m=new Set,b=(v,S)=>{const _=g._global?._remountKeys;return v&&_?.[v]&&!m.has(v)?(m.add(v),`${v}-remount-${_[v]}`):v||S};return no(n,g,l,i,{translationContext:u.translationContext,translationEngine:u.translationEngine,bindingEngine:u.bindingEngine,actionDispatcher:u.actionDispatcher,getRemountKey:b})},o.renderExpandContent=n=>{const{children:r,row:i,expandContext:l,componentContext:u,keyPrefix:d}=n;if(!r||!Array.isArray(r)||r.length===0)return null;const f=n.componentMap||fa.getInstance().getComponentMap(),g=e.getState(),m=o.state?.get?.()||{},b=u?.stateRef?.current??u?.state??{},v={...m._local||{},...b},S=u?.computedRef?.current??m._computed??{},_=g.bindingEngine??o.getDataBindingEngine?.(),x={...m,_local:v,_computed:S,row:i,item:i,$item:i};let k={};if(l&&typeof l=="object"&&_)try{for(const[D,j]of Object.entries(l))if(typeof j=="string"){const H=j.match(/^\{\{([^}]+)\}\}$/);if(H){const P=H[1].trim();try{k[D]=_.evaluateExpression(P,x,{skipCache:!0})}catch{k[D]=void 0}}else k[D]=_.resolveBindings(j,x,{skipCache:!0})}else k[D]=j}catch(D){Se.warn("renderExpandContent: expandContext 평가 오류:",D)}const O={row:i,item:i,$item:i,_local:v,_global:m._global||{},_computed:m._computed||{},...k},M=new Set,T=(D,j)=>{const H=O._global?._remountKeys;return D&&H?.[D]&&!M.has(D)?(M.add(D),`${D}-remount-${H[D]}`):D||j};return no(r,O,f,d,{translationContext:g.translationContext,translationEngine:g.translationEngine??void 0,bindingEngine:g.bindingEngine??void 0,actionDispatcher:g.actionDispatcher,componentContext:u,getRemountKey:T})},o.$get=function(r,i,l=void 0){if(r==null)return l;const u=Array.isArray(i)?i:[i];if(u.length===0)return r;let d=r;for(const f of u){if(d==null||f==null)return l;d=d[f]}return d??l},Se.log("전역 객체 window.G7Core.renderItemChildren에 노출됨"),Se.log("전역 객체 window.G7Core.renderComponentLayout에 노출됨"),Se.log("전역 객체 window.G7Core.renderExpandContent에 노출됨"),Se.log("전역 객체 window.G7Core.$get에 노출됨")}function EA(o){o.dispatch=async(e,n)=>{const r=window.__templateApp;if(!r)return Se.warn("G7Core.dispatch: TemplateApp이 초기화되지 않았습니다."),{success:!1,error:new Error("TemplateApp이 초기화되지 않았습니다.")};const i=r.getActionDispatcher?.();if(!i)return Se.warn("G7Core.dispatch: ActionDispatcher를 찾을 수 없습니다."),{success:!1,error:new Error("ActionDispatcher를 찾을 수 없습니다.")};const l=r.getRouter?.(),u=r.getGlobalState?.(),d=r.setGlobalState?.bind(r),g=n?.componentContext||window.__g7ActionContext,m=window.__g7PendingLocalState;let b=g?.state??u;m&&g&&(b=m,Se.log("[dispatch] Using __g7PendingLocalState for context.state:",m));let v=g?.data??u;m&&g?.data?._local&&(v={...g.data,_local:m},Se.log("[dispatch] Updated context.data._local with pendingLocalState"));const S={navigate:l?(_,x)=>l.navigate(_,x):void 0,setState:g?.setState??d,state:b,data:v,_isDispatchFallbackContext:!g?.setState};if(e.debounce){const _=e.debounceKey||`dispatch-${e.handler}`,x=typeof e.debounce=="number"?e.debounce:e.debounce.delay;return i.debouncedCall(_,x,()=>{const{debounce:k,debounceKey:O,...M}=e;i.dispatchAction(M,S)}),{success:!0,debounced:!0}}try{return await i.dispatchAction(e,S)}catch(_){return Se.error("G7Core.dispatch: 액션 실행 오류:",_),{success:!1,error:_ instanceof Error?_:new Error(String(_))}}},Se.log("전역 객체 window.G7Core.dispatch에 노출됨")}function Ao(o){const e={};for(const[n,r]of Object.entries(o))if(n.includes(".")){const i=n.split(".");let l=e;for(let u=0;u<i.length-1;u++){const d=i[u];d in l?(typeof l[d]!="object"||l[d]===null)&&(l[d]={}):l[d]={},l=l[d]}l[i[i.length-1]]=r}else e[n]=r;return e}function yy(o,e=""){const n=[];if(!o||typeof o!="object")return n;for(const r of Object.keys(o)){const i=e?`${e}.${r}`:r,l=o[r];l&&typeof l=="object"&&!Array.isArray(l)?n.push(...yy(l,i)):n.push(i)}return n}function _A(o){const e=Object.keys(o);return e.length>0&&e.every(n=>/^\d+$/.test(n))}function by(o,e){const n={...o};for(const r of Object.keys(e))r in n?n[r]!==null&&typeof n[r]=="object"&&!Array.isArray(n[r])&&e[r]!==null&&typeof e[r]=="object"&&!Array.isArray(e[r])&&(n[r]=by(n[r],e[r])):n[r]=e[r];return n}function ta(o,e){if(Array.isArray(o)&&!Array.isArray(e)&&_A(e)){const r=Object.keys(e).map(l=>parseInt(l,10));if(!((r.length>0?Math.max(...r):0)>=o.length+r.length+10)){const l=[...o];for(const[u,d]of Object.entries(e)){const f=parseInt(u,10);f>=0&&f<l.length?d!==null&&typeof d=="object"&&!Array.isArray(d)&&l[f]!==null&&typeof l[f]=="object"?l[f]=ta(l[f],d):l[f]=d:f>=l.length&&(l[f]=d)}return l}}const n={...o};for(const[r,i]of Object.entries(e))i!==null&&typeof i=="object"&&!Array.isArray(i)?n[r]!==null&&typeof n[r]=="object"?n[r]=ta(n[r],i):n[r]={...i}:n[r]=i;return n}function AA(o){o.state={get:()=>window.__templateApp?.getGlobalState?.()||{},set:(e,n)=>{const r=window.__templateApp;if(r?.setGlobalState&&r?.getGlobalState){const i=n?.merge||"deep",l=Ao(e);let u;if(i==="replace")u=l;else if(i==="shallow")u={...r.getGlobalState(),...l};else{const d=r.getGlobalState();u=ta(d,l)}r.setGlobalState(u,{render:n?.render})}else Se.warn("G7Core.state.set: TemplateApp이 초기화되지 않았습니다.")},setLocal:(e,n)=>{const r=window.__templateApp;if(n?.render===!1&&!n?.selfManaged){const k=window.__g7AutoBindingPaths;k&&k.size>0&&yy(Ao(e)).some(M=>k.has(M))&&(Se.log("[setLocal] render:false + 자동바인딩 경로 겹침 감지 → render:true 자동 승격 (engine-v1.43.0)"),n={...n,render:!0})}if(n?.debounce){const k=r?.getActionDispatcher?.();if(k){const O=n.debounceKey||`setLocal-${Object.keys(e).join(",")}`,{debounce:M,debounceKey:T,...D}=n;k.debouncedCall(O,n.debounce,()=>{o.state.setLocal(e,D)});return}}const i=n?.scope??"current",l=n?.merge||"deep",u=window.__g7ActionContext,d=Ao(e);if(i==="parent"||i==="root"){const k=window.__g7LayoutContextStack||[];if(k.length>0){const O=i==="parent"?k[k.length-1]:k[0];if(O?.setState){O.setState(M=>l==="replace"?d:l==="shallow"?{...M||{},...d}:ta(M||{},d)),Se.log(`[setLocal] scope=${i}: 타겟 컨텍스트에 상태 업데이트 (mergeMode=${l})`,d);return}}Se.warn(`[setLocal] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const f=window.__g7PendingLocalState,g=r?.getGlobalState?.()?._local||{},v=!((window.__g7LayoutContextStack||[]).length>0)&&u?.state?u.state:void 0,S=v?by(g,v):g,_=f||S;let x;if(l==="replace"?x=d:l==="shallow"?x={..._,...d}:x=ta(_,d),r?.setGlobalState&&(r.setGlobalState({_local:x},{render:n?.render}),Se.log(`[setLocal] globalLocal updated via setGlobalState (mergeMode=${l}, render=${n?.render??!0}):`,d)),window.__g7PendingLocalState=x,Se.log("[setLocal] __g7PendingLocalState updated:",x),window.__g7SequenceLocalSync=x,window.__g7LastSetLocalSnapshot=x,l==="replace")window.__g7ForcedLocalFields=d;else{const k=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=ta(k,d)}if(Se.log("[setLocal] __g7ForcedLocalFields updated:",d),l==="replace")window.__g7SetLocalOverrideKeys=d;else{const k=window.__g7SetLocalOverrideKeys||{};window.__g7SetLocalOverrideKeys=ta(k,d)}Se.log("[setLocal] __g7SetLocalOverrideKeys updated:",d),u?.setState&&u.setState(k=>l==="replace"?d:l==="shallow"?{...k||{},...d}:ta(k||{},d)),r?.setGlobalState||Se.warn("G7Core.state.setLocal: TemplateApp이 없습니다.")},getLocal:()=>{const r=(window.__templateApp?.getGlobalState?.()||{})._local||{},i=window.__g7PendingLocalState;if(i)return ta(r,i);const l=window.__g7LastSetLocalSnapshot;return l&&l!==r?ta(r,l):r},update:e=>{const n=window.__templateApp;if(n?.getGlobalState&&n?.setGlobalState){const r=n.getGlobalState(),i=e(r);n.setGlobalState(i)}else Se.warn("G7Core.state.update: TemplateApp이 초기화되지 않았습니다.")},subscribe:e=>{const n=window.__templateApp;return n?.onGlobalStateChange?n.onGlobalStateChange(e):(Se.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,n,r)=>{let i,l,u;typeof e=="string"?(i=e,l=n||{},u=r):(l=e,u=n&&typeof n=="object"&&"merge"in n?n:r);const d=u?.merge||"deep",f=Ao(l);if(i){const b=window.__g7IsolatedStates?.[i];b?.mergeState?b.mergeState(f,d):Se.warn(`G7Core.state.setIsolated: scopeId '${i}'를 찾을 수 없습니다.`);return}const g=window.__g7ActionContext;g?.isolatedContext?.mergeState?g.isolatedContext.mergeState(f,d):Se.warn("G7Core.state.setIsolated: 액션 컨텍스트에 isolatedContext가 없습니다.")},getParent:()=>{const e=window.__g7LayoutContextStack||[];if(e.length===0)return Se.log("[getParent] 레이아웃 컨텍스트 스택이 비어있습니다."),null;const n=e[e.length-1];if(!n)return null;const r=n.dataContext||{};return{_local:n.state||r._local||{},_global:r._global||o.state.get()||{},setState:n.setState}},setParentLocal:(e,n,r)=>{const i=window.__g7LayoutContextStack||[];if(i.length===0){Se.warn("[setParentLocal] 레이아웃 컨텍스트 스택이 비어있습니다.");return}const l=i[i.length-1];if(!l?.setState){Se.warn("[setParentLocal] 부모 컨텍스트에 setState가 없습니다.");return}let u,d;typeof e=="string"?(u={[e]:n},d=r):(u=e,d=n&&typeof n=="object"&&"merge"in n?n:r);const f=d?.merge||"deep",g=Ao(u),m=l.state?._local!==void 0,b=m?l.state._local:l.state||{};let v;f==="replace"?v=g:f==="shallow"?v={...b,...g}:v=ta(b,g),window.__g7PendingLocalState=v;const S=window.__templateApp;if(S?.setGlobalState&&S.setGlobalState({_local:v}),l.setState(v),m?l.state._local=v:l.state=v,l.dataContext&&(l.dataContext._local=v),f==="replace")window.__g7ForcedLocalFields=g;else{const _=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=ta(_,g)}$d()},setParentGlobal:(e,n)=>{let r;typeof e=="string"?r={[e]:n}:r=e,o.state.set(r),Se.log("[setParentGlobal] 전역 상태 업데이트:",r)}},window.__g7IsolatedStates||(window.__g7IsolatedStates={}),o.state.getGlobal=o.state.get,o.state.setGlobal=o.state.set,Se.log("전역 객체 window.G7Core.state에 노출됨")}function xA(o){o.dataSource={get:e=>window.__templateApp?.getDataSource?.(e),set:(e,n,r)=>{const i=window.__templateApp;i?.setDataSource?i.setDataSource(e,n,r):Se.warn("G7Core.dataSource.set: TemplateApp이 초기화되지 않았습니다.")},refetch:async(e,n)=>{const r=window.__templateApp;if(r?.refetchDataSource)return r.refetchDataSource(e,n);Se.warn("G7Core.dataSource.refetch: TemplateApp이 초기화되지 않았습니다.")},updateItem:(e,n,r,i,l)=>{const u=window.__templateApp;return u?.updateDataSourceItem?u.updateDataSourceItem(e,n,r,i,l):(Se.warn("G7Core.dataSource.updateItem: TemplateApp이 초기화되지 않았습니다."),!1)},updateData:(e,n,r,i="append")=>{const l=window.__templateApp;if(!l?.getDataSource||!l?.setDataSource)return Se.warn("G7Core.dataSource.updateData: TemplateApp이 초기화되지 않았습니다."),!1;const u=l.getDataSource(e);if(!u)return Se.warn(`G7Core.dataSource.updateData: 데이터 소스 '${e}'를 찾을 수 없습니다.`),!1;let d,f=u,g=null;if(n){const b=n.split(".");g=b.pop();for(const v of b)if(f&&typeof f=="object"&&v in f)f=f[v];else return Se.warn(`G7Core.dataSource.updateData: 경로 '${n}'를 찾을 수 없습니다.`),!1;d=f[g]}else d=u;if(!Array.isArray(d))return Se.warn("G7Core.dataSource.updateData: 대상 경로의 데이터가 배열이 아닙니다."),!1;if(!Array.isArray(r))return Se.warn("G7Core.dataSource.updateData: newData가 배열이 아닙니다."),!1;const m=i==="prepend"?[...r,...d]:[...d,...r];return n&&g?(f[g]=m,l.setDataSource(e,u,{merge:!1})):l.setDataSource(e,m,{merge:!1}),Se.log(`G7Core.dataSource.updateData: '${e}'에 ${r.length}개 항목 ${i==="prepend"?"앞에":"뒤에"} 추가됨`),!0}},Se.log("전역 객체 window.G7Core.dataSource에 노출됨")}function TA(o,e){o.locale={current:()=>window.__templateApp?.getLocale?.()||"ko",supported:()=>{const r=window.__templateApp?.globalState?.appConfig?.supportedLocales;return Array.isArray(r)&&r.length>0?r:e.getState().templateMetadata?.locales||["ko","en"]},change:async n=>{const r=window.__templateApp;r?.changeLocale?await r.changeLocale(n):Se.warn("G7Core.locale.change: TemplateApp이 초기화되지 않았습니다.")}},Se.log("전역 객체 window.G7Core.locale에 노출됨")}function RA(o){o.toast={show:(e,n)=>{o.dispatch({handler:"toast",params:{message:e,type:n?.type||"info",...n?.duration&&{duration:n.duration}}})},success:(e,n)=>{o.toast.show(e,{type:"success",duration:n})},error:(e,n)=>{o.toast.show(e,{type:"error",duration:n})},warning:(e,n)=>{o.toast.show(e,{type:"warning",duration:n})},info:(e,n)=>{o.toast.show(e,{type:"info",duration:n})}},Se.log("전역 객체 window.G7Core.toast에 노출됨")}function kA(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 n=o.state.get();return n._global?.activeModal===e||n._global?.modalStack?.includes(e)||!1},getStack:()=>o.state.get()._global?.modalStack||[]},Se.log("전역 객체 window.G7Core.modal에 노출됨")}function DA(o){o.style={mergeClasses:gA,conditionalClass:pA,joinClasses:mA},Se.log("전역 객체 window.G7Core.style에 노출됨")}function OA(o,e){const{webSocketManager:n}=e;o.websocket={manager:n,subscribe:(r,i,l,u)=>n.subscribe(r,i,l,u),unsubscribe:r=>n.unsubscribe(r),leaveChannel:r=>n.leaveChannel(r),disconnect:()=>n.disconnect(),isInitialized:()=>n.isInitialized(),getSubscriptionCount:()=>n.getSubscriptionCount()},Se.log("전역 객체 window.G7Core.websocket에 노출됨")}function LA(o,e){const{transitionManager:n}=e;o.navigation={isPending:()=>n?.getIsPending?.()||!1,onComplete:r=>{if(!n)return r(),()=>{};let i=n.getIsPending();const l=n.subscribe(u=>{u?i=!0:i&&(r(),l())});return l}},Se.log("전역 객체 window.G7Core.navigation에 노출됨")}function MA(o){o.plugin={getSettings:e=>window.G7Config?.plugins?.[e],get:(e,n,r)=>window.G7Config?.plugins?.[e]?.[n]??r,getAll:()=>window.G7Config?.plugins??{}},Se.log("전역 객체 window.G7Core.plugin에 노출됨")}function $A(o){o.module={getSettings:e=>window.G7Config?.modules?.[e],get:(e,n,r)=>window.G7Config?.modules?.[e]?.[n]??r,getAll:()=>window.G7Config?.modules??{}},Se.log("전역 객체 window.G7Core.module에 노출됨")}function NA(o,e){const{transitionManager:n,responsiveManager:r}=e;o.AuthManager=ga,o.api=Ia(),o.TransitionManager=n,o.useTransitionState=dm,o.ResponsiveManager=r,o.useResponsive=zd,o.useControllableState=_C,o.shallowArrayEqual=AC,o.shallowObjectEqual=hm,o.updateQueryParams=async(i,l)=>{const u=window.__templateApp;if(u?.updateQueryParams)return u.updateQueryParams(i,l);Se.warn("G7Core.updateQueryParams: TemplateApp이 초기화되지 않았습니다.")},Se.log("전역 객체 window.G7Core.AuthManager에 노출됨"),Se.log("전역 객체 window.G7Core.api에 노출됨"),Se.log("전역 객체 window.G7Core.ResponsiveManager에 노출됨"),Se.log("전역 객체 window.G7Core.useResponsive에 노출됨"),Se.log("전역 객체 window.G7Core.useControllableState에 노출됨"),Se.log("전역 객체 window.G7Core.updateQueryParams에 노출됨")}function IA(o,e){o.getSlotContext=()=>window.__slotContextValue??null,o.getDynamicRenderer=()=>window.__DynamicRenderer??null,o.getComponentRegistry=()=>e.getComponentRegistry?.()??fa.getInstance(),o.getDataBindingEngine=()=>e.getDataBindingEngine?.()??e.getState().bindingEngine,o.getTranslationEngine=()=>e.getTranslationEngine?.()??e.getState().translationEngine,o.getActionDispatcher=()=>e.getActionDispatcher?.()??e.getState().actionDispatcher,Se.log("전역 객체 window.G7Core 슬롯 API에 노출됨 (getSlotContext, getDynamicRenderer 등)")}function HA(o){o.identity={setLauncher:wt.setLauncher.bind(wt),handle:wt.handle.bind(wt),isIdentityRequired:wt.isIdentityRequired.bind(wt),hasLauncher:wt.hasLauncher.bind(wt),markDomainNoticeShown:wt.markDomainNoticeShown.bind(wt),redirectExternally:wt.redirectExternally.bind(wt),createDeferred:wt.createDeferred.bind(wt),resolveDeferred:wt.resolveDeferred.bind(wt),reset:wt.reset.bind(wt),redirectStashKey:Rd},Se.log("전역 객체 window.G7Core 본인인증(IDV) API에 노출됨 (identity)")}function zA(o){if(typeof window>"u")return;yA(),window.G7Core||(window.G7Core={});const e=window.G7Core;vA(e),bA(e),SA(e),NA(e,o),wA(e,o),CA(e,o),EA(e),AA(e),xA(e),TA(e,o),RA(e),kA(e),DA(e),OA(e,o),LA(e,o),MA(e),$A(e),IA(e,o),HA(e),Se.log("G7Core 전역 객체 초기화 완료")}function jA(){const o=window.G7Core;if(!o){Se.warn("G7Core가 초기화되지 않았습니다.");return}const e=()=>Tr.getInstance(),n={isEnabled:()=>{try{return e().isEnabled()}catch{return!1}},trackRender:r=>{try{e().isEnabled()&&e().trackRender(r)}catch{}},trackIteration:(r,i,l,u,d)=>{try{e().isEnabled()&&e().trackIteration(r,{source:i,itemVar:l,indexVar:u,sourceLength:d})}catch{}},trackIfCondition:(r,i,l,u)=>{try{e().isEnabled()&&e().trackIfCondition(r,i,l)}catch{}},trackMount:(r,i)=>{try{e().isEnabled()&&e().trackMount(r,{...i,id:r})}catch{}},trackUnmount:r=>{try{e().isEnabled()&&e().trackUnmount(r)}catch{}},trackExpressionEval:r=>{try{e().isEnabled()&&e().trackExpressionEval(r)}catch{}},trackBindingEval:r=>{try{e().isEnabled()&&e().trackBindingEval(r)}catch{}},recordCacheHit:()=>{try{e().isEnabled()&&e().recordCacheHit()}catch{}},recordCacheMiss:()=>{try{e().isEnabled()&&e().recordCacheMiss()}catch{}},trackHandlerRegistration:(r,i,l,u)=>{try{e().isEnabled()&&e().trackHandlerRegistration(r,i,l,u)}catch{}},trackHandlerUnregistration:r=>{try{e().isEnabled()&&e().trackHandlerUnregistration(r)}catch{}},logAction:r=>{try{e().isEnabled()&&e().logAction(r)}catch{}},trackRequest:(r,i)=>{try{return e().isEnabled()?e().trackRequest(r,i):""}catch{return""}},completeRequest:(r,i,l)=>{try{e().isEnabled()&&e().completeRequest(r,i,l)}catch{}},failRequest:(r,i)=>{try{e().isEnabled()&&e().failRequest(r,i)}catch{}},trackDataSourceDefinition:r=>{try{e().isEnabled()&&e().trackDataSourceDefinition(r)}catch{}},trackDataSourceLoading:r=>{try{e().isEnabled()&&e().trackDataSourceLoading(r)}catch{}},trackDataSourceLoaded:(r,i,l)=>{try{e().isEnabled()&&e().trackDataSourceLoaded(r,i,l)}catch{}},trackDataSourceError:(r,i)=>{try{e().isEnabled()&&e().trackDataSourceError(r,i)}catch{}},trackForm:(r,i,l)=>{try{e().isEnabled()&&e().trackForm(r,i,l)}catch{}},untrackForm:r=>{try{e().isEnabled()&&e().untrackForm(r)}catch{}},startStateChange:(r,i,l,u)=>{try{return e().isEnabled()?e().startStateChange(r,i,l,u):""}catch{return""}},completeStateChange:r=>{try{e().isEnabled()&&e().completeStateChange(r)}catch{}},trackComponentRender:(r,i,l,u,d,f)=>{try{e().isEnabled()&&e().trackComponentRender(r,i,l,u,d,f)}catch{}},updateLocalState:r=>{try{e().isEnabled()&&e().updateLocalState(r)}catch{}},updateComputedState:r=>{try{e().isEnabled()&&e().updateComputedState(r)}catch{}},updateParentContext:r=>{try{e().isEnabled()&&e().updateParentContext(r)}catch{}},trackComponentStateSource:(r,i,l,u)=>{try{e().isEnabled()&&e().trackComponentStateSource(r,i,l,u)}catch{}},trackDynamicState:(r,i)=>{try{e().isEnabled()&&e().trackDynamicState(r,i)}catch{}},trackContextFlow:(r,i,l,u,d,f)=>{try{e().isEnabled()&&e().trackContextFlow(r,i,l,u,d,f)}catch{}},trackComponentStyle:(r,i,l,u)=>{try{e().isEnabled()&&e().trackComponentStyle(r,i,l,u)}catch{}},trackAuthEvent:(r,i,l,u)=>{try{e().isEnabled()&&e().trackAuthEvent(r,i,l,u)}catch{}},trackAuthHeader:(r,i,l,u,d)=>{try{e().isEnabled()&&e().trackAuthHeader(r,i,l,u,d)}catch{}},trackLog:(r,i,l)=>{try{e().isEnabled()&&e().trackLog(r,i,l)}catch{}},trackAction:r=>{try{e().isEnabled()&&e().trackAction?.(r)}catch{}},trackDataSourceUpdate:r=>{try{e().isEnabled()&&e().trackDataSourceUpdate?.(r)}catch{}},startSequenceExecution:r=>{try{return e().isEnabled()?e().startSequenceExecution(r):""}catch{return""}},captureSequenceActionBefore:(r,i,l,u,d)=>{try{e().isEnabled()&&e().captureSequenceActionBefore(r,i,l,u,d)}catch{}},captureSequenceActionAfter:(r,i,l,u,d,f)=>{try{e().isEnabled()&&e().captureSequenceActionAfter(r,i,l,u,d,f)}catch{}},endSequenceExecution:(r,i)=>{try{e().isEnabled()&&e().endSequenceExecution(r,i)}catch{}},registerStateCaptureForHandler:(r,i,l)=>{try{e().isEnabled()&&e().registerStateCaptureForHandler(r,i,l)}catch{}},detectStaleClosure:(r,i,l,u,d)=>{try{return e().isEnabled()?e().detectStaleClosure(r,i,l,u,d):[]}catch{return[]}},trackStaleClosureWarning:r=>{try{e().isEnabled()&&e().trackStaleClosureWarning(r)}catch{}},trackModalOpen:r=>{try{e().isEnabled()&&e().trackModalOpen(r)}catch{}},trackModalClose:(r,i)=>{try{e().isEnabled()&&e().trackModalClose(r,i)}catch{}},trackModalStateChange:r=>{try{e().isEnabled()&&e().trackModalStateChange(r)}catch{}},trackNestedContext:r=>{try{return e().isEnabled()?e().trackNestedContext(r):""}catch{return""}},trackNestedContextAccess:(r,i)=>{try{e().isEnabled()&&e().trackNestedContextAccess(r,i)}catch{}},trackComputedProperty:(r,i,l,u,d,f,g)=>{try{e().isEnabled()&&e().trackComputedProperty(r,i,l,u,d,f,g)}catch{}},trackComputedRecalc:(r,i,l,u,d,f,g)=>{try{e().isEnabled()&&e().trackComputedRecalc(r,i,l,u,d,f,g)}catch{}},setNamedActionDefinitions:r=>{try{e().isEnabled()&&e().setNamedActionDefinitions(r)}catch{}},trackNamedActionRef:r=>{try{e().isEnabled()&&e().trackNamedActionRef(r)}catch{}}};o.devTools=n,Se.log("G7Core.devTools 인터페이스 초기화 완료")}let xo=null;function UA(){const o=window.G7Core;return o?.__devtools?Promise.resolve(o.__devtools):xo||(xo=new Promise((e,n)=>{const r=window.G7Config?.coreDevToolsAsset||"/build/core/devtools.min.js",i="g7-devtools-bundle",l=()=>{const f=window.G7Core?.__devtools;f?e(f):n(new Error("DevTools 번들 로드됨 — 그러나 __devtools 미노출"))};window.G7Core=window.G7Core||{},window.G7Core.__onDevToolsReady=l;const u=document.getElementById(i);if(u){u.addEventListener("load",l,{once:!0}),u.addEventListener("error",()=>n(new Error(`DevTools 번들 로드 실패: ${r}`)),{once:!0});return}const d=document.createElement("script");d.id=i,d.src=r,d.async=!1,d.addEventListener("load",l,{once:!0}),d.addEventListener("error",()=>{xo=null,n(new Error(`DevTools 번들 로드 실패: ${r}`))},{once:!0}),document.head.appendChild(d)}),xo)}function BA(){const o=window.G7Core;if(!o){Se.warn("G7Core가 초기화되지 않았습니다.");return}const e=Tr.getInstance();if(e.initialize(),!e.isEnabled()){window.G7DevTools={isEnabled:()=>!1,enable:()=>{Se.log("환경설정 > 고급 설정 > 디버그 모드를 켜세요")}},rd(),Se.log("G7DevTools 비활성화됨 (디버그 모드 꺼짐)");return}PA(o,e)}async function PA(o,e){let n;try{n=await UA()}catch(g){Se.warn("DevTools 번들 로드 실패 — 최소 API 로 폴백:",g),window.G7DevTools={isEnabled:()=>!1,enable:()=>{}},rd();return}const{DiagnosticEngine:r,getServerConnector:i,getStyleTracker:l}=n;jA(),rd();try{l().enable(),Se.log("StyleTracker 활성화됨")}catch(g){Se.warn("StyleTracker 활성화 실패:",g)}const u=new r,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){Se.warn("DataBindingEngine이 없습니다.");return}return m.evaluateExpression(g,e.getState())},getCacheStats:()=>e.getCacheStats(),clearStats:()=>{e.resetCacheStats(),Se.log("캐시 통계 초기화됨")}},diagnose:{analyze:g=>u.analyze(g),suggestFix:g=>u.suggestFix(g),getCommonIssues:()=>u.getCommonIssues(),getRulesByCategory:g=>u.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,Se.log("G7DevTools 전역 객체 초기화 완료 (window.G7DevTools)"),qA(n.DevToolsPanel)}function qA(o){if(document.getElementById("g7-devtools-root")){Se.log("DevToolsPanel 이미 렌더링됨");return}const e=document.createElement("div");e.id="g7-devtools-root",document.body.appendChild(e);try{nd.createRoot(e).render(Xe.createElement(o)),Se.log("DevToolsPanel UI 렌더링 완료")}catch(n){Se.error("DevToolsPanel UI 렌더링 실패:",n)}}const et=dt("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 To=!1;const Ro=[];async function GA(o){try{et.log("템플릿 메타데이터 로드 중...",o);const e=o.split("-").map(r=>r.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")).join(""),n=window[e];return n?.templateMetadata?(et.log("템플릿 메타데이터 로드 완료 (전역 변수)",n.templateMetadata),n.templateMetadata):(et.warn(`템플릿 번들에 메타데이터가 없습니다. 전역 변수: ${e}`),{identifier:o,locales:["ko","en"],name:{ko:o,en:o},description:{ko:"",en:""},version:"1.0.0",type:"admin"})}catch(e){return et.error("템플릿 메타데이터 로드 실패",e),{identifier:o,locales:["ko","en"],name:{ko:o,en:o},description:{ko:"",en:""},version:"1.0.0",type:"admin"}}}function vy(){const e=(typeof window<"u"?window.__templateApp:void 0)?.globalState?.appConfig?.supportedLocales,n=re.templateMetadata?.locales;return{$locale:re.locale,$locales:Array.isArray(e)&&e.length>0?e:n||["ko","en"],$templateLocales:n||["ko","en"],$templateId:re.templateId}}async function ko(o){try{if(et.log("템플릿 엔진 초기화 시작",o),re.isInitialized)throw new Error("템플릿 엔진이 이미 초기화되었습니다. destroyTemplate()을 먼저 호출하세요.");if(!o.templateId)throw new eA;To=o.debug??!1,typeof window<"u"&&(window.G7Config||(window.G7Config={}),window.G7Config.debug=To),BA(),re.templateId=o.templateId,re.locale=o.locale||"ko",et.log("엔진 인스턴스 생성 중..."),re.registry=fa.getInstance(),re.bindingEngine=new Rn,re.translationEngine=Er.getInstance(),o.cacheVersion!==void 0&&o.cacheVersion>0&&re.translationEngine.setCacheVersion(o.cacheVersion),re.translationContext={templateId:o.templateId,locale:re.locale},re.actionDispatcher=new fo({},re.translationEngine,re.translationContext),mC(re.actionDispatcher),et.log("다국어 파일 로드 중...",o.templateId,re.locale);const e="en",n=[re.translationEngine.loadTranslations(o.templateId,re.locale).then(()=>{et.log(`다국어 파일 로드 완료: ${re.locale}`)}).catch(r=>{et.warn(`다국어 파일 로드 실패 (${re.locale}):`,r instanceof Error?r.message:r)})];re.locale!==e&&n.push(re.translationEngine.loadTranslations(o.templateId,e).then(()=>{et.log(`폴백 다국어 파일 로드 완료: ${e}`)}).catch(r=>{et.warn(`폴백 다국어 파일 로드 실패 (${e}):`,r instanceof Error?r.message:r)})),await Promise.allSettled(n),et.log("템플릿 메타데이터 로드 중...",o.templateId),re.templateMetadata=await GA(o.templateId),re.isInitialized=!0,et.log("템플릿 엔진 초기화 완료 (ComponentRegistry는 별도 로드)")}catch(e){throw et.error("템플릿 엔진 초기화 실패",e),re.isInitialized=!1,re.registry=null,re.bindingEngine=null,re.translationEngine=null,re.actionDispatcher=null,e}}let Do=null;function yf(){const o=window.G7Core;return o?.__LayoutEditorChrome?Promise.resolve(o.__LayoutEditorChrome):Do||(Do=new Promise((e,n)=>{const r=window.G7Config?.coreEditorAsset||"/build/core/layout-editor.min.js",i="g7-layout-editor-bundle",l=document.getElementById(i),u=()=>{const f=window.G7Core?.__LayoutEditorChrome;f?e(f):n(new Error("편집기 번들 로드됨 — 그러나 __LayoutEditorChrome 미노출"))};if(window.G7Core=window.G7Core||{},window.G7Core.__onChromeReady=u,l){l.addEventListener("load",u,{once:!0}),l.addEventListener("error",()=>n(new Error(`편집기 번들 로드 실패: ${r}`)),{once:!0});return}const d=document.createElement("script");d.id=i,d.src=r,d.async=!1,d.addEventListener("load",u,{once:!0}),d.addEventListener("error",()=>{Do=null,n(new Error(`편집기 번들 로드 실패: ${r}`))},{once:!0}),document.head.appendChild(d)}),Do)}async function fs(o){try{if(et.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 n=vy();if(re.containerId=o.containerId,re.currentLayoutJson=o.layoutJson,re.currentDataContext={...n,...o.dataContext||{}},re.translationContext=o.translationContext||{templateId:re.templateId||"",locale:re.locale},re.reactRoot||(et.log("React Root 생성"),re.reactRoot=nd.createRoot(e)),typeof window<"u"){const l=hy(window.location.pathname);if(l){et.log("레이아웃 편집기 모드 진입",l);let u;try{u=await yf()}catch(f){et.error("레이아웃 편집기 번들 로드 실패",f),ff.render(o.containerId,{title:"레이아웃 편집기 로드 실패",message:f instanceof Error?f.message:"편집기 번들을 불러오지 못했습니다.",icon:"fas fa-triangle-exclamation",showStack:!1,showReloadButton:!0,debug:To});return}const d=Xe.createElement(u,{templateIdentifier:l.templateIdentifier,initialLocale:re.locale});re.reactRoot.render(Xe.createElement(hc,{translationEngine:re.translationEngine,translationContext:re.translationContext,children:Xe.createElement(Nd,{children:Xe.createElement(ec,{children:Xe.createElement(lf,{children:d})})})}));return}}const r=o.layoutJson.components||[];if(r.length===0){et.warn("렌더링할 컴포넌트가 없습니다.");return}const i=o.layoutJson.modals||[];if(et.log("modals 배열:",i),et.log("modals 개수:",i.length),et.log("DynamicRenderer로 렌더링 시작"),re.reactRoot.render(Xe.createElement(hc,{translationEngine:re.translationEngine,translationContext:re.translationContext},Xe.createElement(Nd,null,Xe.createElement(ec,null,Xe.createElement(lf,null,[...r.map((l,u)=>{const d=re.currentLayoutJson?.layout_name||"";return Xe.createElement(ja,{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:u===0,layoutKey:d})}),Xe.createElement(sm,{key:"__modal_parent_context_provider"},i.map(l=>{const u=re.currentDataContext._global?.modalStack||[],f=u.includes(l.id)||re.currentDataContext._global?.activeModal===l.id,g=u.indexOf(l.id),m=g>=0?50+g:50,b=window.__g7LayoutContextStack||[],S=b[b.length-1]?.dataContext,_=Xe.createElement(ja,{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?Xe.createElement(dy,{key:`modal_${l.id}`,isOpen:f,modalId:l.id,dataSources:l.data_sources,dataContext:re.currentDataContext,globalStateUpdater:re.actionDispatcher?.getGlobalStateUpdater(),bindingEngine:re.bindingEngine,debug:To,children:_}):_}))]))))),et.log("템플릿 렌더링 완료"),Ro.length>0){et.log(`대기 중인 데이터 업데이트 ${Ro.length}건 적용`);const l=[...Ro];Ro.length=0;for(const{data:u,options:d}of l)hs(u,d)}}catch(e){throw et.error("템플릿 렌더링 실패",e),e}}function hs(o,e){try{if(et.log("템플릿 데이터 업데이트 시작",Object.keys(o)),!re.isInitialized)throw new Error("템플릿 엔진이 초기화되지 않았습니다.");if(!re.reactRoot||!re.currentLayoutJson){et.log("React 미준비 - 데이터 업데이트 큐잉:",Object.keys(o)),Ro.push({data:o,options:e});return}const n=vy(),r={...re.currentDataContext._global||{},...o._global||{}},i=CC(re.currentDataContext._localInit,o._localInit);re.currentDataContext={...n,...re.currentDataContext,...o,_global:r,_localInit:i},r._local!==void 0&&(re.currentDataContext._local=r._local),r._computed!==void 0&&(re.currentDataContext._computed=r._computed);const l=re.currentLayoutJson.components||[],u=re.currentLayoutJson.modals||[];et.log("updateTemplateData - modals 배열:",u),et.log("updateTemplateData - modals 개수:",u.length),et.log("updateTemplateData - activeModal:",re.currentDataContext._global?.activeModal);const d=()=>{re.reactRoot.render(Xe.createElement(hc,{translationEngine:re.translationEngine,translationContext:re.translationContext},Xe.createElement(Nd,null,Xe.createElement(ec,null,Xe.createElement(lf,null,[...l.map((f,g)=>{const m=re.currentLayoutJson?.layout_name||"";return Xe.createElement(ja,{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})}),Xe.createElement(sm,{key:"__modal_parent_context_provider_update"},u.map(f=>{const g=re.currentDataContext._global?.modalStack||[],b=g.includes(f.id)||re.currentDataContext._global?.activeModal===f.id,v=g.indexOf(f.id),S=v>=0?50+v:50,_=window.__g7LayoutContextStack||[],k=_[_.length-1]?.dataContext,O=Xe.createElement(ja,{key:`modal_${f.id}_renderer`,componentDef:{...f,props:{...f.props,isOpen:b,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:k});return f.data_sources&&f.data_sources.length>0?Xe.createElement(dy,{key:`modal_${f.id}`,isOpen:b,modalId:f.id,dataSources:f.data_sources,dataContext:re.currentDataContext,globalStateUpdater:re.actionDispatcher?.getGlobalStateUpdater(),bindingEngine:re.bindingEngine,debug:To,children:O}):O}))])))))};e?.sync?(et.log("재렌더링 시작 (sync mode - 즉시 렌더링)"),d()):(et.log("재렌더링 시작 (with startTransition)"),I.startTransition(()=>{d()})),et.log("템플릿 데이터 업데이트 완료")}catch(n){throw et.error("템플릿 데이터 업데이트 실패",n),n}}function Sc(){try{et.log("템플릿 정리 시작"),re.reactRoot&&(et.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,et.log("템플릿 정리 완료")}catch(o){throw et.error("템플릿 정리 실패",o),o}}function er(){return Object.freeze({...re})}function Sy(){return re.actionDispatcher}const Oo={initTemplateEngine:ko,renderTemplate:fs,updateTemplateData:hs,destroyTemplate:Sc,getState:er};typeof window<"u"&&(window.G7Core||(window.G7Core={}),window.G7Core.TemplateEngine=Oo,zA({getState:()=>({translationEngine:re.translationEngine,translationContext:re.translationContext,bindingEngine:re.bindingEngine,actionDispatcher:re.actionDispatcher,templateMetadata:re.templateMetadata}),transitionManager:Ha,responsiveManager:ui,webSocketManager:mc}),et.log("전역 객체 window.G7Core.TemplateEngine에 노출됨"));const Ua=Object.freeze(Object.defineProperty({__proto__:null,DataSourceManager:Sa,LayoutLoader:sf,TemplateApp:_o,TemplateEngine:Oo,default:Oo,destroyTemplate:Sc,getActionDispatcher:Sy,getState:er,initTemplateApp:mf,initTemplateEngine:ko,loadLayoutEditorBundle:yf,renderTemplate:fs,updateTemplateData:hs},Symbol.toStringTag,{value:"Module"}));Xt.DataSourceManager=Sa,Xt.LayoutLoader=sf,Xt.TemplateApp=_o,Xt.TemplateEngine=Oo,Xt.default=Oo,Xt.destroyTemplate=Sc,Xt.getActionDispatcher=Sy,Xt.getState=er,Xt.initTemplateApp=mf,Xt.initTemplateEngine=ko,Xt.loadLayoutEditorBundle=yf,Xt.renderTemplate=fs,Xt.updateTemplateData=hs,Object.defineProperties(Xt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})(this.G7Core=this.G7Core||{});
|
||
//# sourceMappingURL=template-engine.min.js.map
|