From 05db17887df5834b0de439371196728256c71582 Mon Sep 17 00:00:00 2001
From: HeuJung
- Component not found: ${e}
+
diff --git a/app/Console/Commands/Core/CoreUpdateCommand.php b/app/Console/Commands/Core/CoreUpdateCommand.php
index a5fde397..42d32503 100644
--- a/app/Console/Commands/Core/CoreUpdateCommand.php
+++ b/app/Console/Commands/Core/CoreUpdateCommand.php
@@ -3,6 +3,7 @@
namespace App\Console\Commands\Core;
use App\Console\Commands\Core\Concerns\BundledExtensionUpdatePrompt;
+use App\Exceptions\UpgradeHandoffException;
use App\Extension\CoreVersionChecker;
use App\Extension\Helpers\CoreBackupHelper;
use App\Extension\ModuleManager;
@@ -438,11 +439,85 @@ class CoreUpdateCommand extends Command
$this->newLine();
$this->info('일괄 업데이트로 생성된 파일의 소유권을 복원하는 중...');
$service->restoreOwnership($ownershipSnapshot, $onProgress);
+ // restoreOwnership 의 진행 표시($onProgress → $bar->display())가
+ // 개행 없이 끝나므로 다음 셸 프롬프트가 같은 줄에 붙는 것을 방지.
+ $this->newLine(2);
$log('일괄 확장 업데이트 후 소유권 재복원 완료');
}
return Command::SUCCESS;
+ } catch (UpgradeHandoffException $e) {
+ // 업그레이드 스텝이 새 PHP 프로세스 재진입을 요청한 경우.
+ //
+ // 롤백하지 않음 — 파일 교체 / migration / composer 결과까지는 이미 `toVersion` 상태로 유효.
+ // Step 11 cleanup 을 축소 실행하여 중간 상태를 확정하고, 사용자에게 스텝 전용 재실행 안내.
+ //
+ // - updateVersionInEnv(toVersion): 디스크가 이미 toVersion 이므로 .env 도 toVersion 으로
+ // 일치시킨다. afterVersion 이 아님 — afterVersion 으로 두면 사용자가 다시 core:update
+ // 를 돌릴 때 GitHub 재다운로드부터 전체가 반복된다. toVersion 으로 고정 + 사용자에게는
+ // execute-upgrade-steps 만 실행하도록 안내하여 재다운로드를 회피한다.
+ // - clearAllCaches: 신규 코드·config 반영
+ // - restoreOwnership: sudo 생성 파일 소유권 복원
+ // - cleanupPending: _pending 정리
+ // - 백업은 유지 (재실행 중 실패해도 복구 가능)
+ // - maintenance 해제: 서비스 재개
+ //
+ // resumeCommand 는 예외에 명시되지 않았으면 `execute-upgrade-steps --from=
")||d.includes("")){const g=this.extractErrorFromHtml(d);throw new Error(`서버 오류: ${g}`)}try{return JSON.parse(d)}catch{throw new Error(`잘못된 JSON 응답: ${d.substring(0,100)}...`)}}catch(o){throw clearTimeout(i),o instanceof Error&&o.name==="AbortError"?new Error("요청 타임아웃"):o}}extractErrorFromHtml(e){const t=[/(Fatal error|Warning|Notice|Parse error)<\/b>:\s*([^<]+)/i,/Exception:\s*([^<\n]+)/i,/Error:\s*([^<\n]+)/i,/(TypeError|ArgumentCountError|ValueError)[^:]*:\s*([^<\n]+)/i];for(const i of t){const o=e.match(i);if(o)return(o[o.length-1]||o[1]).replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').trim().substring(0,200)}return e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().substring(0,200)||"Unknown server error"}destroy(){this.stopAutoCapture()}}let Bg=null;function tx(){return Bg||(Bg=new sk),Bg}const rk=`
+ `},{id:"form-no-datakey",name:"Form dataKey 미설정",category:"form",symptoms:["Input 값이 저장 안됨","Form 제출 시 빈 값"],detector:r=>r.form.some(e=>!e.dataKey),probability:.9,solution:"Form에 dataKey prop 추가",docLink:"troubleshooting-components.md#form-datakey"},{id:"input-no-name",name:"Input name 미설정",category:"form",symptoms:["자동 바인딩 안됨","Input 값 변경이 상태에 반영 안됨"],detector:r=>r.form.some(e=>e.inputs.some(t=>!t.name)),probability:.95,solution:"Input에 name prop 추가",docLink:"troubleshooting-components.md#input-name"},{id:"i18n-key-missing",name:"번역 키 누락",category:"i18n",symptoms:["$t:key가 그대로 표시됨","번역되지 않은 텍스트"],detector:r=>typeof document<"u"?document.body.innerHTML.includes("$t:"):!1,probability:.95,solution:"번역 파일에 키 추가",docLink:"troubleshooting-components.md#i18n"}];class ex{constructor(){H(this,"devTools");this.devTools=ka.getInstance()}analyze(e){const t=this.buildContext(),a=[];for(const i of Hc){const o=e.some(g=>i.symptoms.some(h=>h.toLowerCase().includes(g.toLowerCase())||g.toLowerCase().includes(h.toLowerCase())));let d=!1;try{d=i.detector(t)}catch{}(o||d)&&a.push({rule:i,confidence:this.calculateConfidence(i,e,o,d),evidence:this.collectEvidence(i,t)})}return a.sort((i,o)=>o.confidence-i.confidence)}suggestFix(e){return{title:e.rule.name,description:e.rule.solution,codeExample:e.rule.codeExample,docLink:e.rule.docLink}}getCommonIssues(){const e=this.buildContext(),t=[];for(const a of Hc)try{a.detector(e)&&t.push({rule:a,count:1})}catch{}return t.sort((a,i)=>i.count-a.count).map(a=>({id:a.rule.id,name:a.rule.name,description:a.rule.solution,frequency:a.count}))}getRulesByCategory(e){return Hc.filter(t=>t.category===e)}getAllRules(){return[...Hc]}buildContext(){return{stateHistory:this.devTools.getStateHistory(),actionHistory:this.devTools.getActionHistory(),cacheStats:this.devTools.getCacheStats(),currentState:this.devTools.getState(),lifecycle:this.devTools.getLifecycleInfo(),performance:this.devTools.getPerformanceInfo(),network:this.devTools.getNetworkInfo(),conditional:this.devTools.getConditionalInfo(),form:this.devTools.getFormInfo(),websocket:this.devTools.getWebSocketInfo(),stateAtTime:e=>this.devTools.getStateAtTime(e),layoutHas:(e,t)=>this.checkLayoutHas(e,t)}}calculateConfidence(e,t,a,i){let o=e.probability;if(a){const d=t.filter(g=>e.symptoms.some(h=>h.toLowerCase().includes(g.toLowerCase())||g.toLowerCase().includes(h.toLowerCase()))).length;o+=d*.05}return i&&(o+=.1),Math.min(o,.99)}collectEvidence(e,t){const a=[];switch(e.category){case"state":t.stateHistory.length>0&&a.push(`상태 변경 이력: ${t.stateHistory.length}개`);break;case"cache":a.push(`캐시 히트율: ${((t.cacheStats.hitRate??0)*100).toFixed(1)}%`);break;case"lifecycle":t.lifecycle.orphanedListeners.length>0&&a.push(`정리되지 않은 리스너: ${t.lifecycle.orphanedListeners.length}개`);break;case"performance":a.push(`바인딩 평가 횟수: ${t.performance.bindingEvalCount}`);break;case"network":a.push(`진행 중인 요청: ${t.network.activeRequests.length}개`);break;case"form":a.push(`추적 중인 Form: ${t.form.length}개`);break}return a}checkLayoutHas(e,t){try{const i=window.G7Core?.getCurrentLayout?.();if(!i)return!1;const o=JSON.stringify(i);return o.includes(`"${e}":"${t}`)||o.includes(`"${e}": "${t}`)}catch{return!1}}}const ak=Object.freeze(Object.defineProperty({__proto__:null,DiagnosticEngine:ex},Symbol.toStringTag,{value:"Module"})),sk={dumpEndpoint:"/_boost/g7-debug/dump-state",logEndpoint:"/_boost/g7-debug/log",timeout:1e4,autoCapture:!1,autoCaptureInterval:3e4};class rk{constructor(e){H(this,"config");H(this,"devTools");H(this,"connected",!1);H(this,"autoCaptureTimer",null);H(this,"CHUNK_SIZE",2*1024*1024);H(this,"BULK_THRESHOLD",4*1024*1024);this.config={...sk,...e},this.devTools=ka.getInstance(),this.config.autoCapture&&this.startAutoCapture()}async dumpState(e=!1){const t=`${Date.now()}_${Math.random().toString(36).substring(2,9)}`,a=Date.now(),i=this.devTools.getPerformanceInfo(),o={renderCounts:Object.fromEntries(i.renderCounts),bindingEvalCount:i.bindingEvalCount,memoryWarnings:i.memoryWarnings},d={state:()=>this.devTools.getState(),actions:()=>this.devTools.getActionHistory(),cache:()=>this.devTools.getCacheStats(),lifecycle:()=>this.devTools.getLifecycleInfo(),network:()=>this.devTools.getNetworkInfo(),expressions:()=>this.devTools.getExpressions(),forms:()=>this.devTools.getForms(),performance:()=>o,conditionals:()=>this.devTools.getConditionalInfo(),dataSources:()=>this.devTools.getDataSources(),handlers:()=>this.devTools.getHandlers(),componentEvents:()=>this.devTools.getComponentEventInfo(),stateRendering:()=>this.devTools.getStateRenderingInfo(),stateHierarchy:()=>this.devTools.getStateHierarchyInfo(),contextFlow:()=>this.devTools.getContextFlowInfo(),styleValidation:()=>this.devTools.getStyleValidationInfo(),authDebug:()=>this.devTools.getAuthDebugInfo(),logs:()=>this.devTools.getLogInfo(),layout:()=>this.devTools.getLayoutDebugInfo(),changeDetection:()=>this.devTools.getChangeDetectionInfo(),sequenceTracking:()=>this.devTools.getSequenceTrackingInfo(),staleClosureTracking:()=>this.devTools.getStaleClosureTrackingInfo(),cacheDecisionTracking:()=>this.devTools.getCacheDecisionTrackingInfo(),dataPathTransformTracking:()=>this.devTools.getDataPathTransformTrackingInfo(),nestedContextTracking:()=>this.devTools.getNestedContextTrackingInfo(),formBindingValidationTracking:()=>this.devTools.getFormBindingValidationTrackingInfo(),computedDependencyTracking:()=>this.devTools.getComputedDependencyTrackingInfo(),modalStateScopeTracking:()=>this.devTools.getModalStateScopeTrackingInfo(),namedActionTracking:()=>this.devTools.getNamedActionTrackingInfo()},g={},h=[];let f=0;for(const[x,S]of Object.entries(d))try{const v=S(),w=this.safeStringify(v,x);w===null?(h.push(`${x}: 직렬화 실패`),g[x]=JSON.stringify({_error:`${x} 섹션 직렬화 실패`})):g[x]=w,f+=g[x].length}catch(v){const w=v instanceof Error?v.message:String(v);h.push(`${x}: ${w}`),g[x]=JSON.stringify({_error:`${x} 섹션 수집 실패: ${w}`}),f+=g[x].length}const p=Object.keys(g).length,y=p-h.length;try{return f<=this.BULK_THRESHOLD?(await this.sendBulkDump(g,a,e),console.log(`[G7DevTools] 상태 덤프 완료 - 일괄 전송 (${(f/1024).toFixed(1)}KB, ${y}/${p} 섹션 성공)`)):(await this.sendChunkedDump(t,g,a,e),console.log(`[G7DevTools] 상태 덤프 완료 - 분할 전송 (${(f/1024/1024).toFixed(2)}MB, ${y}/${p} 섹션 성공)`)),this.connected=!0,h.length>0&&console.warn("[G7DevTools] 일부 섹션 실패:",h.join(", ")),t}catch(x){throw this.connected=!1,console.error("[G7DevTools] 상태 덤프 실패:",x),x}}async sendBulkDump(e,t,a){const i={};for(const[o,d]of Object.entries(e))try{i[o]=JSON.parse(d)}catch{i[o]={_error:"파싱 실패"}}await this.sendRequest(this.config.dumpEndpoint,{bulk:!0,sections:i,timestamp:t,saveHistory:a})}async sendChunkedDump(e,t,a,i){const o=Object.keys(t),d=o.length;for(let g=0;g
")||d.includes("")){const g=this.extractErrorFromHtml(d);throw new Error(`서버 오류: ${g}`)}try{return JSON.parse(d)}catch{throw new Error(`잘못된 JSON 응답: ${d.substring(0,100)}...`)}}catch(o){throw clearTimeout(i),o instanceof Error&&o.name==="AbortError"?new Error("요청 타임아웃"):o}}extractErrorFromHtml(e){const t=[/(Fatal error|Warning|Notice|Parse error)<\/b>:\s*([^<]+)/i,/Exception:\s*([^<\n]+)/i,/Error:\s*([^<\n]+)/i,/(TypeError|ArgumentCountError|ValueError)[^:]*:\s*([^<\n]+)/i];for(const i of t){const o=e.match(i);if(o)return(o[o.length-1]||o[1]).replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').trim().substring(0,200)}return e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().substring(0,200)||"Unknown server error"}destroy(){this.stopAutoCapture()}}let Bg=null;function tx(){return Bg||(Bg=new rk),Bg}const ik=`
#g7-devtools-root {
/* 기본 폰트 설정 */
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
@@ -1841,16 +1841,16 @@ details[open] > .g7dt-summary::before {
.g7dt-cursor-pointer {
cursor: pointer;
}
-`,ik=()=>{const r="g7-devtools-styles";if(document.getElementById(r))return;const e=document.createElement("style");e.id=r,e.textContent=rk,document.head.appendChild(e)},nx={state:"상태",actions:"액션",cache:"캐시",diagnose:"진단",performance:"성능",lifecycle:"라이프사이클",network:"네트워크",form:"Form",conditional:"조건부",expression:"표현식",handlers:"핸들러",events:"이벤트",datasources:"데이터소스",renders:"렌더링",styles:"스타일",auth:"인증",logs:"로그",layout:"레이아웃",changedetection:"변경감지",staleclosure:"Stale Closure",nestedcontext:"Context",modalscope:"모달스코프",namedactions:"Named Actions"},ok=700,lk=500,ax=400,sx=300,rx="g7-devtools-panel",Ug=r=>r===null||r===void 0?"g7dt-text-gray":typeof r=="string"?"g7dt-text-yellow":typeof r=="number"?"g7dt-text-cyan":typeof r=="boolean"?"g7dt-text-pink":Array.isArray(r)?"g7dt-text-orange":typeof r=="object"?"g7dt-text-blue":"g7dt-text-white",ck=r=>r===null?"null":r===void 0?"undefined":Array.isArray(r)?`Array(${r.length})`:typeof r=="object"?`Object(${Object.keys(r).length})`:typeof r,dk=r=>r===null?"null":r===void 0?"undefined":typeof r=="string"?r.length>50?`"${r.substring(0,50)}..."`:`"${r}"`:typeof r=="boolean"?r?"true":"false":typeof r=="number"?String(r):"",ix=()=>{try{const r=localStorage.getItem(rx);if(r)return JSON.parse(r)}catch(r){console.warn("[G7DevTools] 설정 로드 실패:",r)}return{}},ox=r=>{try{const t={...ix(),...r};localStorage.setItem(rx,JSON.stringify(t))}catch(e){console.warn("[G7DevTools] 설정 저장 실패:",e)}},hi=({keyName:r,value:e,path:t,expandedPaths:a,onToggle:i,searchTerm:o,depth:d=0})=>{const g=e!==null&&typeof e=="object",h=a.has(t),f=Array.isArray(e),p=o&&(r.toLowerCase().includes(o.toLowerCase())||typeof e=="string"&&e.toLowerCase().includes(o.toLowerCase())||typeof e=="number"&&String(e).includes(o)),y=S=>{S.stopPropagation(),g&&i(t)},x=g?Object.entries(e):[];return l.jsxs("div",{style:{marginLeft:d>0?"16px":"0"},children:[l.jsxs("div",{className:`g7dt-tree-node g7dt-flex g7dt-items-center g7dt-gap-1 ${p?"g7dt-ring-highlight":""}`,onClick:y,children:[g?l.jsx("span",{className:"g7dt-text-gray g7dt-w-4 g7dt-text-xs g7dt-select-none",style:{textAlign:"center"},children:h?"▼":"▶"}):l.jsx("span",{className:"g7dt-w-4"}),l.jsx("span",{className:"g7dt-text-purple g7dt-text-xs",children:r}),l.jsx("span",{className:"g7dt-text-gray-dark g7dt-text-xs",children:":"}),g?l.jsxs("span",{className:`g7dt-text-xs ${Ug(e)}`,children:[f?"[":"{",!h&&l.jsx("span",{className:"g7dt-text-gray",style:{margin:"0 4px"},children:ck(e)}),!h&&(f?"]":"}")]}):l.jsx("span",{className:`g7dt-text-xs ${Ug(e)}`,children:dk(e)}),!g&&l.jsxs("span",{className:"g7dt-text-gray-dark g7dt-text-xs g7dt-ml-1",children:["(",typeof e,")"]})]}),g&&h&&l.jsxs("div",{className:"g7dt-border-l",style:{marginLeft:"8px"},children:[x.map(([S,v])=>l.jsx(hi,{keyName:f?`[${S}]`:S,value:v,path:`${t}.${S}`,expandedPaths:a,onToggle:i,searchTerm:o,depth:d+1},`${t}.${S}`)),l.jsx("div",{className:"g7dt-ml-4 g7dt-text-xs",children:l.jsx("span",{className:Ug(e),children:f?"]":"}"})})]})]})},uk=({state:r,devTools:e})=>{const[t,a]=j.useState(new Set(["_global","_local","_computed","_isolated","$parent"])),[i,o]=j.useState(""),[d,g]=j.useState(!1),[h,f]=j.useState(!1),[p,y]=j.useState(null),x=j.useCallback(()=>{e&&y(e.getComputedDependencyTrackingInfo())},[e]);j.useEffect(()=>{if(h&&e){x();const M=setInterval(x,2e3);return()=>clearInterval(M)}},[h,e,x]);const S=M=>{switch(M){case"state-change":return"📊";case"prop-change":return"📥";case"dependency-change":return"🔗";case"manual":return"👆";case"initial":return"🚀";default:return"❓"}},v=j.useCallback(M=>{a(z=>{const K=new Set(z);return K.has(M)?K.delete(M):K.add(M),K})},[]),w=j.useCallback((M,z)=>{const K=[z];if(M!==null&&typeof M=="object")for(const[pe,we]of Object.entries(M))K.push(...w(we,`${z}.${pe}`));return K},[]),k=j.useCallback(()=>{if(d)a(new Set(["_global","_local","_computed","_isolated","$parent"]));else{const M=new Set;w(r._global,"_global").forEach(z=>M.add(z)),w(r._local,"_local").forEach(z=>M.add(z)),w(r._computed,"_computed").forEach(z=>M.add(z)),w(r._isolated,"_isolated").forEach(z=>M.add(z)),r.$parent&&w(r.$parent,"$parent").forEach(z=>M.add(z)),a(M)}g(!d)},[d,r,w]),A=Object.keys(r._global||{}).length,O=Object.keys(r._local||{}).length,N=Object.keys(r._computed||{}).length,D=Object.keys(r._isolated||{}).length,$=Object.keys(r.$parent||{}).length;return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-flex g7dt-gap-2 g7dt-items-center g7dt-flex-shrink-0",children:[l.jsx("input",{type:"text",placeholder:"키 또는 값 검색...",value:i,onChange:M=>o(M.target.value),className:"g7dt-input g7dt-flex-1"}),l.jsx("button",{onClick:k,className:"g7dt-btn g7dt-bg-gray-700",children:d?"모두 접기":"모두 펼치기"})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-3 g7dt-text-xs g7dt-text-gray g7dt-flex-wrap g7dt-flex-shrink-0",children:[l.jsxs("span",{children:[l.jsx("span",{className:"g7dt-text-yellow",children:"●"})," string"]}),l.jsxs("span",{children:[l.jsx("span",{className:"g7dt-text-cyan",children:"●"})," number"]}),l.jsxs("span",{children:[l.jsx("span",{className:"g7dt-text-pink",children:"●"})," boolean"]}),l.jsxs("span",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"●"})," null"]}),l.jsxs("span",{children:[l.jsx("span",{className:"g7dt-text-orange",children:"●"})," array"]}),l.jsxs("span",{children:[l.jsx("span",{className:"g7dt-text-blue",children:"●"})," object"]})]}),l.jsxs("div",{className:"g7dt-bg-gray-800 g7dt-rounded g7dt-p-2 g7dt-overflow-auto g7dt-border",style:{flex:1,minHeight:0},children:[l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-text-sm g7dt-font-bold g7dt-text-green g7dt-mb-1 g7dt-cursor-pointer",onClick:()=>v("_global"),children:[l.jsx("span",{children:t.has("_global")?"▼":"▶"}),l.jsx("span",{children:"_global"}),l.jsxs("span",{className:"g7dt-text-gray g7dt-text-xs",style:{fontWeight:"normal"},children:["(",A,"개 키)"]})]}),t.has("_global")&&l.jsx("div",{className:"g7dt-ml-2 g7dt-border-l",children:Object.entries(r._global||{}).map(([M,z])=>l.jsx(hi,{keyName:M,value:z,path:`_global.${M}`,expandedPaths:t,onToggle:v,searchTerm:i},`_global.${M}`))})]}),l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-text-sm g7dt-font-bold g7dt-text-blue g7dt-mb-1 g7dt-cursor-pointer",onClick:()=>v("_local"),children:[l.jsx("span",{children:t.has("_local")?"▼":"▶"}),l.jsx("span",{children:"_local"}),l.jsxs("span",{className:"g7dt-text-gray g7dt-text-xs",style:{fontWeight:"normal"},children:["(",O,"개 키)"]})]}),t.has("_local")&&l.jsx("div",{className:"g7dt-ml-2 g7dt-border-l",children:Object.entries(r._local||{}).map(([M,z])=>l.jsx(hi,{keyName:M,value:z,path:`_local.${M}`,expandedPaths:t,onToggle:v,searchTerm:i},`_local.${M}`))})]}),l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-text-sm g7dt-font-bold g7dt-text-purple g7dt-mb-1 g7dt-cursor-pointer",onClick:()=>v("_computed"),children:[l.jsx("span",{children:t.has("_computed")?"▼":"▶"}),l.jsx("span",{children:"_computed"}),l.jsxs("span",{className:"g7dt-text-gray g7dt-text-xs",style:{fontWeight:"normal"},children:["(",N,"개 키)"]})]}),t.has("_computed")&&l.jsx("div",{className:"g7dt-ml-2 g7dt-border-l",children:Object.entries(r._computed||{}).map(([M,z])=>l.jsx(hi,{keyName:M,value:z,path:`_computed.${M}`,expandedPaths:t,onToggle:v,searchTerm:i},`_computed.${M}`))})]}),D>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-text-sm g7dt-font-bold g7dt-text-orange g7dt-mb-1 g7dt-cursor-pointer",onClick:()=>v("_isolated"),children:[l.jsx("span",{children:t.has("_isolated")?"▼":"▶"}),l.jsx("span",{children:"_isolated"}),l.jsxs("span",{className:"g7dt-text-gray g7dt-text-xs",style:{fontWeight:"normal"},children:["(",D,"개 스코프)"]})]}),t.has("_isolated")&&l.jsx("div",{className:"g7dt-ml-2 g7dt-border-l",children:Object.entries(r._isolated||{}).map(([M,z])=>l.jsx(hi,{keyName:M,value:z,path:`_isolated.${M}`,expandedPaths:t,onToggle:v,searchTerm:i},`_isolated.${M}`))})]}),$>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-text-sm g7dt-font-bold g7dt-text-cyan g7dt-mb-1 g7dt-cursor-pointer",onClick:()=>v("$parent"),children:[l.jsx("span",{children:t.has("$parent")?"▼":"▶"}),l.jsx("span",{children:"$parent"}),l.jsxs("span",{className:"g7dt-text-gray g7dt-text-xs",style:{fontWeight:"normal"},children:["(",$,"개 키)"]})]}),t.has("$parent")&&l.jsx("div",{className:"g7dt-ml-2 g7dt-border-l",children:Object.entries(r.$parent||{}).map(([M,z])=>l.jsx(hi,{keyName:M,value:z,path:`$parent.${M}`,expandedPaths:t,onToggle:v,searchTerm:i},`$parent.${M}`))})]})]}),e&&l.jsx("div",{className:"g7dt-flex g7dt-justify-end g7dt-mt-2",children:l.jsx("button",{onClick:()=>f(!h),className:`g7dt-tab-button ${h?"g7dt-tab-active":""}`,children:"🧮 Computed 추적"})}),h&&p&&l.jsxs("div",{className:"g7dt-card g7dt-mt-2",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:["Computed 의존성 추적 (",p.properties.length,"개)"]}),l.jsxs("div",{className:"g7dt-stats-grid g7dt-mb-3",children:[l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-purple",children:p.stats.totalComputed}),l.jsx("div",{className:"g7dt-stat-label",children:"Computed"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-blue",children:p.stats.totalRecalculations}),l.jsx("div",{className:"g7dt-stat-label",children:"재계산"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-yellow",children:p.stats.unnecessaryRecalculations}),l.jsx("div",{className:"g7dt-stat-label",children:"불필요"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsxs("div",{className:"g7dt-stat-value g7dt-text-green",children:[p.stats.avgComputationTime.toFixed(1),"ms"]}),l.jsx("div",{className:"g7dt-stat-label",children:"평균시간"})]})]}),p.stats.cycleDetectionCount>0&&l.jsxs("div",{className:"g7dt-text-xs g7dt-text-red g7dt-mb-3 g7dt-p-2 g7dt-bg-red-900 g7dt-rounded",children:["⚠️ 순환 의존성 감지: ",p.stats.cycleDetectionCount,"건"]}),p.stats.topRecalculated.length>0&&l.jsxs("div",{className:"g7dt-mb-3",children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-2",children:"자주 재계산되는 속성"}),l.jsx("div",{className:"g7dt-space-y-1",children:p.stats.topRecalculated.slice(0,3).map((M,z)=>l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-text-xs",children:[l.jsx("span",{className:"g7dt-text-purple g7dt-font-mono",children:M.name}),l.jsxs("span",{className:"g7dt-text-muted",children:[M.count,"회"]})]},z))})]}),p.recalcLogs.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"재계산 로그가 없습니다"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-40 g7dt-overflow-y-auto",children:p.recalcLogs.slice().reverse().slice(0,20).map(M=>l.jsxs("div",{className:`g7dt-list-item ${M.valueChanged?"":"g7dt-border-yellow"}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{children:S(M.trigger)}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-purple g7dt-font-mono",children:M.computedName}),!M.valueChanged&&l.jsx("span",{className:"g7dt-badge g7dt-text-xs g7dt-text-yellow",children:"값 변경 없음"}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:[M.computationTime.toFixed(1),"ms"]})]}),M.triggeredBy&&l.jsxs("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mt-1",children:["트리거: ",l.jsx("span",{className:"g7dt-text-blue",children:M.triggeredBy.path})]})]},M.id))})]})]})},gk=({actions:r,devTools:e})=>{const[t,a]=j.useState(""),[i,o]=j.useState("actions"),[d,g]=j.useState(null),[h,f]=j.useState(null),p=j.useCallback(()=>{e&&g(e.getSequenceTrackingInfo())},[e]);j.useEffect(()=>{if(i==="sequences"&&e){p();const w=setInterval(p,2e3);return()=>clearInterval(w)}},[i,e,p]);const y=t?r.filter(w=>w.type.toLowerCase().includes(t.toLowerCase())||w.status===t):r,x=w=>{switch(w){case"success":return"g7dt-status-success";case"error":return"g7dt-status-error";case"started":return"g7dt-status-started";default:return"g7dt-status-default"}},S=w=>{switch(w){case"success":return"g7dt-badge-success";case"error":return"g7dt-badge-error";default:return"g7dt-badge-warning"}},v=h&&d?d.executions.find(w=>w.id===h):null;return l.jsxs("div",{className:"g7dt-space-y-4",children:[e&&l.jsx("div",{className:"g7dt-card",children:l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsxs("button",{className:`g7dt-tab-button ${i==="actions"?"g7dt-tab-active":""}`,onClick:()=>o("actions"),children:["📋 액션 (",r.length,")"]}),l.jsxs("button",{className:`g7dt-tab-button ${i==="sequences"?"g7dt-tab-active":""}`,onClick:()=>o("sequences"),children:["🔗 Sequence (",d?.executions.length||0,")"]})]})}),i==="actions"&&l.jsxs("div",{className:"g7dt-flex g7dt-gap-2 g7dt-flex-shrink-0",children:[l.jsx("input",{type:"text",placeholder:"액션 타입 또는 상태로 필터...",value:t,onChange:w=>a(w.target.value),className:"g7dt-input g7dt-flex-1"}),l.jsx("button",{onClick:()=>a(""),className:"g7dt-btn-text",children:"초기화"})]}),i==="sequences"&&d&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"Sequence 통계"}),l.jsxs("div",{className:"g7dt-stats-grid-3",children:[l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-blue",children:d.stats.totalSequences}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"총 실행"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-green",children:d.stats.successCount}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"성공"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-red",children:d.stats.errorCount}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"실패"})]})]})]}),l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"Sequence 실행 목록"}),d.executions.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"실행된 Sequence가 없습니다"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-40 g7dt-overflow-y-auto",children:d.executions.slice().reverse().map(w=>l.jsx("div",{className:`g7dt-list-item g7dt-cursor-pointer ${h===w.id?"g7dt-selected":""} ${w.status==="error"?"g7dt-border-red":""}`,onClick:()=>f(h===w.id?null:w.id),children:l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{children:w.status==="completed"?"✅":w.status==="error"?"❌":"⏳"}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-white",children:[w.actions.length,"개 액션"]}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:[w.totalDuration.toFixed(0),"ms"]})]})},w.id))})]}),v&&l.jsxs("div",{className:"g7dt-card g7dt-border-blue",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:["🔗 Sequence 상세 (",v.actions.length,"개 액션)"]}),l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-60 g7dt-overflow-y-auto",children:v.actions.map((w,k)=>l.jsxs("div",{className:`g7dt-list-item ${w.status==="error"?"g7dt-border-red":""}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted",children:["#",w.index+1]}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-white g7dt-font-mono",children:w.handler}),l.jsx("span",{className:`g7dt-text-xs ${w.status==="success"?"g7dt-text-green":"g7dt-text-red"}`,children:w.status==="success"?"✓":"✕"}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:[w.duration.toFixed(0),"ms"]})]}),w.stateChanges&&w.stateChanges.length>0&&l.jsxs("div",{className:"g7dt-mt-1",children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"상태 변경:"}),w.stateChanges.slice(0,3).map((A,O)=>l.jsx("div",{className:"g7dt-text-xs g7dt-text-yellow g7dt-ml-2",children:A.path},O)),w.stateChanges.length>3&&l.jsxs("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-2",children:["...외 ",w.stateChanges.length-3,"개"]})]})]},k))})]})]}),i==="actions"&&l.jsx("div",{className:"g7dt-section",children:l.jsx("div",{className:"g7dt-scroll-list g7dt-space-y-2-flat g7dt-action-list",children:y.length===0?l.jsx("div",{className:"g7dt-empty-message",children:"액션 이력이 없습니다"}):y.slice(-30).reverse().map((w,k)=>l.jsxs("div",{className:`g7dt-action-item ${x(w.status)}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-start",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-font-mono g7dt-font-bold",children:w.type}),l.jsx("span",{className:`g7dt-status-badge ${S(w.status)}`,children:w.status})]}),l.jsx("span",{className:"g7dt-text-gray",children:w.duration?`${w.duration.toFixed(2)}ms`:"-"})]}),w.error&&l.jsx("div",{className:"g7dt-error-box",children:w.error.message}),w.params&&Object.keys(w.params).length>0&&l.jsxs("details",{className:"g7dt-details",children:[l.jsx("summary",{className:"g7dt-summary",children:"파라미터"}),l.jsx("pre",{className:"g7dt-pre",children:JSON.stringify(w.params,null,2)})]})]},`${w.id}-${k}`))})})]})},hk=({stats:r,devTools:e})=>{const[t,a]=j.useState(null),[i,o]=j.useState(!1),d=j.useCallback(()=>{a(e.getCacheDecisionTrackingInfo())},[e]);j.useEffect(()=>{if(i){d();const f=setInterval(d,2e3);return()=>clearInterval(f)}},[i,d]);const g=()=>{e.resetCacheStats(),console.log("[G7DevTools] 캐시 통계 초기화")},h=f=>{switch(f){case"use_cache":return"✅";case"skip_cache":return"⏭️";case"invalidate":return"🗑️";default:return"❓"}};return l.jsxs("div",{className:"g7dt-space-y-6",children:[l.jsxs("div",{className:"g7dt-stats-grid",children:[l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-green",children:r.hits}),l.jsx("div",{className:"g7dt-stat-label",children:"Cache Hits"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-red",children:r.misses}),l.jsx("div",{className:"g7dt-stat-label",children:"Cache Misses"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-blue",children:r.entries}),l.jsx("div",{className:"g7dt-stat-label",children:"Entries"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsxs("div",{className:"g7dt-stat-value g7dt-text-purple",children:[(r.hitRate*100).toFixed(1),"%"]}),l.jsx("div",{className:"g7dt-stat-label",children:"Hit Rate"})]})]}),l.jsxs("div",{className:"g7dt-space-y-2",children:[l.jsx("div",{className:"g7dt-text-sm g7dt-text-gray",children:"캐시 히트율"}),l.jsx("div",{className:"g7dt-progress-bar",children:l.jsx("div",{className:"g7dt-progress-fill",style:{width:`${r.hitRate*100}%`}})})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsx("button",{onClick:g,className:"g7dt-btn-danger",children:"캐시 통계 초기화"}),l.jsx("button",{onClick:()=>o(!i),className:`g7dt-tab-button ${i?"g7dt-tab-active":""}`,children:"📋 Decision Log"})]}),i&&t&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:["캐시 결정 로그 (",t.decisions.length,"개)"]}),t.decisions.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"캐시 결정 기록이 없습니다"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-60 g7dt-overflow-y-auto",children:t.decisions.slice().reverse().slice(0,50).map(f=>l.jsxs("div",{className:`g7dt-list-item ${f.decision==="skip_cache"?"g7dt-border-yellow":f.decision==="invalidate"?"g7dt-border-red":""}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{children:h(f.decision)}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-white g7dt-font-mono g7dt-truncate",style:{maxWidth:"200px"},children:f.expression}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:f.decision})]}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mt-1",children:f.reason}),f.context&&l.jsxs("div",{className:"g7dt-flex g7dt-gap-2 g7dt-mt-1",children:[f.context.isInIteration&&l.jsx("span",{className:"g7dt-badge g7dt-text-xs",children:"🔄 iteration"}),f.context.isInAction&&l.jsx("span",{className:"g7dt-badge g7dt-text-xs",children:"⚡ action"})]})]},f.id))})]})]})},fk=()=>{const[r,e]=j.useState([]),[t,a]=j.useState([]),[i,o]=j.useState(""),d=["이전 값이 전송됨","모든 행이 같은 값","상태가 업데이트 안됨","API 호출이 안됨","초기값이 없음","무한 로딩","Form 값이 저장 안됨","iteration 데이터 중복"],g=p=>{e(y=>y.includes(p)?y.filter(x=>x!==p):[...y,p])},h=()=>{i&&!r.includes(i)&&(e(p=>[...p,i]),o(""))},f=async()=>{const{DiagnosticEngine:p}=await Promise.resolve().then(()=>nk),x=new p().analyze(r);a(x)};return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"증상 선택"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-2",children:d.map(p=>l.jsx("button",{onClick:()=>g(p),className:r.includes(p)?"g7dt-symptom-btn g7dt-symptom-active":"g7dt-symptom-btn",children:p},p))})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsx("input",{type:"text",placeholder:"직접 증상 입력...",value:i,onChange:p=>o(p.target.value),onKeyDown:p=>p.key==="Enter"&&h(),className:"g7dt-input g7dt-flex-1"}),l.jsx("button",{onClick:h,className:"g7dt-btn-secondary",children:"추가"})]}),l.jsxs("button",{onClick:f,disabled:r.length===0,className:r.length===0?"g7dt-btn-primary g7dt-btn-disabled g7dt-w-full":"g7dt-btn-primary g7dt-w-full",children:["진단 실행 (",r.length,"개 증상)"]}),t.length>0&&l.jsxs("div",{className:"g7dt-space-y-3",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:"진단 결과"}),t.slice(0,5).map((p,y)=>l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("span",{className:"g7dt-font-bold g7dt-text-yellow",children:p.rule.name}),l.jsxs("span",{className:"g7dt-confidence-badge",children:[(p.confidence*100).toFixed(0),"%"]})]}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-lightgray",children:p.rule.solution}),p.rule.codeExample&&l.jsx("pre",{className:"g7dt-pre g7dt-mt-2",children:p.rule.codeExample})]},y))]})]})},pk=({devTools:r})=>{const e=r.getPerformanceInfo();return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-stats-grid-2",children:[l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-blue",children:e.bindingEvalCount}),l.jsx("div",{className:"g7dt-stat-label",children:"바인딩 평가 횟수"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-purple",children:e.renderCounts.size}),l.jsx("div",{className:"g7dt-stat-label",children:"렌더링된 컴포넌트"})]})]}),e.memoryWarnings.length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-text-red g7dt-mb-2",children:"메모리 경고"}),l.jsx("div",{className:"g7dt-space-y-2",children:e.memoryWarnings.map((t,a)=>l.jsxs("div",{className:"g7dt-warning-card",children:[l.jsx("div",{className:"g7dt-font-bold",children:t.type}),l.jsx("div",{className:"g7dt-text-lightgray",children:t.message}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-gray g7dt-mt-1",children:t.suggestion})]},a))})]}),e.renderCounts.size>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"컴포넌트별 렌더링"}),l.jsx("div",{className:"g7dt-space-y-1 g7dt-scroll-list",children:Array.from(e.renderCounts.entries()).sort((t,a)=>a[1]-t[1]).slice(0,10).map(([t,a])=>l.jsxs("div",{className:"g7dt-list-item",children:[l.jsx("span",{className:"g7dt-text-lightgray g7dt-truncate",children:t}),l.jsxs("span",{className:a>50?"g7dt-text-red":"g7dt-text-gray",children:[a,"회"]})]},t))})]})]})},mk=({devTools:r})=>{const e=r.getLifecycleInfo();return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-section",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-text-green g7dt-mb-2 g7dt-flex-shrink-0",children:["마운트된 컴포넌트 (",e.mountedComponents.length,")"]}),l.jsx("div",{className:"g7dt-scroll-list",children:e.mountedComponents.length===0?l.jsx("div",{className:"g7dt-empty-message",children:"추적된 컴포넌트 없음"}):e.mountedComponents.map(t=>l.jsxs("div",{className:"g7dt-list-item g7dt-text-xs",children:[l.jsx("span",{className:"g7dt-text-lightgray",children:t.name}),l.jsx("span",{className:"g7dt-text-gray",children:t.id})]},t.id))})]}),e.orphanedListeners.length>0&&l.jsxs("div",{className:"g7dt-section",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-text-red g7dt-mb-2 g7dt-flex-shrink-0",children:["정리되지 않은 리스너 (",e.orphanedListeners.length,")"]}),l.jsx("div",{className:"g7dt-scroll-list",children:e.orphanedListeners.map((t,a)=>l.jsxs("div",{className:"g7dt-warning-card g7dt-text-xs",children:[l.jsx("span",{className:"g7dt-text-lightgray",children:t.type}),l.jsxs("span",{className:"g7dt-text-gray g7dt-ml-2",children:["on ",t.target]})]},a))})]})]})},yk=({devTools:r})=>{const e=r.getNetworkInfo(),t=d=>{switch(d){case"success":return"g7dt-text-green";case"error":return"g7dt-text-red";case"pending":return"g7dt-text-yellow";default:return"g7dt-text-gray"}},a=d=>d.queryParams&&Object.keys(d.queryParams).length>0,i=d=>Object.entries(d).map(([g,h])=>l.jsxs("div",{className:"g7dt-flex g7dt-gap-2 g7dt-text-xs",children:[l.jsxs("span",{className:"g7dt-text-purple",children:[g,":"]}),l.jsx("span",{className:"g7dt-text-lightgray",children:Array.isArray(h)?JSON.stringify(h):h})]},g)),o=(d,g=5e3)=>{try{const h=JSON.stringify(d,null,2);return h.length>g?h.substring(0,g)+`
-... (truncated)`:h}catch{return"(직렬화 불가)"}};return l.jsxs("div",{className:"g7dt-space-y-4",children:[e.activeRequests.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-text-yellow g7dt-mb-2",children:["진행 중 (",e.activeRequests.length,")"]}),l.jsx("div",{className:"g7dt-space-y-1",children:e.activeRequests.map(d=>l.jsxs("details",{className:"g7dt-details",children:[l.jsxs("summary",{className:"g7dt-summary g7dt-pending-request",children:[l.jsx("span",{className:"g7dt-font-bold",children:d.method}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-lightgray g7dt-truncate",children:d.fullUrl||d.url})]}),l.jsxs("div",{className:"g7dt-card g7dt-mt-1 g7dt-text-xs",children:[a(d)&&l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsx("div",{className:"g7dt-text-blue g7dt-font-bold g7dt-mb-1",children:"쿼리 파라미터"}),l.jsx("div",{className:"g7dt-pl-2 g7dt-border-l-2 g7dt-border-blue",children:i(d.queryParams)})]}),d.requestBody&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-orange g7dt-font-bold g7dt-mb-1",children:"요청 본문"}),l.jsx("pre",{className:"g7dt-pre g7dt-text-xs",children:o(d.requestBody,2e3)})]})]})]},d.id))})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"요청 이력"}),l.jsx("div",{className:"g7dt-space-y-1 g7dt-scroll-list-lg",children:e.requestHistory.length===0?l.jsx("div",{className:"g7dt-empty-message",children:"요청 이력 없음"}):e.requestHistory.slice(-20).reverse().map(d=>l.jsxs("details",{className:"g7dt-details",children:[l.jsxs("summary",{className:"g7dt-summary g7dt-card g7dt-text-xs",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-w-full",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-font-bold",children:d.method}),l.jsx("span",{className:`g7dt-ml-2 ${t(d.status)}`,children:d.statusCode||d.status})]}),l.jsxs("span",{className:"g7dt-text-gray",children:[d.duration,"ms"]})]}),l.jsx("div",{className:"g7dt-text-gray g7dt-truncate g7dt-mt-1",children:d.fullUrl||d.url})]}),l.jsxs("div",{className:"g7dt-card g7dt-mt-1 g7dt-text-xs g7dt-ml-2 g7dt-border-l-2 g7dt-border-gray",children:[l.jsx("div",{className:"g7dt-mb-2",children:l.jsxs("div",{className:"g7dt-text-xs g7dt-space-y-1",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"URL:"})," ",l.jsx("span",{className:"g7dt-text-lightgray",children:d.fullUrl||d.url})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"상태:"})," ",l.jsx("span",{className:t(d.status),children:d.statusCode||d.status})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"소요시간:"})," ",l.jsxs("span",{className:"g7dt-text-lightgray",children:[d.duration,"ms"]})]}),d.dataSourceId&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"데이터소스:"})," ",l.jsx("span",{className:"g7dt-text-blue",children:d.dataSourceId})]}),d.error&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"에러:"})," ",l.jsx("span",{className:"g7dt-text-red",children:d.error})]})]})}),a(d)&&l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsx("div",{className:"g7dt-text-blue g7dt-font-bold g7dt-mb-1",children:"쿼리 파라미터"}),l.jsx("div",{className:"g7dt-pl-2 g7dt-border-l-2 g7dt-border-blue",children:i(d.queryParams)})]}),d.requestBody&&l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsx("div",{className:"g7dt-text-orange g7dt-font-bold g7dt-mb-1",children:"요청 본문"}),l.jsx("pre",{className:"g7dt-pre g7dt-text-xs g7dt-max-h-40 g7dt-overflow-auto",children:o(d.requestBody,2e3)})]}),d.response!==void 0&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-green g7dt-font-bold g7dt-mb-1",children:"응답 내용"}),l.jsx("pre",{className:"g7dt-pre g7dt-text-xs g7dt-max-h-60 g7dt-overflow-auto",children:o(d.response,5e3)})]})]})]},d.id))})]}),e.pendingDataSources.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-text-blue g7dt-mb-2",children:["대기 중인 데이터소스 (",e.pendingDataSources.length,")"]}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-2",children:e.pendingDataSources.map(d=>l.jsx("span",{className:"g7dt-tag-blue",children:d},d))})]})]})},xk=({devTools:r})=>{const e=r.getFormInfo(),[t,a]=j.useState(!1),[i,o]=j.useState(null),d=j.useCallback(()=>{o(r.getFormBindingValidationTrackingInfo())},[r]);j.useEffect(()=>{if(t){d();const f=setInterval(d,2e3);return()=>clearInterval(f)}},[t,d]);const g=f=>{switch(f){case"missing-datakey":return"🔑";case"missing-input-name":return"📝";case"context-not-propagated":return"🔗";case"sortable-context-break":return"📊";case"modal-context-isolation":return"🪟";case"duplicate-input-name":return"👯";case"value-type-mismatch":return"⚠️";case"binding-path-invalid":return"❌";default:return"❓"}},h=f=>{switch(f){case"error":return"g7dt-text-red";case"warning":return"g7dt-text-yellow";case"info":return"g7dt-text-blue";default:return"g7dt-text-gray"}};return l.jsxs("div",{className:"g7dt-space-y-4",children:[e.length===0?l.jsx("div",{className:"g7dt-empty-message g7dt-py-8",children:"추적된 Form이 없습니다"}):e.map(f=>l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("span",{className:"g7dt-font-bold g7dt-text-blue",children:f.dataKey||"(no dataKey)"}),!f.dataKey&&l.jsx("span",{className:"g7dt-text-red g7dt-text-xs",children:"dataKey 필요"})]}),l.jsx("div",{className:"g7dt-space-y-1 g7dt-mb-2",children:f.inputs.map((p,y)=>l.jsxs("div",{className:"g7dt-text-xs g7dt-flex g7dt-justify-between",children:[l.jsx("span",{children:p.name||l.jsx("span",{className:"g7dt-text-red",children:"name 없음"})}),l.jsx("span",{className:"g7dt-text-gray",children:p.type})]},y))}),l.jsxs("details",{className:"g7dt-details",children:[l.jsx("summary",{className:"g7dt-summary",children:"현재 값 보기"}),l.jsx("pre",{className:"g7dt-pre",children:JSON.stringify(f,null,2)})]})]},f.id)),l.jsx("div",{className:"g7dt-flex g7dt-justify-end",children:l.jsx("button",{onClick:()=>a(!t),className:`g7dt-tab-button ${t?"g7dt-tab-active":""}`,children:"🔍 Auto-Binding Check"})}),t&&i&&l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"Form 바인딩 검증 결과"}),l.jsxs("div",{className:"g7dt-stats-grid g7dt-mb-3",children:[l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-blue",children:i.stats.totalFormsValidated}),l.jsx("div",{className:"g7dt-stat-label",children:"검증된 Form"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-green",children:i.stats.validForms}),l.jsx("div",{className:"g7dt-stat-label",children:"유효"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-red",children:i.stats.formsWithIssues}),l.jsx("div",{className:"g7dt-stat-label",children:"문제 있음"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-yellow",children:i.stats.totalIssues}),l.jsx("div",{className:"g7dt-stat-label",children:"총 이슈"})]})]}),i.stats.topIssues.length>0&&l.jsxs("div",{className:"g7dt-mb-3",children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-2",children:"자주 발생하는 이슈"}),l.jsx("div",{className:"g7dt-space-y-1",children:i.stats.topIssues.slice(0,3).map((f,p)=>l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-text-xs",children:[l.jsx("span",{children:g(f.type)}),l.jsx("span",{className:"g7dt-text-white",children:f.description}),l.jsxs("span",{className:"g7dt-text-muted",children:["(",f.count,")"]})]},p))})]}),i.issues.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"바인딩 이슈가 없습니다 ✅"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-60 g7dt-overflow-y-auto",children:i.issues.slice().reverse().slice(0,30).map(f=>l.jsxs("div",{className:`g7dt-list-item ${f.severity==="error"?"g7dt-border-red":f.severity==="warning"?"g7dt-border-yellow":""}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{children:g(f.type)}),l.jsx("span",{className:`g7dt-text-xs g7dt-font-bold ${h(f.severity)}`,children:f.type}),f.formDataKey&&l.jsx("span",{className:"g7dt-text-xs g7dt-text-blue g7dt-font-mono",children:f.formDataKey})]}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-white g7dt-mt-1",children:f.description}),l.jsxs("div",{className:"g7dt-text-xs g7dt-text-green g7dt-mt-1",children:["💡 ",f.suggestion]}),f.contextInfo&&l.jsxs("div",{className:"g7dt-flex g7dt-gap-2 g7dt-mt-1",children:[f.contextInfo.isInsideModal&&l.jsx("span",{className:"g7dt-badge g7dt-text-xs",children:"🪟 modal"}),f.contextInfo.isInsideSortable&&l.jsx("span",{className:"g7dt-badge g7dt-text-xs",children:"📊 sortable"}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted",children:["depth: ",f.contextInfo.depth]})]})]},f.id))})]})]})},bk=({devTools:r})=>{const e=r.getConditionalInfo();return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-text-purple g7dt-mb-2",children:["if 조건 (",e.ifConditions.length,")"]}),l.jsx("div",{className:"g7dt-space-y-1 g7dt-scroll-list",children:e.ifConditions.length===0?l.jsx("div",{className:"g7dt-empty-message",children:"추적된 if 조건 없음"}):e.ifConditions.map(t=>l.jsx("div",{className:`g7dt-condition-item ${t.evaluatedValue?"g7dt-condition-true":"g7dt-condition-false"}`,children:l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsx("span",{className:"g7dt-font-mono g7dt-text-lightgray g7dt-truncate-60",children:t.expression}),l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{className:t.evaluatedValue?"g7dt-badge-success":"g7dt-badge-error",children:t.evaluatedValue?"true":"false"}),l.jsxs("span",{className:"g7dt-text-gray",children:[t.evaluationCount,"회"]})]})]})},t.id))})]}),l.jsxs("div",{children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-text-cyan g7dt-mb-2",children:["iteration (",e.iterations.length,")"]}),l.jsx("div",{className:"g7dt-space-y-1 g7dt-scroll-list",children:e.iterations.length===0?l.jsx("div",{className:"g7dt-empty-message",children:"추적된 iteration 없음"}):e.iterations.map(t=>l.jsxs("div",{className:"g7dt-card g7dt-text-xs",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-1",children:[l.jsx("span",{className:"g7dt-font-mono g7dt-text-lightgray g7dt-truncate-60",children:t.source}),l.jsxs("span",{className:t.sourceLength>0?"g7dt-badge-blue":"g7dt-badge-warning",children:[t.sourceLength,"개 항목"]})]}),l.jsxs("div",{className:"g7dt-text-gray",children:[l.jsxs("span",{className:"g7dt-mr-2",children:["item_var: ",t.itemVar]}),t.indexVar&&l.jsxs("span",{children:["index_var: ",t.indexVar]})]})]},t.id))})]}),(e.ifConditions.some(t=>t.evaluatedValue===!1&&t.evaluationCount>5)||e.iterations.some(t=>t.sourceLength===0))&&l.jsxs("div",{className:"g7dt-warning-box",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-text-yellow g7dt-mb-2",children:"잠재적 문제"}),l.jsxs("div",{className:"g7dt-space-y-1 g7dt-text-xs",children:[e.ifConditions.filter(t=>t.evaluatedValue===!1&&t.evaluationCount>5).map(t=>l.jsxs("div",{className:"g7dt-text-lightgray",children:["⚠️ if 조건 항상 false: ",t.expression]},t.id)),e.iterations.filter(t=>t.sourceLength===0).map(t=>l.jsxs("div",{className:"g7dt-text-lightgray",children:["⚠️ iteration 소스 비어있음: ",t.source]},t.id))]})]})]})},vk=({devTools:r})=>{const[e,t]=j.useState([]),[a,i]=j.useState({totalEvaluations:0,uniqueExpressions:0,warningCount:0,cacheHitRate:0,averageDuration:0,byType:{},byWarning:{}}),[o,d]=j.useState(""),[g,h]=j.useState(!1),[f,p]=j.useState(null),y=j.useCallback(()=>{const A=r.getExpressionInfo();t(A.expressions),i(A.stats)},[r]);j.useEffect(()=>{y();const A=r.watchExpressions(()=>{y()}),O=setInterval(y,2e3);return()=>{A(),clearInterval(O)}},[r,y]);const x=e.filter(A=>{if(g&&!A.warning)return!1;if(o){const O=o.toLowerCase();return A.expression.toLowerCase().includes(O)||A.componentName?.toLowerCase().includes(O)||A.propName?.toLowerCase().includes(O)||A.resultType.toLowerCase().includes(O)}return!0}),S=A=>{switch(A){case"string":return"g7dt-text-green";case"number":return"g7dt-text-blue";case"boolean":return"g7dt-text-purple";case"array":return"g7dt-text-cyan";case"object":return"g7dt-text-yellow";case"undefined":case"null":return"g7dt-text-red";default:return"g7dt-text-gray"}},v=A=>{switch(A){case"undefined-result":return"undefined 결과";case"null-result":return"null 결과";case"array-to-string":return"배열→문자열";case"object-to-string":return"객체→문자열";case"missing-optional-chain":return"?. 누락 의심";case"wrong-iteration-var":return"잘못된 반복 변수";case"type-mismatch":return"타입 불일치";case"cache-stale":return"캐시 오래됨";case"slow-evaluation":return"느린 평가";default:return A}},w=(A,O)=>O==="undefined"?"undefined":O==="null"?"null":O==="string"?`"${String(A).substring(0,50)}${String(A).length>50?"...":""}"`:O==="array"?`Array(${Array.isArray(A)?A.length:"?"})`:O==="object"?"Object{...}":String(A),k=()=>{r.clearExpressions(),t([]),p(null)};return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-stats-grid-5",children:[l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-lg g7dt-text-blue",children:a.totalEvaluations}),l.jsx("div",{className:"g7dt-stat-label-xs",children:"총 평가"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-lg g7dt-text-green",children:a.uniqueExpressions}),l.jsx("div",{className:"g7dt-stat-label-xs",children:"고유 표현식"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-lg g7dt-text-yellow",children:a.warningCount}),l.jsx("div",{className:"g7dt-stat-label-xs",children:"경고"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsxs("div",{className:"g7dt-stat-value-lg g7dt-text-purple",children:[(a.cacheHitRate*100).toFixed(0),"%"]}),l.jsx("div",{className:"g7dt-stat-label-xs",children:"캐시 히트"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsxs("div",{className:"g7dt-stat-value-lg g7dt-text-cyan",children:[a.averageDuration.toFixed(1),"ms"]}),l.jsx("div",{className:"g7dt-stat-label-xs",children:"평균 시간"})]})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2 g7dt-items-center",children:[l.jsx("input",{type:"text",placeholder:"표현식, 컴포넌트, prop 검색...",value:o,onChange:A=>d(A.target.value),className:"g7dt-input g7dt-flex-1"}),l.jsxs("label",{className:"g7dt-checkbox-label",children:[l.jsx("input",{type:"checkbox",checked:g,onChange:A=>h(A.target.checked),className:"g7dt-checkbox"}),"경고만"]}),l.jsx("button",{onClick:k,className:"g7dt-btn-danger-sm",children:"초기화"})]}),Object.keys(a.byType).length>0&&l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1",children:Object.entries(a.byType).map(([A,O])=>l.jsxs("span",{className:`g7dt-type-tag ${S(A)}`,children:[A,": ",O]},A))}),l.jsx("div",{className:"g7dt-space-y-1 g7dt-expr-list",children:x.length===0?l.jsx("div",{className:"g7dt-empty-message g7dt-py-4",children:o||g?"조건에 맞는 표현식이 없습니다":"추적된 표현식이 없습니다"}):x.slice(-50).reverse().map(A=>l.jsx("div",{onClick:()=>p(A),className:`g7dt-expr-item ${f?.id===A.id?"g7dt-expr-selected":A.warning?"g7dt-expr-warning":""}`,children:l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-start g7dt-gap-2",children:[l.jsxs("div",{className:"g7dt-flex-1 g7dt-min-w-0",children:[l.jsx("div",{className:"g7dt-font-mono g7dt-text-white g7dt-truncate",title:A.expression,children:A.expression}),l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-mt-1 g7dt-text-xxs",children:[A.componentName&&l.jsxs("span",{className:"g7dt-text-gray",children:[A.componentName,A.propName&&`.${A.propName}`]}),l.jsx("span",{className:S(A.resultType),children:w(A.result,A.resultType)})]})]}),l.jsxs("div",{className:"g7dt-flex g7dt-flex-col g7dt-items-end g7dt-gap-1",children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-1",children:[A.fromCache&&l.jsx("span",{className:"g7dt-mini-badge g7dt-badge-success",children:"캐시"}),A.warning&&l.jsx("span",{className:"g7dt-mini-badge g7dt-badge-warning",children:v(A.warning.type)})]}),A.duration!==void 0&&l.jsxs("span",{className:"g7dt-text-xxs g7dt-text-gray",children:[A.duration.toFixed(2),"ms"]})]})]})},A.id))}),f&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:"표현식 상세"}),l.jsx("button",{onClick:()=>p(null),className:"g7dt-btn-close",children:"✕"})]}),l.jsxs("div",{className:"g7dt-space-y-2 g7dt-text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"표현식:"}),l.jsx("code",{className:"g7dt-code g7dt-text-green",children:f.expression})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"결과:"}),l.jsx("span",{className:`g7dt-ml-2 ${S(f.resultType)}`,children:JSON.stringify(f.result,null,2)?.substring(0,200)}),l.jsxs("span",{className:"g7dt-ml-2 g7dt-text-darkgray",children:["(",f.resultType,")"]})]}),f.componentName&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"컴포넌트:"}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-blue",children:f.componentName}),f.propName&&l.jsxs("span",{className:"g7dt-text-gray",children:[".",f.propName]})]}),f.method&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"메서드:"}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-purple",children:f.method})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"캐시:"}),l.jsxs("span",{className:`g7dt-ml-2 ${f.fromCache?"g7dt-text-green":"g7dt-text-gray"}`,children:[f.fromCache?"캐시에서 로드":"새로 평가",f.skipCache&&" (skipCache)"]})]}),f.duration!==void 0&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"소요 시간:"}),l.jsxs("span",{className:`g7dt-ml-2 ${f.duration>10?"g7dt-text-red":"g7dt-text-lightgray"}`,children:[f.duration.toFixed(3),"ms"]})]}),f.warning&&l.jsxs("div",{className:"g7dt-warning-box-light",children:[l.jsxs("div",{className:"g7dt-text-yellow g7dt-font-bold",children:["⚠️ ",v(f.warning.type)]}),l.jsx("div",{className:"g7dt-text-lightgray g7dt-mt-1",children:f.warning.message}),f.warning.suggestion&&l.jsxs("div",{className:"g7dt-text-gray g7dt-mt-1 g7dt-text-xxs",children:["💡 ",f.warning.suggestion]})]}),f.steps&&f.steps.length>0&&l.jsxs("details",{className:"g7dt-details",children:[l.jsxs("summary",{className:"g7dt-summary",children:["평가 단계 (",f.steps.length,")"]}),l.jsx("div",{className:"g7dt-mt-1 g7dt-space-y-1 g7dt-pl-2 g7dt-border-l",children:f.steps.map((A,O)=>l.jsxs("div",{className:"g7dt-text-xxs",children:[l.jsx("span",{className:"g7dt-text-purple",children:A.step}),A.path&&l.jsx("span",{className:"g7dt-text-gray g7dt-ml-1",children:A.path}),A.fromCache&&l.jsx("span",{className:"g7dt-text-green g7dt-ml-1",children:"(cached)"}),A.error&&l.jsx("span",{className:"g7dt-text-red g7dt-ml-1",children:A.error})]},O))})]})]})]}),Object.keys(a.byWarning).length>0&&l.jsxs("div",{className:"g7dt-warning-box-light",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-text-yellow g7dt-mb-2",children:"경고 요약"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-2",children:Object.entries(a.byWarning).map(([A,O])=>l.jsxs("span",{className:"g7dt-warning-tag",children:[v(A),": ",O]},A))})]})]})},wk=({devTools:r})=>{const e=r.getHandlers(),[t,a]=j.useState(""),[i,o]=j.useState("all"),d={"built-in":e.filter(f=>f.category==="built-in"),custom:e.filter(f=>f.category==="custom"),module:e.filter(f=>f.category==="module"),plugin:e.filter(f=>f.category==="plugin")},g={all:e.length,"built-in":d["built-in"].length,custom:d.custom.length,module:d.module.length,plugin:d.plugin.length},h=e.filter(f=>i!=="all"&&f.category!==i?!1:t?f.name.toLowerCase().includes(t.toLowerCase())||f.description?.toLowerCase().includes(t.toLowerCase()):!0);return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsx("div",{className:"g7dt-flex g7dt-gap-2",children:["all","built-in","custom","module","plugin"].map(f=>l.jsxs("button",{onClick:()=>o(f),className:i===f?"g7dt-filter-btn g7dt-filter-active":"g7dt-filter-btn",children:[f==="all"?"전체":f," (",g[f],")"]},f))}),l.jsx("input",{type:"text",placeholder:"핸들러 이름 검색...",value:t,onChange:f=>a(f.target.value),className:"g7dt-input g7dt-w-full"}),l.jsx("div",{className:"g7dt-space-y-1 g7dt-handler-list",children:h.length===0?l.jsx("div",{className:"g7dt-empty-message g7dt-py-4",children:"등록된 핸들러가 없습니다"}):h.map(f=>l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsx("span",{className:"g7dt-font-mono g7dt-text-blue",children:f.name}),l.jsx("span",{className:f.category==="built-in"?"g7dt-mini-badge g7dt-badge-success":f.category==="module"?"g7dt-mini-badge g7dt-badge-purple":f.category==="plugin"?"g7dt-mini-badge g7dt-badge-info":"g7dt-mini-badge g7dt-badge-warning",children:f.category})]}),f.description&&l.jsx("div",{className:"g7dt-text-xs g7dt-text-gray g7dt-mt-1",children:f.description})]},f.name))}),l.jsxs("div",{className:"g7dt-text-xs g7dt-text-gray",children:["총 ",e.length,"개 핸들러 | 빌트인 ",g["built-in"]," | 커스텀 ",g.custom," | 모듈 ",g.module," | 플러그인 ",g.plugin]})]})},Sk=({devTools:r})=>{const[e,t]=j.useState(r.getComponentEventInfo()),[a,i]=j.useState(null),o=j.useCallback(()=>{t(r.getComponentEventInfo())},[r]);j.useEffect(()=>{o();const g=setInterval(o,2e3);return()=>clearInterval(g)},[o]);const d=a?e.emitHistory.filter(g=>g.eventName===a):e.emitHistory;return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-stats-grid-3",children:[l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value-lg g7dt-text-blue",children:e.subscriptions.length}),l.jsx("div",{className:"g7dt-stat-label",children:"이벤트 타입"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value-lg g7dt-text-green",children:e.totalSubscribers}),l.jsx("div",{className:"g7dt-stat-label",children:"총 구독자"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value-lg g7dt-text-purple",children:e.totalEmits}),l.jsx("div",{className:"g7dt-stat-label",children:"총 발행"})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"구독된 이벤트"}),l.jsxs("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-2",children:[l.jsx("button",{onClick:()=>i(null),className:a===null?"g7dt-filter-btn g7dt-filter-active":"g7dt-filter-btn",children:"전체"}),e.subscriptions.map(g=>l.jsxs("button",{onClick:()=>i(g.eventName),className:a===g.eventName?"g7dt-filter-btn g7dt-filter-active":"g7dt-filter-btn",children:[g.eventName," (",g.subscriberCount,")"]},g.eventName))]})]}),l.jsxs("div",{children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:["발행 이력 ",a&&`(${a})`]}),l.jsx("div",{className:"g7dt-space-y-1 g7dt-event-list",children:d.length===0?l.jsx("div",{className:"g7dt-empty-message g7dt-py-4",children:"이벤트 발행 이력이 없습니다"}):d.slice(-30).reverse().map(g=>l.jsxs("div",{className:`g7dt-card g7dt-text-xs ${g.hasError?"g7dt-card-error":""}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsx("span",{className:"g7dt-font-mono g7dt-text-green",children:g.eventName}),l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsxs("span",{className:"g7dt-text-gray",children:[g.listenerCount," listeners"]}),g.hasError&&l.jsx("span",{className:"g7dt-text-red g7dt-text-xxs",children:"에러"})]})]}),g.data!==void 0&&l.jsxs("details",{className:"g7dt-details g7dt-mt-1",children:[l.jsx("summary",{className:"g7dt-summary",children:"데이터"}),l.jsx("pre",{className:"g7dt-pre",children:JSON.stringify(g.data,null,2)})]}),g.hasError&&g.errorMessage&&l.jsx("div",{className:"g7dt-error-inline",children:g.errorMessage})]},g.id))})]}),l.jsx("button",{onClick:o,className:"g7dt-btn-secondary",children:"새로고침"})]})},Ck=({devTools:r})=>{const e=r.getDataSources(),[t,a]=j.useState("all"),[i,o]=j.useState(null),[d,g]=j.useState(!1),[h,f]=j.useState(null),p=j.useCallback(()=>{f(r.getDataPathTransformTrackingInfo())},[r]);j.useEffect(()=>{if(d){p();const k=setInterval(p,2e3);return()=>clearInterval(k)}},[d,p]);const y=k=>{switch(k){case"api_response":return"📥";case"extract_data":return"📄";case"apply_path":return"🔗";case"init_global":return"🌐";case"init_local":return"📌";default:return"❓"}},x=e.filter(k=>t==="all"?!0:k.status===t),S={all:e.length,idle:e.filter(k=>k.status==="idle").length,loading:e.filter(k=>k.status==="loading").length,loaded:e.filter(k=>k.status==="loaded").length,error:e.filter(k=>k.status==="error").length},v=k=>{switch(k){case"loaded":return"g7dt-badge-success";case"loading":return"g7dt-badge-warning";case"error":return"g7dt-badge-error";default:return"g7dt-badge-gray"}},w=i?e.find(k=>k.id===i):null;return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsx("div",{className:"g7dt-flex g7dt-gap-2",children:["all","idle","loading","loaded","error"].map(k=>l.jsxs("button",{onClick:()=>a(k),className:t===k?"g7dt-filter-btn g7dt-filter-active":"g7dt-filter-btn",children:[k==="all"?"전체":k," (",S[k],")"]},k))}),l.jsx("div",{className:"g7dt-ds-grid",children:x.length===0?l.jsx("div",{className:"g7dt-empty-message g7dt-col-span-2 g7dt-py-4",children:"데이터소스가 없습니다"}):x.map(k=>l.jsxs("div",{onClick:()=>o(k.id),className:`g7dt-ds-item ${i===k.id?"g7dt-ds-selected":""}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsx("span",{className:"g7dt-font-mono g7dt-text-blue g7dt-truncate",children:k.id}),l.jsx("span",{className:`g7dt-mini-badge ${v(k.status)}`,children:k.status})]}),l.jsx("div",{className:"g7dt-text-gray g7dt-mt-1 g7dt-truncate",children:k.endpoint||"(endpoint 없음)"}),k.itemCount!==void 0&&l.jsxs("div",{className:"g7dt-text-lightgray g7dt-mt-1",children:[k.itemCount,"개 항목"]})]},k.id))}),w&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:w.id}),l.jsx("button",{onClick:()=>o(null),className:"g7dt-btn-close",children:"✕"})]}),l.jsxs("div",{className:"g7dt-space-y-2 g7dt-text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"엔드포인트:"}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-green",children:w.endpoint||"-"})]}),w.dataPath&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"데이터 경로:"}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-yellow",children:w.dataPath})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"상태:"}),l.jsx("span",{className:`g7dt-ml-2 g7dt-mini-badge ${v(w.status)}`,children:w.status})]}),w.itemCount!==void 0&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"항목 수:"}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-blue",children:w.itemCount})]}),w.keys&&w.keys.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"키:"}),l.jsxs("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1 g7dt-mt-1",children:[w.keys.slice(0,10).map(k=>l.jsx("span",{className:"g7dt-key-tag",children:k},k)),w.keys.length>10&&l.jsxs("span",{className:"g7dt-text-gray",children:["+",w.keys.length-10,"개"]})]})]}),w.dependencies&&w.dependencies.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-gray",children:"의존성:"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1 g7dt-mt-1",children:w.dependencies.map(k=>l.jsx("span",{className:"g7dt-dep-tag",children:k},k))})]})]})]}),l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsxs("div",{className:"g7dt-text-xs g7dt-text-gray",children:["총 ",e.length,"개 데이터소스 | 로드됨 ",S.loaded," | 로딩중 ",S.loading," | 에러 ",S.error]}),l.jsx("button",{onClick:()=>g(!d),className:`g7dt-tab-button ${d?"g7dt-tab-active":""}`,children:"🔀 Path Transform"})]}),d&&h&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:["데이터 경로 변환 추적 (",h.transforms.length,"개)"]}),l.jsxs("div",{className:"g7dt-stats-grid-3 g7dt-mb-3",children:[l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-xl g7dt-font-bold g7dt-text-blue",children:h.stats.totalTransforms}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"총 변환"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-xl g7dt-font-bold g7dt-text-purple",children:Object.keys(h.stats.byDataSource).length}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"데이터소스"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-xl g7dt-font-bold g7dt-text-yellow",children:h.stats.warningsCount}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"경고"})]})]}),h.transforms.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"변환 기록이 없습니다"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-60 g7dt-overflow-y-auto",children:h.transforms.slice().reverse().slice(0,20).map((k,A)=>l.jsxs("div",{className:`g7dt-list-item ${k.warnings.length>0?"g7dt-border-yellow":""}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{className:"g7dt-text-xs g7dt-text-blue g7dt-font-mono",children:k.dataSourceId}),k.warnings.length>0&&l.jsxs("span",{className:"g7dt-badge g7dt-text-xs g7dt-text-yellow",children:["⚠️ ",k.warnings.length]})]}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1 g7dt-mt-1",children:k.transformSteps.map((O,N)=>l.jsxs("span",{className:"g7dt-badge g7dt-text-xs",title:`${O.inputPath} → ${O.outputPath}`,children:[y(O.step)," ",O.step]},N))}),k.finalBinding&&l.jsxs("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mt-1",children:["최종: ",l.jsx("span",{className:"g7dt-text-green",children:k.finalBinding.expression}),"→ ",l.jsx("span",{className:"g7dt-text-blue",children:k.finalBinding.resolvedPath})]}),k.warnings.length>0&&l.jsx("div",{className:"g7dt-text-xs g7dt-text-yellow g7dt-mt-1",children:k.warnings[0]})]},`${k.dataSourceId}-${A}`))}),h.stats.commonWarnings.length>0&&l.jsxs("div",{className:"g7dt-mt-3",children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-1",children:"자주 발생하는 경고"}),l.jsx("div",{className:"g7dt-space-y-1",children:h.stats.commonWarnings.slice(0,5).map((k,A)=>l.jsxs("div",{className:"g7dt-text-xs g7dt-text-yellow",children:[k.warning," (",k.count,"회)"]},A))})]})]})]})},jk=({devTools:r})=>{const[e,t]=j.useState(r.getStateRenderingInfo()),[a,i]=j.useState(null),[o,d]=j.useState(!1),[g,h]=j.useState(""),f=j.useCallback(()=>{t(r.getStateRenderingInfo())},[r]);j.useEffect(()=>{f();const v=setInterval(f,2e3);return()=>clearInterval(v)},[f]);const p=e.logs.filter(v=>!(o&&v.renderedComponents.length>0||g&&!v.statePath.toLowerCase().includes(g.toLowerCase()))),y=a?e.logs.find(v=>v.setStateId===a):null,x=e.stats,S=e.logs.filter(v=>v.renderedComponents.length===0).length;return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-stats-grid",children:[l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-blue",children:x.totalStateChanges}),l.jsx("div",{className:"g7dt-stat-label",children:"상태 변경"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-green",children:x.totalRenders}),l.jsx("div",{className:"g7dt-stat-label",children:"총 렌더링"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsxs("div",{className:"g7dt-stat-value g7dt-text-purple",children:[x.avgRenderDuration.toFixed(1),"ms"]}),l.jsx("div",{className:"g7dt-stat-label",children:"평균 렌더 시간"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:`g7dt-stat-value ${S>0?"g7dt-text-yellow":"g7dt-text-green"}`,children:S}),l.jsx("div",{className:"g7dt-stat-label",children:"렌더링 없음"})]})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsx("input",{type:"text",placeholder:"상태 경로 필터 (예: _global.user)",value:g,onChange:v=>h(v.target.value),className:"g7dt-input g7dt-flex-1"}),l.jsx("button",{onClick:()=>d(!o),className:o?"g7dt-filter-btn-active-yellow":"g7dt-filter-btn",children:"렌더링 없음만"})]}),l.jsx("div",{className:"g7dt-scroll-list",children:p.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"상태-렌더링 로그가 없습니다"}):p.slice(-30).reverse().map(v=>{const w=v.renderedComponents.length>0,k=w?"✅":"⚠️",A=new Date(v.timestamp).toLocaleTimeString();return l.jsxs("div",{onClick:()=>i(v.setStateId),className:`g7dt-render-log-item ${a===v.setStateId?"g7dt-selected":w?"":"g7dt-warning"}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsxs("span",{className:"g7dt-mono g7dt-text-blue",children:[k," ",v.statePath]}),l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[w?l.jsxs("span",{className:"g7dt-text-green",children:[v.renderedComponents.length,"개 렌더"]}):l.jsx("span",{className:"g7dt-text-yellow",children:"렌더링 없음"}),l.jsx("span",{className:"g7dt-text-muted",children:A})]})]}),v.triggeredBy?.handlerType&&l.jsxs("div",{className:"g7dt-text-muted g7dt-mt-1",children:["트리거: ",v.triggeredBy.handlerType]})]},v.setStateId)})}),y&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:y.statePath}),l.jsx("button",{onClick:()=>i(null),className:"g7dt-close-btn",children:"✕"})]}),l.jsxs("div",{className:"g7dt-space-y-2 g7dt-text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"setStateId:"}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-purple g7dt-mono",children:y.setStateId})]}),y.triggeredBy&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"트리거:"}),l.jsxs("span",{className:"g7dt-ml-2 g7dt-text-yellow",children:[y.triggeredBy.handlerType,y.triggeredBy.actionId&&` (${y.triggeredBy.actionId})`]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"이전 값:"}),l.jsx("pre",{className:"g7dt-pre g7dt-text-red",children:JSON.stringify(y.oldValue,null,2)?.slice(0,200)})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"새 값:"}),l.jsx("pre",{className:"g7dt-pre g7dt-text-green",children:JSON.stringify(y.newValue,null,2)?.slice(0,200)})]}),y.renderedComponents.length>0?l.jsxs("div",{children:[l.jsxs("span",{className:"g7dt-text-muted",children:["렌더링된 컴포넌트 (",y.renderedComponents.length,"개):"]}),l.jsxs("div",{className:"g7dt-mt-1 g7dt-space-y-1",children:[y.renderedComponents.slice(0,10).map((v,w)=>l.jsxs("div",{className:"g7dt-render-comp-item",children:[l.jsx("span",{className:"g7dt-text-blue",children:v.componentName}),l.jsxs("span",{className:"g7dt-text-muted",children:[v.renderDuration.toFixed(2),"ms"]})]},w)),y.renderedComponents.length>10&&l.jsxs("div",{className:"g7dt-text-muted g7dt-text-center",children:["... 외 ",y.renderedComponents.length-10,"개"]})]}),l.jsxs("div",{className:"g7dt-mt-2 g7dt-text-muted",children:["총 렌더 시간: ",y.totalRenderDuration.toFixed(2),"ms"]})]}):l.jsxs("div",{className:"g7dt-warning-box",children:[l.jsx("span",{className:"g7dt-text-yellow",children:"⚠️ 렌더링이 발생하지 않았습니다"}),l.jsxs("div",{className:"g7dt-text-muted g7dt-mt-1 g7dt-text-xxs",children:["가능한 원인:",l.jsxs("ul",{className:"g7dt-list g7dt-mt-1",children:[l.jsx("li",{children:"해당 상태를 바인딩하는 컴포넌트가 없음"}),l.jsx("li",{children:"컴포넌트가 마운트되지 않은 상태"}),l.jsx("li",{children:"동일한 값으로 상태 설정"})]})]})]})]})]}),x.topRenderedComponents.length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"가장 많이 렌더링된 컴포넌트"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-2",children:x.topRenderedComponents.slice(0,5).map((v,w)=>l.jsxs("span",{className:"g7dt-tag",children:[v.name,": ",l.jsx("span",{className:"g7dt-text-blue",children:v.count})]},w))})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsx("button",{onClick:f,className:"g7dt-btn-secondary",children:"새로고침"}),l.jsx("button",{onClick:()=>{r.clearStateRenderingLogs(),f()},className:"g7dt-btn-danger",children:"로그 초기화"})]})]})},kk=({devTools:r})=>{const[e,t]=j.useState(null),[a,i]=j.useState(null),[o,d]=j.useState("all"),g=j.useCallback(()=>{t(r.getStyleValidationInfo())},[r]);if(j.useEffect(()=>{g();const y=setInterval(g,2e3);return()=>clearInterval(y)},[g]),!e)return l.jsx("div",{className:"g7dt-empty-state",children:"로딩 중..."});const h=e.issues.filter(y=>o==="all"?!0:y.type===o),f=a?e.issues.find(y=>y.componentId===a):null,p=e.stats;return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-stats-grid",children:[l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value g7dt-text-blue",children:p.totalComponents}),l.jsx("div",{className:"g7dt-stat-label",children:"총 컴포넌트"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:`g7dt-stat-value ${p.invisibleCount>0?"g7dt-text-red":"g7dt-text-green"}`,children:p.invisibleCount}),l.jsx("div",{className:"g7dt-stat-label",children:"숨겨진 요소"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:`g7dt-stat-value ${p.tailwindIssueCount>0?"g7dt-text-yellow":"g7dt-text-green"}`,children:p.tailwindIssueCount}),l.jsx("div",{className:"g7dt-stat-label",children:"Tailwind 이슈"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:`g7dt-stat-value ${p.darkModeIssueCount>0?"g7dt-text-purple":"g7dt-text-green"}`,children:p.darkModeIssueCount}),l.jsx("div",{className:"g7dt-stat-label",children:"다크모드 이슈"})]})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsxs("select",{value:o,onChange:y=>d(y.target.value),className:"g7dt-select",children:[l.jsx("option",{value:"all",children:"모든 이슈"}),l.jsx("option",{value:"invisible-element",children:"숨겨진 요소"}),l.jsx("option",{value:"tailwind-purging",children:"Tailwind 퍼징"}),l.jsx("option",{value:"dark-mode-missing",children:"다크모드 누락"})]}),l.jsx("button",{onClick:g,className:"g7dt-btn-secondary",children:"새로고침"})]}),l.jsx("div",{className:"g7dt-scroll-list",children:h.length===0?l.jsx("div",{className:"g7dt-empty-state",children:e.issues.length===0?"스타일 이슈가 없습니다 ✓":"필터에 맞는 이슈가 없습니다"}):h.map(y=>{const x=y.type==="invisible-element"?"👁️":y.type==="tailwind-purging"?"🎨":"🌙",S=y.severity==="error"?"g7dt-severity-error":y.severity==="warning"?"g7dt-severity-warning":"g7dt-severity-info";return l.jsxs("div",{onClick:()=>i(y.componentId),className:`g7dt-style-issue-item ${S} ${a===y.componentId?"g7dt-selected":""}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsxs("span",{className:"g7dt-mono g7dt-text-blue",children:[x," ",y.componentName]}),l.jsx("span",{className:y.severity==="error"?"g7dt-badge-error":y.severity==="warning"?"g7dt-badge-warning":"g7dt-badge-info",children:y.type})]}),l.jsx("div",{className:"g7dt-text-muted g7dt-mt-1 g7dt-truncate",children:y.description})]},y.componentId)})}),f&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:f.componentName}),l.jsx("button",{onClick:()=>i(null),className:"g7dt-close-btn",children:"✕"})]}),l.jsxs("div",{className:"g7dt-space-y-2 g7dt-text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"이슈 타입:"}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-yellow",children:f.type})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"설명:"}),l.jsx("div",{className:"g7dt-mt-1 g7dt-text-white",children:f.description})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"CSS 속성:"}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-purple",children:f.property}),l.jsxs("span",{className:"g7dt-ml-2 g7dt-text-muted",children:["= ",f.currentValue]}),f.expectedValue&&l.jsxs("span",{className:"g7dt-ml-2 g7dt-text-green",children:["(예상: ",f.expectedValue,")"]})]}),f.suggestion&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"해결 방법:"}),l.jsx("div",{className:"g7dt-mt-1 g7dt-text-green",children:f.suggestion})]})]})]}),e.componentStyles.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:["컴포넌트 스타일 (",e.componentStyles.length,")"]}),l.jsx("div",{className:"g7dt-scroll-list-sm",children:e.componentStyles.slice(0,20).map((y,x)=>l.jsxs("div",{className:"g7dt-list-item",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-blue",children:y.componentName}),l.jsxs("span",{className:"g7dt-text-muted",children:[y.classes.length," classes"]})]}),y.classes.length>0&&l.jsxs("div",{className:"g7dt-text-muted g7dt-mt-1 g7dt-truncate",children:[y.classes.slice(0,5).join(" "),y.classes.length>5&&"..."]})]},x))})]})]})},Nk=({devTools:r})=>{const[e,t]=j.useState(null),[a,i]=j.useState(null),[o,d]=j.useState("all"),g=j.useCallback(()=>{t(r.getAuthDebugInfo())},[r]);if(j.useEffect(()=>{g();const x=setInterval(g,2e3);return()=>clearInterval(x)},[g]),!e)return l.jsx("div",{className:"g7dt-empty-state",children:"로딩 중..."});const h=e.events.filter(x=>o==="all"?!0:x.type===o),f=a?e.events.find(x=>x.id===a):null,p=e.stats,y=e.state;return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-justify-between g7dt-mb-3",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:"현재 인증 상태"}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted",children:["소스: ",y.source||"unknown"]})]}),l.jsxs("div",{className:"g7dt-stats-grid-3 g7dt-mb-3",children:[l.jsx("div",{className:"g7dt-text-center",children:l.jsx("div",{className:`g7dt-text-lg g7dt-font-bold ${y.isAuthenticated?"g7dt-text-green":"g7dt-text-red"}`,children:y.isAuthenticated?"✓ 인증됨":"✕ 미인증"})}),l.jsx("div",{className:"g7dt-text-center",children:l.jsx("div",{className:`g7dt-text-lg g7dt-font-bold ${y.tokens.hasAccessToken?"g7dt-text-green":"g7dt-text-yellow"}`,children:y.tokens.hasAccessToken?"✓ 토큰 유효":"⚠ 토큰 없음"})}),l.jsx("div",{className:"g7dt-text-center",children:l.jsx("div",{className:"g7dt-text-lg g7dt-font-bold g7dt-text-blue",children:y.user?.name||y.user?.email||"익명"})})]}),y.user&&l.jsxs("div",{className:"g7dt-border-t g7dt-pt-3 g7dt-mt-3",children:[l.jsxs("div",{className:"g7dt-grid-2 g7dt-gap-2 g7dt-text-xs",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"ID:"}),l.jsx("span",{className:"g7dt-text-white g7dt-mono",children:y.user.id})]}),l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"이메일:"}),l.jsx("span",{className:"g7dt-text-white g7dt-truncate g7dt-ml-2",title:y.user.email,children:y.user.email})]}),y.user.name&&l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"이름:"}),l.jsx("span",{className:"g7dt-text-white",children:y.user.name})]}),y.user.nickname&&l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"닉네임:"}),l.jsx("span",{className:"g7dt-text-white",children:y.user.nickname})]}),y.user.phone&&l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"전화번호:"}),l.jsx("span",{className:"g7dt-text-white",children:y.user.phone})]}),y.user.status&&l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"상태:"}),l.jsx("span",{className:y.user.status==="active"?"g7dt-text-green":"g7dt-text-yellow",children:y.user.status})]}),y.user.locale&&l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"언어:"}),l.jsx("span",{className:"g7dt-text-white",children:y.user.locale})]})]}),y.user.roles&&y.user.roles.length>0&&l.jsxs("div",{className:"g7dt-mt-2",children:[l.jsx("span",{className:"g7dt-text-muted g7dt-text-xs",children:"역할: "}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1 g7dt-mt-1",children:y.user.roles.map((x,S)=>l.jsx("span",{className:"g7dt-role-tag",title:x.guard_name?`guard: ${x.guard_name}`:void 0,children:typeof x=="string"?x:x.name},S))})]}),y.user.permissions&&y.user.permissions.length>0&&l.jsxs("div",{className:"g7dt-mt-2",children:[l.jsx("span",{className:"g7dt-text-muted g7dt-text-xs",children:"권한: "}),l.jsxs("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1 g7dt-mt-1 g7dt-max-h-16 g7dt-overflow-auto",children:[y.user.permissions.slice(0,10).map((x,S)=>l.jsx("span",{className:"g7dt-perm-tag",title:x.guard_name?`guard: ${x.guard_name}`:void 0,children:typeof x=="string"?x:x.name},S)),y.user.permissions.length>10&&l.jsxs("span",{className:"g7dt-text-muted g7dt-text-xs",children:["+",y.user.permissions.length-10,"개"]})]})]}),l.jsxs("div",{className:"g7dt-mt-2 g7dt-grid-2 g7dt-gap-2 g7dt-text-xs",children:[y.user.created_at&&l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"가입일:"}),l.jsx("span",{className:"g7dt-text-muted",children:new Date(y.user.created_at).toLocaleDateString()})]}),y.user.last_login_at&&l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"마지막 로그인:"}),l.jsx("span",{className:"g7dt-text-muted",children:new Date(y.user.last_login_at).toLocaleString()})]}),y.user.email_verified_at&&l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"이메일 인증:"}),l.jsx("span",{className:"g7dt-text-green",children:"✓ 인증됨"})]})]})]}),l.jsx("div",{className:"g7dt-border-t g7dt-pt-3 g7dt-mt-3",children:l.jsxs("div",{className:"g7dt-grid-2 g7dt-gap-2 g7dt-text-xs",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"저장소:"}),l.jsx("span",{className:"g7dt-text-white",children:y.tokens.storage})]}),y.tokens.accessTokenPreview&&l.jsxs("div",{className:"g7dt-flex g7dt-justify-between",children:[l.jsx("span",{className:"g7dt-text-muted",children:"토큰:"}),l.jsx("span",{className:"g7dt-text-muted g7dt-mono",children:y.tokens.accessTokenPreview})]})]})}),y.tokens.accessTokenExpiresAt&&l.jsxs("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mt-2 g7dt-text-center",children:["토큰 만료: ",new Date(y.tokens.accessTokenExpiresAt).toLocaleString()]})]}),l.jsxs("div",{className:"g7dt-stats-grid-5",children:[l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-sm g7dt-text-blue",children:p.loginAttempts}),l.jsx("div",{className:"g7dt-stat-label",children:"로그인 시도"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-sm g7dt-text-green",children:p.successfulLogins}),l.jsx("div",{className:"g7dt-stat-label",children:"성공"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:`g7dt-stat-value-sm ${p.failedLogins>0?"g7dt-text-red":"g7dt-text-muted"}`,children:p.failedLogins}),l.jsx("div",{className:"g7dt-stat-label",children:"실패"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-sm g7dt-text-purple",children:p.tokenRefreshes}),l.jsx("div",{className:"g7dt-stat-label",children:"토큰 갱신"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:`g7dt-stat-value-sm ${p.unauthorizedResponses>0?"g7dt-text-red":"g7dt-text-muted"}`,children:p.unauthorizedResponses}),l.jsx("div",{className:"g7dt-stat-label",children:"401 응답"})]})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsxs("select",{value:o,onChange:x=>d(x.target.value),className:"g7dt-select",children:[l.jsx("option",{value:"all",children:"모든 이벤트"}),l.jsx("option",{value:"login",children:"로그인"}),l.jsx("option",{value:"logout",children:"로그아웃"}),l.jsx("option",{value:"token-refresh",children:"토큰 갱신"}),l.jsx("option",{value:"token-expired",children:"토큰 만료"}),l.jsx("option",{value:"api-unauthorized",children:"401 응답"})]}),l.jsx("button",{onClick:g,className:"g7dt-btn-secondary",children:"새로고침"})]}),l.jsx("div",{className:"g7dt-scroll-list-sm",children:h.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"인증 이벤트가 없습니다"}):h.slice(-20).reverse().map(x=>{const S=x.success?"✅":"❌",v=new Date(x.timestamp).toLocaleTimeString();return l.jsxs("div",{onClick:()=>i(x.id),className:`g7dt-auth-event-item ${a===x.id?"g7dt-selected":x.success?"":"g7dt-error"}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsxs("span",{className:"g7dt-mono",children:[S," ",x.type]}),l.jsx("span",{className:"g7dt-text-muted",children:v})]}),x.error&&l.jsx("div",{className:"g7dt-text-red g7dt-mt-1 g7dt-truncate",children:x.error})]},x.id)})}),f&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:f.type}),l.jsx("button",{onClick:()=>i(null),className:"g7dt-close-btn",children:"✕"})]}),l.jsxs("div",{className:"g7dt-space-y-2 g7dt-text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"결과:"}),l.jsx("span",{className:`g7dt-ml-2 ${f.success?"g7dt-text-green":"g7dt-text-red"}`,children:f.success?"성공":"실패"})]}),f.error&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"에러:"}),l.jsx("div",{className:"g7dt-mt-1 g7dt-text-red",children:f.error})]}),f.details&&Object.keys(f.details).length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"상세:"}),l.jsx("pre",{className:"g7dt-pre g7dt-text-green",children:JSON.stringify(f.details,null,2)})]})]})]}),e.headerAnalysis.length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"최근 API 인증 헤더"}),l.jsx("div",{className:"g7dt-scroll-list-xs",children:e.headerAnalysis.slice(-10).reverse().map((x,S)=>l.jsxs("div",{className:"g7dt-header-item",children:[l.jsx("span",{className:"g7dt-text-blue g7dt-truncate g7dt-flex-1",children:x.url}),l.jsx("span",{className:`g7dt-ml-2 ${x.hasAuthHeader?"g7dt-text-green":"g7dt-text-yellow"}`,children:x.hasAuthHeader?`✓ ${x.headerType}`:"✕ 헤더 없음"}),x.responseStatus&&l.jsx("span",{className:`g7dt-ml-2 ${x.responseStatus<400?"g7dt-text-muted":"g7dt-text-red"}`,children:x.responseStatus})]},S))})]})]})},Ek=({devTools:r})=>{const[e,t]=j.useState([]),[a,i]=j.useState(null),[o,d]=j.useState(null),[g,h]=j.useState("all"),[f,p]=j.useState(""),[y,x]=j.useState(""),S=j.useCallback(()=>{const N=r.getLogInfo();t(N.entries),i(N.stats)},[r]);j.useEffect(()=>{S();const N=setInterval(S,1e3);return()=>clearInterval(N)},[S]);const v=e.filter(N=>!(g!=="all"&&N.level!==g||f&&!N.prefix.toLowerCase().includes(f.toLowerCase())||y&&!N.message.toLowerCase().includes(y.toLowerCase()))),w=o?e.find(N=>N.id===o):null,k=()=>{r.clearLogs(),S(),d(null)},A=N=>{switch(N){case"error":return"g7dt-text-red";case"warn":return"g7dt-text-yellow";case"info":return"g7dt-text-blue";case"debug":return"g7dt-text-muted";default:return"g7dt-text-white"}},O=N=>{switch(N){case"error":return"g7dt-log-error";case"warn":return"g7dt-log-warn";case"info":return"g7dt-log-info";case"debug":return"g7dt-log-debug";default:return"g7dt-log-default"}};return l.jsxs("div",{className:"g7dt-space-y-4",children:[a&&l.jsxs("div",{className:"g7dt-stats-grid-6",children:[l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-sm g7dt-text-white",children:a.totalLogs}),l.jsx("div",{className:"g7dt-stat-label",children:"전체"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-sm g7dt-text-red",children:a.byLevel.error}),l.jsx("div",{className:"g7dt-stat-label",children:"에러"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-sm g7dt-text-yellow",children:a.byLevel.warn}),l.jsx("div",{className:"g7dt-stat-label",children:"경고"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:"g7dt-stat-value-sm g7dt-text-blue",children:a.byLevel.info}),l.jsx("div",{className:"g7dt-stat-label",children:"정보"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:`g7dt-stat-value-sm ${a.recentErrors>0?"g7dt-text-red":"g7dt-text-green"}`,children:a.recentErrors}),l.jsx("div",{className:"g7dt-stat-label",children:"최근 에러"})]}),l.jsxs("div",{className:"g7dt-stat-card-sm",children:[l.jsx("div",{className:`g7dt-stat-value-sm ${a.recentWarnings>0?"g7dt-text-yellow":"g7dt-text-green"}`,children:a.recentWarnings}),l.jsx("div",{className:"g7dt-stat-label",children:"최근 경고"})]})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2 g7dt-flex-wrap",children:[l.jsxs("select",{value:g,onChange:N=>h(N.target.value),className:"g7dt-select",children:[l.jsx("option",{value:"all",children:"모든 레벨"}),l.jsx("option",{value:"error",children:"에러"}),l.jsx("option",{value:"warn",children:"경고"}),l.jsx("option",{value:"info",children:"정보"}),l.jsx("option",{value:"log",children:"로그"}),l.jsx("option",{value:"debug",children:"디버그"})]}),l.jsx("input",{type:"text",placeholder:"prefix 필터",value:f,onChange:N=>p(N.target.value),className:"g7dt-input g7dt-w-32"}),l.jsx("input",{type:"text",placeholder:"메시지 검색",value:y,onChange:N=>x(N.target.value),className:"g7dt-input g7dt-flex-1"}),l.jsx("button",{onClick:S,className:"g7dt-btn-secondary",children:"새로고침"}),l.jsx("button",{onClick:k,className:"g7dt-btn-danger",children:"초기화"})]}),l.jsx("div",{className:"g7dt-scroll-list-lg",children:v.length===0?l.jsx("div",{className:"g7dt-empty-state",children:e.length===0?"로그가 없습니다":"필터에 맞는 로그가 없습니다"}):v.slice(-50).reverse().map(N=>{const D=new Date(N.timestamp).toLocaleTimeString();return l.jsxs("div",{onClick:()=>d(N.id),className:`g7dt-log-item ${o===N.id?"g7dt-selected":O(N.level)}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{className:`g7dt-font-bold g7dt-uppercase ${A(N.level)}`,children:N.level}),l.jsxs("span",{className:"g7dt-text-purple",children:["[",N.prefix,"]"]})]}),l.jsx("span",{className:"g7dt-text-muted",children:D})]}),l.jsx("div",{className:"g7dt-text-white g7dt-mt-1 g7dt-truncate",children:N.message})]},N.id)})}),w&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold",children:[l.jsx("span",{className:A(w.level),children:w.level.toUpperCase()})," ",l.jsxs("span",{className:"g7dt-text-purple",children:["[",w.prefix,"]"]})]}),l.jsx("button",{onClick:()=>d(null),className:"g7dt-close-btn",children:"✕"})]}),l.jsxs("div",{className:"g7dt-space-y-2 g7dt-text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"시간:"}),l.jsx("span",{className:"g7dt-ml-2 g7dt-text-white",children:new Date(w.timestamp).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"메시지:"}),l.jsx("pre",{className:"g7dt-pre g7dt-text-white g7dt-whitespace-pre-wrap",children:w.message})]}),w.args.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"인수:"}),l.jsx("pre",{className:"g7dt-pre g7dt-text-green",children:JSON.stringify(w.args,null,2)})]}),w.stack&&l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"스택 트레이스:"}),l.jsx("pre",{className:"g7dt-pre-stack g7dt-text-red",children:w.stack})]})]})]}),a&&Object.keys(a.byPrefix).length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"Prefix별 로그 수"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-2",children:Object.entries(a.byPrefix).sort((N,D)=>D[1]-N[1]).slice(0,10).map(([N,D])=>l.jsxs("button",{onClick:()=>p(N),className:f===N?"g7dt-prefix-btn-active":"g7dt-prefix-btn",children:[N,": ",l.jsx("span",{className:"g7dt-text-blue",children:D})]},N))})]})]})},_k=({devTools:r})=>{const[e,t]=j.useState(r.getLayoutDebugInfo()),[a,i]=j.useState(!1),[o,d]=j.useState(null),[g,h]=j.useState(!1),[f,p]=j.useState({});j.useEffect(()=>{const A=setInterval(()=>{t(r.getLayoutDebugInfo())},1e3);return()=>clearInterval(A)},[r]),j.useEffect(()=>{(async()=>{try{const O=await fetch("/api/admin/permissions",{headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`,Accept:"application/json"}});if(O.ok){const N=await O.json(),D={},$=M=>{M.forEach(z=>{D[z.identifier]=z.name,z.children?.length&&$(z.children)})};Object.values(N.data?.permissions||{}).forEach(M=>{M.permissions&&$(M.permissions)}),p(D)}}catch(O){console.warn("[G7DevTools] 권한 목록 조회 실패:",O)}})()},[]);const y=e.current,x=y?.layoutJson,S=e.history,v=e.stats,w=x?[{key:"components",label:"컴포넌트",count:Array.isArray(x.components)?x.components.length:0},{key:"data_sources",label:"데이터소스",count:Array.isArray(x.data_sources)?x.data_sources.length:0},{key:"computed",label:"Computed",count:x.computed?Object.keys(x.computed).length:0},{key:"defines",label:"Defines",count:x.defines?Object.keys(x.defines).length:0},{key:"slots",label:"Slots",count:x.slots?Object.keys(x.slots).length:0},{key:"modals",label:"Modals",count:x.modals?Object.keys(x.modals).length:0},{key:"init_actions",label:"초기화 액션",count:Array.isArray(x.init_actions)?x.init_actions.length:0},{key:"scripts",label:"스크립트",count:Array.isArray(x.scripts)?x.scripts.length:0},{key:"meta",label:"메타데이터",count:x.meta?Object.keys(x.meta).length:0},{key:"errorHandling",label:"에러핸들링",count:x.errorHandling?Object.keys(x.errorHandling).length:0},{key:"permissions",label:"권한",count:Array.isArray(x.permissions)?x.permissions.length:0}]:[],k=A=>{navigator.clipboard.writeText(JSON.stringify(A,null,2))};return y?l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"📊 로드 통계"}),l.jsxs("div",{className:"g7dt-grid-3",children:[l.jsxs("div",{className:"g7dt-stat-item",children:[l.jsx("span",{className:"g7dt-text-muted",children:"총 로드:"}),l.jsx("span",{className:"g7dt-text-blue",children:v.totalLoads})]}),l.jsxs("div",{className:"g7dt-stat-item",children:[l.jsx("span",{className:"g7dt-text-muted",children:"캐시 히트:"}),l.jsx("span",{className:"g7dt-text-green",children:v.cacheHits})]}),l.jsxs("div",{className:"g7dt-stat-item",children:[l.jsx("span",{className:"g7dt-text-muted",children:"API 로드:"}),l.jsx("span",{className:"g7dt-text-yellow",children:v.apiLoads})]})]})]}),l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:"📋 현재 레이아웃"}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsx("button",{onClick:()=>k(x),className:"g7dt-btn-small",title:"전체 JSON 복사",children:"📋 복사"}),l.jsx("button",{onClick:()=>i(!a),className:"g7dt-btn-small",children:a?"요약 보기":"전체 보기"})]})]}),l.jsxs("div",{className:"g7dt-space-y-2 g7dt-text-xs",children:[l.jsxs("div",{className:"g7dt-flex g7dt-gap-4",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"경로:"}),l.jsx("span",{className:"g7dt-ml-1 g7dt-text-white g7dt-font-mono",children:y.layoutPath})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"템플릿:"}),l.jsx("span",{className:"g7dt-ml-1 g7dt-text-blue",children:y.templateId})]})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-4",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"버전:"}),l.jsx("span",{className:"g7dt-ml-1 g7dt-text-white",children:y.version||"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"소스:"}),l.jsx("span",{className:`g7dt-ml-1 ${y.source==="cache"?"g7dt-text-green":"g7dt-text-yellow"}`,children:y.source==="cache"?"💾 캐시":"🌐 API"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"로드 시간:"}),l.jsx("span",{className:"g7dt-ml-1 g7dt-text-white",children:y.loadedAt?new Date(y.loadedAt).toLocaleTimeString():"-"})]})]}),l.jsx("div",{className:"g7dt-flex g7dt-gap-4 g7dt-mt-2",children:l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-text-muted",children:"권한:"}),x.permissions&&x.permissions.length>0?l.jsxs("span",{className:"g7dt-ml-1 g7dt-text-yellow",children:["🔒 ",x.permissions.map(A=>f[A]||A).join(", ")]}):x.permissions&&x.permissions.length===0?l.jsx("span",{className:"g7dt-ml-1 g7dt-text-green",children:"🌐 공개"}):l.jsx("span",{className:"g7dt-ml-1 g7dt-text-muted",children:"미정의 (부모 상속)"})]})})]})]}),!a&&l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"🏗️ 레이아웃 구조"}),l.jsx("div",{className:"g7dt-grid-2",children:w.map(A=>l.jsxs("button",{onClick:()=>d(o===A.key?null:A.key),className:`g7dt-section-btn ${o===A.key?"g7dt-selected":""}`,children:[l.jsx("span",{children:A.label}),l.jsxs("span",{className:"g7dt-text-blue",children:[A.count,"개"]})]},A.key))})]}),(a||o)&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:a?"📄 전체 레이아웃 JSON":`📎 ${o} 섹션`}),l.jsx("button",{onClick:()=>{a?k(x):o&&x&&k(x[o])},className:"g7dt-btn-small",children:"복사"})]}),o==="permissions"&&!a?l.jsx("div",{className:"g7dt-text-xs",children:x.permissions&&x.permissions.length>0?l.jsxs("table",{className:"g7dt-table g7dt-w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"g7dt-border-b g7dt-border-gray-700",children:[l.jsx("th",{className:"g7dt-text-left g7dt-p-2 g7dt-text-muted",children:"권한 ID"}),l.jsx("th",{className:"g7dt-text-left g7dt-p-2 g7dt-text-muted",children:"명칭"})]})}),l.jsx("tbody",{children:x.permissions.map(A=>l.jsxs("tr",{className:"g7dt-border-b g7dt-border-gray-800",children:[l.jsx("td",{className:"g7dt-p-2 g7dt-font-mono g7dt-text-blue",children:A}),l.jsx("td",{className:"g7dt-p-2 g7dt-text-white",children:f[A]||l.jsx("span",{className:"g7dt-text-muted",children:"-"})})]},A))})]}):x.permissions&&x.permissions.length===0?l.jsx("p",{className:"g7dt-text-muted g7dt-p-2",children:"🌐 공개 레이아웃 (permissions: [])"}):l.jsx("p",{className:"g7dt-text-muted g7dt-p-2",children:"권한 미정의 (부모 레이아웃 상속)"})}):l.jsx("pre",{className:"g7dt-pre g7dt-text-green g7dt-max-h-96 g7dt-overflow-auto",children:JSON.stringify(a?x:o&&x?x[o]:null,null,2)})]}),S.length>0&&l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-cursor-pointer",onClick:()=>h(!g),children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold",children:["📜 로드 이력 (",S.length,")"]}),l.jsx("span",{className:"g7dt-text-muted",children:g?"▼":"▶"})]}),g&&l.jsx("div",{className:"g7dt-mt-2 g7dt-space-y-1",children:S.slice(-20).reverse().map(A=>l.jsxs("div",{className:"g7dt-history-item",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsx("span",{className:"g7dt-font-mono g7dt-text-xs",children:A.layoutPath}),l.jsx("span",{className:`g7dt-text-xs ${A.source==="cache"?"g7dt-text-green":"g7dt-text-yellow"}`,children:A.source==="cache"?"💾":"🌐"})]}),l.jsxs("div",{className:"g7dt-text-xs g7dt-text-muted",children:[A.templateId," · ",A.loadedAt?new Date(A.loadedAt).toLocaleTimeString():"-"]})]},A.id))})]}),l.jsxs("div",{className:"g7dt-card g7dt-text-xs g7dt-text-muted",children:["💡 레이아웃 캐시 문제가 의심되면:",l.jsxs("ul",{className:"g7dt-ml-4 g7dt-list-disc",children:[l.jsx("li",{children:'"소스" 항목이 💾 캐시인지 🌐 API인지 확인'}),l.jsx("li",{children:"캐시에서 로드된 경우, JSON 내용이 최신인지 확인"}),l.jsxs("li",{children:["문제가 있으면 ",l.jsx("code",{className:"g7dt-code",children:"php artisan template:refresh-layout"})," 실행"]})]})]})]}):l.jsx("div",{className:"g7dt-space-y-4",children:l.jsxs("div",{className:"g7dt-empty-state",children:["현재 로드된 레이아웃이 없습니다.",l.jsx("br",{}),"페이지를 새로고침하거나 라우트를 변경해보세요."]})})},Ak=({devTools:r})=>{const[e,t]=j.useState(r.getChangeDetectionInfo()),[a,i]=j.useState(null),[o,d]=j.useState(!1),[g,h]=j.useState(new Set);j.useEffect(()=>{const N=setInterval(()=>{t(r.getChangeDetectionInfo())},500);return()=>clearInterval(N)},[r]);const{executionDetails:f,alerts:p,stats:y}=e,x=o?f.filter(N=>N.alerts.length>0||N.stateChanges.length===0):f,S=a?f.find(N=>N.executionId===a):null,v=N=>{h(D=>{const $=new Set(D);return $.has(N)?$.delete(N):$.add(N),$})},w=N=>{switch(N){case"normal":return"✅";case"early-return-condition":return"⏎";case"early-return-validation":return"❌";case"error":return"💥";default:return"❓"}},k=N=>{switch(N){case"no-state-change":return"⚠️";case"no-datasource-change":return"📊";case"expected-not-fulfilled":return"❗";case"object-reference-same":return"🔄";case"early-return-detected":return"⏎";case"async-timing-issue":return"⏱️";default:return"📢"}},A=N=>{switch(N){case"error":return"g7dt-text-red";case"warning":return"g7dt-text-yellow";case"info":return"g7dt-text-blue";default:return"g7dt-text-white"}},O=N=>new Date(N).toLocaleTimeString("ko-KR",{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3});return l.jsxs("div",{className:"g7dt-space-y-4",children:[p.filter(N=>N.severity==="error"||N.severity==="warning").length>0&&l.jsx("div",{className:"g7dt-card",style:{backgroundColor:"#7f1d1d",borderColor:"#991b1b"},children:l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsxs("span",{className:"g7dt-font-bold",children:["⚠️ 변경 감지 알림: ",p.filter(N=>N.severity==="error").length,"개 에러,"," ",p.filter(N=>N.severity==="warning").length,"개 경고"]}),l.jsx("button",{onClick:()=>r.clearChangeDetectionData(),className:"g7dt-btn-small",children:"초기화"})]})}),l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"📊 변경 감지 통계"}),l.jsxs("div",{className:"g7dt-grid-3",children:[l.jsxs("div",{className:"g7dt-stat-item",children:[l.jsx("span",{className:"g7dt-text-muted",children:"총 실행:"}),l.jsx("span",{className:"g7dt-text-blue",children:y.totalExecutions})]}),l.jsxs("div",{className:"g7dt-stat-item",children:[l.jsx("span",{className:"g7dt-text-muted",children:"상태 변경 있음:"}),l.jsx("span",{className:"g7dt-text-green",children:y.executionsWithStateChange})]}),l.jsxs("div",{className:"g7dt-stat-item",children:[l.jsx("span",{className:"g7dt-text-muted",children:"상태 변경 없음:"}),l.jsx("span",{className:y.executionsWithoutStateChange>0?"g7dt-text-yellow":"g7dt-text-gray",children:y.executionsWithoutStateChange})]}),l.jsxs("div",{className:"g7dt-stat-item",children:[l.jsx("span",{className:"g7dt-text-muted",children:"Early Return:"}),l.jsx("span",{className:"g7dt-text-orange",children:y.earlyReturnCount})]}),l.jsxs("div",{className:"g7dt-stat-item",children:[l.jsx("span",{className:"g7dt-text-muted",children:"알림:"}),l.jsx("span",{className:y.alertCount>0?"g7dt-text-red":"g7dt-text-gray",children:y.alertCount})]})]})]}),p.length>0&&l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"🔔 최근 알림"}),l.jsx("div",{className:"g7dt-space-y-2",style:{maxHeight:"200px",overflowY:"auto"},children:p.slice(-10).reverse().map(N=>l.jsxs("div",{className:"g7dt-list-item",onClick:()=>v(N.id),style:{cursor:"pointer"},children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-start",children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{children:k(N.type)}),l.jsx("span",{className:`g7dt-text-xs ${A(N.severity)}`,children:N.message})]}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted",children:O(N.timestamp)})]}),g.has(N.id)&&l.jsxs("div",{className:"g7dt-mt-2 g7dt-text-xs g7dt-text-muted g7dt-pl-6",children:[l.jsx("p",{children:N.description}),N.statePath&&l.jsxs("p",{className:"g7dt-mt-1",children:[l.jsx("span",{className:"g7dt-text-cyan",children:"경로:"})," ",N.statePath]}),N.suggestion&&l.jsxs("p",{className:"g7dt-mt-1",children:[l.jsx("span",{className:"g7dt-text-green",children:"제안:"})," ",N.suggestion]}),N.docLink&&l.jsxs("p",{className:"g7dt-mt-1",children:[l.jsx("span",{className:"g7dt-text-blue",children:"문서:"})," ",l.jsx("code",{className:"g7dt-code",children:N.docLink})]})]})]},N.id))})]}),l.jsxs("div",{className:"g7dt-card",children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center g7dt-mb-2",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold",children:"🔧 핸들러 실행 이력"}),l.jsxs("label",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-text-xs",children:[l.jsx("input",{type:"checkbox",checked:o,onChange:N=>d(N.target.checked)}),l.jsx("span",{children:"경고만 표시"})]})]}),x.length===0?l.jsxs("div",{className:"g7dt-empty-state",children:["핸들러 실행 이력이 없습니다.",l.jsx("br",{}),"액션을 실행하면 여기에 표시됩니다."]}):l.jsx("div",{className:"g7dt-space-y-1",style:{maxHeight:"300px",overflowY:"auto"},children:x.slice(-20).reverse().map(N=>l.jsxs("div",{className:`g7dt-list-item ${a===N.executionId?"g7dt-selected":""}`,onClick:()=>i(a===N.executionId?null:N.executionId),style:{cursor:"pointer"},children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{children:w(N.exitReason)}),l.jsx("span",{className:"g7dt-text-white g7dt-font-mono g7dt-text-xs",children:N.handlerName}),N.alerts.length>0&&l.jsx("span",{className:"g7dt-badge g7dt-badge-warning",children:N.alerts.length})]}),l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-text-xs",children:[l.jsxs("span",{className:"g7dt-text-muted",children:["상태: ",N.stateChanges.length]}),l.jsx("span",{className:"g7dt-text-muted",children:N.duration?`${N.duration}ms`:"-"}),l.jsx("span",{className:"g7dt-text-muted",children:O(N.startTime)})]})]}),a===N.executionId&&S&&l.jsxs("div",{className:"g7dt-mt-3 g7dt-pt-3 g7dt-border-t g7dt-border-gray-700",children:[l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted",children:"종료 사유: "}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-white",children:S.exitReason||"unknown"}),S.exitLocation&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-2",children:"위치: "}),l.jsx("code",{className:"g7dt-code g7dt-text-xs",children:S.exitLocation})]})]}),S.exitDescription&&l.jsx("div",{className:"g7dt-mb-2 g7dt-text-xs g7dt-text-muted",children:S.exitDescription}),S.stateChanges.length>0&&l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsxs("span",{className:"g7dt-text-xs g7dt-font-bold g7dt-text-green",children:["상태 변경 (",S.stateChanges.length,")"]}),l.jsx("div",{className:"g7dt-mt-1 g7dt-space-y-1",children:S.stateChanges.map(D=>l.jsxs("div",{className:"g7dt-text-xs g7dt-pl-2",children:[l.jsx("span",{className:"g7dt-text-cyan",children:D.path}),l.jsxs("span",{className:"g7dt-text-muted",children:[" (",D.changeType,")"]}),D.comparison.changedKeys&&l.jsxs("span",{className:"g7dt-text-muted g7dt-ml-1",children:["[변경: ",D.comparison.changedKeys.join(", "),"]"]})]},D.id))})]}),S.dataSourceChanges.length>0&&l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsxs("span",{className:"g7dt-text-xs g7dt-font-bold g7dt-text-blue",children:["데이터소스 변경 (",S.dataSourceChanges.length,")"]}),l.jsx("div",{className:"g7dt-mt-1 g7dt-space-y-1",children:S.dataSourceChanges.map((D,$)=>l.jsxs("div",{className:"g7dt-text-xs g7dt-pl-2",children:[l.jsx("span",{className:"g7dt-text-cyan",children:D.dataSourceId}),l.jsxs("span",{className:"g7dt-text-muted",children:[" ","(",D.changeType,": ",D.previousStatus," → ",D.newStatus,")"]})]},$))})]}),S.expectedChanges&&l.jsxs("div",{className:"g7dt-mb-2",children:[l.jsx("span",{className:"g7dt-text-xs g7dt-font-bold g7dt-text-yellow",children:"기대 변경"}),l.jsxs("div",{className:"g7dt-mt-1 g7dt-text-xs g7dt-pl-2 g7dt-text-muted",children:["상태: ",S.expectedChanges.expectedStatePaths.join(", ")||"없음",l.jsx("br",{}),"데이터소스: ",S.expectedChanges.expectedDataSources.join(", ")||"없음"]})]}),S.alerts.length>0&&l.jsxs("div",{children:[l.jsxs("span",{className:"g7dt-text-xs g7dt-font-bold g7dt-text-red",children:["알림 (",S.alerts.length,")"]}),l.jsx("div",{className:"g7dt-mt-1 g7dt-space-y-1",children:S.alerts.map(D=>l.jsxs("div",{className:"g7dt-text-xs g7dt-pl-2",children:[l.jsx("span",{children:k(D.type)}),l.jsx("span",{className:`g7dt-ml-1 ${A(D.severity)}`,children:D.message})]},D.id))})]})]})]},N.executionId))})]}),l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-2",children:"💡 변경 감지 가이드"}),l.jsxs("ul",{className:"g7dt-help-list",children:[l.jsx("li",{children:"핸들러 실행 후 상태 변경이 없으면 ⚠️ 경고가 표시됩니다"}),l.jsx("li",{children:"early return으로 종료된 경우 ⏎ 아이콘으로 표시됩니다"}),l.jsx("li",{children:"객체 변경 시 참조가 동일하면 🔄 경고가 발생합니다"}),l.jsx("li",{children:"문제 해결: exitLocation 확인 → 조건문 검토 → 불변성 확인"})]})]})]})},Tk=({devTools:r})=>{const[e,t]=j.useState(null),[a,i]=j.useState(null),[o,d]=j.useState("all"),g=j.useCallback(()=>{t(r.getStaleClosureTrackingInfo())},[r]);if(j.useEffect(()=>{g();const v=setInterval(g,2e3);return()=>clearInterval(v)},[g]),!e)return l.jsx("div",{className:"g7dt-empty-state",children:"로딩 중..."});const{warnings:h,stats:f}=e,p=h.filter(v=>o==="all"?!0:v.severity===o),y=a?h.find(v=>v.id===a):null,x=v=>{switch(v){case"error":return"❌";case"warning":return"⚠️";default:return"❓"}},S=v=>{switch(v){case"state-changed-during-async":return"⏳";case"captured-in-callback":return"📸";case"stale-in-handler":return"🔄";default:return"❓"}};return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"Stale Closure 통계"}),l.jsxs("div",{className:"g7dt-stats-grid-3",children:[l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-yellow",children:f.totalWarnings||0}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"총 경고"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-red",children:f.warningsBySeverity?.error||0}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"에러"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-orange",children:f.warningsBySeverity?.warning||0}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"경고"})]})]})]}),f.warningsByType&&Object.keys(f.warningsByType).length>0&&l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"타입별 분포"}),l.jsx("div",{className:"g7dt-space-y-2",children:Object.entries(f.warningsByType).map(([v,w])=>l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-text-xs",children:[l.jsxs("span",{className:"g7dt-text-muted",children:[S(v)," ",v]}),l.jsx("span",{className:"g7dt-text-white g7dt-font-mono",children:w})]},v))})]}),l.jsx("div",{className:"g7dt-card",children:l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted",children:"심각도:"}),l.jsxs("select",{value:o,onChange:v=>d(v.target.value),className:"g7dt-select",children:[l.jsx("option",{value:"all",children:"전체"}),l.jsx("option",{value:"error",children:"에러"}),l.jsx("option",{value:"warning",children:"경고"})]}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:[p.length,"개 표시"]})]})}),l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"Stale Closure 경고"}),p.length===0?l.jsx("div",{className:"g7dt-empty-state g7dt-text-green",children:"✅ Stale Closure 경고가 없습니다"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-60 g7dt-overflow-y-auto",children:p.slice().reverse().map(v=>l.jsxs("div",{className:`g7dt-list-item g7dt-cursor-pointer ${a===v.id?"g7dt-selected":""}`,onClick:()=>i(a===v.id?null:v.id),children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{children:x(v.severity)}),l.jsx("span",{children:S(v.type)}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-white g7dt-truncate",children:v.location}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:new Date(v.timestamp).toLocaleTimeString()})]}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mt-1 g7dt-truncate",children:v.statePath})]},v.id))})]}),y&&l.jsxs("div",{className:"g7dt-card g7dt-border-yellow",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:[x(y.severity)," 경고 상세"]}),l.jsxs("div",{className:"g7dt-space-y-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"위치"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-white g7dt-mono",children:y.location})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"타입"}),l.jsxs("div",{className:"g7dt-text-sm g7dt-text-white",children:[S(y.type)," ",y.type]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"상태 경로"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-yellow g7dt-mono",children:y.statePath})]}),l.jsxs("div",{className:"g7dt-grid-2 g7dt-gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"캡처된 값"}),l.jsx("pre",{className:"g7dt-code-block g7dt-text-red",children:JSON.stringify(y.capturedValue,null,2)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"현재 값"}),l.jsx("pre",{className:"g7dt-code-block g7dt-text-green",children:JSON.stringify(y.currentValue,null,2)})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"시간 차이"}),l.jsxs("div",{className:"g7dt-text-sm g7dt-text-white",children:[y.timeDiff,"ms"]})]}),y.suggestion&&l.jsxs("div",{className:"g7dt-bg-blue-dark g7dt-p-2 g7dt-rounded",children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-blue",children:"💡 제안"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-white g7dt-mt-1",children:y.suggestion})]})]})]})]})},Dk=({devTools:r})=>{const[e,t]=j.useState(null),[a,i]=j.useState(null),[o,d]=j.useState("all"),g=j.useCallback(()=>{t(r.getNestedContextTrackingInfo())},[r]);if(j.useEffect(()=>{g();const v=setInterval(g,2e3);return()=>clearInterval(v)},[g]),!e)return l.jsx("div",{className:"g7dt-empty-state",children:"로딩 중..."});const{contexts:h,stats:f}=e,p=h.filter(v=>o==="all"?!0:v.componentType===o),y=a?h.find(v=>v.id===a):null,x=v=>{switch(v){case"expandChildren":return"📂";case"cellChildren":return"📊";case"iteration":return"🔄";case"modal":return"🪟";case"slot":return"🔲";default:return"❓"}},S=v=>"│".repeat(Math.max(0,v-1))+(v>0?"├─":"");return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"Nested Context 통계"}),l.jsxs("div",{className:"g7dt-stats-grid-3",children:[l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-blue",children:f.totalContexts||0}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"총 컨텍스트"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-purple",children:f.maxDepth||0}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"최대 깊이"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-red",children:f.failedAccessCount||0}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"접근 오류"})]})]})]}),f.byType&&Object.keys(f.byType).length>0&&l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"타입별 분포"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-3",children:Object.entries(f.byType).map(([v,w])=>l.jsxs("div",{className:`g7dt-badge g7dt-cursor-pointer ${o===v?"g7dt-badge-selected":""}`,onClick:()=>d(o===v?"all":v),children:[x(v)," ",v,": ",w]},v))})]}),l.jsx("div",{className:"g7dt-card",children:l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted",children:"타입:"}),l.jsxs("select",{value:o,onChange:v=>d(v.target.value),className:"g7dt-select",children:[l.jsx("option",{value:"all",children:"전체"}),l.jsx("option",{value:"expandChildren",children:"expandChildren"}),l.jsx("option",{value:"cellChildren",children:"cellChildren"}),l.jsx("option",{value:"iteration",children:"iteration"}),l.jsx("option",{value:"modal",children:"modal"}),l.jsx("option",{value:"slot",children:"slot"})]}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:[p.length,"개 표시"]})]})}),l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"컨텍스트 목록"}),p.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"추적된 Nested Context가 없습니다"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-60 g7dt-overflow-y-auto",children:p.slice().reverse().map(v=>{const w=v.accessAttempts?.some(A=>!A.found),k=v.mergedContext?.all||[];return l.jsxs("div",{className:`g7dt-list-item g7dt-cursor-pointer ${a===v.id?"g7dt-selected":""} ${w?"g7dt-border-red":""}`,onClick:()=>i(a===v.id?null:v.id),children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{className:"g7dt-text-muted g7dt-mono g7dt-text-xs",children:S(v.depth)}),l.jsx("span",{children:x(v.componentType)}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-white",children:v.componentId||v.componentType}),w&&l.jsx("span",{className:"g7dt-text-red g7dt-text-xs",children:"⚠️ 오류"}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:["깊이: ",v.depth]})]}),l.jsxs("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mt-1",children:["변수: ",k.slice(0,5).join(", "),k.length>5&&"..."]})]},v.id)})})]}),y&&l.jsxs("div",{className:"g7dt-card g7dt-border-blue",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:[x(y.componentType)," 컨텍스트 상세"]}),l.jsxs("div",{className:"g7dt-space-y-3",children:[l.jsxs("div",{className:"g7dt-grid-2 g7dt-gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"타입"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-white",children:y.componentType})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"깊이"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-white",children:y.depth})]})]}),y.componentId&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"컴포넌트 ID"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-blue g7dt-mono",children:y.componentId})]}),y.parentId&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"부모 컨텍스트"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-purple g7dt-mono",children:y.parentId})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-2",children:"사용 가능한 변수"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1",children:(y.mergedContext?.all||[]).map(v=>l.jsx("span",{className:"g7dt-badge g7dt-badge-blue g7dt-text-xs",children:v},v))})]}),y.ownContext?.added&&y.ownContext.added.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-2",children:"추가된 변수 (이 컨텍스트에서)"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1",children:y.ownContext.added.map(v=>l.jsxs("span",{className:"g7dt-badge g7dt-badge-green g7dt-text-xs",children:["+ ",v]},v))})]}),y.accessAttempts&&y.accessAttempts.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-2",children:"접근 시도"}),l.jsx("div",{className:"g7dt-space-y-1",children:y.accessAttempts.slice(0,10).map((v,w)=>l.jsxs("div",{className:`g7dt-flex g7dt-justify-between g7dt-text-xs ${v.found?"":"g7dt-text-red"}`,children:[l.jsx("span",{className:"g7dt-mono",children:v.path}),l.jsx("span",{children:v.found?"✓":"✕"})]},w))})]})]})]})]})},Rk=({devTools:r})=>{const[e,t]=j.useState(null),[a,i]=j.useState(null),[o,d]=j.useState(null),[g,h]=j.useState("modals"),f=j.useCallback(()=>{t(r.getModalStateScopeTrackingInfo())},[r]);if(j.useEffect(()=>{f();const D=setInterval(f,2e3);return()=>clearInterval(D)},[f]),!e)return l.jsx("div",{className:"g7dt-empty-state",children:"로딩 중..."});const{modals:p,issues:y,relations:x,changeLogs:S,stats:v}=e,w=a?p.find(D=>D.modalId===a):null,k=o?y.find(D=>D.id===o):null,A=D=>{switch(D){case"isolated":return"🔒";case"shared":return"🔓";case"inherited":return"📥";default:return"❓"}},O=D=>{switch(D){case"state-leakage":return"💧";case"isolation-violation":return"🔓";case"parent-mutation":return"👆";case"orphaned-state":return"👻";case"scope-mismatch":return"🔀";case"cleanup-failure":return"🧹";case"missing-definition":return"🚫";default:return"❓"}},N=D=>{switch(D){case"error":return"❌";case"warning":return"⚠️";default:return"❓"}};return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"모달 상태 스코프 통계"}),l.jsxs("div",{className:"g7dt-stats-grid-3",children:[l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-blue",children:v.totalModals}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"총 모달"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-green",children:v.openModals}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"열린 모달"})]}),l.jsxs("div",{className:"g7dt-text-center",children:[l.jsx("div",{className:"g7dt-text-2xl g7dt-font-bold g7dt-text-red",children:v.totalIssues}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"이슈"})]})]})]}),l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"스코프별 / 이슈별"}),l.jsxs("div",{className:"g7dt-grid-2 g7dt-gap-4",children:[l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-2",children:"스코프 타입"}),l.jsx("div",{className:"g7dt-space-y-1",children:Object.entries(v.byScope).map(([D,$])=>l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-text-xs",children:[l.jsxs("span",{children:[A(D)," ",D]}),l.jsx("span",{className:"g7dt-font-mono",children:$})]},D))})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-2",children:"이슈 타입"}),l.jsxs("div",{className:"g7dt-space-y-1",children:[Object.entries(v.issuesByType).filter(([D,$])=>$>0).map(([D,$])=>l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-text-xs",children:[l.jsxs("span",{children:[O(D)," ",D]}),l.jsx("span",{className:"g7dt-font-mono g7dt-text-red",children:$})]},D)),Object.values(v.issuesByType).every(D=>D===0)&&l.jsx("div",{className:"g7dt-text-xs g7dt-text-green",children:"✅ 이슈 없음"})]})]})]})]}),l.jsx("div",{className:"g7dt-card",children:l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsxs("button",{className:`g7dt-tab-button ${g==="modals"?"g7dt-tab-active":""}`,onClick:()=>h("modals"),children:["🪟 모달 (",p.length,")"]}),l.jsxs("button",{className:`g7dt-tab-button ${g==="issues"?"g7dt-tab-active":""}`,onClick:()=>h("issues"),children:["⚠️ 이슈 (",y.length,")"]}),l.jsxs("button",{className:`g7dt-tab-button ${g==="logs"?"g7dt-tab-active":""}`,onClick:()=>h("logs"),children:["📝 로그 (",S.length,")"]})]})}),g==="modals"&&l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"모달 목록"}),p.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"추적된 모달이 없습니다"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-60 g7dt-overflow-y-auto",children:p.map(D=>{const $=y.some(M=>M.modalId===D.modalId);return l.jsx("div",{className:`g7dt-list-item g7dt-cursor-pointer ${a===D.modalId?"g7dt-selected":""} ${$?"g7dt-border-red":""}`,onClick:()=>i(a===D.modalId?null:D.modalId),children:l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{children:D.closedAt===null?"📭":"📪"}),l.jsx("span",{children:A(D.scopeType)}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-white",children:D.modalName}),$&&l.jsx("span",{className:"g7dt-text-red",children:"⚠️"}),l.jsxs("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:["변경: ",D.stateChangeCount]})]})},D.modalId)})})]}),g==="issues"&&l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"이슈 목록"}),y.length===0?l.jsx("div",{className:"g7dt-empty-state g7dt-text-green",children:"✅ 모달 상태 이슈가 없습니다"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-60 g7dt-overflow-y-auto",children:y.slice().reverse().map(D=>l.jsxs("div",{className:`g7dt-list-item g7dt-cursor-pointer ${o===D.id?"g7dt-selected":""}`,onClick:()=>d(o===D.id?null:D.id),children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{children:N(D.severity)}),l.jsx("span",{children:O(D.type)}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-white",children:D.modalName}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:new Date(D.timestamp).toLocaleTimeString()})]}),l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mt-1 g7dt-truncate",children:D.description})]},D.id))})]}),g==="logs"&&l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"상태 변경 로그"}),S.length===0?l.jsx("div",{className:"g7dt-empty-state",children:"상태 변경 로그가 없습니다"}):l.jsx("div",{className:"g7dt-space-y-2 g7dt-max-h-60 g7dt-overflow-y-auto",children:S.slice().reverse().slice(0,50).map(D=>l.jsxs("div",{className:`g7dt-list-item ${D.violatesIsolation?"g7dt-border-red":""}`,children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2",children:[l.jsx("span",{className:"g7dt-text-xs g7dt-text-white",children:D.modalName}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-blue g7dt-mono",children:D.stateKey}),D.violatesIsolation&&l.jsx("span",{className:"g7dt-text-red",children:"⚠️ 격리 위반"}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted g7dt-ml-auto",children:new Date(D.timestamp).toLocaleTimeString()})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2 g7dt-text-xs g7dt-mt-1",children:[l.jsx("span",{className:"g7dt-text-red g7dt-truncate",style:{maxWidth:"45%"},children:JSON.stringify(D.previousValue)}),l.jsx("span",{className:"g7dt-text-muted",children:"→"}),l.jsx("span",{className:"g7dt-text-green g7dt-truncate",style:{maxWidth:"45%"},children:JSON.stringify(D.newValue)})]})]},D.id))})]}),w&&g==="modals"&&l.jsxs("div",{className:"g7dt-card g7dt-border-blue",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:[A(w.scopeType)," 모달 상세: ",w.modalName]}),l.jsxs("div",{className:"g7dt-space-y-3",children:[l.jsxs("div",{className:"g7dt-grid-2 g7dt-gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"스코프"}),l.jsxs("div",{className:"g7dt-text-sm g7dt-text-white",children:[A(w.scopeType)," ",w.scopeType]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"상태"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-white",children:w.closedAt===null?"📭 열림":"📪 닫힘"})]})]}),w.parentModalId&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"부모 모달"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-purple g7dt-mono",children:w.parentModalId})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"상태 변경 횟수"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-white",children:w.stateChangeCount})]}),w.isolatedStateKeys.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-1",children:"격리된 상태 키"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1",children:w.isolatedStateKeys.map(D=>l.jsxs("span",{className:"g7dt-badge g7dt-badge-red g7dt-text-xs",children:["🔒 ",D]},D))})]}),w.sharedStateKeys.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted g7dt-mb-1",children:"공유된 상태 키"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1",children:w.sharedStateKeys.map(D=>l.jsxs("span",{className:"g7dt-badge g7dt-badge-blue g7dt-text-xs",children:["🔓 ",D]},D))})]})]})]}),k&&g==="issues"&&l.jsxs("div",{className:"g7dt-card g7dt-border-red",children:[l.jsxs("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:[N(k.severity)," 이슈 상세"]}),l.jsxs("div",{className:"g7dt-space-y-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"타입"}),l.jsxs("div",{className:"g7dt-text-sm g7dt-text-white",children:[O(k.type)," ",k.type]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"설명"}),l.jsx("div",{className:"g7dt-text-sm g7dt-text-white",children:k.description})]}),k.affectedStateKeys.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"영향 받는 상태 키"}),l.jsx("div",{className:"g7dt-flex g7dt-flex-wrap g7dt-gap-1 g7dt-mt-1",children:k.affectedStateKeys.map(D=>l.jsx("span",{className:"g7dt-badge g7dt-text-xs",children:D},D))})]}),k.leakedValue!==void 0&&l.jsxs("div",{children:[l.jsx("div",{className:"g7dt-text-xs g7dt-text-muted",children:"유출된 값"}),l.jsx("pre",{className:"g7dt-code-block g7dt-text-red",children:JSON.stringify(k.leakedValue,null,2)})]})]})]}),x.length>0&&l.jsxs("div",{className:"g7dt-card",children:[l.jsx("h3",{className:"g7dt-text-sm g7dt-font-bold g7dt-mb-3",children:"모달 관계"}),l.jsx("div",{className:"g7dt-space-y-2",children:x.map((D,$)=>l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-gap-2 g7dt-text-xs",children:[l.jsx("span",{className:"g7dt-text-purple",children:D.parentModalId}),l.jsx("span",{className:"g7dt-text-muted",children:"→"}),l.jsx("span",{className:"g7dt-text-blue",children:D.childModalId}),l.jsx("span",{className:"g7dt-badge g7dt-text-xs g7dt-ml-auto",children:D.relationType})]},$))})]})]})},Ok=({devTools:r})=>{const[e,t]=j.useState("definitions"),[a,i]=j.useState(null),[o,d]=j.useState(""),g=j.useCallback(()=>{r&&i(r.getNamedActionTrackingInfo())},[r]);if(j.useEffect(()=>{g();const v=setInterval(g,2e3);return()=>clearInterval(v)},[g]),!a)return l.jsx("div",{className:"g7dt-empty-message g7dt-py-4",children:"데이터 로딩 중..."});const{definitions:h,refLogs:f,stats:p}=a,y=Object.keys(h),x=y.filter(v=>!o||v.toLowerCase().includes(o.toLowerCase())||h[v]?.handler?.toLowerCase().includes(o.toLowerCase())),S=f.filter(v=>!o||v.actionRefName.toLowerCase().includes(o.toLowerCase())||v.resolvedHandler.toLowerCase().includes(o.toLowerCase()));return l.jsxs("div",{className:"g7dt-space-y-4",children:[l.jsxs("div",{className:"g7dt-grid g7dt-grid-cols-3 g7dt-gap-2",children:[l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value",children:p.totalDefinitions}),l.jsx("div",{className:"g7dt-stat-label",children:"정의"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value",children:p.totalRefs}),l.jsx("div",{className:"g7dt-stat-label",children:"참조"})]}),l.jsxs("div",{className:"g7dt-stat-card",children:[l.jsx("div",{className:"g7dt-stat-value",style:{color:p.unusedDefinitions.length>0?"#f59e0b":"#10b981"},children:p.unusedDefinitions.length}),l.jsx("div",{className:"g7dt-stat-label",children:"미사용"})]})]}),l.jsxs("div",{className:"g7dt-flex g7dt-gap-2",children:[l.jsxs("button",{onClick:()=>t("definitions"),className:e==="definitions"?"g7dt-filter-btn g7dt-filter-active":"g7dt-filter-btn",children:["정의 목록 (",y.length,")"]}),l.jsxs("button",{onClick:()=>t("refs"),className:e==="refs"?"g7dt-filter-btn g7dt-filter-active":"g7dt-filter-btn",children:["참조 이력 (",f.length,")"]}),l.jsx("button",{onClick:g,className:"g7dt-filter-btn",title:"새로고침",children:"↻"})]}),l.jsx("input",{type:"text",placeholder:e==="definitions"?"액션 이름 검색...":"actionRef 검색...",value:o,onChange:v=>d(v.target.value),className:"g7dt-input g7dt-w-full"}),e==="definitions"&&l.jsx("div",{className:"g7dt-space-y-1",children:x.length===0?l.jsx("div",{className:"g7dt-empty-message g7dt-py-4",children:y.length===0?"정의된 named_actions가 없습니다":"검색 결과 없음"}):x.map(v=>{const w=h[v],k=p.refCountByName[v]||0,A=p.unusedDefinitions.includes(v);return l.jsxs("div",{className:"g7dt-card",style:{borderLeft:A?"3px solid #f59e0b":"3px solid #10b981"},children:[l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-font-bold",children:v}),l.jsxs("span",{className:"g7dt-text-muted g7dt-ml-2",children:["→ ",w.handler]})]}),l.jsxs("span",{className:"g7dt-badge",title:"참조 횟수",children:[k,"회"]})]}),w.params&&l.jsxs("details",{className:"g7dt-mt-1",children:[l.jsx("summary",{className:"g7dt-text-xs g7dt-text-muted g7dt-cursor-pointer",children:"params"}),l.jsx("pre",{className:"g7dt-pre g7dt-text-xs g7dt-mt-1",style:{maxHeight:"200px",overflow:"auto"},children:JSON.stringify(w.params,null,2)})]}),A&&l.jsx("div",{className:"g7dt-text-xs",style:{color:"#f59e0b",marginTop:"4px"},children:"⚠ 미사용 정의"})]},v)})}),e==="refs"&&l.jsx("div",{className:"g7dt-space-y-1",children:S.length===0?l.jsx("div",{className:"g7dt-empty-message g7dt-py-4",children:f.length===0?"actionRef 해석 이력이 없습니다":"검색 결과 없음"}):[...S].reverse().map(v=>l.jsx("div",{className:"g7dt-card",children:l.jsxs("div",{className:"g7dt-flex g7dt-justify-between g7dt-items-center",children:[l.jsxs("div",{children:[l.jsx("span",{className:"g7dt-font-bold",children:v.actionRefName}),l.jsxs("span",{className:"g7dt-text-muted g7dt-ml-2",children:["→ ",v.resolvedHandler]})]}),l.jsx("span",{className:"g7dt-text-xs g7dt-text-muted",children:new Date(v.timestamp).toLocaleTimeString()})]})},v.id))})]})},Lk=()=>{j.useEffect(()=>{ik()},[]);const r=j.useRef(ix()),[e,t]=j.useState(r.current.isOpen??!1),[a,i]=j.useState(!1),[o,d]=j.useState("state"),[g,h]=j.useState({_global:{},_local:{},_computed:{}}),[f,p]=j.useState([]),[y,x]=j.useState({hits:0,misses:0,entries:0,hitRate:0}),[S,v]=j.useState(!1),[w,k]=j.useState(r.current.position??{x:-1,y:-1}),[A,O]=j.useState(!1),N=j.useRef(null),D=j.useRef(null),[$,M]=j.useState(r.current.size??{width:ok,height:lk}),[z,K]=j.useState(!1),[pe,we]=j.useState(null),J=j.useRef(null),[be,le]=j.useState(!1),de=j.useRef(null),je=ka.getInstance(),W=tx();j.useEffect(()=>{if(w.x===-1&&w.y===-1){const U=window.innerWidth-$.width-16;k({x:U,y:16})}},[w,$.width]),j.useEffect(()=>{if(w.x===-1&&w.y===-1||A||z)return;const U=setTimeout(()=>{ox({position:w,size:$})},300);return()=>clearTimeout(U)},[w,$,A,z]),j.useEffect(()=>{ox({isOpen:e})},[e]);const ge=j.useCallback(U=>{U.target.tagName!=="BUTTON"&&(O(!0),N.current={x:U.clientX,y:U.clientY,posX:w.x,posY:w.y},U.preventDefault())},[w]);j.useEffect(()=>{if(!A)return;const U=ye=>{if(!N.current)return;const oe=ye.clientX-N.current.x,ke=ye.clientY-N.current.y;let Oe=N.current.posX+oe,Te=N.current.posY+ke;const qe=window.innerWidth-$.width,Ie=window.innerHeight-$.height;Oe=Math.max(0,Math.min(Oe,qe)),Te=Math.max(0,Math.min(Te,Ie)),k({x:Oe,y:Te})},re=()=>{O(!1),N.current=null};return document.addEventListener("mousemove",U),document.addEventListener("mouseup",re),()=>{document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",re)}},[A,$.width,$.height]);const ne=j.useCallback(U=>re=>{re.preventDefault(),re.stopPropagation(),K(!0),we(U),J.current={x:re.clientX,y:re.clientY,width:$.width,height:$.height,posX:w.x,posY:w.y}},[$,w]);j.useEffect(()=>{if(!z||!pe)return;const U=ye=>{if(!J.current)return;const oe=ye.clientX-J.current.x,ke=ye.clientY-J.current.y;let Oe=J.current.width,Te=J.current.height,qe=J.current.posX,Ie=J.current.posY;if(pe.includes("e")&&(Oe=Math.max(ax,J.current.width+oe)),pe.includes("w")){const Nt=Math.min(oe,J.current.width-ax);Oe=J.current.width-Nt,qe=J.current.posX+Nt}if(pe.includes("s")&&(Te=Math.max(sx,J.current.height+ke)),pe.includes("n")){const Nt=Math.min(ke,J.current.height-sx);Te=J.current.height-Nt,Ie=J.current.posY+Nt}Oe=Math.min(Oe,window.innerWidth-qe),Te=Math.min(Te,window.innerHeight-Ie),qe=Math.max(0,qe),Ie=Math.max(0,Ie),M({width:Oe,height:Te}),k({x:qe,y:Ie})},re=()=>{K(!1),we(null),J.current=null};return document.addEventListener("mousemove",U),document.addEventListener("mouseup",re),()=>{document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",re)}},[z,pe]);const X=j.useCallback(()=>{be?(de.current&&(k(de.current.position),M(de.current.size)),le(!1)):(de.current={position:w,size:$},k({x:0,y:0}),M({width:window.innerWidth,height:window.innerHeight}),le(!0))},[be,w,$]),ae=j.useCallback(()=>{je.isEnabled()&&(h(je.getState()),p(je.getActionHistory()),x(je.getCacheStats()),v(W.isConnected()))},[je,W]);j.useEffect(()=>{const U=re=>{re.ctrlKey&&re.shiftKey&&re.key==="G"&&(re.preventDefault(),t(ye=>!ye))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[]),j.useEffect(()=>{if(!e||!je.isEnabled())return;ae();const U=je.watchState("*",()=>{h(je.getState())}),re=je.watchActions(()=>{p(je.getActionHistory()),x(je.getCacheStats())}),ye=setInterval(ae,5e3);return()=>{U(),re(),clearInterval(ye)}},[e,je,ae]);const R=async()=>{try{const U=await W.dumpState();console.log("[G7DevTools] 상태 덤프 완료:",U),v(!0)}catch(U){console.error("[G7DevTools] 상태 덤프 실패:",U),v(!1)}};return je.isEnabled()?e?a?l.jsx("div",{className:"g7dt-minimized",children:l.jsxs("div",{className:"g7dt-minimized-content",children:[l.jsx("span",{className:"g7dt-font-bold g7dt-text-sm",children:"G7 DevTools"}),l.jsx("button",{onClick:()=>i(!1),className:"g7dt-btn g7dt-text-xs",title:"확장",children:"▲"}),l.jsx("button",{onClick:()=>t(!1),className:"g7dt-btn g7dt-text-xs",children:"✕"})]})}):l.jsxs("div",{ref:D,className:`g7dt-panel ${be?"maximized":""} ${z?"g7dt-resizing":""}`,style:{left:`${w.x>=0?w.x:0}px`,top:`${w.y>=0?w.y:0}px`,width:`${$.width}px`,height:`${$.height}px`},children:[!be&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"g7dt-resize-handle g7dt-resize-corner g7dt-resize-nw",onMouseDown:ne("nw")}),l.jsx("div",{className:"g7dt-resize-handle g7dt-resize-corner g7dt-resize-ne",onMouseDown:ne("ne")}),l.jsx("div",{className:"g7dt-resize-handle g7dt-resize-corner g7dt-resize-sw",onMouseDown:ne("sw")}),l.jsx("div",{className:"g7dt-resize-handle g7dt-resize-corner g7dt-resize-se",onMouseDown:ne("se")}),l.jsx("div",{className:"g7dt-resize-handle g7dt-resize-edge-h g7dt-resize-n",onMouseDown:ne("n")}),l.jsx("div",{className:"g7dt-resize-handle g7dt-resize-edge-h g7dt-resize-s",onMouseDown:ne("s")}),l.jsx("div",{className:"g7dt-resize-handle g7dt-resize-edge-v g7dt-resize-w",onMouseDown:ne("w")}),l.jsx("div",{className:"g7dt-resize-handle g7dt-resize-edge-v g7dt-resize-e",onMouseDown:ne("e")})]}),l.jsxs("div",{className:`g7dt-header ${A?"dragging":""}`,onMouseDown:ge,children:[l.jsxs("div",{className:"g7dt-header-left",children:[l.jsx("span",{className:"g7dt-header-title",children:"G7 DevTools"}),l.jsx("span",{className:`g7dt-header-badge ${S?"connected":""}`,title:S?"서버 덤프 성공":"서버에 덤프되지 않음 (덤프 버튼 클릭)",children:S?"덤프 완료":"로컬 모드"})]}),l.jsxs("div",{className:"g7dt-header-right",children:[l.jsx("button",{onClick:R,className:"g7dt-btn g7dt-btn-primary",title:"서버로 상태 덤프",children:"덤프"}),l.jsx("button",{onClick:ae,className:"g7dt-btn",title:"새로고침",children:"↻"}),l.jsx("button",{onClick:X,className:"g7dt-btn",title:be?"복원":"최대화",children:be?"❐":"□"}),l.jsx("button",{onClick:()=>i(!0),className:"g7dt-btn",title:"최소화",children:"▼"}),l.jsx("button",{onClick:()=>t(!1),className:"g7dt-btn",children:"✕"})]})]}),l.jsx("div",{className:"g7dt-tabs",children:Object.keys(nx).map(U=>l.jsx("button",{onClick:()=>d(U),className:`g7dt-tab ${o===U?"active":""}`,children:nx[U]},U))}),l.jsxs("div",{className:"g7dt-content",children:[o==="state"&&l.jsx(uk,{state:g,devTools:je}),o==="actions"&&l.jsx(gk,{actions:f,devTools:je}),o==="cache"&&l.jsx(hk,{stats:y,devTools:je}),o==="diagnose"&&l.jsx(fk,{}),o==="performance"&&l.jsx(pk,{devTools:je}),o==="lifecycle"&&l.jsx(mk,{devTools:je}),o==="network"&&l.jsx(yk,{devTools:je}),o==="form"&&l.jsx(xk,{devTools:je}),o==="conditional"&&l.jsx(bk,{devTools:je}),o==="expression"&&l.jsx(vk,{devTools:je}),o==="handlers"&&l.jsx(wk,{devTools:je}),o==="events"&&l.jsx(Sk,{devTools:je}),o==="datasources"&&l.jsx(Ck,{devTools:je}),o==="renders"&&l.jsx(jk,{devTools:je}),o==="styles"&&l.jsx(kk,{devTools:je}),o==="auth"&&l.jsx(Nk,{devTools:je}),o==="logs"&&l.jsx(Ek,{devTools:je}),o==="layout"&&l.jsx(_k,{devTools:je}),o==="changedetection"&&l.jsx(Ak,{devTools:je}),o==="staleclosure"&&l.jsx(Tk,{devTools:je}),o==="nestedcontext"&&l.jsx(Dk,{devTools:je}),o==="modalscope"&&l.jsx(Rk,{devTools:je}),o==="namedactions"&&l.jsx(Ok,{devTools:je})]}),l.jsxs("div",{className:"g7dt-footer",children:[l.jsx("span",{children:"Ctrl+Shift+G 토글 | 헤더 드래그로 이동"}),l.jsxs("span",{children:["액션: ",f.length," | 캐시 히트율: ",(y.hitRate*100).toFixed(1),"%"]})]})]}):l.jsx("button",{onClick:()=>t(!0),className:"g7dt-floating-btn",title:"G7 DevTools (Ctrl+Shift+G)",children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}):e?l.jsxs("div",{className:"g7dt-disabled-notice",children:[l.jsxs("div",{className:"g7dt-flex g7dt-items-center g7dt-justify-between g7dt-mb-2",children:[l.jsx("span",{className:"g7dt-font-bold g7dt-text-yellow",children:"G7 DevTools"}),l.jsx("button",{onClick:()=>t(!1),className:"g7dt-btn",children:"✕"})]}),l.jsx("p",{className:"g7dt-text-sm g7dt-text-gray",children:"DevTools가 비활성화되어 있습니다."}),l.jsx("p",{className:"g7dt-text-xs g7dt-text-gray-dark g7dt-mt-2",children:"환경설정 > 고급 설정 > 디버그 모드를 켜세요."})]}):null},Mk=["display","visibility","opacity","position","zIndex","overflow","width","height","backgroundColor","color"],_r=class _r{constructor(){H(this,"enabled",!1);H(this,"trackedComponents",new Map);H(this,"mutationObserver",null);H(this,"scanInterval",null);H(this,"devTools");this.devTools=ka.getInstance()}static getInstance(){return _r.instance||(_r.instance=new _r),_r.instance}enable(){this.enabled||(this.enabled=!0,this.setupMutationObserver(),this.scanInterval=setInterval(()=>{this.scanVisibleComponents()},5e3),console.log("[StyleTracker] 스타일 추적 활성화됨"))}disable(){this.enabled&&(this.enabled=!1,this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.scanInterval&&(clearInterval(this.scanInterval),this.scanInterval=null),this.trackedComponents.clear(),console.log("[StyleTracker] 스타일 추적 비활성화됨"))}trackComponent(e,t,a){if(!this.enabled||!this.devTools.isEnabled()||!a)return;const i=this.extractClasses(a),o=this.getComputedStyles(a);this.devTools.trackComponentStyle(e,t,i,o),this.trackedComponents.set(e,{componentId:e,componentName:t,classes:i,computedStyles:o,element:new WeakRef(a),timestamp:Date.now()}),this.detectIssues(e,t,a,i,o)}untrackComponent(e){this.trackedComponents.delete(e)}scanVisibleComponents(){if(!this.enabled||!this.devTools.isEnabled())return;(this.devTools.getLifecycleInfo().mountedComponents||[]).forEach(i=>{const o=i.id,d=i.name;let g=null;if(o&&(g=document.getElementById(o)),!g&&o&&(g=document.querySelector(`[data-component-id="${o}"]`)),!g&&o&&(g=document.querySelector(`[data-editor-id="${o}"]`)),!g)return;const h=this.extractClasses(g),f=this.getComputedStyles(g);this.devTools.trackComponentStyle(o,d,h,f),this.detectIssues(o,d,g,h,f),this.trackedComponents.set(o,{componentId:o,componentName:d,classes:h,computedStyles:f,element:new WeakRef(g),timestamp:Date.now()})}),document.querySelectorAll('[data-editor-id], [id^="comp-"]').forEach(i=>{if(!(i instanceof HTMLElement))return;const o=i.getAttribute("data-editor-id")||i.id,d=i.getAttribute("data-editor-name")||i.tagName;if(!o||this.trackedComponents.has(o))return;const g=this.extractClasses(i),h=this.getComputedStyles(i);this.devTools.trackComponentStyle(o,d,g,h),this.detectIssues(o,d,i,g,h),this.trackedComponents.set(o,{componentId:o,componentName:d,classes:g,computedStyles:h,element:new WeakRef(i),timestamp:Date.now()})})}detectIssues(e,t,a,i,o){o.display==="none"&&this.addIssue({type:"invisible-element",componentId:e,componentName:t,property:"display",currentValue:"none",severity:"info",description:"요소가 display:none으로 숨겨져 있습니다",suggestion:"의도적인 숨김이 아니라면 조건부 렌더링(if)을 확인하세요"}),o.visibility==="hidden"&&this.addIssue({type:"invisible-element",componentId:e,componentName:t,property:"visibility",currentValue:"hidden",severity:"info",description:"요소가 visibility:hidden으로 숨겨져 있습니다",suggestion:"공간은 유지되지만 보이지 않습니다. 의도적인지 확인하세요"}),o.opacity==="0"&&this.addIssue({type:"invisible-element",componentId:e,componentName:t,property:"opacity",currentValue:"0",severity:"warning",description:"요소가 opacity:0으로 투명합니다",suggestion:"애니메이션 상태가 아니라면 스타일을 확인하세요"}),(o.width==="0px"||o.height==="0px")&&this.addIssue({type:"invisible-element",componentId:e,componentName:t,property:o.width==="0px"?"width":"height",currentValue:"0px",severity:"warning",description:"요소의 크기가 0입니다",suggestion:"컨텐츠가 있는데 크기가 0이라면 레이아웃 문제일 수 있습니다"}),o.overflow==="hidden"&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight)&&this.addIssue({type:"overflow-hidden",componentId:e,componentName:t,property:"overflow",currentValue:"hidden",severity:"warning",description:"컨텐츠가 overflow:hidden으로 잘리고 있습니다",suggestion:"overflow-auto 또는 컨테이너 크기를 확인하세요"});const d=i.some(S=>S.startsWith("dark:"));i.some(S=>(S.startsWith("bg-white")||S.startsWith("bg-gray-"))&&!S.startsWith("dark:"))&&!d&&this.addIssue({type:"dark-mode-missing",componentId:e,componentName:t,property:"className",currentValue:i.filter(S=>S.startsWith("bg-")).join(" "),severity:"info",description:"다크 모드 변형 클래스가 누락되었을 수 있습니다",suggestion:"bg-white 사용 시 dark:bg-gray-800 등을 함께 지정하세요"});const h=parseInt(o.zIndex,10);!isNaN(h)&&h>50&&o.position!=="static"&&this.addIssue({type:"z-index-conflict",componentId:e,componentName:t,property:"z-index",currentValue:o.zIndex,severity:"info",description:`높은 z-index(${h})가 설정되어 있습니다`,suggestion:"z-index 충돌을 피하려면 10, 20, 30, 40, 50 단위를 사용하세요"});const f=i.some(S=>S.startsWith("sm:")||S.startsWith("md:")||S.startsWith("lg:")||S.startsWith("xl:")),p=i.includes("hidden"),y=i.includes("portable:block")||i.includes("portable:flex"),x=i.includes("desktop:block")||i.includes("desktop:flex");p&&!f&&!y&&!x&&this.addIssue({type:"responsive-issue",componentId:e,componentName:t,property:"className",currentValue:"hidden",severity:"info",description:"반응형 표시 클래스 없이 hidden이 설정되어 있습니다",suggestion:"조건에 따라 표시하려면 sm:block, desktop:flex 등을 추가하세요"})}addIssue(e){this.devTools.addStyleIssue(e)}extractClasses(e){return(e.getAttribute("class")||"").split(/\s+/).filter(Boolean)}getComputedStyles(e){const t=window.getComputedStyle(e),a={};for(const i of Mk)a[i]=t.getPropertyValue(i.replace(/([A-Z])/g,"-$1").toLowerCase());return a}setupMutationObserver(){typeof MutationObserver>"u"||(this.mutationObserver=new MutationObserver(e=>{let t=!1;for(const a of e){if(a.type==="childList"&&a.addedNodes.length>0){t=!0;break}if(a.type==="attributes"&&(a.attributeName==="class"||a.attributeName==="style")){t=!0;break}}t&&setTimeout(()=>this.scanVisibleComponents(),100)}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style"]}))}fullScan(){return this.scanVisibleComponents(),this.devTools.getStyleValidationInfo().issues}getIssues(){return this.devTools.getStyleValidationInfo().issues}getIssuesForComponent(e){return this.getIssues().filter(t=>t.componentId===e)}clear(){this.trackedComponents.clear(),this.devTools.clearStyleValidationData()}};H(_r,"instance",null);let qg=_r;function $k(){return qg.getInstance()}function Ik(r={}){const{checked:e,value:t,name:a,type:i="checkbox"}=r,o={checked:e??!1,value:t??String(e??""),name:a??"",type:i};return{target:o,currentTarget:o,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 zk(r={}){const{button:e=0,clientX:t=0,clientY:a=0}=r;return{button:e,clientX:t,clientY:a,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new MouseEvent("click"),bubbles:!0,cancelable:!0,defaultPrevented:!1,eventPhase:Event.AT_TARGET,isTrusted:!1,timeStamp:Date.now(),type:"click",isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,persist:()=>{},target:document.createElement("div"),currentTarget:document.createElement("div")}}function Hk(){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 Pk(r,e="keydown"){return{key:r,code:r.length===1?`Key${r.toUpperCase()}`:r,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new KeyboardEvent(e,{key:r}),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 Bk={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 lx(r){const e=r.replace(/^(dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+/,"");for(const[t,a]of Object.entries(Bk))if(a.test(e))return t;return null}function cx(r){const e=r.match(/^((dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+)/);return e?e[1]:""}function Uk(r,e){if(!e||e.trim()==="")return r;if(!r||r.trim()==="")return e;const t=r.split(/\s+/).filter(Boolean),a=e.split(/\s+/).filter(Boolean),i=new Map;for(const d of a){const g=lx(d);if(g){const h=cx(d),f=`${g}:${h}`;i.set(f,d)}}return[...t.filter(d=>{const g=lx(d);if(!g)return!0;const h=cx(d),f=`${g}:${h}`;return!i.has(f)}),...a].join(" ")}function qk(r){return Object.entries(r).filter(([,e])=>e).map(([e])=>e).join(" ")}function Gk(...r){return r.filter(e=>typeof e=="string"&&e.length>0).join(" ")}const Ee=it("G7CoreGlobals");function Fk(){window.React=Ke,window.ReactDOM={...Hu,createPortal:Os.createPortal,unstable_batchedUpdates:r=>r()},window.ReactJSXRuntime=u7,Ee.log("전역 객체 window.React, window.ReactDOM, window.ReactJSXRuntime에 노출됨")}function Vk(r){const e=new Map,t=ka.getInstance();r.componentEvent={on:(a,i)=>(e.has(a)||e.set(a,new Set),e.get(a).add(i),t.trackEventSubscribe(a),()=>{e.get(a)?.delete(i),t.trackEventUnsubscribe(a)}),emit:async(a,i)=>{const o=e.get(a),d=o?.size??0;if(!o||o.size===0)return t.trackEventEmit(a,i,0),[];let g,h=[];try{h=await Promise.all(Array.from(o).map(async f=>{try{return await f(i)}catch(p){throw Ee.error(`componentEvent: Error in listener for "${a}":`,p),p}}))}catch(f){g=f instanceof Error?f:new Error(String(f))}if(t.trackEventEmit(a,i,d,h,g),g)throw g;return h},off:a=>{e.delete(a),t.trackEventOff(a)},clear:()=>{e.clear(),t.trackEventClear()}},Ee.log("전역 객체 window.G7Core.componentEvent에 노출됨")}function Kk(r,e){r.useTranslation=Tj,r.t=(t,a)=>{const i=e.getState();if(!i.translationEngine||!i.translationContext)return t;if(a){const o="|"+Object.entries(a).map(([d,g])=>`${d}=${g}`).join("|");return i.translationEngine.translate(t,i.translationContext,o)}return i.translationEngine.translate(t,i.translationContext)},Ee.log("전역 객체 window.G7Core.useTranslation에 노출됨")}function Wk(r,e){r.createChangeEvent=Ik,r.createClickEvent=zk,r.createSubmitEvent=Hk,r.createKeyboardEvent=Pk,r.uuid=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const a=Math.random()*16|0;return(t==="x"?a:a&3|8).toString(16)}),r.createLogger=it,Ee.log("전역 객체 window.G7Core.createLogger에 노출됨"),r.renderItemChildren=(t,a,i,o,d)=>{const g=e.getState(),p={_global:window.__templateApp?.getGlobalState?.()||{},_local:a._local||{},_computed:a._computed||{},...a},y=new Set,x=(v,w)=>{const k=p._global?._remountKeys;return v&&k?.[v]&&!y.has(v)?(y.add(v),`${v}-remount-${k[v]}`):v||w},S={translationContext:g.translationContext,translationEngine:g.translationEngine,bindingEngine:g.bindingEngine,actionDispatcher:g.actionDispatcher,getRemountKey:x,...d};return fo(t,p,i,o,S)},r.getComponentMap=()=>ba.getInstance().getComponentMap(),r.renderComponentLayout=(t,a,i)=>{if(!t||!Array.isArray(t)||t.length===0)return null;const o=ba.getInstance().getComponentMap(),d=e.getState(),h=window.__templateApp?.getGlobalState?.()||{},f={_global:h._global||{},_local:h._local||{},_computed:h._computed||{},...a},p=new Set,y=(x,S)=>{const v=f._global?._remountKeys;return x&&v?.[x]&&!p.has(x)?(p.add(x),`${x}-remount-${v[x]}`):x||S};return fo(t,f,o,i,{translationContext:d.translationContext,translationEngine:d.translationEngine,bindingEngine:d.bindingEngine,actionDispatcher:d.actionDispatcher,getRemountKey:y})},r.renderExpandContent=t=>{const{children:a,row:i,expandContext:o,componentContext:d,keyPrefix:g}=t;if(!a||!Array.isArray(a)||a.length===0)return null;const h=t.componentMap||ba.getInstance().getComponentMap(),f=e.getState(),p=r.state?.get?.()||{},y=d?.stateRef?.current??d?.state??{},x={...p._local||{},...y},S=d?.computedRef?.current??p._computed??{},v=f.bindingEngine??r.getDataBindingEngine?.(),w={...p,_local:x,_computed:S,row:i,item:i,$item:i};let k={};if(o&&typeof o=="object"&&v)try{for(const[D,$]of Object.entries(o))if(typeof $=="string"){const M=$.match(/^\{\{([^}]+)\}\}$/);if(M){const z=M[1].trim();try{k[D]=v.evaluateExpression(z,w,{skipCache:!0})}catch{k[D]=void 0}}else k[D]=v.resolveBindings($,w,{skipCache:!0})}else k[D]=$}catch(D){Ee.warn("renderExpandContent: expandContext 평가 오류:",D)}const A={row:i,item:i,$item:i,_local:x,_global:p._global||{},_computed:p._computed||{},...k},O=new Set,N=(D,$)=>{const M=A._global?._remountKeys;return D&&M?.[D]&&!O.has(D)?(O.add(D),`${D}-remount-${M[D]}`):D||$};return fo(a,A,h,g,{translationContext:f.translationContext,translationEngine:f.translationEngine??void 0,bindingEngine:f.bindingEngine??void 0,actionDispatcher:f.actionDispatcher,componentContext:d,getRemountKey:N})},r.$get=function(a,i,o=void 0){if(a==null)return o;const d=Array.isArray(i)?i:[i];if(d.length===0)return a;let g=a;for(const h of d){if(g==null||h==null)return o;g=g[h]}return g??o},Ee.log("전역 객체 window.G7Core.renderItemChildren에 노출됨"),Ee.log("전역 객체 window.G7Core.renderComponentLayout에 노출됨"),Ee.log("전역 객체 window.G7Core.renderExpandContent에 노출됨"),Ee.log("전역 객체 window.G7Core.$get에 노출됨")}function Yk(r){r.dispatch=async(e,t)=>{const a=window.__templateApp;if(!a)return Ee.warn("G7Core.dispatch: TemplateApp이 초기화되지 않았습니다."),{success:!1,error:new Error("TemplateApp이 초기화되지 않았습니다.")};const i=a.getActionDispatcher?.();if(!i)return Ee.warn("G7Core.dispatch: ActionDispatcher를 찾을 수 없습니다."),{success:!1,error:new Error("ActionDispatcher를 찾을 수 없습니다.")};const o=a.getRouter?.(),d=a.getGlobalState?.(),g=a.setGlobalState?.bind(a),f=t?.componentContext||window.__g7ActionContext,p=window.__g7PendingLocalState;let y=f?.state??d;p&&f&&(y=p,Ee.log("[dispatch] Using __g7PendingLocalState for context.state:",p));let x=f?.data??d;p&&f?.data?._local&&(x={...f.data,_local:p},Ee.log("[dispatch] Updated context.data._local with pendingLocalState"));const S={navigate:o?(v,w)=>o.navigate(v,w):void 0,setState:f?.setState??g,state:y,data:x,_isDispatchFallbackContext:!f?.setState};if(e.debounce){const v=e.debounceKey||`dispatch-${e.handler}`,w=typeof e.debounce=="number"?e.debounce:e.debounce.delay;return i.debouncedCall(v,w,()=>{const{debounce:k,debounceKey:A,...O}=e;i.dispatchAction(O,S)}),{success:!0,debounced:!0}}try{return await i.dispatchAction(e,S)}catch(v){return Ee.error("G7Core.dispatch: 액션 실행 오류:",v),{success:!1,error:v instanceof Error?v:new Error(String(v))}}},Ee.log("전역 객체 window.G7Core.dispatch에 노출됨")}function Hc(r){const e={};for(const[t,a]of Object.entries(r))if(t.includes(".")){const i=t.split(".");let o=e;for(let d=0;d